From owner-svn-src-all@freebsd.org Sun Feb 11 00:10:34 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E2F8BF09965; Sun, 11 Feb 2018 00:10:33 +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 96D6A7A2E9; Sun, 11 Feb 2018 00:10:33 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (ralph.baldwin.cx [66.234.199.215]) by mail.baldwin.cx (Postfix) with ESMTPSA id F3EC310A7DB; Sat, 10 Feb 2018 19:10:31 -0500 (EST) From: John Baldwin To: Alexey Dokuchaev Cc: Warner Losh , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers , Warner Losh Subject: Re: svn commit: r329064 - head/share/zoneinfo Date: Sat, 10 Feb 2018 16:02:48 -0800 Message-ID: <9220095.UvqZmaNGKz@ralph.baldwin.cx> User-Agent: KMail/4.14.10 (FreeBSD/11.1-STABLE; KDE/4.14.30; amd64; ; ) In-Reply-To: <20180209190450.GA85711@FreeBSD.org> References: <201802091550.w19FoXEb018181@repo.freebsd.org> <20180209190450.GA85711@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); Sat, 10 Feb 2018 19:10:32 -0500 (EST) X-Virus-Scanned: clamav-milter 0.99.2 at mail.baldwin.cx X-Virus-Status: Clean X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Feb 2018 00:10:34 -0000 On Friday, February 09, 2018 07:04:50 PM Alexey Dokuchaev wrote: > On Fri, Feb 09, 2018 at 11:50:35AM -0700, Warner Losh wrote: > > On Fri, Feb 9, 2018 at 10:49 AM, John Baldwin wrote: > > > On Friday, February 09, 2018 03:50:33 PM Warner Losh wrote: > > > > New Revision: 329064 > > > > URL: https://svnweb.freebsd.org/changeset/base/329064 > > > > > > > > Log: > > > > We don't actually need env here, so drop it. All shells allow setting > > > > of shell variables for the next command like this. > > > > > > Eh: > > > > > > % LC_ALL=C env > > > LC_ALL=C: Command not found. > > > > > > csh and tcsh don't let you set environment variables as a prefix. > > > > > > That said, if you try to use csh as the SHELL for make I bet many things > > > would break. > > > > Right, all shells supported as SHELL for make. csh isn't on the list of > > supported shells. Your bet is right: a lot of things do break. > > I don't really understand why we're discussing it: (t)csh, fish, whatever > are for interactive use *only*. Scripts (and makefiles) should only be > written for standard plain POSIX shell. I think the trigger is that "All shells" is a bit ambiguous. "All shells supported by make" or some such would have been clearer. -- John Baldwin From owner-svn-src-all@freebsd.org Sun Feb 11 02:27:53 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ED24EF10DE5; Sun, 11 Feb 2018 02:27:52 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9BD167E8A6; Sun, 11 Feb 2018 02:27:52 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7C4571CA94; Sun, 11 Feb 2018 02:27:52 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1B2RqgS089759; Sun, 11 Feb 2018 02:27:52 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1B2RoFg089740; Sun, 11 Feb 2018 02:27:50 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201802110227.w1B2RoFg089740@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sun, 11 Feb 2018 02:27:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r329114 - in stable/11: . lib/libstand sbin/geom/class/eli share/mk sys/boot sys/boot/arm/uboot sys/boot/common sys/boot/efi/boot1 sys/boot/efi/include sys/boot/efi/libefi sys/boot/efi/... X-SVN-Group: stable-11 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in stable/11: . lib/libstand sbin/geom/class/eli share/mk sys/boot sys/boot/arm/uboot sys/boot/common sys/boot/efi/boot1 sys/boot/efi/include sys/boot/efi/libefi sys/boot/efi/loader sys/boot/efi/loade... X-SVN-Commit-Revision: 329114 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Feb 2018 02:27:53 -0000 Author: kevans Date: Sun Feb 11 02:27:50 2018 New Revision: 329114 URL: https://svnweb.freebsd.org/changeset/base/329114 Log: MFC Loader Fixes 2017q3: r320547,r320553,r321621,r321844,r321969,r321991, r322037,r322038,r322039,r322040,r322056,r322074,r322542,r322592,r322593, r322896,r322923,r323671,r322930,r322931,r322932,r322933,r322934,r322935, r322936,r322937,r322938,r322939,r322941,r323062,r323063,r323064,r323065, r323100,r323131,r323174,r323258,r323261,r323272,r323367,r323379,r323389, r323407,r323428,r323436,r323494,r323496,r323497,r323541,r323554,r323589, r323707,r323867,r323885,r323886,r323895,r323896,r323897,r323905,r323906, r323907,r323908,r323909,r323952,r323991,r324099,r324558,r326445,r326609, r326610 This batch includes a special kludge to fix powerpc loader build; was included after there, causing problems with DEBUG_MALLOC bits. Include a little bit earlier to fix the build with the intention of removing this when eventually libsa silently replaces stdlib.h with stand.h. r320547: Link EFI/uboot loaders with -znotext r320553: Integer underflow in efipart_realstrategy when I/O starts after end of disk r321621: Always set the receive mask in loader.efi. r321844: Clean up style in print_state(..) and pager_printf(..) r321969: Fix the return types for printf and putchar to match their libc r321991: Revert r321969 r322037: Add stpcpy and stpncpy to libstand r322038: Add definitions and utilities for EFI drivers r322039: Move EFI ZFS functions to libefi r322040: Add EFI utility functions to libefi r322056: Move EFI fmtdev functionality to libefi r322074: libefi/time.c cstyle cleanup r322542: loader.efi: repace XXX with real comments in trap.c r322592: Remove unused defines. r322593: Define proposed GUID for FreeBSD boot loader variables. r322896: Make spinconsole platform independent and hook it up into EFI loader r322923: Hide length of geli passphrase during boot. r323671: Fix language used in the r322923. r322930: Move efi_main into efi/loader r322931: Cleanup efi_main return type r322932: Use the loader.efi conventions for the various EFI tables. r322933: No need for MK_ZFS around these: they are by their nature only active when MK_ZFS is true. r322934: _STAND is sometimes defined on the command line. Make the define here match. r322935: Fix warnings due to type mismatch. r322936: Remove useless 'static' for an enum definition. r322937: Forward declare struct dsk to avoid warnings when building libi386. r322938: Link in libefi for boot1 r322939: Use efi_devpath_str for debug path info. r322941: Eliminate redunant device path matching. r323062: Make efichar.c routines available to libefi. r323063: boot1.efi: print more info about where boot1.efi is loaded from r323064: Exit rather than panic for most errors. r323065: Save where we're booted from r323100: libstand: nfs_readlink() should return proper return code r323131: Revert r322941: Eliminate redundant device matching functions r323174: Fix loader bug causing too many pages allocation when bootloader is U-Boot r323258: ucs2len r323261: Fix armv6 build r323272: Be consistent and do return (1); r323367: Mark init_chroot and init_script variables as deprecated. r323379: It's been pointed out that init_script at least is useful w/o r323389: loader.efi: chain loader should provide proper device handle r323407: boot1 generate-fat: generate all templates at once r323428: r323389 breaks the kernel build when WITHOUT_ZFS is defined in src.conf r323436: boot1: remove BOOT1_MAXSIZE default value r323494: loader should support large_dnode r323496: libstand: tftp_open() can leak pkt on error r323497: libefi: efipart_open should check the status from disk_open r323541: libefi: efipart_realstrategy rsize pointer may be NULL r323554: Increase EFI boot file size frok 128k to 384k r323589: loader: biosmem.c cstyle cleanup r323707: loader: biosmem allocate heap just below 4GB r323867: libefi: devicename.c cleanups r323885: libefi: efi_devpath_match() should return bool r323886: libefi: efipart.c should use calloc() r323895: libefi: efi_devpath_match local len should be unsigned r323896: r323885 did miss efilib.h update r323897: efilib.h: typo in structure member description r323905: libefi: pdinfo_t pd_unit and pd_open should be unsigned r323906: libefi: efipart_strategy() should return ENXIO when there is no media r323907: libefi: efipart.c cstyle fix for efipart_print_common() r323908: libefi: efipart_hdinfo_add_filepath should check strtol result r323909: libefi: define EISA PNP constants r323952: After the r317886 support for TFTP and NFS can be enable simultaneously. r323991: libefi: efipart_floppy() will should not pass acpi pointer if the HID test fails r324099: Compile loader as Little-Endian on PPC64/POWER8 r324558: Define prototype for exit and ensure references r326445: Fix random() and srandom() prototypes to match the standard. r326609: Make putenv and getenv match the userland definition r326610: Fix random() prototype to match the system. PR: 219000 221001 222215 Relnotes: yes ("The length of the geli passphrase is hidden during boot") Added: stable/11/sys/boot/efi/boot1/fat-amd64.tmpl.xz - copied unchanged from r323554, head/sys/boot/efi/boot1/fat-amd64.tmpl.xz stable/11/sys/boot/efi/boot1/fat-arm.tmpl.xz - copied unchanged from r323554, head/sys/boot/efi/boot1/fat-arm.tmpl.xz stable/11/sys/boot/efi/boot1/fat-arm64.tmpl.xz - copied unchanged from r323554, head/sys/boot/efi/boot1/fat-arm64.tmpl.xz stable/11/sys/boot/efi/boot1/fat-i386.tmpl.xz - copied unchanged from r323554, head/sys/boot/efi/boot1/fat-i386.tmpl.xz stable/11/sys/boot/efi/include/efi_driver_utils.h - copied unchanged from r322038, head/sys/boot/efi/include/efi_driver_utils.h stable/11/sys/boot/efi/include/efi_drivers.h - copied unchanged from r322038, head/sys/boot/efi/include/efi_drivers.h stable/11/sys/boot/efi/include/efizfs.h - copied, changed from r322039, head/sys/boot/efi/include/efizfs.h stable/11/sys/boot/efi/libefi/devicename.c - copied, changed from r322056, head/sys/boot/efi/libefi/devicename.c stable/11/sys/boot/efi/libefi/efi_driver_utils.c - copied unchanged from r322038, head/sys/boot/efi/libefi/efi_driver_utils.c stable/11/sys/boot/efi/libefi/efizfs.c - copied, changed from r322039, head/sys/boot/efi/libefi/efizfs.c stable/11/sys/boot/efi/loader/efi_main.c - copied, changed from r322930, head/sys/boot/efi/loader/efi_main.c Deleted: stable/11/sys/boot/efi/boot1/fat-amd64.tmpl.bz2.uu stable/11/sys/boot/efi/boot1/fat-arm.tmpl.bz2.uu stable/11/sys/boot/efi/boot1/fat-arm64.tmpl.bz2.uu stable/11/sys/boot/efi/boot1/fat-i386.tmpl.bz2.uu stable/11/sys/boot/efi/loader/devicename.c Modified: stable/11/UPDATING stable/11/lib/libstand/Makefile stable/11/lib/libstand/environment.c stable/11/lib/libstand/libstand.3 stable/11/lib/libstand/nfs.c stable/11/lib/libstand/random.c stable/11/lib/libstand/stand.h stable/11/lib/libstand/tftp.c stable/11/sbin/geom/class/eli/geli.8 stable/11/sbin/geom/class/eli/geom_eli.c stable/11/share/mk/src.opts.mk stable/11/sys/boot/Makefile.inc stable/11/sys/boot/arm/uboot/Makefile stable/11/sys/boot/arm/uboot/conf.c stable/11/sys/boot/common/loader.8 stable/11/sys/boot/efi/boot1/Makefile stable/11/sys/boot/efi/boot1/Makefile.fat stable/11/sys/boot/efi/boot1/boot1.c stable/11/sys/boot/efi/boot1/boot_module.h stable/11/sys/boot/efi/boot1/generate-fat.sh stable/11/sys/boot/efi/boot1/ufs_module.c stable/11/sys/boot/efi/boot1/zfs_module.c stable/11/sys/boot/efi/include/efi.h stable/11/sys/boot/efi/include/efiapi.h stable/11/sys/boot/efi/include/efichar.h stable/11/sys/boot/efi/include/efidevp.h stable/11/sys/boot/efi/include/efilib.h stable/11/sys/boot/efi/include/efiprot.h stable/11/sys/boot/efi/libefi/Makefile stable/11/sys/boot/efi/libefi/devpath.c stable/11/sys/boot/efi/libefi/efichar.c stable/11/sys/boot/efi/libefi/efinet.c stable/11/sys/boot/efi/libefi/efipart.c stable/11/sys/boot/efi/libefi/errno.c stable/11/sys/boot/efi/libefi/libefi.c stable/11/sys/boot/efi/libefi/time.c stable/11/sys/boot/efi/loader/Makefile stable/11/sys/boot/efi/loader/arch/amd64/Makefile.inc stable/11/sys/boot/efi/loader/arch/amd64/trap.c stable/11/sys/boot/efi/loader/arch/i386/Makefile.inc stable/11/sys/boot/efi/loader/bootinfo.c stable/11/sys/boot/efi/loader/conf.c stable/11/sys/boot/efi/loader/loader_efi.h stable/11/sys/boot/efi/loader/main.c stable/11/sys/boot/geli/geliboot.c stable/11/sys/boot/geli/geliboot.h stable/11/sys/boot/geli/geliboot_crypto.c stable/11/sys/boot/geli/geliboot_internal.h stable/11/sys/boot/geli/pwgets.c stable/11/sys/boot/i386/libi386/Makefile stable/11/sys/boot/i386/libi386/biosdisk.c stable/11/sys/boot/i386/libi386/biosmem.c stable/11/sys/boot/i386/libi386/spinconsole.c stable/11/sys/boot/mips/uboot/conf.c stable/11/sys/boot/powerpc/ofw/conf.c stable/11/sys/boot/powerpc/ofw/ofwfdt.c stable/11/sys/boot/powerpc/uboot/conf.c stable/11/sys/boot/userboot/test/test.c stable/11/sys/boot/userboot/userboot.h stable/11/sys/boot/userboot/userboot/main.c stable/11/sys/boot/zfs/zfsimpl.c stable/11/sys/cddl/boot/zfs/zfsimpl.h stable/11/sys/geom/eli/g_eli.c stable/11/sys/geom/eli/g_eli.h stable/11/sys/geom/eli/g_eli_ctl.c stable/11/usr.sbin/bhyveload/bhyveload.c Directory Properties: stable/11/ (props changed) Modified: stable/11/UPDATING ============================================================================== --- stable/11/UPDATING Sat Feb 10 22:36:42 2018 (r329113) +++ stable/11/UPDATING Sun Feb 11 02:27:50 2018 (r329114) @@ -16,6 +16,10 @@ from older versions of FreeBSD, try WITHOUT_CLANG and the tip of head, and then rebuild without this option. The bootstrap process from older version of current across the gcc/clang cutover is a bit fragile. +20180210: + The geli password typed at boot is now hidden. To restore the previous + behavior, see geli(8) for configuration options. + 20180113: The SW_WATCHDOG option is no longer necessary to enable the hardclock-based software watchdog if no hardware watchdog is Modified: stable/11/lib/libstand/Makefile ============================================================================== --- stable/11/lib/libstand/Makefile Sat Feb 10 22:36:42 2018 (r329113) +++ stable/11/lib/libstand/Makefile Sun Feb 11 02:27:50 2018 (r329114) @@ -41,7 +41,7 @@ SRCS+= ntoh.c .PATH: ${LIBC_SRC}/string SRCS+= bcmp.c bcopy.c bzero.c ffs.c fls.c \ memccpy.c memchr.c memcmp.c memcpy.c memmove.c memset.c \ - qdivrem.c strcat.c strchr.c strcmp.c strcpy.c \ + qdivrem.c strcat.c strchr.c strcmp.c strcpy.c stpcpy.c stpncpy.c \ strcspn.c strlcat.c strlcpy.c strlen.c strncat.c strncmp.c strncpy.c \ strnlen.c strpbrk.c strrchr.c strsep.c strspn.c strstr.c strtok.c swab.c .if ${MACHINE_CPUARCH} == "arm" Modified: stable/11/lib/libstand/environment.c ============================================================================== --- stable/11/lib/libstand/environment.c Sat Feb 10 22:36:42 2018 (r329113) +++ stable/11/lib/libstand/environment.c Sun Feb 11 02:27:50 2018 (r329114) @@ -162,7 +162,7 @@ setenv(const char *name, const char *value, int overwr } int -putenv(const char *string) +putenv(char *string) { char *value, *copy; int result; Modified: stable/11/lib/libstand/libstand.3 ============================================================================== --- stable/11/lib/libstand/libstand.3 Sat Feb 10 22:36:42 2018 (r329113) +++ stable/11/lib/libstand/libstand.3 Sun Feb 11 02:27:50 2018 (r329114) @@ -110,7 +110,7 @@ for set/unset hook functions. .Xc .It Xo .Ft int -.Fn putenv "const char *string" +.Fn putenv "char *string" .Xc .It Xo .Ft int @@ -172,7 +172,7 @@ may be used to prevent a variable being unset. .Fn srandom "unsigned long seed" .Xc .It Xo -.Ft "unsigned long" +.Ft "long" .Fn random void .Xc .It Xo Modified: stable/11/lib/libstand/nfs.c ============================================================================== --- stable/11/lib/libstand/nfs.c Sat Feb 10 22:36:42 2018 (r329113) +++ stable/11/lib/libstand/nfs.c Sun Feb 11 02:27:50 2018 (r329114) @@ -382,7 +382,7 @@ nfs_readlink(struct nfs_iodesc *d, char *buf) buf[repl->len] = 0; done: free(pkt); - return (0); + return (rc); } #endif Modified: stable/11/lib/libstand/random.c ============================================================================== --- stable/11/lib/libstand/random.c Sat Feb 10 22:36:42 2018 (r329113) +++ stable/11/lib/libstand/random.c Sun Feb 11 02:27:50 2018 (r329114) @@ -48,8 +48,8 @@ srandom(seed) * and whatever else we might use it for. The result is uniform on * [0, 2^31 - 1]. */ -u_long -random() +long +random(void) { long x, hi, lo, t; Modified: stable/11/lib/libstand/stand.h ============================================================================== --- stable/11/lib/libstand/stand.h Sat Feb 10 22:36:42 2018 (r329113) +++ stable/11/lib/libstand/stand.h Sun Feb 11 02:27:50 2018 (r329114) @@ -282,7 +282,7 @@ extern ssize_t write(int, void *, size_t); extern struct dirent *readdirfd(int); extern void srandom(u_long seed); -extern u_long random(void); +extern long random(void); /* imports from stdlib, locally modified */ extern long strtol(const char *, char **, int); @@ -330,7 +330,7 @@ extern int env_setenv(const char *name, int flags, extern char *getenv(const char *name); extern int setenv(const char *name, const char *value, int overwrite); -extern int putenv(const char *string); +extern int putenv(char *string); extern int unsetenv(const char *name); extern ev_sethook_t env_noset; /* refuse set operation */ @@ -376,6 +376,7 @@ extern int null_readdir(struct open_file *f, struct di * Machine dependent functions and data, must be provided or stubbed by * the consumer */ +extern void exit(int); extern int getchar(void); extern int ischar(void); extern void putchar(int); Modified: stable/11/lib/libstand/tftp.c ============================================================================== --- stable/11/lib/libstand/tftp.c Sat Feb 10 22:36:42 2018 (r329113) +++ stable/11/lib/libstand/tftp.c Sun Feb 11 02:27:50 2018 (r329114) @@ -467,6 +467,7 @@ tftp_open(const char *path, struct open_file *f) if (res) { free(tftpfile->path); + free(tftpfile->pkt); free(tftpfile); return (res); } Modified: stable/11/sbin/geom/class/eli/geli.8 ============================================================================== --- stable/11/sbin/geom/class/eli/geli.8 Sat Feb 10 22:36:42 2018 (r329113) +++ stable/11/sbin/geom/class/eli/geli.8 Sun Feb 11 02:27:50 2018 (r329114) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 3, 2016 +.Dd September 17, 2017 .Dt GELI 8 .Os .Sh NAME @@ -51,7 +51,7 @@ utility: .Pp .Nm .Cm init -.Op Fl bgPTv +.Op Fl bdgPTv .Op Fl a Ar aalgo .Op Fl B Ar backupfile .Op Fl e Ar ealgo @@ -88,7 +88,7 @@ utility: .Ar prov .Nm .Cm configure -.Op Fl bBgGtT +.Op Fl bBdDgGtT .Ar prov ... .Nm .Cm setkey @@ -279,6 +279,11 @@ To inhibit backups, you can use .Pa none as the .Ar backupfile . +.It Fl d +When entering the passphrase to boot from this encrypted root filesystem, echo +.Ql * +characters. +This makes the length of the passphrase visible. .It Fl e Ar ealgo Encryption algorithm to use. Currently supported algorithms are: @@ -490,6 +495,15 @@ For more information, see the description of the subcommand. .It Fl B Remove the BOOT flag from the given providers. +.It Fl d +When entering the passphrase to boot from this encrypted root filesystem, echo +.Ql * +characters. +This makes the length of the passphrase visible. +.It Fl D +Disable echoing of any characters when a passphrase is entered to boot from this +encrypted root filesystem. +This hides the passphrase length. .It Fl g Enable booting from this encrypted root filesystem. The boot loader prompts for the passphrase and loads Modified: stable/11/sbin/geom/class/eli/geom_eli.c ============================================================================== --- stable/11/sbin/geom/class/eli/geom_eli.c Sat Feb 10 22:36:42 2018 (r329113) +++ stable/11/sbin/geom/class/eli/geom_eli.c Sun Feb 11 02:27:50 2018 (r329114) @@ -82,7 +82,7 @@ static int eli_backup_create(struct gctl_req *req, con /* * Available commands: * - * init [-bgPTv] [-a aalgo] [-B backupfile] [-e ealgo] [-i iterations] [-l keylen] [-J newpassfile] [-K newkeyfile] [-s sectorsize] [-V version] prov + * init [-bdgPTv] [-a aalgo] [-B backupfile] [-e ealgo] [-i iterations] [-l keylen] [-J newpassfile] [-K newkeyfile] [-s sectorsize] [-V version] prov * label - alias for 'init' * attach [-dprv] [-j passfile] [-k keyfile] prov * detach [-fl] prov ... @@ -107,6 +107,7 @@ struct g_command class_commands[] = { { 'a', "aalgo", "", G_TYPE_STRING }, { 'b', "boot", NULL, G_TYPE_BOOL }, { 'B', "backupfile", "", G_TYPE_STRING }, + { 'd', "displaypass", NULL, G_TYPE_BOOL }, { 'e', "ealgo", "", G_TYPE_STRING }, { 'g', "geliboot", NULL, G_TYPE_BOOL }, { 'i', "iterations", "-1", G_TYPE_NUMBER }, @@ -119,13 +120,14 @@ struct g_command class_commands[] = { { 'V', "mdversion", "-1", G_TYPE_NUMBER }, G_OPT_SENTINEL }, - "[-bgPTv] [-a aalgo] [-B backupfile] [-e ealgo] [-i iterations] [-l keylen] [-J newpassfile] [-K newkeyfile] [-s sectorsize] [-V version] prov" + "[-bdgPTv] [-a aalgo] [-B backupfile] [-e ealgo] [-i iterations] [-l keylen] [-J newpassfile] [-K newkeyfile] [-s sectorsize] [-V version] prov" }, { "label", G_FLAG_VERBOSE, eli_main, { { 'a', "aalgo", "", G_TYPE_STRING }, { 'b', "boot", NULL, G_TYPE_BOOL }, { 'B', "backupfile", "", G_TYPE_STRING }, + { 'd', "displaypass", NULL, G_TYPE_BOOL }, { 'e', "ealgo", "", G_TYPE_STRING }, { 'g', "geliboot", NULL, G_TYPE_BOOL }, { 'i', "iterations", "-1", G_TYPE_NUMBER }, @@ -182,13 +184,15 @@ struct g_command class_commands[] = { { { 'b', "boot", NULL, G_TYPE_BOOL }, { 'B', "noboot", NULL, G_TYPE_BOOL }, + { 'd', "displaypass", NULL, G_TYPE_BOOL }, + { 'D', "nodisplaypass", NULL, G_TYPE_BOOL }, { 'g', "geliboot", NULL, G_TYPE_BOOL }, { 'G', "nogeliboot", NULL, G_TYPE_BOOL }, { 't', "trim", NULL, G_TYPE_BOOL }, { 'T', "notrim", NULL, G_TYPE_BOOL }, G_OPT_SENTINEL }, - "[-bBgGtT] prov ..." + "[-bBdDgGtT] prov ..." }, { "setkey", G_FLAG_VERBOSE, eli_main, { @@ -708,6 +712,8 @@ eli_init(struct gctl_req *req) md.md_flags |= G_ELI_FLAG_BOOT; if (gctl_get_int(req, "geliboot")) md.md_flags |= G_ELI_FLAG_GELIBOOT; + if (gctl_get_int(req, "displaypass")) + md.md_flags |= G_ELI_FLAG_GELIDISPLAYPASS; if (gctl_get_int(req, "notrim")) md.md_flags |= G_ELI_FLAG_NODELETE; md.md_ealgo = CRYPTO_ALGORITHM_MIN - 1; @@ -912,7 +918,7 @@ eli_attach(struct gctl_req *req) static void eli_configure_detached(struct gctl_req *req, const char *prov, int boot, - int geliboot, int trim) + int geliboot, int displaypass, int trim) { struct g_eli_metadata md; bool changed = 0; @@ -948,6 +954,21 @@ eli_configure_detached(struct gctl_req *req, const cha changed = 1; } + if (displaypass == 1 && (md.md_flags & G_ELI_FLAG_GELIDISPLAYPASS)) { + if (verbose) + printf("GELIDISPLAYPASS flag already configured for %s.\n", prov); + } else if (displaypass == 0 && + !(md.md_flags & G_ELI_FLAG_GELIDISPLAYPASS)) { + if (verbose) + printf("GELIDISPLAYPASS flag not configured for %s.\n", prov); + } else if (displaypass >= 0) { + if (displaypass) + md.md_flags |= G_ELI_FLAG_GELIDISPLAYPASS; + else + md.md_flags &= ~G_ELI_FLAG_GELIDISPLAYPASS; + changed = 1; + } + if (trim == 0 && (md.md_flags & G_ELI_FLAG_NODELETE)) { if (verbose) printf("TRIM disable flag already configured for %s.\n", prov); @@ -971,8 +992,9 @@ static void eli_configure(struct gctl_req *req) { const char *prov; - bool boot, noboot, geliboot, nogeliboot, trim, notrim; - int doboot, dogeliboot, dotrim; + bool boot, noboot, geliboot, nogeliboot, displaypass, nodisplaypass; + bool trim, notrim; + int doboot, dogeliboot, dodisplaypass, dotrim; int i, nargs; nargs = gctl_get_int(req, "nargs"); @@ -985,6 +1007,8 @@ eli_configure(struct gctl_req *req) noboot = gctl_get_int(req, "noboot"); geliboot = gctl_get_int(req, "geliboot"); nogeliboot = gctl_get_int(req, "nogeliboot"); + displaypass = gctl_get_int(req, "displaypass"); + nodisplaypass = gctl_get_int(req, "nodisplaypass"); trim = gctl_get_int(req, "trim"); notrim = gctl_get_int(req, "notrim"); @@ -1008,6 +1032,16 @@ eli_configure(struct gctl_req *req) else if (nogeliboot) dogeliboot = 0; + dodisplaypass = -1; + if (displaypass && nodisplaypass) { + gctl_error(req, "Options -d and -D are mutually exclusive."); + return; + } + if (displaypass) + dodisplaypass = 1; + else if (nodisplaypass) + dodisplaypass = 0; + dotrim = -1; if (trim && notrim) { gctl_error(req, "Options -t and -T are mutually exclusive."); @@ -1018,7 +1052,8 @@ eli_configure(struct gctl_req *req) else if (notrim) dotrim = 0; - if (doboot == -1 && dogeliboot == -1 && dotrim == -1) { + if (doboot == -1 && dogeliboot == -1 && dodisplaypass == -1 && + dotrim == -1) { gctl_error(req, "No option given."); return; } @@ -1028,8 +1063,10 @@ eli_configure(struct gctl_req *req) /* Now the rest. */ for (i = 0; i < nargs; i++) { prov = gctl_get_ascii(req, "arg%d", i); - if (!eli_is_attached(prov)) - eli_configure_detached(req, prov, doboot, dogeliboot, dotrim); + if (!eli_is_attached(prov)) { + eli_configure_detached(req, prov, doboot, dogeliboot, + dodisplaypass, dotrim); + } } } Modified: stable/11/share/mk/src.opts.mk ============================================================================== --- stable/11/share/mk/src.opts.mk Sat Feb 10 22:36:42 2018 (r329113) +++ stable/11/share/mk/src.opts.mk Sun Feb 11 02:27:50 2018 (r329114) @@ -188,6 +188,7 @@ __DEFAULT_NO_OPTIONS = \ HESIOD \ LIBSOFT \ LINT \ + LOADER_FORCE_LE \ NAND \ OFED \ OPENLDAP \ Modified: stable/11/sys/boot/Makefile.inc ============================================================================== --- stable/11/sys/boot/Makefile.inc Sat Feb 10 22:36:42 2018 (r329113) +++ stable/11/sys/boot/Makefile.inc Sun Feb 11 02:27:50 2018 (r329114) @@ -1,6 +1,6 @@ # $FreeBSD$ -.include +.include SSP_CFLAGS= @@ -22,3 +22,11 @@ CFLAGS.clang+= -mfpu=none # when this test succeeds rather than require dd to be a bootstrap tool. DD_NOSTATUS!=(dd status=none count=0 2> /dev/null && echo status=none) || true DD=dd ${DD_NOSTATUS} + +.if ${MK_LOADER_FORCE_LE} != "no" + +.if ${MACHINE_ARCH} == "powerpc64" +CFLAGS+= -mlittle-endian +.endif + +.endif Modified: stable/11/sys/boot/arm/uboot/Makefile ============================================================================== --- stable/11/sys/boot/arm/uboot/Makefile Sat Feb 10 22:36:42 2018 (r329113) +++ stable/11/sys/boot/arm/uboot/Makefile Sun Feb 11 02:27:50 2018 (r329114) @@ -100,6 +100,7 @@ CLEANFILES+= loader.help CFLAGS+= -ffreestanding -msoft-float LDFLAGS= -nostdlib -static -T ${.CURDIR}/ldscript.${MACHINE_CPUARCH} +LDFLAGS+= -Wl,-znotext # Pull in common loader code .PATH: ${.CURDIR}/../../uboot/common Modified: stable/11/sys/boot/arm/uboot/conf.c ============================================================================== --- stable/11/sys/boot/arm/uboot/conf.c Sat Feb 10 22:36:42 2018 (r329113) +++ stable/11/sys/boot/arm/uboot/conf.c Sun Feb 11 02:27:50 2018 (r329114) @@ -36,6 +36,9 @@ __FBSDID("$FreeBSD$"); #include "dev_net.h" #endif +/* Make sure we have an explicit reference to exit so libsa's panic pulls in the MD exit */ +void (*exitfn)(int) = exit; + struct devsw *devsw[] = { #if defined(LOADER_DISK_SUPPORT) || defined(LOADER_CD9660_SUPPORT) &uboot_storage, Modified: stable/11/sys/boot/common/loader.8 ============================================================================== --- stable/11/sys/boot/common/loader.8 Sat Feb 10 22:36:42 2018 (r329113) +++ stable/11/sys/boot/common/loader.8 Sun Feb 11 02:27:50 2018 (r329114) @@ -487,6 +487,11 @@ That happens before entering single-user mode or multi mode (but after executing the .Va init_script if enabled). +This functionality has generally been eclipsed by rerooting. +See +.Xr reboot 8 +.Fl r +for details. .It Va init_path Sets the list of binaries which the kernel will try to run as the initial process. @@ -508,6 +513,11 @@ if the script terminates with a non-zero exit code, or if a SIGTERM is delivered to the .Xr init 8 process (PID 1). +This functionality has generally been eclipsed by rerooting. +See +.Xr reboot 8 +.Fl r +for details. .It Va init_shell Defines the shell binary to be used for executing the various shell scripts. The default is Modified: stable/11/sys/boot/efi/boot1/Makefile ============================================================================== --- stable/11/sys/boot/efi/boot1/Makefile Sat Feb 10 22:36:42 2018 (r329113) +++ stable/11/sys/boot/efi/boot1/Makefile Sun Feb 11 02:27:50 2018 (r329114) @@ -10,7 +10,13 @@ PROG= boot1.sym INTERNALPROG= WARNS?= 6 -.if ${MK_ZFS} != "no" +# We implement a slightly non-standard %S in that it always takes a +# CHAR16 that's common in UEFI-land instead of a wchar_t. This only +# seems to matter on arm64 where wchar_t defaults to an int instead +# of a short. There's no good cast to use here so just ignore the +# warnings for now. +CWARNFLAGS.boot1.c+= -Wno-format + # Disable warnings that are currently incompatible with the zfs boot code CWARNFLAGS.zfs_module.c += -Wno-array-bounds CWARNFLAGS.zfs_module.c += -Wno-cast-align @@ -25,7 +31,6 @@ CWARNFLAGS.skein.c += -Wno-missing-variable-declaratio .else if ${COMPILER_TYPE} == "gcc" CWARNFLAGS.skein.c += -Wno-missing-declarations .endif -.endif # architecture-specific loader code SRCS= boot1.c self_reloc.c start.S ufs_module.c @@ -68,7 +73,7 @@ FILES= boot1.efi boot1.efifat FILESMODE_boot1.efi= ${BINMODE} LDSCRIPT= ${.CURDIR}/../loader/arch/${MACHINE}/ldscript.${MACHINE} -LDFLAGS+= -Wl,-T${LDSCRIPT} -Wl,-Bsymbolic -shared +LDFLAGS+= -Wl,-T${LDSCRIPT},-Bsymbolic,-znotext -shared .if ${MACHINE_CPUARCH} == "aarch64" CFLAGS+= -mgeneral-regs-only @@ -78,13 +83,15 @@ CFLAGS+= -fPIC LDFLAGS+= -Wl,-znocombreloc .endif +LIBEFI= ${.OBJDIR}/../libefi/libefi.a + # # Add libstand for the runtime functions used by the compiler - for example # __aeabi_* (arm) or __divdi3 (i386). # as well as required string and memory functions for all platforms. # -DPADD+= ${LIBSTAND} -LDADD+= -lstand +DPADD+= ${LIBEFI} ${LIBSTAND} +LDADD+= ${LIBEFI} -lstand DPADD+= ${LDSCRIPT} @@ -119,7 +126,6 @@ boot1.o: ${.CURDIR}/../../common/ufsread.c # created by generate-fat.sh .include "${.CURDIR}/Makefile.fat" -BOOT1_MAXSIZE?= 131072 boot1.efifat: boot1.efi @set -- `ls -l ${.ALLSRC}`; \ @@ -129,9 +135,7 @@ boot1.efifat: boot1.efi exit 1; \ fi echo ${.OBJDIR} - uudecode ${.CURDIR}/fat-${MACHINE}.tmpl.bz2.uu - mv fat-${MACHINE}.tmpl.bz2 ${.TARGET}.bz2 - bzip2 -f -d ${.TARGET}.bz2 + xz -d -c ${.CURDIR}/fat-${MACHINE}.tmpl.xz > ${.TARGET} ${DD} if=${.ALLSRC} of=${.TARGET} seek=${BOOT1_OFFSET} conv=notrunc CLEANFILES= boot1.efi boot1.efifat Modified: stable/11/sys/boot/efi/boot1/Makefile.fat ============================================================================== --- stable/11/sys/boot/efi/boot1/Makefile.fat Sat Feb 10 22:36:42 2018 (r329113) +++ stable/11/sys/boot/efi/boot1/Makefile.fat Sun Feb 11 02:27:50 2018 (r329114) @@ -1,4 +1,4 @@ # This file autogenerated by generate-fat.sh - DO NOT EDIT # $FreeBSD$ BOOT1_OFFSET=0x2d -BOOT1_MAXSIZE=131072 +BOOT1_MAXSIZE=393216 Modified: stable/11/sys/boot/efi/boot1/boot1.c ============================================================================== --- stable/11/sys/boot/efi/boot1/boot1.c Sat Feb 10 22:36:42 2018 (r329113) +++ stable/11/sys/boot/efi/boot1/boot1.c Sun Feb 11 02:27:50 2018 (r329114) @@ -29,10 +29,14 @@ __FBSDID("$FreeBSD$"); #include #include +typedef CHAR16 efi_char; +#include #include "boot_module.h" #include "paths.h" +static void efi_panic(EFI_STATUS s, const char *fmt, ...) __dead2 __printflike(2, 3); + static const boot_module_t *boot_modules[] = { #ifdef EFI_ZFS_BOOT @@ -47,16 +51,11 @@ static const boot_module_t *boot_modules[] = /* The initial number of handles used to query EFI for partitions. */ #define NUM_HANDLES_INIT 24 -EFI_STATUS efi_main(EFI_HANDLE Ximage, EFI_SYSTEM_TABLE* Xsystab); - -EFI_SYSTEM_TABLE *systab; -EFI_BOOT_SERVICES *bs; -static EFI_HANDLE *image; - static EFI_GUID BlockIoProtocolGUID = BLOCK_IO_PROTOCOL; static EFI_GUID DevicePathGUID = DEVICE_PATH_PROTOCOL; static EFI_GUID LoadedImageGUID = LOADED_IMAGE_PROTOCOL; static EFI_GUID ConsoleControlGUID = EFI_CONSOLE_CONTROL_PROTOCOL_GUID; +static EFI_GUID FreeBSDBootVarGUID = FREEBSD_BOOT_VAR_GUID; /* * Provide Malloc / Free backed by EFIs AllocatePool / FreePool which ensures @@ -68,7 +67,7 @@ Malloc(size_t len, const char *file __unused, int line { void *out; - if (bs->AllocatePool(EfiLoaderData, len, &out) == EFI_SUCCESS) + if (BS->AllocatePool(EfiLoaderData, len, &out) == EFI_SUCCESS) return (out); return (NULL); @@ -78,9 +77,26 @@ void Free(void *buf, const char *file __unused, int line __unused) { if (buf != NULL) - (void)bs->FreePool(buf); + (void)BS->FreePool(buf); } +static EFI_STATUS +efi_setenv_freebsd_wcs(const char *varname, CHAR16 *valstr) +{ + CHAR16 *var = NULL; + size_t len; + EFI_STATUS rv; + + utf8_to_ucs2(varname, &var, &len); + if (var == NULL) + return (EFI_OUT_OF_RESOURCES); + rv = RS->SetVariable(var, &FreeBSDBootVarGUID, + EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS, + (ucs2len(valstr) + 1) * sizeof(efi_char), valstr); + free(var); + return (rv); +} + /* * nodes_match returns TRUE if the imgpath isn't NULL and the nodes match, * FALSE otherwise. @@ -88,7 +104,7 @@ Free(void *buf, const char *file __unused, int line __ static BOOLEAN nodes_match(EFI_DEVICE_PATH *imgpath, EFI_DEVICE_PATH *devpath) { - int len; + size_t len; if (imgpath == NULL || imgpath->Type != devpath->Type || imgpath->SubType != devpath->SubType) @@ -142,178 +158,6 @@ devpath_last(EFI_DEVICE_PATH *devpath) } /* - * devpath_node_str is a basic output method for a devpath node which - * only understands a subset of the available sub types. - * - * If we switch to UEFI 2.x then we should update it to use: - * EFI_DEVICE_PATH_TO_TEXT_PROTOCOL. - */ -static int -devpath_node_str(char *buf, size_t size, EFI_DEVICE_PATH *devpath) -{ - - switch (devpath->Type) { - case MESSAGING_DEVICE_PATH: - switch (devpath->SubType) { - case MSG_ATAPI_DP: { - ATAPI_DEVICE_PATH *atapi; - - atapi = (ATAPI_DEVICE_PATH *)(void *)devpath; - return snprintf(buf, size, "ata(%s,%s,0x%x)", - (atapi->PrimarySecondary == 1) ? "Sec" : "Pri", - (atapi->SlaveMaster == 1) ? "Slave" : "Master", - atapi->Lun); - } - case MSG_USB_DP: { - USB_DEVICE_PATH *usb; - - usb = (USB_DEVICE_PATH *)devpath; - return snprintf(buf, size, "usb(0x%02x,0x%02x)", - usb->ParentPortNumber, usb->InterfaceNumber); - } - case MSG_SCSI_DP: { - SCSI_DEVICE_PATH *scsi; - - scsi = (SCSI_DEVICE_PATH *)(void *)devpath; - return snprintf(buf, size, "scsi(0x%02x,0x%02x)", - scsi->Pun, scsi->Lun); - } - case MSG_SATA_DP: { - SATA_DEVICE_PATH *sata; - - sata = (SATA_DEVICE_PATH *)(void *)devpath; - return snprintf(buf, size, "sata(0x%x,0x%x,0x%x)", - sata->HBAPortNumber, sata->PortMultiplierPortNumber, - sata->Lun); - } - default: - return snprintf(buf, size, "msg(0x%02x)", - devpath->SubType); - } - break; - case HARDWARE_DEVICE_PATH: - switch (devpath->SubType) { - case HW_PCI_DP: { - PCI_DEVICE_PATH *pci; - - pci = (PCI_DEVICE_PATH *)devpath; - return snprintf(buf, size, "pci(0x%02x,0x%02x)", - pci->Device, pci->Function); - } - default: - return snprintf(buf, size, "hw(0x%02x)", - devpath->SubType); - } - break; - case ACPI_DEVICE_PATH: { - ACPI_HID_DEVICE_PATH *acpi; - - acpi = (ACPI_HID_DEVICE_PATH *)(void *)devpath; - if ((acpi->HID & PNP_EISA_ID_MASK) == PNP_EISA_ID_CONST) { - switch (EISA_ID_TO_NUM(acpi->HID)) { - case 0x0a03: - return snprintf(buf, size, "pciroot(0x%x)", - acpi->UID); - case 0x0a08: - return snprintf(buf, size, "pcieroot(0x%x)", - acpi->UID); - case 0x0604: - return snprintf(buf, size, "floppy(0x%x)", - acpi->UID); - case 0x0301: - return snprintf(buf, size, "keyboard(0x%x)", - acpi->UID); - case 0x0501: - return snprintf(buf, size, "serial(0x%x)", - acpi->UID); - case 0x0401: - return snprintf(buf, size, "parallelport(0x%x)", - acpi->UID); - default: - return snprintf(buf, size, "acpi(pnp%04x,0x%x)", - EISA_ID_TO_NUM(acpi->HID), acpi->UID); - } - } - - return snprintf(buf, size, "acpi(0x%08x,0x%x)", acpi->HID, - acpi->UID); - } - case MEDIA_DEVICE_PATH: - switch (devpath->SubType) { - case MEDIA_CDROM_DP: { - CDROM_DEVICE_PATH *cdrom; - - cdrom = (CDROM_DEVICE_PATH *)(void *)devpath; - return snprintf(buf, size, "cdrom(%x)", - cdrom->BootEntry); - } - case MEDIA_HARDDRIVE_DP: { - HARDDRIVE_DEVICE_PATH *hd; - - hd = (HARDDRIVE_DEVICE_PATH *)(void *)devpath; - return snprintf(buf, size, "hd(%x)", - hd->PartitionNumber); - } - default: - return snprintf(buf, size, "media(0x%02x)", - devpath->SubType); - } - case BBS_DEVICE_PATH: - return snprintf(buf, size, "bbs(0x%02x)", devpath->SubType); - case END_DEVICE_PATH_TYPE: - return (0); - } - - return snprintf(buf, size, "type(0x%02x, 0x%02x)", devpath->Type, - devpath->SubType); -} - -/* - * devpath_strlcat appends a text description of devpath to buf but not more - * than size - 1 characters followed by NUL-terminator. - */ -int -devpath_strlcat(char *buf, size_t size, EFI_DEVICE_PATH *devpath) -{ - size_t len, used; - const char *sep; - - sep = ""; - used = 0; - while (!IsDevicePathEnd(devpath)) { - len = snprintf(buf, size - used, "%s", sep); - used += len; - if (used > size) - return (used); - buf += len; - - len = devpath_node_str(buf, size - used, devpath); - used += len; - if (used > size) - return (used); - buf += len; - devpath = NextDevicePathNode(devpath); - sep = ":"; - } - - return (used); -} - -/* - * devpath_str is convenience method which returns the text description of - * devpath using a static buffer, so it isn't thread safe! - */ -char * -devpath_str(EFI_DEVICE_PATH *devpath) -{ - static char buf[256]; - - devpath_strlcat(buf, sizeof(buf), devpath); - - return buf; -} - -/* * load_loader attempts to load the loader image data. * * It tries each module and its respective devices, identified by mod->probe, @@ -400,14 +244,14 @@ try_boot(void) buf = NULL; } - if ((status = bs->LoadImage(TRUE, image, devpath_last(dev->devpath), + if ((status = BS->LoadImage(TRUE, IH, devpath_last(dev->devpath), loaderbuf, loadersize, &loaderhandle)) != EFI_SUCCESS) { printf("Failed to load image provided by %s, size: %zu, (%lu)\n", mod->name, loadersize, EFI_ERROR_CODE(status)); goto errout; } - if ((status = bs->HandleProtocol(loaderhandle, &LoadedImageGUID, + if ((status = BS->HandleProtocol(loaderhandle, &LoadedImageGUID, (VOID**)&loaded_image)) != EFI_SUCCESS) { printf("Failed to query LoadedImage provided by %s (%lu)\n", mod->name, EFI_ERROR_CODE(status)); @@ -433,7 +277,7 @@ try_boot(void) DSTALL(1000000); DPRINTF(".\n"); - if ((status = bs->StartImage(loaderhandle, NULL, NULL)) != + if ((status = BS->StartImage(loaderhandle, NULL, NULL)) != EFI_SUCCESS) { printf("Failed to start image provided by %s (%lu)\n", mod->name, EFI_ERROR_CODE(status)); @@ -467,7 +311,7 @@ probe_handle(EFI_HANDLE h, EFI_DEVICE_PATH *imgpath, B UINTN i; /* Figure out if we're dealing with an actual partition. */ - status = bs->HandleProtocol(h, &DevicePathGUID, (void **)&devpath); + status = BS->HandleProtocol(h, &DevicePathGUID, (void **)&devpath); if (status == EFI_UNSUPPORTED) return (status); @@ -476,10 +320,14 @@ probe_handle(EFI_HANDLE h, EFI_DEVICE_PATH *imgpath, B EFI_ERROR_CODE(status)); return (status); } - - DPRINTF("probing: %s\n", devpath_str(devpath)); - - status = bs->HandleProtocol(h, &BlockIoProtocolGUID, (void **)&blkio); +#ifdef EFI_DEBUG + { + CHAR16 *text = efi_devpath_name(devpath); + DPRINTF("probing: %S\n", text); + efi_free_devpath_name(text); + } +#endif + status = BS->HandleProtocol(h, &BlockIoProtocolGUID, (void **)&blkio); if (status == EFI_UNSUPPORTED) return (status); @@ -496,11 +344,9 @@ probe_handle(EFI_HANDLE h, EFI_DEVICE_PATH *imgpath, B /* Run through each module, see if it can load this partition */ for (i = 0; i < NUM_BOOT_MODULES; i++) { - if ((status = bs->AllocatePool(EfiLoaderData, - sizeof(*devinfo), (void **)&devinfo)) != - EFI_SUCCESS) { - DPRINTF("\nFailed to allocate devinfo (%lu)\n", - EFI_ERROR_CODE(status)); + devinfo = malloc(sizeof(*devinfo)); + if (devinfo == NULL) { + DPRINTF("\nFailed to allocate devinfo\n"); continue; } devinfo->dev = blkio; @@ -513,7 +359,7 @@ probe_handle(EFI_HANDLE h, EFI_DEVICE_PATH *imgpath, B status = boot_modules[i]->probe(devinfo); if (status == EFI_SUCCESS) return (EFI_SUCCESS); - (void)bs->FreePool(devinfo); + free(devinfo); } return (EFI_UNSUPPORTED); @@ -565,14 +411,16 @@ efi_main(EFI_HANDLE Ximage, EFI_SYSTEM_TABLE *Xsystab) EFI_CONSOLE_CONTROL_PROTOCOL *ConsoleControl = NULL; SIMPLE_TEXT_OUTPUT_INTERFACE *conout = NULL; UINTN i, max_dim, best_mode, cols, rows, hsize, nhandles; + CHAR16 *text; /* Basic initialization*/ - systab = Xsystab; - image = Ximage; - bs = Xsystab->BootServices; + ST = Xsystab; + IH = Ximage; + BS = ST->BootServices; + RS = ST->RuntimeServices; /* Set up the console, so printf works. */ - status = bs->LocateProtocol(&ConsoleControlGUID, NULL, + status = BS->LocateProtocol(&ConsoleControlGUID, NULL, (VOID **)&ConsoleControl); if (status == EFI_SUCCESS) (void)ConsoleControl->SetMode(ConsoleControl, @@ -580,7 +428,7 @@ efi_main(EFI_HANDLE Ximage, EFI_SYSTEM_TABLE *Xsystab) /* * Reset the console and find the best text mode. */ - conout = systab->ConOut; + conout = ST->ConOut; conout->Reset(conout, TRUE); max_dim = best_mode = 0; for (i = 0; ; i++) { @@ -607,34 +455,55 @@ efi_main(EFI_HANDLE Ximage, EFI_SYSTEM_TABLE *Xsystab) } putchar('\n'); + /* Determine the devpath of our image so we can prefer it. */ + status = BS->HandleProtocol(IH, &LoadedImageGUID, (VOID**)&img); + imgpath = NULL; + if (status == EFI_SUCCESS) { + text = efi_devpath_name(img->FilePath); + printf(" Load Path: %S\n", text); + efi_setenv_freebsd_wcs("Boot1Path", text); + efi_free_devpath_name(text); + + status = BS->HandleProtocol(img->DeviceHandle, &DevicePathGUID, + (void **)&imgpath); + if (status != EFI_SUCCESS) { + DPRINTF("Failed to get image DevicePath (%lu)\n", + EFI_ERROR_CODE(status)); + } else { + text = efi_devpath_name(imgpath); + printf(" Load Device: %S\n", text); + efi_setenv_freebsd_wcs("Boot1Dev", text); + efi_free_devpath_name(text); + } + + } + /* Get all the device handles */ hsize = (UINTN)NUM_HANDLES_INIT * sizeof(EFI_HANDLE); - if ((status = bs->AllocatePool(EfiLoaderData, hsize, (void **)&handles)) - != EFI_SUCCESS) - panic("Failed to allocate %d handles (%lu)", NUM_HANDLES_INIT, - EFI_ERROR_CODE(status)); + handles = malloc(hsize); + if (handles == NULL) { + printf("Failed to allocate %d handles\n", NUM_HANDLES_INIT); + } - status = bs->LocateHandle(ByProtocol, &BlockIoProtocolGUID, NULL, + status = BS->LocateHandle(ByProtocol, &BlockIoProtocolGUID, NULL, &hsize, handles); switch (status) { case EFI_SUCCESS: break; case EFI_BUFFER_TOO_SMALL: - (void)bs->FreePool(handles); - if ((status = bs->AllocatePool(EfiLoaderData, hsize, - (void **)&handles)) != EFI_SUCCESS) { - panic("Failed to allocate %zu handles (%lu)", hsize / - sizeof(*handles), EFI_ERROR_CODE(status)); - } - status = bs->LocateHandle(ByProtocol, &BlockIoProtocolGUID, + free(handles); + handles = malloc(hsize); + if (handles == NULL) + efi_panic(EFI_OUT_OF_RESOURCES, "Failed to allocate %d handles\n", + NUM_HANDLES_INIT); + status = BS->LocateHandle(ByProtocol, &BlockIoProtocolGUID, NULL, &hsize, handles); if (status != EFI_SUCCESS) - panic("Failed to get device handles (%lu)\n", - EFI_ERROR_CODE(status)); + efi_panic(status, "Failed to get device handles\n"); break; default: - panic("Failed to get device handles (%lu)", - EFI_ERROR_CODE(status)); + efi_panic(status, "Failed to get device handles\n"); + break; } /* Scan all partitions, probing with all modules. */ @@ -642,18 +511,6 @@ efi_main(EFI_HANDLE Ximage, EFI_SYSTEM_TABLE *Xsystab) printf(" Probing %zu block devices...", nhandles); DPRINTF("\n"); - /* Determine the devpath of our image so we can prefer it. */ - status = bs->HandleProtocol(image, &LoadedImageGUID, (VOID**)&img); - imgpath = NULL; - if (status == EFI_SUCCESS) { - status = bs->HandleProtocol(img->DeviceHandle, &DevicePathGUID, - (void **)&imgpath); - if (status != EFI_SUCCESS) - DPRINTF("Failed to get image DevicePath (%lu)\n", - EFI_ERROR_CODE(status)); - DPRINTF("boot1 imagepath: %s\n", devpath_str(imgpath)); - } - for (i = 0; i < nhandles; i++) probe_handle_status(handles[i], imgpath); printf(" done\n"); @@ -667,7 +524,7 @@ efi_main(EFI_HANDLE Ximage, EFI_SYSTEM_TABLE *Xsystab) try_boot(); /* If we get here, we're out of luck... */ - panic("No bootable partitions found!"); + efi_panic(EFI_LOAD_ERROR, "No bootable partitions found!"); } /* @@ -689,8 +546,12 @@ add_device(dev_info_t **devinfop, dev_info_t *devinfo) dev->next = devinfo; } -void -panic(const char *fmt, ...) +/* + * OK. We totally give up. Exit back to EFI with a sensible status so + * it can try the next option on the list. + */ +static void +efi_panic(EFI_STATUS s, const char *fmt, ...) { va_list ap; @@ -700,7 +561,7 @@ panic(const char *fmt, ...) va_end(ap); printf("\n"); - while (1) {} + BS->Exit(IH, s, 0, NULL); } void @@ -711,9 +572,9 @@ putchar(int c) if (c == '\n') { buf[0] = '\r'; buf[1] = 0; - systab->ConOut->OutputString(systab->ConOut, buf); + ST->ConOut->OutputString(ST->ConOut, buf); } buf[0] = c; buf[1] = 0; - systab->ConOut->OutputString(systab->ConOut, buf); + ST->ConOut->OutputString(ST->ConOut, buf); } Modified: stable/11/sys/boot/efi/boot1/boot_module.h ============================================================================== --- stable/11/sys/boot/efi/boot1/boot_module.h Sat Feb 10 22:36:42 2018 (r329113) +++ stable/11/sys/boot/efi/boot1/boot_module.h Sun Feb 11 02:27:50 2018 (r329114) @@ -37,7 +37,7 @@ #ifdef EFI_DEBUG #define DPRINTF(fmt, args...) printf(fmt, ##args) -#define DSTALL(d) bs->Stall(d) +#define DSTALL(d) BS->Stall(d) #else #define DPRINTF(fmt, ...) {} *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Sun Feb 11 03:02:30 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7872AF12E6F; Sun, 11 Feb 2018 03:02:30 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2A422803B6; Sun, 11 Feb 2018 03:02:30 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 252F31D1BA; Sun, 11 Feb 2018 03:02:30 +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 w1B32UgM010640; Sun, 11 Feb 2018 03:02:30 GMT (envelope-from dteske@FreeBSD.org) Received: (from dteske@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1B32U5i010639; Sun, 11 Feb 2018 03:02:30 GMT (envelope-from dteske@FreeBSD.org) Message-Id: <201802110302.w1B32U5i010639@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dteske set sender to dteske@FreeBSD.org using -f From: Devin Teske Date: Sun, 11 Feb 2018 03:02:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329115 - head/share/man/man4 X-SVN-Group: head X-SVN-Commit-Author: dteske X-SVN-Commit-Paths: head/share/man/man4 X-SVN-Commit-Revision: 329115 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Feb 2018 03:02:30 -0000 Author: dteske Date: Sun Feb 11 03:02:29 2018 New Revision: 329115 URL: https://svnweb.freebsd.org/changeset/base/329115 Log: Fix typo in dtrace_tcp(4) Using args[2]->tcps_state as-documented results in error: operator -> cannot be applied to pointer to type "void" This error is accurate as the synopsis for tcp:::state-change is: tcp:::state-change(void *, csinfo_t *, void *, tcpsinfo_t *, void *, tcplsinfo_t *); args[2] refers to the third argument which is always NULL (as- documented). The to-state for the TCP connection state transition is actually in the fourth argument, args[3]->tcps_state. Modified: head/share/man/man4/dtrace_tcp.4 Modified: head/share/man/man4/dtrace_tcp.4 ============================================================================== --- head/share/man/man4/dtrace_tcp.4 Sun Feb 11 02:27:50 2018 (r329114) +++ head/share/man/man4/dtrace_tcp.4 Sun Feb 11 03:02:29 2018 (r329115) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 15, 2016 +.Dd February 10, 2018 .Dt DTRACE_TCP 4 .Os .Sh NAME @@ -135,7 +135,7 @@ Its first, third and fifth arguments are currently alw .Dv NULL . Its last argument describes the from-state in the transition, and the to-state can be obtained from -.Dv args[2]->tcps_state . +.Dv args[3]->tcps_state . .Sh ARGUMENTS The .Vt pktinfo_t From owner-svn-src-all@freebsd.org Sun Feb 11 03:09:09 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9A2E8F136F8; Sun, 11 Feb 2018 03:09:09 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4D72380AB9; Sun, 11 Feb 2018 03:09:09 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 483A71D1D7; Sun, 11 Feb 2018 03:09:09 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1B399CD010976; Sun, 11 Feb 2018 03:09:09 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1B399kI010975; Sun, 11 Feb 2018 03:09:09 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201802110309.w1B399kI010975@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sun, 11 Feb 2018 03:09:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r329116 - stable/11/lib/libstand X-SVN-Group: stable-11 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: stable/11/lib/libstand X-SVN-Commit-Revision: 329116 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Feb 2018 03:09:09 -0000 Author: kevans Date: Sun Feb 11 03:09:08 2018 New Revision: 329116 URL: https://svnweb.freebsd.org/changeset/base/329116 Log: Back out exit() change in r329114; stable/11 was not ready for this one yet This is a direct commit to stable/11. Modified: stable/11/lib/libstand/stand.h Modified: stable/11/lib/libstand/stand.h ============================================================================== --- stable/11/lib/libstand/stand.h Sun Feb 11 03:02:29 2018 (r329115) +++ stable/11/lib/libstand/stand.h Sun Feb 11 03:09:08 2018 (r329116) @@ -376,7 +376,6 @@ extern int null_readdir(struct open_file *f, struct di * Machine dependent functions and data, must be provided or stubbed by * the consumer */ -extern void exit(int); extern int getchar(void); extern int ischar(void); extern void putchar(int); From owner-svn-src-all@freebsd.org Sun Feb 11 03:10:27 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C02BEF137E0; Sun, 11 Feb 2018 03:10:27 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7262680C9B; Sun, 11 Feb 2018 03:10:27 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6D62E1D1DF; Sun, 11 Feb 2018 03:10:27 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1B3ARv1011132; Sun, 11 Feb 2018 03:10:27 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1B3ARXJ011131; Sun, 11 Feb 2018 03:10:27 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201802110310.w1B3ARXJ011131@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sun, 11 Feb 2018 03:10:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r329117 - stable/11/usr.sbin/bhyveload X-SVN-Group: stable-11 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: stable/11/usr.sbin/bhyveload X-SVN-Commit-Revision: 329117 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Feb 2018 03:10:27 -0000 Author: kevans Date: Sun Feb 11 03:10:27 2018 New Revision: 329117 URL: https://svnweb.freebsd.org/changeset/base/329117 Log: MFC r326615: De-const to match changes in userboot.h Modified: stable/11/usr.sbin/bhyveload/bhyveload.c Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.sbin/bhyveload/bhyveload.c ============================================================================== --- stable/11/usr.sbin/bhyveload/bhyveload.c Sun Feb 11 03:09:08 2018 (r329116) +++ stable/11/usr.sbin/bhyveload/bhyveload.c Sun Feb 11 03:10:27 2018 (r329117) @@ -511,14 +511,14 @@ cb_getmem(void *arg, uint64_t *ret_lowmem, uint64_t *r } struct env { - const char *str; /* name=value */ + char *str; /* name=value */ SLIST_ENTRY(env) next; }; static SLIST_HEAD(envhead, env) envhead; static void -addenv(const char *str) +addenv(char *str) { struct env *env; From owner-svn-src-all@freebsd.org Sun Feb 11 03:21:07 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 70AE4F13C13; Sun, 11 Feb 2018 03:21:07 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 25054812BF; Sun, 11 Feb 2018 03:21:07 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 071281D3CA; Sun, 11 Feb 2018 03:21:07 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1B3L6jZ016402; Sun, 11 Feb 2018 03:21:06 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1B3L6pw016398; Sun, 11 Feb 2018 03:21:06 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201802110321.w1B3L6pw016398@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sun, 11 Feb 2018 03:21:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r329118 - in stable/11/sys/boot: arm/uboot mips/uboot powerpc/ofw powerpc/uboot X-SVN-Group: stable-11 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in stable/11/sys/boot: arm/uboot mips/uboot powerpc/ofw powerpc/uboot X-SVN-Commit-Revision: 329118 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Feb 2018 03:21:07 -0000 Author: kevans Date: Sun Feb 11 03:21:06 2018 New Revision: 329118 URL: https://svnweb.freebsd.org/changeset/base/329118 Log: Back out MFC r324558: Define prototype for exit and ensure references This went terribly wrong Modified: stable/11/sys/boot/arm/uboot/conf.c stable/11/sys/boot/mips/uboot/conf.c stable/11/sys/boot/powerpc/ofw/conf.c stable/11/sys/boot/powerpc/uboot/conf.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/boot/arm/uboot/conf.c ============================================================================== --- stable/11/sys/boot/arm/uboot/conf.c Sun Feb 11 03:10:27 2018 (r329117) +++ stable/11/sys/boot/arm/uboot/conf.c Sun Feb 11 03:21:06 2018 (r329118) @@ -36,9 +36,6 @@ __FBSDID("$FreeBSD$"); #include "dev_net.h" #endif -/* Make sure we have an explicit reference to exit so libsa's panic pulls in the MD exit */ -void (*exitfn)(int) = exit; - struct devsw *devsw[] = { #if defined(LOADER_DISK_SUPPORT) || defined(LOADER_CD9660_SUPPORT) &uboot_storage, Modified: stable/11/sys/boot/mips/uboot/conf.c ============================================================================== --- stable/11/sys/boot/mips/uboot/conf.c Sun Feb 11 03:10:27 2018 (r329117) +++ stable/11/sys/boot/mips/uboot/conf.c Sun Feb 11 03:21:06 2018 (r329118) @@ -36,9 +36,6 @@ __FBSDID("$FreeBSD$"); #include "dev_net.h" #endif -/* Make sure we have an explicit reference to exit so libsa's panic pulls in the MD exit */ -void (*exitfn)(int) = exit; - struct devsw *devsw[] = { #if defined(LOADER_DISK_SUPPORT) || defined(LOADER_CD9660_SUPPORT) &uboot_storage, Modified: stable/11/sys/boot/powerpc/ofw/conf.c ============================================================================== --- stable/11/sys/boot/powerpc/ofw/conf.c Sun Feb 11 03:10:27 2018 (r329117) +++ stable/11/sys/boot/powerpc/ofw/conf.c Sun Feb 11 03:21:06 2018 (r329118) @@ -36,9 +36,6 @@ __FBSDID("$FreeBSD$"); #include "dev_net.h" #endif -/* Make sure we have an explicit reference to exit so libsa's panic pulls in the MD exit */ -void (*exitfn)(int) = exit; - /* * We could use linker sets for some or all of these, but * then we would have to control what ended up linked into Modified: stable/11/sys/boot/powerpc/uboot/conf.c ============================================================================== --- stable/11/sys/boot/powerpc/uboot/conf.c Sun Feb 11 03:10:27 2018 (r329117) +++ stable/11/sys/boot/powerpc/uboot/conf.c Sun Feb 11 03:21:06 2018 (r329118) @@ -35,9 +35,6 @@ __FBSDID("$FreeBSD$"); #include "dev_net.h" #endif -/* Make sure we have an explicit reference to exit so libsa's panic pulls in the MD exit */ -void (*exitfn)(int) = exit; - /* * We could use linker sets for some or all of these, but * then we would have to control what ended up linked into From owner-svn-src-all@freebsd.org Sun Feb 11 06:57:21 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9FE04F1BF36; Sun, 11 Feb 2018 06:57:21 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 501A187A29; Sun, 11 Feb 2018 06:57:21 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4AFA21F74A; Sun, 11 Feb 2018 06:57: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 w1B6vLJs024577; Sun, 11 Feb 2018 06:57:21 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1B6vKvT024572; Sun, 11 Feb 2018 06:57:20 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201802110657.w1B6vKvT024572@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Sun, 11 Feb 2018 06:57:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329119 - in head: sbin/geom/class/part sys/geom/part sys/sys/disk X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: in head: sbin/geom/class/part sys/geom/part sys/sys/disk X-SVN-Commit-Revision: 329119 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Feb 2018 06:57:21 -0000 Author: cem Date: Sun Feb 11 06:57:20 2018 New Revision: 329119 URL: https://svnweb.freebsd.org/changeset/base/329119 Log: Add GUID and alias for Apple APFS partition PR: 225813 Submitted by: James Wright Modified: head/sbin/geom/class/part/gpart.8 head/sys/geom/part/g_part.c head/sys/geom/part/g_part.h head/sys/geom/part/g_part_gpt.c head/sys/sys/disk/gpt.h Modified: head/sbin/geom/class/part/gpart.8 ============================================================================== --- head/sbin/geom/class/part/gpart.8 Sun Feb 11 03:21:06 2018 (r329118) +++ head/sbin/geom/class/part/gpart.8 Sun Feb 11 06:57:20 2018 (r329119) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 19, 2017 +.Dd February 10, 2018 .Dt GPART 8 .Os .Sh NAME @@ -654,6 +654,8 @@ Another symbolic names that can be used with .Cm gpart utility are: .Bl -tag -width ".Cm dragonfly-disklabel64" +.It Cm apple-apfs +An Apple macOS partition used for the Apple file system, APFS. .It Cm apple-core-storage An Apple Mac OS X partition used by logical volume manager known as Core Storage. Modified: head/sys/geom/part/g_part.c ============================================================================== --- head/sys/geom/part/g_part.c Sun Feb 11 03:21:06 2018 (r329118) +++ head/sys/geom/part/g_part.c Sun Feb 11 06:57:20 2018 (r329119) @@ -71,6 +71,7 @@ struct g_part_alias_list { const char *lexeme; enum g_part_alias alias; } g_part_alias_list[G_PART_ALIAS_COUNT] = { + { "apple-apfs", G_PART_ALIAS_APPLE_APFS }, { "apple-boot", G_PART_ALIAS_APPLE_BOOT }, { "apple-core-storage", G_PART_ALIAS_APPLE_CORE_STORAGE }, { "apple-hfs", G_PART_ALIAS_APPLE_HFS }, Modified: head/sys/geom/part/g_part.h ============================================================================== --- head/sys/geom/part/g_part.h Sun Feb 11 03:21:06 2018 (r329118) +++ head/sys/geom/part/g_part.h Sun Feb 11 06:57:20 2018 (r329119) @@ -38,6 +38,7 @@ #define G_PART_PROBE_PRI_HIGH 0 enum g_part_alias { + G_PART_ALIAS_APPLE_APFS, /* An Apple APFS partition. */ G_PART_ALIAS_APPLE_BOOT, /* An Apple boot partition entry. */ G_PART_ALIAS_APPLE_CORE_STORAGE,/* An Apple Core Storage partition. */ G_PART_ALIAS_APPLE_HFS, /* An HFS+ file system entry. */ Modified: head/sys/geom/part/g_part_gpt.c ============================================================================== --- head/sys/geom/part/g_part_gpt.c Sun Feb 11 03:21:06 2018 (r329118) +++ head/sys/geom/part/g_part_gpt.c Sun Feb 11 06:57:20 2018 (r329119) @@ -147,6 +147,7 @@ static struct g_part_scheme g_part_gpt_scheme = { }; G_PART_SCHEME_DECLARE(g_part_gpt); +static struct uuid gpt_uuid_apple_apfs = GPT_ENT_TYPE_APPLE_APFS; static struct uuid gpt_uuid_apple_boot = GPT_ENT_TYPE_APPLE_BOOT; static struct uuid gpt_uuid_apple_core_storage = GPT_ENT_TYPE_APPLE_CORE_STORAGE; @@ -208,6 +209,7 @@ static struct g_part_uuid_alias { int alias; int mbrtype; } gpt_uuid_alias_match[] = { + { &gpt_uuid_apple_apfs, G_PART_ALIAS_APPLE_APFS, 0 }, { &gpt_uuid_apple_boot, G_PART_ALIAS_APPLE_BOOT, 0xab }, { &gpt_uuid_apple_core_storage, G_PART_ALIAS_APPLE_CORE_STORAGE, 0 }, { &gpt_uuid_apple_hfs, G_PART_ALIAS_APPLE_HFS, 0xaf }, Modified: head/sys/sys/disk/gpt.h ============================================================================== --- head/sys/sys/disk/gpt.h Sun Feb 11 03:21:06 2018 (r329118) +++ head/sys/sys/disk/gpt.h Sun Feb 11 06:57:20 2018 (r329119) @@ -183,6 +183,8 @@ CTASSERT(sizeof(struct gpt_ent) == 128); {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_APPLE_APFS \ + {0x7c3457ef,0x0000,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}} From owner-svn-src-all@freebsd.org Sun Feb 11 07:01:49 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 83943F1C3F8; Sun, 11 Feb 2018 07:01:49 +0000 (UTC) (envelope-from antoine.brodin.freebsd@gmail.com) Received: from mail-io0-x22e.google.com (mail-io0-x22e.google.com [IPv6:2607:f8b0:4001:c06::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 0EFD26804D; Sun, 11 Feb 2018 07:01:49 +0000 (UTC) (envelope-from antoine.brodin.freebsd@gmail.com) Received: by mail-io0-x22e.google.com with SMTP id l17so14166789ioc.3; Sat, 10 Feb 2018 23:01:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=4aGICFTftFpMQsyaRyQKGTf7Prk/XsUsTaV+72612s0=; b=RPKWlZqmjMxTLiBNV/rUhtdUiUnQz/TPepadBzXNZ72adVNC//vMVvYmRgiMG5Oa1u bdedYWwDrHAf0/rg61yhDVIqpahEp/Hl7txG5wY6eE7ZkvQa8V1pgmWsq88pFpgwQAck KXm/P41hhj++FG22+5asH4RXbyXpOKdEI4SSWU6S3MZcXy0s1Zh0wIAXa6jOznQ8aj6+ J4k0+F8KNfI3Fh/espMU00FaRWRkPUhosmyuTeWyv7ux3lnx59guhn6aAv0tATrZLtTN qMM+u3oFaUEhbcFGSmhv+jLg+PyWwgDeMTGDJsxXkplYtPetuGShm2s5OwGydOG5yikf jZDQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=4aGICFTftFpMQsyaRyQKGTf7Prk/XsUsTaV+72612s0=; b=DHliQWOy7tZstjxKbfVJJ/mYhzQsSXKYp0nXkn5gmvksaLGzR0Q170EqkWYSo2s2+v SBYWwplgSVf8SWUXVU5dw5lzpdBSA7L/aGF3pakmEGqe33F3e9CvIWFgwOGdr4Iqbm+Z VrPPRGWkTnpX7ODyE6PYVsHGDlK44MWZzdhKyF78SNJGBTUew+boeIdzXsJJiN1nI9w3 scmTAqXR4o1l36yQ89SIdhKz8ST+mUWhJIIqac/1tC/9YIs5u+/D4s4FjcW4IpwgVPmz 1sYFxe7/5IeQTwx+wxtlOrRb3winNfxicDR4r3MVR0eIjcV3mYcT35itL2EoU9m9N4SD JSNA== X-Gm-Message-State: APf1xPDhCH9/XH8onHRX/5HVMFqW7kYPMnGHWe7TXm1LY+HX4Cpo5Q1h bl7Q3G4KhL6iuDbDD5Zj1MyEh9UbspO/ECg9lwUyCA== X-Google-Smtp-Source: AH8x227RJqh0PW2EhdJqjvYL3guCnoGwYY3E4pXR0hy7tqums0g6CURuT0Q7bJSUdeBhhL571KTw3KHEdcgmdqXcUao= X-Received: by 10.107.142.68 with SMTP id q65mr9067744iod.133.1518332508472; Sat, 10 Feb 2018 23:01:48 -0800 (PST) MIME-Version: 1.0 Sender: antoine.brodin.freebsd@gmail.com Received: by 10.107.143.86 with HTTP; Sat, 10 Feb 2018 23:01:48 -0800 (PST) In-Reply-To: <201802071506.w17F6s5l043163@repo.freebsd.org> References: <201802071506.w17F6s5l043163@repo.freebsd.org> From: Antoine Brodin Date: Sun, 11 Feb 2018 08:01:48 +0100 X-Google-Sender-Auth: sc7kxLvlcqykSPCqpCxUesU0PVE Message-ID: Subject: Re: svn commit: r328973 - in stable/11: include sys/sys To: Hans Petter Selasky Cc: src-committers , svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org, re Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Feb 2018 07:01:49 -0000 On Wed, Feb 7, 2018 at 4:06 PM, Hans Petter Selasky wrote: > Author: hselasky > Date: Wed Feb 7 15:06:54 2018 > New Revision: 328973 > URL: https://svnweb.freebsd.org/changeset/base/328973 > > Log: > MFC r328237: > Use the __alloc_size2 attribute where relevant. > > This follows the documented use in GCC. It is basically only relevant for > calloc(3), reallocarray(3) and mallocarray(9). > > NOTE: Without this change clang 5.0.1 can produce incorrect optimisation > code for static processing of data using the allocated object. For example > this has been seen compiling the mlx4 core module, which allocates a > fixed size array which is then sorted by a fixed order loop. The > optimised result, -O2, is incorrect unless this patch is in place. > > Suggested by: Mark Millard > Reference: https://docs.freebsd.org/cgi/mid.cgi?9DE674C6-EAA3-4E8A-906F-446E74D82FC4 > > Modified: > stable/11/include/stdlib.h > stable/11/sys/sys/malloc.h > Directory Properties: > stable/11/ (props changed) Hi, Please revert this change. Lots of ports that used to build fine on stable/11 are now failing. /usr/include/stdlib.h:93:7: error: expected function body after function declarator __alloc_size2(1, 2); Antoine (with hat: portmgr) From owner-svn-src-all@freebsd.org Sun Feb 11 07:00:41 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 653FAF1C248; Sun, 11 Feb 2018 07:00:41 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 138AA87DB5; Sun, 11 Feb 2018 07:00:41 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0E9C21F75E; Sun, 11 Feb 2018 07:00:41 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1B70eXb024788; Sun, 11 Feb 2018 07:00:40 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1B70eMH024787; Sun, 11 Feb 2018 07:00:40 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201802110700.w1B70eMH024787@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Sun, 11 Feb 2018 07:00:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r329120 - stable/11/bin/ps X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: stable/11/bin/ps X-SVN-Commit-Revision: 329120 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Feb 2018 07:00:41 -0000 Author: eadler Date: Sun Feb 11 07:00:40 2018 New Revision: 329120 URL: https://svnweb.freebsd.org/changeset/base/329120 Log: MFC r304007: Correct the history of where ps first appeared. PR: 211741 Submitted by: Sevan Janiyan Modified: stable/11/bin/ps/ps.1 Directory Properties: stable/11/ (props changed) Modified: stable/11/bin/ps/ps.1 ============================================================================== --- stable/11/bin/ps/ps.1 Sun Feb 11 06:57:20 2018 (r329119) +++ stable/11/bin/ps/ps.1 Sun Feb 11 07:00:40 2018 (r329120) @@ -773,7 +773,8 @@ operating systems. The .Nm command appeared in -.At v4 . +.At v3 +in section 8 of the manual. .Sh BUGS Since .Nm From owner-svn-src-all@freebsd.org Sun Feb 11 07:04:49 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3C8CAF1C7D0; Sun, 11 Feb 2018 07:04:49 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DAE52682DA; Sun, 11 Feb 2018 07:04:48 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D5B5E1F8E3; Sun, 11 Feb 2018 07:04:48 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1B74mCC029486; Sun, 11 Feb 2018 07:04:48 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1B74mbF029485; Sun, 11 Feb 2018 07:04:48 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201802110704.w1B74mbF029485@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Sun, 11 Feb 2018 07:04:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r329121 - stable/11/sys/dev/uart X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: stable/11/sys/dev/uart X-SVN-Commit-Revision: 329121 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Feb 2018 07:04:49 -0000 Author: eadler Date: Sun Feb 11 07:04:48 2018 New Revision: 329121 URL: https://svnweb.freebsd.org/changeset/base/329121 Log: MFC r308926: Add Intel Atom Cherryview SOC HSUART support PR: 207910 Submitted by: johannes@brilliantservice.co.jp Modified: stable/11/sys/dev/uart/uart_bus_pci.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/uart/uart_bus_pci.c ============================================================================== --- stable/11/sys/dev/uart/uart_bus_pci.c Sun Feb 11 07:00:40 2018 (r329120) +++ stable/11/sys/dev/uart/uart_bus_pci.c Sun Feb 11 07:04:48 2018 (r329121) @@ -131,6 +131,10 @@ static const struct pci_id pci_ns8250_ids[] = { { 0x8086, 0x1c3d, 0xffff, 0, "Intel AMT - KT Controller", 0x10 }, { 0x8086, 0x1d3d, 0xffff, 0, "Intel C600/X79 Series Chipset KT Controller", 0x10 }, { 0x8086, 0x1e3d, 0xffff, 0, "Intel Panther Point KT Controller", 0x10 }, +{ 0x8086, 0x228a, 0xffff, 0, "Intel Cherryview SIO HSUART#1", 0x10, + 24 * DEFAULT_RCLK, 2 }, +{ 0x8086, 0x228c, 0xffff, 0, "Intel Cherryview SIO HSUART#2", 0x10, + 24 * DEFAULT_RCLK, 2 }, { 0x8086, 0x2a07, 0xffff, 0, "Intel AMT - PM965/GM965 KT Controller", 0x10 }, { 0x8086, 0x2a47, 0xffff, 0, "Mobile 4 Series Chipset KT Controller", 0x10 }, { 0x8086, 0x2e17, 0xffff, 0, "4 Series Chipset Serial KT Controller", 0x10 }, From owner-svn-src-all@freebsd.org Sun Feb 11 10:09:44 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F1799F081BE; Sun, 11 Feb 2018 10:09:43 +0000 (UTC) (envelope-from antoine.brodin.freebsd@gmail.com) Received: from mail-it0-x234.google.com (mail-it0-x234.google.com [IPv6:2607:f8b0:4001:c0b::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 8A52170309; Sun, 11 Feb 2018 10:09:43 +0000 (UTC) (envelope-from antoine.brodin.freebsd@gmail.com) Received: by mail-it0-x234.google.com with SMTP id n206so3335919itg.1; Sun, 11 Feb 2018 02:09:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=qlrQqiGgbrAk49RKqRFIdrQKPK4Z511TtS/XGZkjhBg=; b=EgHlkEtUZzQY+HPBX4YMP55SSY8UFdB9ub3eHbc2fb0W+2iuLujL0OI5D7BqHAoEB3 c0tfjCRTifNJshLs+CxkPvStCNYfF9KX+koN6uhfX7aZRxXj32ehx+L7DBYPnqAJfV7S vXWgpvwhzcAHfz9+C7JSHRREVbNCAj3j3iip0or7HgPgspYCMR/rgJJZEoYG5YcmHnrf ubqwyLtQn0Ac5Qd9dwg2p5kd0DJyIr5nu8PAJXvWfBOSUS4/i4/GqgNGKrYkFCzlNczH XQ3iuEWfTDZa8f4BqgfAo3wGMKxGJByMV49ABAwms6FI6qEyJQBrlmsti5vIQLmsPS+f WPUg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=qlrQqiGgbrAk49RKqRFIdrQKPK4Z511TtS/XGZkjhBg=; b=gBvEhkkioX/I4a5ZKcq6dU0icK41JSvoeDPWgj4Zuv3yzSLfjse8hlfLmJgTHFa5E8 /Svoq8nuRKT5b3rK9lGLQLA9nzxdSYSgcZm7jyfgKPMHOTQVvRbuFN5nh2NWc+iRm8Bn PirSQV9H74sz/+kwExMKKjRHCDX6Qjk0ky3co4RCrgQtBaCo+o7Y7gsWH6v1XJ51G1U5 2KG2xCdZ9c8zdujqQWpgmHiZfcjxOsSN13hyLL4ZVHoWYhurSt58YHgT/y/rMy/+zx5H ANzwbIdHTf9LYhsuAeyVtbQDMbwGw+34ni7FsoHW1ldo3JTzoEAKaX5dn9hT1XJwdx/p oOUA== X-Gm-Message-State: APf1xPDD3pSEyB/zQQsD3RQPwwPWNNmxdqaXVxCTFVamt0bVoio2BBMq obC75QXwJvUDD+0uivUL4G4ULep/ZhMaNVN47Qbf/LEP X-Google-Smtp-Source: AH8x225drczXBeXWG/pV91A3b0tuf4gJ3UkgDLgB2ng2Ypj20ZigVME+Pa9HSC5LvXQ3A8REtzRZCfHU6auWPM0b+hU= X-Received: by 10.36.58.14 with SMTP id m14mr1413186itm.45.1518343782737; Sun, 11 Feb 2018 02:09:42 -0800 (PST) MIME-Version: 1.0 Sender: antoine.brodin.freebsd@gmail.com Received: by 10.107.143.86 with HTTP; Sun, 11 Feb 2018 02:09:42 -0800 (PST) In-Reply-To: References: <201802071506.w17F6s5l043163@repo.freebsd.org> From: Antoine Brodin Date: Sun, 11 Feb 2018 11:09:42 +0100 X-Google-Sender-Auth: X0a6jQ7qBxIYpLEE-xkoourJbAY Message-ID: Subject: Re: svn commit: r328973 - in stable/11: include sys/sys To: Hans Petter Selasky Cc: src-committers , svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org, re Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Feb 2018 10:09:44 -0000 On Sun, Feb 11, 2018 at 8:01 AM, Antoine Brodin wrote: > On Wed, Feb 7, 2018 at 4:06 PM, Hans Petter Selasky > wrote: >> Author: hselasky >> Date: Wed Feb 7 15:06:54 2018 >> New Revision: 328973 >> URL: https://svnweb.freebsd.org/changeset/base/328973 >> >> Log: >> MFC r328237: >> Use the __alloc_size2 attribute where relevant. >> >> This follows the documented use in GCC. It is basically only relevant for >> calloc(3), reallocarray(3) and mallocarray(9). >> >> NOTE: Without this change clang 5.0.1 can produce incorrect optimisation >> code for static processing of data using the allocated object. For example >> this has been seen compiling the mlx4 core module, which allocates a >> fixed size array which is then sorted by a fixed order loop. The >> optimised result, -O2, is incorrect unless this patch is in place. >> >> Suggested by: Mark Millard >> Reference: https://docs.freebsd.org/cgi/mid.cgi?9DE674C6-EAA3-4E8A-906F-446E74D82FC4 >> >> Modified: >> stable/11/include/stdlib.h >> stable/11/sys/sys/malloc.h >> Directory Properties: >> stable/11/ (props changed) > > Hi, > > Please revert this change. Lots of ports that used to build fine on > stable/11 are now failing. > /usr/include/stdlib.h:93:7: error: expected function body after > function declarator > __alloc_size2(1, 2); Something like this may be needed on stable/11: Index: 11/sys/sys/cdefs.h =================================================================== --- 11/sys/sys/cdefs.h (revision 329121) +++ 11/sys/sys/cdefs.h (working copy) @@ -213,6 +213,7 @@ #define __aligned(x) #define __alloc_align(x) #define __alloc_size(x) +#define __alloc_size2(n, x) #define __section(x) #define __weak_symbol #else Antoine From owner-svn-src-all@freebsd.org Sun Feb 11 10:23:33 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3201DF09696; Sun, 11 Feb 2018 10:23:33 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D8B4170FA1; Sun, 11 Feb 2018 10:23:32 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D37CA219E5; Sun, 11 Feb 2018 10:23:32 +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 w1BANWIl030782; Sun, 11 Feb 2018 10:23:32 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1BANW2O030781; Sun, 11 Feb 2018 10:23:32 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201802111023.w1BANW2O030781@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Sun, 11 Feb 2018 10:23:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r329122 - stable/11/sys/sys X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/11/sys/sys X-SVN-Commit-Revision: 329122 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Feb 2018 10:23:33 -0000 Author: hselasky Date: Sun Feb 11 10:23:32 2018 New Revision: 329122 URL: https://svnweb.freebsd.org/changeset/base/329122 Log: Fix regression issue after r328973: The lint target does no longer exist in FreeBSD head and the __alloc_size2() support for lint was missing when r328973 was MFCed. Add support for __alloc_size2() to the lint target. This is a direct commit. Found by: antoine@ Pointy hat: hselasky@ Sponsored by: Mellanox Technologies Modified: stable/11/sys/sys/cdefs.h Modified: stable/11/sys/sys/cdefs.h ============================================================================== --- stable/11/sys/sys/cdefs.h Sun Feb 11 07:04:48 2018 (r329121) +++ stable/11/sys/sys/cdefs.h Sun Feb 11 10:23:32 2018 (r329122) @@ -213,6 +213,7 @@ #define __aligned(x) #define __alloc_align(x) #define __alloc_size(x) +#define __alloc_size2(n, x) #define __section(x) #define __weak_symbol #else From owner-svn-src-all@freebsd.org Sun Feb 11 10:26:59 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 58415F09A86; Sun, 11 Feb 2018 10:26:59 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (turbocat.net [IPv6:2a01:4f8:c17:6c4b::2]) (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 EABCD7120B; Sun, 11 Feb 2018 10:26:58 +0000 (UTC) (envelope-from hps@selasky.org) Received: from hps2016.home.selasky.org (unknown [62.141.128.70]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 0D7492605ED; Sun, 11 Feb 2018 11:26:56 +0100 (CET) Subject: Re: svn commit: r328973 - in stable/11: include sys/sys To: Antoine Brodin Cc: src-committers , svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org, re References: <201802071506.w17F6s5l043163@repo.freebsd.org> From: Hans Petter Selasky Message-ID: Date: Sun, 11 Feb 2018 11:24:02 +0100 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Feb 2018 10:26:59 -0000 On 02/11/18 11:09, Antoine Brodin wrote: > On Sun, Feb 11, 2018 at 8:01 AM, Antoine Brodin wrote: >> On Wed, Feb 7, 2018 at 4:06 PM, Hans Petter Selasky >> wrote: >>> Author: hselasky >>> Date: Wed Feb 7 15:06:54 2018 >>> New Revision: 328973 >>> URL: https://svnweb.freebsd.org/changeset/base/328973 >>> >>> Log: >>> MFC r328237: >>> Use the __alloc_size2 attribute where relevant. >>> >>> This follows the documented use in GCC. It is basically only relevant for >>> calloc(3), reallocarray(3) and mallocarray(9). >>> >>> NOTE: Without this change clang 5.0.1 can produce incorrect optimisation >>> code for static processing of data using the allocated object. For example >>> this has been seen compiling the mlx4 core module, which allocates a >>> fixed size array which is then sorted by a fixed order loop. The >>> optimised result, -O2, is incorrect unless this patch is in place. >>> >>> Suggested by: Mark Millard >>> Reference: https://docs.freebsd.org/cgi/mid.cgi?9DE674C6-EAA3-4E8A-906F-446E74D82FC4 >>> >>> Modified: >>> stable/11/include/stdlib.h >>> stable/11/sys/sys/malloc.h >>> Directory Properties: >>> stable/11/ (props changed) >> >> Hi, >> >> Please revert this change. Lots of ports that used to build fine on >> stable/11 are now failing. >> /usr/include/stdlib.h:93:7: error: expected function body after >> function declarator >> __alloc_size2(1, 2); > Hi Antoine, I'm sorry for the inconvenience. Probably I should have sent this patch for portmgr first, to avoid such breakage. This patch is required also for ports, and it is good you are now rebuilding ports which use this define, because they might be broken due to the fact the __alloc_size2() was incorrectly implemented! I hope this will be the end of the breakage: https://svnweb.freebsd.org/changeset/base/329122 Else I will revert both patches and have you test them first. --HPS > Something like this may be needed on stable/11: > > Index: 11/sys/sys/cdefs.h > =================================================================== > --- 11/sys/sys/cdefs.h (revision 329121) > +++ 11/sys/sys/cdefs.h (working copy) > @@ -213,6 +213,7 @@ > #define __aligned(x) > #define __alloc_align(x) > #define __alloc_size(x) > +#define __alloc_size2(n, x) > #define __section(x) > #define __weak_symbol > #else > > Antoine > > From owner-svn-src-all@freebsd.org Sun Feb 11 13:35:32 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6BF8EF18CA8; Sun, 11 Feb 2018 13:35:32 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1A1BB787E8; Sun, 11 Feb 2018 13:35:32 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0BA6023915; Sun, 11 Feb 2018 13:35:32 +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 w1BDZVjE026045; Sun, 11 Feb 2018 13:35:31 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1BDZVIL026043; Sun, 11 Feb 2018 13:35:31 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201802111335.w1BDZVIL026043@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Sun, 11 Feb 2018 13:35:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329123 - head/usr.bin/lock X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/usr.bin/lock X-SVN-Commit-Revision: 329123 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Feb 2018 13:35:32 -0000 Author: trasz Date: Sun Feb 11 13:35:31 2018 New Revision: 329123 URL: https://svnweb.freebsd.org/changeset/base/329123 Log: Make lock(1) use PAM. This makes the -p option work again. (Well, kind of, because the whole idea of this utility is rather broken.) This originally come from NetBSD, and was later reworked a bit. Reviewed by: des@ (earlier version) MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D4981 Modified: head/usr.bin/lock/Makefile head/usr.bin/lock/lock.c Modified: head/usr.bin/lock/Makefile ============================================================================== --- head/usr.bin/lock/Makefile Sun Feb 11 10:23:32 2018 (r329122) +++ head/usr.bin/lock/Makefile Sun Feb 11 13:35:31 2018 (r329123) @@ -5,6 +5,6 @@ PROG= lock BINOWN= root BINMODE=4555 -LIBADD= crypt +LIBADD= pam .include Modified: head/usr.bin/lock/lock.c ============================================================================== --- head/usr.bin/lock/lock.c Sun Feb 11 10:23:32 2018 (r329122) +++ head/usr.bin/lock/lock.c Sun Feb 11 13:35:31 2018 (r329123) @@ -73,6 +73,9 @@ __FBSDID("$FreeBSD$"); #include #include +#include +#include /* for openpam_ttyconv() */ + #define TIMEOUT 15 static void quit(int); @@ -91,19 +94,23 @@ static int vtyunlock; /* Unlock flag and code. */ int main(int argc, char **argv) { + static const struct pam_conv pamc = { &openpam_ttyconv, NULL }; + pam_handle_t *pamh; struct passwd *pw; struct itimerval ntimer, otimer; struct tm *timp; time_t timval; - int ch, failures, sectimeout, usemine, vtylock; - char *ap, *cryptpw, *mypw, *ttynam, *tzn; + int ch, failures, pam_err, sectimeout, usemine, vtylock; + char *ap, *ttynam, *tzn; char hostname[MAXHOSTNAMELEN], s[BUFSIZ], s1[BUFSIZ]; openlog("lock", 0, LOG_AUTH); + pam_err = PAM_SYSTEM_ERR; /* pacify GCC */ + sectimeout = TIMEOUT; + pamh = NULL; pw = NULL; - mypw = NULL; usemine = 0; no_timeout = 0; vtylock = 0; @@ -117,7 +124,6 @@ main(int argc, char **argv) usemine = 1; if (!(pw = getpwuid(getuid()))) errx(1, "unknown uid %d", getuid()); - mypw = strdup(pw->pw_passwd); break; case 'n': no_timeout = 1; @@ -131,9 +137,11 @@ main(int argc, char **argv) } timeout.tv_sec = sectimeout * 60; - /* discard privs */ - if (setuid(getuid()) != 0) - errx(1, "setuid failed"); + if (!usemine) { /* -p with PAM or S/key needs privs */ + /* discard privs */ + if (setuid(getuid()) != 0) + errx(1, "setuid failed"); + } if (tcgetattr(0, &tty)) /* get information for header */ exit(1); @@ -153,7 +161,11 @@ main(int argc, char **argv) ntty = tty; ntty.c_lflag &= ~ECHO; (void)tcsetattr(0, TCSADRAIN|TCSASOFT, &ntty); - if (!mypw) { + if (usemine) { + pam_err = pam_start("lock", pw->pw_name, &pamc, &pamh); + if (pam_err != PAM_SUCCESS) + err(1, "pam_start: %s", pam_strerror(NULL, pam_err)); + } else { /* get key and check again */ (void)printf("Key: "); if (!fgets(s, sizeof(s), stdin) || *s == '\n') @@ -171,7 +183,6 @@ main(int argc, char **argv) exit(1); } s[0] = '\0'; - mypw = s1; } /* set signal handlers */ @@ -216,19 +227,27 @@ main(int argc, char **argv) failures = 0; for (;;) { + if (usemine) { + pam_err = pam_authenticate(pamh, 0); + if (pam_err == PAM_SUCCESS) + break; + + if (pam_err != PAM_AUTH_ERR && + pam_err != PAM_USER_UNKNOWN && + pam_err != PAM_MAXTRIES) { + syslog(LOG_ERR, "pam_authenticate: %s", + pam_strerror(pamh, pam_err)); + } + + goto tryagain; + } (void)printf("Key: "); if (!fgets(s, sizeof(s), stdin)) { clearerr(stdin); hi(0); goto tryagain; } - if (usemine) { - s[strlen(s) - 1] = '\0'; - cryptpw = crypt(s, mypw); - if (cryptpw != NULL && !strcmp(mypw, cryptpw)) - break; - } - else if (!strcmp(s, s1)) + if (!strcmp(s, s1)) break; (void)printf("\07\n"); failures++; @@ -243,6 +262,8 @@ tryagain: if (getuid() == 0) syslog(LOG_NOTICE, "ROOT UNLOCK ON hostname %s port %s", hostname, ttynam); + if (usemine) + (void)pam_end(pamh, pam_err); quit(0); return(0); /* not reached */ } From owner-svn-src-all@freebsd.org Sun Feb 11 13:57:16 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 55AA4F1A5F6; Sun, 11 Feb 2018 13:57:16 +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 D8CB479508; Sun, 11 Feb 2018 13:57:15 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from coleburn.home.andric.com (coleburn.home.andric.com [192.168.0.15]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id AAC681DFDD; Sun, 11 Feb 2018 14:57:08 +0100 (CET) From: Dimitry Andric Message-Id: <83191F81-4D50-4B7D-918D-963CC8A0F331@FreeBSD.org> Content-Type: multipart/signed; boundary="Apple-Mail=_72B1D30F-D38F-459A-A74A-F4651EE3F99D"; protocol="application/pgp-signature"; micalg=pgp-sha1 Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) Subject: Re: svn commit: r328973 - in stable/11: include sys/sys Date: Sun, 11 Feb 2018 14:57:07 +0100 In-Reply-To: Cc: Antoine Brodin , src-committers , svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org, re To: Hans Petter Selasky References: <201802071506.w17F6s5l043163@repo.freebsd.org> X-Mailer: Apple Mail (2.3273) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Feb 2018 13:57:16 -0000 --Apple-Mail=_72B1D30F-D38F-459A-A74A-F4651EE3F99D Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii On 11 Feb 2018, at 11:24, Hans Petter Selasky wrote: >=20 > On 02/11/18 11:09, Antoine Brodin wrote: >> On Sun, Feb 11, 2018 at 8:01 AM, Antoine Brodin = wrote: >>> On Wed, Feb 7, 2018 at 4:06 PM, Hans Petter Selasky >>> wrote: >>>> Author: hselasky >>>> Date: Wed Feb 7 15:06:54 2018 >>>> New Revision: 328973 >>>> URL: https://svnweb.freebsd.org/changeset/base/328973 >>>>=20 >>>> Log: >>>> MFC r328237: >>>> Use the __alloc_size2 attribute where relevant. >>>>=20 >>>> This follows the documented use in GCC. It is basically only = relevant for >>>> calloc(3), reallocarray(3) and mallocarray(9). >>>>=20 >>>> NOTE: Without this change clang 5.0.1 can produce incorrect = optimisation >>>> code for static processing of data using the allocated object. = For example >>>> this has been seen compiling the mlx4 core module, which = allocates a >>>> fixed size array which is then sorted by a fixed order loop. The >>>> optimised result, -O2, is incorrect unless this patch is in = place. >>>>=20 >>>> Suggested by: Mark Millard >>>> Reference: = https://docs.freebsd.org/cgi/mid.cgi?9DE674C6-EAA3-4E8A-906F-446E74D82FC4 >>>>=20 >>>> Modified: >>>> stable/11/include/stdlib.h >>>> stable/11/sys/sys/malloc.h >>>> Directory Properties: >>>> stable/11/ (props changed) >>>=20 >>> Hi, >>>=20 >>> Please revert this change. Lots of ports that used to build fine on >>> stable/11 are now failing. >>> /usr/include/stdlib.h:93:7: error: expected function body after >>> function declarator >>> __alloc_size2(1, 2); >=20 > Hi Antoine, >=20 > I'm sorry for the inconvenience. Probably I should have sent this = patch for portmgr first, to avoid such breakage. This patch is required = also for ports, and it is good you are now rebuilding ports which use = this define, because they might be broken due to the fact the = __alloc_size2() was incorrectly implemented! >=20 > I hope this will be the end of the breakage: >=20 > https://svnweb.freebsd.org/changeset/base/329122 Hmm, so you add something to the lint path, and that suddenly fixes the = builds? How is that possible? Are all these ports compiled in "lint = mode"? -Dimitry --Apple-Mail=_72B1D30F-D38F-459A-A74A-F4651EE3F99D Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.2 iF0EARECAB0WIQR6tGLSzjX8bUI5T82wXqMKLiCWowUCWoBLswAKCRCwXqMKLiCW o5RBAKDwFd8KBmE6f2Cydy8fFusUEwnHcACgwpPteMH/XmpJHZzOfNPHJxIX14s= =uP8l -----END PGP SIGNATURE----- --Apple-Mail=_72B1D30F-D38F-459A-A74A-F4651EE3F99D-- From owner-svn-src-all@freebsd.org Sun Feb 11 16:12:56 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8BCA7F0185A; Sun, 11 Feb 2018 16:12:56 +0000 (UTC) (envelope-from feld@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 35D397E683; Sun, 11 Feb 2018 16:12:56 +0000 (UTC) (envelope-from feld@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2F377252FB; Sun, 11 Feb 2018 16:12:56 +0000 (UTC) (envelope-from feld@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1BGCt1p005370; Sun, 11 Feb 2018 16:12:55 GMT (envelope-from feld@FreeBSD.org) Received: (from feld@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1BGCthD005369; Sun, 11 Feb 2018 16:12:55 GMT (envelope-from feld@FreeBSD.org) Message-Id: <201802111612.w1BGCthD005369@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: feld set sender to feld@FreeBSD.org using -f From: Mark Felder Date: Sun, 11 Feb 2018 16:12:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329124 - head/share/misc X-SVN-Group: head X-SVN-Commit-Author: feld X-SVN-Commit-Paths: head/share/misc X-SVN-Commit-Revision: 329124 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Feb 2018 16:12:56 -0000 Author: feld (ports committer) Date: Sun Feb 11 16:12:55 2018 New Revision: 329124 URL: https://svnweb.freebsd.org/changeset/base/329124 Log: Add Thomas Zander to ports-secteam Modified: head/share/misc/organization.dot Modified: head/share/misc/organization.dot ============================================================================== --- head/share/misc/organization.dot Sun Feb 11 13:35:31 2018 (r329123) +++ head/share/misc/organization.dot Sun Feb 11 16:12:55 2018 (r329124) @@ -34,7 +34,7 @@ portmgr [label="Port Management Team\nportmgr@FreeBSD. portmgrsecretary [label="Port Management Team Secretary\nportmgr-secretary@FreeBSD.org\nrene"] re [label="Primary Release Engineering Team\nre@FreeBSD.org\ngjb, kib,\nbdrewery, blackend,\nrgrimes, delphij,\nhrs, glebius,\nmarius, rwatson"] secteam [label="Security Team\nsecteam@FreeBSD.org\ndelphij,\ndes, gavin, gjb,\nglebius, remko"] -portssecteam [label="Ports Security Team\nports-secteam@FreeBSD.org\ndelphij, amdmi3, eadler, feld, jgh, rea, sbz, simon, swills, zi"] +portssecteam [label="Ports Security Team\nports-secteam@FreeBSD.org\ndelphij, amdmi3, eadler, feld, jgh, rea, riggs, sbz, simon, swills, zi"] secteamsecretary [label="Security Team Secretary\nsecteam-secretary@FreeBSD.org\nremko"] securityofficer [label="Security Officer Team\nsecurity-officer@FreeBSD.org\ndelphij, des,\ngavin, gjb,\nglebius, remko"] srccommitters [label="Src Committers\nsrc-committers@FreeBSD.org"] From owner-svn-src-all@freebsd.org Sun Feb 11 16:35:24 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 80B7FF033E4; Sun, 11 Feb 2018 16:35:24 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2EC3F7F412; Sun, 11 Feb 2018 16:35:24 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 25AD72562E; Sun, 11 Feb 2018 16:35:24 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1BGZNwD015272; Sun, 11 Feb 2018 16:35:23 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1BGZN2x015270; Sun, 11 Feb 2018 16:35:23 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201802111635.w1BGZN2x015270@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sun, 11 Feb 2018 16:35:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329125 - in head/sys/dev/usb: . serial X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: in head/sys/dev/usb: . serial X-SVN-Commit-Revision: 329125 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Feb 2018 16:35:24 -0000 Author: ian Date: Sun Feb 11 16:35:23 2018 New Revision: 329125 URL: https://svnweb.freebsd.org/changeset/base/329125 Log: Add a device ID to uftdi for TIAO USB Multi Protocol Adapter (TUMPA). PR: 225810 Modified: head/sys/dev/usb/serial/uftdi.c head/sys/dev/usb/usbdevs Modified: head/sys/dev/usb/serial/uftdi.c ============================================================================== --- head/sys/dev/usb/serial/uftdi.c Sun Feb 11 16:12:55 2018 (r329124) +++ head/sys/dev/usb/serial/uftdi.c Sun Feb 11 16:35:23 2018 (r329125) @@ -522,6 +522,7 @@ static const STRUCT_USB_HOST_ID uftdi_devs[] = { UFTDI_DEV(FTDI, TERATRONIK_D2XX, 0), UFTDI_DEV(FTDI, TERATRONIK_VCP, 0), UFTDI_DEV(FTDI, THORLABS, 0), + UFTDI_DEV(FTDI, TIAO, 0), UFTDI_DEV(FTDI, TNC_X, 0), UFTDI_DEV(FTDI, TTUSB, 0), UFTDI_DEV(FTDI, TURTELIZER2, UFTDI_JTAG_IFACE(0)), Modified: head/sys/dev/usb/usbdevs ============================================================================== --- head/sys/dev/usb/usbdevs Sun Feb 11 16:12:55 2018 (r329124) +++ head/sys/dev/usb/usbdevs Sun Feb 11 16:35:23 2018 (r329125) @@ -2157,6 +2157,7 @@ product FTDI TAVIR_STK500 0xfa33 FTDI compatible adapt product FTDI TERATRONIK_D2XX 0xec89 FTDI compatible adapter product FTDI TERATRONIK_VCP 0xec88 FTDI compatible adapter product FTDI THORLABS 0xfaf0 FTDI compatible adapter +product FTDI TIAO 0x8a98 FTDI compatible adapter product FTDI TNC_X 0xebe0 FTDI compatible adapter product FTDI TTUSB 0xff20 FTDI compatible adapter product FTDI USBX_707 0xf857 FTDI compatible adapter From owner-svn-src-all@freebsd.org Sun Feb 11 16:35:57 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EC7BAF034C9; Sun, 11 Feb 2018 16:35:56 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9E9C27F55A; Sun, 11 Feb 2018 16:35:56 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9919725630; Sun, 11 Feb 2018 16:35:56 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1BGZuOK015342; Sun, 11 Feb 2018 16:35:56 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1BGZutu015341; Sun, 11 Feb 2018 16:35:56 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201802111635.w1BGZutu015341@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sun, 11 Feb 2018 16:35:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329126 - head/etc/devd X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/etc/devd X-SVN-Commit-Revision: 329126 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Feb 2018 16:35:57 -0000 Author: ian Date: Sun Feb 11 16:35:56 2018 New Revision: 329126 URL: https://svnweb.freebsd.org/changeset/base/329126 Log: Regenerate devd/usb.conf after the recent addition of several new device IDs. Modified: head/etc/devd/usb.conf Modified: head/etc/devd/usb.conf ============================================================================== --- head/etc/devd/usb.conf Sun Feb 11 16:35:23 2018 (r329125) +++ head/etc/devd/usb.conf Sun Feb 11 16:35:56 2018 (r329126) @@ -145,7 +145,7 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x0403"; - match "product" "(0x5259|0x6001|0x6004|0x6006|0x6006|0x6010|0x6011|0x6014|0x6015|0x8372|0x9378|0x9379|0x937a|0x937c|0x9868|0x9e90|0x9f80|0xa6d0|0xa6d1|0xabb8|0xb810|0xb811|0xb812|0xbaf8|0xbbe2|0xbca0|0xbca1|0xbca2|0xbca4|0xbcd8|0xbcd9|0xbcda|0xbdc8|0xbfd8|0xbfd9|0xbfda|0xbfdb|0xbfdc|0xc7d0|0xc850|0xc991|0xcaa0|0xcc48|0xcc49|0xcc4a|0xd010|0xd011|0xd012|0xd013|0xd014|0xd015|0xd016|0xd017|0xd070|0xd071|0xd388|0xd389|0xd38a|0xd38b|0xd38c|0xd38d|0xd38e|0xd38f|0xd578|0xd678|0xd738|0xd780|0xdaf8|0xdaf9|0xdafa|0xdafb|0xdafc|0xdafd|0xdafe|0xdaff|0xdc00|0xdc01|0xdd20|0xdf28|0xdf30|0xdf31|0xdf32|0xdf33|0xdf35|0xe000|0xe001|0xe002|0xe004|0xe006|0xe008|0xe009|0xe00a|0xe050|0xe0e8|0xe0e9|0xe0ea|0xe0eb|0xe0ec|0xe0ed|0xe0ee|0xe0ef|0xe0f0|0xe0f1|0xe0f2|0xe0f3|0xe0f4|0xe0f5|0xe0f6|0xe0f7|0xe40b|0xe520|0xe548|0xe6c8|0xe700|0xe729|0xe808|0xe809|0xe80a|0xe80b|0xe80c|0xe80d|0xe80e|0xe80f|0xe888|0xe889|0xe88a|0xe88b|0xe88c|0xe88d|0xe88e|0xe88f|0xea90|0xebe0|0xec88|0xec89|0xed22|0xed71|0xed72|0xed73|0xed7 4|0xee18|0xeee8|0xeee9|0xeeea|0xeeeb|0xeeec|0xeeed|0xeeee|0xeeef|0xef50|0xef51|0xf068|0xf069|0xf06a|0xf06b|0xf06c|0xf06d|0xf06e|0xf06f|0xf070|0xf0c0|0xf0c8|0xf208|0xf2d0|0xf3c0|0xf3c1|0xf3c2|0xf448|0xf449|0xf44a|0xf44b|0xf44c|0xf460|0xf608|0xf60b|0xf680|0xf850|0xf857|0xf9d0|0xf9d1|0xf9d2|0xf9d3|0xf9d4|0xf9d5|0xfa00|0xfa01|0xfa02|0xfa03|0xfa04|0xfa05|0xfa06|0xfa10|0xfa33|0xfa88|0xfad0|0xfaf0|0xfb58|0xfb59|0xfb5a|0xfb5b|0xfb5c|0xfb5d|0xfb5e|0xfb5f|0xfb80|0xfb99|0xfbfa|0xfc08|0xfc09|0xfc0a|0xfc0b|0xfc0c|0xfc0d|0xfc0e|0xfc0f|0xfc60|0xfc70|0xfc71|0xfc72|0xfc73|0xfc82|0xfd60|0xfe38|0xff00|0xff18|0xff1c|0xff1d|0xff20|0xff38|0xff39|0xff3a|0xff3b|0xff3c|0xff3d|0xff3e|0xff3f|0xffa8)"; + match "product" "(0x5259|0x6001|0x6004|0x6006|0x6006|0x6010|0x6011|0x6014|0x6015|0x8372|0x8a98|0x9378|0x9379|0x937a|0x937c|0x9868|0x9e90|0x9f80|0xa6d0|0xa6d1|0xabb8|0xb810|0xb811|0xb812|0xbaf8|0xbbe2|0xbca0|0xbca1|0xbca2|0xbca4|0xbcd8|0xbcd9|0xbcda|0xbdc8|0xbfd8|0xbfd9|0xbfda|0xbfdb|0xbfdc|0xc7d0|0xc850|0xc991|0xcaa0|0xcc48|0xcc49|0xcc4a|0xd010|0xd011|0xd012|0xd013|0xd014|0xd015|0xd016|0xd017|0xd070|0xd071|0xd388|0xd389|0xd38a|0xd38b|0xd38c|0xd38d|0xd38e|0xd38f|0xd578|0xd678|0xd738|0xd780|0xdaf8|0xdaf9|0xdafa|0xdafb|0xdafc|0xdafd|0xdafe|0xdaff|0xdc00|0xdc01|0xdd20|0xdf28|0xdf30|0xdf31|0xdf32|0xdf33|0xdf35|0xe000|0xe001|0xe002|0xe004|0xe006|0xe008|0xe009|0xe00a|0xe050|0xe0e8|0xe0e9|0xe0ea|0xe0eb|0xe0ec|0xe0ed|0xe0ee|0xe0ef|0xe0f0|0xe0f1|0xe0f2|0xe0f3|0xe0f4|0xe0f5|0xe0f6|0xe0f7|0xe40b|0xe520|0xe548|0xe6c8|0xe700|0xe729|0xe808|0xe809|0xe80a|0xe80b|0xe80c|0xe80d|0xe80e|0xe80f|0xe888|0xe889|0xe88a|0xe88b|0xe88c|0xe88d|0xe88e|0xe88f|0xea90|0xebe0|0xec88|0xec89|0xed22|0xed71|0xed72|0xed7 3|0xed74|0xee18|0xeee8|0xeee9|0xeeea|0xeeeb|0xeeec|0xeeed|0xeeee|0xeeef|0xef50|0xef51|0xf068|0xf069|0xf06a|0xf06b|0xf06c|0xf06d|0xf06e|0xf06f|0xf070|0xf0c0|0xf0c8|0xf208|0xf2d0|0xf3c0|0xf3c1|0xf3c2|0xf448|0xf449|0xf44a|0xf44b|0xf44c|0xf460|0xf608|0xf60b|0xf680|0xf850|0xf857|0xf9d0|0xf9d1|0xf9d2|0xf9d3|0xf9d4|0xf9d5|0xfa00|0xfa01|0xfa02|0xfa03|0xfa04|0xfa05|0xfa06|0xfa10|0xfa33|0xfa88|0xfad0|0xfaf0|0xfb58|0xfb59|0xfb5a|0xfb5b|0xfb5c|0xfb5d|0xfb5e|0xfb5f|0xfb80|0xfb99|0xfbfa|0xfc08|0xfc09|0xfc0a|0xfc0b|0xfc0c|0xfc0d|0xfc0e|0xfc0f|0xfc60|0xfc70|0xfc71|0xfc72|0xfc73|0xfc82|0xfd60|0xfe38|0xff00|0xff18|0xff1c|0xff1d|0xff20|0xff38|0xff39|0xff3a|0xff3b|0xff3c|0xff3d|0xff3e|0xff3f|0xffa8)"; action "kldload -n uftdi"; }; @@ -2793,7 +2793,7 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x0bda"; - match "product" "0x8754"; + match "product" "(0x8754|0x8812)"; action "kldload -n if_rtwn_usb"; }; @@ -3681,7 +3681,7 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x10c4"; - match "product" "(0x8066|0x806f|0x807a|0x80c4|0x80ca|0x80dd|0x80ed|0x80f6|0x8115|0x813d|0x813f|0x814a|0x814a|0x814b|0x8156|0x815e|0x815f|0x818b|0x819f|0x81a6|0x81a9|0x81ac|0x81ad|0x81c8|0x81e2|0x81e7|0x81e8|0x81f2|0x8218|0x822b|0x826b|0x8293|0x82f9|0x8341|0x8382|0x83a8|0x83d8|0x8411|0x8418|0x846e|0x8477|0x85ea|0x85eb|0x85f8|0x8664|0x8665|0x88a4|0x88a5|0xea60|0xea61|0xea70|0xea71|0xea80|0xf001|0xf002|0xf003|0xf004)"; + match "product" "(0x8066|0x806f|0x807a|0x80c4|0x80ca|0x80dd|0x80ed|0x80f6|0x8115|0x813d|0x813f|0x814a|0x814a|0x814b|0x8156|0x815e|0x815f|0x818b|0x819f|0x81a6|0x81a9|0x81ac|0x81ad|0x81c8|0x81e2|0x81e7|0x81e8|0x81f2|0x8218|0x822b|0x826b|0x8293|0x82f9|0x8341|0x8382|0x83a8|0x83d8|0x8411|0x8418|0x846e|0x8477|0x85ea|0x85eb|0x85f8|0x8664|0x8665|0x88a4|0x88a5|0x8a2a|0xea60|0xea61|0xea70|0xea71|0xea80|0xf001|0xf002|0xf003|0xf004)"; action "kldload -n uslcom"; }; @@ -3921,7 +3921,7 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x12d1"; - match "product" "(0x1573|0x15c1|0x1803|0x1c05|0x1c0b)"; + match "product" "(0x155b|0x1573|0x15c1|0x1803|0x1c05|0x1c0b|0x1c1e)"; action "kldload -n u3g"; }; @@ -4432,6 +4432,14 @@ nomatch 32 { nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; + match "vendor" "0x15eb"; + match "product" "0x7d0e"; + action "kldload -n u3g"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; match "vendor" "0x1614"; match "product" "(0x0800|0x0802|0x7002)"; action "kldload -n u3g"; @@ -5328,6 +5336,14 @@ nomatch 32 { nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; + match "vendor" "0x2357"; + match "product" "0x0601"; + action "kldload -n if_ure"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; match "vendor" "0x2405"; match "product" "0x0003"; action "kldload -n uslcom"; @@ -5352,6 +5368,14 @@ nomatch 32 { nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; + match "vendor" "0x2c7c"; + match "product" "0x0125"; + action "kldload -n u3g"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; match "vendor" "0x3195"; match "product" "(0xf190|0xf280|0xf281)"; action "kldload -n uslcom"; @@ -5727,6 +5751,46 @@ nomatch 32 { match "vendor" "0x12d1"; match "intclass" "0xff"; match "intsubclass" "0x02"; + match "intprotocol" "0x01"; + action "kldload -n umodem"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x12d1"; + match "intclass" "0xff"; + match "intsubclass" "0x02"; + match "intprotocol" "0x02"; + action "kldload -n umodem"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x12d1"; + match "intclass" "0xff"; + match "intsubclass" "0x02"; + match "intprotocol" "0x10"; + action "kldload -n umodem"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x12d1"; + match "intclass" "0xff"; + match "intsubclass" "0x02"; + match "intprotocol" "0x12"; + action "kldload -n umodem"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x12d1"; + match "intclass" "0xff"; + match "intsubclass" "0x02"; match "intprotocol" "0x16"; action "kldload -n if_cdce"; }; @@ -5747,12 +5811,42 @@ nomatch 32 { match "vendor" "0x12d1"; match "intclass" "0xff"; match "intsubclass" "0x02"; + match "intprotocol" "0x61"; + action "kldload -n umodem"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x12d1"; + match "intclass" "0xff"; + match "intsubclass" "0x02"; + match "intprotocol" "0x62"; + action "kldload -n umodem"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x12d1"; + match "intclass" "0xff"; + match "intsubclass" "0x02"; match "intprotocol" "0x76"; action "kldload -n if_cdce"; }; nomatch 32 { match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x12d1"; + match "intclass" "0xff"; + match "intsubclass" "0x03"; + match "intprotocol" "0x16"; + action "kldload -n if_cdce"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; match "mode" "(host|device)"; match "intclass" "0x02"; match "intsubclass" "0x02"; @@ -5921,5 +6015,5 @@ nomatch 32 { action "kldload -n umass"; }; -# 2760 USB entries processed +# 2775 USB entries processed From owner-svn-src-all@freebsd.org Sun Feb 11 16:54:48 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 28EADF04EEA for ; Sun, 11 Feb 2018 16:54:48 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from sonic306-35.consmr.mail.ne1.yahoo.com (sonic306-35.consmr.mail.ne1.yahoo.com [66.163.189.97]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 28002807A2 for ; Sun, 11 Feb 2018 16:54:47 +0000 (UTC) (envelope-from pfg@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1518368086; bh=WtDuCuHH7EPhguGbusEbHD1Sp6M3vzSHsINTlFSePJ8=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From:Subject; b=KyjMMklJ33c+2jQRjtJUnJn8mPFhc0yVsQ82HvFkBXSXER7XTpbpcqUvPpjP3ubfZSOy/9dBaWDaSwNrezAWQiAblEg2otMSNXhEGMaTQPtgdFjZ+jf8K7/9c/SqbaqPz4z7Ai0d7pYFTd4ONGRpdjtxi9MDACsC7FU1g1tJVEQmAW+Le61nIdCnCsTuph/FnBR8ZHZPyCiheDjWsJPxkDCPcZcaBHgT/cA8Y2IFJjgtBgO+nrjNgrd0io7vfVIRgkBIL2dnIwXOLrM27VOH/0FfG8LmTrVtbfeMuFv10OLgBoiEhwDKU8pv75CeG//cjVhhNSUmAhyfnodpL41RAg== X-YMail-OSG: 8pPWtHgVM1lP5hSHImNzSlgBS79d__1dFprm7Igv9GXZpwwm9QfsPhNo7sWon_L cQx9QNjillhtC9fNgI_S.R3.F95w3jsAGPMhVkAxHn2vrNcnLA7.gnPCrvuRTaJ0IW7j740X8dRf Z1_yfVplyAJto9tgaVS4xzNRoVnRwfQ6dz7chMEFLMfFsRRvYaDJsBp97RY_10QkkpHX76b.1D6I cKL8kKv.PdkxwK3Q7qtwEd6updrUnHuV39kj3Fw0KJPj6jdnK4bfCkrbfkVQekxqpgne0JgB.fy3 o.c1F901hfnj1n56JYbKEQZyGAVdHitMKjbvetCqbI4qhBJQGgokpU.zUEw_FUbmdESG8WyeXxEf e01IJfa9LPEpDOs22o66.1aJzP4vGxiIinCYG2HStzmW6Nvr8Udcj8OgnuFKaDhP3xcKbWlzAfwi pXaRbBYP6JQjQJYbf9ncRmGDz9cD2kUaXc7RkX6d7yB5Gu.lbiPmPCAGyFYE0p7Sm.6h0R0s5uUh wFnKF_TM6Kg-- Received: from sonic.gate.mail.ne1.yahoo.com by sonic306.consmr.mail.ne1.yahoo.com with HTTP; Sun, 11 Feb 2018 16:54:46 +0000 Received: from smtp230.mail.ne1.yahoo.com (EHLO [192.168.0.8]) ([10.218.253.211]) by smtp409.mail.ne1.yahoo.com (JAMES SMTP Server ) with ESMTPA ID b87cb78e870cdc10322a74f0b8f86ff3; Sun, 11 Feb 2018 16:54:45 +0000 (UTC) Subject: Re: svn commit: r328973 - in stable/11: include sys/sys To: Hans Petter Selasky , Antoine Brodin Cc: src-committers , svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org, re References: <201802071506.w17F6s5l043163@repo.freebsd.org> From: Pedro Giffuni Organization: FreeBSD Project Message-ID: <28983217-7cbf-6ef8-8197-de122af9bf6f@FreeBSD.org> Date: Sun, 11 Feb 2018 11:54:44 -0500 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Feb 2018 16:54:48 -0000 ... On 11/02/2018 05:24, Hans Petter Selasky wrote: > On 02/11/18 11:09, Antoine Brodin wrote: >> On Sun, Feb 11, 2018 at 8:01 AM, Antoine Brodin >> wrote: >>> On Wed, Feb 7, 2018 at 4:06 PM, Hans Petter Selasky >>> wrote: >>>> Author: hselasky >>>> Date: Wed Feb  7 15:06:54 2018 >>>> New Revision: 328973 >>>> URL: https://svnweb.freebsd.org/changeset/base/328973 >>>> >>>> Log: >>>>    MFC r328237: >>>>    Use the __alloc_size2 attribute where relevant. >>>> >>>>    This follows the documented use in GCC. It is basically only >>>> relevant for >>>>    calloc(3), reallocarray(3) and  mallocarray(9). >>>> >>>>    NOTE: Without this change clang 5.0.1 can produce incorrect >>>> optimisation >>>>    code for static processing of data using the allocated object. >>>> For example >>>>    this has been seen compiling the mlx4 core module, which >>>> allocates a >>>>    fixed size array which is then sorted by a fixed order loop. The >>>>    optimised result, -O2, is incorrect unless this patch is in place. >>>> >>>>    Suggested by: Mark Millard >>>>    Reference: >>>> https://docs.freebsd.org/cgi/mid.cgi?9DE674C6-EAA3-4E8A-906F-446E74D82FC4 >>>> >>>> Modified: >>>>    stable/11/include/stdlib.h >>>>    stable/11/sys/sys/malloc.h >>>> Directory Properties: >>>>    stable/11/   (props changed) >>> >>> Hi, >>> >>> Please revert this change.  Lots of ports that used to build fine on >>> stable/11 are now failing. >>> /usr/include/stdlib.h:93:7: error: expected function body after >>> function declarator >>>               __alloc_size2(1, 2); >> > > Hi Antoine, > > I'm sorry for the inconvenience. Probably I should have sent this > patch for portmgr first, to avoid such breakage. This patch is > required also for ports, and it is good you are now rebuilding ports > which use this define, because they might be broken due to the fact > the __alloc_size2() was incorrectly implemented! > > I hope this will be the end of the breakage: > > https://svnweb.freebsd.org/changeset/base/329122 > > Else I will revert both patches and have you test them first. > > --HPS > While the lint mode definition was missing, I didn't merge the attribute uses (r328237) on purpose as I knew they could bring issues. Some rather broken ports like to take the standard headers and "fix" them. In essence, any port that requires an attribute defined in sys/cdefs.h is doing something wrong. The most notable offender was GCC but I think that was fixed: in any case, the last time I merged an attribute change I had to wait for the next release to start using it. Cheers, Pedro. From owner-svn-src-all@freebsd.org Sun Feb 11 17:09:44 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B8B4DF06086; Sun, 11 Feb 2018 17:09:44 +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 4F56E8105D; Sun, 11 Feb 2018 17:09:43 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from coleburn.home.andric.com (coleburn.home.andric.com [192.168.0.15]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id 80E3E1DFF8; Sun, 11 Feb 2018 18:09:42 +0100 (CET) From: Dimitry Andric Message-Id: Content-Type: multipart/signed; boundary="Apple-Mail=_B5CEA6CA-1D2A-4A47-AD7B-EA05B59FAFCB"; protocol="application/pgp-signature"; micalg=pgp-sha1 Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) Subject: Re: svn commit: r328973 - in stable/11: include sys/sys Date: Sun, 11 Feb 2018 18:09:36 +0100 In-Reply-To: <28983217-7cbf-6ef8-8197-de122af9bf6f@FreeBSD.org> Cc: Hans Petter Selasky , Antoine Brodin , src-committers , svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org, re To: Pedro Giffuni References: <201802071506.w17F6s5l043163@repo.freebsd.org> <28983217-7cbf-6ef8-8197-de122af9bf6f@FreeBSD.org> X-Mailer: Apple Mail (2.3273) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Feb 2018 17:09:44 -0000 --Apple-Mail=_B5CEA6CA-1D2A-4A47-AD7B-EA05B59FAFCB Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii On 11 Feb 2018, at 17:54, Pedro Giffuni wrote: ... > While the lint mode definition was missing, I didn't merge the = attribute uses (r328237) on purpose as I knew they could bring issues. = Some rather broken ports like to take the standard headers and "fix" = them. In essence, any port that requires an attribute defined in = sys/cdefs.h is doing something wrong. >=20 > The most notable offender was GCC but I think that was fixed: in any = case, the last time I merged an attribute change I had to wait for the = next release to start using it. The "fixincludes" feature you are referring to was finally removed by Gerald in r444860 for gcc5, and for other gcc ports in later revisions: https://svnweb.freebsd.org/ports?view=3Drevision&revision=3D444860 so both the latest quarterly and the current package collection should have no more gcc's with mangled system headers. -Dimitry --Apple-Mail=_B5CEA6CA-1D2A-4A47-AD7B-EA05B59FAFCB Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.2 iF0EARECAB0WIQR6tGLSzjX8bUI5T82wXqMKLiCWowUCWoB40AAKCRCwXqMKLiCW o6ZpAJ0SRuI7Mi9X2FxDnEDCH0/DBsFjPQCfXuW3GXP3ZMs+E4oPdspPXtfJErM= =NG6F -----END PGP SIGNATURE----- --Apple-Mail=_B5CEA6CA-1D2A-4A47-AD7B-EA05B59FAFCB-- From owner-svn-src-all@freebsd.org Sun Feb 11 17:45:39 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 72BD5F08CBD; Sun, 11 Feb 2018 17:45:39 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 21D0682623; Sun, 11 Feb 2018 17:45:39 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1CD05261DB; Sun, 11 Feb 2018 17:45:39 +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 w1BHjcwW050693; Sun, 11 Feb 2018 17:45:38 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1BHjcWA050692; Sun, 11 Feb 2018 17:45:38 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201802111745.w1BHjcWA050692@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sun, 11 Feb 2018 17:45:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329127 - head/sys/sys X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/sys X-SVN-Commit-Revision: 329127 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Feb 2018 17:45:39 -0000 Author: imp Date: Sun Feb 11 17:45:38 2018 New Revision: 329127 URL: https://svnweb.freebsd.org/changeset/base/329127 Log: Consistent macro indentation is the hobgoblin of small minds Line up the macro definitions and names here like the machine/stdarg.h files that this replaced. This is easier to read and also makes it easier to match up with other includes. Also two space indent va_end to match the rest of the surrounding if block. Modified: head/sys/sys/_stdarg.h Modified: head/sys/sys/_stdarg.h ============================================================================== --- head/sys/sys/_stdarg.h Sun Feb 11 16:35:56 2018 (r329126) +++ head/sys/sys/_stdarg.h Sun Feb 11 17:45:38 2018 (r329127) @@ -43,13 +43,13 @@ #endif #ifdef __GNUCLIKE_BUILTIN_STDARG - #define va_start(ap, last) __builtin_va_start((ap), (last)) - #define va_arg(ap, type) __builtin_va_arg((ap), type) - #define __va_copy(dest, src) __builtin_va_copy((dest), (src)) + #define va_start(ap, last) __builtin_va_start((ap), (last)) + #define va_arg(ap, type) __builtin_va_arg((ap), type) + #define __va_copy(dest, src) __builtin_va_copy((dest), (src)) #if __ISO_C_VISIBLE >= 1999 - #define va_copy(dest, src) __va_copy(dest, src) + #define va_copy(dest, src) __va_copy(dest, src) #endif -#define va_end(ap) __builtin_va_end(ap) + #define va_end(ap) __builtin_va_end(ap) #endif #if defined(lint) && !defined(va_start) From owner-svn-src-all@freebsd.org Sun Feb 11 18:27:12 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E279EF0BB8F; Sun, 11 Feb 2018 18:27:11 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-it0-f52.google.com (mail-it0-f52.google.com [209.85.214.52]) (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 7A3A783CE8; Sun, 11 Feb 2018 18:27:11 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-it0-f52.google.com with SMTP id b66so4194628itd.5; Sun, 11 Feb 2018 10:27:11 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:reply-to:in-reply-to:references :from:date:message-id:subject:to:cc; bh=ofmFeaXbQlXFfnhpd0v81PgGZ79b5OM4b7FjKs75wMg=; b=Kg4iIpZCO5t6qwF8Oh1PdMgKONow9KWcKXRZYRIM5MBhgaDl3ng4r4EyPn4OLZPk8C TFubXk9PbpsCyCETv9osrjcZ8EMhl6K2IQvqLpONUz2viFV4d3wCJ5qztVoVAMd3Pho4 qiJzUWY/AMlxv2Zo4/R7MW7ZD05ODPCtebiDPXjaW3lTq5U52cqvZQFWaN6GQ3Va+Wp3 uaM/6qWysVGQwIH+SfTnSlHGELfXEKcl/bOml2VO14Gj1sH9hx94gmbBFSbuW+y6BuHq pfWeITpbjH0uuVd6CY1WChYs3KHmK+j5ABSYYiQd0IC9AhpjXTRj2EctwyMGejxMZIFB sWIA== X-Gm-Message-State: APf1xPBsboMPS1IgKp7GYeKSmzsNo4V7Em/SnQZvckycFIPgNQxMnwI1 pbwVy8r7Pgom4HklfoRJW6Qtim+r X-Google-Smtp-Source: AH8x224uCmK+vP56F1+dXWSYbaag2h1/3mkxOhl/L3sxVHq1vX1F26LTV1N6ddj2QkRf0PQnt5hiKg== X-Received: by 10.36.2.213 with SMTP id 204mr2480956itu.121.1518373220098; Sun, 11 Feb 2018 10:20:20 -0800 (PST) Received: from mail-io0-f169.google.com (mail-io0-f169.google.com. [209.85.223.169]) by smtp.gmail.com with ESMTPSA id b185sm4747568itb.20.2018.02.11.10.20.19 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 11 Feb 2018 10:20:19 -0800 (PST) Received: by mail-io0-f169.google.com with SMTP id l17so15027196ioc.3; Sun, 11 Feb 2018 10:20:19 -0800 (PST) X-Received: by 10.107.175.151 with SMTP id p23mr1495265ioo.215.1518373219181; Sun, 11 Feb 2018 10:20:19 -0800 (PST) MIME-Version: 1.0 Reply-To: cem@freebsd.org Received: by 10.2.30.149 with HTTP; Sun, 11 Feb 2018 10:20:18 -0800 (PST) In-Reply-To: <201802111635.w1BGZutu015341@repo.freebsd.org> References: <201802111635.w1BGZutu015341@repo.freebsd.org> From: Conrad Meyer Date: Sun, 11 Feb 2018 10:20:18 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r329126 - head/etc/devd To: Ian Lepore Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Feb 2018 18:27:12 -0000 On Sun, Feb 11, 2018 at 8:35 AM, Ian Lepore wrote: > Author: ian > Date: Sun Feb 11 16:35:56 2018 > New Revision: 329126 > URL: https://svnweb.freebsd.org/changeset/base/329126 > > Log: > Regenerate devd/usb.conf after the recent addition of several new device IDs. > > Modified: > head/etc/devd/usb.conf If this file is machine generated and not an administrator configuration file, shouldn't it live in /usr/share instead of /etc, per hier(7)? Best, Conrad From owner-svn-src-all@freebsd.org Sun Feb 11 18:33:23 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6304BF0C292; Sun, 11 Feb 2018 18:33:23 +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 0C59484295; Sun, 11 Feb 2018 18:33:22 +0000 (UTC) (envelope-from brooks@spindle.one-eyed-alien.net) Received: by spindle.one-eyed-alien.net (Postfix, from userid 3001) id 90BD75A9F12; Sun, 11 Feb 2018 18:33:16 +0000 (UTC) Date: Sun, 11 Feb 2018 18:33:16 +0000 From: Brooks Davis To: Conrad Meyer Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r329109 - head/share/man/man9 Message-ID: <20180211183316.GB91264@spindle.one-eyed-alien.net> References: <201802102034.w1AKY9IP015134@repo.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="XsQoSWH+UP9D9v3l" Content-Disposition: inline In-Reply-To: <201802102034.w1AKY9IP015134@repo.freebsd.org> User-Agent: Mutt/1.9.1 (2017-09-22) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Feb 2018 18:33:23 -0000 --XsQoSWH+UP9D9v3l Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Feb 10, 2018 at 08:34:09PM +0000, Conrad Meyer wrote: > Author: cem > Date: Sat Feb 10 20:34:09 2018 > New Revision: 329109 > URL: https://svnweb.freebsd.org/changeset/base/329109 >=20 > Log: > Document syscall_helper_register(9), syscall_helper_unregister(9) Thanks! We should probably also document the syscall32_helper_register and the associated macros (which confusingly use an entirely different meaning for _COMPAT (use the sys_ version)). -- Brooks --XsQoSWH+UP9D9v3l Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEcBAEBAgAGBQJagIxrAAoJEKzQXbSebgfAFF0H/3bnHPpnvlW3tYzvu8mmJWQ4 D0xzWbD1pnfNSFa6iraFf0JrRFdhbJif/LREMXJ5qPe2Bdj3eJdmqNHb1t255OSK J62MdMAZ1xP4N8Tb67iuE+xJCbF4+DiuIRp2vTZuwstgXlGFc00XShBklgvAKz3i jUhmSYM+2x9cJQFsYBBF6+3+R9AgLqC8RF7Wzj6BlPo/0lRVbjI6B89EiVxLU/+c pPUeVERlSChflSGy8PfCJ1c86mQJpu2DxLSVuhPCJ41kLvsEqjXOmZmMr3PkogW1 E2hS2nfG6QEl5HlWpu0S7GHJWiF8DoPuFDMqziiKNVg8qy+bM9wGyoFTA3guN1E= =NFN+ -----END PGP SIGNATURE----- --XsQoSWH+UP9D9v3l-- From owner-svn-src-all@freebsd.org Sun Feb 11 18:37:09 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2DB12F0C714; Sun, 11 Feb 2018 18:37:09 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D5611845DF; Sun, 11 Feb 2018 18:37:08 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B213F26A24; Sun, 11 Feb 2018 18:37:08 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1BIb8bo075574; Sun, 11 Feb 2018 18:37:08 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1BIb8Oo075573; Sun, 11 Feb 2018 18:37:08 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201802111837.w1BIb8Oo075573@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Sun, 11 Feb 2018 18:37:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329128 - head/sys/kgssapi X-SVN-Group: head X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: head/sys/kgssapi X-SVN-Commit-Revision: 329128 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Feb 2018 18:37:09 -0000 Author: brooks Date: Sun Feb 11 18:37:08 2018 New Revision: 329128 URL: https://svnweb.freebsd.org/changeset/base/329128 Log: Use syscall_helper_register(9) rather than syscall_register(). The usage is simpler, documented, and more common. Reviewed by: cem Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D14227 Modified: head/sys/kgssapi/gss_impl.c Modified: head/sys/kgssapi/gss_impl.c ============================================================================== --- head/sys/kgssapi/gss_impl.c Sun Feb 11 17:45:38 2018 (r329127) +++ head/sys/kgssapi/gss_impl.c Sun Feb 11 18:37:08 2018 (r329128) @@ -56,39 +56,33 @@ MALLOC_DEFINE(M_GSSAPI, "GSS-API", "GSS-API"); /* * Syscall hooks */ -static int gssd_syscall_offset = SYS_gssd_syscall; -static struct sysent gssd_syscall_prev_sysent; -MAKE_SYSENT(gssd_syscall); -static bool_t gssd_syscall_registered = FALSE; +static struct syscall_helper_data gssd_syscalls[] = { + SYSCALL_INIT_HELPER(gssd_syscall), + SYSCALL_INIT_LAST +}; struct kgss_mech_list kgss_mechs; CLIENT *kgss_gssd_handle; struct mtx kgss_gssd_lock; -static void -kgss_init(void *dummy) +static int +kgss_load(void) { int error; LIST_INIT(&kgss_mechs); - error = syscall_register(&gssd_syscall_offset, &gssd_syscall_sysent, - &gssd_syscall_prev_sysent, SY_THR_STATIC_KLD); - if (error) - printf("Can't register GSSD syscall\n"); - else - gssd_syscall_registered = TRUE; + error = syscall_helper_register(gssd_syscalls, SY_THR_STATIC_KLD); + if (error != 0) + return (error); + return (0); } -SYSINIT(kgss_init, SI_SUB_LOCK, SI_ORDER_FIRST, kgss_init, NULL); static void -kgss_uninit(void *dummy) +kgss_unload(void) { - if (gssd_syscall_registered) - syscall_deregister(&gssd_syscall_offset, - &gssd_syscall_prev_sysent); + syscall_helper_unregister(gssd_syscalls); } -SYSUNINIT(kgss_uninit, SI_SUB_LOCK, SI_ORDER_FIRST, kgss_uninit, NULL); int sys_gssd_syscall(struct thread *td, struct gssd_syscall_args *uap) @@ -293,6 +287,8 @@ kgssapi_modevent(module_t mod, int type, void *data) switch (type) { case MOD_LOAD: + if (error != 0) + return (error); rpc_gss_entries.rpc_gss_refresh_auth = rpc_gss_refresh_auth; rpc_gss_entries.rpc_gss_secfind = rpc_gss_secfind; rpc_gss_entries.rpc_gss_secpurge = rpc_gss_secpurge; @@ -317,8 +313,11 @@ kgssapi_modevent(module_t mod, int type, void *data) rpc_gss_entries.rpc_gss_svc_max_data_length = rpc_gss_svc_max_data_length; mtx_init(&kgss_gssd_lock, "kgss_gssd_lock", NULL, MTX_DEF); + error = kgss_load(); break; case MOD_UNLOAD: + kgss_unload(); + mtx_destroy(&kgss_gssd_lock); /* * Unloading of the kgssapi module is not currently supported. * If somebody wants this, we would need to keep track of From owner-svn-src-all@freebsd.org Sun Feb 11 18:42:38 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 68A00F0CE12 for ; Sun, 11 Feb 2018 18:42:38 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound1b.ore.mailhop.org (outbound1b.ore.mailhop.org [54.200.247.200]) (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 E9D9D84B1B for ; Sun, 11 Feb 2018 18:42:37 +0000 (UTC) (envelope-from ian@freebsd.org) X-MHO-User: 49701746-0f5b-11e8-bb8e-b35b57339d60 X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 67.177.211.60 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [67.177.211.60]) by outbound1.ore.mailhop.org (Halon) with ESMTPSA id 49701746-0f5b-11e8-bb8e-b35b57339d60; Sun, 11 Feb 2018 18:42:18 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id w1BIgTEC032446; Sun, 11 Feb 2018 11:42:29 -0700 (MST) (envelope-from ian@freebsd.org) Message-ID: <1518374549.32585.238.camel@freebsd.org> Subject: Re: svn commit: r329126 - head/etc/devd From: Ian Lepore To: cem@freebsd.org Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Sun, 11 Feb 2018 11:42:29 -0700 In-Reply-To: References: <201802111635.w1BGZutu015341@repo.freebsd.org> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.18.5.1 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Feb 2018 18:42:38 -0000 On Sun, 2018-02-11 at 10:20 -0800, Conrad Meyer wrote: > On Sun, Feb 11, 2018 at 8:35 AM, Ian Lepore wrote: > > > > Author: ian > > Date: Sun Feb 11 16:35:56 2018 > > New Revision: 329126 > > URL: https://svnweb.freebsd.org/changeset/base/329126 > > > > Log: > >   Regenerate devd/usb.conf after the recent addition of several new > > device IDs. > > > > Modified: > >   head/etc/devd/usb.conf > > If this file is machine generated and not an administrator > configuration file, shouldn't it live in /usr/share instead of /etc, > per hier(7)? > > Best, > Conrad > I wonder if that question would apply to all five files we put in /etc/devd?  It looks like they could be moved to /usr/share with minimal fuss by adding that directory to the search list in /etc/devd.conf. I'm agnostic about the value of moving them.  Users can configure local rules by modifying the existing devd.conf and files in devd/ and dealing with mergemaster on updates, or by adding their own new files in devd/. -- Ian From owner-svn-src-all@freebsd.org Sun Feb 11 19:08:28 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2BA9BF0EE59 for ; Sun, 11 Feb 2018 19:08:28 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-io0-x230.google.com (mail-io0-x230.google.com [IPv6:2607:f8b0:4001:c06::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 B296885B17 for ; Sun, 11 Feb 2018 19:08:27 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-io0-x230.google.com with SMTP id f89so15062472ioj.4 for ; Sun, 11 Feb 2018 11:08:27 -0800 (PST) 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=3aXLx4diqSDU+1sh60awgiDIPzxSPgBDLU0MSb8pK7o=; b=dZX3ILydaHANsiLY6Sd/1xmM8DQvBMUUy0Q4IE69cyac+5b1mGugcQr/jHIYS4RFVQ N3u9IU+5LOamj+IBZJMyHtXp3FMIZTFfQZD2lKlWhb3fSBPOwND2aWOx0nOpLMkUXhEx 64gozbQbT7Jz0OfFlyNgW2k6g/iVNi9ABFp3j0OYooey5aJzs2IJGCKPR1UzxTIxiO59 lram3yjhkxAP1AqILiN/+17JgzlgRpoO2OavGzipyOQ6wz2uHqMrIwUn1WvHJ1FzshvS R8enNLtDGowEML8oxRUbuGMOx6T7h3zvh1Ri4jrGTMqax9PEx5K+V4FPny+yierCRh47 u0ng== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=3aXLx4diqSDU+1sh60awgiDIPzxSPgBDLU0MSb8pK7o=; b=m0U0LBBR3c1zucAE0QHzwGaaep6vN84tOIjBArwqfCJpVQVzQjKpnzQCP+BgFyJj2o lwQTup9R16/lK+J5iV+DRqf2F5VOl9ehV4HgAFG4NUVP/1kdrgFxdbgWay66acDHoOPk Q8Bq/9YikF8CCh/NoPfLjVdCQ48kldhLeC3K5dvei0xIvMPyg7OuLsTZy0vmL5t+jrZp d9SpHg5fNRw4+JZ119sUg3R23IrCvgArONnI2/BDCMh9Zf1B47zX2XyYe9WgBPC72Qbb GTaf7hnBNw6y7akYZhsI08z1VQAP6YudNM+eGBMO90aTI2eXeawrRZ+PtWq0Wrm/EiAE 2tKg== X-Gm-Message-State: APf1xPC0+iOHsFPpoirdZaJso/yunDzTgxj/UgRFxVjDc84rOHbFB+6N TccIx+nn+C30Z+yl4VGUYZI2cyPcdQpVRxBySinmvw== X-Google-Smtp-Source: AH8x225PSdUof6ihn3k81cw6wy85d02a5bAjpuOqWzNWhs1/832w0ljQ00MoCDQnYRFg0BLfi77HWCogCnI4ltIgMN8= X-Received: by 10.107.88.12 with SMTP id m12mr9752028iob.136.1518376106980; Sun, 11 Feb 2018 11:08:26 -0800 (PST) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.201.67 with HTTP; Sun, 11 Feb 2018 11:08:26 -0800 (PST) X-Originating-IP: [2603:300b:6:5100:18a2:a4f7:170:8dd9] In-Reply-To: <1518374549.32585.238.camel@freebsd.org> References: <201802111635.w1BGZutu015341@repo.freebsd.org> <1518374549.32585.238.camel@freebsd.org> From: Warner Losh Date: Sun, 11 Feb 2018 12:08:26 -0700 X-Google-Sender-Auth: eY3dVMqY7Zbc4PNhmj0OQjzAIDI Message-ID: Subject: Re: svn commit: r329126 - head/etc/devd To: Ian Lepore Cc: "Conrad E. Meyer" , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.25 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Feb 2018 19:08:28 -0000 On Sun, Feb 11, 2018 at 11:42 AM, Ian Lepore wrote: > On Sun, 2018-02-11 at 10:20 -0800, Conrad Meyer wrote: > > On Sun, Feb 11, 2018 at 8:35 AM, Ian Lepore wrote: > > > > > > Author: ian > > > Date: Sun Feb 11 16:35:56 2018 > > > New Revision: 329126 > > > URL: https://svnweb.freebsd.org/changeset/base/329126 > > > > > > Log: > > > Regenerate devd/usb.conf after the recent addition of several new > > > device IDs. > > > > > > Modified: > > > head/etc/devd/usb.conf > > > > If this file is machine generated and not an administrator > > configuration file, shouldn't it live in /usr/share instead of /etc, > > per hier(7)? > > > > Best, > > Conrad > > > > I wonder if that question would apply to all five files we put in > /etc/devd? It looks like they could be moved to /usr/share with > minimal fuss by adding that directory to the search list in > /etc/devd.conf. > > I'm agnostic about the value of moving them. Users can configure local > rules by modifying the existing devd.conf and files in devd/ and > dealing with mergemaster on updates, or by adding their own new files > in devd/. > It doesn't matter. We're better off throwing the generated stuff away entirely and migrating this to devmatch. Warner From owner-svn-src-all@freebsd.org Sun Feb 11 19:30:03 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B1073F10913; Sun, 11 Feb 2018 19:30:02 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5DEEE86712; Sun, 11 Feb 2018 19:30:02 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 58ABA27266; Sun, 11 Feb 2018 19:30:02 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1BJU2rC000847; Sun, 11 Feb 2018 19:30:02 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1BJTw3n000776; Sun, 11 Feb 2018 19:29:58 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201802111929.w1BJTw3n000776@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sun, 11 Feb 2018 19:29:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r329129 - in stable/11/sys/boot: . arm/uboot common efi/boot1 efi/fdt efi/include efi/libefi efi/loader fdt i386/gptboot i386/gptzfsboot i386/libfirewire i386/libi386 i386/loader i386/z... X-SVN-Group: stable-11 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in stable/11/sys/boot: . arm/uboot common efi/boot1 efi/fdt efi/include efi/libefi efi/loader fdt i386/gptboot i386/gptzfsboot i386/libfirewire i386/libi386 i386/loader i386/zfsboot libstand32 mips/be... X-SVN-Commit-Revision: 329129 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Feb 2018 19:30:03 -0000 Author: kevans Date: Sun Feb 11 19:29:58 2018 New Revision: 329129 URL: https://svnweb.freebsd.org/changeset/base/329129 Log: MFC Loader Fixes 2017q4p1: r324321,r324359,r324360,r324388,r324449,r324450, r324451,r324452 r324321: This README file was quite relevant for FreeBSD 3 or 4. No more. r324359: Add efi_devpath_is_prefix r324360: Encapsulate ZFS preferences into efi_zfs_is_preferred r324388: Unbreak building efiboot with MK_ZFS == no r324449: Prefer ${LIBSTAND} to -lstand r324450: Define SASRC and use it r324451: Add missing -I${SASRC} in a couple of places so that stand.h doesn't accidentally come in via host pollution. r324452: Define LIBSA* and use them instead of overloaded LIBSTAND Added: stable/11/sys/boot/userboot/Makefile.inc - copied unchanged from r324450, head/sys/boot/userboot/Makefile.inc Deleted: stable/11/sys/boot/README Modified: stable/11/sys/boot/Makefile.ficl stable/11/sys/boot/Makefile.inc stable/11/sys/boot/arm/uboot/Makefile stable/11/sys/boot/common/Makefile.inc stable/11/sys/boot/efi/boot1/Makefile stable/11/sys/boot/efi/fdt/Makefile stable/11/sys/boot/efi/include/efilib.h stable/11/sys/boot/efi/include/efizfs.h stable/11/sys/boot/efi/libefi/Makefile stable/11/sys/boot/efi/libefi/devpath.c stable/11/sys/boot/efi/libefi/efizfs.c stable/11/sys/boot/efi/loader/Makefile stable/11/sys/boot/efi/loader/main.c stable/11/sys/boot/fdt/Makefile stable/11/sys/boot/i386/gptboot/Makefile stable/11/sys/boot/i386/gptzfsboot/Makefile stable/11/sys/boot/i386/libfirewire/Makefile stable/11/sys/boot/i386/libi386/Makefile stable/11/sys/boot/i386/loader/Makefile stable/11/sys/boot/i386/zfsboot/Makefile stable/11/sys/boot/libstand32/Makefile stable/11/sys/boot/mips/beri/boot2/Makefile stable/11/sys/boot/mips/beri/loader/Makefile stable/11/sys/boot/mips/uboot/Makefile stable/11/sys/boot/ofw/libofw/Makefile stable/11/sys/boot/powerpc/kboot/Makefile stable/11/sys/boot/powerpc/ofw/Makefile stable/11/sys/boot/powerpc/ps3/Makefile stable/11/sys/boot/powerpc/uboot/Makefile stable/11/sys/boot/sparc64/loader/Makefile stable/11/sys/boot/uboot/fdt/Makefile stable/11/sys/boot/uboot/lib/Makefile stable/11/sys/boot/userboot/libstand/Makefile stable/11/sys/boot/userboot/userboot/Makefile stable/11/sys/boot/userboot/zfs/Makefile stable/11/sys/boot/zfs/Makefile Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/boot/Makefile.ficl ============================================================================== --- stable/11/sys/boot/Makefile.ficl Sun Feb 11 18:37:08 2018 (r329128) +++ stable/11/sys/boot/Makefile.ficl Sun Feb 11 19:29:58 2018 (r329129) @@ -27,7 +27,7 @@ CFLAGS+= -m32 -mcpu=powerpc -I. .endif CFLAGS+= -I${FICLDIR} -I${FICLDIR}/${FICL_CPUARCH} \ - -I${FICLDIR}/../common + -I${FICLDIR}/../common -I${SASRC} .if ${MACHINE_CPUARCH} == "amd64" && defined(FICL32) .if !exists(machine) Modified: stable/11/sys/boot/Makefile.inc ============================================================================== --- stable/11/sys/boot/Makefile.inc Sun Feb 11 18:37:08 2018 (r329128) +++ stable/11/sys/boot/Makefile.inc Sun Feb 11 19:29:58 2018 (r329129) @@ -2,6 +2,17 @@ .include +.if !defined(__BOOT_MAKEFILE_INC__) +__BOOT_MAKEFILE_INC__=${MFILE} + +SASRC=${SRCTOP}/lib/libstand +# Normal stand alone library +LIBSA=${OBJTOP}/lib/libstand/libstand.a +# stand alone library compiled for 32-bit version of the processor +LIBSA32=${OBJTOP}/sys/boot/libstand32/libstand.a +# stand along library compiled for userboot +LIBSAU=${OBJTOP}/sys/boot/userboot/libstand/libstand.a + SSP_CFLAGS= .if ${MACHINE_CPUARCH} == "arm" @@ -24,9 +35,9 @@ DD_NOSTATUS!=(dd status=none count=0 2> /dev/null && e DD=dd ${DD_NOSTATUS} .if ${MK_LOADER_FORCE_LE} != "no" - .if ${MACHINE_ARCH} == "powerpc64" CFLAGS+= -mlittle-endian +.endif .endif .endif Modified: stable/11/sys/boot/arm/uboot/Makefile ============================================================================== --- stable/11/sys/boot/arm/uboot/Makefile Sun Feb 11 18:37:08 2018 (r329128) +++ stable/11/sys/boot/arm/uboot/Makefile Sun Feb 11 19:29:58 2018 (r329129) @@ -112,16 +112,15 @@ LIBUBOOT= ${.OBJDIR}/../../uboot/lib/libuboot.a CFLAGS+= -I${.CURDIR}/../../uboot/lib CFLAGS+= -I${.OBJDIR}/../../uboot/lib -# where to get libstand from -CFLAGS+= -I${.CURDIR}/../../../../lib/libstand/ +CFLAGS+= -I${SASRC} CFLAGS+= -fPIC # clang doesn't understand %D as a specifier to printf NO_WERROR.clang= -DPADD= ${LIBFICL} ${LIBUBOOT} ${LIBFDT} ${LIBUBOOT_FDT} ${LIBSTAND} -LDADD= ${LIBFICL} ${LIBUBOOT} ${LIBFDT} ${LIBUBOOT_FDT} -lstand +DPADD= ${LIBFICL} ${LIBUBOOT} ${LIBFDT} ${LIBUBOOT_FDT} ${LIBSA} +LDADD= ${LIBFICL} ${LIBUBOOT} ${LIBFDT} ${LIBUBOOT_FDT} ${LIBSA} OBJS+= ${SRCS:N*.h:R:S/$/.o/g} Modified: stable/11/sys/boot/common/Makefile.inc ============================================================================== --- stable/11/sys/boot/common/Makefile.inc Sun Feb 11 18:37:08 2018 (r329128) +++ stable/11/sys/boot/common/Makefile.inc Sun Feb 11 19:29:58 2018 (r329129) @@ -74,7 +74,7 @@ CFLAGS+= -DBOOT_PROMPT_123 .if defined(LOADER_INSTALL_SUPPORT) SRCS+= install.c -CFLAGS+=-I${.CURDIR}/../../../../lib/libstand +CFLAGS+=-I${SASRC} .endif CLEANFILES+= vers.c Modified: stable/11/sys/boot/efi/boot1/Makefile ============================================================================== --- stable/11/sys/boot/efi/boot1/Makefile Sun Feb 11 18:37:08 2018 (r329128) +++ stable/11/sys/boot/efi/boot1/Makefile Sun Feb 11 19:29:58 2018 (r329129) @@ -90,8 +90,8 @@ LIBEFI= ${.OBJDIR}/../libefi/libefi.a # __aeabi_* (arm) or __divdi3 (i386). # as well as required string and memory functions for all platforms. # -DPADD+= ${LIBEFI} ${LIBSTAND} -LDADD+= ${LIBEFI} -lstand +DPADD+= ${LIBEFI} ${LIBSA} +LDADD+= ${LIBEFI} ${LIBSA} DPADD+= ${LDSCRIPT} Modified: stable/11/sys/boot/efi/fdt/Makefile ============================================================================== --- stable/11/sys/boot/efi/fdt/Makefile Sun Feb 11 18:37:08 2018 (r329128) +++ stable/11/sys/boot/efi/fdt/Makefile Sun Feb 11 19:29:58 2018 (r329129) @@ -17,7 +17,7 @@ CFLAGS+= -mgeneral-regs-only CFLAGS+= -msoft-float .endif -CFLAGS+= -I${.CURDIR}/../../../../lib/libstand/ +CFLAGS+= -I${SASRC} # EFI library headers CFLAGS+= -I${.CURDIR}/../include Modified: stable/11/sys/boot/efi/include/efilib.h ============================================================================== --- stable/11/sys/boot/efi/include/efilib.h Sun Feb 11 18:37:08 2018 (r329128) +++ stable/11/sys/boot/efi/include/efilib.h Sun Feb 11 19:29:58 2018 (r329129) @@ -82,6 +82,7 @@ EFI_HANDLE efi_devpath_handle(EFI_DEVICE_PATH *); EFI_DEVICE_PATH *efi_devpath_last_node(EFI_DEVICE_PATH *); EFI_DEVICE_PATH *efi_devpath_trim(EFI_DEVICE_PATH *); bool efi_devpath_match(EFI_DEVICE_PATH *, EFI_DEVICE_PATH *); +int efi_devpath_is_prefix(EFI_DEVICE_PATH *, EFI_DEVICE_PATH *); CHAR16 *efi_devpath_name(EFI_DEVICE_PATH *); void efi_free_devpath_name(CHAR16 *); Modified: stable/11/sys/boot/efi/include/efizfs.h ============================================================================== --- stable/11/sys/boot/efi/include/efizfs.h Sun Feb 11 18:37:08 2018 (r329128) +++ stable/11/sys/boot/efi/include/efizfs.h Sun Feb 11 19:29:58 2018 (r329129) @@ -27,6 +27,7 @@ */ #include +#include #ifndef _EFIZFS_H_ #define _EFIZFS_H_ @@ -45,6 +46,7 @@ extern uint64_t pool_guid; extern void efi_zfs_probe(void); extern zfsinfo_list_t *efizfs_get_zfsinfo_list(void); +extern bool efi_zfs_is_preferred(EFI_HANDLE *h); extern EFI_HANDLE efizfs_get_handle_by_guid(uint64_t); #endif Modified: stable/11/sys/boot/efi/libefi/Makefile ============================================================================== --- stable/11/sys/boot/efi/libefi/Makefile Sun Feb 11 18:37:08 2018 (r329128) +++ stable/11/sys/boot/efi/libefi/Makefile Sun Feb 11 19:29:58 2018 (r329129) @@ -37,7 +37,7 @@ CFLAGS+= -fPIC -mno-red-zone .endif CFLAGS+= -I${.CURDIR}/../include CFLAGS+= -I${.CURDIR}/../include/${MACHINE} -CFLAGS+= -I${.CURDIR}/../../../../lib/libstand +CFLAGS+= -I${SASRC} .if ${MK_ZFS} != "no" CFLAGS+= -I${.CURDIR}/../../zfs CFLAGS+= -I${.CURDIR}/../../../cddl/boot/zfs Modified: stable/11/sys/boot/efi/libefi/devpath.c ============================================================================== --- stable/11/sys/boot/efi/libefi/devpath.c Sun Feb 11 18:37:08 2018 (r329128) +++ stable/11/sys/boot/efi/libefi/devpath.c Sun Feb 11 19:29:58 2018 (r329129) @@ -166,3 +166,32 @@ efi_devpath_match(EFI_DEVICE_PATH *devpath1, EFI_DEVIC } return (true); } + +int +efi_devpath_is_prefix(EFI_DEVICE_PATH *prefix, EFI_DEVICE_PATH *path) +{ + int len; + + if (prefix == NULL || path == NULL) + return (0); + + while (1) { + if (IsDevicePathEnd(prefix)) + break; + + if (DevicePathType(prefix) != DevicePathType(path) || + DevicePathSubType(prefix) != DevicePathSubType(path)) + return (0); + + len = DevicePathNodeLength(prefix); + if (len != DevicePathNodeLength(path)) + return (0); + + if (memcmp(prefix, path, (size_t)len) != 0) + return (0); + + prefix = NextDevicePathNode(prefix); + path = NextDevicePathNode(path); + } + return (1); +} Modified: stable/11/sys/boot/efi/libefi/efizfs.c ============================================================================== --- stable/11/sys/boot/efi/libefi/efizfs.c Sun Feb 11 18:37:08 2018 (r329128) +++ stable/11/sys/boot/efi/libefi/efizfs.c Sun Feb 11 19:29:58 2018 (r329129) @@ -81,12 +81,9 @@ efi_zfs_probe(void) { pdinfo_list_t *hdi; pdinfo_t *hd, *pd = NULL; - EFI_GUID imgid = LOADED_IMAGE_PROTOCOL; - EFI_LOADED_IMAGE *img; char devname[SPECNAMELEN + 1]; uint64_t guid; - BS->HandleProtocol(IH, &imgid, (VOID**)&img); hdi = efiblk_get_pdinfo_list(&efipart_hddev); STAILQ_INIT(&zfsinfo); @@ -105,7 +102,7 @@ efi_zfs_probe(void) if (zfs_probe_dev(devname, &guid) == 0) { insert_zfs(pd->pd_handle, guid); - if (pd->pd_handle == img->DeviceHandle) + if (efi_zfs_is_preferred(pd->pd_handle)) pool_guid = guid; } Modified: stable/11/sys/boot/efi/loader/Makefile ============================================================================== --- stable/11/sys/boot/efi/loader/Makefile Sun Feb 11 18:37:08 2018 (r329128) +++ stable/11/sys/boot/efi/loader/Makefile Sun Feb 11 19:29:58 2018 (r329129) @@ -37,7 +37,7 @@ CWARNFLAGS.zfs.c+= -Wno-missing-prototypes .endif .if defined(LOADER_NET_SUPPORT) -CFLAGS+= -I${.CURDIR}/../../../../lib/libstand +CFLAGS+= -I${SASRC} .endif .if ${COMPILER_TYPE} == "gcc" && ${COMPILER_VERSION} > 40201 @@ -156,9 +156,9 @@ loader.efi: ${PROG} LIBEFI= ${.OBJDIR}/../libefi/libefi.a -DPADD= ${LIBFICL} ${LIBEFI} ${LIBFDT} ${LIBEFI_FDT} ${LIBSTAND} \ +DPADD= ${LIBFICL} ${LIBEFI} ${LIBFDT} ${LIBEFI_FDT} ${LIBSA} \ ${LDSCRIPT} -LDADD= ${LIBFICL} ${LIBEFI} ${LIBFDT} ${LIBEFI_FDT} ${LIBSTAND} +LDADD= ${LIBFICL} ${LIBEFI} ${LIBFDT} ${LIBEFI_FDT} ${LIBSA} .include Modified: stable/11/sys/boot/efi/loader/main.c ============================================================================== --- stable/11/sys/boot/efi/loader/main.c Sun Feb 11 18:37:08 2018 (r329128) +++ stable/11/sys/boot/efi/loader/main.c Sun Feb 11 19:29:58 2018 (r329129) @@ -72,6 +72,16 @@ EFI_GUID debugimg = DEBUG_IMAGE_INFO_TABLE_GUID; EFI_GUID fdtdtb = FDT_TABLE_GUID; EFI_GUID inputid = SIMPLE_TEXT_INPUT_PROTOCOL; +static EFI_LOADED_IMAGE *img; + +#ifdef EFI_ZFS_BOOT +bool +efi_zfs_is_preferred(EFI_HANDLE *h) +{ + return (h == img->DeviceHandle); +} +#endif + static int has_keyboard(void) { @@ -300,7 +310,6 @@ EFI_STATUS main(int argc, CHAR16 *argv[]) { char var[128]; - EFI_LOADED_IMAGE *img; EFI_GUID *guid; int i, j, vargood, howto; UINTN k; @@ -319,6 +328,9 @@ main(int argc, CHAR16 *argv[]) archsw.arch_zfs_probe = efi_zfs_probe; #endif + /* Get our loaded image protocol interface structure. */ + BS->HandleProtocol(IH, &imgid, (VOID**)&img); + /* Init the time source */ efi_time_init(); @@ -445,9 +457,6 @@ main(int argc, CHAR16 *argv[]) for (i = 0; devsw[i] != NULL; i++) if (devsw[i]->dv_init != NULL) (devsw[i]->dv_init)(); - - /* Get our loaded image protocol interface structure. */ - BS->HandleProtocol(IH, &imgid, (VOID**)&img); printf("Command line arguments:"); for (i = 0; i < argc; i++) Modified: stable/11/sys/boot/fdt/Makefile ============================================================================== --- stable/11/sys/boot/fdt/Makefile Sun Feb 11 18:37:08 2018 (r329128) +++ stable/11/sys/boot/fdt/Makefile Sun Feb 11 19:29:58 2018 (r329129) @@ -12,6 +12,7 @@ SRCS+= fdt.c fdt_ro.c fdt_wip.c fdt_sw.c fdt_rw.c fdt # Loader's fdt commands extension sources. SRCS+= fdt_loader_cmd.c +CFLAGS+= -I${SASRC} CFLAGS+= -I${.CURDIR}/../../contrib/libfdt/ -I${.CURDIR}/../common/ CFLAGS+= -ffreestanding Modified: stable/11/sys/boot/i386/gptboot/Makefile ============================================================================== --- stable/11/sys/boot/i386/gptboot/Makefile Sun Feb 11 18:37:08 2018 (r329128) +++ stable/11/sys/boot/i386/gptboot/Makefile Sun Feb 11 19:29:58 2018 (r329129) @@ -50,8 +50,6 @@ OPENCRYPTO_XTS= xform_aes_xts.o LD_FLAGS=${LD_FLAGS_BIN} -LIBSTAND= ${.OBJDIR}/../../libstand32/libstand.a - # Pick up ../Makefile.inc early. .include @@ -76,7 +74,7 @@ gptboot.bin: gptboot.out ${OBJCOPY} -S -O binary gptboot.out ${.TARGET} gptboot.out: ${BTXCRT} gptboot.o sio.o crc32.o drv.o cons.o util.o ${OPENCRYPTO_XTS} - ${LD} ${LD_FLAGS} -Ttext ${ORG2} -o ${.TARGET} ${.ALLSRC} ${LIBGELIBOOT} ${LIBSTAND} + ${LD} ${LD_FLAGS} -Ttext ${ORG2} -o ${.TARGET} ${.ALLSRC} ${LIBGELIBOOT} ${LIBSA32} gptboot.o: ${.CURDIR}/../../common/ufsread.c Modified: stable/11/sys/boot/i386/gptzfsboot/Makefile ============================================================================== --- stable/11/sys/boot/i386/gptzfsboot/Makefile Sun Feb 11 18:37:08 2018 (r329128) +++ stable/11/sys/boot/i386/gptzfsboot/Makefile Sun Feb 11 19:29:58 2018 (r329129) @@ -60,8 +60,6 @@ CFLAGS.gcc+= --param max-inline-insns-single=100 LD_FLAGS=${LD_FLAGS_BIN} -LIBSTAND= ${.OBJDIR}/../../libstand32/libstand.a - # Pick up ../Makefile.inc early. .include @@ -87,7 +85,7 @@ gptzfsboot.bin: gptzfsboot.out gptzfsboot.out: ${BTXCRT} zfsboot.o sio.o gpt.o drv.o cons.o util.o \ skein.o skein_block.o ${OPENCRYPTO_XTS} - ${LD} ${LD_FLAGS} -Ttext ${ORG2} -o ${.TARGET} ${.ALLSRC} ${LIBGELIBOOT} ${LIBSTAND} + ${LD} ${LD_FLAGS} -Ttext ${ORG2} -o ${.TARGET} ${.ALLSRC} ${LIBGELIBOOT} ${LIBSA32} zfsboot.o: ${.CURDIR}/../../zfs/zfsimpl.c Modified: stable/11/sys/boot/i386/libfirewire/Makefile ============================================================================== --- stable/11/sys/boot/i386/libfirewire/Makefile Sun Feb 11 18:37:08 2018 (r329128) +++ stable/11/sys/boot/i386/libfirewire/Makefile Sun Feb 11 19:29:58 2018 (r329129) @@ -10,7 +10,7 @@ SRCS+= dcons.c fwcrom.c CFLAGS+= -D_BOOT CFLAGS+= -I${.CURDIR}/../../common -I${.CURDIR}/../../.. -I. -CFLAGS+= -I${.CURDIR}/../../../../lib/libstand +CFLAGS+= -I${SASRC} CFLAGS+= -I${.CURDIR}/../btx/lib CFLAGS+= -I${.CURDIR}/../libi386 Modified: stable/11/sys/boot/i386/libi386/Makefile ============================================================================== --- stable/11/sys/boot/i386/libi386/Makefile Sun Feb 11 18:37:08 2018 (r329128) +++ stable/11/sys/boot/i386/libi386/Makefile Sun Feb 11 19:29:58 2018 (r329129) @@ -60,7 +60,7 @@ CFLAGS+= -I${.CURDIR}/../../ficl -I${.CURDIR}/../../fi -I${.CURDIR}/../../../contrib/dev/acpica/include \ -I${.CURDIR}/../../.. -I. # the location of libstand -CFLAGS+= -I${.CURDIR}/../../../../lib/libstand/ +CFLAGS+= -I${SASRC} # Handle FreeBSD specific %b and %D printf format specifiers CFLAGS+= ${FORMAT_EXTENSIONS} Modified: stable/11/sys/boot/i386/loader/Makefile ============================================================================== --- stable/11/sys/boot/i386/loader/Makefile Sun Feb 11 18:37:08 2018 (r329128) +++ stable/11/sys/boot/i386/loader/Makefile Sun Feb 11 19:29:58 2018 (r329129) @@ -29,7 +29,7 @@ LIBZFSBOOT= ${.OBJDIR}/../../zfs/libzfsboot.a .endif .if defined(LOADER_NET_SUPPORT) -CFLAGS+= -I${.CURDIR}/../../../../lib/libstand +CFLAGS+= -I${SASRC} .endif .if defined(LOADER_TFTP_SUPPORT) @@ -90,8 +90,6 @@ LDFLAGS= -static -Ttext 0x0 LIBI386= ${.OBJDIR}/../libi386/libi386.a CFLAGS+= -I${.CURDIR}/.. -LIBSTAND= ${.OBJDIR}/../../libstand32/libstand.a - # BTX components CFLAGS+= -I${.CURDIR}/../btx/lib @@ -127,8 +125,8 @@ FILES+= loader.rc menu.rc # XXX crt0.o needs to be first for pxeboot(8) to work OBJS= ${BTXCRT} -DPADD= ${LIBFICL} ${LIBFIREWIRE} ${LIBZFSBOOT} ${LIBI386} ${LIBGELIBOOT} ${LIBSTAND} -LDADD= ${LIBFICL} ${LIBFIREWIRE} ${LIBZFSBOOT} ${LIBI386} ${LIBGELIBOOT} ${LIBSTAND} +DPADD= ${LIBFICL} ${LIBFIREWIRE} ${LIBZFSBOOT} ${LIBI386} ${LIBGELIBOOT} ${LIBSA32} +LDADD= ${LIBFICL} ${LIBFIREWIRE} ${LIBZFSBOOT} ${LIBI386} ${LIBGELIBOOT} ${LIBSA32} .include Modified: stable/11/sys/boot/i386/zfsboot/Makefile ============================================================================== --- stable/11/sys/boot/i386/zfsboot/Makefile Sun Feb 11 18:37:08 2018 (r329128) +++ stable/11/sys/boot/i386/zfsboot/Makefile Sun Feb 11 19:29:58 2018 (r329129) @@ -40,8 +40,6 @@ CFLAGS+= -DSKEIN_LOOP=111 LD_FLAGS=${LD_FLAGS_BIN} -LIBSTAND= ${.OBJDIR}/../../libstand32/libstand.a - # Pick up ../Makefile.inc early. .include @@ -83,7 +81,7 @@ zfsboot.bin: zfsboot.out ${OBJCOPY} -S -O binary zfsboot.out ${.TARGET} zfsboot.out: ${BTXCRT} zfsboot.o sio.o drv.o cons.o util.o skein.o skein_block.o - ${LD} ${LD_FLAGS} -Ttext ${ORG2} -o ${.TARGET} ${.ALLSRC} ${LIBSTAND} + ${LD} ${LD_FLAGS} -Ttext ${ORG2} -o ${.TARGET} ${.ALLSRC} ${LIBSA32} SRCS= zfsboot.c Modified: stable/11/sys/boot/libstand32/Makefile ============================================================================== --- stable/11/sys/boot/libstand32/Makefile Sun Feb 11 18:37:08 2018 (r329128) +++ stable/11/sys/boot/libstand32/Makefile Sun Feb 11 19:29:58 2018 (r329129) @@ -2,23 +2,25 @@ .include -LIBSTAND_SRC= ${.CURDIR}/../../../lib/libstand +.include "../Makefile.inc" + .if ${MACHINE_CPUARCH} == "amd64" LIBSTAND_CPUARCH=i386 .else LIBSTAND_CPUARCH=${MACHINE_CPUARCH} .endif -LIBC_SRC= ${LIBSTAND_SRC}/../libc +LIBSTAND_SRC= ${SASRC} +LIBC_SRC= ${SRCTOP}/lib/libc INTERNALLIB= INCS= MAN= -.PATH: ${LIBSTAND_SRC} +.PATH: ${SASRC} .if ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "powerpc64" CFLAGS+= -m32 -I. .endif -.include "${LIBSTAND_SRC}/Makefile" +.include "${SASRC}/Makefile" .if ${MACHINE_CPUARCH} == "amd64" CLEANFILES+= machine Modified: stable/11/sys/boot/mips/beri/boot2/Makefile ============================================================================== --- stable/11/sys/boot/mips/beri/boot2/Makefile Sun Feb 11 18:37:08 2018 (r329128) +++ stable/11/sys/boot/mips/beri/boot2/Makefile Sun Feb 11 19:29:58 2018 (r329129) @@ -58,8 +58,7 @@ CFLAGS= -ffreestanding \ -g # where to get libstand from -CFLAGS+= -I${.CURDIR}/../../../../../lib/libstand/ -LIBSTAND= ${.OBJDIR}/../../../../../lib/libstand/libstand.a +CFLAGS+= -I${SASRC} LDFLAGS= -nostdlib \ -static \ @@ -72,7 +71,7 @@ CFLAGS+= -I${.CURDIR}/../common flashboot.elf: relocate.o start.o boot2.o altera_jtag_uart.o cfi.o sdcard.o ${CC} ${LDFLAGS} -T ${.CURDIR}/flashboot.ldscript -o ${.TARGET} \ - ${.ALLSRC} ${LIBSTAND} + ${.ALLSRC} ${LIBSA} flashboot: flashboot.elf ${OBJCOPY} -S -O binary ${.TARGET}.elf ${.TARGET} flashboot.md5: flashboot @@ -80,7 +79,7 @@ flashboot.md5: flashboot jtagboot: start.o boot2.o altera_jtag_uart.o cfi.o sdcard.o ${CC} ${LDFLAGS} -T ${.CURDIR}/jtagboot.ldscript -o ${.TARGET} \ - ${.ALLSRC} ${LIBSTAND} + ${.ALLSRC} ${LIBSA} jtagboot.md5: jtagboot md5 jtagboot > jtagboot.md5 Modified: stable/11/sys/boot/mips/beri/loader/Makefile ============================================================================== --- stable/11/sys/boot/mips/beri/loader/Makefile Sun Feb 11 18:37:08 2018 (r329128) +++ stable/11/sys/boot/mips/beri/loader/Makefile Sun Feb 11 19:29:58 2018 (r329129) @@ -108,11 +108,10 @@ LDFLAGS= -nostdlib \ -e __start # where to get libstand from -CFLAGS+= -I${.CURDIR}/../../../../../lib/libstand/ -LIBSTAND= ${.OBJDIR}/../../../../../lib/libstand/libstand.a +CFLAGS+= -I${SASRC} -DPADD= ${LIBFICL} ${LIBSTAND} -LDADD= ${LIBFICL} ${LIBSTAND} +DPADD= ${LIBFICL} ${LIBSA} +LDADD= ${LIBFICL} ${LIBSA} loader.help: help.common help.mips cat ${.ALLSRC} | \ Modified: stable/11/sys/boot/mips/uboot/Makefile ============================================================================== --- stable/11/sys/boot/mips/uboot/Makefile Sun Feb 11 18:37:08 2018 (r329128) +++ stable/11/sys/boot/mips/uboot/Makefile Sun Feb 11 19:29:58 2018 (r329129) @@ -116,15 +116,14 @@ CFLAGS+= -I${.CURDIR}/../../uboot/lib CFLAGS+= -I${.OBJDIR}/../../uboot/lib # where to get libstand from -CFLAGS+= -I${.CURDIR}/../../../../lib/libstand/ -LIBSTAND= ${.OBJDIR}/../../../../lib/libstand/libstand.a +CFLAGS+= -I${SASRC} # clang doesn't understand %D as a specifier to printf #NO_WERROR.clang= #NO_WERROR= -DPADD= ${LIBFICL} ${LIBUBOOT} ${LIBFDT} ${LIBUBOOT_FDT} ${LIBSTAND} -LDADD= ${LIBFICL} ${LIBUBOOT} ${LIBFDT} ${LIBUBOOT_FDT} ${LIBSTAND} +DPADD= ${LIBFICL} ${LIBUBOOT} ${LIBFDT} ${LIBUBOOT_FDT} ${LIBSA} +LDADD= ${LIBFICL} ${LIBUBOOT} ${LIBFDT} ${LIBUBOOT_FDT} ${LIBSA} OBJS+= ${SRCS:N*.h:R:S/$/.o/g} Modified: stable/11/sys/boot/ofw/libofw/Makefile ============================================================================== --- stable/11/sys/boot/ofw/libofw/Makefile Sun Feb 11 18:37:08 2018 (r329128) +++ stable/11/sys/boot/ofw/libofw/Makefile Sun Feb 11 19:29:58 2018 (r329129) @@ -9,7 +9,7 @@ SRCS= devicename.c elf_freebsd.c ofw_console.c ofw_cop .PATH: ${.CURDIR}/../../zfs SRCS+= devicename_stubs.c -CFLAGS+= -I${.CURDIR}/../../../../lib/libstand/ +CFLAGS+= -I${SASRC} # Pick up the bootstrap header for some interface items CFLAGS+= -I${.CURDIR}/../../common -I${.CURDIR}/../../.. -I. Modified: stable/11/sys/boot/powerpc/kboot/Makefile ============================================================================== --- stable/11/sys/boot/powerpc/kboot/Makefile Sun Feb 11 18:37:08 2018 (r329128) +++ stable/11/sys/boot/powerpc/kboot/Makefile Sun Feb 11 19:29:58 2018 (r329129) @@ -94,11 +94,10 @@ CFLAGS+= -Wa,-mppc64bridge #.include "${.CURDIR}/../../ofw/common/Makefile.inc" # where to get libstand from -LIBSTAND= ${.OBJDIR}/../../libstand32/libstand.a -CFLAGS+= -I${.CURDIR}/../../../../lib/libstand/ +CFLAGS+= -I${SASRC} -DPADD= ${LIBFICL} ${LIBOFW} ${LIBFDT} ${LIBSTAND} -LDADD= ${LIBFICL} ${LIBOFW} ${LIBFDT} ${LIBSTAND} +DPADD= ${LIBFICL} ${LIBOFW} ${LIBFDT} ${LIBSA32} +LDADD= ${LIBFICL} ${LIBOFW} ${LIBFDT} ${LIBSA32} loader.help: help.common help.kboot ${.CURDIR}/../../fdt/help.fdt cat ${.ALLSRC} | \ Modified: stable/11/sys/boot/powerpc/ofw/Makefile ============================================================================== --- stable/11/sys/boot/powerpc/ofw/Makefile Sun Feb 11 18:37:08 2018 (r329128) +++ stable/11/sys/boot/powerpc/ofw/Makefile Sun Feb 11 19:29:58 2018 (r329129) @@ -92,11 +92,10 @@ LIBOFW= ${.OBJDIR}/../../ofw/libofw/libofw.a CFLAGS+= -I${.CURDIR}/../../ofw/libofw # where to get libstand from -LIBSTAND= ${.OBJDIR}/../../libstand32/libstand.a -CFLAGS+= -I${.CURDIR}/../../../../lib/libstand/ +CFLAGS+= -I${SASRC} -DPADD= ${LIBFICL} ${LIBOFW} ${LIBFDT} ${LIBSTAND} -LDADD= ${LIBFICL} ${LIBOFW} ${LIBFDT} ${LIBSTAND} +DPADD= ${LIBFICL} ${LIBOFW} ${LIBFDT} ${LIBSA32} +LDADD= ${LIBFICL} ${LIBOFW} ${LIBFDT} ${LIBSA32} loader.help: help.common help.ofw ${.CURDIR}/../../fdt/help.fdt cat ${.ALLSRC} | \ Modified: stable/11/sys/boot/powerpc/ps3/Makefile ============================================================================== --- stable/11/sys/boot/powerpc/ps3/Makefile Sun Feb 11 18:37:08 2018 (r329128) +++ stable/11/sys/boot/powerpc/ps3/Makefile Sun Feb 11 19:29:58 2018 (r329129) @@ -91,11 +91,10 @@ LDFLAGS= -nostdlib -static -T ${.CURDIR}/ldscript.powe #.include "${.CURDIR}/../../ofw/common/Makefile.inc" # where to get libstand from -LIBSTAND= ${.OBJDIR}/../../libstand32/libstand.a -CFLAGS+= -I${.CURDIR}/../../../../lib/libstand/ +CFLAGS+= -I${SASRC} -DPADD= ${LIBFICL} ${LIBOFW} ${LIBSTAND} -LDADD= ${LIBFICL} ${LIBOFW} ${LIBSTAND} +DPADD= ${LIBFICL} ${LIBOFW} ${LIBSA32} +LDADD= ${LIBFICL} ${LIBOFW} ${LIBSA32} SC_DFLT_FONT=cp437 Modified: stable/11/sys/boot/powerpc/uboot/Makefile ============================================================================== --- stable/11/sys/boot/powerpc/uboot/Makefile Sun Feb 11 18:37:08 2018 (r329128) +++ stable/11/sys/boot/powerpc/uboot/Makefile Sun Feb 11 19:29:58 2018 (r329129) @@ -97,11 +97,10 @@ CFLAGS+= -I${.CURDIR}/../../uboot/lib CFLAGS+= -I${.OBJDIR}/../../uboot/lib # where to get libstand from -LIBSTAND= ${.OBJDIR}/../../libstand32/libstand.a -CFLAGS+= -I${.CURDIR}/../../../../lib/libstand/ +CFLAGS+= -I${SASRC} -DPADD= ${LIBFICL} ${LIBUBOOT} ${LIBFDT} ${LIBUBOOT_FDT} ${LIBSTAND} -LDADD= ${LIBFICL} ${LIBUBOOT} ${LIBFDT} ${LIBUBOOT_FDT} ${LIBSTAND} +DPADD= ${LIBFICL} ${LIBUBOOT} ${LIBFDT} ${LIBUBOOT_FDT} ${LIBSA32} +LDADD= ${LIBFICL} ${LIBUBOOT} ${LIBFDT} ${LIBUBOOT_FDT} ${LIBSA32} loader.help: help.common help.uboot ${.CURDIR}/../../fdt/help.fdt cat ${.ALLSRC} | \ Modified: stable/11/sys/boot/sparc64/loader/Makefile ============================================================================== --- stable/11/sys/boot/sparc64/loader/Makefile Sun Feb 11 18:37:08 2018 (r329128) +++ stable/11/sys/boot/sparc64/loader/Makefile Sun Feb 11 19:29:58 2018 (r329129) @@ -80,13 +80,13 @@ LIBOFW= ${.OBJDIR}/../../ofw/libofw/libofw.a CFLAGS+= -I${.CURDIR}/../../ofw/libofw/ # where to get libstand from -CFLAGS+= -I${.CURDIR}/../../../../lib/libstand/ +CFLAGS+= -I${SASRC} # Need sys/ for crypto/intake.h CFLAGS+= -I${SRCTOP}/sys -DPADD= ${LIBFICL} ${LIBZFSBOOT} ${LIBOFW} ${LIBSTAND} -LDADD= ${LIBFICL} ${LIBZFSBOOT} ${LIBOFW} -lstand +DPADD= ${LIBFICL} ${LIBZFSBOOT} ${LIBOFW} ${LIBSA} +LDADD= ${LIBFICL} ${LIBZFSBOOT} ${LIBOFW} ${LIBSA} loader.help: help.common help.sparc64 cat ${.ALLSRC} | \ Modified: stable/11/sys/boot/uboot/fdt/Makefile ============================================================================== --- stable/11/sys/boot/uboot/fdt/Makefile Sun Feb 11 18:37:08 2018 (r329128) +++ stable/11/sys/boot/uboot/fdt/Makefile Sun Feb 11 19:29:58 2018 (r329129) @@ -12,7 +12,7 @@ SRCS= uboot_fdt.c CFLAGS+= -ffreestanding -msoft-float -CFLAGS+= -I${.CURDIR}/../../../../lib/libstand/ +CFLAGS+= -I${SASRC} # U-Boot library headers CFLAGS+= -I${.CURDIR}/../lib Modified: stable/11/sys/boot/uboot/lib/Makefile ============================================================================== --- stable/11/sys/boot/uboot/lib/Makefile Sun Feb 11 18:37:08 2018 (r329128) +++ stable/11/sys/boot/uboot/lib/Makefile Sun Feb 11 19:29:58 2018 (r329129) @@ -13,7 +13,7 @@ SRCS+= module.c net.c reboot.c time.c CFLAGS+= -ffreestanding -msoft-float -CFLAGS+= -I${.CURDIR}/../../../../lib/libstand/ +CFLAGS+= -I${SASRC} .if !defined(LOADER_NO_DISK_SUPPORT) SRCS+= disk.c Copied: stable/11/sys/boot/userboot/Makefile.inc (from r324450, head/sys/boot/userboot/Makefile.inc) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/sys/boot/userboot/Makefile.inc Sun Feb 11 19:29:58 2018 (r329129, copy of r324450, head/sys/boot/userboot/Makefile.inc) @@ -0,0 +1,3 @@ +# $FreeBSD$ + +.include "../Makefile.inc" Modified: stable/11/sys/boot/userboot/libstand/Makefile ============================================================================== --- stable/11/sys/boot/userboot/libstand/Makefile Sun Feb 11 18:37:08 2018 (r329128) +++ stable/11/sys/boot/userboot/libstand/Makefile Sun Feb 11 19:29:58 2018 (r329129) @@ -1,8 +1,9 @@ # $FreeBSD$ .include +.include "../Makefile.inc" -LIBSTAND_SRC= ${.CURDIR}/../../../../lib/libstand +LIBSTAND_SRC= ${SASRC} INTERNALLIB= INCS= Modified: stable/11/sys/boot/userboot/userboot/Makefile ============================================================================== --- stable/11/sys/boot/userboot/userboot/Makefile Sun Feb 11 18:37:08 2018 (r329128) +++ stable/11/sys/boot/userboot/userboot/Makefile Sun Feb 11 19:29:58 2018 (r329129) @@ -32,7 +32,7 @@ CFLAGS+= -Wall CFLAGS+= -I${.CURDIR}/.. CFLAGS+= -I${.CURDIR}/../../common CFLAGS+= -I${.CURDIR}/../../.. -CFLAGS+= -I${.CURDIR}/../../../../lib/libstand +CFLAGS+= -I${SASRC} CFLAGS+= -ffreestanding -I. CWARNFLAGS.main.c += -Wno-implicit-function-declaration @@ -49,8 +49,6 @@ CFLAGS+= -DBF_DICTSIZE=15000 LIBFICL= ${.OBJDIR}/../ficl/libficl.a .endif -LIBSTAND= ${.OBJDIR}/../libstand/libstand.a - .if ${MK_ZFS} != "no" CFLAGS+= -DUSERBOOT_ZFS_SUPPORT LIBZFSBOOT= ${.OBJDIR}/../zfs/libzfsboot.a @@ -61,7 +59,7 @@ LIBZFSBOOT= ${.OBJDIR}/../zfs/libzfsboot.a .include "${.CURDIR}/../../common/Makefile.inc" CFLAGS+= -I${.CURDIR}/../../common CFLAGS+= -I. -DPADD+= ${LIBFICL} ${LIBZFSBOOT} ${LIBSTAND} -LDADD+= ${LIBFICL} ${LIBZFSBOOT} ${LIBSTAND} +DPADD+= ${LIBFICL} ${LIBZFSBOOT} ${LIBSAU} +LDADD+= ${LIBFICL} ${LIBZFSBOOT} ${LIBSAU} .include Modified: stable/11/sys/boot/userboot/zfs/Makefile ============================================================================== --- stable/11/sys/boot/userboot/zfs/Makefile Sun Feb 11 18:37:08 2018 (r329128) +++ stable/11/sys/boot/userboot/zfs/Makefile Sun Feb 11 19:29:58 2018 (r329129) @@ -12,7 +12,7 @@ SRCS+= zfs.c skein.c skein_block.c CFLAGS+= -DSKEIN_LOOP=111 CFLAGS+= -I${.CURDIR}/../../common -I${.CURDIR}/../../.. -I. -CFLAGS+= -I${.CURDIR}/../../../../lib/libstand +CFLAGS+= -I${SASRC} CFLAGS+= -I${.CURDIR}/../../../cddl/boot/zfs CFLAGS+= -I${.CURDIR}/../../../crypto/skein Modified: stable/11/sys/boot/zfs/Makefile ============================================================================== --- stable/11/sys/boot/zfs/Makefile Sun Feb 11 18:37:08 2018 (r329128) +++ stable/11/sys/boot/zfs/Makefile Sun Feb 11 19:29:58 2018 (r329129) @@ -12,7 +12,7 @@ CFLAGS+= -DSKEIN_LOOP=111 CFLAGS+= -DBOOTPROG=\"zfsloader\" CFLAGS+= -I${.CURDIR}/../common -I${.CURDIR}/../.. -I. -CFLAGS+= -I${.CURDIR}/../../../lib/libstand +CFLAGS+= -I${SASRC} CFLAGS+= -I${.CURDIR}/../../cddl/boot/zfs CFLAGS+= -I${.CURDIR}/../../crypto/skein From owner-svn-src-all@freebsd.org Sun Feb 11 19:33:25 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5D50CF10E0B; Sun, 11 Feb 2018 19:33:25 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0E2CA86B6C; Sun, 11 Feb 2018 19:33:25 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 09279273F3; Sun, 11 Feb 2018 19:33:25 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1BJXOdt005375; Sun, 11 Feb 2018 19:33:24 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1BJXOqY005370; Sun, 11 Feb 2018 19:33:24 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201802111933.w1BJXOqY005370@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sun, 11 Feb 2018 19:33:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r329130 - in stable/11: . lib share/mk sys/boot sys/boot/libsa X-SVN-Group: stable-11 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in stable/11: . lib share/mk sys/boot sys/boot/libsa X-SVN-Commit-Revision: 329130 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Feb 2018 19:33:25 -0000 Author: kevans Date: Sun Feb 11 19:33:24 2018 New Revision: 329130 URL: https://svnweb.freebsd.org/changeset/base/329130 Log: MFC Loader Fixes 2017q4p2: r324453, r324454 r324453: Create sys/boot/libsa and build libstand.a there r324454: Disconnect libstand from the build. Added: stable/11/sys/boot/libsa/ - copied from r324453, head/sys/boot/libsa/ Modified: stable/11/ObsoleteFiles.inc stable/11/lib/Makefile stable/11/share/mk/bsd.libnames.mk stable/11/sys/boot/Makefile stable/11/sys/boot/Makefile.inc Directory Properties: stable/11/ (props changed) Modified: stable/11/ObsoleteFiles.inc ============================================================================== --- stable/11/ObsoleteFiles.inc Sun Feb 11 19:29:58 2018 (r329129) +++ stable/11/ObsoleteFiles.inc Sun Feb 11 19:33:24 2018 (r329130) @@ -38,6 +38,11 @@ # xargs -n1 | sort | uniq -d; # done +# 20180222: Remove libstand +OLD_FILES+=usr/lib/libstand.a +OLD_FILES+=usr/lib/libstand_p.a +OLD_FILES+=usr/include/stand.h +OLD_FILES+=usr/share/man/man3/libstand.3 # 20180202: Convert geli(8) tests to ATF OLD_FILES+=tests/sys/geom/class/eli/nokey_test.sh OLD_FILES+=tests/sys/geom/class/eli/readonly_test.sh Modified: stable/11/lib/Makefile ============================================================================== --- stable/11/lib/Makefile Sun Feb 11 19:29:58 2018 (r329129) +++ stable/11/lib/Makefile Sun Feb 11 19:33:24 2018 (r329130) @@ -98,7 +98,6 @@ SUBDIR= ${SUBDIR_BOOTSTRAP} \ ${_libsmdb} \ ${_libsmutil} \ libsqlite3 \ - libstand \ libstdbuf \ libstdthreads \ libsysdecode \ Modified: stable/11/share/mk/bsd.libnames.mk ============================================================================== --- stable/11/share/mk/bsd.libnames.mk Sun Feb 11 19:29:58 2018 (r329129) +++ stable/11/share/mk/bsd.libnames.mk Sun Feb 11 19:33:24 2018 (r329130) @@ -138,7 +138,6 @@ LIBSDP?= ${DESTDIR}${LIBDIR_BASE}/libsdp.a LIBSMB?= ${DESTDIR}${LIBDIR_BASE}/libsmb.a LIBSSL?= ${DESTDIR}${LIBDIR_BASE}/libssl.a LIBSSP_NONSHARED?= ${DESTDIR}${LIBDIR_BASE}/libssp_nonshared.a -LIBSTAND?= ${DESTDIR}${LIBDIR_BASE}/libstand.a LIBSTDCPLUSPLUS?= ${DESTDIR}${LIBDIR_BASE}/libstdc++.a LIBSTDTHREADS?= ${DESTDIR}${LIBDIR_BASE}/libstdthreads.a LIBSYSDECODE?= ${DESTDIR}${LIBDIR_BASE}/libsysdecode.a Modified: stable/11/sys/boot/Makefile ============================================================================== --- stable/11/sys/boot/Makefile Sun Feb 11 19:29:58 2018 (r329129) +++ stable/11/sys/boot/Makefile Sun Feb 11 19:33:24 2018 (r329130) @@ -2,6 +2,7 @@ .include +SUBDIR+= libsa .if ${MK_FORTH} != "no" # Build the add-in FORTH interpreter. SUBDIR+= ficl Modified: stable/11/sys/boot/Makefile.inc ============================================================================== --- stable/11/sys/boot/Makefile.inc Sun Feb 11 19:29:58 2018 (r329129) +++ stable/11/sys/boot/Makefile.inc Sun Feb 11 19:33:24 2018 (r329130) @@ -7,7 +7,7 @@ __BOOT_MAKEFILE_INC__=${MFILE} SASRC=${SRCTOP}/lib/libstand # Normal stand alone library -LIBSA=${OBJTOP}/lib/libstand/libstand.a +LIBSA=${OBJTOP}/sys/boot/libsa/libstand.a # stand alone library compiled for 32-bit version of the processor LIBSA32=${OBJTOP}/sys/boot/libstand32/libstand.a # stand along library compiled for userboot From owner-svn-src-all@freebsd.org Sun Feb 11 19:35:46 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1F71FF110B9; Sun, 11 Feb 2018 19:35:46 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BF95586D45; Sun, 11 Feb 2018 19:35:45 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A06EE273F7; Sun, 11 Feb 2018 19:35:45 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1BJZjqN005535; Sun, 11 Feb 2018 19:35:45 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1BJZhFZ005510; Sun, 11 Feb 2018 19:35:43 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201802111935.w1BJZhFZ005510@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sun, 11 Feb 2018 19:35:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r329131 - in stable/11/sys/boot: . arm/uboot common efi/fdt efi/libefi efi/loader fdt i386/libfirewire i386/libi386 i386/loader mips/beri/boot2 mips/beri/loader mips/uboot ofw/libofw po... X-SVN-Group: stable-11 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in stable/11/sys/boot: . arm/uboot common efi/fdt efi/libefi efi/loader fdt i386/libfirewire i386/libi386 i386/loader mips/beri/boot2 mips/beri/loader mips/uboot ofw/libofw powerpc/kboot powerpc/ofw p... X-SVN-Commit-Revision: 329131 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Feb 2018 19:35:46 -0000 Author: kevans Date: Sun Feb 11 19:35:42 2018 New Revision: 329131 URL: https://svnweb.freebsd.org/changeset/base/329131 Log: MFC Loader Fixes 2017q4p3: r324460,r324471 r324460: Rather than laying whack-a-mole with including the path to stand.h, always include it. r324471: Fix typos: `stand alon{e,g}` should be spelled like `standalone` Modified: stable/11/sys/boot/Makefile.ficl stable/11/sys/boot/Makefile.inc stable/11/sys/boot/arm/uboot/Makefile stable/11/sys/boot/common/Makefile.inc stable/11/sys/boot/efi/fdt/Makefile stable/11/sys/boot/efi/libefi/Makefile stable/11/sys/boot/efi/loader/Makefile stable/11/sys/boot/fdt/Makefile stable/11/sys/boot/i386/libfirewire/Makefile stable/11/sys/boot/i386/libi386/Makefile stable/11/sys/boot/i386/loader/Makefile stable/11/sys/boot/mips/beri/boot2/Makefile stable/11/sys/boot/mips/beri/loader/Makefile stable/11/sys/boot/mips/uboot/Makefile stable/11/sys/boot/ofw/libofw/Makefile stable/11/sys/boot/powerpc/kboot/Makefile stable/11/sys/boot/powerpc/ofw/Makefile stable/11/sys/boot/powerpc/ps3/Makefile stable/11/sys/boot/powerpc/uboot/Makefile stable/11/sys/boot/sparc64/loader/Makefile stable/11/sys/boot/uboot/fdt/Makefile stable/11/sys/boot/uboot/lib/Makefile stable/11/sys/boot/userboot/userboot/Makefile stable/11/sys/boot/zfs/Makefile Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/boot/Makefile.ficl ============================================================================== --- stable/11/sys/boot/Makefile.ficl Sun Feb 11 19:33:24 2018 (r329130) +++ stable/11/sys/boot/Makefile.ficl Sun Feb 11 19:35:42 2018 (r329131) @@ -27,7 +27,7 @@ CFLAGS+= -m32 -mcpu=powerpc -I. .endif CFLAGS+= -I${FICLDIR} -I${FICLDIR}/${FICL_CPUARCH} \ - -I${FICLDIR}/../common -I${SASRC} + -I${FICLDIR}/../common .if ${MACHINE_CPUARCH} == "amd64" && defined(FICL32) .if !exists(machine) Modified: stable/11/sys/boot/Makefile.inc ============================================================================== --- stable/11/sys/boot/Makefile.inc Sun Feb 11 19:33:24 2018 (r329130) +++ stable/11/sys/boot/Makefile.inc Sun Feb 11 19:35:42 2018 (r329131) @@ -6,12 +6,14 @@ __BOOT_MAKEFILE_INC__=${MFILE} SASRC=${SRCTOP}/lib/libstand -# Normal stand alone library +# Normal standalone library LIBSA=${OBJTOP}/sys/boot/libsa/libstand.a -# stand alone library compiled for 32-bit version of the processor +# Standalone library compiled for 32-bit version of the processor LIBSA32=${OBJTOP}/sys/boot/libstand32/libstand.a -# stand along library compiled for userboot +# Standalone library compiled for userboot LIBSAU=${OBJTOP}/sys/boot/userboot/libstand/libstand.a + +CFLAGS+=-I${SASRC} SSP_CFLAGS= Modified: stable/11/sys/boot/arm/uboot/Makefile ============================================================================== --- stable/11/sys/boot/arm/uboot/Makefile Sun Feb 11 19:33:24 2018 (r329130) +++ stable/11/sys/boot/arm/uboot/Makefile Sun Feb 11 19:35:42 2018 (r329131) @@ -112,8 +112,6 @@ LIBUBOOT= ${.OBJDIR}/../../uboot/lib/libuboot.a CFLAGS+= -I${.CURDIR}/../../uboot/lib CFLAGS+= -I${.OBJDIR}/../../uboot/lib -CFLAGS+= -I${SASRC} - CFLAGS+= -fPIC # clang doesn't understand %D as a specifier to printf Modified: stable/11/sys/boot/common/Makefile.inc ============================================================================== --- stable/11/sys/boot/common/Makefile.inc Sun Feb 11 19:33:24 2018 (r329130) +++ stable/11/sys/boot/common/Makefile.inc Sun Feb 11 19:35:42 2018 (r329131) @@ -74,7 +74,6 @@ CFLAGS+= -DBOOT_PROMPT_123 .if defined(LOADER_INSTALL_SUPPORT) SRCS+= install.c -CFLAGS+=-I${SASRC} .endif CLEANFILES+= vers.c Modified: stable/11/sys/boot/efi/fdt/Makefile ============================================================================== --- stable/11/sys/boot/efi/fdt/Makefile Sun Feb 11 19:33:24 2018 (r329130) +++ stable/11/sys/boot/efi/fdt/Makefile Sun Feb 11 19:35:42 2018 (r329131) @@ -17,8 +17,6 @@ CFLAGS+= -mgeneral-regs-only CFLAGS+= -msoft-float .endif -CFLAGS+= -I${SASRC} - # EFI library headers CFLAGS+= -I${.CURDIR}/../include CFLAGS+= -I${.CURDIR}/../include/${MACHINE} Modified: stable/11/sys/boot/efi/libefi/Makefile ============================================================================== --- stable/11/sys/boot/efi/libefi/Makefile Sun Feb 11 19:33:24 2018 (r329130) +++ stable/11/sys/boot/efi/libefi/Makefile Sun Feb 11 19:35:42 2018 (r329131) @@ -37,7 +37,6 @@ CFLAGS+= -fPIC -mno-red-zone .endif CFLAGS+= -I${.CURDIR}/../include CFLAGS+= -I${.CURDIR}/../include/${MACHINE} -CFLAGS+= -I${SASRC} .if ${MK_ZFS} != "no" CFLAGS+= -I${.CURDIR}/../../zfs CFLAGS+= -I${.CURDIR}/../../../cddl/boot/zfs Modified: stable/11/sys/boot/efi/loader/Makefile ============================================================================== --- stable/11/sys/boot/efi/loader/Makefile Sun Feb 11 19:33:24 2018 (r329130) +++ stable/11/sys/boot/efi/loader/Makefile Sun Feb 11 19:35:42 2018 (r329131) @@ -36,10 +36,6 @@ CWARNFLAGS.zfs.c+= -Wno-array-bounds CWARNFLAGS.zfs.c+= -Wno-missing-prototypes .endif -.if defined(LOADER_NET_SUPPORT) -CFLAGS+= -I${SASRC} -.endif - .if ${COMPILER_TYPE} == "gcc" && ${COMPILER_VERSION} > 40201 CWARNFLAGS.self_reloc.c+= -Wno-error=maybe-uninitialized .endif Modified: stable/11/sys/boot/fdt/Makefile ============================================================================== --- stable/11/sys/boot/fdt/Makefile Sun Feb 11 19:33:24 2018 (r329130) +++ stable/11/sys/boot/fdt/Makefile Sun Feb 11 19:35:42 2018 (r329131) @@ -12,7 +12,6 @@ SRCS+= fdt.c fdt_ro.c fdt_wip.c fdt_sw.c fdt_rw.c fdt # Loader's fdt commands extension sources. SRCS+= fdt_loader_cmd.c -CFLAGS+= -I${SASRC} CFLAGS+= -I${.CURDIR}/../../contrib/libfdt/ -I${.CURDIR}/../common/ CFLAGS+= -ffreestanding Modified: stable/11/sys/boot/i386/libfirewire/Makefile ============================================================================== --- stable/11/sys/boot/i386/libfirewire/Makefile Sun Feb 11 19:33:24 2018 (r329130) +++ stable/11/sys/boot/i386/libfirewire/Makefile Sun Feb 11 19:35:42 2018 (r329131) @@ -10,7 +10,6 @@ SRCS+= dcons.c fwcrom.c CFLAGS+= -D_BOOT CFLAGS+= -I${.CURDIR}/../../common -I${.CURDIR}/../../.. -I. -CFLAGS+= -I${SASRC} CFLAGS+= -I${.CURDIR}/../btx/lib CFLAGS+= -I${.CURDIR}/../libi386 Modified: stable/11/sys/boot/i386/libi386/Makefile ============================================================================== --- stable/11/sys/boot/i386/libi386/Makefile Sun Feb 11 19:33:24 2018 (r329130) +++ stable/11/sys/boot/i386/libi386/Makefile Sun Feb 11 19:35:42 2018 (r329131) @@ -59,8 +59,6 @@ CFLAGS+= -I${.CURDIR}/../../ficl -I${.CURDIR}/../../fi -I${.CURDIR}/../btx/lib \ -I${.CURDIR}/../../../contrib/dev/acpica/include \ -I${.CURDIR}/../../.. -I. -# the location of libstand -CFLAGS+= -I${SASRC} # Handle FreeBSD specific %b and %D printf format specifiers CFLAGS+= ${FORMAT_EXTENSIONS} Modified: stable/11/sys/boot/i386/loader/Makefile ============================================================================== --- stable/11/sys/boot/i386/loader/Makefile Sun Feb 11 19:33:24 2018 (r329130) +++ stable/11/sys/boot/i386/loader/Makefile Sun Feb 11 19:35:42 2018 (r329131) @@ -28,10 +28,6 @@ CFLAGS+= -DLOADER_ZFS_SUPPORT LIBZFSBOOT= ${.OBJDIR}/../../zfs/libzfsboot.a .endif -.if defined(LOADER_NET_SUPPORT) -CFLAGS+= -I${SASRC} -.endif - .if defined(LOADER_TFTP_SUPPORT) CFLAGS+= -DLOADER_TFTP_SUPPORT .endif Modified: stable/11/sys/boot/mips/beri/boot2/Makefile ============================================================================== --- stable/11/sys/boot/mips/beri/boot2/Makefile Sun Feb 11 19:33:24 2018 (r329130) +++ stable/11/sys/boot/mips/beri/boot2/Makefile Sun Feb 11 19:35:42 2018 (r329131) @@ -57,9 +57,6 @@ CFLAGS= -ffreestanding \ -msoft-float \ -g -# where to get libstand from -CFLAGS+= -I${SASRC} - LDFLAGS= -nostdlib \ -static \ -Wl,-N \ Modified: stable/11/sys/boot/mips/beri/loader/Makefile ============================================================================== --- stable/11/sys/boot/mips/beri/loader/Makefile Sun Feb 11 19:33:24 2018 (r329130) +++ stable/11/sys/boot/mips/beri/loader/Makefile Sun Feb 11 19:35:42 2018 (r329131) @@ -107,9 +107,6 @@ LDFLAGS= -nostdlib \ -L${.CURDIR} \ -e __start -# where to get libstand from -CFLAGS+= -I${SASRC} - DPADD= ${LIBFICL} ${LIBSA} LDADD= ${LIBFICL} ${LIBSA} Modified: stable/11/sys/boot/mips/uboot/Makefile ============================================================================== --- stable/11/sys/boot/mips/uboot/Makefile Sun Feb 11 19:33:24 2018 (r329130) +++ stable/11/sys/boot/mips/uboot/Makefile Sun Feb 11 19:35:42 2018 (r329131) @@ -115,9 +115,6 @@ LIBUBOOT= ${.OBJDIR}/../../uboot/lib/libuboot.a CFLAGS+= -I${.CURDIR}/../../uboot/lib CFLAGS+= -I${.OBJDIR}/../../uboot/lib -# where to get libstand from -CFLAGS+= -I${SASRC} - # clang doesn't understand %D as a specifier to printf #NO_WERROR.clang= #NO_WERROR= Modified: stable/11/sys/boot/ofw/libofw/Makefile ============================================================================== --- stable/11/sys/boot/ofw/libofw/Makefile Sun Feb 11 19:33:24 2018 (r329130) +++ stable/11/sys/boot/ofw/libofw/Makefile Sun Feb 11 19:35:42 2018 (r329131) @@ -9,8 +9,6 @@ SRCS= devicename.c elf_freebsd.c ofw_console.c ofw_cop .PATH: ${.CURDIR}/../../zfs SRCS+= devicename_stubs.c -CFLAGS+= -I${SASRC} - # Pick up the bootstrap header for some interface items CFLAGS+= -I${.CURDIR}/../../common -I${.CURDIR}/../../.. -I. Modified: stable/11/sys/boot/powerpc/kboot/Makefile ============================================================================== --- stable/11/sys/boot/powerpc/kboot/Makefile Sun Feb 11 19:33:24 2018 (r329130) +++ stable/11/sys/boot/powerpc/kboot/Makefile Sun Feb 11 19:35:42 2018 (r329131) @@ -93,9 +93,6 @@ CFLAGS+= -Wa,-mppc64bridge #.PATH: ${.CURDIR}/../../ofw/common #.include "${.CURDIR}/../../ofw/common/Makefile.inc" -# where to get libstand from -CFLAGS+= -I${SASRC} - DPADD= ${LIBFICL} ${LIBOFW} ${LIBFDT} ${LIBSA32} LDADD= ${LIBFICL} ${LIBOFW} ${LIBFDT} ${LIBSA32} Modified: stable/11/sys/boot/powerpc/ofw/Makefile ============================================================================== --- stable/11/sys/boot/powerpc/ofw/Makefile Sun Feb 11 19:33:24 2018 (r329130) +++ stable/11/sys/boot/powerpc/ofw/Makefile Sun Feb 11 19:35:42 2018 (r329131) @@ -91,9 +91,6 @@ LDFLAGS= -nostdlib -static -T ${.CURDIR}/ldscript.powe LIBOFW= ${.OBJDIR}/../../ofw/libofw/libofw.a CFLAGS+= -I${.CURDIR}/../../ofw/libofw -# where to get libstand from -CFLAGS+= -I${SASRC} - DPADD= ${LIBFICL} ${LIBOFW} ${LIBFDT} ${LIBSA32} LDADD= ${LIBFICL} ${LIBOFW} ${LIBFDT} ${LIBSA32} Modified: stable/11/sys/boot/powerpc/ps3/Makefile ============================================================================== --- stable/11/sys/boot/powerpc/ps3/Makefile Sun Feb 11 19:33:24 2018 (r329130) +++ stable/11/sys/boot/powerpc/ps3/Makefile Sun Feb 11 19:35:42 2018 (r329131) @@ -90,9 +90,6 @@ LDFLAGS= -nostdlib -static -T ${.CURDIR}/ldscript.powe #.PATH: ${.CURDIR}/../../ofw/common #.include "${.CURDIR}/../../ofw/common/Makefile.inc" -# where to get libstand from -CFLAGS+= -I${SASRC} - DPADD= ${LIBFICL} ${LIBOFW} ${LIBSA32} LDADD= ${LIBFICL} ${LIBOFW} ${LIBSA32} Modified: stable/11/sys/boot/powerpc/uboot/Makefile ============================================================================== --- stable/11/sys/boot/powerpc/uboot/Makefile Sun Feb 11 19:33:24 2018 (r329130) +++ stable/11/sys/boot/powerpc/uboot/Makefile Sun Feb 11 19:35:42 2018 (r329131) @@ -96,9 +96,6 @@ LIBUBOOT= ${.OBJDIR}/../../uboot/lib/libuboot.a CFLAGS+= -I${.CURDIR}/../../uboot/lib CFLAGS+= -I${.OBJDIR}/../../uboot/lib -# where to get libstand from -CFLAGS+= -I${SASRC} - DPADD= ${LIBFICL} ${LIBUBOOT} ${LIBFDT} ${LIBUBOOT_FDT} ${LIBSA32} LDADD= ${LIBFICL} ${LIBUBOOT} ${LIBFDT} ${LIBUBOOT_FDT} ${LIBSA32} Modified: stable/11/sys/boot/sparc64/loader/Makefile ============================================================================== --- stable/11/sys/boot/sparc64/loader/Makefile Sun Feb 11 19:33:24 2018 (r329130) +++ stable/11/sys/boot/sparc64/loader/Makefile Sun Feb 11 19:35:42 2018 (r329131) @@ -79,9 +79,6 @@ LDFLAGS= -static LIBOFW= ${.OBJDIR}/../../ofw/libofw/libofw.a CFLAGS+= -I${.CURDIR}/../../ofw/libofw/ -# where to get libstand from -CFLAGS+= -I${SASRC} - # Need sys/ for crypto/intake.h CFLAGS+= -I${SRCTOP}/sys Modified: stable/11/sys/boot/uboot/fdt/Makefile ============================================================================== --- stable/11/sys/boot/uboot/fdt/Makefile Sun Feb 11 19:33:24 2018 (r329130) +++ stable/11/sys/boot/uboot/fdt/Makefile Sun Feb 11 19:35:42 2018 (r329131) @@ -12,8 +12,6 @@ SRCS= uboot_fdt.c CFLAGS+= -ffreestanding -msoft-float -CFLAGS+= -I${SASRC} - # U-Boot library headers CFLAGS+= -I${.CURDIR}/../lib Modified: stable/11/sys/boot/uboot/lib/Makefile ============================================================================== --- stable/11/sys/boot/uboot/lib/Makefile Sun Feb 11 19:33:24 2018 (r329130) +++ stable/11/sys/boot/uboot/lib/Makefile Sun Feb 11 19:35:42 2018 (r329131) @@ -13,8 +13,6 @@ SRCS+= module.c net.c reboot.c time.c CFLAGS+= -ffreestanding -msoft-float -CFLAGS+= -I${SASRC} - .if !defined(LOADER_NO_DISK_SUPPORT) SRCS+= disk.c CFLAGS+= -DLOADER_DISK_SUPPORT Modified: stable/11/sys/boot/userboot/userboot/Makefile ============================================================================== --- stable/11/sys/boot/userboot/userboot/Makefile Sun Feb 11 19:33:24 2018 (r329130) +++ stable/11/sys/boot/userboot/userboot/Makefile Sun Feb 11 19:35:42 2018 (r329131) @@ -32,7 +32,6 @@ CFLAGS+= -Wall CFLAGS+= -I${.CURDIR}/.. CFLAGS+= -I${.CURDIR}/../../common CFLAGS+= -I${.CURDIR}/../../.. -CFLAGS+= -I${SASRC} CFLAGS+= -ffreestanding -I. CWARNFLAGS.main.c += -Wno-implicit-function-declaration Modified: stable/11/sys/boot/zfs/Makefile ============================================================================== --- stable/11/sys/boot/zfs/Makefile Sun Feb 11 19:33:24 2018 (r329130) +++ stable/11/sys/boot/zfs/Makefile Sun Feb 11 19:35:42 2018 (r329131) @@ -12,7 +12,6 @@ CFLAGS+= -DSKEIN_LOOP=111 CFLAGS+= -DBOOTPROG=\"zfsloader\" CFLAGS+= -I${.CURDIR}/../common -I${.CURDIR}/../.. -I. -CFLAGS+= -I${SASRC} CFLAGS+= -I${.CURDIR}/../../cddl/boot/zfs CFLAGS+= -I${.CURDIR}/../../crypto/skein From owner-svn-src-all@freebsd.org Sun Feb 11 19:51:30 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7C7F0F1247E; Sun, 11 Feb 2018 19:51:30 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2BCA787A87; Sun, 11 Feb 2018 19:51:30 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 26959276F4; Sun, 11 Feb 2018 19:51:30 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1BJpU8D014825; Sun, 11 Feb 2018 19:51:30 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1BJpTWb014816; Sun, 11 Feb 2018 19:51:29 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201802111951.w1BJpTWb014816@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sun, 11 Feb 2018 19:51:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r329132 - in stable/11: lib/libstand sys/boot/libsa sys/boot/libsa/amd64 sys/boot/libsa/i386 sys/boot/libsa/mips sys/boot/libsa/powerpc sys/boot/libsa/sparc64 X-SVN-Group: stable-11 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in stable/11: lib/libstand sys/boot/libsa sys/boot/libsa/amd64 sys/boot/libsa/i386 sys/boot/libsa/mips sys/boot/libsa/powerpc sys/boot/libsa/sparc64 X-SVN-Commit-Revision: 329132 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Feb 2018 19:51:30 -0000 Author: kevans Date: Sun Feb 11 19:51:29 2018 New Revision: 329132 URL: https://svnweb.freebsd.org/changeset/base/329132 Log: MFC r324551: Move lib/libstand to sys/boot/libsa Added: stable/11/sys/boot/libsa/Makefile.depend - copied unchanged from r329131, stable/11/lib/libstand/Makefile.depend stable/11/sys/boot/libsa/__main.c - copied unchanged from r329131, stable/11/lib/libstand/__main.c stable/11/sys/boot/libsa/amd64/ - copied from r329131, stable/11/lib/libstand/amd64/ stable/11/sys/boot/libsa/arp.c - copied unchanged from r329131, stable/11/lib/libstand/arp.c stable/11/sys/boot/libsa/assert.c - copied unchanged from r329131, stable/11/lib/libstand/assert.c stable/11/sys/boot/libsa/bcd.c - copied unchanged from r329131, stable/11/lib/libstand/bcd.c stable/11/sys/boot/libsa/bootp.c - copied unchanged from r329131, stable/11/lib/libstand/bootp.c stable/11/sys/boot/libsa/bootp.h - copied unchanged from r329131, stable/11/lib/libstand/bootp.h stable/11/sys/boot/libsa/bootparam.c - copied unchanged from r329131, stable/11/lib/libstand/bootparam.c stable/11/sys/boot/libsa/bootparam.h - copied unchanged from r329131, stable/11/lib/libstand/bootparam.h stable/11/sys/boot/libsa/bzipfs.c - copied unchanged from r329131, stable/11/lib/libstand/bzipfs.c stable/11/sys/boot/libsa/cd9660.c - copied unchanged from r329131, stable/11/lib/libstand/cd9660.c stable/11/sys/boot/libsa/close.c - copied unchanged from r329131, stable/11/lib/libstand/close.c stable/11/sys/boot/libsa/closeall.c - copied unchanged from r329131, stable/11/lib/libstand/closeall.c stable/11/sys/boot/libsa/dev.c - copied unchanged from r329131, stable/11/lib/libstand/dev.c stable/11/sys/boot/libsa/dosfs.c - copied unchanged from r329131, stable/11/lib/libstand/dosfs.c stable/11/sys/boot/libsa/dosfs.h - copied unchanged from r329131, stable/11/lib/libstand/dosfs.h stable/11/sys/boot/libsa/environment.c - copied unchanged from r329131, stable/11/lib/libstand/environment.c stable/11/sys/boot/libsa/ether.c - copied unchanged from r329131, stable/11/lib/libstand/ether.c stable/11/sys/boot/libsa/ext2fs.c - copied unchanged from r329131, stable/11/lib/libstand/ext2fs.c stable/11/sys/boot/libsa/fstat.c - copied unchanged from r329131, stable/11/lib/libstand/fstat.c stable/11/sys/boot/libsa/getopt.c - copied unchanged from r329131, stable/11/lib/libstand/getopt.c stable/11/sys/boot/libsa/gets.c - copied unchanged from r329131, stable/11/lib/libstand/gets.c stable/11/sys/boot/libsa/globals.c - copied unchanged from r329131, stable/11/lib/libstand/globals.c stable/11/sys/boot/libsa/gzipfs.c - copied unchanged from r329131, stable/11/lib/libstand/gzipfs.c stable/11/sys/boot/libsa/i386/ - copied from r329131, stable/11/lib/libstand/i386/ stable/11/sys/boot/libsa/in_cksum.c - copied unchanged from r329131, stable/11/lib/libstand/in_cksum.c stable/11/sys/boot/libsa/inet_ntoa.c - copied unchanged from r329131, stable/11/lib/libstand/inet_ntoa.c stable/11/sys/boot/libsa/ioctl.c - copied unchanged from r329131, stable/11/lib/libstand/ioctl.c stable/11/sys/boot/libsa/iodesc.h - copied unchanged from r329131, stable/11/lib/libstand/iodesc.h stable/11/sys/boot/libsa/ip.c - copied unchanged from r329131, stable/11/lib/libstand/ip.c stable/11/sys/boot/libsa/libstand.3 - copied unchanged from r329131, stable/11/lib/libstand/libstand.3 stable/11/sys/boot/libsa/lseek.c - copied unchanged from r329131, stable/11/lib/libstand/lseek.c stable/11/sys/boot/libsa/mips/ - copied from r329131, stable/11/lib/libstand/mips/ stable/11/sys/boot/libsa/nandfs.c - copied unchanged from r329131, stable/11/lib/libstand/nandfs.c stable/11/sys/boot/libsa/net.c - copied unchanged from r329131, stable/11/lib/libstand/net.c stable/11/sys/boot/libsa/net.h - copied unchanged from r329131, stable/11/lib/libstand/net.h stable/11/sys/boot/libsa/netif.c - copied unchanged from r329131, stable/11/lib/libstand/netif.c stable/11/sys/boot/libsa/netif.h - copied unchanged from r329131, stable/11/lib/libstand/netif.h stable/11/sys/boot/libsa/nfs.c - copied unchanged from r329131, stable/11/lib/libstand/nfs.c stable/11/sys/boot/libsa/nfsv2.h - copied unchanged from r329131, stable/11/lib/libstand/nfsv2.h stable/11/sys/boot/libsa/nullfs.c - copied unchanged from r329131, stable/11/lib/libstand/nullfs.c stable/11/sys/boot/libsa/open.c - copied unchanged from r329131, stable/11/lib/libstand/open.c stable/11/sys/boot/libsa/pager.c - copied unchanged from r329131, stable/11/lib/libstand/pager.c stable/11/sys/boot/libsa/pkgfs.c - copied unchanged from r329131, stable/11/lib/libstand/pkgfs.c stable/11/sys/boot/libsa/powerpc/ - copied from r329131, stable/11/lib/libstand/powerpc/ stable/11/sys/boot/libsa/printf.c - copied unchanged from r329131, stable/11/lib/libstand/printf.c stable/11/sys/boot/libsa/qdivrem.c - copied unchanged from r329131, stable/11/lib/libstand/qdivrem.c stable/11/sys/boot/libsa/quad.h - copied unchanged from r329131, stable/11/lib/libstand/quad.h stable/11/sys/boot/libsa/random.c - copied unchanged from r329131, stable/11/lib/libstand/random.c stable/11/sys/boot/libsa/rarp.c - copied unchanged from r329131, stable/11/lib/libstand/rarp.c stable/11/sys/boot/libsa/read.c - copied unchanged from r329131, stable/11/lib/libstand/read.c stable/11/sys/boot/libsa/readdir.c - copied unchanged from r329131, stable/11/lib/libstand/readdir.c stable/11/sys/boot/libsa/rpc.c - copied unchanged from r329131, stable/11/lib/libstand/rpc.c stable/11/sys/boot/libsa/rpc.h - copied unchanged from r329131, stable/11/lib/libstand/rpc.h stable/11/sys/boot/libsa/rpcv2.h - copied unchanged from r329131, stable/11/lib/libstand/rpcv2.h stable/11/sys/boot/libsa/saioctl.h - copied unchanged from r329131, stable/11/lib/libstand/saioctl.h stable/11/sys/boot/libsa/sbrk.c - copied unchanged from r329131, stable/11/lib/libstand/sbrk.c stable/11/sys/boot/libsa/sparc64/ - copied from r329131, stable/11/lib/libstand/sparc64/ stable/11/sys/boot/libsa/splitfs.c - copied unchanged from r329131, stable/11/lib/libstand/splitfs.c stable/11/sys/boot/libsa/stand.h - copied unchanged from r329131, stable/11/lib/libstand/stand.h stable/11/sys/boot/libsa/stat.c - copied unchanged from r329131, stable/11/lib/libstand/stat.c stable/11/sys/boot/libsa/strcasecmp.c - copied unchanged from r329131, stable/11/lib/libstand/strcasecmp.c stable/11/sys/boot/libsa/strdup.c - copied unchanged from r329131, stable/11/lib/libstand/strdup.c stable/11/sys/boot/libsa/strerror.c - copied unchanged from r329131, stable/11/lib/libstand/strerror.c stable/11/sys/boot/libsa/strtol.c - copied unchanged from r329131, stable/11/lib/libstand/strtol.c stable/11/sys/boot/libsa/strtoul.c - copied unchanged from r329131, stable/11/lib/libstand/strtoul.c stable/11/sys/boot/libsa/tftp.c - copied unchanged from r329131, stable/11/lib/libstand/tftp.c stable/11/sys/boot/libsa/tftp.h - copied unchanged from r329131, stable/11/lib/libstand/tftp.h stable/11/sys/boot/libsa/twiddle.c - copied unchanged from r329131, stable/11/lib/libstand/twiddle.c stable/11/sys/boot/libsa/udp.c - copied unchanged from r329131, stable/11/lib/libstand/udp.c stable/11/sys/boot/libsa/ufs.c - copied unchanged from r329131, stable/11/lib/libstand/ufs.c stable/11/sys/boot/libsa/uuid_from_string.c - copied unchanged from r329131, stable/11/lib/libstand/uuid_from_string.c stable/11/sys/boot/libsa/uuid_to_string.c - copied unchanged from r329131, stable/11/lib/libstand/uuid_to_string.c stable/11/sys/boot/libsa/write.c - copied unchanged from r329131, stable/11/lib/libstand/write.c stable/11/sys/boot/libsa/zalloc.c - copied unchanged from r329131, stable/11/lib/libstand/zalloc.c stable/11/sys/boot/libsa/zalloc_defs.h - copied unchanged from r329131, stable/11/lib/libstand/zalloc_defs.h stable/11/sys/boot/libsa/zalloc_malloc.c - copied unchanged from r329131, stable/11/lib/libstand/zalloc_malloc.c stable/11/sys/boot/libsa/zalloc_mem.h - copied unchanged from r329131, stable/11/lib/libstand/zalloc_mem.h stable/11/sys/boot/libsa/zalloc_protos.h - copied unchanged from r329131, stable/11/lib/libstand/zalloc_protos.h Deleted: stable/11/lib/libstand/ Modified: stable/11/sys/boot/libsa/Makefile Modified: stable/11/sys/boot/libsa/Makefile ============================================================================== --- stable/11/sys/boot/libsa/Makefile Sun Feb 11 19:35:42 2018 (r329131) +++ stable/11/sys/boot/libsa/Makefile Sun Feb 11 19:51:29 2018 (r329132) @@ -1,14 +1,163 @@ # $FreeBSD$ +# Originally from $NetBSD: Makefile,v 1.21 1997/10/26 22:08:38 lukem Exp $ +# +# Notes: +# - We don't use the libc strerror/sys_errlist because the string table is +# quite large. +# +PACKAGE=lib${LIB} +MK_PROFILE= no +MK_SSP= no + .include -.include "../Makefile.inc" +LIBSTAND_SRC?= ${.CURDIR} +LIBSTAND_CPUARCH?=${MACHINE_CPUARCH} +LIBC_SRC= ${LIBSTAND_SRC}/../libc -LIBSTAND_SRC= ${SASRC} -LIBC_SRC= ${SRCTOP}/lib/libc -INTERNALLIB= -INCS= -MAN= -.PATH: ${SASRC} +LIB= stand +NO_PIC= +INCS?= stand.h +MAN?= libstand.3 -.include "${SASRC}/Makefile" +WARNS?= 0 + +CFLAGS+= -I${LIBSTAND_SRC} + +# standalone components and stuff we have modified locally +SRCS+= gzguts.h zutil.h __main.c assert.c bcd.c environment.c getopt.c gets.c \ + globals.c pager.c printf.c strdup.c strerror.c strtol.c strtoul.c random.c \ + sbrk.c twiddle.c zalloc.c zalloc_malloc.c + +# private (pruned) versions of libc string functions +SRCS+= strcasecmp.c + +.PATH: ${LIBC_SRC}/net + +SRCS+= ntoh.c + +# string functions from libc +.PATH: ${LIBC_SRC}/string +SRCS+= bcmp.c bcopy.c bzero.c ffs.c fls.c \ + memccpy.c memchr.c memcmp.c memcpy.c memmove.c memset.c \ + qdivrem.c strcat.c strchr.c strcmp.c strcpy.c stpcpy.c stpncpy.c \ + strcspn.c strlcat.c strlcpy.c strlen.c strncat.c strncmp.c strncpy.c \ + strnlen.c strpbrk.c strrchr.c strsep.c strspn.c strstr.c strtok.c swab.c +.if ${MACHINE_CPUARCH} == "arm" +.PATH: ${LIBC_SRC}/arm/gen + +# Do not generate movt/movw, because the relocation fixup for them does not +# translate to the -Bsymbolic -pie format required by self_reloc() in loader(8). +# Also, the fpu is not available in a standalone environment. +.if ${COMPILER_VERSION} < 30800 +CFLAGS.clang+= -mllvm -arm-use-movt=0 +.else +CFLAGS.clang+= -mno-movt +.endif +CFLAGS.clang+= -mfpu=none + +# Compiler support functions +.PATH: ${LIBSTAND_SRC}/../../contrib/compiler-rt/lib/builtins/ +# __clzsi2 and ctzsi2 for various builtin functions +SRCS+= clzsi2.c ctzsi2.c +# Divide and modulus functions called by the compiler +SRCS+= divmoddi4.c divmodsi4.c divdi3.c divsi3.c moddi3.c modsi3.c +SRCS+= udivmoddi4.c udivmodsi4.c udivdi3.c udivsi3.c umoddi3.c umodsi3.c + +.PATH: ${LIBSTAND_SRC}/../../contrib/compiler-rt/lib/builtins/arm/ +SRCS+= aeabi_idivmod.S aeabi_ldivmod.S aeabi_uidivmod.S aeabi_uldivmod.S +SRCS+= aeabi_memcmp.S aeabi_memcpy.S aeabi_memmove.S aeabi_memset.S +.endif + +.if ${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "riscv" +.PATH: ${LIBC_SRC}/${MACHINE_CPUARCH}/gen +.endif + +.if ${MACHINE_CPUARCH} == "powerpc" +.PATH: ${LIBC_SRC}/quad +SRCS+= ashldi3.c ashrdi3.c +SRCS+= syncicache.c +.endif + +# uuid functions from libc +.PATH: ${LIBC_SRC}/uuid +SRCS+= uuid_create_nil.c uuid_equal.c uuid_from_string.c uuid_is_nil.c uuid_to_string.c + +# _setjmp/_longjmp +.PATH: ${LIBSTAND_SRC}/${LIBSTAND_CPUARCH} +SRCS+= _setjmp.S + +# decompression functionality from libbz2 +# NOTE: to actually test this functionality after libbz2 upgrade compile +# loader(8) with LOADER_BZIP2_SUPPORT defined +.PATH: ${LIBSTAND_SRC}/../../contrib/bzip2 +CFLAGS+= -DBZ_NO_STDIO -DBZ_NO_COMPRESS +SRCS+= libstand_bzlib_private.h + +.for file in bzlib.c crctable.c decompress.c huffman.c randtable.c +SRCS+= _${file} +CLEANFILES+= _${file} + +_${file}: ${file} + sed "s|bzlib_private\.h|libstand_bzlib_private.h|" \ + ${.ALLSRC} > ${.TARGET} +.endfor + +CLEANFILES+= libstand_bzlib_private.h +libstand_bzlib_private.h: bzlib_private.h + sed -e 's||"stand.h"|' \ + ${.ALLSRC} > ${.TARGET} + +# decompression functionality from zlib +.PATH: ${LIBSTAND_SRC}/../../contrib/zlib +CFLAGS+=-DHAVE_MEMCPY -I${LIBSTAND_SRC}/../../contrib/zlib +SRCS+= adler32.c crc32.c libstand_zutil.h libstand_gzguts.h + +.for file in infback.c inffast.c inflate.c inftrees.c zutil.c +SRCS+= _${file} +CLEANFILES+= _${file} + +_${file}: ${file} + sed -e "s|zutil\.h|libstand_zutil.h|" \ + -e "s|gzguts\.h|libstand_gzguts.h|" \ + ${.ALLSRC} > ${.TARGET} +.endfor + +# depend on stand.h being able to be included multiple times +.for file in zutil.h gzguts.h +CLEANFILES+= libstand_${file} +libstand_${file}: ${file} + sed -e 's||"stand.h"|' \ + -e 's||"stand.h"|' \ + -e 's||"stand.h"|' \ + -e 's||"stand.h"|' \ + -e 's||"stand.h"|' \ + ${.ALLSRC} > ${.TARGET} +.endfor + +# io routines +SRCS+= closeall.c dev.c ioctl.c nullfs.c stat.c \ + fstat.c close.c lseek.c open.c read.c write.c readdir.c + +# network routines +SRCS+= arp.c ether.c ip.c inet_ntoa.c in_cksum.c net.c udp.c netif.c rpc.c + +# network info services: +SRCS+= bootp.c rarp.c bootparam.c + +# boot filesystems +SRCS+= ufs.c nfs.c cd9660.c tftp.c gzipfs.c bzipfs.c +SRCS+= dosfs.c ext2fs.c +SRCS+= splitfs.c +SRCS+= pkgfs.c +.if ${MK_NAND} != "no" +SRCS+= nandfs.c +.endif + +# explicit_bzero +.PATH: ${SRCTOP}/sys/libkern +SRCS+= explicit_bzero.c + +.include +.include Copied: stable/11/sys/boot/libsa/Makefile.depend (from r329131, stable/11/lib/libstand/Makefile.depend) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/sys/boot/libsa/Makefile.depend Sun Feb 11 19:51:29 2018 (r329132, copy of r329131, stable/11/lib/libstand/Makefile.depend) @@ -0,0 +1,15 @@ +# $FreeBSD$ +# Autogenerated - do NOT edit! + +DIRDEPS = \ + include \ + include/arpa \ + include/xlocale \ + lib/libbz2 \ + + +.include + +.if ${DEP_RELDIR} == ${_DEP_RELDIR} +# local dependencies - needed for -jN in clean tree +.endif Copied: stable/11/sys/boot/libsa/__main.c (from r329131, stable/11/lib/libstand/__main.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/sys/boot/libsa/__main.c Sun Feb 11 19:51:29 2018 (r329132, copy of r329131, stable/11/lib/libstand/__main.c) @@ -0,0 +1,43 @@ +/* $NetBSD: __main.c,v 1.4 1996/03/14 18:52:03 christos Exp $ */ + +/* + * Copyright (c) 1993 Christopher G. Demetriou + * 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 Christopher G. Demetriou. + * 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 + +void __main(void); + +void +__main(void) +{ +} Copied: stable/11/sys/boot/libsa/arp.c (from r329131, stable/11/lib/libstand/arp.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/sys/boot/libsa/arp.c Sun Feb 11 19:51:29 2018 (r329132, copy of r329131, stable/11/lib/libstand/arp.c) @@ -0,0 +1,305 @@ +/* $NetBSD: arp.c,v 1.18 1997/07/07 15:52:49 drochner Exp $ */ + +/* + * Copyright (c) 1992 Regents of the University of California. + * All rights reserved. + * + * This software was developed by the Computer Systems Engineering group + * at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and + * contributed to Berkeley. + * + * 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. + * + * @(#) Header: arp.c,v 1.5 93/07/15 05:52:26 leres Exp (LBL) + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include + +#include + +#include + +#include "stand.h" +#include "net.h" + +/* Cache stuff */ +#define ARP_NUM 8 /* need at most 3 arp entries */ + +struct arp_list { + struct in_addr addr; + u_char ea[6]; +} arp_list[ARP_NUM] = { + /* XXX - net order `INADDR_BROADCAST' must be a constant */ + { {0xffffffff}, BA } +}; +int arp_num = 1; + +/* Local forwards */ +static ssize_t arpsend(struct iodesc *, void *, size_t); +static ssize_t arprecv(struct iodesc *, void **, void **, time_t); + +/* Broadcast an ARP packet, asking who has addr on interface d */ +u_char * +arpwhohas(struct iodesc *d, struct in_addr addr) +{ + int i; + struct ether_arp *ah; + struct arp_list *al; + void *pkt; + struct { + struct ether_header eh; + struct { + struct ether_arp arp; + u_char pad[18]; /* 60 - sizeof(...) */ + } data; + } wbuf; + + /* Try for cached answer first */ + for (i = 0, al = arp_list; i < arp_num; ++i, ++al) + if (addr.s_addr == al->addr.s_addr) + return (al->ea); + + /* Don't overflow cache */ + if (arp_num > ARP_NUM - 1) { + arp_num = 1; /* recycle */ + printf("arpwhohas: overflowed arp_list!\n"); + } + +#ifdef ARP_DEBUG + if (debug) + printf("arpwhohas: send request for %s\n", inet_ntoa(addr)); +#endif + + bzero((char*)&wbuf.data, sizeof(wbuf.data)); + ah = &wbuf.data.arp; + ah->arp_hrd = htons(ARPHRD_ETHER); + ah->arp_pro = htons(ETHERTYPE_IP); + ah->arp_hln = sizeof(ah->arp_sha); /* hardware address length */ + ah->arp_pln = sizeof(ah->arp_spa); /* protocol address length */ + ah->arp_op = htons(ARPOP_REQUEST); + MACPY(d->myea, ah->arp_sha); + bcopy(&d->myip, ah->arp_spa, sizeof(ah->arp_spa)); + /* Leave zeros in arp_tha */ + bcopy(&addr, ah->arp_tpa, sizeof(ah->arp_tpa)); + + /* Store ip address in cache (incomplete entry). */ + al->addr = addr; + + pkt = NULL; + ah = NULL; + i = sendrecv(d, + arpsend, &wbuf.data, sizeof(wbuf.data), + arprecv, &pkt, (void **)&ah); + if (i == -1) { + panic("arp: no response for %s\n", + inet_ntoa(addr)); + } + + /* Store ethernet address in cache */ +#ifdef ARP_DEBUG + if (debug) { + struct ether_header *eh; + + eh = (struct ether_header *)((uintptr_t)pkt + ETHER_ALIGN); + printf("arp: response from %s\n", + ether_sprintf(eh->ether_shost)); + printf("arp: cacheing %s --> %s\n", + inet_ntoa(addr), ether_sprintf(ah->arp_sha)); + } +#endif + MACPY(ah->arp_sha, al->ea); + ++arp_num; + + free(pkt); + return (al->ea); +} + +static ssize_t +arpsend(struct iodesc *d, void *pkt, size_t len) +{ + +#ifdef ARP_DEBUG + if (debug) + printf("arpsend: called\n"); +#endif + + return (sendether(d, pkt, len, bcea, ETHERTYPE_ARP)); +} + +/* + * Returns 0 if this is the packet we're waiting for + * else -1 (and errno == 0) + */ +static ssize_t +arprecv(struct iodesc *d, void **pkt, void **payload, time_t tleft) +{ + ssize_t n; + struct ether_arp *ah; + u_int16_t etype; /* host order */ + void *ptr; + +#ifdef ARP_DEBUG + if (debug) + printf("arprecv: "); +#endif + + ptr = NULL; + n = readether(d, &ptr, (void **)&ah, tleft, &etype); + errno = 0; /* XXX */ + if (n == -1 || n < sizeof(struct ether_arp)) { +#ifdef ARP_DEBUG + if (debug) + printf("bad len=%d\n", n); +#endif + free(ptr); + return (-1); + } + + if (etype != ETHERTYPE_ARP) { +#ifdef ARP_DEBUG + if (debug) + printf("not arp type=%d\n", etype); +#endif + free(ptr); + return (-1); + } + + /* Ethernet address now checked in readether() */ + if (ah->arp_hrd != htons(ARPHRD_ETHER) || + ah->arp_pro != htons(ETHERTYPE_IP) || + ah->arp_hln != sizeof(ah->arp_sha) || + ah->arp_pln != sizeof(ah->arp_spa) ) + { +#ifdef ARP_DEBUG + if (debug) + printf("bad hrd/pro/hln/pln\n"); +#endif + free(ptr); + return (-1); + } + + if (ah->arp_op == htons(ARPOP_REQUEST)) { +#ifdef ARP_DEBUG + if (debug) + printf("is request\n"); +#endif + arp_reply(d, ah); + free(ptr); + return (-1); + } + + if (ah->arp_op != htons(ARPOP_REPLY)) { +#ifdef ARP_DEBUG + if (debug) + printf("not ARP reply\n"); +#endif + free(ptr); + return (-1); + } + + /* Is the reply from the source we want? */ + if (bcmp(&arp_list[arp_num].addr, + ah->arp_spa, sizeof(ah->arp_spa))) + { +#ifdef ARP_DEBUG + if (debug) + printf("unwanted address\n"); +#endif + free(ptr); + return (-1); + } + /* We don't care who the reply was sent to. */ + + /* We have our answer. */ +#ifdef ARP_DEBUG + if (debug) + printf("got it\n"); +#endif + *pkt = ptr; + *payload = ah; + return (n); +} + +/* + * Convert an ARP request into a reply and send it. + * Notes: Re-uses buffer. Pad to length = 46. + */ +void +arp_reply(struct iodesc *d, void *pkt) +{ + struct ether_arp *arp = pkt; + + if (arp->arp_hrd != htons(ARPHRD_ETHER) || + arp->arp_pro != htons(ETHERTYPE_IP) || + arp->arp_hln != sizeof(arp->arp_sha) || + arp->arp_pln != sizeof(arp->arp_spa) ) + { +#ifdef ARP_DEBUG + if (debug) + printf("arp_reply: bad hrd/pro/hln/pln\n"); +#endif + return; + } + + if (arp->arp_op != htons(ARPOP_REQUEST)) { +#ifdef ARP_DEBUG + if (debug) + printf("arp_reply: not request!\n"); +#endif + return; + } + + /* If we are not the target, ignore the request. */ + if (bcmp(arp->arp_tpa, &d->myip, sizeof(arp->arp_tpa))) + return; + +#ifdef ARP_DEBUG + if (debug) { + printf("arp_reply: to %s\n", ether_sprintf(arp->arp_sha)); + } +#endif + + arp->arp_op = htons(ARPOP_REPLY); + /* source becomes target */ + bcopy(arp->arp_sha, arp->arp_tha, sizeof(arp->arp_tha)); + bcopy(arp->arp_spa, arp->arp_tpa, sizeof(arp->arp_tpa)); + /* here becomes source */ + bcopy(d->myea, arp->arp_sha, sizeof(arp->arp_sha)); + bcopy(&d->myip, arp->arp_spa, sizeof(arp->arp_spa)); + + /* + * No need to get fancy here. If the send fails, the + * requestor will just ask again. + */ + (void) sendether(d, pkt, sizeof(*arp) + 18, + arp->arp_tha, ETHERTYPE_ARP); +} Copied: stable/11/sys/boot/libsa/assert.c (from r329131, stable/11/lib/libstand/assert.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/sys/boot/libsa/assert.c Sun Feb 11 19:51:29 2018 (r329132, copy of r329131, stable/11/lib/libstand/assert.c) @@ -0,0 +1,44 @@ +/*- + * Copyright (c) 1998 Michael Smith. + * 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 "stand.h" + +void +__assert(const char *func, const char *file, int line, const char *expression) +{ + if (func == NULL) + panic("Assertion failed: (%s), file %s, line %d.\n", + expression, file, line); + else + panic( + "Assertion failed: (%s), function %s, file %s, line %d.\n", + expression, func, file, line); +} Copied: stable/11/sys/boot/libsa/bcd.c (from r329131, stable/11/lib/libstand/bcd.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/sys/boot/libsa/bcd.c Sun Feb 11 19:51:29 2018 (r329132, copy of r329131, stable/11/lib/libstand/bcd.c) @@ -0,0 +1,38 @@ +/* + * Some data-tables that are often used. + * Cannot be copyrighted. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include + +u_char const bcd2bin_data[] = { + 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 0, 0, 0, 0, 0, + 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 0, 0, 0, 0, 0, 0, + 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 0, 0, 0, 0, 0, 0, + 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 0, 0, 0, 0, 0, 0, + 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 0, 0, 0, 0, 0, 0, + 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 0, 0, 0, 0, 0, 0, + 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 0, 0, 0, 0, 0, 0, + 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 0, 0, 0, 0, 0, 0, + 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 0, 0, 0, 0, 0, 0, + 90, 91, 92, 93, 94, 95, 96, 97, 98, 99 +}; + +u_char const bin2bcd_data[] = { + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, + 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, + 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, + 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, + 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, + 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, + 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, + 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, + 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, + 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98, 0x99 +}; + +/* This is actually used with radix [2..36] */ +char const hex2ascii_data[] = "0123456789abcdefghijklmnopqrstuvwxyz"; Copied: stable/11/sys/boot/libsa/bootp.c (from r329131, stable/11/lib/libstand/bootp.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/sys/boot/libsa/bootp.c Sun Feb 11 19:51:29 2018 (r329132, copy of r329131, stable/11/lib/libstand/bootp.c) @@ -0,0 +1,791 @@ +/* $NetBSD: bootp.c,v 1.14 1998/02/16 11:10:54 drochner Exp $ */ + +/* + * Copyright (c) 1992 Regents of the University of California. + * All rights reserved. + * + * This software was developed by the Computer Systems Engineering group + * at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and + * contributed to Berkeley. + * + * 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. + * + * @(#) Header: bootp.c,v 1.4 93/09/11 03:13:51 leres Exp (LBL) + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include + +#include + +#define BOOTP_DEBUGxx +#define SUPPORT_DHCP + +#define DHCP_ENV_NOVENDOR 1 /* do not parse vendor options */ +#define DHCP_ENV_PXE 10 /* assume pxe vendor options */ +#define DHCP_ENV_FREEBSD 11 /* assume freebsd vendor options */ +/* set DHCP_ENV to one of the values above to export dhcp options to kenv */ +#define DHCP_ENV DHCP_ENV_NO_VENDOR + +#include "stand.h" +#include "net.h" +#include "netif.h" +#include "bootp.h" + + +struct in_addr servip; + +static time_t bot; + +static char vm_rfc1048[4] = VM_RFC1048; +#ifdef BOOTP_VEND_CMU +static char vm_cmu[4] = VM_CMU; +#endif + +/* Local forwards */ +static ssize_t bootpsend(struct iodesc *, void *, size_t); +static ssize_t bootprecv(struct iodesc *, void **, void **, time_t); +static int vend_rfc1048(u_char *, u_int); +#ifdef BOOTP_VEND_CMU +static void vend_cmu(u_char *); +#endif + +#ifdef DHCP_ENV /* export the dhcp response to kenv */ +struct dhcp_opt; +static void setenv_(u_char *cp, u_char *ep, struct dhcp_opt *opts); +#else +#define setenv_(a, b, c) +#endif + +#ifdef SUPPORT_DHCP +static char expected_dhcpmsgtype = -1, dhcp_ok; +struct in_addr dhcp_serverip; +#endif +struct bootp *bootp_response; +size_t bootp_response_size; + +static void +bootp_fill_request(unsigned char *bp_vend) +{ + /* + * We are booting from PXE, we want to send the string + * 'PXEClient' to the DHCP server so you have the option of + * only responding to PXE aware dhcp requests. + */ + bp_vend[0] = TAG_CLASSID; + bp_vend[1] = 9; + bcopy("PXEClient", &bp_vend[2], 9); + bp_vend[11] = TAG_USER_CLASS; + /* len of each user class + number of user class */ + bp_vend[12] = 8; + /* len of the first user class */ + bp_vend[13] = 7; + bcopy("FreeBSD", &bp_vend[14], 7); + bp_vend[21] = TAG_PARAM_REQ; + bp_vend[22] = 7; + bp_vend[23] = TAG_ROOTPATH; + bp_vend[24] = TAG_HOSTNAME; + bp_vend[25] = TAG_SWAPSERVER; + bp_vend[26] = TAG_GATEWAY; + bp_vend[27] = TAG_SUBNET_MASK; + bp_vend[28] = TAG_INTF_MTU; + bp_vend[29] = TAG_SERVERID; + bp_vend[30] = TAG_END; +} + +/* Fetch required bootp infomation */ +void +bootp(int sock) +{ + void *pkt; + struct iodesc *d; + struct bootp *bp; + struct { + u_char header[HEADER_SIZE]; + struct bootp wbootp; + } wbuf; + struct bootp *rbootp; + +#ifdef BOOTP_DEBUG + if (debug) + printf("bootp: socket=%d\n", sock); +#endif + if (!bot) + bot = getsecs(); + + if (!(d = socktodesc(sock))) { + printf("bootp: bad socket. %d\n", sock); + return; + } +#ifdef BOOTP_DEBUG + if (debug) + printf("bootp: d=%lx\n", (long)d); +#endif + + bp = &wbuf.wbootp; + bzero(bp, sizeof(*bp)); + + bp->bp_op = BOOTREQUEST; + bp->bp_htype = 1; /* 10Mb Ethernet (48 bits) */ + bp->bp_hlen = 6; + bp->bp_xid = htonl(d->xid); + MACPY(d->myea, bp->bp_chaddr); + strncpy(bp->bp_file, bootfile, sizeof(bp->bp_file)); + bcopy(vm_rfc1048, bp->bp_vend, sizeof(vm_rfc1048)); +#ifdef SUPPORT_DHCP + bp->bp_vend[4] = TAG_DHCP_MSGTYPE; + bp->bp_vend[5] = 1; + bp->bp_vend[6] = DHCPDISCOVER; + bootp_fill_request(&bp->bp_vend[7]); + +#else + bp->bp_vend[4] = TAG_END; +#endif + + d->myip.s_addr = INADDR_ANY; + d->myport = htons(IPPORT_BOOTPC); + d->destip.s_addr = INADDR_BROADCAST; + d->destport = htons(IPPORT_BOOTPS); + +#ifdef SUPPORT_DHCP + expected_dhcpmsgtype = DHCPOFFER; + dhcp_ok = 0; +#endif + + if(sendrecv(d, + bootpsend, bp, sizeof(*bp), + bootprecv, &pkt, (void **)&rbootp) == -1) { + printf("bootp: no reply\n"); + return; + } + +#ifdef SUPPORT_DHCP + if(dhcp_ok) { + u_int32_t leasetime; + bp->bp_vend[6] = DHCPREQUEST; + bp->bp_vend[7] = TAG_REQ_ADDR; + bp->bp_vend[8] = 4; + bcopy(&rbootp->bp_yiaddr, &bp->bp_vend[9], 4); + bp->bp_vend[13] = TAG_SERVERID; + bp->bp_vend[14] = 4; + bcopy(&dhcp_serverip.s_addr, &bp->bp_vend[15], 4); + bp->bp_vend[19] = TAG_LEASETIME; + bp->bp_vend[20] = 4; + leasetime = htonl(300); + bcopy(&leasetime, &bp->bp_vend[21], 4); + bootp_fill_request(&bp->bp_vend[25]); + + expected_dhcpmsgtype = DHCPACK; + + free(pkt); + if(sendrecv(d, + bootpsend, bp, sizeof(*bp), + bootprecv, &pkt, (void **)&rbootp) == -1) { + printf("DHCPREQUEST failed\n"); + return; + } + } +#endif + + myip = d->myip = rbootp->bp_yiaddr; + servip = rbootp->bp_siaddr; + if (rootip.s_addr == INADDR_ANY) + rootip = servip; + bcopy(rbootp->bp_file, bootfile, sizeof(bootfile)); + bootfile[sizeof(bootfile) - 1] = '\0'; + + if (!netmask) { + if (IN_CLASSA(ntohl(myip.s_addr))) + netmask = htonl(IN_CLASSA_NET); + else if (IN_CLASSB(ntohl(myip.s_addr))) + netmask = htonl(IN_CLASSB_NET); + else + netmask = htonl(IN_CLASSC_NET); +#ifdef BOOTP_DEBUG + if (debug) + printf("'native netmask' is %s\n", intoa(netmask)); +#endif + } + +#ifdef BOOTP_DEBUG + if (debug) + printf("mask: %s\n", intoa(netmask)); +#endif + + /* We need a gateway if root is on a different net */ + if (!SAMENET(myip, rootip, netmask)) { +#ifdef BOOTP_DEBUG + if (debug) + printf("need gateway for root ip\n"); +#endif + } + + /* Toss gateway if on a different net */ + if (!SAMENET(myip, gateip, netmask)) { +#ifdef BOOTP_DEBUG + if (debug) + printf("gateway ip (%s) bad\n", inet_ntoa(gateip)); +#endif + gateip.s_addr = 0; + } + + /* Bump xid so next request will be unique. */ + ++d->xid; + free(pkt); +} + +/* Transmit a bootp request */ +static ssize_t +bootpsend(struct iodesc *d, void *pkt, size_t len) +{ + struct bootp *bp; + +#ifdef BOOTP_DEBUG + if (debug) + printf("bootpsend: d=%lx called.\n", (long)d); +#endif + + bp = pkt; + bp->bp_secs = htons((u_short)(getsecs() - bot)); + +#ifdef BOOTP_DEBUG + if (debug) + printf("bootpsend: calling sendudp\n"); +#endif + + return (sendudp(d, pkt, len)); +} + +static ssize_t +bootprecv(struct iodesc *d, void **pkt, void **payload, time_t tleft) +{ + ssize_t n; + struct bootp *bp; + void *ptr; + +#ifdef BOOTP_DEBUG + if (debug) + printf("bootp_recvoffer: called\n"); +#endif + + ptr = NULL; + n = readudp(d, &ptr, (void **)&bp, tleft); + if (n == -1 || n < sizeof(struct bootp) - BOOTP_VENDSIZE) + goto bad; + +#ifdef BOOTP_DEBUG + if (debug) + printf("bootprecv: checked. bp = %p, n = %zd\n", bp, n); +#endif + if (bp->bp_xid != htonl(d->xid)) { +#ifdef BOOTP_DEBUG + if (debug) { + printf("bootprecv: expected xid 0x%lx, got 0x%x\n", + d->xid, ntohl(bp->bp_xid)); + } +#endif + goto bad; + } + +#ifdef BOOTP_DEBUG + if (debug) + printf("bootprecv: got one!\n"); +#endif + + /* Suck out vendor info */ + if (bcmp(vm_rfc1048, bp->bp_vend, sizeof(vm_rfc1048)) == 0) { + int vsize = n - offsetof(struct bootp, bp_vend); + if (vend_rfc1048(bp->bp_vend, vsize) != 0) + goto bad; + + /* Save copy of bootp reply or DHCP ACK message */ + if (bp->bp_op == BOOTREPLY && + ((dhcp_ok == 1 && expected_dhcpmsgtype == DHCPACK) || + dhcp_ok == 0)) { + free(bootp_response); + bootp_response = malloc(n); + if (bootp_response != NULL) { + bootp_response_size = n; + bcopy(bp, bootp_response, bootp_response_size); + } + } + } +#ifdef BOOTP_VEND_CMU + else if (bcmp(vm_cmu, bp->bp_vend, sizeof(vm_cmu)) == 0) + vend_cmu(bp->bp_vend); +#endif + else + printf("bootprecv: unknown vendor 0x%lx\n", (long)bp->bp_vend); + + *pkt = ptr; + *payload = bp; + return (n); +bad: + free(ptr); + errno = 0; + return (-1); +} + +int +dhcp_try_rfc1048(u_char *cp, u_int len) +{ + + expected_dhcpmsgtype = DHCPACK; + if (bcmp(vm_rfc1048, cp, sizeof(vm_rfc1048)) == 0) { *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Sun Feb 11 20:00:28 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A844DF12FD5; Sun, 11 Feb 2018 20:00:28 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5946B68100; Sun, 11 Feb 2018 20:00:28 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 53BB92774B; Sun, 11 Feb 2018 20:00:28 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1BK0SoF016447; Sun, 11 Feb 2018 20:00:28 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1BK0QDc016430; Sun, 11 Feb 2018 20:00:26 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201802112000.w1BK0QDc016430@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sun, 11 Feb 2018 20:00:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r329134 - in stable/11/sys/boot: . common efi/boot1 i386/gptboot i386/gptzfsboot i386/zfsboot libsa libsa32 libstand32 powerpc/boot1.chrp sparc64/boot1 uboot/lib userboot userboot/libst... X-SVN-Group: stable-11 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in stable/11/sys/boot: . common efi/boot1 i386/gptboot i386/gptzfsboot i386/zfsboot libsa libsa32 libstand32 powerpc/boot1.chrp sparc64/boot1 uboot/lib userboot userboot/libstand userboot/userboot X-SVN-Commit-Revision: 329134 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Feb 2018 20:00:29 -0000 Author: kevans Date: Sun Feb 11 20:00:26 2018 New Revision: 329134 URL: https://svnweb.freebsd.org/changeset/base/329134 Log: MFC Loader Fixes 2017q4p4: r324552,r324553,r324554,r324555,r324556 r324552: Kill the userboot copy of libstand. r324553: Rename libstand.a to libsa.a and libstand32.a to libsa32.a r324554: Move crc32.c, util.c and gpt.c over to libsa. r324555: Honor CFLAGS modifications in Makefile.inc by using += here. r324556: Move ufsread.c Added: stable/11/sys/boot/libsa/crc32.c - copied unchanged from r324554, head/sys/boot/libsa/crc32.c stable/11/sys/boot/libsa/crc32.h - copied unchanged from r324554, head/sys/boot/libsa/crc32.h stable/11/sys/boot/libsa/gpt.c - copied unchanged from r324554, head/sys/boot/libsa/gpt.c stable/11/sys/boot/libsa/gpt.h - copied unchanged from r324554, head/sys/boot/libsa/gpt.h stable/11/sys/boot/libsa/ufsread.c - copied unchanged from r329133, stable/11/sys/boot/common/ufsread.c stable/11/sys/boot/libsa/util.c - copied unchanged from r324554, head/sys/boot/libsa/util.c stable/11/sys/boot/libsa/util.h - copied unchanged from r324554, head/sys/boot/libsa/util.h stable/11/sys/boot/libsa32/ - copied from r324553, head/sys/boot/libsa32/ Deleted: stable/11/sys/boot/common/crc32.c stable/11/sys/boot/common/crc32.h stable/11/sys/boot/common/gpt.c stable/11/sys/boot/common/gpt.h stable/11/sys/boot/common/ufsread.c stable/11/sys/boot/common/util.c stable/11/sys/boot/common/util.h stable/11/sys/boot/libstand32/ stable/11/sys/boot/userboot/libstand/Makefile stable/11/sys/boot/userboot/libstand/Makefile.depend Modified: stable/11/sys/boot/Makefile.amd64 stable/11/sys/boot/Makefile.i386 stable/11/sys/boot/Makefile.inc stable/11/sys/boot/Makefile.powerpc stable/11/sys/boot/common/Makefile.inc stable/11/sys/boot/efi/boot1/Makefile stable/11/sys/boot/i386/gptboot/Makefile stable/11/sys/boot/i386/gptzfsboot/Makefile stable/11/sys/boot/i386/zfsboot/Makefile stable/11/sys/boot/libsa/Makefile stable/11/sys/boot/powerpc/boot1.chrp/Makefile stable/11/sys/boot/sparc64/boot1/Makefile stable/11/sys/boot/uboot/lib/Makefile stable/11/sys/boot/userboot/Makefile stable/11/sys/boot/userboot/userboot/Makefile Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/boot/Makefile.amd64 ============================================================================== --- stable/11/sys/boot/Makefile.amd64 Sun Feb 11 19:54:21 2018 (r329133) +++ stable/11/sys/boot/Makefile.amd64 Sun Feb 11 20:00:26 2018 (r329134) @@ -1,7 +1,7 @@ # $FreeBSD$ SUBDIR+= efi -SUBDIR+= libstand32 +SUBDIR+= libsa32 SUBDIR+= zfs SUBDIR+= userboot Modified: stable/11/sys/boot/Makefile.i386 ============================================================================== --- stable/11/sys/boot/Makefile.i386 Sun Feb 11 19:54:21 2018 (r329133) +++ stable/11/sys/boot/Makefile.i386 Sun Feb 11 20:00:26 2018 (r329134) @@ -1,7 +1,7 @@ # $FreeBSD$ SUBDIR+= efi -SUBDIR+= libstand32 +SUBDIR+= libsa32 SUBDIR+= zfs .if !defined(LOADER_NO_GELI_SUPPORT) Modified: stable/11/sys/boot/Makefile.inc ============================================================================== --- stable/11/sys/boot/Makefile.inc Sun Feb 11 19:54:21 2018 (r329133) +++ stable/11/sys/boot/Makefile.inc Sun Feb 11 20:00:26 2018 (r329134) @@ -5,13 +5,11 @@ .if !defined(__BOOT_MAKEFILE_INC__) __BOOT_MAKEFILE_INC__=${MFILE} -SASRC=${SRCTOP}/lib/libstand -# Normal standalone library -LIBSA=${OBJTOP}/sys/boot/libsa/libstand.a +SASRC=${SRCTOP}/sys/boot/libsa +# Normal Standalone library +LIBSA=${OBJTOP}/sys/boot/libsa/libsa.a # Standalone library compiled for 32-bit version of the processor -LIBSA32=${OBJTOP}/sys/boot/libstand32/libstand.a -# Standalone library compiled for userboot -LIBSAU=${OBJTOP}/sys/boot/userboot/libstand/libstand.a +LIBSA32=${OBJTOP}/sys/boot/libsa32/libsa32.a CFLAGS+=-I${SASRC} Modified: stable/11/sys/boot/Makefile.powerpc ============================================================================== --- stable/11/sys/boot/Makefile.powerpc Sun Feb 11 19:54:21 2018 (r329133) +++ stable/11/sys/boot/Makefile.powerpc Sun Feb 11 20:00:26 2018 (r329134) @@ -4,6 +4,6 @@ SUBDIR+= fdt .endif -SUBDIR+= libstand32 +SUBDIR+= libsa32 SUBDIR+= ofw SUBDIR+= uboot Modified: stable/11/sys/boot/common/Makefile.inc ============================================================================== --- stable/11/sys/boot/common/Makefile.inc Sun Feb 11 19:54:21 2018 (r329133) +++ stable/11/sys/boot/common/Makefile.inc Sun Feb 11 20:00:26 2018 (r329134) @@ -1,5 +1,7 @@ # $FreeBSD$ +.PATH: ${SRCTOP}/sys/boot/common ${SRCTOP}/sys/boot/libsa + SRCS+= boot.c commands.c console.c devopen.c interp.c SRCS+= interp_backslash.c interp_parse.c ls.c misc.c SRCS+= module.c panic.c @@ -32,7 +34,6 @@ SRCS+= dev_net.c SRCS+= disk.c part.c CFLAGS+= -DLOADER_DISK_SUPPORT .if !defined(LOADER_NO_GPT_SUPPORT) -SRCS+= crc32.c CFLAGS+= -DLOADER_GPT_SUPPORT .endif .if !defined(LOADER_NO_MBR_SUPPORT) Modified: stable/11/sys/boot/efi/boot1/Makefile ============================================================================== --- stable/11/sys/boot/efi/boot1/Makefile Sun Feb 11 19:54:21 2018 (r329133) +++ stable/11/sys/boot/efi/boot1/Makefile Sun Feb 11 20:00:26 2018 (r329134) @@ -2,7 +2,7 @@ MAN= -.include +.include "../Makefile.inc" MK_SSP= no @@ -120,7 +120,7 @@ boot1.efi: ${PROG} -j .rela.dyn -j .reloc -j .eh_frame \ --output-target=${EFI_TARGET} ${.ALLSRC} ${.TARGET} -boot1.o: ${.CURDIR}/../../common/ufsread.c +boot1.o: ${SASRC}/ufsread.c # The following inserts our objects into a template FAT file system # created by generate-fat.sh Modified: stable/11/sys/boot/i386/gptboot/Makefile ============================================================================== --- stable/11/sys/boot/i386/gptboot/Makefile Sun Feb 11 19:54:21 2018 (r329133) +++ stable/11/sys/boot/i386/gptboot/Makefile Sun Feb 11 20:00:26 2018 (r329134) @@ -1,7 +1,9 @@ # $FreeBSD$ -.PATH: ${.CURDIR}/../boot2 ${.CURDIR}/../common ${.CURDIR}/../../common +.include "../Makefile.inc" +.PATH: ${.CURDIR}/../boot2 ${.CURDIR}/../common ${SASRC} + FILES= gptboot MAN= gptboot.8 @@ -20,7 +22,7 @@ GPTBOOT_UFS?= UFS1_AND_UFS2 #GPTBOOT_UFS?= UFS2_ONLY #GPTBOOT_UFS?= UFS1_ONLY -CFLAGS= -DBOOTPROG=\"gptboot\" \ +CFLAGS+=-DBOOTPROG=\"gptboot\" \ -O1 \ -DGPT \ -D${GPTBOOT_UFS} \ @@ -76,7 +78,7 @@ gptboot.bin: gptboot.out gptboot.out: ${BTXCRT} gptboot.o sio.o crc32.o drv.o cons.o util.o ${OPENCRYPTO_XTS} ${LD} ${LD_FLAGS} -Ttext ${ORG2} -o ${.TARGET} ${.ALLSRC} ${LIBGELIBOOT} ${LIBSA32} -gptboot.o: ${.CURDIR}/../../common/ufsread.c +gptboot.o: ${SASRC}/ufsread.c .if ${MACHINE_CPUARCH} == "amd64" beforedepend gptboot.o: machine Modified: stable/11/sys/boot/i386/gptzfsboot/Makefile ============================================================================== --- stable/11/sys/boot/i386/gptzfsboot/Makefile Sun Feb 11 19:54:21 2018 (r329133) +++ stable/11/sys/boot/i386/gptzfsboot/Makefile Sun Feb 11 20:00:26 2018 (r329134) @@ -1,10 +1,10 @@ # $FreeBSD$ -.include +.include "../Makefile.inc" .PATH: ${.CURDIR}/../boot2 ${.CURDIR}/../gptboot \ ${.CURDIR}/../zfsboot ${.CURDIR}/../common \ - ${.CURDIR}/../../common ${.CURDIR}/../../../crypto/skein + ${.CURDIR}/../../../crypto/skein ${SASRC} FILES= gptzfsboot MAN= gptzfsboot.8 @@ -19,7 +19,7 @@ REL1= 0x700 ORG1= 0x7c00 ORG2= 0x0 -CFLAGS= -DBOOTPROG=\"gptzfsboot\" \ +CFLAGS+=-DBOOTPROG=\"gptzfsboot\" \ -O1 \ -DGPT -DZFS -DBOOT2 \ -DSIOPRT=${BOOT_COMCONSOLE_PORT} \ Modified: stable/11/sys/boot/i386/zfsboot/Makefile ============================================================================== --- stable/11/sys/boot/i386/zfsboot/Makefile Sun Feb 11 19:54:21 2018 (r329133) +++ stable/11/sys/boot/i386/zfsboot/Makefile Sun Feb 11 20:00:26 2018 (r329134) @@ -1,7 +1,9 @@ # $FreeBSD$ +.include "../Makefile.inc" + .PATH: ${.CURDIR}/../boot2 ${.CURDIR}/../common \ - ${.CURDIR}/../../common ${.CURDIR}/../../../crypto/skein + ${.CURDIR}/../../../crypto/skein ${SASRC} FILES= zfsboot MAN= zfsboot.8 @@ -16,7 +18,7 @@ REL1= 0x700 ORG1= 0x7c00 ORG2= 0x2000 -CFLAGS= -DBOOTPROG=\"zfsboot\" \ +CFLAGS+=-DBOOTPROG=\"zfsboot\" \ -O1 \ -DZFS -DBOOT2 \ -DSIOPRT=${BOOT_COMCONSOLE_PORT} \ Modified: stable/11/sys/boot/libsa/Makefile ============================================================================== --- stable/11/sys/boot/libsa/Makefile Sun Feb 11 19:54:21 2018 (r329133) +++ stable/11/sys/boot/libsa/Makefile Sun Feb 11 20:00:26 2018 (r329134) @@ -16,7 +16,7 @@ LIBSTAND_SRC?= ${.CURDIR} LIBSTAND_CPUARCH?=${MACHINE_CPUARCH} LIBC_SRC= ${LIBSTAND_SRC}/../libc -LIB= stand +LIB?= sa NO_PIC= INCS?= stand.h MAN?= libstand.3 Copied: stable/11/sys/boot/libsa/crc32.c (from r324554, head/sys/boot/libsa/crc32.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/sys/boot/libsa/crc32.c Sun Feb 11 20:00:26 2018 (r329134, copy of r324554, head/sys/boot/libsa/crc32.c) @@ -0,0 +1,108 @@ +/*- + * COPYRIGHT (C) 1986 Gary S. Brown. You may use this program, or + * code or tables extracted from it, as desired without restriction. + */ + +/* + * First, the polynomial itself and its table of feedback terms. The + * polynomial is + * X^32+X^26+X^23+X^22+X^16+X^12+X^11+X^10+X^8+X^7+X^5+X^4+X^2+X^1+X^0 + * + * Note that we take it "backwards" and put the highest-order term in + * the lowest-order bit. The X^32 term is "implied"; the LSB is the + * X^31 term, etc. The X^0 term (usually shown as "+1") results in + * the MSB being 1 + * + * Note that the usual hardware shift register implementation, which + * is what we're using (we're merely optimizing it by doing eight-bit + * chunks at a time) shifts bits into the lowest-order term. In our + * implementation, that means shifting towards the right. Why do we + * do it this way? Because the calculated CRC must be transmitted in + * order from highest-order term to lowest-order term. UARTs transmit + * characters in order from LSB to MSB. By storing the CRC this way + * we hand it to the UART in the order low-byte to high-byte; the UART + * sends each low-bit to hight-bit; and the result is transmission bit + * by bit from highest- to lowest-order term without requiring any bit + * shuffling on our part. Reception works similarly + * + * The feedback terms table consists of 256, 32-bit entries. Notes + * + * The table can be generated at runtime if desired; code to do so + * is shown later. It might not be obvious, but the feedback + * terms simply represent the results of eight shift/xor opera + * tions for all combinations of data and CRC register values + * + * The values must be right-shifted by eight bits by the "updcrc + * logic; the shift must be unsigned (bring in zeroes). On some + * hardware you could probably optimize the shift in assembler by + * using byte-swap instructions + * polynomial $edb88320 + * + * + * CRC32 code derived from work by Gary S. Brown. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include + +#include "crc32.h" + +static const uint32_t crc32_tab[] = { + 0x00000000, 0x77073096, 0xee0e612c, 0x990951ba, 0x076dc419, 0x706af48f, + 0xe963a535, 0x9e6495a3, 0x0edb8832, 0x79dcb8a4, 0xe0d5e91e, 0x97d2d988, + 0x09b64c2b, 0x7eb17cbd, 0xe7b82d07, 0x90bf1d91, 0x1db71064, 0x6ab020f2, + 0xf3b97148, 0x84be41de, 0x1adad47d, 0x6ddde4eb, 0xf4d4b551, 0x83d385c7, + 0x136c9856, 0x646ba8c0, 0xfd62f97a, 0x8a65c9ec, 0x14015c4f, 0x63066cd9, + 0xfa0f3d63, 0x8d080df5, 0x3b6e20c8, 0x4c69105e, 0xd56041e4, 0xa2677172, + 0x3c03e4d1, 0x4b04d447, 0xd20d85fd, 0xa50ab56b, 0x35b5a8fa, 0x42b2986c, + 0xdbbbc9d6, 0xacbcf940, 0x32d86ce3, 0x45df5c75, 0xdcd60dcf, 0xabd13d59, + 0x26d930ac, 0x51de003a, 0xc8d75180, 0xbfd06116, 0x21b4f4b5, 0x56b3c423, + 0xcfba9599, 0xb8bda50f, 0x2802b89e, 0x5f058808, 0xc60cd9b2, 0xb10be924, + 0x2f6f7c87, 0x58684c11, 0xc1611dab, 0xb6662d3d, 0x76dc4190, 0x01db7106, + 0x98d220bc, 0xefd5102a, 0x71b18589, 0x06b6b51f, 0x9fbfe4a5, 0xe8b8d433, + 0x7807c9a2, 0x0f00f934, 0x9609a88e, 0xe10e9818, 0x7f6a0dbb, 0x086d3d2d, + 0x91646c97, 0xe6635c01, 0x6b6b51f4, 0x1c6c6162, 0x856530d8, 0xf262004e, + 0x6c0695ed, 0x1b01a57b, 0x8208f4c1, 0xf50fc457, 0x65b0d9c6, 0x12b7e950, + 0x8bbeb8ea, 0xfcb9887c, 0x62dd1ddf, 0x15da2d49, 0x8cd37cf3, 0xfbd44c65, + 0x4db26158, 0x3ab551ce, 0xa3bc0074, 0xd4bb30e2, 0x4adfa541, 0x3dd895d7, + 0xa4d1c46d, 0xd3d6f4fb, 0x4369e96a, 0x346ed9fc, 0xad678846, 0xda60b8d0, + 0x44042d73, 0x33031de5, 0xaa0a4c5f, 0xdd0d7cc9, 0x5005713c, 0x270241aa, + 0xbe0b1010, 0xc90c2086, 0x5768b525, 0x206f85b3, 0xb966d409, 0xce61e49f, + 0x5edef90e, 0x29d9c998, 0xb0d09822, 0xc7d7a8b4, 0x59b33d17, 0x2eb40d81, + 0xb7bd5c3b, 0xc0ba6cad, 0xedb88320, 0x9abfb3b6, 0x03b6e20c, 0x74b1d29a, + 0xead54739, 0x9dd277af, 0x04db2615, 0x73dc1683, 0xe3630b12, 0x94643b84, + 0x0d6d6a3e, 0x7a6a5aa8, 0xe40ecf0b, 0x9309ff9d, 0x0a00ae27, 0x7d079eb1, + 0xf00f9344, 0x8708a3d2, 0x1e01f268, 0x6906c2fe, 0xf762575d, 0x806567cb, + 0x196c3671, 0x6e6b06e7, 0xfed41b76, 0x89d32be0, 0x10da7a5a, 0x67dd4acc, + 0xf9b9df6f, 0x8ebeeff9, 0x17b7be43, 0x60b08ed5, 0xd6d6a3e8, 0xa1d1937e, + 0x38d8c2c4, 0x4fdff252, 0xd1bb67f1, 0xa6bc5767, 0x3fb506dd, 0x48b2364b, + 0xd80d2bda, 0xaf0a1b4c, 0x36034af6, 0x41047a60, 0xdf60efc3, 0xa867df55, + 0x316e8eef, 0x4669be79, 0xcb61b38c, 0xbc66831a, 0x256fd2a0, 0x5268e236, + 0xcc0c7795, 0xbb0b4703, 0x220216b9, 0x5505262f, 0xc5ba3bbe, 0xb2bd0b28, + 0x2bb45a92, 0x5cb36a04, 0xc2d7ffa7, 0xb5d0cf31, 0x2cd99e8b, 0x5bdeae1d, + 0x9b64c2b0, 0xec63f226, 0x756aa39c, 0x026d930a, 0x9c0906a9, 0xeb0e363f, + 0x72076785, 0x05005713, 0x95bf4a82, 0xe2b87a14, 0x7bb12bae, 0x0cb61b38, + 0x92d28e9b, 0xe5d5be0d, 0x7cdcefb7, 0x0bdbdf21, 0x86d3d2d4, 0xf1d4e242, + 0x68ddb3f8, 0x1fda836e, 0x81be16cd, 0xf6b9265b, 0x6fb077e1, 0x18b74777, + 0x88085ae6, 0xff0f6a70, 0x66063bca, 0x11010b5c, 0x8f659eff, 0xf862ae69, + 0x616bffd3, 0x166ccf45, 0xa00ae278, 0xd70dd2ee, 0x4e048354, 0x3903b3c2, + 0xa7672661, 0xd06016f7, 0x4969474d, 0x3e6e77db, 0xaed16a4a, 0xd9d65adc, + 0x40df0b66, 0x37d83bf0, 0xa9bcae53, 0xdebb9ec5, 0x47b2cf7f, 0x30b5ffe9, + 0xbdbdf21c, 0xcabac28a, 0x53b39330, 0x24b4a3a6, 0xbad03605, 0xcdd70693, + 0x54de5729, 0x23d967bf, 0xb3667a2e, 0xc4614ab8, 0x5d681b02, 0x2a6f2b94, + 0xb40bbe37, 0xc30c8ea1, 0x5a05df1b, 0x2d02ef8d +}; + +uint32_t +crc32(const void *buf, size_t size) +{ + const uint8_t *p = buf; + uint32_t crc; + + crc = ~0U; + while (size--) + crc = crc32_tab[(crc ^ *p++) & 0xFF] ^ (crc >> 8); + return (crc ^ ~0U); +} Copied: stable/11/sys/boot/libsa/crc32.h (from r324554, head/sys/boot/libsa/crc32.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/sys/boot/libsa/crc32.h Sun Feb 11 20:00:26 2018 (r329134, copy of r324554, head/sys/boot/libsa/crc32.h) @@ -0,0 +1,13 @@ +/*- + * COPYRIGHT (C) 1986 Gary S. Brown. You may use this program, or + * code or tables extracted from it, as desired without restriction. + * + * $FreeBSD$ + */ + +#ifndef _CRC32_H_ +#define _CRC32_H_ + +uint32_t crc32(const void *buf, size_t size); + +#endif /* !_CRC32_H_ */ Copied: stable/11/sys/boot/libsa/gpt.c (from r324554, head/sys/boot/libsa/gpt.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/sys/boot/libsa/gpt.c Sun Feb 11 20:00:26 2018 (r329134, copy of r324554, head/sys/boot/libsa/gpt.c) @@ -0,0 +1,379 @@ +/*- + * Copyright (c) 2010 Pawel Jakub Dawidek + * 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 AUTHORS 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 AUTHORS 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 + +#ifndef LITTLE_ENDIAN +#error gpt.c works only for little endian architectures +#endif + +#include "crc32.h" +#include "drv.h" +#include "util.h" +#include "gpt.h" + +static struct gpt_hdr hdr_primary, hdr_backup, *gpthdr; +static uint64_t hdr_primary_lba, hdr_backup_lba; +static struct gpt_ent table_primary[MAXTBLENTS], table_backup[MAXTBLENTS]; +static struct gpt_ent *gpttable; +static int curent, bootonce; + +/* + * Buffer below 64kB passed on gptread(), which can hold at least + * one sector of data (512 bytes). + */ +static char *secbuf; + +static void +gptupdate(const char *which, struct dsk *dskp, struct gpt_hdr *hdr, + struct gpt_ent *table) +{ + int entries_per_sec, firstent; + daddr_t slba; + + /* + * We need to update the following for both primary and backup GPT: + * 1. Sector on disk that contains current partition. + * 2. Partition table checksum. + * 3. Header checksum. + * 4. Header on disk. + */ + + entries_per_sec = DEV_BSIZE / hdr->hdr_entsz; + slba = curent / entries_per_sec; + firstent = slba * entries_per_sec; + bcopy(&table[firstent], secbuf, DEV_BSIZE); + slba += hdr->hdr_lba_table; + if (drvwrite(dskp, secbuf, slba, 1)) { + printf("%s: unable to update %s GPT partition table\n", + BOOTPROG, which); + return; + } + hdr->hdr_crc_table = crc32(table, hdr->hdr_entries * hdr->hdr_entsz); + hdr->hdr_crc_self = 0; + hdr->hdr_crc_self = crc32(hdr, hdr->hdr_size); + bzero(secbuf, DEV_BSIZE); + bcopy(hdr, secbuf, hdr->hdr_size); + if (drvwrite(dskp, secbuf, hdr->hdr_lba_self, 1)) { + printf("%s: unable to update %s GPT header\n", BOOTPROG, which); + return; + } +} + +int +gptfind(const uuid_t *uuid, struct dsk *dskp, int part) +{ + struct gpt_ent *ent; + int firsttry; + + if (part >= 0) { + if (part == 0 || part > gpthdr->hdr_entries) { + printf("%s: invalid partition index\n", BOOTPROG); + return (-1); + } + ent = &gpttable[part - 1]; + if (bcmp(&ent->ent_type, uuid, sizeof(uuid_t)) != 0) { + printf("%s: specified partition is not UFS\n", + BOOTPROG); + return (-1); + } + curent = part - 1; + goto found; + } + + firsttry = (curent == -1); + curent++; + if (curent >= gpthdr->hdr_entries) { + curent = gpthdr->hdr_entries; + return (-1); + } + if (bootonce) { + /* + * First look for partition with both GPT_ENT_ATTR_BOOTME and + * GPT_ENT_ATTR_BOOTONCE flags. + */ + for (; curent < gpthdr->hdr_entries; curent++) { + ent = &gpttable[curent]; + if (bcmp(&ent->ent_type, uuid, sizeof(uuid_t)) != 0) + continue; + if (!(ent->ent_attr & GPT_ENT_ATTR_BOOTME)) + continue; + if (!(ent->ent_attr & GPT_ENT_ATTR_BOOTONCE)) + continue; + /* Ok, found one. */ + goto found; + } + bootonce = 0; + curent = 0; + } + for (; curent < gpthdr->hdr_entries; curent++) { + ent = &gpttable[curent]; + if (bcmp(&ent->ent_type, uuid, sizeof(uuid_t)) != 0) + continue; + if (!(ent->ent_attr & GPT_ENT_ATTR_BOOTME)) + continue; + if (ent->ent_attr & GPT_ENT_ATTR_BOOTONCE) + continue; + /* Ok, found one. */ + goto found; + } + if (firsttry) { + /* + * No partition with BOOTME flag was found, try to boot from + * first UFS partition. + */ + for (curent = 0; curent < gpthdr->hdr_entries; curent++) { + ent = &gpttable[curent]; + if (bcmp(&ent->ent_type, uuid, sizeof(uuid_t)) != 0) + continue; + /* Ok, found one. */ + goto found; + } + } + return (-1); +found: + dskp->part = curent + 1; + ent = &gpttable[curent]; + dskp->start = ent->ent_lba_start; + if (ent->ent_attr & GPT_ENT_ATTR_BOOTONCE) { + /* + * Clear BOOTME, but leave BOOTONCE set before trying to + * boot from this partition. + */ + if (hdr_primary_lba > 0) { + table_primary[curent].ent_attr &= ~GPT_ENT_ATTR_BOOTME; + gptupdate("primary", dskp, &hdr_primary, table_primary); + } + if (hdr_backup_lba > 0) { + table_backup[curent].ent_attr &= ~GPT_ENT_ATTR_BOOTME; + gptupdate("backup", dskp, &hdr_backup, table_backup); + } + } + return (0); +} + +static int +gptread_hdr(const char *which, struct dsk *dskp, struct gpt_hdr *hdr, + uint64_t hdrlba) +{ + uint32_t crc; + + if (drvread(dskp, secbuf, hdrlba, 1)) { + printf("%s: unable to read %s GPT header\n", BOOTPROG, which); + return (-1); + } + bcopy(secbuf, hdr, sizeof(*hdr)); + if (bcmp(hdr->hdr_sig, GPT_HDR_SIG, sizeof(hdr->hdr_sig)) != 0 || + hdr->hdr_lba_self != hdrlba || hdr->hdr_revision < 0x00010000 || + hdr->hdr_entsz < sizeof(struct gpt_ent) || + hdr->hdr_entries > MAXTBLENTS || DEV_BSIZE % hdr->hdr_entsz != 0) { + printf("%s: invalid %s GPT header\n", BOOTPROG, which); + return (-1); + } + crc = hdr->hdr_crc_self; + hdr->hdr_crc_self = 0; + if (crc32(hdr, hdr->hdr_size) != crc) { + printf("%s: %s GPT header checksum mismatch\n", BOOTPROG, + which); + return (-1); + } + hdr->hdr_crc_self = crc; + return (0); +} + +void +gptbootfailed(struct dsk *dskp) +{ + + if (!(gpttable[curent].ent_attr & GPT_ENT_ATTR_BOOTONCE)) + return; + + if (hdr_primary_lba > 0) { + table_primary[curent].ent_attr &= ~GPT_ENT_ATTR_BOOTONCE; + table_primary[curent].ent_attr |= GPT_ENT_ATTR_BOOTFAILED; + gptupdate("primary", dskp, &hdr_primary, table_primary); + } + if (hdr_backup_lba > 0) { + table_backup[curent].ent_attr &= ~GPT_ENT_ATTR_BOOTONCE; + table_backup[curent].ent_attr |= GPT_ENT_ATTR_BOOTFAILED; + gptupdate("backup", dskp, &hdr_backup, table_backup); + } +} + +static void +gptbootconv(const char *which, struct dsk *dskp, struct gpt_hdr *hdr, + struct gpt_ent *table) +{ + struct gpt_ent *ent; + daddr_t slba; + int table_updated, sector_updated; + int entries_per_sec, nent, part; + + table_updated = 0; + entries_per_sec = DEV_BSIZE / hdr->hdr_entsz; + for (nent = 0, slba = hdr->hdr_lba_table; + slba < hdr->hdr_lba_table + hdr->hdr_entries / entries_per_sec; + slba++, nent += entries_per_sec) { + sector_updated = 0; + for (part = 0; part < entries_per_sec; part++) { + ent = &table[nent + part]; + if ((ent->ent_attr & (GPT_ENT_ATTR_BOOTME | + GPT_ENT_ATTR_BOOTONCE | + GPT_ENT_ATTR_BOOTFAILED)) != + GPT_ENT_ATTR_BOOTONCE) { + continue; + } + ent->ent_attr &= ~GPT_ENT_ATTR_BOOTONCE; + ent->ent_attr |= GPT_ENT_ATTR_BOOTFAILED; + table_updated = 1; + sector_updated = 1; + } + if (!sector_updated) + continue; + bcopy(&table[nent], secbuf, DEV_BSIZE); + if (drvwrite(dskp, secbuf, slba, 1)) { + printf("%s: unable to update %s GPT partition table\n", + BOOTPROG, which); + } + } + if (!table_updated) + return; + hdr->hdr_crc_table = crc32(table, hdr->hdr_entries * hdr->hdr_entsz); + hdr->hdr_crc_self = 0; + hdr->hdr_crc_self = crc32(hdr, hdr->hdr_size); + bzero(secbuf, DEV_BSIZE); + bcopy(hdr, secbuf, hdr->hdr_size); + if (drvwrite(dskp, secbuf, hdr->hdr_lba_self, 1)) + printf("%s: unable to update %s GPT header\n", BOOTPROG, which); +} + +static int +gptread_table(const char *which, const uuid_t *uuid, struct dsk *dskp, + struct gpt_hdr *hdr, struct gpt_ent *table) +{ + struct gpt_ent *ent; + int entries_per_sec; + int part, nent; + daddr_t slba; + + if (hdr->hdr_entries == 0) + return (0); + + entries_per_sec = DEV_BSIZE / hdr->hdr_entsz; + slba = hdr->hdr_lba_table; + nent = 0; + for (;;) { + if (drvread(dskp, secbuf, slba, 1)) { + printf("%s: unable to read %s GPT partition table\n", + BOOTPROG, which); + return (-1); + } + ent = (struct gpt_ent *)secbuf; + for (part = 0; part < entries_per_sec; part++, ent++) { + bcopy(ent, &table[nent], sizeof(table[nent])); + if (++nent >= hdr->hdr_entries) + break; + } + if (nent >= hdr->hdr_entries) + break; + slba++; + } + if (crc32(table, nent * hdr->hdr_entsz) != hdr->hdr_crc_table) { + printf("%s: %s GPT table checksum mismatch\n", BOOTPROG, which); + return (-1); + } + return (0); +} + +int +gptread(const uuid_t *uuid, struct dsk *dskp, char *buf) +{ + uint64_t altlba; + + /* + * Read and verify both GPT headers: primary and backup. + */ + + secbuf = buf; + hdr_primary_lba = hdr_backup_lba = 0; + curent = -1; + bootonce = 1; + dskp->start = 0; + + if (gptread_hdr("primary", dskp, &hdr_primary, 1) == 0 && + gptread_table("primary", uuid, dskp, &hdr_primary, + table_primary) == 0) { + hdr_primary_lba = hdr_primary.hdr_lba_self; + gpthdr = &hdr_primary; + gpttable = table_primary; + } + + if (hdr_primary_lba > 0) { + /* + * If primary header is valid, we can get backup + * header location from there. + */ + altlba = hdr_primary.hdr_lba_alt; + } else { + altlba = drvsize(dskp); + if (altlba > 0) + altlba--; + } + if (altlba == 0) + printf("%s: unable to locate backup GPT header\n", BOOTPROG); + else if (gptread_hdr("backup", dskp, &hdr_backup, altlba) == 0 && + gptread_table("backup", uuid, dskp, &hdr_backup, + table_backup) == 0) { + hdr_backup_lba = hdr_backup.hdr_lba_self; + if (hdr_primary_lba == 0) { + gpthdr = &hdr_backup; + gpttable = table_backup; + printf("%s: using backup GPT\n", BOOTPROG); + } + } + + /* + * Convert all BOOTONCE without BOOTME flags into BOOTFAILED. + * BOOTONCE without BOOTME means that we tried to boot from it, + * but failed after leaving gptboot and machine was rebooted. + * We don't want to leave partitions marked as BOOTONCE only, + * because when we boot successfully start-up scripts should + * find at most one partition with only BOOTONCE flag and this + * will mean that we booted from that partition. + */ + if (hdr_primary_lba != 0) + gptbootconv("primary", dskp, &hdr_primary, table_primary); + if (hdr_backup_lba != 0) + gptbootconv("backup", dskp, &hdr_backup, table_backup); + + if (hdr_primary_lba == 0 && hdr_backup_lba == 0) + return (-1); + return (0); +} Copied: stable/11/sys/boot/libsa/gpt.h (from r324554, head/sys/boot/libsa/gpt.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/sys/boot/libsa/gpt.h Sun Feb 11 20:00:26 2018 (r329134, copy of r324554, head/sys/boot/libsa/gpt.h) @@ -0,0 +1,41 @@ +/*- + * Copyright (c) 2010 Pawel Jakub Dawidek + * 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 AUTHORS 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 AUTHORS 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 _GPT_H_ +#define _GPT_H_ + +#include +#include + +#define MAXTBLENTS 128 + +int gptread(const uuid_t *uuid, struct dsk *dskp, char *buf); +int gptfind(const uuid_t *uuid, struct dsk *dskp, int part); +void gptbootfailed(struct dsk *dskp); + +#endif /* !_GPT_H_ */ Copied: stable/11/sys/boot/libsa/ufsread.c (from r329133, stable/11/sys/boot/common/ufsread.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/sys/boot/libsa/ufsread.c Sun Feb 11 20:00:26 2018 (r329134, copy of r329133, stable/11/sys/boot/common/ufsread.c) @@ -0,0 +1,326 @@ +/*- + * Copyright (c) 2002 McAfee, Inc. + * All rights reserved. + * + * This software was developed for the FreeBSD Project by Marshall + * Kirk McKusick and McAfee Research,, the Security Research Division of + * McAfee, Inc. under DARPA/SPAWAR contract N66001-01-C-8035 ("CBOSS"), as + * part of the DARPA CHATS research program + * + * 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. + */ +/*- + * Copyright (c) 1998 Robert Nordier + * All rights reserved. + * + * Redistribution and use in source and binary forms are freely + * permitted provided that the above copyright notice and this + * paragraph and the following disclaimer are duplicated in all + * such forms. + * + * This software is provided "AS IS" and without any express or + * implied warranties, including, without limitation, the implied + * warranties of merchantability and fitness for a particular + * purpose. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include + +#ifdef UFS_SMALL_CGBASE +/* XXX: Revert to old (broken for over 1.5Tb filesystems) version of cgbase + (see sys/ufs/ffs/fs.h rev 1.39) so that small boot loaders (e.g. boot2) can + support both UFS1 and UFS2. */ +#undef cgbase +#define cgbase(fs, c) ((ufs2_daddr_t)((fs)->fs_fpg * (c))) +#endif + +typedef uint32_t ufs_ino_t; + +/* + * We use 4k `virtual' blocks for filesystem data, whatever the actual + * filesystem block size. FFS blocks are always a multiple of 4k. + */ +#define VBLKSHIFT 12 +#define VBLKSIZE (1 << VBLKSHIFT) +#define VBLKMASK (VBLKSIZE - 1) +#define DBPERVBLK (VBLKSIZE / DEV_BSIZE) +#define INDIRPERVBLK(fs) (NINDIR(fs) / ((fs)->fs_bsize >> VBLKSHIFT)) +#define IPERVBLK(fs) (INOPB(fs) / ((fs)->fs_bsize >> VBLKSHIFT)) +#define INO_TO_VBA(fs, ipervblk, x) \ + (fsbtodb(fs, cgimin(fs, ino_to_cg(fs, x))) + \ + (((x) % (fs)->fs_ipg) / (ipervblk) * DBPERVBLK)) +#define INO_TO_VBO(ipervblk, x) ((x) % ipervblk) +#define FS_TO_VBA(fs, fsb, off) (fsbtodb(fs, fsb) + \ + ((off) / VBLKSIZE) * DBPERVBLK) +#define FS_TO_VBO(fs, fsb, off) ((off) & VBLKMASK) + +/* Buffers that must not span a 64k boundary. */ +struct dmadat { + char blkbuf[VBLKSIZE]; /* filesystem blocks */ + char indbuf[VBLKSIZE]; /* indir blocks */ + char sbbuf[SBLOCKSIZE]; /* superblock */ + char secbuf[DEV_BSIZE]; /* for MBR/disklabel */ +}; +static struct dmadat *dmadat; + +static ufs_ino_t lookup(const char *); +static ssize_t fsread(ufs_ino_t, void *, size_t); + +static uint8_t ls, dsk_meta; +static uint32_t fs_off; + +static __inline uint8_t +fsfind(const char *name, ufs_ino_t * ino) +{ + static char buf[DEV_BSIZE]; + static struct direct d; + char *s; + ssize_t n; + + fs_off = 0; + while ((n = fsread(*ino, buf, DEV_BSIZE)) > 0) + for (s = buf; s < buf + DEV_BSIZE;) { + memcpy(&d, s, sizeof(struct direct)); + if (ls) + printf("%s ", d.d_name); + else if (!strcmp(name, d.d_name)) { + *ino = d.d_ino; + return d.d_type; + } + s += d.d_reclen; + } + if (n != -1 && ls) + printf("\n"); + return 0; +} + +static ufs_ino_t +lookup(const char *path) +{ + static char name[MAXNAMLEN + 1]; + const char *s; + ufs_ino_t ino; + ssize_t n; + uint8_t dt; + + ino = ROOTINO; + dt = DT_DIR; + for (;;) { + if (*path == '/') + path++; + if (!*path) + break; + for (s = path; *s && *s != '/'; s++); + if ((n = s - path) > MAXNAMLEN) + return 0; + ls = *path == '?' && n == 1 && !*s; + memcpy(name, path, n); + name[n] = 0; + if (dt != DT_DIR) { + printf("%s: not a directory.\n", name); + return (0); + } + if ((dt = fsfind(name, &ino)) <= 0) + break; + path = s; + } + return dt == DT_REG ? ino : 0; +} + +/* + * Possible superblock locations ordered from most to least likely. + */ +static int sblock_try[] = SBLOCKSEARCH; + +#if defined(UFS2_ONLY) +#define DIP(field) dp2.field +#elif defined(UFS1_ONLY) +#define DIP(field) dp1.field +#else +#define DIP(field) fs.fs_magic == FS_UFS1_MAGIC ? dp1.field : dp2.field +#endif + +static ssize_t +fsread_size(ufs_ino_t inode, void *buf, size_t nbyte, size_t *fsizep) +{ +#ifndef UFS2_ONLY + static struct ufs1_dinode dp1; + ufs1_daddr_t addr1; +#endif +#ifndef UFS1_ONLY + static struct ufs2_dinode dp2; +#endif + static struct fs fs; + static ufs_ino_t inomap; + char *blkbuf; + void *indbuf; + char *s; + size_t n, nb, size, off, vboff; + ufs_lbn_t lbn; + ufs2_daddr_t addr2, vbaddr; + static ufs2_daddr_t blkmap, indmap; + u_int u; + + /* Basic parameter validation. */ + if ((buf == NULL && nbyte != 0) || dmadat == NULL) + return (-1); + + blkbuf = dmadat->blkbuf; + indbuf = dmadat->indbuf; + + /* + * Force probe if inode is zero to ensure we have a valid fs, otherwise + * when probing multiple paritions, reads from subsequent parititions + * will incorrectly succeed. + */ + if (!dsk_meta || inode == 0) { + inomap = 0; + dsk_meta = 0; + for (n = 0; sblock_try[n] != -1; n++) { + if (dskread(dmadat->sbbuf, sblock_try[n] / DEV_BSIZE, + SBLOCKSIZE / DEV_BSIZE)) + return -1; + memcpy(&fs, dmadat->sbbuf, sizeof(struct fs)); + if (( +#if defined(UFS1_ONLY) + fs.fs_magic == FS_UFS1_MAGIC +#elif defined(UFS2_ONLY) + (fs.fs_magic == FS_UFS2_MAGIC && + fs.fs_sblockloc == sblock_try[n]) +#else + fs.fs_magic == FS_UFS1_MAGIC || + (fs.fs_magic == FS_UFS2_MAGIC && + fs.fs_sblockloc == sblock_try[n]) +#endif + ) && + fs.fs_bsize <= MAXBSIZE && + fs.fs_bsize >= (int32_t)sizeof(struct fs)) + break; + } + if (sblock_try[n] == -1) { + return -1; + } + dsk_meta++; + } else + memcpy(&fs, dmadat->sbbuf, sizeof(struct fs)); + if (!inode) + return 0; + if (inomap != inode) { + n = IPERVBLK(&fs); + if (dskread(blkbuf, INO_TO_VBA(&fs, n, inode), DBPERVBLK)) + return -1; + n = INO_TO_VBO(n, inode); +#if defined(UFS1_ONLY) + memcpy(&dp1, (struct ufs1_dinode *)(void *)blkbuf + n, + sizeof(dp1)); +#elif defined(UFS2_ONLY) + memcpy(&dp2, (struct ufs2_dinode *)(void *)blkbuf + n, + sizeof(dp2)); +#else + if (fs.fs_magic == FS_UFS1_MAGIC) + memcpy(&dp1, (struct ufs1_dinode *)(void *)blkbuf + n, + sizeof(dp1)); + else + memcpy(&dp2, (struct ufs2_dinode *)(void *)blkbuf + n, + sizeof(dp2)); +#endif + inomap = inode; + fs_off = 0; + blkmap = indmap = 0; + } + s = buf; + size = DIP(di_size); + n = size - fs_off; + if (nbyte > n) + nbyte = n; + nb = nbyte; + while (nb) { + lbn = lblkno(&fs, fs_off); + off = blkoff(&fs, fs_off); + if (lbn < NDADDR) { + addr2 = DIP(di_db[lbn]); + } else if (lbn < NDADDR + NINDIR(&fs)) { *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Sun Feb 11 20:04:36 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C1E23F13561; Sun, 11 Feb 2018 20:04:35 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6DF99685F2; Sun, 11 Feb 2018 20:04:35 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 67C19278DD; Sun, 11 Feb 2018 20:04:35 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1BK4ZtM021165; Sun, 11 Feb 2018 20:04:35 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1BK4ZZf021160; Sun, 11 Feb 2018 20:04:35 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201802112004.w1BK4ZZf021160@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sun, 11 Feb 2018 20:04:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r329135 - in stable/11/sys/boot: . arm/uboot common efi/boot1 efi/include efi/libefi efi/loader efi/loader/arch/i386 libsa man mips/uboot powerpc/ofw powerpc/uboot X-SVN-Group: stable-11 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in stable/11/sys/boot: . arm/uboot common efi/boot1 efi/include efi/libefi efi/loader efi/loader/arch/i386 libsa man mips/uboot powerpc/ofw powerpc/uboot X-SVN-Commit-Revision: 329135 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Feb 2018 20:04:36 -0000 Author: kevans Date: Sun Feb 11 20:04:34 2018 New Revision: 329135 URL: https://svnweb.freebsd.org/changeset/base/329135 Log: MFC Loader Fixes 2017q4p5: r324557,r324558,r324559,r324646,r324647 r324557: Rename exit to efi_exit to avoid clashing with libsa exit definition r324558: Define prototype for exit and ensure references r324559: Move panic back into libsa. It's documented in libstand(3) to belong there. r324646: Unify boot1 with loader. r324647: Move orphaned man pages into new man directory from common. Added: stable/11/sys/boot/efi/libefi/efi_main.c - copied unchanged from r324646, head/sys/boot/efi/libefi/efi_main.c stable/11/sys/boot/libsa/panic.c - copied unchanged from r324559, head/sys/boot/libsa/panic.c stable/11/sys/boot/man/ - copied from r324647, head/sys/boot/man/ Deleted: stable/11/sys/boot/common/Makefile stable/11/sys/boot/common/loader.8 stable/11/sys/boot/common/panic.c stable/11/sys/boot/common/zfsloader.8 stable/11/sys/boot/efi/boot1/boot_module.h stable/11/sys/boot/efi/boot1/ufs_module.c stable/11/sys/boot/efi/boot1/zfs_module.c stable/11/sys/boot/efi/loader/efi_main.c Modified: stable/11/sys/boot/Makefile stable/11/sys/boot/arm/uboot/conf.c stable/11/sys/boot/common/Makefile.inc stable/11/sys/boot/efi/boot1/Makefile stable/11/sys/boot/efi/boot1/boot1.c stable/11/sys/boot/efi/include/efilib.h stable/11/sys/boot/efi/libefi/Makefile stable/11/sys/boot/efi/loader/Makefile stable/11/sys/boot/efi/loader/arch/i386/exec.c stable/11/sys/boot/libsa/Makefile stable/11/sys/boot/libsa/stand.h stable/11/sys/boot/mips/uboot/conf.c stable/11/sys/boot/powerpc/ofw/conf.c stable/11/sys/boot/powerpc/uboot/conf.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/boot/Makefile ============================================================================== --- stable/11/sys/boot/Makefile Sun Feb 11 20:00:26 2018 (r329134) +++ stable/11/sys/boot/Makefile Sun Feb 11 20:04:34 2018 (r329135) @@ -9,7 +9,7 @@ SUBDIR+= ficl SUBDIR+= forth .endif -SUBDIR+= common +SUBDIR+= man .include Modified: stable/11/sys/boot/arm/uboot/conf.c ============================================================================== --- stable/11/sys/boot/arm/uboot/conf.c Sun Feb 11 20:00:26 2018 (r329134) +++ stable/11/sys/boot/arm/uboot/conf.c Sun Feb 11 20:04:34 2018 (r329135) @@ -36,6 +36,9 @@ __FBSDID("$FreeBSD$"); #include "dev_net.h" #endif +/* Make sure we have an explicit reference to exit so libsa's panic pulls in the MD exit */ +void (*exitfn)(int) = exit; + struct devsw *devsw[] = { #if defined(LOADER_DISK_SUPPORT) || defined(LOADER_CD9660_SUPPORT) &uboot_storage, Modified: stable/11/sys/boot/common/Makefile.inc ============================================================================== --- stable/11/sys/boot/common/Makefile.inc Sun Feb 11 20:00:26 2018 (r329134) +++ stable/11/sys/boot/common/Makefile.inc Sun Feb 11 20:04:34 2018 (r329135) @@ -4,7 +4,7 @@ SRCS+= boot.c commands.c console.c devopen.c interp.c SRCS+= interp_backslash.c interp_parse.c ls.c misc.c -SRCS+= module.c panic.c +SRCS+= module.c .if ${MACHINE} == "i386" || ${MACHINE_CPUARCH} == "amd64" SRCS+= load_elf32.c load_elf32_obj.c reloc_elf32.c Modified: stable/11/sys/boot/efi/boot1/Makefile ============================================================================== --- stable/11/sys/boot/efi/boot1/Makefile Sun Feb 11 20:00:26 2018 (r329134) +++ stable/11/sys/boot/efi/boot1/Makefile Sun Feb 11 20:04:34 2018 (r329135) @@ -8,8 +8,11 @@ MK_SSP= no PROG= boot1.sym INTERNALPROG= -WARNS?= 6 +WARNS?= 3 +# Include bcache code. +HAVE_BCACHE= yes + # We implement a slightly non-standard %S in that it always takes a # CHAR16 that's common in UEFI-land instead of a wchar_t. This only # seems to matter on arm64 where wchar_t defaults to an int instead @@ -18,13 +21,15 @@ WARNS?= 6 CWARNFLAGS.boot1.c+= -Wno-format # Disable warnings that are currently incompatible with the zfs boot code -CWARNFLAGS.zfs_module.c += -Wno-array-bounds -CWARNFLAGS.zfs_module.c += -Wno-cast-align -CWARNFLAGS.zfs_module.c += -Wno-cast-qual -CWARNFLAGS.zfs_module.c += -Wno-missing-prototypes -CWARNFLAGS.zfs_module.c += -Wno-sign-compare -CWARNFLAGS.zfs_module.c += -Wno-unused-parameter -CWARNFLAGS.zfs_module.c += -Wno-unused-function +CWARNFLAGS.zfs.c += -Wno-incompatible-pointer-types-discards-qualifiers +CWARNFLAGS.zfs.c += -Wno-missing-variable-declarations +CWARNFLAGS.zfs.c += -Wno-array-bounds +CWARNFLAGS.zfs.c += -Wno-cast-align +CWARNFLAGS.zfs.c += -Wno-cast-qual +CWARNFLAGS.zfs.c += -Wno-missing-prototypes +CWARNFLAGS.zfs.c += -Wno-sign-compare +CWARNFLAGS.zfs.c += -Wno-unused-parameter +CWARNFLAGS.zfs.c += -Wno-unused-function CWARNFLAGS.skein.c += -Wno-cast-align .if ${COMPILER_TYPE} == "clang" CWARNFLAGS.skein.c += -Wno-missing-variable-declarations @@ -33,19 +38,27 @@ CWARNFLAGS.skein.c += -Wno-missing-declarations .endif # architecture-specific loader code -SRCS= boot1.c self_reloc.c start.S ufs_module.c +SRCS= boot1.c self_reloc.c start.S .if ${MK_ZFS} != "no" -SRCS+= zfs_module.c +.PATH: ${.CURDIR}/../../../crypto/skein SRCS+= skein.c skein_block.c # Do not unroll skein loops, reduce code size CFLAGS+= -DSKEIN_LOOP=111 -.PATH: ${.CURDIR}/../../../crypto/skein +.PATH: ${.CURDIR}/../../zfs +SRCS+= zfs.c .endif .if ${COMPILER_TYPE} == "gcc" && ${COMPILER_VERSION} > 40201 CWARNFLAGS.self_reloc.c+= -Wno-error=maybe-uninitialized .endif +# Always add MI sources +.PATH: ${.CURDIR}/../../common +.include "${.CURDIR}/../../common/Makefile.inc" +CFLAGS+= -I${.CURDIR}/../../common + +.PATH: ${.CURDIR}/arch/${MACHINE} + CFLAGS+= -I. CFLAGS+= -I${.CURDIR}/../include CFLAGS+= -I${.CURDIR}/../include/${MACHINE} @@ -117,7 +130,7 @@ boot1.efi: ${PROG} SOURCE_DATE_EPOCH=${SOURCE_DATE_EPOCH} \ ${OBJCOPY} -j .peheader -j .text -j .sdata -j .data \ -j .dynamic -j .dynsym -j .rel.dyn \ - -j .rela.dyn -j .reloc -j .eh_frame \ + -j .rela.dyn -j .reloc -j .eh_frame -j set_Xcommand_set \ --output-target=${EFI_TARGET} ${.ALLSRC} ${.TARGET} boot1.o: ${SASRC}/ufsread.c Modified: stable/11/sys/boot/efi/boot1/boot1.c ============================================================================== --- stable/11/sys/boot/efi/boot1/boot1.c Sun Feb 11 20:00:26 2018 (r329134) +++ stable/11/sys/boot/efi/boot1/boot1.c Sun Feb 11 20:04:34 2018 (r329135) @@ -23,61 +23,179 @@ __FBSDID("$FreeBSD$"); #include +#include #include #include #include +#include #include +#include +#include #include +#ifdef EFI_ZFS_BOOT +#include +#endif typedef CHAR16 efi_char; #include -#include "boot_module.h" +#include + +#include "efi_drivers.h" +#include "efizfs.h" #include "paths.h" static void efi_panic(EFI_STATUS s, const char *fmt, ...) __dead2 __printflike(2, 3); +#ifdef EFI_DEBUG +#define DPRINTF(fmt, args...) printf(fmt, ##args) +#define DSTALL(d) BS->Stall(d) +#else +#define DPRINTF(fmt, ...) {} +#define DSTALL(d) {} +#endif -static const boot_module_t *boot_modules[] = -{ +struct arch_switch archsw; /* MI/MD interface boundary */ + +static const efi_driver_t *efi_drivers[] = { + NULL +}; + +extern struct console efi_console; +#if defined(__amd64__) || defined(__i386__) +extern struct console comconsole; +extern struct console nullconsole; +#endif + #ifdef EFI_ZFS_BOOT - &zfs_module, +uint64_t pool_guid; #endif + +struct fs_ops *file_system[] = { +#ifdef EFI_ZFS_BOOT + &zfs_fsops, +#endif + &dosfs_fsops, #ifdef EFI_UFS_BOOT - &ufs_module + &ufs_fsops, #endif + &cd9660_fsops, + &nfs_fsops, + &gzipfs_fsops, + &bzipfs_fsops, + NULL }; -#define NUM_BOOT_MODULES nitems(boot_modules) +struct devsw *devsw[] = { + &efipart_hddev, + &efipart_fddev, + &efipart_cddev, +#ifdef EFI_ZFS_BOOT + &zfs_dev, +#endif + NULL +}; + +struct console *consoles[] = { + &efi_console, + NULL +}; + +static EFI_LOADED_IMAGE *boot_image; +static EFI_DEVICE_PATH *imgpath; +static EFI_DEVICE_PATH *imgprefix; + +/* Definitions we don't actually need for boot, but we need to define + * to make the linker happy. + */ +struct file_format *file_formats[] = { NULL }; + +struct netif_driver *netif_drivers[] = { NULL }; + +static int +efi_autoload(void) +{ + printf("******** Boot block should not call autoload\n"); + return (-1); +} + +static ssize_t +efi_copyin(const void *src __unused, vm_offset_t dest __unused, + const size_t len __unused) +{ + printf("******** Boot block should not call copyin\n"); + return (-1); +} + +static ssize_t +efi_copyout(vm_offset_t src __unused, void *dest __unused, + const size_t len __unused) +{ + printf("******** Boot block should not call copyout\n"); + return (-1); +} + +static ssize_t +efi_readin(int fd __unused, vm_offset_t dest __unused, + const size_t len __unused) +{ + printf("******** Boot block should not call readin\n"); + return (-1); +} + /* The initial number of handles used to query EFI for partitions. */ #define NUM_HANDLES_INIT 24 -static EFI_GUID BlockIoProtocolGUID = BLOCK_IO_PROTOCOL; static EFI_GUID DevicePathGUID = DEVICE_PATH_PROTOCOL; static EFI_GUID LoadedImageGUID = LOADED_IMAGE_PROTOCOL; -static EFI_GUID ConsoleControlGUID = EFI_CONSOLE_CONTROL_PROTOCOL_GUID; static EFI_GUID FreeBSDBootVarGUID = FREEBSD_BOOT_VAR_GUID; -/* - * Provide Malloc / Free backed by EFIs AllocatePool / FreePool which ensures - * memory is correctly aligned avoiding EFI_INVALID_PARAMETER returns from - * EFI methods. - */ -void * -Malloc(size_t len, const char *file __unused, int line __unused) +static EFI_STATUS +do_load(const char *filepath, void **bufp, size_t *bufsize) { - void *out; + struct stat st; + void *buf = NULL; + int fd, err; + size_t fsize, remaining; + ssize_t readsize; - if (BS->AllocatePool(EfiLoaderData, len, &out) == EFI_SUCCESS) - return (out); + if ((fd = open(filepath, O_RDONLY)) < 0) { + return (ENOTSUP); + } - return (NULL); -} + if ((err = fstat(fd, &st)) != 0) { + goto close_file; + } -void -Free(void *buf, const char *file __unused, int line __unused) -{ - if (buf != NULL) - (void)BS->FreePool(buf); + fsize = st.st_size; + + if ((buf = malloc(fsize)) == NULL) { + err = ENOMEM; + goto close_file; + } + + remaining = fsize; + + do { + if ((readsize = read(fd, buf, fsize)) < 0) { + err = (-readsize); + goto free_buf; + } + + remaining -= readsize; + } while(remaining != 0); + + close(fd); + *bufsize = st.st_size; + *bufp = buf; + + close_file: + close(fd); + + return errno_to_efi_status(err); + + free_buf: + free(buf); + goto close_file; } static EFI_STATUS @@ -97,98 +215,275 @@ efi_setenv_freebsd_wcs(const char *varname, CHAR16 *va return (rv); } -/* - * nodes_match returns TRUE if the imgpath isn't NULL and the nodes match, - * FALSE otherwise. - */ -static BOOLEAN -nodes_match(EFI_DEVICE_PATH *imgpath, EFI_DEVICE_PATH *devpath) +static int +probe_fs(const char *filepath) { - size_t len; + int fd; - if (imgpath == NULL || imgpath->Type != devpath->Type || - imgpath->SubType != devpath->SubType) - return (FALSE); + if ((fd = open(filepath, O_RDONLY)) < 0) { + return (ENOTSUP); + } - len = DevicePathNodeLength(imgpath); - if (len != DevicePathNodeLength(devpath)) - return (FALSE); + close(fd); - return (memcmp(imgpath, devpath, (size_t)len) == 0); + return (0); } -/* - * device_paths_match returns TRUE if the imgpath isn't NULL and all nodes - * in imgpath and devpath match up to their respective occurrences of a - * media node, FALSE otherwise. - */ -static BOOLEAN -device_paths_match(EFI_DEVICE_PATH *imgpath, EFI_DEVICE_PATH *devpath) +static int +probe_dev(struct devsw *dev, int unit, const char *filepath) { + struct devdesc currdev; + char *devname; + int err; - if (imgpath == NULL) - return (FALSE); + currdev.d_dev = dev; + currdev.d_type = currdev.d_dev->dv_type; + currdev.d_unit = unit; + currdev.d_opendata = NULL; + devname = efi_fmtdev(&currdev); - while (!IsDevicePathEnd(imgpath) && !IsDevicePathEnd(devpath)) { - if (IsDevicePathType(imgpath, MEDIA_DEVICE_PATH) && - IsDevicePathType(devpath, MEDIA_DEVICE_PATH)) - return (TRUE); + env_setenv("currdev", EV_VOLATILE, devname, efi_setcurrdev, + env_nounset); - if (!nodes_match(imgpath, devpath)) - return (FALSE); + err = probe_fs(filepath); - imgpath = NextDevicePathNode(imgpath); - devpath = NextDevicePathNode(devpath); - } + return (err); +} - return (FALSE); +static bool +check_preferred(EFI_HANDLE *h) +{ + EFI_DEVICE_PATH *path = efi_lookup_devpath(h); + bool out; + + if ((path = efi_lookup_devpath(h)) == NULL) + return (false); + + out = efi_devpath_is_prefix(imgpath, path) || + efi_devpath_is_prefix(imgprefix, path); + + return (out); } -/* - * devpath_last returns the last non-path end node in devpath. - */ -static EFI_DEVICE_PATH * -devpath_last(EFI_DEVICE_PATH *devpath) +bool +efi_zfs_is_preferred(EFI_HANDLE *h) { + return (check_preferred(h)); +} - while (!IsDevicePathEnd(NextDevicePathNode(devpath))) - devpath = NextDevicePathNode(devpath); +static int +load_preferred(EFI_LOADED_IMAGE *img, const char *filepath, void **bufp, + size_t *bufsize, EFI_HANDLE *handlep) +{ + pdinfo_list_t *pdi_list; + pdinfo_t *dp, *pp; + char *devname; - return (devpath); +#ifdef EFI_ZFS_BOOT + /* Did efi_zfs_probe() detect the boot pool? */ + if (pool_guid != 0) { + struct zfs_devdesc currdev; + + currdev.d_dev = &zfs_dev; + currdev.d_unit = 0; + currdev.d_type = currdev.d_dev->dv_type; + currdev.d_opendata = NULL; + currdev.pool_guid = pool_guid; + currdev.root_guid = 0; + devname = efi_fmtdev(&currdev); + + env_setenv("currdev", EV_VOLATILE, devname, efi_setcurrdev, + env_nounset); + + if (probe_fs(filepath) == 0 && + do_load(filepath, bufp, bufsize) == EFI_SUCCESS) { + *handlep = efizfs_get_handle_by_guid(pool_guid); + return (0); + } + } +#endif /* EFI_ZFS_BOOT */ + + /* We have device lists for hd, cd, fd, walk them all. */ + pdi_list = efiblk_get_pdinfo_list(&efipart_hddev); + STAILQ_FOREACH(dp, pdi_list, pd_link) { + struct disk_devdesc currdev; + + currdev.d_dev = &efipart_hddev; + currdev.d_type = currdev.d_dev->dv_type; + currdev.d_unit = dp->pd_unit; + currdev.d_opendata = NULL; + currdev.d_slice = -1; + currdev.d_partition = -1; + devname = efi_fmtdev(&currdev); + + env_setenv("currdev", EV_VOLATILE, devname, efi_setcurrdev, + env_nounset); + + if (check_preferred(dp->pd_handle) && + probe_fs(filepath) == 0 && + do_load(filepath, bufp, bufsize) == EFI_SUCCESS) { + *handlep = dp->pd_handle; + return (0); + } + + /* Assuming GPT partitioning. */ + STAILQ_FOREACH(pp, &dp->pd_part, pd_link) { + if (check_preferred(pp->pd_handle)) { + currdev.d_slice = pp->pd_unit; + currdev.d_partition = 255; + devname = efi_fmtdev(&currdev); + + env_setenv("currdev", EV_VOLATILE, devname, + efi_setcurrdev, env_nounset); + + if (probe_fs(filepath) == 0 && + do_load(filepath, bufp, bufsize) == + EFI_SUCCESS) { + *handlep = pp->pd_handle; + return (0); + } + } + } + } + + pdi_list = efiblk_get_pdinfo_list(&efipart_cddev); + STAILQ_FOREACH(dp, pdi_list, pd_link) { + if ((dp->pd_handle == img->DeviceHandle || + dp->pd_alias == img->DeviceHandle || + check_preferred(dp->pd_handle)) && + probe_dev(&efipart_cddev, dp->pd_unit, filepath) == 0 && + do_load(filepath, bufp, bufsize) == EFI_SUCCESS) { + *handlep = dp->pd_handle; + return (0); + } + } + + pdi_list = efiblk_get_pdinfo_list(&efipart_fddev); + STAILQ_FOREACH(dp, pdi_list, pd_link) { + if ((dp->pd_handle == img->DeviceHandle || + check_preferred(dp->pd_handle)) && + probe_dev(&efipart_cddev, dp->pd_unit, filepath) == 0 && + do_load(filepath, bufp, bufsize) == EFI_SUCCESS) { + *handlep = dp->pd_handle; + return (0); + } + } + + return (ENOENT); } -/* - * load_loader attempts to load the loader image data. - * - * It tries each module and its respective devices, identified by mod->probe, - * in order until a successful load occurs at which point it returns EFI_SUCCESS - * and EFI_NOT_FOUND otherwise. - * - * Only devices which have preferred matching the preferred parameter are tried. - */ -static EFI_STATUS -load_loader(const boot_module_t **modp, dev_info_t **devinfop, void **bufp, - size_t *bufsize, BOOLEAN preferred) +static int +load_all(const char *filepath, void **bufp, size_t *bufsize, + EFI_HANDLE *handlep) { - UINTN i; - dev_info_t *dev; - const boot_module_t *mod; + pdinfo_list_t *pdi_list; + pdinfo_t *dp, *pp; + zfsinfo_list_t *zfsi_list; + zfsinfo_t *zi; + char *devname; - for (i = 0; i < NUM_BOOT_MODULES; i++) { - mod = boot_modules[i]; - for (dev = mod->devices(); dev != NULL; dev = dev->next) { - if (dev->preferred != preferred) - continue; +#ifdef EFI_ZFS_BOOT + zfsi_list = efizfs_get_zfsinfo_list(); + STAILQ_FOREACH(zi, zfsi_list, zi_link) { + struct zfs_devdesc currdev; - if (mod->load(PATH_LOADER_EFI, dev, bufp, bufsize) == - EFI_SUCCESS) { - *devinfop = dev; - *modp = mod; - return (EFI_SUCCESS); + currdev.d_dev = &zfs_dev; + currdev.d_unit = 0; + currdev.d_type = currdev.d_dev->dv_type; + currdev.d_opendata = NULL; + currdev.pool_guid = zi->zi_pool_guid; + currdev.root_guid = 0; + devname = efi_fmtdev(&currdev); + + env_setenv("currdev", EV_VOLATILE, devname, efi_setcurrdev, + env_nounset); + + if (probe_fs(filepath) == 0 && + do_load(filepath, bufp, bufsize) == EFI_SUCCESS) { + *handlep = zi->zi_handle; + + return (0); + } + } +#endif /* EFI_ZFS_BOOT */ + + /* We have device lists for hd, cd, fd, walk them all. */ + pdi_list = efiblk_get_pdinfo_list(&efipart_hddev); + STAILQ_FOREACH(dp, pdi_list, pd_link) { + struct disk_devdesc currdev; + + currdev.d_dev = &efipart_hddev; + currdev.d_type = currdev.d_dev->dv_type; + currdev.d_unit = dp->pd_unit; + currdev.d_opendata = NULL; + currdev.d_slice = -1; + currdev.d_partition = -1; + devname = efi_fmtdev(&currdev); + + env_setenv("currdev", EV_VOLATILE, devname, efi_setcurrdev, + env_nounset); + + if (probe_fs(filepath) == 0 && + do_load(filepath, bufp, bufsize) == EFI_SUCCESS) { + *handlep = dp->pd_handle; + + return (0); + } + + /* Assuming GPT partitioning. */ + STAILQ_FOREACH(pp, &dp->pd_part, pd_link) { + currdev.d_slice = pp->pd_unit; + currdev.d_partition = 255; + devname = efi_fmtdev(&currdev); + + env_setenv("currdev", EV_VOLATILE, devname, + efi_setcurrdev, env_nounset); + + if (probe_fs(filepath) == 0 && + do_load(filepath, bufp, bufsize) == EFI_SUCCESS) { + *handlep = pp->pd_handle; + + return (0); } } } + pdi_list = efiblk_get_pdinfo_list(&efipart_cddev); + STAILQ_FOREACH(dp, pdi_list, pd_link) { + if (probe_dev(&efipart_cddev, dp->pd_unit, filepath) == 0 && + do_load(filepath, bufp, bufsize) == EFI_SUCCESS) { + *handlep = dp->pd_handle; + + return (0); + } + } + + pdi_list = efiblk_get_pdinfo_list(&efipart_fddev); + STAILQ_FOREACH(dp, pdi_list, pd_link) { + if (probe_dev(&efipart_fddev, dp->pd_unit, filepath) == 0 && + do_load(filepath, bufp, bufsize) == EFI_SUCCESS) { + *handlep = dp->pd_handle; + + return (0); + } + } + + return (ENOENT); +} + +static EFI_STATUS +load_loader(EFI_HANDLE *handlep, void **bufp, size_t *bufsize) +{ + /* Try the preferred handles first, then all the handles */ + if (load_preferred(boot_image, PATH_LOADER_EFI, bufp, bufsize, + handlep) == 0) { + return (0); + } + + if (load_all(PATH_LOADER_EFI, bufp, bufsize, handlep) == 0) { + return (0); + } + return (EFI_NOT_FOUND); } @@ -202,20 +497,27 @@ try_boot(void) size_t bufsize, loadersize, cmdsize; void *buf, *loaderbuf; char *cmd; - dev_info_t *dev; - const boot_module_t *mod; + EFI_HANDLE fshandle; EFI_HANDLE loaderhandle; EFI_LOADED_IMAGE *loaded_image; EFI_STATUS status; + EFI_DEVICE_PATH *fspath; - status = load_loader(&mod, &dev, &loaderbuf, &loadersize, TRUE); - if (status != EFI_SUCCESS) { - status = load_loader(&mod, &dev, &loaderbuf, &loadersize, - FALSE); + status = load_loader(&fshandle, &loaderbuf, &loadersize); + + if (status != EFI_SUCCESS) { + return (status); + } + + fspath = NULL; + if (status == EFI_SUCCESS) { + status = BS->OpenProtocol(fshandle, &DevicePathGUID, + (void **)&fspath, IH, NULL, EFI_OPEN_PROTOCOL_GET_PROTOCOL); if (status != EFI_SUCCESS) { - printf("Failed to load '%s'\n", PATH_LOADER_EFI); - return (status); - } + DPRINTF("Failed to get image DevicePath (%lu)\n", + EFI_ERROR_CODE(status)); + } + DPRINTF("filesystem device path: %s\n", devpath_str(fspath)); } /* @@ -230,9 +532,9 @@ try_boot(void) */ cmd = NULL; cmdsize = 0; - status = mod->load(PATH_DOTCONFIG, dev, &buf, &bufsize); + status = do_load(PATH_DOTCONFIG, &buf, &bufsize); if (status == EFI_NOT_FOUND) - status = mod->load(PATH_CONFIG, dev, &buf, &bufsize); + status = do_load(PATH_CONFIG, &buf, &bufsize); if (status == EFI_SUCCESS) { cmdsize = bufsize + 1; cmd = malloc(cmdsize); @@ -244,24 +546,25 @@ try_boot(void) buf = NULL; } - if ((status = BS->LoadImage(TRUE, IH, devpath_last(dev->devpath), + if ((status = BS->LoadImage(TRUE, IH, efi_devpath_last_node(fspath), loaderbuf, loadersize, &loaderhandle)) != EFI_SUCCESS) { - printf("Failed to load image provided by %s, size: %zu, (%lu)\n", - mod->name, loadersize, EFI_ERROR_CODE(status)); + printf("Failed to load image, size: %zu, (%lu)\n", + loadersize, EFI_ERROR_CODE(status)); goto errout; } - if ((status = BS->HandleProtocol(loaderhandle, &LoadedImageGUID, - (VOID**)&loaded_image)) != EFI_SUCCESS) { - printf("Failed to query LoadedImage provided by %s (%lu)\n", - mod->name, EFI_ERROR_CODE(status)); + if ((status = BS->OpenProtocol(loaderhandle, &LoadedImageGUID, + (VOID**)&loaded_image, IH, NULL, + EFI_OPEN_PROTOCOL_GET_PROTOCOL)) != EFI_SUCCESS) { + printf("Failed to query LoadedImage (%lu)\n", + EFI_ERROR_CODE(status)); goto errout; } if (cmd != NULL) printf(" command args: %s\n", cmd); - loaded_image->DeviceHandle = dev->devhandle; + loaded_image->DeviceHandle = fshandle; loaded_image->LoadOptionsSize = cmdsize; loaded_image->LoadOptions = cmd; @@ -279,8 +582,8 @@ try_boot(void) if ((status = BS->StartImage(loaderhandle, NULL, NULL)) != EFI_SUCCESS) { - printf("Failed to start image provided by %s (%lu)\n", - mod->name, EFI_ERROR_CODE(status)); + printf("Failed to start image (%lu)\n", + EFI_ERROR_CODE(status)); loaded_image->LoadOptionsSize = 0; loaded_image->LoadOptions = NULL; } @@ -296,142 +599,37 @@ errout: return (status); } -/* - * probe_handle determines if the passed handle represents a logical partition - * if it does it uses each module in order to probe it and if successful it - * returns EFI_SUCCESS. - */ -static EFI_STATUS -probe_handle(EFI_HANDLE h, EFI_DEVICE_PATH *imgpath, BOOLEAN *preferred) +EFI_STATUS +main(int argc __unused, CHAR16 *argv[] __unused) { - dev_info_t *devinfo; - EFI_BLOCK_IO *blkio; - EFI_DEVICE_PATH *devpath; - EFI_STATUS status; - UINTN i; + EFI_STATUS status; - /* Figure out if we're dealing with an actual partition. */ - status = BS->HandleProtocol(h, &DevicePathGUID, (void **)&devpath); - if (status == EFI_UNSUPPORTED) - return (status); + SIMPLE_TEXT_OUTPUT_INTERFACE *conout = NULL; + UINTN i, max_dim, best_mode, cols, rows; + CHAR16 *text; - if (status != EFI_SUCCESS) { - DPRINTF("\nFailed to query DevicePath (%lu)\n", - EFI_ERROR_CODE(status)); - return (status); - } -#ifdef EFI_DEBUG - { - CHAR16 *text = efi_devpath_name(devpath); - DPRINTF("probing: %S\n", text); - efi_free_devpath_name(text); - } + archsw.arch_autoload = efi_autoload; + archsw.arch_getdev = efi_getdev; + archsw.arch_copyin = efi_copyin; + archsw.arch_copyout = efi_copyout; + archsw.arch_readin = efi_readin; +#ifdef EFI_ZFS_BOOT + /* Note this needs to be set before ZFS init. */ + archsw.arch_zfs_probe = efi_zfs_probe; #endif - status = BS->HandleProtocol(h, &BlockIoProtocolGUID, (void **)&blkio); - if (status == EFI_UNSUPPORTED) - return (status); - if (status != EFI_SUCCESS) { - DPRINTF("\nFailed to query BlockIoProtocol (%lu)\n", - EFI_ERROR_CODE(status)); - return (status); - } + /* Init the time source */ + efi_time_init(); + cons_probe(); - if (!blkio->Media->LogicalPartition) - return (EFI_UNSUPPORTED); - - *preferred = device_paths_match(imgpath, devpath); - - /* Run through each module, see if it can load this partition */ - for (i = 0; i < NUM_BOOT_MODULES; i++) { - devinfo = malloc(sizeof(*devinfo)); - if (devinfo == NULL) { - DPRINTF("\nFailed to allocate devinfo\n"); - continue; - } - devinfo->dev = blkio; - devinfo->devpath = devpath; - devinfo->devhandle = h; - devinfo->devdata = NULL; - devinfo->preferred = *preferred; - devinfo->next = NULL; - - status = boot_modules[i]->probe(devinfo); - if (status == EFI_SUCCESS) - return (EFI_SUCCESS); - free(devinfo); - } - - return (EFI_UNSUPPORTED); -} - -/* - * probe_handle_status calls probe_handle and outputs the returned status - * of the call. - */ -static void -probe_handle_status(EFI_HANDLE h, EFI_DEVICE_PATH *imgpath) -{ - EFI_STATUS status; - BOOLEAN preferred; - - preferred = FALSE; - status = probe_handle(h, imgpath, &preferred); - - DPRINTF("probe: "); - switch (status) { - case EFI_UNSUPPORTED: - printf("."); - DPRINTF(" not supported\n"); - break; - case EFI_SUCCESS: - if (preferred) { - printf("%c", '*'); - DPRINTF(" supported (preferred)\n"); - } else { - printf("%c", '+'); - DPRINTF(" supported\n"); - } - break; - default: - printf("x"); - DPRINTF(" error (%lu)\n", EFI_ERROR_CODE(status)); - break; - } - DSTALL(500000); -} - -EFI_STATUS -efi_main(EFI_HANDLE Ximage, EFI_SYSTEM_TABLE *Xsystab) -{ - EFI_HANDLE *handles; - EFI_LOADED_IMAGE *img; - EFI_DEVICE_PATH *imgpath; - EFI_STATUS status; - EFI_CONSOLE_CONTROL_PROTOCOL *ConsoleControl = NULL; - SIMPLE_TEXT_OUTPUT_INTERFACE *conout = NULL; - UINTN i, max_dim, best_mode, cols, rows, hsize, nhandles; - CHAR16 *text; - - /* Basic initialization*/ - ST = Xsystab; - IH = Ximage; - BS = ST->BootServices; - RS = ST->RuntimeServices; - - /* Set up the console, so printf works. */ - status = BS->LocateProtocol(&ConsoleControlGUID, NULL, - (VOID **)&ConsoleControl); - if (status == EFI_SUCCESS) - (void)ConsoleControl->SetMode(ConsoleControl, - EfiConsoleControlScreenText); /* * Reset the console and find the best text mode. */ conout = ST->ConOut; conout->Reset(conout, TRUE); max_dim = best_mode = 0; - for (i = 0; ; i++) { + + for (i = 0; ; i++) { status = conout->QueryMode(conout, i, &cols, &rows); if (EFI_ERROR(status)) break; @@ -440,31 +638,37 @@ efi_main(EFI_HANDLE Ximage, EFI_SYSTEM_TABLE *Xsystab) best_mode = i; } } - if (max_dim > 0) + + if (max_dim > 0) conout->SetMode(conout, best_mode); + conout->EnableCursor(conout, TRUE); conout->ClearScreen(conout); + /* Print this here, so people know it's at least starting. */ printf("\n>> FreeBSD EFI boot block\n"); printf(" Loader path: %s\n\n", PATH_LOADER_EFI); - printf(" Initializing modules:"); - for (i = 0; i < NUM_BOOT_MODULES; i++) { - printf(" %s", boot_modules[i]->name); - if (boot_modules[i]->init != NULL) - boot_modules[i]->init(); + + /* Get the image path and trim it to get the disk on which we + * found this loader. + */ + if ((status = BS->OpenProtocol(IH, &LoadedImageGUID, + (VOID**)&boot_image, IH, NULL, + EFI_OPEN_PROTOCOL_GET_PROTOCOL)) != EFI_SUCCESS) { + panic("Failed to query LoadedImage (%lu)\n", + EFI_ERROR_CODE(status)); } - putchar('\n'); /* Determine the devpath of our image so we can prefer it. */ - status = BS->HandleProtocol(IH, &LoadedImageGUID, (VOID**)&img); + status = BS->HandleProtocol(IH, &LoadedImageGUID, (VOID**)&boot_image); imgpath = NULL; if (status == EFI_SUCCESS) { - text = efi_devpath_name(img->FilePath); + text = efi_devpath_name(boot_image->FilePath); printf(" Load Path: %S\n", text); efi_setenv_freebsd_wcs("Boot1Path", text); efi_free_devpath_name(text); - status = BS->HandleProtocol(img->DeviceHandle, &DevicePathGUID, + status = BS->HandleProtocol(boot_image->DeviceHandle, &DevicePathGUID, (void **)&imgpath); if (status != EFI_SUCCESS) { DPRINTF("Failed to get image DevicePath (%lu)\n", @@ -478,49 +682,36 @@ efi_main(EFI_HANDLE Ximage, EFI_SYSTEM_TABLE *Xsystab) } - /* Get all the device handles */ - hsize = (UINTN)NUM_HANDLES_INIT * sizeof(EFI_HANDLE); - handles = malloc(hsize); - if (handles == NULL) { - printf("Failed to allocate %d handles\n", NUM_HANDLES_INIT); - } + /* The loaded image device path ends with a partition, then a + * file path. Trim them both to get the actual disk. + */ + if ((imgprefix = efi_devpath_trim(imgpath)) == NULL || + (imgprefix = efi_devpath_trim(imgprefix)) == NULL) { + panic("Couldn't trim device path"); + } - status = BS->LocateHandle(ByProtocol, &BlockIoProtocolGUID, NULL, - &hsize, handles); - switch (status) { - case EFI_SUCCESS: - break; - case EFI_BUFFER_TOO_SMALL: - free(handles); - handles = malloc(hsize); - if (handles == NULL) - efi_panic(EFI_OUT_OF_RESOURCES, "Failed to allocate %d handles\n", - NUM_HANDLES_INIT); - status = BS->LocateHandle(ByProtocol, &BlockIoProtocolGUID, - NULL, &hsize, handles); - if (status != EFI_SUCCESS) - efi_panic(status, "Failed to get device handles\n"); - break; - default: *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Sun Feb 11 20:06:37 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6A776F138BB; Sun, 11 Feb 2018 20:06:37 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1BE5A68A84; Sun, 11 Feb 2018 20:06:37 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 16E7E278E5; Sun, 11 Feb 2018 20:06:37 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1BK6axf021678; Sun, 11 Feb 2018 20:06:36 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1BK6a5f021674; Sun, 11 Feb 2018 20:06:36 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201802112006.w1BK6a5f021674@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sun, 11 Feb 2018 20:06:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r329136 - in stable/11/sys/boot: . common efi/libefi ficl X-SVN-Group: stable-11 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in stable/11/sys/boot: . common efi/libefi ficl X-SVN-Commit-Revision: 329136 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Feb 2018 20:06:37 -0000 Author: kevans Date: Sun Feb 11 20:06:36 2018 New Revision: 329136 URL: https://svnweb.freebsd.org/changeset/base/329136 Log: MFC r324648: Rename top level Makefile.ficl to ficl.mk. Added: stable/11/sys/boot/ficl.mk - copied unchanged from r329135, stable/11/sys/boot/Makefile.ficl Deleted: stable/11/sys/boot/Makefile.ficl Modified: stable/11/sys/boot/common/Makefile.inc stable/11/sys/boot/efi/libefi/Makefile stable/11/sys/boot/ficl/Makefile Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/boot/common/Makefile.inc ============================================================================== --- stable/11/sys/boot/common/Makefile.inc Sun Feb 11 20:04:34 2018 (r329135) +++ stable/11/sys/boot/common/Makefile.inc Sun Feb 11 20:06:36 2018 (r329136) @@ -66,7 +66,7 @@ SRCS+= pnp.c # Forth interpreter .if defined(BOOT_FORTH) SRCS+= interp_forth.c -.include "${SRCTOP}/sys/boot/Makefile.ficl" +.include "../ficl.mk" .endif .if defined(BOOT_PROMPT_123) Modified: stable/11/sys/boot/efi/libefi/Makefile ============================================================================== --- stable/11/sys/boot/efi/libefi/Makefile Sun Feb 11 20:04:34 2018 (r329135) +++ stable/11/sys/boot/efi/libefi/Makefile Sun Feb 11 20:06:36 2018 (r329136) @@ -4,7 +4,7 @@ .if ${MK_FORTH} != "no" CFLAGS+= -DBOOT_FORTH -.include "${.CURDIR}/../../Makefile.ficl" +.include "../../ficl.mk" .endif LIB= efi Copied: stable/11/sys/boot/ficl.mk (from r329135, stable/11/sys/boot/Makefile.ficl) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/sys/boot/ficl.mk Sun Feb 11 20:06:36 2018 (r329136, copy of r329135, stable/11/sys/boot/Makefile.ficl) @@ -0,0 +1,43 @@ +# $FreeBSD$ + +# Common flags to build FICL related files + +FICLDIR?= ${SRCTOP}/sys/boot/ficl + +.if ${MACHINE_CPUARCH} == "amd64" && defined(FICL32) +FICL_CPUARCH= i386 +.elif ${MACHINE_ARCH} == "mips64" || ${MACHINE_ARCH} == "mips64el" +FICL_CPUARCH= mips64 +.else +FICL_CPUARCH= ${MACHINE_CPUARCH} +.endif + +.PATH: ${FICLDIR} ${FICLDIR}/${FICL_CPUARCH} + +.if ${MACHINE_CPUARCH} == "amd64" +.if defined(FICL32) +CFLAGS+= -m32 -I. +.else +CFLAGS+= -fPIC +.endif +.endif + +.if ${MACHINE_ARCH} == "powerpc64" +CFLAGS+= -m32 -mcpu=powerpc -I. +.endif + +CFLAGS+= -I${FICLDIR} -I${FICLDIR}/${FICL_CPUARCH} \ + -I${FICLDIR}/../common + +.if ${MACHINE_CPUARCH} == "amd64" && defined(FICL32) +.if !exists(machine) +${SRCS:M*.c:R:S/$/.o/g}: machine + +beforedepend ${OBJS}: machine +.endif + +machine: .NOMETA + ln -sf ${.CURDIR}/../../i386/include machine + +CLEANFILES+= machine +.endif Modified: stable/11/sys/boot/ficl/Makefile ============================================================================== --- stable/11/sys/boot/ficl/Makefile Sun Feb 11 20:04:34 2018 (r329135) +++ stable/11/sys/boot/ficl/Makefile Sun Feb 11 20:06:36 2018 (r329136) @@ -1,7 +1,7 @@ # $FreeBSD$ # -.include "${.CURDIR}/../Makefile.ficl" +.include "../ficl.mk" BASE_SRCS= dict.c ficl.c fileaccess.c float.c loader.c math64.c \ prefix.c search.c stack.c tools.c vm.c words.c From owner-svn-src-all@freebsd.org Sun Feb 11 20:15:48 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4CC4EF144A2; Sun, 11 Feb 2018 20:15:48 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EBC03691B0; Sun, 11 Feb 2018 20:15:47 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E216727A80; Sun, 11 Feb 2018 20:15:47 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1BKFlK9026587; Sun, 11 Feb 2018 20:15:47 GMT (envelope-from scottl@FreeBSD.org) Received: (from scottl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1BKFlkh026585; Sun, 11 Feb 2018 20:15:47 GMT (envelope-from scottl@FreeBSD.org) Message-Id: <201802112015.w1BKFlkh026585@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: scottl set sender to scottl@FreeBSD.org using -f From: Scott Long Date: Sun, 11 Feb 2018 20:15:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329137 - in head/sys/dev: mpr mps X-SVN-Group: head X-SVN-Commit-Author: scottl X-SVN-Commit-Paths: in head/sys/dev: mpr mps X-SVN-Commit-Revision: 329137 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Feb 2018 20:15:48 -0000 Author: scottl Date: Sun Feb 11 20:15:47 2018 New Revision: 329137 URL: https://svnweb.freebsd.org/changeset/base/329137 Log: Print out the shared memory queues during initialization Sponsored by: Netflix Modified: head/sys/dev/mpr/mpr.c head/sys/dev/mps/mps.c Modified: head/sys/dev/mpr/mpr.c ============================================================================== --- head/sys/dev/mpr/mpr.c Sun Feb 11 20:06:36 2018 (r329136) +++ head/sys/dev/mpr/mpr.c Sun Feb 11 20:15:47 2018 (r329137) @@ -1356,6 +1356,10 @@ mpr_alloc_hw_queues(struct mpr_softc *sc) sc->free_busaddr = queues_busaddr; sc->post_queue = (MPI2_REPLY_DESCRIPTORS_UNION *)(queues + fqsize); sc->post_busaddr = queues_busaddr + fqsize; + mpr_dprint(sc, MPR_INIT, "free queue busaddr= %#016lx size= %d\n", + sc->free_busaddr, fqsize); + mpr_dprint(sc, MPR_INIT, "reply queue busaddr= %#016lx size= %d\n", + sc->post_busaddr, pqsize); return (0); } @@ -1398,6 +1402,8 @@ mpr_alloc_replies(struct mpr_softc *sc) bzero(sc->reply_frames, rsize); bus_dmamap_load(sc->reply_dmat, sc->reply_map, sc->reply_frames, rsize, mpr_memaddr_cb, &sc->reply_busaddr, 0); + mpr_dprint(sc, MPR_INIT, "reply frames busaddr= %#016lx size= %d\n", + sc->reply_busaddr, rsize); return (0); } @@ -1432,6 +1438,8 @@ mpr_alloc_requests(struct mpr_softc *sc) bzero(sc->req_frames, rsize); bus_dmamap_load(sc->req_dmat, sc->req_map, sc->req_frames, rsize, mpr_memaddr_cb, &sc->req_busaddr, 0); + mpr_dprint(sc, MPR_INIT, "request frames busaddr= %#016lx size= %d\n", + sc->req_busaddr, rsize); rsize = sc->chain_frame_size * sc->num_chains; if (bus_dma_tag_create( sc->mpr_parent_dmat, /* parent */ @@ -1456,6 +1464,8 @@ mpr_alloc_requests(struct mpr_softc *sc) bzero(sc->chain_frames, rsize); bus_dmamap_load(sc->chain_dmat, sc->chain_map, sc->chain_frames, rsize, mpr_memaddr_cb, &sc->chain_busaddr, 0); + mpr_dprint(sc, MPR_INIT, "chain frames busaddr= %#016lx size= %d\n", + sc->chain_busaddr, rsize); rsize = MPR_SENSE_LEN * sc->num_reqs; if (bus_dma_tag_create( sc->mpr_parent_dmat, /* parent */ @@ -1480,6 +1490,8 @@ mpr_alloc_requests(struct mpr_softc *sc) bzero(sc->sense_frames, rsize); bus_dmamap_load(sc->sense_dmat, sc->sense_map, sc->sense_frames, rsize, mpr_memaddr_cb, &sc->sense_busaddr, 0); + mpr_dprint(sc, MPR_INIT, "sense frames busaddr= %#016lx size= %d\n", + sc->sense_busaddr, rsize); sc->chains = malloc(sizeof(struct mpr_chain) * sc->num_chains, M_MPR, M_WAITOK | M_ZERO); Modified: head/sys/dev/mps/mps.c ============================================================================== --- head/sys/dev/mps/mps.c Sun Feb 11 20:06:36 2018 (r329136) +++ head/sys/dev/mps/mps.c Sun Feb 11 20:15:47 2018 (r329137) @@ -1313,6 +1313,10 @@ mps_alloc_hw_queues(struct mps_softc *sc) sc->free_busaddr = queues_busaddr; sc->post_queue = (MPI2_REPLY_DESCRIPTORS_UNION *)(queues + fqsize); sc->post_busaddr = queues_busaddr + fqsize; + mps_dprint(sc, MPS_INIT, "free queue busaddr= %#016lx size= %d\n", + sc->free_busaddr, fqsize); + mps_dprint(sc, MPS_INIT, "reply queue busaddr= %#016lx size= %d\n", + sc->post_busaddr, pqsize); return (0); } @@ -1356,6 +1360,9 @@ mps_alloc_replies(struct mps_softc *sc) bus_dmamap_load(sc->reply_dmat, sc->reply_map, sc->reply_frames, rsize, mps_memaddr_cb, &sc->reply_busaddr, 0); + mps_dprint(sc, MPS_INIT, "reply frames busaddr= %#016lx size= %d\n", + sc->reply_busaddr, rsize); + return (0); } @@ -1389,6 +1396,8 @@ mps_alloc_requests(struct mps_softc *sc) bzero(sc->req_frames, rsize); bus_dmamap_load(sc->req_dmat, sc->req_map, sc->req_frames, rsize, mps_memaddr_cb, &sc->req_busaddr, 0); + mps_dprint(sc, MPS_INIT, "request frames busaddr= %#016lx size= %d\n", + sc->req_busaddr, rsize); rsize = sc->reqframesz * sc->num_chains; if (bus_dma_tag_create( sc->mps_parent_dmat, /* parent */ @@ -1413,6 +1422,8 @@ mps_alloc_requests(struct mps_softc *sc) bzero(sc->chain_frames, rsize); bus_dmamap_load(sc->chain_dmat, sc->chain_map, sc->chain_frames, rsize, mps_memaddr_cb, &sc->chain_busaddr, 0); + mps_dprint(sc, MPS_INIT, "chain frames busaddr= %#016lx size= %d\n", + sc->chain_busaddr, rsize); rsize = MPS_SENSE_LEN * sc->num_reqs; if (bus_dma_tag_create( sc->mps_parent_dmat, /* parent */ @@ -1437,6 +1448,8 @@ mps_alloc_requests(struct mps_softc *sc) bzero(sc->sense_frames, rsize); bus_dmamap_load(sc->sense_dmat, sc->sense_map, sc->sense_frames, rsize, mps_memaddr_cb, &sc->sense_busaddr, 0); + mps_dprint(sc, MPS_INIT, "sense frames busaddr= %#016lx size= %d\n", + sc->sense_busaddr, rsize); sc->chains = malloc(sizeof(struct mps_chain) * sc->num_chains, M_MPT2, M_WAITOK | M_ZERO); From owner-svn-src-all@freebsd.org Sun Feb 11 20:35:15 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 62C17F15E86; Sun, 11 Feb 2018 20:35:15 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0C1BE69EE7; Sun, 11 Feb 2018 20:35:15 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DD92A27DD5; Sun, 11 Feb 2018 20:35:14 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1BKZEok036828; Sun, 11 Feb 2018 20:35:14 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1BKZEJP036827; Sun, 11 Feb 2018 20:35:14 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201802112035.w1BKZEJP036827@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sun, 11 Feb 2018 20:35:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r329138 - stable/11/sys/boot/libsa X-SVN-Group: stable-11 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: stable/11/sys/boot/libsa X-SVN-Commit-Revision: 329138 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Feb 2018 20:35:15 -0000 Author: kevans Date: Sun Feb 11 20:35:14 2018 New Revision: 329138 URL: https://svnweb.freebsd.org/changeset/base/329138 Log: Fix paths after r329132 This is a direct commit to stable/11 due to svn's handling of merging this move being less than ideal. Modified: stable/11/sys/boot/libsa/Makefile Modified: stable/11/sys/boot/libsa/Makefile ============================================================================== --- stable/11/sys/boot/libsa/Makefile Sun Feb 11 20:15:47 2018 (r329137) +++ stable/11/sys/boot/libsa/Makefile Sun Feb 11 20:35:14 2018 (r329138) @@ -14,13 +14,10 @@ MK_SSP= no LIBSTAND_SRC?= ${.CURDIR} LIBSTAND_CPUARCH?=${MACHINE_CPUARCH} -LIBC_SRC= ${LIBSTAND_SRC}/../libc +LIBC_SRC= ${SRCTOP_LIBC}/../libc LIB?= sa NO_PIC= -INCS?= stand.h -MAN?= libstand.3 - WARNS?= 0 CFLAGS+= -I${LIBSTAND_SRC} @@ -58,14 +55,14 @@ CFLAGS.clang+= -mno-movt CFLAGS.clang+= -mfpu=none # Compiler support functions -.PATH: ${LIBSTAND_SRC}/../../contrib/compiler-rt/lib/builtins/ +.PATH: ${SRCTOP}/contrib/compiler-rt/lib/builtins/ # __clzsi2 and ctzsi2 for various builtin functions SRCS+= clzsi2.c ctzsi2.c # Divide and modulus functions called by the compiler SRCS+= divmoddi4.c divmodsi4.c divdi3.c divsi3.c moddi3.c modsi3.c SRCS+= udivmoddi4.c udivmodsi4.c udivdi3.c udivsi3.c umoddi3.c umodsi3.c -.PATH: ${LIBSTAND_SRC}/../../contrib/compiler-rt/lib/builtins/arm/ +.PATH: ${SRCTOP}/contrib/compiler-rt/lib/builtins/arm/ SRCS+= aeabi_idivmod.S aeabi_ldivmod.S aeabi_uidivmod.S aeabi_uldivmod.S SRCS+= aeabi_memcmp.S aeabi_memcpy.S aeabi_memmove.S aeabi_memset.S .endif @@ -91,7 +88,7 @@ SRCS+= _setjmp.S # decompression functionality from libbz2 # NOTE: to actually test this functionality after libbz2 upgrade compile # loader(8) with LOADER_BZIP2_SUPPORT defined -.PATH: ${LIBSTAND_SRC}/../../contrib/bzip2 +.PATH: ${SRCTOP}/contrib/bzip2 CFLAGS+= -DBZ_NO_STDIO -DBZ_NO_COMPRESS SRCS+= libstand_bzlib_private.h @@ -110,7 +107,7 @@ libstand_bzlib_private.h: bzlib_private.h ${.ALLSRC} > ${.TARGET} # decompression functionality from zlib -.PATH: ${LIBSTAND_SRC}/../../contrib/zlib +.PATH: ${SRCTOP}/contrib/zlib CFLAGS+=-DHAVE_MEMCPY -I${LIBSTAND_SRC}/../../contrib/zlib SRCS+= adler32.c crc32.c libstand_zutil.h libstand_gzguts.h From owner-svn-src-all@freebsd.org Sun Feb 11 20:58:03 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BF9F3F17818; Sun, 11 Feb 2018 20:58:02 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 70F1A6AC33; Sun, 11 Feb 2018 20:58:02 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6B8A7139; Sun, 11 Feb 2018 20:58:02 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1BKw2dd046864; Sun, 11 Feb 2018 20:58:02 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1BKw0xv046842; Sun, 11 Feb 2018 20:58:00 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201802112058.w1BKw0xv046842@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sun, 11 Feb 2018 20:58:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r329140 - in stable/11: . share/mk sys/arm/include sys/arm64/include sys/boot sys/boot/arm/at91 sys/boot/arm/at91/boot0 sys/boot/arm/at91/boot0iic sys/boot/arm/at91/boot0spi sys/boot/ar... X-SVN-Group: stable-11 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in stable/11: . share/mk sys/arm/include sys/arm64/include sys/boot sys/boot/arm/at91 sys/boot/arm/at91/boot0 sys/boot/arm/at91/boot0iic sys/boot/arm/at91/boot0spi sys/boot/arm/at91/boot2 sys/boot/arm... X-SVN-Commit-Revision: 329140 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Feb 2018 20:58:03 -0000 Author: kevans Date: Sun Feb 11 20:58:00 2018 New Revision: 329140 URL: https://svnweb.freebsd.org/changeset/base/329140 Log: MFC Loader Fixes 2017q4p6: r324649,r324650,r324651,r324652,r324653,r324654, r324700,r324702,r324709,r324717,r324719,r324841,r324842,r324843,r324845, r324850,r324876,r324877,r324878,r324879,r324880,r324881,r324883,r324980, r324981,r324982,r324995,r325014,r325093,r325094,r325114,r325170,r325171, r325172,r325173,r325174,r325175,r325176,r325248,r325286,r325310,r325332, r325338,r325339,r325376,r325377,r325379,r325380,r325382,r325478,r325479, r325480,r325482,r325483,r325484,r325485,r325556,r325641,r325681,r325685, r325686,r325687,r325688,r325689,r325690,r325691,r325692,r325693,r325694, r325743,r325744,r325748,r325775,r325779,r325780 r324649: Move common/Makefile.inc to sys/boot/loader.mk. r324650: tweak style r324651: create defs.mk for common definitions r324652: Move all the ficl common code into ficl.mk r324653: LOADER_foo_SUPPORTED r324654: Explicitly inlcude SYSDIR in the include path r324700: loader: initialize dv_cleanup in md.c to eliminate clang warning r324702: We need to include disk.o in libuboot.a when we're building with support for disk access. r324709: Revert "Unify boot1 with loader" change r324646 r324717: libsa/ip.c: misplaced comment, ip_v is half char, not ip_p r324719: libsa/ip: stop read loop on bad fragments r324841: Use BOOTDIR more consistently in defs.mk rather than repeat sys/boot. r324842: Introduce BOOTOBJ: The top level object directory for the boot tree r324843: Stopgap fix to the mistmatch between LOADER_GELI_SUPPORT and LOADER_NO_GELI_SUPPORT. r324845: Use BOOTOBJ and BOOTDIR to find geli includes and libraries. r324850: Define LIBSA32 to LIBSA on i386 to fix build. r324876: Move fdt and uboot defines into common uboot.mk. r324877: End source directories with SRC rather than a hodgepodge of names r324878: Make at91 boot loader compile again. r324879: Prefer SRCTOP paths for bits we're grabbing from libc. r324880: Use BOOTSRC here. r324881: Use SYSDIR instead of ${.CURDIR}/../../sys. r324883: Use preferred defined paths, rather than relative paths in fdt. r324980: Use BOOTDIR consistently. r324981: Move BINDIR definition to defs.mk, and override where it isn't /boot r324982: Remove sys/boot/arm/at91 and ixp425 r324995: loader.efi: Make framebuffer commands available for arm64 r325014: Add a 'place holder' arm struct efi_fb until a real one comes r325093: Define new EFI variables r325094: Cleanup non-arch Makefiles r325114: Use defs.mk defins in most MD code r325170: Use defs.mk values for userboot r325171: Use defs.mk name and prefer bsd.init.mk r325172: Remove the -nostdlib stuff I added. Instead, fix LDFLAGS to be honored correctly with the new Makefile.inc include order. r325173: We don't need to build a special ficl for userboot. r325174: Minor cleanup r325175: For amd64, compile both zfs and zfs32 libraries. r325176: Actually add zfs32/Makefile r325248: loader ptblread() is broken with >512B sectors r325286: efipart_strategy is using wrong offset with >512B sectors r325310: zfs.c:vdev_read() needs to be careful about large sectors r325332: loader: re-enable gzip support for x86 r325338: loader: fix BOOTSRC -> BOOTOBJ in a library path r325339: This used to have bzip2 support too. r325376: WIP: centralize machine links r325377: mostly libsa r325379: Revert "mostly libsa" r325380: Revert "WIP: centralize machine links" r325382: Cleanup stray libstand names to be libsa names. r325478: Powerpc is a 32-bit boot loader. r325479: Define LIBFICL32 to be libficl.a on i386 and libficl32.a on amd64. r325480: Use DO32 for all the places that we need to flag we're building a 32-bit version of a library. r325482: Move machine and other link creation to defs.mk r325483: MACHINE can never be powerpc64, so cleanup code that thinks it can. r325484: Prefer bsd.init.mk to src.opts.mk r325485: Centralize all 32-bit builds on 64-bit platform stuff. r325556: loader: set options before including bsd.init.mk r325641: loader.efi: efi_devpath_is_prefix should return bool r325681: boot1: avoid using NULL device path r325685: libsa32 isn't needed for i386. It's already a 32-bit platform. r325686: Simplify this if to a direct assignment. r325687: Remove all the empty help files from the powerpc build. r325688: FDT support doesn't make sense for ps3, remove it. r325689: Remove LOADER_FDT_SUPPORT as a Makefile variable. r325690: Remove LOADER_ZFS_SUPPORT as a Makefile variable r325691: Remove useless PNP define here. r325692: Replace LOADER_FIREWIRE_SUPPORT variable r325693: Move LOADER_{NO,}_GELI_SUPPORT to MK_LOADER_GELI r325694: Install the 4th files in sys/boot/forth instead of each loader r325743: Make sure the proper loader.rc gets installed. r325744: boot1: also check for NULL device r325748: Use proper include file. r325775: Add loader.conf to the list of files that are MD. r325779: Add /boot/dts to the list of default modules. r325780: Don't add /boot/dt*s* but /boot/dt*b*. Stupid think-o. Added: stable/11/sys/boot/arm/loader/ - copied from r325775, head/sys/boot/arm/loader/ stable/11/sys/boot/defs.mk - copied, changed from r324654, head/sys/boot/defs.mk stable/11/sys/boot/efi/boot1/boot_module.h - copied unchanged from r324709, head/sys/boot/efi/boot1/boot_module.h stable/11/sys/boot/efi/boot1/ufs_module.c - copied unchanged from r324709, head/sys/boot/efi/boot1/ufs_module.c stable/11/sys/boot/efi/boot1/zfs_module.c - copied unchanged from r324709, head/sys/boot/efi/boot1/zfs_module.c stable/11/sys/boot/efi/loader/efi_main.c - copied unchanged from r324709, head/sys/boot/efi/loader/efi_main.c stable/11/sys/boot/efi/loader/framebuffer.c - copied unchanged from r324995, head/sys/boot/efi/loader/framebuffer.c stable/11/sys/boot/efi/loader/framebuffer.h - copied unchanged from r324995, head/sys/boot/efi/loader/framebuffer.h stable/11/sys/boot/fdt.mk - copied unchanged from r325689, head/sys/boot/fdt.mk stable/11/sys/boot/loader.mk - copied, changed from r329139, stable/11/sys/boot/common/Makefile.inc stable/11/sys/boot/uboot.mk - copied, changed from r324881, head/sys/boot/uboot.mk stable/11/sys/boot/zfs32/ - copied from r325176, head/sys/boot/zfs32/ stable/11/tools/build/options/WITHOUT_LOADER_GEIL - copied unchanged from r325693, head/tools/build/options/WITHOUT_LOADER_GEIL stable/11/tools/build/options/WITH_LOADER_FIREWIRE - copied unchanged from r325692, head/tools/build/options/WITH_LOADER_FIREWIRE Replaced: stable/11/sys/boot/arm/loader/loader.conf - copied unchanged from r329139, stable/11/sys/boot/arm/uboot/loader.conf Deleted: stable/11/sys/boot/arm/at91/Makefile stable/11/sys/boot/arm/at91/Makefile.inc stable/11/sys/boot/arm/at91/boot0/Makefile stable/11/sys/boot/arm/at91/boot0/README stable/11/sys/boot/arm/at91/boot0/linker.cfg stable/11/sys/boot/arm/at91/boot0/main.c stable/11/sys/boot/arm/at91/boot0iic/Makefile stable/11/sys/boot/arm/at91/boot0iic/main.c stable/11/sys/boot/arm/at91/boot0spi/Makefile stable/11/sys/boot/arm/at91/boot0spi/main.c stable/11/sys/boot/arm/at91/boot2/Makefile stable/11/sys/boot/arm/at91/boot2/board.h stable/11/sys/boot/arm/at91/boot2/boot2.c stable/11/sys/boot/arm/at91/boot2/bwct_board.c stable/11/sys/boot/arm/at91/boot2/centipad_board.c stable/11/sys/boot/arm/at91/boot2/kb920x_board.c stable/11/sys/boot/arm/at91/bootiic/Makefile stable/11/sys/boot/arm/at91/bootiic/README stable/11/sys/boot/arm/at91/bootiic/env_vars.c stable/11/sys/boot/arm/at91/bootiic/env_vars.h stable/11/sys/boot/arm/at91/bootiic/loader_prompt.c stable/11/sys/boot/arm/at91/bootiic/loader_prompt.h stable/11/sys/boot/arm/at91/bootiic/main.c stable/11/sys/boot/arm/at91/bootspi/Makefile stable/11/sys/boot/arm/at91/bootspi/README stable/11/sys/boot/arm/at91/bootspi/ee.c stable/11/sys/boot/arm/at91/bootspi/ee.h stable/11/sys/boot/arm/at91/bootspi/env_vars.c stable/11/sys/boot/arm/at91/bootspi/env_vars.h stable/11/sys/boot/arm/at91/bootspi/loader_prompt.c stable/11/sys/boot/arm/at91/bootspi/loader_prompt.h stable/11/sys/boot/arm/at91/bootspi/main.c stable/11/sys/boot/arm/at91/libat91/Makefile stable/11/sys/boot/arm/at91/libat91/arm_init.S stable/11/sys/boot/arm/at91/libat91/at91rm9200.h stable/11/sys/boot/arm/at91/libat91/at91rm9200_lowlevel.c stable/11/sys/boot/arm/at91/libat91/at91rm9200_lowlevel.h stable/11/sys/boot/arm/at91/libat91/delay.c stable/11/sys/boot/arm/at91/libat91/eeprom.c stable/11/sys/boot/arm/at91/libat91/emac.c stable/11/sys/boot/arm/at91/libat91/emac.h stable/11/sys/boot/arm/at91/libat91/emac_init.c stable/11/sys/boot/arm/at91/libat91/getc.c stable/11/sys/boot/arm/at91/libat91/lib.h stable/11/sys/boot/arm/at91/libat91/lib_AT91RM9200.h stable/11/sys/boot/arm/at91/libat91/mci_device.h stable/11/sys/boot/arm/at91/libat91/memcmp.c stable/11/sys/boot/arm/at91/libat91/memcpy.c stable/11/sys/boot/arm/at91/libat91/memset.c stable/11/sys/boot/arm/at91/libat91/p_string.c stable/11/sys/boot/arm/at91/libat91/printf.c stable/11/sys/boot/arm/at91/libat91/putchar.c stable/11/sys/boot/arm/at91/libat91/reset.c stable/11/sys/boot/arm/at91/libat91/sd-card.c stable/11/sys/boot/arm/at91/libat91/sd-card.h stable/11/sys/boot/arm/at91/libat91/spi_flash.c stable/11/sys/boot/arm/at91/libat91/spi_flash.h stable/11/sys/boot/arm/at91/libat91/strcmp.c stable/11/sys/boot/arm/at91/libat91/strcpy.c stable/11/sys/boot/arm/at91/libat91/strcvt.c stable/11/sys/boot/arm/at91/libat91/strlen.c stable/11/sys/boot/arm/at91/libat91/tag_list.c stable/11/sys/boot/arm/at91/libat91/tag_list.h stable/11/sys/boot/arm/at91/libat91/xmodem.c stable/11/sys/boot/arm/at91/linker.cfg stable/11/sys/boot/arm/ixp425/Makefile.inc stable/11/sys/boot/arm/ixp425/boot2/Makefile stable/11/sys/boot/arm/ixp425/boot2/arm_init.S stable/11/sys/boot/arm/ixp425/boot2/boot2.c stable/11/sys/boot/arm/ixp425/boot2/cf_ata.h stable/11/sys/boot/arm/ixp425/boot2/ixp425_board.c stable/11/sys/boot/arm/ixp425/boot2/lib.h stable/11/sys/boot/arm/uboot/loader.conf stable/11/sys/boot/common/Makefile.inc stable/11/sys/boot/efi/libefi/efi_main.c stable/11/sys/boot/efi/loader/arch/amd64/framebuffer.c stable/11/sys/boot/efi/loader/arch/amd64/framebuffer.h stable/11/sys/boot/forth/Makefile.inc stable/11/sys/boot/powerpc/kboot/help.kboot stable/11/sys/boot/powerpc/ofw/help.ofw stable/11/sys/boot/powerpc/ps3/help.ps3 stable/11/sys/boot/powerpc/uboot/help.uboot stable/11/sys/boot/uboot/common/Makefile.inc stable/11/sys/boot/userboot/ficl/Makefile stable/11/sys/boot/userboot/ficl/Makefile.depend stable/11/sys/boot/userboot/zfs/Makefile stable/11/sys/boot/userboot/zfs/Makefile.depend Modified: stable/11/UPDATING stable/11/share/mk/src.opts.mk stable/11/sys/arm/include/metadata.h stable/11/sys/arm64/include/metadata.h stable/11/sys/boot/Makefile stable/11/sys/boot/Makefile.amd64 stable/11/sys/boot/Makefile.arm stable/11/sys/boot/Makefile.arm64 stable/11/sys/boot/Makefile.i386 stable/11/sys/boot/Makefile.inc stable/11/sys/boot/Makefile.powerpc stable/11/sys/boot/Makefile.sparc64 stable/11/sys/boot/arm/uboot/Makefile stable/11/sys/boot/common/disk.c stable/11/sys/boot/common/md.c stable/11/sys/boot/efi/Makefile stable/11/sys/boot/efi/Makefile.inc stable/11/sys/boot/efi/boot1/Makefile stable/11/sys/boot/efi/boot1/boot1.c stable/11/sys/boot/efi/fdt/Makefile stable/11/sys/boot/efi/include/efilib.h stable/11/sys/boot/efi/libefi/Makefile stable/11/sys/boot/efi/libefi/devpath.c stable/11/sys/boot/efi/libefi/efipart.c stable/11/sys/boot/efi/loader/Makefile stable/11/sys/boot/efi/loader/arch/amd64/Makefile.inc stable/11/sys/boot/efi/loader/arch/arm/Makefile.inc stable/11/sys/boot/efi/loader/arch/arm64/Makefile.inc stable/11/sys/boot/efi/loader/arch/i386/Makefile.inc stable/11/sys/boot/efi/loader/bootinfo.c stable/11/sys/boot/fdt/Makefile stable/11/sys/boot/ficl.mk stable/11/sys/boot/ficl/Makefile stable/11/sys/boot/ficl32/Makefile stable/11/sys/boot/forth/Makefile stable/11/sys/boot/forth/loader.conf stable/11/sys/boot/geli/Makefile stable/11/sys/boot/i386/Makefile stable/11/sys/boot/i386/Makefile.inc stable/11/sys/boot/i386/boot0/Makefile stable/11/sys/boot/i386/boot2/Makefile stable/11/sys/boot/i386/btx/btx/Makefile stable/11/sys/boot/i386/btx/btxldr/Makefile stable/11/sys/boot/i386/btx/lib/Makefile stable/11/sys/boot/i386/cdboot/Makefile stable/11/sys/boot/i386/gptboot/Makefile stable/11/sys/boot/i386/gptzfsboot/Makefile stable/11/sys/boot/i386/kgzldr/Makefile stable/11/sys/boot/i386/libfirewire/Makefile stable/11/sys/boot/i386/libi386/Makefile stable/11/sys/boot/i386/loader/Makefile stable/11/sys/boot/i386/mbr/Makefile stable/11/sys/boot/i386/pmbr/Makefile stable/11/sys/boot/i386/pxeldr/Makefile stable/11/sys/boot/i386/zfsboot/Makefile stable/11/sys/boot/i386/zfsloader/Makefile stable/11/sys/boot/libsa/Makefile stable/11/sys/boot/libsa/ip.c stable/11/sys/boot/libsa32/Makefile stable/11/sys/boot/man/Makefile stable/11/sys/boot/mips/beri/Makefile.inc stable/11/sys/boot/mips/beri/boot2/Makefile stable/11/sys/boot/mips/beri/loader/Makefile stable/11/sys/boot/mips/uboot/Makefile stable/11/sys/boot/ofw/Makefile.inc stable/11/sys/boot/ofw/libofw/Makefile stable/11/sys/boot/powerpc/Makefile stable/11/sys/boot/powerpc/Makefile.inc stable/11/sys/boot/powerpc/boot1.chrp/Makefile stable/11/sys/boot/powerpc/kboot/Makefile stable/11/sys/boot/powerpc/ofw/Makefile stable/11/sys/boot/powerpc/ps3/Makefile stable/11/sys/boot/powerpc/uboot/Makefile stable/11/sys/boot/sparc64/Makefile stable/11/sys/boot/sparc64/Makefile.inc stable/11/sys/boot/sparc64/boot1/Makefile stable/11/sys/boot/sparc64/loader/Makefile stable/11/sys/boot/sparc64/zfsloader/Makefile stable/11/sys/boot/uboot/Makefile stable/11/sys/boot/uboot/Makefile.inc stable/11/sys/boot/uboot/fdt/Makefile stable/11/sys/boot/uboot/lib/Makefile stable/11/sys/boot/userboot/Makefile stable/11/sys/boot/userboot/test/Makefile stable/11/sys/boot/userboot/test/test.c stable/11/sys/boot/userboot/userboot/Makefile stable/11/sys/boot/zfs/Makefile stable/11/sys/boot/zfs/zfs.c stable/11/sys/boot/zfs32/Makefile stable/11/tools/boot/universe.sh Directory Properties: stable/11/ (props changed) Modified: stable/11/UPDATING ============================================================================== --- stable/11/UPDATING Sun Feb 11 20:47:38 2018 (r329139) +++ stable/11/UPDATING Sun Feb 11 20:58:00 2018 (r329140) @@ -16,6 +16,11 @@ from older versions of FreeBSD, try WITHOUT_CLANG and the tip of head, and then rebuild without this option. The bootstrap process from older version of current across the gcc/clang cutover is a bit fragile. +20180211: + The LOADER_FIREWIRE_SUPPORT build variable as been renamed to + WITH/OUT_LOADER_FIREWIRE. LOADER_{NO_,}GELI_SUPPORT has been renamed + to WITH/OUT_LOADER_GELI. + 20180210: The geli password typed at boot is now hidden. To restore the previous behavior, see geli(8) for configuration options. Modified: stable/11/share/mk/src.opts.mk ============================================================================== --- stable/11/share/mk/src.opts.mk Sun Feb 11 20:47:38 2018 (r329139) +++ stable/11/share/mk/src.opts.mk Sun Feb 11 20:58:00 2018 (r329140) @@ -123,6 +123,7 @@ __DEFAULT_YES_OPTIONS = \ LIB32 \ LIBPTHREAD \ LIBTHR \ + LOADER_GELI \ LOCALES \ LOCATE \ LPR \ @@ -188,6 +189,7 @@ __DEFAULT_NO_OPTIONS = \ HESIOD \ LIBSOFT \ LINT \ + LOADER_FIREWIRE \ LOADER_FORCE_LE \ NAND \ OFED \ Modified: stable/11/sys/arm/include/metadata.h ============================================================================== --- stable/11/sys/arm/include/metadata.h Sun Feb 11 20:47:38 2018 (r329139) +++ stable/11/sys/arm/include/metadata.h Sun Feb 11 20:58:00 2018 (r329140) @@ -39,4 +39,19 @@ struct efi_map_header { uint32_t descriptor_version; }; +/* + * Placeholder for now + */ +struct efi_fb { + uint64_t fb_addr; + uint64_t fb_size; + uint32_t fb_height; + uint32_t fb_width; + uint32_t fb_stride; + uint32_t fb_mask_red; + uint32_t fb_mask_green; + uint32_t fb_mask_blue; + uint32_t fb_mask_reserved; +}; + #endif /* !_MACHINE_METADATA_H_ */ Modified: stable/11/sys/arm64/include/metadata.h ============================================================================== --- stable/11/sys/arm64/include/metadata.h Sun Feb 11 20:47:38 2018 (r329139) +++ stable/11/sys/arm64/include/metadata.h Sun Feb 11 20:58:00 2018 (r329140) @@ -31,11 +31,24 @@ #define MODINFOMD_EFI_MAP 0x1001 #define MODINFOMD_DTBP 0x1002 +#define MODINFOMD_EFI_FB 0x1003 struct efi_map_header { size_t memory_size; size_t descriptor_size; uint32_t descriptor_version; +}; + +struct efi_fb { + uint64_t fb_addr; + uint64_t fb_size; + uint32_t fb_height; + uint32_t fb_width; + uint32_t fb_stride; + uint32_t fb_mask_red; + uint32_t fb_mask_green; + uint32_t fb_mask_blue; + uint32_t fb_mask_reserved; }; #endif /* !_MACHINE_METADATA_H_ */ Modified: stable/11/sys/boot/Makefile ============================================================================== --- stable/11/sys/boot/Makefile Sun Feb 11 20:47:38 2018 (r329139) +++ stable/11/sys/boot/Makefile Sun Feb 11 20:58:00 2018 (r329140) @@ -13,10 +13,8 @@ SUBDIR+= man .include -# Pick the machine-dependent subdir based on the target architecture. -ADIR= ${MACHINE:S/powerpc64/powerpc/} -.if exists(${.CURDIR}/${ADIR}/.) -SUBDIR+= ${ADIR} +.if exists(${.CURDIR}/${MACHINE}/.) +SUBDIR+= ${MACHINE} .endif .include Modified: stable/11/sys/boot/Makefile.amd64 ============================================================================== --- stable/11/sys/boot/Makefile.amd64 Sun Feb 11 20:47:38 2018 (r329139) +++ stable/11/sys/boot/Makefile.amd64 Sun Feb 11 20:58:00 2018 (r329140) @@ -1,16 +1,18 @@ # $FreeBSD$ -SUBDIR+= efi SUBDIR+= libsa32 -SUBDIR+= zfs -SUBDIR+= userboot - -.if !defined(LOADER_NO_GELI_SUPPORT) -SUBDIR+= geli +.if ${MK_ZFS} != "no" +SUBDIR+= zfs zfs32 .endif - .if ${MK_FORTH} != "no" SUBDIR+= ficl32 +.endif + +SUBDIR+= efi +SUBDIR+= userboot + +.if ${LOADER_GELI_SUPPORT:Uyes} == "yes" +SUBDIR+= geli .endif SUBDIR+= i386 Modified: stable/11/sys/boot/Makefile.arm ============================================================================== --- stable/11/sys/boot/Makefile.arm Sun Feb 11 20:47:38 2018 (r329139) +++ stable/11/sys/boot/Makefile.arm Sun Feb 11 20:58:00 2018 (r329140) @@ -3,5 +3,8 @@ .if ${MK_FDT} != "no" SUBDIR+= fdt .endif +.if ${MK_ZFS} != "no" +SUBDIR+= zfs +.endif SUBDIR+= efi uboot Modified: stable/11/sys/boot/Makefile.arm64 ============================================================================== --- stable/11/sys/boot/Makefile.arm64 Sun Feb 11 20:47:38 2018 (r329139) +++ stable/11/sys/boot/Makefile.arm64 Sun Feb 11 20:58:00 2018 (r329140) @@ -3,5 +3,8 @@ .if ${MK_FDT} != "no" SUBDIR+= fdt .endif +.if ${MK_ZFS} != "no" +SUBDIR+= zfs +.endif SUBDIR+= efi Modified: stable/11/sys/boot/Makefile.i386 ============================================================================== --- stable/11/sys/boot/Makefile.i386 Sun Feb 11 20:47:38 2018 (r329139) +++ stable/11/sys/boot/Makefile.i386 Sun Feb 11 20:58:00 2018 (r329140) @@ -1,9 +1,10 @@ # $FreeBSD$ -SUBDIR+= efi -SUBDIR+= libsa32 -SUBDIR+= zfs - -.if !defined(LOADER_NO_GELI_SUPPORT) +.if ${LOADER_GELI_SUPPORT:Uyes} == "yes" SUBDIR+= geli .endif +.if ${MK_ZFS} != "no" +SUBDIR+= zfs +.endif + +SUBDIR+= efi Modified: stable/11/sys/boot/Makefile.inc ============================================================================== --- stable/11/sys/boot/Makefile.inc Sun Feb 11 20:47:38 2018 (r329139) +++ stable/11/sys/boot/Makefile.inc Sun Feb 11 20:58:00 2018 (r329140) @@ -1,15 +1,9 @@ # $FreeBSD$ -.include +.include "defs.mk" .if !defined(__BOOT_MAKEFILE_INC__) __BOOT_MAKEFILE_INC__=${MFILE} - -SASRC=${SRCTOP}/sys/boot/libsa -# Normal Standalone library -LIBSA=${OBJTOP}/sys/boot/libsa/libsa.a -# Standalone library compiled for 32-bit version of the processor -LIBSA32=${OBJTOP}/sys/boot/libsa32/libsa32.a CFLAGS+=-I${SASRC} Modified: stable/11/sys/boot/Makefile.powerpc ============================================================================== --- stable/11/sys/boot/Makefile.powerpc Sun Feb 11 20:47:38 2018 (r329139) +++ stable/11/sys/boot/Makefile.powerpc Sun Feb 11 20:58:00 2018 (r329140) @@ -4,6 +4,5 @@ SUBDIR+= fdt .endif -SUBDIR+= libsa32 SUBDIR+= ofw SUBDIR+= uboot Modified: stable/11/sys/boot/Makefile.sparc64 ============================================================================== --- stable/11/sys/boot/Makefile.sparc64 Sun Feb 11 20:47:38 2018 (r329139) +++ stable/11/sys/boot/Makefile.sparc64 Sun Feb 11 20:58:00 2018 (r329140) @@ -1,4 +1,6 @@ # $FreeBSD$ SUBDIR+= ofw +.if ${MK_ZFS} != "no" SUBDIR+= zfs +.endif Copied: stable/11/sys/boot/arm/loader/loader.conf (from r329139, stable/11/sys/boot/arm/uboot/loader.conf) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/sys/boot/arm/loader/loader.conf Sun Feb 11 20:58:00 2018 (r329140, copy of r329139, stable/11/sys/boot/arm/uboot/loader.conf) @@ -0,0 +1,13 @@ +# This is defaults/loader.conf for ARM, containing defaults for loader(8). +# Do not modify the contents of this file, instead put your customizations +# into /boot/loader.conf or /boot/loader.conf.local +# $FreeBSD$ + +autoboot_delay=10 +bootfile="kernel" # Kernel name (possibly absolute path) +kernel="kernel" # /boot sub-directory containing kernel and modules +loader_conf_files="/boot/loader.conf /boot/loader.conf.local" +module_path="/boot/kernel;/boot/modules;/boot/dtb;/boot/overlays" +nextboot_conf="/boot/nextboot.conf" +nextboot_enable="NO" +verbose_loading="NO" Modified: stable/11/sys/boot/arm/uboot/Makefile ============================================================================== --- stable/11/sys/boot/arm/uboot/Makefile Sun Feb 11 20:47:38 2018 (r329139) +++ stable/11/sys/boot/arm/uboot/Makefile Sun Feb 11 20:58:00 2018 (r329140) @@ -1,11 +1,20 @@ # $FreeBSD$ -.include +LOADER_UFS_SUPPORT?= yes +LOADER_CD9660_SUPPORT?= no +LOADER_MSDOS_SUPPORT?= no +LOADER_EXT2FS_SUPPORT?= no +LOADER_NET_SUPPORT?= yes +LOADER_NFS_SUPPORT?= yes +LOADER_TFTP_SUPPORT?= no +LOADER_GZIP_SUPPORT?= no +LOADER_BZIP2_SUPPORT?= no -FILES= ubldr ubldr.bin +.include +FILES+= ubldr ubldr.bin + NEWVERSWHAT= "U-Boot loader" ${MACHINE_ARCH} -BINDIR?= /boot INSTALLFLAGS= -b WARNS?= 1 # Address at which ubldr will be loaded. @@ -19,113 +28,26 @@ SRCS= start.S conf.c self_reloc.c vers.c CWARNFLAGS.self_reloc.c+= -Wno-error=maybe-uninitialized .endif -.if !defined(LOADER_NO_DISK_SUPPORT) -LOADER_DISK_SUPPORT?= yes -.else -LOADER_DISK_SUPPORT= no -.endif -LOADER_UFS_SUPPORT?= yes -LOADER_CD9660_SUPPORT?= no -LOADER_EXT2FS_SUPPORT?= no -.if ${MK_NAND} != "no" -LOADER_NANDFS_SUPPORT?= yes -.else -LOADER_NANDFS_SUPPORT?= no -.endif -LOADER_NET_SUPPORT?= yes -LOADER_NFS_SUPPORT?= yes -LOADER_TFTP_SUPPORT?= no -LOADER_GZIP_SUPPORT?= no -LOADER_BZIP2_SUPPORT?= no -.if ${MK_FDT} != "no" -LOADER_FDT_SUPPORT= yes -.else -LOADER_FDT_SUPPORT= no -.endif +HELP_FILES+= help.uboot ${BOOTSRC}/fdt/help.fdt -.if ${LOADER_DISK_SUPPORT} == "yes" -CFLAGS+= -DLOADER_DISK_SUPPORT -.endif -.if ${LOADER_UFS_SUPPORT} == "yes" -CFLAGS+= -DLOADER_UFS_SUPPORT -.endif -.if ${LOADER_CD9660_SUPPORT} == "yes" -CFLAGS+= -DLOADER_CD9660_SUPPORT -.endif -.if ${LOADER_EXT2FS_SUPPORT} == "yes" -CFLAGS+= -DLOADER_EXT2FS_SUPPORT -.endif -.if ${LOADER_NANDFS_SUPPORT} == "yes" -CFLAGS+= -DLOADER_NANDFS_SUPPORT -.endif -.if ${LOADER_GZIP_SUPPORT} == "yes" -CFLAGS+= -DLOADER_GZIP_SUPPORT -.endif -.if ${LOADER_BZIP2_SUPPORT} == "yes" -CFLAGS+= -DLOADER_BZIP2_SUPPORT -.endif -.if ${LOADER_NET_SUPPORT} == "yes" -CFLAGS+= -DLOADER_NET_SUPPORT -.endif -.if ${LOADER_NFS_SUPPORT} == "yes" -CFLAGS+= -DLOADER_NFS_SUPPORT -.endif -.if ${LOADER_TFTP_SUPPORT} == "yes" -CFLAGS+= -DLOADER_TFTP_SUPPORT -.endif -.if ${LOADER_FDT_SUPPORT} == "yes" -CFLAGS+= -I${.CURDIR}/../../fdt -CFLAGS+= -I${.OBJDIR}/../../fdt -CFLAGS+= -DLOADER_FDT_SUPPORT -LIBUBOOT_FDT= ${.OBJDIR}/../../uboot/fdt/libuboot_fdt.a -LIBFDT= ${.OBJDIR}/../../fdt/libfdt.a -.endif - -.if ${MK_FORTH} != "no" -# Enable BootForth -BOOT_FORTH= yes -CFLAGS+= -DBOOT_FORTH -I${.CURDIR}/../../ficl -CFLAGS+= -I${.CURDIR}/../../ficl/arm -LIBFICL= ${.OBJDIR}/../../ficl/libficl.a -.endif - # Always add MI sources -.PATH: ${.CURDIR}/../../common -.include "${.CURDIR}/../../common/Makefile.inc" -CFLAGS+= -I${.CURDIR}/../../common -CFLAGS+= -I. +.include "${BOOTSRC}/loader.mk" -CLEANFILES+= loader.help - CFLAGS+= -ffreestanding -msoft-float LDFLAGS= -nostdlib -static -T ${.CURDIR}/ldscript.${MACHINE_CPUARCH} LDFLAGS+= -Wl,-znotext # Pull in common loader code -.PATH: ${.CURDIR}/../../uboot/common -.include "${.CURDIR}/../../uboot/common/Makefile.inc" -CFLAGS+= -I${.CURDIR}/../../uboot/common +.include "${BOOTSRC}/uboot.mk" -# U-Boot standalone support library -LIBUBOOT= ${.OBJDIR}/../../uboot/lib/libuboot.a -CFLAGS+= -I${.CURDIR}/../../uboot/lib -CFLAGS+= -I${.OBJDIR}/../../uboot/lib - CFLAGS+= -fPIC -# clang doesn't understand %D as a specifier to printf -NO_WERROR.clang= - DPADD= ${LIBFICL} ${LIBUBOOT} ${LIBFDT} ${LIBUBOOT_FDT} ${LIBSA} LDADD= ${LIBFICL} ${LIBUBOOT} ${LIBFDT} ${LIBUBOOT_FDT} ${LIBSA} OBJS+= ${SRCS:N*.h:R:S/$/.o/g} -loader.help: help.common help.uboot ${.CURDIR}/../../fdt/help.fdt - cat ${.ALLSRC} | \ - awk -f ${.CURDIR}/../../common/merge_help.awk > ${.TARGET} - ldscript.abs: echo "UBLDR_LOADADDR = ${UBLDR_LOADADDR};" >${.TARGET} @@ -144,16 +66,5 @@ ubldr.bin: ubldr.pie ${OBJCOPY} -S -O binary ubldr.pie ${.TARGET} CLEANFILES+= ldscript.abs ldscript.pie ubldr ubldr.pie ubldr.bin - -.if !defined(LOADER_ONLY) -.PATH: ${.CURDIR}/../../forth -.include "${.CURDIR}/../../forth/Makefile.inc" - -# Install loader.rc. -FILES+= loader.rc -# Put sample menu.rc on disk but don't enable it by default. -FILES+= menu.rc -FILESNAME_menu.rc= menu.rc.sample -.endif .include Modified: stable/11/sys/boot/common/disk.c ============================================================================== --- stable/11/sys/boot/common/disk.c Sun Feb 11 20:47:38 2018 (r329139) +++ stable/11/sys/boot/common/disk.c Sun Feb 11 20:58:00 2018 (r329140) @@ -89,6 +89,12 @@ ptblread(void *d, void *buf, size_t blocks, uint64_t o od = (struct open_disk *)dev->d_opendata; /* + * The strategy function assumes the offset is in units of 512 byte + * sectors. For larger sector sizes, we need to adjust the offset to + * match the actual sector size. + */ + offset *= (od->sectorsize / 512); + /* * As the GPT backup partition is located at the end of the disk, * to avoid reading past disk end, flag bcache not to use RA. */ Modified: stable/11/sys/boot/common/md.c ============================================================================== --- stable/11/sys/boot/common/md.c Sun Feb 11 20:47:38 2018 (r329139) +++ stable/11/sys/boot/common/md.c Sun Feb 11 20:58:00 2018 (r329140) @@ -73,7 +73,8 @@ struct devsw md_dev = { md_open, md_close, noioctl, - md_print + md_print, + NULL }; static int Copied and modified: stable/11/sys/boot/defs.mk (from r324654, head/sys/boot/defs.mk) ============================================================================== --- head/sys/boot/defs.mk Mon Oct 16 03:59:58 2017 (r324654, copy source) +++ stable/11/sys/boot/defs.mk Sun Feb 11 20:58:00 2018 (r329140) @@ -5,19 +5,38 @@ .if !defined(__BOOT_DEFS_MK__) __BOOT_DEFS_MK__=${MFILE} -BOOTDIR= ${SRCTOP}/sys/boot -FICLDIR= ${SRCTOP}/sys/boot/ficl -LDR_MI= ${BOOTDIR}/common -SASRC= ${SRCTOP}/sys/boot/libsa +BOOTSRC= ${SRCTOP}/sys/boot +EFISRC= ${BOOTSRC}/efi +EFIINC= ${EFISRC}/include +EFIINCMD= ${EFIINC}/${MACHINE} +FDTSRC= ${BOOTSRC}/fdt +FICLSRC= ${BOOTSRC}/ficl +LDRSRC= ${BOOTSRC}/common +SASRC= ${BOOTSRC}/libsa SYSDIR= ${SRCTOP}/sys +UBOOTSRC= ${BOOTSRC}/uboot +ZFSSRC= ${BOOTSRC}/zfs +BOOTOBJ= ${OBJTOP}/sys/boot + +# BINDIR is where we install +BINDIR?= /boot + # NB: The makefiles depend on these being empty when we don't build forth. .if ${MK_FORTH} != "no" -LIBFICL= ${OBJTOP}/sys/boot/ficl/libficl.a -LIBFICL32= ${OBJTOP}/sys/boot/ficl32/libficl.a +LIBFICL= ${BOOTOBJ}/ficl/libficl.a +.if ${MACHINE} == "i386" +LIBFICL32= ${LIBFICL} +.else +LIBFICL32= ${BOOTOBJ}/ficl32/libficl.a .endif -LIBSA= ${OBJTOP}/sys/boot/libsa/libsa.a -LIBSA32= ${OBJTOP}/sys/boot/libsa32/libsa32.a +.endif +LIBSA= ${BOOTOBJ}/libsa/libsa.a +.if ${MACHINE} == "i386" +LIBSA32= ${LIBSA} +.else +LIBSA32= ${BOOTOBJ}/libsa32/libsa32.a +.endif # Standard options: @@ -66,9 +85,87 @@ CFLAGS+= -DLOADER_GPT_SUPPORT .if ${LOADER_MBR_SUPPORT:Uyes} == "yes" CFLAGS+= -DLOADER_MBR_SUPPORT .endif -.if ${LOADER_GELI_SUPPORT:Uyes} == "yes" -CFLAGS+= -DLOADER_GELI_SUPPORT + +# GELI Support, with backward compat hooks +.if defined(HAVE_GELI) +.if defined(LOADER_NO_GELI_SUPPORT) +MK_LOADER_GELI=no +.warning "Please move from LOADER_NO_GELI_SUPPORT to WITHOUT_LOADER_GELI" .endif +.if defined(LOADER_GELI_SUPPORT) +MK_LOADER_GELI=yes +.warning "Please move from LOADER_GELI_SUPPORT to WITH_LOADER_GELI" .endif +.if ${MK_LOADER_GELI} == "yes" +CFLAGS+= -DLOADER_GELI_SUPPORT +CFLAGS+= -I${BOOTSRC}/geli +LIBGELIBOOT= ${BOOTOBJ}/geli/libgeliboot.a +.endif +.endif +.endif + +CFLAGS+= -I${SYSDIR} + +# All PowerPC builds are 32 bit. We have no 64-bit loaders on powerpc +# or powerpc64. +.if ${MACHINE_ARCH} == "powerpc64" +CFLAGS+= -m32 -mcpu=powerpc +.endif + +# For amd64, there's a bit of mixed bag. Some of the tree (i386, lib*32) is +# build 32-bit and some 64-bit (lib*, efi). Centralize all the 32-bit magic here +# and activate it when DO32 is explicitly defined to be 1. +.if ${MACHINE_ARCH} == "amd64" && ${DO32:U0} == 1 +CFLAGS+= -m32 -mcpu=i386 +# LD_FLAGS is passed directly to ${LD}, not via ${CC}: +LD_FLAGS+= -m elf_i386_fbsd +AFLAGS+= --32 +.endif + +# Make sure we use the machine link we're about to create +CFLAGS+=-I. + +_ILINKS=machine +.if ${MACHINE} != ${MACHINE_CPUARCH} && ${MACHINE} != "arm64" +_ILINKS+=${MACHINE_CPUARCH} +.endif +.if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64" +_ILINKS+=x86 +.endif +CLEANFILES+=${_ILINKS} + +all: ${PROG} + +beforedepend: ${_ILINKS} +beforebuild: ${_ILINKS} + +# Ensure that the links exist without depending on it when it exists which +# causes all the modules to be rebuilt when the directory pointed to changes. +.for _link in ${_ILINKS} +.if !exists(${.OBJDIR}/${_link}) +${OBJS}: ${_link} +.endif +.endfor + +.NOPATH: ${_ILINKS} + +${_ILINKS}: + @case ${.TARGET} in \ + machine) \ + if [ ${DO32:U0} -eq 0 ]; then \ + path=${SYSDIR}/${MACHINE}/include ; \ + else \ + path=${SYSDIR}/${MACHINE:C/amd64/i386/}/include ; \ + fi ;; \ + *) \ + path=${SYSDIR}/${.TARGET:T}/include ;; \ + esac ; \ + path=`(cd $$path && /bin/pwd)` ; \ + ${ECHO} ${.TARGET:T} "->" $$path ; \ + ln -fhs $$path ${.TARGET:T} + +# For loader implementations, we generate a loader.help file. This can be suppressed by +# setting HELP_FILES to nothing. +HELP_FILES= ${LDRSRC}/help.common .endif # __BOOT_DEFS_MK__ Modified: stable/11/sys/boot/efi/Makefile ============================================================================== --- stable/11/sys/boot/efi/Makefile Sun Feb 11 20:47:38 2018 (r329139) +++ stable/11/sys/boot/efi/Makefile Sun Feb 11 20:58:00 2018 (r329140) @@ -1,6 +1,6 @@ # $FreeBSD$ -.include +.include # In-tree GCC does not support __attribute__((ms_abi)), but gcc newer # than 4.5 supports it. Modified: stable/11/sys/boot/efi/Makefile.inc ============================================================================== --- stable/11/sys/boot/efi/Makefile.inc Sun Feb 11 20:47:38 2018 (r329139) +++ stable/11/sys/boot/efi/Makefile.inc Sun Feb 11 20:58:00 2018 (r329140) @@ -1,7 +1,5 @@ # $FreeBSD$ -BINDIR?= /boot - .if ${MACHINE_CPUARCH} == "i386" CFLAGS+= -march=i386 CFLAGS+= -mno-aes Modified: stable/11/sys/boot/efi/boot1/Makefile ============================================================================== --- stable/11/sys/boot/efi/boot1/Makefile Sun Feb 11 20:47:38 2018 (r329139) +++ stable/11/sys/boot/efi/boot1/Makefile Sun Feb 11 20:58:00 2018 (r329140) @@ -2,17 +2,15 @@ MAN= -.include "../Makefile.inc" +.include MK_SSP= no +MK_FORTH= no PROG= boot1.sym INTERNALPROG= -WARNS?= 3 +WARNS?= 6 -# Include bcache code. -HAVE_BCACHE= yes - # We implement a slightly non-standard %S in that it always takes a # CHAR16 that's common in UEFI-land instead of a wchar_t. This only # seems to matter on arm64 where wchar_t defaults to an int instead @@ -21,71 +19,46 @@ HAVE_BCACHE= yes CWARNFLAGS.boot1.c+= -Wno-format # Disable warnings that are currently incompatible with the zfs boot code -CWARNFLAGS.zfs.c += -Wno-incompatible-pointer-types-discards-qualifiers -CWARNFLAGS.zfs.c += -Wno-missing-variable-declarations -CWARNFLAGS.zfs.c += -Wno-array-bounds -CWARNFLAGS.zfs.c += -Wno-cast-align -CWARNFLAGS.zfs.c += -Wno-cast-qual -CWARNFLAGS.zfs.c += -Wno-missing-prototypes -CWARNFLAGS.zfs.c += -Wno-sign-compare -CWARNFLAGS.zfs.c += -Wno-unused-parameter -CWARNFLAGS.zfs.c += -Wno-unused-function -CWARNFLAGS.skein.c += -Wno-cast-align -.if ${COMPILER_TYPE} == "clang" -CWARNFLAGS.skein.c += -Wno-missing-variable-declarations -.else if ${COMPILER_TYPE} == "gcc" -CWARNFLAGS.skein.c += -Wno-missing-declarations -.endif +CWARNFLAGS.zfs_module.c += -Wno-array-bounds +CWARNFLAGS.zfs_module.c += -Wno-cast-align +CWARNFLAGS.zfs_module.c += -Wno-cast-qual +CWARNFLAGS.zfs_module.c += -Wno-missing-prototypes +CWARNFLAGS.zfs_module.c += -Wno-sign-compare +CWARNFLAGS.zfs_module.c += -Wno-unused-parameter +CWARNFLAGS.zfs_module.c += -Wno-unused-function # architecture-specific loader code -SRCS= boot1.c self_reloc.c start.S +SRCS= boot1.c self_reloc.c start.S ufs_module.c .if ${MK_ZFS} != "no" -.PATH: ${.CURDIR}/../../../crypto/skein -SRCS+= skein.c skein_block.c -# Do not unroll skein loops, reduce code size -CFLAGS+= -DSKEIN_LOOP=111 -.PATH: ${.CURDIR}/../../zfs -SRCS+= zfs.c +SRCS+= zfs_module.c +CFLAGS+= -I${ZFSSRC} +CFLAGS+= -I${SYSDIR}/cddl/boot/zfs +CFLAGS+= -DEFI_ZFS_BOOT +LIBZFSBOOT= ${BOOTOBJ}/zfs/libzfsboot.a .endif .if ${COMPILER_TYPE} == "gcc" && ${COMPILER_VERSION} > 40201 CWARNFLAGS.self_reloc.c+= -Wno-error=maybe-uninitialized .endif -# Always add MI sources -.PATH: ${.CURDIR}/../../common -.include "${.CURDIR}/../../common/Makefile.inc" -CFLAGS+= -I${.CURDIR}/../../common - -.PATH: ${.CURDIR}/arch/${MACHINE} - -CFLAGS+= -I. -CFLAGS+= -I${.CURDIR}/../include -CFLAGS+= -I${.CURDIR}/../include/${MACHINE} -CFLAGS+= -I${.CURDIR}/../../../contrib/dev/acpica/include -CFLAGS+= -I${.CURDIR}/../../.. +CFLAGS+= -I${EFIINC} +CFLAGS+= -I${EFIINCMD} +CFLAGS+= -I${SYSDIR}/contrib/dev/acpica/include CFLAGS+= -DEFI_UFS_BOOT .ifdef(EFI_DEBUG) CFLAGS+= -DEFI_DEBUG .endif -.if ${MK_ZFS} != "no" -CFLAGS+= -I${.CURDIR}/../../zfs/ -CFLAGS+= -I${.CURDIR}/../../../cddl/boot/zfs/ -CFLAGS+= -I${.CURDIR}/../../../crypto/skein -CFLAGS+= -DEFI_ZFS_BOOT -.endif - # Always add MI sources and REGULAR efi loader bits -.PATH: ${.CURDIR}/../loader/arch/${MACHINE} -.PATH: ${.CURDIR}/../loader -.PATH: ${.CURDIR}/../../common -CFLAGS+= -I${.CURDIR}/../../common +.PATH: ${EFISRC}/loader/arch/${MACHINE} +.PATH: ${EFISRC}/loader +.PATH: ${LDRSRC} +CFLAGS+= -I${LDRSRC} FILES= boot1.efi boot1.efifat FILESMODE_boot1.efi= ${BINMODE} -LDSCRIPT= ${.CURDIR}/../loader/arch/${MACHINE}/ldscript.${MACHINE} +LDSCRIPT= ${EFISRC}/loader/arch/${MACHINE}/ldscript.${MACHINE} LDFLAGS+= -Wl,-T${LDSCRIPT},-Bsymbolic,-znotext -shared .if ${MACHINE_CPUARCH} == "aarch64" @@ -96,15 +69,15 @@ CFLAGS+= -fPIC LDFLAGS+= -Wl,-znocombreloc .endif -LIBEFI= ${.OBJDIR}/../libefi/libefi.a +LIBEFI= ${BOOTOBJ}/efi/libefi/libefi.a # # Add libstand for the runtime functions used by the compiler - for example # __aeabi_* (arm) or __divdi3 (i386). # as well as required string and memory functions for all platforms. # -DPADD+= ${LIBEFI} ${LIBSA} -LDADD+= ${LIBEFI} ${LIBSA} +DPADD+= ${LIBEFI} ${LIBZFSBOOT} ${LIBSA} +LDADD+= ${LIBEFI} ${LIBZFSBOOT} ${LIBSA} DPADD+= ${LDSCRIPT} @@ -130,7 +103,7 @@ boot1.efi: ${PROG} SOURCE_DATE_EPOCH=${SOURCE_DATE_EPOCH} \ ${OBJCOPY} -j .peheader -j .text -j .sdata -j .data \ -j .dynamic -j .dynsym -j .rel.dyn \ - -j .rela.dyn -j .reloc -j .eh_frame -j set_Xcommand_set \ + -j .rela.dyn -j .reloc -j .eh_frame \ --output-target=${EFI_TARGET} ${.ALLSRC} ${.TARGET} boot1.o: ${SASRC}/ufsread.c @@ -151,21 +124,6 @@ boot1.efifat: boot1.efi xz -d -c ${.CURDIR}/fat-${MACHINE}.tmpl.xz > ${.TARGET} ${DD} if=${.ALLSRC} of=${.TARGET} seek=${BOOT1_OFFSET} conv=notrunc -CLEANFILES= boot1.efi boot1.efifat +CLEANFILES+= boot1.efi boot1.efifat .include - -beforedepend ${OBJS}: machine - -CLEANFILES+= machine - -machine: .NOMETA - ln -sf ${.CURDIR}/../../../${MACHINE}/include machine - -.if ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_CPUARCH} == "i386" -beforedepend ${OBJS}: x86 -CLEANFILES+= x86 - -x86: .NOMETA - ln -sf ${.CURDIR}/../../../x86/include x86 -.endif Modified: stable/11/sys/boot/efi/boot1/boot1.c ============================================================================== --- stable/11/sys/boot/efi/boot1/boot1.c Sun Feb 11 20:47:38 2018 (r329139) +++ stable/11/sys/boot/efi/boot1/boot1.c Sun Feb 11 20:58:00 2018 (r329140) @@ -23,179 +23,61 @@ __FBSDID("$FreeBSD$"); #include -#include #include #include #include -#include #include -#include -#include #include -#ifdef EFI_ZFS_BOOT -#include -#endif typedef CHAR16 efi_char; #include -#include - -#include "efi_drivers.h" -#include "efizfs.h" +#include "boot_module.h" #include "paths.h" static void efi_panic(EFI_STATUS s, const char *fmt, ...) __dead2 __printflike(2, 3); -#ifdef EFI_DEBUG -#define DPRINTF(fmt, args...) printf(fmt, ##args) -#define DSTALL(d) BS->Stall(d) -#else -#define DPRINTF(fmt, ...) {} -#define DSTALL(d) {} -#endif -struct arch_switch archsw; /* MI/MD interface boundary */ - -static const efi_driver_t *efi_drivers[] = { - NULL -}; - -extern struct console efi_console; -#if defined(__amd64__) || defined(__i386__) -extern struct console comconsole; -extern struct console nullconsole; -#endif - +static const boot_module_t *boot_modules[] = +{ #ifdef EFI_ZFS_BOOT -uint64_t pool_guid; + &zfs_module, #endif - -struct fs_ops *file_system[] = { -#ifdef EFI_ZFS_BOOT - &zfs_fsops, -#endif - &dosfs_fsops, #ifdef EFI_UFS_BOOT - &ufs_fsops, + &ufs_module #endif - &cd9660_fsops, - &nfs_fsops, - &gzipfs_fsops, - &bzipfs_fsops, - NULL }; -struct devsw *devsw[] = { - &efipart_hddev, - &efipart_fddev, - &efipart_cddev, -#ifdef EFI_ZFS_BOOT - &zfs_dev, -#endif - NULL -}; - -struct console *consoles[] = { - &efi_console, - NULL -}; - -static EFI_LOADED_IMAGE *boot_image; -static EFI_DEVICE_PATH *imgpath; -static EFI_DEVICE_PATH *imgprefix; - -/* Definitions we don't actually need for boot, but we need to define - * to make the linker happy. - */ -struct file_format *file_formats[] = { NULL }; - -struct netif_driver *netif_drivers[] = { NULL }; - -static int -efi_autoload(void) -{ - printf("******** Boot block should not call autoload\n"); - return (-1); -} - -static ssize_t -efi_copyin(const void *src __unused, vm_offset_t dest __unused, - const size_t len __unused) -{ - printf("******** Boot block should not call copyin\n"); - return (-1); -} - -static ssize_t -efi_copyout(vm_offset_t src __unused, void *dest __unused, - const size_t len __unused) -{ - printf("******** Boot block should not call copyout\n"); - return (-1); -} - -static ssize_t -efi_readin(int fd __unused, vm_offset_t dest __unused, - const size_t len __unused) -{ - printf("******** Boot block should not call readin\n"); - return (-1); -} - +#define NUM_BOOT_MODULES nitems(boot_modules) /* The initial number of handles used to query EFI for partitions. */ #define NUM_HANDLES_INIT 24 +static EFI_GUID BlockIoProtocolGUID = BLOCK_IO_PROTOCOL; static EFI_GUID DevicePathGUID = DEVICE_PATH_PROTOCOL; static EFI_GUID LoadedImageGUID = LOADED_IMAGE_PROTOCOL; +static EFI_GUID ConsoleControlGUID = EFI_CONSOLE_CONTROL_PROTOCOL_GUID; static EFI_GUID FreeBSDBootVarGUID = FREEBSD_BOOT_VAR_GUID; -static EFI_STATUS -do_load(const char *filepath, void **bufp, size_t *bufsize) +/* + * Provide Malloc / Free backed by EFIs AllocatePool / FreePool which ensures + * memory is correctly aligned avoiding EFI_INVALID_PARAMETER returns from + * EFI methods. + */ +void * +Malloc(size_t len, const char *file __unused, int line __unused) { - struct stat st; - void *buf = NULL; - int fd, err; - size_t fsize, remaining; - ssize_t readsize; + void *out; - if ((fd = open(filepath, O_RDONLY)) < 0) { - return (ENOTSUP); - } + if (BS->AllocatePool(EfiLoaderData, len, &out) == EFI_SUCCESS) + return (out); - if ((err = fstat(fd, &st)) != 0) { - goto close_file; - } + return (NULL); +} - fsize = st.st_size; - - if ((buf = malloc(fsize)) == NULL) { - err = ENOMEM; - goto close_file; - } - - remaining = fsize; - - do { - if ((readsize = read(fd, buf, fsize)) < 0) { - err = (-readsize); - goto free_buf; - } - - remaining -= readsize; - } while(remaining != 0); - - close(fd); - *bufsize = st.st_size; - *bufp = buf; - - close_file: - close(fd); - - return errno_to_efi_status(err); - - free_buf: - free(buf); - goto close_file; +void +Free(void *buf, const char *file __unused, int line __unused) +{ + if (buf != NULL) + (void)BS->FreePool(buf); } static EFI_STATUS @@ -215,275 +97,98 @@ efi_setenv_freebsd_wcs(const char *varname, CHAR16 *va return (rv); } -static int -probe_fs(const char *filepath) +/* + * nodes_match returns TRUE if the imgpath isn't NULL and the nodes match, + * FALSE otherwise. + */ +static BOOLEAN +nodes_match(EFI_DEVICE_PATH *imgpath, EFI_DEVICE_PATH *devpath) { - int fd; + size_t len; - if ((fd = open(filepath, O_RDONLY)) < 0) { - return (ENOTSUP); - } + if (imgpath == NULL || imgpath->Type != devpath->Type || + imgpath->SubType != devpath->SubType) + return (FALSE); - close(fd); + len = DevicePathNodeLength(imgpath); + if (len != DevicePathNodeLength(devpath)) + return (FALSE); - return (0); + return (memcmp(imgpath, devpath, (size_t)len) == 0); } -static int -probe_dev(struct devsw *dev, int unit, const char *filepath) +/* + * device_paths_match returns TRUE if the imgpath isn't NULL and all nodes + * in imgpath and devpath match up to their respective occurrences of a + * media node, FALSE otherwise. + */ +static BOOLEAN +device_paths_match(EFI_DEVICE_PATH *imgpath, EFI_DEVICE_PATH *devpath) { - struct devdesc currdev; - char *devname; - int err; - currdev.d_dev = dev; - currdev.d_type = currdev.d_dev->dv_type; - currdev.d_unit = unit; - currdev.d_opendata = NULL; - devname = efi_fmtdev(&currdev); + if (imgpath == NULL) + return (FALSE); - env_setenv("currdev", EV_VOLATILE, devname, efi_setcurrdev, - env_nounset); + while (!IsDevicePathEnd(imgpath) && !IsDevicePathEnd(devpath)) { + if (IsDevicePathType(imgpath, MEDIA_DEVICE_PATH) && + IsDevicePathType(devpath, MEDIA_DEVICE_PATH)) + return (TRUE); - err = probe_fs(filepath); + if (!nodes_match(imgpath, devpath)) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Sun Feb 11 21:28:09 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 576CDF19D2F; Sun, 11 Feb 2018 21:28:09 +0000 (UTC) (envelope-from byond.lenox@gmail.com) Received: from mail-lf0-f48.google.com (mail-lf0-f48.google.com [209.85.215.48]) (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 B78566C148; Sun, 11 Feb 2018 21:28:08 +0000 (UTC) (envelope-from byond.lenox@gmail.com) Received: by mail-lf0-f48.google.com with SMTP id j193so1988593lfe.0; Sun, 11 Feb 2018 13:28:08 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=6fpPz9WC9lbJ1aXiyn2ZuvYXwQPfTT2Y3CjPbyW/Axk=; b=V4M8A3Zjugo7zi+WD/56Iz1N3nN/HBBQDFG6GnBxvH3uDotPz2D994ye5Y1KH1Ped5 c8ouCkmJNU/ukpZsZaTtp79fNrVI26fBLemdBMVPCT/jRRS2Bc6jVzjI0ggywtte0FO6 BQbyA074t94t2/lFYbW48f57Uk6ALQXtQnLAYByO8yiuKoRgumKI41mAM4c3mIKYBviv uKk6XxSZDj9c+becAyTwTq91gj8eYfmYiBSr1HZGaO7VCXAqs/31LL0vBncqLs0hBF6X S5CvT3lF4JWc/ssb9y6CGNwZZwD+kkj/oECRGlC0kiEfhIWxdRYFF5uHGpBfwKb9sWS3 a3ug== X-Gm-Message-State: APf1xPCxkeu9w4P8JNBAX/V3toHAxYCEB76BOtyPQn9q4/Epprcc12xL vT2oAP0baeRZSJ2bar2wob2xBgrb X-Google-Smtp-Source: AH8x226Rymw8SkM9TsWSHBiOBKhEoeN4n1qIl5hXFsWu23nD9QjJ3ys62zyyLvapcC0Pa5N1SLslmw== X-Received: by 10.25.78.79 with SMTP id c76mr5525911lfb.98.1518384083596; Sun, 11 Feb 2018 13:21:23 -0800 (PST) Received: from mail-lf0-f44.google.com (mail-lf0-f44.google.com. [209.85.215.44]) by smtp.gmail.com with ESMTPSA id a197sm1408789lfe.88.2018.02.11.13.21.23 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 11 Feb 2018 13:21:23 -0800 (PST) Received: by mail-lf0-f44.google.com with SMTP id i24so14796288lfc.7; Sun, 11 Feb 2018 13:21:23 -0800 (PST) X-Received: by 10.46.23.156 with SMTP id 28mr3444223ljx.29.1518384083153; Sun, 11 Feb 2018 13:21:23 -0800 (PST) MIME-Version: 1.0 Received: by 10.46.106.8 with HTTP; Sun, 11 Feb 2018 13:21:02 -0800 (PST) In-Reply-To: <201802112058.w1BKw0xv046842@repo.freebsd.org> References: <201802112058.w1BKw0xv046842@repo.freebsd.org> From: Kyle Evans Date: Sun, 11 Feb 2018 15:21:02 -0600 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r329140 - in stable/11: . share/mk sys/arm/include sys/arm64/include sys/boot sys/boot/arm/at91 sys/boot/arm/at91/boot0 sys/boot/arm/at91/boot0iic sys/boot/arm/at91/boot0spi sys/boot/ar... To: src-committers Cc: svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Feb 2018 21:28:09 -0000 On Sun, Feb 11, 2018 at 2:58 PM, Kyle Evans wrote: > Author: kevans > Date: Sun Feb 11 20:58:00 2018 > New Revision: 329140 > URL: https://svnweb.freebsd.org/changeset/base/329140 > > Log: > MFC Loader Fixes 2017q4p6: r324649,r324650,r324651,r324652,r324653,r324654, > r324700,r324702,r324709,r324717,r324719,r324841,r324842,r324843,r324845, > r324850,r324876,r324877,r324878,r324879,r324880,r324881,r324883,r324980, > r324981,r324982,r324995,r325014,r325093,r325094,r325114,r325170,r325171, > r325172,r325173,r325174,r325175,r325176,r325248,r325286,r325310,r325332, > r325338,r325339,r325376,r325377,r325379,r325380,r325382,r325478,r325479, > r325480,r325482,r325483,r325484,r325485,r325556,r325641,r325681,r325685, > r325686,r325687,r325688,r325689,r325690,r325691,r325692,r325693,r325694, > r325743,r325744,r325748,r325775,r325779,r325780 > Apologies for all of the breakage/cutting teeth in the last couple hours of this process... A lot of things got moved around, and svn's handling of merging commits that moved things isn't great considering 'svn mv' does a 'copy + delete old'. All of the cherry-picking that we've done came back to haunt us as it tried to wipe out the cherry-picked bits in the process. We can now begin our downhill descent, as the next step is to move everything from sys/boot to stand/ except for sys/boot/fdt/dts and things should be easygoing from there. From owner-svn-src-all@freebsd.org Sun Feb 11 22:09:09 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 99DADF1D179; Sun, 11 Feb 2018 22:09:09 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CB0E96DF99; Sun, 11 Feb 2018 22:09:08 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 068BBCF5; Sun, 11 Feb 2018 22:09:08 +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 w1BM97df081914; Sun, 11 Feb 2018 22:09:07 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1BM97WQ081913; Sun, 11 Feb 2018 22:09:07 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201802112209.w1BM97WQ081913@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Sun, 11 Feb 2018 22:09:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329142 - head/share/man/man9 X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/share/man/man9 X-SVN-Commit-Revision: 329142 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Feb 2018 22:09:09 -0000 Author: cem Date: Sun Feb 11 22:09:07 2018 New Revision: 329142 URL: https://svnweb.freebsd.org/changeset/base/329142 Log: device_add_child.9: reference logical opposite, device_delete_child(9) Modified: head/share/man/man9/device_add_child.9 Modified: head/share/man/man9/device_add_child.9 ============================================================================== --- head/share/man/man9/device_add_child.9 Sun Feb 11 21:09:00 2018 (r329141) +++ head/share/man/man9/device_add_child.9 Sun Feb 11 22:09:07 2018 (r329142) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 15, 2017 +.Dd February 11, 2018 .Dt DEVICE_ADD_CHILD 9 .Os .Sh NAME @@ -126,6 +126,7 @@ The new device if successful, NULL otherwise. .Sh SEE ALSO .Xr BUS_ADD_CHILD 9 , .Xr device 9 , +.Xr device_delete_child 9 , .Xr device_find_child 9 , .Xr DEVICE_IDENTIFY 9 .Sh AUTHORS From owner-svn-src-all@freebsd.org Sun Feb 11 22:16:25 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2B141F1DAAB; Sun, 11 Feb 2018 22:16:25 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CFE206E539; Sun, 11 Feb 2018 22:16:24 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CA5B8E9F; Sun, 11 Feb 2018 22:16:24 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1BMGO2a086797; Sun, 11 Feb 2018 22:16:24 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1BMGOFZ086796; Sun, 11 Feb 2018 22:16:24 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201802112216.w1BMGOFZ086796@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sun, 11 Feb 2018 22:16:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r329143 - stable/11/sys/boot X-SVN-Group: stable-11 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: stable/11/sys/boot X-SVN-Commit-Revision: 329143 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Feb 2018 22:16:25 -0000 Author: kevans Date: Sun Feb 11 22:16:24 2018 New Revision: 329143 URL: https://svnweb.freebsd.org/changeset/base/329143 Log: Correct check: BOOT_FORTH is MK_FORTH in makefiles. This is a direct commit to stable/11. Modified: stable/11/sys/boot/loader.mk Modified: stable/11/sys/boot/loader.mk ============================================================================== --- stable/11/sys/boot/loader.mk Sun Feb 11 22:09:07 2018 (r329142) +++ stable/11/sys/boot/loader.mk Sun Feb 11 22:16:24 2018 (r329143) @@ -68,7 +68,7 @@ SRCS+= pnp.c .endif # Forth interpreter -.if defined(BOOT_FORTH) +.if defined(MK_FORTH) SRCS+= interp_forth.c .include "${BOOTSRC}/ficl.mk" .endif From owner-svn-src-all@freebsd.org Sun Feb 11 22:38:17 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 99A9CF1F7F9; Sun, 11 Feb 2018 22:38:17 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48D736F64E; Sun, 11 Feb 2018 22:38:17 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 43C531226; Sun, 11 Feb 2018 22:38:17 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1BMcHb2097049; Sun, 11 Feb 2018 22:38:17 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1BMcH9b097047; Sun, 11 Feb 2018 22:38:17 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201802112238.w1BMcH9b097047@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sun, 11 Feb 2018 22:38:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r329144 - stable/11/sys/boot X-SVN-Group: stable-11 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: stable/11/sys/boot X-SVN-Commit-Revision: 329144 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Feb 2018 22:38:18 -0000 Author: kevans Date: Sun Feb 11 22:38:16 2018 New Revision: 329144 URL: https://svnweb.freebsd.org/changeset/base/329144 Log: Re-sync loader.mk and ficl.mk to where they should be This is a direct commit to stable/11 due to changes lost during an MFC of a move. Modified: stable/11/sys/boot/ficl.mk stable/11/sys/boot/loader.mk Modified: stable/11/sys/boot/ficl.mk ============================================================================== --- stable/11/sys/boot/ficl.mk Sun Feb 11 22:16:24 2018 (r329143) +++ stable/11/sys/boot/ficl.mk Sun Feb 11 22:38:16 2018 (r329144) @@ -6,7 +6,7 @@ .if ${MACHINE_CPUARCH} == "amd64" && ${DO32:U0} == 1 FICL_CPUARCH= i386 -.elif ${MACHINE_ARCH} == "mips64" || ${MACHINE_ARCH} == "mips64el" +.elif ${MACHINE_ARCH:Mmips64*} != "" FICL_CPUARCH= mips64 .else FICL_CPUARCH= ${MACHINE_CPUARCH} Modified: stable/11/sys/boot/loader.mk ============================================================================== --- stable/11/sys/boot/loader.mk Sun Feb 11 22:16:24 2018 (r329143) +++ stable/11/sys/boot/loader.mk Sun Feb 11 22:38:16 2018 (r329144) @@ -1,6 +1,6 @@ # $FreeBSD$ -.PATH: ${SRCTOP}/sys/boot/common ${SRCTOP}/sys/boot/libsa +.include "defs.mk" .PATH: ${LDRSRC} ${BOOTSRC}/libsa @@ -24,29 +24,19 @@ SRCS+= load_elf32.c reloc_elf32.c SRCS+= load_elf64.c reloc_elf64.c .elif ${MACHINE_CPUARCH} == "sparc64" SRCS+= load_elf64.c reloc_elf64.c -.elif ${MACHINE_ARCH} == "mips64" || ${MACHINE_ARCH} == "mips64el" +.elif ${MACHINE_ARCH:Mmips64*} != "" SRCS+= load_elf64.c reloc_elf64.c .elif ${MACHINE} == "mips" SRCS+= load_elf32.c reloc_elf32.c .endif -.if defined(LOADER_NET_SUPPORT) -SRCS+= dev_net.c +.if ${LOADER_DISK_SUPPORT:Uyes} == "yes" +SRCS+= disk.c part.c .endif -.if !defined(LOADER_NO_DISK_SUPPORT) -SRCS+= disk.c part.c -CFLAGS+= -DLOADER_DISK_SUPPORT -.if !defined(LOADER_NO_GPT_SUPPORT) -CFLAGS+= -DLOADER_GPT_SUPPORT +.if ${LOADER_NET_SUPPORT:Uno} == "yes" +SRCS+= dev_net.c .endif -.if !defined(LOADER_NO_MBR_SUPPORT) -CFLAGS+= -DLOADER_MBR_SUPPORT -.endif -.endif -.if !defined(LOADER_NO_GELI_SUPPORT) -CFLAGS+= -DLOADER_GELI_SUPPORT -.endif .if defined(HAVE_BCACHE) SRCS+= bcache.c @@ -68,7 +58,7 @@ SRCS+= pnp.c .endif # Forth interpreter -.if defined(MK_FORTH) +.if ${MK_FORTH} != "no" SRCS+= interp_forth.c .include "${BOOTSRC}/ficl.mk" .endif From owner-svn-src-all@freebsd.org Sun Feb 11 23:46:37 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 26AE3F0155C; Sun, 11 Feb 2018 23:46:37 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9CDA57241D; Sun, 11 Feb 2018 23:46:35 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id w1BNkQpc041511; Sun, 11 Feb 2018 15:46:26 -0800 (PST) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id w1BNkPXc041510; Sun, 11 Feb 2018 15:46:25 -0800 (PST) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201802112346.w1BNkPXc041510@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r329126 - head/etc/devd In-Reply-To: <1518374549.32585.238.camel@freebsd.org> To: Ian Lepore Date: Sun, 11 Feb 2018 15:46:24 -0800 (PST) CC: cem@freebsd.org, src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Feb 2018 23:46:37 -0000 [ Charset ISO-8859-1 unsupported, converting... ] > On Sun, 2018-02-11 at 10:20 -0800, Conrad Meyer wrote: > > On Sun, Feb 11, 2018 at 8:35 AM, Ian Lepore wrote: > > > > > > Author: ian > > > Date: Sun Feb 11 16:35:56 2018 > > > New Revision: 329126 > > > URL: https://svnweb.freebsd.org/changeset/base/329126 > > > > > > Log: > > > ? Regenerate devd/usb.conf after the recent addition of several new > > > device IDs. > > > > > > Modified: > > > ? head/etc/devd/usb.conf > > > > If this file is machine generated and not an administrator > > configuration file, shouldn't it live in /usr/share instead of /etc, > > per hier(7)? > > > > Best, > > Conrad > > > > I wonder if that question would apply to all five files we put in > /etc/devd? ?It looks like they could be moved to /usr/share with > minimal fuss by adding that directory to the search list in > /etc/devd.conf. Moving this to /usr creates a cyclic issue in that you then need /usr to be mounted before devd can start and devd's /etc/rc.d file says: # PROVIDE: devd # REQUIRE: NETWORKING # BEFORE: mountcritremote # KEYWORD: nojail In the diskless and nfs shared /usr worlds devd wants to start before /usr is mounted. > I'm agnostic about the value of moving them. ?Users can configure local > rules by modifying the existing devd.conf and files in devd/ and > dealing with mergemaster on updates, or by adding their own new files > in devd/. -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Mon Feb 12 00:07:30 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C5E2AF030A9 for ; Mon, 12 Feb 2018 00:07:30 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from pmta2.delivery6.ore.mailhop.org (pmta2.delivery6.ore.mailhop.org [54.200.129.228]) (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 534017330D for ; Mon, 12 Feb 2018 00:07:30 +0000 (UTC) (envelope-from ian@freebsd.org) X-MHO-User: a5c25af7-0f88-11e8-b951-f99fef315fd9 X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 67.177.211.60 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [67.177.211.60]) by outbound2.ore.mailhop.org (Halon) with ESMTPSA id a5c25af7-0f88-11e8-b951-f99fef315fd9; Mon, 12 Feb 2018 00:07:01 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id w1C07L9O033052; Sun, 11 Feb 2018 17:07:21 -0700 (MST) (envelope-from ian@freebsd.org) Message-ID: <1518394041.32585.240.camel@freebsd.org> Subject: Re: svn commit: r329137 - in head/sys/dev: mpr mps From: Ian Lepore To: Scott Long , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Sun, 11 Feb 2018 17:07:21 -0700 In-Reply-To: <201802112015.w1BKFlkh026585@repo.freebsd.org> References: <201802112015.w1BKFlkh026585@repo.freebsd.org> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.18.5.1 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Feb 2018 00:07:30 -0000 On Sun, 2018-02-11 at 20:15 +0000, Scott Long wrote: > Author: scottl > Date: Sun Feb 11 20:15:47 2018 > New Revision: 329137 > URL: https://svnweb.freebsd.org/changeset/base/329137 > > Log: >   Print out the shared memory queues during initialization >    >   Sponsored by: Netflix > > Modified: >   head/sys/dev/mpr/mpr.c >   head/sys/dev/mps/mps.c > FYI, I'm getting several errors like this building for i386... /b/staging/freebsd/head/src/sys/dev/mps/mps.c:1317:6: error: format specifies type 'unsigned long' but the argument has type 'bus_addr_t' (aka 'unsigned int') [-Werror,-Wformat]             sc->free_busaddr, fqsize);             ^~~~~~~~~~~~~~~~ /b/staging/freebsd/head/src/sys/dev/mps/mpsvar.h:664:39: note: expanded from macro 'mps_dprint'                 device_printf((sc)->mps_dev, msg, ##args);      \                                                     ^~~~ -- Ian From owner-svn-src-all@freebsd.org Mon Feb 12 01:08:47 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8073CF07788; Mon, 12 Feb 2018 01:08:47 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2C99E75834; Mon, 12 Feb 2018 01:08:47 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 26C972AF5; Mon, 12 Feb 2018 01:08:47 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1C18lgY072463; Mon, 12 Feb 2018 01:08:47 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1C18iU5072435; Mon, 12 Feb 2018 01:08:44 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201802120108.w1C18iU5072435@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Mon, 12 Feb 2018 01:08:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r329145 - in stable/11: . lib/libefivar release/powerpc release/tools share/examples/bootforth share/examples/etc share/man/man5 share/man/man7 share/man/man8 stand stand/arm stand/arm6... X-SVN-Group: stable-11 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in stable/11: . lib/libefivar release/powerpc release/tools share/examples/bootforth share/examples/etc share/man/man5 share/man/man7 share/man/man8 stand stand/arm stand/arm64 stand/common stand/efi ... X-SVN-Commit-Revision: 329145 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Feb 2018 01:08:48 -0000 Author: kevans Date: Mon Feb 12 01:08:44 2018 New Revision: 329145 URL: https://svnweb.freebsd.org/changeset/base/329145 Log: MFC r325834,r325997,326502: Move sys/boot to stand/ This is effectively a direct commit to stable/11, due to differences between stable/11 and head. Changes to DTS in sys/boot/fdt/dts were often accompanied by kernel changes. Many of these were also risc-v updates that likely had many more dependencies to MFC. Because of this, sys/boot/fdt/dts remains as-is while everything else in sys/boot relocates to stand/. r325834: Move sys/boot to stand. Fix all references to new location r325997: Remove empty directories. r326502: Document the sys/boot -> stand move in hier.7 and the top-level README. Added: stable/11/stand/ stable/11/stand/Makefile - copied unchanged from r329144, stable/11/sys/boot/Makefile stable/11/stand/Makefile.amd64 - copied unchanged from r329144, stable/11/sys/boot/Makefile.amd64 stable/11/stand/Makefile.arm - copied unchanged from r329144, stable/11/sys/boot/Makefile.arm stable/11/stand/Makefile.arm64 - copied unchanged from r329144, stable/11/sys/boot/Makefile.arm64 stable/11/stand/Makefile.i386 - copied unchanged from r329144, stable/11/sys/boot/Makefile.i386 stable/11/stand/Makefile.inc - copied unchanged from r329144, stable/11/sys/boot/Makefile.inc stable/11/stand/Makefile.mips - copied unchanged from r329144, stable/11/sys/boot/Makefile.mips stable/11/stand/Makefile.pc98 - copied unchanged from r329144, stable/11/sys/boot/Makefile.pc98 stable/11/stand/Makefile.powerpc - copied unchanged from r329144, stable/11/sys/boot/Makefile.powerpc stable/11/stand/Makefile.sparc64 - copied unchanged from r329144, stable/11/sys/boot/Makefile.sparc64 stable/11/stand/arm/ - copied from r329144, stable/11/sys/boot/arm/ stable/11/stand/arm64/ - copied from r329144, stable/11/sys/boot/arm64/ stable/11/stand/common/ - copied from r329144, stable/11/sys/boot/common/ stable/11/stand/defs.mk - copied, changed from r329144, stable/11/sys/boot/defs.mk stable/11/stand/efi/ - copied from r329144, stable/11/sys/boot/efi/ stable/11/stand/fdt/ stable/11/stand/fdt.mk - copied unchanged from r329144, stable/11/sys/boot/fdt.mk stable/11/stand/fdt/Makefile - copied unchanged from r329144, stable/11/sys/boot/fdt/Makefile stable/11/stand/fdt/Makefile.depend - copied unchanged from r329144, stable/11/sys/boot/fdt/Makefile.depend stable/11/stand/fdt/fdt_loader_cmd.c - copied unchanged from r329144, stable/11/sys/boot/fdt/fdt_loader_cmd.c stable/11/stand/fdt/fdt_platform.h - copied unchanged from r329144, stable/11/sys/boot/fdt/fdt_platform.h stable/11/stand/fdt/help.fdt - copied unchanged from r329144, stable/11/sys/boot/fdt/help.fdt stable/11/stand/ficl/ - copied from r329144, stable/11/sys/boot/ficl/ stable/11/stand/ficl.mk - copied unchanged from r329144, stable/11/sys/boot/ficl.mk stable/11/stand/ficl32/ - copied from r329144, stable/11/sys/boot/ficl32/ stable/11/stand/forth/ - copied from r329144, stable/11/sys/boot/forth/ stable/11/stand/geli/ - copied from r329144, stable/11/sys/boot/geli/ stable/11/stand/i386/ - copied from r329144, stable/11/sys/boot/i386/ stable/11/stand/kshim/ - copied from r329144, stable/11/sys/boot/kshim/ stable/11/stand/libsa/ - copied from r329144, stable/11/sys/boot/libsa/ stable/11/stand/libsa32/ - copied from r329144, stable/11/sys/boot/libsa32/ stable/11/stand/loader.mk - copied unchanged from r329144, stable/11/sys/boot/loader.mk stable/11/stand/man/ - copied from r329144, stable/11/sys/boot/man/ stable/11/stand/mips/ - copied from r329144, stable/11/sys/boot/mips/ stable/11/stand/ofw/ - copied from r329144, stable/11/sys/boot/ofw/ stable/11/stand/pc98/ - copied from r329144, stable/11/sys/boot/pc98/ stable/11/stand/powerpc/ - copied from r329144, stable/11/sys/boot/powerpc/ stable/11/stand/sparc64/ - copied from r329144, stable/11/sys/boot/sparc64/ stable/11/stand/uboot/ - copied from r329144, stable/11/sys/boot/uboot/ stable/11/stand/uboot.mk - copied unchanged from r329144, stable/11/sys/boot/uboot.mk stable/11/stand/usb/ - copied from r329144, stable/11/sys/boot/usb/ stable/11/stand/userboot/ - copied from r329144, stable/11/sys/boot/userboot/ stable/11/stand/zfs/ - copied from r329144, stable/11/sys/boot/zfs/ stable/11/stand/zfs32/ - copied from r329144, stable/11/sys/boot/zfs32/ Deleted: stable/11/stand/userboot/ficl/ stable/11/stand/userboot/libstand/ stable/11/stand/userboot/zfs/ stable/11/sys/boot/Makefile stable/11/sys/boot/Makefile.amd64 stable/11/sys/boot/Makefile.arm stable/11/sys/boot/Makefile.arm64 stable/11/sys/boot/Makefile.i386 stable/11/sys/boot/Makefile.inc stable/11/sys/boot/Makefile.mips stable/11/sys/boot/Makefile.pc98 stable/11/sys/boot/Makefile.powerpc stable/11/sys/boot/Makefile.sparc64 stable/11/sys/boot/arm/ stable/11/sys/boot/arm64/ stable/11/sys/boot/common/ stable/11/sys/boot/defs.mk stable/11/sys/boot/efi/ stable/11/sys/boot/fdt.mk stable/11/sys/boot/fdt/Makefile stable/11/sys/boot/fdt/Makefile.depend stable/11/sys/boot/fdt/fdt_loader_cmd.c stable/11/sys/boot/fdt/fdt_platform.h stable/11/sys/boot/fdt/help.fdt stable/11/sys/boot/ficl/ stable/11/sys/boot/ficl.mk stable/11/sys/boot/ficl32/ stable/11/sys/boot/forth/ stable/11/sys/boot/geli/ stable/11/sys/boot/i386/ stable/11/sys/boot/kshim/ stable/11/sys/boot/libsa/ stable/11/sys/boot/libsa32/ stable/11/sys/boot/loader.mk stable/11/sys/boot/man/ stable/11/sys/boot/mips/ stable/11/sys/boot/ofw/ stable/11/sys/boot/pc98/ stable/11/sys/boot/powerpc/ stable/11/sys/boot/sparc64/ stable/11/sys/boot/uboot/ stable/11/sys/boot/uboot.mk stable/11/sys/boot/usb/ stable/11/sys/boot/userboot/ stable/11/sys/boot/zfs/ stable/11/sys/boot/zfs32/ Modified: stable/11/MAINTAINERS stable/11/Makefile.inc1 stable/11/README stable/11/lib/libefivar/Makefile stable/11/release/powerpc/generate-hfs.sh stable/11/release/tools/vmimage.subr stable/11/share/examples/bootforth/README stable/11/share/examples/etc/make.conf stable/11/share/man/man5/make.conf.5 stable/11/share/man/man7/hier.7 stable/11/share/man/man8/diskless.8 stable/11/stand/forth/pnp.4th stable/11/stand/forth/support.4th stable/11/stand/i386/Makefile.inc stable/11/stand/pc98/Makefile.inc stable/11/sys/Makefile stable/11/sys/contrib/dev/acpica/acpica_prep.sh stable/11/tools/boot/universe.sh stable/11/tools/tools/bootparttest/Makefile stable/11/tools/tools/zfsboottest/Makefile stable/11/usr.sbin/bhyveload/Makefile Directory Properties: stable/11/ (props changed) Modified: stable/11/MAINTAINERS ============================================================================== --- stable/11/MAINTAINERS Sun Feb 11 22:38:16 2018 (r329144) +++ stable/11/MAINTAINERS Mon Feb 12 01:08:44 2018 (r329145) @@ -87,7 +87,7 @@ sh(1) jilles Pre-commit review requested. This also compiled in as builtins. share/mk imp, bapt, bdrewery, emaste, sjg Make is hard. share/mk/*.test.mk freebsd-testing,ngie (same list as share/mk too) Pre-commit review requested. -sys/boot/forth dteske Pre-commit review requested. +stand/forth dteske Pre-commit review requested. sys/compat/linuxkpi hselasky If in doubt, ask. sys/dev/e1000 erj Pre-commit phabricator review requested. sys/dev/ixgbe erj Pre-commit phabricator review requested. Modified: stable/11/Makefile.inc1 ============================================================================== --- stable/11/Makefile.inc1 Sun Feb 11 22:38:16 2018 (r329144) +++ stable/11/Makefile.inc1 Mon Feb 12 01:08:44 2018 (r329145) @@ -252,6 +252,9 @@ SUBDIR+=secure .if !defined(NO_SHARE) SUBDIR+=share .endif +.if ${MK_BOOT} != "no" +SUBDIR+=stand +.endif SUBDIR+=sys usr.bin usr.sbin .if ${MK_TESTS} != "no" SUBDIR+= tests @@ -1903,7 +1906,7 @@ _clang_libs= lib/clang _gcc= gnu/usr.bin/cc .endif .if ${MK_USB} != "no" -_usb_tools= sys/boot/usb/tools +_usb_tools= stand/usb/tools .endif cross-tools: .MAKE .PHONY Modified: stable/11/README ============================================================================== --- stable/11/README Sun Feb 11 22:38:16 2018 (r329144) +++ stable/11/README Mon Feb 12 01:08:44 2018 (r329145) @@ -66,6 +66,8 @@ secure Cryptographic libraries and commands. share Shared resources. +stand Boot loader sources. + sys Kernel sources. tests Regression tests which can be run by Kyua. See tests/README Modified: stable/11/lib/libefivar/Makefile ============================================================================== --- stable/11/lib/libefivar/Makefile Sun Feb 11 22:38:16 2018 (r329144) +++ stable/11/lib/libefivar/Makefile Mon Feb 12 01:08:44 2018 (r329145) @@ -26,7 +26,7 @@ .include -EFIBOOT=${SRCTOP}/sys/boot/efi +EFIBOOT=${SRCTOP}/stand/efi EDK2INC=${SRCTOP}/sys/contrib/edk2/Include .PATH: ${EFIBOOT}/libefi Modified: stable/11/release/powerpc/generate-hfs.sh ============================================================================== --- stable/11/release/powerpc/generate-hfs.sh Sun Feb 11 22:38:16 2018 (r329144) +++ stable/11/release/powerpc/generate-hfs.sh Mon Feb 12 01:08:44 2018 (r329145) @@ -32,7 +32,7 @@ cat > bootinfo.txt << EOF FreeBSD/powerpc bootloader FreeBSD - $FreeBSD: head/sys/boot/powerpc/boot1.chrp/bootinfo.txt 184490 2008-10 + $FreeBSD: head/stand/powerpc/boot1.chrp/bootinfo.txt 184490 2008-10 -31 00:52:31Z nwhitehorn $ Modified: stable/11/release/tools/vmimage.subr ============================================================================== --- stable/11/release/tools/vmimage.subr Sun Feb 11 22:38:16 2018 (r329144) +++ stable/11/release/tools/vmimage.subr Mon Feb 12 01:08:44 2018 (r329145) @@ -17,9 +17,9 @@ write_partition_layout() { _OBJDIR="$(make -C ${WORLDDIR} -V .OBJDIR)" _OBJDIR="$(realpath ${_OBJDIR})" if [ -d "${_OBJDIR%%/usr/src}/${TARGET}.${TARGET_ARCH}" ]; then - BOOTFILES="/${_OBJDIR%%/usr/src}/${TARGET}.${TARGET_ARCH}/usr/src/sys/boot" + BOOTFILES="/${_OBJDIR%%/usr/src}/${TARGET}.${TARGET_ARCH}/usr/src/stand" else - BOOTFILES="/${_OBJDIR}/sys/boot" + BOOTFILES="/${_OBJDIR}/stand" fi case "${TARGET}:${TARGET_ARCH}" in Modified: stable/11/share/examples/bootforth/README ============================================================================== --- stable/11/share/examples/bootforth/README Sun Feb 11 22:38:16 2018 (r329144) +++ stable/11/share/examples/bootforth/README Mon Feb 12 01:08:44 2018 (r329145) @@ -1,6 +1,6 @@ Here you can find some simple examples how to use BootFORTH (part of the new bootloader) together with terminal emulation code (available when -compiling /sys/boot/i386/libi386 with -DTERM_EMU). +compiling /stand/i386/libi386 with -DTERM_EMU). Normally, you can place the files in /boot as they are here, and they will be automatically loaded by /boot/loader. You must choose between boot.4th or Modified: stable/11/share/examples/etc/make.conf ============================================================================== --- stable/11/share/examples/etc/make.conf Sun Feb 11 22:38:16 2018 (r329144) +++ stable/11/share/examples/etc/make.conf Mon Feb 12 01:08:44 2018 (r329145) @@ -171,7 +171,7 @@ #BOOT_COMCONSOLE_SPEED= 115200 # # By default the 'pxeboot' loader retrieves the kernel via NFS. Defining -# this and recompiling /usr/src/sys/boot will cause it to retrieve the kernel +# this and recompiling /usr/src/stand will cause it to retrieve the kernel # via TFTP. This allows pxeboot to load a custom BOOTP diskless kernel yet # still mount the server's '/' (i.e. rather than load the server's kernel). # Modified: stable/11/share/man/man5/make.conf.5 ============================================================================== --- stable/11/share/man/man5/make.conf.5 Sun Feb 11 22:38:16 2018 (r329144) +++ stable/11/share/man/man5/make.conf.5 Mon Feb 12 01:08:44 2018 (r329145) @@ -369,7 +369,7 @@ By default the .Xr pxeboot 8 loader retrieves the kernel via NFS. Defining this and recompiling -.Pa /usr/src/sys/boot +.Pa /usr/src/stand will cause it to retrieve the kernel via TFTP. This allows .Xr pxeboot 8 @@ -380,7 +380,7 @@ rather than load the server's kernel. .It Va LOADER_FIREWIRE_SUPPORT .Pq Vt bool Defining this and recompiling -.Pa /usr/src/sys/boot/i386 +.Pa /usr/src/stand/i386 will add .Xr dcons 4 console driver to Modified: stable/11/share/man/man7/hier.7 ============================================================================== --- stable/11/share/man/man7/hier.7 Sun Feb 11 22:38:16 2018 (r329144) +++ stable/11/share/man/man7/hier.7 Mon Feb 12 01:08:44 2018 (r329145) @@ -28,7 +28,7 @@ .\" @(#)hier.7 8.1 (Berkeley) 6/5/93 .\" $FreeBSD$ .\" -.Dd January 15, 2018 +.Dd February 11, 2018 .Dt HIER 7 .Os .Sh NAME @@ -696,6 +696,8 @@ build directory for files in .It Pa share/ source for files in .Pa /usr/share +.It Pa stand/ +boot loader source code .It Pa sys/ kernel source code .Bl -tag -width "opencrypto/" -compact Modified: stable/11/share/man/man8/diskless.8 ============================================================================== --- stable/11/share/man/man8/diskless.8 Sun Feb 11 22:38:16 2018 (r329144) +++ stable/11/share/man/man8/diskless.8 Mon Feb 12 01:08:44 2018 (r329145) @@ -124,7 +124,7 @@ the .Nm machine, which may not be what you want to have happen. .Bd -literal -offset indent -cd /usr/src/sys/boot/i386 +cd /usr/src/stand/i386 make clean; make; make install cp /boot/pxeboot /tftpdir/ .Ed Copied: stable/11/stand/Makefile (from r329144, stable/11/sys/boot/Makefile) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/stand/Makefile Mon Feb 12 01:08:44 2018 (r329145, copy of r329144, stable/11/sys/boot/Makefile) @@ -0,0 +1,20 @@ +# $FreeBSD$ + +.include + +SUBDIR+= libsa +.if ${MK_FORTH} != "no" +# Build the add-in FORTH interpreter. +SUBDIR+= ficl +SUBDIR+= forth +.endif + +SUBDIR+= man + +.include + +.if exists(${.CURDIR}/${MACHINE}/.) +SUBDIR+= ${MACHINE} +.endif + +.include Copied: stable/11/stand/Makefile.amd64 (from r329144, stable/11/sys/boot/Makefile.amd64) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/stand/Makefile.amd64 Mon Feb 12 01:08:44 2018 (r329145, copy of r329144, stable/11/sys/boot/Makefile.amd64) @@ -0,0 +1,18 @@ +# $FreeBSD$ + +SUBDIR+= libsa32 +.if ${MK_ZFS} != "no" +SUBDIR+= zfs zfs32 +.endif +.if ${MK_FORTH} != "no" +SUBDIR+= ficl32 +.endif + +SUBDIR+= efi +SUBDIR+= userboot + +.if ${LOADER_GELI_SUPPORT:Uyes} == "yes" +SUBDIR+= geli +.endif + +SUBDIR+= i386 Copied: stable/11/stand/Makefile.arm (from r329144, stable/11/sys/boot/Makefile.arm) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/stand/Makefile.arm Mon Feb 12 01:08:44 2018 (r329145, copy of r329144, stable/11/sys/boot/Makefile.arm) @@ -0,0 +1,10 @@ +# $FreeBSD$ + +.if ${MK_FDT} != "no" +SUBDIR+= fdt +.endif +.if ${MK_ZFS} != "no" +SUBDIR+= zfs +.endif + +SUBDIR+= efi uboot Copied: stable/11/stand/Makefile.arm64 (from r329144, stable/11/sys/boot/Makefile.arm64) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/stand/Makefile.arm64 Mon Feb 12 01:08:44 2018 (r329145, copy of r329144, stable/11/sys/boot/Makefile.arm64) @@ -0,0 +1,10 @@ +# $FreeBSD$ + +.if ${MK_FDT} != "no" +SUBDIR+= fdt +.endif +.if ${MK_ZFS} != "no" +SUBDIR+= zfs +.endif + +SUBDIR+= efi Copied: stable/11/stand/Makefile.i386 (from r329144, stable/11/sys/boot/Makefile.i386) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/stand/Makefile.i386 Mon Feb 12 01:08:44 2018 (r329145, copy of r329144, stable/11/sys/boot/Makefile.i386) @@ -0,0 +1,10 @@ +# $FreeBSD$ + +.if ${LOADER_GELI_SUPPORT:Uyes} == "yes" +SUBDIR+= geli +.endif +.if ${MK_ZFS} != "no" +SUBDIR+= zfs +.endif + +SUBDIR+= efi Copied: stable/11/stand/Makefile.inc (from r329144, stable/11/sys/boot/Makefile.inc) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/stand/Makefile.inc Mon Feb 12 01:08:44 2018 (r329145, copy of r329144, stable/11/sys/boot/Makefile.inc) @@ -0,0 +1,37 @@ +# $FreeBSD$ + +.include "defs.mk" + +.if !defined(__BOOT_MAKEFILE_INC__) +__BOOT_MAKEFILE_INC__=${MFILE} + +CFLAGS+=-I${SASRC} + +SSP_CFLAGS= + +.if ${MACHINE_CPUARCH} == "arm" +# Do not generate movt/movw, because the relocation fixup for them does not +# translate to the -Bsymbolic -pie format required by self_reloc() in loader(8). +# Also, the fpu is not available in a standalone environment. +.if ${COMPILER_VERSION} < 30800 +CFLAGS.clang+= -mllvm -arm-use-movt=0 +.else +CFLAGS.clang+= -mno-movt +.endif +CFLAGS.clang+= -mfpu=none +.endif + +# The boot loader build uses dd status=none, where possible, for reproducible +# build output (since performance varies from run to run). Trouble is that +# option was recently (10.3) added to FreeBSD and is non-standard. Only use it +# when this test succeeds rather than require dd to be a bootstrap tool. +DD_NOSTATUS!=(dd status=none count=0 2> /dev/null && echo status=none) || true +DD=dd ${DD_NOSTATUS} + +.if ${MK_LOADER_FORCE_LE} != "no" +.if ${MACHINE_ARCH} == "powerpc64" +CFLAGS+= -mlittle-endian +.endif +.endif + +.endif Copied: stable/11/stand/Makefile.mips (from r329144, stable/11/sys/boot/Makefile.mips) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/stand/Makefile.mips Mon Feb 12 01:08:44 2018 (r329145, copy of r329144, stable/11/sys/boot/Makefile.mips) @@ -0,0 +1,7 @@ +# $FreeBSD$ + +.if ${MK_FDT} != "no" +SUBDIR+= fdt +.endif + +SUBDIR+= uboot Copied: stable/11/stand/Makefile.pc98 (from r329144, stable/11/sys/boot/Makefile.pc98) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/stand/Makefile.pc98 Mon Feb 12 01:08:44 2018 (r329145, copy of r329144, stable/11/sys/boot/Makefile.pc98) @@ -0,0 +1,3 @@ +# $FreeBSD$ + +SUBDIR+= libstand32 Copied: stable/11/stand/Makefile.powerpc (from r329144, stable/11/sys/boot/Makefile.powerpc) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/stand/Makefile.powerpc Mon Feb 12 01:08:44 2018 (r329145, copy of r329144, stable/11/sys/boot/Makefile.powerpc) @@ -0,0 +1,8 @@ +# $FreeBSD$ + +.if ${MK_FDT} != "no" +SUBDIR+= fdt +.endif + +SUBDIR+= ofw +SUBDIR+= uboot Copied: stable/11/stand/Makefile.sparc64 (from r329144, stable/11/sys/boot/Makefile.sparc64) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/stand/Makefile.sparc64 Mon Feb 12 01:08:44 2018 (r329145, copy of r329144, stable/11/sys/boot/Makefile.sparc64) @@ -0,0 +1,6 @@ +# $FreeBSD$ + +SUBDIR+= ofw +.if ${MK_ZFS} != "no" +SUBDIR+= zfs +.endif Copied and modified: stable/11/stand/defs.mk (from r329144, stable/11/sys/boot/defs.mk) ============================================================================== --- stable/11/sys/boot/defs.mk Sun Feb 11 22:38:16 2018 (r329144, copy source) +++ stable/11/stand/defs.mk Mon Feb 12 01:08:44 2018 (r329145) @@ -5,7 +5,7 @@ .if !defined(__BOOT_DEFS_MK__) __BOOT_DEFS_MK__=${MFILE} -BOOTSRC= ${SRCTOP}/sys/boot +BOOTSRC= ${SRCTOP}/stand EFISRC= ${BOOTSRC}/efi EFIINC= ${EFISRC}/include EFIINCMD= ${EFIINC}/${MACHINE} @@ -17,7 +17,7 @@ SYSDIR= ${SRCTOP}/sys UBOOTSRC= ${BOOTSRC}/uboot ZFSSRC= ${BOOTSRC}/zfs -BOOTOBJ= ${OBJTOP}/sys/boot +BOOTOBJ= ${OBJTOP}/stand # BINDIR is where we install BINDIR?= /boot Copied: stable/11/stand/fdt.mk (from r329144, stable/11/sys/boot/fdt.mk) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/stand/fdt.mk Mon Feb 12 01:08:44 2018 (r329145, copy of r329144, stable/11/sys/boot/fdt.mk) @@ -0,0 +1,9 @@ +# $FreeBSD$ + +.if ${MK_FDT} == "yes" +CFLAGS+= -I${FDTSRC} +CFLAGS+= -I${BOOTOBJ}/fdt +CFLAGS+= -I${SYSDIR}/contrib/libfdt +CFLAGS+= -DLOADER_FDT_SUPPORT +LIBFDT= ${BOOTOBJ}/fdt/libfdt.a +.endif Copied: stable/11/stand/fdt/Makefile (from r329144, stable/11/sys/boot/fdt/Makefile) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/stand/fdt/Makefile Mon Feb 12 01:08:44 2018 (r329145, copy of r329144, stable/11/sys/boot/fdt/Makefile) @@ -0,0 +1,28 @@ +# $FreeBSD$ + +.include + +.PATH: ${SYSDIR}/contrib/libfdt/ + +LIB= fdt +INTERNALLIB= + +# Vendor sources of libfdt. +SRCS+= fdt.c fdt_ro.c fdt_wip.c fdt_sw.c fdt_rw.c fdt_strerror.c \ + fdt_empty_tree.c fdt_addresses.c fdt_overlay.c + +# Loader's fdt commands extension sources. +SRCS+= fdt_loader_cmd.c + +CFLAGS+= -I${SYSDIR}/contrib/libfdt/ -I${LDRSRC} + +CFLAGS+= -ffreestanding + +.if ${MACHINE_CPUARCH} == "powerpc" || ${MACHINE_CPUARCH} == "arm" || ${MACHINE_CPUARCH} == "mips" +CFLAGS+= -msoft-float +.endif + +CFLAGS+= -Wformat -Wall + +.include +.include Copied: stable/11/stand/fdt/Makefile.depend (from r329144, stable/11/sys/boot/fdt/Makefile.depend) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/stand/fdt/Makefile.depend Mon Feb 12 01:08:44 2018 (r329145, copy of r329144, stable/11/sys/boot/fdt/Makefile.depend) @@ -0,0 +1,14 @@ +# $FreeBSD$ +# Autogenerated - do NOT edit! + +DIRDEPS = \ + include \ + include/xlocale \ + lib/libstand \ + + +.include + +.if ${DEP_RELDIR} == ${_DEP_RELDIR} +# local dependencies - needed for -jN in clean tree +.endif Copied: stable/11/stand/fdt/fdt_loader_cmd.c (from r329144, stable/11/sys/boot/fdt/fdt_loader_cmd.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/stand/fdt/fdt_loader_cmd.c Mon Feb 12 01:08:44 2018 (r329145, copy of r329144, stable/11/sys/boot/fdt/fdt_loader_cmd.c) @@ -0,0 +1,1796 @@ +/*- + * Copyright (c) 2009-2010 The FreeBSD Foundation + * All rights reserved. + * + * This software was developed by Semihalf under sponsorship from + * the FreeBSD Foundation. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include + +#include "bootstrap.h" +#include "fdt_platform.h" + +#ifdef DEBUG +#define debugf(fmt, args...) do { printf("%s(): ", __func__); \ + printf(fmt,##args); } while (0) +#else +#define debugf(fmt, args...) +#endif + +#define FDT_CWD_LEN 256 +#define FDT_MAX_DEPTH 12 + +#define FDT_PROP_SEP " = " + +#define COPYOUT(s,d,l) archsw.arch_copyout(s, d, l) +#define COPYIN(s,d,l) archsw.arch_copyin(s, d, l) + +#define FDT_STATIC_DTB_SYMBOL "fdt_static_dtb" + +#define CMD_REQUIRES_BLOB 0x01 + +/* Location of FDT yet to be loaded. */ +/* This may be in read-only memory, so can't be manipulated directly. */ +static struct fdt_header *fdt_to_load = NULL; +/* Location of FDT on heap. */ +/* This is the copy we actually manipulate. */ +static struct fdt_header *fdtp = NULL; +/* Size of FDT blob */ +static size_t fdtp_size = 0; +/* Location of FDT in kernel or module. */ +/* This won't be set if FDT is loaded from disk or memory. */ +/* If it is set, we'll update it when fdt_copy() gets called. */ +static vm_offset_t fdtp_va = 0; + +static int fdt_load_dtb(vm_offset_t va); +static void fdt_print_overlay_load_error(int err, const char *filename); + +static int fdt_cmd_nyi(int argc, char *argv[]); +static int fdt_load_dtb_overlays_string(const char * filenames); + +static int fdt_cmd_addr(int argc, char *argv[]); +static int fdt_cmd_mkprop(int argc, char *argv[]); +static int fdt_cmd_cd(int argc, char *argv[]); +static int fdt_cmd_hdr(int argc, char *argv[]); +static int fdt_cmd_ls(int argc, char *argv[]); +static int fdt_cmd_prop(int argc, char *argv[]); +static int fdt_cmd_pwd(int argc, char *argv[]); +static int fdt_cmd_rm(int argc, char *argv[]); +static int fdt_cmd_mknode(int argc, char *argv[]); +static int fdt_cmd_mres(int argc, char *argv[]); + +typedef int cmdf_t(int, char *[]); + +struct cmdtab { + const char *name; + cmdf_t *handler; + int flags; +}; + +static const struct cmdtab commands[] = { + { "addr", &fdt_cmd_addr, 0 }, + { "alias", &fdt_cmd_nyi, 0 }, + { "cd", &fdt_cmd_cd, CMD_REQUIRES_BLOB }, + { "header", &fdt_cmd_hdr, CMD_REQUIRES_BLOB }, + { "ls", &fdt_cmd_ls, CMD_REQUIRES_BLOB }, + { "mknode", &fdt_cmd_mknode, CMD_REQUIRES_BLOB }, + { "mkprop", &fdt_cmd_mkprop, CMD_REQUIRES_BLOB }, + { "mres", &fdt_cmd_mres, CMD_REQUIRES_BLOB }, + { "prop", &fdt_cmd_prop, CMD_REQUIRES_BLOB }, + { "pwd", &fdt_cmd_pwd, CMD_REQUIRES_BLOB }, + { "rm", &fdt_cmd_rm, CMD_REQUIRES_BLOB }, + { NULL, NULL } +}; + +static char cwd[FDT_CWD_LEN] = "/"; + +static vm_offset_t +fdt_find_static_dtb() +{ + Elf_Ehdr *ehdr; + Elf_Shdr *shdr; + Elf_Sym sym; + vm_offset_t strtab, symtab, fdt_start; + uint64_t offs; + struct preloaded_file *kfp; + struct file_metadata *md; + char *strp; + int i, sym_count; + + debugf("fdt_find_static_dtb()\n"); + + sym_count = symtab = strtab = 0; + strp = NULL; + + offs = __elfN(relocation_offset); + + kfp = file_findfile(NULL, NULL); + if (kfp == NULL) + return (0); + + /* Locate the dynamic symbols and strtab. */ + md = file_findmetadata(kfp, MODINFOMD_ELFHDR); + if (md == NULL) + return (0); + ehdr = (Elf_Ehdr *)md->md_data; + + md = file_findmetadata(kfp, MODINFOMD_SHDR); + if (md == NULL) + return (0); + shdr = (Elf_Shdr *)md->md_data; + + for (i = 0; i < ehdr->e_shnum; ++i) { + if (shdr[i].sh_type == SHT_DYNSYM && symtab == 0) { + symtab = shdr[i].sh_addr + offs; + sym_count = shdr[i].sh_size / sizeof(Elf_Sym); + } else if (shdr[i].sh_type == SHT_STRTAB && strtab == 0) { + strtab = shdr[i].sh_addr + offs; + } + } + + /* + * The most efficient way to find a symbol would be to calculate a + * hash, find proper bucket and chain, and thus find a symbol. + * However, that would involve code duplication (e.g. for hash + * function). So we're using simpler and a bit slower way: we're + * iterating through symbols, searching for the one which name is + * 'equal' to 'fdt_static_dtb'. To speed up the process a little bit, + * we are eliminating symbols type of which is not STT_NOTYPE, or(and) + * those which binding attribute is not STB_GLOBAL. + */ + fdt_start = 0; + while (sym_count > 0 && fdt_start == 0) { + COPYOUT(symtab, &sym, sizeof(sym)); + symtab += sizeof(sym); + --sym_count; + if (ELF_ST_BIND(sym.st_info) != STB_GLOBAL || + ELF_ST_TYPE(sym.st_info) != STT_NOTYPE) + continue; + strp = strdupout(strtab + sym.st_name); + if (strcmp(strp, FDT_STATIC_DTB_SYMBOL) == 0) + fdt_start = (vm_offset_t)sym.st_value + offs; + free(strp); + } + return (fdt_start); +} + +static int +fdt_load_dtb(vm_offset_t va) +{ + struct fdt_header header; + int err; + + debugf("fdt_load_dtb(0x%08jx)\n", (uintmax_t)va); + + COPYOUT(va, &header, sizeof(header)); + err = fdt_check_header(&header); + if (err < 0) { + if (err == -FDT_ERR_BADVERSION) { + snprintf(command_errbuf, sizeof(command_errbuf), + "incompatible blob version: %d, should be: %d", + fdt_version(fdtp), FDT_LAST_SUPPORTED_VERSION); + } else { + snprintf(command_errbuf, sizeof(command_errbuf), + "error validating blob: %s", fdt_strerror(err)); + } + return (1); + } + + /* + * Release previous blob + */ + if (fdtp) + free(fdtp); + + fdtp_size = fdt_totalsize(&header); + fdtp = malloc(fdtp_size); + + if (fdtp == NULL) { + command_errmsg = "can't allocate memory for device tree copy"; + return (1); + } + + fdtp_va = va; + COPYOUT(va, fdtp, fdtp_size); + debugf("DTB blob found at 0x%jx, size: 0x%jx\n", (uintmax_t)va, (uintmax_t)fdtp_size); + + return (0); +} + +int +fdt_load_dtb_addr(struct fdt_header *header) +{ + int err; + + debugf("fdt_load_dtb_addr(%p)\n", header); + + fdtp_size = fdt_totalsize(header); + err = fdt_check_header(header); + if (err < 0) { + snprintf(command_errbuf, sizeof(command_errbuf), + "error validating blob: %s", fdt_strerror(err)); + return (err); + } + free(fdtp); + if ((fdtp = malloc(fdtp_size)) == NULL) { + command_errmsg = "can't allocate memory for device tree copy"; + return (1); + } + + fdtp_va = 0; // Don't write this back into module or kernel. + bcopy(header, fdtp, fdtp_size); + return (0); +} + +int +fdt_load_dtb_file(const char * filename) +{ + struct preloaded_file *bfp, *oldbfp; + int err; + + debugf("fdt_load_dtb_file(%s)\n", filename); + + oldbfp = file_findfile(NULL, "dtb"); + + /* Attempt to load and validate a new dtb from a file. */ + if ((bfp = file_loadraw(filename, "dtb", 1)) == NULL) { + snprintf(command_errbuf, sizeof(command_errbuf), + "failed to load file '%s'", filename); + return (1); + } + if ((err = fdt_load_dtb(bfp->f_addr)) != 0) { + file_discard(bfp); + return (err); + } + + /* A new dtb was validated, discard any previous file. */ + if (oldbfp) + file_discard(oldbfp); + return (0); +} + +static int +fdt_load_dtb_overlay(const char * filename) +{ + struct preloaded_file *bfp; + struct fdt_header header; + int err; + + debugf("fdt_load_dtb_overlay(%s)\n", filename); + + /* Attempt to load and validate a new dtb from a file. FDT_ERR_NOTFOUND + * is normally a libfdt error code, but libfdt would actually return + * -FDT_ERR_NOTFOUND. We re-purpose the error code here to convey a + * similar meaning: the file itself was not found, which can still be + * considered an error dealing with FDT pieces. + */ + if ((bfp = file_loadraw(filename, "dtbo", 1)) == NULL) + return (FDT_ERR_NOTFOUND); + + COPYOUT(bfp->f_addr, &header, sizeof(header)); + err = fdt_check_header(&header); + + if (err < 0) { + file_discard(bfp); + return (err); + } + + return (0); +} + +static void +fdt_print_overlay_load_error(int err, const char *filename) +{ + + switch (err) { + case FDT_ERR_NOTFOUND: + printf("%s: failed to load file\n", filename); + break; + case -FDT_ERR_BADVERSION: + printf("%s: incompatible blob version: %d, should be: %d\n", + filename, fdt_version(fdtp), + FDT_LAST_SUPPORTED_VERSION); + break; + default: + /* libfdt errs are negative */ + if (err < 0) + printf("%s: error validating blob: %s\n", + filename, fdt_strerror(err)); + else + printf("%s: unknown load error\n", filename); + break; + } +} + +static int +fdt_load_dtb_overlays_string(const char * filenames) +{ + char *names; + char *name, *name_ext; + char *comaptr; + int err, namesz; + + debugf("fdt_load_dtb_overlays_string(%s)\n", filenames); + + names = strdup(filenames); + if (names == NULL) + return (1); + name = names; + do { + comaptr = strchr(name, ','); + if (comaptr) + *comaptr = '\0'; + err = fdt_load_dtb_overlay(name); + if (err == FDT_ERR_NOTFOUND) { + /* Allocate enough to append ".dtbo" */ + namesz = strlen(name) + 6; + name_ext = malloc(namesz); + if (name_ext == NULL) { + fdt_print_overlay_load_error(err, name); + name = comaptr + 1; + continue; + } + snprintf(name_ext, namesz, "%s.dtbo", name); + err = fdt_load_dtb_overlay(name_ext); + free(name_ext); + } + /* Catch error with either initial load or fallback load */ + if (err != 0) + fdt_print_overlay_load_error(err, name); + name = comaptr + 1; + } while(comaptr); + + free(names); + return (0); +} + +void +fdt_apply_overlays() +{ + struct preloaded_file *fp; + size_t max_overlay_size, next_fdtp_size; + size_t current_fdtp_size; + void *current_fdtp; + void *next_fdtp; + void *overlay; + int rv; + + if ((fdtp == NULL) || (fdtp_size == 0)) + return; + + max_overlay_size = 0; + for (fp = file_findfile(NULL, "dtbo"); fp != NULL; fp = fp->f_next) { + if (max_overlay_size < fp->f_size) + max_overlay_size = fp->f_size; + } + + /* Nothing to apply */ + if (max_overlay_size == 0) + return; + + overlay = malloc(max_overlay_size); + if (overlay == NULL) { + printf("failed to allocate memory for DTB blob with overlays\n"); + return; + } + current_fdtp = fdtp; + current_fdtp_size = fdtp_size; + for (fp = file_findfile(NULL, "dtbo"); fp != NULL; fp = fp->f_next) { + printf("applying DTB overlay '%s'\n", fp->f_name); + next_fdtp_size = current_fdtp_size + fp->f_size; + next_fdtp = malloc(next_fdtp_size); + if (next_fdtp == NULL) { + /* + * Output warning, then move on to applying other + * overlays in case this one is simply too large. + */ + printf("failed to allocate memory for overlay base\n"); + continue; + } + rv = fdt_open_into(current_fdtp, next_fdtp, next_fdtp_size); + if (rv != 0) { + free(next_fdtp); + printf("failed to open base dtb into overlay base\n"); + continue; + } + COPYOUT(fp->f_addr, overlay, fp->f_size); + /* Both overlay and next_fdtp may be modified in place */ + rv = fdt_overlay_apply(next_fdtp, overlay); + if (rv == 0) { + /* Rotate next -> current */ + if (current_fdtp != fdtp) + free(current_fdtp); + current_fdtp = next_fdtp; + current_fdtp_size = next_fdtp_size; + } else { + /* + * Assume here that the base we tried to apply on is + * either trashed or in an inconsistent state. Trying to + * load it might work, but it's better to discard it and + * play it safe. */ + free(next_fdtp); + printf("failed to apply overlay: %s\n", + fdt_strerror(rv)); + } + } + /* We could have failed to apply all overlays; then we do nothing */ + if (current_fdtp != fdtp) { + free(fdtp); + fdtp = current_fdtp; + fdtp_size = current_fdtp_size; + } + free(overlay); +} + +int +fdt_setup_fdtp() +{ + struct preloaded_file *bfp; + vm_offset_t va; + + debugf("fdt_setup_fdtp()\n"); + + /* If we already loaded a file, use it. */ + if ((bfp = file_findfile(NULL, "dtb")) != NULL) { + if (fdt_load_dtb(bfp->f_addr) == 0) { + printf("Using DTB from loaded file '%s'.\n", + bfp->f_name); + return (0); + } + } + + /* If we were given the address of a valid blob in memory, use it. */ + if (fdt_to_load != NULL) { + if (fdt_load_dtb_addr(fdt_to_load) == 0) { + printf("Using DTB from memory address %p.\n", + fdt_to_load); + return (0); + } + } + + if (fdt_platform_load_dtb() == 0) + return (0); + + /* If there is a dtb compiled into the kernel, use it. */ + if ((va = fdt_find_static_dtb()) != 0) { + if (fdt_load_dtb(va) == 0) { + printf("Using DTB compiled into kernel.\n"); + return (0); + } + } + + command_errmsg = "No device tree blob found!\n"; + return (1); +} + +#define fdt_strtovect(str, cellbuf, lim, cellsize) _fdt_strtovect((str), \ + (cellbuf), (lim), (cellsize), 0); + +/* Force using base 16 */ +#define fdt_strtovectx(str, cellbuf, lim, cellsize) _fdt_strtovect((str), \ + (cellbuf), (lim), (cellsize), 16); + +static int +_fdt_strtovect(const char *str, void *cellbuf, int lim, unsigned char cellsize, + uint8_t base) +{ + const char *buf = str; + const char *end = str + strlen(str) - 2; + uint32_t *u32buf = NULL; + uint8_t *u8buf = NULL; + int cnt = 0; + + if (cellsize == sizeof(uint32_t)) + u32buf = (uint32_t *)cellbuf; + else + u8buf = (uint8_t *)cellbuf; + + if (lim == 0) + return (0); + + while (buf < end) { + + /* Skip white whitespace(s)/separators */ + while (!isxdigit(*buf) && buf < end) + buf++; + + if (u32buf != NULL) + u32buf[cnt] = + cpu_to_fdt32((uint32_t)strtol(buf, NULL, base)); + + else + u8buf[cnt] = (uint8_t)strtol(buf, NULL, base); + + if (cnt + 1 <= lim - 1) + cnt++; + else + break; + buf++; + /* Find another number */ + while ((isxdigit(*buf) || *buf == 'x') && buf < end) + buf++; + } + return (cnt); +} + +void +fdt_fixup_ethernet(const char *str, char *ethstr, int len) +{ + uint8_t tmp_addr[6]; + + /* Convert macaddr string into a vector of uints */ + fdt_strtovectx(str, &tmp_addr, 6, sizeof(uint8_t)); + /* Set actual property to a value from vect */ + fdt_setprop(fdtp, fdt_path_offset(fdtp, ethstr), + "local-mac-address", &tmp_addr, 6 * sizeof(uint8_t)); +} + +void +fdt_fixup_cpubusfreqs(unsigned long cpufreq, unsigned long busfreq) +{ + int lo, o = 0, o2, maxo = 0, depth; + const uint32_t zero = 0; + + /* We want to modify every subnode of /cpus */ + o = fdt_path_offset(fdtp, "/cpus"); + if (o < 0) + return; + + /* maxo should contain offset of node next to /cpus */ + depth = 0; + maxo = o; + while (depth != -1) + maxo = fdt_next_node(fdtp, maxo, &depth); + + /* Find CPU frequency properties */ + o = fdt_node_offset_by_prop_value(fdtp, o, "clock-frequency", + &zero, sizeof(uint32_t)); + + o2 = fdt_node_offset_by_prop_value(fdtp, o, "bus-frequency", &zero, + sizeof(uint32_t)); + + lo = MIN(o, o2); + + while (o != -FDT_ERR_NOTFOUND && o2 != -FDT_ERR_NOTFOUND) { + + o = fdt_node_offset_by_prop_value(fdtp, lo, + "clock-frequency", &zero, sizeof(uint32_t)); + + o2 = fdt_node_offset_by_prop_value(fdtp, lo, "bus-frequency", + &zero, sizeof(uint32_t)); + + /* We're only interested in /cpus subnode(s) */ + if (lo > maxo) + break; + + fdt_setprop_inplace_cell(fdtp, lo, "clock-frequency", + (uint32_t)cpufreq); + + fdt_setprop_inplace_cell(fdtp, lo, "bus-frequency", + (uint32_t)busfreq); + + lo = MIN(o, o2); + } +} + +#ifdef notyet +static int *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Mon Feb 12 01:13:11 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A72F3F07E49; Mon, 12 Feb 2018 01:13:11 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail106.syd.optusnet.com.au (mail106.syd.optusnet.com.au [211.29.132.42]) by mx1.freebsd.org (Postfix) with ESMTP id EFE0275D86; Mon, 12 Feb 2018 01:13:10 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from [192.168.0.102] (c110-21-101-228.carlnfd1.nsw.optusnet.com.au [110.21.101.228]) by mail106.syd.optusnet.com.au (Postfix) with ESMTPS id C02E63C44A3; Mon, 12 Feb 2018 11:55:21 +1100 (AEDT) Date: Mon, 12 Feb 2018 11:55:21 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Warner Losh cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r329127 - head/sys/sys In-Reply-To: <201802111745.w1BHjcWA050692@repo.freebsd.org> Message-ID: <20180212111457.R873@besplex.bde.org> References: <201802111745.w1BHjcWA050692@repo.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.2 cv=cIaQihWN c=1 sm=1 tr=0 a=PalzARQSbocsUSjMRkwAPg==:117 a=PalzARQSbocsUSjMRkwAPg==:17 a=kj9zAlcOel0A:10 a=0lazxUdnjwkT5nhfHf8A:9 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Feb 2018 01:13:11 -0000 On Sun, 11 Feb 2018, Warner Losh wrote: > Log: > Consistent macro indentation is the hobgoblin of small minds > > Line up the macro definitions and names here like the machine/stdarg.h > files that this replaced. This is easier to read and also makes it > easier to match up with other includes. Also two space indent va_end > to match the rest of the surrounding if block. Any chance of using KNF style? The 2-column indent for cpp things is easier to read than the KNF 0-column indent for cpp things, but is inconsistent with the KNF 8-column indent for C things, and is harder to write and maintain. > Modified: head/sys/sys/_stdarg.h > ============================================================================== > --- head/sys/sys/_stdarg.h Sun Feb 11 16:35:56 2018 (r329126) > +++ head/sys/sys/_stdarg.h Sun Feb 11 17:45:38 2018 (r329127) > @@ -43,13 +43,13 @@ > #endif > > #ifdef __GNUCLIKE_BUILTIN_STDARG > - #define va_start(ap, last) __builtin_va_start((ap), (last)) > - #define va_arg(ap, type) __builtin_va_arg((ap), type) > - #define __va_copy(dest, src) __builtin_va_copy((dest), (src)) > + #define va_start(ap, last) __builtin_va_start((ap), (last)) > + #define va_arg(ap, type) __builtin_va_arg((ap), type) > + #define __va_copy(dest, src) __builtin_va_copy((dest), (src)) In KNF, '#define' is not indented, and the tab after '#define' puts the name in column 8. Here, '#define is indented by 2 columns, and the space after #define used to put the name in column 2+7+1 = 10; now it puts the name in column 16 which is too far to the right. > #if __ISO_C_VISIBLE >= 1999 > - #define va_copy(dest, src) __va_copy(dest, src) > + #define va_copy(dest, src) __va_copy(dest, src) Deeper nesting causes further problems. Now the '#define's are indented by 2+2 columns. The names used to be indented to match, but they are now indented uniformly to 16 (except for unconverted ones), so their indentation no longer reflects the nesting. For 5 levels of nesting, the #define's would be in column 10 and the tab would indent the names to column 24. > #endif > -#define va_end(ap) __builtin_va_end(ap) > + #define va_end(ap) __builtin_va_end(ap) This like was actually in KNF style. > #endif > > #if defined(lint) && !defined(va_start) There are many unchanged misformattings before and after the ones modified in the patch. These are now more inconsistent than before: before: - space instead of tab after #define for idempotency ifdef - space instead of tab after #define for _VA_LIST_DECLARED after: - no tabs in the lint section (4 #define's). One of these is long and would blow out to 92 columns with tabs instead of spaces. After fixing the indentation of #define, it still takes 83 columns. Other style bugs in this file: - _VA_LIST_DECLARED is declared before va_list is actually declared. This is illogical, and its bad style is not used for older #define's of this type - space after ! in comment on #endif for idempotency ifdef - garbage newline before EOF. This file scores 67% on knfom(1) after this commit, down from 68% before. Most of the errors detected are for the 2-column indentation of almost everything. After fixing this, the score is 95%. IIRC, indent(1) never reformats cpp directives. knfom(1) uses indent(1) so it doesn't notice bugs in cpp expressions. The score is only 95% because of bugs in indent(1). indent(1) fixes the cpp indentation and the garbage before EOF, but adds the following bugs: - change the tab in tyhe typedef to a space - indent the comment on the #endif for the idempotency ifdef. Bruce From owner-svn-src-all@freebsd.org Mon Feb 12 01:17:10 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 08A2AF08347; Mon, 12 Feb 2018 01:17:10 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 92F9B7604A; Mon, 12 Feb 2018 01:17:09 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 74C7B2C8E; Mon, 12 Feb 2018 01:17:09 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1C1H9Bf077511; Mon, 12 Feb 2018 01:17:09 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1C1H7Xq077487; Mon, 12 Feb 2018 01:17:07 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201802120117.w1C1H7Xq077487@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Mon, 12 Feb 2018 01:17:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r329146 - in stable/11/stand: . arm/uboot efi efi/fdt fdt i386 i386/gptzfsboot i386/libi386 mips/beri mips/beri/boot2 mips/beri/loader mips/uboot ofw/libofw powerpc/boot1.chrp powerpc/k... X-SVN-Group: stable-11 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in stable/11/stand: . arm/uboot efi efi/fdt fdt i386 i386/gptzfsboot i386/libi386 mips/beri mips/beri/boot2 mips/beri/loader mips/uboot ofw/libofw powerpc/boot1.chrp powerpc/kboot powerpc/ofw powerpc/... X-SVN-Commit-Revision: 329146 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Feb 2018 01:17:10 -0000 Author: kevans Date: Mon Feb 12 01:17:06 2018 New Revision: 329146 URL: https://svnweb.freebsd.org/changeset/base/329146 Log: MFC r326038,r326069,r326072: More stand simplification and fixes r326038: Move some more common stuff up to Makefile.inc. r326069: Fix gptzfsboot for cases with GELI. r326072: Unbreak riscv build in universe. Modified: stable/11/stand/Makefile.inc stable/11/stand/arm/uboot/Makefile stable/11/stand/efi/Makefile.inc stable/11/stand/efi/fdt/Makefile stable/11/stand/fdt/Makefile stable/11/stand/i386/Makefile.inc stable/11/stand/i386/gptzfsboot/Makefile stable/11/stand/i386/libi386/Makefile stable/11/stand/mips/beri/Makefile.inc stable/11/stand/mips/beri/boot2/Makefile stable/11/stand/mips/beri/loader/Makefile stable/11/stand/mips/uboot/Makefile stable/11/stand/ofw/libofw/Makefile stable/11/stand/powerpc/boot1.chrp/Makefile stable/11/stand/powerpc/kboot/Makefile stable/11/stand/powerpc/ofw/Makefile stable/11/stand/powerpc/ps3/Makefile stable/11/stand/powerpc/uboot/Makefile stable/11/stand/sparc64/Makefile.inc stable/11/stand/uboot/fdt/Makefile stable/11/stand/uboot/lib/Makefile stable/11/stand/usb/Makefile stable/11/stand/usb/Makefile.test stable/11/stand/userboot/userboot/Makefile Directory Properties: stable/11/ (props changed) Modified: stable/11/stand/Makefile.inc ============================================================================== --- stable/11/stand/Makefile.inc Mon Feb 12 01:08:44 2018 (r329145) +++ stable/11/stand/Makefile.inc Mon Feb 12 01:17:06 2018 (r329146) @@ -9,6 +9,22 @@ CFLAGS+=-I${SASRC} SSP_CFLAGS= +# Add in the no float / no SIMD stuff and announce we're freestanding +# aarch64 and riscv don't have -msoft-float, but all others do. riscv +# currently has no /boot/loader, but may soon. +CFLAGS+= -ffreestanding ${CFLAGS_NO_SIMD} +.if ${MACHINE_CPUARCH} == "aarch64" +CFLAGS+= -mgeneral-regs-only +.elif ${MACHINE_CPUARCH} != "riscv" +CFLAGS+= -msoft-float +.endif + +.if ${MACHINE_CPUARCH} == "i386" || (${MACHINE_CPUARCH} == "amd64" && ${DO32:U0} == 1) +CFLAGS+= -march=i386 +CFLAGS.gcc+= -mpreferred-stack-boundary=2 +.endif + + .if ${MACHINE_CPUARCH} == "arm" # Do not generate movt/movw, because the relocation fixup for them does not # translate to the -Bsymbolic -pie format required by self_reloc() in loader(8). Modified: stable/11/stand/arm/uboot/Makefile ============================================================================== --- stable/11/stand/arm/uboot/Makefile Mon Feb 12 01:08:44 2018 (r329145) +++ stable/11/stand/arm/uboot/Makefile Mon Feb 12 01:17:06 2018 (r329146) @@ -33,8 +33,6 @@ HELP_FILES+= help.uboot ${BOOTSRC}/fdt/help.fdt # Always add MI sources .include "${BOOTSRC}/loader.mk" -CFLAGS+= -ffreestanding -msoft-float - LDFLAGS= -nostdlib -static -T ${.CURDIR}/ldscript.${MACHINE_CPUARCH} LDFLAGS+= -Wl,-znotext Modified: stable/11/stand/efi/Makefile.inc ============================================================================== --- stable/11/stand/efi/Makefile.inc Mon Feb 12 01:08:44 2018 (r329145) +++ stable/11/stand/efi/Makefile.inc Mon Feb 12 01:17:06 2018 (r329146) @@ -1,23 +1,13 @@ # $FreeBSD$ -.if ${MACHINE_CPUARCH} == "i386" -CFLAGS+= -march=i386 -CFLAGS+= -mno-aes -.endif - # Options used when building app-specific efi components # See conf/kern.mk for the correct set of these -CFLAGS+= -ffreestanding -Wformat ${CFLAGS_NO_SIMD} +CFLAGS+= -Wformat LDFLAGS+= -nostdlib -.if ${MACHINE_CPUARCH} != "aarch64" -CFLAGS+= -msoft-float -.endif - .if ${MACHINE_CPUARCH} == "amd64" CFLAGS+= -fshort-wchar CFLAGS+= -mno-red-zone -CFLAGS+= -mno-aes .endif .if ${MACHINE_CPUARCH} == "aarch64" Modified: stable/11/stand/efi/fdt/Makefile ============================================================================== --- stable/11/stand/efi/fdt/Makefile Mon Feb 12 01:08:44 2018 (r329145) +++ stable/11/stand/efi/fdt/Makefile Mon Feb 12 01:17:06 2018 (r329146) @@ -10,13 +10,6 @@ WARNS?= 6 SRCS= efi_fdt.c -CFLAGS+= -ffreestanding -.if ${MACHINE_CPUARCH} == "aarch64" -CFLAGS+= -mgeneral-regs-only -.else -CFLAGS+= -msoft-float -.endif - # EFI library headers CFLAGS+= -I${EFISRC}/include CFLAGS+= -I${EFISRC}/include/${MACHINE} Modified: stable/11/stand/fdt/Makefile ============================================================================== --- stable/11/stand/fdt/Makefile Mon Feb 12 01:08:44 2018 (r329145) +++ stable/11/stand/fdt/Makefile Mon Feb 12 01:17:06 2018 (r329146) @@ -16,12 +16,6 @@ SRCS+= fdt_loader_cmd.c CFLAGS+= -I${SYSDIR}/contrib/libfdt/ -I${LDRSRC} -CFLAGS+= -ffreestanding - -.if ${MACHINE_CPUARCH} == "powerpc" || ${MACHINE_CPUARCH} == "arm" || ${MACHINE_CPUARCH} == "mips" -CFLAGS+= -msoft-float -.endif - CFLAGS+= -Wformat -Wall .include Modified: stable/11/stand/i386/Makefile.inc ============================================================================== --- stable/11/stand/i386/Makefile.inc Mon Feb 12 01:08:44 2018 (r329145) +++ stable/11/stand/i386/Makefile.inc Mon Feb 12 01:17:06 2018 (r329146) @@ -3,9 +3,6 @@ # $FreeBSD$ LOADER_ADDRESS?=0x200000 -CFLAGS+= -march=i386 -ffreestanding -CFLAGS.gcc+= -mpreferred-stack-boundary=2 -CFLAGS+= ${CFLAGS_NO_SIMD} -msoft-float LDFLAGS+= -nostdlib # BTX components Modified: stable/11/stand/i386/gptzfsboot/Makefile ============================================================================== --- stable/11/stand/i386/gptzfsboot/Makefile Mon Feb 12 01:08:44 2018 (r329145) +++ stable/11/stand/i386/gptzfsboot/Makefile Mon Feb 12 01:17:06 2018 (r329146) @@ -1,6 +1,6 @@ # $FreeBSD$ -HAVE_GPT= yes +HAVE_GELI= yes .include @@ -70,12 +70,12 @@ gptldr.out: gptldr.o ${LD} ${LD_FLAGS} -e start -Ttext ${ORG1} -o ${.TARGET} gptldr.o CLEANFILES+= gptzfsboot.bin gptzfsboot.out zfsboot.o sio.o cons.o \ - drv.o gpt.o util.o ${OPENCRYPTO_XTS} + drv.o gpt.o ${OPENCRYPTO_XTS} gptzfsboot.bin: gptzfsboot.out ${OBJCOPY} -S -O binary gptzfsboot.out ${.TARGET} -gptzfsboot.out: ${BTXCRT} zfsboot.o sio.o gpt.o drv.o cons.o util.o \ +gptzfsboot.out: ${BTXCRT} zfsboot.o sio.o gpt.o drv.o cons.o \ ${OPENCRYPTO_XTS} ${LD} ${LD_FLAGS} -Ttext ${ORG2} -o ${.TARGET} ${.ALLSRC} ${LIBGELIBOOT} ${LIBZFSBOOT} ${LIBSA32} Modified: stable/11/stand/i386/libi386/Makefile ============================================================================== --- stable/11/stand/i386/libi386/Makefile Mon Feb 12 01:08:44 2018 (r329145) +++ stable/11/stand/i386/libi386/Makefile Mon Feb 12 01:17:06 2018 (r329146) @@ -1,6 +1,5 @@ # $FreeBSD$ -HAVE_GPT= yes HAVE_GELI= yes .include Modified: stable/11/stand/mips/beri/Makefile.inc ============================================================================== --- stable/11/stand/mips/beri/Makefile.inc Mon Feb 12 01:08:44 2018 (r329145) +++ stable/11/stand/mips/beri/Makefile.inc Mon Feb 12 01:17:06 2018 (r329146) @@ -1,6 +1,5 @@ # $FreeBSD$ -CFLAGS+= -ffreestanding LDFLAGS+= -nostdlib .include "../Makefile.inc" Modified: stable/11/stand/mips/beri/boot2/Makefile ============================================================================== --- stable/11/stand/mips/beri/boot2/Makefile Mon Feb 12 01:08:44 2018 (r329145) +++ stable/11/stand/mips/beri/boot2/Makefile Mon Feb 12 01:17:06 2018 (r329146) @@ -47,15 +47,13 @@ MAN= AFLAGS= -G0 -CFLAGS= -ffreestanding \ - -I${.CURDIR} \ +CFLAGS+= -I${.CURDIR} \ -I${SASRC} \ -I${LDRSRC} \ -D_KERNEL \ -Wall \ -G0 \ -fno-pic -mno-abicalls \ - -msoft-float \ -g LDFLAGS= -nostdlib \ Modified: stable/11/stand/mips/beri/loader/Makefile ============================================================================== --- stable/11/stand/mips/beri/loader/Makefile Mon Feb 12 01:08:44 2018 (r329145) +++ stable/11/stand/mips/beri/loader/Makefile Mon Feb 12 01:17:06 2018 (r329146) @@ -83,7 +83,6 @@ CFLAGS+= -I${.CURDIR} CFLAGS+= -G0 \ -fno-pic \ -mno-abicalls \ - -msoft-float \ -g LDFLAGS= -nostdlib \ Modified: stable/11/stand/mips/uboot/Makefile ============================================================================== --- stable/11/stand/mips/uboot/Makefile Mon Feb 12 01:08:44 2018 (r329145) +++ stable/11/stand/mips/uboot/Makefile Mon Feb 12 01:17:06 2018 (r329146) @@ -29,7 +29,7 @@ HELP_FILES+= help.uboot ${BOOTSRC}/fdt/help.fdt # Always add MI sources .include "${BOOTSRC}/loader.mk" -CFLAGS+= -ffreestanding -msoft-float -g +CFLAGS+= -g LDFLAGS= -nostdlib -static -T ${.CURDIR}/ldscript.${MACHINE_CPUARCH} Modified: stable/11/stand/ofw/libofw/Makefile ============================================================================== --- stable/11/stand/ofw/libofw/Makefile Mon Feb 12 01:08:44 2018 (r329145) +++ stable/11/stand/ofw/libofw/Makefile Mon Feb 12 01:17:06 2018 (r329146) @@ -14,9 +14,7 @@ SRCS+= devicename_stubs.c # Pick up the bootstrap header for some interface items CFLAGS+= -I${LDRSRC} -CFLAGS+= -ffreestanding .if ${MACHINE_CPUARCH} == "powerpc" -CFLAGS+= -msoft-float SRCS+= ppc64_elf_freebsd.c .endif Modified: stable/11/stand/powerpc/boot1.chrp/Makefile ============================================================================== --- stable/11/stand/powerpc/boot1.chrp/Makefile Mon Feb 12 01:08:44 2018 (r329145) +++ stable/11/stand/powerpc/boot1.chrp/Makefile Mon Feb 12 01:17:06 2018 (r329146) @@ -13,9 +13,7 @@ SRCS= boot1.c ashldi3.c syncicache.c MAN= -CFLAGS= -ffreestanding -msoft-float \ - -I${LDRSRC} -I${SYSDIR} -I${SASRC} \ - -D_STANDALONE +CFLAGS= -I${LDRSRC} -I${SYSDIR} -I${SASRC} -D_STANDALONE LDFLAGS=-nostdlib -static -Wl,-N .PATH: ${SYSDIR}/libkern ${SRCTOP}/lib/libc/powerpc/gen ${.CURDIR} Modified: stable/11/stand/powerpc/kboot/Makefile ============================================================================== --- stable/11/stand/powerpc/kboot/Makefile Mon Feb 12 01:08:44 2018 (r329145) +++ stable/11/stand/powerpc/kboot/Makefile Mon Feb 12 01:17:06 2018 (r329146) @@ -32,7 +32,7 @@ HELP_FILES= # Disable .include "${BOOTSRC}/loader.mk" .PATH: ${SYSDIR}/libkern -CFLAGS+= -Wall -ffreestanding -msoft-float -DAIM +CFLAGS+= -Wall -DAIM # load address. set in linker script RELOC?= 0x0 CFLAGS+= -DRELOC=${RELOC} Modified: stable/11/stand/powerpc/ofw/Makefile ============================================================================== --- stable/11/stand/powerpc/ofw/Makefile Mon Feb 12 01:08:44 2018 (r329145) +++ stable/11/stand/powerpc/ofw/Makefile Mon Feb 12 01:17:06 2018 (r329146) @@ -34,7 +34,6 @@ HELP_FILES+= ${FDTSRC}/help.fdt .PATH: ${SYSDIR}/libkern -CFLAGS+= -ffreestanding -msoft-float # load address. set in linker script RELOC?= 0x1C00000 CFLAGS+= -DRELOC=${RELOC} Modified: stable/11/stand/powerpc/ps3/Makefile ============================================================================== --- stable/11/stand/powerpc/ps3/Makefile Mon Feb 12 01:08:44 2018 (r329145) +++ stable/11/stand/powerpc/ps3/Makefile Mon Feb 12 01:17:06 2018 (r329146) @@ -30,7 +30,7 @@ HELP_FILES= # Disable .include "${BOOTSRC}/loader.mk" .PATH: ${SYSDIR}/libkern -CFLAGS+= -Wall -ffreestanding -msoft-float -DAIM +CFLAGS+= -Wall -DAIM # load address. set in linker script RELOC?= 0x0 CFLAGS+= -DRELOC=${RELOC} Modified: stable/11/stand/powerpc/uboot/Makefile ============================================================================== --- stable/11/stand/powerpc/uboot/Makefile Mon Feb 12 01:08:44 2018 (r329145) +++ stable/11/stand/powerpc/uboot/Makefile Mon Feb 12 01:17:06 2018 (r329146) @@ -25,8 +25,6 @@ HELP_FILES= # Disable .include "${BOOTSRC}/loader.mk" .PATH: ${SYSDIR}/libkern -CFLAGS+= -ffreestanding - LDFLAGS= -nostdlib -static -T ${.CURDIR}/ldscript.powerpc .include "${BOOTSRC}/uboot.mk" Modified: stable/11/stand/sparc64/Makefile.inc ============================================================================== --- stable/11/stand/sparc64/Makefile.inc Mon Feb 12 01:08:44 2018 (r329145) +++ stable/11/stand/sparc64/Makefile.inc Mon Feb 12 01:17:06 2018 (r329146) @@ -1,6 +1,5 @@ # $FreeBSD$ -CFLAGS+= -ffreestanding LDFLAGS+= -nostdlib .include "../Makefile.inc" Modified: stable/11/stand/uboot/fdt/Makefile ============================================================================== --- stable/11/stand/uboot/fdt/Makefile Mon Feb 12 01:08:44 2018 (r329145) +++ stable/11/stand/uboot/fdt/Makefile Mon Feb 12 01:17:06 2018 (r329146) @@ -10,8 +10,6 @@ WARNS?= 2 SRCS= uboot_fdt.c -CFLAGS+= -ffreestanding -msoft-float - # U-Boot library headers CFLAGS+= -I${UBOOTSRC}/lib Modified: stable/11/stand/uboot/lib/Makefile ============================================================================== --- stable/11/stand/uboot/lib/Makefile Mon Feb 12 01:08:44 2018 (r329145) +++ stable/11/stand/uboot/lib/Makefile Mon Feb 12 01:17:06 2018 (r329146) @@ -11,8 +11,6 @@ WARNS?= 2 SRCS= console.c copy.c devicename.c elf_freebsd.c glue.c SRCS+= module.c net.c reboot.c time.c -CFLAGS+= -ffreestanding -msoft-float - .if ${LOADER_DISK_SUPPORT:Uyes} == "yes" SRCS+= disk.c .endif Modified: stable/11/stand/usb/Makefile ============================================================================== --- stable/11/stand/usb/Makefile Mon Feb 12 01:08:44 2018 (r329145) +++ stable/11/stand/usb/Makefile Mon Feb 12 01:17:06 2018 (r329146) @@ -36,15 +36,10 @@ INTERNALLIB= CFLAGS+= -DBOOTPROG=\"usbloader\" CFLAGS+= -ffunction-sections -fdata-sections -CFLAGS+= -ffreestanding CFLAGS+= -Wformat -Wall CFLAGS+= -g CFLAGS+= -fno-pic -.if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64" -CFLAGS+= -march=i386 -CFLAGS.gcc+= -mpreferred-stack-boundary=2 -.endif .if ${MACHINE_CPUARCH} == "amd64" CFLAGS+= -m32 .endif Modified: stable/11/stand/usb/Makefile.test ============================================================================== --- stable/11/stand/usb/Makefile.test Mon Feb 12 01:08:44 2018 (r329145) +++ stable/11/stand/usb/Makefile.test Mon Feb 12 01:17:06 2018 (r329146) @@ -38,10 +38,6 @@ SRCS= CFLAGS+= -Wall CFLAGS+= -g -.if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64" -CFLAGS+= -march=i386 -CFLAGS.gcc+= -mpreferred-stack-boundary=2 -.endif .if ${MACHINE_CPUARCH} == "amd64" CFLAGS+= -m32 .endif Modified: stable/11/stand/userboot/userboot/Makefile ============================================================================== --- stable/11/stand/userboot/userboot/Makefile Mon Feb 12 01:08:44 2018 (r329145) +++ stable/11/stand/userboot/userboot/Makefile Mon Feb 12 01:17:06 2018 (r329146) @@ -36,7 +36,6 @@ SRCS+= vers.c CFLAGS+= -Wall CFLAGS+= -I${BOOTSRC}/userboot -CFLAGS+= -ffreestanding CWARNFLAGS.main.c += -Wno-implicit-function-declaration From owner-svn-src-all@freebsd.org Mon Feb 12 01:29:12 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2CBEAF09256 for ; Mon, 12 Feb 2018 01:29:12 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-it0-x231.google.com (mail-it0-x231.google.com [IPv6:2607:f8b0:4001:c0b::231]) (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 B0134767E6 for ; Mon, 12 Feb 2018 01:29:11 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-it0-x231.google.com with SMTP id x128so4896834ite.0 for ; Sun, 11 Feb 2018 17:29:11 -0800 (PST) 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=or9RWhlIgYwKlQItjAwo/cq2yRqIj1i3fhnqUM31jNA=; b=RPJaivfVDFx9C55FnrKTUQi2Zqzrz7MMR8qkrTtQhG9oAvgXvOypREx6lkKJbA4xzc dd4uUXaT7duzpRF4O9XPNdbdS5nsxwu+VZ2ZFoLeprabJMOIcOEqTVfDDfmKXno1zM74 DQdbeuZlqAaIim93t0/dpyyurQFr8H25yS2TkrHThwCXjWTBfgsERShLfX4FvUKDeTzz 5HUHQkwsI/9sFswK/xUtg8EZ6w6rcSxb+hZn+OfIw7S7i/U/qkJDRenCNnMb/RoXX07a QnZ3s5CvhQ/AsyCjcAaJGXFo8HJYfWsY9XuDaR78PGqQ7aDQ7FuLC5NVUbtRKK3D0/uL HGnA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=or9RWhlIgYwKlQItjAwo/cq2yRqIj1i3fhnqUM31jNA=; b=NyBR0w8hX/wz6OtAc1pU9PNEHD31cQYnYXUe3hAqF6KSghc2+tCtOVvSpFWHxaw38T 1dqmdE1TY1aVLWFtECU9tvB+swqvE2huTarSdfDKi3uKozj8niUzEEFeiUITtTvytK6B ObfhHcyhoJ856KzclZRIvnhyElFMs9vWEuomeWzdTEpSHkgSCswWHj5thTufLaEVVD4i O3i8zXvRWkFrI7ufilsrqFnrLPqXMZGbRy3vNHidGkwvdpLQN2mLTMq+JlEt2rjjklXB iVcf9zyJ0U0YBJX68/ACek/vkizoqn6VDJCGjkTieGz6PHhGwIApHVfzbzUm+atqLUjN grTw== X-Gm-Message-State: APf1xPCOSbRogbhgOkxbhfbkaDm+DNv7p4bVQwA3uCS171IVgyHyv0Wl cK6C7g4oFV5BdX7V79XMem6ZQToz1XOj0ORhoe/y1Q== X-Google-Smtp-Source: AH8x227yKRKnME/2MCi1XyzYH7NI6KA25kBvkJmCP0QLUwqBWAbe8A2ON3HH+TPBdiN1bwCyYETfYlV9zZtQnxI5CR0= X-Received: by 10.36.250.193 with SMTP id v184mr3279279ith.64.1518398950786; Sun, 11 Feb 2018 17:29:10 -0800 (PST) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.201.67 with HTTP; Sun, 11 Feb 2018 17:29:10 -0800 (PST) X-Originating-IP: [50.253.99.174] In-Reply-To: <20180212111457.R873@besplex.bde.org> References: <201802111745.w1BHjcWA050692@repo.freebsd.org> <20180212111457.R873@besplex.bde.org> From: Warner Losh Date: Sun, 11 Feb 2018 18:29:10 -0700 X-Google-Sender-Auth: tC8kjCb8k_kNg51CLJBPaDBoqxM Message-ID: Subject: Re: svn commit: r329127 - head/sys/sys To: Bruce Evans Cc: Warner Losh , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.25 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Feb 2018 01:29:12 -0000 On Sun, Feb 11, 2018 at 5:55 PM, Bruce Evans wrote: > On Sun, 11 Feb 2018, Warner Losh wrote: > > Log: >> Consistent macro indentation is the hobgoblin of small minds >> >> Line up the macro definitions and names here like the machine/stdarg.h >> files that this replaced. This is easier to read and also makes it >> easier to match up with other includes. Also two space indent va_end >> to match the rest of the surrounding if block. >> > > Any chance of using KNF style? > > The 2-column indent for cpp things is easier to read than the KNF 0-column > indent for cpp things, but is inconsistent with the KNF 8-column indent for > C things, and is harder to write and maintain. > > Modified: head/sys/sys/_stdarg.h >> ============================================================ >> ================== >> --- head/sys/sys/_stdarg.h Sun Feb 11 16:35:56 2018 (r329126) >> +++ head/sys/sys/_stdarg.h Sun Feb 11 17:45:38 2018 (r329127) >> @@ -43,13 +43,13 @@ >> #endif >> >> #ifdef __GNUCLIKE_BUILTIN_STDARG >> - #define va_start(ap, last) __builtin_va_start((ap), (last)) >> - #define va_arg(ap, type) __builtin_va_arg((ap), type) >> - #define __va_copy(dest, src) __builtin_va_copy((dest), (src)) >> + #define va_start(ap, last) __builtin_va_start((ap), (last)) >> + #define va_arg(ap, type) __builtin_va_arg((ap), type) >> + #define __va_copy(dest, src) __builtin_va_copy((dest), (src)) >> > > In KNF, '#define' is not indented, and the tab after '#define' puts the > name in column 8. Here, '#define is indented by 2 columns, and the space > after #define used to put the name in column 2+7+1 = 10; now it puts the > name in column 16 which is too far to the right. > > #if __ISO_C_VISIBLE >= 1999 >> - #define va_copy(dest, src) __va_copy(dest, src) >> + #define va_copy(dest, src) __va_copy(dest, src) >> > > Deeper nesting causes further problems. Now the '#define's are indented > by 2+2 columns. The names used to be indented to match, but they are > now indented uniformly to 16 (except for unconverted ones), so their > indentation no longer reflects the nesting. For 5 levels of nesting, > the #define's would be in column 10 and the tab would indent the names > to column 24. > > #endif >> -#define va_end(ap) __builtin_va_end(ap) >> + #define va_end(ap) __builtin_va_end(ap) >> > > This like was actually in KNF style. Right, but it didn't match the rest of the file :) > > #endif >> >> #if defined(lint) && !defined(va_start) >> > > There are many unchanged misformattings before and after the ones modified > in the patch. These are now more inconsistent than before: > before: > - space instead of tab after #define for idempotency ifdef > - space instead of tab after #define for _VA_LIST_DECLARED > after: > - no tabs in the lint section (4 #define's). One of these is long and > would blow out to 92 columns with tabs instead of spaces. After fixing > the indentation of #define, it still takes 83 columns. > > Other style bugs in this file: > - _VA_LIST_DECLARED is declared before va_list is actually declared. This > is illogical, and its bad style is not used for older #define's of this > type > - space after ! in comment on #endif for idempotency ifdef > - garbage newline before EOF. > > This file scores 67% on knfom(1) after this commit, down from 68% before. > Most of the errors detected are for the 2-column indentation of almost > everything. After fixing this, the score is 95%. IIRC, indent(1) never > reformats cpp directives. knfom(1) uses indent(1) so it doesn't notice > bugs in cpp expressions. The score is only 95% because of bugs in > indent(1). indent(1) fixes the cpp indentation and the garbage before EOF, > but adds the following bugs: > - change the tab in tyhe typedef to a space > - indent the comment on the #endif for the idempotency ifdef. what's knfom? Google gives me garbage when I search for that. Warner From owner-svn-src-all@freebsd.org Mon Feb 12 02:04:52 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 49478F0B936; Mon, 12 Feb 2018 02:04:52 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-io0-f169.google.com (mail-io0-f169.google.com [209.85.223.169]) (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 D9B6577C25; Mon, 12 Feb 2018 02:04:51 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-io0-f169.google.com with SMTP id 72so15691678iom.10; Sun, 11 Feb 2018 18:04:51 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:reply-to:in-reply-to:references :from:date:message-id:subject:to:cc; bh=EScMYWvzkvWMaJ8vzrsD3n8MZJMqBetvVBrv+GVLFic=; b=OGnUZQIGnGXkR52tM/h3zdlk4FIKGOpmk6pSKPuP+AK7NrHaQxtW267Zr5bo2axyvL RB76ILMC0SBE5jT/V2xJxU1ul0gMclAfyjtKqY6+SUuBF4WEfl38efZCfc9fPS08MiXq SorpyrEUpU7z0R9aKIWYB0hwdoyn+D//nluEQ2oGT3ELAnjsX8EGvhAUdYjNwW6iXbHF fOqH6XsbtxdOtHbjMrMvB71HkLAEz640yvGFCjcvo2ZL0B16zUeio3VeezECxbmj6q2Q ZdP15LPxd5E7MOE4KF/kpsQwOlot6U394Dy8JL9a5/T7zxOMKIuxEYXu06+m/3qXwQ6X Rtvg== X-Gm-Message-State: APf1xPBDCb8oOIpv12ro1cuI6a5VKGzCS2cOdJIxLtvGxiz3VylPrWf/ VufajdOlDn5UKO6YO+Nn54uL4SFX X-Google-Smtp-Source: AH8x225TqhFThNeiwtjnWB0uEhTdxa+TNXw9j+V3NXj21P/DRI1+QO6OoxqtNg2LOf1PPEfFwCfLDg== X-Received: by 10.107.70.25 with SMTP id t25mr11157181ioa.126.1518395727935; Sun, 11 Feb 2018 16:35:27 -0800 (PST) Received: from mail-io0-f182.google.com (mail-io0-f182.google.com. [209.85.223.182]) by smtp.gmail.com with ESMTPSA id i63sm4996391itb.31.2018.02.11.16.35.27 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 11 Feb 2018 16:35:27 -0800 (PST) Received: by mail-io0-f182.google.com with SMTP id g14so9354673iob.9; Sun, 11 Feb 2018 16:35:27 -0800 (PST) X-Received: by 10.107.2.6 with SMTP id 6mr2684060ioc.117.1518395726998; Sun, 11 Feb 2018 16:35:26 -0800 (PST) MIME-Version: 1.0 Reply-To: cem@freebsd.org Received: by 10.2.30.149 with HTTP; Sun, 11 Feb 2018 16:35:26 -0800 (PST) In-Reply-To: <201802112346.w1BNkPXc041510@pdx.rh.CN85.dnsmgr.net> References: <1518374549.32585.238.camel@freebsd.org> <201802112346.w1BNkPXc041510@pdx.rh.CN85.dnsmgr.net> From: Conrad Meyer Date: Sun, 11 Feb 2018 16:35:26 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r329126 - head/etc/devd To: "Rodney W. Grimes" Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Feb 2018 02:04:52 -0000 On Sun, Feb 11, 2018 at 3:46 PM, Rodney W. Grimes wrote: > Moving this to /usr creates a cyclic issue in that you then need > /usr to be mounted before devd can start and devd's /etc/rc.d file > says: > # PROVIDE: devd > # REQUIRE: NETWORKING > # BEFORE: mountcritremote > # KEYWORD: nojail > > In the diskless and nfs shared /usr worlds devd wants to start > before /usr is mounted. If devd is needed to mount /usr (???), it seems like just another demonstration of why separate /usr is a poor idea. From owner-svn-src-all@freebsd.org Mon Feb 12 02:58:04 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A731AF0F01F for ; Mon, 12 Feb 2018 02:58:04 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-io0-x233.google.com (mail-io0-x233.google.com [IPv6:2607:f8b0:4001:c06::233]) (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 2F674795EA for ; Mon, 12 Feb 2018 02:58:04 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-io0-x233.google.com with SMTP id n7so15800437iob.0 for ; Sun, 11 Feb 2018 18:58:04 -0800 (PST) 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=wwYk+xIZ4cxkRVEaGBElNlnyNuRwD9dWSbDtXn2Ww3g=; b=zzsGxkRcLkLDCxtxM3Q3yryTI2xB1fpiMPKT3YKNOGHqG+FSpenoVCiYleBn4JA0dn JXO2gAgvPSRdgTbtdKkXLCfQ1XGTmU8ikDAXOxCK2Y3SIY2taSXuxDgtnMtQRcDyUf51 r4AHpeLSCZBnFUhFFEhtg0XfQR0NCRPyc7p/1GRb1MhuNbmOy6P1GnQcuX0VO2titgSI qO8oJbx4pIl4XMFViZKK0tEFe1N5QZx2t2XReZ/I8mlz8bJ6IUo/aLq+oQjDBNgBqm1p PgoSoBsCGeKkTyRhFCYWR90Rz9dDz5SHYqYeOhQ9TwWo1SYJ2sbeXTyR/IU7xl3jdEk/ ormg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=wwYk+xIZ4cxkRVEaGBElNlnyNuRwD9dWSbDtXn2Ww3g=; b=KnFc6cA18/Mcsj55QeZduW+GIgoXrhOYKULOyqeRyc5RXEE7fn7lpY/jokpgeqs56j pvJQzirZRCnN5y9pFmFCe369nmtCB3OxpumzXF9DgaSlzshMJZZasbt3G7+1XDer6k9s dHWqUSvp2qbffIUP6KpPp968LHMqLwAisyyq1iK+bafTsjT5AzW7hl/bhZGR6hM5DnvF nUU9yq2kTXreLF8pD29oSwJu4Fbq6tTrNPVEj5lHes6ZGKKVRkckgfoZZf/nPKwB1EMx AL3Y+Jgp8S35717jay1Z/GEk+HYEC9kPBK1lAeRdpF6RaDTmjUszmJLk1Ez/mm0lxJhn kR/w== X-Gm-Message-State: APf1xPA/eRoeap1sgp/B44zxpP3wgzon68B+swa4g0cAVMNK3tuOdMNF RnxB+94H8pe0goWSGIZeEsfMtFkdOXmGKjKt2f0zRA== X-Google-Smtp-Source: AH8x227G7fWH1TfLLzsG2wi717FgmS/xScFg7vuCYJlTNyXTkRx7xU6ncf2wz1m//NUfwZHhHApr5DAYBncZotiTFas= X-Received: by 10.107.172.130 with SMTP id v124mr7300305ioe.301.1518404283321; Sun, 11 Feb 2018 18:58:03 -0800 (PST) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.201.67 with HTTP; Sun, 11 Feb 2018 18:58:02 -0800 (PST) X-Originating-IP: [2603:300b:6:5100:b0a7:f4b6:69f8:4eba] Received: by 10.79.201.67 with HTTP; Sun, 11 Feb 2018 18:58:02 -0800 (PST) In-Reply-To: References: <1518374549.32585.238.camel@freebsd.org> <201802112346.w1BNkPXc041510@pdx.rh.CN85.dnsmgr.net> From: Warner Losh Date: Sun, 11 Feb 2018 19:58:02 -0700 X-Google-Sender-Auth: dwoExcNZkqq8GgYspU07rZUEAxs Message-ID: Subject: Re: svn commit: r329126 - head/etc/devd To: "Conrad E. Meyer" Cc: "Rodney W. Grimes" , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.25 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Feb 2018 02:58:04 -0000 On Feb 11, 2018 7:05 PM, "Conrad Meyer" wrote: On Sun, Feb 11, 2018 at 3:46 PM, Rodney W. Grimes wrote: > Moving this to /usr creates a cyclic issue in that you then need > /usr to be mounted before devd can start and devd's /etc/rc.d file > says: > # PROVIDE: devd > # REQUIRE: NETWORKING > # BEFORE: mountcritremote > # KEYWORD: nojail > > In the diskless and nfs shared /usr worlds devd wants to start > before /usr is mounted. If devd is needed to mount /usr (???), it seems like just another demonstration of why separate /usr is a poor idea. No, it's another reason why generated devd files are wrong in the face of devmatch. Warner From owner-svn-src-all@freebsd.org Mon Feb 12 03:54:19 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EC1FDF12E7A; Mon, 12 Feb 2018 03:54:18 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-io0-f182.google.com (mail-io0-f182.google.com [209.85.223.182]) (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 844717B9FE; Mon, 12 Feb 2018 03:54:18 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-io0-f182.google.com with SMTP id e7so1633074ioj.1; Sun, 11 Feb 2018 19:54:18 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:reply-to:in-reply-to:references :from:date:message-id:subject:to:cc; bh=VEQQfofDdLot5A6N6ginA5eA3vFPgV0KyLjoxSuBn6s=; b=ZyLULkDe1gmeqmxZo/F8eZhnicJefIhIvZalmmQfmGpvw0l5mxNdtmWV2joEIirsx7 fXyWpouw2o4d+V0UXkxqUtYR2ZChKm6bqwLE5fIk3+utHA2yb0/Q/ZFt/r7nwZHa7SVC 8S2ObYimeqIzFXSY/QGcJ8+AlLqTOY4u5i9jaziF7X+CZ2YqQ7bNnZyB2A6bMeqAUX24 +ZnQCeUEDAcCC3r9aBnUFlcFT44pPZAiDybiW9KlhRpAhftJXnf5j8CmcowlQyIvSevn rINhDWMpiF4XeNXXQlnZ1jNwUH1snce1ER7xgchXCrKbyg7vJsztdSLUTrU5MtgQdquc HMrw== X-Gm-Message-State: APf1xPDAQKIDwqsSiH9b7uj7+/EdJbugaCcFXbkvR7OPyyGjKap+MMiE 7+YEnXy8ditvyG3VbqspUziZMBfG X-Google-Smtp-Source: AH8x226EMKz2hw3+SiAPiVJ2P79MBay1ZCruAhVM76jvodeGNrqCoamLlHWQIwrQXz/LVTJ3C1JpFA== X-Received: by 10.107.13.143 with SMTP id 137mr11474006ion.265.1518407652255; Sun, 11 Feb 2018 19:54:12 -0800 (PST) Received: from mail-it0-f43.google.com (mail-it0-f43.google.com. [209.85.214.43]) by smtp.gmail.com with ESMTPSA id b41sm9313059iod.30.2018.02.11.19.54.11 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 11 Feb 2018 19:54:11 -0800 (PST) Received: by mail-it0-f43.google.com with SMTP id i144so5123648ita.3; Sun, 11 Feb 2018 19:54:11 -0800 (PST) X-Received: by 10.36.21.131 with SMTP id 125mr438813itq.71.1518407651237; Sun, 11 Feb 2018 19:54:11 -0800 (PST) MIME-Version: 1.0 Reply-To: cem@freebsd.org Received: by 10.2.30.149 with HTTP; Sun, 11 Feb 2018 19:54:10 -0800 (PST) In-Reply-To: References: <1518374549.32585.238.camel@freebsd.org> <201802112346.w1BNkPXc041510@pdx.rh.CN85.dnsmgr.net> From: Conrad Meyer Date: Sun, 11 Feb 2018 19:54:10 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r329126 - head/etc/devd To: Warner Losh Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Feb 2018 03:54:19 -0000 On Sun, Feb 11, 2018 at 6:58 PM, Warner Losh wrote: > No, it's another reason why generated devd files are wrong in the face of > devmatch. Devmatch is both vaporware and orthogonal to the placement of pre-devmatch static system databases. I'm on board with the glorious devmatch-autoloads-usb-devices future. But someone has to actually write the logic that incorporates it with devd and remove these databases before it matters. From owner-svn-src-all@freebsd.org Mon Feb 12 04:27:27 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C0111F151C7 for ; Mon, 12 Feb 2018 04:27:26 +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 0AF147CAB5 for ; Mon, 12 Feb 2018 04:27:26 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-it0-x232.google.com with SMTP id x128so5203564ite.0 for ; Sun, 11 Feb 2018 20:27:26 -0800 (PST) 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=QxzWy9hJOztUpT92sTWVLDr43ADS9gPRyS847OeWSZY=; b=QBHeKgnPEsRdH6EibIVmlmGD3vE5iKq+eGroUQ1osDfjUleNzoK3ptnHxJCLNDcZbg NxIHj5P1navxt6L6U0Tc91xHM7MjhntnhY+MnFLMKyj6b2RrfSvxMwqMyGQNr89Sk983 yoFaUDmHdWSx86SoFG/lKs/JpCsTDNikQitXUinQxpTEGaKseKbZYRBZ2kBpbDyoe6I0 AjJmN+6bSyj2hef91h4mWvbeB7KHu1xX9cqjxK8nh8ZZr0m6IKfAmdcaY2PZiObzx2O7 /Hm1cQUXXmVUWKJLbTBGdILF4dgNtgpdyY5Kb5U9EBfy4npeihUmuWamCdsQ5q93KDyK iHBA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=QxzWy9hJOztUpT92sTWVLDr43ADS9gPRyS847OeWSZY=; b=JoXUu/OF5wtKrfi6szr7BE96sse5uX5V+hlOUnb0a9eCzpfleByq14+emEsd0ZjQKX 7FP6qIos5LuB+Hqt+ts7vYfV90barsc/1Kfn4vkwbrTEPX+bAkPtllu2AXz0pYuvZnbz 0BKewxAkI9po963maHd1WIDzqZ96PhtfNifF31ws9ANcAFRH4N3TjYBXybivJaUYnst2 IlKX7Jz9N/CDo38zUU/PWrzm4h2NaPcQ74bHLpBSqTzvNNjXDGUJt3walePQDS1z33i6 LUxwINe4wFk47CV5GWufx3/cJIPOfSLtYeAOSZGTywodcHPm2vT5bZvaCiglXELTgWax gpFg== X-Gm-Message-State: APf1xPDtsZ805/zU3krZZMXA7w5HM7MoadGyPHiXtHpQH829ahtDA3oY HcenFsy0aL5VJwJY0JFQ3NTdd+dd67T1gAyjSKtrbQ== X-Google-Smtp-Source: AH8x2256fsiM4j7ZGijFINGAph8Cc/tbC8xn2o5cDwFVIh9vYe08rHi3ck4rZde+jV+58oYjJsKGbiiTNfJNUniUAmU= X-Received: by 10.36.145.139 with SMTP id i133mr4162104ite.69.1518409645314; Sun, 11 Feb 2018 20:27:25 -0800 (PST) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.201.67 with HTTP; Sun, 11 Feb 2018 20:27:24 -0800 (PST) X-Originating-IP: [50.253.99.174] In-Reply-To: References: <1518374549.32585.238.camel@freebsd.org> <201802112346.w1BNkPXc041510@pdx.rh.CN85.dnsmgr.net> From: Warner Losh Date: Sun, 11 Feb 2018 21:27:24 -0700 X-Google-Sender-Auth: 7Gjqn514VHZs4BJcCco-gLemE6E Message-ID: Subject: Re: svn commit: r329126 - head/etc/devd To: "Conrad E. Meyer" Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.25 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Feb 2018 04:27:27 -0000 On Sun, Feb 11, 2018 at 8:54 PM, Conrad Meyer wrote: > On Sun, Feb 11, 2018 at 6:58 PM, Warner Losh wrote: > > No, it's another reason why generated devd files are wrong in the face of > > devmatch. > > Devmatch is both vaporware and orthogonal to the placement of > pre-devmatch static system databases. > kldload $(devmatch | uniq) would do the trick. I take exception to the vaporware comment. At worst it's incompletely integrated. The point is that these generated things are at worst a transient thing that aren't worth moving or even arguing about where they should have gone were they not set for deletion soon. Warner From owner-svn-src-all@freebsd.org Mon Feb 12 04:45:18 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 57A61F16458; Mon, 12 Feb 2018 04:45:18 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0DE407D49B; Mon, 12 Feb 2018 04:45:18 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E2EF653C9; Mon, 12 Feb 2018 04:45:17 +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 w1C4jHS6081830; Mon, 12 Feb 2018 04:45:17 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1C4jH1c081827; Mon, 12 Feb 2018 04:45:17 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201802120445.w1C4jH1c081827@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 12 Feb 2018 04:45:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329147 - in head/etc: defaults rc.d X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head/etc: defaults rc.d X-SVN-Commit-Revision: 329147 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Feb 2018 04:45:18 -0000 Author: imp Date: Mon Feb 12 04:45:17 2018 New Revision: 329147 URL: https://svnweb.freebsd.org/changeset/base/329147 Log: Add devmatch rc.d integration Create simple script to load modules on demand based on the device identifying information. Sponsored by: Netflix Added: head/etc/rc.d/devmatch (contents, props changed) Modified: head/etc/defaults/rc.conf Modified: head/etc/defaults/rc.conf ============================================================================== --- head/etc/defaults/rc.conf Mon Feb 12 01:17:06 2018 (r329146) +++ head/etc/defaults/rc.conf Mon Feb 12 04:45:17 2018 (r329147) @@ -41,6 +41,7 @@ ddb_enable="NO" # Set to YES to load ddb scripts at b ddb_config="/etc/ddb.conf" # ddb(8) config file. devd_enable="YES" # Run devd, to trigger programs on device tree changes. devd_flags="" # Additional flags for devd(8). +devmatch_enable="NO" # Demand load kernel modules based on device ids. #kld_list="" # Kernel modules to load after local disks are mounted kldxref_enable="NO" # Build linker.hints files with kldxref(8). kldxref_clobber="NO" # Overwrite old linker.hints at boot. Added: head/etc/rc.d/devmatch ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/etc/rc.d/devmatch Mon Feb 12 04:45:17 2018 (r329147) @@ -0,0 +1,54 @@ +#!/bin/sh + +# Copyright (c) 2018 Warner Losh +# 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$ +# +# PROVIDE: devmatch +# REQUIRE: kldxref +# KEYWORD: nojail + +. /etc/rc.subr + +name="devmatch" +desc="Use devmatch(8) to load kernel modules + +start_cmd="${name}_start" +stop_cmd=':' + +devmatch_start() +{ + local x + + x=$(devmatch | sort -u) + + [ -n "$x" ] || return + + echo "Autoloading modules" + kldload ${x} +} + +load_rc_config $name +run_rc_command "$1" From owner-svn-src-all@freebsd.org Mon Feb 12 04:45:27 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6E1B2F1648D; Mon, 12 Feb 2018 04:45:27 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1F6647D586; Mon, 12 Feb 2018 04:45:27 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1A6F653CA; Mon, 12 Feb 2018 04:45:27 +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 w1C4jQR1081886; Mon, 12 Feb 2018 04:45:26 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1C4jQBL081885; Mon, 12 Feb 2018 04:45:26 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201802120445.w1C4jQBL081885@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 12 Feb 2018 04:45:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329148 - head/etc/devd X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/etc/devd X-SVN-Commit-Revision: 329148 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Feb 2018 04:45:27 -0000 Author: imp Date: Mon Feb 12 04:45:26 2018 New Revision: 329148 URL: https://svnweb.freebsd.org/changeset/base/329148 Log: Switch to using devmatch to autoload drivers. Remove usb.conf as obsolete because devmatch gets its information from the same place as the genration scripts. Added: head/etc/devd/devmatch.conf (contents, props changed) Deleted: head/etc/devd/usb.conf Added: head/etc/devd/devmatch.conf ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/etc/devd/devmatch.conf Mon Feb 12 04:45:26 2018 (r329148) @@ -0,0 +1,13 @@ +# +# $FreeBSD$ +# + +# +# Example devd configuration file for automatically +# loading what modules we can based on nomatch +# events. +# +# Generic NOMATCH event +nomatch 100 { + action "service devmatch onestart" +}; From owner-svn-src-all@freebsd.org Mon Feb 12 04:45:41 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E517FF164EE for ; Mon, 12 Feb 2018 04:45:40 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-it0-x230.google.com (mail-it0-x230.google.com [IPv6:2607:f8b0:4001:c0b::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 74BCA7D6A5 for ; Mon, 12 Feb 2018 04:45:40 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-it0-x230.google.com with SMTP id 193so2352911iti.1 for ; Sun, 11 Feb 2018 20:45:40 -0800 (PST) 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=f/BJ1Pyb3RHFyNXbvF4QncMsmo/e1RfMmT0jGfcZkt8=; b=a/jm+Qhn1J/LEV1Pm9mlQPkH448IlHeX7kkNdtGI8e0TlYsVLeyd8gCctC+JZ/UVo0 yDeiZ+/9jTmcxmz6luN+ADIThnFnrBb4vUpuO2FlHQkgJMsIEf/c1hDoqWgf50Je2tz7 DrGjsUUAES841Xe7ZvRNB6LMkQzeOJ6WiL/m3YWvqCbyJKW6LOnKvi/J7hMgvSB8ax0U GC4hHbYfQKJMMrgMYRK6wv7ZWzB5TL4ZkQQ1a0YNQNOAqDwuVkyxdFCNO+JXsu/6tNnB +3HH9Fx7C3voWZkvWnLvy1ZsnzOeJWtL41ViFIkfg0DICq+zHTiBek/EMr+WgpefTix3 rMEQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=f/BJ1Pyb3RHFyNXbvF4QncMsmo/e1RfMmT0jGfcZkt8=; b=P5T7sTx3WWZ8jLBrPMNfgRjRsQfQGWnRs7FYZ6tsG2zBf/0ScyvhOn3JJQjc1ojwu/ Y8ZSgo+0S5MZ/f1CO0khcmfE/XOFYXN1UKlfUUBSZmk0jRj93L+DegdbFss8By/2vhWl 5xrmkUSyF9c+o6evmgMLkAJFbczQpyUn0YESBDiPdGyb+OF6130bFlJ5+qZGtAtcbE23 7O+7mPTnOEUJhyBOxxme+AjacVxjc19+872Cdwft0F1Ciqusi536N5K1FlSDXY1TU/M7 qBwx48uPuCitavjLP2soIfd5KmvVf/bO857VRBkB4FdtDwgikpTAv6zqRULU+nf2x352 +UbA== X-Gm-Message-State: APf1xPChlk9Vj2awVTw9V2oLjtA+xbcDbN34qr6Tu/AdqDA9dY+UmtBJ mZHkBurUY/EuZk+aCkpnv/Y1tEQJTV2sAf91g85UJQ== X-Google-Smtp-Source: AH8x227W4Drqfwj6yv+OGVQfFtHabWWjhK+P3MybINhlz5sHxVtk9Jnfc3CGIX33y5Y3Rgjsx3AQjj4y2sxggDq5w0w= X-Received: by 10.36.145.139 with SMTP id i133mr4199353ite.69.1518410739752; Sun, 11 Feb 2018 20:45:39 -0800 (PST) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.201.67 with HTTP; Sun, 11 Feb 2018 20:45:38 -0800 (PST) X-Originating-IP: [50.253.99.174] In-Reply-To: References: <1518374549.32585.238.camel@freebsd.org> <201802112346.w1BNkPXc041510@pdx.rh.CN85.dnsmgr.net> From: Warner Losh Date: Sun, 11 Feb 2018 21:45:38 -0700 X-Google-Sender-Auth: 5IVKZZVDqZRBKdk6YH9EPzXqPGU Message-ID: Subject: Re: svn commit: r329126 - head/etc/devd To: "Conrad E. Meyer" Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.25 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Feb 2018 04:45:41 -0000 Sigh. r329147, r329148. Trivial. Warner On Sun, Feb 11, 2018 at 9:41 PM, Conrad Meyer wrote: > As usual, I'll believe it when I see it. If it's so easy, seems like > you could just commit it today. And if it's not so easy, maybe the > integration isn't so trivial. > > On Sun, Feb 11, 2018 at 8:27 PM, Warner Losh wrote: > > > > > > On Sun, Feb 11, 2018 at 8:54 PM, Conrad Meyer wrote: > >> > >> On Sun, Feb 11, 2018 at 6:58 PM, Warner Losh wrote: > >> > No, it's another reason why generated devd files are wrong in the face > >> > of > >> > devmatch. > >> > >> Devmatch is both vaporware and orthogonal to the placement of > >> pre-devmatch static system databases. > > > > > > kldload $(devmatch | uniq) would do the trick. > > > > I take exception to the vaporware comment. At worst it's incompletely > > integrated. The point is that these generated things are at worst a > > transient thing that aren't worth moving or even arguing about where they > > should have gone were they not set for deletion soon. > > > > Warner > From owner-svn-src-all@freebsd.org Mon Feb 12 04:52:25 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B9136F16E75; Mon, 12 Feb 2018 04:52:25 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6C7BF7DD6C; Mon, 12 Feb 2018 04:52:25 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 67551555D; Mon, 12 Feb 2018 04:52:25 +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 w1C4qPAe086602; Mon, 12 Feb 2018 04:52:25 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1C4qPQh086600; Mon, 12 Feb 2018 04:52:25 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201802120452.w1C4qPQh086600@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 12 Feb 2018 04:52:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329149 - head/etc/rc.d X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/etc/rc.d X-SVN-Commit-Revision: 329149 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Feb 2018 04:52:25 -0000 Author: imp Date: Mon Feb 12 04:52:25 2018 New Revision: 329149 URL: https://svnweb.freebsd.org/changeset/base/329149 Log: Install devmatch int /etc/rc.d and echo modules being installed. Modified: head/etc/rc.d/Makefile head/etc/rc.d/devmatch Modified: head/etc/rc.d/Makefile ============================================================================== --- head/etc/rc.d/Makefile Mon Feb 12 04:45:26 2018 (r329148) +++ head/etc/rc.d/Makefile Mon Feb 12 04:52:25 2018 (r329149) @@ -29,6 +29,7 @@ FILES= DAEMON \ defaultroute \ devd \ devfs \ + devmatch \ dhclient \ dmesg \ dumpon \ Modified: head/etc/rc.d/devmatch ============================================================================== --- head/etc/rc.d/devmatch Mon Feb 12 04:45:26 2018 (r329148) +++ head/etc/rc.d/devmatch Mon Feb 12 04:52:25 2018 (r329149) @@ -33,7 +33,7 @@ . /etc/rc.subr name="devmatch" -desc="Use devmatch(8) to load kernel modules +desc="Use devmatch(8) to load kernel modules" start_cmd="${name}_start" stop_cmd=':' @@ -46,7 +46,7 @@ devmatch_start() [ -n "$x" ] || return - echo "Autoloading modules" + echo "Autoloading modules: ${x}" kldload ${x} } From owner-svn-src-all@freebsd.org Mon Feb 12 04:54:51 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BE793F17279; Mon, 12 Feb 2018 04:54:51 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 71CD57E175; Mon, 12 Feb 2018 04:54:51 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6C9275568; Mon, 12 Feb 2018 04:54:51 +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 w1C4sptW086857; Mon, 12 Feb 2018 04:54:51 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1C4sp4o086856; Mon, 12 Feb 2018 04:54:51 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201802120454.w1C4sp4o086856@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 12 Feb 2018 04:54:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329150 - head/etc/devd X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/etc/devd X-SVN-Commit-Revision: 329150 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Feb 2018 04:54:51 -0000 Author: imp Date: Mon Feb 12 04:54:51 2018 New Revision: 329150 URL: https://svnweb.freebsd.org/changeset/base/329150 Log: Install devmatch.conf, don't install usb.conf Modified: head/etc/devd/Makefile Modified: head/etc/devd/Makefile ============================================================================== --- head/etc/devd/Makefile Mon Feb 12 04:52:25 2018 (r329149) +++ head/etc/devd/Makefile Mon Feb 12 04:54:51 2018 (r329150) @@ -12,13 +12,14 @@ FILES+= apple.conf .if ${MK_ACPI} != "no" FILES+= asus.conf .endif +FILES+=devmatch.conf .if ${MK_HYPERV} != "no" FILES+= hyperv.conf .endif .endif .if ${MK_USB} != "no" -FILES+= uath.conf ulpt.conf usb.conf +FILES+= uath.conf ulpt.conf .endif .if ${MK_ZFS} != "no" From owner-svn-src-all@freebsd.org Mon Feb 12 05:01:25 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 08CBFF17A86; Mon, 12 Feb 2018 05:01:25 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-it0-f48.google.com (mail-it0-f48.google.com [209.85.214.48]) (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 9C6B87E66E; Mon, 12 Feb 2018 05:01:24 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-it0-f48.google.com with SMTP id e1so5121607ita.0; Sun, 11 Feb 2018 21:01:24 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:reply-to:in-reply-to:references :from:date:message-id:subject:to:cc; bh=RExAIDMbONLN8FmSEYCCg2u39hxGmd1WUZmtlE0Ql5M=; b=D6RQlvHnJi7TyKi2GcaKfEcAPHEPhDgnolSkY/NxW8AlBCMUIeSNbf1ha78k5xirEe wutXtydIUOtr5mr3qM+EHaLap6lJeW9KJ/BbPwq92cZULoQGL3Kom6u3fFXRpfK377a4 DDPvTIZHnsEbjODrJd9tB3sL+arHTRAA6iSGXt5FJj2+9abhVIUyi59VceDHMlQ4krWZ 4BOIrBkwGZQdxIZkf7x7xUA25ryfB9S8EHA6/vyCXDH/QPA3OGW1GiQUmvksTL8wPmxV 71uDJ1RXNRmippBXUnUs9XRnBrZfMVdhgtCqac+BbGRdtb9TVEhxXAW5FmyPxW+UmgNB 3sig== X-Gm-Message-State: APf1xPDbYGI4Go6Z5IAI7f0BrXj95t1kD5ke2UDUDz/XuD3MtWpKRWMb Q65G6h3vNkkRcKfjliWyXop6gsDD X-Google-Smtp-Source: AH8x227J0D7iaxqKHCkXpNMeSXejGimbOI9g7PwCx7F/rIkM+S1NhiTu4AqhgjSBvEeg7gFY687m7Q== X-Received: by 10.36.89.73 with SMTP id p70mr4334676itb.117.1518411678483; Sun, 11 Feb 2018 21:01:18 -0800 (PST) Received: from mail-it0-f44.google.com (mail-it0-f44.google.com. [209.85.214.44]) by smtp.gmail.com with ESMTPSA id f16sm8711621iob.75.2018.02.11.21.01.18 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 11 Feb 2018 21:01:18 -0800 (PST) Received: by mail-it0-f44.google.com with SMTP id b66so5246423itd.5; Sun, 11 Feb 2018 21:01:18 -0800 (PST) X-Received: by 10.36.204.139 with SMTP id x133mr4082091itf.75.1518411678091; Sun, 11 Feb 2018 21:01:18 -0800 (PST) MIME-Version: 1.0 Reply-To: cem@freebsd.org Received: by 10.2.30.149 with HTTP; Sun, 11 Feb 2018 21:01:17 -0800 (PST) In-Reply-To: References: <1518374549.32585.238.camel@freebsd.org> <201802112346.w1BNkPXc041510@pdx.rh.CN85.dnsmgr.net> From: Conrad Meyer Date: Sun, 11 Feb 2018 21:01:17 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r329126 - head/etc/devd To: Warner Losh Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Feb 2018 05:01:25 -0000 I am happy with this outcome, thanks. On Sun, Feb 11, 2018 at 8:45 PM, Warner Losh wrote: > Sigh. r329147, r329148. > > Trivial. > > Warner > > > On Sun, Feb 11, 2018 at 9:41 PM, Conrad Meyer wrote: >> >> As usual, I'll believe it when I see it. If it's so easy, seems like >> you could just commit it today. And if it's not so easy, maybe the >> integration isn't so trivial. >> >> On Sun, Feb 11, 2018 at 8:27 PM, Warner Losh wrote: >> > >> > >> > On Sun, Feb 11, 2018 at 8:54 PM, Conrad Meyer wrote: >> >> >> >> On Sun, Feb 11, 2018 at 6:58 PM, Warner Losh wrote: >> >> > No, it's another reason why generated devd files are wrong in the >> >> > face >> >> > of >> >> > devmatch. >> >> >> >> Devmatch is both vaporware and orthogonal to the placement of >> >> pre-devmatch static system databases. >> > >> > >> > kldload $(devmatch | uniq) would do the trick. >> > >> > I take exception to the vaporware comment. At worst it's incompletely >> > integrated. The point is that these generated things are at worst a >> > transient thing that aren't worth moving or even arguing about where >> > they >> > should have gone were they not set for deletion soon. >> > >> > Warner > > From owner-svn-src-all@freebsd.org Mon Feb 12 05:01:43 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AAF47F17C2C for ; Mon, 12 Feb 2018 05:01:43 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-io0-x22a.google.com (mail-io0-x22a.google.com [IPv6:2607:f8b0:4001:c06::22a]) (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 33F0E7E7D4 for ; Mon, 12 Feb 2018 05:01:43 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-io0-x22a.google.com with SMTP id b198so15989357iof.6 for ; Sun, 11 Feb 2018 21:01:43 -0800 (PST) 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=lHXC62wI/ejUbwip37G78dkcIuGyDzOV47nJB3oh0y4=; b=afUh1ZCGiaOWIdLZP1hgXembM0uYT2JviV6rrxcQe97C69sYzVNnTL+EZXI0Jlcnq6 Wu+1vrgQ/IKW7ZAnFgnPyAwZAWx7zBg2oEBd51zoJiOLm+rwa5mlITryVKoYRv0wnOLz cIHBTImFBvTGjzRCxhdgDtkFHH855CVNJYSOEwuOa/QRijj08a0zNvSe2vq98HjV8ogj /Q419xhTVEGqVFAG+/46Jy9VdSKXYNnqTVwe7kuXd3hObJDeC6wXSnkyvYNPhSkj6+8T sGVKBJsjS4M2hESUg/cItj/bmwVu7ae8U7mQgSCjpvYaIcyvvVMzFmh3r0tBdoHF0QZA oFDw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=lHXC62wI/ejUbwip37G78dkcIuGyDzOV47nJB3oh0y4=; b=KPT6bXe9hoCvJUrWeWgNkAMVisxZ16tHeFmKpFNKYmrkZj4tsDgxi9bGrZc57zAcbh Ufq9YXj/ifdeVjLGtx0gULWbX99wNPXrIV+CGUiXIlnxehrcUSqk7oVN/AKswjKI4S8x OxwZeX2iJYpEgtpwt6yWLUWV0CR34JFyDPsS3fM8J7MgnrOsnciYH7iZKv4Yc+sSIXn6 b39/RLEFmlF2zJoAWrA/iUTVB5mhj7lIJ1xvaIbGd2PqfL+NjoAhiPndR1QfZHIlyZPn m5T6cwiJ/eQgvwEpcYqgfb9cUuj2Bk7/edpOV7DaO0D5pD/EqP0kiXXAOYeTqLGeIuqF COMQ== X-Gm-Message-State: APf1xPBRWA4eXxYO45vpaXc+VouC/deuA8iWOfKUHBEuV8uMrsEhep9x mNqt3iwQ0PBFNPumk2Ltx9yCGmg863Mf6ekHW1QnVw== X-Google-Smtp-Source: AH8x224TSxgFIpzBmbXC+zXC+2JlniZRd7J9PCqX7DxH71/XXtLU+wceQWjINmSoaa2eNVcO67xxT4XjRq9P1G4Lp4c= X-Received: by 10.107.30.146 with SMTP id e140mr11663461ioe.291.1518411702521; Sun, 11 Feb 2018 21:01:42 -0800 (PST) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.201.67 with HTTP; Sun, 11 Feb 2018 21:01:41 -0800 (PST) X-Originating-IP: [50.253.99.174] In-Reply-To: References: <1518374549.32585.238.camel@freebsd.org> <201802112346.w1BNkPXc041510@pdx.rh.CN85.dnsmgr.net> From: Warner Losh Date: Sun, 11 Feb 2018 22:01:41 -0700 X-Google-Sender-Auth: LyFCZzAc81BNAOkEDJ0_sjlURsA Message-ID: Subject: Re: svn commit: r329126 - head/etc/devd To: "Conrad E. Meyer" Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.25 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Feb 2018 05:01:43 -0000 OK. I guess I shouldn't push when angry to try to prove a point. That never works out well... So, I needed r329149 and 329150 as well to tweak a couple of things. Warner On Sun, Feb 11, 2018 at 9:45 PM, Warner Losh wrote: > Sigh. r329147, r329148. > > Trivial. > > Warner > > > On Sun, Feb 11, 2018 at 9:41 PM, Conrad Meyer wrote: > >> As usual, I'll believe it when I see it. If it's so easy, seems like >> you could just commit it today. And if it's not so easy, maybe the >> integration isn't so trivial. >> >> On Sun, Feb 11, 2018 at 8:27 PM, Warner Losh wrote: >> > >> > >> > On Sun, Feb 11, 2018 at 8:54 PM, Conrad Meyer wrote: >> >> >> >> On Sun, Feb 11, 2018 at 6:58 PM, Warner Losh wrote: >> >> > No, it's another reason why generated devd files are wrong in the >> face >> >> > of >> >> > devmatch. >> >> >> >> Devmatch is both vaporware and orthogonal to the placement of >> >> pre-devmatch static system databases. >> > >> > >> > kldload $(devmatch | uniq) would do the trick. >> > >> > I take exception to the vaporware comment. At worst it's incompletely >> > integrated. The point is that these generated things are at worst a >> > transient thing that aren't worth moving or even arguing about where >> they >> > should have gone were they not set for deletion soon. >> > >> > Warner >> > > From owner-svn-src-all@freebsd.org Mon Feb 12 05:04:33 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E66EEF18090; Mon, 12 Feb 2018 05:04:32 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-it0-f50.google.com (mail-it0-f50.google.com [209.85.214.50]) (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 725AB7EB7C; Mon, 12 Feb 2018 05:04:32 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-it0-f50.google.com with SMTP id n206so5119381itg.1; Sun, 11 Feb 2018 21:04:32 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:reply-to:in-reply-to:references :from:date:message-id:subject:to:cc; bh=Pp6yUQBruIdI+IFEgbt+p2hRcNg355tuE2xjAhM8tT4=; b=iG53Dcg3VBNfu0+R14u96euT3ISHHrwxPiztV+JusUfRo5VbShMbuIPAMfow159Wdi 57ZqMkY55jdQ+GYKkG44iVYR2Gvvw0tIbZpV1HJpclwkzHfIOC5tnkwGdpCf5lSP5jJo RT4hmcvhbWJaHwrd9b+tWEIOL80PmccdhSw8bBWxrDAxwsngvha6Rq5KGj90aFeQhnpy An6c6TbV1pysBc625ypLqt8p3Zuh9C83eL78gG0IW6xJ0xf9GOKxWXgRxy3MBhPIe31J x9c5kJbsEp1ieZu2x/Da5gYNlyvxD4K7qNMEg5QNGQrohbx3shUsAfQcUv8JFZXdWH5e E9nQ== X-Gm-Message-State: APf1xPBmevV39x36IelkN5zvmCJnUd1iXDLchAafoyHpa1BYcTMQwgkR 5o+PRgXobuoJxiuKWHMmbngmw7rR X-Google-Smtp-Source: AH8x225LquiQOrC0PyPVtzKWqZHfuEzBoFH1Iukvwk4KDE4ibQmIwUo3f24OHejGjo38HqBKx9ew1A== X-Received: by 10.36.25.77 with SMTP id b74mr3544004itb.99.1518410510444; Sun, 11 Feb 2018 20:41:50 -0800 (PST) Received: from mail-io0-f172.google.com (mail-io0-f172.google.com. [209.85.223.172]) by smtp.gmail.com with ESMTPSA id w142sm5331965ita.25.2018.02.11.20.41.50 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 11 Feb 2018 20:41:50 -0800 (PST) Received: by mail-io0-f172.google.com with SMTP id e7so1718442ioj.1; Sun, 11 Feb 2018 20:41:50 -0800 (PST) X-Received: by 10.107.2.6 with SMTP id 6mr3130807ioc.117.1518410509899; Sun, 11 Feb 2018 20:41:49 -0800 (PST) MIME-Version: 1.0 Reply-To: cem@freebsd.org Received: by 10.2.30.149 with HTTP; Sun, 11 Feb 2018 20:41:49 -0800 (PST) In-Reply-To: References: <1518374549.32585.238.camel@freebsd.org> <201802112346.w1BNkPXc041510@pdx.rh.CN85.dnsmgr.net> From: Conrad Meyer Date: Sun, 11 Feb 2018 20:41:49 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r329126 - head/etc/devd To: Warner Losh Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Feb 2018 05:04:33 -0000 As usual, I'll believe it when I see it. If it's so easy, seems like you could just commit it today. And if it's not so easy, maybe the integration isn't so trivial. On Sun, Feb 11, 2018 at 8:27 PM, Warner Losh wrote: > > > On Sun, Feb 11, 2018 at 8:54 PM, Conrad Meyer wrote: >> >> On Sun, Feb 11, 2018 at 6:58 PM, Warner Losh wrote: >> > No, it's another reason why generated devd files are wrong in the face >> > of >> > devmatch. >> >> Devmatch is both vaporware and orthogonal to the placement of >> pre-devmatch static system databases. > > > kldload $(devmatch | uniq) would do the trick. > > I take exception to the vaporware comment. At worst it's incompletely > integrated. The point is that these generated things are at worst a > transient thing that aren't worth moving or even arguing about where they > should have gone were they not set for deletion soon. > > Warner From owner-svn-src-all@freebsd.org Mon Feb 12 05:08:28 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 32311F185FC; Mon, 12 Feb 2018 05:08:28 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A4A937EE88; Mon, 12 Feb 2018 05:08:27 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id w1C58NaK042384; Sun, 11 Feb 2018 21:08:23 -0800 (PST) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id w1C58Nj1042383; Sun, 11 Feb 2018 21:08:23 -0800 (PST) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201802120508.w1C58Nj1042383@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r329148 - head/etc/devd In-Reply-To: <201802120445.w1C4jQBL081885@repo.freebsd.org> To: Warner Losh Date: Sun, 11 Feb 2018 21:08:23 -0800 (PST) CC: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Feb 2018 05:08:28 -0000 > Author: imp > Date: Mon Feb 12 04:45:26 2018 > New Revision: 329148 > URL: https://svnweb.freebsd.org/changeset/base/329148 > > Log: > Switch to using devmatch to autoload drivers. Remove usb.conf > as obsolete because devmatch gets its information from the same > place as the genration scripts. > > Added: > head/etc/devd/devmatch.conf (contents, props changed) > Deleted: > head/etc/devd/usb.conf I know you did this in a hurry and as you said while angry, perhaps take a day and step back? I think this was rather hap hazzard, and now devmatch is stucking files in devd that is to be obsoleted, is this really how we want this nice clean solution to start its new life? > Added: head/etc/devd/devmatch.conf Shouldnt this gone to head/etc/devmatch? > ============================================================================== > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/etc/devd/devmatch.conf Mon Feb 12 04:45:26 2018 (r329148) > @@ -0,0 +1,13 @@ > +# > +# $FreeBSD$ > +# > + > +# > +# Example devd configuration file for automatically > +# loading what modules we can based on nomatch > +# events. > +# > +# Generic NOMATCH event > +nomatch 100 { > + action "service devmatch onestart" > +}; > > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Mon Feb 12 05:10:32 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C4D6FF18889; Mon, 12 Feb 2018 05:10:32 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 434957F0A7; Mon, 12 Feb 2018 05:10:32 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id w1C5AUvg042401; Sun, 11 Feb 2018 21:10:30 -0800 (PST) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id w1C5AUFY042400; Sun, 11 Feb 2018 21:10:30 -0800 (PST) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201802120510.w1C5AUFY042400@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r329150 - head/etc/devd In-Reply-To: <201802120454.w1C4sp4o086856@repo.freebsd.org> To: Warner Losh Date: Sun, 11 Feb 2018 21:10:30 -0800 (PST) CC: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Feb 2018 05:10:32 -0000 [ Charset UTF-8 unsupported, converting... ] > Author: imp > Date: Mon Feb 12 04:54:51 2018 > New Revision: 329150 > URL: https://svnweb.freebsd.org/changeset/base/329150 > > Log: > Install devmatch.conf, don't install usb.conf Doesnt this break devd and anyone depending on it? Does usb.conf need to go in OBSOLETEFILES now? Relnotes y? > Modified: > head/etc/devd/Makefile > > Modified: head/etc/devd/Makefile > ============================================================================== > --- head/etc/devd/Makefile Mon Feb 12 04:52:25 2018 (r329149) > +++ head/etc/devd/Makefile Mon Feb 12 04:54:51 2018 (r329150) > @@ -12,13 +12,14 @@ FILES+= apple.conf > .if ${MK_ACPI} != "no" > FILES+= asus.conf > .endif > +FILES+=devmatch.conf ^ missing tab > .if ${MK_HYPERV} != "no" > FILES+= hyperv.conf > .endif > .endif > > .if ${MK_USB} != "no" > -FILES+= uath.conf ulpt.conf usb.conf > +FILES+= uath.conf ulpt.conf > .endif > > .if ${MK_ZFS} != "no" -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Mon Feb 12 05:11:33 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C4292F189C8 for ; Mon, 12 Feb 2018 05:11:33 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-io0-x22c.google.com (mail-io0-x22c.google.com [IPv6:2607:f8b0:4001:c06::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 5769B7F2F6 for ; Mon, 12 Feb 2018 05:11:33 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-io0-x22c.google.com with SMTP id z6so15981211iob.11 for ; Sun, 11 Feb 2018 21:11:33 -0800 (PST) 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=flxb0kInjQ4DN7Ve9Bfb61Hxcri1iKkZrDhyhpQlXvE=; b=VkJdCYbb0Zxoi8LVJ0tlvYdCMOvQre5WFG8AalGexoBoM2ExOi+duXZy1j6xigKvwh HFVMXt3k66v4ECtC17R5L4IKzok37YLaRI2e+v4NfRtaVb/JiNYJrqukDtM5r7/QAjgJ aAAKIb6nvZ0cBs43VQU1/5U/kHN1BO7+KgXjZVsR2rlaMWKlyYPkUh0AEIqaEQFpcxzt c5q6MvEcTo4ANvQRvHqYgGGS/4eLq3MPejgcGbSFar4E8CG7AIQeWAczYWwex0KPOkjq D9zBYsHF33Pt1jM2XCD0M30FUZX+aFONKQ0x7lyxzWtddjvdyY6TBWk/ddksLdjoK2r3 ozIA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=flxb0kInjQ4DN7Ve9Bfb61Hxcri1iKkZrDhyhpQlXvE=; b=p3eyZfFIXPB41VLlTsCw0xxzJdbbMI/Ype5NRWtTRSHfErWlmVj9K1OB3rFoU5CLt1 JJIcDC4e5HeIZ3ymJe5IPF2s/Tglzm72tW4LMW8r7vI7Z/eb/AmKvc8RqjzHI+3cQMqm DlCMWVbk8FJm5WkkCwhmTIa6s4Ec/sShU5PqNf1Ae1BKC2Qa0HGS5wCAC5Z8WvFWg2h3 XwFe4THs+qCmKV9nYhOp/cRRJO+anwOHnjW7aLsL3aQFsNoQco0SQ4fTOk8KOYnbiAdS iKvC3h9Xpl7GnMbkMxCdRdy4RDefX4yecWAPLU9Qf4Xq0LzuWtG0jF0Qby3JBkRhpyEs WzEw== X-Gm-Message-State: APf1xPDxq8X1tXsZrGCCcTWIViJmEGRjUr3Kox6p7CaUt0yq/N2dZknY KX6JUO/MexAuj3IHwho82NoNXUM2xl8YNRLu/9VNlg== X-Google-Smtp-Source: AH8x22769huMIzFA/i+jk0rnX2hFGHfal2j+O/DI5G4CDp9WzsohXiqy0rUgJ5hzsuVEPStW6uEaroChU5PlDRomewA= X-Received: by 10.107.172.130 with SMTP id v124mr7551949ioe.301.1518412292703; Sun, 11 Feb 2018 21:11:32 -0800 (PST) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.201.67 with HTTP; Sun, 11 Feb 2018 21:11:31 -0800 (PST) X-Originating-IP: [2603:300b:6:5100:b0a7:f4b6:69f8:4eba] Received: by 10.79.201.67 with HTTP; Sun, 11 Feb 2018 21:11:31 -0800 (PST) In-Reply-To: <201802120508.w1C58Nj1042383@pdx.rh.CN85.dnsmgr.net> References: <201802120445.w1C4jQBL081885@repo.freebsd.org> <201802120508.w1C58Nj1042383@pdx.rh.CN85.dnsmgr.net> From: Warner Losh Date: Sun, 11 Feb 2018 22:11:31 -0700 X-Google-Sender-Auth: K1A4zxyVU8iPNkV-viQ121YRAaQ Message-ID: Subject: Re: svn commit: r329148 - head/etc/devd To: "Rodney W. Grimes" Cc: Warner Losh , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.25 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Feb 2018 05:11:34 -0000 On Feb 11, 2018 10:08 PM, "Rodney W. Grimes" wrote: > Author: imp > Date: Mon Feb 12 04:45:26 2018 > New Revision: 329148 > URL: https://svnweb.freebsd.org/changeset/base/329148 > > Log: > Switch to using devmatch to autoload drivers. Remove usb.conf > as obsolete because devmatch gets its information from the same > place as the genration scripts. > > Added: > head/etc/devd/devmatch.conf (contents, props changed) > Deleted: > head/etc/devd/usb.conf I know you did this in a hurry and as you said while angry, perhaps take a day and step back? I think this was rather hap hazzard, and now devmatch is stucking files in devd that is to be obsoleted, is this really how we want this nice clean solution to start its new life? No time like the present. > Added: head/etc/devd/devmatch.conf Shouldnt this gone to head/etc/devmatch? No. Warner > ============================================================ ================== > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/etc/devd/devmatch.conf Mon Feb 12 04:45:26 2018 (r329148) > @@ -0,0 +1,13 @@ > +# > +# $FreeBSD$ > +# > + > +# > +# Example devd configuration file for automatically > +# loading what modules we can based on nomatch > +# events. > +# > +# Generic NOMATCH event > +nomatch 100 { > + action "service devmatch onestart" > +}; > > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Mon Feb 12 05:28:22 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D4EB6F19E44 for ; Mon, 12 Feb 2018 05:28:21 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-io0-x229.google.com (mail-io0-x229.google.com [IPv6:2607:f8b0:4001:c06::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 5C8B57FF88 for ; Mon, 12 Feb 2018 05:28:21 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-io0-x229.google.com with SMTP id l17so16070373ioc.3 for ; Sun, 11 Feb 2018 21:28:21 -0800 (PST) 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=dDyDaknlbJURQwCkaL+TzqaGbR0PKKfz8nc2qfJzdiM=; b=kxC0Gk0mRk4fYpMCUzIbNMMfzpxEAetdaX1OCQ+/PSIC6v0rCgLRRvTc+I41SmBNQH nrOT6VmQ5UeLB8d/XYiTbzSWSlpWxKZHSA0XwiWJhmvfh+TOMEWWUP/sNMabLeZ5OD17 +QhAM+lZqd9/ElNabLSrEL3eG46qKPKbMFTjYT0/q7+u0zqeZ9jLdVpyELDo7lrUjEhI eAN9da4J06ws4KhsJ+0EFD3YdnZUkP7UF/CnHpHunn5M/n5nafRSiU1tb3/EzdUltMa8 O+U8ZaahAzFwzU5U/DfAUpahmPKLU0aWxElCn82Wa7uFU2UNbRs8mFFe0oIeiyfChGVm ZOJw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=dDyDaknlbJURQwCkaL+TzqaGbR0PKKfz8nc2qfJzdiM=; b=mLdr5diPki1uSqrdSA5IQT6FiWd3KSQ7NgUIa+9lTtu1ofV4PvpfudZ5KTfiCbDKRW /qCyiKjaxe+MQhH58kM8RQ3N5eaISJGvrEtkovAPKcXHSvKCnB54N8Q4iW6TLOu8ikJz 24U4ThkTBacj2MEeDK5YDpIPl+07l2FaAODPrOo6x2b3g/K4ZNY6KVWxQJmJabCVfUhA l23pNHKsOQzDXFWNLrIiU9nSpqXGwsLLrXyshucrOMvlrfSmGHu7D0ffV/VFfh1qyXcu +SkAyLoJ1LpesGwx1xvYPpDgp0aDLvc9S/rignNlmN0p1smlLEAwX2i/Oeuc0ir/iLxx GVew== X-Gm-Message-State: APf1xPDUgZ0+s3z5qufRnpCFIGx0ny4mLb/S56eV1ZkIimQn5tJBJhA0 38ytj5WSmgKbbFiLEtjlzfKmaRHGcP8fg1A1ikyzzw== X-Google-Smtp-Source: AH8x225YmStoircAjnOMmwrPbBCUetzXmDX1hw56gqrSe4cMMr+AqKYeXx4BsEuGEMO2lypQNTvwstOLv5Jv4Jx8Pw0= X-Received: by 10.107.30.146 with SMTP id e140mr11727392ioe.291.1518413300656; Sun, 11 Feb 2018 21:28:20 -0800 (PST) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.201.67 with HTTP; Sun, 11 Feb 2018 21:28:19 -0800 (PST) X-Originating-IP: [2603:300b:6:5100:18a2:a4f7:170:8dd9] In-Reply-To: <201802120510.w1C5AUFY042400@pdx.rh.CN85.dnsmgr.net> References: <201802120454.w1C4sp4o086856@repo.freebsd.org> <201802120510.w1C5AUFY042400@pdx.rh.CN85.dnsmgr.net> From: Warner Losh Date: Sun, 11 Feb 2018 22:28:19 -0700 X-Google-Sender-Auth: QRw0-BiqPeQqMC7CET6iI-uXdLg Message-ID: Subject: Re: svn commit: r329150 - head/etc/devd To: "Rodney W. Grimes" Cc: Warner Losh , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.25 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Feb 2018 05:28:22 -0000 On Sun, Feb 11, 2018 at 10:10 PM, Rodney W. Grimes < freebsd@pdx.rh.cn85.dnsmgr.net> wrote: > [ Charset UTF-8 unsupported, converting... ] > > Author: imp > > Date: Mon Feb 12 04:54:51 2018 > > New Revision: 329150 > > URL: https://svnweb.freebsd.org/changeset/base/329150 > > > > Log: > > Install devmatch.conf, don't install usb.conf > > Doesnt this break devd and anyone depending on it? > I'm having problems understanding how it would break it? > Does usb.conf need to go in OBSOLETEFILES now? > Yes. It should... > Relnotes y? Yes. It's hard to know where in the sequence of on-boarding a new function where to put it. Warner > > > Modified: > > head/etc/devd/Makefile > > > > Modified: head/etc/devd/Makefile > > ============================================================ > ================== > > --- head/etc/devd/Makefile Mon Feb 12 04:52:25 2018 (r329149) > > +++ head/etc/devd/Makefile Mon Feb 12 04:54:51 2018 (r329150) > > @@ -12,13 +12,14 @@ FILES+= apple.conf > > .if ${MK_ACPI} != "no" > > FILES+= asus.conf > > .endif > > +FILES+=devmatch.conf > ^ missing tab > > > .if ${MK_HYPERV} != "no" > > FILES+= hyperv.conf > > .endif > > .endif > > > > .if ${MK_USB} != "no" > > -FILES+= uath.conf ulpt.conf usb.conf > > +FILES+= uath.conf ulpt.conf > > .endif > > > > .if ${MK_ZFS} != "no" > > -- > Rod Grimes > rgrimes@freebsd.org > From owner-svn-src-all@freebsd.org Mon Feb 12 05:28:53 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 95BB4F19F26; Mon, 12 Feb 2018 05:28:53 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3BC29800AC; Mon, 12 Feb 2018 05:28:53 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 36B8A5A46; Mon, 12 Feb 2018 05:28:53 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1C5SrkL002103; Mon, 12 Feb 2018 05:28:53 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1C5SriY002102; Mon, 12 Feb 2018 05:28:53 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201802120528.w1C5SriY002102@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Mon, 12 Feb 2018 05:28:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r329151 - stable/11 X-SVN-Group: stable-11 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: stable/11 X-SVN-Commit-Revision: 329151 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Feb 2018 05:28:53 -0000 Author: kevans Date: Mon Feb 12 05:28:52 2018 New Revision: 329151 URL: https://svnweb.freebsd.org/changeset/base/329151 Log: Record-only merge of r326857 and r326888 These are equal and opposite commits*; one to flip GELI support off by default and another to flip it back on. They were made to circumvent some GELI breakage in head that didn't apply to stable/11. The former commit shows up when looking at MFC candidates for stand/, hence the desire for this record. * Equal and opposite except in that r326857 added a comment to zfsldr.S that likely should not have been added at that time. Modified: Directory Properties: stable/11/ (props changed) From owner-svn-src-all@freebsd.org Mon Feb 12 05:55:45 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E6478F1B833; Mon, 12 Feb 2018 05:55:44 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8D8D181043; Mon, 12 Feb 2018 05:55:44 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 885095F23; Mon, 12 Feb 2018 05:55:44 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1C5tiWm017011; Mon, 12 Feb 2018 05:55:44 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1C5tiZ1017010; Mon, 12 Feb 2018 05:55:44 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201802120555.w1C5tiZ1017010@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Mon, 12 Feb 2018 05:55:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r329152 - stable/11/stand/fdt X-SVN-Group: stable-11 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: stable/11/stand/fdt X-SVN-Commit-Revision: 329152 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Feb 2018 05:55:45 -0000 Author: kevans Date: Mon Feb 12 05:55:44 2018 New Revision: 329152 URL: https://svnweb.freebsd.org/changeset/base/329152 Log: MFC r328505,r328659: stand/fdt improvements r328505: stand/fdt: Check /compatible property on overlay if it exists r328659: stand/fdt: Rip out FDT VA tracking Modified: stable/11/stand/fdt/fdt_loader_cmd.c Directory Properties: stable/11/ (props changed) Modified: stable/11/stand/fdt/fdt_loader_cmd.c ============================================================================== --- stable/11/stand/fdt/fdt_loader_cmd.c Mon Feb 12 05:28:52 2018 (r329151) +++ stable/11/stand/fdt/fdt_loader_cmd.c Mon Feb 12 05:55:44 2018 (r329152) @@ -67,13 +67,10 @@ static struct fdt_header *fdt_to_load = NULL; static struct fdt_header *fdtp = NULL; /* Size of FDT blob */ static size_t fdtp_size = 0; -/* Location of FDT in kernel or module. */ -/* This won't be set if FDT is loaded from disk or memory. */ -/* If it is set, we'll update it when fdt_copy() gets called. */ -static vm_offset_t fdtp_va = 0; static int fdt_load_dtb(vm_offset_t va); static void fdt_print_overlay_load_error(int err, const char *filename); +static int fdt_check_overlay_compatible(void *base_fdt, void *overlay_fdt); static int fdt_cmd_nyi(int argc, char *argv[]); static int fdt_load_dtb_overlays_string(const char * filenames); @@ -220,7 +217,6 @@ fdt_load_dtb(vm_offset_t va) return (1); } - fdtp_va = va; COPYOUT(va, fdtp, fdtp_size); debugf("DTB blob found at 0x%jx, size: 0x%jx\n", (uintmax_t)va, (uintmax_t)fdtp_size); @@ -247,7 +243,6 @@ fdt_load_dtb_addr(struct fdt_header *header) return (1); } - fdtp_va = 0; // Don't write this back into module or kernel. bcopy(header, fdtp, fdtp_size); return (0); } @@ -374,6 +369,62 @@ fdt_load_dtb_overlays_string(const char * filenames) return (0); } +/* + * fdt_check_overlay_compatible - check that the overlay_fdt is compatible with + * base_fdt before we attempt to apply it. It will need to re-calculate offsets + * in the base every time, rather than trying to cache them earlier in the + * process, because the overlay application process can/will invalidate a lot of + * offsets. + */ +static int +fdt_check_overlay_compatible(void *base_fdt, void *overlay_fdt) +{ + const char *compat; + int compat_len, ocompat_len; + int oroot_offset, root_offset; + int slidx, sllen; + + oroot_offset = fdt_path_offset(overlay_fdt, "/"); + if (oroot_offset < 0) + return (oroot_offset); + /* + * If /compatible in the overlay does not exist or if it is empty, then + * we're automatically compatible. We do this for the sake of rapid + * overlay development for overlays that aren't intended to be deployed. + * The user assumes the risk of using an overlay without /compatible. + */ + if (fdt_get_property(overlay_fdt, oroot_offset, "compatible", + &ocompat_len) == NULL || ocompat_len == 0) + return (0); + root_offset = fdt_path_offset(base_fdt, "/"); + if (root_offset < 0) + return (root_offset); + /* + * However, an empty or missing /compatible on the base is an error, + * because allowing this offers no advantages. + */ + if (fdt_get_property(base_fdt, root_offset, "compatible", + &compat_len) == NULL) + return (compat_len); + else if(compat_len == 0) + return (1); + + slidx = 0; + compat = fdt_stringlist_get(overlay_fdt, oroot_offset, "compatible", + slidx, &sllen); + while (compat != NULL) { + if (fdt_stringlist_search(base_fdt, root_offset, "compatible", + compat) >= 0) + return (0); + ++slidx; + compat = fdt_stringlist_get(overlay_fdt, oroot_offset, + "compatible", slidx, &sllen); + }; + + /* We've exhausted the overlay's /compatible property... no match */ + return (1); +} + void fdt_apply_overlays() { @@ -406,6 +457,13 @@ fdt_apply_overlays() current_fdtp = fdtp; current_fdtp_size = fdtp_size; for (fp = file_findfile(NULL, "dtbo"); fp != NULL; fp = fp->f_next) { + COPYOUT(fp->f_addr, overlay, fp->f_size); + /* Check compatible first to avoid unnecessary allocation */ + rv = fdt_check_overlay_compatible(current_fdtp, overlay); + if (rv != 0) { + printf("DTB overlay '%s' not compatible\n", fp->f_name); + continue; + } printf("applying DTB overlay '%s'\n", fp->f_name); next_fdtp_size = current_fdtp_size + fp->f_size; next_fdtp = malloc(next_fdtp_size); @@ -423,7 +481,6 @@ fdt_apply_overlays() printf("failed to open base dtb into overlay base\n"); continue; } - COPYOUT(fp->f_addr, overlay, fp->f_size); /* Both overlay and next_fdtp may be modified in place */ rv = fdt_overlay_apply(next_fdtp, overlay); if (rv == 0) { @@ -899,11 +956,6 @@ fdt_copy(vm_offset_t va) if (fdt_fixup() == 0) return (0); - if (fdtp_va != 0) { - /* Overwrite the FDT with the fixed version. */ - /* XXX Is this really appropriate? */ - COPYIN(fdtp, fdtp_va, fdtp_size); - } COPYIN(fdtp, va, fdtp_size); return (fdtp_size); } From owner-svn-src-all@freebsd.org Mon Feb 12 06:05:46 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1B5C9F1BEF1; Mon, 12 Feb 2018 06:05:46 +0000 (UTC) (envelope-from allanjude@freebsd.org) Received: from mx1.scaleengine.net (mx1.scaleengine.net [209.51.186.6]) (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 B12D4815C1; Mon, 12 Feb 2018 06:05:45 +0000 (UTC) (envelope-from allanjude@freebsd.org) Received: from [10.1.1.2] (Seawolf.HML3.ScaleEngine.net [209.51.186.28]) (Authenticated sender: allanjude.freebsd@scaleengine.com) by mx1.scaleengine.net (Postfix) with ESMTPSA id DD31514386; Mon, 12 Feb 2018 06:05:38 +0000 (UTC) Subject: Re: svn commit: r329126 - head/etc/devd To: rgrimes@freebsd.org, Ian Lepore Cc: cem@freebsd.org, src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201802112346.w1BNkPXc041510@pdx.rh.CN85.dnsmgr.net> From: Allan Jude Message-ID: <2ca53192-e55f-cbb3-6490-f111d23be408@freebsd.org> Date: Mon, 12 Feb 2018 01:05:36 -0500 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: <201802112346.w1BNkPXc041510@pdx.rh.CN85.dnsmgr.net> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="zB3zvhv0oS4KbfRx4mJPpdMTJ8iKUjMcn" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Feb 2018 06:05:46 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --zB3zvhv0oS4KbfRx4mJPpdMTJ8iKUjMcn Content-Type: multipart/mixed; boundary="M6cxDh6BA09cfIrlwR2FZ1iykKcXfMtzk"; protected-headers="v1" From: Allan Jude To: rgrimes@freebsd.org, Ian Lepore Cc: cem@freebsd.org, src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: <2ca53192-e55f-cbb3-6490-f111d23be408@freebsd.org> Subject: Re: svn commit: r329126 - head/etc/devd References: <201802112346.w1BNkPXc041510@pdx.rh.CN85.dnsmgr.net> In-Reply-To: <201802112346.w1BNkPXc041510@pdx.rh.CN85.dnsmgr.net> --M6cxDh6BA09cfIrlwR2FZ1iykKcXfMtzk Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable On 2018-02-11 18:46, Rodney W. Grimes wrote: > [ Charset ISO-8859-1 unsupported, converting... ] >> On Sun, 2018-02-11 at 10:20 -0800, Conrad Meyer wrote: >>> On Sun, Feb 11, 2018 at 8:35 AM, Ian Lepore wrote: >>>> >>>> Author: ian >>>> Date: Sun Feb 11 16:35:56 2018 >>>> New Revision: 329126 >>>> URL: https://svnweb.freebsd.org/changeset/base/329126 >>>> >>>> Log: >>>> ? Regenerate devd/usb.conf after the recent addition of several new >>>> device IDs. >>>> >>>> Modified: >>>> ? head/etc/devd/usb.conf >>> >>> If this file is machine generated and not an administrator >>> configuration file, shouldn't it live in /usr/share instead of /etc, >>> per hier(7)? >>> >>> Best, >>> Conrad >>> >> >> I wonder if that question would apply to all five files we put in >> /etc/devd? ?It looks like they could be moved to /usr/share with >> minimal fuss by adding that directory to the search list in >> /etc/devd.conf. >=20 > Moving this to /usr creates a cyclic issue in that you then need > /usr to be mounted before devd can start and devd's /etc/rc.d file > says: > # PROVIDE: devd > # REQUIRE: NETWORKING > # BEFORE: mountcritremote > # KEYWORD: nojail >=20 > In the diskless and nfs shared /usr worlds devd wants to start > before /usr is mounted. >=20 >> I'm agnostic about the value of moving them. ?Users can configure loca= l >> rules by modifying the existing devd.conf and files in devd/ and >> dealing with mergemaster on updates, or by adding their own new files >> in devd/. >=20 Maybe the correct place is /etc/defaults/devd/ then? --=20 Allan Jude --M6cxDh6BA09cfIrlwR2FZ1iykKcXfMtzk-- --zB3zvhv0oS4KbfRx4mJPpdMTJ8iKUjMcn Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (MingW32) iQIcBAEBAgAGBQJagS6zAAoJEBmVNT4SmAt+XUQP/3kg4PloHzAUJKba0T6fLMNT oQbhulH74ndPAEKuJ9LwWiew390RxAyQe6HfReiPJndM49WYWajhyIAiESdBcpNB 7ZUzerXYguZ8pEnJo1JuHWbOBOKhNY+oYYLcBHuhlfyKAhMZrsgVVWQxJXbBllFd 86W8udd6f/jKZY1eFo0WmWgh40MX57FodDaOU4QTTCaxQc54596WRkbQ4wtxi7Z2 P9yeKB7mez8M7gtpDH5nPSope3qx5YwiPjObPL+U1kHSMg5pNDuHB7uTEPBk/Tnx tv6+7kNpOok4usr+p/PER7voTihLsvet2BUz2/odyTl4MsJlYEQZCKkwy8UGYd1v mxBNtzKJ7HDP6FPCbffhOvXZUqtSchv5/TOKVTjAmGGE+59iu4PmxDDe4IInVNmB DURf6WsuVsfAvbEr4BmQfoWdjJ45m0tA3NXvgOuW0mLMg3S7GSFD11avIECsPWXW jCIP6TNUkV12qa8UK1PfNnatFTk08Vqezsa96yIcE/tNzjDwk69J0BY64xt2TsP0 S1qlnJOAqNYDbI0JOmlgyXt+olTLjvg6pixwMtQ4kkiss/VLttKs772w6uQ6fuIo N4h7tZnjA0s3Z58XAWjH/PrKygt5GHEyGwLZAkg7s4Ph3iAMQExkZIGsitLk8DV9 fJvEAKfoRqy0gMO7eQ6X =YJGP -----END PGP SIGNATURE----- --zB3zvhv0oS4KbfRx4mJPpdMTJ8iKUjMcn-- From owner-svn-src-all@freebsd.org Mon Feb 12 06:08:12 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1AD27F1C0AA; Mon, 12 Feb 2018 06:08:12 +0000 (UTC) (envelope-from allanjude@freebsd.org) Received: from mx1.scaleengine.net (mx1.scaleengine.net [209.51.186.6]) (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 A0CAE81771; Mon, 12 Feb 2018 06:08:11 +0000 (UTC) (envelope-from allanjude@freebsd.org) Received: from [10.1.1.2] (Seawolf.HML3.ScaleEngine.net [209.51.186.28]) (Authenticated sender: allanjude.freebsd@scaleengine.com) by mx1.scaleengine.net (Postfix) with ESMTPSA id DD7E71438D; Mon, 12 Feb 2018 06:08:10 +0000 (UTC) Subject: Re: svn commit: r329150 - head/etc/devd To: Warner Losh , "Rodney W. Grimes" Cc: Warner Losh , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201802120454.w1C4sp4o086856@repo.freebsd.org> <201802120510.w1C5AUFY042400@pdx.rh.CN85.dnsmgr.net> From: Allan Jude Message-ID: <3cd5ec93-caaa-8789-4caf-549296cd07dc@freebsd.org> Date: Mon, 12 Feb 2018 01:08:11 -0500 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="zLBSGnQz9j6cL0IayiTIFlnDv8CAR2fUo" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Feb 2018 06:08:12 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --zLBSGnQz9j6cL0IayiTIFlnDv8CAR2fUo Content-Type: multipart/mixed; boundary="EMF8l9UxPWgMFkXxBf9zctthxNCGElOib"; protected-headers="v1" From: Allan Jude To: Warner Losh , "Rodney W. Grimes" Cc: Warner Losh , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: <3cd5ec93-caaa-8789-4caf-549296cd07dc@freebsd.org> Subject: Re: svn commit: r329150 - head/etc/devd References: <201802120454.w1C4sp4o086856@repo.freebsd.org> <201802120510.w1C5AUFY042400@pdx.rh.CN85.dnsmgr.net> In-Reply-To: --EMF8l9UxPWgMFkXxBf9zctthxNCGElOib Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable On 2018-02-12 00:28, Warner Losh wrote: >=20 >=20 > On Sun, Feb 11, 2018 at 10:10 PM, Rodney W. Grimes > = > > wrote: >=20 > [ Charset UTF-8 unsupported, converting... ] > > Author: imp > > Date: Mon Feb 12 04:54:51 2018 > > New Revision: 329150 > > URL: https://svnweb.freebsd.org/changeset/base/329150 > > > > > Log: > >=C2=A0 =C2=A0Install devmatch.conf, don't install usb.conf >=20 > Doesnt this break devd and anyone depending on it? >=20 >=20 > I'm having problems understanding how it would break it? > =C2=A0 >=20 > Does usb.conf need to go in OBSOLETEFILES now? >=20 >=20 > Yes. It should... > =C2=A0 >=20 > Relnotes y? >=20 >=20 > Yes. It's hard to know where in the sequence of on-boarding a new > function where to put it. >=20 Previously Release Engineering has said they'd rather you mark a few too many things as Relnotes: Yes, than too few. In cases like this, it might make sense to flag the entire series of commits, so a year from now re@ stands a better chance of writing a coherent paragraph about what the change actually is, and how it impacts the user. > Warner > =C2=A0 >=20 >=20 > > Modified: > >=C2=A0 =C2=A0head/etc/devd/Makefile > > > > Modified: head/etc/devd/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/etc/devd/Makefile=C2=A0 =C2=A0 Mon Feb 12 04:52:25 2018=C2= =A0 =C2=A0 =C2=A0 =C2=A0 (r329149) > > +++ head/etc/devd/Makefile=C2=A0 =C2=A0 Mon Feb 12 04:54:51 2018=C2= =A0 =C2=A0 =C2=A0 =C2=A0 (r329150) > > @@ -12,13 +12,14 @@ FILES+=3D=C2=A0 =C2=A0apple.conf > >=C2=A0 .if ${MK_ACPI} !=3D "no" > >=C2=A0 FILES+=3D=C2=A0 =C2=A0 =C2=A0 asus.conf > >=C2=A0 .endif > > +FILES+=3Ddevmatch.conf > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ^ missing tab >=20 > >=C2=A0 .if ${MK_HYPERV} !=3D "no" > >=C2=A0 FILES+=3D=C2=A0 =C2=A0 =C2=A0 hyperv.conf > >=C2=A0 .endif > >=C2=A0 .endif > > > >=C2=A0 .if ${MK_USB} !=3D "no" > > -FILES+=3D=C2=A0 =C2=A0 =C2=A0 uath.conf ulpt.conf usb.conf > > +FILES+=3D=C2=A0 =C2=A0 =C2=A0 uath.conf ulpt.conf > >=C2=A0 .endif > > > >=C2=A0 .if ${MK_ZFS} !=3D "no" >=20 > -- > Rod Grimes=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 > =C2=A0rgrimes@freebsd.org >=20 >=20 --=20 Allan Jude --EMF8l9UxPWgMFkXxBf9zctthxNCGElOib-- --zLBSGnQz9j6cL0IayiTIFlnDv8CAR2fUo Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (MingW32) iQIcBAEBAgAGBQJagS9LAAoJEBmVNT4SmAt+w4IQAMn+KKrU+Qkr5q4JI0ikZdWb bgDQpHibHRYQrT1LtsmRkjPe8fzM8YB6G+RlB3eZziEG+9feu7s3ppNnXAf7xLmU r9+N0/CenK8kw/GpIkkK7PKZco8GhK9GaBTKOf3Cl8puog2Lrcuc1QCWdSbQ7ubJ Yz6upo1DgwLw30sTnuGrsVjb5BdOYKUMrRp5CxG3AQVpZXpNPr5T3IiXcFhAlAKM wLydi1SB5gWEsHXkjXnfZelyymT0tb4N9XmBwYn/FJJnL6g1nUuriGbajwL/Xv+r HYKTtZugI0OYeLX7eNAjjz674DK6B3AgPyaib4woXn17RTF6cimek3CIob5TYVat 5Gml53wfR6cBJ6vZ7Gf5FRGaQ4rDWSJbyKSvtSe9eLsYXivD8cEoeDsaEANOmMjw hserRS0cZvZyslj2N1DfgW284Lw9PiPpzJE86TtlDfODPhBO6KUwRtxAAMQlNz4B 5DXCbmOSMlEiqDdhliCG0q6sn8XHOIVKesWKKPQkYmb01LfHUpp82rkeGpppnOYV kp1heNdC4vflZVU7UU8P7IERWPRAlbC+JhDXazDGRp8nsTXIB8/FCDU6/poNuLeR o14ZK4IOtz7yTU3Kx0JPq3bUzyBNURRpjwba7RKaVvNPxxQrSDVxlz++myND04vP n5oBjXOnxq4RDzT1SWGw =dZx+ -----END PGP SIGNATURE----- --zLBSGnQz9j6cL0IayiTIFlnDv8CAR2fUo-- From owner-svn-src-all@freebsd.org Mon Feb 12 06:42:39 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 20EF1F1D90D; Mon, 12 Feb 2018 06:42:39 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C80F482A90; Mon, 12 Feb 2018 06:42:38 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C30DB673D; Mon, 12 Feb 2018 06:42:38 +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 w1C6gcAq041708; Mon, 12 Feb 2018 06:42:38 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1C6gcKe041705; Mon, 12 Feb 2018 06:42:38 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201802120642.w1C6gcKe041705@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 12 Feb 2018 06:42:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329153 - in head: . etc/devd X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head: . etc/devd X-SVN-Commit-Revision: 329153 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Feb 2018 06:42:39 -0000 Author: imp Date: Mon Feb 12 06:42:38 2018 New Revision: 329153 URL: https://svnweb.freebsd.org/changeset/base/329153 Log: Add usb.conf to ObsoleteFiles. Add a note to UPDATING. Fix a missing tab. Relnotes: Yes Modified: head/ObsoleteFiles.inc head/UPDATING head/etc/devd/Makefile Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Mon Feb 12 05:55:44 2018 (r329152) +++ head/ObsoleteFiles.inc Mon Feb 12 06:42:38 2018 (r329153) @@ -38,6 +38,8 @@ # xargs -n1 | sort | uniq -d; # done +# 20180211: remove usb.conf +OLD_FILES+=etc/devd/usb.conf # 20180208: remove c_rehash(1) OLD_FILES+=usr/share/openssl/man/man1/c_rehash.1.gz # 20180206: remove gdbtui Modified: head/UPDATING ============================================================================== --- head/UPDATING Mon Feb 12 05:55:44 2018 (r329152) +++ head/UPDATING Mon Feb 12 06:42:38 2018 (r329153) @@ -51,6 +51,11 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 12.x IS SLOW: ****************************** SPECIAL WARNING: ****************************** +20180211: + devmatch functionality has been turned on in devd. It will automatically + load drivers for unattached devices. This may cause unexpected drivers to + be loaded. Please report any problems to current@ and imp@freebsd.org. + 20180114: Clang, llvm, lld, lldb, compiler-rt and libc++ have been upgraded to 6.0.0. Please see the 20141231 entry below for information about Modified: head/etc/devd/Makefile ============================================================================== --- head/etc/devd/Makefile Mon Feb 12 05:55:44 2018 (r329152) +++ head/etc/devd/Makefile Mon Feb 12 06:42:38 2018 (r329153) @@ -12,7 +12,7 @@ FILES+= apple.conf .if ${MK_ACPI} != "no" FILES+= asus.conf .endif -FILES+=devmatch.conf +FILES+= devmatch.conf .if ${MK_HYPERV} != "no" FILES+= hyperv.conf .endif From owner-svn-src-all@freebsd.org Mon Feb 12 06:51:20 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C9CB9F1DE05; Mon, 12 Feb 2018 06:51:20 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7CE6B82F49; Mon, 12 Feb 2018 06:51: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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 77E676781; Mon, 12 Feb 2018 06:51:20 +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 w1C6pKOo042320; Mon, 12 Feb 2018 06:51:20 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1C6pKqF042318; Mon, 12 Feb 2018 06:51:20 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201802120651.w1C6pKqF042318@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 12 Feb 2018 06:51:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329154 - in head/etc: defaults devd X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head/etc: defaults devd X-SVN-Commit-Revision: 329154 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Feb 2018 06:51:21 -0000 Author: imp Date: Mon Feb 12 06:51:20 2018 New Revision: 329154 URL: https://svnweb.freebsd.org/changeset/base/329154 Log: Turn devmatch on by default. Turn devmatch on by default. However, use 'start' instead of 'onestart' in the devmatch.conf file so the setting of 'devmatch_enable' is honored. Give an example of what to put in devd.conf if you want to disable just the run-time part of devmatch. Relnotes: yes Modified: head/etc/defaults/rc.conf head/etc/devd/devmatch.conf Modified: head/etc/defaults/rc.conf ============================================================================== --- head/etc/defaults/rc.conf Mon Feb 12 06:42:38 2018 (r329153) +++ head/etc/defaults/rc.conf Mon Feb 12 06:51:20 2018 (r329154) @@ -41,7 +41,7 @@ ddb_enable="NO" # Set to YES to load ddb scripts at b ddb_config="/etc/ddb.conf" # ddb(8) config file. devd_enable="YES" # Run devd, to trigger programs on device tree changes. devd_flags="" # Additional flags for devd(8). -devmatch_enable="NO" # Demand load kernel modules based on device ids. +devmatch_enable="YES" # Demand load kernel modules based on device ids. #kld_list="" # Kernel modules to load after local disks are mounted kldxref_enable="NO" # Build linker.hints files with kldxref(8). kldxref_clobber="NO" # Overwrite old linker.hints at boot. Modified: head/etc/devd/devmatch.conf ============================================================================== --- head/etc/devd/devmatch.conf Mon Feb 12 06:42:38 2018 (r329153) +++ head/etc/devd/devmatch.conf Mon Feb 12 06:51:20 2018 (r329154) @@ -9,5 +9,12 @@ # # Generic NOMATCH event nomatch 100 { - action "service devmatch onestart" + action "service devmatch start" }; + +# Add the following to devd.conf to preent this from running: +# nomatch 1000 { +# action "true" +# }; +# it replaces the generic event with one of higher priority that +# does nothing. You can also set 'devmatch_enable=NO' in /etc/rc.conf From owner-svn-src-all@freebsd.org Mon Feb 12 06:52:50 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 441EFF1E0A0; Mon, 12 Feb 2018 06:52:50 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E4C51831A6; Mon, 12 Feb 2018 06:52:49 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DC26968D3; Mon, 12 Feb 2018 06:52:49 +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 w1C6qn58046954; Mon, 12 Feb 2018 06:52:49 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1C6qnHP046953; Mon, 12 Feb 2018 06:52:49 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201802120652.w1C6qnHP046953@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 12 Feb 2018 06:52:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329155 - head/etc/devd X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/etc/devd X-SVN-Commit-Revision: 329155 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Feb 2018 06:52:50 -0000 Author: imp Date: Mon Feb 12 06:52:49 2018 New Revision: 329155 URL: https://svnweb.freebsd.org/changeset/base/329155 Log: Fix typo Modified: head/etc/devd/devmatch.conf Modified: head/etc/devd/devmatch.conf ============================================================================== --- head/etc/devd/devmatch.conf Mon Feb 12 06:51:20 2018 (r329154) +++ head/etc/devd/devmatch.conf Mon Feb 12 06:52:49 2018 (r329155) @@ -12,7 +12,7 @@ nomatch 100 { action "service devmatch start" }; -# Add the following to devd.conf to preent this from running: +# Add the following to devd.conf to prevent this from running: # nomatch 1000 { # action "true" # }; From owner-svn-src-all@freebsd.org Mon Feb 12 06:56:00 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CEC54F1E2B4; Mon, 12 Feb 2018 06:55:59 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from smtp-out-no.shaw.ca (smtp-out-no.shaw.ca [64.59.134.13]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 34D2383361; Mon, 12 Feb 2018 06:55:58 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from spqr.komquats.com ([96.50.22.10]) by shaw.ca with ESMTPA id l81lens2Z7Gjal81neDf3A; Sun, 11 Feb 2018 23:55:51 -0700 X-Authority-Analysis: v=2.3 cv=I59Luuog c=1 sm=1 tr=0 a=jvE2nwUzI0ECrNeyr98KWA==:117 a=jvE2nwUzI0ECrNeyr98KWA==:17 a=kj9zAlcOel0A:10 a=Op4juWPpsa0A:10 a=6I5d2MoRAAAA:8 a=YxBL1-UpAAAA:8 a=1t0oBGq3kUfe7izZYdYA:9 a=CjuIK1q_8ugA:10 a=IjZwj45LgO3ly-622nXo:22 a=Ia-lj3WSrqcvXOmTRaiG:22 Received: from slippy.cwsent.com (slippy [10.1.1.91]) by spqr.komquats.com (Postfix) with ESMTPS id 59D78B76; Sun, 11 Feb 2018 22:55:49 -0800 (PST) Received: from slippy.cwsent.com (localhost [127.0.0.1]) by slippy.cwsent.com (8.15.2/8.15.2) with ESMTP id w1C6tmZk080472; Sun, 11 Feb 2018 22:55:48 -0800 (PST) (envelope-from Cy.Schubert@cschubert.com) Received: from slippy (cy@localhost) by slippy.cwsent.com (8.15.2/8.15.2/Submit) with ESMTP id w1C6tmCO080469; Sun, 11 Feb 2018 22:55:48 -0800 (PST) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <201802120655.w1C6tmCO080469@slippy.cwsent.com> X-Authentication-Warning: slippy.cwsent.com: cy owned process doing -bs X-Mailer: exmh version 2.8.0 04/21/2012 with nmh-1.7 Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: Warner Losh cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r329154 - in head/etc: defaults devd In-Reply-To: Message from Warner Losh of "Mon, 12 Feb 2018 06:51:20 +0000." <201802120651.w1C6pKqF042318@repo.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Sun, 11 Feb 2018 22:55:48 -0800 X-CMAE-Envelope: MS4wfGeD/HtDbDvd2YoxFwGKUTO56VvKBcViUSgwak63zCoJCuFjyWOGGhp1oSIX1MtlWmYalYvbVJJbJRAeNKsnnOfNqTxwBLRbx6mc3frimLTV0avOW0lU D5O1V0oZ7ZUcS/IJLOQYKcvo0TghoPnw09apge2ZZTcIE4T35HyDibZdajXCcVP7sMG9H/X2sFSlggyUf32HqYMLdapHFSDF3lVdzvHWJhhwxsY4Cpk32Vue HAf8lCU938+F9IyUODvA0zhG+yFm+ca3kjniFgSJxiAWd5tO2/t+Q9lbNkT/jOh8 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Feb 2018 06:56:00 -0000 In message <201802120651.w1C6pKqF042318@repo.freebsd.org>, Warner Losh writes: > Author: imp > Date: Mon Feb 12 06:51:20 2018 > New Revision: 329154 > URL: https://svnweb.freebsd.org/changeset/base/329154 > > Log: > Turn devmatch on by default. > > Turn devmatch on by default. However, use 'start' instead of > 'onestart' in the devmatch.conf file so the setting of > 'devmatch_enable' is honored. Give an example of what to put in > devd.conf if you want to disable just the run-time part of devmatch. > > Relnotes: yes > > Modified: > head/etc/defaults/rc.conf > head/etc/devd/devmatch.conf > > Modified: head/etc/defaults/rc.conf > ============================================================================= > = > --- head/etc/defaults/rc.conf Mon Feb 12 06:42:38 2018 (r329153) > +++ head/etc/defaults/rc.conf Mon Feb 12 06:51:20 2018 (r329154) > @@ -41,7 +41,7 @@ ddb_enable="NO" # Set to YES to load ddb script > s at b > ddb_config="/etc/ddb.conf" # ddb(8) config file. > devd_enable="YES" # Run devd, to trigger programs on device tree changes. > devd_flags="" # Additional flags for devd(8). > -devmatch_enable="NO" # Demand load kernel modules based on device ids. > +devmatch_enable="YES" # Demand load kernel modules based on device id > s. This assumes that everyone has /usr in /. We might want to consider moving devmatch to /sbin or document that /usr and / be merged. -- Cheers, Cy Schubert FreeBSD UNIX: Web: http://www.FreeBSD.org The need of the many outweighs the greed of the few. From owner-svn-src-all@freebsd.org Mon Feb 12 06:59:27 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2E87AF1E4F3 for ; Mon, 12 Feb 2018 06:59:27 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-io0-x236.google.com (mail-io0-x236.google.com [IPv6:2607:f8b0:4001:c06::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 B097C83542 for ; Mon, 12 Feb 2018 06:59:26 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-io0-x236.google.com with SMTP id f89so16219531ioj.4 for ; Sun, 11 Feb 2018 22:59:26 -0800 (PST) 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=Fqzad2wBSZzt4x85xxeOw21AHiao04YA8megSzB/vsU=; b=PNOJE0j1M6Od9ce3/kehopr+ikbruqokuX8kVMBCPJcJdBbt7ptdv/JboxW9IhxzIo gEauL0uprUx10YI0LrKziGOFeLbC7nSZjbRWn79Wi91ey5RHkwer611OLmE4fvXH9WPE P2csJGz0l8+tKQDPQ806QHbcTr4Ngg25mnruE/Gz4B8jQhwrxwUvXeFQ/bw3olCTffiJ 1Hg0vwp96SLyjHXjSG29DS2wrtp3p8eFAj5kiBntLqFGZG48bmUnp3YG1+y9j++s015V w6n/EJUGztTmOOgNCzpN+A/Uu4z7/fY2qmNVQItR0ahml9j5Q54fmKaBAbgmSwvrIK4l pJ5g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=Fqzad2wBSZzt4x85xxeOw21AHiao04YA8megSzB/vsU=; b=kzzH+Ut0GkZ4UqeKGjGCNseMQl2gyf3EgRocW7rPbM/LPorojdwp6t0KjDhtpaxYtS 2ZqF9iuYUerF6jpcyUs4zBzMCHraDTC7HVWiB1pu3q0IC0bljtF2qX5iOPY89xXFxtZy xLFrIuNuD2VWDw9zV4QSweNHBGJaEQvJ1X/DoJKqWA/ZFa5l2pG3tUzBn+4CxAvIps8/ rD5W9Iooxq0vb6sgRRcY9/r0twB5u7Q/yX06wLQ6Mjww9DzUeHwEKqXOYCgD5dIMIHL2 oLD15f8ucTnKKwYXHuxoEGYn4liyOFat2g0+WoQeNm5/JVxutArpVe2PZM1t3gnAg6cf pNQw== X-Gm-Message-State: APf1xPCVW4hFtzQQJA24eEQ8BF6CvqiyKtSoFTjRtwqdKRhRk7yg3TfS 8qlFcY8Z8ArykOMhiV9AhMy/dCSRQLCyEF5tRUlNsA== X-Google-Smtp-Source: AH8x225dbsqLW+qioV85ohJU6kEaeliHn95HPEkKyshCsDMmef8S5tBqzkI8/aLwFjz5ctZYmUsMyMfWENR392+F3tI= X-Received: by 10.107.172.130 with SMTP id v124mr7791687ioe.301.1518418765786; Sun, 11 Feb 2018 22:59:25 -0800 (PST) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.201.67 with HTTP; Sun, 11 Feb 2018 22:59:25 -0800 (PST) X-Originating-IP: [2603:300b:6:5100:18a2:a4f7:170:8dd9] In-Reply-To: <201802120655.w1C6tmCO080469@slippy.cwsent.com> References: <201802120651.w1C6pKqF042318@repo.freebsd.org> <201802120655.w1C6tmCO080469@slippy.cwsent.com> From: Warner Losh Date: Sun, 11 Feb 2018 23:59:25 -0700 X-Google-Sender-Auth: w3EZcRm-2g82Bw-37Ib8jUeMEhc Message-ID: Subject: Re: svn commit: r329154 - in head/etc: defaults devd To: Cy Schubert Cc: Warner Losh , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.25 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Feb 2018 06:59:27 -0000 On Sun, Feb 11, 2018 at 11:55 PM, Cy Schubert wrote: > In message <201802120651.w1C6pKqF042318@repo.freebsd.org>, Warner Losh > writes: > > Author: imp > > Date: Mon Feb 12 06:51:20 2018 > > New Revision: 329154 > > URL: https://svnweb.freebsd.org/changeset/base/329154 > > > > Log: > > Turn devmatch on by default. > > > > Turn devmatch on by default. However, use 'start' instead of > > 'onestart' in the devmatch.conf file so the setting of > > 'devmatch_enable' is honored. Give an example of what to put in > > devd.conf if you want to disable just the run-time part of devmatch. > > > > Relnotes: yes > > > > Modified: > > head/etc/defaults/rc.conf > > head/etc/devd/devmatch.conf > > > > Modified: head/etc/defaults/rc.conf > > ============================================================ > ================= > > = > > --- head/etc/defaults/rc.conf Mon Feb 12 06:42:38 2018 (r329153) > > +++ head/etc/defaults/rc.conf Mon Feb 12 06:51:20 2018 (r329154) > > @@ -41,7 +41,7 @@ ddb_enable="NO" # Set to YES to load ddb > script > > s at b > > ddb_config="/etc/ddb.conf" # ddb(8) config file. > > devd_enable="YES" # Run devd, to trigger programs on device tree > changes. > > devd_flags="" # Additional flags for devd(8). > > -devmatch_enable="NO" # Demand load kernel modules based on device ids. > > +devmatch_enable="YES" # Demand load kernel modules based on > device id > > s. > > This assumes that everyone has /usr in /. We might want to consider > moving devmatch to /sbin or document that /usr and / be merged. > That's a good point. I think /etc/rc.d is fine, but devd runs before /usr is mounted, so I think you are right. I'll make the change tomorrow. Warner From owner-svn-src-all@freebsd.org Mon Feb 12 07:01:56 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BDB3CF1E7D3; Mon, 12 Feb 2018 07:01:56 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 73642838F1; Mon, 12 Feb 2018 07:01:56 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1033) id 6BCD01BAA3; Mon, 12 Feb 2018 07:01:56 +0000 (UTC) Date: Mon, 12 Feb 2018 07:01:56 +0000 From: Alexey Dokuchaev To: Cy Schubert Cc: Warner Losh , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r329154 - in head/etc: defaults devd Message-ID: <20180212070156.GA49948@FreeBSD.org> References: <201802120651.w1C6pKqF042318@repo.freebsd.org> <201802120655.w1C6tmCO080469@slippy.cwsent.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201802120655.w1C6tmCO080469@slippy.cwsent.com> User-Agent: Mutt/1.9.2 (2017-12-15) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Feb 2018 07:01:56 -0000 On Sun, Feb 11, 2018 at 10:55:48PM -0800, Cy Schubert wrote: > In message <201802120651.w1C6pKqF042318@repo.freebsd.org>, Warner Losh > writes: > > New Revision: 329154 > > URL: https://svnweb.freebsd.org/changeset/base/329154 > > > > Log: > > Turn devmatch on by default. > > > > Turn devmatch on by default. However, use 'start' instead of > > 'onestart' in the devmatch.conf file so the setting of > > 'devmatch_enable' is honored. Give an example of what to put in > > devd.conf if you want to disable just the run-time part of devmatch. > > > > ... > > @@ -41,7 +41,7 @@ ddb_enable="NO" # Set to YES to load ddb script > > s at b > > ddb_config="/etc/ddb.conf" # ddb(8) config file. > > devd_enable="YES" # Run devd, to trigger programs on device tree changes. > > devd_flags="" # Additional flags for devd(8). > > -devmatch_enable="NO" # Demand load kernel modules based on device ids. > > +devmatch_enable="YES" # Demand load kernel modules based on device id > > s. > > This assumes that everyone has /usr in /. We might want to consider > moving devmatch to /sbin, or document that I was actually surprised to find out it's installed as /usr/sbin/devmatch; /sbin indeed looks more appropriate. > /usr and / be merged. Please don't. ./danfe From owner-svn-src-all@freebsd.org Mon Feb 12 07:14:26 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E2C26F1F261; Mon, 12 Feb 2018 07:14:25 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail106.syd.optusnet.com.au (mail106.syd.optusnet.com.au [211.29.132.42]) by mx1.freebsd.org (Postfix) with ESMTP id 4AB2A83F31; Mon, 12 Feb 2018 07:14:24 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from [192.168.0.102] (c110-21-101-228.carlnfd1.nsw.optusnet.com.au [110.21.101.228]) by mail106.syd.optusnet.com.au (Postfix) with ESMTPS id 551993C5010; Mon, 12 Feb 2018 18:14:20 +1100 (AEDT) Date: Mon, 12 Feb 2018 18:14:14 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Warner Losh cc: "Conrad E. Meyer" , "Rodney W. Grimes" , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r329126 - head/etc/devd In-Reply-To: Message-ID: <20180212181001.I1004@besplex.bde.org> References: <1518374549.32585.238.camel@freebsd.org> <201802112346.w1BNkPXc041510@pdx.rh.CN85.dnsmgr.net> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.2 cv=DIX/22Fb c=1 sm=1 tr=0 a=PalzARQSbocsUSjMRkwAPg==:117 a=PalzARQSbocsUSjMRkwAPg==:17 a=kj9zAlcOel0A:10 a=6I5d2MoRAAAA:8 a=iKhvJSA4AAAA:8 a=pw8i2ox7dyFYx6z0qzYA:9 a=CjuIK1q_8ugA:10 a=IjZwj45LgO3ly-622nXo:22 a=odh9cflL3HIXMm4fY7Wr:22 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Feb 2018 07:14:26 -0000 On Sun, 11 Feb 2018, Warner Losh wrote: > On Feb 11, 2018 7:05 PM, "Conrad Meyer" wrote: > > On Sun, Feb 11, 2018 at 3:46 PM, Rodney W. Grimes > wrote: >> Moving this to /usr creates a cyclic issue in that you then need >> /usr to be mounted before devd can start and devd's /etc/rc.d file >> says: >> # PROVIDE: devd >> # REQUIRE: NETWORKING >> # BEFORE: mountcritremote >> # KEYWORD: nojail >> >> In the diskless and nfs shared /usr worlds devd wants to start >> before /usr is mounted. > > If devd is needed to mount /usr (???), it seems like just another > demonstration of why separate /usr is a poor idea. No, it is just another defense against people breaking separate /usr. > No, it's another reason why generated devd files are wrong in the face of > devmatch. Bruce From owner-svn-src-all@freebsd.org Mon Feb 12 08:35:46 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 012AEF028DC for ; Mon, 12 Feb 2018 08:35:46 +0000 (UTC) (envelope-from oliver.pinter@hardenedbsd.org) Received: from mail-wm0-x241.google.com (mail-wm0-x241.google.com [IPv6:2a00:1450:400c:c09::241]) (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 7E2A986BB8 for ; Mon, 12 Feb 2018 08:35:45 +0000 (UTC) (envelope-from oliver.pinter@hardenedbsd.org) Received: by mail-wm0-x241.google.com with SMTP id g1so8010284wmg.2 for ; Mon, 12 Feb 2018 00:35:45 -0800 (PST) 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=+RiDWmFqPN/qMfR78aI7cWq3pkf039D34EBSKTqs47s=; b=USxyRDu+SHOOdUCPa39cMegRCMDRs15dl8QRFCJB15o39xbZRaaEJILZOIxSel2/x2 5UzGq3VODLiwmQlYH7mdej8xIYS4nF55CuUMhMFzy5Ao2Mh93RA3BETxdX8m7q/knGG/ GKSiAaqq6yANholpIhr5WIU9+LviObfO7IxG0V7UF0SrYheqeqnBMmrtWl/b88Anivu7 DdkAM0+D4P9Rh/jtvXmutGoDZ8y5w/fYG5idHuvsv7hWBFlkuBJ0J7CQllS6AreLDeoB rcWD19bUrEbD48f7bBdSbpdlZ+1sEXCDq2e0RWzWIDrvMQ86QWtteigP5spvxPTvyNEc TgDQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=+RiDWmFqPN/qMfR78aI7cWq3pkf039D34EBSKTqs47s=; b=C4d985GDrgiUEtmQJhpScJ1WYDlrntDtpvrsbgzaO5aTaOf3xewBcKRQgjTkzEodr7 LtDjjLiSFGAlkuDpcn92XW+IX0lBB0ABNVzevZXlPjjocFu9AZvF1HfPj5t9kGUKacTI iWD/KbvuKcUO81LK+0Lzg252B1vDJOUOzxICCKyZ7JCgt7QaLqRwMzRIUxznGwTGlrV7 yKDpuok4SoSj5uyFERaEzr/ERLsDBsKPS5qKV0gM7/PJqPeBKk6E9nHrIaJllipVNVO4 IBy24YE+jQj0kMgj00QxRfVyTbChrvcH/LBYVuvsmL6ILTekc2Dxx1//M69SpcR4Nfno DEQw== X-Gm-Message-State: APf1xPDs3jc/kAVutwArueuuSzWzTYrUAyLFqJpuB2WjyM4x8doYMEbu gWXR0W+ATnU8LJ8PkWBxbR1sF+NMAnOwLnU2jXlJCg== X-Google-Smtp-Source: AH8x2245meyKo+z4AtVRBHTFIJ3viY3KGLwmhcUTZ4eq6xIxNsoosmjKIFAt3Ax9gDp9EIDmWHvlooI7w/p+f96NzQM= X-Received: by 10.80.191.71 with SMTP id g7mr14998633edk.246.1518424544535; Mon, 12 Feb 2018 00:35:44 -0800 (PST) MIME-Version: 1.0 Received: by 10.80.148.90 with HTTP; Mon, 12 Feb 2018 00:35:44 -0800 (PST) In-Reply-To: <20180212070156.GA49948@FreeBSD.org> References: <201802120651.w1C6pKqF042318@repo.freebsd.org> <201802120655.w1C6tmCO080469@slippy.cwsent.com> <20180212070156.GA49948@FreeBSD.org> From: Oliver Pinter Date: Mon, 12 Feb 2018 09:35:44 +0100 Message-ID: Subject: Re: svn commit: r329154 - in head/etc: defaults devd To: Alexey Dokuchaev Cc: Cy Schubert , "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , Warner Losh Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.25 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Feb 2018 08:35:46 -0000 On Monday, February 12, 2018, Alexey Dokuchaev wrote: > On Sun, Feb 11, 2018 at 10:55:48PM -0800, Cy Schubert wrote: > > In message <201802120651.w1C6pKqF042318@repo.freebsd.org>, Warner Losh > > writes: > > > New Revision: 329154 > > > URL: https://svnweb.freebsd.org/changeset/base/329154 > > > > > > Log: > > > Turn devmatch on by default. > > > > > > Turn devmatch on by default. However, use 'start' instead of > > > 'onestart' in the devmatch.conf file so the setting of > > > 'devmatch_enable' is honored. Give an example of what to put in > > > devd.conf if you want to disable just the run-time part of devmatch. > > > > > > ... > > > @@ -41,7 +41,7 @@ ddb_enable="NO" # Set to YES to load ddb > script > > > s at b > > > ddb_config="/etc/ddb.conf" # ddb(8) config file. > > > devd_enable="YES" # Run devd, to trigger programs on device tree > changes. > > > devd_flags="" # Additional flags for devd(8). > > > -devmatch_enable="NO" # Demand load kernel modules based on > device ids. > > > +devmatch_enable="YES" # Demand load kernel modules based on > device id > > > s. > > > > This assumes that everyone has /usr in /. We might want to consider > > moving devmatch to /sbin, or document that > > I was actually surprised to find out it's installed as /usr/sbin/devmatch; > /sbin indeed looks more appropriate. > > > /usr and / be merged. > > Please don't. There are already lot of separated / and /usr installations, so +1. > > ./danfe > _______________________________________________ > 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-all@freebsd.org Mon Feb 12 08:53:08 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 09AB0F03EC0; Mon, 12 Feb 2018 08:53:08 +0000 (UTC) (envelope-from agapon@gmail.com) Received: from mail-lf0-f49.google.com (mail-lf0-f49.google.com [209.85.215.49]) (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 758B387A06; Mon, 12 Feb 2018 08:53:07 +0000 (UTC) (envelope-from agapon@gmail.com) Received: by mail-lf0-f49.google.com with SMTP id q194so19360216lfe.13; Mon, 12 Feb 2018 00:53:07 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=abcLIsWYYHKhlKlANcZ3FcpVTzkk635redeGm39Q7wc=; b=qX1UQs0xa70IKoIXmcQgY1jW7XflAB8htcOmnoyz0bmKRh2yV9ol/7MQBPkAK6FVbj LWU+icmiotw7gJRBRxXps5clva54qz0tb4r6iz5qilcDGTxFixrxGr5s0PRNNf+K7zvv Ahw8cMd1gTRIq2Z0dBnq4WbNEfigOHeSY8nvKB4fzmLtdBMSkO99k+8z7xocFAgn5eFK 88EVevYGNtmVBbisuhJoWiYG2s3AoIlZGVgIq0/Hj3v2bjVgdxnksewsNr7G+RRp8xc0 icjH+rCqOTlL8JDnyKDRfgdrHrjC/R6SzYeoAou2NJhgxsqMF9iaRDAm7GPxghiVI4lK JhDQ== X-Gm-Message-State: APf1xPBMe8+VZFDDTn87h0V+5Ig/WDMOx9ILzuxiyB4yam2QewCjgY/m MX3Xq5ELj52Ftgo+s1WJ0ONigpMf5vY= X-Google-Smtp-Source: AH8x22699qIMPJYJd1oPxrdsYEWvqWPEPL0SPIi6TY8WPtiwzXlnP1M/oqtCLadJ/kkEdQ629ig8SA== X-Received: by 10.25.68.10 with SMTP id r10mr6631153lfa.124.1518425579773; Mon, 12 Feb 2018 00:52:59 -0800 (PST) Received: from [192.168.0.88] (east.meadow.volia.net. [93.72.151.96]) by smtp.googlemail.com with ESMTPSA id l136sm1580604lfb.59.2018.02.12.00.52.58 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 12 Feb 2018 00:52:59 -0800 (PST) Subject: Re: svn commit: r329126 - head/etc/devd To: Bruce Evans , Warner Losh Cc: "Conrad E. Meyer" , "Rodney W. Grimes" , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <1518374549.32585.238.camel@freebsd.org> <201802112346.w1BNkPXc041510@pdx.rh.CN85.dnsmgr.net> <20180212181001.I1004@besplex.bde.org> From: Andriy Gapon Message-ID: <6873c493-e5bc-7068-d4f3-62206a95c968@FreeBSD.org> Date: Mon, 12 Feb 2018 10:52:57 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: <20180212181001.I1004@besplex.bde.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Feb 2018 08:53:08 -0000 On 12/02/2018 09:14, Bruce Evans wrote: > No, it is just another defense against people breaking separate /usr. /usr is too diverse. Separate (from root and from each other) /usr/local, /usr/obj, /usr/ports, /usr/src, /usr/home are a good idea. Separate /usr/bin and /usr/sbin ... many potential problems for zero benefit. Legacy storage allocation schemes are very limiting, of course. -- Andriy Gapon From owner-svn-src-all@freebsd.org Mon Feb 12 09:25:40 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 40405F0688D; Mon, 12 Feb 2018 09:25:40 +0000 (UTC) (envelope-from gljennjohn@gmail.com) Received: from mail-wm0-x22d.google.com (mail-wm0-x22d.google.com [IPv6:2a00:1450:400c: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 9690869249; Mon, 12 Feb 2018 09:25:39 +0000 (UTC) (envelope-from gljennjohn@gmail.com) Received: by mail-wm0-x22d.google.com with SMTP id f3so8541237wmc.1; Mon, 12 Feb 2018 01:25:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:in-reply-to:references:reply-to :mime-version:content-transfer-encoding; bh=vRzsV/JPBeM0U68tvsiE2A8Sw/hKHd21Ki9gDfGJ49E=; b=dXgUABSRnPU70OIzoUh32ijMLa7CaanQjST/NoIUQ+Gpjde1OCvDKI8lRg7qBUgnHC ADJS1uELa1q+XXbMGeZ46y3U+D+qATukH7kQjOYRQLYBr4R+SKVxdwfknvlopZP9wgiK +km8ovOjuRrnvxQLXajtlLENHx42yvJQDDtUUCJwrTrh7t+WmeBhQg7zOaNMPCEYh4zg 1DUUlHVs3nlQCqn2nFR/p9So79MQbtFrUDhOo+MzZAz7HJ9REt3Leq/shevyi+e87qSg NRAuXaJJoBYx5z8AAtPvUrrQrWjZUkavUNI1Mww6wtO/Rrmu+Wi0OB7VoYZBRDMVi2kX MQzQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:reply-to:mime-version:content-transfer-encoding; bh=vRzsV/JPBeM0U68tvsiE2A8Sw/hKHd21Ki9gDfGJ49E=; b=dIjg3kN46arueW/qkVkCiJ2/WBZpQIptufLVIkKHnyih+YEbc8dg6JjhB6/7wUG+47 hD1TywNIiYcmmThIg3V9fGhD7NaFAsn3//cti00iUaduvFOAYrHQyWlO6VjpAUKiI2um PDW6AQ2F6QasCFU3IV5ygGbxLZ3lYhtMciQkdtUy8a2QJW1FDTtnL+JulsIxHk5os4Bp Px41SzZiPse/fdinT3tElCEQZEFkPFk4Epzwhkxln/6b3u0vFBxDwfe3CtKUTifBCzAZ wMLxpgaP10SWT4vAgw+CKgREddFG5gFfn7WrKjj1MhmC2uHLU0ua8yXUCIZS+WsG00sY DmGA== X-Gm-Message-State: APf1xPC9fnRfyUqdufMhRm5j8g9W0Kq3YZ/BHc93J4y3ittL8xSwY3pi ZQLKFM5Vpz3zqEs3/as8H1r0VA== X-Google-Smtp-Source: AH8x226LMocJykLZT5E0CKOcsaDY1UCVtoBL8K1DAuITXeXGaPjaT0wUGw4Df3fLMj+s88Hl89H8HA== X-Received: by 10.28.29.81 with SMTP id d78mr3204179wmd.65.1518427538397; Mon, 12 Feb 2018 01:25:38 -0800 (PST) Received: from ernst.home (p5B0233C8.dip0.t-ipconnect.de. [91.2.51.200]) by smtp.gmail.com with ESMTPSA id j132sm8524487wmd.38.2018.02.12.01.25.36 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 12 Feb 2018 01:25:37 -0800 (PST) Date: Mon, 12 Feb 2018 10:25:36 +0100 From: Gary Jennejohn To: Alexey Dokuchaev Cc: Cy Schubert , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Warner Losh Subject: Re: svn commit: r329154 - in head/etc: defaults devd Message-ID: <20180212102536.76603ed6@ernst.home> In-Reply-To: <20180212070156.GA49948@FreeBSD.org> References: <201802120651.w1C6pKqF042318@repo.freebsd.org> <201802120655.w1C6tmCO080469@slippy.cwsent.com> <20180212070156.GA49948@FreeBSD.org> Reply-To: gljennjohn@gmail.com X-Mailer: Claws Mail 3.16.0 (GTK+ 2.24.31; amd64-portbld-freebsd12.0) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Feb 2018 09:25:40 -0000 On Mon, 12 Feb 2018 07:01:56 +0000 Alexey Dokuchaev wrote: > On Sun, Feb 11, 2018 at 10:55:48PM -0800, Cy Schubert wrote: > > In message <201802120651.w1C6pKqF042318@repo.freebsd.org>, Warner Losh > > writes: > > > New Revision: 329154 > > > URL: https://svnweb.freebsd.org/changeset/base/329154 > > > > > > Log: > > > Turn devmatch on by default. > > > > > > Turn devmatch on by default. However, use 'start' instead of > > > 'onestart' in the devmatch.conf file so the setting of > > > 'devmatch_enable' is honored. Give an example of what to put in > > > devd.conf if you want to disable just the run-time part of devmatch. > > > > > > ... > > > @@ -41,7 +41,7 @@ ddb_enable="NO" # Set to YES to load ddb script > > > s at b > > > ddb_config="/etc/ddb.conf" # ddb(8) config file. > > > devd_enable="YES" # Run devd, to trigger programs on device tree changes. > > > devd_flags="" # Additional flags for devd(8). > > > -devmatch_enable="NO" # Demand load kernel modules based on device ids. > > > +devmatch_enable="YES" # Demand load kernel modules based on device id > > > s. > > > > This assumes that everyone has /usr in /. We might want to consider > > moving devmatch to /sbin, or document that > > I was actually surprised to find out it's installed as /usr/sbin/devmatch; > /sbin indeed looks more appropriate. > > > /usr and / be merged. > > Please don't. > +1 -- Gary Jennejohn From owner-svn-src-all@freebsd.org Mon Feb 12 10:34:16 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B6FDEF0C4C4; Mon, 12 Feb 2018 10:34:16 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 68BD66C870; Mon, 12 Feb 2018 10:34:16 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6392E10C51; Mon, 12 Feb 2018 10:34:16 +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 w1CAYGYr056783; Mon, 12 Feb 2018 10:34:16 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1CAYGlZ056782; Mon, 12 Feb 2018 10:34:16 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201802121034.w1CAYGlZ056782@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 12 Feb 2018 10:34:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r329156 - stable/11/sys/vm X-SVN-Group: stable-11 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/11/sys/vm X-SVN-Commit-Revision: 329156 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Feb 2018 10:34:16 -0000 Author: kib Date: Mon Feb 12 10:34:15 2018 New Revision: 329156 URL: https://svnweb.freebsd.org/changeset/base/329156 Log: MFC r328880: On munlock(), unwire correct page. Modified: stable/11/sys/vm/vm_object.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/vm/vm_object.c ============================================================================== --- stable/11/sys/vm/vm_object.c Mon Feb 12 06:52:49 2018 (r329155) +++ stable/11/sys/vm/vm_object.c Mon Feb 12 10:34:15 2018 (r329156) @@ -2268,7 +2268,7 @@ void vm_object_unwire(vm_object_t object, vm_ooffset_t offset, vm_size_t length, uint8_t queue) { - vm_object_t tobject; + vm_object_t tobject, t1object; vm_page_t m, tm; vm_pindex_t end_pindex, pindex, tpindex; int depth, locked_depth; @@ -2282,6 +2282,7 @@ vm_object_unwire(vm_object_t object, vm_ooffset_t offs return; pindex = OFF_TO_IDX(offset); end_pindex = pindex + atop(length); +again: locked_depth = 1; VM_OBJECT_RLOCK(object); m = vm_page_find_least(object, pindex); @@ -2315,16 +2316,26 @@ vm_object_unwire(vm_object_t object, vm_ooffset_t offs m = TAILQ_NEXT(m, listq); } vm_page_lock(tm); + if (vm_page_xbusied(tm)) { + for (tobject = object; locked_depth >= 1; + locked_depth--) { + t1object = tobject->backing_object; + VM_OBJECT_RUNLOCK(tobject); + tobject = t1object; + } + vm_page_busy_sleep(tm, "unwbo", true); + goto again; + } vm_page_unwire(tm, queue); vm_page_unlock(tm); next_page: pindex++; } /* Release the accumulated object locks. */ - for (depth = 0; depth < locked_depth; depth++) { - tobject = object->backing_object; - VM_OBJECT_RUNLOCK(object); - object = tobject; + for (tobject = object; locked_depth >= 1; locked_depth--) { + t1object = tobject->backing_object; + VM_OBJECT_RUNLOCK(tobject); + tobject = t1object; } } From owner-svn-src-all@freebsd.org Mon Feb 12 10:58:46 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 93901F0E64E; Mon, 12 Feb 2018 10:58:46 +0000 (UTC) (envelope-from manu@bidouilliste.com) Received: from mail.blih.net (mail.blih.net [212.83.177.182]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mail.blih.net", Issuer "mail.blih.net" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id C9A4F6DB33; Mon, 12 Feb 2018 10:58:45 +0000 (UTC) (envelope-from manu@bidouilliste.com) Received: from mail.blih.net (mail.blih.net [212.83.177.182]) by mail.blih.net (OpenSMTPD) with ESMTP id 078a8f5d; Mon, 12 Feb 2018 11:52:03 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=bidouilliste.com; h=date :from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; s=mail; bh=ahNPyDHzukbxob12cmDqWvNak/8=; b=k5dXb3WoAHP+cNnH/biRYloK9eCK iSby3ba8ifAal6A2RbvFUw9gzSGkN7R6Auek4xj0i5QaY7+Ze4DDfCaJDAWHwOYX tdibU6KVLcT5yDXP/Nyli9tSzS2LUFZByBQTPHsS0IYd43I8t6OdUriZQ4HbjPmY FPBr1s73l1/67lI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=bidouilliste.com; h=date :from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; q=dns; s= mail; b=cQ5AbBYvTM1xxWTDqsyAW8xrxGlXcJy37M9eKzGgMV3JCMV4kTf7h55T 7inY1SEPfZMyi1LZ8U0PdLlcHHLw8AS2d6+EHLSVvplsUbMb+dSgIRulI+PeNbn8 scZYlgv0WuSIS7KjUz+c7zYi0k9YlC6TCAdFUCkPhRamk/NFXXk= Received: from arcadia (evadot.gandi.net [217.70.181.36]) by mail.blih.net (OpenSMTPD) with ESMTPSA id a7cff899 TLS version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO; Mon, 12 Feb 2018 11:52:03 +0100 (CET) Date: Mon, 12 Feb 2018 11:52:02 +0100 From: Emmanuel Vadot To: Brad Davis Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r328136 - in head/etc: defaults rc.d Message-Id: <20180212115202.414ce229077525da98716595@bidouilliste.com> In-Reply-To: <201801182045.w0IKjf44088801@repo.freebsd.org> References: <201801182045.w0IKjf44088801@repo.freebsd.org> X-Mailer: Sylpheed 3.6.0 (GTK+ 2.24.31; amd64-portbld-freebsd12.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Feb 2018 10:58:46 -0000 On Thu, 18 Jan 2018 20:45:41 +0000 (UTC) Brad Davis wrote: > Author: brd (doc,ports committer) > Date: Thu Jan 18 20:45:41 2018 > New Revision: 328136 > URL: https://svnweb.freebsd.org/changeset/base/328136 > > Log: > Teach the resolv startup script to respect its enable flag. > > Reviewed by: will, imp > Approved by: imp > > Modified: > head/etc/defaults/rc.conf > head/etc/rc.d/resolv > > Modified: head/etc/defaults/rc.conf > ============================================================================== > --- head/etc/defaults/rc.conf Thu Jan 18 20:12:12 2018 (r328135) > +++ head/etc/defaults/rc.conf Thu Jan 18 20:45:41 2018 (r328136) > @@ -96,6 +96,7 @@ fsck_y_enable="NO" # Set to YES to do fsck -y if the i > fsck_y_flags="-T ffs:-R -T ufs:-R" # Additional flags for fsck -y > background_fsck="YES" # Attempt to run fsck in the background where possible. > background_fsck_delay="60" # Time to wait (seconds) before starting the fsck. > +growfs_enable="NO" # Set to YES to attempt to grow the root filesystem on boot > netfs_types="nfs:NFS smbfs:SMB" # Net filesystems. > extra_netfs_types="NO" # List of network extra filesystem types for delayed > # mount at startup (or NO). > @@ -276,6 +277,7 @@ ctld_enable="NO" # CAM Target Layer / iSCSI target da > local_unbound_enable="NO" # local caching resolver > blacklistd_enable="NO" # Run blacklistd daemon (YES/NO). > blacklistd_flags="" # Optional flags for blacklistd(8). > +resolv_enable="YES" # Enable resolv / resolvconf > > # > # kerberos. Do not run the admin daemons on slave servers > > Modified: head/etc/rc.d/resolv > ============================================================================== > --- head/etc/rc.d/resolv Thu Jan 18 20:12:12 2018 (r328135) > +++ head/etc/rc.d/resolv Thu Jan 18 20:45:41 2018 (r328136) > @@ -35,6 +35,7 @@ > > name="resolv" > desc="Create /etc/resolv.conf from kenv" > +start_cmd="${name}_start" > stop_cmd=':' > > load_rc_config $name > @@ -42,17 +43,20 @@ load_rc_config $name > # if the info is available via dhcp/kenv > # build the resolv.conf > # > -if [ -n "`/bin/kenv dhcp.domain-name-servers 2> /dev/null`" ]; then > - interface="`/bin/kenv boot.netif.name`" > - ( > - if [ -n "`/bin/kenv dhcp.domain-name 2> /dev/null`" ]; then > - echo domain `/bin/kenv dhcp.domain-name` > +resolv_start() > +{ > + if [ -n "`/bin/kenv dhcp.domain-name-servers 2> /dev/null`" ]; then > + interface="`/bin/kenv boot.netif.name`" > + ( > + if [ -n "`/bin/kenv dhcp.domain-name 2> /dev/null`" ]; then > + echo domain `/bin/kenv dhcp.domain-name` > + fi > + > + set -- `/bin/kenv dhcp.domain-name-servers` > + for ns in `IFS=','; echo $*`; do > + echo nameserver $ns > + done > + ) | /sbin/resolvconf -a ${interface}:dhcp4 > fi > - > - set -- `/bin/kenv dhcp.domain-name-servers` > - for ns in `IFS=','; echo $*`; do > - echo nameserver $ns > - done > - ) | /sbin/resolvconf -a ${interface}:dhcp4 > -fi > +} > I don't understand how it can work without. run_rc_command "$1" -- Emmanuel Vadot From owner-svn-src-all@freebsd.org Mon Feb 12 11:19:06 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D8DDEF1025D; Mon, 12 Feb 2018 11:19:05 +0000 (UTC) (envelope-from zeising+freebsd@daemonic.se) Received: from mail.daemonic.se (mail.daemonic.se [IPv6:2607:f740:d:20::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 6FBE76E9F9; Mon, 12 Feb 2018 11:19:05 +0000 (UTC) (envelope-from zeising+freebsd@daemonic.se) Received: from cid.daemonic.se (localhost [IPv6:::1]) by mail.daemonic.se (Postfix) with ESMTP id 3zg38J4JcyzDhCl; Mon, 12 Feb 2018 11:18:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=daemonic.se; h= content-transfer-encoding:content-language:content-type :content-type:in-reply-to:mime-version:user-agent:date:date :message-id:from:from:references:subject:subject:received :received; s=20151023; t=1518434336; bh=d+fs8L4lQOk/mSapml8CwVwe boDoi1xZtXULC6Xa/sc=; b=hRphZsDYMMua0+x6GQ5lI7ZA6A+k9aOYKvKZPmgP emJ+XWTVPX6WEy8g8jksBWsEecf3REaBf27KVJ3P4xYX+WYlGeaVUldK4ngPelY5 PC6lCEkneaVM3C2Dh+VNuYT8HaapGwHbGaVKw3wvGut+9aPGS9q8g5xbamby5lv5 3Mo= X-Virus-Scanned: amavisd-new at daemonic.se Received: from mail.daemonic.se ([IPv6:::1]) (using TLS with cipher ECDHE-RSA-AES128-GCM-SHA256) by cid.daemonic.se (mailscanner.daemonic.se [IPv6:::1]) (amavisd-new, port 10587) with ESMTPS id ciECqL-jy8kS; Mon, 12 Feb 2018 11:18:56 +0000 (UTC) Received: from garnet.daemonic.se (host-95-195-216-36.mobileonline.telia.com [95.195.216.36]) by mail.daemonic.se (Postfix) with ESMTPSA id 3zg38H5qpvzDhDr; Mon, 12 Feb 2018 11:18:55 +0000 (UTC) Subject: Re: svn commit: r329154 - in head/etc: defaults devd To: gljennjohn@gmail.com, Alexey Dokuchaev Cc: svn-src-head@freebsd.org, Cy Schubert , svn-src-all@freebsd.org, src-committers@freebsd.org, Warner Losh References: <201802120651.w1C6pKqF042318@repo.freebsd.org> <201802120655.w1C6tmCO080469@slippy.cwsent.com> <20180212070156.GA49948@FreeBSD.org> <20180212102536.76603ed6@ernst.home> From: Niclas Zeising Message-ID: <4dce5988-44a5-a4d3-123f-b2a19c2c32ea@daemonic.se> Date: Mon, 12 Feb 2018 12:18:47 +0100 User-Agent: Mutt/1.5.21 MIME-Version: 1.0 In-Reply-To: <20180212102536.76603ed6@ernst.home> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Feb 2018 11:19:06 -0000 On 02/12/18 10:25, Gary Jennejohn wrote: > On Mon, 12 Feb 2018 07:01:56 +0000 > Alexey Dokuchaev wrote: > >> On Sun, Feb 11, 2018 at 10:55:48PM -0800, Cy Schubert wrote: >>> In message <201802120651.w1C6pKqF042318@repo.freebsd.org>, Warner Losh >>> writes: >>>> New Revision: 329154 >>>> URL: https://svnweb.freebsd.org/changeset/base/329154 >>>> >>>> Log: >>>> Turn devmatch on by default. >>>> >>>> Turn devmatch on by default. However, use 'start' instead of >>>> 'onestart' in the devmatch.conf file so the setting of >>>> 'devmatch_enable' is honored. Give an example of what to put in >>>> devd.conf if you want to disable just the run-time part of devmatch. >>>> >>>> ... >>>> @@ -41,7 +41,7 @@ ddb_enable="NO" # Set to YES to load ddb script >>>> s at b >>>> ddb_config="/etc/ddb.conf" # ddb(8) config file. >>>> devd_enable="YES" # Run devd, to trigger programs on device tree changes. >>>> devd_flags="" # Additional flags for devd(8). >>>> -devmatch_enable="NO" # Demand load kernel modules based on device ids. >>>> +devmatch_enable="YES" # Demand load kernel modules based on device id >>>> s. >>> >>> This assumes that everyone has /usr in /. We might want to consider >>> moving devmatch to /sbin, or document that >> >> I was actually surprised to find out it's installed as /usr/sbin/devmatch; >> /sbin indeed looks more appropriate. >> >>> /usr and / be merged. >> >> Please don't. >> > > +1 > Any chance of moving /usr/bin/limits to /bin/limits at the same time? It's preventing some scripts (ddb) from running at boot. See https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=206291 for info. Regards! -- Niclas From owner-svn-src-all@freebsd.org Mon Feb 12 12:41:55 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DE6A9F1733E; Mon, 12 Feb 2018 12:41:54 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 947C87281B; Mon, 12 Feb 2018 12:41:54 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8F37B12011; Mon, 12 Feb 2018 12:41:54 +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 w1CCfsJr021904; Mon, 12 Feb 2018 12:41:54 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1CCfsb4021900; Mon, 12 Feb 2018 12:41:54 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201802121241.w1CCfsb4021900@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Mon, 12 Feb 2018 12:41:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r329157 - stable/11/sys/netinet6 X-SVN-Group: stable-11 X-SVN-Commit-Author: ae X-SVN-Commit-Paths: stable/11/sys/netinet6 X-SVN-Commit-Revision: 329157 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Feb 2018 12:41:55 -0000 Author: ae Date: Mon Feb 12 12:41:53 2018 New Revision: 329157 URL: https://svnweb.freebsd.org/changeset/base/329157 Log: MFC r328876: Modify ip6_get_prevhdr() to be able use it safely. Instead of returning pointer to the previous header, return its offset. In frag6_input() use m_copyback() and determined offset to store next header instead of accessing to it by pointer and assuming that the memory is contiguous. In rip6_input() use offset returned by ip6_get_prevhdr() instead of calculating it from pointers arithmetic, because IP header can belong to another mbuf in the chain. Reported by: Maxime Villard Modified: stable/11/sys/netinet6/frag6.c stable/11/sys/netinet6/ip6_input.c stable/11/sys/netinet6/ip6_var.h stable/11/sys/netinet6/raw_ip6.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/netinet6/frag6.c ============================================================================== --- stable/11/sys/netinet6/frag6.c Mon Feb 12 10:34:15 2018 (r329156) +++ stable/11/sys/netinet6/frag6.c Mon Feb 12 12:41:53 2018 (r329157) @@ -575,10 +575,8 @@ insert: /* * Store NXT to the original. */ - { - char *prvnxtp = ip6_get_prevhdr(m, offset); /* XXX */ - *prvnxtp = nxt; - } + m_copyback(m, ip6_get_prevhdr(m, offset), sizeof(uint8_t), + (caddr_t)&nxt); frag6_remque(q6); V_frag6_nfrags -= q6->ip6q_nfrag; Modified: stable/11/sys/netinet6/ip6_input.c ============================================================================== --- stable/11/sys/netinet6/ip6_input.c Mon Feb 12 10:34:15 2018 (r329156) +++ stable/11/sys/netinet6/ip6_input.c Mon Feb 12 12:41:53 2018 (r329157) @@ -1625,49 +1625,39 @@ ip6_pullexthdr(struct mbuf *m, size_t off, int nxt) /* * Get pointer to the previous header followed by the header * currently processed. - * XXX: This function supposes that - * M includes all headers, - * the next header field and the header length field of each header - * are valid, and - * the sum of each header length equals to OFF. - * Because of these assumptions, this function must be called very - * carefully. Moreover, it will not be used in the near future when - * we develop `neater' mechanism to process extension headers. */ -char * +int ip6_get_prevhdr(const struct mbuf *m, int off) { - struct ip6_hdr *ip6 = mtod(m, struct ip6_hdr *); + struct ip6_ext ip6e; + struct ip6_hdr *ip6; + int len, nlen, nxt; if (off == sizeof(struct ip6_hdr)) - return (&ip6->ip6_nxt); - else { - int len, nxt; - struct ip6_ext *ip6e = NULL; + return (offsetof(struct ip6_hdr, ip6_nxt)); + if (off < sizeof(struct ip6_hdr)) + panic("%s: off < sizeof(struct ip6_hdr)", __func__); - nxt = ip6->ip6_nxt; - len = sizeof(struct ip6_hdr); - while (len < off) { - ip6e = (struct ip6_ext *)(mtod(m, caddr_t) + len); - - switch (nxt) { - case IPPROTO_FRAGMENT: - len += sizeof(struct ip6_frag); - break; - case IPPROTO_AH: - len += (ip6e->ip6e_len + 2) << 2; - break; - default: - len += (ip6e->ip6e_len + 1) << 3; - break; - } - nxt = ip6e->ip6e_nxt; + ip6 = mtod(m, struct ip6_hdr *); + nxt = ip6->ip6_nxt; + len = sizeof(struct ip6_hdr); + nlen = 0; + while (len < off) { + m_copydata(m, len, sizeof(ip6e), (caddr_t)&ip6e); + switch (nxt) { + case IPPROTO_FRAGMENT: + nlen = sizeof(struct ip6_frag); + break; + case IPPROTO_AH: + nlen = (ip6e.ip6e_len + 2) << 2; + break; + default: + nlen = (ip6e.ip6e_len + 1) << 3; } - if (ip6e) - return (&ip6e->ip6e_nxt); - else - return NULL; + len += nlen; + nxt = ip6e.ip6e_nxt; } + return (len - nlen); } /* Modified: stable/11/sys/netinet6/ip6_var.h ============================================================================== --- stable/11/sys/netinet6/ip6_var.h Mon Feb 12 10:34:15 2018 (r329156) +++ stable/11/sys/netinet6/ip6_var.h Mon Feb 12 12:41:53 2018 (r329157) @@ -362,7 +362,7 @@ void ip6_direct_input(struct mbuf *); void ip6_freepcbopts(struct ip6_pktopts *); int ip6_unknown_opt(u_int8_t *, struct mbuf *, int); -char * ip6_get_prevhdr(const struct mbuf *, int); +int ip6_get_prevhdr(const struct mbuf *, int); int ip6_nexthdr(const struct mbuf *, int, int, int *); int ip6_lasthdr(const struct mbuf *, int, int, int *); Modified: stable/11/sys/netinet6/raw_ip6.c ============================================================================== --- stable/11/sys/netinet6/raw_ip6.c Mon Feb 12 10:34:15 2018 (r329156) +++ stable/11/sys/netinet6/raw_ip6.c Mon Feb 12 12:41:53 2018 (r329157) @@ -323,12 +323,10 @@ rip6_input(struct mbuf **mp, int *offp, int proto) RIP6STAT_INC(rip6s_nosockmcast); if (proto == IPPROTO_NONE) m_freem(m); - else { - char *prvnxtp = ip6_get_prevhdr(m, *offp); /* XXX */ + else icmp6_error(m, ICMP6_PARAM_PROB, ICMP6_PARAMPROB_NEXTHEADER, - prvnxtp - mtod(m, char *)); - } + ip6_get_prevhdr(m, *offp)); IP6STAT_DEC(ip6s_delivered); } return (IPPROTO_DONE); From owner-svn-src-all@freebsd.org Mon Feb 12 13:52:59 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B5578F1C417; Mon, 12 Feb 2018 13:52:59 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 67CF37516A; Mon, 12 Feb 2018 13:52:59 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6277412C9B; Mon, 12 Feb 2018 13:52:59 +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 w1CDqxXT056800; Mon, 12 Feb 2018 13:52:59 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1CDqwMe056796; Mon, 12 Feb 2018 13:52:58 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201802121352.w1CDqwMe056796@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Mon, 12 Feb 2018 13:52:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r329158 - stable/10/sys/netinet6 X-SVN-Group: stable-10 X-SVN-Commit-Author: ae X-SVN-Commit-Paths: stable/10/sys/netinet6 X-SVN-Commit-Revision: 329158 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Feb 2018 13:53:00 -0000 Author: ae Date: Mon Feb 12 13:52:58 2018 New Revision: 329158 URL: https://svnweb.freebsd.org/changeset/base/329158 Log: MFC r328876: Modify ip6_get_prevhdr() to be able use it safely. Instead of returning pointer to the previous header, return its offset. In frag6_input() use m_copyback() and determined offset to store next header instead of accessing to it by pointer and assuming that the memory is contiguous. In rip6_input() use offset returned by ip6_get_prevhdr() instead of calculating it from pointers arithmetic, because IP header can belong to another mbuf in the chain. Reported by: Maxime Villard Modified: stable/10/sys/netinet6/frag6.c stable/10/sys/netinet6/ip6_input.c stable/10/sys/netinet6/ip6_var.h stable/10/sys/netinet6/raw_ip6.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/netinet6/frag6.c ============================================================================== --- stable/10/sys/netinet6/frag6.c Mon Feb 12 12:41:53 2018 (r329157) +++ stable/10/sys/netinet6/frag6.c Mon Feb 12 13:52:58 2018 (r329158) @@ -579,10 +579,8 @@ insert: /* * Store NXT to the original. */ - { - char *prvnxtp = ip6_get_prevhdr(m, offset); /* XXX */ - *prvnxtp = nxt; - } + m_copyback(m, ip6_get_prevhdr(m, offset), sizeof(uint8_t), + (caddr_t)&nxt); frag6_remque(q6); V_frag6_nfrags -= q6->ip6q_nfrag; Modified: stable/10/sys/netinet6/ip6_input.c ============================================================================== --- stable/10/sys/netinet6/ip6_input.c Mon Feb 12 12:41:53 2018 (r329157) +++ stable/10/sys/netinet6/ip6_input.c Mon Feb 12 13:52:58 2018 (r329158) @@ -1677,49 +1677,39 @@ ip6_pullexthdr(struct mbuf *m, size_t off, int nxt) /* * Get pointer to the previous header followed by the header * currently processed. - * XXX: This function supposes that - * M includes all headers, - * the next header field and the header length field of each header - * are valid, and - * the sum of each header length equals to OFF. - * Because of these assumptions, this function must be called very - * carefully. Moreover, it will not be used in the near future when - * we develop `neater' mechanism to process extension headers. */ -char * +int ip6_get_prevhdr(struct mbuf *m, int off) { - struct ip6_hdr *ip6 = mtod(m, struct ip6_hdr *); + struct ip6_ext ip6e; + struct ip6_hdr *ip6; + int len, nlen, nxt; if (off == sizeof(struct ip6_hdr)) - return (&ip6->ip6_nxt); - else { - int len, nxt; - struct ip6_ext *ip6e = NULL; + return (offsetof(struct ip6_hdr, ip6_nxt)); + if (off < sizeof(struct ip6_hdr)) + panic("%s: off < sizeof(struct ip6_hdr)", __func__); - nxt = ip6->ip6_nxt; - len = sizeof(struct ip6_hdr); - while (len < off) { - ip6e = (struct ip6_ext *)(mtod(m, caddr_t) + len); - - switch (nxt) { - case IPPROTO_FRAGMENT: - len += sizeof(struct ip6_frag); - break; - case IPPROTO_AH: - len += (ip6e->ip6e_len + 2) << 2; - break; - default: - len += (ip6e->ip6e_len + 1) << 3; - break; - } - nxt = ip6e->ip6e_nxt; + ip6 = mtod(m, struct ip6_hdr *); + nxt = ip6->ip6_nxt; + len = sizeof(struct ip6_hdr); + nlen = 0; + while (len < off) { + m_copydata(m, len, sizeof(ip6e), (caddr_t)&ip6e); + switch (nxt) { + case IPPROTO_FRAGMENT: + nlen = sizeof(struct ip6_frag); + break; + case IPPROTO_AH: + nlen = (ip6e.ip6e_len + 2) << 2; + break; + default: + nlen = (ip6e.ip6e_len + 1) << 3; } - if (ip6e) - return (&ip6e->ip6e_nxt); - else - return NULL; + len += nlen; + nxt = ip6e.ip6e_nxt; } + return (len - nlen); } /* Modified: stable/10/sys/netinet6/ip6_var.h ============================================================================== --- stable/10/sys/netinet6/ip6_var.h Mon Feb 12 12:41:53 2018 (r329157) +++ stable/10/sys/netinet6/ip6_var.h Mon Feb 12 13:52:58 2018 (r329158) @@ -390,7 +390,7 @@ struct in6_ifaddr *ip6_getdstifaddr(struct mbuf *); void ip6_freepcbopts(struct ip6_pktopts *); int ip6_unknown_opt(u_int8_t *, struct mbuf *, int); -char * ip6_get_prevhdr(struct mbuf *, int); +int ip6_get_prevhdr(struct mbuf *, int); int ip6_nexthdr(struct mbuf *, int, int, int *); int ip6_lasthdr(struct mbuf *, int, int, int *); Modified: stable/10/sys/netinet6/raw_ip6.c ============================================================================== --- stable/10/sys/netinet6/raw_ip6.c Mon Feb 12 12:41:53 2018 (r329157) +++ stable/10/sys/netinet6/raw_ip6.c Mon Feb 12 13:52:58 2018 (r329158) @@ -328,12 +328,10 @@ rip6_input(struct mbuf **mp, int *offp, int proto) RIP6STAT_INC(rip6s_nosockmcast); if (proto == IPPROTO_NONE) m_freem(m); - else { - char *prvnxtp = ip6_get_prevhdr(m, *offp); /* XXX */ + else icmp6_error(m, ICMP6_PARAM_PROB, ICMP6_PARAMPROB_NEXTHEADER, - prvnxtp - mtod(m, char *)); - } + ip6_get_prevhdr(m, *offp)); IP6STAT_DEC(ip6s_delivered); } return (IPPROTO_DONE); From owner-svn-src-all@freebsd.org Mon Feb 12 13:56:58 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 68847F1C8BA; Mon, 12 Feb 2018 13:56:58 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 16BC275531; Mon, 12 Feb 2018 13:56:58 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 10B4912C9E; Mon, 12 Feb 2018 13:56:58 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1CDuvX2057275; Mon, 12 Feb 2018 13:56:57 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1CDuvgC057268; Mon, 12 Feb 2018 13:56:57 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201802121356.w1CDuvgC057268@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 12 Feb 2018 13:56:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r329159 - in stable/11/sys: amd64/conf conf dev/mlx4 dev/mlx4/mlx4_core dev/mlx4/mlx4_en dev/mlx4/mlx4_ib i386/conf modules modules/mlx4 modules/mlx4en modules/mlx4ib modules/mlxen ofed... X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in stable/11/sys: amd64/conf conf dev/mlx4 dev/mlx4/mlx4_core dev/mlx4/mlx4_en dev/mlx4/mlx4_ib i386/conf modules modules/mlx4 modules/mlx4en modules/mlx4ib modules/mlxen ofed/drivers/infiniband/hw/ml... X-SVN-Commit-Revision: 329159 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Feb 2018 13:56:58 -0000 Author: hselasky Date: Mon Feb 12 13:56:57 2018 New Revision: 329159 URL: https://svnweb.freebsd.org/changeset/base/329159 Log: MFC r306486-r325841: Update the mlx4, mlx4ib(4) and mlx4en(4) drivers to match FreeBSD-head prior to the Linux 4.9 RoCE/infiniband upgrade. Sponsored by: Mellanox Technologies MFC r306486: Move the ConnectX-3 and ConnectX-2 driver from sys/ofed into sys/dev/mlx4 like other PCI network drivers. The sys/ofed directory is now mainly reserved for generic infiniband code, with exception of the mthca driver. - Add new manual page, mlx4en(4), describing how to configure and load mlx4en. - All relevant driver C-files are now prefixed mlx4, mlx4_en and mlx4_ib respectivly to avoid object filename collisions when compiling the kernel. This also fixes an issue with proper dependency file generation for the C-files in question. - Device mlxen is now device mlx4en and depends on device mlx4, see mlx4en(4). Only the network device name remains unchanged. - The mlx4 and mlx4en modules are now built by default on i386 and amd64 targets. Only building the mlx4ib module depends on WITH_OFED=YES . Sponsored by: Mellanox Technologies MFC r310425: mlx: avoid use of __DATE__ to make build reproducible Reviewed by: hselasky Differential Revision: https://reviews.freebsd.org/D8886 MFC r310488: mlx(4): remove date from log message Further to r310425, go one step further and just remove the date. Reviewed by: hselasky Differential Revision: https://reviews.freebsd.org/D8888 MFC r324200: Implement SIOCGIFRSS{KEY,HASH} for the mlx4en(4) driver. Differential Revision: https://reviews.freebsd.org/D12176 Sponsored by: Mellanox Technologies MFC r324201: Setup mbuf hash type properly when receiving IP packets in the mlx4en(4) driver. Submitted by: sephe@ Differential Revision: https://reviews.freebsd.org/D12229 Sponsored by: Mellanox Technologies MFC r324621: mlx4: use enum constants instead of const vars for case exprs Follow up from r324201 to fix compilation with gcc, which complains about non-ICE case expressions. Reviewed by: hselasky Differential Revision: https://reviews.freebsd.org/D12675 MFC r325841: Update the mlx4 core and mlx4en(4) modules towards Linux v4.9. Background: The coming ibcore update forces an update of mlx4ib(4) which in turn requires an updated mlx4 core module. This also affects the mlx4en(4) module because commonly used APIs are updated. This commit is a middle step updating the mlx4 modules towards the new ibcore. This change contains no major new features. Changes in mlx4: a) Improved error handling when mlx4 PCI devices are detached inside VMs. b) Major update of codebase towards Linux 4.9. Changes in mlx4ib(4): a) Minimal changes needed in order to compile using the updated mlx4 core APIs. Changes in mlx4en(4): a) Update flow steering code in mlx4en to use new APIs for registering MAC addresses and IP addresses. b) Update all statistics counters to be 64-bit. c) Minimal changes needed in order to compile using the updated mlx4 core APIs. Sponsored by: Mellanox Technologies Added: stable/11/sys/dev/mlx4/ - copied from r306486, head/sys/dev/mlx4/ stable/11/sys/dev/mlx4/mlx4_core/fw_qos.h (contents, props changed) stable/11/sys/dev/mlx4/mlx4_core/mlx4_fw_qos.c (contents, props changed) stable/11/sys/modules/mlx4en/ - copied from r306486, head/sys/modules/mlx4en/ Deleted: stable/11/sys/dev/mlx4/mlx4_core/mlx4_sys_tune.c stable/11/sys/modules/mlxen/ stable/11/sys/ofed/drivers/infiniband/hw/mlx4/ stable/11/sys/ofed/drivers/net/ stable/11/sys/ofed/include/linux/ Modified: stable/11/sys/amd64/conf/NOTES stable/11/sys/conf/files stable/11/sys/dev/mlx4/cmd.h stable/11/sys/dev/mlx4/cq.h stable/11/sys/dev/mlx4/device.h stable/11/sys/dev/mlx4/driver.h stable/11/sys/dev/mlx4/mlx4_core/fw.h stable/11/sys/dev/mlx4/mlx4_core/icm.h stable/11/sys/dev/mlx4/mlx4_core/mlx4.h stable/11/sys/dev/mlx4/mlx4_core/mlx4_alloc.c stable/11/sys/dev/mlx4/mlx4_core/mlx4_catas.c stable/11/sys/dev/mlx4/mlx4_core/mlx4_cmd.c stable/11/sys/dev/mlx4/mlx4_core/mlx4_cq.c stable/11/sys/dev/mlx4/mlx4_core/mlx4_eq.c stable/11/sys/dev/mlx4/mlx4_core/mlx4_fw.c stable/11/sys/dev/mlx4/mlx4_core/mlx4_icm.c stable/11/sys/dev/mlx4/mlx4_core/mlx4_intf.c stable/11/sys/dev/mlx4/mlx4_core/mlx4_main.c stable/11/sys/dev/mlx4/mlx4_core/mlx4_mcg.c stable/11/sys/dev/mlx4/mlx4_core/mlx4_mr.c stable/11/sys/dev/mlx4/mlx4_core/mlx4_pd.c stable/11/sys/dev/mlx4/mlx4_core/mlx4_port.c stable/11/sys/dev/mlx4/mlx4_core/mlx4_profile.c stable/11/sys/dev/mlx4/mlx4_core/mlx4_qp.c stable/11/sys/dev/mlx4/mlx4_core/mlx4_reset.c stable/11/sys/dev/mlx4/mlx4_core/mlx4_resource_tracker.c stable/11/sys/dev/mlx4/mlx4_core/mlx4_sense.c stable/11/sys/dev/mlx4/mlx4_core/mlx4_srq.c stable/11/sys/dev/mlx4/mlx4_en/en.h stable/11/sys/dev/mlx4/mlx4_en/en_port.h stable/11/sys/dev/mlx4/mlx4_en/mlx4_en_cq.c stable/11/sys/dev/mlx4/mlx4_en/mlx4_en_main.c stable/11/sys/dev/mlx4/mlx4_en/mlx4_en_netdev.c stable/11/sys/dev/mlx4/mlx4_en/mlx4_en_port.c stable/11/sys/dev/mlx4/mlx4_en/mlx4_en_resources.c stable/11/sys/dev/mlx4/mlx4_en/mlx4_en_rx.c stable/11/sys/dev/mlx4/mlx4_en/mlx4_en_tx.c stable/11/sys/dev/mlx4/mlx4_ib/mlx4_ib.h stable/11/sys/dev/mlx4/mlx4_ib/mlx4_ib_cq.c stable/11/sys/dev/mlx4/mlx4_ib/mlx4_ib_mad.c stable/11/sys/dev/mlx4/mlx4_ib/mlx4_ib_main.c stable/11/sys/dev/mlx4/mlx4_ib/mlx4_ib_mr.c stable/11/sys/dev/mlx4/mlx4_ib/mlx4_ib_qp.c stable/11/sys/dev/mlx4/mlx4_ib/mlx4_ib_srq.c stable/11/sys/dev/mlx4/mlx4_ib/mlx4_ib_sysfs.c stable/11/sys/dev/mlx4/qp.h stable/11/sys/dev/mlx4/stats.h stable/11/sys/i386/conf/NOTES stable/11/sys/modules/Makefile stable/11/sys/modules/mlx4/Makefile stable/11/sys/modules/mlx4en/Makefile stable/11/sys/modules/mlx4ib/Makefile Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/amd64/conf/NOTES ============================================================================== --- stable/11/sys/amd64/conf/NOTES Mon Feb 12 13:52:58 2018 (r329158) +++ stable/11/sys/amd64/conf/NOTES Mon Feb 12 13:56:57 2018 (r329159) @@ -324,7 +324,7 @@ options DRM_DEBUG # Include debug printfs (slow) # ixl: Intel XL710 40Gbe PCIE Ethernet # ixlv: Intel XL710 40Gbe VF PCIE Ethernet # mlx4ib: Mellanox ConnectX HCA InfiniBand -# mlxen: Mellanox ConnectX HCA Ethernet +# mlx4en: Mellanox ConnectX HCA Ethernet # mthca: Mellanox HCA InfiniBand # nfe: nVidia nForce MCP on-board Ethernet Networking (BSD open source) # sfxge: Solarflare SFC9000 family 10Gb Ethernet adapters @@ -343,8 +343,9 @@ device iwn # Intel 4965/1000/5000/6000 wireless NICs device ixl # Intel XL710 40Gbe PCIE Ethernet options IXL_IW # Enable iWARP Client Interface in ixl(4) device ixlv # Intel XL710 40Gbe VF PCIE Ethernet +device mlx4 # Shared code module between IB and Ethernet device mlx4ib # Mellanox ConnectX HCA InfiniBand -device mlxen # Mellanox ConnectX HCA Ethernet +device mlx4en # Mellanox ConnectX HCA Ethernet device mthca # Mellanox HCA InfiniBand device nfe # nVidia nForce MCP on-board Ethernet device sfxge # Solarflare SFC9000 10Gb Ethernet Modified: stable/11/sys/conf/files ============================================================================== --- stable/11/sys/conf/files Mon Feb 12 13:52:58 2018 (r329158) +++ stable/11/sys/conf/files Mon Feb 12 13:56:57 2018 (r329159) @@ -4286,131 +4286,90 @@ ofed/drivers/infiniband/ulp/sdp/sdp_cma.c optional sdp ofed/drivers/infiniband/ulp/sdp/sdp_tx.c optional sdp inet \ compile-with "${OFED_C} -I$S/ofed/drivers/infiniband/ulp/sdp/" -ofed/drivers/infiniband/hw/mlx4/alias_GUID.c optional mlx4ib \ - no-depend obj-prefix "mlx4ib_" \ - compile-with "${OFED_C_NOIMP} -I$S/ofed/drivers/infiniband/hw/mlx4/" -ofed/drivers/infiniband/hw/mlx4/mcg.c optional mlx4ib \ - no-depend obj-prefix "mlx4ib_" \ - compile-with "${OFED_C_NOIMP} -I$S/ofed/drivers/infiniband/hw/mlx4/" -ofed/drivers/infiniband/hw/mlx4/sysfs.c optional mlx4ib \ - no-depend obj-prefix "mlx4ib_" \ - compile-with "${OFED_C_NOIMP} -I$S/ofed/drivers/infiniband/hw/mlx4/" -ofed/drivers/infiniband/hw/mlx4/cm.c optional mlx4ib \ - no-depend obj-prefix "mlx4ib_" \ - compile-with "${OFED_C_NOIMP} -I$S/ofed/drivers/infiniband/hw/mlx4/" -ofed/drivers/infiniband/hw/mlx4/ah.c optional mlx4ib \ - no-depend obj-prefix "mlx4ib_" \ - compile-with "${OFED_C_NOIMP} -I$S/ofed/drivers/infiniband/hw/mlx4/" -ofed/drivers/infiniband/hw/mlx4/cq.c optional mlx4ib \ - no-depend obj-prefix "mlx4ib_" \ - compile-with "${OFED_C_NOIMP} -I$S/ofed/drivers/infiniband/hw/mlx4/" -ofed/drivers/infiniband/hw/mlx4/doorbell.c optional mlx4ib \ - no-depend obj-prefix "mlx4ib_" \ - compile-with "${OFED_C_NOIMP} -I$S/ofed/drivers/infiniband/hw/mlx4/" -ofed/drivers/infiniband/hw/mlx4/mad.c optional mlx4ib \ - no-depend obj-prefix "mlx4ib_" \ - compile-with "${OFED_C_NOIMP} -I$S/ofed/drivers/infiniband/hw/mlx4/" -ofed/drivers/infiniband/hw/mlx4/main.c optional mlx4ib \ - no-depend obj-prefix "mlx4ib_" \ - compile-with "${OFED_C_NOIMP} -I$S/ofed/drivers/infiniband/hw/mlx4/" -ofed/drivers/infiniband/hw/mlx4/mlx4_exp.c optional mlx4ib \ - no-depend obj-prefix "mlx4ib_" \ - compile-with "${OFED_C_NOIMP} -I$S/ofed/drivers/infiniband/hw/mlx4/" -ofed/drivers/infiniband/hw/mlx4/mr.c optional mlx4ib \ - no-depend obj-prefix "mlx4ib_" \ - compile-with "${OFED_C_NOIMP} -I$S/ofed/drivers/infiniband/hw/mlx4/" -ofed/drivers/infiniband/hw/mlx4/qp.c optional mlx4ib \ - no-depend obj-prefix "mlx4ib_" \ - compile-with "${OFED_C_NOIMP} -I$S/ofed/drivers/infiniband/hw/mlx4/" -ofed/drivers/infiniband/hw/mlx4/srq.c optional mlx4ib \ - no-depend obj-prefix "mlx4ib_" \ - compile-with "${OFED_C_NOIMP} -I$S/ofed/drivers/infiniband/hw/mlx4/" -ofed/drivers/infiniband/hw/mlx4/wc.c optional mlx4ib \ - no-depend obj-prefix "mlx4ib_" \ - compile-with "${OFED_C_NOIMP} -I$S/ofed/drivers/infiniband/hw/mlx4/" +dev/mlx4/mlx4_ib/mlx4_ib_alias_GUID.c optional mlx4ib pci ofed \ + compile-with "${OFED_C}" +dev/mlx4/mlx4_ib/mlx4_ib_mcg.c optional mlx4ib pci ofed \ + compile-with "${OFED_C}" +dev/mlx4/mlx4_ib/mlx4_ib_sysfs.c optional mlx4ib pci ofed \ + compile-with "${OFED_C}" +dev/mlx4/mlx4_ib/mlx4_ib_cm.c optional mlx4ib pci ofed \ + compile-with "${OFED_C}" +dev/mlx4/mlx4_ib/mlx4_ib_ah.c optional mlx4ib pci ofed \ + compile-with "${OFED_C}" +dev/mlx4/mlx4_ib/mlx4_ib_cq.c optional mlx4ib pci ofed \ + compile-with "${OFED_C}" +dev/mlx4/mlx4_ib/mlx4_ib_doorbell.c optional mlx4ib pci ofed \ + compile-with "${OFED_C}" +dev/mlx4/mlx4_ib/mlx4_ib_mad.c optional mlx4ib pci ofed \ + compile-with "${OFED_C}" +dev/mlx4/mlx4_ib/mlx4_ib_main.c optional mlx4ib pci ofed \ + compile-with "${OFED_C}" +dev/mlx4/mlx4_ib/mlx4_ib_exp.c optional mlx4ib pci ofed \ + compile-with "${OFED_C}" +dev/mlx4/mlx4_ib/mlx4_ib_mr.c optional mlx4ib pci ofed \ + compile-with "${OFED_C}" +dev/mlx4/mlx4_ib/mlx4_ib_qp.c optional mlx4ib pci ofed \ + compile-with "${OFED_C}" +dev/mlx4/mlx4_ib/mlx4_ib_srq.c optional mlx4ib pci ofed \ + compile-with "${OFED_C}" +dev/mlx4/mlx4_ib/mlx4_ib_wc.c optional mlx4ib pci ofed \ + compile-with "${OFED_C}" -ofed/drivers/net/mlx4/alloc.c optional mlx4ib | mlxen \ - no-depend obj-prefix "mlx4_" \ - compile-with "${OFED_C_NOIMP} -I$S/ofed/drivers/net/mlx4/" -ofed/drivers/net/mlx4/catas.c optional mlx4ib | mlxen \ - no-depend obj-prefix "mlx4_" \ - compile-with "${OFED_C_NOIMP} -I$S/ofed/drivers/net/mlx4/" -ofed/drivers/net/mlx4/cmd.c optional mlx4ib | mlxen \ - no-depend obj-prefix "mlx4_" \ - compile-with "${OFED_C_NOIMP} -I$S/ofed/drivers/net/mlx4/" -ofed/drivers/net/mlx4/cq.c optional mlx4ib | mlxen \ - no-depend obj-prefix "mlx4_" \ - compile-with "${OFED_C_NOIMP} -I$S/ofed/drivers/net/mlx4/" -ofed/drivers/net/mlx4/eq.c optional mlx4ib | mlxen \ - no-depend obj-prefix "mlx4_" \ - compile-with "${OFED_C_NOIMP} -I$S/ofed/drivers/net/mlx4/" -ofed/drivers/net/mlx4/fw.c optional mlx4ib | mlxen \ - no-depend obj-prefix "mlx4_" \ - compile-with "${OFED_C_NOIMP} -I$S/ofed/drivers/net/mlx4/" -ofed/drivers/net/mlx4/icm.c optional mlx4ib | mlxen \ - no-depend obj-prefix "mlx4_" \ - compile-with "${OFED_C_NOIMP} -I$S/ofed/drivers/net/mlx4/" -ofed/drivers/net/mlx4/intf.c optional mlx4ib | mlxen \ - no-depend obj-prefix "mlx4_" \ - compile-with "${OFED_C_NOIMP} -I$S/ofed/drivers/net/mlx4/" -ofed/drivers/net/mlx4/main.c optional mlx4ib | mlxen \ - no-depend obj-prefix "mlx4_" \ - compile-with "${OFED_C_NOIMP} -I$S/ofed/drivers/net/mlx4/" -ofed/drivers/net/mlx4/mcg.c optional mlx4ib | mlxen \ - no-depend obj-prefix "mlx4_" \ - compile-with "${OFED_C_NOIMP} -I$S/ofed/drivers/net/mlx4/ -Wno-unused" -ofed/drivers/net/mlx4/mr.c optional mlx4ib | mlxen \ - no-depend obj-prefix "mlx4_" \ - compile-with "${OFED_C_NOIMP} -I$S/ofed/drivers/net/mlx4/" -ofed/drivers/net/mlx4/pd.c optional mlx4ib | mlxen \ - no-depend obj-prefix "mlx4_" \ - compile-with "${OFED_C_NOIMP} -I$S/ofed/drivers/net/mlx4/" -ofed/drivers/net/mlx4/port.c optional mlx4ib | mlxen \ - no-depend obj-prefix "mlx4_" \ - compile-with "${OFED_C_NOIMP} -I$S/ofed/drivers/net/mlx4/" -ofed/drivers/net/mlx4/profile.c optional mlx4ib | mlxen \ - no-depend obj-prefix "mlx4_" \ - compile-with "${OFED_C_NOIMP} -I$S/ofed/drivers/net/mlx4/" -ofed/drivers/net/mlx4/qp.c optional mlx4ib | mlxen \ - no-depend obj-prefix "mlx4_" \ - compile-with "${OFED_C_NOIMP} -I$S/ofed/drivers/net/mlx4/" -ofed/drivers/net/mlx4/reset.c optional mlx4ib | mlxen \ - no-depend obj-prefix "mlx4_" \ - compile-with "${OFED_C_NOIMP} -I$S/ofed/drivers/net/mlx4/" -ofed/drivers/net/mlx4/sense.c optional mlx4ib | mlxen \ - no-depend obj-prefix "mlx4_" \ - compile-with "${OFED_C_NOIMP} -I$S/ofed/drivers/net/mlx4/" -ofed/drivers/net/mlx4/srq.c optional mlx4ib | mlxen \ - no-depend obj-prefix "mlx4_" \ - compile-with "${OFED_C_NOIMP} -I$S/ofed/drivers/net/mlx4/" -ofed/drivers/net/mlx4/resource_tracker.c optional mlx4ib | mlxen \ - no-depend obj-prefix "mlx4_" \ - compile-with "${OFED_C_NOIMP} -I$S/ofed/drivers/net/mlx4/" -ofed/drivers/net/mlx4/sys_tune.c optional mlx4ib | mlxen \ - no-depend obj-prefix "mlx4_" \ - compile-with "${OFED_C_NOIMP} -I$S/ofed/drivers/net/mlx4/" +dev/mlx4/mlx4_core/mlx4_alloc.c optional mlx4 pci \ + compile-with "${OFED_C}" +dev/mlx4/mlx4_core/mlx4_catas.c optional mlx4 pci \ + compile-with "${OFED_C}" +dev/mlx4/mlx4_core/mlx4_cmd.c optional mlx4 pci \ + compile-with "${OFED_C}" +dev/mlx4/mlx4_core/mlx4_cq.c optional mlx4 pci \ + compile-with "${OFED_C}" +dev/mlx4/mlx4_core/mlx4_eq.c optional mlx4 pci \ + compile-with "${OFED_C}" +dev/mlx4/mlx4_core/mlx4_fw.c optional mlx4 pci \ + compile-with "${OFED_C}" +dev/mlx4/mlx4_core/mlx4_fw_qos.c optional mlx4 pci \ + compile-with "${OFED_C}" +dev/mlx4/mlx4_core/mlx4_icm.c optional mlx4 pci \ + compile-with "${OFED_C}" +dev/mlx4/mlx4_core/mlx4_intf.c optional mlx4 pci \ + compile-with "${OFED_C}" +dev/mlx4/mlx4_core/mlx4_main.c optional mlx4 pci \ + compile-with "${OFED_C}" +dev/mlx4/mlx4_core/mlx4_mcg.c optional mlx4 pci \ + compile-with "${OFED_C}" +dev/mlx4/mlx4_core/mlx4_mr.c optional mlx4 pci \ + compile-with "${OFED_C}" +dev/mlx4/mlx4_core/mlx4_pd.c optional mlx4 pci \ + compile-with "${OFED_C}" +dev/mlx4/mlx4_core/mlx4_port.c optional mlx4 pci \ + compile-with "${OFED_C}" +dev/mlx4/mlx4_core/mlx4_profile.c optional mlx4 pci \ + compile-with "${OFED_C}" +dev/mlx4/mlx4_core/mlx4_qp.c optional mlx4 pci \ + compile-with "${OFED_C}" +dev/mlx4/mlx4_core/mlx4_reset.c optional mlx4 pci \ + compile-with "${OFED_C}" +dev/mlx4/mlx4_core/mlx4_sense.c optional mlx4 pci \ + compile-with "${OFED_C}" +dev/mlx4/mlx4_core/mlx4_srq.c optional mlx4 pci \ + compile-with "${OFED_C}" +dev/mlx4/mlx4_core/mlx4_resource_tracker.c optional mlx4 pci \ + compile-with "${OFED_C}" -ofed/drivers/net/mlx4/en_cq.c optional mlxen \ - no-depend obj-prefix "mlx4_" \ - compile-with "${OFED_C_NOIMP} -I$S/ofed/drivers/net/mlx4/" -ofed/drivers/net/mlx4/en_main.c optional mlxen \ - no-depend obj-prefix "mlx4_" \ - compile-with "${OFED_C_NOIMP} -I$S/ofed/drivers/net/mlx4/" -ofed/drivers/net/mlx4/en_netdev.c optional mlxen \ - no-depend obj-prefix "mlx4_" \ - compile-with "${OFED_C_NOIMP} -I$S/ofed/drivers/net/mlx4/" -ofed/drivers/net/mlx4/en_port.c optional mlxen \ - no-depend obj-prefix "mlx4_" \ - compile-with "${OFED_C_NOIMP} -I$S/ofed/drivers/net/mlx4/" -ofed/drivers/net/mlx4/en_resources.c optional mlxen \ - no-depend obj-prefix "mlx4_" \ - compile-with "${OFED_C_NOIMP} -I$S/ofed/drivers/net/mlx4/" -ofed/drivers/net/mlx4/en_rx.c optional mlxen \ - no-depend obj-prefix "mlx4_" \ - compile-with "${OFED_C_NOIMP} -I$S/ofed/drivers/net/mlx4/" -ofed/drivers/net/mlx4/en_tx.c optional mlxen \ - no-depend obj-prefix "mlx4_" \ - compile-with "${OFED_C_NOIMP} -I$S/ofed/drivers/net/mlx4/" +dev/mlx4/mlx4_en/mlx4_en_cq.c optional mlx4en pci inet inet6 \ + compile-with "${OFED_C}" +dev/mlx4/mlx4_en/mlx4_en_main.c optional mlx4en pci inet inet6 \ + compile-with "${OFED_C}" +dev/mlx4/mlx4_en/mlx4_en_netdev.c optional mlx4en pci inet inet6 \ + compile-with "${OFED_C}" +dev/mlx4/mlx4_en/mlx4_en_port.c optional mlx4en pci inet inet6 \ + compile-with "${OFED_C}" +dev/mlx4/mlx4_en/mlx4_en_resources.c optional mlx4en pci inet inet6 \ + compile-with "${OFED_C}" +dev/mlx4/mlx4_en/mlx4_en_rx.c optional mlx4en pci inet inet6 \ + compile-with "${OFED_C}" +dev/mlx4/mlx4_en/mlx4_en_tx.c optional mlx4en pci inet inet6 \ + compile-with "${OFED_C}" dev/mlx5/mlx5_ib/mlx5_ib_ah.c optional mlx5ib pci ofed \ compile-with "${OFED_C}" Modified: stable/11/sys/dev/mlx4/cmd.h ============================================================================== --- head/sys/dev/mlx4/cmd.h Fri Sep 30 08:23:06 2016 (r306486) +++ stable/11/sys/dev/mlx4/cmd.h Mon Feb 12 13:56:57 2018 (r329159) @@ -36,6 +36,8 @@ #include #include +struct mlx4_counter; + enum { /* initialization and general commands */ MLX4_CMD_SYS_EN = 0x1, @@ -67,8 +69,13 @@ enum { MLX4_CMD_MAP_ICM_AUX = 0xffc, MLX4_CMD_UNMAP_ICM_AUX = 0xffb, MLX4_CMD_SET_ICM_SIZE = 0xffd, + MLX4_CMD_ACCESS_REG = 0x3b, + MLX4_CMD_ALLOCATE_VPP = 0x80, + MLX4_CMD_SET_VPORT_QOS = 0x81, + /*master notify fw on finish for slave's flr*/ MLX4_CMD_INFORM_FLR_DONE = 0x5b, + MLX4_CMD_VIRT_PORT_MAP = 0x5c, MLX4_CMD_GET_OP_REQ = 0x59, /* TPT commands */ @@ -116,6 +123,7 @@ enum { /* special QP and management commands */ MLX4_CMD_CONF_SPECIAL_QP = 0x23, MLX4_CMD_MAD_IFC = 0x24, + MLX4_CMD_MAD_DEMUX = 0x203, /* multicast commands */ MLX4_CMD_READ_MCG = 0x25, @@ -125,6 +133,7 @@ enum { /* miscellaneous commands */ MLX4_CMD_DIAG_RPRT = 0x30, MLX4_CMD_NOP = 0x31, + MLX4_CMD_CONFIG_DEV = 0x3a, MLX4_CMD_ACCESS_MEM = 0x2e, MLX4_CMD_SET_VEP = 0x52, @@ -158,6 +167,9 @@ enum { MLX4_QP_FLOW_STEERING_ATTACH = 0x65, MLX4_QP_FLOW_STEERING_DETACH = 0x66, MLX4_FLOW_STEERING_IB_UC_QP_RANGE = 0x64, + + /* Update and read QCN parameters */ + MLX4_CMD_CONGESTION_CTRL_OPCODE = 0x68, }; enum { @@ -167,27 +179,85 @@ enum { }; enum { + /* virtual to physical port mapping opcode modifiers */ + MLX4_GET_PORT_VIRT2PHY = 0x0, + MLX4_SET_PORT_VIRT2PHY = 0x1, +}; + +enum { MLX4_MAILBOX_SIZE = 4096, MLX4_ACCESS_MEM_ALIGN = 256, }; enum { - /* set port opcode modifiers */ - MLX4_SET_PORT_GENERAL = 0x0, - MLX4_SET_PORT_RQP_CALC = 0x1, - MLX4_SET_PORT_MAC_TABLE = 0x2, - MLX4_SET_PORT_VLAN_TABLE = 0x3, - MLX4_SET_PORT_PRIO_MAP = 0x4, - MLX4_SET_PORT_GID_TABLE = 0x5, - MLX4_SET_PORT_PRIO2TC = 0x8, - MLX4_SET_PORT_SCHEDULER = 0x9 + /* Set port opcode modifiers */ + MLX4_SET_PORT_IB_OPCODE = 0x0, + MLX4_SET_PORT_ETH_OPCODE = 0x1, + MLX4_SET_PORT_BEACON_OPCODE = 0x4, }; enum { + /* Set port Ethernet input modifiers */ + MLX4_SET_PORT_GENERAL = 0x0, + MLX4_SET_PORT_RQP_CALC = 0x1, + MLX4_SET_PORT_MAC_TABLE = 0x2, + MLX4_SET_PORT_VLAN_TABLE = 0x3, + MLX4_SET_PORT_PRIO_MAP = 0x4, + MLX4_SET_PORT_GID_TABLE = 0x5, + MLX4_SET_PORT_PRIO2TC = 0x8, + MLX4_SET_PORT_SCHEDULER = 0x9, + MLX4_SET_PORT_VXLAN = 0xB, + MLX4_SET_PORT_ROCE_ADDR = 0xD +}; + +enum { + MLX4_CMD_MAD_DEMUX_CONFIG = 0, + MLX4_CMD_MAD_DEMUX_QUERY_STATE = 1, + MLX4_CMD_MAD_DEMUX_QUERY_RESTR = 2, /* Query mad demux restrictions */ +}; + +enum { MLX4_CMD_WRAPPED, MLX4_CMD_NATIVE }; +/* + * MLX4_RX_CSUM_MODE_VAL_NON_TCP_UDP - + * Receive checksum value is reported in CQE also for non TCP/UDP packets. + * + * MLX4_RX_CSUM_MODE_L4 - + * L4_CSUM bit in CQE, which indicates whether or not L4 checksum + * was validated correctly, is supported. + * + * MLX4_RX_CSUM_MODE_IP_OK_IP_NON_TCP_UDP - + * IP_OK CQE's field is supported also for non TCP/UDP IP packets. + * + * MLX4_RX_CSUM_MODE_MULTI_VLAN - + * Receive Checksum offload is supported for packets with more than 2 vlan headers. + */ +enum mlx4_rx_csum_mode { + MLX4_RX_CSUM_MODE_VAL_NON_TCP_UDP = 1UL << 0, + MLX4_RX_CSUM_MODE_L4 = 1UL << 1, + MLX4_RX_CSUM_MODE_IP_OK_IP_NON_TCP_UDP = 1UL << 2, + MLX4_RX_CSUM_MODE_MULTI_VLAN = 1UL << 3 +}; + +struct mlx4_config_dev_params { + u16 vxlan_udp_dport; + u8 rx_csum_flags_port_1; + u8 rx_csum_flags_port_2; +}; + +enum mlx4_en_congestion_control_algorithm { + MLX4_CTRL_ALGO_802_1_QAU_REACTION_POINT = 0, +}; + +enum mlx4_en_congestion_control_opmod { + MLX4_CONGESTION_CONTROL_GET_PARAMS, + MLX4_CONGESTION_CONTROL_GET_STATISTICS, + MLX4_CONGESTION_CONTROL_SET_PARAMS = 4, +}; + struct mlx4_dev; struct mlx4_cmd_mailbox { @@ -233,26 +303,28 @@ static inline int mlx4_cmd_imm(struct mlx4_dev *dev, u struct mlx4_cmd_mailbox *mlx4_alloc_cmd_mailbox(struct mlx4_dev *dev); void mlx4_free_cmd_mailbox(struct mlx4_dev *dev, struct mlx4_cmd_mailbox *mailbox); +int mlx4_get_counter_stats(struct mlx4_dev *dev, int counter_index, + struct mlx4_counter *counter_stats, int reset); u32 mlx4_comm_get_version(void); -int mlx4_set_vf_mac(struct mlx4_dev *dev, int port, int vf, u8 *mac); -int mlx4_set_vf_vlan(struct mlx4_dev *dev, int port, int vf, u16 vlan, u8 qos); +int mlx4_set_vf_mac(struct mlx4_dev *dev, int port, int vf, u64 mac); +int mlx4_set_vf_vlan(struct mlx4_dev *dev, int port, int vf, u16 vlan, + u8 qos, __be16 proto); +int mlx4_set_vf_rate(struct mlx4_dev *dev, int port, int vf, int min_tx_rate, + int max_tx_rate); int mlx4_set_vf_spoofchk(struct mlx4_dev *dev, int port, int vf, bool setting); -int mlx4_set_vf_link_state(struct mlx4_dev *dev, int port, int vf, int link_state); -int mlx4_get_vf_link_state(struct mlx4_dev *dev, int port, int vf); +int mlx4_config_dev_retrieval(struct mlx4_dev *dev, + struct mlx4_config_dev_params *params); +void mlx4_cmd_wake_completions(struct mlx4_dev *dev); +void mlx4_report_internal_err_comm_event(struct mlx4_dev *dev); /* * mlx4_get_slave_default_vlan - - * retrun true if VST ( default vlan) - * if VST will fill vlan & qos (if not NULL) + * return true if VST ( default vlan) + * if VST, will return vlan & qos (if not NULL) */ -bool mlx4_get_slave_default_vlan(struct mlx4_dev *dev, int port, int slave, u16 *vlan, u8 *qos); +bool mlx4_get_slave_default_vlan(struct mlx4_dev *dev, int port, int slave, + u16 *vlan, u8 *qos); -enum { - IFLA_VF_LINK_STATE_AUTO, /* link state of the uplink */ - IFLA_VF_LINK_STATE_ENABLE, /* link always up */ - IFLA_VF_LINK_STATE_DISABLE, /* link always down */ - __IFLA_VF_LINK_STATE_MAX, -}; - #define MLX4_COMM_GET_IF_REV(cmd_chan_ver) (u8)((cmd_chan_ver) >> 8) +#define COMM_CHAN_EVENT_INTERNAL_ERR (1 << 17) #endif /* MLX4_CMD_H */ Modified: stable/11/sys/dev/mlx4/cq.h ============================================================================== --- head/sys/dev/mlx4/cq.h Fri Sep 30 08:23:06 2016 (r306486) +++ stable/11/sys/dev/mlx4/cq.h Mon Feb 12 13:56:57 2018 (r329159) @@ -42,31 +42,22 @@ struct mlx4_cqe { __be32 vlan_my_qpn; __be32 immed_rss_invalid; __be32 g_mlpath_rqpn; + __be16 sl_vid; union { struct { - union { - struct { - __be16 sl_vid; - __be16 rlid; - }; - __be32 timestamp_16_47; - }; + __be16 rlid; __be16 status; u8 ipv6_ext_mask; u8 badfcs_enc; }; - struct { - __be16 reserved1; - u8 smac[6]; - }; + u8 smac[ETH_ALEN]; }; __be32 byte_cnt; __be16 wqe_index; __be16 checksum; - u8 reserved2[1]; - __be16 timestamp_0_15; + u8 reserved[3]; u8 owner_sr_opcode; -} __packed; +}; struct mlx4_err_cqe { __be32 my_qpn; @@ -95,7 +86,13 @@ struct mlx4_ts_cqe { } __packed; enum { - MLX4_CQE_VLAN_PRESENT_MASK = 1 << 29, + MLX4_CQE_L2_TUNNEL_IPOK = 1 << 31, + MLX4_CQE_CVLAN_PRESENT_MASK = 1 << 29, + MLX4_CQE_SVLAN_PRESENT_MASK = 1 << 30, + MLX4_CQE_L2_TUNNEL = 1 << 27, + MLX4_CQE_L2_TUNNEL_CSUM = 1 << 26, + MLX4_CQE_L2_TUNNEL_IPV4 = 1 << 25, + MLX4_CQE_QPN_MASK = 0xffffff, MLX4_CQE_VID_MASK = 0xfff, }; @@ -177,5 +174,5 @@ int mlx4_cq_modify(struct mlx4_dev *dev, struct mlx4_c u16 count, u16 period); int mlx4_cq_resize(struct mlx4_dev *dev, struct mlx4_cq *cq, int entries, struct mlx4_mtt *mtt); -int mlx4_cq_ignore_overrun(struct mlx4_dev *dev, struct mlx4_cq *cq); + #endif /* MLX4_CQ_H */ Modified: stable/11/sys/dev/mlx4/device.h ============================================================================== --- head/sys/dev/mlx4/device.h Fri Sep 30 08:23:06 2016 (r306486) +++ stable/11/sys/dev/mlx4/device.h Mon Feb 12 13:56:57 2018 (r329159) @@ -39,20 +39,21 @@ #include #include #include +#include +#include + #include #include +#define DEFAULT_UAR_PAGE_SHIFT 12 + #define MAX_MSIX_P_PORT 17 #define MAX_MSIX 64 -#define MSIX_LEGACY_SZ 4 #define MIN_MSIX_P_PORT 5 +#define MLX4_IS_LEGACY_EQ_MODE(dev_cap) ((dev_cap).num_comp_vectors < \ + (dev_cap).num_ports * MIN_MSIX_P_PORT) -#define MLX4_ROCE_MAX_GIDS 128 -#define MLX4_ROCE_PF_GIDS 16 - -#define MLX4_NUM_UP 8 -#define MLX4_NUM_TC 8 #define MLX4_MAX_100M_UNITS_VAL 255 /* * work around: can't set values * greater then this value when @@ -62,6 +63,9 @@ #define MLX4_RATELIMIT_1G_UNITS 4 /* 1 Gbps */ #define MLX4_RATELIMIT_DEFAULT 0x00ff +#define MLX4_ROCE_MAX_GIDS 128 +#define MLX4_ROCE_PF_GIDS 16 + #define CORE_CLOCK_MASK 0xffffffffffffULL enum { @@ -70,8 +74,9 @@ enum { MLX4_FLAG_MASTER = 1 << 2, MLX4_FLAG_SLAVE = 1 << 3, MLX4_FLAG_SRIOV = 1 << 4, - MLX4_FLAG_DEV_NUM_STR = 1 << 5, - MLX4_FLAG_OLD_REG_MAC = 1 << 6, + MLX4_FLAG_OLD_REG_MAC = 1 << 6, + MLX4_FLAG_BONDED = 1 << 7, + MLX4_FLAG_SECURE_HOST = 1 << 8, }; enum { @@ -81,7 +86,8 @@ enum { enum { MLX4_MAX_PORTS = 2, - MLX4_MAX_PORT_PKEYS = 128 + MLX4_MAX_PORT_PKEYS = 128, + MLX4_MAX_PORT_GIDS = 128 }; /* base qkey for use in sriov tunnel-qp/proxy-qp communication. @@ -92,14 +98,14 @@ enum { #define MLX4_RESERVED_QKEY_MASK (0xFFFF0000) enum { - MLX4_BOARD_ID_LEN = 64, - MLX4_VSD_LEN = 208 + MLX4_BOARD_ID_LEN = 64 }; enum { MLX4_MAX_NUM_PF = 16, - MLX4_MAX_NUM_VF = 64, - MLX4_MFUNC_MAX = 80, + MLX4_MAX_NUM_VF = 126, + MLX4_MAX_NUM_VF_P_PORT = 64, + MLX4_MFUNC_MAX = 128, MLX4_MAX_EQ_NUM = 1024, MLX4_MFUNC_EQ_NUM = 4, MLX4_MFUNC_MAX_EQES = 8, @@ -119,6 +125,14 @@ enum { MLX4_STEERING_MODE_DEVICE_MANAGED }; +enum { + MLX4_STEERING_DMFS_A0_DEFAULT, + MLX4_STEERING_DMFS_A0_DYNAMIC, + MLX4_STEERING_DMFS_A0_STATIC, + MLX4_STEERING_DMFS_A0_DISABLE, + MLX4_STEERING_DMFS_A0_NOT_SUPPORTED +}; + static inline const char *mlx4_steering_mode_str(int steering_mode) { switch (steering_mode) { @@ -137,6 +151,11 @@ static inline const char *mlx4_steering_mode_str(int s } enum { + MLX4_TUNNEL_OFFLOAD_MODE_NONE, + MLX4_TUNNEL_OFFLOAD_MODE_VXLAN +}; + +enum { MLX4_DEV_CAP_FLAG_RC = 1LL << 0, MLX4_DEV_CAP_FLAG_UC = 1LL << 1, MLX4_DEV_CAP_FLAG_UD = 1LL << 2, @@ -161,12 +180,10 @@ enum { MLX4_DEV_CAP_FLAG_UDP_RSS = 1LL << 40, MLX4_DEV_CAP_FLAG_VEP_UC_STEER = 1LL << 41, MLX4_DEV_CAP_FLAG_VEP_MC_STEER = 1LL << 42, - MLX4_DEV_CAP_FLAG_CROSS_CHANNEL = 1LL << 44, MLX4_DEV_CAP_FLAG_COUNTERS = 1LL << 48, - MLX4_DEV_CAP_FLAG_COUNTERS_EXT = 1LL << 49, - MLX4_DEV_CAP_FLAG_SET_PORT_ETH_SCHED = 1LL << 53, + MLX4_DEV_CAP_FLAG_RSS_IP_FRAG = 1LL << 52, + MLX4_DEV_CAP_FLAG_SET_ETH_SCHED = 1LL << 53, MLX4_DEV_CAP_FLAG_SENSE_SUPPORT = 1LL << 55, - MLX4_DEV_CAP_FLAG_FAST_DROP = 1LL << 57, MLX4_DEV_CAP_FLAG_PORT_MNG_CHG_EV = 1LL << 59, MLX4_DEV_CAP_FLAG_64B_EQE = 1LL << 61, MLX4_DEV_CAP_FLAG_64B_CQE = 1LL << 62 @@ -177,30 +194,51 @@ enum { MLX4_DEV_CAP_FLAG2_RSS_TOP = 1LL << 1, MLX4_DEV_CAP_FLAG2_RSS_XOR = 1LL << 2, MLX4_DEV_CAP_FLAG2_FS_EN = 1LL << 3, - MLX4_DEV_CAP_FLAG2_FSM = 1LL << 4, - MLX4_DEV_CAP_FLAG2_VLAN_CONTROL = 1LL << 5, - MLX4_DEV_CAP_FLAG2_UPDATE_QP = 1LL << 6, - MLX4_DEV_CAP_FLAG2_LB_SRC_CHK = 1LL << 7, - MLX4_DEV_CAP_FLAG2_DMFS_IPOIB = 1LL << 8, - MLX4_DEV_CAP_FLAG2_ETS_CFG = 1LL << 9, - MLX4_DEV_CAP_FLAG2_ETH_BACKPL_AN_REP = 1LL << 10, - MLX4_DEV_CAP_FLAG2_FLOWSTATS_EN = 1LL << 11, - MLX4_DEV_CAP_FLAG2_RECOVERABLE_ERROR_EVENT = 1LL << 12, - MLX4_DEV_CAP_FLAG2_TS = 1LL << 13, - MLX4_DEV_CAP_FLAG2_DRIVER_VERSION_TO_FW = 1LL << 14, - MLX4_DEV_CAP_FLAG2_REASSIGN_MAC_EN = 1LL << 15, - MLX4_DEV_CAP_FLAG2_VXLAN_OFFLOADS = 1LL << 16, - MLX4_DEV_CAP_FLAG2_FS_EN_NCSI = 1LL << 17, + MLX4_DEV_CAP_FLAG2_REASSIGN_MAC_EN = 1LL << 4, + MLX4_DEV_CAP_FLAG2_TS = 1LL << 5, + MLX4_DEV_CAP_FLAG2_VLAN_CONTROL = 1LL << 6, + MLX4_DEV_CAP_FLAG2_FSM = 1LL << 7, + MLX4_DEV_CAP_FLAG2_UPDATE_QP = 1LL << 8, + MLX4_DEV_CAP_FLAG2_DMFS_IPOIB = 1LL << 9, + MLX4_DEV_CAP_FLAG2_VXLAN_OFFLOADS = 1LL << 10, + MLX4_DEV_CAP_FLAG2_MAD_DEMUX = 1LL << 11, + MLX4_DEV_CAP_FLAG2_CQE_STRIDE = 1LL << 12, + MLX4_DEV_CAP_FLAG2_EQE_STRIDE = 1LL << 13, + MLX4_DEV_CAP_FLAG2_ETH_PROT_CTRL = 1LL << 14, + MLX4_DEV_CAP_FLAG2_ETH_BACKPL_AN_REP = 1LL << 15, + MLX4_DEV_CAP_FLAG2_CONFIG_DEV = 1LL << 16, + MLX4_DEV_CAP_FLAG2_SYS_EQS = 1LL << 17, MLX4_DEV_CAP_FLAG2_80_VFS = 1LL << 18, - MLX4_DEV_CAP_FLAG2_DMFS_TAG_MODE = 1LL << 19, - MLX4_DEV_CAP_FLAG2_ROCEV2 = 1LL << 20, - MLX4_DEV_CAP_FLAG2_ETH_PROT_CTRL = 1LL << 21, - MLX4_DEV_CAP_FLAG2_CQE_STRIDE = 1LL << 22, - MLX4_DEV_CAP_FLAG2_EQE_STRIDE = 1LL << 23, - MLX4_DEV_CAP_FLAG2_UPDATE_QP_SRC_CHECK_LB = 1LL << 24, - MLX4_DEV_CAP_FLAG2_RX_CSUM_MODE = 1LL << 25, + MLX4_DEV_CAP_FLAG2_FS_A0 = 1LL << 19, + MLX4_DEV_CAP_FLAG2_RECOVERABLE_ERROR_EVENT = 1LL << 20, + MLX4_DEV_CAP_FLAG2_PORT_REMAP = 1LL << 21, + MLX4_DEV_CAP_FLAG2_QCN = 1LL << 22, + MLX4_DEV_CAP_FLAG2_QP_RATE_LIMIT = 1LL << 23, + MLX4_DEV_CAP_FLAG2_FLOWSTATS_EN = 1LL << 24, + MLX4_DEV_CAP_FLAG2_QOS_VPP = 1LL << 25, + MLX4_DEV_CAP_FLAG2_ETS_CFG = 1LL << 26, + MLX4_DEV_CAP_FLAG2_PORT_BEACON = 1LL << 27, + MLX4_DEV_CAP_FLAG2_IGNORE_FCS = 1LL << 28, + MLX4_DEV_CAP_FLAG2_PHV_EN = 1LL << 29, + MLX4_DEV_CAP_FLAG2_SKIP_OUTER_VLAN = 1LL << 30, + MLX4_DEV_CAP_FLAG2_UPDATE_QP_SRC_CHECK_LB = 1ULL << 31, + MLX4_DEV_CAP_FLAG2_LB_SRC_CHK = 1ULL << 32, + MLX4_DEV_CAP_FLAG2_ROCE_V1_V2 = 1ULL << 33, + MLX4_DEV_CAP_FLAG2_DMFS_UC_MC_SNIFFER = 1ULL << 34, + MLX4_DEV_CAP_FLAG2_DIAG_PER_PORT = 1ULL << 35, + MLX4_DEV_CAP_FLAG2_SVLAN_BY_QP = 1ULL << 36, + MLX4_DEV_CAP_FLAG2_SL_TO_VL_CHANGE_EVENT = 1ULL << 37, }; +enum { + MLX4_QUERY_FUNC_FLAGS_BF_RES_QP = 1LL << 0, + MLX4_QUERY_FUNC_FLAGS_A0_RES_QP = 1LL << 1 +}; + +enum { + MLX4_VF_CAP_FLAG_RESET = 1 << 0 +}; + /* bit enums for an 8-bit flags field indicating special use * QPs which require special handling in qp_reserve_range. * Currently, this only includes QPs used by the ETH interface, @@ -210,38 +248,47 @@ enum { * This enum may use only bits 0..7. */ enum { - MLX4_RESERVE_BF_QP = 1 << 7, + MLX4_RESERVE_A0_QP = 1 << 6, + MLX4_RESERVE_ETH_BF_QP = 1 << 7, }; enum { - MLX4_DEV_CAP_CQ_FLAG_IO = 1 << 0 -}; - -enum { MLX4_DEV_CAP_64B_EQE_ENABLED = 1LL << 0, - MLX4_DEV_CAP_64B_CQE_ENABLED = 1LL << 1 + MLX4_DEV_CAP_64B_CQE_ENABLED = 1LL << 1, + MLX4_DEV_CAP_CQE_STRIDE_ENABLED = 1LL << 2, + MLX4_DEV_CAP_EQE_STRIDE_ENABLED = 1LL << 3 }; enum { - MLX4_USER_DEV_CAP_64B_CQE = 1L << 0 + MLX4_USER_DEV_CAP_LARGE_CQE = 1L << 0 }; enum { - MLX4_FUNC_CAP_64B_EQE_CQE = 1L << 0 + MLX4_FUNC_CAP_64B_EQE_CQE = 1L << 0, + MLX4_FUNC_CAP_EQE_CQE_STRIDE = 1L << 1, + MLX4_FUNC_CAP_DMFS_A0_STATIC = 1L << 2 }; #define MLX4_ATTR_EXTENDED_PORT_INFO cpu_to_be16(0xff90) enum { - MLX4_BMME_FLAG_WIN_TYPE_2B = 1 << 1, + MLX4_BMME_FLAG_WIN_TYPE_2B = 1 << 1, MLX4_BMME_FLAG_LOCAL_INV = 1 << 6, MLX4_BMME_FLAG_REMOTE_INV = 1 << 7, MLX4_BMME_FLAG_TYPE_2_WIN = 1 << 9, MLX4_BMME_FLAG_RESERVED_LKEY = 1 << 10, MLX4_BMME_FLAG_FAST_REG_WR = 1 << 11, + MLX4_BMME_FLAG_ROCE_V1_V2 = 1 << 19, + MLX4_BMME_FLAG_PORT_REMAP = 1 << 24, + MLX4_BMME_FLAG_VSD_INIT2RTR = 1 << 28, }; +enum { + MLX4_FLAG_PORT_REMAP = MLX4_BMME_FLAG_PORT_REMAP, + MLX4_FLAG_ROCE_V1_V2 = MLX4_BMME_FLAG_ROCE_V1_V2 +}; + enum mlx4_event { MLX4_EVENT_TYPE_COMP = 0x00, MLX4_EVENT_TYPE_PATH_MIG = 0x01, @@ -311,6 +358,7 @@ enum { MLX4_PERM_REMOTE_WRITE = 1 << 13, MLX4_PERM_ATOMIC = 1 << 14, MLX4_PERM_BIND_MW = 1 << 15, + MLX4_PERM_MASK = 0xFC00 }; enum { @@ -355,12 +403,10 @@ enum { MLX4_MTT_FLAG_PRESENT = 1 }; -enum { - MLX4_MAX_MTT_SHIFT = 31 -}; - enum mlx4_qp_region { MLX4_QP_REGION_FW = 0, + MLX4_QP_REGION_RSS_RAW_ETH, + MLX4_QP_REGION_BOTTOM = MLX4_QP_REGION_RSS_RAW_ETH, MLX4_QP_REGION_ETH_ADDR, MLX4_QP_REGION_FC_ADDR, MLX4_QP_REGION_FC_EXCH, @@ -371,8 +417,7 @@ enum mlx4_port_type { MLX4_PORT_TYPE_NONE = 0, MLX4_PORT_TYPE_IB = 1, MLX4_PORT_TYPE_ETH = 2, - MLX4_PORT_TYPE_AUTO = 3, - MLX4_PORT_TYPE_NA = 4 + MLX4_PORT_TYPE_AUTO = 3 }; enum mlx4_special_vlan_idx { @@ -396,9 +441,21 @@ enum { }; enum { + /* + * Max wqe size for rdma read is 512 bytes, so this + * limits our max_sge_rd as the wqe needs to fit: + * - ctrl segment (16 bytes) + * - rdma segment (16 bytes) + * - scatter elements (16 bytes each) + */ + MLX4_MAX_SGE_RD = (512 - 16 - 16) / 16 +}; + +enum { MLX4_DEV_PMC_SUBTYPE_GUID_INFO = 0x14, MLX4_DEV_PMC_SUBTYPE_PORT_INFO = 0x15, MLX4_DEV_PMC_SUBTYPE_PKEY_TABLE = 0x16, + MLX4_DEV_PMC_SUBTYPE_SL_TO_VL_MAP = 0x17, }; /* Port mgmt change event handling */ @@ -410,16 +467,46 @@ enum { MLX4_EQ_PORT_INFO_MSTR_SM_SL_CHANGE_MASK = 1 << 4, }; +union sl2vl_tbl_to_u64 { + u8 sl8[8]; + u64 sl64; +}; + +enum { + MLX4_DEVICE_STATE_UP = 1 << 0, + MLX4_DEVICE_STATE_INTERNAL_ERROR = 1 << 1, +}; + +enum { + MLX4_INTERFACE_STATE_UP = 1 << 0, + MLX4_INTERFACE_STATE_DELETION = 1 << 1, +}; + #define MSTR_SM_CHANGE_MASK (MLX4_EQ_PORT_INFO_MSTR_SM_SL_CHANGE_MASK | \ MLX4_EQ_PORT_INFO_MSTR_SM_LID_CHANGE_MASK) enum mlx4_module_id { - MLX4_MODULE_ID_SFP = 0x3, - MLX4_MODULE_ID_QSFP = 0xC, - MLX4_MODULE_ID_QSFP_PLUS = 0xD, - MLX4_MODULE_ID_QSFP28 = 0x11, + MLX4_MODULE_ID_SFP = 0x3, + MLX4_MODULE_ID_QSFP = 0xC, + MLX4_MODULE_ID_QSFP_PLUS = 0xD, + MLX4_MODULE_ID_QSFP28 = 0x11, }; +enum { /* rl */ + MLX4_QP_RATE_LIMIT_NONE = 0, + MLX4_QP_RATE_LIMIT_KBS = 1, + MLX4_QP_RATE_LIMIT_MBS = 2, + MLX4_QP_RATE_LIMIT_GBS = 3 +}; + +struct mlx4_rate_limit_caps { + u16 num_rates; /* Number of different rates */ + u8 min_unit; + u16 min_val; + u8 max_unit; + u16 max_val; +}; + static inline u64 mlx4_fw_ver(u64 major, u64 minor, u64 subminor) { return (major << 32) | (minor << 16) | subminor; @@ -462,6 +549,8 @@ struct mlx4_caps { int max_rq_desc_sz; int max_qp_init_rdma; int max_qp_dest_rdma; + int max_tc_eth; + u32 *qp0_qkey; u32 *qp0_proxy; u32 *qp1_proxy; u32 *qp0_tunnel; @@ -473,13 +562,13 @@ struct mlx4_caps { int num_cqs; int max_cqes; int reserved_cqs; + int num_sys_eqs; int num_eqs; int reserved_eqs; int num_comp_vectors; - int comp_pool; int num_mpts; int max_fmr_maps; - u64 num_mtts; + int num_mtts; int fmr_reserved_mtts; int reserved_mtts; int reserved_mrws; @@ -489,6 +578,8 @@ struct mlx4_caps { int reserved_mcgs; int num_qp_per_mgm; int steering_mode; + int dmfs_high_steer_mode; + int fs_log_max_ucast_qp_range_size; int num_pds; int reserved_pds; int max_xrcds; @@ -501,7 +592,6 @@ struct mlx4_caps { u32 bmme_flags; u32 reserved_lkey; u16 stat_rate_support; - u8 cq_timestamp; u8 port_width_cap[MLX4_MAX_PORTS + 1]; int max_gso_sz; int max_rss_tbl_sz; @@ -519,18 +609,21 @@ struct mlx4_caps { u32 max_counters; u8 port_ib_mtu[MLX4_MAX_PORTS + 1]; u16 sqp_demux; - u32 sync_qp; - u32 cq_flags; u32 eqe_size; u32 cqe_size; u8 eqe_factor; - u32 userspace_caps; /* userspace must be aware to */ - u32 function_caps; /* functions must be aware to */ - u8 fast_drop; + u32 userspace_caps; /* userspace must be aware of these */ + u32 function_caps; /* VFs must be aware of these */ u16 hca_core_clock; - u32 max_basic_counters; - u32 max_extended_counters; - u8 def_counter_index[MLX4_MAX_PORTS + 1]; + u64 phys_port_id[MLX4_MAX_PORTS + 1]; + int tunnel_offload_mode; + u8 rx_checksum_flags_port[MLX4_MAX_PORTS + 1]; + u8 phv_bit[MLX4_MAX_PORTS + 1]; + u8 alloc_res_qp_mask; + u32 dmfs_high_rate_qpn_base; + u32 dmfs_high_rate_qpn_range; + u32 vf_caps; + struct mlx4_rate_limit_caps rl_caps; }; struct mlx4_buf_list { @@ -627,7 +720,7 @@ struct mlx4_uar { }; struct mlx4_bf { - unsigned long offset; + unsigned int offset; int buf_size; struct mlx4_uar *uar; void __iomem *reg; @@ -641,6 +734,7 @@ struct mlx4_cq { u32 cons_index; + u16 irq; __be32 *set_ci_db; __be32 *arm_db; int arm_sn; @@ -650,8 +744,8 @@ struct mlx4_cq { atomic_t refcount; struct completion free; - int eqn; - u16 irq; + int reset_notify_added; + struct list_head reset_notify; }; struct mlx4_qp { @@ -700,9 +794,9 @@ struct mlx4_eth_av { __be32 sl_tclass_flowlabel; u8 dgid[16]; u8 s_mac[6]; - u8 reserved4[2]; + u8 reserved4[2]; __be16 vlan; - u8 mac[6]; + u8 mac[ETH_ALEN]; }; union mlx4_ext_av { @@ -710,66 +804,17 @@ union mlx4_ext_av { struct mlx4_eth_av eth; }; -struct mlx4_if_stat_control { - u8 reserved1[3]; - /* Extended counters enabled */ - u8 cnt_mode; - /* Number of interfaces */ - __be32 num_of_if; - __be32 reserved[2]; +struct mlx4_counter { + u8 reserved1[3]; + u8 counter_mode; + __be32 num_ifc; + u32 reserved2[2]; + __be64 rx_frames; + __be64 rx_bytes; + __be64 tx_frames; + __be64 tx_bytes; }; -struct mlx4_if_stat_basic { - struct mlx4_if_stat_control control; - struct { - __be64 IfRxFrames; - __be64 IfRxOctets; - __be64 IfTxFrames; - __be64 IfTxOctets; - } counters[]; -}; -#define MLX4_IF_STAT_BSC_SZ(ports)(sizeof(struct mlx4_if_stat_extended) +\ - sizeof(((struct mlx4_if_stat_extended *)0)->\ - counters[0]) * ports) - -struct mlx4_if_stat_extended { - struct mlx4_if_stat_control control; - struct { - __be64 IfRxUnicastFrames; - __be64 IfRxUnicastOctets; - __be64 IfRxMulticastFrames; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Mon Feb 12 13:59:04 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D927BF1CB7D; Mon, 12 Feb 2018 13:59:04 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 879CA7570A; Mon, 12 Feb 2018 13:59:04 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7E6C712C9F; Mon, 12 Feb 2018 13:59:04 +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 w1CDx4bk057407; Mon, 12 Feb 2018 13:59:04 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1CDx4EG057405; Mon, 12 Feb 2018 13:59:04 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201802121359.w1CDx4EG057405@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 12 Feb 2018 13:59:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r329160 - in stable/11/sys/dev/mlx4: mlx4_core mlx4_en X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in stable/11/sys/dev/mlx4: mlx4_core mlx4_en X-SVN-Commit-Revision: 329160 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Feb 2018 13:59:05 -0000 Author: hselasky Date: Mon Feb 12 13:59:04 2018 New Revision: 329160 URL: https://svnweb.freebsd.org/changeset/base/329160 Log: MFC r326666: mlx4: Remove redundant declarations to fix GCC build These were made redundant in r325841. Reviewed by: hselasky Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D13401 Modified: stable/11/sys/dev/mlx4/mlx4_core/icm.h stable/11/sys/dev/mlx4/mlx4_en/en.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/mlx4/mlx4_core/icm.h ============================================================================== --- stable/11/sys/dev/mlx4/mlx4_core/icm.h Mon Feb 12 13:56:57 2018 (r329159) +++ stable/11/sys/dev/mlx4/mlx4_core/icm.h Mon Feb 12 13:59:04 2018 (r329160) @@ -124,7 +124,4 @@ static inline unsigned long mlx4_icm_size(struct mlx4_ return sg_dma_len(&iter->chunk->mem[iter->page_idx]); } -int mlx4_MAP_ICM_AUX(struct mlx4_dev *dev, struct mlx4_icm *icm); -int mlx4_UNMAP_ICM_AUX(struct mlx4_dev *dev); - #endif /* MLX4_ICM_H */ Modified: stable/11/sys/dev/mlx4/mlx4_en/en.h ============================================================================== --- stable/11/sys/dev/mlx4/mlx4_en/en.h Mon Feb 12 13:56:57 2018 (r329159) +++ stable/11/sys/dev/mlx4/mlx4_en/en.h Mon Feb 12 13:59:04 2018 (r329160) @@ -832,7 +832,6 @@ void mlx4_en_destroy_drop_qp(struct mlx4_en_priv *priv int mlx4_en_free_tx_buf(struct net_device *dev, struct mlx4_en_tx_ring *ring); void mlx4_en_rx_irq(struct mlx4_cq *mcq); -int mlx4_SET_MCAST_FLTR(struct mlx4_dev *dev, u8 port, u64 mac, u64 clear, u8 mode); int mlx4_SET_VLAN_FLTR(struct mlx4_dev *dev, struct mlx4_en_priv *priv); int mlx4_en_DUMP_ETH_STATS(struct mlx4_en_dev *mdev, u8 port, u8 reset); From owner-svn-src-all@freebsd.org Mon Feb 12 14:44:23 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 13491F202A3; Mon, 12 Feb 2018 14:44:23 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B8542774BA; Mon, 12 Feb 2018 14:44:22 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 98472134B0; Mon, 12 Feb 2018 14:44:22 +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 w1CEiMNK082218; Mon, 12 Feb 2018 14:44:22 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1CEiLTx082212; Mon, 12 Feb 2018 14:44:21 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201802121444.w1CEiLTx082212@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 12 Feb 2018 14:44:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329161 - in head: . sbin sbin/devmatch usr.sbin usr.sbin/devmatch X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head: . sbin sbin/devmatch usr.sbin usr.sbin/devmatch X-SVN-Commit-Revision: 329161 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Feb 2018 14:44:23 -0000 Author: imp Date: Mon Feb 12 14:44:21 2018 New Revision: 329161 URL: https://svnweb.freebsd.org/changeset/base/329161 Log: Move devmatch to sbin from usr/sbin. Since we want to use devmatch in context before a split /,/usr system has mounted /usr, move devmatch to /sbin. Sponsored by: Netflix Added: head/sbin/devmatch/ head/sbin/devmatch/Makefile (contents, props changed) - copied, changed from r329155, head/usr.sbin/devmatch/Makefile head/sbin/devmatch/devmatch.8 (contents, props changed) - copied, changed from r329155, head/usr.sbin/devmatch/devmatch.8 head/sbin/devmatch/devmatch.c (contents, props changed) - copied, changed from r329155, head/usr.sbin/devmatch/devmatch.c Deleted: head/usr.sbin/devmatch/Makefile head/usr.sbin/devmatch/devmatch.8 head/usr.sbin/devmatch/devmatch.c Modified: head/ObsoleteFiles.inc head/sbin/Makefile head/usr.sbin/Makefile Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Mon Feb 12 13:59:04 2018 (r329160) +++ head/ObsoleteFiles.inc Mon Feb 12 14:44:21 2018 (r329161) @@ -38,6 +38,8 @@ # xargs -n1 | sort | uniq -d; # done +# 20180212: move devmatch +OLD_FILES+=usr/sbin/devmatch # 20180211: remove usb.conf OLD_FILES+=etc/devd/usb.conf # 20180208: remove c_rehash(1) Modified: head/sbin/Makefile ============================================================================== --- head/sbin/Makefile Mon Feb 12 13:59:04 2018 (r329160) +++ head/sbin/Makefile Mon Feb 12 14:44:21 2018 (r329161) @@ -12,6 +12,7 @@ SUBDIR=adjkerntz \ conscontrol \ ddb \ devfs \ + devmatch \ dhclient \ dmesg \ dump \ Copied and modified: head/sbin/devmatch/Makefile (from r329155, head/usr.sbin/devmatch/Makefile) ============================================================================== Copied and modified: head/sbin/devmatch/devmatch.8 (from r329155, head/usr.sbin/devmatch/devmatch.8) ============================================================================== Copied and modified: head/sbin/devmatch/devmatch.c (from r329155, head/usr.sbin/devmatch/devmatch.c) ============================================================================== Modified: head/usr.sbin/Makefile ============================================================================== --- head/usr.sbin/Makefile Mon Feb 12 13:59:04 2018 (r329160) +++ head/usr.sbin/Makefile Mon Feb 12 14:44:21 2018 (r329161) @@ -21,7 +21,6 @@ SUBDIR= adduser \ dconschat \ devctl \ devinfo \ - devmatch \ diskinfo \ dumpcis \ etcupdate \ From owner-svn-src-all@freebsd.org Mon Feb 12 14:45:28 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 647EFF204E7; Mon, 12 Feb 2018 14:45:28 +0000 (UTC) (envelope-from tychon@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F27907771A; Mon, 12 Feb 2018 14:45:27 +0000 (UTC) (envelope-from tychon@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id ED7E2134B4; Mon, 12 Feb 2018 14:45:27 +0000 (UTC) (envelope-from tychon@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1CEjR5K082520; Mon, 12 Feb 2018 14:45:27 GMT (envelope-from tychon@FreeBSD.org) Received: (from tychon@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1CEjR3n082516; Mon, 12 Feb 2018 14:45:27 GMT (envelope-from tychon@FreeBSD.org) Message-Id: <201802121445.w1CEjR3n082516@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tychon set sender to tychon@FreeBSD.org using -f From: Tycho Nightingale Date: Mon, 12 Feb 2018 14:45:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329162 - in head/sys/amd64/vmm: amd intel X-SVN-Group: head X-SVN-Commit-Author: tychon X-SVN-Commit-Paths: in head/sys/amd64/vmm: amd intel X-SVN-Commit-Revision: 329162 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Feb 2018 14:45:29 -0000 Author: tychon Date: Mon Feb 12 14:45:27 2018 New Revision: 329162 URL: https://svnweb.freebsd.org/changeset/base/329162 Log: Provide further mitigation against CVE-2017-5715 by flushing the return stack buffer (RSB) upon returning from the guest. This was inspired by this linux commit: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/arch/x86/kvm?id=117cc7a908c83697b0b737d15ae1eb5943afe35b Reviewed by: grehan Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D14272 Modified: head/sys/amd64/vmm/amd/svm_support.S head/sys/amd64/vmm/intel/vmcs.c head/sys/amd64/vmm/intel/vmx.h head/sys/amd64/vmm/intel/vmx_support.S Modified: head/sys/amd64/vmm/amd/svm_support.S ============================================================================== --- head/sys/amd64/vmm/amd/svm_support.S Mon Feb 12 14:44:21 2018 (r329161) +++ head/sys/amd64/vmm/amd/svm_support.S Mon Feb 12 14:45:27 2018 (r329162) @@ -113,6 +113,23 @@ ENTRY(svm_launch) movq %rdi, SCTX_RDI(%rax) movq %rsi, SCTX_RSI(%rax) + /* + * To prevent malicious branch target predictions from + * affecting the host, overwrite all entries in the RSB upon + * exiting a guest. + */ + mov $16, %ecx /* 16 iterations, two calls per loop */ + mov %rsp, %rax +0: call 2f /* create an RSB entry. */ +1: pause + call 1b /* capture rogue speculation. */ +2: call 2f /* create an RSB entry. */ +1: pause + call 1b /* capture rogue speculation. */ +2: sub $1, %ecx + jnz 0b + mov %rax, %rsp + /* Restore host state */ pop %r15 pop %r14 Modified: head/sys/amd64/vmm/intel/vmcs.c ============================================================================== --- head/sys/amd64/vmm/intel/vmcs.c Mon Feb 12 14:44:21 2018 (r329161) +++ head/sys/amd64/vmm/intel/vmcs.c Mon Feb 12 14:45:27 2018 (r329162) @@ -34,6 +34,7 @@ __FBSDID("$FreeBSD$"); #include +#include #include #include @@ -52,6 +53,12 @@ __FBSDID("$FreeBSD$"); #include #endif +SYSCTL_DECL(_hw_vmm_vmx); + +static int no_flush_rsb; +SYSCTL_INT(_hw_vmm_vmx, OID_AUTO, no_flush_rsb, CTLFLAG_RW, + &no_flush_rsb, 0, "Do not flush RSB upon vmexit"); + static uint64_t vmcs_fix_regval(uint32_t encoding, uint64_t val) { @@ -403,8 +410,15 @@ vmcs_init(struct vmcs *vmcs) goto done; /* instruction pointer */ - if ((error = vmwrite(VMCS_HOST_RIP, (u_long)vmx_exit_guest)) != 0) - goto done; + if (no_flush_rsb) { + if ((error = vmwrite(VMCS_HOST_RIP, + (u_long)vmx_exit_guest)) != 0) + goto done; + } else { + if ((error = vmwrite(VMCS_HOST_RIP, + (u_long)vmx_exit_guest_flush_rsb)) != 0) + goto done; + } /* link pointer */ if ((error = vmwrite(VMCS_LINK_POINTER, ~0)) != 0) Modified: head/sys/amd64/vmm/intel/vmx.h ============================================================================== --- head/sys/amd64/vmm/intel/vmx.h Mon Feb 12 14:44:21 2018 (r329161) +++ head/sys/amd64/vmm/intel/vmx.h Mon Feb 12 14:45:27 2018 (r329162) @@ -150,5 +150,6 @@ u_long vmx_fix_cr4(u_long cr4); int vmx_set_tsc_offset(struct vmx *vmx, int vcpu, uint64_t offset); extern char vmx_exit_guest[]; +extern char vmx_exit_guest_flush_rsb[]; #endif Modified: head/sys/amd64/vmm/intel/vmx_support.S ============================================================================== --- head/sys/amd64/vmm/intel/vmx_support.S Mon Feb 12 14:44:21 2018 (r329161) +++ head/sys/amd64/vmm/intel/vmx_support.S Mon Feb 12 14:45:27 2018 (r329162) @@ -42,6 +42,29 @@ #define VLEAVE pop %rbp /* + * Save the guest context. + */ +#define VMX_GUEST_SAVE \ + movq %rdi,VMXCTX_GUEST_RDI(%rsp); \ + movq %rsi,VMXCTX_GUEST_RSI(%rsp); \ + movq %rdx,VMXCTX_GUEST_RDX(%rsp); \ + movq %rcx,VMXCTX_GUEST_RCX(%rsp); \ + movq %r8,VMXCTX_GUEST_R8(%rsp); \ + movq %r9,VMXCTX_GUEST_R9(%rsp); \ + movq %rax,VMXCTX_GUEST_RAX(%rsp); \ + movq %rbx,VMXCTX_GUEST_RBX(%rsp); \ + movq %rbp,VMXCTX_GUEST_RBP(%rsp); \ + movq %r10,VMXCTX_GUEST_R10(%rsp); \ + movq %r11,VMXCTX_GUEST_R11(%rsp); \ + movq %r12,VMXCTX_GUEST_R12(%rsp); \ + movq %r13,VMXCTX_GUEST_R13(%rsp); \ + movq %r14,VMXCTX_GUEST_R14(%rsp); \ + movq %r15,VMXCTX_GUEST_R15(%rsp); \ + movq %cr2,%rdi; \ + movq %rdi,VMXCTX_GUEST_CR2(%rsp); \ + movq %rsp,%rdi; + +/* * Assumes that %rdi holds a pointer to the 'vmxctx'. * * On "return" all registers are updated to reflect guest state. The two @@ -211,31 +234,55 @@ inst_error: * The VMCS-restored %rsp points to the struct vmxctx */ ALIGN_TEXT - .globl vmx_exit_guest -vmx_exit_guest: + .globl vmx_exit_guest_flush_rsb +vmx_exit_guest_flush_rsb: /* * Save guest state that is not automatically saved in the vmcs. */ - movq %rdi,VMXCTX_GUEST_RDI(%rsp) - movq %rsi,VMXCTX_GUEST_RSI(%rsp) - movq %rdx,VMXCTX_GUEST_RDX(%rsp) - movq %rcx,VMXCTX_GUEST_RCX(%rsp) - movq %r8,VMXCTX_GUEST_R8(%rsp) - movq %r9,VMXCTX_GUEST_R9(%rsp) - movq %rax,VMXCTX_GUEST_RAX(%rsp) - movq %rbx,VMXCTX_GUEST_RBX(%rsp) - movq %rbp,VMXCTX_GUEST_RBP(%rsp) - movq %r10,VMXCTX_GUEST_R10(%rsp) - movq %r11,VMXCTX_GUEST_R11(%rsp) - movq %r12,VMXCTX_GUEST_R12(%rsp) - movq %r13,VMXCTX_GUEST_R13(%rsp) - movq %r14,VMXCTX_GUEST_R14(%rsp) - movq %r15,VMXCTX_GUEST_R15(%rsp) + VMX_GUEST_SAVE - movq %cr2,%rdi - movq %rdi,VMXCTX_GUEST_CR2(%rsp) + /* + * Deactivate guest pmap from this cpu. + */ + movq VMXCTX_PMAP(%rdi), %r11 + movl PCPU(CPUID), %r10d + LK btrl %r10d, PM_ACTIVE(%r11) - movq %rsp,%rdi + VMX_HOST_RESTORE + + VMX_GUEST_CLOBBER + + /* + * To prevent malicious branch target predictions from + * affecting the host, overwrite all entries in the RSB upon + * exiting a guest. + */ + mov $16, %ecx /* 16 iterations, two calls per loop */ + mov %rsp, %rax +0: call 2f /* create an RSB entry. */ +1: pause + call 1b /* capture rogue speculation. */ +2: call 2f /* create an RSB entry. */ +1: pause + call 1b /* capture rogue speculation. */ +2: sub $1, %ecx + jnz 0b + mov %rax, %rsp + + /* + * This will return to the caller of 'vmx_enter_guest()' with a return + * value of VMX_GUEST_VMEXIT. + */ + movl $VMX_GUEST_VMEXIT, %eax + VLEAVE + ret + + .globl vmx_exit_guest +vmx_exit_guest: + /* + * Save guest state that is not automatically saved in the vmcs. + */ + VMX_GUEST_SAVE /* * Deactivate guest pmap from this cpu. From owner-svn-src-all@freebsd.org Mon Feb 12 14:47:14 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A8BB5F206D3; Mon, 12 Feb 2018 14:47:14 +0000 (UTC) (envelope-from byond.lenox@gmail.com) Received: from mail-lf0-f50.google.com (mail-lf0-f50.google.com [209.85.215.50]) (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 079B777909; Mon, 12 Feb 2018 14:47:13 +0000 (UTC) (envelope-from byond.lenox@gmail.com) Received: by mail-lf0-f50.google.com with SMTP id c188so4864702lfc.11; Mon, 12 Feb 2018 06:47:13 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=ucVJSM6UGyd9QQ4tiq2aYv33Vt0pf/utJtsQzKXFWfU=; b=s+4KP3n/tQzBHgVBRwJsYnOeuKfa+8GTZ03JoUXHhrCWy/a1iuicyozllxRT19BDW7 /5WOwmZv5ux8nmhf1Qf/yoApeg5caBC29kCD478SimKrkTAl32aXggXTA4/oxKV2ErGU VGucrHl+82Zzv09HhAgD97lzGup2+MOuw/zixiIlYozp/pH7EpH037t+960JJEVD5cdV DIligSGdJvjZfsWYzQNB42j/nvVM9H0m2C6mAVUidUPEMeMXbVRbnUGsMA3LgBesWmDT zUToQqP4yjiX4qOHxB10YMaG1nYWYIi3Erg8pi7EASvdqyoylohFqQJGhWWr17kSqkQc A+qw== X-Gm-Message-State: APf1xPBLdKBwVJC7FkoGKXaRB2htHh6yhHtSL0bVWCqVG/7ue2HioKpz f20bGQ7XxMs5w78XlSXgojzOE20B X-Google-Smtp-Source: AH8x22642EBYBvRDQoO2VUJoHgxgmMMdpkafvqFrn9RY9XomLkfkCx2eoSopdT4nuLKfgAscOdyLZw== X-Received: by 10.46.101.208 with SMTP id e77mr5074715ljf.66.1518446825562; Mon, 12 Feb 2018 06:47:05 -0800 (PST) Received: from mail-lf0-f51.google.com (mail-lf0-f51.google.com. [209.85.215.51]) by smtp.gmail.com with ESMTPSA id p189sm1724557lfe.64.2018.02.12.06.47.04 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 12 Feb 2018 06:47:05 -0800 (PST) Received: by mail-lf0-f51.google.com with SMTP id t79so20779399lfe.3; Mon, 12 Feb 2018 06:47:04 -0800 (PST) X-Received: by 10.25.157.141 with SMTP id g135mr7124091lfe.142.1518446824160; Mon, 12 Feb 2018 06:47:04 -0800 (PST) MIME-Version: 1.0 Received: by 10.46.106.8 with HTTP; Mon, 12 Feb 2018 06:46:43 -0800 (PST) In-Reply-To: <201712211221.vBLCLZ5p017820@repo.freebsd.org> References: <201712211221.vBLCLZ5p017820@repo.freebsd.org> From: Kyle Evans Date: Mon, 12 Feb 2018 08:46:43 -0600 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r327058 - head/stand/efi/boot1 To: Michael Zhilin Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org, tsoome@freebsd.org, Allan Jude Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Feb 2018 14:47:14 -0000 On Thu, Dec 21, 2017 at 6:21 AM, Michael Zhilin wrote: > Author: mizhka > Date: Thu Dec 21 12:21:35 2017 > New Revision: 327058 > URL: https://svnweb.freebsd.org/changeset/base/327058 > > Log: > [boot/efi] scan all display modes rather than sequential try-fail way > > This patch allows to scan all display modes in boot1 as loader does. > > Before system tried to select optimal display mode by sequential scan of > modes and if error then stop scanning. This way is not good, because > if mode N is not present, mode N+1 may exist. > > In loader we use conout->Mode->MaxMode to identify maximum number of modes. > This commit is to use same way in boot1 as in loader. > > Reported by: Andrey Pustovetov > Reviewed by: tsoome > Differential Revision: https://reviews.freebsd.org/D13541 > HI, Just FYI- we've had several reports of this doing the wrong thing for many people, most recently by Allan yesterday (IIRC). I'm going to avoid MFC'ing it, I think we should either back this out or figure out where it's going wrong sooner rather than later. =( Thanks, Kyle Evans From owner-svn-src-all@freebsd.org Mon Feb 12 14:48:06 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 55629F20829; Mon, 12 Feb 2018 14:48:06 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F149C77B01; Mon, 12 Feb 2018 14:48:05 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E7D56134BF; Mon, 12 Feb 2018 14:48:05 +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 w1CEm55M082646; Mon, 12 Feb 2018 14:48:05 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1CEm50c082642; Mon, 12 Feb 2018 14:48:05 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201802121448.w1CEm50c082642@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 12 Feb 2018 14:48:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329163 - in head/sys: mips/include powerpc/include riscv/include sparc64/include X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head/sys: mips/include powerpc/include riscv/include sparc64/include X-SVN-Commit-Revision: 329163 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Feb 2018 14:48:06 -0000 Author: imp Date: Mon Feb 12 14:48:05 2018 New Revision: 329163 URL: https://svnweb.freebsd.org/changeset/base/329163 Log: Use standard pattern for stdargs.h We don't support older compilers. Most of the code in these files is for pre-3.0 gcc, which is at least 15 years obsolete. Move to using phk's sys/_stdargs.h for all these platforms. Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D14323 Modified: head/sys/mips/include/stdarg.h head/sys/powerpc/include/stdarg.h head/sys/riscv/include/stdarg.h head/sys/sparc64/include/stdarg.h Modified: head/sys/mips/include/stdarg.h ============================================================================== --- head/sys/mips/include/stdarg.h Mon Feb 12 14:45:27 2018 (r329162) +++ head/sys/mips/include/stdarg.h Mon Feb 12 14:48:05 2018 (r329163) @@ -1,144 +1,39 @@ -/* - * JNPR: stdarg.h,v 1.3 2006/09/15 12:52:34 katta +/*- + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2017 Poul-Henning Kamp. 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 _MACHINE_STDARG_H_ #define _MACHINE_STDARG_H_ -#include -#include +#include -#if __GNUC__ >= 3 - -#ifndef _VA_LIST_DECLARED -#define _VA_LIST_DECLARED -typedef __va_list va_list; +#ifndef va_start + #error this file needs to be ported to your compiler #endif -#define va_start(v,l) __builtin_va_start((v),l) -#define va_end __builtin_va_end -#define va_arg __builtin_va_arg -#define va_copy __builtin_va_copy -#else /* __GNUC__ */ - - -/* ---------------------------------------- */ -/* VARARGS for MIPS/GNU CC */ -/* ---------------------------------------- */ - -#include - -/* These macros implement varargs for GNU C--either traditional or ANSI. */ - -/* Define __gnuc_va_list. */ - -#ifndef __GNUC_VA_LIST -#define __GNUC_VA_LIST - -typedef char * __gnuc_va_list; -typedef __gnuc_va_list va_list; - -#endif /* ! __GNUC_VA_LIST */ - -/* If this is for internal libc use, don't define anything but - __gnuc_va_list. */ - -#ifndef _VA_MIPS_H_ENUM -#define _VA_MIPS_H_ENUM -enum { - __no_type_class = -1, - __void_type_class, - __integer_type_class, - __char_type_class, - __enumeral_type_class, - __boolean_type_class, - __pointer_type_class, - __reference_type_class, - __offset_type_class, - __real_type_class, - __complex_type_class, - __function_type_class, - __method_type_class, - __record_type_class, - __union_type_class, - __array_type_class, - __string_type_class, - __set_type_class, - __file_type_class, - __lang_type_class -}; -#endif - -/* In GCC version 2, we want an ellipsis at the end of the declaration - of the argument list. GCC version 1 can't parse it. */ - -#if __GNUC__ > 1 -#define __va_ellipsis ... -#else -#define __va_ellipsis -#endif - - -#define va_start(__AP, __LASTARG) \ - (__AP = (__gnuc_va_list) __builtin_next_arg (__LASTARG)) - -#define va_end(__AP) ((void)0) - - -/* We cast to void * and then to TYPE * because this avoids - a warning about increasing the alignment requirement. */ -/* The __mips64 cases are reversed from the 32 bit cases, because the standard - 32 bit calling convention left-aligns all parameters smaller than a word, - whereas the __mips64 calling convention does not (and hence they are - right aligned). */ - -#ifdef __mips64 - -#define __va_rounded_size(__TYPE) (((sizeof (__TYPE) + 8 - 1) / 8) * 8) - -#define __va_reg_size 8 - -#if defined(__MIPSEB__) || (BYTE_ORDER == BIG_ENDIAN) -#define va_arg(__AP, __type) \ - ((__type *) (void *) (__AP = (char *) \ - ((((__PTRDIFF_TYPE__)__AP + 8 - 1) & -8) \ - + __va_rounded_size (__type))))[-1] -#else /* ! __MIPSEB__ && !BYTE_ORDER == BIG_ENDIAN */ -#define va_arg(__AP, __type) \ - ((__AP = (char *) ((((__PTRDIFF_TYPE__)__AP + 8 - 1) & -8) \ - + __va_rounded_size (__type))), \ - *(__type *) (void *) (__AP - __va_rounded_size (__type))) -#endif /* ! __MIPSEB__ && !BYTE_ORDER == BIG_ENDIAN */ - -#else /* ! __mips64 */ - -#define __va_rounded_size(__TYPE) \ - (((sizeof (__TYPE) + sizeof (int) - 1) / sizeof (int)) * sizeof (int)) - -#define __va_reg_size 4 - -#if defined(__MIPSEB__) || (BYTE_ORDER == BIG_ENDIAN) -/* For big-endian machines. */ -#define va_arg(__AP, __type) \ - ((__AP = (char *) ((__alignof__ (__type) > 4 \ - ? ((__PTRDIFF_TYPE__)__AP + 8 - 1) & -8 \ - : ((__PTRDIFF_TYPE__)__AP + 4 - 1) & -4) \ - + __va_rounded_size (__type))), \ - *(__type *) (void *) (__AP - __va_rounded_size (__type))) -#else /* ! __MIPSEB__ && !BYTE_ORDER == BIG_ENDIAN */ -/* For little-endian machines. */ -#define va_arg(__AP, __type) \ - ((__type *) (void *) (__AP = (char *) ((__alignof__(__type) > 4 \ - ? ((__PTRDIFF_TYPE__)__AP + 8 - 1) & -8 \ - : ((__PTRDIFF_TYPE__)__AP + 4 - 1) & -4) \ - + __va_rounded_size(__type))))[-1] -#endif /* ! __MIPSEB__ && !BYTE_ORDER == BIG_ENDIAN */ -#endif /* ! __mips64 */ - -/* Copy __gnuc_va_list into another variable of this type. */ -#define __va_copy(dest, src) (dest) = (src) -#define va_copy(dest, src) (dest) = (src) - -#endif /* __GNUC__ */ -#endif /* _MACHINE_STDARG_H_ */ +#endif /* !_MACHINE_STDARG_H_ */ Modified: head/sys/powerpc/include/stdarg.h ============================================================================== --- head/sys/powerpc/include/stdarg.h Mon Feb 12 14:45:27 2018 (r329162) +++ head/sys/powerpc/include/stdarg.h Mon Feb 12 14:48:05 2018 (r329163) @@ -1,8 +1,7 @@ /*- - * SPDX-License-Identifier: BSD-3-Clause + * SPDX-License-Identifier: BSD-2-Clause * - * Copyright (c) 2002 David E. O'Brien. All rights reserved. - * Copyright (c) 2000 Tsubai Masanari. All rights reserved. + * Copyright (c) 2017 Poul-Henning Kamp. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -12,141 +11,29 @@ * 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. 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. + * 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: stdarg.h,v 1.5 2000/02/27 17:50:21 tsubai Exp $ * $FreeBSD$ */ #ifndef _MACHINE_STDARG_H_ #define _MACHINE_STDARG_H_ -#include -#include +#include -#ifndef _VA_LIST_DECLARED -#define _VA_LIST_DECLARED -typedef __va_list va_list; +#ifndef va_start + #error this file needs to be ported to your compiler #endif -#if defined(__GNUCLIKE_BUILTIN_STDARG) - -#define va_start(ap, last) \ - __builtin_va_start((ap), (last)) - -#define va_arg(ap, type) \ - __builtin_va_arg((ap), type) - -#if __ISO_C_VISIBLE >= 1999 -#define va_copy(dest, src) \ - __builtin_va_copy((dest), (src)) - -#define __va_copy(dest, src) \ - va_copy((dest), (src)) -#endif - -#define va_end(ap) \ - __builtin_va_end(ap) - -#else /* !__GNUCLIKE_BUILTIN_STDARG */ - -#ifdef __lint__ - -#define va_start(ap, last) ((ap) = *(va_list *)0) -#define va_arg(ap, type) (*(type *)(void *)&(ap)) - -#else - -#if defined(__GNUC_VA_LIST_COMPATIBILITY) -#define va_start(ap, last) \ - (__builtin_next_arg(last), \ - __builtin_memcpy((void *)&(ap), __builtin_saveregs (), \ - sizeof(__gnuc_va_list))) -#else -#define va_start(ap, last) \ - (__builtin_next_arg(last), \ - (ap).__stack = __va_stack_args, \ - (ap).__base = __va_reg_args, \ - (ap).__gpr = __va_first_gpr, \ - (ap).__fpr = __va_first_fpr) -#endif - -#define __va_first_gpr (__builtin_args_info(0)) -#define __va_first_fpr (__builtin_args_info(1) - 32 - 1) -#define __va_stack_args \ - ((char *)__builtin_saveregs() + \ - (__va_first_gpr >= 8 ? __va_first_gpr - 8 : 0) * sizeof(int)) -#define __va_reg_args \ - ((char *)__builtin_frame_address(0) + __builtin_args_info(4)) - -#define __INTEGER_TYPE_CLASS 1 -#define __REAL_TYPE_CLASS 8 -#define __RECORD_TYPE_CLASS 12 - -#define __va_longlong(type) \ - (__builtin_classify_type(*(type *)0) == __INTEGER_TYPE_CLASS && \ - sizeof(type) == 8) - -#define __va_double(type) \ - (__builtin_classify_type(*(type *)0) == __REAL_TYPE_CLASS) - -#define __va_struct(type) \ - (__builtin_classify_type(*(type *)0) >= __RECORD_TYPE_CLASS) - -#define __va_size(type) \ - ((sizeof(type) + sizeof(int) - 1) / sizeof(int) * sizeof(int)) - -#define __va_savedgpr(ap, type) \ - ((ap).__base + (ap).__gpr * sizeof(int) - sizeof(type)) - -#define __va_savedfpr(ap, type) \ - ((ap).__base + 8 * sizeof(int) + (ap).__fpr * sizeof(double) - \ - sizeof(type)) - -#define __va_stack(ap, type) \ - ((ap).__stack += __va_size(type) + \ - (__va_longlong(type) ? (int)(ap).__stack & 4 : 0), \ - (ap).__stack - sizeof(type)) - -#define __va_gpr(ap, type) \ - ((ap).__gpr += __va_size(type) / sizeof(int) + \ - (__va_longlong(type) ? (ap).__gpr & 1 : 0), \ - (ap).__gpr <= 8 ? __va_savedgpr(ap, type) : __va_stack(ap, type)) - -#define __va_fpr(ap, type) \ - ((ap).__fpr++, \ - (ap).__fpr <= 8 ? __va_savedfpr(ap, type) : __va_stack(ap, type)) - -#define va_arg(ap, type) \ - (*(type *)(__va_struct(type) ? (*(void **)__va_gpr(ap, void *)) : \ - __va_double(type) ? __va_fpr(ap, type) : \ - __va_gpr(ap, type))) - -#endif /* __lint__ */ - -#define va_end(ap) - -#if __ISO_C_VISIBLE >= 1999 -#if !defined(_ANSI_SOURCE) && \ - (!defined(_POSIX_C_SOURCE) && !defined(_XOPEN_SOURCE) || \ - defined(_ISOC99_SOURCE) || (__STDC_VERSION__ - 0) >= 199901L) -#define va_copy(dest, src) \ - ((dest) = (src)) -#endif -#endif - -#endif /* __GNUCLIKE_BUILTIN_STDARG */ - -#endif /* _MACHINE_STDARG_H_ */ +#endif /* !_MACHINE_STDARG_H_ */ Modified: head/sys/riscv/include/stdarg.h ============================================================================== --- head/sys/riscv/include/stdarg.h Mon Feb 12 14:45:27 2018 (r329162) +++ head/sys/riscv/include/stdarg.h Mon Feb 12 14:48:05 2018 (r329163) @@ -1,8 +1,8 @@ /*- - * Copyright (c) 2002 David E. O'Brien. All rights reserved. - * Copyright (c) 1991, 1993 - * The Regents of the University of California. All rights reserved. + * SPDX-License-Identifier: BSD-2-Clause * + * Copyright (c) 2017 Poul-Henning Kamp. All rights reserved. + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -11,14 +11,11 @@ * 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 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 + * 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 + * 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) @@ -27,53 +24,16 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * @(#)stdarg.h 8.1 (Berkeley) 6/10/93 * $FreeBSD$ */ #ifndef _MACHINE_STDARG_H_ #define _MACHINE_STDARG_H_ -#include -#include +#include -#ifndef _VA_LIST_DECLARED -#define _VA_LIST_DECLARED -typedef __va_list va_list; +#ifndef va_start + #error this file needs to be ported to your compiler #endif - -#ifdef __GNUCLIKE_BUILTIN_STDARG - -#define va_start(ap, last) \ - __builtin_va_start((ap), (last)) - -#define va_arg(ap, type) \ - __builtin_va_arg((ap), type) - -#if __ISO_C_VISIBLE >= 1999 -#define va_copy(dest, src) \ - __builtin_va_copy((dest), (src)) -#endif - -#define va_end(ap) \ - __builtin_va_end(ap) - -#elif defined(lint) -/* Provide a fake implementation for lint's benefit */ -#define __va_size(type) \ - (((sizeof(type) + sizeof(long) - 1) / sizeof(long)) * sizeof(long)) -#define va_start(ap, last) \ - ((ap) = (va_list)&(last) + __va_size(last)) -#define va_copy(dst, src) \ - ((dst) = (src)) -#define va_arg(ap, type) \ - (*(type *)((ap) += __va_size(type), (ap) - __va_size(type))) -#define va_end(ap) - -#else /* !__GNUCLIKE_BUILTIN_STDARG */ - -#error no support for your compiler - -#endif /* __GNUCLIKE_BUILTIN_STDARG */ #endif /* !_MACHINE_STDARG_H_ */ Modified: head/sys/sparc64/include/stdarg.h ============================================================================== --- head/sys/sparc64/include/stdarg.h Mon Feb 12 14:45:27 2018 (r329162) +++ head/sys/sparc64/include/stdarg.h Mon Feb 12 14:48:05 2018 (r329163) @@ -1,19 +1,8 @@ /*- - * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * SPDX-License-Identifier: BSD-2-Clause * - * Copyright (c) 2002 David E. O'Brien. All rights reserved. - * Copyright (c) 1992, 1993 - * The Regents of the University of California. All rights reserved. + * Copyright (c) 2017 Poul-Henning Kamp. All rights reserved. * - * This software was developed by the Computer Systems Engineering group - * at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and - * contributed to Berkeley. - * - * All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Lawrence Berkeley Laboratory. - * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -23,10 +12,10 @@ * 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 REGENTS AND CONTRIBUTORS ``AS IS'' AND + * 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 + * 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) @@ -35,69 +24,16 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * @(#)stdarg.h 8.2 (Berkeley) 9/27/93 - * $NetBSD: stdarg.h,v 1.11 2000/07/23 21:36:56 mycroft Exp $ * $FreeBSD$ */ #ifndef _MACHINE_STDARG_H_ #define _MACHINE_STDARG_H_ -#include -#include +#include -#ifndef _VA_LIST_DECLARED -#define _VA_LIST_DECLARED -typedef __va_list va_list; +#ifndef va_start + #error this file needs to be ported to your compiler #endif - -#ifdef __GNUCLIKE_BUILTIN_STDARG - -#define va_start(ap, last) \ - __builtin_va_start((ap), (last)) - -#define va_arg(ap, type) \ - __builtin_va_arg((ap), type) - -#if __ISO_C_VISIBLE >= 1999 -#define va_copy(dest, src) \ - __builtin_va_copy((dest), (src)) -#endif - -#define va_end(ap) \ - __builtin_va_end(ap) - -#else /* ! __GNUCLIKE_BUILTIN_STDARG */ - -#if !defined(__GNUCLIKE_BUILTIN_NEXT_ARG) && !defined(lint) -#error no support for your compiler -#endif - -#define va_start(ap, last) \ - (__builtin_next_arg(last), (ap) = (va_list)__builtin_saveregs()) - -#define va_end(ap) - -#define __va_arg8(ap, type) \ - (*(type *)(void *)((ap) += 8, (ap) - 8)) -#define __va_arg16(ap, type) \ - (*(type *)(void *)((ap) = (va_list)(((unsigned long)(ap) + 31) & -16),\ - (ap) - 16)) -#define __va_int(ap, type) \ - (*(type *)(void *)((ap) += 8, (ap) - sizeof(type))) - -#define __REAL_TYPE_CLASS 8 -#define __RECORD_TYPE_CLASS 12 -#define va_arg(ap, type) \ - (__builtin_classify_type(*(type *)0) == __REAL_TYPE_CLASS ? \ - (__alignof__(type) == 16 ? __va_arg16(ap, type) : \ - __va_arg8(ap, type)) : \ - (__builtin_classify_type(*(type *)0) < __RECORD_TYPE_CLASS ? \ - __va_int(ap, type) : \ - (sizeof(type) <= 8 ? __va_arg8(ap, type) : \ - (sizeof(type) <= 16 ? __va_arg16(ap, type) : \ - *__va_arg8(ap, type *))))) - -#endif /* __GNUCLIKE_BUILTIN_STDARG */ #endif /* !_MACHINE_STDARG_H_ */ From owner-svn-src-all@freebsd.org Mon Feb 12 14:48:15 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4C5B5F2088A; Mon, 12 Feb 2018 14:48:15 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E6AC877BE5; Mon, 12 Feb 2018 14:48:14 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E1169134C0; Mon, 12 Feb 2018 14:48: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 w1CEmErM082702; Mon, 12 Feb 2018 14:48:14 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1CEmEUX082701; Mon, 12 Feb 2018 14:48:14 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201802121448.w1CEmEUX082701@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 12 Feb 2018 14:48:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329164 - in head: include sys/amd64/include sys/i386/include sys/mips/include sys/powerpc/include sys/sparc64/include X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head: include sys/amd64/include sys/i386/include sys/mips/include sys/powerpc/include sys/sparc64/include X-SVN-Commit-Revision: 329164 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Feb 2018 14:48:15 -0000 Author: imp Date: Mon Feb 12 14:48:14 2018 New Revision: 329164 URL: https://svnweb.freebsd.org/changeset/base/329164 Log: We don't support gcc < 4.2.1, so varargs.h now is just #error always. Unifdef for versions prior to 4.2.1 and remove now-unused header files. Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D14323 Deleted: head/sys/amd64/include/varargs.h head/sys/i386/include/varargs.h head/sys/mips/include/varargs.h head/sys/powerpc/include/varargs.h head/sys/sparc64/include/varargs.h Modified: head/include/varargs.h Modified: head/include/varargs.h ============================================================================== --- head/include/varargs.h Mon Feb 12 14:48:05 2018 (r329163) +++ head/include/varargs.h Mon Feb 12 14:48:14 2018 (r329164) @@ -31,15 +31,7 @@ #ifndef _VARARGS_H_ #define _VARARGS_H_ -#if defined(__GNUC__) && (__GNUC__ == 3 && __GNUC_MINOR__ > 2 || __GNUC__ >= 4) - -#error " is obsolete with this version of GCC." +#error " is obsolete." #error "Change your code to use instead." - -#else /* ! __GNUC__ post GCC 3.3 */ - -#include - -#endif /* __GNUC__ post GCC 3.3 */ #endif /* !_VARARGS_H_ */ From owner-svn-src-all@freebsd.org Mon Feb 12 14:48:22 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 15412F208D6; Mon, 12 Feb 2018 14:48:22 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 97D6777C06; Mon, 12 Feb 2018 14:48:21 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 90898134C1; Mon, 12 Feb 2018 14:48:21 +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 w1CEmLPD082765; Mon, 12 Feb 2018 14:48:21 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1CEmKuj082757; Mon, 12 Feb 2018 14:48:20 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201802121448.w1CEmKuj082757@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 12 Feb 2018 14:48:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329165 - in head/sys: arm/include arm64/include mips/include powerpc/include riscv/include sparc64/include sys x86/include X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head/sys: arm/include arm64/include mips/include powerpc/include riscv/include sparc64/include sys x86/include X-SVN-Commit-Revision: 329165 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Feb 2018 14:48:22 -0000 Author: imp Date: Mon Feb 12 14:48:20 2018 New Revision: 329165 URL: https://svnweb.freebsd.org/changeset/base/329165 Log: Move __va_list and related defines to sys/sys/_types.h __va_list and related defines are identical in all the ARCH/include/_types.h files. Move them to sys/sys/_types.h Sponsored by: Netflix Modified: head/sys/arm/include/_types.h head/sys/arm64/include/_types.h head/sys/mips/include/_types.h head/sys/powerpc/include/_types.h head/sys/riscv/include/_types.h head/sys/sparc64/include/_types.h head/sys/sys/_types.h head/sys/x86/include/_types.h Modified: head/sys/arm/include/_types.h ============================================================================== --- head/sys/arm/include/_types.h Mon Feb 12 14:48:14 2018 (r329164) +++ head/sys/arm/include/_types.h Mon Feb 12 14:48:20 2018 (r329165) @@ -109,18 +109,4 @@ typedef unsigned int ___wchar_t; #define __WCHAR_MIN 0 /* min value for a wchar_t */ #define __WCHAR_MAX __UINT_MAX /* max value for a wchar_t */ -/* - * Unusual type definitions. - */ -#ifdef __GNUCLIKE_BUILTIN_VARARGS -typedef __builtin_va_list __va_list; /* internally known to gcc */ -#else -typedef char * __va_list; -#endif /* __GNUCLIKE_BUILTIN_VARARGS */ -#if defined(__GNUCLIKE_BUILTIN_VAALIST) && !defined(__GNUC_VA_LIST) \ - && !defined(__NO_GNUC_VA_LIST) -#define __GNUC_VA_LIST -typedef __va_list __gnuc_va_list; /* compatibility w/GNU headers*/ -#endif - #endif /* !_MACHINE__TYPES_H_ */ Modified: head/sys/arm64/include/_types.h ============================================================================== --- head/sys/arm64/include/_types.h Mon Feb 12 14:48:14 2018 (r329164) +++ head/sys/arm64/include/_types.h Mon Feb 12 14:48:20 2018 (r329165) @@ -95,18 +95,4 @@ typedef unsigned int ___wchar_t; #define __WCHAR_MIN 0 /* min value for a wchar_t */ #define __WCHAR_MAX __UINT_MAX /* max value for a wchar_t */ -/* - * Unusual type definitions. - */ -#ifdef __GNUCLIKE_BUILTIN_VARARGS -typedef __builtin_va_list __va_list; /* internally known to gcc */ -#else -typedef char * __va_list; -#endif /* __GNUCLIKE_BUILTIN_VARARGS */ -#if defined(__GNUCLIKE_BUILTIN_VAALIST) && !defined(__GNUC_VA_LIST) \ - && !defined(__NO_GNUC_VA_LIST) -#define __GNUC_VA_LIST -typedef __va_list __gnuc_va_list; /* compatibility w/GNU headers*/ -#endif - #endif /* !_MACHINE__TYPES_H_ */ Modified: head/sys/mips/include/_types.h ============================================================================== --- head/sys/mips/include/_types.h Mon Feb 12 14:48:14 2018 (r329164) +++ head/sys/mips/include/_types.h Mon Feb 12 14:48:20 2018 (r329165) @@ -150,18 +150,4 @@ typedef int ___wchar_t; #define __WCHAR_MIN __INT_MIN /* min value for a wchar_t */ #define __WCHAR_MAX __INT_MAX /* max value for a wchar_t */ -/* - * Unusual type definitions. - */ -#ifdef __GNUCLIKE_BUILTIN_VARARGS -typedef __builtin_va_list __va_list; /* internally known to gcc */ -#else -typedef char * __va_list; -#endif /* __GNUCLIKE_BUILTIN_VARARGS */ -#if defined(__GNUC_VA_LIST_COMPATIBILITY) && !defined(__GNUC_VA_LIST) \ - && !defined(__NO_GNUC_VA_LIST) -#define __GNUC_VA_LIST -typedef __va_list __gnuc_va_list; /* compatibility w/GNU headers*/ -#endif - #endif /* !_MACHINE__TYPES_H_ */ Modified: head/sys/powerpc/include/_types.h ============================================================================== --- head/sys/powerpc/include/_types.h Mon Feb 12 14:48:14 2018 (r329164) +++ head/sys/powerpc/include/_types.h Mon Feb 12 14:48:20 2018 (r329165) @@ -144,24 +144,4 @@ typedef int ___wchar_t; #define __WCHAR_MIN __INT_MIN /* min value for a wchar_t */ #define __WCHAR_MAX __INT_MAX /* max value for a wchar_t */ -/* - * Unusual type definitions. - */ -#if defined(__GNUCLIKE_BUILTIN_VARARGS) -typedef __builtin_va_list __va_list; /* internally known to gcc */ -#else -typedef struct { - char __gpr; - char __fpr; - char __pad[2]; - char *__stack; - char *__base; -} __va_list; -#endif /* post GCC 2.95 */ -#if defined(__GNUC_VA_LIST_COMPATIBILITY) && !defined(__GNUC_VA_LIST) \ - && !defined(__NO_GNUC_VA_LIST) -#define __GNUC_VA_LIST -typedef __va_list __gnuc_va_list; /* compatibility w/GNU headers*/ -#endif - #endif /* !_MACHINE__TYPES_H_ */ Modified: head/sys/riscv/include/_types.h ============================================================================== --- head/sys/riscv/include/_types.h Mon Feb 12 14:48:14 2018 (r329164) +++ head/sys/riscv/include/_types.h Mon Feb 12 14:48:20 2018 (r329165) @@ -95,18 +95,4 @@ typedef int ___wchar_t; #define __WCHAR_MIN __INT_MIN /* min value for a wchar_t */ #define __WCHAR_MAX __INT_MAX /* max value for a wchar_t */ -/* - * Unusual type definitions. - */ -#ifdef __GNUCLIKE_BUILTIN_VARARGS -typedef __builtin_va_list __va_list; /* internally known to gcc */ -#else -typedef char * __va_list; -#endif /* __GNUCLIKE_BUILTIN_VARARGS */ -#if defined(__GNUCLIKE_BUILTIN_VAALIST) && !defined(__GNUC_VA_LIST) \ - && !defined(__NO_GNUC_VA_LIST) -#define __GNUC_VA_LIST -typedef __va_list __gnuc_va_list; /* compatibility w/GNU headers*/ -#endif - #endif /* !_MACHINE__TYPES_H_ */ Modified: head/sys/sparc64/include/_types.h ============================================================================== --- head/sys/sparc64/include/_types.h Mon Feb 12 14:48:14 2018 (r329164) +++ head/sys/sparc64/include/_types.h Mon Feb 12 14:48:20 2018 (r329165) @@ -97,18 +97,4 @@ typedef int ___wchar_t; #define __WCHAR_MIN __INT_MIN /* min value for a wchar_t */ #define __WCHAR_MAX __INT_MAX /* max value for a wchar_t */ -/* - * Unusual type definitions. - */ -#ifdef __GNUCLIKE_BUILTIN_VARARGS -typedef __builtin_va_list __va_list; /* internally known to gcc */ -#else -typedef char * __va_list; -#endif /* __GNUCLIKE_BUILTIN_VARARGS */ -#if defined(__GNUCLIKE_BUILTIN_VAALIST) && !defined(__GNUC_VA_LIST) \ - && !defined(__NO_GNUC_VA_LIST) -#define __GNUC_VA_LIST -typedef __va_list __gnuc_va_list; /* compatibility w/GNU headers*/ -#endif - #endif /* !_MACHINE__TYPES_H_ */ Modified: head/sys/sys/_types.h ============================================================================== --- head/sys/sys/_types.h Mon Feb 12 14:48:14 2018 (r329164) +++ head/sys/sys/_types.h Mon Feb 12 14:48:20 2018 (r329165) @@ -123,6 +123,21 @@ typedef union { typedef __uintmax_t __rman_res_t; /* + * Types for varargs. These are all provided by builtin types these + * days, so centralize their definition. + */ +#ifdef __GNUCLIKE_BUILTIN_VARARGS +typedef __builtin_va_list __va_list; /* internally known to gcc */ +#else +#error "No support for your compiler for stdargs" +#endif +#if defined(__GNUC_VA_LIST_COMPATIBILITY) && !defined(__GNUC_VA_LIST) \ + && !defined(__NO_GNUC_VA_LIST) +#define __GNUC_VA_LIST +typedef __va_list __gnuc_va_list; /* compatibility w/GNU headers*/ +#endif + +/* * When the following macro is defined, the system uses 64-bit inode numbers. * Programs can use this to avoid including , with its associated * namespace pollution. Modified: head/sys/x86/include/_types.h ============================================================================== --- head/sys/x86/include/_types.h Mon Feb 12 14:48:14 2018 (r329164) +++ head/sys/x86/include/_types.h Mon Feb 12 14:48:20 2018 (r329165) @@ -143,26 +143,4 @@ typedef int ___wchar_t; #define __WCHAR_MIN __INT_MIN /* min value for a wchar_t */ #define __WCHAR_MAX __INT_MAX /* max value for a wchar_t */ -/* - * Unusual type definitions. - */ -#ifdef __GNUCLIKE_BUILTIN_VARARGS -typedef __builtin_va_list __va_list; /* internally known to gcc */ -#else -#ifdef __LP64__ -struct __s_va_list { - __uint32_t _pad1[2]; /* gp_offset, fp_offset */ - __uint64_t _pad2[2]; /* overflow_arg_area, reg_save_area */ -}; -typedef struct __s_va_list __va_list; -#else -typedef char * __va_list; -#endif -#endif -#if defined(__GNUC_VA_LIST_COMPATIBILITY) && !defined(__GNUC_VA_LIST) \ - && !defined(__NO_GNUC_VA_LIST) -#define __GNUC_VA_LIST -typedef __va_list __gnuc_va_list; /* compatibility w/GNU headers*/ -#endif - #endif /* !_MACHINE__TYPES_H_ */ From owner-svn-src-all@freebsd.org Mon Feb 12 15:27:43 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F0E1CF00A59; Mon, 12 Feb 2018 15:27:42 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 39900798DC; Mon, 12 Feb 2018 15:27:42 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id w1CFRe53044501; Mon, 12 Feb 2018 07:27:40 -0800 (PST) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id w1CFRe3K044500; Mon, 12 Feb 2018 07:27:40 -0800 (PST) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201802121527.w1CFRe3K044500@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r329162 - in head/sys/amd64/vmm: amd intel In-Reply-To: <201802121445.w1CEjR3n082516@repo.freebsd.org> To: Tycho Nightingale Date: Mon, 12 Feb 2018 07:27:40 -0800 (PST) CC: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Feb 2018 15:27:43 -0000 > Author: tychon > Date: Mon Feb 12 14:45:27 2018 > New Revision: 329162 > URL: https://svnweb.freebsd.org/changeset/base/329162 > > Log: > Provide further mitigation against CVE-2017-5715 by flushing the > return stack buffer (RSB) upon returning from the guest. > > This was inspired by this linux commit: > https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/arch/x86/kvm?id=117cc7a908c83697b0b737d15ae1eb5943afe35b > > Reviewed by: grehan > Sponsored by: Dell EMC Isilon > Differential Revision: https://reviews.freebsd.org/D14272 Plans to MFC this? It would be good to have as many meltdown/spectre patches as possible in the upcomming 11.2 release. > Modified: > head/sys/amd64/vmm/amd/svm_support.S > head/sys/amd64/vmm/intel/vmcs.c > head/sys/amd64/vmm/intel/vmx.h > head/sys/amd64/vmm/intel/vmx_support.S > > Modified: head/sys/amd64/vmm/amd/svm_support.S > ============================================================================== > --- head/sys/amd64/vmm/amd/svm_support.S Mon Feb 12 14:44:21 2018 (r329161) > +++ head/sys/amd64/vmm/amd/svm_support.S Mon Feb 12 14:45:27 2018 (r329162) > @@ -113,6 +113,23 @@ ENTRY(svm_launch) > movq %rdi, SCTX_RDI(%rax) > movq %rsi, SCTX_RSI(%rax) > > + /* > + * To prevent malicious branch target predictions from > + * affecting the host, overwrite all entries in the RSB upon > + * exiting a guest. > + */ > + mov $16, %ecx /* 16 iterations, two calls per loop */ > + mov %rsp, %rax > +0: call 2f /* create an RSB entry. */ > +1: pause > + call 1b /* capture rogue speculation. */ > +2: call 2f /* create an RSB entry. */ > +1: pause > + call 1b /* capture rogue speculation. */ > +2: sub $1, %ecx > + jnz 0b > + mov %rax, %rsp > + > /* Restore host state */ > pop %r15 > pop %r14 > > Modified: head/sys/amd64/vmm/intel/vmcs.c > ============================================================================== > --- head/sys/amd64/vmm/intel/vmcs.c Mon Feb 12 14:44:21 2018 (r329161) > +++ head/sys/amd64/vmm/intel/vmcs.c Mon Feb 12 14:45:27 2018 (r329162) > @@ -34,6 +34,7 @@ > __FBSDID("$FreeBSD$"); > > #include > +#include > #include > #include > > @@ -52,6 +53,12 @@ __FBSDID("$FreeBSD$"); > #include > #endif > > +SYSCTL_DECL(_hw_vmm_vmx); > + > +static int no_flush_rsb; > +SYSCTL_INT(_hw_vmm_vmx, OID_AUTO, no_flush_rsb, CTLFLAG_RW, > + &no_flush_rsb, 0, "Do not flush RSB upon vmexit"); > + > static uint64_t > vmcs_fix_regval(uint32_t encoding, uint64_t val) > { > @@ -403,8 +410,15 @@ vmcs_init(struct vmcs *vmcs) > goto done; > > /* instruction pointer */ > - if ((error = vmwrite(VMCS_HOST_RIP, (u_long)vmx_exit_guest)) != 0) > - goto done; > + if (no_flush_rsb) { > + if ((error = vmwrite(VMCS_HOST_RIP, > + (u_long)vmx_exit_guest)) != 0) > + goto done; > + } else { > + if ((error = vmwrite(VMCS_HOST_RIP, > + (u_long)vmx_exit_guest_flush_rsb)) != 0) > + goto done; > + } > > /* link pointer */ > if ((error = vmwrite(VMCS_LINK_POINTER, ~0)) != 0) > > Modified: head/sys/amd64/vmm/intel/vmx.h > ============================================================================== > --- head/sys/amd64/vmm/intel/vmx.h Mon Feb 12 14:44:21 2018 (r329161) > +++ head/sys/amd64/vmm/intel/vmx.h Mon Feb 12 14:45:27 2018 (r329162) > @@ -150,5 +150,6 @@ u_long vmx_fix_cr4(u_long cr4); > int vmx_set_tsc_offset(struct vmx *vmx, int vcpu, uint64_t offset); > > extern char vmx_exit_guest[]; > +extern char vmx_exit_guest_flush_rsb[]; > > #endif > > Modified: head/sys/amd64/vmm/intel/vmx_support.S > ============================================================================== > --- head/sys/amd64/vmm/intel/vmx_support.S Mon Feb 12 14:44:21 2018 (r329161) > +++ head/sys/amd64/vmm/intel/vmx_support.S Mon Feb 12 14:45:27 2018 (r329162) > @@ -42,6 +42,29 @@ > #define VLEAVE pop %rbp > > /* > + * Save the guest context. > + */ > +#define VMX_GUEST_SAVE \ > + movq %rdi,VMXCTX_GUEST_RDI(%rsp); \ > + movq %rsi,VMXCTX_GUEST_RSI(%rsp); \ > + movq %rdx,VMXCTX_GUEST_RDX(%rsp); \ > + movq %rcx,VMXCTX_GUEST_RCX(%rsp); \ > + movq %r8,VMXCTX_GUEST_R8(%rsp); \ > + movq %r9,VMXCTX_GUEST_R9(%rsp); \ > + movq %rax,VMXCTX_GUEST_RAX(%rsp); \ > + movq %rbx,VMXCTX_GUEST_RBX(%rsp); \ > + movq %rbp,VMXCTX_GUEST_RBP(%rsp); \ > + movq %r10,VMXCTX_GUEST_R10(%rsp); \ > + movq %r11,VMXCTX_GUEST_R11(%rsp); \ > + movq %r12,VMXCTX_GUEST_R12(%rsp); \ > + movq %r13,VMXCTX_GUEST_R13(%rsp); \ > + movq %r14,VMXCTX_GUEST_R14(%rsp); \ > + movq %r15,VMXCTX_GUEST_R15(%rsp); \ > + movq %cr2,%rdi; \ > + movq %rdi,VMXCTX_GUEST_CR2(%rsp); \ > + movq %rsp,%rdi; > + > +/* > * Assumes that %rdi holds a pointer to the 'vmxctx'. > * > * On "return" all registers are updated to reflect guest state. The two > @@ -211,31 +234,55 @@ inst_error: > * The VMCS-restored %rsp points to the struct vmxctx > */ > ALIGN_TEXT > - .globl vmx_exit_guest > -vmx_exit_guest: > + .globl vmx_exit_guest_flush_rsb > +vmx_exit_guest_flush_rsb: > /* > * Save guest state that is not automatically saved in the vmcs. > */ > - movq %rdi,VMXCTX_GUEST_RDI(%rsp) > - movq %rsi,VMXCTX_GUEST_RSI(%rsp) > - movq %rdx,VMXCTX_GUEST_RDX(%rsp) > - movq %rcx,VMXCTX_GUEST_RCX(%rsp) > - movq %r8,VMXCTX_GUEST_R8(%rsp) > - movq %r9,VMXCTX_GUEST_R9(%rsp) > - movq %rax,VMXCTX_GUEST_RAX(%rsp) > - movq %rbx,VMXCTX_GUEST_RBX(%rsp) > - movq %rbp,VMXCTX_GUEST_RBP(%rsp) > - movq %r10,VMXCTX_GUEST_R10(%rsp) > - movq %r11,VMXCTX_GUEST_R11(%rsp) > - movq %r12,VMXCTX_GUEST_R12(%rsp) > - movq %r13,VMXCTX_GUEST_R13(%rsp) > - movq %r14,VMXCTX_GUEST_R14(%rsp) > - movq %r15,VMXCTX_GUEST_R15(%rsp) > + VMX_GUEST_SAVE > > - movq %cr2,%rdi > - movq %rdi,VMXCTX_GUEST_CR2(%rsp) > + /* > + * Deactivate guest pmap from this cpu. > + */ > + movq VMXCTX_PMAP(%rdi), %r11 > + movl PCPU(CPUID), %r10d > + LK btrl %r10d, PM_ACTIVE(%r11) > > - movq %rsp,%rdi > + VMX_HOST_RESTORE > + > + VMX_GUEST_CLOBBER > + > + /* > + * To prevent malicious branch target predictions from > + * affecting the host, overwrite all entries in the RSB upon > + * exiting a guest. > + */ > + mov $16, %ecx /* 16 iterations, two calls per loop */ > + mov %rsp, %rax > +0: call 2f /* create an RSB entry. */ > +1: pause > + call 1b /* capture rogue speculation. */ > +2: call 2f /* create an RSB entry. */ > +1: pause > + call 1b /* capture rogue speculation. */ > +2: sub $1, %ecx > + jnz 0b > + mov %rax, %rsp > + > + /* > + * This will return to the caller of 'vmx_enter_guest()' with a return > + * value of VMX_GUEST_VMEXIT. > + */ > + movl $VMX_GUEST_VMEXIT, %eax > + VLEAVE > + ret > + > + .globl vmx_exit_guest > +vmx_exit_guest: > + /* > + * Save guest state that is not automatically saved in the vmcs. > + */ > + VMX_GUEST_SAVE > > /* > * Deactivate guest pmap from this cpu. > > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Mon Feb 12 15:31:55 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3988CF00FA9; Mon, 12 Feb 2018 15:31:55 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DEB1079E71; Mon, 12 Feb 2018 15:31:54 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D94F513CA5; Mon, 12 Feb 2018 15:31:54 +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 w1CFVsIR007421; Mon, 12 Feb 2018 15:31:54 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1CFVrGi007406; Mon, 12 Feb 2018 15:31:53 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201802121531.w1CFVrGi007406@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 12 Feb 2018 15:31:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329166 - in head: . share/mk stand stand/common stand/liblua stand/liblua32 sys/sys tools/build/options X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head: . share/mk stand stand/common stand/liblua stand/liblua32 sys/sys tools/build/options X-SVN-Commit-Revision: 329166 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Feb 2018 15:31:55 -0000 Author: imp Date: Mon Feb 12 15:31:53 2018 New Revision: 329166 URL: https://svnweb.freebsd.org/changeset/base/329166 Log: Add Lua as a scripting langauge to /boot/loader liblua glues the lua run time into the boot loader. It implements all the runtime routines that lua expects. In addition, it has a few standard 'C' headers that nueter various aspects of the LUA build that are too specific to lua to be in libsa. Many refinements from the original code to improve implementation and the number of included lua libraries. Use int64_t for lua_Number. Have "/boot/lua" be the default module path. Numerous cleanups from the original GSoC project, including hacking libsa to allow lua to be built with only one change outside luaconf.h. Add the final bit of lua glue to bring in liblua and plug into the multiple interpreter framework, previously committed. Add LOADER_LUA option, currently off by default. Presently, this is an experimental option. One must opt-in to using this by defining WITH_LOADER_LUA and WITHOUT_FORTH. It's been lightly tested, so keep a backup copy of your old loader handy. The menu code, coming in the next commit, hasn't been exhaustively tested. A LUA boot loader is 60k larger than a FORTH one, which is 80k larger than a no-interpreter one. Subtle changes in size may tip things past some subtle limit (the binary is ~430k now when built with LUA). A future version may offer coexistance. Bump FreeBSD version to 1200058 to mark the milestone. Pedro Souza's 2014 Summer of Code project. Rui Paulo, Pedro Arthur, Zakary Nafziger and Wojciech A. Koszek also contributed. Warner Losh reworked it extensively into its current form. Obtained from: https://wiki.freebsd.org/SummerOfCode2014/LuaLoader Sponsored by: Google Summer of Code Relnotes: Yes MFC After: 1 month Differential Review: https://reviews.freebsd.org/D14295 Added: head/stand/common/interp_lua.c (contents, props changed) head/stand/liblua/ head/stand/liblua/Makefile (contents, props changed) head/stand/liblua/float.h (contents, props changed) head/stand/liblua/locale.h (contents, props changed) head/stand/liblua/lstd.c (contents, props changed) head/stand/liblua/lstd.h (contents, props changed) head/stand/liblua/luaconf.h (contents, props changed) head/stand/liblua/lutils.c (contents, props changed) head/stand/liblua/lutils.h (contents, props changed) head/stand/liblua/math.h (contents, props changed) head/stand/liblua32/ head/stand/liblua32/Makefile (contents, props changed) head/stand/lua.mk (contents, props changed) head/tools/build/options/WITH_LOADER_LUA (contents, props changed) Modified: head/UPDATING head/share/mk/src.opts.mk head/stand/Makefile head/stand/Makefile.amd64 head/stand/defs.mk head/stand/loader.mk head/sys/sys/param.h Modified: head/UPDATING ============================================================================== --- head/UPDATING Mon Feb 12 14:48:20 2018 (r329165) +++ head/UPDATING Mon Feb 12 15:31:53 2018 (r329166) @@ -51,6 +51,14 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 12.x IS SLOW: ****************************** SPECIAL WARNING: ****************************** +20180212: + FreeBSD boot loader enhanced with Lua scripting. It's purely opt-in for + now by building WITH_LOADER_LUA and WITHOUT_FORTH in /etc/src.conf. + Co-existance for the transition period will come shortly. Booting is a + complex environment and test coverage for Lua-enabled loaders has been + thin, so it would be prudent to assume it might not work and make + provisions for backup boot methods. + 20180211: devmatch functionality has been turned on in devd. It will automatically load drivers for unattached devices. This may cause unexpected drivers to Modified: head/share/mk/src.opts.mk ============================================================================== --- head/share/mk/src.opts.mk Mon Feb 12 14:48:20 2018 (r329165) +++ head/share/mk/src.opts.mk Mon Feb 12 15:31:53 2018 (r329166) @@ -184,6 +184,7 @@ __DEFAULT_NO_OPTIONS = \ LIBSOFT \ LOADER_FIREWIRE \ LOADER_FORCE_LE \ + LOADER_LUA \ NAND \ OFED \ OPENLDAP \ Modified: head/stand/Makefile ============================================================================== --- head/stand/Makefile Mon Feb 12 14:48:20 2018 (r329165) +++ head/stand/Makefile Mon Feb 12 15:31:53 2018 (r329166) @@ -8,6 +8,9 @@ SUBDIR+= libsa SUBDIR+= ficl SUBDIR+= forth .endif +.if ${MK_LOADER_LUA} != "no" +SUBDIR+= liblua +.endif SUBDIR+= man Modified: head/stand/Makefile.amd64 ============================================================================== --- head/stand/Makefile.amd64 Mon Feb 12 14:48:20 2018 (r329165) +++ head/stand/Makefile.amd64 Mon Feb 12 15:31:53 2018 (r329166) @@ -7,6 +7,9 @@ SUBDIR+= zfs zfs32 .if ${MK_FORTH} != "no" SUBDIR+= ficl32 .endif +.if ${MK_LOADER_LUA} != "no" +SUBDIR+= liblua32 +.endif SUBDIR+= efi SUBDIR+= userboot Added: head/stand/common/interp_lua.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/stand/common/interp_lua.c Mon Feb 12 15:31:53 2018 (r329166) @@ -0,0 +1,164 @@ +/*- + * Copyright (c) 2011 Wojciech A. Koszek + * Copyright (c) 2014 Pedro Souza + * 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 "bootstrap.h" + +#define lua_c + +#include "lstd.h" + +#include +#include +#include +#include +#include + +struct interp_lua_softc { + lua_State *luap; +}; + +static struct interp_lua_softc lua_softc; + +#ifdef LUA_DEBUG +#define LDBG(...) do { \ + printf("%s(%d): ", __func__, __LINE__); \ + printf(__VA_ARGS__); \ + printf("\n"); \ +} while (0) +#else +#define LDBG(...) +#endif + + +static void * +interp_lua_realloc(void *ud __unused, void *ptr, size_t osize __unused, size_t nsize) +{ + + if (nsize == 0) { + free(ptr); + return NULL; + } + return realloc(ptr, nsize); +} + +/* + * The libraries commented out below either lack the proper + * support from libsa, or they are unlikely to be useful + * in the bootloader, so have been commented out. + */ +static const luaL_Reg loadedlibs[] = { + {"_G", luaopen_base}, + {LUA_LOADLIBNAME, luaopen_package}, +// {LUA_COLIBNAME, luaopen_coroutine}, +// {LUA_TABLIBNAME, luaopen_table}, + {LUA_STRLIBNAME, luaopen_string}, +// {LUA_IOLIBNAME, luaopen_io}, +// {LUA_OSLIBNAME, luaopen_os}, +// {LUA_MATHLIBNAME, luaopen_math}, +// {LUA_UTF8LIBNAME, luaopen_utf8}, +// {LUA_DBLIBNAME, luaopen_debug}, + {NULL, NULL} +}; + +void +interp_init(void) +{ + lua_State *luap; + struct interp_lua_softc *softc = &lua_softc; + const char *filename; + const luaL_Reg *lib; + + setenv("script.lang", "lua", 1); + LDBG("creating context"); + + luap = lua_newstate(interp_lua_realloc, NULL); + if (luap == NULL) { + printf("problem initializing the Lua interpreter\n"); + abort(); + } + softc->luap = luap; + register_utils(luap); + + /* "require" functions from 'loadedlibs' and set results to global table */ + for (lib = loadedlibs; lib->func; lib++) { + luaL_requiref(luap, lib->name, lib->func, 1); + lua_pop(luap, 1); /* remove lib */ + } + + filename = "/boot/lua/loader.lua"; + if (interp_include(filename) != 0) { + const char *errstr = lua_tostring(luap, -1); + errstr = errstr == NULL ? "unknown" : errstr; + printf("Startup errorr in %s:\nLUA ERROR: %s.\n", filename, errstr); + lua_pop(luap, 1); + } +} + +int +interp_run(const char *line) +{ + int argc; + char **argv; + lua_State *luap; + struct interp_lua_softc *softc = &lua_softc; + int status; + + luap = softc->luap; + LDBG("executing line..."); + if ((status = luaL_dostring(luap, line)) != 0) { + /* + * If we could not parse the line as Lua syntax, + * try parsing it as a loader command. + */ + lua_pop(luap, 1); + if (parse(&argc, &argv, line) == 0) { + status = interp_builtin_cmd(argc, argv); + if (status != CMD_OK) + printf("Command failed\n"); + free(argv); + } else { + printf("Failed to parse \'%s\'\n", line); + status = -1; + } + } + + return (status == 0 ? CMD_OK : CMD_ERROR); +} + +int +interp_include(const char *filename) +{ + struct interp_lua_softc *softc = &lua_softc; + + LDBG("loading file %s", filename); + + return (luaL_dofile(softc->luap, filename)); +} Modified: head/stand/defs.mk ============================================================================== --- head/stand/defs.mk Mon Feb 12 14:48:20 2018 (r329165) +++ head/stand/defs.mk Mon Feb 12 15:31:53 2018 (r329166) @@ -23,6 +23,8 @@ EFIINCMD= ${EFIINC}/${MACHINE} FDTSRC= ${BOOTSRC}/fdt FICLSRC= ${BOOTSRC}/ficl LDRSRC= ${BOOTSRC}/common +LIBLUASRC= ${BOOTSRC}/liblua +LUASRC= ${SRCTOP}/contrib/lua/src SASRC= ${BOOTSRC}/libsa SYSDIR= ${SRCTOP}/sys UBOOTSRC= ${BOOTSRC}/uboot Added: head/stand/liblua/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/stand/liblua/Makefile Mon Feb 12 15:31:53 2018 (r329166) @@ -0,0 +1,38 @@ +# $FreeBSD$ + +.include + +.PATH: ${LUASRC} +.PATH: ${LIBLUASRC} + +LIB= lua +INTERNALLIB= + +# Core Lua. +SRCS= lapi.c lcode.c lctype.c ldebug.c ldo.c ldump.c lfunc.c lgc.c llex.c \ + lmem.c lobject.c lopcodes.c lparser.c lstate.c lstring.c ltable.c \ + ltm.c lundump.c lvm.c lzio.c +SRCS+= lauxlib.c lbaselib.c lstrlib.c loadlib.c + +# These aren't yet included, but link now, omitting them saves 15k +#SRCS+= lcorolib.c ldblib.c lutf8lib.c + +# These aren't yet compatible with the boot environment, and some may never be +#SRCS+= lbitlib.c liolib.c lmathlib.c loslib.c ltablib.c + +# Our utilities. +SRCS+= lstd.c lutils.c + +WARNS= 3 + +CFLAGS+= -DLUA_FLOAT_TYPE=LUA_FLOAT_INT64 +CFLAGS+= -DLUA_PATH_DEFAULT=\"/boot/lua/\?.lua\" +CFLAGS+= -ffreestanding -nostdlib -DBOOT_LUA -DLUA_USE_POSIX +CFLAGS+= -fno-stack-protector -D__BSD_VISIBLE +CFLAGS+= -I${BOOTSRC}/include -I${LIBLUASRC} -I${LUASRC} -I${LDRSRC} + +.if ${MACHINE_CPUARCH} == "amd64" && ${DO32:U0} == 0 +CFLAGS+= -fPIC +.endif + +.include Added: head/stand/liblua/float.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/stand/liblua/float.h Mon Feb 12 15:31:53 2018 (r329166) @@ -0,0 +1,32 @@ +/*- + * Copyright (c) 2018 M Warner Losh + * 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$ + */ + +/* + * Empty file to keep lua build happy. Lua expects to have to include float.h + * but the int64_t number implementation doesn't need it. + */ Added: head/stand/liblua/locale.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/stand/liblua/locale.h Mon Feb 12 15:31:53 2018 (r329166) @@ -0,0 +1,27 @@ +/*- + * Copyright (c) 2018 M Warner Losh + * 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$ + */ Added: head/stand/liblua/lstd.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/stand/liblua/lstd.c Mon Feb 12 15:31:53 2018 (r329166) @@ -0,0 +1,182 @@ +/*- + * Copyright (c) 2014 Pedro Souza + * 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 "lstd.h" +#include "math.h" + +FILE * +fopen(const char *filename, const char *mode) +{ + struct stat st; + int fd; + FILE *f; + + if (mode == NULL || mode[0] != 'r') + return NULL; + + fd = open(filename, O_RDONLY); + if (fd < 0) + return NULL; + + f = malloc(sizeof(FILE)); + if (f == NULL) { + close(fd); + return NULL; + } + + if (fstat(fd, &st) != 0) { + free(f); + close(fd); + return (NULL); + } + + f->fd = fd; + f->offset = 0; + f->size = st.st_size; + + return (f); +} + + +FILE * +freopen(const char *filename, const char *mode, FILE *stream) +{ + fclose(stream); + return (fopen(filename, mode)); +} + +size_t +fread(void *ptr, size_t size, size_t count, FILE *stream) +{ + size_t r; + + if (stream == NULL) + return 0; + r = (size_t)read(stream->fd, ptr, size * count); + stream->offset += r; + + return (r); +} + +int +fclose(FILE *stream) +{ + if (stream == NULL) + return EOF; + close(stream->fd); + free(stream); + + return (0); +} + +int +ferror(FILE *stream) +{ + + return (stream == NULL || stream->fd < 0); +} + +int +feof(FILE *stream) +{ + + if (stream == NULL) + return 1; + + return (stream->offset >= stream->size); +} + +int +getc(FILE *stream) +{ + char ch; + size_t r; + + if (stream == NULL) + return EOF; + r = read(stream->fd, &ch, 1); + if (r == 1) + return ch; + return EOF; +} + +void +luai_writestring(const char *s, int i) +{ + + while (i-- > 0) + putchar(*s++); +} + +/* + * These routines from here on down are to implement the lua math + * library, but that's not presently included by default. They are + * little more than placeholders to allow compilation due to linkage + * issues with upstream Lua. + */ + +int64_t +lstd_pow(int64_t x, int64_t y) +{ + int64_t rv = 1; + + if (y < 0) + return 0; + rv = x; + while (--y) + rv *= x; + + return rv; +} + +int64_t +lstd_floor(int64_t x) +{ + + return (x); +} + +int64_t +lstd_fmod(int64_t a, int64_t b) +{ + + return (a % b); +} + +/* + * This can't be implemented, so maybe it should just abort. + */ +int64_t +lstd_frexp(int64_t a, int *y) +{ + *y = 0; + + return 0; +} Added: head/stand/liblua/lstd.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/stand/liblua/lstd.h Mon Feb 12 15:31:53 2018 (r329166) @@ -0,0 +1,74 @@ +/*- + * Copyright (c) 2014 Pedro Souza + * 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 LSTD_H +#define LSTD_H + +#include +#include +#include +#include +#include +#include + +typedef struct FILE +{ + int fd; + size_t offset; + size_t size; +} FILE; + +FILE *fopen(const char *filename, const char *mode); +FILE *freopen( const char *filename, const char *mode, FILE *stream); +size_t fread(void *ptr, size_t size, size_t count, FILE *stream); +int fclose(FILE *stream); +int ferror(FILE *stream); +int feof(FILE *stream); +int getc(FILE * stream); + +#ifndef EOF +#define EOF (-1) +#endif + +#define stdin ((FILE*)NULL) +#define stdout 1 + +#ifndef BUFSIZ +#define BUFSIZ 512 +#endif + +#define lua_writestringerror(s, p) do { printf((s), (p)); } while (0) + +void luai_writestring(const char *, int); + +#define lua_writestring(s,l) luai_writestring(s,l) + +#define fflush /* */ +#define fgets(b, l, s) fgetstr((b), (l), 0) + +#endif /* LSTD_H */ Added: head/stand/liblua/luaconf.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/stand/liblua/luaconf.h Mon Feb 12 15:31:53 2018 (r329166) @@ -0,0 +1,811 @@ +/* $FreeBSD$ */ +/* +** $Id: luaconf.h,v 1.259 2016/12/22 13:08:50 roberto Exp $ +** Configuration file for Lua +** See Copyright Notice in lua.h +*/ + + +#ifndef luaconf_h +#define luaconf_h + +#include +#include + + +/* +** =================================================================== +** Search for "@@" to find all configurable definitions. +** =================================================================== +*/ + + +/* +** {==================================================================== +** System Configuration: macros to adapt (if needed) Lua to some +** particular platform, for instance compiling it with 32-bit numbers or +** restricting it to C89. +** ===================================================================== +*/ + +/* +@@ LUA_32BITS enables Lua with 32-bit integers and 32-bit floats. You +** can also define LUA_32BITS in the make file, but changing here you +** ensure that all software connected to Lua will be compiled with the +** same configuration. +*/ +/* #define LUA_32BITS */ + + +/* +@@ LUA_USE_C89 controls the use of non-ISO-C89 features. +** Define it if you want Lua to avoid the use of a few C99 features +** or Windows-specific features on Windows. +*/ +/* #define LUA_USE_C89 */ + + +/* +** By default, Lua on Windows use (some) specific Windows features +*/ +#if !defined(LUA_USE_C89) && defined(_WIN32) && !defined(_WIN32_WCE) +#define LUA_USE_WINDOWS /* enable goodies for regular Windows */ +#endif + + +#if defined(LUA_USE_WINDOWS) +#define LUA_DL_DLL /* enable support for DLL */ +#define LUA_USE_C89 /* broadly, Windows is C89 */ +#endif + + +#if defined(LUA_USE_LINUX) +#define LUA_USE_POSIX +#define LUA_USE_DLOPEN /* needs an extra library: -ldl */ +#define LUA_USE_READLINE /* needs some extra libraries */ +#endif + + +#if defined(LUA_USE_MACOSX) +#define LUA_USE_POSIX +#define LUA_USE_DLOPEN /* MacOS does not need -ldl */ +#define LUA_USE_READLINE /* needs an extra library: -lreadline */ +#endif + + +/* +@@ LUA_C89_NUMBERS ensures that Lua uses the largest types available for +** C89 ('long' and 'double'); Windows always has '__int64', so it does +** not need to use this case. +*/ +#if defined(LUA_USE_C89) && !defined(LUA_USE_WINDOWS) +#define LUA_C89_NUMBERS +#endif + + + +/* +@@ LUAI_BITSINT defines the (minimum) number of bits in an 'int'. +*/ +/* avoid undefined shifts */ +#if ((INT_MAX >> 15) >> 15) >= 1 +#define LUAI_BITSINT 32 +#else +/* 'int' always must have at least 16 bits */ +#define LUAI_BITSINT 16 +#endif + + +/* +@@ LUA_INT_TYPE defines the type for Lua integers. +@@ LUA_FLOAT_TYPE defines the type for Lua floats. +** Lua should work fine with any mix of these options (if supported +** by your C compiler). The usual configurations are 64-bit integers +** and 'double' (the default), 32-bit integers and 'float' (for +** restricted platforms), and 'long'/'double' (for C compilers not +** compliant with C99, which may not have support for 'long long'). +*/ + +/* predefined options for LUA_INT_TYPE */ +#define LUA_INT_INT 1 +#define LUA_INT_LONG 2 +#define LUA_INT_LONGLONG 3 + +/* predefined options for LUA_FLOAT_TYPE */ +#define LUA_FLOAT_FLOAT 1 +#define LUA_FLOAT_DOUBLE 2 +#define LUA_FLOAT_LONGDOUBLE 3 +#define LUA_FLOAT_INT64 4 + +#if defined(LUA_32BITS) /* { */ +/* +** 32-bit integers and 'float' +*/ +#if LUAI_BITSINT >= 32 /* use 'int' if big enough */ +#define LUA_INT_TYPE LUA_INT_INT +#else /* otherwise use 'long' */ +#define LUA_INT_TYPE LUA_INT_LONG +#endif +#define LUA_FLOAT_TYPE LUA_FLOAT_FLOAT + +#elif defined(LUA_C89_NUMBERS) /* }{ */ +/* +** largest types available for C89 ('long' and 'double') +*/ +#define LUA_INT_TYPE LUA_INT_LONG +#define LUA_FLOAT_TYPE LUA_FLOAT_DOUBLE + +#endif /* } */ + + +/* +** default configuration for 64-bit Lua ('long long' and 'double') +*/ +#if !defined(LUA_INT_TYPE) +#define LUA_INT_TYPE LUA_INT_LONGLONG +#endif + +#if !defined(LUA_FLOAT_TYPE) +#define LUA_FLOAT_TYPE LUA_FLOAT_DOUBLE +#endif + +/* }================================================================== */ + + + + +/* +** {================================================================== +** Configuration for Paths. +** =================================================================== +*/ + +/* +** LUA_PATH_SEP is the character that separates templates in a path. +** LUA_PATH_MARK is the string that marks the substitution points in a +** template. +** LUA_EXEC_DIR in a Windows path is replaced by the executable's +** directory. +*/ +#define LUA_PATH_SEP ";" +#define LUA_PATH_MARK "?" +#define LUA_EXEC_DIR "!" + + +/* +@@ LUA_PATH_DEFAULT is the default path that Lua uses to look for +** Lua libraries. +@@ LUA_CPATH_DEFAULT is the default path that Lua uses to look for +** C libraries. +** CHANGE them if your machine has a non-conventional directory +** hierarchy or if you want to install your libraries in +** non-conventional directories. +*/ +#define LUA_VDIR LUA_VERSION_MAJOR "." LUA_VERSION_MINOR +#if defined(_WIN32) /* { */ +/* +** In Windows, any exclamation mark ('!') in the path is replaced by the +** path of the directory of the executable file of the current process. +*/ +#define LUA_LDIR "!\\lua\\" +#define LUA_CDIR "!\\" +#define LUA_SHRDIR "!\\..\\share\\lua\\" LUA_VDIR "\\" +#define LUA_PATH_DEFAULT \ + LUA_LDIR"?.lua;" LUA_LDIR"?\\init.lua;" \ + LUA_CDIR"?.lua;" LUA_CDIR"?\\init.lua;" \ + LUA_SHRDIR"?.lua;" LUA_SHRDIR"?\\init.lua;" \ + ".\\?.lua;" ".\\?\\init.lua" +#define LUA_CPATH_DEFAULT \ + LUA_CDIR"?.dll;" \ + LUA_CDIR"..\\lib\\lua\\" LUA_VDIR "\\?.dll;" \ + LUA_CDIR"loadall.dll;" ".\\?.dll" + +#else /* }{ */ + +#define LUA_ROOT "/usr/local/" +#define LUA_LDIR LUA_ROOT "share/lua/" LUA_VDIR "/" +#define LUA_CDIR LUA_ROOT "lib/lua/" LUA_VDIR "/" +#ifndef LUA_PATH_DEFAULT +#define LUA_PATH_DEFAULT \ + LUA_LDIR"?.lua;" LUA_LDIR"?/init.lua;" \ + LUA_CDIR"?.lua;" LUA_CDIR"?/init.lua;" \ + "./?.lua;" "./?/init.lua" +#endif +#define LUA_CPATH_DEFAULT \ + LUA_CDIR"?.so;" LUA_CDIR"loadall.so;" "./?.so" +#endif /* } */ + + +/* +@@ LUA_DIRSEP is the directory separator (for submodules). +** CHANGE it if your machine does not use "/" as the directory separator +** and is not Windows. (On Windows Lua automatically uses "\".) +*/ +#if defined(_WIN32) +#define LUA_DIRSEP "\\" +#else +#define LUA_DIRSEP "/" +#endif + +/* }================================================================== */ + + +/* +** {================================================================== +** Marks for exported symbols in the C code +** =================================================================== +*/ + +/* +@@ LUA_API is a mark for all core API functions. +@@ LUALIB_API is a mark for all auxiliary library functions. +@@ LUAMOD_API is a mark for all standard library opening functions. +** CHANGE them if you need to define those functions in some special way. +** For instance, if you want to create one Windows DLL with the core and +** the libraries, you may want to use the following definition (define +** LUA_BUILD_AS_DLL to get it). +*/ +#if defined(LUA_BUILD_AS_DLL) /* { */ + +#if defined(LUA_CORE) || defined(LUA_LIB) /* { */ +#define LUA_API __declspec(dllexport) +#else /* }{ */ +#define LUA_API __declspec(dllimport) +#endif /* } */ + +#else /* }{ */ + +#define LUA_API extern + +#endif /* } */ + + +/* more often than not the libs go together with the core */ +#define LUALIB_API LUA_API +#define LUAMOD_API LUALIB_API + + +/* +@@ LUAI_FUNC is a mark for all extern functions that are not to be +** exported to outside modules. +@@ LUAI_DDEF and LUAI_DDEC are marks for all extern (const) variables +** that are not to be exported to outside modules (LUAI_DDEF for +** definitions and LUAI_DDEC for declarations). +** CHANGE them if you need to mark them in some special way. Elf/gcc +** (versions 3.2 and later) mark them as "hidden" to optimize access +** when Lua is compiled as a shared library. Not all elf targets support +** this attribute. Unfortunately, gcc does not offer a way to check +** whether the target offers that support, and those without support +** give a warning about it. To avoid these warnings, change to the +** default definition. +*/ +#if defined(__GNUC__) && ((__GNUC__*100 + __GNUC_MINOR__) >= 302) && \ + defined(__ELF__) /* { */ +#define LUAI_FUNC __attribute__((visibility("hidden"))) extern +#else /* }{ */ +#define LUAI_FUNC extern +#endif /* } */ + +#define LUAI_DDEC LUAI_FUNC +#define LUAI_DDEF /* empty */ + +/* }================================================================== */ + + +/* +** {================================================================== +** Compatibility with previous versions +** =================================================================== +*/ + +/* +@@ LUA_COMPAT_5_2 controls other macros for compatibility with Lua 5.2. +@@ LUA_COMPAT_5_1 controls other macros for compatibility with Lua 5.1. +** You can define it to get all options, or change specific options +** to fit your specific needs. +*/ +#if defined(LUA_COMPAT_5_2) /* { */ + +/* +@@ LUA_COMPAT_MATHLIB controls the presence of several deprecated +** functions in the mathematical library. +*/ +#define LUA_COMPAT_MATHLIB + +/* +@@ LUA_COMPAT_BITLIB controls the presence of library 'bit32'. +*/ +#define LUA_COMPAT_BITLIB + +/* +@@ LUA_COMPAT_IPAIRS controls the effectiveness of the __ipairs metamethod. +*/ +#define LUA_COMPAT_IPAIRS + +/* +@@ LUA_COMPAT_APIINTCASTS controls the presence of macros for +** manipulating other integer types (lua_pushunsigned, lua_tounsigned, +** luaL_checkint, luaL_checklong, etc.) +*/ +#define LUA_COMPAT_APIINTCASTS + +#endif /* } */ + + +#if defined(LUA_COMPAT_5_1) /* { */ + +/* Incompatibilities from 5.2 -> 5.3 */ +#define LUA_COMPAT_MATHLIB +#define LUA_COMPAT_APIINTCASTS + +/* +@@ LUA_COMPAT_UNPACK controls the presence of global 'unpack'. +** You can replace it with 'table.unpack'. +*/ +#define LUA_COMPAT_UNPACK + +/* +@@ LUA_COMPAT_LOADERS controls the presence of table 'package.loaders'. +** You can replace it with 'package.searchers'. +*/ +#define LUA_COMPAT_LOADERS + +/* +@@ macro 'lua_cpcall' emulates deprecated function lua_cpcall. +** You can call your C function directly (with light C functions). +*/ +#define lua_cpcall(L,f,u) \ + (lua_pushcfunction(L, (f)), \ + lua_pushlightuserdata(L,(u)), \ + lua_pcall(L,1,0,0)) + + +/* +@@ LUA_COMPAT_LOG10 defines the function 'log10' in the math library. +** You can rewrite 'log10(x)' as 'log(x, 10)'. +*/ +#define LUA_COMPAT_LOG10 + +/* +@@ LUA_COMPAT_LOADSTRING defines the function 'loadstring' in the base +** library. You can rewrite 'loadstring(s)' as 'load(s)'. +*/ +#define LUA_COMPAT_LOADSTRING + +/* +@@ LUA_COMPAT_MAXN defines the function 'maxn' in the table library. +*/ +#define LUA_COMPAT_MAXN + +/* +@@ The following macros supply trivial compatibility for some +** changes in the API. The macros themselves document how to +** change your code to avoid using them. +*/ +#define lua_strlen(L,i) lua_rawlen(L, (i)) + +#define lua_objlen(L,i) lua_rawlen(L, (i)) + +#define lua_equal(L,idx1,idx2) lua_compare(L,(idx1),(idx2),LUA_OPEQ) +#define lua_lessthan(L,idx1,idx2) lua_compare(L,(idx1),(idx2),LUA_OPLT) + +/* +@@ LUA_COMPAT_MODULE controls compatibility with previous +** module functions 'module' (Lua) and 'luaL_register' (C). +*/ +#define LUA_COMPAT_MODULE + +#endif /* } */ + + *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Mon Feb 12 15:32:04 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B5B54F0100B; Mon, 12 Feb 2018 15:32:03 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3DD6E79F76; Mon, 12 Feb 2018 15:32:03 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2E73013CB0; Mon, 12 Feb 2018 15:32: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 w1CFW1Sd007484; Mon, 12 Feb 2018 15:32:01 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1CFW0U2007475; Mon, 12 Feb 2018 15:32:00 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201802121532.w1CFW0U2007475@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 12 Feb 2018 15:32:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329167 - in head/stand: . lua X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head/stand: . lua X-SVN-Commit-Revision: 329167 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Feb 2018 15:32:04 -0000 Author: imp Date: Mon Feb 12 15:32:00 2018 New Revision: 329167 URL: https://svnweb.freebsd.org/changeset/base/329167 Log: Add the lua scripts from the lua-bootloader SoC These are the .lua files from from Pedro Souza's 2014 Summer of Code project. Rui Paulo, Pedro Arthur and Wojciech A. Koszek also contributed. Obtained from: https://wiki.freebsd.org/SummerOfCode2014/LuaLoader Sponsored by: Google Summer of Code Improve the SoC lua menu code to bring it in line with forth menu functionality Submitted by: Zakary Nafziger Sponsored by: FreeBSD Foundation Use loader.setenv and loader.unsetenv instead of loader.perform Convert from include("/boot/foo.lua") to foo = require("foo"); to bring in line with latest lua module conventions. Enforce a uniform style for the new .lua files: o hard tab indenation for 8 spaces o don't have if foo then bar; else bas; end on one line MFC After: 1 month Relnotes: yes Differential Review: https://reviews.freebsd.org/D14295 Added: head/stand/lua/ head/stand/lua/Makefile (contents, props changed) head/stand/lua/color.lua (contents, props changed) head/stand/lua/config.lua (contents, props changed) head/stand/lua/core.lua (contents, props changed) head/stand/lua/drawer.lua (contents, props changed) head/stand/lua/loader.lua (contents, props changed) head/stand/lua/menu.lua (contents, props changed) head/stand/lua/password.lua (contents, props changed) head/stand/lua/screen.lua (contents, props changed) Modified: head/stand/Makefile Modified: head/stand/Makefile ============================================================================== --- head/stand/Makefile Mon Feb 12 15:31:53 2018 (r329166) +++ head/stand/Makefile Mon Feb 12 15:32:00 2018 (r329167) @@ -10,6 +10,7 @@ SUBDIR+= forth .endif .if ${MK_LOADER_LUA} != "no" SUBDIR+= liblua +SUBDIR+= lua .endif SUBDIR+= man Added: head/stand/lua/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/stand/lua/Makefile Mon Feb 12 15:32:00 2018 (r329167) @@ -0,0 +1,15 @@ +# $FreeBSD$ + +.include + +BINDIR= /boot/lua +FILES= color.lua \ + config.lua \ + core.lua \ + drawer.lua \ + loader.lua \ + menu.lua \ + password.lua \ + screen.lua + +.include Added: head/stand/lua/color.lua ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/stand/lua/color.lua Mon Feb 12 15:32:00 2018 (r329167) @@ -0,0 +1,99 @@ +-- +-- Copyright (c) 2015 Pedro Souza +-- 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$ +-- + +local color = {}; + +local core = require("core"); + +color.BLACK = 0; +color.RED = 1; +color.GREEN = 2; +color.YELLOW = 3; +color.BLUE = 4; +color.MAGENTA = 5; +color.CYAN = 6; +color.WHITE = 7; + +color.DEFAULT = 0; +color.BRIGHT = 1; +color.DIM = 2; + +function color.isEnabled() + local c = loader.getenv("loader_color"); + if c ~= nil then + if c:lower() == "no" or c == "0" then + return false; + end + end + return not core.bootserial(); +end + +color.disabled = not color.isEnabled(); + + +function color.escapef(c) + if color.disabled then + return c; + end + return "\027[3"..c.."m"; +end + +function color.escapeb(c) + if color.disabled then + return c; + end + return "\027[4"..c.."m"; +end + +function color.escape(fg, bg, att) + if color.disabled then + return ""; + end + if not att then + att = "" + else + att = att..";"; + end + return "\027["..att.."3"..fg..";4"..bg.."m"; +end + +function color.default() + if color.disabled then + return ""; + end + return "\027[0;37;40m"; +end + +function color.highlight(str) + if color.disabled then + return str; + end + return "\027[1m"..str.."\027[0m"; +end + +return color Added: head/stand/lua/config.lua ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/stand/lua/config.lua Mon Feb 12 15:32:00 2018 (r329167) @@ -0,0 +1,371 @@ +-- +-- Copyright (c) 2015 Pedro Souza +-- 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$ +-- + +local config = {}; + +local modules = {}; + +function config.setKey(k, n, v) + if modules[k] == nil then + modules[k] = {}; + end + modules[k][n] = v; +end + +local pattern_table = { + [1] = { + str = "^%s*(#.*)", + process = function(k, v) end + }, + -- module_load="value" + [2] = { + str = "^%s*([%w_]+)_load%s*=%s*\"([%w%s%p]-)\"%s*(.*)", + process = function(k, v) + if modules[k] == nil then + modules[k] = {}; + end + modules[k].load = string.upper(v); + end + }, + -- module_name="value" + [3] = { + str = "^%s*([%w_]+)_name%s*=%s*\"([%w%s%p]-)\"%s*(.*)", + process = function(k, v) + config.setKey(k, "name", v); + end + }, + -- module_type="value" + [4] = { + str = "^%s*([%w_]+)_type%s*=%s*\"([%w%s%p]-)\"%s*(.*)", + process = function(k, v) + config.setKey(k, "type", v); + end + }, + -- module_flags="value" + [5] = { + str = "^%s*([%w_]+)_flags%s*=%s*\"([%w%s%p]-)\"%s*(.*)", + process = function(k, v) + config.setKey(k, "flags", v); + end + }, + -- module_before="value" + [6] = { + str = "^%s*([%w_]+)_before%s*=%s*\"([%w%s%p]-)\"%s*(.*)", + process = function(k, v) + config.setKey(k, "before", v); + end + }, + -- module_after="value" + [7] = { + str = "^%s*([%w_]+)_after%s*=%s*\"([%w%s%p]-)\"%s*(.*)", + process = function(k, v) + config.setKey(k, "after", v); + end + }, + -- module_error="value" + [8] = { + str = "^%s*([%w_]+)_error%s*=%s*\"([%w%s%p]-)\"%s*(.*)", + process = function(k, v) + config.setKey(k, "error", v); + end + }, + -- exec="command" + [9] = { + str = "^%s*exec%s*=%s*\"([%w%s%p]-)\"%s*(.*)", + process = function(k, v) + if loader.perform(k) ~= 0 then + print("Failed to exec '"..k.."'"); + end + end + }, + -- env_var="value" + [10] = { + str = "^%s*([%w%p]+)%s*=%s*\"([%w%s%p]-)\"%s*(.*)", + process = function(k, v) + if loader.setenv(k, v) ~= 0 then + print("Failed to set '"..k.."' with value: "..v..""); + end + end + }, + -- env_var=num + [11] = { + str = "^%s*([%w%p]+)%s*=%s*(%d+)%s*(.*)", + process = function(k, v) + if loader.setenv(k, v) ~= 0 then + print("Failed to set '"..k.."' with value: "..v..""); + end + end + } +}; + +function config.isValidComment(c) + if c ~= nil then + local s = string.match(c, "^%s*#.*"); + if s == nil then + s = string.match(c, "^%s*$"); + end + if s == nil then + return false; + end + end + return true; +end + +function config.loadmod(mod, silent) + local status = true; + for k, v in pairs(mod) do + if v.load == "YES" then + local str = "load "; + if v.flags ~= nil then + str = str .. v.flags .. " "; + end + if v.type ~= nil then + str = str .. "-t " .. v.type .. " "; + end + if v.name ~= nil then + str = str .. v.name; + else + str = str .. k; + end + + if v.before ~= nil then + if loader.perform(v.before) ~= 0 then + if not silent then + print("Failed to execute '"..v.before.."' before loading '"..k.."'"); + end + status = false; + end + end + + if loader.perform(str) ~= 0 then + if not silent then + print("Failed to execute '" .. str .. "'"); + end + if v.error ~= nil then + loader.perform(v.error); + end + status = false; + end + + if v.after ~= nil then + if loader.perform(v.after) ~= 0 then + if not silent then + print("Failed to execute '"..v.after.."' after loading '"..k.."'"); + end + status = false; + end + end + + else + --if not silent then print("Skiping module '".. k .. "'"); end + end + end + + return status; +end + +function config.parse(name, silent) + local f = io.open(name); + if f == nil then + if not silent then + print("Failed to open config: '" .. name.."'"); + end + return false; + end + + local text; + local r; + + text, r = io.read(f); + + if text == nil then + if not silent then + print("Failed to read config: '" .. name.."'"); + end + return false; + end + + local n = 1; + local status = true; + + for line in string.gmatch(text, "([^\n]+)") do + + if string.match(line, "^%s*$") == nil then + local found = false; + + for i, val in ipairs(pattern_table) do + local k, v, c = string.match(line, val.str); + if k ~= nil then + found = true; + + if config.isValidComment(c) then + val.process(k, v); + else + print("Malformed line ("..n.."):\n\t'"..line.."'"); + status = false; + end + + break; + end + end + + if found == false then + print("Malformed line ("..n.."):\n\t'"..line.."'"); + status = false; + end + end + n = n + 1; + end + + return status; +end + +function config.loadkernel() + local flags = loader.getenv("kernel_options") or ""; + local kernel = loader.getenv("kernel"); + + local try_load = function (names) + for name in names:gmatch("([^;]+)%s*;?") do + r = loader.perform("load "..flags.." "..name); + if r == 0 then + return name; + end + end + return nil; + end; + + local load_bootfile = function() + local bootfile = loader.getenv("bootfile"); + + -- append default kernel name + if not bootfile then + bootfile = "kernel"; + else + bootfile = bootfile..";kernel"; + end + + return try_load(bootfile); + end; + + -- kernel not set, try load from default module_path + if kernel == nil then + local res = load_bootfile(); + + if res ~= nil then + return true; + else + print("Failed to load kernel '"..res.."'"); + return false; + end + else + local module_path = loader.getenv("module_path"); + local res = nil; + + -- first try load kernel with module_path = /boot/${kernel} + -- then try load with module_path=${kernel} + local paths = {"/boot/"..kernel, kernel}; + + for k,v in pairs(paths) do + + loader.setenv("module_path", v); + res = load_bootfile(); + + -- succeeded add path to module_path + if res ~= nil then + loader.setenv("module_path", v..";"..module_path); + return true; + end + end + + -- failed to load with ${kernel} as a directory + -- try as a file + res = try_load(kernel); + if res ~= nil then + return true; + else + print("Failed to load kernel '"..res.."'"); + return false; + end + end +end + + +function config.load(file) + + if not file then + file = "/boot/defaults/loader.conf"; + end + + if not config.parse(file) then +-- print("Failed to parse configuration: '"..file.."'"); + end + + local f = loader.getenv("loader_conf_files"); + if f ~= nil then + for name in string.gmatch(f, "([%w%p]+)%s*") do + if not config.parse(name) then +-- print("Failed to parse configuration: '"..name.."'"); + end + end + end + + print("Loading kernel..."); + config.loadkernel(); + + print("Loading configurations..."); + if not config.loadmod(modules) then + print("Could not load configurations!"); + end +end + +function config.reload(kernel) + local res = 1; + + -- unload all modules + print("Unloading modules..."); + loader.perform("unload"); + + if kernel ~= nil then + res = loader.perform("load "..kernel); + if res == 0 then + print("Kernel '"..kernel.."' loaded!"); + end + end + + -- failed to load kernel or it is nil + -- then load default + if res == 1 then + print("Loading default kernel..."); + config.loadkernel(); + end + + -- load modules + config.loadmod(modules); +end + +return config Added: head/stand/lua/core.lua ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/stand/lua/core.lua Mon Feb 12 15:32:00 2018 (r329167) @@ -0,0 +1,154 @@ +-- +-- Copyright (c) 2015 Pedro Souza +-- 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$ +-- + +local core = {}; + +function core.setVerbose(b) + if (b == nil) then + b = not core.verbose; + end + + if (b == true) then + loader.setenv("boot_verbose", "YES"); + else + loader.unsetenv("boot_verbose"); + end + core.verbose = b; +end + +function core.setSingleUser(b) + if (b == nil) then + b = not core.su; + end + + if (b == true) then + loader.setenv("boot_single", "YES"); + else + loader.unsetenv("boot_single"); + end + core.su = b; +end + +function core.setACPI(b) + if (b == nil) then + b = not core.acpi; + end + + if (b == true) then + loader.setenv("acpi_load", "YES"); + loader.setenv("hint.acpi.0.disabled", "0"); + loader.unsetenv("loader.acpi_disabled_by_user"); + else + loader.unsetenv("acpi_load"); + loader.setenv("hint.acpi.0.disabled", "1"); + loader.setenv("loader.acpi_disabled_by_user", "1"); + end + core.acpi = b; +end + +function core.setSafeMode(b) + if (b == nil) then + b = not core.sm; + end + if (b == true) then + loader.setenv("kern.smp.disabled", "1"); + loader.setenv("hw.ata.ata_dma", "0"); + loader.setenv("hw.ata.atapi_dma", "0"); + loader.setenv("hw.ata.wc", "0"); + loader.setenv("hw.eisa_slots", "0"); + loader.setenv("kern.eventtimer.periodic", "1"); + loader.setenv("kern.geom.part.check_integrity", "0"); + else + loader.unsetenv("kern.smp.disabled"); + loader.unsetenv("hw.ata.ata_dma"); + loader.unsetenv("hw.ata.atapi_dma"); + loader.unsetenv("hw.ata.wc"); + loader.unsetenv("hw.eisa_slots"); + loader.unsetenv("kern.eventtimer.periodic"); + loader.unsetenv("kern.geom.part.check_integrity"); + end + core.sm = b; +end + +function core.kernelList() + local k = loader.getenv("kernel"); + local v = loader.getenv("kernels") or ""; + + local kernels = {}; + local i = 0; + if k ~= nil then + i = i + 1; + kernels[i] = k; + end + + for n in v:gmatch("([^; ]+)[; ]?") do + if n ~= k then + i = i + 1; + kernels[i] = n; + end + end + return kernels; +end + +function core.setDefaults() + core.setACPI(true); + core.setSafeMode(false); + core.setSingleUser(false); + core.setVerbose(false); +end + +function core.autoboot() + loader.perform("autoboot"); +end + +function core.boot() + loader.perform("boot"); +end + +function core.bootserial() + local c = loader.getenv("console"); + + if c ~= nil then + if c:find("comconsole") ~= nil then + return true; + end + end + + local s = loader.getenv("boot_serial"); + if s ~= nil then + return true; + end + + local m = loader.getenv("boot_multicons"); + if m ~= nil then + return true; + end + return false; +end + +return core Added: head/stand/lua/drawer.lua ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/stand/lua/drawer.lua Mon Feb 12 15:32:00 2018 (r329167) @@ -0,0 +1,309 @@ +-- +-- Copyright (c) 2015 Pedro Souza +-- 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$ +-- + +local drawer = {}; + +local color = require("color"); +local screen = require("screen"); + +drawer.brand_position = {x = 2, y = 1}; +drawer.fbsd_logo = { + " ______ ____ _____ _____ ", + " | ____| | _ \\ / ____| __ \\ ", + " | |___ _ __ ___ ___ | |_) | (___ | | | |", + " | ___| '__/ _ \\/ _ \\| _ < \\___ \\| | | |", + " | | | | | __/ __/| |_) |____) | |__| |", + " | | | | | | || | | |", + " |_| |_| \\___|\\___||____/|_____/|_____/ " +}; + +drawer.logo_position = {x = 46, y = 1}; +drawer.beastie_color = { + " \027[31m, ,", + " /( )`", + " \\ \\___ / |", + " /- \027[37m_\027[31m `-/ '", + " (\027[37m/\\/ \\\027[31m \\ /\\", + " \027[37m/ / |\027[31m ` \\", + " \027[34mO O \027[37m) \027[31m/ |", + " \027[37m`-^--'\027[31m`< '", + " (_.) _ ) /", + " `.___/` /", + " `-----' /", + " \027[33m<----.\027[31m __ / __ \\", + " \027[33m<----|====\027[31mO)))\027[33m==\027[31m) \\) /\027[33m====|", + " \027[33m<----'\027[31m `--' `.__,' \\", + " | |", + " \\ / /\\", + " \027[36m______\027[31m( (_ / \\______/", + " \027[36m,' ,-----' |", + " `--{__________)\027[37m" +}; + +drawer.beastie = { + " , ,", + " /( )`", + " \\ \\___ / |", + " /- _ `-/ '", + " (/\\/ \\ \\ /\\", + " / / | ` \\", + " O O ) / |", + " `-^--'`< '", + " (_.) _ ) /", + " `.___/` /", + " `-----' /", + " <----. __ / __ \\", + " <----|====O)))==) \\) /====|", + " <----' `--' `.__,' \\", + " | |", + " \\ / /\\", + " ______( (_ / \\______/", + " ,' ,-----' |", + " `--{__________)" +}; + +drawer.fbsd_logo_shift = {x = 5, y = 4}; +drawer.fbsd_logo_v = { + " ______", + " | ____| __ ___ ___ ", + " | |__ | '__/ _ \\/ _ \\", + " | __|| | | __/ __/", + " | | | | | | |", + " |_| |_| \\___|\\___|", + " ____ _____ _____", + " | _ \\ / ____| __ \\", + " | |_) | (___ | | | |", + " | _ < \\___ \\| | | |", + " | |_) |____) | |__| |", + " | | | |", + " |____/|_____/|_____/" +}; + +drawer.orb_shift = {x = 2, y = 4}; +drawer.orb_color = { + " \027[31m``` \027[31;1m`\027[31m", + " s` `.....---...\027[31;1m....--.``` -/\027[31m", + " +o .--` \027[31;1m/y:` +.\027[31m", + " yo`:. \027[31;1m:o `+-\027[31m", + " y/ \027[31;1m-/` -o/\027[31m", + " .- \027[31;1m::/sy+:.\027[31m", + " / \027[31;1m`-- /\027[31m", + " `: \027[31;1m:`\027[31m", + " `: \027[31;1m:`\027[31m", + " / \027[31;1m/\027[31m", + " .- \027[31;1m-.\027[31m", + " -- \027[31;1m-.\027[31m", + " `:` \027[31;1m`:`", + " \027[31;1m.-- `--.", + " .---.....----.\027[37m" +}; + +drawer.orb = { + " ``` `", + " s` `.....---.......--.``` -/", + " +o .--` /y:` +.", + " yo`:. :o `+-", + " y/ -/` -o/", + " .- ::/sy+:.", + " / `-- /", + " `: :`", + " `: :`", + " / /", + " .- -.", + " -- -.", + " `:` `:`", + " .-- `--.", + " .---.....----." +}; + +drawer.none = {""}; + +drawer.none_shift = {x = 17, y = 0}; + +drawer.menu_position = {x = 6, y = 11}; + +drawer.box_pos_dim = {x = 3, y = 10, w = 41, h = 11}; + +function drawer.drawscreen(menu_opts) + -- drawlogo() must go first. + -- it determines the positions of other elements + drawer.drawlogo(); + drawer.drawbrand(); + drawer.drawbox(); + return drawer.drawmenu(menu_opts); +end + +function drawer.drawmenu(m) + x = drawer.menu_position.x; + y = drawer.menu_position.y; + + -- print the menu and build the alias table + local alias_table = {}; + local entry_num = 0; + for line_num, e in ipairs(m) do + if (e.entry_type ~= "separator") then + entry_num = entry_num + 1; + screen.setcursor(x, y + line_num); + print(entry_num .. ". "..e.name()); + + -- fill the alias table + alias_table[tostring(entry_num)] = e; + for n, a in ipairs(e.alias) do + alias_table[a] = e; + end + else + screen.setcursor(x, y + line_num); + print(e.name()); + end + end + return alias_table; +end + + +function drawer.drawbox() + x = drawer.box_pos_dim.x; + y = drawer.box_pos_dim.y; + w = drawer.box_pos_dim.w; + h = drawer.box_pos_dim.h; + + local hl = string.char(0xCD); + local vl = string.char(0xBA); + + local tl = string.char(0xC9); + local bl = string.char(0xC8); + local tr = string.char(0xBB); + local br = string.char(0xBC); + + screen.setcursor(x, y); print(tl); + screen.setcursor(x, y+h); print(bl); + screen.setcursor(x+w, y); print(tr); + screen.setcursor(x+w, y+h); print(br); + + for i = 1, w-1 do + screen.setcursor(x+i, y); + print(hl); + screen.setcursor(x+i, y+h); + print(hl); + end + + for i = 1, h-1 do + screen.setcursor(x, y+i); + print(vl); + screen.setcursor(x+w, y+i); + print(vl); + end + + screen.setcursor(x+(w/2)-9, y); + print("Welcome to FreeBSD"); +end + +function drawer.draw(x, y, logo) + for i = 1, #logo do + screen.setcursor(x, y + i); + print(logo[i]); + end +end + +function drawer.drawbrand() + local x = tonumber(loader.getenv("loader_brand_x")); + local y = tonumber(loader.getenv("loader_brand_y")); + + if not x then + x = drawer.brand_position.x; + end + if not y then + y = drawer.brand_position.y; + end + + local logo = load("return " .. tostring(loader.getenv("loader_brand")))(); + if not logo then + logo = drawer.fbsd_logo; + end + drawer.draw(x, y, logo); +end + +function drawer.drawlogo() + local x = tonumber(loader.getenv("loader_logo_x")); + local y = tonumber(loader.getenv("loader_logo_y")); + + if not x then + x = drawer.logo_position.x; + end + if not y then + y = drawer.logo_position.y; + end + + local logo = loader.getenv("loader_logo"); + local s = {x = 0, y = 0}; + local colored = color.isEnabled(); + + if logo == "beastie" then + if colored then + logo = drawer.beastie_color; + end + elseif logo == "beastiebw" then + logo = drawer.beastie; + elseif logo == "fbsdbw" then + logo = drawer.fbsd_logo_v; + s = drawer.fbsd_logo_shift; + elseif logo == "orb" then + if colored then + logo = drawer.orb_color; + end + s = drawer.orb_shift; + elseif logo == "orbbw" then + logo = drawer.orb; + s = drawer.orb_shift; + elseif logo == "tribute" then + logo = drawer.fbsd_logo; + elseif logo == "tributebw" then + logo = drawer.fbsd_logo; + elseif logo == "none" then + --centre brand and text if no logo + drawer.brand_position.x = drawer.brand_position.x + drawer.none_shift.x; + drawer.brand_position.y = drawer.brand_position.y + drawer.none_shift.y; + drawer.menu_position.x = drawer.menu_position.x + drawer.none_shift.x; + drawer.menu_position.y = drawer.menu_position.y + drawer.none_shift.y; + drawer.box_pos_dim.x = drawer.box_pos_dim.x + drawer.none_shift.x; + drawer.box_pos_dim.y = drawer.box_pos_dim.y + drawer.none_shift.y; + --prevent redraws from moving menu further + drawer.none_shift.x = 0; + drawer.none_shift.y = 0; + logo = drawer.none; + end + if not logo then + if colored then + logo = drawer.orb_color; + else + logo = drawer.orb; + end + end + drawer.draw(x + s.x, y + s.y, logo); +end + +return drawer Added: head/stand/lua/loader.lua ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/stand/lua/loader.lua Mon Feb 12 15:32:00 2018 (r329167) @@ -0,0 +1,35 @@ +-- +-- Copyright (c) 2015 Pedro Souza +-- 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. *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Mon Feb 12 15:32:05 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9A834F0101F; Mon, 12 Feb 2018 15:32:05 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 71FF379F96; Mon, 12 Feb 2018 15:32:05 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6BCF813CB4; Mon, 12 Feb 2018 15:32:05 +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 w1CFW5sh007537; Mon, 12 Feb 2018 15:32:05 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1CFW5Rf007536; Mon, 12 Feb 2018 15:32:05 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201802121532.w1CFW5Rf007536@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 12 Feb 2018 15:32:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329168 - head/tools/boot X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/tools/boot X-SVN-Commit-Revision: 329168 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Feb 2018 15:32:05 -0000 Author: imp Date: Mon Feb 12 15:32:05 2018 New Revision: 329168 URL: https://svnweb.freebsd.org/changeset/base/329168 Log: Add lua to build script Modified: head/tools/boot/universe.sh Modified: head/tools/boot/universe.sh ============================================================================== --- head/tools/boot/universe.sh Mon Feb 12 15:32:00 2018 (r329167) +++ head/tools/boot/universe.sh Mon Feb 12 15:32:05 2018 (r329168) @@ -76,6 +76,20 @@ for i in \ dobuild $ta _.boot.${ta}.log "" done +# Default build for a goodly selection of architectures with Lua +for i in \ + amd64/amd64 \ + arm/arm arm/armeb arm/armv7 \ + arm64/aarch64 \ + i386/i386 \ + mips/mips mips/mips64 \ + powerpc/powerpc powerpc/powerpc64 \ + sparc64/sparc64 \ + ; do + ta=${i##*/} + dobuild $ta _.boot.${ta}.lua.log "MK_LOADEDER_LUA=yes MK_FORTH=no" +done + # Build w/o ZFS for i in \ amd64/amd64 \ From owner-svn-src-all@freebsd.org Mon Feb 12 15:37:12 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 27D26F017AF for ; Mon, 12 Feb 2018 15:37:12 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: from mail-wm0-x22f.google.com (mail-wm0-x22f.google.com [IPv6:2a00:1450:400c:c09::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 6E90A7A589 for ; Mon, 12 Feb 2018 15:37:11 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: by mail-wm0-x22f.google.com with SMTP id x4so9309968wmc.0 for ; Mon, 12 Feb 2018 07:37:11 -0800 (PST) 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=wd3r5yjhPx7nNpdZHEJjQBZZ11Rq9+5K+fr/BDZzKao=; b=q3YvpXnmzE4eg+XEbp9BYdkO+rBzSuFQ5Pa9Yy9VZGGCw5Yb8FIrqSFd+IQOQV0Gy6 r8petWIGSZmrqK0NJ2c3BEbR95tvBX0Iuhwk36vNm4JgSUoJYPeSMJ0TONauWeXv+HHt BfoDLgWE1ESubGq+HB/Qw9kBUe6aTm+wUOpKuSyoMnS/fgqSoQg4CI3ssSMr96cry/qo ctZZ4wJKN8TTgWHU5/JYEiz4dKRsEshkUxloQCL+xa1f08f6D68zwGbujIF+QkeaF69j NqwbqxPycGrDsw59kqlYVq1k4NgGvkKIpCcfdZGTUmjawNuvIPvnZTdSyBbBsckfnjQM WYwA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=wd3r5yjhPx7nNpdZHEJjQBZZ11Rq9+5K+fr/BDZzKao=; b=ZUEbCSN3WtJ6OLVulzHPO8DOkadhiRSQuvZJ6evLblT/D5Yfs75NkTGgSDAKlh+0Mj Q9taksND9YljqTTj2KYZegndaGF90tp5G2cOxkF/Y4+D2pT6aTxNrlLyfk6FsNu4DCQ/ tkIXH0zMOVHnpugD87ghFtp9vT0jbL3Ov271V4S7hlKfJdgcYKSK9d/kyIK+eKSnVs88 cadc6Xsv6WqSR8MVfZ3QPhKeaSKf3Lhj1cQDLisik0OXCC2PBmrfj39NPT9u0kxao8iX 1ME02bKSC38k2LKtdlDilRAYFsc1Y4bkHs0c9bW91veR4Fr5oqhshuGpFcRLfPMLdipD I0Rw== X-Gm-Message-State: APf1xPDcYL4VmfrczPm/qUxtcgKulRQ9EoYlxsTQeqXHk1kkheSObJk2 KRSNmnGm5iLNu/zOO0fI7ukx8w== X-Google-Smtp-Source: AH8x224NPMQZzvcFd/Y4+NDKFeiEr2SsRAMza7aJGZYb52UJsEOMNlfnVe2PDPwQukZ+vY5GL1xdUA== X-Received: by 10.28.171.10 with SMTP id u10mr3761896wme.108.1518449830128; Mon, 12 Feb 2018 07:37:10 -0800 (PST) Received: from mutt-hbsd ([51.15.53.83]) by smtp.gmail.com with ESMTPSA id h32sm8434833wrf.65.2018.02.12.07.37.07 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 12 Feb 2018 07:37:09 -0800 (PST) Date: Mon, 12 Feb 2018 10:37:00 -0500 From: Shawn Webb To: Tycho Nightingale Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r329162 - in head/sys/amd64/vmm: amd intel Message-ID: <20180212153700.xbmbctnjtawum76h@mutt-hbsd> References: <201802121445.w1CEjR3n082516@repo.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="pknvq5xyabqlqd5w" Content-Disposition: inline In-Reply-To: <201802121445.w1CEjR3n082516@repo.freebsd.org> X-Operating-System: FreeBSD mutt-hbsd 12.0-CURRENT FreeBSD 12.0-CURRENT X-PGP-Key: http://pgp.mit.edu/pks/lookup?op=vindex&search=0x6A84658F52456EEE User-Agent: NeoMutt/20171215 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Feb 2018 15:37:12 -0000 --pknvq5xyabqlqd5w Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Feb 12, 2018 at 02:45:27PM +0000, Tycho Nightingale wrote: > Author: tychon > Date: Mon Feb 12 14:45:27 2018 > New Revision: 329162 > URL: https://svnweb.freebsd.org/changeset/base/329162 >=20 > Log: > Provide further mitigation against CVE-2017-5715 by flushing the > return stack buffer (RSB) upon returning from the guest. > =20 > This was inspired by this linux commit: > https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/comm= it/arch/x86/kvm?id=3D117cc7a908c83697b0b737d15ae1eb5943afe35b > =20 > Reviewed by: grehan > Sponsored by: Dell EMC Isilon > Differential Revision: https://reviews.freebsd.org/D14272 >=20 > Modified: > head/sys/amd64/vmm/amd/svm_support.S > head/sys/amd64/vmm/intel/vmcs.c > head/sys/amd64/vmm/intel/vmx.h > head/sys/amd64/vmm/intel/vmx_support.S >=20 > Modified: head/sys/amd64/vmm/amd/svm_support.S > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=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/amd64/vmm/amd/svm_support.S Mon Feb 12 14:44:21 2018 (r32916= 1) > +++ head/sys/amd64/vmm/amd/svm_support.S Mon Feb 12 14:45:27 2018 (r32916= 2) > @@ -113,6 +113,23 @@ ENTRY(svm_launch) > movq %rdi, SCTX_RDI(%rax) > movq %rsi, SCTX_RSI(%rax) > =20 > + /* > + * To prevent malicious branch target predictions from > + * affecting the host, overwrite all entries in the RSB upon > + * exiting a guest. > + */ > + mov $16, %ecx /* 16 iterations, two calls per loop */ > + mov %rsp, %rax > +0: call 2f /* create an RSB entry. */ > +1: pause > + call 1b /* capture rogue speculation. */ > +2: call 2f /* create an RSB entry. */ > +1: pause > + call 1b /* capture rogue speculation. */ > +2: sub $1, %ecx > + jnz 0b > + mov %rax, %rsp > + > /* Restore host state */ > pop %r15 > pop %r14 >=20 For amd systems, isn't use of lfence required for performance reasons[1]? Or am I conflating two things? 1: https://reviews.llvm.org/D41723 Thanks, --=20 Shawn Webb Cofounder and Security Engineer HardenedBSD Tor-ified Signal: +1 443-546-8752 GPG Key ID: 0x6A84658F52456EEE GPG Key Fingerprint: 2ABA B6BD EF6A F486 BE89 3D9E 6A84 658F 5245 6EEE --pknvq5xyabqlqd5w Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEKrq2ve9q9Ia+iT2eaoRlj1JFbu4FAlqBtJgACgkQaoRlj1JF bu7tYA/+NG5TaLVeH6SHXEJCy3BfCEym7Wa0RfYR87Brgnc/ETKSn/TsQUDeD4Qp qXHb18YnfoFbP7VPxPyL+flUDAndzAGPDZarHymcK9N1sOHH36vGnee0zRa5RAaR 3YOJGWmVqTos1Mvp0eBc5B/xMtxF1l8eO5wzdXIL38/yifhtec7hvGCm7aHx4jmo U3UMsMMd+1MYEx0xb7rj/4XT38dSCgySKiTPrrohD7TYsdUH61yVLb5lpOCAU/Z8 X/qE02RtjajGBKPeC1iJOBCOv1OrpPv7951sKEs0MCiLbCmvhKZep9fj87IpF+br W2E0Y7NIXywVAeyWBbG6S6ucP9YRHszLwc1+MhKvagEfB3dEQiHl9izH4fPavMh8 lk7AHuBrgADfAEWcnkjh4xhdv9PeISJ7kBhmSKumjYm88LtoPjMPzsRsEoKM4bza eiEAQjQjDj5MDaF26bJ0jxwmo7bLDuq5N6Qh+lr1xbqV3wWvwPgebXcv0WytZw3O tKqpOMRHWUFCAplcLrciFk3PAAjmUwKLq/7VuQYUMJz/nJW4hSgFUglFfl2/Mong CbA+LfFLg8IRQkpR8z9cCQ5x1GFwJkcH20T2JjN5SonXw9EESySNgzaj/yFlL2lS o0y9dZLMyGuJ/qfAnfBDxSW4qMedc/JmJ20RiwOlSMgJ53iXHn4= =gOIE -----END PGP SIGNATURE----- --pknvq5xyabqlqd5w-- From owner-svn-src-all@freebsd.org Mon Feb 12 15:44:29 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 11605F02078 for ; Mon, 12 Feb 2018 15:44:29 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: from mail-wm0-x229.google.com (mail-wm0-x229.google.com [IPv6:2a00:1450:400c: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 79D6B7ADAF for ; Mon, 12 Feb 2018 15:44:28 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: by mail-wm0-x229.google.com with SMTP id g1so10388543wmg.2 for ; Mon, 12 Feb 2018 07:44:28 -0800 (PST) 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=WVvFVtR2F9hm/5YLS2qiepJZqfVEGYRkq9awaMozxZI=; b=wY47SOV+aE3itkKwaltnW3yJmp8Pm/+vzGkVcvNiTlP43pyQXX7Nh1J10aKPt/fcob bb4h/9D7ruoE10UZ5InQZIC16mCzsoBPZagbD9L1l7Y/er1EJ+VTOX40Xx7cButh5gNC a4+roIX17ghTaHA7vrKcgScvt13Hd83iab/1ubD4p5xypzeo9LEvgWhsB4U4hC4TRNAx xbGs5nHZtGS9CqFJMMrrTk0Yl1Sitv5mGHty27VkAvkS1SgCCqHYRfnklrQGHEnRze4F 2oyKYATD7TlAX4BL82FMCF5hF+zFPC05EFddFcUK/w2do7qyfZ77BRXRpbsFqdzxyqUZ Z0cA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=WVvFVtR2F9hm/5YLS2qiepJZqfVEGYRkq9awaMozxZI=; b=DWYvY4dZU6aa69elIirB0HF6wknmpQ7sr2Wq5tns4UJOhx2BZqxu1mi9lsxU4LqHF9 r0k5t9wQZwAGGVHJ0t9FolQ9gBTleGhkCuQBSfpnct3Yeg5ruCMtjckMaFC54UvwNWe3 3prnSXbDsPuGbEBjQmrDCS37PqDQJus5NewssdI8i/khEBB5jiUTfPGqOTg7EQfWJmNX sCharcroRN2siIJCC61EbHReoqW+NAk8PHBF3pT0s4VvvMMhsLq59sOZbpQOPn1l83P+ LRqJZJkBjzfORcqWeSNj/hsitJDCuKVtqbGb2eLQIEbyRpBv9KW9+qyjuLH+YB3y7o25 HqVQ== X-Gm-Message-State: APf1xPAAuHjou+flgt11i//1eBRtRjNDVYWWMBvCh8jDtQYdRaNBr8Nu goXogEWsYbVvo3/sz8VkzOViMojOrRo= X-Google-Smtp-Source: AH8x226VY6gZgprL82o3o3x4bx2Uizzv9D9L6VsjN57RSa1FvNdSMhcE0xRn8IU1Iftpx8lPoTDovg== X-Received: by 10.80.142.194 with SMTP id x2mr17070553edx.274.1518450267298; Mon, 12 Feb 2018 07:44:27 -0800 (PST) Received: from mutt-hbsd (ori.enn.lu. [85.248.227.163]) by smtp.gmail.com with ESMTPSA id g30sm5307408edb.48.2018.02.12.07.44.23 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 12 Feb 2018 07:44:26 -0800 (PST) Date: Mon, 12 Feb 2018 10:44:14 -0500 From: Shawn Webb To: Kyle Evans Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: Re: svn commit: r329140 - in stable/11: . share/mk sys/arm/include sys/arm64/include sys/boot sys/boot/arm/at91 sys/boot/arm/at91/boot0 sys/boot/arm/at91/boot0iic sys/boot/arm/at91/boot0spi sys/boot/ar... Message-ID: <20180212154355.2jiwz3r6ffeaawhe@mutt-hbsd> References: <201802112058.w1BKw0xv046842@repo.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="hzct5awhjtsq44yb" Content-Disposition: inline In-Reply-To: <201802112058.w1BKw0xv046842@repo.freebsd.org> X-Operating-System: FreeBSD mutt-hbsd 12.0-CURRENT FreeBSD 12.0-CURRENT X-PGP-Key: http://pgp.mit.edu/pks/lookup?op=vindex&search=0x6A84658F52456EEE User-Agent: NeoMutt/20171215 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Feb 2018 15:44:29 -0000 --hzct5awhjtsq44yb Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Feb 11, 2018 at 08:58:00PM +0000, Kyle Evans wrote: > Author: kevans > Date: Sun Feb 11 20:58:00 2018 > New Revision: 329140 > URL: https://svnweb.freebsd.org/changeset/base/329140 > [snip] > Added: > [snip] > stable/11/tools/build/options/WITHOUT_LOADER_GEIL > - copied unchanged from r325693, head/tools/build/options/WITHOUT_LO= ADER_GEIL Shouldn't this be WITHOUT_LOADER_GELI? Thanks, --=20 Shawn Webb Cofounder and Security Engineer HardenedBSD Tor-ified Signal: +1 443-546-8752 GPG Key ID: 0x6A84658F52456EEE GPG Key Fingerprint: 2ABA B6BD EF6A F486 BE89 3D9E 6A84 658F 5245 6EEE --hzct5awhjtsq44yb Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIyBAEBCAAdFiEEKrq2ve9q9Ia+iT2eaoRlj1JFbu4FAlqBtk4ACgkQaoRlj1JF bu6GSw/470h6MWam3fvvnR5jmM2YA3UO8hR/50g9lJ5JTkC7DloIzcX4cqO4y1ge vvawpuXQs7b3Z/kgzfSo/Reduchg19O4j8y5UT1u1sRNbrop4e3ziJAp44z1SudR pVr+0y1+8wNWxk2j0bzfu3jPdzgOX35hR8MlPNcnP//02w7D7PVcmB1UEcWcfF6I HQMT28XI2DaDwIBPydnrwPfJm192en6b7EqE3W9QbIJJ3Pi/Z4RR0q4tS2eDQGbs g+OWNXSqSjNFFIIcdLWIIpl8GhJS5aAE6fDrDR0Feum0rflkIwn9xyd/1chCCkME fW32BAc7vVy80fF0jHQM6Eow02odkzeAzy4c08bnCAl/71dS83+xABq1kDhazzRW 9b8FrpjSeyykgvUva6HqVIf0evpJqDPEKlBNsLOshGT9xEeHFBnbgfyAyYXyUk7/ tFPyIvsmR2y8MAuHCyBXF9ZnApGYu/BaqRPE8qQYp67vBQBZV11shBFP2dByK+AN EvXjHeNtn8jJZdPya/OwZpQcmyDBPchFczb46JgFEVYvDswhl0DH7rHxvabpxI5k TIO1bnios4hoOKuATIaOryHY9r9Je6GNrErHbjBoVs50fT+nAjuKcaXdA0Gk1IeN qfRpoLKlPmj6dEeW1+p7aw1CSULVJgun2N1ZQnDIlSh17G1a8Q== =2EUQ -----END PGP SIGNATURE----- --hzct5awhjtsq44yb-- From owner-svn-src-all@freebsd.org Mon Feb 12 15:48:13 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 75C22F024F9; Mon, 12 Feb 2018 15:48:13 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 237527B139; Mon, 12 Feb 2018 15:48:13 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1E25513E99; Mon, 12 Feb 2018 15:48:13 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1CFmC31013729; Mon, 12 Feb 2018 15:48:12 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1CFmCNT013728; Mon, 12 Feb 2018 15:48:12 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201802121548.w1CFmCNT013728@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Mon, 12 Feb 2018 15:48:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r329169 - stable/11/tools/build/options X-SVN-Group: stable-11 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: stable/11/tools/build/options X-SVN-Commit-Revision: 329169 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Feb 2018 15:48:13 -0000 Author: kevans Date: Mon Feb 12 15:48:12 2018 New Revision: 329169 URL: https://svnweb.freebsd.org/changeset/base/329169 Log: MFC r325718: Fix typo in filename. Noticed by: Shawn Webb (again) Added: stable/11/tools/build/options/WITHOUT_LOADER_GELI - copied unchanged from r325718, head/tools/build/options/WITHOUT_LOADER_GELI Deleted: stable/11/tools/build/options/WITHOUT_LOADER_GEIL Modified: Directory Properties: stable/11/ (props changed) Copied: stable/11/tools/build/options/WITHOUT_LOADER_GELI (from r325718, head/tools/build/options/WITHOUT_LOADER_GELI) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/tools/build/options/WITHOUT_LOADER_GELI Mon Feb 12 15:48:12 2018 (r329169, copy of r325718, head/tools/build/options/WITHOUT_LOADER_GELI) @@ -0,0 +1,2 @@ +.\" $FreeBSD$ +Disable inclusion of GELI crypto support in the boot chain binaries. From owner-svn-src-all@freebsd.org Mon Feb 12 15:50:13 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0500DF02757; Mon, 12 Feb 2018 15:50:13 +0000 (UTC) (envelope-from byond.lenox@gmail.com) Received: from mail-lf0-f53.google.com (mail-lf0-f53.google.com [209.85.215.53]) (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 6CDB37B3AC; Mon, 12 Feb 2018 15:50:12 +0000 (UTC) (envelope-from byond.lenox@gmail.com) Received: by mail-lf0-f53.google.com with SMTP id w10so8260220lfc.9; Mon, 12 Feb 2018 07:50:12 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=voY22C7WAcuIh995wDOqLmZAz/iT47JMU5WLzNWGnoQ=; b=mZ8PcvSXdb2XWZlfHWe7va/DLCtQ2PElO4KV2PjrARaQoNd3FX4lpeceqId/JtlenG PCEatIGnhNcLtIvoBAGEijBYX7c59u8fvyUbxZ8RTIJpjFSUxqcz7+eOqqf/oHx+2uQD s5i2q/wahhsUWPXUtHhgx13AJ1DBasZcPjv0vimMaKJUVyKbQ2l+qLpopmnUCVuRrmFI JtTJJ2iMI/R+lmpIfXByvKN2Uzoj+3anRbj42DEpCsMB7TxefGjyOdpZ7wUbIw+0O5IV 6GrKNAi+epeXHLSazviqTE1xf9UIvKzcvnSVhK6IoQ4sASG1gJGzPX3ulaE16Cd6wkOO Fq+A== X-Gm-Message-State: APf1xPDlrk3AaOv4JyqYKM9CHD8sh1nzd4soBwhB3CTzOiNKxRj5dWaR aNaNL5l3Cp0kXTKHp7aV581KuJ1C X-Google-Smtp-Source: AH8x225GSViMuSyLe1/RgYAqj/i7YcF+6804frdtiO+/fSJIZcRd7pxnNZViSxwQJuqbYpyMujblMw== X-Received: by 10.46.15.26 with SMTP id 26mr7943695ljp.52.1518450604473; Mon, 12 Feb 2018 07:50:04 -0800 (PST) Received: from mail-lf0-f49.google.com (mail-lf0-f49.google.com. [209.85.215.49]) by smtp.gmail.com with ESMTPSA id h7sm1655713ljf.37.2018.02.12.07.50.03 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 12 Feb 2018 07:50:03 -0800 (PST) Received: by mail-lf0-f49.google.com with SMTP id j193so5072984lfe.0; Mon, 12 Feb 2018 07:50:03 -0800 (PST) X-Received: by 10.46.101.65 with SMTP id z62mr3029051ljb.37.1518450603543; Mon, 12 Feb 2018 07:50:03 -0800 (PST) MIME-Version: 1.0 Received: by 10.46.106.8 with HTTP; Mon, 12 Feb 2018 07:49:43 -0800 (PST) In-Reply-To: <20180212154355.2jiwz3r6ffeaawhe@mutt-hbsd> References: <201802112058.w1BKw0xv046842@repo.freebsd.org> <20180212154355.2jiwz3r6ffeaawhe@mutt-hbsd> From: Kyle Evans Date: Mon, 12 Feb 2018 09:49:43 -0600 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r329140 - in stable/11: . share/mk sys/arm/include sys/arm64/include sys/boot sys/boot/arm/at91 sys/boot/arm/at91/boot0 sys/boot/arm/at91/boot0iic sys/boot/arm/at91/boot0spi sys/boot/ar... To: Shawn Webb Cc: src-committers , svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Feb 2018 15:50:13 -0000 On Mon, Feb 12, 2018 at 9:44 AM, Shawn Webb wrote: > On Sun, Feb 11, 2018 at 08:58:00PM +0000, Kyle Evans wrote: >> Author: kevans >> Date: Sun Feb 11 20:58:00 2018 >> New Revision: 329140 >> URL: https://svnweb.freebsd.org/changeset/base/329140 >> [snip] >> Added: >> [snip] >> stable/11/tools/build/options/WITHOUT_LOADER_GEIL >> - copied unchanged from r325693, head/tools/build/options/WITHOUT_LOADER_GEIL > > Shouldn't this be WITHOUT_LOADER_GELI? > You're now 2 for 2 on catching that. ;) Fixd in r329169, thanks! From owner-svn-src-all@freebsd.org Mon Feb 12 15:58:57 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 60038F03501; Mon, 12 Feb 2018 15:58:57 +0000 (UTC) (envelope-from joerg@bec.de) Received: from relay4-d.mail.gandi.net (relay4-d.mail.gandi.net [IPv6:2001:4b98:c:538::196]) (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 F2A1C7BDB9; Mon, 12 Feb 2018 15:58:56 +0000 (UTC) (envelope-from joerg@bec.de) Received: from britannica.bec.de (p200300D2ABCCC4104639C4FFFE599710.dip0.t-ipconnect.de [IPv6:2003:d2:abcc:c410:4639:c4ff:fe59:9710]) (Authenticated sender: joerg@bec.de) by relay4-d.mail.gandi.net (Postfix) with ESMTPSA id 0A3AF172677; Mon, 12 Feb 2018 16:58:46 +0100 (CET) Date: Mon, 12 Feb 2018 16:57:49 +0100 From: Joerg Sonnenberger To: Warner Losh Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r329164 - in head: include sys/amd64/include sys/i386/include sys/mips/include sys/powerpc/include sys/sparc64/include Message-ID: <20180212155749.GA27160@britannica.bec.de> References: <201802121448.w1CEmEUX082701@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201802121448.w1CEmEUX082701@repo.freebsd.org> User-Agent: Mutt/1.9.0 (2017-09-02) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Feb 2018 15:58:57 -0000 On Mon, Feb 12, 2018 at 02:48:14PM +0000, Warner Losh wrote: > Author: imp > Date: Mon Feb 12 14:48:14 2018 > New Revision: 329164 > URL: https://svnweb.freebsd.org/changeset/base/329164 > > Log: > We don't support gcc < 4.2.1, so varargs.h now is just #error > always. Unifdef for versions prior to 4.2.1 and remove now-unused > header files. In my experience it is better to really drop it. Keeping the header with an #error is just creating *more* pain than having no header at all. Joerg From owner-svn-src-all@freebsd.org Mon Feb 12 16:07:35 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 103D3F03F53 for ; Mon, 12 Feb 2018 16:07:35 +0000 (UTC) (envelope-from wlosh@bsdimp.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 8CC287C5F7 for ; Mon, 12 Feb 2018 16:07:34 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-it0-x243.google.com with SMTP id e1so7090262ita.0 for ; Mon, 12 Feb 2018 08:07:34 -0800 (PST) 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=BTrrIY/dCtCcuG4IBfeWAjogpXCm6CGFAnP3niGoTts=; b=Ldwr1ql0CtA+41RbiUo97oy/YuZOoyhytkhygwe0ywwwlAE3z9E4QfqBc6hQ3TWZKi EBRdFbXTrgI90p+20rQpALn7Cnf3CK6N3EFaVLVH+mo7kXAvzl6p33wkCGXESDHlQ3cA QLYEssWTH0NNKA6MujcMqcDtwtZUIPHXlzgfEoqidhuIFDrukZiXF3fc6YJQ8kjMySu8 NebpPMSQb5iw9kxhtfIZlA0xZ7LPFfevVj65sGLM8sGxNcyYG1V9gY5jSV9hLhzDGtkj n8sp/sVYxh+e5HHZ/VX75HDY2Epplk04r5QScc6JbJm385sjjwKFWaFu1S+M6aO7UDfh 1uNA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=BTrrIY/dCtCcuG4IBfeWAjogpXCm6CGFAnP3niGoTts=; b=CX+jxxSkj6ONWL8Wd9mqUZvaZZ0Ip6m8xFfsIkB0gMcQCo2IHVfcAreskpZr77h5bG RB+j9Oz57RThd/rbv5HKvZkaVGsWTtW+ySk1QUDzh/fSrx4giePKTqbqlJOoxH3IqkvQ +T/WJJrRDKxRUyiAWE8VVgODidJvniq5WB1RVWe70gVmtSKP/LXBwGTDdKMb3DuD6v2V P/X3q6zTX87oLEX9rOaWIwMC1tu/Ih9f4PTr+OYtatVrhw1kg0xiAQzerOoXv2nVa82b ysSz47LJWxhmEatQuFC23P3Wt7h18xcoGmzsoIfHtk9k6ZT5Y0ZOKIyqOgOrGWGP9Wzs MJZQ== X-Gm-Message-State: APf1xPAAyt0/vlZ2jKjlhC0RHoXj18buUGcNeWuDFNBN8tL8MP/IOooI HuGPSkdVpLfOHTNivJztLpjCr5dtvoEGNtpe9u7gEQ== X-Google-Smtp-Source: AH8x225kTV2bR8lvQKPp+N0LullcDdmyhC7CRXP5oM0XHYIxzuykzqpig2BhqvlOPtSRKfdhyvakjck38TTIBngoXfA= X-Received: by 10.36.54.66 with SMTP id l63mr6078740itl.50.1518451653713; Mon, 12 Feb 2018 08:07:33 -0800 (PST) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.201.67 with HTTP; Mon, 12 Feb 2018 08:07:32 -0800 (PST) X-Originating-IP: [50.253.99.174] In-Reply-To: <20180212155749.GA27160@britannica.bec.de> References: <201802121448.w1CEmEUX082701@repo.freebsd.org> <20180212155749.GA27160@britannica.bec.de> From: Warner Losh Date: Mon, 12 Feb 2018 09:07:32 -0700 X-Google-Sender-Auth: NtApJwrOUejAnqZxKCpiFBuQ_a8 Message-ID: Subject: Re: svn commit: r329164 - in head: include sys/amd64/include sys/i386/include sys/mips/include sys/powerpc/include sys/sparc64/include To: Joerg Sonnenberger Cc: Warner Losh , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.25 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Feb 2018 16:07:35 -0000 On Mon, Feb 12, 2018 at 8:57 AM, Joerg Sonnenberger wrote: > On Mon, Feb 12, 2018 at 02:48:14PM +0000, Warner Losh wrote: > > Author: imp > > Date: Mon Feb 12 14:48:14 2018 > > New Revision: 329164 > > URL: https://svnweb.freebsd.org/changeset/base/329164 > > > > Log: > > We don't support gcc < 4.2.1, so varargs.h now is just #error > > always. Unifdef for versions prior to 4.2.1 and remove now-unused > > header files. > > In my experience it is better to really drop it. Keeping the header with > an #error is just creating *more* pain than having no header at all. > My change didn't change anything here. It already was a #error. I just changed it from #if #error #endif to #error. I'll leave it to the compliance folks to jump in and remove it. It's a posix header, it seems. But nobody is using it and it can't be causing widespread problems today or it would be on people's radar... It's not. Warner From owner-svn-src-all@freebsd.org Mon Feb 12 16:25:57 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9ADCCF057B7; Mon, 12 Feb 2018 16:25:57 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CB457D42A; Mon, 12 Feb 2018 16:25:57 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 432611451F; Mon, 12 Feb 2018 16:25:57 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1CGPv5l034019; Mon, 12 Feb 2018 16:25:57 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1CGPu81034017; Mon, 12 Feb 2018 16:25:56 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201802121625.w1CGPu81034017@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Mon, 12 Feb 2018 16:25:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329170 - in head/sys: kern sys X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: in head/sys: kern sys X-SVN-Commit-Revision: 329170 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Feb 2018 16:25:57 -0000 Author: ian Date: Mon Feb 12 16:25:56 2018 New Revision: 329170 URL: https://svnweb.freebsd.org/changeset/base/329170 Log: Replace the existing print_ct() private debugging function with a set of three public functions to format and print the three major data structures used by realtime clock drivers (clocktime, bcd_clocktime, and timespec). Modified: head/sys/kern/subr_clock.c head/sys/sys/clock.h Modified: head/sys/kern/subr_clock.c ============================================================================== --- head/sys/kern/subr_clock.c Mon Feb 12 15:48:12 2018 (r329169) +++ head/sys/kern/subr_clock.c Mon Feb 12 16:25:56 2018 (r329170) @@ -108,6 +108,14 @@ static const int recent_base_year = 2017; static const int recent_base_days = 17167; /* + * Table to 'calculate' pow(10, 9 - nsdigits) via lookup of nsdigits. + * Before doing the lookup, the code asserts 0 <= nsdigits <= 9. + */ +static u_int nsdivisors[] = { + 1000000000, 100000000, 10000000, 1000000, 100000, 10000, 1000, 100, 10, 1 +}; + +/* * This inline avoids some unnecessary modulo operations * as compared with the usual macro: * ( ((year % 4) == 0 && @@ -131,23 +139,15 @@ leapyear(int year) return (rv); } -static void -print_ct(const struct clocktime *ct) -{ - printf("[%04d-%02d-%02d %02d:%02d:%02d]", - ct->year, ct->mon, ct->day, - ct->hour, ct->min, ct->sec); -} - int clock_ct_to_ts(const struct clocktime *ct, struct timespec *ts) { int i, year, days; if (ct_debug) { - printf("ct_to_ts("); - print_ct(ct); - printf(")"); + printf("ct_to_ts(["); + clock_print_ct(ct, 9); + printf("])"); } /* @@ -288,10 +288,10 @@ clock_ts_to_ct(const struct timespec *ts, struct clock ct->sec = rsec; ct->nsec = ts->tv_nsec; if (ct_debug) { - printf("ts_to_ct(%jd.%09ld) = ", + printf("ts_to_ct(%jd.%09ld) = [", (intmax_t)ts->tv_sec, ts->tv_nsec); - print_ct(ct); - printf("\n"); + clock_print_ct(ct, 9); + printf("]\n"); } KASSERT(ct->year >= 0 && ct->year < 10000, @@ -335,6 +335,51 @@ clock_ts_to_bcd(const struct timespec *ts, struct bcd_ bct->sec = TOBCD(ct.sec); bct->dow = ct.dow; bct->nsec = ct.nsec; +} + +void +clock_print_bcd(const struct bcd_clocktime *bct, int nsdigits) +{ + + KASSERT(nsdigits >= 0 && nsdigits <= 9, ("bad nsdigits %d", nsdigits)); + + if (nsdigits > 0) { + printf("%4.4x-%2.2x-%2.2x %2.2x:%2.2x:%2.2x.%*.*ld", + bct->year, bct->mon, bct->day, + bct->hour, bct->min, bct->sec, + nsdigits, nsdigits, bct->nsec / nsdivisors[nsdigits]); + } else { + printf("%4.4x-%2.2x-%2.2x %2.2x:%2.2x:%2.2x", + bct->year, bct->mon, bct->day, + bct->hour, bct->min, bct->sec); + } +} + +void +clock_print_ct(const struct clocktime *ct, int nsdigits) +{ + + KASSERT(nsdigits >= 0 && nsdigits <= 9, ("bad nsdigits %d", nsdigits)); + + if (nsdigits > 0) { + printf("%04d-%02d-%02d %02d:%02d:%02d.%*.*ld", + ct->year, ct->mon, ct->day, + ct->hour, ct->min, ct->sec, + nsdigits, nsdigits, ct->nsec / nsdivisors[nsdigits]); + } else { + printf("%04d-%02d-%02d %02d:%02d:%02d", + ct->year, ct->mon, ct->day, + ct->hour, ct->min, ct->sec); + } +} + +void +clock_print_ts(const struct timespec *ts, int nsdigits) +{ + struct clocktime ct; + + clock_ts_to_ct(ts, &ct); + clock_print_ct(&ct, nsdigits); } int Modified: head/sys/sys/clock.h ============================================================================== --- head/sys/sys/clock.h Mon Feb 12 15:48:12 2018 (r329169) +++ head/sys/sys/clock.h Mon Feb 12 16:25:56 2018 (r329170) @@ -182,6 +182,15 @@ void timespec2fattime(const struct timespec *tsp, int void fattime2timespec(unsigned dd, unsigned dt, unsigned dh, int utc, struct timespec *tsp); +/* + * Print a [bcd_]clocktime or timespec, optionally with fractional seconds. The + * nsdig argument can range from 0-9, and specifies how many decimal digits to + * display for fractional seconds. + */ +void clock_print_bcd(const struct bcd_clocktime *bct, int nsdig); +void clock_print_ct(const struct clocktime *ct, int nsdig); +void clock_print_ts(const struct timespec *ts, int nsdig); + #endif /* _KERNEL */ #endif /* !_SYS_CLOCK_H_ */ From owner-svn-src-all@freebsd.org Mon Feb 12 16:39:18 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 15237F0698F; Mon, 12 Feb 2018 16:39:18 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-it0-f52.google.com (mail-it0-f52.google.com [209.85.214.52]) (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 A6A097DEA9; Mon, 12 Feb 2018 16:39:17 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-it0-f52.google.com with SMTP id d10so1285206itj.2; Mon, 12 Feb 2018 08:39:17 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:reply-to:in-reply-to:references :from:date:message-id:subject:to:cc; bh=9LuoQ/EAiVpG2uwB/uTY3xAkNnIo4wiBv3WGZchhiAk=; b=GgQS+LCdfkF/6huGbEeAnGyY20EhIb/koya4F8Ps6zrErH6i8iOF1lrW3fbCcP/oM0 ysuPfToP9zlu7YUJw196EJ7/BKia7ThzmQE7g52XrhiX2eXwWtl6tjjf85749CjdVWFU FfvQNGKxNH73UkLd25cdcHb6B3HzlHXmObD917VMc1D+ovhdV/rEeeCmMulW5EulKC8V kVAav1YzXOCvCtBmOKYEx0vByAyS9ywc4JUXfV9GHBmIh+y8p319lil6k9aXgXxnlRHA SMSp3C5+hQ8UXLu1e2sktTe0ZU/4KrAtwFQL5q/D07yUAEDW6B2weA3KmfV5CxOkpo9t KaJQ== X-Gm-Message-State: APf1xPCcvNTpBBeOsj/X9XJ4LsyXVHX/Rah3LJgmQ56NLkHs2dqn9TZ5 0bW6K1kml0gbYgnvdbZOnCjSoXaI X-Google-Smtp-Source: AH8x224FH6yp0K2sFvF0keA5XoDZC3W84qOTwb9cz3sBP6ilsaQotjn/4tZCXts6UcBYLlhICS7nRg== X-Received: by 10.36.105.138 with SMTP id e132mr6131898itc.137.1518453556514; Mon, 12 Feb 2018 08:39:16 -0800 (PST) Received: from mail-it0-f45.google.com (mail-it0-f45.google.com. [209.85.214.45]) by smtp.gmail.com with ESMTPSA id s8sm7712170itb.39.2018.02.12.08.39.16 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 12 Feb 2018 08:39:16 -0800 (PST) Received: by mail-it0-f45.google.com with SMTP id k6so7209448ita.3; Mon, 12 Feb 2018 08:39:16 -0800 (PST) X-Received: by 10.36.192.131 with SMTP id u125mr6134567itf.119.1518453556052; Mon, 12 Feb 2018 08:39:16 -0800 (PST) MIME-Version: 1.0 Reply-To: cem@freebsd.org Received: by 10.2.30.149 with HTTP; Mon, 12 Feb 2018 08:39:15 -0800 (PST) In-Reply-To: <201802120655.w1C6tmCO080469@slippy.cwsent.com> References: <201802120651.w1C6pKqF042318@repo.freebsd.org> <201802120655.w1C6tmCO080469@slippy.cwsent.com> From: Conrad Meyer Date: Mon, 12 Feb 2018 08:39:15 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r329154 - in head/etc: defaults devd To: Cy Schubert Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Feb 2018 16:39:18 -0000 On Sun, Feb 11, 2018 at 10:55 PM, Cy Schubert wrote: > We might want to consider > moving devmatch to /sbin or document that /usr and / be merged. +1. Installing base to a single filesystem image is not a hardship and makes many things simpler. Base is not so large that this is as costly as it was in the 1970s. It doesn't have to apply retroactively, of course, but maybe support can be follow the usual deprecation process. Administrators can still keep separate /usr/local, /usr/src, /usr/obj, /var/log, etc, as Andriy suggests. None of these impact the functioning of the early base system nearly so badly as /usr/*bin, /usr/share, and /usr/lib. The other option is just putting all the base libraries and binaries in /lib and /*bin (unfortunately, I don't think /share exists). The current sorting of items into /usr or not /usr is haphazard. Best, Conrad From owner-svn-src-all@freebsd.org Mon Feb 12 17:27:50 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9C189F0A9F3; Mon, 12 Feb 2018 17:27:50 +0000 (UTC) (envelope-from jtl@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 52820803BE; Mon, 12 Feb 2018 17:27:50 +0000 (UTC) (envelope-from jtl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4D8AB14EE6; Mon, 12 Feb 2018 17:27:50 +0000 (UTC) (envelope-from jtl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1CHRoR6063773; Mon, 12 Feb 2018 17:27:50 GMT (envelope-from jtl@FreeBSD.org) Received: (from jtl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1CHRo1I063772; Mon, 12 Feb 2018 17:27:50 GMT (envelope-from jtl@FreeBSD.org) Message-Id: <201802121727.w1CHRo1I063772@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jtl set sender to jtl@FreeBSD.org using -f From: "Jonathan T. Looney" Date: Mon, 12 Feb 2018 17:27:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329171 - head/sys/amd64/amd64 X-SVN-Group: head X-SVN-Commit-Author: jtl X-SVN-Commit-Paths: head/sys/amd64/amd64 X-SVN-Commit-Revision: 329171 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Feb 2018 17:27:50 -0000 Author: jtl Date: Mon Feb 12 17:27:50 2018 New Revision: 329171 URL: https://svnweb.freebsd.org/changeset/base/329171 Log: Mark the pages used for the initial page-table entries as wired. This makes them consistent with the way other page-table pages are allocated. It also provides the rest of the VM system a good clue that these pages are used. Reviewed by: alc, kib, markj Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D14269 Modified: head/sys/amd64/amd64/pmap.c Modified: head/sys/amd64/amd64/pmap.c ============================================================================== --- head/sys/amd64/amd64/pmap.c Mon Feb 12 16:25:56 2018 (r329170) +++ head/sys/amd64/amd64/pmap.c Mon Feb 12 17:27:50 2018 (r329171) @@ -1244,7 +1244,9 @@ pmap_init(void) ("pmap_init: page table page is out of range")); mpte->pindex = pmap_pde_pindex(KERNBASE) + i; mpte->phys_addr = KPTphys + (i << PAGE_SHIFT); + mpte->wire_count = 1; } + atomic_add_int(&vm_cnt.v_wire_count, nkpt); /* * If the kernel is running on a virtual machine, then it must assume From owner-svn-src-all@freebsd.org Mon Feb 12 17:29:09 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BCB9BF0ABC5; Mon, 12 Feb 2018 17:29:09 +0000 (UTC) (envelope-from jonlooney@gmail.com) Received: from mail-wr0-x234.google.com (mail-wr0-x234.google.com [IPv6:2a00:1450:400c:c0c::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 3A3E3805A0; Mon, 12 Feb 2018 17:29:09 +0000 (UTC) (envelope-from jonlooney@gmail.com) Received: by mail-wr0-x234.google.com with SMTP id k9so2235952wre.9; Mon, 12 Feb 2018 09:29:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=KJyPgrLSJv2MRVwEjilf5JZVdbWfzsAZvYejWwgD/7o=; b=mX6egFpu25eZXXYPQstSvUWJJxjCW1YiV0HBXHomeNR4ooDf/YgWB5kXlG5xnBIqWg RFmiKOpu8s1QSRgThQe1fEQxRtCGZ4suJyuqvFw2s+bMUM4Uy21s2YHPC3xVYEbHkVO1 itIudwtFSDissXeFFJGkBrWHvO3LjdIYWOZRfoCZebEAgu/oskLI2JMvI1p5zdYL+3KE 8zRGBD0HaVTsp0QlNMr1sj5+JRWM+cbzubahQLRg0kCwtjqEYOGnAXV40glJVx61A1uD lhBuRqYpLCMy3InlaM/qxQXVDmwIYQg8FZH2d8ntM41ooMCNluHXIf5uu2iounHFNkmC y4NA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to; bh=KJyPgrLSJv2MRVwEjilf5JZVdbWfzsAZvYejWwgD/7o=; b=oMXzI5X6P+vqSM53dV8B40ZJHEGKa9amy3ZlDU3I2r8Hln/0PRS0Gwhz93e/bVy/z2 z/T5RwBiBMTLWZGz89xwtxVYDQUyI428oJWFPZuwWPKdnjgNt5xVbfBF4Z+l3Nk2DpL5 HEZhcCqChmROx9meSXy5rj1zmUci9brTuOEnCPYJgf2x1jcNVYZBHkyktTImD6sJFZKD c5hzrXIs2nhRY3TiJXI4zZT4RAehqaaIE8H6mwyXIMfbYxMpws0f9FzbA24C0c7yRpX3 wib59dmBrmH5PqOUA6ZH2tBzfktsBTYyBMYdXFy1/3NFp0OXf9zL+dtLDfvqhC9uZuH8 8kmw== X-Gm-Message-State: APf1xPAw5dV8K2V5ilLijn2opkWCi6Qbbv9iSO95bdU276FJp/qHSj2F k4acvFnDurefVI/z45sMZhCpl67e7PPaQGP478BQAw== X-Google-Smtp-Source: AH8x225HXufrU+xAxFuNdFOAZ13bH8noQW8ePj9nuEGBFc71wGQgrErrXggB30Ky8usO66hX3va8LTLiYSSftx8xfdw= X-Received: by 10.223.132.166 with SMTP id 35mr10404664wrg.183.1518456547997; Mon, 12 Feb 2018 09:29:07 -0800 (PST) MIME-Version: 1.0 Received: by 10.223.192.76 with HTTP; Mon, 12 Feb 2018 09:29:07 -0800 (PST) In-Reply-To: <201802121727.w1CHRo1I063772@repo.freebsd.org> References: <201802121727.w1CHRo1I063772@repo.freebsd.org> From: Jonathan Looney Date: Mon, 12 Feb 2018 12:29:07 -0500 Message-ID: Subject: Re: svn commit: r329171 - head/sys/amd64/amd64 To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.25 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Feb 2018 17:29:10 -0000 On Mon, Feb 12, 2018 at 12:27 PM, Jonathan T. Looney wrote: > Author: jtl > Date: Mon Feb 12 17:27:50 2018 > New Revision: 329171 > URL: https://svnweb.freebsd.org/changeset/base/329171 > > Log: > Mark the pages used for the initial page-table entries as wired. This > makes them consistent with the way other page-table pages are allocated. > It also provides the rest of the VM system a good clue that these pages > are used. > > Reviewed by: alc, kib, markj > Sponsored by: Netflix > Differential Revision: https://reviews.freebsd.org/D14269 Should have also said... MFC after: 2 weeks From owner-svn-src-all@freebsd.org Mon Feb 12 17:33:16 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CF50DF0B298; Mon, 12 Feb 2018 17:33:15 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7083680BE7; Mon, 12 Feb 2018 17:33:15 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4BA5615083; Mon, 12 Feb 2018 17:33:15 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1CHXF1W068959; Mon, 12 Feb 2018 17:33:15 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1CHXF9N068957; Mon, 12 Feb 2018 17:33:15 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201802121733.w1CHXF9N068957@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Mon, 12 Feb 2018 17:33:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329172 - in head/sys: kern sys X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: in head/sys: kern sys X-SVN-Commit-Revision: 329172 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Feb 2018 17:33:16 -0000 Author: ian Date: Mon Feb 12 17:33:14 2018 New Revision: 329172 URL: https://svnweb.freebsd.org/changeset/base/329172 Log: Add a set of convenience routines for RTC drivers to use for debug output, and a debug.clock_show_io sysctl to control debugging output. Modified: head/sys/kern/subr_rtc.c head/sys/sys/clock.h Modified: head/sys/kern/subr_rtc.c ============================================================================== --- head/sys/kern/subr_rtc.c Mon Feb 12 17:27:50 2018 (r329171) +++ head/sys/kern/subr_rtc.c Mon Feb 12 17:33:14 2018 (r329172) @@ -76,6 +76,10 @@ __FBSDID("$FreeBSD$"); #include "clock_if.h" +static int show_io; +SYSCTL_INT(_debug, OID_AUTO, clock_show_io, CTLFLAG_RWTUN, &show_io, 0, + "Enable debug printing of RTC clock I/O; 1=reads, 2=writes, 3=both."); + /* XXX: should be kern. now, it's no longer machdep. */ static int disable_rtc_set; SYSCTL_INT(_machdep, OID_AUTO, disable_rtc_set, CTLFLAG_RW, &disable_rtc_set, @@ -142,6 +146,60 @@ settime_task_func(void *arg, int pending) ts.tv_nsec = 0; } CLOCK_SETTIME(rtc->clockdev, &ts); +} + +static void +clock_dbgprint_hdr(device_t dev, int rw) +{ + struct timespec now; + + getnanotime(&now); + device_printf(dev, "%s at ", (rw & CLOCK_DBG_READ) ? "read " : "write"); + clock_print_ts(&now, 9); + printf(": "); +} + +void +clock_dbgprint_bcd(device_t dev, int rw, const struct bcd_clocktime *bct) +{ + + if (show_io & rw) { + clock_dbgprint_hdr(dev, rw); + clock_print_bcd(bct, 9); + printf("\n"); + } +} + +void +clock_dbgprint_ct(device_t dev, int rw, const struct clocktime *ct) +{ + + if (show_io & rw) { + clock_dbgprint_hdr(dev, rw); + clock_print_ct(ct, 9); + printf("\n"); + } +} + +void +clock_dbgprint_err(device_t dev, int rw, int err) +{ + + if (show_io & rw) { + clock_dbgprint_hdr(dev, rw); + printf("error = %d\n", err); + } +} + +void +clock_dbgprint_ts(device_t dev, int rw, const struct timespec *ts) +{ + + if (show_io & rw) { + clock_dbgprint_hdr(dev, rw); + clock_print_ts(ts, 9); + printf("\n"); + } } void Modified: head/sys/sys/clock.h ============================================================================== --- head/sys/sys/clock.h Mon Feb 12 17:27:50 2018 (r329171) +++ head/sys/sys/clock.h Mon Feb 12 17:33:14 2018 (r329172) @@ -191,6 +191,18 @@ void clock_print_bcd(const struct bcd_clocktime *bct, void clock_print_ct(const struct clocktime *ct, int nsdig); void clock_print_ts(const struct timespec *ts, int nsdig); +/* + * Debugging helpers for RTC clock drivers. Print a [bcd_]clocktime or + * timespec, only if rtc clock debugging has been enabled. The rw argument is + * one of CLOCK_DBG_READ or CLOCK_DBG_WRITE. + */ +#define CLOCK_DBG_READ 0x01 +#define CLOCK_DBG_WRITE 0x02 +void clock_dbgprint_bcd(device_t dev, int rw, const struct bcd_clocktime *bct); +void clock_dbgprint_ct(device_t dev, int rw, const struct clocktime *ct); +void clock_dbgprint_err(device_t dev, int rw, int err); +void clock_dbgprint_ts(device_t dev, int rw, const struct timespec *ts); + #endif /* _KERNEL */ #endif /* !_SYS_CLOCK_H_ */ From owner-svn-src-all@freebsd.org Mon Feb 12 17:41:12 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0A63EF0BD27; Mon, 12 Feb 2018 17:41:12 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B4A94810E2; Mon, 12 Feb 2018 17:41:11 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AF93F150BD; Mon, 12 Feb 2018 17:41:11 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1CHfBlP069972; Mon, 12 Feb 2018 17:41:11 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1CHfBWa069971; Mon, 12 Feb 2018 17:41:11 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201802121741.w1CHfBWa069971@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Mon, 12 Feb 2018 17:41:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329173 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 329173 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Feb 2018 17:41:12 -0000 Author: ian Date: Mon Feb 12 17:41:11 2018 New Revision: 329173 URL: https://svnweb.freebsd.org/changeset/base/329173 Log: Add a new sysctl, debug.clock_do_io, to allow manully triggering a one-shot read or write of all registered realtime clocks. In the read case, the values read are simply discarded. For writes, there's no alternative but to actually write the current system time to the device. Modified: head/sys/kern/subr_rtc.c Modified: head/sys/kern/subr_rtc.c ============================================================================== --- head/sys/kern/subr_rtc.c Mon Feb 12 17:33:14 2018 (r329172) +++ head/sys/kern/subr_rtc.c Mon Feb 12 17:41:11 2018 (r329173) @@ -80,6 +80,11 @@ static int show_io; SYSCTL_INT(_debug, OID_AUTO, clock_show_io, CTLFLAG_RWTUN, &show_io, 0, "Enable debug printing of RTC clock I/O; 1=reads, 2=writes, 3=both."); +static int sysctl_clock_do_io(SYSCTL_HANDLER_ARGS); +SYSCTL_PROC(_debug, OID_AUTO, clock_do_io, CTLTYPE_INT | CTLFLAG_RW, + 0, 0, sysctl_clock_do_io, "I", + "Trigger one-time IO on RTC clocks; 1=read (and discard), 2=write"); + /* XXX: should be kern. now, it's no longer machdep. */ static int disable_rtc_set; SYSCTL_INT(_machdep, OID_AUTO, disable_rtc_set, CTLFLAG_RW, &disable_rtc_set, @@ -280,6 +285,36 @@ clock_schedule(device_t clockdev, u_int offsetns) sx_xunlock(&rtc_list_lock); } +static int +read_clocks(struct timespec *ts, bool debug_read) +{ + struct rtc_instance *rtc; + int error; + + error = ENXIO; + sx_xlock(&rtc_list_lock); + LIST_FOREACH(rtc, &rtc_list, rtc_entries) { + if ((error = CLOCK_GETTIME(rtc->clockdev, ts)) != 0) + continue; + if (ts->tv_sec < 0 || ts->tv_nsec < 0) { + error = EINVAL; + continue; + } + if (!(rtc->flags & CLOCKF_GETTIME_NO_ADJ)) { + timespecadd(ts, &rtc->resadj); + ts->tv_sec += utc_offset(); + } + if (!debug_read) { + if (bootverbose) + device_printf(rtc->clockdev, + "providing initial system time\n"); + break; + } + } + sx_xunlock(&rtc_list_lock); + return (error); +} + /* * Initialize the system time. Must be called from a context which does not * restrict any locking or sleeping that clock drivers may need to do. @@ -296,28 +331,9 @@ void inittodr(time_t base) { struct timespec ts; - struct rtc_instance *rtc; int error; - error = ENXIO; - sx_xlock(&rtc_list_lock); - LIST_FOREACH(rtc, &rtc_list, rtc_entries) { - if ((error = CLOCK_GETTIME(rtc->clockdev, &ts)) != 0) - continue; - if (ts.tv_sec < 0 || ts.tv_nsec < 0) { - error = EINVAL; - continue; - } - if (!(rtc->flags & CLOCKF_GETTIME_NO_ADJ)) { - timespecadd(&ts, &rtc->resadj); - ts.tv_sec += utc_offset(); - } - if (bootverbose) - device_printf(rtc->clockdev, - "providing initial system time\n"); - break; - } - sx_xunlock(&rtc_list_lock); + error = read_clocks(&ts, false); /* * Do not report errors from each clock; it is expected that some clocks @@ -379,4 +395,30 @@ resettodr(void) &rtc->stask, -sbt, 0, C_PREL(31)); } sx_xunlock(&rtc_list_lock); +} + +static int +sysctl_clock_do_io(SYSCTL_HANDLER_ARGS) +{ + struct timespec ts_discard; + int error, value; + + value = 0; + error = sysctl_handle_int(oidp, &value, 0, req); + if (error != 0 || req->newptr == NULL) + return (error); + + switch (value) { + case CLOCK_DBG_READ: + if (read_clocks(&ts_discard, true) == ENXIO) + printf("No registered RTC clocks\n"); + break; + case CLOCK_DBG_WRITE: + resettodr(); + break; + default: + return (EINVAL); + } + + return (0); } From owner-svn-src-all@freebsd.org Mon Feb 12 17:42:29 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0F6BAF0BF3F; Mon, 12 Feb 2018 17:42:29 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B618481378; Mon, 12 Feb 2018 17:42:28 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B10A315212; Mon, 12 Feb 2018 17:42:28 +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 w1CHgSmp072923; Mon, 12 Feb 2018 17:42:28 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1CHgSTd072922; Mon, 12 Feb 2018 17:42:28 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201802121742.w1CHgSTd072922@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Mon, 12 Feb 2018 17:42:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329174 - head/sys/sys X-SVN-Group: head X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: head/sys/sys X-SVN-Commit-Revision: 329174 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Feb 2018 17:42:29 -0000 Author: asomers Date: Mon Feb 12 17:42:28 2018 New Revision: 329174 URL: https://svnweb.freebsd.org/changeset/base/329174 Log: Fix a comment. No functional change. MFC after: 3 weeks Sponsored by: Spectra Logic Corp Modified: head/sys/sys/aio.h Modified: head/sys/sys/aio.h ============================================================================== --- head/sys/sys/aio.h Mon Feb 12 17:41:11 2018 (r329173) +++ head/sys/sys/aio.h Mon Feb 12 17:42:28 2018 (r329174) @@ -54,7 +54,7 @@ #define LIO_WAIT 0x1 /* - * Maximum number of allowed LIO operations + * Maximum number of operations in a single lio_listio call */ #define AIO_LISTIO_MAX 16 From owner-svn-src-all@freebsd.org Mon Feb 12 17:44:39 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2D98BF0C20D; Mon, 12 Feb 2018 17:44:39 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AAEC781736; Mon, 12 Feb 2018 17:44:38 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A0D4315219; Mon, 12 Feb 2018 17:44:38 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1CHic0m073996; Mon, 12 Feb 2018 17:44:38 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1CHiZmV073963; Mon, 12 Feb 2018 17:44:35 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201802121744.w1CHiZmV073963@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Mon, 12 Feb 2018 17:44:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r329175 - in stable/11: contrib/compiler-rt/lib/builtins lib/libc/stdlib stand stand/arm/uboot stand/common stand/efi/boot1 stand/efi/include stand/efi/libefi stand/efi/loader stand/fic... X-SVN-Group: stable-11 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in stable/11: contrib/compiler-rt/lib/builtins lib/libc/stdlib stand stand/arm/uboot stand/common stand/efi/boot1 stand/efi/include stand/efi/libefi stand/efi/loader stand/ficl stand/geli stand/i386 s... X-SVN-Commit-Revision: 329175 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Feb 2018 17:44:39 -0000 Author: kevans Date: Mon Feb 12 17:44:35 2018 New Revision: 329175 URL: https://svnweb.freebsd.org/changeset/base/329175 Log: MFC Loader Fixes 2017q4p7: r324844,r326089,r326926,r326440,r326484,r326494, r326588,r326708,r326784,r326914,r327390,r328446,r326090,r326143,r326144, r326182,r326384,r326421,r326440,r326441,r326442,r326443,r326444,r326445, r326446,r326447,r326448,r326484,r326485,r326486,r326487,r326488,r326490, r326491,r326492,r326493,r326494,r326495,r326504,r326507,r326509,r326584, r326585,r326586,r326587,r326588,r326589,r326590,r326591,r326592,r326593, r326594,r326600,r326616,r326671,r326707,r326708,r326709,r326710,r326711, r326712,r326714,r326720,r326768,r326772,r326784,r326792,r326812,r326854, r326855,r326856,r326858,r326886,r326887,r326914,r326926,r326927,r326960, r326961,r326962,r326963,r327351,r327453,r327390,r327523,r327524,r326489, r327880,r328437,r328438,r328439,r328441,r328446,r328448,r328449,r328612, r328613,r328615 While here, undo our libfdt hack of not including if we're compiling _STANDALONE. r324844: When building standalone, don't define errno. Let the definition from stand.h override. This is similar to what we do in the kernel. r326089: loader.efi: efipart does not recognize partitionless disks r326090: net_parse_rootpath() has no parameters r326143: Fix theoretical integer overflow issues. If the product here is r326144: Mark the func pointer as __dead2. It looks up loader_main, which r326182: Modify all FreeBSD bootloaders on PowerPC AIM (Book-S) systems r326384: Use const pointers to avoid casting away constness. r326421: loader.efi: efipart should exclude iPXE stub block protocol r326440: Remove stale dependency on ufsread.c r326441: Minor flags cleanup r326442: Cleanup CFALGS usage here r326443: We don't need both _STAND and _STANDALONE, use the latter. r326444: Move geli to common DO32 stuff r326445: Fix random() and srandom() prototypes to match the standard. r326446: Undefine _STANDALONE since this is test code. r326447: Tweaks to the beri boot loader so that it builds w/o warnings. r326448: Fix all warnings related to geli and ZFS support on x86. r326484: Const poison the propname. r326485: Delcare md_load in libofw.h. Make all prototypes match for ofw r326486: Include machine/md_var to pick up __syncicache prototype. r326487: Cast mdp (a vm_offset_t) to void * to match prototype. r326488: e_entry can be smaller than a pointer. Cast it to an intptr_t r326490: Declare our strange brand of main(). r326491: Disconnet ps3 from the build. There's too many warnings to fix. r326492: Cast void * pointer to char * so the arg matches the %s format. r326493: Provide a md_load64 prototype. r326494: Mark two things as unused (since they are only sometimes used) r326495: Now it's safe to bump WARNS to 1. r326504: Switch to proper MK_LOADER_GELI tests. r326507: increase maximum size of zfsboot r326509: loader.efi: add note about iPXE into the efipart.c r326584: When building standalone, include stand.h rather than the kernel r326585: Include ficl.h before anything else r326586: No need to include the userland md5.h, the kernel one is just fine. r326587: Use the kernel relative paths, rather than the userland relative paths r326588: Need to include skein in the include path r326589: Make sure we include the right path for skein.h r326590: Prefer stdint.h to inttypes.h r326591: This isn't NetBSD specific code. Include these for any kernel / r326592: Don't inherit CFLAGS. This a specialized test program. r326593: Stop building with the standard system headers. r326594: Now that we offer a semi-sane standards-ish set of #include files, stop hacking includes with sed. r326600: Since this is contrib code, create an upstreamable version of my r326616: dhcp_try_rfc1048() is not used any more r326671: Avoid setting -Wno-tentative-definition-incomplete-type with gcc. r326707: Add partial support signal.h functioanlity. Pull in machine/signal.h r326708: Remove _KERNEL hack now that errno.h does the right thing when built standalone. r326709: Provide implementations for iscntrl, ispunct and isgraph. r326710: Put the files we're copying over into a few variables and clean hings up. r326711: Const poison a couple of interfaces. r326712: Create interp class. r326714: boot1.c needs EFI_ZFS_BOOT too, so add it globally. r326720: This path belongs in ficl/Makefile, not the common defines for users r326768: Fix a comment to be more accurate r326772: Fix regression with lua import r326784: Revert part of 362772. It was causing problems for includes r326792: Attempt to unbreak buildworld r326812: Revert r326792, r326784, r326772, r326712 r326854: libefi: make efichar.h more usable in stand code r326855: Cargo cut a fix for the regressions r326585 caused. r326856: Fix comments after bump in size. r326858: Revert r326855: Cargo cut a fix for the regressions r326585 caused. r326886: Panic in sbrk if setheap hasn't been called yet. This is preferable o a mysterious crash r326887: Remove the 'mini libstand in libstand' that util.[ch] provided. r326914: Move loader-only defines to loader.mk from defs.mk r326926: Move loader help file definitions to being 100% inside of loader.mk. r326927: libficl is only ever used in a loader (never a boot) program. Move it. r326960: Simplify things a little. The RETURN macro isn't required. r326961: Interact is always called with NULL. Simplify code a little r326962: Hoist btx include stuff to i386/Makefile.inc r326963: No need to use relative paths like this here. r327351: Fix ubldr. uboot/lib uses defines for the loader. r327453: Add a validbcd() routine that uses the bcd2bin_data[] array r327390: Garbage-collect loader.ps3. It is currently disconnected from the build and kboot replaces. r327523: Don't clobber system LDFLAGS for beri boot loaders. r327524: Use 'extern uint8_t' instead of 'extern void' for external symbols. r326489: Allow this file to be used in libsa without warning... r327880: Move getsecs() prototype to stand.h from net.h so it can be used r328437: Split panic routine r328438: Implement abort() as a call to panic. r328439: Provide abs form stdlib.h. r328441: abort() should be marked __dead2 since it won't return. r328446: Now that exit is __dead2, we need to tag ub_exit() as __dead2. r328448: Make exit() never return until host_exit can be written. r328449: Tag unreachable places as such. I left the while (1); in place r328612: Move strtold wrapper from strtol.c to its own strtold.c. r328613: Kill copies of strtol and strtoul. r328615: Update stand.h for changes for strto*l PR: 223969 Added: stable/11/lib/libc/stdlib/strtold.c - copied unchanged from r328612, head/lib/libc/stdlib/strtold.c stable/11/stand/libsa/abort.c - copied unchanged from r328438, head/stand/libsa/abort.c stable/11/stand/libsa/xlocale_private.h - copied unchanged from r328613, head/stand/libsa/xlocale_private.h Deleted: stable/11/stand/libsa/strtol.c stable/11/stand/libsa/strtoul.c stable/11/stand/libsa/util.c stable/11/stand/libsa/util.h stable/11/stand/powerpc/ps3/ Modified: stable/11/contrib/compiler-rt/lib/builtins/int_lib.h stable/11/lib/libc/stdlib/Makefile.inc stable/11/lib/libc/stdlib/strtol.c stable/11/stand/Makefile.amd64 stable/11/stand/Makefile.i386 stable/11/stand/Makefile.inc stable/11/stand/arm/uboot/Makefile stable/11/stand/common/bootstrap.h stable/11/stand/common/dev_net.c stable/11/stand/common/interp.c stable/11/stand/common/interp_backslash.c stable/11/stand/common/interp_forth.c stable/11/stand/common/interp_parse.c stable/11/stand/common/load_elf.c stable/11/stand/common/load_elf_obj.c stable/11/stand/common/reloc_elf.c stable/11/stand/defs.mk stable/11/stand/efi/boot1/Makefile stable/11/stand/efi/boot1/boot1.c stable/11/stand/efi/include/efichar.h stable/11/stand/efi/libefi/Makefile stable/11/stand/efi/libefi/efichar.c stable/11/stand/efi/libefi/efipart.c stable/11/stand/efi/loader/Makefile stable/11/stand/efi/loader/main.c stable/11/stand/ficl.mk stable/11/stand/ficl/Makefile stable/11/stand/ficl/float.c stable/11/stand/geli/Makefile stable/11/stand/geli/geliboot.c stable/11/stand/geli/geliboot_internal.h stable/11/stand/i386/Makefile.inc stable/11/stand/i386/boot2/Makefile stable/11/stand/i386/common/cons.c stable/11/stand/i386/common/drv.c stable/11/stand/i386/gptboot/Makefile stable/11/stand/i386/gptboot/gptboot.c stable/11/stand/i386/gptboot/gptldr.S stable/11/stand/i386/gptzfsboot/Makefile stable/11/stand/i386/libfirewire/Makefile stable/11/stand/i386/libi386/Makefile stable/11/stand/i386/libi386/biosdisk.c stable/11/stand/i386/libi386/multiboot.c stable/11/stand/i386/loader/Makefile stable/11/stand/i386/loader/main.c stable/11/stand/i386/zfsboot/Makefile stable/11/stand/i386/zfsboot/zfsboot.c stable/11/stand/libsa/Makefile stable/11/stand/libsa/bootp.c stable/11/stand/libsa/bootp.h stable/11/stand/libsa/cd9660.c stable/11/stand/libsa/gpt.c stable/11/stand/libsa/net.h stable/11/stand/libsa/panic.c stable/11/stand/libsa/sbrk.c stable/11/stand/libsa/stand.h stable/11/stand/loader.mk stable/11/stand/mips/beri/boot2/Makefile stable/11/stand/mips/beri/boot2/boot2.c stable/11/stand/mips/beri/common/altera_jtag_uart.c stable/11/stand/mips/beri/common/cfi.c stable/11/stand/mips/beri/common/sdcard.c stable/11/stand/mips/beri/loader/Makefile stable/11/stand/mips/beri/loader/devicename.c stable/11/stand/mips/beri/loader/exec.c stable/11/stand/mips/beri/loader/loader.h stable/11/stand/mips/beri/loader/main.c stable/11/stand/mips/uboot/Makefile stable/11/stand/mips/uboot/conf.c stable/11/stand/ofw/common/main.c stable/11/stand/ofw/libofw/elf_freebsd.c stable/11/stand/ofw/libofw/libofw.h stable/11/stand/ofw/libofw/openfirm.c stable/11/stand/ofw/libofw/openfirm.h stable/11/stand/ofw/libofw/ppc64_elf_freebsd.c stable/11/stand/powerpc/Makefile stable/11/stand/powerpc/boot1.chrp/Makefile stable/11/stand/powerpc/boot1.chrp/boot1.c stable/11/stand/powerpc/kboot/Makefile stable/11/stand/powerpc/kboot/host_syscall.h stable/11/stand/powerpc/kboot/hostdisk.c stable/11/stand/powerpc/kboot/kbootfdt.c stable/11/stand/powerpc/kboot/main.c stable/11/stand/powerpc/kboot/ppc64_elf_freebsd.c stable/11/stand/powerpc/ofw/Makefile stable/11/stand/powerpc/ofw/start.c stable/11/stand/powerpc/uboot/Makefile stable/11/stand/sparc64/boot1/Makefile stable/11/stand/sparc64/loader/Makefile stable/11/stand/sparc64/loader/main.c stable/11/stand/sparc64/loader/metadata.c stable/11/stand/uboot/common/main.c stable/11/stand/uboot/lib/glue.c stable/11/stand/uboot/lib/glue.h stable/11/stand/userboot/test/Makefile stable/11/stand/userboot/test/test.c stable/11/stand/userboot/userboot/Makefile stable/11/stand/userboot/userboot/main.c stable/11/stand/zfs/zfsimpl.c stable/11/sys/cddl/boot/zfs/zfssubr.c stable/11/sys/contrib/libfdt/libfdt_env.h stable/11/sys/geom/eli/g_eli_hmac.c stable/11/sys/geom/eli/pkcs5v2.c stable/11/sys/opencrypto/xform_userland.h stable/11/sys/sys/errno.h stable/11/sys/sys/libkern.h stable/11/sys/sys/syslimits.h Directory Properties: stable/11/ (props changed) Modified: stable/11/contrib/compiler-rt/lib/builtins/int_lib.h ============================================================================== --- stable/11/contrib/compiler-rt/lib/builtins/int_lib.h Mon Feb 12 17:42:28 2018 (r329174) +++ stable/11/contrib/compiler-rt/lib/builtins/int_lib.h Mon Feb 12 17:44:35 2018 (r329175) @@ -55,12 +55,16 @@ #define UNUSED __attribute__((unused)) #endif -#if defined(__NetBSD__) && (defined(_KERNEL) || defined(_STANDALONE)) +#if (defined(__FreeBSD__) || defined(__NetBSD__)) && (defined(_KERNEL) || defined(_STANDALONE)) /* * Kernel and boot environment can't use normal headers, * so use the equivalent system headers. */ +#ifdef __FreeBSD__ +# include +#else # include +#endif # include # include #else Modified: stable/11/lib/libc/stdlib/Makefile.inc ============================================================================== --- stable/11/lib/libc/stdlib/Makefile.inc Mon Feb 12 17:42:28 2018 (r329174) +++ stable/11/lib/libc/stdlib/Makefile.inc Mon Feb 12 17:44:35 2018 (r329175) @@ -15,7 +15,7 @@ MISRCS+=C99_Exit.c a64l.c abort.c abs.c atexit.c atof. radixsort.c rand.c \ random.c reallocarray.c reallocf.c realpath.c remque.c \ set_constraint_handler_s.c strfmon.c strtoimax.c \ - strtol.c strtoll.c strtoq.c strtoul.c strtonum.c strtoull.c \ + strtol.c strtold.c strtoll.c strtoq.c strtoul.c strtonum.c strtoull.c \ strtoumax.c strtouq.c system.c tdelete.c tfind.c tsearch.c twalk.c # Work around an issue on case-insensitive file systems. Modified: stable/11/lib/libc/stdlib/strtol.c ============================================================================== --- stable/11/lib/libc/stdlib/strtol.c Mon Feb 12 17:42:28 2018 (r329174) +++ stable/11/lib/libc/stdlib/strtol.c Mon Feb 12 17:44:35 2018 (r329175) @@ -44,7 +44,6 @@ __FBSDID("$FreeBSD$"); #include #include "xlocale_private.h" - /* * Convert a string to a long integer. * @@ -150,9 +149,4 @@ long strtol(const char * __restrict nptr, char ** __restrict endptr, int base) { return strtol_l(nptr, endptr, base, __get_locale()); -} -long double -strtold(const char * __restrict nptr, char ** __restrict endptr) -{ - return strtold_l(nptr, endptr, __get_locale()); } Copied: stable/11/lib/libc/stdlib/strtold.c (from r328612, head/lib/libc/stdlib/strtold.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/lib/libc/stdlib/strtold.c Mon Feb 12 17:44:35 2018 (r329175, copy of r328612, head/lib/libc/stdlib/strtold.c) @@ -0,0 +1,45 @@ +/*- + * SPDX-License-Identifier: BSD-3-Clause + * + * Copyright (c) 2011 The FreeBSD Foundation + * All rights reserved. + * Portions of this software were developed by David Chisnall + * under sponsorship from the FreeBSD Foundation. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. 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. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include "xlocale_private.h" + +long double +strtold(const char * __restrict nptr, char ** __restrict endptr) +{ + + return strtold_l(nptr, endptr, __get_locale()); +} Modified: stable/11/stand/Makefile.amd64 ============================================================================== --- stable/11/stand/Makefile.amd64 Mon Feb 12 17:42:28 2018 (r329174) +++ stable/11/stand/Makefile.amd64 Mon Feb 12 17:44:35 2018 (r329175) @@ -11,7 +11,7 @@ SUBDIR+= ficl32 SUBDIR+= efi SUBDIR+= userboot -.if ${LOADER_GELI_SUPPORT:Uyes} == "yes" +.if ${MK_LOADER_GELI} == "yes" SUBDIR+= geli .endif Modified: stable/11/stand/Makefile.i386 ============================================================================== --- stable/11/stand/Makefile.i386 Mon Feb 12 17:42:28 2018 (r329174) +++ stable/11/stand/Makefile.i386 Mon Feb 12 17:44:35 2018 (r329175) @@ -1,6 +1,6 @@ # $FreeBSD$ -.if ${LOADER_GELI_SUPPORT:Uyes} == "yes" +.if ${MK_LOADER_GELI} == "yes" SUBDIR+= geli .endif .if ${MK_ZFS} != "no" Modified: stable/11/stand/Makefile.inc ============================================================================== --- stable/11/stand/Makefile.inc Mon Feb 12 17:42:28 2018 (r329174) +++ stable/11/stand/Makefile.inc Mon Feb 12 17:44:35 2018 (r329175) @@ -1,53 +1,3 @@ # $FreeBSD$ .include "defs.mk" - -.if !defined(__BOOT_MAKEFILE_INC__) -__BOOT_MAKEFILE_INC__=${MFILE} - -CFLAGS+=-I${SASRC} - -SSP_CFLAGS= - -# Add in the no float / no SIMD stuff and announce we're freestanding -# aarch64 and riscv don't have -msoft-float, but all others do. riscv -# currently has no /boot/loader, but may soon. -CFLAGS+= -ffreestanding ${CFLAGS_NO_SIMD} -.if ${MACHINE_CPUARCH} == "aarch64" -CFLAGS+= -mgeneral-regs-only -.elif ${MACHINE_CPUARCH} != "riscv" -CFLAGS+= -msoft-float -.endif - -.if ${MACHINE_CPUARCH} == "i386" || (${MACHINE_CPUARCH} == "amd64" && ${DO32:U0} == 1) -CFLAGS+= -march=i386 -CFLAGS.gcc+= -mpreferred-stack-boundary=2 -.endif - - -.if ${MACHINE_CPUARCH} == "arm" -# Do not generate movt/movw, because the relocation fixup for them does not -# translate to the -Bsymbolic -pie format required by self_reloc() in loader(8). -# Also, the fpu is not available in a standalone environment. -.if ${COMPILER_VERSION} < 30800 -CFLAGS.clang+= -mllvm -arm-use-movt=0 -.else -CFLAGS.clang+= -mno-movt -.endif -CFLAGS.clang+= -mfpu=none -.endif - -# The boot loader build uses dd status=none, where possible, for reproducible -# build output (since performance varies from run to run). Trouble is that -# option was recently (10.3) added to FreeBSD and is non-standard. Only use it -# when this test succeeds rather than require dd to be a bootstrap tool. -DD_NOSTATUS!=(dd status=none count=0 2> /dev/null && echo status=none) || true -DD=dd ${DD_NOSTATUS} - -.if ${MK_LOADER_FORCE_LE} != "no" -.if ${MACHINE_ARCH} == "powerpc64" -CFLAGS+= -mlittle-endian -.endif -.endif - -.endif Modified: stable/11/stand/arm/uboot/Makefile ============================================================================== --- stable/11/stand/arm/uboot/Makefile Mon Feb 12 17:42:28 2018 (r329174) +++ stable/11/stand/arm/uboot/Makefile Mon Feb 12 17:44:35 2018 (r329175) @@ -28,7 +28,7 @@ SRCS= start.S conf.c self_reloc.c vers.c CWARNFLAGS.self_reloc.c+= -Wno-error=maybe-uninitialized .endif -HELP_FILES+= help.uboot ${BOOTSRC}/fdt/help.fdt +HELP_FILES= ${.CURDIR}/help.uboot ${BOOTSRC}/fdt/help.fdt # Always add MI sources .include "${BOOTSRC}/loader.mk" Modified: stable/11/stand/common/bootstrap.h ============================================================================== --- stable/11/stand/common/bootstrap.h Mon Feb 12 17:42:28 2018 (r329174) +++ stable/11/stand/common/bootstrap.h Mon Feb 12 17:44:35 2018 (r329175) @@ -45,17 +45,17 @@ extern char command_errbuf[COMMAND_ERRBUFSZ]; #define CMD_FATAL 4 /* interp.c */ -void interact(const char *rc); +void interact(void); int include(const char *filename); /* interp_backslash.c */ -char *backslash(char *str); +char *backslash(const char *str); /* interp_parse.c */ -int parse(int *argc, char ***argv, char *str); +int parse(int *argc, char ***argv, const char *str); /* interp_forth.c */ -void bf_init(const char *rc); +void bf_init(void); int bf_run(char *line); /* boot.c */ Modified: stable/11/stand/common/dev_net.c ============================================================================== --- stable/11/stand/common/dev_net.c Mon Feb 12 17:42:28 2018 (r329174) +++ stable/11/stand/common/dev_net.c Mon Feb 12 17:44:35 2018 (r329175) @@ -382,7 +382,7 @@ net_print(int verbose) * It leaves just the pathname in the global rootpath. */ uint32_t -net_parse_rootpath() +net_parse_rootpath(void) { n_long addr = htonl(INADDR_NONE); size_t i; Modified: stable/11/stand/common/interp.c ============================================================================== --- stable/11/stand/common/interp.c Mon Feb 12 17:42:28 2018 (r329174) +++ stable/11/stand/common/interp.c Mon Feb 12 17:44:35 2018 (r329175) @@ -39,11 +39,7 @@ __FBSDID("$FreeBSD$"); #ifdef BOOT_FORTH #include "ficl.h" -#define RETURN(x) stackPushINT(bf_vm->pStack,!x); return(x) - extern FICL_VM *bf_vm; -#else -#define RETURN(x) return(x) #endif #define MAXARGS 20 /* maximum number of arguments allowed */ @@ -51,12 +47,10 @@ extern FICL_VM *bf_vm; static void prompt(void); #ifndef BOOT_FORTH -static int perform(int argc, char *argv[]); - /* * Perform the command */ -int +static int perform(int argc, char *argv[]) { int result; @@ -82,7 +76,7 @@ perform(int argc, char *argv[]) } else { command_errmsg = "unknown command"; } - RETURN(result); + return(result); } #endif /* ! BOOT_FORTH */ @@ -90,7 +84,7 @@ perform(int argc, char *argv[]) * Interactive mode */ void -interact(const char *rc) +interact(void) { static char input[256]; /* big enough? */ #ifndef BOOT_FORTH @@ -99,14 +93,11 @@ interact(const char *rc) #endif #ifdef BOOT_FORTH - bf_init((rc) ? "" : NULL); + bf_init(); #endif - if (rc == NULL) { - /* Read our default configuration. */ - include("/boot/loader.rc"); - } else if (*rc != '\0') - include(rc); + /* Read our default configuration. */ + include("/boot/loader.rc"); printf("\n"); Modified: stable/11/stand/common/interp_backslash.c ============================================================================== --- stable/11/stand/common/interp_backslash.c Mon Feb 12 17:42:28 2018 (r329174) +++ stable/11/stand/common/interp_backslash.c Mon Feb 12 17:44:35 2018 (r329175) @@ -28,7 +28,7 @@ __FBSDID("$FreeBSD$"); * processing" done on it. Original can be free'd if desired. */ char * -backslash(char *str) +backslash(const char *str) { /* * Remove backslashes from the strings. Turn \040 etc. into a single Modified: stable/11/stand/common/interp_forth.c ============================================================================== --- stable/11/stand/common/interp_forth.c Mon Feb 12 17:42:28 2018 (r329174) +++ stable/11/stand/common/interp_forth.c Mon Feb 12 17:44:35 2018 (r329175) @@ -250,7 +250,7 @@ bf_command(FICL_VM *vm) * Initialise the Forth interpreter, create all our commands as words. */ void -bf_init(const char *rc) +bf_init(void) { struct bootblk_command **cmdp; char create_buf[41]; /* 31 characters-long builtins */ @@ -280,14 +280,9 @@ bf_init(const char *rc) ficlSetEnv(bf_sys, "loader_version", bootprog_rev); /* try to load and run init file if present */ - if (rc == NULL) - rc = "/boot/boot.4th"; - if (*rc != '\0') { - fd = open(rc, O_RDONLY); - if (fd != -1) { - (void)ficlExecFD(bf_vm, fd); - close(fd); - } + if ((fd = open("/boot/boot.4th", O_RDONLY)) != -1) { + (void)ficlExecFD(bf_vm, fd); + close(fd); } } Modified: stable/11/stand/common/interp_parse.c ============================================================================== --- stable/11/stand/common/interp_parse.c Mon Feb 12 17:42:28 2018 (r329174) +++ stable/11/stand/common/interp_parse.c Mon Feb 12 17:44:35 2018 (r329175) @@ -7,7 +7,7 @@ * 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. - * + * * Jordan K. Hubbard * 29 August 1998 * @@ -82,7 +82,7 @@ isdquote(int ch) } int -parse(int *argc, char ***argv, char *str) +parse(int *argc, char ***argv, const char *str) { int ac; char *val, *p, *q, *copy = NULL; Modified: stable/11/stand/common/load_elf.c ============================================================================== --- stable/11/stand/common/load_elf.c Mon Feb 12 17:42:28 2018 (r329174) +++ stable/11/stand/common/load_elf.c Mon Feb 12 17:44:35 2018 (r329175) @@ -37,7 +37,7 @@ __FBSDID("$FreeBSD$"); #include #include #define FREEBSD_ELF -#include +#include #include "bootstrap.h" @@ -456,7 +456,7 @@ __elfN(loadimage)(struct preloaded_file *fp, elf_file_ * think the rule is going to have to be that you must strip a * file to remove symbols before gzipping it. */ - chunk = ehdr->e_shnum * ehdr->e_shentsize; + chunk = (size_t)ehdr->e_shnum * (size_t)ehdr->e_shentsize; if (chunk == 0 || ehdr->e_shoff == 0) goto nosyms; shdr = alloc_pread(ef->fd, ehdr->e_shoff, chunk); @@ -747,7 +747,7 @@ __elfN(load_modmetadata)(struct preloaded_file *fp, u_ goto out; } - size = ef.ehdr->e_shnum * ef.ehdr->e_shentsize; + size = (size_t)ef.ehdr->e_shnum * (size_t)ef.ehdr->e_shentsize; shdr = alloc_pread(ef.fd, ef.ehdr->e_shoff, size); if (shdr == NULL) { err = ENOMEM; Modified: stable/11/stand/common/load_elf_obj.c ============================================================================== --- stable/11/stand/common/load_elf_obj.c Mon Feb 12 17:42:28 2018 (r329174) +++ stable/11/stand/common/load_elf_obj.c Mon Feb 12 17:44:35 2018 (r329175) @@ -33,12 +33,12 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include +#include #include #include #include #define FREEBSD_ELF -#include +#include #include "bootstrap.h" Modified: stable/11/stand/common/reloc_elf.c ============================================================================== --- stable/11/stand/common/reloc_elf.c Mon Feb 12 17:42:28 2018 (r329174) +++ stable/11/stand/common/reloc_elf.c Mon Feb 12 17:44:35 2018 (r329175) @@ -36,7 +36,7 @@ __FBSDID("$FreeBSD$"); #include #define FREEBSD_ELF -#include +#include #include "bootstrap.h" Modified: stable/11/stand/defs.mk ============================================================================== --- stable/11/stand/defs.mk Mon Feb 12 17:42:28 2018 (r329174) +++ stable/11/stand/defs.mk Mon Feb 12 17:44:35 2018 (r329175) @@ -2,6 +2,8 @@ .include +WARNS?=1 + .if !defined(__BOOT_DEFS_MK__) __BOOT_DEFS_MK__=${MFILE} @@ -22,15 +24,6 @@ BOOTOBJ= ${OBJTOP}/stand # BINDIR is where we install BINDIR?= /boot -# NB: The makefiles depend on these being empty when we don't build forth. -.if ${MK_FORTH} != "no" -LIBFICL= ${BOOTOBJ}/ficl/libficl.a -.if ${MACHINE} == "i386" -LIBFICL32= ${LIBFICL} -.else -LIBFICL32= ${BOOTOBJ}/ficl32/libficl.a -.endif -.endif LIBSA= ${BOOTOBJ}/libsa/libsa.a .if ${MACHINE} == "i386" LIBSA32= ${LIBSA} @@ -39,54 +32,16 @@ LIBSA32= ${BOOTOBJ}/libsa32/libsa32.a .endif # Standard options: - -# Filesystem support -.if ${LOADER_CD9660_SUPPORT:Uno} == "yes" -CFLAGS+= -DLOADER_CD9660_SUPPORT +CFLAGS+= -nostdinc +.if ${MACHINE_ARCH} == "amd64" && ${DO32:U0} == 1 +CFLAGS+= -I${BOOTOBJ}/libsa32 +.else +CFLAGS+= -I${BOOTOBJ}/libsa .endif -.if ${LOADER_EXT2FS_SUPPORT:Uno} == "yes" -CFLAGS+= -DLOADER_EXT2FS_SUPPORT -.endif -.if ${LOADER_MSDOS_SUPPORT:Uno} == "yes" -CFLAGS+= -DLOADER_MSDOS_SUPPORT -.endif -.if ${LOADER_NANDFS_SUPPORT:U${MK_NAND}} == "yes" -CFLAGS+= -DLOADER_NANDFS_SUPPORT -.endif -.if ${LOADER_UFS_SUPPORT:Uyes} == "yes" -CFLAGS+= -DLOADER_UFS_SUPPORT -.endif +CFLAGS+= -I${SASRC} -D_STANDALONE +CFLAGS+= -I${SYSDIR} -# Compression -.if ${LOADER_GZIP_SUPPORT:Uno} == "yes" -CFLAGS+= -DLOADER_GZIP_SUPPORT -.endif -.if ${LOADER_BZIP2_SUPPORT:Uno} == "yes" -CFLAGS+= -DLOADER_BZIP2_SUPPORT -.endif - -# Network related things -.if ${LOADER_NET_SUPPORT:Uno} == "yes" -CFLAGS+= -DLOADER_NET_SUPPORT -.endif -.if ${LOADER_NFS_SUPPORT:Uno} == "yes" -CFLAGS+= -DLOADER_NFS_SUPPORT -.endif -.if ${LOADER_TFTP_SUPPORT:Uno} == "yes" -CFLAGS+= -DLOADER_TFTP_SUPPORT -.endif - -# Disk and partition support -.if ${LOADER_DISK_SUPPORT:Uyes} == "yes" -CFLAGS+= -DLOADER_DISK_SUPPORT -.if ${LOADER_GPT_SUPPORT:Uyes} == "yes" -CFLAGS+= -DLOADER_GPT_SUPPORT -.endif -.if ${LOADER_MBR_SUPPORT:Uyes} == "yes" -CFLAGS+= -DLOADER_MBR_SUPPORT -.endif - -# GELI Support, with backward compat hooks +# GELI Support, with backward compat hooks (mostly) .if defined(HAVE_GELI) .if defined(LOADER_NO_GELI_SUPPORT) MK_LOADER_GELI=no @@ -100,11 +55,17 @@ MK_LOADER_GELI=yes CFLAGS+= -DLOADER_GELI_SUPPORT CFLAGS+= -I${BOOTSRC}/geli LIBGELIBOOT= ${BOOTOBJ}/geli/libgeliboot.a +.endif # MK_LOADER_GELI +.endif # HAVE_GELI + +# These should be confined to loader.mk, but can't because uboot/lib +# also uses it. It's part of loader, but isn't a loader so we can't +# just include loader.mk +.if ${LOADER_DISK_SUPPORT:Uyes} == "yes" +CFLAGS+= -DLOADER_DISK_SUPPORT .endif -.endif -.endif -CFLAGS+= -I${SYSDIR} +# Machine specific flags for all builds here # All PowerPC builds are 32 bit. We have no 64-bit loaders on powerpc # or powerpc64. @@ -122,6 +83,49 @@ LD_FLAGS+= -m elf_i386_fbsd AFLAGS+= --32 .endif +SSP_CFLAGS= + +# Add in the no float / no SIMD stuff and announce we're freestanding +# aarch64 and riscv don't have -msoft-float, but all others do. riscv +# currently has no /boot/loader, but may soon. +CFLAGS+= -ffreestanding ${CFLAGS_NO_SIMD} +.if ${MACHINE_CPUARCH} == "aarch64" +CFLAGS+= -mgeneral-regs-only +.elif ${MACHINE_CPUARCH} != "riscv" +CFLAGS+= -msoft-float +.endif + +.if ${MACHINE_CPUARCH} == "i386" || (${MACHINE_CPUARCH} == "amd64" && ${DO32:U0} == 1) +CFLAGS+= -march=i386 +CFLAGS.gcc+= -mpreferred-stack-boundary=2 +.endif + + +.if ${MACHINE_CPUARCH} == "arm" +# Do not generate movt/movw, because the relocation fixup for them does not +# translate to the -Bsymbolic -pie format required by self_reloc() in loader(8). +# Also, the fpu is not available in a standalone environment. +.if ${COMPILER_VERSION} < 30800 +CFLAGS.clang+= -mllvm -arm-use-movt=0 +.else +CFLAGS.clang+= -mno-movt +.endif +CFLAGS.clang+= -mfpu=none +.endif + +# The boot loader build uses dd status=none, where possible, for reproducible +# build output (since performance varies from run to run). Trouble is that +# option was recently (10.3) added to FreeBSD and is non-standard. Only use it +# when this test succeeds rather than require dd to be a bootstrap tool. +DD_NOSTATUS!=(dd status=none count=0 2> /dev/null && echo status=none) || true +DD=dd ${DD_NOSTATUS} + +.if ${MK_LOADER_FORCE_LE} != "no" +.if ${MACHINE_ARCH} == "powerpc64" +CFLAGS+= -mlittle-endian +.endif +.endif + # Make sure we use the machine link we're about to create CFLAGS+=-I. @@ -163,9 +167,5 @@ ${_ILINKS}: path=`(cd $$path && /bin/pwd)` ; \ ${ECHO} ${.TARGET:T} "->" $$path ; \ ln -fhs $$path ${.TARGET:T} - -# For loader implementations, we generate a loader.help file. This can be suppressed by -# setting HELP_FILES to nothing. -HELP_FILES= ${LDRSRC}/help.common .endif # __BOOT_DEFS_MK__ Modified: stable/11/stand/efi/boot1/Makefile ============================================================================== --- stable/11/stand/efi/boot1/Makefile Mon Feb 12 17:42:28 2018 (r329174) +++ stable/11/stand/efi/boot1/Makefile Mon Feb 12 17:44:35 2018 (r329175) @@ -31,8 +31,9 @@ CWARNFLAGS.zfs_module.c += -Wno-unused-function SRCS= boot1.c self_reloc.c start.S ufs_module.c .if ${MK_ZFS} != "no" SRCS+= zfs_module.c -CFLAGS+= -I${ZFSSRC} -CFLAGS+= -I${SYSDIR}/cddl/boot/zfs +CFLAGS.zfs_module.c+= -I${ZFSSRC} +CFLAGS.zfs_module.c+= -I${SYSDIR}/cddl/boot/zfs +CFLAGS.zfs_module.c+= -I${SYSDIR}/crypto/skein CFLAGS+= -DEFI_ZFS_BOOT LIBZFSBOOT= ${BOOTOBJ}/zfs/libzfsboot.a .endif @@ -105,8 +106,6 @@ boot1.efi: ${PROG} -j .dynamic -j .dynsym -j .rel.dyn \ -j .rela.dyn -j .reloc -j .eh_frame \ --output-target=${EFI_TARGET} ${.ALLSRC} ${.TARGET} - -boot1.o: ${SASRC}/ufsread.c # The following inserts our objects into a template FAT file system # created by generate-fat.sh Modified: stable/11/stand/efi/boot1/boot1.c ============================================================================== --- stable/11/stand/efi/boot1/boot1.c Mon Feb 12 17:42:28 2018 (r329174) +++ stable/11/stand/efi/boot1/boot1.c Mon Feb 12 17:44:35 2018 (r329175) @@ -29,7 +29,6 @@ __FBSDID("$FreeBSD$"); #include #include -typedef CHAR16 efi_char; #include #include "boot_module.h" Modified: stable/11/stand/efi/include/efichar.h ============================================================================== --- stable/11/stand/efi/include/efichar.h Mon Feb 12 17:42:28 2018 (r329174) +++ stable/11/stand/efi/include/efichar.h Mon Feb 12 17:44:35 2018 (r329175) @@ -29,6 +29,12 @@ #ifndef _BOOT_EFI_EFICHAR_H_ #define _BOOT_EFI_EFICHAR_H_ +#ifdef _STANDALONE +#include + +typedef CHAR16 efi_char; +#endif + int ucs2_to_utf8(const efi_char *, char **); int utf8_to_ucs2(const char *, efi_char **, size_t *); int ucs2len(const efi_char *); Modified: stable/11/stand/efi/libefi/Makefile ============================================================================== --- stable/11/stand/efi/libefi/Makefile Mon Feb 12 17:42:28 2018 (r329174) +++ stable/11/stand/efi/libefi/Makefile Mon Feb 12 17:44:35 2018 (r329175) @@ -52,6 +52,4 @@ CFLAGS+= ${FORMAT_EXTENSIONS} CFLAGS+= -DTERM_EMU .endif -CFLAGS+= -DLIBEFI - .include Modified: stable/11/stand/efi/libefi/efichar.c ============================================================================== --- stable/11/stand/efi/libefi/efichar.c Mon Feb 12 17:42:28 2018 (r329174) +++ stable/11/stand/efi/libefi/efichar.c Mon Feb 12 17:44:35 2018 (r329175) @@ -29,16 +29,16 @@ __FBSDID("$FreeBSD$"); #include #include -#ifdef LIBEFI +#ifdef _STANDALONE #include #else #include #include #include #include -#endif #include #include +#endif #include "efichar.h" Modified: stable/11/stand/efi/libefi/efipart.c ============================================================================== --- stable/11/stand/efi/libefi/efipart.c Mon Feb 12 17:42:28 2018 (r329174) +++ stable/11/stand/efi/libefi/efipart.c Mon Feb 12 17:44:35 2018 (r329175) @@ -39,6 +39,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include static EFI_GUID blkio_guid = BLOCK_IO_PROTOCOL; @@ -196,6 +197,82 @@ efipart_floppy(EFI_DEVICE_PATH *node) } /* + * Determine if the provided device path is hdd. + * + * There really is no simple fool proof way to classify the devices. + * Since we do build three lists of devices - floppy, cd and hdd, we + * will try to see if the device is floppy or cd, and list anything else + * as hdd. + */ +static bool +efipart_hdd(EFI_DEVICE_PATH *dp) +{ + unsigned i, nin; + EFI_DEVICE_PATH *devpath, *node; + EFI_BLOCK_IO *blkio; + EFI_STATUS status; + + if (dp == NULL) + return (false); + + if ((node = efi_devpath_last_node(dp)) == NULL) + return (false); + + if (efipart_floppy(node) != NULL) + return (false); + + /* + * Test every EFI BLOCK IO handle to make sure dp is not device path + * for CD/DVD. + */ + nin = efipart_nhandles / sizeof (*efipart_handles); + for (i = 0; i < nin; i++) { + devpath = efi_lookup_devpath(efipart_handles[i]); + if (devpath == NULL) + return (false); + + /* Only continue testing when dp is prefix in devpath. */ + if (!efi_devpath_is_prefix(dp, devpath)) + continue; + + /* + * The device path has to have last node describing the + * device, or we can not test the type. + */ + if ((node = efi_devpath_last_node(devpath)) == NULL) + return (false); + + if (DevicePathType(node) == MEDIA_DEVICE_PATH && + DevicePathSubType(node) == MEDIA_CDROM_DP) { + return (false); + } + + /* Make sure we do have the media. */ + status = BS->HandleProtocol(efipart_handles[i], + &blkio_guid, (void **)&blkio); + if (EFI_ERROR(status)) + return (false); + + /* USB or SATA cd without the media. */ + if (blkio->Media->RemovableMedia && + !blkio->Media->MediaPresent) { + return (false); + } + + /* + * We assume the block size 512 or greater power of 2. + * iPXE is known to insert stub BLOCK IO device with + * BlockSize 1. + */ + if (blkio->Media->BlockSize < 512 || + !powerof2(blkio->Media->BlockSize)) { + return (false); + } + } + return (true); +} + +/* * Add or update entries with new handle data. */ static int @@ -308,9 +385,13 @@ efipart_updatecd(void) if ((node = efi_devpath_last_node(devpath)) == NULL) continue; + if (efipart_floppy(node) != NULL) continue; + if (efipart_hdd(devpath)) + continue; + status = BS->HandleProtocol(efipart_handles[i], &blkio_guid, (void **)&blkio); if (EFI_ERROR(status)) @@ -380,13 +461,21 @@ efipart_hdinfo_add(EFI_HANDLE disk_handle, EFI_HANDLE pdinfo_t *hd, *pd, *last; disk_devpath = efi_lookup_devpath(disk_handle); - part_devpath = efi_lookup_devpath(part_handle); - if (disk_devpath == NULL || part_devpath == NULL) { + if (disk_devpath == NULL) return (ENOENT); + + if (part_handle != NULL) { + part_devpath = efi_lookup_devpath(part_handle); + if (part_devpath == NULL) + return (ENOENT); + node = (HARDDRIVE_DEVICE_PATH *) + efi_devpath_last_node(part_devpath); + if (node == NULL) + return (ENOENT); /* This should not happen. */ + } else { + part_devpath = NULL; + node = NULL; } - node = (HARDDRIVE_DEVICE_PATH *)efi_devpath_last_node(part_devpath); - if (node == NULL) - return (ENOENT); /* This should not happen. */ pd = calloc(1, sizeof(pdinfo_t)); if (pd == NULL) { @@ -397,6 +486,9 @@ efipart_hdinfo_add(EFI_HANDLE disk_handle, EFI_HANDLE STAILQ_FOREACH(hd, &hdinfo, pd_link) { if (efi_devpath_match(hd->pd_devpath, disk_devpath) == true) { + if (part_devpath == NULL) + return (0); + /* Add the partition. */ pd->pd_handle = part_handle; pd->pd_unit = node->PartitionNumber; @@ -419,6 +511,9 @@ efipart_hdinfo_add(EFI_HANDLE disk_handle, EFI_HANDLE hd->pd_devpath = disk_devpath; STAILQ_INSERT_TAIL(&hdinfo, hd, pd_link); + if (part_devpath == NULL) + return (0); + pd = calloc(1, sizeof(pdinfo_t)); if (pd == NULL) { printf("Failed to add partition, out of memory\n"); @@ -470,8 +565,7 @@ efipart_hdinfo_add_filepath(EFI_HANDLE disk_handle) unit = 0; /* FILEPATH_DEVICE_PATH has 0 terminated string */ - for (len = 0; node->PathName[len] != 0; len++) - ; + len = ucs2len(node->PathName); if ((pathname = malloc(len + 1)) == NULL) { printf("Failed to add disk, out of memory\n"); free(pd); @@ -541,7 +635,8 @@ efipart_updatehd(void) if ((node = efi_devpath_last_node(devpath)) == NULL) continue; - if (efipart_floppy(node) != NULL) + + if (!efipart_hdd(devpath)) continue; status = BS->HandleProtocol(efipart_handles[i], @@ -550,6 +645,12 @@ efipart_updatehd(void) continue; if (DevicePathType(node) == MEDIA_DEVICE_PATH && + DevicePathSubType(node) == MEDIA_FILEPATH_DP) { + efipart_hdinfo_add_filepath(efipart_handles[i]); + continue; + } + + if (DevicePathType(node) == MEDIA_DEVICE_PATH && DevicePathSubType(node) == MEDIA_HARDDRIVE_DP) { devpathcpy = efi_devpath_trim(devpath); if (devpathcpy == NULL) @@ -568,18 +669,16 @@ efipart_updatehd(void) continue; if ((node = efi_devpath_last_node(devpathcpy)) == NULL) continue; + if (DevicePathType(node) == MEDIA_DEVICE_PATH && DevicePathSubType(node) == MEDIA_HARDDRIVE_DP) continue; + efipart_hdinfo_add(handle, efipart_handles[i]); continue; } - if (DevicePathType(node) == MEDIA_DEVICE_PATH && - DevicePathSubType(node) == MEDIA_FILEPATH_DP) { - efipart_hdinfo_add_filepath(efipart_handles[i]); - continue; - } + efipart_hdinfo_add(efipart_handles[i], NULL); } } Modified: stable/11/stand/efi/loader/Makefile ============================================================================== --- stable/11/stand/efi/loader/Makefile Mon Feb 12 17:42:28 2018 (r329174) +++ stable/11/stand/efi/loader/Makefile Mon Feb 12 17:44:35 2018 (r329175) @@ -89,7 +89,6 @@ CFLAGS+= -DEFI_STAGING_SIZE=${EFI_STAGING_SIZE} .endif # Always add MI sources -HELP_FILES= .include "${BOOTSRC}/loader.mk" FILES+= loader.efi Modified: stable/11/stand/efi/loader/main.c ============================================================================== --- stable/11/stand/efi/loader/main.c Mon Feb 12 17:42:28 2018 (r329174) +++ stable/11/stand/efi/loader/main.c Mon Feb 12 17:44:35 2018 (r329175) @@ -32,7 +32,7 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include +#include #include #include #include @@ -501,7 +501,7 @@ main(int argc, CHAR16 *argv[]) #endif } - interact(NULL); /* doesn't return */ + interact(); /* doesn't return */ return (EFI_SUCCESS); /* keep compiler happy */ } Modified: stable/11/stand/ficl.mk ============================================================================== --- stable/11/stand/ficl.mk Mon Feb 12 17:42:28 2018 (r329174) +++ stable/11/stand/ficl.mk Mon Feb 12 17:44:35 2018 (r329175) @@ -12,8 +12,6 @@ FICL_CPUARCH= mips64 FICL_CPUARCH= ${MACHINE_CPUARCH} .endif -.PATH: ${FICLSRC} ${FICLSRC}/${FICL_CPUARCH} - .if ${MACHINE_CPUARCH} == "amd64" && ${DO32:U0} == 0 CFLAGS+= -fPIC .endif Modified: stable/11/stand/ficl/Makefile ============================================================================== --- stable/11/stand/ficl/Makefile Mon Feb 12 17:42:28 2018 (r329174) +++ stable/11/stand/ficl/Makefile Mon Feb 12 17:44:35 2018 (r329175) @@ -4,6 +4,8 @@ .include .include "${BOOTSRC}/ficl.mk" +.PATH: ${FICLSRC} ${FICLSRC}/${FICL_CPUARCH} + BASE_SRCS= dict.c ficl.c fileaccess.c float.c loader.c math64.c \ prefix.c search.c stack.c tools.c vm.c words.c Modified: stable/11/stand/ficl/float.c ============================================================================== --- stable/11/stand/ficl/float.c Mon Feb 12 17:42:28 2018 (r329174) +++ stable/11/stand/ficl/float.c Mon Feb 12 17:44:35 2018 (r329175) @@ -43,14 +43,14 @@ /* $FreeBSD$ */ +#include "ficl.h" + +#if FICL_WANT_FLOAT #include #include #include #include #include -#include "ficl.h" - -#if FICL_WANT_FLOAT /******************************************************************* ** Do float addition r1 + r2. Modified: stable/11/stand/geli/Makefile ============================================================================== --- stable/11/stand/geli/Makefile Mon Feb 12 17:42:28 2018 (r329174) +++ stable/11/stand/geli/Makefile Mon Feb 12 17:44:35 2018 (r329175) @@ -2,6 +2,7 @@ # libgeliboot MAN= +DO32=1 .include MK_SSP= no @@ -11,19 +12,6 @@ INTERNALLIB= MK_PROFILE= no NO_PIC= -.if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64" -CFLAGS+= -march=i386 -.endif -.if ${MACHINE_ARCH} == "amd64" -CFLAGS+= -m32 -.endif - -WARNS?= 0 - -# string functions from libc -.PATH: ${SRCTOP}/lib/libc/string -SRCS+= bcmp.c bcopy.c bzero.c - # Our password input method SRCS+= pwgets.c @@ -45,7 +33,6 @@ SRCS+= rijndael-alg-fst.c rijndael-api-fst.c rijndael # local GELI Implementation .PATH: ${SYSDIR}/geom/eli -CFLAGS+= -D_STAND SRCS+= geliboot_crypto.c g_eli_hmac.c g_eli_key.c g_eli_key_cache.c pkcs5v2.c # aes Modified: stable/11/stand/geli/geliboot.c ============================================================================== --- stable/11/stand/geli/geliboot.c Mon Feb 12 17:42:28 2018 (r329174) +++ stable/11/stand/geli/geliboot.c Mon Feb 12 17:44:35 2018 (r329175) @@ -222,7 +222,7 @@ geli_taste(int read_func(void *vdev, void *priv, off_t */ static int geli_attach(struct geli_entry *ge, struct dsk *dskp, const char *passphrase, - const u_char *mkeyp) + u_char *mkeyp) { u_char key[G_ELI_USERKEYLEN], mkey[G_ELI_DATAIVKEYLEN], *mkp; u_int keynum; @@ -248,7 +248,7 @@ geli_attach(struct geli_entry *ge, struct dsk *dskp, c } else if (geli_e->md.md_iterations == 0) { g_eli_crypto_hmac_update(&ctx, geli_e->md.md_salt, sizeof(geli_e->md.md_salt)); - g_eli_crypto_hmac_update(&ctx, passphrase, + g_eli_crypto_hmac_update(&ctx, (const uint8_t *)passphrase, strlen(passphrase)); } else if (geli_e->md.md_iterations > 0) { printf("Calculating GELI Decryption Key disk%dp%d @ %d" @@ -294,7 +294,7 @@ found_key: /* * The encryption key is: ekey = HMAC_SHA512(Data-Key, 0x10) */ - g_eli_crypto_hmac(mkp, G_ELI_MAXKEYLEN, "\x10", 1, + g_eli_crypto_hmac(mkp, G_ELI_MAXKEYLEN, (const uint8_t *)"\x10", 1, geli_e->sc.sc_ekey, 0); } explicit_bzero(mkey, sizeof(mkey)); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Mon Feb 12 18:30:21 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 49DE0F0FABB; Mon, 12 Feb 2018 18:30:21 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EB4BC8398F; Mon, 12 Feb 2018 18:30:20 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E1DB4158C9; Mon, 12 Feb 2018 18:30:20 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1CIUKg1094240; Mon, 12 Feb 2018 18:30:20 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1CIUKFu094238; Mon, 12 Feb 2018 18:30:20 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201802121830.w1CIUKFu094238@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Mon, 12 Feb 2018 18:30:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r329176 - in stable/11/stand/mips/beri: boot2 common X-SVN-Group: stable-11 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in stable/11/stand/mips/beri: boot2 common X-SVN-Commit-Revision: 329176 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Feb 2018 18:30:21 -0000 Author: kevans Date: Mon Feb 12 18:30:20 2018 New Revision: 329176 URL: https://svnweb.freebsd.org/changeset/base/329176 Log: MFC r327705,r328447: Fix BERI bootloader build r327705: Use instead of and in boot code. r328447: BERI isn't BTX, so we don't have to provide exit(). Modified: stable/11/stand/mips/beri/boot2/boot2.c stable/11/stand/mips/beri/common/sdcard.c Directory Properties: stable/11/ (props changed) Modified: stable/11/stand/mips/beri/boot2/boot2.c ============================================================================== --- stable/11/stand/mips/beri/boot2/boot2.c Mon Feb 12 17:44:35 2018 (r329175) +++ stable/11/stand/mips/beri/boot2/boot2.c Mon Feb 12 18:30:20 2018 (r329176) @@ -139,7 +139,6 @@ static int comspeed = SIOSPD; struct bootinfo bootinfo; static uint8_t ioctrl = IO_KEYBOARD; -void exit(int); void putchar(int); static void boot_fromdram(void); static void boot_fromfs(void); @@ -277,12 +276,6 @@ main(u_int argc, const char *argv[], const char *envv[ else load(); } -} - -/* XXX - Needed for btxld to link the boot2 binary; do not remove. */ -void -exit(int x) -{ } static void Modified: stable/11/stand/mips/beri/common/sdcard.c ============================================================================== --- stable/11/stand/mips/beri/common/sdcard.c Mon Feb 12 17:44:35 2018 (r329175) +++ stable/11/stand/mips/beri/common/sdcard.c Mon Feb 12 18:30:20 2018 (r329176) @@ -33,8 +33,7 @@ #include #include -#include -#include +#include /* From owner-svn-src-all@freebsd.org Mon Feb 12 18:31:12 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E5595F0FCE9; Mon, 12 Feb 2018 18:31:11 +0000 (UTC) (envelope-from tychon@freebsd.org) Received: from pb-smtp1.pobox.com (pb-smtp1.pobox.com [64.147.108.70]) (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 8C99A83C99; Mon, 12 Feb 2018 18:31:11 +0000 (UTC) (envelope-from tychon@freebsd.org) Received: from pb-smtp1.pobox.com (unknown [127.0.0.1]) by pb-smtp1.pobox.com (Postfix) with ESMTP id C24DDCBA7B; Mon, 12 Feb 2018 13:31:05 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=pobox.com; h=content-type :mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; s=sasl; bh= Dt9xzJCkQvs4+fRd2LIkPp/nWo0=; b=ADpYwdnej58Cg5hfZMvifreOI1GUMHMp 3y8jEq498W1jYEX9EI573Kf4kaGVBvQKKhHDrGa7zqgOxPg4k3QdKLorY9QxhfU6 R5SxabIT95Ukadq34e5Ku1rZe3MX8gLpMQEm0bDRNB5WccwGvEuAwNR8xWtC/pbo DXgg7ISiiw0= Received: from pb-smtp1.nyi.icgroup.com (unknown [127.0.0.1]) by pb-smtp1.pobox.com (Postfix) with ESMTP id AF280CBA7A; Mon, 12 Feb 2018 13:31:05 -0500 (EST) Received: from [10.0.1.4] (unknown [146.115.75.63]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by pb-smtp1.pobox.com (Postfix) with ESMTPSA id 67E81CBA79; Mon, 12 Feb 2018 13:31:04 -0500 (EST) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 11.2 \(3445.5.20\)) Subject: Re: svn commit: r329162 - in head/sys/amd64/vmm: amd intel From: Tycho Nightingale In-Reply-To: <20180212153700.xbmbctnjtawum76h@mutt-hbsd> Date: Mon, 12 Feb 2018 13:31:02 -0500 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: References: <201802121445.w1CEjR3n082516@repo.freebsd.org> <20180212153700.xbmbctnjtawum76h@mutt-hbsd> To: Shawn Webb X-Mailer: Apple Mail (2.3445.5.20) X-Pobox-Relay-ID: E23EF608-1022-11E8-97B5-692D1A68708C-09779102!pb-smtp1.pobox.com X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Feb 2018 18:31:12 -0000 Hi, > On Feb 12, 2018, at 10:37 AM, Shawn Webb = wrote: >=20 > On Mon, Feb 12, 2018 at 02:45:27PM +0000, Tycho Nightingale wrote: >> Author: tychon >> Date: Mon Feb 12 14:45:27 2018 >> New Revision: 329162 >> URL: https://svnweb.freebsd.org/changeset/base/329162 >>=20 >> Log: >> Provide further mitigation against CVE-2017-5715 by flushing the >> return stack buffer (RSB) upon returning from the guest. >>=20 >> This was inspired by this linux commit: >> = https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/= arch/x86/kvm?id=3D117cc7a908c83697b0b737d15ae1eb5943afe35b >>=20 >> Reviewed by: grehan >> Sponsored by: Dell EMC Isilon >> Differential Revision: https://reviews.freebsd.org/D14272 >>=20 >> Modified: >> head/sys/amd64/vmm/amd/svm_support.S >> head/sys/amd64/vmm/intel/vmcs.c >> head/sys/amd64/vmm/intel/vmx.h >> head/sys/amd64/vmm/intel/vmx_support.S >>=20 >> Modified: head/sys/amd64/vmm/amd/svm_support.S >> = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=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/amd64/vmm/amd/svm_support.S Mon Feb 12 14:44:21 2018 = (r329161) >> +++ head/sys/amd64/vmm/amd/svm_support.S Mon Feb 12 14:45:27 2018 = (r329162) >> @@ -113,6 +113,23 @@ ENTRY(svm_launch) >> movq %rdi, SCTX_RDI(%rax) >> movq %rsi, SCTX_RSI(%rax) >>=20 >> + /* >> + * To prevent malicious branch target predictions from >> + * affecting the host, overwrite all entries in the RSB upon >> + * exiting a guest. >> + */ >> + mov $16, %ecx /* 16 iterations, two calls per loop */ >> + mov %rsp, %rax >> +0: call 2f /* create an RSB entry. */ >> +1: pause >> + call 1b /* capture rogue speculation. */ >> +2: call 2f /* create an RSB entry. */ >> +1: pause >> + call 1b /* capture rogue speculation. */ >> +2: sub $1, %ecx >> + jnz 0b >> + mov %rax, %rsp >> + >> /* Restore host state */ >> pop %r15 >> pop %r14 >>=20 >=20 > For amd systems, isn't use of lfence required for performance > reasons[1]? Or am I conflating two things? >=20 > 1: https://reviews.llvm.org/D41723 For what AMD calls V2 (the window of a speculative execution between = indirect branch predictions and resolution of the correct target) there = are a few mitigations cited in their white paper: = https://developer.amd.com/wp-content/resources/Managing-Speculation-on-AMD= -Processors.pdf depending on the specific code you are trying to =E2=80=9Cfix=E2=80=9D. = In my interpretation lfence is a component of several of the possible = mitigations when one wants to =E2=80=9Cfix=E2=80=9D a specific indirect = branch but does not ensure that subsequent branches will not be = speculated around. In this case we are trying to guard against the more = generic case of "entering more privileged code=E2=80=9D i.e. returning = from the guest to hypervisor aka host and protect all subsequent = indirect branches without needing to apply an lfence to them = individually. To do that, I=E2=80=99ve implemented mitigation V2-3 = where the return address predictor is filled with benign entries. Does that help? Tycho= From owner-svn-src-all@freebsd.org Mon Feb 12 18:40:20 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 87E33F1097B; Mon, 12 Feb 2018 18:40:20 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 39AE5845DC; Mon, 12 Feb 2018 18:40:20 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 348A715A91; Mon, 12 Feb 2018 18:40:20 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1CIeKr8099790; Mon, 12 Feb 2018 18:40:20 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1CIeJ4l099785; Mon, 12 Feb 2018 18:40:19 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201802121840.w1CIeJ4l099785@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Mon, 12 Feb 2018 18:40:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r329177 - in stable/11/sys: compat/freebsd32 kern X-SVN-Group: stable-11 X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: in stable/11/sys: compat/freebsd32 kern X-SVN-Commit-Revision: 329177 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Feb 2018 18:40:20 -0000 Author: brooks Date: Mon Feb 12 18:40:19 2018 New Revision: 329177 URL: https://svnweb.freebsd.org/changeset/base/329177 Log: MFC r328799: Add kern.ipc.{msqids,semsegs,sema} sysctls for FreeBSD32. Stop leaking kernel pointers though theses sysctls and make sure that the padding in the structures is zeroed on allocation to avoid other leaks. Reviewed by: gordon, kib Obtained from: CheriBSD Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D13459 Modified: stable/11/sys/compat/freebsd32/freebsd32_ipc.h stable/11/sys/kern/sysv_msg.c stable/11/sys/kern/sysv_sem.c stable/11/sys/kern/sysv_shm.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/compat/freebsd32/freebsd32_ipc.h ============================================================================== --- stable/11/sys/compat/freebsd32/freebsd32_ipc.h Mon Feb 12 18:30:20 2018 (r329176) +++ stable/11/sys/compat/freebsd32/freebsd32_ipc.h Mon Feb 12 18:40:19 2018 (r329177) @@ -47,6 +47,18 @@ struct semid_ds32 { int32_t sem_ctime; }; +#ifdef _KERNEL +struct semid_kernel32 { + /* Data structure exposed to user space. */ + struct semid_ds32 u; + + /* Kernel-private components of the semaphore. */ + int32_t label; + int32_t cred; +}; +#endif /* _KERNEL */ + + union semun32 { int val; uint32_t buf; @@ -67,6 +79,17 @@ struct msqid_ds32 { int32_t msg_ctime; }; +#ifdef _KERNEL +struct msqid_kernel32 { + /* Data structure exposed to user space. */ + struct msqid_ds32 u; + + /* Kernel-private components of the message queue. */ + uint32_t label; + uint32_t cred; +}; +#endif + struct shmid_ds32 { struct ipc_perm32 shm_perm; int32_t shm_segsz; @@ -77,6 +100,15 @@ struct shmid_ds32 { int32_t shm_dtime; int32_t shm_ctime; }; + +#ifdef _KERNEL +struct shmid_kernel32 { + struct shmid_ds32 u; + int32_t *object; + int32_t *label; + int32_t *cred; +}; +#endif struct shm_info32 { int32_t used_ids; Modified: stable/11/sys/kern/sysv_msg.c ============================================================================== --- stable/11/sys/kern/sysv_msg.c Mon Feb 12 18:30:20 2018 (r329176) +++ stable/11/sys/kern/sysv_msg.c Mon Feb 12 18:40:19 2018 (r329177) @@ -220,7 +220,7 @@ msginit() msgmaps = malloc(sizeof(struct msgmap) * msginfo.msgseg, M_MSG, M_WAITOK); msghdrs = malloc(sizeof(struct msg) * msginfo.msgtql, M_MSG, M_WAITOK); msqids = malloc(sizeof(struct msqid_kernel) * msginfo.msgmni, M_MSG, - M_WAITOK); + M_WAITOK | M_ZERO); /* * msginfo.msgssz should be a power of two for efficiency reasons. @@ -1417,7 +1417,12 @@ static int sysctl_msqids(SYSCTL_HANDLER_ARGS) { struct msqid_kernel tmsqk; +#ifdef COMPAT_FREEBSD32 + struct msqid_kernel32 tmsqk32; +#endif struct prison *pr, *rpr; + void *outaddr; + size_t outsize; int error, i; pr = req->td->td_ucred->cr_prison; @@ -1434,7 +1439,40 @@ sysctl_msqids(SYSCTL_HANDLER_ARGS) tmsqk.u.msg_perm.key = IPC_PRIVATE; } mtx_unlock(&msq_mtx); - error = SYSCTL_OUT(req, &tmsqk, sizeof(tmsqk)); +#ifdef COMPAT_FREEBSD32 + if (SV_CURPROC_FLAG(SV_ILP32)) { + bzero(&tmsqk32, sizeof(tmsqk32)); + freebsd32_ipcperm_out(&tmsqk.u.msg_perm, + &tmsqk32.u.msg_perm); + /* Don't copy u.msg_first or u.msg_last */ + CP(tmsqk, tmsqk32, u.msg_cbytes); + CP(tmsqk, tmsqk32, u.msg_qnum); + CP(tmsqk, tmsqk32, u.msg_qbytes); + CP(tmsqk, tmsqk32, u.msg_lspid); + CP(tmsqk, tmsqk32, u.msg_lrpid); + CP(tmsqk, tmsqk32, u.msg_stime); + CP(tmsqk, tmsqk32, u.msg_rtime); + CP(tmsqk, tmsqk32, u.msg_ctime); + /* Don't copy label or cred */ + outaddr = &tmsqk32; + outsize = sizeof(tmsqk32); + } else +#endif + { + /* Don't leak kernel pointers */ + tmsqk.u.msg_first = NULL; + tmsqk.u.msg_last = NULL; + tmsqk.label = NULL; + tmsqk.cred = NULL; + /* + * XXX: some padding also exists, but we take care to + * allocate our pool of msqid_kernel structs with + * zeroed memory so this should be OK. + */ + outaddr = &tmsqk; + outsize = sizeof(tmsqk); + } + error = SYSCTL_OUT(req, outaddr, outsize); if (error != 0) break; } Modified: stable/11/sys/kern/sysv_sem.c ============================================================================== --- stable/11/sys/kern/sysv_sem.c Mon Feb 12 18:30:20 2018 (r329176) +++ stable/11/sys/kern/sysv_sem.c Mon Feb 12 18:40:19 2018 (r329177) @@ -271,7 +271,7 @@ seminit(void) sem = malloc(sizeof(struct sem) * seminfo.semmns, M_SEM, M_WAITOK); sema = malloc(sizeof(struct semid_kernel) * seminfo.semmni, M_SEM, - M_WAITOK); + M_WAITOK | M_ZERO); sema_mtx = malloc(sizeof(struct mtx) * seminfo.semmni, M_SEM, M_WAITOK | M_ZERO); semu = malloc(seminfo.semmnu * seminfo.semusz, M_SEM, M_WAITOK); @@ -1467,6 +1467,11 @@ sysctl_sema(SYSCTL_HANDLER_ARGS) { struct prison *pr, *rpr; struct semid_kernel tsemak; +#ifdef COMPAT_FREEBSD32 + struct semid_kernel32 tsemak32; +#endif + void *outaddr; + size_t outsize; int error, i; pr = req->td->td_ucred->cr_prison; @@ -1483,7 +1488,28 @@ sysctl_sema(SYSCTL_HANDLER_ARGS) tsemak.u.sem_perm.key = IPC_PRIVATE; } mtx_unlock(&sema_mtx[i]); - error = SYSCTL_OUT(req, &tsemak, sizeof(tsemak)); +#ifdef COMPAT_FREEBSD32 + if (SV_CURPROC_FLAG(SV_ILP32)) { + bzero(&tsemak32, sizeof(tsemak32)); + freebsd32_ipcperm_out(&tsemak.u.sem_perm, + &tsemak32.u.sem_perm); + /* Don't copy u.sem_base */ + CP(tsemak, tsemak32, u.sem_nsems); + CP(tsemak, tsemak32, u.sem_otime); + CP(tsemak, tsemak32, u.sem_ctime); + /* Don't copy label or cred */ + outaddr = &tsemak32; + outsize = sizeof(tsemak32); + } else +#endif + { + tsemak.u.sem_base = NULL; + tsemak.label = NULL; + tsemak.cred = NULL; + outaddr = &tsemak; + outsize = sizeof(tsemak); + } + error = SYSCTL_OUT(req, outaddr, outsize); if (error != 0) break; } Modified: stable/11/sys/kern/sysv_shm.c ============================================================================== --- stable/11/sys/kern/sysv_shm.c Mon Feb 12 18:30:20 2018 (r329176) +++ stable/11/sys/kern/sysv_shm.c Mon Feb 12 18:40:19 2018 (r329177) @@ -844,7 +844,8 @@ shmrealloc(void) if (shmalloced >= shminfo.shmmni) return; - newsegs = malloc(shminfo.shmmni * sizeof(*newsegs), M_SHM, M_WAITOK); + newsegs = malloc(shminfo.shmmni * sizeof(*newsegs), M_SHM, + M_WAITOK | M_ZERO); for (i = 0; i < shmalloced; i++) bcopy(&shmsegs[i], &newsegs[i], sizeof(newsegs[0])); for (; i < shminfo.shmmni; i++) { @@ -922,7 +923,8 @@ shminit(void) } } shmalloced = shminfo.shmmni; - shmsegs = malloc(shmalloced * sizeof(shmsegs[0]), M_SHM, M_WAITOK); + shmsegs = malloc(shmalloced * sizeof(shmsegs[0]), M_SHM, + M_WAITOK|M_ZERO); for (i = 0; i < shmalloced; i++) { shmsegs[i].u.shm_perm.mode = SHMSEG_FREE; shmsegs[i].u.shm_perm.seq = 0; @@ -1009,7 +1011,12 @@ static int sysctl_shmsegs(SYSCTL_HANDLER_ARGS) { struct shmid_kernel tshmseg; +#ifdef COMPAT_FREEBSD32 + struct shmid_kernel32 tshmseg32; +#endif struct prison *pr, *rpr; + void *outaddr; + size_t outsize; int error, i; SYSVSHM_LOCK(); @@ -1026,7 +1033,31 @@ sysctl_shmsegs(SYSCTL_HANDLER_ARGS) if (tshmseg.cred->cr_prison != pr) tshmseg.u.shm_perm.key = IPC_PRIVATE; } - error = SYSCTL_OUT(req, &tshmseg, sizeof(tshmseg)); +#ifdef COMPAT_FREEBSD32 + if (SV_CURPROC_FLAG(SV_ILP32)) { + bzero(&tshmseg32, sizeof(tshmseg32)); + freebsd32_ipcperm_out(&tshmseg.u.shm_perm, + &tshmseg32.u.shm_perm); + CP(tshmseg, tshmseg32, u.shm_segsz); + CP(tshmseg, tshmseg32, u.shm_lpid); + CP(tshmseg, tshmseg32, u.shm_cpid); + CP(tshmseg, tshmseg32, u.shm_nattch); + CP(tshmseg, tshmseg32, u.shm_atime); + CP(tshmseg, tshmseg32, u.shm_dtime); + CP(tshmseg, tshmseg32, u.shm_ctime); + /* Don't copy object, label, or cred */ + outaddr = &tshmseg32; + outsize = sizeof(tshmseg32); + } else +#endif + { + tshmseg.object = NULL; + tshmseg.label = NULL; + tshmseg.cred = NULL; + outaddr = &tshmseg; + outsize = sizeof(tshmseg); + } + error = SYSCTL_OUT(req, outaddr, outsize); if (error != 0) break; } From owner-svn-src-all@freebsd.org Mon Feb 12 18:47:20 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C0D38F114BB; Mon, 12 Feb 2018 18:47:20 +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 6DDE384F5F; Mon, 12 Feb 2018 18:47:20 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (ralph.baldwin.cx [66.234.199.215]) by mail.baldwin.cx (Postfix) with ESMTPSA id B567C10A7DB; Mon, 12 Feb 2018 13:47:13 -0500 (EST) From: John Baldwin To: Warner Losh Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r329148 - head/etc/devd Date: Mon, 12 Feb 2018 10:43:53 -0800 Message-ID: <1851723.CDKeKmhBc8@ralph.baldwin.cx> User-Agent: KMail/4.14.10 (FreeBSD/11.1-STABLE; KDE/4.14.30; amd64; ; ) In-Reply-To: <201802120445.w1C4jQBL081885@repo.freebsd.org> References: <201802120445.w1C4jQBL081885@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, 12 Feb 2018 13:47:13 -0500 (EST) X-Virus-Scanned: clamav-milter 0.99.2 at mail.baldwin.cx X-Virus-Status: Clean X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Feb 2018 18:47:20 -0000 On Monday, February 12, 2018 04:45:26 AM Warner Losh wrote: > Author: imp > Date: Mon Feb 12 04:45:26 2018 > New Revision: 329148 > URL: https://svnweb.freebsd.org/changeset/base/329148 > > Log: > Switch to using devmatch to autoload drivers. Remove usb.conf > as obsolete because devmatch gets its information from the same > place as the genration scripts. > > Added: > head/etc/devd/devmatch.conf (contents, props changed) > Deleted: > head/etc/devd/usb.conf This is a bigger hammer. The old approach only loaded the specific driver for the device plugged in. This might load other drivers as well which users might find surprising. -- John Baldwin From owner-svn-src-all@freebsd.org Mon Feb 12 18:53:00 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3DB19F11EEB; Mon, 12 Feb 2018 18:53:00 +0000 (UTC) (envelope-from rgrimes@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DDF1F85B61; Mon, 12 Feb 2018 18:52:59 +0000 (UTC) (envelope-from rgrimes@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D8D3115DC0; Mon, 12 Feb 2018 18:52:59 +0000 (UTC) (envelope-from rgrimes@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1CIqx66009539; Mon, 12 Feb 2018 18:52:59 GMT (envelope-from rgrimes@FreeBSD.org) Received: (from rgrimes@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1CIqxD5009538; Mon, 12 Feb 2018 18:52:59 GMT (envelope-from rgrimes@FreeBSD.org) Message-Id: <201802121852.w1CIqxD5009538@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rgrimes set sender to rgrimes@FreeBSD.org using -f From: "Rodney W. Grimes" Date: Mon, 12 Feb 2018 18:52:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r329178 - stable/11/share/examples/bhyve X-SVN-Group: stable-11 X-SVN-Commit-Author: rgrimes X-SVN-Commit-Paths: stable/11/share/examples/bhyve X-SVN-Commit-Revision: 329178 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Feb 2018 18:53:00 -0000 Author: rgrimes Date: Mon Feb 12 18:52:59 2018 New Revision: 329178 URL: https://svnweb.freebsd.org/changeset/base/329178 Log: MFC: r316746 Add UEFI support to vmrun.sh Adds: -E: Use UEFI mode -f: path to UEFI firmware image (default: path to uefi-edk2-bhyve package) -F: UEFI framebuffer size (default: w=1024,h=768) -L: IP to listen for VNC connections on (default: 127.0.0.1) -P: Port to listen for VNC connections on (default: 5900) -T: Enable tablnet device (for VNC) -v: Wait for VNC client before booting VM Submitted by: Shawn Webb Approved by: grehan(mentor),allanjude(original committer) Relnotes: yes Differential Revision: https://reviews.freebsd.org/D10378 Modified: stable/11/share/examples/bhyve/vmrun.sh Directory Properties: stable/11/ (props changed) Modified: stable/11/share/examples/bhyve/vmrun.sh ============================================================================== --- stable/11/share/examples/bhyve/vmrun.sh Mon Feb 12 18:40:19 2018 (r329177) +++ stable/11/share/examples/bhyve/vmrun.sh Mon Feb 12 18:52:59 2018 (r329178) @@ -46,10 +46,12 @@ errmsg() { usage() { local msg=$1 - echo "Usage: vmrun.sh [-aAhi] [-c ] [-C ] [-d ]" - echo " [-e ] [-g ] [-H ]" + echo "Usage: vmrun.sh [-aAEhiTv] [-c ] [-C ] [-d ]" + echo " [-e ] [-f ] [-F ]" + echo " [-g ] [-H ]" echo " [-I ] [-l ]" - echo " [-m ] [-t ] " + echo " [-L ]" + echo " [-m ] [-P ] [-t ] " echo "" echo " -h: display this help message" echo " -a: force memory mapped local APIC access" @@ -58,15 +60,22 @@ usage() { echo " -C: console device (default is ${DEFAULT_CONSOLE})" echo " -d: virtio diskdev file (default is ${DEFAULT_VIRTIO_DISK})" echo " -e: set FreeBSD loader environment variable" + echo " -E: Use UEFI mode" + echo " -f: Use a specific UEFI firmware" + echo " -F: Use a custom UEFI GOP framebuffer size (default: w=1024,h=768)" echo " -g: listen for connection from kgdb at " echo " -H: host filesystem to export to the loader" echo " -i: force boot of the Installation CDROM image" echo " -I: Installation CDROM image location (default is ${DEFAULT_ISOFILE})" echo " -l: the OS loader to use (default is /boot/userboot.so)" + echo " -L: IP address for UEFI GOP VNC server (default: 127.0.0.1)" echo " -m: memory size (default is ${DEFAULT_MEMSIZE})" echo " -p: pass-through a host PCI device at bus/slot/func (e.g. 10/0/0)" + echo " -P: UEFI GOP VNC port (default: 5900)" echo " -t: tap device for virtio-net (default is $DEFAULT_TAPDEV)" + echo " -T: Enable tablet device (for UEFI GOP)" echo " -u: RTC keeps UTC time" + echo " -v: Wait for VNC client connection before booting VM" echo " -w: ignore unimplemented MSRs" echo "" [ -n "$msg" ] && errmsg "$msg" @@ -97,7 +106,16 @@ loader_opt="" bhyverun_opt="-H -A -P" pass_total=0 -while getopts aAc:C:d:e:g:hH:iI:l:m:p:t:uw c ; do +# EFI-specific options +efi_mode=0 +efi_firmware="/usr/local/share/uefi-firmware/BHYVE_UEFI.fd" +vncwait="" +vnchost="127.0.0.1" +vncport=5900 +fbsize="w=1024,h=768" +tablet="" + +while getopts aAc:C:d:e:Ef:F:g:hH:iI:l:m:p:P:t:Tuvw c ; do case $c in a) bhyverun_opt="${bhyverun_opt} -a" @@ -121,6 +139,15 @@ while getopts aAc:C:d:e:g:hH:iI:l:m:p:t:uw c ; do e) loader_opt="${loader_opt} -e ${OPTARG}" ;; + E) + efi_mode=1 + ;; + f) + efi_firmware="${OPTARG}" + ;; + F) + fbsize="${OPTARG}" + ;; g) gdbport=${OPTARG} ;; @@ -136,6 +163,9 @@ while getopts aAc:C:d:e:g:hH:iI:l:m:p:t:uw c ; do l) loader_opt="${loader_opt} -l ${OPTARG}" ;; + L) + vnchost="${OPTARG}" + ;; m) memsize=${OPTARG} ;; @@ -143,13 +173,22 @@ while getopts aAc:C:d:e:g:hH:iI:l:m:p:t:uw c ; do eval "pass_dev${pass_total}=\"${OPTARG}\"" pass_total=$(($pass_total + 1)) ;; + P) + vncport="${OPTARG}" + ;; t) eval "tap_dev${tap_total}=\"${OPTARG}\"" tap_total=$(($tap_total + 1)) ;; + T) + tablet="-s 30,xhci,tablet" + ;; u) bhyverun_opt="${bhyverun_opt} -u" ;; + v) + vncwait=",wait" + ;; w) bhyverun_opt="${bhyverun_opt} -w" ;; @@ -186,6 +225,13 @@ if [ ${pass_total} -gt 0 ]; then bhyverun_opt="${bhyverun_opt} -S" fi +if [ ${efi_mode} -gt 0 ]; then + if [ ! -f ${efi_firmware} ]; then + echo "Error: EFI Firmware ${efi_firmware} doesn't exist. Try: pkg install uefi-edk2-bhyve" + exit 1 + fi +fi + make_and_check_diskdev() { local virtio_diskdev="$1" @@ -248,11 +294,13 @@ while [ 1 ]; do installer_opt="" fi - ${LOADER} -c ${console} -m ${memsize} ${BOOTDISKS} ${loader_opt} \ - ${vmname} - bhyve_exit=$? - if [ $bhyve_exit -ne 0 ]; then - break + if [ ${efi_mode} -eq 0 ]; then + ${LOADER} -c ${console} -m ${memsize} ${BOOTDISKS} ${loader_opt} \ + ${vmname} + bhyve_exit=$? + if [ $bhyve_exit -ne 0 ]; then + break + fi fi # @@ -286,10 +334,18 @@ while [ 1 ]; do i=$(($i + 1)) done + efiargs="" + if [ ${efi_mode} -gt 0 ]; then + efiargs="-s 29,fbuf,tcp=${vnchost}:${vncport},${fbsize}${vncwait}" + efiargs="${efiargs} -l bootrom,${efi_firmware}" + efiargs="${efiargs} ${tablet}" + fi + ${FBSDRUN} -c ${cpus} -m ${memsize} ${bhyverun_opt} \ -g ${gdbport} \ -s 0:0,hostbridge \ -s 1:0,lpc \ + ${efiargs} \ ${devargs} \ -l com1,${console} \ ${installer_opt} \ From owner-svn-src-all@freebsd.org Mon Feb 12 18:55:56 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9C650F122E0 for ; Mon, 12 Feb 2018 18:55:56 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound1b.ore.mailhop.org (outbound1b.ore.mailhop.org [54.200.247.200]) (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 2DBE185DF1 for ; Mon, 12 Feb 2018 18:55:55 +0000 (UTC) (envelope-from ian@freebsd.org) X-MHO-User: 522c08cc-1026-11e8-bb8e-b35b57339d60 X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 67.177.211.60 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [67.177.211.60]) by outbound1.ore.mailhop.org (Halon) with ESMTPSA id 522c08cc-1026-11e8-bb8e-b35b57339d60; Mon, 12 Feb 2018 18:55:41 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id w1CItrpS035306; Mon, 12 Feb 2018 11:55:53 -0700 (MST) (envelope-from ian@freebsd.org) Message-ID: <1518461752.94819.42.camel@freebsd.org> Subject: Re: svn commit: r329173 - head/sys/kern From: Ian Lepore To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Mon, 12 Feb 2018 11:55:52 -0700 In-Reply-To: <201802121741.w1CHfBWa069971@repo.freebsd.org> References: <201802121741.w1CHfBWa069971@repo.freebsd.org> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.18.5.1 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Feb 2018 18:55:56 -0000 On Mon, 2018-02-12 at 17:41 +0000, Ian Lepore wrote: > Author: ian > Date: Mon Feb 12 17:41:11 2018 > New Revision: 329173 > URL: https://svnweb.freebsd.org/changeset/base/329173 > > Log: >   Add a new sysctl, debug.clock_do_io, to allow manully triggering a one-shot >   read or write of all registered realtime clocks.  In the read case, the >   values read are simply discarded.  For writes, there's no alternative but >   to actually write the current system time to the device. > > Modified: >   head/sys/kern/subr_rtc.c I've received several questions about this series of commits, which I think means I probably should have put it up for review first.  I didn't do so only because every other RTC-related change I've put on phab has just languished without comments for a couple weeks before I gave up waiting and committed it anyway. As to what this series of rtc debugging changes was about in general... I'm tired of hacking read-now/write-now sysctls into (and then back out of before committing) every RTC driver I've ever worked on.  It's nice to be able to debug them without actually changing the time on the system continuously and/or rebooting.  If you can trigger the IO on demand you can use kldload/unload while testing.  Otherwise the only way to make a read happen after you've made a code change is to reboot.   Another motivation: I want to eliminate atrtc's ddb "show rtc" command that only works in that one of the dozen+ rtc drivers we have, and it brings complications to the atrtc code that I want to clean up.   As to why I made clock_do_io a "write to read" thing... I find myself always doing "sysctl -a | grep something" where something is some fragment of an oid name I vaguely remember.  I'm probably not alone in doing things like that, and I didn't want sysctl -a to start triggering expensive hardware accesses like i2c bus transactions; that's why I made it "write-to-read" (which requires that you go look for the debugging output on the console or in dmesg, which is klunky, but hey... this is debugging stuff, not some fancy new kernel abi for reading time). -- Ian From owner-svn-src-all@freebsd.org Mon Feb 12 19:08:17 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B9D5BF13692; Mon, 12 Feb 2018 19:08:17 +0000 (UTC) (envelope-from rgrimes@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 652FC87CA6; Mon, 12 Feb 2018 19:08:17 +0000 (UTC) (envelope-from rgrimes@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5B44A15FB1; Mon, 12 Feb 2018 19:08:17 +0000 (UTC) (envelope-from rgrimes@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1CJ8Hbu017827; Mon, 12 Feb 2018 19:08:17 GMT (envelope-from rgrimes@FreeBSD.org) Received: (from rgrimes@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1CJ8H5i017826; Mon, 12 Feb 2018 19:08:17 GMT (envelope-from rgrimes@FreeBSD.org) Message-Id: <201802121908.w1CJ8H5i017826@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rgrimes set sender to rgrimes@FreeBSD.org using -f From: "Rodney W. Grimes" Date: Mon, 12 Feb 2018 19:08:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r329179 - stable/11/share/examples/bhyve X-SVN-Group: stable-11 X-SVN-Commit-Author: rgrimes X-SVN-Commit-Paths: stable/11/share/examples/bhyve X-SVN-Commit-Revision: 329179 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Feb 2018 19:08:18 -0000 Author: rgrimes Date: Mon Feb 12 19:08:17 2018 New Revision: 329179 URL: https://svnweb.freebsd.org/changeset/base/329179 Log: MFC: r328695,r328720,r328784,r328795 share/examples/bhyve/vmrun.sh additions and cleanups r328695: Add option '-n' network device emulation type which has a default of virtio-net PR: 225558 Submitted by: Johannes Lundberg r328720: Add -n to usage synopsis forgotten in r328695. Fix long lines in usage. Consistently use "default:" rather than "default is" r328784: Clean up long lines. r328795: Fold constants and unify vnc variable names. Approved by: grehan (mentor) PR: 225558 Modified: stable/11/share/examples/bhyve/vmrun.sh Directory Properties: stable/11/ (props changed) Modified: stable/11/share/examples/bhyve/vmrun.sh ============================================================================== --- stable/11/share/examples/bhyve/vmrun.sh Mon Feb 12 18:52:59 2018 (r329178) +++ stable/11/share/examples/bhyve/vmrun.sh Mon Feb 12 19:08:17 2018 (r329179) @@ -36,9 +36,15 @@ DEFAULT_CPUS=2 DEFAULT_TAPDEV=tap0 DEFAULT_CONSOLE=stdio +DEFAULT_NIC=virtio-net +DEFAULT_DISK=virtio-blk DEFAULT_VIRTIO_DISK="./diskdev" DEFAULT_ISOFILE="./release.iso" +DEFAULT_VNCHOST="127.0.0.1" +DEFAULT_VNCPORT=5900 +DEFAULT_VNCSIZE="w=1024,h=768" + errmsg() { echo "*** $1" } @@ -46,33 +52,43 @@ errmsg() { usage() { local msg=$1 - echo "Usage: vmrun.sh [-aAEhiTv] [-c ] [-C ] [-d ]" - echo " [-e ] [-f ] [-F ]" + echo "Usage: vmrun.sh [-aAEhiTv] [-c ] [-C ]" \ + "[-d ]" + echo " [-e ] [-f ]" \ + "[-F ]" echo " [-g ] [-H ]" echo " [-I ] [-l ]" echo " [-L ]" - echo " [-m ] [-P ] [-t ] " + echo " [-m ]" \ + "[-n ]" + echo " [-P ] [-t ] " echo "" echo " -h: display this help message" echo " -a: force memory mapped local APIC access" - echo " -A: use AHCI disk emulation instead of virtio" - echo " -c: number of virtual cpus (default is ${DEFAULT_CPUS})" - echo " -C: console device (default is ${DEFAULT_CONSOLE})" - echo " -d: virtio diskdev file (default is ${DEFAULT_VIRTIO_DISK})" + echo " -A: use AHCI disk emulation instead of ${DEFAULT_DISK}" + echo " -c: number of virtual cpus (default: ${DEFAULT_CPUS})" + echo " -C: console device (default: ${DEFAULT_CONSOLE})" + echo " -d: virtio diskdev file (default: ${DEFAULT_VIRTIO_DISK})" echo " -e: set FreeBSD loader environment variable" echo " -E: Use UEFI mode" echo " -f: Use a specific UEFI firmware" - echo " -F: Use a custom UEFI GOP framebuffer size (default: w=1024,h=768)" + echo " -F: Use a custom UEFI GOP framebuffer size" \ + "(default: ${DEFAULT_VNCSIZE}" echo " -g: listen for connection from kgdb at " echo " -H: host filesystem to export to the loader" echo " -i: force boot of the Installation CDROM image" - echo " -I: Installation CDROM image location (default is ${DEFAULT_ISOFILE})" - echo " -l: the OS loader to use (default is /boot/userboot.so)" - echo " -L: IP address for UEFI GOP VNC server (default: 127.0.0.1)" - echo " -m: memory size (default is ${DEFAULT_MEMSIZE})" - echo " -p: pass-through a host PCI device at bus/slot/func (e.g. 10/0/0)" - echo " -P: UEFI GOP VNC port (default: 5900)" - echo " -t: tap device for virtio-net (default is $DEFAULT_TAPDEV)" + echo " -I: Installation CDROM image location" \ + "(default: ${DEFAULT_ISOFILE})" + echo " -l: the OS loader to use (default: /boot/userboot.so)" + echo " -L: IP address for UEFI GOP VNC server" \ + "(default: ${DEFAULT_VNCHOST}" + echo " -m: memory size (default: ${DEFAULT_MEMSIZE})" + echo " -n: network adapter emulation type" \ + "(default: ${DEFAULT_NIC})" + echo " -p: pass-through a host PCI device at bus/slot/func" \ + "(e.g. 10/0/0)" + echo " -P: UEFI GOP VNC port (default: ${DEFAULT_VNCPORT})" + echo " -t: tap device for virtio-net (default: $DEFAULT_TAPDEV)" echo " -T: Enable tablet device (for UEFI GOP)" echo " -u: RTC keeps UTC time" echo " -v: Wait for VNC client connection before booting VM" @@ -98,9 +114,10 @@ isofile=${DEFAULT_ISOFILE} memsize=${DEFAULT_MEMSIZE} console=${DEFAULT_CONSOLE} cpus=${DEFAULT_CPUS} +nic=${DEFAULT_NIC} tap_total=0 disk_total=0 -disk_emulation="virtio-blk" +disk_emulation=${DEFAULT_DISK} gdbport=0 loader_opt="" bhyverun_opt="-H -A -P" @@ -110,12 +127,12 @@ pass_total=0 efi_mode=0 efi_firmware="/usr/local/share/uefi-firmware/BHYVE_UEFI.fd" vncwait="" -vnchost="127.0.0.1" -vncport=5900 -fbsize="w=1024,h=768" +vnchost=${DEFAULT_VNCHOST} +vncport=${DEFAULT_VNCPORT} +vncsize=${DEFAULT_VNCSIZE} tablet="" -while getopts aAc:C:d:e:Ef:F:g:hH:iI:l:m:p:P:t:Tuvw c ; do +while getopts aAc:C:d:e:Ef:F:g:hH:iI:l:m:n:p:P:t:Tuvw c ; do case $c in a) bhyverun_opt="${bhyverun_opt} -a" @@ -146,7 +163,7 @@ while getopts aAc:C:d:e:Ef:F:g:hH:iI:l:m:p:P:t:Tuvw c efi_firmware="${OPTARG}" ;; F) - fbsize="${OPTARG}" + vncsize="${OPTARG}" ;; g) gdbport=${OPTARG} @@ -169,6 +186,9 @@ while getopts aAc:C:d:e:Ef:F:g:hH:iI:l:m:p:P:t:Tuvw c m) memsize=${OPTARG} ;; + n) + nic=${OPTARG} + ;; p) eval "pass_dev${pass_total}=\"${OPTARG}\"" pass_total=$(($pass_total + 1)) @@ -227,7 +247,8 @@ fi if [ ${efi_mode} -gt 0 ]; then if [ ! -f ${efi_firmware} ]; then - echo "Error: EFI Firmware ${efi_firmware} doesn't exist. Try: pkg install uefi-edk2-bhyve" + echo "Error: EFI Firmware ${efi_firmware} doesn't exist." \ + "Try: pkg install uefi-edk2-bhyve" exit 1 fi fi @@ -264,7 +285,8 @@ while [ 1 ]; do file -s ${first_diskdev} | grep "boot sector" > /dev/null rc=$? if [ $rc -ne 0 ]; then - file -s ${first_diskdev} | grep ": Unix Fast File sys" > /dev/null + file -s ${first_diskdev} | \ + grep ": Unix Fast File sys" > /dev/null rc=$? fi if [ $rc -ne 0 ]; then @@ -295,8 +317,8 @@ while [ 1 ]; do fi if [ ${efi_mode} -eq 0 ]; then - ${LOADER} -c ${console} -m ${memsize} ${BOOTDISKS} ${loader_opt} \ - ${vmname} + ${LOADER} -c ${console} -m ${memsize} ${BOOTDISKS} \ + ${loader_opt} ${vmname} bhyve_exit=$? if [ $bhyve_exit -ne 0 ]; then break @@ -311,7 +333,7 @@ while [ 1 ]; do i=0 while [ $i -lt $tap_total ] ; do eval "tapname=\$tap_dev${i}" - devargs="$devargs -s $nextslot:0,virtio-net,${tapname} " + devargs="$devargs -s $nextslot:0,${nic},${tapname} " nextslot=$(($nextslot + 1)) i=$(($i + 1)) done @@ -336,7 +358,8 @@ while [ 1 ]; do efiargs="" if [ ${efi_mode} -gt 0 ]; then - efiargs="-s 29,fbuf,tcp=${vnchost}:${vncport},${fbsize}${vncwait}" + efiargs="-s 29,fbuf,tcp=${vnchost}:${vncport}," + efiargs="${efiargs}${vncsize}${vncwait}" efiargs="${efiargs} -l bootrom,${efi_firmware}" efiargs="${efiargs} ${tablet}" fi From owner-svn-src-all@freebsd.org Mon Feb 12 19:13:07 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 927AEF13E14; Mon, 12 Feb 2018 19:13:07 +0000 (UTC) (envelope-from garga.bsd@gmail.com) Received: from mail-qt0-x230.google.com (mail-qt0-x230.google.com [IPv6:2607:f8b0:400d:c0d::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 294FE68321; Mon, 12 Feb 2018 19:13:07 +0000 (UTC) (envelope-from garga.bsd@gmail.com) Received: by mail-qt0-x230.google.com with SMTP id f18so827413qth.11; Mon, 12 Feb 2018 11:13:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-language:content-transfer-encoding; bh=Az+XFPQpcVk/nZ3WuhWxfNgH79FPVsy0K+zC/SJVwsI=; b=p+joBmF8agjOOzP2/AgKrC8JFGnDiL5xjYTCQ83gjJezH/kQmu+W4kx0tMI08LLTbh KTamGWy8Y0xlMcv9W/YMourWuw9WuB1h4DVeLSbuEHnJjXC317lF/WOEnYjbphG4hXa5 KMrqLoZQbGXY4vdDRN1yX9zzwT1E2o3KneMUpYMMxTznt/i+Uh4jzoJ0SxSA26kfJWuT he1Rx/BeCUCcUDDYIM43Tf14Q1W0ygL8v7qTD8LxtD9moGauYDpcuejc34XL2AghU1J6 7Q18nWc/esgC+eyBa6+g2/pgRRJZVgNTk/OsvCX1nS/RkWuO2wVJueBrqkCxbmEprojS XxkA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=Az+XFPQpcVk/nZ3WuhWxfNgH79FPVsy0K+zC/SJVwsI=; b=OKRUSZZnH4fncY0HhiQOf70BBnTVPBoTE87onfVjY39832ilDBhcFeKkh4Lhhlk+FU P0q5pVkL5JdfCEEaSZh8gh90yfDab3QPU834ZsJnTPxXzAjBwv8WciytOIq/lGFqnD9y lToNJFtWsjlsGk9RMK4+uddTbLI6fzK1KP4+VW1r2tEoIXZrrIUn5AwfpzIQOrxxPYOc jLXUhyrFNHQgeEdaqT/9FBioooP8r8ok7hfm/FaBdndDNnagaORHL3c3GT8innT24NaS D+RRyX9nMt02cVtWGkpZNejy9LZCCEvXllH7SSqAPcNPlIjxeQHH/Gmd0yt1mCEibAue cumg== X-Gm-Message-State: APf1xPAVEAoeq6oOAl4YnfXWyC341n3GaVHIaT7RmRmCKvukvRPy1xig ZQPkckWIxkCorncJ8SIaD0QX8CvQ X-Google-Smtp-Source: AH8x22618dB9rfauYHOWSic1GcFyKOjnYFgRGI0n4QJ272Ees9hy7vTutlTo3YgJGL+Klk8HSJAf5g== X-Received: by 10.200.80.67 with SMTP id h3mr727091qtm.211.1518462786496; Mon, 12 Feb 2018 11:13:06 -0800 (PST) Received: from mbp.home ([177.53.86.172]) by smtp.gmail.com with ESMTPSA id e46sm6865757qte.9.2018.02.12.11.13.04 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 12 Feb 2018 11:13:05 -0800 (PST) Subject: Re: svn commit: r329148 - head/etc/devd To: Warner Losh , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201802120445.w1C4jQBL081885@repo.freebsd.org> From: Renato Botelho Message-ID: <1f2b78cb-c27b-6b3b-0ee7-130de756bbb7@gmail.com> Date: Mon, 12 Feb 2018 17:13:01 -0200 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: <201802120445.w1C4jQBL081885@repo.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Feb 2018 19:13:07 -0000 On 12/02/18 02:45, Warner Losh wrote: > Author: imp > Date: Mon Feb 12 04:45:26 2018 > New Revision: 329148 > URL: https://svnweb.freebsd.org/changeset/base/329148 > > Log: > Switch to using devmatch to autoload drivers. Remove usb.conf > as obsolete because devmatch gets its information from the same > place as the genration scripts. > > Added: > head/etc/devd/devmatch.conf (contents, props changed) > Deleted: > head/etc/devd/usb.conf > > Added: head/etc/devd/devmatch.conf > ============================================================================== > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/etc/devd/devmatch.conf Mon Feb 12 04:45:26 2018 (r329148) > @@ -0,0 +1,13 @@ > +# > +# $FreeBSD$ > +# > + > +# > +# Example devd configuration file for automatically > +# loading what modules we can based on nomatch > +# events. > +# > +# Generic NOMATCH event > +nomatch 100 { > + action "service devmatch onestart" Config syntax is broken. It's missing ; in the end of above line -- Renato Botelho From owner-svn-src-all@freebsd.org Mon Feb 12 19:36:28 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E3284F15B48; Mon, 12 Feb 2018 19:36:27 +0000 (UTC) (envelope-from landonf@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 912BD69406; Mon, 12 Feb 2018 19:36:27 +0000 (UTC) (envelope-from landonf@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8BC6C16488; Mon, 12 Feb 2018 19:36:27 +0000 (UTC) (envelope-from landonf@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1CJaRRp033046; Mon, 12 Feb 2018 19:36:27 GMT (envelope-from landonf@FreeBSD.org) Received: (from landonf@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1CJaRlq033041; Mon, 12 Feb 2018 19:36:27 GMT (envelope-from landonf@FreeBSD.org) Message-Id: <201802121936.w1CJaRlq033041@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: landonf set sender to landonf@FreeBSD.org using -f From: "Landon J. Fuller" Date: Mon, 12 Feb 2018 19:36:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329180 - head/sys/dev/bhnd/siba X-SVN-Group: head X-SVN-Commit-Author: landonf X-SVN-Commit-Paths: head/sys/dev/bhnd/siba X-SVN-Commit-Revision: 329180 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Feb 2018 19:36:28 -0000 Author: landonf Date: Mon Feb 12 19:36:26 2018 New Revision: 329180 URL: https://svnweb.freebsd.org/changeset/base/329180 Log: siba(4): Ignore disabled per-core address match entries. Previously, the address regions described by disabled admatch entries would be treated as being mapped to the given core; while incorrect, this was essentially harmless given that the entries describe unused address space on the few affected devices. We now perform parsing of per-core admatch registers and interrupt flags in siba_erom, correctly skip any disabled admatch entries, and use the siba_erom API in siba_add_children() to perform enumeration of attached cores. Added: head/sys/dev/bhnd/siba/siba_eromvar.h (contents, props changed) Modified: head/sys/dev/bhnd/siba/siba.c head/sys/dev/bhnd/siba/siba_erom.c head/sys/dev/bhnd/siba/siba_subr.c head/sys/dev/bhnd/siba/sibavar.h Modified: head/sys/dev/bhnd/siba/siba.c ============================================================================== --- head/sys/dev/bhnd/siba/siba.c Mon Feb 12 19:08:17 2018 (r329179) +++ head/sys/dev/bhnd/siba/siba.c Mon Feb 12 19:36:26 2018 (r329180) @@ -47,9 +47,14 @@ __FBSDID("$FreeBSD$"); #include #include +#include "siba_eromvar.h" + #include "sibareg.h" #include "sibavar.h" +/* RID used when allocating EROM resources */ +#define SIBA_EROM_RID 0 + static bhnd_erom_class_t * siba_get_erom_class(driver_t *driver) { @@ -1057,7 +1062,7 @@ siba_decode_port_rid(device_t dev, device_t child, int return (EINVAL); /* Look for a matching addrspace entry */ - for (u_int i = 0; i < dinfo->core_id.num_addrspace; i++) { + for (u_int i = 0; i < dinfo->core_id.num_admatch; i++) { if (dinfo->addrspace[i].sa_rid != rid) continue; @@ -1131,7 +1136,7 @@ siba_get_intr_count(device_t dev, device_t child) return (BHND_BUS_GET_INTR_COUNT(device_get_parent(dev), child)); dinfo = device_get_ivars(child); - if (!dinfo->intr_en) { + if (!dinfo->core_id.intr_en) { /* No interrupts */ return (0); } else { @@ -1161,121 +1166,14 @@ siba_get_intr_ivec(device_t dev, device_t child, u_int dinfo = device_get_ivars(child); - KASSERT(dinfo->intr_en, ("core does not have an interrupt assigned")); - *ivec = dinfo->intr.flag; - return (0); -} + KASSERT(dinfo->core_id.intr_en, + ("core does not have an interrupt assigned")); -/** - * Register all address space mappings for @p di. - * - * @param dev The siba bus device. - * @param di The device info instance on which to register all address - * space entries. - * @param r A resource mapping the enumeration table block for @p di. - */ -static int -siba_register_addrspaces(device_t dev, struct siba_devinfo *di, - struct bhnd_resource *r) -{ - struct siba_core_id *cid; - uint32_t addr; - uint32_t size; - int error; - - cid = &di->core_id; - - - /* Register the device address space entries */ - for (uint8_t i = 0; i < di->core_id.num_addrspace; i++) { - uint32_t adm; - u_int adm_offset; - uint32_t bus_reserved; - - /* Determine the register offset */ - adm_offset = siba_admatch_offset(i); - if (adm_offset == 0) { - device_printf(dev, "addrspace %hhu is unsupported", i); - return (ENODEV); - } - - /* Fetch the address match register value */ - adm = bhnd_bus_read_4(r, adm_offset); - - /* Parse the value */ - if ((error = siba_parse_admatch(adm, &addr, &size))) { - device_printf(dev, "failed to decode address " - " match register value 0x%x\n", adm); - return (error); - } - - /* If this is the device's core/enumeration addrespace, - * reserve the Sonics configuration register blocks for the - * use of our bus. */ - bus_reserved = 0; - if (i == SIBA_CORE_ADDRSPACE) - bus_reserved = cid->num_cfg_blocks * SIBA_CFG_SIZE; - - /* Append the region info */ - error = siba_append_dinfo_region(di, i, addr, size, - bus_reserved); - if (error) - return (error); - } - + *ivec = dinfo->core_id.intr_flag; return (0); } - /** - * Register all interrupt descriptors for @p dinfo. Must be called after - * configuration blocks have been mapped. - * - * @param dev The siba bus device. - * @param child The siba child device. - * @param dinfo The device info instance on which to register all interrupt - * descriptor entries. - * @param r A resource mapping the enumeration table block for @p di. - */ -static int -siba_register_interrupts(device_t dev, device_t child, - struct siba_devinfo *dinfo, struct bhnd_resource *r) -{ - uint32_t tpsflag; - int error; - - /* Is backplane interrupt distribution enabled for this core? */ - tpsflag = bhnd_bus_read_4(r, SB0_REG_ABS(SIBA_CFG0_TPSFLAG)); - if ((tpsflag & SIBA_TPS_F0EN0) == 0) { - dinfo->intr_en = false; - return (0); - } - - /* Have one interrupt */ - dinfo->intr_en = true; - dinfo->intr.flag = SIBA_REG_GET(tpsflag, TPS_NUM0); - dinfo->intr.mapped = false; - dinfo->intr.irq = 0; - dinfo->intr.rid = -1; - - /* Map the interrupt */ - error = BHND_BUS_MAP_INTR(dev, child, 0 /* single intr is always 0 */, - &dinfo->intr.irq); - if (error) { - device_printf(dev, "failed mapping interrupt line for core %u: " - "%d\n", dinfo->core_id.core_info.core_idx, error); - return (error); - } - dinfo->intr.mapped = true; - - /* Update the resource list */ - dinfo->intr.rid = resource_list_add_next(&dinfo->resources, SYS_RES_IRQ, - dinfo->intr.irq, dinfo->intr.irq, 1); - - return (0); -} - -/** * Map per-core configuration blocks for @p dinfo. * * @param dev The siba bus device. @@ -1386,21 +1284,27 @@ siba_child_deleted(device_t dev, device_t child) int siba_add_children(device_t dev) { - const struct bhnd_chipid *chipid; + bhnd_erom_t *erom; + struct siba_erom *siba_erom; + struct bhnd_erom_io *eio; + const struct bhnd_chipid *cid; struct siba_core_id *cores; - struct bhnd_resource *r; device_t *children; - int rid; int error; - cores = NULL; - r = NULL; + cid = BHND_BUS_GET_CHIPID(dev, dev); - chipid = BHND_BUS_GET_CHIPID(dev, dev); + /* Allocate our EROM parser */ + eio = bhnd_erom_iores_new(dev, SIBA_EROM_RID); + erom = bhnd_erom_alloc(&siba_erom_parser, cid, eio); + if (erom == NULL) { + bhnd_erom_io_fini(eio); + return (ENODEV); + } /* Allocate our temporary core and device table */ - cores = malloc(sizeof(*cores) * chipid->ncores, M_BHND, M_WAITOK); - children = malloc(sizeof(*children) * chipid->ncores, M_BHND, + cores = malloc(sizeof(*cores) * cid->ncores, M_BHND, M_WAITOK); + children = malloc(sizeof(*children) * cid->ncores, M_BHND, M_WAITOK | M_ZERO); /* @@ -1411,40 +1315,14 @@ siba_add_children(device_t dev) * defer mapping of the per-core siba(4) config blocks until all cores * have been enumerated and otherwise configured. */ - for (u_int i = 0; i < chipid->ncores; i++) { + siba_erom = (struct siba_erom *)erom; + for (u_int i = 0; i < cid->ncores; i++) { struct siba_devinfo *dinfo; device_t child; - uint32_t idhigh, idlow; - rman_res_t r_count, r_end, r_start; - /* Map the core's register block */ - rid = 0; - r_start = SIBA_CORE_ADDR(i); - r_count = SIBA_CORE_SIZE; - r_end = r_start + SIBA_CORE_SIZE - 1; - r = bhnd_alloc_resource(dev, SYS_RES_MEMORY, &rid, r_start, - r_end, r_count, RF_ACTIVE); - if (r == NULL) { - error = ENXIO; + if ((error = siba_erom_get_core_id(siba_erom, i, &cores[i]))) goto failed; - } - /* Read the core info */ - idhigh = bhnd_bus_read_4(r, SB0_REG_ABS(SIBA_CFG0_IDHIGH)); - idlow = bhnd_bus_read_4(r, SB0_REG_ABS(SIBA_CFG0_IDLOW)); - - cores[i] = siba_parse_core_id(idhigh, idlow, i, 0); - - /* Determine and set unit number */ - for (u_int j = 0; j < i; j++) { - struct bhnd_core_info *cur = &cores[i].core_info; - struct bhnd_core_info *prev = &cores[j].core_info; - - if (prev->vendor == cur->vendor && - prev->device == cur->device) - cur->unit++; - } - /* Add the child device */ child = BUS_ADD_CHILD(dev, 0, NULL, -1); if (child == NULL) { @@ -1460,30 +1338,22 @@ siba_add_children(device_t dev) goto failed; } - if ((error = siba_init_dinfo(dev, dinfo, &cores[i]))) + if ((error = siba_init_dinfo(dev, child, dinfo, &cores[i]))) goto failed; - /* Register the core's address space(s). */ - if ((error = siba_register_addrspaces(dev, dinfo, r))) - goto failed; - - /* Register the core's interrupts */ - if ((error = siba_register_interrupts(dev, child, dinfo, r))) - goto failed; - - /* Unmap the core's register block */ - bhnd_release_resource(dev, SYS_RES_MEMORY, rid, r); - r = NULL; - /* If pins are floating or the hardware is otherwise * unpopulated, the device shouldn't be used. */ if (bhnd_is_hw_disabled(child)) device_disable(child); } + /* Free EROM (and any bridge register windows it might hold) */ + bhnd_erom_free(erom); + erom = NULL; + /* Map all valid core's config register blocks and perform interrupt * assignment */ - for (u_int i = 0; i < chipid->ncores; i++) { + for (u_int i = 0; i < cid->ncores; i++) { struct siba_devinfo *dinfo; device_t child; @@ -1509,7 +1379,7 @@ siba_add_children(device_t dev) return (0); failed: - for (u_int i = 0; i < chipid->ncores; i++) { + for (u_int i = 0; i < cid->ncores; i++) { if (children[i] == NULL) continue; @@ -1518,9 +1388,8 @@ failed: free(cores, M_BHND); free(children, M_BHND); - - if (r != NULL) - bhnd_release_resource(dev, SYS_RES_MEMORY, rid, r); + if (erom != NULL) + bhnd_erom_free(erom); return (error); } Modified: head/sys/dev/bhnd/siba/siba_erom.c ============================================================================== --- head/sys/dev/bhnd/siba/siba_erom.c Mon Feb 12 19:08:17 2018 (r329179) +++ head/sys/dev/bhnd/siba/siba_erom.c Mon Feb 12 19:36:26 2018 (r329180) @@ -49,6 +49,8 @@ __FBSDID("$FreeBSD$"); #include "sibareg.h" #include "sibavar.h" +#include "siba_eromvar.h" + struct siba_erom; struct siba_erom_io; @@ -59,8 +61,9 @@ static int siba_eio_init(struct siba_erom_io *io, static uint32_t siba_eio_read_4(struct siba_erom_io *io, u_int core_idx, bus_size_t offset); -static struct siba_core_id siba_eio_read_core_id(struct siba_erom_io *io, - u_int core_idx, int unit); +static int siba_eio_read_core_id(struct siba_erom_io *io, + u_int core_idx, int unit, + struct siba_core_id *sid); static int siba_eio_read_chipid(struct siba_erom_io *io, bus_addr_t enum_addr, @@ -118,7 +121,8 @@ siba_erom_probe(bhnd_erom_class_t *cls, struct bhnd_er * BCM4710, it's a SDRAM core (0x803). */ - sid = siba_eio_read_core_id(&io, 0, 0); + if ((error = siba_eio_read_core_id(&io, 0, 0, &sid))) + return (error); if (sid.core_info.vendor != BHND_MFGID_BCM) return (ENXIO); @@ -227,19 +231,154 @@ siba_eio_read_4(struct siba_erom_io *io, u_int core_id * @param core_idx The core index. * @param unit The caller-specified unit number to be included in the return * value. + * @param[out] sid On success, the parsed siba core id. + * + * @retval 0 success + * @retval non-zero if reading or parsing the identification registers + * otherwise fails, a regular unix error code will be + * returned. */ -static struct siba_core_id -siba_eio_read_core_id(struct siba_erom_io *io, u_int core_idx, int unit) +static int +siba_eio_read_core_id(struct siba_erom_io *io, u_int core_idx, int unit, + struct siba_core_id *sid) { - uint32_t idhigh, idlow; + struct siba_admatch admatch[SIBA_MAX_ADDRSPACE]; + uint32_t idhigh, idlow; + uint32_t tpsflag; + uint16_t ocp_vendor; + uint8_t sonics_rev; + uint8_t num_admatch; + uint8_t num_admatch_en; + uint8_t num_cfg; + bool intr_en; + u_int intr_flag; + int error; idhigh = siba_eio_read_4(io, core_idx, SB0_REG_ABS(SIBA_CFG0_IDHIGH)); idlow = siba_eio_read_4(io, core_idx, SB0_REG_ABS(SIBA_CFG0_IDLOW)); + tpsflag = siba_eio_read_4(io, core_idx, SB0_REG_ABS(SIBA_CFG0_TPSFLAG)); - return (siba_parse_core_id(idhigh, idlow, core_idx, unit)); + ocp_vendor = SIBA_REG_GET(idhigh, IDH_VENDOR); + sonics_rev = SIBA_REG_GET(idlow, IDL_SBREV); + num_admatch = SIBA_REG_GET(idlow, IDL_NRADDR) + 1 /* + enum block */; + if (num_admatch > nitems(admatch)) { + printf("core%u: invalid admatch count %hhu\n", core_idx, + num_admatch); + return (EINVAL); + } + + /* Determine backplane interrupt distribution configuration */ + intr_en = ((tpsflag & SIBA_TPS_F0EN0) != 0); + intr_flag = SIBA_REG_GET(tpsflag, TPS_NUM0); + + /* Determine the number of sonics config register blocks */ + num_cfg = SIBA_CFG_NUM_2_2; + if (sonics_rev >= SIBA_IDL_SBREV_2_3) + num_cfg = SIBA_CFG_NUM_2_3; + + /* Parse all admatch descriptors */ + num_admatch_en = 0; + for (uint8_t i = 0; i < num_admatch; i++) { + uint32_t am_value; + u_int am_offset; + + KASSERT(i < nitems(admatch), ("invalid admatch index")); + + /* Determine the register offset */ + am_offset = siba_admatch_offset(i); + if (am_offset == 0) { + printf("core%u: addrspace %hhu is unsupported", + core_idx, i); + return (ENODEV); + } + + /* Read and parse the address match register */ + am_value = siba_eio_read_4(io, core_idx, am_offset); + error = siba_parse_admatch(am_value, &admatch[num_admatch_en]); + if (error) { + printf("core%u: failed to decode admatch[%hhu] " + "register value 0x%x\n", core_idx, i, am_value); + return (error); + } + + /* Skip disabled entries */ + if (!admatch[num_admatch_en].am_enabled) + continue; + + /* Reject unsupported negative matches. These are not used on + * any known devices */ + if (admatch[num_admatch_en].am_negative) { + printf("core%u: unsupported negative admatch[%hhu] " + "value 0x%x\n", core_idx, i, am_value); + return (ENXIO); + } + + num_admatch_en++; + } + + /* Populate the result */ + *sid = (struct siba_core_id) { + .core_info = { + .vendor = siba_get_bhnd_mfgid(ocp_vendor), + .device = SIBA_REG_GET(idhigh, IDH_DEVICE), + .hwrev = SIBA_IDH_CORE_REV(idhigh), + .core_idx = core_idx, + .unit = unit + }, + .sonics_vendor = ocp_vendor, + .sonics_rev = sonics_rev, + .intr_en = intr_en, + .intr_flag = intr_flag, + .num_admatch = num_admatch_en, + .num_cfg_blocks = num_cfg + }; + memcpy(sid->admatch, admatch, num_admatch_en * sizeof(admatch[0])); + + return (0); } /** + * Read and parse the SSB identification registers for the given @p core_index, + * returning the siba(4) core identification in @p sid. + * + * @param sc A siba EROM instance. + * @param core_idx The index of the core to be identified. + * @param[out] result On success, the parsed siba core id. + * + * @retval 0 success + * @retval non-zero if reading or parsing the identification registers + * otherwise fails, a regular unix error code will be + * returned. + */ +int +siba_erom_get_core_id(struct siba_erom *sc, u_int core_idx, + struct siba_core_id *result) +{ + struct siba_core_id sid; + int error; + + /* Fetch the core info, assuming a unit number of 0 */ + if ((error = siba_eio_read_core_id(&sc->io, core_idx, 0, &sid))) + return (error); + + /* Scan preceding cores to determine the real unit number. */ + for (u_int i = 0; i < core_idx; i++) { + struct siba_core_id prev; + + if ((error = siba_eio_read_core_id(&sc->io, i, 0, &prev))) + return (error); + + /* Bump the unit number? */ + if (sid.core_info.vendor == prev.core_info.vendor && + sid.core_info.device == prev.core_info.device) + sid.core_info.unit++; + } + + *result = sid; + return (0); +} + +/** * Read and parse the chip identification register from the ChipCommon core. * * @param io EROM I/O context. @@ -252,9 +391,12 @@ siba_eio_read_chipid(struct siba_erom_io *io, bus_addr { struct siba_core_id ccid; uint32_t idreg; + int error; /* Identify the chipcommon core */ - ccid = siba_eio_read_core_id(io, 0, 0); + if ((error = siba_eio_read_core_id(io, 0, 0, &ccid))) + return (error); + if (ccid.core_info.vendor != BHND_MFGID_BCM || ccid.core_info.device != BHND_COREID_CC) { @@ -281,6 +423,7 @@ siba_erom_lookup_core(bhnd_erom_t *erom, const struct { struct siba_erom *sc; struct bhnd_core_match imatch; + int error; sc = (struct siba_erom *)erom; @@ -294,7 +437,9 @@ siba_erom_lookup_core(bhnd_erom_t *erom, const struct struct bhnd_core_info ci; /* Read the core info */ - sid = siba_eio_read_core_id(&sc->io, i, 0); + if ((error = siba_eio_read_core_id(&sc->io, i, 0, &sid))) + return (error); + ci = sid.core_info; /* Check for initial match */ @@ -303,7 +448,9 @@ siba_erom_lookup_core(bhnd_erom_t *erom, const struct /* Re-scan preceding cores to determine the unit number. */ for (u_int j = 0; j < i; j++) { - sid = siba_eio_read_core_id(&sc->io, j, 0); + error = siba_eio_read_core_id(&sc->io, j, 0, &sid); + if (error) + return (error); /* Bump the unit number? */ if (sid.core_info.vendor == ci.vendor && @@ -332,7 +479,8 @@ siba_erom_lookup_core_addr(bhnd_erom_t *erom, const st struct siba_erom *sc; struct bhnd_core_info core; struct siba_core_id sid; - uint32_t am, am_addr, am_size; + struct siba_admatch admatch; + uint32_t am; u_int am_offset; u_int addrspace, cfg; @@ -345,7 +493,9 @@ siba_erom_lookup_core_addr(bhnd_erom_t *erom, const st return (error); /* Fetch full siba core ident */ - sid = siba_eio_read_core_id(&sc->io, core.core_idx, core.unit); + error = siba_eio_read_core_id(&sc->io, core.core_idx, core.unit, &sid); + if (error) + return (error); /* Is port valid? */ if (!siba_is_port_valid(&sid, type, port)) @@ -419,7 +569,7 @@ siba_erom_lookup_core_addr(bhnd_erom_t *erom, const st /* Read and parse the address match register */ am = siba_eio_read_4(&sc->io, core.core_idx, am_offset); - if ((error = siba_parse_admatch(am, &am_addr, &am_size))) { + if ((error = siba_parse_admatch(am, &admatch))) { printf("failed to decode address match register value 0x%x\n", am); return (error); @@ -428,8 +578,8 @@ siba_erom_lookup_core_addr(bhnd_erom_t *erom, const st if (info != NULL) *info = core; - *addr = am_addr; - *size = am_size; + *addr = admatch.am_base; + *size = admatch.am_size; return (0); } @@ -441,6 +591,7 @@ siba_erom_get_core_table(bhnd_erom_t *erom, struct bhn { struct siba_erom *sc; struct bhnd_core_info *out; + int error; sc = (struct siba_erom *)erom; @@ -457,7 +608,9 @@ siba_erom_get_core_table(bhnd_erom_t *erom, struct bhn struct siba_core_id sid; /* Read the core info */ - sid = siba_eio_read_core_id(&sc->io, i, 0); + if ((error = siba_eio_read_core_id(&sc->io, i, 0, &sid))) + return (error); + out[i] = sid.core_info; /* Determine unit number */ @@ -508,8 +661,9 @@ siba_erom_dump(bhnd_erom_t *erom) printf("\tnraddr\t0x%04x\n", nraddr); for (size_t addrspace = 0; addrspace < nraddr; addrspace++) { - uint32_t am, am_addr, am_size; - u_int am_offset; + struct siba_admatch admatch; + uint32_t am; + u_int am_offset; /* Determine the register offset */ am_offset = siba_admatch_offset(addrspace); @@ -521,16 +675,15 @@ siba_erom_dump(bhnd_erom_t *erom) /* Read and parse the address match register */ am = siba_eio_read_4(&sc->io, i, am_offset); - error = siba_parse_admatch(am, &am_addr, &am_size); - if (error) { + if ((error = siba_parse_admatch(am, &admatch))) { printf("failed to decode address match " "register value 0x%x\n", am); continue; } printf("\taddrspace %zu\n", addrspace); - printf("\t\taddr: 0x%08x\n", am_addr); - printf("\t\tsize: 0x%08x\n", am_size); + printf("\t\taddr: 0x%08x\n", admatch.am_base); + printf("\t\tsize: 0x%08x\n", admatch.am_size); } } Added: head/sys/dev/bhnd/siba/siba_eromvar.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/bhnd/siba/siba_eromvar.h Mon Feb 12 19:36:26 2018 (r329180) @@ -0,0 +1,46 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2018 Landon Fuller + * 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 _SIBA_SIBA_EROMVAR_H_ +#define _SIBA_SIBA_EROMVAR_H_ + +#include +#include + +#include "sibavar.h" + +struct siba_erom; + +#define SIBA_EROM_ + +int siba_erom_get_core_id(struct siba_erom *sc, u_int core_idx, + struct siba_core_id *result); + +#endif /* _SIBA_SIBA_EROMVAR_H_ */ Modified: head/sys/dev/bhnd/siba/siba_subr.c ============================================================================== --- head/sys/dev/bhnd/siba/siba_subr.c Mon Feb 12 19:08:17 2018 (r329179) +++ head/sys/dev/bhnd/siba/siba_subr.c Mon Feb 12 19:36:26 2018 (r329180) @@ -48,6 +48,12 @@ __FBSDID("$FreeBSD$"); #include "sibareg.h" #include "sibavar.h" +static int siba_register_interrupts(device_t dev, device_t child, + struct siba_devinfo *dinfo); +static int siba_append_dinfo_region(struct siba_devinfo *dinfo, + uint8_t addridx, uint32_t base, uint32_t size, + uint32_t bus_reserved); + /** * Map a siba(4) OCP vendor code to its corresponding JEDEC JEP-106 vendor * code. @@ -68,48 +74,6 @@ siba_get_bhnd_mfgid(uint16_t ocp_vendor) } /** - * Parse the SIBA_IDH_* fields from the per-core identification - * registers, returning a siba_core_id representation. - * - * @param idhigh The SIBA_R0_IDHIGH register. - * @param idlow The SIBA_R0_IDLOW register. - * @param core_id The core id (index) to include in the result. - * @param unit The unit number to include in the result. - */ -struct siba_core_id -siba_parse_core_id(uint32_t idhigh, uint32_t idlow, u_int core_idx, int unit) -{ - - uint16_t ocp_vendor; - uint8_t sonics_rev; - uint8_t num_addrspace; - uint8_t num_cfg; - - ocp_vendor = SIBA_REG_GET(idhigh, IDH_VENDOR); - sonics_rev = SIBA_REG_GET(idlow, IDL_SBREV); - num_addrspace = SIBA_REG_GET(idlow, IDL_NRADDR) + 1 /* + enum block */; - - /* Determine the number of sonics config register blocks */ - num_cfg = SIBA_CFG_NUM_2_2; - if (sonics_rev >= SIBA_IDL_SBREV_2_3) - num_cfg = SIBA_CFG_NUM_2_3; - - return (struct siba_core_id) { - .core_info = { - .vendor = siba_get_bhnd_mfgid(ocp_vendor), - .device = SIBA_REG_GET(idhigh, IDH_DEVICE), - .hwrev = SIBA_IDH_CORE_REV(idhigh), - .core_idx = core_idx, - .unit = unit - }, - .sonics_vendor = ocp_vendor, - .sonics_rev = sonics_rev, - .num_addrspace = num_addrspace, - .num_cfg_blocks = num_cfg - }; -} - -/** * Allocate and return a new empty device info structure. * * @param bus The requesting bus device. @@ -138,8 +102,12 @@ siba_alloc_dinfo(device_t bus) resource_list_init(&dinfo->resources); dinfo->pmu_state = SIBA_PMU_NONE; - dinfo->intr_en = false; + dinfo->intr = (struct siba_intr) { + .mapped = false, + .rid = -1 + }; + return dinfo; } @@ -148,6 +116,7 @@ siba_alloc_dinfo(device_t bus) * siba_alloc_dinfo, copying the provided core id. * * @param dev The requesting bus device. + * @param child The siba child device. * @param dinfo The device info instance. * @param core Device core info. * @@ -155,14 +124,81 @@ siba_alloc_dinfo(device_t bus) * @retval non-zero initialization failed. */ int -siba_init_dinfo(device_t dev, struct siba_devinfo *dinfo, +siba_init_dinfo(device_t dev, device_t child, struct siba_devinfo *dinfo, const struct siba_core_id *core_id) { + int error; + dinfo->core_id = *core_id; + + /* Register all address space mappings */ + for (uint8_t i = 0; i < core_id->num_admatch; i++) { + uint32_t bus_reserved; + + /* If this is the device's core/enumeration addrespace, + * reserve the Sonics configuration register blocks for the + * use of our bus. */ + bus_reserved = 0; + if (i == SIBA_CORE_ADDRSPACE) + bus_reserved = core_id->num_cfg_blocks * SIBA_CFG_SIZE; + + /* Append the region info */ + error = siba_append_dinfo_region(dinfo, i, + core_id->admatch[i].am_base, core_id->admatch[i].am_size, + bus_reserved); + if (error) + return (error); + } + + /* Register all interrupt(s) */ + if ((error = siba_register_interrupts(dev, child, dinfo))) + return (error); + return (0); } + /** + * Register and map all interrupts for @p dinfo. + * + * @param dev The siba bus device. + * @param child The siba child device. + * @param dinfo The device info instance on which to register all interrupt + * entries. + */ +static int +siba_register_interrupts(device_t dev, device_t child, + struct siba_devinfo *dinfo) +{ + int error; + + /* Is backplane interrupt distribution enabled for this core? */ + if (!dinfo->core_id.intr_en) + return (0); + + /* Have one interrupt */ + dinfo->intr.mapped = false; + dinfo->intr.irq = 0; + dinfo->intr.rid = -1; + + /* Map the interrupt */ + error = BHND_BUS_MAP_INTR(dev, child, 0 /* single intr is always 0 */, + &dinfo->intr.irq); + if (error) { + device_printf(dev, "failed mapping interrupt line for core %u: " + "%d\n", dinfo->core_id.core_info.core_idx, error); + return (error); + } + dinfo->intr.mapped = true; + + /* Update the resource list */ + dinfo->intr.rid = resource_list_add_next(&dinfo->resources, SYS_RES_IRQ, + dinfo->intr.irq, dinfo->intr.irq, 1); + + return (0); +} + +/** * Map an addrspace index to its corresponding bhnd(4) BHND_PORT_DEVICE port * number. * @@ -238,7 +274,7 @@ siba_port_count(struct siba_core_id *core_id, bhnd_por switch (port_type) { case BHND_PORT_DEVICE: /* 0, 1, or 2 ports */ - return (min(core_id->num_addrspace, 2)); + return (min(core_id->num_admatch, 2)); case BHND_PORT_AGENT: /* One agent port maps all configuration blocks */ @@ -292,11 +328,11 @@ siba_port_region_count(struct siba_core_id *core_id, b case BHND_PORT_DEVICE: /* The first address space, if any, is mapped to device0.0 */ if (port == 0) - return (min(core_id->num_addrspace, 1)); + return (min(core_id->num_admatch, 1)); /* All remaining address spaces are mapped to device0.(n - 1) */ - if (port == 1 && core_id->num_addrspace >= 2) - return (core_id->num_addrspace - 1); + if (port == 1 && core_id->num_admatch >= 2) + return (core_id->num_admatch - 1); break; @@ -327,7 +363,6 @@ siba_port_region_count(struct siba_core_id *core_id, b * agent0.0 0 * agent0.1 1 * - * @param num_addrspace The number of available siba address spaces. * @param port_type The bhnd(4) port type. * @param port The bhnd(4) port number. * @param region The bhnd(4) port region. @@ -394,7 +429,7 @@ siba_find_cfg_block(struct siba_devinfo *dinfo, bhnd_p * For compatibility with bcma(4), we map address spaces to port/region * identifiers as follows: * - * [port] [addrspace] + * [port.region] [admatch index] * device0.0 0 * device1.0 1 * device1.1 2 @@ -431,7 +466,7 @@ siba_addrspace_index(struct siba_core_id *core_id, bhn else return (ENOENT); - if (idx >= core_id->num_addrspace) + if (idx >= core_id->num_admatch) return (ENOENT); /* Found */ @@ -484,7 +519,7 @@ siba_find_addrspace(struct siba_devinfo *dinfo, bhnd_p * @retval 0 success * @retval non-zero An error occurred appending the entry. */ -int +static int siba_append_dinfo_region(struct siba_devinfo *dinfo, uint8_t addridx, uint32_t base, uint32_t size, uint32_t bus_reserved) { @@ -546,7 +581,7 @@ siba_free_dinfo(device_t dev, device_t child, struct s } /* Unmap the core's interrupt */ - if (dinfo->intr_en && dinfo->intr.mapped) { + if (dinfo->core_id.intr_en && dinfo->intr.mapped) { BHND_BUS_UNMAP_INTR(dev, child, dinfo->intr.irq); dinfo->intr.mapped = false; } @@ -585,36 +620,38 @@ siba_admatch_offset(uint8_t addrspace) * * @param addrspace The address space index. * @param am The address match register value to be parsed. - * @param[out] addr The parsed address. - * @param[out] size The parsed size. + * @param[out] admatch The parsed address match descriptor * * @retval 0 success * @retval non-zero a parse error occurred. */ int -siba_parse_admatch(uint32_t am, uint32_t *addr, uint32_t *size) +siba_parse_admatch(uint32_t am, struct siba_admatch *admatch) { - u_int am_type; + u_int am_type; - /* Negative encoding is not supported. This is not used on any - * currently known devices*/ - if (am & SIBA_AM_ADNEG) - return (EINVAL); - /* Extract the base address and size */ am_type = SIBA_REG_GET(am, AM_TYPE); switch (am_type) { case 0: - *addr = am & SIBA_AM_BASE0_MASK; - *size = 1 << (SIBA_REG_GET(am, AM_ADINT0) + 1); + /* Type 0 entries are always enabled, and do not support + * negative matching */ + admatch->am_base = am & SIBA_AM_BASE0_MASK; + admatch->am_size = 1 << (SIBA_REG_GET(am, AM_ADINT0) + 1); + admatch->am_enabled = true; + admatch->am_negative = false; break; case 1: - *addr = am & SIBA_AM_BASE1_MASK; - *size = 1 << (SIBA_REG_GET(am, AM_ADINT1) + 1); + admatch->am_base = am & SIBA_AM_BASE1_MASK; + admatch->am_size = 1 << (SIBA_REG_GET(am, AM_ADINT1) + 1); + admatch->am_enabled = ((am & SIBA_AM_ADEN) != 0); + admatch->am_negative = ((am & SIBA_AM_ADNEG) != 0); break; case 2: - *addr = am & SIBA_AM_BASE2_MASK; - *size = 1 << (SIBA_REG_GET(am, AM_ADINT2) + 1); + admatch->am_base = am & SIBA_AM_BASE2_MASK; + admatch->am_size = 1 << (SIBA_REG_GET(am, AM_ADINT2) + 1); + admatch->am_enabled = ((am & SIBA_AM_ADEN) != 0); + admatch->am_negative = ((am & SIBA_AM_ADNEG) != 0); break; default: return (EINVAL); Modified: head/sys/dev/bhnd/siba/sibavar.h ============================================================================== --- head/sys/dev/bhnd/siba/sibavar.h Mon Feb 12 19:08:17 2018 (r329179) +++ head/sys/dev/bhnd/siba/sibavar.h Mon Feb 12 19:36:26 2018 (r329180) @@ -37,6 +37,7 @@ #define _SIBA_SIBAVAR_H_ #include +#include #include #include #include @@ -52,6 +53,7 @@ */ struct siba_addrspace; +struct siba_admatch; struct siba_cfg_block; struct siba_devinfo; struct siba_core_id; @@ -68,13 +70,10 @@ int siba_get_intr_ivec(device_t dev, device_t child uint16_t siba_get_bhnd_mfgid(uint16_t ocp_vendor); -struct siba_core_id siba_parse_core_id(uint32_t idhigh, uint32_t idlow, - u_int core_idx, int unit); - int siba_add_children(device_t bus); struct siba_devinfo *siba_alloc_dinfo(device_t dev); -int siba_init_dinfo(device_t dev, +int siba_init_dinfo(device_t dev, device_t child, struct siba_devinfo *dinfo, const struct siba_core_id *core_id); void siba_free_dinfo(device_t dev, device_t child, @@ -109,13 +108,9 @@ struct siba_addrspace *siba_find_addrspace(struct siba *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Mon Feb 12 19:49:21 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 97466F16B34; Mon, 12 Feb 2018 19:49:21 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 45F0769E47; Mon, 12 Feb 2018 19:49:21 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 40C0216648; Mon, 12 Feb 2018 19:49:21 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1CJnLnG038517; Mon, 12 Feb 2018 19:49:21 GMT (envelope-from vangyzen@FreeBSD.org) Received: (from vangyzen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1CJnLl4038516; Mon, 12 Feb 2018 19:49:21 GMT (envelope-from vangyzen@FreeBSD.org) Message-Id: <201802121949.w1CJnLl4038516@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vangyzen set sender to vangyzen@FreeBSD.org using -f From: Eric van Gyzen Date: Mon, 12 Feb 2018 19:49:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329181 - head/sys/netinet6 X-SVN-Group: head X-SVN-Commit-Author: vangyzen X-SVN-Commit-Paths: head/sys/netinet6 X-SVN-Commit-Revision: 329181 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Feb 2018 19:49:21 -0000 Author: vangyzen Date: Mon Feb 12 19:49:20 2018 New Revision: 329181 URL: https://svnweb.freebsd.org/changeset/base/329181 Log: Update the MTU in affected routes when IPv6 RA changes the MTU ip6_calcmtu() only looks at the interface MTU if neither the TCP hostcache nor the route provides an MTU. Update the routes so they do not provide stale MTUs. This fixes UNH IPv6 conformance test cases v6LC_4_1_08 and v6LC_4_1_09, which use a RA to reduce the link MTU from 1500 to 1280. Reported and tested by: Farrell Woods Reviewed by: dab, melifaro Discussed with: ae MFC after: 1 week Sponsored by: Dell EMC Differential Revision: https://reviews.freebsd.org/D14257 Modified: head/sys/netinet6/nd6_rtr.c Modified: head/sys/netinet6/nd6_rtr.c ============================================================================== --- head/sys/netinet6/nd6_rtr.c Mon Feb 12 19:36:26 2018 (r329180) +++ head/sys/netinet6/nd6_rtr.c Mon Feb 12 19:49:20 2018 (r329181) @@ -408,8 +408,11 @@ nd6_ra_input(struct mbuf *m, int off, int icmp6len) int change = (ndi->linkmtu != mtu); ndi->linkmtu = mtu; - if (change) /* in6_maxmtu may change */ + if (change) { + /* in6_maxmtu may change */ in6_setmaxmtu(); + rt_updatemtu(ifp); + } } else { nd6log((LOG_INFO, "nd6_ra_input: bogus mtu " "mtu=%lu sent from %s; " From owner-svn-src-all@freebsd.org Mon Feb 12 19:50:44 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 26C69F16D30; Mon, 12 Feb 2018 19:50:44 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CD6056A150; Mon, 12 Feb 2018 19:50:43 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C84A416662; Mon, 12 Feb 2018 19:50:43 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1CJohav038786; Mon, 12 Feb 2018 19:50:43 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1CJohFV038785; Mon, 12 Feb 2018 19:50:43 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201802121950.w1CJohFV038785@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Mon, 12 Feb 2018 19:50:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r329182 - stable/11 X-SVN-Group: stable-11 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: stable/11 X-SVN-Commit-Revision: 329182 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Feb 2018 19:50:44 -0000 Author: kevans Date: Mon Feb 12 19:50:43 2018 New Revision: 329182 URL: https://svnweb.freebsd.org/changeset/base/329182 Log: Correct date in ObsoleteFiles Getting a little ahead of myself here- correct the date to today. Modified: stable/11/ObsoleteFiles.inc Modified: stable/11/ObsoleteFiles.inc ============================================================================== --- stable/11/ObsoleteFiles.inc Mon Feb 12 19:49:20 2018 (r329181) +++ stable/11/ObsoleteFiles.inc Mon Feb 12 19:50:43 2018 (r329182) @@ -38,7 +38,7 @@ # xargs -n1 | sort | uniq -d; # done -# 20180222: Remove libstand +# 20180212: Remove libstand OLD_FILES+=usr/lib/libstand.a OLD_FILES+=usr/lib/libstand_p.a OLD_FILES+=usr/include/stand.h From owner-svn-src-all@freebsd.org Mon Feb 12 20:51:29 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AAA56F1BA81; Mon, 12 Feb 2018 20:51:29 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 578506D0ED; Mon, 12 Feb 2018 20:51:29 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3855A1707B; Mon, 12 Feb 2018 20:51:29 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1CKpT0U072131; Mon, 12 Feb 2018 20:51:29 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1CKpSxw072122; Mon, 12 Feb 2018 20:51:28 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201802122051.w1CKpSxw072122@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Mon, 12 Feb 2018 20:51:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r329183 - in stable/11: . stand stand/arm/uboot stand/common stand/efi/boot1 stand/efi/fdt stand/efi/include stand/efi/libefi stand/efi/loader stand/efi/loader/arch/arm stand/efi/loader... X-SVN-Group: stable-11 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in stable/11: . stand stand/arm/uboot stand/common stand/efi/boot1 stand/efi/fdt stand/efi/include stand/efi/libefi stand/efi/loader stand/efi/loader/arch/arm stand/efi/loader/arch/i386 stand/fdt stan... X-SVN-Commit-Revision: 329183 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Feb 2018 20:51:30 -0000 Author: kevans Date: Mon Feb 12 20:51:28 2018 New Revision: 329183 URL: https://svnweb.freebsd.org/changeset/base/329183 Log: MFC Loader Fixes Final: r327612,r327703,r327704,r327878,r327879,r327881, r328007,r328029,r328030,r328031,r328061,r328156,r328169,r328288,r328289, r328290,r328291,r328292,r328411,r328536,r328603,r328614,r328642,r328769, r328779,r328780,r328781,r328782,r328783,r328806,r328808,r328826,r328835, r328911,r328986,r328987,r328990,r328999,r329000,r329019,r329050,r329054, r329060 r327612: Invent new #defines for the biospci_{read,write}_config function r327703: Define __dmadat after #include'ing ufsread.c. r327704: Fix printf missing format variables warnings. r327878: Add GUID for UEFI boot manager variables. r327879: Report the boot order and where we are in that boot order. r327881: Allow this file to be included r328007: Fix booting on some arm64 systems after r327879 by fixing the call to utf8_to_ucs2 r328029: When returning an error and freeing allocated memory from ucs2_to_utf8, NULL the return pointer. r328030: Check the return value from utf8_to_ucs2 instead of whether or not uv is NULL. r328031: Need to free uv after we're done using it. r328061: utf8_to_ucs2() should check for malloc failure r328156: stand: Move sections around to fix stand/ build with ld.lld on armv7 r328169: Remove extra copy of bootinfo.c. It's a bit rotted copy of the one in efi/loader. r328288: Fix some resource leaks. r328289: Don't leak memory when displaying help. r328290: On malloc failure, be sure to close the include file that triggered it. r328291: getenv does not return tainted data in the boot loader. Attempt to clue Coverity into that fact. r328292: There's no tainted data here, tag it as such to avoid false positives. r328411: loader.efi: add missing EFI GUIDs r328536: loader: support for mixed-endianness ELF/loader and POWER8 r328603: Add missing non-POWERPC case to give the scr value something non-zero. r328614: Move libstand.3 to libsa.3. Update libsa.3 to include functions r328642: Break out the interpreters (simple and forth) w/o ifdefs. r328769: Centralize several variables. r328779: Retire pnp.4th and the code needed only for 4th words used here. r328780: These 4th words were an attempt to allow integration into the boot loader scripts. However, that path won't be taken after all it seems. r328781: Remove pcibios forth support. r328782: Now that we no longer conditionally compile some files outside of ficl r328783: Invent new LDR_INTERP for the loader interpreter to use. r328806: We need more heap space to properly load newer powerpc kernels. r328808: Implement strcoll as strcmp. r328826: Make cross-endian loader changes apply only to powerpc r328835: Fix regression introduced in r328806, preventing boot on many platforms. r328911: Ignore relocation tables for non-memory-resident sections. r328986: Fix relative location of USB sources after recent move. r328987: A more definitions to kernel emulation shim in order to build stand/usb. r328990: Move the stand/usb test loader into its own directory. r328999: Fix indentation to FreeBSD standard for interp files r329000: Move simple interpreter 'perform' into interp.c and call it r329019: Move to tabs for indentation and to 8-space notches, per style(9). r329050: Fix build of userboot.so r329054: Set script.lang in the environment to either 'forth' or 'simple' to reflect what scripting language was compiled into the loader. r329060: loader: fix endianness conversion PR: 225323 Added: stable/11/stand/common/interp_simple.c - copied, changed from r328642, head/stand/common/interp_simple.c stable/11/stand/libsa/libsa.3 - copied, changed from r329182, stable/11/stand/libsa/libstand.3 stable/11/stand/usb/test/ - copied from r328990, head/stand/usb/test/ Deleted: stable/11/stand/efi/loader/arch/i386/bootinfo.c stable/11/stand/forth/pcibios.4th stable/11/stand/forth/pnp.4th stable/11/stand/libsa/libstand.3 stable/11/stand/usb/Makefile.test stable/11/stand/usb/bsd_usbloader_test.c Modified: stable/11/ObsoleteFiles.inc stable/11/stand/arm/uboot/Makefile stable/11/stand/arm/uboot/ldscript.arm stable/11/stand/common/boot.c stable/11/stand/common/bootstrap.h stable/11/stand/common/commands.c stable/11/stand/common/install.c stable/11/stand/common/interp.c stable/11/stand/common/interp_backslash.c stable/11/stand/common/interp_forth.c stable/11/stand/common/interp_parse.c stable/11/stand/common/load_elf.c stable/11/stand/common/load_elf_obj.c stable/11/stand/common/misc.c stable/11/stand/common/pnp.c stable/11/stand/defs.mk stable/11/stand/efi/boot1/Makefile stable/11/stand/efi/boot1/boot1.c stable/11/stand/efi/fdt/Makefile stable/11/stand/efi/include/efi.h stable/11/stand/efi/include/efiapi.h stable/11/stand/efi/libefi/Makefile stable/11/stand/efi/libefi/efichar.c stable/11/stand/efi/libefi/env.c stable/11/stand/efi/loader/Makefile stable/11/stand/efi/loader/arch/arm/ldscript.arm stable/11/stand/efi/loader/main.c stable/11/stand/fdt/Makefile stable/11/stand/ficl.mk stable/11/stand/ficl/Makefile stable/11/stand/forth/Makefile stable/11/stand/forth/loader.4th stable/11/stand/geli/Makefile stable/11/stand/i386/boot0/Makefile stable/11/stand/i386/btx/btx/Makefile stable/11/stand/i386/btx/btxldr/Makefile stable/11/stand/i386/btx/lib/Makefile stable/11/stand/i386/cdboot/Makefile stable/11/stand/i386/kgzldr/Makefile stable/11/stand/i386/libfirewire/Makefile stable/11/stand/i386/libfirewire/firewire.c stable/11/stand/i386/libi386/Makefile stable/11/stand/i386/libi386/biospci.c stable/11/stand/i386/libi386/comconsole.c stable/11/stand/i386/libi386/libi386.h stable/11/stand/i386/loader/Makefile stable/11/stand/i386/mbr/Makefile stable/11/stand/i386/pmbr/Makefile stable/11/stand/kshim/bsd_kernel.h stable/11/stand/libsa/Makefile stable/11/stand/libsa/environment.c stable/11/stand/libsa/stand.h stable/11/stand/loader.mk stable/11/stand/mips/beri/boot2/Makefile stable/11/stand/mips/beri/boot2/boot2.c stable/11/stand/mips/beri/loader/Makefile stable/11/stand/mips/beri/loader/exec.c stable/11/stand/mips/uboot/Makefile stable/11/stand/ofw/common/main.c stable/11/stand/ofw/libofw/Makefile stable/11/stand/ofw/libofw/elf_freebsd.c stable/11/stand/ofw/libofw/libofw.h stable/11/stand/ofw/libofw/ofw_copy.c stable/11/stand/ofw/libofw/ofw_memory.c stable/11/stand/ofw/libofw/ppc64_elf_freebsd.c stable/11/stand/powerpc/boot1.chrp/Makefile stable/11/stand/powerpc/kboot/Makefile stable/11/stand/powerpc/kboot/conf.c stable/11/stand/powerpc/kboot/host_syscall.S stable/11/stand/powerpc/kboot/host_syscall.h stable/11/stand/powerpc/kboot/hostdisk.c stable/11/stand/powerpc/kboot/kerneltramp.S stable/11/stand/powerpc/kboot/main.c stable/11/stand/powerpc/kboot/metadata.c stable/11/stand/powerpc/kboot/ppc64_elf_freebsd.c stable/11/stand/powerpc/ofw/Makefile stable/11/stand/powerpc/ofw/ldscript.powerpc stable/11/stand/powerpc/uboot/Makefile stable/11/stand/sparc64/boot1/Makefile stable/11/stand/sparc64/loader/Makefile stable/11/stand/uboot/fdt/Makefile stable/11/stand/uboot/lib/Makefile stable/11/stand/usb/usbcore.mk stable/11/stand/userboot/test/Makefile stable/11/stand/userboot/userboot/Makefile stable/11/stand/zfs/Makefile stable/11/sys/kern/link_elf_obj.c Directory Properties: stable/11/ (props changed) Modified: stable/11/ObsoleteFiles.inc ============================================================================== --- stable/11/ObsoleteFiles.inc Mon Feb 12 19:50:43 2018 (r329182) +++ stable/11/ObsoleteFiles.inc Mon Feb 12 20:51:28 2018 (r329183) @@ -38,6 +38,9 @@ # xargs -n1 | sort | uniq -d; # done +# 20180212: Obsolete forth files +OLD_FILES+=boot/efi.4th +OLD_FILES+=boot/pcibios.4th # 20180212: Remove libstand OLD_FILES+=usr/lib/libstand.a OLD_FILES+=usr/lib/libstand_p.a Modified: stable/11/stand/arm/uboot/Makefile ============================================================================== --- stable/11/stand/arm/uboot/Makefile Mon Feb 12 19:50:43 2018 (r329182) +++ stable/11/stand/arm/uboot/Makefile Mon Feb 12 20:51:28 2018 (r329183) @@ -41,8 +41,8 @@ LDFLAGS+= -Wl,-znotext CFLAGS+= -fPIC -DPADD= ${LIBFICL} ${LIBUBOOT} ${LIBFDT} ${LIBUBOOT_FDT} ${LIBSA} -LDADD= ${LIBFICL} ${LIBUBOOT} ${LIBFDT} ${LIBUBOOT_FDT} ${LIBSA} +DPADD= ${LDR_INTERP} ${LIBUBOOT} ${LIBFDT} ${LIBUBOOT_FDT} ${LIBSA} +LDADD= ${LDR_INTERP} ${LIBUBOOT} ${LIBFDT} ${LIBUBOOT_FDT} ${LIBSA} OBJS+= ${SRCS:N*.h:R:S/$/.o/g} Modified: stable/11/stand/arm/uboot/ldscript.arm ============================================================================== --- stable/11/stand/arm/uboot/ldscript.arm Mon Feb 12 19:50:43 2018 (r329182) +++ stable/11/stand/arm/uboot/ldscript.arm Mon Feb 12 20:51:28 2018 (r329183) @@ -32,6 +32,11 @@ SECTIONS .rela.got : { *(.rela.got) } .rela.got1 : { *(.rela.got1) } .rela.got2 : { *(.rela.got2) } + .dynamic : { *(.dynamic) } + PROVIDE (_GOT_START_ = .); + .got : { *(.got) } + .got.plt : { *(.got.plt) } + PROVIDE (_GOT_END_ = .); .rela.ctors : { *(.rela.ctors) } .rela.dtors : { *(.rela.dtors) } .rela.init : { *(.rela.init) } @@ -58,7 +63,6 @@ SECTIONS } .data1 : { *(.data1) } .got1 : { *(.got1) } - .dynamic : { *(.dynamic) } /* Put .ctors and .dtors next to the .got2 section, so that the pointers get relocated with -mrelocatable. Also put in the .fixup pointers. The current compiler no longer needs this, but keep it around for 2.7.2 */ @@ -74,10 +78,6 @@ SECTIONS .fixup : { *(.fixup) } PROVIDE (_FIXUP_END_ = .); PROVIDE (_GOT2_END_ = .); - PROVIDE (_GOT_START_ = .); - .got : { *(.got) } - .got.plt : { *(.got.plt) } - PROVIDE (_GOT_END_ = .); /* We want the small data sections together, so single-instruction offsets can access them all, and initialized data all before uninitialized, so we can shorten the on-disk segment size. */ Modified: stable/11/stand/common/boot.c ============================================================================== --- stable/11/stand/common/boot.c Mon Feb 12 19:50:43 2018 (r329182) +++ stable/11/stand/common/boot.c Mon Feb 12 20:51:28 2018 (r329183) @@ -52,60 +52,60 @@ COMMAND_SET(boot, "boot", "boot a file or loaded kerne static int command_boot(int argc, char *argv[]) { - struct preloaded_file *fp; + struct preloaded_file *fp; - /* - * See if the user has specified an explicit kernel to boot. - */ - if ((argc > 1) && (argv[1][0] != '-')) { + /* + * See if the user has specified an explicit kernel to boot. + */ + if ((argc > 1) && (argv[1][0] != '-')) { - /* XXX maybe we should discard everything and start again? */ - if (file_findfile(NULL, NULL) != NULL) { - snprintf(command_errbuf, sizeof(command_errbuf), - "can't boot '%s', kernel module already loaded", argv[1]); - return(CMD_ERROR); + /* XXX maybe we should discard everything and start again? */ + if (file_findfile(NULL, NULL) != NULL) { + snprintf(command_errbuf, sizeof(command_errbuf), + "can't boot '%s', kernel module already loaded", argv[1]); + return(CMD_ERROR); + } + + /* find/load the kernel module */ + if (mod_loadkld(argv[1], argc - 2, argv + 2) != 0) + return(CMD_ERROR); + /* we have consumed all arguments */ + argc = 1; } - /* find/load the kernel module */ - if (mod_loadkld(argv[1], argc - 2, argv + 2) != 0) - return(CMD_ERROR); - /* we have consumed all arguments */ - argc = 1; - } + /* + * See if there is a kernel module already loaded + */ + if (file_findfile(NULL, NULL) == NULL) + if (loadakernel(0, argc - 1, argv + 1)) + /* we have consumed all arguments */ + argc = 1; - /* - * See if there is a kernel module already loaded - */ - if (file_findfile(NULL, NULL) == NULL) - if (loadakernel(0, argc - 1, argv + 1)) - /* we have consumed all arguments */ - argc = 1; + /* + * Loaded anything yet? + */ + if ((fp = file_findfile(NULL, NULL)) == NULL) { + command_errmsg = "no bootable kernel"; + return(CMD_ERROR); + } - /* - * Loaded anything yet? - */ - if ((fp = file_findfile(NULL, NULL)) == NULL) { - command_errmsg = "no bootable kernel"; - return(CMD_ERROR); - } + /* + * If we were given arguments, discard any previous. + * XXX should we merge arguments? Hard to DWIM. + */ + if (argc > 1) { + if (fp->f_args != NULL) + free(fp->f_args); + fp->f_args = unargv(argc - 1, argv + 1); + } - /* - * If we were given arguments, discard any previous. - * XXX should we merge arguments? Hard to DWIM. - */ - if (argc > 1) { - if (fp->f_args != NULL) - free(fp->f_args); - fp->f_args = unargv(argc - 1, argv + 1); - } + /* Hook for platform-specific autoloading of modules */ + if (archsw.arch_autoload() != 0) + return(CMD_ERROR); - /* Hook for platform-specific autoloading of modules */ - if (archsw.arch_autoload() != 0) + /* Call the exec handler from the loader matching the kernel */ + file_formats[fp->f_loader]->l_exec(fp); return(CMD_ERROR); - - /* Call the exec handler from the loader matching the kernel */ - file_formats[fp->f_loader]->l_exec(fp); - return(CMD_ERROR); } @@ -118,29 +118,29 @@ COMMAND_SET(autoboot, "autoboot", "boot automatically static int command_autoboot(int argc, char *argv[]) { - int howlong; - char *cp, *prompt; + int howlong; + char *cp, *prompt; - prompt = NULL; - howlong = -1; - switch(argc) { - case 3: - prompt = argv[2]; - /* FALLTHROUGH */ - case 2: - howlong = strtol(argv[1], &cp, 0); - if (*cp != 0) { - snprintf(command_errbuf, sizeof(command_errbuf), - "bad delay '%s'", argv[1]); - return(CMD_ERROR); + prompt = NULL; + howlong = -1; + switch(argc) { + case 3: + prompt = argv[2]; + /* FALLTHROUGH */ + case 2: + howlong = strtol(argv[1], &cp, 0); + if (*cp != 0) { + snprintf(command_errbuf, sizeof(command_errbuf), + "bad delay '%s'", argv[1]); + return(CMD_ERROR); + } + /* FALLTHROUGH */ + case 1: + return(autoboot(howlong, prompt)); } - /* FALLTHROUGH */ - case 1: - return(autoboot(howlong, prompt)); - } - command_errmsg = "too many arguments"; - return(CMD_ERROR); + command_errmsg = "too many arguments"; + return(CMD_ERROR); } /* @@ -150,103 +150,103 @@ command_autoboot(int argc, char *argv[]) void autoboot_maybe() { - char *cp; + char *cp; - cp = getenv("autoboot_delay"); - if ((autoboot_tried == 0) && ((cp == NULL) || strcasecmp(cp, "NO"))) - autoboot(-1, NULL); /* try to boot automatically */ + cp = getenv("autoboot_delay"); + if ((autoboot_tried == 0) && ((cp == NULL) || strcasecmp(cp, "NO"))) + autoboot(-1, NULL); /* try to boot automatically */ } int autoboot(int timeout, char *prompt) { - time_t when, otime, ntime; - int c, yes; - char *argv[2], *cp, *ep; - char *kernelname; + time_t when, otime, ntime; + int c, yes; + char *argv[2], *cp, *ep; + char *kernelname; #ifdef BOOT_PROMPT_123 - const char *seq = "123", *p = seq; + const char *seq = "123", *p = seq; #endif - autoboot_tried = 1; + autoboot_tried = 1; - if (timeout == -1) { - timeout = 10; - /* try to get a delay from the environment */ - if ((cp = getenv("autoboot_delay"))) { - timeout = strtol(cp, &ep, 0); - if (cp == ep) - timeout = 10; /* Unparseable? Set default! */ + if (timeout == -1) { + timeout = 10; + /* try to get a delay from the environment */ + if ((cp = getenv("autoboot_delay"))) { + timeout = strtol(cp, &ep, 0); + if (cp == ep) + timeout = 10; /* Unparseable? Set default! */ + } } - } - kernelname = getenv("kernelname"); - if (kernelname == NULL) { - argv[0] = NULL; - loadakernel(0, 0, argv); kernelname = getenv("kernelname"); if (kernelname == NULL) { - command_errmsg = "no valid kernel found"; - return(CMD_ERROR); + argv[0] = NULL; + loadakernel(0, 0, argv); + kernelname = getenv("kernelname"); + if (kernelname == NULL) { + command_errmsg = "no valid kernel found"; + return(CMD_ERROR); + } } - } - if (timeout >= 0) { - otime = time(NULL); - when = otime + timeout; /* when to boot */ + if (timeout >= 0) { + otime = time(NULL); + when = otime + timeout; /* when to boot */ - yes = 0; + yes = 0; #ifdef BOOT_PROMPT_123 - printf("%s\n", (prompt == NULL) ? "Hit [Enter] to boot immediately, or " - "1 2 3 sequence for command prompt." : prompt); + printf("%s\n", (prompt == NULL) ? "Hit [Enter] to boot immediately, or " + "1 2 3 sequence for command prompt." : prompt); #else - printf("%s\n", (prompt == NULL) ? "Hit [Enter] to boot immediately, or any other key for command prompt." : prompt); + printf("%s\n", (prompt == NULL) ? "Hit [Enter] to boot immediately, or any other key for command prompt." : prompt); #endif - for (;;) { - if (ischar()) { - c = getchar(); + for (;;) { + if (ischar()) { + c = getchar(); #ifdef BOOT_PROMPT_123 - if ((c == '\r') || (c == '\n')) { - yes = 1; - break; - } else if (c != *p++) - p = seq; - if (*p == 0) - break; + if ((c == '\r') || (c == '\n')) { + yes = 1; + break; + } else if (c != *p++) + p = seq; + if (*p == 0) + break; #else - if ((c == '\r') || (c == '\n')) - yes = 1; - break; + if ((c == '\r') || (c == '\n')) + yes = 1; + break; #endif - } - ntime = time(NULL); - if (ntime >= when) { - yes = 1; - break; - } + } + ntime = time(NULL); + if (ntime >= when) { + yes = 1; + break; + } - if (ntime != otime) { - printf("\rBooting [%s] in %d second%s... ", - kernelname, (int)(when - ntime), - (when-ntime)==1?"":"s"); - otime = ntime; - } - } - } else { - yes = 1; - } + if (ntime != otime) { + printf("\rBooting [%s] in %d second%s... ", + kernelname, (int)(when - ntime), + (when-ntime)==1?"":"s"); + otime = ntime; + } + } + } else { + yes = 1; + } - if (yes) - printf("\rBooting [%s]... ", kernelname); - putchar('\n'); - if (yes) { - argv[0] = "boot"; - argv[1] = NULL; - return(command_boot(1, argv)); - } - return(CMD_OK); + if (yes) + printf("\rBooting [%s]... ", kernelname); + putchar('\n'); + if (yes) { + argv[0] = "boot"; + argv[1] = NULL; + return(command_boot(1, argv)); + } + return(CMD_OK); } /* @@ -255,43 +255,43 @@ autoboot(int timeout, char *prompt) static char * getbootfile(int try) { - static char *name = NULL; - const char *spec, *ep; - size_t len; + static char *name = NULL; + const char *spec, *ep; + size_t len; - /* we use dynamic storage */ - if (name != NULL) { - free(name); - name = NULL; - } + /* we use dynamic storage */ + if (name != NULL) { + free(name); + name = NULL; + } - /* - * Try $bootfile, then try our builtin default - */ - if ((spec = getenv("bootfile")) == NULL) - spec = default_bootfiles; + /* + * Try $bootfile, then try our builtin default + */ + if ((spec = getenv("bootfile")) == NULL) + spec = default_bootfiles; - while ((try > 0) && (spec != NULL)) { - spec = strchr(spec, ';'); - if (spec) - spec++; /* skip over the leading ';' */ - try--; - } - if (spec != NULL) { - if ((ep = strchr(spec, ';')) != NULL) { - len = ep - spec; - } else { - len = strlen(spec); + while ((try > 0) && (spec != NULL)) { + spec = strchr(spec, ';'); + if (spec) + spec++; /* skip over the leading ';' */ + try--; } - name = malloc(len + 1); - strncpy(name, spec, len); - name[len] = 0; - } - if (name && name[0] == 0) { - free(name); - name = NULL; - } - return(name); + if (spec != NULL) { + if ((ep = strchr(spec, ';')) != NULL) { + len = ep - spec; + } else { + len = strlen(spec); + } + name = malloc(len + 1); + strncpy(name, spec, len); + name[len] = 0; + } + if (name && name[0] == 0) { + free(name); + name = NULL; + } + return(name); } /* @@ -307,104 +307,109 @@ getbootfile(int try) int getrootmount(char *rootdev) { - char lbuf[128], *cp, *ep, *dev, *fstyp, *options; - int fd, error; + char lbuf[128], *cp, *ep, *dev, *fstyp, *options; + int fd, error; - if (getenv("vfs.root.mountfrom") != NULL) - return(0); + if (getenv("vfs.root.mountfrom") != NULL) + return(0); - error = 1; - sprintf(lbuf, "%s/etc/fstab", rootdev); - if ((fd = open(lbuf, O_RDONLY)) < 0) - goto notfound; + error = 1; + sprintf(lbuf, "%s/etc/fstab", rootdev); + if ((fd = open(lbuf, O_RDONLY)) < 0) + goto notfound; - /* loop reading lines from /etc/fstab What was that about sscanf again? */ - while (fgetstr(lbuf, sizeof(lbuf), fd) >= 0) { - if ((lbuf[0] == 0) || (lbuf[0] == '#')) - continue; + /* loop reading lines from /etc/fstab What was that about sscanf again? */ + fstyp = NULL; + dev = NULL; + while (fgetstr(lbuf, sizeof(lbuf), fd) >= 0) { + if ((lbuf[0] == 0) || (lbuf[0] == '#')) + continue; - /* skip device name */ - for (cp = lbuf; (*cp != 0) && !isspace(*cp); cp++) - ; - if (*cp == 0) /* misformatted */ - continue; - /* delimit and save */ - *cp++ = 0; - dev = strdup(lbuf); + /* skip device name */ + for (cp = lbuf; (*cp != 0) && !isspace(*cp); cp++) + ; + if (*cp == 0) /* misformatted */ + continue; + /* delimit and save */ + *cp++ = 0; + free(dev); + dev = strdup(lbuf); - /* skip whitespace up to mountpoint */ - while ((*cp != 0) && isspace(*cp)) - cp++; - /* must have / to be root */ - if ((*cp == 0) || (*cp != '/') || !isspace(*(cp + 1))) - continue; - /* skip whitespace up to fstype */ - cp += 2; - while ((*cp != 0) && isspace(*cp)) - cp++; - if (*cp == 0) /* misformatted */ - continue; - /* skip text to end of fstype and delimit */ - ep = cp; - while ((*cp != 0) && !isspace(*cp)) - cp++; - *cp = 0; - fstyp = strdup(ep); + /* skip whitespace up to mountpoint */ + while ((*cp != 0) && isspace(*cp)) + cp++; + /* must have / to be root */ + if ((*cp == 0) || (*cp != '/') || !isspace(*(cp + 1))) + continue; + /* skip whitespace up to fstype */ + cp += 2; + while ((*cp != 0) && isspace(*cp)) + cp++; + if (*cp == 0) /* misformatted */ + continue; + /* skip text to end of fstype and delimit */ + ep = cp; + while ((*cp != 0) && !isspace(*cp)) + cp++; + *cp = 0; + free(fstyp); + fstyp = strdup(ep); - /* skip whitespace up to mount options */ - cp += 1; - while ((*cp != 0) && isspace(*cp)) - cp++; - if (*cp == 0) /* misformatted */ - continue; - /* skip text to end of mount options and delimit */ - ep = cp; - while ((*cp != 0) && !isspace(*cp)) - cp++; - *cp = 0; - options = strdup(ep); - /* Build the : and save it in vfs.root.mountfrom */ - sprintf(lbuf, "%s:%s", fstyp, dev); + /* skip whitespace up to mount options */ + cp += 1; + while ((*cp != 0) && isspace(*cp)) + cp++; + if (*cp == 0) /* misformatted */ + continue; + /* skip text to end of mount options and delimit */ + ep = cp; + while ((*cp != 0) && !isspace(*cp)) + cp++; + *cp = 0; + options = strdup(ep); + /* Build the : and save it in vfs.root.mountfrom */ + sprintf(lbuf, "%s:%s", fstyp, dev); + setenv("vfs.root.mountfrom", lbuf, 0); + + /* Don't override vfs.root.mountfrom.options if it is already set */ + if (getenv("vfs.root.mountfrom.options") == NULL) { + /* save mount options */ + setenv("vfs.root.mountfrom.options", options, 0); + } + free(options); + error = 0; + break; + } + close(fd); free(dev); free(fstyp); - setenv("vfs.root.mountfrom", lbuf, 0); - /* Don't override vfs.root.mountfrom.options if it is already set */ - if (getenv("vfs.root.mountfrom.options") == NULL) { - /* save mount options */ - setenv("vfs.root.mountfrom.options", options, 0); - } - free(options); - error = 0; - break; - } - close(fd); - notfound: - if (error) { - const char *currdev; + if (error) { + const char *currdev; - currdev = getenv("currdev"); - if (currdev != NULL && strncmp("zfs:", currdev, 4) == 0) { - cp = strdup(currdev); - cp[strlen(cp) - 1] = '\0'; - setenv("vfs.root.mountfrom", cp, 0); - error = 0; + currdev = getenv("currdev"); + if (currdev != NULL && strncmp("zfs:", currdev, 4) == 0) { + cp = strdup(currdev); + cp[strlen(cp) - 1] = '\0'; + setenv("vfs.root.mountfrom", cp, 0); + error = 0; + free(cp); + } } - } - return(error); + return(error); } static int loadakernel(int try, int argc, char* argv[]) { - char *cp; + char *cp; for (try = 0; (cp = getbootfile(try)) != NULL; try++) - if (mod_loadkld(cp, argc - 1, argv + 1) != 0) - printf("can't load '%s'\n", cp); - else - return 1; + if (mod_loadkld(cp, argc - 1, argv + 1) != 0) + printf("can't load '%s'\n", cp); + else + return 1; return 0; } Modified: stable/11/stand/common/bootstrap.h ============================================================================== --- stable/11/stand/common/bootstrap.h Mon Feb 12 19:50:43 2018 (r329182) +++ stable/11/stand/common/bootstrap.h Mon Feb 12 20:51:28 2018 (r329183) @@ -46,18 +46,20 @@ extern char command_errbuf[COMMAND_ERRBUFSZ]; /* interp.c */ void interact(void); -int include(const char *filename); +void interp_emit_prompt(void); +int interp_builtin_cmd(int argc, char *argv[]); +/* Called by interp.c for interp_*.c embedded interpreters */ +int interp_include(const char *filename); /* Execute commands from filename */ +void interp_init(void); /* Initialize interpreater */ +int interp_run(const char *line); /* Run a single command */ + /* interp_backslash.c */ char *backslash(const char *str); /* interp_parse.c */ int parse(int *argc, char ***argv, const char *str); -/* interp_forth.c */ -void bf_init(void); -int bf_run(char *line); - /* boot.c */ int autoboot(int timeout, char *prompt); void autoboot_maybe(void); @@ -315,6 +317,9 @@ struct arch_switch /* Probe ZFS pool(s), if needed. */ void (*arch_zfs_probe)(void); + + /* For kexec-type loaders, get ksegment structure */ + void (*arch_kexec_kseg_get)(int *nseg, void **kseg); }; extern struct arch_switch archsw; Modified: stable/11/stand/common/commands.c ============================================================================== --- stable/11/stand/common/commands.c Mon Feb 12 19:50:43 2018 (r329182) +++ stable/11/stand/common/commands.c Mon Feb 12 20:51:28 2018 (r329183) @@ -91,10 +91,8 @@ help_getnext(int fd, char **topic, char **subtopic, ch cp = ep; } if (*topic == NULL) { - if (*subtopic != NULL) - free(*subtopic); - if (*desc != NULL) - free(*desc); + free(*subtopic); + free(*desc); continue; } return(1); @@ -169,7 +167,7 @@ command_help(int argc, char *argv[]) } else if (strcmp(topic, t)) { /* topic mismatch */ - if(matched) /* nothing more on this topic, stop scanning */ + if (matched) /* nothing more on this topic, stop scanning */ break; } else { @@ -178,7 +176,7 @@ command_help(int argc, char *argv[]) if (((subtopic == NULL) && (s == NULL)) || ((subtopic != NULL) && (s != NULL) && !strcmp(subtopic, s))) { /* exact match, print text */ - while((fgetstr(buf, 80, hfd) >= 0) && (buf[0] != '#')) { + while ((fgetstr(buf, 80, hfd) >= 0) && (buf[0] != '#')) { if (pager_output(buf)) break; if (pager_output("\n")) @@ -193,23 +191,24 @@ command_help(int argc, char *argv[]) free(t); free(s); free(d); + t = s = d = NULL; } + free(t); + free(s); + free(d); pager_close(); close(hfd); if (!matched) { snprintf(command_errbuf, sizeof(command_errbuf), "no help available for '%s'", topic); free(topic); - if (subtopic) - free(subtopic); + free(subtopic); return(CMD_ERROR); } free(topic); - if (subtopic) - free(subtopic); + free(subtopic); return(CMD_OK); } - COMMAND_SET(commandlist, "?", "list commands", command_commandlist); Modified: stable/11/stand/common/install.c ============================================================================== --- stable/11/stand/common/install.c Mon Feb 12 19:50:43 2018 (r329182) +++ stable/11/stand/common/install.c Mon Feb 12 20:51:28 2018 (r329183) @@ -286,7 +286,7 @@ install(char *pkgname) fd = open(s, O_RDONLY); if (fd != -1) { close(fd); - error = include(s); + error = inter_include(s); if (error == CMD_ERROR) goto fail; } Modified: stable/11/stand/common/interp.c ============================================================================== --- stable/11/stand/common/interp.c Mon Feb 12 19:50:43 2018 (r329182) +++ stable/11/stand/common/interp.c Mon Feb 12 20:51:28 2018 (r329183) @@ -37,102 +37,40 @@ __FBSDID("$FreeBSD$"); #include #include "bootstrap.h" -#ifdef BOOT_FORTH -#include "ficl.h" -extern FICL_VM *bf_vm; -#endif - #define MAXARGS 20 /* maximum number of arguments allowed */ -static void prompt(void); - -#ifndef BOOT_FORTH /* - * Perform the command - */ -static int -perform(int argc, char *argv[]) -{ - int result; - struct bootblk_command **cmdp; - bootblk_cmd_t *cmd; - - if (argc < 1) - return(CMD_OK); - - /* set return defaults; a successful command will override these */ - command_errmsg = command_errbuf; - strcpy(command_errbuf, "no error message"); - cmd = NULL; - result = CMD_ERROR; - - /* search the command set for the command */ - SET_FOREACH(cmdp, Xcommand_set) { - if (((*cmdp)->c_name != NULL) && !strcmp(argv[0], (*cmdp)->c_name)) - cmd = (*cmdp)->c_fn; - } - if (cmd != NULL) { - result = (cmd)(argc, argv); - } else { - command_errmsg = "unknown command"; - } - return(result); -} -#endif /* ! BOOT_FORTH */ - -/* * Interactive mode */ void interact(void) { - static char input[256]; /* big enough? */ -#ifndef BOOT_FORTH - int argc; - char **argv; -#endif + static char input[256]; /* big enough? */ -#ifdef BOOT_FORTH - bf_init(); -#endif + interp_init(); - /* Read our default configuration. */ - include("/boot/loader.rc"); + printf("\n"); - printf("\n"); + /* + * Before interacting, we might want to autoboot. + */ + autoboot_maybe(); - /* - * Before interacting, we might want to autoboot. - */ - autoboot_maybe(); - - /* - * Not autobooting, go manual - */ - printf("\nType '?' for a list of commands, 'help' for more detailed help.\n"); - if (getenv("prompt") == NULL) - setenv("prompt", "${interpret}", 1); - if (getenv("interpret") == NULL) - setenv("interpret", "OK", 1); - + /* + * Not autobooting, go manual + */ + printf("\nType '?' for a list of commands, 'help' for more detailed help.\n"); + if (getenv("prompt") == NULL) + setenv("prompt", "${interpret}", 1); + if (getenv("interpret") == NULL) + setenv("interpret", "OK", 1); - for (;;) { - input[0] = '\0'; - prompt(); - ngets(input, sizeof(input)); -#ifdef BOOT_FORTH - bf_vm->sourceID.i = 0; - bf_run(input); -#else - if (!parse(&argc, &argv, input)) { - if (perform(argc, argv)) - printf("%s: %s\n", argv[0], command_errmsg); - free(argv); - } else { - printf("parse error\n"); + for (;;) { + input[0] = '\0'; + interp_emit_prompt(); + ngets(input, sizeof(input)); + interp_run(input); } -#endif - } } /* @@ -149,214 +87,87 @@ COMMAND_SET(include, "include", "read commands from a static int command_include(int argc, char *argv[]) { - int i; - int res; - char **argvbuf; + int i; + int res; + char **argvbuf; - /* - * Since argv is static, we need to save it here. - */ - argvbuf = (char**) calloc((u_int)argc, sizeof(char*)); - for (i = 0; i < argc; i++) - argvbuf[i] = strdup(argv[i]); + /* + * Since argv is static, we need to save it here. + */ + argvbuf = (char**) calloc((u_int)argc, sizeof(char*)); + for (i = 0; i < argc; i++) + argvbuf[i] = strdup(argv[i]); - res=CMD_OK; - for (i = 1; (i < argc) && (res == CMD_OK); i++) - res = include(argvbuf[i]); + res=CMD_OK; + for (i = 1; (i < argc) && (res == CMD_OK); i++) + res = interp_include(argvbuf[i]); - for (i = 0; i < argc; i++) - free(argvbuf[i]); - free(argvbuf); + for (i = 0; i < argc; i++) + free(argvbuf[i]); + free(argvbuf); - return(res); + return(res); } /* - * Header prepended to each line. The text immediately follows the header. - * We try to make this short in order to save memory -- the loader has - * limited memory available, and some of the forth files are very long. + * Emit the current prompt; use the same syntax as the parser + * for embedding environment variables. Does not accept input. */ -struct includeline +void +interp_emit_prompt(void) { - struct includeline *next; -#ifndef BOOT_FORTH - int flags; - int line; -#define SL_QUIET (1<<0) -#define SL_IGNOREERR (1<<1) -#endif - char text[0]; -}; + char *pr, *p, *cp, *ev; -int -include(const char *filename) -{ - struct includeline *script, *se, *sp; - char input[256]; /* big enough? */ -#ifdef BOOT_FORTH - int res; - char *cp; - int prevsrcid, fd, line; -#else - int argc,res; - char **argv, *cp; - int fd, flags, line; -#endif + if ((cp = getenv("prompt")) == NULL) + cp = ">"; + pr = p = strdup(cp); - if (((fd = open(filename, O_RDONLY)) == -1)) { - snprintf(command_errbuf, sizeof(command_errbuf), - "can't open '%s': %s", filename, strerror(errno)); - return(CMD_ERROR); - } + while (*p != 0) { + if ((*p == '$') && (*(p+1) == '{')) { + for (cp = p + 2; (*cp != 0) && (*cp != '}'); cp++) + ; + *cp = 0; + ev = getenv(p + 2); - /* - * Read the script into memory. - */ - script = se = NULL; - line = 0; - - while (fgetstr(input, sizeof(input), fd) >= 0) { - line++; -#ifdef BOOT_FORTH - cp = input; -#else - flags = 0; - /* Discard comments */ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Mon Feb 12 22:21:12 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7147CF22B4B; Mon, 12 Feb 2018 22:21:12 +0000 (UTC) (envelope-from landonf@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1C19871937; Mon, 12 Feb 2018 22:21:12 +0000 (UTC) (envelope-from landonf@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F12B41802E; Mon, 12 Feb 2018 22:21:11 +0000 (UTC) (envelope-from landonf@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1CMLBr5017707; Mon, 12 Feb 2018 22:21:11 GMT (envelope-from landonf@FreeBSD.org) Received: (from landonf@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1CMLBqp017704; Mon, 12 Feb 2018 22:21:11 GMT (envelope-from landonf@FreeBSD.org) Message-Id: <201802122221.w1CMLBqp017704@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: landonf set sender to landonf@FreeBSD.org using -f From: "Landon J. Fuller" Date: Mon, 12 Feb 2018 22:21:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329184 - in head/sys: conf dev/bwn modules/bwn X-SVN-Group: head X-SVN-Commit-Author: landonf X-SVN-Commit-Paths: in head/sys: conf dev/bwn modules/bwn X-SVN-Commit-Revision: 329184 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Feb 2018 22:21:12 -0000 Author: landonf Date: Mon Feb 12 22:21:11 2018 New Revision: 329184 URL: https://svnweb.freebsd.org/changeset/base/329184 Log: bwn(4): Fix outstanding bug in PHY-G tssi2dbm table generation caught by -Wconstant-conversion, and remove now unnecessary warning suppression flags. Modified: head/sys/conf/files head/sys/dev/bwn/if_bwn_phy_g.c head/sys/modules/bwn/Makefile Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Mon Feb 12 20:51:28 2018 (r329183) +++ head/sys/conf/files Mon Feb 12 22:21:11 2018 (r329184) @@ -1326,15 +1326,11 @@ dev/bwi/bwiphy.c optional bwi dev/bwi/bwirf.c optional bwi dev/bwi/if_bwi.c optional bwi dev/bwi/if_bwi_pci.c optional bwi pci -# XXX Work around clang warnings, until maintainer approves fix. -dev/bwn/if_bwn.c optional bwn bhnd \ - compile-with "${NORMAL_C} ${NO_WSOMETIMES_UNINITIALIZED}" +dev/bwn/if_bwn.c optional bwn bhnd dev/bwn/if_bwn_pci.c optional bwn pci bhnd bhndb bhndb_pci dev/bwn/if_bwn_phy_common.c optional bwn bhnd -dev/bwn/if_bwn_phy_g.c optional bwn bhnd \ - compile-with "${NORMAL_C} ${NO_WSOMETIMES_UNINITIALIZED} ${NO_WCONSTANT_CONVERSION}" -dev/bwn/if_bwn_phy_lp.c optional bwn bhnd \ - compile-with "${NORMAL_C} ${NO_WSOMETIMES_UNINITIALIZED}" +dev/bwn/if_bwn_phy_g.c optional bwn bhnd +dev/bwn/if_bwn_phy_lp.c optional bwn bhnd dev/bwn/if_bwn_phy_n.c optional bwn bhnd dev/bwn/if_bwn_util.c optional bwn bhnd dev/cardbus/cardbus.c optional cardbus Modified: head/sys/dev/bwn/if_bwn_phy_g.c ============================================================================== --- head/sys/dev/bwn/if_bwn_phy_g.c Mon Feb 12 20:51:28 2018 (r329183) +++ head/sys/dev/bwn/if_bwn_phy_g.c Mon Feb 12 22:21:11 2018 (r329184) @@ -216,7 +216,7 @@ do { \ } while (delta >= 2); pg->pg_tssi2dbm[i] = MIN(MAX(BWN_TSSI2DBM(m1 * f, 8192), -127), - 128); + 127); } pg->pg_flags |= BWN_PHY_G_FLAG_TSSITABLE_ALLOC; Modified: head/sys/modules/bwn/Makefile ============================================================================== --- head/sys/modules/bwn/Makefile Mon Feb 12 20:51:28 2018 (r329183) +++ head/sys/modules/bwn/Makefile Mon Feb 12 22:21:11 2018 (r329184) @@ -38,8 +38,3 @@ SRCS.BWN_GPL_PHY+= if_bwn_phy_n_ppr.c SRCS.BWN_GPL_PHY+= if_bwn_phy_n_core.c .include - -# XXX Work around clang warnings, until maintainer approves fix. -CWARNFLAGS.if_bwn.c= ${NO_WSOMETIMES_UNINITIALIZED} -CWARNFLAGS.if_bwn_phy_g.c= ${NO_WSOMETIMES_UNINITIALIZED} ${NO_WCONSTANT_CONVERSION} -CWARNFLAGS.if_bwn_phy_lp.c= ${NO_WSOMETIMES_UNINITIALIZED} From owner-svn-src-all@freebsd.org Mon Feb 12 22:42:08 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0F92BF00079; Mon, 12 Feb 2018 22:42:08 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7E5CC72B7D; Mon, 12 Feb 2018 22:42:07 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 794CF183C6; Mon, 12 Feb 2018 22:42:07 +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 w1CMg7JM030833; Mon, 12 Feb 2018 22:42:07 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1CMg7lo030828; Mon, 12 Feb 2018 22:42:07 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201802122242.w1CMg7lo030828@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Mon, 12 Feb 2018 22:42:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329185 - head/share/man/man9 X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/share/man/man9 X-SVN-Commit-Revision: 329185 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Feb 2018 22:42:08 -0000 Author: cem Date: Mon Feb 12 22:42:06 2018 New Revision: 329185 URL: https://svnweb.freebsd.org/changeset/base/329185 Log: Take a first stab at documenting use of MODULE_PNP_INFO Sponsored by: Dell EMC Isilon Added: head/share/man/man9/MODULE_PNP_INFO.9 (contents, props changed) Modified: head/share/man/man9/DRIVER_MODULE.9 head/share/man/man9/Makefile head/share/man/man9/module.9 Modified: head/share/man/man9/DRIVER_MODULE.9 ============================================================================== --- head/share/man/man9/DRIVER_MODULE.9 Mon Feb 12 22:21:11 2018 (r329184) +++ head/share/man/man9/DRIVER_MODULE.9 Mon Feb 12 22:42:06 2018 (r329185) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 15, 2017 +.Dd February 12, 2018 .Dt DRIVER_MODULE 9 .Os .Sh NAME @@ -144,6 +144,7 @@ for a specific pass level. .Xr device 9 , .Xr driver 9 , .Xr module 9 , +.Xr MODULE_PNP_INFO 9 , .Xr SYSINIT 9 .Sh AUTHORS This manual page was written by Added: head/share/man/man9/MODULE_PNP_INFO.9 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man9/MODULE_PNP_INFO.9 Mon Feb 12 22:42:06 2018 (r329185) @@ -0,0 +1,179 @@ +.\" Copyright (c) 2018 Conrad Meyer +.\" 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$ +.\" +.Dd February 12, 2018 +.Dt MODULE_PNP_INFO 9 +.Os +.Sh NAME +.Nm MODULE_PNP_INFO +.Nd register plug and play information for device matching +.\" +.Sh SYNOPSIS +.In sys/module.h +.Fo MODULE_PNP_INFO +.Fa "const char *descriptor_string" +.Fa "bus" +.Fa "module" +.Fa "void *table" +.Fa "size_t entry_len" +.Fa "size_t num_entries" +.Fc +.\" +.Sh DESCRIPTION +The +.Fn MODULE_PNP_INFO +macro registers a +.Fa table +of device-identifying data for use by +.Xr devmatch 8 . +.Pp +The macro takes a +.Fa descriptor_string +that describes the memory layout of table entries. +The string is a series of members separated by semi-colons. +Members are identified by a type and a name. +They are encoded in the descriptor string by concatenating the type with a +colon, followed by the name. +(The special type +.Vt W32 +represents two members. +The first name is encoded like any other type. +The second name is encoded by appending a forward slash and the second +name after the first.) +.Pp +Types are one of the following: +.Bl -tag -width U16 +.It Dq Vt U8 +.Vt uint8_t +element. +.It Dq Vt V8 +Same as +.Vt U8 , +except that the sentinel value 0xFF matches any. +.It Dq Vt G16 +.Vt uint16_t +element; any value greater than or equal matches. +.It Dq Vt L16 +.Vt uint16_t +element; any value less than or equal matches. +.It Dq Vt M16 +.Vt uint16_t +element; mask of which of the following fields to use. +.It Dq Vt U16 +.Vt uint16_t +element. +.It Dq Vt V16 +Same as +.Vt U16 , +except that the sentinel value 0xFFFF matches any. +.It Dq Vt U32 +.Vt uint32_t +element. +.It Dq Vt V32 +Same as +.Vt U32 , +except that the sentinel value 0xFFFFFFFF matches any. +.It Dq Vt W32 +Two +.Vt uint16_t +values; the first named member is in the least significant word and the second +named member is in the most significant word. +.It Dq Vt Z +A pointer to a string to match exactly. +.It Dq Vt D +A pointer to a human readable description for the device. +.It Dq Vt P +A pointer that should be ignored. +.It Dq Vt E +EISA PNP Identifier. +.El +.Pp +The pseudo-name +.Dq # +is reserved for fields that should be ignored. +Any member that does not match the parent device's pnpinfo output must be +ignored. +.Pp +The +.Fa bus +parameter is an unquoted word naming the parent bus of the driver. +For example, +.Dq pci . +.Pp +The +.Fa module +parameter is also an unquoted word. +It must be unique to the driver. +Usually the driver's name is used. +.Pp +The +.Fa table +parameter points to the device matching data with entries matching the +.Fa descriptor_string . +.Pp +The +.Fa entry_len +parameter is the size of each table entry, i.e., +.Ql sizeof(table[0]) . +.Pp +The +.Fa num_entries +parameter is the number of entries in the table, i.e., +.Ql nitems(table) . +Note that only valid entries should be included. +If the table contains trailing zero or bogus values, they should not be +included in +.Fa num_entries . +.\" +.Sh EXAMPLES +.Bd -literal -offset indent -compact +#include +#include +static struct my_pciids { + uint32_t devid; + const char *desc; +} my_ids[] = { + { 0x12345678, "Foo bar" }, + { 0x9abcdef0, "Baz fizz" }, +}; +MODULE_PNP_INFO("W32:vendor/device", pci, my_driver, my_ids, sizeof(my_ids[0]), + nitems(my_ids)); +.Ed +.\" +.Sh SEE ALSO +.Xr module 9 , +.Xr DRIVER_MODULE 9 , +.Xr devmatch 8 +.Sh HISTORY +The macro +.Nm +appeared in +.Fx 12.0 . +.Sh AUTHORS +The PNP framework and +.Xr devmatch 8 +utility were written by +.An Warner Losh Aq Mt imp@FreeBSD.org . Modified: head/share/man/man9/Makefile ============================================================================== --- head/share/man/man9/Makefile Mon Feb 12 22:21:11 2018 (r329184) +++ head/share/man/man9/Makefile Mon Feb 12 22:42:06 2018 (r329185) @@ -199,6 +199,7 @@ MAN= accept_filter.9 \ mod_cc.9 \ module.9 \ MODULE_DEPEND.9 \ + MODULE_PNP_INFO.9 \ MODULE_VERSION.9 \ mtx_pool.9 \ mutex.9 \ Modified: head/share/man/man9/module.9 ============================================================================== --- head/share/man/man9/module.9 Mon Feb 12 22:21:11 2018 (r329184) +++ head/share/man/man9/module.9 Mon Feb 12 22:42:06 2018 (r329185) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 19, 2007 +.Dd February 12, 2018 .Dt MODULE 9 .Os .Sh NAME @@ -112,6 +112,7 @@ DECLARE_MODULE(foo, mod_data, SI_SUB_EXEC, SI_ORDER_AN .Xr DEV_MODULE 9 , .Xr DRIVER_MODULE 9 , .Xr MODULE_DEPEND 9 , +.Xr MODULE_PNP_INFO 9 , .Xr MODULE_VERSION 9 , .Xr SYSCALL_MODULE 9 .Pp From owner-svn-src-all@freebsd.org Mon Feb 12 22:43:48 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5184EF003FC; Mon, 12 Feb 2018 22:43:48 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 089E072E58; Mon, 12 Feb 2018 22:43:48 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0379C183E7; Mon, 12 Feb 2018 22:43:48 +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 w1CMhlmU031044; Mon, 12 Feb 2018 22:43:47 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1CMhlsK031043; Mon, 12 Feb 2018 22:43:47 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201802122243.w1CMhlsK031043@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Mon, 12 Feb 2018 22:43:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329186 - head/sbin/devmatch X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/sbin/devmatch X-SVN-Commit-Revision: 329186 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Feb 2018 22:43:48 -0000 Author: cem Date: Mon Feb 12 22:43:47 2018 New Revision: 329186 URL: https://svnweb.freebsd.org/changeset/base/329186 Log: devmatch.8: Link to MODULE_PNP_INFO(9) Sponsored by: Dell EMC Isilon Modified: head/sbin/devmatch/devmatch.8 Modified: head/sbin/devmatch/devmatch.8 ============================================================================== --- head/sbin/devmatch/devmatch.8 Mon Feb 12 22:42:06 2018 (r329185) +++ head/sbin/devmatch/devmatch.8 Mon Feb 12 22:43:47 2018 (r329186) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 25, 2017 +.Dd February 12, 2018 .Dt DEVMATCH 8 .Os .Sh NAME @@ -57,7 +57,8 @@ tables with that PNP info can't be found. Produce more verbose output. .El .Sh SEE ALSO -.Xr devinfo 8 +.Xr devinfo 8 , +.Xr MODULE_PNP_INFO 9 .Sh BUGS The kernel has hints in it, but we exclude it from the list of modules to suggest for unmatched devices. From owner-svn-src-all@freebsd.org Mon Feb 12 22:53:03 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 939A4F00E49; Mon, 12 Feb 2018 22:53:03 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 408C273499; Mon, 12 Feb 2018 22:53:03 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3B25E1857B; Mon, 12 Feb 2018 22:53:03 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1CMr3Kc036340; Mon, 12 Feb 2018 22:53:03 GMT (envelope-from jeff@FreeBSD.org) Received: (from jeff@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1CMr12w036317; Mon, 12 Feb 2018 22:53:01 GMT (envelope-from jeff@FreeBSD.org) Message-Id: <201802122253.w1CMr12w036317@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jeff set sender to jeff@FreeBSD.org using -f From: Jeff Roberson Date: Mon, 12 Feb 2018 22:53:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329187 - in head/sys: amd64/amd64 arm/arm arm64/arm64 compat/linprocfs compat/linux i386/i386 kern mips/mips powerpc/booke riscv/riscv sparc64/sparc64 sys vm X-SVN-Group: head X-SVN-Commit-Author: jeff X-SVN-Commit-Paths: in head/sys: amd64/amd64 arm/arm arm64/arm64 compat/linprocfs compat/linux i386/i386 kern mips/mips powerpc/booke riscv/riscv sparc64/sparc64 sys vm X-SVN-Commit-Revision: 329187 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Feb 2018 22:53:03 -0000 Author: jeff Date: Mon Feb 12 22:53:00 2018 New Revision: 329187 URL: https://svnweb.freebsd.org/changeset/base/329187 Log: Make v_wire_count a per-cpu counter(9) counter. This eliminates a significant source of cache line contention from vm_page_alloc(). Use accessors and vm_page_unwire_noq() so that the mechanism can be easily changed in the future. Reviewed by: markj Discussed with: kib, glebius Tested by: pho (earlier version) Sponsored by: Netflix, Dell/EMC Isilon Differential Revision: https://reviews.freebsd.org/D14273 Modified: head/sys/amd64/amd64/efirt_machdep.c head/sys/amd64/amd64/pmap.c head/sys/arm/arm/pmap-v6.c head/sys/arm64/arm64/efirt_machdep.c head/sys/arm64/arm64/pmap.c head/sys/compat/linprocfs/linprocfs.c head/sys/compat/linux/linux_misc.c head/sys/i386/i386/pmap.c head/sys/kern/kern_mib.c head/sys/kern/subr_pcpu.c head/sys/kern/vfs_bio.c head/sys/mips/mips/pmap.c head/sys/powerpc/booke/pmap.c head/sys/riscv/riscv/pmap.c head/sys/sparc64/sparc64/pmap.c head/sys/sys/vmmeter.h head/sys/vm/swap_pager.c head/sys/vm/vm_glue.c head/sys/vm/vm_meter.c head/sys/vm/vm_mmap.c head/sys/vm/vm_page.c Modified: head/sys/amd64/amd64/efirt_machdep.c ============================================================================== --- head/sys/amd64/amd64/efirt_machdep.c Mon Feb 12 22:43:47 2018 (r329186) +++ head/sys/amd64/amd64/efirt_machdep.c Mon Feb 12 22:53:00 2018 (r329187) @@ -74,8 +74,7 @@ efi_destroy_1t1_map(void) VM_OBJECT_RLOCK(obj_1t1_pt); TAILQ_FOREACH(m, &obj_1t1_pt->memq, listq) m->wire_count = 0; - atomic_subtract_int(&vm_cnt.v_wire_count, - obj_1t1_pt->resident_page_count); + vm_wire_sub(obj_1t1_pt->resident_page_count); VM_OBJECT_RUNLOCK(obj_1t1_pt); vm_object_deallocate(obj_1t1_pt); } Modified: head/sys/amd64/amd64/pmap.c ============================================================================== --- head/sys/amd64/amd64/pmap.c Mon Feb 12 22:43:47 2018 (r329186) +++ head/sys/amd64/amd64/pmap.c Mon Feb 12 22:53:00 2018 (r329187) @@ -1246,7 +1246,7 @@ pmap_init(void) mpte->phys_addr = KPTphys + (i << PAGE_SHIFT); mpte->wire_count = 1; } - atomic_add_int(&vm_cnt.v_wire_count, nkpt); + vm_wire_add(nkpt); /* * If the kernel is running on a virtual machine, then it must assume @@ -2381,7 +2381,7 @@ pmap_free_zero_pages(struct spglist *free) /* Preserve the page's PG_ZERO setting. */ vm_page_free_toq(m); } - atomic_subtract_int(&vm_cnt.v_wire_count, count); + vm_wire_sub(count); } /* Modified: head/sys/arm/arm/pmap-v6.c ============================================================================== --- head/sys/arm/arm/pmap-v6.c Mon Feb 12 22:43:47 2018 (r329186) +++ head/sys/arm/arm/pmap-v6.c Mon Feb 12 22:53:00 2018 (r329187) @@ -2634,11 +2634,12 @@ pmap_unwire_pt2pg(pmap_t pmap, vm_offset_t va, vm_page pmap->pm_stats.resident_count--; /* - * This is a release store so that the ordinary store unmapping + * This barrier is so that the ordinary store unmapping * the L2 page table page is globally performed before TLB shoot- * down is begun. */ - atomic_subtract_rel_int(&vm_cnt.v_wire_count, 1); + wmb(); + vm_wire_sub(1); } /* @@ -2945,7 +2946,7 @@ out: SLIST_REMOVE_HEAD(&free, plinks.s.ss); /* Recycle a freed page table page. */ m_pc->wire_count = 1; - atomic_add_int(&vm_cnt.v_wire_count, 1); + vm_wire_add(1); } pmap_free_zero_pages(&free); return (m_pc); Modified: head/sys/arm64/arm64/efirt_machdep.c ============================================================================== --- head/sys/arm64/arm64/efirt_machdep.c Mon Feb 12 22:43:47 2018 (r329186) +++ head/sys/arm64/arm64/efirt_machdep.c Mon Feb 12 22:53:00 2018 (r329187) @@ -75,8 +75,7 @@ efi_destroy_1t1_map(void) VM_OBJECT_RLOCK(obj_1t1_pt); TAILQ_FOREACH(m, &obj_1t1_pt->memq, listq) m->wire_count = 0; - atomic_subtract_int(&vm_cnt.v_wire_count, - obj_1t1_pt->resident_page_count); + vm_wire_sub(obj_1t1_pt->resident_page_count); VM_OBJECT_RUNLOCK(obj_1t1_pt); vm_object_deallocate(obj_1t1_pt); } Modified: head/sys/arm64/arm64/pmap.c ============================================================================== --- head/sys/arm64/arm64/pmap.c Mon Feb 12 22:43:47 2018 (r329186) +++ head/sys/arm64/arm64/pmap.c Mon Feb 12 22:53:00 2018 (r329187) @@ -1362,7 +1362,7 @@ _pmap_unwire_l3(pmap_t pmap, vm_offset_t va, vm_page_t } pmap_invalidate_page(pmap, va); - atomic_subtract_int(&vm_cnt.v_wire_count, 1); + vm_wire_sub(1); /* * Put page on a list so that it is released after @@ -1907,7 +1907,7 @@ reclaim_pv_chunk(pmap_t locked_pmap, struct rwlock **l SLIST_REMOVE_HEAD(&free, plinks.s.ss); /* Recycle a freed page table page. */ m_pc->wire_count = 1; - atomic_add_int(&vm_cnt.v_wire_count, 1); + vm_wire_add(1); } pmap_free_zero_pages(&free); return (m_pc); @@ -1958,7 +1958,7 @@ free_pv_chunk(struct pv_chunk *pc) /* entire chunk is free, return it */ m = PHYS_TO_VM_PAGE(DMAP_TO_PHYS((vm_offset_t)pc)); dump_drop_page(m->phys_addr); - vm_page_unwire(m, PQ_NONE); + vm_page_unwire_noq(m); vm_page_free(m); } @@ -2264,9 +2264,9 @@ pmap_remove_l2(pmap_t pmap, pt_entry_t *l2, vm_offset_ pmap_resident_count_dec(pmap, 1); KASSERT(ml3->wire_count == NL3PG, ("pmap_remove_pages: l3 page wire count error")); - ml3->wire_count = 0; + ml3->wire_count = 1; + vm_page_unwire_noq(ml3); pmap_add_delayed_free_list(ml3, free, FALSE); - atomic_subtract_int(&vm_cnt.v_wire_count, 1); } return (pmap_unuse_pt(pmap, sva, l1e, free)); } @@ -3711,11 +3711,10 @@ pmap_remove_pages(pmap_t pmap) pmap_resident_count_dec(pmap,1); KASSERT(ml3->wire_count == NL3PG, ("pmap_remove_pages: l3 page wire count error")); - ml3->wire_count = 0; + ml3->wire_count = 1; + vm_page_unwire_noq(ml3); pmap_add_delayed_free_list(ml3, &free, FALSE); - atomic_subtract_int( - &vm_cnt.v_wire_count, 1); } break; case 2: Modified: head/sys/compat/linprocfs/linprocfs.c ============================================================================== --- head/sys/compat/linprocfs/linprocfs.c Mon Feb 12 22:43:47 2018 (r329186) +++ head/sys/compat/linprocfs/linprocfs.c Mon Feb 12 22:53:00 2018 (r329187) @@ -163,7 +163,7 @@ linprocfs_domeminfo(PFS_FILL_ARGS) * is very little memory left, so we cheat and tell them that * all memory that isn't wired down is free. */ - memused = vm_cnt.v_wire_count * PAGE_SIZE; + memused = vm_wire_count() * PAGE_SIZE; memfree = memtotal - memused; swap_pager_status(&i, &j); swaptotal = (unsigned long long)i * PAGE_SIZE; Modified: head/sys/compat/linux/linux_misc.c ============================================================================== --- head/sys/compat/linux/linux_misc.c Mon Feb 12 22:43:47 2018 (r329186) +++ head/sys/compat/linux/linux_misc.c Mon Feb 12 22:53:00 2018 (r329187) @@ -165,7 +165,7 @@ linux_sysinfo(struct thread *td, struct linux_sysinfo_ LINUX_SYSINFO_LOADS_SCALE / averunnable.fscale; sysinfo.totalram = physmem * PAGE_SIZE; - sysinfo.freeram = sysinfo.totalram - vm_cnt.v_wire_count * PAGE_SIZE; + sysinfo.freeram = sysinfo.totalram - vm_wire_count() * PAGE_SIZE; sysinfo.sharedram = 0; mtx_lock(&vm_object_list_mtx); Modified: head/sys/i386/i386/pmap.c ============================================================================== --- head/sys/i386/i386/pmap.c Mon Feb 12 22:43:47 2018 (r329186) +++ head/sys/i386/i386/pmap.c Mon Feb 12 22:53:00 2018 (r329187) @@ -1718,7 +1718,7 @@ pmap_free_zero_pages(struct spglist *free) /* Preserve the page's PG_ZERO setting. */ vm_page_free_toq(m); } - atomic_subtract_int(&vm_cnt.v_wire_count, count); + vm_wire_sub(count); } /* Modified: head/sys/kern/kern_mib.c ============================================================================== --- head/sys/kern/kern_mib.c Mon Feb 12 22:43:47 2018 (r329186) +++ head/sys/kern/kern_mib.c Mon Feb 12 22:53:00 2018 (r329187) @@ -206,7 +206,7 @@ sysctl_hw_usermem(SYSCTL_HANDLER_ARGS) { u_long val; - val = ctob(physmem - vm_cnt.v_wire_count); + val = ctob(physmem - vm_wire_count()); return (sysctl_handle_long(oidp, &val, 0, req)); } Modified: head/sys/kern/subr_pcpu.c ============================================================================== --- head/sys/kern/subr_pcpu.c Mon Feb 12 22:43:47 2018 (r329186) +++ head/sys/kern/subr_pcpu.c Mon Feb 12 22:53:00 2018 (r329187) @@ -151,7 +151,7 @@ pcpu_zones_startup(void) pcpu_zone_ptr = uma_zcreate("ptr pcpu", sizeof(void *), NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_PCPU); } -SYSINIT(pcpu_zones, SI_SUB_KMEM, SI_ORDER_ANY, pcpu_zones_startup, NULL); +SYSINIT(pcpu_zones, SI_SUB_VM, SI_ORDER_ANY, pcpu_zones_startup, NULL); /* * First-fit extent based allocator for allocating space in the per-cpu Modified: head/sys/kern/vfs_bio.c ============================================================================== --- head/sys/kern/vfs_bio.c Mon Feb 12 22:43:47 2018 (r329186) +++ head/sys/kern/vfs_bio.c Mon Feb 12 22:53:00 2018 (r329187) @@ -4552,7 +4552,7 @@ vm_hold_free_pages(struct buf *bp, int newbsize) p->wire_count--; vm_page_free(p); } - atomic_subtract_int(&vm_cnt.v_wire_count, bp->b_npages - newnpages); + vm_wire_sub(bp->b_npages - newnpages); bp->b_npages = newnpages; } Modified: head/sys/mips/mips/pmap.c ============================================================================== --- head/sys/mips/mips/pmap.c Mon Feb 12 22:43:47 2018 (r329186) +++ head/sys/mips/mips/pmap.c Mon Feb 12 22:53:00 2018 (r329187) @@ -1009,7 +1009,7 @@ _pmap_unwire_ptp(pmap_t pmap, vm_offset_t va, vm_page_ * If the page is finally unwired, simply free it. */ vm_page_free_zero(m); - atomic_subtract_int(&vm_cnt.v_wire_count, 1); + vm_wire_sub(1); } /* Modified: head/sys/powerpc/booke/pmap.c ============================================================================== --- head/sys/powerpc/booke/pmap.c Mon Feb 12 22:43:47 2018 (r329186) +++ head/sys/powerpc/booke/pmap.c Mon Feb 12 22:53:00 2018 (r329187) @@ -681,7 +681,7 @@ pdir_free(mmu_t mmu, pmap_t pmap, unsigned int pp2d_id pa = pte_vatopa(mmu, kernel_pmap, va); m = PHYS_TO_VM_PAGE(pa); vm_page_free_zero(m); - atomic_subtract_int(&vm_cnt.v_wire_count, 1); + vm_wire_sub(1); pmap_kremove(va); } @@ -786,7 +786,7 @@ ptbl_alloc(mmu_t mmu, pmap_t pmap, pte_t ** pdir, unsi ptbl_free_pmap_ptbl(pmap, ptbl); for (j = 0; j < i; j++) vm_page_free(mtbl[j]); - atomic_subtract_int(&vm_cnt.v_wire_count, i); + vm_wire_sub(i); return (NULL); } VM_WAIT; @@ -828,7 +828,7 @@ ptbl_free(mmu_t mmu, pmap_t pmap, pte_t ** pdir, unsig pa = pte_vatopa(mmu, kernel_pmap, va); m = PHYS_TO_VM_PAGE(pa); vm_page_free_zero(m); - atomic_subtract_int(&vm_cnt.v_wire_count, 1); + vm_wire_sub(1); pmap_kremove(va); } @@ -1030,7 +1030,7 @@ ptbl_alloc(mmu_t mmu, pmap_t pmap, unsigned int pdir_i ptbl_free_pmap_ptbl(pmap, ptbl); for (j = 0; j < i; j++) vm_page_free(mtbl[j]); - atomic_subtract_int(&vm_cnt.v_wire_count, i); + vm_wire_sub(i); return (NULL); } VM_WAIT; @@ -1091,7 +1091,7 @@ ptbl_free(mmu_t mmu, pmap_t pmap, unsigned int pdir_id pa = pte_vatopa(mmu, kernel_pmap, va); m = PHYS_TO_VM_PAGE(pa); vm_page_free_zero(m); - atomic_subtract_int(&vm_cnt.v_wire_count, 1); + vm_wire_sub(1); mmu_booke_kremove(mmu, va); } Modified: head/sys/riscv/riscv/pmap.c ============================================================================== --- head/sys/riscv/riscv/pmap.c Mon Feb 12 22:43:47 2018 (r329186) +++ head/sys/riscv/riscv/pmap.c Mon Feb 12 22:53:00 2018 (r329187) @@ -1153,7 +1153,7 @@ _pmap_unwire_l3(pmap_t pmap, vm_offset_t va, vm_page_t } pmap_invalidate_page(pmap, va); - atomic_subtract_int(&vm_cnt.v_wire_count, 1); + vm_wire_sub(1); /* * Put page on a list so that it is released after Modified: head/sys/sparc64/sparc64/pmap.c ============================================================================== --- head/sys/sparc64/sparc64/pmap.c Mon Feb 12 22:43:47 2018 (r329186) +++ head/sys/sparc64/sparc64/pmap.c Mon Feb 12 22:53:00 2018 (r329187) @@ -1308,8 +1308,7 @@ pmap_release(pmap_t pm) while (!TAILQ_EMPTY(&obj->memq)) { m = TAILQ_FIRST(&obj->memq); m->md.pmap = NULL; - m->wire_count--; - atomic_subtract_int(&vm_cnt.v_wire_count, 1); + vm_page_unwire_noq(m); vm_page_free_zero(m); } VM_OBJECT_WUNLOCK(obj); Modified: head/sys/sys/vmmeter.h ============================================================================== --- head/sys/sys/vmmeter.h Mon Feb 12 22:43:47 2018 (r329186) +++ head/sys/sys/vmmeter.h Mon Feb 12 22:53:00 2018 (r329187) @@ -125,6 +125,7 @@ struct vmmeter { counter_u64_t v_vforkpages; /* (p) pages affected by vfork() */ counter_u64_t v_rforkpages; /* (p) pages affected by rfork() */ counter_u64_t v_kthreadpages; /* (p) ... and by kernel fork() */ + counter_u64_t v_wire_count; /* (p) pages wired down */ #define VM_METER_NCOUNTERS \ (offsetof(struct vmmeter, v_page_size) / sizeof(counter_u64_t)) /* @@ -139,7 +140,6 @@ struct vmmeter { u_int v_pageout_free_min; /* (c) min pages reserved for kernel */ u_int v_interrupt_free_min; /* (c) reserved pages for int code */ u_int v_free_severe; /* (c) severe page depletion point */ - u_int v_wire_count VMMETER_ALIGNED; /* (a) pages wired down */ }; #endif /* _KERNEL || _WANT_VMMETER */ @@ -155,7 +155,27 @@ extern domainset_t vm_severe_domains; #define VM_CNT_INC(var) VM_CNT_ADD(var, 1) #define VM_CNT_FETCH(var) counter_u64_fetch(vm_cnt.var) +static inline void +vm_wire_add(int cnt) +{ + + VM_CNT_ADD(v_wire_count, cnt); +} + +static inline void +vm_wire_sub(int cnt) +{ + + VM_CNT_ADD(v_wire_count, -cnt); +} + u_int vm_free_count(void); +static inline u_int +vm_wire_count(void) +{ + + return (VM_CNT_FETCH(v_wire_count)); +} /* * Return TRUE if we are under our severe low-free-pages threshold Modified: head/sys/vm/swap_pager.c ============================================================================== --- head/sys/vm/swap_pager.c Mon Feb 12 22:43:47 2018 (r329186) +++ head/sys/vm/swap_pager.c Mon Feb 12 22:53:00 2018 (r329187) @@ -209,7 +209,8 @@ swap_reserve_by_cred(vm_ooffset_t incr, struct ucred * mtx_lock(&sw_dev_mtx); r = swap_reserved + incr; if (overcommit & SWAP_RESERVE_ALLOW_NONWIRED) { - s = vm_cnt.v_page_count - vm_cnt.v_free_reserved - vm_cnt.v_wire_count; + s = vm_cnt.v_page_count - vm_cnt.v_free_reserved - + vm_wire_count(); s *= PAGE_SIZE; } else s = 0; Modified: head/sys/vm/vm_glue.c ============================================================================== --- head/sys/vm/vm_glue.c Mon Feb 12 22:43:47 2018 (r329186) +++ head/sys/vm/vm_glue.c Mon Feb 12 22:53:00 2018 (r329187) @@ -191,7 +191,7 @@ vslock(void *addr, size_t len) * Also, the sysctl code, which is the only present user * of vslock(), does a hard loop on EAGAIN. */ - if (npages + vm_cnt.v_wire_count > vm_page_max_wired) + if (npages + vm_wire_count() > vm_page_max_wired) return (EAGAIN); #endif error = vm_map_wire(&curproc->p_vmspace->vm_map, start, end, Modified: head/sys/vm/vm_meter.c ============================================================================== --- head/sys/vm/vm_meter.c Mon Feb 12 22:43:47 2018 (r329186) +++ head/sys/vm/vm_meter.c Mon Feb 12 22:53:00 2018 (r329187) @@ -96,6 +96,7 @@ struct vmmeter __exclusive_cache_line vm_cnt = { .v_vforkpages = EARLY_COUNTER, .v_rforkpages = EARLY_COUNTER, .v_kthreadpages = EARLY_COUNTER, + .v_wire_count = EARLY_COUNTER, }; static void @@ -105,7 +106,7 @@ vmcounter_startup(void) COUNTER_ARRAY_ALLOC(cnt, VM_METER_NCOUNTERS, M_WAITOK); } -SYSINIT(counter, SI_SUB_CPU, SI_ORDER_FOURTH + 1, vmcounter_startup, NULL); +SYSINIT(counter, SI_SUB_KMEM, SI_ORDER_FIRST, vmcounter_startup, NULL); SYSCTL_UINT(_vm, VM_V_FREE_MIN, v_free_min, CTLFLAG_RW, &vm_cnt.v_free_min, 0, "Minimum low-free-pages threshold"); @@ -403,7 +404,7 @@ VM_STATS_UINT(v_free_reserved, "Pages reserved for dea VM_STATS_UINT(v_free_target, "Pages desired free"); VM_STATS_UINT(v_free_min, "Minimum low-free-pages threshold"); VM_STATS_PROC(v_free_count, "Free pages", vm_free_count); -VM_STATS_UINT(v_wire_count, "Wired pages"); +VM_STATS_PROC(v_wire_count, "Wired pages", vm_wire_count); VM_STATS_PROC(v_active_count, "Active pages", vm_active_count); VM_STATS_UINT(v_inactive_target, "Desired inactive pages"); VM_STATS_PROC(v_inactive_count, "Inactive pages", vm_inactive_count); Modified: head/sys/vm/vm_mmap.c ============================================================================== --- head/sys/vm/vm_mmap.c Mon Feb 12 22:43:47 2018 (r329186) +++ head/sys/vm/vm_mmap.c Mon Feb 12 22:53:00 2018 (r329187) @@ -1002,7 +1002,7 @@ kern_mlock(struct proc *proc, struct ucred *cred, uint return (ENOMEM); } PROC_UNLOCK(proc); - if (npages + vm_cnt.v_wire_count > vm_page_max_wired) + if (npages + vm_wire_count() > vm_page_max_wired) return (EAGAIN); #ifdef RACCT if (racct_enable) { Modified: head/sys/vm/vm_page.c ============================================================================== --- head/sys/vm/vm_page.c Mon Feb 12 22:43:47 2018 (r329186) +++ head/sys/vm/vm_page.c Mon Feb 12 22:53:00 2018 (r329187) @@ -1796,7 +1796,7 @@ found: * The page lock is not required for wiring a page until that * page is inserted into the object. */ - atomic_add_int(&vm_cnt.v_wire_count, 1); + vm_wire_add(1); m->wire_count = 1; } m->act_count = 0; @@ -1805,7 +1805,7 @@ found: if (vm_page_insert_after(m, object, pindex, mpred)) { pagedaemon_wakeup(domain); if (req & VM_ALLOC_WIRED) { - atomic_subtract_int(&vm_cnt.v_wire_count, 1); + vm_wire_sub(1); m->wire_count = 0; } KASSERT(m->object == NULL, ("page %p has object", m)); @@ -1989,7 +1989,7 @@ found: if ((req & VM_ALLOC_SBUSY) != 0) busy_lock = VPB_SHARERS_WORD(1); if ((req & VM_ALLOC_WIRED) != 0) - atomic_add_int(&vm_cnt.v_wire_count, npages); + vm_wire_add(npages); if (object != NULL) { if (object->memattr != VM_MEMATTR_DEFAULT && memattr == VM_MEMATTR_DEFAULT) @@ -2007,8 +2007,7 @@ found: if (vm_page_insert_after(m, object, pindex, mpred)) { pagedaemon_wakeup(domain); if ((req & VM_ALLOC_WIRED) != 0) - atomic_subtract_int( - &vm_cnt.v_wire_count, npages); + vm_wire_sub(npages); KASSERT(m->object == NULL, ("page %p has object", m)); mpred = m; @@ -2133,7 +2132,7 @@ again: * The page lock is not required for wiring a page that does * not belong to an object. */ - atomic_add_int(&vm_cnt.v_wire_count, 1); + vm_wire_add(1); m->wire_count = 1; } /* Unmanaged pages don't use "act_count". */ @@ -3256,7 +3255,7 @@ vm_page_wire(vm_page_t m) KASSERT((m->oflags & VPO_UNMANAGED) == 0 || m->queue == PQ_NONE, ("vm_page_wire: unmanaged page %p is queued", m)); - atomic_add_int(&vm_cnt.v_wire_count, 1); + vm_wire_add(1); } m->wire_count++; KASSERT(m->wire_count != 0, ("vm_page_wire: wire_count overflow m=%p", m)); @@ -3331,7 +3330,7 @@ vm_page_unwire_noq(vm_page_t m) panic("vm_page_unwire: page %p's wire count is zero", m); m->wire_count--; if (m->wire_count == 0) { - atomic_subtract_int(&vm_cnt.v_wire_count, 1); + vm_wire_sub(1); return (true); } else return (false); @@ -4157,7 +4156,7 @@ DB_SHOW_COMMAND(page, vm_page_print_page_info) db_printf("vm_cnt.v_inactive_count: %d\n", vm_inactive_count()); db_printf("vm_cnt.v_active_count: %d\n", vm_active_count()); db_printf("vm_cnt.v_laundry_count: %d\n", vm_laundry_count()); - db_printf("vm_cnt.v_wire_count: %d\n", vm_cnt.v_wire_count); + db_printf("vm_cnt.v_wire_count: %d\n", vm_wire_count()); db_printf("vm_cnt.v_free_reserved: %d\n", vm_cnt.v_free_reserved); db_printf("vm_cnt.v_free_min: %d\n", vm_cnt.v_free_min); db_printf("vm_cnt.v_free_target: %d\n", vm_cnt.v_free_target); From owner-svn-src-all@freebsd.org Mon Feb 12 23:53:40 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4555BF04F47; Mon, 12 Feb 2018 23:53:40 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E4FA17575C; Mon, 12 Feb 2018 23:53:39 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C57D218F5D; Mon, 12 Feb 2018 23:53:39 +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 w1CNrdk2065952; Mon, 12 Feb 2018 23:53:39 GMT (envelope-from dteske@FreeBSD.org) Received: (from dteske@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1CNrdtc065944; Mon, 12 Feb 2018 23:53:39 GMT (envelope-from dteske@FreeBSD.org) Message-Id: <201802122353.w1CNrdtc065944@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dteske set sender to dteske@FreeBSD.org using -f From: Devin Teske Date: Mon, 12 Feb 2018 23:53:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329188 - head/cddl/lib/libdtrace X-SVN-Group: head X-SVN-Commit-Author: dteske X-SVN-Commit-Paths: head/cddl/lib/libdtrace X-SVN-Commit-Revision: 329188 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Feb 2018 23:53:40 -0000 Author: dteske Date: Mon Feb 12 23:53:38 2018 New Revision: 329188 URL: https://svnweb.freebsd.org/changeset/base/329188 Log: Use tabs in io.d, fix alignment issues, remove extraneous newlines Modified: head/cddl/lib/libdtrace/io.d head/cddl/lib/libdtrace/ip.d head/cddl/lib/libdtrace/libproc_compat.h head/cddl/lib/libdtrace/psinfo.d head/cddl/lib/libdtrace/regs_x86.d head/cddl/lib/libdtrace/sched.d head/cddl/lib/libdtrace/tcp.d head/cddl/lib/libdtrace/udp.d Modified: head/cddl/lib/libdtrace/io.d ============================================================================== --- head/cddl/lib/libdtrace/io.d Mon Feb 12 22:53:00 2018 (r329187) +++ head/cddl/lib/libdtrace/io.d Mon Feb 12 23:53:38 2018 (r329188) @@ -29,47 +29,47 @@ #pragma D depends_on provider io typedef struct devinfo { - int dev_major; /* major number */ - int dev_minor; /* minor number */ - int dev_instance; /* instance number */ - string dev_name; /* name of device */ - string dev_statname; /* name of device + instance/minor */ - string dev_pathname; /* pathname of device */ + int dev_major; /* major number */ + int dev_minor; /* minor number */ + int dev_instance; /* instance number */ + string dev_name; /* name of device */ + string dev_statname; /* name of device + instance/minor */ + string dev_pathname; /* pathname of device */ } devinfo_t; #pragma D binding "1.0" translator translator devinfo_t < struct devstat *D > { - dev_major = D->device_number; - dev_minor = D->unit_number; - dev_instance = 0; - dev_name = stringof(D->device_name); - dev_statname = stringof(D->device_name); - dev_pathname = stringof(D->device_name); + dev_major = D->device_number; + dev_minor = D->unit_number; + dev_instance = 0; + dev_name = stringof(D->device_name); + dev_statname = stringof(D->device_name); + dev_pathname = stringof(D->device_name); }; typedef struct bufinfo { - int b_flags; /* flags */ - long b_bcount; /* number of bytes */ - caddr_t b_addr; /* buffer address */ - uint64_t b_blkno; /* expanded block # on device */ - uint64_t b_lblkno; /* block # on device */ - size_t b_resid; /* # of bytes not transferred */ - size_t b_bufsize; /* size of allocated buffer */ -/* caddr_t b_iodone; I/O completion routine */ - int b_error; /* expanded error field */ -/* dev_t b_edev; extended device */ + int b_flags; /* flags */ + long b_bcount; /* number of bytes */ + caddr_t b_addr; /* buffer address */ + uint64_t b_blkno; /* expanded block # on device */ + uint64_t b_lblkno; /* block # on device */ + size_t b_resid; /* # of bytes not transferred */ + size_t b_bufsize; /* size of allocated buffer */ +/* caddr_t b_iodone; I/O completion routine */ + int b_error; /* expanded error field */ +/* dev_t b_edev; extended device */ } bufinfo_t; #pragma D binding "1.0" translator translator bufinfo_t < struct bio *B > { - b_flags = B->bio_flags; - b_bcount = B->bio_bcount; - b_addr = B->bio_data; - b_blkno = 0; - b_lblkno = 0; - b_resid = B->bio_resid; - b_bufsize = 0; /* XXX gnn */ - b_error = B->bio_error; + b_flags = B->bio_flags; + b_bcount = B->bio_bcount; + b_addr = B->bio_data; + b_blkno = 0; + b_lblkno = 0; + b_resid = B->bio_resid; + b_bufsize = 0; /* XXX gnn */ + b_error = B->bio_error; }; /* @@ -105,5 +105,3 @@ inline int O_SYNC = 0x0080; #pragma D binding "1.1" O_SYNC inline int O_TRUNC = 0x0400; #pragma D binding "1.1" O_TRUNC - - Modified: head/cddl/lib/libdtrace/ip.d ============================================================================== --- head/cddl/lib/libdtrace/ip.d Mon Feb 12 22:53:00 2018 (r329187) +++ head/cddl/lib/libdtrace/ip.d Mon Feb 12 23:53:38 2018 (r329188) @@ -215,10 +215,10 @@ translator csinfo_t < void *p > { #pragma D binding "1.6.3" translator translator csinfo_t < struct inpcb *p > { - cs_addr = NULL; - cs_cid = (uint64_t)p; - cs_pid = 0; /* XXX */ - cs_zoneid = 0; + cs_addr = NULL; + cs_cid = (uint64_t)p; + cs_pid = 0; /* XXX */ + cs_zoneid = 0; }; #pragma D binding "1.5" translator Modified: head/cddl/lib/libdtrace/libproc_compat.h ============================================================================== --- head/cddl/lib/libdtrace/libproc_compat.h Mon Feb 12 22:53:00 2018 (r329187) +++ head/cddl/lib/libdtrace/libproc_compat.h Mon Feb 12 23:53:38 2018 (r329188) @@ -4,7 +4,7 @@ * * This software was developed by Rui Paulo under sponsorship from the * FreeBSD Foundation. - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: Modified: head/cddl/lib/libdtrace/psinfo.d ============================================================================== --- head/cddl/lib/libdtrace/psinfo.d Mon Feb 12 22:53:00 2018 (r329187) +++ head/cddl/lib/libdtrace/psinfo.d Mon Feb 12 23:53:38 2018 (r329188) @@ -97,4 +97,3 @@ inline psinfo_t *curpsinfo = xlate (curth inline lwpsinfo_t *curlwpsinfo = xlate (curthread); #pragma D attributes Stable/Stable/Common curlwpsinfo #pragma D binding "1.0" curlwpsinfo - Modified: head/cddl/lib/libdtrace/regs_x86.d ============================================================================== --- head/cddl/lib/libdtrace/regs_x86.d Mon Feb 12 22:53:00 2018 (r329187) +++ head/cddl/lib/libdtrace/regs_x86.d Mon Feb 12 23:53:38 2018 (r329188) @@ -1,4 +1,4 @@ -/* +/* * CDDL HEADER START * * The contents of this file are subject to the terms of the @@ -116,4 +116,3 @@ inline int R_R14 = 18 + 1 + 1; #pragma D binding "1.0" R_R14 inline int R_R15 = 18 + 1 + 0; #pragma D binding "1.0" R_R15 - Modified: head/cddl/lib/libdtrace/sched.d ============================================================================== --- head/cddl/lib/libdtrace/sched.d Mon Feb 12 22:53:00 2018 (r329187) +++ head/cddl/lib/libdtrace/sched.d Mon Feb 12 23:53:38 2018 (r329188) @@ -81,4 +81,3 @@ inline chipid_t chip = curcpu->cpu_chip; inline lgrp_id_t lgrp = curcpu->cpu_lgrp; #pragma D attributes Stable/Stable/Common lgrp #pragma D binding "1.0" lgrp - Modified: head/cddl/lib/libdtrace/tcp.d ============================================================================== --- head/cddl/lib/libdtrace/tcp.d Mon Feb 12 22:53:00 2018 (r329187) +++ head/cddl/lib/libdtrace/tcp.d Mon Feb 12 23:53:38 2018 (r329188) @@ -118,18 +118,18 @@ typedef struct tcpsinfo { int32_t tcps_rcv_ws; /* receive window scaling */ u_long tcps_cwnd; /* congestion window */ u_long tcps_cwnd_ssthresh; /* threshold for congestion avoidance */ - uint32_t tcps_srecover; /* for use in NewReno Fast Recovery */ + uint32_t tcps_srecover; /* for use in NewReno Fast Recovery */ uint32_t tcps_sack_fack; /* SACK sequence # we have acked */ uint32_t tcps_sack_snxt; /* next SACK seq # for retransmission */ uint32_t tcps_rto; /* round-trip timeout, msec */ uint32_t tcps_mss; /* max segment size */ int tcps_retransmit; /* retransmit send event, boolean */ int tcps_srtt; /* smoothed RTT in units of (TCP_RTT_SCALE*hz) */ - int tcps_debug; /* socket has SO_DEBUG set */ - int tcps_cookie; /* expose the socket's SO_USER_COOKIE */ - int32_t tcps_dupacks; /* consecutive dup acks received */ - uint32_t tcps_rtttime; /* RTT measurement start time */ - uint32_t tcps_rtseq; /* sequence # being timed */ + int tcps_debug; /* socket has SO_DEBUG set */ + int tcps_cookie; /* expose the socket's SO_USER_COOKIE */ + int32_t tcps_dupacks; /* consecutive dup acks received */ + uint32_t tcps_rtttime; /* RTT measurement start time */ + uint32_t tcps_rtseq; /* sequence # being timed */ uint32_t tcps_ts_recent; /* timestamp echo data */ } tcpsinfo_t; @@ -206,31 +206,31 @@ translator tcpsinfo_t < struct tcpcb *p > { tcps_snxt = p == NULL ? 0 : p->snd_nxt; tcps_rack = p == NULL ? 0 : p->last_ack_sent; tcps_rnxt = p == NULL ? 0 : p->rcv_nxt; - tcps_swnd = p == NULL ? -1 : p->snd_wnd; - tcps_snd_ws = p == NULL ? -1 : p->snd_scale; - tcps_swl1 = p == NULL ? -1 : p->snd_wl1; - tcps_swl2 = p == NULL ? -1 : p->snd_wl2; - tcps_radv = p == NULL ? -1 : p->rcv_adv; - tcps_rwnd = p == NULL ? -1 : p->rcv_wnd; - tcps_rup = p == NULL ? -1 : p->rcv_up; - tcps_rcv_ws = p == NULL ? -1 : p->rcv_scale; - tcps_cwnd = p == NULL ? -1 : p->snd_cwnd; - tcps_cwnd_ssthresh = p == NULL ? -1 : p->snd_ssthresh; - tcps_srecover = p == NULL ? -1 : p->snd_recover; + tcps_swnd = p == NULL ? -1 : p->snd_wnd; + tcps_snd_ws = p == NULL ? -1 : p->snd_scale; + tcps_swl1 = p == NULL ? -1 : p->snd_wl1; + tcps_swl2 = p == NULL ? -1 : p->snd_wl2; + tcps_radv = p == NULL ? -1 : p->rcv_adv; + tcps_rwnd = p == NULL ? -1 : p->rcv_wnd; + tcps_rup = p == NULL ? -1 : p->rcv_up; + tcps_rcv_ws = p == NULL ? -1 : p->rcv_scale; + tcps_cwnd = p == NULL ? -1 : p->snd_cwnd; + tcps_cwnd_ssthresh = p == NULL ? -1 : p->snd_ssthresh; + tcps_srecover = p == NULL ? -1 : p->snd_recover; tcps_sack_fack = p == NULL ? 0 : p->snd_fack; tcps_sack_snxt = p == NULL ? 0 : p->sack_newdata; tcps_rto = p == NULL ? -1 : (p->t_rxtcur * 1000) / `hz; - tcps_mss = p == NULL ? -1 : p->t_maxseg; + tcps_mss = p == NULL ? -1 : p->t_maxseg; tcps_retransmit = p == NULL ? -1 : p->t_rxtshift > 0 ? 1 : 0; - tcps_srtt = p == NULL ? -1 : p->t_srtt; /* smoothed RTT in units of (TCP_RTT_SCALE*hz) */ + tcps_srtt = p == NULL ? -1 : p->t_srtt; /* smoothed RTT in units of (TCP_RTT_SCALE*hz) */ tcps_debug = p == NULL ? 0 : p->t_inpcb->inp_socket->so_options & 1; tcps_cookie = p == NULL ? -1 : p->t_inpcb->inp_socket->so_user_cookie; - tcps_dupacks = p == NULL ? -1 : p->t_dupacks; - tcps_rtttime = p == NULL ? -1 : p->t_rtttime; - tcps_rtseq = p == NULL ? -1 : p->t_rtseq; - tcps_ts_recent = p == NULL ? -1 : p->ts_recent; + tcps_dupacks = p == NULL ? -1 : p->t_dupacks; + tcps_rtttime = p == NULL ? -1 : p->t_rtttime; + tcps_rtseq = p == NULL ? -1 : p->t_rtseq; + tcps_ts_recent = p == NULL ? -1 : p->ts_recent; }; #pragma D binding "1.6.3" translator @@ -319,74 +319,74 @@ inline int PRU_LISTEN = 3; #pragma D binding "1.12.1" PRU_CONNECT inline int PRU_CONNECT = 4; #pragma D binding "1.12.1" PRU_ACCEPT -inline int PRU_ACCEPT = 5 ; +inline int PRU_ACCEPT = 5 ; #pragma D binding "1.12.1" PRU_DISCONNECT -inline int PRU_DISCONNECT= 6; +inline int PRU_DISCONNECT = 6; #pragma D binding "1.12.1" PRU_SHUTDOWN -inline int PRU_SHUTDOWN = 7; +inline int PRU_SHUTDOWN = 7; #pragma D binding "1.12.1" PRU_RCVD -inline int PRU_RCVD = 8; +inline int PRU_RCVD = 8; #pragma D binding "1.12.1" PRU_SEND -inline int PRU_SEND = 9; +inline int PRU_SEND = 9; #pragma D binding "1.12.1" PRU_ABORT -inline int PRU_ABORT = 10; +inline int PRU_ABORT = 10; #pragma D binding "1.12.1" PRU_CONTROL -inline int PRU_CONTROL = 11; +inline int PRU_CONTROL = 11; #pragma D binding "1.12.1" PRU_SENSE -inline int PRU_SENSE = 12; +inline int PRU_SENSE = 12; #pragma D binding "1.12.1" PRU_RCVOOB -inline int PRU_RCVOOB = 13; +inline int PRU_RCVOOB = 13; #pragma D binding "1.12.1" PRU_SENDOOB -inline int PRU_SENDOOB = 14; +inline int PRU_SENDOOB = 14; #pragma D binding "1.12.1" PRU_SOCKADDR -inline int PRU_SOCKADDR = 15; +inline int PRU_SOCKADDR = 15; #pragma D binding "1.12.1" PRU_PEERADDR -inline int PRU_PEERADDR = 16; +inline int PRU_PEERADDR = 16; #pragma D binding "1.12.1" PRU_CONNECT2 -inline int PRU_CONNECT2 = 17; +inline int PRU_CONNECT2 = 17; #pragma D binding "1.12.1" PRU_FASTTIMO -inline int PRU_FASTTIMO = 18; +inline int PRU_FASTTIMO = 18; #pragma D binding "1.12.1" PRU_SLOWTIMO -inline int PRU_SLOWTIMO = 19; +inline int PRU_SLOWTIMO = 19; #pragma D binding "1.12.1" PRU_PROTORCV -inline int PRU_PROTORCV = 20; +inline int PRU_PROTORCV = 20; #pragma D binding "1.12.1" PRU_PROTOSEND -inline int PRU_PROTOSEND = 21; +inline int PRU_PROTOSEND = 21; #pragma D binding "1.12.1" PRU_SEND_EOF -inline int PRU_SEND_EOF = 22; +inline int PRU_SEND_EOF = 22; #pragma D binding "1.12.1" PRU_SOSETLABEL -inline int PRU_SOSETLABEL = 23; +inline int PRU_SOSETLABEL = 23; #pragma D binding "1.12.1" PRU_CLOSE -inline int PRU_CLOSE = 24; +inline int PRU_CLOSE = 24; #pragma D binding "1.12.1" PRU_FLUSH -inline int PRU_FLUSH = 25; +inline int PRU_FLUSH = 25; #pragma D binding "1.12.1" prureq_string inline string prureq_string[uint8_t req] = - req == PRU_ATTACH ? "ATTACH" : - req == PRU_DETACH ? "DETACH" : - req == PRU_BIND ? "BIND" : - req == PRU_LISTEN ? "LISTEN" : - req == PRU_CONNECT ? "CONNECT" : - req == PRU_ACCEPT ? "ACCEPT" : - req == PRU_DISCONNECT ? "DISCONNECT" : - req == PRU_SHUTDOWN ? "SHUTDOWN" : - req == PRU_RCVD ? "RCVD" : - req == PRU_SEND ? "SEND" : - req == PRU_ABORT ? "ABORT" : - req == PRU_CONTROL ? "CONTROL" : - req == PRU_SENSE ? "SENSE" : - req == PRU_RCVOOB ? "RCVOOB" : - req == PRU_SENDOOB ? "SENDOOB" : - req == PRU_SOCKADDR ? "SOCKADDR" : - req == PRU_PEERADDR ? "PEERADDR" : - req == PRU_CONNECT2 ? "CONNECT2" : - req == PRU_FASTTIMO ? "FASTTIMO" : - req == PRU_SLOWTIMO ? "SLOWTIMO" : - req == PRU_PROTORCV ? "PROTORCV" : - req == PRU_PROTOSEND ? "PROTOSEND" : - req == PRU_SEND ? "SEND_EOF" : - req == PRU_SOSETLABEL ? "SOSETLABEL" : - req == PRU_CLOSE ? "CLOSE" : - req == PRU_FLUSH ? "FLUSE" : + req == PRU_ATTACH ? "ATTACH" : + req == PRU_DETACH ? "DETACH" : + req == PRU_BIND ? "BIND" : + req == PRU_LISTEN ? "LISTEN" : + req == PRU_CONNECT ? "CONNECT" : + req == PRU_ACCEPT ? "ACCEPT" : + req == PRU_DISCONNECT ? "DISCONNECT" : + req == PRU_SHUTDOWN ? "SHUTDOWN" : + req == PRU_RCVD ? "RCVD" : + req == PRU_SEND ? "SEND" : + req == PRU_ABORT ? "ABORT" : + req == PRU_CONTROL ? "CONTROL" : + req == PRU_SENSE ? "SENSE" : + req == PRU_RCVOOB ? "RCVOOB" : + req == PRU_SENDOOB ? "SENDOOB" : + req == PRU_SOCKADDR ? "SOCKADDR" : + req == PRU_PEERADDR ? "PEERADDR" : + req == PRU_CONNECT2 ? "CONNECT2" : + req == PRU_FASTTIMO ? "FASTTIMO" : + req == PRU_SLOWTIMO ? "SLOWTIMO" : + req == PRU_PROTORCV ? "PROTORCV" : + req == PRU_PROTOSEND ? "PROTOSEND" : + req == PRU_SEND ? "SEND_EOF" : + req == PRU_SOSETLABEL ? "SOSETLABEL" : + req == PRU_CLOSE ? "CLOSE" : + req == PRU_FLUSH ? "FLUSE" : "unknown" ; Modified: head/cddl/lib/libdtrace/udp.d ============================================================================== --- head/cddl/lib/libdtrace/udp.d Mon Feb 12 22:53:00 2018 (r329187) +++ head/cddl/lib/libdtrace/udp.d Mon Feb 12 23:53:38 2018 (r329188) @@ -47,7 +47,7 @@ typedef struct udpinfo { uint16_t udp_sport; /* source port */ uint16_t udp_dport; /* destination port */ uint16_t udp_length; /* total length */ - uint16_t udp_checksum; /* headers + data checksum */ + uint16_t udp_checksum; /* headers + data checksum */ struct udphdr *udp_hdr; /* raw UDP header */ } udpinfo_t; From owner-svn-src-all@freebsd.org Tue Feb 13 02:11:41 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 14A24F12B62; Tue, 13 Feb 2018 02:11:41 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BBD1A7C793; Tue, 13 Feb 2018 02:11:40 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9E2281A677; Tue, 13 Feb 2018 02:11:40 +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 w1D2BeZi031290; Tue, 13 Feb 2018 02:11:40 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1D2BdXX031284; Tue, 13 Feb 2018 02:11:39 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201802130211.w1D2BdXX031284@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Tue, 13 Feb 2018 02:11:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r329189 - in stable/11/sys/dev: mpr mps X-SVN-Group: stable-11 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: in stable/11/sys/dev: mpr mps X-SVN-Commit-Revision: 329189 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Feb 2018 02:11:41 -0000 Author: mav Date: Tue Feb 13 02:11:39 2018 New Revision: 329189 URL: https://svnweb.freebsd.org/changeset/base/329189 Log: MFC r328937: Fix queue length reporting in mps(4) and mpr(4). Both drivers were found to report CAM bigger queue depth then they really can handle. It made them later under high load with many disks return some of submitted requests back with CAM_REQUEUE_REQ status for later resubmission. Modified: stable/11/sys/dev/mpr/mpr.c stable/11/sys/dev/mpr/mpr_sas.c stable/11/sys/dev/mpr/mprvar.h stable/11/sys/dev/mps/mps.c stable/11/sys/dev/mps/mps_sas.c stable/11/sys/dev/mps/mpsvar.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/mpr/mpr.c ============================================================================== --- stable/11/sys/dev/mpr/mpr.c Mon Feb 12 23:53:38 2018 (r329188) +++ stable/11/sys/dev/mpr/mpr.c Tue Feb 13 02:11:39 2018 (r329189) @@ -503,7 +503,10 @@ mpr_iocfacts_allocate(struct mpr_softc *sc, uint8_t at * Size the queues. Since the reply queues always need one free * entry, we'll just deduct one reply message here. */ - sc->num_reqs = MIN(MPR_REQ_FRAMES, sc->facts->RequestCredit); + sc->num_prireqs = MIN(MPR_PRI_REQ_FRAMES, + sc->facts->HighPriorityCredit); + sc->num_reqs = MIN(MPR_REQ_FRAMES, sc->facts->RequestCredit) + + sc->num_prireqs; sc->num_replies = MIN(MPR_REPLY_FRAMES + MPR_EVT_REPLY_FRAMES, sc->facts->MaxReplyDescriptorPostQueueDepth) - 1; @@ -1362,7 +1365,7 @@ mpr_alloc_requests(struct mpr_softc *sc) /* XXX Is a failure here a critical problem? */ if (bus_dmamap_create(sc->buffer_dmat, 0, &cm->cm_dmamap) == 0) { - if (i <= sc->facts->HighPriorityCredit) + if (i <= sc->num_prireqs) mpr_free_high_priority_command(sc, cm); else mpr_free_command(sc, cm); Modified: stable/11/sys/dev/mpr/mpr_sas.c ============================================================================== --- stable/11/sys/dev/mpr/mpr_sas.c Mon Feb 12 23:53:38 2018 (r329188) +++ stable/11/sys/dev/mpr/mpr_sas.c Tue Feb 13 02:11:39 2018 (r329189) @@ -728,7 +728,7 @@ mpr_attach_sas(struct mpr_softc *sc) { struct mprsas_softc *sassc; cam_status status; - int unit, error = 0; + int unit, error = 0, reqs; MPR_FUNCTRACE(sc); @@ -757,7 +757,8 @@ mpr_attach_sas(struct mpr_softc *sc) sc->sassc = sassc; sassc->sc = sc; - if ((sassc->devq = cam_simq_alloc(sc->num_reqs)) == NULL) { + reqs = sc->num_reqs - sc->num_prireqs - 1; + if ((sassc->devq = cam_simq_alloc(reqs)) == NULL) { mpr_dprint(sc, MPR_ERROR, "Cannot allocate SIMQ\n"); error = ENOMEM; goto out; @@ -765,7 +766,7 @@ mpr_attach_sas(struct mpr_softc *sc) unit = device_get_unit(sc->mpr_dev); sassc->sim = cam_sim_alloc(mprsas_action, mprsas_poll, "mpr", sassc, - unit, &sc->mpr_mtx, sc->num_reqs, sc->num_reqs, sassc->devq); + unit, &sc->mpr_mtx, reqs, reqs, sassc->devq); if (sassc->sim == NULL) { mpr_dprint(sc, MPR_ERROR, "Cannot allocate SIM\n"); error = EINVAL; Modified: stable/11/sys/dev/mpr/mprvar.h ============================================================================== --- stable/11/sys/dev/mpr/mprvar.h Mon Feb 12 23:53:38 2018 (r329188) +++ stable/11/sys/dev/mpr/mprvar.h Tue Feb 13 02:11:39 2018 (r329189) @@ -38,6 +38,7 @@ #define MPR_DB_MAX_WAIT 2500 #define MPR_REQ_FRAMES 1024 +#define MPR_PRI_REQ_FRAMES 128 #define MPR_EVT_REPLY_FRAMES 32 #define MPR_REPLY_FRAMES MPR_REQ_FRAMES #define MPR_CHAIN_FRAMES 2048 @@ -328,6 +329,7 @@ struct mpr_softc { MPI2_IOC_FACTS_REPLY *facts; int num_reqs; + int num_prireqs; int num_replies; int fqdepth; /* Free queue */ int pqdepth; /* Post queue */ Modified: stable/11/sys/dev/mps/mps.c ============================================================================== --- stable/11/sys/dev/mps/mps.c Mon Feb 12 23:53:38 2018 (r329188) +++ stable/11/sys/dev/mps/mps.c Tue Feb 13 02:11:39 2018 (r329189) @@ -489,7 +489,10 @@ mps_iocfacts_allocate(struct mps_softc *sc, uint8_t at * Size the queues. Since the reply queues always need one free * entry, we'll just deduct one reply message here. */ - sc->num_reqs = MIN(MPS_REQ_FRAMES, sc->facts->RequestCredit); + sc->num_prireqs = MIN(MPS_PRI_REQ_FRAMES, + sc->facts->HighPriorityCredit); + sc->num_reqs = MIN(MPS_REQ_FRAMES, sc->facts->RequestCredit) + + sc->num_prireqs; sc->num_replies = MIN(MPS_REPLY_FRAMES + MPS_EVT_REPLY_FRAMES, sc->facts->MaxReplyDescriptorPostQueueDepth) - 1; @@ -1303,7 +1306,7 @@ mps_alloc_requests(struct mps_softc *sc) /* XXX Is a failure here a critical problem? */ if (bus_dmamap_create(sc->buffer_dmat, 0, &cm->cm_dmamap) == 0) - if (i <= sc->facts->HighPriorityCredit) + if (i <= sc->num_prireqs) mps_free_high_priority_command(sc, cm); else mps_free_command(sc, cm); Modified: stable/11/sys/dev/mps/mps_sas.c ============================================================================== --- stable/11/sys/dev/mps/mps_sas.c Mon Feb 12 23:53:38 2018 (r329188) +++ stable/11/sys/dev/mps/mps_sas.c Tue Feb 13 02:11:39 2018 (r329189) @@ -716,7 +716,7 @@ mps_attach_sas(struct mps_softc *sc) { struct mpssas_softc *sassc; cam_status status; - int unit, error = 0; + int unit, error = 0, reqs; MPS_FUNCTRACE(sc); @@ -745,7 +745,8 @@ mps_attach_sas(struct mps_softc *sc) sc->sassc = sassc; sassc->sc = sc; - if ((sassc->devq = cam_simq_alloc(sc->num_reqs)) == NULL) { + reqs = sc->num_reqs - sc->num_prireqs - 1; + if ((sassc->devq = cam_simq_alloc(reqs)) == NULL) { mps_dprint(sc, MPS_ERROR, "Cannot allocate SIMQ\n"); error = ENOMEM; goto out; @@ -753,7 +754,7 @@ mps_attach_sas(struct mps_softc *sc) unit = device_get_unit(sc->mps_dev); sassc->sim = cam_sim_alloc(mpssas_action, mpssas_poll, "mps", sassc, - unit, &sc->mps_mtx, sc->num_reqs, sc->num_reqs, sassc->devq); + unit, &sc->mps_mtx, reqs, reqs, sassc->devq); if (sassc->sim == NULL) { mps_dprint(sc, MPS_ERROR, "Cannot allocate SIM\n"); error = EINVAL; Modified: stable/11/sys/dev/mps/mpsvar.h ============================================================================== --- stable/11/sys/dev/mps/mpsvar.h Mon Feb 12 23:53:38 2018 (r329188) +++ stable/11/sys/dev/mps/mpsvar.h Tue Feb 13 02:11:39 2018 (r329189) @@ -38,6 +38,7 @@ #define MPS_DB_MAX_WAIT 2500 #define MPS_REQ_FRAMES 1024 +#define MPS_PRI_REQ_FRAMES 128 #define MPS_EVT_REPLY_FRAMES 32 #define MPS_REPLY_FRAMES MPS_REQ_FRAMES #define MPS_CHAIN_FRAMES 2048 @@ -314,6 +315,7 @@ struct mps_softc { MPI2_IOC_FACTS_REPLY *facts; int num_reqs; + int num_prireqs; int num_replies; int fqdepth; /* Free queue */ int pqdepth; /* Post queue */ From owner-svn-src-all@freebsd.org Tue Feb 13 03:44:52 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 92AC1F1AF18; Tue, 13 Feb 2018 03:44:52 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3C5A780FC1; Tue, 13 Feb 2018 03:44:52 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1CC311B794; Tue, 13 Feb 2018 03:44:52 +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 w1D3ipfV081439; Tue, 13 Feb 2018 03:44:51 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1D3ioVT081427; Tue, 13 Feb 2018 03:44:50 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201802130344.w1D3ioVT081427@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Tue, 13 Feb 2018 03:44:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329190 - in head/stand: . common mips/beri/loader powerpc/kboot powerpc/ofw sparc64/loader uboot/common uboot/lib X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: in head/stand: . common mips/beri/loader powerpc/kboot powerpc/ofw sparc64/loader uboot/common uboot/lib X-SVN-Commit-Revision: 329190 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Feb 2018 03:44:52 -0000 Author: jhibbits Date: Tue Feb 13 03:44:50 2018 New Revision: 329190 URL: https://svnweb.freebsd.org/changeset/base/329190 Log: Unify metadata load files for arm, mips, powerpc, sparc64 Summary: All metadata.c files are very similar, with only trivial changes. Unify them into a single common file, with minor special-casing where needed. Reviewed By: imp Differential Revision: https://reviews.freebsd.org/D13978 Added: head/stand/common/metadata.c - copied, changed from r329189, head/stand/powerpc/ofw/metadata.c Deleted: head/stand/mips/beri/loader/metadata.c head/stand/powerpc/kboot/metadata.c head/stand/powerpc/ofw/metadata.c head/stand/sparc64/loader/metadata.c head/stand/uboot/common/metadata.c Modified: head/stand/loader.mk head/stand/mips/beri/loader/Makefile head/stand/mips/beri/loader/exec.c head/stand/mips/beri/loader/loader.h head/stand/powerpc/kboot/Makefile head/stand/powerpc/kboot/main.c head/stand/powerpc/ofw/Makefile head/stand/sparc64/loader/Makefile head/stand/uboot.mk head/stand/uboot/lib/elf_freebsd.c Copied and modified: head/stand/common/metadata.c (from r329189, head/stand/powerpc/ofw/metadata.c) ============================================================================== --- head/stand/powerpc/ofw/metadata.c Tue Feb 13 02:11:39 2018 (r329189, copy source) +++ head/stand/common/metadata.c Tue Feb 13 03:44:50 2018 (r329190) @@ -34,12 +34,63 @@ __FBSDID("$FreeBSD$"); #include #include #include +#if defined(LOADER_FDT_SUPPORT) #include +#endif #include #include "bootstrap.h" +#if defined(__sparc64__) +#include + +extern struct tlb_entry *dtlb_store; +extern struct tlb_entry *itlb_store; + +extern int dtlb_slot; +extern int itlb_slot; + +static int +md_bootserial(void) +{ + char buf[64]; + ihandle_t inst; + phandle_t input; + phandle_t node; + phandle_t output; + + if ((node = OF_finddevice("/options")) == -1) + return(-1); + if (OF_getprop(node, "input-device", buf, sizeof(buf)) == -1) + return(-1); + input = OF_finddevice(buf); + if (OF_getprop(node, "output-device", buf, sizeof(buf)) == -1) + return(-1); + output = OF_finddevice(buf); + if (input == -1 || output == -1 || + OF_getproplen(input, "keyboard") >= 0) { + if ((node = OF_finddevice("/chosen")) == -1) + return(-1); + if (OF_getprop(node, "stdin", &inst, sizeof(inst)) == -1) + return(-1); + if ((input = OF_instance_to_package(inst)) == -1) + return(-1); + if (OF_getprop(node, "stdout", &inst, sizeof(inst)) == -1) + return(-1); + if ((output = OF_instance_to_package(inst)) == -1) + return(-1); + } + if (input != output) + return(-1); + if (OF_getprop(input, "device_type", buf, sizeof(buf)) == -1) + return(-1); + if (strcmp(buf, "serial") != 0) + return(-1); + return(0); +} +#endif + int md_getboothowto(char *kargs) { @@ -47,7 +98,7 @@ md_getboothowto(char *kargs) int howto; int active; int i; - + /* Parse kargs */ howto = 0; if (kargs != NULL) { @@ -98,14 +149,20 @@ md_getboothowto(char *kargs) cp++; } } + /* get equivalents from the environment */ for (i = 0; howto_names[i].ev != NULL; i++) if (getenv(howto_names[i].ev) != NULL) howto |= howto_names[i].mask; +#if defined(__sparc64__) + if (md_bootserial() != -1) + howto |= RB_SERIAL; +#else if (!strcmp(getenv("console"), "comconsole")) howto |= RB_SERIAL; if (!strcmp(getenv("console"), "nullconsole")) howto |= RB_MUTE; +#endif return(howto); } @@ -114,11 +171,11 @@ md_getboothowto(char *kargs) * Each variable is formatted as =, with a single nul * separating each variable, and a double nul terminating the environment. */ -vm_offset_t +static vm_offset_t md_copyenv(vm_offset_t addr) { struct env_var *ep; - + /* traverse the environment */ for (ep = environ; ep != NULL; ep = ep->ev_next) { archsw.arch_copyin(ep->ev_name, addr, strlen(ep->ev_name)); @@ -199,7 +256,7 @@ static int align; COPY32(0, a, c); \ } -vm_offset_t +static vm_offset_t md_copymodules(vm_offset_t addr, int kern64) { struct preloaded_file *fp; @@ -235,7 +292,7 @@ md_copymodules(vm_offset_t addr, int kern64) } /* - * Load the information expected by a powerpc kernel. + * Load the information expected by a kernel. * * - The 'boothowto' argument is constructed * - The 'bootdev' argument is constructed @@ -251,7 +308,9 @@ md_load_dual(char *args, vm_offset_t *modulep, vm_offs vm_offset_t kernend; vm_offset_t addr; vm_offset_t envp; +#if defined(LOADER_FDT_SUPPORT) vm_offset_t fdtp; +#endif vm_offset_t size; uint64_t scratch64; char *rootdevname; @@ -260,40 +319,45 @@ md_load_dual(char *args, vm_offset_t *modulep, vm_offs align = kern64 ? 8 : 4; howto = md_getboothowto(args); - /* - * Allow the environment variable 'rootdev' to override the supplied device - * This should perhaps go to MI code and/or have $rootdev tested/set by - * MI code before launching the kernel. + /* + * Allow the environment variable 'rootdev' to override the supplied + * device. This should perhaps go to MI code and/or have $rootdev + * tested/set by MI code before launching the kernel. */ rootdevname = getenv("rootdev"); if (rootdevname == NULL) - rootdevname = getenv("currdev"); + rootdevname = getenv("currdev"); /* Try reading the /etc/fstab file to select the root device */ getrootmount(rootdevname); - /* find the last module in the chain */ + /* Find the last module in the chain */ addr = 0; for (xp = file_findfile(NULL, NULL); xp != NULL; xp = xp->f_next) { if (addr < (xp->f_addr + xp->f_size)) addr = xp->f_addr + xp->f_size; } - /* pad to a page boundary */ + /* Pad to a page boundary */ addr = roundup(addr, PAGE_SIZE); - /* copy our environment */ + /* Copy our environment */ envp = addr; addr = md_copyenv(addr); - /* pad to a page boundary */ + /* Pad to a page boundary */ addr = roundup(addr, PAGE_SIZE); +#if defined(LOADER_FDT_SUPPORT) /* Copy out FDT */ - *dtb = fdtp = 0; - if (getenv("usefdt") != NULL) { - size = fdt_copy(addr); - *dtb = fdtp = addr; - addr = roundup(addr + size, PAGE_SIZE); + fdtp = 0; +#if defined(__powerpc__) + if (getenv("usefdt") != NULL) +#endif + { + size = fdt_copy(addr); + fdtp = addr; + addr = roundup(addr + size, PAGE_SIZE); } +#endif kernend = 0; kfp = file_findfile(NULL, kern64 ? "elf64 kernel" : "elf32 kernel"); @@ -305,19 +369,35 @@ md_load_dual(char *args, vm_offset_t *modulep, vm_offs if (kern64) { scratch64 = envp; file_addmetadata(kfp, MODINFOMD_ENVP, sizeof scratch64, &scratch64); - if (fdtp != 0) { +#if defined(LOADER_FDT_SUPPORT) + if (fdtp != 0) { scratch64 = fdtp; file_addmetadata(kfp, MODINFOMD_DTBP, sizeof scratch64, &scratch64); - } + } +#endif scratch64 = kernend; - file_addmetadata(kfp, MODINFOMD_KERNEND, sizeof scratch64, &scratch64); + file_addmetadata(kfp, MODINFOMD_KERNEND, + sizeof scratch64, &scratch64); } else { file_addmetadata(kfp, MODINFOMD_ENVP, sizeof envp, &envp); - if (fdtp != 0) +#if defined(LOADER_FDT_SUPPORT) + if (fdtp != 0) file_addmetadata(kfp, MODINFOMD_DTBP, sizeof fdtp, &fdtp); +#endif file_addmetadata(kfp, MODINFOMD_KERNEND, sizeof kernend, &kernend); } +#if defined(__sparc64__) + file_addmetadata(kfp, MODINFOMD_DTLB_SLOTS, + sizeof dtlb_slot, &dtlb_slot); + file_addmetadata(kfp, MODINFOMD_ITLB_SLOTS, + sizeof itlb_slot, &itlb_slot); + file_addmetadata(kfp, MODINFOMD_DTLB, + dtlb_slot * sizeof(*dtlb_store), dtlb_store); + file_addmetadata(kfp, MODINFOMD_ITLB, + itlb_slot * sizeof(*itlb_store), itlb_store); +#endif + *modulep = addr; size = md_copymodules(0, kern64); kernend = roundup(addr + size, PAGE_SIZE); @@ -329,8 +409,12 @@ md_load_dual(char *args, vm_offset_t *modulep, vm_offs } else { bcopy(&kernend, md->md_data, sizeof kernend); } - + (void)md_copymodules(addr, kern64); +#if defined(LOADER_FDT_SUPPORT) + if (dtb != NULL) + *dtb = fdtp; +#endif return(0); } @@ -341,9 +425,10 @@ md_load(char *args, vm_offset_t *modulep, vm_offset_t return (md_load_dual(args, modulep, dtb, 0)); } +#if defined(__mips__) || defined(__powerpc__) int md_load64(char *args, vm_offset_t *modulep, vm_offset_t *dtb) { return (md_load_dual(args, modulep, dtb, 1)); } - +#endif Modified: head/stand/loader.mk ============================================================================== --- head/stand/loader.mk Tue Feb 13 02:11:39 2018 (r329189) +++ head/stand/loader.mk Tue Feb 13 03:44:50 2018 (r329190) @@ -20,12 +20,16 @@ SRCS+= load_elf32.c reloc_elf32.c .elif ${MACHINE_CPUARCH} == "powerpc" SRCS+= load_elf32.c reloc_elf32.c SRCS+= load_elf64.c reloc_elf64.c +SRCS+= metadata.c .elif ${MACHINE_CPUARCH} == "sparc64" SRCS+= load_elf64.c reloc_elf64.c +SRCS+= metadata.c .elif ${MACHINE_ARCH:Mmips64*} != "" SRCS+= load_elf64.c reloc_elf64.c +SRCS+= metadata.c .elif ${MACHINE} == "mips" SRCS+= load_elf32.c reloc_elf32.c +SRCS+= metadata.c .endif .if ${LOADER_DISK_SUPPORT:Uyes} == "yes" Modified: head/stand/mips/beri/loader/Makefile ============================================================================== --- head/stand/mips/beri/loader/Makefile Tue Feb 13 02:11:39 2018 (r329189) +++ head/stand/mips/beri/loader/Makefile Tue Feb 13 03:44:50 2018 (r329190) @@ -47,7 +47,6 @@ SRCS= start.S \ main.c \ devicename.c \ exec.c \ - metadata.c \ vers.c \ arch.c Modified: head/stand/mips/beri/loader/exec.c ============================================================================== --- head/stand/mips/beri/loader/exec.c Tue Feb 13 02:11:39 2018 (r329189) +++ head/stand/mips/beri/loader/exec.c Tue Feb 13 03:44:50 2018 (r329190) @@ -85,7 +85,7 @@ beri_elf64_exec(struct preloaded_file *fp) } ehdr = (Elf_Ehdr *)md->md_data; - error = md_load64(fp->f_args, &mdp); + error = md_load64(fp->f_args, &mdp, NULL); if (error) { printf("%s: md_load64 failed\n", fp->f_name); return (error); Modified: head/stand/mips/beri/loader/loader.h ============================================================================== --- head/stand/mips/beri/loader/loader.h Tue Feb 13 02:11:39 2018 (r329189) +++ head/stand/mips/beri/loader/loader.h Tue Feb 13 03:44:50 2018 (r329190) @@ -56,7 +56,7 @@ extern char **boot2_envv; extern struct bootinfo boot2_bootinfo; /* metadata.c */ -int md_load64(char *args, vm_offset_t *modulep); +int md_load64(char *args, vm_offset_t *modulep, vm_offset_t *dtbp); /* vers.c */ extern char bootprog_info[]; Modified: head/stand/powerpc/kboot/Makefile ============================================================================== --- head/stand/powerpc/kboot/Makefile Tue Feb 13 02:11:39 2018 (r329189) +++ head/stand/powerpc/kboot/Makefile Tue Feb 13 03:44:50 2018 (r329190) @@ -17,7 +17,7 @@ NEWVERSWHAT= "kboot loader" ${MACHINE_ARCH} INSTALLFLAGS= -b # Architecture-specific loader code -SRCS= conf.c metadata.c vers.c main.c ppc64_elf_freebsd.c +SRCS= conf.c vers.c main.c ppc64_elf_freebsd.c SRCS+= host_syscall.S hostcons.c hostdisk.c kerneltramp.S kbootfdt.c SRCS+= ucmpdi2.c Modified: head/stand/powerpc/kboot/main.c ============================================================================== --- head/stand/powerpc/kboot/main.c Tue Feb 13 02:11:39 2018 (r329189) +++ head/stand/powerpc/kboot/main.c Tue Feb 13 03:44:50 2018 (r329190) @@ -291,6 +291,7 @@ main(int argc, const char **argv) setenv("currdev", bootdev, 1); setenv("loaddev", bootdev, 1); setenv("LINES", "24", 1); + setenv("usefdt", "1", 1); interact(); /* doesn't return */ Modified: head/stand/powerpc/ofw/Makefile ============================================================================== --- head/stand/powerpc/ofw/Makefile Tue Feb 13 02:11:39 2018 (r329189) +++ head/stand/powerpc/ofw/Makefile Tue Feb 13 03:44:50 2018 (r329190) @@ -17,7 +17,7 @@ NEWVERSWHAT= "Open Firmware loader" ${MACHINE_ARCH} INSTALLFLAGS= -b # Architecture-specific loader code -SRCS= conf.c metadata.c vers.c start.c +SRCS= conf.c vers.c start.c SRCS+= ucmpdi2.c .include "${BOOTSRC}/fdt.mk" Modified: head/stand/sparc64/loader/Makefile ============================================================================== --- head/stand/sparc64/loader/Makefile Tue Feb 13 02:11:39 2018 (r329189) +++ head/stand/sparc64/loader/Makefile Tue Feb 13 03:44:50 2018 (r329190) @@ -21,7 +21,7 @@ INSTALLFLAGS= -b # Architecture-specific loader code .PATH: ${BOOTSRC}/sparc64/loader -SRCS= locore.S main.c metadata.c vers.c +SRCS= locore.S main.c vers.c .if ${LOADER_DEBUG} == "yes" CFLAGS+= -DLOADER_DEBUG Modified: head/stand/uboot.mk ============================================================================== --- head/stand/uboot.mk Tue Feb 13 02:11:39 2018 (r329189) +++ head/stand/uboot.mk Tue Feb 13 03:44:50 2018 (r329190) @@ -1,6 +1,6 @@ # $FreeBSD$ -SRCS+= main.c metadata.c +SRCS+= main.c .PATH: ${UBOOTSRC}/common @@ -10,6 +10,9 @@ CFLAGS+= -I${UBOOTSRC}/common LIBUBOOT= ${BOOTOBJ}/uboot/lib/libuboot.a CFLAGS+= -I${UBOOTSRC}/lib CFLAGS+= -I${BOOTOBJ}/uboot/lib +.if ${MACHINE_CPUARCH} == "arm" +SRCS+= metadata.c +.endif .include "${BOOTSRC}/fdt.mk" Modified: head/stand/uboot/lib/elf_freebsd.c ============================================================================== --- head/stand/uboot/lib/elf_freebsd.c Tue Feb 13 02:11:39 2018 (r329189) +++ head/stand/uboot/lib/elf_freebsd.c Tue Feb 13 03:44:50 2018 (r329190) @@ -44,7 +44,7 @@ __FBSDID("$FreeBSD$"); #include "bootstrap.h" #include "libuboot.h" -extern vm_offset_t md_load(char *, vm_offset_t *); +extern vm_offset_t md_load(char *, vm_offset_t *, vm_offset_t *); int __elfN(uboot_load)(char *filename, u_int64_t dest, @@ -81,7 +81,7 @@ __elfN(uboot_exec)(struct preloaded_file *fp) e = (Elf_Ehdr *)&fmp->md_data; - if ((error = md_load(fp->f_args, &mdp)) != 0) + if ((error = md_load(fp->f_args, &mdp, NULL)) != 0) return (error); entry = (void *)e->e_entry; From owner-svn-src-all@freebsd.org Tue Feb 13 04:10:11 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6AA8DF1CD6F; Tue, 13 Feb 2018 04:10:11 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 18D33820CE; Tue, 13 Feb 2018 04:10:11 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E60681BAD3; Tue, 13 Feb 2018 04:10:10 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1D4AAVa091441; Tue, 13 Feb 2018 04:10:10 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1D4AAZZ091439; Tue, 13 Feb 2018 04:10:10 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201802130410.w1D4AAZZ091439@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Tue, 13 Feb 2018 04:10:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r329191 - in stable/11: stand/common sys/kern X-SVN-Group: stable-11 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in stable/11: stand/common sys/kern X-SVN-Commit-Revision: 329191 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Feb 2018 04:10:11 -0000 Author: kevans Date: Tue Feb 13 04:10:10 2018 New Revision: 329191 URL: https://svnweb.freebsd.org/changeset/base/329191 Log: Revert MFC r328911 from r329183 jhb@ had specified an MFC timer of 1-month, and I clobbered his efforts by MFC'ing it way prematurely. Back out that part of r329183 so it may be MFC'd when jhb is ready. Modified: stable/11/stand/common/load_elf_obj.c stable/11/sys/kern/link_elf_obj.c Directory Properties: stable/11/ (props changed) Modified: stable/11/stand/common/load_elf_obj.c ============================================================================== --- stable/11/stand/common/load_elf_obj.c Tue Feb 13 03:44:50 2018 (r329190) +++ stable/11/stand/common/load_elf_obj.c Tue Feb 13 04:10:10 2018 (r329191) @@ -280,8 +280,6 @@ __elfN(obj_loadimage)(struct preloaded_file *fp, elf_f switch (shdr[i].sh_type) { case SHT_REL: case SHT_RELA: - if ((shdr[shdr[i].sh_info].sh_flags & SHF_ALLOC) == 0) - break; lastaddr = roundup(lastaddr, shdr[i].sh_addralign); shdr[i].sh_addr = (Elf_Addr)lastaddr; lastaddr += shdr[i].sh_size; Modified: stable/11/sys/kern/link_elf_obj.c ============================================================================== --- stable/11/sys/kern/link_elf_obj.c Tue Feb 13 03:44:50 2018 (r329190) +++ stable/11/sys/kern/link_elf_obj.c Tue Feb 13 04:10:10 2018 (r329191) @@ -267,17 +267,9 @@ link_elf_link_preload(linker_class_t cls, const char * symstrindex = shdr[i].sh_link; break; case SHT_REL: - /* - * Ignore relocation tables for sections not - * loaded by the loader. - */ - if (shdr[shdr[i].sh_info].sh_addr == 0) - break; ef->nreltab++; break; case SHT_RELA: - if (shdr[shdr[i].sh_info].sh_addr == 0) - break; ef->nrelatab++; break; } @@ -399,16 +391,12 @@ link_elf_link_preload(linker_class_t cls, const char * pb++; break; case SHT_REL: - if (shdr[shdr[i].sh_info].sh_addr == 0) - break; ef->reltab[rl].rel = (Elf_Rel *)shdr[i].sh_addr; ef->reltab[rl].nrel = shdr[i].sh_size / sizeof(Elf_Rel); ef->reltab[rl].sec = shdr[i].sh_info; rl++; break; case SHT_RELA: - if (shdr[shdr[i].sh_info].sh_addr == 0) - break; ef->relatab[ra].rela = (Elf_Rela *)shdr[i].sh_addr; ef->relatab[ra].nrela = shdr[i].sh_size / sizeof(Elf_Rela); @@ -619,17 +607,9 @@ link_elf_load_file(linker_class_t cls, const char *fil symstrindex = shdr[i].sh_link; break; case SHT_REL: - /* - * Ignore relocation tables for unallocated - * sections. - */ - if ((shdr[shdr[i].sh_info].sh_flags & SHF_ALLOC) == 0) - break; ef->nreltab++; break; case SHT_RELA: - if ((shdr[shdr[i].sh_info].sh_flags & SHF_ALLOC) == 0) - break; ef->nrelatab++; break; case SHT_STRTAB: @@ -883,8 +863,6 @@ link_elf_load_file(linker_class_t cls, const char *fil pb++; break; case SHT_REL: - if ((shdr[shdr[i].sh_info].sh_flags & SHF_ALLOC) == 0) - break; ef->reltab[rl].rel = malloc(shdr[i].sh_size, M_LINKER, M_WAITOK); ef->reltab[rl].nrel = shdr[i].sh_size / sizeof(Elf_Rel); @@ -903,8 +881,6 @@ link_elf_load_file(linker_class_t cls, const char *fil rl++; break; case SHT_RELA: - if ((shdr[shdr[i].sh_info].sh_flags & SHF_ALLOC) == 0) - break; ef->relatab[ra].rela = malloc(shdr[i].sh_size, M_LINKER, M_WAITOK); ef->relatab[ra].nrela = From owner-svn-src-all@freebsd.org Tue Feb 13 04:28:14 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A233AF1E660; Tue, 13 Feb 2018 04:28:14 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4AEE182BE7; Tue, 13 Feb 2018 04:28:14 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2AD1B1BE0D; Tue, 13 Feb 2018 04:28:14 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1D4SELD001617; Tue, 13 Feb 2018 04:28:14 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1D4SDMm001614; Tue, 13 Feb 2018 04:28:13 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201802130428.w1D4SDMm001614@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Tue, 13 Feb 2018 04:28:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r329192 - in stable/11/stand: efi/loader i386/zfsboot powerpc/ofw X-SVN-Group: stable-11 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in stable/11/stand: efi/loader i386/zfsboot powerpc/ofw X-SVN-Commit-Revision: 329192 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Feb 2018 04:28:15 -0000 Author: kevans Date: Tue Feb 13 04:28:13 2018 New Revision: 329192 URL: https://svnweb.freebsd.org/changeset/base/329192 Log: stand: Clean up some unintentional inconsistencies This is a direct commit to stable/11 to address the following final unintended inconsistencies between stable/11 and head: - Some unused LIBSTAND= cruft left in efi/loader/Makefie - A comment that flew in with unrelated changes - An #include that may go away now that stand is basically self-contained Modified: stable/11/stand/efi/loader/Makefile stable/11/stand/i386/zfsboot/zfsldr.S stable/11/stand/powerpc/ofw/ofwfdt.c Modified: stable/11/stand/efi/loader/Makefile ============================================================================== --- stable/11/stand/efi/loader/Makefile Tue Feb 13 04:10:10 2018 (r329191) +++ stable/11/stand/efi/loader/Makefile Tue Feb 13 04:28:13 2018 (r329192) @@ -54,12 +54,6 @@ CFLAGS+= -I${SYSDIR}/contrib/dev/acpica/include CFLAGS+= -I${BOOTSRC}/i386/libi386 CFLAGS+= -DNO_PCI -DEFI -# make buildenv doesn't set DESTDIR, this means LIBSTAND -# will be wrong when crossbuilding. -.if exists(${.OBJDIR}/../../../../lib/libstand/libstand.a) -LIBSTAND= ${.OBJDIR}/../../../../lib/libstand/libstand.a -.endif - .if !defined(BOOT_HIDE_SERIAL_NUMBERS) # Export serial numbers, UUID, and asset tag from loader. CFLAGS+= -DSMBIOS_SERIAL_NUMBERS Modified: stable/11/stand/i386/zfsboot/zfsldr.S ============================================================================== --- stable/11/stand/i386/zfsboot/zfsldr.S Tue Feb 13 04:10:10 2018 (r329191) +++ stable/11/stand/i386/zfsboot/zfsldr.S Tue Feb 13 04:28:13 2018 (r329192) @@ -33,7 +33,7 @@ .set SIZ_PAG,0x1000 # Page size .set SIZ_SEC,0x200 # Sector size .set COPY_BLKS,0x8 # Number of blocks - # to copy for boot2 + # to copy for boot2 (<= 15) .set COPY_BLK_SZ,0x8000 # Copy in 32k blocks; must be # a multiple of 16 bytes .set NSECT,(COPY_BLK_SZ / SIZ_SEC * COPY_BLKS) Modified: stable/11/stand/powerpc/ofw/ofwfdt.c ============================================================================== --- stable/11/stand/powerpc/ofw/ofwfdt.c Tue Feb 13 04:10:10 2018 (r329191) +++ stable/11/stand/powerpc/ofw/ofwfdt.c Tue Feb 13 04:28:13 2018 (r329192) @@ -26,11 +26,6 @@ #include __FBSDID("$FreeBSD$"); -/* - * Include stdlib.h because of DEBUG_MALLOC shenanigans in stand.h for now. - * This will be removed in the future, when libsa silently replaces stdlib.h. - */ -#include #include #include #include From owner-svn-src-all@freebsd.org Tue Feb 13 06:36:28 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6375EF027A5; Tue, 13 Feb 2018 06:36:28 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0EA8D87079; Tue, 13 Feb 2018 06:36:28 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 05EAC1D31E; Tue, 13 Feb 2018 06:36:28 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1D6aR1p065798; Tue, 13 Feb 2018 06:36:27 GMT (envelope-from araujo@FreeBSD.org) Received: (from araujo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1D6aRZO065797; Tue, 13 Feb 2018 06:36:27 GMT (envelope-from araujo@FreeBSD.org) Message-Id: <201802130636.w1D6aRZO065797@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: araujo set sender to araujo@FreeBSD.org using -f From: Marcelo Araujo Date: Tue, 13 Feb 2018 06:36:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329193 - head X-SVN-Group: head X-SVN-Commit-Author: araujo X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 329193 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Feb 2018 06:36:28 -0000 Author: araujo Date: Tue Feb 13 06:36:27 2018 New Revision: 329193 URL: https://svnweb.freebsd.org/changeset/base/329193 Log: - I'm not using nis(8) and ypldap(8) anymore, so I'm removing myself from MAINTAINERS list. Modified: head/MAINTAINERS Modified: head/MAINTAINERS ============================================================================== --- head/MAINTAINERS Tue Feb 13 04:28:13 2018 (r329192) +++ head/MAINTAINERS Tue Feb 13 06:36:27 2018 (r329193) @@ -65,7 +65,6 @@ lpr gad Pre-commit review requested, particularly for nanobsd imp Pre-commit phabricator review requested. net80211 adrian Pre-commit review requested, send to freebsd-wireless@freebsd.org nfs freebsd-fs@FreeBSD.org, rmacklem is best for reviews. -nis(8), yp(8) araujo Pre-commit review requested. nvd(4) jimharris Pre-commit review requested. nvme(4) jimharris Pre-commit review requested. nvmecontrol(8) jimharris Pre-commit review requested. From owner-svn-src-all@freebsd.org Tue Feb 13 08:10:17 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AAA5BF081A5; Tue, 13 Feb 2018 08:10:17 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 60E096A384; Tue, 13 Feb 2018 08:10:17 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5BD341E1A9; Tue, 13 Feb 2018 08:10:17 +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 w1D8AHPA010074; Tue, 13 Feb 2018 08:10:17 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1D8AHqW010073; Tue, 13 Feb 2018 08:10:17 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201802130810.w1D8AHqW010073@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Tue, 13 Feb 2018 08:10:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329194 - head/etc/devd X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/etc/devd X-SVN-Commit-Revision: 329194 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Feb 2018 08:10:17 -0000 Author: hselasky Date: Tue Feb 13 08:10:17 2018 New Revision: 329194 URL: https://svnweb.freebsd.org/changeset/base/329194 Log: Add missing semicolon to not break devd during system startup. Modified: head/etc/devd/devmatch.conf Modified: head/etc/devd/devmatch.conf ============================================================================== --- head/etc/devd/devmatch.conf Tue Feb 13 06:36:27 2018 (r329193) +++ head/etc/devd/devmatch.conf Tue Feb 13 08:10:17 2018 (r329194) @@ -9,12 +9,12 @@ # # Generic NOMATCH event nomatch 100 { - action "service devmatch start" + action "service devmatch start"; }; # Add the following to devd.conf to prevent this from running: # nomatch 1000 { -# action "true" +# action "true"; # }; # it replaces the generic event with one of higher priority that # does nothing. You can also set 'devmatch_enable=NO' in /etc/rc.conf From owner-svn-src-all@freebsd.org Tue Feb 13 08:13:21 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 54C5DF08838; Tue, 13 Feb 2018 08:13:21 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 069356AA31; Tue, 13 Feb 2018 08:13:21 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 018271E343; Tue, 13 Feb 2018 08:13:21 +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 w1D8DKKm015010; Tue, 13 Feb 2018 08:13:20 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1D8DKMB015007; Tue, 13 Feb 2018 08:13:20 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201802130813.w1D8DKMB015007@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Tue, 13 Feb 2018 08:13:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329195 - in head/sys/dev/usb: . quirk X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in head/sys/dev/usb: . quirk X-SVN-Commit-Revision: 329195 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Feb 2018 08:13:21 -0000 Author: hselasky Date: Tue Feb 13 08:13:20 2018 New Revision: 329195 URL: https://svnweb.freebsd.org/changeset/base/329195 Log: Add new USB quirk. PR: 225844 MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/dev/usb/quirk/usb_quirk.c head/sys/dev/usb/usbdevs Modified: head/sys/dev/usb/quirk/usb_quirk.c ============================================================================== --- head/sys/dev/usb/quirk/usb_quirk.c Tue Feb 13 08:10:17 2018 (r329194) +++ head/sys/dev/usb/quirk/usb_quirk.c Tue Feb 13 08:13:20 2018 (r329195) @@ -137,6 +137,8 @@ static struct usb_quirk_entry usb_quirks[USB_DEV_QUIRK USB_QUIRK(CORSAIR, K60, 0x0000, 0xffff, UQ_KBD_BOOTPROTO), /* Quirk for Corsair Vengeance K70 keyboard */ USB_QUIRK(CORSAIR, K70, 0x0000, 0xffff, UQ_KBD_BOOTPROTO), + /* Quirk for Corsair K70 RGB keyboard */ + USB_QUIRK(CORSAIR, K70_RGB, 0x0000, 0xffff, UQ_KBD_BOOTPROTO), /* Quirk for Corsair STRAFE Gaming keyboard */ USB_QUIRK(CORSAIR, STRAFE, 0x0000, 0xffff, UQ_KBD_BOOTPROTO), /* umodem(4) device quirks */ Modified: head/sys/dev/usb/usbdevs ============================================================================== --- head/sys/dev/usb/usbdevs Tue Feb 13 08:10:17 2018 (r329194) +++ head/sys/dev/usb/usbdevs Tue Feb 13 08:13:20 2018 (r329195) @@ -1532,6 +1532,7 @@ product COREGA FETHER_USB_TXC 0x9601 FEther USB-TXC /* Corsair products */ product CORSAIR K60 0x0a60 Corsair Vengeance K60 keyboard product CORSAIR K70 0x1b09 Corsair Vengeance K70 keyboard +product CORSAIR K70_RGB 0x1b13 Corsair K70 RGB Keyboard product CORSAIR STRAFE 0x1b15 Cossair STRAFE Gaming keyboard /* Creative products */ From owner-svn-src-all@freebsd.org Tue Feb 13 08:17:20 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0C4B1F09031; Tue, 13 Feb 2018 08:17:20 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B24C36AE4C; Tue, 13 Feb 2018 08:17:19 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 933461E34B; Tue, 13 Feb 2018 08:17:19 +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 w1D8HJqE015195; Tue, 13 Feb 2018 08:17:19 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1D8HJ45015194; Tue, 13 Feb 2018 08:17:19 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201802130817.w1D8HJ45015194@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Tue, 13 Feb 2018 08:17:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329196 - head/usr.sbin/devmatch X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/usr.sbin/devmatch X-SVN-Commit-Revision: 329196 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Feb 2018 08:17:20 -0000 Author: hselasky Date: Tue Feb 13 08:17:19 2018 New Revision: 329196 URL: https://svnweb.freebsd.org/changeset/base/329196 Log: Remove leftover empty directory. Deleted: head/usr.sbin/devmatch/ From owner-svn-src-all@freebsd.org Tue Feb 13 09:07:24 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0B95CF0CD34; Tue, 13 Feb 2018 09:07:24 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (turbocat.net [88.99.82.50]) (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 A1B786CC61; Tue, 13 Feb 2018 09:07:23 +0000 (UTC) (envelope-from hps@selasky.org) Received: from hps2016.home.selasky.org (unknown [62.141.128.70]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 0349F2600EC; Tue, 13 Feb 2018 10:07:15 +0100 (CET) Subject: Re: svn commit: r329148 - head/etc/devd To: Renato Botelho , Warner Losh , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201802120445.w1C4jQBL081885@repo.freebsd.org> <1f2b78cb-c27b-6b3b-0ee7-130de756bbb7@gmail.com> From: Hans Petter Selasky Message-ID: Date: Tue, 13 Feb 2018 10:04:21 +0100 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2 MIME-Version: 1.0 In-Reply-To: <1f2b78cb-c27b-6b3b-0ee7-130de756bbb7@gmail.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Feb 2018 09:07:24 -0000 On 02/12/18 20:13, Renato Botelho wrote: > On 12/02/18 02:45, Warner Losh wrote: >> Author: imp >> Date: Mon Feb 12 04:45:26 2018 >> New Revision: 329148 >> URL: https://svnweb.freebsd.org/changeset/base/329148 >> >> Log: >> Switch to using devmatch to autoload drivers. Remove usb.conf >> as obsolete because devmatch gets its information from the same >> place as the genration scripts. >> >> Added: >> head/etc/devd/devmatch.conf (contents, props changed) >> Deleted: >> head/etc/devd/usb.conf >> >> Added: head/etc/devd/devmatch.conf >> ============================================================================== >> --- /dev/null 00:00:00 1970 (empty, because file is newly added) >> +++ head/etc/devd/devmatch.conf Mon Feb 12 04:45:26 2018 (r329148) >> @@ -0,0 +1,13 @@ >> +# >> +# $FreeBSD$ >> +# >> + >> +# >> +# Example devd configuration file for automatically >> +# loading what modules we can based on nomatch >> +# events. >> +# >> +# Generic NOMATCH event >> +nomatch 100 { >> + action "service devmatch onestart" > > Config syntax is broken. It's missing ; in the end of above line > I've just fixed this in r329194. BTW: I see another annoying issue. Devmatch, when it receives a NOMATCH event, should limit the searching to the current system. I.E. when you plug a USB device, devmatch should not search PCI drivers aswell. Warner, can you add this support? --HPS From owner-svn-src-all@freebsd.org Tue Feb 13 10:11:40 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E7FA4F12255; Tue, 13 Feb 2018 10:11:39 +0000 (UTC) (envelope-from n_hibma@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9DD6E6FF17; Tue, 13 Feb 2018 10:11:39 +0000 (UTC) (envelope-from n_hibma@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9877D1F69C; Tue, 13 Feb 2018 10:11:39 +0000 (UTC) (envelope-from n_hibma@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1DABdKp071402; Tue, 13 Feb 2018 10:11:39 GMT (envelope-from n_hibma@FreeBSD.org) Received: (from n_hibma@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1DABd1S071401; Tue, 13 Feb 2018 10:11:39 GMT (envelope-from n_hibma@FreeBSD.org) Message-Id: <201802131011.w1DABd1S071401@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: n_hibma set sender to n_hibma@FreeBSD.org using -f From: Nick Hibma Date: Tue, 13 Feb 2018 10:11:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329197 - head/sbin/ipfw X-SVN-Group: head X-SVN-Commit-Author: n_hibma X-SVN-Commit-Paths: head/sbin/ipfw X-SVN-Commit-Revision: 329197 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Feb 2018 10:11:40 -0000 Author: n_hibma Date: Tue Feb 13 10:11:39 2018 New Revision: 329197 URL: https://svnweb.freebsd.org/changeset/base/329197 Log: DSCP values passed to setdscp need to be lowercase. See definition of f_ipdscp values. They are compared against using bcmp which is case sensitive. MFC after: 1 week Modified: head/sbin/ipfw/ipfw.8 Modified: head/sbin/ipfw/ipfw.8 ============================================================================== --- head/sbin/ipfw/ipfw.8 Tue Feb 13 08:17:19 2018 (r329196) +++ head/sbin/ipfw/ipfw.8 Tue Feb 13 10:11:39 2018 (r329197) @@ -1070,49 +1070,49 @@ Set specified DiffServ codepoint for an IPv4/IPv6 pack Processing continues at the next rule. Supported values are: .Pp -.Cm CS0 +.Cm cs0 .Pq Dv 000000 , -.Cm CS1 +.Cm cs1 .Pq Dv 001000 , -.Cm CS2 +.Cm cs2 .Pq Dv 010000 , -.Cm CS3 +.Cm cs3 .Pq Dv 011000 , -.Cm CS4 +.Cm cs4 .Pq Dv 100000 , -.Cm CS5 +.Cm cs5 .Pq Dv 101000 , -.Cm CS6 +.Cm cs6 .Pq Dv 110000 , -.Cm CS7 +.Cm cs7 .Pq Dv 111000 , -.Cm AF11 +.Cm af11 .Pq Dv 001010 , -.Cm AF12 +.Cm af12 .Pq Dv 001100 , -.Cm AF13 +.Cm af13 .Pq Dv 001110 , -.Cm AF21 +.Cm af21 .Pq Dv 010010 , -.Cm AF22 +.Cm af22 .Pq Dv 010100 , -.Cm AF23 +.Cm af23 .Pq Dv 010110 , -.Cm AF31 +.Cm af31 .Pq Dv 011010 , -.Cm AF32 +.Cm af32 .Pq Dv 011100 , -.Cm AF33 +.Cm af33 .Pq Dv 011110 , -.Cm AF41 +.Cm af41 .Pq Dv 100010 , -.Cm AF42 +.Cm af42 .Pq Dv 100100 , -.Cm AF43 +.Cm af43 .Pq Dv 100110 , -.Cm EF +.Cm ef .Pq Dv 101110 , -.Cm BE +.Cm be .Pq Dv 000000 . Additionally, DSCP value can be specified by number (0..64). It is also possible to use the From owner-svn-src-all@freebsd.org Tue Feb 13 11:43:58 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7A95EF1985E; Tue, 13 Feb 2018 11:43:58 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2DB8673610; Tue, 13 Feb 2018 11:43:58 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2853F2055E; Tue, 13 Feb 2018 11:43:58 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1DBhwrM019112; Tue, 13 Feb 2018 11:43:58 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1DBhwXt019111; Tue, 13 Feb 2018 11:43:58 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201802131143.w1DBhwXt019111@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Tue, 13 Feb 2018 11:43:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329198 - head/sys/dev/usb X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/dev/usb X-SVN-Commit-Revision: 329198 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Feb 2018 11:43:58 -0000 Author: hselasky Date: Tue Feb 13 11:43:57 2018 New Revision: 329198 URL: https://svnweb.freebsd.org/changeset/base/329198 Log: Fix for incorrect PnP information used by devmatch(8). MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/dev/usb/usbdi.h Modified: head/sys/dev/usb/usbdi.h ============================================================================== --- head/sys/dev/usb/usbdi.h Tue Feb 13 10:11:39 2018 (r329197) +++ head/sys/dev/usb/usbdi.h Tue Feb 13 11:43:57 2018 (r329198) @@ -336,7 +336,7 @@ struct usb_device_id { unsigned long driver_info; } __aligned(32); -#define USB_STD_PNP_INFO "M16:mask;U16:vendor;U16:product;L16:product;G16:product;" \ +#define USB_STD_PNP_INFO "M16:mask;U16:vendor;U16:product;L16:release;G16:release;" \ "U8:devclass;U8:devsubclass;U8:devprotocol;" \ "U8:intclass;U8:intsubclass;U8:intprotocol;" #define USB_STD_PNP_HOST_INFO USB_STD_PNP_INFO "T:mode=host;" From owner-svn-src-all@freebsd.org Tue Feb 13 12:54:04 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D7B49F1FF00; Tue, 13 Feb 2018 12:54:03 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 88DB576F71; Tue, 13 Feb 2018 12:54:03 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 83BEE2109F; Tue, 13 Feb 2018 12:54:03 +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 w1DCs3mB054360; Tue, 13 Feb 2018 12:54:03 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1DCs3ca054357; Tue, 13 Feb 2018 12:54:03 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201802131254.w1DCs3ca054357@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 13 Feb 2018 12:54:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r329199 - in stable/11/sys: conf i386/i386 X-SVN-Group: stable-11 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in stable/11/sys: conf i386/i386 X-SVN-Commit-Revision: 329199 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Feb 2018 12:54:04 -0000 Author: kib Date: Tue Feb 13 12:54:03 2018 New Revision: 329199 URL: https://svnweb.freebsd.org/changeset/base/329199 Log: MFC r328913: Move signal trampolines out of locore.s into separate source file. Added: stable/11/sys/i386/i386/sigtramp.s - copied unchanged from r328913, head/sys/i386/i386/sigtramp.s Modified: stable/11/sys/conf/files.i386 stable/11/sys/i386/i386/locore.s Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/conf/files.i386 ============================================================================== --- stable/11/sys/conf/files.i386 Tue Feb 13 11:43:57 2018 (r329198) +++ stable/11/sys/conf/files.i386 Tue Feb 13 12:54:03 2018 (r329199) @@ -504,6 +504,7 @@ i386/i386/mpboot.s optional smp i386/i386/perfmon.c optional perfmon i386/i386/pmap.c standard i386/i386/ptrace_machdep.c standard +i386/i386/sigtramp.s standard i386/i386/support.s standard i386/i386/swtch.s standard i386/i386/sys_machdep.c standard Modified: stable/11/sys/i386/i386/locore.s ============================================================================== --- stable/11/sys/i386/i386/locore.s Tue Feb 13 11:43:57 2018 (r329198) +++ stable/11/sys/i386/i386/locore.s Tue Feb 13 12:54:03 2018 (r329199) @@ -44,7 +44,6 @@ #include "opt_nfsroot.h" #include "opt_pmap.h" -#include #include #include @@ -327,77 +326,6 @@ begin: call mi_startup /* autoconfiguration, mountroot etc */ /* NOTREACHED */ addl $0,%esp /* for db_numargs() again */ - -/* - * Signal trampoline, copied to top of user stack - */ -NON_GPROF_ENTRY(sigcode) - calll *SIGF_HANDLER(%esp) - leal SIGF_UC(%esp),%eax /* get ucontext */ - pushl %eax - testl $PSL_VM,UC_EFLAGS(%eax) - jne 1f - mov UC_GS(%eax),%gs /* restore %gs */ -1: - movl $SYS_sigreturn,%eax - pushl %eax /* junk to fake return addr. */ - int $0x80 /* enter kernel with args */ - /* on stack */ -1: - jmp 1b - -#ifdef COMPAT_FREEBSD4 - ALIGN_TEXT -freebsd4_sigcode: - calll *SIGF_HANDLER(%esp) - leal SIGF_UC4(%esp),%eax /* get ucontext */ - pushl %eax - testl $PSL_VM,UC4_EFLAGS(%eax) - jne 1f - mov UC4_GS(%eax),%gs /* restore %gs */ -1: - movl $344,%eax /* 4.x SYS_sigreturn */ - pushl %eax /* junk to fake return addr. */ - int $0x80 /* enter kernel with args */ - /* on stack */ -1: - jmp 1b -#endif - -#ifdef COMPAT_43 - ALIGN_TEXT -osigcode: - call *SIGF_HANDLER(%esp) /* call signal handler */ - lea SIGF_SC(%esp),%eax /* get sigcontext */ - pushl %eax - testl $PSL_VM,SC_PS(%eax) - jne 9f - mov SC_GS(%eax),%gs /* restore %gs */ -9: - movl $103,%eax /* 3.x SYS_sigreturn */ - pushl %eax /* junk to fake return addr. */ - int $0x80 /* enter kernel with args */ -0: jmp 0b -#endif /* COMPAT_43 */ - - ALIGN_TEXT -esigcode: - - .data - .globl szsigcode -szsigcode: - .long esigcode-sigcode -#ifdef COMPAT_FREEBSD4 - .globl szfreebsd4_sigcode -szfreebsd4_sigcode: - .long esigcode-freebsd4_sigcode -#endif -#ifdef COMPAT_43 - .globl szosigcode -szosigcode: - .long esigcode-osigcode -#endif - .text /********************************************************************** * Copied: stable/11/sys/i386/i386/sigtramp.s (from r328913, head/sys/i386/i386/sigtramp.s) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/sys/i386/i386/sigtramp.s Tue Feb 13 12:54:03 2018 (r329199, copy of r328913, head/sys/i386/i386/sigtramp.s) @@ -0,0 +1,118 @@ +/*- + * Copyright (c) 1990 The Regents of the University of California. + * All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * William Jolitz. + * + * 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 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. + * + * from: @(#)locore.s 7.3 (Berkeley) 5/13/91 + * $FreeBSD$ + * + * originally from: locore.s, by William F. Jolitz + * + * Substantially rewritten by David Greenman, Rod Grimes, + * Bruce Evans, Wolfgang Solfrank, Poul-Henning Kamp + * and many others. + */ + +#include "opt_compat.h" + +#include +#include +#include + +#include "assym.s" + +/* + * Signal trampoline, copied to top of user stack + */ +NON_GPROF_ENTRY(sigcode) + calll *SIGF_HANDLER(%esp) + leal SIGF_UC(%esp),%eax /* get ucontext */ + pushl %eax + testl $PSL_VM,UC_EFLAGS(%eax) + jne 1f + mov UC_GS(%eax),%gs /* restore %gs */ +1: + movl $SYS_sigreturn,%eax + pushl %eax /* junk to fake return addr. */ + int $0x80 /* enter kernel with args */ + /* on stack */ +1: + jmp 1b + +#ifdef COMPAT_FREEBSD4 + ALIGN_TEXT +freebsd4_sigcode: + calll *SIGF_HANDLER(%esp) + leal SIGF_UC4(%esp),%eax /* get ucontext */ + pushl %eax + testl $PSL_VM,UC4_EFLAGS(%eax) + jne 1f + mov UC4_GS(%eax),%gs /* restore %gs */ +1: + movl $344,%eax /* 4.x SYS_sigreturn */ + pushl %eax /* junk to fake return addr. */ + int $0x80 /* enter kernel with args */ + /* on stack */ +1: + jmp 1b +#endif + +#ifdef COMPAT_43 + ALIGN_TEXT +osigcode: + call *SIGF_HANDLER(%esp) /* call signal handler */ + lea SIGF_SC(%esp),%eax /* get sigcontext */ + pushl %eax + testl $PSL_VM,SC_PS(%eax) + jne 9f + mov SC_GS(%eax),%gs /* restore %gs */ +9: + movl $103,%eax /* 3.x SYS_sigreturn */ + pushl %eax /* junk to fake return addr. */ + int $0x80 /* enter kernel with args */ +0: jmp 0b +#endif /* COMPAT_43 */ + + ALIGN_TEXT +esigcode: + + .data + .globl szsigcode +szsigcode: + .long esigcode-sigcode +#ifdef COMPAT_FREEBSD4 + .globl szfreebsd4_sigcode +szfreebsd4_sigcode: + .long esigcode-freebsd4_sigcode +#endif +#ifdef COMPAT_43 + .globl szosigcode +szosigcode: + .long esigcode-osigcode +#endif From owner-svn-src-all@freebsd.org Tue Feb 13 14:37:23 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5FBB1F052DB; Tue, 13 Feb 2018 14:37:23 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 095EC7B5BF; Tue, 13 Feb 2018 14:37:23 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EF1C0220CB; Tue, 13 Feb 2018 14:37:22 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1DEbMLw004437; Tue, 13 Feb 2018 14:37:22 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1DEbM64004427; Tue, 13 Feb 2018 14:37:22 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201802131437.w1DEbM64004427@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Tue, 13 Feb 2018 14:37:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r329200 - in stable/11/sys: conf dev/mlx5 dev/mlx5/mlx5_core dev/mlx5/mlx5_en modules/mlx5 X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in stable/11/sys: conf dev/mlx5 dev/mlx5/mlx5_core dev/mlx5/mlx5_en modules/mlx5 X-SVN-Commit-Revision: 329200 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Feb 2018 14:37:23 -0000 Author: hselasky Date: Tue Feb 13 14:37:21 2018 New Revision: 329200 URL: https://svnweb.freebsd.org/changeset/base/329200 Log: MFC r325638 and r325976: Refactor the flowsteering APIs used by mlx5en(4). This change is needed by the coming ibcore and mlx5ib updates in order to support traffic redirection to so-called raw ethernet QPs. Remove unused E-switch related routines and files while at it. Sponsored by: Mellanox Technologies Added: stable/11/sys/dev/mlx5/fs.h - copied unchanged from r325638, head/sys/dev/mlx5/fs.h stable/11/sys/dev/mlx5/mlx5_core/fs_core.h - copied unchanged from r325638, head/sys/dev/mlx5/mlx5_core/fs_core.h stable/11/sys/dev/mlx5/mlx5_core/mlx5_fs_cmd.c - copied unchanged from r325638, head/sys/dev/mlx5/mlx5_core/mlx5_fs_cmd.c stable/11/sys/dev/mlx5/mlx5_core/mlx5_fs_tree.c - copied, changed from r325638, head/sys/dev/mlx5/mlx5_core/mlx5_fs_tree.c Deleted: stable/11/sys/dev/mlx5/eswitch_vacl.h stable/11/sys/dev/mlx5/flow_table.h stable/11/sys/dev/mlx5/mlx5_core/mlx5_eswitch_vacl.c stable/11/sys/dev/mlx5/mlx5_core/mlx5_flow_table.c Modified: stable/11/sys/conf/files stable/11/sys/dev/mlx5/device.h stable/11/sys/dev/mlx5/driver.h stable/11/sys/dev/mlx5/mlx5_core/mlx5_main.c stable/11/sys/dev/mlx5/mlx5_en/en.h stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_flow_table.c stable/11/sys/dev/mlx5/mlx5_ifc.h stable/11/sys/modules/mlx5/Makefile Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/conf/files ============================================================================== --- stable/11/sys/conf/files Tue Feb 13 12:54:03 2018 (r329199) +++ stable/11/sys/conf/files Tue Feb 13 14:37:21 2018 (r329200) @@ -4402,7 +4402,9 @@ dev/mlx5/mlx5_core/mlx5_diagnostics.c optional mlx5 p compile-with "${OFED_C}" dev/mlx5/mlx5_core/mlx5_eq.c optional mlx5 pci \ compile-with "${OFED_C}" -dev/mlx5/mlx5_core/mlx5_flow_table.c optional mlx5 pci \ +dev/mlx5/mlx5_core/mlx5_fs_cmd.c optional mlx5 pci \ + compile-with "${OFED_C}" +dev/mlx5/mlx5_core/mlx5_fs_tree.c optional mlx5 pci \ compile-with "${OFED_C}" dev/mlx5/mlx5_core/mlx5_fw.c optional mlx5 pci \ compile-with "${OFED_C}" Modified: stable/11/sys/dev/mlx5/device.h ============================================================================== --- stable/11/sys/dev/mlx5/device.h Tue Feb 13 12:54:03 2018 (r329199) +++ stable/11/sys/dev/mlx5/device.h Tue Feb 13 14:37:21 2018 (r329200) @@ -1085,6 +1085,7 @@ enum { MLX5_FLOW_TABLE_TYPE_ESWITCH = 4, MLX5_FLOW_TABLE_TYPE_SNIFFER_RX = 5, MLX5_FLOW_TABLE_TYPE_SNIFFER_TX = 6, + MLX5_FLOW_TABLE_TYPE_NIC_RX_RDMA = 7, }; enum { Modified: stable/11/sys/dev/mlx5/driver.h ============================================================================== --- stable/11/sys/dev/mlx5/driver.h Tue Feb 13 12:54:03 2018 (r329199) +++ stable/11/sys/dev/mlx5/driver.h Tue Feb 13 14:37:21 2018 (r329200) @@ -582,6 +582,7 @@ struct mlx5_special_contexts { int resd_lkey; }; +struct mlx5_flow_root_namespace; struct mlx5_core_dev { struct pci_dev *pdev; char board_id[MLX5_BOARD_ID_LEN]; @@ -600,6 +601,12 @@ struct mlx5_core_dev { u32 issi; struct mlx5_special_contexts special_contexts; unsigned int module_status[MLX5_MAX_PORTS]; + struct mlx5_flow_root_namespace *root_ns; + struct mlx5_flow_root_namespace *fdb_root_ns; + struct mlx5_flow_root_namespace *esw_egress_root_ns; + struct mlx5_flow_root_namespace *esw_ingress_root_ns; + struct mlx5_flow_root_namespace *sniffer_rx_root_ns; + struct mlx5_flow_root_namespace *sniffer_tx_root_ns; u32 num_q_counter_allocated[MLX5_INTERFACE_NUMBER]; }; Copied: stable/11/sys/dev/mlx5/fs.h (from r325638, head/sys/dev/mlx5/fs.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/sys/dev/mlx5/fs.h Tue Feb 13 14:37:21 2018 (r329200, copy of r325638, head/sys/dev/mlx5/fs.h) @@ -0,0 +1,232 @@ +/*- + * Copyright (c) 2013-2017, Mellanox Technologies, Ltd. 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 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 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 _MLX5_FS_ +#define _MLX5_FS_ + +#include + +#include +#include +#include + +enum { + MLX5_FLOW_CONTEXT_ACTION_FWD_NEXT_PRIO = 1 << 16, +}; + +/*Flow tag*/ +enum { + MLX5_FS_DEFAULT_FLOW_TAG = 0xFFFFFF, + MLX5_FS_ETH_FLOW_TAG = 0xFFFFFE, + MLX5_FS_SNIFFER_FLOW_TAG = 0xFFFFFD, +}; + +enum { + MLX5_FS_FLOW_TAG_MASK = 0xFFFFFF, +}; + +#define FS_MAX_TYPES 10 +#define FS_MAX_ENTRIES 32000U + +enum mlx5_flow_namespace_type { + MLX5_FLOW_NAMESPACE_BYPASS, + MLX5_FLOW_NAMESPACE_KERNEL, + MLX5_FLOW_NAMESPACE_LEFTOVERS, + MLX5_FLOW_NAMESPACE_SNIFFER_RX, + MLX5_FLOW_NAMESPACE_SNIFFER_TX, + MLX5_FLOW_NAMESPACE_FDB, + MLX5_FLOW_NAMESPACE_ESW_EGRESS, + MLX5_FLOW_NAMESPACE_ESW_INGRESS, +}; + +struct mlx5_flow_table; +struct mlx5_flow_group; +struct mlx5_flow_rule; +struct mlx5_flow_namespace; + +struct mlx5_flow_spec { + u8 match_criteria_enable; + u32 match_criteria[MLX5_ST_SZ_DW(fte_match_param)]; + u32 match_value[MLX5_ST_SZ_DW(fte_match_param)]; +}; + +struct mlx5_flow_destination { + u32 type; + union { + u32 tir_num; + struct mlx5_flow_table *ft; + u32 vport_num; + }; +}; + +#define FT_NAME_STR_SZ 20 +#define LEFTOVERS_RULE_NUM 2 +static inline void build_leftovers_ft_param(char *name, + unsigned int *priority, + int *n_ent, + int *n_grp) +{ + snprintf(name, FT_NAME_STR_SZ, "leftovers"); + *priority = 0; /*Priority of leftovers_prio-0*/ + *n_ent = LEFTOVERS_RULE_NUM + 1; /*1: star rules*/ + *n_grp = LEFTOVERS_RULE_NUM; +} + +static inline bool outer_header_zero(u32 *match_criteria) +{ + int size = MLX5_ST_SZ_BYTES(fte_match_param); + char *outer_headers_c = MLX5_ADDR_OF(fte_match_param, match_criteria, + outer_headers); + + return outer_headers_c[0] == 0 && !memcmp(outer_headers_c, + outer_headers_c + 1, + size - 1); +} + +struct mlx5_flow_namespace * +mlx5_get_flow_namespace(struct mlx5_core_dev *dev, + enum mlx5_flow_namespace_type type); + +/* The underlying implementation create two more entries for + * chaining flow tables. the user should be aware that if he pass + * max_num_ftes as 2^N it will result in doubled size flow table + */ +struct mlx5_flow_table * +mlx5_create_auto_grouped_flow_table(struct mlx5_flow_namespace *ns, + int prio, + const char *name, + int num_flow_table_entries, + int max_num_groups); + +struct mlx5_flow_table * +mlx5_create_vport_flow_table(struct mlx5_flow_namespace *ns, + u16 vport, + int prio, + const char *name, + int num_flow_table_entries); + +struct mlx5_flow_table * +mlx5_create_flow_table(struct mlx5_flow_namespace *ns, + int prio, + const char *name, + int num_flow_table_entries); +int mlx5_destroy_flow_table(struct mlx5_flow_table *ft); + +/* inbox should be set with the following values: + * start_flow_index + * end_flow_index + * match_criteria_enable + * match_criteria + */ +struct mlx5_flow_group * +mlx5_create_flow_group(struct mlx5_flow_table *ft, u32 *in); +void mlx5_destroy_flow_group(struct mlx5_flow_group *fg); + +/* Single destination per rule. + * Group ID is implied by the match criteria. + */ +struct mlx5_flow_rule * +mlx5_add_flow_rule(struct mlx5_flow_table *ft, + u8 match_criteria_enable, + u32 *match_criteria, + u32 *match_value, + u32 action, + u32 flow_tag, + struct mlx5_flow_destination *dest); +void mlx5_del_flow_rule(struct mlx5_flow_rule *fr); + +/*The following API is for sniffer*/ +typedef int (*rule_event_fn)(struct mlx5_flow_rule *rule, + bool ctx_changed, + void *client_data, + void *context); + +struct mlx5_flow_handler; + +struct flow_client_priv_data; + +void mlx5e_sniffer_roce_mode_notify( + struct mlx5_core_dev *mdev, + int action); + +int mlx5_set_rule_private_data(struct mlx5_flow_rule *rule, struct + mlx5_flow_handler *handler, void + *client_data); + +struct mlx5_flow_handler *mlx5_register_rule_notifier(struct mlx5_core_dev *dev, + enum mlx5_flow_namespace_type ns_type, + rule_event_fn add_cb, + rule_event_fn del_cb, + void *context); + +void mlx5_unregister_rule_notifier(struct mlx5_flow_handler *handler); + +void mlx5_flow_iterate_existing_rules(struct mlx5_flow_namespace *ns, + rule_event_fn cb, + void *context); + +void mlx5_get_match_criteria(u32 *match_criteria, + struct mlx5_flow_rule *rule); + +void mlx5_get_match_value(u32 *match_value, + struct mlx5_flow_rule *rule); + +u8 mlx5_get_match_criteria_enable(struct mlx5_flow_rule *rule); + +struct mlx5_flow_rules_list *get_roce_flow_rules(u8 roce_mode); + +void mlx5_del_flow_rules_list(struct mlx5_flow_rules_list *rules_list); + +struct mlx5_flow_rules_list { + struct list_head head; +}; + +struct mlx5_flow_rule_node { + struct list_head list; + u32 match_criteria[MLX5_ST_SZ_DW(fte_match_param)]; + u32 match_value[MLX5_ST_SZ_DW(fte_match_param)]; + u8 match_criteria_enable; +}; + +struct mlx5_core_fs_mask { + u8 match_criteria_enable; + u32 match_criteria[MLX5_ST_SZ_DW(fte_match_param)]; +}; + +bool fs_match_exact_val( + struct mlx5_core_fs_mask *mask, + void *val1, + void *val2); + +bool fs_match_exact_mask( + u8 match_criteria_enable1, + u8 match_criteria_enable2, + void *mask1, + void *mask2); +/**********end API for sniffer**********/ + +#endif Copied: stable/11/sys/dev/mlx5/mlx5_core/fs_core.h (from r325638, head/sys/dev/mlx5/mlx5_core/fs_core.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/sys/dev/mlx5/mlx5_core/fs_core.h Tue Feb 13 14:37:21 2018 (r329200, copy of r325638, head/sys/dev/mlx5/mlx5_core/fs_core.h) @@ -0,0 +1,300 @@ +/*- + * Copyright (c) 2013-2017, Mellanox Technologies, Ltd. 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 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 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 _MLX5_FS_CORE_ +#define _MLX5_FS_CORE_ + +#include +#include +#include +#include + +enum fs_type { + FS_TYPE_NAMESPACE, + FS_TYPE_PRIO, + FS_TYPE_FLOW_TABLE, + FS_TYPE_FLOW_GROUP, + FS_TYPE_FLOW_ENTRY, + FS_TYPE_FLOW_DEST +}; + +enum fs_ft_type { + FS_FT_NIC_RX = 0x0, + FS_FT_ESW_EGRESS_ACL = 0x2, + FS_FT_ESW_INGRESS_ACL = 0x3, + FS_FT_FDB = 0X4, + FS_FT_SNIFFER_RX = 0x5, + FS_FT_SNIFFER_TX = 0x6 +}; + +enum fs_fte_status { + FS_FTE_STATUS_EXISTING = 1UL << 0, +}; + +/* Should always be the first variable in the struct */ +struct fs_base { + struct list_head list; + struct fs_base *parent; + enum fs_type type; + struct kref refcount; + /* lock the node for writing and traversing */ + struct mutex lock; + struct completion complete; + atomic_t users_refcount; + const char *name; +}; + +struct mlx5_flow_rule { + struct fs_base base; + struct mlx5_flow_destination dest_attr; + struct list_head clients_data; + /*protect clients lits*/ + struct mutex clients_lock; +}; + +struct fs_fte { + struct fs_base base; + u32 val[MLX5_ST_SZ_DW(fte_match_param)]; + uint32_t dests_size; + uint32_t flow_tag; + struct list_head dests; + uint32_t index; /* index in ft */ + u8 action; /* MLX5_FLOW_CONTEXT_ACTION */ + enum fs_fte_status status; +}; + +struct fs_star_rule { + struct mlx5_flow_group *fg; + struct fs_fte *fte; +}; + +struct mlx5_flow_table { + struct fs_base base; + /* sorted list by start_index */ + struct list_head fgs; + struct { + bool active; + unsigned int max_types; + unsigned int num_types; + } autogroup; + unsigned int max_fte; + unsigned int level; + uint32_t id; + u16 vport; + enum fs_ft_type type; + struct fs_star_rule star_rule; + unsigned int shared_refcount; +}; + +enum fs_prio_flags { + MLX5_CORE_FS_PRIO_SHARED = 1 +}; + +struct fs_prio { + struct fs_base base; + struct list_head objs; /* each object is a namespace or ft */ + unsigned int max_ft; + unsigned int num_ft; + unsigned int max_ns; + unsigned int prio; + /*When create shared flow table, this lock should be taken*/ + struct mutex shared_lock; + u8 flags; +}; + +struct mlx5_flow_namespace { + /* parent == NULL => root ns */ + struct fs_base base; + /* sorted by priority number */ + struct list_head prios; /* list of fs_prios */ + struct list_head list_notifiers; + struct rw_semaphore notifiers_rw_sem; + struct rw_semaphore dests_rw_sem; +}; + +struct mlx5_flow_root_namespace { + struct mlx5_flow_namespace ns; + struct mlx5_flow_table *ft_level_0; + enum fs_ft_type table_type; + struct mlx5_core_dev *dev; + struct mlx5_flow_table *root_ft; + /* When chaining flow-tables, this lock should be taken */ + struct mutex fs_chain_lock; +}; + +struct mlx5_flow_group { + struct fs_base base; + struct list_head ftes; + struct mlx5_core_fs_mask mask; + uint32_t start_index; + uint32_t max_ftes; + uint32_t num_ftes; + uint32_t id; +}; + +struct mlx5_flow_handler { + struct list_head list; + rule_event_fn add_dst_cb; + rule_event_fn del_dst_cb; + void *client_context; + struct mlx5_flow_namespace *ns; +}; + +struct fs_client_priv_data { + struct mlx5_flow_handler *fs_handler; + struct list_head list; + void *client_dst_data; +}; + +void _fs_remove_node(struct kref *kref); +#define fs_get_obj(v, _base) {v = container_of((_base), typeof(*v), base); } +#define fs_get_parent(v, child) {v = (child)->base.parent ? \ + container_of((child)->base.parent, \ + typeof(*v), base) : NULL; } + +#define fs_list_for_each_entry(pos, cond, root) \ + list_for_each_entry(pos, root, base.list) \ + if (!(cond)) {} else + +#define fs_list_for_each_entry_continue(pos, cond, root) \ + list_for_each_entry_continue(pos, root, base.list) \ + if (!(cond)) {} else + +#define fs_list_for_each_entry_reverse(pos, cond, root) \ + list_for_each_entry_reverse(pos, root, base.list) \ + if (!(cond)) {} else + +#define fs_list_for_each_entry_continue_reverse(pos, cond, root) \ + list_for_each_entry_continue_reverse(pos, root, base.list) \ + if (!(cond)) {} else + +#define fs_for_each_ft(pos, prio) \ + fs_list_for_each_entry(pos, (pos)->base.type == FS_TYPE_FLOW_TABLE, \ + &(prio)->objs) + +#define fs_for_each_ft_reverse(pos, prio) \ + fs_list_for_each_entry_reverse(pos, \ + (pos)->base.type == FS_TYPE_FLOW_TABLE, \ + &(prio)->objs) + +#define fs_for_each_ns(pos, prio) \ + fs_list_for_each_entry(pos, \ + (pos)->base.type == FS_TYPE_NAMESPACE, \ + &(prio)->objs) + +#define fs_for_each_ns_or_ft_reverse(pos, prio) \ + list_for_each_entry_reverse(pos, &(prio)->objs, list) \ + if (!((pos)->type == FS_TYPE_NAMESPACE || \ + (pos)->type == FS_TYPE_FLOW_TABLE)) {} else + +#define fs_for_each_ns_or_ft(pos, prio) \ + list_for_each_entry(pos, &(prio)->objs, list) \ + if (!((pos)->type == FS_TYPE_NAMESPACE || \ + (pos)->type == FS_TYPE_FLOW_TABLE)) {} else + +#define fs_for_each_ns_or_ft_continue_reverse(pos, prio) \ + list_for_each_entry_continue_reverse(pos, &(prio)->objs, list) \ + if (!((pos)->type == FS_TYPE_NAMESPACE || \ + (pos)->type == FS_TYPE_FLOW_TABLE)) {} else + +#define fs_for_each_ns_or_ft_continue(pos, prio) \ + list_for_each_entry_continue(pos, &(prio)->objs, list) \ + if (!((pos)->type == FS_TYPE_NAMESPACE || \ + (pos)->type == FS_TYPE_FLOW_TABLE)) {} else + +#define fs_for_each_prio(pos, ns) \ + fs_list_for_each_entry(pos, (pos)->base.type == FS_TYPE_PRIO, \ + &(ns)->prios) + +#define fs_for_each_prio_reverse(pos, ns) \ + fs_list_for_each_entry_reverse(pos, (pos)->base.type == FS_TYPE_PRIO, \ + &(ns)->prios) + +#define fs_for_each_prio_continue(pos, ns) \ + fs_list_for_each_entry_continue(pos, (pos)->base.type == FS_TYPE_PRIO, \ + &(ns)->prios) + +#define fs_for_each_prio_continue_reverse(pos, ns) \ + fs_list_for_each_entry_continue_reverse(pos, \ + (pos)->base.type == FS_TYPE_PRIO, \ + &(ns)->prios) + +#define fs_for_each_fg(pos, ft) \ + fs_list_for_each_entry(pos, (pos)->base.type == FS_TYPE_FLOW_GROUP, \ + &(ft)->fgs) + +#define fs_for_each_fte(pos, fg) \ + fs_list_for_each_entry(pos, (pos)->base.type == FS_TYPE_FLOW_ENTRY, \ + &(fg)->ftes) +#define fs_for_each_dst(pos, fte) \ + fs_list_for_each_entry(pos, (pos)->base.type == FS_TYPE_FLOW_DEST, \ + &(fte)->dests) + +int mlx5_cmd_fs_create_ft(struct mlx5_core_dev *dev, + u16 vport, + enum fs_ft_type type, unsigned int level, + unsigned int log_size, unsigned int *table_id); + +int mlx5_cmd_fs_destroy_ft(struct mlx5_core_dev *dev, + u16 vport, + enum fs_ft_type type, unsigned int table_id); + +int mlx5_cmd_fs_create_fg(struct mlx5_core_dev *dev, + u32 *in, + u16 vport, + enum fs_ft_type type, unsigned int table_id, + unsigned int *group_id); + +int mlx5_cmd_fs_destroy_fg(struct mlx5_core_dev *dev, + u16 vport, + enum fs_ft_type type, unsigned int table_id, + unsigned int group_id); + + +int mlx5_cmd_fs_set_fte(struct mlx5_core_dev *dev, + u16 vport, + enum fs_fte_status *fte_status, + u32 *match_val, + enum fs_ft_type type, unsigned int table_id, + unsigned int index, unsigned int group_id, + unsigned int flow_tag, + unsigned short action, int dest_size, + struct list_head *dests); /* mlx5_flow_desination */ + +int mlx5_cmd_fs_delete_fte(struct mlx5_core_dev *dev, + u16 vport, + enum fs_fte_status *fte_status, + enum fs_ft_type type, unsigned int table_id, + unsigned int index); + +int mlx5_cmd_update_root_ft(struct mlx5_core_dev *dev, + enum fs_ft_type type, + unsigned int id); + +int mlx5_init_fs(struct mlx5_core_dev *dev); +void mlx5_cleanup_fs(struct mlx5_core_dev *dev); +#endif Copied: stable/11/sys/dev/mlx5/mlx5_core/mlx5_fs_cmd.c (from r325638, head/sys/dev/mlx5/mlx5_core/mlx5_fs_cmd.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/sys/dev/mlx5/mlx5_core/mlx5_fs_cmd.c Tue Feb 13 14:37:21 2018 (r329200, copy of r325638, head/sys/dev/mlx5/mlx5_core/mlx5_fs_cmd.c) @@ -0,0 +1,302 @@ +/*- + * Copyright (c) 2013-2017, Mellanox Technologies, Ltd. 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 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 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 +#include +#include +#include +#include + +#include "fs_core.h" +#include "mlx5_core.h" + +int mlx5_cmd_update_root_ft(struct mlx5_core_dev *dev, + enum fs_ft_type type, + unsigned int id) +{ + u32 in[MLX5_ST_SZ_DW(set_flow_table_root_in)]; + u32 out[MLX5_ST_SZ_DW(set_flow_table_root_out)]; + + if (!dev) + return -EINVAL; + memset(in, 0, sizeof(in)); + + MLX5_SET(set_flow_table_root_in, in, opcode, + MLX5_CMD_OP_SET_FLOW_TABLE_ROOT); + MLX5_SET(set_flow_table_root_in, in, table_type, type); + MLX5_SET(set_flow_table_root_in, in, table_id, id); + + memset(out, 0, sizeof(out)); + return mlx5_cmd_exec_check_status(dev, in, sizeof(in), out, + sizeof(out)); +} + +int mlx5_cmd_fs_create_ft(struct mlx5_core_dev *dev, + u16 vport, + enum fs_ft_type type, unsigned int level, + unsigned int log_size, unsigned int *table_id) +{ + u32 in[MLX5_ST_SZ_DW(create_flow_table_in)]; + u32 out[MLX5_ST_SZ_DW(create_flow_table_out)]; + int err; + + if (!dev) + return -EINVAL; + memset(in, 0, sizeof(in)); + + MLX5_SET(create_flow_table_in, in, opcode, + MLX5_CMD_OP_CREATE_FLOW_TABLE); + + MLX5_SET(create_flow_table_in, in, table_type, type); + MLX5_SET(create_flow_table_in, in, flow_table_context.level, level); + MLX5_SET(create_flow_table_in, in, flow_table_context.log_size, + log_size); + if (vport) { + MLX5_SET(create_flow_table_in, in, vport_number, vport); + MLX5_SET(create_flow_table_in, in, other_vport, 1); + } + + memset(out, 0, sizeof(out)); + err = mlx5_cmd_exec_check_status(dev, in, sizeof(in), out, + sizeof(out)); + if (err) + return err; + + *table_id = MLX5_GET(create_flow_table_out, out, table_id); + + return 0; +} + +int mlx5_cmd_fs_destroy_ft(struct mlx5_core_dev *dev, + u16 vport, + enum fs_ft_type type, unsigned int table_id) +{ + u32 in[MLX5_ST_SZ_DW(destroy_flow_table_in)]; + u32 out[MLX5_ST_SZ_DW(destroy_flow_table_out)]; + + if (!dev) + return -EINVAL; + memset(in, 0, sizeof(in)); + memset(out, 0, sizeof(out)); + + MLX5_SET(destroy_flow_table_in, in, opcode, + MLX5_CMD_OP_DESTROY_FLOW_TABLE); + MLX5_SET(destroy_flow_table_in, in, table_type, type); + MLX5_SET(destroy_flow_table_in, in, table_id, table_id); + if (vport) { + MLX5_SET(destroy_flow_table_in, in, vport_number, vport); + MLX5_SET(destroy_flow_table_in, in, other_vport, 1); + } + + return mlx5_cmd_exec_check_status(dev, in, sizeof(in), out, sizeof(out)); +} + +int mlx5_cmd_fs_create_fg(struct mlx5_core_dev *dev, + u32 *in, + u16 vport, + enum fs_ft_type type, unsigned int table_id, + unsigned int *group_id) +{ + u32 out[MLX5_ST_SZ_DW(create_flow_group_out)]; + int err; + int inlen = MLX5_ST_SZ_BYTES(create_flow_group_in); + if (!dev) + return -EINVAL; + memset(out, 0, sizeof(out)); + + MLX5_SET(create_flow_group_in, in, opcode, + MLX5_CMD_OP_CREATE_FLOW_GROUP); + MLX5_SET(create_flow_group_in, in, table_type, type); + MLX5_SET(create_flow_group_in, in, table_id, table_id); + if (vport) { + MLX5_SET(create_flow_group_in, in, vport_number, vport); + MLX5_SET(create_flow_group_in, in, other_vport, 1); + } + + err = mlx5_cmd_exec_check_status(dev, in, + inlen, out, + sizeof(out)); + if (!err) + *group_id = MLX5_GET(create_flow_group_out, out, group_id); + + return err; +} + +int mlx5_cmd_fs_destroy_fg(struct mlx5_core_dev *dev, + u16 vport, + enum fs_ft_type type, unsigned int table_id, + unsigned int group_id) +{ + u32 in[MLX5_ST_SZ_DW(destroy_flow_group_in)]; + u32 out[MLX5_ST_SZ_DW(destroy_flow_group_out)]; + + if (!dev) + return -EINVAL; + memset(in, 0, sizeof(in)); + memset(out, 0, sizeof(out)); + + MLX5_SET(destroy_flow_group_in, in, opcode, + MLX5_CMD_OP_DESTROY_FLOW_GROUP); + MLX5_SET(destroy_flow_group_in, in, table_type, type); + MLX5_SET(destroy_flow_group_in, in, table_id, table_id); + MLX5_SET(destroy_flow_group_in, in, group_id, group_id); + if (vport) { + MLX5_SET(destroy_flow_group_in, in, vport_number, vport); + MLX5_SET(destroy_flow_group_in, in, other_vport, 1); + } + + return mlx5_cmd_exec_check_status(dev, in, sizeof(in), out, sizeof(out)); +} + +int mlx5_cmd_fs_set_fte(struct mlx5_core_dev *dev, + u16 vport, + enum fs_fte_status *fte_status, + u32 *match_val, + enum fs_ft_type type, unsigned int table_id, + unsigned int index, unsigned int group_id, + unsigned int flow_tag, + unsigned short action, int dest_size, + struct list_head *dests) /* mlx5_flow_desination */ +{ + u32 out[MLX5_ST_SZ_DW(set_fte_out)]; + u32 *in; + unsigned int inlen; + struct mlx5_flow_rule *dst; + void *in_flow_context; + void *in_match_value; + void *in_dests; + int err; + int opmod = 0; + int modify_mask = 0; + int atomic_mod_cap; + + if (action != MLX5_FLOW_CONTEXT_ACTION_FWD_DEST) + dest_size = 0; + + inlen = MLX5_ST_SZ_BYTES(set_fte_in) + + dest_size * MLX5_ST_SZ_BYTES(dest_format_struct); + + if (!dev) + return -EINVAL; + + if (*fte_status & FS_FTE_STATUS_EXISTING) { + atomic_mod_cap = MLX5_CAP_FLOWTABLE(dev, + flow_table_properties_nic_receive. + flow_modify_en); + if (!atomic_mod_cap) + return -ENOTSUPP; + opmod = 1; + modify_mask = 1 << + MLX5_SET_FTE_MODIFY_ENABLE_MASK_DESTINATION_LIST; + } + + in = mlx5_vzalloc(inlen); + if (!in) { + mlx5_core_warn(dev, "failed to allocate inbox\n"); + return -ENOMEM; + } + + MLX5_SET(set_fte_in, in, opcode, MLX5_CMD_OP_SET_FLOW_TABLE_ENTRY); + MLX5_SET(set_fte_in, in, op_mod, opmod); + MLX5_SET(set_fte_in, in, modify_enable_mask, modify_mask); + MLX5_SET(set_fte_in, in, table_type, type); + MLX5_SET(set_fte_in, in, table_id, table_id); + MLX5_SET(set_fte_in, in, flow_index, index); + if (vport) { + MLX5_SET(set_fte_in, in, vport_number, vport); + MLX5_SET(set_fte_in, in, other_vport, 1); + } + + in_flow_context = MLX5_ADDR_OF(set_fte_in, in, flow_context); + MLX5_SET(flow_context, in_flow_context, group_id, group_id); + MLX5_SET(flow_context, in_flow_context, flow_tag, flow_tag); + MLX5_SET(flow_context, in_flow_context, action, action); + MLX5_SET(flow_context, in_flow_context, destination_list_size, + dest_size); + in_match_value = MLX5_ADDR_OF(flow_context, in_flow_context, + match_value); + memcpy(in_match_value, match_val, MLX5_ST_SZ_BYTES(fte_match_param)); + if (dest_size) { + in_dests = MLX5_ADDR_OF(flow_context, in_flow_context, destination); + list_for_each_entry(dst, dests, base.list) { + unsigned int id; + + MLX5_SET(dest_format_struct, in_dests, destination_type, + dst->dest_attr.type); + if (dst->dest_attr.type == + MLX5_FLOW_CONTEXT_DEST_TYPE_FLOW_TABLE) + id = dst->dest_attr.ft->id; + else + id = dst->dest_attr.tir_num; + MLX5_SET(dest_format_struct, in_dests, destination_id, id); + in_dests += MLX5_ST_SZ_BYTES(dest_format_struct); + } + } + memset(out, 0, sizeof(out)); + err = mlx5_cmd_exec_check_status(dev, in, inlen, out, + sizeof(out)); + if (!err) + *fte_status |= FS_FTE_STATUS_EXISTING; + + kvfree(in); + + return err; +} + +int mlx5_cmd_fs_delete_fte(struct mlx5_core_dev *dev, + u16 vport, + enum fs_fte_status *fte_status, + enum fs_ft_type type, unsigned int table_id, + unsigned int index) +{ + u32 in[MLX5_ST_SZ_DW(delete_fte_in)]; + u32 out[MLX5_ST_SZ_DW(delete_fte_out)]; + int err; + + if (!(*fte_status & FS_FTE_STATUS_EXISTING)) + return 0; + + if (!dev) + return -EINVAL; + memset(in, 0, sizeof(in)); + memset(out, 0, sizeof(out)); + + MLX5_SET(delete_fte_in, in, opcode, MLX5_CMD_OP_DELETE_FLOW_TABLE_ENTRY); + MLX5_SET(delete_fte_in, in, table_type, type); + MLX5_SET(delete_fte_in, in, table_id, table_id); + MLX5_SET(delete_fte_in, in, flow_index, index); + if (vport) { + MLX5_SET(delete_fte_in, in, vport_number, vport); + MLX5_SET(delete_fte_in, in, other_vport, 1); + } + + err = mlx5_cmd_exec_check_status(dev, in, sizeof(in), out, sizeof(out)); + if (!err) + *fte_status = 0; + + return err; +} Copied and modified: stable/11/sys/dev/mlx5/mlx5_core/mlx5_fs_tree.c (from r325638, head/sys/dev/mlx5/mlx5_core/mlx5_fs_tree.c) ============================================================================== --- head/sys/dev/mlx5/mlx5_core/mlx5_fs_tree.c Fri Nov 10 09:49:08 2017 (r325638, copy source) +++ stable/11/sys/dev/mlx5/mlx5_core/mlx5_fs_tree.c Tue Feb 13 14:37:21 2018 (r329200) @@ -2553,10 +2553,6 @@ static void iterate_rules_in_ft(struct mlx5_flow_table mutex_unlock(&ft->base.lock); } -static void iterate_rules_in_ns(struct mlx5_flow_namespace *ns, - rule_event_fn add_rule_cb, - void *context); - static void iterate_rules_in_prio(struct fs_prio *prio, rule_event_fn add_rule_cb, void *context) Modified: stable/11/sys/dev/mlx5/mlx5_core/mlx5_main.c ============================================================================== --- stable/11/sys/dev/mlx5/mlx5_core/mlx5_main.c Tue Feb 13 12:54:03 2018 (r329199) +++ stable/11/sys/dev/mlx5/mlx5_core/mlx5_main.c Tue Feb 13 14:37:21 2018 (r329200) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2013-2015, Mellanox Technologies, Ltd. All rights reserved. + * Copyright (c) 2013-2017, Mellanox Technologies, Ltd. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -42,6 +42,7 @@ #include #include #include "mlx5_core.h" +#include "fs_core.h" MODULE_AUTHOR("Eli Cohen "); MODULE_DESCRIPTION("Mellanox Connect-IB, ConnectX-4 core driver"); @@ -794,8 +795,21 @@ static int mlx5_dev_init(struct mlx5_core_dev *dev, st mlx5_init_srq_table(dev); mlx5_init_mr_table(dev); + err = mlx5_init_fs(dev); + if (err) { + mlx5_core_err(dev, "flow steering init %d\n", err); + goto err_init_tables; + } + return 0; +err_init_tables: + mlx5_cleanup_mr_table(dev); + mlx5_cleanup_srq_table(dev); + mlx5_cleanup_qp_table(dev); + mlx5_cleanup_cq_table(dev); + unmap_bf_area(dev); + err_stop_eqs: mlx5_stop_eqs(dev); @@ -848,6 +862,7 @@ static void mlx5_dev_cleanup(struct mlx5_core_dev *dev { struct mlx5_priv *priv = &dev->priv; + mlx5_cleanup_fs(dev); mlx5_cleanup_mr_table(dev); mlx5_cleanup_srq_table(dev); mlx5_cleanup_qp_table(dev); Modified: stable/11/sys/dev/mlx5/mlx5_en/en.h ============================================================================== --- stable/11/sys/dev/mlx5/mlx5_en/en.h Tue Feb 13 12:54:03 2018 (r329199) +++ stable/11/sys/dev/mlx5/mlx5_en/en.h Tue Feb 13 14:37:21 2018 (r329200) @@ -590,10 +590,13 @@ enum { MLX5E_NUM_RQT = 2, }; +struct mlx5_flow_rule; + struct mlx5e_eth_addr_info { u8 addr [ETH_ALEN + 2]; u32 tt_vec; - u32 ft_ix[MLX5E_NUM_TT]; /* flow table index per traffic type */ + /* flow table rule per traffic type */ + struct mlx5_flow_rule *ft_rule[MLX5E_NUM_TT]; }; #define MLX5E_ETH_ADDR_HASH_SIZE (1 << BITS_PER_BYTE) @@ -622,17 +625,26 @@ enum { struct mlx5e_vlan_db { unsigned long active_vlans[BITS_TO_LONGS(VLAN_N_VID)]; - u32 active_vlans_ft_ix[VLAN_N_VID]; - u32 untagged_rule_ft_ix; - u32 any_vlan_rule_ft_ix; + struct mlx5_flow_rule *active_vlans_ft_rule[VLAN_N_VID]; + struct mlx5_flow_rule *untagged_ft_rule; + struct mlx5_flow_rule *any_cvlan_ft_rule; + struct mlx5_flow_rule *any_svlan_ft_rule; bool filter_disabled; }; struct mlx5e_flow_table { - void *vlan; - void *main; + int num_groups; + struct mlx5_flow_table *t; + struct mlx5_flow_group **g; }; +struct mlx5e_flow_tables { + struct mlx5_flow_namespace *ns; + struct mlx5e_flow_table vlan; + struct mlx5e_flow_table main; + struct mlx5e_flow_table inner_rss; +}; + struct mlx5e_priv { /* priv data path fields - start */ int order_base_2_num_channels; @@ -657,7 +669,7 @@ struct mlx5e_priv { u32 rqtn; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Tue Feb 13 14:40:23 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B6F5EF05650 for ; Tue, 13 Feb 2018 14:40:23 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-io0-x22c.google.com (mail-io0-x22c.google.com [IPv6:2607:f8b0:4001:c06::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 41E497B78B for ; Tue, 13 Feb 2018 14:40:23 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-io0-x22c.google.com with SMTP id n7so21520503iob.0 for ; Tue, 13 Feb 2018 06:40:23 -0800 (PST) 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=rMC/aiHsaMLJjJ9Qc8GibtHeSv1rVFHpoHjueouFTZI=; b=WCEHuP20pKV64TnzgKhluHjDCzLDZCNYjgFepl23SMSfGBD7JnMiTemDcVAqy/GoTJ zwbZfw2/GIUA686p/HTZXa4vD7EcOijMHnAhzY56Fdj48eHukOF+SqrTrqF7HntsHH5V kKQT1oVFEckkN/WbNoEwYdJV5IN2pZYGOco5gFQSUXufYbpMGkoA2Yyaxl/IkypdsTZ5 dF8ayVd9TvX0fOYCWJpuVfctygx0X8TQiO3v/8yryUquotBGZ0rmjdZlXuiZ9K94IKw0 ifDMwtLAEEHr6LV0P4k7Xs2bR3TMYOJwysuJIspmpO2vp5DUFlll24MRvlNfLOd+TNJb kdAA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=rMC/aiHsaMLJjJ9Qc8GibtHeSv1rVFHpoHjueouFTZI=; b=BCcLGitPz3AB9BfiiicuKNnCjmc6HJWQF+kLjLCv1MQFnPneOJJpWnRwruiIR/LS4P FVflmNFy6UZH91lcPeBtVQNI293eas7CLbVUX3ykT3RgfkZngWGEZ/NdQ2ScaUHhLG6p lbLq1zS6UAIM3QutvFzxBDK47NGh2MlQvQLnD2bHdorr5sU2jv/to0xbzXe7jqbFCj/u 8RR00IE0SZdFRnEREwhd/iAW1G87Blq9ZXEhXy+PObqUrEo09jF9fgnpYaFi7pl1mkej eQpFhrZ6HFbjiQXpSy9B3ZdYKQdaHFmdl3AeEIZm7Z2NpAbsRMwjOld+jcOPMCy7NkPj GgQg== X-Gm-Message-State: APf1xPDX8reta0LNqwu86qLRN2yAOHo40U4ueb4D5Gg7xoa2UqgnLruN ThfbUR5in5ZDSx/DIioJZIxrSbdNy86n0e5DhRl0DA== X-Google-Smtp-Source: AH8x224tuZWOcgap5qhb9PhIBbCDcW+csmjaEjq4OihQZITL+Q8mblpJTBUaT1+2lY5W7QmyMdTvD8ijBM1WIwPCdu4= X-Received: by 10.107.51.78 with SMTP id z75mr882323ioz.291.1518532822439; Tue, 13 Feb 2018 06:40:22 -0800 (PST) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.201.67 with HTTP; Tue, 13 Feb 2018 06:40:21 -0800 (PST) X-Originating-IP: [2603:300b:6:5100:18a2:a4f7:170:8dd9] In-Reply-To: References: <201802120445.w1C4jQBL081885@repo.freebsd.org> <1f2b78cb-c27b-6b3b-0ee7-130de756bbb7@gmail.com> From: Warner Losh Date: Tue, 13 Feb 2018 07:40:21 -0700 X-Google-Sender-Auth: nIMYAYibfwF0oq7m-_0el4nBG3U Message-ID: Subject: Re: svn commit: r329148 - head/etc/devd To: Hans Petter Selasky Cc: Renato Botelho , Warner Losh , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.25 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Feb 2018 14:40:24 -0000 On Tue, Feb 13, 2018 at 2:04 AM, Hans Petter Selasky wrote: > On 02/12/18 20:13, Renato Botelho wrote: > >> On 12/02/18 02:45, Warner Losh wrote: >> >>> Author: imp >>> Date: Mon Feb 12 04:45:26 2018 >>> New Revision: 329148 >>> URL: https://svnweb.freebsd.org/changeset/base/329148 >>> >>> Log: >>> Switch to using devmatch to autoload drivers. Remove usb.conf >>> as obsolete because devmatch gets its information from the same >>> place as the genration scripts. >>> >>> Added: >>> head/etc/devd/devmatch.conf (contents, props changed) >>> Deleted: >>> head/etc/devd/usb.conf >>> >>> Added: head/etc/devd/devmatch.conf >>> ============================================================ >>> ================== >>> --- /dev/null 00:00:00 1970 (empty, because file is newly added) >>> +++ head/etc/devd/devmatch.conf Mon Feb 12 04:45:26 2018 (r329148) >>> @@ -0,0 +1,13 @@ >>> +# >>> +# $FreeBSD$ >>> +# >>> + >>> +# >>> +# Example devd configuration file for automatically >>> +# loading what modules we can based on nomatch >>> +# events. >>> +# >>> +# Generic NOMATCH event >>> +nomatch 100 { >>> + action "service devmatch onestart" >>> >> >> Config syntax is broken. It's missing ; in the end of above line >> >> > I've just fixed this in r329194. > > BTW: I see another annoying issue. Devmatch, when it receives a NOMATCH > event, should limit the searching to the current system. I.E. when you plug > a USB device, devmatch should not search PCI drivers aswell. > > Warner, can you add this support? Yes, but on boot, it's still going to match everything because all the NOMATCH events are in the queue. Warner From owner-svn-src-all@freebsd.org Tue Feb 13 14:45:06 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4F543F05E6C; Tue, 13 Feb 2018 14:45:06 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 02AC67BD9C; Tue, 13 Feb 2018 14:45:06 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id ED6132225E; Tue, 13 Feb 2018 14:45:05 +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 w1DEj51c009372; Tue, 13 Feb 2018 14:45:05 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1DEj5V5009370; Tue, 13 Feb 2018 14:45:05 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201802131445.w1DEj5V5009370@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Tue, 13 Feb 2018 14:45:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r329201 - in stable/11/sys/dev/mlx5: . mlx5_core X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in stable/11/sys/dev/mlx5: . mlx5_core X-SVN-Commit-Revision: 329201 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Feb 2018 14:45:06 -0000 Author: hselasky Date: Tue Feb 13 14:45:05 2018 New Revision: 329201 URL: https://svnweb.freebsd.org/changeset/base/329201 Log: MFC r325655: Add API function to query virtual port counters in mlx5 core. Sponsored by: Mellanox Technologies Modified: stable/11/sys/dev/mlx5/mlx5_core/mlx5_vport.c stable/11/sys/dev/mlx5/vport.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/mlx5/mlx5_core/mlx5_vport.c ============================================================================== --- stable/11/sys/dev/mlx5/mlx5_core/mlx5_vport.c Tue Feb 13 14:37:21 2018 (r329200) +++ stable/11/sys/dev/mlx5/mlx5_core/mlx5_vport.c Tue Feb 13 14:45:05 2018 (r329201) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2013-2015, Mellanox Technologies, Ltd. All rights reserved. + * Copyright (c) 2013-2017, Mellanox Technologies, Ltd. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -965,6 +965,43 @@ int mlx5_nic_vport_disable_roce(struct mlx5_core_dev * return mlx5_nic_vport_enable_disable_roce(mdev, 0); } EXPORT_SYMBOL_GPL(mlx5_nic_vport_disable_roce); + +int mlx5_core_query_vport_counter(struct mlx5_core_dev *dev, u8 other_vport, + int vf, u8 port_num, void *out, + size_t out_sz) +{ + int in_sz = MLX5_ST_SZ_BYTES(query_vport_counter_in); + int is_group_manager; + void *in; + int err; + + is_group_manager = MLX5_CAP_GEN(dev, vport_group_manager); + in = mlx5_vzalloc(in_sz); + if (!in) { + err = -ENOMEM; + return err; + } + + MLX5_SET(query_vport_counter_in, in, opcode, + MLX5_CMD_OP_QUERY_VPORT_COUNTER); + if (other_vport) { + if (is_group_manager) { + MLX5_SET(query_vport_counter_in, in, other_vport, 1); + MLX5_SET(query_vport_counter_in, in, vport_number, vf + 1); + } else { + err = -EPERM; + goto free; + } + } + if (MLX5_CAP_GEN(dev, num_ports) == 2) + MLX5_SET(query_vport_counter_in, in, port_num, port_num); + + err = mlx5_cmd_exec(dev, in, in_sz, out, out_sz); +free: + kvfree(in); + return err; +} +EXPORT_SYMBOL_GPL(mlx5_core_query_vport_counter); int mlx5_query_hca_vport_context(struct mlx5_core_dev *mdev, u8 port_num, u8 vport_num, u32 *out, Modified: stable/11/sys/dev/mlx5/vport.h ============================================================================== --- stable/11/sys/dev/mlx5/vport.h Tue Feb 13 14:37:21 2018 (r329200) +++ stable/11/sys/dev/mlx5/vport.h Tue Feb 13 14:45:05 2018 (r329201) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2013-2015, Mellanox Technologies, Ltd. All rights reserved. + * Copyright (c) 2013-2017, Mellanox Technologies, Ltd. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -101,6 +101,9 @@ int mlx5_set_nic_vport_permanent_mac(struct mlx5_core_ u8 *addr); int mlx5_nic_vport_enable_roce(struct mlx5_core_dev *mdev); int mlx5_nic_vport_disable_roce(struct mlx5_core_dev *mdev); +int mlx5_core_query_vport_counter(struct mlx5_core_dev *dev, u8 other_vport, + int vf, u8 port_num, void *out, + size_t out_sz); int mlx5_query_nic_vport_system_image_guid(struct mlx5_core_dev *mdev, u64 *system_image_guid); int mlx5_query_vport_system_image_guid(struct mlx5_core_dev *dev, From owner-svn-src-all@freebsd.org Tue Feb 13 14:46:30 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8D642F06084; Tue, 13 Feb 2018 14:46:30 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 367CC7BF3C; Tue, 13 Feb 2018 14:46:30 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2E06E2225F; Tue, 13 Feb 2018 14:46:30 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1DEkTMR009477; Tue, 13 Feb 2018 14:46:29 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1DEkTtL009475; Tue, 13 Feb 2018 14:46:29 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201802131446.w1DEkTtL009475@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Tue, 13 Feb 2018 14:46:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r329202 - in stable/11/sys/dev/mlx5: . mlx5_core X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in stable/11/sys/dev/mlx5: . mlx5_core X-SVN-Commit-Revision: 329202 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Feb 2018 14:46:30 -0000 Author: hselasky Date: Tue Feb 13 14:46:29 2018 New Revision: 329202 URL: https://svnweb.freebsd.org/changeset/base/329202 Log: MFC r325656: Add API functions to query and modify local loopback of multicast and unicast traffic in mlx5 core. Sponsored by: Mellanox Technologies Modified: stable/11/sys/dev/mlx5/mlx5_core/mlx5_vport.c stable/11/sys/dev/mlx5/vport.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/mlx5/mlx5_core/mlx5_vport.c ============================================================================== --- stable/11/sys/dev/mlx5/mlx5_core/mlx5_vport.c Tue Feb 13 14:45:05 2018 (r329201) +++ stable/11/sys/dev/mlx5/mlx5_core/mlx5_vport.c Tue Feb 13 14:46:29 2018 (r329202) @@ -1485,6 +1485,72 @@ int mlx5_modify_nic_vport_promisc(struct mlx5_core_dev } EXPORT_SYMBOL_GPL(mlx5_modify_nic_vport_promisc); +int mlx5_nic_vport_modify_local_lb(struct mlx5_core_dev *mdev, + enum mlx5_local_lb_selection selection, + u8 value) +{ + void *in; + int inlen = MLX5_ST_SZ_BYTES(modify_nic_vport_context_in); + int err; + + in = mlx5_vzalloc(inlen); + if (!in) { + mlx5_core_warn(mdev, "failed to allocate inbox\n"); + return -ENOMEM; + } + + MLX5_SET(modify_nic_vport_context_in, in, vport_number, 0); + + if (selection == MLX5_LOCAL_MC_LB) { + MLX5_SET(modify_nic_vport_context_in, in, + field_select.disable_mc_local_lb, 1); + MLX5_SET(modify_nic_vport_context_in, in, + nic_vport_context.disable_mc_local_lb, + value); + } else { + MLX5_SET(modify_nic_vport_context_in, in, + field_select.disable_uc_local_lb, 1); + MLX5_SET(modify_nic_vport_context_in, in, + nic_vport_context.disable_uc_local_lb, + value); + } + + err = mlx5_modify_nic_vport_context(mdev, in, inlen); + + kvfree(in); + return err; +} +EXPORT_SYMBOL_GPL(mlx5_nic_vport_modify_local_lb); + +int mlx5_nic_vport_query_local_lb(struct mlx5_core_dev *mdev, + enum mlx5_local_lb_selection selection, + u8 *value) +{ + void *out; + int outlen = MLX5_ST_SZ_BYTES(query_nic_vport_context_out); + int err; + + out = kzalloc(outlen, GFP_KERNEL); + if (!out) + return -ENOMEM; + + err = mlx5_query_nic_vport_context(mdev, 0, out, outlen); + if (err) + goto done; + + if (selection == MLX5_LOCAL_MC_LB) + *value = MLX5_GET(query_nic_vport_context_out, out, + nic_vport_context.disable_mc_local_lb); + else + *value = MLX5_GET(query_nic_vport_context_out, out, + nic_vport_context.disable_uc_local_lb); + +done: + kfree(out); + return err; +} +EXPORT_SYMBOL_GPL(mlx5_nic_vport_query_local_lb); + int mlx5_query_vport_counter(struct mlx5_core_dev *dev, u8 port_num, u16 vport_num, void *out, int out_size) Modified: stable/11/sys/dev/mlx5/vport.h ============================================================================== --- stable/11/sys/dev/mlx5/vport.h Tue Feb 13 14:45:05 2018 (r329201) +++ stable/11/sys/dev/mlx5/vport.h Tue Feb 13 14:46:29 2018 (r329202) @@ -41,7 +41,17 @@ int mlx5_vport_query_q_counter(struct mlx5_core_dev *m int mlx5_vport_query_out_of_rx_buffer(struct mlx5_core_dev *mdev, u16 counter_set_id, u32 *out_of_rx_buffer); +enum mlx5_local_lb_selection { + MLX5_LOCAL_MC_LB, + MLX5_LOCAL_UC_LB +}; +int mlx5_nic_vport_query_local_lb(struct mlx5_core_dev *mdev, + enum mlx5_local_lb_selection selection, + u8 *value); +int mlx5_nic_vport_modify_local_lb(struct mlx5_core_dev *mdev, + enum mlx5_local_lb_selection selection, + u8 value); u8 mlx5_query_vport_state(struct mlx5_core_dev *mdev, u8 opmod, u16 vport); u8 mlx5_query_vport_admin_state(struct mlx5_core_dev *mdev, u8 opmod, u16 vport); From owner-svn-src-all@freebsd.org Tue Feb 13 14:47:45 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 19842F062C3; Tue, 13 Feb 2018 14:47:45 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BF57B7C102; Tue, 13 Feb 2018 14:47:44 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BA47122262; Tue, 13 Feb 2018 14:47: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 w1DElirw009575; Tue, 13 Feb 2018 14:47:44 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1DEliRG009573; Tue, 13 Feb 2018 14:47:44 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201802131447.w1DEliRG009573@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Tue, 13 Feb 2018 14:47:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r329203 - in stable/11/sys/dev/mlx5: . mlx5_core X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in stable/11/sys/dev/mlx5: . mlx5_core X-SVN-Commit-Revision: 329203 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Feb 2018 14:47:45 -0000 Author: hselasky Date: Tue Feb 13 14:47:44 2018 New Revision: 329203 URL: https://svnweb.freebsd.org/changeset/base/329203 Log: MFC r325657: Add API function to query port performance counters for infiniband and RoCE traffic in mlx5 core. Sponsored by: Mellanox Technologies Modified: stable/11/sys/dev/mlx5/mlx5_core/mlx5_vport.c stable/11/sys/dev/mlx5/vport.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/mlx5/mlx5_core/mlx5_vport.c ============================================================================== --- stable/11/sys/dev/mlx5/mlx5_core/mlx5_vport.c Tue Feb 13 14:46:29 2018 (r329202) +++ stable/11/sys/dev/mlx5/mlx5_core/mlx5_vport.c Tue Feb 13 14:47:44 2018 (r329203) @@ -1757,3 +1757,25 @@ out: return err; } EXPORT_SYMBOL_GPL(mlx5_query_hca_vport_state); + +int mlx5_core_query_ib_ppcnt(struct mlx5_core_dev *dev, + u8 port_num, void *out, size_t sz) +{ + u32 *in; + int err; + + in = mlx5_vzalloc(sz); + if (!in) { + err = -ENOMEM; + return err; + } + + MLX5_SET(ppcnt_reg, in, local_port, port_num); + + MLX5_SET(ppcnt_reg, in, grp, MLX5_INFINIBAND_PORT_COUNTERS_GROUP); + err = mlx5_core_access_reg(dev, in, sz, out, + sz, MLX5_REG_PPCNT, 0, 0); + + kvfree(in); + return err; +} Modified: stable/11/sys/dev/mlx5/vport.h ============================================================================== --- stable/11/sys/dev/mlx5/vport.h Tue Feb 13 14:46:29 2018 (r329202) +++ stable/11/sys/dev/mlx5/vport.h Tue Feb 13 14:47:44 2018 (r329203) @@ -143,4 +143,6 @@ int mlx5_query_vport_counter(struct mlx5_core_dev *dev void *out, int out_size); int mlx5_get_vport_counters(struct mlx5_core_dev *dev, u8 port_num, struct mlx5_vport_counters *vc); +int mlx5_core_query_ib_ppcnt(struct mlx5_core_dev *dev, + u8 port_num, void *out, size_t sz); #endif /* __MLX5_VPORT_H__ */ From owner-svn-src-all@freebsd.org Tue Feb 13 14:57:35 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 954A6F06E12; Tue, 13 Feb 2018 14:57:35 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4A41A7C7B9; Tue, 13 Feb 2018 14:57:35 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 44EEE22405; Tue, 13 Feb 2018 14:57:35 +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 w1DEvZKS014845; Tue, 13 Feb 2018 14:57:35 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1DEvYKC014840; Tue, 13 Feb 2018 14:57:34 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201802131457.w1DEvYKC014840@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Tue, 13 Feb 2018 14:57:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r329204 - in stable/11/sys/dev/mlx5: . mlx5_ib X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in stable/11/sys/dev/mlx5: . mlx5_ib X-SVN-Commit-Revision: 329204 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Feb 2018 14:57:35 -0000 Author: hselasky Date: Tue Feb 13 14:57:34 2018 New Revision: 329204 URL: https://svnweb.freebsd.org/changeset/base/329204 Log: MFC r325662: Add more and update existing mlx5 core firmware structure definitions and bits. This change is part of coming ibcore and mlx5ib updates. Sponsored by: Mellanox Technologies Modified: stable/11/sys/dev/mlx5/device.h stable/11/sys/dev/mlx5/driver.h stable/11/sys/dev/mlx5/mlx5_ib/mlx5_ib_qp.c stable/11/sys/dev/mlx5/mlx5_ifc.h stable/11/sys/dev/mlx5/qp.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/mlx5/device.h ============================================================================== --- stable/11/sys/dev/mlx5/device.h Tue Feb 13 14:47:44 2018 (r329203) +++ stable/11/sys/dev/mlx5/device.h Tue Feb 13 14:57:34 2018 (r329204) @@ -100,6 +100,35 @@ __mlx5_mask(typ, fld)) #define MLX5_GET64(typ, p, fld) be64_to_cpu(*((__be64 *)(p) + __mlx5_64_off(typ, fld))) +#define MLX5_GET64_BE(typ, p, fld) (*((__be64 *)(p) +\ + __mlx5_64_off(typ, fld))) + +#define MLX5_GET_BE(type_t, typ, p, fld) ({ \ + type_t tmp; \ + switch (sizeof(tmp)) { \ + case sizeof(u8): \ + tmp = (__force type_t)MLX5_GET(typ, p, fld); \ + break; \ + case sizeof(u16): \ + tmp = (__force type_t)cpu_to_be16(MLX5_GET(typ, p, fld)); \ + break; \ + case sizeof(u32): \ + tmp = (__force type_t)cpu_to_be32(MLX5_GET(typ, p, fld)); \ + break; \ + case sizeof(u64): \ + tmp = (__force type_t)MLX5_GET64_BE(typ, p, fld); \ + break; \ + } \ + tmp; \ + }) + +#define MLX5_BY_PASS_NUM_REGULAR_PRIOS 8 +#define MLX5_BY_PASS_NUM_DONT_TRAP_PRIOS 8 +#define MLX5_BY_PASS_NUM_MULTICAST_PRIOS 1 +#define MLX5_BY_PASS_NUM_PRIOS (MLX5_BY_PASS_NUM_REGULAR_PRIOS +\ + MLX5_BY_PASS_NUM_DONT_TRAP_PRIOS +\ + MLX5_BY_PASS_NUM_MULTICAST_PRIOS) + enum { MLX5_MAX_COMMANDS = 32, MLX5_CMD_DATA_BLOCK_SIZE = 512, @@ -326,6 +355,17 @@ enum { MLX5_CAP_OFF_CMDIF_CSUM = 46, }; +enum { + /* + * Max wqe size for rdma read is 512 bytes, so this + * limits our max_sge_rd as the wqe needs to fit: + * - ctrl segment (16 bytes) + * - rdma segment (16 bytes) + * - scatter elements (16 bytes each) + */ + MLX5_MAX_SGE_RD = (512 - 16 - 16) / 16 +}; + struct mlx5_inbox_hdr { __be16 opcode; u8 rsvd[4]; @@ -642,9 +682,9 @@ enum { }; enum { - CQE_ROCE_L3_HEADER_TYPE_GRH = 0x0, - CQE_ROCE_L3_HEADER_TYPE_IPV6 = 0x1, - CQE_ROCE_L3_HEADER_TYPE_IPV4 = 0x2, + MLX5_CQE_ROCE_L3_HEADER_TYPE_GRH = 0x0, + MLX5_CQE_ROCE_L3_HEADER_TYPE_IPV6 = 0x1, + MLX5_CQE_ROCE_L3_HEADER_TYPE_IPV4 = 0x2, }; enum { @@ -1282,6 +1322,7 @@ enum { MLX5_PER_PRIORITY_COUNTERS_GROUP = 0x10, MLX5_PER_TRAFFIC_CLASS_COUNTERS_GROUP = 0x11, MLX5_PHYSICAL_LAYER_COUNTERS_GROUP = 0x12, + MLX5_PHYSICAL_LAYER_STATISTICAL_GROUP = 0x16, MLX5_INFINIBAND_PORT_COUNTERS_GROUP = 0x20, }; Modified: stable/11/sys/dev/mlx5/driver.h ============================================================================== --- stable/11/sys/dev/mlx5/driver.h Tue Feb 13 14:47:44 2018 (r329203) +++ stable/11/sys/dev/mlx5/driver.h Tue Feb 13 14:57:34 2018 (r329204) @@ -306,6 +306,11 @@ struct cmd_msg_cache { }; +struct mlx5_traffic_counter { + u64 packets; + u64 octets; +}; + struct mlx5_cmd_stats { u64 sum; u64 n; @@ -742,6 +747,13 @@ struct mlx5_pas { u8 log_sz; }; +enum port_state_policy { + MLX5_POLICY_DOWN = 0, + MLX5_POLICY_UP = 1, + MLX5_POLICY_FOLLOW = 2, + MLX5_POLICY_INVALID = 0xffffffff +}; + static inline void * mlx5_buf_offset(struct mlx5_buf *buf, int offset) { @@ -808,6 +820,11 @@ static inline void *mlx5_vmalloc(unsigned long size) if (!rtn) rtn = vmalloc(size); return rtn; +} + +static inline u32 mlx5_base_mkey(const u32 key) +{ + return key & 0xffffff00u; } void mlx5_enter_error_state(struct mlx5_core_dev *dev); Modified: stable/11/sys/dev/mlx5/mlx5_ib/mlx5_ib_qp.c ============================================================================== --- stable/11/sys/dev/mlx5/mlx5_ib/mlx5_ib_qp.c Tue Feb 13 14:47:44 2018 (r329203) +++ stable/11/sys/dev/mlx5/mlx5_ib/mlx5_ib_qp.c Tue Feb 13 14:57:34 2018 (r329204) @@ -59,13 +59,6 @@ enum { MLX5_IB_CACHE_LINE_SIZE = 64, }; -enum { - MLX5_RQ_NUM_STATE = MLX5_RQC_STATE_ERR + 1, - MLX5_SQ_NUM_STATE = MLX5_SQC_STATE_ERR + 1, - MLX5_QP_STATE = MLX5_QP_NUM_STATE + 1, - MLX5_QP_STATE_BAD = MLX5_QP_STATE + 1, -}; - static const u32 mlx5_ib_opcode[] = { [IB_WR_SEND] = MLX5_OPCODE_SEND, [IB_WR_SEND_WITH_IMM] = MLX5_OPCODE_SEND_IMM, Modified: stable/11/sys/dev/mlx5/mlx5_ifc.h ============================================================================== --- stable/11/sys/dev/mlx5/mlx5_ifc.h Tue Feb 13 14:47:44 2018 (r329203) +++ stable/11/sys/dev/mlx5/mlx5_ifc.h Tue Feb 13 14:57:34 2018 (r329204) @@ -756,7 +756,8 @@ struct mlx5_ifc_per_protocol_networking_offload_caps_b u8 multi_pkt_send_wqe[0x2]; u8 wqe_inline_mode[0x2]; u8 rss_ind_tbl_cap[0x4]; - u8 reserved_1[0x3]; + u8 scatter_fcs[0x1]; + u8 reserved_1[0x2]; u8 tunnel_lso_const_out_ip_id[0x1]; u8 tunnel_lro_gre[0x1]; u8 tunnel_lro_vxlan[0x1]; @@ -1045,10 +1046,12 @@ struct mlx5_ifc_cmd_hca_cap_bits { u8 cd[0x1]; u8 atm[0x1]; u8 apm[0x1]; - u8 reserved_32[0x7]; + u8 imaicl[0x1]; + u8 reserved_32[0x6]; u8 qkv[0x1]; u8 pkv[0x1]; - u8 reserved_33[0x4]; + u8 set_deth_sqpn[0x1]; + u8 reserved_33[0x3]; u8 xrc[0x1]; u8 ud[0x1]; u8 uc[0x1]; @@ -1800,7 +1803,7 @@ enum { struct mlx5_ifc_qpc_bits { u8 state[0x4]; - u8 reserved_0[0x4]; + u8 lag_tx_port_affinity[0x4]; u8 st[0x8]; u8 reserved_1[0x3]; u8 pm_state[0x2]; @@ -1862,8 +1865,11 @@ struct mlx5_ifc_qpc_bits { u8 reserved_16[0x8]; u8 cqn_snd[0x18]; - u8 reserved_17[0x40]; + u8 reserved_at_400[0x8]; + u8 deth_sqpn[0x18]; + u8 reserved_17[0x20]; + u8 reserved_18[0x8]; u8 last_acked_psn[0x18]; @@ -2060,7 +2066,11 @@ struct mlx5_ifc_traffic_counter_bits { }; struct mlx5_ifc_tisc_bits { - u8 reserved_0[0xc]; + u8 strict_lag_tx_port_affinity[0x1]; + u8 reserved_at_1[0x3]; + u8 lag_tx_port_affinity[0x04]; + + u8 reserved_at_8[0x4]; u8 prio[0x4]; u8 reserved_1[0x10]; @@ -4657,30 +4667,29 @@ struct mlx5_ifc_query_flow_group_in_bits { struct mlx5_ifc_query_flow_counter_out_bits { u8 status[0x8]; - u8 reserved_0[0x18]; + u8 reserved_at_8[0x18]; u8 syndrome[0x20]; - u8 reserved_1[0x40]; + u8 reserved_at_40[0x40]; - struct mlx5_ifc_traffic_counter_bits flow_statistics; - - u8 reserved_2[0x700]; + struct mlx5_ifc_traffic_counter_bits flow_statistics[0]; }; struct mlx5_ifc_query_flow_counter_in_bits { u8 opcode[0x10]; - u8 reserved_0[0x10]; + u8 reserved_at_10[0x10]; - u8 reserved_1[0x10]; + u8 reserved_at_20[0x10]; u8 op_mod[0x10]; - u8 reserved_2[0x80]; + u8 reserved_at_40[0x80]; u8 clear[0x1]; - u8 reserved_3[0x1f]; + u8 reserved_at_c1[0xf]; + u8 num_of_counters[0x10]; - u8 reserved_4[0x10]; + u8 reserved_at_e0[0x10]; u8 flow_counter_id[0x10]; }; @@ -5106,6 +5115,15 @@ struct mlx5_ifc_modify_tis_out_bits { u8 reserved_1[0x40]; }; +struct mlx5_ifc_modify_tis_bitmask_bits { + u8 reserved_at_0[0x20]; + + u8 reserved_at_20[0x1d]; + u8 lag_tx_port_affinity[0x1]; + u8 strict_lag_tx_port_affinity[0x1]; + u8 prio[0x1]; +}; + struct mlx5_ifc_modify_tis_in_bits { u8 opcode[0x10]; u8 reserved_0[0x10]; @@ -5118,7 +5136,7 @@ struct mlx5_ifc_modify_tis_in_bits { u8 reserved_3[0x20]; - u8 modify_bitmask[0x40]; + struct mlx5_ifc_modify_tis_bitmask_bits bitmask; u8 reserved_4[0x40]; @@ -5266,12 +5284,9 @@ struct mlx5_ifc_modify_rq_out_bits { u8 reserved_1[0x40]; }; -struct mlx5_ifc_rq_bitmask_bits { - u8 reserved[0x20]; - - u8 reserved1[0x1e]; - u8 vlan_strip_disable[0x1]; - u8 reserved2[0x1]; +enum { + MLX5_MODIFY_RQ_IN_MODIFY_BITMASK_VSD = 1ULL << 1, + MLX5_MODIFY_RQ_IN_MODIFY_BITMASK_MODIFY_RQ_COUNTER_SET_ID = 1ULL << 3, }; struct mlx5_ifc_modify_rq_in_bits { @@ -5287,7 +5302,7 @@ struct mlx5_ifc_modify_rq_in_bits { u8 reserved_3[0x20]; - struct mlx5_ifc_rq_bitmask_bits bitmask; + u8 modify_bitmask[0x40]; u8 reserved_4[0x40]; @@ -8126,6 +8141,36 @@ struct mlx5_ifc_phys_layer_cntrs_bits { u8 successful_recovery_events[0x20]; u8 reserved_0[0x180]; +}; + +struct mlx5_ifc_ib_port_cntrs_grp_data_layout_bits { + u8 symbol_error_counter[0x10]; + + u8 link_error_recovery_counter[0x8]; + + u8 link_downed_counter[0x8]; + + u8 port_rcv_errors[0x10]; + + u8 port_rcv_remote_physical_errors[0x10]; + + u8 port_rcv_switch_relay_errors[0x10]; + + u8 port_xmit_discards[0x10]; + + u8 port_xmit_constraint_errors[0x8]; + + u8 port_rcv_constraint_errors[0x8]; + + u8 reserved_at_70[0x8]; + + u8 link_overrun_errors[0x8]; + + u8 reserved_at_80[0x10]; + + u8 vl_15_dropped[0x10]; + + u8 reserved_at_a0[0xa0]; }; struct mlx5_ifc_phys_layer_statistical_cntrs_bits { Modified: stable/11/sys/dev/mlx5/qp.h ============================================================================== --- stable/11/sys/dev/mlx5/qp.h Tue Feb 13 14:47:44 2018 (r329203) +++ stable/11/sys/dev/mlx5/qp.h Tue Feb 13 14:57:34 2018 (r329204) @@ -28,9 +28,7 @@ #ifndef MLX5_QP_H #define MLX5_QP_H -#include #include -#include #define MLX5_INVALID_LKEY 0x100 #define MLX5_SIG_WQE_SIZE (MLX5_SEND_WQE_BB * 5) @@ -45,6 +43,7 @@ #define MLX5_BSF_REPEAT_BLOCK (1 << 7) #define MLX5_BSF_APPTAG_ESCAPE 0x1 #define MLX5_BSF_APPREF_ESCAPE 0x2 +#define MLX5_WQE_DS_UNITS 16 enum mlx5_qp_optpar { MLX5_QP_OPTPAR_ALT_ADDR_PATH = 1 << 0, @@ -78,10 +77,19 @@ enum mlx5_qp_state { MLX5_QP_STATE_ERR = 6, MLX5_QP_STATE_SQ_DRAINING = 7, MLX5_QP_STATE_SUSPENDED = 9, - MLX5_QP_NUM_STATE + MLX5_QP_NUM_STATE, + MLX5_QP_STATE, + MLX5_QP_STATE_BAD, }; enum { + MLX5_SQ_STATE_NA = MLX5_SQC_STATE_ERR + 1, + MLX5_SQ_NUM_STATE = MLX5_SQ_STATE_NA + 1, + MLX5_RQ_STATE_NA = MLX5_RQC_STATE_ERR + 1, + MLX5_RQ_NUM_STATE = MLX5_RQ_STATE_NA + 1, +}; + +enum { MLX5_QP_ST_RC = 0x0, MLX5_QP_ST_UC = 0x1, MLX5_QP_ST_UD = 0x2, @@ -157,6 +165,7 @@ enum { enum { MLX5_FENCE_MODE_NONE = 0 << 5, MLX5_FENCE_MODE_INITIATOR_SMALL = 1 << 5, + MLX5_FENCE_MODE_FENCE = 2 << 5, MLX5_FENCE_MODE_STRONG_ORDERING = 3 << 5, MLX5_FENCE_MODE_SMALL_AND_FENCE = 4 << 5, }; @@ -198,6 +207,8 @@ struct mlx5_wqe_ctrl_seg { __be32 imm; }; +#define MLX5_WQE_CTRL_DS_MASK 0x3f + enum { MLX5_MLX_FLAG_MASK_VL15 = 0x40, MLX5_MLX_FLAG_MASK_SLR = 0x20, @@ -221,10 +232,10 @@ enum { }; enum { - MLX5_ETH_WQE_SWP_OUTER_L3_TYPE = 1 << 0, - MLX5_ETH_WQE_SWP_OUTER_L4_TYPE = 1 << 1, - MLX5_ETH_WQE_SWP_INNER_L3_TYPE = 1 << 4, - MLX5_ETH_WQE_SWP_INNER_L4_TYPE = 1 << 5, + MLX5_ETH_WQE_SWP_INNER_L3_TYPE = 1 << 0, + MLX5_ETH_WQE_SWP_INNER_L4_TYPE = 1 << 1, + MLX5_ETH_WQE_SWP_OUTER_L3_TYPE = 1 << 4, + MLX5_ETH_WQE_SWP_OUTER_L4_TYPE = 1 << 5, }; struct mlx5_wqe_eth_seg { @@ -415,6 +426,42 @@ struct mlx5_stride_block_ctrl_seg { __be16 num_entries; }; +enum mlx5_pagefault_flags { + MLX5_PFAULT_REQUESTOR = 1 << 0, + MLX5_PFAULT_WRITE = 1 << 1, + MLX5_PFAULT_RDMA = 1 << 2, +}; + +/* Contains the details of a pagefault. */ +struct mlx5_pagefault { + u32 bytes_committed; + u8 event_subtype; + enum mlx5_pagefault_flags flags; + union { + /* Initiator or send message responder pagefault details. */ + struct { + /* Received packet size, only valid for responders. */ + u32 packet_size; + /* + * WQE index. Refers to either the send queue or + * receive queue, according to event_subtype. + */ + u16 wqe_index; + } wqe; + /* RDMA responder pagefault details */ + struct { + u32 r_key; + /* + * Received packet size, minimal size page fault + * resolution required for forward progress. + */ + u32 packet_size; + u32 rdma_op_len; + u64 rdma_va; + } rdma; + }; +}; + struct mlx5_core_qp { struct mlx5_core_rsc_common common; /* must be first */ void (*event) (struct mlx5_core_qp *, int); @@ -462,7 +509,8 @@ struct mlx5_qp_context { u8 reserved2[4]; __be32 next_send_psn; __be32 cqn_send; - u8 reserved3[8]; + __be32 deth_sqpn; + u8 reserved3[4]; __be32 last_acked_psn; __be32 ssn; __be32 params2; From owner-svn-src-all@freebsd.org Tue Feb 13 15:05:24 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 51F9CF077E5; Tue, 13 Feb 2018 15:05:24 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 018427CFA3; Tue, 13 Feb 2018 15:05:24 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D0C69225AC; Tue, 13 Feb 2018 15:05:23 +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 w1DF5NsT019651; Tue, 13 Feb 2018 15:05:23 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1DF5Nos019649; Tue, 13 Feb 2018 15:05:23 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201802131505.w1DF5Nos019649@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Tue, 13 Feb 2018 15:05:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r329205 - in stable/11/sys/dev/mlx5: . mlx5_core X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in stable/11/sys/dev/mlx5: . mlx5_core X-SVN-Commit-Revision: 329205 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Feb 2018 15:05:24 -0000 Author: hselasky Date: Tue Feb 13 15:05:23 2018 New Revision: 329205 URL: https://svnweb.freebsd.org/changeset/base/329205 Log: MFC r325648: Implement support for decoding general port notification event in the mlx5 core module. Sponsored by: Mellanox Technologies Modified: stable/11/sys/dev/mlx5/device.h stable/11/sys/dev/mlx5/mlx5_core/mlx5_eq.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/mlx5/device.h ============================================================================== --- stable/11/sys/dev/mlx5/device.h Tue Feb 13 14:57:34 2018 (r329204) +++ stable/11/sys/dev/mlx5/device.h Tue Feb 13 15:05:23 2018 (r329205) @@ -526,6 +526,11 @@ struct mlx5_eqe_port_module_event { u8 error_type; }; +struct mlx5_eqe_general_notification_event { + u32 rq_user_index_delay_drop; + u32 rsvd0[6]; +}; + union ev_data { __be32 raw[7]; struct mlx5_eqe_cmd cmd; @@ -539,6 +544,7 @@ union ev_data { struct mlx5_eqe_page_req req_pages; struct mlx5_eqe_port_module_event port_module_event; struct mlx5_eqe_vport_change vport_change; + struct mlx5_eqe_general_notification_event general_notifications; } __packed; struct mlx5_eqe { @@ -1427,6 +1433,10 @@ static inline int mlx5_get_cqe_format(const struct mlx { return (cqe->op_own & MLX5E_CQE_FORMAT_MASK) >> 2; } + +enum { + MLX5_GEN_EVENT_SUBTYPE_DELAY_DROP_TIMEOUT = 0x1, +}; /* 8 regular priorities + 1 for multicast */ #define MLX5_NUM_BYPASS_FTS 9 Modified: stable/11/sys/dev/mlx5/mlx5_core/mlx5_eq.c ============================================================================== --- stable/11/sys/dev/mlx5/mlx5_core/mlx5_eq.c Tue Feb 13 14:57:34 2018 (r329204) +++ stable/11/sys/dev/mlx5/mlx5_core/mlx5_eq.c Tue Feb 13 15:05:23 2018 (r329205) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2013-2015, Mellanox Technologies, Ltd. All rights reserved. + * Copyright (c) 2013-2017, Mellanox Technologies, Ltd. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -80,6 +80,8 @@ struct cre_des_eq { /*Function prototype*/ static void mlx5_port_module_event(struct mlx5_core_dev *dev, struct mlx5_eqe *eqe); +static void mlx5_port_general_notification_event(struct mlx5_core_dev *dev, + struct mlx5_eqe *eqe); static int mlx5_cmd_destroy_eq(struct mlx5_core_dev *dev, u8 eqn) { @@ -157,6 +159,8 @@ static const char *eqe_type_str(u8 type) return "MLX5_EVENT_TYPE_NIC_VPORT_CHANGE"; case MLX5_EVENT_TYPE_CODING_DCBX_CHANGE_EVENT: return "MLX5_EVENT_TYPE_CODING_DCBX_CHANGE_EVENT"; + case MLX5_EVENT_TYPE_CODING_GENERAL_NOTIFICATION_EVENT: + return "MLX5_EVENT_TYPE_CODING_GENERAL_NOTIFICATION_EVENT"; default: return "Unrecognized event"; } @@ -296,6 +300,10 @@ static int mlx5_eq_int(struct mlx5_core_dev *dev, stru } break; + case MLX5_EVENT_TYPE_CODING_GENERAL_NOTIFICATION_EVENT: + mlx5_port_general_notification_event(dev, eqe); + break; + case MLX5_EVENT_TYPE_CQ_ERROR: cqn = be32_to_cpu(eqe->data.cq_err.cqn) & 0xffffff; mlx5_core_warn(dev, "CQ error on CQN 0x%x, syndrom 0x%x\n", @@ -665,5 +673,26 @@ static void mlx5_port_module_event(struct mlx5_core_de /* store module status */ if (module_num < MLX5_MAX_PORTS) dev->module_status[module_num] = module_status; +} + +static void mlx5_port_general_notification_event(struct mlx5_core_dev *dev, + struct mlx5_eqe *eqe) +{ + u8 port = (eqe->data.port.port >> 4) & 0xf; + u32 rqn = 0; + struct mlx5_eqe_general_notification_event *general_event = NULL; + + switch (eqe->sub_type) { + case MLX5_GEN_EVENT_SUBTYPE_DELAY_DROP_TIMEOUT: + general_event = &eqe->data.general_notifications; + rqn = be32_to_cpu(general_event->rq_user_index_delay_drop) & + 0xffffff; + break; + default: + mlx5_core_warn(dev, + "general event with unrecognized subtype: port %d, sub_type %d\n", + port, eqe->sub_type); + break; + } } From owner-svn-src-all@freebsd.org Tue Feb 13 15:07:40 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2837AF07ABC; Tue, 13 Feb 2018 15:07:40 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CEBFE7D1B3; Tue, 13 Feb 2018 15:07:39 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C5738225AF; Tue, 13 Feb 2018 15:07:39 +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 w1DF7d1X019777; Tue, 13 Feb 2018 15:07:39 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1DF7dvq019775; Tue, 13 Feb 2018 15:07:39 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201802131507.w1DF7dvq019775@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Tue, 13 Feb 2018 15:07:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r329206 - in stable/11/sys/dev/mlx5: . mlx5_core X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in stable/11/sys/dev/mlx5: . mlx5_core X-SVN-Commit-Revision: 329206 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Feb 2018 15:07:40 -0000 Author: hselasky Date: Tue Feb 13 15:07:39 2018 New Revision: 329206 URL: https://svnweb.freebsd.org/changeset/base/329206 Log: MFC r325650: Add const keyword to input-only argument in mlx5 core. Sponsored by: Mellanox Technologies Modified: stable/11/sys/dev/mlx5/driver.h stable/11/sys/dev/mlx5/mlx5_core/mlx5_mad.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/mlx5/driver.h ============================================================================== --- stable/11/sys/dev/mlx5/driver.h Tue Feb 13 15:05:23 2018 (r329205) +++ stable/11/sys/dev/mlx5/driver.h Tue Feb 13 15:07:39 2018 (r329206) @@ -879,7 +879,7 @@ int mlx5_core_dump_fill_mkey(struct mlx5_core_dev *dev u32 *mkey); int mlx5_core_alloc_pd(struct mlx5_core_dev *dev, u32 *pdn); int mlx5_core_dealloc_pd(struct mlx5_core_dev *dev, u32 pdn); -int mlx5_core_mad_ifc(struct mlx5_core_dev *dev, void *inb, void *outb, +int mlx5_core_mad_ifc(struct mlx5_core_dev *dev, const void *inb, void *outb, u16 opmod, u8 port); void mlx5_fwp_flush(struct mlx5_fw_page *fwp); void mlx5_fwp_invalidate(struct mlx5_fw_page *fwp); Modified: stable/11/sys/dev/mlx5/mlx5_core/mlx5_mad.c ============================================================================== --- stable/11/sys/dev/mlx5/mlx5_core/mlx5_mad.c Tue Feb 13 15:05:23 2018 (r329205) +++ stable/11/sys/dev/mlx5/mlx5_core/mlx5_mad.c Tue Feb 13 15:07:39 2018 (r329206) @@ -30,7 +30,7 @@ #include #include "mlx5_core.h" -int mlx5_core_mad_ifc(struct mlx5_core_dev *dev, void *inb, void *outb, +int mlx5_core_mad_ifc(struct mlx5_core_dev *dev, const void *inb, void *outb, u16 opmod, u8 port) { struct mlx5_mad_ifc_mbox_in *in = NULL; From owner-svn-src-all@freebsd.org Tue Feb 13 15:09:04 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5014AF07C99; Tue, 13 Feb 2018 15:09:04 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 029AF7D32D; Tue, 13 Feb 2018 15:09:04 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F1912225B0; Tue, 13 Feb 2018 15:09:03 +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 w1DF93A4019882; Tue, 13 Feb 2018 15:09:03 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1DF93b6019880; Tue, 13 Feb 2018 15:09:03 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201802131509.w1DF93b6019880@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Tue, 13 Feb 2018 15:09:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r329207 - in stable/11/sys/dev/mlx5: . mlx5_core X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in stable/11/sys/dev/mlx5: . mlx5_core X-SVN-Commit-Revision: 329207 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Feb 2018 15:09:04 -0000 Author: hselasky Date: Tue Feb 13 15:09:03 2018 New Revision: 329207 URL: https://svnweb.freebsd.org/changeset/base/329207 Log: MFC r325653: Add API functions to set and query dropless port mode in mlx5 core. Sponsored by: Mellanox Technologies Modified: stable/11/sys/dev/mlx5/driver.h stable/11/sys/dev/mlx5/mlx5_core/mlx5_port.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/mlx5/driver.h ============================================================================== --- stable/11/sys/dev/mlx5/driver.h Tue Feb 13 15:07:39 2018 (r329206) +++ stable/11/sys/dev/mlx5/driver.h Tue Feb 13 15:09:03 2018 (r329207) @@ -983,6 +983,8 @@ int mlx5_core_destroy_psv(struct mlx5_core_dev *dev, i void mlx5_core_put_rsc(struct mlx5_core_rsc_common *common); u8 mlx5_is_wol_supported(struct mlx5_core_dev *dev); int mlx5_set_wol(struct mlx5_core_dev *dev, u8 wol_mode); +int mlx5_set_dropless_mode(struct mlx5_core_dev *dev, u16 timeout); +int mlx5_query_dropless_mode(struct mlx5_core_dev *dev, u16 *timeout); int mlx5_query_wol(struct mlx5_core_dev *dev, u8 *wol_mode); int mlx5_core_access_pvlc(struct mlx5_core_dev *dev, struct mlx5_pvlc_reg *pvlc, int write); Modified: stable/11/sys/dev/mlx5/mlx5_core/mlx5_port.c ============================================================================== --- stable/11/sys/dev/mlx5/mlx5_core/mlx5_port.c Tue Feb 13 15:07:39 2018 (r329206) +++ stable/11/sys/dev/mlx5/mlx5_core/mlx5_port.c Tue Feb 13 15:09:03 2018 (r329207) @@ -459,6 +459,46 @@ int mlx5_set_wol(struct mlx5_core_dev *dev, u8 wol_mod } EXPORT_SYMBOL_GPL(mlx5_set_wol); +int mlx5_query_dropless_mode(struct mlx5_core_dev *dev, u16 *timeout) +{ + u32 in[MLX5_ST_SZ_DW(query_delay_drop_params_in)]; + u32 out[MLX5_ST_SZ_DW(query_delay_drop_params_out)]; + int err = 0; + + memset(in, 0, sizeof(in)); + memset(out, 0, sizeof(out)); + + MLX5_SET(query_delay_drop_params_in, in, opcode, + MLX5_CMD_OP_QUERY_DELAY_DROP_PARAMS); + + err = mlx5_cmd_exec_check_status(dev, in, sizeof(in), out, sizeof(out)); + if (err) + return err; + + *timeout = MLX5_GET(query_delay_drop_params_out, out, + delay_drop_timeout); + + return 0; +} +EXPORT_SYMBOL_GPL(mlx5_query_dropless_mode); + +int mlx5_set_dropless_mode(struct mlx5_core_dev *dev, u16 timeout) +{ + u32 in[MLX5_ST_SZ_DW(set_delay_drop_params_in)]; + u32 out[MLX5_ST_SZ_DW(set_delay_drop_params_out)]; + + memset(in, 0, sizeof(in)); + memset(out, 0, sizeof(out)); + + MLX5_SET(set_delay_drop_params_in, in, opcode, + MLX5_CMD_OP_SET_DELAY_DROP_PARAMS); + MLX5_SET(set_delay_drop_params_in, in, delay_drop_timeout, timeout); + + return mlx5_cmd_exec_check_status(dev, in, sizeof(in), + out, sizeof(out)); +} +EXPORT_SYMBOL_GPL(mlx5_set_dropless_mode); + int mlx5_core_access_pvlc(struct mlx5_core_dev *dev, struct mlx5_pvlc_reg *pvlc, int write) { From owner-svn-src-all@freebsd.org Tue Feb 13 15:11:01 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ADB7CF07EDF; Tue, 13 Feb 2018 15:11:01 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5B8D17D51E; Tue, 13 Feb 2018 15:11:01 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 568B9226D2; Tue, 13 Feb 2018 15:11:01 +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 w1DFB1xx022914; Tue, 13 Feb 2018 15:11:01 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1DFB1t0022913; Tue, 13 Feb 2018 15:11:01 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201802131511.w1DFB1t0022913@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Tue, 13 Feb 2018 15:11:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r329208 - stable/11/sys/dev/mlx5/mlx5_core X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/11/sys/dev/mlx5/mlx5_core X-SVN-Commit-Revision: 329208 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Feb 2018 15:11:01 -0000 Author: hselasky Date: Tue Feb 13 15:11:00 2018 New Revision: 329208 URL: https://svnweb.freebsd.org/changeset/base/329208 Log: MFC r325649: Make local variable 64-bits to avoid masking away bits in mlx5 core. Sponsored by: Mellanox Technologies Modified: stable/11/sys/dev/mlx5/mlx5_core/mlx5_eq.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/mlx5/mlx5_core/mlx5_eq.c ============================================================================== --- stable/11/sys/dev/mlx5/mlx5_core/mlx5_eq.c Tue Feb 13 15:09:03 2018 (r329207) +++ stable/11/sys/dev/mlx5/mlx5_core/mlx5_eq.c Tue Feb 13 15:11:00 2018 (r329208) @@ -510,7 +510,7 @@ void mlx5_eq_cleanup(struct mlx5_core_dev *dev) int mlx5_start_eqs(struct mlx5_core_dev *dev) { struct mlx5_eq_table *table = &dev->priv.eq_table; - u32 async_event_mask = MLX5_ASYNC_EVENT_MASK; + u64 async_event_mask = MLX5_ASYNC_EVENT_MASK; int err; if (MLX5_CAP_GEN(dev, port_module_event)) From owner-svn-src-all@freebsd.org Tue Feb 13 15:13:16 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7DD80F08307; Tue, 13 Feb 2018 15:13:16 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2F6CE7D916; Tue, 13 Feb 2018 15:13:16 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2A59622740; Tue, 13 Feb 2018 15:13:16 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1DFDFwG024516; Tue, 13 Feb 2018 15:13:15 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1DFDFWi024514; Tue, 13 Feb 2018 15:13:15 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201802131513.w1DFDFWi024514@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Tue, 13 Feb 2018 15:13:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r329209 - in stable/11/sys/dev/mlx5: . mlx5_core X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in stable/11/sys/dev/mlx5: . mlx5_core X-SVN-Commit-Revision: 329209 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Feb 2018 15:13:16 -0000 Author: hselasky Date: Tue Feb 13 15:13:15 2018 New Revision: 329209 URL: https://svnweb.freebsd.org/changeset/base/329209 Log: MFC r325651: Set ATOMIC endian mode in mlx5 core. The hardware is capable of 2 requestor endianness modes for standard 8 byte atomics: BE (0x0) and host endianness (0x1). Read the supported modes from hca atomic capabilities and configure HW to host endianness mode if supported. Sponsored by: Mellanox Technologies Modified: stable/11/sys/dev/mlx5/mlx5_core/mlx5_main.c stable/11/sys/dev/mlx5/mlx5_ifc.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/mlx5/mlx5_core/mlx5_main.c ============================================================================== --- stable/11/sys/dev/mlx5/mlx5_core/mlx5_main.c Tue Feb 13 15:11:00 2018 (r329208) +++ stable/11/sys/dev/mlx5/mlx5_core/mlx5_main.c Tue Feb 13 15:13:15 2018 (r329209) @@ -74,6 +74,11 @@ struct mlx5_device_context { void *context; }; +enum { + MLX5_ATOMIC_REQ_MODE_BE = 0x0, + MLX5_ATOMIC_REQ_MODE_HOST_ENDIANNESS = 0x1, +}; + static struct mlx5_profile profiles[] = { [0] = { .mask = 0, @@ -393,6 +398,53 @@ query_ex: return err; } +static int handle_hca_cap_atomic(struct mlx5_core_dev *dev) +{ + void *set_ctx; + void *set_hca_cap; + int set_sz = MLX5_ST_SZ_BYTES(set_hca_cap_in); + int req_endianness; + int err; + + if (MLX5_CAP_GEN(dev, atomic)) { + err = mlx5_core_get_caps(dev, MLX5_CAP_ATOMIC, + HCA_CAP_OPMOD_GET_MAX); + if (err) + return err; + + err = mlx5_core_get_caps(dev, MLX5_CAP_ATOMIC, + HCA_CAP_OPMOD_GET_CUR); + if (err) + return err; + } else { + return 0; + } + + req_endianness = + MLX5_CAP_ATOMIC(dev, + supported_atomic_req_8B_endianess_mode_1); + + if (req_endianness != MLX5_ATOMIC_REQ_MODE_HOST_ENDIANNESS) + return 0; + + set_ctx = kzalloc(set_sz, GFP_KERNEL); + if (!set_ctx) + return -ENOMEM; + + MLX5_SET(set_hca_cap_in, set_ctx, op_mod, + MLX5_SET_HCA_CAP_OP_MOD_ATOMIC << 1); + set_hca_cap = MLX5_ADDR_OF(set_hca_cap_in, set_ctx, capability); + + /* Set requestor to host endianness */ + MLX5_SET(atomic_caps, set_hca_cap, atomic_req_8B_endianess_mode, + MLX5_ATOMIC_REQ_MODE_HOST_ENDIANNESS); + + err = set_caps(dev, set_ctx, set_sz); + + kfree(set_ctx); + return err; +} + static int set_hca_ctrl(struct mlx5_core_dev *dev) { struct mlx5_reg_host_endianess he_in; @@ -717,15 +769,21 @@ static int mlx5_dev_init(struct mlx5_core_dev *dev, st goto err_pagealloc_stop; } + err = set_hca_ctrl(dev); + if (err) { + device_printf((&pdev->dev)->bsddev, "ERR: ""set_hca_ctrl failed\n"); + goto reclaim_boot_pages; + } + err = handle_hca_cap(dev); if (err) { device_printf((&pdev->dev)->bsddev, "ERR: ""handle_hca_cap failed\n"); goto reclaim_boot_pages; } - err = set_hca_ctrl(dev); + err = handle_hca_cap_atomic(dev); if (err) { - device_printf((&pdev->dev)->bsddev, "ERR: ""set_hca_ctrl failed\n"); + device_printf((&pdev->dev)->bsddev, "ERR: ""handle_hca_cap_atomic failed\n"); goto reclaim_boot_pages; } Modified: stable/11/sys/dev/mlx5/mlx5_ifc.h ============================================================================== --- stable/11/sys/dev/mlx5/mlx5_ifc.h Tue Feb 13 15:11:00 2018 (r329208) +++ stable/11/sys/dev/mlx5/mlx5_ifc.h Tue Feb 13 15:13:15 2018 (r329209) @@ -74,6 +74,11 @@ enum { }; enum { + MLX5_SET_HCA_CAP_OP_MOD_GENERAL_DEVICE = 0x0, + MLX5_SET_HCA_CAP_OP_MOD_ATOMIC = 0x3, +}; + +enum { MLX5_CMD_OP_QUERY_HCA_CAP = 0x100, MLX5_CMD_OP_QUERY_ADAPTER = 0x101, MLX5_CMD_OP_INIT_HCA = 0x102, From owner-svn-src-all@freebsd.org Tue Feb 13 15:13:44 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 11698F083C0; Tue, 13 Feb 2018 15:13:44 +0000 (UTC) (envelope-from remko@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B761D7DA58; Tue, 13 Feb 2018 15:13:43 +0000 (UTC) (envelope-from remko@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B25C922741; Tue, 13 Feb 2018 15:13:43 +0000 (UTC) (envelope-from remko@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1DFDhGd024580; Tue, 13 Feb 2018 15:13:43 GMT (envelope-from remko@FreeBSD.org) Received: (from remko@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1DFDhce024578; Tue, 13 Feb 2018 15:13:43 GMT (envelope-from remko@FreeBSD.org) Message-Id: <201802131513.w1DFDhce024578@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: remko set sender to remko@FreeBSD.org using -f From: Remko Lodder Date: Tue, 13 Feb 2018 15:13:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329210 - head/share/misc X-SVN-Group: head X-SVN-Commit-Author: remko X-SVN-Commit-Paths: head/share/misc X-SVN-Commit-Revision: 329210 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Feb 2018 15:13:44 -0000 Author: remko Date: Tue Feb 13 15:13:43 2018 New Revision: 329210 URL: https://svnweb.freebsd.org/changeset/base/329210 Log: Update the secteam/security officer list to match reality. Modified: head/share/misc/organization.dot Modified: head/share/misc/organization.dot ============================================================================== --- head/share/misc/organization.dot Tue Feb 13 15:13:15 2018 (r329209) +++ head/share/misc/organization.dot Tue Feb 13 15:13:43 2018 (r329210) @@ -33,10 +33,10 @@ portscommitters [label="Ports Committers\nports-commit portmgr [label="Port Management Team\nportmgr@FreeBSD.org\nadamw, antoine, bapt, bdrewery\nfeld, mat, rene, swills"] portmgrsecretary [label="Port Management Team Secretary\nportmgr-secretary@FreeBSD.org\nrene"] re [label="Primary Release Engineering Team\nre@FreeBSD.org\ngjb, kib,\nbdrewery, blackend,\nrgrimes, delphij,\nhrs, glebius,\nmarius, rwatson"] -secteam [label="Security Team\nsecteam@FreeBSD.org\ndelphij,\ndes, gavin, gjb,\nglebius, remko"] +secteam [label="Security Team\nsecteam@FreeBSD.org\nbenno, delphij,\ndes, emaste,\ngjb, gordon,\nremko"] portssecteam [label="Ports Security Team\nports-secteam@FreeBSD.org\ndelphij, amdmi3, eadler, feld, jgh, rea, riggs, sbz, simon, swills, zi"] secteamsecretary [label="Security Team Secretary\nsecteam-secretary@FreeBSD.org\nremko"] -securityofficer [label="Security Officer Team\nsecurity-officer@FreeBSD.org\ndelphij, des,\ngavin, gjb,\nglebius, remko"] +securityofficer [label="Security Officer Team\nsecurity-officer@FreeBSD.org\nbenno, delphij,\ndes, emaste,\ngjb, gordon,\nremko"] srccommitters [label="Src Committers\nsrc-committers@FreeBSD.org"] # Admin teams go here alphabetically sorted From owner-svn-src-all@freebsd.org Tue Feb 13 15:14:33 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4E515F0852B; Tue, 13 Feb 2018 15:14:33 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 034DA7DBEE; Tue, 13 Feb 2018 15:14:33 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F26DD22742; Tue, 13 Feb 2018 15:14:32 +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 w1DFEWJH024660; Tue, 13 Feb 2018 15:14:32 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1DFEW76024659; Tue, 13 Feb 2018 15:14:32 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201802131514.w1DFEW76024659@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Tue, 13 Feb 2018 15:14:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r329211 - stable/11/sys/dev/mlx5/mlx5_core X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/11/sys/dev/mlx5/mlx5_core X-SVN-Commit-Revision: 329211 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Feb 2018 15:14:33 -0000 Author: hselasky Date: Tue Feb 13 15:14:32 2018 New Revision: 329211 URL: https://svnweb.freebsd.org/changeset/base/329211 Log: MFC r325652: Prevent mlx5 core from accessing host memory after shutdown by disabling PCI busmaster. Sponsored by: Mellanox Technologies Modified: stable/11/sys/dev/mlx5/mlx5_core/mlx5_main.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/mlx5/mlx5_core/mlx5_main.c ============================================================================== --- stable/11/sys/dev/mlx5/mlx5_core/mlx5_main.c Tue Feb 13 15:13:43 2018 (r329210) +++ stable/11/sys/dev/mlx5/mlx5_core/mlx5_main.c Tue Feb 13 15:14:32 2018 (r329211) @@ -1134,6 +1134,12 @@ static void remove_one(struct pci_dev *pdev) kfree(dev); } +static void shutdown_one(struct pci_dev *pdev) +{ + /* prevent device from accessing host memory after shutdown */ + pci_clear_master(pdev); +} + static const struct pci_device_id mlx5_core_pci_table[] = { { PCI_VDEVICE(MELLANOX, 4113) }, /* Connect-IB */ { PCI_VDEVICE(MELLANOX, 4114) }, /* Connect-IB VF */ @@ -1175,6 +1181,7 @@ MODULE_DEVICE_TABLE(pci, mlx5_core_pci_table); static struct pci_driver mlx5_core_driver = { .name = DRIVER_NAME, .id_table = mlx5_core_pci_table, + .shutdown = shutdown_one, .probe = init_one, .remove = remove_one }; From owner-svn-src-all@freebsd.org Tue Feb 13 15:16:11 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C1991F08783; Tue, 13 Feb 2018 15:16:11 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5DB417DDA7; Tue, 13 Feb 2018 15:16:11 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 52B2F22745; Tue, 13 Feb 2018 15:16:11 +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 w1DFGBkh024787; Tue, 13 Feb 2018 15:16:11 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1DFGBnb024785; Tue, 13 Feb 2018 15:16:11 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201802131516.w1DFGBnb024785@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Tue, 13 Feb 2018 15:16:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r329212 - in stable/11/sys/dev/mlx5: . mlx5_core X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in stable/11/sys/dev/mlx5: . mlx5_core X-SVN-Commit-Revision: 329212 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Feb 2018 15:16:11 -0000 Author: hselasky Date: Tue Feb 13 15:16:10 2018 New Revision: 329212 URL: https://svnweb.freebsd.org/changeset/base/329212 Log: MFC r325658: Make physical address of init segment available in the priv of mlx5 core. This change is needed by mlx5ib(4). Sponsored by: Mellanox Technologies Modified: stable/11/sys/dev/mlx5/driver.h stable/11/sys/dev/mlx5/mlx5_core/mlx5_main.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/mlx5/driver.h ============================================================================== --- stable/11/sys/dev/mlx5/driver.h Tue Feb 13 15:14:32 2018 (r329211) +++ stable/11/sys/dev/mlx5/driver.h Tue Feb 13 15:16:10 2018 (r329212) @@ -595,6 +595,7 @@ struct mlx5_core_dev { struct mlx5_port_caps port_caps[MLX5_MAX_PORTS]; u32 hca_caps_cur[MLX5_CAP_NUM][MLX5_UN_SZ_DW(hca_cap_union)]; u32 hca_caps_max[MLX5_CAP_NUM][MLX5_UN_SZ_DW(hca_cap_union)]; + phys_addr_t iseg_base; struct mlx5_init_seg __iomem *iseg; enum mlx5_device_state state; void (*event) (struct mlx5_core_dev *dev, Modified: stable/11/sys/dev/mlx5/mlx5_core/mlx5_main.c ============================================================================== --- stable/11/sys/dev/mlx5/mlx5_core/mlx5_main.c Tue Feb 13 15:14:32 2018 (r329211) +++ stable/11/sys/dev/mlx5/mlx5_core/mlx5_main.c Tue Feb 13 15:16:10 2018 (r329212) @@ -716,8 +716,8 @@ static int mlx5_dev_init(struct mlx5_core_dev *dev, st goto err_clr_master; } - dev->iseg = ioremap(pci_resource_start(dev->pdev, 0), - sizeof(*dev->iseg)); + dev->iseg_base = pci_resource_start(dev->pdev, 0); + dev->iseg = ioremap(dev->iseg_base, sizeof(*dev->iseg)); if (!dev->iseg) { err = -ENOMEM; device_printf((&pdev->dev)->bsddev, "ERR: ""Failed mapping initialization segment, aborting\n"); From owner-svn-src-all@freebsd.org Tue Feb 13 15:18:12 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 956D8F08A5B; Tue, 13 Feb 2018 15:18:12 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 473A57DF77; Tue, 13 Feb 2018 15:18:12 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3E0DB22747; Tue, 13 Feb 2018 15:18:12 +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 w1DFIBc1024905; Tue, 13 Feb 2018 15:18:11 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1DFIBNp024903; Tue, 13 Feb 2018 15:18:11 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201802131518.w1DFIBNp024903@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Tue, 13 Feb 2018 15:18:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r329213 - stable/11/sys/dev/mlx5/mlx5_core X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/11/sys/dev/mlx5/mlx5_core X-SVN-Commit-Revision: 329213 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Feb 2018 15:18:12 -0000 Author: hselasky Date: Tue Feb 13 15:18:11 2018 New Revision: 329213 URL: https://svnweb.freebsd.org/changeset/base/329213 Log: MFC r325654: Add API functions to modify the transport interface send object, TIS, in mlx5 core. Sponsored by: Mellanox Technologies Modified: stable/11/sys/dev/mlx5/mlx5_core/mlx5_transobj.c stable/11/sys/dev/mlx5/mlx5_core/transobj.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/mlx5/mlx5_core/mlx5_transobj.c ============================================================================== --- stable/11/sys/dev/mlx5/mlx5_core/mlx5_transobj.c Tue Feb 13 15:16:10 2018 (r329212) +++ stable/11/sys/dev/mlx5/mlx5_core/mlx5_transobj.c Tue Feb 13 15:18:11 2018 (r329213) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2013-2015, Mellanox Technologies, Ltd. All rights reserved. + * Copyright (c) 2013-2017, Mellanox Technologies, Ltd. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -208,6 +208,17 @@ int mlx5_core_create_tis(struct mlx5_core_dev *dev, u3 *tisn = MLX5_GET(create_tis_out, out, tisn); return err; +} + +int mlx5_core_modify_tis(struct mlx5_core_dev *dev, u32 tisn, u32 *in, + int inlen) +{ + u32 out[MLX5_ST_SZ_DW(modify_tis_out)] = {0}; + + MLX5_SET(modify_tis_in, in, tisn, tisn); + MLX5_SET(modify_tis_in, in, opcode, MLX5_CMD_OP_MODIFY_TIS); + + return mlx5_cmd_exec(dev, in, inlen, out, sizeof(out)); } void mlx5_core_destroy_tis(struct mlx5_core_dev *dev, u32 tisn) Modified: stable/11/sys/dev/mlx5/mlx5_core/transobj.h ============================================================================== --- stable/11/sys/dev/mlx5/mlx5_core/transobj.h Tue Feb 13 15:16:10 2018 (r329212) +++ stable/11/sys/dev/mlx5/mlx5_core/transobj.h Tue Feb 13 15:18:11 2018 (r329213) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2013-2015, Mellanox Technologies, Ltd. All rights reserved. + * Copyright (c) 2013-2017, Mellanox Technologies, Ltd. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -45,6 +45,8 @@ int mlx5_core_create_tir(struct mlx5_core_dev *dev, u3 void mlx5_core_destroy_tir(struct mlx5_core_dev *dev, u32 tirn); int mlx5_core_create_tis(struct mlx5_core_dev *dev, u32 *in, int inlen, u32 *tisn); +int mlx5_core_modify_tis(struct mlx5_core_dev *dev, u32 tisn, u32 *in, + int inlen); void mlx5_core_destroy_tis(struct mlx5_core_dev *dev, u32 tisn); int mlx5_core_create_rmp(struct mlx5_core_dev *dev, u32 *in, int inlen, u32 *rmpn); int mlx5_core_modify_rmp(struct mlx5_core_dev *dev, u32 *in, int inlen); From owner-svn-src-all@freebsd.org Tue Feb 13 15:30:32 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 216C6F09A5B; Tue, 13 Feb 2018 15:30:32 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C76717E6E5; Tue, 13 Feb 2018 15:30: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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C23EF228E4; Tue, 13 Feb 2018 15:30:31 +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 w1DFUVUv029952; Tue, 13 Feb 2018 15:30:31 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1DFUVJ3029950; Tue, 13 Feb 2018 15:30:31 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201802131530.w1DFUVJ3029950@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 13 Feb 2018 15:30:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329214 - in head/sys/x86: include x86 X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in head/sys/x86: include x86 X-SVN-Commit-Revision: 329214 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Feb 2018 15:30:32 -0000 Author: kib Date: Tue Feb 13 15:30:31 2018 New Revision: 329214 URL: https://svnweb.freebsd.org/changeset/base/329214 Log: Fix build with gas. Do not use C constant suffixes. Bit values are small enough to not require typing, despite they are used for 64bit MSR writes. The added cast in hw_ibrs_recalculate() is redundand but I prefer to add it for clarity. Reported by: bde Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/x86/include/specialreg.h head/sys/x86/x86/cpu_machdep.c Modified: head/sys/x86/include/specialreg.h ============================================================================== --- head/sys/x86/include/specialreg.h Tue Feb 13 15:18:11 2018 (r329213) +++ head/sys/x86/include/specialreg.h Tue Feb 13 15:30:31 2018 (r329214) @@ -702,8 +702,8 @@ * document 336996-001 Speculative Execution Side Channel Mitigations. */ /* MSR IA32_SPEC_CTRL */ -#define IA32_SPEC_CTRL_IBRS 0x0000000000000001ULL -#define IA32_SPEC_CTRL_STIBP 0x0000000000000002ULL +#define IA32_SPEC_CTRL_IBRS 0x00000001 +#define IA32_SPEC_CTRL_STIBP 0x00000002 /* MSR IA32_PRED_CMD */ #define IA32_PRED_CMD_IBPB_BARRIER 0x0000000000000001ULL Modified: head/sys/x86/x86/cpu_machdep.c ============================================================================== --- head/sys/x86/x86/cpu_machdep.c Tue Feb 13 15:18:11 2018 (r329213) +++ head/sys/x86/x86/cpu_machdep.c Tue Feb 13 15:30:31 2018 (r329214) @@ -592,7 +592,7 @@ hw_ibrs_recalculate(void) if ((cpu_ia32_arch_caps & IA32_ARCH_CAP_IBRS_ALL) != 0) { if (hw_ibrs_disable) { v= rdmsr(MSR_IA32_SPEC_CTRL); - v &= ~IA32_SPEC_CTRL_IBRS; + v &= ~(uint64_t)IA32_SPEC_CTRL_IBRS; wrmsr(MSR_IA32_SPEC_CTRL, v); } else { v= rdmsr(MSR_IA32_SPEC_CTRL); From owner-svn-src-all@freebsd.org Tue Feb 13 15:36:29 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 08DE5F0A311; Tue, 13 Feb 2018 15:36:29 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AF7E77EC95; Tue, 13 Feb 2018 15:36:28 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AA49622A8E; Tue, 13 Feb 2018 15:36:28 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1DFaSj0035082; Tue, 13 Feb 2018 15:36:28 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1DFaSbn035081; Tue, 13 Feb 2018 15:36:28 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201802131536.w1DFaSbn035081@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 13 Feb 2018 15:36:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329215 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 329215 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Feb 2018 15:36:29 -0000 Author: kib Date: Tue Feb 13 15:36:28 2018 New Revision: 329215 URL: https://svnweb.freebsd.org/changeset/base/329215 Log: Do not leak rv->psind in some specific situations. Suppose that we have an object with a mapped superpage, and that all pages in the superpages are held (by some driver). Additionally, suppose that the object is terminated, e.g. because the only process mapping it is exiting. Then the reservation is broken, but the pages cannot be freed until later, when they are unheld. In this situation, the reservation code cannot clean psind, since no pages are freed, and the page is freed and then reused with invalid psind. Clean psind on vm_reserv_break() to avoid the situation. Reported and tested by: Slava Shwartsman Reviewed by: markj Sponsored by: Mellanox Technologies MFC after: 1 week Differential revision: https://reviews.freebsd.org/D14335 Modified: head/sys/vm/vm_reserv.c Modified: head/sys/vm/vm_reserv.c ============================================================================== --- head/sys/vm/vm_reserv.c Tue Feb 13 15:30:31 2018 (r329214) +++ head/sys/vm/vm_reserv.c Tue Feb 13 15:36:28 2018 (r329215) @@ -949,6 +949,7 @@ vm_reserv_break(vm_reserv_t rv, vm_page_t m) vm_domain_free_assert_locked(VM_DOMAIN(rv->domain)); vm_reserv_remove(rv); + rv->pages->psind = 0; if (m != NULL) { /* * Since the reservation is being broken, there is no harm in From owner-svn-src-all@freebsd.org Tue Feb 13 15:44:36 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 993E0F0ACD1; Tue, 13 Feb 2018 15:44:36 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4B3957F3BA; Tue, 13 Feb 2018 15:44:36 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 460FD22C2F; Tue, 13 Feb 2018 15:44:36 +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 w1DFia9f039913; Tue, 13 Feb 2018 15:44:36 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1DFiaJ7039912; Tue, 13 Feb 2018 15:44:36 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201802131544.w1DFiaJ7039912@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 13 Feb 2018 15:44:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329216 - head/sys/compat/linuxkpi/common/include/linux X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 329216 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Feb 2018 15:44:36 -0000 Author: kib Date: Tue Feb 13 15:44:35 2018 New Revision: 329216 URL: https://svnweb.freebsd.org/changeset/base/329216 Log: linuxkpi: Do not leak pages on put. When the owner of the wire reference releases the last reference, it might be that the page was already attempted to be freed (but free cannot be performed at that time due to wire). Check that the page was removed from the object as the indicator of the free attempt and finish the free operation if so. Reported and tested by: Slava Shwartsman Reviewed by: hselasky Sponsored by: Mellanox Technologies MFC after: 1 week Modified: head/sys/compat/linuxkpi/common/include/linux/mm.h Modified: head/sys/compat/linuxkpi/common/include/linux/mm.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/mm.h Tue Feb 13 15:36:28 2018 (r329215) +++ head/sys/compat/linuxkpi/common/include/linux/mm.h Tue Feb 13 15:44:35 2018 (r329216) @@ -243,7 +243,8 @@ static inline void put_page(struct vm_page *page) { vm_page_lock(page); - vm_page_unwire(page, PQ_ACTIVE); + if (vm_page_unwire(page, PQ_ACTIVE) && page->object == NULL) + vm_page_free(page); vm_page_unlock(page); } From owner-svn-src-all@freebsd.org Tue Feb 13 15:55:32 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2BDF2F0BB34; Tue, 13 Feb 2018 15:55:32 +0000 (UTC) (envelope-from bryanv@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D0BA37FB71; Tue, 13 Feb 2018 15:55:31 +0000 (UTC) (envelope-from bryanv@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C772122DC3; Tue, 13 Feb 2018 15:55:31 +0000 (UTC) (envelope-from bryanv@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1DFtVsH044747; Tue, 13 Feb 2018 15:55:31 GMT (envelope-from bryanv@FreeBSD.org) Received: (from bryanv@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1DFtVYJ044746; Tue, 13 Feb 2018 15:55:31 GMT (envelope-from bryanv@FreeBSD.org) Message-Id: <201802131555.w1DFtVYJ044746@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bryanv set sender to bryanv@FreeBSD.org using -f From: Bryan Venteicher Date: Tue, 13 Feb 2018 15:55:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r329217 - stable/11/share/man/man9 X-SVN-Group: stable-11 X-SVN-Commit-Author: bryanv X-SVN-Commit-Paths: stable/11/share/man/man9 X-SVN-Commit-Revision: 329217 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Feb 2018 15:55:32 -0000 Author: bryanv Date: Tue Feb 13 15:55:31 2018 New Revision: 329217 URL: https://svnweb.freebsd.org/changeset/base/329217 Log: MFC 328917: Correct structure name used in bus_map_resource(9) example Modified: stable/11/share/man/man9/bus_map_resource.9 Directory Properties: stable/11/ (props changed) Modified: stable/11/share/man/man9/bus_map_resource.9 ============================================================================== --- stable/11/share/man/man9/bus_map_resource.9 Tue Feb 13 15:44:35 2018 (r329216) +++ stable/11/share/man/man9/bus_map_resource.9 Tue Feb 13 15:55:31 2018 (r329217) @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 20, 2016 +.Dd February 5, 2018 .Dt BUS_MAP_RESOURCE 9 .Os .Sh NAME @@ -143,16 +143,16 @@ reads the first 32-bit word: .Bd -literal struct resource *r; struct resource_map map; - struct resource_map_args args; + struct resource_map_request req; uint32_t val; int rid; rid = PCIR_BAR(0); r = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, RF_ACTIVE | RF_UNMAPPED); - resource_init_map_request(&args); - args.memattr = VM_MEMATTR_WRITE_COMBINING; - bus_map_resource(dev, SYS_RES_MEMORY, r, &args, &map); + resource_init_map_request(&req); + req.memattr = VM_MEMATTR_WRITE_COMBINING; + bus_map_resource(dev, SYS_RES_MEMORY, r, &req, &map); val = bus_read_4(&map, 0); .Ed .Sh SEE ALSO From owner-svn-src-all@freebsd.org Tue Feb 13 16:07:40 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 484CBF0CA92; Tue, 13 Feb 2018 16:07:40 +0000 (UTC) (envelope-from brd@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E9CE0802E2; Tue, 13 Feb 2018 16:07:39 +0000 (UTC) (envelope-from brd@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E48C322F7A; Tue, 13 Feb 2018 16:07:39 +0000 (UTC) (envelope-from brd@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1DG7dtB050208; Tue, 13 Feb 2018 16:07:39 GMT (envelope-from brd@FreeBSD.org) Received: (from brd@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1DG7dta050207; Tue, 13 Feb 2018 16:07:39 GMT (envelope-from brd@FreeBSD.org) Message-Id: <201802131607.w1DG7dta050207@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brd set sender to brd@FreeBSD.org using -f From: Brad Davis Date: Tue, 13 Feb 2018 16:07:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329218 - head/etc/rc.d X-SVN-Group: head X-SVN-Commit-Author: brd X-SVN-Commit-Paths: head/etc/rc.d X-SVN-Commit-Revision: 329218 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Feb 2018 16:07:40 -0000 Author: brd (doc,ports committer) Date: Tue Feb 13 16:07:39 2018 New Revision: 329218 URL: https://svnweb.freebsd.org/changeset/base/329218 Log: Fix resolv to run when it should and not when it should not.. Approved by: manu Reported by: manu Pointy hat to: brd Modified: head/etc/rc.d/resolv Modified: head/etc/rc.d/resolv ============================================================================== --- head/etc/rc.d/resolv Tue Feb 13 15:55:31 2018 (r329217) +++ head/etc/rc.d/resolv Tue Feb 13 16:07:39 2018 (r329218) @@ -34,12 +34,11 @@ . /etc/rc.subr name="resolv" +rcvar="resolv_enable" desc="Create /etc/resolv.conf from kenv" start_cmd="${name}_start" stop_cmd=':' -load_rc_config $name - # if the info is available via dhcp/kenv # build the resolv.conf # @@ -60,3 +59,5 @@ resolv_start() fi } +load_rc_config $name +run_rc_command "$1" From owner-svn-src-all@freebsd.org Tue Feb 13 16:25:44 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2A3F2F0E2CE; Tue, 13 Feb 2018 16:25:44 +0000 (UTC) (envelope-from royger@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CC9B1810A4; Tue, 13 Feb 2018 16:25:43 +0000 (UTC) (envelope-from royger@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C7932232C1; Tue, 13 Feb 2018 16:25:43 +0000 (UTC) (envelope-from royger@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1DGPhgf059731; Tue, 13 Feb 2018 16:25:43 GMT (envelope-from royger@FreeBSD.org) Received: (from royger@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1DGPhDf059730; Tue, 13 Feb 2018 16:25:43 GMT (envelope-from royger@FreeBSD.org) Message-Id: <201802131625.w1DGPhDf059730@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: royger set sender to royger@FreeBSD.org using -f From: =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= Date: Tue, 13 Feb 2018 16:25:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329219 - head X-SVN-Group: head X-SVN-Commit-Author: royger X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 329219 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Feb 2018 16:25:44 -0000 Author: royger Date: Tue Feb 13 16:25:43 2018 New Revision: 329219 URL: https://svnweb.freebsd.org/changeset/base/329219 Log: list myself in the MAINTAINERS file for Xen bits Modified: head/MAINTAINERS Modified: head/MAINTAINERS ============================================================================== --- head/MAINTAINERS Tue Feb 13 16:07:39 2018 (r329218) +++ head/MAINTAINERS Tue Feb 13 16:25:43 2018 (r329219) @@ -92,8 +92,11 @@ sys/dev/ixgbe erj Pre-commit phabricator review reques sys/dev/ixl erj Pre-commit phabricator review requested. sys/dev/sound/usb hselasky If in doubt, ask. sys/dev/usb hselasky If in doubt, ask. +sys/dev/xen royger Pre-commit review recommended. sys/netinet/ip_carp.c glebius Pre-commit review recommended. sys/netpfil/pf kp,glebius Pre-commit review recommended. +sys/x86/xen royger Pre-commit review recommended. +sys/xen royger Pre-commit review recommended. tests freebsd-testing,ngie Pre-commit review requested. usr.sbin/bsdconfig dteske Pre-commit phabricator review requested. usr.sbin/dpv dteske Pre-commit review requested. Keep in sync with libdpv. From owner-svn-src-all@freebsd.org Tue Feb 13 16:26:07 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5A7A2F0E362; Tue, 13 Feb 2018 16:26:07 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 08280811DB; Tue, 13 Feb 2018 16:26:07 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 032E6232C2; Tue, 13 Feb 2018 16:26:07 +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 w1DGQ6OY059794; Tue, 13 Feb 2018 16:26:06 GMT (envelope-from lwhsu@FreeBSD.org) Received: (from lwhsu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1DGQ6W0059792; Tue, 13 Feb 2018 16:26:06 GMT (envelope-from lwhsu@FreeBSD.org) Message-Id: <201802131626.w1DGQ6W0059792@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: lwhsu set sender to lwhsu@FreeBSD.org using -f From: Li-Wen Hsu Date: Tue, 13 Feb 2018 16:26:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329220 - in head/sys/dev: mpr mps X-SVN-Group: head X-SVN-Commit-Author: lwhsu X-SVN-Commit-Paths: in head/sys/dev: mpr mps X-SVN-Commit-Revision: 329220 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Feb 2018 16:26:07 -0000 Author: lwhsu (ports committer) Date: Tue Feb 13 16:26:06 2018 New Revision: 329220 URL: https://svnweb.freebsd.org/changeset/base/329220 Log: Fix non-64-bit platform build by printing bus_addr_t values using %#jx Reviewed by: slm Differential Revision: https://reviews.freebsd.org/D14344 Modified: head/sys/dev/mpr/mpr.c head/sys/dev/mps/mps.c Modified: head/sys/dev/mpr/mpr.c ============================================================================== --- head/sys/dev/mpr/mpr.c Tue Feb 13 16:25:43 2018 (r329219) +++ head/sys/dev/mpr/mpr.c Tue Feb 13 16:26:06 2018 (r329220) @@ -1356,10 +1356,10 @@ mpr_alloc_hw_queues(struct mpr_softc *sc) sc->free_busaddr = queues_busaddr; sc->post_queue = (MPI2_REPLY_DESCRIPTORS_UNION *)(queues + fqsize); sc->post_busaddr = queues_busaddr + fqsize; - mpr_dprint(sc, MPR_INIT, "free queue busaddr= %#016lx size= %d\n", - sc->free_busaddr, fqsize); - mpr_dprint(sc, MPR_INIT, "reply queue busaddr= %#016lx size= %d\n", - sc->post_busaddr, pqsize); + mpr_dprint(sc, MPR_INIT, "free queue busaddr= %#016jx size= %d\n", + (uintmax_t)sc->free_busaddr, fqsize); + mpr_dprint(sc, MPR_INIT, "reply queue busaddr= %#016jx size= %d\n", + (uintmax_t)sc->post_busaddr, pqsize); return (0); } @@ -1402,8 +1402,8 @@ mpr_alloc_replies(struct mpr_softc *sc) bzero(sc->reply_frames, rsize); bus_dmamap_load(sc->reply_dmat, sc->reply_map, sc->reply_frames, rsize, mpr_memaddr_cb, &sc->reply_busaddr, 0); - mpr_dprint(sc, MPR_INIT, "reply frames busaddr= %#016lx size= %d\n", - sc->reply_busaddr, rsize); + mpr_dprint(sc, MPR_INIT, "reply frames busaddr= %#016jx size= %d\n", + (uintmax_t)sc->reply_busaddr, rsize); return (0); } @@ -1438,8 +1438,8 @@ mpr_alloc_requests(struct mpr_softc *sc) bzero(sc->req_frames, rsize); bus_dmamap_load(sc->req_dmat, sc->req_map, sc->req_frames, rsize, mpr_memaddr_cb, &sc->req_busaddr, 0); - mpr_dprint(sc, MPR_INIT, "request frames busaddr= %#016lx size= %d\n", - sc->req_busaddr, rsize); + mpr_dprint(sc, MPR_INIT, "request frames busaddr= %#016jx size= %d\n", + (uintmax_t)sc->req_busaddr, rsize); rsize = sc->chain_frame_size * sc->num_chains; if (bus_dma_tag_create( sc->mpr_parent_dmat, /* parent */ @@ -1464,8 +1464,8 @@ mpr_alloc_requests(struct mpr_softc *sc) bzero(sc->chain_frames, rsize); bus_dmamap_load(sc->chain_dmat, sc->chain_map, sc->chain_frames, rsize, mpr_memaddr_cb, &sc->chain_busaddr, 0); - mpr_dprint(sc, MPR_INIT, "chain frames busaddr= %#016lx size= %d\n", - sc->chain_busaddr, rsize); + mpr_dprint(sc, MPR_INIT, "chain frames busaddr= %#016jx size= %d\n", + (uintmax_t)sc->chain_busaddr, rsize); rsize = MPR_SENSE_LEN * sc->num_reqs; if (bus_dma_tag_create( sc->mpr_parent_dmat, /* parent */ @@ -1490,8 +1490,8 @@ mpr_alloc_requests(struct mpr_softc *sc) bzero(sc->sense_frames, rsize); bus_dmamap_load(sc->sense_dmat, sc->sense_map, sc->sense_frames, rsize, mpr_memaddr_cb, &sc->sense_busaddr, 0); - mpr_dprint(sc, MPR_INIT, "sense frames busaddr= %#016lx size= %d\n", - sc->sense_busaddr, rsize); + mpr_dprint(sc, MPR_INIT, "sense frames busaddr= %#016jx size= %d\n", + (uintmax_t)sc->sense_busaddr, rsize); sc->chains = malloc(sizeof(struct mpr_chain) * sc->num_chains, M_MPR, M_WAITOK | M_ZERO); Modified: head/sys/dev/mps/mps.c ============================================================================== --- head/sys/dev/mps/mps.c Tue Feb 13 16:25:43 2018 (r329219) +++ head/sys/dev/mps/mps.c Tue Feb 13 16:26:06 2018 (r329220) @@ -1313,10 +1313,10 @@ mps_alloc_hw_queues(struct mps_softc *sc) sc->free_busaddr = queues_busaddr; sc->post_queue = (MPI2_REPLY_DESCRIPTORS_UNION *)(queues + fqsize); sc->post_busaddr = queues_busaddr + fqsize; - mps_dprint(sc, MPS_INIT, "free queue busaddr= %#016lx size= %d\n", - sc->free_busaddr, fqsize); - mps_dprint(sc, MPS_INIT, "reply queue busaddr= %#016lx size= %d\n", - sc->post_busaddr, pqsize); + mps_dprint(sc, MPS_INIT, "free queue busaddr= %#016jx size= %d\n", + (uintmax_t)sc->free_busaddr, fqsize); + mps_dprint(sc, MPS_INIT, "reply queue busaddr= %#016jx size= %d\n", + (uintmax_t)sc->post_busaddr, pqsize); return (0); } @@ -1360,8 +1360,8 @@ mps_alloc_replies(struct mps_softc *sc) bus_dmamap_load(sc->reply_dmat, sc->reply_map, sc->reply_frames, rsize, mps_memaddr_cb, &sc->reply_busaddr, 0); - mps_dprint(sc, MPS_INIT, "reply frames busaddr= %#016lx size= %d\n", - sc->reply_busaddr, rsize); + mps_dprint(sc, MPS_INIT, "reply frames busaddr= %#016jx size= %d\n", + (uintmax_t)sc->reply_busaddr, rsize); return (0); } @@ -1396,8 +1396,8 @@ mps_alloc_requests(struct mps_softc *sc) bzero(sc->req_frames, rsize); bus_dmamap_load(sc->req_dmat, sc->req_map, sc->req_frames, rsize, mps_memaddr_cb, &sc->req_busaddr, 0); - mps_dprint(sc, MPS_INIT, "request frames busaddr= %#016lx size= %d\n", - sc->req_busaddr, rsize); + mps_dprint(sc, MPS_INIT, "request frames busaddr= %#016jx size= %d\n", + (uintmax_t)sc->req_busaddr, rsize); rsize = sc->reqframesz * sc->num_chains; if (bus_dma_tag_create( sc->mps_parent_dmat, /* parent */ @@ -1422,8 +1422,8 @@ mps_alloc_requests(struct mps_softc *sc) bzero(sc->chain_frames, rsize); bus_dmamap_load(sc->chain_dmat, sc->chain_map, sc->chain_frames, rsize, mps_memaddr_cb, &sc->chain_busaddr, 0); - mps_dprint(sc, MPS_INIT, "chain frames busaddr= %#016lx size= %d\n", - sc->chain_busaddr, rsize); + mps_dprint(sc, MPS_INIT, "chain frames busaddr= %#016jx size= %d\n", + (uintmax_t)sc->chain_busaddr, rsize); rsize = MPS_SENSE_LEN * sc->num_reqs; if (bus_dma_tag_create( sc->mps_parent_dmat, /* parent */ @@ -1448,8 +1448,8 @@ mps_alloc_requests(struct mps_softc *sc) bzero(sc->sense_frames, rsize); bus_dmamap_load(sc->sense_dmat, sc->sense_map, sc->sense_frames, rsize, mps_memaddr_cb, &sc->sense_busaddr, 0); - mps_dprint(sc, MPS_INIT, "sense frames busaddr= %#016lx size= %d\n", - sc->sense_busaddr, rsize); + mps_dprint(sc, MPS_INIT, "sense frames busaddr= %#016jx size= %d\n", + (uintmax_t)sc->sense_busaddr, rsize); sc->chains = malloc(sizeof(struct mps_chain) * sc->num_chains, M_MPT2, M_WAITOK | M_ZERO); From owner-svn-src-all@freebsd.org Tue Feb 13 16:48:58 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 656DAF0FF0F; Tue, 13 Feb 2018 16:48:58 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1A936823FC; Tue, 13 Feb 2018 16:48:58 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1253E23681; Tue, 13 Feb 2018 16:48:58 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1DGmvUn070373; Tue, 13 Feb 2018 16:48:57 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1DGmvAr070372; Tue, 13 Feb 2018 16:48:57 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201802131648.w1DGmvAr070372@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Tue, 13 Feb 2018 16:48:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329221 - head/bin/sh X-SVN-Group: head X-SVN-Commit-Author: bdrewery X-SVN-Commit-Paths: head/bin/sh X-SVN-Commit-Revision: 329221 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Feb 2018 16:48:58 -0000 Author: bdrewery Date: Tue Feb 13 16:48:57 2018 New Revision: 329221 URL: https://svnweb.freebsd.org/changeset/base/329221 Log: Allow overriding VTABSIZE at compile-time. Reviewed by: jilles Differential Revision: https://reviews.freebsd.org/D14339 Modified: head/bin/sh/var.c Modified: head/bin/sh/var.c ============================================================================== --- head/bin/sh/var.c Tue Feb 13 16:26:06 2018 (r329220) +++ head/bin/sh/var.c Tue Feb 13 16:48:57 2018 (r329221) @@ -71,7 +71,9 @@ __FBSDID("$FreeBSD$"); #endif +#ifndef VTABSIZE #define VTABSIZE 39 +#endif struct varinit { From owner-svn-src-all@freebsd.org Tue Feb 13 17:04:36 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 09912F11621; Tue, 13 Feb 2018 17:04:35 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9C6E683F9D; Tue, 13 Feb 2018 17:04:35 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7D0C6239C1; Tue, 13 Feb 2018 17:04:35 +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 w1DH4ZjA082090; Tue, 13 Feb 2018 17:04:35 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1DH4YZN082083; Tue, 13 Feb 2018 17:04:34 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201802131704.w1DH4YZN082083@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Tue, 13 Feb 2018 17:04:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329222 - in head/sys: amd64/conf conf dev/mthca i386/conf modules modules/mthca ofed/include/uapi/rdma X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in head/sys: amd64/conf conf dev/mthca i386/conf modules modules/mthca ofed/include/uapi/rdma X-SVN-Commit-Revision: 329222 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Feb 2018 17:04:36 -0000 Author: hselasky Date: Tue Feb 13 17:04:34 2018 New Revision: 329222 URL: https://svnweb.freebsd.org/changeset/base/329222 Log: Import the mthca kernel side infiniband driver from Linux 4.9 and fix compilation under FreeBSD. The mthca driver was temporarily removed as part of the Linux 4.9 RoCE/infinband upgrade. Top commit in Linux source tree: 69973b830859bc6529a7a0468ba0d80ee5117826 Sponsored by: Mellanox Technologies Added: head/sys/dev/mthca/ head/sys/dev/mthca/mthca_allocator.c (contents, props changed) head/sys/dev/mthca/mthca_av.c (contents, props changed) head/sys/dev/mthca/mthca_catas.c (contents, props changed) head/sys/dev/mthca/mthca_cmd.c (contents, props changed) head/sys/dev/mthca/mthca_cmd.h (contents, props changed) head/sys/dev/mthca/mthca_config_reg.h (contents, props changed) head/sys/dev/mthca/mthca_cq.c (contents, props changed) head/sys/dev/mthca/mthca_dev.h (contents, props changed) head/sys/dev/mthca/mthca_doorbell.h (contents, props changed) head/sys/dev/mthca/mthca_eq.c (contents, props changed) head/sys/dev/mthca/mthca_mad.c (contents, props changed) head/sys/dev/mthca/mthca_main.c (contents, props changed) head/sys/dev/mthca/mthca_mcg.c (contents, props changed) head/sys/dev/mthca/mthca_memfree.c (contents, props changed) head/sys/dev/mthca/mthca_memfree.h (contents, props changed) head/sys/dev/mthca/mthca_mr.c (contents, props changed) head/sys/dev/mthca/mthca_pd.c (contents, props changed) head/sys/dev/mthca/mthca_profile.c (contents, props changed) head/sys/dev/mthca/mthca_profile.h (contents, props changed) head/sys/dev/mthca/mthca_provider.c (contents, props changed) head/sys/dev/mthca/mthca_provider.h (contents, props changed) head/sys/dev/mthca/mthca_qp.c (contents, props changed) head/sys/dev/mthca/mthca_reset.c (contents, props changed) head/sys/dev/mthca/mthca_srq.c (contents, props changed) head/sys/dev/mthca/mthca_uar.c (contents, props changed) head/sys/dev/mthca/mthca_user.h (contents, props changed) head/sys/dev/mthca/mthca_wqe.h (contents, props changed) head/sys/modules/mthca/ head/sys/modules/mthca/Makefile (contents, props changed) head/sys/ofed/include/uapi/rdma/mthca-abi.h (contents, props changed) Modified: head/sys/amd64/conf/NOTES head/sys/conf/files head/sys/i386/conf/NOTES head/sys/modules/Makefile Modified: head/sys/amd64/conf/NOTES ============================================================================== --- head/sys/amd64/conf/NOTES Tue Feb 13 16:48:57 2018 (r329221) +++ head/sys/amd64/conf/NOTES Tue Feb 13 17:04:34 2018 (r329222) @@ -315,6 +315,7 @@ options DRM_DEBUG # Include debug printfs (slow) # Requires the iwn firmware module # ixl: Intel XL710 40Gbe PCIE Ethernet # ixlv: Intel XL710 40Gbe VF PCIE Ethernet +# mthca: Mellanox HCA InfiniBand # mlx4ib: Mellanox ConnectX HCA InfiniBand # mlx4en: Mellanox ConnectX HCA Ethernet # nfe: nVidia nForce MCP on-board Ethernet Networking (BSD open source) @@ -334,6 +335,7 @@ device iwn # Intel 4965/1000/5000/6000 wireless NICs device ixl # Intel XL710 40Gbe PCIE Ethernet options IXL_IW # Enable iWARP Client Interface in ixl(4) device ixlv # Intel XL710 40Gbe VF PCIE Ethernet +device mthca # Mellanox HCA InfiniBand device mlx4 # Shared code module between IB and Ethernet device mlx4ib # Mellanox ConnectX HCA InfiniBand device mlx4en # Mellanox ConnectX HCA Ethernet Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Tue Feb 13 16:48:57 2018 (r329221) +++ head/sys/conf/files Tue Feb 13 17:04:34 2018 (r329222) @@ -4551,6 +4551,43 @@ ofed/drivers/infiniband/ulp/sdp/sdp_cma.c optional sdp ofed/drivers/infiniband/ulp/sdp/sdp_tx.c optional sdp inet \ compile-with "${OFED_C} -I$S/ofed/drivers/infiniband/ulp/sdp/" +dev/mthca/mthca_allocator.c optional mthca pci ofed \ + compile-with "${OFED_C}" +dev/mthca/mthca_av.c optional mthca pci ofed \ + compile-with "${OFED_C}" +dev/mthca/mthca_catas.c optional mthca pci ofed \ + compile-with "${OFED_C}" +dev/mthca/mthca_cmd.c optional mthca pci ofed \ + compile-with "${OFED_C}" +dev/mthca/mthca_cq.c optional mthca pci ofed \ + compile-with "${OFED_C}" +dev/mthca/mthca_eq.c optional mthca pci ofed \ + compile-with "${OFED_C}" +dev/mthca/mthca_mad.c optional mthca pci ofed \ + compile-with "${OFED_C}" +dev/mthca/mthca_main.c optional mthca pci ofed \ + compile-with "${OFED_C}" +dev/mthca/mthca_mcg.c optional mthca pci ofed \ + compile-with "${OFED_C}" +dev/mthca/mthca_memfree.c optional mthca pci ofed \ + compile-with "${OFED_C}" +dev/mthca/mthca_mr.c optional mthca pci ofed \ + compile-with "${OFED_C}" +dev/mthca/mthca_pd.c optional mthca pci ofed \ + compile-with "${OFED_C}" +dev/mthca/mthca_profile.c optional mthca pci ofed \ + compile-with "${OFED_C}" +dev/mthca/mthca_provider.c optional mthca pci ofed \ + compile-with "${OFED_C}" +dev/mthca/mthca_qp.c optional mthca pci ofed \ + compile-with "${OFED_C}" +dev/mthca/mthca_reset.c optional mthca pci ofed \ + compile-with "${OFED_C}" +dev/mthca/mthca_srq.c optional mthca pci ofed \ + compile-with "${OFED_C}" +dev/mthca/mthca_uar.c optional mthca pci ofed \ + compile-with "${OFED_C}" + dev/mlx4/mlx4_ib/mlx4_ib_alias_GUID.c optional mlx4ib pci ofed \ compile-with "${OFED_C}" dev/mlx4/mlx4_ib/mlx4_ib_mcg.c optional mlx4ib pci ofed \ Added: head/sys/dev/mthca/mthca_allocator.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/mthca/mthca_allocator.c Tue Feb 13 17:04:34 2018 (r329222) @@ -0,0 +1,301 @@ +/* + * Copyright (c) 2004 Topspin Communications. All rights reserved. + * + * This software is available to you under a choice of one of two + * licenses. You may choose to be licensed under the terms of the GNU + * General Public License (GPL) Version 2, available from the file + * COPYING in the main directory of this source tree, or the + * OpenIB.org BSD license below: + * + * Redistribution and use in source and binary forms, with or + * without modification, are permitted provided that the following + * conditions are met: + * + * - Redistributions of source code must retain the above + * copyright notice, this list of conditions and the following + * disclaimer. + * + * - 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. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS + * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +#include +#include +#include + +#include "mthca_dev.h" + +/* Trivial bitmap-based allocator */ +u32 mthca_alloc(struct mthca_alloc *alloc) +{ + unsigned long flags; + u32 obj; + + spin_lock_irqsave(&alloc->lock, flags); + + obj = find_next_zero_bit(alloc->table, alloc->max, alloc->last); + if (obj >= alloc->max) { + alloc->top = (alloc->top + alloc->max) & alloc->mask; + obj = find_first_zero_bit(alloc->table, alloc->max); + } + + if (obj < alloc->max) { + set_bit(obj, alloc->table); + obj |= alloc->top; + } else + obj = -1; + + spin_unlock_irqrestore(&alloc->lock, flags); + + return obj; +} + +void mthca_free(struct mthca_alloc *alloc, u32 obj) +{ + unsigned long flags; + + obj &= alloc->max - 1; + + spin_lock_irqsave(&alloc->lock, flags); + + clear_bit(obj, alloc->table); + alloc->last = min(alloc->last, obj); + alloc->top = (alloc->top + alloc->max) & alloc->mask; + + spin_unlock_irqrestore(&alloc->lock, flags); +} + +int mthca_alloc_init(struct mthca_alloc *alloc, u32 num, u32 mask, + u32 reserved) +{ + int i; + + /* num must be a power of 2 */ + if (num != 1 << (ffs(num) - 1)) + return -EINVAL; + + alloc->last = 0; + alloc->top = 0; + alloc->max = num; + alloc->mask = mask; + spin_lock_init(&alloc->lock); + alloc->table = kmalloc(BITS_TO_LONGS(num) * sizeof (long), + GFP_KERNEL); + if (!alloc->table) + return -ENOMEM; + + bitmap_zero(alloc->table, num); + for (i = 0; i < reserved; ++i) + set_bit(i, alloc->table); + + return 0; +} + +void mthca_alloc_cleanup(struct mthca_alloc *alloc) +{ + kfree(alloc->table); +} + +/* + * Array of pointers with lazy allocation of leaf pages. Callers of + * _get, _set and _clear methods must use a lock or otherwise + * serialize access to the array. + */ + +#define MTHCA_ARRAY_MASK (PAGE_SIZE / sizeof (void *) - 1) + +void *mthca_array_get(struct mthca_array *array, int index) +{ + int p = (index * sizeof (void *)) >> PAGE_SHIFT; + + if (array->page_list[p].page) + return array->page_list[p].page[index & MTHCA_ARRAY_MASK]; + else + return NULL; +} + +int mthca_array_set(struct mthca_array *array, int index, void *value) +{ + int p = (index * sizeof (void *)) >> PAGE_SHIFT; + + /* Allocate with GFP_ATOMIC because we'll be called with locks held. */ + if (!array->page_list[p].page) + array->page_list[p].page = (void **) get_zeroed_page(GFP_ATOMIC); + + if (!array->page_list[p].page) + return -ENOMEM; + + array->page_list[p].page[index & MTHCA_ARRAY_MASK] = value; + ++array->page_list[p].used; + + return 0; +} + +void mthca_array_clear(struct mthca_array *array, int index) +{ + int p = (index * sizeof (void *)) >> PAGE_SHIFT; + + if (--array->page_list[p].used == 0) { + free_page((unsigned long) array->page_list[p].page); + array->page_list[p].page = NULL; + } else + array->page_list[p].page[index & MTHCA_ARRAY_MASK] = NULL; + + if (array->page_list[p].used < 0) + pr_debug("Array %p index %d page %d with ref count %d < 0\n", + array, index, p, array->page_list[p].used); +} + +int mthca_array_init(struct mthca_array *array, int nent) +{ + int npage = (nent * sizeof (void *) + PAGE_SIZE - 1) / PAGE_SIZE; + int i; + + array->page_list = kmalloc(npage * sizeof *array->page_list, GFP_KERNEL); + if (!array->page_list) + return -ENOMEM; + + for (i = 0; i < npage; ++i) { + array->page_list[i].page = NULL; + array->page_list[i].used = 0; + } + + return 0; +} + +void mthca_array_cleanup(struct mthca_array *array, int nent) +{ + int i; + + for (i = 0; i < (nent * sizeof (void *) + PAGE_SIZE - 1) / PAGE_SIZE; ++i) + free_page((unsigned long) array->page_list[i].page); + + kfree(array->page_list); +} + +/* + * Handling for queue buffers -- we allocate a bunch of memory and + * register it in a memory region at HCA virtual address 0. If the + * requested size is > max_direct, we split the allocation into + * multiple pages, so we don't require too much contiguous memory. + */ + +int mthca_buf_alloc(struct mthca_dev *dev, int size, int max_direct, + union mthca_buf *buf, int *is_direct, struct mthca_pd *pd, + int hca_write, struct mthca_mr *mr) +{ + int err = -ENOMEM; + int npages, shift; + u64 *dma_list = NULL; + dma_addr_t t; + int i; + + if (size <= max_direct) { + *is_direct = 1; + npages = 1; + shift = get_order(size) + PAGE_SHIFT; + + buf->direct.buf = dma_alloc_coherent(&dev->pdev->dev, + size, &t, GFP_KERNEL); + if (!buf->direct.buf) + return -ENOMEM; + + dma_unmap_addr_set(&buf->direct, mapping, t); + + memset(buf->direct.buf, 0, size); + + while (t & ((1 << shift) - 1)) { + --shift; + npages *= 2; + } + + dma_list = kmalloc(npages * sizeof *dma_list, GFP_KERNEL); + if (!dma_list) + goto err_free; + + for (i = 0; i < npages; ++i) + dma_list[i] = t + i * (1 << shift); + } else { + *is_direct = 0; + npages = (size + PAGE_SIZE - 1) / PAGE_SIZE; + shift = PAGE_SHIFT; + + dma_list = kmalloc(npages * sizeof *dma_list, GFP_KERNEL); + if (!dma_list) + return -ENOMEM; + + buf->page_list = kmalloc(npages * sizeof *buf->page_list, + GFP_KERNEL); + if (!buf->page_list) + goto err_out; + + for (i = 0; i < npages; ++i) + buf->page_list[i].buf = NULL; + + for (i = 0; i < npages; ++i) { + buf->page_list[i].buf = + dma_alloc_coherent(&dev->pdev->dev, PAGE_SIZE, + &t, GFP_KERNEL); + if (!buf->page_list[i].buf) + goto err_free; + + dma_list[i] = t; + dma_unmap_addr_set(&buf->page_list[i], mapping, t); + + clear_page(buf->page_list[i].buf); + } + } + + err = mthca_mr_alloc_phys(dev, pd->pd_num, + dma_list, shift, npages, + 0, size, + MTHCA_MPT_FLAG_LOCAL_READ | + (hca_write ? MTHCA_MPT_FLAG_LOCAL_WRITE : 0), + mr); + if (err) + goto err_free; + + kfree(dma_list); + + return 0; + +err_free: + mthca_buf_free(dev, size, buf, *is_direct, NULL); + +err_out: + kfree(dma_list); + + return err; +} + +void mthca_buf_free(struct mthca_dev *dev, int size, union mthca_buf *buf, + int is_direct, struct mthca_mr *mr) +{ + int i; + + if (mr) + mthca_free_mr(dev, mr); + + if (is_direct) + dma_free_coherent(&dev->pdev->dev, size, buf->direct.buf, + dma_unmap_addr(&buf->direct, mapping)); + else { + for (i = 0; i < (size + PAGE_SIZE - 1) / PAGE_SIZE; ++i) + dma_free_coherent(&dev->pdev->dev, PAGE_SIZE, + buf->page_list[i].buf, + dma_unmap_addr(&buf->page_list[i], + mapping)); + kfree(buf->page_list); + } +} Added: head/sys/dev/mthca/mthca_av.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/mthca/mthca_av.c Tue Feb 13 17:04:34 2018 (r329222) @@ -0,0 +1,374 @@ +/* + * Copyright (c) 2004 Topspin Communications. All rights reserved. + * Copyright (c) 2005 Sun Microsystems, Inc. All rights reserved. + * + * This software is available to you under a choice of one of two + * licenses. You may choose to be licensed under the terms of the GNU + * General Public License (GPL) Version 2, available from the file + * COPYING in the main directory of this source tree, or the + * OpenIB.org BSD license below: + * + * Redistribution and use in source and binary forms, with or + * without modification, are permitted provided that the following + * conditions are met: + * + * - Redistributions of source code must retain the above + * copyright notice, this list of conditions and the following + * disclaimer. + * + * - 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. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS + * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +#include +#include + +#include +#include + +#include "mthca_dev.h" + +enum { + MTHCA_RATE_TAVOR_FULL = 0, + MTHCA_RATE_TAVOR_1X = 1, + MTHCA_RATE_TAVOR_4X = 2, + MTHCA_RATE_TAVOR_1X_DDR = 3 +}; + +enum { + MTHCA_RATE_MEMFREE_FULL = 0, + MTHCA_RATE_MEMFREE_QUARTER = 1, + MTHCA_RATE_MEMFREE_EIGHTH = 2, + MTHCA_RATE_MEMFREE_HALF = 3 +}; + +struct mthca_av { + __be32 port_pd; + u8 reserved1; + u8 g_slid; + __be16 dlid; + u8 reserved2; + u8 gid_index; + u8 msg_sr; + u8 hop_limit; + __be32 sl_tclass_flowlabel; + __be32 dgid[4]; +}; + +static enum ib_rate memfree_rate_to_ib(u8 mthca_rate, u8 port_rate) +{ + switch (mthca_rate) { + case MTHCA_RATE_MEMFREE_EIGHTH: + return mult_to_ib_rate(port_rate >> 3); + case MTHCA_RATE_MEMFREE_QUARTER: + return mult_to_ib_rate(port_rate >> 2); + case MTHCA_RATE_MEMFREE_HALF: + return mult_to_ib_rate(port_rate >> 1); + case MTHCA_RATE_MEMFREE_FULL: + default: + return mult_to_ib_rate(port_rate); + } +} + +static enum ib_rate tavor_rate_to_ib(u8 mthca_rate, u8 port_rate) +{ + switch (mthca_rate) { + case MTHCA_RATE_TAVOR_1X: return IB_RATE_2_5_GBPS; + case MTHCA_RATE_TAVOR_1X_DDR: return IB_RATE_5_GBPS; + case MTHCA_RATE_TAVOR_4X: return IB_RATE_10_GBPS; + default: return mult_to_ib_rate(port_rate); + } +} + +enum ib_rate mthca_rate_to_ib(struct mthca_dev *dev, u8 mthca_rate, u8 port) +{ + if (mthca_is_memfree(dev)) { + /* Handle old Arbel FW */ + if (dev->limits.stat_rate_support == 0x3 && mthca_rate) + return IB_RATE_2_5_GBPS; + + return memfree_rate_to_ib(mthca_rate, dev->rate[port - 1]); + } else + return tavor_rate_to_ib(mthca_rate, dev->rate[port - 1]); +} + +static u8 ib_rate_to_memfree(u8 req_rate, u8 cur_rate) +{ + if (cur_rate <= req_rate) + return 0; + + /* + * Inter-packet delay (IPD) to get from rate X down to a rate + * no more than Y is (X - 1) / Y. + */ + switch ((cur_rate - 1) / req_rate) { + case 0: return MTHCA_RATE_MEMFREE_FULL; + case 1: return MTHCA_RATE_MEMFREE_HALF; + case 2: /* fall through */ + case 3: return MTHCA_RATE_MEMFREE_QUARTER; + default: return MTHCA_RATE_MEMFREE_EIGHTH; + } +} + +static u8 ib_rate_to_tavor(u8 static_rate) +{ + switch (static_rate) { + case IB_RATE_2_5_GBPS: return MTHCA_RATE_TAVOR_1X; + case IB_RATE_5_GBPS: return MTHCA_RATE_TAVOR_1X_DDR; + case IB_RATE_10_GBPS: return MTHCA_RATE_TAVOR_4X; + default: return MTHCA_RATE_TAVOR_FULL; + } +} + +u8 mthca_get_rate(struct mthca_dev *dev, int static_rate, u8 port) +{ + u8 rate; + + if (!static_rate || ib_rate_to_mult(static_rate) >= dev->rate[port - 1]) + return 0; + + if (mthca_is_memfree(dev)) + rate = ib_rate_to_memfree(ib_rate_to_mult(static_rate), + dev->rate[port - 1]); + else + rate = ib_rate_to_tavor(static_rate); + + if (!(dev->limits.stat_rate_support & (1 << rate))) + rate = 1; + + return rate; +} + +int mthca_create_ah(struct mthca_dev *dev, + struct mthca_pd *pd, + struct ib_ah_attr *ah_attr, + struct mthca_ah *ah) +{ + u32 index = -1; + struct mthca_av *av = NULL; + + ah->type = MTHCA_AH_PCI_POOL; + + if (mthca_is_memfree(dev)) { + ah->av = kmalloc(sizeof *ah->av, GFP_ATOMIC); + if (!ah->av) + return -ENOMEM; + + ah->type = MTHCA_AH_KMALLOC; + av = ah->av; + } else if (!atomic_read(&pd->sqp_count) && + !(dev->mthca_flags & MTHCA_FLAG_DDR_HIDDEN)) { + index = mthca_alloc(&dev->av_table.alloc); + + /* fall back to allocate in host memory */ + if (index == -1) + goto on_hca_fail; + + av = kmalloc(sizeof *av, GFP_ATOMIC); + if (!av) + goto on_hca_fail; + + ah->type = MTHCA_AH_ON_HCA; + ah->avdma = dev->av_table.ddr_av_base + + index * MTHCA_AV_SIZE; + } + +on_hca_fail: + if (ah->type == MTHCA_AH_PCI_POOL) { + ah->av = pci_pool_alloc(dev->av_table.pool, + GFP_ATOMIC, &ah->avdma); + if (!ah->av) + return -ENOMEM; + + av = ah->av; + } + + ah->key = pd->ntmr.ibmr.lkey; + + memset(av, 0, MTHCA_AV_SIZE); + + av->port_pd = cpu_to_be32(pd->pd_num | (ah_attr->port_num << 24)); + av->g_slid = ah_attr->src_path_bits; + av->dlid = cpu_to_be16(ah_attr->dlid); + av->msg_sr = (3 << 4) | /* 2K message */ + mthca_get_rate(dev, ah_attr->static_rate, ah_attr->port_num); + av->sl_tclass_flowlabel = cpu_to_be32(ah_attr->sl << 28); + if (ah_attr->ah_flags & IB_AH_GRH) { + av->g_slid |= 0x80; + av->gid_index = (ah_attr->port_num - 1) * dev->limits.gid_table_len + + ah_attr->grh.sgid_index; + av->hop_limit = ah_attr->grh.hop_limit; + av->sl_tclass_flowlabel |= + cpu_to_be32((ah_attr->grh.traffic_class << 20) | + ah_attr->grh.flow_label); + memcpy(av->dgid, ah_attr->grh.dgid.raw, 16); + } else { + /* Arbel workaround -- low byte of GID must be 2 */ + av->dgid[3] = cpu_to_be32(2); + } + + if (0) { + int j; + + mthca_dbg(dev, "Created UDAV at %p/%08lx:\n", + av, (unsigned long) ah->avdma); + for (j = 0; j < 8; ++j) + printk(KERN_DEBUG " [%2x] %08x\n", + j * 4, be32_to_cpu(((__be32 *) av)[j])); + } + + if (ah->type == MTHCA_AH_ON_HCA) { + memcpy_toio(dev->av_table.av_map + index * MTHCA_AV_SIZE, + av, MTHCA_AV_SIZE); + kfree(av); + } + + return 0; +} + +int mthca_destroy_ah(struct mthca_dev *dev, struct mthca_ah *ah) +{ + switch (ah->type) { + case MTHCA_AH_ON_HCA: + mthca_free(&dev->av_table.alloc, + (ah->avdma - dev->av_table.ddr_av_base) / + MTHCA_AV_SIZE); + break; + + case MTHCA_AH_PCI_POOL: + pci_pool_free(dev->av_table.pool, ah->av, ah->avdma); + break; + + case MTHCA_AH_KMALLOC: + kfree(ah->av); + break; + } + + return 0; +} + +int mthca_ah_grh_present(struct mthca_ah *ah) +{ + return !!(ah->av->g_slid & 0x80); +} + +int mthca_read_ah(struct mthca_dev *dev, struct mthca_ah *ah, + struct ib_ud_header *header) +{ + if (ah->type == MTHCA_AH_ON_HCA) + return -EINVAL; + + header->lrh.service_level = be32_to_cpu(ah->av->sl_tclass_flowlabel) >> 28; + header->lrh.destination_lid = ah->av->dlid; + header->lrh.source_lid = cpu_to_be16(ah->av->g_slid & 0x7f); + if (mthca_ah_grh_present(ah)) { + header->grh.traffic_class = + (be32_to_cpu(ah->av->sl_tclass_flowlabel) >> 20) & 0xff; + header->grh.flow_label = + ah->av->sl_tclass_flowlabel & cpu_to_be32(0xfffff); + header->grh.hop_limit = ah->av->hop_limit; + ib_get_cached_gid(&dev->ib_dev, + be32_to_cpu(ah->av->port_pd) >> 24, + ah->av->gid_index % dev->limits.gid_table_len, + &header->grh.source_gid, NULL); + memcpy(header->grh.destination_gid.raw, + ah->av->dgid, 16); + } + + return 0; +} + +int mthca_ah_query(struct ib_ah *ibah, struct ib_ah_attr *attr) +{ + struct mthca_ah *ah = to_mah(ibah); + struct mthca_dev *dev = to_mdev(ibah->device); + + /* Only implement for MAD and memfree ah for now. */ + if (ah->type == MTHCA_AH_ON_HCA) + return -ENOSYS; + + memset(attr, 0, sizeof *attr); + attr->dlid = be16_to_cpu(ah->av->dlid); + attr->sl = be32_to_cpu(ah->av->sl_tclass_flowlabel) >> 28; + attr->port_num = be32_to_cpu(ah->av->port_pd) >> 24; + attr->static_rate = mthca_rate_to_ib(dev, ah->av->msg_sr & 0x7, + attr->port_num); + attr->src_path_bits = ah->av->g_slid & 0x7F; + attr->ah_flags = mthca_ah_grh_present(ah) ? IB_AH_GRH : 0; + + if (attr->ah_flags) { + attr->grh.traffic_class = + be32_to_cpu(ah->av->sl_tclass_flowlabel) >> 20; + attr->grh.flow_label = + be32_to_cpu(ah->av->sl_tclass_flowlabel) & 0xfffff; + attr->grh.hop_limit = ah->av->hop_limit; + attr->grh.sgid_index = ah->av->gid_index & + (dev->limits.gid_table_len - 1); + memcpy(attr->grh.dgid.raw, ah->av->dgid, 16); + } + + return 0; +} + +int mthca_init_av_table(struct mthca_dev *dev) +{ + int err; + + if (mthca_is_memfree(dev)) + return 0; + + err = mthca_alloc_init(&dev->av_table.alloc, + dev->av_table.num_ddr_avs, + dev->av_table.num_ddr_avs - 1, + 0); + if (err) + return err; + + dev->av_table.pool = pci_pool_create("mthca_av", dev->pdev, + MTHCA_AV_SIZE, + MTHCA_AV_SIZE, 0); + if (!dev->av_table.pool) + goto out_free_alloc; + + if (!(dev->mthca_flags & MTHCA_FLAG_DDR_HIDDEN)) { + dev->av_table.av_map = ioremap(pci_resource_start(dev->pdev, 4) + + dev->av_table.ddr_av_base - + dev->ddr_start, + dev->av_table.num_ddr_avs * + MTHCA_AV_SIZE); + if (!dev->av_table.av_map) + goto out_free_pool; + } else + dev->av_table.av_map = NULL; + + return 0; + + out_free_pool: + pci_pool_destroy(dev->av_table.pool); + + out_free_alloc: + mthca_alloc_cleanup(&dev->av_table.alloc); + return -ENOMEM; +} + +void mthca_cleanup_av_table(struct mthca_dev *dev) +{ + if (mthca_is_memfree(dev)) + return; + + if (dev->av_table.av_map) + iounmap(dev->av_table.av_map); + pci_pool_destroy(dev->av_table.pool); + mthca_alloc_cleanup(&dev->av_table.alloc); +} Added: head/sys/dev/mthca/mthca_catas.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/mthca/mthca_catas.c Tue Feb 13 17:04:34 2018 (r329222) @@ -0,0 +1,202 @@ +/* + * Copyright (c) 2005 Cisco Systems. All rights reserved. + * + * This software is available to you under a choice of one of two + * licenses. You may choose to be licensed under the terms of the GNU + * General Public License (GPL) Version 2, available from the file + * COPYING in the main directory of this source tree, or the + * OpenIB.org BSD license below: + * + * Redistribution and use in source and binary forms, with or + * without modification, are permitted provided that the following + * conditions are met: + * + * - Redistributions of source code must retain the above + * copyright notice, this list of conditions and the following + * disclaimer. + * + * - 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. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS + * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +#define LINUXKPI_PARAM_PREFIX mthca_ + +#include +#include +#include +#include + +#include "mthca_dev.h" + +#define MTHCA_CATAS_POLL_INTERVAL (5 * HZ) + +enum { + MTHCA_CATAS_TYPE_INTERNAL = 0, + MTHCA_CATAS_TYPE_UPLINK = 3, + MTHCA_CATAS_TYPE_DDR = 4, + MTHCA_CATAS_TYPE_PARITY = 5, +}; + +static DEFINE_SPINLOCK(catas_lock); + +static LIST_HEAD(catas_list); +static struct workqueue_struct *catas_wq; +static struct work_struct catas_work; + +static int catas_reset_disable; +module_param_named(catas_reset_disable, catas_reset_disable, int, 0644); +MODULE_PARM_DESC(catas_reset_disable, "disable reset on catastrophic event if nonzero"); + +static void catas_reset(struct work_struct *work) +{ + struct mthca_dev *dev, *tmpdev; + LIST_HEAD(tlist); + int ret; + + mutex_lock(&mthca_device_mutex); + + spin_lock_irq(&catas_lock); + list_splice_init(&catas_list, &tlist); + spin_unlock_irq(&catas_lock); + + list_for_each_entry_safe(dev, tmpdev, &tlist, catas_err.list) { + struct pci_dev *pdev = dev->pdev; + ret = __mthca_restart_one(dev->pdev); + /* 'dev' now is not valid */ + if (ret) + printk(KERN_ERR "mthca %s: Reset failed (%d)\n", + pci_name(pdev), ret); + else { + struct mthca_dev *d = pci_get_drvdata(pdev); + mthca_dbg(d, "Reset succeeded\n"); + } + } + + mutex_unlock(&mthca_device_mutex); +} + +static void handle_catas(struct mthca_dev *dev) +{ + struct ib_event event; + unsigned long flags; + const char *type; + int i; + + event.device = &dev->ib_dev; + event.event = IB_EVENT_DEVICE_FATAL; + event.element.port_num = 0; + dev->active = false; + + ib_dispatch_event(&event); + + switch (swab32(readl(dev->catas_err.map)) >> 24) { + case MTHCA_CATAS_TYPE_INTERNAL: + type = "internal error"; + break; + case MTHCA_CATAS_TYPE_UPLINK: + type = "uplink bus error"; + break; + case MTHCA_CATAS_TYPE_DDR: + type = "DDR data error"; + break; + case MTHCA_CATAS_TYPE_PARITY: + type = "internal parity error"; + break; + default: + type = "unknown error"; + break; + } + + mthca_err(dev, "Catastrophic error detected: %s\n", type); + for (i = 0; i < dev->catas_err.size; ++i) + mthca_err(dev, " buf[%02x]: %08x\n", + i, swab32(readl(dev->catas_err.map + i))); + + if (catas_reset_disable) + return; + + spin_lock_irqsave(&catas_lock, flags); + list_add(&dev->catas_err.list, &catas_list); + queue_work(catas_wq, &catas_work); + spin_unlock_irqrestore(&catas_lock, flags); +} + +static void poll_catas(unsigned long dev_ptr) +{ + struct mthca_dev *dev = (struct mthca_dev *) dev_ptr; + int i; + + for (i = 0; i < dev->catas_err.size; ++i) + if (readl(dev->catas_err.map + i)) { + handle_catas(dev); + return; + } + + mod_timer(&dev->catas_err.timer, + round_jiffies(jiffies + MTHCA_CATAS_POLL_INTERVAL)); +} + +void mthca_start_catas_poll(struct mthca_dev *dev) +{ + phys_addr_t addr; + + init_timer(&dev->catas_err.timer); + dev->catas_err.map = NULL; + + addr = pci_resource_start(dev->pdev, 0) + + ((pci_resource_len(dev->pdev, 0) - 1) & + dev->catas_err.addr); + + dev->catas_err.map = ioremap(addr, dev->catas_err.size * 4); + if (!dev->catas_err.map) { + mthca_warn(dev, "couldn't map catastrophic error region " + "at 0x%llx/0x%x\n", (unsigned long long) addr, + dev->catas_err.size * 4); + return; + } + + dev->catas_err.timer.data = (unsigned long) dev; + dev->catas_err.timer.function = poll_catas; + dev->catas_err.timer.expires = jiffies + MTHCA_CATAS_POLL_INTERVAL; + INIT_LIST_HEAD(&dev->catas_err.list); + add_timer(&dev->catas_err.timer); +} + +void mthca_stop_catas_poll(struct mthca_dev *dev) +{ + del_timer_sync(&dev->catas_err.timer); + + if (dev->catas_err.map) + iounmap(dev->catas_err.map); + + spin_lock_irq(&catas_lock); + list_del(&dev->catas_err.list); + spin_unlock_irq(&catas_lock); +} + +int __init mthca_catas_init(void) +{ + INIT_WORK(&catas_work, catas_reset); + + catas_wq = alloc_ordered_workqueue("mthca_catas", WQ_MEM_RECLAIM); + if (!catas_wq) + return -ENOMEM; + + return 0; +} + +void mthca_catas_cleanup(void) +{ + destroy_workqueue(catas_wq); +} Added: head/sys/dev/mthca/mthca_cmd.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/mthca/mthca_cmd.c Tue Feb 13 17:04:34 2018 (r329222) @@ -0,0 +1,1968 @@ +/* + * Copyright (c) 2004, 2005 Topspin Communications. All rights reserved. + * Copyright (c) 2005 Mellanox Technologies. All rights reserved. + * Copyright (c) 2005, 2006 Cisco Systems. All rights reserved. + * + * This software is available to you under a choice of one of two + * licenses. You may choose to be licensed under the terms of the GNU + * General Public License (GPL) Version 2, available from the file + * COPYING in the main directory of this source tree, or the + * OpenIB.org BSD license below: + * + * Redistribution and use in source and binary forms, with or + * without modification, are permitted provided that the following + * conditions are met: + * + * - Redistributions of source code must retain the above + * copyright notice, this list of conditions and the following + * disclaimer. + * + * - 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. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS + * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +#define LINUXKPI_PARAM_PREFIX mthca_ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "mthca_dev.h" *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Tue Feb 13 17:05:51 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 79472F117CF; Tue, 13 Feb 2018 17:05:51 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 248A4841A5; Tue, 13 Feb 2018 17:05:51 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1F5A8239C2; Tue, 13 Feb 2018 17:05:51 +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 w1DH5pdH082179; Tue, 13 Feb 2018 17:05:51 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1DH5o6J082178; Tue, 13 Feb 2018 17:05:50 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201802131705.w1DH5o6J082178@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Tue, 13 Feb 2018 17:05:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329223 - head/contrib/llvm/tools/clang/lib/Sema X-SVN-Group: head X-SVN-Commit-Author: dim X-SVN-Commit-Paths: head/contrib/llvm/tools/clang/lib/Sema X-SVN-Commit-Revision: 329223 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Feb 2018 17:05:51 -0000 Author: dim Date: Tue Feb 13 17:05:50 2018 New Revision: 329223 URL: https://svnweb.freebsd.org/changeset/base/329223 Log: Pull in r323998 from upstream clang trunk (by Richard Smith): PR36157: When injecting an implicit function declaration in C89, find the right DeclContext rather than injecting it wherever we happen to be. This avoids creating functions whose DeclContext is a struct or similar. This fixes assertion failures when parsing certain not-completely-valid struct declarations. Reported by: ae PR: 225862 MFC after: 3 months X-MFC-With: r327952 Modified: head/contrib/llvm/tools/clang/lib/Sema/SemaDecl.cpp Modified: head/contrib/llvm/tools/clang/lib/Sema/SemaDecl.cpp ============================================================================== --- head/contrib/llvm/tools/clang/lib/Sema/SemaDecl.cpp Tue Feb 13 17:04:34 2018 (r329222) +++ head/contrib/llvm/tools/clang/lib/Sema/SemaDecl.cpp Tue Feb 13 17:05:50 2018 (r329223) @@ -12507,9 +12507,19 @@ void Sema::ActOnFinishDelayedAttribute(Scope *S, Decl /// call, forming a call to an implicitly defined function (per C99 6.5.1p2). NamedDecl *Sema::ImplicitlyDefineFunction(SourceLocation Loc, IdentifierInfo &II, Scope *S) { + // Find the scope in which the identifier is injected and the corresponding + // DeclContext. + // FIXME: C89 does not say what happens if there is no enclosing block scope. + // In that case, we inject the declaration into the translation unit scope + // instead. Scope *BlockScope = S; while (!BlockScope->isCompoundStmtScope() && BlockScope->getParent()) BlockScope = BlockScope->getParent(); + + Scope *ContextScope = BlockScope; + while (!ContextScope->getEntity()) + ContextScope = ContextScope->getParent(); + ContextRAII SavedContext(*this, ContextScope->getEntity()); // Before we produce a declaration for an implicitly defined // function, see whether there was a locally-scoped declaration of From owner-svn-src-all@freebsd.org Tue Feb 13 17:38:09 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9E002F140DA; Tue, 13 Feb 2018 17:38:09 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C42085B83; Tue, 13 Feb 2018 17:38:09 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4302C23EA4; Tue, 13 Feb 2018 17:38:09 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1DHc93v097230; Tue, 13 Feb 2018 17:38:09 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1DHc9au097229; Tue, 13 Feb 2018 17:38:09 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201802131738.w1DHc9au097229@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Tue, 13 Feb 2018 17:38:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329224 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 329224 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Feb 2018 17:38:09 -0000 Author: ian Date: Tue Feb 13 17:38:08 2018 New Revision: 329224 URL: https://svnweb.freebsd.org/changeset/base/329224 Log: Fix bad indentation. Whitespace only, no functional changes. Reported by: bde@ Modified: head/sys/kern/subr_rtc.c Modified: head/sys/kern/subr_rtc.c ============================================================================== --- head/sys/kern/subr_rtc.c Tue Feb 13 17:05:50 2018 (r329223) +++ head/sys/kern/subr_rtc.c Tue Feb 13 17:38:08 2018 (r329224) @@ -156,55 +156,55 @@ settime_task_func(void *arg, int pending) static void clock_dbgprint_hdr(device_t dev, int rw) { - struct timespec now; + struct timespec now; - getnanotime(&now); - device_printf(dev, "%s at ", (rw & CLOCK_DBG_READ) ? "read " : "write"); - clock_print_ts(&now, 9); - printf(": "); + getnanotime(&now); + device_printf(dev, "%s at ", (rw & CLOCK_DBG_READ) ? "read " : "write"); + clock_print_ts(&now, 9); + printf(": "); } void clock_dbgprint_bcd(device_t dev, int rw, const struct bcd_clocktime *bct) { - if (show_io & rw) { - clock_dbgprint_hdr(dev, rw); - clock_print_bcd(bct, 9); - printf("\n"); - } + if (show_io & rw) { + clock_dbgprint_hdr(dev, rw); + clock_print_bcd(bct, 9); + printf("\n"); + } } void clock_dbgprint_ct(device_t dev, int rw, const struct clocktime *ct) { - if (show_io & rw) { - clock_dbgprint_hdr(dev, rw); - clock_print_ct(ct, 9); - printf("\n"); - } + if (show_io & rw) { + clock_dbgprint_hdr(dev, rw); + clock_print_ct(ct, 9); + printf("\n"); + } } void clock_dbgprint_err(device_t dev, int rw, int err) { - if (show_io & rw) { - clock_dbgprint_hdr(dev, rw); - printf("error = %d\n", err); - } + if (show_io & rw) { + clock_dbgprint_hdr(dev, rw); + printf("error = %d\n", err); + } } void clock_dbgprint_ts(device_t dev, int rw, const struct timespec *ts) { - if (show_io & rw) { - clock_dbgprint_hdr(dev, rw); - clock_print_ts(ts, 9); - printf("\n"); - } + if (show_io & rw) { + clock_dbgprint_hdr(dev, rw); + clock_print_ts(ts, 9); + printf("\n"); + } } void @@ -266,7 +266,7 @@ clock_unregister(device_t clockdev) if (rtc != NULL) { taskqueue_cancel_timeout(taskqueue_thread, &rtc->stask, NULL); taskqueue_drain_timeout(taskqueue_thread, &rtc->stask); - free(rtc, M_DEVBUF); + free(rtc, M_DEVBUF); } } From owner-svn-src-all@freebsd.org Tue Feb 13 17:40:09 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D4C99F142E8; Tue, 13 Feb 2018 17:40:09 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8850085D49; Tue, 13 Feb 2018 17:40:09 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 832CC23EA9; Tue, 13 Feb 2018 17:40:09 +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 w1DHe9wN097369; Tue, 13 Feb 2018 17:40:09 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1DHe9IN097368; Tue, 13 Feb 2018 17:40:09 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201802131740.w1DHe9IN097368@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Tue, 13 Feb 2018 17:40:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329225 - head/sys/geom/part X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: head/sys/geom/part X-SVN-Commit-Revision: 329225 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Feb 2018 17:40:10 -0000 Author: jhibbits Date: Tue Feb 13 17:40:09 2018 New Revision: 329225 URL: https://svnweb.freebsd.org/changeset/base/329225 Log: Narrow a race, and fix a leak, in g_part_wither A race in g_part_wither() can lead to I/O being performed with a freed GEOM when the device disappears. Close the race as best as we can for now, following the code patterns from g_part_ctl_destroy() and g_part_ctl_undo(). This also fixes a leak, as g_wither_geom() does not wither providers, it only orphans them, so the partition entries would never get destroyed in g_wither_washer(). Note, this is not a complete fix, it can still race with g_part_start(), the race has merely been narrowed. Reviewed by: markj Sponsored by: Dell EMC Isilon Modified: head/sys/geom/part/g_part.c Modified: head/sys/geom/part/g_part.c ============================================================================== --- head/sys/geom/part/g_part.c Tue Feb 13 17:38:08 2018 (r329224) +++ head/sys/geom/part/g_part.c Tue Feb 13 17:40:09 2018 (r329225) @@ -1541,18 +1541,21 @@ g_part_wither(struct g_geom *gp, int error) { struct g_part_entry *entry; struct g_part_table *table; + struct g_provider *pp; table = gp->softc; if (table != NULL) { - G_PART_DESTROY(table, NULL); + gp->softc = NULL; while ((entry = LIST_FIRST(&table->gpt_entry)) != NULL) { LIST_REMOVE(entry, gpe_entry); + pp = entry->gpe_pp; + entry->gpe_pp->private = NULL; + entry->gpe_pp = NULL; + g_wither_provider(pp, error); g_free(entry); } - if (gp->softc != NULL) { - kobj_delete((kobj_t)gp->softc, M_GEOM); - gp->softc = NULL; - } + G_PART_DESTROY(table, NULL); + kobj_delete((kobj_t)table, M_GEOM); } g_wither_geom(gp, error); } From owner-svn-src-all@freebsd.org Tue Feb 13 17:42:10 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C279BF14676; Tue, 13 Feb 2018 17:42:10 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 994428617F; Tue, 13 Feb 2018 17:42:10 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 944EA2401B; Tue, 13 Feb 2018 17:42:10 +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 w1DHgAWF001946; Tue, 13 Feb 2018 17:42:10 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1DHgA8C001945; Tue, 13 Feb 2018 17:42:10 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201802131742.w1DHgA8C001945@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Tue, 13 Feb 2018 17:42:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329226 - head/etc/mtree X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/etc/mtree X-SVN-Commit-Revision: 329226 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Feb 2018 17:42:10 -0000 Author: imp Date: Tue Feb 13 17:42:10 2018 New Revision: 329226 URL: https://svnweb.freebsd.org/changeset/base/329226 Log: Add /boot/lua. Modified: head/etc/mtree/BSD.root.dist Modified: head/etc/mtree/BSD.root.dist ============================================================================== --- head/etc/mtree/BSD.root.dist Tue Feb 13 17:40:09 2018 (r329225) +++ head/etc/mtree/BSD.root.dist Tue Feb 13 17:42:10 2018 (r329226) @@ -14,6 +14,8 @@ .. firmware .. + lua + .. kernel .. modules From owner-svn-src-all@freebsd.org Tue Feb 13 17:43:54 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B190DF14A37; Tue, 13 Feb 2018 17:43:54 +0000 (UTC) (envelope-from landonf@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5F41486476; Tue, 13 Feb 2018 17:43:54 +0000 (UTC) (envelope-from landonf@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5A33524039; Tue, 13 Feb 2018 17:43:54 +0000 (UTC) (envelope-from landonf@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1DHhsq6002138; Tue, 13 Feb 2018 17:43:54 GMT (envelope-from landonf@FreeBSD.org) Received: (from landonf@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1DHhs3d002137; Tue, 13 Feb 2018 17:43:54 GMT (envelope-from landonf@FreeBSD.org) Message-Id: <201802131743.w1DHhs3d002137@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: landonf set sender to landonf@FreeBSD.org using -f From: "Landon J. Fuller" Date: Tue, 13 Feb 2018 17:43:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329228 - head/sys/gnu/dev/bwn/phy_n X-SVN-Group: head X-SVN-Commit-Author: landonf X-SVN-Commit-Paths: head/sys/gnu/dev/bwn/phy_n X-SVN-Commit-Revision: 329228 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Feb 2018 17:43:54 -0000 Author: landonf Date: Tue Feb 13 17:43:54 2018 New Revision: 329228 URL: https://svnweb.freebsd.org/changeset/base/329228 Log: bwn(4): txpid2g/txpid5g[lh] are not defined after sromrev 7; the default indices into the TX power gain table should be used instead. This enables use of bwn(4) with later BCM4321 revisions. Reported by: Trev Roydhouse Modified: head/sys/gnu/dev/bwn/phy_n/if_bwn_phy_n_core.c Modified: head/sys/gnu/dev/bwn/phy_n/if_bwn_phy_n_core.c ============================================================================== --- head/sys/gnu/dev/bwn/phy_n/if_bwn_phy_n_core.c Tue Feb 13 17:42:16 2018 (r329227) +++ head/sys/gnu/dev/bwn/phy_n/if_bwn_phy_n_core.c Tue Feb 13 17:43:54 2018 (r329228) @@ -3906,6 +3906,9 @@ static int bwn_nphy_tx_power_fix(struct bwn_mac *mac) } else if (sc->sc_board_info.board_srom_rev < 4) { txpi[0] = 72; txpi[1] = 72; + } else if (sc->sc_board_info.board_srom_rev > 7) { + txpi[0] = 0; + txpi[1] = 0; } else { #define BWN_NPHY_GET_TXPI(_name, _result) \ do { \ From owner-svn-src-all@freebsd.org Tue Feb 13 17:51:17 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 699AAF15493; Tue, 13 Feb 2018 17:51:17 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1AE5486CF8; Tue, 13 Feb 2018 17:51:17 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 15EB624084; Tue, 13 Feb 2018 17:51:17 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1DHpGVV003506; Tue, 13 Feb 2018 17:51:16 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1DHpGL0003505; Tue, 13 Feb 2018 17:51:16 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201802131751.w1DHpGL0003505@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Tue, 13 Feb 2018 17:51:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329232 - head/sys/conf X-SVN-Group: head X-SVN-Commit-Author: bdrewery X-SVN-Commit-Paths: head/sys/conf X-SVN-Commit-Revision: 329232 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Feb 2018 17:51:17 -0000 Author: bdrewery Date: Tue Feb 13 17:51:16 2018 New Revision: 329232 URL: https://svnweb.freebsd.org/changeset/base/329232 Log: ports modules: Don't leak AUTO_OBJ changes into the port builds. This came about when r328489 made ports modules builds no longer use the in-tree share/mk files, but didn't cleanup MAKEOBJDIR from the environment. This fixes "Variable OBJTOP is recursive". Sponsored by: Dell EMC Modified: head/sys/conf/kern.post.mk Modified: head/sys/conf/kern.post.mk ============================================================================== --- head/sys/conf/kern.post.mk Tue Feb 13 17:50:36 2018 (r329231) +++ head/sys/conf/kern.post.mk Tue Feb 13 17:51:16 2018 (r329232) @@ -70,6 +70,7 @@ PORTSMODULESENV=\ -u CXX \ -u CPP \ -u MAKESYSPATH \ + -u MAKEOBJDIR \ MAKEFLAGS="${MAKEFLAGS:M*:tW:S/^-m /-m_/g:S/ -m / -m_/g:tw:N-m_*}" \ SYSDIR=${SYSDIR} \ PATH=${PATH}:${LOCALBASE}/bin:${LOCALBASE}/sbin \ From owner-svn-src-all@freebsd.org Tue Feb 13 19:17:33 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CE1B1F1C09F; Tue, 13 Feb 2018 19:17:33 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7EF0F6B1EA; Tue, 13 Feb 2018 19:17:33 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7883B24F04; Tue, 13 Feb 2018 19:17:33 +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 w1DJHXft047412; Tue, 13 Feb 2018 19:17:33 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1DJHXfY047411; Tue, 13 Feb 2018 19:17:33 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201802131917.w1DJHXfY047411@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Tue, 13 Feb 2018 19:17:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329236 - head/contrib/netbsd-tests/kernel X-SVN-Group: head X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: head/contrib/netbsd-tests/kernel X-SVN-Commit-Revision: 329236 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Feb 2018 19:17:34 -0000 Author: asomers Date: Tue Feb 13 19:17:33 2018 New Revision: 329236 URL: https://svnweb.freebsd.org/changeset/base/329236 Log: Fix Coverity CIDs in the sys/kern/sysv_test tests CID 979810: strcpy => strlcpy CID 1193367: don't leak a file descriptor CID 1299856: Check the return value of read(2) Reported by: Coverity Coverity CID: 978910 1193367 1299856 MFC after: 3 weeks X-MFC-With: 328896 Sponsored by: Spectra Logic Corp Modified: head/contrib/netbsd-tests/kernel/t_sysv.c Modified: head/contrib/netbsd-tests/kernel/t_sysv.c ============================================================================== --- head/contrib/netbsd-tests/kernel/t_sysv.c Tue Feb 13 17:58:02 2018 (r329235) +++ head/contrib/netbsd-tests/kernel/t_sysv.c Tue Feb 13 19:17:33 2018 (r329236) @@ -129,7 +129,8 @@ read_int(const char *path) return -1; else { int value; - read(input, &value, sizeof(value)); + ATF_REQUIRE_EQ(read(input, &value, sizeof(value)), sizeof(value)); + close(input); return value; } } @@ -284,7 +285,7 @@ ATF_TC_BODY(msg, tc) * Send the first message to the receiver and wait for the ACK. */ m.mtype = MTYPE_1; - strcpy(m.mtext, m1_str); + strlcpy(m.mtext, m1_str, sizeof(m.mtext)); ATF_REQUIRE_MSG(msgsnd(sender_msqid, &m, MESSAGE_TEXT_LEN, 0) != -1, "sender: msgsnd 1: %d", errno); @@ -298,7 +299,7 @@ ATF_TC_BODY(msg, tc) * Send the second message to the receiver and wait for the ACK. */ m.mtype = MTYPE_2; - strcpy(m.mtext, m2_str); + strlcpy(m.mtext, m2_str, sizeof(m.mtext)); ATF_REQUIRE_MSG(msgsnd(sender_msqid, &m, MESSAGE_TEXT_LEN, 0) != -1, "sender: msgsnd 2: %d", errno); From owner-svn-src-all@freebsd.org Tue Feb 13 19:17:49 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AB3DAF1C0EB; Tue, 13 Feb 2018 19:17:49 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 61A206B2FE; Tue, 13 Feb 2018 19:17: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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 43CEB24F05; Tue, 13 Feb 2018 19:17: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 w1DJHnRd047469; Tue, 13 Feb 2018 19:17:49 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1DJHmso047463; Tue, 13 Feb 2018 19:17:48 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201802131917.w1DJHmso047463@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Tue, 13 Feb 2018 19:17:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329237 - head/sys/libkern X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/sys/libkern X-SVN-Commit-Revision: 329237 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Feb 2018 19:17:50 -0000 Author: emaste Date: Tue Feb 13 19:17:48 2018 New Revision: 329237 URL: https://svnweb.freebsd.org/changeset/base/329237 Log: libkern: use nul for terminating char rather than 0 Akin to the change made in r188080 for lib/libc/string/. Reported by: bde Sponsored by: The FreeBSD Foundation Modified: head/sys/libkern/strcmp.c head/sys/libkern/strncat.c head/sys/libkern/strncpy.c head/sys/libkern/strsep.c head/sys/libkern/strstr.c Modified: head/sys/libkern/strcmp.c ============================================================================== --- head/sys/libkern/strcmp.c Tue Feb 13 19:17:33 2018 (r329236) +++ head/sys/libkern/strcmp.c Tue Feb 13 19:17:48 2018 (r329237) @@ -44,7 +44,7 @@ int strcmp(const char *s1, const char *s2) { while (*s1 == *s2++) - if (*s1++ == 0) + if (*s1++ == '\0') return (0); return (*(const unsigned char *)s1 - *(const unsigned char *)(s2 - 1)); } Modified: head/sys/libkern/strncat.c ============================================================================== --- head/sys/libkern/strncat.c Tue Feb 13 19:17:33 2018 (r329236) +++ head/sys/libkern/strncat.c Tue Feb 13 19:17:48 2018 (r329237) @@ -53,11 +53,11 @@ strncat(char *dst, const char *src, size_t n) while (*d != 0) d++; do { - if ((*d = *s++) == 0) + if ((*d = *s++) == '\0') break; d++; } while (--n != 0); - *d = 0; + *d = '\0'; } return (dst); } Modified: head/sys/libkern/strncpy.c ============================================================================== --- head/sys/libkern/strncpy.c Tue Feb 13 19:17:33 2018 (r329236) +++ head/sys/libkern/strncpy.c Tue Feb 13 19:17:48 2018 (r329237) @@ -49,10 +49,10 @@ strncpy(char * __restrict dst, const char * __restrict const char *s = src; do { - if ((*d++ = *s++) == 0) { + if ((*d++ = *s++) == '\0') { /* NUL pad the remaining n-1 bytes */ while (--n != 0) - *d++ = 0; + *d++ = '\0'; break; } } while (--n != 0); Modified: head/sys/libkern/strsep.c ============================================================================== --- head/sys/libkern/strsep.c Tue Feb 13 19:17:33 2018 (r329236) +++ head/sys/libkern/strsep.c Tue Feb 13 19:17:48 2018 (r329237) @@ -64,14 +64,14 @@ strsep(char **stringp, const char *delim) spanp = delim; do { if ((sc = *spanp++) == c) { - if (c == 0) + if (c == '\0') s = NULL; else - s[-1] = 0; + s[-1] = '\0'; *stringp = s; return (tok); } - } while (sc != 0); + } while (sc != '\0'); } /* NOTREACHED */ } Modified: head/sys/libkern/strstr.c ============================================================================== --- head/sys/libkern/strstr.c Tue Feb 13 19:17:33 2018 (r329236) +++ head/sys/libkern/strstr.c Tue Feb 13 19:17:48 2018 (r329237) @@ -51,7 +51,7 @@ strstr(const char *s, const char *find) len = strlen(find); do { do { - if ((sc = *s++) == 0) + if ((sc = *s++) == '\0') return (NULL); } while (sc != c); } while (strncmp(s, find, len) != 0); From owner-svn-src-all@freebsd.org Tue Feb 13 19:18:01 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2666FF1C162; Tue, 13 Feb 2018 19:18:01 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CFD706B3FB; Tue, 13 Feb 2018 19:18:00 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CAC3424F07; Tue, 13 Feb 2018 19:18:00 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1DJI0Ad047526; Tue, 13 Feb 2018 19:18:00 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1DJI0jD047524; Tue, 13 Feb 2018 19:18:00 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201802131918.w1DJI0jD047524@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 13 Feb 2018 19:18:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329238 - head/sys/contrib/zstd/lib/freebsd X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/contrib/zstd/lib/freebsd X-SVN-Commit-Revision: 329238 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Feb 2018 19:18:01 -0000 Author: markj Date: Tue Feb 13 19:18:00 2018 New Revision: 329238 URL: https://svnweb.freebsd.org/changeset/base/329238 Log: Move zstd malloc()/free()/calloc() macros to stdlib.h. The definitions otherwise leak into anything that includes zstd.h, which is not desirable for native FreeBSD code. Reviewed by: allanjude, cem, imp MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D14352 Modified: head/sys/contrib/zstd/lib/freebsd/stdlib.h head/sys/contrib/zstd/lib/freebsd/zstd_kfreebsd.h Modified: head/sys/contrib/zstd/lib/freebsd/stdlib.h ============================================================================== --- head/sys/contrib/zstd/lib/freebsd/stdlib.h Tue Feb 13 19:17:48 2018 (r329237) +++ head/sys/contrib/zstd/lib/freebsd/stdlib.h Tue Feb 13 19:18:00 2018 (r329238) @@ -1,3 +1,44 @@ -/* This file is in the public domain */ -/* $FreeBSD$ */ -#include "zstd_kfreebsd.h" +/*- + * Copyright (c) 2014-2015 Allan Jude + * 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 _ZSTD_FREEBSD_STDLIB_H_ +#define _ZSTD_FREEBSD_STDLIB_H_ + +#ifdef _KERNEL + +#include + +MALLOC_DECLARE(M_ZSTD); + +#define malloc(x) (malloc)((x), M_ZSTD, M_WAITOK) +#define free(x) (free)((x), M_ZSTD) +#define calloc(a, b) (mallocarray)((a), (b), M_ZSTD, M_WAITOK | M_ZERO) + +#endif /* _KERNEL */ + +#endif /* _ZSTD_FREEBSD_STDLIB_H_ */ Modified: head/sys/contrib/zstd/lib/freebsd/zstd_kfreebsd.h ============================================================================== --- head/sys/contrib/zstd/lib/freebsd/zstd_kfreebsd.h Tue Feb 13 19:17:48 2018 (r329237) +++ head/sys/contrib/zstd/lib/freebsd/zstd_kfreebsd.h Tue Feb 13 19:18:00 2018 (r329238) @@ -39,14 +39,6 @@ extern "C" { #ifndef BUILDING_ZFS #include /* ptrdiff_t */ #endif -#include - -MALLOC_DECLARE(M_ZSTD); - -#define malloc(x) (malloc)((x), M_ZSTD, M_WAITOK) -#define free(x) (free)((x), M_ZSTD) -/* in zstd's use of calloc, a is always 1 */ -#define calloc(a,b) (mallocarray)((a), (b), M_ZSTD, M_WAITOK | M_ZERO) #endif #ifdef __cplusplus From owner-svn-src-all@freebsd.org Tue Feb 13 19:19:27 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 714EFF1C325; Tue, 13 Feb 2018 19:19:27 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 239786B61E; Tue, 13 Feb 2018 19:19:27 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1E72D24F0D; Tue, 13 Feb 2018 19:19:27 +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 w1DJJRT2047618; Tue, 13 Feb 2018 19:19:27 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1DJJQC9047617; Tue, 13 Feb 2018 19:19:26 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201802131919.w1DJJQC9047617@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Tue, 13 Feb 2018 19:19:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329239 - head/sys/amd64/amd64 X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/sys/amd64/amd64 X-SVN-Commit-Revision: 329239 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Feb 2018 19:19:27 -0000 Author: emaste Date: Tue Feb 13 19:19:26 2018 New Revision: 329239 URL: https://svnweb.freebsd.org/changeset/base/329239 Log: amd64/pmap: Move Foundation copyright to the 2-clause section Sponsored by: The FreeBSD Foundation Modified: head/sys/amd64/amd64/pmap.c Modified: head/sys/amd64/amd64/pmap.c ============================================================================== --- head/sys/amd64/amd64/pmap.c Tue Feb 13 19:18:00 2018 (r329238) +++ head/sys/amd64/amd64/pmap.c Tue Feb 13 19:19:26 2018 (r329239) @@ -11,17 +11,11 @@ * All rights reserved. * Copyright (c) 2005-2010 Alan L. Cox * All rights reserved. - * Copyright (c) 2014-2018 The FreeBSD Foundation - * All rights reserved. * * This code is derived from software contributed to Berkeley by * the Systems Programming Group of the University of Utah Computer * Science Department and William Jolitz of UUNET Technologies Inc. * - * Portions of this software were developed by - * Konstantin Belousov under sponsorship from - * the FreeBSD Foundation. - * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -54,6 +48,7 @@ */ /*- * Copyright (c) 2003 Networks Associates Technology, Inc. + * Copyright (c) 2014-2018 The FreeBSD Foundation * All rights reserved. * * This software was developed for the FreeBSD Project by Jake Burkholder, @@ -61,6 +56,10 @@ * Security Research Division of Network Associates, Inc. under * DARPA/SPAWAR contract N66001-01-C-8035 ("CBOSS"), as part of the DARPA * CHATS research program. + * + * Portions of this software were developed by + * Konstantin Belousov under sponsorship from + * the FreeBSD Foundation. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions From owner-svn-src-all@freebsd.org Tue Feb 13 19:24:03 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D9075F1CBF2 for ; Tue, 13 Feb 2018 19:24:03 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from bat.pine.relay.mailchannels.net (bat.pine.relay.mailchannels.net [23.83.219.13]) (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 95C836BC62 for ; Tue, 13 Feb 2018 19:24:02 +0000 (UTC) (envelope-from ian@freebsd.org) X-Sender-Id: _forwarded-from|67.177.211.60 Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id 737EF5C03B1 for ; Tue, 13 Feb 2018 19:23:58 +0000 (UTC) Received: from outbound1a.eu.mailhop.org (unknown [100.96.14.37]) (Authenticated sender: duocircle) by relay.mailchannels.net (Postfix) with ESMTPA id D51715C1507 for ; Tue, 13 Feb 2018 19:23:57 +0000 (UTC) X-Sender-Id: _forwarded-from|67.177.211.60 Received: from outbound1a.eu.mailhop.org (outbound1a.eu.mailhop.org [172.18.55.234]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384) by 0.0.0.0:2500 (trex/5.13.1); Tue, 13 Feb 2018 19:23:58 +0000 X-MC-Relay: Junk X-MailChannels-SenderId: _forwarded-from|67.177.211.60 X-MailChannels-Auth-Id: duocircle X-Wiry-Cold: 0852e02f388e6e7a_1518549838256_2970403533 X-MC-Loop-Signature: 1518549838256:1045465089 X-MC-Ingress-Time: 1518549838256 X-MHO-User: 6c4d0a7e-10f3-11e8-91c6-33ffc249f3e8 X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 67.177.211.60 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [67.177.211.60]) by outbound1.eu.mailhop.org (Halon) with ESMTPSA id 6c4d0a7e-10f3-11e8-91c6-33ffc249f3e8; Tue, 13 Feb 2018 19:23:52 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id w1DJNn2L038434; Tue, 13 Feb 2018 12:23:49 -0700 (MST) (envelope-from ian@freebsd.org) Message-ID: <1518549829.85310.39.camel@freebsd.org> Subject: Re: svn commit: r329237 - head/sys/libkern From: Ian Lepore To: Ed Maste , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Tue, 13 Feb 2018 12:23:49 -0700 In-Reply-To: <201802131917.w1DJHmso047463@repo.freebsd.org> References: <201802131917.w1DJHmso047463@repo.freebsd.org> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.18.5.1 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Feb 2018 19:24:04 -0000 On Tue, 2018-02-13 at 19:17 +0000, Ed Maste wrote: > Author: emaste > Date: Tue Feb 13 19:17:48 2018 > New Revision: 329237 > URL: https://svnweb.freebsd.org/changeset/base/329237 > > Log: >   libkern: use nul for terminating char rather than 0 >    >   Akin to the change made in r188080 for lib/libc/string/. >    >   Reported by: bde >   Sponsored by: The FreeBSD Foundation There are many ways to spell 0.  Why are we using something other than the simplest way?  Is it a style rule thing, or is it portability- correctness, or what? -- Ian From owner-svn-src-all@freebsd.org Tue Feb 13 19:28:04 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8CC0CF1D028; Tue, 13 Feb 2018 19:28:04 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3D3B56BEAC; Tue, 13 Feb 2018 19:28:04 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1BA9F250AE; Tue, 13 Feb 2018 19:28:04 +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 w1DJS30T052545; Tue, 13 Feb 2018 19:28:03 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1DJS203052532; Tue, 13 Feb 2018 19:28:02 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201802131928.w1DJS203052532@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 13 Feb 2018 19:28:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329240 - in head: sbin/dumpon sbin/savecore share/man/man5 sys/conf sys/kern sys/sys X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in head: sbin/dumpon sbin/savecore share/man/man5 sys/conf sys/kern sys/sys X-SVN-Commit-Revision: 329240 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Feb 2018 19:28:04 -0000 Author: markj Date: Tue Feb 13 19:28:02 2018 New Revision: 329240 URL: https://svnweb.freebsd.org/changeset/base/329240 Log: Add support for zstd-compressed user and kernel core dumps. This works similarly to the existing gzip compression support, but zstd is typically faster and gives better compression ratios. Support for this functionality must be configured by adding ZSTDIO to one's kernel configuration file. dumpon(8)'s new -Z option is used to configure zstd compression for kernel dumps. savecore(8) now recognizes and saves zstd-compressed kernel dumps with a .zst extension. Submitted by: cem (original version) Relnotes: yes Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D13101, https://reviews.freebsd.org/D13633 Modified: head/sbin/dumpon/dumpon.8 head/sbin/dumpon/dumpon.c head/sbin/savecore/savecore.c head/share/man/man5/core.5 head/sys/conf/NOTES head/sys/conf/files head/sys/conf/options head/sys/kern/kern_shutdown.c head/sys/kern/kern_sig.c head/sys/kern/subr_compressor.c head/sys/sys/compressor.h head/sys/sys/kerneldump.h Modified: head/sbin/dumpon/dumpon.8 ============================================================================== --- head/sbin/dumpon/dumpon.8 Tue Feb 13 19:19:26 2018 (r329239) +++ head/sbin/dumpon/dumpon.8 Tue Feb 13 19:28:02 2018 (r329240) @@ -28,7 +28,7 @@ .\" From: @(#)swapon.8 8.1 (Berkeley) 6/5/93 .\" $FreeBSD$ .\" -.Dd October 24, 2017 +.Dd February 13, 2018 .Dt DUMPON 8 .Os .Sh NAME @@ -39,6 +39,7 @@ .Op Fl v .Op Fl k Ar public_key_file .Op Fl z +.Op Fl Z .Ar special_file .Nm .Op Fl v @@ -116,8 +117,10 @@ kernel option. .Pp The .Fl z -option configures the kernel to compress the dump in gzip format before writing -it to the dump device. +and +.Fl Z +options configure the kernel to compress the dump before writing it to +the dump device. This reduces the amount of space required for the dump and accelerates recovery with .Xr savecore 8 @@ -126,10 +129,22 @@ When compression is enabled, the .Nm utility will not verify that the dump device is sufficiently large for a full dump. -This flag requires a kernel compiled with the +The +.Fl z +and +.Fl Z +options cause the dump to be written in +.Xr gzip 1 +and +.Xr zstd 1 +format, respectively. +These flags require a kernel compiled with the .Dv GZIO -kernel option. +or +.Dv ZSTDIO +kernel options. .Pp +.Pp The .Fl l flag causes @@ -269,15 +284,17 @@ The core was decrypted properly if .Xr kgdb 1 does not print any errors. .Sh SEE ALSO +.Xr gzip 1 , .Xr kgdb 1 , +.Xr zstd 1 , .Xr ddb 4 , .Xr fstab 5 , .Xr rc.conf 5 , .Xr config 8 , +.Xr decryptcore 8 , .Xr init 8 , .Xr loader 8 , .Xr rc 8 , -.Xr decryptcore 8 , .Xr savecore 8 , .Xr swapon 8 , .Xr panic 9 Modified: head/sbin/dumpon/dumpon.c ============================================================================== --- head/sbin/dumpon/dumpon.c Tue Feb 13 19:19:26 2018 (r329239) +++ head/sbin/dumpon/dumpon.c Tue Feb 13 19:28:02 2018 (r329240) @@ -73,7 +73,7 @@ static void usage(void) { fprintf(stderr, "%s\n%s\n%s\n", - "usage: dumpon [-v] [-k public_key_file] [-z] special_file", + "usage: dumpon [-v] [-k public_key_file] [-Zz] special_file", " dumpon [-v] off", " dumpon [-v] -l"); exit(EX_USAGE); @@ -192,12 +192,12 @@ main(int argc, char *argv[]) int ch; int i, fd; int do_listdumpdev = 0; - bool enable, gzip; + bool enable, gzip, zstd; - gzip = false; + gzip = zstd = false; pubkeyfile = NULL; - while ((ch = getopt(argc, argv, "k:lvz")) != -1) + while ((ch = getopt(argc, argv, "k:lvZz")) != -1) switch((char)ch) { case 'k': pubkeyfile = optarg; @@ -208,6 +208,9 @@ main(int argc, char *argv[]) case 'v': verbose = 1; break; + case 'Z': + zstd = true; + break; case 'z': gzip = true; break; @@ -215,6 +218,9 @@ main(int argc, char *argv[]) usage(); } + if (gzip && zstd) + errx(EX_USAGE, "The -z and -Z options are mutually exclusive."); + argc -= optind; argv += optind; @@ -254,7 +260,7 @@ main(int argc, char *argv[]) if (fd < 0) err(EX_OSFILE, "%s", dumpdev); - if (!gzip) + if (!gzip && !zstd) check_size(fd, dumpdev); bzero(&kda, sizeof(kda)); @@ -268,8 +274,11 @@ main(int argc, char *argv[]) #endif kda.kda_enable = 1; - kda.kda_compression = gzip ? KERNELDUMP_COMP_GZIP : - KERNELDUMP_COMP_NONE; + kda.kda_compression = KERNELDUMP_COMP_NONE; + if (zstd) + kda.kda_compression = KERNELDUMP_COMP_ZSTD; + else if (gzip) + kda.kda_compression = KERNELDUMP_COMP_GZIP; i = ioctl(fd, DIOCSKERNELDUMP, &kda); explicit_bzero(kda.kda_encryptedkey, kda.kda_encryptedkeysize); free(kda.kda_encryptedkey); Modified: head/sbin/savecore/savecore.c ============================================================================== --- head/sbin/savecore/savecore.c Tue Feb 13 19:19:26 2018 (r329239) +++ head/sbin/savecore/savecore.c Tue Feb 13 19:28:02 2018 (r329240) @@ -109,6 +109,7 @@ printheader(xo_handle_t *xo, const struct kerneldumphe uint64_t dumplen; time_t t; const char *stat_str; + const char *comp_str; xo_flush_h(xo); xo_emit_h(xo, "{Lwc:Dump header from device}{:dump_device/%s}\n", @@ -123,10 +124,21 @@ printheader(xo_handle_t *xo, const struct kerneldumphe (long long)dumplen); xo_emit_h(xo, "{P: }{Lwc:Blocksize}{:blocksize/%d}\n", dtoh32(h->blocksize)); - xo_emit_h(xo, "{P: }{Lwc:Compression}{:compression/%s}\n", - h->compression == KERNELDUMP_COMP_GZIP ? - "gzip" : "none"); - + switch (h->compression) { + case KERNELDUMP_COMP_NONE: + comp_str = "none"; + break; + case KERNELDUMP_COMP_GZIP: + comp_str = "gzip"; + break; + case KERNELDUMP_COMP_ZSTD: + comp_str = "zstd"; + break; + default: + comp_str = "???"; + break; + } + xo_emit_h(xo, "{P: }{Lwc:Compression}{:compression/%s}\n", comp_str); t = dtoh64(h->dumptime); xo_emit_h(xo, "{P: }{Lwc:Dumptime}{:dumptime/%s}", ctime(&t)); xo_emit_h(xo, "{P: }{Lwc:Hostname}{:hostname/%s}\n", h->hostname); @@ -249,6 +261,8 @@ saved_dump_size(int bounds) dumpsize += file_size(path); (void)snprintf(path, sizeof(path), "vmcore.%d.gz", bounds); dumpsize += file_size(path); + (void)snprintf(path, sizeof(path), "vmcore.%d.zst", bounds); + dumpsize += file_size(path); (void)snprintf(path, sizeof(path), "textdump.tar.%d", bounds); dumpsize += file_size(path); (void)snprintf(path, sizeof(path), "textdump.tar.%d.gz", bounds); @@ -268,6 +282,8 @@ saved_dump_remove(int bounds) (void)unlink(path); (void)snprintf(path, sizeof(path), "vmcore.%d.gz", bounds); (void)unlink(path); + (void)snprintf(path, sizeof(path), "vmcore.%d.zst", bounds); + (void)unlink(path); (void)snprintf(path, sizeof(path), "textdump.tar.%d", bounds); (void)unlink(path); (void)snprintf(path, sizeof(path), "textdump.tar.%d.gz", bounds); @@ -282,6 +298,7 @@ symlinks_remove(void) (void)unlink("key.last"); (void)unlink("vmcore.last"); (void)unlink("vmcore.last.gz"); + (void)unlink("vmcore.last.zstd"); (void)unlink("vmcore_encrypted.last"); (void)unlink("vmcore_encrypted.last.gz"); (void)unlink("textdump.tar.last"); @@ -615,6 +632,7 @@ DoFile(const char *savedir, const char *device) case KERNELDUMP_COMP_NONE: break; case KERNELDUMP_COMP_GZIP: + case KERNELDUMP_COMP_ZSTD: if (compress && verbose) printf("dump is already compressed\n"); compress = false; @@ -743,7 +761,8 @@ DoFile(const char *savedir, const char *device) (isencrypted ? "vmcore_encrypted" : "vmcore"), bounds); fp = zopen(corename, "w"); } else if (iscompressed && !isencrypted) { - snprintf(corename, sizeof(corename), "vmcore.%d.gz", bounds); + snprintf(corename, sizeof(corename), "vmcore.%d.%s", bounds, + (kdhl.compression == KERNELDUMP_COMP_GZIP) ? "gz" : "zst"); fp = fopen(corename, "w"); } else { snprintf(corename, sizeof(corename), "%s.%d", @@ -845,9 +864,10 @@ DoFile(const char *savedir, const char *device) } } if (compress || iscompressed) { - snprintf(linkname, sizeof(linkname), "%s.last.gz", + snprintf(linkname, sizeof(linkname), "%s.last.%s", istextdump ? "textdump.tar" : - (isencrypted ? "vmcore_encrypted" : "vmcore")); + (isencrypted ? "vmcore_encrypted" : "vmcore"), + (kdhl.compression == KERNELDUMP_COMP_ZSTD) ? "zst" : "gz"); } else { snprintf(linkname, sizeof(linkname), "%s.last", istextdump ? "textdump.tar" : Modified: head/share/man/man5/core.5 ============================================================================== --- head/share/man/man5/core.5 Tue Feb 13 19:19:26 2018 (r329239) +++ head/share/man/man5/core.5 Tue Feb 13 19:28:02 2018 (r329240) @@ -28,7 +28,7 @@ .\" @(#)core.5 8.3 (Berkeley) 12/11/93 .\" $FreeBSD$ .\" -.Dd January 8, 2018 +.Dd February 13, 2018 .Dt CORE 5 .Os .Sh NAME @@ -112,10 +112,17 @@ The following sysctl control core file compression: .Bl -tag -width "kern.compress_user_cores_level" -compact -offset "12345" .It Em kern.compress_user_cores Enable compression of user cores. -A value of 1 configures gzip compression. -gzip-compressed core files will have a suffix of +A value of 1 configures +.Xr gzip 1 +compression, +and a value of 2 configures +.Xr zstd 1 +compression. +Compressed core files will have a suffix of .Ql .gz -appended to their filenames. +or +.Ql .zst +appended to their filenames depending on the selected format. .It Em kern.compress_user_cores_level Compression level. Defaults to 6. Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Tue Feb 13 19:19:26 2018 (r329239) +++ head/sys/conf/NOTES Tue Feb 13 19:28:02 2018 (r329240) @@ -3018,6 +3018,10 @@ options IMAGACT_BINMISC # This enables support for compressed core dumps. options GZIO +# zstd I/O stream support +# This enables support for Zstd compressed core dumps. +options ZSTDIO + # BHND(4) drivers options BHND_LOGLEVEL # Logging threshold level Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Tue Feb 13 19:19:26 2018 (r329239) +++ head/sys/conf/files Tue Feb 13 19:28:02 2018 (r329240) @@ -3836,7 +3836,8 @@ kern/subr_bus_dma.c standard kern/subr_bufring.c standard kern/subr_capability.c standard kern/subr_clock.c standard -kern/subr_compressor.c standard +kern/subr_compressor.c standard \ + compile-with "${NORMAL_C} -I$S/contrib/zstd/lib/freebsd" kern/subr_counter.c standard kern/subr_devstat.c standard kern/subr_disk.c standard Modified: head/sys/conf/options ============================================================================== --- head/sys/conf/options Tue Feb 13 19:19:26 2018 (r329239) +++ head/sys/conf/options Tue Feb 13 19:28:02 2018 (r329240) @@ -222,6 +222,7 @@ TURNSTILE_PROFILING UMTX_PROFILING UMTX_CHAINS opt_global.h VERBOSE_SYSINIT +ZSTDIO opt_zstdio.h # POSIX kernel options P1003_1B_MQUEUE opt_posix.h Modified: head/sys/kern/kern_shutdown.c ============================================================================== --- head/sys/kern/kern_shutdown.c Tue Feb 13 19:19:26 2018 (r329239) +++ head/sys/kern/kern_shutdown.c Tue Feb 13 19:28:02 2018 (r329240) @@ -174,6 +174,7 @@ struct kerneldumpcrypto { #endif struct kerneldumpcomp { + uint8_t kdc_format; struct compressor *kdc_stream; uint8_t *kdc_buf; size_t kdc_resid; @@ -987,12 +988,23 @@ static struct kerneldumpcomp * kerneldumpcomp_create(struct dumperinfo *di, uint8_t compression) { struct kerneldumpcomp *kdcomp; + int format; - if (compression != KERNELDUMP_COMP_GZIP) + switch (compression) { + case KERNELDUMP_COMP_GZIP: + format = COMPRESS_GZIP; + break; + case KERNELDUMP_COMP_ZSTD: + format = COMPRESS_ZSTD; + break; + default: return (NULL); + } + kdcomp = malloc(sizeof(*kdcomp), M_DUMPER, M_WAITOK | M_ZERO); + kdcomp->kdc_format = compression; kdcomp->kdc_stream = compressor_init(kerneldumpcomp_write_cb, - COMPRESS_GZIP, di->maxiosize, kerneldump_gzlevel, di); + format, di->maxiosize, kerneldump_gzlevel, di); if (kdcomp->kdc_stream == NULL) { free(kdcomp, M_DUMPER); return (NULL); @@ -1293,7 +1305,7 @@ dump_start(struct dumperinfo *di, struct kerneldumphea * will occupy, so try to use the whole swap partition * (minus the first 64KB) in the hope that the * compressed dump will fit. If that doesn't turn out to - * be enouch, the bounds checking in dump_write() + * be enough, the bounds checking in dump_write() * will catch us and cause the dump to fail. */ dumpextent = di->mediasize - SIZEOF_METADATA - @@ -1463,7 +1475,7 @@ dump_init_header(const struct dumperinfo *di, struct k if (panicstr != NULL) strlcpy(kdh->panicstring, panicstr, sizeof(kdh->panicstring)); if (di->kdcomp != NULL) - kdh->compression = KERNELDUMP_COMP_GZIP; + kdh->compression = di->kdcomp->kdc_format; kdh->parity = kerneldump_parity(kdh); } Modified: head/sys/kern/kern_sig.c ============================================================================== --- head/sys/kern/kern_sig.c Tue Feb 13 19:19:26 2018 (r329239) +++ head/sys/kern/kern_sig.c Tue Feb 13 19:28:02 2018 (r329240) @@ -3253,7 +3253,8 @@ sysctl_debug_num_cores_check (SYSCTL_HANDLER_ARGS) SYSCTL_PROC(_debug, OID_AUTO, ncores, CTLTYPE_INT|CTLFLAG_RW, 0, sizeof(int), sysctl_debug_num_cores_check, "I", ""); -#define GZ_SUFFIX ".gz" +#define GZIP_SUFFIX ".gz" +#define ZSTD_SUFFIX ".zst" int compress_user_cores = 0; @@ -3273,7 +3274,9 @@ sysctl_compress_user_cores(SYSCTL_HANDLER_ARGS) } SYSCTL_PROC(_kern, OID_AUTO, compress_user_cores, CTLTYPE_INT | CTLFLAG_RWTUN, 0, sizeof(int), sysctl_compress_user_cores, "I", - "Enable compression of user corefiles (" __XSTRING(COMPRESS_GZIP) " = gzip)"); + "Enable compression of user corefiles (" + __XSTRING(COMPRESS_GZIP) " = gzip, " + __XSTRING(COMPRESS_ZSTD) " = zstd)"); int compress_user_cores_level = 6; SYSCTL_INT(_kern, OID_AUTO, compress_user_cores_level, CTLFLAG_RWTUN, @@ -3377,7 +3380,9 @@ corefile_open(const char *comm, uid_t uid, pid_t pid, sx_sunlock(&corefilename_lock); free(hostname, M_TEMP); if (compress == COMPRESS_GZIP) - sbuf_printf(&sb, GZ_SUFFIX); + sbuf_printf(&sb, GZIP_SUFFIX); + else if (compress == COMPRESS_ZSTD) + sbuf_printf(&sb, ZSTD_SUFFIX); if (sbuf_error(&sb) != 0) { log(LOG_ERR, "pid %ld (%s), uid (%lu): corename is too " "long\n", (long)pid, comm, (u_long)uid); Modified: head/sys/kern/subr_compressor.c ============================================================================== --- head/sys/kern/subr_compressor.c Tue Feb 13 19:19:26 2018 (r329239) +++ head/sys/kern/subr_compressor.c Tue Feb 13 19:28:02 2018 (r329240) @@ -2,6 +2,7 @@ * SPDX-License-Identifier: BSD-2-Clause-FreeBSD * * Copyright (c) 2014, 2017 Mark Johnston + * Copyright (c) 2017 Conrad Meyer * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are @@ -34,8 +35,10 @@ __FBSDID("$FreeBSD$"); #include "opt_gzio.h" +#include "opt_zstdio.h" #include +#include #include #include @@ -244,6 +247,232 @@ struct compressor_methods gzip_methods = { DATA_SET(compressors, gzip_methods); #endif /* GZIO */ + +#ifdef ZSTDIO + +#define ZSTD_STATIC_LINKING_ONLY +#include + +struct zstdio_stream { + ZSTD_CCtx *zst_stream; + ZSTD_inBuffer zst_inbuffer; + ZSTD_outBuffer zst_outbuffer; + uint8_t * zst_buffer; /* output buffer */ + size_t zst_maxiosz; /* Max output IO size */ + off_t zst_off; /* offset into the output stream */ + void * zst_static_wkspc; +}; + +static void *zstdio_init(size_t maxiosize, int level); +static void zstdio_reset(void *stream); +static int zstdio_write(void *stream, void *data, size_t len, + compressor_cb_t, void *); +static void zstdio_fini(void *stream); + +static void * +zstdio_init(size_t maxiosize, int level) +{ + ZSTD_CCtx *dump_compressor; + struct zstdio_stream *s; + void *wkspc, *owkspc, *buffer; + size_t wkspc_size, buf_size; + + wkspc_size = ZSTD_estimateCStreamSize(level); + owkspc = wkspc = malloc(wkspc_size + 8, M_COMPRESS, + M_WAITOK | M_NODUMP); + /* Zstd API requires 8-byte alignment. */ + if ((uintptr_t)wkspc % 8 != 0) + wkspc = (void *)roundup2((uintptr_t)wkspc, 8); + + dump_compressor = ZSTD_initStaticCCtx(wkspc, wkspc_size); + if (dump_compressor == NULL) { + free(owkspc, M_COMPRESS); + printf("%s: workspace too small.\n", __func__); + return (NULL); + } + + (void)ZSTD_CCtx_setParameter(dump_compressor, ZSTD_p_checksumFlag, 1); + + buf_size = ZSTD_CStreamOutSize() * 2; + buffer = malloc(buf_size, M_COMPRESS, M_WAITOK | M_NODUMP); + + s = malloc(sizeof(*s), M_COMPRESS, M_NODUMP | M_WAITOK); + s->zst_buffer = buffer; + s->zst_outbuffer.dst = buffer; + s->zst_outbuffer.size = buf_size; + s->zst_maxiosz = maxiosize; + s->zst_stream = dump_compressor; + s->zst_static_wkspc = owkspc; + + zstdio_reset(s); + + return (s); +} + +static void +zstdio_reset(void *stream) +{ + struct zstdio_stream *s; + size_t res; + + s = stream; + res = ZSTD_resetCStream(s->zst_stream, 0); + if (ZSTD_isError(res)) + panic("%s: could not reset stream %p: %s\n", __func__, s, + ZSTD_getErrorName(res)); + + s->zst_off = 0; + s->zst_inbuffer.src = NULL; + s->zst_inbuffer.size = 0; + s->zst_inbuffer.pos = 0; + s->zst_outbuffer.pos = 0; +} + +static int +zst_flush_intermediate(struct zstdio_stream *s, compressor_cb_t cb, void *arg) +{ + size_t bytes_to_dump; + int error; + + /* Flush as many full output blocks as possible. */ + /* XXX: 4096 is arbitrary safe HDD block size for kernel dumps */ + while (s->zst_outbuffer.pos >= 4096) { + bytes_to_dump = rounddown(s->zst_outbuffer.pos, 4096); + + if (bytes_to_dump > s->zst_maxiosz) + bytes_to_dump = s->zst_maxiosz; + + error = cb(s->zst_buffer, bytes_to_dump, s->zst_off, arg); + if (error != 0) + return (error); + + /* + * Shift any non-full blocks up to the front of the output + * buffer. + */ + s->zst_outbuffer.pos -= bytes_to_dump; + memmove(s->zst_outbuffer.dst, + (char *)s->zst_outbuffer.dst + bytes_to_dump, + s->zst_outbuffer.pos); + s->zst_off += bytes_to_dump; + } + return (0); +} + +static int +zstdio_flush(struct zstdio_stream *s, compressor_cb_t cb, void *arg) +{ + size_t rc, lastpos; + int error; + + /* + * Positive return indicates unflushed data remaining; need to call + * endStream again after clearing out room in output buffer. + */ + rc = 1; + lastpos = s->zst_outbuffer.pos; + while (rc > 0) { + rc = ZSTD_endStream(s->zst_stream, &s->zst_outbuffer); + if (ZSTD_isError(rc)) { + printf("%s: ZSTD_endStream failed (%s)\n", __func__, + ZSTD_getErrorName(rc)); + return (EIO); + } + if (lastpos == s->zst_outbuffer.pos) { + printf("%s: did not make forward progress endStream %zu\n", + __func__, lastpos); + return (EIO); + } + + error = zst_flush_intermediate(s, cb, arg); + if (error != 0) + return (error); + + lastpos = s->zst_outbuffer.pos; + } + + /* + * We've already done an intermediate flush, so all full blocks have + * been written. Only a partial block remains. Padding happens in a + * higher layer. + */ + if (s->zst_outbuffer.pos != 0) { + error = cb(s->zst_buffer, s->zst_outbuffer.pos, s->zst_off, + arg); + if (error != 0) + return (error); + } + + return (0); +} + +static int +zstdio_write(void *stream, void *data, size_t len, compressor_cb_t cb, + void *arg) +{ + struct zstdio_stream *s; + size_t lastpos, rc; + int error; + + s = stream; + if (data == NULL) + return (zstdio_flush(s, cb, arg)); + + s->zst_inbuffer.src = data; + s->zst_inbuffer.size = len; + s->zst_inbuffer.pos = 0; + lastpos = 0; + + while (s->zst_inbuffer.pos < s->zst_inbuffer.size) { + rc = ZSTD_compressStream(s->zst_stream, &s->zst_outbuffer, + &s->zst_inbuffer); + if (ZSTD_isError(rc)) { + printf("%s: Compress failed on %p! (%s)\n", + __func__, data, ZSTD_getErrorName(rc)); + return (EIO); + } + + if (lastpos == s->zst_inbuffer.pos) { + /* + * XXX: May need flushStream to make forward progress + */ + printf("ZSTD: did not make forward progress @pos %zu\n", + lastpos); + return (EIO); + } + lastpos = s->zst_inbuffer.pos; + + error = zst_flush_intermediate(s, cb, arg); + if (error != 0) + return (error); + } + return (0); +} + +static void +zstdio_fini(void *stream) +{ + struct zstdio_stream *s; + + s = stream; + if (s->zst_static_wkspc != NULL) + free(s->zst_static_wkspc, M_COMPRESS); + else + ZSTD_freeCCtx(s->zst_stream); + free(s->zst_buffer, M_COMPRESS); + free(s, M_COMPRESS); +} + +static struct compressor_methods zstd_methods = { + .format = COMPRESS_ZSTD, + .init = zstdio_init, + .reset = zstdio_reset, + .write = zstdio_write, + .fini = zstdio_fini, +}; +DATA_SET(compressors, zstd_methods); + +#endif /* ZSTDIO */ bool compressor_avail(int format) Modified: head/sys/sys/compressor.h ============================================================================== --- head/sys/sys/compressor.h Tue Feb 13 19:19:26 2018 (r329239) +++ head/sys/sys/compressor.h Tue Feb 13 19:28:02 2018 (r329240) @@ -35,6 +35,7 @@ /* Supported formats. */ #define COMPRESS_GZIP 1 +#define COMPRESS_ZSTD 2 typedef int (*compressor_cb_t)(void *, size_t, off_t, void *); Modified: head/sys/sys/kerneldump.h ============================================================================== --- head/sys/sys/kerneldump.h Tue Feb 13 19:19:26 2018 (r329239) +++ head/sys/sys/kerneldump.h Tue Feb 13 19:28:02 2018 (r329240) @@ -59,6 +59,7 @@ #define KERNELDUMP_COMP_NONE 0 #define KERNELDUMP_COMP_GZIP 1 +#define KERNELDUMP_COMP_ZSTD 2 #define KERNELDUMP_ENC_NONE 0 #define KERNELDUMP_ENC_AES_256_CBC 1 From owner-svn-src-all@freebsd.org Tue Feb 13 19:43:26 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9C0FCF1E47F; Tue, 13 Feb 2018 19:43:26 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: from mail-it0-x22c.google.com (mail-it0-x22c.google.com [IPv6:2607:f8b0:4001:c0b::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 2D5356CDDB; Tue, 13 Feb 2018 19:43:26 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: by mail-it0-x22c.google.com with SMTP id n206so12205826itg.1; Tue, 13 Feb 2018 11:43:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=zJcUCHazPIKRq3ZzD5ceQNTIEiNbB8Mn0yib87yXeWg=; b=jwGhLRNO6tkMJol73fenCt1/4B5mdH16NXZrz6nGLVp7Dc3mxyKg0QBzYTWcomKOIv wc9gaANARiArdywh5uYDSPu96jw1zQslbubknWwau9aiUsbkZ9vez8V4wY8xfLmyvjro IBnWmCLK23iT7TjjUhadUzazfROfh/JdiiicWHFB/1ZJnlujA2qjh5YKLMKBQvHWnDcF UVWNXmUnHFFYWKBcrKgOzFyeCb7IwCbvfO7s+xevu3YyYmqJOb+U6o0Tr+3VNssIqxWU hE08JCtnJrE7Oc7vxskLCXDau2htqIseROY7kQeH1uGihuKh9bSjDXRdHEB2OPf7MLsI S+IQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=zJcUCHazPIKRq3ZzD5ceQNTIEiNbB8Mn0yib87yXeWg=; b=ifhSgJQGo60OLwn2byWsiVhKYQvmM/6KfETZYuZ/B3jsbSe0j3iut7/DgVcnlhkkFz rjfLbj7CBXbfVIww24v0xuA4Qt1u+TzqVtJrCKZB9U/jTnZe6CuxTXfuxDWae6nmf4ot hoivX8+CjhAr6cF3l2S0rSohImZ1LpUFHrE7oU/c1V9tOzvGDt2eKP9JGse391OvhtNn 8n9RUtanojhqN1dSKj7HXIUBN1Cdtm2UZQJMI3nGIG0UFUa8fYnupYHPuCWDOWnjIp3N b4unREBWrBUphHBCHfBzqFoeoEeU4RJJ9aiyWJWYUoLHFZb8I1nKryKI2Jf5+OHFYYD4 FAqg== X-Gm-Message-State: APf1xPAHkf07JuQXT2H97ykw82xDoaND7sT/TSuU/R6PCpfW1OzcLyTk XT4UbK65XQSsV2ugKP+INPpTEkY/xiUACsrVp/eAog== X-Google-Smtp-Source: AH8x226eBt1I52wPe8okBLiBr3bcxbHtpKAElbJwaQU1JmL0vMwhSS2+3MXujOVbRwv3WF9WF02wQrQ7tFdUA0gp1gI= X-Received: by 10.36.208.4 with SMTP id m4mr1096323itg.69.1518551005370; Tue, 13 Feb 2018 11:43:25 -0800 (PST) MIME-Version: 1.0 Sender: carpeddiem@gmail.com Received: by 10.107.147.9 with HTTP; Tue, 13 Feb 2018 11:43:04 -0800 (PST) In-Reply-To: <1518549829.85310.39.camel@freebsd.org> References: <201802131917.w1DJHmso047463@repo.freebsd.org> <1518549829.85310.39.camel@freebsd.org> From: Ed Maste Date: Tue, 13 Feb 2018 14:43:04 -0500 X-Google-Sender-Auth: pOipul-8t9zivbRfFb8Q2k77IvI Message-ID: Subject: Re: svn commit: r329237 - head/sys/libkern To: Ian Lepore Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Feb 2018 19:43:26 -0000 On 13 February 2018 at 14:23, Ian Lepore wrote: > On Tue, 2018-02-13 at 19:17 +0000, Ed Maste wrote: >> Author: emaste >> Date: Tue Feb 13 19:17:48 2018 >> New Revision: 329237 >> URL: https://svnweb.freebsd.org/changeset/base/329237 >> >> Log: >> libkern: use nul for terminating char rather than 0 >> >> Akin to the change made in r188080 for lib/libc/string/. >> >> Reported by: bde >> Sponsored by: The FreeBSD Foundation > > There are many ways to spell 0. Why are we using something other than > the simplest way? Is it a style rule thing, or is it portability- > correctness, or what? I made the change to improve consistency between lib/libc/string and sys/libkern, which is what Bruce commented on some time ago. I don't have a personal preference for 0 or '\0' but definitely believe that if we have multiple, similar copies of a function they ought to avoid gratuitous differences. (I'm happy to change both trees to 0 if that's preferred.) From owner-svn-src-all@freebsd.org Tue Feb 13 19:52:14 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 97943F1EF21; Tue, 13 Feb 2018 19:52:14 +0000 (UTC) (envelope-from eric@vangyzen.net) Received: from smtp.vangyzen.net (hotblack.vangyzen.net [199.48.133.146]) by mx1.freebsd.org (Postfix) with ESMTP id 47C6E6D3D5; Tue, 13 Feb 2018 19:52:13 +0000 (UTC) (envelope-from eric@vangyzen.net) Received: from sweettea.beer.town (unknown [76.164.8.130]) by smtp.vangyzen.net (Postfix) with ESMTPSA id 0E1965646B; Tue, 13 Feb 2018 13:52:12 -0600 (CST) Subject: Re: svn commit: r329237 - head/sys/libkern To: Ed Maste , Ian Lepore Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201802131917.w1DJHmso047463@repo.freebsd.org> <1518549829.85310.39.camel@freebsd.org> From: Eric van Gyzen Message-ID: <1b3a489d-d62c-6f88-a269-a35ad9bf5ef5@vangyzen.net> Date: Tue, 13 Feb 2018 13:52:11 -0600 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Feb 2018 19:52:14 -0000 On 02/13/2018 13:43, Ed Maste wrote: > On 13 February 2018 at 14:23, Ian Lepore wrote: >> On Tue, 2018-02-13 at 19:17 +0000, Ed Maste wrote: >>> Author: emaste >>> Date: Tue Feb 13 19:17:48 2018 >>> New Revision: 329237 >>> URL: https://svnweb.freebsd.org/changeset/base/329237 >>> >>> Log: >>> libkern: use nul for terminating char rather than 0 >>> >>> Akin to the change made in r188080 for lib/libc/string/. >>> >>> Reported by: bde >>> Sponsored by: The FreeBSD Foundation >> >> There are many ways to spell 0. Why are we using something other than >> the simplest way? Is it a style rule thing, or is it portability- >> correctness, or what? > > I made the change to improve consistency between lib/libc/string and > sys/libkern, which is what Bruce commented on some time ago. I don't > have a personal preference for 0 or '\0' but definitely believe that > if we have multiple, similar copies of a function they ought to avoid > gratuitous differences. (I'm happy to change both trees to 0 if that's > preferred.) I prefer '\0' here because it tells the reader that it's a NUL character, as opposed to a NULL pointer or a zero integer. Yes, the reader should already know that, but the author can /help/ the reader by communicating more clearly and completely. Eric From owner-svn-src-all@freebsd.org Tue Feb 13 19:54:48 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BAF1CF1F1DA for ; Tue, 13 Feb 2018 19:54:48 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from pmta2.delivery6.ore.mailhop.org (pmta2.delivery6.ore.mailhop.org [54.200.129.228]) (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 46B036D78E for ; Tue, 13 Feb 2018 19:54:47 +0000 (UTC) (envelope-from ian@freebsd.org) X-MHO-User: ac67eb81-10f7-11e8-b951-f99fef315fd9 X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 67.177.211.60 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [67.177.211.60]) by outbound2.ore.mailhop.org (Halon) with ESMTPSA id ac67eb81-10f7-11e8-b951-f99fef315fd9; Tue, 13 Feb 2018 19:54:17 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id w1DJsdSs038527; Tue, 13 Feb 2018 12:54:39 -0700 (MST) (envelope-from ian@freebsd.org) Message-ID: <1518551679.72050.4.camel@freebsd.org> Subject: Re: svn commit: r329237 - head/sys/libkern From: Ian Lepore To: Ed Maste Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Tue, 13 Feb 2018 12:54:39 -0700 In-Reply-To: References: <201802131917.w1DJHmso047463@repo.freebsd.org> <1518549829.85310.39.camel@freebsd.org> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.18.5.1 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Feb 2018 19:54:48 -0000 On Tue, 2018-02-13 at 14:43 -0500, Ed Maste wrote: > On 13 February 2018 at 14:23, Ian Lepore wrote: > > > > On Tue, 2018-02-13 at 19:17 +0000, Ed Maste wrote: > > > > > > Author: emaste > > > Date: Tue Feb 13 19:17:48 2018 > > > New Revision: 329237 > > > URL: https://svnweb.freebsd.org/changeset/base/329237 > > > > > > Log: > > >   libkern: use nul for terminating char rather than 0 > > > > > >   Akin to the change made in r188080 for lib/libc/string/. > > > > > >   Reported by:        bde > > >   Sponsored by:       The FreeBSD Foundation > > There are many ways to spell 0.  Why are we using something other > > than > > the simplest way?  Is it a style rule thing, or is it portability- > > correctness, or what? > I made the change to improve consistency between lib/libc/string and > sys/libkern, which is what Bruce commented on some time ago. I don't > have a personal preference for 0 or '\0' but definitely believe that > if we have multiple, similar copies of a function they ought to avoid > gratuitous differences. (I'm happy to change both trees to 0 if > that's > preferred.) > Oh, I agree completely about consistancy being important.  I just wanted to know whether I should try to remember to always use \0 because it's a rule or has some benefit I didn't know about. 20+ years ago I used to slavishly ensure I always used \0 when a char type was involved, just as a personal style thing.  Then over time I came to the conclusion that "0 is 0 no matter how you spell it, so keep it simple" (except for pointers... even in c++ I've always used NULL). -- Ian From owner-svn-src-all@freebsd.org Tue Feb 13 20:07:41 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1574BF1FF7F; Tue, 13 Feb 2018 20:07:41 +0000 (UTC) (envelope-from landonf@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B88D56E1D3; Tue, 13 Feb 2018 20:07:40 +0000 (UTC) (envelope-from landonf@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B242D2573A; Tue, 13 Feb 2018 20:07:40 +0000 (UTC) (envelope-from landonf@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1DK7e6j073345; Tue, 13 Feb 2018 20:07:40 GMT (envelope-from landonf@FreeBSD.org) Received: (from landonf@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1DK7exX073343; Tue, 13 Feb 2018 20:07:40 GMT (envelope-from landonf@FreeBSD.org) Message-Id: <201802132007.w1DK7exX073343@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: landonf set sender to landonf@FreeBSD.org using -f From: "Landon J. Fuller" Date: Tue, 13 Feb 2018 20:07:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329241 - head/sys/dev/bwn X-SVN-Group: head X-SVN-Commit-Author: landonf X-SVN-Commit-Paths: head/sys/dev/bwn X-SVN-Commit-Revision: 329241 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Feb 2018 20:07:41 -0000 Author: landonf Date: Tue Feb 13 20:07:40 2018 New Revision: 329241 URL: https://svnweb.freebsd.org/changeset/base/329241 Log: bwn(4): Conditionalize "RX decryption attempted" message on a new BWN_DEBUG_HWCRYPTO debug flag. The MAC will attempt decryption (and set BWN_RX_MAC_DEC) even if a key has not been supplied to the hardware; this is expected behavior, and there's no need to spam users' console with this debugging printf. Modified: head/sys/dev/bwn/if_bwn.c head/sys/dev/bwn/if_bwn_debug.h Modified: head/sys/dev/bwn/if_bwn.c ============================================================================== --- head/sys/dev/bwn/if_bwn.c Tue Feb 13 19:28:02 2018 (r329240) +++ head/sys/dev/bwn/if_bwn.c Tue Feb 13 20:07:40 2018 (r329241) @@ -5983,7 +5983,6 @@ bwn_rxeof(struct bwn_mac *mac, struct mbuf *m, const v int padding, rate, rssi = 0, noise = 0, type; uint16_t phytype, phystat0, phystat3, chanstat; unsigned char *mp = mtod(m, unsigned char *); - static int rx_mac_dec_rpt = 0; BWN_ASSERT_LOCKED(sc); @@ -6032,11 +6031,12 @@ bwn_rxeof(struct bwn_mac *mac, struct mbuf *m, const v } wh = mtod(m, struct ieee80211_frame_min *); - if (macstat & BWN_RX_MAC_DEC && rx_mac_dec_rpt++ < 50) - device_printf(sc->sc_dev, + if (macstat & BWN_RX_MAC_DEC) { + DPRINTF(sc, BWN_DEBUG_HWCRYPTO, "RX decryption attempted (old %d keyidx %#x)\n", BWN_ISOLDFMT(mac), (macstat & BWN_RX_MAC_KEYIDX) >> BWN_RX_MAC_KEYIDX_SHIFT); + } if (phystat0 & BWN_RX_PHYST0_OFDM) rate = bwn_plcp_get_ofdmrate(mac, plcp, Modified: head/sys/dev/bwn/if_bwn_debug.h ============================================================================== --- head/sys/dev/bwn/if_bwn_debug.h Tue Feb 13 19:28:02 2018 (r329240) +++ head/sys/dev/bwn/if_bwn_debug.h Tue Feb 13 20:07:40 2018 (r329241) @@ -53,6 +53,7 @@ enum { BWN_DEBUG_XMIT_POWER = 0x00020000, BWN_DEBUG_PHY = 0x00040000, BWN_DEBUG_EEPROM = 0x00080000, + BWN_DEBUG_HWCRYPTO = 0x00100000, /* HW crypto */ BWN_DEBUG_FATAL = 0x80000000, /* fatal errors */ BWN_DEBUG_ANY = 0xffffffff }; From owner-svn-src-all@freebsd.org Tue Feb 13 20:09:40 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B7DDDF2029E; Tue, 13 Feb 2018 20:09:40 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-io0-f182.google.com (mail-io0-f182.google.com [209.85.223.182]) (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 576A66E48F; Tue, 13 Feb 2018 20:09:40 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-io0-f182.google.com with SMTP id n7so22662483iob.0; Tue, 13 Feb 2018 12:09:40 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:reply-to:in-reply-to:references :from:date:message-id:subject:to:cc; bh=ek02G6ADi+SIr2sj798SOrLWnjKwngPkqkgPgEHoJYc=; b=RimX0GD0hWMbve0QlY3EJ6BwLK3+zZbKxFI+QnCe0uZXFzOAzNjkWC43gRMvBGDx47 9qPwC4vgtbtuG/G1rMlWkI0XTfkw075sx+gt+CfQdsmvqxTwIUtJzzIlGYr953Du+nXW O6yLEUi2SVDCslhi4korqpdKdU1BjE5Yj06GdKQxooY3E7cHEot/s47tD3Y2wtjnqxBw onQbBzZone3F80JYqnQrSqhBwaypmVJmyYP9jWnv+4Af7fr+Z5wLoVQA0BMLO5ljGp2a koQ1R5rg4U3RqZXdgRl0Wrhmh963kk7Ld0ArzchDNJOm7KV7sJJvv38UiCTYpRXFd3XJ wsSg== X-Gm-Message-State: APf1xPCuOUlANzXmIZkDtaAjtRc5rIn6vLzKKR6bEiRk4mLSYjeAL+ZU 4cWp/n2VaRz9d8brn/VGbCsn1XpU X-Google-Smtp-Source: AH8x227MalFyqFSujXMUXVEG5UYCKkvmgwbSHdFj82CD0XX9YrMEzoPGhWuoEGk6E/kxRsckpdHCbw== X-Received: by 10.107.53.22 with SMTP id c22mr2798718ioa.189.1518552574486; Tue, 13 Feb 2018 12:09:34 -0800 (PST) Received: from mail-it0-f42.google.com (mail-it0-f42.google.com. [209.85.214.42]) by smtp.gmail.com with ESMTPSA id x2sm11870804ite.10.2018.02.13.12.09.34 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 13 Feb 2018 12:09:34 -0800 (PST) Received: by mail-it0-f42.google.com with SMTP id 140so4195785iti.0; Tue, 13 Feb 2018 12:09:34 -0800 (PST) X-Received: by 10.36.192.131 with SMTP id u125mr3026460itf.119.1518552573900; Tue, 13 Feb 2018 12:09:33 -0800 (PST) MIME-Version: 1.0 Reply-To: cem@freebsd.org Received: by 10.2.30.149 with HTTP; Tue, 13 Feb 2018 12:09:33 -0800 (PST) In-Reply-To: <1b3a489d-d62c-6f88-a269-a35ad9bf5ef5@vangyzen.net> References: <201802131917.w1DJHmso047463@repo.freebsd.org> <1518549829.85310.39.camel@freebsd.org> <1b3a489d-d62c-6f88-a269-a35ad9bf5ef5@vangyzen.net> From: Conrad Meyer Date: Tue, 13 Feb 2018 12:09:33 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r329237 - head/sys/libkern To: Eric van Gyzen Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Feb 2018 20:09:40 -0000 On Tue, Feb 13, 2018 at 11:52 AM, Eric van Gyzen wrote: > On 02/13/2018 13:43, Ed Maste wrote: >> On 13 February 2018 at 14:23, Ian Lepore wrote: >>> There are many ways to spell 0. Why are we using something other than >>> the simplest way? Is it a style rule thing, or is it portability- >>> correctness, or what? >> >> I made the change to improve consistency between lib/libc/string and >> sys/libkern, >> ... > > I prefer '\0' here because it tells the reader that it's a NUL > character, as opposed to a NULL pointer or a zero integer. Yes, the > reader should already know that, but the author can /help/ the reader by > communicating more clearly and completely. And I prefer 0, because it's easier to type and conveys exactly the same meaning. A character NUL is simply a zero integer of char type. These are standard library string manipulation routines with char pointer types. It is already extremely clear to the reader that the zeros involved are end-of-string sentinels. Best, Conrad From owner-svn-src-all@freebsd.org Tue Feb 13 20:40:27 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9A209F229F5; Tue, 13 Feb 2018 20:40:27 +0000 (UTC) (envelope-from rpokala@mac.com) Received: from mr11p00im-asmtp003.me.com (mr11p00im-asmtp003.me.com [17.110.69.254]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 329906FF09; Tue, 13 Feb 2018 20:40:27 +0000 (UTC) (envelope-from rpokala@mac.com) Received: from process-dkim-sign-daemon.mr11p00im-asmtp003.me.com by mr11p00im-asmtp003.me.com (Oracle Communications Messaging Server 8.0.1.2.20170607 64bit (built Jun 7 2017)) id <0P4300200U98RW00@mr11p00im-asmtp003.me.com>; Tue, 13 Feb 2018 20:40:12 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mac.com; s=04042017; t=1518554412; bh=pRNowctWcuY/WmgRKm+yv7Cfllf7C0I+waUKQZHzC1w=; h=Date:Subject:From:To:Message-id:MIME-version:Content-type; b=rtLQWkIqEeaeZOl0cufp6m9R7OD3DMn7a9BWTC2wiMiKQFk1mhABU+pdm1/6dK0sP bcNo6UeYKNhwyo5YoPjJnNyFGzD5lx1AU7RBZyK86NV3OwKDPO07CQpbK/qeMkn3fb iV6MdH1C1lh30/byJSUOEt4YRqSuzNlVn3GAN7yzvDmYWpPQqwzmkrg1lWDvSE2M/z vRr0GIW1wDnuVVyDQznTPZdB0fiKZEBd4QNibwM1N9JLIp7ssQHTV17bSMXPpAxybg UuWSkf4qtOEvG0oLnU5daZFwKQ2JoYPmBCLbIKBA8EgALWzXLKVDfdYW45g8NdzImF 34mn8fT9VSvag== Received: from icloud.com ([127.0.0.1]) by mr11p00im-asmtp003.me.com (Oracle Communications Messaging Server 8.0.1.2.20170607 64bit (built Jun 7 2017)) with ESMTPSA id <0P4300GGWW2XD010@mr11p00im-asmtp003.me.com>; Tue, 13 Feb 2018 20:40:10 +0000 (GMT) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2018-02-13_11:,, signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 clxscore=1011 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1707230000 definitions=main-1802130245 User-Agent: Microsoft-MacOutlook/10.9.0.180116 Date: Tue, 13 Feb 2018 12:40:08 -0800 Subject: Re: svn commit: r329237 - head/sys/libkern From: Ravi Pokala To: Eric van Gyzen , Ed Maste , Ian Lepore Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-id: Thread-topic: svn commit: r329237 - head/sys/libkern References: <201802131917.w1DJHmso047463@repo.freebsd.org> <1518549829.85310.39.camel@freebsd.org> <1b3a489d-d62c-6f88-a269-a35ad9bf5ef5@vangyzen.net> In-reply-to: <1b3a489d-d62c-6f88-a269-a35ad9bf5ef5@vangyzen.net> MIME-version: 1.0 Content-type: text/plain; charset=UTF-8 Content-transfer-encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Feb 2018 20:40:27 -0000 -----Original Message----- From: on behalf of Eric van Gyzen Date: 2018-02-13, Tuesday at 11:52 To: Ed Maste , Ian Lepore Cc: src-committers , , Subject: Re: svn commit: r329237 - head/sys/libkern > ... > > I prefer '\0' here because it tells the reader that it's a NUL > character, as opposed to a NULL pointer or a zero integer. Yes, the > reader should already know that, but the author can /help/ the reader by > communicating more clearly and completely. > > Eric Out of morbid curiosity, does any standard (or any of our non-standard headers) define a "NUL" macro for use as a manual string terminator? -Ravi (rpokala@) From owner-svn-src-all@freebsd.org Tue Feb 13 20:55:49 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A762FF239FF for ; Tue, 13 Feb 2018 20:55:49 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-io0-x22a.google.com (mail-io0-x22a.google.com [IPv6:2607:f8b0:4001:c06::22a]) (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 136A370DE3 for ; Tue, 13 Feb 2018 20:55:49 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-io0-x22a.google.com with SMTP id m11so22750017iob.2 for ; Tue, 13 Feb 2018 12:55:49 -0800 (PST) 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=epFvpRX+my3GnN0uqKet373QIPyUv57PikhtsSXKr7Q=; b=Hb3BEtKz5Ptz1anLkW8R9qQ6hpo9I1uBobIR9pfi/de+r62/qhGe3zw9USweeMQGNt P8dtG8S0Dira5RLcIXdc4ShKagJPFfCTmAlYulpbR4ASt7GwNhVlsiy140TlGkFOeRxX AuMYNtM7m43Wa725NwXwERQ5ra///ektpTCF/XGgr2r2hPGpaEA2faPArL1N/gxcFoy2 wermtVQgGsY+hQY+DR9T3usWQpawJMbC+u+c9e+ga/LpT04TKQXNXx7Dq494dMGoBcvh W1SlvlAUnSiWfPVSUEKLjQb4anaIIHvEWIGvZbJlaSHWRDLL69b5phnuRgMSWtDvqHiK IIaQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=epFvpRX+my3GnN0uqKet373QIPyUv57PikhtsSXKr7Q=; b=j+r3BOKpENvVlc6p76E7jvXxuA3fDWxhYCUryxtGLETcah+BLtFW4knGwopqGlvKCa TFfYG65lDKrIfe1Rey+ATtGOdNjv9/e8w4n6kzeh1LBcCrPm9DlCqP23UgAibXdtPbDb J5CsBDJV77JYONAMSEQ/67hzq7BkdZqP1afCvb1W39n4AD4riTUUReioDhzmzyFrGhjJ QSn6jcJrDIs5Uwi7qZ6RJkHzcXlJy1ws1KyTAOeK/0bDi/8zfsq6t1PPvuNOqXuxuRkZ SFlToGfdL3lqsdpzHd9P1uBAXHFYTFXyn1YsahtcTX1BQWmYGxU08gmHpxmNRyLih61V NiHA== X-Gm-Message-State: APf1xPCtcHXpSZE/3PYEKywxRdzeGzOkJYasGw1waAb5naDsY1LFmoho +G37oH0bOiQrH4le4UIM46Ekbo4danMsxYE4zNHHuA== X-Google-Smtp-Source: AH8x2246Q+9D6hjKi6KzQR4NA/wLL4613CeYq/KyThmStt3QeqH7WygfUcNXz40ehhzkgUpX9p/GQgXhsW+S4N2DEdw= X-Received: by 10.107.88.12 with SMTP id m12mr2732026iob.136.1518555348338; Tue, 13 Feb 2018 12:55:48 -0800 (PST) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.201.67 with HTTP; Tue, 13 Feb 2018 12:55:47 -0800 (PST) X-Originating-IP: [2607:fb10:7061:7fd::663] In-Reply-To: References: <201802131917.w1DJHmso047463@repo.freebsd.org> <1518549829.85310.39.camel@freebsd.org> <1b3a489d-d62c-6f88-a269-a35ad9bf5ef5@vangyzen.net> From: Warner Losh Date: Tue, 13 Feb 2018 13:55:47 -0700 X-Google-Sender-Auth: nrE71FpvrgDUGfzD18VVqG7_nlI Message-ID: Subject: Re: svn commit: r329237 - head/sys/libkern To: Ravi Pokala Cc: Eric van Gyzen , Ed Maste , Ian Lepore , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.25 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Feb 2018 20:55:49 -0000 On Tue, Feb 13, 2018 at 1:40 PM, Ravi Pokala wrote: > -----Original Message----- > From: on behalf of Eric van Gyzen < > eric@vangyzen.net> > Date: 2018-02-13, Tuesday at 11:52 > To: Ed Maste , Ian Lepore > Cc: src-committers , , > > Subject: Re: svn commit: r329237 - head/sys/libkern > > > ... > > > > I prefer '\0' here because it tells the reader that it's a NUL > > character, as opposed to a NULL pointer or a zero integer. Yes, the > > reader should already know that, but the author can /help/ the reader by > > communicating more clearly and completely. > > > > Eric > > Out of morbid curiosity, does any standard (or any of our non-standard > headers) define a "NUL" macro for use as a manual string terminator? > No. There's no standard define. Warner From owner-svn-src-all@freebsd.org Tue Feb 13 21:11:28 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4F731F00D71; Tue, 13 Feb 2018 21:11:28 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 01235719C5; Tue, 13 Feb 2018 21:11:28 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F01B6261D4; Tue, 13 Feb 2018 21:11:27 +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 w1DLBRmj005174; Tue, 13 Feb 2018 21:11:27 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1DLBRfJ005171; Tue, 13 Feb 2018 21:11:27 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <201802132111.w1DLBRfJ005171@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Tue, 13 Feb 2018 21:11:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r329242 - in stable/11: . secure/lib/libcrypto secure/usr.bin/openssl secure/usr.bin/openssl/man X-SVN-Group: stable-11 X-SVN-Commit-Author: jkim X-SVN-Commit-Paths: in stable/11: . secure/lib/libcrypto secure/usr.bin/openssl secure/usr.bin/openssl/man X-SVN-Commit-Revision: 329242 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Feb 2018 21:11:28 -0000 Author: jkim Date: Tue Feb 13 21:11:27 2018 New Revision: 329242 URL: https://svnweb.freebsd.org/changeset/base/329242 Log: MFC: r329024 Remove c_rehash(1) to not confuse users. Deleted: stable/11/secure/usr.bin/openssl/man/c_rehash.1 Modified: stable/11/ObsoleteFiles.inc stable/11/secure/lib/libcrypto/Makefile.inc stable/11/secure/usr.bin/openssl/Makefile.man Directory Properties: stable/11/ (props changed) Modified: stable/11/ObsoleteFiles.inc ============================================================================== --- stable/11/ObsoleteFiles.inc Tue Feb 13 20:07:40 2018 (r329241) +++ stable/11/ObsoleteFiles.inc Tue Feb 13 21:11:27 2018 (r329242) @@ -38,6 +38,8 @@ # xargs -n1 | sort | uniq -d; # done +# 20180213: remove c_rehash(1) +OLD_FILES+=usr/share/openssl/man/man1/c_rehash.1.gz # 20180212: Obsolete forth files OLD_FILES+=boot/efi.4th OLD_FILES+=boot/pcibios.4th Modified: stable/11/secure/lib/libcrypto/Makefile.inc ============================================================================== --- stable/11/secure/lib/libcrypto/Makefile.inc Tue Feb 13 20:07:40 2018 (r329241) +++ stable/11/secure/lib/libcrypto/Makefile.inc Tue Feb 13 21:11:27 2018 (r329242) @@ -64,14 +64,11 @@ MANDIR= ${SHAREDIR}/openssl/man/man .if defined(LIB) _docs= ${LIB} -.if ${LIB} == ssl -_docs+= man3 -.endif _skip= SSLeay_version des_modes _sec= 3 .else _docs= apps -_skip= config +_skip= c_rehash config _sec= 1 .endif Modified: stable/11/secure/usr.bin/openssl/Makefile.man ============================================================================== --- stable/11/secure/usr.bin/openssl/Makefile.man Tue Feb 13 20:07:40 2018 (r329241) +++ stable/11/secure/usr.bin/openssl/Makefile.man Tue Feb 13 21:11:27 2018 (r329242) @@ -2,7 +2,6 @@ # DO NOT EDIT: generated from man-makefile-update target MAN+= CA.pl.1 MAN+= asn1parse.1 -MAN+= c_rehash.1 MAN+= ca.1 MAN+= ciphers.1 MAN+= cms.1 From owner-svn-src-all@freebsd.org Tue Feb 13 21:14:28 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 22CDCF01171; Tue, 13 Feb 2018 21:14:28 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C4F7C71F0C; Tue, 13 Feb 2018 21:14:27 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A5EF02631A; Tue, 13 Feb 2018 21:14:27 +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 w1DLERKC009286; Tue, 13 Feb 2018 21:14:27 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1DLER6X009285; Tue, 13 Feb 2018 21:14:27 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <201802132114.w1DLER6X009285@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Tue, 13 Feb 2018 21:14:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r329243 - stable/11/crypto/openssl/doc/man3 X-SVN-Group: stable-11 X-SVN-Commit-Author: jkim X-SVN-Commit-Paths: stable/11/crypto/openssl/doc/man3 X-SVN-Commit-Revision: 329243 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Feb 2018 21:14:28 -0000 Author: jkim Date: Tue Feb 13 21:14:27 2018 New Revision: 329243 URL: https://svnweb.freebsd.org/changeset/base/329243 Log: MFC: r329022 Remove an empty directory. Deleted: stable/11/crypto/openssl/doc/man3/ Modified: Directory Properties: stable/11/ (props changed) From owner-svn-src-all@freebsd.org Tue Feb 13 21:22:10 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A9DD0F01B60; Tue, 13 Feb 2018 21:22:10 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 27C8D72546; Tue, 13 Feb 2018 21:22:10 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 22EB426492; Tue, 13 Feb 2018 21:22:10 +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 w1DLMAE8013245; Tue, 13 Feb 2018 21:22:10 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1DLMAbq013244; Tue, 13 Feb 2018 21:22:10 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201802132122.w1DLMAbq013244@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Tue, 13 Feb 2018 21:22:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329244 - head/share/man/man9 X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/share/man/man9 X-SVN-Commit-Revision: 329244 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Feb 2018 21:22:10 -0000 Author: emaste Date: Tue Feb 13 21:22:09 2018 New Revision: 329244 URL: https://svnweb.freebsd.org/changeset/base/329244 Log: Document DECLARE_MODULE_TIED It was introduced in r213716. Reviewed by: kib Sponsored by: The FreeBSD Foundation Modified: head/share/man/man9/DECLARE_MODULE.9 Modified: head/share/man/man9/DECLARE_MODULE.9 ============================================================================== --- head/share/man/man9/DECLARE_MODULE.9 Tue Feb 13 21:14:27 2018 (r329243) +++ head/share/man/man9/DECLARE_MODULE.9 Tue Feb 13 21:22:09 2018 (r329244) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 6, 2005 +.Dd February 13, 2018 .Dt DECLARE_MODULE 9 .Os .Sh NAME @@ -39,6 +39,7 @@ .In sys/kernel.h .In sys/module.h .Fn DECLARE_MODULE "name" "moduledata_t data" "sub" "order" +.Fn DECLARE_MODULE_TIED "name" "moduledata_t data" "sub" "order" .Sh DESCRIPTION The .Fn DECLARE_MODULE @@ -55,7 +56,17 @@ and Of course, it can also be called directly, for example in order to implement dynamic sysctls. .Pp -The arguments it expects are: +A module declared with +.Fn DECLARE_MODULE_TIED +will load only if the running kernel version +(as specified by +.Dv __FreeBSD_version ) +is identical to that on which it was built. +This declaration should be used by modules which depend on interfaces beyond +the stable kernel KBI (such as ABI emulators or hypervisors that rely on +internal kernel structures). +.Pp +The arguments are: .Bl -tag -width indent .It Fa name The module name, which will be used in the From owner-svn-src-all@freebsd.org Tue Feb 13 21:33:41 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6149CF0291E; Tue, 13 Feb 2018 21:33:41 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 14B1B72DCD; Tue, 13 Feb 2018 21:33:41 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0F96A26645; Tue, 13 Feb 2018 21:33:41 +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 w1DLXexs019115; Tue, 13 Feb 2018 21:33:40 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1DLXe7o019114; Tue, 13 Feb 2018 21:33:40 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201802132133.w1DLXe7o019114@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Tue, 13 Feb 2018 21:33:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329245 - head/share/man/man9 X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/share/man/man9 X-SVN-Commit-Revision: 329245 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Feb 2018 21:33:41 -0000 Author: emaste Date: Tue Feb 13 21:33:40 2018 New Revision: 329245 URL: https://svnweb.freebsd.org/changeset/base/329245 Log: Add DECLARE_MODULE_TIED mlink missed in r329244 Reported by: imp Modified: head/share/man/man9/Makefile Modified: head/share/man/man9/Makefile ============================================================================== --- head/share/man/man9/Makefile Tue Feb 13 21:22:09 2018 (r329244) +++ head/share/man/man9/Makefile Tue Feb 13 21:33:40 2018 (r329245) @@ -858,6 +858,7 @@ MLINKS+=crypto.9 crypto_dispatch.9 \ crypto.9 crypto_unregister_all.9 MLINKS+=DB_COMMAND.9 DB_SHOW_ALL_COMMAND.9 \ DB_COMMAND.9 DB_SHOW_COMMAND.9 +MLINKS+=DECLARE_MODULE.9 DECLARE_MODULE_TIED.9 MLINKS+=dev_clone.9 drain_dev_clone_events.9 MLINKS+=devfs_set_cdevpriv.9 devfs_clear_cdevpriv.9 \ devfs_set_cdevpriv.9 devfs_get_cdevpriv.9 From owner-svn-src-all@freebsd.org Tue Feb 13 22:37:55 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4DB14F073AB; Tue, 13 Feb 2018 22:37:55 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 003A675E1D; Tue, 13 Feb 2018 22:37:55 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EE9DB27038; Tue, 13 Feb 2018 22:37:54 +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 w1DMbslP049425; Tue, 13 Feb 2018 22:37:54 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1DMbs7p049423; Tue, 13 Feb 2018 22:37:54 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201802132237.w1DMbs7p049423@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Tue, 13 Feb 2018 22:37:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r329246 - stable/11/usr.sbin/kldxref X-SVN-Group: stable-11 X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: stable/11/usr.sbin/kldxref X-SVN-Commit-Revision: 329246 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Feb 2018 22:37:55 -0000 Author: emaste Date: Tue Feb 13 22:37:54 2018 New Revision: 329246 URL: https://svnweb.freebsd.org/changeset/base/329246 Log: MFC r327503: kldxref: correct function names in warning messages Sponsored by: The FreeBSD Foundation Modified: stable/11/usr.sbin/kldxref/ef.c stable/11/usr.sbin/kldxref/ef_obj.c Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.sbin/kldxref/ef.c ============================================================================== --- stable/11/usr.sbin/kldxref/ef.c Tue Feb 13 21:33:40 2018 (r329245) +++ stable/11/usr.sbin/kldxref/ef.c Tue Feb 13 22:37:54 2018 (r329246) @@ -473,7 +473,7 @@ ef_seg_read_rel(elf_file_t ef, Elf_Off offset, size_t if (ofs == 0) { if (ef->ef_verbose) - warnx("ef_seg_read(%s): zero offset (%lx:%ld)", + warnx("ef_seg_read_rel(%s): zero offset (%lx:%ld)", ef->ef_name, (long)offset, ofs); return EFAULT; } Modified: stable/11/usr.sbin/kldxref/ef_obj.c ============================================================================== --- stable/11/usr.sbin/kldxref/ef_obj.c Tue Feb 13 21:33:40 2018 (r329245) +++ stable/11/usr.sbin/kldxref/ef_obj.c Tue Feb 13 22:37:54 2018 (r329246) @@ -225,7 +225,7 @@ ef_obj_seg_read(elf_file_t ef, Elf_Off offset, size_t if (offset + len > ef->size) { if (ef->ef_verbose) - warnx("ef_seg_read_rel(%s): bad offset/len (%lx:%ld)", + warnx("ef_obj_seg_read(%s): bad offset/len (%lx:%ld)", ef->ef_name, (long)offset, (long)len); return (EFAULT); } @@ -244,7 +244,7 @@ ef_obj_seg_read_rel(elf_file_t ef, Elf_Off offset, siz if (offset + len > ef->size) { if (ef->ef_verbose) - warnx("ef_seg_read_rel(%s): bad offset/len (%lx:%ld)", + warnx("ef_obj_seg_read_rel(%s): bad offset/len (%lx:%ld)", ef->ef_name, (long)offset, (long)len); return (EFAULT); } From owner-svn-src-all@freebsd.org Tue Feb 13 22:40:34 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 47BE4F0769F; Tue, 13 Feb 2018 22:40:34 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id ED7FE7601C; Tue, 13 Feb 2018 22:40:33 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E22A727040; Tue, 13 Feb 2018 22:40:33 +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 w1DMeX65051793; Tue, 13 Feb 2018 22:40:33 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1DMeX2m051789; Tue, 13 Feb 2018 22:40:33 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201802132240.w1DMeX2m051789@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Tue, 13 Feb 2018 22:40:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r329247 - stable/11/usr.sbin/kldxref X-SVN-Group: stable-11 X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: stable/11/usr.sbin/kldxref X-SVN-Commit-Revision: 329247 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Feb 2018 22:40:34 -0000 Author: emaste Date: Tue Feb 13 22:40:33 2018 New Revision: 329247 URL: https://svnweb.freebsd.org/changeset/base/329247 Log: MFC r328052: kldxref: handle modules with md_cval at end of allocated secs Attempting to retrieve an md_cval string from a kernel module with kldxref would throw a offset error for modules created using lld, since this value would be placed at the end of all allocated sections. Add an ef_read_seg_string method to the ef interface, to allow reading strings of varying size without attempting to read beyond the segment's bounds. PR: 224875 Submitted by: Mitchell Horne Sponsored by: The FreeBSD Foundation Modified: stable/11/usr.sbin/kldxref/ef.c stable/11/usr.sbin/kldxref/ef.h stable/11/usr.sbin/kldxref/ef_obj.c stable/11/usr.sbin/kldxref/kldxref.c Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.sbin/kldxref/ef.c ============================================================================== --- stable/11/usr.sbin/kldxref/ef.c Tue Feb 13 22:37:54 2018 (r329246) +++ stable/11/usr.sbin/kldxref/ef.c Tue Feb 13 22:40:33 2018 (r329247) @@ -88,6 +88,8 @@ static int ef_read_entry(elf_file_t ef, Elf_Off offset static int ef_seg_read(elf_file_t ef, Elf_Off offset, size_t len, void *dest); static int ef_seg_read_rel(elf_file_t ef, Elf_Off offset, size_t len, void *dest); +static int ef_seg_read_string(elf_file_t ef, Elf_Off offset, size_t len, + char *dest); static int ef_seg_read_entry(elf_file_t ef, Elf_Off offset, size_t len, void **ptr); static int ef_seg_read_entry_rel(elf_file_t ef, Elf_Off offset, size_t len, @@ -104,6 +106,7 @@ static struct elf_file_ops ef_file_ops = { ef_read_entry, ef_seg_read, ef_seg_read_rel, + ef_seg_read_string, ef_seg_read_entry, ef_seg_read_entry_rel, ef_symaddr, @@ -492,6 +495,28 @@ ef_seg_read_rel(elf_file_t ef, Elf_Off offset, size_t if (error != 0) return (error); } + return (0); +} + +static int +ef_seg_read_string(elf_file_t ef, Elf_Off offset, size_t len, char *dest) +{ + u_long ofs = ef_get_offset(ef, offset); + ssize_t r; + + if (ofs == 0 || ofs == (Elf_Off)-1) { + if (ef->ef_verbose) + warnx("ef_seg_read_string(%s): bad offset (%lx:%ld)", + ef->ef_name, (long)offset, ofs); + return (EFAULT); + } + + r = pread(ef->ef_fd, dest, len, ofs); + if (r < 0) + return (errno); + if (strnlen(dest, len) == len) + return (EFAULT); + return (0); } Modified: stable/11/usr.sbin/kldxref/ef.h ============================================================================== --- stable/11/usr.sbin/kldxref/ef.h Tue Feb 13 22:37:54 2018 (r329246) +++ stable/11/usr.sbin/kldxref/ef.h Tue Feb 13 22:40:33 2018 (r329247) @@ -21,6 +21,8 @@ (ef)->ef_ops->seg_read((ef)->ef_ef, offset, len, dest) #define EF_SEG_READ_REL(ef, offset, len, dest) \ (ef)->ef_ops->seg_read_rel((ef)->ef_ef, offset, len, dest) +#define EF_SEG_READ_STRING(ef, offset, len, dest) \ + (ef)->ef_ops->seg_read_string((ef)->ef_ef, offset, len, dest) #define EF_SEG_READ_ENTRY(ef, offset, len, ptr) \ (ef)->ef_ops->seg_read_entry((ef)->kf_ef, offset, len, ptr) #define EF_SEG_READ_ENTRY_REL(ef, offset, len, ptr) \ @@ -44,6 +46,8 @@ struct elf_file_ops { int (*seg_read)(elf_file_t ef, Elf_Off offset, size_t len, void *dest); int (*seg_read_rel)(elf_file_t ef, Elf_Off offset, size_t len, void *dest); + int (*seg_read_string)(elf_file_t, Elf_Off offset, size_t len, + char *dest); int (*seg_read_entry)(elf_file_t ef, Elf_Off offset, size_t len, void**ptr); int (*seg_read_entry_rel)(elf_file_t ef, Elf_Off offset, size_t len, Modified: stable/11/usr.sbin/kldxref/ef_obj.c ============================================================================== --- stable/11/usr.sbin/kldxref/ef_obj.c Tue Feb 13 22:37:54 2018 (r329246) +++ stable/11/usr.sbin/kldxref/ef_obj.c Tue Feb 13 22:40:33 2018 (r329247) @@ -108,6 +108,8 @@ static int ef_obj_seg_read(elf_file_t ef, Elf_Off offs void *dest); static int ef_obj_seg_read_rel(elf_file_t ef, Elf_Off offset, size_t len, void *dest); +static int ef_obj_seg_read_string(elf_file_t ef, Elf_Off offset, size_t len, + char *dest); static int ef_obj_seg_read_entry(elf_file_t ef, Elf_Off offset, size_t len, void **ptr); static int ef_obj_seg_read_entry_rel(elf_file_t ef, Elf_Off offset, size_t len, @@ -124,6 +126,7 @@ static struct elf_file_ops ef_obj_file_ops = { ef_obj_read_entry, ef_obj_seg_read, ef_obj_seg_read_rel, + ef_obj_seg_read_string, ef_obj_seg_read_entry, ef_obj_seg_read_entry_rel, ef_obj_symaddr, @@ -293,6 +296,27 @@ ef_obj_seg_read_rel(elf_file_t ef, Elf_Off offset, siz return (error); } } + return (0); +} + +static int +ef_obj_seg_read_string(elf_file_t ef, Elf_Off offset, size_t len, char *dest) +{ + + if (offset >= ef->size) { + if (ef->ef_verbose) + warnx("ef_obj_seg_read_string(%s): bad offset (%lx)", + ef->ef_name, (long)offset); + return (EFAULT); + } + + if (ef->size - offset < len) + len = ef->size - offset; + + if (strnlen(ef->address + offset, len) == len) + return (EFAULT); + + memcpy(dest, ef->address + offset, len); return (0); } Modified: stable/11/usr.sbin/kldxref/kldxref.c ============================================================================== --- stable/11/usr.sbin/kldxref/kldxref.c Tue Feb 13 22:37:54 2018 (r329246) +++ stable/11/usr.sbin/kldxref/kldxref.c Tue Feb 13 22:40:33 2018 (r329247) @@ -569,9 +569,8 @@ read_kld(char *filename, char *kldname) check(EF_SEG_READ_REL(&ef, (Elf_Off)*p, sizeof(md), &md)); p++; - check(EF_SEG_READ(&ef, (Elf_Off)md.md_cval, + check(EF_SEG_READ_STRING(&ef, (Elf_Off)md.md_cval, sizeof(cval), cval)); - cval[MAXMODNAME] = '\0'; parse_entry(&md, cval, &ef, kldname); } if (error) From owner-svn-src-all@freebsd.org Tue Feb 13 22:43:09 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E6B80F07BA9; Tue, 13 Feb 2018 22:43:08 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 98731765BB; Tue, 13 Feb 2018 22:43:08 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 93589271CD; Tue, 13 Feb 2018 22:43:08 +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 w1DMh8kc054407; Tue, 13 Feb 2018 22:43:08 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1DMh7IY054400; Tue, 13 Feb 2018 22:43:07 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201802132243.w1DMh7IY054400@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 13 Feb 2018 22:43:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r329249 - in stable/11: cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety cddl/contrib/opensolaris/lib/libdtrace/common cddl/usr.sbin/dtrace/tests/common/safety cddl/usr.sbin/d... X-SVN-Group: stable-11 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in stable/11: cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety cddl/contrib/opensolaris/lib/libdtrace/common cddl/usr.sbin/dtrace/tests/common/safety cddl/usr.sbin/dtrace/tests/tools sys/cdd... X-SVN-Commit-Revision: 329249 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Feb 2018 22:43:09 -0000 Author: markj Date: Tue Feb 13 22:43:07 2018 New Revision: 329249 URL: https://svnweb.freebsd.org/changeset/base/329249 Log: MFC r327888, r327972, r327973: Add "jid" and "jailname" variables to DTrace. Added: stable/11/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.jailname.d - copied unchanged from r327888, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.jailname.d stable/11/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.jid.d - copied unchanged from r327888, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.jid.d Modified: stable/11/cddl/contrib/opensolaris/lib/libdtrace/common/dt_open.c stable/11/cddl/usr.sbin/dtrace/tests/common/safety/Makefile stable/11/cddl/usr.sbin/dtrace/tests/tools/exclude.sh stable/11/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c stable/11/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace.h Directory Properties: stable/11/ (props changed) Copied: stable/11/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.jailname.d (from r327888, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.jailname.d) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.jailname.d Tue Feb 13 22:43:07 2018 (r329249, copy of r327888, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.jailname.d) @@ -0,0 +1,44 @@ +/* + * This file and its contents are supplied under the terms of the + * Common Development and Distribution License ("CDDL"), version 1.0. + * You may only use this file in accordance with the terms version + * 1.0 of the CDDL. + * + * A full copy of the text of the CDDL should have accompanied this + * source. A copy of the CDDL is also available via the Internet at + * http://www.illumos.org/license/CDDL. + */ + +/* + * Copyright 2018 Domagoj Stolfa . + * + * This software was developed by BAE Systems, the University of Cambridge + * Computer Laboratory, and Memorial University under DARPA/AFRL contract + * FA8650-15-C-7558 ("CADETS"), as part of the DARPA Transparent Computing + * (TC) research program. + * + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * collect jailname at every fbt probe and at every firing of a + * high-frequency profile probe + */ + +fbt::: +{ + @a[jailname] = count(); +} + +profile-4999hz +{ + @a[jailname] = count(); +} + +tick-1sec +/n++ == 10/ +{ + exit(0); +} Copied: stable/11/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.jid.d (from r327888, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.jid.d) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.jid.d Tue Feb 13 22:43:07 2018 (r329249, copy of r327888, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.jid.d) @@ -0,0 +1,44 @@ +/* + * This file and its contents are supplied under the terms of the + * Common Development and Distribution License ("CDDL"), version 1.0. + * You may only use this file in accordance with the terms version + * 1.0 of the CDDL. + * + * A full copy of the text of the CDDL should have accompanied this + * source. A copy of the CDDL is also available via the Internet at + * http://www.illumos.org/license/CDDL. + */ + +/* + * Copyright 2018 Domagoj Stolfa . + * + * This software was developed by BAE Systems, the University of Cambridge + * Computer Laboratory, and Memorial University under DARPA/AFRL contract + * FA8650-15-C-7558 ("CADETS"), as part of the DARPA Transparent Computing + * (TC) research program. + * + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * collect jid at every fbt probe and at every firing of a + * high-frequency profile probe + */ + +fbt::: +{ + @a[jid] = count(); +} + +profile-4999hz +{ + @a[jid] = count(); +} + +tick-1sec +/n++ == 10/ +{ + exit(0); +} Modified: stable/11/cddl/contrib/opensolaris/lib/libdtrace/common/dt_open.c ============================================================================== --- stable/11/cddl/contrib/opensolaris/lib/libdtrace/common/dt_open.c Tue Feb 13 22:42:25 2018 (r329248) +++ stable/11/cddl/contrib/opensolaris/lib/libdtrace/common/dt_open.c Tue Feb 13 22:43:07 2018 (r329249) @@ -311,6 +311,12 @@ static const dt_ident_t _dtrace_globals[] = { DT_VERS_1_5, &dt_idops_func, "string(int, void *)" }, { "ipl", DT_IDENT_SCALAR, 0, DIF_VAR_IPL, DT_ATTR_STABCMN, DT_VERS_1_0, &dt_idops_type, "uint_t" }, +#ifdef __FreeBSD__ +{ "jailname", DT_IDENT_SCALAR, 0, DIF_VAR_JAILNAME, + DT_ATTR_STABCMN, DT_VERS_1_13, &dt_idops_type, "string" }, +{ "jid", DT_IDENT_SCALAR, 0, DIF_VAR_JID, DT_ATTR_STABCMN, DT_VERS_1_13, + &dt_idops_type, "int" }, +#endif { "json", DT_IDENT_FUNC, 0, DIF_SUBR_JSON, DT_ATTR_STABCMN, DT_VERS_1_11, &dt_idops_func, "string(const char *, const char *)" }, { "jstack", DT_IDENT_ACTFUNC, 0, DT_ACT_JSTACK, DT_ATTR_STABCMN, DT_VERS_1_0, @@ -530,10 +536,8 @@ static const dt_ident_t _dtrace_globals[] = { { "walltimestamp", DT_IDENT_SCALAR, 0, DIF_VAR_WALLTIMESTAMP, DT_ATTR_STABCMN, DT_VERS_1_0, &dt_idops_type, "int64_t" }, -#ifdef illumos { "zonename", DT_IDENT_SCALAR, 0, DIF_VAR_ZONENAME, DT_ATTR_STABCMN, DT_VERS_1_0, &dt_idops_type, "string" }, -#endif #ifndef illumos { "cpu", DT_IDENT_SCALAR, 0, DIF_VAR_CPU, Modified: stable/11/cddl/usr.sbin/dtrace/tests/common/safety/Makefile ============================================================================== --- stable/11/cddl/usr.sbin/dtrace/tests/common/safety/Makefile Tue Feb 13 22:42:25 2018 (r329248) +++ stable/11/cddl/usr.sbin/dtrace/tests/common/safety/Makefile Tue Feb 13 22:43:07 2018 (r329249) @@ -19,6 +19,8 @@ ${PACKAGE}FILES= \ tst.gid.d \ tst.hton.d \ tst.index.d \ + tst.jailname.d \ + tst.jid.d \ tst.msgdsize.d \ tst.msgsize.d \ tst.null.d \ Modified: stable/11/cddl/usr.sbin/dtrace/tests/tools/exclude.sh ============================================================================== --- stable/11/cddl/usr.sbin/dtrace/tests/tools/exclude.sh Tue Feb 13 22:42:25 2018 (r329248) +++ stable/11/cddl/usr.sbin/dtrace/tests/tools/exclude.sh Tue Feb 13 22:43:07 2018 (r329249) @@ -41,7 +41,6 @@ exclude EXFAIL common/misc/tst.include.ksh exclude EXFAIL common/safety/tst.copyin2.d exclude EXFAIL common/safety/tst.msgdsize.d exclude EXFAIL common/safety/tst.msgsize.d -exclude EXFAIL common/safety/tst.zonename.d exclude EXFAIL common/scalars/tst.misc.d exclude EXFAIL common/scalars/tst.selfarray2.d exclude EXFAIL common/sched/tst.enqueue.d Modified: stable/11/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c ============================================================================== --- stable/11/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c Tue Feb 13 22:42:25 2018 (r329248) +++ stable/11/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c Tue Feb 13 22:43:07 2018 (r329249) @@ -3537,6 +3537,24 @@ dtrace_dif_variable(dtrace_mstate_t *mstate, dtrace_st return (dtrace_dif_varstr( (uintptr_t)curthread->t_procp->p_zone->zone_name, state, mstate)); +#elif defined(__FreeBSD__) + /* + * On FreeBSD, we introduce compatibility to zonename by falling through + * into jailname. + */ + case DIF_VAR_JAILNAME: + if (!dtrace_priv_kernel(state)) + return (0); + + return (dtrace_dif_varstr( + (uintptr_t)curthread->td_ucred->cr_prison->pr_name, + state, mstate)); + + case DIF_VAR_JID: + if (!dtrace_priv_kernel(state)) + return (0); + + return ((uint64_t)curthread->td_ucred->cr_prison->pr_id); #else return (0); #endif Modified: stable/11/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace.h ============================================================================== --- stable/11/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace.h Tue Feb 13 22:42:25 2018 (r329248) +++ stable/11/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace.h Tue Feb 13 22:43:07 2018 (r329249) @@ -254,6 +254,8 @@ typedef enum dtrace_probespec { #define DIF_VAR_GID 0x011f /* process group ID */ #define DIF_VAR_ERRNO 0x0120 /* thread errno */ #define DIF_VAR_EXECARGS 0x0121 /* process arguments */ +#define DIF_VAR_JID 0x0122 /* process jail id */ +#define DIF_VAR_JAILNAME 0x0123 /* process jail name */ #ifndef illumos #define DIF_VAR_CPU 0x0200 From owner-svn-src-all@freebsd.org Wed Feb 14 00:12:03 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CDB35F0E543; Wed, 14 Feb 2018 00:12:03 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7CBB679E90; Wed, 14 Feb 2018 00:12:03 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 77A8961; Wed, 14 Feb 2018 00:12:03 +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 w1E0C3MQ099338; Wed, 14 Feb 2018 00:12:03 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1E0C3ma099337; Wed, 14 Feb 2018 00:12:03 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201802140012.w1E0C3ma099337@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Wed, 14 Feb 2018 00:12:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329251 - head/sys/kgssapi X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/sys/kgssapi X-SVN-Commit-Revision: 329251 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Feb 2018 00:12:04 -0000 Author: cem Date: Wed Feb 14 00:12:03 2018 New Revision: 329251 URL: https://svnweb.freebsd.org/changeset/base/329251 Log: kgssapi: Remove trivial deadcode CID: 1385956 Reported by: Coverity Sponsored by: Dell EMC Isilon Modified: head/sys/kgssapi/gss_impl.c Modified: head/sys/kgssapi/gss_impl.c ============================================================================== --- head/sys/kgssapi/gss_impl.c Tue Feb 13 22:46:06 2018 (r329250) +++ head/sys/kgssapi/gss_impl.c Wed Feb 14 00:12:03 2018 (r329251) @@ -287,8 +287,6 @@ kgssapi_modevent(module_t mod, int type, void *data) switch (type) { case MOD_LOAD: - if (error != 0) - return (error); rpc_gss_entries.rpc_gss_refresh_auth = rpc_gss_refresh_auth; rpc_gss_entries.rpc_gss_secfind = rpc_gss_secfind; rpc_gss_entries.rpc_gss_secpurge = rpc_gss_secpurge; From owner-svn-src-all@freebsd.org Wed Feb 14 00:25:19 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E88E9F0F50A; Wed, 14 Feb 2018 00:25:18 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9F09A7A5FD; Wed, 14 Feb 2018 00:25:18 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 99F88268; Wed, 14 Feb 2018 00:25:18 +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 w1E0PIKv004314; Wed, 14 Feb 2018 00:25:18 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1E0PIvc004313; Wed, 14 Feb 2018 00:25:18 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201802140025.w1E0PIvc004313@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 14 Feb 2018 00:25:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329252 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 329252 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Feb 2018 00:25:19 -0000 Author: kib Date: Wed Feb 14 00:25:18 2018 New Revision: 329252 URL: https://svnweb.freebsd.org/changeset/base/329252 Log: Do not call pmap_enter() with invalid protection mode. If the map entry elookup was performed due to the mapping changes, we need to ensure that there is still some access permission bit requested which is compatible with the current vm_map_entry mode. If not, restart the handler from scratch instead of trying to save the current progress. Also adjust fault_type to not include cleared permission bits. Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D14347 Modified: head/sys/vm/vm_fault.c Modified: head/sys/vm/vm_fault.c ============================================================================== --- head/sys/vm/vm_fault.c Wed Feb 14 00:12:03 2018 (r329251) +++ head/sys/vm/vm_fault.c Wed Feb 14 00:25:18 2018 (r329252) @@ -1219,6 +1219,12 @@ readrest: * write-enabled after all. */ prot &= retry_prot; + fault_type &= retry_prot; + if (prot == 0) { + release_page(&fs); + unlock_and_deallocate(&fs); + goto RetryFault; + } } } From owner-svn-src-all@freebsd.org Wed Feb 14 00:31:38 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 655A8F0FDD1; Wed, 14 Feb 2018 00:31:38 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 17EC07ABA7; Wed, 14 Feb 2018 00:31:38 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 129AE2E0; Wed, 14 Feb 2018 00:31:38 +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 w1E0VbRA009300; Wed, 14 Feb 2018 00:31:37 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1E0VbCg009299; Wed, 14 Feb 2018 00:31:37 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201802140031.w1E0VbCg009299@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 14 Feb 2018 00:31:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r329253 - stable/11/usr.bin/sort X-SVN-Group: stable-11 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/11/usr.bin/sort X-SVN-Commit-Revision: 329253 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Feb 2018 00:31:38 -0000 Author: markj Date: Wed Feb 14 00:31:37 2018 New Revision: 329253 URL: https://svnweb.freebsd.org/changeset/base/329253 Log: MFC r312667 (by pfg): sort - Don't live-loop threads. Modified: stable/11/usr.bin/sort/radixsort.c Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.bin/sort/radixsort.c ============================================================================== --- stable/11/usr.bin/sort/radixsort.c Wed Feb 14 00:25:18 2018 (r329252) +++ stable/11/usr.bin/sort/radixsort.c Wed Feb 14 00:31:37 2018 (r329253) @@ -83,12 +83,12 @@ static struct level_stack *g_ls; #if defined(SORT_THREADS) /* stack guarding mutex */ +static pthread_cond_t g_ls_cond; static pthread_mutex_t g_ls_mutex; /* counter: how many items are left */ static size_t sort_left; /* guarding mutex */ -static pthread_mutex_t sort_left_mutex; /* semaphore to count threads */ static sem_t mtsem; @@ -99,23 +99,25 @@ static sem_t mtsem; static inline void sort_left_dec(size_t n) { - - pthread_mutex_lock(&sort_left_mutex); + pthread_mutex_lock(&g_ls_mutex); sort_left -= n; - pthread_mutex_unlock(&sort_left_mutex); + if (sort_left == 0 && nthreads > 1) + pthread_cond_broadcast(&g_ls_cond); + pthread_mutex_unlock(&g_ls_mutex); } /* * Do we have something to sort ? + * + * This routine does not need to be locked. */ static inline bool have_sort_left(void) { bool ret; - pthread_mutex_lock(&sort_left_mutex); ret = (sort_left > 0); - pthread_mutex_unlock(&sort_left_mutex); + return (ret); } @@ -146,6 +148,11 @@ push_ls(struct sort_level *sl) #if defined(SORT_THREADS) if (nthreads > 1) + pthread_cond_signal(&g_ls_cond); +#endif + +#if defined(SORT_THREADS) + if (nthreads > 1) pthread_mutex_unlock(&g_ls_mutex); #endif } @@ -184,13 +191,19 @@ pop_ls_mt(void) pthread_mutex_lock(&g_ls_mutex); - if (g_ls) { - sl = g_ls->sl; - saved_ls = g_ls; - g_ls = g_ls->next; - } else { + for (;;) { + if (g_ls) { + sl = g_ls->sl; + saved_ls = g_ls; + g_ls = g_ls->next; + break; + } sl = NULL; saved_ls = NULL; + + if (have_sort_left() == 0) + break; + pthread_cond_wait(&g_ls_cond, &g_ls_mutex); } pthread_mutex_unlock(&g_ls_mutex); @@ -495,13 +508,8 @@ run_sort_cycle_mt(void) for (;;) { slc = pop_ls_mt(); - if (slc == NULL) { - if (have_sort_left()) { - pthread_yield(); - continue; - } + if (slc == NULL) break; - } run_sort_level_next(slc); } } @@ -512,9 +520,7 @@ run_sort_cycle_mt(void) static void* sort_thread(void* arg) { - run_sort_cycle_mt(); - sem_post(&mtsem); return (arg); @@ -610,8 +616,7 @@ run_top_sort_level(struct sort_level *sl) pthread_t pth; pthread_attr_init(&attr); - pthread_attr_setdetachstate(&attr, - PTHREAD_DETACHED); + pthread_attr_setdetachstate(&attr, PTHREAD_DETACHED); for (;;) { int res = pthread_create(&pth, &attr, @@ -628,7 +633,7 @@ run_top_sort_level(struct sort_level *sl) pthread_attr_destroy(&attr); } - for(i = 0; i < nthreads; ++i) + for (i = 0; i < nthreads; ++i) sem_wait(&mtsem); } #endif /* defined(SORT_THREADS) */ @@ -651,7 +656,7 @@ run_sort(struct sort_list_item **base, size_t nmemb) pthread_mutexattr_settype(&mattr, PTHREAD_MUTEX_ADAPTIVE_NP); pthread_mutex_init(&g_ls_mutex, &mattr); - pthread_mutex_init(&sort_left_mutex, &mattr); + pthread_cond_init(&g_ls_cond, NULL); pthread_mutexattr_destroy(&mattr); @@ -679,7 +684,6 @@ run_sort(struct sort_list_item **base, size_t nmemb) if (nthreads > 1) { sem_destroy(&mtsem); pthread_mutex_destroy(&g_ls_mutex); - pthread_mutex_destroy(&sort_left_mutex); } nthreads = nthreads_save; #endif From owner-svn-src-all@freebsd.org Wed Feb 14 00:31:46 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8D784F0FE2A; Wed, 14 Feb 2018 00:31:46 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 210727ACAE; Wed, 14 Feb 2018 00:31:46 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E277A2EE; Wed, 14 Feb 2018 00:31: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 w1E0VjfR009350; Wed, 14 Feb 2018 00:31:45 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1E0Vj4w009349; Wed, 14 Feb 2018 00:31:45 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201802140031.w1E0Vj4w009349@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 14 Feb 2018 00:31:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329254 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 329254 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Feb 2018 00:31:46 -0000 Author: kib Date: Wed Feb 14 00:31:45 2018 New Revision: 329254 URL: https://svnweb.freebsd.org/changeset/base/329254 Log: Ensure memory consistency on COW. From the submitter description: The process is forked transitioning a map entry to COW Thread A writes to a page on the map entry, faults, updates the pmap to writable at a new phys addr, and starts TLB invalidations... Thread B acquires a lock, writes to a location on the new phys addr, and releases the lock Thread C acquires the lock, reads from the location on the old phys addr... Thread A ...continues the TLB invalidations which are completed Thread C ...reads from the location on the new phys addr, and releases the lock In this example Thread B and C [lock, use and unlock] properly and neither own the lock at the same time. Thread A was writing somewhere else on the page and so never had/needed the lock. Thread C sees a location that is only ever read|modified under a lock change beneath it while it is the lock owner. To fix this, perform the two-stage update of the copied PTE. First, the PTE is updated with the address of the new physical page with copied content, but in read-only mode. The pmap locking and the page busy state during PTE update and TLB invalidation IPIs ensure that any writer to the page cannot upgrade the PTE to the writable state until all CPUs updated their TLB to not cache old mapping. Then, after the busy state of the page is lifted, the faults for write can proceed and do not violate the consistency of the reads. The change is done in vm_fault because most architectures do need IPIs to invalidate remote TLBs. More, I think that hardware guarantees of atomicity of the remote TLB invalidation are not enough to prevent the inconsistent reads of non-atomic reads, like multi-word accesses protected by a lock. So instead of modifying each pmap invalidation code, I did it there. Discovered and analyzed by: Elliott.Rabe@dell.com Reviewed by: markj PR: 225584 (appeared to have the same cause) Tested by: Elliott.Rabe@dell.com, emaste, Mike Tancsa , truckman Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D14347 Modified: head/sys/vm/vm_fault.c Modified: head/sys/vm/vm_fault.c ============================================================================== --- head/sys/vm/vm_fault.c Wed Feb 14 00:31:37 2018 (r329253) +++ head/sys/vm/vm_fault.c Wed Feb 14 00:31:45 2018 (r329254) @@ -1135,6 +1135,10 @@ readrest: */ pmap_copy_page(fs.m, fs.first_m); fs.first_m->valid = VM_PAGE_BITS_ALL; + if ((fault_flags & VM_FAULT_WIRE) == 0) { + prot &= ~VM_PROT_WRITE; + fault_type &= ~VM_PROT_WRITE; + } if (wired && (fault_flags & VM_FAULT_WIRE) == 0) { vm_page_lock(fs.first_m); From owner-svn-src-all@freebsd.org Wed Feb 14 00:32:20 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BAFBCF10059; Wed, 14 Feb 2018 00:32:20 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C0E97AF87; Wed, 14 Feb 2018 00:32:20 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 46F51417; Wed, 14 Feb 2018 00:32:20 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1E0WK0S009440; Wed, 14 Feb 2018 00:32:20 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1E0WKKl009439; Wed, 14 Feb 2018 00:32:20 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201802140032.w1E0WKKl009439@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 14 Feb 2018 00:32:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r329255 - stable/11/usr.bin/sort X-SVN-Group: stable-11 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/11/usr.bin/sort X-SVN-Commit-Revision: 329255 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Feb 2018 00:32:20 -0000 Author: markj Date: Wed Feb 14 00:32:19 2018 New Revision: 329255 URL: https://svnweb.freebsd.org/changeset/base/329255 Log: MFC r328995: Fix the WITH_SORT_THREADS build. PR: 201664 Modified: stable/11/usr.bin/sort/radixsort.c Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.bin/sort/radixsort.c ============================================================================== --- stable/11/usr.bin/sort/radixsort.c Wed Feb 14 00:31:45 2018 (r329254) +++ stable/11/usr.bin/sort/radixsort.c Wed Feb 14 00:32:19 2018 (r329255) @@ -127,6 +127,14 @@ have_sort_left(void) #endif /* SORT_THREADS */ +static void +_push_ls(struct level_stack *ls) +{ + + ls->next = g_ls; + g_ls = ls; +} + /* * Push sort level to the stack */ @@ -139,22 +147,14 @@ push_ls(struct sort_level *sl) new_ls->sl = sl; #if defined(SORT_THREADS) - if (nthreads > 1) + if (nthreads > 1) { pthread_mutex_lock(&g_ls_mutex); -#endif - - new_ls->next = g_ls; - g_ls = new_ls; - -#if defined(SORT_THREADS) - if (nthreads > 1) + _push_ls(new_ls); pthread_cond_signal(&g_ls_cond); -#endif - -#if defined(SORT_THREADS) - if (nthreads > 1) pthread_mutex_unlock(&g_ls_mutex); + } else #endif + _push_ls(new_ls); } /* From owner-svn-src-all@freebsd.org Wed Feb 14 00:34:02 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A8265F1035B; Wed, 14 Feb 2018 00:34:02 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7D9E17B243; Wed, 14 Feb 2018 00:34:02 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5F3BA42C; Wed, 14 Feb 2018 00:34:02 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1E0Y2tf009579; Wed, 14 Feb 2018 00:34:02 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1E0Y2c3009578; Wed, 14 Feb 2018 00:34:02 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201802140034.w1E0Y2c3009578@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 14 Feb 2018 00:34:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329256 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 329256 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Feb 2018 00:34:02 -0000 Author: kib Date: Wed Feb 14 00:34:02 2018 New Revision: 329256 URL: https://svnweb.freebsd.org/changeset/base/329256 Log: Cleanup unused page argument for vm_reserv_break(). Reviewed by: markj MFC after: 1 week Differential revision: https://reviews.freebsd.org/D14364 Modified: head/sys/vm/vm_reserv.c Modified: head/sys/vm/vm_reserv.c ============================================================================== --- head/sys/vm/vm_reserv.c Wed Feb 14 00:32:19 2018 (r329255) +++ head/sys/vm/vm_reserv.c Wed Feb 14 00:34:02 2018 (r329256) @@ -259,7 +259,7 @@ struct mtx_padalign vm_reserv_object_mtx[VM_RESERV_OBJ #define vm_reserv_object_unlock(object) \ mtx_unlock(vm_reserv_object_lock_ptr((object))) -static void vm_reserv_break(vm_reserv_t rv, vm_page_t m); +static void vm_reserv_break(vm_reserv_t rv); static void vm_reserv_depopulate(vm_reserv_t rv, int index); static vm_reserv_t vm_reserv_from_page(vm_page_t m); static boolean_t vm_reserv_has_pindex(vm_reserv_t rv, @@ -934,34 +934,21 @@ vm_reserv_alloc_page(vm_object_t object, vm_pindex_t p } /* - * Breaks the given reservation. Except for the specified free page, all free - * pages in the reservation are returned to the physical memory allocator. - * The reservation's population count and map are reset to their initial - * state. + * Breaks the given reservation. All free pages in the reservation + * are returned to the physical memory allocator. The reservation's + * population count and map are reset to their initial state. * * The given reservation must not be in the partially populated reservation * queue. The free page queue lock must be held. */ static void -vm_reserv_break(vm_reserv_t rv, vm_page_t m) +vm_reserv_break(vm_reserv_t rv) { int begin_zeroes, hi, i, lo; vm_domain_free_assert_locked(VM_DOMAIN(rv->domain)); vm_reserv_remove(rv); rv->pages->psind = 0; - if (m != NULL) { - /* - * Since the reservation is being broken, there is no harm in - * abusing the population map to stop "m" from being returned - * to the physical memory allocator. - */ - i = m - rv->pages; - KASSERT(popmap_is_clear(rv->popmap, i), - ("vm_reserv_break: reserv %p's popmap is corrupted", rv)); - popmap_set(rv->popmap, i); - rv->popcnt++; - } i = hi = 0; do { /* Find the next 0 bit. Any previous 0 bits are < "hi". */ @@ -1039,7 +1026,7 @@ vm_reserv_break_all(vm_object_t object) TAILQ_REMOVE(&vm_rvq_partpop[rv->domain], rv, partpopq); rv->inpartpopq = FALSE; } - vm_reserv_break(rv, NULL); + vm_reserv_break(rv); } if (vmd != NULL) vm_domain_free_unlock(vmd); @@ -1156,7 +1143,7 @@ vm_reserv_reclaim(vm_reserv_t rv) rv, rv->domain)); TAILQ_REMOVE(&vm_rvq_partpop[rv->domain], rv, partpopq); rv->inpartpopq = FALSE; - vm_reserv_break(rv, NULL); + vm_reserv_break(rv); vm_reserv_reclaimed++; } From owner-svn-src-all@freebsd.org Wed Feb 14 02:48:27 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C0FE2F1A6E6; Wed, 14 Feb 2018 02:48:27 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6C4C87F7E9; Wed, 14 Feb 2018 02:48:27 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6420A194F; Wed, 14 Feb 2018 02:48:27 +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 w1E2mRvT073532; Wed, 14 Feb 2018 02:48:27 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1E2mRQ9073531; Wed, 14 Feb 2018 02:48:27 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201802140248.w1E2mRQ9073531@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Wed, 14 Feb 2018 02:48:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329257 - head/sys/powerpc/pseries X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: head/sys/powerpc/pseries X-SVN-Commit-Revision: 329257 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Feb 2018 02:48:27 -0000 Author: jhibbits Date: Wed Feb 14 02:48:27 2018 New Revision: 329257 URL: https://svnweb.freebsd.org/changeset/base/329257 Log: powerpc64/pseries: Define new hcalls Summary: Define new hcalls as in 'Linux on Power Architecture Platform Reference' version 1.1 (24 March 2016) downloaded from: https://members.openpowerfoundation.org/document/dl/469 Submitted by: Breno Leitao Differential Revision: https://reviews.freebsd.org/D14281 Modified: head/sys/powerpc/pseries/phyp-hvcall.h Modified: head/sys/powerpc/pseries/phyp-hvcall.h ============================================================================== --- head/sys/powerpc/pseries/phyp-hvcall.h Wed Feb 14 00:34:02 2018 (r329256) +++ head/sys/powerpc/pseries/phyp-hvcall.h Wed Feb 14 02:48:27 2018 (r329257) @@ -296,7 +296,25 @@ #define H_VPM_STAT 0x2bc #define H_SET_MPP 0x2d0 #define H_GET_MPP 0x2d4 -#define MAX_HCALL_OPCODE H_GET_MPP +#define H_MO_PERF 0x2d8 +#define H_REG_SUB_CRQ 0x2dc +#define H_FREE_SUB_CRQ 0x2e0 +#define H_SEND_SUB_CRQ 0x2e4 +#define H_SEND_SUB_CRQ_IND 0x2e8 +#define H_HOME_NODE_ASSOC 0x2ec +/* Reserved ... */ +#define H_BEST_ENERGY 0x2f4 +#define H_REG_SNS 0x2f8 +#define H_X_XIRR 0x2fc +#define H_RANDOM 0x300 +/* Reserved ... */ +#define H_COP_OP 0x304 +#define H_STOP_COP_OP 0x308 +#define H_GET_MPP_X 0x314 +#define H_SET_MODE 0x31C +/* Reserved ... */ +#define H_GET_DMA_XLATES_L 0x324 +#define MAX_HCALL_OPCODE H_GET_DMA_XLATES_L int64_t phyp_hcall(uint64_t opcode, ...); int64_t phyp_pft_hcall(uint64_t opcode, uint64_t flags, uint64_t pteidx, From owner-svn-src-all@freebsd.org Wed Feb 14 02:51:28 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A1ECDF1AA8A; Wed, 14 Feb 2018 02:51:28 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 557307FB88; Wed, 14 Feb 2018 02:51:28 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5081919AD; Wed, 14 Feb 2018 02:51:28 +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 w1E2pSpW074476; Wed, 14 Feb 2018 02:51:28 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1E2pSoA074475; Wed, 14 Feb 2018 02:51:28 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201802140251.w1E2pSoA074475@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Wed, 14 Feb 2018 02:51:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329258 - head/sys/powerpc/pseries X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: head/sys/powerpc/pseries X-SVN-Commit-Revision: 329258 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Feb 2018 02:51:28 -0000 Author: jhibbits Date: Wed Feb 14 02:51:28 2018 New Revision: 329258 URL: https://svnweb.freebsd.org/changeset/base/329258 Log: PPC64: Get the timestap from the proper OF field Summary: After revision rS328534('PPC64: use hwref instead of cpuid'), FreeBSD on powerpc64 virtual machine panics since it is unable to read the timebase, showing the following error: get-property for timebase-frequency on zero phandle panic: Unable to determine timebase frequency! With the change above, cpuref->cr_hwref does not contain the phandle anymore, thus, it never reads the proper CPU entry in OF. Submitted by: Breno Leitao Differential Revision: https://reviews.freebsd.org/D14204 Modified: head/sys/powerpc/pseries/platform_chrp.c Modified: head/sys/powerpc/pseries/platform_chrp.c ============================================================================== --- head/sys/powerpc/pseries/platform_chrp.c Wed Feb 14 02:48:27 2018 (r329257) +++ head/sys/powerpc/pseries/platform_chrp.c Wed Feb 14 02:51:28 2018 (r329258) @@ -285,12 +285,24 @@ chrp_real_maxaddr(platform_t plat) static u_long chrp_timebase_freq(platform_t plat, struct cpuref *cpuref) { - phandle_t phandle; + phandle_t cpus, cpunode; int32_t ticks = -1; + int res; + char buf[8]; - phandle = cpuref->cr_hwref; + cpus = OF_finddevice("/cpus"); + if (cpus <= 0) + panic("CPU tree not found on Open Firmware\n"); - OF_getencprop(phandle, "timebase-frequency", &ticks, sizeof(ticks)); + for (cpunode = OF_child(cpus); cpunode != 0; cpunode = OF_peer(cpunode)) { + res = OF_getprop(cpunode, "device_type", buf, sizeof(buf)); + if (res > 0 && strcmp(buf, "cpu") == 0) + break; + } + if (cpunode <= 0) + panic("CPU node not found on Open Firmware\n"); + + OF_getencprop(cpunode, "timebase-frequency", &ticks, sizeof(ticks)); if (ticks <= 0) panic("Unable to determine timebase frequency!"); From owner-svn-src-all@freebsd.org Wed Feb 14 04:11:33 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A31F2F20702; Wed, 14 Feb 2018 04:11:33 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from c.mail.sonic.net (c.mail.sonic.net [64.142.111.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 385FA826A3; Wed, 14 Feb 2018 04:11:33 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from zeppelin.tachypleus.net (cpe-75-82-218-62.socal.res.rr.com [75.82.218.62]) (authenticated bits=0) by c.mail.sonic.net (8.15.1/8.15.1) with ESMTPSA id w1E4BSap011739 (version=TLSv1.2 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT); Tue, 13 Feb 2018 20:11:29 -0800 Subject: Re: svn commit: r329257 - head/sys/powerpc/pseries To: Justin Hibbits , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201802140248.w1E2mRQ9073531@repo.freebsd.org> From: Nathan Whitehorn Message-ID: Date: Tue, 13 Feb 2018 20:11:28 -0800 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 MIME-Version: 1.0 In-Reply-To: <201802140248.w1E2mRQ9073531@repo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-Sonic-CAuth: UmFuZG9tSVbsKgPEspO6ST0hQgP9oqQqwBYMhUZVpLS+AyjOHwC4NrptfkzqWjRcDp4MOIbpdW1rtAEWxjM2D6wujY0Zx+9w3KDd0Esn8Yw= X-Sonic-ID: C;xIFgIT0R6BGz91DNXaHR5A== M;nuwLIj0R6BGz91DNXaHR5A== X-Spam-Flag: No X-Sonic-Spam-Details: 0.0/5.0 by cerberusd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Feb 2018 04:11:33 -0000 There is another set of these that Linux added recently that are used for Meltdown/Spectre workarounds. Might be worth importing while these are being updated... -Nathan On 02/13/18 18:48, Justin Hibbits wrote: > Author: jhibbits > Date: Wed Feb 14 02:48:27 2018 > New Revision: 329257 > URL: https://svnweb.freebsd.org/changeset/base/329257 > > Log: > powerpc64/pseries: Define new hcalls > > Summary: > Define new hcalls as in 'Linux on Power Architecture Platform Reference' > version 1.1 (24 March 2016) downloaded from: > > https://members.openpowerfoundation.org/document/dl/469 > > Submitted by: Breno Leitao > Differential Revision: https://reviews.freebsd.org/D14281 > > Modified: > head/sys/powerpc/pseries/phyp-hvcall.h > > Modified: head/sys/powerpc/pseries/phyp-hvcall.h > ============================================================================== > --- head/sys/powerpc/pseries/phyp-hvcall.h Wed Feb 14 00:34:02 2018 (r329256) > +++ head/sys/powerpc/pseries/phyp-hvcall.h Wed Feb 14 02:48:27 2018 (r329257) > @@ -296,7 +296,25 @@ > #define H_VPM_STAT 0x2bc > #define H_SET_MPP 0x2d0 > #define H_GET_MPP 0x2d4 > -#define MAX_HCALL_OPCODE H_GET_MPP > +#define H_MO_PERF 0x2d8 > +#define H_REG_SUB_CRQ 0x2dc > +#define H_FREE_SUB_CRQ 0x2e0 > +#define H_SEND_SUB_CRQ 0x2e4 > +#define H_SEND_SUB_CRQ_IND 0x2e8 > +#define H_HOME_NODE_ASSOC 0x2ec > +/* Reserved ... */ > +#define H_BEST_ENERGY 0x2f4 > +#define H_REG_SNS 0x2f8 > +#define H_X_XIRR 0x2fc > +#define H_RANDOM 0x300 > +/* Reserved ... */ > +#define H_COP_OP 0x304 > +#define H_STOP_COP_OP 0x308 > +#define H_GET_MPP_X 0x314 > +#define H_SET_MODE 0x31C > +/* Reserved ... */ > +#define H_GET_DMA_XLATES_L 0x324 > +#define MAX_HCALL_OPCODE H_GET_DMA_XLATES_L > > int64_t phyp_hcall(uint64_t opcode, ...); > int64_t phyp_pft_hcall(uint64_t opcode, uint64_t flags, uint64_t pteidx, > From owner-svn-src-all@freebsd.org Wed Feb 14 05:20:30 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7CD21F00FFD; Wed, 14 Feb 2018 05:20:30 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail106.syd.optusnet.com.au (mail106.syd.optusnet.com.au [211.29.132.42]) by mx1.freebsd.org (Postfix) with ESMTP id EAE148473C; Wed, 14 Feb 2018 05:20:29 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from [192.168.0.102] (c110-21-101-228.carlnfd1.nsw.optusnet.com.au [110.21.101.228]) by mail106.syd.optusnet.com.au (Postfix) with ESMTPS id F3D293C5F4C; Wed, 14 Feb 2018 16:20:21 +1100 (AEDT) Date: Wed, 14 Feb 2018 16:20:21 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Ian Lepore cc: Ed Maste , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r329237 - head/sys/libkern In-Reply-To: <1518551679.72050.4.camel@freebsd.org> Message-ID: <20180214160048.E1450@besplex.bde.org> References: <201802131917.w1DJHmso047463@repo.freebsd.org> <1518549829.85310.39.camel@freebsd.org> <1518551679.72050.4.camel@freebsd.org> MIME-Version: 1.0 X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.2 cv=cIaQihWN c=1 sm=1 tr=0 a=PalzARQSbocsUSjMRkwAPg==:117 a=PalzARQSbocsUSjMRkwAPg==:17 a=nlC_4_pT8q9DhB4Ho9EA:9 a=6I5d2MoRAAAA:8 a=j84lBZEu4_Iwgp79yk0A:9 a=45ClL6m2LaAA:10 a=IjZwj45LgO3ly-622nXo:22 Content-Type: TEXT/PLAIN; charset=X-UNKNOWN; format=flowed Content-Transfer-Encoding: QUOTED-PRINTABLE X-Content-Filtered-By: Mailman/MimeDel 2.1.25 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Feb 2018 05:20:30 -0000 On Tue, 13 Feb 2018, Ian Lepore wrote: > On Tue, 2018-02-13 at 14:43 -0500, Ed Maste wrote: >> On 13 February 2018 at 14:23, Ian Lepore wrote: >>> >>> On Tue, 2018-02-13 at 19:17 +0000, Ed Maste wrote: >>>> >>>> Author: emaste >>>> Date: Tue Feb 13 19:17:48 2018 >>>> New Revision: 329237 >>>> URL: https://svnweb.freebsd.org/changeset/base/329237 >>>> >>>> Log: >>>> =A0 libkern: use nul for terminating char rather than 0 >>>> >>>> =A0 Akin to the change made in r188080 for lib/libc/string/. >>>> >>>> =A0 Reported by:=A0=A0=A0=A0=A0=A0=A0=A0bde >>>> =A0 Sponsored by:=A0=A0=A0=A0=A0=A0=A0The FreeBSD Foundation >>> There are many ways to spell 0.=A0=A0Why are we using something other >>> than >>> the simplest way?=A0=A0Is it a style rule thing, or is it portability- >>> correctness, or what? style(9) requires '\0' (by always spelling the character constant with value 0 like that). >> I made the change to improve consistency between lib/libc/string and >> sys/libkern, which is what Bruce commented on some time ago. I don't >> have a personal preference for 0 or '\0' but definitely believe that >> if we have multiple, similar copies of a function they ought to avoid >> gratuitous differences. (I'm happy to change both trees to 0 if >> that's >> preferred.) Core parts of libc like stdio and (MI) string use '\0' fairly consistently. There were about 10-20 plain 0's in string in FreeBSD-5, but most of these have been changed to '\0'. This gives a much larger set of examples of normal style. > Oh, I agree completely about consistancy being important. =A0I just > wanted to know whether I should try to remember to always use \0 > because it's a rule or has some benefit I didn't know about. > > 20+ years ago I used to slavishly ensure I always used \0 when a char > type was involved, just as a personal style thing. =A0Then over time I > came to the conclusion that "0 is 0 no matter how you spell it, so keep > it simple" (except for pointers... even in c++ I've always used NULL). Probably the BSD style rule has the same origin. Bruce From owner-svn-src-all@freebsd.org Wed Feb 14 06:19:15 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CE2A8F03D76; Wed, 14 Feb 2018 06:19:15 +0000 (UTC) (envelope-from antoine.brodin.freebsd@gmail.com) Received: from mail-io0-x241.google.com (mail-io0-x241.google.com [IPv6:2607:f8b0:4001:c06::241]) (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 539398627B; Wed, 14 Feb 2018 06:19:15 +0000 (UTC) (envelope-from antoine.brodin.freebsd@gmail.com) Received: by mail-io0-x241.google.com with SMTP id d13so23978851iog.5; Tue, 13 Feb 2018 22:19:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=Q24D08PLB+VMpZdmFuKySDriX7hpl1Mr9E4ht/thHsc=; b=jQ8eg59ImzXq+oZfzWBp7SO84QQyE3jnrdzGILjOQ1W8W+c5ajo8yhJhOqqEMyeMFg vnqYyRCQn8IDHviUefU+9HFvnLHVWTa1T0atgVcH4/B2oboU9ml4RnEevWQZBINX6LbI JiZCWfuaaPDPJ7I4QJaygyslmYzvFfsCPoV8aLrPj8AwyhQsUlT74IBFSGdbZP3kY+FM SGIva3kT47T0jPYgQ0O7TYLeFn3r4W09vRsz27U3vN0G4sZa7H9Ch35cfcQiV0y3Uiu1 mc5GNxdaoKLVAlo8xav3ShlBlWI8g29yKkLvQtAwRVvpR+bEPOP7jNqnkZtiKlprX20d A1bA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=Q24D08PLB+VMpZdmFuKySDriX7hpl1Mr9E4ht/thHsc=; b=K+zhqF1SZv8dzpFmJAdkYB0hlIR9Xhl949otAwgqjeiJh8ryu+8HdoVwGuXjVnHgoj kcAoqtozPkysipX6ZFj5GQaBtFCGoWCvqgLe+8r3EswqVN6G6Wng1yQffFnn67cGTYwO t2WZkg/7fPcPmButa9po/oobUgwtV79KPluiL57AqU/RVMz9Sw4GnvjJri+ZjXSJqoi6 /6ttHEZI9CYvWs5Q7OFCvIzU8fwS1T7Sp4GsgsyEtbs2OKOu9gbvbgHUBp5oLSdBwKA+ Hm+virIp1puLJ2gKwGsBRhheEy3Gph0Bmv2ZtsHL1aYIqJFlb1vc+j/Ce4EPheGXriv3 2fCA== X-Gm-Message-State: APf1xPDFwfsDXzM6bSxADFRQkhSTiMTBDyaEU1CTrgrcCtFDSBwCtN+q LT3sMihXgO80EYYvWYZY4oIXDd2OCOip4tZN71J1UA== X-Google-Smtp-Source: AH8x226uL80RZv+09Ci2dy0sgMQAjj2WlokincCACt/02L1lU6yLXGCUc4cLGjrBDhgllIbYQHW2x/uJrfO1wPyi08A= X-Received: by 10.107.27.19 with SMTP id b19mr4322851iob.202.1518589154550; Tue, 13 Feb 2018 22:19:14 -0800 (PST) MIME-Version: 1.0 Sender: antoine.brodin.freebsd@gmail.com Received: by 10.107.143.86 with HTTP; Tue, 13 Feb 2018 22:19:14 -0800 (PST) In-Reply-To: <201802132243.w1DMh7IY054400@repo.freebsd.org> References: <201802132243.w1DMh7IY054400@repo.freebsd.org> From: Antoine Brodin Date: Wed, 14 Feb 2018 07:19:14 +0100 X-Google-Sender-Auth: 6rDv9OxtqGB8_HhB8lx3NR8ah3Y Message-ID: Subject: Re: svn commit: r329249 - in stable/11: cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety cddl/contrib/opensolaris/lib/libdtrace/common cddl/usr.sbin/dtrace/tests/common/safety cddl/usr.sbin/d... To: Mark Johnston Cc: src-committers , svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Feb 2018 06:19:16 -0000 On Tue, Feb 13, 2018 at 11:43 PM, Mark Johnston wrote: > Author: markj > Date: Tue Feb 13 22:43:07 2018 > New Revision: 329249 > URL: https://svnweb.freebsd.org/changeset/base/329249 > > Log: > MFC r327888, r327972, r327973: > Add "jid" and "jailname" variables to DTrace. > Hi, stable/11 fails to build: /poudriere/jails/11stable-amd64/usr/src/cddl/contrib/opensolaris/lib/libdtrace/common/dt_open.c:316:19: error: use of undeclared identifier 'DT_VERS_1_13' DT_ATTR_STABCMN, DT_VERS_1_13, &dt_idops_type, "string" }, ^ /poudriere/jails/11stable-amd64/usr/src/cddl/contrib/opensolaris/lib/libdtrace/common/dt_open.c:317:60: error: use of undeclared identifier 'DT_VERS_1_13' { "jid", DT_IDENT_SCALAR, 0, DIF_VAR_JID, DT_ATTR_STABCMN, DT_VERS_1_13, ^ 2 errors generated. Antoine From owner-svn-src-all@freebsd.org Wed Feb 14 07:59:31 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 32341F09902; Wed, 14 Feb 2018 07:59:31 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D278F697F9; Wed, 14 Feb 2018 07:59:30 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CCF725021; Wed, 14 Feb 2018 07:59:30 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1E7xU9m027315; Wed, 14 Feb 2018 07:59:30 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1E7xUCH027314; Wed, 14 Feb 2018 07:59:30 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201802140759.w1E7xUCH027314@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Wed, 14 Feb 2018 07:59:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329259 - head/lib/msun/src X-SVN-Group: head X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: head/lib/msun/src X-SVN-Commit-Revision: 329259 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Feb 2018 07:59:31 -0000 Author: eadler Date: Wed Feb 14 07:59:30 2018 New Revision: 329259 URL: https://svnweb.freebsd.org/changeset/base/329259 Log: msun: signed overflow in atan2 As a component of atan2(y, x), the case of x == 1.0 is farmed out to atan(y). The current implementation of this comparison is vulnerable to signed integer underflow (that is, undefined behavior), and it's performed in a somewhat more complicated way than it need be. Change it to not be quite so cute, rather directly comparing the high/low bits of x to the specific IEEE-754 bit pattern that encodes 1.0. Note that while there are three different e_atan* files in the relevant directory, only this one needs fixing. e_atan2f.c already compares against the full bit pattern encoding 1.0f, while e_atan2l.cuses bitwise-ands/ors/nots and so doesn't require a change. Closes #130 Submitted by: Jeff Walden (@jswalden github PR #130) Reviewed by: bde MFC After: 1 month Modified: head/lib/msun/src/e_atan2.c Modified: head/lib/msun/src/e_atan2.c ============================================================================== --- head/lib/msun/src/e_atan2.c Wed Feb 14 02:51:28 2018 (r329258) +++ head/lib/msun/src/e_atan2.c Wed Feb 14 07:59:30 2018 (r329259) @@ -71,7 +71,7 @@ __ieee754_atan2(double y, double x) if(((ix|((lx|-lx)>>31))>0x7ff00000)|| ((iy|((ly|-ly)>>31))>0x7ff00000)) /* x or y is NaN */ return x+y; - if((hx-0x3ff00000|lx)==0) return atan(y); /* x=1.0 */ + if(hx==0x3ff00000&&lx==0) return atan(y); /* x=1.0 */ m = ((hy>>31)&1)|((hx>>30)&2); /* 2*sign(x)+sign(y) */ /* when y = 0 */ From owner-svn-src-all@freebsd.org Wed Feb 14 09:53:24 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 34F1FF12402; Wed, 14 Feb 2018 09:53:24 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DB4D36E312; Wed, 14 Feb 2018 09:53:23 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D64D7639A; Wed, 14 Feb 2018 09:53:23 +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 w1E9rN1T087408; Wed, 14 Feb 2018 09:53:23 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1E9rNQx087407; Wed, 14 Feb 2018 09:53:23 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201802140953.w1E9rNQx087407@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 14 Feb 2018 09:53:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r329260 - stable/11/sys/compat/linuxkpi/common/include/linux X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/11/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 329260 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Feb 2018 09:53:24 -0000 Author: hselasky Date: Wed Feb 14 09:53:23 2018 New Revision: 329260 URL: https://svnweb.freebsd.org/changeset/base/329260 Log: MFC r328971: Fix implementation of ktime_add_ns() and ktime_sub_ns() in the LinuxKPI to actually return the computed result instead of the input value. This is a regression issue after r289572. Found by: gcc6 Sponsored by: Mellanox Technologies Modified: stable/11/sys/compat/linuxkpi/common/include/linux/ktime.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/compat/linuxkpi/common/include/linux/ktime.h ============================================================================== --- stable/11/sys/compat/linuxkpi/common/include/linux/ktime.h Wed Feb 14 07:59:30 2018 (r329259) +++ stable/11/sys/compat/linuxkpi/common/include/linux/ktime.h Wed Feb 14 09:53:23 2018 (r329260) @@ -88,18 +88,14 @@ ktime_to_timeval(ktime_t kt) static inline ktime_t ktime_add_ns(ktime_t kt, int64_t ns) { - ktime_t res; - - res.tv64 = kt.tv64 + ns; + kt.tv64 += ns; return kt; } static inline ktime_t ktime_sub_ns(ktime_t kt, int64_t ns) { - ktime_t res; - - res.tv64 = kt.tv64 - ns; + kt.tv64 -= ns; return kt; } From owner-svn-src-all@freebsd.org Wed Feb 14 14:29:12 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6B325F02FFC; Wed, 14 Feb 2018 14:29:12 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 171887AA54; Wed, 14 Feb 2018 14:29:12 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 11E6B10FD6; Wed, 14 Feb 2018 14:29:12 +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 w1EETB6G024834; Wed, 14 Feb 2018 14:29:11 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1EETBvS024833; Wed, 14 Feb 2018 14:29:11 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201802141429.w1EETBvS024833@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 14 Feb 2018 14:29:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r329261 - stable/11/cddl/contrib/opensolaris/lib/libdtrace/common X-SVN-Group: stable-11 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/11/cddl/contrib/opensolaris/lib/libdtrace/common X-SVN-Commit-Revision: 329261 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Feb 2018 14:29:12 -0000 Author: markj Date: Wed Feb 14 14:29:11 2018 New Revision: 329261 URL: https://svnweb.freebsd.org/changeset/base/329261 Log: Add DT_VERS_1_13 to libdtrace to unbreak the build. This is a direct commit to stable/11. PR: 225889 Modified: stable/11/cddl/contrib/opensolaris/lib/libdtrace/common/dt_open.c Modified: stable/11/cddl/contrib/opensolaris/lib/libdtrace/common/dt_open.c ============================================================================== --- stable/11/cddl/contrib/opensolaris/lib/libdtrace/common/dt_open.c Wed Feb 14 09:53:23 2018 (r329260) +++ stable/11/cddl/contrib/opensolaris/lib/libdtrace/common/dt_open.c Wed Feb 14 14:29:11 2018 (r329261) @@ -130,8 +130,9 @@ #define DT_VERS_1_11 DT_VERSION_NUMBER(1, 11, 0) #define DT_VERS_1_12 DT_VERSION_NUMBER(1, 12, 0) #define DT_VERS_1_12_1 DT_VERSION_NUMBER(1, 12, 1) -#define DT_VERS_LATEST DT_VERS_1_12_1 -#define DT_VERS_STRING "Sun D 1.12.1" +#define DT_VERS_1_13 DT_VERSION_NUMBER(1, 13, 0) +#define DT_VERS_LATEST DT_VERS_1_13 +#define DT_VERS_STRING "Sun D 1.13" const dt_version_t _dtrace_versions[] = { DT_VERS_1_0, /* D API 1.0.0 (PSARC 2001/466) Solaris 10 FCS */ @@ -157,6 +158,7 @@ const dt_version_t _dtrace_versions[] = { DT_VERS_1_11, /* D API 1.11 */ DT_VERS_1_12, /* D API 1.12 */ DT_VERS_1_12_1, /* D API 1.12.1 */ + DT_VERS_1_13, /* D API 1.13 */ 0 }; From owner-svn-src-all@freebsd.org Wed Feb 14 14:31:03 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F38D1F03282; Wed, 14 Feb 2018 14:31:02 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-io0-x22c.google.com (mail-io0-x22c.google.com [IPv6:2607:f8b0:4001:c06::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 82EFD7AE4A; Wed, 14 Feb 2018 14:31:02 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by mail-io0-x22c.google.com with SMTP id t126so2071786iof.4; Wed, 14 Feb 2018 06:31:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=luITXd1n8lHtl8ERjdk7KLbprRxmDD6LbrBitvG3ZPk=; b=P1uxrXn0o5rHcMxRIctwaBxuLr/UUNaJRKiDKZTfkOqIiA9Z0EnEFuMpaGLyWz88+B 9nVnZ9YTMakS0nBE/ehitfERhOIDOPIEs22ZBbZL9YZ0uO5JM1X9w4rTNJmcQmIWBdUr UsbwiF0dJBjj5ZynOcOa6e7uh1V0C4BBP9uUOtNMlj6Pr0Z0YxZA/1qDg+iLIEwuoi2P 0OlWYSXfVa2V9ReGoGw5ggbr/CvUiPesF3Rb3OuXxkuKqcNtdNUpJy+lX2ugCwzf0pS6 gT1chCvQwgNmTSIhx5WuF6cn5itAEQ5Un9QFetqDVJawpXjGV9GNCXCs6hoScsF67VN8 RIgA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=luITXd1n8lHtl8ERjdk7KLbprRxmDD6LbrBitvG3ZPk=; b=bKSoV9AHpPyaxUHUhFCbUpHqtVtjqtb/Pt4uoJATkHkZjE/pSGNH3DjThGsviB2hqr 9OMMpeZ3h+w7/RW0JTIaOv44ceMZZ5HoHvOcEp9KvlZ8qFlsrZ+TRpWYxpcPTyQqHL01 05URdjEJurq/Lr41KZ2/CNKb5/T+nG+S978Vd9b6J2UH9lsTGzrg539dNAtYNEdEdsDA gmoro8tY0CIpvNh4uRXeCPe2M2WubTfEQ3++0baX+kezL7n6Dk5vbmj7S1Gkc+ewyNWr JfLVhWF3ZEdJB+KYb0N3ry9gpd0alkNCGyorVkexrDOWL34Cv9KjgrU+SxBW6w+s9Afm /aRA== X-Gm-Message-State: APf1xPDBP/TLhNZyfniEfkCabVLj7sLiVwWuCmzAwHc5kE63/cYahfPT H8RRQuUW7FGRtjQJXby/fsMR8Rud X-Google-Smtp-Source: AH8x226lCAjGgMvtsVrE5muBhcVU4JqreTM4k6NBJxGtJRr1B9B36kd5di6yJ8eBdyrziMJQWY47Ww== X-Received: by 10.107.165.19 with SMTP id o19mr5445915ioe.87.1518618661002; Wed, 14 Feb 2018 06:31:01 -0800 (PST) Received: from raichu (toroon0560w-lp130-01-174-88-76-226.dsl.bell.ca. [174.88.76.226]) by smtp.gmail.com with ESMTPSA id b72sm8632096iob.50.2018.02.14.06.30.59 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 14 Feb 2018 06:30:59 -0800 (PST) Sender: Mark Johnston Date: Wed, 14 Feb 2018 09:30:57 -0500 From: Mark Johnston To: Antoine Brodin Cc: src-committers , svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: Re: svn commit: r329249 - in stable/11: cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety cddl/contrib/opensolaris/lib/libdtrace/common cddl/usr.sbin/dtrace/tests/common/safety cddl/usr.sbin/d... Message-ID: <20180214143057.GB17626@raichu> References: <201802132243.w1DMh7IY054400@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.3 (2018-01-21) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Feb 2018 14:31:03 -0000 On Wed, Feb 14, 2018 at 07:19:14AM +0100, Antoine Brodin wrote: > On Tue, Feb 13, 2018 at 11:43 PM, Mark Johnston wrote: > > Author: markj > > Date: Tue Feb 13 22:43:07 2018 > > New Revision: 329249 > > URL: https://svnweb.freebsd.org/changeset/base/329249 > > > > Log: > > MFC r327888, r327972, r327973: > > Add "jid" and "jailname" variables to DTrace. > > > > Hi, > > stable/11 fails to build: > > /poudriere/jails/11stable-amd64/usr/src/cddl/contrib/opensolaris/lib/libdtrace/common/dt_open.c:316:19: > error: use of undeclared identifier 'DT_VERS_1_13' > DT_ATTR_STABCMN, DT_VERS_1_13, &dt_idops_type, "string" }, > ^ > /poudriere/jails/11stable-amd64/usr/src/cddl/contrib/opensolaris/lib/libdtrace/common/dt_open.c:317:60: > error: use of undeclared identifier 'DT_VERS_1_13' > { "jid", DT_IDENT_SCALAR, 0, DIF_VAR_JID, DT_ATTR_STABCMN, DT_VERS_1_13, > ^ > 2 errors generated. This should be fixed now. My apologies for the breakage. From owner-svn-src-all@freebsd.org Wed Feb 14 15:12:10 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 16225F06011; Wed, 14 Feb 2018 15:12:10 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C08AA7CDC7; Wed, 14 Feb 2018 15:12:09 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BB84C117CC; Wed, 14 Feb 2018 15:12:09 +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 w1EFC9EO049591; Wed, 14 Feb 2018 15:12:09 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1EFC9f1049589; Wed, 14 Feb 2018 15:12:09 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201802141512.w1EFC9f1049589@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Wed, 14 Feb 2018 15:12:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329262 - head/sys/geom/part X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: head/sys/geom/part X-SVN-Commit-Revision: 329262 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Feb 2018 15:12:10 -0000 Author: jhibbits Date: Wed Feb 14 15:12:09 2018 New Revision: 329262 URL: https://svnweb.freebsd.org/changeset/base/329262 Log: Fix a panic introduced in r329225 Some GEOM partition tables may be destroyed with incomplete partition entries. Guard against this with NULL checks. Reported by: pholm,others Reviewed by: markj Tested by: pholm Modified: head/sys/geom/part/g_part.c Modified: head/sys/geom/part/g_part.c ============================================================================== --- head/sys/geom/part/g_part.c Wed Feb 14 14:29:11 2018 (r329261) +++ head/sys/geom/part/g_part.c Wed Feb 14 15:12:09 2018 (r329262) @@ -1549,9 +1549,11 @@ g_part_wither(struct g_geom *gp, int error) while ((entry = LIST_FIRST(&table->gpt_entry)) != NULL) { LIST_REMOVE(entry, gpe_entry); pp = entry->gpe_pp; - entry->gpe_pp->private = NULL; entry->gpe_pp = NULL; - g_wither_provider(pp, error); + if (pp != NULL) { + pp->private = NULL; + g_wither_provider(pp, error); + } g_free(entry); } G_PART_DESTROY(table, NULL); From owner-svn-src-all@freebsd.org Wed Feb 14 15:14:21 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D813AF0634C; Wed, 14 Feb 2018 15:14:20 +0000 (UTC) (envelope-from skra@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8972A7D105; Wed, 14 Feb 2018 15:14:20 +0000 (UTC) (envelope-from skra@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 84535117F6; Wed, 14 Feb 2018 15:14:20 +0000 (UTC) (envelope-from skra@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1EFEK5j049711; Wed, 14 Feb 2018 15:14:20 GMT (envelope-from skra@FreeBSD.org) Received: (from skra@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1EFEKxg049710; Wed, 14 Feb 2018 15:14:20 GMT (envelope-from skra@FreeBSD.org) Message-Id: <201802141514.w1EFEKxg049710@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: skra set sender to skra@FreeBSD.org using -f From: Svatopluk Kraus Date: Wed, 14 Feb 2018 15:14:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r329263 - stable/11/sys/arm/arm X-SVN-Group: stable-11 X-SVN-Commit-Author: skra X-SVN-Commit-Paths: stable/11/sys/arm/arm X-SVN-Commit-Revision: 329263 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Feb 2018 15:14:21 -0000 Author: skra Date: Wed Feb 14 15:14:20 2018 New Revision: 329263 URL: https://svnweb.freebsd.org/changeset/base/329263 Log: MFC r325321: Take into account race conditions in case of accessed or modified bit emulation in fast path of data/prefetch abort common routine. Process these bits only if related page table entries are consistent with provided abort info. In case of inconsistency, do nothing and let processor to signal new abort if still needed. Modified: stable/11/sys/arm/arm/pmap-v6.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/arm/arm/pmap-v6.c ============================================================================== --- stable/11/sys/arm/arm/pmap-v6.c Wed Feb 14 15:12:09 2018 (r329262) +++ stable/11/sys/arm/arm/pmap-v6.c Wed Feb 14 15:14:20 2018 (r329263) @@ -6433,6 +6433,22 @@ pmap_fault(pmap_t pmap, vm_offset_t far, uint32_t fsr, */ PMAP_LOCK(pmap); +#ifdef INVARIANTS + pte1 = pte1_load(pmap_pte1(pmap, far)); + if (pte1_is_link(pte1)) { + /* + * Check in advance that associated L2 page table is mapped into + * PT2MAP space. Note that faulty access to not mapped L2 page + * table is caught in more general check above where "far" is + * checked that it does not lay in PT2MAP space. Note also that + * L1 page table and PT2TAB always exist and are mapped. + */ + pte2 = pt2tab_load(pmap_pt2tab_entry(pmap, far)); + if (!pte2_is_valid(pte2)) + panic("%s: missing L2 page table (%p, %#x)", + __func__, pmap, far); + } +#endif #ifdef SMP /* * Special treatment is due to break-before-make approach done when @@ -6453,10 +6469,23 @@ pmap_fault(pmap_t pmap, vm_offset_t far, uint32_t fsr, * for aborts from user mode. */ if (idx == FAULT_ACCESS_L2) { - pte2p = pt2map_entry(far); - pte2 = pte2_load(pte2p); - if (pte2_is_valid(pte2)) { - pte2_store(pte2p, pte2 | PTE2_A); + pte1 = pte1_load(pmap_pte1(pmap, far)); + if (pte1_is_link(pte1)) { + /* L2 page table should exist and be mapped. */ + pte2p = pt2map_entry(far); + pte2 = pte2_load(pte2p); + if (pte2_is_valid(pte2)) { + pte2_store(pte2p, pte2 | PTE2_A); + PMAP_UNLOCK(pmap); + return (KERN_SUCCESS); + } + } else { + /* + * We got L2 access fault but PTE1 is not a link. + * Probably some race happened, do nothing. + */ + CTR3(KTR_PMAP, "%s: FAULT_ACCESS_L2 - pmap %#x far %#x", + __func__, pmap, far); PMAP_UNLOCK(pmap); return (KERN_SUCCESS); } @@ -6468,6 +6497,15 @@ pmap_fault(pmap_t pmap, vm_offset_t far, uint32_t fsr, pte1_store(pte1p, pte1 | PTE1_A); PMAP_UNLOCK(pmap); return (KERN_SUCCESS); + } else { + /* + * We got L1 access fault but PTE1 is not section + * mapping. Probably some race happened, do nothing. + */ + CTR3(KTR_PMAP, "%s: FAULT_ACCESS_L1 - pmap %#x far %#x", + __func__, pmap, far); + PMAP_UNLOCK(pmap); + return (KERN_SUCCESS); } } @@ -6480,12 +6518,25 @@ pmap_fault(pmap_t pmap, vm_offset_t far, uint32_t fsr, * for aborts from user mode. */ if ((fsr & FSR_WNR) && (idx == FAULT_PERM_L2)) { - pte2p = pt2map_entry(far); - pte2 = pte2_load(pte2p); - if (pte2_is_valid(pte2) && !(pte2 & PTE2_RO) && - (pte2 & PTE2_NM)) { - pte2_store(pte2p, pte2 & ~PTE2_NM); - tlb_flush(trunc_page(far)); + pte1 = pte1_load(pmap_pte1(pmap, far)); + if (pte1_is_link(pte1)) { + /* L2 page table should exist and be mapped. */ + pte2p = pt2map_entry(far); + pte2 = pte2_load(pte2p); + if (pte2_is_valid(pte2) && !(pte2 & PTE2_RO) && + (pte2 & PTE2_NM)) { + pte2_store(pte2p, pte2 & ~PTE2_NM); + tlb_flush(trunc_page(far)); + PMAP_UNLOCK(pmap); + return (KERN_SUCCESS); + } + } else { + /* + * We got L2 permission fault but PTE1 is not a link. + * Probably some race happened, do nothing. + */ + CTR3(KTR_PMAP, "%s: FAULT_PERM_L2 - pmap %#x far %#x", + __func__, pmap, far); PMAP_UNLOCK(pmap); return (KERN_SUCCESS); } @@ -6493,10 +6544,20 @@ pmap_fault(pmap_t pmap, vm_offset_t far, uint32_t fsr, if ((fsr & FSR_WNR) && (idx == FAULT_PERM_L1)) { pte1p = pmap_pte1(pmap, far); pte1 = pte1_load(pte1p); - if (pte1_is_section(pte1) && !(pte1 & PTE1_RO) && - (pte1 & PTE1_NM)) { - pte1_store(pte1p, pte1 & ~PTE1_NM); - tlb_flush(pte1_trunc(far)); + if (pte1_is_section(pte1)) { + if (!(pte1 & PTE1_RO) && (pte1 & PTE1_NM)) { + pte1_store(pte1p, pte1 & ~PTE1_NM); + tlb_flush(pte1_trunc(far)); + PMAP_UNLOCK(pmap); + return (KERN_SUCCESS); + } + } else { + /* + * We got L1 permission fault but PTE1 is not section + * mapping. Probably some race happened, do nothing. + */ + CTR3(KTR_PMAP, "%s: FAULT_PERM_L1 - pmap %#x far %#x", + __func__, pmap, far); PMAP_UNLOCK(pmap); return (KERN_SUCCESS); } @@ -6507,33 +6568,6 @@ pmap_fault(pmap_t pmap, vm_offset_t far, uint32_t fsr, * modify bits aborts, could be moved to ASM. Now we are * starting to deal with not fast aborts. */ - -#ifdef INVARIANTS - /* - * Read an entry in PT2TAB associated with both pmap and far. - * It's safe because PT2TAB is always mapped. - */ - pte2 = pt2tab_load(pmap_pt2tab_entry(pmap, far)); - if (pte2_is_valid(pte2)) { - /* - * Now, when we know that L2 page table is allocated, - * we can use PT2MAP to get L2 page table entry. - */ - pte2 = pte2_load(pt2map_entry(far)); - if (pte2_is_valid(pte2)) { - /* - * If L2 page table entry is valid, make sure that - * L1 page table entry is valid too. Note that we - * leave L2 page entries untouched when promoted. - */ - pte1 = pte1_load(pmap_pte1(pmap, far)); - if (!pte1_is_valid(pte1)) { - panic("%s: missing L1 page entry (%p, %#x)", - __func__, pmap, far); - } - } - } -#endif PMAP_UNLOCK(pmap); return (KERN_FAILURE); } From owner-svn-src-all@freebsd.org Wed Feb 14 15:40:14 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0582CF086D9; Wed, 14 Feb 2018 15:40:14 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AF5597E67F; Wed, 14 Feb 2018 15:40:13 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AA4CD11B47; Wed, 14 Feb 2018 15:40:13 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1EFeDFq059618; Wed, 14 Feb 2018 15:40:13 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1EFeDD6059615; Wed, 14 Feb 2018 15:40:13 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201802141540.w1EFeDD6059615@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Wed, 14 Feb 2018 15:40:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329264 - head/stand/libsa X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/stand/libsa X-SVN-Commit-Revision: 329264 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Feb 2018 15:40:14 -0000 Author: kevans Date: Wed Feb 14 15:40:13 2018 New Revision: 329264 URL: https://svnweb.freebsd.org/changeset/base/329264 Log: libsa: Fix IP recv timeout readip() doesn't, at the moment, properly indicate to callers that it has timed out. One can tell that it's timed out if errno == EAGAIN when it returns, but this is not ideal. Restructure it a little bit to explicitly set errno to ETIMEDOUT if we've exhausted tleft. I found two places that care about where it timed out or not: sendrecv in net.c and sendrecv_tftp. Both are structured to pass smaller timeout values to readip while tracking a larger timeout. Neither of them were able to do this properly with readip not indicating ETIMEDOUT, so fix it. While here, straighten out the time (t/t1) usage in sendrecv_tftp. This would have manifested itself in periodic failures to NFS/TFTP boot for no apparent reason because MINTMO/MAXTMO were not actually being respected properly. Problems were not reported with NFS, only TFTP. Reported by: sbruno Reviewed by: sbruno, tsoome MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D14350 Modified: head/stand/libsa/ip.c head/stand/libsa/net.c head/stand/libsa/tftp.c Modified: head/stand/libsa/ip.c ============================================================================== --- head/stand/libsa/ip.c Wed Feb 14 15:14:20 2018 (r329263) +++ head/stand/libsa/ip.c Wed Feb 14 15:40:13 2018 (r329264) @@ -416,8 +416,13 @@ readip(struct iodesc *d, void **pkt, void **payload, t while ((getsecs() - t) < tleft) { errno = 0; ret = readipv4(d, pkt, payload, tleft, proto); + if (ret >= 0) + return (ret); + /* Bubble up the error if it wasn't successful */ if (errno != EAGAIN) - break; + return (-1); } - return (ret); + /* We've exhausted tleft; timeout */ + errno = ETIMEDOUT; + return (-1); } Modified: head/stand/libsa/net.c ============================================================================== --- head/stand/libsa/net.c Wed Feb 14 15:14:20 2018 (r329263) +++ head/stand/libsa/net.c Wed Feb 14 15:40:13 2018 (r329264) @@ -118,7 +118,7 @@ sendrecv(struct iodesc *d, /* Try to get a packet and process it. */ cc = (*rproc)(d, pkt, payload, tleft); /* Return on data, EOF or real error. */ - if (cc != -1 || errno != 0) + if (cc != -1 || (errno != 0 && errno != ETIMEDOUT)) return (cc); /* Timed out or didn't get the packet we're waiting for */ Modified: head/stand/libsa/tftp.c ============================================================================== --- head/stand/libsa/tftp.c Wed Feb 14 15:14:20 2018 (r329263) +++ head/stand/libsa/tftp.c Wed Feb 14 15:40:13 2018 (r329264) @@ -638,14 +638,20 @@ sendrecv_tftp(struct tftp_handle *h, if (cc == -1) { /* Error on transmit; wait before retrying */ while ((getsecs() - t1) < tleft); + t1 = getsecs(); continue; } + t = t1 = getsecs(); recvnext: + if ((getsecs() - t) > MAXTMO) { + errno = ETIMEDOUT; + return -1; + } /* Try to get a packet and process it. */ cc = (*rproc)(h, pkt, payload, tleft, rtype); /* Return on data, EOF or real error. */ - if (cc != -1 || errno != 0) + if (cc != -1 || (errno != 0 && errno != ETIMEDOUT)) return (cc); if ((getsecs() - t1) < tleft) { goto recvnext; From owner-svn-src-all@freebsd.org Wed Feb 14 15:49:32 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 093B0F09215; Wed, 14 Feb 2018 15:49:32 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AE77E7ED9D; Wed, 14 Feb 2018 15:49:31 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A980711CE4; Wed, 14 Feb 2018 15:49:31 +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 w1EFnVoJ064849; Wed, 14 Feb 2018 15:49:31 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1EFnVBV064848; Wed, 14 Feb 2018 15:49:31 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201802141549.w1EFnVBV064848@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Wed, 14 Feb 2018 15:49:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329265 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Commit-Revision: 329265 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Feb 2018 15:49:32 -0000 Author: asomers Date: Wed Feb 14 15:49:31 2018 New Revision: 329265 URL: https://svnweb.freebsd.org/changeset/base/329265 Log: Implement .vop_pathconf and .vop_getacl for the .zfs ctldir zfsctl_common_pathconf will report all the same variables that regular ZFS volumes report. zfsctl_common_getacl will report an ACL equivalent to 555, except that you can't read xattrs or edit attributes. Fixes a bug where "ls .zfs" will occasionally print something like: ls: .zfs/.: Operation not supported PR: 225793 Reviewed by: avg MFC after: 3 weeks Sponsored by: Spectra Logic Corp Differential Revision: https://reviews.freebsd.org/D14365 Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c Wed Feb 14 15:40:13 2018 (r329264) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c Wed Feb 14 15:49:31 2018 (r329265) @@ -80,6 +80,10 @@ #include "zfs_namecheck.h" +/* Common access mode for all virtual directories under the ctldir */ +const u_short zfsctl_ctldir_mode = S_IRUSR | S_IXUSR | S_IRGRP | S_IXGRP | + S_IROTH | S_IXOTH; + /* * "Synthetic" filesystem implementation. */ @@ -496,8 +500,7 @@ zfsctl_common_getattr(vnode_t *vp, vattr_t *vap) vap->va_nblocks = 0; vap->va_seq = 0; vn_fsid(vp, vap); - vap->va_mode = S_IRUSR | S_IXUSR | S_IRGRP | S_IXGRP | - S_IROTH | S_IXOTH; + vap->va_mode = zfsctl_ctldir_mode; vap->va_type = VDIR; /* * We live in the now (for atime). @@ -724,6 +727,87 @@ zfsctl_root_vptocnp(struct vop_vptocnp_args *ap) return (0); } +static int +zfsctl_common_pathconf(ap) + struct vop_pathconf_args /* { + struct vnode *a_vp; + int a_name; + int *a_retval; + } */ *ap; +{ + /* + * We care about ACL variables so that user land utilities like ls + * can display them correctly. Since the ctldir's st_dev is set to be + * the same as the parent dataset, we must support all variables that + * it supports. + */ + switch (ap->a_name) { + case _PC_LINK_MAX: + *ap->a_retval = INT_MAX; + return (0); + + case _PC_FILESIZEBITS: + *ap->a_retval = 64; + return (0); + + case _PC_MIN_HOLE_SIZE: + *ap->a_retval = (int)SPA_MINBLOCKSIZE; + return (0); + + case _PC_ACL_EXTENDED: + *ap->a_retval = 0; + return (0); + + case _PC_ACL_NFS4: + *ap->a_retval = 1; + return (0); + + case _PC_ACL_PATH_MAX: + *ap->a_retval = ACL_MAX_ENTRIES; + return (0); + + default: + return (EINVAL); + } +} + +/** + * Returns a trivial ACL + */ +int +zfsctl_common_getacl(ap) + struct vop_getacl_args /* { + struct vnode *vp; + acl_type_t a_type; + struct acl *a_aclp; + struct ucred *cred; + struct thread *td; + } */ *ap; +{ + int i; + + if (ap->a_type != ACL_TYPE_NFS4) + return (EINVAL); + + acl_nfs4_sync_acl_from_mode(ap->a_aclp, zfsctl_ctldir_mode, 0); + /* + * acl_nfs4_sync_acl_from_mode assumes that the owner can always modify + * attributes. That is not the case for the ctldir, so we must clear + * those bits. We also must clear ACL_READ_NAMED_ATTRS, because xattrs + * aren't supported by the ctldir. + */ + for (i = 0; i < ap->a_aclp->acl_cnt; i++) { + struct acl_entry *entry; + entry = &(ap->a_aclp->acl_entry[i]); + uint32_t old_perm = entry->ae_perm; + entry->ae_perm &= ~(ACL_WRITE_ACL | ACL_WRITE_OWNER | + ACL_WRITE_ATTRIBUTES | ACL_WRITE_NAMED_ATTRS | + ACL_READ_NAMED_ATTRS ); + } + + return (0); +} + static struct vop_vector zfsctl_ops_root = { .vop_default = &default_vnodeops, .vop_open = zfsctl_common_open, @@ -738,6 +822,8 @@ static struct vop_vector zfsctl_ops_root = { .vop_fid = zfsctl_common_fid, .vop_print = zfsctl_common_print, .vop_vptocnp = zfsctl_root_vptocnp, + .vop_pathconf = zfsctl_common_pathconf, + .vop_getacl = zfsctl_common_getacl, }; static int @@ -1066,6 +1152,8 @@ static struct vop_vector zfsctl_ops_snapdir = { .vop_reclaim = zfsctl_common_reclaim, .vop_fid = zfsctl_common_fid, .vop_print = zfsctl_common_print, + .vop_pathconf = zfsctl_common_pathconf, + .vop_getacl = zfsctl_common_getacl, }; static int From owner-svn-src-all@freebsd.org Wed Feb 14 17:51:52 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F2089F129DE; Wed, 14 Feb 2018 17:51:51 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9F92C84BBE; Wed, 14 Feb 2018 17:51:51 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9A8D7131B3; Wed, 14 Feb 2018 17:51:51 +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 w1EHpp3P027255; Wed, 14 Feb 2018 17:51:51 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1EHppNe027242; Wed, 14 Feb 2018 17:51:51 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201802141751.w1EHppNe027242@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Wed, 14 Feb 2018 17:51:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329266 - head/tools/boot X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/tools/boot X-SVN-Commit-Revision: 329266 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Feb 2018 17:51:52 -0000 Author: imp Date: Wed Feb 14 17:51:51 2018 New Revision: 329266 URL: https://svnweb.freebsd.org/changeset/base/329266 Log: A quick test script that we can run to use userboot's test mode to excersize the load loader. Assumes that we already have a suitable root area that you pass in with the first arg. Added: head/tools/boot/lua-test.sh (contents, props changed) Added: head/tools/boot/lua-test.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/boot/lua-test.sh Wed Feb 14 17:51:51 2018 (r329266) @@ -0,0 +1,22 @@ +#!/bin/sh +# $FreeBSD$ + +die() { + echo $* + exit 1 +} + +dir=$1 +cd $(make -V SRCTOP)/stand +obj=$(make -V .OBJDIR) +t=$obj/userboot/test/test +u=$obj/userboot/userboot/userboot.so + +[ -n "$dir" ] || die "No directory specified" +[ -d "$dir" ] || die "Directory $dir doesn't exist" +[ -f "$dir/boot/lua/loader.lua" ] || die "No boot/lua/loader.lua found" +[ -f "$dir/boot/kernel/kernel" ] || die "No kernel to load" +[ -x "$t" ] || die "no userboot test jig found ($t)" +[ -x "$u" ] || die "no userboot.so ($u) found" + +$t -h $dir -b $u From owner-svn-src-all@freebsd.org Wed Feb 14 18:05:38 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2A780F1396B; Wed, 14 Feb 2018 18:05:38 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D207385914; Wed, 14 Feb 2018 18:05:37 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CCD17133AD; Wed, 14 Feb 2018 18:05:37 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1EI5bXT035979; Wed, 14 Feb 2018 18:05:37 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1EI5bs2035976; Wed, 14 Feb 2018 18:05:37 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201802141805.w1EI5bs2035976@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Wed, 14 Feb 2018 18:05:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329268 - in head/stand/efi: include libefi loader X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: in head/stand/efi: include libefi loader X-SVN-Commit-Revision: 329268 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Feb 2018 18:05:38 -0000 Author: manu Date: Wed Feb 14 18:05:37 2018 New Revision: 329268 URL: https://svnweb.freebsd.org/changeset/base/329268 Log: efi: Only scan the BLKIO MEDIA once Scan only the BLOCK IO MEDIA once instead of each time for each type of device (fd, cd and hdd). Leave the mechanism to free and reprobe all devices if one day we want to implement a "dev rescan" thing. Reviewed by: imp, tsoome MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D14334 Modified: head/stand/efi/include/efilib.h head/stand/efi/libefi/efipart.c head/stand/efi/loader/main.c Modified: head/stand/efi/include/efilib.h ============================================================================== --- head/stand/efi/include/efilib.h Wed Feb 14 17:59:04 2018 (r329267) +++ head/stand/efi/include/efilib.h Wed Feb 14 18:05:37 2018 (r329268) @@ -106,4 +106,7 @@ int wcscmp(CHAR16 *, CHAR16 *); void cpy8to16(const char *, CHAR16 *, size_t); void cpy16to8(const CHAR16 *, char *, size_t); +/* efipart.c */ +int efipart_inithandles(void); + #endif /* _LOADER_EFILIB_H */ Modified: head/stand/efi/libefi/efipart.c ============================================================================== --- head/stand/efi/libefi/efipart.c Wed Feb 14 17:59:04 2018 (r329267) +++ head/stand/efi/libefi/efipart.c Wed Feb 14 18:05:37 2018 (r329268) @@ -148,7 +148,7 @@ efiblk_pdinfo_count(pdinfo_list_t *pdi) return (i); } -static int +int efipart_inithandles(void) { UINTN sz; @@ -176,6 +176,10 @@ efipart_inithandles(void) efipart_handles = hin; efipart_nhandles = sz; +#ifdef EFIPART_DEBUG + printf("%s: Got %d BLOCK IO MEDIA handle(s)\n", __func__, + efipart_nhandles); +#endif return (0); } @@ -319,11 +323,7 @@ efipart_updatefd(void) static int efipart_initfd(void) { - int rv; - rv = efipart_inithandles(); - if (rv != 0) - return (rv); STAILQ_INIT(&fdinfo); efipart_updatefd(); @@ -439,11 +439,7 @@ efipart_updatecd(void) static int efipart_initcd(void) { - int rv; - rv = efipart_inithandles(); - if (rv != 0) - return (rv); STAILQ_INIT(&cdinfo); efipart_updatecd(); @@ -685,11 +681,7 @@ efipart_updatehd(void) static int efipart_inithd(void) { - int rv; - rv = efipart_inithandles(); - if (rv != 0) - return (rv); STAILQ_INIT(&hdinfo); efipart_updatehd(); Modified: head/stand/efi/loader/main.c ============================================================================== --- head/stand/efi/loader/main.c Wed Feb 14 17:59:04 2018 (r329267) +++ head/stand/efi/loader/main.c Wed Feb 14 18:05:37 2018 (r329268) @@ -456,11 +456,15 @@ main(int argc, CHAR16 *argv[]) } /* - * March through the device switch probing for things. + * Scan the BLOCK IO MEDIA handles then + * march through the device switch probing for things. */ - for (i = 0; devsw[i] != NULL; i++) - if (devsw[i]->dv_init != NULL) - (devsw[i]->dv_init)(); + if ((i = efipart_inithandles()) == 0) { + for (i = 0; devsw[i] != NULL; i++) + if (devsw[i]->dv_init != NULL) + (devsw[i]->dv_init)(); + } else + printf("efipart_inithandles failed %d, expect failures", i); printf("Command line arguments:"); for (i = 0; i < argc; i++) From owner-svn-src-all@freebsd.org Wed Feb 14 18:07:28 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 01BBAF13B47; Wed, 14 Feb 2018 18:07:28 +0000 (UTC) (envelope-from benno@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A1C1085B02; Wed, 14 Feb 2018 18:07:27 +0000 (UTC) (envelope-from benno@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9BB87133C3; Wed, 14 Feb 2018 18:07:27 +0000 (UTC) (envelope-from benno@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1EI7RCQ036079; Wed, 14 Feb 2018 18:07:27 GMT (envelope-from benno@FreeBSD.org) Received: (from benno@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1EI7Ror036078; Wed, 14 Feb 2018 18:07:27 GMT (envelope-from benno@FreeBSD.org) Message-Id: <201802141807.w1EI7Ror036078@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: benno set sender to benno@FreeBSD.org using -f From: Benno Rice Date: Wed, 14 Feb 2018 18:07:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329269 - head/stand/i386/boot2 X-SVN-Group: head X-SVN-Commit-Author: benno X-SVN-Commit-Paths: head/stand/i386/boot2 X-SVN-Commit-Revision: 329269 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Feb 2018 18:07:28 -0000 Author: benno Date: Wed Feb 14 18:07:27 2018 New Revision: 329269 URL: https://svnweb.freebsd.org/changeset/base/329269 Log: Reformat to come significantly closer to style(9). Reviewed by: imp, jhibbits Differential Revision: https://reviews.freebsd.org/D14366 Modified: head/stand/i386/boot2/boot2.c Modified: head/stand/i386/boot2/boot2.c ============================================================================== --- head/stand/i386/boot2/boot2.c Wed Feb 14 18:05:37 2018 (r329268) +++ head/stand/i386/boot2/boot2.c Wed Feb 14 18:07:27 2018 (r329269) @@ -72,33 +72,33 @@ extern uint32_t _end; static const char optstr[NOPT] = "DhaCcdgmnpqrsv"; /* Also 'P', 'S' */ static const unsigned char flags[NOPT] = { - RBX_DUAL, - RBX_SERIAL, - RBX_ASKNAME, - RBX_CDROM, - RBX_CONFIG, - RBX_KDB, - RBX_GDB, - RBX_MUTE, - RBX_NOINTR, - RBX_PAUSE, - RBX_QUIET, - RBX_DFLTROOT, - RBX_SINGLE, - RBX_VERBOSE + RBX_DUAL, + RBX_SERIAL, + RBX_ASKNAME, + RBX_CDROM, + RBX_CONFIG, + RBX_KDB, + RBX_GDB, + RBX_MUTE, + RBX_NOINTR, + RBX_PAUSE, + RBX_QUIET, + RBX_DFLTROOT, + RBX_SINGLE, + RBX_VERBOSE }; static const char *const dev_nm[NDEV] = {"ad", "da", "fd"}; static const unsigned char dev_maj[NDEV] = {30, 4, 2}; static struct dsk { - unsigned drive; - unsigned type; - unsigned unit; - uint8_t slice; - uint8_t part; - unsigned start; - int init; + unsigned drive; + unsigned type; + unsigned unit; + uint8_t slice; + uint8_t part; + unsigned start; + int init; } dsk; static char cmd[512], cmddup[512], knamebuf[1024]; static const char *kname; @@ -126,18 +126,21 @@ static void memcpy(void *, const void *, int); static void memcpy(void *dst, const void *src, int len) { - const char *s = src; - char *d = dst; + const char *s; + char *d; - while (len--) - *d++ = *s++; + s = src; + d = dst; + while (len--) + *d++ = *s++; } static inline int strcmp(const char *s1, const char *s2) { - for (; *s1 == *s2 && *s1; s1++, s2++); - return (unsigned char)*s1 - (unsigned char)*s2; + + for (; *s1 == *s2 && *s1; s1++, s2++); + return ((unsigned char)*s1 - (unsigned char)*s2); } #define UFS_SMALL_CGBASE @@ -146,501 +149,519 @@ strcmp(const char *s1, const char *s2) static int xfsread(ufs_ino_t inode, void *buf, size_t nbyte) { - if ((size_t)fsread(inode, buf, nbyte) != nbyte) { - printf("Invalid %s\n", "format"); - return -1; - } - return 0; + + if ((size_t)fsread(inode, buf, nbyte) != nbyte) { + printf("Invalid %s\n", "format"); + return (-1); + } + return (0); } static inline void getstr(void) { - char *s; - int c; + char *s; + int c; - s = cmd; - for (;;) { - switch (c = xgetc(0)) { - case 0: - break; - case '\177': - case '\b': - if (s > cmd) { - s--; - printf("\b \b"); - } - break; - case '\n': - case '\r': - *s = 0; - return; - default: - if (s - cmd < sizeof(cmd) - 1) - *s++ = c; - putchar(c); + s = cmd; + for (;;) { + switch (c = xgetc(0)) { + case 0: + break; + case '\177': + case '\b': + if (s > cmd) { + s--; + printf("\b \b"); + } + break; + case '\n': + case '\r': + *s = 0; + return; + default: + if (s - cmd < sizeof(cmd) - 1) + *s++ = c; + putchar(c); + } } - } } static inline void putc(int c) { - v86.addr = 0x10; - v86.eax = 0xe00 | (c & 0xff); - v86.ebx = 0x7; - v86int(); + + v86.addr = 0x10; + v86.eax = 0xe00 | (c & 0xff); + v86.ebx = 0x7; + v86int(); } int main(void) { - uint8_t autoboot; - ufs_ino_t ino; - size_t nbyte; + uint8_t autoboot; + ufs_ino_t ino; + size_t nbyte; - dmadat = (void *)(roundup2(__base + (int32_t)&_end, 0x10000) - __base); - v86.ctl = V86_FLAGS; - v86.efl = PSL_RESERVED_DEFAULT | PSL_I; - dsk.drive = *(uint8_t *)PTOV(ARGS); - dsk.type = dsk.drive & DRV_HARD ? TYPE_AD : TYPE_FD; - dsk.unit = dsk.drive & DRV_MASK; - dsk.slice = *(uint8_t *)PTOV(ARGS + 1) + 1; - bootinfo.bi_version = BOOTINFO_VERSION; - bootinfo.bi_size = sizeof(bootinfo); + dmadat = (void *)(roundup2(__base + (int32_t)&_end, 0x10000) - __base); + v86.ctl = V86_FLAGS; + v86.efl = PSL_RESERVED_DEFAULT | PSL_I; + dsk.drive = *(uint8_t *)PTOV(ARGS); + dsk.type = dsk.drive & DRV_HARD ? TYPE_AD : TYPE_FD; + dsk.unit = dsk.drive & DRV_MASK; + dsk.slice = *(uint8_t *)PTOV(ARGS + 1) + 1; + bootinfo.bi_version = BOOTINFO_VERSION; + bootinfo.bi_size = sizeof(bootinfo); - /* Process configuration file */ + /* Process configuration file */ - autoboot = 1; + autoboot = 1; - if ((ino = lookup(PATH_CONFIG)) || - (ino = lookup(PATH_DOTCONFIG))) { - nbyte = fsread(ino, cmd, sizeof(cmd) - 1); - cmd[nbyte] = '\0'; - } + if ((ino = lookup(PATH_CONFIG)) || + (ino = lookup(PATH_DOTCONFIG))) { + nbyte = fsread(ino, cmd, sizeof(cmd) - 1); + cmd[nbyte] = '\0'; + } - if (*cmd) { - memcpy(cmddup, cmd, sizeof(cmd)); - if (parse()) - autoboot = 0; - if (!OPT_CHECK(RBX_QUIET)) - printf("%s: %s", PATH_CONFIG, cmddup); - /* Do not process this command twice */ - *cmd = 0; - } + if (*cmd) { + memcpy(cmddup, cmd, sizeof(cmd)); + if (parse()) + autoboot = 0; + if (!OPT_CHECK(RBX_QUIET)) + printf("%s: %s", PATH_CONFIG, cmddup); + /* Do not process this command twice */ + *cmd = 0; + } - /* - * Try to exec stage 3 boot loader. If interrupted by a keypress, - * or in case of failure, try to load a kernel directly instead. - */ + /* + * Try to exec stage 3 boot loader. If interrupted by a keypress, + * or in case of failure, try to load a kernel directly instead. + */ - if (!kname) { - kname = PATH_LOADER; - if (autoboot && !keyhit(3*SECOND)) { - load(); - kname = PATH_KERNEL; + if (!kname) { + kname = PATH_LOADER; + if (autoboot && !keyhit(3*SECOND)) { + load(); + kname = PATH_KERNEL; + } } - } - /* Present the user with the boot2 prompt. */ + /* Present the user with the boot2 prompt. */ - for (;;) { - if (!autoboot || !OPT_CHECK(RBX_QUIET)) - printf("\nFreeBSD/x86 boot\n" - "Default: %u:%s(%u,%c)%s\n" - "boot: ", - dsk.drive & DRV_MASK, dev_nm[dsk.type], dsk.unit, - 'a' + dsk.part, kname); - if (DO_SIO) - sio_flush(); - if (!autoboot || keyhit(3*SECOND)) - getstr(); - else if (!autoboot || !OPT_CHECK(RBX_QUIET)) - putchar('\n'); - autoboot = 0; - if (parse()) - putchar('\a'); - else - load(); - } + for (;;) { + if (!autoboot || !OPT_CHECK(RBX_QUIET)) + printf("\nFreeBSD/x86 boot\n" + "Default: %u:%s(%u,%c)%s\n" + "boot: ", + dsk.drive & DRV_MASK, dev_nm[dsk.type], dsk.unit, + 'a' + dsk.part, kname); + if (DO_SIO) + sio_flush(); + if (!autoboot || keyhit(3*SECOND)) + getstr(); + else if (!autoboot || !OPT_CHECK(RBX_QUIET)) + putchar('\n'); + autoboot = 0; + if (parse()) + putchar('\a'); + else + load(); + } } /* XXX - Needed for btxld to link the boot2 binary; do not remove. */ void exit(int x) { + } static void load(void) { - union { - struct exec ex; - Elf32_Ehdr eh; - } hdr; - static Elf32_Phdr ep[2]; - static Elf32_Shdr es[2]; - caddr_t p; - ufs_ino_t ino; - uint32_t addr; - int k; - uint8_t i, j; + union { + struct exec ex; + Elf32_Ehdr eh; + } hdr; + static Elf32_Phdr ep[2]; + static Elf32_Shdr es[2]; + caddr_t p; + ufs_ino_t ino; + uint32_t addr; + int k; + uint8_t i, j; - if (!(ino = lookup(kname))) { - if (!ls) - printf("No %s\n", kname); - return; - } - if (xfsread(ino, &hdr, sizeof(hdr))) - return; - - if (N_GETMAGIC(hdr.ex) == ZMAGIC) { - addr = hdr.ex.a_entry & 0xffffff; - p = PTOV(addr); - fs_off = PAGE_SIZE; - if (xfsread(ino, p, hdr.ex.a_text)) - return; - p += roundup2(hdr.ex.a_text, PAGE_SIZE); - if (xfsread(ino, p, hdr.ex.a_data)) - return; - } else if (IS_ELF(hdr.eh)) { - fs_off = hdr.eh.e_phoff; - for (j = k = 0; k < hdr.eh.e_phnum && j < 2; k++) { - if (xfsread(ino, ep + j, sizeof(ep[0]))) + if (!(ino = lookup(kname))) { + if (!ls) + printf("No %s\n", kname); return; - if (ep[j].p_type == PT_LOAD) - j++; } - for (i = 0; i < 2; i++) { - p = PTOV(ep[i].p_paddr & 0xffffff); - fs_off = ep[i].p_offset; - if (xfsread(ino, p, ep[i].p_filesz)) + if (xfsread(ino, &hdr, sizeof(hdr))) return; - } - p += roundup2(ep[1].p_memsz, PAGE_SIZE); - bootinfo.bi_symtab = VTOP(p); - if (hdr.eh.e_shnum == hdr.eh.e_shstrndx + 3) { - fs_off = hdr.eh.e_shoff + sizeof(es[0]) * - (hdr.eh.e_shstrndx + 1); - if (xfsread(ino, &es, sizeof(es))) + + if (N_GETMAGIC(hdr.ex) == ZMAGIC) { + addr = hdr.ex.a_entry & 0xffffff; + p = PTOV(addr); + fs_off = PAGE_SIZE; + if (xfsread(ino, p, hdr.ex.a_text)) + return; + p += roundup2(hdr.ex.a_text, PAGE_SIZE); + if (xfsread(ino, p, hdr.ex.a_data)) + return; + } else if (IS_ELF(hdr.eh)) { + fs_off = hdr.eh.e_phoff; + for (j = k = 0; k < hdr.eh.e_phnum && j < 2; k++) { + if (xfsread(ino, ep + j, sizeof(ep[0]))) + return; + if (ep[j].p_type == PT_LOAD) + j++; + } + for (i = 0; i < 2; i++) { + p = PTOV(ep[i].p_paddr & 0xffffff); + fs_off = ep[i].p_offset; + if (xfsread(ino, p, ep[i].p_filesz)) + return; + } + p += roundup2(ep[1].p_memsz, PAGE_SIZE); + bootinfo.bi_symtab = VTOP(p); + if (hdr.eh.e_shnum == hdr.eh.e_shstrndx + 3) { + fs_off = hdr.eh.e_shoff + sizeof(es[0]) * + (hdr.eh.e_shstrndx + 1); + if (xfsread(ino, &es, sizeof(es))) + return; + for (i = 0; i < 2; i++) { + *(Elf32_Word *)p = es[i].sh_size; + p += sizeof(es[i].sh_size); + fs_off = es[i].sh_offset; + if (xfsread(ino, p, es[i].sh_size)) + return; + p += es[i].sh_size; + } + } + addr = hdr.eh.e_entry & 0xffffff; + bootinfo.bi_esymtab = VTOP(p); + } else { + printf("Invalid %s\n", "format"); return; - for (i = 0; i < 2; i++) { - *(Elf32_Word *)p = es[i].sh_size; - p += sizeof(es[i].sh_size); - fs_off = es[i].sh_offset; - if (xfsread(ino, p, es[i].sh_size)) - return; - p += es[i].sh_size; - } } - addr = hdr.eh.e_entry & 0xffffff; - bootinfo.bi_esymtab = VTOP(p); - } else { - printf("Invalid %s\n", "format"); - return; - } - bootinfo.bi_kernelname = VTOP(kname); - bootinfo.bi_bios_dev = dsk.drive; - __exec((caddr_t)addr, RB_BOOTINFO | (opts & RBX_MASK), - MAKEBOOTDEV(dev_maj[dsk.type], dsk.slice, dsk.unit, dsk.part), - 0, 0, 0, VTOP(&bootinfo)); + bootinfo.bi_kernelname = VTOP(kname); + bootinfo.bi_bios_dev = dsk.drive; + __exec((caddr_t)addr, RB_BOOTINFO | (opts & RBX_MASK), + MAKEBOOTDEV(dev_maj[dsk.type], dsk.slice, dsk.unit, dsk.part), + 0, 0, 0, VTOP(&bootinfo)); } static int parse() { - char *arg = cmd; - char *ep, *p, *q; - const char *cp; - unsigned int drv; - int c, i, j; - size_t k; + char *arg; + char *ep, *p, *q; + const char *cp; + unsigned int drv; + int c, i, j; + size_t k; - while ((c = *arg++)) { - if (c == ' ' || c == '\t' || c == '\n') - continue; - for (p = arg; *p && *p != '\n' && *p != ' ' && *p != '\t'; p++); - ep = p; - if (*p) - *p++ = 0; - if (c == '-') { - while ((c = *arg++)) { - if (c == 'P') { - if (*(uint8_t *)PTOV(0x496) & 0x10) { - cp = "yes"; - } else { - opts |= OPT_SET(RBX_DUAL) | OPT_SET(RBX_SERIAL); - cp = "no"; - } - printf("Keyboard: %s\n", cp); - continue; + arg = cmd; + + while ((c = *arg++)) { + if (c == ' ' || c == '\t' || c == '\n') + continue; + for (p = arg; *p && *p != '\n' && *p != ' ' && *p != '\t'; p++); + ep = p; + if (*p) + *p++ = 0; + if (c == '-') { + while ((c = *arg++)) { + if (c == 'P') { + if (*(uint8_t *)PTOV(0x496) & 0x10) { + cp = "yes"; + } else { + opts |= OPT_SET(RBX_DUAL) | + OPT_SET(RBX_SERIAL); + cp = "no"; + } + printf("Keyboard: %s\n", cp); + continue; #if SERIAL - } else if (c == 'S') { - j = 0; - while ((unsigned int)(i = *arg++ - '0') <= 9) - j = j * 10 + i; - if (j > 0 && i == -'0') { - comspeed = j; - break; - } - /* Fall through to error below ('S' not in optstr[]). */ + } else if (c == 'S') { + j = 0; + while (*arg <= '9') { + i = (unsigned int)(*arg - '0'); + j = j * 10 + i; + arg++; + } + if (j > 0 && i == -'0') { + comspeed = j; + break; + } + /* + * Fall through to error below + * ('S' not in optstr[]). + */ #endif - } - for (i = 0; c != optstr[i]; i++) - if (i == NOPT - 1) - return -1; - opts ^= OPT_SET(flags[i]); - } + } + for (i = 0; c != optstr[i]; i++) + if (i == NOPT - 1) + return (-1); + opts ^= OPT_SET(flags[i]); + } #if SERIAL - ioctrl = OPT_CHECK(RBX_DUAL) ? (IO_SERIAL|IO_KEYBOARD) : - OPT_CHECK(RBX_SERIAL) ? IO_SERIAL : IO_KEYBOARD; - if (DO_SIO) { - if (sio_init(115200 / comspeed) != 0) - ioctrl &= ~IO_SERIAL; - } + ioctrl = OPT_CHECK(RBX_DUAL) ? + (IO_SERIAL|IO_KEYBOARD) : + OPT_CHECK(RBX_SERIAL) ? IO_SERIAL : IO_KEYBOARD; + if (DO_SIO) { + if (sio_init(115200 / comspeed) != 0) + ioctrl &= ~IO_SERIAL; + } #endif - } else { - for (q = arg--; *q && *q != '('; q++); - if (*q) { - drv = -1; - if (arg[1] == ':') { - drv = *arg - '0'; - if (drv > 9) - return (-1); - arg += 2; + } else { + for (q = arg--; *q && *q != '('; q++); + if (*q) { + drv = -1; + if (arg[1] == ':') { + drv = *arg - '0'; + if (drv > 9) + return (-1); + arg += 2; + } + if (q - arg != 2) + return -1; + for (i = 0; arg[0] != dev_nm[i][0] || + arg[1] != dev_nm[i][1]; i++) + if (i == NDEV - 1) + return (-1); + dsk.type = i; + arg += 3; + dsk.unit = *arg - '0'; + if (arg[1] != ',' || dsk.unit > 9) + return (-1); + arg += 2; + dsk.slice = WHOLE_DISK_SLICE; + if (arg[1] == ',') { + dsk.slice = *arg - '0' + 1; + if (dsk.slice > NDOSPART + 1) + return (-1); + arg += 2; + } + if (arg[1] != ')') + return (-1); + dsk.part = *arg - 'a'; + if (dsk.part > 7) + return (-1); + arg += 2; + if (drv == -1) + drv = dsk.unit; + dsk.drive = (dsk.type <= TYPE_MAXHARD + ? DRV_HARD : 0) + drv; + dsk_meta = 0; + } + k = ep - arg; + if (k > 0) { + if (k >= sizeof(knamebuf)) + return (-1); + memcpy(knamebuf, arg, k + 1); + kname = knamebuf; + } } - if (q - arg != 2) - return -1; - for (i = 0; arg[0] != dev_nm[i][0] || - arg[1] != dev_nm[i][1]; i++) - if (i == NDEV - 1) - return -1; - dsk.type = i; - arg += 3; - dsk.unit = *arg - '0'; - if (arg[1] != ',' || dsk.unit > 9) - return -1; - arg += 2; - dsk.slice = WHOLE_DISK_SLICE; - if (arg[1] == ',') { - dsk.slice = *arg - '0' + 1; - if (dsk.slice > NDOSPART + 1) - return -1; - arg += 2; - } - if (arg[1] != ')') - return -1; - dsk.part = *arg - 'a'; - if (dsk.part > 7) - return (-1); - arg += 2; - if (drv == -1) - drv = dsk.unit; - dsk.drive = (dsk.type <= TYPE_MAXHARD - ? DRV_HARD : 0) + drv; - dsk_meta = 0; - } - k = ep - arg; - if (k > 0) { - if (k >= sizeof(knamebuf)) - return -1; - memcpy(knamebuf, arg, k + 1); - kname = knamebuf; - } + arg = p; } - arg = p; - } - return 0; + return (0); } static int dskread(void *buf, unsigned lba, unsigned nblk) { - struct dos_partition *dp; - struct disklabel *d; - char *sec; - unsigned i; - uint8_t sl; - const char *reason; + struct dos_partition *dp; + struct disklabel *d; + char *sec; + unsigned i; + uint8_t sl; + const char *reason; - if (!dsk_meta) { - sec = dmadat->secbuf; - dsk.start = 0; - if (drvread(sec, DOSBBSECTOR, 1)) - return -1; - dp = (void *)(sec + DOSPARTOFF); - sl = dsk.slice; - if (sl < BASE_SLICE) { - for (i = 0; i < NDOSPART; i++) - if (dp[i].dp_typ == DOSPTYP_386BSD && - (dp[i].dp_flag & 0x80 || sl < BASE_SLICE)) { - sl = BASE_SLICE + i; - if (dp[i].dp_flag & 0x80 || - dsk.slice == COMPATIBILITY_SLICE) - break; + if (!dsk_meta) { + sec = dmadat->secbuf; + dsk.start = 0; + if (drvread(sec, DOSBBSECTOR, 1)) + return (-1); + dp = (void *)(sec + DOSPARTOFF); + sl = dsk.slice; + if (sl < BASE_SLICE) { + for (i = 0; i < NDOSPART; i++) + if (dp[i].dp_typ == DOSPTYP_386BSD && + (dp[i].dp_flag & 0x80 || sl < BASE_SLICE)) { + sl = BASE_SLICE + i; + if (dp[i].dp_flag & 0x80 || + dsk.slice == COMPATIBILITY_SLICE) + break; + } + if (dsk.slice == WHOLE_DISK_SLICE) + dsk.slice = sl; } - if (dsk.slice == WHOLE_DISK_SLICE) - dsk.slice = sl; + if (sl != WHOLE_DISK_SLICE) { + if (sl != COMPATIBILITY_SLICE) + dp += sl - BASE_SLICE; + if (dp->dp_typ != DOSPTYP_386BSD) { + reason = "slice"; + goto error; + } + dsk.start = dp->dp_start; + } + if (drvread(sec, dsk.start + LABELSECTOR, 1)) + return (-1); + d = (void *)(sec + LABELOFFSET); + if (d->d_magic != DISKMAGIC || d->d_magic2 != DISKMAGIC) { + if (dsk.part != RAW_PART) { + reason = "label"; + goto error; + } + } else { + if (!dsk.init) { + if (d->d_type == DTYPE_SCSI) + dsk.type = TYPE_DA; + dsk.init++; + } + if (dsk.part >= d->d_npartitions || + !d->d_partitions[dsk.part].p_size) { + reason = "partition"; + goto error; + } + dsk.start += d->d_partitions[dsk.part].p_offset; + dsk.start -= d->d_partitions[RAW_PART].p_offset; + } } - if (sl != WHOLE_DISK_SLICE) { - if (sl != COMPATIBILITY_SLICE) - dp += sl - BASE_SLICE; - if (dp->dp_typ != DOSPTYP_386BSD) { - reason = "slice"; - goto error; - } - dsk.start = dp->dp_start; - } - if (drvread(sec, dsk.start + LABELSECTOR, 1)) - return -1; - d = (void *)(sec + LABELOFFSET); - if (d->d_magic != DISKMAGIC || d->d_magic2 != DISKMAGIC) { - if (dsk.part != RAW_PART) { - reason = "label"; - goto error; - } - } else { - if (!dsk.init) { - if (d->d_type == DTYPE_SCSI) - dsk.type = TYPE_DA; - dsk.init++; - } - if (dsk.part >= d->d_npartitions || - !d->d_partitions[dsk.part].p_size) { - reason = "partition"; - goto error; - } - dsk.start += d->d_partitions[dsk.part].p_offset; - dsk.start -= d->d_partitions[RAW_PART].p_offset; - } - } - return drvread(buf, dsk.start + lba, nblk); + return (drvread(buf, dsk.start + lba, nblk)); error: - printf("Invalid %s\n", reason); - return -1; + printf("Invalid %s\n", reason); + return (-1); } static void printf(const char *fmt,...) { - va_list ap; - static char buf[10]; - char *s; - unsigned u; - int c; + va_list ap; + static char buf[10]; + char *s; + unsigned u; + int c; - va_start(ap, fmt); - while ((c = *fmt++)) { - if (c == '%') { - c = *fmt++; - switch (c) { - case 'c': - putchar(va_arg(ap, int)); - continue; - case 's': - for (s = va_arg(ap, char *); *s; s++) - putchar(*s); - continue; - case 'u': - u = va_arg(ap, unsigned); - s = buf; - do - *s++ = '0' + u % 10U; - while (u /= 10U); - while (--s >= buf) - putchar(*s); - continue; - } + va_start(ap, fmt); + while ((c = *fmt++)) { + if (c == '%') { + c = *fmt++; + switch (c) { + case 'c': + putchar(va_arg(ap, int)); + continue; + case 's': + for (s = va_arg(ap, char *); *s; s++) + putchar(*s); + continue; + case 'u': + u = va_arg(ap, unsigned); + s = buf; + do + *s++ = '0' + u % 10U; + while (u /= 10U); + while (--s >= buf) + putchar(*s); + continue; + } + } + putchar(c); } - putchar(c); - } - va_end(ap); - return; + va_end(ap); + return; } static void putchar(int c) { - if (c == '\n') - xputc('\r'); - xputc(c); + + if (c == '\n') + xputc('\r'); + xputc(c); } static int drvread(void *buf, unsigned lba, unsigned nblk) { - static unsigned c = 0x2d5c7c2f; + static unsigned c = 0x2d5c7c2f; - if (!OPT_CHECK(RBX_QUIET)) { - xputc(c = c << 8 | c >> 24); - xputc('\b'); - } - v86.ctl = V86_ADDR | V86_CALLF | V86_FLAGS; - v86.addr = XREADORG; /* call to xread in boot1 */ - v86.es = VTOPSEG(buf); - v86.eax = lba; - v86.ebx = VTOPOFF(buf); - v86.ecx = lba >> 16; - v86.edx = nblk << 8 | dsk.drive; - v86int(); - v86.ctl = V86_FLAGS; - if (V86_CY(v86.efl)) { - printf("error %u lba %u\n", v86.eax >> 8 & 0xff, lba); - return -1; - } - return 0; + if (!OPT_CHECK(RBX_QUIET)) { + xputc(c = c << 8 | c >> 24); + xputc('\b'); + } + v86.ctl = V86_ADDR | V86_CALLF | V86_FLAGS; + v86.addr = XREADORG; /* call to xread in boot1 */ + v86.es = VTOPSEG(buf); + v86.eax = lba; + v86.ebx = VTOPOFF(buf); + v86.ecx = lba >> 16; + v86.edx = nblk << 8 | dsk.drive; + v86int(); + v86.ctl = V86_FLAGS; + if (V86_CY(v86.efl)) { + printf("error %u lba %u\n", v86.eax >> 8 & 0xff, lba); + return (-1); + } + return (0); } static int keyhit(unsigned ticks) { - uint32_t t0, t1; + uint32_t t0, t1; - if (OPT_CHECK(RBX_NOINTR)) - return 0; - t0 = 0; - for (;;) { - if (xgetc(1)) - return 1; - t1 = *(uint32_t *)PTOV(0x46c); - if (!t0) - t0 = t1; - if ((uint32_t)(t1 - t0) >= ticks) - return 0; - } + if (OPT_CHECK(RBX_NOINTR)) + return (0); + t0 = 0; + for (;;) { + if (xgetc(1)) + return (1); + t1 = *(uint32_t *)PTOV(0x46c); + if (!t0) + t0 = t1; + if ((uint32_t)(t1 - t0) >= ticks) + return (0); + } } static int xputc(int c) { - if (DO_KBD) - putc(c); - if (DO_SIO) - sio_putc(c); - return c; + + if (DO_KBD) + putc(c); + if (DO_SIO) + sio_putc(c); + return (c); } static int getc(int fn) { - v86.addr = 0x16; - v86.eax = fn << 8; - v86int(); - return fn == 0 ? v86.eax & 0xff : !V86_ZR(v86.efl); + + v86.addr = 0x16; + v86.eax = fn << 8; + v86int(); + return (fn == 0 ? v86.eax & 0xff : !V86_ZR(v86.efl)); } static int xgetc(int fn) { - if (OPT_CHECK(RBX_NOINTR)) - return 0; - for (;;) { - if (DO_KBD && getc(1)) - return fn ? 1 : getc(0); - if (DO_SIO && sio_ischar()) - return fn ? 1 : sio_getc(); - if (fn) - return 0; - } + + if (OPT_CHECK(RBX_NOINTR)) + return (0); + + for (;;) { + if (DO_KBD && getc(1)) + return (fn ? 1 : getc(0)); + if (DO_SIO && sio_ischar()) + return (fn ? 1 : sio_getc()); + if (fn) + return (0); + } } From owner-svn-src-all@freebsd.org Wed Feb 14 18:21:55 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 10761F14B7C; Wed, 14 Feb 2018 18:21:55 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B6AAE865C6; Wed, 14 Feb 2018 18:21:54 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B18E1136C8; Wed, 14 Feb 2018 18:21:54 +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 w1EILs3n045203; Wed, 14 Feb 2018 18:21:54 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1EILs5U045202; Wed, 14 Feb 2018 18:21:54 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201802141821.w1EILs5U045202@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Wed, 14 Feb 2018 18:21:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329270 - head/tools/boot X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/tools/boot X-SVN-Commit-Revision: 329270 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Feb 2018 18:21:55 -0000 Author: imp Date: Wed Feb 14 18:21:54 2018 New Revision: 329270 URL: https://svnweb.freebsd.org/changeset/base/329270 Log: Simple script to image a small test area from a built tree. Build with 'cd stand; make MK_FORTH=no MK_LOADER_LUA=yes' then run this script. You can then test with lua-test.sh with the same parameter. Added: head/tools/boot/lua-img.sh (contents, props changed) Added: head/tools/boot/lua-img.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/boot/lua-img.sh Wed Feb 14 18:21:54 2018 (r329270) @@ -0,0 +1,25 @@ +#!/bin/sh +# $FreeBSD$ + +# Quick script to build a suitable /boot dir somewhere in the tree for testing. + +die() { + echo $* + exit 1 +} + +dir=$1 +cd $(make -V SRCTOP) + +[ -n "$dir" ] || die "No directory specified" + +set -e + +rm -rf ${dir} +mkdir -p ${dir} +mtree -deUW -f etc/mtree/BSD.root.dist -p ${dir} +mtree -deUW -f etc/mtree/BSD.usr.dist -p ${dir}/usr +cd stand +make install DESTDIR=${dir} NO_ROOT=t MK_LOADER_LUA=yes MK_FORTH=no MK_INSTALL_AS_USER=yes +mkdir -p ${dir}/boot/kernel +cp /boot/kernel/kernel ${dir}/boot/kernel From owner-svn-src-all@freebsd.org Wed Feb 14 18:43:51 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EE3ECF16553; Wed, 14 Feb 2018 18:43:50 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A3A36876D4; Wed, 14 Feb 2018 18:43:50 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9E84513A58; Wed, 14 Feb 2018 18:43:50 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1EIho1f056639; Wed, 14 Feb 2018 18:43:50 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1EIhocY056637; Wed, 14 Feb 2018 18:43:50 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201802141843.w1EIhocY056637@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Wed, 14 Feb 2018 18:43:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329271 - in head: contrib/netbsd-tests/lib/libc/sys sys/kern X-SVN-Group: head X-SVN-Commit-Author: bdrewery X-SVN-Commit-Paths: in head: contrib/netbsd-tests/lib/libc/sys sys/kern X-SVN-Commit-Revision: 329271 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Feb 2018 18:43:51 -0000 Author: bdrewery Date: Wed Feb 14 18:43:50 2018 New Revision: 329271 URL: https://svnweb.freebsd.org/changeset/base/329271 Log: nanosleep(2): Fix bogus incrementing of rmtp by tc_tick_sbt on [EINTR]. sbt is the time in the future that the tsleep_sbt() is expected to be completed at. sbtt is the current time. Depending on the precision with sysctl kern.timecounter.alloweddeviation the start time may be incremented by tc_tick_sbt. The same increment is needed for the current time of sbtt before calculating the difference. The impact of missing this increment is that rmtp may increase by one tc_tick_sbt on every early [EINTR] return. If the same struct is passed in for rqtp as rmtp this can result in rqtp effectively incrementing by tc_tick_sbt and sleeping longer than originally intended. This problem was introduced in r247797. Reviewed by: kib, markj, vangyzen (all on an older version of the test) MFC after: 2 weeks Sponsored by: Dell EMC Differential Revision: https://reviews.freebsd.org/D14362 Modified: head/contrib/netbsd-tests/lib/libc/sys/t_nanosleep.c head/sys/kern/kern_time.c Modified: head/contrib/netbsd-tests/lib/libc/sys/t_nanosleep.c ============================================================================== --- head/contrib/netbsd-tests/lib/libc/sys/t_nanosleep.c Wed Feb 14 18:21:54 2018 (r329270) +++ head/contrib/netbsd-tests/lib/libc/sys/t_nanosleep.c Wed Feb 14 18:43:50 2018 (r329271) @@ -50,6 +50,15 @@ handler(int signo __unused) /* Nothing. */ } +static int got_info; +static void +info_handler(int signo __unused) +{ + + got_info = 1; +} + + ATF_TC(nanosleep_basic); ATF_TC_HEAD(nanosleep_basic, tc) { @@ -176,12 +185,84 @@ ATF_TC_BODY(nanosleep_sig, tc) atf_tc_fail("signal did not interrupt nanosleep(2)"); } +ATF_TC(nanosleep_eintr); +ATF_TC_HEAD(nanosleep_eintr, tc) +{ + atf_tc_set_md_var(tc, "descr", "Test [EINTR] for nanosleep(2)"); + atf_tc_set_md_var(tc, "timeout", "7"); +} + +ATF_TC_BODY(nanosleep_eintr, tc) +{ + struct sigaction act; + struct timespec tso, ts; + pid_t pid; + int sta; + + /* + * Test that [EINTR] properly handles rmtp for nanosleep(2). + */ + pid = fork(); + + ATF_REQUIRE(pid >= 0); + + got_info = 0; + + if (pid == 0) { + act.sa_handler = info_handler; + sigemptyset(&act.sa_mask); + act.sa_flags = 0; /* Don't allow restart. */ + ATF_REQUIRE(sigaction(SIGINFO, &act, NULL) == 0); + + tso.tv_sec = 5; + tso.tv_nsec = 0; + + ts.tv_sec = tso.tv_sec; + ts.tv_nsec = tso.tv_nsec; + + errno = 0; + while (nanosleep(&ts, &ts) != 0) { + ATF_REQUIRE_MSG(timespeccmp(&ts, &tso, <=), + "errno=%d ts=%0.9f should be <= last tso=%0.9f\n", + errno, + ts.tv_sec + ts.tv_nsec / 1e9, + tso.tv_sec + tso.tv_nsec / 1e9); + if (errno == EINTR && got_info == 1) { + got_info = 0; + errno = 0; + tso.tv_sec = ts.tv_sec; + tso.tv_nsec = ts.tv_nsec; + continue; + } + _exit(EXIT_FAILURE); + } + + if (errno != 0) + _exit(EXIT_FAILURE); + + _exit(EXIT_SUCCESS); + } + + /* Flood the process with SIGINFO until it exits. */ + do { + for (int i = 0; i < 10; i++) + ATF_REQUIRE(kill(pid, SIGINFO) == 0); + ATF_REQUIRE(usleep(10000) == 0); + } while (waitpid(pid, &sta, WNOHANG) == 0); + + ATF_REQUIRE(WIFEXITED(sta) == 1); + + if (WEXITSTATUS(sta) != EXIT_SUCCESS) + atf_tc_fail("nanosleep(2) handled rtmp incorrectly"); +} + ATF_TP_ADD_TCS(tp) { ATF_TP_ADD_TC(tp, nanosleep_basic); ATF_TP_ADD_TC(tp, nanosleep_err); ATF_TP_ADD_TC(tp, nanosleep_sig); + ATF_TP_ADD_TC(tp, nanosleep_eintr); return atf_no_error(); } Modified: head/sys/kern/kern_time.c ============================================================================== --- head/sys/kern/kern_time.c Wed Feb 14 18:21:54 2018 (r329270) +++ head/sys/kern/kern_time.c Wed Feb 14 18:43:50 2018 (r329271) @@ -563,7 +563,8 @@ kern_clock_nanosleep(struct thread *td, clockid_t cloc } while (error == 0 && is_abs_real && td->td_rtcgen == 0); td->td_rtcgen = 0; if (error != EWOULDBLOCK) { - TIMESEL(&sbtt, tmp); + if (TIMESEL(&sbtt, tmp)) + sbtt += tc_tick_sbt; if (sbtt >= sbt) return (0); if (error == ERESTART) From owner-svn-src-all@freebsd.org Wed Feb 14 20:01:40 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4DCFEF1BC51; Wed, 14 Feb 2018 20:01:40 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EDAC76A43C; Wed, 14 Feb 2018 20:01:39 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E8B2E14752; Wed, 14 Feb 2018 20:01:39 +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 w1EK1dg0092028; Wed, 14 Feb 2018 20:01:39 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1EK1doJ092027; Wed, 14 Feb 2018 20:01:39 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201802142001.w1EK1doJ092027@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Wed, 14 Feb 2018 20:01:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r329272 - stable/11/sys/dev/spibus X-SVN-Group: stable-11 X-SVN-Commit-Author: gonzo X-SVN-Commit-Paths: stable/11/sys/dev/spibus X-SVN-Commit-Revision: 329272 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Feb 2018 20:01:40 -0000 Author: gonzo Date: Wed Feb 14 20:01:39 2018 New Revision: 329272 URL: https://svnweb.freebsd.org/changeset/base/329272 Log: MFC r308895 by manu: Enable the use of spigen on FDT platform Modified: stable/11/sys/dev/spibus/spigen.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/spibus/spigen.c ============================================================================== --- stable/11/sys/dev/spibus/spigen.c Wed Feb 14 18:43:50 2018 (r329271) +++ stable/11/sys/dev/spibus/spigen.c Wed Feb 14 20:01:39 2018 (r329272) @@ -25,6 +25,8 @@ #include __FBSDID("$FreeBSD$"); +#include "opt_platform.h" + #include #include #include @@ -65,6 +67,17 @@ struct spigen_softc { int sc_debug; }; +#ifdef FDT +static void +spigen_identify(driver_t *driver, device_t parent) +{ + if (device_find_child(parent, "spigen", -1) != NULL) + return; + if (BUS_ADD_CHILD(parent, 0, "spigen", -1) == NULL) + device_printf(parent, "add child failed\n"); +} +#endif + static int spigen_probe(device_t dev) { @@ -393,6 +406,9 @@ static devclass_t spigen_devclass; static device_method_t spigen_methods[] = { /* Device interface */ +#ifdef FDT + DEVMETHOD(device_identify, spigen_identify), +#endif DEVMETHOD(device_probe, spigen_probe), DEVMETHOD(device_attach, spigen_attach), DEVMETHOD(device_detach, spigen_detach), From owner-svn-src-all@freebsd.org Wed Feb 14 20:15:33 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B4B8BF1CC5C; Wed, 14 Feb 2018 20:15:33 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 684176B008; Wed, 14 Feb 2018 20:15:33 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6292314935; Wed, 14 Feb 2018 20:15:33 +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 w1EKFXLY000964; Wed, 14 Feb 2018 20:15:33 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1EKFWkn000961; Wed, 14 Feb 2018 20:15:32 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201802142015.w1EKFWkn000961@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Wed, 14 Feb 2018 20:15:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329273 - in head: sys/geom/eli tests/sys/geom/class/eli X-SVN-Group: head X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: in head: sys/geom/eli tests/sys/geom/class/eli X-SVN-Commit-Revision: 329273 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Feb 2018 20:15:34 -0000 Author: asomers Date: Wed Feb 14 20:15:32 2018 New Revision: 329273 URL: https://svnweb.freebsd.org/changeset/base/329273 Log: geli: append "/eli" to the underlying provider's physical path If the underlying provider's physical path is null, then the geli device's physical path will be, too. Otherwise, it will append "/eli". This will make geli work better with zfsd(8). PR: 224962 MFC after: 3 weeks Differential Revision: https://reviews.freebsd.org/D13979 Added: head/tests/sys/geom/class/eli/misc_test.sh (contents, props changed) Modified: head/sys/geom/eli/g_eli.c head/tests/sys/geom/class/eli/Makefile Modified: head/sys/geom/eli/g_eli.c ============================================================================== --- head/sys/geom/eli/g_eli.c Wed Feb 14 20:01:39 2018 (r329272) +++ head/sys/geom/eli/g_eli.c Wed Feb 14 20:15:32 2018 (r329273) @@ -212,6 +212,16 @@ g_eli_crypto_rerun(struct cryptop *crp) return (error); } +static void +g_eli_getattr_done(struct bio *bp) +{ + if (bp->bio_error == 0 && + !strcmp(bp->bio_attribute, "GEOM::physpath")) { + strlcat(bp->bio_data, "/eli", bp->bio_length); + } + g_std_done(bp); +} + /* * The function is called afer reading encrypted data from the provider. * @@ -380,7 +390,10 @@ g_eli_start(struct bio *bp) case BIO_FLUSH: case BIO_DELETE: case BIO_ZONE: - cbp->bio_done = g_std_done; + if (bp->bio_cmd == BIO_GETATTR) + cbp->bio_done = g_eli_getattr_done; + else + cbp->bio_done = g_std_done; cp = LIST_FIRST(&sc->sc_geom->consumer); cbp->bio_to = cp->provider; G_ELI_LOGREQ(2, cbp, "Sending request."); Modified: head/tests/sys/geom/class/eli/Makefile ============================================================================== --- head/tests/sys/geom/class/eli/Makefile Wed Feb 14 20:01:39 2018 (r329272) +++ head/tests/sys/geom/class/eli/Makefile Wed Feb 14 20:15:32 2018 (r329273) @@ -14,6 +14,7 @@ ATF_TESTS_SH+= detach_test ATF_TESTS_SH+= init_test ATF_TESTS_SH+= integrity_test ATF_TESTS_SH+= kill_test +ATF_TESTS_SH+= misc_test ATF_TESTS_SH+= onetime_test ATF_TESTS_SH+= resize_test ATF_TESTS_SH+= setkey_test Added: head/tests/sys/geom/class/eli/misc_test.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tests/sys/geom/class/eli/misc_test.sh Wed Feb 14 20:15:32 2018 (r329273) @@ -0,0 +1,177 @@ +# Copyright (c) 2018 Alan Somers +# 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$ + +atf_test_case preserve_props cleanup +preserve_props_head() +{ + atf_set "descr" "geli should preserve basic GEOM properties" + atf_set "require.user" "root" + atf_set "timeout" 15 +} +preserve_props_body() +{ + . $(atf_get_srcdir)/conf.sh + md=$(attach_md -s1m) + atf_check geli onetime /dev/${md} + md_secsize=$(diskinfo ${md} | cut -wf 2) + md_stripesize=$(diskinfo ${md} | cut -wf 5) + eli_secsize=$(diskinfo ${md}.eli | cut -wf 2) + eli_stripesize=$(diskinfo ${md}.eli | cut -wf 5) + atf_check_equal "$md_secsize" "$eli_secsize" + atf_check_equal "$md_stripesize" "$eli_stripesize" +} +preserve_props_cleanup() +{ + . $(atf_get_srcdir)/conf.sh + geli_test_cleanup +} + +atf_test_case preserve_disk_props cleanup +preserve_disk_props_head() +{ + atf_set "descr" "geli should preserve properties for disks" + atf_set "require.user" "root" + atf_set "require.config" "disks" + atf_set "timeout" 15 +} +preserve_disk_props_body() +{ + . $(atf_get_srcdir)/conf.sh + disks=`atf_config_get disks` + disk=${disks%% *} + if [ -z "$disk" ]; then + atf_skip "Must define disks (see tests(7))" + fi + atf_check geli onetime ${disk} + + disk_ident=$(diskinfo -s ${disk}) + disk_descr=$(diskinfo -v ${disk} | awk '/Disk descr/ {print $1}') + disk_rotrate=$(diskinfo -v ${disk} | awk '/Rotation rate/ {print $1}') + disk_zonemode=$(diskinfo -v ${disk} | awk '/Zone Mode/ {print $1}') + eli_ident=$(diskinfo -s ${disk}.eli) + eli_descr=$(diskinfo -v ${disk}.eli | awk '/Disk descr/ {print $1}') + eli_rotrate=$(diskinfo -v ${disk}.eli | awk '/Rotation/ {print $1}') + eli_zonemode=$(diskinfo -v ${disk}.eli | awk '/Zone Mode/ {print $1}') + atf_check_equal "$disk_ident" "$eli_ident" + atf_check_equal "$disk_descr" "$eli_descr" + atf_check_equal "$disk_rotrate" "$eli_rotrate" + atf_check_equal "$disk_zonemode" "$eli_zonemode" +} +preserve_disk_props_cleanup() +{ + . $(atf_get_srcdir)/conf.sh + disk_cleanup + geli_test_cleanup +} + +atf_test_case physpath cleanup +physpath_head() +{ + atf_set "descr" "geli should append /eli to the underlying device's physical path" + atf_set "require.user" "root" + atf_set "timeout" 15 +} +physpath_body() +{ + . $(atf_get_srcdir)/conf.sh + load_gnop + + md=$(attach_md -s1m) + # If the underlying device has no physical path, then geli should not + # create one. + atf_check -o empty -e ignore diskinfo -p $md + atf_check -s exit:0 geli onetime $md + atf_check -o empty -e ignore diskinfo -p $md.eli + atf_check -s exit:0 geli kill $md + + # If the underlying device does have a physical path, then geli should + # append "/eli" + physpath="some/physical/path" + atf_check gnop create -z $physpath ${md} + atf_check -s exit:0 geli onetime $md.nop + atf_check -o match:"^${physpath}/eli$" diskinfo -p $md.nop.eli +} +physpath_cleanup() +{ + . $(atf_get_srcdir)/conf.sh + + if [ -f "$TEST_MDS_FILE" ]; then + while read md; do + [ -c /dev/${md}.nop.eli ] && \ + geli detach $md.nop.eli 2>/dev/null + [ -c /dev/${md}.nop ] && \ + gnop destroy -f $md.nop 2>/dev/null + [ -c /dev/${md}.eli ] && \ + geli detach $md.eli 2>/dev/null + mdconfig -d -u $md 2>/dev/null + done < $TEST_MDS_FILE + fi + true +} + +atf_init_test_cases() +{ + atf_add_test_case physpath + atf_add_test_case preserve_props + atf_add_test_case preserve_disk_props +} + + +common_cleanup() +{ + + if [ -f "$MD_DEVS" ]; then + while read test_md; do + gnop destroy -f ${test_md}.nop 2>/dev/null + mdconfig -d -u $test_md 2>/dev/null + done < $MD_DEVS + rm $MD_DEVS + fi + + if [ -f "$PLAINFILES" ]; then + while read f; do + rm -f ${f} + done < ${PLAINFILES} + rm ${PLAINFILES} + fi + true +} + +disk_cleanup() +{ + disks=`atf_config_get disks` + disk=${disks%% *} + if [ -n "$disk" ]; then + geli kill ${disk} 2>/dev/null + fi +} + +load_gnop() +{ + if ! kldstat -q -m g_nop; then + geom nop load || atf_skip "could not load module for geom nop" + fi +} From owner-svn-src-all@freebsd.org Wed Feb 14 20:18:23 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A4B8AF1CFD0; Wed, 14 Feb 2018 20:18:23 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 53D496B2B2; Wed, 14 Feb 2018 20:18:23 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4E86014945; Wed, 14 Feb 2018 20:18:23 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1EKIN3W001143; Wed, 14 Feb 2018 20:18:23 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1EKIN7C001142; Wed, 14 Feb 2018 20:18:23 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201802142018.w1EKIN7C001142@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Wed, 14 Feb 2018 20:18:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329274 - head/stand/lua X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/stand/lua X-SVN-Commit-Revision: 329274 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Feb 2018 20:18:23 -0000 Author: kevans Date: Wed Feb 14 20:18:23 2018 New Revision: 329274 URL: https://svnweb.freebsd.org/changeset/base/329274 Log: stand/lua: Exit sub-menus on backspace Modified: head/stand/lua/menu.lua Modified: head/stand/lua/menu.lua ============================================================================== --- head/stand/lua/menu.lua Wed Feb 14 20:15:32 2018 (r329273) +++ head/stand/lua/menu.lua Wed Feb 14 20:18:23 2018 (r329274) @@ -270,8 +270,14 @@ function menu.run(m) cont = true; while cont do - local key = string.char(io.getchar()); + local key = io.getchar(); + -- Exit on backspace + if (key == 127) and (m ~= menu.welcome) then + break + end + + key = string.char(key) -- check to see if key is an alias local sel_entry = nil; for k, v in pairs(alias_table) do From owner-svn-src-all@freebsd.org Wed Feb 14 20:26:10 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A4921F1D868; Wed, 14 Feb 2018 20:26:10 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 552A66B82F; Wed, 14 Feb 2018 20:26:10 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4FFC414AE4; Wed, 14 Feb 2018 20:26:10 +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 w1EKQArD006029; Wed, 14 Feb 2018 20:26:10 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1EKQ9g8006025; Wed, 14 Feb 2018 20:26:09 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201802142026.w1EKQ9g8006025@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Wed, 14 Feb 2018 20:26:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329275 - in head: sys/geom/part tests/sys/geom/class tests/sys/geom/class/part X-SVN-Group: head X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: in head: sys/geom/part tests/sys/geom/class tests/sys/geom/class/part X-SVN-Commit-Revision: 329275 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Feb 2018 20:26:10 -0000 Author: asomers Date: Wed Feb 14 20:26:09 2018 New Revision: 329275 URL: https://svnweb.freebsd.org/changeset/base/329275 Log: gpart: append partition name to the underlying provider's physical path If the underlying provider's physical path is null, then the gpart device's physical path will be, too. Otherwise, it will append the partition name, such as "/p1" or "/s1/a". This will make gpart work better with zfsd(8). PR: 224965 MFC after: 3 weeks Differential Revision: https://reviews.freebsd.org/D14010 Added: head/tests/sys/geom/class/part/ head/tests/sys/geom/class/part/Makefile (contents, props changed) head/tests/sys/geom/class/part/misc.sh (contents, props changed) Modified: head/sys/geom/part/g_part.c head/tests/sys/geom/class/Makefile Modified: head/sys/geom/part/g_part.c ============================================================================== --- head/sys/geom/part/g_part.c Wed Feb 14 20:18:23 2018 (r329274) +++ head/sys/geom/part/g_part.c Wed Feb 14 20:26:09 2018 (r329275) @@ -275,6 +275,35 @@ g_part_geometry(struct g_part_table *table, struct g_c } } +static void +g_part_get_physpath_done(struct bio *bp) +{ + struct g_geom *gp; + struct g_part_entry *entry; + struct g_part_table *table; + struct g_provider *pp; + struct bio *pbp; + + pbp = bp->bio_parent; + pp = pbp->bio_to; + gp = pp->geom; + table = gp->softc; + entry = pp->private; + + if (bp->bio_error == 0) { + char *end; + size_t len, remainder; + len = strlcat(bp->bio_data, "/", bp->bio_length); + if (len < bp->bio_length) { + end = bp->bio_data + len; + remainder = bp->bio_length - len; + G_PART_NAME(table, entry, end, remainder); + } + } + g_std_done(bp); +} + + #define DPRINTF(...) if (bootverbose) { \ printf("GEOM_PART: " __VA_ARGS__); \ } @@ -2189,6 +2218,7 @@ g_part_start(struct bio *bp) struct g_part_table *table; struct g_kerneldump *gkd; struct g_provider *pp; + void (*done_func)(struct bio *) = g_std_done; char buf[64]; biotrack(bp, __func__); @@ -2243,6 +2273,10 @@ g_part_start(struct bio *bp) if (g_handleattr_str(bp, "PART::type", G_PART_TYPE(table, entry, buf, sizeof(buf)))) return; + if (!strcmp("GEOM::physpath", bp->bio_attribute)) { + done_func = g_part_get_physpath_done; + break; + } if (!strcmp("GEOM::kerneldump", bp->bio_attribute)) { /* * Check that the partition is suitable for kernel @@ -2279,7 +2313,7 @@ g_part_start(struct bio *bp) g_io_deliver(bp, ENOMEM); return; } - bp2->bio_done = g_std_done; + bp2->bio_done = done_func; g_io_request(bp2, cp); } Modified: head/tests/sys/geom/class/Makefile ============================================================================== --- head/tests/sys/geom/class/Makefile Wed Feb 14 20:18:23 2018 (r329274) +++ head/tests/sys/geom/class/Makefile Wed Feb 14 20:26:09 2018 (r329275) @@ -7,10 +7,9 @@ TESTSDIR= ${TESTSBASE}/sys/geom/class TESTS_SUBDIRS+= concat TESTS_SUBDIRS+= eli TESTS_SUBDIRS+= gate -# XXX: might not work due to geom(4) changes; more investigation's needed -#TESTS_SUBDIRS+= gpt TESTS_SUBDIRS+= mirror TESTS_SUBDIRS+= nop +TESTS_SUBDIRS+= part TESTS_SUBDIRS+= raid3 TESTS_SUBDIRS+= shsec TESTS_SUBDIRS+= stripe Added: head/tests/sys/geom/class/part/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tests/sys/geom/class/part/Makefile Wed Feb 14 20:26:09 2018 (r329275) @@ -0,0 +1,10 @@ +# $FreeBSD$ + +PACKAGE= tests + +TESTSDIR= ${TESTSBASE}/sys/geom/class/${.CURDIR:T} + +# TODO: port the perl tests in tools/regression/geom_gpt +ATF_TESTS_SH+= misc + +.include Added: head/tests/sys/geom/class/part/misc.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tests/sys/geom/class/part/misc.sh Wed Feb 14 20:26:09 2018 (r329275) @@ -0,0 +1,187 @@ +# Copyright (c) 2018 Alan Somers +# 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$ + +MD_DEVS="md.devs" + +atf_test_case blank_physpath cleanup +blank_physpath_head() +{ + atf_set "descr" "gpart shouldn't add physical paths to underlying providers that have none" + atf_set "require.user" "root" +} +blank_physpath_body() +{ + load_gnop + load_gpart + md=$(alloc_md) + atf_check -o empty -e ignore diskinfo -p ${md} + atf_check -s exit:0 -o ignore gpart create -s bsd ${md} + atf_check -s exit:0 -o ignore gpart add -t freebsd-ufs ${md} + atf_check -o empty -e ignore diskinfo -p ${md}a +} +blank_physpath_cleanup() +{ + common_cleanup +} + + +atf_test_case bsd_physpath cleanup +bsd_physpath_head() +{ + atf_set "descr" "BSD partitions should append /X to the underlying device's physical path" + atf_set "require.user" "root" +} +bsd_physpath_body() +{ + load_gnop + load_gpart + md=$(alloc_md) + physpath="some/physical/path" + atf_check gnop create -z $physpath /dev/${md} + atf_check -s exit:0 -o ignore gpart create -s bsd ${md}.nop + atf_check -s exit:0 -o ignore gpart add -t freebsd-ufs ${md}.nop + gpart_physpath=$(diskinfo -p ${md}.nopa) + atf_check_equal "${physpath}/a" "$gpart_physpath" +} +bsd_physpath_cleanup() +{ + common_cleanup +} + +atf_test_case gpt_physpath cleanup +gpt_physpath_head() +{ + atf_set "descr" "GPT partitions should append /pX to the underlying device's physical path" + atf_set "require.user" "root" +} +gpt_physpath_body() +{ + load_gnop + load_gpart + md=$(alloc_md) + physpath="some/physical/path" + atf_check gnop create -z $physpath /dev/${md} + atf_check -s exit:0 -o ignore gpart create -s gpt ${md}.nop + atf_check -s exit:0 -o ignore gpart add -t efi ${md}.nop + gpart_physpath=$(diskinfo -p ${md}.nopp1) + atf_check_equal "${physpath}/p1" "$gpart_physpath" +} +gpt_physpath_cleanup() +{ + common_cleanup +} + +atf_test_case mbr_physpath cleanup +mbr_physpath_head() +{ + atf_set "descr" "MBR partitions should append /sX to the underlying device's physical path" + atf_set "require.user" "root" +} +mbr_physpath_body() +{ + load_gnop + load_gpart + md=$(alloc_md) + physpath="some/physical/path" + atf_check gnop create -z $physpath /dev/${md} + atf_check -s exit:0 -o ignore gpart create -s mbr ${md}.nop + atf_check -s exit:0 -o ignore gpart add -t freebsd ${md}.nop + gpart_physpath=$(diskinfo -p ${md}.nops1) + atf_check_equal "${physpath}/s1" "$gpart_physpath" +} +mbr_physpath_cleanup() +{ + common_cleanup +} + +atf_test_case mbr_bsd_physpath cleanup +mbr_bsd_physpath_head() +{ + atf_set "descr" "BSD partitions nested within MBR partitions should append /sX/Y to the underlying device's physical path" + atf_set "require.user" "root" +} +mbr_bsd_physpath_body() +{ + load_gnop + load_gpart + md=$(alloc_md) + physpath="some/physical/path" + atf_check gnop create -z $physpath /dev/${md} + atf_check -s exit:0 -o ignore gpart create -s mbr ${md}.nop + atf_check -s exit:0 -o ignore gpart add -t freebsd ${md}.nop + atf_check -s exit:0 -o ignore gpart create -s bsd ${md}.nops1 + atf_check -s exit:0 -o ignore gpart add -t freebsd-ufs ${md}.nops1 + gpart_physpath=$(diskinfo -p ${md}.nops1a) + atf_check_equal "${physpath}/s1/a" "$gpart_physpath" +} +mbr_bsd_physpath_cleanup() +{ + common_cleanup +} + +atf_init_test_cases() +{ + atf_add_test_case blank_physpath + atf_add_test_case bsd_physpath + atf_add_test_case gpt_physpath + atf_add_test_case mbr_physpath + atf_add_test_case mbr_bsd_physpath +} + +alloc_md() +{ + local md + + md=$(mdconfig -a -t swap -s 1M) || atf_fail "mdconfig -a failed" + echo ${md} >> $MD_DEVS + echo ${md} +} + +common_cleanup() +{ + if [ -f "$MD_DEVS" ]; then + while read test_md; do + gnop destroy -f ${test_md}.nop 2>/dev/null + mdconfig -d -u $test_md 2>/dev/null + done < $MD_DEVS + rm $MD_DEVS + fi + true +} + +load_gpart() +{ + if ! kldstat -q -m g_part; then + geom part load || atf_skip "could not load module for geom part" + fi +} + +load_gnop() +{ + if ! kldstat -q -m g_nop; then + geom nop load || atf_skip "could not load module for geom nop" + fi +} From owner-svn-src-all@freebsd.org Wed Feb 14 20:37:34 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AE2B9F1E521; Wed, 14 Feb 2018 20:37:34 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 54EB06C0B9; Wed, 14 Feb 2018 20:37:34 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4691214CA1; Wed, 14 Feb 2018 20:37:34 +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 w1EKbYho011261; Wed, 14 Feb 2018 20:37:34 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1EKbYuf011260; Wed, 14 Feb 2018 20:37:34 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201802142037.w1EKbYuf011260@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Wed, 14 Feb 2018 20:37:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329276 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 329276 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Feb 2018 20:37:34 -0000 Author: mjg Date: Wed Feb 14 20:37:33 2018 New Revision: 329276 URL: https://svnweb.freebsd.org/changeset/base/329276 Log: rwlock: diff-reduction of runlock compared to sx sunlock Modified: head/sys/kern/kern_rwlock.c Modified: head/sys/kern/kern_rwlock.c ============================================================================== --- head/sys/kern/kern_rwlock.c Wed Feb 14 20:26:09 2018 (r329275) +++ head/sys/kern/kern_rwlock.c Wed Feb 14 20:37:33 2018 (r329276) @@ -760,22 +760,19 @@ __rw_runlock_hard(struct rwlock *rw, struct thread *td if (SCHEDULER_STOPPED()) return; + if (__rw_runlock_try(rw, td, &v)) + goto out_lockstat; + + /* + * Ok, we know we have waiters and we think we are the + * last reader, so grab the turnstile lock. + */ + turnstile_chain_lock(&rw->lock_object); + v = RW_READ_VALUE(rw); for (;;) { if (__rw_runlock_try(rw, td, &v)) break; - /* - * Ok, we know we have waiters and we think we are the - * last reader, so grab the turnstile lock. - */ - turnstile_chain_lock(&rw->lock_object); - v = RW_READ_VALUE(rw); -retry_ts: - if (__rw_runlock_try(rw, td, &v)) { - turnstile_chain_unlock(&rw->lock_object); - break; - } - v &= (RW_LOCK_WAITERS | RW_LOCK_WRITE_SPINNER); MPASS(v & RW_LOCK_WAITERS); @@ -803,7 +800,7 @@ retry_ts: } v |= RW_READERS_LOCK(1); if (!atomic_fcmpset_rel_ptr(&rw->rw_lock, &v, setv)) - goto retry_ts; + continue; if (LOCK_LOG_TEST(&rw->lock_object, 0)) CTR2(KTR_LOCK, "%s: %p last succeeded with waiters", __func__, rw); @@ -819,10 +816,11 @@ retry_ts: MPASS(ts != NULL); turnstile_broadcast(ts, queue); turnstile_unpend(ts, TS_SHARED_LOCK); - turnstile_chain_unlock(&rw->lock_object); td->td_rw_rlocks--; break; } + turnstile_chain_unlock(&rw->lock_object); +out_lockstat: LOCKSTAT_PROFILE_RELEASE_RWLOCK(rw__release, rw, LOCKSTAT_READER); } From owner-svn-src-all@freebsd.org Wed Feb 14 21:02:41 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 68CA7F1FF72; Wed, 14 Feb 2018 21:02:41 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 409CF6D187; Wed, 14 Feb 2018 21:02:39 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 83A931516B; Wed, 14 Feb 2018 21:02:38 +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 w1EL2cTQ025843; Wed, 14 Feb 2018 21:02:38 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1EL2cvf025842; Wed, 14 Feb 2018 21:02:38 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201802142102.w1EL2cvf025842@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Wed, 14 Feb 2018 21:02:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329277 - head/etc/mtree X-SVN-Group: head X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: head/etc/mtree X-SVN-Commit-Revision: 329277 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Feb 2018 21:02:41 -0000 Author: asomers Date: Wed Feb 14 21:02:38 2018 New Revision: 329277 URL: https://svnweb.freebsd.org/changeset/base/329277 Log: Add mtree entry for 329275 MFC after: 3 weeks X-MFC-With: 329275 Sponsored by: Spectra Logic Corp Modified: head/etc/mtree/BSD.tests.dist Modified: head/etc/mtree/BSD.tests.dist ============================================================================== --- head/etc/mtree/BSD.tests.dist Wed Feb 14 20:37:33 2018 (r329276) +++ head/etc/mtree/BSD.tests.dist Wed Feb 14 21:02:38 2018 (r329277) @@ -450,6 +450,8 @@ .. nop .. + part + .. raid3 .. shsec From owner-svn-src-all@freebsd.org Wed Feb 14 21:14:30 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DC815F20CBB; Wed, 14 Feb 2018 21:14:29 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8A2C46D942; Wed, 14 Feb 2018 21:14:29 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8175A15316; Wed, 14 Feb 2018 21:14:29 +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 w1ELETw4031186; Wed, 14 Feb 2018 21:14:29 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1ELETkO031184; Wed, 14 Feb 2018 21:14:29 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201802142114.w1ELETkO031184@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Wed, 14 Feb 2018 21:14:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r329278 - in stable/11/sys: dev/spibus modules modules/spigen X-SVN-Group: stable-11 X-SVN-Commit-Author: gonzo X-SVN-Commit-Paths: in stable/11/sys: dev/spibus modules modules/spigen X-SVN-Commit-Revision: 329278 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Feb 2018 21:14:30 -0000 Author: gonzo Date: Wed Feb 14 21:14:28 2018 New Revision: 329278 URL: https://svnweb.freebsd.org/changeset/base/329278 Log: MFC r314933-r314934 r314933: [spigen] make spigen device ready to be compiled as a module - Add flag to indicate that device is opened by userland - Replace "always fail" detach method with proper detach implementation r314934: [spigen] Add spigen module spigen provides userland API to SPI bus. Make it available as a loadable module so people using official ARM images can enabled it on devices like BBB or RPi without re-building kernel Added: stable/11/sys/modules/spigen/ - copied from r314934, head/sys/modules/spigen/ Modified: stable/11/sys/dev/spibus/spigen.c stable/11/sys/modules/Makefile Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/spibus/spigen.c ============================================================================== --- stable/11/sys/dev/spibus/spigen.c Wed Feb 14 21:02:38 2018 (r329277) +++ stable/11/sys/dev/spibus/spigen.c Wed Feb 14 21:14:28 2018 (r329278) @@ -53,6 +53,9 @@ __FBSDID("$FreeBSD$"); #include "spibus_if.h" +#define SPIGEN_OPEN (1 << 0) +#define SPIGEN_MMAP_BUSY (1 << 1) + struct spigen_softc { device_t sc_dev; struct cdev *sc_cdev; @@ -63,8 +66,8 @@ struct spigen_softc { vm_object_t sc_mmap_buffer; /* command, then data */ vm_offset_t sc_mmap_kvaddr; size_t sc_mmap_buffer_size; - int sc_mmap_busy; int sc_debug; + int sc_flags; }; #ifdef FDT @@ -191,10 +194,24 @@ spigen_attach(device_t dev) } static int -spigen_open(struct cdev *dev, int oflags, int devtype, struct thread *td) +spigen_open(struct cdev *cdev, int oflags, int devtype, struct thread *td) { + int error; + device_t dev; + struct spigen_softc *sc; - return (0); + error = 0; + dev = cdev->si_drv1; + sc = device_get_softc(dev); + + mtx_lock(&sc->sc_mtx); + if (sc->sc_flags & SPIGEN_OPEN) + error = EBUSY; + else + sc->sc_flags |= SPIGEN_OPEN; + mtx_unlock(&sc->sc_mtx); + + return (error); } static int @@ -264,7 +281,7 @@ spigen_transfer_mmapped(struct cdev *cdev, struct spig int error = 0; mtx_lock(&sc->sc_mtx); - if (sc->sc_mmap_busy) + if (sc->sc_flags & SPIGEN_MMAP_BUSY) error = EBUSY; else if (stm->stm_command_length > sc->sc_command_length_max || stm->stm_data_length > sc->sc_data_length_max) @@ -275,7 +292,7 @@ spigen_transfer_mmapped(struct cdev *cdev, struct spig stm->stm_command_length + stm->stm_data_length) error = ENOMEM; if (error == 0) - sc->sc_mmap_busy = 1; + sc->sc_flags |= SPIGEN_MMAP_BUSY; mtx_unlock(&sc->sc_mtx); if (error) return (error); @@ -288,8 +305,8 @@ spigen_transfer_mmapped(struct cdev *cdev, struct spig error = SPIBUS_TRANSFER(device_get_parent(dev), dev, &transfer); mtx_lock(&sc->sc_mtx); - KASSERT(sc->sc_mmap_busy, ("mmap no longer marked busy")); - sc->sc_mmap_busy = 0; + KASSERT((sc->sc_flags & SPIGEN_MMAP_BUSY), ("mmap no longer marked busy")); + sc->sc_flags &= ~(SPIGEN_MMAP_BUSY); mtx_unlock(&sc->sc_mtx); return (error); } @@ -391,6 +408,7 @@ spigen_close(struct cdev *cdev, int fflag, int devtype sc->sc_mmap_buffer = NULL; sc->sc_mmap_buffer_size = 0; } + sc->sc_flags &= ~(SPIGEN_OPEN); mtx_unlock(&sc->sc_mtx); return (0); } @@ -398,8 +416,23 @@ spigen_close(struct cdev *cdev, int fflag, int devtype static int spigen_detach(device_t dev) { + struct spigen_softc *sc; - return (EIO); + sc = device_get_softc(dev); + + mtx_lock(&sc->sc_mtx); + if (sc->sc_flags & SPIGEN_OPEN) { + mtx_unlock(&sc->sc_mtx); + return (EBUSY); + } + mtx_unlock(&sc->sc_mtx); + + mtx_destroy(&sc->sc_mtx); + + if (sc->sc_cdev) + destroy_dev(sc->sc_cdev); + + return (0); } static devclass_t spigen_devclass; Modified: stable/11/sys/modules/Makefile ============================================================================== --- stable/11/sys/modules/Makefile Wed Feb 14 21:02:38 2018 (r329277) +++ stable/11/sys/modules/Makefile Wed Feb 14 21:14:28 2018 (r329278) @@ -359,6 +359,7 @@ SUBDIR= \ snp \ sound \ ${_speaker} \ + spigen \ ${_splash} \ ${_sppp} \ ste \ From owner-svn-src-all@freebsd.org Wed Feb 14 21:17:45 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0D5FEF21128; Wed, 14 Feb 2018 21:17:45 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AC4D06DCE8; Wed, 14 Feb 2018 21:17:44 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A2FD61531A; Wed, 14 Feb 2018 21:17:44 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1ELHiUN031477; Wed, 14 Feb 2018 21:17:44 GMT (envelope-from eugen@FreeBSD.org) Received: (from eugen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1ELHiOj031474; Wed, 14 Feb 2018 21:17:44 GMT (envelope-from eugen@FreeBSD.org) Message-Id: <201802142117.w1ELHiOj031474@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eugen set sender to eugen@FreeBSD.org using -f From: Eugene Grosbein Date: Wed, 14 Feb 2018 21:17:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329279 - in head: share/man/man4 sys/netgraph X-SVN-Group: head X-SVN-Commit-Author: eugen X-SVN-Commit-Paths: in head: share/man/man4 sys/netgraph X-SVN-Commit-Revision: 329279 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Feb 2018 21:17:45 -0000 Author: eugen Date: Wed Feb 14 21:17:44 2018 New Revision: 329279 URL: https://svnweb.freebsd.org/changeset/base/329279 Log: ng_pppoe(8): add support for user-supplied Host-Uniq tag. A few ISP filter PADI requests based on such tag, to force the use of their own routers. The custom Host-Uniq tag is passed in the NGM_PPPOE_CONNECT control message, so it can be used with FreeBSD ppp(8) and mpd without any other change. Add support to send and receive PADM messages, HURL and MOTM, often used by service providers to provide ACS information and other configuration settings to the user CPE. Submitted by: ale Approved by: mav (mentor) MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D9270 Modified: head/share/man/man4/ng_pppoe.4 head/sys/netgraph/ng_pppoe.c head/sys/netgraph/ng_pppoe.h Modified: head/share/man/man4/ng_pppoe.4 ============================================================================== --- head/share/man/man4/ng_pppoe.4 Wed Feb 14 21:14:28 2018 (r329278) +++ head/share/man/man4/ng_pppoe.4 Wed Feb 14 21:17:44 2018 (r329279) @@ -35,7 +35,7 @@ .\" $FreeBSD$ .\" $Whistle: ng_pppoe.8,v 1.1 1999/01/25 23:46:27 archie Exp $ .\" -.Dd September 15, 2015 +.Dd February 14, 2018 .Dt NG_PPPOE 4 .Os .Sh NAME @@ -104,12 +104,33 @@ the state machine as a client. It must be newly created and a service name can be given as an argument. It is legal to specify a zero-length service name, this is common on some DSL setups. -It is possible to request a connection to a specific -access concentrator by its name using the "AC-Name\\Service-Name" syntax. -A session request packet will be broadcasted on the Ethernet. +It is possible to request a connection to a specific access concentrator, +and/or set a specific Host-Uniq tag, required by some Internet providers, +using the +.Qq Li [AC-Name\\][Host-Uniq|]Service-Name +syntax. +To set a binary Host-Uniq, it must be encoded as a hexadecimal lowercase +string and prefixed with +.Qq Li 0x , +for example +.Qq Li 0x6d792d746167 +is equivalent to +.Qq Li my-tag . +A session request packet will be broadcast on the Ethernet. This command uses the .Dv ngpppoe_init_data structure shown below. +For example, this init data argument can be used to +connect to +.Qq Li my-isp +service with +.Qq Li my-host +uniq tag, accepting only +.Qq Li remote-ac +as access concentrator: +.Bd -literal -offset indent +"remote-ac\\my-host|my-isp" +.Ed .It Dv NGM_PPPOE_LISTEN Pq Ic pppoe_listen Tell a nominated newly created hook that its session should enter the state machine as a server listener. @@ -258,7 +279,41 @@ struct ngpppoe_maxp { uint16_t data; }; .Ed +.It Dv NGM_PPPOE_SEND_HURL Pq Ic send_hurl +Tell a nominated hook with an active session to send a PADM message with +a HURL tag. +The argument is the URL to be delivered to the client: +.Bd -literal -offset indent +ngctl msg fxp0:orphans send_hurl '{ hook="myHook" data="http://example.net/cpe" }' +.Ed +.It Dv NGM_PPPOE_SEND_MOTM Pq Ic send_motm +Tell a nominated hook with an active session to send a PADM message with +a MOTM tag. +The argument is the message to be delivered to the client: +.Bd -literal -offset indent +ngctl msg fxp0:orphans send_motm '{ hook="myHook" data="Welcome aboard" }' +.Ed .El +.Pp +The two commands above use the same ngpppoe_init_data structure described +above. +.Bl -tag -width 3n +.It Dv NGM_PPPOE_HURL +This command is sent to the node that started this session when a PADM +message with a HURL tag is received, and contains a URL that the host can +pass to a web browser for presentation to the user. +.It Dv NGM_PPPOE_MOTM +This command is sent to the node that started this session when a PADM +message with a MOTM tag is received, and contains a Message Of The +Minute that the host can display to the user. +.El +.Pp +The two commands above use a common data structure: +.Bd -literal -offset 4n +struct ngpppoe_padm { + char msg[PPPOE_PADM_VALUE_SIZE]; +}; +.Ed .Sh SHUTDOWN This node shuts down upon receipt of a .Dv NGM_SHUTDOWN Modified: head/sys/netgraph/ng_pppoe.c ============================================================================== --- head/sys/netgraph/ng_pppoe.c Wed Feb 14 21:14:28 2018 (r329278) +++ head/sys/netgraph/ng_pppoe.c Wed Feb 14 21:17:44 2018 (r329279) @@ -175,6 +175,20 @@ static const struct ng_cmdlist ng_pppoe_cmds[] = { &ng_parse_uint16_type, NULL }, + { + NGM_PPPOE_COOKIE, + NGM_PPPOE_SEND_HURL, + "send_hurl", + &ngpppoe_init_data_state_type, + NULL + }, + { + NGM_PPPOE_COOKIE, + NGM_PPPOE_SEND_MOTM, + "send_motm", + &ngpppoe_init_data_state_type, + NULL + }, { 0 } }; @@ -226,9 +240,11 @@ struct sess_neg { const struct pppoe_tag *tags[NUMTAGS]; u_int service_len; u_int ac_name_len; + u_int host_uniq_len; struct datatag service; struct datatag ac_name; + struct datatag host_uniq; }; typedef struct sess_neg *negp; @@ -589,22 +605,47 @@ static hook_p pppoe_finduniq(node_p node, const struct pppoe_tag *tag) { hook_p hook = NULL; - union uniq uniq; + sessp sp; - bcopy(tag + 1, uniq.bytes, sizeof(void *)); /* Cycle through all known hooks. */ LIST_FOREACH(hook, &node->nd_hooks, hk_hooks) { /* Skip any nonsession hook. */ if (NG_HOOK_PRIVATE(hook) == NULL) continue; - if (uniq.pointer == NG_HOOK_PRIVATE(hook)) + sp = NG_HOOK_PRIVATE(hook); + /* Skip already connected sessions. */ + if (sp->neg == NULL) + continue; + if (sp->neg->host_uniq_len == ntohs(tag->tag_len) && + bcmp(sp->neg->host_uniq.data, (const char *)(tag + 1), + sp->neg->host_uniq_len) == 0) break; } - CTR3(KTR_NET, "%20s: matched %p for %p", __func__, hook, uniq.pointer); + CTR3(KTR_NET, "%20s: matched %p for %p", __func__, hook, sp); return (hook); } +static hook_p +pppoe_findcookie(node_p node, const struct pppoe_tag *tag) +{ + hook_p hook = NULL; + union uniq cookie; + + bcopy(tag + 1, cookie.bytes, sizeof(void *)); + /* Cycle through all known hooks. */ + LIST_FOREACH(hook, &node->nd_hooks, hk_hooks) { + /* Skip any nonsession hook. */ + if (NG_HOOK_PRIVATE(hook) == NULL) + continue; + if (cookie.pointer == NG_HOOK_PRIVATE(hook)) + break; + } + CTR3(KTR_NET, "%20s: matched %p for %p", __func__, hook, cookie.pointer); + + return (hook); +} + /************************************************************************** * Start of Netgraph entrypoints. * **************************************************************************/ @@ -744,17 +785,29 @@ ng_pppoe_rcvmsg(node_p node, item_p item, hook_p lasth case NGM_PPPOE_LISTEN: case NGM_PPPOE_OFFER: case NGM_PPPOE_SERVICE: + case NGM_PPPOE_SEND_HURL: + case NGM_PPPOE_SEND_MOTM: ourmsg = (struct ngpppoe_init_data *)msg->data; if (msg->header.arglen < sizeof(*ourmsg)) { log(LOG_ERR, "ng_pppoe[%x]: init data too " "small\n", node->nd_ID); LEAVE(EMSGSIZE); } - if (msg->header.arglen - sizeof(*ourmsg) > - PPPOE_SERVICE_NAME_SIZE) { - log(LOG_ERR, "ng_pppoe[%x]: service name " - "too big\n", node->nd_ID); - LEAVE(EMSGSIZE); + if (msg->header.cmd == NGM_PPPOE_SEND_HURL || + msg->header.cmd == NGM_PPPOE_SEND_MOTM) { + if (msg->header.arglen - sizeof(*ourmsg) > + PPPOE_PADM_VALUE_SIZE) { + log(LOG_ERR, "ng_pppoe[%x]: message " + "too big\n", node->nd_ID); + LEAVE(EMSGSIZE); + } + } else { + if (msg->header.arglen - sizeof(*ourmsg) > + PPPOE_SERVICE_NAME_SIZE) { + log(LOG_ERR, "ng_pppoe[%x]: service name " + "too big\n", node->nd_ID); + LEAVE(EMSGSIZE); + } } if (msg->header.arglen - sizeof(*ourmsg) < ourmsg->data_len) { @@ -794,6 +847,20 @@ ng_pppoe_rcvmsg(node_p node, item_p item, hook_p lasth if (msg->header.cmd == NGM_PPPOE_SERVICE) break; + /* + * PADM messages are set up on active sessions. + */ + if (msg->header.cmd == NGM_PPPOE_SEND_HURL || + msg->header.cmd == NGM_PPPOE_SEND_MOTM) { + if (sp->state != PPPOE_NEWCONNECTED && + sp->state != PPPOE_CONNECTED) { + log(LOG_NOTICE, "ng_pppoe[%x]: session is not " + "active\n", node->nd_ID); + LEAVE(EISCONN); + } + break; + } + if (sp->state != PPPOE_SNONE) { log(LOG_NOTICE, "ng_pppoe[%x]: Session already " "active\n", node->nd_ID); @@ -848,12 +915,15 @@ ng_pppoe_rcvmsg(node_p node, item_p item, hook_p lasth * Check the hook exists and is Uninitialised. * Send a PADI request, and start the timeout logic. * Store the originator of this message so we can send - * a success of fail message to them later. + * a success or fail message to them later. * Move the session to SINIT. * Set up the session to the correct state and * start it. */ - int i, acnlen = 0, acnsep = 0, srvlen; + int acnpos, acnlen = 0, acnsep = 0; + int hupos, hulen = 0, husep = 0; + int i, srvpos, srvlen; + acnpos = 0; for (i = 0; i < ourmsg->data_len; i++) { if (ourmsg->data[i] == '\\') { acnlen = i; @@ -861,15 +931,56 @@ ng_pppoe_rcvmsg(node_p node, item_p item, hook_p lasth break; } } - srvlen = ourmsg->data_len - acnlen - acnsep; + hupos = acnlen + acnsep; + for (i = hupos; i < ourmsg->data_len; i++) { + if (ourmsg->data[i] == '|') { + hulen = i - hupos; + husep = 1; + break; + } + } + srvpos = hupos + hulen + husep; + srvlen = ourmsg->data_len - srvpos; - bcopy(ourmsg->data, neg->ac_name.data, acnlen); + bcopy(ourmsg->data + acnpos, neg->ac_name.data, acnlen); neg->ac_name_len = acnlen; + neg->host_uniq.hdr.tag_type = PTT_HOST_UNIQ; + if (hulen == 0) { + /* Not provided, generate one */ + neg->host_uniq.hdr.tag_len = htons(sizeof(sp)); + bcopy(&sp, neg->host_uniq.data, sizeof(sp)); + neg->host_uniq_len = sizeof(sp); + } else if (hulen > 2 && ourmsg->data[hupos] == '0' && + ourmsg->data[hupos + 1] == 'x' && hulen % 2 == 0) { + /* Hex encoded */ + static const char hexdig[16] = "0123456789abcdef"; + int j; + + neg->host_uniq.hdr.tag_len = htons((uint16_t)(hulen / 2 - 1)); + for (i = 0; i < hulen - 2; i++) { + for (j = 0; + j < 16 && + ourmsg->data[hupos + 2 + i] != hexdig[j]; + j++); + if (j == 16) + LEAVE(EINVAL); + if (i % 2 == 0) + neg->host_uniq.data[i / 2] = j << 4; + else + neg->host_uniq.data[i / 2] |= j; + } + neg->host_uniq_len = hulen / 2 - 1; + } else { + /* Plain string */ + neg->host_uniq.hdr.tag_len = htons((uint16_t)hulen); + bcopy(ourmsg->data + hupos, neg->host_uniq.data, hulen); + neg->host_uniq_len = hulen; + } + neg->service.hdr.tag_type = PTT_SRV_NAME; neg->service.hdr.tag_len = htons((uint16_t)srvlen); - bcopy(ourmsg->data + acnlen + acnsep, - neg->service.data, srvlen); + bcopy(ourmsg->data + srvpos, neg->service.data, srvlen); neg->service_len = srvlen; pppoe_start(sp); break; @@ -879,7 +990,7 @@ ng_pppoe_rcvmsg(node_p node, item_p item, hook_p lasth * Check the hook exists and is Uninitialised. * Install the service matching string. * Store the originator of this message so we can send - * a success of fail message to them later. + * a success or fail message to them later. * Move the hook to 'LISTENING' */ neg->service.hdr.tag_type = PTT_SRV_NAME; @@ -1019,6 +1130,92 @@ ng_pppoe_rcvmsg(node_p node, item_p item, hook_p lasth privp->max_payload.hdr.tag_len = htons(sizeof(uint16_t)); privp->max_payload.data = htons(*((uint16_t *)msg->data)); break; + case NGM_PPPOE_SEND_HURL: + { + struct mbuf *m; + + /* Generate a packet of that type. */ + m = m_gethdr(M_NOWAIT, MT_DATA); + if (m == NULL) + log(LOG_NOTICE, "ng_pppoe[%x]: session out of " + "mbufs\n", node->nd_ID); + else { + struct pppoe_full_hdr *wh; + struct pppoe_tag *tag; + int error = 0; + + wh = mtod(m, struct pppoe_full_hdr *); + bcopy(&sp->pkt_hdr, wh, sizeof(*wh)); + + /* Revert the stored header to DISC/PADM mode. */ + wh->ph.code = PADM_CODE; + /* + * Configure ethertype depending on what + * was used during sessions stage. + */ + if (wh->eh.ether_type == + ETHERTYPE_PPPOE_3COM_SESS) + wh->eh.ether_type = ETHERTYPE_PPPOE_3COM_DISC; + else + wh->eh.ether_type = ETHERTYPE_PPPOE_DISC; + /* + * Add PADM message and adjust sizes. + */ + tag = (void *)(&wh->ph + 1); + tag->tag_type = PTT_HURL; + tag->tag_len = htons(ourmsg->data_len); + strncpy((char *)(tag + 1), ourmsg->data, ourmsg->data_len); + m->m_pkthdr.len = m->m_len = sizeof(*wh) + sizeof(*tag) + + ourmsg->data_len; + wh->ph.length = htons(sizeof(*tag) + ourmsg->data_len); + NG_SEND_DATA_ONLY(error, + privp->ethernet_hook, m); + } + break; + } + case NGM_PPPOE_SEND_MOTM: + { + struct mbuf *m; + + /* Generate a packet of that type. */ + m = m_gethdr(M_NOWAIT, MT_DATA); + if (m == NULL) + log(LOG_NOTICE, "ng_pppoe[%x]: session out of " + "mbufs\n", node->nd_ID); + else { + struct pppoe_full_hdr *wh; + struct pppoe_tag *tag; + int error = 0; + + wh = mtod(m, struct pppoe_full_hdr *); + bcopy(&sp->pkt_hdr, wh, sizeof(*wh)); + + /* Revert the stored header to DISC/PADM mode. */ + wh->ph.code = PADM_CODE; + /* + * Configure ethertype depending on what + * was used during sessions stage. + */ + if (wh->eh.ether_type == + ETHERTYPE_PPPOE_3COM_SESS) + wh->eh.ether_type = ETHERTYPE_PPPOE_3COM_DISC; + else + wh->eh.ether_type = ETHERTYPE_PPPOE_DISC; + /* + * Add PADM message and adjust sizes. + */ + tag = (void *)(&wh->ph + 1); + tag->tag_type = PTT_MOTM; + tag->tag_len = htons(ourmsg->data_len); + strncpy((char *)(tag + 1), ourmsg->data, ourmsg->data_len); + m->m_pkthdr.len = m->m_len = sizeof(*wh) + sizeof(*tag) + + ourmsg->data_len; + wh->ph.length = htons(sizeof(*tag) + ourmsg->data_len); + NG_SEND_DATA_ONLY(error, + privp->ethernet_hook, m); + } + break; + } default: LEAVE(EINVAL); } @@ -1061,10 +1258,6 @@ pppoe_start(sessp sp) node_p node = NG_HOOK_NODE(hook); priv_p privp = NG_NODE_PRIVATE(node); negp neg = sp->neg; - struct { - struct pppoe_tag hdr; - union uniq data; - } __packed uniqtag; struct mbuf *m0; int error; @@ -1080,11 +1273,8 @@ pppoe_start(sessp sp) memcpy((void *)&neg->pkt->pkt_header.eh, &privp->eh, sizeof(struct ether_header)); neg->pkt->pkt_header.ph.code = PADI_CODE; - uniqtag.hdr.tag_type = PTT_HOST_UNIQ; - uniqtag.hdr.tag_len = htons((u_int16_t)sizeof(uniqtag.data)); - uniqtag.data.pointer = sp; init_tags(sp); - insert_tag(sp, &uniqtag.hdr); + insert_tag(sp, &neg->host_uniq.hdr); insert_tag(sp, &neg->service.hdr); if (privp->max_payload.data != 0) insert_tag(sp, &privp->max_payload.hdr); @@ -1163,6 +1353,52 @@ send_maxp(sessp sp, const struct pppoe_tag *tag) return (error); } +static int +send_hurl(sessp sp, const struct pppoe_tag *tag) +{ + int error, tlen; + struct ng_mesg *msg; + struct ngpppoe_padm *padm; + + CTR2(KTR_NET, "%20s: called %d", __func__, sp->Session_ID); + + NG_MKMESSAGE(msg, NGM_PPPOE_COOKIE, NGM_PPPOE_HURL, + sizeof(struct ngpppoe_padm), M_NOWAIT); + if (msg == NULL) + return (ENOMEM); + + padm = (struct ngpppoe_padm *)msg->data; + tlen = min(PPPOE_PADM_VALUE_SIZE - 1, ntohs(tag->tag_len)); + strncpy(padm->msg, (const char *)(tag + 1), tlen); + padm->msg[tlen] = '\0'; + NG_SEND_MSG_ID(error, NG_HOOK_NODE(sp->hook), msg, sp->creator, 0); + + return (error); +} + +static int +send_motm(sessp sp, const struct pppoe_tag *tag) +{ + int error, tlen; + struct ng_mesg *msg; + struct ngpppoe_padm *padm; + + CTR2(KTR_NET, "%20s: called %d", __func__, sp->Session_ID); + + NG_MKMESSAGE(msg, NGM_PPPOE_COOKIE, NGM_PPPOE_MOTM, + sizeof(struct ngpppoe_padm), M_NOWAIT); + if (msg == NULL) + return (ENOMEM); + + padm = (struct ngpppoe_padm *)msg->data; + tlen = min(PPPOE_PADM_VALUE_SIZE - 1, ntohs(tag->tag_len)); + strncpy(padm->msg, (const char *)(tag + 1), tlen); + padm->msg[tlen] = '\0'; + NG_SEND_MSG_ID(error, NG_HOOK_NODE(sp->hook), msg, sp->creator, 0); + + return (error); +} + /* * Receive data from session hook and do something with it. */ @@ -1320,6 +1556,7 @@ ng_pppoe_rcvdata_ether(hook_p hook, item_p item) const priv_p privp = NG_NODE_PRIVATE(node); sessp sp; const struct pppoe_tag *utag = NULL, *tag = NULL; + const struct pppoe_tag sntag = { PTT_SRV_NAME, 0 }; const struct pppoe_full_hdr *wh; const struct pppoe_hdr *ph; negp neg = NULL; @@ -1409,11 +1646,8 @@ ng_pppoe_rcvdata_ether(hook_p hook, item_p item) * processing. */ tag = get_tag(ph, PTT_SRV_NAME); - if (tag == NULL) { - CTR1(KTR_NET, "%20s: PADI w/o Service-Name", - __func__); - LEAVE(ENETUNREACH); - } + if (tag == NULL) + tag = &sntag; /* * First, try to match Service-Name against our @@ -1438,8 +1672,7 @@ ng_pppoe_rcvdata_ether(hook_p hook, item_p item) * For now simply accept the first we receive. */ utag = get_tag(ph, PTT_HOST_UNIQ); - if ((utag == NULL) || - (ntohs(utag->tag_len) != sizeof(sp))) { + if (utag == NULL) { log(LOG_NOTICE, "ng_pppoe[%x]: no host " "unique field\n", node->nd_ID); LEAVE(ENETUNREACH); @@ -1529,7 +1762,7 @@ ng_pppoe_rcvdata_ether(hook_p hook, item_p item) LEAVE(ENETUNREACH); } - sendhook = pppoe_finduniq(node, utag); + sendhook = pppoe_findcookie(node, utag); if (sendhook == NULL) LEAVE(ENETUNREACH); @@ -1605,8 +1838,7 @@ ng_pppoe_rcvdata_ether(hook_p hook, item_p item) * set us into Session mode. */ utag = get_tag(ph, PTT_HOST_UNIQ); - if ((utag == NULL) || - (ntohs(utag->tag_len) != sizeof(sp))) { + if (utag == NULL) { LEAVE (ENETUNREACH); } sendhook = pppoe_finduniq(node, utag); @@ -1659,6 +1891,19 @@ ng_pppoe_rcvdata_ether(hook_p hook, item_p item) /* Disconnect that hook. */ ng_rmhook_self(sp->hook); break; + case PADM_CODE: + /* + * We are a client: + * find matching peer/session combination. + */ + sp = pppoe_findsession(privp, wh); + if (sp == NULL) + LEAVE (ENETUNREACH); + if ((tag = get_tag(ph, PTT_HURL))) + send_hurl(sp, tag); + if ((tag = get_tag(ph, PTT_MOTM))) + send_motm(sp, tag); + break; default: LEAVE(EPFNOSUPPORT); } @@ -1781,7 +2026,7 @@ ng_pppoe_disconnect(hook_p hook) struct mbuf *m; /* Generate a packet of that type. */ - MGETHDR(m, M_NOWAIT, MT_DATA); + m = m_gethdr(M_NOWAIT, MT_DATA); if (m == NULL) log(LOG_NOTICE, "ng_pppoe[%x]: session out of " "mbufs\n", node->nd_ID); @@ -1791,8 +2036,6 @@ ng_pppoe_disconnect(hook_p hook) int msglen = strlen(SIGNOFF); int error = 0; - m->m_pkthdr.rcvif = NULL; - m->m_pkthdr.len = m->m_len = sizeof(*wh); wh = mtod(m, struct pppoe_full_hdr *); bcopy(&sp->pkt_hdr, wh, sizeof(*wh)); @@ -1815,8 +2058,8 @@ ng_pppoe_disconnect(hook_p hook) tag->tag_type = PTT_GEN_ERR; tag->tag_len = htons((u_int16_t)msglen); strncpy((char *)(tag + 1), SIGNOFF, msglen); - m->m_pkthdr.len = (m->m_len += sizeof(*tag) + - msglen); + m->m_pkthdr.len = m->m_len = sizeof(*wh) + sizeof(*tag) + + msglen; wh->ph.length = htons(sizeof(*tag) + msglen); NG_SEND_DATA_ONLY(error, privp->ethernet_hook, m); @@ -1933,6 +2176,8 @@ scan_tags(sessp sp, const struct pppoe_hdr* ph) case PTT_SYS_ERR: case PTT_GEN_ERR: case PTT_MAX_PAYL: + case PTT_HURL: + case PTT_MOTM: break; } pt = (const struct pppoe_tag*)ptn; Modified: head/sys/netgraph/ng_pppoe.h ============================================================================== --- head/sys/netgraph/ng_pppoe.h Wed Feb 14 21:14:28 2018 (r329278) +++ head/sys/netgraph/ng_pppoe.h Wed Feb 14 21:17:44 2018 (r329279) @@ -52,8 +52,10 @@ #define NGM_PPPOE_COOKIE 1089893072 #define NGM_PPPOE_SETMAXP_COOKIE 1441624322 +#define NGM_PPPOE_PADM_COOKIE 1488405822 #define PPPOE_SERVICE_NAME_SIZE 64 /* for now */ +#define PPPOE_PADM_VALUE_SIZE 128 /* for now */ /* Hook names */ #define NG_PPPOE_HOOK_ETHERNET "ethernet" @@ -84,7 +86,11 @@ enum cmd { NGM_PPPOE_SETMODE = 12, /* set to standard or compat modes */ NGM_PPPOE_GETMODE = 13, /* see current mode */ NGM_PPPOE_SETENADDR = 14, /* set Ethernet address */ - NGM_PPPOE_SETMAXP = 15 /* Set PPP-Max-Payload value */ + NGM_PPPOE_SETMAXP = 15, /* Set PPP-Max-Payload value */ + NGM_PPPOE_SEND_HURL = 16, /* Send PADM HURL message */ + NGM_PPPOE_HURL = 17, /* HURL for informational purposes */ + NGM_PPPOE_SEND_MOTM = 18, /* Send PADM MOTM message */ + NGM_PPPOE_MOTM = 19 /* MOTM for informational purposes */ }; /*********************** @@ -157,6 +163,13 @@ struct ngpppoe_maxp { uint16_t data; }; +/* + * This structure is used to send PADM messages from server to client. + */ +struct ngpppoe_padm { + char msg[PPPOE_PADM_VALUE_SIZE]; +}; + /******************************************************************** * Constants and definitions specific to pppoe ********************************************************************/ @@ -171,6 +184,7 @@ struct ngpppoe_maxp { #define PADR_CODE 0x19 #define PADS_CODE 0x65 #define PADT_CODE 0xa7 +#define PADM_CODE 0xd3 /* Tag identifiers */ #if BYTE_ORDER == BIG_ENDIAN @@ -181,6 +195,8 @@ struct ngpppoe_maxp { #define PTT_AC_COOKIE (0x0104) #define PTT_VENDOR (0x0105) #define PTT_RELAY_SID (0x0110) +#define PTT_HURL (0x0111) /* PPPoE Extensions (CARREL) */ +#define PTT_MOTM (0x0112) /* PPPoE Extensions (CARREL) */ #define PTT_MAX_PAYL (0x0120) /* PPP-Max-Payload (RFC4638) */ #define PTT_SRV_ERR (0x0201) #define PTT_SYS_ERR (0x0202) @@ -198,6 +214,8 @@ struct ngpppoe_maxp { #define PTT_AC_COOKIE (0x0401) #define PTT_VENDOR (0x0501) #define PTT_RELAY_SID (0x1001) +#define PTT_HURL (0x1101) /* PPPoE Extensions (CARREL) */ +#define PTT_MOTM (0x1201) /* PPPoE Extensions (CARREL) */ #define PTT_MAX_PAYL (0x2001) /* PPP-Max-Payload (RFC4638) */ #define PTT_SRV_ERR (0x0102) #define PTT_SYS_ERR (0x0202) From owner-svn-src-all@freebsd.org Wed Feb 14 21:39:11 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6C174F22AB0; Wed, 14 Feb 2018 21:39:11 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 224736EDC4; Wed, 14 Feb 2018 21:39: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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 191031568A; Wed, 14 Feb 2018 21:39: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 w1ELdArD042365; Wed, 14 Feb 2018 21:39:10 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1ELdAHl042364; Wed, 14 Feb 2018 21:39:10 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201802142139.w1ELdAHl042364@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Wed, 14 Feb 2018 21:39:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r329280 - stable/11/sys/arm/arm X-SVN-Group: stable-11 X-SVN-Commit-Author: gonzo X-SVN-Commit-Paths: stable/11/sys/arm/arm X-SVN-Commit-Revision: 329280 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Feb 2018 21:39:11 -0000 Author: gonzo Date: Wed Feb 14 21:39:10 2018 New Revision: 329280 URL: https://svnweb.freebsd.org/changeset/base/329280 Log: MFC r320387: [arm] Use correct index value when checking range validity Reviewed by: andrew Differential Revision: https://reviews.freebsd.org/D9145 Modified: stable/11/sys/arm/arm/gic.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/arm/arm/gic.c ============================================================================== --- stable/11/sys/arm/arm/gic.c Wed Feb 14 21:17:44 2018 (r329279) +++ stable/11/sys/arm/arm/gic.c Wed Feb 14 21:39:10 2018 (r329280) @@ -1656,11 +1656,11 @@ arm_gicv2m_alloc_msi(device_t dev, device_t child, int break; } - KASSERT((psc->gic_irqs[irq].gi_flags & GI_FLAG_MSI)!= 0, + KASSERT((psc->gic_irqs[end_irq].gi_flags & GI_FLAG_MSI)!= 0, ("%s: Non-MSI interrupt found", __func__)); /* This is already used */ - if ((psc->gic_irqs[irq].gi_flags & GI_FLAG_MSI_USED) == + if ((psc->gic_irqs[end_irq].gi_flags & GI_FLAG_MSI_USED) == GI_FLAG_MSI_USED) { found = false; break; From owner-svn-src-all@freebsd.org Wed Feb 14 23:35:48 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C2703F06617; Wed, 14 Feb 2018 23:35:48 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7201E73542; Wed, 14 Feb 2018 23:35:48 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 52D5A16A28; Wed, 14 Feb 2018 23:35:48 +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 w1ENZmfh002609; Wed, 14 Feb 2018 23:35:48 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1ENZmVU002607; Wed, 14 Feb 2018 23:35:48 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201802142335.w1ENZmVU002607@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Wed, 14 Feb 2018 23:35:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329281 - in head/sys: amd64/amd64 i386/i386 X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: in head/sys: amd64/amd64 i386/i386 X-SVN-Commit-Revision: 329281 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Feb 2018 23:35:49 -0000 Author: cem Date: Wed Feb 14 23:35:47 2018 New Revision: 329281 URL: https://svnweb.freebsd.org/changeset/base/329281 Log: x86 pmap: Make memory mapped via pmap_qenter() non-executable The idea is, the pmap_qenter() API is now defined to not produce executable mappings. If you need executable mappings, use another API. Add pg_nx flag in pmap_qenter on x86 to make kernel pages non-executable. Other architectures that support execute-specific permissons on page table entries should subsequently be updated to match. Submitted by: Darrick Lew Reviewed by: markj Discussed with: alc, jhb, kib Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D14062 Modified: head/sys/amd64/amd64/pmap.c head/sys/i386/i386/pmap.c Modified: head/sys/amd64/amd64/pmap.c ============================================================================== --- head/sys/amd64/amd64/pmap.c Wed Feb 14 21:39:10 2018 (r329280) +++ head/sys/amd64/amd64/pmap.c Wed Feb 14 23:35:47 2018 (r329281) @@ -2338,7 +2338,7 @@ pmap_qenter(vm_offset_t sva, vm_page_t *ma, int count) pa = VM_PAGE_TO_PHYS(m) | cache_bits; if ((*pte & (PG_FRAME | X86_PG_PTE_CACHE)) != pa) { oldpte |= *pte; - pte_store(pte, pa | pg_g | X86_PG_RW | X86_PG_V); + pte_store(pte, pa | pg_g | pg_nx | X86_PG_RW | X86_PG_V); } pte++; } Modified: head/sys/i386/i386/pmap.c ============================================================================== --- head/sys/i386/i386/pmap.c Wed Feb 14 21:39:10 2018 (r329280) +++ head/sys/i386/i386/pmap.c Wed Feb 14 23:35:47 2018 (r329281) @@ -1677,7 +1677,11 @@ pmap_qenter(vm_offset_t sva, vm_page_t *ma, int count) pa = VM_PAGE_TO_PHYS(m) | pmap_cache_bits(m->md.pat_mode, 0); if ((*pte & (PG_FRAME | PG_PTE_CACHE)) != pa) { oldpte |= *pte; +#if defined(PAE) || defined(PAE_TABLES) + pte_store(pte, pa | pgeflag | pg_nx | PG_RW | PG_V); +#else pte_store(pte, pa | pgeflag | PG_RW | PG_V); +#endif } pte++; } From owner-svn-src-all@freebsd.org Wed Feb 14 23:47:05 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 847FDF07226; Wed, 14 Feb 2018 23:47:05 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3314273CB7; Wed, 14 Feb 2018 23:47:05 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2DEBA16BE6; Wed, 14 Feb 2018 23:47:05 +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 w1ENl4vr007624; Wed, 14 Feb 2018 23:47:04 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1ENl4In007623; Wed, 14 Feb 2018 23:47:04 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201802142347.w1ENl4In007623@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Wed, 14 Feb 2018 23:47:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329282 - head/share/man/man9 X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/share/man/man9 X-SVN-Commit-Revision: 329282 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Feb 2018 23:47:05 -0000 Author: cem Date: Wed Feb 14 23:47:04 2018 New Revision: 329282 URL: https://svnweb.freebsd.org/changeset/base/329282 Log: pmap_qenter.9: Document API NX mapping A follow-up to r329281. Sponsored by: Dell EMC Isilon Modified: head/share/man/man9/pmap_qenter.9 Modified: head/share/man/man9/pmap_qenter.9 ============================================================================== --- head/share/man/man9/pmap_qenter.9 Wed Feb 14 23:35:47 2018 (r329281) +++ head/share/man/man9/pmap_qenter.9 Wed Feb 14 23:47:04 2018 (r329282) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 21, 2003 +.Dd February 14, 2018 .Dt PMAP_QENTER 9 .Os .Sh NAME @@ -50,6 +50,7 @@ pointers to wired pages and enters each of these pages into the kernel virtual address (KVA) space, beginning at the address .Fa sva . +The pages are mapped non-executable. .Pp The .Fn pmap_qremove From owner-svn-src-all@freebsd.org Wed Feb 14 23:51:45 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 70161F076C2; Wed, 14 Feb 2018 23:51:45 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2151A740CB; Wed, 14 Feb 2018 23:51:45 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1BC7216D3C; Wed, 14 Feb 2018 23:51:45 +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 w1ENpij8009991; Wed, 14 Feb 2018 23:51:44 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1ENpi1u009989; Wed, 14 Feb 2018 23:51:44 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201802142351.w1ENpi1u009989@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Wed, 14 Feb 2018 23:51:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r329283 - in stable/11: share/man/man4 sys/dev/vt/colors X-SVN-Group: stable-11 X-SVN-Commit-Author: gonzo X-SVN-Commit-Paths: in stable/11: share/man/man4 sys/dev/vt/colors X-SVN-Commit-Revision: 329283 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Feb 2018 23:51:45 -0000 Author: gonzo Date: Wed Feb 14 23:51:44 2018 New Revision: 329283 URL: https://svnweb.freebsd.org/changeset/base/329283 Log: MFC r327444, r327449, r327454 r327444: vt(4): add support for configurable console palette Introduce new set of loader tunables kern.vt.color.N.rgb, where N is a number from 0 to 15. The value is either comma-separated list decimal numbers ranging from 0 to 255 that represent values of red, green, and blue components respectively (i.e. "128,128,128") or 6-digit hex triplet commonly used to represent colors in HTML or xterm settings (i.e. #808080) Each tunable overrides one of the 16 hardcoded palette codes and can be set in loader.conf(5) Reviewed by: bcr(docs), jilles, manu, ray Differential Revision: https://reviews.freebsd.org/D13645 r327449: Unbreak build broken by r327444 During review iterations function signature has changed in definition but not in actual call. Fix call to match the definition. Reported by: Herbert J. Skuhra Pointyhat to: gonzo r327454: Fix GCC build broken by r32744 Indicate in function declaration that vt_palette_init does not take any arguments Modified: stable/11/share/man/man4/vt.4 stable/11/sys/dev/vt/colors/vt_termcolors.c Directory Properties: stable/11/ (props changed) Modified: stable/11/share/man/man4/vt.4 ============================================================================== --- stable/11/share/man/man4/vt.4 Wed Feb 14 23:47:04 2018 (r329282) +++ stable/11/share/man/man4/vt.4 Wed Feb 14 23:51:44 2018 (r329283) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 19, 2016 +.Dd December 28, 2017 .Dt "VT" 4 .Os .Sh NAME @@ -45,6 +45,7 @@ In .Xr loader.conf 5 : .Cd hw.vga.textmode=1 .Cd kern.vty=vt +.Cd kern.vt.color..rgb="" .Cd kern.vt.fb.default_mode="x" .Cd kern.vt.fb.modes.="x" .Pp @@ -205,6 +206,16 @@ If not set, the default in the .Pa GENERIC kernel is .Nm . +.It Va kern.vt.color. Ns Ar colornum Ns Va .rgb +Set this value to override default palette entry for color +.Pa colornum +which should be in a range from 0 to 15 inclusive. +The value should be either a comma-separated triplet of +red, green, and blue values in a range from 0 to 255 or +HTML-like hex triplet. +See +.Sx EXAMPLES +below. .It Va kern.vt.fb.default_mode Set this value to a graphic mode to override the default mode picked by the .Nm @@ -309,6 +320,11 @@ The connector name was found in .Dl info: [drm] Connector LVDS-1: get mode from tunables: .Dl info: [drm] - kern.vt.fb.modes.LVDS-1 .Dl info: [drm] - kern.vt.fb.default_mode +.Pp +To set black and white colors of console palette +.Pp +.Dl kern.vt.color.0.rgb="10,10,10" +.Dl kern.vt.color.15.rgb="#f0f0f0" .Sh SEE ALSO .Xr kbdcontrol 1 , .Xr login 1 , Modified: stable/11/sys/dev/vt/colors/vt_termcolors.c ============================================================================== --- stable/11/sys/dev/vt/colors/vt_termcolors.c Wed Feb 14 23:47:04 2018 (r329282) +++ stable/11/sys/dev/vt/colors/vt_termcolors.c Wed Feb 14 23:51:44 2018 (r329283) @@ -31,14 +31,18 @@ __FBSDID("$FreeBSD$"); #include +#include +#include #include -static const struct { +#define NCOLORS 16 + +static struct { unsigned char r; /* Red percentage value. */ unsigned char g; /* Green percentage value. */ unsigned char b; /* Blue percentage value. */ -} color_def[16] = { +} color_def[NCOLORS] = { {0, 0, 0}, /* black */ {50, 0, 0}, /* dark red */ {0, 50, 0}, /* dark green */ @@ -63,19 +67,112 @@ static const struct { * - blue and red are swapped (1 <-> 4) * - yellow ad cyan are swapped (3 <-> 6) */ -static const int cons_to_vga_colors[16] = { +static const int cons_to_vga_colors[NCOLORS] = { 0, 4, 2, 6, 1, 5, 3, 7, 0, 4, 2, 6, 1, 5, 3, 7 }; +static int +vt_parse_rgb_triplet(const char *rgb, unsigned char *r, + unsigned char *g, unsigned char *b) +{ + unsigned long v; + const char *ptr; + char *endptr; + + ptr = rgb; + + /* Handle #rrggbb case */ + if (*ptr == '#') { + if (strlen(ptr) != 7) + return (-1); + v = strtoul(ptr + 1, &endptr, 16); + if (*endptr != '\0') + return (-1); + + *r = (v >> 16) & 0xff; + *g = (v >> 8) & 0xff; + *b = v & 0xff; + + return (0); + } + + /* "r, g, b" case */ + v = strtoul(ptr, &endptr, 10); + if (ptr == endptr) + return (-1); + if (v > 255) + return (-1); + *r = v & 0xff; + ptr = endptr; + + /* skip separator */ + while (*ptr == ',' || *ptr == ' ') + ptr++; + + v = strtoul(ptr, &endptr, 10); + if (ptr == endptr) + return (-1); + if (v > 255) + return (-1); + *g = v & 0xff; + ptr = endptr; + + /* skip separator */ + while (*ptr == ',' || *ptr == ' ') + ptr++; + + v = strtoul(ptr, &endptr, 10); + if (ptr == endptr) + return (-1); + if (v > 255) + return (-1); + *b = v & 0xff; + ptr = endptr; + + /* skip trailing spaces */ + while (*ptr == ' ') + ptr++; + + /* unexpected characters at the end of the string */ + if (*ptr != 0) + return (-1); + + return (0); +} + +static void +vt_palette_init(void) +{ + int i; + char rgb[32]; + char tunable[32]; + unsigned char r, g, b; + + for (i = 0; i < NCOLORS; i++) { + snprintf(tunable, sizeof(tunable), + "kern.vt.color.%d.rgb", i); + if (TUNABLE_STR_FETCH(tunable, rgb, sizeof(rgb))) { + if (vt_parse_rgb_triplet(rgb, &r, &g, &b) == 0) { + /* convert to percentages */ + color_def[i].r = r*100/255; + color_def[i].g = g*100/255; + color_def[i].b = b*100/255; + } + } + } +} + int vt_generate_cons_palette(uint32_t *palette, int format, uint32_t rmax, int roffset, uint32_t gmax, int goffset, uint32_t bmax, int boffset) { int i; + vt_palette_init(); + #define CF(_f, _i) ((_f ## max * color_def[(_i)]._f / 100) << _f ## offset) - for (i = 0; i < 16; i++) { + for (i = 0; i < NCOLORS; i++) { switch (format) { case COLOR_FORMAT_VGA: palette[i] = cons_to_vga_colors[i]; From owner-svn-src-all@freebsd.org Wed Feb 14 23:52:40 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4F23AF07949; Wed, 14 Feb 2018 23:52:40 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0148A742CB; Wed, 14 Feb 2018 23:52:40 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F02AE16D7A; Wed, 14 Feb 2018 23:52:39 +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 w1ENqdcm012239; Wed, 14 Feb 2018 23:52:39 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1ENqd6b012235; Wed, 14 Feb 2018 23:52:39 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201802142352.w1ENqd6b012235@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Wed, 14 Feb 2018 23:52:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329284 - in head: cddl/usr.sbin/zfsd lib/libdevdctl X-SVN-Group: head X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: in head: cddl/usr.sbin/zfsd lib/libdevdctl X-SVN-Commit-Revision: 329284 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Feb 2018 23:52:40 -0000 Author: asomers Date: Wed Feb 14 23:52:39 2018 New Revision: 329284 URL: https://svnweb.freebsd.org/changeset/base/329284 Log: zfsd: Allow zfsd to work on any type of GEOM provider cddl/usr.sbin/zfsd/zfsd_event.cc Remove the check for da and ada devices. This way zfsd can work on md, geli, glabel, gstripe, etc devices. geli in particular is useful combined with ZFS. gnop is also useful for simulating drive pulls in the ZFSD test suite. Also, eliminate the DevfsEvent class entirely. Move its responsibilities into GeomEvent. We can get everything we need to know just from listening to GEOM events. lib/libdevdctl/event.cc Fix GeomEvent::DevName for CREATE events. Oddly, the relevant field is named "cdev" for CREATE events but "devname" for disk events. MFC after: 3 weeks Relnotes: Yes (probably worth mentioning the geli part) Sponsored by: Spectra Logic Corp Modified: head/cddl/usr.sbin/zfsd/zfsd.cc head/cddl/usr.sbin/zfsd/zfsd_event.cc head/cddl/usr.sbin/zfsd/zfsd_event.h head/lib/libdevdctl/event.cc Modified: head/cddl/usr.sbin/zfsd/zfsd.cc ============================================================================== --- head/cddl/usr.sbin/zfsd/zfsd.cc Wed Feb 14 23:51:44 2018 (r329283) +++ head/cddl/usr.sbin/zfsd/zfsd.cc Wed Feb 14 23:52:39 2018 (r329284) @@ -98,7 +98,6 @@ int ZfsDaemon::s_signalPipeFD[2]; bool ZfsDaemon::s_systemRescanRequested(false); EventFactory::Record ZfsDaemon::s_registryEntries[] = { - { Event::NOTIFY, "DEVFS", &DevfsEvent::Builder }, { Event::NOTIFY, "GEOM", &GeomEvent::Builder }, { Event::NOTIFY, "ZFS", &ZfsEvent::Builder } }; Modified: head/cddl/usr.sbin/zfsd/zfsd_event.cc ============================================================================== --- head/cddl/usr.sbin/zfsd/zfsd_event.cc Wed Feb 14 23:51:44 2018 (r329283) +++ head/cddl/usr.sbin/zfsd/zfsd_event.cc Wed Feb 14 23:52:39 2018 (r329284) @@ -76,111 +76,32 @@ using std::stringstream; /*=========================== Class Implementations ==========================*/ -/*-------------------------------- DevfsEvent --------------------------------*/ +/*-------------------------------- GeomEvent --------------------------------*/ -//- DevfsEvent Static Public Methods ------------------------------------------- +//- GeomEvent Static Public Methods ------------------------------------------- Event * -DevfsEvent::Builder(Event::Type type, - NVPairMap &nvPairs, - const string &eventString) +GeomEvent::Builder(Event::Type type, + NVPairMap &nvPairs, + const string &eventString) { - return (new DevfsEvent(type, nvPairs, eventString)); + return (new GeomEvent(type, nvPairs, eventString)); } -//- DevfsEvent Static Protected Methods ---------------------------------------- -nvlist_t * -DevfsEvent::ReadLabel(int devFd, bool &inUse, bool °raded) -{ - pool_state_t poolState; - char *poolName; - boolean_t b_inuse; - int nlabels; - - inUse = false; - degraded = false; - poolName = NULL; - if (zpool_in_use(g_zfsHandle, devFd, &poolState, - &poolName, &b_inuse) == 0) { - nvlist_t *devLabel = NULL; - - inUse = b_inuse == B_TRUE; - if (poolName != NULL) - free(poolName); - - nlabels = zpool_read_all_labels(devFd, &devLabel); - /* - * If we find a disk with fewer than the maximum number of - * labels, it might be the whole disk of a partitioned disk - * where ZFS resides on a partition. In that case, we should do - * nothing and wait for the partition to appear. Or, the disk - * might be damaged. In that case, zfsd should do nothing and - * wait for the sysadmin to decide. - */ - if (nlabels != VDEV_LABELS || devLabel == NULL) { - nvlist_free(devLabel); - return (NULL); - } - - try { - Vdev vdev(devLabel); - degraded = vdev.State() != VDEV_STATE_HEALTHY; - return (devLabel); - } catch (ZfsdException &exp) { - string devName = fdevname(devFd); - string devPath = _PATH_DEV + devName; - string context("DevfsEvent::ReadLabel: " - + devPath + ": "); - - exp.GetString().insert(0, context); - exp.Log(); - nvlist_free(devLabel); - } - } - return (NULL); -} - -bool -DevfsEvent::OnlineByLabel(const string &devPath, const string& physPath, - nvlist_t *devConfig) -{ - try { - /* - * A device with ZFS label information has been - * inserted. If it matches a device for which we - * have a case, see if we can solve that case. - */ - syslog(LOG_INFO, "Interrogating VDEV label for %s\n", - devPath.c_str()); - Vdev vdev(devConfig); - CaseFile *caseFile(CaseFile::Find(vdev.PoolGUID(), - vdev.GUID())); - if (caseFile != NULL) - return (caseFile->ReEvaluate(devPath, physPath, &vdev)); - - } catch (ZfsdException &exp) { - string context("DevfsEvent::OnlineByLabel: " + devPath + ": "); - - exp.GetString().insert(0, context); - exp.Log(); - } - return (false); -} - -//- DevfsEvent Virtual Public Methods ------------------------------------------ +//- GeomEvent Virtual Public Methods ------------------------------------------ Event * -DevfsEvent::DeepCopy() const +GeomEvent::DeepCopy() const { - return (new DevfsEvent(*this)); + return (new GeomEvent(*this)); } - + bool -DevfsEvent::Process() const +GeomEvent::Process() const { /* - * We are only concerned with newly discovered - * devices that can be ZFS vdevs. + * We are only concerned with create arrivals and physical path changes, + * because those can be used to satisfy online and autoreplace operations */ - if (Value("type") != "CREATE" || !IsDiskDev()) + if (Value("type") != "GEOM::physpath" && Value("type") != "CREATE") return (false); /* Log the event since it is of interest. */ @@ -199,7 +120,7 @@ DevfsEvent::Process() const nvlist_t *devLabel(ReadLabel(devFd, inUse, degraded)); string physPath; - bool havePhysPath(PhysicalPath(physPath)); + bool havePhysPath(PhysicalPath(physPath)); string devName; DevName(devName); @@ -211,8 +132,8 @@ DevfsEvent::Process() const syslog(LOG_INFO, "%s is marked degraded. Ignoring " "as a replace by physical path candidate.\n", devName.c_str()); - } else if (havePhysPath && IsWholeDev()) { - /* + } else if (havePhysPath) { + /* * TODO: attempt to resolve events using every casefile * that matches this physpath */ @@ -227,93 +148,97 @@ DevfsEvent::Process() const caseFile->ReEvaluate(devPath, physPath, /*vdev*/NULL); } } - if (devLabel != NULL) - nvlist_free(devLabel); return (false); } -//- DevfsEvent Protected Methods ----------------------------------------------- -DevfsEvent::DevfsEvent(Event::Type type, NVPairMap &nvpairs, +//- GeomEvent Protected Methods ----------------------------------------------- +GeomEvent::GeomEvent(Event::Type type, NVPairMap &nvpairs, const string &eventString) - : DevdCtl::DevfsEvent(type, nvpairs, eventString) + : DevdCtl::GeomEvent(type, nvpairs, eventString) { } -DevfsEvent::DevfsEvent(const DevfsEvent &src) - : DevdCtl::DevfsEvent::DevfsEvent(src) +GeomEvent::GeomEvent(const GeomEvent &src) + : DevdCtl::GeomEvent::GeomEvent(src) { } -/*-------------------------------- GeomEvent --------------------------------*/ - -//- GeomEvent Static Public Methods ------------------------------------------- -Event * -GeomEvent::Builder(Event::Type type, - NVPairMap &nvPairs, - const string &eventString) +nvlist_t * +GeomEvent::ReadLabel(int devFd, bool &inUse, bool °raded) { - return (new GeomEvent(type, nvPairs, eventString)); -} + pool_state_t poolState; + char *poolName; + boolean_t b_inuse; + int nlabels; -//- GeomEvent Virtual Public Methods ------------------------------------------ -Event * -GeomEvent::DeepCopy() const -{ - return (new GeomEvent(*this)); -} - -bool -GeomEvent::Process() const -{ - /* - * We are only concerned with physical path changes, because those can - * be used to satisfy autoreplace operations - */ - if (Value("type") != "GEOM::physpath" || !IsDiskDev()) - return (false); + inUse = false; + degraded = false; + poolName = NULL; + if (zpool_in_use(g_zfsHandle, devFd, &poolState, + &poolName, &b_inuse) == 0) { + nvlist_t *devLabel = NULL; - /* Log the event since it is of interest. */ - Log(LOG_INFO); + inUse = b_inuse == B_TRUE; + if (poolName != NULL) + free(poolName); - string devPath; - if (!DevPath(devPath)) - return (false); + nlabels = zpool_read_all_labels(devFd, &devLabel); + /* + * If we find a disk with fewer than the maximum number of + * labels, it might be the whole disk of a partitioned disk + * where ZFS resides on a partition. In that case, we should do + * nothing and wait for the partition to appear. Or, the disk + * might be damaged. In that case, zfsd should do nothing and + * wait for the sysadmin to decide. + */ + if (nlabels != VDEV_LABELS || devLabel == NULL) { + nvlist_free(devLabel); + return (NULL); + } - string physPath; - bool havePhysPath(PhysicalPath(physPath)); + try { + Vdev vdev(devLabel); + degraded = vdev.State() != VDEV_STATE_HEALTHY; + return (devLabel); + } catch (ZfsdException &exp) { + string devName = fdevname(devFd); + string devPath = _PATH_DEV + devName; + string context("GeomEvent::ReadLabel: " + + devPath + ": "); - string devName; - DevName(devName); - - if (havePhysPath) { - /* - * TODO: attempt to resolve events using every casefile - * that matches this physpath - */ - CaseFile *caseFile(CaseFile::Find(physPath)); - if (caseFile != NULL) { - syslog(LOG_INFO, - "Found CaseFile(%s:%s:%s) - ReEvaluating\n", - caseFile->PoolGUIDString().c_str(), - caseFile->VdevGUIDString().c_str(), - zpool_state_to_name(caseFile->VdevState(), - VDEV_AUX_NONE)); - caseFile->ReEvaluate(devPath, physPath, /*vdev*/NULL); + exp.GetString().insert(0, context); + exp.Log(); + nvlist_free(devLabel); } } - return (false); + return (NULL); } -//- GeomEvent Protected Methods ----------------------------------------------- -GeomEvent::GeomEvent(Event::Type type, NVPairMap &nvpairs, - const string &eventString) - : DevdCtl::GeomEvent(type, nvpairs, eventString) +bool +GeomEvent::OnlineByLabel(const string &devPath, const string& physPath, + nvlist_t *devConfig) { -} + try { + /* + * A device with ZFS label information has been + * inserted. If it matches a device for which we + * have a case, see if we can solve that case. + */ + syslog(LOG_INFO, "Interrogating VDEV label for %s\n", + devPath.c_str()); + Vdev vdev(devConfig); + CaseFile *caseFile(CaseFile::Find(vdev.PoolGUID(), + vdev.GUID())); + if (caseFile != NULL) + return (caseFile->ReEvaluate(devPath, physPath, &vdev)); -GeomEvent::GeomEvent(const GeomEvent &src) - : DevdCtl::GeomEvent::GeomEvent(src) -{ + } catch (ZfsdException &exp) { + string context("GeomEvent::OnlineByLabel: " + devPath + ": "); + + exp.GetString().insert(0, context); + exp.Log(); + } + return (false); } Modified: head/cddl/usr.sbin/zfsd/zfsd_event.h ============================================================================== --- head/cddl/usr.sbin/zfsd/zfsd_event.h Wed Feb 14 23:51:44 2018 (r329283) +++ head/cddl/usr.sbin/zfsd/zfsd_event.h Wed Feb 14 23:52:39 2018 (r329284) @@ -60,63 +60,6 @@ typedef struct zpool_handle zpool_handle_t; struct nvlist; typedef struct nvlist nvlist_t; -/*============================= Class Definitions ============================*/ -/*-------------------------------- DevfsEvent --------------------------------*/ -class DevfsEvent : public DevdCtl::DevfsEvent -{ -public: - /** Specialized DevdCtlEvent object factory for Devfs events. */ - static BuildMethod Builder; - - virtual DevdCtl::Event *DeepCopy() const; - - /** - * Interpret and perform any actions necessary to - * consume the event. - * \return True if this event should be queued for later reevaluation - */ - virtual bool Process() const; - -protected: - /** - * \brief Read and return label information for a device. - * - * \param devFd The device from which to read ZFS label information. - * \param inUse The device is part of an active or potentially - * active configuration. - * \param degraded The device label indicates the vdev is not healthy. - * - * \return If label information is available, an nvlist describing - * the vdev configuraiton found on the device specified by - * devFd. Otherwise NULL. - */ - static nvlist_t *ReadLabel(int devFd, bool &inUse, bool °raded); - - /** - * Attempt to match the ZFS labeled device at devPath with an active - * CaseFile for a missing vdev. If a CaseFile is found, attempt - * to re-integrate the device with its pool. - * - * \param devPath The devfs path to the potential leaf vdev. - * \param physPath The physical path string reported by the device - * at devPath. - * \param devConfig The ZFS label information found on the device - * at devPath. - * - * \return true if the event that caused the online action can - * be considered consumed. - */ - static bool OnlineByLabel(const string &devPath, - const string& physPath, - nvlist_t *devConfig); - - /** DeepCopy Constructor. */ - DevfsEvent(const DevfsEvent &src); - - /** Constructor */ - DevfsEvent(Type, DevdCtl::NVPairMap &, const string &); -}; - /*--------------------------------- ZfsEvent ---------------------------------*/ class ZfsEvent : public DevdCtl::ZfsEvent { @@ -164,5 +107,38 @@ class GeomEvent : public DevdCtl::GeomEvent (protected /** Constructor */ GeomEvent(Type, DevdCtl::NVPairMap &, const string &); + + /** + * Attempt to match the ZFS labeled device at devPath with an active + * CaseFile for a missing vdev. If a CaseFile is found, attempt + * to re-integrate the device with its pool. + * + * \param devPath The devfs path to the potential leaf vdev. + * \param physPath The physical path string reported by the device + * at devPath. + * \param devConfig The ZFS label information found on the device + * at devPath. + * + * \return true if the event that caused the online action can + * be considered consumed. + */ + static bool OnlineByLabel(const string &devPath, + const string& physPath, + nvlist_t *devConfig); + + /** + * \brief Read and return label information for a device. + * + * \param devFd The device from which to read ZFS label information. + * \param inUse The device is part of an active or potentially + * active configuration. + * \param degraded The device label indicates the vdev is not healthy. + * + * \return If label information is available, an nvlist describing + * the vdev configuraiton found on the device specified by + * devFd. Otherwise NULL. + */ + static nvlist_t *ReadLabel(int devFd, bool &inUse, bool °raded); + }; #endif /*_ZFSD_EVENT_H_ */ Modified: head/lib/libdevdctl/event.cc ============================================================================== --- head/lib/libdevdctl/event.cc Wed Feb 14 23:51:44 2018 (r329283) +++ head/lib/libdevdctl/event.cc Wed Feb 14 23:52:39 2018 (r329284) @@ -542,7 +542,10 @@ GeomEvent::DeepCopy() const bool GeomEvent::DevName(std::string &name) const { - name = Value("devname"); + if (Value("subsystem") == "disk") + name = Value("devname"); + else + name = Value("cdev"); return (!name.empty()); } From owner-svn-src-all@freebsd.org Thu Feb 15 03:22:53 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B04CAF19EA1; Thu, 15 Feb 2018 03:22:53 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5FBE57ED37; Thu, 15 Feb 2018 03:22:53 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5A3661936D; Thu, 15 Feb 2018 03:22:53 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1F3Mrk9018787; Thu, 15 Feb 2018 03:22:53 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1F3Mrie018786; Thu, 15 Feb 2018 03:22:53 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201802150322.w1F3Mrie018786@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Thu, 15 Feb 2018 03:22:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329296 - head/sbin/devd X-SVN-Group: head X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: head/sbin/devd X-SVN-Commit-Revision: 329296 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Feb 2018 03:22:53 -0000 Author: eadler Date: Thu Feb 15 03:22:53 2018 New Revision: 329296 URL: https://svnweb.freebsd.org/changeset/base/329296 Log: devd: don't pass &fds in useless parameters to select(2) select(2) should be declared as restrict. In addition the only fd in the fdset is open O_RDONLY, and it's not a socket that can provide OOB notifications, Reviewed by: ian, imp, vangyzen Modified: head/sbin/devd/devd.cc Modified: head/sbin/devd/devd.cc ============================================================================== --- head/sbin/devd/devd.cc Thu Feb 15 03:22:04 2018 (r329295) +++ head/sbin/devd/devd.cc Thu Feb 15 03:22:53 2018 (r329296) @@ -1021,7 +1021,7 @@ event_loop(void) tv.tv_usec = 0; FD_ZERO(&fds); FD_SET(fd, &fds); - rv = select(fd + 1, &fds, &fds, &fds, &tv); + rv = select(fd + 1, &fds, NULL, NULL, &tv); // No events -> we've processed all pending events if (rv == 0) { devdlog(LOG_DEBUG, "Calling daemon\n"); From owner-svn-src-all@freebsd.org Thu Feb 15 03:22:05 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 25325F19D62; Thu, 15 Feb 2018 03:22:05 +0000 (UTC) (envelope-from rpokala@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CD4CF7EB56; Thu, 15 Feb 2018 03:22:04 +0000 (UTC) (envelope-from rpokala@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C840019343; Thu, 15 Feb 2018 03:22:04 +0000 (UTC) (envelope-from rpokala@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1F3M44x017816; Thu, 15 Feb 2018 03:22:04 GMT (envelope-from rpokala@FreeBSD.org) Received: (from rpokala@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1F3M4fC017815; Thu, 15 Feb 2018 03:22:04 GMT (envelope-from rpokala@FreeBSD.org) Message-Id: <201802150322.w1F3M4fC017815@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rpokala set sender to rpokala@FreeBSD.org using -f From: Ravi Pokala Date: Thu, 15 Feb 2018 03:22:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329295 - head/sys/dev/mxge X-SVN-Group: head X-SVN-Commit-Author: rpokala X-SVN-Commit-Paths: head/sys/dev/mxge X-SVN-Commit-Revision: 329295 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Feb 2018 03:22:05 -0000 Author: rpokala Date: Thu Feb 15 03:22:04 2018 New Revision: 329295 URL: https://svnweb.freebsd.org/changeset/base/329295 Log: mxge(4) should pass unhandled ioctls to ether_ioctl() Panasas discovered that ioctl(SIOCGLAGGPORT) returns ENOTTY for mxge(4) when the NIC is not a member of a lagg. This came as a surprise, because the SIOCGLAGGPORT handler in if_lagg.c only returns ENOENT (if run against the laggX interface, rather than a physical port) or EINVAL (if run against a non-member physical port). This behavior was not seen with other drivers, such as bge(4), igb(4), and cxl(4). When I compared their respective ioctl handlers, I found that they all called ether_ioctl() for the default (i.e. unhandled) case; by contrast, mxge(4) only calls ether_ioctl() for two specific cases, and returns ENOTTY for the default case. Remove the two cases which explicitly call ether_ioctl(), and let the default case call it instead. This matches what the vast majority of the NIC drivers do. Reviewed by: kmacy MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D14381 Modified: head/sys/dev/mxge/if_mxge.c Modified: head/sys/dev/mxge/if_mxge.c ============================================================================== --- head/sys/dev/mxge/if_mxge.c Thu Feb 15 00:27:30 2018 (r329294) +++ head/sys/dev/mxge/if_mxge.c Thu Feb 15 03:22:04 2018 (r329295) @@ -4162,11 +4162,6 @@ mxge_ioctl(struct ifnet *ifp, u_long command, caddr_t err = 0; switch (command) { - case SIOCSIFADDR: - case SIOCGIFADDR: - err = ether_ioctl(ifp, command, data); - break; - case SIOCSIFMTU: err = mxge_change_mtu(sc, ifr->ifr_mtu); break; @@ -4290,7 +4285,8 @@ mxge_ioctl(struct ifnet *ifp, u_long command, caddr_t break; default: - err = ENOTTY; + err = ether_ioctl(ifp, command, data); + break; } return err; } From owner-svn-src-all@freebsd.org Thu Feb 15 03:39:52 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 03C36F1B397 for ; Thu, 15 Feb 2018 03:39:51 +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 6EFA47F7B0 for ; Thu, 15 Feb 2018 03:39:51 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-it0-x229.google.com with SMTP id 193so14837425iti.1 for ; Wed, 14 Feb 2018 19:39:51 -0800 (PST) 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=LC2xR4FMqy9J6AA4ctQRdfbG9xgivjbDZQhPLrKOPZs=; b=Q1FZU97/OthCitbvMiQvY67xhHk39/XxIadKkiMAkqHip+c1WkBe3lf5lJPgDsvPTR qICVpXEd0qOPey1uGcsmat0McblfRlwNNsOFvAAt/gDAe+erHRBXQ9WSSFVujZXj8937 vUa0X9elK9v2jAHB7iDDQdohN9RyLN6usvYtgzfrmBJkQus4ApR7p0pDvA9UP99keeNB TWtkGD/61fLXV2WksUtOreF3RanwEGOtlWDGPyp//UWa6xLoXPBDn5yIUTDyNFTD5pci f8fhsswnSOdyWwm4OUm3WUZ382UAJQavPfHzhWc6MZ4pXkGsS1Fq3vdUxAzPBN5Mg/rQ m18A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=LC2xR4FMqy9J6AA4ctQRdfbG9xgivjbDZQhPLrKOPZs=; b=gM6QHqL+6l89Ix2X5PAU6PR0ocvtWs3fL5AD6u47GVmYMpzBqxYiD/caRz9pJUZKl1 Hf2CDN2CtjGMTzko3NyZaUgpjFy/5yh2CadSQOJGdzJxT9/nVSZ5djGOx3uKmxLpjW+z lDUV3FXuboxUKs40rNjJs4VGJBsAC9F4p5SEpVYGHA3dOv0tEiNsOWSSsju7eHjHSAZL CLAxl4xHDcyvtQcbaHiYsDgM/nn1yJiome4xaK9b1sGDx/nqJsJRNpdJuibl6HGuqE1G fYbwCJ8UQpcO88O0veLCMWGjmZiCUioHP18/taeQpJ6GeQEMyM0SKEWs4/wlAl+B80Tl gDFw== X-Gm-Message-State: APf1xPDhN2zD8+c+s1goQGN6CfVJIaCXfitAiFx5Ywix3KgisKTzd2Du Duzz2urW7MIePh3fr/RTAWRSfXVj+F+LMjvQ7Sijcg== X-Google-Smtp-Source: AH8x224m7KgYWrPHB2mrZtA9jJQa1L1jXbURmlfujLGvZU/tXx3sKSVu/B1nUmsBAtqWCrgdNi32HfWD6cn6xQBIw+I= X-Received: by 10.36.80.17 with SMTP id m17mr779905itb.64.1518665990395; Wed, 14 Feb 2018 19:39:50 -0800 (PST) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.201.67 with HTTP; Wed, 14 Feb 2018 19:39:49 -0800 (PST) X-Originating-IP: [2603:300b:6:5100:c5d:377:1ec2:48fe] Received: by 10.79.201.67 with HTTP; Wed, 14 Feb 2018 19:39:49 -0800 (PST) In-Reply-To: <201802150322.w1F3Mrie018786@repo.freebsd.org> References: <201802150322.w1F3Mrie018786@repo.freebsd.org> From: Warner Losh Date: Wed, 14 Feb 2018 20:39:49 -0700 X-Google-Sender-Auth: aL3iPQDiVL6pdXlnKttV5qb78CQ Message-ID: Subject: Re: svn commit: r329296 - head/sbin/devd To: Eitan Adler Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.25 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Feb 2018 03:39:52 -0000 On Feb 14, 2018 8:23 PM, "Eitan Adler" wrote: Author: eadler Date: Thu Feb 15 03:22:53 2018 New Revision: 329296 URL: https://svnweb.freebsd.org/changeset/base/329296 Log: devd: don't pass &fds in useless parameters to select(2) select(2) should be declared as restrict. In addition the only fd in the fdset is open O_RDONLY, and it's not a socket that can provide OOB notifications, Reviewed by: ian, imp, vangyzen Don't put my name on this. I specifically and clearly objected to the change anf tld yoy not to do it. Warner Modified: head/sbin/devd/devd.cc Modified: head/sbin/devd/devd.cc ============================================================ ================== --- head/sbin/devd/devd.cc Thu Feb 15 03:22:04 2018 (r329295) +++ head/sbin/devd/devd.cc Thu Feb 15 03:22:53 2018 (r329296) @@ -1021,7 +1021,7 @@ event_loop(void) tv.tv_usec = 0; FD_ZERO(&fds); FD_SET(fd, &fds); - rv = select(fd + 1, &fds, &fds, &fds, &tv); + rv = select(fd + 1, &fds, NULL, NULL, &tv); // No events -> we've processed all pending events if (rv == 0) { devdlog(LOG_DEBUG, "Calling daemon\n"); From owner-svn-src-all@freebsd.org Thu Feb 15 03:48:20 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 16066F1BEB7 for ; Thu, 15 Feb 2018 03:48:20 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-it0-x233.google.com (mail-it0-x233.google.com [IPv6:2607:f8b0:4001:c0b::233]) (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 9F6947FE0D for ; Thu, 15 Feb 2018 03:48:19 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-it0-x233.google.com with SMTP id w63so4002858ita.3 for ; Wed, 14 Feb 2018 19:48:19 -0800 (PST) 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=rWMv9ny2NVak8POaHA41XoU/1yDC9h1dG2Ugiqacqgk=; b=HKziAGRn7yZBDDVhlE4DJp/JYXnT6Mrwag+255pkijmzUvVzHPi4OA51oP7IAuCbJ0 ypuBI56Vh4msj7IBVI3hCPSkXXcA3PBGuiXLv9FvCfMaGcXlkVTHscUocDtrSA8UShbc S6abrrqi61reyN+4gA9JxoG1WXsQ9856sJGmVkli/Yt8Hkfblj0yyhid9Vr84LM8GHep TMRfzPaB1QO2CnOWcFtCFzI1Je1JEVvROX4rZBHIIR9uxebKyvct5bqPNs6np6fAGSIU F6avhGiNc0Hkzkrj8iQlspCTw+finK6RyJ+lDxmHlw1dBhQzJI/v0F3XbfWiqV974ARU Z55w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=rWMv9ny2NVak8POaHA41XoU/1yDC9h1dG2Ugiqacqgk=; b=B2ECyVAzRZbowKWGK4cidcQXHSQWQuz3ymNOXlLaau2pLgC/fnZgFskJ6d2LWdQrKY btPxuO10vJ/G5/BCTObpqoznlh7tn/HchfztASI5Hrf9WfP2fQqefPPje1L4T3x8oMeK chICx6toeYmCtySQo4vv4u2W511nA8HOVmJznKtbvOdSl1a3cGZMGVEQjh7zefxJaXWO pbyrDodvitm3PZWKuQyG5P1NRblcRn9PdZGoj8EwWUYgiGVPUcytt2lCcx3pnLSSl+zA x/GgiUM99h/0QC7AIYbvk7IbHRVVr6fvvYz0YIAMF14epT5FaTlVDVgTUlU1CeBZRFOm VguA== X-Gm-Message-State: APf1xPAO5RYKo8tqFYafmSigq2rdaokdtg8gctSTDBHll85PkwyG5+bM WueOIeRRHPtfLtnxqxdgzeF0VswpMOc1EsiuaagNDA== X-Google-Smtp-Source: AH8x225W+GX1H0vBstb9iVM+oY3UUkapty6qKsLNto6rY8viPZp1heh90dKT3Nb63EaWCn5W5nCxkM04u/nNYlSG1sk= X-Received: by 10.36.54.66 with SMTP id l63mr1712304itl.50.1518666498892; Wed, 14 Feb 2018 19:48:18 -0800 (PST) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.201.67 with HTTP; Wed, 14 Feb 2018 19:48:17 -0800 (PST) X-Originating-IP: [2603:300b:6:5100:18a2:a4f7:170:8dd9] In-Reply-To: References: <201802150322.w1F3Mrie018786@repo.freebsd.org> From: Warner Losh Date: Wed, 14 Feb 2018 20:48:17 -0700 X-Google-Sender-Auth: He8XBqbzz7KSorqQJpudx0r3r0s Message-ID: Subject: Re: svn commit: r329296 - head/sbin/devd To: Eitan Adler Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.25 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Feb 2018 03:48:20 -0000 On Wed, Feb 14, 2018 at 8:39 PM, Warner Losh wrote: > > > On Feb 14, 2018 8:23 PM, "Eitan Adler" wrote: > > Author: eadler > Date: Thu Feb 15 03:22:53 2018 > New Revision: 329296 > URL: https://svnweb.freebsd.org/changeset/base/329296 > > Log: > devd: don't pass &fds in useless parameters to select(2) > > select(2) should be declared as restrict. In addition the only fd in > the fdset is open O_RDONLY, and it's not a socket that can provide OOB > notifications, > > Reviewed by: ian, imp, vangyzen > > > Don't put my name on this. I specifically and clearly objected to the > change anf tld yoy not to do it. > Stupid phone... I specifically objected to this change. I said not to make it because it wasn't necessary. You did it any way. Don't put "reviewed by" for that. Put "objected to but I did it anyway by: imp" Warner > > Warner > > > Modified: > head/sbin/devd/devd.cc > > Modified: head/sbin/devd/devd.cc > ============================================================ > ================== > --- head/sbin/devd/devd.cc Thu Feb 15 03:22:04 2018 (r329295) > +++ head/sbin/devd/devd.cc Thu Feb 15 03:22:53 2018 (r329296) > @@ -1021,7 +1021,7 @@ event_loop(void) > tv.tv_usec = 0; > FD_ZERO(&fds); > FD_SET(fd, &fds); > - rv = select(fd + 1, &fds, &fds, &fds, &tv); > + rv = select(fd + 1, &fds, NULL, NULL, &tv); > // No events -> we've processed all pending events > if (rv == 0) { > devdlog(LOG_DEBUG, "Calling daemon\n"); > > > From owner-svn-src-all@freebsd.org Thu Feb 15 03:52:25 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8406FF1C3FA for ; Thu, 15 Feb 2018 03:52:25 +0000 (UTC) (envelope-from lists@eitanadler.com) Received: from mail-yw0-x22a.google.com (mail-yw0-x22a.google.com [IPv6:2607:f8b0:4002:c05::22a]) (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 1768A802E8 for ; Thu, 15 Feb 2018 03:52:24 +0000 (UTC) (envelope-from lists@eitanadler.com) Received: by mail-yw0-x22a.google.com with SMTP id d77so4213753ywb.2 for ; Wed, 14 Feb 2018 19:52:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eitanadler.com; s=0xdeadbeef; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=TPS7dD6g7UgUP1Cc8iRJ960Olx+NvONeaULq/mBB/xQ=; b=F5QXnbw39F/VNe/Tan5FEFCLwfVKB5OqGkvMKAQA0lrgEWvCVeRSeNOE7fc8ohp9Ip WQK9FUFrEm4asms2YE/nepDh+wDo00av50t0YsBkwx6wRiGKgKWiTmgqk+DswsTDFUY9 2dkggfyO1pGjftou7Pd3mFUbxpNojQLpZ1508= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd-org.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=TPS7dD6g7UgUP1Cc8iRJ960Olx+NvONeaULq/mBB/xQ=; b=Sv25g+u7ZjF2xckUU7/EaPKysDmxp2svrOfSsYUFtsj2WxjzEWXu/LrIrheEfoLpDF XM3SFWxqTdw2rC4XWuV9QgURKKx5Vv8S52/tRQ97R1yOVDyU1rD5HNRTplAkAcaMbw4Q VoSzbOnDJ2bWKbk/pHrKTVCHR7xswKC4L86LV/e1hjjifhcM3qa3ht28XImPvJW0uPOe lDW6DmrFOPD8SEHPit43xRq5y/Dq8eRAzlCUBFdzRQw9uRFwZfSJt9K8b5mH3Rywry67 7SOLjjVCsMhmyde4jI7dmx/YDi4aN4nCKgXqE2QOlpVqfEVeUJ3ZkF08ClaTLMZyOJUB aopw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=TPS7dD6g7UgUP1Cc8iRJ960Olx+NvONeaULq/mBB/xQ=; b=Uh+DQkAe61eAEFl68RYfQlviIzm5FHhxphFGnJqqDfeiToaRdd+IZglp9qP1TLhqDF EsPcCxcvD7HzBgVMZJIlX5/6Nq/WwhcHJrjI617zdo3hCoYOxClA3YmI0KX+L4PluCPL xNylHp4d43B04dLh9tVsT/duRLM/jiK4LqKVWOAMpNqnZ1Ooi4QQxLk0EWIrfCZ/Z0zG 0zSzGUxSMFLBjC25vKtxJsa0V94f3xDq73OIyVWoFQnQACt76AJmnx5k90wyWw8S3Ydu KtL5NLKroLzKvcILGnxb9fLcmPU+TB6CBd74DKdRayYATeaoKKM/hU2L6+mQ5Vf5ZnmN cZ+g== X-Gm-Message-State: APf1xPDca1FnEf6Y6Kp+YcQsgad/GJcVvOP4/qe25cwEns7EPR8BzNg0 uY7vQq38GySUcaX7Tiof9QciAIyyvD1LcjN9gKseMw== X-Google-Smtp-Source: AH8x2247r2B3oq8M+PSCdEc6iWOxDCfieLxy2BDeajzQlWxH/JeQOon58s9ii3MAmUOOBeLbtN2U0O5spymvmdIQWyQ= X-Received: by 10.37.37.18 with SMTP id l18mr89941ybl.277.1518666744379; Wed, 14 Feb 2018 19:52:24 -0800 (PST) MIME-Version: 1.0 Sender: lists@eitanadler.com Received: by 2002:a25:7107:0:0:0:0:0 with HTTP; Wed, 14 Feb 2018 19:51:53 -0800 (PST) In-Reply-To: References: <201802150322.w1F3Mrie018786@repo.freebsd.org> From: Eitan Adler Date: Wed, 14 Feb 2018 19:51:53 -0800 X-Google-Sender-Auth: hQZOgaKuW6-k6HEUWGefzSTwT9Y Message-ID: Subject: Re: svn commit: r329296 - head/sbin/devd To: Warner Losh Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Feb 2018 03:52:25 -0000 On 14 February 2018 at 19:48, Warner Losh wrote: > > > On Wed, Feb 14, 2018 at 8:39 PM, Warner Losh wrote: >> >> >> >> On Feb 14, 2018 8:23 PM, "Eitan Adler" wrote: >> >> Author: eadler >> Date: Thu Feb 15 03:22:53 2018 >> New Revision: 329296 >> URL: https://svnweb.freebsd.org/changeset/base/329296 >> >> Log: >> devd: don't pass &fds in useless parameters to select(2) >> >> select(2) should be declared as restrict. In addition the only fd in >> the fdset is open O_RDONLY, and it's not a socket that can provide OOB >> notifications, >> >> Reviewed by: ian, imp, vangyzen >> >> >> Don't put my name on this. I specifically and clearly objected to the >> change anf tld yoy not to do it. > > > Stupid phone... > > I specifically objected to this change. I said not to make it because it > wasn't necessary. You did it any way. Don't put "reviewed by" for that. Put > "objected to but I did it anyway by: imp" hrm.. rereading the thread I think I missed your original email. Only comment I saw was "poll is a better interface". Sorry for mis-stating your opinion. FTR I'd like to fix the declaration of select(2) anyways. -- Eitan Adler Source, Ports, Doc committer Bugmeister, Ports Security teams From owner-svn-src-all@freebsd.org Thu Feb 15 06:24:30 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 74E35F00BA0 for ; Thu, 15 Feb 2018 06:24:30 +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 F2F0084D11 for ; Thu, 15 Feb 2018 06:24:29 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-io0-x235.google.com with SMTP id z6so27706570iob.11 for ; Wed, 14 Feb 2018 22:24:29 -0800 (PST) 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=a3CIRNYArpEDA0/ijtxxsKh/DUxNYxlsY/3QMZmhVgM=; b=At9s+Ew1lOr2eAGKJtQY35P43mfzDCTaTjf4Iqw6oLwIonyl0dv0xkmbj9Ax4odSLk EOC2dxcmu1fIP/3b8CdZcrBI36ED/1kDwDM9ic5EEHrTvgLU9at5EFJLBlEjtH15PQod igvPjT4lsD+/SaKDGkKsCZ9qTWGn8cIJ02mDXkLQsJTNRWwqXT/Mj0QJbKVAZd0sfaIh EDzaJfPNF0R1BhRIJ3xKXqb5Kfls0i31ZXbwB6PxxTabDuKGF4ygJWpHU4H3nmftfDf+ 77yyCv/vi596GhLQkLHPxnrgCX8wIFGWmJTBiNukB1C6qrk0f+VBuIKV3fwgG7gOda6x 47og== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=a3CIRNYArpEDA0/ijtxxsKh/DUxNYxlsY/3QMZmhVgM=; b=ssvyOXHiLo+DVtRBJkbQHhAWYTyordPai0aJhswTR5bVFDQ0P+ue+S1oswS09vA2z0 i/atvybc2WN8zmsn11LQZU7EmqnSpWKWJx7gKZfn40qLodpgozXaocwOz2X6m4RRE+ik QcQodRaiMEChEUxtc5HhkwzDcPP2N3nz6yAE07/oHiVc8Y6R36rH50Y6YxsxRimNUier cWMZ3OB9n67Lmkxs5V3sLPDdqyshD5dNqumaJT3PPsiTY48zz2EHyQ6q3yH0cXBvMwnW DuDr8j+RUV6g+VVjP9COGrf/W8T261kjfmu7aoKuuTCXVm2k/UUIxDXIP/c1w3NG7dTI wt4A== X-Gm-Message-State: APf1xPAvHFvpx04JV9lJTVd42n67AKnImDQti6pwIyqdUY1/f5r1aHqr p5ancgr8JOmLRmSJOoec6bkcH2AgOBIJFl3mIwtwuQ== X-Google-Smtp-Source: AH8x224r2pHl2tV6R4/UIpdO9ib8/tYZ5CTT07yjz4k9JFZBLdlrgIYFvWu+HxgyDmjw2D6n0odSYhMy/XGz4D47hQg= X-Received: by 10.107.232.7 with SMTP id f7mr691289ioh.130.1518675869088; Wed, 14 Feb 2018 22:24:29 -0800 (PST) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.201.67 with HTTP; Wed, 14 Feb 2018 22:24:28 -0800 (PST) X-Originating-IP: [2603:300b:6:5100:18a2:a4f7:170:8dd9] In-Reply-To: References: <201802150322.w1F3Mrie018786@repo.freebsd.org> From: Warner Losh Date: Wed, 14 Feb 2018 23:24:28 -0700 X-Google-Sender-Auth: HoMnuRv9rVfnlFc6xarkjfCdjyc Message-ID: Subject: Re: svn commit: r329296 - head/sbin/devd To: Eitan Adler Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.25 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Feb 2018 06:24:30 -0000 On Wed, Feb 14, 2018 at 8:51 PM, Eitan Adler wrote: > On 14 February 2018 at 19:48, Warner Losh wrote: > > > > > > On Wed, Feb 14, 2018 at 8:39 PM, Warner Losh wrote: > >> > >> > >> > >> On Feb 14, 2018 8:23 PM, "Eitan Adler" wrote: > >> > >> Author: eadler > >> Date: Thu Feb 15 03:22:53 2018 > >> New Revision: 329296 > >> URL: https://svnweb.freebsd.org/changeset/base/329296 > >> > >> Log: > >> devd: don't pass &fds in useless parameters to select(2) > >> > >> select(2) should be declared as restrict. In addition the only fd in > >> the fdset is open O_RDONLY, and it's not a socket that can provide OOB > >> notifications, > >> > >> Reviewed by: ian, imp, vangyzen > >> > >> > >> Don't put my name on this. I specifically and clearly objected to the > >> change anf tld yoy not to do it. > > > > > > Stupid phone... > > > > I specifically objected to this change. I said not to make it because it > > wasn't necessary. You did it any way. Don't put "reviewed by" for that. > Put > > "objected to but I did it anyway by: imp" > > hrm.. rereading the thread I think I missed your original email. Only > comment I saw was "poll is a better interface". Sorry for mis-stating > your opinion. > Yea. It was more of a "don't change it, since it's fine now" and then the "poll" comment was "better to just change to a better interface." > FTR I'd like to fix the declaration of select(2) anyways. That's unlikely to end well... I wish you luck... The pattern I used in devd for select was nearly universal a decade ago... Maybe things have changed... Warner From owner-svn-src-all@freebsd.org Thu Feb 15 07:23:42 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 894FBF03293; Thu, 15 Feb 2018 07:23:42 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 095A386A4C; Thu, 15 Feb 2018 07:23:42 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0444B1BA7A; Thu, 15 Feb 2018 07:23:42 +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 w1F7Nf64037460; Thu, 15 Feb 2018 07:23:41 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1F7NfKj037459; Thu, 15 Feb 2018 07:23:41 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201802150723.w1F7NfKj037459@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Thu, 15 Feb 2018 07:23:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329297 - head/sys/x86/xen X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/x86/xen X-SVN-Commit-Revision: 329297 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Feb 2018 07:23:42 -0000 Author: mjg Date: Thu Feb 15 07:23:41 2018 New Revision: 329297 URL: https://svnweb.freebsd.org/changeset/base/329297 Log: xen: fix smp boot after r328157 mce_stack was left unset leading to early crashes Modified: head/sys/x86/xen/pv.c Modified: head/sys/x86/xen/pv.c ============================================================================== --- head/sys/x86/xen/pv.c Thu Feb 15 03:22:53 2018 (r329296) +++ head/sys/x86/xen/pv.c Thu Feb 15 07:23:41 2018 (r329297) @@ -99,6 +99,7 @@ static int xen_pv_start_all_aps(void); #ifdef SMP /* Variables used by amd64 mp_machdep to start APs */ extern char *doublefault_stack; +extern char *mce_stack; extern char *nmi_stack; #endif @@ -218,6 +219,8 @@ start_xen_ap(int cpu) bootstacks[cpu] = (void *)kmem_malloc(kernel_arena, stacksize, M_WAITOK | M_ZERO); doublefault_stack = + (char *)kmem_malloc(kernel_arena, PAGE_SIZE, M_WAITOK | M_ZERO); + mce_stack = (char *)kmem_malloc(kernel_arena, PAGE_SIZE, M_WAITOK | M_ZERO); nmi_stack = (char *)kmem_malloc(kernel_arena, PAGE_SIZE, M_WAITOK | M_ZERO); From owner-svn-src-all@freebsd.org Thu Feb 15 08:43:23 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B03E7F08421; Thu, 15 Feb 2018 08:43:23 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6637F69D1F; Thu, 15 Feb 2018 08:43:23 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6107C1C75C; Thu, 15 Feb 2018 08:43:23 +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 w1F8hNi6077667; Thu, 15 Feb 2018 08:43:23 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1F8hN3D077666; Thu, 15 Feb 2018 08:43:23 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201802150843.w1F8hN3D077666@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 15 Feb 2018 08:43:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r329298 - stable/11/sys/kern X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/11/sys/kern X-SVN-Commit-Revision: 329298 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Feb 2018 08:43:23 -0000 Author: hselasky Date: Thu Feb 15 08:43:23 2018 New Revision: 329298 URL: https://svnweb.freebsd.org/changeset/base/329298 Log: MFC r328774: Slightly bump the maximum OID path for loading tunable SYSCTLs. Coming updates to the mlx5en(4) driver will require this. Sponsored by: Mellanox Technologies Modified: stable/11/sys/kern/kern_sysctl.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/kern/kern_sysctl.c ============================================================================== --- stable/11/sys/kern/kern_sysctl.c Thu Feb 15 07:23:41 2018 (r329297) +++ stable/11/sys/kern/kern_sysctl.c Thu Feb 15 08:43:23 2018 (r329298) @@ -188,7 +188,7 @@ sysctl_load_tunable_by_oid_locked(struct sysctl_oid *o struct sysctl_req req; struct sysctl_oid *curr; char *penv = NULL; - char path[64]; + char path[96]; ssize_t rem = sizeof(path); ssize_t len; uint8_t val_8; From owner-svn-src-all@freebsd.org Thu Feb 15 08:46:21 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 17368F08754; Thu, 15 Feb 2018 08:46:21 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BC68769EF1; Thu, 15 Feb 2018 08:46:20 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B74651C75F; Thu, 15 Feb 2018 08:46:20 +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 w1F8kKPs077864; Thu, 15 Feb 2018 08:46:20 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1F8kKEL077863; Thu, 15 Feb 2018 08:46:20 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201802150846.w1F8kKEL077863@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 15 Feb 2018 08:46:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r329299 - stable/11/sys/dev/mlx5/mlx5_en X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/11/sys/dev/mlx5/mlx5_en X-SVN-Commit-Revision: 329299 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Feb 2018 08:46:21 -0000 Author: hselasky Date: Thu Feb 15 08:46:20 2018 New Revision: 329299 URL: https://svnweb.freebsd.org/changeset/base/329299 Log: MFC r328591: Move the mlx5 core device pointer first in the mlx5en priv. This help simplify checks to recognize own network devices when using mlx5ib. This patch fixes an issues where mlx5ib fails to recognize mceX network devices for use with RoCE. Sponsored by: Mellanox Technologies Modified: stable/11/sys/dev/mlx5/mlx5_en/en.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/mlx5/mlx5_en/en.h ============================================================================== --- stable/11/sys/dev/mlx5/mlx5_en/en.h Thu Feb 15 08:43:23 2018 (r329298) +++ stable/11/sys/dev/mlx5/mlx5_en/en.h Thu Feb 15 08:46:20 2018 (r329299) @@ -646,6 +646,8 @@ struct mlx5e_flow_tables { }; struct mlx5e_priv { + struct mlx5_core_dev *mdev; /* must be first */ + /* priv data path fields - start */ int order_base_2_num_channels; int queue_mapping_channel_mask; @@ -683,7 +685,6 @@ struct mlx5e_priv { struct work_struct set_rx_mode_work; MLX5_DECLARE_DOORBELL_LOCK(doorbell_lock) - struct mlx5_core_dev *mdev; struct ifnet *ifp; struct sysctl_ctx_list sysctl_ctx; struct sysctl_oid *sysctl_ifnet; From owner-svn-src-all@freebsd.org Thu Feb 15 08:48:05 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6F3D2F08982; Thu, 15 Feb 2018 08:48:05 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2062C6A235; Thu, 15 Feb 2018 08:48:05 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1B3E71C761; Thu, 15 Feb 2018 08:48:05 +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 w1F8m4mD077978; Thu, 15 Feb 2018 08:48:04 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1F8m4o6077977; Thu, 15 Feb 2018 08:48:04 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201802150848.w1F8m4o6077977@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 15 Feb 2018 08:48:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r329300 - stable/10/sys/dev/mlx5/mlx5_en X-SVN-Group: stable-10 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/10/sys/dev/mlx5/mlx5_en X-SVN-Commit-Revision: 329300 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Feb 2018 08:48:05 -0000 Author: hselasky Date: Thu Feb 15 08:48:04 2018 New Revision: 329300 URL: https://svnweb.freebsd.org/changeset/base/329300 Log: MFC r328591: Move the mlx5 core device pointer first in the mlx5en priv. This help simplify checks to recognize own network devices when using mlx5ib. This patch fixes an issues where mlx5ib fails to recognize mceX network devices for use with RoCE. Sponsored by: Mellanox Technologies Modified: stable/10/sys/dev/mlx5/mlx5_en/en.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/mlx5/mlx5_en/en.h ============================================================================== --- stable/10/sys/dev/mlx5/mlx5_en/en.h Thu Feb 15 08:46:20 2018 (r329299) +++ stable/10/sys/dev/mlx5/mlx5_en/en.h Thu Feb 15 08:48:04 2018 (r329300) @@ -644,6 +644,8 @@ struct mlx5e_flow_table { }; struct mlx5e_priv { + struct mlx5_core_dev *mdev; /* must be first */ + /* priv data path fields - start */ int order_base_2_num_channels; int queue_mapping_channel_mask; @@ -681,7 +683,6 @@ struct mlx5e_priv { struct work_struct set_rx_mode_work; MLX5_DECLARE_DOORBELL_LOCK(doorbell_lock) - struct mlx5_core_dev *mdev; struct ifnet *ifp; struct sysctl_ctx_list sysctl_ctx; struct sysctl_oid *sysctl_ifnet; From owner-svn-src-all@freebsd.org Thu Feb 15 08:50:44 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AFEFBF08CB1; Thu, 15 Feb 2018 08:50:44 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 628FD6A551; Thu, 15 Feb 2018 08:50:44 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5D0BB1C773; Thu, 15 Feb 2018 08:50: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 w1F8oiom078257; Thu, 15 Feb 2018 08:50:44 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1F8oiTg078255; Thu, 15 Feb 2018 08:50:44 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201802150850.w1F8oiTg078255@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 15 Feb 2018 08:50:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r329301 - in stable/11/sys/dev/usb: . serial X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in stable/11/sys/dev/usb: . serial X-SVN-Commit-Revision: 329301 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Feb 2018 08:50:44 -0000 Author: hselasky Date: Thu Feb 15 08:50:43 2018 New Revision: 329301 URL: https://svnweb.freebsd.org/changeset/base/329301 Log: MFC r328830: Add new USB ID. PR: 225641 Submitted by: Ryan Sponsored by: Mellanox Technologies Modified: stable/11/sys/dev/usb/serial/uslcom.c stable/11/sys/dev/usb/usbdevs Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/usb/serial/uslcom.c ============================================================================== --- stable/11/sys/dev/usb/serial/uslcom.c Thu Feb 15 08:48:04 2018 (r329300) +++ stable/11/sys/dev/usb/serial/uslcom.c Thu Feb 15 08:50:43 2018 (r329301) @@ -313,6 +313,7 @@ static const STRUCT_USB_HOST_ID uslcom_devs[] = { USLCOM_DEV(SILABS, EMS_C1007), USLCOM_DEV(SILABS, HAMLINKUSB), USLCOM_DEV(SILABS, HELICOM), + USLCOM_DEV(SILABS, HUBZ), USLCOM_DEV(SILABS, IMS_USB_RS422), USLCOM_DEV(SILABS, INFINITY_MIC), USLCOM_DEV(SILABS, INGENI_ZIGBEE), Modified: stable/11/sys/dev/usb/usbdevs ============================================================================== --- stable/11/sys/dev/usb/usbdevs Thu Feb 15 08:48:04 2018 (r329300) +++ stable/11/sys/dev/usb/usbdevs Thu Feb 15 08:50:43 2018 (r329301) @@ -4174,6 +4174,7 @@ product SILABS AC_SERV_CAN 0x8664 AC-Services CAN Inte product SILABS AC_SERV_OBD 0x8665 AC-Services OBD Interface product SILABS MMB_ZIGBEE 0x88a4 MMB Networks ZigBee product SILABS INGENI_ZIGBEE 0x88a5 Planet Innovation Ingeni ZigBee +product SILABS HUBZ 0x8a2a HubZ dual ZigBee and Z-Wave product SILABS CP2102 0xea60 SILABS USB UART product SILABS CP210X_2 0xea61 CP210x Serial product SILABS CP210X_3 0xea70 CP210x Serial From owner-svn-src-all@freebsd.org Thu Feb 15 08:52:59 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 44B1CF091FF; Thu, 15 Feb 2018 08:52:59 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EB17F6ABAA; Thu, 15 Feb 2018 08:52:58 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E5D1B1C8FA; Thu, 15 Feb 2018 08:52:58 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1F8qwRI083190; Thu, 15 Feb 2018 08:52:58 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1F8qw1s083188; Thu, 15 Feb 2018 08:52:58 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201802150852.w1F8qw1s083188@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 15 Feb 2018 08:52:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r329302 - in stable/10/sys/dev/usb: . serial X-SVN-Group: stable-10 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in stable/10/sys/dev/usb: . serial X-SVN-Commit-Revision: 329302 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Feb 2018 08:52:59 -0000 Author: hselasky Date: Thu Feb 15 08:52:58 2018 New Revision: 329302 URL: https://svnweb.freebsd.org/changeset/base/329302 Log: MFC r328830: Add new USB ID. PR: 225641 Submitted by: Ryan Sponsored by: Mellanox Technologies Modified: stable/10/sys/dev/usb/serial/uslcom.c stable/10/sys/dev/usb/usbdevs Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/usb/serial/uslcom.c ============================================================================== --- stable/10/sys/dev/usb/serial/uslcom.c Thu Feb 15 08:50:43 2018 (r329301) +++ stable/10/sys/dev/usb/serial/uslcom.c Thu Feb 15 08:52:58 2018 (r329302) @@ -313,6 +313,7 @@ static const STRUCT_USB_HOST_ID uslcom_devs[] = { USLCOM_DEV(SILABS, EMS_C1007), USLCOM_DEV(SILABS, HAMLINKUSB), USLCOM_DEV(SILABS, HELICOM), + USLCOM_DEV(SILABS, HUBZ), USLCOM_DEV(SILABS, IMS_USB_RS422), USLCOM_DEV(SILABS, INFINITY_MIC), USLCOM_DEV(SILABS, INGENI_ZIGBEE), Modified: stable/10/sys/dev/usb/usbdevs ============================================================================== --- stable/10/sys/dev/usb/usbdevs Thu Feb 15 08:50:43 2018 (r329301) +++ stable/10/sys/dev/usb/usbdevs Thu Feb 15 08:52:58 2018 (r329302) @@ -4162,6 +4162,7 @@ product SILABS AC_SERV_CAN 0x8664 AC-Services CAN Inte product SILABS AC_SERV_OBD 0x8665 AC-Services OBD Interface product SILABS MMB_ZIGBEE 0x88a4 MMB Networks ZigBee product SILABS INGENI_ZIGBEE 0x88a5 Planet Innovation Ingeni ZigBee +product SILABS HUBZ 0x8a2a HubZ dual ZigBee and Z-Wave product SILABS CP2102 0xea60 SILABS USB UART product SILABS CP210X_2 0xea61 CP210x Serial product SILABS CP210X_3 0xea70 CP210x Serial From owner-svn-src-all@freebsd.org Thu Feb 15 08:56:04 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 79E55F09549; Thu, 15 Feb 2018 08:56:04 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2A5896ADD2; Thu, 15 Feb 2018 08:56:04 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 20B721C8FC; Thu, 15 Feb 2018 08:56:04 +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 w1F8u3KG083399; Thu, 15 Feb 2018 08:56:03 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1F8u3tR083397; Thu, 15 Feb 2018 08:56:03 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201802150856.w1F8u3tR083397@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 15 Feb 2018 08:56:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r329303 - in stable/11/sys/dev/usb: . serial X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in stable/11/sys/dev/usb: . serial X-SVN-Commit-Revision: 329303 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Feb 2018 08:56:04 -0000 Author: hselasky Date: Thu Feb 15 08:56:03 2018 New Revision: 329303 URL: https://svnweb.freebsd.org/changeset/base/329303 Log: MFC r328163: Add new USB ID to U3G driver. PR: 134299 Sponsored by: Mellanox Technologies Modified: stable/11/sys/dev/usb/serial/u3g.c stable/11/sys/dev/usb/usbdevs Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/usb/serial/u3g.c ============================================================================== --- stable/11/sys/dev/usb/serial/u3g.c Thu Feb 15 08:52:58 2018 (r329302) +++ stable/11/sys/dev/usb/serial/u3g.c Thu Feb 15 08:56:03 2018 (r329303) @@ -200,6 +200,7 @@ static driver_t u3g_driver = { static const STRUCT_USB_HOST_ID u3g_devs[] = { #define U3G_DEV(v,p,i) { USB_VPI(USB_VENDOR_##v, USB_PRODUCT_##v##_##p, i) } + U3G_DEV(ABIT, AK_020, 0), U3G_DEV(ACERP, H10, 0), U3G_DEV(AIRPLUS, MCD650, 0), U3G_DEV(AIRPRIME, PC5220, 0), Modified: stable/11/sys/dev/usb/usbdevs ============================================================================== --- stable/11/sys/dev/usb/usbdevs Thu Feb 15 08:52:58 2018 (r329302) +++ stable/11/sys/dev/usb/usbdevs Thu Feb 15 08:56:03 2018 (r329303) @@ -666,6 +666,7 @@ vendor SOUNDGRAPH 0x15c2 Soundgraph, Inc. vendor AMIT2 0x15c5 AMIT vendor TEXTECH 0x15ca Textech International Ltd. vendor SOHOWARE 0x15e8 SOHOware +vendor ABIT 0x15eb ABIT Corporation vendor UMAX 0x1606 UMAX Data Systems vendor INSIDEOUT 0x1608 Inside Out Networks vendor AMOI 0x1614 Amoi Electronics @@ -807,6 +808,9 @@ product 3COMUSR OFFICECONN 0x0082 3Com OfficeConnect A product 3COMUSR USRISDN 0x008f 3Com U.S. Robotics Pro ISDN TA product 3COMUSR HOMECONN 0x009d 3Com HomeConnect Camera product 3COMUSR USR56K 0x3021 U.S. Robotics 56000 Voice FaxModem Pro + +/* ABIT products */ +product ABIT AK_020 0x7d0e 3G modem /* AboCom products */ product ABOCOM XX1 0x110c XX1 From owner-svn-src-all@freebsd.org Thu Feb 15 08:57:15 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 95859F0971B; Thu, 15 Feb 2018 08:57:15 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4B1AE6AFC3; Thu, 15 Feb 2018 08:57:15 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 45E961C8FE; Thu, 15 Feb 2018 08:57:15 +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 w1F8vFb0083508; Thu, 15 Feb 2018 08:57:15 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1F8vE9m083506; Thu, 15 Feb 2018 08:57:14 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201802150857.w1F8vE9m083506@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 15 Feb 2018 08:57:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r329304 - in stable/10/sys/dev/usb: . serial X-SVN-Group: stable-10 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in stable/10/sys/dev/usb: . serial X-SVN-Commit-Revision: 329304 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Feb 2018 08:57:15 -0000 Author: hselasky Date: Thu Feb 15 08:57:14 2018 New Revision: 329304 URL: https://svnweb.freebsd.org/changeset/base/329304 Log: MFC r328163: Add new USB ID to U3G driver. PR: 134299 Sponsored by: Mellanox Technologies Modified: stable/10/sys/dev/usb/serial/u3g.c stable/10/sys/dev/usb/usbdevs Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/usb/serial/u3g.c ============================================================================== --- stable/10/sys/dev/usb/serial/u3g.c Thu Feb 15 08:56:03 2018 (r329303) +++ stable/10/sys/dev/usb/serial/u3g.c Thu Feb 15 08:57:14 2018 (r329304) @@ -205,6 +205,7 @@ MODULE_VERSION(u3g, 1); static const STRUCT_USB_HOST_ID u3g_devs[] = { #define U3G_DEV(v,p,i) { USB_VPI(USB_VENDOR_##v, USB_PRODUCT_##v##_##p, i) } + U3G_DEV(ABIT, AK_020, 0), U3G_DEV(ACERP, H10, 0), U3G_DEV(AIRPLUS, MCD650, 0), U3G_DEV(AIRPRIME, PC5220, 0), Modified: stable/10/sys/dev/usb/usbdevs ============================================================================== --- stable/10/sys/dev/usb/usbdevs Thu Feb 15 08:56:03 2018 (r329303) +++ stable/10/sys/dev/usb/usbdevs Thu Feb 15 08:57:14 2018 (r329304) @@ -665,6 +665,7 @@ vendor SOUNDGRAPH 0x15c2 Soundgraph, Inc. vendor AMIT2 0x15c5 AMIT vendor TEXTECH 0x15ca Textech International Ltd. vendor SOHOWARE 0x15e8 SOHOware +vendor ABIT 0x15eb ABIT Corporation vendor UMAX 0x1606 UMAX Data Systems vendor INSIDEOUT 0x1608 Inside Out Networks vendor AMOI 0x1614 Amoi Electronics @@ -805,6 +806,9 @@ product 3COMUSR OFFICECONN 0x0082 3Com OfficeConnect A product 3COMUSR USRISDN 0x008f 3Com U.S. Robotics Pro ISDN TA product 3COMUSR HOMECONN 0x009d 3Com HomeConnect Camera product 3COMUSR USR56K 0x3021 U.S. Robotics 56000 Voice FaxModem Pro + +/* ABIT products */ +product ABIT AK_020 0x7d0e 3G modem /* AboCom products */ product ABOCOM XX1 0x110c XX1 From owner-svn-src-all@freebsd.org Thu Feb 15 09:00:12 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A1786F09C08; Thu, 15 Feb 2018 09:00:12 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 417A76B1CC; Thu, 15 Feb 2018 09:00:12 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3C75B1C904; Thu, 15 Feb 2018 09:00:12 +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 w1F90CAi083731; Thu, 15 Feb 2018 09:00:12 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1F90CqU083730; Thu, 15 Feb 2018 09:00:12 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201802150900.w1F90CqU083730@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 15 Feb 2018 09:00:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r329305 - stable/11/sys/dev/vt X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/11/sys/dev/vt X-SVN-Commit-Revision: 329305 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Feb 2018 09:00:12 -0000 Author: hselasky Date: Thu Feb 15 09:00:11 2018 New Revision: 329305 URL: https://svnweb.freebsd.org/changeset/base/329305 Log: MFC r325724: Implement missing KDGETMODE IOCTL in VT. Obtained from: Johannes Lundberg Sponsored by: Mellanox Technologies Modified: stable/11/sys/dev/vt/vt_core.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/vt/vt_core.c ============================================================================== --- stable/11/sys/dev/vt/vt_core.c Thu Feb 15 08:57:14 2018 (r329304) +++ stable/11/sys/dev/vt/vt_core.c Thu Feb 15 09:00:11 2018 (r329305) @@ -2150,6 +2150,10 @@ skip_thunk: return (error); } + case KDGETMODE: + *(int *)data = (vw->vw_flags & VWF_GRAPHICS) ? + KD_GRAPHICS : KD_TEXT; + return (0); case KDGKBMODE: { error = 0; From owner-svn-src-all@freebsd.org Thu Feb 15 09:04:07 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 569A2F0A1AF; Thu, 15 Feb 2018 09:04:07 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 065526B827; Thu, 15 Feb 2018 09:04:07 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DB1811CAAF; Thu, 15 Feb 2018 09:04:06 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1F946DG088757; Thu, 15 Feb 2018 09:04:06 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1F946Kb088754; Thu, 15 Feb 2018 09:04:06 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201802150904.w1F946Kb088754@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 15 Feb 2018 09:04:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r329306 - in stable/11/sys: dev/mlx5/mlx5_ib ofed/drivers/infiniband/hw/mthca ofed/include/rdma X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in stable/11/sys: dev/mlx5/mlx5_ib ofed/drivers/infiniband/hw/mthca ofed/include/rdma X-SVN-Commit-Revision: 329306 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Feb 2018 09:04:07 -0000 Author: hselasky Date: Thu Feb 15 09:04:06 2018 New Revision: 329306 URL: https://svnweb.freebsd.org/changeset/base/329306 Log: MFC r325807: Make sure the ib_wr_opcode enum is signed by adding a negative dummy element. Different compilers may optimise the enum type in different ways. This ensures coherency when range checking the value of enums in ibcore. Sponsored by: Mellanox Technologies Modified: stable/11/sys/dev/mlx5/mlx5_ib/mlx5_ib_qp.c stable/11/sys/ofed/drivers/infiniband/hw/mthca/mthca_qp.c stable/11/sys/ofed/include/rdma/ib_verbs.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/mlx5/mlx5_ib/mlx5_ib_qp.c ============================================================================== --- stable/11/sys/dev/mlx5/mlx5_ib/mlx5_ib_qp.c Thu Feb 15 09:00:11 2018 (r329305) +++ stable/11/sys/dev/mlx5/mlx5_ib/mlx5_ib_qp.c Thu Feb 15 09:04:06 2018 (r329306) @@ -2497,7 +2497,7 @@ int mlx5_ib_post_send(struct ib_qp *ibqp, struct ib_se } for (nreq = 0; wr; nreq++, wr = wr->next) { - if (unlikely(wr->opcode >= ARRAY_SIZE(mlx5_ib_opcode))) { + if (unlikely(wr->opcode < 0 || wr->opcode >= ARRAY_SIZE(mlx5_ib_opcode))) { mlx5_ib_warn(dev, "Invalid opcode 0x%x\n", wr->opcode); err = -EINVAL; *bad_wr = wr; Modified: stable/11/sys/ofed/drivers/infiniband/hw/mthca/mthca_qp.c ============================================================================== --- stable/11/sys/ofed/drivers/infiniband/hw/mthca/mthca_qp.c Thu Feb 15 09:00:11 2018 (r329305) +++ stable/11/sys/ofed/drivers/infiniband/hw/mthca/mthca_qp.c Thu Feb 15 09:04:06 2018 (r329306) @@ -1765,7 +1765,7 @@ int mthca_tavor_post_send(struct ib_qp *ibqp, struct i qp->wrid[ind] = wr->wr_id; - if (wr->opcode >= ARRAY_SIZE(mthca_opcode)) { + if (wr->opcode < 0 || wr->opcode >= ARRAY_SIZE(mthca_opcode)) { mthca_err(dev, "opcode invalid\n"); err = -EINVAL; *bad_wr = wr; Modified: stable/11/sys/ofed/include/rdma/ib_verbs.h ============================================================================== --- stable/11/sys/ofed/include/rdma/ib_verbs.h Thu Feb 15 09:00:11 2018 (r329305) +++ stable/11/sys/ofed/include/rdma/ib_verbs.h Thu Feb 15 09:04:06 2018 (r329306) @@ -1136,6 +1136,8 @@ enum ib_wr_opcode { IB_WR_RESERVED8, IB_WR_RESERVED9, IB_WR_RESERVED10, + + IB_WR_DUMMY = -1, /* force enum type signed */ }; enum ib_send_flags { From owner-svn-src-all@freebsd.org Thu Feb 15 09:05:29 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DEA26F0A397; Thu, 15 Feb 2018 09:05:29 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 87A756B9CC; Thu, 15 Feb 2018 09:05:29 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7FF031CAB3; Thu, 15 Feb 2018 09:05:29 +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 w1F95TLn088863; Thu, 15 Feb 2018 09:05:29 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1F95TQa088862; Thu, 15 Feb 2018 09:05:29 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201802150905.w1F95TQa088862@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 15 Feb 2018 09:05:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r329307 - stable/11/sys/ofed/drivers/infiniband/core X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/11/sys/ofed/drivers/infiniband/core X-SVN-Commit-Revision: 329307 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Feb 2018 09:05:30 -0000 Author: hselasky Date: Thu Feb 15 09:05:29 2018 New Revision: 329307 URL: https://svnweb.freebsd.org/changeset/base/329307 Log: MFC r325806: Make sure a valid VNET is set before trying to access the V_ip6_v6only variable. Access the variable directly instead of going through the sysctl() interface in the kernel. Sponsored by: Mellanox Technologies Modified: stable/11/sys/ofed/drivers/infiniband/core/cma.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/ofed/drivers/infiniband/core/cma.c ============================================================================== --- stable/11/sys/ofed/drivers/infiniband/core/cma.c Thu Feb 15 09:04:06 2018 (r329306) +++ stable/11/sys/ofed/drivers/infiniband/core/cma.c Thu Feb 15 09:05:29 2018 (r329307) @@ -2734,10 +2734,6 @@ int rdma_bind_addr(struct rdma_cm_id *id, struct socka { struct rdma_id_private *id_priv; int ret; -#if defined(INET6) - int ipv6only; - size_t var_size = sizeof(int); -#endif if (addr->sa_family != AF_INET && addr->sa_family != AF_INET6) return -EAFNOSUPPORT; @@ -2765,9 +2761,11 @@ int rdma_bind_addr(struct rdma_cm_id *id, struct socka if (addr->sa_family == AF_INET) id_priv->afonly = 1; #if defined(INET6) - else if (addr->sa_family == AF_INET6) - id_priv->afonly = kernel_sysctlbyname(&thread0, "net.inet6.ip6.v6only", - &ipv6only, &var_size, NULL, 0, NULL, 0); + else if (addr->sa_family == AF_INET6) { + CURVNET_SET_QUIET(&init_net); + id_priv->afonly = V_ip6_v6only; + CURVNET_RESTORE(); + } #endif } ret = cma_get_port(id_priv); From owner-svn-src-all@freebsd.org Thu Feb 15 09:07:38 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5A839F0A61C; Thu, 15 Feb 2018 09:07:38 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0C0056BCD0; Thu, 15 Feb 2018 09:07:38 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 071841CAB7; Thu, 15 Feb 2018 09:07:38 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1F97bXv089123; Thu, 15 Feb 2018 09:07:37 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1F97bA1089122; Thu, 15 Feb 2018 09:07:37 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201802150907.w1F97bA1089122@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 15 Feb 2018 09:07:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r329308 - stable/11/sys/contrib/rdma/krping X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/11/sys/contrib/rdma/krping X-SVN-Commit-Revision: 329308 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Feb 2018 09:07:38 -0000 Author: hselasky Date: Thu Feb 15 09:07:37 2018 New Revision: 329308 URL: https://svnweb.freebsd.org/changeset/base/329308 Log: MFC r325805: Set the default VNET in krping before calling ifunit_ref(). Else using IPv6 link-local addresses when VIMAGE is enabled will cause a so-called NULL pointer dereferencing issue. Sponsored by: Mellanox Technologies Modified: stable/11/sys/contrib/rdma/krping/krping.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/contrib/rdma/krping/krping.c ============================================================================== --- stable/11/sys/contrib/rdma/krping/krping.c Thu Feb 15 09:05:29 2018 (r329307) +++ stable/11/sys/contrib/rdma/krping/krping.c Thu Feb 15 09:07:37 2018 (r329308) @@ -3185,7 +3185,9 @@ krping_get_ipv6_scope_id(char *name) if (name == NULL) return (0); + CURVNET_SET_QUIET(TD_TO_VNET(curthread)); ifp = ifunit_ref(name); + CURVNET_RESTORE(); if (ifp == NULL) return (0); retval = ifp->if_index; From owner-svn-src-all@freebsd.org Thu Feb 15 09:09:43 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 51355F0A8DD; Thu, 15 Feb 2018 09:09:43 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 05C876BEE2; Thu, 15 Feb 2018 09:09:43 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 00B7A1CAB9; Thu, 15 Feb 2018 09:09:43 +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 w1F99g9I089248; Thu, 15 Feb 2018 09:09:42 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1F99gi2089247; Thu, 15 Feb 2018 09:09:42 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201802150909.w1F99gi2089247@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 15 Feb 2018 09:09:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r329309 - stable/11/sys/ofed/drivers/infiniband/ulp/ipoib X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/11/sys/ofed/drivers/infiniband/ulp/ipoib X-SVN-Commit-Revision: 329309 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Feb 2018 09:09:43 -0000 Author: hselasky Date: Thu Feb 15 09:09:42 2018 New Revision: 329309 URL: https://svnweb.freebsd.org/changeset/base/329309 Log: MFC r325637: Mark ipoib device as initialized on device open. Set the IPOIB_FLAG_INITIALIZED on dev_open and clear it on dev_stop to avoid a race between ipoib load and the underlying device driver. The device module must dispatch the IB_EVENT_PORT_ACTIVE event before ipoib module is loaded. Otherwise, the flush will fail since no one set the IPOIB_FLAG_INITIALIZED. Submitted by: Slava Shwartsman Sponsored by: Mellanox Technologies Modified: stable/11/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_ib.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_ib.c ============================================================================== --- stable/11/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_ib.c Thu Feb 15 09:07:37 2018 (r329308) +++ stable/11/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_ib.c Thu Feb 15 09:09:42 2018 (r329309) @@ -638,6 +638,8 @@ int ipoib_ib_dev_open(struct ipoib_dev_priv *priv) clear_bit(IPOIB_STOP_REAPER, &priv->flags); queue_delayed_work(ipoib_workqueue, &priv->ah_reap_task, HZ); + set_bit(IPOIB_FLAG_INITIALIZED, &priv->flags); + return 0; } @@ -744,6 +746,8 @@ int ipoib_ib_dev_stop(struct ipoib_dev_priv *priv, int unsigned long begin; struct ipoib_tx_buf *tx_req; int i; + + clear_bit(IPOIB_FLAG_INITIALIZED, &priv->flags); ipoib_cm_dev_stop(priv); From owner-svn-src-all@freebsd.org Thu Feb 15 09:12:09 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E54FCF0ACB3; Thu, 15 Feb 2018 09:12:08 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 97EE66C3A5; Thu, 15 Feb 2018 09:12:08 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 92F961CC2A; Thu, 15 Feb 2018 09:12:08 +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 w1F9C8a3091824; Thu, 15 Feb 2018 09:12:08 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1F9C8g7091820; Thu, 15 Feb 2018 09:12:08 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201802150912.w1F9C8g7091820@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 15 Feb 2018 09:12:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r329310 - stable/11/sys/ofed/drivers/infiniband/core X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/11/sys/ofed/drivers/infiniband/core X-SVN-Commit-Revision: 329310 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Feb 2018 09:12:09 -0000 Author: hselasky Date: Thu Feb 15 09:12:07 2018 New Revision: 329310 URL: https://svnweb.freebsd.org/changeset/base/329310 Log: MFC r323350: Remove unsafe access to the LinuxKPI file structure from ibcore. selwakeup() is now done by the wake_up() family of functions. Sponsored by: Mellanox Technologies Modified: stable/11/sys/ofed/drivers/infiniband/core/ucm.c stable/11/sys/ofed/drivers/infiniband/core/ucma.c stable/11/sys/ofed/drivers/infiniband/core/user_mad.c stable/11/sys/ofed/drivers/infiniband/core/uverbs_main.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/ofed/drivers/infiniband/core/ucm.c ============================================================================== --- stable/11/sys/ofed/drivers/infiniband/core/ucm.c Thu Feb 15 09:09:42 2018 (r329309) +++ stable/11/sys/ofed/drivers/infiniband/core/ucm.c Thu Feb 15 09:12:07 2018 (r329310) @@ -378,8 +378,6 @@ static int ib_ucm_event_handler(struct ib_cm_id *cm_id list_add_tail(&uevent->file_list, &ctx->file->events); list_add_tail(&uevent->ctx_list, &ctx->events); wake_up_interruptible(&ctx->file->poll_wait); - if (ctx->file->filp) - selwakeup(&ctx->file->filp->f_selinfo); mutex_unlock(&ctx->file->file_mutex); return 0; Modified: stable/11/sys/ofed/drivers/infiniband/core/ucma.c ============================================================================== --- stable/11/sys/ofed/drivers/infiniband/core/ucma.c Thu Feb 15 09:09:42 2018 (r329309) +++ stable/11/sys/ofed/drivers/infiniband/core/ucma.c Thu Feb 15 09:12:07 2018 (r329310) @@ -287,8 +287,6 @@ static int ucma_event_handler(struct rdma_cm_id *cm_id list_add_tail(&uevent->list, &ctx->file->event_list); wake_up_interruptible(&ctx->file->poll_wait); - if (ctx->file->filp) - selwakeup(&ctx->file->filp->f_selinfo); out: mutex_unlock(&ctx->file->mut); return ret; Modified: stable/11/sys/ofed/drivers/infiniband/core/user_mad.c ============================================================================== --- stable/11/sys/ofed/drivers/infiniband/core/user_mad.c Thu Feb 15 09:09:42 2018 (r329309) +++ stable/11/sys/ofed/drivers/infiniband/core/user_mad.c Thu Feb 15 09:12:07 2018 (r329310) @@ -236,7 +236,6 @@ static int queue_packet(struct ib_umad_file *file, packet->mad.hdr.id++) if (agent == __get_agent(file, packet->mad.hdr.id)) { list_add_tail(&packet->list, &file->recv_list); - selwakeup(&file->filp->f_selinfo); wake_up_interruptible(&file->recv_wait); ret = 0; break; Modified: stable/11/sys/ofed/drivers/infiniband/core/uverbs_main.c ============================================================================== --- stable/11/sys/ofed/drivers/infiniband/core/uverbs_main.c Thu Feb 15 09:09:42 2018 (r329309) +++ stable/11/sys/ofed/drivers/infiniband/core/uverbs_main.c Thu Feb 15 09:12:07 2018 (r329310) @@ -519,8 +519,6 @@ void ib_uverbs_comp_handler(struct ib_cq *cq, void *cq spin_unlock_irqrestore(&file->lock, flags); wake_up_interruptible(&file->poll_wait); - if (file->filp) - selwakeup(&file->filp->f_selinfo); kill_fasync(&file->async_queue, SIGIO, POLL_IN); } @@ -554,8 +552,6 @@ static void ib_uverbs_async_handler(struct ib_uverbs_f spin_unlock_irqrestore(&file->async_file->lock, flags); wake_up_interruptible(&file->async_file->poll_wait); - if (file->async_file->filp) - selwakeup(&file->async_file->filp->f_selinfo); kill_fasync(&file->async_file->async_queue, SIGIO, POLL_IN); } From owner-svn-src-all@freebsd.org Thu Feb 15 11:13:22 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 69F41F13971; Thu, 15 Feb 2018 11:13:22 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 11E1271848; Thu, 15 Feb 2018 11:13:22 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0AE331E015; Thu, 15 Feb 2018 11:13:22 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1FBDLOL053925; Thu, 15 Feb 2018 11:13:21 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1FBDLrd053924; Thu, 15 Feb 2018 11:13:21 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201802151113.w1FBDLrd053924@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Thu, 15 Feb 2018 11:13:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329311 - head/share/misc X-SVN-Group: head X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: head/share/misc X-SVN-Commit-Revision: 329311 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Feb 2018 11:13:22 -0000 Author: eadler Date: Thu Feb 15 11:13:21 2018 New Revision: 329311 URL: https://svnweb.freebsd.org/changeset/base/329311 Log: share: update pci_vendors to 2018.02.15 MFC After: 1 week Modified: head/share/misc/pci_vendors Modified: head/share/misc/pci_vendors ============================================================================== --- head/share/misc/pci_vendors Thu Feb 15 09:12:07 2018 (r329310) +++ head/share/misc/pci_vendors Thu Feb 15 11:13:21 2018 (r329311) @@ -1,10 +1,9 @@ # $FreeBSD$ -# # List of PCI ID's # -# Version: 2018.01.14 -# Date: 2018-01-14 03:15:02 +# Version: 2018.02.15 +# Date: 2018-02-15 03:15:01 # # Maintained by Albert Pool, Martin Mares, and other volunteers from # the PCI ID Project at http://pci-ids.ucw.cz/. @@ -252,6 +251,7 @@ 1028 1fd4 PERC H745P MX 1d49 0602 ThinkSystem RAID 930-16i 4GB Flash PCIe 12Gb Adapter 1d49 0604 ThinkSystem RAID 930-8e 4GB Flash PCIe 12Gb Adapter + 1d49 0607 ThinkSystem RAID 930-16i 8GB Flash PCIe 12Gb Adapter 8086 352d Integrated RAID Module RMSP3AD160F 8086 9460 RAID Controller RSP3TD160F 8086 9480 RAID Controller RSP3MD088F @@ -786,7 +786,7 @@ 18bc 0101 GC-R9600PRO (Primary) 4151 RV350 [Radeon 9600 Series] 1043 c004 A9600SE - 174b 7c37 Radeon 9600 SE + 174b 7c37 Radeon 9600SE 128M DDR V/D/VO 4152 RV360 [Radeon 9600/X1050 Series] 1002 0002 Radeon 9600XT 1002 4772 All-in-Wonder 9600 XT @@ -816,7 +816,7 @@ 18bc 0100 GC-R9600PRO (Secondary) 4171 RV350 [Radeon 9600] (Secondary) 1043 c005 A9600SE (Secondary) - 174b 7c36 Radeon 9600 SE (secondary) + 174b 7c36 Radeon 9600SE 128M DDR V/D/VO (secondary) 4172 RV350 [Radeon 9600/X1050 Series] (Secondary) 1002 0003 Radeon 9600XT (Secondary) 1002 4773 All-in-Wonder 9600 XT (Secondary) @@ -923,6 +923,7 @@ 1043 836c M4A785TD Motherboard 1043 8410 M4A89GTD PRO/USB3 Motherboard 1043 841b M5A88-V EVO + 1043 8445 M5A78L LE 105b 0e13 N15235/A74MX mainboard / AMD SB700 1179 ff50 Satellite P305D-S8995E 1458 a022 GA-MA770-DS3rev2.0 Motherboard @@ -1609,6 +1610,7 @@ 1028 0684 FirePro W4170M 6607 Mars LE [Radeon HD 8530M / R5 M240] 6608 Oland GL [FirePro W2100] + 13cc 3d28 MXRT-2600 6610 Oland XT [Radeon HD 8670 / R7 250/350] 1019 0030 Radeon HD 8670 1028 2120 Radeon R7 250 @@ -1641,6 +1643,7 @@ 1002 0b0c FirePro W4300 103c 0b0c Bonaire [FirePro W4300] 103c 230c FirePro W5100 + 13cc 3d2a MXRT-5600 6650 Bonaire 6651 Bonaire 6658 Bonaire XTX [Radeon R7 260X/360] @@ -1879,7 +1882,10 @@ 8086 2111 Radeon HD 6625M 6743 Whistler [Radeon E6760] 6749 Turks GL [FirePro V4900] + 15c3 2b06 MED-X4900 674a Turks GL [FirePro V3900] + 13cc 3d22 MXRT-2500 + 15c3 0106 MED-X3900 6750 Onega [Radeon HD 6650A/7650A] 1462 2670 Radeon HD 6670A 17aa 3079 Radeon HD 7650A @@ -2192,11 +2198,13 @@ 1043 3001 Tahiti XTL [ROG Matrix R9 280X] 1043 3006 Tahiti XTL [Radeon R9 280X DirectCU II TOP] 1043 9999 ARES II + 106b 0127 FirePro D700 + 106b 0128 FirePro D700 1092 3000 Tahiti XT2 [Radeon HD 7970 GHz Edition] 1458 2261 Tahiti XT2 [Radeon HD 7970 GHz Edition OC] # GV-R928XOC-3GD 1458 3001 Tahiti XTL [Radeon R9 280X OC] - 1462 2774 MSI R7970 TF 3GD5/OC BE + 1462 2774 HD 7970 TwinFrozr III Boost Edition OC 1682 3001 Tahiti XTL [Radeon R9 280X] 1682 3211 Double D HD 7970 Black Edition # FX-797A-TNBC @@ -2217,6 +2225,8 @@ 1462 8036 Radeon HD 8990 OEM 148c 8990 Radeon HD 8990 OEM 679e Tahiti LE [Radeon HD 7870 XT] + 106b 0125 FirePro D500 + 106b 0126 FirePro D500 1787 2328 Radeon HD 7870 Black Edition 2 GB GDDR5 [2GBD5-2DHV3E] 679f Tahiti 67a0 Hawaii XT GL [FirePro W9100] @@ -2271,7 +2281,7 @@ 174b e324 Sapphire Nitro R9 390 67b9 Vesuvius [Radeon R9 295X2] 67be Hawaii LE - 67c0 Ellesmere [Radeon Pro WX 7100] + 67c0 Ellesmere [Radeon Pro WX 7100 Mobile] 67c2 Ellesmere [Radeon Pro V7300X / V7350x2] 67c4 Ellesmere [Radeon Pro WX 7100] 1002 0336 Radeon Pro Duo @@ -2301,10 +2311,20 @@ 1787 a480 Radeon RX 480 1da2 e353 Sapphire Radeon RX 580 Pulse 8GB 1da2 e366 Nitro+ Radeon RX 580 4GB - 67e0 Baffin [Polaris11] + 67e0 Baffin [Radeon Pro WX 4170] + 103c 8270 Radeon Pro WX 4170 + 103c 8272 Radeon Pro WX 4170 67e1 Baffin [Polaris11] 67e3 Baffin [Radeon Pro WX 4100] - 67e8 Baffin [Polaris11] + 67e8 Baffin [Radeon Pro WX 4130/4150] + 1028 075d Radeon Pro WX 4150 + 1028 07b0 Radeon Pro WX 4130/4150 + 1028 07b1 Radeon Pro WX 4130 + 1028 175d Radeon Pro WX 4150 + 1028 17b0 Radeon Pro WX 4130/4150 + 1028 17b1 Radeon Pro WX 4130 + 103c 8275 Radeon Pro WX 4150 + 103c 8277 Radeon Pro WX 4150 67e9 Baffin [Polaris11] 67eb Baffin [Radeon Pro V5300X] 67ef Baffin [Radeon RX 460/560D / Pro 450/455/460/560] @@ -2329,8 +2349,14 @@ 6808 Pitcairn XT GL [FirePro W7000] 1002 0310 FirePro S7000 1002 0420 Radeon Sky 500 + 13cc 3d25 MXRT-7500 6809 Pitcairn LE GL [FirePro W5000] + 13cc 3d23 MXRT-5500 + 13cc 3d24 MXRT-5550 + 15c3 0b06 MED-X5000 6810 Curacao XT / Trinidad XT [Radeon R7 370 / R9 270X/370X] + 106b 012a FirePro D300 + 106b 012b FirePro D300 148c 0908 Radeon R9 370 OEM 1682 7370 Radeon R7 370 6811 Curacao PRO [Radeon R7 370 / R9 270/370 OEM] @@ -2376,6 +2402,7 @@ 6826 Chelsea LP [Radeon HD 7700M Series] 6827 Heathrow PRO [Radeon HD 7850M/8850M] 6828 Cape Verde PRO [FirePro W600] + 15c3 2b1e MED-X6000 6829 Cape Verde 682a Venus PRO 682b Venus LE / Tropo PRO-L [Radeon HD 8830M / R7 M465X] @@ -2514,17 +2541,19 @@ 6842 Thames LE [Radeon HD 7000M Series] 6843 Thames [Radeon HD 7670M] 6860 Vega 10 [Radeon Instinct MI25] + 106b 017c Radeon Pro Vega 64 6861 Vega 10 XT [Radeon PRO WX 9100] 6862 Vega 10 XT [Radeon PRO SSG] 6863 Vega 10 XTX [Radeon Vega Frontier Edition] 6864 Vega - 6867 Vega + 6867 Vega 10 XL [Radeon Pro Vega 56] 6868 Vega 686c Vega 10 [Radeon Instinct MI25 MxGPU] 687f Vega 10 XT [Radeon RX Vega 64] 6888 Cypress XT [FirePro V8800] 6889 Cypress PRO [FirePro V7800] 1002 0301 FirePro V7800P + 13cc 3d1f MXRT-7400 688a Cypress XT [FirePro V9800] 1002 030c FirePro V9800P 688c Cypress XT GL [FireStream 9370] @@ -2572,6 +2601,8 @@ 103c 159b Radeon HD 6850M 144d c0ad Radeon HD 6850M 68a9 Juniper XT [FirePro V5800] + 13cc 3d1e MXRT-5400 + 13cc 3d20 MXRT-5450 68b8 Juniper XT [Radeon HD 5770] 106b 00cf MacPro5,1 [Mac Pro 2.8GHz DDR3] 68b9 Juniper LE [Radeon HD 5670 640SP Edition] @@ -2733,6 +2764,7 @@ 1462 2246 Radeon HD 6550A 68c8 Redwood XT GL [FirePro V4800] 68c9 Redwood PRO GL [FirePro V3800] + 13cc 3d1d MXRT-2400 68d8 Redwood XT [Radeon HD 5670/5690/5730] 1028 68e0 Radeon HD 5670 174b 5690 Radeon HD 5690 @@ -3015,6 +3047,7 @@ 6921 Amethyst XT [Radeon R9 M295X] 6929 Tonga XT GL [FirePro S7150] 692b Tonga PRO GL [FirePro W7100] + 13cc 3d2b MXRT-7600 692f Tonga XTV GL [FirePro S7150V] 6938 Tonga XT / Amethyst XT [Radeon R9 380X / R9 M295X] 1043 04f5 Radeon R9 380X @@ -3045,17 +3078,27 @@ 7101 R520/M58 [Mobility Radeon X1800 XT] 7102 R520/M58 [Mobility Radeon X1800] 7104 R520 GL [FireGL V7200] + 13cc 3d0a MXRT-5100 7109 R520 [Radeon X1800 XL] 1002 0322 All-in-Wonder X1800XL 1002 0d02 Radeon X1800 CrossFire Edition 710a R520 [Radeon X1800 GTO] 1002 0b12 Radeon X1800 GTO² 710b R520 [Radeon X1800 GTO] + 710e R520 GL [FireGL V7300] + 13cc 3d0c MXRT-5150 + 710f R520 GL [FireGL V7350] + 13cc 3d0e MXRT-7100 7120 R520 [Radeon X1800] (Secondary) 7124 R520 GL [FireGL V7200] (Secondary) + 13cc 3d0b MXRT-5100 (Secondary) 7129 R520 [Radeon X1800] (Secondary) 1002 0323 All-In-Wonder X1800 XL (Secondary) 1002 0d03 Radeon X1800 CrossFire Edition (Secondary) + 712e R520 GL [FireGL V7300] (Secondary) + 13cc 3d0d MXRT-5150 (Secondary) + 712f R520 GL [FireGL V7350] (Secondary) + 13cc 3d0f MXRT-7100 (Secondary) 7140 RV515 [Radeon X1300/X1550/X1600 Series] 7142 RV515 PRO [Radeon X1300/X1550 Series] 1002 0322 All-in-Wonder 2006 PCI-E Edition @@ -3095,12 +3138,16 @@ 7193 RV516 [Radeon X1550 Series] 7196 RV516/M62-S [Mobility Radeon X1350] 719b RV516 GL [FireMV 2250] + 13cc 3d12 MXRT-1150 + 13cc 3d14 MXRT-2150 719f RV516 [Radeon X1550 Series] 71a0 RV516 [Radeon X1300/X1550 Series] (Secondary) 71a1 RV516 [Radeon X1600/X1650 Series] (Secondary) 71a3 RV516 [Radeon X1300/X1550 Series] (Secondary) 71a7 RV516 [Radeon X1300/X1550 Series] (Secondary) 71bb RV516 GL [FireMV 2250] (Secondary) + 13cc 3d13 MXRT-1150 (Secondary) + 13cc 3d15 MXRT-2150 (Secondary) 71c0 RV530 [Radeon X1600 XT/X1650 GTO] 1002 e160 Radeon X1650 GTO 174b e160 Radeon X1650 GTO @@ -3119,6 +3166,7 @@ 1787 3000 PowerColor X1650 PRO AGP 71ce RV530 [Radeon X1300 XT/X1600 PRO] 71d2 RV530 GL [FireGL V3400] + 13cc 3d08 MXRT-2100 71d4 RV530/M66 GL [Mobility FireGL V5250] 71d5 RV530/M66-P [Mobility Radeon X1700] 71d6 RV530/M66-XT [Mobility Radeon X1700] @@ -3132,6 +3180,7 @@ 71e7 RV535 [Radeon X1650 PRO] (Secondary) 1787 3001 Radeon X1650 PRO AGP 71f2 RV530 GL [FireGL V3400] (Secondary) + 13cc 3d09 MXRT-2100 (Secondary) 7210 RV550/M71 [Mobility Radeon HD 2300] 7211 RV550/M71 [Mobility Radeon X2300 HD] 7240 R580+ [Radeon X1950 XTX] @@ -3208,6 +3257,7 @@ 9403 R600 [Radeon HD 2900 PRO] 9405 R600 [Radeon HD 2900 GT] 940a R600 GL [FireGL V8650] + 13cc 3d16 MXRT-7200 940b R600 GL [FireGL V8600] 940f R600 GL [FireGL V7600] 9440 RV770 [Radeon HD 4870] @@ -3245,6 +3295,7 @@ 174b 0028 Radeon HD 4650 AGP DDR2 9498 RV730 PRO [Radeon HD 4650] 949c RV730 GL [FirePro V7750] + 13cc 3d1b MXRT-7300 949e RV730 GL [FirePro V5700] 949f RV730 GL [FirePro V3750] 94a0 RV740/M97 [Mobility Radeon HD 4830] @@ -3331,6 +3382,7 @@ 958a RV630 [Radeon HD 2600 X2] 958b RV630/M76 [Mobility Radeon HD 2600 XT] 958c RV630 GL [FireGL V5600] + 13cc 3d18 MXRT-5200 958d RV630 GL [FireGL V3600] 9591 RV635/M86 [Mobility Radeon HD 3650] 1002 9591 Mobility Radeon HD 3650 @@ -3345,6 +3397,7 @@ 1043 3001 Radeon HD 4570 174b 3001 Radeon HD 3750 174b 4580 RV635 PRO [Radeon HD 4580] + 17af 3011 RV635 PRO [Radeon HD 4580] 9599 RV635 PRO [Radeon HD 3650 AGP] 95c0 RV620 PRO [Radeon HD 3470] 1002 95c0 Mobility Radeon HD 3470 @@ -3444,8 +3497,8 @@ 103c 194e ProBook 455 G1 Notebook 103c 1952 ProBook 455 G1 Notebook 9904 Trinity [Radeon HD 7560D] - 9905 Trinity [FirePro A300 Series Graphics] - 9906 Trinity [FirePro A300 Series Graphics] + 9905 Trinity GL [FirePro A300] + 9906 Trinity GL [FirePro A320] 9907 Trinity [Radeon HD 7620G] 9908 Trinity [Radeon HD 7600G] 9909 Trinity [Radeon HD 7500G] @@ -4081,7 +4134,7 @@ 1463 Family 17h (Models 00h-0fh) Data Fabric: Device 18h; Function 3 1464 Family 17h (Models 00h-0fh) Data Fabric: Device 18h; Function 4 1465 Family 17h (Models 00h-0fh) Data Fabric: Device 18h; Function 5 - 1466 Family 17h (Models 00h-0fh) Data Fabric Device 18h Function 6 + 1466 Family 17h (Models 00h-0fh) Data Fabric: Device 18h; Function 6 1467 Family 17h (Models 00h-0fh) Data Fabric: Device 18h; Function 7 1510 Family 14h Processor Root Complex 174b 1001 PURE Fusion Mini @@ -4098,6 +4151,17 @@ 1535 Family 16h Processor Function 5 1536 Family 16h Processor Root Complex 1538 Family 16h Processor Function 0 + 1570 Family 15h (Models 60h-6fh) Processor Function 0 + 1571 Family 15h (Models 60h-6fh) Processor Function 1 + 1572 Family 15h (Models 60h-6fh) Processor Function 2 + 1573 Family 15h (Models 60h-6fh) Processor Function 3 + 1574 Family 15h (Models 60h-6fh) Processor Function 4 + 1575 Family 15h (Models 60h-6fh) Processor Function 5 + 1576 Family 15h (Models 60h-6fh) Processor Root Complex + 1577 Family 15h (Models 60h-6fh) I/O Memory Management Unit + 157a Family 15h (Models 60h-6fh) Audio Controller + 157b Family 15h (Models 60h-6fh) Host Bridge + 157c Family 15h (Models 60h-6fh) Processor Root Port 1600 Family 15h Processor Function 0 1601 Family 15h Processor Function 1 1602 Family 15h Processor Function 2 @@ -4167,8 +4231,11 @@ 43a1 Hudson PCI to PCI bridge (PCIE port 1) 43a2 Hudson PCI to PCI bridge (PCIE port 2) 43a3 Hudson PCI to PCI bridge (PCIE port 3) + 43b1 X399 Series Chipset PCIe Bridge 43b4 300 Series Chipset PCIe Port + 43b6 X399 Series Chipset SATA Controller 43b7 300 Series Chipset SATA Controller + 43ba X399 Series Chipset USB 3.1 xHCI Controller 43bb 300 Series Chipset USB 3.1 xHCI Controller 7006 AMD-751 [Irongate] System Controller 7007 AMD-751 [Irongate] AGP Bridge @@ -4625,7 +4692,7 @@ 103c 3381 iLO4 0534 G200eR2 0536 Integrated Matrox G200eW3 Graphics Controller - 0538 G200eH + 0538 MGA G200eH3 1590 00e4 iLO5 VGA 0540 M91XX 102b 2080 M9140 LP PCIe x16 @@ -5311,7 +5378,7 @@ c824 82C824 c825 82C825 [Firebridge 2] c832 82C832 - c861 82C861 + c861 82C861 OHCI USB Host c881 82C881 [FireLink] 1394 OHCI Link Controller c895 82C895 c935 EV1935 ECTIVA MachOne PCIAudio @@ -9295,6 +9362,7 @@ 0424 G86 [GeForce 8400 GS] 0425 G86M [GeForce 8600M GS] 1025 0121 Aspire 5920G + 1043 1514 F3SV 0426 G86M [GeForce 8400M GT] 0427 G86M [GeForce 8400M GS] 103c 30cc Pavilion dv6700 @@ -9466,6 +9534,7 @@ 1682 2385 GeForce 9600 GSO 768mb 0611 G92 [GeForce 8800 GT] 107d 2ab0 Winfast PX8800 GT PCI-E + 1462 1170 NX8800GT series model V117 2xDVI+TV 19da 1040 ZT-88TES2P-FSP 0612 G92 [GeForce 9800 GTX / 9800 GTX+] 0613 G92 [GeForce 9800 GTX+] @@ -10250,8 +10319,10 @@ 102a GK110BGL [Tesla K40t] 102d GK210GL [Tesla K80] 102e GK110BGL [Tesla K40d] + 102f GK110BGL [Tesla Stella Solo] 103a GK110GL [Quadro K6000] 103c GK110GL [Quadro K5200] + 103f GK110BGL [Tesla Stella SXM] 1040 GF119 [GeForce GT 520] 1043 83a0 ENGT520 SILENT 1042 GF119 [GeForce 510] @@ -10705,6 +10776,7 @@ 11a3 GK104M [GeForce GTX 680MX] 106b 010d iMac 13,2 11a7 GK104M [GeForce GTX 675MX] + 11af GK104GLM [GRID IceCube] # GRID K2 Quadro USM 11b0 GK104GL [GRID K240Q\K260Q vGPU] 10de 101a GRID K240Q @@ -10884,6 +10956,7 @@ 13bd GM107GL [Tesla M10] 10de 110a GRID M40 10de 1160 Tesla M10 + 10de 11d2 GRID M10-8Q 13c0 GM204 [GeForce GTX 980] 1043 8504 GTX980-4GD5 13c1 GM204 @@ -10897,6 +10970,10 @@ 13f0 GM204GL [Quadro M5000] 13f1 GM204GL [Quadro M4000] 13f2 GM204GL [Tesla M60] + 10de 114d GRID M60-1Q + 10de 114e GRID M60-2Q + 10de 1150 GRID M60-8Q + 10de 11b0 GRID M60-4A 13f3 GM204GL [Tesla M6] 10de 1184 GRID M6-8Q 13f8 GM204GLM [Quadro M5000M / M5000 SE] @@ -10927,6 +11004,7 @@ 172f GP100 174d GM108M [GeForce MX130] 174e GM108M [GeForce MX110] + 1789 GM107GL [GRID M3-3020] 17c2 GM200 [GeForce GTX TITAN X] 17c8 GM200 [GeForce GTX 980 Ti] 17f0 GM200GL [Quadro M6000] @@ -10998,12 +11076,13 @@ 1cb1 GP107GL [Quadro P1000] 1cb2 GP107GL [Quadro P600] 1cb3 GP107GL [Quadro P400] + 1cb6 GP107GL [Quadro P620] 1d01 GP108 [GeForce GT 1030] 1d10 GP108M [GeForce MX150] 1d33 GP108GL [Quadro P500] 1d81 GV100 [TITAN V] - 1db1 GV100 [Tesla V100 SXM2] - 1db4 GV100 [Tesla V100 PCIe] + 1db1 GV100GL [Tesla V100 SXM2] + 1db4 GV100GL [Tesla V100 PCIe] 10df Emulex Corporation 0720 OneConnect NIC (Skyhawk) 103c 1934 FlexFabric 20Gb 2-port 650M Adapter @@ -11282,7 +11361,7 @@ 1043 16d5 U6V/U31J laptop 1043 81aa P5B 1043 82c6 M3A78 Series Motherboard - 1043 83a3 M4A785TD Motherboard + 1043 83a3 M4A785/P7P55 Motherboard 1043 8432 P8P67 and other motherboards 1043 8505 P8 series motherboard 105b 0d7c D270S/D250S Motherboard @@ -11290,6 +11369,7 @@ 144d c652 RTL8168 on a NP300E5C series laptop 1458 e000 Onboard Ethernet 1462 238c Onboard RTL8111b on MSI P965 Platinum Mainboard + 1462 345c RTL8111B on MS-7345 Motherboard 1462 368c K9AG Neo2 1462 4180 Wind PC MS-7418 1462 7522 X58 Pro-E @@ -13306,9 +13386,47 @@ 117c 802f ExpressPCI UL5D Low Profile 0033 SAS Adapter 0041 ExpressSAS R30F + 0042 ExpressSAS 6Gb/s SAS/SATA HBA + 117c 0042 ExpressSAS H680 + 117c 0043 ExpressSAS H608 + 117c 0044 ExpressSAS H60F + 117c 0045 ExpressSAS H6F0 + 117c 0046 ExpressSAS H644 + 117c 004f ExpressSAS M608 + 117c 0057 ExpressSAS M680 + 117c 0058 ExpressSAS M644 + 117c 0059 ExpressSAS W608 + 117c 005a ExpressSAS W680 + 117c 005b ExpressSAS W644 + 0049 ExpressSAS 6Gb SAS/SATA RAID Adapter + 117c 0049 ExpressSAS R680 + 117c 004a ExpressSAS R608 + 117c 004b ExpressSAS R60F + 117c 004c ExpressSAS R6F0 + 117c 004d ExpressSAS R644 + 117c 004e ExpressSAS R648 + 0064 Celerity FC 16Gb/s Gen 5 Fibre Channel HBA + 117c 0063 Celerity FC-161E + 117c 0064 Celerity FC-162E + 117c 0065 Celerity FC-164E + 0094 Celerity FC 16/32Gb/s Gen 6 Fibre Channel HBA + 117c 0094 Celerity FC-162P + 117c 00a0 Celerity FC-161P + 117c 00a1 Celerity FC-164P + 117c 00a2 Celerity FC-321E + 117c 00a3 Celerity FC-322E + 117c 00ac Celerity FC-324E 8013 ExpressPCI UL4D 8014 ExpressPCI UL4S 8027 ExpressPCI UL5D + 8070 ExpressSAS 12Gb/s SAS/SATA HBA + 117c 0070 ExpressSAS H1280 + 117c 0071 ExpressSAS H1208 + 117c 0080 ExpressSAS H1244 + 8072 ExpressSAS 12Gb/s SAS/SATA HBA + 117c 0072 ExpressSAS H12F0 + 117c 0073 ExpressSAS H120F + 117c 0082 ExpressSAS H1288 117d Becton & Dickinson 117e T/R Systems 117f Integrated Circuit Systems @@ -13363,6 +13481,7 @@ 1025 0121 Aspire 5920G 1028 01d7 XPS M1210 1028 01f3 Inspiron 1420 + 1028 022f Inspiron 1525 103c 30b5 Presario V3242AU 103c 30b7 Presario V6133CL 103c 30cc Pavilion dv6700 @@ -13380,6 +13499,7 @@ 1028 01a2 Inspiron 9200 1028 01d7 XPS M1210 1028 01f3 Inspiron 1420 + 1028 022f Inspiron 1525 103c 03b5 Presario V3242AU 103c 30b7 Presario V6133CL 103c 30c1 Compaq 6910p @@ -13396,6 +13516,7 @@ 1025 0121 Aspire 5920G 1028 01d7 XPS M1210 1028 01f3 Inspiron 1420 + 1028 022f Inspiron 1525 1028 024d Latitude E4300 103c 30b5 Presario V3242AU 103c 30b7 Presario V6133CL @@ -13418,6 +13539,7 @@ 0852 xD-Picture Card Controller 1025 0121 Aspire 5920G 1028 01f3 Inspiron 1420 + 1028 022f Inspiron 1525 103c 30b5 Presario V3242AU 103c 30b7 Presario V6133CL 103c 30cc Pavilion dv6700 @@ -13669,6 +13791,7 @@ 4353 88E8039 PCI-E Fast Ethernet Controller 104d 902d VAIO VGN-NR120E 4354 88E8040 PCI-E Fast Ethernet Controller + 1028 022f Inspiron 1525 144d c06a R730 Laptop 144d c072 Notebook N150P 4355 88E8040T PCI-E Fast Ethernet Controller @@ -13764,8 +13887,9 @@ 6081 MV88SX6081 8-port SATA II PCI-X Controller 6101 88SE6101/6102 single-port PATA133 interface 1043 82e0 P5K PRO Motherboard - 6111 88SE6111 1-port PATA133(IDE) and 1-port SATA II Controllers - 6121 88SE6121 SATA II / PATA Controller + 6121 88SE6111/6121 SATA II / PATA Controller +# 6111: 1 SATA port; 6121: 2 SATA ports + 11ab 6121 88SE6111/6121 1/2 port SATA II + 1 port PATA Controller 6141 88SE614x SATA II PCI-E controller 6145 88SE6145 SATA II PCI-E controller 6180 88F6180 [Kirkwood] ARM SoC @@ -14091,6 +14215,7 @@ 8000 PM8000 [SPC - SAS Protocol Controller] 8009 PM8009 SPCve 8x6G 8032 ATTO Celerity FC8xEN + 117c 003a Celerity FC-81EN Fibre Channel Adapter 117c 003b Celerity FC-82EN Fibre Channel Adapter 117c 003c Celerity FC-84EN Fibre Channel Adapter 8053 PM8053 SXP 12G 24-port SAS/SATA expander @@ -14111,39 +14236,39 @@ 11fc Silicon Magic 11fd High Street Consultants 11fe Comtrol Corporation - 0001 RocketPort 32 port w/external I/F - 0002 RocketPort 8 port w/external I/F - 0003 RocketPort 16 port w/external I/F - 0004 RocketPort 4 port w/quad cable - 0005 RocketPort 8 port w/octa cable - 0006 RocketPort 8 port w/RJ11 connectors - 0007 RocketPort 4 port w/RJ11 connectors - 0008 RocketPort 8 port w/ DB78 SNI (Siemens) connector - 0009 RocketPort 16 port w/ DB78 SNI (Siemens) connector - 000a RocketPort Plus 4 port - 000b RocketPort Plus 8 port - 000c RocketModem 6 port + 0001 RocketPort PCI 32-port w/external I/F + 0002 RocketPort PCI 8-port w/external I/F + 0003 RocketPort PCI 16-port w/external I/F + 0004 RocketPort PCI 4-port w/Quad Cable + 0005 RocketPort PCI 8-port w/Octa Cable + 0006 RocketPort PCI 8-port w/RJ11 connectors + 0007 RocketPort PCI 4-port w/RJ45 connectors + 0008 RocketPort PCI 8-port w/DB78 SNI connector (Siemens) + 0009 RocketPort PCI 16-port w/DB78 SNI connector (Siemens) + 000a RocketPort PCI Plus 4-port w/Quad Cable + 000b RocketPort PCI Plus 8-port w/Octa Cable + 000c RocketModem II 6-port 000d RocketModem 4-port - 000e RocketPort Plus 2 port RS232 - 000f RocketPort Plus 2 port RS422 - 0040 RocketPort Infinity Octa, 8port, RJ45 - 0041 RocketPort Infinity 32port, External Interface - 0042 RocketPort Infinity 8port, External Interface - 0043 RocketPort Infinity 16port, External Interface - 0044 RocketPort Infinity Quad, 4port, DB - 0045 RocketPort Infinity Octa, 8port, DB + 000e RocketPort PCI Plus 2-port RS-232 w/DB9 connectors + 000f RocketPort PCI Plus 2-port SMPTE w/DB9 connectors + 0040 RocketPort INFINITY 8-port w/Octa Cable RJ45 + 0041 RocketPort INFINITY 32-port w/external I/F + 0042 RocketPort INFINITY 8-port w/external I/F + 0043 RocketPort INFINITY 16-port w/external I/F + 0044 RocketPort INFINITY 4-port w/Quad Cable DB + 0045 RocketPort INFINITY 8-port w/Octa Cable DB 0046 RocketPort INFINITY 4-port w/external I/F - 0047 RocketPort Infinity 4port, RJ45 + 0047 RocketPort INFINITY 4J (4-port) w/RJ45 connectors 0048 RocketPort INFINITY 4J (4-port) w/RJ45 connectors 004a RocketPort INFINITY Plus 4-port 004b RocketPort INFINITY Plus 8-port 004c RocketModem INFINITY III 8-port 004d RocketModem INFINITY III 4-port 004e RocketPort INFINITY Plus 2-port - 004f RocketPort Infinity 2port, SMPTE + 004f RocketPort INFINITY 2-port SMPTE w/DB9 connectors 0050 RocketPort INFINITY Plus 4-port RJ45 0051 RocketPort INFINITY Plus 8-port RJ11 - 0052 RocketPort Infinity Octa, 8port, SMPTE + 0052 RocketPort INFINITY 8-port SMPTE w/DB9 Connectors 0060 RocketPort EXPRESS 8-port w/Octa Cable 0061 RocketPort EXPRESS 32-port w/external I/F 0062 RocketPort EXPRESS 8-Port w/external I/F @@ -14161,7 +14286,7 @@ 0805 RocketPort uPCI 8-port w/Octa Cable 080b RocketPort Plus uPCI 8-port w/Octa Cable 080c RocketModem III 8-port - 080d RcoketModem III 4-port + 080d RocketModem III 4-port 080e RocketPort uPCI 2-port RS232 w/DB9 connectors 080f RocketPort uPCI SMPTE 2-port 0810 RocketPort Plus uPCI 4J (4-port) w/RJ45 connectors @@ -16337,6 +16462,7 @@ 4887 T440T-4087 Unified Wire Ethernet Controller [VF] 4888 T440-4088 Unified Wire Ethernet Controller [VF] 5001 T520-CR Unified Wire Ethernet Controller + 193d 1001 510F-B 5002 T522-CR Unified Wire Ethernet Controller 5003 T540-CR Unified Wire Ethernet Controller 5004 T520-BCH Unified Wire Ethernet Controller @@ -17060,6 +17186,7 @@ 14be L3 Communications 14bf SPIDER Communications Inc. 14c0 COMPAL Electronics Inc + 1201 X550 10Gb 2P RJ45 OCP Mezz # now owned by CSP, Inc. 14c1 MYRICOM Inc. 0008 Myri-10G Dual-Protocol NIC @@ -17168,7 +17295,12 @@ 107b 5048 E4500 Onboard 1259 2705 AT-2711FX 1601 NetXtreme BCM5752M Gigabit Ethernet PCI Express + 1604 BCM5745X NetXtreme-E Ethernet Partition + 1605 BCM5745X NetXtreme-E RDMA Partition + 1606 BCM5745X NetXtreme-E RDMA Virtual Function + 1609 BCM5745X NetXtreme-E Ethernet Virtual Function 1612 BCM70012 Video Decoder [Crystal HD] + 1614 BCM57454 NetXtreme-E 10Gb/25Gb/40Gb/50Gb/100Gb Ethernet 1615 BCM70015 Video Decoder [Crystal HD] 1639 NetXtreme II BCM5709 Gigabit Ethernet 1028 0235 PowerEdge R710 BCM5709 Gigabit Ethernet @@ -17411,6 +17543,8 @@ 103c 193a FlexFabric 10Gb 2-port 533FLR-T Adapter 103c 3382 Ethernet 10Gb 2-port 530FLR-SFP+ Adapter 103c 339d Ethernet 10Gb 2-port 530SFP+ Adapter + 193d 1003 530F-B + 193d 1006 530F-L 1690 NetXtreme BCM57760 Gigabit Ethernet PCIe 1691 NetLink BCM57788 Gigabit Ethernet PCIe 1028 04aa XPS 8300 @@ -17583,6 +17717,7 @@ 16ed BCM57414 NetXtreme-E RDMA Partition 16ee BCM57416 NetXtreme-E Ethernet Partition 16ef BCM57416 NetXtreme-E RDMA Partition + 16f1 BCM57452 NetXtreme-E 10Gb/25Gb/40Gb/50Gb Ethernet 16f3 NetXtreme BCM5727 Gigabit Ethernet PCIe 16f7 NetXtreme BCM5753 Gigabit Ethernet PCI Express 16fd NetXtreme BCM5753M Gigabit Ethernet PCI Express @@ -17859,6 +17994,13 @@ aa52 BCM43602 802.11ac Wireless LAN SoC b302 BCM56302 StrataXGS 24x1GE 2x10GE Switch Controller b334 BCM56334 StrataXGS 24x1GE 4x10GE Switch Controller + b370 BCM56370 Switch ASIC + b371 BCM56371 Switch ASIC + b372 BCM56372 Switch ASIC + b375 BCM56375 Switch ASIC + b376 BCM56376 Switch ASIC + b377 BCM56377 Switch ASIC + b379 Broadcom BCM56379 Switch ASIC b800 BCM56800 StrataXGS 10GE Switch Controller b842 BCM56842 Trident 10GE Switch Controller # Trident2 @@ -18567,6 +18709,7 @@ 15b3 0078 ConnectX-3 Pro 10 GbE Dual Port KR Mezzanine Card 15b3 0079 ConnectX-3 Pro 40 GbE Dual Port QSFP+ Adapter 15b3 0080 ConnectX-3 Pro 10 GbE Dual Port SFP+ Adapter + 193d 1002 520F-B 1009 MT27530 Family 100a MT27531 Family 100b MT27540 Family @@ -18594,6 +18737,7 @@ 15b3 0020 MCX4411A-ACQN, ConnectX-4 Lx EN OCP, 1x25Gb 15b3 0021 MCX4421A-ACQN ConnectX-4 Lx EN OCP,2x25G 15b3 0025 ConnectX-4 Lx 25 GbE Dual Port SFP28 rNDC + 193d 100a 620F-B 1016 MT27710 Family [ConnectX-4 Lx Virtual Function] 1017 MT27800 Family [ConnectX-5] 1018 MT27800 Family [ConnectX-5 Virtual Function] @@ -18661,7 +18805,7 @@ # Spectrum, 100GbE Switch cb84 MT52100 cf08 MT53236 - cf6c MT53100 [Spectrum-2, 64 x 100GbE switch] + cf6c MT53100 [Spectrum-2] d2f0 Switch-IB 3 HDR (200Gbps) switch 15b4 CCI/TRIAD 15b5 Cimetrics Inc @@ -18826,6 +18970,14 @@ 5641 FarSync T4Ee PCI Express (4 port X.21/V.35/V.24) 6620 FarSync T2U-PMC PCI Express (2 port X.21/V.35/V.24) 161f Rioworks +1621 Lynx Studio Technology, Inc. + 0020 LynxTWO-A + 0021 LynxTWO-B + 0022 LynxTWO-C + 0023 Lynx L22 + 0024 Lynx AES16 + 0025 Lynx AES16-SRC + 0028 Lynx AES16e 1626 TDK Semiconductor Corp. 8410 RTL81xx Fast Ethernet 1629 Kongsberg Spacetec AS @@ -19346,6 +19498,9 @@ 7029 AP342 14-bit, 12-Channel Isolated Simultaneous Conversion Analog Input Module 702a AP226 12-Bit, 8-Channel Isolated Analog Output Module 702b AP236 16-Bit, 8-Channel Isolated Analog Output Module + 7031 AP441-1: 32-Channel Isolated Digital Input Module + 7032 AP441-2: 32-Channel Isolated Digital Input Module + 7033 AP441-3: 32-Channel Isolated Digital Input Module 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 @@ -19418,6 +19573,7 @@ 0101 PCD-7004 Digital Bi-Directional Ports PCI Card 0102 PCD-7104 Digital Input & Output PCI Card 0303 PCD-7006C Digital Input & Output PCI Card +1761 Pickering Interfaces Ltd 1771 InnoVISION Multimedia Ltd. # nee SBS Technologies 1775 GE Intelligent Platforms @@ -20620,6 +20776,7 @@ 0009 RAIDCore Controller 000a RAIDCore Controller 1aae Global Velocity, Inc. +1ab4 FFEI Ltd 1ab6 CalDigit, Inc. 6201 RAID Card # Parallels VM virtual devices @@ -20794,6 +20951,9 @@ 91a4 88SE912x IDE Controller 9220 88SE9220 PCIe 2.0 x2 2-port SATA 6 Gb/s RAID Controller 9230 88SE9230 PCIe SATA 6Gb/s Controller + 1028 1fd6 BOSS-S1 Adapter + 1028 1fdf BOSS-S1 Modular + 1028 1fe2 BOSS-S1 Adapter 1d49 0300 ThinkSystem M.2 with Mirroring Enablement Kit 9235 88SE9235 PCIe 2.0 x2 4-port SATA 6 Gb/s Controller 9445 88SE9445 PCIe 2.0 x4 4-Port SAS/SATA 6 Gbps RAID Controller @@ -20936,6 +21096,8 @@ 1014 04f5 PCIe3 1.6TB NVMe Flash Adapter 1014 04f6 PCIe3 3.2TB NVMe Flash Adapter 0023 Ultrastar SN200 Series NVMe SSD +1c5c SK hynix + 1283 PC300 NVMe Solid State Drive 1c5f Beijing Memblaze Technology Co. Ltd. 0540 PBlaze4 NVMe SSD # http://www.nicevt.ru/ (in Russian) @@ -21139,6 +21301,9 @@ e00b Skylark PCI Express Root Port 6 [X-Gene 3] e00c Skylark PCI Express Root Port 7 [X-Gene 3] 1df7 opencpi.org + 0001 ml605 + 0002 alst4 + 0003 alst4x # nee Tumsan Oy 1fc0 Ascom (Finland) Oy 0300 E2200 Dual E1/Rawpipe Card @@ -21189,6 +21354,7 @@ 4027 TN9710P 10GBase-T/NBASE-T Ethernet Adapter 1154 0368 LGY-PCIE-MG 1432 8104 10 Gigabit Ethernet PCI Express Adapter + 1546 4027 IOI9710P 10Gbase-T/NBASE-T Ethernet Adapter 1fc9 3015 Ethernet Adapter 4527 TN9710Q 5GBase-T/NBASE-T Ethernet Adapter 1fcc StreamLabs @@ -23254,6 +23420,7 @@ 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 + 193d 1004 560F-B 1bd4 001b 10G SFP+ DP ER102Fi4 Rack Adapter 1bd4 002f 10G SFP+ DP EP102Fi4A Adapter 1bd4 0032 10G SFP+ DP EP102Fi4 Adapter @@ -23572,6 +23739,8 @@ 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 + 193d 1005 360T-B + 193d 1007 360T-L 1bd4 001d 1G base-T QP EP014Ti1 Adapter 1bd4 0035 1G base-T QP EP014Ti1 Adapter 8086 0001 Ethernet Server Adapter I350-T4 @@ -23685,9 +23854,12 @@ 1563 Ethernet Controller 10G X550T 1028 1fa8 Ethernet 10G 4P X550/I350 rNDC 1028 1fa9 Ethernet 10G 4P X550 rNDC + 14c0 1201 X550 10Gb 2P RJ45 OCP Mezz 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 + 193d 1008 560T-B + 193d 1009 560T-L 8086 0001 Ethernet Converged Network Adapter X550-T2 8086 001a Ethernet Converged Network Adapter X550-T2 8086 001b Ethernet Server Adapter X550-T2 for OCP @@ -24698,6 +24870,7 @@ 1043 8277 P5K PRO Motherboard 1043 844d P8 series motherboard 1458 5000 Motherboard + 1462 7345 MS-7345 Motherboard: Intel 82801I/IR [ICH9/ICH9R] 1462 7418 Wind PC MS-7418 15d9 060d C7SIM-Q Motherboard 15d9 9680 X7DBN Motherboard @@ -25186,6 +25359,7 @@ 24f4 Wireless 8260 # Snow Field Peak AC 8086 0030 Dual Band Wireless-AC 8260 + 24fb Dual Band Wireless-AC 3168NGW [Stone Peak] 24fd Wireless 8265 / 8275 # Windstorm Peak 8086 0010 Dual Band Wireless-AC 8265 @@ -25199,6 +25373,7 @@ 250f 82820 820 (Camino) Chipset AGP Bridge 2520 82805AA MTH Memory Translator Hub 2521 82804AA MRH-S Memory Repeater Hub for SDRAM + 2526 Wireless-AC 9260 2530 82850 850 (Tehama) Chipset Host Bridge (MCH) 1028 00c7 Dimension 8100 147b 0507 TH7II-RAID @@ -26072,6 +26247,7 @@ 2815 82801HM (ICH8M) LPC Interface Controller 1025 0121 Aspire 5920G 1028 01f3 Inspiron 1420 + 1028 022f Inspiron 1525 103c 30c0 Compaq 6710b 103c 30cc Pavilion dv6700 103c 30d9 Presario C700 @@ -26087,6 +26263,7 @@ 1028 020d Inspiron 530 103c 2a6f Asus IPIBL-LB Motherboard 1043 8277 P5K PRO Motherboard: 82801IR [ICH9R] + 1462 7345 MS-7345 Motherboard: Intel 82801I/IR [ICH9/ICH9R] 2823 C610/X99 series chipset sSATA Controller [RAID mode] 2824 82801HB (ICH8) 4 port SATA Controller [AHCI mode] 1043 81ec P5B @@ -26108,6 +26285,7 @@ e4bf cc47 CCG-RUMBA 2829 82801HM/HEM (ICH8M/ICH8M-E) SATA Controller [AHCI mode] 1025 0121 Aspire 5920G + 1028 022f Inspiron 1525 103c 30c0 Compaq 6710b 103c 30c1 Compaq 6910p 103c 30cc Pavilion dv6700 @@ -26124,6 +26302,7 @@ 1025 0121 Aspire 5920G 1028 01da OptiPlex 745 1028 01f3 Inspiron 1420 + 1028 022f Inspiron 1525 103c 30c0 Compaq 6710b 103c 30c1 Compaq 6910p 103c 30cc Pavilion dv6700 @@ -26139,6 +26318,7 @@ 1025 0121 Aspire 5920G 1028 01da OptiPlex 745 1028 01f3 Inspiron 1420 + 1028 022f Inspiron 1525 103c 30c0 Compaq 6710b 103c 30c1 Compaq 6910p 103c 30cc Pavilion dv6700 @@ -26154,6 +26334,7 @@ 1025 0121 Aspire 5920G 1028 01da OptiPlex 745 1028 01f3 Inspiron 1420 + 1028 022f Inspiron 1525 103c 30c0 Compaq 6710b 103c 30c1 Compaq 6910p 103c 30cc Pavilion dv6700 @@ -26170,6 +26351,7 @@ 1025 0121 Aspire 5920G 1028 01da OptiPlex 745 1028 01f3 Inspiron 1420 + 1028 022f Inspiron 1525 103c 30c0 Compaq 6710b 103c 30c1 Compaq 6910p 103c 30cc Pavilion dv6700 @@ -26184,6 +26366,7 @@ 1025 0121 Aspire 5920G 1028 01da OptiPlex 745 1028 01f3 Inspiron 1420 + 1028 022f Inspiron 1525 103c 30c0 Compaq 6710b 103c 30c1 Compaq 6910p 103c 30cc Pavilion dv6700 @@ -26197,6 +26380,7 @@ 1025 0121 Aspire 5920G 1028 01da OptiPlex 745 1028 01f3 Inspiron 1420 + 1028 022f Inspiron 1525 103c 30c0 Compaq 6710b 103c 30c1 Compaq 6910p 103c 30cc Pavilion dv6700 @@ -26212,6 +26396,7 @@ 1025 0121 Aspire 5920G 1028 01da OptiPlex 745 1028 01f3 Inspiron 1420 + 1028 022f Inspiron 1525 103c 30c0 Compaq 6710b 103c 30c1 Compaq 6910p 103c 30cc Pavilion dv6700 @@ -26225,6 +26410,7 @@ 1025 0121 Aspire 5920G 1028 01da OptiPlex 745 1028 01f3 Inspiron 1420 + 1028 022f Inspiron 1525 103c 30d9 Presario C700 1043 81ec P5B 104d 9005 Vaio VGN-FZ260E @@ -26266,6 +26452,7 @@ 1028 01f3 Inspiron 1420 1028 01f9 Latitude D630 1028 01ff Precision M4300 + 1028 022f Inspiron 1525 1028 0256 Studio 1735 103c 2802 Compaq dc7700p 103c 30c0 Compaq 6710b @@ -26286,6 +26473,7 @@ 2850 82801HM/HEM (ICH8M/ICH8M-E) IDE Controller 1025 0121 Aspire 5920G 1028 01f3 Inspiron 1420 + 1028 022f Inspiron 1525 103c 30c0 Compaq 6710b 103c 30c1 Compaq 6910p 103c 30cc Pavilion dv6700 @@ -26302,6 +26490,7 @@ 1028 020d Inspiron 530 103c 2a6f Asus IPIBL-LB Motherboard 1043 8277 P5K PRO Motherboard + 1462 7345 MS-7345 Motherboard 8086 5044 Desktop Board DP35DP 2917 ICH9M-E LPC Interface Controller e4bf cc4d CCM-BOOGIE @@ -26317,6 +26506,7 @@ 1028 0211 Optiplex 755 1028 023c PowerEdge R200 onboard SATA Controller 1043 8277 P5K PRO Motherboard: 82801IR [ICH9R] + 1462 7345 MS-7345 Motherboard: Intel 82801IR [ICH9R] 2921 82801IB (ICH9) 2 port SATA Controller [IDE mode] 1028 0235 PowerEdge R710 SATA IDE Controller 1028 0236 PowerEdge R610 SATA IDE Controller @@ -26324,6 +26514,7 @@ 1462 7360 G33/P35 Neo 2922 82801IR/IO/IH (ICH9R/DO/DH) 6 port SATA Controller [AHCI mode] 1043 8277 P5K PRO Motherboard: 82801IR [ICH9R] + 1462 7345 MS-7345 Motherboard: Intel 82801IR [ICH9R] 1af4 1100 QEMU Virtual Machine 8086 5044 Desktop Board DP35DP 2923 82801IB (ICH9) 4 port SATA Controller [AHCI mode] @@ -26336,6 +26527,7 @@ 1028 0210 PowerEdge T300 onboard SATA Controller 1028 0211 Optiplex 755 1043 8277 P5K PRO Motherboard: 82801IR [ICH9R] + 1462 7345 MS-7345 Motherboard: Intel 82801IR [ICH9R] 1462 7360 G33/P35 Neo 2928 82801IBM/IEM (ICH9M/ICH9M-E) 2 port SATA Controller [IDE mode] 2929 82801IBM/IEM (ICH9M/ICH9M-E) 4 port SATA Controller [AHCI mode] @@ -26350,6 +26542,7 @@ 103c 2a6f Asus IPIBL-LB Motherboard 103c 3628 dv6-1190en 1043 8277 P5K PRO Motherboard: 82801IR [ICH9R] + 1462 7345 MS-7345 Motherboard: Intel 82801I/IR [ICH9/ICH9R] 1462 7360 G33/P35 Neo 1af4 1100 QEMU Virtual Machine 8086 5044 Desktop Board DP35DP @@ -26370,6 +26563,7 @@ 1028 2011 Optiplex 755 *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Thu Feb 15 11:39:59 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C1B53F1589B; Thu, 15 Feb 2018 11:39:59 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (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 2992E7289E; Thu, 15 Feb 2018 11:39:59 +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 w1FBdpGZ053041 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Thu, 15 Feb 2018 13:39:54 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua w1FBdpGZ053041 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id w1FBdpkK053040; Thu, 15 Feb 2018 13:39:51 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Thu, 15 Feb 2018 13:39:51 +0200 From: Konstantin Belousov To: Conrad Meyer Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r329282 - head/share/man/man9 Message-ID: <20180215113951.GH94212@kib.kiev.ua> References: <201802142347.w1ENl4In007623@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201802142347.w1ENl4In007623@repo.freebsd.org> User-Agent: Mutt/1.9.3 (2018-01-21) 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Feb 2018 11:39:59 -0000 On Wed, Feb 14, 2018 at 11:47:04PM +0000, Conrad Meyer wrote: > Author: cem > Date: Wed Feb 14 23:47:04 2018 > New Revision: 329282 > URL: https://svnweb.freebsd.org/changeset/base/329282 > > Log: > pmap_qenter.9: Document API NX mapping > > A follow-up to r329281. > > Sponsored by: Dell EMC Isilon > > Modified: > head/share/man/man9/pmap_qenter.9 > > Modified: head/share/man/man9/pmap_qenter.9 > ============================================================================== > --- head/share/man/man9/pmap_qenter.9 Wed Feb 14 23:35:47 2018 (r329281) > +++ head/share/man/man9/pmap_qenter.9 Wed Feb 14 23:47:04 2018 (r329282) > @@ -25,7 +25,7 @@ > .\" > .\" $FreeBSD$ > .\" > -.Dd July 21, 2003 > +.Dd February 14, 2018 > .Dt PMAP_QENTER 9 > .Os > .Sh NAME > @@ -50,6 +50,7 @@ pointers to wired pages > and enters each of these pages into the kernel virtual address (KVA) space, > beginning at the address > .Fa sva . > +The pages are mapped non-executable. I think that this is too strong statement. It is not even true on i386 without PAE. Also, the man page describes the interface between pmap and MI VM, so it should explain the difference between required in allowed. In this case, it is acceptable for an architecture to implement pmap_qenter() by creating non-exec mappings, but the architecture is not required to do that. > .Pp > The > .Fn pmap_qremove From owner-svn-src-all@freebsd.org Thu Feb 15 11:41:38 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ACA6DF15A94; Thu, 15 Feb 2018 11:41:38 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5A58772CD1; Thu, 15 Feb 2018 11:41:38 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 553ED1E4A5; Thu, 15 Feb 2018 11:41:38 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1FBfcEj066408; Thu, 15 Feb 2018 11:41:38 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1FBfcBq066407; Thu, 15 Feb 2018 11:41:38 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201802151141.w1FBfcBq066407@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Thu, 15 Feb 2018 11:41:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329312 - head/etc/autofs X-SVN-Group: head X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: head/etc/autofs X-SVN-Commit-Revision: 329312 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Feb 2018 11:41:38 -0000 Author: eadler Date: Thu Feb 15 11:41:38 2018 New Revision: 329312 URL: https://svnweb.freebsd.org/changeset/base/329312 Log: etc: clean up trailing whitespace in autofs Obtained from: DragonFlyBSD (48a93f514f93ff671b7b6c9bbed54d45b3f65180) Modified: head/etc/autofs/special_media Modified: head/etc/autofs/special_media ============================================================================== --- head/etc/autofs/special_media Thu Feb 15 11:13:21 2018 (r329311) +++ head/etc/autofs/special_media Thu Feb 15 11:41:38 2018 (r329312) @@ -41,7 +41,7 @@ print_map_entry() { case "${_fstype}" in "exfat") if [ -f "/usr/local/sbin/mount.exfat" ]; then - echo "-mountprog=/usr/local/sbin/mount.exfat,fstype=${_fstype},nosuid :/dev/${_p}" + echo "-mountprog=/usr/local/sbin/mount.exfat,fstype=${_fstype},nosuid :/dev/${_p}" else /usr/bin/logger -p info -t "special_media[$$]" \ "Cannot mount ${_fstype} formatted device /dev/${_p}: Install sysutils/fusefs-exfat first" @@ -50,7 +50,7 @@ print_map_entry() { ;; "ntfs") if [ -f "/usr/local/bin/ntfs-3g" ]; then - echo "-mountprog=/usr/local/bin/ntfs-3g,fstype=${_fstype},nosuid :/dev/${_p}" + echo "-mountprog=/usr/local/bin/ntfs-3g,fstype=${_fstype},nosuid :/dev/${_p}" else /usr/bin/logger -p info -t "special_media[$$]" \ "Cannot mount ${_fstype} formatted device /dev/${_p}: Install sysutils/fusefs-ntfs first" @@ -58,10 +58,10 @@ print_map_entry() { fi ;; "ext2fs" | "msdosfs") - echo "-fstype=${_fstype},nosuid,async :/dev/${_p}" + echo "-fstype=${_fstype},nosuid,async :/dev/${_p}" ;; *) - echo "-fstype=${_fstype},nosuid :/dev/${_p}" + echo "-fstype=${_fstype},nosuid :/dev/${_p}" ;; esac } From owner-svn-src-all@freebsd.org Thu Feb 15 12:23:06 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CDC2CF19567; Thu, 15 Feb 2018 12:23:06 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail105.syd.optusnet.com.au (mail105.syd.optusnet.com.au [211.29.132.249]) by mx1.freebsd.org (Postfix) with ESMTP id B00B8747CD; Thu, 15 Feb 2018 12:23:05 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from [192.168.0.102] (c110-21-101-228.carlnfd1.nsw.optusnet.com.au [110.21.101.228]) by mail105.syd.optusnet.com.au (Postfix) with ESMTPS id A80CD1047FC1; Thu, 15 Feb 2018 23:22:57 +1100 (AEDT) Date: Thu, 15 Feb 2018 23:22:56 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Warner Losh cc: Eitan Adler , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r329296 - head/sbin/devd In-Reply-To: Message-ID: <20180215231649.Q985@besplex.bde.org> References: <201802150322.w1F3Mrie018786@repo.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.2 cv=cIaQihWN c=1 sm=1 tr=0 a=PalzARQSbocsUSjMRkwAPg==:117 a=PalzARQSbocsUSjMRkwAPg==:17 a=kj9zAlcOel0A:10 a=6I5d2MoRAAAA:8 a=7Qk2ozbKAAAA:8 a=vSB-gUQo5yuNJ_K1mewA:9 a=CjuIK1q_8ugA:10 a=IjZwj45LgO3ly-622nXo:22 a=1lyxoWkJIXJV6VJUPhuM:22 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Feb 2018 12:23:07 -0000 On Wed, 14 Feb 2018, Warner Losh wrote: > On Wed, Feb 14, 2018 at 8:51 PM, Eitan Adler wrote: > >> On 14 February 2018 at 19:48, Warner Losh wrote: >>> >>> On Wed, Feb 14, 2018 at 8:39 PM, Warner Losh wrote: >>>> >>>> On Feb 14, 2018 8:23 PM, "Eitan Adler" wrote: >>>> Log: >>>> devd: don't pass &fds in useless parameters to select(2) >>>> >>>> select(2) should be declared as restrict. In addition the only fd in >>>> the fdset is open O_RDONLY, and it's not a socket that can provide OOB >>>> notifications, >>>> >>>> Reviewed by: ian, imp, vangyzen >>>> >>>> Don't put my name on this. I specifically and clearly objected to the >>>> change anf tld yoy not to do it. >>> >>> Stupid phone... >>> >>> I specifically objected to this change. I said not to make it because it >>> wasn't necessary. You did it any way. Don't put "reviewed by" for that. >> Put >>> "objected to but I did it anyway by: imp" It is worse than unnecessary. It breaks at least "any" in the comment before it. "any" means read, write or exeptional descriptors, but now only read descriptors are checked. >> hrm.. rereading the thread I think I missed your original email. Only >> comment I saw was "poll is a better interface". Sorry for mis-stating >> your opinion. > > Yea. It was more of a "don't change it, since it's fine now" and then the > "poll" comment was "better to just change to a better interface." > >> FTR I'd like to fix the declaration of select(2) anyways. > > That's unlikely to end well... I wish you luck... The pattern I used in > devd for select was nearly universal a decade ago... Maybe things have > changed... It can't be nearly universal except possibly for the very special check where you don't care which events occurred, just whether there was one, and also don't wait for any events, but just check for one in a racy way. Bruce From owner-svn-src-all@freebsd.org Thu Feb 15 14:34:19 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 020E9F22DA7; Thu, 15 Feb 2018 14:34:19 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9B1FD7B41A; Thu, 15 Feb 2018 14:34:18 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 92D6920050; Thu, 15 Feb 2018 14:34:18 +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 w1FEYIvO059339; Thu, 15 Feb 2018 14:34:18 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1FEYIbB059337; Thu, 15 Feb 2018 14:34:18 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201802151434.w1FEYIbB059337@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Thu, 15 Feb 2018 14:34:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r329313 - in vendor-sys/illumos/dist/uts/common/fs/zfs: . sys X-SVN-Group: vendor-sys X-SVN-Commit-Author: avg X-SVN-Commit-Paths: in vendor-sys/illumos/dist/uts/common/fs/zfs: . sys X-SVN-Commit-Revision: 329313 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Feb 2018 14:34:19 -0000 Author: avg Date: Thu Feb 15 14:34:18 2018 New Revision: 329313 URL: https://svnweb.freebsd.org/changeset/base/329313 Log: 8857 zio_remove_child() panic due to already destroyed parent zio illumos/illumos-gate@d6e1c446d7897003fd9fd36ef5aa7da350b7f6af https://github.com/illumos/illumos-gate/commit/d6e1c446d7897003fd9fd36ef5aa7da350b7f6af https://www.illumos.org/issues/8857 I had an OS panic on one of our servers: ffffff01809128c0 vpanic() ffffff01809128e0 mutex_panic+0x58(fffffffffb94c904, ffffff597dde7f80) ffffff0180912950 mutex_vector_enter+0x347(ffffff597dde7f80) ffffff01809129b0 zio_remove_child+0x50(ffffff597dde7c58, ffffff32bd901ac0, ffffff3373370908) ffffff0180912a40 zio_done+0x390(ffffff32bd901ac0) ffffff0180912a70 zio_execute+0x78(ffffff32bd901ac0) ffffff0180912b30 taskq_thread+0x2d0(ffffff33bae44140) ffffff0180912b40 thread_start+8() It panicked here: http://src.illumos.org/source/xref/illumos-gate/usr/src/uts/common/fs/zfs/ zio.c#430 pio->io_lock is DEAD, thus a panic. Further analysis shows the "pio" (parent zio of "cio") has already been destroyed. Reviewed by: Matthew Ahrens Reviewed by: Andriy Gapon Reviewed by: Youzhong Yang Approved by: Dan McDonald Author: George Wilson Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/sys/zio.h vendor-sys/illumos/dist/uts/common/fs/zfs/zio.c Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/sys/zio.h ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/sys/zio.h Thu Feb 15 11:41:38 2018 (r329312) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/sys/zio.h Thu Feb 15 14:34:18 2018 (r329313) @@ -208,6 +208,9 @@ enum zio_flag { (((zio)->io_flags & ZIO_FLAG_VDEV_INHERIT) | \ ZIO_FLAG_CANFAIL) +#define ZIO_CHILD_BIT(x) (1 << (x)) +#define ZIO_CHILD_BIT_IS_SET(val, x) ((val) & (1 << (x))) + enum zio_child { ZIO_CHILD_VDEV = 0, ZIO_CHILD_GANG, @@ -215,6 +218,14 @@ enum zio_child { ZIO_CHILD_LOGICAL, ZIO_CHILD_TYPES }; + +#define ZIO_CHILD_VDEV_BIT ZIO_CHILD_BIT(ZIO_CHILD_VDEV) +#define ZIO_CHILD_GANG_BIT ZIO_CHILD_BIT(ZIO_CHILD_GANG) +#define ZIO_CHILD_DDT_BIT ZIO_CHILD_BIT(ZIO_CHILD_DDT) +#define ZIO_CHILD_LOGICAL_BIT ZIO_CHILD_BIT(ZIO_CHILD_LOGICAL) +#define ZIO_CHILD_ALL_BITS \ + (ZIO_CHILD_VDEV_BIT | ZIO_CHILD_GANG_BIT | \ + ZIO_CHILD_DDT_BIT | ZIO_CHILD_LOGICAL_BIT) enum zio_wait_type { ZIO_WAIT_READY = 0, Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/zio.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/zio.c Thu Feb 15 11:41:38 2018 (r329312) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/zio.c Thu Feb 15 14:34:18 2018 (r329313) @@ -442,21 +442,26 @@ zio_remove_child(zio_t *pio, zio_t *cio, zio_link_t *z } static boolean_t -zio_wait_for_children(zio_t *zio, enum zio_child child, enum zio_wait_type wait) +zio_wait_for_children(zio_t *zio, uint8_t childbits, enum zio_wait_type wait) { - uint64_t *countp = &zio->io_children[child][wait]; boolean_t waiting = B_FALSE; mutex_enter(&zio->io_lock); ASSERT(zio->io_stall == NULL); - if (*countp != 0) { - zio->io_stage >>= 1; - ASSERT3U(zio->io_stage, !=, ZIO_STAGE_OPEN); - zio->io_stall = countp; - waiting = B_TRUE; + for (int c = 0; c < ZIO_CHILD_TYPES; c++) { + if (!(ZIO_CHILD_BIT_IS_SET(childbits, c))) + continue; + + uint64_t *countp = &zio->io_children[c][wait]; + if (*countp != 0) { + zio->io_stage >>= 1; + ASSERT3U(zio->io_stage, !=, ZIO_STAGE_OPEN); + zio->io_stall = countp; + waiting = B_TRUE; + break; + } } mutex_exit(&zio->io_lock); - return (waiting); } @@ -1237,9 +1242,10 @@ zio_write_compress(zio_t *zio) * If our children haven't all reached the ready stage, * wait for them and then repeat this pipeline stage. */ - if (zio_wait_for_children(zio, ZIO_CHILD_GANG, ZIO_WAIT_READY) || - zio_wait_for_children(zio, ZIO_CHILD_LOGICAL, ZIO_WAIT_READY)) + if (zio_wait_for_children(zio, ZIO_CHILD_LOGICAL_BIT | + ZIO_CHILD_GANG_BIT, ZIO_WAIT_READY)) { return (ZIO_PIPELINE_STOP); + } if (!IO_IS_ALLOCATING(zio)) return (ZIO_PIPELINE_CONTINUE); @@ -2080,8 +2086,9 @@ zio_gang_issue(zio_t *zio) { blkptr_t *bp = zio->io_bp; - if (zio_wait_for_children(zio, ZIO_CHILD_GANG, ZIO_WAIT_DONE)) + if (zio_wait_for_children(zio, ZIO_CHILD_GANG_BIT, ZIO_WAIT_DONE)) { return (ZIO_PIPELINE_STOP); + } ASSERT(BP_IS_GANG(bp) && zio->io_gang_leader == zio); ASSERT(zio->io_child_type > ZIO_CHILD_GANG); @@ -2402,8 +2409,9 @@ zio_ddt_read_done(zio_t *zio) { blkptr_t *bp = zio->io_bp; - if (zio_wait_for_children(zio, ZIO_CHILD_DDT, ZIO_WAIT_DONE)) + if (zio_wait_for_children(zio, ZIO_CHILD_DDT_BIT, ZIO_WAIT_DONE)) { return (ZIO_PIPELINE_STOP); + } ASSERT(BP_GET_DEDUP(bp)); ASSERT(BP_GET_PSIZE(bp) == zio->io_size); @@ -3109,8 +3117,9 @@ zio_vdev_io_done(zio_t *zio) vdev_ops_t *ops = vd ? vd->vdev_ops : &vdev_mirror_ops; boolean_t unexpected_error = B_FALSE; - if (zio_wait_for_children(zio, ZIO_CHILD_VDEV, ZIO_WAIT_DONE)) + if (zio_wait_for_children(zio, ZIO_CHILD_VDEV_BIT, ZIO_WAIT_DONE)) { return (ZIO_PIPELINE_STOP); + } ASSERT(zio->io_type == ZIO_TYPE_READ || zio->io_type == ZIO_TYPE_WRITE); @@ -3176,8 +3185,9 @@ zio_vdev_io_assess(zio_t *zio) { vdev_t *vd = zio->io_vd; - if (zio_wait_for_children(zio, ZIO_CHILD_VDEV, ZIO_WAIT_DONE)) + if (zio_wait_for_children(zio, ZIO_CHILD_VDEV_BIT, ZIO_WAIT_DONE)) { return (ZIO_PIPELINE_STOP); + } if (vd == NULL && !(zio->io_flags & ZIO_FLAG_CONFIG_WRITER)) spa_config_exit(zio->io_spa, SCL_ZIO, zio); @@ -3392,9 +3402,10 @@ zio_ready(zio_t *zio) zio_t *pio, *pio_next; zio_link_t *zl = NULL; - if (zio_wait_for_children(zio, ZIO_CHILD_GANG, ZIO_WAIT_READY) || - zio_wait_for_children(zio, ZIO_CHILD_DDT, ZIO_WAIT_READY)) + if (zio_wait_for_children(zio, ZIO_CHILD_GANG_BIT | ZIO_CHILD_DDT_BIT, + ZIO_WAIT_READY)) { return (ZIO_PIPELINE_STOP); + } if (zio->io_ready) { ASSERT(IO_IS_ALLOCATING(zio)); @@ -3534,11 +3545,9 @@ zio_done(zio_t *zio) * If our children haven't all completed, * wait for them and then repeat this pipeline stage. */ - if (zio_wait_for_children(zio, ZIO_CHILD_VDEV, ZIO_WAIT_DONE) || - zio_wait_for_children(zio, ZIO_CHILD_GANG, ZIO_WAIT_DONE) || - zio_wait_for_children(zio, ZIO_CHILD_DDT, ZIO_WAIT_DONE) || - zio_wait_for_children(zio, ZIO_CHILD_LOGICAL, ZIO_WAIT_DONE)) + if (zio_wait_for_children(zio, ZIO_CHILD_ALL_BITS, ZIO_WAIT_DONE)) { return (ZIO_PIPELINE_STOP); + } /* * If the allocation throttle is enabled, then update the accounting. From owner-svn-src-all@freebsd.org Thu Feb 15 14:46:30 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9C927F23988; Thu, 15 Feb 2018 14:46:30 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C7807BD8A; Thu, 15 Feb 2018 14:46:30 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 42C27201E7; Thu, 15 Feb 2018 14:46:30 +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 w1FEkUup065186; Thu, 15 Feb 2018 14:46:30 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1FEkT4Q065184; Thu, 15 Feb 2018 14:46:29 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201802151446.w1FEkT4Q065184@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Thu, 15 Feb 2018 14:46:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329314 - in head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs: . sys X-SVN-Group: head X-SVN-Commit-Author: avg X-SVN-Commit-Paths: in head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs: . sys X-SVN-Commit-Revision: 329314 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Feb 2018 14:46:30 -0000 Author: avg Date: Thu Feb 15 14:46:29 2018 New Revision: 329314 URL: https://svnweb.freebsd.org/changeset/base/329314 Log: MFV r329313: 8857 zio_remove_child() panic due to already destroyed parent zio illumos/illumos-gate@d6e1c446d7897003fd9fd36ef5aa7da350b7f6af https://github.com/illumos/illumos-gate/commit/d6e1c446d7897003fd9fd36ef5aa7da350b7f6af https://www.illumos.org/issues/8857 I had an OS panic on one of our servers: ffffff01809128c0 vpanic() ffffff01809128e0 mutex_panic+0x58(fffffffffb94c904, ffffff597dde7f80) ffffff0180912950 mutex_vector_enter+0x347(ffffff597dde7f80) ffffff01809129b0 zio_remove_child+0x50(ffffff597dde7c58, ffffff32bd901ac0, ffffff3373370908) ffffff0180912a40 zio_done+0x390(ffffff32bd901ac0) ffffff0180912a70 zio_execute+0x78(ffffff32bd901ac0) ffffff0180912b30 taskq_thread+0x2d0(ffffff33bae44140) ffffff0180912b40 thread_start+8() It panicked here: http://src.illumos.org/source/xref/illumos-gate/usr/src/uts/common/fs/zfs/ zio.c#430 pio->io_lock is DEAD, thus a panic. Further analysis shows the "pio" (parent zio of "cio") has already been destroyed. Reviewed by: Matthew Ahrens Reviewed by: Andriy Gapon Reviewed by: Youzhong Yang Approved by: Dan McDonald Author: George Wilson PR: 223803 Tested by: shiva.bhanujan@quorum.com MFC after: 2 weeks Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Directory Properties: head/sys/cddl/contrib/opensolaris/ (props changed) Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h Thu Feb 15 14:34:18 2018 (r329313) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h Thu Feb 15 14:46:29 2018 (r329314) @@ -201,6 +201,9 @@ enum zio_flag { (((zio)->io_flags & ZIO_FLAG_VDEV_INHERIT) | \ ZIO_FLAG_CANFAIL) +#define ZIO_CHILD_BIT(x) (1 << (x)) +#define ZIO_CHILD_BIT_IS_SET(val, x) ((val) & (1 << (x))) + enum zio_child { ZIO_CHILD_VDEV = 0, ZIO_CHILD_GANG, @@ -208,6 +211,14 @@ enum zio_child { ZIO_CHILD_LOGICAL, ZIO_CHILD_TYPES }; + +#define ZIO_CHILD_VDEV_BIT ZIO_CHILD_BIT(ZIO_CHILD_VDEV) +#define ZIO_CHILD_GANG_BIT ZIO_CHILD_BIT(ZIO_CHILD_GANG) +#define ZIO_CHILD_DDT_BIT ZIO_CHILD_BIT(ZIO_CHILD_DDT) +#define ZIO_CHILD_LOGICAL_BIT ZIO_CHILD_BIT(ZIO_CHILD_LOGICAL) +#define ZIO_CHILD_ALL_BITS \ + (ZIO_CHILD_VDEV_BIT | ZIO_CHILD_GANG_BIT | \ + ZIO_CHILD_DDT_BIT | ZIO_CHILD_LOGICAL_BIT) enum zio_wait_type { ZIO_WAIT_READY = 0, Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Thu Feb 15 14:34:18 2018 (r329313) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Thu Feb 15 14:46:29 2018 (r329314) @@ -512,21 +512,26 @@ zio_remove_child(zio_t *pio, zio_t *cio, zio_link_t *z } static boolean_t -zio_wait_for_children(zio_t *zio, enum zio_child child, enum zio_wait_type wait) +zio_wait_for_children(zio_t *zio, uint8_t childbits, enum zio_wait_type wait) { - uint64_t *countp = &zio->io_children[child][wait]; boolean_t waiting = B_FALSE; mutex_enter(&zio->io_lock); ASSERT(zio->io_stall == NULL); - if (*countp != 0) { - zio->io_stage >>= 1; - ASSERT3U(zio->io_stage, !=, ZIO_STAGE_OPEN); - zio->io_stall = countp; - waiting = B_TRUE; + for (int c = 0; c < ZIO_CHILD_TYPES; c++) { + if (!(ZIO_CHILD_BIT_IS_SET(childbits, c))) + continue; + + uint64_t *countp = &zio->io_children[c][wait]; + if (*countp != 0) { + zio->io_stage >>= 1; + ASSERT3U(zio->io_stage, !=, ZIO_STAGE_OPEN); + zio->io_stall = countp; + waiting = B_TRUE; + break; + } } mutex_exit(&zio->io_lock); - return (waiting); } @@ -1330,9 +1335,10 @@ zio_write_compress(zio_t *zio) * If our children haven't all reached the ready stage, * wait for them and then repeat this pipeline stage. */ - if (zio_wait_for_children(zio, ZIO_CHILD_GANG, ZIO_WAIT_READY) || - zio_wait_for_children(zio, ZIO_CHILD_LOGICAL, ZIO_WAIT_READY)) + if (zio_wait_for_children(zio, ZIO_CHILD_LOGICAL_BIT | + ZIO_CHILD_GANG_BIT, ZIO_WAIT_READY)) { return (ZIO_PIPELINE_STOP); + } if (!IO_IS_ALLOCATING(zio)) return (ZIO_PIPELINE_CONTINUE); @@ -2180,8 +2186,9 @@ zio_gang_issue(zio_t *zio) { blkptr_t *bp = zio->io_bp; - if (zio_wait_for_children(zio, ZIO_CHILD_GANG, ZIO_WAIT_DONE)) + if (zio_wait_for_children(zio, ZIO_CHILD_GANG_BIT, ZIO_WAIT_DONE)) { return (ZIO_PIPELINE_STOP); + } ASSERT(BP_IS_GANG(bp) && zio->io_gang_leader == zio); ASSERT(zio->io_child_type > ZIO_CHILD_GANG); @@ -2502,8 +2509,9 @@ zio_ddt_read_done(zio_t *zio) { blkptr_t *bp = zio->io_bp; - if (zio_wait_for_children(zio, ZIO_CHILD_DDT, ZIO_WAIT_DONE)) + if (zio_wait_for_children(zio, ZIO_CHILD_DDT_BIT, ZIO_WAIT_DONE)) { return (ZIO_PIPELINE_STOP); + } ASSERT(BP_GET_DEDUP(bp)); ASSERT(BP_GET_PSIZE(bp) == zio->io_size); @@ -3235,8 +3243,9 @@ zio_vdev_io_done(zio_t *zio) vdev_ops_t *ops = vd ? vd->vdev_ops : &vdev_mirror_ops; boolean_t unexpected_error = B_FALSE; - if (zio_wait_for_children(zio, ZIO_CHILD_VDEV, ZIO_WAIT_DONE)) + if (zio_wait_for_children(zio, ZIO_CHILD_VDEV_BIT, ZIO_WAIT_DONE)) { return (ZIO_PIPELINE_STOP); + } ASSERT(zio->io_type == ZIO_TYPE_READ || zio->io_type == ZIO_TYPE_WRITE || zio->io_type == ZIO_TYPE_FREE); @@ -3312,8 +3321,9 @@ zio_vdev_io_assess(zio_t *zio) { vdev_t *vd = zio->io_vd; - if (zio_wait_for_children(zio, ZIO_CHILD_VDEV, ZIO_WAIT_DONE)) + if (zio_wait_for_children(zio, ZIO_CHILD_VDEV_BIT, ZIO_WAIT_DONE)) { return (ZIO_PIPELINE_STOP); + } if (vd == NULL && !(zio->io_flags & ZIO_FLAG_CONFIG_WRITER)) spa_config_exit(zio->io_spa, SCL_ZIO, zio); @@ -3544,9 +3554,10 @@ zio_ready(zio_t *zio) zio_t *pio, *pio_next; zio_link_t *zl = NULL; - if (zio_wait_for_children(zio, ZIO_CHILD_GANG, ZIO_WAIT_READY) || - zio_wait_for_children(zio, ZIO_CHILD_DDT, ZIO_WAIT_READY)) + if (zio_wait_for_children(zio, ZIO_CHILD_GANG_BIT | ZIO_CHILD_DDT_BIT, + ZIO_WAIT_READY)) { return (ZIO_PIPELINE_STOP); + } if (zio->io_ready) { ASSERT(IO_IS_ALLOCATING(zio)); @@ -3686,11 +3697,9 @@ zio_done(zio_t *zio) * If our children haven't all completed, * wait for them and then repeat this pipeline stage. */ - if (zio_wait_for_children(zio, ZIO_CHILD_VDEV, ZIO_WAIT_DONE) || - zio_wait_for_children(zio, ZIO_CHILD_GANG, ZIO_WAIT_DONE) || - zio_wait_for_children(zio, ZIO_CHILD_DDT, ZIO_WAIT_DONE) || - zio_wait_for_children(zio, ZIO_CHILD_LOGICAL, ZIO_WAIT_DONE)) + if (zio_wait_for_children(zio, ZIO_CHILD_ALL_BITS, ZIO_WAIT_DONE)) { return (ZIO_PIPELINE_STOP); + } /* * If the allocation throttle is enabled, then update the accounting. From owner-svn-src-all@freebsd.org Thu Feb 15 15:01:07 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A7C9CF2484A; Thu, 15 Feb 2018 15:01:07 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5993E7C88C; Thu, 15 Feb 2018 15:01:07 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5478B20497; Thu, 15 Feb 2018 15:01:07 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1FF178S070943; Thu, 15 Feb 2018 15:01:07 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1FF17bB070942; Thu, 15 Feb 2018 15:01:07 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201802151501.w1FF17bB070942@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 15 Feb 2018 15:01:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329315 - head/stand/common X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/stand/common X-SVN-Commit-Revision: 329315 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Feb 2018 15:01:07 -0000 Author: kevans Date: Thu Feb 15 15:01:07 2018 New Revision: 329315 URL: https://svnweb.freebsd.org/changeset/base/329315 Log: stand: Fix ubldr after r329190 metadata load files were consolidated in r329190, and these relocation fixup bits were inadvertently dropped in the process. Re-add them to fix boot with ubldr. Glanced over by: jhibbits X-MFC-With: r329190 Modified: head/stand/common/metadata.c Modified: head/stand/common/metadata.c ============================================================================== --- head/stand/common/metadata.c Thu Feb 15 14:46:29 2018 (r329314) +++ head/stand/common/metadata.c Thu Feb 15 15:01:07 2018 (r329315) @@ -38,6 +38,9 @@ __FBSDID("$FreeBSD$"); #include #endif +#ifdef __arm__ +#include +#endif #include #include "bootstrap.h" @@ -315,7 +318,23 @@ md_load_dual(char *args, vm_offset_t *modulep, vm_offs uint64_t scratch64; char *rootdevname; int howto; +#ifdef __arm__ + vm_offset_t vaddr; + int i; + /* + * These metadata addreses must be converted for kernel after + * relocation. + */ + uint32_t mdt[] = { + MODINFOMD_SSYM, MODINFOMD_ESYM, MODINFOMD_KERNEND, + MODINFOMD_ENVP, +#if defined(LOADER_FDT_SUPPORT) + MODINFOMD_DTBP +#endif + }; +#endif + align = kern64 ? 8 : 4; howto = md_getboothowto(args); @@ -409,6 +428,23 @@ md_load_dual(char *args, vm_offset_t *modulep, vm_offs } else { bcopy(&kernend, md->md_data, sizeof kernend); } + +#ifdef __arm__ + /* Convert addresses to the final VA */ + *modulep -= __elfN(relocation_offset); + + /* Do relocation fixup on metadata of each module. */ + for (xp = file_findfile(NULL, NULL); xp != NULL; xp = xp->f_next) { + for (i = 0; i < nitems(mdt); i++) { + md = file_findmetadata(xp, mdt[i]); + if (md) { + bcopy(md->md_data, &vaddr, sizeof vaddr); + vaddr -= __elfN(relocation_offset); + bcopy(&vaddr, md->md_data, sizeof vaddr); + } + } + } +#endif (void)md_copymodules(addr, kern64); #if defined(LOADER_FDT_SUPPORT) From owner-svn-src-all@freebsd.org Thu Feb 15 15:33:19 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C748DF01CDC; Thu, 15 Feb 2018 15:33:18 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6CC7E7E274; Thu, 15 Feb 2018 15:33:18 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 67BDB209E2; Thu, 15 Feb 2018 15:33:18 +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 w1FFXIG7089694; Thu, 15 Feb 2018 15:33:18 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1FFXI0B089691; Thu, 15 Feb 2018 15:33:18 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201802151533.w1FFXI0B089691@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Thu, 15 Feb 2018 15:33:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r329316 - in stable/11/sys: cam/scsi geom X-SVN-Group: stable-11 X-SVN-Commit-Author: avg X-SVN-Commit-Paths: in stable/11/sys: cam/scsi geom X-SVN-Commit-Revision: 329316 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Feb 2018 15:33:19 -0000 Author: avg Date: Thu Feb 15 15:33:17 2018 New Revision: 329316 URL: https://svnweb.freebsd.org/changeset/base/329316 Log: MFC r327996: geom_disk / scsi_da: deny opening write-protected disks for writing Ths change consists of two parts. geom_disk: deny opening a disk for writing if it's marked as write-protected. A new disk(9) flag is added to mark write protected disks. A possible alternative could be to add another parameter to d_open, so that the open mode could be passed to it and the disk drivers could make the decision internally, but the flag required less churn. scsi_da: add a new phase of disk probing to query the all pages mode sense page. We can determine if the disk is write protected using bit 7 of the device specific field in the mode parameter header returned by MODE SENSE. PR: 224037 Modified: stable/11/sys/cam/scsi/scsi_da.c stable/11/sys/geom/geom_disk.c stable/11/sys/geom/geom_disk.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/cam/scsi/scsi_da.c ============================================================================== --- stable/11/sys/cam/scsi/scsi_da.c Thu Feb 15 15:01:07 2018 (r329315) +++ stable/11/sys/cam/scsi/scsi_da.c Thu Feb 15 15:33:17 2018 (r329316) @@ -79,6 +79,7 @@ __FBSDID("$FreeBSD$"); * ATA -> LOGDIR -> IDDIR -> SUP -> ATA_ZONE */ typedef enum { + DA_STATE_PROBE_WP, DA_STATE_PROBE_RC, DA_STATE_PROBE_RC16, DA_STATE_PROBE_LBP, @@ -155,6 +156,7 @@ typedef enum { DA_CCB_PROBE_ATA_IDDIR = 0x0F, DA_CCB_PROBE_ATA_SUP = 0x10, DA_CCB_PROBE_ATA_ZONE = 0x11, + DA_CCB_PROBE_WP = 0x12, DA_CCB_TYPE_MASK = 0x1F, DA_CCB_RETRY_UA = 0x20 } da_ccb_state; @@ -2402,7 +2404,7 @@ daregister(struct cam_periph *periph, void *arg) } LIST_INIT(&softc->pending_ccbs); - softc->state = DA_STATE_PROBE_RC; + softc->state = DA_STATE_PROBE_WP; bioq_init(&softc->delete_run_queue); if (SID_IS_REMOVABLE(&cgd->inq_data)) softc->flags |= DA_FLAG_PACK_REMOVABLE; @@ -2506,7 +2508,6 @@ daregister(struct cam_periph *periph, void *arg) if (SID_ANSI_REV(&cgd->inq_data) >= SCSI_REV_SPC3 && (softc->quirks & DA_Q_NO_RC16) == 0) { softc->flags |= DA_FLAG_CAN_RC16; - softc->state = DA_STATE_PROBE_RC16; } /* @@ -3070,6 +3071,36 @@ out: daschedule(periph); break; } + case DA_STATE_PROBE_WP: + { + void *mode_buf; + int mode_buf_len; + + mode_buf_len = 192; + mode_buf = malloc(mode_buf_len, M_SCSIDA, M_NOWAIT); + if (mode_buf == NULL) { + xpt_print(periph->path, "Unable to send mode sense - " + "malloc failure\n"); + softc->state = DA_STATE_PROBE_RC; + goto skipstate; + } + scsi_mode_sense_len(&start_ccb->csio, + /*retries*/ da_retry_count, + /*cbfcnp*/ dadone, + /*tag_action*/ MSG_SIMPLE_Q_TAG, + /*dbd*/ FALSE, + /*pc*/ SMS_PAGE_CTRL_CURRENT, + /*page*/ SMS_ALL_PAGES_PAGE, + /*param_buf*/ mode_buf, + /*param_len*/ mode_buf_len, + /*minimum_cmd_size*/ softc->minimum_cmd_size, + /*sense_len*/ SSD_FULL_SIZE, + /*timeout*/ da_default_timeout * 1000); + start_ccb->ccb_h.ccb_bp = NULL; + start_ccb->ccb_h.ccb_state = DA_CCB_PROBE_WP; + xpt_action(start_ccb); + break; + } case DA_STATE_PROBE_RC: { struct scsi_read_capacity_data *rcap; @@ -4219,6 +4250,52 @@ dadone(struct cam_periph *periph, union ccb *done_ccb) biodone(bp); return; } + case DA_CCB_PROBE_WP: + { + struct scsi_mode_header_6 *mode_hdr6; + struct scsi_mode_header_10 *mode_hdr10; + uint8_t dev_spec; + + if (softc->minimum_cmd_size > 6) { + mode_hdr10 = (struct scsi_mode_header_10 *)csio->data_ptr; + dev_spec = mode_hdr10->dev_spec; + } else { + mode_hdr6 = (struct scsi_mode_header_6 *)csio->data_ptr; + dev_spec = mode_hdr6->dev_spec; + } + if (cam_ccb_status(done_ccb) == CAM_REQ_CMP) { + if ((dev_spec & 0x80) != 0) + softc->disk->d_flags |= DISKFLAG_WRITE_PROTECT; + else + softc->disk->d_flags &= ~DISKFLAG_WRITE_PROTECT; + } else { + int error; + + error = daerror(done_ccb, CAM_RETRY_SELTO, + SF_RETRY_UA|SF_NO_PRINT); + if (error == ERESTART) + return; + else if (error != 0) { + if ((done_ccb->ccb_h.status & CAM_DEV_QFRZN) != 0) { + /* Don't wedge this device's queue */ + cam_release_devq(done_ccb->ccb_h.path, + /*relsim_flags*/0, + /*reduction*/0, + /*timeout*/0, + /*getcount_only*/0); + } + } + } + + free(csio->data_ptr, M_SCSIDA); + xpt_release_ccb(done_ccb); + if ((softc->flags & DA_FLAG_CAN_RC16) != 0) + softc->state = DA_STATE_PROBE_RC16; + else + softc->state = DA_STATE_PROBE_RC; + xpt_schedule(periph, priority); + return; + } case DA_CCB_PROBE_RC: case DA_CCB_PROBE_RC16: { @@ -5286,11 +5363,7 @@ dareprobe(struct cam_periph *periph) KASSERT(status == CAM_REQ_CMP, ("dareprobe: cam_periph_acquire failed")); - if (softc->flags & DA_FLAG_CAN_RC16) - softc->state = DA_STATE_PROBE_RC16; - else - softc->state = DA_STATE_PROBE_RC; - + softc->state = DA_STATE_PROBE_WP; xpt_schedule(periph, CAM_PRIORITY_DEV); } Modified: stable/11/sys/geom/geom_disk.c ============================================================================== --- stable/11/sys/geom/geom_disk.c Thu Feb 15 15:01:07 2018 (r329315) +++ stable/11/sys/geom/geom_disk.c Thu Feb 15 15:33:17 2018 (r329316) @@ -118,14 +118,18 @@ g_disk_access(struct g_provider *pp, int r, int w, int e += pp->ace; error = 0; if ((pp->acr + pp->acw + pp->ace) == 0 && (r + w + e) > 0) { - if (dp->d_open != NULL) { + /* + * It would be better to defer this decision to d_open if + * it was able to take flags. + */ + if (w > 0 && (dp->d_flags & DISKFLAG_WRITE_PROTECT) != 0) + error = EROFS; + if (error == 0 && dp->d_open != NULL) error = dp->d_open(dp); - if (bootverbose && error != 0) - printf("Opened disk %s -> %d\n", - pp->name, error); - if (error != 0) - return (error); - } + if (bootverbose && error != 0) + printf("Opened disk %s -> %d\n", pp->name, error); + if (error != 0) + return (error); pp->sectorsize = dp->d_sectorsize; if (dp->d_maxsize == 0) { printf("WARNING: Disk drive %s%d has no d_maxsize\n", Modified: stable/11/sys/geom/geom_disk.h ============================================================================== --- stable/11/sys/geom/geom_disk.h Thu Feb 15 15:01:07 2018 (r329315) +++ stable/11/sys/geom/geom_disk.h Thu Feb 15 15:33:17 2018 (r329316) @@ -116,13 +116,14 @@ struct disk { void *d_drv1; }; -#define DISKFLAG_RESERVED 0x1 /* Was NEEDSGIANT */ -#define DISKFLAG_OPEN 0x2 -#define DISKFLAG_CANDELETE 0x4 -#define DISKFLAG_CANFLUSHCACHE 0x8 -#define DISKFLAG_UNMAPPED_BIO 0x10 -#define DISKFLAG_DIRECT_COMPLETION 0x20 -#define DISKFLAG_CANZONE 0x80 +#define DISKFLAG_RESERVED 0x0001 /* Was NEEDSGIANT */ +#define DISKFLAG_OPEN 0x0002 +#define DISKFLAG_CANDELETE 0x0004 +#define DISKFLAG_CANFLUSHCACHE 0x0008 +#define DISKFLAG_UNMAPPED_BIO 0x0010 +#define DISKFLAG_DIRECT_COMPLETION 0x0020 +#define DISKFLAG_CANZONE 0x0080 +#define DISKFLAG_WRITE_PROTECT 0x0100 struct disk *disk_alloc(void); void disk_create(struct disk *disk, int version); From owner-svn-src-all@freebsd.org Thu Feb 15 15:46:15 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 388C2F02889; Thu, 15 Feb 2018 15:46:15 +0000 (UTC) (envelope-from cognet@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D1B2E7EDCE; Thu, 15 Feb 2018 15:46:14 +0000 (UTC) (envelope-from cognet@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C83C820B73; Thu, 15 Feb 2018 15:46:14 +0000 (UTC) (envelope-from cognet@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1FFkEi2095746; Thu, 15 Feb 2018 15:46:14 GMT (envelope-from cognet@FreeBSD.org) Received: (from cognet@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1FFkEBb095745; Thu, 15 Feb 2018 15:46:14 GMT (envelope-from cognet@FreeBSD.org) Message-Id: <201802151546.w1FFkEBb095745@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cognet set sender to cognet@FreeBSD.org using -f From: Olivier Houchard Date: Thu, 15 Feb 2018 15:46:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329317 - head/sys/arm/arm X-SVN-Group: head X-SVN-Commit-Author: cognet X-SVN-Commit-Paths: head/sys/arm/arm X-SVN-Commit-Revision: 329317 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Feb 2018 15:46:15 -0000 Author: cognet Date: Thu Feb 15 15:46:14 2018 New Revision: 329317 URL: https://svnweb.freebsd.org/changeset/base/329317 Log: Rename the ACPI variant of the gicv2m driver from "gicv2m" to "gicv2m_acpi". The FDT variant is called "gicv2m" too, and as both would try to register on gic, only one of them would succeed, while we want them both in a GENERIC kernel. Reviewed by: andrew Modified: head/sys/arm/arm/gic_acpi.c Modified: head/sys/arm/arm/gic_acpi.c ============================================================================== --- head/sys/arm/arm/gic_acpi.c Thu Feb 15 15:33:17 2018 (r329316) +++ head/sys/arm/arm/gic_acpi.c Thu Feb 15 15:46:14 2018 (r329317) @@ -342,5 +342,5 @@ DEFINE_CLASS_1(gicv2m, arm_gicv2m_acpi_driver, arm_gic static devclass_t arm_gicv2m_acpi_devclass; -EARLY_DRIVER_MODULE(gicv2m, gic, arm_gicv2m_acpi_driver, +EARLY_DRIVER_MODULE(gicv2m_acpi, gic, arm_gicv2m_acpi_driver, arm_gicv2m_acpi_devclass, 0, 0, BUS_PASS_INTERRUPT + BUS_PASS_ORDER_MIDDLE); From owner-svn-src-all@freebsd.org Thu Feb 15 16:31:36 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C1E7EF05B01; Thu, 15 Feb 2018 16:31:36 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 73E1F80C98; Thu, 15 Feb 2018 16:31:36 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6EBAA21327; Thu, 15 Feb 2018 16:31:36 +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 w1FGVahN023702; Thu, 15 Feb 2018 16:31:36 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1FGVarH023681; Thu, 15 Feb 2018 16:31:36 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201802151631.w1FGVarH023681@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Thu, 15 Feb 2018 16:31:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r329319 - in stable/10/sys: cam/scsi geom X-SVN-Group: stable-10 X-SVN-Commit-Author: avg X-SVN-Commit-Paths: in stable/10/sys: cam/scsi geom X-SVN-Commit-Revision: 329319 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Feb 2018 16:31:37 -0000 Author: avg Date: Thu Feb 15 16:31:35 2018 New Revision: 329319 URL: https://svnweb.freebsd.org/changeset/base/329319 Log: MFC r327996: geom_disk / scsi_da: deny opening write-protected disks for writing Ths change consists of two parts. geom_disk: deny opening a disk for writing if it's marked as write-protected. A new disk(9) flag is added to mark write protected disks. A possible alternative could be to add another parameter to d_open, so that the open mode could be passed to it and the disk drivers could make the decision internally, but the flag required less churn. scsi_da: add a new phase of disk probing to query the all pages mode sense page. We can determine if the disk is write protected using bit 7 of the device specific field in the mode parameter header returned by MODE SENSE. PR: 224037 Modified: stable/10/sys/cam/scsi/scsi_da.c stable/10/sys/geom/geom_disk.c stable/10/sys/geom/geom_disk.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/scsi/scsi_da.c ============================================================================== --- stable/10/sys/cam/scsi/scsi_da.c Thu Feb 15 16:29:35 2018 (r329318) +++ stable/10/sys/cam/scsi/scsi_da.c Thu Feb 15 16:31:35 2018 (r329319) @@ -69,6 +69,7 @@ __FBSDID("$FreeBSD$"); #ifdef _KERNEL typedef enum { + DA_STATE_PROBE_WP, DA_STATE_PROBE_RC, DA_STATE_PROBE_RC16, DA_STATE_PROBE_LBP, @@ -126,8 +127,9 @@ typedef enum { DA_CCB_DUMP = 0x0A, DA_CCB_DELETE = 0x0B, DA_CCB_TUR = 0x0C, - DA_CCB_TYPE_MASK = 0x0F, - DA_CCB_RETRY_UA = 0x10 + DA_CCB_PROBE_WP = 0x12, + DA_CCB_TYPE_MASK = 0x1F, + DA_CCB_RETRY_UA = 0x20 } da_ccb_state; /* @@ -2096,7 +2098,7 @@ daregister(struct cam_periph *periph, void *arg) } LIST_INIT(&softc->pending_ccbs); - softc->state = DA_STATE_PROBE_RC; + softc->state = DA_STATE_PROBE_WP; bioq_init(&softc->bio_queue); bioq_init(&softc->delete_queue); bioq_init(&softc->delete_run_queue); @@ -2183,7 +2185,6 @@ daregister(struct cam_periph *periph, void *arg) if (SID_ANSI_REV(&cgd->inq_data) >= SCSI_REV_SPC3 && (softc->quirks & DA_Q_NO_RC16) == 0) { softc->flags |= DA_FLAG_CAN_RC16; - softc->state = DA_STATE_PROBE_RC16; } /* @@ -2415,6 +2416,36 @@ out: daschedule(periph); break; } + case DA_STATE_PROBE_WP: + { + void *mode_buf; + int mode_buf_len; + + mode_buf_len = 192; + mode_buf = malloc(mode_buf_len, M_SCSIDA, M_NOWAIT); + if (mode_buf == NULL) { + xpt_print(periph->path, "Unable to send mode sense - " + "malloc failure\n"); + softc->state = DA_STATE_PROBE_RC; + goto skipstate; + } + scsi_mode_sense_len(&start_ccb->csio, + /*retries*/ da_retry_count, + /*cbfcnp*/ dadone, + /*tag_action*/ MSG_SIMPLE_Q_TAG, + /*dbd*/ FALSE, + /*pc*/ SMS_PAGE_CTRL_CURRENT, + /*page*/ SMS_ALL_PAGES_PAGE, + /*param_buf*/ mode_buf, + /*param_len*/ mode_buf_len, + /*minimum_cmd_size*/ softc->minimum_cmd_size, + /*sense_len*/ SSD_FULL_SIZE, + /*timeout*/ da_default_timeout * 1000); + start_ccb->ccb_h.ccb_bp = NULL; + start_ccb->ccb_h.ccb_state = DA_CCB_PROBE_WP; + xpt_action(start_ccb); + break; + } case DA_STATE_PROBE_RC: { struct scsi_read_capacity_data *rcap; @@ -3095,6 +3126,52 @@ dadone(struct cam_periph *periph, union ccb *done_ccb) biodone(bp); return; } + case DA_CCB_PROBE_WP: + { + struct scsi_mode_header_6 *mode_hdr6; + struct scsi_mode_header_10 *mode_hdr10; + uint8_t dev_spec; + + if (softc->minimum_cmd_size > 6) { + mode_hdr10 = (struct scsi_mode_header_10 *)csio->data_ptr; + dev_spec = mode_hdr10->dev_spec; + } else { + mode_hdr6 = (struct scsi_mode_header_6 *)csio->data_ptr; + dev_spec = mode_hdr6->dev_spec; + } + if (cam_ccb_status(done_ccb) == CAM_REQ_CMP) { + if ((dev_spec & 0x80) != 0) + softc->disk->d_flags |= DISKFLAG_WRITE_PROTECT; + else + softc->disk->d_flags &= ~DISKFLAG_WRITE_PROTECT; + } else { + int error; + + error = daerror(done_ccb, CAM_RETRY_SELTO, + SF_RETRY_UA|SF_NO_PRINT); + if (error == ERESTART) + return; + else if (error != 0) { + if ((done_ccb->ccb_h.status & CAM_DEV_QFRZN) != 0) { + /* Don't wedge this device's queue */ + cam_release_devq(done_ccb->ccb_h.path, + /*relsim_flags*/0, + /*reduction*/0, + /*timeout*/0, + /*getcount_only*/0); + } + } + } + + free(csio->data_ptr, M_SCSIDA); + xpt_release_ccb(done_ccb); + if ((softc->flags & DA_FLAG_CAN_RC16) != 0) + softc->state = DA_STATE_PROBE_RC16; + else + softc->state = DA_STATE_PROBE_RC; + xpt_schedule(periph, priority); + return; + } case DA_CCB_PROBE_RC: case DA_CCB_PROBE_RC16: { @@ -3612,11 +3689,7 @@ dareprobe(struct cam_periph *periph) KASSERT(status == CAM_REQ_CMP, ("dareprobe: cam_periph_acquire failed")); - if (softc->flags & DA_FLAG_CAN_RC16) - softc->state = DA_STATE_PROBE_RC16; - else - softc->state = DA_STATE_PROBE_RC; - + softc->state = DA_STATE_PROBE_WP; xpt_schedule(periph, CAM_PRIORITY_DEV); } Modified: stable/10/sys/geom/geom_disk.c ============================================================================== --- stable/10/sys/geom/geom_disk.c Thu Feb 15 16:29:35 2018 (r329318) +++ stable/10/sys/geom/geom_disk.c Thu Feb 15 16:31:35 2018 (r329319) @@ -134,16 +134,21 @@ g_disk_access(struct g_provider *pp, int r, int w, int e += pp->ace; error = 0; if ((pp->acr + pp->acw + pp->ace) == 0 && (r + w + e) > 0) { - if (dp->d_open != NULL) { + /* + * It would be better to defer this decision to d_open if + * it was able to take flags. + */ + if (w > 0 && (dp->d_flags & DISKFLAG_WRITE_PROTECT) != 0) + error = EROFS; + if (error == 0 && dp->d_open != NULL) { g_disk_lock_giant(dp); error = dp->d_open(dp); - if (bootverbose && error != 0) - printf("Opened disk %s -> %d\n", - pp->name, error); g_disk_unlock_giant(dp); - if (error != 0) - return (error); } + if (bootverbose && error != 0) + printf("Opened disk %s -> %d\n", pp->name, error); + if (error != 0) + return (error); pp->mediasize = dp->d_mediasize; pp->sectorsize = dp->d_sectorsize; if (dp->d_maxsize == 0) { Modified: stable/10/sys/geom/geom_disk.h ============================================================================== --- stable/10/sys/geom/geom_disk.h Thu Feb 15 16:29:35 2018 (r329318) +++ stable/10/sys/geom/geom_disk.h Thu Feb 15 16:31:35 2018 (r329319) @@ -105,13 +105,14 @@ struct disk { uint16_t d_rotation_rate; }; -#define DISKFLAG_NEEDSGIANT 0x1 -#define DISKFLAG_OPEN 0x2 -#define DISKFLAG_CANDELETE 0x4 -#define DISKFLAG_CANFLUSHCACHE 0x8 -#define DISKFLAG_UNMAPPED_BIO 0x10 -#define DISKFLAG_DIRECT_COMPLETION 0x20 -#define DISKFLAG_LACKS_ROTRATE 0x40 +#define DISKFLAG_NEEDSGIANT 0x0001 +#define DISKFLAG_OPEN 0x0002 +#define DISKFLAG_CANDELETE 0x0004 +#define DISKFLAG_CANFLUSHCACHE 0x0008 +#define DISKFLAG_UNMAPPED_BIO 0x0010 +#define DISKFLAG_DIRECT_COMPLETION 0x0020 +#define DISKFLAG_LACKS_ROTRATE 0x0040 +#define DISKFLAG_WRITE_PROTECT 0x0100 #define DISK_RR_UNKNOWN 0 #define DISK_RR_NON_ROTATING 1 From owner-svn-src-all@freebsd.org Thu Feb 15 17:09:49 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 57AE6F08A07; Thu, 15 Feb 2018 17:09:49 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0555982DCA; Thu, 15 Feb 2018 17:09:49 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0054D21847; Thu, 15 Feb 2018 17:09:49 +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 w1FH9mkX048791; Thu, 15 Feb 2018 17:09:48 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1FH9mBA048790; Thu, 15 Feb 2018 17:09:48 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201802151709.w1FH9mBA048790@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Thu, 15 Feb 2018 17:09:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r329320 - stable/11/sys/amd64/vmm/amd X-SVN-Group: stable-11 X-SVN-Commit-Author: avg X-SVN-Commit-Paths: stable/11/sys/amd64/vmm/amd X-SVN-Commit-Revision: 329320 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Feb 2018 17:09:49 -0000 Author: avg Date: Thu Feb 15 17:09:48 2018 New Revision: 329320 URL: https://svnweb.freebsd.org/changeset/base/329320 Log: MFC r328622: vmm/svm: post LAPIC interrupts using event injection PR: 215972 Modified: stable/11/sys/amd64/vmm/amd/svm.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/amd64/vmm/amd/svm.c ============================================================================== --- stable/11/sys/amd64/vmm/amd/svm.c Thu Feb 15 16:31:35 2018 (r329319) +++ stable/11/sys/amd64/vmm/amd/svm.c Thu Feb 15 17:09:48 2018 (r329320) @@ -928,7 +928,6 @@ svm_update_virqinfo(struct svm_softc *sc, int vcpu) struct vm *vm; struct vlapic *vlapic; struct vmcb_ctrl *ctrl; - int pending; vm = sc->vm; vlapic = vm_lapic(vm, vcpu); @@ -937,20 +936,9 @@ svm_update_virqinfo(struct svm_softc *sc, int vcpu) /* Update %cr8 in the emulated vlapic */ vlapic_set_cr8(vlapic, ctrl->v_tpr); - /* - * If V_IRQ indicates that the interrupt injection attempted on then - * last VMRUN was successful then update the vlapic accordingly. - */ - if (ctrl->v_intr_vector != 0) { - pending = ctrl->v_irq; - KASSERT(ctrl->v_intr_vector >= 16, ("%s: invalid " - "v_intr_vector %d", __func__, ctrl->v_intr_vector)); - KASSERT(!ctrl->v_ign_tpr, ("%s: invalid v_ign_tpr", __func__)); - VCPU_CTR2(vm, vcpu, "v_intr_vector %d %s", ctrl->v_intr_vector, - pending ? "pending" : "accepted"); - if (!pending) - vlapic_intr_accepted(vlapic, ctrl->v_intr_vector); - } + /* Virtual interrupt injection is not used. */ + KASSERT(ctrl->v_intr_vector == 0, ("%s: invalid " + "v_intr_vector %d", __func__, ctrl->v_intr_vector)); } static void @@ -1019,12 +1007,7 @@ disable_intr_window_exiting(struct svm_softc *sc, int return; } -#ifdef KTR - if (ctrl->v_intr_vector == 0) - VCPU_CTR0(sc->vm, vcpu, "Disable intr window exiting"); - else - VCPU_CTR0(sc->vm, vcpu, "Clearing V_IRQ interrupt injection"); -#endif + VCPU_CTR0(sc->vm, vcpu, "Disable intr window exiting"); ctrl->v_irq = 0; ctrl->v_intr_vector = 0; svm_set_dirty(sc, vcpu, VMCB_CACHE_TPR); @@ -1569,14 +1552,14 @@ svm_inj_interrupts(struct svm_softc *sc, int vcpu, str struct vmcb_state *state; struct svm_vcpu *vcpustate; uint8_t v_tpr; - int vector, need_intr_window, pending_apic_vector; + int vector, need_intr_window; + int extint_pending; state = svm_get_vmcb_state(sc, vcpu); ctrl = svm_get_vmcb_ctrl(sc, vcpu); vcpustate = svm_get_vcpu(sc, vcpu); need_intr_window = 0; - pending_apic_vector = 0; if (vcpustate->nextrip != state->rip) { ctrl->intr_shadow = 0; @@ -1646,40 +1629,19 @@ svm_inj_interrupts(struct svm_softc *sc, int vcpu, str } } - if (!vm_extint_pending(sc->vm, vcpu)) { - /* - * APIC interrupts are delivered using the V_IRQ offload. - * - * The primary benefit is that the hypervisor doesn't need to - * deal with the various conditions that inhibit interrupts. - * It also means that TPR changes via CR8 will be handled - * without any hypervisor involvement. - * - * Note that the APIC vector must remain pending in the vIRR - * until it is confirmed that it was delivered to the guest. - * This can be confirmed based on the value of V_IRQ at the - * next #VMEXIT (1 = pending, 0 = delivered). - * - * Also note that it is possible that another higher priority - * vector can become pending before this vector is delivered - * to the guest. This is alright because vcpu_notify_event() - * will send an IPI and force the vcpu to trap back into the - * hypervisor. The higher priority vector will be injected on - * the next VMRUN. - */ - if (vlapic_pending_intr(vlapic, &vector)) { - KASSERT(vector >= 16 && vector <= 255, - ("invalid vector %d from local APIC", vector)); - pending_apic_vector = vector; - } - goto done; + extint_pending = vm_extint_pending(sc->vm, vcpu); + if (!extint_pending) { + if (!vlapic_pending_intr(vlapic, &vector)) + goto done; + KASSERT(vector >= 16 && vector <= 255, + ("invalid vector %d from local APIC", vector)); + } else { + /* Ask the legacy pic for a vector to inject */ + vatpic_pending_intr(sc->vm, &vector); + KASSERT(vector >= 0 && vector <= 255, + ("invalid vector %d from INTR", vector)); } - /* Ask the legacy pic for a vector to inject */ - vatpic_pending_intr(sc->vm, &vector); - KASSERT(vector >= 0 && vector <= 255, ("invalid vector %d from INTR", - vector)); - /* * If the guest has disabled interrupts or is in an interrupt shadow * then we cannot inject the pending interrupt. @@ -1705,14 +1667,14 @@ svm_inj_interrupts(struct svm_softc *sc, int vcpu, str goto done; } - /* - * Legacy PIC interrupts are delivered via the event injection - * mechanism. - */ svm_eventinject(sc, vcpu, VMCB_EVENTINJ_TYPE_INTR, vector, 0, false); - vm_extint_clear(sc->vm, vcpu); - vatpic_intr_accepted(sc->vm, vector); + if (!extint_pending) { + vlapic_intr_accepted(vlapic, vector); + } else { + vm_extint_clear(sc->vm, vcpu); + vatpic_intr_accepted(sc->vm, vector); + } /* * Force a VM-exit as soon as the vcpu is ready to accept another @@ -1742,21 +1704,7 @@ done: svm_set_dirty(sc, vcpu, VMCB_CACHE_TPR); } - if (pending_apic_vector) { - /* - * If an APIC vector is being injected then interrupt window - * exiting is not possible on this VMRUN. - */ - KASSERT(!need_intr_window, ("intr_window exiting impossible")); - VCPU_CTR1(sc->vm, vcpu, "Injecting vector %d using V_IRQ", - pending_apic_vector); - - ctrl->v_irq = 1; - ctrl->v_ign_tpr = 0; - ctrl->v_intr_vector = pending_apic_vector; - ctrl->v_intr_prio = pending_apic_vector >> 4; - svm_set_dirty(sc, vcpu, VMCB_CACHE_TPR); - } else if (need_intr_window) { + if (need_intr_window) { /* * We use V_IRQ in conjunction with the VINTR intercept to * trap into the hypervisor as soon as a virtual interrupt From owner-svn-src-all@freebsd.org Thu Feb 15 17:10:43 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DD2A5F08C21; Thu, 15 Feb 2018 17:10:42 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8938782F9B; Thu, 15 Feb 2018 17:10:42 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8429B21855; Thu, 15 Feb 2018 17:10:42 +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 w1FHAgMp049007; Thu, 15 Feb 2018 17:10:42 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1FHAgAq049006; Thu, 15 Feb 2018 17:10:42 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201802151710.w1FHAgAq049006@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Thu, 15 Feb 2018 17:10:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r329321 - stable/10/sys/amd64/vmm/amd X-SVN-Group: stable-10 X-SVN-Commit-Author: avg X-SVN-Commit-Paths: stable/10/sys/amd64/vmm/amd X-SVN-Commit-Revision: 329321 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Feb 2018 17:10:43 -0000 Author: avg Date: Thu Feb 15 17:10:42 2018 New Revision: 329321 URL: https://svnweb.freebsd.org/changeset/base/329321 Log: MFC r328622: vmm/svm: post LAPIC interrupts using event injection PR: 215972 Modified: stable/10/sys/amd64/vmm/amd/svm.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/amd64/vmm/amd/svm.c ============================================================================== --- stable/10/sys/amd64/vmm/amd/svm.c Thu Feb 15 17:09:48 2018 (r329320) +++ stable/10/sys/amd64/vmm/amd/svm.c Thu Feb 15 17:10:42 2018 (r329321) @@ -929,7 +929,6 @@ svm_update_virqinfo(struct svm_softc *sc, int vcpu) struct vm *vm; struct vlapic *vlapic; struct vmcb_ctrl *ctrl; - int pending; vm = sc->vm; vlapic = vm_lapic(vm, vcpu); @@ -938,20 +937,9 @@ svm_update_virqinfo(struct svm_softc *sc, int vcpu) /* Update %cr8 in the emulated vlapic */ vlapic_set_cr8(vlapic, ctrl->v_tpr); - /* - * If V_IRQ indicates that the interrupt injection attempted on then - * last VMRUN was successful then update the vlapic accordingly. - */ - if (ctrl->v_intr_vector != 0) { - pending = ctrl->v_irq; - KASSERT(ctrl->v_intr_vector >= 16, ("%s: invalid " - "v_intr_vector %d", __func__, ctrl->v_intr_vector)); - KASSERT(!ctrl->v_ign_tpr, ("%s: invalid v_ign_tpr", __func__)); - VCPU_CTR2(vm, vcpu, "v_intr_vector %d %s", ctrl->v_intr_vector, - pending ? "pending" : "accepted"); - if (!pending) - vlapic_intr_accepted(vlapic, ctrl->v_intr_vector); - } + /* Virtual interrupt injection is not used. */ + KASSERT(ctrl->v_intr_vector == 0, ("%s: invalid " + "v_intr_vector %d", __func__, ctrl->v_intr_vector)); } static void @@ -1020,12 +1008,7 @@ disable_intr_window_exiting(struct svm_softc *sc, int return; } -#ifdef KTR - if (ctrl->v_intr_vector == 0) - VCPU_CTR0(sc->vm, vcpu, "Disable intr window exiting"); - else - VCPU_CTR0(sc->vm, vcpu, "Clearing V_IRQ interrupt injection"); -#endif + VCPU_CTR0(sc->vm, vcpu, "Disable intr window exiting"); ctrl->v_irq = 0; ctrl->v_intr_vector = 0; svm_set_dirty(sc, vcpu, VMCB_CACHE_TPR); @@ -1570,14 +1553,14 @@ svm_inj_interrupts(struct svm_softc *sc, int vcpu, str struct vmcb_state *state; struct svm_vcpu *vcpustate; uint8_t v_tpr; - int vector, need_intr_window, pending_apic_vector; + int vector, need_intr_window; + int extint_pending; state = svm_get_vmcb_state(sc, vcpu); ctrl = svm_get_vmcb_ctrl(sc, vcpu); vcpustate = svm_get_vcpu(sc, vcpu); need_intr_window = 0; - pending_apic_vector = 0; if (vcpustate->nextrip != state->rip) { ctrl->intr_shadow = 0; @@ -1647,40 +1630,19 @@ svm_inj_interrupts(struct svm_softc *sc, int vcpu, str } } - if (!vm_extint_pending(sc->vm, vcpu)) { - /* - * APIC interrupts are delivered using the V_IRQ offload. - * - * The primary benefit is that the hypervisor doesn't need to - * deal with the various conditions that inhibit interrupts. - * It also means that TPR changes via CR8 will be handled - * without any hypervisor involvement. - * - * Note that the APIC vector must remain pending in the vIRR - * until it is confirmed that it was delivered to the guest. - * This can be confirmed based on the value of V_IRQ at the - * next #VMEXIT (1 = pending, 0 = delivered). - * - * Also note that it is possible that another higher priority - * vector can become pending before this vector is delivered - * to the guest. This is alright because vcpu_notify_event() - * will send an IPI and force the vcpu to trap back into the - * hypervisor. The higher priority vector will be injected on - * the next VMRUN. - */ - if (vlapic_pending_intr(vlapic, &vector)) { - KASSERT(vector >= 16 && vector <= 255, - ("invalid vector %d from local APIC", vector)); - pending_apic_vector = vector; - } - goto done; + extint_pending = vm_extint_pending(sc->vm, vcpu); + if (!extint_pending) { + if (!vlapic_pending_intr(vlapic, &vector)) + goto done; + KASSERT(vector >= 16 && vector <= 255, + ("invalid vector %d from local APIC", vector)); + } else { + /* Ask the legacy pic for a vector to inject */ + vatpic_pending_intr(sc->vm, &vector); + KASSERT(vector >= 0 && vector <= 255, + ("invalid vector %d from INTR", vector)); } - /* Ask the legacy pic for a vector to inject */ - vatpic_pending_intr(sc->vm, &vector); - KASSERT(vector >= 0 && vector <= 255, ("invalid vector %d from INTR", - vector)); - /* * If the guest has disabled interrupts or is in an interrupt shadow * then we cannot inject the pending interrupt. @@ -1706,14 +1668,14 @@ svm_inj_interrupts(struct svm_softc *sc, int vcpu, str goto done; } - /* - * Legacy PIC interrupts are delivered via the event injection - * mechanism. - */ svm_eventinject(sc, vcpu, VMCB_EVENTINJ_TYPE_INTR, vector, 0, false); - vm_extint_clear(sc->vm, vcpu); - vatpic_intr_accepted(sc->vm, vector); + if (!extint_pending) { + vlapic_intr_accepted(vlapic, vector); + } else { + vm_extint_clear(sc->vm, vcpu); + vatpic_intr_accepted(sc->vm, vector); + } /* * Force a VM-exit as soon as the vcpu is ready to accept another @@ -1743,21 +1705,7 @@ done: svm_set_dirty(sc, vcpu, VMCB_CACHE_TPR); } - if (pending_apic_vector) { - /* - * If an APIC vector is being injected then interrupt window - * exiting is not possible on this VMRUN. - */ - KASSERT(!need_intr_window, ("intr_window exiting impossible")); - VCPU_CTR1(sc->vm, vcpu, "Injecting vector %d using V_IRQ", - pending_apic_vector); - - ctrl->v_irq = 1; - ctrl->v_ign_tpr = 0; - ctrl->v_intr_vector = pending_apic_vector; - ctrl->v_intr_prio = pending_apic_vector >> 4; - svm_set_dirty(sc, vcpu, VMCB_CACHE_TPR); - } else if (need_intr_window) { + if (need_intr_window) { /* * We use V_IRQ in conjunction with the VINTR intercept to * trap into the hypervisor as soon as a virtual interrupt From owner-svn-src-all@freebsd.org Thu Feb 15 17:26:30 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C31D2F0A331; Thu, 15 Feb 2018 17:26:30 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 76A1C83FFB; Thu, 15 Feb 2018 17:26:30 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 715ED21B94; Thu, 15 Feb 2018 17:26:30 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1FHQU9S059730; Thu, 15 Feb 2018 17:26:30 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1FHQUqW059729; Thu, 15 Feb 2018 17:26:30 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201802151726.w1FHQUqW059729@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Thu, 15 Feb 2018 17:26:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329322 - head/sys/compat/freebsd32 X-SVN-Group: head X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: head/sys/compat/freebsd32 X-SVN-Commit-Revision: 329322 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Feb 2018 17:26:30 -0000 Author: brooks Date: Thu Feb 15 17:26:30 2018 New Revision: 329322 URL: https://svnweb.freebsd.org/changeset/base/329322 Log: Fix getdirentries(2) under 32-bit compat. The latest version of getdirentries (syscall 554) takes a pointer an an off_t as the last argument. The old version which copies out an int32_t was being used instead. Use the standard sys_getdirentries() implementation instead. Reviewed by: kib Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D14379 Modified: head/sys/compat/freebsd32/syscalls.master Modified: head/sys/compat/freebsd32/syscalls.master ============================================================================== --- head/sys/compat/freebsd32/syscalls.master Thu Feb 15 17:10:42 2018 (r329321) +++ head/sys/compat/freebsd32/syscalls.master Thu Feb 15 17:26:30 2018 (r329322) @@ -1097,9 +1097,9 @@ 553 AUE_FHSTAT STD { int freebsd32_fhstat( \ const struct fhandle *u_fhp, \ struct stat32 *sb); } -554 AUE_GETDIRENTRIES STD { ssize_t freebsd32_getdirentries( \ +554 AUE_GETDIRENTRIES NOPROTO { ssize_t getdirentries( \ int fd, char *buf, size_t count, \ - int32_t *basep); } + off_t *basep); } 555 AUE_STATFS NOPROTO { int statfs(char *path, \ struct statfs32 *buf); } 556 AUE_FSTATFS NOPROTO { int fstatfs(int fd, struct statfs32 *buf); } From owner-svn-src-all@freebsd.org Thu Feb 15 17:27:21 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C7D80F0A45F; Thu, 15 Feb 2018 17:27:20 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 222658418C; Thu, 15 Feb 2018 17:27:20 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1C9D221B99; Thu, 15 Feb 2018 17:27:20 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1FHRJkE059889; Thu, 15 Feb 2018 17:27:19 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1FHRJ6e059882; Thu, 15 Feb 2018 17:27:19 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201802151727.w1FHRJ6e059882@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Thu, 15 Feb 2018 17:27:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329323 - head/sys/compat/freebsd32 X-SVN-Group: head X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: head/sys/compat/freebsd32 X-SVN-Commit-Revision: 329323 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Feb 2018 17:27:21 -0000 Author: brooks Date: Thu Feb 15 17:27:19 2018 New Revision: 329323 URL: https://svnweb.freebsd.org/changeset/base/329323 Log: Regen after r329322: Fix getdirentries(2) under 32-bit compat. Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D14379 Modified: head/sys/compat/freebsd32/freebsd32_proto.h head/sys/compat/freebsd32/freebsd32_syscall.h head/sys/compat/freebsd32/freebsd32_syscalls.c head/sys/compat/freebsd32/freebsd32_sysent.c head/sys/compat/freebsd32/freebsd32_systrace_args.c Modified: head/sys/compat/freebsd32/freebsd32_proto.h ============================================================================== --- head/sys/compat/freebsd32/freebsd32_proto.h Thu Feb 15 17:26:30 2018 (r329322) +++ head/sys/compat/freebsd32/freebsd32_proto.h Thu Feb 15 17:27:19 2018 (r329323) @@ -680,12 +680,6 @@ struct freebsd32_fhstat_args { char u_fhp_l_[PADL_(const struct fhandle *)]; const struct fhandle * u_fhp; char u_fhp_r_[PADR_(const struct fhandle *)]; char sb_l_[PADL_(struct stat32 *)]; struct stat32 * sb; char sb_r_[PADR_(struct stat32 *)]; }; -struct freebsd32_getdirentries_args { - char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)]; - char buf_l_[PADL_(char *)]; char * buf; char buf_r_[PADR_(char *)]; - char count_l_[PADL_(size_t)]; size_t count; char count_r_[PADR_(size_t)]; - char basep_l_[PADL_(int32_t *)]; int32_t * basep; char basep_r_[PADR_(int32_t *)]; -}; struct freebsd32_kevent_args { char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)]; char changelist_l_[PADL_(const struct kevent32 *)]; const struct kevent32 * changelist; char changelist_r_[PADR_(const struct kevent32 *)]; @@ -840,7 +834,6 @@ int freebsd32_utimensat(struct thread *, struct freebs int freebsd32_fstat(struct thread *, struct freebsd32_fstat_args *); int freebsd32_fstatat(struct thread *, struct freebsd32_fstatat_args *); int freebsd32_fhstat(struct thread *, struct freebsd32_fhstat_args *); -int freebsd32_getdirentries(struct thread *, struct freebsd32_getdirentries_args *); int freebsd32_kevent(struct thread *, struct freebsd32_kevent_args *); int freebsd32_cpuset_getdomain(struct thread *, struct freebsd32_cpuset_getdomain_args *); int freebsd32_cpuset_setdomain(struct thread *, struct freebsd32_cpuset_setdomain_args *); @@ -1389,7 +1382,6 @@ int freebsd11_freebsd32_mknodat(struct thread *, struc #define FREEBSD32_SYS_AUE_freebsd32_fstat AUE_FSTAT #define FREEBSD32_SYS_AUE_freebsd32_fstatat AUE_FSTATAT #define FREEBSD32_SYS_AUE_freebsd32_fhstat AUE_FHSTAT -#define FREEBSD32_SYS_AUE_freebsd32_getdirentries AUE_GETDIRENTRIES #define FREEBSD32_SYS_AUE_freebsd32_kevent AUE_KEVENT #define FREEBSD32_SYS_AUE_freebsd32_cpuset_getdomain AUE_NULL #define FREEBSD32_SYS_AUE_freebsd32_cpuset_setdomain AUE_NULL Modified: head/sys/compat/freebsd32/freebsd32_syscall.h ============================================================================== --- head/sys/compat/freebsd32/freebsd32_syscall.h Thu Feb 15 17:26:30 2018 (r329322) +++ head/sys/compat/freebsd32/freebsd32_syscall.h Thu Feb 15 17:27:19 2018 (r329323) @@ -459,7 +459,7 @@ #define FREEBSD32_SYS_freebsd32_fstat 551 #define FREEBSD32_SYS_freebsd32_fstatat 552 #define FREEBSD32_SYS_freebsd32_fhstat 553 -#define FREEBSD32_SYS_freebsd32_getdirentries 554 +#define FREEBSD32_SYS_getdirentries 554 #define FREEBSD32_SYS_statfs 555 #define FREEBSD32_SYS_fstatfs 556 #define FREEBSD32_SYS_getfsstat 557 Modified: head/sys/compat/freebsd32/freebsd32_syscalls.c ============================================================================== --- head/sys/compat/freebsd32/freebsd32_syscalls.c Thu Feb 15 17:26:30 2018 (r329322) +++ head/sys/compat/freebsd32/freebsd32_syscalls.c Thu Feb 15 17:27:19 2018 (r329323) @@ -586,7 +586,7 @@ const char *freebsd32_syscallnames[] = { "freebsd32_fstat", /* 551 = freebsd32_fstat */ "freebsd32_fstatat", /* 552 = freebsd32_fstatat */ "freebsd32_fhstat", /* 553 = freebsd32_fhstat */ - "freebsd32_getdirentries", /* 554 = freebsd32_getdirentries */ + "getdirentries", /* 554 = getdirentries */ "statfs", /* 555 = statfs */ "fstatfs", /* 556 = fstatfs */ "getfsstat", /* 557 = getfsstat */ Modified: head/sys/compat/freebsd32/freebsd32_sysent.c ============================================================================== --- head/sys/compat/freebsd32/freebsd32_sysent.c Thu Feb 15 17:26:30 2018 (r329322) +++ head/sys/compat/freebsd32/freebsd32_sysent.c Thu Feb 15 17:27:19 2018 (r329323) @@ -635,7 +635,7 @@ struct sysent freebsd32_sysent[] = { { AS(freebsd32_fstat_args), (sy_call_t *)freebsd32_fstat, AUE_FSTAT, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 551 = freebsd32_fstat */ { AS(freebsd32_fstatat_args), (sy_call_t *)freebsd32_fstatat, AUE_FSTATAT, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 552 = freebsd32_fstatat */ { AS(freebsd32_fhstat_args), (sy_call_t *)freebsd32_fhstat, AUE_FHSTAT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 553 = freebsd32_fhstat */ - { AS(freebsd32_getdirentries_args), (sy_call_t *)freebsd32_getdirentries, AUE_GETDIRENTRIES, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 554 = freebsd32_getdirentries */ + { AS(getdirentries_args), (sy_call_t *)sys_getdirentries, AUE_GETDIRENTRIES, NULL, 0, 0, 0, SY_THR_STATIC }, /* 554 = getdirentries */ { AS(statfs_args), (sy_call_t *)sys_statfs, AUE_STATFS, NULL, 0, 0, 0, SY_THR_STATIC }, /* 555 = statfs */ { AS(fstatfs_args), (sy_call_t *)sys_fstatfs, AUE_FSTATFS, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 556 = fstatfs */ { AS(getfsstat_args), (sy_call_t *)sys_getfsstat, AUE_GETFSSTAT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 557 = getfsstat */ Modified: head/sys/compat/freebsd32/freebsd32_systrace_args.c ============================================================================== --- head/sys/compat/freebsd32/freebsd32_systrace_args.c Thu Feb 15 17:26:30 2018 (r329322) +++ head/sys/compat/freebsd32/freebsd32_systrace_args.c Thu Feb 15 17:27:19 2018 (r329323) @@ -3183,13 +3183,13 @@ systrace_args(int sysnum, void *params, uint64_t *uarg *n_args = 2; break; } - /* freebsd32_getdirentries */ + /* getdirentries */ case 554: { - struct freebsd32_getdirentries_args *p = params; + struct getdirentries_args *p = params; iarg[0] = p->fd; /* int */ uarg[1] = (intptr_t) p->buf; /* char * */ uarg[2] = p->count; /* size_t */ - uarg[3] = (intptr_t) p->basep; /* int32_t * */ + uarg[3] = (intptr_t) p->basep; /* off_t * */ *n_args = 4; break; } @@ -8626,7 +8626,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *d break; }; break; - /* freebsd32_getdirentries */ + /* getdirentries */ case 554: switch(ndx) { case 0: @@ -8639,7 +8639,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *d p = "size_t"; break; case 3: - p = "userland int32_t *"; + p = "userland off_t *"; break; default: break; @@ -10606,7 +10606,7 @@ systrace_return_setargdesc(int sysnum, int ndx, char * if (ndx == 0 || ndx == 1) p = "int"; break; - /* freebsd32_getdirentries */ + /* getdirentries */ case 554: if (ndx == 0 || ndx == 1) p = "ssize_t"; From owner-svn-src-all@freebsd.org Thu Feb 15 17:35:41 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6C22CF0ACA7; Thu, 15 Feb 2018 17:35:41 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1FD0384998; Thu, 15 Feb 2018 17:35: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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1ACE721D38; Thu, 15 Feb 2018 17:35: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 w1FHZes3065898; Thu, 15 Feb 2018 17:35:40 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1FHZetl065897; Thu, 15 Feb 2018 17:35:40 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201802151735.w1FHZetl065897@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 15 Feb 2018 17:35:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329325 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 329325 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Feb 2018 17:35:41 -0000 Author: markj Date: Thu Feb 15 17:35:40 2018 New Revision: 329325 URL: https://svnweb.freebsd.org/changeset/base/329325 Log: Fix the test for SET_FOREACH termination. Unlike the queue(3) _FOREACH macros, the iterator for a SET_FOREACH is not NULL after the end of the set is reached. Modified: head/sys/kern/subr_compressor.c Modified: head/sys/kern/subr_compressor.c ============================================================================== --- head/sys/kern/subr_compressor.c Thu Feb 15 17:27:34 2018 (r329324) +++ head/sys/kern/subr_compressor.c Thu Feb 15 17:35:40 2018 (r329325) @@ -498,7 +498,7 @@ compressor_init(compressor_cb_t cb, int format, size_t if ((*iter)->format == format) break; } - if (iter == NULL) + if (iter == SET_LIMIT(compressors)) return (NULL); priv = (*iter)->init(maxiosize, level); From owner-svn-src-all@freebsd.org Thu Feb 15 17:47:44 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 952FAF0BB7A; Thu, 15 Feb 2018 17:47:44 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46DCC857E6; Thu, 15 Feb 2018 17:47:44 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 289E421EEB; Thu, 15 Feb 2018 17:47:44 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1FHlheY072521; Thu, 15 Feb 2018 17:47:43 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1FHlhE7072520; Thu, 15 Feb 2018 17:47:43 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201802151747.w1FHlhE7072520@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 15 Feb 2018 17:47:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329326 - head/tools/boot X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/tools/boot X-SVN-Commit-Revision: 329326 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Feb 2018 17:47:44 -0000 Author: kevans Date: Thu Feb 15 17:47:43 2018 New Revision: 329326 URL: https://svnweb.freebsd.org/changeset/base/329326 Log: Set svn:executable on lua-img.sh Modified: Directory Properties: head/tools/boot/lua-img.sh (props changed) From owner-svn-src-all@freebsd.org Thu Feb 15 17:56:46 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1D03BF0C7B8; Thu, 15 Feb 2018 17:56:46 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C5D778612A; Thu, 15 Feb 2018 17:56:45 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C0B982207C; Thu, 15 Feb 2018 17:56:45 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1FHujX6077951; Thu, 15 Feb 2018 17:56:45 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1FHujpo077950; Thu, 15 Feb 2018 17:56:45 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201802151756.w1FHujpo077950@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 15 Feb 2018 17:56:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329327 - head/tools/boot X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/tools/boot X-SVN-Commit-Revision: 329327 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Feb 2018 17:56:46 -0000 Author: kevans Date: Thu Feb 15 17:56:45 2018 New Revision: 329327 URL: https://svnweb.freebsd.org/changeset/base/329327 Log: Build loader before installing it in lua-img.sh Slightly more foolproof when all you're wanting to do is quickly get off the ground with testing the lua loader. Modified: head/tools/boot/lua-img.sh Modified: head/tools/boot/lua-img.sh ============================================================================== --- head/tools/boot/lua-img.sh Thu Feb 15 17:47:43 2018 (r329326) +++ head/tools/boot/lua-img.sh Thu Feb 15 17:56:45 2018 (r329327) @@ -20,6 +20,7 @@ mkdir -p ${dir} mtree -deUW -f etc/mtree/BSD.root.dist -p ${dir} mtree -deUW -f etc/mtree/BSD.usr.dist -p ${dir}/usr cd stand +make MK_LOADER_LUA=yes MK_FORTH=no make install DESTDIR=${dir} NO_ROOT=t MK_LOADER_LUA=yes MK_FORTH=no MK_INSTALL_AS_USER=yes mkdir -p ${dir}/boot/kernel cp /boot/kernel/kernel ${dir}/boot/kernel From owner-svn-src-all@freebsd.org Thu Feb 15 17:58:53 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0C145F0CA3F; Thu, 15 Feb 2018 17:58:53 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A9BB886347; Thu, 15 Feb 2018 17:58:52 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9FD242207D; Thu, 15 Feb 2018 17:58:52 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1FHwq4e078191; Thu, 15 Feb 2018 17:58:52 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1FHwpgI078185; Thu, 15 Feb 2018 17:58:51 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201802151758.w1FHwpgI078185@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Thu, 15 Feb 2018 17:58:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329328 - head/sys/compat/freebsd32 X-SVN-Group: head X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: head/sys/compat/freebsd32 X-SVN-Commit-Revision: 329328 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Feb 2018 17:58:53 -0000 Author: brooks Date: Thu Feb 15 17:58:51 2018 New Revision: 329328 URL: https://svnweb.freebsd.org/changeset/base/329328 Log: Revert r329323. I missed something in my testing. Modified: head/sys/compat/freebsd32/freebsd32_proto.h head/sys/compat/freebsd32/freebsd32_syscall.h head/sys/compat/freebsd32/freebsd32_syscalls.c head/sys/compat/freebsd32/freebsd32_sysent.c head/sys/compat/freebsd32/freebsd32_systrace_args.c Modified: head/sys/compat/freebsd32/freebsd32_proto.h ============================================================================== --- head/sys/compat/freebsd32/freebsd32_proto.h Thu Feb 15 17:56:45 2018 (r329327) +++ head/sys/compat/freebsd32/freebsd32_proto.h Thu Feb 15 17:58:51 2018 (r329328) @@ -680,6 +680,12 @@ struct freebsd32_fhstat_args { char u_fhp_l_[PADL_(const struct fhandle *)]; const struct fhandle * u_fhp; char u_fhp_r_[PADR_(const struct fhandle *)]; char sb_l_[PADL_(struct stat32 *)]; struct stat32 * sb; char sb_r_[PADR_(struct stat32 *)]; }; +struct freebsd32_getdirentries_args { + char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)]; + char buf_l_[PADL_(char *)]; char * buf; char buf_r_[PADR_(char *)]; + char count_l_[PADL_(size_t)]; size_t count; char count_r_[PADR_(size_t)]; + char basep_l_[PADL_(int32_t *)]; int32_t * basep; char basep_r_[PADR_(int32_t *)]; +}; struct freebsd32_kevent_args { char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)]; char changelist_l_[PADL_(const struct kevent32 *)]; const struct kevent32 * changelist; char changelist_r_[PADR_(const struct kevent32 *)]; @@ -834,6 +840,7 @@ int freebsd32_utimensat(struct thread *, struct freebs int freebsd32_fstat(struct thread *, struct freebsd32_fstat_args *); int freebsd32_fstatat(struct thread *, struct freebsd32_fstatat_args *); int freebsd32_fhstat(struct thread *, struct freebsd32_fhstat_args *); +int freebsd32_getdirentries(struct thread *, struct freebsd32_getdirentries_args *); int freebsd32_kevent(struct thread *, struct freebsd32_kevent_args *); int freebsd32_cpuset_getdomain(struct thread *, struct freebsd32_cpuset_getdomain_args *); int freebsd32_cpuset_setdomain(struct thread *, struct freebsd32_cpuset_setdomain_args *); @@ -1382,6 +1389,7 @@ int freebsd11_freebsd32_mknodat(struct thread *, struc #define FREEBSD32_SYS_AUE_freebsd32_fstat AUE_FSTAT #define FREEBSD32_SYS_AUE_freebsd32_fstatat AUE_FSTATAT #define FREEBSD32_SYS_AUE_freebsd32_fhstat AUE_FHSTAT +#define FREEBSD32_SYS_AUE_freebsd32_getdirentries AUE_GETDIRENTRIES #define FREEBSD32_SYS_AUE_freebsd32_kevent AUE_KEVENT #define FREEBSD32_SYS_AUE_freebsd32_cpuset_getdomain AUE_NULL #define FREEBSD32_SYS_AUE_freebsd32_cpuset_setdomain AUE_NULL Modified: head/sys/compat/freebsd32/freebsd32_syscall.h ============================================================================== --- head/sys/compat/freebsd32/freebsd32_syscall.h Thu Feb 15 17:56:45 2018 (r329327) +++ head/sys/compat/freebsd32/freebsd32_syscall.h Thu Feb 15 17:58:51 2018 (r329328) @@ -459,7 +459,7 @@ #define FREEBSD32_SYS_freebsd32_fstat 551 #define FREEBSD32_SYS_freebsd32_fstatat 552 #define FREEBSD32_SYS_freebsd32_fhstat 553 -#define FREEBSD32_SYS_getdirentries 554 +#define FREEBSD32_SYS_freebsd32_getdirentries 554 #define FREEBSD32_SYS_statfs 555 #define FREEBSD32_SYS_fstatfs 556 #define FREEBSD32_SYS_getfsstat 557 Modified: head/sys/compat/freebsd32/freebsd32_syscalls.c ============================================================================== --- head/sys/compat/freebsd32/freebsd32_syscalls.c Thu Feb 15 17:56:45 2018 (r329327) +++ head/sys/compat/freebsd32/freebsd32_syscalls.c Thu Feb 15 17:58:51 2018 (r329328) @@ -586,7 +586,7 @@ const char *freebsd32_syscallnames[] = { "freebsd32_fstat", /* 551 = freebsd32_fstat */ "freebsd32_fstatat", /* 552 = freebsd32_fstatat */ "freebsd32_fhstat", /* 553 = freebsd32_fhstat */ - "getdirentries", /* 554 = getdirentries */ + "freebsd32_getdirentries", /* 554 = freebsd32_getdirentries */ "statfs", /* 555 = statfs */ "fstatfs", /* 556 = fstatfs */ "getfsstat", /* 557 = getfsstat */ Modified: head/sys/compat/freebsd32/freebsd32_sysent.c ============================================================================== --- head/sys/compat/freebsd32/freebsd32_sysent.c Thu Feb 15 17:56:45 2018 (r329327) +++ head/sys/compat/freebsd32/freebsd32_sysent.c Thu Feb 15 17:58:51 2018 (r329328) @@ -635,7 +635,7 @@ struct sysent freebsd32_sysent[] = { { AS(freebsd32_fstat_args), (sy_call_t *)freebsd32_fstat, AUE_FSTAT, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 551 = freebsd32_fstat */ { AS(freebsd32_fstatat_args), (sy_call_t *)freebsd32_fstatat, AUE_FSTATAT, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 552 = freebsd32_fstatat */ { AS(freebsd32_fhstat_args), (sy_call_t *)freebsd32_fhstat, AUE_FHSTAT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 553 = freebsd32_fhstat */ - { AS(getdirentries_args), (sy_call_t *)sys_getdirentries, AUE_GETDIRENTRIES, NULL, 0, 0, 0, SY_THR_STATIC }, /* 554 = getdirentries */ + { AS(freebsd32_getdirentries_args), (sy_call_t *)freebsd32_getdirentries, AUE_GETDIRENTRIES, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 554 = freebsd32_getdirentries */ { AS(statfs_args), (sy_call_t *)sys_statfs, AUE_STATFS, NULL, 0, 0, 0, SY_THR_STATIC }, /* 555 = statfs */ { AS(fstatfs_args), (sy_call_t *)sys_fstatfs, AUE_FSTATFS, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 556 = fstatfs */ { AS(getfsstat_args), (sy_call_t *)sys_getfsstat, AUE_GETFSSTAT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 557 = getfsstat */ Modified: head/sys/compat/freebsd32/freebsd32_systrace_args.c ============================================================================== --- head/sys/compat/freebsd32/freebsd32_systrace_args.c Thu Feb 15 17:56:45 2018 (r329327) +++ head/sys/compat/freebsd32/freebsd32_systrace_args.c Thu Feb 15 17:58:51 2018 (r329328) @@ -3183,13 +3183,13 @@ systrace_args(int sysnum, void *params, uint64_t *uarg *n_args = 2; break; } - /* getdirentries */ + /* freebsd32_getdirentries */ case 554: { - struct getdirentries_args *p = params; + struct freebsd32_getdirentries_args *p = params; iarg[0] = p->fd; /* int */ uarg[1] = (intptr_t) p->buf; /* char * */ uarg[2] = p->count; /* size_t */ - uarg[3] = (intptr_t) p->basep; /* off_t * */ + uarg[3] = (intptr_t) p->basep; /* int32_t * */ *n_args = 4; break; } @@ -8626,7 +8626,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *d break; }; break; - /* getdirentries */ + /* freebsd32_getdirentries */ case 554: switch(ndx) { case 0: @@ -8639,7 +8639,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *d p = "size_t"; break; case 3: - p = "userland off_t *"; + p = "userland int32_t *"; break; default: break; @@ -10606,7 +10606,7 @@ systrace_return_setargdesc(int sysnum, int ndx, char * if (ndx == 0 || ndx == 1) p = "int"; break; - /* getdirentries */ + /* freebsd32_getdirentries */ case 554: if (ndx == 0 || ndx == 1) p = "ssize_t"; From owner-svn-src-all@freebsd.org Thu Feb 15 18:16:17 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 47565F0E0D2; Thu, 15 Feb 2018 18:16:17 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F162887372; Thu, 15 Feb 2018 18:16:16 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E7B2D223B4; Thu, 15 Feb 2018 18:16:16 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1FIGGGo089378; Thu, 15 Feb 2018 18:16:16 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1FIGGt8089377; Thu, 15 Feb 2018 18:16:16 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201802151816.w1FIGGt8089377@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 15 Feb 2018 18:16:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329329 - head/stand/lua X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/stand/lua X-SVN-Commit-Revision: 329329 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Feb 2018 18:16:17 -0000 Author: kevans Date: Thu Feb 15 18:16:16 2018 New Revision: 329329 URL: https://svnweb.freebsd.org/changeset/base/329329 Log: stand/lua: Always boot on 'enter' keypress in menus Modified: head/stand/lua/menu.lua Modified: head/stand/lua/menu.lua ============================================================================== --- head/stand/lua/menu.lua Thu Feb 15 17:58:51 2018 (r329328) +++ head/stand/lua/menu.lua Thu Feb 15 18:16:16 2018 (r329329) @@ -152,7 +152,7 @@ menu.welcome = { core.setSingleUser(false); core.boot(); end, - alias = {"b", "B", "\013"} + alias = {"b", "B"} }, -- boot single user @@ -272,9 +272,12 @@ function menu.run(m) while cont do local key = io.getchar(); - -- Exit on backspace + -- Special key behaviors if (key == 127) and (m ~= menu.welcome) then break + elseif (key == 13) then + core.boot(); + -- Should not return end key = string.char(key) From owner-svn-src-all@freebsd.org Thu Feb 15 18:19:25 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B4D06F0E455; Thu, 15 Feb 2018 18:19:25 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5F62187798; Thu, 15 Feb 2018 18:19:25 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5A02C223D7; Thu, 15 Feb 2018 18:19:25 +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 w1FIJPok089790; Thu, 15 Feb 2018 18:19:25 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1FIJPq3089789; Thu, 15 Feb 2018 18:19:25 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201802151819.w1FIJPq3089789@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Thu, 15 Feb 2018 18:19:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329330 - head/share/man/man9 X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/share/man/man9 X-SVN-Commit-Revision: 329330 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Feb 2018 18:19:25 -0000 Author: cem Date: Thu Feb 15 18:19:25 2018 New Revision: 329330 URL: https://svnweb.freebsd.org/changeset/base/329330 Log: pmap_qenter.9: Clarify that not all arch can map NX The goal is to use security features when architectures provide them. Reported by: kib Sponsored by: Dell EMC Isilon Modified: head/share/man/man9/pmap_qenter.9 Modified: head/share/man/man9/pmap_qenter.9 ============================================================================== --- head/share/man/man9/pmap_qenter.9 Thu Feb 15 18:16:16 2018 (r329329) +++ head/share/man/man9/pmap_qenter.9 Thu Feb 15 18:19:25 2018 (r329330) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 14, 2018 +.Dd February 15, 2018 .Dt PMAP_QENTER 9 .Os .Sh NAME @@ -50,7 +50,8 @@ pointers to wired pages and enters each of these pages into the kernel virtual address (KVA) space, beginning at the address .Fa sva . -The pages are mapped non-executable. +The pages are mapped non-executable, if possible. +(For example, non-PAE i386 has no capability to map pages non-executable.) .Pp The .Fn pmap_qremove From owner-svn-src-all@freebsd.org Thu Feb 15 18:26:46 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C558DF0ED00; Thu, 15 Feb 2018 18:26:45 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7845587DDA; Thu, 15 Feb 2018 18:26:45 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 72DC722590; Thu, 15 Feb 2018 18:26:45 +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 w1FIQjxS095389; Thu, 15 Feb 2018 18:26:45 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1FIQjxk095386; Thu, 15 Feb 2018 18:26:45 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201802151826.w1FIQjxk095386@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Thu, 15 Feb 2018 18:26:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329331 - head/usr.sbin/trpt X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/usr.sbin/trpt X-SVN-Commit-Revision: 329331 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Feb 2018 18:26:46 -0000 Author: cem Date: Thu Feb 15 18:26:45 2018 New Revision: 329331 URL: https://svnweb.freebsd.org/changeset/base/329331 Log: trpt(8): Fully remove and undocument '-t' option disabled in 1999 The relevant code was commented out in r50680. PR: 57045 Submitted by: Fernando Apesteguía Modified: head/usr.sbin/trpt/trpt.8 head/usr.sbin/trpt/trpt.c Modified: head/usr.sbin/trpt/trpt.8 ============================================================================== --- head/usr.sbin/trpt/trpt.8 Thu Feb 15 18:19:25 2018 (r329330) +++ head/usr.sbin/trpt/trpt.8 Thu Feb 15 18:26:45 2018 (r329331) @@ -28,7 +28,7 @@ .\" @(#)trpt.8 8.2 (Berkeley) 12/11/93 .\" $FreeBSD$ .\" -.Dd December 11, 1993 +.Dd February 15, 2018 .Dt TRPT 8 .Os .Sh NAME @@ -41,7 +41,6 @@ .Op Fl j .Op Fl p Ar hex-address .Op Fl s -.Op Fl t .Oo .Ar system Op Ar core .Oc @@ -86,10 +85,6 @@ control block at the given address In addition to the normal output, print a detailed description of the packet sequencing information. -.It Fl t -In addition to the normal output, -print the values for all timers at each -point in the trace. .El .Pp The recommended use of Modified: head/usr.sbin/trpt/trpt.c ============================================================================== --- head/usr.sbin/trpt/trpt.c Thu Feb 15 18:19:25 2018 (r329330) +++ head/usr.sbin/trpt/trpt.c Thu Feb 15 18:26:45 2018 (r329331) @@ -90,7 +90,7 @@ struct nlist nl[3]; static caddr_t tcp_pcbs[TCP_NDEBUG]; static n_time ntime; -static int aflag, kflag, memf, follow, sflag, tflag; +static int aflag, kflag, memf, follow, sflag; void dotrace(caddr_t); void klseek(int, off_t, int); @@ -108,7 +108,7 @@ main(int argc, char **argv) nl[1].n_name = strdup("_tcp_debx"); jflag = npcbs = 0; - while ((ch = getopt(argc, argv, "afjp:st")) != -1) + while ((ch = getopt(argc, argv, "afjp:s")) != -1) switch (ch) { case 'a': ++aflag; @@ -128,9 +128,6 @@ main(int argc, char **argv) case 's': ++sflag; break; - case 't': - ++tflag; - break; case '?': default: usage(); @@ -216,7 +213,7 @@ static void usage() { (void)fprintf(stderr, - "usage: trpt [-afjst] [-p hex-address] [system [core]]\n"); + "usage: trpt [-afjs] [-p hex-address] [system [core]]\n"); exit(1); } @@ -427,28 +424,6 @@ tcp_trace(short act, short ostate, struct tcpcb *tp, i (u_long)tp->snd_wl1, (u_long)tp->snd_wl2, (u_long)tp->snd_wnd); } - /* print out timers? */ -#if 0 - /* - * XXX - * kernel now uses callouts, not integer time values. - */ - if (tflag) { - register char *cp = "\t"; - register int i; - - for (i = 0; i < TCPT_NTIMERS; i++) { - if (tp->t_timer[i] == 0) - continue; - printf("%s%s=%d", cp, tcptimers[i], tp->t_timer[i]); - if (i == TCPT_REXMT) - printf(" (t_rxtshft=%d)", tp->t_rxtshift); - cp = ", "; - } - if (*cp != '\t') - putchar('\n'); - } -#endif } int From owner-svn-src-all@freebsd.org Thu Feb 15 18:31:44 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 93D01F0F3C5; Thu, 15 Feb 2018 18:31:44 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49DD8682E1; Thu, 15 Feb 2018 18:31:44 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 44CE7225F0; Thu, 15 Feb 2018 18:31:44 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1FIViL1097560; Thu, 15 Feb 2018 18:31:44 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1FIViw4097559; Thu, 15 Feb 2018 18:31:44 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201802151831.w1FIViw4097559@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Thu, 15 Feb 2018 18:31:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329332 - head/sys/compat/freebsd32 X-SVN-Group: head X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: head/sys/compat/freebsd32 X-SVN-Commit-Revision: 329332 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Feb 2018 18:31:44 -0000 Author: brooks Date: Thu Feb 15 18:31:43 2018 New Revision: 329332 URL: https://svnweb.freebsd.org/changeset/base/329332 Log: Remove freebsd32_getdirentries(), it will be unused after the next commit. Modified: head/sys/compat/freebsd32/freebsd32_misc.c Modified: head/sys/compat/freebsd32/freebsd32_misc.c ============================================================================== --- head/sys/compat/freebsd32/freebsd32_misc.c Thu Feb 15 18:26:45 2018 (r329331) +++ head/sys/compat/freebsd32/freebsd32_misc.c Thu Feb 15 18:31:43 2018 (r329332) @@ -1786,25 +1786,6 @@ freebsd11_freebsd32_getdents(struct thread *td, } #endif /* COMPAT_FREEBSD11 */ -int -freebsd32_getdirentries(struct thread *td, - struct freebsd32_getdirentries_args *uap) -{ - long base; - int32_t base32; - int error; - - error = kern_getdirentries(td, uap->fd, uap->buf, uap->count, &base, - NULL, UIO_USERSPACE); - if (error) - return (error); - if (uap->basep != NULL) { - base32 = base; - error = copyout(&base32, uap->basep, sizeof(int32_t)); - } - return (error); -} - #ifdef COMPAT_FREEBSD6 /* versions with the 'int pad' argument */ int From owner-svn-src-all@freebsd.org Thu Feb 15 18:32:12 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 574E2F0F476; Thu, 15 Feb 2018 18:32:12 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2D8156848B; Thu, 15 Feb 2018 18:32:12 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2878A2261A; Thu, 15 Feb 2018 18:32:12 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1FIWCPa098357; Thu, 15 Feb 2018 18:32:12 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1FIWBRX098350; Thu, 15 Feb 2018 18:32:11 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201802151832.w1FIWBRX098350@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Thu, 15 Feb 2018 18:32:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329333 - head/sys/compat/freebsd32 X-SVN-Group: head X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: head/sys/compat/freebsd32 X-SVN-Commit-Revision: 329333 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Feb 2018 18:32:12 -0000 Author: brooks Date: Thu Feb 15 18:32:11 2018 New Revision: 329333 URL: https://svnweb.freebsd.org/changeset/base/329333 Log: Regen after r329322. Modified: head/sys/compat/freebsd32/freebsd32_proto.h head/sys/compat/freebsd32/freebsd32_syscall.h head/sys/compat/freebsd32/freebsd32_syscalls.c head/sys/compat/freebsd32/freebsd32_sysent.c head/sys/compat/freebsd32/freebsd32_systrace_args.c Modified: head/sys/compat/freebsd32/freebsd32_proto.h ============================================================================== --- head/sys/compat/freebsd32/freebsd32_proto.h Thu Feb 15 18:31:43 2018 (r329332) +++ head/sys/compat/freebsd32/freebsd32_proto.h Thu Feb 15 18:32:11 2018 (r329333) @@ -680,12 +680,6 @@ struct freebsd32_fhstat_args { char u_fhp_l_[PADL_(const struct fhandle *)]; const struct fhandle * u_fhp; char u_fhp_r_[PADR_(const struct fhandle *)]; char sb_l_[PADL_(struct stat32 *)]; struct stat32 * sb; char sb_r_[PADR_(struct stat32 *)]; }; -struct freebsd32_getdirentries_args { - char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)]; - char buf_l_[PADL_(char *)]; char * buf; char buf_r_[PADR_(char *)]; - char count_l_[PADL_(size_t)]; size_t count; char count_r_[PADR_(size_t)]; - char basep_l_[PADL_(int32_t *)]; int32_t * basep; char basep_r_[PADR_(int32_t *)]; -}; struct freebsd32_kevent_args { char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)]; char changelist_l_[PADL_(const struct kevent32 *)]; const struct kevent32 * changelist; char changelist_r_[PADR_(const struct kevent32 *)]; @@ -840,7 +834,6 @@ int freebsd32_utimensat(struct thread *, struct freebs int freebsd32_fstat(struct thread *, struct freebsd32_fstat_args *); int freebsd32_fstatat(struct thread *, struct freebsd32_fstatat_args *); int freebsd32_fhstat(struct thread *, struct freebsd32_fhstat_args *); -int freebsd32_getdirentries(struct thread *, struct freebsd32_getdirentries_args *); int freebsd32_kevent(struct thread *, struct freebsd32_kevent_args *); int freebsd32_cpuset_getdomain(struct thread *, struct freebsd32_cpuset_getdomain_args *); int freebsd32_cpuset_setdomain(struct thread *, struct freebsd32_cpuset_setdomain_args *); @@ -1389,7 +1382,6 @@ int freebsd11_freebsd32_mknodat(struct thread *, struc #define FREEBSD32_SYS_AUE_freebsd32_fstat AUE_FSTAT #define FREEBSD32_SYS_AUE_freebsd32_fstatat AUE_FSTATAT #define FREEBSD32_SYS_AUE_freebsd32_fhstat AUE_FHSTAT -#define FREEBSD32_SYS_AUE_freebsd32_getdirentries AUE_GETDIRENTRIES #define FREEBSD32_SYS_AUE_freebsd32_kevent AUE_KEVENT #define FREEBSD32_SYS_AUE_freebsd32_cpuset_getdomain AUE_NULL #define FREEBSD32_SYS_AUE_freebsd32_cpuset_setdomain AUE_NULL Modified: head/sys/compat/freebsd32/freebsd32_syscall.h ============================================================================== --- head/sys/compat/freebsd32/freebsd32_syscall.h Thu Feb 15 18:31:43 2018 (r329332) +++ head/sys/compat/freebsd32/freebsd32_syscall.h Thu Feb 15 18:32:11 2018 (r329333) @@ -459,7 +459,7 @@ #define FREEBSD32_SYS_freebsd32_fstat 551 #define FREEBSD32_SYS_freebsd32_fstatat 552 #define FREEBSD32_SYS_freebsd32_fhstat 553 -#define FREEBSD32_SYS_freebsd32_getdirentries 554 +#define FREEBSD32_SYS_getdirentries 554 #define FREEBSD32_SYS_statfs 555 #define FREEBSD32_SYS_fstatfs 556 #define FREEBSD32_SYS_getfsstat 557 Modified: head/sys/compat/freebsd32/freebsd32_syscalls.c ============================================================================== --- head/sys/compat/freebsd32/freebsd32_syscalls.c Thu Feb 15 18:31:43 2018 (r329332) +++ head/sys/compat/freebsd32/freebsd32_syscalls.c Thu Feb 15 18:32:11 2018 (r329333) @@ -586,7 +586,7 @@ const char *freebsd32_syscallnames[] = { "freebsd32_fstat", /* 551 = freebsd32_fstat */ "freebsd32_fstatat", /* 552 = freebsd32_fstatat */ "freebsd32_fhstat", /* 553 = freebsd32_fhstat */ - "freebsd32_getdirentries", /* 554 = freebsd32_getdirentries */ + "getdirentries", /* 554 = getdirentries */ "statfs", /* 555 = statfs */ "fstatfs", /* 556 = fstatfs */ "getfsstat", /* 557 = getfsstat */ Modified: head/sys/compat/freebsd32/freebsd32_sysent.c ============================================================================== --- head/sys/compat/freebsd32/freebsd32_sysent.c Thu Feb 15 18:31:43 2018 (r329332) +++ head/sys/compat/freebsd32/freebsd32_sysent.c Thu Feb 15 18:32:11 2018 (r329333) @@ -635,7 +635,7 @@ struct sysent freebsd32_sysent[] = { { AS(freebsd32_fstat_args), (sy_call_t *)freebsd32_fstat, AUE_FSTAT, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 551 = freebsd32_fstat */ { AS(freebsd32_fstatat_args), (sy_call_t *)freebsd32_fstatat, AUE_FSTATAT, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 552 = freebsd32_fstatat */ { AS(freebsd32_fhstat_args), (sy_call_t *)freebsd32_fhstat, AUE_FHSTAT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 553 = freebsd32_fhstat */ - { AS(freebsd32_getdirentries_args), (sy_call_t *)freebsd32_getdirentries, AUE_GETDIRENTRIES, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 554 = freebsd32_getdirentries */ + { AS(getdirentries_args), (sy_call_t *)sys_getdirentries, AUE_GETDIRENTRIES, NULL, 0, 0, 0, SY_THR_STATIC }, /* 554 = getdirentries */ { AS(statfs_args), (sy_call_t *)sys_statfs, AUE_STATFS, NULL, 0, 0, 0, SY_THR_STATIC }, /* 555 = statfs */ { AS(fstatfs_args), (sy_call_t *)sys_fstatfs, AUE_FSTATFS, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 556 = fstatfs */ { AS(getfsstat_args), (sy_call_t *)sys_getfsstat, AUE_GETFSSTAT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 557 = getfsstat */ Modified: head/sys/compat/freebsd32/freebsd32_systrace_args.c ============================================================================== --- head/sys/compat/freebsd32/freebsd32_systrace_args.c Thu Feb 15 18:31:43 2018 (r329332) +++ head/sys/compat/freebsd32/freebsd32_systrace_args.c Thu Feb 15 18:32:11 2018 (r329333) @@ -3183,13 +3183,13 @@ systrace_args(int sysnum, void *params, uint64_t *uarg *n_args = 2; break; } - /* freebsd32_getdirentries */ + /* getdirentries */ case 554: { - struct freebsd32_getdirentries_args *p = params; + struct getdirentries_args *p = params; iarg[0] = p->fd; /* int */ uarg[1] = (intptr_t) p->buf; /* char * */ uarg[2] = p->count; /* size_t */ - uarg[3] = (intptr_t) p->basep; /* int32_t * */ + uarg[3] = (intptr_t) p->basep; /* off_t * */ *n_args = 4; break; } @@ -8626,7 +8626,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *d break; }; break; - /* freebsd32_getdirentries */ + /* getdirentries */ case 554: switch(ndx) { case 0: @@ -8639,7 +8639,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *d p = "size_t"; break; case 3: - p = "userland int32_t *"; + p = "userland off_t *"; break; default: break; @@ -10606,7 +10606,7 @@ systrace_return_setargdesc(int sysnum, int ndx, char * if (ndx == 0 || ndx == 1) p = "int"; break; - /* freebsd32_getdirentries */ + /* getdirentries */ case 554: if (ndx == 0 || ndx == 1) p = "ssize_t"; From owner-svn-src-all@freebsd.org Thu Feb 15 18:37:33 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A004BF0FA71; Thu, 15 Feb 2018 18:37:33 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4E0E8689C1; Thu, 15 Feb 2018 18:37:33 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 490B022752; Thu, 15 Feb 2018 18:37:33 +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 w1FIbXsa001595; Thu, 15 Feb 2018 18:37:33 GMT (envelope-from dteske@FreeBSD.org) Received: (from dteske@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1FIbXbI001594; Thu, 15 Feb 2018 18:37:33 GMT (envelope-from dteske@FreeBSD.org) Message-Id: <201802151837.w1FIbXbI001594@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dteske set sender to dteske@FreeBSD.org using -f From: Devin Teske Date: Thu, 15 Feb 2018 18:37:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329334 - head/cddl/lib/libdtrace X-SVN-Group: head X-SVN-Commit-Author: dteske X-SVN-Commit-Paths: head/cddl/lib/libdtrace X-SVN-Commit-Revision: 329334 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Feb 2018 18:37:33 -0000 Author: dteske Date: Thu Feb 15 18:37:32 2018 New Revision: 329334 URL: https://svnweb.freebsd.org/changeset/base/329334 Log: Add the following errno definitions to /usr/lib/dtrace/errno.d ENOTCAPABLE (93) ECAPMODE (94) ENOTRECOVERABLE (95) EOWNERDEAD (96) ERELOOKUP (-5) and update ELAST (92 -> 96) Reviewed by: markj Sponsored by: Smule, Inc. Differential Revision: https://reviews.freebsd.org/D14340 Modified: head/cddl/lib/libdtrace/errno.d Modified: head/cddl/lib/libdtrace/errno.d ============================================================================== --- head/cddl/lib/libdtrace/errno.d Thu Feb 15 18:32:11 2018 (r329333) +++ head/cddl/lib/libdtrace/errno.d Thu Feb 15 18:37:32 2018 (r329334) @@ -216,7 +216,15 @@ inline int ENOLINK = 91; #pragma D binding "1.0" ENOLINK inline int EPROTO = 92; #pragma D binding "1.0" EPROTO -inline int ELAST = 92; +inline int ENOTCAPABLE = 93; +#pragma D binding "1.13" ENOTCAPABLE +inline int ECAPMODE = 94; +#pragma D binding "1.13" ECAPMODE +inline int ENOTRECOVERABLE = 95; +#pragma D binding "1.13" ENOTRECOVERABLE +inline int EOWNERDEAD = 96; +#pragma D binding "1.13" EOWNERDEAD +inline int ELAST = 96; #pragma D binding "1.0" ELAST inline int ERESTART = -1; #pragma D binding "1.0" ERESTART @@ -226,3 +234,5 @@ inline int ENOIOCTL = -3; #pragma D binding "1.0" ENOIOCTL inline int EDIRIOCTL = -4; #pragma D binding "1.0" EDIRIOCTL +inline int ERELOOKUP = -5; +#pragma D binding "1.13" ERELOOKUP From owner-svn-src-all@freebsd.org Thu Feb 15 18:39:44 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7EC55F0FCFA; Thu, 15 Feb 2018 18:39:44 +0000 (UTC) (envelope-from shurd@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2FC9A68C99; Thu, 15 Feb 2018 18:39:44 +0000 (UTC) (envelope-from shurd@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2ACFB2275C; Thu, 15 Feb 2018 18:39:44 +0000 (UTC) (envelope-from shurd@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1FIdigL002043; Thu, 15 Feb 2018 18:39:44 GMT (envelope-from shurd@FreeBSD.org) Received: (from shurd@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1FIdiND002042; Thu, 15 Feb 2018 18:39:44 GMT (envelope-from shurd@FreeBSD.org) Message-Id: <201802151839.w1FIdiND002042@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: shurd set sender to shurd@FreeBSD.org using -f From: Stephen Hurd Date: Thu, 15 Feb 2018 18:39:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329335 - head/share/man/man4 X-SVN-Group: head X-SVN-Commit-Author: shurd X-SVN-Commit-Paths: head/share/man/man4 X-SVN-Commit-Revision: 329335 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Feb 2018 18:39:44 -0000 Author: shurd Date: Thu Feb 15 18:39:43 2018 New Revision: 329335 URL: https://svnweb.freebsd.org/changeset/base/329335 Log: bnxt: Update man page with newly supported devices, options, etc update man page with * Newly supported devices * Newly added options * 'maintained by' Email ID Submitted by: Siva Kallam Reviewed by: shurd, sbruno Approved by: shurd Sponsored by: Broadcom Limited Differential Revision: https://reviews.freebsd.org/D13982 Modified: head/share/man/man4/bnxt.4 Modified: head/share/man/man4/bnxt.4 ============================================================================== --- head/share/man/man4/bnxt.4 Thu Feb 15 18:37:32 2018 (r329334) +++ head/share/man/man4/bnxt.4 Thu Feb 15 18:39:43 2018 (r329335) @@ -68,25 +68,41 @@ Broadcom BCM57302 NetXtreme-C 10Gb/25Gb Ethernet Contr .It Broadcom BCM57304 NetXtreme-C 10Gb/25Gb/40Gb/50Gb Ethernet Controller .It -Broadcom BCM57402 NetXtreme-E 10Gb Ethernet Controller +Broadcom BCM57304 NetXtreme-C Ethernet Virtual Function .It -Broadcom BCM57404 NetXtreme-E 10Gb/25Gb Ethernet Controller +Broadcom BCM57314 NetXtreme-C Ethernet Virtual Function .It -Broadcom BCM57406 NetXtreme-E 10GBase-T Ethernet Controller +Broadcom BCM57402 NetXtreme-E 10Gb Ethernet Controller .It -Broadcom BCM57402 NetXtreme-E Partition +Broadcom BCM57402 NetXtreme-E Ethernet Partition .It -Broadcom BCM57407 NetXtreme-E 10GBase-T Ethernet Controller +Broadcom BCM57404 NetXtreme-E 10Gb/25Gb Ethernet Controller .It +Broadcom BCM57404 NetXtreme-E Ethernet Virtual Function +.It Broadcom BCM57404 NetXtreme-E Partition .It +Broadcom BCM57406 NetXtreme-E 10GBASE-T Ethernet Controller +.It Broadcom BCM57406 NetXtreme-E Partition .It +Broadcom BCM57407 NetXtreme-E 10GBase-T Ethernet Controller +.It Broadcom BCM57407 NetXtreme-E 25Gb Ethernet Controller .It -Broadcom BCM57304 NetXtreme-C Virtual Function +Broadcom BCM57407 NetXtreme-E Partition .It -Broadcom BCM57404 NetXtreme-E Virtual Function +Broadcom BCM57412 NetXtreme-E Partition +.It +Broadcom BCM57414 NetXtreme-E Ethernet Virtual Function +.It +Broadcom BCM57414 NetXtreme-E Partition +.It +Broadcom BCM57416 NetXtreme-E Partition +.It +Broadcom BCM57417 NetXtreme-E Ethernet Partition +.It +Broadcom BCM57454 NetXtreme-E 10Gb/25Gb/40Gb/50Gb/100Gb Ethernet .El .Sh SYSCTL VARIABLES These variables must be set before loading the driver, either via @@ -181,11 +197,20 @@ Supported HWRM API version of the currently running fi HWRM API version the driver was built to support. .It Va dev.bnxt.X.hwstats.* Per-queue statistics tracked by the hardware. +.It Va dev.bnxt.X.hwstats.port_stats.* +Per-port statistics tracked by the hardware. .It Va dev.bnxt.X.hwstats.rxq0.drop_pkts Number of packets dropped by hardware on queue zero. This number might seem high, but the count includes packets dropped due to incorrect destination MAC, unsubscribed multicast address, and other normal reasons to ignore Ethernet frames. +.It Va dev.bnxt.X.hwstats.rxq0.tpa_* +statistics related to HW LRO. +.It Va dev.bnxt.X.hw_lro.* +Enable / Disable HW LRO feature. Defaults to disable. +Enabling HW LRO could cause issues when forwarding is enabled on host. +.It Va dev.bnxt.X.fc +Enable / Disable Flow Control feature. Defaults to Enable .El .Sh DIAGNOSTICS .Bl -diag @@ -219,6 +244,8 @@ device driver first appeared in The .Nm driver was written by -.An Jack Vogel Aq Mt jfvogel@gmail.com , +.An Jack Vogel Aq Mt jfvogel@gmail.com +and +.An Stephen Hurd Aq Mt shurd@freebsd.org , and is currently maintained by -.An Stephen Hurd Aq Mt stephen.hurd@broadcom.com . +.An Broadcom Limited Aq Mt freebsd.pdl@broadcom.com . From owner-svn-src-all@freebsd.org Thu Feb 15 18:57:23 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E1C50F11256; Thu, 15 Feb 2018 18:57:22 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8928E6A0F4; Thu, 15 Feb 2018 18:57:22 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6587822ADD; Thu, 15 Feb 2018 18:57:22 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1FIvMBx013915; Thu, 15 Feb 2018 18:57:22 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1FIvMS7013914; Thu, 15 Feb 2018 18:57:22 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201802151857.w1FIvMS7013914@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Thu, 15 Feb 2018 18:57:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329336 - head/sys/security/mac X-SVN-Group: head X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: head/sys/security/mac X-SVN-Commit-Revision: 329336 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Feb 2018 18:57:23 -0000 Author: brooks Date: Thu Feb 15 18:57:22 2018 New Revision: 329336 URL: https://svnweb.freebsd.org/changeset/base/329336 Log: Reduce duplication in __mac_*_(file|link)(2) implementation. Reviewed by: rwatson Obtained from: CheriBSD Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D14175 Modified: head/sys/security/mac/mac_syscalls.c Modified: head/sys/security/mac/mac_syscalls.c ============================================================================== --- head/sys/security/mac/mac_syscalls.c Thu Feb 15 18:39:43 2018 (r329335) +++ head/sys/security/mac/mac_syscalls.c Thu Feb 15 18:57:22 2018 (r329336) @@ -76,6 +76,11 @@ __FBSDID("$FreeBSD$"); FEATURE(security_mac, "Mandatory Access Control Framework support"); +static int kern___mac_get_path(struct thread *td, const char *path_p, + struct mac *mac_p, int follow); +static int kern___mac_set_path(struct thread *td, const char *path_p, + struct mac *mac_p, int follow); + int sys___mac_get_pid(struct thread *td, struct __mac_get_pid_args *uap) { @@ -315,57 +320,21 @@ out: int sys___mac_get_file(struct thread *td, struct __mac_get_file_args *uap) { - char *elements, *buffer; - struct nameidata nd; - struct label *intlabel; - struct mac mac; - int error; - if (!(mac_labeled & MPC_OBJECT_VNODE)) - return (EINVAL); - - error = copyin(uap->mac_p, &mac, sizeof(mac)); - if (error) - return (error); - - error = mac_check_structmac_consistent(&mac); - if (error) - return (error); - - elements = malloc(mac.m_buflen, M_MACTEMP, M_WAITOK); - error = copyinstr(mac.m_string, elements, mac.m_buflen, NULL); - if (error) { - free(elements, M_MACTEMP); - return (error); - } - - buffer = malloc(mac.m_buflen, M_MACTEMP, M_WAITOK | M_ZERO); - NDINIT(&nd, LOOKUP, LOCKLEAF | FOLLOW, UIO_USERSPACE, - uap->path_p, td); - error = namei(&nd); - if (error) - goto out; - - intlabel = mac_vnode_label_alloc(); - mac_vnode_copy_label(nd.ni_vp->v_label, intlabel); - error = mac_vnode_externalize_label(intlabel, elements, buffer, - mac.m_buflen); - - NDFREE(&nd, 0); - mac_vnode_label_free(intlabel); - if (error == 0) - error = copyout(buffer, mac.m_string, strlen(buffer)+1); - -out: - free(buffer, M_MACTEMP); - free(elements, M_MACTEMP); - - return (error); + return (kern___mac_get_path(td, uap->path_p, uap->mac_p, FOLLOW)); } int sys___mac_get_link(struct thread *td, struct __mac_get_link_args *uap) { + + return (kern___mac_get_path(td, uap->path_p, uap->mac_p, NOFOLLOW)); +} + +static int +kern___mac_get_path(struct thread *td, const char *path_p, struct mac *mac_p, + int follow) +{ char *elements, *buffer; struct nameidata nd; struct label *intlabel; @@ -375,7 +344,7 @@ sys___mac_get_link(struct thread *td, struct __mac_get if (!(mac_labeled & MPC_OBJECT_VNODE)) return (EINVAL); - error = copyin(uap->mac_p, &mac, sizeof(mac)); + error = copyin(mac_p, &mac, sizeof(mac)); if (error) return (error); @@ -391,8 +360,7 @@ sys___mac_get_link(struct thread *td, struct __mac_get } buffer = malloc(mac.m_buflen, M_MACTEMP, M_WAITOK | M_ZERO); - NDINIT(&nd, LOOKUP, LOCKLEAF | NOFOLLOW, UIO_USERSPACE, - uap->path_p, td); + NDINIT(&nd, LOOKUP, LOCKLEAF | follow, UIO_USERSPACE, path_p, td); error = namei(&nd); if (error) goto out; @@ -518,58 +486,21 @@ out: int sys___mac_set_file(struct thread *td, struct __mac_set_file_args *uap) { - struct label *intlabel; - struct nameidata nd; - struct mount *mp; - struct mac mac; - char *buffer; - int error; - if (!(mac_labeled & MPC_OBJECT_VNODE)) - return (EINVAL); - - error = copyin(uap->mac_p, &mac, sizeof(mac)); - if (error) - return (error); - - error = mac_check_structmac_consistent(&mac); - if (error) - return (error); - - buffer = malloc(mac.m_buflen, M_MACTEMP, M_WAITOK); - error = copyinstr(mac.m_string, buffer, mac.m_buflen, NULL); - if (error) { - free(buffer, M_MACTEMP); - return (error); - } - - intlabel = mac_vnode_label_alloc(); - error = mac_vnode_internalize_label(intlabel, buffer); - free(buffer, M_MACTEMP); - if (error) - goto out; - - NDINIT(&nd, LOOKUP, LOCKLEAF | FOLLOW, UIO_USERSPACE, - uap->path_p, td); - error = namei(&nd); - if (error == 0) { - error = vn_start_write(nd.ni_vp, &mp, V_WAIT | PCATCH); - if (error == 0) { - error = vn_setlabel(nd.ni_vp, intlabel, - td->td_ucred); - vn_finished_write(mp); - } - } - - NDFREE(&nd, 0); -out: - mac_vnode_label_free(intlabel); - return (error); + return (kern___mac_set_path(td, uap->path_p, uap->mac_p, FOLLOW)); } int sys___mac_set_link(struct thread *td, struct __mac_set_link_args *uap) { + + return (kern___mac_set_path(td, uap->path_p, uap->mac_p, NOFOLLOW)); +} + +static int +kern___mac_set_path(struct thread *td, const char *path_p, struct mac *mac_p, + int follow) +{ struct label *intlabel; struct nameidata nd; struct mount *mp; @@ -580,7 +511,7 @@ sys___mac_set_link(struct thread *td, struct __mac_set if (!(mac_labeled & MPC_OBJECT_VNODE)) return (EINVAL); - error = copyin(uap->mac_p, &mac, sizeof(mac)); + error = copyin(mac_p, &mac, sizeof(mac)); if (error) return (error); @@ -601,8 +532,7 @@ sys___mac_set_link(struct thread *td, struct __mac_set if (error) goto out; - NDINIT(&nd, LOOKUP, LOCKLEAF | NOFOLLOW, UIO_USERSPACE, - uap->path_p, td); + NDINIT(&nd, LOOKUP, LOCKLEAF | follow, UIO_USERSPACE, path_p, td); error = namei(&nd); if (error == 0) { error = vn_start_write(nd.ni_vp, &mp, V_WAIT | PCATCH); From owner-svn-src-all@freebsd.org Thu Feb 15 18:57:55 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 15F49F11362; Thu, 15 Feb 2018 18:57:55 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BD4716A243; Thu, 15 Feb 2018 18:57:54 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B856222AE2; Thu, 15 Feb 2018 18:57:54 +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 w1FIvsJn014040; Thu, 15 Feb 2018 18:57:54 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1FIvsqS014039; Thu, 15 Feb 2018 18:57:54 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201802151857.w1FIvsqS014039@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Thu, 15 Feb 2018 18:57:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329337 - head/sys/cam X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/cam X-SVN-Commit-Revision: 329337 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Feb 2018 18:57:55 -0000 Author: imp Date: Thu Feb 15 18:57:54 2018 New Revision: 329337 URL: https://svnweb.freebsd.org/changeset/base/329337 Log: Report the number of remaining retries when we have an error that we're retrying. Modified: head/sys/cam/cam_periph.c Modified: head/sys/cam/cam_periph.c ============================================================================== --- head/sys/cam/cam_periph.c Thu Feb 15 18:57:22 2018 (r329336) +++ head/sys/cam/cam_periph.c Thu Feb 15 18:57:54 2018 (r329337) @@ -1911,8 +1911,11 @@ cam_periph_error(union ccb *ccb, cam_flags camflags, error, action_string); } else if (action_string != NULL) xpt_print(ccb->ccb_h.path, "%s\n", action_string); - else - xpt_print(ccb->ccb_h.path, "Retrying command\n"); + else { + xpt_print(ccb->ccb_h.path, + "Retrying command, %d more tries remain\n", + ccb->ccb_h.retry_count); + } } if (devctl_err && (error != 0 || (action & SSQ_PRINT_SENSE) != 0)) From owner-svn-src-all@freebsd.org Thu Feb 15 18:58:06 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1809AF113C5; Thu, 15 Feb 2018 18:58:06 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 815476A38A; Thu, 15 Feb 2018 18:58:04 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DB32422AE5; Thu, 15 Feb 2018 18:58:03 +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 w1FIw37B014248; Thu, 15 Feb 2018 18:58:03 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1FIw39O014247; Thu, 15 Feb 2018 18:58:03 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201802151858.w1FIw39O014247@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Thu, 15 Feb 2018 18:58:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329338 - head/tools/boot X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/tools/boot X-SVN-Commit-Revision: 329338 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Feb 2018 18:58:06 -0000 Author: imp Date: Thu Feb 15 18:58:03 2018 New Revision: 329338 URL: https://svnweb.freebsd.org/changeset/base/329338 Log: Simplify building before installing. Modified: head/tools/boot/lua-img.sh Modified: head/tools/boot/lua-img.sh ============================================================================== --- head/tools/boot/lua-img.sh Thu Feb 15 18:57:54 2018 (r329337) +++ head/tools/boot/lua-img.sh Thu Feb 15 18:58:03 2018 (r329338) @@ -20,7 +20,6 @@ mkdir -p ${dir} mtree -deUW -f etc/mtree/BSD.root.dist -p ${dir} mtree -deUW -f etc/mtree/BSD.usr.dist -p ${dir}/usr cd stand -make MK_LOADER_LUA=yes MK_FORTH=no -make install DESTDIR=${dir} NO_ROOT=t MK_LOADER_LUA=yes MK_FORTH=no MK_INSTALL_AS_USER=yes +make all install DESTDIR=${dir} NO_ROOT=t MK_LOADER_LUA=yes MK_FORTH=no MK_INSTALL_AS_USER=yes mkdir -p ${dir}/boot/kernel cp /boot/kernel/kernel ${dir}/boot/kernel From owner-svn-src-all@freebsd.org Thu Feb 15 19:49:16 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A066DF14D19; Thu, 15 Feb 2018 19:49:16 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4E4DD6CA38; Thu, 15 Feb 2018 19:49:16 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4531223330; Thu, 15 Feb 2018 19:49:16 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1FJnG1T044420; Thu, 15 Feb 2018 19:49:16 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1FJnFS4044411; Thu, 15 Feb 2018 19:49:15 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201802151949.w1FJnFS4044411@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 15 Feb 2018 19:49:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329339 - head/stand/libsa X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/stand/libsa X-SVN-Commit-Revision: 329339 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Feb 2018 19:49:16 -0000 Author: kevans Date: Thu Feb 15 19:49:15 2018 New Revision: 329339 URL: https://svnweb.freebsd.org/changeset/base/329339 Log: libsa: Consolidate tftp sendrecv into net.c sendrecv bootp/arp/rarp/rpc all use the sendrecv implementation in net.c. tftp has its own implementation because it passes an extra parameter into the recv callback for the received payload type to be held. These sendrecv implementations are otherwise equivalent, so consolidate them. The other users of sendrecv won't be using the extra argument to recv, but this gives us only one place to worry about respecting timeouts and one consistent timeout behavior. Tested by: sbruno Reviewed by: sbruno, tsoome MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D14373 Modified: head/stand/libsa/arp.c head/stand/libsa/bootp.c head/stand/libsa/net.c head/stand/libsa/net.h head/stand/libsa/rarp.c head/stand/libsa/rpc.c head/stand/libsa/tftp.c Modified: head/stand/libsa/arp.c ============================================================================== --- head/stand/libsa/arp.c Thu Feb 15 18:58:03 2018 (r329338) +++ head/stand/libsa/arp.c Thu Feb 15 19:49:15 2018 (r329339) @@ -65,7 +65,7 @@ int arp_num = 1; /* Local forwards */ static ssize_t arpsend(struct iodesc *, void *, size_t); -static ssize_t arprecv(struct iodesc *, void **, void **, time_t); +static ssize_t arprecv(struct iodesc *, void **, void **, time_t, void *); /* Broadcast an ARP packet, asking who has addr on interface d */ u_char * @@ -118,7 +118,7 @@ arpwhohas(struct iodesc *d, struct in_addr addr) ah = NULL; i = sendrecv(d, arpsend, &wbuf.data, sizeof(wbuf.data), - arprecv, &pkt, (void **)&ah); + arprecv, &pkt, (void **)&ah, NULL); if (i == -1) { panic("arp: no response for %s\n", inet_ntoa(addr)); @@ -160,7 +160,7 @@ arpsend(struct iodesc *d, void *pkt, size_t len) * else -1 (and errno == 0) */ static ssize_t -arprecv(struct iodesc *d, void **pkt, void **payload, time_t tleft) +arprecv(struct iodesc *d, void **pkt, void **payload, time_t tleft, void *extra) { ssize_t n; struct ether_arp *ah; Modified: head/stand/libsa/bootp.c ============================================================================== --- head/stand/libsa/bootp.c Thu Feb 15 18:58:03 2018 (r329338) +++ head/stand/libsa/bootp.c Thu Feb 15 19:49:15 2018 (r329339) @@ -73,7 +73,7 @@ static char vm_cmu[4] = VM_CMU; /* Local forwards */ static ssize_t bootpsend(struct iodesc *, void *, size_t); -static ssize_t bootprecv(struct iodesc *, void **, void **, time_t); +static ssize_t bootprecv(struct iodesc *, void **, void **, time_t, void *); static int vend_rfc1048(u_char *, u_int); #ifdef BOOTP_VEND_CMU static void vend_cmu(u_char *); @@ -183,7 +183,7 @@ bootp(int sock) if(sendrecv(d, bootpsend, bp, sizeof(*bp), - bootprecv, &pkt, (void **)&rbootp) == -1) { + bootprecv, &pkt, (void **)&rbootp, NULL) == -1) { printf("bootp: no reply\n"); return; } @@ -209,7 +209,7 @@ bootp(int sock) free(pkt); if(sendrecv(d, bootpsend, bp, sizeof(*bp), - bootprecv, &pkt, (void **)&rbootp) == -1) { + bootprecv, &pkt, (void **)&rbootp, NULL) == -1) { printf("DHCPREQUEST failed\n"); return; } @@ -286,7 +286,8 @@ bootpsend(struct iodesc *d, void *pkt, size_t len) } static ssize_t -bootprecv(struct iodesc *d, void **pkt, void **payload, time_t tleft) +bootprecv(struct iodesc *d, void **pkt, void **payload, time_t tleft, + void *extra) { ssize_t n; struct bootp *bp; Modified: head/stand/libsa/net.c ============================================================================== --- head/stand/libsa/net.c Thu Feb 15 18:58:03 2018 (r329338) +++ head/stand/libsa/net.c Thu Feb 15 19:49:15 2018 (r329339) @@ -72,8 +72,8 @@ ssize_t sendrecv(struct iodesc *d, ssize_t (*sproc)(struct iodesc *, void *, size_t), void *sbuf, size_t ssize, - ssize_t (*rproc)(struct iodesc *, void **, void **, time_t), - void **pkt, void **payload) + ssize_t (*rproc)(struct iodesc *, void **, void **, time_t, void *), + void **pkt, void **payload, void *recv_extra) { ssize_t cc; time_t t, tmo, tlast; @@ -116,7 +116,7 @@ sendrecv(struct iodesc *d, } /* Try to get a packet and process it. */ - cc = (*rproc)(d, pkt, payload, tleft); + cc = (*rproc)(d, pkt, payload, tleft, recv_extra); /* Return on data, EOF or real error. */ if (cc != -1 || (errno != 0 && errno != ETIMEDOUT)) return (cc); Modified: head/stand/libsa/net.h ============================================================================== --- head/stand/libsa/net.h Thu Feb 15 18:58:03 2018 (r329338) +++ head/stand/libsa/net.h Thu Feb 15 19:49:15 2018 (r329339) @@ -115,8 +115,9 @@ ssize_t readudp(struct iodesc *, void **, void **, tim ssize_t sendrecv(struct iodesc *, ssize_t (*)(struct iodesc *, void *, size_t), void *, size_t, - ssize_t (*)(struct iodesc *, void **, void **, time_t), - void **, void **); + ssize_t (*)(struct iodesc *, void **, void **, time_t, + void *), + void **, void **, void *); /* bootp/DHCP */ void bootp(int); Modified: head/stand/libsa/rarp.c ============================================================================== --- head/stand/libsa/rarp.c Thu Feb 15 18:58:03 2018 (r329338) +++ head/stand/libsa/rarp.c Thu Feb 15 19:49:15 2018 (r329339) @@ -54,7 +54,7 @@ __FBSDID("$FreeBSD$"); static ssize_t rarpsend(struct iodesc *, void *, size_t); -static ssize_t rarprecv(struct iodesc *, void **, void **, time_t); +static ssize_t rarprecv(struct iodesc *, void **, void **, time_t, void *); /* * Ethernet (Reverse) Address Resolution Protocol (see RFC 903, and 826). @@ -99,7 +99,7 @@ rarp_getipaddress(int sock) if (sendrecv(d, rarpsend, &wbuf.data, sizeof(wbuf.data), - rarprecv, &pkt, (void *)&ap) < 0) { + rarprecv, &pkt, (void *)&ap, NULL) < 0) { printf("No response for RARP request\n"); return (-1); } @@ -143,7 +143,8 @@ rarpsend(struct iodesc *d, void *pkt, size_t len) * else -1 (and errno == 0) */ static ssize_t -rarprecv(struct iodesc *d, void **pkt, void **payload, time_t tleft) +rarprecv(struct iodesc *d, void **pkt, void **payload, time_t tleft, + void *extra) { ssize_t n; struct ether_arp *ap; Modified: head/stand/libsa/rpc.c ============================================================================== --- head/stand/libsa/rpc.c Thu Feb 15 18:58:03 2018 (r329338) +++ head/stand/libsa/rpc.c Thu Feb 15 19:49:15 2018 (r329339) @@ -97,7 +97,7 @@ struct rpc_reply { }; /* Local forwards */ -static ssize_t recvrpc(struct iodesc *, void **, void **, time_t); +static ssize_t recvrpc(struct iodesc *, void **, void **, time_t, void *); static int rpc_getport(struct iodesc *, n_long, n_long); int rpc_xid; @@ -167,7 +167,7 @@ rpc_call(struct iodesc *d, n_long prog, n_long vers, n ptr = NULL; cc = sendrecv(d, sendudp, send_head, send_tail - send_head, - recvrpc, &ptr, (void **)&reply); + recvrpc, &ptr, (void **)&reply, NULL); #ifdef RPC_DEBUG if (debug) @@ -217,7 +217,7 @@ rpc_call(struct iodesc *d, n_long prog, n_long vers, n * Remaining checks are done by callrpc */ static ssize_t -recvrpc(struct iodesc *d, void **pkt, void **payload, time_t tleft) +recvrpc(struct iodesc *d, void **pkt, void **payload, time_t tleft, void *extra) { void *ptr; struct rpc_reply *reply; Modified: head/stand/libsa/tftp.c ============================================================================== --- head/stand/libsa/tftp.c Thu Feb 15 18:58:03 2018 (r329338) +++ head/stand/libsa/tftp.c Thu Feb 15 19:49:15 2018 (r329339) @@ -61,7 +61,10 @@ __FBSDID("$FreeBSD$"); #include "tftp.h" struct tftp_handle; +struct tftprecv_extra; +static ssize_t recvtftp(struct iodesc *d, void **pkt, void **payload, + time_t tleft, void *recv_extra); static int tftp_open(const char *path, struct open_file *f); static int tftp_close(struct open_file *f); static int tftp_parse_oack(struct tftp_handle *h, char *buf, size_t len); @@ -70,11 +73,6 @@ static int tftp_write(struct open_file *f, void *buf, static off_t tftp_seek(struct open_file *f, off_t offset, int where); static int tftp_set_blksize(struct tftp_handle *h, const char *str); static int tftp_stat(struct open_file *f, struct stat *sb); -static ssize_t sendrecv_tftp(struct tftp_handle *h, - ssize_t (*sproc)(struct iodesc *, void *, size_t), - void *sbuf, size_t ssize, - ssize_t (*rproc)(struct tftp_handle *h, void **, void **, time_t, unsigned short *), - void **, void **, unsigned short *rtype); struct fs_ops tftp_fsops = { "tftp", @@ -118,6 +116,11 @@ struct tftp_handle { struct tftphdr *tftp_hdr; }; +struct tftprecv_extra { + struct tftp_handle *tftp_handle; + unsigned short rtype; /* Received type */ +}; + #define TFTP_MAX_ERRCODE EOPTNEG static const int tftperrors[TFTP_MAX_ERRCODE + 1] = { 0, /* ??? */ @@ -178,15 +181,19 @@ tftp_sendack(struct tftp_handle *h) } static ssize_t -recvtftp(struct tftp_handle *h, void **pkt, void **payload, time_t tleft, - unsigned short *rtype) +recvtftp(struct iodesc *d, void **pkt, void **payload, time_t tleft, + void *recv_extra) { - struct iodesc *d = h->iodesc; + struct tftprecv_extra *extra; + struct tftp_handle *h; struct tftphdr *t; + unsigned short *rtype; void *ptr = NULL; ssize_t len; errno = 0; + extra = (struct tftprecv_extra *)recv_extra; + h = extra->tftp_handle; len = readudp(d, &ptr, (void **)&t, tleft); @@ -195,7 +202,7 @@ recvtftp(struct tftp_handle *h, void **pkt, void **pay return (-1); } - *rtype = ntohs(t->th_opcode); + extra->rtype = ntohs(t->th_opcode); switch (ntohs(t->th_opcode)) { case DATA: { int got; @@ -282,6 +289,7 @@ tftp_makereq(struct tftp_handle *h) struct tftphdr t; u_char space[FNAME_SIZE + 6]; } __packed __aligned(4) wbuf; + struct tftprecv_extra recv_extra; char *wtail; int l; ssize_t res; @@ -289,7 +297,6 @@ tftp_makereq(struct tftp_handle *h) struct tftphdr *t; char *tftp_blksize = NULL; int blksize_l; - unsigned short rtype = 0; /* * Allow overriding default TFTP block size by setting @@ -334,8 +341,9 @@ tftp_makereq(struct tftp_handle *h) h->validsize = 0; pkt = NULL; - res = sendrecv_tftp(h, &sendudp, &wbuf.t, wtail - (char *) &wbuf.t, - &recvtftp, &pkt, (void **)&t, &rtype); + recv_extra.tftp_handle = h; + res = sendrecv(h->iodesc, &sendudp, &wbuf.t, wtail - (char *) &wbuf.t, + (void *)&recvtftp, &pkt, (void **)&t, &recv_extra); if (res == -1) { free(pkt); return (errno); @@ -345,13 +353,13 @@ tftp_makereq(struct tftp_handle *h) h->pkt = pkt; h->tftp_hdr = t; - if (rtype == OACK) + if (recv_extra.rtype == OACK) return (tftp_getnextblock(h)); /* Server ignored our blksize request, revert to TFTP default. */ h->tftp_blksize = SEGSIZE; - switch (rtype) { + switch (recv_extra.rtype) { case DATA: { h->currblock = 1; h->validsize = res; @@ -377,11 +385,11 @@ tftp_getnextblock(struct tftp_handle *h) u_char header[HEADER_SIZE]; struct tftphdr t; } __packed __aligned(4) wbuf; + struct tftprecv_extra recv_extra; char *wtail; int res; void *pkt; struct tftphdr *t; - unsigned short rtype = 0; wbuf.t.th_opcode = htons((u_short) ACK); wtail = (char *) &wbuf.t.th_block; wbuf.t.th_block = htons((u_short) h->currblock); @@ -390,8 +398,9 @@ tftp_getnextblock(struct tftp_handle *h) h->iodesc->xid = h->currblock + 1; /* expected block */ pkt = NULL; - res = sendrecv_tftp(h, &sendudp, &wbuf.t, wtail - (char *) &wbuf.t, - &recvtftp, &pkt, (void **)&t, &rtype); + recv_extra.tftp_handle = h; + res = sendrecv(h->iodesc, &sendudp, &wbuf.t, wtail - (char *) &wbuf.t, + (void *)&recvtftp, &pkt, (void **)&t, &recv_extra); if (res == -1) { /* 0 is OK! */ free(pkt); @@ -603,67 +612,6 @@ tftp_seek(struct open_file *f, off_t offset, int where return (-1); } return (tftpfile->off); -} - -static ssize_t -sendrecv_tftp(struct tftp_handle *h, - ssize_t (*sproc)(struct iodesc *, void *, size_t), - void *sbuf, size_t ssize, - ssize_t (*rproc)(struct tftp_handle *, void **, void **, time_t, - unsigned short *), - void **pkt, void **payload, unsigned short *rtype) -{ - struct iodesc *d = h->iodesc; - ssize_t cc; - time_t t, t1, tleft; - -#ifdef TFTP_DEBUG - if (debug) - printf("sendrecv: called\n"); -#endif - - tleft = MINTMO; - t = t1 = getsecs(); - for (;;) { - if ((getsecs() - t) > MAXTMO) { - errno = ETIMEDOUT; - return -1; - } - - cc = (*sproc)(d, sbuf, ssize); - if (cc != -1 && cc < ssize) - panic("sendrecv: short write! (%zd < %zu)", - cc, ssize); - - if (cc == -1) { - /* Error on transmit; wait before retrying */ - while ((getsecs() - t1) < tleft); - t1 = getsecs(); - continue; - } - - t = t1 = getsecs(); -recvnext: - if ((getsecs() - t) > MAXTMO) { - errno = ETIMEDOUT; - return -1; - } - /* Try to get a packet and process it. */ - cc = (*rproc)(h, pkt, payload, tleft, rtype); - /* Return on data, EOF or real error. */ - if (cc != -1 || (errno != 0 && errno != ETIMEDOUT)) - return (cc); - if ((getsecs() - t1) < tleft) { - goto recvnext; - } - - /* Timed out or didn't get the packet we're waiting for */ - tleft += MINTMO; - if (tleft > (2 * MINTMO)) { - tleft = (2 * MINTMO); - } - t1 = getsecs(); - } } static int From owner-svn-src-all@freebsd.org Thu Feb 15 20:42:38 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C23D5F18BA6; Thu, 15 Feb 2018 20:42:38 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 75C2C6F2C9; Thu, 15 Feb 2018 20:42:38 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 70B7123CFD; Thu, 15 Feb 2018 20:42:38 +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 w1FKgceD079602; Thu, 15 Feb 2018 20:42:38 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1FKgcDd079601; Thu, 15 Feb 2018 20:42:38 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <201802152042.w1FKgcDd079601@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Thu, 15 Feb 2018 20:42:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329340 - head/sys/amd64/include X-SVN-Group: head X-SVN-Commit-Author: jkim X-SVN-Commit-Paths: head/sys/amd64/include X-SVN-Commit-Revision: 329340 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Feb 2018 20:42:38 -0000 Author: jkim Date: Thu Feb 15 20:42:38 2018 New Revision: 329340 URL: https://svnweb.freebsd.org/changeset/base/329340 Log: Change size of padding to reflect reality. No functional change. Discussed with: kib Modified: head/sys/amd64/include/pcpu.h Modified: head/sys/amd64/include/pcpu.h ============================================================================== --- head/sys/amd64/include/pcpu.h Thu Feb 15 19:49:15 2018 (r329339) +++ head/sys/amd64/include/pcpu.h Thu Feb 15 20:42:38 2018 (r329340) @@ -75,7 +75,7 @@ uint32_t pc_pcid_gen; \ uint32_t pc_smp_tlb_done; /* TLB op acknowledgement */ \ uint32_t pc_ibpb_set; \ - char __pad[216] /* be divisor of PAGE_SIZE \ + char __pad[224] /* be divisor of PAGE_SIZE \ after cache alignment */ #define PC_DBREG_CMD_NONE 0 From owner-svn-src-all@freebsd.org Thu Feb 15 21:06:57 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9B0C1F1A592; Thu, 15 Feb 2018 21:06:57 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BBC4705A8; Thu, 15 Feb 2018 21:06:57 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 424F024042; Thu, 15 Feb 2018 21:06:57 +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 w1FL6v1a092372; Thu, 15 Feb 2018 21:06:57 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1FL6uNa092369; Thu, 15 Feb 2018 21:06:56 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201802152106.w1FL6uNa092369@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Thu, 15 Feb 2018 21:06:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329341 - head/usr.sbin/trpt X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/usr.sbin/trpt X-SVN-Commit-Revision: 329341 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Feb 2018 21:06:57 -0000 Author: cem Date: Thu Feb 15 21:06:56 2018 New Revision: 329341 URL: https://svnweb.freebsd.org/changeset/base/329341 Log: trpt(8): Sprinkle style(9) and adddress warnings Update function definitions to post-ISO style; remove deprecated "register" keyword. Correct indentation. Sprinkle 'static' on file-local variables. Appease warnings at WARNS=6, for both Clang and GCC. Sponsored by: Dell EMC Isilon Modified: head/usr.sbin/trpt/Makefile head/usr.sbin/trpt/trpt.c Modified: head/usr.sbin/trpt/Makefile ============================================================================== --- head/usr.sbin/trpt/Makefile Thu Feb 15 20:42:38 2018 (r329340) +++ head/usr.sbin/trpt/Makefile Thu Feb 15 21:06:56 2018 (r329341) @@ -8,10 +8,12 @@ MAN= trpt.8 BINGRP= kmem BINMODE= 2555 -WARNS?= 4 - .if ${MK_INET6_SUPPORT} != "no" CFLAGS+= -DINET6 .endif .include + +# Several included system headers tickle this warning in ways that are +# difficult to work around in this program. +CFLAGS+= -Wno-missing-variable-declarations Modified: head/usr.sbin/trpt/trpt.c ============================================================================== --- head/usr.sbin/trpt/trpt.c Thu Feb 15 20:42:38 2018 (r329340) +++ head/usr.sbin/trpt/trpt.c Thu Feb 15 21:06:56 2018 (r329341) @@ -79,12 +79,13 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include #include -struct nlist nl[3]; +static struct nlist nl[3]; #define N_TCP_DEBUG 0 #define N_TCP_DEBX 1 @@ -92,10 +93,10 @@ static caddr_t tcp_pcbs[TCP_NDEBUG]; static n_time ntime; static int aflag, kflag, memf, follow, sflag; -void dotrace(caddr_t); -void klseek(int, off_t, int); -int numeric(const void *, const void *); -void tcp_trace(short, short, struct tcpcb *, int, void *, struct tcphdr *, int); +static void dotrace(caddr_t); +static void klseek(int, off_t, int); +static int numeric(const void *, const void *); +static void tcp_trace(short, short, struct tcpcb *, int, void *, struct tcphdr *, int); static void usage(void); int @@ -150,8 +151,7 @@ main(int argc, char **argv) */ if (setgid(getgid()) != 0) err(1, "setgid"); - } - else + } else syst = getbootfile(); if (nlist(syst, nl) < 0 || !nl[0].n_value) @@ -178,8 +178,8 @@ main(int argc, char **argv) */ if (!npcbs) { for (i = 0; i < TCP_NDEBUG; i++) { - register struct tcp_debug *td = &tcp_debug[i]; - register int j; + struct tcp_debug *td = &tcp_debug[i]; + int j; if (td->td_tcb == 0) continue; @@ -201,31 +201,31 @@ main(int argc, char **argv) fputs(", ", stdout); } putchar('\n'); - } - else for (i = 0; i < npcbs; i++) { - printf("\n%p:\n", tcp_pcbs[i]); - dotrace(tcp_pcbs[i]); - } + } else + for (i = 0; i < npcbs; i++) { + printf("\n%p:\n", tcp_pcbs[i]); + dotrace(tcp_pcbs[i]); + } exit(0); } static void -usage() +usage(void) { (void)fprintf(stderr, - "usage: trpt [-afjs] [-p hex-address] [system [core]]\n"); + "usage: trpt [-afjs] [-p hex-address] [system [core]]\n"); exit(1); } -void -dotrace(tcpcb) - register caddr_t tcpcb; +static void +dotrace(caddr_t tcpcb) { - register struct tcp_debug *td; - register int i; + struct tcp_debug *td; + int i; int prev_debx = tcp_debx, family; -again: if (--tcp_debx < 0) +again: + if (--tcp_debx < 0) tcp_debx = TCP_NDEBUG - 1; for (i = prev_debx % TCP_NDEBUG; i < TCP_NDEBUG; i++) { td = &tcp_debug[i]; @@ -237,17 +237,17 @@ again: if (--tcp_debx < 0) #else family = AF_INET; #endif - switch(family) { + switch (family) { case AF_INET: - tcp_trace(td->td_act, td->td_ostate, - &td->td_cb, td->td_family, &td->td_ti.ti_i, - &td->td_ti.ti_t, td->td_req); + tcp_trace(td->td_act, td->td_ostate, &td->td_cb, + td->td_family, &td->td_ti.ti_i, &td->td_ti.ti_t, + td->td_req); break; #ifdef INET6 case AF_INET6: - tcp_trace(td->td_act, td->td_ostate, - &td->td_cb, td->td_family, &td->td_ti6.ip6, - &td->td_ti6.th, td->td_req); + tcp_trace(td->td_act, td->td_ostate, &td->td_cb, + td->td_family, &td->td_ti6.ip6, &td->td_ti6.th, + td->td_req); break; #endif } @@ -264,22 +264,23 @@ again: if (--tcp_debx < 0) #else family = AF_INET; #endif - switch(family) { + switch (family) { case AF_INET: - tcp_trace(td->td_act, td->td_ostate, - &td->td_cb, td->td_family, &td->td_ti.ti_i, - &td->td_ti.ti_t, td->td_req); + tcp_trace(td->td_act, td->td_ostate, &td->td_cb, + td->td_family, &td->td_ti.ti_i, &td->td_ti.ti_t, + td->td_req); break; #ifdef INET6 case AF_INET6: - tcp_trace(td->td_act, td->td_ostate, - &td->td_cb, td->td_family, &td->td_ti6.ip6, - &td->td_ti6.th, td->td_req); + tcp_trace(td->td_act, td->td_ostate, &td->td_cb, + td->td_family, &td->td_ti6.ip6, &td->td_ti6.th, + td->td_req); break; #endif } } -done: if (follow) { +done: + if (follow) { prev_debx = tcp_debx + 1; if (prev_debx >= TCP_NDEBUG) prev_debx = 0; @@ -302,7 +303,7 @@ done: if (follow) { * Tcp debug routines */ /*ARGSUSED*/ -void +static void tcp_trace(short act, short ostate, struct tcpcb *tp, int family __unused, void *ip, struct tcphdr *th, int req) { @@ -310,21 +311,26 @@ tcp_trace(short act, short ostate, struct tcpcb *tp, i int flags, len, win, timer; struct ip *ip4; #ifdef INET6 - int isipv6, nopkt = 1; + bool isipv6, nopkt = true; struct ip6_hdr *ip6; char ntop_buf[INET6_ADDRSTRLEN]; #endif #ifdef INET6 + /* Appease GCC -Wmaybe-uninitialized */ + ip4 = NULL; + ip6 = NULL; + isipv6 = false; + switch (family) { case AF_INET: - nopkt = 0; - isipv6 = 0; + nopkt = false; + isipv6 = false; ip4 = (struct ip *)ip; break; case AF_INET6: - nopkt = 0; - isipv6 = 1; + nopkt = false; + isipv6 = true; ip6 = (struct ip6_hdr *)ip; case 0: default: @@ -333,43 +339,39 @@ tcp_trace(short act, short ostate, struct tcpcb *tp, i #else ip4 = (struct ip *)ip; #endif - printf("%03ld %s:%s ", (long)((ntime/10) % 1000), tcpstates[ostate], + printf("%03ld %s:%s ", (long)((ntime / 10) % 1000), tcpstates[ostate], tanames[act]); switch (act) { case TA_INPUT: case TA_OUTPUT: case TA_DROP: #ifdef INET6 - if (nopkt != 0) + if (nopkt) break; #endif if (aflag) { printf("(src=%s,%u, ", #ifdef INET6 - isipv6 - ? inet_ntop(AF_INET6, &ip6->ip6_src, ntop_buf, - sizeof(ntop_buf)) : + isipv6 ? inet_ntop(AF_INET6, &ip6->ip6_src, + ntop_buf, sizeof(ntop_buf)) : #endif - inet_ntoa(ip4->ip_src), - ntohs(th->th_sport)); + inet_ntoa(ip4->ip_src), ntohs(th->th_sport)); printf("dst=%s,%u)", #ifdef INET6 - isipv6 - ? inet_ntop(AF_INET6, &ip6->ip6_dst, ntop_buf, - sizeof(ntop_buf)) : + isipv6 ? inet_ntop(AF_INET6, &ip6->ip6_dst, + ntop_buf, sizeof(ntop_buf)) : #endif - inet_ntoa(ip4->ip_dst), - ntohs(th->th_dport)); + inet_ntoa(ip4->ip_dst), ntohs(th->th_dport)); } seq = th->th_seq; ack = th->th_ack; len = #ifdef INET6 - isipv6 ? ip6->ip6_plen : + isipv6 ? ip6->ip6_plen : #endif - ip4->ip_len; + ip4->ip_len; win = th->th_win; if (act == TA_OUTPUT) { seq = ntohl(seq); @@ -421,23 +423,21 @@ tcp_trace(short act, short ostate, struct tcpcb *tp, i (u_long)tp->snd_una, (u_long)tp->snd_nxt, (u_long)tp->snd_max); printf("\tsnd_wl1 %lx snd_wl2 %lx snd_wnd %lx\n", - (u_long)tp->snd_wl1, - (u_long)tp->snd_wl2, (u_long)tp->snd_wnd); + (u_long)tp->snd_wl1, (u_long)tp->snd_wl2, + (u_long)tp->snd_wnd); } } -int -numeric(v1, v2) - const void *v1, *v2; +static int +numeric(const void *v1, const void *v2) { const caddr_t *c1 = v1, *c2 = v2; - return(*c1 - *c2); + + return (*c1 - *c2); } -void -klseek(fd, base, off) - int fd, off; - off_t base; +static void +klseek(int fd, off_t base, int off) { (void)lseek(fd, base, off); } From owner-svn-src-all@freebsd.org Thu Feb 15 21:24:44 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A5085F1B952; Thu, 15 Feb 2018 21:24:44 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5868971153; Thu, 15 Feb 2018 21:24:44 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5348D24364; Thu, 15 Feb 2018 21:24:44 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1FLOiYY004067; Thu, 15 Feb 2018 21:24:44 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1FLOi6M004066; Thu, 15 Feb 2018 21:24:44 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201802152124.w1FLOi6M004066@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Thu, 15 Feb 2018 21:24:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329342 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 329342 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Feb 2018 21:24:44 -0000 Author: brooks Date: Thu Feb 15 21:24:43 2018 New Revision: 329342 URL: https://svnweb.freebsd.org/changeset/base/329342 Log: Reduce duplication in __acl_*_(file|link). Add const to new kern_ functions and push down as required. Reviewed by: rwatson Obtained from: CheriBSD Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D14174 Modified: head/sys/kern/vfs_acl.c Modified: head/sys/kern/vfs_acl.c ============================================================================== --- head/sys/kern/vfs_acl.c Thu Feb 15 21:06:56 2018 (r329341) +++ head/sys/kern/vfs_acl.c Thu Feb 15 21:24:43 2018 (r329342) @@ -67,12 +67,21 @@ CTASSERT(ACL_MAX_ENTRIES >= OLDACL_MAX_ENTRIES); MALLOC_DEFINE(M_ACL, "acl", "Access Control Lists"); + +static int kern___acl_aclcheck_path(struct thread *td, const char *path, + acl_type_t type, struct acl *aclp, int follow); +static int kern___acl_delete_path(struct thread *td, const char *path, + acl_type_t type, int follow); +static int kern___acl_get_path(struct thread *td, const char *path, + acl_type_t type, struct acl *aclp, int follow); +static int kern___acl_set_path(struct thread *td, const char *path, + acl_type_t type, const struct acl *aclp, int follow); static int vacl_set_acl(struct thread *td, struct vnode *vp, - acl_type_t type, struct acl *aclp); + acl_type_t type, const struct acl *aclp); static int vacl_get_acl(struct thread *td, struct vnode *vp, acl_type_t type, struct acl *aclp); static int vacl_aclcheck(struct thread *td, struct vnode *vp, - acl_type_t type, struct acl *aclp); + acl_type_t type, const struct acl *aclp); int acl_copy_oldacl_into_acl(const struct oldacl *source, struct acl *dest) @@ -130,7 +139,7 @@ acl_copy_acl_into_oldacl(const struct acl *source, str * format. */ static int -acl_copyin(void *user_acl, struct acl *kernel_acl, acl_type_t type) +acl_copyin(const void *user_acl, struct acl *kernel_acl, acl_type_t type) { int error; struct oldacl old; @@ -154,7 +163,7 @@ acl_copyin(void *user_acl, struct acl *kernel_acl, acl } static int -acl_copyout(struct acl *kernel_acl, void *user_acl, acl_type_t type) +acl_copyout(const struct acl *kernel_acl, void *user_acl, acl_type_t type) { uint32_t am; int error; @@ -218,7 +227,7 @@ acl_type_unold(int type) */ static int vacl_set_acl(struct thread *td, struct vnode *vp, acl_type_t type, - struct acl *aclp) + const struct acl *aclp) { struct acl *inkernelacl; struct mount *mp; @@ -319,7 +328,7 @@ out: */ static int vacl_aclcheck(struct thread *td, struct vnode *vp, acl_type_t type, - struct acl *aclp) + const struct acl *aclp) { struct acl *inkernelacl; int error; @@ -346,17 +355,9 @@ out: int sys___acl_get_file(struct thread *td, struct __acl_get_file_args *uap) { - struct nameidata nd; - int error; - NDINIT(&nd, LOOKUP, FOLLOW | AUDITVNODE1, UIO_USERSPACE, uap->path, - td); - error = namei(&nd); - if (error == 0) { - error = vacl_get_acl(td, nd.ni_vp, uap->type, uap->aclp); - NDFREE(&nd, 0); - } - return (error); + return (kern___acl_get_path(td, uap->path, uap->type, uap->aclp, + FOLLOW)); } /* @@ -365,14 +366,22 @@ sys___acl_get_file(struct thread *td, struct __acl_get int sys___acl_get_link(struct thread *td, struct __acl_get_link_args *uap) { + + return(kern___acl_get_path(td, uap->path, uap->type, uap->aclp, + NOFOLLOW)); +} + +static int +kern___acl_get_path(struct thread *td, const char *path, acl_type_t type, + struct acl *aclp, int follow) +{ struct nameidata nd; int error; - NDINIT(&nd, LOOKUP, NOFOLLOW | AUDITVNODE1, UIO_USERSPACE, uap->path, - td); + NDINIT(&nd, LOOKUP, follow | AUDITVNODE1, UIO_USERSPACE, path, td); error = namei(&nd); if (error == 0) { - error = vacl_get_acl(td, nd.ni_vp, uap->type, uap->aclp); + error = vacl_get_acl(td, nd.ni_vp, type, aclp); NDFREE(&nd, 0); } return (error); @@ -384,17 +393,9 @@ sys___acl_get_link(struct thread *td, struct __acl_get int sys___acl_set_file(struct thread *td, struct __acl_set_file_args *uap) { - struct nameidata nd; - int error; - NDINIT(&nd, LOOKUP, FOLLOW | AUDITVNODE1, UIO_USERSPACE, uap->path, - td); - error = namei(&nd); - if (error == 0) { - error = vacl_set_acl(td, nd.ni_vp, uap->type, uap->aclp); - NDFREE(&nd, 0); - } - return (error); + return(kern___acl_set_path(td, uap->path, uap->type, uap->aclp, + FOLLOW)); } /* @@ -403,14 +404,22 @@ sys___acl_set_file(struct thread *td, struct __acl_set int sys___acl_set_link(struct thread *td, struct __acl_set_link_args *uap) { + + return(kern___acl_set_path(td, uap->path, uap->type, uap->aclp, + NOFOLLOW)); +} + +static int +kern___acl_set_path(struct thread *td, const char *path, + acl_type_t type, const struct acl *aclp, int follow) +{ struct nameidata nd; int error; - NDINIT(&nd, LOOKUP, NOFOLLOW | AUDITVNODE1, UIO_USERSPACE, uap->path, - td); + NDINIT(&nd, LOOKUP, follow | AUDITVNODE1, UIO_USERSPACE, path, td); error = namei(&nd); if (error == 0) { - error = vacl_set_acl(td, nd.ni_vp, uap->type, uap->aclp); + error = vacl_set_acl(td, nd.ni_vp, type, aclp); NDFREE(&nd, 0); } return (error); @@ -462,16 +471,8 @@ sys___acl_set_fd(struct thread *td, struct __acl_set_f int sys___acl_delete_file(struct thread *td, struct __acl_delete_file_args *uap) { - struct nameidata nd; - int error; - NDINIT(&nd, LOOKUP, FOLLOW, UIO_USERSPACE, uap->path, td); - error = namei(&nd); - if (error == 0) { - error = vacl_delete(td, nd.ni_vp, uap->type); - NDFREE(&nd, 0); - } - return (error); + return (kern___acl_delete_path(td, uap->path, uap->type, FOLLOW)); } /* @@ -480,13 +481,21 @@ sys___acl_delete_file(struct thread *td, struct __acl_ int sys___acl_delete_link(struct thread *td, struct __acl_delete_link_args *uap) { + + return (kern___acl_delete_path(td, uap->path, uap->type, NOFOLLOW)); +} + +static int +kern___acl_delete_path(struct thread *td, const char *path, + acl_type_t type, int follow) +{ struct nameidata nd; int error; - NDINIT(&nd, LOOKUP, NOFOLLOW, UIO_USERSPACE, uap->path, td); + NDINIT(&nd, LOOKUP, follow, UIO_USERSPACE, path, td); error = namei(&nd); if (error == 0) { - error = vacl_delete(td, nd.ni_vp, uap->type); + error = vacl_delete(td, nd.ni_vp, type); NDFREE(&nd, 0); } return (error); @@ -518,16 +527,9 @@ sys___acl_delete_fd(struct thread *td, struct __acl_de int sys___acl_aclcheck_file(struct thread *td, struct __acl_aclcheck_file_args *uap) { - struct nameidata nd; - int error; - NDINIT(&nd, LOOKUP, FOLLOW, UIO_USERSPACE, uap->path, td); - error = namei(&nd); - if (error == 0) { - error = vacl_aclcheck(td, nd.ni_vp, uap->type, uap->aclp); - NDFREE(&nd, 0); - } - return (error); + return (kern___acl_aclcheck_path(td, uap->path, uap->type, uap->aclp, + FOLLOW)); } /* @@ -536,13 +538,21 @@ sys___acl_aclcheck_file(struct thread *td, struct __ac int sys___acl_aclcheck_link(struct thread *td, struct __acl_aclcheck_link_args *uap) { + return (kern___acl_aclcheck_path(td, uap->path, uap->type, uap->aclp, + NOFOLLOW)); +} + +static int +kern___acl_aclcheck_path(struct thread *td, const char *path, acl_type_t type, + struct acl *aclp, int follow) +{ struct nameidata nd; int error; - NDINIT(&nd, LOOKUP, NOFOLLOW, UIO_USERSPACE, uap->path, td); + NDINIT(&nd, LOOKUP, follow, UIO_USERSPACE, path, td); error = namei(&nd); if (error == 0) { - error = vacl_aclcheck(td, nd.ni_vp, uap->type, uap->aclp); + error = vacl_aclcheck(td, nd.ni_vp, type, aclp); NDFREE(&nd, 0); } return (error); From owner-svn-src-all@freebsd.org Thu Feb 15 21:27:25 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DFE44F1BD46; Thu, 15 Feb 2018 21:27:24 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8DE2671479; Thu, 15 Feb 2018 21:27:24 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 88AF024375; Thu, 15 Feb 2018 21:27:24 +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 w1FLROeG004639; Thu, 15 Feb 2018 21:27:24 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1FLRO9D004636; Thu, 15 Feb 2018 21:27:24 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201802152127.w1FLRO9D004636@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 15 Feb 2018 21:27:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r329343 - in stable/11: sys/opencrypto tools/tools/crypto X-SVN-Group: stable-11 X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in stable/11: sys/opencrypto tools/tools/crypto X-SVN-Commit-Revision: 329343 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Feb 2018 21:27:25 -0000 Author: jhb Date: Thu Feb 15 21:27:24 2018 New Revision: 329343 URL: https://svnweb.freebsd.org/changeset/base/329343 Log: MFC 318090,319475: Use const with some read-only buffers in opencrypto APIs. 318090: Use const with some read-only buffers in opencrypto APIs. - Mark the source buffer for a copyback operation as const in the kernel API. - Use const with input-only buffers in crypto ioctl structures used with /dev/crypto. 319475: Fix some new errors and a warning in cryptotest. - Use a new 'char *key' to allocate storage for keys and assign the pointer to the session2_op 'const char *' members after the key is initialized. - Mark the 'find' variable used in crfind() static so that crfind() doesn't return a pointer to stack garbage. Sponsored by: Chelsio Communications Modified: stable/11/sys/opencrypto/criov.c stable/11/sys/opencrypto/cryptodev.h stable/11/tools/tools/crypto/cryptotest.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/opencrypto/criov.c ============================================================================== --- stable/11/sys/opencrypto/criov.c Thu Feb 15 21:24:43 2018 (r329342) +++ stable/11/sys/opencrypto/criov.c Thu Feb 15 21:27:24 2018 (r329343) @@ -79,7 +79,7 @@ cuio_copydata(struct uio* uio, int off, int len, caddr } void -cuio_copyback(struct uio* uio, int off, int len, caddr_t cp) +cuio_copyback(struct uio* uio, int off, int len, c_caddr_t cp) { struct iovec *iov = uio->uio_iov; int iol = uio->uio_iovcnt; @@ -155,7 +155,7 @@ cuio_apply(struct uio *uio, int off, int len, int (*f) } void -crypto_copyback(int flags, caddr_t buf, int off, int size, caddr_t in) +crypto_copyback(int flags, caddr_t buf, int off, int size, c_caddr_t in) { if ((flags & CRYPTO_F_IMBUF) != 0) Modified: stable/11/sys/opencrypto/cryptodev.h ============================================================================== --- stable/11/sys/opencrypto/cryptodev.h Thu Feb 15 21:24:43 2018 (r329342) +++ stable/11/sys/opencrypto/cryptodev.h Thu Feb 15 21:27:24 2018 (r329343) @@ -211,9 +211,9 @@ struct session_op { u_int32_t mac; /* ie. CRYPTO_MD5_HMAC */ u_int32_t keylen; /* cipher key */ - caddr_t key; + c_caddr_t key; int mackeylen; /* mac key */ - caddr_t mackey; + c_caddr_t mackey; u_int32_t ses; /* returns: session # */ }; @@ -223,9 +223,9 @@ struct session2_op { u_int32_t mac; /* ie. CRYPTO_MD5_HMAC */ u_int32_t keylen; /* cipher key */ - caddr_t key; + c_caddr_t key; int mackeylen; /* mac key */ - caddr_t mackey; + c_caddr_t mackey; u_int32_t ses; /* returns: session # */ int crid; /* driver id + flags (rw) */ @@ -240,9 +240,10 @@ struct crypt_op { u_int16_t flags; #define COP_F_BATCH 0x0008 /* Batch op if possible */ u_int len; - caddr_t src, dst; /* become iov[] inside kernel */ + c_caddr_t src; /* become iov[] inside kernel */ + caddr_t dst; caddr_t mac; /* must be big enough for chosen MAC */ - caddr_t iv; + c_caddr_t iv; }; /* op and flags the same as crypt_op */ @@ -253,10 +254,11 @@ struct crypt_aead { u_int len; u_int aadlen; u_int ivlen; - caddr_t src, dst; /* become iov[] inside kernel */ - caddr_t aad; /* additional authenticated data */ + c_caddr_t src; /* become iov[] inside kernel */ + caddr_t dst; + c_caddr_t aad; /* additional authenticated data */ caddr_t tag; /* must fit for chosen TAG length */ - caddr_t iv; + c_caddr_t iv; }; /* @@ -503,7 +505,7 @@ extern int crypto_devallowsoft; /* only use hardware c */ struct uio; extern void cuio_copydata(struct uio* uio, int off, int len, caddr_t cp); -extern void cuio_copyback(struct uio* uio, int off, int len, caddr_t cp); +extern void cuio_copyback(struct uio* uio, int off, int len, c_caddr_t cp); extern int cuio_getptr(struct uio *uio, int loc, int *off); extern int cuio_apply(struct uio *uio, int off, int len, int (*f)(void *, void *, u_int), void *arg); @@ -514,7 +516,7 @@ extern int crypto_mbuftoiov(struct mbuf *mbuf, struct int *cnt, int *allocated); extern void crypto_copyback(int flags, caddr_t buf, int off, int size, - caddr_t in); + c_caddr_t in); extern void crypto_copydata(int flags, caddr_t buf, int off, int size, caddr_t out); extern int crypto_apply(int flags, caddr_t buf, int off, int len, Modified: stable/11/tools/tools/crypto/cryptotest.c ============================================================================== --- stable/11/tools/tools/crypto/cryptotest.c Thu Feb 15 21:24:43 2018 (r329342) +++ stable/11/tools/tools/crypto/cryptotest.c Thu Feb 15 21:27:24 2018 (r329343) @@ -216,7 +216,7 @@ crlookup(const char *devname) const char * crfind(int crid) { - struct crypt_find_op find; + static struct crypt_find_op find; bzero(&find, sizeof(find)); find.crid = crid; @@ -252,7 +252,7 @@ runtest(struct alg *alg, int count, int size, u_long c { int i, fd = crget(); struct timeval start, stop, dt; - char *cleartext, *ciphertext, *originaltext; + char *cleartext, *ciphertext, *originaltext, *key; struct session2_op sop; struct crypt_op cop; char iv[EALG_MAX_BLOCK_LEN]; @@ -260,19 +260,21 @@ runtest(struct alg *alg, int count, int size, u_long c bzero(&sop, sizeof(sop)); if (!alg->ishash) { sop.keylen = (alg->minkeylen + alg->maxkeylen)/2; - sop.key = (char *) malloc(sop.keylen); - if (sop.key == NULL) + key = (char *) malloc(sop.keylen); + if (key == NULL) err(1, "malloc (key)"); for (i = 0; i < sop.keylen; i++) - sop.key[i] = rdigit(); + key[i] = rdigit(); + sop.key = key; sop.cipher = alg->code; } else { sop.mackeylen = (alg->minkeylen + alg->maxkeylen)/2; - sop.mackey = (char *) malloc(sop.mackeylen); - if (sop.mackey == NULL) + key = (char *) malloc(sop.mackeylen); + if (key == NULL) err(1, "malloc (mac)"); for (i = 0; i < sop.mackeylen; i++) - sop.mackey[i] = rdigit(); + key[i] = rdigit(); + sop.mackey = key; sop.mac = alg->code; } sop.crid = crid; From owner-svn-src-all@freebsd.org Thu Feb 15 21:30:32 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CEB64F1C08F; Thu, 15 Feb 2018 21:30:31 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7D0C87167F; Thu, 15 Feb 2018 21:30:31 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5DD3A2437C; Thu, 15 Feb 2018 21:30:31 +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 w1FLUVZg005134; Thu, 15 Feb 2018 21:30:31 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1FLUVwU005130; Thu, 15 Feb 2018 21:30:31 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201802152130.w1FLUVwU005130@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Thu, 15 Feb 2018 21:30:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329344 - head/cddl/usr.sbin/zfsd X-SVN-Group: head X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: head/cddl/usr.sbin/zfsd X-SVN-Commit-Revision: 329344 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Feb 2018 21:30:32 -0000 Author: asomers Date: Thu Feb 15 21:30:30 2018 New Revision: 329344 URL: https://svnweb.freebsd.org/changeset/base/329344 Log: Optimize zfsd for the happy case If there are no damaged pools, then ignore all GEOM events. We only use them to fix damaged pools. However, still pay attention to ZFS events. MFC after: 20 days X-MFC-With: 329284 Sponsored by: Spectra Logic Corp Modified: head/cddl/usr.sbin/zfsd/case_file.cc head/cddl/usr.sbin/zfsd/case_file.h head/cddl/usr.sbin/zfsd/zfsd_event.cc Modified: head/cddl/usr.sbin/zfsd/case_file.cc ============================================================================== --- head/cddl/usr.sbin/zfsd/case_file.cc Thu Feb 15 21:27:24 2018 (r329343) +++ head/cddl/usr.sbin/zfsd/case_file.cc Thu Feb 15 21:30:30 2018 (r329344) @@ -186,6 +186,12 @@ CaseFile::DeSerialize() free(caseFiles); } +bool +CaseFile::Empty() +{ + return (s_activeCases.empty()); +} + void CaseFile::LogAll() { Modified: head/cddl/usr.sbin/zfsd/case_file.h ============================================================================== --- head/cddl/usr.sbin/zfsd/case_file.h Thu Feb 15 21:27:24 2018 (r329343) +++ head/cddl/usr.sbin/zfsd/case_file.h Thu Feb 15 21:30:30 2018 (r329344) @@ -135,6 +135,11 @@ class CaseFile (public) static void DeSerialize(); /** + * \brief returns true if there are no CaseFiles + */ + static bool Empty(); + + /** * \brief Emit syslog data on all active CaseFile%%s in the system. */ static void LogAll(); Modified: head/cddl/usr.sbin/zfsd/zfsd_event.cc ============================================================================== --- head/cddl/usr.sbin/zfsd/zfsd_event.cc Thu Feb 15 21:27:24 2018 (r329343) +++ head/cddl/usr.sbin/zfsd/zfsd_event.cc Thu Feb 15 21:30:30 2018 (r329344) @@ -98,8 +98,16 @@ bool GeomEvent::Process() const { /* - * We are only concerned with create arrivals and physical path changes, - * because those can be used to satisfy online and autoreplace operations + * We only use GEOM events to repair damaged pools. So return early if + * there are no damaged pools + */ + if (CaseFile::Empty()) + return (false); + + /* + * We are only concerned with arrivals and physical path changes, + * because those can be used to satisfy online and autoreplace + * operations */ if (Value("type") != "GEOM::physpath" && Value("type") != "CREATE") return (false); From owner-svn-src-all@freebsd.org Thu Feb 15 23:16:31 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 319B7F22F0C; Thu, 15 Feb 2018 23:16:31 +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 D6F6A758C8; Thu, 15 Feb 2018 23:16:30 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (ralph.baldwin.cx [66.234.199.215]) by mail.baldwin.cx (Postfix) with ESMTPSA id 18DDC10AFAD; Thu, 15 Feb 2018 18:16:24 -0500 (EST) From: John Baldwin To: Alan Somers Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r329265 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs Date: Thu, 15 Feb 2018 11:18:15 -0800 Message-ID: <3148002.4yJvN52HMT@ralph.baldwin.cx> User-Agent: KMail/4.14.10 (FreeBSD/11.1-STABLE; KDE/4.14.30; amd64; ; ) In-Reply-To: <201802141549.w1EFnVBV064848@repo.freebsd.org> References: <201802141549.w1EFnVBV064848@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, 15 Feb 2018 18:16:24 -0500 (EST) X-Virus-Scanned: clamav-milter 0.99.2 at mail.baldwin.cx X-Virus-Status: Clean X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Feb 2018 23:16:31 -0000 On Wednesday, February 14, 2018 03:49:31 PM Alan Somers wrote: > Author: asomers > Date: Wed Feb 14 15:49:31 2018 > New Revision: 329265 > URL: https://svnweb.freebsd.org/changeset/base/329265 > > Log: > Implement .vop_pathconf and .vop_getacl for the .zfs ctldir > > zfsctl_common_pathconf will report all the same variables that regular ZFS > volumes report. zfsctl_common_getacl will report an ACL equivalent to 555, > except that you can't read xattrs or edit attributes. > > Fixes a bug where "ls .zfs" will occasionally print something like: > ls: .zfs/.: Operation not supported > > PR: 225793 > Reviewed by: avg > MFC after: 3 weeks > Sponsored by: Spectra Logic Corp > Differential Revision: https://reviews.freebsd.org/D14365 > > Modified: > head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c > > Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c > ============================================================================== > --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c Wed Feb 14 15:40:13 2018 (r329264) > +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c Wed Feb 14 15:49:31 2018 (r329265) > @@ -80,6 +80,10 @@ > > #include "zfs_namecheck.h" > > +/* Common access mode for all virtual directories under the ctldir */ > +const u_short zfsctl_ctldir_mode = S_IRUSR | S_IXUSR | S_IRGRP | S_IXGRP | > + S_IROTH | S_IXOTH; > + > /* > * "Synthetic" filesystem implementation. > */ > @@ -496,8 +500,7 @@ zfsctl_common_getattr(vnode_t *vp, vattr_t *vap) > vap->va_nblocks = 0; > vap->va_seq = 0; > vn_fsid(vp, vap); > - vap->va_mode = S_IRUSR | S_IXUSR | S_IRGRP | S_IXGRP | > - S_IROTH | S_IXOTH; > + vap->va_mode = zfsctl_ctldir_mode; > vap->va_type = VDIR; > /* > * We live in the now (for atime). > @@ -724,6 +727,87 @@ zfsctl_root_vptocnp(struct vop_vptocnp_args *ap) > return (0); > } > > +static int > +zfsctl_common_pathconf(ap) > + struct vop_pathconf_args /* { > + struct vnode *a_vp; > + int a_name; > + int *a_retval; > + } */ *ap; > +{ > + /* > + * We care about ACL variables so that user land utilities like ls > + * can display them correctly. Since the ctldir's st_dev is set to be > + * the same as the parent dataset, we must support all variables that > + * it supports. > + */ > + switch (ap->a_name) { > + case _PC_LINK_MAX: > + *ap->a_retval = INT_MAX; > + return (0); On HEAD this should probably match the existing ZFS pathconf (min(LONG_MAX, ZFS_LINK_MAX IIRC), though if these directories can only ever have a link count of 2 (which seems true from zfsctl_common_getattr()) then it would be fine to return '2' here instead. For stable you'd have to restrict it to LINK_MAX if you don't use '2'. Also, you should call vfs_stdpathconf() in the default: case. -- John Baldwin From owner-svn-src-all@freebsd.org Fri Feb 16 00:17:34 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CB726F01FD1; Fri, 16 Feb 2018 00:17:33 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 78D2577DF8; Fri, 16 Feb 2018 00:17:33 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 73A6025EFD; Fri, 16 Feb 2018 00:17:33 +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 w1G0HXI6094650; Fri, 16 Feb 2018 00:17:33 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1G0HWq8094640; Fri, 16 Feb 2018 00:17:32 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201802160017.w1G0HWq8094640@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Fri, 16 Feb 2018 00:17:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329345 - in head: share/mk stand stand/fdt stand/ficl stand/geli stand/libsa stand/mips/uboot stand/uboot/fdt stand/uboot/lib stand/zfs X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head: share/mk stand stand/fdt stand/ficl stand/geli stand/libsa stand/mips/uboot stand/uboot/fdt stand/uboot/lib stand/zfs X-SVN-Commit-Revision: 329345 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Feb 2018 00:17:34 -0000 Author: imp Date: Fri Feb 16 00:17:32 2018 New Revision: 329345 URL: https://svnweb.freebsd.org/changeset/base/329345 Log: Eliminate bsd.stand.mk and -fPIC 32-bit intel builds OK. We don't really need a bsd.stand.mk, and it was causing a -fPIC for the toolchain to be added (bogusly) when building on amd64. Pull all relevant defs back into defs.mk and delete bsd.stand.mk. This saves about 15-20k on i386 loader and zfsloader which when combined with Lua give us a lot more stack space in those constrained environments. Deleted: head/share/mk/bsd.stand.mk Modified: head/stand/defs.mk head/stand/fdt/Makefile head/stand/ficl/Makefile head/stand/geli/Makefile head/stand/libsa/Makefile head/stand/mips/uboot/Makefile head/stand/uboot/fdt/Makefile head/stand/uboot/lib/Makefile head/stand/zfs/Makefile Modified: head/stand/defs.mk ============================================================================== --- head/stand/defs.mk Thu Feb 15 21:30:30 2018 (r329344) +++ head/stand/defs.mk Fri Feb 16 00:17:32 2018 (r329345) @@ -101,8 +101,10 @@ SSP_CFLAGS= # currently has no /boot/loader, but may soon. CFLAGS+= -ffreestanding ${CFLAGS_NO_SIMD} .if ${MACHINE_CPUARCH} == "aarch64" -CFLAGS+= -mgeneral-regs-only -.elif ${MACHINE_CPUARCH} != "riscv" +CFLAGS+= -mgeneral-regs-only -fPIC +.elif ${MACHINE_CPUARCH} == "riscv" +CFLAGS+= -march=rv64imac -mabi=lp64 +.else CFLAGS+= -msoft-float .endif @@ -110,8 +112,10 @@ CFLAGS+= -msoft-float CFLAGS+= -march=i386 CFLAGS.gcc+= -mpreferred-stack-boundary=2 .endif +.if ${MACHINE_CPUARCH} == "amd64" && ${DO32:U0} == 0 +CFLAGS+= -fPIC -mno-red-zone +.endif - .if ${MACHINE_CPUARCH} == "arm" # Do not generate movt/movw, because the relocation fixup for them does not # translate to the -Bsymbolic -pie format required by self_reloc() in loader(8). @@ -122,6 +126,7 @@ CFLAGS.clang+= -mllvm -arm-use-movt=0 CFLAGS.clang+= -mno-movt .endif CFLAGS.clang+= -mfpu=none +CFLAGS+= -fPIC .endif # The boot loader build uses dd status=none, where possible, for reproducible @@ -130,6 +135,10 @@ CFLAGS.clang+= -mfpu=none # when this test succeeds rather than require dd to be a bootstrap tool. DD_NOSTATUS!=(dd status=none count=0 2> /dev/null && echo status=none) || true DD=dd ${DD_NOSTATUS} + +.if ${MACHINE_CPUARCH} == "mips" +CFLAGS+= -G0 -fno-pic -mno-abicalls +.endif .if ${MK_LOADER_FORCE_LE} != "no" .if ${MACHINE_ARCH} == "powerpc64" Modified: head/stand/fdt/Makefile ============================================================================== --- head/stand/fdt/Makefile Thu Feb 15 21:30:30 2018 (r329344) +++ head/stand/fdt/Makefile Fri Feb 16 00:17:32 2018 (r329345) @@ -17,5 +17,4 @@ CFLAGS+= -I${SYSDIR}/contrib/libfdt/ -I${LDRSRC} CFLAGS+= -Wformat -Wall -.include .include Modified: head/stand/ficl/Makefile ============================================================================== --- head/stand/ficl/Makefile Thu Feb 15 21:30:30 2018 (r329344) +++ head/stand/ficl/Makefile Fri Feb 16 00:17:32 2018 (r329345) @@ -12,7 +12,6 @@ BASE_SRCS= dict.c ficl.c fileaccess.c float.c loader.c SRCS= ${BASE_SRCS} sysdep.c softcore.c CLEANFILES+= softcore.c testmain testmain.o -.include .ifmake testmain CFLAGS+= -DTESTMAIN -D_TESTMAIN SRCS+= testmain.c Modified: head/stand/geli/Makefile ============================================================================== --- head/stand/geli/Makefile Thu Feb 15 21:30:30 2018 (r329344) +++ head/stand/geli/Makefile Fri Feb 16 00:17:32 2018 (r329345) @@ -34,5 +34,4 @@ SRCS+= geliboot_crypto.c g_eli_hmac.c g_eli_key.c g_e .PATH: ${SYSDIR}/opencrypto SRCS+= xform_aes_xts.c -.include .include Modified: head/stand/libsa/Makefile ============================================================================== --- head/stand/libsa/Makefile Thu Feb 15 21:30:30 2018 (r329344) +++ head/stand/libsa/Makefile Fri Feb 16 00:17:32 2018 (r329345) @@ -151,5 +151,4 @@ CFLAGS.bzipfs.c+= -I${SRCTOP}/contrib/bzip2 .PATH: ${SYSDIR}/libkern SRCS+= explicit_bzero.c -.include .include Modified: head/stand/mips/uboot/Makefile ============================================================================== --- head/stand/mips/uboot/Makefile Thu Feb 15 21:30:30 2018 (r329344) +++ head/stand/mips/uboot/Makefile Fri Feb 16 00:17:32 2018 (r329345) @@ -53,5 +53,4 @@ ubldr: ${OBJS} ldscript.abs ${.CURDIR}/ldscript.${MACH CLEANFILES+= ldscript.abs ldscript.pie ubldr ubldr.pie ubldr.bin -.include .include Modified: head/stand/uboot/fdt/Makefile ============================================================================== --- head/stand/uboot/fdt/Makefile Thu Feb 15 21:30:30 2018 (r329344) +++ head/stand/uboot/fdt/Makefile Fri Feb 16 00:17:32 2018 (r329345) @@ -18,5 +18,4 @@ CFLAGS+= -I${FDTSRC} # Pick up the bootstrap header for some interface items CFLAGS+= -I${LDRSRC} -.include .include Modified: head/stand/uboot/lib/Makefile ============================================================================== --- head/stand/uboot/lib/Makefile Thu Feb 15 21:30:30 2018 (r329344) +++ head/stand/uboot/lib/Makefile Fri Feb 16 00:17:32 2018 (r329345) @@ -24,5 +24,4 @@ CFLAGS+= -I${LDRSRC} CFLAGS+= -DDISK_DEBUG .endif -.include .include Modified: head/stand/zfs/Makefile ============================================================================== --- head/stand/zfs/Makefile Thu Feb 15 21:30:30 2018 (r329344) +++ head/stand/zfs/Makefile Fri Feb 16 00:17:32 2018 (r329345) @@ -17,5 +17,4 @@ CFLAGS+= -I${SYSDIR}/crypto/skein CFLAGS+= -Wformat -Wall -.include .include From owner-svn-src-all@freebsd.org Fri Feb 16 01:03:08 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C85C4F04D78; Fri, 16 Feb 2018 01:03:08 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7A1F179CDA; Fri, 16 Feb 2018 01:03:08 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 74FDD26710; Fri, 16 Feb 2018 01:03:08 +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 w1G1384f019406; Fri, 16 Feb 2018 01:03:08 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1G138kW019405; Fri, 16 Feb 2018 01:03:08 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201802160103.w1G138kW019405@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Fri, 16 Feb 2018 01:03:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329346 - head/share/man/man5 X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/share/man/man5 X-SVN-Commit-Revision: 329346 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Feb 2018 01:03:09 -0000 Author: cem Date: Fri Feb 16 01:03:08 2018 New Revision: 329346 URL: https://svnweb.freebsd.org/changeset/base/329346 Log: rc.conf.5: Flip default background_fsck language to match defaults Reviewed by: Daniel O'Connor Sponsored by: Dell EMC Isilon Modified: head/share/man/man5/rc.conf.5 Modified: head/share/man/man5/rc.conf.5 ============================================================================== --- head/share/man/man5/rc.conf.5 Fri Feb 16 00:17:32 2018 (r329345) +++ head/share/man/man5/rc.conf.5 Fri Feb 16 01:03:08 2018 (r329346) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 9, 2017 +.Dd February 15, 2018 .Dt RC.CONF 5 .Os .Sh NAME @@ -2056,8 +2056,8 @@ of the file systems fails. .It Va background_fsck .Pq Vt bool If set to -.Dq Li YES , -the system will attempt to run +.Dq Li NO , +the system will not attempt to run .Xr fsck 8 in the background where possible. .It Va background_fsck_delay From owner-svn-src-all@freebsd.org Fri Feb 16 01:08:33 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3FCCCF05478; Fri, 16 Feb 2018 01:08:33 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DDE317A1B4; Fri, 16 Feb 2018 01:08:32 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CD5B526712; Fri, 16 Feb 2018 01:08:32 +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 w1G18WqH019632; Fri, 16 Feb 2018 01:08:32 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1G18Wv9019631; Fri, 16 Feb 2018 01:08:32 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201802160108.w1G18Wv9019631@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 16 Feb 2018 01:08:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329347 - head/share/man/man9 X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/share/man/man9 X-SVN-Commit-Revision: 329347 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Feb 2018 01:08:33 -0000 Author: kib Date: Fri Feb 16 01:08:32 2018 New Revision: 329347 URL: https://svnweb.freebsd.org/changeset/base/329347 Log: Note that on amd64 pmap_enter(psind = 1) works (since r321378). Sponsored by: The FreeBSD Foundation MFC after: 3 days Modified: head/share/man/man9/pmap_enter.9 Modified: head/share/man/man9/pmap_enter.9 ============================================================================== --- head/share/man/man9/pmap_enter.9 Fri Feb 16 01:03:08 2018 (r329346) +++ head/share/man/man9/pmap_enter.9 Fri Feb 16 01:08:32 2018 (r329347) @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 27, 2015 +.Dd February 16, 2018 .Dt PMAP_ENTER 9 .Os .Sh NAME @@ -133,13 +133,13 @@ The function must handle the multiprocessor TLB consistency for the given address. .Sh NOTES -On amd64, arm and i386 architectures the existing implementation +On arm and i386 architectures the existing implementation of the .Nm function is incomplete, only value 0 for .Fa psind is supported. -Other supported architectures have +Other supported architectures, except amd64, have .Dv pagesizes[] array of size 1. .Sh RETURN VALUES From owner-svn-src-all@freebsd.org Fri Feb 16 01:33:02 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 630AFF06D71; Fri, 16 Feb 2018 01:33:02 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 153527B208; Fri, 16 Feb 2018 01:33:02 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1000E26BE4; Fri, 16 Feb 2018 01:33:02 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1G1X11t034141; Fri, 16 Feb 2018 01:33:01 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1G1X18D034134; Fri, 16 Feb 2018 01:33:01 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201802160133.w1G1X18D034134@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Fri, 16 Feb 2018 01:33:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329348 - in head: sys/sys usr.bin/ipcrm usr.bin/ipcs X-SVN-Group: head X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: in head: sys/sys usr.bin/ipcrm usr.bin/ipcs X-SVN-Commit-Revision: 329348 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Feb 2018 01:33:02 -0000 Author: brooks Date: Fri Feb 16 01:33:01 2018 New Revision: 329348 URL: https://svnweb.freebsd.org/changeset/base/329348 Log: Get rid of the requirement to include SysV IPC headers with _KERNEL defined in ipcrm by introducing _WANT_SYSVxxx_INTERNALS defines. Reviewed by: jhb Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D14271 Modified: head/sys/sys/ipc.h head/sys/sys/msg.h head/sys/sys/sem.h head/sys/sys/shm.h head/usr.bin/ipcrm/ipcrm.c head/usr.bin/ipcs/ipc.h Modified: head/sys/sys/ipc.h ============================================================================== --- head/sys/sys/ipc.h Fri Feb 16 01:08:32 2018 (r329347) +++ head/sys/sys/ipc.h Fri Feb 16 01:33:01 2018 (r329348) @@ -119,12 +119,14 @@ struct ipc_perm { #define IPC_INFO 3 /* get info */ #endif -#ifdef _KERNEL +#if defined(_KERNEL) || defined(_WANT_SYSVIPC_INTERNALS) /* Macros to convert between ipc ids and array indices or sequence ids */ #define IPCID_TO_IX(id) ((id) & 0xffff) #define IPCID_TO_SEQ(id) (((id) >> 16) & 0xffff) #define IXSEQ_TO_IPCID(ix,perm) (((perm.seq) << 16) | (ix & 0xffff)) +#endif +#ifdef _KERNEL struct thread; struct proc; struct vmspace; Modified: head/sys/sys/msg.h ============================================================================== --- head/sys/sys/msg.h Fri Feb 16 01:08:32 2018 (r329347) +++ head/sys/sys/msg.h Fri Feb 16 01:33:01 2018 (r329348) @@ -25,6 +25,9 @@ #include #include +#ifdef _WANT_SYSVMSG_INTERNALS +#define _WANT_SYSVIPC_INTERNALS +#endif #include /* @@ -116,7 +119,6 @@ struct mymsg { #endif #ifdef _KERNEL - struct msg { struct msg *msg_next; /* next msg in the chain */ long msg_type; /* type of this message */ @@ -126,7 +128,9 @@ struct msg { short msg_spot; /* location of start of msg in buffer */ struct label *label; /* MAC Framework label */ }; +#endif +#if defined(_KERNEL) || defined(_WANT_SYSVMSG_INTERNALS) /* * Based on the configuration parameters described in an SVR2 (yes, two) * config(1m) man page. @@ -145,7 +149,6 @@ struct msginfo { int msgssz; /* size of a message segment (see note) */ int msgseg; /* number of message segments */ }; -extern struct msginfo msginfo; /* * Kernel wrapper for the user-level structure. @@ -162,10 +165,13 @@ struct msqid_kernel { struct label *label; /* MAC label */ struct ucred *cred; /* creator's credentials */ }; +#endif -#endif /* _KERNEL */ +#ifdef _KERNEL +extern struct msginfo msginfo; -#if !defined(_KERNEL) || defined(_WANT_MSG_PROTOTYPES) +#else /* _KERNEL */ + __BEGIN_DECLS int msgctl(int, int, struct msqid_ds *); int msgget(key_t, int); @@ -175,7 +181,6 @@ int msgsnd(int, const void *, size_t, int); int msgsys(int, ...); #endif __END_DECLS - -#endif /* !_KERNEL || _WANT_MSG_PROTOTYPES */ +#endif /* !_KERNEL */ #endif /* !_SYS_MSG_H_ */ Modified: head/sys/sys/sem.h ============================================================================== --- head/sys/sys/sem.h Fri Feb 16 01:08:32 2018 (r329347) +++ head/sys/sys/sem.h Fri Feb 16 01:33:01 2018 (r329348) @@ -10,6 +10,9 @@ #ifndef _SYS_SEM_H_ #define _SYS_SEM_H_ +#ifdef _WANT_SYSVSEM_INTERNALS +#define _WANT_SYSVIPC_INTERNALS +#endif #include #ifndef _PID_T_DECLARED @@ -101,8 +104,7 @@ union semun { #define SEM_A IPC_W /* alter permission */ #define SEM_R IPC_R /* read permission */ -#ifdef _KERNEL - +#if defined(_KERNEL) || defined(_WANT_SYSVSEM_INTERNALS) /* * semaphore info struct */ @@ -117,7 +119,6 @@ struct seminfo { int semvmx; /* semaphore maximum value */ int semaem; /* adjust on exit max value */ }; -extern struct seminfo seminfo; /* * Kernel wrapper for the user-level structure @@ -131,15 +132,17 @@ struct semid_kernel { /* internal "mode" bits */ #define SEM_ALLOC 01000 /* semaphore is allocated */ #define SEM_DEST 02000 /* semaphore will be destroyed on last detach */ +#endif +#ifdef _KERNEL +extern struct seminfo seminfo; /* * Process sem_undo vectors at proc exit. */ void semexit(struct proc *p); -#endif /* _KERNEL */ +#else /* !_KERNEL */ -#if !defined(_KERNEL) || defined(_WANT_SEM_PROTOTYPES) __BEGIN_DECLS #if __BSD_VISIBLE int semsys(int, ...); @@ -149,6 +152,6 @@ int semget(key_t, int, int); int semop(int, struct sembuf *, size_t); __END_DECLS -#endif /* !_KERNEL || _WANT_SEM_PROTOTYPES */ +#endif /* !_KERNEL */ #endif /* !_SYS_SEM_H_ */ Modified: head/sys/sys/shm.h ============================================================================== --- head/sys/sys/shm.h Fri Feb 16 01:08:32 2018 (r329347) +++ head/sys/sys/shm.h Fri Feb 16 01:33:01 2018 (r329348) @@ -42,6 +42,9 @@ #define _SYS_SHM_H_ #include +#ifdef _WANT_SYSVSHM_INTERNALS +#define _WANT_SYSVIPC_INTERNALS +#endif #include #include @@ -107,9 +110,7 @@ struct shmid_ds { time_t shm_ctime; /* time of last change by shmctl() */ }; -#ifdef _KERNEL -#include - +#if defined(_KERNEL) || defined(_WANT_SYSVSHM_INTERNALS) /* * System 5 style catch-all structure for shared memory constants that * might be of interest to user programs. Do we really want/need this? @@ -122,19 +123,20 @@ struct shminfo { u_long shmall; /* max amount of shared memory (pages) */ }; +struct vm_object; + /* * Add a kernel wrapper to the shmid_ds struct so that private info (like the * MAC label) can be added to it, without changing the user interface. */ struct shmid_kernel { struct shmid_ds u; - vm_object_t object; + struct vm_object *object; struct label *label; /* MAC label */ struct ucred *cred; /* creator's credendials */ }; +#endif -extern struct shminfo shminfo; - struct shm_info { int used_ids; unsigned long shm_tot; @@ -144,15 +146,17 @@ struct shm_info { unsigned long swap_successes; }; -struct thread; +#ifdef _KERNEL struct proc; struct vmspace; +extern struct shminfo shminfo; + void shmexit(struct vmspace *); void shmfork(struct proc *, struct proc *); -#endif /* _KERNEL */ -#if !defined(_KERNEL) || defined(_WANT_SHM_PROTOTYPES) +#else /* !_KERNEL */ + #include #ifndef _SIZE_T_DECLARED @@ -170,6 +174,6 @@ int shmctl(int, int, struct shmid_ds *); int shmdt(const void *); __END_DECLS -#endif /* _KERNEL || _WANT_SHM_PROTOTYPES */ +#endif /* _KERNEL */ #endif /* !_SYS_SHM_H_ */ Modified: head/usr.bin/ipcrm/ipcrm.c ============================================================================== --- head/usr.bin/ipcrm/ipcrm.c Fri Feb 16 01:08:32 2018 (r329347) +++ head/usr.bin/ipcrm/ipcrm.c Fri Feb 16 01:33:01 2018 (r329348) @@ -36,14 +36,12 @@ __FBSDID("$FreeBSD$"); #include -#define _WANT_MSG_PROTOTYPES -#define _WANT_SEM_PROTOTYPES -#define _WANT_SHM_PROTOTYPES -#define _KERNEL +#define _WANT_SYSVMSG_INTERNALS +#include +#define _WANT_SYSVSEM_INTERNALS #include +#define _WANT_SYSVSHM_INTERNALS #include -#include -#undef _KERNEL #include #include Modified: head/usr.bin/ipcs/ipc.h ============================================================================== --- head/usr.bin/ipcs/ipc.h Fri Feb 16 01:08:32 2018 (r329347) +++ head/usr.bin/ipcs/ipc.h Fri Feb 16 01:33:01 2018 (r329348) @@ -68,3 +68,6 @@ extern kvm_t *kd; extern struct semid_kernel *sema; extern struct msqid_kernel *msqids; extern struct shmid_kernel *shmsegs; +extern struct seminfo seminfo; +extern struct msginfo msginfo; +extern struct shminfo shminfo; From owner-svn-src-all@freebsd.org Fri Feb 16 03:12:25 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1ED1FF0D404; Fri, 16 Feb 2018 03:12:25 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C21F87F436; Fri, 16 Feb 2018 03:12:24 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BD2CA27C57; Fri, 16 Feb 2018 03:12:24 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1G3COu4085742; Fri, 16 Feb 2018 03:12:24 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1G3CO3r085739; Fri, 16 Feb 2018 03:12:24 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201802160312.w1G3CO3r085739@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Fri, 16 Feb 2018 03:12:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329349 - head/stand/lua X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/stand/lua X-SVN-Commit-Revision: 329349 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Feb 2018 03:12:25 -0000 Author: kevans Date: Fri Feb 16 03:12:24 2018 New Revision: 329349 URL: https://svnweb.freebsd.org/changeset/base/329349 Log: stand/lua: Reduce magic numbers Enter/backspace values are hardcoded in both the menu and password scripts. Separate these out to core for reuse between the two. Modified: head/stand/lua/core.lua head/stand/lua/menu.lua head/stand/lua/password.lua Modified: head/stand/lua/core.lua ============================================================================== --- head/stand/lua/core.lua Fri Feb 16 01:33:01 2018 (r329348) +++ head/stand/lua/core.lua Fri Feb 16 03:12:24 2018 (r329349) @@ -28,6 +28,10 @@ local core = {}; +-- Commonly appearing constants +core.KEY_ENTER = 13 +core.KEY_BACKSPACE = 127 + function core.setVerbose(b) if (b == nil) then b = not core.verbose; Modified: head/stand/lua/menu.lua ============================================================================== --- head/stand/lua/menu.lua Fri Feb 16 01:33:01 2018 (r329348) +++ head/stand/lua/menu.lua Fri Feb 16 03:12:24 2018 (r329349) @@ -273,9 +273,9 @@ function menu.run(m) local key = io.getchar(); -- Special key behaviors - if (key == 127) and (m ~= menu.welcome) then + if (key == core.KEY_BACKSPACE) and (m ~= menu.welcome) then break - elseif (key == 13) then + elseif (key == core.KEY_ENTER) then core.boot(); -- Should not return end @@ -357,7 +357,7 @@ function menu.autoboot() screen.defcursor(); if io.ischar() then local ch = io.getchar(); - if ch == 13 then + if ch == core.KEY_ENTER then break; else -- prevent autoboot when escaping to interpreter Modified: head/stand/lua/password.lua ============================================================================== --- head/stand/lua/password.lua Fri Feb 16 01:33:01 2018 (r329348) +++ head/stand/lua/password.lua Fri Feb 16 03:12:24 2018 (r329349) @@ -37,11 +37,11 @@ function password.read() repeat ch = io.getchar(); - if ch == 13 then + if ch == core.KEY_ENTER then break; end - if ch == 8 then + if ch == core.KEY_BACKSPACE then if n > 0 then n = n - 1; -- loader.printc("\008 \008"); From owner-svn-src-all@freebsd.org Fri Feb 16 03:14:24 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 90B76F0D6B2; Fri, 16 Feb 2018 03:14:24 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3FB367F62C; Fri, 16 Feb 2018 03:14:24 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 391EA27C60; Fri, 16 Feb 2018 03:14:24 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1G3EOsR085849; Fri, 16 Feb 2018 03:14:24 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1G3EOmI085848; Fri, 16 Feb 2018 03:14:24 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201802160314.w1G3EOmI085848@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Fri, 16 Feb 2018 03:14:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329350 - head/stand/lua X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/stand/lua X-SVN-Commit-Revision: 329350 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Feb 2018 03:14:24 -0000 Author: kevans Date: Fri Feb 16 03:14:23 2018 New Revision: 329350 URL: https://svnweb.freebsd.org/changeset/base/329350 Log: stand/lua: Don't descend into an empty kernels submenu This submenu is likely going to go away in favor of kernel selection as it is done in forth at the moment, but for the time being don't descend into it if we have no kernels available for listing. Modified: head/stand/lua/menu.lua Modified: head/stand/lua/menu.lua ============================================================================== --- head/stand/lua/menu.lua Fri Feb 16 03:12:24 2018 (r329349) +++ head/stand/lua/menu.lua Fri Feb 16 03:14:23 2018 (r329350) @@ -218,6 +218,9 @@ menu.welcome = { -- dynamically build the kernel menu: local kernels = core.kernelList(); + if #kernels == 0 then + return nil; + end for k, v in ipairs(kernels) do menu.kernel_options[#menu.kernel_options + 1] = { entry_type = "entry", From owner-svn-src-all@freebsd.org Fri Feb 16 04:03:16 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B4DE6F10B16; Fri, 16 Feb 2018 04:03:16 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6AEFE81FFD; Fri, 16 Feb 2018 04:03:16 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 65C284EB; Fri, 16 Feb 2018 04:03:16 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1G43G7x011580; Fri, 16 Feb 2018 04:03:16 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1G43GKn011579; Fri, 16 Feb 2018 04:03:16 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201802160403.w1G43GKn011579@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Fri, 16 Feb 2018 04:03:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329351 - head/stand/lua X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/stand/lua X-SVN-Commit-Revision: 329351 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Feb 2018 04:03:16 -0000 Author: kevans Date: Fri Feb 16 04:03:15 2018 New Revision: 329351 URL: https://svnweb.freebsd.org/changeset/base/329351 Log: stand/lua: Set reasonable ACPI default based on presence Set it based on hint.acpi.0.rsdp. Initially, hint.acpi.0.disabled will be respected. "Using System Defaults" will override whether it's explicitly disabled by hint and re-load it based on whether it's present on the system. Unlike the 4th version, this is not restricted to x86. I have no strong reasoning for this, so this is definitely open to change. Modified: head/stand/lua/core.lua Modified: head/stand/lua/core.lua ============================================================================== --- head/stand/lua/core.lua Fri Feb 16 03:14:23 2018 (r329350) +++ head/stand/lua/core.lua Fri Feb 16 04:03:15 2018 (r329351) @@ -58,6 +58,20 @@ function core.setSingleUser(b) core.su = b; end +function core.getACPIPresent(checkingSystemDefaults) + local c = loader.getenv("hint.acpi.0.rsdp"); + + if (c ~= nil) then + if (checkingSystemDefaults == true) then + return true; + end + -- Otherwise, respect disabled if it's set + c = loader.getenv("hint.acpi.0.disabled"); + return (c == nil) or (tonumber(c) ~= 1); + end + return false; +end + function core.setACPI(b) if (b == nil) then b = not core.acpi; @@ -120,7 +134,7 @@ function core.kernelList() end function core.setDefaults() - core.setACPI(true); + core.setACPI(core.getACPIPresent(true)); core.setSafeMode(false); core.setSingleUser(false); core.setVerbose(false); @@ -155,4 +169,5 @@ function core.bootserial() return false; end +core.acpi = core.getACPIPresent(false) return core From owner-svn-src-all@freebsd.org Fri Feb 16 04:10:11 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C7C7DF111FD; Fri, 16 Feb 2018 04:10:11 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7117C8232B; Fri, 16 Feb 2018 04:10:11 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5A2174F1; Fri, 16 Feb 2018 04:10:11 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1G4ABPT011994; Fri, 16 Feb 2018 04:10:11 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1G4ABRs011993; Fri, 16 Feb 2018 04:10:11 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201802160410.w1G4ABRs011993@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Fri, 16 Feb 2018 04:10:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329352 - head/stand/lua X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/stand/lua X-SVN-Commit-Revision: 329352 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Feb 2018 04:10:12 -0000 Author: kevans Date: Fri Feb 16 04:10:10 2018 New Revision: 329352 URL: https://svnweb.freebsd.org/changeset/base/329352 Log: stand/lua: Consistently use semicolons for line endings Modified: head/stand/lua/core.lua Modified: head/stand/lua/core.lua ============================================================================== --- head/stand/lua/core.lua Fri Feb 16 04:03:15 2018 (r329351) +++ head/stand/lua/core.lua Fri Feb 16 04:10:10 2018 (r329352) @@ -29,8 +29,8 @@ local core = {}; -- Commonly appearing constants -core.KEY_ENTER = 13 -core.KEY_BACKSPACE = 127 +core.KEY_ENTER = 13; +core.KEY_BACKSPACE = 127; function core.setVerbose(b) if (b == nil) then @@ -169,5 +169,5 @@ function core.bootserial() return false; end -core.acpi = core.getACPIPresent(false) +core.acpi = core.getACPIPresent(false); return core From owner-svn-src-all@freebsd.org Fri Feb 16 04:22:30 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 03B4DF120C8; Fri, 16 Feb 2018 04:22:30 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AA61F82E5E; Fri, 16 Feb 2018 04:22: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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A53D680D; Fri, 16 Feb 2018 04:22: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 w1G4MTri021809; Fri, 16 Feb 2018 04:22:29 GMT (envelope-from dteske@FreeBSD.org) Received: (from dteske@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1G4MTEx021808; Fri, 16 Feb 2018 04:22:29 GMT (envelope-from dteske@FreeBSD.org) Message-Id: <201802160422.w1G4MTEx021808@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dteske set sender to dteske@FreeBSD.org using -f From: Devin Teske Date: Fri, 16 Feb 2018 04:22:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329353 - head/cddl/lib/libdtrace X-SVN-Group: head X-SVN-Commit-Author: dteske X-SVN-Commit-Paths: head/cddl/lib/libdtrace X-SVN-Commit-Revision: 329353 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Feb 2018 04:22:30 -0000 Author: dteske Date: Fri Feb 16 04:22:29 2018 New Revision: 329353 URL: https://svnweb.freebsd.org/changeset/base/329353 Log: Add inline to errno.d for translating int to string Gives DTrace scripts strerror(3) functionality. Reviewed by: markj Sponsored by: Smule, Inc. Differential Revision: https://reviews.freebsd.org/D14386 Modified: head/cddl/lib/libdtrace/errno.d Modified: head/cddl/lib/libdtrace/errno.d ============================================================================== --- head/cddl/lib/libdtrace/errno.d Fri Feb 16 04:10:10 2018 (r329352) +++ head/cddl/lib/libdtrace/errno.d Fri Feb 16 04:22:29 2018 (r329353) @@ -20,6 +20,7 @@ * CDDL HEADER END * * Portions Copyright 2006-2008 John Birrell jb@freebsd.org + * Portions Copyright 2018 Devin Teske dteske@freebsd.org * * $FreeBSD$ */ @@ -236,3 +237,112 @@ inline int EDIRIOCTL = -4; #pragma D binding "1.0" EDIRIOCTL inline int ERELOOKUP = -5; #pragma D binding "1.13" ERELOOKUP + +/* + * Error strings from + */ +#pragma D binding "1.13" strerror +inline string strerror[int errno] = + errno == 0 ? "Success" : + errno == EPERM ? "Operation not permitted" : + errno == ENOENT ? "No such file or directory" : + errno == ESRCH ? "No such process" : + errno == EINTR ? "Interrupted system call" : + errno == EIO ? "Input/output error" : + errno == ENXIO ? "Device not configured" : + errno == E2BIG ? "Argument list too long" : + errno == ENOEXEC ? "Exec format error" : + errno == EBADF ? "Bad file descriptor" : + errno == ECHILD ? "No child processes" : + errno == EDEADLK ? "Resource deadlock avoided" : + errno == ENOMEM ? "Cannot allocate memory" : + errno == EACCES ? "Permission denied" : + errno == EFAULT ? "Bad address" : + errno == ENOTBLK ? "Block device required" : + errno == EBUSY ? "Device busy" : + errno == EEXIST ? "File exists" : + errno == EXDEV ? "Cross-device link" : + errno == ENODEV ? "Operation not supported by device" : + errno == ENOTDIR ? "Not a directory" : + errno == EISDIR ? "Is a directory" : + errno == EINVAL ? "Invalid argument" : + errno == ENFILE ? "Too many open files in system" : + errno == EMFILE ? "Too many open files" : + errno == ENOTTY ? "Inappropriate ioctl for device" : + errno == ETXTBSY ? "Text file busy" : + errno == EFBIG ? "File too large" : + errno == ENOSPC ? "No space left on device" : + errno == ESPIPE ? "Illegal seek" : + errno == EROFS ? "Read-only filesystem" : + errno == EMLINK ? "Too many links" : + errno == EPIPE ? "Broken pipe" : + errno == EDOM ? "Numerical argument out of domain" : + errno == ERANGE ? "Result too large" : + errno == EAGAIN ? "Resource temporarily unavailable" : + errno == EINPROGRESS ? "Operation now in progress" : + errno == EALREADY ? "Operation already in progress" : + errno == ENOTSOCK ? "Socket operation on non-socket" : + errno == EDESTADDRREQ ? "Destination address required" : + errno == EMSGSIZE ? "Message too long" : + errno == EPROTOTYPE ? "Protocol wrong type for socket" : + errno == ENOPROTOOPT ? "Protocol not available" : + errno == EPROTONOSUPPORT ? "Protocol not supported" : + errno == ESOCKTNOSUPPORT ? "Socket type not supported" : + errno == EOPNOTSUPP ? "Operation not supported" : + errno == EPFNOSUPPORT ? "Protocol family not supported" : + errno == EAFNOSUPPORT ? "Address family not supported by protocol family" : + errno == EADDRINUSE ? "Address already in use" : + errno == EADDRNOTAVAIL ? "Can't assign requested address" : + errno == ENETDOWN ? "Network is down" : + errno == ENETUNREACH ? "Network is unreachable" : + errno == ENETRESET ? "Network dropped connection on reset" : + errno == ECONNABORTED ? "Software caused connection abort" : + errno == ECONNRESET ? "Connection reset by peer" : + errno == ENOBUFS ? "No buffer space available" : + errno == EISCONN ? "Socket is already connected" : + errno == ENOTCONN ? "Socket is not connected" : + errno == ESHUTDOWN ? "Can't send after socket shutdown" : + errno == ETOOMANYREFS ? "Too many references: can't splice" : + errno == ETIMEDOUT ? "Operation timed out" : + errno == ECONNREFUSED ? "Connection refused" : + errno == ELOOP ? "Too many levels of symbolic links" : + errno == ENAMETOOLONG ? "File name too long" : + errno == EHOSTDOWN ? "Host is down" : + errno == EHOSTUNREACH ? "No route to host" : + errno == ENOTEMPTY ? "Directory not empty" : + errno == EPROCLIM ? "Too many processes" : + errno == EUSERS ? "Too many users" : + errno == EDQUOT ? "Disc quota exceeded" : + errno == ESTALE ? "Stale NFS file handle" : + errno == EREMOTE ? "Too many levels of remote in path" : + errno == EBADRPC ? "RPC struct is bad" : + errno == ERPCMISMATCH ? "RPC version wrong" : + errno == EPROGUNAVAIL ? "RPC prog. not avail" : + errno == EPROGMISMATCH ? "Program version wrong" : + errno == EPROCUNAVAIL ? "Bad procedure for program" : + errno == ENOLCK ? "No locks available" : + errno == ENOSYS ? "Function not implemented" : + errno == EFTYPE ? "Inappropriate file type or format" : + errno == EAUTH ? "Authentication error" : + errno == ENEEDAUTH ? "Need authenticator" : + errno == EIDRM ? "Identifier removed" : + errno == ENOMSG ? "No message of desired type" : + errno == EOVERFLOW ? "Value too large to be stored in data type" : + errno == ECANCELED ? "Operation canceled" : + errno == EILSEQ ? "Illegal byte sequence" : + errno == ENOATTR ? "Attribute not found" : + errno == EDOOFUS ? "Programming error" : + errno == EBADMSG ? "Bad message" : + errno == EMULTIHOP ? "Multihop attempted" : + errno == ENOLINK ? "Link has been severed" : + errno == EPROTO ? "Protocol error" : + errno == ENOTCAPABLE ? "Capabilities insufficient" : + errno == ECAPMODE ? "Not permitted in capability mode" : + errno == ENOTRECOVERABLE ? "State not recoverable" : + errno == EOWNERDEAD ? "Previous owner died" : + errno == ERESTART ? "restart syscall" : + errno == EJUSTRETURN ? "don't modify regs, just return" : + errno == ENOIOCTL ? "ioctl not handled by this layer" : + errno == EDIRIOCTL ? "do direct ioctl in GEOM" : + errno == ERELOOKUP ? "retry the directory lookup" : + "Unknown error"; From owner-svn-src-all@freebsd.org Fri Feb 16 04:30:58 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 245A6F1295F; Fri, 16 Feb 2018 04:30:58 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C9E1B832AB; Fri, 16 Feb 2018 04:30:57 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C4BEE82D; Fri, 16 Feb 2018 04:30:57 +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 w1G4Uvbd022334; Fri, 16 Feb 2018 04:30:57 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1G4UvCr022333; Fri, 16 Feb 2018 04:30:57 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201802160430.w1G4UvCr022333@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Fri, 16 Feb 2018 04:30:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329354 - head/usr.sbin/trpt X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/usr.sbin/trpt X-SVN-Commit-Revision: 329354 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Feb 2018 04:30:58 -0000 Author: cem Date: Fri Feb 16 04:30:57 2018 New Revision: 329354 URL: https://svnweb.freebsd.org/changeset/base/329354 Log: trpt(8): Work around GCC4 shenanigans Reduce warns to known good value and do not add -Wno- flag the ancient GCC4 does not understand. Reported by: jhibbits Sponsored by: Dell EMC Isilon Modified: head/usr.sbin/trpt/Makefile Modified: head/usr.sbin/trpt/Makefile ============================================================================== --- head/usr.sbin/trpt/Makefile Fri Feb 16 04:22:29 2018 (r329353) +++ head/usr.sbin/trpt/Makefile Fri Feb 16 04:30:57 2018 (r329354) @@ -8,12 +8,20 @@ MAN= trpt.8 BINGRP= kmem BINMODE= 2555 +.if ${MACHINE_CPUARCH} != "aarch64" && ${MACHINE_CPUARCH} != "amd64" && \ + ${MACHINE_CPUARCH} != "i386" && ${MACHINE_CPUARCH} != "riscv" +WARNS?= 4 +.endif + .if ${MK_INET6_SUPPORT} != "no" CFLAGS+= -DINET6 .endif .include +.if ${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "amd64" || \ + ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "riscv" # Several included system headers tickle this warning in ways that are # difficult to work around in this program. CFLAGS+= -Wno-missing-variable-declarations +.endif From owner-svn-src-all@freebsd.org Fri Feb 16 04:31:10 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D1839F12ACC; Fri, 16 Feb 2018 04:31:09 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8467A833B3; Fri, 16 Feb 2018 04:31:09 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7F7DD83B; Fri, 16 Feb 2018 04:31:09 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1G4V9AQ022399; Fri, 16 Feb 2018 04:31:09 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1G4V9iu022398; Fri, 16 Feb 2018 04:31:09 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201802160431.w1G4V9iu022398@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Fri, 16 Feb 2018 04:31:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329355 - head/stand/lua X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/stand/lua X-SVN-Commit-Revision: 329355 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Feb 2018 04:31:10 -0000 Author: kevans Date: Fri Feb 16 04:31:09 2018 New Revision: 329355 URL: https://svnweb.freebsd.org/changeset/base/329355 Log: stand/lua: Move kernel selection into main menu This matches the corresponding 4th behavior. Modified: head/stand/lua/menu.lua Modified: head/stand/lua/menu.lua ============================================================================== --- head/stand/lua/menu.lua Fri Feb 16 04:30:57 2018 (r329354) +++ head/stand/lua/menu.lua Fri Feb 16 04:31:09 2018 (r329355) @@ -39,26 +39,14 @@ local OnOff; local skip; local run; local autoboot; +local current_kernel_index = 1; --loader menu tree: --rooted at menu.welcome --submenu declarations: -local kernel_options; local boot_options; local welcome; -menu.kernel_options = { - -- this table is dynamically appended to when accessed - -- return to welcome menu - { - entry_type = "return", - name = function() - return "Back to main menu"..color.highlight(" [Backspace]"); - end, - alias = {"\08"} - } -}; - menu.boot_options = { -- return to welcome menu { @@ -206,35 +194,34 @@ menu.welcome = { -- kernel options { - entry_type = "submenu", + entry_type = "entry", name = function() local kernels = core.kernelList(); if #kernels == 0 then - return "Kernels (not available)"; + return "Kernel: "; end - return color.highlight("K").."ernels"; + + local kernel_name = color.escapef(color.GREEN) .. + kernels[current_kernel_index] .. color.default(); + if (current_kernel_index == 1) then + kernel_name = "default/" .. kernel_name; + end + return color.highlight("K").."ernel: " .. kernel_name .. + " (" .. current_kernel_index .. + " of " .. #kernels .. ")"; end, - submenu = function() + func = function() -- dynamically build the kernel menu: local kernels = core.kernelList(); - if #kernels == 0 then + -- Don't do anything if we don't have multiple kernels + if #kernels <= 1 then return nil; end - for k, v in ipairs(kernels) do - menu.kernel_options[#menu.kernel_options + 1] = { - entry_type = "entry", - name = function() - return v; - end, - func = function() - config.reload(v); - end, - alias = {} -- automatically enumerated - } - end - - return menu.kernel_options; + current_kernel_index = (current_kernel_index % #kernels) + + 1; + local current_kernel = kernels[current_kernel_index]; + config.reload(current_kernel) end, alias = {"k", "K"} }, From owner-svn-src-all@freebsd.org Fri Feb 16 04:44:48 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3F6FBF13C75; Fri, 16 Feb 2018 04:44:48 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E6F1A84040; Fri, 16 Feb 2018 04:44:47 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DDB12B5D; Fri, 16 Feb 2018 04:44:47 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1G4ilch031908; Fri, 16 Feb 2018 04:44:47 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1G4il7X031907; Fri, 16 Feb 2018 04:44:47 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201802160444.w1G4il7X031907@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Fri, 16 Feb 2018 04:44:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329356 - head/stand/lua X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/stand/lua X-SVN-Commit-Revision: 329356 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Feb 2018 04:44:48 -0000 Author: kevans Date: Fri Feb 16 04:44:47 2018 New Revision: 329356 URL: https://svnweb.freebsd.org/changeset/base/329356 Log: stand/lua: Allow menu items to not have explicit aliases This will generally be used for cases like "Back to main menu" that already have global aliases installed. Modified: head/stand/lua/drawer.lua Modified: head/stand/lua/drawer.lua ============================================================================== --- head/stand/lua/drawer.lua Fri Feb 16 04:31:09 2018 (r329355) +++ head/stand/lua/drawer.lua Fri Feb 16 04:44:47 2018 (r329356) @@ -173,8 +173,10 @@ function drawer.drawmenu(m) -- fill the alias table alias_table[tostring(entry_num)] = e; - for n, a in ipairs(e.alias) do - alias_table[a] = e; + if (e.alias ~= nil) then + for n, a in ipairs(e.alias) do + alias_table[a] = e; + end end else screen.setcursor(x, y + line_num); From owner-svn-src-all@freebsd.org Fri Feb 16 04:45:54 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 641A0F13DB0; Fri, 16 Feb 2018 04:45:54 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3B6E0841AF; Fri, 16 Feb 2018 04:45:54 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 362AEB5E; Fri, 16 Feb 2018 04:45:54 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1G4js5x032004; Fri, 16 Feb 2018 04:45:54 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1G4jsoq032003; Fri, 16 Feb 2018 04:45:54 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201802160445.w1G4jsoq032003@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Fri, 16 Feb 2018 04:45:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329357 - head/stand/lua X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/stand/lua X-SVN-Commit-Revision: 329357 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Feb 2018 04:45:54 -0000 Author: kevans Date: Fri Feb 16 04:45:53 2018 New Revision: 329357 URL: https://svnweb.freebsd.org/changeset/base/329357 Log: stand/lua: Remove explicit alias from "Back to main menu" This removes a redundant alias that has since been converted into a global alias. It was converted to a global alias before to ensure that we always have a way to go up one level in the menu. Modified: head/stand/lua/menu.lua Modified: head/stand/lua/menu.lua ============================================================================== --- head/stand/lua/menu.lua Fri Feb 16 04:44:47 2018 (r329356) +++ head/stand/lua/menu.lua Fri Feb 16 04:45:53 2018 (r329357) @@ -53,8 +53,7 @@ menu.boot_options = { entry_type = "return", name = function() return "Back to main menu"..color.highlight(" [Backspace]"); - end, - alias = {"\08"} + end }, -- load defaults From owner-svn-src-all@freebsd.org Fri Feb 16 04:50:15 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EBDCCF1423B; Fri, 16 Feb 2018 04:50:14 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9B91B843F4; Fri, 16 Feb 2018 04:50:14 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 92808B63; Fri, 16 Feb 2018 04:50:14 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1G4oEVL032265; Fri, 16 Feb 2018 04:50:14 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1G4oEXI032264; Fri, 16 Feb 2018 04:50:14 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201802160450.w1G4oEXI032264@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Fri, 16 Feb 2018 04:50:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329358 - head/stand/lua X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/stand/lua X-SVN-Commit-Revision: 329358 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Feb 2018 04:50:15 -0000 Author: kevans Date: Fri Feb 16 04:50:14 2018 New Revision: 329358 URL: https://svnweb.freebsd.org/changeset/base/329358 Log: stand/lua: Say "loader prompt" instead of "lua interpreter" Noting that we're in lualoader is nice, but it's not a difference we raelly need to expose to Fred. Re-word it to match the 4th wording and reduce differences. Modified: head/stand/lua/menu.lua Modified: head/stand/lua/menu.lua ============================================================================== --- head/stand/lua/menu.lua Fri Feb 16 04:45:53 2018 (r329357) +++ head/stand/lua/menu.lua Fri Feb 16 04:50:14 2018 (r329358) @@ -159,7 +159,7 @@ menu.welcome = { { entry_type = "return", name = function() - return color.highlight("Esc").."ape to lua interpreter"; + return color.highlight("Esc").."ape to loader prompt"; end, alias = {"\027"} }, From owner-svn-src-all@freebsd.org Fri Feb 16 04:59:22 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E5EABF14CC7; Fri, 16 Feb 2018 04:59:21 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9A82184A59; Fri, 16 Feb 2018 04:59:21 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 90C7ECF6; Fri, 16 Feb 2018 04:59:21 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1G4xLrc037121; Fri, 16 Feb 2018 04:59:21 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1G4xLe9037119; Fri, 16 Feb 2018 04:59:21 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201802160459.w1G4xLe9037119@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Fri, 16 Feb 2018 04:59:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329359 - head/stand/lua X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/stand/lua X-SVN-Commit-Revision: 329359 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Feb 2018 04:59:22 -0000 Author: kevans Date: Fri Feb 16 04:59:21 2018 New Revision: 329359 URL: https://svnweb.freebsd.org/changeset/base/329359 Log: stand/lua: Remove a magic number/string (not a trivial literal) We'll arbitrarily use KEYSTR_ for string representations of non-trivial characters. Modified: head/stand/lua/core.lua head/stand/lua/menu.lua Modified: head/stand/lua/core.lua ============================================================================== --- head/stand/lua/core.lua Fri Feb 16 04:50:14 2018 (r329358) +++ head/stand/lua/core.lua Fri Feb 16 04:59:21 2018 (r329359) @@ -32,6 +32,8 @@ local core = {}; core.KEY_ENTER = 13; core.KEY_BACKSPACE = 127; +core.KEYSTR_ESCAPE = "\027"; + function core.setVerbose(b) if (b == nil) then b = not core.verbose; Modified: head/stand/lua/menu.lua ============================================================================== --- head/stand/lua/menu.lua Fri Feb 16 04:50:14 2018 (r329358) +++ head/stand/lua/menu.lua Fri Feb 16 04:59:21 2018 (r329359) @@ -161,7 +161,7 @@ menu.welcome = { name = function() return color.highlight("Esc").."ape to loader prompt"; end, - alias = {"\027"} + alias = {core.KEYSTR_ESCAPE} }, -- reboot From owner-svn-src-all@freebsd.org Fri Feb 16 05:17:02 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C66DDF15ED2; Fri, 16 Feb 2018 05:17:01 +0000 (UTC) (envelope-from anish@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7873F853BC; Fri, 16 Feb 2018 05:17:01 +0000 (UTC) (envelope-from anish@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6F0F0102D; Fri, 16 Feb 2018 05:17:01 +0000 (UTC) (envelope-from anish@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1G5H1nZ047282; Fri, 16 Feb 2018 05:17:01 GMT (envelope-from anish@FreeBSD.org) Received: (from anish@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1G5H1XH047278; Fri, 16 Feb 2018 05:17:01 GMT (envelope-from anish@FreeBSD.org) Message-Id: <201802160517.w1G5H1XH047278@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: anish set sender to anish@FreeBSD.org using -f From: Anish Gupta Date: Fri, 16 Feb 2018 05:17:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329360 - in head/sys: amd64/vmm/amd contrib/dev/acpica/include X-SVN-Group: head X-SVN-Commit-Author: anish X-SVN-Commit-Paths: in head/sys: amd64/vmm/amd contrib/dev/acpica/include X-SVN-Commit-Revision: 329360 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Feb 2018 05:17:02 -0000 Author: anish Date: Fri Feb 16 05:17:00 2018 New Revision: 329360 URL: https://svnweb.freebsd.org/changeset/base/329360 Log: This change fixes duplicate detection of same IOMMU/AMD-Vi device for Ryzen with EFR support. IVRS can have entry of type legacy and non-legacy present at same time for same AMD-Vi device. ivhd driver will ignore legacy if new IVHD type is present as specified in AMD-Vi specification. Earlier both of IVHD entries used and two ivhd devices were created. Add support for new IVHD type 0x11 and 0x40 in ACPI. Create new struct of type acpi_ivrs_hardware_new for these new type of IVHDs. Legacy type 0x10 will continue to use acpi_ivrs_hardware. Reviewed by: avg Approved by: grehan Differential Revision:https://reviews.freebsd.org/D13160 Modified: head/sys/amd64/vmm/amd/amdvi_hw.c head/sys/amd64/vmm/amd/amdvi_priv.h head/sys/amd64/vmm/amd/ivrs_drv.c head/sys/contrib/dev/acpica/include/actbl2.h Modified: head/sys/amd64/vmm/amd/amdvi_hw.c ============================================================================== --- head/sys/amd64/vmm/amd/amdvi_hw.c Fri Feb 16 04:59:21 2018 (r329359) +++ head/sys/amd64/vmm/amd/amdvi_hw.c Fri Feb 16 05:17:00 2018 (r329360) @@ -745,23 +745,8 @@ amdvi_print_pci_cap(device_t dev) softc->pci_cap = cap >> 24; device_printf(softc->dev, "PCI cap 0x%x@0x%x feature:%b\n", cap, off, softc->pci_cap, - "\020\001IOTLB\002HT\003NPCache\004EFR"); + "\20\1IOTLB\2HT\3NPCache\4EFR\5CapExt"); - /* IOMMU spec Rev 2.0, section 3.7.2.1 */ - softc->pci_efr = softc->ctrl->ex_feature; - if (softc->pci_efr) { - device_printf(softc->dev, "PCI extended Feature:%b\n", - (int)softc->pci_efr, - "\020\001PreFSup\002PPRSup\003XTSup\004NXSup\006IASup" - "\007GASup\008HESup\009PCSup"); - device_printf(softc->dev, - "PCI HATS = %d GATS = %d GLXSup = %d, max PASID: 0x%x ", - (int)((softc->pci_efr >> 10) & 0x3), - (int)((softc->pci_efr >> 12) & 0x3), - (int)((softc->pci_efr >> 14) & 0x3), - (int)((softc->pci_efr >> 32) & 0x1F) + 1); - } - return (0); } @@ -1040,7 +1025,7 @@ amdvi_init(void) } if (!amdvi_enable_user && ivhd_count) { printf("bhyve: Found %d AMD-Vi/IOMMU device(s), " - "use hw.vmm.amdvi_enable=1 to enable pass-through.\n", + "use hw.vmm.amdvi.enable=1 to enable pass-through.\n", ivhd_count); return (EINVAL); } @@ -1315,40 +1300,41 @@ static void amdvi_set_dte(struct amdvi_domain *domain, uint16_t devid, bool enable) { struct amdvi_softc *softc; - struct amdvi_dte temp; + struct amdvi_dte* temp; + KASSERT(domain, ("domain is NULL for pci_rid:0x%x\n", devid)); + softc = amdvi_find_iommu(devid); KASSERT(softc, ("softc is NULL for pci_rid:0x%x\n", devid)); - memset(&temp, 0, sizeof(struct amdvi_dte)); + temp = &amdvi_dte[devid]; #ifdef AMDVI_ATS_ENABLE /* If IOMMU and device support IOTLB, enable it. */ if (amdvi_dev_support_iotlb(softc, devid) && softc->iotlb) - temp.iotlb_enable = 1; + temp->iotlb_enable = 1; #endif /* Avoid duplicate I/O faults. */ - temp.sup_second_io_fault = 1; - temp.sup_all_io_fault = amdvi_disable_io_fault; + temp->sup_second_io_fault = 1; + temp->sup_all_io_fault = amdvi_disable_io_fault; - temp.dt_valid = 1; - temp.domain_id = domain->id; + temp->dt_valid = 1; + temp->domain_id = domain->id; if (enable) { if (domain->ptp) { - temp.pt_base = vtophys(domain->ptp) >> 12; - temp.pt_level = amdvi_ptp_level; + temp->pt_base = vtophys(domain->ptp) >> 12; + temp->pt_level = amdvi_ptp_level; } /* * XXX: Page table valid[TV] bit must be set even if host domain * page tables are not enabled. */ - temp.pt_valid = 1; - temp.read_allow = 1; - temp.write_allow = 1; + temp->pt_valid = 1; + temp->read_allow = 1; + temp->write_allow = 1; } - amdvi_dte[devid] = temp; } static void Modified: head/sys/amd64/vmm/amd/amdvi_priv.h ============================================================================== --- head/sys/amd64/vmm/amd/amdvi_priv.h Fri Feb 16 04:59:21 2018 (r329359) +++ head/sys/amd64/vmm/amd/amdvi_priv.h Fri Feb 16 05:17:00 2018 (r329360) @@ -29,6 +29,8 @@ #ifndef _AMDVI_PRIV_H_ #define _AMDVI_PRIV_H_ +#include + #define BIT(n) (1ULL << (n)) /* Return value of bits[n:m] where n and (n >= ) m are bit positions. */ #define REG_BITS(x, n, m) (((x) >> (m)) & \ @@ -358,6 +360,7 @@ struct amdvi_domain { struct amdvi_softc { struct amdvi_ctrl *ctrl; /* Control area. */ device_t dev; /* IOMMU device. */ + enum AcpiIvrsType ivhd_type; /* IOMMU IVHD type 0x10/0x11 or 0x40 */ bool iotlb; /* IOTLB supported by IOMMU */ struct amdvi_cmd *cmd; /* Command descriptor area. */ int cmd_max; /* Max number of commands. */ @@ -370,11 +373,11 @@ struct amdvi_softc { int event_rid; /* ACPI various flags. */ uint32_t ivhd_flag; /* ACPI IVHD flag. */ - uint32_t ivhd_efr; /* ACPI v1 Reserved or v2 EFR . */ + uint32_t ivhd_feature; /* ACPI v1 Reserved or v2 attribute. */ + uint64_t ext_feature; /* IVHD EFR */ /* PCI related. */ uint16_t cap_off; /* PCI Capability offset. */ uint8_t pci_cap; /* PCI capability. */ - uint64_t pci_efr; /* PCI EFR for rev2.0 */ uint16_t pci_seg; /* IOMMU PCI domain/segment. */ uint16_t pci_rid; /* PCI BDF of IOMMU */ /* Device range under this IOMMU. */ Modified: head/sys/amd64/vmm/amd/ivrs_drv.c ============================================================================== --- head/sys/amd64/vmm/amd/ivrs_drv.c Fri Feb 16 04:59:21 2018 (r329359) +++ head/sys/amd64/vmm/amd/ivrs_drv.c Fri Feb 16 05:17:00 2018 (r329360) @@ -47,12 +47,16 @@ __FBSDID("$FreeBSD$"); #include "amdvi_priv.h" device_t *ivhd_devs; /* IVHD or AMD-Vi device list. */ -int ivhd_count; /* Number of IVHD or AMD-Vi devices. */ +int ivhd_count; /* Number of IVHD header. */ +/* + * Cached IVHD header list. + * Single entry for each IVHD, filtered the legacy one. + */ +ACPI_IVRS_HARDWARE *ivhd_hdrs[10]; extern int amdvi_ptp_level; /* Page table levels. */ -typedef int (*ivhd_iter_t)(ACPI_IVRS_HEADER * ptr, void *arg); - +typedef int (*ivhd_iter_t)(ACPI_IVRS_HEADER *ptr, void *arg); /* * Iterate IVRS table for IVHD and IVMD device type. */ @@ -107,14 +111,19 @@ ivrs_hdr_iterate_tbl(ivhd_iter_t iter, void *arg) } } -static int +static bool ivrs_is_ivhd(UINT8 type) { - if ((type == ACPI_IVRS_TYPE_HARDWARE) || (type == 0x11) || (type == 0x40)) - return (1); + switch(type) { + case ACPI_IVRS_TYPE_HARDWARE: + case ACPI_IVRS_TYPE_HARDWARE_EXT1: + case ACPI_IVRS_TYPE_HARDWARE_EXT2: + return (true); - return (0); + default: + return (false); + } } /* Count the number of AMD-Vi devices in the system. */ @@ -184,7 +193,7 @@ ivhd_dev_add_entry(struct amdvi_softc *softc, uint32_t * Record device attributes as suggested by BIOS. */ static int -ivhd_dev_parse(ACPI_IVRS_HARDWARE * ivhd, struct amdvi_softc *softc) +ivhd_dev_parse(ACPI_IVRS_HARDWARE* ivhd, struct amdvi_softc *softc) { ACPI_IVRS_DE_HEADER *de; uint8_t *p, *end; @@ -196,11 +205,26 @@ ivhd_dev_parse(ACPI_IVRS_HARDWARE * ivhd, struct amdvi softc->start_dev_rid = ~0; softc->end_dev_rid = 0; - /* - * XXX The following actually depends on Header.Type and - * is only true for 0x10. - */ - p = (uint8_t *)ivhd + sizeof(ACPI_IVRS_HARDWARE); + switch (ivhd->Header.Type) { + case ACPI_IVRS_TYPE_HARDWARE_EXT1: + case ACPI_IVRS_TYPE_HARDWARE_EXT2: + p = (uint8_t *)ivhd + sizeof(ACPI_IVRS_HARDWARE_NEW); + de = (ACPI_IVRS_DE_HEADER *) ((uint8_t *)ivhd + + sizeof(ACPI_IVRS_HARDWARE_NEW)); + break; + + case ACPI_IVRS_TYPE_HARDWARE: + p = (uint8_t *)ivhd + sizeof(ACPI_IVRS_HARDWARE); + de = (ACPI_IVRS_DE_HEADER *) ((uint8_t *)ivhd + + sizeof(ACPI_IVRS_HARDWARE)); + break; + + default: + device_printf(softc->dev, + "unknown type: 0x%x\n", ivhd->Header.Type); + return (-1); + } + end = (uint8_t *)ivhd + ivhd->Header.Length; while (p < end) { @@ -285,14 +309,30 @@ ivhd_dev_parse(ACPI_IVRS_HARDWARE * ivhd, struct amdvi return (0); } +static bool +ivhd_is_newer(ACPI_IVRS_HEADER *old, ACPI_IVRS_HEADER *new) +{ + /* + * Newer IVRS header type take precedence. + */ + if ((old->DeviceId == new->DeviceId) && + (old->Type == ACPI_IVRS_TYPE_HARDWARE) && + ((new->Type == ACPI_IVRS_TYPE_HARDWARE_EXT1) || + (new->Type == ACPI_IVRS_TYPE_HARDWARE_EXT1))) { + return (true); + } + + return (false); +} + static void ivhd_identify(driver_t *driver, device_t parent) { ACPI_TABLE_IVRS *ivrs; ACPI_IVRS_HARDWARE *ivhd; ACPI_STATUS status; - uint32_t info; int i, count = 0; + uint32_t ivrs_ivinfo; if (acpi_disabled("ivhd")) return; @@ -305,25 +345,41 @@ ivhd_identify(driver_t *driver, device_t parent) return; } - info = ivrs->Info; - printf("AMD-Vi IVRS VAsize = %d PAsize = %d GVAsize = %d flags:%b\n", - REG_BITS(info, 21, 15), REG_BITS(info, 14, 8), - REG_BITS(info, 7, 5), REG_BITS(info, 22, 22), - "\020\001HtAtsResv"); + ivrs_ivinfo = ivrs->Info; + printf("AMD-Vi: IVRS Info VAsize = %d PAsize = %d GVAsize = %d" + " flags:%b\n", + REG_BITS(ivrs_ivinfo, 21, 15), REG_BITS(ivrs_ivinfo, 14, 8), + REG_BITS(ivrs_ivinfo, 7, 5), REG_BITS(ivrs_ivinfo, 22, 22), + "\020\001EFRSup"); ivrs_hdr_iterate_tbl(ivhd_count_iter, NULL); if (!ivhd_count) return; - ivhd_devs = malloc(sizeof(device_t) * ivhd_count, M_DEVBUF, - M_WAITOK | M_ZERO); for (i = 0; i < ivhd_count; i++) { ivhd = ivhd_find_by_index(i); - if (ivhd == NULL) { - printf("Can't find IVHD entry%d\n", i); - continue; + KASSERT(ivhd, ("ivhd%d is NULL\n", i)); + ivhd_hdrs[i] = ivhd; + } + + /* + * Scan for presence of legacy and non-legacy device type + * for same AMD-Vi device and override the old one. + */ + for (i = ivhd_count - 1 ; i > 0 ; i--){ + if (ivhd_is_newer(&ivhd_hdrs[i-1]->Header, + &ivhd_hdrs[i]->Header)) { + ivhd_hdrs[i-1] = ivhd_hdrs[i]; + ivhd_count--; } + } + ivhd_devs = malloc(sizeof(device_t) * ivhd_count, M_DEVBUF, + M_WAITOK | M_ZERO); + for (i = 0; i < ivhd_count; i++) { + ivhd = ivhd_hdrs[i]; + KASSERT(ivhd, ("ivhd%d is NULL\n", i)); + /* * Use a high order to ensure that this driver is probed after * the Host-PCI bridge and the root PCI bus. @@ -338,7 +394,7 @@ ivhd_identify(driver_t *driver, device_t parent) if (ivhd_devs[i] == NULL) { ivhd_devs[i] = device_find_child(parent, "ivhd", i); if (ivhd_devs[i] == NULL) { - printf("AMD-Vi: cant find AMD-Vi dev%d\n", i); + printf("AMD-Vi: cant find ivhd%d\n", i); break; } } @@ -354,14 +410,169 @@ ivhd_identify(driver_t *driver, device_t parent) static int ivhd_probe(device_t dev) { + ACPI_IVRS_HARDWARE *ivhd; + int unit; if (acpi_get_handle(dev) != NULL) return (ENXIO); - device_set_desc(dev, "AMD-Vi/IOMMU or ivhd"); + unit = device_get_unit(dev); + KASSERT((unit < ivhd_count), + ("ivhd unit %d > count %d", unit, ivhd_count)); + ivhd = ivhd_hdrs[unit]; + KASSERT(ivhd, ("ivhd is NULL")); + + if (ivhd->Header.Type == ACPI_IVRS_TYPE_HARDWARE) + device_set_desc(dev, "AMD-Vi/IOMMU ivhd"); + else + device_set_desc(dev, "AMD-Vi/IOMMU ivhd with EFR"); + return (BUS_PROBE_NOWILDCARD); } +static void +ivhd_print_flag(device_t dev, enum AcpiIvrsType ivhd_type, uint8_t flag) +{ + /* + * IVHD lgeacy type has two extra high bits in flag which has + * been moved to EFR for non-legacy device. + */ + switch (ivhd_type) { + case ACPI_IVRS_TYPE_HARDWARE: + device_printf(dev, "Flag:%b\n", flag, + "\020" + "\001HtTunEn" + "\002PassPW" + "\003ResPassPW" + "\004Isoc" + "\005IotlbSup" + "\006Coherent" + "\007PreFSup" + "\008PPRSup"); + break; + + case ACPI_IVRS_TYPE_HARDWARE_EXT1: + case ACPI_IVRS_TYPE_HARDWARE_EXT2: + device_printf(dev, "Flag:%b\n", flag, + "\020" + "\001HtTunEn" + "\002PassPW" + "\003ResPassPW" + "\004Isoc" + "\005IotlbSup" + "\006Coherent"); + break; + + default: + device_printf(dev, "Can't decode flag of ivhd type :0x%x\n", + ivhd_type); + break; + } +} + +/* + * Feature in legacy IVHD type(0x10) and attribute in newer type(0x11 and 0x40). + */ +static void +ivhd_print_feature(device_t dev, enum AcpiIvrsType ivhd_type, uint32_t feature) +{ + switch (ivhd_type) { + case ACPI_IVRS_TYPE_HARDWARE: + device_printf(dev, "Features(type:0x%x) HATS = %d GATS = %d" + " MsiNumPPR = %d PNBanks= %d PNCounters= %d\n", + ivhd_type, + REG_BITS(feature, 31, 30), + REG_BITS(feature, 29, 28), + REG_BITS(feature, 27, 23), + REG_BITS(feature, 22, 17), + REG_BITS(feature, 16, 13)); + device_printf(dev, "max PASID = %d GLXSup = %d Feature:%b\n", + REG_BITS(feature, 12, 8), + REG_BITS(feature, 4, 3), + feature, + "\020" + "\002NXSup" + "\003GTSup" + "\004" + "\005IASup" + "\006GASup" + "\007HESup"); + break; + + /* Fewer features or attributes are reported in non-legacy type. */ + case ACPI_IVRS_TYPE_HARDWARE_EXT1: + case ACPI_IVRS_TYPE_HARDWARE_EXT2: + device_printf(dev, "Features(type:0x%x) MsiNumPPR = %d" + " PNBanks= %d PNCounters= %d\n", + ivhd_type, + REG_BITS(feature, 27, 23), + REG_BITS(feature, 22, 17), + REG_BITS(feature, 16, 13)); + break; + + default: /* Other ivhd type features are not decoded. */ + device_printf(dev, "Can't decode ivhd type :0x%x\n", ivhd_type); + } +} + +/* Print extended features of IOMMU. */ +static void +ivhd_print_ext_feature(device_t dev, uint64_t ext_feature) +{ + uint32_t ext_low, ext_high; + + if (!ext_feature) + return; + + ext_low = ext_feature; + device_printf(dev, "Extended features[31:0]:%b " + "HATS = 0x%x GATS = 0x%x " + "GLXSup = 0x%x SmiFSup = 0x%x SmiFRC = 0x%x " + "GAMSup = 0x%x DualPortLogSup = 0x%x DualEventLogSup = 0x%x\n", + (int)ext_low, + "\020" + "\001PreFSup" + "\002PPRSup" + "\003" + "\004NXSup" + "\005GTSup" + "\006" + "\007IASup" + "\008GASup" + "\009HESup" + "\010PCSup", + REG_BITS(ext_low, 11, 10), + REG_BITS(ext_low, 13, 12), + REG_BITS(ext_low, 15, 14), + REG_BITS(ext_low, 17, 16), + REG_BITS(ext_low, 20, 18), + REG_BITS(ext_low, 23, 21), + REG_BITS(ext_low, 25, 24), + REG_BITS(ext_low, 29, 28)); + + ext_high = ext_feature >> 32; + device_printf(dev, "Extended features[62:32]:%b " + "Max PASID: 0x%x DevTblSegSup = 0x%x " + "MarcSup = 0x%x\n", + (int)(ext_high), + "\020" + "\006USSup" + "\009PprOvrflwEarlySup" + "\010PPRAutoRspSup" + "\013BlKStopMrkSup" + "\014PerfOptSup" + "\015MsiCapMmioSup" + "\017GIOSup" + "\018HASup" + "\019EPHSup" + "\020AttrFWSup" + "\021HDSup" + "\023InvIotlbSup", + REG_BITS(ext_high, 5, 0), + REG_BITS(ext_high, 8, 7), + REG_BITS(ext_high, 11, 10)); +} + static int ivhd_print_cap(struct amdvi_softc *softc, ACPI_IVRS_HARDWARE * ivhd) { @@ -369,41 +580,23 @@ ivhd_print_cap(struct amdvi_softc *softc, ACPI_IVRS_HA int max_ptp_level; dev = softc->dev; - device_printf(dev, "Flag:%b\n", softc->ivhd_flag, - "\020\001HtTunEn\002PassPW\003ResPassPW\004Isoc\005IotlbSup" - "\006Coherent\007PreFSup\008PPRSup"); - /* - * If no extended feature[EFR], its rev1 with maximum paging level as 7. - */ + + ivhd_print_flag(dev, softc->ivhd_type, softc->ivhd_flag); + ivhd_print_feature(dev, softc->ivhd_type, softc->ivhd_feature); + ivhd_print_ext_feature(dev, softc->ext_feature); max_ptp_level = 7; - if (softc->ivhd_efr) { - device_printf(dev, "EFR HATS = %d GATS = %d GLXSup = %d " - "MsiNumPr = %d PNBanks= %d PNCounters= %d\n" - "max PASID = %d EFR: %b \n", - REG_BITS(softc->ivhd_efr, 31, 30), - REG_BITS(softc->ivhd_efr, 29, 28), - REG_BITS(softc->ivhd_efr, 4, 3), - REG_BITS(softc->ivhd_efr, 27, 23), - REG_BITS(softc->ivhd_efr, 22, 17), - REG_BITS(softc->ivhd_efr, 16, 13), - REG_BITS(softc->ivhd_efr, 12, 8), - softc->ivhd_efr, "\020\001XTSup\002NXSup\003GTSup\005IASup" - "\006GASup\007HESup\008PPRSup"); - - max_ptp_level = REG_BITS(softc->ivhd_efr, 31, 30) + 4; - } - /* Make sure device support minimum page level as requested by user. */ if (max_ptp_level < amdvi_ptp_level) { - device_printf(dev, "Insufficient PTP level:%d\n", - max_ptp_level); + device_printf(dev, "insufficient PTP level:%d\n", + max_ptp_level); return (EINVAL); + } else { + device_printf(softc->dev, "supported paging level:%d, will use only: %d\n", + max_ptp_level, amdvi_ptp_level); } - device_printf(softc->dev, "max supported paging level:%d restricting to: %d\n", - max_ptp_level, amdvi_ptp_level); - device_printf(softc->dev, "device supported range " - "[0x%x - 0x%x]\n", softc->start_dev_rid, softc->end_dev_rid); + device_printf(softc->dev, "device range: 0x%x - 0x%x\n", + softc->start_dev_rid, softc->end_dev_rid); return (0); } @@ -412,25 +605,32 @@ static int ivhd_attach(device_t dev) { ACPI_IVRS_HARDWARE *ivhd; + ACPI_IVRS_HARDWARE_NEW *ivhd1; struct amdvi_softc *softc; int status, unit; unit = device_get_unit(dev); + KASSERT((unit < ivhd_count), + ("ivhd unit %d > count %d", unit, ivhd_count)); /* Make sure its same device for which attach is called. */ - if (ivhd_devs[unit] != dev) - panic("Not same device old %p new %p", ivhd_devs[unit], dev); + KASSERT((ivhd_devs[unit] == dev), + ("Not same device old %p new %p", ivhd_devs[unit], dev)); softc = device_get_softc(dev); softc->dev = dev; - ivhd = ivhd_find_by_index(unit); - if (ivhd == NULL) - return (EINVAL); + ivhd = ivhd_hdrs[unit]; + KASSERT(ivhd, ("ivhd is NULL")); + softc->ivhd_type = ivhd->Header.Type; softc->pci_seg = ivhd->PciSegmentGroup; softc->pci_rid = ivhd->Header.DeviceId; softc->ivhd_flag = ivhd->Header.Flags; - softc->ivhd_efr = ivhd->Reserved; /* + * On lgeacy IVHD type(0x10), it is documented as feature + * but in newer type it is attribute. + */ + softc->ivhd_feature = ivhd->Reserved; + /* * PCI capability has more capabilities that are not part of IVRS. */ softc->cap_off = ivhd->CapabilityOffset; @@ -439,6 +639,15 @@ ivhd_attach(device_t dev) /* IVHD Info bit[4:0] is event MSI/X number. */ softc->event_msix = ivhd->Info & 0x1F; #endif + switch (ivhd->Header.Type) { + case ACPI_IVRS_TYPE_HARDWARE_EXT1: + case ACPI_IVRS_TYPE_HARDWARE_EXT2: + ivhd1 = (ACPI_IVRS_HARDWARE_NEW *)ivhd; + softc->ext_feature = ivhd1->ExtFR; + break; + + } + softc->ctrl = (struct amdvi_ctrl *) PHYS_TO_DMAP(ivhd->BaseAddress); status = ivhd_dev_parse(ivhd, softc); if (status != 0) { Modified: head/sys/contrib/dev/acpica/include/actbl2.h ============================================================================== --- head/sys/contrib/dev/acpica/include/actbl2.h Fri Feb 16 04:59:21 2018 (r329359) +++ head/sys/contrib/dev/acpica/include/actbl2.h Fri Feb 16 05:17:00 2018 (r329360) @@ -444,6 +444,8 @@ typedef struct acpi_ivrs_header enum AcpiIvrsType { ACPI_IVRS_TYPE_HARDWARE = 0x10, + ACPI_IVRS_TYPE_HARDWARE_EXT1 = 0x11, + ACPI_IVRS_TYPE_HARDWARE_EXT2 = 0x40, ACPI_IVRS_TYPE_MEMORY1 = 0x20, ACPI_IVRS_TYPE_MEMORY2 = 0x21, ACPI_IVRS_TYPE_MEMORY3 = 0x22 @@ -481,6 +483,21 @@ typedef struct acpi_ivrs_hardware UINT32 Reserved; } ACPI_IVRS_HARDWARE; + +/* 0x11 and 0x40: I/O Virtualization Hardware Definition Block (IVHD) */ + +typedef struct acpi_ivrs_hardware_new +{ + ACPI_IVRS_HEADER Header; + UINT16 CapabilityOffset; /* Offset for IOMMU control fields */ + UINT64 BaseAddress; /* IOMMU control registers */ + UINT16 PciSegmentGroup; + UINT16 Info; /* MSI number and unit ID */ + UINT32 Attr; /* IOMMU Feature */ + UINT64 ExtFR; /* IOMMU Extended Feature */ + UINT64 Reserved; /* v1 feature or v2 attribute */ + +} ACPI_IVRS_HARDWARE_NEW; /* Masks for Info field above */ From owner-svn-src-all@freebsd.org Fri Feb 16 05:48:46 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 02D6FF17F83; Fri, 16 Feb 2018 05:48:46 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AAB4A866F7; Fri, 16 Feb 2018 05:48:45 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A18D1151F; Fri, 16 Feb 2018 05:48:45 +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 w1G5mjOY062434; Fri, 16 Feb 2018 05:48:45 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1G5mjGo062432; Fri, 16 Feb 2018 05:48:45 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201802160548.w1G5mjGo062432@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Fri, 16 Feb 2018 05:48:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329361 - head/lib/libc/string X-SVN-Group: head X-SVN-Commit-Author: cy X-SVN-Commit-Paths: head/lib/libc/string X-SVN-Commit-Revision: 329361 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Feb 2018 05:48:46 -0000 Author: cy Date: Fri Feb 16 05:48:45 2018 New Revision: 329361 URL: https://svnweb.freebsd.org/changeset/base/329361 Log: Document memset_s(3). memset_s(3) is defined in C11 standard (ISO/IEC 9899:2011) K.3.7.4.1 The memset_s function (p: 621-622) Fix memset(3) portion of the man page by replacing the first argument (destination) "b" with "dest", which is more descriptive than "b". This also makes it consistent with the term used in the memset_s() portion of the man page. See also http://en.cppreference.com/w/c/string/byte/memset. Reviewed by: kib MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D13682 Modified: head/lib/libc/string/Makefile.inc head/lib/libc/string/memset.3 Modified: head/lib/libc/string/Makefile.inc ============================================================================== --- head/lib/libc/string/Makefile.inc Fri Feb 16 05:17:00 2018 (r329360) +++ head/lib/libc/string/Makefile.inc Fri Feb 16 05:48:45 2018 (r329361) @@ -50,6 +50,7 @@ MLINKS+=ffs.3 ffsl.3 \ ffs.3 flsll.3 MLINKS+=index.3 rindex.3 MLINKS+=memchr.3 memrchr.3 +MLINKS+=memset.3 memset_s.3 MLINKS+=strcasecmp.3 strncasecmp.3 \ strcasecmp.3 strcasecmp_l.3 \ strcasecmp.3 strncasecmp_l.3 Modified: head/lib/libc/string/memset.3 ============================================================================== --- head/lib/libc/string/memset.3 Fri Feb 16 05:17:00 2018 (r329360) +++ head/lib/libc/string/memset.3 Fri Feb 16 05:48:45 2018 (r329361) @@ -32,7 +32,7 @@ .\" @(#)memset.3 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd June 4, 1993 +.Dd February 15, 2018 .Dt MEMSET 3 .Os .Sh NAME @@ -43,7 +43,9 @@ .Sh SYNOPSIS .In string.h .Ft void * -.Fn memset "void *b" "int c" "size_t len" +.Fn memset "void *dest" "int c" "size_t len" +.Ft errno_t +.Fn memset_s "void *dest" "rsize_t destsz" "int c" "rsize_t len" .Sh DESCRIPTION The .Fn memset @@ -55,13 +57,66 @@ bytes of value (converted to an .Vt "unsigned char" ) to the string -.Fa b . +.Fa dest . +Undefined behaviour from +.Fn memset , +resulting from storage overflow, will occur if +.Fa len +is greater than the the length of buffer +.Fa dest . +The behaviour is also undefined if +.Fa dest +is an invalid pointer. +.Pp +The +.Fn memset_s +function behaves the same as +.Fn memset +except that an error is returned and the currently registered +runtime-constraint handler is called if +.Fa dest +is a null pointer, +.Fa destsz +or +.Fa len +is greater than +.Dv RSIZE_MAX , +or +.Sp +.Fa len +is greater than +.Fa destsz +(buffer overflow would occur). +The runtime-constraint handler is called first and may not return. +If it does return, an error is returned to the caller. +Like +.Xr explicit_bzero 3 , +.Fn memset_s +is not removed through Dead Store Elimination (DSE), making it useful for +clearing sensitve data. +In contrast +.Fn memset +function +may be optimized away if the object modified by the function is not accessed +again. +To clear memory that will not subsequently be accessed it is advised to use +.Fn memset_s +instead of +.Fn memset . +For instance, a buffer containing a password should be cleared with +.Fn memset_s +before +.Xr free 3 . .Sh RETURN VALUES The .Fn memset function returns its first argument. +The +.Fn memset_s +function returns zero on success, non-zero on error. .Sh SEE ALSO .Xr bzero 3 , +.Xr explicit_bzero 3 , .Xr swab 3 , .Xr wmemset 3 .Sh STANDARDS @@ -70,3 +125,7 @@ The function conforms to .St -isoC . +.Fn memset_s +conforms to: +.St -isoC-2011 +K.3.7.4.1. From owner-svn-src-all@freebsd.org Fri Feb 16 06:51:40 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 62083F1A9A2; Fri, 16 Feb 2018 06:51:40 +0000 (UTC) (envelope-from silby@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 13A8A68D67; Fri, 16 Feb 2018 06:51:40 +0000 (UTC) (envelope-from silby@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0E83D1F1C; Fri, 16 Feb 2018 06:51:40 +0000 (UTC) (envelope-from silby@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1G6pd0O093347; Fri, 16 Feb 2018 06:51:39 GMT (envelope-from silby@FreeBSD.org) Received: (from silby@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1G6pdoQ093346; Fri, 16 Feb 2018 06:51:39 GMT (envelope-from silby@FreeBSD.org) Message-Id: <201802160651.w1G6pdoQ093346@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: silby set sender to silby@FreeBSD.org using -f From: Mike Silbersack Date: Fri, 16 Feb 2018 06:51:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329362 - head/sbin/savecore X-SVN-Group: head X-SVN-Commit-Author: silby X-SVN-Commit-Paths: head/sbin/savecore X-SVN-Commit-Revision: 329362 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Feb 2018 06:51:40 -0000 Author: silby Date: Fri Feb 16 06:51:39 2018 New Revision: 329362 URL: https://svnweb.freebsd.org/changeset/base/329362 Log: Prevent savecore from reading bounds from the current directory. Rev 244218 removed the requirement that you provide a dump directory when checking if there is a coredump ready to be written. That had the side-effect of causing the bounds file to be read from the current working directory instead of the dump directory. As the bounds file is irrelevant when just checking, the simplest fix is to not read the bounds file when checking. Reviewed by: markj MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D14383 Modified: head/sbin/savecore/savecore.c Modified: head/sbin/savecore/savecore.c ============================================================================== --- head/sbin/savecore/savecore.c Fri Feb 16 05:48:45 2018 (r329361) +++ head/sbin/savecore/savecore.c Fri Feb 16 06:51:39 2018 (r329362) @@ -172,6 +172,13 @@ getbounds(void) char buf[6]; int ret; + /* + * If we are just checking, then we haven't done a chdir to the dump + * directory and we should not try to read a bounds file. + */ + if (checkfor) + return (0); + ret = 0; if ((fp = fopen("bounds", "r")) == NULL) { From owner-svn-src-all@freebsd.org Fri Feb 16 06:59:36 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DF415F1B0E0; Fri, 16 Feb 2018 06:59:35 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 945996923E; Fri, 16 Feb 2018 06:59:35 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8F0B8206A; Fri, 16 Feb 2018 06:59:35 +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 w1G6xZFH096739; Fri, 16 Feb 2018 06:59:35 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1G6xZWg096736; Fri, 16 Feb 2018 06:59:35 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201802160659.w1G6xZWg096736@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Fri, 16 Feb 2018 06:59:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329363 - in head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs: . sys X-SVN-Group: head X-SVN-Commit-Author: avg X-SVN-Commit-Paths: in head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs: . sys X-SVN-Commit-Revision: 329363 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Feb 2018 06:59:36 -0000 Author: avg Date: Fri Feb 16 06:59:35 2018 New Revision: 329363 URL: https://svnweb.freebsd.org/changeset/base/329363 Log: read-behind / read-ahead support for zfs_getpages() ZFS caches blocks it reads in its ARC, so in general the optional pages are not as useful as with filesystems that read the data directly into the target pages. But still the optional pages are useful to reduce the number of page faults and associated VM / VFS / ZFS calls. Another case that gets optimized (as a side effect) is paging in from a hole. ZFS DMU does not currently provide a convenient API to check for a hole. Instead it creates a temporary zero-filled block and allows accessing it as if it were a normal data block. Getting multiple pages one by one from a hole results in repeated creation and destruction of the temporary block (and an associated ARC header). Tested with fsx using various supported blocks sizes from 512 bytes to 128 KB and additionally 1 MB. Please note that in illumos and ZoL they do not do the range-locking in the page-in path. This is because ZFS has a double-caching problem between ARC and page cache and that requires zfs_read() and zfs_write() to consult pages in the page cache. So, in those functions they first lock a range and then lock pages corresponding to the range. While in the page-in (and maybe page-out) path they first lock the pages and then would lock the range. So, they would have a deadlock. I believe that FreeBSD does not have that problem, because the page-in deals only with invalid pages while zfs_read() and zfs_write() need to access only valid pages. They do not wait on a busy page unless it's already valid. Reviewed by: kib MFC after: 3 weeks Differential Revision: https://reviews.freebsd.org/D14263 Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c Fri Feb 16 06:51:39 2018 (r329362) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c Fri Feb 16 06:59:35 2018 (r329363) @@ -1518,6 +1518,188 @@ dmu_write_pages(objset_t *os, uint64_t object, uint64_ dmu_buf_rele_array(dbp, numbufs, FTAG); return (err); } + +int +dmu_read_pages(objset_t *os, uint64_t object, vm_page_t *ma, int count, + int *rbehind, int *rahead, int last_size) +{ + struct sf_buf *sf; + vm_object_t vmobj; + vm_page_t m; + dmu_buf_t **dbp; + dmu_buf_t *db; + caddr_t va; + int numbufs, i; + int bufoff, pgoff, tocpy; + int mi, di; + int err; + + ASSERT3U(ma[0]->pindex + count - 1, ==, ma[count - 1]->pindex); + ASSERT(last_size <= PAGE_SIZE); + + err = dmu_buf_hold_array(os, object, IDX_TO_OFF(ma[0]->pindex), + IDX_TO_OFF(count - 1) + last_size, TRUE, FTAG, &numbufs, &dbp); + if (err != 0) + return (err); + +#ifdef DEBUG + IMPLY(last_size < PAGE_SIZE, *rahead == 0); + if (dbp[0]->db_offset != 0 || numbufs > 1) { + for (i = 0; i < numbufs; i++) { + ASSERT(ISP2(dbp[i]->db_size)); + ASSERT((dbp[i]->db_offset % dbp[i]->db_size) == 0); + ASSERT3U(dbp[i]->db_size, ==, dbp[0]->db_size); + } + } +#endif + + vmobj = ma[0]->object; + zfs_vmobject_wlock(vmobj); + + db = dbp[0]; + for (i = 0; i < *rbehind; i++) { + m = vm_page_grab(vmobj, ma[0]->pindex - 1 - i, + VM_ALLOC_NORMAL | VM_ALLOC_NOWAIT | VM_ALLOC_NOBUSY); + if (m == NULL) + break; + if (m->valid != 0) { + ASSERT3U(m->valid, ==, VM_PAGE_BITS_ALL); + break; + } + ASSERT(m->dirty == 0); + ASSERT(!pmap_page_is_mapped(m)); + + ASSERT(db->db_size > PAGE_SIZE); + bufoff = IDX_TO_OFF(m->pindex) % db->db_size; + va = zfs_map_page(m, &sf); + bcopy((char *)db->db_data + bufoff, va, PAGESIZE); + zfs_unmap_page(sf); + m->valid = VM_PAGE_BITS_ALL; + vm_page_lock(m); + if ((m->busy_lock & VPB_BIT_WAITERS) != 0) + vm_page_activate(m); + else + vm_page_deactivate(m); + vm_page_unlock(m); + } + *rbehind = i; + + bufoff = IDX_TO_OFF(ma[0]->pindex) % db->db_size; + pgoff = 0; + for (mi = 0, di = 0; mi < count && di < numbufs; ) { + if (pgoff == 0) { + m = ma[mi]; + vm_page_assert_xbusied(m); + ASSERT(m->valid == 0); + ASSERT(m->dirty == 0); + ASSERT(!pmap_page_is_mapped(m)); + va = zfs_map_page(m, &sf); + } + if (bufoff == 0) + db = dbp[di]; + + ASSERT3U(IDX_TO_OFF(m->pindex) + pgoff, ==, + db->db_offset + bufoff); + + /* + * We do not need to clamp the copy size by the file + * size as the last block is zero-filled beyond the + * end of file anyway. + */ + tocpy = MIN(db->db_size - bufoff, PAGESIZE - pgoff); + bcopy((char *)db->db_data + bufoff, va + pgoff, tocpy); + + pgoff += tocpy; + ASSERT(pgoff <= PAGESIZE); + if (pgoff == PAGESIZE) { + zfs_unmap_page(sf); + m->valid = VM_PAGE_BITS_ALL; + ASSERT(mi < count); + mi++; + pgoff = 0; + } + + bufoff += tocpy; + ASSERT(bufoff <= db->db_size); + if (bufoff == db->db_size) { + ASSERT(di < numbufs); + di++; + bufoff = 0; + } + } + +#ifdef DEBUG + /* + * Three possibilities: + * - last requested page ends at a buffer boundary and , thus, + * all pages and buffers have been iterated; + * - all requested pages are filled, but the last buffer + * has not been exhausted; + * the read-ahead is possible only in this case; + * - all buffers have been read, but the last page has not been + * fully filled; + * this is only possible if the file has only a single buffer + * with a size that is not a multiple of the page size. + */ + if (mi == count) { + ASSERT(di >= numbufs - 1); + IMPLY(*rahead != 0, di == numbufs - 1); + IMPLY(*rahead != 0, bufoff != 0); + ASSERT(pgoff == 0); + } + if (di == numbufs) { + ASSERT(mi >= count - 1); + ASSERT(*rahead == 0); + IMPLY(pgoff == 0, mi == count); + if (pgoff != 0) { + ASSERT(mi == count - 1); + ASSERT((dbp[0]->db_size & PAGE_MASK) != 0); + } + } +#endif + if (pgoff != 0) { + bzero(va + pgoff, PAGESIZE - pgoff); + zfs_unmap_page(sf); + m->valid = VM_PAGE_BITS_ALL; + } + + for (i = 0; i < *rahead; i++) { + m = vm_page_grab(vmobj, ma[count - 1]->pindex + 1 + i, + VM_ALLOC_NORMAL | VM_ALLOC_NOWAIT | VM_ALLOC_NOBUSY); + if (m == NULL) + break; + if (m->valid != 0) { + ASSERT3U(m->valid, ==, VM_PAGE_BITS_ALL); + break; + } + ASSERT(m->dirty == 0); + ASSERT(!pmap_page_is_mapped(m)); + + ASSERT(db->db_size > PAGE_SIZE); + bufoff = IDX_TO_OFF(m->pindex) % db->db_size; + tocpy = MIN(db->db_size - bufoff, PAGESIZE); + va = zfs_map_page(m, &sf); + bcopy((char *)db->db_data + bufoff, va, tocpy); + if (tocpy < PAGESIZE) { + ASSERT(i == *rahead - 1); + ASSERT((db->db_size & PAGE_MASK) != 0); + bzero(va + tocpy, PAGESIZE - tocpy); + } + zfs_unmap_page(sf); + m->valid = VM_PAGE_BITS_ALL; + vm_page_lock(m); + if ((m->busy_lock & VPB_BIT_WAITERS) != 0) + vm_page_activate(m); + else + vm_page_deactivate(m); + vm_page_unlock(m); + } + *rahead = i; + zfs_vmobject_wunlock(vmobj); + + dmu_buf_rele_array(dbp, numbufs, FTAG); + return (0); +} #endif /* illumos */ #endif /* _KERNEL */ Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu.h Fri Feb 16 06:51:39 2018 (r329362) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu.h Fri Feb 16 06:59:35 2018 (r329363) @@ -750,6 +750,8 @@ int dmu_write_pages(objset_t *os, uint64_t object, uin #else int dmu_write_pages(objset_t *os, uint64_t object, uint64_t offset, uint64_t size, struct vm_page **ppa, dmu_tx_t *tx); +int dmu_read_pages(objset_t *os, uint64_t object, vm_page_t *ma, int count, + int *rbehind, int *rahead, int last_size); #endif #endif struct arc_buf *dmu_request_arcbuf(dmu_buf_t *handle, int size); Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Fri Feb 16 06:51:39 2018 (r329362) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Fri Feb 16 06:59:35 2018 (r329363) @@ -4514,81 +4514,85 @@ zfs_setsecattr(vnode_t *vp, vsecattr_t *vsecp, int fla } static int -zfs_getpages(struct vnode *vp, vm_page_t *m, int count, int *rbehind, +zfs_getpages(struct vnode *vp, vm_page_t *ma, int count, int *rbehind, int *rahead) { znode_t *zp = VTOZ(vp); zfsvfs_t *zfsvfs = zp->z_zfsvfs; objset_t *os = zp->z_zfsvfs->z_os; - vm_page_t mlast; + rl_t *rl; vm_object_t object; - caddr_t va; - struct sf_buf *sf; - off_t startoff, endoff; - int i, error; - vm_pindex_t reqstart, reqend; - int lsize, size; + off_t start, end, obj_size; + uint_t blksz; + int pgsin_b, pgsin_a; + int error; - object = m[0]->object; - error = 0; - ZFS_ENTER(zfsvfs); ZFS_VERIFY_ZP(zp); - zfs_vmobject_wlock(object); - if (m[count - 1]->valid != 0 && --count == 0) { - zfs_vmobject_wunlock(object); - goto out; + start = IDX_TO_OFF(ma[0]->pindex); + end = IDX_TO_OFF(ma[count - 1]->pindex + 1); + + /* + * Lock a range covering all required and optional pages. + * Note that we need to handle the case of the block size growing. + */ + for (;;) { + blksz = zp->z_blksz; + rl = zfs_range_lock(zp, rounddown(start, blksz), + roundup(end, blksz) - rounddown(start, blksz), RL_READER); + if (blksz == zp->z_blksz) + break; + zfs_range_unlock(rl); } - mlast = m[count - 1]; - - if (IDX_TO_OFF(mlast->pindex) >= - object->un_pager.vnp.vnp_size) { - zfs_vmobject_wunlock(object); + object = ma[0]->object; + zfs_vmobject_wlock(object); + obj_size = object->un_pager.vnp.vnp_size; + zfs_vmobject_wunlock(object); + if (IDX_TO_OFF(ma[count - 1]->pindex) >= obj_size) { + zfs_range_unlock(rl); ZFS_EXIT(zfsvfs); return (zfs_vm_pagerret_bad); } - VM_CNT_INC(v_vnodein); - VM_CNT_ADD(v_vnodepgsin, count); + pgsin_b = 0; + if (rbehind != NULL) { + pgsin_b = OFF_TO_IDX(start - rounddown(start, blksz)); + pgsin_b = MIN(*rbehind, pgsin_b); + } - lsize = PAGE_SIZE; - if (IDX_TO_OFF(mlast->pindex) + lsize > object->un_pager.vnp.vnp_size) - lsize = object->un_pager.vnp.vnp_size - - IDX_TO_OFF(mlast->pindex); - zfs_vmobject_wunlock(object); - - for (i = 0; i < count; i++) { - size = PAGE_SIZE; - if (i == count - 1) - size = lsize; - va = zfs_map_page(m[i], &sf); - error = dmu_read(os, zp->z_id, IDX_TO_OFF(m[i]->pindex), - size, va, DMU_READ_PREFETCH); - if (size != PAGE_SIZE) - bzero(va + size, PAGE_SIZE - size); - zfs_unmap_page(sf); - if (error != 0) - goto out; + pgsin_a = 0; + if (rahead != NULL) { + pgsin_a = OFF_TO_IDX(roundup(end, blksz) - end); + if (end + IDX_TO_OFF(pgsin_a) >= obj_size) + pgsin_a = OFF_TO_IDX(round_page(obj_size) - end); + pgsin_a = MIN(*rahead, pgsin_a); } - zfs_vmobject_wlock(object); - for (i = 0; i < count; i++) - m[i]->valid = VM_PAGE_BITS_ALL; - zfs_vmobject_wunlock(object); + /* + * NB: we need to pass the exact byte size of the data that we expect + * to read after accounting for the file size. This is required because + * ZFS will panic if we request DMU to read beyond the end of the last + * allocated block. + */ + error = dmu_read_pages(os, zp->z_id, ma, count, &pgsin_b, &pgsin_a, + MIN(end, obj_size) - (end - PAGE_SIZE)); -out: + zfs_range_unlock(rl); ZFS_ACCESSTIME_STAMP(zfsvfs, zp); ZFS_EXIT(zfsvfs); - if (error == 0) { - if (rbehind) - *rbehind = 0; - if (rahead) - *rahead = 0; - return (zfs_vm_pagerret_ok); - } else + + if (error != 0) return (zfs_vm_pagerret_error); + + VM_CNT_INC(v_vnodein); + VM_CNT_ADD(v_vnodepgsin, count + pgsin_b + pgsin_a); + if (rbehind != NULL) + *rbehind = pgsin_b; + if (rahead != NULL) + *rahead = pgsin_a; + return (zfs_vm_pagerret_ok); } static int From owner-svn-src-all@freebsd.org Fri Feb 16 07:02:15 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4C81DF1B3A8; Fri, 16 Feb 2018 07:02:15 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2262C69622; Fri, 16 Feb 2018 07:02:15 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1D39321E7; Fri, 16 Feb 2018 07:02:15 +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 w1G72EUk000879; Fri, 16 Feb 2018 07:02:14 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1G72E96000878; Fri, 16 Feb 2018 07:02:14 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201802160702.w1G72E96000878@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Fri, 16 Feb 2018 07:02:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329364 - head/sys/amd64/vmm/amd X-SVN-Group: head X-SVN-Commit-Author: avg X-SVN-Commit-Paths: head/sys/amd64/vmm/amd X-SVN-Commit-Revision: 329364 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Feb 2018 07:02:15 -0000 Author: avg Date: Fri Feb 16 07:02:14 2018 New Revision: 329364 URL: https://svnweb.freebsd.org/changeset/base/329364 Log: move vintr_intercept_enabled under INVARIANTS The function is not used outside of INVARIANTS since r328622. MFC after: 1 week Modified: head/sys/amd64/vmm/amd/svm.c Modified: head/sys/amd64/vmm/amd/svm.c ============================================================================== --- head/sys/amd64/vmm/amd/svm.c Fri Feb 16 06:59:35 2018 (r329363) +++ head/sys/amd64/vmm/amd/svm.c Fri Feb 16 07:02:14 2018 (r329364) @@ -969,6 +969,7 @@ svm_save_intinfo(struct svm_softc *svm_sc, int vcpu) vm_exit_intinfo(svm_sc->vm, vcpu, intinfo); } +#ifdef INVARIANTS static __inline int vintr_intercept_enabled(struct svm_softc *sc, int vcpu) { @@ -976,6 +977,7 @@ vintr_intercept_enabled(struct svm_softc *sc, int vcpu return (svm_get_intercept(sc, vcpu, VMCB_CTRL1_INTCPT, VMCB_INTCPT_VINTR)); } +#endif static __inline void enable_intr_window_exiting(struct svm_softc *sc, int vcpu) From owner-svn-src-all@freebsd.org Fri Feb 16 07:42:39 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 79A76F1D818; Fri, 16 Feb 2018 07:42:39 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail109.syd.optusnet.com.au (mail109.syd.optusnet.com.au [211.29.132.80]) by mx1.freebsd.org (Postfix) with ESMTP id E7DE06AD40; Fri, 16 Feb 2018 07:42:38 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from [192.168.0.102] (c110-21-101-228.carlnfd1.nsw.optusnet.com.au [110.21.101.228]) by mail109.syd.optusnet.com.au (Postfix) with ESMTPS id 194E7D6924E; Fri, 16 Feb 2018 18:19:15 +1100 (AEDT) Date: Fri, 16 Feb 2018 18:19:14 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Jung-uk Kim cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r329340 - head/sys/amd64/include In-Reply-To: <201802152042.w1FKgcDd079601@repo.freebsd.org> Message-ID: <20180216172320.I2471@besplex.bde.org> References: <201802152042.w1FKgcDd079601@repo.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.2 cv=cIaQihWN c=1 sm=1 tr=0 a=PalzARQSbocsUSjMRkwAPg==:117 a=PalzARQSbocsUSjMRkwAPg==:17 a=kj9zAlcOel0A:10 a=wANgeDMT7b3Cd_af7SoA:9 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Feb 2018 07:42:39 -0000 On Thu, 15 Feb 2018, Jung-uk Kim wrote: > Log: > Change size of padding to reflect reality. No functional change. > > Discussed with: kib > > Modified: > head/sys/amd64/include/pcpu.h > > Modified: head/sys/amd64/include/pcpu.h > ============================================================================== > --- head/sys/amd64/include/pcpu.h Thu Feb 15 19:49:15 2018 (r329339) > +++ head/sys/amd64/include/pcpu.h Thu Feb 15 20:42:38 2018 (r329340) > @@ -75,7 +75,7 @@ > uint32_t pc_pcid_gen; \ > uint32_t pc_smp_tlb_done; /* TLB op acknowledgement */ \ > uint32_t pc_ibpb_set; \ > - char __pad[216] /* be divisor of PAGE_SIZE \ > + char __pad[224] /* be divisor of PAGE_SIZE \ > after cache alignment */ This still has a bogus struct member name. The prefix for names in this struct is pc_, not __. Names beginning with __ are reserved for the implementation. The implementation might define __pad as . To detect this common naming error. It is also used in sys/efi.h. i386/include/pcpu.h and i386/include/pmc_mdep.h. The object of "be" in the comment is unclear. It is the size of the whole struct, not the MD fields. The padding amount is especially odd for i386 pcpu. It is 445 chars there. This means 445 chars of padding in __pad[] and 3 more chars in unnamed padding. The MD fields have no special alignment, and the padding depends on the MI fields too. With this change, on amd64 sizeof(struct pcpu) is 1K. This indeed divides PAGE_SIZE. I don't see what good this does. __pcpu is only aligned to an 0x200 boundary in my test kernel (struct pcpu is aligned to an 0x40 boundary, and aligning to this boundary is what made the old padding work). On i386, the garbage value of 445 also gives sizeof(struct pcpu) = 1K. __pcpu is only aligned to an 0x80 boundary in my test kernel (struct pcpu has the same CACHE_LINE_SIZE = 0x40 boundary as on amd64). Bruce From owner-svn-src-all@freebsd.org Fri Feb 16 09:30:07 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 52F9EF00E0B; Fri, 16 Feb 2018 09:30:07 +0000 (UTC) (envelope-from cochard@gmail.com) Received: from mail-pg0-f43.google.com (mail-pg0-f43.google.com [74.125.83.43]) (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 D347E6EEAA; Fri, 16 Feb 2018 09:30:06 +0000 (UTC) (envelope-from cochard@gmail.com) Received: by mail-pg0-f43.google.com with SMTP id g12so2005230pgs.0; Fri, 16 Feb 2018 01:30:06 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=eJ76x4LNpFxLA7oZqF8EuQiBc0xDc7BP5omOo0FV6JM=; b=qdP8OPqojPAlEfnckr3IX7WFlicfp/8jfquNiQPJac7LNh0BKkDf5SwASfSCJt1B7S nCa0/gVDEKVcIHv+X0alR7F0SZcUL1mW2WF+1L+CbdVcIrMPCic+YpD7hhlwdYOGu3ti G0F945dgpW3uG8tbif6auHhl9sN3iFEkEr+JOH2sTIMMbN0UFI8Y8cEv2tsHU03Sn/vS 16c8tnYF/3hU0fYf23artfN5rItA+vcYUKe2PCn3RjmgerU/DR/pdGWjK2utfixXzIb6 LjOSq1yDb3j16+ji1XfOKVf6CH4PeHew8mTbUUqJHt5oMuDSRniuj9NJf4GwU+HFXz1E 8z4A== X-Gm-Message-State: APf1xPC0WpdXGYdAkJ2MT5J4uLkrWZSY3llbtAnZYsP83iv49j3+Br+m M/H5hPZcqhnB0EHqUebuNsrnsRim X-Google-Smtp-Source: AH8x2277uO/CNdjrFev0+blF2Y6sgqBfFQBEXoy0dua1EhJlCk9V6gYD2AQZMo9dGzKjshtbXLwBWA== X-Received: by 10.98.170.15 with SMTP id e15mr5498691pff.207.1518773405472; Fri, 16 Feb 2018 01:30:05 -0800 (PST) Received: from mail-pg0-f51.google.com (mail-pg0-f51.google.com. [74.125.83.51]) by smtp.gmail.com with ESMTPSA id e24sm4548704pfd.122.2018.02.16.01.30.04 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 16 Feb 2018 01:30:04 -0800 (PST) Received: by mail-pg0-f51.google.com with SMTP id j9so1979903pgp.11; Fri, 16 Feb 2018 01:30:04 -0800 (PST) X-Received: by 10.98.156.71 with SMTP id f68mr5571488pfe.193.1518773404280; Fri, 16 Feb 2018 01:30:04 -0800 (PST) MIME-Version: 1.0 Received: by 10.236.165.9 with HTTP; Fri, 16 Feb 2018 01:29:43 -0800 (PST) In-Reply-To: <201802141807.w1EI7Ror036078@repo.freebsd.org> References: <201802141807.w1EI7Ror036078@repo.freebsd.org> From: =?UTF-8?Q?Olivier_Cochard=2DLabb=C3=A9?= Date: Fri, 16 Feb 2018 10:29:43 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r329269 - head/stand/i386/boot2 To: Benno Rice Cc: src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.25 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Feb 2018 09:30:07 -0000 On Wed, Feb 14, 2018 at 7:07 PM, Benno Rice wrote: > Author: benno > Date: Wed Feb 14 18:07:27 2018 > New Revision: 329269 > URL: https://svnweb.freebsd.org/changeset/base/329269 > > Log: > Reformat to come significantly closer to style(9). > > Reviewed by: imp, jhibbits > Differential Revision: https://reviews.freebsd.org/D14366 > > Modified: > head/stand/i386/boot2/boot2.c > > =E2=80=8BHi, I've got 2 regressions with this commit on my headless servers (Netgate RCC and PC Engines=E2=80=8B =E2=80=8B). I'm using this configuration file on all my headless servers: [root@netgate]~# cat /boot.config -S115200 -h Now with this commit, I meet a first regression: they all stop to boot automatically at the boot stage. ****************************** /boot/config: -S115200 -h FreeBSD/x86 boot Default: 0:ad(0,a)/boot/loader boot: ******************************* I had to connect to the serial console and to press "enter" here for continuing the boot process. Once the boot process go to the next stage, I meet the second regression: loader menu is correctly displayed, but dmesg messages are no visible on the console. Regards, Olivier From owner-svn-src-all@freebsd.org Fri Feb 16 13:32:47 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EF63EF13F93; Fri, 16 Feb 2018 13:32:46 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A080479878; Fri, 16 Feb 2018 13:32:46 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9B1C1658F; Fri, 16 Feb 2018 13:32:46 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1GDWklj097145; Fri, 16 Feb 2018 13:32:46 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1GDWk96097144; Fri, 16 Feb 2018 13:32:46 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201802161332.w1GDWk96097144@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 16 Feb 2018 13:32:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329365 - head/sys/amd64/include X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/amd64/include X-SVN-Commit-Revision: 329365 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Feb 2018 13:32:47 -0000 Author: kib Date: Fri Feb 16 13:32:46 2018 New Revision: 329365 URL: https://svnweb.freebsd.org/changeset/base/329365 Log: Use local symbol for offset. Small global symbols confuse ddb which matches them against small unrelated displacements and makes the disassembly ugly. Reported by: bde Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/amd64/include/asmacros.h Modified: head/sys/amd64/include/asmacros.h ============================================================================== --- head/sys/amd64/include/asmacros.h Fri Feb 16 07:02:14 2018 (r329364) +++ head/sys/amd64/include/asmacros.h Fri Feb 16 13:32:46 2018 (r329365) @@ -175,11 +175,11 @@ .endm .macro MOVE_STACKS qw - offset=0 + .L.offset=0 .rept \qw - movq offset(%rsp),%rdx - movq %rdx,offset(%rax) - offset=offset+8 + movq .L.offset(%rsp),%rdx + movq %rdx,.L.offset(%rax) + .L.offset=.L.offset+8 .endr .endm From owner-svn-src-all@freebsd.org Fri Feb 16 13:57:44 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9CEF7F15F05; Fri, 16 Feb 2018 13:57:44 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5168B7ABA0; Fri, 16 Feb 2018 13:57:44 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 47B1568E4; Fri, 16 Feb 2018 13:57:44 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1GDviq1007941; Fri, 16 Feb 2018 13:57:44 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1GDvi7i007940; Fri, 16 Feb 2018 13:57:44 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201802161357.w1GDvi7i007940@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Fri, 16 Feb 2018 13:57:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329366 - head/stand/lua X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/stand/lua X-SVN-Commit-Revision: 329366 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Feb 2018 13:57:44 -0000 Author: kevans Date: Fri Feb 16 13:57:43 2018 New Revision: 329366 URL: https://svnweb.freebsd.org/changeset/base/329366 Log: stand/lua: Set ACPI's default the proper way (setACPI) Modified: head/stand/lua/core.lua Modified: head/stand/lua/core.lua ============================================================================== --- head/stand/lua/core.lua Fri Feb 16 13:32:46 2018 (r329365) +++ head/stand/lua/core.lua Fri Feb 16 13:57:43 2018 (r329366) @@ -171,5 +171,5 @@ function core.bootserial() return false; end -core.acpi = core.getACPIPresent(false); +core.setACPI(core.getACPIPresent(false)) return core From owner-svn-src-all@freebsd.org Fri Feb 16 13:57:48 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 076E3F15F56 for ; Fri, 16 Feb 2018 13:57:48 +0000 (UTC) (envelope-from byond.lenox@gmail.com) Received: from mail-lf0-f51.google.com (mail-lf0-f51.google.com [209.85.215.51]) (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 65C637ABB3 for ; Fri, 16 Feb 2018 13:57:47 +0000 (UTC) (envelope-from byond.lenox@gmail.com) Received: by mail-lf0-f51.google.com with SMTP id f137so4159707lfe.4 for ; Fri, 16 Feb 2018 05:57:47 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:cc; bh=DpPMD+zBTMsR+GwmYL6zKJRDfoK4MAPCuhZofwJ0ZXk=; b=sRTTQzjXPiMLfb5kXDo84OJRHPvGzohCCKQzDHQ+DGdCYt+oM1k6as2kspeLX08EYo GhdaNiFRRqZJV+wSHb5fbh5k3JQKQY1HxpUvOv94TbF7U4sWj/r2TvBtcWOtOLW9RYX5 vbGgwlwehhxMN//rjJ5fB8UPxkoVMvow5yjSVqTZR3b7KlO8C0mwo7J7Yi+ZoIgAaxNN ZATVJsw8K9E7CkM8AQPXEC1Y8p+KaW9qFRwdpzGlG7bmMz23FqbXCtpXGllBlM8c0A4P PbbfuBtNlanbgb+NqrAhJ2v0D1bw4G127NrU2Hwez64wROaA86tQgeqA5njLYpKtfaV8 esIQ== X-Gm-Message-State: APf1xPD1xY/PFYwLFR+UGa8llfidNt8DcgDLRzuQ4DtqhKe5OXjGJELm dyPA10EccV/gXoq2zYYla+lu3dONU+E= X-Google-Smtp-Source: AH8x22476Jbw1IlH0DcfYc5gBv2NHexN2pRBt2YjWXWmidhcNAz0EQiDMbdDTbIrGXUrACrQ12YO9Q== X-Received: by 10.46.91.206 with SMTP id m75mr3767776lje.59.1518789459783; Fri, 16 Feb 2018 05:57:39 -0800 (PST) Received: from mail-lf0-f54.google.com (mail-lf0-f54.google.com. [209.85.215.54]) by smtp.gmail.com with ESMTPSA id t69sm1409797ljb.36.2018.02.16.05.57.39 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 16 Feb 2018 05:57:39 -0800 (PST) Received: by mail-lf0-f54.google.com with SMTP id h78so4161892lfg.6 for ; Fri, 16 Feb 2018 05:57:39 -0800 (PST) X-Received: by 10.46.64.203 with SMTP id r72mt5013129lje.38.1518789458740; Fri, 16 Feb 2018 05:57:38 -0800 (PST) MIME-Version: 1.0 Received: by 10.46.106.8 with HTTP; Fri, 16 Feb 2018 05:57:18 -0800 (PST) In-Reply-To: <201802160312.w1G3CO3r085739@repo.freebsd.org> References: <201802160312.w1G3CO3r085739@repo.freebsd.org> From: Kyle Evans Date: Fri, 16 Feb 2018 07:57:18 -0600 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r329349 - head/stand/lua Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Feb 2018 13:57:48 -0000 On Thu, Feb 15, 2018 at 9:12 PM, Kyle Evans wrote: > Author: kevans > Date: Fri Feb 16 03:12:24 2018 > New Revision: 329349 > URL: https://svnweb.freebsd.org/changeset/base/329349 > > Log: > stand/lua: Reduce magic numbers > > Enter/backspace values are hardcoded in both the menu and password scripts. > Separate these out to core for reuse between the two. > > Modified: > head/stand/lua/core.lua > head/stand/lua/menu.lua > head/stand/lua/password.lua > > Modified: head/stand/lua/core.lua > ============================================================================== > --- head/stand/lua/core.lua Fri Feb 16 01:33:01 2018 (r329348) > +++ head/stand/lua/core.lua Fri Feb 16 03:12:24 2018 (r329349) > @@ -28,6 +28,10 @@ > > local core = {}; > > +-- Commonly appearing constants > +core.KEY_ENTER = 13 > +core.KEY_BACKSPACE = 127 > + > function core.setVerbose(b) > if (b == nil) then > b = not core.verbose; > > Modified: head/stand/lua/menu.lua > ============================================================================== > --- head/stand/lua/menu.lua Fri Feb 16 01:33:01 2018 (r329348) > +++ head/stand/lua/menu.lua Fri Feb 16 03:12:24 2018 (r329349) > @@ -273,9 +273,9 @@ function menu.run(m) > local key = io.getchar(); > > -- Special key behaviors > - if (key == 127) and (m ~= menu.welcome) then > + if (key == core.KEY_BACKSPACE) and (m ~= menu.welcome) then > break > - elseif (key == 13) then > + elseif (key == core.KEY_ENTER) then > core.boot(); > -- Should not return > end > @@ -357,7 +357,7 @@ function menu.autoboot() > screen.defcursor(); > if io.ischar() then > local ch = io.getchar(); > - if ch == 13 then > + if ch == core.KEY_ENTER then > break; > else > -- prevent autoboot when escaping to interpreter > > Modified: head/stand/lua/password.lua > ============================================================================== > --- head/stand/lua/password.lua Fri Feb 16 01:33:01 2018 (r329348) > +++ head/stand/lua/password.lua Fri Feb 16 03:12:24 2018 (r329349) > @@ -37,11 +37,11 @@ function password.read() > > repeat > ch = io.getchar(); > - if ch == 13 then > + if ch == core.KEY_ENTER then > break; > end > > - if ch == 8 then > + if ch == core.KEY_BACKSPACE then It's worth noting that this changes the comparison from 'ch == 8' to 'ch == 127'. The password prompt was non-functional on my test systems until this change, because I can never type my password right the first time. =) Pointed out by: cem@ From owner-svn-src-all@freebsd.org Fri Feb 16 14:31:57 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 449D7F18C7B; Fri, 16 Feb 2018 14:31:57 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail105.syd.optusnet.com.au (mail105.syd.optusnet.com.au [211.29.132.249]) by mx1.freebsd.org (Postfix) with ESMTP id B85447C719; Fri, 16 Feb 2018 14:31:56 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from [192.168.0.102] (c110-21-101-228.carlnfd1.nsw.optusnet.com.au [110.21.101.228]) by mail105.syd.optusnet.com.au (Postfix) with ESMTPS id 0BA4E104B234; Sat, 17 Feb 2018 01:31:46 +1100 (AEDT) Date: Sat, 17 Feb 2018 01:31:45 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Benno Rice cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r329269 - head/stand/i386/boot2 In-Reply-To: <201802141807.w1EI7Ror036078@repo.freebsd.org> Message-ID: <20180217000503.F3685@besplex.bde.org> References: <201802141807.w1EI7Ror036078@repo.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.2 cv=FNpr/6gs c=1 sm=1 tr=0 a=PalzARQSbocsUSjMRkwAPg==:117 a=PalzARQSbocsUSjMRkwAPg==:17 a=kj9zAlcOel0A:10 a=zMeS5lR-rpC9UbJK_LUA:9 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Feb 2018 14:31:57 -0000 On Wed, 14 Feb 2018, Benno Rice wrote: > Log: > Reformat to come significantly closer to style(9). This gives unreadable diffs. It does more than reformatting. Bugs have been reported. They must be in the non-reformatting changes. > Modified: head/stand/i386/boot2/boot2.c > ============================================================================== > --- head/stand/i386/boot2/boot2.c Wed Feb 14 18:05:37 2018 (r329268) > +++ head/stand/i386/boot2/boot2.c Wed Feb 14 18:07:27 2018 (r329269) > ... > #if SERIAL > - } else if (c == 'S') { > - j = 0; > - while ((unsigned int)(i = *arg++ - '0') <= 9) > - j = j * 10 + i; > - if (j > 0 && i == -'0') { > - comspeed = j; > - break; > - } > - /* Fall through to error below ('S' not in optstr[]). */ > + } else if (c == 'S') { > + j = 0; > + while (*arg <= '9') { > + i = (unsigned int)(*arg - '0'); > + j = j * 10 + i; > + arg++; > + } > + if (j > 0 && i == -'0') { > + comspeed = j; > + break; > + } > + /* > + * Fall through to error below > + * ('S' not in optstr[]). > + */ > #endif The bugs seem to be only here. The old code uses a bogus cast to obfuscate its classification of digits. The change breaks the classification of digits by moving the cast to a place where it has no effect. Even space separators and '\0' terminators are now misclassified as digits. Space separators seem to be broken anyway, so -S only worked if it is the last arg. Now it never works, since the terminating char is never '\0'. Moving the increment of 'arg' is risky but seems to have no effect since -S must be at the end to work so no further advance of arg is useful. Bruce From owner-svn-src-all@freebsd.org Fri Feb 16 14:39:42 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 268FCF196DA; Fri, 16 Feb 2018 14:39:42 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C8E3E7CD66; Fri, 16 Feb 2018 14:39:41 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C248C6F66; Fri, 16 Feb 2018 14:39:41 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1GEdf9Z028461; Fri, 16 Feb 2018 14:39:41 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1GEdfTN028459; Fri, 16 Feb 2018 14:39:41 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201802161439.w1GEdfTN028459@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Fri, 16 Feb 2018 14:39:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329367 - head/stand/lua X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/stand/lua X-SVN-Commit-Revision: 329367 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Feb 2018 14:39:42 -0000 Author: kevans Date: Fri Feb 16 14:39:41 2018 New Revision: 329367 URL: https://svnweb.freebsd.org/changeset/base/329367 Log: stand/lua: Create a "carousel" menu entry type This is a pre-cursor to boot environment support in lualoader. Create a new menu item type, "carousel_entry", that generally provides a callback to get the list of items, a carousel_id for storing the current value, and the standard name/func functions that an entry has. The difference between this and a normal menu item, functionally, is that selecting a carousel item will automatically rotate through available items and wrap back at the beginning when the list is exhausted. The 'name' function takes the choice index, current choice, and the list of choices as parameters so that the menu item can decorate the name freely as desired. The 'func' function takes the current choice as a parameter, so it can act accordingly. The kernel menu item has been rewritten to use the carousel_entry type as both an example and initial test of its functionality before it is used for boot environment options. Modified: head/stand/lua/drawer.lua head/stand/lua/menu.lua Modified: head/stand/lua/drawer.lua ============================================================================== --- head/stand/lua/drawer.lua Fri Feb 16 13:57:43 2018 (r329366) +++ head/stand/lua/drawer.lua Fri Feb 16 14:39:41 2018 (r329367) @@ -169,7 +169,21 @@ function drawer.drawmenu(m) if (e.entry_type ~= "separator") then entry_num = entry_num + 1; screen.setcursor(x, y + line_num); - print(entry_num .. ". "..e.name()); + local name = ""; + + if (e.entry_type == "carousel_entry") then + local carid = e.carousel_id; + local caridx = menu.getCarouselIndex(carid); + local choices = e.items(); + + if (#choices < caridx) then + caridx = 1; + end; + name = e.name(caridx, choices[caridx], choices); + else + name = e.name(); + end + print(entry_num .. ". "..name); -- fill the alias table alias_table[tostring(entry_num)] = e; Modified: head/stand/lua/menu.lua ============================================================================== --- head/stand/lua/menu.lua Fri Feb 16 13:57:43 2018 (r329366) +++ head/stand/lua/menu.lua Fri Feb 16 14:39:41 2018 (r329367) @@ -39,7 +39,7 @@ local OnOff; local skip; local run; local autoboot; -local current_kernel_index = 1; +local carousel_choices = {}; --loader menu tree: --rooted at menu.welcome @@ -193,34 +193,25 @@ menu.welcome = { -- kernel options { - entry_type = "entry", - name = function() - local kernels = core.kernelList(); - if #kernels == 0 then + entry_type = "carousel_entry", + carousel_id = "kernel", + items = core.kernelList, + name = function(idx, choice, all_choices) + if #all_choices == 0 then return "Kernel: "; end local kernel_name = color.escapef(color.GREEN) .. - kernels[current_kernel_index] .. color.default(); - if (current_kernel_index == 1) then + choice .. color.default(); + if (idx == 1) then kernel_name = "default/" .. kernel_name; end return color.highlight("K").."ernel: " .. kernel_name .. - " (" .. current_kernel_index .. - " of " .. #kernels .. ")"; + " (" .. idx .. + " of " .. #all_choices .. ")"; end, - func = function() - - -- dynamically build the kernel menu: - local kernels = core.kernelList(); - -- Don't do anything if we don't have multiple kernels - if #kernels <= 1 then - return nil; - end - current_kernel_index = (current_kernel_index % #kernels) - + 1; - local current_kernel = kernels[current_kernel_index]; - config.reload(current_kernel) + func = function(choice) + config.reload(choice); end, alias = {"k", "K"} }, @@ -239,6 +230,19 @@ menu.welcome = { }; +-- The first item in every carousel is always the default item. +function menu.getCarouselIndex(id) + local val = carousel_choices[id]; + if (val == nil) then + return 1; + end + return val; +end + +function menu.setCarouselIndex(id, idx) + carousel_choices[id] = idx; +end + function menu.run(m) if (menu.skip()) then @@ -283,6 +287,15 @@ function menu.run(m) if (sel_entry.entry_type == "entry") then -- run function sel_entry.func(); + elseif (sel_entry.entry_type == "carousel_entry") then + -- carousel (rotating) functionality + local carid = sel_entry.carousel_id; + local caridx = menu.getCarouselIndex(carid); + local choices = sel_entry.items(); + + caridx = (caridx % #choices) + 1; + menu.setCarouselIndex(carid, caridx); + sel_entry.func(choices[caridx]); elseif (sel_entry.entry_type == "submenu") then -- recurse cont = menu.run(sel_entry.submenu()); From owner-svn-src-all@freebsd.org Fri Feb 16 14:57:43 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 826B9F1B1DE; Fri, 16 Feb 2018 14:57:43 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 371C67DDB5; Fri, 16 Feb 2018 14:57:43 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2DC077291; Fri, 16 Feb 2018 14:57:43 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1GEvhHf038130; Fri, 16 Feb 2018 14:57:43 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1GEvgQs038127; Fri, 16 Feb 2018 14:57:42 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201802161457.w1GEvgQs038127@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Fri, 16 Feb 2018 14:57:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329368 - head/stand/lua X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/stand/lua X-SVN-Commit-Revision: 329368 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Feb 2018 14:57:43 -0000 Author: kevans Date: Fri Feb 16 14:57:42 2018 New Revision: 329368 URL: https://svnweb.freebsd.org/changeset/base/329368 Log: stand/lua: Create/use some MENU_ constants where applicable Modified: head/stand/lua/core.lua head/stand/lua/drawer.lua head/stand/lua/menu.lua Modified: head/stand/lua/core.lua ============================================================================== --- head/stand/lua/core.lua Fri Feb 16 14:39:41 2018 (r329367) +++ head/stand/lua/core.lua Fri Feb 16 14:57:42 2018 (r329368) @@ -29,11 +29,17 @@ local core = {}; -- Commonly appearing constants -core.KEY_ENTER = 13; -core.KEY_BACKSPACE = 127; +core.KEY_ENTER = 13; +core.KEY_BACKSPACE = 127; -core.KEYSTR_ESCAPE = "\027"; +core.KEYSTR_ESCAPE = "\027"; +core.MENU_RETURN = "return"; +core.MENU_ENTRY = "entry"; +core.MENU_SEPARATOR = "separator"; +core.MENU_SUBMENU = "submenu"; +core.MENU_CAROUSEL_ENTRY = "carousel_entry"; + function core.setVerbose(b) if (b == nil) then b = not core.verbose; @@ -119,6 +125,7 @@ function core.kernelList() local k = loader.getenv("kernel"); local v = loader.getenv("kernels") or ""; + v = "kernel;kernel.GENERIC" local kernels = {}; local i = 0; if k ~= nil then Modified: head/stand/lua/drawer.lua ============================================================================== --- head/stand/lua/drawer.lua Fri Feb 16 14:39:41 2018 (r329367) +++ head/stand/lua/drawer.lua Fri Feb 16 14:57:42 2018 (r329368) @@ -29,6 +29,7 @@ local drawer = {}; local color = require("color"); +local core = require("core"); local screen = require("screen"); drawer.brand_position = {x = 2, y = 1}; @@ -166,12 +167,12 @@ function drawer.drawmenu(m) local alias_table = {}; local entry_num = 0; for line_num, e in ipairs(m) do - if (e.entry_type ~= "separator") then + if (e.entry_type ~= core.MENU_SEPARATOR) then entry_num = entry_num + 1; screen.setcursor(x, y + line_num); local name = ""; - if (e.entry_type == "carousel_entry") then + if (e.entry_type == core.MENU_CAROUSEL_ENTRY) then local carid = e.carousel_id; local caridx = menu.getCarouselIndex(carid); local choices = e.items(); Modified: head/stand/lua/menu.lua ============================================================================== --- head/stand/lua/menu.lua Fri Feb 16 14:39:41 2018 (r329367) +++ head/stand/lua/menu.lua Fri Feb 16 14:57:42 2018 (r329368) @@ -50,7 +50,7 @@ local welcome; menu.boot_options = { -- return to welcome menu { - entry_type = "return", + entry_type = core.MENU_RETURN, name = function() return "Back to main menu"..color.highlight(" [Backspace]"); end @@ -58,7 +58,7 @@ menu.boot_options = { -- load defaults { - entry_type = "entry", + entry_type = core.MENU_ENTRY, name = function() return "Load System "..color.highlight("D").."efaults"; end, @@ -69,14 +69,14 @@ menu.boot_options = { }, { - entry_type = "separator", + entry_type = core.MENU_SEPARATOR, name = function() return ""; end }, { - entry_type = "separator", + entry_type = core.MENU_SEPARATOR, name = function() return "Boot Options:"; end @@ -84,7 +84,7 @@ menu.boot_options = { -- acpi { - entry_type = "entry", + entry_type = core.MENU_ENTRY, name = function() return OnOff(color.highlight("A").."CPI :", core.acpi); end, @@ -95,7 +95,7 @@ menu.boot_options = { }, -- safe mode { - entry_type = "entry", + entry_type = core.MENU_ENTRY, name = function() return OnOff("Safe "..color.highlight("M").."ode :", core.sm); end, @@ -106,7 +106,7 @@ menu.boot_options = { }, -- single user { - entry_type = "entry", + entry_type = core.MENU_ENTRY, name = function() return OnOff(color.highlight("S").."ingle user:", core.su); end, @@ -117,7 +117,7 @@ menu.boot_options = { }, -- verbose boot { - entry_type = "entry", + entry_type = core.MENU_ENTRY, name = function() return OnOff(color.highlight("V").."erbose :", core.verbose); end, @@ -131,7 +131,7 @@ menu.boot_options = { menu.welcome = { -- boot multi user { - entry_type = "entry", + entry_type = core.MENU_ENTRY, name = function() return color.highlight("B").."oot Multi user "..color.highlight("[Enter]"); end, @@ -144,7 +144,7 @@ menu.welcome = { -- boot single user { - entry_type = "entry", + entry_type = core.MENU_ENTRY, name = function() return "Boot "..color.highlight("S").."ingle user"; end, @@ -157,7 +157,7 @@ menu.welcome = { -- escape to interpreter { - entry_type = "return", + entry_type = core.MENU_RETURN, name = function() return color.highlight("Esc").."ape to loader prompt"; end, @@ -166,7 +166,7 @@ menu.welcome = { -- reboot { - entry_type = "entry", + entry_type = core.MENU_ENTRY, name = function() return color.highlight("R").."eboot"; end, @@ -178,14 +178,14 @@ menu.welcome = { { - entry_type = "separator", + entry_type = core.MENU_SEPARATOR, name = function() return ""; end }, { - entry_type = "separator", + entry_type = core.MENU_SEPARATOR, name = function() return "Options:"; end @@ -193,7 +193,7 @@ menu.welcome = { -- kernel options { - entry_type = "carousel_entry", + entry_type = core.MENU_CAROUSEL_ENTRY, carousel_id = "kernel", items = core.kernelList, name = function(idx, choice, all_choices) @@ -218,7 +218,7 @@ menu.welcome = { -- boot options { - entry_type = "submenu", + entry_type = core.MENU_SUBMENU, name = function() return "Boot "..color.highlight("O").."ptions"; end, @@ -284,10 +284,10 @@ function menu.run(m) -- if we have an alias do the assigned action: if(sel_entry ~= nil) then - if (sel_entry.entry_type == "entry") then + if (sel_entry.entry_type == core.MENU_ENTRY) then -- run function sel_entry.func(); - elseif (sel_entry.entry_type == "carousel_entry") then + elseif (sel_entry.entry_type == core.MENU_CAROUSEL_ENTRY) then -- carousel (rotating) functionality local carid = sel_entry.carousel_id; local caridx = menu.getCarouselIndex(carid); @@ -296,10 +296,10 @@ function menu.run(m) caridx = (caridx % #choices) + 1; menu.setCarouselIndex(carid, caridx); sel_entry.func(choices[caridx]); - elseif (sel_entry.entry_type == "submenu") then + elseif (sel_entry.entry_type == core.MENU_SUBMENU) then -- recurse cont = menu.run(sel_entry.submenu()); - elseif (sel_entry.entry_type == "return") then + elseif (sel_entry.entry_type == core.MENU_RETURN) then -- break recurse cont = false; end From owner-svn-src-all@freebsd.org Fri Feb 16 14:59:11 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ACE53F1B3C0; Fri, 16 Feb 2018 14:59:11 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5CD317DF53; Fri, 16 Feb 2018 14:59:11 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 57B047292; Fri, 16 Feb 2018 14:59:11 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1GExB6t038220; Fri, 16 Feb 2018 14:59:11 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1GExB0i038219; Fri, 16 Feb 2018 14:59:11 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201802161459.w1GExB0i038219@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Fri, 16 Feb 2018 14:59:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329369 - head/stand/lua X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/stand/lua X-SVN-Commit-Revision: 329369 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Feb 2018 14:59:11 -0000 Author: kevans Date: Fri Feb 16 14:59:11 2018 New Revision: 329369 URL: https://svnweb.freebsd.org/changeset/base/329369 Log: stand/lua: Remove sneaky kernel assignment Modified: head/stand/lua/core.lua Modified: head/stand/lua/core.lua ============================================================================== --- head/stand/lua/core.lua Fri Feb 16 14:57:42 2018 (r329368) +++ head/stand/lua/core.lua Fri Feb 16 14:59:11 2018 (r329369) @@ -125,7 +125,6 @@ function core.kernelList() local k = loader.getenv("kernel"); local v = loader.getenv("kernels") or ""; - v = "kernel;kernel.GENERIC" local kernels = {}; local i = 0; if k ~= nil then From owner-svn-src-all@freebsd.org Fri Feb 16 15:00:16 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BBC06F1B552; Fri, 16 Feb 2018 15:00:16 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6739D7E121; Fri, 16 Feb 2018 15:00:16 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 61CCE7296; Fri, 16 Feb 2018 15:00:16 +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 w1GF0Gmc038366; Fri, 16 Feb 2018 15:00:16 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1GF0FhT038352; Fri, 16 Feb 2018 15:00:15 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201802161500.w1GF0FhT038352@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 16 Feb 2018 15:00:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329370 - in head/sys: amd64/linux32 compat/linux i386/linux X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: in head/sys: amd64/linux32 compat/linux i386/linux X-SVN-Commit-Revision: 329370 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Feb 2018 15:00:17 -0000 Author: emaste Date: Fri Feb 16 15:00:14 2018 New Revision: 329370 URL: https://svnweb.freebsd.org/changeset/base/329370 Log: Rationalize license text on Linuxolator files Many licenses on Linuxolator files contained small variations from the standard FreeBSD license text. To avoid license proliferation switch to the standard 2-clause FreeBSD license for those files where I have permission from each of the listed copyright holders. Additional files waiting on permission from others are listed in review D14210. Approved by: kan, marcel, sos, rdivacky MFC after: 1 week Sponsored by: The FreeBSD Foundation Modified: head/sys/amd64/linux32/linux32_dummy.c head/sys/compat/linux/linux_file.c head/sys/compat/linux/linux_ioctl.c head/sys/compat/linux/linux_ipc.c head/sys/compat/linux/linux_mib.c head/sys/compat/linux/linux_signal.c head/sys/compat/linux/linux_socket.c head/sys/compat/linux/linux_stats.c head/sys/compat/linux/linux_sysctl.c head/sys/i386/linux/imgact_linux.c head/sys/i386/linux/linux_dummy.c head/sys/i386/linux/linux_machdep.c head/sys/i386/linux/linux_ptrace.c head/sys/i386/linux/linux_sysvec.c Modified: head/sys/amd64/linux32/linux32_dummy.c ============================================================================== --- head/sys/amd64/linux32/linux32_dummy.c Fri Feb 16 14:59:11 2018 (r329369) +++ head/sys/amd64/linux32/linux32_dummy.c Fri Feb 16 15:00:14 2018 (r329370) @@ -1,5 +1,5 @@ /*- - * SPDX-License-Identifier: BSD-3-Clause + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD * * Copyright (c) 1994-1995 Søren Schmidt * All rights reserved. @@ -8,24 +8,22 @@ * 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 - * in this position and unchanged. + * 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. 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. + * 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 Modified: head/sys/compat/linux/linux_file.c ============================================================================== --- head/sys/compat/linux/linux_file.c Fri Feb 16 14:59:11 2018 (r329369) +++ head/sys/compat/linux/linux_file.c Fri Feb 16 15:00:14 2018 (r329370) @@ -1,5 +1,5 @@ /*- - * SPDX-License-Identifier: BSD-3-Clause + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD * * Copyright (c) 1994-1995 Søren Schmidt * All rights reserved. @@ -8,24 +8,22 @@ * 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 - * in this position and unchanged. + * 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. 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. + * 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 Modified: head/sys/compat/linux/linux_ioctl.c ============================================================================== --- head/sys/compat/linux/linux_ioctl.c Fri Feb 16 14:59:11 2018 (r329369) +++ head/sys/compat/linux/linux_ioctl.c Fri Feb 16 15:00:14 2018 (r329370) @@ -1,5 +1,5 @@ /*- - * SPDX-License-Identifier: BSD-3-Clause + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD * * Copyright (c) 1994-1995 Søren Schmidt * All rights reserved. @@ -8,24 +8,22 @@ * 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 - * in this position and unchanged. + * 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. 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. + * 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 "opt_compat.h" Modified: head/sys/compat/linux/linux_ipc.c ============================================================================== --- head/sys/compat/linux/linux_ipc.c Fri Feb 16 14:59:11 2018 (r329369) +++ head/sys/compat/linux/linux_ipc.c Fri Feb 16 15:00:14 2018 (r329370) @@ -1,5 +1,5 @@ /*- - * SPDX-License-Identifier: BSD-3-Clause + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD * * Copyright (c) 1994-1995 Søren Schmidt * All rights reserved. @@ -8,24 +8,22 @@ * 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 - * in this position and unchanged. + * 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. 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. + * 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 Modified: head/sys/compat/linux/linux_mib.c ============================================================================== --- head/sys/compat/linux/linux_mib.c Fri Feb 16 14:59:11 2018 (r329369) +++ head/sys/compat/linux/linux_mib.c Fri Feb 16 15:00:14 2018 (r329370) @@ -1,5 +1,5 @@ /*- - * SPDX-License-Identifier: BSD-3-Clause + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD * * Copyright (c) 1999 Marcel Moolenaar * All rights reserved. @@ -8,24 +8,22 @@ * 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 - * in this position and unchanged. + * 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. 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. + * 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 Modified: head/sys/compat/linux/linux_signal.c ============================================================================== --- head/sys/compat/linux/linux_signal.c Fri Feb 16 14:59:11 2018 (r329369) +++ head/sys/compat/linux/linux_signal.c Fri Feb 16 15:00:14 2018 (r329370) @@ -1,5 +1,5 @@ /*- - * SPDX-License-Identifier: BSD-3-Clause + * SPDX-License-Identifier: BSD-2-Clause * * Copyright (c) 1994-1995 Søren Schmidt * All rights reserved. @@ -8,24 +8,22 @@ * 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 - * in this position and unchanged. + * 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. 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. + * 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 Modified: head/sys/compat/linux/linux_socket.c ============================================================================== --- head/sys/compat/linux/linux_socket.c Fri Feb 16 14:59:11 2018 (r329369) +++ head/sys/compat/linux/linux_socket.c Fri Feb 16 15:00:14 2018 (r329370) @@ -1,5 +1,5 @@ /*- - * SPDX-License-Identifier: BSD-3-Clause + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD * * Copyright (c) 1995 Søren Schmidt * All rights reserved. @@ -8,24 +8,22 @@ * 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 - * in this position and unchanged. + * 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. 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. + * 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 Modified: head/sys/compat/linux/linux_stats.c ============================================================================== --- head/sys/compat/linux/linux_stats.c Fri Feb 16 14:59:11 2018 (r329369) +++ head/sys/compat/linux/linux_stats.c Fri Feb 16 15:00:14 2018 (r329370) @@ -1,5 +1,5 @@ /*- - * SPDX-License-Identifier: BSD-3-Clause + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD * * Copyright (c) 1994-1995 Søren Schmidt * All rights reserved. @@ -8,24 +8,22 @@ * 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 - * in this position and unchanged. + * 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. 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. + * 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 Modified: head/sys/compat/linux/linux_sysctl.c ============================================================================== --- head/sys/compat/linux/linux_sysctl.c Fri Feb 16 14:59:11 2018 (r329369) +++ head/sys/compat/linux/linux_sysctl.c Fri Feb 16 15:00:14 2018 (r329370) @@ -1,5 +1,5 @@ /*- - * SPDX-License-Identifier: BSD-3-Clause + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD * * Copyright (c) 2001 Marcel Moolenaar * All rights reserved. @@ -8,24 +8,22 @@ * 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 - * in this position and unchanged. + * 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. 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. + * 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 Modified: head/sys/i386/linux/imgact_linux.c ============================================================================== --- head/sys/i386/linux/imgact_linux.c Fri Feb 16 14:59:11 2018 (r329369) +++ head/sys/i386/linux/imgact_linux.c Fri Feb 16 15:00:14 2018 (r329370) @@ -1,5 +1,5 @@ /*- - * SPDX-License-Identifier: BSD-3-Clause + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD * * Copyright (c) 1994-1996 Søren Schmidt * All rights reserved. @@ -11,24 +11,22 @@ * 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 - * in this position and unchanged. + * 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. 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. + * 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 Modified: head/sys/i386/linux/linux_dummy.c ============================================================================== --- head/sys/i386/linux/linux_dummy.c Fri Feb 16 14:59:11 2018 (r329369) +++ head/sys/i386/linux/linux_dummy.c Fri Feb 16 15:00:14 2018 (r329370) @@ -1,5 +1,5 @@ /*- - * SPDX-License-Identifier: BSD-3-Clause + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD * * Copyright (c) 1994-1995 Søren Schmidt * All rights reserved. @@ -8,24 +8,22 @@ * 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 - * in this position and unchanged. + * 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. 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. + * 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 Modified: head/sys/i386/linux/linux_machdep.c ============================================================================== --- head/sys/i386/linux/linux_machdep.c Fri Feb 16 14:59:11 2018 (r329369) +++ head/sys/i386/linux/linux_machdep.c Fri Feb 16 15:00:14 2018 (r329370) @@ -1,5 +1,5 @@ /*- - * SPDX-License-Identifier: BSD-3-Clause + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD * * Copyright (c) 2000 Marcel Moolenaar * All rights reserved. @@ -8,24 +8,22 @@ * 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 - * in this position and unchanged. + * 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. 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. + * 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 Modified: head/sys/i386/linux/linux_ptrace.c ============================================================================== --- head/sys/i386/linux/linux_ptrace.c Fri Feb 16 14:59:11 2018 (r329369) +++ head/sys/i386/linux/linux_ptrace.c Fri Feb 16 15:00:14 2018 (r329370) @@ -1,5 +1,5 @@ /*- - * SPDX-License-Identifier: BSD-3-Clause + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD * * Copyright (c) 2001 Alexander Kabaev * All rights reserved. @@ -8,24 +8,22 @@ * 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 - * in this position and unchanged. + * 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. 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. + * 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 Modified: head/sys/i386/linux/linux_sysvec.c ============================================================================== --- head/sys/i386/linux/linux_sysvec.c Fri Feb 16 14:59:11 2018 (r329369) +++ head/sys/i386/linux/linux_sysvec.c Fri Feb 16 15:00:14 2018 (r329370) @@ -1,5 +1,5 @@ /*- - * SPDX-License-Identifier: BSD-3-Clause + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD * * Copyright (c) 1994-1996 Søren Schmidt * All rights reserved. @@ -8,24 +8,22 @@ * 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 - * in this position and unchanged. + * 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. 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. + * 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 From owner-svn-src-all@freebsd.org Fri Feb 16 15:20:22 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EC2DFF1CFC9; Fri, 16 Feb 2018 15:20:21 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A27497F30B; Fri, 16 Feb 2018 15:20:21 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 98DD475E9; Fri, 16 Feb 2018 15:20:21 +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 w1GFKLaS049086; Fri, 16 Feb 2018 15:20:21 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1GFKLiA049085; Fri, 16 Feb 2018 15:20:21 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201802161520.w1GFKLiA049085@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 16 Feb 2018 15:20:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329371 - head/sys/compat/linuxkpi/common/include/asm X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/compat/linuxkpi/common/include/asm X-SVN-Commit-Revision: 329371 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Feb 2018 15:20:22 -0000 Author: hselasky Date: Fri Feb 16 15:20:21 2018 New Revision: 329371 URL: https://svnweb.freebsd.org/changeset/base/329371 Log: Allow the cmpxchg() macro in the LinuxKPI to work on pointers without generating compiler warnings, -Wint-conversion . Requested by: Johannes Lundberg Sponsored by: Mellanox Technologies Modified: head/sys/compat/linuxkpi/common/include/asm/atomic.h Modified: head/sys/compat/linuxkpi/common/include/asm/atomic.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/asm/atomic.h Fri Feb 16 15:00:14 2018 (r329370) +++ head/sys/compat/linuxkpi/common/include/asm/atomic.h Fri Feb 16 15:20:21 2018 (r329371) @@ -159,36 +159,41 @@ atomic_cmpxchg(atomic_t *v, int old, int new) return (ret); } -#define cmpxchg(ptr, old, new) ({ \ - __typeof(*(ptr)) __ret; \ - \ - CTASSERT(sizeof(__ret) == 1 || sizeof(__ret) == 2 || \ - sizeof(__ret) == 4 || sizeof(__ret) == 8); \ - \ - __ret = (old); \ - switch (sizeof(__ret)) { \ - case 1: \ - while (!atomic_fcmpset_8((volatile int8_t *)(ptr), \ - (int8_t *)&__ret, (new)) && __ret == (old)) \ - ; \ - break; \ - case 2: \ - while (!atomic_fcmpset_16((volatile int16_t *)(ptr), \ - (int16_t *)&__ret, (new)) && __ret == (old)) \ - ; \ - break; \ - case 4: \ - while (!atomic_fcmpset_32((volatile int32_t *)(ptr), \ - (int32_t *)&__ret, (new)) && __ret == (old)) \ - ; \ - break; \ - case 8: \ - while (!atomic_fcmpset_64((volatile int64_t *)(ptr), \ - (int64_t *)&__ret, (new)) && __ret == (old)) \ - ; \ - break; \ - } \ - __ret; \ +#define cmpxchg(ptr, old, new) ({ \ + union { \ + __typeof(*(ptr)) val; \ + u8 u8[]; \ + u16 u16[]; \ + u32 u32[]; \ + u64 u64[]; \ + } __ret = { .val = (old) }, __new = { .val = (new) }; \ + \ + CTASSERT(sizeof(__ret.val) == 1 || sizeof(__ret.val) == 2 || \ + sizeof(__ret.val) == 4 || sizeof(__ret.val) == 8); \ + \ + switch (sizeof(__ret.val)) { \ + case 1: \ + while (!atomic_fcmpset_8((volatile u8 *)(ptr), \ + __ret.u8, __new.u8[0]) && __ret.val == (old)) \ + ; \ + break; \ + case 2: \ + while (!atomic_fcmpset_16((volatile u16 *)(ptr), \ + __ret.u16, __new.u16[0]) && __ret.val == (old)) \ + ; \ + break; \ + case 4: \ + while (!atomic_fcmpset_32((volatile u32 *)(ptr), \ + __ret.u32, __new.u32[0]) && __ret.val == (old)) \ + ; \ + break; \ + case 8: \ + while (!atomic_fcmpset_64((volatile u64 *)(ptr), \ + __ret.u64, __new.u64[0]) && __ret.val == (old)) \ + ; \ + break; \ + } \ + __ret.val; \ }) #define cmpxchg_relaxed(...) cmpxchg(__VA_ARGS__) From owner-svn-src-all@freebsd.org Fri Feb 16 15:37:34 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B9682F1E63A; Fri, 16 Feb 2018 15:37:34 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 51BB38006A; Fri, 16 Feb 2018 15:37:34 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4C6277919; Fri, 16 Feb 2018 15:37:34 +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 w1GFbYsU059034; Fri, 16 Feb 2018 15:37:34 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1GFbY8D059033; Fri, 16 Feb 2018 15:37:34 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201802161537.w1GFbY8D059033@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 16 Feb 2018 15:37:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329372 - head/sys/compat/linuxkpi/common/include/linux X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 329372 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Feb 2018 15:37:34 -0000 Author: hselasky Date: Fri Feb 16 15:37:33 2018 New Revision: 329372 URL: https://svnweb.freebsd.org/changeset/base/329372 Log: Implement enable_irq() and disable_irq() in the LinuxKPI. MFC after: 1 week Submitted by: Johannes Lundberg Sponsored by: Mellanox Technologies Modified: head/sys/compat/linuxkpi/common/include/linux/interrupt.h Modified: head/sys/compat/linuxkpi/common/include/linux/interrupt.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/interrupt.h Fri Feb 16 15:20:21 2018 (r329371) +++ head/sys/compat/linuxkpi/common/include/linux/interrupt.h Fri Feb 16 15:37:33 2018 (r329372) @@ -112,6 +112,38 @@ request_irq(unsigned int irq, irq_handler_t handler, u } static inline int +enable_irq(unsigned int irq) +{ + struct irq_ent *irqe; + struct device *dev; + + dev = linux_pci_find_irq_dev(irq); + if (dev == NULL) + return -EINVAL; + irqe = linux_irq_ent(dev, irq); + if (irqe == NULL) + return -EINVAL; + return -bus_setup_intr(dev->bsddev, irqe->res, INTR_TYPE_NET | INTR_MPSAFE, + NULL, linux_irq_handler, irqe, &irqe->tag); +} + +static inline void +disable_irq(unsigned int irq) +{ + struct irq_ent *irqe; + struct device *dev; + + dev = linux_pci_find_irq_dev(irq); + if (dev == NULL) + return; + irqe = linux_irq_ent(dev, irq); + if (irqe == NULL) + return; + bus_teardown_intr(dev->bsddev, irqe->res, irqe->tag); + irqe->tag = NULL; +} + +static inline int bind_irq_to_cpu(unsigned int irq, int cpu_id) { struct irq_ent *irqe; From owner-svn-src-all@freebsd.org Fri Feb 16 15:38:03 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 092CAF1E6E6; Fri, 16 Feb 2018 15:38:03 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AFD928017C; Fri, 16 Feb 2018 15:38:02 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AAAD9791A; Fri, 16 Feb 2018 15:38:02 +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 w1GFc2b2059103; Fri, 16 Feb 2018 15:38:02 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1GFc26r059102; Fri, 16 Feb 2018 15:38:02 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201802161538.w1GFc26r059102@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 16 Feb 2018 15:38:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329373 - head/sys/conf X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/sys/conf X-SVN-Commit-Revision: 329373 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Feb 2018 15:38:03 -0000 Author: emaste Date: Fri Feb 16 15:38:02 2018 New Revision: 329373 URL: https://svnweb.freebsd.org/changeset/base/329373 Log: Correct module symbol export handling EXPORT_SYMS can be set to YES, NO, a list of symbols to export from a module, or to a filename containing such a list. For the case that it is set to a symbol list, replace spaces in the list with newlines, so the created file is in the format expected by kmod_syms.awk. Reviewed by: imp, jhb MFC after: 1 month Sponsored by: Turing Robotic Industries Inc. Differential Revision: https://reviews.freebsd.org/D14284 Modified: head/sys/conf/kmod.mk Modified: head/sys/conf/kmod.mk ============================================================================== --- head/sys/conf/kmod.mk Fri Feb 16 15:37:33 2018 (r329372) +++ head/sys/conf/kmod.mk Fri Feb 16 15:38:02 2018 (r329373) @@ -243,14 +243,14 @@ ${FULLPROG}: ${OBJS} .if ${EXPORT_SYMS} == NO :> export_syms .elif !exists(${.CURDIR}/${EXPORT_SYMS}) - echo ${EXPORT_SYMS} > export_syms + echo -n "${EXPORT_SYMS:@s@$s${.newline}@}" > export_syms .else grep -v '^#' < ${EXPORT_SYMS} > export_syms .endif ${AWK} -f ${SYSDIR}/conf/kmod_syms.awk ${.TARGET} \ export_syms | xargs -J% ${OBJCOPY} % ${.TARGET} .endif -.endif +.endif # defined(EXPORT_SYMS) .if defined(PREFIX_SYMS) ${AWK} -v prefix=${PREFIX_SYMS} -f ${SYSDIR}/conf/kmod_syms_prefix.awk \ ${.TARGET} /dev/null | xargs -J% ${OBJCOPY} % ${.TARGET} From owner-svn-src-all@freebsd.org Fri Feb 16 15:38:23 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 41810F1E738; Fri, 16 Feb 2018 15:38:23 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EB287802C1; Fri, 16 Feb 2018 15:38:22 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E6200791B; Fri, 16 Feb 2018 15:38:22 +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 w1GFcMaI059158; Fri, 16 Feb 2018 15:38:22 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1GFcMOu059157; Fri, 16 Feb 2018 15:38:22 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201802161538.w1GFcMOu059157@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Fri, 16 Feb 2018 15:38:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329374 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 329374 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Feb 2018 15:38:23 -0000 Author: markj Date: Fri Feb 16 15:38:22 2018 New Revision: 329374 URL: https://svnweb.freebsd.org/changeset/base/329374 Log: Use the conventional name for an array of pages. No functional change intended. Discussed with: kib MFC after: 3 days Modified: head/sys/vm/swap_pager.c Modified: head/sys/vm/swap_pager.c ============================================================================== --- head/sys/vm/swap_pager.c Fri Feb 16 15:38:02 2018 (r329373) +++ head/sys/vm/swap_pager.c Fri Feb 16 15:38:22 2018 (r329374) @@ -1084,16 +1084,16 @@ swap_pager_unswapped(vm_page_t m) /* * swap_pager_getpages() - bring pages in from swap * - * Attempt to page in the pages in array "m" of length "count". The caller - * may optionally specify that additional pages preceding and succeeding - * the specified range be paged in. The number of such pages is returned - * in the "rbehind" and "rahead" parameters, and they will be in the - * inactive queue upon return. + * Attempt to page in the pages in array "ma" of length "count". The + * caller may optionally specify that additional pages preceding and + * succeeding the specified range be paged in. The number of such pages + * is returned in the "rbehind" and "rahead" parameters, and they will + * be in the inactive queue upon return. * - * The pages in "m" must be busied and will remain busied upon return. + * The pages in "ma" must be busied and will remain busied upon return. */ static int -swap_pager_getpages(vm_object_t object, vm_page_t *m, int count, int *rbehind, +swap_pager_getpages(vm_object_t object, vm_page_t *ma, int count, int *rbehind, int *rahead) { struct buf *bp; @@ -1108,7 +1108,7 @@ swap_pager_getpages(vm_object_t object, vm_page_t *m, bp = getpbuf(&nsw_rcount); VM_OBJECT_WLOCK(object); - if (!swap_pager_haspage(object, m[0]->pindex, &maxbehind, &maxahead)) { + if (!swap_pager_haspage(object, ma[0]->pindex, &maxbehind, &maxahead)) { relpbuf(bp, &nsw_rcount); return (VM_PAGER_FAIL); } @@ -1120,15 +1120,15 @@ swap_pager_getpages(vm_object_t object, vm_page_t *m, KASSERT(reqcount - 1 <= maxahead, ("page count %d extends beyond swap block", reqcount)); *rahead = imin(*rahead, maxahead - (reqcount - 1)); - pindex = m[reqcount - 1]->pindex; - msucc = TAILQ_NEXT(m[reqcount - 1], listq); + pindex = ma[reqcount - 1]->pindex; + msucc = TAILQ_NEXT(ma[reqcount - 1], listq); if (msucc != NULL && msucc->pindex - pindex - 1 < *rahead) *rahead = msucc->pindex - pindex - 1; } if (rbehind != NULL) { *rbehind = imin(*rbehind, maxbehind); - pindex = m[0]->pindex; - mpred = TAILQ_PREV(m[0], pglist, listq); + pindex = ma[0]->pindex; + mpred = TAILQ_PREV(ma[0], pglist, listq); if (mpred != NULL && pindex - mpred->pindex - 1 < *rbehind) *rbehind = pindex - mpred->pindex - 1; } @@ -1139,7 +1139,7 @@ swap_pager_getpages(vm_object_t object, vm_page_t *m, shift = rbehind != NULL ? *rbehind : 0; if (shift != 0) { for (i = 1; i <= shift; i++) { - p = vm_page_alloc(object, m[0]->pindex - i, + p = vm_page_alloc(object, ma[0]->pindex - i, VM_ALLOC_NORMAL); if (p == NULL) { /* Shift allocated pages to the left. */ @@ -1154,11 +1154,11 @@ swap_pager_getpages(vm_object_t object, vm_page_t *m, *rbehind = shift; } for (i = 0; i < reqcount; i++) - bp->b_pages[i + shift] = m[i]; + bp->b_pages[i + shift] = ma[i]; if (rahead != NULL) { for (i = 0; i < *rahead; i++) { p = vm_page_alloc(object, - m[reqcount - 1]->pindex + i + 1, VM_ALLOC_NORMAL); + ma[reqcount - 1]->pindex + i + 1, VM_ALLOC_NORMAL); if (p == NULL) break; bp->b_pages[shift + reqcount + i] = p; @@ -1203,7 +1203,7 @@ swap_pager_getpages(vm_object_t object, vm_page_t *m, * Instead, we look at the one page we are interested in which we * still hold a lock on even through the I/O completion. * - * The other pages in our m[] array are also released on completion, + * The other pages in our ma[] array are also released on completion, * so we cannot assume they are valid anymore either. * * NOTE: b_blkno is destroyed by the call to swapdev_strategy @@ -1217,8 +1217,8 @@ swap_pager_getpages(vm_object_t object, vm_page_t *m, * is set in the metadata for each page in the request. */ VM_OBJECT_WLOCK(object); - while ((m[0]->oflags & VPO_SWAPINPROG) != 0) { - m[0]->oflags |= VPO_SWAPSLEEP; + while ((ma[0]->oflags & VPO_SWAPINPROG) != 0) { + ma[0]->oflags |= VPO_SWAPSLEEP; VM_CNT_INC(v_intrans); if (VM_OBJECT_SLEEP(object, &object->paging_in_progress, PSWP, "swread", hz * 20)) { @@ -1232,7 +1232,7 @@ swap_pager_getpages(vm_object_t object, vm_page_t *m, * If we had an unrecoverable read error pages will not be valid. */ for (i = 0; i < reqcount; i++) - if (m[i]->valid != VM_PAGE_BITS_ALL) + if (ma[i]->valid != VM_PAGE_BITS_ALL) return (VM_PAGER_ERROR); return (VM_PAGER_OK); @@ -1252,12 +1252,12 @@ swap_pager_getpages(vm_object_t object, vm_page_t *m, * swap_pager_getpages(). */ static int -swap_pager_getpages_async(vm_object_t object, vm_page_t *m, int count, +swap_pager_getpages_async(vm_object_t object, vm_page_t *ma, int count, int *rbehind, int *rahead, pgo_getpages_iodone_t iodone, void *arg) { int r, error; - r = swap_pager_getpages(object, m, count, rbehind, rahead); + r = swap_pager_getpages(object, ma, count, rbehind, rahead); VM_OBJECT_WUNLOCK(object); switch (r) { case VM_PAGER_OK: @@ -1272,7 +1272,7 @@ swap_pager_getpages_async(vm_object_t object, vm_page_ default: panic("unhandled swap_pager_getpages() error %d", r); } - (iodone)(arg, m, count, error); + (iodone)(arg, ma, count, error); VM_OBJECT_WLOCK(object); return (r); @@ -1301,16 +1301,16 @@ swap_pager_getpages_async(vm_object_t object, vm_page_ * We need to unbusy the rest on I/O completion. */ static void -swap_pager_putpages(vm_object_t object, vm_page_t *m, int count, +swap_pager_putpages(vm_object_t object, vm_page_t *ma, int count, int flags, int *rtvals) { int i, n; boolean_t sync; - if (count && m[0]->object != object) { + if (count && ma[0]->object != object) { panic("swap_pager_putpages: object mismatch %p/%p", object, - m[0]->object + ma[0]->object ); } @@ -1388,7 +1388,7 @@ swap_pager_putpages(vm_object_t object, vm_page_t *m, VM_OBJECT_WLOCK(object); for (j = 0; j < n; ++j) { - vm_page_t mreq = m[i+j]; + vm_page_t mreq = ma[i+j]; swp_pager_meta_build( mreq->object, From owner-svn-src-all@freebsd.org Fri Feb 16 15:41:05 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E2818F1EA49; Fri, 16 Feb 2018 15:41:04 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 946F08059B; Fri, 16 Feb 2018 15:41:04 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8C0F27952; Fri, 16 Feb 2018 15:41:04 +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 w1GFf4mP061500; Fri, 16 Feb 2018 15:41:04 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1GFf3UY061493; Fri, 16 Feb 2018 15:41:03 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201802161541.w1GFf3UY061493@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Fri, 16 Feb 2018 15:41:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329375 - in head: lib/libufs stand/libsa sys/geom sys/geom/journal sys/geom/label sys/ufs/ffs X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in head: lib/libufs stand/libsa sys/geom sys/geom/journal sys/geom/label sys/ufs/ffs X-SVN-Commit-Revision: 329375 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Feb 2018 15:41:05 -0000 Author: markj Date: Fri Feb 16 15:41:03 2018 New Revision: 329375 URL: https://svnweb.freebsd.org/changeset/base/329375 Log: Fix a memory leak introduced in r328426. ffs_sbget() may return a superblock buffer even if it fails, so the caller must be prepared to free it in this case. Moreover, when tasting alternate superblock locations in a loop, ffs_sbget()'s readfunc callback must free the previously allocated buffer. Reported and tested by: pho Reviewed by: kib (previous version) Differential Revision: https://reviews.freebsd.org/D14390 Modified: head/lib/libufs/sblock.c head/stand/libsa/ufs.c head/sys/geom/geom_io.c head/sys/geom/journal/g_journal_ufs.c head/sys/geom/label/g_label_ufs.c head/sys/ufs/ffs/ffs_subr.c head/sys/ufs/ffs/ffs_vfsops.c Modified: head/lib/libufs/sblock.c ============================================================================== --- head/lib/libufs/sblock.c Fri Feb 16 15:38:22 2018 (r329374) +++ head/lib/libufs/sblock.c Fri Feb 16 15:41:03 2018 (r329375) @@ -150,6 +150,7 @@ use_pread(void *devfd, off_t loc, void **bufp, int siz int fd; fd = *(int *)devfd; + free(*bufp); if ((*bufp = malloc(size)) == NULL) return (ENOSPC); if (pread(fd, *bufp, size, loc) != size) Modified: head/stand/libsa/ufs.c ============================================================================== --- head/stand/libsa/ufs.c Fri Feb 16 15:38:22 2018 (r329374) +++ head/stand/libsa/ufs.c Fri Feb 16 15:41:03 2018 (r329375) @@ -687,6 +687,7 @@ ufs_use_sa_read(void *devfd, off_t loc, void **bufp, i int error; f = (struct open_file *)devfd; + free(*bufp); if ((*bufp = malloc(size)) == NULL) return (ENOSPC); error = (f->f_dev->dv_strategy)(f->f_devdata, F_READ, loc / DEV_BSIZE, Modified: head/sys/geom/geom_io.c ============================================================================== --- head/sys/geom/geom_io.c Fri Feb 16 15:38:22 2018 (r329374) +++ head/sys/geom/geom_io.c Fri Feb 16 15:41:03 2018 (r329375) @@ -966,6 +966,8 @@ g_use_g_read_data(void *devfd, off_t loc, void **bufp, */ if (loc % cp->provider->sectorsize != 0) return (ENOENT); + if (*bufp != NULL) + g_free(*bufp); *bufp = g_read_data(cp, loc, size, NULL); if (*bufp == NULL) return (ENOENT); Modified: head/sys/geom/journal/g_journal_ufs.c ============================================================================== --- head/sys/geom/journal/g_journal_ufs.c Fri Feb 16 15:38:22 2018 (r329374) +++ head/sys/geom/journal/g_journal_ufs.c Fri Feb 16 15:41:03 2018 (r329375) @@ -70,10 +70,13 @@ g_journal_ufs_dirty(struct g_consumer *cp) struct fs *fs; int error; + fs = NULL; if (SBLOCKSIZE % cp->provider->sectorsize != 0 || ffs_sbget(cp, &fs, -1, NULL, g_use_g_read_data) != 0) { GJ_DEBUG(0, "Cannot find superblock to mark file system %s " "as dirty.", cp->provider->name); + if (fs != NULL) + g_free(fs); return; } GJ_DEBUG(0, "clean=%d flags=0x%x", fs->fs_clean, fs->fs_flags); Modified: head/sys/geom/label/g_label_ufs.c ============================================================================== --- head/sys/geom/label/g_label_ufs.c Fri Feb 16 15:38:22 2018 (r329374) +++ head/sys/geom/label/g_label_ufs.c Fri Feb 16 15:41:03 2018 (r329375) @@ -75,9 +75,14 @@ g_label_ufs_taste_common(struct g_consumer *cp, char * pp = cp->provider; label[0] = '\0'; + fs = NULL; if (SBLOCKSIZE % pp->sectorsize != 0 || - ffs_sbget(cp, &fs, -1, NULL, g_use_g_read_data) != 0) + ffs_sbget(cp, &fs, -1, NULL, g_use_g_read_data) != 0) { + if (fs != NULL) + g_free(fs); return; + } + /* * Check for magic. We also need to check if file system size * is almost equal to providers size, because sysinstall(8) Modified: head/sys/ufs/ffs/ffs_subr.c ============================================================================== --- head/sys/ufs/ffs/ffs_subr.c Fri Feb 16 15:38:22 2018 (r329374) +++ head/sys/ufs/ffs/ffs_subr.c Fri Feb 16 15:41:03 2018 (r329375) @@ -172,6 +172,7 @@ ffs_sbget(void *devfd, struct fs **fsp, off_t altsuper int32_t *lp; char *buf; + *fsp = NULL; if (altsuperblock != -1) { if ((ret = readsuper(devfd, fsp, altsuperblock, readfunc)) != 0) return (ret); @@ -209,9 +210,11 @@ ffs_sbget(void *devfd, struct fs **fsp, off_t altsuper size = fs->fs_bsize; if (i + fs->fs_frag > blks) size = (blks - i) * fs->fs_fsize; + buf = NULL; ret = (*readfunc)(devfd, dbtob(fsbtodb(fs, fs->fs_csaddr + i)), (void **)&buf, size); if (ret) { + UFS_FREE(buf, filltype); UFS_FREE(fs->fs_csp, filltype); fs->fs_csp = NULL; return (ret); Modified: head/sys/ufs/ffs/ffs_vfsops.c ============================================================================== --- head/sys/ufs/ffs/ffs_vfsops.c Fri Feb 16 15:38:22 2018 (r329374) +++ head/sys/ufs/ffs/ffs_vfsops.c Fri Feb 16 15:41:03 2018 (r329375) @@ -1075,6 +1075,7 @@ ffs_use_bread(void *devfd, off_t loc, void **bufp, int struct buf *bp; int error; + free(*bufp, M_UFSMNT); *bufp = malloc(size, M_UFSMNT, M_WAITOK); if ((error = bread((struct vnode *)devfd, btodb(loc), size, NOCRED, &bp)) != 0) { From owner-svn-src-all@freebsd.org Fri Feb 16 15:41:17 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 84ABFF1EA9C; Fri, 16 Feb 2018 15:41:17 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 35C87806C9; Fri, 16 Feb 2018 15:41:17 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 30B337963; Fri, 16 Feb 2018 15:41:17 +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 w1GFfGVe061553; Fri, 16 Feb 2018 15:41:16 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1GFfG0j061551; Fri, 16 Feb 2018 15:41:16 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201802161541.w1GFfG0j061551@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 16 Feb 2018 15:41:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329376 - in head/sys/compat/linuxkpi/common: include/linux src X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in head/sys/compat/linuxkpi/common: include/linux src X-SVN-Commit-Revision: 329376 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Feb 2018 15:41:17 -0000 Author: hselasky Date: Fri Feb 16 15:41:16 2018 New Revision: 329376 URL: https://svnweb.freebsd.org/changeset/base/329376 Log: Implement tasklet_enable() and tasklet_disable() in the LinuxKPI. MFC after: 1 week Requested by: Johannes Lundberg Sponsored by: Mellanox Technologies Modified: head/sys/compat/linuxkpi/common/include/linux/interrupt.h head/sys/compat/linuxkpi/common/src/linux_tasklet.c Modified: head/sys/compat/linuxkpi/common/include/linux/interrupt.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/interrupt.h Fri Feb 16 15:41:03 2018 (r329375) +++ head/sys/compat/linuxkpi/common/include/linux/interrupt.h Fri Feb 16 15:41:16 2018 (r329376) @@ -200,5 +200,7 @@ extern void tasklet_schedule(struct tasklet_struct *); extern void tasklet_kill(struct tasklet_struct *); extern void tasklet_init(struct tasklet_struct *, tasklet_func_t *, unsigned long data); +extern void tasklet_enable(struct tasklet_struct *); +extern void tasklet_disable(struct tasklet_struct *); #endif /* _LINUX_INTERRUPT_H_ */ Modified: head/sys/compat/linuxkpi/common/src/linux_tasklet.c ============================================================================== --- head/sys/compat/linuxkpi/common/src/linux_tasklet.c Fri Feb 16 15:41:03 2018 (r329375) +++ head/sys/compat/linuxkpi/common/src/linux_tasklet.c Fri Feb 16 15:41:16 2018 (r329376) @@ -41,6 +41,7 @@ __FBSDID("$FreeBSD$"); #define TASKLET_ST_BUSY 1 #define TASKLET_ST_EXEC 2 #define TASKLET_ST_LOOP 3 +#define TASKLET_ST_PAUSED 4 #define TASKLET_ST_CMPSET(ts, old, new) \ atomic_cmpset_ptr((volatile uintptr_t *)&(ts)->entry.tqe_prev, old, new) @@ -195,4 +196,22 @@ tasklet_kill(struct tasklet_struct *ts) /* wait until tasklet is no longer busy */ while (TASKLET_ST_GET(ts) != TASKLET_ST_IDLE) pause("W", 1); +} + +void +tasklet_enable(struct tasklet_struct *ts) +{ + (void) TASKLET_ST_CMPSET(ts, TASKLET_ST_PAUSED, TASKLET_ST_IDLE); +} + +void +tasklet_disable(struct tasklet_struct *ts) +{ + while (1) { + if (TASKLET_ST_GET(ts) == TASKLET_ST_PAUSED) + break; + if (TASKLET_ST_CMPSET(ts, TASKLET_ST_IDLE, TASKLET_ST_PAUSED)) + break; + pause("W", 1); + } } From owner-svn-src-all@freebsd.org Fri Feb 16 15:52:29 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EA8C9F1FEC1; Fri, 16 Feb 2018 15:52:28 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9F02682475; Fri, 16 Feb 2018 15:52:28 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 99F057C75; Fri, 16 Feb 2018 15:52:28 +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 w1GFqSUd071488; Fri, 16 Feb 2018 15:52:28 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1GFqSol071487; Fri, 16 Feb 2018 15:52:28 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201802161552.w1GFqSol071487@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 16 Feb 2018 15:52:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329377 - head/sys/compat/linuxkpi/common/include/linux X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 329377 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Feb 2018 15:52:29 -0000 Author: hselasky Date: Fri Feb 16 15:52:28 2018 New Revision: 329377 URL: https://svnweb.freebsd.org/changeset/base/329377 Log: Implement memdup_user_nul() in the LinuxKPI. MFC after: 1 week Submitted by: Johannes Lundberg Sponsored by: Mellanox Technologies Modified: head/sys/compat/linuxkpi/common/include/linux/string.h Modified: head/sys/compat/linuxkpi/common/include/linux/string.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/string.h Fri Feb 16 15:41:16 2018 (r329376) +++ head/sys/compat/linuxkpi/common/include/linux/string.h Fri Feb 16 15:52:28 2018 (r329377) @@ -71,6 +71,22 @@ memdup_user(const void *ptr, size_t len) } static inline void * +memdup_user_nul(const void *ptr, size_t len) +{ + char *retval; + int error; + + retval = malloc(len + 1, M_KMALLOC, M_WAITOK); + error = linux_copyin(ptr, retval, len); + if (error != 0) { + free(retval, M_KMALLOC); + return (ERR_PTR(error)); + } + retval[len] = '\0'; + return (retval); +} + +static inline void * kmemdup(const void *src, size_t len, gfp_t gfp) { void *dst; From owner-svn-src-all@freebsd.org Fri Feb 16 16:01:40 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1506BF208F9; Fri, 16 Feb 2018 16:01:40 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BB51882A05; Fri, 16 Feb 2018 16:01:39 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B66E37DC8; Fri, 16 Feb 2018 16:01:39 +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 w1GG1dU3072607; Fri, 16 Feb 2018 16:01:39 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1GG1dhx072606; Fri, 16 Feb 2018 16:01:39 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201802161601.w1GG1dhx072606@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 16 Feb 2018 16:01:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329378 - head/sys/compat/linuxkpi/common/include/linux X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 329378 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Feb 2018 16:01:40 -0000 Author: hselasky Date: Fri Feb 16 16:01:39 2018 New Revision: 329378 URL: https://svnweb.freebsd.org/changeset/base/329378 Log: Implement mutex_trylock_recursive() in the LinuxKPI. MFC after: 1 week Submitted by: Johannes Lundberg Sponsored by: Mellanox Technologies Modified: head/sys/compat/linuxkpi/common/include/linux/mutex.h Modified: head/sys/compat/linuxkpi/common/include/linux/mutex.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/mutex.h Fri Feb 16 15:52:28 2018 (r329377) +++ head/sys/compat/linuxkpi/common/include/linux/mutex.h Fri Feb 16 16:01:39 2018 (r329378) @@ -77,6 +77,21 @@ typedef struct mutex { !!sx_try_xlock(&(_m)->sx); \ }) +enum mutex_trylock_recursive_enum { + MUTEX_TRYLOCK_FAILED = 0, + MUTEX_TRYLOCK_SUCCESS = 1, + MUTEX_TRYLOCK_RECURSIVE = 2, +}; + +static inline __must_check enum mutex_trylock_recursive_enum +mutex_trylock_recursive(struct mutex *lock) +{ + if (unlikely(sx_xholder(&lock->sx) == curthread)) + return (MUTEX_TRYLOCK_RECURSIVE); + + return (mutex_trylock(lock)); +} + #define mutex_init(_m) \ linux_mutex_init(_m, mutex_name(#_m), SX_NOWITNESS) From owner-svn-src-all@freebsd.org Fri Feb 16 16:05:03 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F407BF20DBF; Fri, 16 Feb 2018 16:05:02 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A5F3082DFB; Fri, 16 Feb 2018 16:05: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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A09597E0D; Fri, 16 Feb 2018 16:05: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 w1GG526v076411; Fri, 16 Feb 2018 16:05:02 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1GG527J076410; Fri, 16 Feb 2018 16:05:02 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201802161605.w1GG527J076410@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Fri, 16 Feb 2018 16:05:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r329379 - stable/11/sys/kern X-SVN-Group: stable-11 X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: stable/11/sys/kern X-SVN-Commit-Revision: 329379 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Feb 2018 16:05:03 -0000 Author: mjg Date: Fri Feb 16 16:05:02 2018 New Revision: 329379 URL: https://svnweb.freebsd.org/changeset/base/329379 Log: MFC r327874: vfs: tidy up vdrop Skip vfs_refcount_release_if_not_last if the interlock is held and just go straight to refcount_release. While here do cosmetic rearrangement of _vhold to better show it contains equivalent behaviour. Modified: stable/11/sys/kern/vfs_subr.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/kern/vfs_subr.c ============================================================================== --- stable/11/sys/kern/vfs_subr.c Fri Feb 16 16:01:39 2018 (r329378) +++ stable/11/sys/kern/vfs_subr.c Fri Feb 16 16:05:02 2018 (r329379) @@ -2769,14 +2769,14 @@ _vhold(struct vnode *vp, bool locked) else ASSERT_VI_UNLOCKED(vp, __func__); CTR2(KTR_VFS, "%s: vp %p", __func__, vp); - if (!locked && vfs_refcount_acquire_if_not_zero(&vp->v_holdcnt)) { - VNASSERT((vp->v_iflag & VI_FREE) == 0, vp, - ("_vhold: vnode with holdcnt is free")); - return; - } - - if (!locked) + if (!locked) { + if (vfs_refcount_acquire_if_not_zero(&vp->v_holdcnt)) { + VNASSERT((vp->v_iflag & VI_FREE) == 0, vp, + ("_vhold: vnode with holdcnt is free")); + return; + } VI_LOCK(vp); + } if ((vp->v_iflag & VI_FREE) == 0) { refcount_acquire(&vp->v_holdcnt); if (!locked) @@ -2830,14 +2830,11 @@ _vdrop(struct vnode *vp, bool locked) CTR2(KTR_VFS, "%s: vp %p", __func__, vp); if ((int)vp->v_holdcnt <= 0) panic("vdrop: holdcnt %d", vp->v_holdcnt); - if (vfs_refcount_release_if_not_last(&vp->v_holdcnt)) { - if (locked) - VI_UNLOCK(vp); - return; - } - - if (!locked) + if (!locked) { + if (vfs_refcount_release_if_not_last(&vp->v_holdcnt)) + return; VI_LOCK(vp); + } if (refcount_release(&vp->v_holdcnt) == 0) { VI_UNLOCK(vp); return; From owner-svn-src-all@freebsd.org Fri Feb 16 16:07:59 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3AA6DF210FD; Fri, 16 Feb 2018 16:07:59 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E01F18301C; Fri, 16 Feb 2018 16:07:58 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C0ABD7E11; Fri, 16 Feb 2018 16:07:58 +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 w1GG7w2R076567; Fri, 16 Feb 2018 16:07:58 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1GG7wRo076564; Fri, 16 Feb 2018 16:07:58 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201802161607.w1GG7wRo076564@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Fri, 16 Feb 2018 16:07:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r329380 - stable/11/sys/kern X-SVN-Group: stable-11 X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: stable/11/sys/kern X-SVN-Commit-Revision: 329380 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Feb 2018 16:07:59 -0000 Author: mjg Date: Fri Feb 16 16:07:58 2018 New Revision: 329380 URL: https://svnweb.freebsd.org/changeset/base/329380 Log: MFC r327875,r327905,r327914: mtx: use fcmpset to cover setting MTX_CONTESTED === rwlock: try regular read unlock even in the hard path Saves on turnstile trips if the lock got more readers. === sx: retry hard shared unlock just like in r327905 for rwlocks Modified: stable/11/sys/kern/kern_mutex.c stable/11/sys/kern/kern_rwlock.c stable/11/sys/kern/kern_sx.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/kern/kern_mutex.c ============================================================================== --- stable/11/sys/kern/kern_mutex.c Fri Feb 16 16:05:02 2018 (r329379) +++ stable/11/sys/kern/kern_mutex.c Fri Feb 16 16:07:58 2018 (r329380) @@ -576,6 +576,7 @@ __mtx_lock_sleep(volatile uintptr_t *c, uintptr_t v) ts = turnstile_trywait(&m->lock_object); v = MTX_READ_VALUE(m); +retry_turnstile: /* * Check if the lock has been released while spinning for @@ -607,10 +608,8 @@ __mtx_lock_sleep(volatile uintptr_t *c, uintptr_t v) * or the state of the MTX_RECURSED bit changed. */ if ((v & MTX_CONTESTED) == 0 && - !atomic_cmpset_ptr(&m->mtx_lock, v, v | MTX_CONTESTED)) { - turnstile_cancel(ts); - v = MTX_READ_VALUE(m); - continue; + !atomic_fcmpset_ptr(&m->mtx_lock, &v, v | MTX_CONTESTED)) { + goto retry_turnstile; } /* Modified: stable/11/sys/kern/kern_rwlock.c ============================================================================== --- stable/11/sys/kern/kern_rwlock.c Fri Feb 16 16:05:02 2018 (r329379) +++ stable/11/sys/kern/kern_rwlock.c Fri Feb 16 16:07:58 2018 (r329380) @@ -769,9 +769,9 @@ __rw_runlock_hard(struct rwlock *rw, struct thread *td turnstile_chain_lock(&rw->lock_object); v = RW_READ_VALUE(rw); retry_ts: - if (__predict_false(RW_READERS(v) > 1)) { + if (__rw_runlock_try(rw, td, &v)) { turnstile_chain_unlock(&rw->lock_object); - continue; + break; } v &= (RW_LOCK_WAITERS | RW_LOCK_WRITE_SPINNER); Modified: stable/11/sys/kern/kern_sx.c ============================================================================== --- stable/11/sys/kern/kern_sx.c Fri Feb 16 16:05:02 2018 (r329379) +++ stable/11/sys/kern/kern_sx.c Fri Feb 16 16:07:58 2018 (r329380) @@ -1191,7 +1191,7 @@ _sx_sunlock_try(struct sx *sx, uintptr_t *xp) static void __noinline _sx_sunlock_hard(struct sx *sx, uintptr_t x LOCK_FILE_LINE_ARG_DEF) { - int wakeup_swapper; + int wakeup_swapper = 0; uintptr_t setx; if (SCHEDULER_STOPPED()) @@ -1211,6 +1211,9 @@ _sx_sunlock_hard(struct sx *sx, uintptr_t x LOCK_FILE_ for (;;) { MPASS(x & SX_LOCK_EXCLUSIVE_WAITERS); MPASS(!(x & SX_LOCK_SHARED_WAITERS)); + if (_sx_sunlock_try(sx, &x)) + break; + /* * Wake up semantic here is quite simple: * Just wake up all the exclusive waiters. From owner-svn-src-all@freebsd.org Fri Feb 16 16:16:34 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 39202F21B20; Fri, 16 Feb 2018 16:16:34 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DE42983644; Fri, 16 Feb 2018 16:16:33 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D8D737FA2; Fri, 16 Feb 2018 16:16:33 +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 w1GGGXOT081843; Fri, 16 Feb 2018 16:16:33 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1GGGX23081840; Fri, 16 Feb 2018 16:16:33 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201802161616.w1GGGX23081840@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Fri, 16 Feb 2018 16:16:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r329381 - in stable/11/sys: sys vm X-SVN-Group: stable-11 X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: in stable/11/sys: sys vm X-SVN-Commit-Revision: 329381 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Feb 2018 16:16:34 -0000 Author: mjg Date: Fri Feb 16 16:16:33 2018 New Revision: 329381 URL: https://svnweb.freebsd.org/changeset/base/329381 Log: MFC r324610: Reduce traffic on vm_cnt.v_free_count The variable is modified with the highly contended page free queue lock. It unnecessarily shares a cacheline with purely read-only fields and is re-read after the lock is dropped in the page allocation code making the hold time longer. Pad the variable just like the others and store the value as found with the lock held instead of re-reading. Provides a modest 1%-ish speed up in concurrent page faults. Due to KBI constraints the field is not moved in this commit, only re-read is avoided. Modified: stable/11/sys/sys/vmmeter.h stable/11/sys/vm/vm_page.c stable/11/sys/vm/vm_phys.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/sys/vmmeter.h ============================================================================== --- stable/11/sys/sys/vmmeter.h Fri Feb 16 16:07:58 2018 (r329380) +++ stable/11/sys/sys/vmmeter.h Fri Feb 16 16:16:33 2018 (r329381) @@ -175,10 +175,10 @@ vm_paging_target(void) * Returns TRUE if the pagedaemon needs to be woken up. */ static inline int -vm_paging_needed(void) +vm_paging_needed(u_int free_count) { - return (vm_cnt.v_free_count < vm_pageout_wakeup_thresh); + return (free_count < vm_pageout_wakeup_thresh); } /* Modified: stable/11/sys/vm/vm_page.c ============================================================================== --- stable/11/sys/vm/vm_page.c Fri Feb 16 16:07:58 2018 (r329380) +++ stable/11/sys/vm/vm_page.c Fri Feb 16 16:16:33 2018 (r329381) @@ -1601,6 +1601,7 @@ vm_page_alloc_after(vm_object_t object, vm_pindex_t pi { vm_page_t m; int flags, req_class; + u_int free_count; KASSERT((object != NULL) == ((req & VM_ALLOC_NOOBJ) == 0) && (object != NULL || (req & VM_ALLOC_SBUSY) == 0) && @@ -1672,7 +1673,7 @@ again: * At this point we had better have found a good page. */ KASSERT(m != NULL, ("missing page")); - vm_phys_freecnt_adj(m, -1); + free_count = vm_phys_freecnt_adj(m, -1); if ((m->flags & PG_ZERO) != 0) vm_page_zero_count--; mtx_unlock(&vm_page_queue_free_mtx); @@ -1737,7 +1738,7 @@ again: * Don't wakeup too often - wakeup the pageout daemon when * we would be nearly out of memory. */ - if (vm_paging_needed()) + if (vm_paging_needed(free_count)) pagedaemon_wakeup(); return (m); @@ -1933,7 +1934,7 @@ retry: pmap_page_set_memattr(m, memattr); pindex++; } - if (vm_paging_needed()) + if (vm_paging_needed(vm_cnt.v_free_count)) pagedaemon_wakeup(); return (m_ret); } @@ -1982,7 +1983,7 @@ vm_page_t vm_page_alloc_freelist(int flind, int req) { vm_page_t m; - u_int flags; + u_int flags, free_count; int req_class; req_class = req & VM_ALLOC_CLASS_MASK; @@ -2013,7 +2014,7 @@ again: mtx_unlock(&vm_page_queue_free_mtx); return (NULL); } - vm_phys_freecnt_adj(m, -1); + free_count = vm_phys_freecnt_adj(m, -1); if ((m->flags & PG_ZERO) != 0) vm_page_zero_count--; mtx_unlock(&vm_page_queue_free_mtx); @@ -2037,7 +2038,7 @@ again: } /* Unmanaged pages don't use "act_count". */ m->oflags = VPO_UNMANAGED; - if (vm_paging_needed()) + if (vm_paging_needed(free_count)) pagedaemon_wakeup(); return (m); } Modified: stable/11/sys/vm/vm_phys.h ============================================================================== --- stable/11/sys/vm/vm_phys.h Fri Feb 16 16:07:58 2018 (r329380) +++ stable/11/sys/vm/vm_phys.h Fri Feb 16 16:16:33 2018 (r329381) @@ -112,13 +112,13 @@ vm_phys_domain(vm_page_t m) #endif } -static inline void +static inline u_int vm_phys_freecnt_adj(vm_page_t m, int adj) { mtx_assert(&vm_page_queue_free_mtx, MA_OWNED); - vm_cnt.v_free_count += adj; vm_phys_domain(m)->vmd_free_count += adj; + return (vm_cnt.v_free_count += adj); } #endif /* _KERNEL */ From owner-svn-src-all@freebsd.org Fri Feb 16 16:22:55 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A1F89F2228D; Fri, 16 Feb 2018 16:22:55 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5195F83BB8; Fri, 16 Feb 2018 16:22:55 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4C27A1013C; Fri, 16 Feb 2018 16:22:55 +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 w1GGMthj086460; Fri, 16 Feb 2018 16:22:55 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1GGMtEj086459; Fri, 16 Feb 2018 16:22:55 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201802161622.w1GGMtEj086459@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Fri, 16 Feb 2018 16:22:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329382 - head/release/arm64 X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: head/release/arm64 X-SVN-Commit-Revision: 329382 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Feb 2018 16:22:55 -0000 Author: andrew Date: Fri Feb 16 16:22:54 2018 New Revision: 329382 URL: https://svnweb.freebsd.org/changeset/base/329382 Log: Put the pine64 root filesystem on teh correct partition. The Pine64 root filesystem was incorrectly created directly on the MBR partition. This can cause the loader to get confused when loading the kernel from this filesystem. The loader will see this as a small partition meaning later checks to ensure it doesn't read past the end of the disk incorrectly report a failure. This seems to work mostly by accident with the released images as they are smaller than the reported size, however after growfs has run the image may no longer boot. Reviewed by: gjb, emaste, imp Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D14343 Modified: head/release/arm64/PINE64.conf Modified: head/release/arm64/PINE64.conf ============================================================================== --- head/release/arm64/PINE64.conf Fri Feb 16 16:16:33 2018 (r329381) +++ head/release/arm64/PINE64.conf Fri Feb 16 16:22:54 2018 (r329382) @@ -11,7 +11,7 @@ FAT_SIZE="54m -b 1m" FAT_TYPE="16" IMAGE_SIZE="2560M" KERNEL="GENERIC" -MD_ARGS="-x 16384 -y 255" +MD_ARGS="-x 63 -y 255" NODOC=1 PART_SCHEME="MBR" export BOARDNAME="PINE64" @@ -25,7 +25,7 @@ arm_install_uboot() { of=/dev/${mddev} bs=1k seek=8 conv=sync chroot ${CHROOTDIR} mkdir -p "${FATMOUNT}" "${UFSMOUNT}" chroot ${CHROOTDIR} mount_msdosfs /dev/${mddev}s1 ${FATMOUNT} - chroot ${CHROOTDIR} mount /dev/${mddev}s2 ${UFSMOUNT} + chroot ${CHROOTDIR} mount /dev/${mddev}s2a ${UFSMOUNT} BOOTFILES="$(chroot ${CHROOTDIR} \ env TARGET=${EMBEDDED_TARGET} TARGET_ARCH=${EMBEDDED_TARGET_ARCH} \ From owner-svn-src-all@freebsd.org Fri Feb 16 16:37:39 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2CE9BF2321F for ; Fri, 16 Feb 2018 16:37:39 +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 AC53F8447B for ; Fri, 16 Feb 2018 16:37:38 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-it0-x229.google.com with SMTP id 193so2447382iti.1 for ; Fri, 16 Feb 2018 08:37:38 -0800 (PST) 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=IAS4hNilnPgjonYhMZABZ/Bvn369ymYEN3iJhTjkIvA=; b=y4Bn5T1RH2T5HGPLqfEulD3OtDthzOOl81/DQ7YKVQoZtkp0YK+1d6ND9N/Tg/k66s iXiPJ5s2Ql6ukxu2BSvIRa4RxRQDaYn+cZ3DWXR+BhJYaS5aD40VoOGKDunzaX6+v6zj QKh7y5g2PrTZHqGczno0IJ70QS+MZLpvinUn3JPOyd5bJvvdc1i+ZkXkKZeaVCba38YW AY8z1BtyQESqO6lQOnELgVNhs2sd2fN6sY9rnP3bcPC7CAOkUzE28Fd2Np37QGfkjxAp Uc372Z4Kathcbsgikur+6F1u5KL/4nFpc9onxIL1jb6hSXdVexRzukIghRtdYbIsfrq+ /fJQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=IAS4hNilnPgjonYhMZABZ/Bvn369ymYEN3iJhTjkIvA=; b=kbdpGZuRpyhTosPsO2BqEmfIqFKPq6y3mD3hIx3VoGJWkFhLXzBy5pI3x1uUzvtILI wnY6gqetvbr1Uch4hItnDxbNst2AVvvtJvsmwLTNdpx5TG59tCyhssB758TEwbcMJSTl oTjVrlFx4Hv4E6SMUXWiwlev0bEdvbX9wnZQDD5MCAV+HbVhRT2BpeodfKoWF3jMXVwQ pxa3LIV0bV+G66mboGrmO/Tws+mcx/qRmvdzibfy1C8dqICHhBfNEhCzsd9yZcA9KdbE ZJvYsKY66guok+5uVmsuUglv1x+ZWbGyOvnsL7sEYRIx3cGwxgdlOboGxnBL8fg3amoH Oz3g== X-Gm-Message-State: APf1xPAvt1j8pXrLTNxLCPowfzNx2b8W2r/NYsZyn1u+qj+YjQhH0b7M xbN0aqGLMkzc8wAxMlI/8beG44vaYjyYUO5g/uklzQ== X-Google-Smtp-Source: AH8x227btpQZvFvT6spPG1h9AAdhIQRDFFEwhGNnJi61PFnV4htUKx0eMbRjtKF5IfdN/4eBntSqqoNzbwYxdUlON58= X-Received: by 10.36.201.66 with SMTP id h63mr6572248itg.36.1518799057999; Fri, 16 Feb 2018 08:37:37 -0800 (PST) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.201.67 with HTTP; Fri, 16 Feb 2018 08:37:37 -0800 (PST) X-Originating-IP: [50.253.99.174] In-Reply-To: References: <201802160312.w1G3CO3r085739@repo.freebsd.org> From: Warner Losh Date: Fri, 16 Feb 2018 09:37:37 -0700 X-Google-Sender-Auth: C7x2lwvvtYTVkghKhJLE6gNzFFE Message-ID: Subject: Re: svn commit: r329349 - head/stand/lua To: Kyle Evans Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.25 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Feb 2018 16:37:39 -0000 On Feb 16, 2018 6:58 AM, "Kyle Evans" wrote: On Thu, Feb 15, 2018 at 9:12 PM, Kyle Evans wrote: > Author: kevans > Date: Fri Feb 16 03:12:24 2018 > New Revision: 329349 > URL: https://svnweb.freebsd.org/changeset/base/329349 > > Log: > stand/lua: Reduce magic numbers > > Enter/backspace values are hardcoded in both the menu and password scripts. > Separate these out to core for reuse between the two. > > Modified: > head/stand/lua/core.lua > head/stand/lua/menu.lua > head/stand/lua/password.lua > > Modified: head/stand/lua/core.lua > ============================================================ ================== > --- head/stand/lua/core.lua Fri Feb 16 01:33:01 2018 (r329348) > +++ head/stand/lua/core.lua Fri Feb 16 03:12:24 2018 (r329349) > @@ -28,6 +28,10 @@ > > local core = {}; > > +-- Commonly appearing constants > +core.KEY_ENTER = 13 > +core.KEY_BACKSPACE = 127 > + > function core.setVerbose(b) > if (b == nil) then > b = not core.verbose; > > Modified: head/stand/lua/menu.lua > ============================================================ ================== > --- head/stand/lua/menu.lua Fri Feb 16 01:33:01 2018 (r329348) > +++ head/stand/lua/menu.lua Fri Feb 16 03:12:24 2018 (r329349) > @@ -273,9 +273,9 @@ function menu.run(m) > local key = io.getchar(); > > -- Special key behaviors > - if (key == 127) and (m ~= menu.welcome) then > + if (key == core.KEY_BACKSPACE) and (m ~= menu.welcome) then > break > - elseif (key == 13) then > + elseif (key == core.KEY_ENTER) then > core.boot(); > -- Should not return > end > @@ -357,7 +357,7 @@ function menu.autoboot() > screen.defcursor(); > if io.ischar() then > local ch = io.getchar(); > - if ch == 13 then > + if ch == core.KEY_ENTER then > break; > else > -- prevent autoboot when escaping to interpreter > > Modified: head/stand/lua/password.lua > ============================================================ ================== > --- head/stand/lua/password.lua Fri Feb 16 01:33:01 2018 (r329348) > +++ head/stand/lua/password.lua Fri Feb 16 03:12:24 2018 (r329349) > @@ -37,11 +37,11 @@ function password.read() > > repeat > ch = io.getchar(); > - if ch == 13 then > + if ch == core.KEY_ENTER then > break; > end > > - if ch == 8 then > + if ch == core.KEY_BACKSPACE then It's worth noting that this changes the comparison from 'ch == 8' to 'ch == 127'. The password prompt was non-functional on my test systems until this change, because I can never type my password right the first time. =) Pointed out by: cem@ History has shown we likely want to accept both BS (8) and DEL (127) as logical 'backwards erase character' signals. Warner From owner-svn-src-all@freebsd.org Fri Feb 16 16:38:49 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9BED2F2346F; Fri, 16 Feb 2018 16:38:49 +0000 (UTC) (envelope-from asomers@gmail.com) Received: from mail-lf0-x230.google.com (mail-lf0-x230.google.com [IPv6:2a00:1450:4010:c07::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 739D584640; Fri, 16 Feb 2018 16:38:48 +0000 (UTC) (envelope-from asomers@gmail.com) Received: by mail-lf0-x230.google.com with SMTP id f136so4824214lff.8; Fri, 16 Feb 2018 08:38:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=9papF+cGJvCk+mNDp5UJdF2GIVU8zFxYGnfOQbNSEJI=; b=lK1g3DjgSargBW1ZgENZKTh3XUhKNzoN/n/RqGn844xT7p095eCbeiFbfovQ/GSBUK YnKU/AyBU27WLPiRAYRKLoIi9D+QDZ7IJO6mQLWi0VVbFReDhNDP3cfWIGhVLL+20HoH uOOuIVNbW3YkpBmPox7nKT9LGZKC4V2Dt7cdrtecm0TfYoNff7Jyu1f22mgEReBBJP7B TtwpTDvI08L6PsPk/Seoq54Civ2i8CQXtoqQRolaXLEFIx9E6jar2tyB/j0nDJM0MfGN UkiF6D8tcfsXaW2v9tdzRF0//+dH34KOH6wJBgb5+tQuGhDCjbbcUY3oP8Ib6NHmINQx pMtg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=9papF+cGJvCk+mNDp5UJdF2GIVU8zFxYGnfOQbNSEJI=; b=DMSTWEzErSAxULQ3q7eTP7Cfsi8usTl+0CKhm7OPSJYQCWCn8emGJcDJctoAapXNso BsdQQOaaaIPtBF6gdPY+WXvbNO3v55go4xWBIRNQbdZHulOMyP1ryfCdg4VhNfsS4Te7 7C5wgvfSK9jCTPXOkRGvX3iienRTa+6YNMSlijRifZeRcCXWjykGMmmk/H6oDavGWv8q LSycPGQrqeyxlOQ4wouX5S6Z10L8aZnKsW5dUyNOO6d5MUnJHwe+xG5dDH6uUXJhVyf0 9RkvpIJ8KfiRu/v0y1l0zuK8+zkGhYPGyJ5Sb7ipwLOdopgalMNyiuh0oo4/p6sZSb4K dVKQ== X-Gm-Message-State: APf1xPB2LNF1dw8BkQtwDcLYtt1/oCXb8MjxYst7BqbUTVp2f4JqbR6G V/529YWuwgElHWE++urjdmiw2qW6b1Fa3zV/pYY= X-Google-Smtp-Source: AH8x2263kdJ0ie0gY53oD7YXFTIsomZFiMAIUZw5aCTSC5rEkvJVSjg7fZWCfv8QFIvDIwMR6klfmy1pHlkpwYHeTkU= X-Received: by 10.46.77.197 with SMTP id c66mr1278378ljd.116.1518799126576; Fri, 16 Feb 2018 08:38:46 -0800 (PST) MIME-Version: 1.0 Sender: asomers@gmail.com Received: by 10.179.30.35 with HTTP; Fri, 16 Feb 2018 08:38:45 -0800 (PST) In-Reply-To: <3148002.4yJvN52HMT@ralph.baldwin.cx> References: <201802141549.w1EFnVBV064848@repo.freebsd.org> <3148002.4yJvN52HMT@ralph.baldwin.cx> From: Alan Somers Date: Fri, 16 Feb 2018 09:38:45 -0700 X-Google-Sender-Auth: N-Ysu6lUti1XxtKG-9LzclcHh3s Message-ID: Subject: Re: svn commit: r329265 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs To: John Baldwin Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.25 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Feb 2018 16:38:49 -0000 On Thu, Feb 15, 2018 at 12:18 PM, John Baldwin wrote: > On Wednesday, February 14, 2018 03:49:31 PM Alan Somers wrote: > > Author: asomers > > Date: Wed Feb 14 15:49:31 2018 > > New Revision: 329265 > > URL: https://svnweb.freebsd.org/changeset/base/329265 > > > > Log: > > Implement .vop_pathconf and .vop_getacl for the .zfs ctldir > > > > zfsctl_common_pathconf will report all the same variables that regular > ZFS > > volumes report. zfsctl_common_getacl will report an ACL equivalent to > 555, > > except that you can't read xattrs or edit attributes. > > > > Fixes a bug where "ls .zfs" will occasionally print something like: > > ls: .zfs/.: Operation not supported > > > > PR: 225793 > > Reviewed by: avg > > MFC after: 3 weeks > > Sponsored by: Spectra Logic Corp > > Differential Revision: https://reviews.freebsd.org/D14365 > > > > Modified: > > head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c > > > > Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/ > zfs_ctldir.c > > ============================================================ > ================== > > --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c > Wed Feb 14 15:40:13 2018 (r329264) > > +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c > Wed Feb 14 15:49:31 2018 (r329265) > > @@ -80,6 +80,10 @@ > > > > #include "zfs_namecheck.h" > > > > +/* Common access mode for all virtual directories under the ctldir */ > > +const u_short zfsctl_ctldir_mode = S_IRUSR | S_IXUSR | S_IRGRP | > S_IXGRP | > > + S_IROTH | S_IXOTH; > > + > > /* > > * "Synthetic" filesystem implementation. > > */ > > @@ -496,8 +500,7 @@ zfsctl_common_getattr(vnode_t *vp, vattr_t *vap) > > vap->va_nblocks = 0; > > vap->va_seq = 0; > > vn_fsid(vp, vap); > > - vap->va_mode = S_IRUSR | S_IXUSR | S_IRGRP | S_IXGRP | > > - S_IROTH | S_IXOTH; > > + vap->va_mode = zfsctl_ctldir_mode; > > vap->va_type = VDIR; > > /* > > * We live in the now (for atime). > > @@ -724,6 +727,87 @@ zfsctl_root_vptocnp(struct vop_vptocnp_args *ap) > > return (0); > > } > > > > +static int > > +zfsctl_common_pathconf(ap) > > + struct vop_pathconf_args /* { > > + struct vnode *a_vp; > > + int a_name; > > + int *a_retval; > > + } */ *ap; > > +{ > > + /* > > + * We care about ACL variables so that user land utilities like ls > > + * can display them correctly. Since the ctldir's st_dev is set > to be > > + * the same as the parent dataset, we must support all variables > that > > + * it supports. > > + */ > > + switch (ap->a_name) { > > + case _PC_LINK_MAX: > > + *ap->a_retval = INT_MAX; > > + return (0); > > On HEAD this should probably match the existing ZFS pathconf > (min(LONG_MAX, ZFS_LINK_MAX IIRC), though if these directories can only > ever have a link count of 2 (which seems true from zfsctl_common_getattr()) > then it would be fine to return '2' here instead. For stable you'd have to > restrict it to LINK_MAX if you don't use '2'. > > Also, you should call vfs_stdpathconf() in the default: case. > > -- > John Baldwin > All good points. I don't think a max link count of 2 is correct, though, because the real link count can be higher than that. See zfsctl_root_getattr and zfsctl_snapdir_getattr. I'll set it the way that zfs_pathconf does. Also, it looks like I need to add _PC_NAME_MAX. -Alan From owner-svn-src-all@freebsd.org Fri Feb 16 16:41:20 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 55155F239ED; Fri, 16 Feb 2018 16:41:20 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0751E84A2C; Fri, 16 Feb 2018 16:41:20 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DC0EC1042F; Fri, 16 Feb 2018 16:41:19 +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 w1GGfJo3091776; Fri, 16 Feb 2018 16:41:19 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1GGfJFr091773; Fri, 16 Feb 2018 16:41:19 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201802161641.w1GGfJFr091773@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Fri, 16 Feb 2018 16:41:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r329383 - in stable/11: share/man/man9 sys/amd64/include sys/i386/include X-SVN-Group: stable-11 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in stable/11: share/man/man9 sys/amd64/include sys/i386/include X-SVN-Commit-Revision: 329383 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Feb 2018 16:41:20 -0000 Author: markj Date: Fri Feb 16 16:41:19 2018 New Revision: 329383 URL: https://svnweb.freebsd.org/changeset/base/329383 Log: MFC r315718, r316031: Add support for 8- and 16-bit atomic_(f)cmpset to x86. Modified: stable/11/share/man/man9/atomic.9 stable/11/sys/amd64/include/atomic.h stable/11/sys/i386/include/atomic.h Directory Properties: stable/11/ (props changed) Modified: stable/11/share/man/man9/atomic.9 ============================================================================== --- stable/11/share/man/man9/atomic.9 Fri Feb 16 16:22:54 2018 (r329382) +++ stable/11/share/man/man9/atomic.9 Fri Feb 16 16:41:19 2018 (r329383) @@ -328,9 +328,9 @@ if (*dst == old) { .Ed .El .Pp -The +Some architectures do not implement the .Fn atomic_cmpset -functions are not implemented for the types +functions for the types .Dq Li char , .Dq Li short , .Dq Li 8 , @@ -367,9 +367,9 @@ function also returns despite .Dl *old == *dst . .Pp -The +Some architectures do not implement the .Fn atomic_fcmpset -functions are not implemented for the types +functions for the types .Dq Li char , .Dq Li short , .Dq Li 8 , Modified: stable/11/sys/amd64/include/atomic.h ============================================================================== --- stable/11/sys/amd64/include/atomic.h Fri Feb 16 16:22:54 2018 (r329382) +++ stable/11/sys/amd64/include/atomic.h Fri Feb 16 16:41:19 2018 (r329383) @@ -99,8 +99,13 @@ void atomic_##NAME##_##TYPE(volatile u_##TYPE *p, u_##TYPE v); \ void atomic_##NAME##_barr_##TYPE(volatile u_##TYPE *p, u_##TYPE v) +int atomic_cmpset_char(volatile u_char *dst, u_char expect, u_char src); +int atomic_cmpset_short(volatile u_short *dst, u_short expect, u_short src); int atomic_cmpset_int(volatile u_int *dst, u_int expect, u_int src); int atomic_cmpset_long(volatile u_long *dst, u_long expect, u_long src); +int atomic_fcmpset_char(volatile u_char *dst, u_char *expect, u_char src); +int atomic_fcmpset_short(volatile u_short *dst, u_short *expect, + u_short src); int atomic_fcmpset_int(volatile u_int *dst, u_int *expect, u_int src); int atomic_fcmpset_long(volatile u_long *dst, u_long *expect, u_long src); u_int atomic_fetchadd_int(volatile u_int *p, u_int v); @@ -157,85 +162,62 @@ atomic_##NAME##_barr_##TYPE(volatile u_##TYPE *p, u_## struct __hack /* - * Atomic compare and set, used by the mutex functions + * Atomic compare and set, used by the mutex functions. * - * if (*dst == expect) *dst = src (all 32 bit words) + * cmpset: + * if (*dst == expect) + * *dst = src * - * Returns 0 on failure, non-zero on success + * fcmpset: + * if (*dst == *expect) + * *dst = src + * else + * *expect = *dst + * + * Returns 0 on failure, non-zero on success. */ - -static __inline int -atomic_cmpset_int(volatile u_int *dst, u_int expect, u_int src) -{ - u_char res; - - __asm __volatile( - " " MPLOCKED " " - " cmpxchgl %3,%1 ; " - " sete %0 ; " - "# atomic_cmpset_int" - : "=q" (res), /* 0 */ - "+m" (*dst), /* 1 */ - "+a" (expect) /* 2 */ - : "r" (src) /* 3 */ - : "memory", "cc"); - return (res); +#define ATOMIC_CMPSET(TYPE) \ +static __inline int \ +atomic_cmpset_##TYPE(volatile u_##TYPE *dst, u_##TYPE expect, u_##TYPE src) \ +{ \ + u_char res; \ + \ + __asm __volatile( \ + " " MPLOCKED " " \ + " cmpxchg %3,%1 ; " \ + " sete %0 ; " \ + "# atomic_cmpset_" #TYPE " " \ + : "=q" (res), /* 0 */ \ + "+m" (*dst), /* 1 */ \ + "+a" (expect) /* 2 */ \ + : "r" (src) /* 3 */ \ + : "memory", "cc"); \ + return (res); \ +} \ + \ +static __inline int \ +atomic_fcmpset_##TYPE(volatile u_##TYPE *dst, u_##TYPE *expect, u_##TYPE src) \ +{ \ + u_char res; \ + \ + __asm __volatile( \ + " " MPLOCKED " " \ + " cmpxchg %3,%1 ; " \ + " sete %0 ; " \ + "# atomic_fcmpset_" #TYPE " " \ + : "=q" (res), /* 0 */ \ + "+m" (*dst), /* 1 */ \ + "+a" (*expect) /* 2 */ \ + : "r" (src) /* 3 */ \ + : "memory", "cc"); \ + return (res); \ } -static __inline int -atomic_cmpset_long(volatile u_long *dst, u_long expect, u_long src) -{ - u_char res; +ATOMIC_CMPSET(char); +ATOMIC_CMPSET(short); +ATOMIC_CMPSET(int); +ATOMIC_CMPSET(long); - __asm __volatile( - " " MPLOCKED " " - " cmpxchgq %3,%1 ; " - " sete %0 ; " - "# atomic_cmpset_long" - : "=q" (res), /* 0 */ - "+m" (*dst), /* 1 */ - "+a" (expect) /* 2 */ - : "r" (src) /* 3 */ - : "memory", "cc"); - return (res); -} - -static __inline int -atomic_fcmpset_int(volatile u_int *dst, u_int *expect, u_int src) -{ - u_char res; - - __asm __volatile( - " " MPLOCKED " " - " cmpxchgl %3,%1 ; " - " sete %0 ; " - "# atomic_fcmpset_int" - : "=r" (res), /* 0 */ - "+m" (*dst), /* 1 */ - "+a" (*expect) /* 2 */ - : "r" (src) /* 3 */ - : "memory", "cc"); - return (res); -} - -static __inline int -atomic_fcmpset_long(volatile u_long *dst, u_long *expect, u_long src) -{ - u_char res; - - __asm __volatile( - " " MPLOCKED " " - " cmpxchgq %3,%1 ; " - " sete %0 ; " - "# atomic_fcmpset_long" - : "=r" (res), /* 0 */ - "+m" (*dst), /* 1 */ - "+a" (*expect) /* 2 */ - : "r" (src) /* 3 */ - : "memory", "cc"); - return (res); -} - /* * Atomically add the value of v to the integer pointed to by p and return * the previous value of *p. @@ -524,6 +506,10 @@ u_long atomic_swap_long(volatile u_long *p, u_long v); #define atomic_add_rel_char atomic_add_barr_char #define atomic_subtract_acq_char atomic_subtract_barr_char #define atomic_subtract_rel_char atomic_subtract_barr_char +#define atomic_cmpset_acq_char atomic_cmpset_char +#define atomic_cmpset_rel_char atomic_cmpset_char +#define atomic_fcmpset_acq_char atomic_fcmpset_char +#define atomic_fcmpset_rel_char atomic_fcmpset_char #define atomic_set_acq_short atomic_set_barr_short #define atomic_set_rel_short atomic_set_barr_short @@ -533,6 +519,10 @@ u_long atomic_swap_long(volatile u_long *p, u_long v); #define atomic_add_rel_short atomic_add_barr_short #define atomic_subtract_acq_short atomic_subtract_barr_short #define atomic_subtract_rel_short atomic_subtract_barr_short +#define atomic_cmpset_acq_short atomic_cmpset_short +#define atomic_cmpset_rel_short atomic_cmpset_short +#define atomic_fcmpset_acq_short atomic_fcmpset_short +#define atomic_fcmpset_rel_short atomic_fcmpset_short #define atomic_set_acq_int atomic_set_barr_int #define atomic_set_rel_int atomic_set_barr_int @@ -544,8 +534,8 @@ u_long atomic_swap_long(volatile u_long *p, u_long v); #define atomic_subtract_rel_int atomic_subtract_barr_int #define atomic_cmpset_acq_int atomic_cmpset_int #define atomic_cmpset_rel_int atomic_cmpset_int -#define atomic_fcmpset_acq_int atomic_fcmpset_int -#define atomic_fcmpset_rel_int atomic_fcmpset_int +#define atomic_fcmpset_acq_int atomic_fcmpset_int +#define atomic_fcmpset_rel_int atomic_fcmpset_int #define atomic_set_acq_long atomic_set_barr_long #define atomic_set_rel_long atomic_set_barr_long @@ -557,8 +547,8 @@ u_long atomic_swap_long(volatile u_long *p, u_long v); #define atomic_subtract_rel_long atomic_subtract_barr_long #define atomic_cmpset_acq_long atomic_cmpset_long #define atomic_cmpset_rel_long atomic_cmpset_long -#define atomic_fcmpset_acq_long atomic_fcmpset_long -#define atomic_fcmpset_rel_long atomic_fcmpset_long +#define atomic_fcmpset_acq_long atomic_fcmpset_long +#define atomic_fcmpset_rel_long atomic_fcmpset_long #define atomic_readandclear_int(p) atomic_swap_int(p, 0) #define atomic_readandclear_long(p) atomic_swap_long(p, 0) @@ -578,6 +568,12 @@ u_long atomic_swap_long(volatile u_long *p, u_long v); #define atomic_subtract_rel_8 atomic_subtract_rel_char #define atomic_load_acq_8 atomic_load_acq_char #define atomic_store_rel_8 atomic_store_rel_char +#define atomic_cmpset_8 atomic_cmpset_char +#define atomic_cmpset_acq_8 atomic_cmpset_acq_char +#define atomic_cmpset_rel_8 atomic_cmpset_rel_char +#define atomic_fcmpset_8 atomic_fcmpset_char +#define atomic_fcmpset_acq_8 atomic_fcmpset_acq_char +#define atomic_fcmpset_rel_8 atomic_fcmpset_rel_char /* Operations on 16-bit words. */ #define atomic_set_16 atomic_set_short @@ -594,6 +590,12 @@ u_long atomic_swap_long(volatile u_long *p, u_long v); #define atomic_subtract_rel_16 atomic_subtract_rel_short #define atomic_load_acq_16 atomic_load_acq_short #define atomic_store_rel_16 atomic_store_rel_short +#define atomic_cmpset_16 atomic_cmpset_short +#define atomic_cmpset_acq_16 atomic_cmpset_acq_short +#define atomic_cmpset_rel_16 atomic_cmpset_rel_short +#define atomic_fcmpset_16 atomic_fcmpset_short +#define atomic_fcmpset_acq_16 atomic_fcmpset_acq_short +#define atomic_fcmpset_rel_16 atomic_fcmpset_rel_short /* Operations on 32-bit double words. */ #define atomic_set_32 atomic_set_int Modified: stable/11/sys/i386/include/atomic.h ============================================================================== --- stable/11/sys/i386/include/atomic.h Fri Feb 16 16:22:54 2018 (r329382) +++ stable/11/sys/i386/include/atomic.h Fri Feb 16 16:41:19 2018 (r329383) @@ -107,7 +107,12 @@ __mbu(void) void atomic_##NAME##_##TYPE(volatile u_##TYPE *p, u_##TYPE v); \ void atomic_##NAME##_barr_##TYPE(volatile u_##TYPE *p, u_##TYPE v) +int atomic_cmpset_char(volatile u_char *dst, u_char expect, u_char src); +int atomic_cmpset_short(volatile u_short *dst, u_short expect, u_short src); int atomic_cmpset_int(volatile u_int *dst, u_int expect, u_int src); +int atomic_fcmpset_char(volatile u_char *dst, u_char *expect, u_char src); +int atomic_fcmpset_short(volatile u_short *dst, u_short *expect, + u_short src); int atomic_fcmpset_int(volatile u_int *dst, u_int *expect, u_int src); u_int atomic_fetchadd_int(volatile u_int *p, u_int v); int atomic_testandset_int(volatile u_int *p, u_int v); @@ -166,49 +171,61 @@ atomic_##NAME##_barr_##TYPE(volatile u_##TYPE *p, u_## struct __hack /* - * Atomic compare and set, used by the mutex functions + * Atomic compare and set, used by the mutex functions. * - * if (*dst == expect) *dst = src (all 32 bit words) + * cmpset: + * if (*dst == expect) + * *dst = src * - * Returns 0 on failure, non-zero on success + * fcmpset: + * if (*dst == *expect) + * *dst = src + * else + * *expect = *dst + * + * Returns 0 on failure, non-zero on success. */ - -static __inline int -atomic_cmpset_int(volatile u_int *dst, u_int expect, u_int src) -{ - u_char res; - - __asm __volatile( - " " MPLOCKED " " - " cmpxchgl %3,%1 ; " - " sete %0 ; " - "# atomic_cmpset_int" - : "=q" (res), /* 0 */ - "+m" (*dst), /* 1 */ - "+a" (expect) /* 2 */ - : "r" (src) /* 3 */ - : "memory", "cc"); - return (res); +#define ATOMIC_CMPSET(TYPE, CONS) \ +static __inline int \ +atomic_cmpset_##TYPE(volatile u_##TYPE *dst, u_##TYPE expect, u_##TYPE src) \ +{ \ + u_char res; \ + \ + __asm __volatile( \ + " " MPLOCKED " " \ + " cmpxchg %3,%1 ; " \ + " sete %0 ; " \ + "# atomic_cmpset_" #TYPE " " \ + : "=q" (res), /* 0 */ \ + "+m" (*dst), /* 1 */ \ + "+a" (expect) /* 2 */ \ + : CONS (src) /* 3 */ \ + : "memory", "cc"); \ + return (res); \ +} \ + \ +static __inline int \ +atomic_fcmpset_##TYPE(volatile u_##TYPE *dst, u_##TYPE *expect, u_##TYPE src) \ +{ \ + u_char res; \ + \ + __asm __volatile( \ + " " MPLOCKED " " \ + " cmpxchg %3,%1 ; " \ + " sete %0 ; " \ + "# atomic_fcmpset_" #TYPE " " \ + : "=q" (res), /* 0 */ \ + "+m" (*dst), /* 1 */ \ + "+a" (*expect) /* 2 */ \ + : CONS (src) /* 3 */ \ + : "memory", "cc"); \ + return (res); \ } -static __inline int -atomic_fcmpset_int(volatile u_int *dst, u_int *expect, u_int src) -{ - u_char res; +ATOMIC_CMPSET(char, "q"); +ATOMIC_CMPSET(short, "r"); +ATOMIC_CMPSET(int, "r"); - __asm __volatile( - " " MPLOCKED " " - " cmpxchgl %3,%1 ; " - " sete %0 ; " - "# atomic_cmpset_int" - : "=q" (res), /* 0 */ - "+m" (*dst), /* 1 */ - "+a" (*expect) /* 2 */ - : "r" (src) /* 3 */ - : "memory", "cc"); - return (res); -} - /* * Atomically add the value of v to the integer pointed to by p and return * the previous value of *p. @@ -668,6 +685,10 @@ u_long atomic_swap_long(volatile u_long *p, u_long v); #define atomic_add_rel_char atomic_add_barr_char #define atomic_subtract_acq_char atomic_subtract_barr_char #define atomic_subtract_rel_char atomic_subtract_barr_char +#define atomic_cmpset_acq_char atomic_cmpset_char +#define atomic_cmpset_rel_char atomic_cmpset_char +#define atomic_fcmpset_acq_char atomic_fcmpset_char +#define atomic_fcmpset_rel_char atomic_fcmpset_char #define atomic_set_acq_short atomic_set_barr_short #define atomic_set_rel_short atomic_set_barr_short @@ -677,6 +698,10 @@ u_long atomic_swap_long(volatile u_long *p, u_long v); #define atomic_add_rel_short atomic_add_barr_short #define atomic_subtract_acq_short atomic_subtract_barr_short #define atomic_subtract_rel_short atomic_subtract_barr_short +#define atomic_cmpset_acq_short atomic_cmpset_short +#define atomic_cmpset_rel_short atomic_cmpset_short +#define atomic_fcmpset_acq_short atomic_fcmpset_short +#define atomic_fcmpset_rel_short atomic_fcmpset_short #define atomic_set_acq_int atomic_set_barr_int #define atomic_set_rel_int atomic_set_barr_int @@ -722,6 +747,12 @@ u_long atomic_swap_long(volatile u_long *p, u_long v); #define atomic_subtract_rel_8 atomic_subtract_rel_char #define atomic_load_acq_8 atomic_load_acq_char #define atomic_store_rel_8 atomic_store_rel_char +#define atomic_cmpset_8 atomic_cmpset_char +#define atomic_cmpset_acq_8 atomic_cmpset_acq_char +#define atomic_cmpset_rel_8 atomic_cmpset_rel_char +#define atomic_fcmpset_8 atomic_fcmpset_char +#define atomic_fcmpset_acq_8 atomic_fcmpset_acq_char +#define atomic_fcmpset_rel_8 atomic_fcmpset_rel_char /* Operations on 16-bit words. */ #define atomic_set_16 atomic_set_short @@ -738,6 +769,12 @@ u_long atomic_swap_long(volatile u_long *p, u_long v); #define atomic_subtract_rel_16 atomic_subtract_rel_short #define atomic_load_acq_16 atomic_load_acq_short #define atomic_store_rel_16 atomic_store_rel_short +#define atomic_cmpset_16 atomic_cmpset_short +#define atomic_cmpset_acq_16 atomic_cmpset_acq_short +#define atomic_cmpset_rel_16 atomic_cmpset_rel_short +#define atomic_fcmpset_16 atomic_fcmpset_short +#define atomic_fcmpset_acq_16 atomic_fcmpset_acq_short +#define atomic_fcmpset_rel_16 atomic_fcmpset_rel_short /* Operations on 32-bit double words. */ #define atomic_set_32 atomic_set_int From owner-svn-src-all@freebsd.org Fri Feb 16 16:44:49 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8B403F23DC7; Fri, 16 Feb 2018 16:44:49 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-it0-x22d.google.com (mail-it0-x22d.google.com [IPv6:2607:f8b0:4001:c0b::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 1FA1084E8F; Fri, 16 Feb 2018 16:44:49 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by mail-it0-x22d.google.com with SMTP id d10so2528670itj.2; Fri, 16 Feb 2018 08:44:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=21b71FkJSNeKb2i/Hxhab5fUhTZTMTBoXfxqlN/A3NI=; b=NoGxtFjfEMVq7Yp0c9IZMKI0HIyR1QoMM8EUDylU6cFESeSsWw53H/a/cyI4wrjHHq 9ZACtOCQNtR6I9Puz738WnUF+nMqprETJHvWyz1AWbuivlzC6CSGPkDaL7XCwhPvdNwz cxGgeP2IX/kpKQbtWT0X+7kG5Vi7kwt3wTLBsXOOWfKQr3CXEkEQFoWrPWAUN6wH3XaN PJ82CQ/6ROui2f6IY77UXOSeVBymM067dCsKwu43NRiDChA+k5wk02ij72/drw1d4BVc y+bP9azlXLwmw/RW2nDJYCefo6I94hVhtaq7vqb9Q/Qlvt16WCZBpWSuh87EW5rBD1FA qKTA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=21b71FkJSNeKb2i/Hxhab5fUhTZTMTBoXfxqlN/A3NI=; b=q/mqbGuaqGp3gbDak3GrWCcYt727ZBcHhrpNHQlgJj1cWnLeQ8/JQQMQIKHU/f+pqW 1AwRSczzCO9n+ywOb4/nmjyreGLuYOqvc1Oj+LvWM5qbODVROeKC6vVpcloFQOc3CDFv chMsgKQfcuOxa3tVDB66hb4rLlVNGZO9pjzb71kn9w51nk8Tvro/ZtbBdd8t5sqfV+xl N40oHdzG/rSqiybkUAA8+p8nnokiB97Xoj+IaBnsnQYjSGMZIRhiBYOtP/0daULTP91f JjRhtXZY16pJK9iwCiQKL4+8NyCqch9sQHNdmlKFwl2fBFww/FlrA31b0cL/PbH+260t Lq3A== X-Gm-Message-State: APf1xPDx3Rqzj787caeWGzuy+tBhncU47hR0ors8kBwcF47/6FGNku0g MeZS1/GvHfLtZUu4/5s/fZDUvQ== X-Google-Smtp-Source: AH8x224ioOmoaEEn3oBKcTEHi1JnfJCoX+WHeYMLDMUVcB8AwCWVPAIbIQreSDj6s9FbelD1EG0iPg== X-Received: by 10.36.198.194 with SMTP id j185mr8933472itg.140.1518799488176; Fri, 16 Feb 2018 08:44:48 -0800 (PST) Received: from raichu (toroon0560w-lp130-01-174-88-76-226.dsl.bell.ca. [174.88.76.226]) by smtp.gmail.com with ESMTPSA id k204sm17617378iok.68.2018.02.16.08.44.46 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 16 Feb 2018 08:44:47 -0800 (PST) Sender: Mark Johnston Date: Fri, 16 Feb 2018 11:44:45 -0500 From: Mark Johnston To: Benno Rice Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r329269 - head/stand/i386/boot2 Message-ID: <20180216164445.GB55620@raichu> References: <201802141807.w1EI7Ror036078@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201802141807.w1EI7Ror036078@repo.freebsd.org> User-Agent: Mutt/1.9.3 (2018-01-21) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Feb 2018 16:44:49 -0000 On Wed, Feb 14, 2018 at 06:07:27PM +0000, Benno Rice wrote: > Author: benno > Date: Wed Feb 14 18:07:27 2018 > New Revision: 329269 > URL: https://svnweb.freebsd.org/changeset/base/329269 > > Log: > Reformat to come significantly closer to style(9). > > Reviewed by: imp, jhibbits > Differential Revision: https://reviews.freebsd.org/D14366 > > Modified: > head/stand/i386/boot2/boot2.c > > Modified: head/stand/i386/boot2/boot2.c > ============================================================================== > --- head/stand/i386/boot2/boot2.c Wed Feb 14 18:05:37 2018 (r329268) > +++ head/stand/i386/boot2/boot2.c Wed Feb 14 18:07:27 2018 (r329269) > [...] > #if SERIAL > - } else if (c == 'S') { > - j = 0; > - while ((unsigned int)(i = *arg++ - '0') <= 9) > - j = j * 10 + i; > - if (j > 0 && i == -'0') { > - comspeed = j; > - break; > - } > - /* Fall through to error below ('S' not in optstr[]). */ > + } else if (c == 'S') { > + j = 0; > + while (*arg <= '9') { > + i = (unsigned int)(*arg - '0'); > + j = j * 10 + i; > + arg++; > + } > + if (j > 0 && i == -'0') { > + comspeed = j; > + break; > + } The gcc build is failing now with a claim that "i" may be used uninitialized in the if-statement above. It looks like a bogus error though. From owner-svn-src-all@freebsd.org Fri Feb 16 16:56:10 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E959BF24A30; Fri, 16 Feb 2018 16:56:09 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9B911858DA; Fri, 16 Feb 2018 16:56:09 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 95FA610635; Fri, 16 Feb 2018 16:56:09 +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 w1GGu9Bb001828; Fri, 16 Feb 2018 16:56:09 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1GGu9VR001827; Fri, 16 Feb 2018 16:56:09 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201802161656.w1GGu9VR001827@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Fri, 16 Feb 2018 16:56:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329384 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Commit-Revision: 329384 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Feb 2018 16:56:10 -0000 Author: asomers Date: Fri Feb 16 16:56:09 2018 New Revision: 329384 URL: https://svnweb.freebsd.org/changeset/base/329384 Log: Handle generic pathconf attributes in the .zfs ctldir MFC instructions: change the value of _PC_LINK_MAX to INT_MAX Reported by: jhb MFC after: 19 days X-MFC-With: 329265 Sponsored by: Spectra Logic Corp Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c Fri Feb 16 16:41:19 2018 (r329383) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c Fri Feb 16 16:56:09 2018 (r329384) @@ -743,7 +743,7 @@ zfsctl_common_pathconf(ap) */ switch (ap->a_name) { case _PC_LINK_MAX: - *ap->a_retval = INT_MAX; + *ap->a_retval = MIN(LONG_MAX, ZFS_LINK_MAX); return (0); case _PC_FILESIZEBITS: @@ -766,8 +766,12 @@ zfsctl_common_pathconf(ap) *ap->a_retval = ACL_MAX_ENTRIES; return (0); + case _PC_NAME_MAX: + *ap->a_retval = NAME_MAX; + return (0); + default: - return (EINVAL); + return (vop_stdpathconf(ap)); } } From owner-svn-src-all@freebsd.org Fri Feb 16 17:42:39 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A7282F031D0; Fri, 16 Feb 2018 17:42:39 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5939887E9D; Fri, 16 Feb 2018 17:42:39 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5405610E6D; Fri, 16 Feb 2018 17:42:39 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1GHgdWU026933; Fri, 16 Feb 2018 17:42:39 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1GHgdDk026930; Fri, 16 Feb 2018 17:42:39 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201802161742.w1GHgdDk026930@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Fri, 16 Feb 2018 17:42:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329386 - head/stand/lua X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/stand/lua X-SVN-Commit-Revision: 329386 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Feb 2018 17:42:39 -0000 Author: kevans Date: Fri Feb 16 17:42:38 2018 New Revision: 329386 URL: https://svnweb.freebsd.org/changeset/base/329386 Log: stand/lua: Correct usage and acceptance of BACKSPACE/DELETE keys Modified: head/stand/lua/core.lua head/stand/lua/menu.lua head/stand/lua/password.lua Modified: head/stand/lua/core.lua ============================================================================== --- head/stand/lua/core.lua Fri Feb 16 17:08:42 2018 (r329385) +++ head/stand/lua/core.lua Fri Feb 16 17:42:38 2018 (r329386) @@ -29,8 +29,9 @@ local core = {}; -- Commonly appearing constants +core.KEY_BACKSPACE = 8; core.KEY_ENTER = 13; -core.KEY_BACKSPACE = 127; +core.KEY_DELETE = 127; core.KEYSTR_ESCAPE = "\027"; Modified: head/stand/lua/menu.lua ============================================================================== --- head/stand/lua/menu.lua Fri Feb 16 17:08:42 2018 (r329385) +++ head/stand/lua/menu.lua Fri Feb 16 17:42:38 2018 (r329386) @@ -266,7 +266,8 @@ function menu.run(m) local key = io.getchar(); -- Special key behaviors - if (key == core.KEY_BACKSPACE) and (m ~= menu.welcome) then + if ((key == core.KEY_BACKSPACE) or (key == core.KEY_DELETE)) and + (m ~= menu.welcome) then break elseif (key == core.KEY_ENTER) then core.boot(); Modified: head/stand/lua/password.lua ============================================================================== --- head/stand/lua/password.lua Fri Feb 16 17:08:42 2018 (r329385) +++ head/stand/lua/password.lua Fri Feb 16 17:42:38 2018 (r329386) @@ -41,7 +41,7 @@ function password.read() break; end - if ch == core.KEY_BACKSPACE then + if (ch == core.KEY_BACKSPACE) or (ch == core.KEY_DELETE) then if n > 0 then n = n - 1; -- loader.printc("\008 \008"); From owner-svn-src-all@freebsd.org Fri Feb 16 17:46:07 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DD804F0354A; Fri, 16 Feb 2018 17:46:07 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8F11B68130; Fri, 16 Feb 2018 17:46:07 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 89E2D10E6F; Fri, 16 Feb 2018 17:46:07 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1GHk7jG027122; Fri, 16 Feb 2018 17:46:07 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1GHk72A027121; Fri, 16 Feb 2018 17:46:07 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201802161746.w1GHk72A027121@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Fri, 16 Feb 2018 17:46:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329387 - head/stand/lua X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/stand/lua X-SVN-Commit-Revision: 329387 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Feb 2018 17:46:08 -0000 Author: kevans Date: Fri Feb 16 17:46:07 2018 New Revision: 329387 URL: https://svnweb.freebsd.org/changeset/base/329387 Log: stand/lua: Chop off the decimal for numbers passed to setcursor Decimals screw up the escape sequence and the cursor will not get set. Right now this only affects setting the cursor for drawing "Welcome to FreeBSD" -- the resulting number after our (x+(w/2)-9) calculation gets output as "14.0." This should be fixed at the interpreter level, rather than here, but this is not a widespread problem at the moment so we'll fix it up in further work. Reported by: David Wolfskill Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D14375 Modified: head/stand/lua/screen.lua Modified: head/stand/lua/screen.lua ============================================================================== --- head/stand/lua/screen.lua Fri Feb 16 17:42:38 2018 (r329386) +++ head/stand/lua/screen.lua Fri Feb 16 17:46:07 2018 (r329387) @@ -31,6 +31,17 @@ local screen = {}; local color = require("color"); local core = require("core"); +-- XXX TODO: This should be fixed in the interpreter to not print decimals +function intstring(num) + local str = tostring(num) + local decimal = string.find(str, "[.]") + + if decimal then + return string.sub(str, 1, decimal - 1) + end + return str +end + function screen.clear() if core.bootserial() then return; @@ -42,7 +53,8 @@ function screen.setcursor(x, y) if core.bootserial() then return; end - loader.printc("\027["..y..";"..x.."H"); + + loader.printc("\027["..intstring(y)..";"..intstring(x).."H"); end function screen.setforeground(c) From owner-svn-src-all@freebsd.org Fri Feb 16 17:50:07 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 925B2F03A73; Fri, 16 Feb 2018 17:50:07 +0000 (UTC) (envelope-from cognet@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 434CC68727; Fri, 16 Feb 2018 17:50:07 +0000 (UTC) (envelope-from cognet@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 39DBA10E7E; Fri, 16 Feb 2018 17:50:07 +0000 (UTC) (envelope-from cognet@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1GHo71m027494; Fri, 16 Feb 2018 17:50:07 GMT (envelope-from cognet@FreeBSD.org) Received: (from cognet@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1GHo7V0027493; Fri, 16 Feb 2018 17:50:07 GMT (envelope-from cognet@FreeBSD.org) Message-Id: <201802161750.w1GHo7V0027493@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cognet set sender to cognet@FreeBSD.org using -f From: Olivier Houchard Date: Fri, 16 Feb 2018 17:50:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329388 - head/sys/contrib/ck/include X-SVN-Group: head X-SVN-Commit-Author: cognet X-SVN-Commit-Paths: head/sys/contrib/ck/include X-SVN-Commit-Revision: 329388 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Feb 2018 17:50:07 -0000 Author: cognet Date: Fri Feb 16 17:50:06 2018 New Revision: 329388 URL: https://svnweb.freebsd.org/changeset/base/329388 Log: Define CK_MD_TSO for the relevant arches (i386, amd64 and sparc64). Defaulting to CK_MD_RMO has the unfortunate side effect of generating memory barriers that are useless on those arches, and the even more unfortunate side effect of generating lfence/sfence/mfence on i386, even if older CPUs don't support it. This should fix the panic reported when using IPFW on a Pentium 3. Note that mfence and sfence might still be used in a few case, but that shouldn't happen in FreeBSD right now, and should be fixed upstream first. MFC after: 1 week Modified: head/sys/contrib/ck/include/ck_md.h Modified: head/sys/contrib/ck/include/ck_md.h ============================================================================== --- head/sys/contrib/ck/include/ck_md.h Fri Feb 16 17:46:07 2018 (r329387) +++ head/sys/contrib/ck/include/ck_md.h Fri Feb 16 17:50:06 2018 (r329388) @@ -53,10 +53,6 @@ #define CK_PR_DISABLE_DOUBLE #endif /* CK_PR_DISABLE_DOUBLE */ -#ifndef CK_MD_RMO -#define CK_MD_RMO -#endif /* CK_MD_RMO */ - #define CK_VERSION "0.6.0" #define CK_GIT_SHA "" @@ -65,11 +61,20 @@ */ #if defined(__i386__) && !defined(__x86__) #define __x86__ +#define CK_MD_TSO +#elif defined(__amd64__) +#define CK_MD_TSO #elif defined(__sparc64__) && !defined(__sparcv9__) #define __sparcv9__ +#define CK_MD_TSO #elif defined(__powerpc64__) && !defined(__ppc64__) #define __ppc64__ #elif defined(__powerpc__) && !defined(__ppc__) #define __ppc__ #endif + +#if !defined(CK_MD_RMO) && !defined(CK_MD_TSO) && !defined(CK_MD_PSO) +#define CK_MD_RMO +#endif + #endif /* CK_MD_H */ From owner-svn-src-all@freebsd.org Fri Feb 16 18:04:28 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A20CFF04B16; Fri, 16 Feb 2018 18:04:28 +0000 (UTC) (envelope-from royger@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5537E69562; Fri, 16 Feb 2018 18:04:28 +0000 (UTC) (envelope-from royger@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4E8EF111D4; Fri, 16 Feb 2018 18:04:28 +0000 (UTC) (envelope-from royger@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1GI4SGg037885; Fri, 16 Feb 2018 18:04:28 GMT (envelope-from royger@FreeBSD.org) Received: (from royger@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1GI4SMo037884; Fri, 16 Feb 2018 18:04:28 GMT (envelope-from royger@FreeBSD.org) Message-Id: <201802161804.w1GI4SMo037884@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: royger set sender to royger@FreeBSD.org using -f From: =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= Date: Fri, 16 Feb 2018 18:04:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329389 - head/sys/x86/xen X-SVN-Group: head X-SVN-Commit-Author: royger X-SVN-Commit-Paths: head/sys/x86/xen X-SVN-Commit-Revision: 329389 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Feb 2018 18:04:28 -0000 Author: royger Date: Fri Feb 16 18:04:27 2018 New Revision: 329389 URL: https://svnweb.freebsd.org/changeset/base/329389 Log: xen/pv: remove the attach of the ISA bus from the Xen PV bus There's no need to attach the ISA bus from the Xen PV one. Sponsored by: Citrix Systems R&D Modified: head/sys/x86/xen/xenpv.c Modified: head/sys/x86/xen/xenpv.c ============================================================================== --- head/sys/x86/xen/xenpv.c Fri Feb 16 17:50:06 2018 (r329388) +++ head/sys/x86/xen/xenpv.c Fri Feb 16 18:04:27 2018 (r329389) @@ -93,24 +93,20 @@ xenpv_probe(device_t dev) static int xenpv_attach(device_t dev) { - device_t child; + int error; /* * Let our child drivers identify any child devices that they * can find. Once that is done attach any devices that we * found. */ - bus_generic_probe(dev); - bus_generic_attach(dev); + error = bus_generic_probe(dev); + if (error) + return (error); - if (!devclass_get_device(devclass_find("isa"), 0)) { - child = BUS_ADD_CHILD(dev, 0, "isa", 0); - if (child == NULL) - panic("Failed to attach ISA bus."); - device_probe_and_attach(child); - } + error = bus_generic_attach(dev); - return (0); + return (error); } static struct resource * From owner-svn-src-all@freebsd.org Fri Feb 16 18:07:05 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0128BF04DBC; Fri, 16 Feb 2018 18:07:05 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A952F69742; Fri, 16 Feb 2018 18:07:04 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A4277111D6; Fri, 16 Feb 2018 18:07:04 +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 w1GI744x038036; Fri, 16 Feb 2018 18:07:04 GMT (envelope-from lwhsu@FreeBSD.org) Received: (from lwhsu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1GI74Z1038034; Fri, 16 Feb 2018 18:07:04 GMT (envelope-from lwhsu@FreeBSD.org) Message-Id: <201802161807.w1GI74Z1038034@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: lwhsu set sender to lwhsu@FreeBSD.org using -f From: Li-Wen Hsu Date: Fri, 16 Feb 2018 18:07:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329390 - head/usr.bin/ipcs X-SVN-Group: head X-SVN-Commit-Author: lwhsu X-SVN-Commit-Paths: head/usr.bin/ipcs X-SVN-Commit-Revision: 329390 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Feb 2018 18:07:05 -0000 Author: lwhsu (ports committer) Date: Fri Feb 16 18:07:04 2018 New Revision: 329390 URL: https://svnweb.freebsd.org/changeset/base/329390 Log: Follow r329348 in ipcs for getting rid of the requirement to include SysV IPC headers with _KERNEL Reviewed by: jhb Differential Revision: https://reviews.freebsd.org/D14398 Modified: head/usr.bin/ipcs/ipc.c head/usr.bin/ipcs/ipcs.c Modified: head/usr.bin/ipcs/ipc.c ============================================================================== --- head/usr.bin/ipcs/ipc.c Fri Feb 16 18:04:27 2018 (r329389) +++ head/usr.bin/ipcs/ipc.c Fri Feb 16 18:07:04 2018 (r329390) @@ -35,11 +35,12 @@ __FBSDID("$FreeBSD$"); #include #include -#define _KERNEL +#define _WANT_SYSVMSG_INTERNALS +#include +#define _WANT_SYSVSEM_INTERNALS #include +#define _WANT_SYSVSHM_INTERNALS #include -#include -#undef _KERNEL #include #include Modified: head/usr.bin/ipcs/ipcs.c ============================================================================== --- head/usr.bin/ipcs/ipcs.c Fri Feb 16 18:04:27 2018 (r329389) +++ head/usr.bin/ipcs/ipcs.c Fri Feb 16 18:07:04 2018 (r329390) @@ -32,11 +32,12 @@ __FBSDID("$FreeBSD$"); #include #include -#define _KERNEL +#define _WANT_SYSVMSG_INTERNALS +#include +#define _WANT_SYSVSEM_INTERNALS #include +#define _WANT_SYSVSHM_INTERNALS #include -#include -#undef _KERNEL #include #include From owner-svn-src-all@freebsd.org Fri Feb 16 18:23:28 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A36FAF0610C; Fri, 16 Feb 2018 18:23:28 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 50F1B6A306; Fri, 16 Feb 2018 18:23:28 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4905811531; Fri, 16 Feb 2018 18:23:28 +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 w1GINSI3047776; Fri, 16 Feb 2018 18:23:28 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1GINSU2047775; Fri, 16 Feb 2018 18:23:28 GMT (envelope-from np@FreeBSD.org) Message-Id: <201802161823.w1GINSU2047775@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Fri, 16 Feb 2018 18:23:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r329391 - stable/11/sys/dev/cxgbe/iw_cxgbe X-SVN-Group: stable-11 X-SVN-Commit-Author: np X-SVN-Commit-Paths: stable/11/sys/dev/cxgbe/iw_cxgbe X-SVN-Commit-Revision: 329391 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Feb 2018 18:23:28 -0000 Author: np Date: Fri Feb 16 18:23:27 2018 New Revision: 329391 URL: https://svnweb.freebsd.org/changeset/base/329391 Log: iw_cxgbe: Follow-up fix to r329017, which updated the code associated with QP flush. This is a direct commit to stable/11. Sponsored by: Chelsio Communications Modified: stable/11/sys/dev/cxgbe/iw_cxgbe/qp.c Modified: stable/11/sys/dev/cxgbe/iw_cxgbe/qp.c ============================================================================== --- stable/11/sys/dev/cxgbe/iw_cxgbe/qp.c Fri Feb 16 18:07:04 2018 (r329390) +++ stable/11/sys/dev/cxgbe/iw_cxgbe/qp.c Fri Feb 16 18:23:27 2018 (r329391) @@ -1036,7 +1036,8 @@ static void __flush_qp(struct c4iw_qp *qhp, struct c4i /* locking heirarchy: cq lock first, then qp lock. */ spin_lock_irqsave(&schp->lock, flag); spin_lock(&qhp->lock); - c4iw_flush_hw_cq(schp); + if (schp != rchp) + c4iw_flush_hw_cq(schp); flushed = c4iw_flush_sq(qhp); spin_unlock(&qhp->lock); spin_unlock_irqrestore(&schp->lock, flag); From owner-svn-src-all@freebsd.org Fri Feb 16 18:37:12 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 896ABF06FCE; Fri, 16 Feb 2018 18:37:12 +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 17E986AC0C; Fri, 16 Feb 2018 18:37:12 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (ralph.baldwin.cx [66.234.199.215]) by mail.baldwin.cx (Postfix) with ESMTPSA id 23D6B10AFAD; Fri, 16 Feb 2018 13:37:11 -0500 (EST) From: John Baldwin To: Mark Johnston Cc: Benno Rice , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r329269 - head/stand/i386/boot2 Date: Fri, 16 Feb 2018 09:58:04 -0800 Message-ID: <2488298.mWgVtp3Hqz@ralph.baldwin.cx> User-Agent: KMail/4.14.10 (FreeBSD/11.1-STABLE; KDE/4.14.30; amd64; ; ) In-Reply-To: <20180216164445.GB55620@raichu> References: <201802141807.w1EI7Ror036078@repo.freebsd.org> <20180216164445.GB55620@raichu> 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, 16 Feb 2018 13:37:11 -0500 (EST) X-Virus-Scanned: clamav-milter 0.99.2 at mail.baldwin.cx X-Virus-Status: Clean X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Feb 2018 18:37:12 -0000 On Friday, February 16, 2018 11:44:45 AM Mark Johnston wrote: > On Wed, Feb 14, 2018 at 06:07:27PM +0000, Benno Rice wrote: > > Author: benno > > Date: Wed Feb 14 18:07:27 2018 > > New Revision: 329269 > > URL: https://svnweb.freebsd.org/changeset/base/329269 > > > > Log: > > Reformat to come significantly closer to style(9). > > > > Reviewed by: imp, jhibbits > > Differential Revision: https://reviews.freebsd.org/D14366 > > > > Modified: > > head/stand/i386/boot2/boot2.c > > > > Modified: head/stand/i386/boot2/boot2.c > > ============================================================================== > > --- head/stand/i386/boot2/boot2.c Wed Feb 14 18:05:37 2018 (r329268) > > +++ head/stand/i386/boot2/boot2.c Wed Feb 14 18:07:27 2018 (r329269) > > [...] > > #if SERIAL > > - } else if (c == 'S') { > > - j = 0; > > - while ((unsigned int)(i = *arg++ - '0') <= 9) > > - j = j * 10 + i; > > - if (j > 0 && i == -'0') { > > - comspeed = j; > > - break; > > - } > > - /* Fall through to error below ('S' not in optstr[]). */ > > + } else if (c == 'S') { > > + j = 0; > > + while (*arg <= '9') { > > + i = (unsigned int)(*arg - '0'); > > + j = j * 10 + i; > > + arg++; > > + } > > + if (j > 0 && i == -'0') { > > + comspeed = j; > > + break; > > + } > > The gcc build is failing now with a claim that "i" may be used > uninitialized in the if-statement above. It looks like a bogus error > though. If this commit mixed functional changes with the reindent it needs to be reverted and the reindent needs to be re-committed as a separate commit. The functional changes (if intended) should then be a separate commit once they are tested. -- John Baldwin From owner-svn-src-all@freebsd.org Fri Feb 16 18:49:51 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DE65EF07D9F; Fri, 16 Feb 2018 18:49:50 +0000 (UTC) (envelope-from brd@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 91B4D6B372; Fri, 16 Feb 2018 18:49:50 +0000 (UTC) (envelope-from brd@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8C8171187E; Fri, 16 Feb 2018 18:49:50 +0000 (UTC) (envelope-from brd@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1GInoLL058847; Fri, 16 Feb 2018 18:49:50 GMT (envelope-from brd@FreeBSD.org) Received: (from brd@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1GInoPU058846; Fri, 16 Feb 2018 18:49:50 GMT (envelope-from brd@FreeBSD.org) Message-Id: <201802161849.w1GInoPU058846@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brd set sender to brd@FreeBSD.org using -f From: Brad Davis Date: Fri, 16 Feb 2018 18:49:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r329392 - stable/11/usr.sbin/mountd X-SVN-Group: stable-11 X-SVN-Commit-Author: brd X-SVN-Commit-Paths: stable/11/usr.sbin/mountd X-SVN-Commit-Revision: 329392 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Feb 2018 18:49:51 -0000 Author: brd (doc,ports committer) Date: Fri Feb 16 18:49:50 2018 New Revision: 329392 URL: https://svnweb.freebsd.org/changeset/base/329392 Log: MFC r329009 mountd(8): Produce vaguely meaningful error messages Approved by: cem, will Modified: stable/11/usr.sbin/mountd/mountd.c Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.sbin/mountd/mountd.c ============================================================================== --- stable/11/usr.sbin/mountd/mountd.c Fri Feb 16 18:23:27 2018 (r329391) +++ stable/11/usr.sbin/mountd/mountd.c Fri Feb 16 18:49:50 2018 (r329392) @@ -199,7 +199,7 @@ static struct hostlist *get_ht(void); static int get_line(void); static void get_mountlist(void); static int get_net(char *, struct netmsk *, int); -static void getexp_err(struct exportlist *, struct grouplist *); +static void getexp_err(struct exportlist *, struct grouplist *, const char *); static struct grouplist *get_grp(void); static void hang_dirp(struct dirlist *, struct grouplist *, struct exportlist *, int); @@ -1448,12 +1448,13 @@ get_exportlist_one(void) tgrp = grp = get_grp(); while (len > 0) { if (len > MNTNAMLEN) { - getexp_err(ep, tgrp); + getexp_err(ep, tgrp, "mountpoint too long"); goto nextline; } if (*cp == '-') { if (ep == (struct exportlist *)NULL) { - getexp_err(ep, tgrp); + getexp_err(ep, tgrp, + "flag before export path definition"); goto nextline; } if (debug) @@ -1461,7 +1462,7 @@ get_exportlist_one(void) got_nondir = 1; if (do_opt(&cp, &endcp, ep, grp, &has_host, &exflags, &anon)) { - getexp_err(ep, tgrp); + getexp_err(ep, tgrp, NULL); goto nextline; } } else if (*cp == '/') { @@ -1469,8 +1470,7 @@ get_exportlist_one(void) *endcp = '\0'; if (v4root_phase > 1) { if (dirp != NULL) { - syslog(LOG_ERR, "Multiple V4 dirs"); - getexp_err(ep, tgrp); + getexp_err(ep, tgrp, "Multiple V4 dirs"); goto nextline; } } @@ -1480,14 +1480,12 @@ get_exportlist_one(void) syslog(LOG_ERR, "Warning: exporting of " "automounted fs %s not supported", cp); if (got_nondir) { - syslog(LOG_ERR, "dirs must be first"); - getexp_err(ep, tgrp); + getexp_err(ep, tgrp, "dirs must be first"); goto nextline; } if (v4root_phase == 1) { if (dirp != NULL) { - syslog(LOG_ERR, "Multiple V4 dirs"); - getexp_err(ep, tgrp); + getexp_err(ep, tgrp, "Multiple V4 dirs"); goto nextline; } if (strlen(v4root_dirpath) == 0) { @@ -1497,7 +1495,7 @@ get_exportlist_one(void) != 0) { syslog(LOG_ERR, "different V4 dirpath %s", cp); - getexp_err(ep, tgrp); + getexp_err(ep, tgrp, NULL); goto nextline; } dirp = cp; @@ -1510,7 +1508,8 @@ get_exportlist_one(void) fsb.f_fsid.val[0] || ep->ex_fs.val[1] != fsb.f_fsid.val[1]) { - getexp_err(ep, tgrp); + getexp_err(ep, tgrp, + "fsid mismatch"); goto nextline; } } else { @@ -1543,7 +1542,8 @@ get_exportlist_one(void) dirplen = len; } } else { - getexp_err(ep, tgrp); + getexp_err(ep, tgrp, + "symbolic link in export path or statfs failed"); goto nextline; } *endcp = savedc; @@ -1552,7 +1552,8 @@ get_exportlist_one(void) *endcp = '\0'; got_nondir = 1; if (ep == (struct exportlist *)NULL) { - getexp_err(ep, tgrp); + getexp_err(ep, tgrp, + "host(s) before export path definition"); goto nextline; } @@ -1590,7 +1591,7 @@ get_exportlist_one(void) len = endcp - cp; } if (check_options(dirhead)) { - getexp_err(ep, tgrp); + getexp_err(ep, tgrp, NULL); goto nextline; } if (!has_host) { @@ -1603,8 +1604,7 @@ get_exportlist_one(void) * host(s) on the same line. */ } else if ((opt_flags & OP_NET) && tgrp->gr_next) { - syslog(LOG_ERR, "network/host conflict"); - getexp_err(ep, tgrp); + getexp_err(ep, tgrp, "network/host conflict"); goto nextline; /* @@ -1616,14 +1616,13 @@ get_exportlist_one(void) while (grp && grp->gr_type == GT_IGNORE) grp = grp->gr_next; if (! grp) { - getexp_err(ep, tgrp); + getexp_err(ep, tgrp, "no valid entries"); goto nextline; } } if (v4root_phase == 1) { - syslog(LOG_ERR, "V4:root, no dirp, ignored"); - getexp_err(ep, tgrp); + getexp_err(ep, tgrp, "V4:root, no dirp, ignored"); goto nextline; } @@ -1636,7 +1635,7 @@ get_exportlist_one(void) do { if (do_mount(ep, grp, exflags, &anon, dirp, dirplen, &fsb)) { - getexp_err(ep, tgrp); + getexp_err(ep, tgrp, NULL); goto nextline; } } while (grp->gr_next && (grp = grp->gr_next)); @@ -1878,12 +1877,17 @@ get_grp(void) * Clean up upon an error in get_exportlist(). */ static void -getexp_err(struct exportlist *ep, struct grouplist *grp) +getexp_err(struct exportlist *ep, struct grouplist *grp, const char *reason) { struct grouplist *tgrp; - if (!(opt_flags & OP_QUIET)) - syslog(LOG_ERR, "bad exports list line %s", line); + if (!(opt_flags & OP_QUIET)) { + if (reason != NULL) + syslog(LOG_ERR, "bad exports list line '%s': %s", line, + reason); + else + syslog(LOG_ERR, "bad exports list line '%s'", line); + } if (ep && (ep->ex_flag & EX_LINKED) == 0) free_exp(ep); while (grp) { From owner-svn-src-all@freebsd.org Fri Feb 16 18:50:07 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 47A58F07E09; Fri, 16 Feb 2018 18:50:07 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E21246B48B; Fri, 16 Feb 2018 18:50:06 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DCE2B11882; Fri, 16 Feb 2018 18:50:06 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1GIo6eM058932; Fri, 16 Feb 2018 18:50:06 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1GIo64V058931; Fri, 16 Feb 2018 18:50:06 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201802161850.w1GIo64V058931@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Fri, 16 Feb 2018 18:50:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329393 - head/stand/lua X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/stand/lua X-SVN-Commit-Revision: 329393 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Feb 2018 18:50:07 -0000 Author: kevans Date: Fri Feb 16 18:50:06 2018 New Revision: 329393 URL: https://svnweb.freebsd.org/changeset/base/329393 Log: stand/lua: Use escaped dot instead of single character class Modified: head/stand/lua/screen.lua Modified: head/stand/lua/screen.lua ============================================================================== --- head/stand/lua/screen.lua Fri Feb 16 18:49:50 2018 (r329392) +++ head/stand/lua/screen.lua Fri Feb 16 18:50:06 2018 (r329393) @@ -34,7 +34,7 @@ local core = require("core"); -- XXX TODO: This should be fixed in the interpreter to not print decimals function intstring(num) local str = tostring(num) - local decimal = string.find(str, "[.]") + local decimal = string.find(str, "%.") if decimal then return string.sub(str, 1, decimal - 1) From owner-svn-src-all@freebsd.org Fri Feb 16 19:10:19 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CAEBAF09577; Fri, 16 Feb 2018 19:10:18 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6FC026C25A; Fri, 16 Feb 2018 19:10:18 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6A5CE11BB5; Fri, 16 Feb 2018 19:10:18 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1GJAI63068910; Fri, 16 Feb 2018 19:10:18 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1GJAFgb068879; Fri, 16 Feb 2018 19:10:15 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201802161910.w1GJAFgb068879@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Fri, 16 Feb 2018 19:10:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r329394 - in vendor/llvm/dist-release_60: docs include/llvm/IR include/llvm/MC include/llvm/Support lib/CodeGen lib/CodeGen/AsmPrinter lib/CodeGen/SelectionDAG lib/IR lib/MC/MCParser li... X-SVN-Group: vendor X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in vendor/llvm/dist-release_60: docs include/llvm/IR include/llvm/MC include/llvm/Support lib/CodeGen lib/CodeGen/AsmPrinter lib/CodeGen/SelectionDAG lib/IR lib/MC/MCParser lib/Target/AMDGPU lib/Targe... X-SVN-Commit-Revision: 329394 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Feb 2018 19:10:19 -0000 Author: dim Date: Fri Feb 16 19:10:15 2018 New Revision: 329394 URL: https://svnweb.freebsd.org/changeset/base/329394 Log: Vendor import of llvm release_60 branch r325330: https://llvm.org/svn/llvm-project/llvm/branches/release_60@325330 Added: vendor/llvm/dist-release_60/include/llvm/MC/MCAsmMacro.h (contents, props changed) vendor/llvm/dist-release_60/test/CodeGen/AMDGPU/llvm.amdgcn.cvt.pk.i16.ll vendor/llvm/dist-release_60/test/CodeGen/AMDGPU/llvm.amdgcn.cvt.pk.u16.ll vendor/llvm/dist-release_60/test/CodeGen/AMDGPU/llvm.amdgcn.cvt.pknorm.i16.ll vendor/llvm/dist-release_60/test/CodeGen/AMDGPU/llvm.amdgcn.cvt.pknorm.u16.ll vendor/llvm/dist-release_60/test/CodeGen/ARM/splitkit.ll vendor/llvm/dist-release_60/test/CodeGen/Thumb/stm-scavenging.ll vendor/llvm/dist-release_60/test/CodeGen/X86/inline-asm-modifier-V.ll vendor/llvm/dist-release_60/test/CodeGen/X86/pr36199.ll vendor/llvm/dist-release_60/test/CodeGen/X86/retpoline-regparm.ll vendor/llvm/dist-release_60/test/DebugInfo/X86/void-typedef.ll vendor/llvm/dist-release_60/test/MC/AsmParser/inline_macro_duplication.ll Modified: vendor/llvm/dist-release_60/docs/ReleaseNotes.rst vendor/llvm/dist-release_60/include/llvm/IR/IntrinsicsAMDGPU.td vendor/llvm/dist-release_60/include/llvm/IR/IntrinsicsX86.td vendor/llvm/dist-release_60/include/llvm/MC/MCContext.h vendor/llvm/dist-release_60/include/llvm/Support/GenericDomTreeConstruction.h vendor/llvm/dist-release_60/lib/CodeGen/AsmPrinter/DebugHandlerBase.cpp vendor/llvm/dist-release_60/lib/CodeGen/AsmPrinter/DwarfUnit.cpp vendor/llvm/dist-release_60/lib/CodeGen/LivePhysRegs.cpp vendor/llvm/dist-release_60/lib/CodeGen/SelectionDAG/DAGCombiner.cpp vendor/llvm/dist-release_60/lib/CodeGen/SplitKit.cpp vendor/llvm/dist-release_60/lib/CodeGen/SplitKit.h vendor/llvm/dist-release_60/lib/IR/AutoUpgrade.cpp vendor/llvm/dist-release_60/lib/MC/MCParser/AsmParser.cpp vendor/llvm/dist-release_60/lib/Target/AMDGPU/AMDGPUISelLowering.cpp vendor/llvm/dist-release_60/lib/Target/AMDGPU/AMDGPUISelLowering.h vendor/llvm/dist-release_60/lib/Target/AMDGPU/AMDGPUInstrInfo.cpp vendor/llvm/dist-release_60/lib/Target/AMDGPU/AMDGPUInstrInfo.h vendor/llvm/dist-release_60/lib/Target/AMDGPU/AMDGPUInstrInfo.td vendor/llvm/dist-release_60/lib/Target/AMDGPU/AMDGPURegisterBankInfo.cpp vendor/llvm/dist-release_60/lib/Target/AMDGPU/SIISelLowering.cpp vendor/llvm/dist-release_60/lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.cpp vendor/llvm/dist-release_60/lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.h vendor/llvm/dist-release_60/lib/Target/AMDGPU/VOP2Instructions.td vendor/llvm/dist-release_60/lib/Target/X86/MCTargetDesc/X86MCCodeEmitter.cpp vendor/llvm/dist-release_60/lib/Target/X86/X86AsmPrinter.cpp vendor/llvm/dist-release_60/lib/Target/X86/X86DomainReassignment.cpp vendor/llvm/dist-release_60/lib/Target/X86/X86ISelLowering.cpp vendor/llvm/dist-release_60/lib/Target/X86/X86IntrinsicsInfo.h vendor/llvm/dist-release_60/lib/Target/X86/X86RetpolineThunks.cpp vendor/llvm/dist-release_60/lib/Transforms/InstCombine/InstCombineCalls.cpp vendor/llvm/dist-release_60/test/CodeGen/ARM/pr25838.ll vendor/llvm/dist-release_60/test/CodeGen/X86/avx512-intrinsics-fast-isel.ll vendor/llvm/dist-release_60/test/CodeGen/X86/avx512-intrinsics-upgrade.ll vendor/llvm/dist-release_60/test/CodeGen/X86/avx512-intrinsics.ll vendor/llvm/dist-release_60/test/CodeGen/X86/avx512-mask-op.ll vendor/llvm/dist-release_60/test/CodeGen/X86/avx512bw-intrinsics-fast-isel.ll vendor/llvm/dist-release_60/test/CodeGen/X86/avx512bw-intrinsics-upgrade.ll vendor/llvm/dist-release_60/test/CodeGen/X86/avx512bw-intrinsics.ll vendor/llvm/dist-release_60/test/CodeGen/X86/domain-reassignment.mir vendor/llvm/dist-release_60/test/CodeGen/X86/retpoline-external.ll vendor/llvm/dist-release_60/test/CodeGen/X86/retpoline.ll vendor/llvm/dist-release_60/test/MC/X86/x86-64.s vendor/llvm/dist-release_60/test/Transforms/InstCombine/AMDGPU/amdgcn-intrinsics.ll Modified: vendor/llvm/dist-release_60/docs/ReleaseNotes.rst ============================================================================== --- vendor/llvm/dist-release_60/docs/ReleaseNotes.rst Fri Feb 16 18:50:06 2018 (r329393) +++ vendor/llvm/dist-release_60/docs/ReleaseNotes.rst Fri Feb 16 19:10:15 2018 (r329394) @@ -71,6 +71,13 @@ Non-comprehensive list of changes in this release Changes to the LLVM IR ---------------------- +Changes to the AArch64 Target +----------------------------- + +During this release: + + * Enabled the new GlobalISel instruction selection framework by default at ``-O0``. + Changes to the ARM Target ------------------------- @@ -80,6 +87,28 @@ During this release the ARM target has: isn't the default. +Changes to the Hexagon Target +----------------------------- + +* The Hexagon backend now supports V65 ISA. + +* The ``-mhvx`` option now takes an optional value that specified the ISA + version of the HVX coprocessor. The available values are v60, v62 and v65. + By default, the value is set to be the same as the CPU version. + +* The compiler option ``-mhvx-double`` is deprecated and will be removed in + the next release of the compiler. Programmers should use ``-mhvx-length`` + option to specify the desired vector length: ``-mhvx-length=64b`` for + 64-byte vectors and ``-mhvx-length=128b`` for 128-byte vectors. While the + current default vector length is 64 bytes, users should always specify the + length explicitly, since the default value may change in the future. + +* The target feature ``hvx-double`` is deprecated and will be removed in the + next release. LLVM IR generators should use target features ``hvx-length64b`` + and ``hvx-length128b`` to indicate the vector length. The length should + always be specified when HVX code generation is enabled. + + Changes to the MIPS Target -------------------------- @@ -90,6 +119,15 @@ Changes to the PowerPC Target ----------------------------- During this release ... + +Changes to the SystemZ Target +----------------------------- + +During this release the SystemZ target has: + +* Added support for 128-bit atomic operations. + +* Added support for the "o" constraint for inline asm statements. Changes to the X86 Target ------------------------- Modified: vendor/llvm/dist-release_60/include/llvm/IR/IntrinsicsAMDGPU.td ============================================================================== --- vendor/llvm/dist-release_60/include/llvm/IR/IntrinsicsAMDGPU.td Fri Feb 16 18:50:06 2018 (r329393) +++ vendor/llvm/dist-release_60/include/llvm/IR/IntrinsicsAMDGPU.td Fri Feb 16 19:10:15 2018 (r329394) @@ -238,6 +238,26 @@ def int_amdgcn_cvt_pkrtz : Intrinsic< [IntrNoMem, IntrSpeculatable] >; +def int_amdgcn_cvt_pknorm_i16 : Intrinsic< + [llvm_v2i16_ty], [llvm_float_ty, llvm_float_ty], + [IntrNoMem, IntrSpeculatable] +>; + +def int_amdgcn_cvt_pknorm_u16 : Intrinsic< + [llvm_v2i16_ty], [llvm_float_ty, llvm_float_ty], + [IntrNoMem, IntrSpeculatable] +>; + +def int_amdgcn_cvt_pk_i16 : Intrinsic< + [llvm_v2i16_ty], [llvm_i32_ty, llvm_i32_ty], + [IntrNoMem, IntrSpeculatable] +>; + +def int_amdgcn_cvt_pk_u16 : Intrinsic< + [llvm_v2i16_ty], [llvm_i32_ty, llvm_i32_ty], + [IntrNoMem, IntrSpeculatable] +>; + def int_amdgcn_class : Intrinsic< [llvm_i1_ty], [llvm_anyfloat_ty, llvm_i32_ty], [IntrNoMem, IntrSpeculatable] Modified: vendor/llvm/dist-release_60/include/llvm/IR/IntrinsicsX86.td ============================================================================== --- vendor/llvm/dist-release_60/include/llvm/IR/IntrinsicsX86.td Fri Feb 16 18:50:06 2018 (r329393) +++ vendor/llvm/dist-release_60/include/llvm/IR/IntrinsicsX86.td Fri Feb 16 19:10:15 2018 (r329394) @@ -3738,6 +3738,15 @@ let TargetPrefix = "x86" in { // All intrinsics start def int_x86_avx512_kxnor_w : // TODO: remove this intrinsic Intrinsic<[llvm_i16_ty], [llvm_i16_ty, llvm_i16_ty], [IntrNoMem]>; + def int_x86_avx512_kunpck_bw : GCCBuiltin<"__builtin_ia32_kunpckhi">, + Intrinsic<[llvm_i16_ty], [llvm_i16_ty, llvm_i16_ty], + [IntrNoMem]>; + def int_x86_avx512_kunpck_wd : GCCBuiltin<"__builtin_ia32_kunpcksi">, + Intrinsic<[llvm_i32_ty], [llvm_i32_ty, llvm_i32_ty], + [IntrNoMem]>; + def int_x86_avx512_kunpck_dq : GCCBuiltin<"__builtin_ia32_kunpckdi">, + Intrinsic<[llvm_i64_ty], [llvm_i64_ty, llvm_i64_ty], + [IntrNoMem]>; def int_x86_avx512_kortestz_w : GCCBuiltin<"__builtin_ia32_kortestzhi">, Intrinsic<[llvm_i32_ty], [llvm_i16_ty, llvm_i16_ty], [IntrNoMem]>; Added: vendor/llvm/dist-release_60/include/llvm/MC/MCAsmMacro.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/llvm/dist-release_60/include/llvm/MC/MCAsmMacro.h Fri Feb 16 19:10:15 2018 (r329394) @@ -0,0 +1,38 @@ +//===- MCAsmMacro.h - Assembly Macros ---------------------------*- C++ -*-===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +#ifndef LLVM_MC_MCASMMACRO_H +#define LLVM_MC_MCASMMACRO_H + +#include "llvm/MC/MCParser/MCAsmLexer.h" + +namespace llvm { + +struct MCAsmMacroParameter { + StringRef Name; + std::vector Value; + bool Required = false; + bool Vararg = false; + + MCAsmMacroParameter() = default; +}; + +typedef std::vector MCAsmMacroParameters; +struct MCAsmMacro { + StringRef Name; + StringRef Body; + MCAsmMacroParameters Parameters; + +public: + MCAsmMacro(StringRef N, StringRef B, MCAsmMacroParameters P) + : Name(N), Body(B), Parameters(std::move(P)) {} +}; +}; // namespace llvm + +#endif Modified: vendor/llvm/dist-release_60/include/llvm/MC/MCContext.h ============================================================================== --- vendor/llvm/dist-release_60/include/llvm/MC/MCContext.h Fri Feb 16 18:50:06 2018 (r329393) +++ vendor/llvm/dist-release_60/include/llvm/MC/MCContext.h Fri Feb 16 19:10:15 2018 (r329394) @@ -18,6 +18,7 @@ #include "llvm/ADT/StringRef.h" #include "llvm/ADT/Twine.h" #include "llvm/BinaryFormat/Dwarf.h" +#include "llvm/MC/MCAsmMacro.h" #include "llvm/MC/MCDwarf.h" #include "llvm/MC/MCSubtargetInfo.h" #include "llvm/MC/SectionKind.h" @@ -268,6 +269,9 @@ namespace llvm { unsigned UniqueID, const MCSymbolELF *Associated); + /// \brief Map of currently defined macros. + StringMap MacroMap; + public: explicit MCContext(const MCAsmInfo *MAI, const MCRegisterInfo *MRI, const MCObjectFileInfo *MOFI, @@ -618,6 +622,17 @@ namespace llvm { // FIXME: We should really do something about that. LLVM_ATTRIBUTE_NORETURN void reportFatalError(SMLoc L, const Twine &Msg); + + const MCAsmMacro *lookupMacro(StringRef Name) { + StringMap::iterator I = MacroMap.find(Name); + return (I == MacroMap.end()) ? nullptr : &I->getValue(); + } + + void defineMacro(StringRef Name, MCAsmMacro Macro) { + MacroMap.insert(std::make_pair(Name, std::move(Macro))); + } + + void undefineMacro(StringRef Name) { MacroMap.erase(Name); } }; } // end namespace llvm Modified: vendor/llvm/dist-release_60/include/llvm/Support/GenericDomTreeConstruction.h ============================================================================== --- vendor/llvm/dist-release_60/include/llvm/Support/GenericDomTreeConstruction.h Fri Feb 16 18:50:06 2018 (r329393) +++ vendor/llvm/dist-release_60/include/llvm/Support/GenericDomTreeConstruction.h Fri Feb 16 19:10:15 2018 (r329394) @@ -698,24 +698,20 @@ struct SemiNCAInfo { return; // Recalculate the set of roots. - DT.Roots = FindRoots(DT, BUI); - for (const NodePtr R : DT.Roots) { - const TreeNodePtr TN = DT.getNode(R); - // A CFG node was selected as a tree root, but the corresponding tree node - // is not connected to the virtual root. This is because the incremental - // algorithm does not really know or use the set of roots and can make a - // different (implicit) decision about which nodes within an infinite loop - // becomes a root. - if (TN && !DT.isVirtualRoot(TN->getIDom())) { - DEBUG(dbgs() << "Root " << BlockNamePrinter(R) - << " is not virtual root's child\n" - << "The entire tree needs to be rebuilt\n"); - // It should be possible to rotate the subtree instead of recalculating - // the whole tree, but this situation happens extremely rarely in - // practice. - CalculateFromScratch(DT, BUI); - return; - } + auto Roots = FindRoots(DT, BUI); + if (DT.Roots.size() != Roots.size() || + !std::is_permutation(DT.Roots.begin(), DT.Roots.end(), Roots.begin())) { + // The roots chosen in the CFG have changed. This is because the + // incremental algorithm does not really know or use the set of roots and + // can make a different (implicit) decision about which node within an + // infinite loop becomes a root. + + DEBUG(dbgs() << "Roots are different in updated trees\n" + << "The entire tree needs to be rebuilt\n"); + // It may be possible to update the tree without recalculating it, but + // we do not know yet how to do it, and it happens rarely in practise. + CalculateFromScratch(DT, BUI); + return; } } Modified: vendor/llvm/dist-release_60/lib/CodeGen/AsmPrinter/DebugHandlerBase.cpp ============================================================================== --- vendor/llvm/dist-release_60/lib/CodeGen/AsmPrinter/DebugHandlerBase.cpp Fri Feb 16 18:50:06 2018 (r329393) +++ vendor/llvm/dist-release_60/lib/CodeGen/AsmPrinter/DebugHandlerBase.cpp Fri Feb 16 19:10:15 2018 (r329394) @@ -163,7 +163,8 @@ uint64_t DebugHandlerBase::getBaseTypeSize(const DITyp DIType *BaseType = DDTy->getBaseType().resolve(); - assert(BaseType && "Unexpected invalid base type"); + if (!BaseType) + return 0; // If this is a derived type, go ahead and get the base type, unless it's a // reference then it's just the size of the field. Pointer types have no need Modified: vendor/llvm/dist-release_60/lib/CodeGen/AsmPrinter/DwarfUnit.cpp ============================================================================== --- vendor/llvm/dist-release_60/lib/CodeGen/AsmPrinter/DwarfUnit.cpp Fri Feb 16 18:50:06 2018 (r329393) +++ vendor/llvm/dist-release_60/lib/CodeGen/AsmPrinter/DwarfUnit.cpp Fri Feb 16 19:10:15 2018 (r329394) @@ -1391,7 +1391,8 @@ void DwarfUnit::constructMemberDIE(DIE &Buffer, const if (!Name.empty()) addString(MemberDie, dwarf::DW_AT_name, Name); - addType(MemberDie, resolve(DT->getBaseType())); + if (DIType *Resolved = resolve(DT->getBaseType())) + addType(MemberDie, Resolved); addSourceLine(MemberDie, DT); Modified: vendor/llvm/dist-release_60/lib/CodeGen/LivePhysRegs.cpp ============================================================================== --- vendor/llvm/dist-release_60/lib/CodeGen/LivePhysRegs.cpp Fri Feb 16 18:50:06 2018 (r329393) +++ vendor/llvm/dist-release_60/lib/CodeGen/LivePhysRegs.cpp Fri Feb 16 19:10:15 2018 (r329394) @@ -205,14 +205,18 @@ void LivePhysRegs::addPristines(const MachineFunction } void LivePhysRegs::addLiveOutsNoPristines(const MachineBasicBlock &MBB) { - if (!MBB.succ_empty()) { - // To get the live-outs we simply merge the live-ins of all successors. - for (const MachineBasicBlock *Succ : MBB.successors()) - addBlockLiveIns(*Succ); - } else if (MBB.isReturnBlock()) { - // For the return block: Add all callee saved registers that are saved and - // restored (somewhere); This does not include callee saved registers that - // are unused and hence not saved and restored; they are called pristine. + // To get the live-outs we simply merge the live-ins of all successors. + for (const MachineBasicBlock *Succ : MBB.successors()) + addBlockLiveIns(*Succ); + if (MBB.isReturnBlock()) { + // Return blocks are a special case because we currently don't mark up + // return instructions completely: specifically, there is no explicit + // use for callee-saved registers. So we add all callee saved registers + // that are saved and restored (somewhere). This does not include + // callee saved registers that are unused and hence not saved and + // restored; they are called pristine. + // FIXME: PEI should add explicit markings to return instructions + // instead of implicitly handling them here. const MachineFunction &MF = *MBB.getParent(); const MachineFrameInfo &MFI = MF.getFrameInfo(); if (MFI.isCalleeSavedInfoValid()) { @@ -225,15 +229,8 @@ void LivePhysRegs::addLiveOutsNoPristines(const Machin void LivePhysRegs::addLiveOuts(const MachineBasicBlock &MBB) { const MachineFunction &MF = *MBB.getParent(); - if (!MBB.succ_empty()) { - addPristines(MF); - addLiveOutsNoPristines(MBB); - } else if (MBB.isReturnBlock()) { - // For the return block: Add all callee saved registers. - const MachineFrameInfo &MFI = MF.getFrameInfo(); - if (MFI.isCalleeSavedInfoValid()) - addCalleeSavedRegs(*this, MF); - } + addPristines(MF); + addLiveOutsNoPristines(MBB); } void LivePhysRegs::addLiveIns(const MachineBasicBlock &MBB) { Modified: vendor/llvm/dist-release_60/lib/CodeGen/SelectionDAG/DAGCombiner.cpp ============================================================================== --- vendor/llvm/dist-release_60/lib/CodeGen/SelectionDAG/DAGCombiner.cpp Fri Feb 16 18:50:06 2018 (r329393) +++ vendor/llvm/dist-release_60/lib/CodeGen/SelectionDAG/DAGCombiner.cpp Fri Feb 16 19:10:15 2018 (r329394) @@ -16409,7 +16409,9 @@ SDValue DAGCombiner::visitINSERT_SUBVECTOR(SDNode *N) N1.getOperand(0).getOpcode() == ISD::EXTRACT_SUBVECTOR && N1.getOperand(0).getOperand(1) == N2 && N1.getOperand(0).getOperand(0).getValueType().getVectorNumElements() == - VT.getVectorNumElements()) { + VT.getVectorNumElements() && + N1.getOperand(0).getOperand(0).getValueType().getSizeInBits() == + VT.getSizeInBits()) { return DAG.getBitcast(VT, N1.getOperand(0).getOperand(0)); } Modified: vendor/llvm/dist-release_60/lib/CodeGen/SplitKit.cpp ============================================================================== --- vendor/llvm/dist-release_60/lib/CodeGen/SplitKit.cpp Fri Feb 16 18:50:06 2018 (r329393) +++ vendor/llvm/dist-release_60/lib/CodeGen/SplitKit.cpp Fri Feb 16 19:10:15 2018 (r329394) @@ -491,9 +491,8 @@ VNInfo *SplitEditor::defValue(unsigned RegIdx, return VNI; } -void SplitEditor::forceRecompute(unsigned RegIdx, const VNInfo *ParentVNI) { - assert(ParentVNI && "Mapping NULL value"); - ValueForcePair &VFP = Values[std::make_pair(RegIdx, ParentVNI->id)]; +void SplitEditor::forceRecompute(unsigned RegIdx, const VNInfo &ParentVNI) { + ValueForcePair &VFP = Values[std::make_pair(RegIdx, ParentVNI.id)]; VNInfo *VNI = VFP.getPointer(); // ParentVNI was either unmapped or already complex mapped. Either way, just @@ -777,7 +776,7 @@ SlotIndex SplitEditor::leaveIntvAfter(SlotIndex Idx) { // the source live range. The spiller also won't try to hoist this copy. if (SpillMode && !SlotIndex::isSameInstr(ParentVNI->def, Idx) && MI->readsVirtualRegister(Edit->getReg())) { - forceRecompute(0, ParentVNI); + forceRecompute(0, *ParentVNI); defFromParent(0, ParentVNI, Idx, *MI->getParent(), MI); return Idx; } @@ -835,7 +834,7 @@ void SplitEditor::overlapIntv(SlotIndex Start, SlotInd // The complement interval will be extended as needed by LRCalc.extend(). if (ParentVNI) - forceRecompute(0, ParentVNI); + forceRecompute(0, *ParentVNI); DEBUG(dbgs() << " overlapIntv [" << Start << ';' << End << "):"); RegAssign.insert(Start, End, OpenIdx); DEBUG(dump()); @@ -878,7 +877,7 @@ void SplitEditor::removeBackCopies(SmallVectorImplreadsVirtualRegister(Edit->getReg())) { DEBUG(dbgs() << " cannot find simple kill of RegIdx " << RegIdx << '\n'); - forceRecompute(RegIdx, Edit->getParent().getVNInfoAt(Def)); + forceRecompute(RegIdx, *Edit->getParent().getVNInfoAt(Def)); } else { SlotIndex Kill = LIS.getInstructionIndex(*MBBI).getRegSlot(); DEBUG(dbgs() << " move kill to " << Kill << '\t' << *MBBI); @@ -982,7 +981,7 @@ void SplitEditor::computeRedundantBackCopies( } } if (!DominatedVNIs.empty()) { - forceRecompute(0, ParentVNI); + forceRecompute(0, *ParentVNI); for (auto VNI : DominatedVNIs) { BackCopies.push_back(VNI); } @@ -1102,7 +1101,7 @@ void SplitEditor::hoistCopies() { NotToHoistSet.count(ParentVNI->id)) continue; BackCopies.push_back(VNI); - forceRecompute(0, ParentVNI); + forceRecompute(0, *ParentVNI); } // If it is not beneficial to hoist all the BackCopies, simply remove @@ -1428,6 +1427,41 @@ void SplitEditor::deleteRematVictims() { Edit->eliminateDeadDefs(Dead, None, &AA); } +void SplitEditor::forceRecomputeVNI(const VNInfo &ParentVNI) { + // Fast-path for common case. + if (!ParentVNI.isPHIDef()) { + for (unsigned I = 0, E = Edit->size(); I != E; ++I) + forceRecompute(I, ParentVNI); + return; + } + + // Trace value through phis. + SmallPtrSet Visited; ///< whether VNI was/is in worklist. + SmallVector WorkList; + Visited.insert(&ParentVNI); + WorkList.push_back(&ParentVNI); + + const LiveInterval &ParentLI = Edit->getParent(); + const SlotIndexes &Indexes = *LIS.getSlotIndexes(); + do { + const VNInfo &VNI = *WorkList.back(); + WorkList.pop_back(); + for (unsigned I = 0, E = Edit->size(); I != E; ++I) + forceRecompute(I, VNI); + if (!VNI.isPHIDef()) + continue; + + MachineBasicBlock &MBB = *Indexes.getMBBFromIndex(VNI.def); + for (const MachineBasicBlock *Pred : MBB.predecessors()) { + SlotIndex PredEnd = Indexes.getMBBEndIdx(Pred); + VNInfo *PredVNI = ParentLI.getVNInfoBefore(PredEnd); + assert(PredVNI && "Value available in PhiVNI predecessor"); + if (Visited.insert(PredVNI).second) + WorkList.push_back(PredVNI); + } + } while(!WorkList.empty()); +} + void SplitEditor::finish(SmallVectorImpl *LRMap) { ++NumFinished; @@ -1444,8 +1478,7 @@ void SplitEditor::finish(SmallVectorImpl *LR // Force rematted values to be recomputed everywhere. // The new live ranges may be truncated. if (Edit->didRematerialize(ParentVNI)) - for (unsigned i = 0, e = Edit->size(); i != e; ++i) - forceRecompute(i, ParentVNI); + forceRecomputeVNI(*ParentVNI); } // Hoist back-copies to the complement interval when in spill mode. Modified: vendor/llvm/dist-release_60/lib/CodeGen/SplitKit.h ============================================================================== --- vendor/llvm/dist-release_60/lib/CodeGen/SplitKit.h Fri Feb 16 18:50:06 2018 (r329393) +++ vendor/llvm/dist-release_60/lib/CodeGen/SplitKit.h Fri Feb 16 19:10:15 2018 (r329394) @@ -357,7 +357,11 @@ class LLVM_LIBRARY_VISIBILITY SplitEditor { (private) /// recomputed by LiveRangeCalc::extend regardless of the number of defs. /// This is used for values whose live range doesn't match RegAssign exactly. /// They could have rematerialized, or back-copies may have been moved. - void forceRecompute(unsigned RegIdx, const VNInfo *ParentVNI); + void forceRecompute(unsigned RegIdx, const VNInfo &ParentVNI); + + /// Calls forceRecompute() on any affected regidx and on ParentVNI + /// predecessors in case of a phi definition. + void forceRecomputeVNI(const VNInfo &ParentVNI); /// defFromParent - Define Reg from ParentVNI at UseIdx using either /// rematerialization or a COPY from parent. Return the new value. Modified: vendor/llvm/dist-release_60/lib/IR/AutoUpgrade.cpp ============================================================================== --- vendor/llvm/dist-release_60/lib/IR/AutoUpgrade.cpp Fri Feb 16 18:50:06 2018 (r329393) +++ vendor/llvm/dist-release_60/lib/IR/AutoUpgrade.cpp Fri Feb 16 19:10:15 2018 (r329394) @@ -75,7 +75,6 @@ static bool ShouldUpgradeX86Intrinsic(Function *F, Str Name=="ssse3.pabs.d.128" || // Added in 6.0 Name.startswith("avx512.mask.shuf.i") || // Added in 6.0 Name.startswith("avx512.mask.shuf.f") || // Added in 6.0 - Name.startswith("avx512.kunpck") || //added in 6.0 Name.startswith("avx2.pabs.") || // Added in 6.0 Name.startswith("avx512.mask.pabs.") || // Added in 6.0 Name.startswith("avx512.broadcastm") || // Added in 6.0 @@ -1063,12 +1062,6 @@ void llvm::UpgradeIntrinsicCall(CallInst *CI, Function Rep = Builder.CreateVectorSplat(NumElts, CI->getArgOperand(0)); Rep = EmitX86Select(Builder, CI->getArgOperand(2), Rep, CI->getArgOperand(1)); - } else if (IsX86 && (Name.startswith("avx512.kunpck"))) { - uint64_t Shift = CI->getType()->getScalarSizeInBits() / 2; - uint64_t And = (1ULL << Shift) - 1; - Value* LowBits = Builder.CreateAnd(CI->getArgOperand(0), And); - Value* HighBits = Builder.CreateShl(CI->getArgOperand(1), Shift); - Rep = Builder.CreateOr(LowBits, HighBits); } else if (IsX86 && (Name == "sse.add.ss" || Name == "sse2.add.sd")) { Type *I32Ty = Type::getInt32Ty(C); Value *Elt0 = Builder.CreateExtractElement(CI->getArgOperand(0), Modified: vendor/llvm/dist-release_60/lib/MC/MCParser/AsmParser.cpp ============================================================================== --- vendor/llvm/dist-release_60/lib/MC/MCParser/AsmParser.cpp Fri Feb 16 18:50:06 2018 (r329393) +++ vendor/llvm/dist-release_60/lib/MC/MCParser/AsmParser.cpp Fri Feb 16 19:10:15 2018 (r329394) @@ -83,27 +83,6 @@ namespace { typedef std::vector MCAsmMacroArgument; typedef std::vector MCAsmMacroArguments; -struct MCAsmMacroParameter { - StringRef Name; - MCAsmMacroArgument Value; - bool Required = false; - bool Vararg = false; - - MCAsmMacroParameter() = default; -}; - -typedef std::vector MCAsmMacroParameters; - -struct MCAsmMacro { - StringRef Name; - StringRef Body; - MCAsmMacroParameters Parameters; - -public: - MCAsmMacro(StringRef N, StringRef B, MCAsmMacroParameters P) - : Name(N), Body(B), Parameters(std::move(P)) {} -}; - /// \brief Helper class for storing information about an active macro /// instantiation. struct MacroInstantiation { @@ -164,9 +143,6 @@ class AsmParser : public MCAsmParser { (private) /// addDirectiveHandler. StringMap ExtensionDirectiveMap; - /// \brief Map of currently defined macros. - StringMap MacroMap; - /// \brief Stack of active macro instantiations. std::vector ActiveMacros; @@ -308,17 +284,6 @@ class AsmParser : public MCAsmParser { (private) /// \brief Control a flag in the parser that enables or disables macros. void setMacrosEnabled(bool Flag) {MacrosEnabledFlag = Flag;} - /// \brief Lookup a previously defined macro. - /// \param Name Macro name. - /// \returns Pointer to macro. NULL if no such macro was defined. - const MCAsmMacro* lookupMacro(StringRef Name); - - /// \brief Define a new macro with the given name and information. - void defineMacro(StringRef Name, MCAsmMacro Macro); - - /// \brief Undefine a macro. If no such macro was defined, it's a no-op. - void undefineMacro(StringRef Name); - /// \brief Are we inside a macro instantiation? bool isInsideMacroInstantiation() {return !ActiveMacros.empty();} @@ -1841,7 +1806,7 @@ bool AsmParser::parseStatement(ParseStatementInfo &Inf // If macros are enabled, check to see if this is a macro instantiation. if (areMacrosEnabled()) - if (const MCAsmMacro *M = lookupMacro(IDVal)) { + if (const MCAsmMacro *M = getContext().lookupMacro(IDVal)) { return handleMacroEntry(M, IDLoc); } @@ -2720,17 +2685,6 @@ bool AsmParser::parseMacroArguments(const MCAsmMacro * return TokError("too many positional arguments"); } -const MCAsmMacro *AsmParser::lookupMacro(StringRef Name) { - StringMap::iterator I = MacroMap.find(Name); - return (I == MacroMap.end()) ? nullptr : &I->getValue(); -} - -void AsmParser::defineMacro(StringRef Name, MCAsmMacro Macro) { - MacroMap.insert(std::make_pair(Name, std::move(Macro))); -} - -void AsmParser::undefineMacro(StringRef Name) { MacroMap.erase(Name); } - bool AsmParser::handleMacroEntry(const MCAsmMacro *M, SMLoc NameLoc) { // Arbitrarily limit macro nesting depth (default matches 'as'). We can // eliminate this, although we should protect against infinite loops. @@ -4249,7 +4203,7 @@ bool AsmParser::parseDirectiveMacro(SMLoc DirectiveLoc eatToEndOfStatement(); } - if (lookupMacro(Name)) { + if (getContext().lookupMacro(Name)) { return Error(DirectiveLoc, "macro '" + Name + "' is already defined"); } @@ -4257,7 +4211,7 @@ bool AsmParser::parseDirectiveMacro(SMLoc DirectiveLoc const char *BodyEnd = EndToken.getLoc().getPointer(); StringRef Body = StringRef(BodyStart, BodyEnd - BodyStart); checkForBadMacro(DirectiveLoc, Name, Body, Parameters); - defineMacro(Name, MCAsmMacro(Name, Body, std::move(Parameters))); + getContext().defineMacro(Name, MCAsmMacro(Name, Body, std::move(Parameters))); return false; } @@ -4416,10 +4370,10 @@ bool AsmParser::parseDirectivePurgeMacro(SMLoc Directi "unexpected token in '.purgem' directive")) return true; - if (!lookupMacro(Name)) + if (!getContext().lookupMacro(Name)) return Error(DirectiveLoc, "macro '" + Name + "' is not defined"); - undefineMacro(Name); + getContext().undefineMacro(Name); return false; } Modified: vendor/llvm/dist-release_60/lib/Target/AMDGPU/AMDGPUISelLowering.cpp ============================================================================== --- vendor/llvm/dist-release_60/lib/Target/AMDGPU/AMDGPUISelLowering.cpp Fri Feb 16 18:50:06 2018 (r329393) +++ vendor/llvm/dist-release_60/lib/Target/AMDGPU/AMDGPUISelLowering.cpp Fri Feb 16 19:10:15 2018 (r329394) @@ -3957,6 +3957,10 @@ const char* AMDGPUTargetLowering::getTargetNodeName(un NODE_NAME_CASE(CVT_F32_UBYTE2) NODE_NAME_CASE(CVT_F32_UBYTE3) NODE_NAME_CASE(CVT_PKRTZ_F16_F32) + NODE_NAME_CASE(CVT_PKNORM_I16_F32) + NODE_NAME_CASE(CVT_PKNORM_U16_F32) + NODE_NAME_CASE(CVT_PK_I16_I32) + NODE_NAME_CASE(CVT_PK_U16_U32) NODE_NAME_CASE(FP_TO_FP16) NODE_NAME_CASE(FP16_ZEXT) NODE_NAME_CASE(BUILD_VERTICAL_VECTOR) Modified: vendor/llvm/dist-release_60/lib/Target/AMDGPU/AMDGPUISelLowering.h ============================================================================== --- vendor/llvm/dist-release_60/lib/Target/AMDGPU/AMDGPUISelLowering.h Fri Feb 16 18:50:06 2018 (r329393) +++ vendor/llvm/dist-release_60/lib/Target/AMDGPU/AMDGPUISelLowering.h Fri Feb 16 19:10:15 2018 (r329394) @@ -417,6 +417,10 @@ enum NodeType : unsigned { // Convert two float 32 numbers into a single register holding two packed f16 // with round to zero. CVT_PKRTZ_F16_F32, + CVT_PKNORM_I16_F32, + CVT_PKNORM_U16_F32, + CVT_PK_I16_I32, + CVT_PK_U16_U32, // Same as the standard node, except the high bits of the resulting integer // are known 0. Modified: vendor/llvm/dist-release_60/lib/Target/AMDGPU/AMDGPUInstrInfo.cpp ============================================================================== --- vendor/llvm/dist-release_60/lib/Target/AMDGPU/AMDGPUInstrInfo.cpp Fri Feb 16 18:50:06 2018 (r329393) +++ vendor/llvm/dist-release_60/lib/Target/AMDGPU/AMDGPUInstrInfo.cpp Fri Feb 16 19:10:15 2018 (r329394) @@ -108,3 +108,21 @@ int AMDGPUInstrInfo::pseudoToMCOpcode(int Opcode) cons return MCOp; } + +// TODO: Should largely merge with AMDGPUTTIImpl::isSourceOfDivergence. +bool AMDGPUInstrInfo::isUniformMMO(const MachineMemOperand *MMO) { + const Value *Ptr = MMO->getValue(); + // UndefValue means this is a load of a kernel input. These are uniform. + // Sometimes LDS instructions have constant pointers. + // If Ptr is null, then that means this mem operand contains a + // PseudoSourceValue like GOT. + if (!Ptr || isa(Ptr) || + isa(Ptr) || isa(Ptr)) + return true; + + if (const Argument *Arg = dyn_cast(Ptr)) + return AMDGPU::isArgPassedInSGPR(Arg); + + const Instruction *I = dyn_cast(Ptr); + return I && I->getMetadata("amdgpu.uniform"); +} Modified: vendor/llvm/dist-release_60/lib/Target/AMDGPU/AMDGPUInstrInfo.h ============================================================================== --- vendor/llvm/dist-release_60/lib/Target/AMDGPU/AMDGPUInstrInfo.h Fri Feb 16 18:50:06 2018 (r329393) +++ vendor/llvm/dist-release_60/lib/Target/AMDGPU/AMDGPUInstrInfo.h Fri Feb 16 19:10:15 2018 (r329394) @@ -50,6 +50,8 @@ class AMDGPUInstrInfo : public AMDGPUGenInstrInfo { (p /// Return -1 if the target-specific opcode for the pseudo instruction does /// not exist. If Opcode is not a pseudo instruction, this is identity. int pseudoToMCOpcode(int Opcode) const; + + static bool isUniformMMO(const MachineMemOperand *MMO); }; } // End llvm namespace Modified: vendor/llvm/dist-release_60/lib/Target/AMDGPU/AMDGPUInstrInfo.td ============================================================================== --- vendor/llvm/dist-release_60/lib/Target/AMDGPU/AMDGPUInstrInfo.td Fri Feb 16 18:50:06 2018 (r329393) +++ vendor/llvm/dist-release_60/lib/Target/AMDGPU/AMDGPUInstrInfo.td Fri Feb 16 19:10:15 2018 (r329394) @@ -35,6 +35,10 @@ def AMDGPUFPPackOp : SDTypeProfile<1, 2, [SDTCisFP<1>, SDTCisSameAs<1, 2>] >; +def AMDGPUIntPackOp : SDTypeProfile<1, 2, + [SDTCisInt<1>, SDTCisSameAs<1, 2>] +>; + def AMDGPUDivScaleOp : SDTypeProfile<2, 3, [SDTCisFP<0>, SDTCisInt<1>, SDTCisSameAs<0, 2>, SDTCisSameAs<0, 3>, SDTCisSameAs<0, 4>] >; @@ -142,6 +146,10 @@ def AMDGPUrsq_clamp : SDNode<"AMDGPUISD::RSQ_CLAMP", S def AMDGPUldexp : SDNode<"AMDGPUISD::LDEXP", AMDGPULdExpOp>; def AMDGPUpkrtz_f16_f32 : SDNode<"AMDGPUISD::CVT_PKRTZ_F16_F32", AMDGPUFPPackOp>; +def AMDGPUpknorm_i16_f32 : SDNode<"AMDGPUISD::CVT_PKNORM_I16_F32", AMDGPUFPPackOp>; +def AMDGPUpknorm_u16_f32 : SDNode<"AMDGPUISD::CVT_PKNORM_U16_F32", AMDGPUFPPackOp>; +def AMDGPUpk_i16_i32 : SDNode<"AMDGPUISD::CVT_PK_I16_I32", AMDGPUIntPackOp>; +def AMDGPUpk_u16_u32 : SDNode<"AMDGPUISD::CVT_PK_U16_U32", AMDGPUIntPackOp>; def AMDGPUfp_to_f16 : SDNode<"AMDGPUISD::FP_TO_FP16" , SDTFPToIntOp>; def AMDGPUfp16_zext : SDNode<"AMDGPUISD::FP16_ZEXT" , SDTFPToIntOp>; Modified: vendor/llvm/dist-release_60/lib/Target/AMDGPU/AMDGPURegisterBankInfo.cpp ============================================================================== --- vendor/llvm/dist-release_60/lib/Target/AMDGPU/AMDGPURegisterBankInfo.cpp Fri Feb 16 18:50:06 2018 (r329393) +++ vendor/llvm/dist-release_60/lib/Target/AMDGPU/AMDGPURegisterBankInfo.cpp Fri Feb 16 19:10:15 2018 (r329394) @@ -120,7 +120,7 @@ static bool isInstrUniform(const MachineInstr &MI) { return false; const MachineMemOperand *MMO = *MI.memoperands_begin(); - return AMDGPU::isUniformMMO(MMO); + return AMDGPUInstrInfo::isUniformMMO(MMO); } const RegisterBankInfo::InstructionMapping & Modified: vendor/llvm/dist-release_60/lib/Target/AMDGPU/SIISelLowering.cpp ============================================================================== --- vendor/llvm/dist-release_60/lib/Target/AMDGPU/SIISelLowering.cpp Fri Feb 16 18:50:06 2018 (r329393) +++ vendor/llvm/dist-release_60/lib/Target/AMDGPU/SIISelLowering.cpp Fri Feb 16 19:10:15 2018 (r329394) @@ -205,6 +205,7 @@ SITargetLowering::SITargetLowering(const TargetMachine setOperationAction(ISD::INTRINSIC_WO_CHAIN, MVT::Other, Custom); setOperationAction(ISD::INTRINSIC_WO_CHAIN, MVT::f32, Custom); setOperationAction(ISD::INTRINSIC_WO_CHAIN, MVT::v4f32, Custom); + setOperationAction(ISD::INTRINSIC_WO_CHAIN, MVT::v2i16, Custom); setOperationAction(ISD::INTRINSIC_WO_CHAIN, MVT::v2f16, Custom); setOperationAction(ISD::INTRINSIC_W_CHAIN, MVT::Other, Custom); @@ -1085,7 +1086,7 @@ bool SITargetLowering::isCheapAddrSpaceCast(unsigned S bool SITargetLowering::isMemOpUniform(const SDNode *N) const { const MemSDNode *MemNode = cast(N); - return AMDGPU::isUniformMMO(MemNode->getMemOperand()); + return AMDGPUInstrInfo::isUniformMMO(MemNode->getMemOperand()); } TargetLoweringBase::LegalizeTypeAction @@ -3517,7 +3518,8 @@ void SITargetLowering::ReplaceNodeResults(SDNode *N, } case ISD::INTRINSIC_WO_CHAIN: { unsigned IID = cast(N->getOperand(0))->getZExtValue(); - if (IID == Intrinsic::amdgcn_cvt_pkrtz) { + switch (IID) { + case Intrinsic::amdgcn_cvt_pkrtz: { SDValue Src0 = N->getOperand(1); SDValue Src1 = N->getOperand(2); SDLoc SL(N); @@ -3526,6 +3528,29 @@ void SITargetLowering::ReplaceNodeResults(SDNode *N, Results.push_back(DAG.getNode(ISD::BITCAST, SL, MVT::v2f16, Cvt)); return; } + case Intrinsic::amdgcn_cvt_pknorm_i16: + case Intrinsic::amdgcn_cvt_pknorm_u16: + case Intrinsic::amdgcn_cvt_pk_i16: + case Intrinsic::amdgcn_cvt_pk_u16: { + SDValue Src0 = N->getOperand(1); + SDValue Src1 = N->getOperand(2); + SDLoc SL(N); + unsigned Opcode; + + if (IID == Intrinsic::amdgcn_cvt_pknorm_i16) + Opcode = AMDGPUISD::CVT_PKNORM_I16_F32; + else if (IID == Intrinsic::amdgcn_cvt_pknorm_u16) + Opcode = AMDGPUISD::CVT_PKNORM_U16_F32; + else if (IID == Intrinsic::amdgcn_cvt_pk_i16) + Opcode = AMDGPUISD::CVT_PK_I16_I32; + else + Opcode = AMDGPUISD::CVT_PK_U16_U32; + + SDValue Cvt = DAG.getNode(Opcode, SL, MVT::i32, Src0, Src1); + Results.push_back(DAG.getNode(ISD::BITCAST, SL, MVT::v2i16, Cvt)); + return; + } + } break; } case ISD::SELECT: { @@ -4424,10 +4449,27 @@ SDValue SITargetLowering::LowerINTRINSIC_WO_CHAIN(SDVa case Intrinsic::amdgcn_ubfe: return DAG.getNode(AMDGPUISD::BFE_U32, DL, VT, Op.getOperand(1), Op.getOperand(2), Op.getOperand(3)); - case Intrinsic::amdgcn_cvt_pkrtz: { - // FIXME: Stop adding cast if v2f16 legal. + case Intrinsic::amdgcn_cvt_pkrtz: + case Intrinsic::amdgcn_cvt_pknorm_i16: + case Intrinsic::amdgcn_cvt_pknorm_u16: + case Intrinsic::amdgcn_cvt_pk_i16: + case Intrinsic::amdgcn_cvt_pk_u16: { + // FIXME: Stop adding cast if v2f16/v2i16 are legal. EVT VT = Op.getValueType(); - SDValue Node = DAG.getNode(AMDGPUISD::CVT_PKRTZ_F16_F32, DL, MVT::i32, + unsigned Opcode; + + if (IntrinsicID == Intrinsic::amdgcn_cvt_pkrtz) + Opcode = AMDGPUISD::CVT_PKRTZ_F16_F32; + else if (IntrinsicID == Intrinsic::amdgcn_cvt_pknorm_i16) + Opcode = AMDGPUISD::CVT_PKNORM_I16_F32; + else if (IntrinsicID == Intrinsic::amdgcn_cvt_pknorm_u16) + Opcode = AMDGPUISD::CVT_PKNORM_U16_F32; + else if (IntrinsicID == Intrinsic::amdgcn_cvt_pk_i16) + Opcode = AMDGPUISD::CVT_PK_I16_I32; + else + Opcode = AMDGPUISD::CVT_PK_U16_U32; + + SDValue Node = DAG.getNode(Opcode, DL, MVT::i32, Op.getOperand(1), Op.getOperand(2)); return DAG.getNode(ISD::BITCAST, DL, VT, Node); } Modified: vendor/llvm/dist-release_60/lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.cpp ============================================================================== --- vendor/llvm/dist-release_60/lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.cpp Fri Feb 16 18:50:06 2018 (r329393) +++ vendor/llvm/dist-release_60/lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.cpp Fri Feb 16 19:10:15 2018 (r329394) @@ -871,24 +871,6 @@ bool isArgPassedInSGPR(const Argument *A) { } } -// TODO: Should largely merge with AMDGPUTTIImpl::isSourceOfDivergence. -bool isUniformMMO(const MachineMemOperand *MMO) { - const Value *Ptr = MMO->getValue(); - // UndefValue means this is a load of a kernel input. These are uniform. - // Sometimes LDS instructions have constant pointers. - // If Ptr is null, then that means this mem operand contains a - // PseudoSourceValue like GOT. - if (!Ptr || isa(Ptr) || - isa(Ptr) || isa(Ptr)) - return true; - - if (const Argument *Arg = dyn_cast(Ptr)) - return isArgPassedInSGPR(Arg); - - const Instruction *I = dyn_cast(Ptr); - return I && I->getMetadata("amdgpu.uniform"); -} - int64_t getSMRDEncodedOffset(const MCSubtargetInfo &ST, int64_t ByteOffset) { if (isGCN3Encoding(ST)) return ByteOffset; Modified: vendor/llvm/dist-release_60/lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.h ============================================================================== --- vendor/llvm/dist-release_60/lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.h Fri Feb 16 18:50:06 2018 (r329393) +++ vendor/llvm/dist-release_60/lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.h Fri Feb 16 19:10:15 2018 (r329394) @@ -363,7 +363,6 @@ LLVM_READNONE bool isInlinableLiteralV216(int32_t Literal, bool HasInv2Pi); bool isArgPassedInSGPR(const Argument *Arg); -bool isUniformMMO(const MachineMemOperand *MMO); /// \returns The encoding that will be used for \p ByteOffset in the SMRD /// offset field. Modified: vendor/llvm/dist-release_60/lib/Target/AMDGPU/VOP2Instructions.td ============================================================================== --- vendor/llvm/dist-release_60/lib/Target/AMDGPU/VOP2Instructions.td Fri Feb 16 18:50:06 2018 (r329393) +++ vendor/llvm/dist-release_60/lib/Target/AMDGPU/VOP2Instructions.td Fri Feb 16 19:10:15 2018 (r329394) @@ -407,11 +407,11 @@ defm V_MBCNT_LO_U32_B32 : VOP2Inst <"v_mbcnt_lo_u32_b3 defm V_MBCNT_HI_U32_B32 : VOP2Inst <"v_mbcnt_hi_u32_b32", VOP_NO_EXT, int_amdgcn_mbcnt_hi>; defm V_LDEXP_F32 : VOP2Inst <"v_ldexp_f32", VOP_NO_EXT, AMDGPUldexp>; defm V_CVT_PKACCUM_U8_F32 : VOP2Inst <"v_cvt_pkaccum_u8_f32", VOP_NO_EXT>; // TODO: set "Uses = dst" -defm V_CVT_PKNORM_I16_F32 : VOP2Inst <"v_cvt_pknorm_i16_f32", VOP_NO_EXT>; -defm V_CVT_PKNORM_U16_F32 : VOP2Inst <"v_cvt_pknorm_u16_f32", VOP_NO_EXT>; +defm V_CVT_PKNORM_I16_F32 : VOP2Inst <"v_cvt_pknorm_i16_f32", VOP_NO_EXT, AMDGPUpknorm_i16_f32>; +defm V_CVT_PKNORM_U16_F32 : VOP2Inst <"v_cvt_pknorm_u16_f32", VOP_NO_EXT, AMDGPUpknorm_u16_f32>; defm V_CVT_PKRTZ_F16_F32 : VOP2Inst <"v_cvt_pkrtz_f16_f32", VOP_NO_EXT, AMDGPUpkrtz_f16_f32>; -defm V_CVT_PK_U16_U32 : VOP2Inst <"v_cvt_pk_u16_u32", VOP_NO_EXT>; -defm V_CVT_PK_I16_I32 : VOP2Inst <"v_cvt_pk_i16_i32", VOP_NO_EXT>; +defm V_CVT_PK_U16_U32 : VOP2Inst <"v_cvt_pk_u16_u32", VOP_NO_EXT, AMDGPUpk_u16_u32>; +defm V_CVT_PK_I16_I32 : VOP2Inst <"v_cvt_pk_i16_i32", VOP_NO_EXT, AMDGPUpk_i16_i32>; } // End SubtargetPredicate = isGCN Modified: vendor/llvm/dist-release_60/lib/Target/X86/MCTargetDesc/X86MCCodeEmitter.cpp ============================================================================== --- vendor/llvm/dist-release_60/lib/Target/X86/MCTargetDesc/X86MCCodeEmitter.cpp Fri Feb 16 18:50:06 2018 (r329393) +++ vendor/llvm/dist-release_60/lib/Target/X86/MCTargetDesc/X86MCCodeEmitter.cpp Fri Feb 16 19:10:15 2018 (r329394) @@ -396,10 +396,14 @@ void X86MCCodeEmitter::emitMemModRMByte(const MCInst & // rip-relative addressing is actually relative to the *next* instruction. // Since an immediate can follow the mod/rm byte for an instruction, this - // means that we need to bias the immediate field of the instruction with - // the size of the immediate field. If we have this case, add it into the + // means that we need to bias the displacement field of the instruction with + // the size of the immediate field. If we have this case, add it into the // expression to emit. - int ImmSize = X86II::hasImm(TSFlags) ? X86II::getSizeOfImm(TSFlags) : 0; + // Note: rip-relative addressing using immediate displacement values should + // not be adjusted, assuming it was the user's intent. + int ImmSize = !Disp.isImm() && X86II::hasImm(TSFlags) + ? X86II::getSizeOfImm(TSFlags) + : 0; EmitImmediate(Disp, MI.getLoc(), 4, MCFixupKind(FixupKind), CurByte, OS, Fixups, -ImmSize); Modified: vendor/llvm/dist-release_60/lib/Target/X86/X86AsmPrinter.cpp ============================================================================== --- vendor/llvm/dist-release_60/lib/Target/X86/X86AsmPrinter.cpp Fri Feb 16 18:50:06 2018 (r329393) +++ vendor/llvm/dist-release_60/lib/Target/X86/X86AsmPrinter.cpp Fri Feb 16 19:10:15 2018 (r329394) @@ -370,6 +370,8 @@ static void printIntelMemReference(X86AsmPrinter &P, c static bool printAsmMRegister(X86AsmPrinter &P, const MachineOperand &MO, char Mode, raw_ostream &O) { unsigned Reg = MO.getReg(); + bool EmitPercent = true; + switch (Mode) { default: return true; // Unknown mode. case 'b': // Print QImode register @@ -384,6 +386,9 @@ static bool printAsmMRegister(X86AsmPrinter &P, const case 'k': // Print SImode register Reg = getX86SubSuperRegister(Reg, 32); break; + case 'V': + EmitPercent = false; + LLVM_FALLTHROUGH; case 'q': // Print 64-bit register names if 64-bit integer registers are available. // Otherwise, print 32-bit register names. @@ -391,7 +396,10 @@ static bool printAsmMRegister(X86AsmPrinter &P, const break; } - O << '%' << X86ATTInstPrinter::getRegisterName(Reg); + if (EmitPercent) + O << '%'; + + O << X86ATTInstPrinter::getRegisterName(Reg); return false; } @@ -464,6 +472,7 @@ bool X86AsmPrinter::PrintAsmOperand(const MachineInstr case 'w': // Print HImode register case 'k': // Print SImode register case 'q': // Print DImode register + case 'V': // Print native register without '%' if (MO.isReg()) return printAsmMRegister(*this, MO, ExtraCode[0], O); printOperand(*this, MI, OpNo, O); Modified: vendor/llvm/dist-release_60/lib/Target/X86/X86DomainReassignment.cpp ============================================================================== --- vendor/llvm/dist-release_60/lib/Target/X86/X86DomainReassignment.cpp Fri Feb 16 18:50:06 2018 (r329393) +++ vendor/llvm/dist-release_60/lib/Target/X86/X86DomainReassignment.cpp Fri Feb 16 19:10:15 2018 (r329394) @@ -663,8 +663,10 @@ void X86DomainReassignment::initConverters() { createReplacer(X86::XOR32rr, X86::KXORDrr); createReplacer(X86::XOR64rr, X86::KXORQrr); - createReplacer(X86::TEST32rr, X86::KTESTDrr); - createReplacer(X86::TEST64rr, X86::KTESTQrr); + // TODO: KTEST is not a replacement for TEST due to flag differences. Need + // to prove only Z flag is used. + //createReplacer(X86::TEST32rr, X86::KTESTDrr); + //createReplacer(X86::TEST64rr, X86::KTESTQrr); } if (STI->hasDQI()) { @@ -684,8 +686,10 @@ void X86DomainReassignment::initConverters() { createReplacer(X86::SHR8ri, X86::KSHIFTRBri); createReplacer(X86::SHL8ri, X86::KSHIFTLBri); - createReplacer(X86::TEST8rr, X86::KTESTBrr); - createReplacer(X86::TEST16rr, X86::KTESTWrr); + // TODO: KTEST is not a replacement for TEST due to flag differences. Need + // to prove only Z flag is used. + //createReplacer(X86::TEST8rr, X86::KTESTBrr); + //createReplacer(X86::TEST16rr, X86::KTESTWrr); createReplacer(X86::XOR8rr, X86::KXORBrr); } Modified: vendor/llvm/dist-release_60/lib/Target/X86/X86ISelLowering.cpp ============================================================================== --- vendor/llvm/dist-release_60/lib/Target/X86/X86ISelLowering.cpp Fri Feb 16 18:50:06 2018 (r329393) +++ vendor/llvm/dist-release_60/lib/Target/X86/X86ISelLowering.cpp Fri Feb 16 19:10:15 2018 (r329394) @@ -17017,24 +17017,6 @@ static bool hasNonFlagsUse(SDValue Op) { return false; } -// Emit KTEST instruction for bit vectors on AVX-512 -static SDValue EmitKTEST(SDValue Op, SelectionDAG &DAG, - const X86Subtarget &Subtarget) { - if (Op.getOpcode() == ISD::BITCAST) { - auto hasKTEST = [&](MVT VT) { - unsigned SizeInBits = VT.getSizeInBits(); - return (Subtarget.hasDQI() && (SizeInBits == 8 || SizeInBits == 16)) || - (Subtarget.hasBWI() && (SizeInBits == 32 || SizeInBits == 64)); - }; - SDValue Op0 = Op.getOperand(0); - MVT Op0VT = Op0.getValueType().getSimpleVT(); - if (Op0VT.isVector() && Op0VT.getVectorElementType() == MVT::i1 && - hasKTEST(Op0VT)) - return DAG.getNode(X86ISD::KTEST, SDLoc(Op), Op0VT, Op0, Op0); - } - return SDValue(); -} - /// Emit nodes that will be selected as "test Op0,Op0", or something /// equivalent. SDValue X86TargetLowering::EmitTest(SDValue Op, unsigned X86CC, const SDLoc &dl, @@ -17079,9 +17061,6 @@ SDValue X86TargetLowering::EmitTest(SDValue Op, unsign // doing a separate TEST. TEST always sets OF and CF to 0, so unless // we prove that the arithmetic won't overflow, we can't use OF or CF. if (Op.getResNo() != 0 || NeedOF || NeedCF) { - // Emit KTEST for bit vectors - if (auto Node = EmitKTEST(Op, DAG, Subtarget)) - return Node; // Emit a CMP with 0, which is the TEST pattern. return DAG.getNode(X86ISD::CMP, dl, MVT::i32, Op, DAG.getConstant(0, dl, Op.getValueType())); @@ -17310,10 +17289,6 @@ SDValue X86TargetLowering::EmitTest(SDValue Op, unsign } if (Opcode == 0) { - // Emit KTEST for bit vectors - if (auto Node = EmitKTEST(Op, DAG, Subtarget)) - return Node; - // Emit a CMP with 0, which is the TEST pattern. return DAG.getNode(X86ISD::CMP, dl, MVT::i32, Op, DAG.getConstant(0, dl, Op.getValueType())); @@ -18093,6 +18068,34 @@ static SDValue LowerVSETCC(SDValue Op, const X86Subtar return Result; } +// Try to select this as a KTEST+SETCC if possible. +static SDValue EmitKTEST(SDValue Op0, SDValue Op1, ISD::CondCode CC, + const SDLoc &dl, SelectionDAG &DAG, + const X86Subtarget &Subtarget) { + // Only support equality comparisons. + if (CC != ISD::SETEQ && CC != ISD::SETNE) + return SDValue(); + + // Must be a bitcast from vXi1. + if (Op0.getOpcode() != ISD::BITCAST) + return SDValue(); + + Op0 = Op0.getOperand(0); + MVT VT = Op0.getSimpleValueType(); + if (!(Subtarget.hasDQI() && (VT == MVT::v8i1 || VT == MVT::v16i1)) && + !(Subtarget.hasBWI() && (VT == MVT::v32i1 || VT == MVT::v64i1))) + return SDValue(); + + X86::CondCode X86CC; + if (isNullConstant(Op1)) { + X86CC = CC == ISD::SETEQ ? X86::COND_E : X86::COND_NE; + } else + return SDValue(); + + SDValue KTEST = DAG.getNode(X86ISD::KTEST, dl, MVT::i32, Op0, Op0); + return getSETCC(X86CC, KTEST, dl, DAG); +} + SDValue X86TargetLowering::LowerSETCC(SDValue Op, SelectionDAG &DAG) const { MVT VT = Op.getSimpleValueType(); @@ -18115,6 +18118,10 @@ SDValue X86TargetLowering::LowerSETCC(SDValue Op, Sele return NewSetCC; } + // Try to lower using KTEST. + if (SDValue NewSetCC = EmitKTEST(Op0, Op1, CC, dl, DAG, Subtarget)) + return NewSetCC; + // Look for X == 0, X == 1, X != 0, or X != 1. We can simplify some forms of // these. *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Fri Feb 16 19:10:25 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 36E5BF095AA; Fri, 16 Feb 2018 19:10:25 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3F66F6C2E1; Fri, 16 Feb 2018 19:10: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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1FEF311BB6; Fri, 16 Feb 2018 19:10: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 w1GJAMPE068957; Fri, 16 Feb 2018 19:10:22 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1GJAMmS068956; Fri, 16 Feb 2018 19:10:22 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201802161910.w1GJAMmS068956@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Fri, 16 Feb 2018 19:10:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r329395 - vendor/llvm/llvm-release_60-r325330 X-SVN-Group: vendor X-SVN-Commit-Author: dim X-SVN-Commit-Paths: vendor/llvm/llvm-release_60-r325330 X-SVN-Commit-Revision: 329395 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Feb 2018 19:10:25 -0000 Author: dim Date: Fri Feb 16 19:10:22 2018 New Revision: 329395 URL: https://svnweb.freebsd.org/changeset/base/329395 Log: Tag llvm release_60 branch r325330. Added: vendor/llvm/llvm-release_60-r325330/ - copied from r329394, vendor/llvm/dist-release_60/ From owner-svn-src-all@freebsd.org Fri Feb 16 19:10:35 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 87D30F095E9; Fri, 16 Feb 2018 19:10:35 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 380F16C429; Fri, 16 Feb 2018 19:10:35 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1AA8011BBD; Fri, 16 Feb 2018 19:10:35 +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 w1GJAYaE069090; Fri, 16 Feb 2018 19:10:34 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1GJAYfZ069089; Fri, 16 Feb 2018 19:10:34 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201802161910.w1GJAYfZ069089@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Fri, 16 Feb 2018 19:10:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r329397 - vendor/clang/clang-release_60-r325330 X-SVN-Group: vendor X-SVN-Commit-Author: dim X-SVN-Commit-Paths: vendor/clang/clang-release_60-r325330 X-SVN-Commit-Revision: 329397 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Feb 2018 19:10:35 -0000 Author: dim Date: Fri Feb 16 19:10:34 2018 New Revision: 329397 URL: https://svnweb.freebsd.org/changeset/base/329397 Log: Tag clang release_60 branch r325330. Added: vendor/clang/clang-release_60-r325330/ - copied from r329396, vendor/clang/dist-release_60/ From owner-svn-src-all@freebsd.org Fri Feb 16 19:10:40 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0B311F0960C; Fri, 16 Feb 2018 19:10:40 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C06876C4AD; Fri, 16 Feb 2018 19:10:37 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 71BD511BBE; Fri, 16 Feb 2018 19:10:37 +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 w1GJAbYN069140; Fri, 16 Feb 2018 19:10:37 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1GJAbwG069139; Fri, 16 Feb 2018 19:10:37 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201802161910.w1GJAbwG069139@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Fri, 16 Feb 2018 19:10:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r329398 - vendor/compiler-rt/dist-release_60/lib/asan X-SVN-Group: vendor X-SVN-Commit-Author: dim X-SVN-Commit-Paths: vendor/compiler-rt/dist-release_60/lib/asan X-SVN-Commit-Revision: 329398 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Feb 2018 19:10:40 -0000 Author: dim Date: Fri Feb 16 19:10:37 2018 New Revision: 329398 URL: https://svnweb.freebsd.org/changeset/base/329398 Log: Vendor import of compiler-rt release_60 branch r325330: https://llvm.org/svn/llvm-project/compiler-rt/branches/release_60@325330 Modified: vendor/compiler-rt/dist-release_60/lib/asan/asan_linux.cc Modified: vendor/compiler-rt/dist-release_60/lib/asan/asan_linux.cc ============================================================================== --- vendor/compiler-rt/dist-release_60/lib/asan/asan_linux.cc Fri Feb 16 19:10:34 2018 (r329397) +++ vendor/compiler-rt/dist-release_60/lib/asan/asan_linux.cc Fri Feb 16 19:10:37 2018 (r329398) @@ -32,6 +32,7 @@ #include #include #include +#include #include #include #include @@ -214,7 +215,7 @@ void AsanCheckIncompatibleRT() { // the functions in dynamic ASan runtime instead of the functions in // system libraries, causing crashes later in ASan initialization. MemoryMappingLayout proc_maps(/*cache_enabled*/true); - char filename[128]; + char filename[PATH_MAX]; MemoryMappedSegment segment(filename, sizeof(filename)); while (proc_maps.Next(&segment)) { if (IsDynamicRTName(segment.filename)) { From owner-svn-src-all@freebsd.org Fri Feb 16 19:10:34 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F173DF095DA; Fri, 16 Feb 2018 19:10:33 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E0EE26C3C8; Fri, 16 Feb 2018 19:10:30 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B8A5C11BB7; Fri, 16 Feb 2018 19:10:30 +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 w1GJAUMU069042; Fri, 16 Feb 2018 19:10:30 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1GJARPf069006; Fri, 16 Feb 2018 19:10:27 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201802161910.w1GJARPf069006@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Fri, 16 Feb 2018 19:10:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r329396 - in vendor/clang/dist-release_60: docs include/clang/AST lib/AST lib/CodeGen lib/Format lib/Headers lib/Lex lib/Sema test/CodeGen test/CodeGenCXX test/Lexer test/Sema test/Sema... X-SVN-Group: vendor X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in vendor/clang/dist-release_60: docs include/clang/AST lib/AST lib/CodeGen lib/Format lib/Headers lib/Lex lib/Sema test/CodeGen test/CodeGenCXX test/Lexer test/Sema test/SemaCXX test/SemaTemplate uni... X-SVN-Commit-Revision: 329396 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Feb 2018 19:10:34 -0000 Author: dim Date: Fri Feb 16 19:10:26 2018 New Revision: 329396 URL: https://svnweb.freebsd.org/changeset/base/329396 Log: Vendor import of clang release_60 branch r325330: https://llvm.org/svn/llvm-project/cfe/branches/release_60@325330 Added: vendor/clang/dist-release_60/test/CodeGenCXX/dllimport-missing-key.cpp (contents, props changed) vendor/clang/dist-release_60/test/CodeGenCXX/microsoft-abi-emit-dependent.cpp (contents, props changed) vendor/clang/dist-release_60/test/CodeGenCXX/msabi-swiftcall-cc.cpp (contents, props changed) vendor/clang/dist-release_60/test/Sema/cxx-as-c.c (contents, props changed) Modified: vendor/clang/dist-release_60/docs/ReleaseNotes.rst vendor/clang/dist-release_60/include/clang/AST/DeclBase.h vendor/clang/dist-release_60/lib/AST/ASTContext.cpp vendor/clang/dist-release_60/lib/AST/DeclBase.cpp vendor/clang/dist-release_60/lib/AST/MicrosoftMangle.cpp vendor/clang/dist-release_60/lib/CodeGen/CodeGenModule.cpp vendor/clang/dist-release_60/lib/CodeGen/ItaniumCXXABI.cpp vendor/clang/dist-release_60/lib/CodeGen/TargetInfo.cpp vendor/clang/dist-release_60/lib/Format/TokenAnnotator.cpp vendor/clang/dist-release_60/lib/Format/UnwrappedLineParser.cpp vendor/clang/dist-release_60/lib/Format/UnwrappedLineParser.h vendor/clang/dist-release_60/lib/Headers/avx512bwintrin.h vendor/clang/dist-release_60/lib/Headers/avx512fintrin.h vendor/clang/dist-release_60/lib/Lex/LiteralSupport.cpp vendor/clang/dist-release_60/lib/Sema/SemaChecking.cpp vendor/clang/dist-release_60/lib/Sema/SemaDecl.cpp vendor/clang/dist-release_60/lib/Sema/SemaInit.cpp vendor/clang/dist-release_60/test/CodeGen/avx512bw-builtins.c vendor/clang/dist-release_60/test/CodeGen/avx512f-builtins.c vendor/clang/dist-release_60/test/CodeGen/ms_abi.c vendor/clang/dist-release_60/test/CodeGenCXX/dllimport-rtti.cpp vendor/clang/dist-release_60/test/Lexer/cxx1y_digit_separators.cpp vendor/clang/dist-release_60/test/Sema/bitfield.c vendor/clang/dist-release_60/test/Sema/compare.c vendor/clang/dist-release_60/test/SemaCXX/init-expr-crash.cpp vendor/clang/dist-release_60/test/SemaCXX/type-traits.cpp vendor/clang/dist-release_60/test/SemaTemplate/instantiate-init.cpp vendor/clang/dist-release_60/unittests/Format/FormatTest.cpp Modified: vendor/clang/dist-release_60/docs/ReleaseNotes.rst ============================================================================== --- vendor/clang/dist-release_60/docs/ReleaseNotes.rst Fri Feb 16 19:10:22 2018 (r329395) +++ vendor/clang/dist-release_60/docs/ReleaseNotes.rst Fri Feb 16 19:10:26 2018 (r329396) @@ -132,6 +132,11 @@ New Compiler Flags difference between the ``-std=c17`` and ``-std=c11`` language modes is the value of the ``__STDC_VERSION__`` macro, as C17 is a bug fix release. +- Added the ``-fexperimental-isel`` and ``-fno-experimental-isel`` flags to + enable/disable the new GlobalISel instruction selection framework. This + feature is enabled by default for AArch64 at the ``-O0`` optimization level. + Support for other targets or optimization levels is currently incomplete. + Deprecated Compiler Flags ------------------------- Modified: vendor/clang/dist-release_60/include/clang/AST/DeclBase.h ============================================================================== --- vendor/clang/dist-release_60/include/clang/AST/DeclBase.h Fri Feb 16 19:10:22 2018 (r329395) +++ vendor/clang/dist-release_60/include/clang/AST/DeclBase.h Fri Feb 16 19:10:26 2018 (r329396) @@ -836,6 +836,10 @@ class LLVM_ALIGNAS(/*alignof(uint64_t)*/ 8) Decl { (pu void setLexicalDeclContext(DeclContext *DC); + /// Determine whether this declaration is a templated entity (whether it is + // within the scope of a template parameter). + bool isTemplated() const; + /// isDefinedOutsideFunctionOrMethod - This predicate returns true if this /// scoped decl is defined outside the current function or method. This is /// roughly global variables and functions, but also handles enums (which Modified: vendor/clang/dist-release_60/lib/AST/ASTContext.cpp ============================================================================== --- vendor/clang/dist-release_60/lib/AST/ASTContext.cpp Fri Feb 16 19:10:22 2018 (r329395) +++ vendor/clang/dist-release_60/lib/AST/ASTContext.cpp Fri Feb 16 19:10:26 2018 (r329396) @@ -2145,7 +2145,7 @@ static bool unionHasUniqueObjectRepresentations(const if (FieldSize != UnionSize) return false; } - return true; + return !RD->field_empty(); } static bool isStructEmpty(QualType Ty) { Modified: vendor/clang/dist-release_60/lib/AST/DeclBase.cpp ============================================================================== --- vendor/clang/dist-release_60/lib/AST/DeclBase.cpp Fri Feb 16 19:10:22 2018 (r329395) +++ vendor/clang/dist-release_60/lib/AST/DeclBase.cpp Fri Feb 16 19:10:26 2018 (r329396) @@ -236,8 +236,21 @@ TemplateDecl *Decl::getDescribedTemplate() const { return RD->getDescribedClassTemplate(); else if (auto *VD = dyn_cast(this)) return VD->getDescribedVarTemplate(); + else if (auto *AD = dyn_cast(this)) + return AD->getDescribedAliasTemplate(); return nullptr; +} + +bool Decl::isTemplated() const { + // A declaration is dependent if it is a template or a template pattern, or + // is within (lexcially for a friend, semantically otherwise) a dependent + // context. + // FIXME: Should local extern declarations be treated like friends? + if (auto *AsDC = dyn_cast(this)) + return AsDC->isDependentContext(); + auto *DC = getFriendObjectKind() ? getLexicalDeclContext() : getDeclContext(); + return DC->isDependentContext() || isTemplateDecl() || getDescribedTemplate(); } const DeclContext *Decl::getParentFunctionOrMethod() const { Modified: vendor/clang/dist-release_60/lib/AST/MicrosoftMangle.cpp ============================================================================== --- vendor/clang/dist-release_60/lib/AST/MicrosoftMangle.cpp Fri Feb 16 19:10:22 2018 (r329395) +++ vendor/clang/dist-release_60/lib/AST/MicrosoftMangle.cpp Fri Feb 16 19:10:26 2018 (r329396) @@ -950,11 +950,10 @@ void MicrosoftCXXNameMangler::mangleUnqualifiedName(co } } +// ::= [] +// ::= [] void MicrosoftCXXNameMangler::mangleNestedName(const NamedDecl *ND) { - // ::= [] - // ::= [] const DeclContext *DC = getEffectiveDeclContext(ND); - while (!DC->isTranslationUnit()) { if (isa(ND) || isa(ND)) { unsigned Disc; @@ -2140,6 +2139,7 @@ void MicrosoftCXXNameMangler::mangleCallingConvention( case CC_X86StdCall: Out << 'G'; break; case CC_X86FastCall: Out << 'I'; break; case CC_X86VectorCall: Out << 'Q'; break; + case CC_Swift: Out << 'S'; break; case CC_X86RegCall: Out << 'w'; break; } } Modified: vendor/clang/dist-release_60/lib/CodeGen/CodeGenModule.cpp ============================================================================== --- vendor/clang/dist-release_60/lib/CodeGen/CodeGenModule.cpp Fri Feb 16 19:10:22 2018 (r329395) +++ vendor/clang/dist-release_60/lib/CodeGen/CodeGenModule.cpp Fri Feb 16 19:10:26 2018 (r329396) @@ -4000,18 +4000,13 @@ void CodeGenModule::EmitDeclContext(const DeclContext /// EmitTopLevelDecl - Emit code for a single top level declaration. void CodeGenModule::EmitTopLevelDecl(Decl *D) { // Ignore dependent declarations. - if (D->getDeclContext() && D->getDeclContext()->isDependentContext()) + if (D->isTemplated()) return; switch (D->getKind()) { case Decl::CXXConversion: case Decl::CXXMethod: case Decl::Function: - // Skip function templates - if (cast(D)->getDescribedFunctionTemplate() || - cast(D)->isLateTemplateParsed()) - return; - EmitGlobal(cast(D)); // Always provide some coverage mapping // even for the functions that aren't emitted. @@ -4024,10 +4019,6 @@ void CodeGenModule::EmitTopLevelDecl(Decl *D) { case Decl::Var: case Decl::Decomposition: - // Skip variable templates - if (cast(D)->getDescribedVarTemplate()) - return; - LLVM_FALLTHROUGH; case Decl::VarTemplateSpecialization: EmitGlobal(cast(D)); if (auto *DD = dyn_cast(D)) @@ -4086,16 +4077,9 @@ void CodeGenModule::EmitTopLevelDecl(Decl *D) { DI->EmitUsingDirective(cast(*D)); return; case Decl::CXXConstructor: - // Skip function templates - if (cast(D)->getDescribedFunctionTemplate() || - cast(D)->isLateTemplateParsed()) - return; - getCXXABI().EmitCXXConstructors(cast(D)); break; case Decl::CXXDestructor: - if (cast(D)->isLateTemplateParsed()) - return; getCXXABI().EmitCXXDestructors(cast(D)); break; Modified: vendor/clang/dist-release_60/lib/CodeGen/ItaniumCXXABI.cpp ============================================================================== --- vendor/clang/dist-release_60/lib/CodeGen/ItaniumCXXABI.cpp Fri Feb 16 19:10:22 2018 (r329395) +++ vendor/clang/dist-release_60/lib/CodeGen/ItaniumCXXABI.cpp Fri Feb 16 19:10:26 2018 (r329396) @@ -2761,6 +2761,11 @@ static bool ShouldUseExternalRTTIDescriptor(CodeGenMod // N.B. We must always emit the RTTI data ourselves if there exists a key // function. bool IsDLLImport = RD->hasAttr(); + + // Don't import the RTTI but emit it locally. + if (CGM.getTriple().isWindowsGNUEnvironment() && IsDLLImport) + return false; + if (CGM.getVTables().isVTableExternal(RD)) return IsDLLImport && !CGM.getTriple().isWindowsItaniumEnvironment() ? false Modified: vendor/clang/dist-release_60/lib/CodeGen/TargetInfo.cpp ============================================================================== --- vendor/clang/dist-release_60/lib/CodeGen/TargetInfo.cpp Fri Feb 16 19:10:22 2018 (r329395) +++ vendor/clang/dist-release_60/lib/CodeGen/TargetInfo.cpp Fri Feb 16 19:10:26 2018 (r329396) @@ -3543,7 +3543,17 @@ ABIArgInfo X86_64ABIInfo::classifyRegCallStructType(Qu void X86_64ABIInfo::computeInfo(CGFunctionInfo &FI) const { - bool IsRegCall = FI.getCallingConvention() == llvm::CallingConv::X86_RegCall; + const unsigned CallingConv = FI.getCallingConvention(); + // It is possible to force Win64 calling convention on any x86_64 target by + // using __attribute__((ms_abi)). In such case to correctly emit Win64 + // compatible code delegate this call to WinX86_64ABIInfo::computeInfo. + if (CallingConv == llvm::CallingConv::Win64) { + WinX86_64ABIInfo Win64ABIInfo(CGT); + Win64ABIInfo.computeInfo(FI); + return; + } + + bool IsRegCall = CallingConv == llvm::CallingConv::X86_RegCall; // Keep track of the number of assigned registers. unsigned FreeIntRegs = IsRegCall ? 11 : 6; Modified: vendor/clang/dist-release_60/lib/Format/TokenAnnotator.cpp ============================================================================== --- vendor/clang/dist-release_60/lib/Format/TokenAnnotator.cpp Fri Feb 16 19:10:22 2018 (r329395) +++ vendor/clang/dist-release_60/lib/Format/TokenAnnotator.cpp Fri Feb 16 19:10:26 2018 (r329396) @@ -1723,15 +1723,18 @@ void TokenAnnotator::setCommentLineLevels( } } - if (NextNonCommentLine && CommentLine) { - // If the comment is currently aligned with the line immediately following - // it, that's probably intentional and we should keep it. - bool AlignedWithNextLine = - NextNonCommentLine->First->NewlinesBefore <= 1 && - NextNonCommentLine->First->OriginalColumn == - (*I)->First->OriginalColumn; - if (AlignedWithNextLine) - (*I)->Level = NextNonCommentLine->Level; + // If the comment is currently aligned with the line immediately following + // it, that's probably intentional and we should keep it. + if (NextNonCommentLine && CommentLine && + NextNonCommentLine->First->NewlinesBefore <= 1 && + NextNonCommentLine->First->OriginalColumn == + (*I)->First->OriginalColumn) { + // Align comments for preprocessor lines with the # in column 0. + // Otherwise, align with the next line. + (*I)->Level = (NextNonCommentLine->Type == LT_PreprocessorDirective || + NextNonCommentLine->Type == LT_ImportStatement) + ? 0 + : NextNonCommentLine->Level; } else { NextNonCommentLine = (*I)->First->isNot(tok::r_brace) ? (*I) : nullptr; } Modified: vendor/clang/dist-release_60/lib/Format/UnwrappedLineParser.cpp ============================================================================== --- vendor/clang/dist-release_60/lib/Format/UnwrappedLineParser.cpp Fri Feb 16 19:10:22 2018 (r329395) +++ vendor/clang/dist-release_60/lib/Format/UnwrappedLineParser.cpp Fri Feb 16 19:10:26 2018 (r329396) @@ -234,14 +234,17 @@ UnwrappedLineParser::UnwrappedLineParser(const FormatS CurrentLines(&Lines), Style(Style), Keywords(Keywords), CommentPragmasRegex(Style.CommentPragmas), Tokens(nullptr), Callback(Callback), AllTokens(Tokens), PPBranchLevel(-1), - IfNdefCondition(nullptr), FoundIncludeGuardStart(false), - IncludeGuardRejected(false), FirstStartColumn(FirstStartColumn) {} + IncludeGuard(Style.IndentPPDirectives == FormatStyle::PPDIS_None + ? IG_Rejected + : IG_Inited), + IncludeGuardToken(nullptr), FirstStartColumn(FirstStartColumn) {} void UnwrappedLineParser::reset() { PPBranchLevel = -1; - IfNdefCondition = nullptr; - FoundIncludeGuardStart = false; - IncludeGuardRejected = false; + IncludeGuard = Style.IndentPPDirectives == FormatStyle::PPDIS_None + ? IG_Rejected + : IG_Inited; + IncludeGuardToken = nullptr; Line.reset(new UnwrappedLine); CommentsBeforeNextToken.clear(); FormatTok = nullptr; @@ -264,6 +267,14 @@ void UnwrappedLineParser::parse() { readToken(); parseFile(); + + // If we found an include guard then all preprocessor directives (other than + // the guard) are over-indented by one. + if (IncludeGuard == IG_Found) + for (auto &Line : Lines) + if (Line.InPPDirective && Line.Level > 0) + --Line.Level; + // Create line with eof token. pushToken(FormatTok); addUnwrappedLine(); @@ -712,26 +723,27 @@ void UnwrappedLineParser::parsePPIf(bool IfDef) { // If there's a #ifndef on the first line, and the only lines before it are // comments, it could be an include guard. bool MaybeIncludeGuard = IfNDef; - if (!IncludeGuardRejected && !FoundIncludeGuardStart && MaybeIncludeGuard) { + if (IncludeGuard == IG_Inited && MaybeIncludeGuard) for (auto &Line : Lines) { if (!Line.Tokens.front().Tok->is(tok::comment)) { MaybeIncludeGuard = false; - IncludeGuardRejected = true; + IncludeGuard = IG_Rejected; break; } } - } --PPBranchLevel; parsePPUnknown(); ++PPBranchLevel; - if (!IncludeGuardRejected && !FoundIncludeGuardStart && MaybeIncludeGuard) - IfNdefCondition = IfCondition; + if (IncludeGuard == IG_Inited && MaybeIncludeGuard) { + IncludeGuard = IG_IfNdefed; + IncludeGuardToken = IfCondition; + } } void UnwrappedLineParser::parsePPElse() { // If a potential include guard has an #else, it's not an include guard. - if (FoundIncludeGuardStart && PPBranchLevel == 0) - FoundIncludeGuardStart = false; + if (IncludeGuard == IG_Defined && PPBranchLevel == 0) + IncludeGuard = IG_Rejected; conditionalCompilationAlternative(); if (PPBranchLevel > -1) --PPBranchLevel; @@ -745,34 +757,37 @@ void UnwrappedLineParser::parsePPEndIf() { conditionalCompilationEnd(); parsePPUnknown(); // If the #endif of a potential include guard is the last thing in the file, - // then we count it as a real include guard and subtract one from every - // preprocessor indent. + // then we found an include guard. unsigned TokenPosition = Tokens->getPosition(); FormatToken *PeekNext = AllTokens[TokenPosition]; - if (FoundIncludeGuardStart && PPBranchLevel == -1 && PeekNext->is(tok::eof) && + if (IncludeGuard == IG_Defined && PPBranchLevel == -1 && + PeekNext->is(tok::eof) && Style.IndentPPDirectives != FormatStyle::PPDIS_None) - for (auto &Line : Lines) - if (Line.InPPDirective && Line.Level > 0) - --Line.Level; + IncludeGuard = IG_Found; } void UnwrappedLineParser::parsePPDefine() { nextToken(); if (FormatTok->Tok.getKind() != tok::identifier) { + IncludeGuard = IG_Rejected; + IncludeGuardToken = nullptr; parsePPUnknown(); return; } - if (IfNdefCondition && IfNdefCondition->TokenText == FormatTok->TokenText) { - FoundIncludeGuardStart = true; + + if (IncludeGuard == IG_IfNdefed && + IncludeGuardToken->TokenText == FormatTok->TokenText) { + IncludeGuard = IG_Defined; + IncludeGuardToken = nullptr; for (auto &Line : Lines) { if (!Line.Tokens.front().Tok->isOneOf(tok::comment, tok::hash)) { - FoundIncludeGuardStart = false; + IncludeGuard = IG_Rejected; break; } } } - IfNdefCondition = nullptr; + nextToken(); if (FormatTok->Tok.getKind() == tok::l_paren && FormatTok->WhitespaceRange.getBegin() == @@ -799,7 +814,6 @@ void UnwrappedLineParser::parsePPUnknown() { if (Style.IndentPPDirectives == FormatStyle::PPDIS_AfterHash) Line->Level += PPBranchLevel + 1; addUnwrappedLine(); - IfNdefCondition = nullptr; } // Here we blacklist certain tokens that are not usually the first token in an Modified: vendor/clang/dist-release_60/lib/Format/UnwrappedLineParser.h ============================================================================== --- vendor/clang/dist-release_60/lib/Format/UnwrappedLineParser.h Fri Feb 16 19:10:22 2018 (r329395) +++ vendor/clang/dist-release_60/lib/Format/UnwrappedLineParser.h Fri Feb 16 19:10:26 2018 (r329396) @@ -248,10 +248,23 @@ class UnwrappedLineParser { (private) // sequence. std::stack PPChainBranchIndex; - // Contains the #ifndef condition for a potential include guard. - FormatToken *IfNdefCondition; - bool FoundIncludeGuardStart; - bool IncludeGuardRejected; + // Include guard search state. Used to fixup preprocessor indent levels + // so that include guards do not participate in indentation. + enum IncludeGuardState { + IG_Inited, // Search started, looking for #ifndef. + IG_IfNdefed, // #ifndef found, IncludeGuardToken points to condition. + IG_Defined, // Matching #define found, checking other requirements. + IG_Found, // All requirements met, need to fix indents. + IG_Rejected, // Search failed or never started. + }; + + // Current state of include guard search. + IncludeGuardState IncludeGuard; + + // Points to the #ifndef condition for a potential include guard. Null unless + // IncludeGuardState == IG_IfNdefed. + FormatToken *IncludeGuardToken; + // Contains the first start column where the source begins. This is zero for // normal source code and may be nonzero when formatting a code fragment that // does not start at the beginning of the file. Modified: vendor/clang/dist-release_60/lib/Headers/avx512bwintrin.h ============================================================================== --- vendor/clang/dist-release_60/lib/Headers/avx512bwintrin.h Fri Feb 16 19:10:22 2018 (r329395) +++ vendor/clang/dist-release_60/lib/Headers/avx512bwintrin.h Fri Feb 16 19:10:26 2018 (r329396) @@ -1854,13 +1854,15 @@ _mm512_maskz_set1_epi8 (__mmask64 __M, char __A) static __inline__ __mmask64 __DEFAULT_FN_ATTRS _mm512_kunpackd (__mmask64 __A, __mmask64 __B) { - return (__mmask64) (( __A & 0xFFFFFFFF) | ( __B << 32)); + return (__mmask64) __builtin_ia32_kunpckdi ((__mmask64) __A, + (__mmask64) __B); } static __inline__ __mmask32 __DEFAULT_FN_ATTRS _mm512_kunpackw (__mmask32 __A, __mmask32 __B) { -return (__mmask32) (( __A & 0xFFFF) | ( __B << 16)); + return (__mmask32) __builtin_ia32_kunpcksi ((__mmask32) __A, + (__mmask32) __B); } static __inline__ __m512i __DEFAULT_FN_ATTRS Modified: vendor/clang/dist-release_60/lib/Headers/avx512fintrin.h ============================================================================== --- vendor/clang/dist-release_60/lib/Headers/avx512fintrin.h Fri Feb 16 19:10:22 2018 (r329395) +++ vendor/clang/dist-release_60/lib/Headers/avx512fintrin.h Fri Feb 16 19:10:26 2018 (r329396) @@ -8787,7 +8787,7 @@ _mm512_kortestz (__mmask16 __A, __mmask16 __B) static __inline__ __mmask16 __DEFAULT_FN_ATTRS _mm512_kunpackb (__mmask16 __A, __mmask16 __B) { - return (__mmask16) (( __A & 0xFF) | ( __B << 8)); + return (__mmask16) __builtin_ia32_kunpckhi ((__mmask16) __A, (__mmask16) __B); } static __inline__ __mmask16 __DEFAULT_FN_ATTRS Modified: vendor/clang/dist-release_60/lib/Lex/LiteralSupport.cpp ============================================================================== --- vendor/clang/dist-release_60/lib/Lex/LiteralSupport.cpp Fri Feb 16 19:10:22 2018 (r329395) +++ vendor/clang/dist-release_60/lib/Lex/LiteralSupport.cpp Fri Feb 16 19:10:26 2018 (r329396) @@ -738,15 +738,17 @@ void NumericLiteralParser::ParseDecimalOrOctalCommon(S s++; radix = 10; saw_exponent = true; - if (*s == '+' || *s == '-') s++; // sign + if (s != ThisTokEnd && (*s == '+' || *s == '-')) s++; // sign const char *first_non_digit = SkipDigits(s); if (containsDigits(s, first_non_digit)) { checkSeparator(TokLoc, s, CSK_BeforeDigits); s = first_non_digit; } else { - PP.Diag(PP.AdvanceToTokenCharacter(TokLoc, Exponent-ThisTokBegin), - diag::err_exponent_has_no_digits); - hadError = true; + if (!hadError) { + PP.Diag(PP.AdvanceToTokenCharacter(TokLoc, Exponent-ThisTokBegin), + diag::err_exponent_has_no_digits); + hadError = true; + } return; } } @@ -787,10 +789,12 @@ void NumericLiteralParser::checkSeparator(SourceLocati } else if (Pos == ThisTokEnd) return; - if (isDigitSeparator(*Pos)) + if (isDigitSeparator(*Pos)) { PP.Diag(PP.AdvanceToTokenCharacter(TokLoc, Pos - ThisTokBegin), diag::err_digit_separator_not_between_digits) << IsAfterDigits; + hadError = true; + } } /// ParseNumberStartingWithZero - This method is called when the first character @@ -840,12 +844,14 @@ void NumericLiteralParser::ParseNumberStartingWithZero const char *Exponent = s; s++; saw_exponent = true; - if (*s == '+' || *s == '-') s++; // sign + if (s != ThisTokEnd && (*s == '+' || *s == '-')) s++; // sign const char *first_non_digit = SkipDigits(s); if (!containsDigits(s, first_non_digit)) { - PP.Diag(PP.AdvanceToTokenCharacter(TokLoc, Exponent-ThisTokBegin), - diag::err_exponent_has_no_digits); - hadError = true; + if (!hadError) { + PP.Diag(PP.AdvanceToTokenCharacter(TokLoc, Exponent-ThisTokBegin), + diag::err_exponent_has_no_digits); + hadError = true; + } return; } checkSeparator(TokLoc, s, CSK_BeforeDigits); Modified: vendor/clang/dist-release_60/lib/Sema/SemaChecking.cpp ============================================================================== --- vendor/clang/dist-release_60/lib/Sema/SemaChecking.cpp Fri Feb 16 19:10:22 2018 (r329395) +++ vendor/clang/dist-release_60/lib/Sema/SemaChecking.cpp Fri Feb 16 19:10:26 2018 (r329396) @@ -8972,6 +8972,16 @@ static void AnalyzeComparison(Sema &S, BinaryOperator LHS = LHS->IgnoreParenImpCasts(); RHS = RHS->IgnoreParenImpCasts(); + if (!S.getLangOpts().CPlusPlus) { + // Avoid warning about comparison of integers with different signs when + // RHS/LHS has a `typeof(E)` type whose sign is different from the sign of + // the type of `E`. + if (const auto *TET = dyn_cast(LHS->getType())) + LHS = TET->getUnderlyingExpr()->IgnoreParenImpCasts(); + if (const auto *TET = dyn_cast(RHS->getType())) + RHS = TET->getUnderlyingExpr()->IgnoreParenImpCasts(); + } + // Check to see if one of the (unmodified) operands is of different // signedness. Expr *signedOperand, *unsignedOperand; Modified: vendor/clang/dist-release_60/lib/Sema/SemaDecl.cpp ============================================================================== --- vendor/clang/dist-release_60/lib/Sema/SemaDecl.cpp Fri Feb 16 19:10:22 2018 (r329395) +++ vendor/clang/dist-release_60/lib/Sema/SemaDecl.cpp Fri Feb 16 19:10:26 2018 (r329396) @@ -12507,9 +12507,19 @@ void Sema::ActOnFinishDelayedAttribute(Scope *S, Decl /// call, forming a call to an implicitly defined function (per C99 6.5.1p2). NamedDecl *Sema::ImplicitlyDefineFunction(SourceLocation Loc, IdentifierInfo &II, Scope *S) { + // Find the scope in which the identifier is injected and the corresponding + // DeclContext. + // FIXME: C89 does not say what happens if there is no enclosing block scope. + // In that case, we inject the declaration into the translation unit scope + // instead. Scope *BlockScope = S; while (!BlockScope->isCompoundStmtScope() && BlockScope->getParent()) BlockScope = BlockScope->getParent(); + + Scope *ContextScope = BlockScope; + while (!ContextScope->getEntity()) + ContextScope = ContextScope->getParent(); + ContextRAII SavedContext(*this, ContextScope->getEntity()); // Before we produce a declaration for an implicitly defined // function, see whether there was a locally-scoped declaration of Modified: vendor/clang/dist-release_60/lib/Sema/SemaInit.cpp ============================================================================== --- vendor/clang/dist-release_60/lib/Sema/SemaInit.cpp Fri Feb 16 19:10:22 2018 (r329395) +++ vendor/clang/dist-release_60/lib/Sema/SemaInit.cpp Fri Feb 16 19:10:26 2018 (r329396) @@ -352,6 +352,7 @@ class InitListChecker { bool FillWithNoInit = false); void FillInEmptyInitializations(const InitializedEntity &Entity, InitListExpr *ILE, bool &RequiresSecondPass, + InitListExpr *OuterILE, unsigned OuterIndex, bool FillWithNoInit = false); bool CheckFlexibleArrayInit(const InitializedEntity &Entity, Expr *InitExpr, FieldDecl *Field, @@ -517,12 +518,13 @@ void InitListChecker::FillInEmptyInitForBase( ILE->setInit(Init, BaseInit.getAs()); } else if (InitListExpr *InnerILE = dyn_cast(ILE->getInit(Init))) { - FillInEmptyInitializations(BaseEntity, InnerILE, - RequiresSecondPass, FillWithNoInit); + FillInEmptyInitializations(BaseEntity, InnerILE, RequiresSecondPass, + ILE, Init, FillWithNoInit); } else if (DesignatedInitUpdateExpr *InnerDIUE = dyn_cast(ILE->getInit(Init))) { FillInEmptyInitializations(BaseEntity, InnerDIUE->getUpdater(), - RequiresSecondPass, /*FillWithNoInit =*/true); + RequiresSecondPass, ILE, Init, + /*FillWithNoInit =*/true); } } @@ -605,24 +607,43 @@ void InitListChecker::FillInEmptyInitForField(unsigned } else if (InitListExpr *InnerILE = dyn_cast(ILE->getInit(Init))) FillInEmptyInitializations(MemberEntity, InnerILE, - RequiresSecondPass, FillWithNoInit); + RequiresSecondPass, ILE, Init, FillWithNoInit); else if (DesignatedInitUpdateExpr *InnerDIUE = dyn_cast(ILE->getInit(Init))) FillInEmptyInitializations(MemberEntity, InnerDIUE->getUpdater(), - RequiresSecondPass, /*FillWithNoInit =*/ true); + RequiresSecondPass, ILE, Init, + /*FillWithNoInit =*/true); } /// Recursively replaces NULL values within the given initializer list /// with expressions that perform value-initialization of the -/// appropriate type. +/// appropriate type, and finish off the InitListExpr formation. void InitListChecker::FillInEmptyInitializations(const InitializedEntity &Entity, InitListExpr *ILE, bool &RequiresSecondPass, + InitListExpr *OuterILE, + unsigned OuterIndex, bool FillWithNoInit) { assert((ILE->getType() != SemaRef.Context.VoidTy) && "Should not have void type"); + // If this is a nested initializer list, we might have changed its contents + // (and therefore some of its properties, such as instantiation-dependence) + // while filling it in. Inform the outer initializer list so that its state + // can be updated to match. + // FIXME: We should fully build the inner initializers before constructing + // the outer InitListExpr instead of mutating AST nodes after they have + // been used as subexpressions of other nodes. + struct UpdateOuterILEWithUpdatedInit { + InitListExpr *Outer; + unsigned OuterIndex; + ~UpdateOuterILEWithUpdatedInit() { + if (Outer) + Outer->setInit(OuterIndex, Outer->getInit(OuterIndex)); + } + } UpdateOuterRAII = {OuterILE, OuterIndex}; + // A transparent ILE is not performing aggregate initialization and should // not be filled in. if (ILE->isTransparent()) @@ -769,11 +790,12 @@ InitListChecker::FillInEmptyInitializations(const Init } else if (InitListExpr *InnerILE = dyn_cast_or_null(InitExpr)) FillInEmptyInitializations(ElementEntity, InnerILE, RequiresSecondPass, - FillWithNoInit); + ILE, Init, FillWithNoInit); else if (DesignatedInitUpdateExpr *InnerDIUE = dyn_cast_or_null(InitExpr)) FillInEmptyInitializations(ElementEntity, InnerDIUE->getUpdater(), - RequiresSecondPass, /*FillWithNoInit =*/ true); + RequiresSecondPass, ILE, Init, + /*FillWithNoInit =*/true); } } @@ -795,10 +817,11 @@ InitListChecker::InitListChecker(Sema &S, const Initia if (!hadError && !VerifyOnly) { bool RequiresSecondPass = false; - FillInEmptyInitializations(Entity, FullyStructuredList, RequiresSecondPass); + FillInEmptyInitializations(Entity, FullyStructuredList, RequiresSecondPass, + /*OuterILE=*/nullptr, /*OuterIndex=*/0); if (RequiresSecondPass && !hadError) FillInEmptyInitializations(Entity, FullyStructuredList, - RequiresSecondPass); + RequiresSecondPass, nullptr, 0); } } @@ -1162,10 +1185,12 @@ void InitListChecker::CheckSubElementType(const Initia if (!hadError && !VerifyOnly) { bool RequiresSecondPass = false; FillInEmptyInitializations(Entity, InnerStructuredList, - RequiresSecondPass); + RequiresSecondPass, StructuredList, + StructuredIndex); if (RequiresSecondPass && !hadError) FillInEmptyInitializations(Entity, InnerStructuredList, - RequiresSecondPass); + RequiresSecondPass, StructuredList, + StructuredIndex); } ++StructuredIndex; ++Index; Modified: vendor/clang/dist-release_60/test/CodeGen/avx512bw-builtins.c ============================================================================== --- vendor/clang/dist-release_60/test/CodeGen/avx512bw-builtins.c Fri Feb 16 19:10:22 2018 (r329395) +++ vendor/clang/dist-release_60/test/CodeGen/avx512bw-builtins.c Fri Feb 16 19:10:26 2018 (r329396) @@ -1626,26 +1626,16 @@ __m512i test_mm512_maskz_set1_epi8(__mmask64 __M, char return _mm512_maskz_set1_epi8(__M, __A); } -__mmask64 test_mm512_kunpackd(__m512i __A, __m512i __B, __m512i __C, __m512i __D, __m512i __E, __m512i __F) { +__mmask64 test_mm512_kunpackd(__mmask64 __A, __mmask64 __B) { // CHECK-LABEL: @test_mm512_kunpackd - // CHECK: bitcast <64 x i1> %{{.*}} to i64 - // CHECK: bitcast <64 x i1> %{{.*}} to i64 - // CHECK: and i64 %{{.*}}, 4294967295 - // CHECK: shl i64 %{{.*}}, 32 - // CHECK: or i64 %{{.*}}, %{{.*}} - // CHECK: bitcast i64 %{{.*}} to <64 x i1> - return _mm512_mask_cmpneq_epu8_mask(_mm512_kunpackd(_mm512_cmpneq_epu8_mask(__B, __A),_mm512_cmpneq_epu8_mask(__C, __D)), __E, __F); + // CHECK: @llvm.x86.avx512.kunpck.dq + return _mm512_kunpackd(__A, __B); } -__mmask32 test_mm512_kunpackw(__m512i __A, __m512i __B, __m512i __C, __m512i __D, __m512i __E, __m512i __F) { +__mmask32 test_mm512_kunpackw(__mmask32 __A, __mmask32 __B) { // CHECK-LABEL: @test_mm512_kunpackw - // CHECK: bitcast <32 x i1> %{{.*}} to i32 - // CHECK: bitcast <32 x i1> %{{.*}} to i32 - // CHECK: and i32 %{{.*}}, 65535 - // CHECK: shl i32 %{{.*}}, 16 - // CHECK: or i32 %{{.*}}, %{{.*}} - // CHECK: bitcast i32 %{{.*}} to <32 x i1> - return _mm512_mask_cmpneq_epu16_mask(_mm512_kunpackw(_mm512_cmpneq_epu16_mask(__B, __A),_mm512_cmpneq_epu16_mask(__C, __D)), __E, __F); + // CHECK: @llvm.x86.avx512.kunpck.wd + return _mm512_kunpackw(__A, __B); } __m512i test_mm512_mask_loadu_epi16(__m512i __W, __mmask32 __U, void const *__P) { Modified: vendor/clang/dist-release_60/test/CodeGen/avx512f-builtins.c ============================================================================== --- vendor/clang/dist-release_60/test/CodeGen/avx512f-builtins.c Fri Feb 16 19:10:22 2018 (r329395) +++ vendor/clang/dist-release_60/test/CodeGen/avx512f-builtins.c Fri Feb 16 19:10:26 2018 (r329396) @@ -6259,17 +6259,10 @@ int test_mm512_kortestz(__mmask16 __A, __mmask16 __B) return _mm512_kortestz(__A, __B); } -__mmask16 test_mm512_kunpackb(__m512i __A, __m512i __B, __m512i __C, __m512i __D, __m512i __E, __m512i __F) { +__mmask16 test_mm512_kunpackb(__mmask16 __A, __mmask16 __B) { // CHECK-LABEL: @test_mm512_kunpackb - // CHECK: bitcast <16 x i1> %{{.*}} to i16 - // CHECK: bitcast <16 x i1> %{{.*}} to i16 - // CHECK: and i32 %{{.*}}, 255 - // CHECK: shl i32 %{{.*}}, 8 - // CHECK: or i32 %{{.*}}, %{{.*}} - // CHECK: bitcast i16 %{{.*}} to <16 x i1> - return _mm512_mask_cmpneq_epu32_mask(_mm512_kunpackb(_mm512_cmpneq_epu32_mask(__A, __B), - _mm512_cmpneq_epu32_mask(__C, __D)), - __E, __F); + // CHECK: @llvm.x86.avx512.kunpck.bw + return _mm512_kunpackb(__A, __B); } __mmask16 test_mm512_kxnor(__m512i __A, __m512i __B, __m512i __C, __m512i __D, __m512i __E, __m512i __F) { Modified: vendor/clang/dist-release_60/test/CodeGen/ms_abi.c ============================================================================== --- vendor/clang/dist-release_60/test/CodeGen/ms_abi.c Fri Feb 16 19:10:22 2018 (r329395) +++ vendor/clang/dist-release_60/test/CodeGen/ms_abi.c Fri Feb 16 19:10:26 2018 (r329396) @@ -146,3 +146,16 @@ void __attribute__((sysv_abi)) f6(__builtin_ms_va_list // WIN64: %[[AP_VAL:.*]] = load i8*, i8** %[[AP]] // WIN64-NEXT: store i8* %[[AP_VAL]], i8** %[[AP2:.*]] } + +// This test checks if structs are passed according to Win64 calling convention +// when it's enforced by __attribute((ms_abi)). +struct i128 { + unsigned long long a; + unsigned long long b; +}; + +__attribute__((ms_abi)) struct i128 f7(struct i128 a) { + // WIN64: define void @f7(%struct.i128* noalias sret %agg.result, %struct.i128* %a) + // FREEBSD: define win64cc void @f7(%struct.i128* noalias sret %agg.result, %struct.i128* %a) + return a; +} Added: vendor/clang/dist-release_60/test/CodeGenCXX/dllimport-missing-key.cpp ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/clang/dist-release_60/test/CodeGenCXX/dllimport-missing-key.cpp Fri Feb 16 19:10:26 2018 (r329396) @@ -0,0 +1,20 @@ +// RUN: %clang_cc1 -triple i686-windows-gnu -emit-llvm -std=c++1y -O0 -o - %s -w | FileCheck --check-prefix=GNU %s + +class __declspec(dllimport) QObjectData { +public: + virtual ~QObjectData() = 0; + void *ptr; + + int method() const; +}; + +class LocalClass : public QObjectData { +}; + +void call() { + (new LocalClass())->method(); +} + +// GNU-DAG: @_ZTV11QObjectData = available_externally dllimport +// GNU-DAG: @_ZTS11QObjectData = linkonce_odr +// GNU-DAG: @_ZTI11QObjectData = linkonce_odr Modified: vendor/clang/dist-release_60/test/CodeGenCXX/dllimport-rtti.cpp ============================================================================== --- vendor/clang/dist-release_60/test/CodeGenCXX/dllimport-rtti.cpp Fri Feb 16 19:10:22 2018 (r329395) +++ vendor/clang/dist-release_60/test/CodeGenCXX/dllimport-rtti.cpp Fri Feb 16 19:10:26 2018 (r329396) @@ -12,7 +12,7 @@ struct __declspec(dllimport) S { // MSVC-DAG: @"\01??_R3S@@8" = linkonce_odr // GNU-DAG: @_ZTV1S = available_externally dllimport -// GNU-DAG: @_ZTI1S = external dllimport +// GNU-DAG: @_ZTI1S = linkonce_odr struct U : S { } u; Added: vendor/clang/dist-release_60/test/CodeGenCXX/microsoft-abi-emit-dependent.cpp ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/clang/dist-release_60/test/CodeGenCXX/microsoft-abi-emit-dependent.cpp Fri Feb 16 19:10:26 2018 (r329396) @@ -0,0 +1,11 @@ +// RUN: %clang_cc1 -emit-llvm-only -fmodules -triple x86_64-windows %s +// PR36181 +#pragma clang module build foo +module foo {} +#pragma clang module contents +template struct A { + friend void f(A) {} +}; +#pragma clang module endbuild +#pragma clang module import foo +void g() { f(A()); } Added: vendor/clang/dist-release_60/test/CodeGenCXX/msabi-swiftcall-cc.cpp ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/clang/dist-release_60/test/CodeGenCXX/msabi-swiftcall-cc.cpp Fri Feb 16 19:10:26 2018 (r329396) @@ -0,0 +1,28 @@ +// RUN: %clang_cc1 -triple i686-unknown-windows-msvc -fdeclspec -emit-llvm %s -o - | FileCheck %s + +void __attribute__((__swiftcall__)) f() {} +// CHECK-DAG: @"\01?f@@YSXXZ" + +void (__attribute__((__swiftcall__)) *p)(); +// CHECK-DAG: @"\01?p@@3P6SXXZA" + +namespace { +void __attribute__((__swiftcall__)) __attribute__((__used__)) f() { } +// CHECK-DAG: "\01?f@?A@@YSXXZ" +} + +namespace n { +void __attribute__((__swiftcall__)) f() {} +// CHECK-DAG: "\01?f@n@@YSXXZ" +} + +struct __declspec(dllexport) S { + S(const S &) = delete; + S & operator=(const S &) = delete; + void __attribute__((__swiftcall__)) m() { } + // CHECK-DAG: "\01?m@S@@QASXXZ" +}; + +void f(void (__attribute__((__swiftcall__))())) {} +// CHECK-DAG: "\01?f@@YAXP6SXXZ@Z" + Modified: vendor/clang/dist-release_60/test/Lexer/cxx1y_digit_separators.cpp ============================================================================== --- vendor/clang/dist-release_60/test/Lexer/cxx1y_digit_separators.cpp Fri Feb 16 19:10:22 2018 (r329395) +++ vendor/clang/dist-release_60/test/Lexer/cxx1y_digit_separators.cpp Fri Feb 16 19:10:26 2018 (r329396) @@ -51,6 +51,8 @@ namespace floating { float u = 0x.'p1f; // expected-error {{hexadecimal floating literal requires a significand}} float v = 0e'f; // expected-error {{exponent has no digits}} float w = 0x0p'f; // expected-error {{exponent has no digits}} + float x = 0'e+1; // expected-error {{digit separator cannot appear at end of digit sequence}} + float y = 0x0'p+1; // expected-error {{digit separator cannot appear at end of digit sequence}} } #line 123'456 Modified: vendor/clang/dist-release_60/test/Sema/bitfield.c ============================================================================== --- vendor/clang/dist-release_60/test/Sema/bitfield.c Fri Feb 16 19:10:22 2018 (r329395) +++ vendor/clang/dist-release_60/test/Sema/bitfield.c Fri Feb 16 19:10:26 2018 (r329396) @@ -82,3 +82,7 @@ typedef __typeof__(+(t5.n--)) Unsigned; // also act li struct Test6 { : 0.0; // expected-error{{type name requires a specifier or qualifier}} }; + +struct PR36157 { + int n : 1 ? 1 : implicitly_declare_function(); // expected-warning {{invalid in C99}} +}; Modified: vendor/clang/dist-release_60/test/Sema/compare.c ============================================================================== --- vendor/clang/dist-release_60/test/Sema/compare.c Fri Feb 16 19:10:22 2018 (r329395) +++ vendor/clang/dist-release_60/test/Sema/compare.c Fri Feb 16 19:10:26 2018 (r329396) @@ -391,3 +391,16 @@ typedef char two_chars[2]; void test12(unsigned a) { if (0 && -1 > a) { } } + +// PR36008 + +enum PR36008EnumTest { + kPR36008Value = 0, +}; + +void pr36008(enum PR36008EnumTest lhs) { + __typeof__(lhs) x = lhs; + __typeof__(kPR36008Value) y = (kPR36008Value); + if (x == y) x = y; // no warning + if (y == x) y = x; // no warning +} Added: vendor/clang/dist-release_60/test/Sema/cxx-as-c.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/clang/dist-release_60/test/Sema/cxx-as-c.c Fri Feb 16 19:10:26 2018 (r329396) @@ -0,0 +1,9 @@ +// RUN: %clang_cc1 %s -verify + +// PR36157 +struct Foo { + Foo(int n) : n_(n) {} // expected-error 1+{{}} expected-warning 1+{{}} +private: + int n; +}; +int main() { Foo f; } // expected-error 1+{{}} Modified: vendor/clang/dist-release_60/test/SemaCXX/init-expr-crash.cpp ============================================================================== --- vendor/clang/dist-release_60/test/SemaCXX/init-expr-crash.cpp Fri Feb 16 19:10:22 2018 (r329395) +++ vendor/clang/dist-release_60/test/SemaCXX/init-expr-crash.cpp Fri Feb 16 19:10:26 2018 (r329396) @@ -29,3 +29,11 @@ template struct B { return 0; } }; + +// This test checks for a crash that resulted from us miscomputing the +// dependence of a nested initializer list. +template struct X { + static constexpr int n = 4; + static constexpr int a[1][1] = {n}; +}; + Modified: vendor/clang/dist-release_60/test/SemaCXX/type-traits.cpp ============================================================================== --- vendor/clang/dist-release_60/test/SemaCXX/type-traits.cpp Fri Feb 16 19:10:22 2018 (r329395) +++ vendor/clang/dist-release_60/test/SemaCXX/type-traits.cpp Fri Feb 16 19:10:26 2018 (r329396) @@ -2524,6 +2524,7 @@ static_assert(!has_unique_object_representations::value, "No references!"); static_assert(!has_unique_object_representations::value, "No references!"); static_assert(!has_unique_object_representations::value, "No empty types!"); +static_assert(!has_unique_object_representations::value, "No empty types!"); class Compressed : Empty { int x; Modified: vendor/clang/dist-release_60/test/SemaTemplate/instantiate-init.cpp ============================================================================== --- vendor/clang/dist-release_60/test/SemaTemplate/instantiate-init.cpp Fri Feb 16 19:10:22 2018 (r329395) +++ vendor/clang/dist-release_60/test/SemaTemplate/instantiate-init.cpp Fri Feb 16 19:10:26 2018 (r329396) @@ -142,3 +142,17 @@ namespace ReturnStmtIsInitialization { template X f() { return {}; } auto &&x = f(); } + +namespace InitListUpdate { + struct A { int n; }; + using AA = A[1]; + + // Check that an init list update doesn't "lose" the pack-ness of an expression. + template void f() { + g(AA{0, [0].n = N} ...); // expected-warning 3{{overrides prior init}} expected-note 3{{previous init}} + g(AA{N, [0].n = 0} ...); // expected-warning 3{{overrides prior init}} expected-note 3{{previous init}} + }; + + void g(AA, AA); + void h() { f<1, 2>(); } // expected-note {{instantiation of}} +} Modified: vendor/clang/dist-release_60/unittests/Format/FormatTest.cpp ============================================================================== --- vendor/clang/dist-release_60/unittests/Format/FormatTest.cpp Fri Feb 16 19:10:22 2018 (r329395) +++ vendor/clang/dist-release_60/unittests/Format/FormatTest.cpp Fri Feb 16 19:10:26 2018 (r329396) @@ -2532,6 +2532,20 @@ TEST_F(FormatTest, IndentPreprocessorDirectives) { "#elif FOO\n" "#endif", Style); + // Non-identifier #define after potential include guard. + verifyFormat("#ifndef FOO\n" + "# define 1\n" + "#endif\n", + Style); + // #if closes past last non-preprocessor line. + verifyFormat("#ifndef FOO\n" + "#define FOO\n" + "#if 1\n" + "int i;\n" + "# define A 0\n" + "#endif\n" + "#endif\n", + Style); // FIXME: This doesn't handle the case where there's code between the // #ifndef and #define but all other conditions hold. This is because when // the #define line is parsed, UnwrappedLineParser::Lines doesn't hold the @@ -2580,21 +2594,85 @@ TEST_F(FormatTest, IndentPreprocessorDirectives) { "code();\n" "#endif", Style)); - // FIXME: The comment indent corrector in TokenAnnotator gets thrown off by - // preprocessor indentation. - EXPECT_EQ("#if 1\n" - " // comment\n" - "# define A 0\n" - "// comment\n" - "# define B 0\n" - "#endif", - format("#if 1\n" - "// comment\n" - "# define A 0\n" - " // comment\n" - "# define B 0\n" - "#endif", - Style)); + // Keep comments aligned with #, otherwise indent comments normally. These + // tests cannot use verifyFormat because messUp manipulates leading + // whitespace. + { + const char *Expected = "" + "void f() {\n" + "#if 1\n" + "// Preprocessor aligned.\n" + "# define A 0\n" + " // Code. Separated by blank line.\n" + "\n" + "# define B 0\n" + " // Code. Not aligned with #\n" + "# define C 0\n" + "#endif"; + const char *ToFormat = "" + "void f() {\n" + "#if 1\n" + "// Preprocessor aligned.\n" + "# define A 0\n" + "// Code. Separated by blank line.\n" + "\n" + "# define B 0\n" + " // Code. Not aligned with #\n" + "# define C 0\n" + "#endif"; + EXPECT_EQ(Expected, format(ToFormat, Style)); + EXPECT_EQ(Expected, format(Expected, Style)); + } + // Keep block quotes aligned. + { + const char *Expected = "" + "void f() {\n" + "#if 1\n" + "/* Preprocessor aligned. */\n" + "# define A 0\n" + " /* Code. Separated by blank line. */\n" + "\n" + "# define B 0\n" + " /* Code. Not aligned with # */\n" + "# define C 0\n" + "#endif"; + const char *ToFormat = "" + "void f() {\n" + "#if 1\n" + "/* Preprocessor aligned. */\n" + "# define A 0\n" + "/* Code. Separated by blank line. */\n" + "\n" + "# define B 0\n" + " /* Code. Not aligned with # */\n" + "# define C 0\n" + "#endif"; + EXPECT_EQ(Expected, format(ToFormat, Style)); + EXPECT_EQ(Expected, format(Expected, Style)); + } + // Keep comments aligned with un-indented directives. + { + const char *Expected = "" + "void f() {\n" + "// Preprocessor aligned.\n" + "#define A 0\n" + " // Code. Separated by blank line.\n" + "\n" + "#define B 0\n" + " // Code. Not aligned with #\n" + "#define C 0\n"; + const char *ToFormat = "" + "void f() {\n" + "// Preprocessor aligned.\n" + "#define A 0\n" + "// Code. Separated by blank line.\n" + "\n" + "#define B 0\n" + " // Code. Not aligned with #\n" + "#define C 0\n"; + EXPECT_EQ(Expected, format(ToFormat, Style)); + EXPECT_EQ(Expected, format(Expected, Style)); + } // Test with tabs. Style.UseTab = FormatStyle::UT_Always; Style.IndentWidth = 8; From owner-svn-src-all@freebsd.org Fri Feb 16 19:10:44 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6241AF09783; Fri, 16 Feb 2018 19:10:44 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 902446C57A; Fri, 16 Feb 2018 19:10:41 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5B8BD11BC6; Fri, 16 Feb 2018 19:10:40 +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 w1GJAewT069879; Fri, 16 Feb 2018 19:10:40 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1GJAeQt069878; Fri, 16 Feb 2018 19:10:40 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201802161910.w1GJAeQt069878@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Fri, 16 Feb 2018 19:10:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r329399 - vendor/compiler-rt/compiler-rt-release_60-r325330 X-SVN-Group: vendor X-SVN-Commit-Author: dim X-SVN-Commit-Paths: vendor/compiler-rt/compiler-rt-release_60-r325330 X-SVN-Commit-Revision: 329399 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Feb 2018 19:10:44 -0000 Author: dim Date: Fri Feb 16 19:10:40 2018 New Revision: 329399 URL: https://svnweb.freebsd.org/changeset/base/329399 Log: Tag compiler-rt release_60 branch r325330. Added: vendor/compiler-rt/compiler-rt-release_60-r325330/ - copied from r329398, vendor/compiler-rt/dist-release_60/ From owner-svn-src-all@freebsd.org Fri Feb 16 19:10:47 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7ACB1F097AF; Fri, 16 Feb 2018 19:10:47 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 888996C624; Fri, 16 Feb 2018 19:10:45 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B704211BD1; Fri, 16 Feb 2018 19:10:44 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1GJAicc069931; Fri, 16 Feb 2018 19:10:44 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1GJAixM069928; Fri, 16 Feb 2018 19:10:44 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201802161910.w1GJAixM069928@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Fri, 16 Feb 2018 19:10:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r329400 - in vendor/libc++/dist-release_60: . test/std/input.output/stream.buffers/streambuf/streambuf.protected/streambuf.put.area test/std/utilities/meta/meta.unary/meta.unary.prop X-SVN-Group: vendor X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in vendor/libc++/dist-release_60: . test/std/input.output/stream.buffers/streambuf/streambuf.protected/streambuf.put.area test/std/utilities/meta/meta.unary/meta.unary.prop X-SVN-Commit-Revision: 329400 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Feb 2018 19:10:47 -0000 Author: dim Date: Fri Feb 16 19:10:44 2018 New Revision: 329400 URL: https://svnweb.freebsd.org/changeset/base/329400 Log: Vendor import of libc++ release_60 branch r325330: https://llvm.org/svn/llvm-project/libcxx/branches/release_60@325330 Modified: vendor/libc++/dist-release_60/CMakeLists.txt vendor/libc++/dist-release_60/test/std/input.output/stream.buffers/streambuf/streambuf.protected/streambuf.put.area/pbump2gig.pass.cpp vendor/libc++/dist-release_60/test/std/utilities/meta/meta.unary/meta.unary.prop/has_unique_object_representations.pass.cpp Modified: vendor/libc++/dist-release_60/CMakeLists.txt ============================================================================== --- vendor/libc++/dist-release_60/CMakeLists.txt Fri Feb 16 19:10:40 2018 (r329399) +++ vendor/libc++/dist-release_60/CMakeLists.txt Fri Feb 16 19:10:44 2018 (r329400) @@ -135,6 +135,9 @@ if (LIBCXX_CXX_ABI STREQUAL "default") elseif (APPLE) set(LIBCXX_CXX_ABI_LIBNAME "libcxxabi") set(LIBCXX_CXX_ABI_SYSTEM 1) + elseif (${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD") + set(LIBCXX_CXX_ABI_LIBNAME "libcxxrt") + set(LIBCXX_CXX_ABI_INCLUDE_PATHS "/usr/include/c++/v1") else() set(LIBCXX_CXX_ABI_LIBNAME "default") endif() Modified: vendor/libc++/dist-release_60/test/std/input.output/stream.buffers/streambuf/streambuf.protected/streambuf.put.area/pbump2gig.pass.cpp ============================================================================== --- vendor/libc++/dist-release_60/test/std/input.output/stream.buffers/streambuf/streambuf.protected/streambuf.put.area/pbump2gig.pass.cpp Fri Feb 16 19:10:40 2018 (r329399) +++ vendor/libc++/dist-release_60/test/std/input.output/stream.buffers/streambuf/streambuf.protected/streambuf.put.area/pbump2gig.pass.cpp Fri Feb 16 19:10:44 2018 (r329400) @@ -32,12 +32,13 @@ int main() #ifndef TEST_HAS_NO_EXCEPTIONS try { #endif - std::string str(2147483648, 'a'); - SB sb; - sb.str(str); - assert(sb.pubpbase() <= sb.pubpptr()); + std::string str(2147483648, 'a'); + SB sb; + sb.str(str); + assert(sb.pubpbase() <= sb.pubpptr()); #ifndef TEST_HAS_NO_EXCEPTIONS - } - catch (const std::bad_alloc &) {} + } + catch (const std::length_error &) {} // maybe the string can't take 2GB + catch (const std::bad_alloc &) {} // maybe we don't have enough RAM #endif } Modified: vendor/libc++/dist-release_60/test/std/utilities/meta/meta.unary/meta.unary.prop/has_unique_object_representations.pass.cpp ============================================================================== --- vendor/libc++/dist-release_60/test/std/utilities/meta/meta.unary/meta.unary.prop/has_unique_object_representations.pass.cpp Fri Feb 16 19:10:40 2018 (r329399) +++ vendor/libc++/dist-release_60/test/std/utilities/meta/meta.unary/meta.unary.prop/has_unique_object_representations.pass.cpp Fri Feb 16 19:10:44 2018 (r329400) @@ -55,7 +55,8 @@ class NotEmpty virtual ~NotEmpty(); }; -union Union {}; +union EmptyUnion {}; +struct NonEmptyUnion {int x; unsigned y;}; struct bit_zero { @@ -84,6 +85,7 @@ int main() { test_has_not_has_unique_object_representations(); test_has_not_has_unique_object_representations(); + test_has_not_has_unique_object_representations(); test_has_not_has_unique_object_representations(); test_has_not_has_unique_object_representations(); test_has_not_has_unique_object_representations(); @@ -97,7 +99,7 @@ int main() test_has_unique_object_representations(); - test_has_unique_object_representations(); + test_has_unique_object_representations(); test_has_unique_object_representations(); test_has_unique_object_representations(); From owner-svn-src-all@freebsd.org Fri Feb 16 19:10:50 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 40489F097D6; Fri, 16 Feb 2018 19:10:50 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 716716C793; Fri, 16 Feb 2018 19:10:48 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BFEA711BD9; Fri, 16 Feb 2018 19:10:47 +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 w1GJAlqj069980; Fri, 16 Feb 2018 19:10:47 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1GJAlqE069979; Fri, 16 Feb 2018 19:10:47 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201802161910.w1GJAlqE069979@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Fri, 16 Feb 2018 19:10:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r329401 - vendor/libc++/libc++-release_60-r325330 X-SVN-Group: vendor X-SVN-Commit-Author: dim X-SVN-Commit-Paths: vendor/libc++/libc++-release_60-r325330 X-SVN-Commit-Revision: 329401 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Feb 2018 19:10:50 -0000 Author: dim Date: Fri Feb 16 19:10:47 2018 New Revision: 329401 URL: https://svnweb.freebsd.org/changeset/base/329401 Log: Tag libc++ release_60 branch r325330. Added: vendor/libc++/libc++-release_60-r325330/ - copied from r329400, vendor/libc++/dist-release_60/ From owner-svn-src-all@freebsd.org Fri Feb 16 19:10:53 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8F7FEF0980D; Fri, 16 Feb 2018 19:10:53 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 87B0B6C822; Fri, 16 Feb 2018 19:10:51 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D598311BDB; Fri, 16 Feb 2018 19:10:50 +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 w1GJAoTc070039; Fri, 16 Feb 2018 19:10:50 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1GJAn5F070028; Fri, 16 Feb 2018 19:10:49 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201802161910.w1GJAn5F070028@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Fri, 16 Feb 2018 19:10:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r329402 - in vendor/lld/dist-release_60: COFF ELF test/COFF test/ELF test/ELF/Inputs X-SVN-Group: vendor X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in vendor/lld/dist-release_60: COFF ELF test/COFF test/ELF test/ELF/Inputs X-SVN-Commit-Revision: 329402 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Feb 2018 19:10:53 -0000 Author: dim Date: Fri Feb 16 19:10:49 2018 New Revision: 329402 URL: https://svnweb.freebsd.org/changeset/base/329402 Log: Vendor import of lld release_60 branch r325330: https://llvm.org/svn/llvm-project/lld/branches/release_60@325330 Added: vendor/lld/dist-release_60/test/ELF/Inputs/mips-gp-dips-corrupt-ver.s (contents, props changed) vendor/lld/dist-release_60/test/ELF/Inputs/mips-gp-dips-corrupt-ver.so (contents, props changed) vendor/lld/dist-release_60/test/ELF/mips-gp-disp-ver.s (contents, props changed) Modified: vendor/lld/dist-release_60/COFF/PDB.cpp vendor/lld/dist-release_60/ELF/Driver.cpp vendor/lld/dist-release_60/ELF/InputFiles.cpp vendor/lld/dist-release_60/ELF/Options.td vendor/lld/dist-release_60/test/COFF/pdb-type-server-missing.yaml vendor/lld/dist-release_60/test/ELF/pie.s Modified: vendor/lld/dist-release_60/COFF/PDB.cpp ============================================================================== --- vendor/lld/dist-release_60/COFF/PDB.cpp Fri Feb 16 19:10:47 2018 (r329401) +++ vendor/lld/dist-release_60/COFF/PDB.cpp Fri Feb 16 19:10:49 2018 (r329402) @@ -96,10 +96,11 @@ class PDBLinker { (public) /// If the object does not use a type server PDB (compiled with /Z7), we merge /// all the type and item records from the .debug$S stream and fill in the /// caller-provided ObjectIndexMap. - const CVIndexMap &mergeDebugT(ObjFile *File, CVIndexMap &ObjectIndexMap); + Expected mergeDebugT(ObjFile *File, + CVIndexMap &ObjectIndexMap); - const CVIndexMap &maybeMergeTypeServerPDB(ObjFile *File, - TypeServer2Record &TS); + Expected maybeMergeTypeServerPDB(ObjFile *File, + TypeServer2Record &TS); /// Add the section map and section contributions to the PDB. void addSections(ArrayRef OutputSections, @@ -140,6 +141,10 @@ class PDBLinker { (public) /// Type index mappings of type server PDBs that we've loaded so far. std::map TypeServerIndexMappings; + + /// List of TypeServer PDBs which cannot be loaded. + /// Cached to prevent repeated load attempts. + std::set MissingTypeServerPDBs; }; } @@ -230,8 +235,8 @@ maybeReadTypeServerRecord(CVTypeArray &Types) { return std::move(TS); } -const CVIndexMap &PDBLinker::mergeDebugT(ObjFile *File, - CVIndexMap &ObjectIndexMap) { +Expected PDBLinker::mergeDebugT(ObjFile *File, + CVIndexMap &ObjectIndexMap) { ArrayRef Data = getDebugSection(File, ".debug$T"); if (Data.empty()) return ObjectIndexMap; @@ -304,11 +309,19 @@ tryToLoadPDB(const GUID &GuidFromObj, StringRef TSPath return std::move(NS); } -const CVIndexMap &PDBLinker::maybeMergeTypeServerPDB(ObjFile *File, - TypeServer2Record &TS) { - // First, check if we already loaded a PDB with this GUID. Return the type +Expected PDBLinker::maybeMergeTypeServerPDB(ObjFile *File, + TypeServer2Record &TS) { + const GUID& TSId = TS.getGuid(); + StringRef TSPath = TS.getName(); + + // First, check if the PDB has previously failed to load. + if (MissingTypeServerPDBs.count(TSId)) + return make_error( + pdb::generic_error_code::type_server_not_found, TSPath); + + // Second, check if we already loaded a PDB with this GUID. Return the type // index mapping if we have it. - auto Insertion = TypeServerIndexMappings.insert({TS.getGuid(), CVIndexMap()}); + auto Insertion = TypeServerIndexMappings.insert({TSId, CVIndexMap()}); CVIndexMap &IndexMap = Insertion.first->second; if (!Insertion.second) return IndexMap; @@ -319,18 +332,21 @@ const CVIndexMap &PDBLinker::maybeMergeTypeServerPDB(O // Check for a PDB at: // 1. The given file path // 2. Next to the object file or archive file - auto ExpectedSession = tryToLoadPDB(TS.getGuid(), TS.getName()); + auto ExpectedSession = tryToLoadPDB(TSId, TSPath); if (!ExpectedSession) { consumeError(ExpectedSession.takeError()); StringRef LocalPath = !File->ParentName.empty() ? File->ParentName : File->getName(); SmallString<128> Path = sys::path::parent_path(LocalPath); sys::path::append( - Path, sys::path::filename(TS.getName(), sys::path::Style::windows)); - ExpectedSession = tryToLoadPDB(TS.getGuid(), Path); + Path, sys::path::filename(TSPath, sys::path::Style::windows)); + ExpectedSession = tryToLoadPDB(TSId, Path); } - if (auto E = ExpectedSession.takeError()) - fatal("Type server PDB was not found: " + toString(std::move(E))); + if (auto E = ExpectedSession.takeError()) { + TypeServerIndexMappings.erase(TSId); + MissingTypeServerPDBs.emplace(TSId); + return std::move(E); + } auto ExpectedTpi = (*ExpectedSession)->getPDBFile().getPDBTpiStream(); if (auto E = ExpectedTpi.takeError()) @@ -707,7 +723,16 @@ void PDBLinker::addObjFile(ObjFile *File) { // the PDB first, so that we can get the map from object file type and item // indices to PDB type and item indices. CVIndexMap ObjectIndexMap; - const CVIndexMap &IndexMap = mergeDebugT(File, ObjectIndexMap); + auto IndexMapResult = mergeDebugT(File, ObjectIndexMap); + + // If the .debug$T sections fail to merge, assume there is no debug info. + if (!IndexMapResult) { + warn("Type server PDB for " + Name + " is invalid, ignoring debug info. " + + toString(IndexMapResult.takeError())); + return; + } + + const CVIndexMap &IndexMap = *IndexMapResult; // Now do all live .debug$S sections. for (SectionChunk *DebugChunk : File->getDebugChunks()) { Modified: vendor/lld/dist-release_60/ELF/Driver.cpp ============================================================================== --- vendor/lld/dist-release_60/ELF/Driver.cpp Fri Feb 16 19:10:47 2018 (r329401) +++ vendor/lld/dist-release_60/ELF/Driver.cpp Fri Feb 16 19:10:49 2018 (r329402) @@ -638,7 +638,7 @@ void LinkerDriver::readConfigs(opt::InputArgList &Args Config->Optimize = args::getInteger(Args, OPT_O, 1); Config->OrphanHandling = getOrphanHandling(Args); Config->OutputFile = Args.getLastArgValue(OPT_o); - Config->Pie = Args.hasFlag(OPT_pie, OPT_nopie, false); + Config->Pie = Args.hasFlag(OPT_pie, OPT_no_pie, false); Config->PrintGcSections = Args.hasFlag(OPT_print_gc_sections, OPT_no_print_gc_sections, false); Config->Rpath = getRpath(Args); Modified: vendor/lld/dist-release_60/ELF/InputFiles.cpp ============================================================================== --- vendor/lld/dist-release_60/ELF/InputFiles.cpp Fri Feb 16 19:10:47 2018 (r329401) +++ vendor/lld/dist-release_60/ELF/InputFiles.cpp Fri Feb 16 19:10:49 2018 (r329402) @@ -856,6 +856,14 @@ template void SharedFile::parseRest continue; } + if (Config->EMachine == EM_MIPS) { + // FIXME: MIPS BFD linker puts _gp_disp symbol into DSO files + // and incorrectly assigns VER_NDX_LOCAL to this section global + // symbol. Here is a workaround for this bug. + if (Versym && VersymIndex == VER_NDX_LOCAL && Name == "_gp_disp") + continue; + } + const Elf_Verdef *Ver = nullptr; if (VersymIndex != VER_NDX_GLOBAL) { if (VersymIndex >= Verdefs.size() || VersymIndex == VER_NDX_LOCAL) { Modified: vendor/lld/dist-release_60/ELF/Options.td ============================================================================== --- vendor/lld/dist-release_60/ELF/Options.td Fri Feb 16 19:10:47 2018 (r329401) +++ vendor/lld/dist-release_60/ELF/Options.td Fri Feb 16 19:10:49 2018 (r329402) @@ -202,6 +202,8 @@ def no_gnu_unique: F<"no-gnu-unique">, def no_merge_exidx_entries: F<"no-merge-exidx-entries">, HelpText<"Disable merging .ARM.exidx entries">; +def no_pie: F<"no-pie">, HelpText<"Do not create a position independent executable">; + def no_threads: F<"no-threads">, HelpText<"Do not run the linker multi-threaded">; @@ -210,8 +212,6 @@ def no_whole_archive: F<"no-whole-archive">, def noinhibit_exec: F<"noinhibit-exec">, HelpText<"Retain the executable output file whenever it is still usable">; - -def nopie: F<"nopie">, HelpText<"Do not create a position independent executable">; def no_omagic: Flag<["--"], "no-omagic">, MetaVarName<"">, HelpText<"Do not set the text data sections to be writable">; Modified: vendor/lld/dist-release_60/test/COFF/pdb-type-server-missing.yaml ============================================================================== --- vendor/lld/dist-release_60/test/COFF/pdb-type-server-missing.yaml Fri Feb 16 19:10:47 2018 (r329401) +++ vendor/lld/dist-release_60/test/COFF/pdb-type-server-missing.yaml Fri Feb 16 19:10:49 2018 (r329402) @@ -1,13 +1,10 @@ # This is an object compiled with /Zi (see the LF_TYPESERVER2 record) without an # adjacent type server PDB. Test that LLD fails gracefully on it. -# FIXME: Ideally we'd do what MSVC does, which is to warn and drop all debug -# info in the object with the missing PDB. - # RUN: yaml2obj %s -o %t.obj -# RUN: not lld-link %t.obj -out:%t.exe -debug -pdb:%t.pdb -nodefaultlib -entry:main 2>&1 | FileCheck %s +# RUN: lld-link %t.obj -out:%t.exe -debug -pdb:%t.pdb -nodefaultlib -entry:main 2>&1 | FileCheck %s -# CHECK: error: Type server PDB was not found +# CHECK: warning: Type server PDB for {{.*}}.obj is invalid, ignoring debug info. --- !COFF header: Added: vendor/lld/dist-release_60/test/ELF/Inputs/mips-gp-dips-corrupt-ver.s ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/lld/dist-release_60/test/ELF/Inputs/mips-gp-dips-corrupt-ver.s Fri Feb 16 19:10:49 2018 (r329402) @@ -0,0 +1,14 @@ +# Source file for mips-gp-dips-corrupt-ver.so +# +# % cat gpdisp.ver +# LLD_1.0.0 { global: foo; }; +# +# % as mips-gp-dips-corrupt-ver.s -o mips-gp-dips-corrupt-ver.o +# % ld -shared -o mips-gp-dips-corrupt-ver.so \ +# --version-script gpdisp.ver mips-gp-dips-corrupt-ver.o + + .global foo + .text +foo: + lui $t0, %hi(_gp_disp) + addi $t0, $t0, %lo(_gp_disp) Added: vendor/lld/dist-release_60/test/ELF/Inputs/mips-gp-dips-corrupt-ver.so ============================================================================== Binary file. No diff available. Added: vendor/lld/dist-release_60/test/ELF/mips-gp-disp-ver.s ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/lld/dist-release_60/test/ELF/mips-gp-disp-ver.s Fri Feb 16 19:10:49 2018 (r329402) @@ -0,0 +1,15 @@ +# MIPS BFD linker puts _gp_disp symbol into DSO files and assigns zero +# version definition index to it. This value means 'unversioned local symbol' +# while _gp_disp is a section global symbol. We have to handle this bug +# in the LLD because BFD linker is used for building MIPS toolchain +# libraries. This test checks such handling. + +# RUN: llvm-mc -filetype=obj -triple=mips-unknown-linux %s -o %t.o +# RUN: ld.lld %t.o %S/Inputs/mips-gp-dips-corrupt-ver.so + +# REQUIRES: mips + + .global __start + .text +__start: + lw $t0, %got(foo)($gp) Modified: vendor/lld/dist-release_60/test/ELF/pie.s ============================================================================== --- vendor/lld/dist-release_60/test/ELF/pie.s Fri Feb 16 19:10:47 2018 (r329401) +++ vendor/lld/dist-release_60/test/ELF/pie.s Fri Feb 16 19:10:49 2018 (r329402) @@ -48,7 +48,7 @@ # CHECK: Type: PT_DYNAMIC ## Check -nopie -# RUN: ld.lld -nopie %t1.o -o %t2 +# RUN: ld.lld -no-pie %t1.o -o %t2 # RUN: llvm-readobj -file-headers -r %t2 | FileCheck %s --check-prefix=NOPIE # NOPIE-NOT: Type: SharedObject From owner-svn-src-all@freebsd.org Fri Feb 16 19:11:00 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 00E13F0984B; Fri, 16 Feb 2018 19:11:00 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2C2A66C902; Fri, 16 Feb 2018 19:10:56 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 624A411BDF; Fri, 16 Feb 2018 19:10:55 +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 w1GJAtUg070086; Fri, 16 Feb 2018 19:10:55 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1GJAtkh070085; Fri, 16 Feb 2018 19:10:55 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201802161910.w1GJAtkh070085@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Fri, 16 Feb 2018 19:10:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r329403 - vendor/lld/lld-release_60-r325330 X-SVN-Group: vendor X-SVN-Commit-Author: dim X-SVN-Commit-Paths: vendor/lld/lld-release_60-r325330 X-SVN-Commit-Revision: 329403 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Feb 2018 19:11:00 -0000 Author: dim Date: Fri Feb 16 19:10:54 2018 New Revision: 329403 URL: https://svnweb.freebsd.org/changeset/base/329403 Log: Tag lld release_60 branch r325330. Added: vendor/lld/lld-release_60-r325330/ - copied from r329402, vendor/lld/dist-release_60/ From owner-svn-src-all@freebsd.org Fri Feb 16 19:11:01 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 72385F0985F; Fri, 16 Feb 2018 19:11:01 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 599466C97F; Fri, 16 Feb 2018 19:10:58 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D747711BE1; Fri, 16 Feb 2018 19:10:57 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1GJAvsR070135; Fri, 16 Feb 2018 19:10:57 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1GJAvM5070133; Fri, 16 Feb 2018 19:10:57 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201802161910.w1GJAvM5070133@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Fri, 16 Feb 2018 19:10:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r329404 - in vendor/lldb/dist-release_60/source/Plugins: Platform/NetBSD Process/NetBSD X-SVN-Group: vendor X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in vendor/lldb/dist-release_60/source/Plugins: Platform/NetBSD Process/NetBSD X-SVN-Commit-Revision: 329404 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Feb 2018 19:11:01 -0000 Author: dim Date: Fri Feb 16 19:10:57 2018 New Revision: 329404 URL: https://svnweb.freebsd.org/changeset/base/329404 Log: Vendor import of lldb release_60 branch r325330: https://llvm.org/svn/llvm-project/lldb/branches/release_60@325330 Modified: vendor/lldb/dist-release_60/source/Plugins/Platform/NetBSD/PlatformNetBSD.cpp vendor/lldb/dist-release_60/source/Plugins/Process/NetBSD/NativeProcessNetBSD.cpp Modified: vendor/lldb/dist-release_60/source/Plugins/Platform/NetBSD/PlatformNetBSD.cpp ============================================================================== --- vendor/lldb/dist-release_60/source/Plugins/Platform/NetBSD/PlatformNetBSD.cpp Fri Feb 16 19:10:54 2018 (r329403) +++ vendor/lldb/dist-release_60/source/Plugins/Platform/NetBSD/PlatformNetBSD.cpp Fri Feb 16 19:10:57 2018 (r329404) @@ -45,20 +45,10 @@ static uint32_t g_initialize_count = 0; PlatformSP PlatformNetBSD::CreateInstance(bool force, const ArchSpec *arch) { Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_PLATFORM)); - if (log) { - const char *arch_name; - if (arch && arch->GetArchitectureName()) - arch_name = arch->GetArchitectureName(); - else - arch_name = ""; + LLDB_LOG(log, "force = {0}, arch=({1}, {2})", force, + arch ? arch->GetArchitectureName() : "", + arch ? arch->GetTriple().getTriple() : ""); - const char *triple_cstr = - arch ? arch->GetTriple().getTriple().c_str() : ""; - - log->Printf("PlatformNetBSD::%s(force=%s, arch={%s,%s})", __FUNCTION__, - force ? "true" : "false", arch_name, triple_cstr); - } - bool create = force; if (create == false && arch && arch->IsValid()) { const llvm::Triple &triple = arch->GetTriple(); @@ -72,18 +62,10 @@ PlatformSP PlatformNetBSD::CreateInstance(bool force, } } + LLDB_LOG(log, "create = {0}", create); if (create) { - if (log) - log->Printf("PlatformNetBSD::%s() creating remote-netbsd platform", - __FUNCTION__); return PlatformSP(new PlatformNetBSD(false)); } - - if (log) - log->Printf( - "PlatformNetBSD::%s() aborting creation of remote-netbsd platform", - __FUNCTION__); - return PlatformSP(); } @@ -258,19 +240,15 @@ bool PlatformNetBSD::CanDebugProcess() { } // For local debugging, NetBSD will override the debug logic to use llgs-launch -// rather than -// lldb-launch, llgs-attach. This differs from current lldb-launch, -// debugserver-attach -// approach on MacOSX. -lldb::ProcessSP PlatformNetBSD::DebugProcess( - ProcessLaunchInfo &launch_info, Debugger &debugger, - Target *target, // Can be NULL, if NULL create a new - // target, else use existing one - Status &error) { +// rather than lldb-launch, llgs-attach. This differs from current lldb-launch, +// debugserver-attach approach on MacOSX. +lldb::ProcessSP +PlatformNetBSD::DebugProcess(ProcessLaunchInfo &launch_info, Debugger &debugger, + Target *target, // Can be NULL, if NULL create a new + // target, else use existing one + Status &error) { Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_PLATFORM)); - if (log) - log->Printf("PlatformNetBSD::%s entered (target %p)", __FUNCTION__, - static_cast(target)); + LLDB_LOG(log, "target {0}", target); // If we're a remote host, use standard behavior from parent class. if (!IsHost()) @@ -293,61 +271,42 @@ lldb::ProcessSP PlatformNetBSD::DebugProcess( // Ensure we have a target. if (target == nullptr) { - if (log) - log->Printf("PlatformNetBSD::%s creating new target", __FUNCTION__); - + LLDB_LOG(log, "creating new target"); TargetSP new_target_sp; error = debugger.GetTargetList().CreateTarget(debugger, "", "", false, nullptr, new_target_sp); if (error.Fail()) { - if (log) - log->Printf("PlatformNetBSD::%s failed to create new target: %s", - __FUNCTION__, error.AsCString()); + LLDB_LOG(log, "failed to create new target: {0}", error); return process_sp; } target = new_target_sp.get(); if (!target) { error.SetErrorString("CreateTarget() returned nullptr"); - if (log) - log->Printf("PlatformNetBSD::%s failed: %s", __FUNCTION__, - error.AsCString()); + LLDB_LOG(log, "error: {0}", error); return process_sp; } - } else { - if (log) - log->Printf("PlatformNetBSD::%s using provided target", __FUNCTION__); } // Mark target as currently selected target. debugger.GetTargetList().SetSelectedTarget(target); // Now create the gdb-remote process. - if (log) - log->Printf( - "PlatformNetBSD::%s having target create process with gdb-remote plugin", - __FUNCTION__); + LLDB_LOG(log, "having target create process with gdb-remote plugin"); process_sp = target->CreateProcess( launch_info.GetListenerForProcess(debugger), "gdb-remote", nullptr); if (!process_sp) { error.SetErrorString("CreateProcess() failed for gdb-remote process"); - if (log) - log->Printf("PlatformNetBSD::%s failed: %s", __FUNCTION__, - error.AsCString()); + LLDB_LOG(log, "error: {0}", error); return process_sp; - } else { - if (log) - log->Printf("PlatformNetBSD::%s successfully created process", - __FUNCTION__); } + LLDB_LOG(log, "successfully created process"); // Adjust launch for a hijacker. ListenerSP listener_sp; if (!launch_info.GetHijackListener()) { - if (log) - log->Printf("PlatformNetBSD::%s setting up hijacker", __FUNCTION__); - + LLDB_LOG(log, "setting up hijacker"); listener_sp = Listener::MakeListener("lldb.PlatformNetBSD.DebugProcess.hijack"); launch_info.SetHijackListener(listener_sp); @@ -356,16 +315,13 @@ lldb::ProcessSP PlatformNetBSD::DebugProcess( // Log file actions. if (log) { - log->Printf( - "PlatformNetBSD::%s launching process with the following file actions:", - __FUNCTION__); - + LLDB_LOG(log, "launching process with the following file actions:"); StreamString stream; size_t i = 0; const FileAction *file_action; while ((file_action = launch_info.GetFileActionAtIndex(i++)) != nullptr) { file_action->Dump(stream); - log->PutCString(stream.GetData()); + LLDB_LOG(log, "{0}", stream.GetData()); stream.Clear(); } } @@ -378,16 +334,7 @@ lldb::ProcessSP PlatformNetBSD::DebugProcess( const StateType state = process_sp->WaitForProcessToStop( llvm::None, NULL, false, listener_sp); - if (state == eStateStopped) { - if (log) - log->Printf("PlatformNetBSD::%s pid %" PRIu64 " state %s\n", - __FUNCTION__, process_sp->GetID(), StateAsCString(state)); - } else { - if (log) - log->Printf("PlatformNetBSD::%s pid %" PRIu64 - " state is not stopped - %s\n", - __FUNCTION__, process_sp->GetID(), StateAsCString(state)); - } + LLDB_LOG(log, "pid {0} state {0}", process_sp->GetID(), state); } // Hook up process PTY if we have one (which we should for local debugging @@ -395,20 +342,11 @@ lldb::ProcessSP PlatformNetBSD::DebugProcess( int pty_fd = launch_info.GetPTY().ReleaseMasterFileDescriptor(); if (pty_fd != PseudoTerminal::invalid_fd) { process_sp->SetSTDIOFileDescriptor(pty_fd); - if (log) - log->Printf("PlatformNetBSD::%s pid %" PRIu64 - " hooked up STDIO pty to process", - __FUNCTION__, process_sp->GetID()); - } else { - if (log) - log->Printf("PlatformNetBSD::%s pid %" PRIu64 - " not using process STDIO pty", - __FUNCTION__, process_sp->GetID()); - } + LLDB_LOG(log, "hooked up STDIO pty to process"); + } else + LLDB_LOG(log, "not using process STDIO pty"); } else { - if (log) - log->Printf("PlatformNetBSD::%s process launch failed: %s", __FUNCTION__, - error.AsCString()); + LLDB_LOG(log, "process launch failed: {0}", error); // FIXME figure out appropriate cleanup here. Do we delete the target? Do // we delete the process? Does our caller do that? } Modified: vendor/lldb/dist-release_60/source/Plugins/Process/NetBSD/NativeProcessNetBSD.cpp ============================================================================== --- vendor/lldb/dist-release_60/source/Plugins/Process/NetBSD/NativeProcessNetBSD.cpp Fri Feb 16 19:10:54 2018 (r329403) +++ vendor/lldb/dist-release_60/source/Plugins/Process/NetBSD/NativeProcessNetBSD.cpp Fri Feb 16 19:10:57 2018 (r329404) @@ -111,7 +111,7 @@ NativeProcessNetBSD::Factory::Launch(ProcessLaunchInfo for (const auto &thread : process_up->m_threads) static_cast(*thread).SetStoppedBySignal(SIGSTOP); - process_up->SetState(StateType::eStateStopped); + process_up->SetState(StateType::eStateStopped, false); return std::move(process_up); } From owner-svn-src-all@freebsd.org Fri Feb 16 19:11:04 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 09F2CF09897; Fri, 16 Feb 2018 19:11:04 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8A6EE6C9F2; Fri, 16 Feb 2018 19:11:01 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 994DE11BE4; Fri, 16 Feb 2018 19:11:00 +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 w1GJB0VQ070214; Fri, 16 Feb 2018 19:11:00 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1GJB0pf070213; Fri, 16 Feb 2018 19:11:00 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201802161911.w1GJB0pf070213@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Fri, 16 Feb 2018 19:11:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r329405 - vendor/lldb/lldb-release_60-r325330 X-SVN-Group: vendor X-SVN-Commit-Author: dim X-SVN-Commit-Paths: vendor/lldb/lldb-release_60-r325330 X-SVN-Commit-Revision: 329405 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Feb 2018 19:11:04 -0000 Author: dim Date: Fri Feb 16 19:11:00 2018 New Revision: 329405 URL: https://svnweb.freebsd.org/changeset/base/329405 Log: Tag lldb release_60 branch r325330. Added: vendor/lldb/lldb-release_60-r325330/ - copied from r329404, vendor/lldb/dist-release_60/ From owner-svn-src-all@freebsd.org Fri Feb 16 20:23:49 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 957E8F0EC41; Fri, 16 Feb 2018 20:23:49 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BC246FEDA; Fri, 16 Feb 2018 20:23:49 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 45CC812897; Fri, 16 Feb 2018 20:23:49 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1GKNna0009096; Fri, 16 Feb 2018 20:23:49 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1GKNnao009094; Fri, 16 Feb 2018 20:23:49 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201802162023.w1GKNnao009094@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Fri, 16 Feb 2018 20:23:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329406 - head/tools/boot X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/tools/boot X-SVN-Commit-Revision: 329406 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Feb 2018 20:23:49 -0000 Author: kevans Date: Fri Feb 16 20:23:48 2018 New Revision: 329406 URL: https://svnweb.freebsd.org/changeset/base/329406 Log: Default to /tmp/loadertest for lua test scripts Modified: head/tools/boot/lua-img.sh head/tools/boot/lua-test.sh Modified: head/tools/boot/lua-img.sh ============================================================================== --- head/tools/boot/lua-img.sh Fri Feb 16 19:11:00 2018 (r329405) +++ head/tools/boot/lua-img.sh Fri Feb 16 20:23:48 2018 (r329406) @@ -2,6 +2,7 @@ # $FreeBSD$ # Quick script to build a suitable /boot dir somewhere in the tree for testing. +# dir may be passed in, will default to /tmp/loadertest if not specified die() { echo $* @@ -11,7 +12,7 @@ die() { dir=$1 cd $(make -V SRCTOP) -[ -n "$dir" ] || die "No directory specified" +[ -n "$dir" ] || dir=/tmp/loadertest set -e Modified: head/tools/boot/lua-test.sh ============================================================================== --- head/tools/boot/lua-test.sh Fri Feb 16 19:11:00 2018 (r329405) +++ head/tools/boot/lua-test.sh Fri Feb 16 20:23:48 2018 (r329406) @@ -12,7 +12,7 @@ obj=$(make -V .OBJDIR) t=$obj/userboot/test/test u=$obj/userboot/userboot/userboot.so -[ -n "$dir" ] || die "No directory specified" +[ -n "$dir" ] || dir=/tmp/loadertest [ -d "$dir" ] || die "Directory $dir doesn't exist" [ -f "$dir/boot/lua/loader.lua" ] || die "No boot/lua/loader.lua found" [ -f "$dir/boot/kernel/kernel" ] || die "No kernel to load" From owner-svn-src-all@freebsd.org Fri Feb 16 20:26:19 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0BF7AF0EF4D; Fri, 16 Feb 2018 20:26:19 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B3C2D700D5; Fri, 16 Feb 2018 20:26:18 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AE3031289A; Fri, 16 Feb 2018 20:26:18 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1GKQIHo009224; Fri, 16 Feb 2018 20:26:18 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1GKQI7k009223; Fri, 16 Feb 2018 20:26:18 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201802162026.w1GKQI7k009223@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Fri, 16 Feb 2018 20:26:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329407 - head/tools/boot X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/tools/boot X-SVN-Commit-Revision: 329407 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Feb 2018 20:26:19 -0000 Author: kevans Date: Fri Feb 16 20:26:18 2018 New Revision: 329407 URL: https://svnweb.freebsd.org/changeset/base/329407 Log: lua-test: Image the loader test directory if it doesn't exist yet Modified: head/tools/boot/lua-test.sh Modified: head/tools/boot/lua-test.sh ============================================================================== --- head/tools/boot/lua-test.sh Fri Feb 16 20:23:48 2018 (r329406) +++ head/tools/boot/lua-test.sh Fri Feb 16 20:26:18 2018 (r329407) @@ -1,19 +1,22 @@ #!/bin/sh # $FreeBSD$ +# Will image the test directory (default /tmp/loadertest) if it doesn't exist + die() { echo $* exit 1 } dir=$1 +scriptdir=$(dirname $(realpath $0)) cd $(make -V SRCTOP)/stand obj=$(make -V .OBJDIR) t=$obj/userboot/test/test u=$obj/userboot/userboot/userboot.so [ -n "$dir" ] || dir=/tmp/loadertest -[ -d "$dir" ] || die "Directory $dir doesn't exist" +[ -d "$dir" ] || ${scriptdir}/lua-img.sh ${dir} [ -f "$dir/boot/lua/loader.lua" ] || die "No boot/lua/loader.lua found" [ -f "$dir/boot/kernel/kernel" ] || die "No kernel to load" [ -x "$t" ] || die "no userboot test jig found ($t)" From owner-svn-src-all@freebsd.org Fri Feb 16 20:45:36 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BAD66F10A21; Fri, 16 Feb 2018 20:45:35 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 65ED071704; Fri, 16 Feb 2018 20:45:35 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 60AD212BE4; Fri, 16 Feb 2018 20:45:35 +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 w1GKjZkj020288; Fri, 16 Feb 2018 20:45:35 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1GKjWf2020258; Fri, 16 Feb 2018 20:45:32 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201802162045.w1GKjWf2020258@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Fri, 16 Feb 2018 20:45:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329410 - in head: contrib/compiler-rt/lib/asan contrib/llvm/include/llvm/IR contrib/llvm/include/llvm/MC contrib/llvm/include/llvm/Support contrib/llvm/lib/CodeGen contrib/llvm/lib/Cod... X-SVN-Group: head X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in head: contrib/compiler-rt/lib/asan contrib/llvm/include/llvm/IR contrib/llvm/include/llvm/MC contrib/llvm/include/llvm/Support contrib/llvm/lib/CodeGen contrib/llvm/lib/CodeGen/AsmPrinter contrib/l... X-SVN-Commit-Revision: 329410 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Feb 2018 20:45:36 -0000 Author: dim Date: Fri Feb 16 20:45:32 2018 New Revision: 329410 URL: https://svnweb.freebsd.org/changeset/base/329410 Log: Upgrade our copies of clang, llvm, lld, lldb, compiler-rt and libc++ to 6.0.0 (branches/release_60 r325330). MFC after: 3 months X-MFC-With: r327952 PR: 224669 Added: head/contrib/llvm/include/llvm/MC/MCAsmMacro.h - copied unchanged from r329405, vendor/llvm/dist-release_60/include/llvm/MC/MCAsmMacro.h Modified: head/contrib/compiler-rt/lib/asan/asan_linux.cc head/contrib/llvm/include/llvm/IR/IntrinsicsAMDGPU.td head/contrib/llvm/include/llvm/IR/IntrinsicsX86.td head/contrib/llvm/include/llvm/MC/MCContext.h head/contrib/llvm/include/llvm/Support/GenericDomTreeConstruction.h head/contrib/llvm/lib/CodeGen/AsmPrinter/DebugHandlerBase.cpp head/contrib/llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp head/contrib/llvm/lib/CodeGen/LivePhysRegs.cpp head/contrib/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp head/contrib/llvm/lib/CodeGen/SplitKit.cpp head/contrib/llvm/lib/CodeGen/SplitKit.h head/contrib/llvm/lib/IR/AutoUpgrade.cpp head/contrib/llvm/lib/MC/MCParser/AsmParser.cpp head/contrib/llvm/lib/Target/AMDGPU/AMDGPUISelLowering.cpp head/contrib/llvm/lib/Target/AMDGPU/AMDGPUISelLowering.h head/contrib/llvm/lib/Target/AMDGPU/AMDGPUInstrInfo.cpp head/contrib/llvm/lib/Target/AMDGPU/AMDGPUInstrInfo.h head/contrib/llvm/lib/Target/AMDGPU/AMDGPUInstrInfo.td head/contrib/llvm/lib/Target/AMDGPU/AMDGPURegisterBankInfo.cpp head/contrib/llvm/lib/Target/AMDGPU/SIISelLowering.cpp head/contrib/llvm/lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.cpp head/contrib/llvm/lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.h head/contrib/llvm/lib/Target/AMDGPU/VOP2Instructions.td head/contrib/llvm/lib/Target/X86/MCTargetDesc/X86MCCodeEmitter.cpp head/contrib/llvm/lib/Target/X86/X86AsmPrinter.cpp head/contrib/llvm/lib/Target/X86/X86DomainReassignment.cpp head/contrib/llvm/lib/Target/X86/X86ISelLowering.cpp head/contrib/llvm/lib/Target/X86/X86IntrinsicsInfo.h head/contrib/llvm/lib/Target/X86/X86RetpolineThunks.cpp head/contrib/llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp head/contrib/llvm/tools/clang/include/clang/AST/DeclBase.h head/contrib/llvm/tools/clang/lib/AST/ASTContext.cpp head/contrib/llvm/tools/clang/lib/AST/DeclBase.cpp head/contrib/llvm/tools/clang/lib/AST/MicrosoftMangle.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CodeGenModule.cpp head/contrib/llvm/tools/clang/lib/CodeGen/ItaniumCXXABI.cpp head/contrib/llvm/tools/clang/lib/Format/TokenAnnotator.cpp head/contrib/llvm/tools/clang/lib/Format/UnwrappedLineParser.cpp head/contrib/llvm/tools/clang/lib/Format/UnwrappedLineParser.h head/contrib/llvm/tools/clang/lib/Headers/avx512bwintrin.h head/contrib/llvm/tools/clang/lib/Headers/avx512fintrin.h head/contrib/llvm/tools/clang/lib/Lex/LiteralSupport.cpp head/contrib/llvm/tools/clang/lib/Sema/SemaChecking.cpp head/contrib/llvm/tools/clang/lib/Sema/SemaInit.cpp head/contrib/llvm/tools/lld/COFF/PDB.cpp head/contrib/llvm/tools/lld/ELF/Driver.cpp head/contrib/llvm/tools/lld/ELF/InputFiles.cpp head/contrib/llvm/tools/lld/ELF/Options.td head/contrib/llvm/tools/lldb/source/Plugins/Platform/NetBSD/PlatformNetBSD.cpp head/contrib/llvm/tools/lldb/source/Plugins/Process/NetBSD/NativeProcessNetBSD.cpp head/lib/clang/include/clang/Basic/Version.inc head/lib/clang/include/lld/Common/Version.inc head/lib/clang/include/llvm/Support/VCSRevision.h Directory Properties: head/contrib/compiler-rt/ (props changed) head/contrib/libc++/ (props changed) head/contrib/llvm/ (props changed) head/contrib/llvm/tools/clang/ (props changed) head/contrib/llvm/tools/lld/ (props changed) head/contrib/llvm/tools/lldb/ (props changed) Modified: head/contrib/compiler-rt/lib/asan/asan_linux.cc ============================================================================== --- head/contrib/compiler-rt/lib/asan/asan_linux.cc Fri Feb 16 20:44:50 2018 (r329409) +++ head/contrib/compiler-rt/lib/asan/asan_linux.cc Fri Feb 16 20:45:32 2018 (r329410) @@ -32,6 +32,7 @@ #include #include #include +#include #include #include #include @@ -214,7 +215,7 @@ void AsanCheckIncompatibleRT() { // the functions in dynamic ASan runtime instead of the functions in // system libraries, causing crashes later in ASan initialization. MemoryMappingLayout proc_maps(/*cache_enabled*/true); - char filename[128]; + char filename[PATH_MAX]; MemoryMappedSegment segment(filename, sizeof(filename)); while (proc_maps.Next(&segment)) { if (IsDynamicRTName(segment.filename)) { Modified: head/contrib/llvm/include/llvm/IR/IntrinsicsAMDGPU.td ============================================================================== --- head/contrib/llvm/include/llvm/IR/IntrinsicsAMDGPU.td Fri Feb 16 20:44:50 2018 (r329409) +++ head/contrib/llvm/include/llvm/IR/IntrinsicsAMDGPU.td Fri Feb 16 20:45:32 2018 (r329410) @@ -238,6 +238,26 @@ def int_amdgcn_cvt_pkrtz : Intrinsic< [IntrNoMem, IntrSpeculatable] >; +def int_amdgcn_cvt_pknorm_i16 : Intrinsic< + [llvm_v2i16_ty], [llvm_float_ty, llvm_float_ty], + [IntrNoMem, IntrSpeculatable] +>; + +def int_amdgcn_cvt_pknorm_u16 : Intrinsic< + [llvm_v2i16_ty], [llvm_float_ty, llvm_float_ty], + [IntrNoMem, IntrSpeculatable] +>; + +def int_amdgcn_cvt_pk_i16 : Intrinsic< + [llvm_v2i16_ty], [llvm_i32_ty, llvm_i32_ty], + [IntrNoMem, IntrSpeculatable] +>; + +def int_amdgcn_cvt_pk_u16 : Intrinsic< + [llvm_v2i16_ty], [llvm_i32_ty, llvm_i32_ty], + [IntrNoMem, IntrSpeculatable] +>; + def int_amdgcn_class : Intrinsic< [llvm_i1_ty], [llvm_anyfloat_ty, llvm_i32_ty], [IntrNoMem, IntrSpeculatable] Modified: head/contrib/llvm/include/llvm/IR/IntrinsicsX86.td ============================================================================== --- head/contrib/llvm/include/llvm/IR/IntrinsicsX86.td Fri Feb 16 20:44:50 2018 (r329409) +++ head/contrib/llvm/include/llvm/IR/IntrinsicsX86.td Fri Feb 16 20:45:32 2018 (r329410) @@ -3738,6 +3738,15 @@ let TargetPrefix = "x86" in { // All intrinsics start def int_x86_avx512_kxnor_w : // TODO: remove this intrinsic Intrinsic<[llvm_i16_ty], [llvm_i16_ty, llvm_i16_ty], [IntrNoMem]>; + def int_x86_avx512_kunpck_bw : GCCBuiltin<"__builtin_ia32_kunpckhi">, + Intrinsic<[llvm_i16_ty], [llvm_i16_ty, llvm_i16_ty], + [IntrNoMem]>; + def int_x86_avx512_kunpck_wd : GCCBuiltin<"__builtin_ia32_kunpcksi">, + Intrinsic<[llvm_i32_ty], [llvm_i32_ty, llvm_i32_ty], + [IntrNoMem]>; + def int_x86_avx512_kunpck_dq : GCCBuiltin<"__builtin_ia32_kunpckdi">, + Intrinsic<[llvm_i64_ty], [llvm_i64_ty, llvm_i64_ty], + [IntrNoMem]>; def int_x86_avx512_kortestz_w : GCCBuiltin<"__builtin_ia32_kortestzhi">, Intrinsic<[llvm_i32_ty], [llvm_i16_ty, llvm_i16_ty], [IntrNoMem]>; Copied: head/contrib/llvm/include/llvm/MC/MCAsmMacro.h (from r329405, vendor/llvm/dist-release_60/include/llvm/MC/MCAsmMacro.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/llvm/include/llvm/MC/MCAsmMacro.h Fri Feb 16 20:45:32 2018 (r329410, copy of r329405, vendor/llvm/dist-release_60/include/llvm/MC/MCAsmMacro.h) @@ -0,0 +1,38 @@ +//===- MCAsmMacro.h - Assembly Macros ---------------------------*- C++ -*-===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +#ifndef LLVM_MC_MCASMMACRO_H +#define LLVM_MC_MCASMMACRO_H + +#include "llvm/MC/MCParser/MCAsmLexer.h" + +namespace llvm { + +struct MCAsmMacroParameter { + StringRef Name; + std::vector Value; + bool Required = false; + bool Vararg = false; + + MCAsmMacroParameter() = default; +}; + +typedef std::vector MCAsmMacroParameters; +struct MCAsmMacro { + StringRef Name; + StringRef Body; + MCAsmMacroParameters Parameters; + +public: + MCAsmMacro(StringRef N, StringRef B, MCAsmMacroParameters P) + : Name(N), Body(B), Parameters(std::move(P)) {} +}; +}; // namespace llvm + +#endif Modified: head/contrib/llvm/include/llvm/MC/MCContext.h ============================================================================== --- head/contrib/llvm/include/llvm/MC/MCContext.h Fri Feb 16 20:44:50 2018 (r329409) +++ head/contrib/llvm/include/llvm/MC/MCContext.h Fri Feb 16 20:45:32 2018 (r329410) @@ -18,6 +18,7 @@ #include "llvm/ADT/StringRef.h" #include "llvm/ADT/Twine.h" #include "llvm/BinaryFormat/Dwarf.h" +#include "llvm/MC/MCAsmMacro.h" #include "llvm/MC/MCDwarf.h" #include "llvm/MC/MCSubtargetInfo.h" #include "llvm/MC/SectionKind.h" @@ -268,6 +269,9 @@ namespace llvm { unsigned UniqueID, const MCSymbolELF *Associated); + /// \brief Map of currently defined macros. + StringMap MacroMap; + public: explicit MCContext(const MCAsmInfo *MAI, const MCRegisterInfo *MRI, const MCObjectFileInfo *MOFI, @@ -618,6 +622,17 @@ namespace llvm { // FIXME: We should really do something about that. LLVM_ATTRIBUTE_NORETURN void reportFatalError(SMLoc L, const Twine &Msg); + + const MCAsmMacro *lookupMacro(StringRef Name) { + StringMap::iterator I = MacroMap.find(Name); + return (I == MacroMap.end()) ? nullptr : &I->getValue(); + } + + void defineMacro(StringRef Name, MCAsmMacro Macro) { + MacroMap.insert(std::make_pair(Name, std::move(Macro))); + } + + void undefineMacro(StringRef Name) { MacroMap.erase(Name); } }; } // end namespace llvm Modified: head/contrib/llvm/include/llvm/Support/GenericDomTreeConstruction.h ============================================================================== --- head/contrib/llvm/include/llvm/Support/GenericDomTreeConstruction.h Fri Feb 16 20:44:50 2018 (r329409) +++ head/contrib/llvm/include/llvm/Support/GenericDomTreeConstruction.h Fri Feb 16 20:45:32 2018 (r329410) @@ -698,24 +698,20 @@ struct SemiNCAInfo { return; // Recalculate the set of roots. - DT.Roots = FindRoots(DT, BUI); - for (const NodePtr R : DT.Roots) { - const TreeNodePtr TN = DT.getNode(R); - // A CFG node was selected as a tree root, but the corresponding tree node - // is not connected to the virtual root. This is because the incremental - // algorithm does not really know or use the set of roots and can make a - // different (implicit) decision about which nodes within an infinite loop - // becomes a root. - if (TN && !DT.isVirtualRoot(TN->getIDom())) { - DEBUG(dbgs() << "Root " << BlockNamePrinter(R) - << " is not virtual root's child\n" - << "The entire tree needs to be rebuilt\n"); - // It should be possible to rotate the subtree instead of recalculating - // the whole tree, but this situation happens extremely rarely in - // practice. - CalculateFromScratch(DT, BUI); - return; - } + auto Roots = FindRoots(DT, BUI); + if (DT.Roots.size() != Roots.size() || + !std::is_permutation(DT.Roots.begin(), DT.Roots.end(), Roots.begin())) { + // The roots chosen in the CFG have changed. This is because the + // incremental algorithm does not really know or use the set of roots and + // can make a different (implicit) decision about which node within an + // infinite loop becomes a root. + + DEBUG(dbgs() << "Roots are different in updated trees\n" + << "The entire tree needs to be rebuilt\n"); + // It may be possible to update the tree without recalculating it, but + // we do not know yet how to do it, and it happens rarely in practise. + CalculateFromScratch(DT, BUI); + return; } } Modified: head/contrib/llvm/lib/CodeGen/AsmPrinter/DebugHandlerBase.cpp ============================================================================== --- head/contrib/llvm/lib/CodeGen/AsmPrinter/DebugHandlerBase.cpp Fri Feb 16 20:44:50 2018 (r329409) +++ head/contrib/llvm/lib/CodeGen/AsmPrinter/DebugHandlerBase.cpp Fri Feb 16 20:45:32 2018 (r329410) @@ -163,7 +163,8 @@ uint64_t DebugHandlerBase::getBaseTypeSize(const DITyp DIType *BaseType = DDTy->getBaseType().resolve(); - assert(BaseType && "Unexpected invalid base type"); + if (!BaseType) + return 0; // If this is a derived type, go ahead and get the base type, unless it's a // reference then it's just the size of the field. Pointer types have no need Modified: head/contrib/llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp ============================================================================== --- head/contrib/llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp Fri Feb 16 20:44:50 2018 (r329409) +++ head/contrib/llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp Fri Feb 16 20:45:32 2018 (r329410) @@ -1391,7 +1391,8 @@ void DwarfUnit::constructMemberDIE(DIE &Buffer, const if (!Name.empty()) addString(MemberDie, dwarf::DW_AT_name, Name); - addType(MemberDie, resolve(DT->getBaseType())); + if (DIType *Resolved = resolve(DT->getBaseType())) + addType(MemberDie, Resolved); addSourceLine(MemberDie, DT); Modified: head/contrib/llvm/lib/CodeGen/LivePhysRegs.cpp ============================================================================== --- head/contrib/llvm/lib/CodeGen/LivePhysRegs.cpp Fri Feb 16 20:44:50 2018 (r329409) +++ head/contrib/llvm/lib/CodeGen/LivePhysRegs.cpp Fri Feb 16 20:45:32 2018 (r329410) @@ -205,14 +205,18 @@ void LivePhysRegs::addPristines(const MachineFunction } void LivePhysRegs::addLiveOutsNoPristines(const MachineBasicBlock &MBB) { - if (!MBB.succ_empty()) { - // To get the live-outs we simply merge the live-ins of all successors. - for (const MachineBasicBlock *Succ : MBB.successors()) - addBlockLiveIns(*Succ); - } else if (MBB.isReturnBlock()) { - // For the return block: Add all callee saved registers that are saved and - // restored (somewhere); This does not include callee saved registers that - // are unused and hence not saved and restored; they are called pristine. + // To get the live-outs we simply merge the live-ins of all successors. + for (const MachineBasicBlock *Succ : MBB.successors()) + addBlockLiveIns(*Succ); + if (MBB.isReturnBlock()) { + // Return blocks are a special case because we currently don't mark up + // return instructions completely: specifically, there is no explicit + // use for callee-saved registers. So we add all callee saved registers + // that are saved and restored (somewhere). This does not include + // callee saved registers that are unused and hence not saved and + // restored; they are called pristine. + // FIXME: PEI should add explicit markings to return instructions + // instead of implicitly handling them here. const MachineFunction &MF = *MBB.getParent(); const MachineFrameInfo &MFI = MF.getFrameInfo(); if (MFI.isCalleeSavedInfoValid()) { @@ -225,15 +229,8 @@ void LivePhysRegs::addLiveOutsNoPristines(const Machin void LivePhysRegs::addLiveOuts(const MachineBasicBlock &MBB) { const MachineFunction &MF = *MBB.getParent(); - if (!MBB.succ_empty()) { - addPristines(MF); - addLiveOutsNoPristines(MBB); - } else if (MBB.isReturnBlock()) { - // For the return block: Add all callee saved registers. - const MachineFrameInfo &MFI = MF.getFrameInfo(); - if (MFI.isCalleeSavedInfoValid()) - addCalleeSavedRegs(*this, MF); - } + addPristines(MF); + addLiveOutsNoPristines(MBB); } void LivePhysRegs::addLiveIns(const MachineBasicBlock &MBB) { Modified: head/contrib/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp ============================================================================== --- head/contrib/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp Fri Feb 16 20:44:50 2018 (r329409) +++ head/contrib/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp Fri Feb 16 20:45:32 2018 (r329410) @@ -16409,7 +16409,9 @@ SDValue DAGCombiner::visitINSERT_SUBVECTOR(SDNode *N) N1.getOperand(0).getOpcode() == ISD::EXTRACT_SUBVECTOR && N1.getOperand(0).getOperand(1) == N2 && N1.getOperand(0).getOperand(0).getValueType().getVectorNumElements() == - VT.getVectorNumElements()) { + VT.getVectorNumElements() && + N1.getOperand(0).getOperand(0).getValueType().getSizeInBits() == + VT.getSizeInBits()) { return DAG.getBitcast(VT, N1.getOperand(0).getOperand(0)); } Modified: head/contrib/llvm/lib/CodeGen/SplitKit.cpp ============================================================================== --- head/contrib/llvm/lib/CodeGen/SplitKit.cpp Fri Feb 16 20:44:50 2018 (r329409) +++ head/contrib/llvm/lib/CodeGen/SplitKit.cpp Fri Feb 16 20:45:32 2018 (r329410) @@ -491,9 +491,8 @@ VNInfo *SplitEditor::defValue(unsigned RegIdx, return VNI; } -void SplitEditor::forceRecompute(unsigned RegIdx, const VNInfo *ParentVNI) { - assert(ParentVNI && "Mapping NULL value"); - ValueForcePair &VFP = Values[std::make_pair(RegIdx, ParentVNI->id)]; +void SplitEditor::forceRecompute(unsigned RegIdx, const VNInfo &ParentVNI) { + ValueForcePair &VFP = Values[std::make_pair(RegIdx, ParentVNI.id)]; VNInfo *VNI = VFP.getPointer(); // ParentVNI was either unmapped or already complex mapped. Either way, just @@ -777,7 +776,7 @@ SlotIndex SplitEditor::leaveIntvAfter(SlotIndex Idx) { // the source live range. The spiller also won't try to hoist this copy. if (SpillMode && !SlotIndex::isSameInstr(ParentVNI->def, Idx) && MI->readsVirtualRegister(Edit->getReg())) { - forceRecompute(0, ParentVNI); + forceRecompute(0, *ParentVNI); defFromParent(0, ParentVNI, Idx, *MI->getParent(), MI); return Idx; } @@ -835,7 +834,7 @@ void SplitEditor::overlapIntv(SlotIndex Start, SlotInd // The complement interval will be extended as needed by LRCalc.extend(). if (ParentVNI) - forceRecompute(0, ParentVNI); + forceRecompute(0, *ParentVNI); DEBUG(dbgs() << " overlapIntv [" << Start << ';' << End << "):"); RegAssign.insert(Start, End, OpenIdx); DEBUG(dump()); @@ -878,7 +877,7 @@ void SplitEditor::removeBackCopies(SmallVectorImplreadsVirtualRegister(Edit->getReg())) { DEBUG(dbgs() << " cannot find simple kill of RegIdx " << RegIdx << '\n'); - forceRecompute(RegIdx, Edit->getParent().getVNInfoAt(Def)); + forceRecompute(RegIdx, *Edit->getParent().getVNInfoAt(Def)); } else { SlotIndex Kill = LIS.getInstructionIndex(*MBBI).getRegSlot(); DEBUG(dbgs() << " move kill to " << Kill << '\t' << *MBBI); @@ -982,7 +981,7 @@ void SplitEditor::computeRedundantBackCopies( } } if (!DominatedVNIs.empty()) { - forceRecompute(0, ParentVNI); + forceRecompute(0, *ParentVNI); for (auto VNI : DominatedVNIs) { BackCopies.push_back(VNI); } @@ -1102,7 +1101,7 @@ void SplitEditor::hoistCopies() { NotToHoistSet.count(ParentVNI->id)) continue; BackCopies.push_back(VNI); - forceRecompute(0, ParentVNI); + forceRecompute(0, *ParentVNI); } // If it is not beneficial to hoist all the BackCopies, simply remove @@ -1428,6 +1427,41 @@ void SplitEditor::deleteRematVictims() { Edit->eliminateDeadDefs(Dead, None, &AA); } +void SplitEditor::forceRecomputeVNI(const VNInfo &ParentVNI) { + // Fast-path for common case. + if (!ParentVNI.isPHIDef()) { + for (unsigned I = 0, E = Edit->size(); I != E; ++I) + forceRecompute(I, ParentVNI); + return; + } + + // Trace value through phis. + SmallPtrSet Visited; ///< whether VNI was/is in worklist. + SmallVector WorkList; + Visited.insert(&ParentVNI); + WorkList.push_back(&ParentVNI); + + const LiveInterval &ParentLI = Edit->getParent(); + const SlotIndexes &Indexes = *LIS.getSlotIndexes(); + do { + const VNInfo &VNI = *WorkList.back(); + WorkList.pop_back(); + for (unsigned I = 0, E = Edit->size(); I != E; ++I) + forceRecompute(I, VNI); + if (!VNI.isPHIDef()) + continue; + + MachineBasicBlock &MBB = *Indexes.getMBBFromIndex(VNI.def); + for (const MachineBasicBlock *Pred : MBB.predecessors()) { + SlotIndex PredEnd = Indexes.getMBBEndIdx(Pred); + VNInfo *PredVNI = ParentLI.getVNInfoBefore(PredEnd); + assert(PredVNI && "Value available in PhiVNI predecessor"); + if (Visited.insert(PredVNI).second) + WorkList.push_back(PredVNI); + } + } while(!WorkList.empty()); +} + void SplitEditor::finish(SmallVectorImpl *LRMap) { ++NumFinished; @@ -1444,8 +1478,7 @@ void SplitEditor::finish(SmallVectorImpl *LR // Force rematted values to be recomputed everywhere. // The new live ranges may be truncated. if (Edit->didRematerialize(ParentVNI)) - for (unsigned i = 0, e = Edit->size(); i != e; ++i) - forceRecompute(i, ParentVNI); + forceRecomputeVNI(*ParentVNI); } // Hoist back-copies to the complement interval when in spill mode. Modified: head/contrib/llvm/lib/CodeGen/SplitKit.h ============================================================================== --- head/contrib/llvm/lib/CodeGen/SplitKit.h Fri Feb 16 20:44:50 2018 (r329409) +++ head/contrib/llvm/lib/CodeGen/SplitKit.h Fri Feb 16 20:45:32 2018 (r329410) @@ -357,7 +357,11 @@ class LLVM_LIBRARY_VISIBILITY SplitEditor { (private) /// recomputed by LiveRangeCalc::extend regardless of the number of defs. /// This is used for values whose live range doesn't match RegAssign exactly. /// They could have rematerialized, or back-copies may have been moved. - void forceRecompute(unsigned RegIdx, const VNInfo *ParentVNI); + void forceRecompute(unsigned RegIdx, const VNInfo &ParentVNI); + + /// Calls forceRecompute() on any affected regidx and on ParentVNI + /// predecessors in case of a phi definition. + void forceRecomputeVNI(const VNInfo &ParentVNI); /// defFromParent - Define Reg from ParentVNI at UseIdx using either /// rematerialization or a COPY from parent. Return the new value. Modified: head/contrib/llvm/lib/IR/AutoUpgrade.cpp ============================================================================== --- head/contrib/llvm/lib/IR/AutoUpgrade.cpp Fri Feb 16 20:44:50 2018 (r329409) +++ head/contrib/llvm/lib/IR/AutoUpgrade.cpp Fri Feb 16 20:45:32 2018 (r329410) @@ -75,7 +75,6 @@ static bool ShouldUpgradeX86Intrinsic(Function *F, Str Name=="ssse3.pabs.d.128" || // Added in 6.0 Name.startswith("avx512.mask.shuf.i") || // Added in 6.0 Name.startswith("avx512.mask.shuf.f") || // Added in 6.0 - Name.startswith("avx512.kunpck") || //added in 6.0 Name.startswith("avx2.pabs.") || // Added in 6.0 Name.startswith("avx512.mask.pabs.") || // Added in 6.0 Name.startswith("avx512.broadcastm") || // Added in 6.0 @@ -1063,12 +1062,6 @@ void llvm::UpgradeIntrinsicCall(CallInst *CI, Function Rep = Builder.CreateVectorSplat(NumElts, CI->getArgOperand(0)); Rep = EmitX86Select(Builder, CI->getArgOperand(2), Rep, CI->getArgOperand(1)); - } else if (IsX86 && (Name.startswith("avx512.kunpck"))) { - uint64_t Shift = CI->getType()->getScalarSizeInBits() / 2; - uint64_t And = (1ULL << Shift) - 1; - Value* LowBits = Builder.CreateAnd(CI->getArgOperand(0), And); - Value* HighBits = Builder.CreateShl(CI->getArgOperand(1), Shift); - Rep = Builder.CreateOr(LowBits, HighBits); } else if (IsX86 && (Name == "sse.add.ss" || Name == "sse2.add.sd")) { Type *I32Ty = Type::getInt32Ty(C); Value *Elt0 = Builder.CreateExtractElement(CI->getArgOperand(0), Modified: head/contrib/llvm/lib/MC/MCParser/AsmParser.cpp ============================================================================== --- head/contrib/llvm/lib/MC/MCParser/AsmParser.cpp Fri Feb 16 20:44:50 2018 (r329409) +++ head/contrib/llvm/lib/MC/MCParser/AsmParser.cpp Fri Feb 16 20:45:32 2018 (r329410) @@ -83,27 +83,6 @@ namespace { typedef std::vector MCAsmMacroArgument; typedef std::vector MCAsmMacroArguments; -struct MCAsmMacroParameter { - StringRef Name; - MCAsmMacroArgument Value; - bool Required = false; - bool Vararg = false; - - MCAsmMacroParameter() = default; -}; - -typedef std::vector MCAsmMacroParameters; - -struct MCAsmMacro { - StringRef Name; - StringRef Body; - MCAsmMacroParameters Parameters; - -public: - MCAsmMacro(StringRef N, StringRef B, MCAsmMacroParameters P) - : Name(N), Body(B), Parameters(std::move(P)) {} -}; - /// \brief Helper class for storing information about an active macro /// instantiation. struct MacroInstantiation { @@ -164,9 +143,6 @@ class AsmParser : public MCAsmParser { (private) /// addDirectiveHandler. StringMap ExtensionDirectiveMap; - /// \brief Map of currently defined macros. - StringMap MacroMap; - /// \brief Stack of active macro instantiations. std::vector ActiveMacros; @@ -308,17 +284,6 @@ class AsmParser : public MCAsmParser { (private) /// \brief Control a flag in the parser that enables or disables macros. void setMacrosEnabled(bool Flag) {MacrosEnabledFlag = Flag;} - /// \brief Lookup a previously defined macro. - /// \param Name Macro name. - /// \returns Pointer to macro. NULL if no such macro was defined. - const MCAsmMacro* lookupMacro(StringRef Name); - - /// \brief Define a new macro with the given name and information. - void defineMacro(StringRef Name, MCAsmMacro Macro); - - /// \brief Undefine a macro. If no such macro was defined, it's a no-op. - void undefineMacro(StringRef Name); - /// \brief Are we inside a macro instantiation? bool isInsideMacroInstantiation() {return !ActiveMacros.empty();} @@ -1841,7 +1806,7 @@ bool AsmParser::parseStatement(ParseStatementInfo &Inf // If macros are enabled, check to see if this is a macro instantiation. if (areMacrosEnabled()) - if (const MCAsmMacro *M = lookupMacro(IDVal)) { + if (const MCAsmMacro *M = getContext().lookupMacro(IDVal)) { return handleMacroEntry(M, IDLoc); } @@ -2720,17 +2685,6 @@ bool AsmParser::parseMacroArguments(const MCAsmMacro * return TokError("too many positional arguments"); } -const MCAsmMacro *AsmParser::lookupMacro(StringRef Name) { - StringMap::iterator I = MacroMap.find(Name); - return (I == MacroMap.end()) ? nullptr : &I->getValue(); -} - -void AsmParser::defineMacro(StringRef Name, MCAsmMacro Macro) { - MacroMap.insert(std::make_pair(Name, std::move(Macro))); -} - -void AsmParser::undefineMacro(StringRef Name) { MacroMap.erase(Name); } - bool AsmParser::handleMacroEntry(const MCAsmMacro *M, SMLoc NameLoc) { // Arbitrarily limit macro nesting depth (default matches 'as'). We can // eliminate this, although we should protect against infinite loops. @@ -4249,7 +4203,7 @@ bool AsmParser::parseDirectiveMacro(SMLoc DirectiveLoc eatToEndOfStatement(); } - if (lookupMacro(Name)) { + if (getContext().lookupMacro(Name)) { return Error(DirectiveLoc, "macro '" + Name + "' is already defined"); } @@ -4257,7 +4211,7 @@ bool AsmParser::parseDirectiveMacro(SMLoc DirectiveLoc const char *BodyEnd = EndToken.getLoc().getPointer(); StringRef Body = StringRef(BodyStart, BodyEnd - BodyStart); checkForBadMacro(DirectiveLoc, Name, Body, Parameters); - defineMacro(Name, MCAsmMacro(Name, Body, std::move(Parameters))); + getContext().defineMacro(Name, MCAsmMacro(Name, Body, std::move(Parameters))); return false; } @@ -4416,10 +4370,10 @@ bool AsmParser::parseDirectivePurgeMacro(SMLoc Directi "unexpected token in '.purgem' directive")) return true; - if (!lookupMacro(Name)) + if (!getContext().lookupMacro(Name)) return Error(DirectiveLoc, "macro '" + Name + "' is not defined"); - undefineMacro(Name); + getContext().undefineMacro(Name); return false; } Modified: head/contrib/llvm/lib/Target/AMDGPU/AMDGPUISelLowering.cpp ============================================================================== --- head/contrib/llvm/lib/Target/AMDGPU/AMDGPUISelLowering.cpp Fri Feb 16 20:44:50 2018 (r329409) +++ head/contrib/llvm/lib/Target/AMDGPU/AMDGPUISelLowering.cpp Fri Feb 16 20:45:32 2018 (r329410) @@ -3957,6 +3957,10 @@ const char* AMDGPUTargetLowering::getTargetNodeName(un NODE_NAME_CASE(CVT_F32_UBYTE2) NODE_NAME_CASE(CVT_F32_UBYTE3) NODE_NAME_CASE(CVT_PKRTZ_F16_F32) + NODE_NAME_CASE(CVT_PKNORM_I16_F32) + NODE_NAME_CASE(CVT_PKNORM_U16_F32) + NODE_NAME_CASE(CVT_PK_I16_I32) + NODE_NAME_CASE(CVT_PK_U16_U32) NODE_NAME_CASE(FP_TO_FP16) NODE_NAME_CASE(FP16_ZEXT) NODE_NAME_CASE(BUILD_VERTICAL_VECTOR) Modified: head/contrib/llvm/lib/Target/AMDGPU/AMDGPUISelLowering.h ============================================================================== --- head/contrib/llvm/lib/Target/AMDGPU/AMDGPUISelLowering.h Fri Feb 16 20:44:50 2018 (r329409) +++ head/contrib/llvm/lib/Target/AMDGPU/AMDGPUISelLowering.h Fri Feb 16 20:45:32 2018 (r329410) @@ -417,6 +417,10 @@ enum NodeType : unsigned { // Convert two float 32 numbers into a single register holding two packed f16 // with round to zero. CVT_PKRTZ_F16_F32, + CVT_PKNORM_I16_F32, + CVT_PKNORM_U16_F32, + CVT_PK_I16_I32, + CVT_PK_U16_U32, // Same as the standard node, except the high bits of the resulting integer // are known 0. Modified: head/contrib/llvm/lib/Target/AMDGPU/AMDGPUInstrInfo.cpp ============================================================================== --- head/contrib/llvm/lib/Target/AMDGPU/AMDGPUInstrInfo.cpp Fri Feb 16 20:44:50 2018 (r329409) +++ head/contrib/llvm/lib/Target/AMDGPU/AMDGPUInstrInfo.cpp Fri Feb 16 20:45:32 2018 (r329410) @@ -108,3 +108,21 @@ int AMDGPUInstrInfo::pseudoToMCOpcode(int Opcode) cons return MCOp; } + +// TODO: Should largely merge with AMDGPUTTIImpl::isSourceOfDivergence. +bool AMDGPUInstrInfo::isUniformMMO(const MachineMemOperand *MMO) { + const Value *Ptr = MMO->getValue(); + // UndefValue means this is a load of a kernel input. These are uniform. + // Sometimes LDS instructions have constant pointers. + // If Ptr is null, then that means this mem operand contains a + // PseudoSourceValue like GOT. + if (!Ptr || isa(Ptr) || + isa(Ptr) || isa(Ptr)) + return true; + + if (const Argument *Arg = dyn_cast(Ptr)) + return AMDGPU::isArgPassedInSGPR(Arg); + + const Instruction *I = dyn_cast(Ptr); + return I && I->getMetadata("amdgpu.uniform"); +} Modified: head/contrib/llvm/lib/Target/AMDGPU/AMDGPUInstrInfo.h ============================================================================== --- head/contrib/llvm/lib/Target/AMDGPU/AMDGPUInstrInfo.h Fri Feb 16 20:44:50 2018 (r329409) +++ head/contrib/llvm/lib/Target/AMDGPU/AMDGPUInstrInfo.h Fri Feb 16 20:45:32 2018 (r329410) @@ -50,6 +50,8 @@ class AMDGPUInstrInfo : public AMDGPUGenInstrInfo { (p /// Return -1 if the target-specific opcode for the pseudo instruction does /// not exist. If Opcode is not a pseudo instruction, this is identity. int pseudoToMCOpcode(int Opcode) const; + + static bool isUniformMMO(const MachineMemOperand *MMO); }; } // End llvm namespace Modified: head/contrib/llvm/lib/Target/AMDGPU/AMDGPUInstrInfo.td ============================================================================== --- head/contrib/llvm/lib/Target/AMDGPU/AMDGPUInstrInfo.td Fri Feb 16 20:44:50 2018 (r329409) +++ head/contrib/llvm/lib/Target/AMDGPU/AMDGPUInstrInfo.td Fri Feb 16 20:45:32 2018 (r329410) @@ -35,6 +35,10 @@ def AMDGPUFPPackOp : SDTypeProfile<1, 2, [SDTCisFP<1>, SDTCisSameAs<1, 2>] >; +def AMDGPUIntPackOp : SDTypeProfile<1, 2, + [SDTCisInt<1>, SDTCisSameAs<1, 2>] +>; + def AMDGPUDivScaleOp : SDTypeProfile<2, 3, [SDTCisFP<0>, SDTCisInt<1>, SDTCisSameAs<0, 2>, SDTCisSameAs<0, 3>, SDTCisSameAs<0, 4>] >; @@ -142,6 +146,10 @@ def AMDGPUrsq_clamp : SDNode<"AMDGPUISD::RSQ_CLAMP", S def AMDGPUldexp : SDNode<"AMDGPUISD::LDEXP", AMDGPULdExpOp>; def AMDGPUpkrtz_f16_f32 : SDNode<"AMDGPUISD::CVT_PKRTZ_F16_F32", AMDGPUFPPackOp>; +def AMDGPUpknorm_i16_f32 : SDNode<"AMDGPUISD::CVT_PKNORM_I16_F32", AMDGPUFPPackOp>; +def AMDGPUpknorm_u16_f32 : SDNode<"AMDGPUISD::CVT_PKNORM_U16_F32", AMDGPUFPPackOp>; +def AMDGPUpk_i16_i32 : SDNode<"AMDGPUISD::CVT_PK_I16_I32", AMDGPUIntPackOp>; +def AMDGPUpk_u16_u32 : SDNode<"AMDGPUISD::CVT_PK_U16_U32", AMDGPUIntPackOp>; def AMDGPUfp_to_f16 : SDNode<"AMDGPUISD::FP_TO_FP16" , SDTFPToIntOp>; def AMDGPUfp16_zext : SDNode<"AMDGPUISD::FP16_ZEXT" , SDTFPToIntOp>; Modified: head/contrib/llvm/lib/Target/AMDGPU/AMDGPURegisterBankInfo.cpp ============================================================================== --- head/contrib/llvm/lib/Target/AMDGPU/AMDGPURegisterBankInfo.cpp Fri Feb 16 20:44:50 2018 (r329409) +++ head/contrib/llvm/lib/Target/AMDGPU/AMDGPURegisterBankInfo.cpp Fri Feb 16 20:45:32 2018 (r329410) @@ -120,7 +120,7 @@ static bool isInstrUniform(const MachineInstr &MI) { return false; const MachineMemOperand *MMO = *MI.memoperands_begin(); - return AMDGPU::isUniformMMO(MMO); + return AMDGPUInstrInfo::isUniformMMO(MMO); } const RegisterBankInfo::InstructionMapping & Modified: head/contrib/llvm/lib/Target/AMDGPU/SIISelLowering.cpp ============================================================================== --- head/contrib/llvm/lib/Target/AMDGPU/SIISelLowering.cpp Fri Feb 16 20:44:50 2018 (r329409) +++ head/contrib/llvm/lib/Target/AMDGPU/SIISelLowering.cpp Fri Feb 16 20:45:32 2018 (r329410) @@ -205,6 +205,7 @@ SITargetLowering::SITargetLowering(const TargetMachine setOperationAction(ISD::INTRINSIC_WO_CHAIN, MVT::Other, Custom); setOperationAction(ISD::INTRINSIC_WO_CHAIN, MVT::f32, Custom); setOperationAction(ISD::INTRINSIC_WO_CHAIN, MVT::v4f32, Custom); + setOperationAction(ISD::INTRINSIC_WO_CHAIN, MVT::v2i16, Custom); setOperationAction(ISD::INTRINSIC_WO_CHAIN, MVT::v2f16, Custom); setOperationAction(ISD::INTRINSIC_W_CHAIN, MVT::Other, Custom); @@ -1085,7 +1086,7 @@ bool SITargetLowering::isCheapAddrSpaceCast(unsigned S bool SITargetLowering::isMemOpUniform(const SDNode *N) const { const MemSDNode *MemNode = cast(N); - return AMDGPU::isUniformMMO(MemNode->getMemOperand()); + return AMDGPUInstrInfo::isUniformMMO(MemNode->getMemOperand()); } TargetLoweringBase::LegalizeTypeAction @@ -3517,7 +3518,8 @@ void SITargetLowering::ReplaceNodeResults(SDNode *N, } case ISD::INTRINSIC_WO_CHAIN: { unsigned IID = cast(N->getOperand(0))->getZExtValue(); - if (IID == Intrinsic::amdgcn_cvt_pkrtz) { + switch (IID) { + case Intrinsic::amdgcn_cvt_pkrtz: { SDValue Src0 = N->getOperand(1); SDValue Src1 = N->getOperand(2); SDLoc SL(N); @@ -3526,6 +3528,29 @@ void SITargetLowering::ReplaceNodeResults(SDNode *N, Results.push_back(DAG.getNode(ISD::BITCAST, SL, MVT::v2f16, Cvt)); return; } + case Intrinsic::amdgcn_cvt_pknorm_i16: + case Intrinsic::amdgcn_cvt_pknorm_u16: + case Intrinsic::amdgcn_cvt_pk_i16: + case Intrinsic::amdgcn_cvt_pk_u16: { + SDValue Src0 = N->getOperand(1); + SDValue Src1 = N->getOperand(2); + SDLoc SL(N); + unsigned Opcode; + + if (IID == Intrinsic::amdgcn_cvt_pknorm_i16) + Opcode = AMDGPUISD::CVT_PKNORM_I16_F32; + else if (IID == Intrinsic::amdgcn_cvt_pknorm_u16) + Opcode = AMDGPUISD::CVT_PKNORM_U16_F32; + else if (IID == Intrinsic::amdgcn_cvt_pk_i16) + Opcode = AMDGPUISD::CVT_PK_I16_I32; + else + Opcode = AMDGPUISD::CVT_PK_U16_U32; + + SDValue Cvt = DAG.getNode(Opcode, SL, MVT::i32, Src0, Src1); + Results.push_back(DAG.getNode(ISD::BITCAST, SL, MVT::v2i16, Cvt)); + return; + } + } break; } case ISD::SELECT: { @@ -4424,10 +4449,27 @@ SDValue SITargetLowering::LowerINTRINSIC_WO_CHAIN(SDVa case Intrinsic::amdgcn_ubfe: return DAG.getNode(AMDGPUISD::BFE_U32, DL, VT, Op.getOperand(1), Op.getOperand(2), Op.getOperand(3)); - case Intrinsic::amdgcn_cvt_pkrtz: { - // FIXME: Stop adding cast if v2f16 legal. + case Intrinsic::amdgcn_cvt_pkrtz: + case Intrinsic::amdgcn_cvt_pknorm_i16: + case Intrinsic::amdgcn_cvt_pknorm_u16: + case Intrinsic::amdgcn_cvt_pk_i16: + case Intrinsic::amdgcn_cvt_pk_u16: { + // FIXME: Stop adding cast if v2f16/v2i16 are legal. EVT VT = Op.getValueType(); - SDValue Node = DAG.getNode(AMDGPUISD::CVT_PKRTZ_F16_F32, DL, MVT::i32, + unsigned Opcode; + + if (IntrinsicID == Intrinsic::amdgcn_cvt_pkrtz) + Opcode = AMDGPUISD::CVT_PKRTZ_F16_F32; + else if (IntrinsicID == Intrinsic::amdgcn_cvt_pknorm_i16) + Opcode = AMDGPUISD::CVT_PKNORM_I16_F32; + else if (IntrinsicID == Intrinsic::amdgcn_cvt_pknorm_u16) + Opcode = AMDGPUISD::CVT_PKNORM_U16_F32; + else if (IntrinsicID == Intrinsic::amdgcn_cvt_pk_i16) + Opcode = AMDGPUISD::CVT_PK_I16_I32; + else + Opcode = AMDGPUISD::CVT_PK_U16_U32; + + SDValue Node = DAG.getNode(Opcode, DL, MVT::i32, Op.getOperand(1), Op.getOperand(2)); return DAG.getNode(ISD::BITCAST, DL, VT, Node); } Modified: head/contrib/llvm/lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.cpp ============================================================================== --- head/contrib/llvm/lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.cpp Fri Feb 16 20:44:50 2018 (r329409) +++ head/contrib/llvm/lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.cpp Fri Feb 16 20:45:32 2018 (r329410) @@ -871,24 +871,6 @@ bool isArgPassedInSGPR(const Argument *A) { } } -// TODO: Should largely merge with AMDGPUTTIImpl::isSourceOfDivergence. -bool isUniformMMO(const MachineMemOperand *MMO) { - const Value *Ptr = MMO->getValue(); - // UndefValue means this is a load of a kernel input. These are uniform. - // Sometimes LDS instructions have constant pointers. - // If Ptr is null, then that means this mem operand contains a - // PseudoSourceValue like GOT. - if (!Ptr || isa(Ptr) || - isa(Ptr) || isa(Ptr)) - return true; - - if (const Argument *Arg = dyn_cast(Ptr)) - return isArgPassedInSGPR(Arg); - - const Instruction *I = dyn_cast(Ptr); - return I && I->getMetadata("amdgpu.uniform"); -} - int64_t getSMRDEncodedOffset(const MCSubtargetInfo &ST, int64_t ByteOffset) { if (isGCN3Encoding(ST)) return ByteOffset; Modified: head/contrib/llvm/lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.h ============================================================================== --- head/contrib/llvm/lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.h Fri Feb 16 20:44:50 2018 (r329409) +++ head/contrib/llvm/lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.h Fri Feb 16 20:45:32 2018 (r329410) @@ -363,7 +363,6 @@ LLVM_READNONE bool isInlinableLiteralV216(int32_t Literal, bool HasInv2Pi); bool isArgPassedInSGPR(const Argument *Arg); -bool isUniformMMO(const MachineMemOperand *MMO); /// \returns The encoding that will be used for \p ByteOffset in the SMRD /// offset field. Modified: head/contrib/llvm/lib/Target/AMDGPU/VOP2Instructions.td ============================================================================== --- head/contrib/llvm/lib/Target/AMDGPU/VOP2Instructions.td Fri Feb 16 20:44:50 2018 (r329409) +++ head/contrib/llvm/lib/Target/AMDGPU/VOP2Instructions.td Fri Feb 16 20:45:32 2018 (r329410) @@ -407,11 +407,11 @@ defm V_MBCNT_LO_U32_B32 : VOP2Inst <"v_mbcnt_lo_u32_b3 defm V_MBCNT_HI_U32_B32 : VOP2Inst <"v_mbcnt_hi_u32_b32", VOP_NO_EXT, int_amdgcn_mbcnt_hi>; defm V_LDEXP_F32 : VOP2Inst <"v_ldexp_f32", VOP_NO_EXT, AMDGPUldexp>; defm V_CVT_PKACCUM_U8_F32 : VOP2Inst <"v_cvt_pkaccum_u8_f32", VOP_NO_EXT>; // TODO: set "Uses = dst" -defm V_CVT_PKNORM_I16_F32 : VOP2Inst <"v_cvt_pknorm_i16_f32", VOP_NO_EXT>; -defm V_CVT_PKNORM_U16_F32 : VOP2Inst <"v_cvt_pknorm_u16_f32", VOP_NO_EXT>; +defm V_CVT_PKNORM_I16_F32 : VOP2Inst <"v_cvt_pknorm_i16_f32", VOP_NO_EXT, AMDGPUpknorm_i16_f32>; +defm V_CVT_PKNORM_U16_F32 : VOP2Inst <"v_cvt_pknorm_u16_f32", VOP_NO_EXT, AMDGPUpknorm_u16_f32>; defm V_CVT_PKRTZ_F16_F32 : VOP2Inst <"v_cvt_pkrtz_f16_f32", VOP_NO_EXT, AMDGPUpkrtz_f16_f32>; -defm V_CVT_PK_U16_U32 : VOP2Inst <"v_cvt_pk_u16_u32", VOP_NO_EXT>; -defm V_CVT_PK_I16_I32 : VOP2Inst <"v_cvt_pk_i16_i32", VOP_NO_EXT>; +defm V_CVT_PK_U16_U32 : VOP2Inst <"v_cvt_pk_u16_u32", VOP_NO_EXT, AMDGPUpk_u16_u32>; +defm V_CVT_PK_I16_I32 : VOP2Inst <"v_cvt_pk_i16_i32", VOP_NO_EXT, AMDGPUpk_i16_i32>; } // End SubtargetPredicate = isGCN Modified: head/contrib/llvm/lib/Target/X86/MCTargetDesc/X86MCCodeEmitter.cpp ============================================================================== --- head/contrib/llvm/lib/Target/X86/MCTargetDesc/X86MCCodeEmitter.cpp Fri Feb 16 20:44:50 2018 (r329409) +++ head/contrib/llvm/lib/Target/X86/MCTargetDesc/X86MCCodeEmitter.cpp Fri Feb 16 20:45:32 2018 (r329410) @@ -396,10 +396,14 @@ void X86MCCodeEmitter::emitMemModRMByte(const MCInst & // rip-relative addressing is actually relative to the *next* instruction. // Since an immediate can follow the mod/rm byte for an instruction, this - // means that we need to bias the immediate field of the instruction with - // the size of the immediate field. If we have this case, add it into the + // means that we need to bias the displacement field of the instruction with + // the size of the immediate field. If we have this case, add it into the // expression to emit. - int ImmSize = X86II::hasImm(TSFlags) ? X86II::getSizeOfImm(TSFlags) : 0; + // Note: rip-relative addressing using immediate displacement values should + // not be adjusted, assuming it was the user's intent. + int ImmSize = !Disp.isImm() && X86II::hasImm(TSFlags) + ? X86II::getSizeOfImm(TSFlags) + : 0; EmitImmediate(Disp, MI.getLoc(), 4, MCFixupKind(FixupKind), CurByte, OS, Fixups, -ImmSize); Modified: head/contrib/llvm/lib/Target/X86/X86AsmPrinter.cpp ============================================================================== --- head/contrib/llvm/lib/Target/X86/X86AsmPrinter.cpp Fri Feb 16 20:44:50 2018 (r329409) +++ head/contrib/llvm/lib/Target/X86/X86AsmPrinter.cpp Fri Feb 16 20:45:32 2018 (r329410) @@ -370,6 +370,8 @@ static void printIntelMemReference(X86AsmPrinter &P, c static bool printAsmMRegister(X86AsmPrinter &P, const MachineOperand &MO, char Mode, raw_ostream &O) { unsigned Reg = MO.getReg(); + bool EmitPercent = true; + switch (Mode) { default: return true; // Unknown mode. case 'b': // Print QImode register @@ -384,6 +386,9 @@ static bool printAsmMRegister(X86AsmPrinter &P, const case 'k': // Print SImode register Reg = getX86SubSuperRegister(Reg, 32); break; + case 'V': + EmitPercent = false; + LLVM_FALLTHROUGH; case 'q': // Print 64-bit register names if 64-bit integer registers are available. // Otherwise, print 32-bit register names. @@ -391,7 +396,10 @@ static bool printAsmMRegister(X86AsmPrinter &P, const break; } - O << '%' << X86ATTInstPrinter::getRegisterName(Reg); + if (EmitPercent) + O << '%'; + + O << X86ATTInstPrinter::getRegisterName(Reg); return false; } @@ -464,6 +472,7 @@ bool X86AsmPrinter::PrintAsmOperand(const MachineInstr case 'w': // Print HImode register case 'k': // Print SImode register case 'q': // Print DImode register + case 'V': // Print native register without '%' if (MO.isReg()) return printAsmMRegister(*this, MO, ExtraCode[0], O); printOperand(*this, MI, OpNo, O); Modified: head/contrib/llvm/lib/Target/X86/X86DomainReassignment.cpp ============================================================================== --- head/contrib/llvm/lib/Target/X86/X86DomainReassignment.cpp Fri Feb 16 20:44:50 2018 (r329409) +++ head/contrib/llvm/lib/Target/X86/X86DomainReassignment.cpp Fri Feb 16 20:45:32 2018 (r329410) @@ -663,8 +663,10 @@ void X86DomainReassignment::initConverters() { createReplacer(X86::XOR32rr, X86::KXORDrr); createReplacer(X86::XOR64rr, X86::KXORQrr); - createReplacer(X86::TEST32rr, X86::KTESTDrr); - createReplacer(X86::TEST64rr, X86::KTESTQrr); + // TODO: KTEST is not a replacement for TEST due to flag differences. Need + // to prove only Z flag is used. + //createReplacer(X86::TEST32rr, X86::KTESTDrr); + //createReplacer(X86::TEST64rr, X86::KTESTQrr); } if (STI->hasDQI()) { @@ -684,8 +686,10 @@ void X86DomainReassignment::initConverters() { createReplacer(X86::SHR8ri, X86::KSHIFTRBri); createReplacer(X86::SHL8ri, X86::KSHIFTLBri); - createReplacer(X86::TEST8rr, X86::KTESTBrr); - createReplacer(X86::TEST16rr, X86::KTESTWrr); + // TODO: KTEST is not a replacement for TEST due to flag differences. Need + // to prove only Z flag is used. + //createReplacer(X86::TEST8rr, X86::KTESTBrr); + //createReplacer(X86::TEST16rr, X86::KTESTWrr); createReplacer(X86::XOR8rr, X86::KXORBrr); } Modified: head/contrib/llvm/lib/Target/X86/X86ISelLowering.cpp ============================================================================== --- head/contrib/llvm/lib/Target/X86/X86ISelLowering.cpp Fri Feb 16 20:44:50 2018 (r329409) +++ head/contrib/llvm/lib/Target/X86/X86ISelLowering.cpp Fri Feb 16 20:45:32 2018 (r329410) @@ -17017,24 +17017,6 @@ static bool hasNonFlagsUse(SDValue Op) { return false; } -// Emit KTEST instruction for bit vectors on AVX-512 -static SDValue EmitKTEST(SDValue Op, SelectionDAG &DAG, - const X86Subtarget &Subtarget) { - if (Op.getOpcode() == ISD::BITCAST) { - auto hasKTEST = [&](MVT VT) { - unsigned SizeInBits = VT.getSizeInBits(); - return (Subtarget.hasDQI() && (SizeInBits == 8 || SizeInBits == 16)) || - (Subtarget.hasBWI() && (SizeInBits == 32 || SizeInBits == 64)); - }; - SDValue Op0 = Op.getOperand(0); - MVT Op0VT = Op0.getValueType().getSimpleVT(); - if (Op0VT.isVector() && Op0VT.getVectorElementType() == MVT::i1 && - hasKTEST(Op0VT)) - return DAG.getNode(X86ISD::KTEST, SDLoc(Op), Op0VT, Op0, Op0); - } - return SDValue(); -} - /// Emit nodes that will be selected as "test Op0,Op0", or something /// equivalent. SDValue X86TargetLowering::EmitTest(SDValue Op, unsigned X86CC, const SDLoc &dl, @@ -17079,9 +17061,6 @@ SDValue X86TargetLowering::EmitTest(SDValue Op, unsign // doing a separate TEST. TEST always sets OF and CF to 0, so unless // we prove that the arithmetic won't overflow, we can't use OF or CF. if (Op.getResNo() != 0 || NeedOF || NeedCF) { - // Emit KTEST for bit vectors - if (auto Node = EmitKTEST(Op, DAG, Subtarget)) - return Node; // Emit a CMP with 0, which is the TEST pattern. return DAG.getNode(X86ISD::CMP, dl, MVT::i32, Op, DAG.getConstant(0, dl, Op.getValueType())); @@ -17310,10 +17289,6 @@ SDValue X86TargetLowering::EmitTest(SDValue Op, unsign } if (Opcode == 0) { - // Emit KTEST for bit vectors - if (auto Node = EmitKTEST(Op, DAG, Subtarget)) - return Node; - // Emit a CMP with 0, which is the TEST pattern. return DAG.getNode(X86ISD::CMP, dl, MVT::i32, Op, DAG.getConstant(0, dl, Op.getValueType())); @@ -18093,6 +18068,34 @@ static SDValue LowerVSETCC(SDValue Op, const X86Subtar return Result; } +// Try to select this as a KTEST+SETCC if possible. +static SDValue EmitKTEST(SDValue Op0, SDValue Op1, ISD::CondCode CC, + const SDLoc &dl, SelectionDAG &DAG, + const X86Subtarget &Subtarget) { + // Only support equality comparisons. + if (CC != ISD::SETEQ && CC != ISD::SETNE) + return SDValue(); + + // Must be a bitcast from vXi1. + if (Op0.getOpcode() != ISD::BITCAST) + return SDValue(); + + Op0 = Op0.getOperand(0); + MVT VT = Op0.getSimpleValueType(); + if (!(Subtarget.hasDQI() && (VT == MVT::v8i1 || VT == MVT::v16i1)) && + !(Subtarget.hasBWI() && (VT == MVT::v32i1 || VT == MVT::v64i1))) + return SDValue(); + + X86::CondCode X86CC; + if (isNullConstant(Op1)) { + X86CC = CC == ISD::SETEQ ? X86::COND_E : X86::COND_NE; + } else + return SDValue(); + + SDValue KTEST = DAG.getNode(X86ISD::KTEST, dl, MVT::i32, Op0, Op0); + return getSETCC(X86CC, KTEST, dl, DAG); +} + SDValue X86TargetLowering::LowerSETCC(SDValue Op, SelectionDAG &DAG) const { MVT VT = Op.getSimpleValueType(); @@ -18115,6 +18118,10 @@ SDValue X86TargetLowering::LowerSETCC(SDValue Op, Sele return NewSetCC; } + // Try to lower using KTEST. + if (SDValue NewSetCC = EmitKTEST(Op0, Op1, CC, dl, DAG, Subtarget)) + return NewSetCC; + // Look for X == 0, X == 1, X != 0, or X != 1. We can simplify some forms of // these. if ((isOneConstant(Op1) || isNullConstant(Op1)) && @@ -20525,6 +20532,18 @@ SDValue X86TargetLowering::LowerINTRINSIC_WO_CHAIN(SDV Mask = DAG.getBitcast(MaskVT, Mask); return DAG.getNode(IntrData->Opc0, dl, Op.getValueType(), Mask); } + case KUNPCK: { + MVT VT = Op.getSimpleValueType(); + MVT MaskVT = MVT::getVectorVT(MVT::i1, VT.getSizeInBits()/2); + + SDValue Src1 = getMaskNode(Op.getOperand(1), MaskVT, Subtarget, DAG, dl); + SDValue Src2 = getMaskNode(Op.getOperand(2), MaskVT, Subtarget, DAG, dl); + // Arguments should be swapped. + SDValue Res = DAG.getNode(IntrData->Opc0, dl, + MVT::getVectorVT(MVT::i1, VT.getSizeInBits()), + Src2, Src1); + return DAG.getBitcast(VT, Res); + } case MASK_BINOP: { MVT VT = Op.getSimpleValueType(); MVT MaskVT = MVT::getVectorVT(MVT::i1, VT.getSizeInBits()); @@ -27094,28 +27113,57 @@ static unsigned getOpcodeForRetpoline(unsigned RPOpc) static const char *getRetpolineSymbol(const X86Subtarget &Subtarget, unsigned Reg) { + if (Subtarget.useRetpolineExternalThunk()) { + // When using an external thunk for retpolines, we pick names that match the + // names GCC happens to use as well. This helps simplify the implementation + // of the thunks for kernels where they have no easy ability to create + // aliases and are doing non-trivial configuration of the thunk's body. For + // example, the Linux kernel will do boot-time hot patching of the thunk + // bodies and cannot easily export aliases of these to loaded modules. + // + // Note that at any point in the future, we may need to change the semantics + // of how we implement retpolines and at that time will likely change the + // name of the called thunk. Essentially, there is no hard guarantee that + // LLVM will generate calls to specific thunks, we merely make a best-effort + // attempt to help out kernels and other systems where duplicating the + // thunks is costly. + switch (Reg) { + case X86::EAX: + assert(!Subtarget.is64Bit() && "Should not be using a 32-bit thunk!"); + return "__x86_indirect_thunk_eax"; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Fri Feb 16 20:46:45 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A6911F10BE6; Fri, 16 Feb 2018 20:46:45 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 51184718C9; Fri, 16 Feb 2018 20:46:45 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4877412BE6; Fri, 16 Feb 2018 20:46:45 +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 w1GKkjpp020383; Fri, 16 Feb 2018 20:46:45 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1GKkjHp020382; Fri, 16 Feb 2018 20:46:45 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201802162046.w1GKkjHp020382@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Fri, 16 Feb 2018 20:46:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329411 - head/usr.sbin/trpt X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/usr.sbin/trpt X-SVN-Commit-Revision: 329411 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Feb 2018 20:46:45 -0000 Author: cem Date: Fri Feb 16 20:46:44 2018 New Revision: 329411 URL: https://svnweb.freebsd.org/changeset/base/329411 Log: trpt(8): Clean up build hack to detect ancient compiler Detect ancient GCC specifically, rather than using target architecture as a crude heuristic. Side note: compilers should really ignore -Wno- and -Wno-error= flags they don't recognize. Seems like modern compilers produce warnings instead of errors. Though, with -Werror they turn into errors. Clang's error can be disabled with -Wno-error=unknown-warning-option, but GCC doesn't seem to have a named method to disable the specific warning. Submitted by: rpokala@ (earlier version) Suggested by: rpokala@ Reviewed by: tinderbox Sponsored by: Dell EMC Isilon Modified: head/usr.sbin/trpt/Makefile Modified: head/usr.sbin/trpt/Makefile ============================================================================== --- head/usr.sbin/trpt/Makefile Fri Feb 16 20:45:32 2018 (r329410) +++ head/usr.sbin/trpt/Makefile Fri Feb 16 20:46:44 2018 (r329411) @@ -8,8 +8,7 @@ MAN= trpt.8 BINGRP= kmem BINMODE= 2555 -.if ${MACHINE_CPUARCH} != "aarch64" && ${MACHINE_CPUARCH} != "amd64" && \ - ${MACHINE_CPUARCH} != "i386" && ${MACHINE_CPUARCH} != "riscv" +.if ${COMPILER_TYPE} == "gcc" && ${COMPILER_VERSION} < 50000 WARNS?= 4 .endif @@ -19,8 +18,7 @@ CFLAGS+= -DINET6 .include -.if ${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "amd64" || \ - ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "riscv" +.if ${COMPILER_TYPE} != "gcc" || ${COMPILER_VERSION} >= 50000 # Several included system headers tickle this warning in ways that are # difficult to work around in this program. CFLAGS+= -Wno-missing-variable-declarations From owner-svn-src-all@freebsd.org Fri Feb 16 21:59:08 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C1B44F16334; Fri, 16 Feb 2018 21:59:08 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6EA9D74929; Fri, 16 Feb 2018 21:59:08 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 69A65137A8; Fri, 16 Feb 2018 21:59:08 +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 w1GLx8qi055046; Fri, 16 Feb 2018 21:59:08 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1GLx8qQ055045; Fri, 16 Feb 2018 21:59:08 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201802162159.w1GLx8qQ055045@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Fri, 16 Feb 2018 21:59:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329412 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Commit-Revision: 329412 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Feb 2018 21:59:08 -0000 Author: asomers Date: Fri Feb 16 21:59:08 2018 New Revision: 329412 URL: https://svnweb.freebsd.org/changeset/base/329412 Log: zfs: fix formatting in a log statement Submitted by: Dave Baukus MFC after: 3 weeks Sponsored by: Spectra Logic Corp Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c Fri Feb 16 20:46:44 2018 (r329411) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c Fri Feb 16 21:59:08 2018 (r329412) @@ -239,7 +239,7 @@ vdev_geom_attach(struct g_provider *pp, vdev_t *vd, bo } error = g_access(cp, 1, 0, 1); if (error != 0) { - ZFS_LOG(1, "%s(%d): g_access failed: %d", __func__, + ZFS_LOG(1, "%s(%d): g_access failed: %d\n", __func__, __LINE__, error); vdev_geom_detach(cp, B_FALSE); return (NULL); From owner-svn-src-all@freebsd.org Fri Feb 16 22:17:31 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6188AF17887; Fri, 16 Feb 2018 22:17:31 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 127207551E; Fri, 16 Feb 2018 22:17:31 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0BFC013AE7; Fri, 16 Feb 2018 22:17:31 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1GMHU9H064728; Fri, 16 Feb 2018 22:17:30 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1GMHUmd064727; Fri, 16 Feb 2018 22:17:30 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201802162217.w1GMHUmd064727@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Fri, 16 Feb 2018 22:17:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329413 - head/stand/lua X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/stand/lua X-SVN-Commit-Revision: 329413 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Feb 2018 22:17:31 -0000 Author: kevans Date: Fri Feb 16 22:17:30 2018 New Revision: 329413 URL: https://svnweb.freebsd.org/changeset/base/329413 Log: stand/lua: Allow MENU_RETURN items to have a func, fix escape to prompt Modified: head/stand/lua/menu.lua Modified: head/stand/lua/menu.lua ============================================================================== --- head/stand/lua/menu.lua Fri Feb 16 21:59:08 2018 (r329412) +++ head/stand/lua/menu.lua Fri Feb 16 22:17:30 2018 (r329413) @@ -161,6 +161,9 @@ menu.welcome = { name = function() return color.highlight("Esc").."ape to loader prompt"; end, + func = function() + loader.setenv("autoboot_delay", "NO") + end, alias = {core.KEYSTR_ESCAPE} }, @@ -301,6 +304,10 @@ function menu.run(m) -- recurse cont = menu.run(sel_entry.submenu()); elseif (sel_entry.entry_type == core.MENU_RETURN) then + -- allow entry to have a function/side effect + if (sel_entry.func ~= nil) then + sel_entry.func(); + end -- break recurse cont = false; end From owner-svn-src-all@freebsd.org Fri Feb 16 22:51:09 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 683B5F19BF9; Fri, 16 Feb 2018 22:51:09 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 168C37689C; Fri, 16 Feb 2018 22:51:09 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1192A13FF4; Fri, 16 Feb 2018 22:51:09 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1GMp8PD079850; Fri, 16 Feb 2018 22:51:08 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1GMp8Bd079849; Fri, 16 Feb 2018 22:51:08 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201802162251.w1GMp8Bd079849@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Fri, 16 Feb 2018 22:51:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329414 - head/stand/lua X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/stand/lua X-SVN-Commit-Revision: 329414 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Feb 2018 22:51:09 -0000 Author: kevans Date: Fri Feb 16 22:51:08 2018 New Revision: 329414 URL: https://svnweb.freebsd.org/changeset/base/329414 Log: stand/lua: Don't try to divide by 0; do nothing Modified: head/stand/lua/menu.lua Modified: head/stand/lua/menu.lua ============================================================================== --- head/stand/lua/menu.lua Fri Feb 16 22:17:30 2018 (r329413) +++ head/stand/lua/menu.lua Fri Feb 16 22:51:08 2018 (r329414) @@ -297,9 +297,11 @@ function menu.run(m) local caridx = menu.getCarouselIndex(carid); local choices = sel_entry.items(); - caridx = (caridx % #choices) + 1; - menu.setCarouselIndex(carid, caridx); - sel_entry.func(choices[caridx]); + if (#choices > 0) then + caridx = (caridx % #choices) + 1; + menu.setCarouselIndex(carid, caridx); + sel_entry.func(choices[caridx]); + end elseif (sel_entry.entry_type == core.MENU_SUBMENU) then -- recurse cont = menu.run(sel_entry.submenu()); From owner-svn-src-all@freebsd.org Fri Feb 16 22:57:52 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DD46AF1A65E; Fri, 16 Feb 2018 22:57:52 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9015376D61; Fri, 16 Feb 2018 22:57:52 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8AFCF14157; Fri, 16 Feb 2018 22:57:52 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1GMvqcN084676; Fri, 16 Feb 2018 22:57:52 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1GMvqBN084675; Fri, 16 Feb 2018 22:57:52 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201802162257.w1GMvqBN084675@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Fri, 16 Feb 2018 22:57:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329415 - head/stand/lua X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/stand/lua X-SVN-Commit-Revision: 329415 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Feb 2018 22:57:53 -0000 Author: kevans Date: Fri Feb 16 22:57:52 2018 New Revision: 329415 URL: https://svnweb.freebsd.org/changeset/base/329415 Log: stand/lua: Don't reload kernel config if we only have one kernel Don't move this into config.reload because we may want to force reloads if /boot changes out from under us later. As a caution: changing kernels in lualoader at the moment might not be loading all of your modules (in my testing, at least) from loader.conf(5). This is a known problem. Modified: head/stand/lua/menu.lua Modified: head/stand/lua/menu.lua ============================================================================== --- head/stand/lua/menu.lua Fri Feb 16 22:51:08 2018 (r329414) +++ head/stand/lua/menu.lua Fri Feb 16 22:57:52 2018 (r329415) @@ -213,8 +213,10 @@ menu.welcome = { " (" .. idx .. " of " .. #all_choices .. ")"; end, - func = function(choice) - config.reload(choice); + func = function(choice, all_choices) + if (#all_choices > 1) then + config.reload(choice); + end end, alias = {"k", "K"} }, @@ -300,7 +302,8 @@ function menu.run(m) if (#choices > 0) then caridx = (caridx % #choices) + 1; menu.setCarouselIndex(carid, caridx); - sel_entry.func(choices[caridx]); + sel_entry.func(choices[caridx], + choices); end elseif (sel_entry.entry_type == core.MENU_SUBMENU) then -- recurse From owner-svn-src-all@freebsd.org Fri Feb 16 23:18:43 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E6040F1C02B; Fri, 16 Feb 2018 23:18:42 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 990B477C04; Fri, 16 Feb 2018 23:18:42 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 937B214493; Fri, 16 Feb 2018 23:18:42 +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 w1GNIgoh094541; Fri, 16 Feb 2018 23:18:42 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1GNIgsC094540; Fri, 16 Feb 2018 23:18:42 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201802162318.w1GNIgsC094540@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 16 Feb 2018 23:18:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329416 - head/sys/x86/x86 X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/x86/x86 X-SVN-Commit-Revision: 329416 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Feb 2018 23:18:43 -0000 Author: kib Date: Fri Feb 16 23:18:42 2018 New Revision: 329416 URL: https://svnweb.freebsd.org/changeset/base/329416 Log: Remove unused symbols. Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/x86/x86/mp_x86.c Modified: head/sys/x86/x86/mp_x86.c ============================================================================== --- head/sys/x86/x86/mp_x86.c Fri Feb 16 22:57:52 2018 (r329415) +++ head/sys/x86/x86/mp_x86.c Fri Feb 16 23:18:42 2018 (r329416) @@ -75,15 +75,6 @@ __FBSDID("$FreeBSD$"); #include #include -#define WARMBOOT_TARGET 0 -#define WARMBOOT_OFF (KERNBASE + 0x0467) -#define WARMBOOT_SEG (KERNBASE + 0x0469) - -#define CMOS_REG (0x70) -#define CMOS_DATA (0x71) -#define BIOS_RESET (0x0f) -#define BIOS_WARM (0x0a) - static MALLOC_DEFINE(M_CPUS, "cpus", "CPU items"); /* lock region used by kernel profiling */ From owner-svn-src-all@freebsd.org Fri Feb 16 23:59:51 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A053DF1EFC2; Fri, 16 Feb 2018 23:59:51 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4E60F79A38; Fri, 16 Feb 2018 23:59:51 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4830C14B2C; Fri, 16 Feb 2018 23:59:51 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1GNxpjF015587; Fri, 16 Feb 2018 23:59:51 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1GNxp9Z015586; Fri, 16 Feb 2018 23:59:51 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201802162359.w1GNxp9Z015586@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Fri, 16 Feb 2018 23:59:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329417 - head/stand/lua X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/stand/lua X-SVN-Commit-Revision: 329417 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Feb 2018 23:59:51 -0000 Author: kevans Date: Fri Feb 16 23:59:50 2018 New Revision: 329417 URL: https://svnweb.freebsd.org/changeset/base/329417 Log: stand/lua: Make CAROUSEL_ENTRY func parameters consistent with name We have no need for the index yet, but add it anyways to keep signatures consistent. Modified: head/stand/lua/menu.lua Modified: head/stand/lua/menu.lua ============================================================================== --- head/stand/lua/menu.lua Fri Feb 16 23:18:42 2018 (r329416) +++ head/stand/lua/menu.lua Fri Feb 16 23:59:50 2018 (r329417) @@ -213,7 +213,7 @@ menu.welcome = { " (" .. idx .. " of " .. #all_choices .. ")"; end, - func = function(choice, all_choices) + func = function(idx, choice, all_choices) if (#all_choices > 1) then config.reload(choice); end @@ -302,7 +302,7 @@ function menu.run(m) if (#choices > 0) then caridx = (caridx % #choices) + 1; menu.setCarouselIndex(carid, caridx); - sel_entry.func(choices[caridx], + sel_entry.func(caridx, choices[caridx], choices); end elseif (sel_entry.entry_type == core.MENU_SUBMENU) then From owner-svn-src-all@freebsd.org Sat Feb 17 00:12:31 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D5728F20032; Sat, 17 Feb 2018 00:12:30 +0000 (UTC) (envelope-from benno@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 85F057A48B; Sat, 17 Feb 2018 00:12:30 +0000 (UTC) (envelope-from benno@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 809AD14E61; Sat, 17 Feb 2018 00:12:30 +0000 (UTC) (envelope-from benno@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1H0CUYS025361; Sat, 17 Feb 2018 00:12:30 GMT (envelope-from benno@FreeBSD.org) Received: (from benno@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1H0CUJC025360; Sat, 17 Feb 2018 00:12:30 GMT (envelope-from benno@FreeBSD.org) Message-Id: <201802170012.w1H0CUJC025360@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: benno set sender to benno@FreeBSD.org using -f From: Benno Rice Date: Sat, 17 Feb 2018 00:12:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329418 - head/stand/i386/boot2 X-SVN-Group: head X-SVN-Commit-Author: benno X-SVN-Commit-Paths: head/stand/i386/boot2 X-SVN-Commit-Revision: 329418 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Feb 2018 00:12:31 -0000 Author: benno Date: Sat Feb 17 00:12:30 2018 New Revision: 329418 URL: https://svnweb.freebsd.org/changeset/base/329418 Log: Revert r329269. I tried to rework a section to fit inside 80 columns but the change ended up being functional. Back this out so I can readdress. Modified: head/stand/i386/boot2/boot2.c Modified: head/stand/i386/boot2/boot2.c ============================================================================== --- head/stand/i386/boot2/boot2.c Fri Feb 16 23:59:50 2018 (r329417) +++ head/stand/i386/boot2/boot2.c Sat Feb 17 00:12:30 2018 (r329418) @@ -72,33 +72,33 @@ extern uint32_t _end; static const char optstr[NOPT] = "DhaCcdgmnpqrsv"; /* Also 'P', 'S' */ static const unsigned char flags[NOPT] = { - RBX_DUAL, - RBX_SERIAL, - RBX_ASKNAME, - RBX_CDROM, - RBX_CONFIG, - RBX_KDB, - RBX_GDB, - RBX_MUTE, - RBX_NOINTR, - RBX_PAUSE, - RBX_QUIET, - RBX_DFLTROOT, - RBX_SINGLE, - RBX_VERBOSE + RBX_DUAL, + RBX_SERIAL, + RBX_ASKNAME, + RBX_CDROM, + RBX_CONFIG, + RBX_KDB, + RBX_GDB, + RBX_MUTE, + RBX_NOINTR, + RBX_PAUSE, + RBX_QUIET, + RBX_DFLTROOT, + RBX_SINGLE, + RBX_VERBOSE }; static const char *const dev_nm[NDEV] = {"ad", "da", "fd"}; static const unsigned char dev_maj[NDEV] = {30, 4, 2}; static struct dsk { - unsigned drive; - unsigned type; - unsigned unit; - uint8_t slice; - uint8_t part; - unsigned start; - int init; + unsigned drive; + unsigned type; + unsigned unit; + uint8_t slice; + uint8_t part; + unsigned start; + int init; } dsk; static char cmd[512], cmddup[512], knamebuf[1024]; static const char *kname; @@ -126,21 +126,18 @@ static void memcpy(void *, const void *, int); static void memcpy(void *dst, const void *src, int len) { - const char *s; - char *d; + const char *s = src; + char *d = dst; - s = src; - d = dst; - while (len--) - *d++ = *s++; + while (len--) + *d++ = *s++; } static inline int strcmp(const char *s1, const char *s2) { - - for (; *s1 == *s2 && *s1; s1++, s2++); - return ((unsigned char)*s1 - (unsigned char)*s2); + for (; *s1 == *s2 && *s1; s1++, s2++); + return (unsigned char)*s1 - (unsigned char)*s2; } #define UFS_SMALL_CGBASE @@ -149,519 +146,501 @@ strcmp(const char *s1, const char *s2) static int xfsread(ufs_ino_t inode, void *buf, size_t nbyte) { - - if ((size_t)fsread(inode, buf, nbyte) != nbyte) { - printf("Invalid %s\n", "format"); - return (-1); - } - return (0); + if ((size_t)fsread(inode, buf, nbyte) != nbyte) { + printf("Invalid %s\n", "format"); + return -1; + } + return 0; } static inline void getstr(void) { - char *s; - int c; + char *s; + int c; - s = cmd; - for (;;) { - switch (c = xgetc(0)) { - case 0: - break; - case '\177': - case '\b': - if (s > cmd) { - s--; - printf("\b \b"); - } - break; - case '\n': - case '\r': - *s = 0; - return; - default: - if (s - cmd < sizeof(cmd) - 1) - *s++ = c; - putchar(c); - } + s = cmd; + for (;;) { + switch (c = xgetc(0)) { + case 0: + break; + case '\177': + case '\b': + if (s > cmd) { + s--; + printf("\b \b"); + } + break; + case '\n': + case '\r': + *s = 0; + return; + default: + if (s - cmd < sizeof(cmd) - 1) + *s++ = c; + putchar(c); } + } } static inline void putc(int c) { - - v86.addr = 0x10; - v86.eax = 0xe00 | (c & 0xff); - v86.ebx = 0x7; - v86int(); + v86.addr = 0x10; + v86.eax = 0xe00 | (c & 0xff); + v86.ebx = 0x7; + v86int(); } int main(void) { - uint8_t autoboot; - ufs_ino_t ino; - size_t nbyte; + uint8_t autoboot; + ufs_ino_t ino; + size_t nbyte; - dmadat = (void *)(roundup2(__base + (int32_t)&_end, 0x10000) - __base); - v86.ctl = V86_FLAGS; - v86.efl = PSL_RESERVED_DEFAULT | PSL_I; - dsk.drive = *(uint8_t *)PTOV(ARGS); - dsk.type = dsk.drive & DRV_HARD ? TYPE_AD : TYPE_FD; - dsk.unit = dsk.drive & DRV_MASK; - dsk.slice = *(uint8_t *)PTOV(ARGS + 1) + 1; - bootinfo.bi_version = BOOTINFO_VERSION; - bootinfo.bi_size = sizeof(bootinfo); + dmadat = (void *)(roundup2(__base + (int32_t)&_end, 0x10000) - __base); + v86.ctl = V86_FLAGS; + v86.efl = PSL_RESERVED_DEFAULT | PSL_I; + dsk.drive = *(uint8_t *)PTOV(ARGS); + dsk.type = dsk.drive & DRV_HARD ? TYPE_AD : TYPE_FD; + dsk.unit = dsk.drive & DRV_MASK; + dsk.slice = *(uint8_t *)PTOV(ARGS + 1) + 1; + bootinfo.bi_version = BOOTINFO_VERSION; + bootinfo.bi_size = sizeof(bootinfo); - /* Process configuration file */ + /* Process configuration file */ - autoboot = 1; + autoboot = 1; - if ((ino = lookup(PATH_CONFIG)) || - (ino = lookup(PATH_DOTCONFIG))) { - nbyte = fsread(ino, cmd, sizeof(cmd) - 1); - cmd[nbyte] = '\0'; - } + if ((ino = lookup(PATH_CONFIG)) || + (ino = lookup(PATH_DOTCONFIG))) { + nbyte = fsread(ino, cmd, sizeof(cmd) - 1); + cmd[nbyte] = '\0'; + } - if (*cmd) { - memcpy(cmddup, cmd, sizeof(cmd)); - if (parse()) - autoboot = 0; - if (!OPT_CHECK(RBX_QUIET)) - printf("%s: %s", PATH_CONFIG, cmddup); - /* Do not process this command twice */ - *cmd = 0; - } + if (*cmd) { + memcpy(cmddup, cmd, sizeof(cmd)); + if (parse()) + autoboot = 0; + if (!OPT_CHECK(RBX_QUIET)) + printf("%s: %s", PATH_CONFIG, cmddup); + /* Do not process this command twice */ + *cmd = 0; + } - /* - * Try to exec stage 3 boot loader. If interrupted by a keypress, - * or in case of failure, try to load a kernel directly instead. - */ + /* + * Try to exec stage 3 boot loader. If interrupted by a keypress, + * or in case of failure, try to load a kernel directly instead. + */ - if (!kname) { - kname = PATH_LOADER; - if (autoboot && !keyhit(3*SECOND)) { - load(); - kname = PATH_KERNEL; - } + if (!kname) { + kname = PATH_LOADER; + if (autoboot && !keyhit(3*SECOND)) { + load(); + kname = PATH_KERNEL; } + } - /* Present the user with the boot2 prompt. */ + /* Present the user with the boot2 prompt. */ - for (;;) { - if (!autoboot || !OPT_CHECK(RBX_QUIET)) - printf("\nFreeBSD/x86 boot\n" - "Default: %u:%s(%u,%c)%s\n" - "boot: ", - dsk.drive & DRV_MASK, dev_nm[dsk.type], dsk.unit, - 'a' + dsk.part, kname); - if (DO_SIO) - sio_flush(); - if (!autoboot || keyhit(3*SECOND)) - getstr(); - else if (!autoboot || !OPT_CHECK(RBX_QUIET)) - putchar('\n'); - autoboot = 0; - if (parse()) - putchar('\a'); - else - load(); - } + for (;;) { + if (!autoboot || !OPT_CHECK(RBX_QUIET)) + printf("\nFreeBSD/x86 boot\n" + "Default: %u:%s(%u,%c)%s\n" + "boot: ", + dsk.drive & DRV_MASK, dev_nm[dsk.type], dsk.unit, + 'a' + dsk.part, kname); + if (DO_SIO) + sio_flush(); + if (!autoboot || keyhit(3*SECOND)) + getstr(); + else if (!autoboot || !OPT_CHECK(RBX_QUIET)) + putchar('\n'); + autoboot = 0; + if (parse()) + putchar('\a'); + else + load(); + } } /* XXX - Needed for btxld to link the boot2 binary; do not remove. */ void exit(int x) { - } static void load(void) { - union { - struct exec ex; - Elf32_Ehdr eh; - } hdr; - static Elf32_Phdr ep[2]; - static Elf32_Shdr es[2]; - caddr_t p; - ufs_ino_t ino; - uint32_t addr; - int k; - uint8_t i, j; + union { + struct exec ex; + Elf32_Ehdr eh; + } hdr; + static Elf32_Phdr ep[2]; + static Elf32_Shdr es[2]; + caddr_t p; + ufs_ino_t ino; + uint32_t addr; + int k; + uint8_t i, j; - if (!(ino = lookup(kname))) { - if (!ls) - printf("No %s\n", kname); + if (!(ino = lookup(kname))) { + if (!ls) + printf("No %s\n", kname); + return; + } + if (xfsread(ino, &hdr, sizeof(hdr))) + return; + + if (N_GETMAGIC(hdr.ex) == ZMAGIC) { + addr = hdr.ex.a_entry & 0xffffff; + p = PTOV(addr); + fs_off = PAGE_SIZE; + if (xfsread(ino, p, hdr.ex.a_text)) + return; + p += roundup2(hdr.ex.a_text, PAGE_SIZE); + if (xfsread(ino, p, hdr.ex.a_data)) + return; + } else if (IS_ELF(hdr.eh)) { + fs_off = hdr.eh.e_phoff; + for (j = k = 0; k < hdr.eh.e_phnum && j < 2; k++) { + if (xfsread(ino, ep + j, sizeof(ep[0]))) return; + if (ep[j].p_type == PT_LOAD) + j++; } - if (xfsread(ino, &hdr, sizeof(hdr))) + for (i = 0; i < 2; i++) { + p = PTOV(ep[i].p_paddr & 0xffffff); + fs_off = ep[i].p_offset; + if (xfsread(ino, p, ep[i].p_filesz)) return; - - if (N_GETMAGIC(hdr.ex) == ZMAGIC) { - addr = hdr.ex.a_entry & 0xffffff; - p = PTOV(addr); - fs_off = PAGE_SIZE; - if (xfsread(ino, p, hdr.ex.a_text)) - return; - p += roundup2(hdr.ex.a_text, PAGE_SIZE); - if (xfsread(ino, p, hdr.ex.a_data)) - return; - } else if (IS_ELF(hdr.eh)) { - fs_off = hdr.eh.e_phoff; - for (j = k = 0; k < hdr.eh.e_phnum && j < 2; k++) { - if (xfsread(ino, ep + j, sizeof(ep[0]))) - return; - if (ep[j].p_type == PT_LOAD) - j++; - } - for (i = 0; i < 2; i++) { - p = PTOV(ep[i].p_paddr & 0xffffff); - fs_off = ep[i].p_offset; - if (xfsread(ino, p, ep[i].p_filesz)) - return; - } - p += roundup2(ep[1].p_memsz, PAGE_SIZE); - bootinfo.bi_symtab = VTOP(p); - if (hdr.eh.e_shnum == hdr.eh.e_shstrndx + 3) { - fs_off = hdr.eh.e_shoff + sizeof(es[0]) * - (hdr.eh.e_shstrndx + 1); - if (xfsread(ino, &es, sizeof(es))) - return; - for (i = 0; i < 2; i++) { - *(Elf32_Word *)p = es[i].sh_size; - p += sizeof(es[i].sh_size); - fs_off = es[i].sh_offset; - if (xfsread(ino, p, es[i].sh_size)) - return; - p += es[i].sh_size; - } - } - addr = hdr.eh.e_entry & 0xffffff; - bootinfo.bi_esymtab = VTOP(p); - } else { - printf("Invalid %s\n", "format"); + } + p += roundup2(ep[1].p_memsz, PAGE_SIZE); + bootinfo.bi_symtab = VTOP(p); + if (hdr.eh.e_shnum == hdr.eh.e_shstrndx + 3) { + fs_off = hdr.eh.e_shoff + sizeof(es[0]) * + (hdr.eh.e_shstrndx + 1); + if (xfsread(ino, &es, sizeof(es))) return; + for (i = 0; i < 2; i++) { + *(Elf32_Word *)p = es[i].sh_size; + p += sizeof(es[i].sh_size); + fs_off = es[i].sh_offset; + if (xfsread(ino, p, es[i].sh_size)) + return; + p += es[i].sh_size; + } } + addr = hdr.eh.e_entry & 0xffffff; + bootinfo.bi_esymtab = VTOP(p); + } else { + printf("Invalid %s\n", "format"); + return; + } - bootinfo.bi_kernelname = VTOP(kname); - bootinfo.bi_bios_dev = dsk.drive; - __exec((caddr_t)addr, RB_BOOTINFO | (opts & RBX_MASK), - MAKEBOOTDEV(dev_maj[dsk.type], dsk.slice, dsk.unit, dsk.part), - 0, 0, 0, VTOP(&bootinfo)); + bootinfo.bi_kernelname = VTOP(kname); + bootinfo.bi_bios_dev = dsk.drive; + __exec((caddr_t)addr, RB_BOOTINFO | (opts & RBX_MASK), + MAKEBOOTDEV(dev_maj[dsk.type], dsk.slice, dsk.unit, dsk.part), + 0, 0, 0, VTOP(&bootinfo)); } static int parse() { - char *arg; - char *ep, *p, *q; - const char *cp; - unsigned int drv; - int c, i, j; - size_t k; + char *arg = cmd; + char *ep, *p, *q; + const char *cp; + unsigned int drv; + int c, i, j; + size_t k; - arg = cmd; - - while ((c = *arg++)) { - if (c == ' ' || c == '\t' || c == '\n') - continue; - for (p = arg; *p && *p != '\n' && *p != ' ' && *p != '\t'; p++); - ep = p; - if (*p) - *p++ = 0; - if (c == '-') { - while ((c = *arg++)) { - if (c == 'P') { - if (*(uint8_t *)PTOV(0x496) & 0x10) { - cp = "yes"; - } else { - opts |= OPT_SET(RBX_DUAL) | - OPT_SET(RBX_SERIAL); - cp = "no"; - } - printf("Keyboard: %s\n", cp); - continue; + while ((c = *arg++)) { + if (c == ' ' || c == '\t' || c == '\n') + continue; + for (p = arg; *p && *p != '\n' && *p != ' ' && *p != '\t'; p++); + ep = p; + if (*p) + *p++ = 0; + if (c == '-') { + while ((c = *arg++)) { + if (c == 'P') { + if (*(uint8_t *)PTOV(0x496) & 0x10) { + cp = "yes"; + } else { + opts |= OPT_SET(RBX_DUAL) | OPT_SET(RBX_SERIAL); + cp = "no"; + } + printf("Keyboard: %s\n", cp); + continue; #if SERIAL - } else if (c == 'S') { - j = 0; - while (*arg <= '9') { - i = (unsigned int)(*arg - '0'); - j = j * 10 + i; - arg++; - } - if (j > 0 && i == -'0') { - comspeed = j; - break; - } - /* - * Fall through to error below - * ('S' not in optstr[]). - */ + } else if (c == 'S') { + j = 0; + while ((unsigned int)(i = *arg++ - '0') <= 9) + j = j * 10 + i; + if (j > 0 && i == -'0') { + comspeed = j; + break; + } + /* Fall through to error below ('S' not in optstr[]). */ #endif - } - for (i = 0; c != optstr[i]; i++) - if (i == NOPT - 1) - return (-1); - opts ^= OPT_SET(flags[i]); - } + } + for (i = 0; c != optstr[i]; i++) + if (i == NOPT - 1) + return -1; + opts ^= OPT_SET(flags[i]); + } #if SERIAL - ioctrl = OPT_CHECK(RBX_DUAL) ? - (IO_SERIAL|IO_KEYBOARD) : - OPT_CHECK(RBX_SERIAL) ? IO_SERIAL : IO_KEYBOARD; - if (DO_SIO) { - if (sio_init(115200 / comspeed) != 0) - ioctrl &= ~IO_SERIAL; - } + ioctrl = OPT_CHECK(RBX_DUAL) ? (IO_SERIAL|IO_KEYBOARD) : + OPT_CHECK(RBX_SERIAL) ? IO_SERIAL : IO_KEYBOARD; + if (DO_SIO) { + if (sio_init(115200 / comspeed) != 0) + ioctrl &= ~IO_SERIAL; + } #endif - } else { - for (q = arg--; *q && *q != '('; q++); - if (*q) { - drv = -1; - if (arg[1] == ':') { - drv = *arg - '0'; - if (drv > 9) - return (-1); - arg += 2; - } - if (q - arg != 2) - return -1; - for (i = 0; arg[0] != dev_nm[i][0] || - arg[1] != dev_nm[i][1]; i++) - if (i == NDEV - 1) - return (-1); - dsk.type = i; - arg += 3; - dsk.unit = *arg - '0'; - if (arg[1] != ',' || dsk.unit > 9) - return (-1); - arg += 2; - dsk.slice = WHOLE_DISK_SLICE; - if (arg[1] == ',') { - dsk.slice = *arg - '0' + 1; - if (dsk.slice > NDOSPART + 1) - return (-1); - arg += 2; - } - if (arg[1] != ')') - return (-1); - dsk.part = *arg - 'a'; - if (dsk.part > 7) - return (-1); - arg += 2; - if (drv == -1) - drv = dsk.unit; - dsk.drive = (dsk.type <= TYPE_MAXHARD - ? DRV_HARD : 0) + drv; - dsk_meta = 0; - } - k = ep - arg; - if (k > 0) { - if (k >= sizeof(knamebuf)) - return (-1); - memcpy(knamebuf, arg, k + 1); - kname = knamebuf; - } + } else { + for (q = arg--; *q && *q != '('; q++); + if (*q) { + drv = -1; + if (arg[1] == ':') { + drv = *arg - '0'; + if (drv > 9) + return (-1); + arg += 2; } - arg = p; + if (q - arg != 2) + return -1; + for (i = 0; arg[0] != dev_nm[i][0] || + arg[1] != dev_nm[i][1]; i++) + if (i == NDEV - 1) + return -1; + dsk.type = i; + arg += 3; + dsk.unit = *arg - '0'; + if (arg[1] != ',' || dsk.unit > 9) + return -1; + arg += 2; + dsk.slice = WHOLE_DISK_SLICE; + if (arg[1] == ',') { + dsk.slice = *arg - '0' + 1; + if (dsk.slice > NDOSPART + 1) + return -1; + arg += 2; + } + if (arg[1] != ')') + return -1; + dsk.part = *arg - 'a'; + if (dsk.part > 7) + return (-1); + arg += 2; + if (drv == -1) + drv = dsk.unit; + dsk.drive = (dsk.type <= TYPE_MAXHARD + ? DRV_HARD : 0) + drv; + dsk_meta = 0; + } + k = ep - arg; + if (k > 0) { + if (k >= sizeof(knamebuf)) + return -1; + memcpy(knamebuf, arg, k + 1); + kname = knamebuf; + } } - return (0); + arg = p; + } + return 0; } static int dskread(void *buf, unsigned lba, unsigned nblk) { - struct dos_partition *dp; - struct disklabel *d; - char *sec; - unsigned i; - uint8_t sl; - const char *reason; + struct dos_partition *dp; + struct disklabel *d; + char *sec; + unsigned i; + uint8_t sl; + const char *reason; - if (!dsk_meta) { - sec = dmadat->secbuf; - dsk.start = 0; - if (drvread(sec, DOSBBSECTOR, 1)) - return (-1); - dp = (void *)(sec + DOSPARTOFF); - sl = dsk.slice; - if (sl < BASE_SLICE) { - for (i = 0; i < NDOSPART; i++) - if (dp[i].dp_typ == DOSPTYP_386BSD && - (dp[i].dp_flag & 0x80 || sl < BASE_SLICE)) { - sl = BASE_SLICE + i; - if (dp[i].dp_flag & 0x80 || - dsk.slice == COMPATIBILITY_SLICE) - break; - } - if (dsk.slice == WHOLE_DISK_SLICE) - dsk.slice = sl; + if (!dsk_meta) { + sec = dmadat->secbuf; + dsk.start = 0; + if (drvread(sec, DOSBBSECTOR, 1)) + return -1; + dp = (void *)(sec + DOSPARTOFF); + sl = dsk.slice; + if (sl < BASE_SLICE) { + for (i = 0; i < NDOSPART; i++) + if (dp[i].dp_typ == DOSPTYP_386BSD && + (dp[i].dp_flag & 0x80 || sl < BASE_SLICE)) { + sl = BASE_SLICE + i; + if (dp[i].dp_flag & 0x80 || + dsk.slice == COMPATIBILITY_SLICE) + break; } - if (sl != WHOLE_DISK_SLICE) { - if (sl != COMPATIBILITY_SLICE) - dp += sl - BASE_SLICE; - if (dp->dp_typ != DOSPTYP_386BSD) { - reason = "slice"; - goto error; - } - dsk.start = dp->dp_start; - } - if (drvread(sec, dsk.start + LABELSECTOR, 1)) - return (-1); - d = (void *)(sec + LABELOFFSET); - if (d->d_magic != DISKMAGIC || d->d_magic2 != DISKMAGIC) { - if (dsk.part != RAW_PART) { - reason = "label"; - goto error; - } - } else { - if (!dsk.init) { - if (d->d_type == DTYPE_SCSI) - dsk.type = TYPE_DA; - dsk.init++; - } - if (dsk.part >= d->d_npartitions || - !d->d_partitions[dsk.part].p_size) { - reason = "partition"; - goto error; - } - dsk.start += d->d_partitions[dsk.part].p_offset; - dsk.start -= d->d_partitions[RAW_PART].p_offset; - } + if (dsk.slice == WHOLE_DISK_SLICE) + dsk.slice = sl; } - return (drvread(buf, dsk.start + lba, nblk)); + if (sl != WHOLE_DISK_SLICE) { + if (sl != COMPATIBILITY_SLICE) + dp += sl - BASE_SLICE; + if (dp->dp_typ != DOSPTYP_386BSD) { + reason = "slice"; + goto error; + } + dsk.start = dp->dp_start; + } + if (drvread(sec, dsk.start + LABELSECTOR, 1)) + return -1; + d = (void *)(sec + LABELOFFSET); + if (d->d_magic != DISKMAGIC || d->d_magic2 != DISKMAGIC) { + if (dsk.part != RAW_PART) { + reason = "label"; + goto error; + } + } else { + if (!dsk.init) { + if (d->d_type == DTYPE_SCSI) + dsk.type = TYPE_DA; + dsk.init++; + } + if (dsk.part >= d->d_npartitions || + !d->d_partitions[dsk.part].p_size) { + reason = "partition"; + goto error; + } + dsk.start += d->d_partitions[dsk.part].p_offset; + dsk.start -= d->d_partitions[RAW_PART].p_offset; + } + } + return drvread(buf, dsk.start + lba, nblk); error: - printf("Invalid %s\n", reason); - return (-1); + printf("Invalid %s\n", reason); + return -1; } static void printf(const char *fmt,...) { - va_list ap; - static char buf[10]; - char *s; - unsigned u; - int c; + va_list ap; + static char buf[10]; + char *s; + unsigned u; + int c; - va_start(ap, fmt); - while ((c = *fmt++)) { - if (c == '%') { - c = *fmt++; - switch (c) { - case 'c': - putchar(va_arg(ap, int)); - continue; - case 's': - for (s = va_arg(ap, char *); *s; s++) - putchar(*s); - continue; - case 'u': - u = va_arg(ap, unsigned); - s = buf; - do - *s++ = '0' + u % 10U; - while (u /= 10U); - while (--s >= buf) - putchar(*s); - continue; - } - } - putchar(c); + va_start(ap, fmt); + while ((c = *fmt++)) { + if (c == '%') { + c = *fmt++; + switch (c) { + case 'c': + putchar(va_arg(ap, int)); + continue; + case 's': + for (s = va_arg(ap, char *); *s; s++) + putchar(*s); + continue; + case 'u': + u = va_arg(ap, unsigned); + s = buf; + do + *s++ = '0' + u % 10U; + while (u /= 10U); + while (--s >= buf) + putchar(*s); + continue; + } } - va_end(ap); - return; + putchar(c); + } + va_end(ap); + return; } static void putchar(int c) { - - if (c == '\n') - xputc('\r'); - xputc(c); + if (c == '\n') + xputc('\r'); + xputc(c); } static int drvread(void *buf, unsigned lba, unsigned nblk) { - static unsigned c = 0x2d5c7c2f; + static unsigned c = 0x2d5c7c2f; - if (!OPT_CHECK(RBX_QUIET)) { - xputc(c = c << 8 | c >> 24); - xputc('\b'); - } - v86.ctl = V86_ADDR | V86_CALLF | V86_FLAGS; - v86.addr = XREADORG; /* call to xread in boot1 */ - v86.es = VTOPSEG(buf); - v86.eax = lba; - v86.ebx = VTOPOFF(buf); - v86.ecx = lba >> 16; - v86.edx = nblk << 8 | dsk.drive; - v86int(); - v86.ctl = V86_FLAGS; - if (V86_CY(v86.efl)) { - printf("error %u lba %u\n", v86.eax >> 8 & 0xff, lba); - return (-1); - } - return (0); + if (!OPT_CHECK(RBX_QUIET)) { + xputc(c = c << 8 | c >> 24); + xputc('\b'); + } + v86.ctl = V86_ADDR | V86_CALLF | V86_FLAGS; + v86.addr = XREADORG; /* call to xread in boot1 */ + v86.es = VTOPSEG(buf); + v86.eax = lba; + v86.ebx = VTOPOFF(buf); + v86.ecx = lba >> 16; + v86.edx = nblk << 8 | dsk.drive; + v86int(); + v86.ctl = V86_FLAGS; + if (V86_CY(v86.efl)) { + printf("error %u lba %u\n", v86.eax >> 8 & 0xff, lba); + return -1; + } + return 0; } static int keyhit(unsigned ticks) { - uint32_t t0, t1; + uint32_t t0, t1; - if (OPT_CHECK(RBX_NOINTR)) - return (0); - t0 = 0; - for (;;) { - if (xgetc(1)) - return (1); - t1 = *(uint32_t *)PTOV(0x46c); - if (!t0) - t0 = t1; - if ((uint32_t)(t1 - t0) >= ticks) - return (0); - } + if (OPT_CHECK(RBX_NOINTR)) + return 0; + t0 = 0; + for (;;) { + if (xgetc(1)) + return 1; + t1 = *(uint32_t *)PTOV(0x46c); + if (!t0) + t0 = t1; + if ((uint32_t)(t1 - t0) >= ticks) + return 0; + } } static int xputc(int c) { - - if (DO_KBD) - putc(c); - if (DO_SIO) - sio_putc(c); - return (c); + if (DO_KBD) + putc(c); + if (DO_SIO) + sio_putc(c); + return c; } static int getc(int fn) { - - v86.addr = 0x16; - v86.eax = fn << 8; - v86int(); - return (fn == 0 ? v86.eax & 0xff : !V86_ZR(v86.efl)); + v86.addr = 0x16; + v86.eax = fn << 8; + v86int(); + return fn == 0 ? v86.eax & 0xff : !V86_ZR(v86.efl); } static int xgetc(int fn) { - - if (OPT_CHECK(RBX_NOINTR)) - return (0); - - for (;;) { - if (DO_KBD && getc(1)) - return (fn ? 1 : getc(0)); - if (DO_SIO && sio_ischar()) - return (fn ? 1 : sio_getc()); - if (fn) - return (0); - } + if (OPT_CHECK(RBX_NOINTR)) + return 0; + for (;;) { + if (DO_KBD && getc(1)) + return fn ? 1 : getc(0); + if (DO_SIO && sio_ischar()) + return fn ? 1 : sio_getc(); + if (fn) + return 0; + } } From owner-svn-src-all@freebsd.org Sat Feb 17 00:21:51 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 84922F20AFA; Sat, 17 Feb 2018 00:21:51 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 35D157A9B5; Sat, 17 Feb 2018 00:21: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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 30D6B14ED3; Sat, 17 Feb 2018 00:21: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 w1H0LpXk029357; Sat, 17 Feb 2018 00:21:51 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1H0LpaN029356; Sat, 17 Feb 2018 00:21:51 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201802170021.w1H0LpaN029356@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Sat, 17 Feb 2018 00:21:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329419 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 329419 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Feb 2018 00:21:51 -0000 Author: mjg Date: Sat Feb 17 00:21:50 2018 New Revision: 329419 URL: https://svnweb.freebsd.org/changeset/base/329419 Log: Tidy up kern_wait6 - don't relock curproc in msleep - don't relock proctree if P_STATCHILD is spotted - reformat the proc_to_reap call in the main loop Modified: head/sys/kern/kern_exit.c Modified: head/sys/kern/kern_exit.c ============================================================================== --- head/sys/kern/kern_exit.c Sat Feb 17 00:12:30 2018 (r329418) +++ head/sys/kern/kern_exit.c Sat Feb 17 00:21:50 2018 (r329419) @@ -1202,21 +1202,21 @@ loop: q->p_flag &= ~P_STATCHILD; PROC_UNLOCK(q); } - nfound = 0; sx_xlock(&proctree_lock); +loop_locked: + nfound = 0; LIST_FOREACH(p, &q->p_children, p_sibling) { pid = p->p_pid; ret = proc_to_reap(td, p, idtype, id, status, options, wrusage, siginfo, 0); if (ret == 0) continue; - else if (ret == 1) - nfound++; - else { + else if (ret != 1) { td->td_retval[0] = pid; return (0); } + nfound++; PROC_LOCK_ASSERT(p, MA_OWNED); if ((options & (WTRAPPED | WUNTRACED)) != 0) @@ -1237,7 +1237,7 @@ loop: report_alive_proc(td, p, siginfo, status, options, CLD_TRAPPED); return (0); - } + } if ((options & WUNTRACED) != 0 && (p->p_flag & P_STOPPED_SIG) != 0 && p->p_suspcount == p->p_numthreads && @@ -1293,13 +1293,13 @@ loop: return (0); } PROC_LOCK(q); - sx_xunlock(&proctree_lock); if (q->p_flag & P_STATCHILD) { q->p_flag &= ~P_STATCHILD; - error = 0; - } else - error = msleep(q, &q->p_mtx, PWAIT | PCATCH, "wait", 0); - PROC_UNLOCK(q); + PROC_UNLOCK(q); + goto loop_locked; + } + sx_xunlock(&proctree_lock); + error = msleep(q, &q->p_mtx, PWAIT | PCATCH | PDROP, "wait", 0); if (error) return (error); goto loop; From owner-svn-src-all@freebsd.org Sat Feb 17 00:23:29 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 70746F20D50; Sat, 17 Feb 2018 00:23:29 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2129C7ABE7; Sat, 17 Feb 2018 00:23:29 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1C13114FFC; Sat, 17 Feb 2018 00:23:29 +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 w1H0NSfW030382; Sat, 17 Feb 2018 00:23:28 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1H0NSH0030381; Sat, 17 Feb 2018 00:23:28 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201802170023.w1H0NSH0030381@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Sat, 17 Feb 2018 00:23:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329420 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 329420 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Feb 2018 00:23:29 -0000 Author: mjg Date: Sat Feb 17 00:23:28 2018 New Revision: 329420 URL: https://svnweb.freebsd.org/changeset/base/329420 Log: Postpone sx_sunlock(&proctree_lock) on fork until after allproc is dropped. There is a significant contention on the lock during -j 128 package build. This change drops total wait time on this lock by 60%. Modified: head/sys/kern/kern_fork.c Modified: head/sys/kern/kern_fork.c ============================================================================== --- head/sys/kern/kern_fork.c Sat Feb 17 00:21:50 2018 (r329419) +++ head/sys/kern/kern_fork.c Sat Feb 17 00:23:28 2018 (r329420) @@ -401,8 +401,6 @@ do_fork(struct thread *td, struct fork_req *fr, struct trypid = fork_findpid(fr->fr_flags); - sx_sunlock(&proctree_lock); - p2->p_state = PRS_NEW; /* protect against others */ p2->p_pid = trypid; AUDIT_ARG_PID(p2->p_pid); @@ -414,6 +412,7 @@ do_fork(struct thread *td, struct fork_req *fr, struct PROC_LOCK(p1); sx_xunlock(&allproc_lock); + sx_sunlock(&proctree_lock); bcopy(&p1->p_startcopy, &p2->p_startcopy, __rangeof(struct proc, p_startcopy, p_endcopy)); @@ -977,8 +976,8 @@ fork1(struct thread *td, struct fork_req *fr) } error = EAGAIN; - sx_sunlock(&proctree_lock); sx_xunlock(&allproc_lock); + sx_sunlock(&proctree_lock); #ifdef MAC mac_proc_destroy(newproc); #endif From owner-svn-src-all@freebsd.org Sat Feb 17 00:23:57 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 77112F20DCC; Sat, 17 Feb 2018 00:23:57 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2652E7AD19; Sat, 17 Feb 2018 00:23:57 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2134E14FFD; Sat, 17 Feb 2018 00:23:57 +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 w1H0NvxE030440; Sat, 17 Feb 2018 00:23:57 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1H0Nvqi030439; Sat, 17 Feb 2018 00:23:57 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201802170023.w1H0Nvqi030439@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Sat, 17 Feb 2018 00:23:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329421 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 329421 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Feb 2018 00:23:57 -0000 Author: mjg Date: Sat Feb 17 00:23:56 2018 New Revision: 329421 URL: https://svnweb.freebsd.org/changeset/base/329421 Log: Unref the prison after proctree is dropped. Modified: head/sys/kern/kern_exit.c Modified: head/sys/kern/kern_exit.c ============================================================================== --- head/sys/kern/kern_exit.c Sat Feb 17 00:23:28 2018 (r329420) +++ head/sys/kern/kern_exit.c Sat Feb 17 00:23:56 2018 (r329421) @@ -530,9 +530,6 @@ exit1(struct thread *td, int rval, int signo) PROC_LOCK(p); p->p_xthread = td; - /* Tell the prison that we are gone. */ - prison_proc_free(p->p_ucred->cr_prison); - #ifdef KDTRACE_HOOKS /* * Tell the DTrace fasttrap provider about the exit if it @@ -602,6 +599,9 @@ exit1(struct thread *td, int rval, int signo) } else PROC_LOCK(p->p_pptr); sx_xunlock(&proctree_lock); + + /* Tell the prison that we are gone. */ + prison_proc_free(p->p_ucred->cr_prison); /* * The state PRS_ZOMBIE prevents other proesses from sending From owner-svn-src-all@freebsd.org Sat Feb 17 00:24:51 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2AF8BF20EFD; Sat, 17 Feb 2018 00:24:51 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CDF017AE8C; Sat, 17 Feb 2018 00:24:50 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C90B014FFF; Sat, 17 Feb 2018 00:24:50 +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 w1H0OofI030512; Sat, 17 Feb 2018 00:24:50 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1H0OoYR030511; Sat, 17 Feb 2018 00:24:50 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201802170024.w1H0OoYR030511@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Sat, 17 Feb 2018 00:24:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329422 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 329422 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Feb 2018 00:24:51 -0000 Author: mjg Date: Sat Feb 17 00:24:50 2018 New Revision: 329422 URL: https://svnweb.freebsd.org/changeset/base/329422 Log: On process exit signal the parent after dropping the proctree lock. Modified: head/sys/kern/kern_exit.c Modified: head/sys/kern/kern_exit.c ============================================================================== --- head/sys/kern/kern_exit.c Sat Feb 17 00:23:56 2018 (r329421) +++ head/sys/kern/kern_exit.c Sat Feb 17 00:24:50 2018 (r329422) @@ -193,6 +193,7 @@ exit1(struct thread *td, int rval, int signo) struct proc *p, *nq, *q, *t; struct thread *tdt; ksiginfo_t *ksi, *ksi1; + int signal_parent; mtx_assert(&Giant, MA_NOTOWNED); KASSERT(rval == 0 || signo == 0, ("exit1 rv %d sig %d", rval, signo)); @@ -559,6 +560,7 @@ exit1(struct thread *td, int rval, int signo) * procdesc_exit() to serialize concurrent calls to close() and * exit(). */ + signal_parent = 0; if (p->p_procdesc == NULL || procdesc_exit(p)) { /* * Notify parent that we're gone. If parent has the @@ -588,17 +590,24 @@ exit1(struct thread *td, int rval, int signo) } else mtx_unlock(&p->p_pptr->p_sigacts->ps_mtx); - if (p->p_pptr == p->p_reaper || p->p_pptr == initproc) - childproc_exited(p); - else if (p->p_sigparent != 0) { - if (p->p_sigparent == SIGCHLD) - childproc_exited(p); - else /* LINUX thread */ - kern_psignal(p->p_pptr, p->p_sigparent); + if (p->p_pptr == p->p_reaper || p->p_pptr == initproc) { + signal_parent = 1; + } else if (p->p_sigparent != 0) { + if (p->p_sigparent == SIGCHLD) { + signal_parent = 1; + } else { /* LINUX thread */ + signal_parent = 2; + } } } else PROC_LOCK(p->p_pptr); sx_xunlock(&proctree_lock); + + if (signal_parent == 1) { + childproc_exited(p); + } else if (signal_parent == 2) { + kern_psignal(p->p_pptr, p->p_sigparent); + } /* Tell the prison that we are gone. */ prison_proc_free(p->p_ucred->cr_prison); From owner-svn-src-all@freebsd.org Sat Feb 17 00:42:38 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 00BEBF221C6; Sat, 17 Feb 2018 00:42:38 +0000 (UTC) (envelope-from jbeich@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A7CD77B9DF; Sat, 17 Feb 2018 00:42:37 +0000 (UTC) (envelope-from jbeich@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1354) id A00261819B; Sat, 17 Feb 2018 00:42:37 +0000 (UTC) From: Jan Beich To: Hans Petter Selasky Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r329371 - head/sys/compat/linuxkpi/common/include/asm References: <201802161520.w1GFKLiA049085@repo.freebsd.org> Date: Sat, 17 Feb 2018 01:42:15 +0100 In-Reply-To: <201802161520.w1GFKLiA049085@repo.freebsd.org> (Hans Petter Selasky's message of "Fri, 16 Feb 2018 15:20:21 +0000 (UTC)") Message-ID: MIME-Version: 1.0 Content-Type: text/plain X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Feb 2018 00:42:38 -0000 Hans Petter Selasky writes: > Author: hselasky > Date: Fri Feb 16 15:20:21 2018 > New Revision: 329371 > URL: https://svnweb.freebsd.org/changeset/base/329371 > > Log: > Allow the cmpxchg() macro in the LinuxKPI to work on pointers without > generating compiler warnings, -Wint-conversion . [...] To generate errors instead ? $ make clean all -C /usr/ports/graphics/drm-next-kmod [...] drm_lock.c:72:10: error: flexible array member 'u8' in a union is not allowed prev = cmpxchg(lock, old, new); ^ /usr/src/sys/compat/linuxkpi/common/include/asm/atomic.h:165:6: note: expanded from macro 'cmpxchg' u8 u8[]; \ ^ drm_lock.c:72:10: error: flexible array member 'u16' in a union is not allowed /usr/src/sys/compat/linuxkpi/common/include/asm/atomic.h:166:7: note: expanded from macro 'cmpxchg' u16 u16[]; \ ^ drm_lock.c:72:10: error: flexible array member 'u32' in a union is not allowed /usr/src/sys/compat/linuxkpi/common/include/asm/atomic.h:167:7: note: expanded from macro 'cmpxchg' u32 u32[]; \ ^ drm_lock.c:72:10: error: flexible array member 'u64' in a union is not allowed /usr/src/sys/compat/linuxkpi/common/include/asm/atomic.h:168:7: note: expanded from macro 'cmpxchg' u64 u64[]; \ ^ From owner-svn-src-all@freebsd.org Sat Feb 17 02:14:02 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 24D32F03C2A; Sat, 17 Feb 2018 02:14:02 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CC7E67F7B1; Sat, 17 Feb 2018 02:14:01 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C7543163B3; Sat, 17 Feb 2018 02:14:01 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1H2E1if085544; Sat, 17 Feb 2018 02:14:01 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1H2E1Vg085541; Sat, 17 Feb 2018 02:14:01 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201802170214.w1H2E1Vg085541@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sat, 17 Feb 2018 02:14:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r329423 - stable/11/stand/libsa X-SVN-Group: stable-11 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: stable/11/stand/libsa X-SVN-Commit-Revision: 329423 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Feb 2018 02:14:02 -0000 Author: kevans Date: Sat Feb 17 02:14:01 2018 New Revision: 329423 URL: https://svnweb.freebsd.org/changeset/base/329423 Log: MFC r329264: libsa: Fix IP recv timeout [This is slightly modified to not set `t` in the middle of the loop so that the connection will eventually timeout after MAXTMO] readip() doesn't, at the moment, properly indicate to callers that it has timed out. One can tell that it's timed out if errno == EAGAIN when it returns, but this is not ideal. Restructure it a little bit to explicitly set errno to ETIMEDOUT if we've exhausted tleft. I found two places that care about where it timed out or not: sendrecv in net.c and sendrecv_tftp. Both are structured to pass smaller timeout values to readip while tracking a larger timeout. Neither of them were able to do this properly with readip not indicating ETIMEDOUT, so fix it. While here, straighten out the time (t/t1) usage in sendrecv_tftp. This would have manifested itself in periodic failures to NFS/TFTP boot for no apparent reason because MINTMO/MAXTMO were not actually being respected properly. Problems were not reported with NFS, only TFTP. Modified: stable/11/stand/libsa/ip.c stable/11/stand/libsa/net.c stable/11/stand/libsa/tftp.c Directory Properties: stable/11/ (props changed) Modified: stable/11/stand/libsa/ip.c ============================================================================== --- stable/11/stand/libsa/ip.c Sat Feb 17 00:24:50 2018 (r329422) +++ stable/11/stand/libsa/ip.c Sat Feb 17 02:14:01 2018 (r329423) @@ -416,8 +416,13 @@ readip(struct iodesc *d, void **pkt, void **payload, t while ((getsecs() - t) < tleft) { errno = 0; ret = readipv4(d, pkt, payload, tleft, proto); + if (ret >= 0) + return (ret); + /* Bubble up the error if it wasn't successful */ if (errno != EAGAIN) - break; + return (-1); } - return (ret); + /* We've exhausted tleft; timeout */ + errno = ETIMEDOUT; + return (-1); } Modified: stable/11/stand/libsa/net.c ============================================================================== --- stable/11/stand/libsa/net.c Sat Feb 17 00:24:50 2018 (r329422) +++ stable/11/stand/libsa/net.c Sat Feb 17 02:14:01 2018 (r329423) @@ -118,7 +118,7 @@ sendrecv(struct iodesc *d, /* Try to get a packet and process it. */ cc = (*rproc)(d, pkt, payload, tleft); /* Return on data, EOF or real error. */ - if (cc != -1 || errno != 0) + if (cc != -1 || (errno != 0 && errno != ETIMEDOUT)) return (cc); /* Timed out or didn't get the packet we're waiting for */ Modified: stable/11/stand/libsa/tftp.c ============================================================================== --- stable/11/stand/libsa/tftp.c Sat Feb 17 00:24:50 2018 (r329422) +++ stable/11/stand/libsa/tftp.c Sat Feb 17 02:14:01 2018 (r329423) @@ -638,14 +638,20 @@ sendrecv_tftp(struct tftp_handle *h, if (cc == -1) { /* Error on transmit; wait before retrying */ while ((getsecs() - t1) < tleft); + t1 = getsecs(); continue; } + t1 = getsecs(); recvnext: + if ((getsecs() - t) > MAXTMO) { + errno = ETIMEDOUT; + return -1; + } /* Try to get a packet and process it. */ cc = (*rproc)(h, pkt, payload, tleft, rtype); /* Return on data, EOF or real error. */ - if (cc != -1 || errno != 0) + if (cc != -1 || (errno != 0 && errno != ETIMEDOUT)) return (cc); if ((getsecs() - t1) < tleft) { goto recvnext; From owner-svn-src-all@freebsd.org Sat Feb 17 03:39:56 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 017E2F09E6D; Sat, 17 Feb 2018 03:39:56 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A770383226; Sat, 17 Feb 2018 03:39:55 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A265F17278; Sat, 17 Feb 2018 03:39:55 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1H3dtEV026345; Sat, 17 Feb 2018 03:39:55 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1H3dtBF026344; Sat, 17 Feb 2018 03:39:55 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201802170339.w1H3dtBF026344@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sat, 17 Feb 2018 03:39:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329426 - head/stand/lua X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/stand/lua X-SVN-Commit-Revision: 329426 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Feb 2018 03:39:56 -0000 Author: kevans Date: Sat Feb 17 03:39:55 2018 New Revision: 329426 URL: https://svnweb.freebsd.org/changeset/base/329426 Log: stand/lua: Correct interpretation of autoboot_delay autoboot_delay=NO is documented to wait for input and *not* autoboot, which is the exact opposite of the current behavior. Additionally, autoboot_delay=-1 is documented to disallow the user from interrupting the boot (i.e. autoboot immediately), which was not previously honored. This also fixes the case insensitive comparison to be truly case insensitive. This is kind of nit-picky, but the previous version would only accept "no" and "NO". Modified: head/stand/lua/menu.lua Modified: head/stand/lua/menu.lua ============================================================================== --- head/stand/lua/menu.lua Sat Feb 17 03:13:05 2018 (r329425) +++ head/stand/lua/menu.lua Sat Feb 17 03:39:55 2018 (r329426) @@ -353,7 +353,9 @@ function menu.autoboot() menu.already_autoboot = true; local ab = loader.getenv("autoboot_delay"); - if ab == "NO" or ab == "no" then + if (ab ~= nil) and (ab:lower() == "no") then + return; + elseif (tonumber(ab) == -1) then core.boot(); end ab = tonumber(ab) or 10; From owner-svn-src-all@freebsd.org Sat Feb 17 03:12:35 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CD84DF0868D; Sat, 17 Feb 2018 03:12:35 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 839A78243A; Sat, 17 Feb 2018 03:12:35 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7DFDB16EEA; Sat, 17 Feb 2018 03:12:35 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1H3CZHf016406; Sat, 17 Feb 2018 03:12:35 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1H3CZw2016405; Sat, 17 Feb 2018 03:12:35 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201802170312.w1H3CZw2016405@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sat, 17 Feb 2018 03:12:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329424 - head/stand/lua X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/stand/lua X-SVN-Commit-Revision: 329424 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Feb 2018 03:12:36 -0000 Author: kevans Date: Sat Feb 17 03:12:35 2018 New Revision: 329424 URL: https://svnweb.freebsd.org/changeset/base/329424 Log: stand/lua: Don't set autoboot_delay=NO in menu autoboot sequence We'll set it later if "Escape to loader prompt" is actually chosen, there's no need to be setting it here. Modified: head/stand/lua/menu.lua Modified: head/stand/lua/menu.lua ============================================================================== --- head/stand/lua/menu.lua Sat Feb 17 02:14:01 2018 (r329423) +++ head/stand/lua/menu.lua Sat Feb 17 03:12:35 2018 (r329424) @@ -375,8 +375,6 @@ function menu.autoboot() if ch == core.KEY_ENTER then break; else - -- prevent autoboot when escaping to interpreter - loader.setenv("autoboot_delay", "NO"); -- erase autoboot msg screen.setcursor(0, y); print(" " From owner-svn-src-all@freebsd.org Sat Feb 17 04:22:36 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C0912F0BDD8; Sat, 17 Feb 2018 04:22:36 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6D357850E8; Sat, 17 Feb 2018 04:22:36 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6826E17B97; Sat, 17 Feb 2018 04:22:36 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1H4Ma3B053067; Sat, 17 Feb 2018 04:22:36 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1H4MaR8053066; Sat, 17 Feb 2018 04:22:36 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201802170422.w1H4MaR8053066@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sat, 17 Feb 2018 04:22:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329428 - head/stand/lua X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/stand/lua X-SVN-Commit-Revision: 329428 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Feb 2018 04:22:36 -0000 Author: kevans Date: Sat Feb 17 04:22:36 2018 New Revision: 329428 URL: https://svnweb.freebsd.org/changeset/base/329428 Log: stand/lua: Correct some trivial errors in config An empty module_path to start with isn't ideal, but if all modules are contained within a kernel directory (which is what we just tested) then it isn't strictly an error. Don't assume that module_path has a value already. When we fail to load the kernel, printing the result (which is guaranteed to be nil) is not intended; print the name of the kernel. Modified: head/stand/lua/config.lua Modified: head/stand/lua/config.lua ============================================================================== --- head/stand/lua/config.lua Sat Feb 17 04:07:16 2018 (r329427) +++ head/stand/lua/config.lua Sat Feb 17 04:22:36 2018 (r329428) @@ -297,7 +297,10 @@ function config.loadkernel() -- succeeded add path to module_path if res ~= nil then - loader.setenv("module_path", v..";"..module_path); + if module_path == nil then + loader.setenv("module_path", v..";".. + module_path); + end return true; end end @@ -308,7 +311,7 @@ function config.loadkernel() if res ~= nil then return true; else - print("Failed to load kernel '"..res.."'"); + print("Failed to load kernel '"..kernel.."'"); return false; end end From owner-svn-src-all@freebsd.org Sat Feb 17 03:13:06 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3DE12F08821; Sat, 17 Feb 2018 03:13:06 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E6E478259E; Sat, 17 Feb 2018 03:13:05 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E1AB816EF0; Sat, 17 Feb 2018 03:13:05 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1H3D5o3016468; Sat, 17 Feb 2018 03:13:05 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1H3D5Ue016467; Sat, 17 Feb 2018 03:13:05 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201802170313.w1H3D5Ue016467@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sat, 17 Feb 2018 03:13:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329425 - head/stand/lua X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/stand/lua X-SVN-Commit-Revision: 329425 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Feb 2018 03:13:06 -0000 Author: kevans Date: Sat Feb 17 03:13:05 2018 New Revision: 329425 URL: https://svnweb.freebsd.org/changeset/base/329425 Log: stand/lua: Enable menu autoboot; it seems to work Modified: head/stand/lua/menu.lua Modified: head/stand/lua/menu.lua ============================================================================== --- head/stand/lua/menu.lua Sat Feb 17 03:12:35 2018 (r329424) +++ head/stand/lua/menu.lua Sat Feb 17 03:13:05 2018 (r329425) @@ -264,7 +264,7 @@ function menu.run(m) screen.defcursor(); local alias_table = drawer.drawscreen(m); --- menu.autoboot(); + menu.autoboot(); cont = true; while cont do From owner-svn-src-all@freebsd.org Sat Feb 17 04:07:17 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9A1F6F0B48B; Sat, 17 Feb 2018 04:07:17 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 45017843A7; Sat, 17 Feb 2018 04:07:17 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3893A177C3; Sat, 17 Feb 2018 04:07:17 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1H47HNM042964; Sat, 17 Feb 2018 04:07:17 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1H47HMQ042963; Sat, 17 Feb 2018 04:07:17 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201802170407.w1H47HMQ042963@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sat, 17 Feb 2018 04:07:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329427 - head/stand/lua X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/stand/lua X-SVN-Commit-Revision: 329427 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Feb 2018 04:07:17 -0000 Author: kevans Date: Sat Feb 17 04:07:16 2018 New Revision: 329427 URL: https://svnweb.freebsd.org/changeset/base/329427 Log: stand/lua: Color non-default kernels blue Modified: head/stand/lua/menu.lua Modified: head/stand/lua/menu.lua ============================================================================== --- head/stand/lua/menu.lua Sat Feb 17 03:39:55 2018 (r329426) +++ head/stand/lua/menu.lua Sat Feb 17 04:07:16 2018 (r329427) @@ -204,11 +204,17 @@ menu.welcome = { return "Kernel: "; end - local kernel_name = color.escapef(color.GREEN) .. - choice .. color.default(); - if (idx == 1) then - kernel_name = "default/" .. kernel_name; + local is_default = (idx == 1); + local kernel_name = ""; + local name_color; + if is_default then + name_color = color.escapef(color.GREEN); + kernel_name = "default/"; + else + name_color = color.escapef(color.BLUE); end + kernel_name = kernel_name .. name_color .. choice .. + color.default(); return color.highlight("K").."ernel: " .. kernel_name .. " (" .. idx .. " of " .. #all_choices .. ")"; From owner-svn-src-all@freebsd.org Sat Feb 17 04:43:42 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1060BF0D26D; Sat, 17 Feb 2018 04:43:42 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AF65585F5A; Sat, 17 Feb 2018 04:43:41 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8CBA917EEE; Sat, 17 Feb 2018 04:43:41 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1H4hfd5063117; Sat, 17 Feb 2018 04:43:41 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1H4hfBI063116; Sat, 17 Feb 2018 04:43:41 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201802170443.w1H4hfBI063116@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sat, 17 Feb 2018 04:43:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329430 - head/stand/lua X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/stand/lua X-SVN-Commit-Revision: 329430 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Feb 2018 04:43:42 -0000 Author: kevans Date: Sat Feb 17 04:43:41 2018 New Revision: 329430 URL: https://svnweb.freebsd.org/changeset/base/329430 Log: stand/lua: Address some nits 1.) Instead of string.function(s, ...), use s:function(...) 2.) Don't try to concatenate `res`, it was just tested to be nil 3.) Note that "Loading configuration" is configured modules, and be a little more precise in mentioning what failed ("loading of one or more modules") Modified: head/stand/lua/config.lua Modified: head/stand/lua/config.lua ============================================================================== --- head/stand/lua/config.lua Sat Feb 17 04:33:37 2018 (r329429) +++ head/stand/lua/config.lua Sat Feb 17 04:43:41 2018 (r329430) @@ -38,11 +38,11 @@ function config.setKey(k, n, v) end function config.dumpModules() - print("== Dumping modules") + print("== Dumping modules"); for k, v in pairs(modules) do print(k, v.load); end - print("== Dump ended") + print("== Dump ended"); end local pattern_table = { @@ -57,7 +57,7 @@ local pattern_table = { if modules[k] == nil then modules[k] = {}; end - modules[k].load = string.upper(v); + modules[k].load = v:upper(); end }, -- module_name="value" @@ -133,9 +133,9 @@ local pattern_table = { function config.isValidComment(c) if c ~= nil then - local s = string.match(c, "^%s*#.*"); + local s = c:match("^%s*#.*"); if s == nil then - s = string.match(c, "^%s*$"); + s = c:match("^%s*$"); end if s == nil then return false; @@ -221,13 +221,13 @@ function config.parse(name, silent) local n = 1; local status = true; - for line in string.gmatch(text, "([^\n]+)") do + for line in text:gmatch("([^\n]+)") do - if string.match(line, "^%s*$") == nil then + if line:match("^%s*$") == nil then local found = false; for i, val in ipairs(pattern_table) do - local k, v, c = string.match(line, val.str); + local k, v, c = line:match(val.str); if k ~= nil then found = true; @@ -287,7 +287,7 @@ function config.loadkernel() if res ~= nil then return true; else - print("Failed to load kernel '"..res.."'"); + print("No kernel set, failed to load from module_path"); return false; end else @@ -338,7 +338,7 @@ function config.load(file) local f = loader.getenv("loader_conf_files"); if f ~= nil then - for name in string.gmatch(f, "([%w%p]+)%s*") do + for name in f:gmatch("([%w%p]+)%s*") do if not config.parse(name) then -- print("Failed to parse configuration: '"..name.."'"); end @@ -348,9 +348,9 @@ function config.load(file) print("Loading kernel..."); config.loadkernel(); - print("Loading configurations..."); + print("Loading configured modules..."); if not config.loadmod(modules) then - print("Could not load configurations!"); + print("Could not load one or more modules!"); end end From owner-svn-src-all@freebsd.org Sat Feb 17 04:46:06 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D5225F0D55D; Sat, 17 Feb 2018 04:46:06 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 87D42861CB; Sat, 17 Feb 2018 04:46:06 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 813BF17EF3; Sat, 17 Feb 2018 04:46:06 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1H4k6pl063270; Sat, 17 Feb 2018 04:46:06 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1H4k6e4063269; Sat, 17 Feb 2018 04:46:06 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201802170446.w1H4k6e4063269@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sat, 17 Feb 2018 04:46:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329431 - head/stand/lua X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/stand/lua X-SVN-Commit-Revision: 329431 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Feb 2018 04:46:07 -0000 Author: kevans Date: Sat Feb 17 04:46:06 2018 New Revision: 329431 URL: https://svnweb.freebsd.org/changeset/base/329431 Log: stand/lua: Correct test sense, this should have been 'not nil' Modified: head/stand/lua/config.lua Modified: head/stand/lua/config.lua ============================================================================== --- head/stand/lua/config.lua Sat Feb 17 04:43:41 2018 (r329430) +++ head/stand/lua/config.lua Sat Feb 17 04:46:06 2018 (r329431) @@ -305,7 +305,7 @@ function config.loadkernel() -- succeeded add path to module_path if res ~= nil then - if module_path == nil then + if module_path ~= nil then loader.setenv("module_path", v..";".. module_path); end From owner-svn-src-all@freebsd.org Sat Feb 17 04:33:37 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B3F41F0C908; Sat, 17 Feb 2018 04:33:37 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6504485819; Sat, 17 Feb 2018 04:33:37 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5FE2A17D43; Sat, 17 Feb 2018 04:33:37 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1H4XbVI058256; Sat, 17 Feb 2018 04:33:37 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1H4Xb0K058255; Sat, 17 Feb 2018 04:33:37 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201802170433.w1H4Xb0K058255@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sat, 17 Feb 2018 04:33:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329429 - head/stand/lua X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/stand/lua X-SVN-Commit-Revision: 329429 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Feb 2018 04:33:37 -0000 Author: kevans Date: Sat Feb 17 04:33:37 2018 New Revision: 329429 URL: https://svnweb.freebsd.org/changeset/base/329429 Log: stand/lua: Add debug method to dump modules Modified: head/stand/lua/config.lua Modified: head/stand/lua/config.lua ============================================================================== --- head/stand/lua/config.lua Sat Feb 17 04:22:36 2018 (r329428) +++ head/stand/lua/config.lua Sat Feb 17 04:33:37 2018 (r329429) @@ -37,6 +37,14 @@ function config.setKey(k, n, v) modules[k][n] = v; end +function config.dumpModules() + print("== Dumping modules") + for k, v in pairs(modules) do + print(k, v.load); + end + print("== Dump ended") +end + local pattern_table = { [1] = { str = "^%s*(#.*)", From owner-svn-src-all@freebsd.org Sat Feb 17 05:02:39 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 18ED3F0EB43; Sat, 17 Feb 2018 05:02:39 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E1E1F86C92; Sat, 17 Feb 2018 05:02:38 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C337118243; Sat, 17 Feb 2018 05:02:38 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1H52c7c072897; Sat, 17 Feb 2018 05:02:38 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1H52cQf072896; Sat, 17 Feb 2018 05:02:38 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201802170502.w1H52cQf072896@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sat, 17 Feb 2018 05:02:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329432 - head/stand/lua X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/stand/lua X-SVN-Commit-Revision: 329432 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Feb 2018 05:02:39 -0000 Author: kevans Date: Sat Feb 17 05:02:38 2018 New Revision: 329432 URL: https://svnweb.freebsd.org/changeset/base/329432 Log: stand/lua: Try to load alternate kernels as directories first This is the procedure that config.loadkernel tries to go through, but reloading kernel config didn't use this function. Amend config.loadkernel to take an optional other_kernel. While here, be a little more verbose ("Trying to load kernel") so that it's easy to follow where we've gone wrong. Modified: head/stand/lua/config.lua Modified: head/stand/lua/config.lua ============================================================================== --- head/stand/lua/config.lua Sat Feb 17 04:46:06 2018 (r329431) +++ head/stand/lua/config.lua Sat Feb 17 05:02:38 2018 (r329432) @@ -253,9 +253,11 @@ function config.parse(name, silent) return status; end -function config.loadkernel() +-- other_kernel is optionally the name of a kernel to load, if not the default +-- or autoloaded default from the module_path +function config.loadkernel(other_kernel) local flags = loader.getenv("kernel_options") or ""; - local kernel = loader.getenv("kernel"); + local kernel = other_kernel or loader.getenv("kernel"); local try_load = function (names) for name in names:gmatch("([^;]+)%s*;?") do @@ -265,7 +267,7 @@ function config.loadkernel() end end return nil; - end; + end local load_bootfile = function() local bootfile = loader.getenv("bootfile"); @@ -294,6 +296,9 @@ function config.loadkernel() local module_path = loader.getenv("module_path"); local res = nil; + if other_kern ~= nil then + kernel = other_kern; + end -- first try load kernel with module_path = /boot/${kernel} -- then try load with module_path=${kernel} local paths = {"/boot/"..kernel, kernel}; @@ -355,22 +360,23 @@ function config.load(file) end function config.reload(kernel) - local res = 1; + local kernel_loaded = false; -- unload all modules print("Unloading modules..."); loader.perform("unload"); - if kernel ~= nil then - res = loader.perform("load "..kernel); - if res == 0 then + if (kernel ~= nil) then + print("Trying to load '" .. kernel .. "'") + kernel_loaded = config.loadkernel(kernel); + if (kernel_loaded) then print("Kernel '"..kernel.."' loaded!"); end end -- failed to load kernel or it is nil -- then load default - if res == 1 then + if (not kernel_loaded) then print("Loading default kernel..."); config.loadkernel(); end From owner-svn-src-all@freebsd.org Sat Feb 17 05:26:28 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B8B9DF10123; Sat, 17 Feb 2018 05:26:28 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 68B69878F8; Sat, 17 Feb 2018 05:26:28 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 631541859C; Sat, 17 Feb 2018 05:26:28 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1H5QSnn082886; Sat, 17 Feb 2018 05:26:28 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1H5QSit082885; Sat, 17 Feb 2018 05:26:28 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201802170526.w1H5QSit082885@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sat, 17 Feb 2018 05:26:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329433 - head/stand/lua X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/stand/lua X-SVN-Commit-Revision: 329433 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Feb 2018 05:26:29 -0000 Author: kevans Date: Sat Feb 17 05:26:28 2018 New Revision: 329433 URL: https://svnweb.freebsd.org/changeset/base/329433 Log: stand/lua: Add optional GELI passphrase prompt Prompt for GELI passphrase when geom_eli_passphrase_prompt has been set to "YES" in loader.conf(5). This entailed breaking out the password prompt into its own function that can be reused between the password compare bits and this prompt that simply takes the entered password and passes it along in the environment as kern.geom.eli.passphrase. I've also added a TODO to re-evaluate later if we want the "password masking" -- it is currently not functional, so one still can't observe the length of the password typed at the prompt. Modified: head/stand/lua/password.lua Modified: head/stand/lua/password.lua ============================================================================== --- head/stand/lua/password.lua Sat Feb 17 05:02:38 2018 (r329432) +++ head/stand/lua/password.lua Sat Feb 17 05:26:28 2018 (r329433) @@ -40,7 +40,8 @@ function password.read() if ch == core.KEY_ENTER then break; end - + -- XXX TODO: Evaluate if we really want this or not, as a + -- security consideration of sorts if (ch == core.KEY_BACKSPACE) or (ch == core.KEY_DELETE) then if n > 0 then n = n - 1; @@ -58,22 +59,35 @@ end function password.check() screen.defcursor(); - local function compare(prompt, pwd) - if (pwd == nil) then - return; - end + -- pwd is optionally supplied if we want to check it + local function do_prompt(prompt, pwd) while true do loader.printc(prompt); - if (pwd == password.read()) then - break; + local read_pwd = password.read(); + if (not pwd) or (pwd == read_pwd) then + return read_pwd; end print("\n\nloader: incorrect password!\n"); loader.delay(3*1000*1000); end + -- Throw an extra newline out after the password prompt + print("") end + local function compare(prompt, pwd) + if (pwd == nil) then + return; + end + do_prompt(prompt, pwd); + end local boot_pwd = loader.getenv("bootlock_password"); compare("Boot password: ", boot_pwd); + + local geli_pass_prompt = loader.getenv("geom_eli_passphrase_prompt"); + if (geli_pass_prompt:lower() == "yes") then + local passphrase = do_prompt("GELI Passphrase: "); + loader.setenv("kern.geom.eli.passphrase", passphrase) + end local pwd = loader.getenv("password"); if (pwd ~=nil) then From owner-svn-src-all@freebsd.org Sat Feb 17 05:28:07 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5D9DEF10350; Sat, 17 Feb 2018 05:28:07 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1201B87ABB; Sat, 17 Feb 2018 05:28:07 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0D0D2185A0; Sat, 17 Feb 2018 05:28:07 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1H5S6J4082984; Sat, 17 Feb 2018 05:28:06 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1H5S6it082983; Sat, 17 Feb 2018 05:28:06 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201802170528.w1H5S6it082983@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sat, 17 Feb 2018 05:28:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329434 - head/stand/lua X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/stand/lua X-SVN-Commit-Revision: 329434 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Feb 2018 05:28:07 -0000 Author: kevans Date: Sat Feb 17 05:28:06 2018 New Revision: 329434 URL: https://svnweb.freebsd.org/changeset/base/329434 Log: stand/lua: Check for nil (GELI prompt) Modified: head/stand/lua/password.lua Modified: head/stand/lua/password.lua ============================================================================== --- head/stand/lua/password.lua Sat Feb 17 05:26:28 2018 (r329433) +++ head/stand/lua/password.lua Sat Feb 17 05:28:06 2018 (r329434) @@ -83,8 +83,8 @@ function password.check() local boot_pwd = loader.getenv("bootlock_password"); compare("Boot password: ", boot_pwd); - local geli_pass_prompt = loader.getenv("geom_eli_passphrase_prompt"); - if (geli_pass_prompt:lower() == "yes") then + local geli_prompt = loader.getenv("geom_eli_passphrase_prompt"); + if (geli_prompt ~= nil) and (geli_prompt:lower() == "yes") then local passphrase = do_prompt("GELI Passphrase: "); loader.setenv("kern.geom.eli.passphrase", passphrase) end From owner-svn-src-all@freebsd.org Sat Feb 17 05:52:26 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 90E63F11884; Sat, 17 Feb 2018 05:52:26 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 33A6468840; Sat, 17 Feb 2018 05:52:26 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2E7D518A67; Sat, 17 Feb 2018 05:52:26 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1H5qQM1097614; Sat, 17 Feb 2018 05:52:26 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1H5qPX4097607; Sat, 17 Feb 2018 05:52:25 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201802170552.w1H5qPX4097607@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sat, 17 Feb 2018 05:52:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329435 - head/stand/lua X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/stand/lua X-SVN-Commit-Revision: 329435 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Feb 2018 05:52:26 -0000 Author: kevans Date: Sat Feb 17 05:52:25 2018 New Revision: 329435 URL: https://svnweb.freebsd.org/changeset/base/329435 Log: stand/lua: Style pass These are the style points that I'd like to try and maintain in our lua scripts: - Parentheses around conditionals - Trailing semicolons, except on block terminators - s:method(...) instead of string.method(s, ...) where applicable There's likely more, but that'll get hammered out as we continue. Modified: head/stand/lua/color.lua head/stand/lua/config.lua head/stand/lua/core.lua head/stand/lua/drawer.lua head/stand/lua/menu.lua head/stand/lua/password.lua head/stand/lua/screen.lua Modified: head/stand/lua/color.lua ============================================================================== --- head/stand/lua/color.lua Sat Feb 17 05:28:06 2018 (r329434) +++ head/stand/lua/color.lua Sat Feb 17 05:52:25 2018 (r329435) @@ -45,36 +45,35 @@ color.DIM = 2; function color.isEnabled() local c = loader.getenv("loader_color"); - if c ~= nil then - if c:lower() == "no" or c == "0" then + if (c ~= nil) then + if (c:lower() == "no") or (c == "0") then return false; end end - return not core.bootserial(); + return (not core.bootserial()); end -color.disabled = not color.isEnabled(); +color.disabled = (not color.isEnabled()); - function color.escapef(c) - if color.disabled then + if (color.disabled) then return c; end return "\027[3"..c.."m"; end function color.escapeb(c) - if color.disabled then + if (color.disabled) then return c; end return "\027[4"..c.."m"; end function color.escape(fg, bg, att) - if color.disabled then + if (color.disabled) then return ""; end - if not att then + if (not att) then att = "" else att = att..";"; @@ -83,17 +82,17 @@ function color.escape(fg, bg, att) end function color.default() - if color.disabled then + if (color.disabled) then return ""; end return "\027[0;37;40m"; end function color.highlight(str) - if color.disabled then + if (color.disabled) then return str; end return "\027[1m"..str.."\027[0m"; end -return color +return color; Modified: head/stand/lua/config.lua ============================================================================== --- head/stand/lua/config.lua Sat Feb 17 05:28:06 2018 (r329434) +++ head/stand/lua/config.lua Sat Feb 17 05:52:25 2018 (r329435) @@ -280,7 +280,7 @@ function config.loadkernel(other_kernel) end return try_load(bootfile); - end; + end -- kernel not set, try load from default module_path if kernel == nil then Modified: head/stand/lua/core.lua ============================================================================== --- head/stand/lua/core.lua Sat Feb 17 05:28:06 2018 (r329434) +++ head/stand/lua/core.lua Sat Feb 17 05:52:25 2018 (r329435) @@ -128,13 +128,13 @@ function core.kernelList() local kernels = {}; local i = 0; - if k ~= nil then + if (k ~= nil) then i = i + 1; kernels[i] = k; end for n in v:gmatch("([^; ]+)[; ]?") do - if n ~= k then + if (n ~= k) then i = i + 1; kernels[i] = n; end @@ -160,23 +160,23 @@ end function core.bootserial() local c = loader.getenv("console"); - if c ~= nil then - if c:find("comconsole") ~= nil then + if (c ~= nil) then + if (c:find("comconsole") ~= nil) then return true; end end local s = loader.getenv("boot_serial"); - if s ~= nil then + if (s ~= nil) then return true; end local m = loader.getenv("boot_multicons"); - if m ~= nil then + if (m ~= nil) then return true; end return false; end -core.setACPI(core.getACPIPresent(false)) -return core +core.setACPI(core.getACPIPresent(false)); +return core; Modified: head/stand/lua/drawer.lua ============================================================================== --- head/stand/lua/drawer.lua Sat Feb 17 05:28:06 2018 (r329434) +++ head/stand/lua/drawer.lua Sat Feb 17 05:52:25 2018 (r329435) @@ -179,7 +179,7 @@ function drawer.drawmenu(m) if (#choices < caridx) then caridx = 1; - end; + end name = e.name(caridx, choices[caridx], choices); else name = e.name(); @@ -247,60 +247,48 @@ function drawer.draw(x, y, logo) end function drawer.drawbrand() - local x = tonumber(loader.getenv("loader_brand_x")); - local y = tonumber(loader.getenv("loader_brand_y")); + local x = tonumber(loader.getenv("loader_brand_x")) or + drawer.brand_position.x; + local y = tonumber(loader.getenv("loader_brand_y")) or + drawer.brand_position.y; - if not x then - x = drawer.brand_position.x; - end - if not y then - y = drawer.brand_position.y; - end - - local logo = load("return " .. tostring(loader.getenv("loader_brand")))(); - if not logo then - logo = drawer.fbsd_logo; - end + local logo = load("return " .. tostring(loader.getenv("loader_brand")))() or + drawer.fbsd_logo; drawer.draw(x, y, logo); end function drawer.drawlogo() - local x = tonumber(loader.getenv("loader_logo_x")); - local y = tonumber(loader.getenv("loader_logo_y")); + local x = tonumber(loader.getenv("loader_logo_x")) or + drawer.logo_position.x; + local y = tonumber(loader.getenv("loader_logo_y")) or + drawer.logo_position.y; - if not x then - x = drawer.logo_position.x; - end - if not y then - y = drawer.logo_position.y; - end - local logo = loader.getenv("loader_logo"); local s = {x = 0, y = 0}; local colored = color.isEnabled(); - if logo == "beastie" then - if colored then + if (logo == "beastie") then + if (colored) then logo = drawer.beastie_color; end - elseif logo == "beastiebw" then + elseif (logo == "beastiebw") then logo = drawer.beastie; - elseif logo == "fbsdbw" then + elseif (logo == "fbsdbw") then logo = drawer.fbsd_logo_v; s = drawer.fbsd_logo_shift; - elseif logo == "orb" then - if colored then + elseif (logo == "orb") then + if (colored) then logo = drawer.orb_color; end s = drawer.orb_shift; - elseif logo == "orbbw" then + elseif (logo == "orbbw") then logo = drawer.orb; s = drawer.orb_shift; - elseif logo == "tribute" then + elseif (logo == "tribute") then logo = drawer.fbsd_logo; - elseif logo == "tributebw" then + elseif (logo == "tributebw") then logo = drawer.fbsd_logo; - elseif logo == "none" then + elseif (logo == "none") then --centre brand and text if no logo drawer.brand_position.x = drawer.brand_position.x + drawer.none_shift.x; drawer.brand_position.y = drawer.brand_position.y + drawer.none_shift.y; @@ -313,8 +301,8 @@ function drawer.drawlogo() drawer.none_shift.y = 0; logo = drawer.none; end - if not logo then - if colored then + if (not logo) then + if (colored) then logo = drawer.orb_color; else logo = drawer.orb; @@ -323,4 +311,4 @@ function drawer.drawlogo() drawer.draw(x + s.x, y + s.y, logo); end -return drawer +return drawer; Modified: head/stand/lua/menu.lua ============================================================================== --- head/stand/lua/menu.lua Sat Feb 17 05:28:06 2018 (r329434) +++ head/stand/lua/menu.lua Sat Feb 17 05:52:25 2018 (r329435) @@ -63,7 +63,7 @@ menu.boot_options = { return "Load System "..color.highlight("D").."efaults"; end, func = function() - core.setDefaults() + core.setDefaults(); end, alias = {"d", "D"} }, @@ -162,7 +162,7 @@ menu.welcome = { return color.highlight("Esc").."ape to loader prompt"; end, func = function() - loader.setenv("autoboot_delay", "NO") + loader.setenv("autoboot_delay", "NO"); end, alias = {core.KEYSTR_ESCAPE} }, @@ -200,14 +200,14 @@ menu.welcome = { carousel_id = "kernel", items = core.kernelList, name = function(idx, choice, all_choices) - if #all_choices == 0 then + if (#all_choices == 0) then return "Kernel: "; end local is_default = (idx == 1); local kernel_name = ""; local name_color; - if is_default then + if (is_default) then name_color = color.escapef(color.GREEN); kernel_name = "default/"; else @@ -273,7 +273,7 @@ function menu.run(m) menu.autoboot(); cont = true; - while cont do + while (cont) do local key = io.getchar(); -- Special key behaviors @@ -295,7 +295,7 @@ function menu.run(m) end -- if we have an alias do the assigned action: - if(sel_entry ~= nil) then + if (sel_entry ~= nil) then if (sel_entry.entry_type == core.MENU_ENTRY) then -- run function sel_entry.func(); @@ -339,11 +339,11 @@ function menu.run(m) end function menu.skip() - if core.bootserial() then + if (core.bootserial() )then return true; end local c = string.lower(loader.getenv("console") or ""); - if (c:match("^efi[ ;]") or c:match("[ ;]efi[ ;]")) ~= nil then + if ((c:match("^efi[ ;]") or c:match("[ ;]efi[ ;]")) ~= nil) then return true; end @@ -353,7 +353,7 @@ function menu.skip() end function menu.autoboot() - if menu.already_autoboot == true then + if (menu.already_autoboot == true) then return; end menu.already_autoboot = true; @@ -378,9 +378,9 @@ function menu.autoboot() print("Autoboot in "..time.." seconds, hit [Enter] to boot" .." or any other key to stop "); screen.defcursor(); - if io.ischar() then + if (io.ischar()) then local ch = io.getchar(); - if ch == core.KEY_ENTER then + if (ch == core.KEY_ENTER) then break; else -- erase autoboot msg @@ -406,4 +406,4 @@ function OnOff(str, b) end end -return menu +return menu; Modified: head/stand/lua/password.lua ============================================================================== --- head/stand/lua/password.lua Sat Feb 17 05:28:06 2018 (r329434) +++ head/stand/lua/password.lua Sat Feb 17 05:52:25 2018 (r329435) @@ -37,23 +37,23 @@ function password.read() repeat ch = io.getchar(); - if ch == core.KEY_ENTER then + if (ch == core.KEY_ENTER) then break; end -- XXX TODO: Evaluate if we really want this or not, as a -- security consideration of sorts if (ch == core.KEY_BACKSPACE) or (ch == core.KEY_DELETE) then - if n > 0 then + if (n > 0) then n = n - 1; -- loader.printc("\008 \008"); - str = string.sub(str, 1, n); + str = str:sub(1, n); end else -- loader.printc("*"); str = str .. string.char(ch); n = n + 1; end - until n == 16 + until (n == 16); return str; end @@ -61,17 +61,17 @@ function password.check() screen.defcursor(); -- pwd is optionally supplied if we want to check it local function do_prompt(prompt, pwd) - while true do + while (true) do loader.printc(prompt); local read_pwd = password.read(); if (not pwd) or (pwd == read_pwd) then + -- Throw an extra newline after password prompt + print(""); return read_pwd; end print("\n\nloader: incorrect password!\n"); loader.delay(3*1000*1000); end - -- Throw an extra newline out after the password prompt - print("") end local function compare(prompt, pwd) if (pwd == nil) then @@ -80,20 +80,20 @@ function password.check() do_prompt(prompt, pwd); end - local boot_pwd = loader.getenv("bootlock_password"); + local boot_pwd = "boot" --loader.getenv("bootlock_password"); compare("Boot password: ", boot_pwd); local geli_prompt = loader.getenv("geom_eli_passphrase_prompt"); if (geli_prompt ~= nil) and (geli_prompt:lower() == "yes") then local passphrase = do_prompt("GELI Passphrase: "); - loader.setenv("kern.geom.eli.passphrase", passphrase) + loader.setenv("kern.geom.eli.passphrase", passphrase); end local pwd = loader.getenv("password"); - if (pwd ~=nil) then + if (pwd ~= nil) then core.autoboot(); end compare("Password: ", pwd); end -return password +return password; Modified: head/stand/lua/screen.lua ============================================================================== --- head/stand/lua/screen.lua Sat Feb 17 05:28:06 2018 (r329434) +++ head/stand/lua/screen.lua Sat Feb 17 05:52:25 2018 (r329435) @@ -33,24 +33,24 @@ local core = require("core"); -- XXX TODO: This should be fixed in the interpreter to not print decimals function intstring(num) - local str = tostring(num) - local decimal = string.find(str, "%.") + local str = tostring(num); + local decimal = str:find("%."); - if decimal then - return string.sub(str, 1, decimal - 1) + if (decimal) then + return str:sub(1, decimal - 1); end - return str + return str; end function screen.clear() - if core.bootserial() then + if (core.bootserial()) then return; end loader.printc("\027[H\027[J"); end function screen.setcursor(x, y) - if core.bootserial() then + if (core.bootserial()) then return; end @@ -58,14 +58,14 @@ function screen.setcursor(x, y) end function screen.setforeground(c) - if color.disabled then + if (color.disabled) then return c; end loader.printc("\027[3"..c.."m"); end function screen.setbackground(c) - if color.disabled then + if (color.disabled) then return c; end loader.printc("\027[4"..c.."m"); @@ -76,10 +76,10 @@ function screen.defcolor() end function screen.defcursor() - if core.bootserial() then + if (core.bootserial()) then return; end loader.printc("\027[25;0H"); end -return screen +return screen; From owner-svn-src-all@freebsd.org Sat Feb 17 05:53:42 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 09218F119A2; Sat, 17 Feb 2018 05:53:41 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9D29668A0D; Sat, 17 Feb 2018 05:53:41 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9830D18A76; Sat, 17 Feb 2018 05:53:41 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1H5rfSw097695; Sat, 17 Feb 2018 05:53:41 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1H5rfdW097694; Sat, 17 Feb 2018 05:53:41 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201802170553.w1H5rfdW097694@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sat, 17 Feb 2018 05:53:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329436 - head/stand/lua X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/stand/lua X-SVN-Commit-Revision: 329436 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Feb 2018 05:53:42 -0000 Author: kevans Date: Sat Feb 17 05:53:41 2018 New Revision: 329436 URL: https://svnweb.freebsd.org/changeset/base/329436 Log: stand/lua: Debugging string snuck in... Modified: head/stand/lua/password.lua Modified: head/stand/lua/password.lua ============================================================================== --- head/stand/lua/password.lua Sat Feb 17 05:52:25 2018 (r329435) +++ head/stand/lua/password.lua Sat Feb 17 05:53:41 2018 (r329436) @@ -80,7 +80,7 @@ function password.check() do_prompt(prompt, pwd); end - local boot_pwd = "boot" --loader.getenv("bootlock_password"); + local boot_pwd = loader.getenv("bootlock_password"); compare("Boot password: ", boot_pwd); local geli_prompt = loader.getenv("geom_eli_passphrase_prompt"); From owner-svn-src-all@freebsd.org Sat Feb 17 05:56:03 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DCA4BF11B9C for ; Sat, 17 Feb 2018 05:56:03 +0000 (UTC) (envelope-from byond.lenox@gmail.com) Received: from mail-lf0-f51.google.com (mail-lf0-f51.google.com [209.85.215.51]) (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 1B06868C36 for ; Sat, 17 Feb 2018 05:56:02 +0000 (UTC) (envelope-from byond.lenox@gmail.com) Received: by mail-lf0-f51.google.com with SMTP id v9so4719471lfa.11 for ; Fri, 16 Feb 2018 21:56:02 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:cc; bh=owguC/Dhmrnpey46JdAXVaW+rvnGpWPHIeKS/h1Kjq8=; b=jXpgYnC/Jg1+PapDhTq7eimRORtVm4xk5btEO89l7WPkLy+QCKaqCpuWQz1y4kPIBI 25KMpcRcj4EoJniNQZwdJpShhZ6I6ANKnHkg6aFyA7UhOx0ROExrsoayYP6dja/3qBrA YDqfKKiVp1BLepX8b46OoaP3Ixu0tLM3XYg+FqFCRFcB//SHtBHax0mbUOm8/0FQi85+ yLgTJC5zOn4tgVQJitxWfrETAC2cfw3o3FDcLNiyRD3+3ndF/Du3ZW3PUvFMBwlp0TP0 VbVUfQOODw9ozLHPNwIkPN/fa7o5TsW5wKWwl9LiF7cBL0fwIwRqs9SBzeFXY9eNZ+uf x7iQ== X-Gm-Message-State: APf1xPBiMAEgpDU1bxY87xuHsg+1CfHVGB2AJW3NRZMgJAf/Re/D9mSc 5CQYB4uFmJ6qm/K1xWIUWfbJuGQh X-Google-Smtp-Source: AH8x2276K4ugv4+UVyxbFFcc9rm9nLU64w+wq15wS0Bx4j29eNv2fnORH3lZOHCxcYfKft8BFNF8rQ== X-Received: by 10.25.150.78 with SMTP id y75mr5848757lfd.81.1518846960950; Fri, 16 Feb 2018 21:56:00 -0800 (PST) Received: from mail-lf0-f50.google.com (mail-lf0-f50.google.com. [209.85.215.50]) by smtp.gmail.com with ESMTPSA id w8sm1546982lje.75.2018.02.16.21.56.00 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 16 Feb 2018 21:56:00 -0800 (PST) Received: by mail-lf0-f50.google.com with SMTP id t204so4074366lff.9 for ; Fri, 16 Feb 2018 21:56:00 -0800 (PST) X-Received: by 10.25.77.212 with SMTP id a203mt6109769lfb.14.1518846960067; Fri, 16 Feb 2018 21:56:00 -0800 (PST) MIME-Version: 1.0 Received: by 10.46.106.8 with HTTP; Fri, 16 Feb 2018 21:55:39 -0800 (PST) In-Reply-To: <201802170553.w1H5rfdW097694@repo.freebsd.org> References: <201802170553.w1H5rfdW097694@repo.freebsd.org> From: Kyle Evans Date: Fri, 16 Feb 2018 23:55:39 -0600 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r329436 - head/stand/lua Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Feb 2018 05:56:04 -0000 On Fri, Feb 16, 2018 at 11:53 PM, Kyle Evans wrote: > Author: kevans > Date: Sat Feb 17 05:53:41 2018 > New Revision: 329436 > URL: https://svnweb.freebsd.org/changeset/base/329436 > > Log: > stand/lua: Debugging string snuck in... > > Modified: > head/stand/lua/password.lua > With this, I think our lualoader menu is fairly stable as-is. Things should calm down while we sketch out the details of boot environment bits. From owner-svn-src-all@freebsd.org Sat Feb 17 06:57:04 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C3AB3F142BB; Sat, 17 Feb 2018 06:57:04 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7242E6A6C3; Sat, 17 Feb 2018 06:57:04 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 53F0C1943A; Sat, 17 Feb 2018 06:57:04 +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 w1H6v45v027387; Sat, 17 Feb 2018 06:57:04 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1H6v4x8027385; Sat, 17 Feb 2018 06:57:04 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201802170657.w1H6v4x8027385@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sat, 17 Feb 2018 06:57:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329437 - in head: sys/sys usr.sbin/kldxref X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head: sys/sys usr.sbin/kldxref X-SVN-Commit-Revision: 329437 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Feb 2018 06:57:04 -0000 Author: imp Date: Sat Feb 17 06:57:03 2018 New Revision: 329437 URL: https://svnweb.freebsd.org/changeset/base/329437 Log: Fixup minor nits in the PNP_INFO protocol. Sponsored by: Netflix Modified: head/sys/sys/module.h head/usr.sbin/kldxref/kldxref.c Modified: head/sys/sys/module.h ============================================================================== --- head/sys/sys/module.h Sat Feb 17 05:53:41 2018 (r329436) +++ head/sys/sys/module.h Sat Feb 17 06:57:03 2018 (r329437) @@ -201,7 +201,7 @@ struct mod_pnp_match_info * D pointer to a string to human readable description for device * P A pointer that should be ignored * E EISA PNP Identifier (in binary, but bus publishes string) - * K Key for whole table. pnp_name=value. must be last, if present. + * T Key for whole table. pnp_name=value. must be last, if present. * * The pnp_name "#" is reserved for other fields that should be ignored. * Otherwise pnp_name must match the name from the parent device's pnpinfo Modified: head/usr.sbin/kldxref/kldxref.c ============================================================================== --- head/usr.sbin/kldxref/kldxref.c Sat Feb 17 05:53:41 2018 (r329436) +++ head/usr.sbin/kldxref/kldxref.c Sat Feb 17 06:57:03 2018 (r329437) @@ -213,12 +213,12 @@ typedef TAILQ_HEAD(pnp_head, pnp_elt) pnp_list; * type Output Meaning * I uint32_t Integer equality comparison * J uint32_t Pair of uint16_t fields converted to native - byte order. The two fields both must match. + * byte order. The two fields both must match. * G uint32_t Greater than or equal to * L uint32_t Less than or equal to * M uint32_t Mask of which fields to test. Fields that - take up space increment the count. This - field must be first, and resets the count. + * take up space increment the count. This + * field must be first, and resets the count. * D string Description of the device this pnp info is for * Z string pnp string must match this * T nothing T fields set pnp values that must be true for From owner-svn-src-all@freebsd.org Sat Feb 17 06:57:10 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E1D6AF142E1; Sat, 17 Feb 2018 06:57:09 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 74F796A720; Sat, 17 Feb 2018 06:57: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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9E8DF1943B; Sat, 17 Feb 2018 06:57:08 +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 w1H6v8RF027440; Sat, 17 Feb 2018 06:57:08 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1H6v8NL027439; Sat, 17 Feb 2018 06:57:08 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201802170657.w1H6v8NL027439@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sat, 17 Feb 2018 06:57:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329438 - head/share/man/man9 X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/share/man/man9 X-SVN-Commit-Revision: 329438 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Feb 2018 06:57:10 -0000 Author: imp Date: Sat Feb 17 06:57:08 2018 New Revision: 329438 URL: https://svnweb.freebsd.org/changeset/base/329438 Log: Add description for T specifier. It's for PNP keys that are checked programatically that must be true for a device to match, but aren't in the table as discrete fields. Sponsored by: Netflix Modified: head/share/man/man9/MODULE_PNP_INFO.9 Modified: head/share/man/man9/MODULE_PNP_INFO.9 ============================================================================== --- head/share/man/man9/MODULE_PNP_INFO.9 Sat Feb 17 06:57:03 2018 (r329437) +++ head/share/man/man9/MODULE_PNP_INFO.9 Sat Feb 17 06:57:08 2018 (r329438) @@ -109,6 +109,11 @@ A pointer to a human readable description for the devi A pointer that should be ignored. .It Dq Vt E EISA PNP Identifier. +.It Dq Vt T +PNP info that's true for the for the whole table. +The driver code checks for these condition pragmatically before using +this table to match devices. +This item must come last in the list. .El .Pp The pseudo-name From owner-svn-src-all@freebsd.org Sat Feb 17 06:57:13 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7AFB5F1430E; Sat, 17 Feb 2018 06:57:13 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2D8D16A7C0; Sat, 17 Feb 2018 06:57: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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1CB961943C; Sat, 17 Feb 2018 06:57: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 w1H6vCTr027493; Sat, 17 Feb 2018 06:57:12 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1H6vCVP027492; Sat, 17 Feb 2018 06:57:12 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201802170657.w1H6vCVP027492@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sat, 17 Feb 2018 06:57:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329439 - head/sbin/devmatch X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sbin/devmatch X-SVN-Commit-Revision: 329439 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Feb 2018 06:57:13 -0000 Author: imp Date: Sat Feb 17 06:57:12 2018 New Revision: 329439 URL: https://svnweb.freebsd.org/changeset/base/329439 Log: Warn when we encounter unknown PNP field specifiers. The 'T' field went unimplemented for months due to a lack of warning. Add a warnings to detect mistakes sooner. Sponsored by: Netflix Modified: head/sbin/devmatch/devmatch.c Modified: head/sbin/devmatch/devmatch.c ============================================================================== --- head/sbin/devmatch/devmatch.c Sat Feb 17 06:57:08 2018 (r329438) +++ head/sbin/devmatch/devmatch.c Sat Feb 17 06:57:12 2018 (r329439) @@ -314,6 +314,7 @@ search_hints(const char *bus, const char *dev, const c notme++; break; default: + fprintf(stderr, "Unknown field type %c\n:", *cp); break; } bit++; From owner-svn-src-all@freebsd.org Sat Feb 17 06:57:18 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 96313F1433A; Sat, 17 Feb 2018 06:57:18 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B85BA6A88C; Sat, 17 Feb 2018 06:57:17 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9ADCA1943D; Sat, 17 Feb 2018 06:57:17 +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 w1H6vHFB027546; Sat, 17 Feb 2018 06:57:17 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1H6vHV3027544; Sat, 17 Feb 2018 06:57:17 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201802170657.w1H6vHV3027544@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sat, 17 Feb 2018 06:57:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329440 - head/sys/dev/usb X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/dev/usb X-SVN-Commit-Revision: 329440 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Feb 2018 06:57:18 -0000 Author: imp Date: Sat Feb 17 06:57:17 2018 New Revision: 329440 URL: https://svnweb.freebsd.org/changeset/base/329440 Log: Correct the PNP information generated by the usb driver to match the artificial NOMATCH usb does in lieu of creating a device_t for devices with no drivers. Also, correct bus to be 'uhub' since where USB devices attach, even though 'usb' is more logical, we need the physical bus here. Submitted by: hps@ Modified: head/sys/dev/usb/usb_hub.c head/sys/dev/usb/usbdi.h Modified: head/sys/dev/usb/usb_hub.c ============================================================================== --- head/sys/dev/usb/usb_hub.c Sat Feb 17 06:57:12 2018 (r329439) +++ head/sys/dev/usb/usb_hub.c Sat Feb 17 06:57:17 2018 (r329440) @@ -1733,7 +1733,12 @@ uhub_child_pnpinfo_string(device_t parent, device_t ch } iface = usbd_get_iface(res.udev, res.iface_index); if (iface && iface->idesc) { - snprintf(buf, buflen, "vendor=0x%04x product=0x%04x " + snprintf(buf, buflen, + "bus=usb " +#if USB_HAVE_UGEN + "device=%s " +#endif + "vendor=0x%04x product=0x%04x " "devclass=0x%02x devsubclass=0x%02x " "devproto=0x%02x " "sernum=\"%s\" " @@ -1741,6 +1746,9 @@ uhub_child_pnpinfo_string(device_t parent, device_t ch "mode=%s " "intclass=0x%02x intsubclass=0x%02x " "intprotocol=0x%02x" "%s%s", +#if USB_HAVE_UGEN + res.udev->ugen_name, +#endif UGETW(res.udev->ddesc.idVendor), UGETW(res.udev->ddesc.idProduct), res.udev->ddesc.bDeviceClass, Modified: head/sys/dev/usb/usbdi.h ============================================================================== --- head/sys/dev/usb/usbdi.h Sat Feb 17 06:57:12 2018 (r329439) +++ head/sys/dev/usb/usbdi.h Sat Feb 17 06:57:17 2018 (r329440) @@ -337,18 +337,18 @@ struct usb_device_id { } __aligned(32); #define USB_STD_PNP_INFO "M16:mask;U16:vendor;U16:product;L16:release;G16:release;" \ - "U8:devclass;U8:devsubclass;U8:devprotocol;" \ + "U8:devclass;U8:devsubclass;U8:devproto;" \ "U8:intclass;U8:intsubclass;U8:intprotocol;" #define USB_STD_PNP_HOST_INFO USB_STD_PNP_INFO "T:mode=host;" #define USB_STD_PNP_DEVICE_INFO USB_STD_PNP_INFO "T:mode=device;" #define USB_PNP_HOST_INFO(table) \ - MODULE_PNP_INFO(USB_STD_PNP_HOST_INFO, usb, table, table, sizeof(table[0]), \ + MODULE_PNP_INFO(USB_STD_PNP_HOST_INFO, uhub, table, table, sizeof(table[0]), \ sizeof(table) / sizeof(table[0])) #define USB_PNP_DEVICE_INFO(table) \ - MODULE_PNP_INFO(USB_STD_PNP_DEVICE_INFO, usb, table, table, sizeof(table[0]), \ + MODULE_PNP_INFO(USB_STD_PNP_DEVICE_INFO, uhub, table, table, sizeof(table[0]), \ sizeof(table) / sizeof(table[0])) #define USB_PNP_DUAL_INFO(table) \ - MODULE_PNP_INFO(USB_STD_PNP_INFO, usb, table, table, sizeof(table[0]), \ + MODULE_PNP_INFO(USB_STD_PNP_INFO, uhub, table, table, sizeof(table[0]), \ sizeof(table) / sizeof(table[0])) /* check that the size of the structure above is correct */ From owner-svn-src-all@freebsd.org Sat Feb 17 06:57:24 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 345D2F1435F; Sat, 17 Feb 2018 06:57:24 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 091996A980; Sat, 17 Feb 2018 06:57:21 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D198F1943E; Sat, 17 Feb 2018 06:57:21 +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 w1H6vLQE027602; Sat, 17 Feb 2018 06:57:21 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1H6vLsG027601; Sat, 17 Feb 2018 06:57:21 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201802170657.w1H6vLsG027601@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sat, 17 Feb 2018 06:57:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329441 - head/etc/rc.d X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/etc/rc.d X-SVN-Commit-Revision: 329441 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Feb 2018 06:57:24 -0000 Author: imp Date: Sat Feb 17 06:57:21 2018 New Revision: 329441 URL: https://svnweb.freebsd.org/changeset/base/329441 Log: If we're passed an argument, then treat it as a single NOMATCH event to parse rather than searching for all events. Pass with new -p arg to devmatch. devmatch will use that one event rather than walking the entire tree. kldload will stop at the first failure. So we need to loop. Also, symbolic links may confused kldload into trying (and failing) to load multiple modules at once, so guard against that. Noticed by: hps (with similar patch) Sponsored by: Netflix Modified: head/etc/rc.d/devmatch Modified: head/etc/rc.d/devmatch ============================================================================== --- head/etc/rc.d/devmatch Sat Feb 17 06:57:17 2018 (r329440) +++ head/etc/rc.d/devmatch Sat Feb 17 06:57:21 2018 (r329441) @@ -37,17 +37,26 @@ desc="Use devmatch(8) to load kernel modules" start_cmd="${name}_start" stop_cmd=':' +[ -n "$2" ] && one_nomatch="-p '$2'" devmatch_start() { local x - x=$(devmatch | sort -u) + x=$(devmatch ${one_nomatch} | sort -u) [ -n "$x" ] || return + # While kldload can accept multiple modules + # on the line at once, we loop here in case + # there's some weird error with one of them. + # We also optimize against the false positives + # or drivers that have symbolic links that + # confuse devmatch by running it -n. echo "Autoloading modules: ${x}" - kldload ${x} + for m in ${x}; do + kldload -n ${m} + done } load_rc_config $name From owner-svn-src-all@freebsd.org Sat Feb 17 06:57:31 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 89663F1438B; Sat, 17 Feb 2018 06:57:31 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2F3C16AA15; Sat, 17 Feb 2018 06:57:26 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2BD0C1943F; Sat, 17 Feb 2018 06:57:26 +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 w1H6vQ4S027653; Sat, 17 Feb 2018 06:57:26 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1H6vQk0027652; Sat, 17 Feb 2018 06:57:26 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201802170657.w1H6vQk0027652@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sat, 17 Feb 2018 06:57:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329442 - head/sbin/devmatch X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sbin/devmatch X-SVN-Commit-Revision: 329442 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Feb 2018 06:57:31 -0000 Author: imp Date: Sat Feb 17 06:57:25 2018 New Revision: 329442 URL: https://svnweb.freebsd.org/changeset/base/329442 Log: Implement 'T' field matching. Implement 'T' field matching. This is needed to prevent false positives. However, it's not general enough. It only handles one field and there's a ton of edge cases even with that it likely wouldn't handle. To do it more generally and also eliminate a lot of the hackiness that's in this program now, we'd need to creating directories for lookups ala awk, pearl, python, etc. It appears to be sufficient, though, to get my keyboard loaded on boot. Sponsored by: Netflix Modified: head/sbin/devmatch/devmatch.c Modified: head/sbin/devmatch/devmatch.c ============================================================================== --- head/sbin/devmatch/devmatch.c Sat Feb 17 06:57:21 2018 (r329441) +++ head/sbin/devmatch/devmatch.c Sat Feb 17 06:57:25 2018 (r329442) @@ -265,6 +265,7 @@ search_hints(const char *bus, const char *dev, const c bit = -1; do { switch (*cp) { + /* All integer fields */ case 'I': case 'J': case 'G': @@ -300,6 +301,7 @@ search_hints(const char *bus, const char *dev, const c break; } break; + /* String fields */ case 'D': case 'Z': getstr(&ptr, val1); @@ -311,6 +313,22 @@ search_hints(const char *bus, const char *dev, const c break; s = pnpval_as_str(cp + 2, pnpinfo); if (strcmp(s, val1) != 0) + notme++; + break; + /* Key override fields, required to be last in the string */ + case 'T': + /* + * This is imperfect and only does one key and will be redone + * to be more general for multiple keys. Currently, nothing + * does that. + */ + if (dump_flag) /* No per-row data stored */ + break; + if (cp[strlen(cp) - 1] == ';') /* Skip required ; at end */ + cp[strlen(cp) - 1] = '\0'; /* in case it's not there */ + if ((s = strstr(pnpinfo, cp + 2)) == NULL) + notme++; + else if (s > pnpinfo && s[-1] != ' ') notme++; break; default: From owner-svn-src-all@freebsd.org Sat Feb 17 06:57:32 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5F7C6F14395; Sat, 17 Feb 2018 06:57:32 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 69BF06AA83; Sat, 17 Feb 2018 06:57:30 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 64C0B19440; Sat, 17 Feb 2018 06:57:30 +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 w1H6vU63027707; Sat, 17 Feb 2018 06:57:30 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1H6vUnD027706; Sat, 17 Feb 2018 06:57:30 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201802170657.w1H6vUnD027706@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sat, 17 Feb 2018 06:57:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329443 - head/sbin/devmatch X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sbin/devmatch X-SVN-Commit-Revision: 329443 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Feb 2018 06:57:32 -0000 Author: imp Date: Sat Feb 17 06:57:30 2018 New Revision: 329443 URL: https://svnweb.freebsd.org/changeset/base/329443 Log: Tweak the 'I' flagged value 'I' was omitting 'zero' values. This is not quite correct, and was put in as a hack but not documented. Remove it. If we find what the hack was really needed for, we'll either fix the need for it, or invent a new flagged value type. Submitted by: hps@ Sponsored by: Netflix Modified: head/sbin/devmatch/devmatch.c Modified: head/sbin/devmatch/devmatch.c ============================================================================== --- head/sbin/devmatch/devmatch.c Sat Feb 17 06:57:25 2018 (r329442) +++ head/sbin/devmatch/devmatch.c Sat Feb 17 06:57:30 2018 (r329443) @@ -285,7 +285,7 @@ search_hints(const char *bus, const char *dev, const c break; /*FALLTHROUGH*/ case 'I': - if (v != ival && ival != 0) + if (v != ival) notme++; break; case 'G': From owner-svn-src-all@freebsd.org Sat Feb 17 06:57:37 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2CF5BF143E0; Sat, 17 Feb 2018 06:57:37 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4D31F6AB55; Sat, 17 Feb 2018 06:57: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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DF0BC19441; Sat, 17 Feb 2018 06:57:34 +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 w1H6vYFH027759; Sat, 17 Feb 2018 06:57:34 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1H6vYdk027757; Sat, 17 Feb 2018 06:57:34 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201802170657.w1H6vYdk027757@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sat, 17 Feb 2018 06:57:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329444 - head/sbin/devmatch X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sbin/devmatch X-SVN-Commit-Revision: 329444 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Feb 2018 06:57:37 -0000 Author: imp Date: Sat Feb 17 06:57:34 2018 New Revision: 329444 URL: https://svnweb.freebsd.org/changeset/base/329444 Log: Add option to parse NOMATCH event and suggest modules to load Add --nomatch/-p to search for individual drivers based on a NOMATCH event from devd. Submitted by: hps (earlier version) Sponsored by: Netflix Modified: head/sbin/devmatch/devmatch.8 head/sbin/devmatch/devmatch.c Modified: head/sbin/devmatch/devmatch.8 ============================================================================== --- head/sbin/devmatch/devmatch.8 Sat Feb 17 06:57:30 2018 (r329443) +++ head/sbin/devmatch/devmatch.8 Sat Feb 17 06:57:34 2018 (r329444) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 12, 2018 +.Dd February 16, 2018 .Dt DEVMATCH 8 .Os .Sh NAME @@ -33,9 +33,10 @@ .Nd print information about unattached devices .Sh SYNOPSIS .Nm -.Op Fl aduv +.Op Fl adpuv .Op Fl -all .Op Fl -dump +.Op Fl -nomatch .Op Fl -unbound .Op Fl -verbose .Sh DESCRIPTION @@ -50,6 +51,10 @@ Include all devices, not just the ones that are unatta Produce a human readable dump of the .Pa linker.hints file. +.It Fl p Fl -nomatch +Parse and use a standard NOMATCH event from +.Xr devd 8 +for matching instead of searching the device tree. .It Fl u Fl -unbound Attempt to produce a list of those drivers with PNP info whose driver tables with that PNP info can't be found. Modified: head/sbin/devmatch/devmatch.c ============================================================================== --- head/sbin/devmatch/devmatch.c Sat Feb 17 06:57:30 2018 (r329443) +++ head/sbin/devmatch/devmatch.c Sat Feb 17 06:57:34 2018 (r329444) @@ -47,6 +47,7 @@ __FBSDID("$FreeBSD$"); static struct option longopts[] = { { "all", no_argument, NULL, 'a' }, { "dump", no_argument, NULL, 'd' }, + { "nomatch", required_argument, NULL, 'p' }, { "unbound", no_argument, NULL, 'u' }, { "verbose", no_argument, NULL, 'v' }, { NULL, 0, NULL, 0 } @@ -54,6 +55,7 @@ static struct option longopts[] = { static int all_flag; static int dump_flag; +static char *nomatch_str; static int unbound_flag; static int verbose_flag; @@ -398,6 +400,46 @@ find_unmatched(struct devinfo_dev *dev, void *arg) } static void +find_nomatch(char *nomatch) +{ + char *bus, *pnpinfo, *tmp; + + /* + * Find our bus name. It will include the unit number. We have to search + * backwards to avoid false positive for any PNP string that has ' on ' + * in them, which would come earlier in the string. Like if there were + * an 'Old Bard' ethernet card made by 'Stratford on Avon Hardware' or + * something silly like that. + */ + tmp = nomatch + strlen(nomatch) - 4; + while (tmp > nomatch && strncmp(tmp, " on ", 4) != 0) + tmp--; + if (tmp == nomatch) + errx(1, "No bus found in nomatch string: '%s'", nomatch); + bus = tmp + 4; + *tmp = '\0'; + tmp = bus + strlen(bus) - 1; + while (tmp > bus && isdigit(*tmp)) + tmp--; + *++tmp = '\0'; + + /* + * Note: the NOMATCH events place both the bus location as well as the + * pnp info after the 'at' and we don't know where one stops and the + * other begins, so we pass the whole thing to our search routine. + */ + if (*nomatch == '?') + nomatch++; + if (strncmp(nomatch, " at ", 4) != 0) + errx(1, "Malformed NOMATCH string: '%s'", nomatch); + pnpinfo = nomatch + 4; + + search_hints(bus, "", pnpinfo); + + exit(0); +} + +static void usage(void) { @@ -410,7 +452,7 @@ main(int argc, char **argv) struct devinfo_dev *root; int ch; - while ((ch = getopt_long(argc, argv, "aduv", + while ((ch = getopt_long(argc, argv, "adp:uv", longopts, NULL)) != -1) { switch (ch) { case 'a': @@ -419,6 +461,9 @@ main(int argc, char **argv) case 'd': dump_flag++; break; + case 'p': + nomatch_str = optarg; + break; case 'u': unbound_flag++; break; @@ -441,6 +486,8 @@ main(int argc, char **argv) exit(0); } + if (nomatch_str != NULL) + find_nomatch(nomatch_str); if (devinfo_init()) err(1, "devinfo_init"); if ((root = devinfo_handle_to_device(DEVINFO_ROOT_DEVICE)) == NULL) From owner-svn-src-all@freebsd.org Sat Feb 17 06:57:41 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D8298F14426; Sat, 17 Feb 2018 06:57:41 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 01D8A6AC10; Sat, 17 Feb 2018 06:57:39 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3958119442; Sat, 17 Feb 2018 06:57:39 +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 w1H6vdKi027813; Sat, 17 Feb 2018 06:57:39 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1H6vcnX027812; Sat, 17 Feb 2018 06:57:38 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201802170657.w1H6vcnX027812@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sat, 17 Feb 2018 06:57:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329445 - head/etc/devd X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/etc/devd X-SVN-Commit-Revision: 329445 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Feb 2018 06:57:42 -0000 Author: imp Date: Sat Feb 17 06:57:38 2018 New Revision: 329445 URL: https://svnweb.freebsd.org/changeset/base/329445 Log: Pass in the NOMATCH event to devmatch In devd/devmatch.conf, we need to pass the event to the devmatch serivce. It gets passed to devmatch -p for matching. We always pass this, unlike hps' original patch, so we kill two birds with one stone and only match modules to the event passed in. Submitted by: hps@ Sponsored by: Netflix Modified: head/etc/devd/devmatch.conf Modified: head/etc/devd/devmatch.conf ============================================================================== --- head/etc/devd/devmatch.conf Sat Feb 17 06:57:34 2018 (r329444) +++ head/etc/devd/devmatch.conf Sat Feb 17 06:57:38 2018 (r329445) @@ -9,7 +9,7 @@ # # Generic NOMATCH event nomatch 100 { - action "service devmatch start"; + action "service devmatch start '?$_'"; }; # Add the following to devd.conf to prevent this from running: From owner-svn-src-all@freebsd.org Sat Feb 17 06:57:46 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 21967F1445D; Sat, 17 Feb 2018 06:57:46 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8A6216ACDB; Sat, 17 Feb 2018 06:57:43 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 94F5B19444; Sat, 17 Feb 2018 06:57:43 +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 w1H6vhND027866; Sat, 17 Feb 2018 06:57:43 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1H6vhaL027864; Sat, 17 Feb 2018 06:57:43 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201802170657.w1H6vhaL027864@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sat, 17 Feb 2018 06:57:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329446 - head/sbin/devmatch X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sbin/devmatch X-SVN-Commit-Revision: 329446 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Feb 2018 06:57:46 -0000 Author: imp Date: Sat Feb 17 06:57:43 2018 New Revision: 329446 URL: https://svnweb.freebsd.org/changeset/base/329446 Log: Implement --hints to read hints file directly In testing, it's often useful to copy a few files into a directory and kldxref them to ensure that particular cases are handled correctly. Add --hints (-h) to facilitate this testing and enable future automated testing. Sponsored by: Netflix Modified: head/sbin/devmatch/devmatch.8 head/sbin/devmatch/devmatch.c Modified: head/sbin/devmatch/devmatch.8 ============================================================================== --- head/sbin/devmatch/devmatch.8 Sat Feb 17 06:57:38 2018 (r329445) +++ head/sbin/devmatch/devmatch.8 Sat Feb 17 06:57:43 2018 (r329446) @@ -33,10 +33,11 @@ .Nd print information about unattached devices .Sh SYNOPSIS .Nm -.Op Fl adpuv +.Op Fl adhpuv .Op Fl -all .Op Fl -dump -.Op Fl -nomatch +.Op Fl -hints Ar file +.Op Fl -nomatch Ar event .Op Fl -unbound .Op Fl -verbose .Sh DESCRIPTION @@ -51,7 +52,13 @@ Include all devices, not just the ones that are unatta Produce a human readable dump of the .Pa linker.hints file. -.It Fl p Fl -nomatch +.It Fl h Fl -hints Ar file +Use the named +.Ar file +instead of +.Pa linker.hints +guessed from the current module load path. +.It Fl p Fl -nomatch Ar event Parse and use a standard NOMATCH event from .Xr devd 8 for matching instead of searching the device tree. Modified: head/sbin/devmatch/devmatch.c ============================================================================== --- head/sbin/devmatch/devmatch.c Sat Feb 17 06:57:38 2018 (r329445) +++ head/sbin/devmatch/devmatch.c Sat Feb 17 06:57:43 2018 (r329446) @@ -47,6 +47,7 @@ __FBSDID("$FreeBSD$"); static struct option longopts[] = { { "all", no_argument, NULL, 'a' }, { "dump", no_argument, NULL, 'd' }, + { "hints", required_argument, NULL, 'h' }, { "nomatch", required_argument, NULL, 'p' }, { "unbound", no_argument, NULL, 'u' }, { "verbose", no_argument, NULL, 'v' }, @@ -55,6 +56,7 @@ static struct option longopts[] = { static int all_flag; static int dump_flag; +static char *linker_hints; static char *nomatch_str; static int unbound_flag; static int verbose_flag; @@ -62,47 +64,66 @@ static int verbose_flag; static void *hints; static void *hints_end; +static void * +read_hints(const char *fn, size_t *len) +{ + void *h; + int fd; + struct stat sb; + + fd = open(fn, O_RDONLY); + if (fd < 0) { + if (errno == ENOENT) + return NULL; + err(1, "Can't open %s for reading", fn); + } + if (fstat(fd, &sb) != 0) + err(1, "Can't fstat %s\n", fn); + h = malloc(sb.st_size); + if (h == NULL) + err(1, "not enough space to read hints file of %ju bytes", (uintmax_t)sb.st_size); + if (read(fd, h, sb.st_size) != sb.st_size) + err(1, "Can't read in %ju bytes from %s", (uintmax_t)sb.st_size, fn); + close(fd); + *len = sb.st_size; + return h; +} + static void read_linker_hints(void) { char fn[MAXPATHLEN]; - struct stat sb; char *modpath, *p, *q; - size_t buflen; - int fd; + size_t buflen, len; - if (sysctlbyname("kern.module_path", NULL, &buflen, NULL, 0) < 0) - errx(1, "Can't find kernel module path."); - modpath = malloc(buflen); - if (modpath == NULL) - err(1, "Can't get memory for modpath."); - if (sysctlbyname("kern.module_path", modpath, &buflen, NULL, 0) < 0) - errx(1, "Can't find kernel module path."); - p = modpath; - while ((q = strsep(&p, ";")) != NULL) { - snprintf(fn, sizeof(fn), "%s/linker.hints", q); - fd = open(fn, O_RDONLY); - if (fd < 0) { - if (errno == ENOENT) + if (linker_hints == NULL) { + if (sysctlbyname("kern.module_path", NULL, &buflen, NULL, 0) < 0) + errx(1, "Can't find kernel module path."); + modpath = malloc(buflen); + if (modpath == NULL) + err(1, "Can't get memory for modpath."); + if (sysctlbyname("kern.module_path", modpath, &buflen, NULL, 0) < 0) + errx(1, "Can't find kernel module path."); + p = modpath; + while ((q = strsep(&p, ";")) != NULL) { + snprintf(fn, sizeof(fn), "%s/linker.hints", q); + hints = read_hints(fn, &len); + if (hints == NULL) continue; - err(1, "Can't open %s for reading", fn); + break; } - if (fstat(fd, &sb) != 0) - err(1, "Can't fstat %s\n", fn); - hints = malloc(sb.st_size); + if (q == NULL) { + warnx("Can't read linker hints file."); + free(hints); + hints = NULL; + return; + } + } else { + hints = read_hints(linker_hints, &len); if (hints == NULL) - err(1, "not enough space to read hints file of %ju bytes", (uintmax_t)sb.st_size); - if (read(fd, hints, sb.st_size) != sb.st_size) - err(1, "Can't read in %ju bytes from %s", (uintmax_t)sb.st_size, fn); - close(fd); - break; + err(1, "Can't open %s for reading", fn); } - if (q == NULL) { - warnx("Can't read linker hints file."); - free(hints); - hints = NULL; - return; - } + if (*(int *)(intptr_t)hints != LINKER_HINTS_VERSION) { warnx("Linker hints version %d doesn't match expected %d.", *(int *)(intptr_t)hints, LINKER_HINTS_VERSION); @@ -110,7 +131,7 @@ read_linker_hints(void) hints = NULL; } if (hints != NULL) - hints_end = (void *)((intptr_t)hints + (intptr_t)sb.st_size); + hints_end = (void *)((intptr_t)hints + (intptr_t)len); } static int @@ -443,7 +464,7 @@ static void usage(void) { - errx(1, "devmatch [-adv]"); + errx(1, "devmatch [-adv] [-p nomatch] [-h linker-hints]"); } int @@ -452,7 +473,7 @@ main(int argc, char **argv) struct devinfo_dev *root; int ch; - while ((ch = getopt_long(argc, argv, "adp:uv", + while ((ch = getopt_long(argc, argv, "adh:p:uv", longopts, NULL)) != -1) { switch (ch) { case 'a': @@ -460,6 +481,9 @@ main(int argc, char **argv) break; case 'd': dump_flag++; + break; + case 'h': + linker_hints = optarg; break; case 'p': nomatch_str = optarg; From owner-svn-src-all@freebsd.org Sat Feb 17 07:30:46 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 913EEF168B7; Sat, 17 Feb 2018 07:30:46 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (turbocat.net [IPv6:2a01:4f8:c17:6c4b::2]) (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 2B4F16C2B3; Sat, 17 Feb 2018 07:30:45 +0000 (UTC) (envelope-from hps@selasky.org) Received: from hps2016.home.selasky.org (unknown [62.141.128.70]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id F0FD6260329; Sat, 17 Feb 2018 08:30:40 +0100 (CET) Subject: Re: svn commit: r329371 - head/sys/compat/linuxkpi/common/include/asm To: Jan Beich Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201802161520.w1GFKLiA049085@repo.freebsd.org> From: Hans Petter Selasky Message-ID: <4b408add-0b85-d57d-292e-9de76d8c15e5@selasky.org> Date: Sat, 17 Feb 2018 08:27:43 +0100 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Feb 2018 07:30:46 -0000 On 02/17/18 01:42, Jan Beich wrote: > To generate errors instead ? Which compiler are you using? This was tested with clang over here. --HPS From owner-svn-src-all@freebsd.org Sat Feb 17 07:35:31 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CBB58F16E2D; Sat, 17 Feb 2018 07:35:31 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (turbocat.net [IPv6:2a01:4f8:c17:6c4b::2]) (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 5E1FE6C746; Sat, 17 Feb 2018 07:35:31 +0000 (UTC) (envelope-from hps@selasky.org) Received: from hps2016.home.selasky.org (unknown [62.141.128.70]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 33C77260329; Sat, 17 Feb 2018 08:35:30 +0100 (CET) Subject: Re: svn commit: r329371 - head/sys/compat/linuxkpi/common/include/asm To: Jan Beich Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201802161520.w1GFKLiA049085@repo.freebsd.org> From: Hans Petter Selasky Message-ID: <6f790c90-8c65-ab0b-4a58-2814be55f09f@selasky.org> Date: Sat, 17 Feb 2018 08:32:34 +0100 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Feb 2018 07:35:32 -0000 On 02/17/18 01:42, Jan Beich wrote: > Hans Petter Selasky writes: > >> Author: hselasky >> Date: Fri Feb 16 15:20:21 2018 >> New Revision: 329371 >> URL: https://svnweb.freebsd.org/changeset/base/329371 >> >> Log: >> Allow the cmpxchg() macro in the LinuxKPI to work on pointers without >> generating compiler warnings, -Wint-conversion . > [...] > > To generate errors instead ? > > $ make clean all -C /usr/ports/graphics/drm-next-kmod > [...] > drm_lock.c:72:10: error: flexible array member 'u8' in a union is not allowed > prev = cmpxchg(lock, old, new); > ^ I believe this is a regression issue in GCC: https://gcc.gnu.org/ml/gcc-patches/2016-07/msg01505.html --HPS From owner-svn-src-all@freebsd.org Sat Feb 17 08:12:36 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A7E8DF19750; Sat, 17 Feb 2018 08:12:36 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5D3756DB11; Sat, 17 Feb 2018 08:12:36 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 582261A168; Sat, 17 Feb 2018 08:12:36 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1H8CaiC066734; Sat, 17 Feb 2018 08:12:36 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1H8CaJg066733; Sat, 17 Feb 2018 08:12:36 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201802170812.w1H8CaJg066733@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Sat, 17 Feb 2018 08:12:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329447 - head/sys/compat/linuxkpi/common/include/asm X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/compat/linuxkpi/common/include/asm X-SVN-Commit-Revision: 329447 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Feb 2018 08:12:36 -0000 Author: hselasky Date: Sat Feb 17 08:12:35 2018 New Revision: 329447 URL: https://svnweb.freebsd.org/changeset/base/329447 Log: Compile fix for GCC in the LinuxKPI. Older versions of GCC don't allow flexible array members in a union. Use a zero length array instead. MFC after: 1 week Reported by: jbeich@ Sponsored by: Mellanox Technologies Modified: head/sys/compat/linuxkpi/common/include/asm/atomic.h Modified: head/sys/compat/linuxkpi/common/include/asm/atomic.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/asm/atomic.h Sat Feb 17 06:57:43 2018 (r329446) +++ head/sys/compat/linuxkpi/common/include/asm/atomic.h Sat Feb 17 08:12:35 2018 (r329447) @@ -162,10 +162,10 @@ atomic_cmpxchg(atomic_t *v, int old, int new) #define cmpxchg(ptr, old, new) ({ \ union { \ __typeof(*(ptr)) val; \ - u8 u8[]; \ - u16 u16[]; \ - u32 u32[]; \ - u64 u64[]; \ + u8 u8[0]; \ + u16 u16[0]; \ + u32 u32[0]; \ + u64 u64[0]; \ } __ret = { .val = (old) }, __new = { .val = (new) }; \ \ CTASSERT(sizeof(__ret.val) == 1 || sizeof(__ret.val) == 2 || \ From owner-svn-src-all@freebsd.org Sat Feb 17 08:13:48 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BF08CF198E4; Sat, 17 Feb 2018 08:13:48 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (turbocat.net [88.99.82.50]) (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 5C00D6DCC9; Sat, 17 Feb 2018 08:13:48 +0000 (UTC) (envelope-from hps@selasky.org) Received: from hps2016.home.selasky.org (unknown [62.141.128.70]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id E6D132600DF; Sat, 17 Feb 2018 09:13:40 +0100 (CET) Subject: Re: svn commit: r329371 - head/sys/compat/linuxkpi/common/include/asm From: Hans Petter Selasky To: Jan Beich Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201802161520.w1GFKLiA049085@repo.freebsd.org> <6f790c90-8c65-ab0b-4a58-2814be55f09f@selasky.org> Message-ID: <46eaba10-0433-20ef-12c5-64f285c33041@selasky.org> Date: Sat, 17 Feb 2018 09:10:44 +0100 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2 MIME-Version: 1.0 In-Reply-To: <6f790c90-8c65-ab0b-4a58-2814be55f09f@selasky.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Feb 2018 08:13:48 -0000 On 02/17/18 08:32, Hans Petter Selasky wrote: > On 02/17/18 01:42, Jan Beich wrote: >> Hans Petter Selasky writes: >> >>> Author: hselasky >>> Date: Fri Feb 16 15:20:21 2018 >>> New Revision: 329371 >>> URL: https://svnweb.freebsd.org/changeset/base/329371 >>> >>> Log: >>>    Allow the cmpxchg() macro in the LinuxKPI to work on pointers without >>>    generating compiler warnings, -Wint-conversion . >> [...] >> >> To generate errors instead ? >> >> $ make clean all -C /usr/ports/graphics/drm-next-kmod >> [...] >> drm_lock.c:72:10: error: flexible array member 'u8' in a union is not >> allowed >>                  prev = cmpxchg(lock, old, new); >>                         ^ > > I believe this is a regression issue in GCC: > > https://gcc.gnu.org/ml/gcc-patches/2016-07/msg01505.html > See r329447. --HPS From owner-svn-src-all@freebsd.org Sat Feb 17 08:48:46 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 84255F1C079; Sat, 17 Feb 2018 08:48:46 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 35B956ED32; Sat, 17 Feb 2018 08:48:46 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 304651A64C; Sat, 17 Feb 2018 08:48:46 +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 w1H8mkNn081765; Sat, 17 Feb 2018 08:48:46 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1H8mkfb081764; Sat, 17 Feb 2018 08:48:46 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201802170848.w1H8mkfb081764@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Sat, 17 Feb 2018 08:48:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329448 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 329448 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Feb 2018 08:48:46 -0000 Author: mjg Date: Sat Feb 17 08:48:45 2018 New Revision: 329448 URL: https://svnweb.freebsd.org/changeset/base/329448 Log: exit: get rid of PROC_SLOCK when checking a process to report All accessed fields are protected with already held process lock. Modified: head/sys/kern/kern_exit.c Modified: head/sys/kern/kern_exit.c ============================================================================== --- head/sys/kern/kern_exit.c Sat Feb 17 08:12:35 2018 (r329447) +++ head/sys/kern/kern_exit.c Sat Feb 17 08:48:45 2018 (r329448) @@ -1228,15 +1228,11 @@ loop_locked: nfound++; PROC_LOCK_ASSERT(p, MA_OWNED); - if ((options & (WTRAPPED | WUNTRACED)) != 0) - PROC_SLOCK(p); - if ((options & WTRAPPED) != 0 && (p->p_flag & P_TRACED) != 0 && (p->p_flag & (P_STOPPED_TRACE | P_STOPPED_SIG)) != 0 && p->p_suspcount == p->p_numthreads && (p->p_flag & P_WAITED) == 0) { - PROC_SUNLOCK(p); CTR4(KTR_PTRACE, "wait: returning trapped pid %d status %#x " "(xstat %d) xthread %d", @@ -1251,13 +1247,10 @@ loop_locked: (p->p_flag & P_STOPPED_SIG) != 0 && p->p_suspcount == p->p_numthreads && (p->p_flag & P_WAITED) == 0) { - PROC_SUNLOCK(p); report_alive_proc(td, p, siginfo, status, options, CLD_STOPPED); return (0); } - if ((options & (WTRAPPED | WUNTRACED)) != 0) - PROC_SUNLOCK(p); if ((options & WCONTINUED) != 0 && (p->p_flag & P_CONTINUED) != 0) { report_alive_proc(td, p, siginfo, status, options, From owner-svn-src-all@freebsd.org Sat Feb 17 09:03:12 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 13B8BF1D447; Sat, 17 Feb 2018 09:03:12 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A90BB6F953; Sat, 17 Feb 2018 09:03:11 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A3FC51A98F; Sat, 17 Feb 2018 09:03:11 +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 w1H93BpZ091755; Sat, 17 Feb 2018 09:03:11 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1H93Bq8091754; Sat, 17 Feb 2018 09:03:11 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201802170903.w1H93Bq8091754@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Sat, 17 Feb 2018 09:03:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329449 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 329449 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Feb 2018 09:03:12 -0000 Author: mjg Date: Sat Feb 17 09:03:11 2018 New Revision: 329449 URL: https://svnweb.freebsd.org/changeset/base/329449 Log: exit: stop doing PROC_SLOCK just to call proc_reap It immediately does PROC_SUNLOCK anyway and the lock plays no role. Modified: head/sys/kern/kern_exit.c Modified: head/sys/kern/kern_exit.c ============================================================================== --- head/sys/kern/kern_exit.c Sat Feb 17 08:48:45 2018 (r329448) +++ head/sys/kern/kern_exit.c Sat Feb 17 09:03:11 2018 (r329449) @@ -817,12 +817,10 @@ proc_reap(struct thread *td, struct proc *p, int *stat sx_assert(&proctree_lock, SA_XLOCKED); PROC_LOCK_ASSERT(p, MA_OWNED); - PROC_SLOCK_ASSERT(p, MA_OWNED); KASSERT(p->p_state == PRS_ZOMBIE, ("proc_reap: !PRS_ZOMBIE")); q = td->td_proc; - PROC_SUNLOCK(p); if (status) *status = KW_EXITCODE(p->p_xexit, p->p_xsig); if (options & WNOWAIT) { @@ -1090,7 +1088,6 @@ proc_to_reap(struct thread *td, struct proc *p, idtype } if (p->p_state == PRS_ZOMBIE && !check_only) { - PROC_SLOCK(p); proc_reap(td, p, status, options); return (-1); } From owner-svn-src-all@freebsd.org Sat Feb 17 09:07:22 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C9F79F1D9E9; Sat, 17 Feb 2018 09:07:22 +0000 (UTC) (envelope-from jbeich@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 81EB06FC02; Sat, 17 Feb 2018 09:07:22 +0000 (UTC) (envelope-from jbeich@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1354) id 79D38631; Sat, 17 Feb 2018 09:07:22 +0000 (UTC) From: Jan Beich To: Hans Petter Selasky Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r329371 - head/sys/compat/linuxkpi/common/include/asm References: <201802161520.w1GFKLiA049085@repo.freebsd.org> <4b408add-0b85-d57d-292e-9de76d8c15e5@selasky.org> Date: Sat, 17 Feb 2018 10:07:12 +0100 Message-ID: MIME-Version: 1.0 Content-Type: text/plain X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Feb 2018 09:07:23 -0000 Hans Petter Selasky writes: > On 02/17/18 01:42, Jan Beich wrote: > >> To generate errors instead ? > > Which compiler are you using? > > This was tested with clang over here. $ cc -v FreeBSD clang version 6.0.0 (branches/release_60 324090) (based on LLVM 6.0.0) Target: x86_64-unknown-freebsd12.0 Thread model: posix InstalledDir: /usr/bin $ cat a.c union { char i8[]; short i16[]; int i32[]; long i64[]; } foo; $ cc -c a.c a.c:2:9: error: flexible array member 'i8' in a union is not allowed char i8[]; ^ a.c:3:9: error: flexible array member 'i16' in a union is not allowed short i16[]; ^ a.c:4:9: error: flexible array member 'i32' in a union is not allowed int i32[]; ^ a.c:5:9: error: flexible array member 'i64' in a union is not allowed long i64[]; ^ 4 errors generated. $ gcc7 -c a.c a.c:2:9: error: flexible array member in union char i8[]; ^~ a.c:3:9: error: flexible array member in union short i16[]; ^~~ a.c:4:9: error: flexible array member in union int i32[]; ^~~ a.c:5:9: error: flexible array member in union long i64[]; ^~~ From owner-svn-src-all@freebsd.org Sat Feb 17 09:33:48 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2EF77F1FDD7; Sat, 17 Feb 2018 09:33:48 +0000 (UTC) (envelope-from jbeich@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D8C2670D49; Sat, 17 Feb 2018 09:33:47 +0000 (UTC) (envelope-from jbeich@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1354) id D0876B0F; Sat, 17 Feb 2018 09:33:47 +0000 (UTC) From: Jan Beich To: Hans Petter Selasky Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r329371 - head/sys/compat/linuxkpi/common/include/asm References: <201802161520.w1GFKLiA049085@repo.freebsd.org> <6f790c90-8c65-ab0b-4a58-2814be55f09f@selasky.org> Date: Sat, 17 Feb 2018 10:33:40 +0100 Message-ID: MIME-Version: 1.0 Content-Type: text/plain X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Feb 2018 09:33:48 -0000 Hans Petter Selasky writes: > On 02/17/18 01:42, Jan Beich wrote: > >> Hans Petter Selasky writes: >> >>> Author: hselasky >>> Date: Fri Feb 16 15:20:21 2018 >>> New Revision: 329371 >>> URL: https://svnweb.freebsd.org/changeset/base/329371 >>> >>> Log: >>> Allow the cmpxchg() macro in the LinuxKPI to work on pointers without >>> generating compiler warnings, -Wint-conversion . >> [...] >> >> To generate errors instead ? >> >> $ make clean all -C /usr/ports/graphics/drm-next-kmod >> [...] >> drm_lock.c:72:10: error: flexible array member 'u8' in a union is not allowed >> prev = cmpxchg(lock, old, new); >> ^ > > I believe this is a regression issue in GCC: > > https://gcc.gnu.org/ml/gcc-patches/2016-07/msg01505.html If you didn't notice that bug is for C++, not C. GCC and Clang accept flexible array members in unions only in C++. cmpxchg() from linuxkpi doesn't seem to be used anywhere in the tree. If the macro didn't expand there's nothing to produce an error for. Anyway, I confirm r329447 fixed graphics/drm-next-kmod build. From owner-svn-src-all@freebsd.org Sat Feb 17 09:47:47 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 962A3F20F3F; Sat, 17 Feb 2018 09:47:47 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (turbocat.net [88.99.82.50]) (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 2E1467177A; Sat, 17 Feb 2018 09:47:46 +0000 (UTC) (envelope-from hps@selasky.org) Received: from hps2016.home.selasky.org (unknown [62.141.128.70]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id B13942600DF; Sat, 17 Feb 2018 10:47:45 +0100 (CET) Subject: Re: svn commit: r329371 - head/sys/compat/linuxkpi/common/include/asm To: Jan Beich Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org References: <201802161520.w1GFKLiA049085@repo.freebsd.org> <6f790c90-8c65-ab0b-4a58-2814be55f09f@selasky.org> From: Hans Petter Selasky Message-ID: Date: Sat, 17 Feb 2018 10:44:49 +0100 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Feb 2018 09:47:47 -0000 On 02/17/18 10:33, Jan Beich wrote: > Hans Petter Selasky writes: > >> On 02/17/18 01:42, Jan Beich wrote: >> >>> Hans Petter Selasky writes: >>> >>>> Author: hselasky >>>> Date: Fri Feb 16 15:20:21 2018 >>>> New Revision: 329371 >>>> URL: https://svnweb.freebsd.org/changeset/base/329371 >>>> >>>> Log: >>>> Allow the cmpxchg() macro in the LinuxKPI to work on pointers without >>>> generating compiler warnings, -Wint-conversion . >>> [...] >>> >>> To generate errors instead ? >>> >>> $ make clean all -C /usr/ports/graphics/drm-next-kmod >>> [...] >>> drm_lock.c:72:10: error: flexible array member 'u8' in a union is not allowed >>> prev = cmpxchg(lock, old, new); >>> ^ >> >> I believe this is a regression issue in GCC: >> >> https://gcc.gnu.org/ml/gcc-patches/2016-07/msg01505.html > > If you didn't notice that bug is for C++, not C. GCC and Clang accept > flexible array members in unions only in C++. cmpxchg() from linuxkpi > doesn't seem to be used anywhere in the tree. If the macro didn't expand > there's nothing to produce an error for. > > Anyway, I confirm r329447 fixed graphics/drm-next-kmod build. > Hi, It looks like there has been a testing issue on my side: drm_lock.c:72:10: error: field has incomplete type 'u64 []' This is an older clang. Thanks for reporting! --HPS From owner-svn-src-all@freebsd.org Sat Feb 17 09:51:11 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D1AFAF212C1; Sat, 17 Feb 2018 09:51:11 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (turbocat.net [IPv6:2a01:4f8:c17:6c4b::2]) (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 6CB0671AF1; Sat, 17 Feb 2018 09:51:11 +0000 (UTC) (envelope-from hps@selasky.org) Received: from hps2016.home.selasky.org (unknown [62.141.128.70]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 034BF2600DF; Sat, 17 Feb 2018 10:51:09 +0100 (CET) Subject: Re: svn commit: r329371 - head/sys/compat/linuxkpi/common/include/asm From: Hans Petter Selasky To: Jan Beich Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org References: <201802161520.w1GFKLiA049085@repo.freebsd.org> <6f790c90-8c65-ab0b-4a58-2814be55f09f@selasky.org> Message-ID: <3a3f820f-03c5-99f7-4c6d-ae829e00395c@selasky.org> Date: Sat, 17 Feb 2018 10:48:13 +0100 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Feb 2018 09:51:12 -0000 BTW: drm-next-kmod now also builds on FreeBSD-11-stable (latest) --HPS From owner-svn-src-all@freebsd.org Sat Feb 17 09:58:54 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 472F8F21BBA; Sat, 17 Feb 2018 09:58:54 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E901A720E1; Sat, 17 Feb 2018 09:58:53 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E401C1B1D8; Sat, 17 Feb 2018 09:58:53 +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 w1H9wrPx017173; Sat, 17 Feb 2018 09:58:53 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1H9wrCg017172; Sat, 17 Feb 2018 09:58:53 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201802170958.w1H9wrCg017172@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Sat, 17 Feb 2018 09:58:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r329450 - stable/11/sys/sys X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/11/sys/sys X-SVN-Commit-Revision: 329450 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Feb 2018 09:58:54 -0000 Author: hselasky Date: Sat Feb 17 09:58:53 2018 New Revision: 329450 URL: https://svnweb.freebsd.org/changeset/base/329450 Log: Bump the FreeBSD version after r329383 to indicate that the cmpxchg() macro is now fully functional in the LinuxKPI. This is a direct commit. Sponsored by: Mellanox Technologies Modified: stable/11/sys/sys/param.h Modified: stable/11/sys/sys/param.h ============================================================================== --- stable/11/sys/sys/param.h Sat Feb 17 09:03:11 2018 (r329449) +++ stable/11/sys/sys/param.h Sat Feb 17 09:58:53 2018 (r329450) @@ -58,7 +58,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1101509 /* Master, propagated to newvers */ +#define __FreeBSD_version 1101510 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-all@freebsd.org Sat Feb 17 11:27:55 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1CB67F026E0; Sat, 17 Feb 2018 11:27:55 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (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 8DABF75C9B; Sat, 17 Feb 2018 11:27:54 +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 w1HBRdKW096529 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Sat, 17 Feb 2018 13:27:42 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua w1HBRdKW096529 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id w1HBRc4Q096528; Sat, 17 Feb 2018 13:27:38 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Sat, 17 Feb 2018 13:27:38 +0200 From: Konstantin Belousov To: Mateusz Guzik Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r329448 - head/sys/kern Message-ID: <20180217112738.GO94212@kib.kiev.ua> References: <201802170848.w1H8mkfb081764@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201802170848.w1H8mkfb081764@repo.freebsd.org> User-Agent: Mutt/1.9.3 (2018-01-21) 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Feb 2018 11:27:55 -0000 On Sat, Feb 17, 2018 at 08:48:46AM +0000, Mateusz Guzik wrote: > Author: mjg > Date: Sat Feb 17 08:48:45 2018 > New Revision: 329448 > URL: https://svnweb.freebsd.org/changeset/base/329448 > > Log: > exit: get rid of PROC_SLOCK when checking a process to report Was this tested ? In particular, are you aware of r309539 ? > > All accessed fields are protected with already held process lock. > > Modified: > head/sys/kern/kern_exit.c > > Modified: head/sys/kern/kern_exit.c > ============================================================================== > --- head/sys/kern/kern_exit.c Sat Feb 17 08:12:35 2018 (r329447) > +++ head/sys/kern/kern_exit.c Sat Feb 17 08:48:45 2018 (r329448) > @@ -1228,15 +1228,11 @@ loop_locked: > nfound++; > PROC_LOCK_ASSERT(p, MA_OWNED); > > - if ((options & (WTRAPPED | WUNTRACED)) != 0) > - PROC_SLOCK(p); > - > if ((options & WTRAPPED) != 0 && > (p->p_flag & P_TRACED) != 0 && > (p->p_flag & (P_STOPPED_TRACE | P_STOPPED_SIG)) != 0 && > p->p_suspcount == p->p_numthreads && > (p->p_flag & P_WAITED) == 0) { > - PROC_SUNLOCK(p); > CTR4(KTR_PTRACE, > "wait: returning trapped pid %d status %#x " > "(xstat %d) xthread %d", > @@ -1251,13 +1247,10 @@ loop_locked: > (p->p_flag & P_STOPPED_SIG) != 0 && > p->p_suspcount == p->p_numthreads && > (p->p_flag & P_WAITED) == 0) { > - PROC_SUNLOCK(p); > report_alive_proc(td, p, siginfo, status, options, > CLD_STOPPED); > return (0); > } > - if ((options & (WTRAPPED | WUNTRACED)) != 0) > - PROC_SUNLOCK(p); > if ((options & WCONTINUED) != 0 && > (p->p_flag & P_CONTINUED) != 0) { > report_alive_proc(td, p, siginfo, status, options, From owner-svn-src-all@freebsd.org Sat Feb 17 12:07:10 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4912BF06AFE; Sat, 17 Feb 2018 12:07:10 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E35187A313; Sat, 17 Feb 2018 12:07:09 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DE2DB1C6FD; Sat, 17 Feb 2018 12:07:09 +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 w1HC79Q7087360; Sat, 17 Feb 2018 12:07:09 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1HC79C1087357; Sat, 17 Feb 2018 12:07:09 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201802171207.w1HC79C1087357@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Sat, 17 Feb 2018 12:07:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329451 - in head/sys: kern sys X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: in head/sys: kern sys X-SVN-Commit-Revision: 329451 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Feb 2018 12:07:10 -0000 Author: mjg Date: Sat Feb 17 12:07:09 2018 New Revision: 329451 URL: https://svnweb.freebsd.org/changeset/base/329451 Log: Undo LOCK_PROFILING pessimisation after r313454 and r313455 With the option used to compile the kernel both sx and rw shared ops would always go to the slow path which added avoidable overhead even when the facility is disabled. Furthermore the increased time spent doing uncontested shared lock acquire would be bogusly added to total wait time, somewhat skewing the results. Restore old behaviour of going there only when profiling is enabled. This change is a no-op for kernels without LOCK_PROFILING (which is the default). Modified: head/sys/kern/kern_rwlock.c head/sys/kern/kern_sx.c head/sys/sys/lockstat.h Modified: head/sys/kern/kern_rwlock.c ============================================================================== --- head/sys/kern/kern_rwlock.c Sat Feb 17 09:58:53 2018 (r329450) +++ head/sys/kern/kern_rwlock.c Sat Feb 17 12:07:09 2018 (r329451) @@ -645,9 +645,12 @@ __rw_rlock_int(struct rwlock *rw LOCK_FILE_LINE_ARG_DE WITNESS_CHECKORDER(&rw->lock_object, LOP_NEWORDER, file, line, NULL); v = RW_READ_VALUE(rw); - if (__predict_false(LOCKSTAT_OOL_PROFILE_ENABLED(rw__acquire) || + if (__predict_false(LOCKSTAT_PROFILE_ENABLED(rw__acquire) || !__rw_rlock_try(rw, td, &v, true LOCK_FILE_LINE_ARG))) __rw_rlock_hard(rw, td, v LOCK_FILE_LINE_ARG); + else + lock_profile_obtain_lock_success(&rw->lock_object, 0, 0, + file, line); LOCK_LOG_LOCK("RLOCK", &rw->lock_object, 0, 0, file, line); WITNESS_LOCK(&rw->lock_object, 0, file, line); @@ -839,9 +842,11 @@ _rw_runlock_cookie_int(struct rwlock *rw LOCK_FILE_LIN td = curthread; v = RW_READ_VALUE(rw); - if (__predict_false(LOCKSTAT_OOL_PROFILE_ENABLED(rw__release) || + if (__predict_false(LOCKSTAT_PROFILE_ENABLED(rw__release) || !__rw_runlock_try(rw, td, &v))) __rw_runlock_hard(rw, td, v LOCK_FILE_LINE_ARG); + else + lock_profile_release_lock(&rw->lock_object); TD_LOCKS_DEC(curthread); } Modified: head/sys/kern/kern_sx.c ============================================================================== --- head/sys/kern/kern_sx.c Sat Feb 17 09:58:53 2018 (r329450) +++ head/sys/kern/kern_sx.c Sat Feb 17 12:07:09 2018 (r329451) @@ -1122,9 +1122,12 @@ _sx_slock_int(struct sx *sx, int opts LOCK_FILE_LINE_A error = 0; x = SX_READ_VALUE(sx); - if (__predict_false(LOCKSTAT_OOL_PROFILE_ENABLED(sx__acquire) || + if (__predict_false(LOCKSTAT_PROFILE_ENABLED(sx__acquire) || !__sx_slock_try(sx, &x LOCK_FILE_LINE_ARG))) error = _sx_slock_hard(sx, opts, x LOCK_FILE_LINE_ARG); + else + lock_profile_obtain_lock_success(&sx->lock_object, 0, 0, + file, line); if (error == 0) { LOCK_LOG_LOCK("SLOCK", &sx->lock_object, 0, 0, file, line); WITNESS_LOCK(&sx->lock_object, 0, file, line); @@ -1252,9 +1255,11 @@ _sx_sunlock_int(struct sx *sx LOCK_FILE_LINE_ARG_DEF) LOCK_LOG_LOCK("SUNLOCK", &sx->lock_object, 0, 0, file, line); x = SX_READ_VALUE(sx); - if (__predict_false(LOCKSTAT_OOL_PROFILE_ENABLED(sx__release) || + if (__predict_false(LOCKSTAT_PROFILE_ENABLED(sx__release) || !_sx_sunlock_try(sx, &x))) _sx_sunlock_hard(sx, x LOCK_FILE_LINE_ARG); + else + lock_profile_release_lock(&sx->lock_object); TD_LOCKS_DEC(curthread); } Modified: head/sys/sys/lockstat.h ============================================================================== --- head/sys/sys/lockstat.h Sat Feb 17 09:58:53 2018 (r329450) +++ head/sys/sys/lockstat.h Sat Feb 17 12:07:09 2018 (r329451) @@ -109,12 +109,7 @@ extern volatile int lockstat_enabled; LOCKSTAT_RECORD1(probe, lp, a); \ } while (0) -#ifndef LOCK_PROFILING #define LOCKSTAT_PROFILE_ENABLED(probe) __predict_false(lockstat_enabled) -#define LOCKSTAT_OOL_PROFILE_ENABLED(probe) LOCKSTAT_PROFILE_ENABLED(probe) -#else -#define LOCKSTAT_OOL_PROFILE_ENABLED(probe) 1 -#endif struct lock_object; uint64_t lockstat_nsecs(struct lock_object *); @@ -139,10 +134,7 @@ uint64_t lockstat_nsecs(struct lock_object *); #define LOCKSTAT_PROFILE_RELEASE_RWLOCK(probe, lp, a) \ LOCKSTAT_PROFILE_RELEASE_LOCK(probe, lp) -#ifndef LOCK_PROFILING #define LOCKSTAT_PROFILE_ENABLED(probe) 0 -#endif -#define LOCKSTAT_OOL_PROFILE_ENABLED(probe) 1 #endif /* !KDTRACE_HOOKS */ From owner-svn-src-all@freebsd.org Sat Feb 17 12:22:32 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5D604F081EB; Sat, 17 Feb 2018 12:22:32 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0CCAA7B125; Sat, 17 Feb 2018 12:22:32 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E2B001CA3C; Sat, 17 Feb 2018 12:22:31 +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 w1HCMVjn097053; Sat, 17 Feb 2018 12:22:31 GMT (envelope-from oshogbo@FreeBSD.org) Received: (from oshogbo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1HCMTMQ097032; Sat, 17 Feb 2018 12:22:29 GMT (envelope-from oshogbo@FreeBSD.org) Message-Id: <201802171222.w1HCMTMQ097032@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: oshogbo set sender to oshogbo@FreeBSD.org using -f From: Mariusz Zaborski Date: Sat, 17 Feb 2018 12:22:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329452 - in head/lib/libcasper: libcasper services/cap_dns services/cap_grp services/cap_pwd services/cap_random services/cap_sysctl services/cap_syslog X-SVN-Group: head X-SVN-Commit-Author: oshogbo X-SVN-Commit-Paths: in head/lib/libcasper: libcasper services/cap_dns services/cap_grp services/cap_pwd services/cap_random services/cap_sysctl services/cap_syslog X-SVN-Commit-Revision: 329452 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Feb 2018 12:22:32 -0000 Author: oshogbo Date: Sat Feb 17 12:22:29 2018 New Revision: 329452 URL: https://svnweb.freebsd.org/changeset/base/329452 Log: Introduce channel flags in libcasper. Instead of passing flags (which describe a type of nvlist) every send/recv we remember them in channel. It's enough for use to extract them only during unwrap. This simplify use of Casper. Reviewed by: bruffer@, bcr@ (both man page) Differential Revision: https://reviews.freebsd.org/D14196 (man page) Modified: head/lib/libcasper/libcasper/Makefile head/lib/libcasper/libcasper/libcasper.3 head/lib/libcasper/libcasper/libcasper.c head/lib/libcasper/libcasper/libcasper.h head/lib/libcasper/libcasper/libcasper_impl.h head/lib/libcasper/libcasper/libcasper_service.c head/lib/libcasper/libcasper/libcasper_service.h head/lib/libcasper/libcasper/service.c head/lib/libcasper/services/cap_dns/Makefile head/lib/libcasper/services/cap_dns/cap_dns.c head/lib/libcasper/services/cap_grp/Makefile head/lib/libcasper/services/cap_grp/cap_grp.c head/lib/libcasper/services/cap_pwd/Makefile head/lib/libcasper/services/cap_pwd/cap_pwd.c head/lib/libcasper/services/cap_random/Makefile head/lib/libcasper/services/cap_random/cap_random.c head/lib/libcasper/services/cap_sysctl/Makefile head/lib/libcasper/services/cap_sysctl/cap_sysctl.c head/lib/libcasper/services/cap_syslog/Makefile head/lib/libcasper/services/cap_syslog/cap_syslog.c Modified: head/lib/libcasper/libcasper/Makefile ============================================================================== --- head/lib/libcasper/libcasper/Makefile Sat Feb 17 12:07:09 2018 (r329451) +++ head/lib/libcasper/libcasper/Makefile Sat Feb 17 12:22:29 2018 (r329452) @@ -8,7 +8,7 @@ PACKAGE=casper .if ${MK_CASPER} != "no" SHLIB= casper -SHLIB_MAJOR= 0 +SHLIB_MAJOR= 1 SRCS= libcasper.c SRCS+= libcasper_impl.c Modified: head/lib/libcasper/libcasper/libcasper.3 ============================================================================== --- head/lib/libcasper/libcasper/libcasper.3 Sat Feb 17 12:07:09 2018 (r329451) +++ head/lib/libcasper/libcasper/libcasper.3 Sat Feb 17 12:22:29 2018 (r329452) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 5, 2018 +.Dd February 17, 2018 .Dt LIBCASPER 3 .Os .Sh NAME @@ -53,9 +53,9 @@ .Ft "cap_channel_t *" .Fn cap_init "void" .Ft "cap_channel_t *" -.Fn cap_wrap "int sock" +.Fn cap_wrap "int sock" "int flags" .Ft "int" -.Fn cap_unwrap "cap_channel_t *chan" +.Fn cap_unwrap "cap_channel_t *chan" "int *flags" .Ft "int" .Fn cap_sock "const cap_channel_t *chan" .Ft "cap_channel_t *" @@ -69,9 +69,9 @@ .Ft "int" .Fn cap_send_nvlist "const cap_channel_t *chan" "const nvlist_t *nvl" .Ft "nvlist_t *" -.Fn cap_recv_nvlist "const cap_channel_t *chan" "int flags" +.Fn cap_recv_nvlist "const cap_channel_t *chan" .Ft "nvlist_t *" -.Fn cap_xfer_nvlist "const cap_channel_t *chan" "nvlist_t *nvl" "int flags" +.Fn cap_xfer_nvlist "const cap_channel_t *chan" "nvlist_t *nvl" .Ft "cap_channel_t *" .Fn cap_service_open "const cap_channel_t *chan" "const char *name" .Sh DESCRIPTION @@ -105,6 +105,14 @@ or send over domain socket as a regular file descriptor and has to be represented as .Vt cap_channel_t again. +The +.Fa flags +argument defines the channel behavior. +The supported flags are: +.Bl -ohang -offset indent +.It CASPER_NO_UNIQ +The communication between process and casper uses no unique version of nvlist. +.El .Pp The .Fn cap_unwrap @@ -164,23 +172,11 @@ Most services should provide higher level API. The .Fn cap_recv_nvlist function receives the given nvlist over the given capability. -The -.Fa flags -argument defines what type the top nvlist is expected to be. -If the nvlist flags do not match the flags passed to -.Fn cap_recv_nvlist , -the nvlist will not be returned. .Pp The .Fn cap_xfer_nvlist function sends the given nvlist, destroys it and receives new nvlist in response over the given capability. -The -.Fa flags -argument defines what type the top nvlist is expected to be. -If the nvlist flags do not match the flags passed to -.Fn cap_xfer_nvlist , -the nvlist will not be returned. It does not matter if the function succeeds or fails, the nvlist given for sending will always be destroyed once the function returns. .Pp Modified: head/lib/libcasper/libcasper/libcasper.c ============================================================================== --- head/lib/libcasper/libcasper/libcasper.c Sat Feb 17 12:07:09 2018 (r329451) +++ head/lib/libcasper/libcasper/libcasper.c Sat Feb 17 12:22:29 2018 (r329452) @@ -48,6 +48,8 @@ __FBSDID("$FreeBSD$"); #include "libcasper.h" #include "libcasper_impl.h" +#define CASPER_VALID_FLAGS (CASPER_NO_UNIQ) + /* * Structure describing communication channel between two separated processes. */ @@ -62,6 +64,8 @@ struct cap_channel { int cch_sock; /* Process descriptor for casper. */ int cch_pd; + /* Flags to communicate with casper. */ + int cch_flags; }; static bool @@ -74,6 +78,13 @@ cap_add_pd(cap_channel_t *chan, int pd) return (true); } +int +cap_channel_flags(const cap_channel_t *chan) +{ + + return (chan->cch_flags); +} + cap_channel_t * cap_init(void) { @@ -96,7 +107,7 @@ cap_init(void) } else if (pid > 0) { /* Child. */ close(sock[1]); - chan = cap_wrap(sock[0]); + chan = cap_wrap(sock[0], 0); if (chan == NULL) { serrno = errno; close(sock[0]); @@ -118,17 +129,21 @@ cap_init(void) } cap_channel_t * -cap_wrap(int sock) +cap_wrap(int sock, int flags) { cap_channel_t *chan; if (!fd_is_valid(sock)) return (NULL); + if ((flags & CASPER_VALID_FLAGS) != flags) + return (NULL); + chan = malloc(sizeof(*chan)); if (chan != NULL) { chan->cch_sock = sock; chan->cch_pd = -1; + chan->cch_flags = flags; chan->cch_magic = CAP_CHANNEL_MAGIC; } @@ -136,7 +151,7 @@ cap_wrap(int sock) } int -cap_unwrap(cap_channel_t *chan) +cap_unwrap(cap_channel_t *chan, int *flags) { int sock; @@ -146,6 +161,8 @@ cap_unwrap(cap_channel_t *chan) sock = chan->cch_sock; if (chan->cch_pd != -1) close(chan->cch_pd); + if (flags != NULL) + *flags = chan->cch_flags; chan->cch_magic = 0; free(chan); @@ -162,9 +179,9 @@ cap_clone(const cap_channel_t *chan) assert(chan != NULL); assert(chan->cch_magic == CAP_CHANNEL_MAGIC); - nvl = nvlist_create(0); + nvl = nvlist_create(channel_nvlist_flags(chan)); nvlist_add_string(nvl, "cmd", "clone"); - nvl = cap_xfer_nvlist(chan, nvl, 0); + nvl = cap_xfer_nvlist(chan, nvl); if (nvl == NULL) return (NULL); if (nvlist_get_number(nvl, "error") != 0) { @@ -174,7 +191,7 @@ cap_clone(const cap_channel_t *chan) } newsock = nvlist_take_descriptor(nvl, "sock"); nvlist_destroy(nvl); - newchan = cap_wrap(newsock); + newchan = cap_wrap(newsock, chan->cch_flags); if (newchan == NULL) { int serrno; @@ -216,10 +233,10 @@ cap_limit_set(const cap_channel_t *chan, nvlist_t *lim nvlist_t *nvlmsg; int error; - nvlmsg = nvlist_create(0); + nvlmsg = nvlist_create(channel_nvlist_flags(chan)); nvlist_add_string(nvlmsg, "cmd", "limit_set"); nvlist_add_nvlist(nvlmsg, "limits", limits); - nvlmsg = cap_xfer_nvlist(chan, nvlmsg, 0); + nvlmsg = cap_xfer_nvlist(chan, nvlmsg); if (nvlmsg == NULL) { nvlist_destroy(limits); return (-1); @@ -240,9 +257,9 @@ cap_limit_get(const cap_channel_t *chan, nvlist_t **li nvlist_t *nvlmsg; int error; - nvlmsg = nvlist_create(0); + nvlmsg = nvlist_create(channel_nvlist_flags(chan)); nvlist_add_string(nvlmsg, "cmd", "limit_get"); - nvlmsg = cap_xfer_nvlist(chan, nvlmsg, 0); + nvlmsg = cap_xfer_nvlist(chan, nvlmsg); if (nvlmsg == NULL) return (-1); error = (int)nvlist_get_number(nvlmsg, "error"); @@ -270,23 +287,25 @@ cap_send_nvlist(const cap_channel_t *chan, const nvlis } nvlist_t * -cap_recv_nvlist(const cap_channel_t *chan, int flags) +cap_recv_nvlist(const cap_channel_t *chan) { assert(chan != NULL); assert(chan->cch_magic == CAP_CHANNEL_MAGIC); - return (nvlist_recv(chan->cch_sock, flags)); + return (nvlist_recv(chan->cch_sock, + channel_nvlist_flags(chan))); } nvlist_t * -cap_xfer_nvlist(const cap_channel_t *chan, nvlist_t *nvl, int flags) +cap_xfer_nvlist(const cap_channel_t *chan, nvlist_t *nvl) { assert(chan != NULL); assert(chan->cch_magic == CAP_CHANNEL_MAGIC); - return (nvlist_xfer(chan->cch_sock, nvl, flags)); + return (nvlist_xfer(chan->cch_sock, nvl, + channel_nvlist_flags(chan))); } cap_channel_t * @@ -295,13 +314,14 @@ cap_service_open(const cap_channel_t *chan, const char cap_channel_t *newchan; nvlist_t *nvl; int sock, error; + int flags; sock = -1; - nvl = nvlist_create(0); + nvl = nvlist_create(channel_nvlist_flags(chan)); nvlist_add_string(nvl, "cmd", "open"); nvlist_add_string(nvl, "service", name); - nvl = cap_xfer_nvlist(chan, nvl, 0); + nvl = cap_xfer_nvlist(chan, nvl); if (nvl == NULL) return (NULL); error = (int)nvlist_get_number(nvl, "error"); @@ -311,10 +331,11 @@ cap_service_open(const cap_channel_t *chan, const char return (NULL); } sock = nvlist_take_descriptor(nvl, "chanfd"); + flags = nvlist_take_number(nvl, "chanflags"); assert(sock >= 0); nvlist_destroy(nvl); nvl = NULL; - newchan = cap_wrap(sock); + newchan = cap_wrap(sock, flags); if (newchan == NULL) goto fail; return (newchan); @@ -332,7 +353,7 @@ cap_service_limit(const cap_channel_t *chan, const cha nvlist_t *limits; unsigned int i; - limits = nvlist_create(0); + limits = nvlist_create(channel_nvlist_flags(chan)); for (i = 0; i < nnames; i++) nvlist_add_null(limits, names[i]); return (cap_limit_set(chan, limits)); Modified: head/lib/libcasper/libcasper/libcasper.h ============================================================================== --- head/lib/libcasper/libcasper/libcasper.h Sat Feb 17 12:07:09 2018 (r329451) +++ head/lib/libcasper/libcasper/libcasper.h Sat Feb 17 12:22:29 2018 (r329452) @@ -45,6 +45,8 @@ #include #include +#define CASPER_NO_UNIQ 0x00000001 + #ifndef _NVLIST_T_DECLARED #define _NVLIST_T_DECLARED struct nvlist; @@ -62,12 +64,36 @@ typedef struct cap_channel cap_channel_t; #else struct cap_channel { int cch_fd; + int cch_flags; }; typedef struct cap_channel cap_channel_t; #define CASPER_SUPPORT (0) #endif /* ! WITH_CASPER */ #endif /* ! _CAP_CHANNEL_T_DECLARED */ +#ifdef WITH_CASPER +int cap_channel_flags(const cap_channel_t *chan); +#else +static inline int +cap_channel_flags(const cap_channel_t *chan) +{ + + return (chan->cch_flags); +} +#endif + +static inline int +channel_nvlist_flags(const cap_channel_t *chan) +{ + int flags; + + flags = 0; + if ((cap_channel_flags(chan) & CASPER_NO_UNIQ) != 0) + flags |= NV_FLAG_NO_UNIQUE; + + return (flags); +} + /* * The functions opens unrestricted communication channel to Casper. */ @@ -103,16 +129,17 @@ int cap_service_limit(const cap_channel_t *chan, * The function creates cap_channel_t based on the given socket. */ #ifdef WITH_CASPER -cap_channel_t *cap_wrap(int sock); +cap_channel_t *cap_wrap(int sock, int flags); #else static inline cap_channel_t * -cap_wrap(int sock) +cap_wrap(int sock, int flags) { cap_channel_t *chan; chan = cap_init(); if (chan != NULL) { chan->cch_fd = sock; + chan->cch_flags = flags; } return (chan); } @@ -122,7 +149,7 @@ cap_wrap(int sock) * The function returns communication socket and frees cap_channel_t. */ #ifdef WITH_CASPER -int cap_unwrap(cap_channel_t *chan); +int cap_unwrap(cap_channel_t *chan, int *flags); #else static inline int cap_unwrap(cap_channel_t *chan) @@ -160,6 +187,7 @@ cap_clone(const cap_channel_t *chan) newchan = NULL; } } + newchan->cch_flags = chan->cch_flags; return (newchan); } @@ -212,7 +240,7 @@ static inline int cap_limit_get(const cap_channel_t *chan __unused, nvlist_t **limitsp) { - *limitsp = nvlist_create(0); + *limitsp = nvlist_create(channel_nvlist_flags(chan)); return (0); } #endif @@ -230,9 +258,9 @@ int cap_send_nvlist(const cap_channel_t *chan, const n * Function receives nvlist over the given capability. */ #ifdef WITH_CASPER -nvlist_t *cap_recv_nvlist(const cap_channel_t *chan, int flags); +nvlist_t *cap_recv_nvlist(const cap_channel_t *chan); #else -#define cap_recv_nvlist(chan, flags) (nvlist_create(flags)) +#define cap_recv_nvlist(chan) (nvlist_create(chan->cch_flags)) #endif /* @@ -240,14 +268,14 @@ nvlist_t *cap_recv_nvlist(const cap_channel_t *chan, i * response over the given capability. */ #ifdef WITH_CASPER -nvlist_t *cap_xfer_nvlist(const cap_channel_t *chan, nvlist_t *nvl, int flags); +nvlist_t *cap_xfer_nvlist(const cap_channel_t *chan, nvlist_t *nvl); #else static inline nvlist_t * -cap_xfer_nvlist(const cap_channel_t *chan __unused, nvlist_t *nvl, int flags) +cap_xfer_nvlist(const cap_channel_t *chan, nvlist_t *nvl) { nvlist_destroy(nvl); - return (nvlist_create(flags)); + return (nvlist_create(channel_nvlist_flags(chan))); } #endif Modified: head/lib/libcasper/libcasper/libcasper_impl.h ============================================================================== --- head/lib/libcasper/libcasper/libcasper_impl.h Sat Feb 17 12:07:09 2018 (r329451) +++ head/lib/libcasper/libcasper/libcasper_impl.h Sat Feb 17 12:22:29 2018 (r329452) @@ -54,6 +54,7 @@ void service_message(struct service *service, struct service_connection *sconn); void service_start(struct service *service, int sock, int procfd); const char *service_name(struct service *service); +int service_get_channel_flags(struct service *service); /* Private service connection functions. */ struct service_connection *service_connection_add(struct service *service, Modified: head/lib/libcasper/libcasper/libcasper_service.c ============================================================================== --- head/lib/libcasper/libcasper/libcasper_service.c Sat Feb 17 12:07:09 2018 (r329451) +++ head/lib/libcasper/libcasper/libcasper_service.c Sat Feb 17 12:22:29 2018 (r329452) @@ -201,6 +201,8 @@ casper_command(const char *cmd, const nvlist_t *limits nvlist_destroy(nvl); nvlist_move_descriptor(nvlout, "chanfd", chanfd); + nvlist_add_number(nvlout, "chanflags", + service_get_channel_flags(casserv->cs_service)); return (0); } Modified: head/lib/libcasper/libcasper/libcasper_service.h ============================================================================== --- head/lib/libcasper/libcasper/libcasper_service.h Sat Feb 17 12:07:09 2018 (r329451) +++ head/lib/libcasper/libcasper/libcasper_service.h Sat Feb 17 12:22:29 2018 (r329452) @@ -42,8 +42,9 @@ struct nvlist; typedef struct nvlist nvlist_t; #endif -#define CASPER_SERVICE_STDIO 0x00000001 -#define CASPER_SERVICE_FD 0x00000002 +#define CASPER_SERVICE_STDIO 0x00000001 +#define CASPER_SERVICE_FD 0x00000002 +#define CASPER_SERVICE_NO_UNIQ_LIMITS 0x00000004 typedef int service_limit_func_t(const nvlist_t *, const nvlist_t *); typedef int service_command_func_t(const char *cmd, const nvlist_t *, Modified: head/lib/libcasper/libcasper/service.c ============================================================================== --- head/lib/libcasper/libcasper/service.c Sat Feb 17 12:07:09 2018 (r329451) +++ head/lib/libcasper/libcasper/service.c Sat Feb 17 12:22:29 2018 (r329452) @@ -136,7 +136,8 @@ service_connection_add(struct service *service, int so sconn = malloc(sizeof(*sconn)); if (sconn == NULL) return (NULL); - sconn->sc_chan = cap_wrap(sock); + sconn->sc_chan = cap_wrap(sock, + service_get_channel_flags(service)); if (sconn->sc_chan == NULL) { serrno = errno; free(sconn); @@ -149,7 +150,7 @@ service_connection_add(struct service *service, int so sconn->sc_limits = nvlist_clone(limits); if (sconn->sc_limits == NULL) { serrno = errno; - (void)cap_unwrap(sconn->sc_chan); + (void)cap_unwrap(sconn->sc_chan, NULL); free(sconn); errno = serrno; return (NULL); @@ -266,16 +267,20 @@ service_message(struct service *service, struct servic { nvlist_t *nvlin, *nvlout; const char *cmd; - int error; + int error, flags; - nvlin = cap_recv_nvlist(service_connection_get_chan(sconn), 0); + flags = 0; + if ((service->s_flags & CASPER_SERVICE_NO_UNIQ_LIMITS) != 0) + flags = NV_FLAG_NO_UNIQUE; + + nvlin = cap_recv_nvlist(service_connection_get_chan(sconn)); if (nvlin == NULL) { service_connection_remove(service, sconn); return; } error = EDOOFUS; - nvlout = nvlist_create(0); + nvlout = nvlist_create(flags); cmd = nvlist_get_string(nvlin, "cmd"); if (strcmp(cmd, "limit_set") == 0) { @@ -341,6 +346,20 @@ service_name(struct service *service) assert(service->s_magic == SERVICE_MAGIC); return (service->s_name); +} + +int +service_get_channel_flags(struct service *service) +{ + int flags; + + assert(service->s_magic == SERVICE_MAGIC); + flags = 0; + + if ((service->s_flags & CASPER_SERVICE_NO_UNIQ_LIMITS) != 0) + flags |= CASPER_NO_UNIQ; + + return (flags); } static void Modified: head/lib/libcasper/services/cap_dns/Makefile ============================================================================== --- head/lib/libcasper/services/cap_dns/Makefile Sat Feb 17 12:07:09 2018 (r329451) +++ head/lib/libcasper/services/cap_dns/Makefile Sat Feb 17 12:22:29 2018 (r329452) @@ -6,7 +6,7 @@ SHLIBDIR?= /lib/casper PACKAGE=libcasper -SHLIB_MAJOR= 0 +SHLIB_MAJOR= 1 INCSDIR?= ${INCLUDEDIR}/casper .if ${MK_CASPER} != "no" Modified: head/lib/libcasper/services/cap_dns/cap_dns.c ============================================================================== --- head/lib/libcasper/services/cap_dns/cap_dns.c Sat Feb 17 12:07:09 2018 (r329451) +++ head/lib/libcasper/services/cap_dns/cap_dns.c Sat Feb 17 12:22:29 2018 (r329452) @@ -139,7 +139,7 @@ cap_gethostbyname2(cap_channel_t *chan, const char *na nvlist_add_string(nvl, "cmd", "gethostbyname"); nvlist_add_number(nvl, "family", (uint64_t)type); nvlist_add_string(nvl, "name", name); - nvl = cap_xfer_nvlist(chan, nvl, 0); + nvl = cap_xfer_nvlist(chan, nvl); if (nvl == NULL) { h_errno = NO_RECOVERY; return (NULL); @@ -166,7 +166,7 @@ cap_gethostbyaddr(cap_channel_t *chan, const void *add nvlist_add_string(nvl, "cmd", "gethostbyaddr"); nvlist_add_binary(nvl, "addr", addr, (size_t)len); nvlist_add_number(nvl, "family", (uint64_t)type); - nvl = cap_xfer_nvlist(chan, nvl, 0); + nvl = cap_xfer_nvlist(chan, nvl); if (nvl == NULL) { h_errno = NO_RECOVERY; return (NULL); @@ -242,7 +242,7 @@ cap_getaddrinfo(cap_channel_t *chan, const char *hostn nvlist_add_number(nvl, "hints.ai_protocol", (uint64_t)hints->ai_protocol); } - nvl = cap_xfer_nvlist(chan, nvl, 0); + nvl = cap_xfer_nvlist(chan, nvl); if (nvl == NULL) return (EAI_MEMORY); if (nvlist_get_number(nvl, "error") != 0) { @@ -292,7 +292,7 @@ cap_getnameinfo(cap_channel_t *chan, const struct sock nvlist_add_number(nvl, "servlen", (uint64_t)servlen); nvlist_add_binary(nvl, "sa", sa, (size_t)salen); nvlist_add_number(nvl, "flags", (uint64_t)flags); - nvl = cap_xfer_nvlist(chan, nvl, 0); + nvl = cap_xfer_nvlist(chan, nvl); if (nvl == NULL) return (EAI_MEMORY); if (nvlist_get_number(nvl, "error") != 0) { Modified: head/lib/libcasper/services/cap_grp/Makefile ============================================================================== --- head/lib/libcasper/services/cap_grp/Makefile Sat Feb 17 12:07:09 2018 (r329451) +++ head/lib/libcasper/services/cap_grp/Makefile Sat Feb 17 12:22:29 2018 (r329452) @@ -6,7 +6,7 @@ SHLIBDIR?= /lib/casper PACKAGE=libcasper -SHLIB_MAJOR= 0 +SHLIB_MAJOR= 1 INCSDIR?= ${INCLUDEDIR}/casper .if ${MK_CASPER} != "no" Modified: head/lib/libcasper/services/cap_grp/cap_grp.c ============================================================================== --- head/lib/libcasper/services/cap_grp/cap_grp.c Sat Feb 17 12:07:09 2018 (r329451) +++ head/lib/libcasper/services/cap_grp/cap_grp.c Sat Feb 17 12:22:29 2018 (r329452) @@ -197,7 +197,7 @@ cap_getgrcommon_r(cap_channel_t *chan, const char *cmd } else { abort(); } - nvl = cap_xfer_nvlist(chan, nvl, 0); + nvl = cap_xfer_nvlist(chan, nvl); if (nvl == NULL) { assert(errno != 0); *result = NULL; @@ -321,7 +321,7 @@ cap_setgroupent(cap_channel_t *chan, int stayopen) nvl = nvlist_create(0); nvlist_add_string(nvl, "cmd", "setgroupent"); nvlist_add_bool(nvl, "stayopen", stayopen != 0); - nvl = cap_xfer_nvlist(chan, nvl, 0); + nvl = cap_xfer_nvlist(chan, nvl); if (nvl == NULL) return (0); if (nvlist_get_number(nvl, "error") != 0) { @@ -341,7 +341,7 @@ cap_setgrent(cap_channel_t *chan) nvl = nvlist_create(0); nvlist_add_string(nvl, "cmd", "setgrent"); - nvl = cap_xfer_nvlist(chan, nvl, 0); + nvl = cap_xfer_nvlist(chan, nvl); if (nvl == NULL) return (0); if (nvlist_get_number(nvl, "error") != 0) { @@ -362,7 +362,7 @@ cap_endgrent(cap_channel_t *chan) nvl = nvlist_create(0); nvlist_add_string(nvl, "cmd", "endgrent"); /* Ignore any errors, we have no way to report them. */ - nvlist_destroy(cap_xfer_nvlist(chan, nvl, 0)); + nvlist_destroy(cap_xfer_nvlist(chan, nvl)); } int Modified: head/lib/libcasper/services/cap_pwd/Makefile ============================================================================== --- head/lib/libcasper/services/cap_pwd/Makefile Sat Feb 17 12:07:09 2018 (r329451) +++ head/lib/libcasper/services/cap_pwd/Makefile Sat Feb 17 12:22:29 2018 (r329452) @@ -6,7 +6,7 @@ SHLIBDIR?= /lib/casper PACKAGE=libcasper -SHLIB_MAJOR= 0 +SHLIB_MAJOR= 1 INCSDIR?= ${INCLUDEDIR}/casper .if ${MK_CASPER} != "no" Modified: head/lib/libcasper/services/cap_pwd/cap_pwd.c ============================================================================== --- head/lib/libcasper/services/cap_pwd/cap_pwd.c Sat Feb 17 12:07:09 2018 (r329451) +++ head/lib/libcasper/services/cap_pwd/cap_pwd.c Sat Feb 17 12:22:29 2018 (r329452) @@ -157,7 +157,7 @@ cap_getpwcommon_r(cap_channel_t *chan, const char *cmd } else { abort(); } - nvl = cap_xfer_nvlist(chan, nvl, 0); + nvl = cap_xfer_nvlist(chan, nvl); if (nvl == NULL) { assert(errno != 0); *result = NULL; @@ -281,7 +281,7 @@ cap_setpassent(cap_channel_t *chan, int stayopen) nvl = nvlist_create(0); nvlist_add_string(nvl, "cmd", "setpassent"); nvlist_add_bool(nvl, "stayopen", stayopen != 0); - nvl = cap_xfer_nvlist(chan, nvl, 0); + nvl = cap_xfer_nvlist(chan, nvl); if (nvl == NULL) return (0); if (nvlist_get_number(nvl, "error") != 0) { @@ -302,7 +302,7 @@ cap_set_end_pwent(cap_channel_t *chan, const char *cmd nvl = nvlist_create(0); nvlist_add_string(nvl, "cmd", cmd); /* Ignore any errors, we have no way to report them. */ - nvlist_destroy(cap_xfer_nvlist(chan, nvl, 0)); + nvlist_destroy(cap_xfer_nvlist(chan, nvl)); } void Modified: head/lib/libcasper/services/cap_random/Makefile ============================================================================== --- head/lib/libcasper/services/cap_random/Makefile Sat Feb 17 12:07:09 2018 (r329451) +++ head/lib/libcasper/services/cap_random/Makefile Sat Feb 17 12:22:29 2018 (r329452) @@ -6,7 +6,7 @@ SHLIBDIR?= /lib/casper PACKAGE=libcasper -SHLIB_MAJOR= 0 +SHLIB_MAJOR= 1 INCSDIR?= ${INCLUDEDIR}/casper .if ${MK_CASPER} != "no" Modified: head/lib/libcasper/services/cap_random/cap_random.c ============================================================================== --- head/lib/libcasper/services/cap_random/cap_random.c Sat Feb 17 12:07:09 2018 (r329451) +++ head/lib/libcasper/services/cap_random/cap_random.c Sat Feb 17 12:22:29 2018 (r329452) @@ -63,7 +63,7 @@ cap_random_buf(cap_channel_t *chan, void *buf, size_t nvlist_add_string(nvl, "cmd", "generate"); nvlist_add_number(nvl, "size", (uint64_t)(left > MAXSIZE ? MAXSIZE : left)); - nvl = cap_xfer_nvlist(chan, nvl, 0); + nvl = cap_xfer_nvlist(chan, nvl); if (nvl == NULL) return (-1); if (nvlist_get_number(nvl, "error") != 0) { Modified: head/lib/libcasper/services/cap_sysctl/Makefile ============================================================================== --- head/lib/libcasper/services/cap_sysctl/Makefile Sat Feb 17 12:07:09 2018 (r329451) +++ head/lib/libcasper/services/cap_sysctl/Makefile Sat Feb 17 12:22:29 2018 (r329452) @@ -6,7 +6,7 @@ SHLIBDIR?= /lib/casper PACKAGE=libcasper -SHLIB_MAJOR= 0 +SHLIB_MAJOR= 1 INCSDIR?= ${INCLUDEDIR}/casper .if ${MK_CASPER} != "no" Modified: head/lib/libcasper/services/cap_sysctl/cap_sysctl.c ============================================================================== --- head/lib/libcasper/services/cap_sysctl/cap_sysctl.c Sat Feb 17 12:07:09 2018 (r329451) +++ head/lib/libcasper/services/cap_sysctl/cap_sysctl.c Sat Feb 17 12:22:29 2018 (r329452) @@ -71,7 +71,7 @@ cap_sysctlbyname(cap_channel_t *chan, const char *name nvlist_add_number(nvl, "oldlen", (uint64_t)*oldlenp); if (newp != NULL) nvlist_add_binary(nvl, "newp", newp, newlen); - nvl = cap_xfer_nvlist(chan, nvl, 0); + nvl = cap_xfer_nvlist(chan, nvl); if (nvl == NULL) return (-1); if (nvlist_get_number(nvl, "error") != 0) { Modified: head/lib/libcasper/services/cap_syslog/Makefile ============================================================================== --- head/lib/libcasper/services/cap_syslog/Makefile Sat Feb 17 12:07:09 2018 (r329451) +++ head/lib/libcasper/services/cap_syslog/Makefile Sat Feb 17 12:22:29 2018 (r329452) @@ -6,7 +6,7 @@ SHLIBDIR?= /lib/casper PACKAGE=libcasper -SHLIB_MAJOR= 0 +SHLIB_MAJOR= 1 INCSDIR?= ${INCLUDEDIR}/casper .if ${MK_CASPER} != "no" Modified: head/lib/libcasper/services/cap_syslog/cap_syslog.c ============================================================================== --- head/lib/libcasper/services/cap_syslog/cap_syslog.c Sat Feb 17 12:07:09 2018 (r329451) +++ head/lib/libcasper/services/cap_syslog/cap_syslog.c Sat Feb 17 12:22:29 2018 (r329452) @@ -69,7 +69,7 @@ cap_vsyslog(cap_channel_t *chan, int priority, const c nvlist_add_string(nvl, "cmd", "vsyslog"); nvlist_add_number(nvl, "priority", priority); nvlist_add_string(nvl, "message", message); - nvl = cap_xfer_nvlist(chan, nvl, 0); + nvl = cap_xfer_nvlist(chan, nvl); if (nvl == NULL) { return; } @@ -88,7 +88,7 @@ cap_openlog(cap_channel_t *chan, const char *ident, in } nvlist_add_number(nvl, "logopt", logopt); nvlist_add_number(nvl, "facility", facility); - nvl = cap_xfer_nvlist(chan, nvl, 0); + nvl = cap_xfer_nvlist(chan, nvl); if (nvl == NULL) { return; } @@ -102,7 +102,7 @@ cap_closelog(cap_channel_t *chan) nvl = nvlist_create(0); nvlist_add_string(nvl, "cmd", "closelog"); - nvl = cap_xfer_nvlist(chan, nvl, 0); + nvl = cap_xfer_nvlist(chan, nvl); if (nvl == NULL) { return; } @@ -118,7 +118,7 @@ cap_setlogmask(cap_channel_t *chan, int maskpri) nvl = nvlist_create(0); nvlist_add_string(nvl, "cmd", "setlogmask"); nvlist_add_number(nvl, "maskpri", maskpri); - nvl = cap_xfer_nvlist(chan, nvl, 0); + nvl = cap_xfer_nvlist(chan, nvl); omask = nvlist_get_number(nvl, "omask"); nvlist_destroy(nvl); From owner-svn-src-all@freebsd.org Sat Feb 17 12:32:54 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6C16EF0906D; Sat, 17 Feb 2018 12:32:54 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 20DC37B7B0; Sat, 17 Feb 2018 12:32:54 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1BC811CBF8; Sat, 17 Feb 2018 12:32:54 +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 w1HCWr5G002234; Sat, 17 Feb 2018 12:32:53 GMT (envelope-from oshogbo@FreeBSD.org) Received: (from oshogbo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1HCWr8N002233; Sat, 17 Feb 2018 12:32:53 GMT (envelope-from oshogbo@FreeBSD.org) Message-Id: <201802171232.w1HCWr8N002233@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: oshogbo set sender to oshogbo@FreeBSD.org using -f From: Mariusz Zaborski Date: Sat, 17 Feb 2018 12:32:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329453 - head/bin/uuidgen X-SVN-Group: head X-SVN-Commit-Author: oshogbo X-SVN-Commit-Paths: head/bin/uuidgen X-SVN-Commit-Revision: 329453 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Feb 2018 12:32:54 -0000 Author: oshogbo Date: Sat Feb 17 12:32:53 2018 New Revision: 329453 URL: https://svnweb.freebsd.org/changeset/base/329453 Log: Capsicumize uuidgen. Modified: head/bin/uuidgen/uuidgen.c Modified: head/bin/uuidgen/uuidgen.c ============================================================================== --- head/bin/uuidgen/uuidgen.c Sat Feb 17 12:22:29 2018 (r329452) +++ head/bin/uuidgen/uuidgen.c Sat Feb 17 12:32:53 2018 (r329453) @@ -28,6 +28,9 @@ #include __FBSDID("$FreeBSD$"); +#include + +#include #include #include #include @@ -79,6 +82,12 @@ main(int argc, char *argv[]) if (argc) usage(); + + caph_cache_catpages(); + if (caph_limit_stdio() < 0) + err(1, "Unable to limit stdio"); + if (cap_enter() < 0 && errno != ENOSYS) + err(1, "Unable to enter capability mode"); if (count == -1) count = 1; From owner-svn-src-all@freebsd.org Sat Feb 17 12:38:47 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6D7FDF097C9; Sat, 17 Feb 2018 12:38:47 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 15FAA7BC40; Sat, 17 Feb 2018 12:38:47 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0F23D1CC10; Sat, 17 Feb 2018 12:38:47 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1HCck27002748; Sat, 17 Feb 2018 12:38:46 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1HCckRK002747; Sat, 17 Feb 2018 12:38:46 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201802171238.w1HCckRK002747@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Sat, 17 Feb 2018 12:38:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329454 - head/sys/dev/usb X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/dev/usb X-SVN-Commit-Revision: 329454 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Feb 2018 12:38:47 -0000 Author: hselasky Date: Sat Feb 17 12:38:46 2018 New Revision: 329454 URL: https://svnweb.freebsd.org/changeset/base/329454 Log: Revert redundant parts of r329440 after recent devmatch(8) changes. Sponsored by: Mellanox Technologies Modified: head/sys/dev/usb/usb_hub.c Modified: head/sys/dev/usb/usb_hub.c ============================================================================== --- head/sys/dev/usb/usb_hub.c Sat Feb 17 12:32:53 2018 (r329453) +++ head/sys/dev/usb/usb_hub.c Sat Feb 17 12:38:46 2018 (r329454) @@ -1733,12 +1733,7 @@ uhub_child_pnpinfo_string(device_t parent, device_t ch } iface = usbd_get_iface(res.udev, res.iface_index); if (iface && iface->idesc) { - snprintf(buf, buflen, - "bus=usb " -#if USB_HAVE_UGEN - "device=%s " -#endif - "vendor=0x%04x product=0x%04x " + snprintf(buf, buflen, "vendor=0x%04x product=0x%04x " "devclass=0x%02x devsubclass=0x%02x " "devproto=0x%02x " "sernum=\"%s\" " @@ -1746,9 +1741,6 @@ uhub_child_pnpinfo_string(device_t parent, device_t ch "mode=%s " "intclass=0x%02x intsubclass=0x%02x " "intprotocol=0x%02x" "%s%s", -#if USB_HAVE_UGEN - res.udev->ugen_name, -#endif UGETW(res.udev->ddesc.idVendor), UGETW(res.udev->ddesc.idProduct), res.udev->ddesc.bDeviceClass, From owner-svn-src-all@freebsd.org Sat Feb 17 13:13:56 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9C5DBF0C63C; Sat, 17 Feb 2018 13:13:56 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4A2D97D5BF; Sat, 17 Feb 2018 13:13:56 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 448FB1D2DE; Sat, 17 Feb 2018 13:13:56 +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 w1HDDuQI022702; Sat, 17 Feb 2018 13:13:56 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1HDDuJl022701; Sat, 17 Feb 2018 13:13:56 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201802171313.w1HDDuJl022701@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Sat, 17 Feb 2018 13:13:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329455 - head/etc/devd X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/etc/devd X-SVN-Commit-Revision: 329455 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Feb 2018 13:13:56 -0000 Author: hselasky Date: Sat Feb 17 13:13:55 2018 New Revision: 329455 URL: https://svnweb.freebsd.org/changeset/base/329455 Log: Invoke devmatch rc.d script directly instead of depending on "service" which is installed in usr/sbin and might not be available at the time devd is started. Sponsored by: Mellanox Technologies Modified: head/etc/devd/devmatch.conf Modified: head/etc/devd/devmatch.conf ============================================================================== --- head/etc/devd/devmatch.conf Sat Feb 17 12:38:46 2018 (r329454) +++ head/etc/devd/devmatch.conf Sat Feb 17 13:13:55 2018 (r329455) @@ -9,7 +9,7 @@ # # Generic NOMATCH event nomatch 100 { - action "service devmatch start '?$_'"; + action "/etc/rc.d/devmatch start '?$_'"; }; # Add the following to devd.conf to prevent this from running: From owner-svn-src-all@freebsd.org Sat Feb 17 13:32:29 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C8A0CF0DFB1; Sat, 17 Feb 2018 13:32:29 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7E76C7E2A9; Sat, 17 Feb 2018 13:32:29 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 796B81D625; Sat, 17 Feb 2018 13:32:29 +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 w1HDWTnt032550; Sat, 17 Feb 2018 13:32:29 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1HDWTBr032549; Sat, 17 Feb 2018 13:32:29 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201802171332.w1HDWTBr032549@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Sat, 17 Feb 2018 13:32:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329456 - head/etc/rc.d X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/etc/rc.d X-SVN-Commit-Revision: 329456 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Feb 2018 13:32:29 -0000 Author: hselasky Date: Sat Feb 17 13:32:29 2018 New Revision: 329456 URL: https://svnweb.freebsd.org/changeset/base/329456 Log: Fix handling of "one_nomatch" shell variable to preserve its contents appearing as a single argument passed to devmatch(8). Don't depend on "sort" utility from usr/bin which might not be available when devd is started. Sponsored by: Mellanox Technologies Modified: head/etc/rc.d/devmatch Modified: head/etc/rc.d/devmatch ============================================================================== --- head/etc/rc.d/devmatch Sat Feb 17 13:13:55 2018 (r329455) +++ head/etc/rc.d/devmatch Sat Feb 17 13:32:29 2018 (r329456) @@ -37,13 +37,17 @@ desc="Use devmatch(8) to load kernel modules" start_cmd="${name}_start" stop_cmd=':' -[ -n "$2" ] && one_nomatch="-p '$2'" +one_nomatch="$2" devmatch_start() { local x - x=$(devmatch ${one_nomatch} | sort -u) + if [ -n "$one_nomatch" ]; then + x=$(devmatch -p "${one_nomatch}") + else + x=$(devmatch) + fi [ -n "$x" ] || return @@ -53,8 +57,8 @@ devmatch_start() # We also optimize against the false positives # or drivers that have symbolic links that # confuse devmatch by running it -n. - echo "Autoloading modules: ${x}" for m in ${x}; do + echo "Autoloading module: ${m}" kldload -n ${m} done } From owner-svn-src-all@freebsd.org Sat Feb 17 14:30:40 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6487DF133A5; Sat, 17 Feb 2018 14:30:40 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 09EBF814ED; Sat, 17 Feb 2018 14:30:40 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 04A381DE6F; Sat, 17 Feb 2018 14:30:40 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1HEUdvW059088; Sat, 17 Feb 2018 14:30:39 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1HEUdxO059087; Sat, 17 Feb 2018 14:30:39 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201802171430.w1HEUdxO059087@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sat, 17 Feb 2018 14:30:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329457 - head/stand/lua X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/stand/lua X-SVN-Commit-Revision: 329457 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Feb 2018 14:30:40 -0000 Author: kevans Date: Sat Feb 17 14:30:39 2018 New Revision: 329457 URL: https://svnweb.freebsd.org/changeset/base/329457 Log: stand/lua: dumpModules => lsModules rgrimes@ notes that this behavior is more befitting of the latter name than the former, and I'm inclined to agree. Reported by: rgrimes Modified: head/stand/lua/config.lua Modified: head/stand/lua/config.lua ============================================================================== --- head/stand/lua/config.lua Sat Feb 17 13:32:29 2018 (r329456) +++ head/stand/lua/config.lua Sat Feb 17 14:30:39 2018 (r329457) @@ -37,7 +37,7 @@ function config.setKey(k, n, v) modules[k][n] = v; end -function config.dumpModules() +function config.lsModules() print("== Dumping modules"); for k, v in pairs(modules) do print(k, v.load); From owner-svn-src-all@freebsd.org Sat Feb 17 14:34:48 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4AD13F1392A; Sat, 17 Feb 2018 14:34:48 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C940F8192E; Sat, 17 Feb 2018 14:34:47 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AAD431DFF3; Sat, 17 Feb 2018 14:34:47 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1HEYlYU063604; Sat, 17 Feb 2018 14:34:47 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1HEYl8I063603; Sat, 17 Feb 2018 14:34:47 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201802171434.w1HEYl8I063603@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Sat, 17 Feb 2018 14:34:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329458 - head/sbin/devmatch X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sbin/devmatch X-SVN-Commit-Revision: 329458 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Feb 2018 14:34:48 -0000 Author: hselasky Date: Sat Feb 17 14:34:47 2018 New Revision: 329458 URL: https://svnweb.freebsd.org/changeset/base/329458 Log: Fix USB driver matching in devmatch(8). Multiple drivers can match on the same USB device and the order of loading decides which driver gets the device. Use the supplied mask value as an indication of priority, so that vendor specific device drivers are loaded before more generic ones. Sponsored by: Mellanox Technologies Modified: head/sbin/devmatch/devmatch.c Modified: head/sbin/devmatch/devmatch.c ============================================================================== --- head/sbin/devmatch/devmatch.c Sat Feb 17 14:30:39 2018 (r329457) +++ head/sbin/devmatch/devmatch.c Sat Feb 17 14:34:47 2018 (r329458) @@ -54,6 +54,14 @@ static struct option longopts[] = { { NULL, 0, NULL, 0 } }; +#define DEVMATCH_MAX_HITS 256 + +static struct match_data { + char *descr; + int priority; +} match_data[DEVMATCH_MAX_HITS]; + +static int hit_index; static int all_flag; static int dump_flag; static char *linker_hints; @@ -236,6 +244,35 @@ pnpval_as_str(const char *val, const char *pnpinfo) return retval; } +static int +match_data_compare(const void *_pa, const void *_pb) +{ + const struct match_data *pa = _pa; + const struct match_data *pb = _pb; + + /* biggest value first */ + if (pa->priority > pb->priority) + return (-1); + else if (pa->priority < pb->priority) + return (1); + + /* then sort by string */ + return (strcmp(pa->descr, pb->descr)); +} + +static int +bitrev16(int input) +{ + int retval = 0; + int x; + + for (x = 0; x != 16; x++) { + if ((input >> x) & 1) + retval |= (0x8000 >> x); + } + return (retval); +} + static void search_hints(const char *bus, const char *dev, const char *pnpinfo) { @@ -367,9 +404,20 @@ search_hints(const char *bus, const char *dev, const c printf("\n"); else if (!notme) { if (!unbound_flag) { + char *descr = NULL; + if (all_flag) - printf("%s: ", *dev ? dev : "unattached" ); - printf("%s\n", lastmod); + asprintf(&descr, "%s: %s", *dev ? dev : "unattached", lastmod); + else + asprintf(&descr, "%s", lastmod); + + if (descr != NULL && hit_index < DEVMATCH_MAX_HITS) { + match_data[hit_index].descr = descr; + match_data[hit_index].priority = bitrev16(mask); + hit_index++; + } else { + free(descr); + } } found++; } @@ -382,6 +430,19 @@ search_hints(const char *bus, const char *dev, const c } walker = (void *)(len - sizeof(int) + (intptr_t)walker); } + if (hit_index != 0) { + /* sort hits by priority */ + mergesort(match_data, hit_index, sizeof(match_data[0]), &match_data_compare); + + /* printout */ + for (i = 0; i != hit_index; i++) { + puts(match_data[i].descr); + free(match_data[i].descr); + } + + /* reset hit_index */ + hit_index = 0; + } if (unbound_flag && found == 0 && *pnpinfo) { if (verbose_flag) printf("------------------------- "); From owner-svn-src-all@freebsd.org Sat Feb 17 14:39:40 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7E6EBF13EFB; Sat, 17 Feb 2018 14:39:40 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D2BFA81C98; Sat, 17 Feb 2018 14:39:39 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id w1HEdZec068049; Sat, 17 Feb 2018 06:39:35 -0800 (PST) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id w1HEdZD5068048; Sat, 17 Feb 2018 06:39:35 -0800 (PST) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201802171439.w1HEdZD5068048@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r329457 - head/stand/lua In-Reply-To: <201802171430.w1HEUdxO059087@repo.freebsd.org> To: Kyle Evans Date: Sat, 17 Feb 2018 06:39:35 -0800 (PST) CC: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Feb 2018 14:39:40 -0000 [ Charset UTF-8 unsupported, converting... ] > Author: kevans > Date: Sat Feb 17 14:30:39 2018 > New Revision: 329457 > URL: https://svnweb.freebsd.org/changeset/base/329457 > > Log: > stand/lua: dumpModules => lsModules > > rgrimes@ notes that this behavior is more befitting of the latter name than > the former, and I'm inclined to agree. > > Reported by: rgrimes > > Modified: > head/stand/lua/config.lua > > Modified: head/stand/lua/config.lua > ============================================================================== > --- head/stand/lua/config.lua Sat Feb 17 13:32:29 2018 (r329456) > +++ head/stand/lua/config.lua Sat Feb 17 14:30:39 2018 (r329457) > @@ -37,7 +37,7 @@ function config.setKey(k, n, v) > modules[k][n] = v; > end > > -function config.dumpModules() > +function config.lsModules() > print("== Dumping modules"); ^^^^^^^ I was more after this word :) > for k, v in pairs(modules) do > print(k, v.load); > > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Sat Feb 17 14:40:29 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5B9FAF1405C; Sat, 17 Feb 2018 14:40:29 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DBB9481E51; Sat, 17 Feb 2018 14:40:28 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BD8FB1DFFC; Sat, 17 Feb 2018 14:40:28 +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 w1HEeSZt063860; Sat, 17 Feb 2018 14:40:28 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1HEeShX063859; Sat, 17 Feb 2018 14:40:28 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201802171440.w1HEeShX063859@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Sat, 17 Feb 2018 14:40:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329459 - head/tools/tools/bus_autoconf X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/tools/tools/bus_autoconf X-SVN-Commit-Revision: 329459 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Feb 2018 14:40:29 -0000 Author: hselasky Date: Sat Feb 17 14:40:28 2018 New Revision: 329459 URL: https://svnweb.freebsd.org/changeset/base/329459 Log: Remove obsolete tool, bus_autoconf, which is replaced by devmatch(8). Deleted: head/tools/tools/bus_autoconf/ From owner-svn-src-all@freebsd.org Sat Feb 17 14:44:04 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D2664F14665; Sat, 17 Feb 2018 14:44:03 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 74D9082377; Sat, 17 Feb 2018 14:44:03 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6FBA11E18B; Sat, 17 Feb 2018 14:44:03 +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 w1HEi3tD068586; Sat, 17 Feb 2018 14:44:03 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1HEi3sb068585; Sat, 17 Feb 2018 14:44:03 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201802171444.w1HEi3sb068585@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Sat, 17 Feb 2018 14:44:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329460 - head/sys/dev/usb X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/dev/usb X-SVN-Commit-Revision: 329460 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Feb 2018 14:44:04 -0000 Author: hselasky Date: Sat Feb 17 14:44:03 2018 New Revision: 329460 URL: https://svnweb.freebsd.org/changeset/base/329460 Log: Remove unused bus_autoconf section from usb.ko. Sponsored by: Mellanox Technologies Modified: head/sys/dev/usb/usb_lookup.c Modified: head/sys/dev/usb/usb_lookup.c ============================================================================== --- head/sys/dev/usb/usb_lookup.c Sat Feb 17 14:40:28 2018 (r329459) +++ head/sys/dev/usb/usb_lookup.c Sat Feb 17 14:44:03 2018 (r329460) @@ -153,70 +153,3 @@ usbd_lookup_id_by_uaa(const struct usb_device_id *id, return (ENXIO); } -/*------------------------------------------------------------------------* - * Export the USB device ID format we use to userspace tools. - *------------------------------------------------------------------------*/ -#if BYTE_ORDER == LITTLE_ENDIAN -#define U16_XOR "0" -#else -#define U16_XOR "8" -#endif - -#if defined(KLD_MODULE) && (USB_HAVE_ID_SECTION != 0) -static const char __section("bus_autoconf_format") __used usb_id_format[] = { - - /* Declare that three different sections use the same format */ - - "usb_host_id{256,:}" - "usb_device_id{256,:}" - "usb_dual_id{256,:}" - - /* List size of fields in the usb_device_id structure */ - - "mf_vendor{" U16_XOR ",1}" - "mf_product{" U16_XOR ",1}" - "mf_dev_lo{" U16_XOR ",1}" - "mf_dev_hi{" U16_XOR ",1}" - - "mf_dev_class{" U16_XOR ",1}" - "mf_dev_subclass{" U16_XOR ",1}" - "mf_dev_protocol{" U16_XOR ",1}" - "mf_int_class{" U16_XOR ",1}" - - "mf_int_subclass{" U16_XOR ",1}" - "mf_int_protocol{" U16_XOR ",1}" - "unused{" U16_XOR ",6}" - - "idVendor[0]{" U16_XOR ",8}" - "idVendor[1]{" U16_XOR ",8}" - "idProduct[0]{" U16_XOR ",8}" - "idProduct[1]{" U16_XOR ",8}" - "bcdDevice_lo[0]{" U16_XOR ",8}" - "bcdDevice_lo[1]{" U16_XOR ",8}" - "bcdDevice_hi[0]{" U16_XOR ",8}" - "bcdDevice_hi[1]{" U16_XOR ",8}" - - "bDeviceClass{0,8}" - "bDeviceSubClass{0,8}" - "bDeviceProtocol{0,8}" - "bInterfaceClass{0,8}" - "bInterfaceSubClass{0,8}" - "bInterfaceProtocol{0,8}" - -#if USB_HAVE_COMPAT_LINUX - "mfl_vendor{" U16_XOR ",1}" - "mfl_product{" U16_XOR ",1}" - "mfl_dev_lo{" U16_XOR ",1}" - "mfl_dev_hi{" U16_XOR ",1}" - - "mfl_dev_class{" U16_XOR ",1}" - "mfl_dev_subclass{" U16_XOR ",1}" - "mfl_dev_protocol{" U16_XOR ",1}" - "mfl_int_class{" U16_XOR ",1}" - - "mfl_int_subclass{" U16_XOR ",1}" - "mfl_int_protocol{" U16_XOR ",1}" - "unused{" U16_XOR ",6}" -#endif -}; -#endif From owner-svn-src-all@freebsd.org Sat Feb 17 14:51:19 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9C2F6F150E0 for ; Sat, 17 Feb 2018 14:51:19 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-it0-x22b.google.com (mail-it0-x22b.google.com [IPv6:2607:f8b0:4001:c0b::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 2AB8482889 for ; Sat, 17 Feb 2018 14:51:19 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-it0-x22b.google.com with SMTP id q4so118832itc.0 for ; Sat, 17 Feb 2018 06:51:19 -0800 (PST) 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=cwaRtWSoAVVjPN0apSZw3BueDlMQEhsHkdGk2mtQXL8=; b=Z1NdCGZ+bum2Tv/ny3P6IpOU2dy359KAmhvrhGGvxJ4OXlgp+CZw93UhPxJZLd58dT qTDoHBn2lIyWxGGYCAIpOkKUdZJCmQBEsU/tzE3WhpBr5U6mv9P65aku304IkhbQHg5C udjJtE5fCGIZv70XKsN2b8nGHAestDJjM8UAM1Joyxl47f2Rx8uH/zRzdwegWKSxz3Il KYR2ogWAbp1fYPLnjiiwJajPlz0XBU8O21jNMqaYrwR7KOAMaib62HQzpIJs4m4kgzj0 95ZSJAZ6EBG3m/a95Nfgh6gFhGV2ASQkHXFy7pQk1GbIz5UnVN5eBjLRgtAjT9lumLXS ZZmg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=cwaRtWSoAVVjPN0apSZw3BueDlMQEhsHkdGk2mtQXL8=; b=CUsly/GOc2hSLc1He1PuvKX1+M3TrBXyq2Fp4G3xXpfCsX4CTAzn2FgW2xw3b6Oifi m8VmYWT6XCeVJSPU/M9sOq3UIgScpY5qkN/EZBDKfygmYeNMPDnLbuI8efty36HXtDlc g7E1iMxVjn+zXGp/OzSvE86aJbn+df6ZsOanv9ZO7QSEMcsUXVRGwDdOJR9wA/7PGaLa +V0cI9Dledt/VStDACptUVRE84tUgMu3ZokW3UMKHbnRvryUl/cFd5DczPcgwGcBgGug XSNchcyW4kfn0raq4w8SSO7EZVsUAc2KxFqSbsOhS0cM6mdxb/dMs0LIuOXnORZ64zkF RXeQ== X-Gm-Message-State: APf1xPAXFzwgLb6xQPkewNn4bT5KYF919wYd1rPBIt4IXMT0K15wEpK+ FN+s0yVmujsqakg9d/AJQXeOyGlFW5X7n4J6oKD6YQ== X-Google-Smtp-Source: AH8x224SCPu2/P0kYL8K0Hm3jiwbDpefXF0XInIGYiiNU2v40q4GMP6yeT2+wC+21oPBSqDdtIamD5G5oYFNzZqCl54= X-Received: by 10.36.55.146 with SMTP id r140mr2041246itr.57.1518879078348; Sat, 17 Feb 2018 06:51:18 -0800 (PST) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.201.67 with HTTP; Sat, 17 Feb 2018 06:51:17 -0800 (PST) X-Originating-IP: [50.253.99.174] In-Reply-To: <201802171332.w1HDWTBr032549@repo.freebsd.org> References: <201802171332.w1HDWTBr032549@repo.freebsd.org> From: Warner Losh Date: Sat, 17 Feb 2018 07:51:17 -0700 X-Google-Sender-Auth: VQZyN5U8XCZvczbpnUcAcee1FAw Message-ID: Subject: Re: svn commit: r329456 - head/etc/rc.d To: Hans Petter Selasky Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.25 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Feb 2018 14:51:19 -0000 On Sat, Feb 17, 2018 at 6:32 AM, Hans Petter Selasky wrote: > Author: hselasky > Date: Sat Feb 17 13:32:29 2018 > New Revision: 329456 > URL: https://svnweb.freebsd.org/changeset/base/329456 > > Log: > Fix handling of "one_nomatch" shell variable to preserve its contents > appearing as a single argument passed to devmatch(8). > > Don't depend on "sort" utility from usr/bin which might not be > available when devd is started. > It's more the unique part than the sort part since otherwise we try to load things a large number of times. I'd preferred if you'd talked to me about a non-urgent change like this (split / and /usr is broken already and there's a few other places that are also a problem) Warner > Sponsored by: Mellanox Technologies > > Modified: > head/etc/rc.d/devmatch > > Modified: head/etc/rc.d/devmatch > ============================================================ > ================== > --- head/etc/rc.d/devmatch Sat Feb 17 13:13:55 2018 (r329455) > +++ head/etc/rc.d/devmatch Sat Feb 17 13:32:29 2018 (r329456) > @@ -37,13 +37,17 @@ desc="Use devmatch(8) to load kernel modules" > > start_cmd="${name}_start" > stop_cmd=':' > -[ -n "$2" ] && one_nomatch="-p '$2'" > +one_nomatch="$2" > > devmatch_start() > { > local x > > - x=$(devmatch ${one_nomatch} | sort -u) > + if [ -n "$one_nomatch" ]; then > + x=$(devmatch -p "${one_nomatch}") > + else > + x=$(devmatch) > + fi > > [ -n "$x" ] || return > > @@ -53,8 +57,8 @@ devmatch_start() > # We also optimize against the false positives > # or drivers that have symbolic links that > # confuse devmatch by running it -n. > - echo "Autoloading modules: ${x}" > for m in ${x}; do > + echo "Autoloading module: ${m}" > kldload -n ${m} > done > } > > From owner-svn-src-all@freebsd.org Sat Feb 17 14:56:53 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E36F8F157DD for ; Sat, 17 Feb 2018 14:56:52 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-it0-x22c.google.com (mail-it0-x22c.google.com [IPv6:2607:f8b0:4001:c0b::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 7768082D05 for ; Sat, 17 Feb 2018 14:56:52 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-it0-x22c.google.com with SMTP id l129so622784ita.3 for ; Sat, 17 Feb 2018 06:56:52 -0800 (PST) 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=u3PsktKgGY5ryCcKThv4IR2sx4sBfgihGaOkFI0iwrA=; b=Q1GkrQ399PB02SiGHoN7RokUnMpMsFUaMxWN5x0VlOiZ1Enq3nwaVFC4WxJk8JMp+A Lk5N+HPtVsCTiQmtgFnoiZNxin/QbMKtlkh+1lM0iJEkiyxDevxBs1S6FBTjKizFEtSo lTNM2HTBNowjrdrmgcK/uaMDf91+5Mnn7bfKGEAzSYC2DMEqDmirsmx+p0iu75Qdy9Jj m7w/z87FQxR03Mk9urxP6gSudsA6x+lAtFNm7UPrIJKneVqBeUeDrhMnL0T1tTk1MP7u CdUmgXqbvTJrBqxP4PeemRmGNSsI25EcZ62aSj8EtShdCpM0MmD99Hs4XFovBG3+rxtY rwqg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=u3PsktKgGY5ryCcKThv4IR2sx4sBfgihGaOkFI0iwrA=; b=kVKZzfmhzQ6w8fbmWwHuabVSb0+A1GaBP7yyMdGltJu/PW1v7SJIJteZ0ueFQiiocv khHV38IvWyR1Uo+whArQmNqA2oNe8EzHIl/KT14u3mdHGubMkq/GJD9RVt2yfcOmKJ1+ RGCCndcnroOvrmQy7QvG9rKb8RHxtMQSM880yiQnywRxiuRkHGbJSKDvGTSMZPHrfEOn +95UhbEPWNeqIxgwCS2S1nWiTuwsELc1XTGFnDvtQ/C1jS5HBkKos4RYeN5uWZezyXaU hTIEjEG3zEy1WCT+y3IPJXIQR4Sa6llnXSNWij7ukFo6Btgudihxh1FgaVRruOvhh7dO 8LcQ== X-Gm-Message-State: APf1xPCKQWEAiq3elW+mwnj6LssrMxa17nQJuPab+MPdCz41n20OOc2m rHNDScPhnLKPNW+iFIvub5NGeYByNbHwi0tz3GedEw== X-Google-Smtp-Source: AH8x226AT6BkfOobeyleVuiPVPCaU0chWd9UUwPrnn3Mi9Zs7+ul8qUHrECOSKyffxMTmKHXjE6f1SSKHYu6QtBxzcw= X-Received: by 10.36.55.146 with SMTP id r140mr2056292itr.57.1518879411848; Sat, 17 Feb 2018 06:56:51 -0800 (PST) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.201.67 with HTTP; Sat, 17 Feb 2018 06:56:51 -0800 (PST) X-Originating-IP: [50.253.99.174] In-Reply-To: <201802171434.w1HEYl8I063603@repo.freebsd.org> References: <201802171434.w1HEYl8I063603@repo.freebsd.org> From: Warner Losh Date: Sat, 17 Feb 2018 07:56:51 -0700 X-Google-Sender-Auth: JBVwTcgFx5DKgx9VhCDB_wSnW-I Message-ID: Subject: Re: svn commit: r329458 - head/sbin/devmatch To: Hans Petter Selasky Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.25 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Feb 2018 14:56:53 -0000 On Sat, Feb 17, 2018 at 7:34 AM, Hans Petter Selasky wrote: > Author: hselasky > Date: Sat Feb 17 14:34:47 2018 > New Revision: 329458 > URL: https://svnweb.freebsd.org/changeset/base/329458 > > Log: > Fix USB driver matching in devmatch(8). > > Multiple drivers can match on the same USB device and the order of > loading > decides which driver gets the device. Use the supplied mask value as an > indication of priority, so that vendor specific device drivers are loaded > before more generic ones. > This change isn't right. I mean, it might cause the special case of USB to get the driver you want loaded, but using the MASK this way is wrong. It's fixing the wrong problem. devmatch can't know who the winners will be and has to recommend all the drivers to load and those drivers have to cope with that. The right fix there, I think, is to load them all at once, in one kldload operation and not loop in /etc/rc.d/devmatch. I'd request you make no further changes to devmatch without a review. Warner > > Sponsored by: Mellanox Technologies > > Modified: > head/sbin/devmatch/devmatch.c > > Modified: head/sbin/devmatch/devmatch.c > ============================================================ > ================== > --- head/sbin/devmatch/devmatch.c Sat Feb 17 14:30:39 2018 > (r329457) > +++ head/sbin/devmatch/devmatch.c Sat Feb 17 14:34:47 2018 > (r329458) > @@ -54,6 +54,14 @@ static struct option longopts[] = { > { NULL, 0, NULL, 0 } > }; > > +#define DEVMATCH_MAX_HITS 256 > + > +static struct match_data { > + char *descr; > + int priority; > +} match_data[DEVMATCH_MAX_HITS]; > + > +static int hit_index; > static int all_flag; > static int dump_flag; > static char *linker_hints; > @@ -236,6 +244,35 @@ pnpval_as_str(const char *val, const char *pnpinfo) > return retval; > } > > +static int > +match_data_compare(const void *_pa, const void *_pb) > +{ > + const struct match_data *pa = _pa; > + const struct match_data *pb = _pb; > + > + /* biggest value first */ > + if (pa->priority > pb->priority) > + return (-1); > + else if (pa->priority < pb->priority) > + return (1); > + > + /* then sort by string */ > + return (strcmp(pa->descr, pb->descr)); > +} > + > +static int > +bitrev16(int input) > +{ > + int retval = 0; > + int x; > + > + for (x = 0; x != 16; x++) { > + if ((input >> x) & 1) > + retval |= (0x8000 >> x); > + } > + return (retval); > +} > + > static void > search_hints(const char *bus, const char *dev, const char *pnpinfo) > { > @@ -367,9 +404,20 @@ search_hints(const char *bus, const char *dev, const c > printf("\n"); > else if (!notme) { > if (!unbound_flag) { > + char *descr = NULL; > + > if (all_flag) > - printf("%s: ", > *dev ? dev : "unattached" ); > - printf("%s\n", lastmod); > + asprintf(&descr, > "%s: %s", *dev ? dev : "unattached", lastmod); > + else > + asprintf(&descr, > "%s", lastmod); > + > + if (descr != NULL && > hit_index < DEVMATCH_MAX_HITS) { > + > match_data[hit_index].descr = descr; > + > match_data[hit_index].priority = bitrev16(mask); > + hit_index++; > + } else { > + free(descr); > + } > } > found++; > } > @@ -382,6 +430,19 @@ search_hints(const char *bus, const char *dev, const c > } > walker = (void *)(len - sizeof(int) + (intptr_t)walker); > } > + if (hit_index != 0) { > + /* sort hits by priority */ > + mergesort(match_data, hit_index, sizeof(match_data[0]), > &match_data_compare); > + > + /* printout */ > + for (i = 0; i != hit_index; i++) { > + puts(match_data[i].descr); > + free(match_data[i].descr); > + } > + > + /* reset hit_index */ > + hit_index = 0; > + } > if (unbound_flag && found == 0 && *pnpinfo) { > if (verbose_flag) > printf("------------------------- "); > > From owner-svn-src-all@freebsd.org Sat Feb 17 14:59:13 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BD542F15B51; Sat, 17 Feb 2018 14:59:13 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (turbocat.net [88.99.82.50]) (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 599FF82F64; Sat, 17 Feb 2018 14:59:13 +0000 (UTC) (envelope-from hps@selasky.org) Received: from hps2016.home.selasky.org (unknown [62.141.128.70]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id E783726027E; Sat, 17 Feb 2018 15:59:11 +0100 (CET) Subject: Re: svn commit: r329456 - head/etc/rc.d To: Warner Losh Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201802171332.w1HDWTBr032549@repo.freebsd.org> From: Hans Petter Selasky Message-ID: Date: Sat, 17 Feb 2018 15:56:15 +0100 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Feb 2018 14:59:13 -0000 On 02/17/18 15:51, Warner Losh wrote: > It's more the unique part than the sort part since otherwise we try to load > things a large number of times. > I'd preferred if you'd talked to me about a non-urgent change like this > (split / and /usr is broken already and there's a few other places that are > also a problem) This needs to be handled inside devmatch. USB cannot use this sorting at all. --HPS From owner-svn-src-all@freebsd.org Sat Feb 17 15:01:26 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CBD75F15E7F; Sat, 17 Feb 2018 15:01:26 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (turbocat.net [IPv6:2a01:4f8:c17:6c4b::2]) (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 6C4838334A; Sat, 17 Feb 2018 15:01:26 +0000 (UTC) (envelope-from hps@selasky.org) Received: from hps2016.home.selasky.org (unknown [62.141.128.70]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 5C68226027E; Sat, 17 Feb 2018 16:01:25 +0100 (CET) Subject: Re: svn commit: r329458 - head/sbin/devmatch To: Warner Losh Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201802171434.w1HEYl8I063603@repo.freebsd.org> From: Hans Petter Selasky Message-ID: <5b49c102-ad07-cfdb-2e45-e27cee99ee81@selasky.org> Date: Sat, 17 Feb 2018 15:58:29 +0100 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Feb 2018 15:01:27 -0000 On 02/17/18 15:56, Warner Losh wrote: > I'd request you make no further changes to devmatch without a review. I don't have a problem with that. You can see now what changes are needed. Please make sure you test with real USB devices! Some people are using FreeBSD-current on desktops, and the USB auto-load feature has been broken for almost a week now. --HPS From owner-svn-src-all@freebsd.org Sat Feb 17 15:02:12 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DCDA9F16137; Sat, 17 Feb 2018 15:02:11 +0000 (UTC) (envelope-from byond.lenox@gmail.com) Received: from mail-lf0-f43.google.com (mail-lf0-f43.google.com [209.85.215.43]) (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 31AFE8359F; Sat, 17 Feb 2018 15:02:10 +0000 (UTC) (envelope-from byond.lenox@gmail.com) Received: by mail-lf0-f43.google.com with SMTP id f137so7705410lfe.4; Sat, 17 Feb 2018 07:02:10 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=eLkoXLAi8i+56rbZPNHGbvYi8vt8xvk8s4LzVje2YJA=; b=QApZxyIZBlw082I8wVZAVQorRZj+3rH/1HII7cN8mmu+lM0Wgqs0C82nCfKbuXodzw +AOkD4/V0ATImMhO/uXBha3Jjshdnq6WZT1XKks4WwbQYvpLuR+zp0clK951MnLgvYZX 8nnU5YCE6UrKdgUMzIRvpOAzLqBBf22TKYa/IZy9RdOl/bNOsPAWaVNSYmvkN4xKT6qS 215OHDzn/S4i5G0NZXPl+ow7N8eb4KqLq7qK3xbtXqlsWFIUMM3VqOqAb6Ql0jVvNvr9 3uVC6I/jjpdlLwT274ycVnRzavTH4DzE0+h52ybu69cZ2PMDt1mp44BRRPlGIZN3ciZp VGIQ== X-Gm-Message-State: APf1xPBeoEP6airBZ+zNjSq9uHaWAWAPiaIbl34RyXrUskQ81yN5kgCc VqHFGNVwsPudn9hNOlKiEkN/8vFU X-Google-Smtp-Source: AH8x224/+BVlhpnnYXoag2fsi2tgAh73HDG7l7uCBWq3rIrd09K0IsD+Uv6fidAwVfxPSNYaQkcqHg== X-Received: by 10.46.73.81 with SMTP id b17mr6696870ljd.122.1518879729119; Sat, 17 Feb 2018 07:02:09 -0800 (PST) Received: from mail-lf0-f51.google.com (mail-lf0-f51.google.com. [209.85.215.51]) by smtp.gmail.com with ESMTPSA id b27sm2775018ljb.84.2018.02.17.07.02.08 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 17 Feb 2018 07:02:08 -0800 (PST) Received: by mail-lf0-f51.google.com with SMTP id q69so7691061lfi.10; Sat, 17 Feb 2018 07:02:08 -0800 (PST) X-Received: by 10.46.44.8 with SMTP id s8mr6109234ljs.51.1518879728640; Sat, 17 Feb 2018 07:02:08 -0800 (PST) MIME-Version: 1.0 Received: by 10.46.106.8 with HTTP; Sat, 17 Feb 2018 07:02:07 -0800 (PST) Received: by 10.46.106.8 with HTTP; Sat, 17 Feb 2018 07:02:07 -0800 (PST) In-Reply-To: References: <201802171430.w1HEUdxO059087@repo.freebsd.org> <201802171439.w1HEdZD5068048@pdx.rh.CN85.dnsmgr.net> From: Kyle Evans Date: Sat, 17 Feb 2018 09:02:07 -0600 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r329457 - head/stand/lua To: rgrimes@freebsd.org Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.25 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Feb 2018 15:02:12 -0000 On Feb 17, 2018 8:39 AM, "Rodney W. Grimes" wrote: [ Charset UTF-8 unsupported, converting... ] > Author: kevans > Date: Sat Feb 17 14:30:39 2018 > New Revision: 329457 > URL: https://svnweb.freebsd.org/changeset/base/329457 > > Log: > stand/lua: dumpModules => lsModules > > rgrimes@ notes that this behavior is more befitting of the latter name than > the former, and I'm inclined to agree. > > Reported by: rgrimes > > Modified: > head/stand/lua/config.lua > > Modified: head/stand/lua/config.lua > ============================================================ ================== > --- head/stand/lua/config.lua Sat Feb 17 13:32:29 2018 (r329456) > +++ head/stand/lua/config.lua Sat Feb 17 14:30:39 2018 (r329457) > @@ -37,7 +37,7 @@ function config.setKey(k, n, v) > modules[k][n] = v; > end > > -function config.dumpModules() > +function config.lsModules() > print("== Dumping modules"); ^^^^^^^ I was more after this word :) > for k, v in pairs(modules) do > print(k, v.load); > > (apologies for the broken quoting, no longer near a reasonable mail client) Feel free to change it- I personally believe it's pretty obvious from the context once you see this message that these things are being dumped out to the console. It wasn't necessarily obvious from the name of the function that this was the case. Either way, this is purely a debugging aide while I was trying to figure out why it wasn't loading modules on kernel change. I don't really care much about the output as long as it still tells me just as much as it does now. As an aside, for anyone interested that reads this far, it's still handling module_path wrong but in a more subtle way. Every kernel change prepends the kernel path to module_path, and we keep building on this. Eventually you'd end up with: "/boot/kernel.GENERIC;/boot/kernel;..." So it may fallback to another kernel path for modules that may or may not match the current kernel version. From owner-svn-src-all@freebsd.org Sat Feb 17 15:03:25 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9028AF163F1 for ; Sat, 17 Feb 2018 15:03:25 +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 E0D2C83840 for ; Sat, 17 Feb 2018 15:03:24 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-it0-x232.google.com with SMTP id l187so5006610ith.4 for ; Sat, 17 Feb 2018 07:03:24 -0800 (PST) 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=BxAZITJeqJHICqdMt4RlDcQvYbYDcVlHyQf5Wvkeczw=; b=jj1mQJBA5Pjt/c6goUwfOe6Yj6oqNBkHDfG808W76u+hqawO4KLewftspO5x9AJ0qp GT+m1vxO0m0DAebXmGi3u4FJrka5f5JcG4eZpBb7ZOqDm2oT25q5RBujTL8xCJEObgFH ag3DZF898TApD8XgsDAzUc6HjCLKY85znyiG7v5Eyc8v1jD/OWTadqfb9Rume5XqsJCP cB70JmSABqRNMmy0NYXdcXOiaEnzaOGY9w8iQCAQx//RdV3haD4Am2vFW0iT8GR9NJB9 1eEsAmm0JzrBXXZ5lJqg1zWvSOJt7DfPU8gxvS58oOqaKbIVtuqohyMmGzi3SawZ0PyN DH7Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=BxAZITJeqJHICqdMt4RlDcQvYbYDcVlHyQf5Wvkeczw=; b=qDNHYA1ZXE1Go+xdBLpVyvrVYmMGi48AOMxnXbJ23iMi+GKZmubOBlrsPiEgKnyXFs cFgjBz0wTs6g+XPIcDLX7H/L5W6sgO6YrkRa7L4DJxDKB3AcUQx1/u6Geilpb5ZSQXxM cqigS8Pws3pH60+SATMHNNHKAfaeaYX0VwQMacR45cMynGOojzSAZsoHi0JoL7TXOhg1 OD+1XjS1YmYgQ/sAwN3HiZwBozcTq07mQMTpeZNeMLO1AdJ77SStdOigUdwCLawIjh7W Io4pEYUd1V/jxDpDzRKzF5skQ0iBF7rQDL+XEHOvfCGKZPf2nGxsqTRuTNeV+h+l9xPN 7E+w== X-Gm-Message-State: APf1xPDz+H1e/u9nbmvJ+80kgRa/s+C8rC3pZ264xuKjvjENFuLkArIx i1dsybM26o+HVN8KOYQovl/NmNNHJ/hrEC3B+sQkSA== X-Google-Smtp-Source: AH8x225EHhM7atIEIfvSNqWtjDj6WQ7/qF72uVn3L9gCaxh01RUJ3JBkGonUDZqzNGfkxfJDsFyg74OafuSZt9YNIQM= X-Received: by 10.36.111.4 with SMTP id x4mr4560122itb.51.1518879804217; Sat, 17 Feb 2018 07:03:24 -0800 (PST) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.201.67 with HTTP; Sat, 17 Feb 2018 07:03:23 -0800 (PST) X-Originating-IP: [50.253.99.174] In-Reply-To: References: <201802171332.w1HDWTBr032549@repo.freebsd.org> From: Warner Losh Date: Sat, 17 Feb 2018 08:03:23 -0700 X-Google-Sender-Auth: 6cibwcfC1xmEf5p6bK5PmkcbtMI Message-ID: Subject: Re: svn commit: r329456 - head/etc/rc.d To: Hans Petter Selasky Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.25 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Feb 2018 15:03:25 -0000 On Sat, Feb 17, 2018 at 7:56 AM, Hans Petter Selasky wrote: > On 02/17/18 15:51, Warner Losh wrote: > >> It's more the unique part than the sort part since otherwise we try to >> load >> things a large number of times. >> I'd preferred if you'd talked to me about a non-urgent change like this >> (split / and /usr is broken already and there's a few other places that >> are >> also a problem) >> > > This needs to be handled inside devmatch. USB cannot use this sorting at > all. This sorting isn't for USB. This sorting is to uniquify the list of modules. so we don't pass ums.ko multiple times, for example. Warner From owner-svn-src-all@freebsd.org Sat Feb 17 15:07:04 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0F754F1692F; Sat, 17 Feb 2018 15:07:04 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (turbocat.net [IPv6:2a01:4f8:c17:6c4b::2]) (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 A112283ADF; Sat, 17 Feb 2018 15:07:03 +0000 (UTC) (envelope-from hps@selasky.org) Received: from hps2016.home.selasky.org (unknown [62.141.128.70]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id B3DDE26027E; Sat, 17 Feb 2018 16:07:01 +0100 (CET) Subject: Re: svn commit: r329458 - head/sbin/devmatch To: Warner Losh Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201802171434.w1HEYl8I063603@repo.freebsd.org> From: Hans Petter Selasky Message-ID: <90001804-e025-4981-6b77-350930310ceb@selasky.org> Date: Sat, 17 Feb 2018 16:04:05 +0100 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Feb 2018 15:07:04 -0000 On 02/17/18 15:56, Warner Losh wrote: > The right fix there, I think, is to load them all at once, in one kldload > operation and not loop in /etc/rc.d/devmatch. Each driver will invoke the driver loaded device method, so this will race aswell! You have a point. But, that means devmatch should read ahead the nomatch events until the end, to make sure the correct driver is loaded. For example if first a driver is loaded for a generic device, uhid, then comes a long a ums device, we have a problem this way. Matching should then understand how to reduce the hints, maybe by stripping down the "mask" from least significant bit. It is then important that the order from devmatch is not messed up by "sort -u". BTW: The "sort" utility lives in usr/bin and is not suitable for /etc/rc.d/devmatch, like already pointed out. --HPS From owner-svn-src-all@freebsd.org Sat Feb 17 15:07:34 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 21EC2F16A00 for ; Sat, 17 Feb 2018 15:07:34 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-it0-x230.google.com (mail-it0-x230.google.com [IPv6:2607:f8b0:4001:c0b::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 A52E583C24 for ; Sat, 17 Feb 2018 15:07:33 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-it0-x230.google.com with SMTP id y16so4893951itc.0 for ; Sat, 17 Feb 2018 07:07:33 -0800 (PST) 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=LMc55vynpfNpP2IZ03Giy9p/nvQTjNytGUd/ZaEoEqw=; b=LLFtguy5mU9HZM55Q5sGt205tcj2yV3gqhAuHG1D2MBK8a+9fjSE1BxQvGry6uVeBP UMwgAeyemzpBn4sGuieVq682L/AaALokKQcDK5NTYQFgv+B1Qx8VJy8THI2Y0RmhP/UC IPv0rdhkjB1z9YyuV2TBfINvuh/au8UfxAa9/tqwX+4d4Q4Dza21lo3DLGgHo3rnBwgK /bWaWQ8KEag3JvuvbHmNzvjq3gXYbA9mLGlYvbnim/OzMARjICyakhP6QT5DT2jn72r1 UkXJlm0bhNjhPVu1R4WwLchBA7Px03quba913uB8398KqLOJ0Cqq9lN3BD951+7NTcui uYbg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=LMc55vynpfNpP2IZ03Giy9p/nvQTjNytGUd/ZaEoEqw=; b=gOk1cMPWzLI7vBoWX6fTvRBucQ/wnbhMEh/Blr418iJoG9/KvLuY5tEVFrOR+qCvJa R0Xo86uUAUsGHlTbJ5FQKxqzfb7dZkpcX1IuAh5nBrphqLVwMxExgZHckSb3tsNH7boj M3lwgEjMXtdAXV9SfjJB12/GIaqWL5FFcJrjpIxdE8XvJggFbEKUs15DNxtSNzGEBpLh ifvXtBm10Wjt9B+iV22mVujqnyPCo1gz70h7jTC973LD3iiUpDWdrLCMRseFEprdKIu0 bFAlSnShMfhuCZYBtjNXT3jMMLX/RJcVnyhAj1rtfpAvArmFZZmM2iHb2Lj0U8+zsU9F wnkA== X-Gm-Message-State: APf1xPCR9AtuGZ3ZlArXkWR3A0P2aliKOHzaujieL3h5dI6xId5RPekH VuT6tbD2PLUDdr8rIi+xwIOhR3ZTP9PDAomLyDpF8g== X-Google-Smtp-Source: AH8x224lM9KpVMHHDudWZ6qwzekaHsDivuhJFusz2SaoEnz+sp9E3WEoRv/geacEaHaxr2fgDgbCIR9xGRyHZKpvrG0= X-Received: by 10.36.55.146 with SMTP id r140mr2101041itr.57.1518880053045; Sat, 17 Feb 2018 07:07:33 -0800 (PST) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.201.67 with HTTP; Sat, 17 Feb 2018 07:07:32 -0800 (PST) X-Originating-IP: [50.253.99.174] In-Reply-To: <5b49c102-ad07-cfdb-2e45-e27cee99ee81@selasky.org> References: <201802171434.w1HEYl8I063603@repo.freebsd.org> <5b49c102-ad07-cfdb-2e45-e27cee99ee81@selasky.org> From: Warner Losh Date: Sat, 17 Feb 2018 08:07:32 -0700 X-Google-Sender-Auth: dbe2BymbcSBsk2bhC3o3wvmXqvQ Message-ID: Subject: Re: svn commit: r329458 - head/sbin/devmatch To: Hans Petter Selasky Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.25 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Feb 2018 15:07:34 -0000 On Sat, Feb 17, 2018 at 7:58 AM, Hans Petter Selasky wrote: > On 02/17/18 15:56, Warner Losh wrote: > >> I'd request you make no further changes to devmatch without a review. >> > > I don't have a problem with that. > > You can see now what changes are needed. Please make sure you test with > real USB devices! Some people are using FreeBSD-current on desktops, and > the USB auto-load feature has been broken for almost a week now. (a) It's current (b) It took longer to sort out than I'd hoped (c) I tested with a keyboard and mouse on my main server. It was absolutely tested. Snide comments like this aren't helping my already grumpy mood over this. It would be more helpful if you could turn on devd's logging (by adding !devd *.>=info /var/log/devd.log to /etc/syslog.conf, restarting syslog and then giving me the exact scenario that's failing so I can add it to a test suite I'm writing. The data will be in /var/log/devd.log. I can't possibly test all the crazy USB scenarios with the hardware I have (there's too many of them), but I can test it in simulation and make sure we're good. The multiple driver matching thing was never ever mentioned in prior things, so getting snippy with me over it for not testing it is not helpful. Understanding what to look for will be helpful in making sure the test suites catch it and we fix the underlying issues. Warner From owner-svn-src-all@freebsd.org Sat Feb 17 15:12:24 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 08196F1725C for ; Sat, 17 Feb 2018 15:12:24 +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 8E55A842D1 for ; Sat, 17 Feb 2018 15:12:23 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-io0-x235.google.com with SMTP id e7so7109670ioj.1 for ; Sat, 17 Feb 2018 07:12:23 -0800 (PST) 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=eL3Kz0HerEfMD5H+It9BSbYYKpI+rbgQl99P8Hr8bqY=; b=pVu4YJas5WrVA4btfTSYgFWt16SZ4x5ECf2YoG3RcJSuzSxXxCr4RFXL73koPFrMcG l5r62y+/5IKb53qJ+gbEaPT5fUGzhXeatW2dtTMhw9QyrU3p39qb0C/tMi0k8T8ZGBHy bGsYqBtZouqDNA0vL7xhczNSFKBfGkTgp3LEM7854Fu3NgUBsvgkHtaeDQcbrK00f1XM xBQNTsbeGrYiHZSf/AIwLydWxmJ//j0Y9kHCLoQ8jD/Xu5jCDcTU7NRoO1qkabEgyHuu FcGvE04sEIbcYaXdVbe4Ro3TDu3AphM9Yi0FzypJkXLHLPF6COzeP4WhefjFAfwCehXP ERJA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=eL3Kz0HerEfMD5H+It9BSbYYKpI+rbgQl99P8Hr8bqY=; b=KnOV7Drd7poyvvJEFeqzSmyf4o+og314Qzwzw1ba8TUCiEU0X+LmeayWZaMAA52a6H oQXPa6TPOPVSiJEqo93JCc007aunXp1dZ72gu/EAIhU0iMPECWFQlcg7+HK8FDCwmKsD l1V5Vhn2G0COjWP90DqHnYuuvKk3DVNIl97L/2clDkt4f+lUdG4x8bJ4JTzQc4MUbfCl Y0tFQ4NQR8GaxUQEFxaeyUovwE7zKkmOmCW7qTjr50O6HAf29PDZETgaWMVdOwLA88Oh e32azMPvC6m7tYquF98bjkRYC5LbHRTloLelUia9xFETm9B0JocP7BYRvx9bqB0o8Ehb ZW/Q== X-Gm-Message-State: APf1xPDEQKT1NBDJKsXApzI8oXv6HNj9Be3cSO9dmrxZk6XXxrEr+M3k gzhvhHTWwV0J2TS0QZP6tkLzn18yzRXQH0YjP/Namg== X-Google-Smtp-Source: AH8x224qZMWytFLCXMV823xwEgYETVfx83SKh3fYqPw7rpDVG0Bl2B5CTWCjntond0rWmR0nSnMFGDNq5VAMc5P2Ma4= X-Received: by 10.107.2.6 with SMTP id 6mr12683267ioc.117.1518880342865; Sat, 17 Feb 2018 07:12:22 -0800 (PST) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.201.67 with HTTP; Sat, 17 Feb 2018 07:12:22 -0800 (PST) X-Originating-IP: [50.253.99.174] In-Reply-To: <90001804-e025-4981-6b77-350930310ceb@selasky.org> References: <201802171434.w1HEYl8I063603@repo.freebsd.org> <90001804-e025-4981-6b77-350930310ceb@selasky.org> From: Warner Losh Date: Sat, 17 Feb 2018 08:12:22 -0700 X-Google-Sender-Auth: qdT5KU7L_ZNyhFULPFKW_XN4spg Message-ID: Subject: Re: svn commit: r329458 - head/sbin/devmatch To: Hans Petter Selasky Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.25 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Feb 2018 15:12:24 -0000 On Sat, Feb 17, 2018 at 8:04 AM, Hans Petter Selasky wrote: > On 02/17/18 15:56, Warner Losh wrote: > >> The right fix there, I think, is to load them all at once, in one kldload >> operation and not loop in /etc/rc.d/devmatch. >> > > Each driver will invoke the driver loaded device method, so this will race > aswell! > > You have a point. But, that means devmatch should read ahead the nomatch > events until the end, to make sure the correct driver is loaded. > We could batch them in the kernel. But that's still unsatisfying since there could still be other races because multiple drivers wanting the same device is well defined only when all the drivers are there at probe/attach time. > For example if first a driver is loaded for a generic device, uhid, then > comes a long a ums device, we have a problem this way. > That makes sense. We likely need to enhance our device model to cope with drivers arriving after a device is attached so this isn't racy. Matching should then understand how to reduce the hints, maybe by stripping > down the "mask" from least significant bit. > > It is then important that the order from devmatch is not messed up by > "sort -u". > No, devmatch is necessarily unordered. We can't reliably use the match like you say. It simply will not work. devmatch has no way of knowing (the mask isn't a viable way) who will win. There must be some other method invented. > BTW: The "sort" utility lives in usr/bin and is not suitable for > /etc/rc.d/devmatch, like already pointed out. Yes. I know that. Continuing to belabor the obvious won't help make me less grumpy. Warner From owner-svn-src-all@freebsd.org Sat Feb 17 15:19:58 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7158DF17DEC; Sat, 17 Feb 2018 15:19:58 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (turbocat.net [IPv6:2a01:4f8:c17:6c4b::2]) (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 13E5E849E7; Sat, 17 Feb 2018 15:19:58 +0000 (UTC) (envelope-from hps@selasky.org) Received: from hps2016.home.selasky.org (unknown [62.141.128.70]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 0067326027E; Sat, 17 Feb 2018 16:19:56 +0100 (CET) Subject: Re: svn commit: r329458 - head/sbin/devmatch To: Warner Losh Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201802171434.w1HEYl8I063603@repo.freebsd.org> <5b49c102-ad07-cfdb-2e45-e27cee99ee81@selasky.org> From: Hans Petter Selasky Message-ID: Date: Sat, 17 Feb 2018 16:17:00 +0100 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Feb 2018 15:19:58 -0000 On 02/17/18 16:07, Warner Losh wrote: > It would be more helpful if you could turn on devd's logging (by adding > !devd > *.>=info /var/log/devd.log > to /etc/syslog.conf, restarting syslog and then giving me the exact > scenario that's failing so I can add it to a test suite I'm writing. The > data will be in /var/log/devd.log. I can't possibly test all the crazy USB > scenarios with the hardware I have (there's too many of them), but I can > test it in simulation and make sure we're good. It wasn't a problem with devd. It was a problem with /etc/rc.d/devmatch . In your initial devmatch rc.d, look at this: one_nomatch="-p '$2'" devmatch ${one_nomatch} Try this (your initial devmatch): #!/bin/sh test='? at bus=0 hubaddr=1 port=6 devaddr=8 interface=1 ugen=ugen0.8 vendor=0x8087 product=0x0a2b devclass=0xe0 devsubclass=0x01 devproto=0x01 release=0x0001 mode=host intclass=0xe0 intsubclass=0x01 intprotocol=0x01 on uhub0' one_nomatch="-p '$test'" devmatch ${one_nomatch} I fixed it to this, which works: #!/bin/sh test='? at bus=0 hubaddr=1 port=6 devaddr=8 interface=1 ugen=ugen0.8 vendor=0x8087 product=0x0a2b devclass=0xe0 devsubclass=0x01 devproto=0x01 release=0x0001 mode=host intclass=0xe0 intsubclass=0x01 intprotocol=0x01 on uhub0' one_nomatch="$test" devmatch -p "${one_nomatch}" Because the $2 variable already contains ''s from devd, the variable expansion then makes devmatch receive the whole devd generated variable list like a separate arguments. Which leads me to believe you are not using /bin/sh or you tested something different than was committed ?? --HPS From owner-svn-src-all@freebsd.org Sat Feb 17 15:24:29 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7DD94F1855B; Sat, 17 Feb 2018 15:24:29 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (turbocat.net [IPv6:2a01:4f8:c17:6c4b::2]) (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 1DA6C84FDC; Sat, 17 Feb 2018 15:24:29 +0000 (UTC) (envelope-from hps@selasky.org) Received: from hps2016.home.selasky.org (unknown [62.141.128.70]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id E943426027E; Sat, 17 Feb 2018 16:24:27 +0100 (CET) Subject: Re: svn commit: r329458 - head/sbin/devmatch To: Warner Losh Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201802171434.w1HEYl8I063603@repo.freebsd.org> <90001804-e025-4981-6b77-350930310ceb@selasky.org> From: Hans Petter Selasky Message-ID: <099dcc61-e018-54b2-cd52-074a2c74e5c1@selasky.org> Date: Sat, 17 Feb 2018 16:21:31 +0100 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Feb 2018 15:24:29 -0000 On 02/17/18 16:12, Warner Losh wrote: > Yes. I know that. Continuing to belabor the obvious won't help make me less > grumpy. I'm sorry about that. Implementing a generic solution to match drivers and devices seems more complicated than at first thought :-) OK, I will say away from *devmatch* and discuss with you first. --HPS From owner-svn-src-all@freebsd.org Sat Feb 17 16:07:08 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6AE4BF1BF78; Sat, 17 Feb 2018 16:07:08 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: from mail-qk0-x235.google.com (mail-qk0-x235.google.com [IPv6:2607:f8b0:400d:c09::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 045E087075; Sat, 17 Feb 2018 16:07:08 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: by mail-qk0-x235.google.com with SMTP id s198so7482909qke.5; Sat, 17 Feb 2018 08:07:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=8myZr/uqljKLWmMNym+YWvpvLj1ff3EOYXzQLOs3wyo=; b=RMirQ4r7W+Q5Zma6jeDnbH0c2MBUm/S5oQKYsE0cj6H6Swcf1aWpqzqLiWiINKJ2ir UFsdrg6OkijUaVejcaahqZ5jpdrQpInjC2y3qfDfRzPSv7NIXodpQXcpyQkIDvwTz/WZ xX6XhhqGJxwCFeqE9oYde0iVCjFrGYZAfVX698AM7AanhfH68UUAyLN/ZHUj7npM8ZCp 9FCbA5x9DL9EdKR/Vyysda1SgCdqlAW27yd5UlYOESgomjj6hPn942JVMw+KPmiKlj3D DbmAD9JMN5/IPdKLsm52sqLHZR9uqJPtDbx5s0arhGDuvdDkKWzak1VdRZ29ZNaOHDq2 7/FA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=8myZr/uqljKLWmMNym+YWvpvLj1ff3EOYXzQLOs3wyo=; b=MgEOCPaaoENYr6JvTxIu2TW6co4b8CsgY6yk3FI0IVZR8hYKV8AnT/c0a/5X06URTH ocV2QX22hCuMqFB6tdhi0JM0VMkdKHDsJTan18+829Dfqh46Lf+wU7C7XgeBrRLB/FdB VNimOpwc5am78r+DAmZkbC8kTIMz2CoxoL9ozNUH2jaSYmPcwXo0r6qisxuhaJxdd6En DpD5/0+mai7IJTHGhBesuovmhl5jeE0sHWXz0JEVqUDkUYQmDdmHPSCrOVsqpYbY5WE1 aHo4o7RUZvD+Vo7nXye5uhLih/KL0kez61AYrjJFHfF3YHIOml0QXSX2h70jFTWQYyzL Vd0g== X-Gm-Message-State: APf1xPCOf3SXNenMTdTEo9c/o0NriljRtkXollahn8C3RfkH1W77/man SByOCqzOmxIdS2SELX/gVzN7Wil3G0WhFEHlPwrNPA== X-Google-Smtp-Source: AH8x225G34vMYbt0DgWgvukbr1M3Sa54Yi1C8495DmUFWm/BdYigTy/I+I2P+fT+AziA0LvFbS4SSm0pNjuvFwsMCJk= X-Received: by 10.55.22.144 with SMTP id 16mr14774785qkw.11.1518883627554; Sat, 17 Feb 2018 08:07:07 -0800 (PST) MIME-Version: 1.0 Received: by 10.237.58.99 with HTTP; Sat, 17 Feb 2018 08:07:07 -0800 (PST) In-Reply-To: <20180217112738.GO94212@kib.kiev.ua> References: <201802170848.w1H8mkfb081764@repo.freebsd.org> <20180217112738.GO94212@kib.kiev.ua> From: Mateusz Guzik Date: Sat, 17 Feb 2018 17:07:07 +0100 Message-ID: Subject: Re: svn commit: r329448 - head/sys/kern To: Konstantin Belousov Cc: Mateusz Guzik , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.25 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Feb 2018 16:07:08 -0000 On Sat, Feb 17, 2018 at 01:27:38PM +0200, Konstantin Belousov wrote: > On Sat, Feb 17, 2018 at 08:48:46AM +0000, Mateusz Guzik wrote: > > Author: mjg > > Date: Sat Feb 17 08:48:45 2018 > > New Revision: 329448 > > URL: https://svnweb.freebsd.org/changeset/base/329448 > > > > Log: > > exit: get rid of PROC_SLOCK when checking a process to report > Was this tested ? > I was trussing multithreaded microbenchmarks, no issues. > In particular, are you aware of r309539 ? > So it looks like I misread the code - I have grepped thread_suspend_switch operating with the proc locked and misread thread_suspend_one's assert as PROC_LOCK_ASSERT. That said, I think this is harmless. Regardless of the lock the inspecting thread can race and check "too soon". Even for a case where it decides to report, I don't see anything which would depend on the suspending thread to finish. However, locking can be employed in a way which is avoided in the common case: diff --git a/sys/kern/kern_exit.c b/sys/kern/kern_exit.c index b063bda5b7ff..4ae24bcd7059 100644 --- a/sys/kern/kern_exit.c +++ b/sys/kern/kern_exit.c @@ -1174,6 +1174,7 @@ kern_wait6(struct thread *td, idtype_t idtype, id_t id, int *status, struct proc *p, *q; pid_t pid; int error, nfound, ret; + bool report; AUDIT_ARG_VALUE((int)idtype); /* XXX - This is likely wrong! */ AUDIT_ARG_PID((pid_t)id); /* XXX - This may be wrong! */ @@ -1226,27 +1227,36 @@ kern_wait6(struct thread *td, idtype_t idtype, id_t id, int *status, PROC_LOCK_ASSERT(p, MA_OWNED); if ((options & WTRAPPED) != 0 && - (p->p_flag & P_TRACED) != 0 && - (p->p_flag & (P_STOPPED_TRACE | P_STOPPED_SIG)) != 0 && - p->p_suspcount == p->p_numthreads && - (p->p_flag & P_WAITED) == 0) { + (p->p_flag & P_TRACED) != 0) { + PROC_SLOCK(p); + report = + ((p->p_flag & (P_STOPPED_TRACE | P_STOPPED_SIG)) && + p->p_suspcount == p->p_numthreads && + (p->p_flag & P_WAITED) == 0); + PROC_SUNLOCK(p); + if (report) { CTR4(KTR_PTRACE, "wait: returning trapped pid %d status %#x " "(xstat %d) xthread %d", p->p_pid, W_STOPCODE(p->p_xsig), p->p_xsig, p->p_xthread != NULL ? p->p_xthread->td_tid : -1); - report_alive_proc(td, p, siginfo, status, options, - CLD_TRAPPED); - return (0); + report_alive_proc(td, p, siginfo, status, + options, CLD_TRAPPED); + return (0); + } } if ((options & WUNTRACED) != 0 && - (p->p_flag & P_STOPPED_SIG) != 0 && - p->p_suspcount == p->p_numthreads && - (p->p_flag & P_WAITED) == 0) { - report_alive_proc(td, p, siginfo, status, options, + report_alive_proc(td, p, siginfo, status, + options, CLD_TRAPPED); + return (0); + } } if ((options & WUNTRACED) != 0 && - (p->p_flag & P_STOPPED_SIG) != 0 && - p->p_suspcount == p->p_numthreads && - (p->p_flag & P_WAITED) == 0) { - report_alive_proc(td, p, siginfo, status, options, - CLD_STOPPED); - return (0); + (p->p_flag & P_STOPPED_SIG) != 0) { + PROC_SLOCK(p); + report = (p->p_suspcount == p->p_numthreads && + ((p->p_flag & P_WAITED) == 0)); + PROC_SUNLOCK(p); + if (report) { + report_alive_proc(td, p, siginfo, status, + options, CLD_STOPPED); + return (0); + } } if ((options & WCONTINUED) != 0 && (p->p_flag & P_CONTINUED) != 0) { On Sat, Feb 17, 2018 at 12:27 PM, Konstantin Belousov wrote: > On Sat, Feb 17, 2018 at 08:48:46AM +0000, Mateusz Guzik wrote: > > Author: mjg > > Date: Sat Feb 17 08:48:45 2018 > > New Revision: 329448 > > URL: https://svnweb.freebsd.org/changeset/base/329448 > > > > Log: > > exit: get rid of PROC_SLOCK when checking a process to report > Was this tested ? > > In particular, are you aware of r309539 ? > > > > > All accessed fields are protected with already held process lock. > > > > Modified: > > head/sys/kern/kern_exit.c > > > > Modified: head/sys/kern/kern_exit.c > > ============================================================ > ================== > > --- head/sys/kern/kern_exit.c Sat Feb 17 08:12:35 2018 (r329447) > > +++ head/sys/kern/kern_exit.c Sat Feb 17 08:48:45 2018 (r329448) > > @@ -1228,15 +1228,11 @@ loop_locked: > > nfound++; > > PROC_LOCK_ASSERT(p, MA_OWNED); > > > > - if ((options & (WTRAPPED | WUNTRACED)) != 0) > > - PROC_SLOCK(p); > > - > > if ((options & WTRAPPED) != 0 && > > (p->p_flag & P_TRACED) != 0 && > > (p->p_flag & (P_STOPPED_TRACE | P_STOPPED_SIG)) != 0 && > > p->p_suspcount == p->p_numthreads && > > (p->p_flag & P_WAITED) == 0) { > > - PROC_SUNLOCK(p); > > CTR4(KTR_PTRACE, > > "wait: returning trapped pid %d status %#x " > > "(xstat %d) xthread %d", > > @@ -1251,13 +1247,10 @@ loop_locked: > > (p->p_flag & P_STOPPED_SIG) != 0 && > > p->p_suspcount == p->p_numthreads && > > (p->p_flag & P_WAITED) == 0) { > > - PROC_SUNLOCK(p); > > report_alive_proc(td, p, siginfo, status, options, > > CLD_STOPPED); > > return (0); > > } > > - if ((options & (WTRAPPED | WUNTRACED)) != 0) > > - PROC_SUNLOCK(p); > > if ((options & WCONTINUED) != 0 && > > (p->p_flag & P_CONTINUED) != 0) { > > report_alive_proc(td, p, siginfo, status, options, > -- Mateusz Guzik From owner-svn-src-all@freebsd.org Sat Feb 17 16:26:44 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C7360F1D77F; Sat, 17 Feb 2018 16:26:44 +0000 (UTC) (envelope-from kib@freebsd.org) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (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 51AAA87CE3; Sat, 17 Feb 2018 16:26:44 +0000 (UTC) (envelope-from kib@freebsd.org) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id w1HGQWZx063679 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Sat, 17 Feb 2018 18:26:35 +0200 (EET) (envelope-from kib@freebsd.org) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua w1HGQWZx063679 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id w1HGQW2f063678; Sat, 17 Feb 2018 18:26:32 +0200 (EET) (envelope-from kib@freebsd.org) X-Authentication-Warning: tom.home: kostik set sender to kib@freebsd.org using -f Date: Sat, 17 Feb 2018 18:26:32 +0200 From: Konstantin Belousov To: Mateusz Guzik , peter@holm.cc Cc: Mateusz Guzik , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r329448 - head/sys/kern Message-ID: <20180217162632.GQ94212@kib.kiev.ua> References: <201802170848.w1H8mkfb081764@repo.freebsd.org> <20180217112738.GO94212@kib.kiev.ua> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.3 (2018-01-21) X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00 autolearn=ham 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Feb 2018 16:26:45 -0000 On Sat, Feb 17, 2018 at 05:07:07PM +0100, Mateusz Guzik wrote: > On Sat, Feb 17, 2018 at 01:27:38PM +0200, Konstantin Belousov wrote: > > On Sat, Feb 17, 2018 at 08:48:46AM +0000, Mateusz Guzik wrote: > > > Author: mjg > > > Date: Sat Feb 17 08:48:45 2018 > > > New Revision: 329448 > > > URL: https://svnweb.freebsd.org/changeset/base/329448 > > > > > > Log: > > > exit: get rid of PROC_SLOCK when checking a process to report > > Was this tested ? > > > > I was trussing multithreaded microbenchmarks, no issues. > > > In particular, are you aware of r309539 ? > > > > So it looks like I misread the code - I have grepped > thread_suspend_switch operating with the proc locked and misread > thread_suspend_one's assert as PROC_LOCK_ASSERT. > > That said, I think this is harmless. Regardless of the lock the > inspecting thread can race and check "too soon". Even for a case where > it decides to report, I don't see anything which would depend on the > suspending thread to finish. It was definitely not harmless when I tried to avoid the spin lock there, but I do not remember exact failure mode. Most likely, it was a missed report of the traced child indeed, but I am not sure that truss triggered it. Most likely, Peter Holm was the reporter, since he is listed in the commit. > > However, locking can be employed in a way which is avoided in the common > case: > > diff --git a/sys/kern/kern_exit.c b/sys/kern/kern_exit.c > index b063bda5b7ff..4ae24bcd7059 100644 > --- a/sys/kern/kern_exit.c > +++ b/sys/kern/kern_exit.c > @@ -1174,6 +1174,7 @@ kern_wait6(struct thread *td, idtype_t idtype, id_t > id, int *status, > struct proc *p, *q; > pid_t pid; > int error, nfound, ret; > + bool report; > > AUDIT_ARG_VALUE((int)idtype); /* XXX - This is likely wrong! */ > AUDIT_ARG_PID((pid_t)id); /* XXX - This may be wrong! */ > @@ -1226,27 +1227,36 @@ kern_wait6(struct thread *td, idtype_t idtype, id_t > id, int *status, > PROC_LOCK_ASSERT(p, MA_OWNED); > > if ((options & WTRAPPED) != 0 && > - (p->p_flag & P_TRACED) != 0 && > - (p->p_flag & (P_STOPPED_TRACE | P_STOPPED_SIG)) != 0 && > - p->p_suspcount == p->p_numthreads && > - (p->p_flag & P_WAITED) == 0) { > + (p->p_flag & P_TRACED) != 0) { > + PROC_SLOCK(p); > + report = > + ((p->p_flag & (P_STOPPED_TRACE | > P_STOPPED_SIG)) && > + p->p_suspcount == p->p_numthreads && > + (p->p_flag & P_WAITED) == 0); > + PROC_SUNLOCK(p); > + if (report) { > CTR4(KTR_PTRACE, > "wait: returning trapped pid %d status %#x " > "(xstat %d) xthread %d", > p->p_pid, W_STOPCODE(p->p_xsig), p->p_xsig, > p->p_xthread != NULL ? > p->p_xthread->td_tid : -1); > - report_alive_proc(td, p, siginfo, status, options, > - CLD_TRAPPED); > - return (0); > + report_alive_proc(td, p, siginfo, status, > + options, CLD_TRAPPED); > + return (0); > + } > } > if ((options & WUNTRACED) != 0 && > - (p->p_flag & P_STOPPED_SIG) != 0 && > - p->p_suspcount == p->p_numthreads && > - (p->p_flag & P_WAITED) == 0) { > - report_alive_proc(td, p, siginfo, status, options, > + report_alive_proc(td, p, siginfo, status, > + options, CLD_TRAPPED); > + return (0); > + } > } > if ((options & WUNTRACED) != 0 && > - (p->p_flag & P_STOPPED_SIG) != 0 && > - p->p_suspcount == p->p_numthreads && > - (p->p_flag & P_WAITED) == 0) { > - report_alive_proc(td, p, siginfo, status, options, > - CLD_STOPPED); > - return (0); > + (p->p_flag & P_STOPPED_SIG) != 0) { > + PROC_SLOCK(p); > + report = (p->p_suspcount == p->p_numthreads && > + ((p->p_flag & P_WAITED) == 0)); > + PROC_SUNLOCK(p); > + if (report) { > + report_alive_proc(td, p, siginfo, status, > + options, CLD_STOPPED); > + return (0); > + } > } > if ((options & WCONTINUED) != 0 && > (p->p_flag & P_CONTINUED) != 0) { > If this works, I am fine with the patch. Still, I would prefer to have the original commit reverted for now, until the fix is tested. Then, commit updated patch. From owner-svn-src-all@freebsd.org Sat Feb 17 16:38:33 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2DAF8F1E680; Sat, 17 Feb 2018 16:38:33 +0000 (UTC) (envelope-from pho@holm.cc) Received: from relay01.pair.com (relay01.pair.com [209.68.5.15]) (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 CFA5688491; Sat, 17 Feb 2018 16:38:32 +0000 (UTC) (envelope-from pho@holm.cc) Received: from x2.osted.lan (87-58-223-204-dynamic.dk.customer.tdc.net [87.58.223.204]) by relay01.pair.com (Postfix) with ESMTP id 75228D00377; Sat, 17 Feb 2018 11:38:25 -0500 (EST) Received: from x2.osted.lan (localhost [127.0.0.1]) by x2.osted.lan (8.14.9/8.14.9) with ESMTP id w1HGcM9h081691 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Sat, 17 Feb 2018 17:38:23 +0100 (CET) (envelope-from pho@x2.osted.lan) Received: (from pho@localhost) by x2.osted.lan (8.14.9/8.14.9/Submit) id w1HGcMx3081690; Sat, 17 Feb 2018 17:38:22 +0100 (CET) (envelope-from pho) Date: Sat, 17 Feb 2018 17:38:22 +0100 From: Peter Holm To: Konstantin Belousov Cc: Mateusz Guzik , Mateusz Guzik , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r329448 - head/sys/kern Message-ID: <20180217163822.GA81555@x2.osted.lan> References: <201802170848.w1H8mkfb081764@repo.freebsd.org> <20180217112738.GO94212@kib.kiev.ua> <20180217162632.GQ94212@kib.kiev.ua> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180217162632.GQ94212@kib.kiev.ua> User-Agent: Mutt/1.5.23 (2014-03-12) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Feb 2018 16:38:33 -0000 On Sat, Feb 17, 2018 at 06:26:32PM +0200, Konstantin Belousov wrote: > On Sat, Feb 17, 2018 at 05:07:07PM +0100, Mateusz Guzik wrote: > > On Sat, Feb 17, 2018 at 01:27:38PM +0200, Konstantin Belousov wrote: > > > On Sat, Feb 17, 2018 at 08:48:46AM +0000, Mateusz Guzik wrote: > > > > Author: mjg > > > > Date: Sat Feb 17 08:48:45 2018 > > > > New Revision: 329448 > > > > URL: https://svnweb.freebsd.org/changeset/base/329448 > > > > > > > > Log: > > > > exit: get rid of PROC_SLOCK when checking a process to report > > > Was this tested ? > > > > > > > I was trussing multithreaded microbenchmarks, no issues. > > > > > In particular, are you aware of r309539 ? > > > > > > > So it looks like I misread the code - I have grepped > > thread_suspend_switch operating with the proc locked and misread > > thread_suspend_one's assert as PROC_LOCK_ASSERT. > > > > That said, I think this is harmless. Regardless of the lock the > > inspecting thread can race and check "too soon". Even for a case where > > it decides to report, I don't see anything which would depend on the > > suspending thread to finish. > It was definitely not harmless when I tried to avoid the spin lock there, > but I do not remember exact failure mode. Most likely, it was a missed > report of the traced child indeed, but I am not sure that truss triggered > it. Most likely, Peter Holm was the reporter, since he is listed in > the commit. > I ran a truss(1) test on r329456 and it fails. I have not had a chance to look closer at this, but this is what I see: [root@mercat1 /home/pho]# pgrep truss | xargs ps -Hlp UID PID PPID CPU PRI NI VSZ RSS MWCHAN STAT TT TIME COMMAND 0 41149 41118 0 52 0 11532 2588 wait I 0 0:01.38 truss /tmp/ttruss 10 0 41151 41149 0 52 0 13156 2300 - TX 0 0:00.98 /tmp/ttruss 10 0 41151 41149 0 52 0 13156 2300 - TX 0 0:00.00 /tmp/ttruss 10 [root@mercat1 /home/pho]# procstat -k 41151 PID TID COMM TDNAME KSTACK 41151 100211 ttruss - mi_switch thread_suspend_switch ptracestop amd64_syscall fast_syscall_common 41151 100765 ttruss - mi_switch thread_suspend_check ast doreti_ast [root@mercat1 /home/pho]# > > > > However, locking can be employed in a way which is avoided in the common > > case: > > > > diff --git a/sys/kern/kern_exit.c b/sys/kern/kern_exit.c > > index b063bda5b7ff..4ae24bcd7059 100644 > > --- a/sys/kern/kern_exit.c > > +++ b/sys/kern/kern_exit.c > > @@ -1174,6 +1174,7 @@ kern_wait6(struct thread *td, idtype_t idtype, id_t > > id, int *status, > > struct proc *p, *q; > > pid_t pid; > > int error, nfound, ret; > > + bool report; > > > > AUDIT_ARG_VALUE((int)idtype); /* XXX - This is likely wrong! */ > > AUDIT_ARG_PID((pid_t)id); /* XXX - This may be wrong! */ > > @@ -1226,27 +1227,36 @@ kern_wait6(struct thread *td, idtype_t idtype, id_t > > id, int *status, > > PROC_LOCK_ASSERT(p, MA_OWNED); > > > > if ((options & WTRAPPED) != 0 && > > - (p->p_flag & P_TRACED) != 0 && > > - (p->p_flag & (P_STOPPED_TRACE | P_STOPPED_SIG)) != 0 && > > - p->p_suspcount == p->p_numthreads && > > - (p->p_flag & P_WAITED) == 0) { > > + (p->p_flag & P_TRACED) != 0) { > > + PROC_SLOCK(p); > > + report = > > + ((p->p_flag & (P_STOPPED_TRACE | > > P_STOPPED_SIG)) && > > + p->p_suspcount == p->p_numthreads && > > + (p->p_flag & P_WAITED) == 0); > > + PROC_SUNLOCK(p); > > + if (report) { > > CTR4(KTR_PTRACE, > > "wait: returning trapped pid %d status %#x " > > "(xstat %d) xthread %d", > > p->p_pid, W_STOPCODE(p->p_xsig), p->p_xsig, > > p->p_xthread != NULL ? > > p->p_xthread->td_tid : -1); > > - report_alive_proc(td, p, siginfo, status, options, > > - CLD_TRAPPED); > > - return (0); > > + report_alive_proc(td, p, siginfo, status, > > + options, CLD_TRAPPED); > > + return (0); > > + } > > } > > if ((options & WUNTRACED) != 0 && > > - (p->p_flag & P_STOPPED_SIG) != 0 && > > - p->p_suspcount == p->p_numthreads && > > - (p->p_flag & P_WAITED) == 0) { > > - report_alive_proc(td, p, siginfo, status, options, > > + report_alive_proc(td, p, siginfo, status, > > + options, CLD_TRAPPED); > > + return (0); > > + } > > } > > if ((options & WUNTRACED) != 0 && > > - (p->p_flag & P_STOPPED_SIG) != 0 && > > - p->p_suspcount == p->p_numthreads && > > - (p->p_flag & P_WAITED) == 0) { > > - report_alive_proc(td, p, siginfo, status, options, > > - CLD_STOPPED); > > - return (0); > > + (p->p_flag & P_STOPPED_SIG) != 0) { > > + PROC_SLOCK(p); > > + report = (p->p_suspcount == p->p_numthreads && > > + ((p->p_flag & P_WAITED) == 0)); > > + PROC_SUNLOCK(p); > > + if (report) { > > + report_alive_proc(td, p, siginfo, status, > > + options, CLD_STOPPED); > > + return (0); > > + } > > } > > if ((options & WCONTINUED) != 0 && > > (p->p_flag & P_CONTINUED) != 0) { > > > If this works, I am fine with the patch. Still, I would prefer to have > the original commit reverted for now, until the fix is tested. Then, > commit updated patch. -- Peter From owner-svn-src-all@freebsd.org Sat Feb 17 17:23:44 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EEC5AF21D87; Sat, 17 Feb 2018 17:23:43 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A2E3B8A399; Sat, 17 Feb 2018 17:23:43 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9DD2B1FB8A; Sat, 17 Feb 2018 17:23:43 +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 w1HHNhwh048329; Sat, 17 Feb 2018 17:23:43 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1HHNhHV048328; Sat, 17 Feb 2018 17:23:43 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201802171723.w1HHNhHV048328@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Sat, 17 Feb 2018 17:23:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329461 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 329461 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Feb 2018 17:23:44 -0000 Author: mjg Date: Sat Feb 17 17:23:43 2018 New Revision: 329461 URL: https://svnweb.freebsd.org/changeset/base/329461 Log: Revert r329448. Turns out is is actually racy, reproducible with stress2/misc/truss.sh Requested by: kib Modified: head/sys/kern/kern_exit.c Modified: head/sys/kern/kern_exit.c ============================================================================== --- head/sys/kern/kern_exit.c Sat Feb 17 14:44:03 2018 (r329460) +++ head/sys/kern/kern_exit.c Sat Feb 17 17:23:43 2018 (r329461) @@ -1225,11 +1225,15 @@ loop_locked: nfound++; PROC_LOCK_ASSERT(p, MA_OWNED); + if ((options & (WTRAPPED | WUNTRACED)) != 0) + PROC_SLOCK(p); + if ((options & WTRAPPED) != 0 && (p->p_flag & P_TRACED) != 0 && (p->p_flag & (P_STOPPED_TRACE | P_STOPPED_SIG)) != 0 && p->p_suspcount == p->p_numthreads && (p->p_flag & P_WAITED) == 0) { + PROC_SUNLOCK(p); CTR4(KTR_PTRACE, "wait: returning trapped pid %d status %#x " "(xstat %d) xthread %d", @@ -1244,10 +1248,13 @@ loop_locked: (p->p_flag & P_STOPPED_SIG) != 0 && p->p_suspcount == p->p_numthreads && (p->p_flag & P_WAITED) == 0) { + PROC_SUNLOCK(p); report_alive_proc(td, p, siginfo, status, options, CLD_STOPPED); return (0); } + if ((options & (WTRAPPED | WUNTRACED)) != 0) + PROC_SUNLOCK(p); if ((options & WCONTINUED) != 0 && (p->p_flag & P_CONTINUED) != 0) { report_alive_proc(td, p, siginfo, status, options, From owner-svn-src-all@freebsd.org Sat Feb 17 17:34:35 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C5AEAF228D5; Sat, 17 Feb 2018 17:34:35 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: from mail-qt0-x244.google.com (mail-qt0-x244.google.com [IPv6:2607:f8b0:400d:c0d::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 660978AABE; Sat, 17 Feb 2018 17:34:35 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: by mail-qt0-x244.google.com with SMTP id f4so7606613qtj.6; Sat, 17 Feb 2018 09:34:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=SNk8loT5L613jMSozrtvnPdxxFvqJv1Z/FIBCsfWf8A=; b=IO2tu6sg7Yqi0JS4W8N+nsnGVHkdI0PHL7WWEMUuSJUVAFaPUwSI8Rcx+pozFofh3H tHBg6d3MMzy6CCatUijxUk2RghOt8akclnFFMv5frd3uMR/YWAPRxzVyq7eOMjq/sPj8 dIXcTGklm86p+ZlUEcjmj3+KZ9SHlywYC5b8YjATKLX07X2ZC8V94FZRNSfI4ossb7EZ q9O1m7V+7DoUHnrq49pwsGSaG7cniY3xOlrFTQpJQ97zfz1G/TAYEspm/3fnp0R+2NRM sL5ATV5Lv9f9+loH+LVA0TwERQsHTkc5il5o18vY696n87nCXLMUffe4viOdfkEoCslN 3xVg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=SNk8loT5L613jMSozrtvnPdxxFvqJv1Z/FIBCsfWf8A=; b=UAgoyT/sn3bdvLmd1Xj94BF3bColgKNikW4LIy1FNqWYHqpEPVsCXGA/tOdHyhTZ7q DgWzdOJQmReqmAO2y03dy123pxpqqD3fKn4I28un/knqtVBICcC7pK2FBY3rHbSZmUgB zchViRXJ6DeHR1u3JdV3nMjmTkj1n8M2lNDwzIuDk+xUgf+XrslimFWAdLxKc6k4zJRR eKFOzHmao0+XMrJ5X3lUjttUIdXkOaeLsBjfxrQdFdPfFxLsL90RSe2RwqmFXKN3zCHE CdMBrvgylaohWCgPyrhu+yoNbzp5ELu7Lt9vW5yOJpuPIC/lTN0stSWk4P6OrW7dtmXT wtjw== X-Gm-Message-State: APf1xPB/u+jLLmjFywNUO3ffCSJtvouZFKsXyImfcFZnxEAX6HRwtSk6 skarda+OyPVMEg2YDUUSCo1AZaaHMRPQtwjN/+ErQA== X-Google-Smtp-Source: AH8x224YYYcaYzeLHLuQvQVesAu8zrUj5V5bTE1+gIPkBZ7VHUH0Xr1d0skEzuDkqM9+H9B7XtmGcpzsmVhdeoV5uNE= X-Received: by 10.200.48.13 with SMTP id f13mr16239329qte.140.1518888874940; Sat, 17 Feb 2018 09:34:34 -0800 (PST) MIME-Version: 1.0 Received: by 10.237.58.99 with HTTP; Sat, 17 Feb 2018 09:34:34 -0800 (PST) In-Reply-To: <20180217163822.GA81555@x2.osted.lan> References: <201802170848.w1H8mkfb081764@repo.freebsd.org> <20180217112738.GO94212@kib.kiev.ua> <20180217162632.GQ94212@kib.kiev.ua> <20180217163822.GA81555@x2.osted.lan> From: Mateusz Guzik Date: Sat, 17 Feb 2018 18:34:34 +0100 Message-ID: Subject: Re: svn commit: r329448 - head/sys/kern To: Peter Holm Cc: Konstantin Belousov , Mateusz Guzik , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.25 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Feb 2018 17:34:36 -0000 On Sat, Feb 17, 2018 at 5:38 PM, Peter Holm wrote: > On Sat, Feb 17, 2018 at 06:26:32PM +0200, Konstantin Belousov wrote: > > On Sat, Feb 17, 2018 at 05:07:07PM +0100, Mateusz Guzik wrote: > > > On Sat, Feb 17, 2018 at 01:27:38PM +0200, Konstantin Belousov wrote: > > > > On Sat, Feb 17, 2018 at 08:48:46AM +0000, Mateusz Guzik wrote: > > > > > Author: mjg > > > > > Date: Sat Feb 17 08:48:45 2018 > > > > > New Revision: 329448 > > > > > URL: https://svnweb.freebsd.org/changeset/base/329448 > > > > > > > > > > Log: > > > > > exit: get rid of PROC_SLOCK when checking a process to report > > > > Was this tested ? > > > > > > > > > > I was trussing multithreaded microbenchmarks, no issues. > > > > > > > In particular, are you aware of r309539 ? > > > > > > > > > > So it looks like I misread the code - I have grepped > > > thread_suspend_switch operating with the proc locked and misread > > > thread_suspend_one's assert as PROC_LOCK_ASSERT. > > > > > > That said, I think this is harmless. Regardless of the lock the > > > inspecting thread can race and check "too soon". Even for a case where > > > it decides to report, I don't see anything which would depend on the > > > suspending thread to finish. > > It was definitely not harmless when I tried to avoid the spin lock there, > > but I do not remember exact failure mode. Most likely, it was a missed > > report of the traced child indeed, but I am not sure that truss triggered > > it. Most likely, Peter Holm was the reporter, since he is listed in > > the commit. > > > > I ran a truss(1) test on r329456 and it fails. I have not had a > chance to look closer at this, but this is what I see: > > [root@mercat1 /home/pho]# pgrep truss | xargs ps -Hlp > UID PID PPID CPU PRI NI VSZ RSS MWCHAN STAT TT TIME COMMAND > 0 41149 41118 0 52 0 11532 2588 wait I 0 0:01.38 truss > /tmp/ttruss 10 > 0 41151 41149 0 52 0 13156 2300 - TX 0 0:00.98 /tmp/ttruss > 10 > 0 41151 41149 0 52 0 13156 2300 - TX 0 0:00.00 /tmp/ttruss > 10 > [root@mercat1 /home/pho]# procstat -k 41151 > PID TID COMM TDNAME KSTACK > 41151 100211 ttruss - mi_switch > thread_suspend_switch ptracestop amd64_syscall fast_syscall_common > 41151 100765 ttruss - mi_switch > thread_suspend_check ast doreti_ast > [root@mercat1 /home/pho]# > > Ok, I reproduced the bug with your script. I reverted the change. The patch I mailed in this thread fixes it for me. Below is a variant which can be applied on top of fresh head: https://people.freebsd.org/~mjg/wait6_slock.diff Now that the bug got reported it is rather obvious: the suspending thread does lock -> wakeup -> slock -> unlock -> sunlock -> sleep Only locking the proc puts as in a spot where we are past the wakeup, but before it gets the chance to bump the counter. On the other hand if we slock, we effectively wait for it to bump and go to sleep after which we see what's going on. -- Mateusz Guzik From owner-svn-src-all@freebsd.org Sat Feb 17 18:00:03 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B81BAF24847; Sat, 17 Feb 2018 18:00:02 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 67DF48C08C; Sat, 17 Feb 2018 18:00:02 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 48A3420073; Sat, 17 Feb 2018 18:00:02 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1HI02Y3064030; Sat, 17 Feb 2018 18:00:02 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1HI01KX064024; Sat, 17 Feb 2018 18:00:01 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201802171800.w1HI01KX064024@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 17 Feb 2018 18:00:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r329462 - in stable/11/sys: amd64/amd64 amd64/ia32 amd64/include amd64/vmm amd64/vmm/intel dev/cpuctl dev/hyperv/vmbus dev/hyperv/vmbus/amd64 dev/hyperv/vmbus/i386 i386/i386 x86/include... X-SVN-Group: stable-11 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in stable/11/sys: amd64/amd64 amd64/ia32 amd64/include amd64/vmm amd64/vmm/intel dev/cpuctl dev/hyperv/vmbus dev/hyperv/vmbus/amd64 dev/hyperv/vmbus/i386 i386/i386 x86/include x86/isa x86/x86 x86/xen X-SVN-Commit-Revision: 329462 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Feb 2018 18:00:03 -0000 Author: kib Date: Sat Feb 17 18:00:01 2018 New Revision: 329462 URL: https://svnweb.freebsd.org/changeset/base/329462 Log: MFC r328083,328096,328116,328119,328120,328128,328135,328153,328157, 328166,328177,328199,328202,328205,328468,328470,328624,328625,328627, 328628,329214,329297,329365: Meltdown mitigation by PTI, PCID optimization of PTI, and kernel use of IBRS for some mitigations of Spectre. Tested by: emaste, Arshan Khanifar Discussed with: jkim Sponsored by: The FreeBSD Foundation Modified: stable/11/sys/amd64/amd64/apic_vector.S stable/11/sys/amd64/amd64/atpic_vector.S stable/11/sys/amd64/amd64/cpu_switch.S stable/11/sys/amd64/amd64/db_trace.c stable/11/sys/amd64/amd64/exception.S stable/11/sys/amd64/amd64/genassym.c stable/11/sys/amd64/amd64/initcpu.c stable/11/sys/amd64/amd64/machdep.c stable/11/sys/amd64/amd64/mp_machdep.c stable/11/sys/amd64/amd64/pmap.c stable/11/sys/amd64/amd64/support.S stable/11/sys/amd64/amd64/sys_machdep.c stable/11/sys/amd64/amd64/trap.c stable/11/sys/amd64/amd64/vm_machdep.c stable/11/sys/amd64/ia32/ia32_exception.S stable/11/sys/amd64/ia32/ia32_syscall.c stable/11/sys/amd64/include/asmacros.h stable/11/sys/amd64/include/frame.h stable/11/sys/amd64/include/intr_machdep.h stable/11/sys/amd64/include/md_var.h stable/11/sys/amd64/include/pcb.h stable/11/sys/amd64/include/pcpu.h stable/11/sys/amd64/include/pmap.h stable/11/sys/amd64/include/smp.h stable/11/sys/amd64/vmm/intel/vmx.c stable/11/sys/amd64/vmm/vmm.c stable/11/sys/dev/cpuctl/cpuctl.c stable/11/sys/dev/hyperv/vmbus/amd64/vmbus_vector.S stable/11/sys/dev/hyperv/vmbus/i386/vmbus_vector.S stable/11/sys/dev/hyperv/vmbus/vmbus.c stable/11/sys/i386/i386/apic_vector.s stable/11/sys/i386/i386/atpic_vector.s stable/11/sys/i386/i386/exception.s stable/11/sys/i386/i386/machdep.c stable/11/sys/i386/i386/pmap.c stable/11/sys/i386/i386/support.s stable/11/sys/i386/i386/vm_machdep.c stable/11/sys/x86/include/apicvar.h stable/11/sys/x86/include/specialreg.h stable/11/sys/x86/include/x86_smp.h stable/11/sys/x86/include/x86_var.h stable/11/sys/x86/isa/atpic.c stable/11/sys/x86/x86/cpu_machdep.c stable/11/sys/x86/x86/identcpu.c stable/11/sys/x86/x86/local_apic.c stable/11/sys/x86/x86/mp_x86.c stable/11/sys/x86/xen/pv.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/amd64/amd64/apic_vector.S ============================================================================== --- stable/11/sys/amd64/amd64/apic_vector.S Sat Feb 17 17:23:43 2018 (r329461) +++ stable/11/sys/amd64/amd64/apic_vector.S Sat Feb 17 18:00:01 2018 (r329462) @@ -2,7 +2,13 @@ * Copyright (c) 1989, 1990 William F. Jolitz. * Copyright (c) 1990 The Regents of the University of California. * All rights reserved. + * Copyright (c) 2014-2018 The FreeBSD Foundation + * All rights reserved. * + * Portions of this software were developed by + * Konstantin Belousov under sponsorship from + * the FreeBSD Foundation. + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -38,12 +44,12 @@ #include "opt_smp.h" +#include "assym.s" + #include #include #include -#include "assym.s" - #ifdef SMP #define LK lock ; #else @@ -73,30 +79,28 @@ as_lapic_eoi: * translates that into a vector, and passes the vector to the * lapic_handle_intr() function. */ -#define ISR_VEC(index, vec_name) \ - .text ; \ - SUPERALIGN_TEXT ; \ -IDTVEC(vec_name) ; \ - PUSH_FRAME ; \ - FAKE_MCOUNT(TF_RIP(%rsp)) ; \ - cmpl $0,x2apic_mode ; \ - je 1f ; \ - movl $(MSR_APIC_ISR0 + index),%ecx ; \ - rdmsr ; \ - jmp 2f ; \ -1: ; \ - movq lapic_map, %rdx ; /* pointer to local APIC */ \ - movl LA_ISR + 16 * (index)(%rdx), %eax ; /* load ISR */ \ -2: ; \ - bsrl %eax, %eax ; /* index of highest set bit in ISR */ \ - jz 3f ; \ - addl $(32 * index),%eax ; \ - movq %rsp, %rsi ; \ - movl %eax, %edi ; /* pass the IRQ */ \ - call lapic_handle_intr ; \ -3: ; \ - MEXITCOUNT ; \ + .macro ISR_VEC index, vec_name + INTR_HANDLER \vec_name + FAKE_MCOUNT(TF_RIP(%rsp)) + cmpl $0,x2apic_mode + je 1f + movl $(MSR_APIC_ISR0 + \index),%ecx + rdmsr + jmp 2f +1: + movq lapic_map, %rdx /* pointer to local APIC */ + movl LA_ISR + 16 * (\index)(%rdx), %eax /* load ISR */ +2: + bsrl %eax, %eax /* index of highest set bit in ISR */ + jz 3f + addl $(32 * \index),%eax + movq %rsp, %rsi + movl %eax, %edi /* pass the IRQ */ + call lapic_handle_intr +3: + MEXITCOUNT jmp doreti + .endm /* * Handle "spurious INTerrupts". @@ -108,26 +112,21 @@ IDTVEC(vec_name) ; \ .text SUPERALIGN_TEXT IDTVEC(spuriousint) - /* No EOI cycle used here */ - jmp doreti_iret - ISR_VEC(1, apic_isr1) - ISR_VEC(2, apic_isr2) - ISR_VEC(3, apic_isr3) - ISR_VEC(4, apic_isr4) - ISR_VEC(5, apic_isr5) - ISR_VEC(6, apic_isr6) - ISR_VEC(7, apic_isr7) + ISR_VEC 1, apic_isr1 + ISR_VEC 2, apic_isr2 + ISR_VEC 3, apic_isr3 + ISR_VEC 4, apic_isr4 + ISR_VEC 5, apic_isr5 + ISR_VEC 6, apic_isr6 + ISR_VEC 7, apic_isr7 /* * Local APIC periodic timer handler. */ - .text - SUPERALIGN_TEXT -IDTVEC(timerint) - PUSH_FRAME + INTR_HANDLER timerint FAKE_MCOUNT(TF_RIP(%rsp)) movq %rsp, %rdi call lapic_handle_timer @@ -137,10 +136,7 @@ IDTVEC(timerint) /* * Local APIC CMCI handler. */ - .text - SUPERALIGN_TEXT -IDTVEC(cmcint) - PUSH_FRAME + INTR_HANDLER cmcint FAKE_MCOUNT(TF_RIP(%rsp)) call lapic_handle_cmc MEXITCOUNT @@ -149,10 +145,7 @@ IDTVEC(cmcint) /* * Local APIC error interrupt handler. */ - .text - SUPERALIGN_TEXT -IDTVEC(errorint) - PUSH_FRAME + INTR_HANDLER errorint FAKE_MCOUNT(TF_RIP(%rsp)) call lapic_handle_error MEXITCOUNT @@ -163,10 +156,7 @@ IDTVEC(errorint) * Xen event channel upcall interrupt handler. * Only used when the hypervisor supports direct vector callbacks. */ - .text - SUPERALIGN_TEXT -IDTVEC(xen_intr_upcall) - PUSH_FRAME + INTR_HANDLER xen_intr_upcall FAKE_MCOUNT(TF_RIP(%rsp)) movq %rsp, %rdi call xen_intr_handle_upcall @@ -183,74 +173,68 @@ IDTVEC(xen_intr_upcall) SUPERALIGN_TEXT invltlb_ret: call as_lapic_eoi - POP_FRAME - jmp doreti_iret + jmp ld_regs SUPERALIGN_TEXT -IDTVEC(invltlb) - PUSH_FRAME - + INTR_HANDLER invltlb call invltlb_handler jmp invltlb_ret -IDTVEC(invltlb_pcid) - PUSH_FRAME - + INTR_HANDLER invltlb_pcid call invltlb_pcid_handler jmp invltlb_ret -IDTVEC(invltlb_invpcid) - PUSH_FRAME - + INTR_HANDLER invltlb_invpcid_nopti call invltlb_invpcid_handler jmp invltlb_ret + INTR_HANDLER invltlb_invpcid_pti + call invltlb_invpcid_pti_handler + jmp invltlb_ret + /* * Single page TLB shootdown */ - .text + INTR_HANDLER invlpg + call invlpg_handler + jmp invltlb_ret - SUPERALIGN_TEXT -IDTVEC(invlpg) - PUSH_FRAME + INTR_HANDLER invlpg_invpcid + call invlpg_invpcid_handler + jmp invltlb_ret - call invlpg_handler + INTR_HANDLER invlpg_pcid + call invlpg_pcid_handler jmp invltlb_ret /* * Page range TLB shootdown. */ - .text - SUPERALIGN_TEXT -IDTVEC(invlrng) - PUSH_FRAME - + INTR_HANDLER invlrng call invlrng_handler jmp invltlb_ret + INTR_HANDLER invlrng_invpcid + call invlrng_invpcid_handler + jmp invltlb_ret + + INTR_HANDLER invlrng_pcid + call invlrng_pcid_handler + jmp invltlb_ret + /* * Invalidate cache. */ - .text - SUPERALIGN_TEXT -IDTVEC(invlcache) - PUSH_FRAME - + INTR_HANDLER invlcache call invlcache_handler jmp invltlb_ret /* * Handler for IPIs sent via the per-cpu IPI bitmap. */ - .text - SUPERALIGN_TEXT -IDTVEC(ipi_intr_bitmap_handler) - PUSH_FRAME - + INTR_HANDLER ipi_intr_bitmap_handler call as_lapic_eoi - FAKE_MCOUNT(TF_RIP(%rsp)) - call ipi_bitmap_handler MEXITCOUNT jmp doreti @@ -258,24 +242,15 @@ IDTVEC(ipi_intr_bitmap_handler) /* * Executed by a CPU when it receives an IPI_STOP from another CPU. */ - .text - SUPERALIGN_TEXT -IDTVEC(cpustop) - PUSH_FRAME - + INTR_HANDLER cpustop call as_lapic_eoi - call cpustop_handler jmp doreti /* * Executed by a CPU when it receives an IPI_SUSPEND from another CPU. */ - .text - SUPERALIGN_TEXT -IDTVEC(cpususpend) - PUSH_FRAME - + INTR_HANDLER cpususpend call cpususpend_handler call as_lapic_eoi jmp doreti @@ -285,10 +260,7 @@ IDTVEC(cpususpend) * * - Calls the generic rendezvous action function. */ - .text - SUPERALIGN_TEXT -IDTVEC(rendezvous) - PUSH_FRAME + INTR_HANDLER rendezvous #ifdef COUNT_IPIS movl PCPU(CPUID), %eax movq ipi_rendezvous_counts(,%rax,8), %rax @@ -327,5 +299,9 @@ IDTVEC(justreturn) popq %rcx popq %rax jmp doreti_iret + + INTR_HANDLER justreturn1 + call as_lapic_eoi + jmp doreti #endif /* SMP */ Modified: stable/11/sys/amd64/amd64/atpic_vector.S ============================================================================== --- stable/11/sys/amd64/amd64/atpic_vector.S Sat Feb 17 17:23:43 2018 (r329461) +++ stable/11/sys/amd64/amd64/atpic_vector.S Sat Feb 17 18:00:01 2018 (r329462) @@ -36,38 +36,35 @@ * master and slave interrupt controllers. */ +#include "assym.s" #include -#include "assym.s" - /* * Macros for interrupt entry, call to handler, and exit. */ -#define INTR(irq_num, vec_name) \ - .text ; \ - SUPERALIGN_TEXT ; \ -IDTVEC(vec_name) ; \ - PUSH_FRAME ; \ - FAKE_MCOUNT(TF_RIP(%rsp)) ; \ - movq %rsp, %rsi ; \ - movl $irq_num, %edi; /* pass the IRQ */ \ - call atpic_handle_intr ; \ - MEXITCOUNT ; \ + .macro INTR irq_num, vec_name + INTR_HANDLER \vec_name + FAKE_MCOUNT(TF_RIP(%rsp)) + movq %rsp, %rsi + movl $\irq_num, %edi /* pass the IRQ */ + call atpic_handle_intr + MEXITCOUNT jmp doreti + .endm - INTR(0, atpic_intr0) - INTR(1, atpic_intr1) - INTR(2, atpic_intr2) - INTR(3, atpic_intr3) - INTR(4, atpic_intr4) - INTR(5, atpic_intr5) - INTR(6, atpic_intr6) - INTR(7, atpic_intr7) - INTR(8, atpic_intr8) - INTR(9, atpic_intr9) - INTR(10, atpic_intr10) - INTR(11, atpic_intr11) - INTR(12, atpic_intr12) - INTR(13, atpic_intr13) - INTR(14, atpic_intr14) - INTR(15, atpic_intr15) + INTR 0, atpic_intr0 + INTR 1, atpic_intr1 + INTR 2, atpic_intr2 + INTR 3, atpic_intr3 + INTR 4, atpic_intr4 + INTR 5, atpic_intr5 + INTR 6, atpic_intr6 + INTR 7, atpic_intr7 + INTR 8, atpic_intr8 + INTR 9, atpic_intr9 + INTR 10, atpic_intr10 + INTR 11, atpic_intr11 + INTR 12, atpic_intr12 + INTR 13, atpic_intr13 + INTR 14, atpic_intr14 + INTR 15, atpic_intr15 Modified: stable/11/sys/amd64/amd64/cpu_switch.S ============================================================================== --- stable/11/sys/amd64/amd64/cpu_switch.S Sat Feb 17 17:23:43 2018 (r329461) +++ stable/11/sys/amd64/amd64/cpu_switch.S Sat Feb 17 18:00:01 2018 (r329462) @@ -215,8 +215,10 @@ done_tss: movq %r8,PCPU(RSP0) movq %r8,PCPU(CURPCB) /* Update the TSS_RSP0 pointer for the next interrupt */ + cmpb $0,pti(%rip) + jne 1f movq %r8,TSS_RSP0(%rdx) - movq %r12,PCPU(CURTHREAD) /* into next thread */ +1: movq %r12,PCPU(CURTHREAD) /* into next thread */ /* Test if debug registers should be restored. */ testl $PCB_DBREGS,PCB_FLAGS(%r8) @@ -293,7 +295,12 @@ do_tss: movq %rdx,PCPU(TSSP) shrq $8,%rcx movl %ecx,8(%rax) movb $0x89,5(%rax) /* unset busy */ - movl $TSSSEL,%eax + cmpb $0,pti(%rip) + je 1f + movq PCPU(PRVSPACE),%rax + addq $PC_PTI_STACK+PC_PTI_STACK_SZ*8,%rax + movq %rax,TSS_RSP0(%rdx) +1: movl $TSSSEL,%eax ltr %ax jmp done_tss Modified: stable/11/sys/amd64/amd64/db_trace.c ============================================================================== --- stable/11/sys/amd64/amd64/db_trace.c Sat Feb 17 17:23:43 2018 (r329461) +++ stable/11/sys/amd64/amd64/db_trace.c Sat Feb 17 18:00:01 2018 (r329462) @@ -200,6 +200,7 @@ db_nextframe(struct amd64_frame **fp, db_addr_t *ip, s if (name != NULL) { if (strcmp(name, "calltrap") == 0 || strcmp(name, "fork_trampoline") == 0 || + strcmp(name, "mchk_calltrap") == 0 || strcmp(name, "nmi_calltrap") == 0 || strcmp(name, "Xdblfault") == 0) frame_type = TRAP; Modified: stable/11/sys/amd64/amd64/exception.S ============================================================================== --- stable/11/sys/amd64/amd64/exception.S Sat Feb 17 17:23:43 2018 (r329461) +++ stable/11/sys/amd64/amd64/exception.S Sat Feb 17 18:00:01 2018 (r329462) @@ -1,12 +1,16 @@ /*- * Copyright (c) 1989, 1990 William F. Jolitz. * Copyright (c) 1990 The Regents of the University of California. - * Copyright (c) 2007 The FreeBSD Foundation + * Copyright (c) 2007-2018 The FreeBSD Foundation * All rights reserved. * * Portions of this software were developed by A. Joseph Koshy under * sponsorship from the FreeBSD Foundation and Google, Inc. * + * Portions of this software were developed by + * Konstantin Belousov under sponsorship from + * the FreeBSD Foundation. + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -38,13 +42,13 @@ #include "opt_compat.h" #include "opt_hwpmc_hooks.h" +#include "assym.s" + #include #include #include #include -#include "assym.s" - #ifdef KDTRACE_HOOKS .bss .globl dtrace_invop_jump_addr @@ -100,69 +104,62 @@ dtrace_invop_calltrap_addr: MCOUNT_LABEL(user) MCOUNT_LABEL(btrap) -/* Traps that we leave interrupts disabled for.. */ -#define TRAP_NOEN(a) \ - subq $TF_RIP,%rsp; \ - movl $(a),TF_TRAPNO(%rsp) ; \ - movq $0,TF_ADDR(%rsp) ; \ - movq $0,TF_ERR(%rsp) ; \ +/* Traps that we leave interrupts disabled for. */ + .macro TRAP_NOEN l, trapno + PTI_ENTRY \l,X\l + .globl X\l + .type X\l,@function +X\l: subq $TF_RIP,%rsp + movl $\trapno,TF_TRAPNO(%rsp) + movq $0,TF_ADDR(%rsp) + movq $0,TF_ERR(%rsp) jmp alltraps_noen -IDTVEC(dbg) - TRAP_NOEN(T_TRCTRAP) -IDTVEC(bpt) - TRAP_NOEN(T_BPTFLT) + .endm + + TRAP_NOEN dbg, T_TRCTRAP + TRAP_NOEN bpt, T_BPTFLT #ifdef KDTRACE_HOOKS -IDTVEC(dtrace_ret) - TRAP_NOEN(T_DTRACE_RET) + TRAP_NOEN dtrace_ret, T_DTRACE_RET #endif /* Regular traps; The cpu does not supply tf_err for these. */ -#define TRAP(a) \ - subq $TF_RIP,%rsp; \ - movl $(a),TF_TRAPNO(%rsp) ; \ - movq $0,TF_ADDR(%rsp) ; \ - movq $0,TF_ERR(%rsp) ; \ + .macro TRAP l, trapno + PTI_ENTRY \l,X\l + .globl X\l + .type X\l,@function +X\l: + subq $TF_RIP,%rsp + movl $\trapno,TF_TRAPNO(%rsp) + movq $0,TF_ADDR(%rsp) + movq $0,TF_ERR(%rsp) jmp alltraps -IDTVEC(div) - TRAP(T_DIVIDE) -IDTVEC(ofl) - TRAP(T_OFLOW) -IDTVEC(bnd) - TRAP(T_BOUND) -IDTVEC(ill) - TRAP(T_PRIVINFLT) -IDTVEC(dna) - TRAP(T_DNA) -IDTVEC(fpusegm) - TRAP(T_FPOPFLT) -IDTVEC(mchk) - TRAP(T_MCHK) -IDTVEC(rsvd) - TRAP(T_RESERVED) -IDTVEC(fpu) - TRAP(T_ARITHTRAP) -IDTVEC(xmm) - TRAP(T_XMMFLT) + .endm -/* This group of traps have tf_err already pushed by the cpu */ -#define TRAP_ERR(a) \ - subq $TF_ERR,%rsp; \ - movl $(a),TF_TRAPNO(%rsp) ; \ - movq $0,TF_ADDR(%rsp) ; \ + TRAP div, T_DIVIDE + TRAP ofl, T_OFLOW + TRAP bnd, T_BOUND + TRAP ill, T_PRIVINFLT + TRAP dna, T_DNA + TRAP fpusegm, T_FPOPFLT + TRAP rsvd, T_RESERVED + TRAP fpu, T_ARITHTRAP + TRAP xmm, T_XMMFLT + +/* This group of traps have tf_err already pushed by the cpu. */ + .macro TRAP_ERR l, trapno + PTI_ENTRY \l,X\l,has_err=1 + .globl X\l + .type X\l,@function +X\l: + subq $TF_ERR,%rsp + movl $\trapno,TF_TRAPNO(%rsp) + movq $0,TF_ADDR(%rsp) jmp alltraps -IDTVEC(tss) - TRAP_ERR(T_TSSFLT) -IDTVEC(missing) - subq $TF_ERR,%rsp - movl $T_SEGNPFLT,TF_TRAPNO(%rsp) - jmp prot_addrf -IDTVEC(stk) - subq $TF_ERR,%rsp - movl $T_STKFLT,TF_TRAPNO(%rsp) - jmp prot_addrf -IDTVEC(align) - TRAP_ERR(T_ALIGNFLT) + .endm + TRAP_ERR tss, T_TSSFLT + TRAP_ERR align, T_ALIGNFLT + /* * alltraps entry point. Use swapgs if this is the first time in the * kernel from userland. Reenable interrupts if they were enabled @@ -174,24 +171,22 @@ IDTVEC(align) alltraps: movq %rdi,TF_RDI(%rsp) testb $SEL_RPL_MASK,TF_CS(%rsp) /* Did we come from kernel? */ - jz alltraps_testi /* already running with kernel GS.base */ + jz 1f /* already running with kernel GS.base */ swapgs movq PCPU(CURPCB),%rdi andl $~PCB_FULL_IRET,PCB_FLAGS(%rdi) - movw %fs,TF_FS(%rsp) - movw %gs,TF_GS(%rsp) - movw %es,TF_ES(%rsp) - movw %ds,TF_DS(%rsp) -alltraps_testi: - testl $PSL_I,TF_RFLAGS(%rsp) - jz alltraps_pushregs_no_rdi - sti -alltraps_pushregs_no_rdi: +1: SAVE_SEGS movq %rdx,TF_RDX(%rsp) movq %rax,TF_RAX(%rsp) + movq %rcx,TF_RCX(%rsp) + testb $SEL_RPL_MASK,TF_CS(%rsp) + jz 2f + call handle_ibrs_entry +2: testl $PSL_I,TF_RFLAGS(%rsp) + jz alltraps_pushregs_no_rax + sti alltraps_pushregs_no_rax: movq %rsi,TF_RSI(%rsp) - movq %rcx,TF_RCX(%rsp) movq %r8,TF_R8(%rsp) movq %r9,TF_R9(%rsp) movq %rbx,TF_RBX(%rsp) @@ -249,15 +244,18 @@ calltrap: alltraps_noen: movq %rdi,TF_RDI(%rsp) testb $SEL_RPL_MASK,TF_CS(%rsp) /* Did we come from kernel? */ - jz 1f /* already running with kernel GS.base */ + jz 1f /* already running with kernel GS.base */ swapgs movq PCPU(CURPCB),%rdi andl $~PCB_FULL_IRET,PCB_FLAGS(%rdi) -1: movw %fs,TF_FS(%rsp) - movw %gs,TF_GS(%rsp) - movw %es,TF_ES(%rsp) - movw %ds,TF_DS(%rsp) - jmp alltraps_pushregs_no_rdi +1: SAVE_SEGS + movq %rdx,TF_RDX(%rsp) + movq %rax,TF_RAX(%rsp) + movq %rcx,TF_RCX(%rsp) + testb $SEL_RPL_MASK,TF_CS(%rsp) + jz alltraps_pushregs_no_rax + call handle_ibrs_entry + jmp alltraps_pushregs_no_rax IDTVEC(dblfault) subq $TF_ERR,%rsp @@ -279,56 +277,110 @@ IDTVEC(dblfault) movq %r13,TF_R13(%rsp) movq %r14,TF_R14(%rsp) movq %r15,TF_R15(%rsp) - movw %fs,TF_FS(%rsp) - movw %gs,TF_GS(%rsp) - movw %es,TF_ES(%rsp) - movw %ds,TF_DS(%rsp) + SAVE_SEGS movl $TF_HASSEGS,TF_FLAGS(%rsp) cld testb $SEL_RPL_MASK,TF_CS(%rsp) /* Did we come from kernel? */ jz 1f /* already running with kernel GS.base */ swapgs 1: - movq %rsp,%rdi + movq PCPU(KCR3),%rax + cmpq $~0,%rax + je 2f + movq %rax,%cr3 +2: movq %rsp,%rdi call dblfault_handler -2: - hlt - jmp 2b +3: hlt + jmp 3b + ALIGN_TEXT +IDTVEC(page_pti) + testb $SEL_RPL_MASK,PTI_CS-2*8(%rsp) + jz Xpage + swapgs + pushq %rax + pushq %rdx + movq %cr3,%rax + movq %rax,PCPU(SAVED_UCR3) + PTI_UUENTRY has_err=1 + subq $TF_ERR,%rsp + movq %rdi,TF_RDI(%rsp) + movq %rax,TF_RAX(%rsp) + movq %rdx,TF_RDX(%rsp) + movq %rcx,TF_RCX(%rsp) + jmp page_u IDTVEC(page) subq $TF_ERR,%rsp - movl $T_PAGEFLT,TF_TRAPNO(%rsp) - movq %rdi,TF_RDI(%rsp) /* free up a GP register */ + movq %rdi,TF_RDI(%rsp) /* free up GP registers */ + movq %rax,TF_RAX(%rsp) + movq %rdx,TF_RDX(%rsp) + movq %rcx,TF_RCX(%rsp) testb $SEL_RPL_MASK,TF_CS(%rsp) /* Did we come from kernel? */ - jz 1f /* already running with kernel GS.base */ + jz page_cr2 /* already running with kernel GS.base */ swapgs - movq PCPU(CURPCB),%rdi +page_u: movq PCPU(CURPCB),%rdi andl $~PCB_FULL_IRET,PCB_FLAGS(%rdi) -1: movq %cr2,%rdi /* preserve %cr2 before .. */ + movq PCPU(SAVED_UCR3),%rax + movq %rax,PCB_SAVED_UCR3(%rdi) + call handle_ibrs_entry +page_cr2: + movq %cr2,%rdi /* preserve %cr2 before .. */ movq %rdi,TF_ADDR(%rsp) /* enabling interrupts. */ - movw %fs,TF_FS(%rsp) - movw %gs,TF_GS(%rsp) - movw %es,TF_ES(%rsp) - movw %ds,TF_DS(%rsp) + SAVE_SEGS + movl $T_PAGEFLT,TF_TRAPNO(%rsp) testl $PSL_I,TF_RFLAGS(%rsp) - jz alltraps_pushregs_no_rdi + jz alltraps_pushregs_no_rax sti - jmp alltraps_pushregs_no_rdi + jmp alltraps_pushregs_no_rax /* * We have to special-case this one. If we get a trap in doreti() at * the iretq stage, we'll reenter with the wrong gs state. We'll have * to do a special the swapgs in this case even coming from the kernel. * XXX linux has a trap handler for their equivalent of load_gs(). + * + * On the stack, we have the hardware interrupt frame to return + * to usermode (faulted) and another frame with error code, for + * fault. For PTI, copy both frames to the main thread stack. */ -IDTVEC(prot) + .macro PROTF_ENTRY name,trapno +\name\()_pti_doreti: + pushq %rax + pushq %rdx + swapgs + movq PCPU(KCR3),%rax + movq %rax,%cr3 + movq PCPU(RSP0),%rax + subq $2*PTI_SIZE-3*8,%rax /* no err, %rax, %rdx in faulted frame */ + MOVE_STACKS (PTI_SIZE / 4 - 3) + movq %rax,%rsp + popq %rdx + popq %rax + swapgs + jmp X\name +IDTVEC(\name\()_pti) + cmpq $doreti_iret,PTI_RIP-2*8(%rsp) + je \name\()_pti_doreti + testb $SEL_RPL_MASK,PTI_CS-2*8(%rsp) /* %rax, %rdx not yet pushed */ + jz X\name + PTI_UENTRY has_err=1 + swapgs +IDTVEC(\name) subq $TF_ERR,%rsp - movl $T_PROTFLT,TF_TRAPNO(%rsp) + movl $\trapno,TF_TRAPNO(%rsp) + jmp prot_addrf + .endm + + PROTF_ENTRY missing, T_SEGNPFLT + PROTF_ENTRY stk, T_STKFLT + PROTF_ENTRY prot, T_PROTFLT + prot_addrf: movq $0,TF_ADDR(%rsp) movq %rdi,TF_RDI(%rsp) /* free up a GP register */ movq %rax,TF_RAX(%rsp) movq %rdx,TF_RDX(%rsp) + movq %rcx,TF_RCX(%rsp) movw %fs,TF_FS(%rsp) movw %gs,TF_GS(%rsp) leaq doreti_iret(%rip),%rdi @@ -354,7 +406,8 @@ prot_addrf: 3: cmpw $KUG32SEL,TF_GS(%rsp) jne 4f movq %rdx,PCB_GSBASE(%rdi) -4: orl $PCB_FULL_IRET,PCB_FLAGS(%rdi) /* always full iret from GPF */ +4: call handle_ibrs_entry + orl $PCB_FULL_IRET,PCB_FLAGS(%rdi) /* always full iret from GPF */ movw %es,TF_ES(%rsp) movw %ds,TF_DS(%rsp) testl $PSL_I,TF_RFLAGS(%rsp) @@ -375,8 +428,18 @@ prot_addrf: * We do not support invoking this from a custom segment registers, * esp. %cs, %ss, %fs, %gs, e.g. using entries from an LDT. */ + SUPERALIGN_TEXT +IDTVEC(fast_syscall_pti) + swapgs + movq %rax,PCPU(SCRATCH_RAX) + movq PCPU(KCR3),%rax + movq %rax,%cr3 + jmp fast_syscall_common + SUPERALIGN_TEXT IDTVEC(fast_syscall) swapgs + movq %rax,PCPU(SCRATCH_RAX) +fast_syscall_common: movq %rsp,PCPU(SCRATCH_RSP) movq PCPU(RSP0),%rsp /* Now emulate a trapframe. Make the 8 byte alignment odd for call. */ @@ -386,10 +449,11 @@ IDTVEC(fast_syscall) movq %rcx,TF_RIP(%rsp) /* %rcx original value is in %r10 */ movq PCPU(SCRATCH_RSP),%r11 /* %r11 already saved */ movq %r11,TF_RSP(%rsp) /* user stack pointer */ - movw %fs,TF_FS(%rsp) - movw %gs,TF_GS(%rsp) - movw %es,TF_ES(%rsp) - movw %ds,TF_DS(%rsp) + movq PCPU(SCRATCH_RAX),%rax + movq %rax,TF_RAX(%rsp) /* syscall number */ + movq %rdx,TF_RDX(%rsp) /* arg 3 */ + SAVE_SEGS + call handle_ibrs_entry movq PCPU(CURPCB),%r11 andl $~PCB_FULL_IRET,PCB_FLAGS(%r11) sti @@ -398,11 +462,9 @@ IDTVEC(fast_syscall) movq $2,TF_ERR(%rsp) movq %rdi,TF_RDI(%rsp) /* arg 1 */ movq %rsi,TF_RSI(%rsp) /* arg 2 */ - movq %rdx,TF_RDX(%rsp) /* arg 3 */ movq %r10,TF_RCX(%rsp) /* arg 4 */ movq %r8,TF_R8(%rsp) /* arg 5 */ movq %r9,TF_R9(%rsp) /* arg 6 */ - movq %rax,TF_RAX(%rsp) /* syscall number */ movq %rbx,TF_RBX(%rsp) /* C preserved */ movq %rbp,TF_RBP(%rsp) /* C preserved */ movq %r12,TF_R12(%rsp) /* C preserved */ @@ -420,11 +482,12 @@ IDTVEC(fast_syscall) /* Disable interrupts before testing PCB_FULL_IRET. */ cli testl $PCB_FULL_IRET,PCB_FLAGS(%rax) - jnz 3f + jnz 4f /* Check for and handle AST's on return to userland. */ movq PCPU(CURTHREAD),%rax testl $TDF_ASTPENDING | TDF_NEEDRESCHED,TD_FLAGS(%rax) - jne 2f + jne 3f + call handle_ibrs_exit /* Restore preserved registers. */ MEXITCOUNT movq TF_RDI(%rsp),%rdi /* bonus; preserve arg 1 */ @@ -434,16 +497,21 @@ IDTVEC(fast_syscall) movq TF_RFLAGS(%rsp),%r11 /* original %rflags */ movq TF_RIP(%rsp),%rcx /* original %rip */ movq TF_RSP(%rsp),%rsp /* user stack pointer */ - swapgs + cmpb $0,pti + je 2f + movq PCPU(UCR3),%r9 + movq %r9,%cr3 + xorl %r9d,%r9d +2: swapgs sysretq -2: /* AST scheduled. */ +3: /* AST scheduled. */ sti movq %rsp,%rdi call ast jmp 1b -3: /* Requested full context restore, use doreti for that. */ +4: /* Requested full context restore, use doreti for that. */ MEXITCOUNT jmp doreti @@ -499,17 +567,15 @@ IDTVEC(nmi) movq %r13,TF_R13(%rsp) movq %r14,TF_R14(%rsp) movq %r15,TF_R15(%rsp) - movw %fs,TF_FS(%rsp) - movw %gs,TF_GS(%rsp) - movw %es,TF_ES(%rsp) - movw %ds,TF_DS(%rsp) + SAVE_SEGS movl $TF_HASSEGS,TF_FLAGS(%rsp) cld xorl %ebx,%ebx testb $SEL_RPL_MASK,TF_CS(%rsp) jnz nmi_fromuserspace /* - * We've interrupted the kernel. Preserve GS.base in %r12. + * We've interrupted the kernel. Preserve GS.base in %r12, + * %cr3 in %r13, and possibly lower half of MSR_IA32_SPEC_CTL in %r14d. */ movl $MSR_GSBASE,%ecx rdmsr @@ -521,27 +587,45 @@ IDTVEC(nmi) movl %edx,%eax shrq $32,%rdx wrmsr + movq %cr3,%r13 + movq PCPU(KCR3),%rax + cmpq $~0,%rax + je 1f + movq %rax,%cr3 +1: testl $CPUID_STDEXT3_IBPB,cpu_stdext_feature3(%rip) + je nmi_calltrap + movl $MSR_IA32_SPEC_CTRL,%ecx + rdmsr + movl %eax,%r14d + call handle_ibrs_entry jmp nmi_calltrap nmi_fromuserspace: incl %ebx swapgs - testb $CPUID_STDEXT_FSGSBASE,cpu_stdext_feature(%rip) - jz 2f + movq %cr3,%r13 + movq PCPU(KCR3),%rax + cmpq $~0,%rax + je 1f + movq %rax,%cr3 +1: call handle_ibrs_entry movq PCPU(CURPCB),%rdi testq %rdi,%rdi - jz 2f + jz 3f + orl $PCB_FULL_IRET,PCB_FLAGS(%rdi) + testb $CPUID_STDEXT_FSGSBASE,cpu_stdext_feature(%rip) + jz 3f cmpw $KUF32SEL,TF_FS(%rsp) - jne 1f + jne 2f rdfsbase %rax movq %rax,PCB_FSBASE(%rdi) -1: cmpw $KUG32SEL,TF_GS(%rsp) - jne 2f +2: cmpw $KUG32SEL,TF_GS(%rsp) + jne 3f movl $MSR_KGSBASE,%ecx rdmsr shlq $32,%rdx orq %rdx,%rax movq %rax,PCB_GSBASE(%rdi) -2: +3: /* Note: this label is also used by ddb and gdb: */ nmi_calltrap: FAKE_MCOUNT(TF_RIP(%rsp)) @@ -564,26 +648,29 @@ nmi_calltrap: movq PCPU(CURTHREAD),%rax orq %rax,%rax /* curthread present? */ jz nocallchain - testl $TDP_CALLCHAIN,TD_PFLAGS(%rax) /* flagged for capture? */ - jz nocallchain /* - * A user callchain is to be captured, so: - * - Move execution to the regular kernel stack, to allow for - * nested NMI interrupts. - * - Take the processor out of "NMI" mode by faking an "iret". - * - Enable interrupts, so that copyin() can work. + * Move execution to the regular kernel stack, because we + * committed to return through doreti. */ movq %rsp,%rsi /* source stack pointer */ movq $TF_SIZE,%rcx movq PCPU(RSP0),%rdx subq %rcx,%rdx movq %rdx,%rdi /* destination stack pointer */ - shrq $3,%rcx /* trap frame size in long words */ cld rep movsq /* copy trapframe */ + movq %rdx,%rsp /* we are on the regular kstack */ + testl $TDP_CALLCHAIN,TD_PFLAGS(%rax) /* flagged for capture? */ + jz nocallchain + /* + * A user callchain is to be captured, so: + * - Take the processor out of "NMI" mode by faking an "iret", + * to allow for nested NMI interrupts. + * - Enable interrupts, so that copyin() can work. + */ movl %ss,%eax pushq %rax /* tf_ss */ pushq %rdx /* tf_rsp (on kernel stack) */ @@ -613,33 +700,139 @@ outofnmi: cli nocallchain: #endif - testl %ebx,%ebx + testl %ebx,%ebx /* %ebx == 0 => return to userland */ jnz doreti_exit -nmi_kernelexit: /* + * Restore speculation control MSR, if preserved. + */ + testl $CPUID_STDEXT3_IBPB,cpu_stdext_feature3(%rip) + je 1f + movl %r14d,%eax + xorl %edx,%edx + movl $MSR_IA32_SPEC_CTRL,%ecx + wrmsr + /* * Put back the preserved MSR_GSBASE value. */ +1: movl $MSR_GSBASE,%ecx + movq %r12,%rdx + movl %edx,%eax + shrq $32,%rdx + wrmsr + movq %r13,%cr3 + RESTORE_REGS + addq $TF_RIP,%rsp + jmp doreti_iret + +/* + * MC# handling is similar to NMI. + * + * As with NMIs, machine check exceptions do not respect RFLAGS.IF and + * can occur at any time with a GS.base value that does not correspond + * to the privilege level in CS. + * + * Machine checks are not unblocked by iretq, but it is best to run *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Sat Feb 17 18:30:25 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B956EF01CFD; Sat, 17 Feb 2018 18:30:25 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6B1BF8D48E; Sat, 17 Feb 2018 18:30:25 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 662632055C; Sat, 17 Feb 2018 18:30:25 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1HIUPmc078726; Sat, 17 Feb 2018 18:30:25 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1HIUPKb078725; Sat, 17 Feb 2018 18:30:25 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201802171830.w1HIUPKb078725@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Sat, 17 Feb 2018 18:30:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329463 - head/sys/arm/allwinner X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/arm/allwinner X-SVN-Commit-Revision: 329463 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Feb 2018 18:30:25 -0000 Author: manu Date: Sat Feb 17 18:30:25 2018 New Revision: 329463 URL: https://svnweb.freebsd.org/changeset/base/329463 Log: aw_mmc: Only change the clock if it has really changed This also seems to fix problem when booting Pine64 from the mmc. Tested On: Pine64 Tested On: Pine64-LTS Modified: head/sys/arm/allwinner/aw_mmc.c Modified: head/sys/arm/allwinner/aw_mmc.c ============================================================================== --- head/sys/arm/allwinner/aw_mmc.c Sat Feb 17 18:00:01 2018 (r329462) +++ head/sys/arm/allwinner/aw_mmc.c Sat Feb 17 18:30:25 2018 (r329463) @@ -117,6 +117,7 @@ struct aw_mmc_softc { int32_t aw_vdd; regulator_t aw_reg_vmmc; regulator_t aw_reg_vqmmc; + unsigned int aw_clock; /* Fields required for DMA access. */ bus_addr_t aw_dma_desc_phys; @@ -939,8 +940,8 @@ aw_mmc_update_ios(device_t bus, device_t child) reg &= ~AW_MMC_CTRL_DDR_MOD_SEL; AW_MMC_WRITE_4(sc, AW_MMC_GCTL, reg); - if (ios->clock) { - clock = ios->clock; + if (ios->clock && ios->clock != sc->aw_clock) { + sc->aw_clock = clock = ios->clock; /* Disable clock */ error = aw_mmc_update_clock(sc, 0); From owner-svn-src-all@freebsd.org Sat Feb 17 18:43:04 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5F1C6F02DA6; Sat, 17 Feb 2018 18:43:04 +0000 (UTC) (envelope-from pho@holm.cc) Received: from relay01.pair.com (relay01.pair.com [209.68.5.15]) (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 EF1F28DF30; Sat, 17 Feb 2018 18:43:03 +0000 (UTC) (envelope-from pho@holm.cc) Received: from x2.osted.lan (87-58-223-204-dynamic.dk.customer.tdc.net [87.58.223.204]) by relay01.pair.com (Postfix) with ESMTP id 3D46AD00389; Sat, 17 Feb 2018 13:43:02 -0500 (EST) Received: from x2.osted.lan (localhost [127.0.0.1]) by x2.osted.lan (8.14.9/8.14.9) with ESMTP id w1HIgxvc084093 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Sat, 17 Feb 2018 19:42:59 +0100 (CET) (envelope-from pho@x2.osted.lan) Received: (from pho@localhost) by x2.osted.lan (8.14.9/8.14.9/Submit) id w1HIgxZE084090; Sat, 17 Feb 2018 19:42:59 +0100 (CET) (envelope-from pho) Date: Sat, 17 Feb 2018 19:42:59 +0100 From: Peter Holm To: Mateusz Guzik Cc: Konstantin Belousov , Mateusz Guzik , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r329448 - head/sys/kern Message-ID: <20180217184259.GA84054@x2.osted.lan> References: <201802170848.w1H8mkfb081764@repo.freebsd.org> <20180217112738.GO94212@kib.kiev.ua> <20180217162632.GQ94212@kib.kiev.ua> <20180217163822.GA81555@x2.osted.lan> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Feb 2018 18:43:04 -0000 On Sat, Feb 17, 2018 at 06:34:34PM +0100, Mateusz Guzik wrote: > On Sat, Feb 17, 2018 at 5:38 PM, Peter Holm wrote: > > > On Sat, Feb 17, 2018 at 06:26:32PM +0200, Konstantin Belousov wrote: > > > On Sat, Feb 17, 2018 at 05:07:07PM +0100, Mateusz Guzik wrote: > > > > On Sat, Feb 17, 2018 at 01:27:38PM +0200, Konstantin Belousov wrote: > > > > > On Sat, Feb 17, 2018 at 08:48:46AM +0000, Mateusz Guzik wrote: > > > > > > Author: mjg > > > > > > Date: Sat Feb 17 08:48:45 2018 > > > > > > New Revision: 329448 > > > > > > URL: https://svnweb.freebsd.org/changeset/base/329448 > > > > > > > > > > > > Log: > > > > > > exit: get rid of PROC_SLOCK when checking a process to report > > > > > Was this tested ? > > > > > > > > > > > > > I was trussing multithreaded microbenchmarks, no issues. > > > > > > > > > In particular, are you aware of r309539 ? > > > > > > > > > > > > > So it looks like I misread the code - I have grepped > > > > thread_suspend_switch operating with the proc locked and misread > > > > thread_suspend_one's assert as PROC_LOCK_ASSERT. > > > > > > > > That said, I think this is harmless. Regardless of the lock the > > > > inspecting thread can race and check "too soon". Even for a case where > > > > it decides to report, I don't see anything which would depend on the > > > > suspending thread to finish. > > > It was definitely not harmless when I tried to avoid the spin lock there, > > > but I do not remember exact failure mode. Most likely, it was a missed > > > report of the traced child indeed, but I am not sure that truss triggered > > > it. Most likely, Peter Holm was the reporter, since he is listed in > > > the commit. > > > > > > > I ran a truss(1) test on r329456 and it fails. I have not had a > > chance to look closer at this, but this is what I see: > > > > [root@mercat1 /home/pho]# pgrep truss | xargs ps -Hlp > > UID PID PPID CPU PRI NI VSZ RSS MWCHAN STAT TT TIME COMMAND > > 0 41149 41118 0 52 0 11532 2588 wait I 0 0:01.38 truss > > /tmp/ttruss 10 > > 0 41151 41149 0 52 0 13156 2300 - TX 0 0:00.98 /tmp/ttruss > > 10 > > 0 41151 41149 0 52 0 13156 2300 - TX 0 0:00.00 /tmp/ttruss > > 10 > > [root@mercat1 /home/pho]# procstat -k 41151 > > PID TID COMM TDNAME KSTACK > > 41151 100211 ttruss - mi_switch > > thread_suspend_switch ptracestop amd64_syscall fast_syscall_common > > 41151 100765 ttruss - mi_switch > > thread_suspend_check ast doreti_ast > > [root@mercat1 /home/pho]# > > > > > Ok, I reproduced the bug with your script. I reverted the change. > > The patch I mailed in this thread fixes it for me. Below is a variant > which can be applied on top of fresh head: > > https://people.freebsd.org/~mjg/wait6_slock.diff > Yes, this also works for me with the truss(1) test scenario. Would you like me to run the full set of test? - Peter From owner-svn-src-all@freebsd.org Sat Feb 17 18:47:40 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D668CF0328E; Sat, 17 Feb 2018 18:47:39 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: from mail-qk0-x243.google.com (mail-qk0-x243.google.com [IPv6:2607:f8b0:400d:c09::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 5D3DC8E224; Sat, 17 Feb 2018 18:47:39 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: by mail-qk0-x243.google.com with SMTP id b130so7773118qkg.9; Sat, 17 Feb 2018 10:47:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=JUTgfSFBxZ22joGIJLhtM1DR+t8nO6AzUB8hG3fSLSw=; b=qgNrBciXZhIKPXSAzJU/3wiBIoaYo4E6AkIw7YZ20jUftvKALPgPOQ+Vo+8nmoUJaG PxbjORJe2y0HO/AzkqyphfPebVyUa7CqI6MLKePzRjvFMoNB07j6GI16G3lW12fus7zq 77cv5OTrnQ9HSWy8t1jHyWQQqA9/mHKtGtgtxHhVn234mskE+6ZIeXMpynV8toqLCTbZ EjJAV9h6oPaOfpQSvKmpAw890S/oC1oqVhLTVXHbogI0e1YnlmyY+m3ofS+WiVh1e9Bx YCWN6h59QrKop42u/F7PmIn74l5Pitr1ecGyWoCgFBIru8G4RiwZ4jFkeMXCkH5ltMYq Hrtg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=JUTgfSFBxZ22joGIJLhtM1DR+t8nO6AzUB8hG3fSLSw=; b=LTKhteCocqE6NkrlzrvbrPM78hR0w6Fn4dUtfExYSzUJKb5ZFSoe0tDxxBwNlU+gyy FK8Ufuo+6wNUwzc5kb54q+b00c9myXFdFgZcEXDrjqSfAwoLPVNpXP7Op/+SRZZJuFZ6 prf7grQF3hEwTFYoZLAuLhvb00p6ZCm4wUsWsiOgQvNmbT6lSqozvFKQWaK3+eLQ9j2s b8oyesq7LkEK2368wr+L0zi7ZADZHuoKMx6uL5iA1kxyiFIq4o+r7kJX5AUFSaVB2Ehw 7yjMRo3JzILlCHTKZebM43ESESvE9Dh2M0w6HF4JFRxlrZ6sExjCBxqVNZ9N70+E0KQ8 UPxg== X-Gm-Message-State: APf1xPB4qXtC77TGnxR5C8ZjsjWaC+HByJ5BSj6RzwbmCt59tXO1KsGN g/l8IwY+X+AoABiGJJAOfA9RkG11y1cgpYJaq1U= X-Google-Smtp-Source: AH8x226pvr68V3cZBUH367gqFRoQ34ChnTaUxkkMjY+NdrU4OtMehlXy0i7ZLRovu8JwU+cCyV2+FKLjdGzOTV3lVHQ= X-Received: by 10.55.74.2 with SMTP id x2mr15449076qka.314.1518893259033; Sat, 17 Feb 2018 10:47:39 -0800 (PST) MIME-Version: 1.0 Received: by 10.237.58.99 with HTTP; Sat, 17 Feb 2018 10:47:38 -0800 (PST) In-Reply-To: <20180217184259.GA84054@x2.osted.lan> References: <201802170848.w1H8mkfb081764@repo.freebsd.org> <20180217112738.GO94212@kib.kiev.ua> <20180217162632.GQ94212@kib.kiev.ua> <20180217163822.GA81555@x2.osted.lan> <20180217184259.GA84054@x2.osted.lan> From: Mateusz Guzik Date: Sat, 17 Feb 2018 19:47:38 +0100 Message-ID: Subject: Re: svn commit: r329448 - head/sys/kern To: Peter Holm Cc: Konstantin Belousov , Mateusz Guzik , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.25 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Feb 2018 18:47:40 -0000 On Sat, Feb 17, 2018 at 7:42 PM, Peter Holm wrote: > On Sat, Feb 17, 2018 at 06:34:34PM +0100, Mateusz Guzik wrote: > > On Sat, Feb 17, 2018 at 5:38 PM, Peter Holm wrote: > > > > > On Sat, Feb 17, 2018 at 06:26:32PM +0200, Konstantin Belousov wrote: > > > > On Sat, Feb 17, 2018 at 05:07:07PM +0100, Mateusz Guzik wrote: > > > > > On Sat, Feb 17, 2018 at 01:27:38PM +0200, Konstantin Belousov > wrote: > > > > > > On Sat, Feb 17, 2018 at 08:48:46AM +0000, Mateusz Guzik wrote: > > > > > > > Author: mjg > > > > > > > Date: Sat Feb 17 08:48:45 2018 > > > > > > > New Revision: 329448 > > > > > > > URL: https://svnweb.freebsd.org/changeset/base/329448 > > > > > > > > > > > > > > Log: > > > > > > > exit: get rid of PROC_SLOCK when checking a process to report > > > > > > Was this tested ? > > > > > > > > > > > > > > > > I was trussing multithreaded microbenchmarks, no issues. > > > > > > > > > > > In particular, are you aware of r309539 ? > > > > > > > > > > > > > > > > So it looks like I misread the code - I have grepped > > > > > thread_suspend_switch operating with the proc locked and misread > > > > > thread_suspend_one's assert as PROC_LOCK_ASSERT. > > > > > > > > > > That said, I think this is harmless. Regardless of the lock the > > > > > inspecting thread can race and check "too soon". Even for a case > where > > > > > it decides to report, I don't see anything which would depend on > the > > > > > suspending thread to finish. > > > > It was definitely not harmless when I tried to avoid the spin lock > there, > > > > but I do not remember exact failure mode. Most likely, it was a > missed > > > > report of the traced child indeed, but I am not sure that truss > triggered > > > > it. Most likely, Peter Holm was the reporter, since he is listed in > > > > the commit. > > > > > > > > > > I ran a truss(1) test on r329456 and it fails. I have not had a > > > chance to look closer at this, but this is what I see: > > > > > > [root@mercat1 /home/pho]# pgrep truss | xargs ps -Hlp > > > UID PID PPID CPU PRI NI VSZ RSS MWCHAN STAT TT TIME COMMAND > > > 0 41149 41118 0 52 0 11532 2588 wait I 0 0:01.38 truss > > > /tmp/ttruss 10 > > > 0 41151 41149 0 52 0 13156 2300 - TX 0 0:00.98 > /tmp/ttruss > > > 10 > > > 0 41151 41149 0 52 0 13156 2300 - TX 0 0:00.00 > /tmp/ttruss > > > 10 > > > [root@mercat1 /home/pho]# procstat -k 41151 > > > PID TID COMM TDNAME KSTACK > > > 41151 100211 ttruss - mi_switch > > > thread_suspend_switch ptracestop amd64_syscall fast_syscall_common > > > 41151 100765 ttruss - mi_switch > > > thread_suspend_check ast doreti_ast > > > [root@mercat1 /home/pho]# > > > > > > > > Ok, I reproduced the bug with your script. I reverted the change. > > > > The patch I mailed in this thread fixes it for me. Below is a variant > > which can be applied on top of fresh head: > > > > https://people.freebsd.org/~mjg/wait6_slock.diff > > > > Yes, this also works for me with the truss(1) test scenario. > Would you like me to run the full set of test? > > If you have free cycles I don't see why not, thanks. -- Mateusz Guzik From owner-svn-src-all@freebsd.org Sat Feb 17 20:09:44 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2ECC7F0A311; Sat, 17 Feb 2018 20:09:44 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D586169C37; Sat, 17 Feb 2018 20:09:43 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D0605215DE; Sat, 17 Feb 2018 20:09:43 +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 w1HK9hnK029315; Sat, 17 Feb 2018 20:09:43 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1HK9hQr029314; Sat, 17 Feb 2018 20:09:43 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201802172009.w1HK9hQr029314@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Sat, 17 Feb 2018 20:09:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329464 - head/sys/compat/linuxkpi/common/include/linux X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 329464 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Feb 2018 20:09:44 -0000 Author: hselasky Date: Sat Feb 17 20:09:43 2018 New Revision: 329464 URL: https://svnweb.freebsd.org/changeset/base/329464 Log: Add checks for valid IRQ tag before setting up or tearing down an interrupt handler in the LinuxKPI. This is needed when the interrupt handler is disabled before freeing the interrupt. MFC after: 1 week Submitted by: Johannes Lundberg Sponsored by: Mellanox Technologies Modified: head/sys/compat/linuxkpi/common/include/linux/interrupt.h Modified: head/sys/compat/linuxkpi/common/include/linux/interrupt.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/interrupt.h Sat Feb 17 18:30:25 2018 (r329463) +++ head/sys/compat/linuxkpi/common/include/linux/interrupt.h Sat Feb 17 20:09:43 2018 (r329464) @@ -121,7 +121,7 @@ enable_irq(unsigned int irq) if (dev == NULL) return -EINVAL; irqe = linux_irq_ent(dev, irq); - if (irqe == NULL) + if (irqe == NULL || irqe->tag != NULL) return -EINVAL; return -bus_setup_intr(dev->bsddev, irqe->res, INTR_TYPE_NET | INTR_MPSAFE, NULL, linux_irq_handler, irqe, &irqe->tag); @@ -139,7 +139,8 @@ disable_irq(unsigned int irq) irqe = linux_irq_ent(dev, irq); if (irqe == NULL) return; - bus_teardown_intr(dev->bsddev, irqe->res, irqe->tag); + if (irqe->tag != NULL) + bus_teardown_intr(dev->bsddev, irqe->res, irqe->tag); irqe->tag = NULL; } @@ -174,7 +175,8 @@ free_irq(unsigned int irq, void *device) irqe = linux_irq_ent(dev, irq); if (irqe == NULL) return; - bus_teardown_intr(dev->bsddev, irqe->res, irqe->tag); + if (irqe->tag != NULL) + bus_teardown_intr(dev->bsddev, irqe->res, irqe->tag); bus_release_resource(dev->bsddev, SYS_RES_IRQ, rid, irqe->res); list_del(&irqe->links); kfree(irqe); From owner-svn-src-all@freebsd.org Sat Feb 17 20:37:22 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6FF3FF0CC6C; Sat, 17 Feb 2018 20:37:22 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2574B6B277; Sat, 17 Feb 2018 20:37:22 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2045C21AE8; Sat, 17 Feb 2018 20:37:22 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1HKbMVE044620; Sat, 17 Feb 2018 20:37:22 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1HKbLfo044617; Sat, 17 Feb 2018 20:37:21 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201802172037.w1HKbLfo044617@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Sat, 17 Feb 2018 20:37:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329465 - head/sys/compat/linuxkpi/common/include/linux X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 329465 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Feb 2018 20:37:22 -0000 Author: hselasky Date: Sat Feb 17 20:37:21 2018 New Revision: 329465 URL: https://svnweb.freebsd.org/changeset/base/329465 Log: Move the IRQ_RETVAL() and irqreturn definitions to irqreturn.h in the LinuxKPI to be compatible with Linux. No functional change. MFC after: 1 week Submitted by: Johannes Lundberg Sponsored by: Mellanox Technologies Added: head/sys/compat/linuxkpi/common/include/linux/irqreturn.h (contents, props changed) Modified: head/sys/compat/linuxkpi/common/include/linux/device.h head/sys/compat/linuxkpi/common/include/linux/interrupt.h Modified: head/sys/compat/linuxkpi/common/include/linux/device.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/device.h Sat Feb 17 20:09:43 2018 (r329464) +++ head/sys/compat/linuxkpi/common/include/linux/device.h Sat Feb 17 20:37:21 2018 (r329465) @@ -46,9 +46,6 @@ #include -enum irqreturn { IRQ_NONE = 0, IRQ_HANDLED, IRQ_WAKE_THREAD, }; -typedef enum irqreturn irqreturn_t; - struct device; struct fwnode_handle; Modified: head/sys/compat/linuxkpi/common/include/linux/interrupt.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/interrupt.h Sat Feb 17 20:09:43 2018 (r329464) +++ head/sys/compat/linuxkpi/common/include/linux/interrupt.h Sat Feb 17 20:37:21 2018 (r329465) @@ -33,13 +33,12 @@ #include #include +#include #include #include typedef irqreturn_t (*irq_handler_t)(int, void *); - -#define IRQ_RETVAL(x) ((x) != IRQ_NONE) #define IRQF_SHARED RF_SHAREABLE Added: head/sys/compat/linuxkpi/common/include/linux/irqreturn.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/compat/linuxkpi/common/include/linux/irqreturn.h Sat Feb 17 20:37:21 2018 (r329465) @@ -0,0 +1,40 @@ +/*- + * Copyright (c) 2017 Limelight Networks, 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 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$ + */ + +#ifndef _LINUX_IRQRETURN_H +#define _LINUX_IRQRETURN_H + +typedef enum irqreturn { + IRQ_NONE = 0, + IRQ_HANDLED = 1, + IRQ_WAKE_THREAD = 2 +} irqreturn_t; + +#define IRQ_RETVAL(x) ((x) ? IRQ_HANDLED : IRQ_NONE) + +#endif /* _LINUX_IRQRETURN_H */ From owner-svn-src-all@freebsd.org Sat Feb 17 20:50:19 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 39069F0DD6C; Sat, 17 Feb 2018 20:50:19 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E27A16BB32; Sat, 17 Feb 2018 20:50:18 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DD4BD21C88; Sat, 17 Feb 2018 20:50:18 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1HKoIcA049479; Sat, 17 Feb 2018 20:50:18 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1HKoIl6049478; Sat, 17 Feb 2018 20:50:18 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201802172050.w1HKoIl6049478@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Sat, 17 Feb 2018 20:50:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329466 - head/sys/compat/linuxkpi/common/include/linux X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 329466 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Feb 2018 20:50:19 -0000 Author: hselasky Date: Sat Feb 17 20:50:18 2018 New Revision: 329466 URL: https://svnweb.freebsd.org/changeset/base/329466 Log: Add support for __percpu and __weak macros in the LinuxKPI. MFC after: 1 week Submitted by: Johannes Lundberg Sponsored by: Mellanox Technologies Modified: head/sys/compat/linuxkpi/common/include/linux/compiler.h Modified: head/sys/compat/linuxkpi/common/include/linux/compiler.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/compiler.h Sat Feb 17 20:37:21 2018 (r329465) +++ head/sys/compat/linuxkpi/common/include/linux/compiler.h Sat Feb 17 20:50:18 2018 (r329466) @@ -56,6 +56,8 @@ #define __devexit #define __exit #define __rcu +#define __percpu +#define __weak __weak_symbol #define __malloc #define ___stringify(...) #__VA_ARGS__ #define __stringify(...) ___stringify(__VA_ARGS__) From owner-svn-src-all@freebsd.org Sat Feb 17 20:52:55 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2FF71F0E209; Sat, 17 Feb 2018 20:52:55 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CA8B76BF93; Sat, 17 Feb 2018 20:52:54 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C270721E18; Sat, 17 Feb 2018 20:52:54 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1HKqs4R054253; Sat, 17 Feb 2018 20:52:54 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1HKqsTr054252; Sat, 17 Feb 2018 20:52:54 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201802172052.w1HKqsTr054252@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Sat, 17 Feb 2018 20:52:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329467 - head/sys/compat/linuxkpi/common/include/linux X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 329467 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Feb 2018 20:52:55 -0000 Author: hselasky Date: Sat Feb 17 20:52:54 2018 New Revision: 329467 URL: https://svnweb.freebsd.org/changeset/base/329467 Log: Add support for mmgrab() function in the LinuxKPI. MFC after: 1 week Submitted by: Johannes Lundberg Sponsored by: Mellanox Technologies Modified: head/sys/compat/linuxkpi/common/include/linux/mm_types.h Modified: head/sys/compat/linuxkpi/common/include/linux/mm_types.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/mm_types.h Sat Feb 17 20:50:18 2018 (r329466) +++ head/sys/compat/linuxkpi/common/include/linux/mm_types.h Sat Feb 17 20:52:54 2018 (r329467) @@ -62,6 +62,12 @@ mmput(struct mm_struct *mm) mmdrop(mm); } +static inline void +mmgrab(struct mm_struct *mm) +{ + atomic_inc(&mm->mm_count); +} + extern struct mm_struct *linux_get_task_mm(struct task_struct *); #define get_task_mm(task) linux_get_task_mm(task) From owner-svn-src-all@freebsd.org Sat Feb 17 20:56:36 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 62CB4F0E618; Sat, 17 Feb 2018 20:56:36 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 171596C1AC; Sat, 17 Feb 2018 20:56:36 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1203A21E1E; Sat, 17 Feb 2018 20:56:36 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1HKuZ9u054453; Sat, 17 Feb 2018 20:56:35 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1HKuZ6t054452; Sat, 17 Feb 2018 20:56:35 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201802172056.w1HKuZ6t054452@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Sat, 17 Feb 2018 20:56:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329468 - head/sys/compat/linuxkpi/common/include/linux X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 329468 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Feb 2018 20:56:36 -0000 Author: hselasky Date: Sat Feb 17 20:56:35 2018 New Revision: 329468 URL: https://svnweb.freebsd.org/changeset/base/329468 Log: Add support for kref_read() function in the LinuxKPI. MFC after: 1 week Submitted by: Johannes Lundberg Sponsored by: Mellanox Technologies Modified: head/sys/compat/linuxkpi/common/include/linux/kref.h Modified: head/sys/compat/linuxkpi/common/include/linux/kref.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/kref.h Sat Feb 17 20:52:54 2018 (r329467) +++ head/sys/compat/linuxkpi/common/include/linux/kref.h Sat Feb 17 20:56:35 2018 (r329468) @@ -52,6 +52,13 @@ kref_init(struct kref *kref) refcount_init(&kref->refcount.counter, 1); } +static inline unsigned int +kref_read(const struct kref *kref) +{ + + return (atomic_read(&kref->refcount)); +} + static inline void kref_get(struct kref *kref) { From owner-svn-src-all@freebsd.org Sat Feb 17 20:59:14 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 534B6F0E9FC; Sat, 17 Feb 2018 20:59:14 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EEC436C3AF; Sat, 17 Feb 2018 20:59: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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E996221E21; Sat, 17 Feb 2018 20:59: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 w1HKxDZw054608; Sat, 17 Feb 2018 20:59:13 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1HKxCWS054597; Sat, 17 Feb 2018 20:59:12 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201802172059.w1HKxCWS054597@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Sat, 17 Feb 2018 20:59:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329469 - in head/sys/powerpc: aim booke include powerpc ps3 pseries X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: in head/sys/powerpc: aim booke include powerpc ps3 pseries X-SVN-Commit-Revision: 329469 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Feb 2018 20:59:14 -0000 Author: jhibbits Date: Sat Feb 17 20:59:12 2018 New Revision: 329469 URL: https://svnweb.freebsd.org/changeset/base/329469 Log: Merge AIM and Book-E PCPU fields This is part of a long-term goal of merging Book-E and AIM into a single GENERIC kernel. As more work is done, the struct may be optimized further. Reviewed by: nwhitehorn Modified: head/sys/powerpc/aim/aim_machdep.c head/sys/powerpc/aim/mmu_oea64.c head/sys/powerpc/aim/moea64_native.c head/sys/powerpc/aim/slb.c head/sys/powerpc/booke/booke_machdep.c head/sys/powerpc/booke/pmap.c head/sys/powerpc/include/pcpu.h head/sys/powerpc/powerpc/genassym.c head/sys/powerpc/powerpc/trap.c head/sys/powerpc/ps3/mmu_ps3.c head/sys/powerpc/pseries/mmu_phyp.c Modified: head/sys/powerpc/aim/aim_machdep.c ============================================================================== --- head/sys/powerpc/aim/aim_machdep.c Sat Feb 17 20:56:35 2018 (r329468) +++ head/sys/powerpc/aim/aim_machdep.c Sat Feb 17 20:59:12 2018 (r329469) @@ -442,7 +442,7 @@ cpu_pcpu_init(struct pcpu *pcpu, int cpuid, size_t sz) { #ifdef __powerpc64__ /* Copy the SLB contents from the current CPU */ -memcpy(pcpu->pc_slb, PCPU_GET(slb), sizeof(pcpu->pc_slb)); +memcpy(pcpu->pc_aim.slb, PCPU_GET(aim.slb), sizeof(pcpu->pc_aim.slb)); #endif } Modified: head/sys/powerpc/aim/mmu_oea64.c ============================================================================== --- head/sys/powerpc/aim/mmu_oea64.c Sat Feb 17 20:56:35 2018 (r329468) +++ head/sys/powerpc/aim/mmu_oea64.c Sat Feb 17 20:59:12 2018 (r329469) @@ -601,7 +601,7 @@ moea64_bootstrap_slb_prefault(vm_offset_t va, int larg uint64_t esid, slbe; uint64_t i; - cache = PCPU_GET(slb); + cache = PCPU_GET(aim.slb); esid = va >> ADDR_SR_SHFT; slbe = (esid << SLBE_ESID_SHIFT) | SLBE_VALID; @@ -840,8 +840,8 @@ moea64_mid_bootstrap(mmu_t mmup, vm_offset_t kernelsta */ #ifdef __powerpc64__ for (i = 0; i < 64; i++) { - pcpup->pc_slb[i].slbv = 0; - pcpup->pc_slb[i].slbe = 0; + pcpup->pc_aim.slb[i].slbv = 0; + pcpup->pc_aim.slb[i].slbe = 0; } #else for (i = 0; i < 16; i++) @@ -1017,9 +1017,10 @@ moea64_pmap_init_qpages(void) if (pc->pc_qmap_addr == 0) panic("pmap_init_qpages: unable to allocate KVA"); PMAP_LOCK(kernel_pmap); - pc->pc_qmap_pvo = moea64_pvo_find_va(kernel_pmap, pc->pc_qmap_addr); + pc->pc_aim.qmap_pvo = + moea64_pvo_find_va(kernel_pmap, pc->pc_qmap_addr); PMAP_UNLOCK(kernel_pmap); - mtx_init(&pc->pc_qmap_lock, "qmap lock", NULL, MTX_DEF); + mtx_init(&pc->pc_aim.qmap_lock, "qmap lock", NULL, MTX_DEF); } } @@ -1038,7 +1039,7 @@ moea64_activate(mmu_t mmu, struct thread *td) CPU_SET(PCPU_GET(cpuid), &pm->pm_active); #ifdef __powerpc64__ - PCPU_SET(userslb, pm->pm_slb); + PCPU_SET(aim.userslb, pm->pm_slb); __asm __volatile("slbmte %0, %1; isync" :: "r"(td->td_pcb->pcb_cpu.aim.usr_vsid), "r"(USER_SLB_SLBE)); #else @@ -1057,7 +1058,7 @@ moea64_deactivate(mmu_t mmu, struct thread *td) pm = &td->td_proc->p_vmspace->vm_pmap; CPU_CLR(PCPU_GET(cpuid), &pm->pm_active); #ifdef __powerpc64__ - PCPU_SET(userslb, NULL); + PCPU_SET(aim.userslb, NULL); #else PCPU_SET(curpmap, NULL); #endif @@ -1153,12 +1154,12 @@ moea64_copy_pages_dmap(mmu_t mmu, vm_page_t *ma, vm_of while (xfersize > 0) { a_pg_offset = a_offset & PAGE_MASK; cnt = min(xfersize, PAGE_SIZE - a_pg_offset); - a_cp = (char *)PHYS_TO_DMAP( + a_cp = (char *)(uintptr_t)PHYS_TO_DMAP( VM_PAGE_TO_PHYS(ma[a_offset >> PAGE_SHIFT])) + a_pg_offset; b_pg_offset = b_offset & PAGE_MASK; cnt = min(cnt, PAGE_SIZE - b_pg_offset); - b_cp = (char *)PHYS_TO_DMAP( + b_cp = (char *)(uintptr_t)PHYS_TO_DMAP( VM_PAGE_TO_PHYS(mb[b_offset >> PAGE_SHIFT])) + b_pg_offset; bcopy(a_cp, b_cp, cnt); @@ -1219,7 +1220,7 @@ moea64_zero_page_area(mmu_t mmu, vm_page_t m, int off, panic("moea64_zero_page: size + off > PAGE_SIZE"); if (hw_direct_map) { - bzero((caddr_t)PHYS_TO_DMAP(pa) + off, size); + bzero((caddr_t)(uintptr_t)PHYS_TO_DMAP(pa) + off, size); } else { mtx_lock(&moea64_scratchpage_mtx); moea64_set_scratchpage_pa(mmu, 0, pa); @@ -1270,10 +1271,10 @@ moea64_quick_enter_page(mmu_t mmu, vm_page_t m) */ sched_pin(); - mtx_assert(PCPU_PTR(qmap_lock), MA_NOTOWNED); - pvo = PCPU_GET(qmap_pvo); + mtx_assert(PCPU_PTR(aim.qmap_lock), MA_NOTOWNED); + pvo = PCPU_GET(aim.qmap_pvo); - mtx_lock(PCPU_PTR(qmap_lock)); + mtx_lock(PCPU_PTR(aim.qmap_lock)); pvo->pvo_pte.pa = moea64_calc_wimg(pa, pmap_page_get_memattr(m)) | (uint64_t)pa; MOEA64_PTE_REPLACE(mmu, pvo, MOEA64_PTE_INVALIDATE); @@ -1288,10 +1289,10 @@ moea64_quick_remove_page(mmu_t mmu, vm_offset_t addr) if (hw_direct_map) return; - mtx_assert(PCPU_PTR(qmap_lock), MA_OWNED); + mtx_assert(PCPU_PTR(aim.qmap_lock), MA_OWNED); KASSERT(PCPU_GET(qmap_addr) == addr, ("moea64_quick_remove_page: invalid address")); - mtx_unlock(PCPU_PTR(qmap_lock)); + mtx_unlock(PCPU_PTR(aim.qmap_lock)); sched_unpin(); } @@ -1417,11 +1418,11 @@ moea64_syncicache(mmu_t mmu, pmap_t pmap, vm_offset_t * If PMAP is not bootstrapped, we are likely to be * in real mode. */ - __syncicache((void *)pa, sz); + __syncicache((void *)(uintptr_t)pa, sz); } else if (pmap == kernel_pmap) { __syncicache((void *)va, sz); } else if (hw_direct_map) { - __syncicache((void *)PHYS_TO_DMAP(pa), sz); + __syncicache((void *)(uintptr_t)PHYS_TO_DMAP(pa), sz); } else { /* Use the scratch page to set up a temp mapping */ @@ -1802,8 +1803,8 @@ moea64_kenter_attr(mmu_t mmu, vm_offset_t va, vm_paddr } if (error != 0 && error != ENOENT) - panic("moea64_kenter: failed to enter va %#zx pa %#zx: %d", va, - pa, error); + panic("moea64_kenter: failed to enter va %#zx pa %#jx: %d", va, + (uintmax_t)pa, error); } void @@ -2767,7 +2768,7 @@ void moea64_dumpsys_map(mmu_t mmu, vm_paddr_t pa, size_t sz, void **va) { - *va = (void *)pa; + *va = (void *)(uintptr_t)pa; } extern struct dump_pa dump_map[PHYS_AVAIL_SZ + 1]; @@ -2799,7 +2800,7 @@ moea64_scan_init(mmu_t mmu) dump_map[0].pa_start; /* 2nd: msgbuf and tables (see pmap_bootstrap()). */ - dump_map[1].pa_start = (vm_paddr_t)msgbufp->msg_ptr; + dump_map[1].pa_start = (vm_paddr_t)(uintptr_t)msgbufp->msg_ptr; dump_map[1].pa_size = round_page(msgbufp->msg_size); /* 3rd: kernel VM. */ Modified: head/sys/powerpc/aim/moea64_native.c ============================================================================== --- head/sys/powerpc/aim/moea64_native.c Sat Feb 17 20:56:35 2018 (r329468) +++ head/sys/powerpc/aim/moea64_native.c Sat Feb 17 20:59:12 2018 (r329469) @@ -365,7 +365,7 @@ moea64_cpu_bootstrap_native(mmu_t mmup, int ap) { int i = 0; #ifdef __powerpc64__ - struct slb *slb = PCPU_GET(slb); + struct slb *slb = PCPU_GET(aim.slb); register_t seg0; #endif Modified: head/sys/powerpc/aim/slb.c ============================================================================== --- head/sys/powerpc/aim/slb.c Sat Feb 17 20:56:35 2018 (r329468) +++ head/sys/powerpc/aim/slb.c Sat Feb 17 20:59:12 2018 (r329469) @@ -426,7 +426,7 @@ slb_insert_kernel(uint64_t slbe, uint64_t slbv) /* We don't want to be preempted while modifying the kernel map */ critical_enter(); - slbcache = PCPU_GET(slb); + slbcache = PCPU_GET(aim.slb); /* Check for an unused slot, abusing the user slot as a full flag */ if (slbcache[USER_SLB_SLOT].slbe == 0) { Modified: head/sys/powerpc/booke/booke_machdep.c ============================================================================== --- head/sys/powerpc/booke/booke_machdep.c Sat Feb 17 20:56:35 2018 (r329468) +++ head/sys/powerpc/booke/booke_machdep.c Sat Feb 17 20:59:12 2018 (r329469) @@ -380,14 +380,14 @@ void cpu_pcpu_init(struct pcpu *pcpu, int cpuid, size_t sz) { - pcpu->pc_tid_next = TID_MIN; + pcpu->pc_booke.tid_next = TID_MIN; #ifdef SMP uintptr_t *ptr; int words_per_gran = RES_GRANULE / sizeof(uintptr_t); ptr = &tlb0_miss_locks[cpuid * words_per_gran]; - pcpu->pc_booke_tlb_lock = ptr; + pcpu->pc_booke.tlb_lock = ptr; *ptr = TLB_UNLOCKED; *(ptr + 1) = 0; /* recurse counter */ #endif Modified: head/sys/powerpc/booke/pmap.c ============================================================================== --- head/sys/powerpc/booke/pmap.c Sat Feb 17 20:56:35 2018 (r329468) +++ head/sys/powerpc/booke/pmap.c Sat Feb 17 20:59:12 2018 (r329469) @@ -501,12 +501,12 @@ tlb_miss_lock(void) if (pc != pcpup) { CTR3(KTR_PMAP, "%s: tlb miss LOCK of CPU=%d, " - "tlb_lock=%p", __func__, pc->pc_cpuid, pc->pc_booke_tlb_lock); + "tlb_lock=%p", __func__, pc->pc_cpuid, pc->pc_booke.tlb_lock); KASSERT((pc->pc_cpuid != PCPU_GET(cpuid)), ("tlb_miss_lock: tried to lock self")); - tlb_lock(pc->pc_booke_tlb_lock); + tlb_lock(pc->pc_booke.tlb_lock); CTR1(KTR_PMAP, "%s: locked", __func__); } @@ -528,7 +528,7 @@ tlb_miss_unlock(void) CTR2(KTR_PMAP, "%s: tlb miss UNLOCK of CPU=%d", __func__, pc->pc_cpuid); - tlb_unlock(pc->pc_booke_tlb_lock); + tlb_unlock(pc->pc_booke.tlb_lock); CTR1(KTR_PMAP, "%s: unlocked", __func__); } @@ -3738,10 +3738,10 @@ tid_alloc(pmap_t pmap) thiscpu = PCPU_GET(cpuid); - tid = PCPU_GET(tid_next); + tid = PCPU_GET(booke.tid_next); if (tid > TID_MAX) tid = TID_MIN; - PCPU_SET(tid_next, tid + 1); + PCPU_SET(booke.tid_next, tid + 1); /* If we are stealing TID then clear the relevant pmap's field */ if (tidbusy[thiscpu][tid] != NULL) { @@ -3759,7 +3759,7 @@ tid_alloc(pmap_t pmap) __asm __volatile("msync; isync"); CTR3(KTR_PMAP, "%s: e (%02d next = %02d)", __func__, tid, - PCPU_GET(tid_next)); + PCPU_GET(booke.tid_next)); return (tid); } Modified: head/sys/powerpc/include/pcpu.h ============================================================================== --- head/sys/powerpc/include/pcpu.h Sat Feb 17 20:56:35 2018 (r329468) +++ head/sys/powerpc/include/pcpu.h Sat Feb 17 20:59:12 2018 (r329469) @@ -52,23 +52,22 @@ struct pvo_entry; register_t pc_tempsave[CPUSAVE_LEN]; \ register_t pc_disisave[CPUSAVE_LEN]; \ register_t pc_dbsave[CPUSAVE_LEN]; \ - void *pc_restore; + void *pc_restore; \ + vm_offset_t pc_qmap_addr; #define PCPU_MD_AIM32_FIELDS \ - vm_offset_t pc_qmap_addr; \ - struct pvo_entry *pc_qmap_pvo; \ - struct mtx pc_qmap_lock; \ - char __pad[128] + struct pvo_entry *qmap_pvo; \ + struct mtx qmap_lock; \ + char __pad[128]; #define PCPU_MD_AIM64_FIELDS \ - struct slb pc_slb[64]; \ - struct slb **pc_userslb; \ - register_t pc_slbsave[18]; \ - uint8_t pc_slbstack[1024]; \ - vm_offset_t pc_qmap_addr; \ - struct pvo_entry *pc_qmap_pvo; \ - struct mtx pc_qmap_lock; \ - char __pad[1345] + struct slb slb[64]; \ + struct slb **userslb; \ + register_t slbsave[18]; \ + uint8_t slbstack[1024]; \ + struct pvo_entry *qmap_pvo; \ + struct mtx qmap_lock; \ + char __pad[1345]; #ifdef __powerpc64__ #define PCPU_MD_AIM_FIELDS PCPU_MD_AIM64_FIELDS @@ -87,14 +86,13 @@ struct pvo_entry; #define BOOKE_PCPU_PAD 429 #endif #define PCPU_MD_BOOKE_FIELDS \ - register_t pc_booke_critsave[BOOKE_CRITSAVE_LEN]; \ - register_t pc_booke_mchksave[CPUSAVE_LEN]; \ - register_t pc_booke_tlbsave[BOOKE_TLBSAVE_LEN]; \ - register_t pc_booke_tlb_level; \ - vm_offset_t pc_qmap_addr; \ - uintptr_t *pc_booke_tlb_lock; \ - int pc_tid_next; \ - char __pad[BOOKE_PCPU_PAD] + register_t critsave[BOOKE_CRITSAVE_LEN]; \ + register_t mchksave[CPUSAVE_LEN]; \ + register_t tlbsave[BOOKE_TLBSAVE_LEN]; \ + register_t tlb_level; \ + uintptr_t *tlb_lock; \ + int tid_next; \ + char __pad[BOOKE_PCPU_PAD]; /* Definitions for register offsets within the exception tmp save areas */ #define CPUSAVE_R27 0 /* where r27 gets saved */ @@ -129,24 +127,16 @@ struct pvo_entry; #define TLBSAVE_BOOKE_R30 14 #define TLBSAVE_BOOKE_R31 15 -#ifdef AIM #define PCPU_MD_FIELDS \ PCPU_MD_COMMON_FIELDS \ - PCPU_MD_AIM_FIELDS -#endif -#if defined(BOOKE) -#define PCPU_MD_FIELDS \ - PCPU_MD_COMMON_FIELDS \ - PCPU_MD_BOOKE_FIELDS -#endif - -/* - * Catch-all for ports (e.g. lsof, used by gtop) - */ -#ifndef PCPU_MD_FIELDS -#define PCPU_MD_FIELDS \ - int pc_md_placeholder[32] -#endif + union { \ + struct { \ + PCPU_MD_AIM_FIELDS \ + } pc_aim; \ + struct { \ + PCPU_MD_BOOKE_FIELDS \ + } pc_booke; \ + } #ifdef _KERNEL Modified: head/sys/powerpc/powerpc/genassym.c ============================================================================== --- head/sys/powerpc/powerpc/genassym.c Sat Feb 17 20:56:35 2018 (r329468) +++ head/sys/powerpc/powerpc/genassym.c Sat Feb 17 20:59:12 2018 (r329469) @@ -66,11 +66,11 @@ ASSYM(PC_DBSAVE, offsetof(struct pcpu, pc_dbsave)); ASSYM(PC_RESTORE, offsetof(struct pcpu, pc_restore)); #if defined(BOOKE) -ASSYM(PC_BOOKE_CRITSAVE, offsetof(struct pcpu, pc_booke_critsave)); -ASSYM(PC_BOOKE_MCHKSAVE, offsetof(struct pcpu, pc_booke_mchksave)); -ASSYM(PC_BOOKE_TLBSAVE, offsetof(struct pcpu, pc_booke_tlbsave)); -ASSYM(PC_BOOKE_TLB_LEVEL, offsetof(struct pcpu, pc_booke_tlb_level)); -ASSYM(PC_BOOKE_TLB_LOCK, offsetof(struct pcpu, pc_booke_tlb_lock)); +ASSYM(PC_BOOKE_CRITSAVE, offsetof(struct pcpu, pc_booke.critsave)); +ASSYM(PC_BOOKE_MCHKSAVE, offsetof(struct pcpu, pc_booke.mchksave)); +ASSYM(PC_BOOKE_TLBSAVE, offsetof(struct pcpu, pc_booke.tlbsave)); +ASSYM(PC_BOOKE_TLB_LEVEL, offsetof(struct pcpu, pc_booke.tlb_level)); +ASSYM(PC_BOOKE_TLB_LOCK, offsetof(struct pcpu, pc_booke.tlb_lock)); #endif ASSYM(CPUSAVE_R27, CPUSAVE_R27*sizeof(register_t)); @@ -109,10 +109,10 @@ ASSYM(MTX_LOCK, offsetof(struct mtx, mtx_lock)); #if defined(AIM) ASSYM(USER_ADDR, USER_ADDR); #ifdef __powerpc64__ -ASSYM(PC_KERNSLB, offsetof(struct pcpu, pc_slb)); -ASSYM(PC_USERSLB, offsetof(struct pcpu, pc_userslb)); -ASSYM(PC_SLBSAVE, offsetof(struct pcpu, pc_slbsave)); -ASSYM(PC_SLBSTACK, offsetof(struct pcpu, pc_slbstack)); +ASSYM(PC_KERNSLB, offsetof(struct pcpu, pc_aim.slb)); +ASSYM(PC_USERSLB, offsetof(struct pcpu, pc_aim.userslb)); +ASSYM(PC_SLBSAVE, offsetof(struct pcpu, pc_aim.slbsave)); +ASSYM(PC_SLBSTACK, offsetof(struct pcpu, pc_aim.slbstack)); ASSYM(USER_SLB_SLOT, USER_SLB_SLOT); ASSYM(USER_SLB_SLBE, USER_SLB_SLBE); ASSYM(SEGMENT_MASK, SEGMENT_MASK); Modified: head/sys/powerpc/powerpc/trap.c ============================================================================== --- head/sys/powerpc/powerpc/trap.c Sat Feb 17 20:56:35 2018 (r329468) +++ head/sys/powerpc/powerpc/trap.c Sat Feb 17 20:59:12 2018 (r329469) @@ -652,7 +652,7 @@ handle_kernel_slb_spill(int type, register_t dar, regi int i; addr = (type == EXC_ISE) ? srr0 : dar; - slbcache = PCPU_GET(slb); + slbcache = PCPU_GET(aim.slb); esid = (uintptr_t)addr >> ADDR_SR_SHFT; slbe = (esid << SLBE_ESID_SHIFT) | SLBE_VALID; Modified: head/sys/powerpc/ps3/mmu_ps3.c ============================================================================== --- head/sys/powerpc/ps3/mmu_ps3.c Sat Feb 17 20:56:35 2018 (r329468) +++ head/sys/powerpc/ps3/mmu_ps3.c Sat Feb 17 20:59:12 2018 (r329469) @@ -121,7 +121,7 @@ mps3_bootstrap(mmu_t mmup, vm_offset_t kernelstart, vm static void mps3_cpu_bootstrap(mmu_t mmup, int ap) { - struct slb *slb = PCPU_GET(slb); + struct slb *slb = PCPU_GET(aim.slb); register_t seg0; int i; Modified: head/sys/powerpc/pseries/mmu_phyp.c ============================================================================== --- head/sys/powerpc/pseries/mmu_phyp.c Sat Feb 17 20:56:35 2018 (r329468) +++ head/sys/powerpc/pseries/mmu_phyp.c Sat Feb 17 20:59:12 2018 (r329469) @@ -221,7 +221,7 @@ mphyp_bootstrap(mmu_t mmup, vm_offset_t kernelstart, v static void mphyp_cpu_bootstrap(mmu_t mmup, int ap) { - struct slb *slb = PCPU_GET(slb); + struct slb *slb = PCPU_GET(aim.slb); register_t seg0; int i; From owner-svn-src-all@freebsd.org Sat Feb 17 21:25:20 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7346DF10D71; Sat, 17 Feb 2018 21:25:20 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 142D86D5E4; Sat, 17 Feb 2018 21:25:20 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0ECB822310; Sat, 17 Feb 2018 21:25:20 +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 w1HLPJTR069030; Sat, 17 Feb 2018 21:25:19 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1HLPJ8G069029; Sat, 17 Feb 2018 21:25:19 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201802172125.w1HLPJ8G069029@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Sat, 17 Feb 2018 21:25:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329470 - head/sys/compat/linuxkpi/common/include/linux X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 329470 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Feb 2018 21:25:20 -0000 Author: hselasky Date: Sat Feb 17 21:25:19 2018 New Revision: 329470 URL: https://svnweb.freebsd.org/changeset/base/329470 Log: Add support for printk_ratelimit() function macro and improve the existing printk_ratelimited() function macro to return a boolean stating if there was a printout, true, or not, false. MFC after: 1 week Submitted by: Johannes Lundberg Sponsored by: Mellanox Technologies Modified: head/sys/compat/linuxkpi/common/include/linux/printk.h Modified: head/sys/compat/linuxkpi/common/include/linux/printk.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/printk.h Sat Feb 17 20:59:12 2018 (r329469) +++ head/sys/compat/linuxkpi/common/include/linux/printk.h Sat Feb 17 21:25:19 2018 (r329470) @@ -106,10 +106,16 @@ print_hex_dump_bytes(const char *prefix_str, const int print_hex_dump(NULL, prefix_str, prefix_type, 16, 1, buf, len, 0); } -#define printk_ratelimited(...) do { \ +#define printk_ratelimit() ({ \ static linux_ratelimit_t __ratelimited; \ - if (linux_ratelimited(&__ratelimited)) \ + linux_ratelimited(&__ratelimited); \ +}) + +#define printk_ratelimited(...) ({ \ + bool __retval = printk_ratelimit(); \ + if (__retval) \ printk(__VA_ARGS__); \ -} while (0) + __retval; \ +}) #endif /* _LINUX_PRINTK_H_ */ From owner-svn-src-all@freebsd.org Sat Feb 17 21:40:20 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 051FDF12114; Sat, 17 Feb 2018 21:40:20 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A5B396DF57; Sat, 17 Feb 2018 21:40:19 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9C2FB224C2; Sat, 17 Feb 2018 21:40:19 +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 w1HLeJSN074276; Sat, 17 Feb 2018 21:40:19 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1HLeJbD074275; Sat, 17 Feb 2018 21:40:19 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201802172140.w1HLeJbD074275@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Sat, 17 Feb 2018 21:40:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329471 - head/sys/compat/linuxkpi/common/include/linux X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 329471 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Feb 2018 21:40:20 -0000 Author: hselasky Date: Sat Feb 17 21:40:19 2018 New Revision: 329471 URL: https://svnweb.freebsd.org/changeset/base/329471 Log: Implement BUILD_BUG_ON_INVALID() function macro in the LinuxKPI. MFC after: 1 week Submitted by: Johannes Lundberg Sponsored by: Mellanox Technologies Modified: head/sys/compat/linuxkpi/common/include/linux/kernel.h Modified: head/sys/compat/linuxkpi/common/include/linux/kernel.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/kernel.h Sat Feb 17 21:25:19 2018 (r329470) +++ head/sys/compat/linuxkpi/common/include/linux/kernel.h Sat Feb 17 21:40:19 2018 (r329471) @@ -89,6 +89,7 @@ #define BUILD_BUG_ON(x) CTASSERT(!(x)) #define BUILD_BUG_ON_MSG(x, msg) BUILD_BUG_ON(x) #define BUILD_BUG_ON_NOT_POWER_OF_2(x) BUILD_BUG_ON(!powerof2(x)) +#define BUILD_BUG_ON_INVALID(expr) while (0) { (void)(expr); } #define BUG() panic("BUG at %s:%d", __FILE__, __LINE__) #define BUG_ON(cond) do { \ From owner-svn-src-all@freebsd.org Sat Feb 17 21:47:16 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E2998F12D1F; Sat, 17 Feb 2018 21:47:15 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 953806E894; Sat, 17 Feb 2018 21:47:15 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9021F22673; Sat, 17 Feb 2018 21:47:15 +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 w1HLlFLn079630; Sat, 17 Feb 2018 21:47:15 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1HLlFq3079629; Sat, 17 Feb 2018 21:47:15 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201802172147.w1HLlFq3079629@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Sat, 17 Feb 2018 21:47:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329472 - head/sys/compat/linuxkpi/common/include/linux X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 329472 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Feb 2018 21:47:16 -0000 Author: hselasky Date: Sat Feb 17 21:47:15 2018 New Revision: 329472 URL: https://svnweb.freebsd.org/changeset/base/329472 Log: Allow the put_user() function macro to put constant values by using the existing __put_user() macro. MFC after: 1 week Submitted by: Johannes Lundberg Sponsored by: Mellanox Technologies Modified: head/sys/compat/linuxkpi/common/include/linux/uaccess.h Modified: head/sys/compat/linuxkpi/common/include/linux/uaccess.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/uaccess.h Sat Feb 17 21:40:19 2018 (r329471) +++ head/sys/compat/linuxkpi/common/include/linux/uaccess.h Sat Feb 17 21:47:15 2018 (r329472) @@ -58,7 +58,7 @@ linux_copyout(&(__x), (_p), sizeof(*(_p))); \ }) #define get_user(_x, _p) linux_copyin((_p), &(_x), sizeof(*(_p))) -#define put_user(_x, _p) linux_copyout(&(_x), (_p), sizeof(*(_p))) +#define put_user(_x, _p) __put_user(_x, _p) #define clear_user(...) linux_clear_user(__VA_ARGS__) #define access_ok(...) linux_access_ok(__VA_ARGS__) From owner-svn-src-all@freebsd.org Sat Feb 17 22:17:22 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C4603F1556B; Sat, 17 Feb 2018 22:17:21 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9CC636FC0F; Sat, 17 Feb 2018 22:17:21 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7D89C22BBD; Sat, 17 Feb 2018 22:17: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 w1HMHLSl094375; Sat, 17 Feb 2018 22:17:21 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1HMHL5O094373; Sat, 17 Feb 2018 22:17:21 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201802172217.w1HMHL5O094373@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Sat, 17 Feb 2018 22:17:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329473 - head/stand/liblua X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/stand/liblua X-SVN-Commit-Revision: 329473 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Feb 2018 22:17:22 -0000 Author: cem Date: Sat Feb 17 22:17:21 2018 New Revision: 329473 URL: https://svnweb.freebsd.org/changeset/base/329473 Log: liblua: Clean up io/loader C module registration Utilize registration APIs Lua provides to make module definition a little cleaner. Discussed with: imp Sponsored by: Dell EMC Isilon Modified: head/stand/liblua/lutils.c head/stand/liblua/lutils.h Modified: head/stand/liblua/lutils.c ============================================================================== --- head/stand/liblua/lutils.c Sat Feb 17 21:47:15 2018 (r329472) +++ head/stand/liblua/lutils.c Sat Feb 17 22:17:21 2018 (r329473) @@ -210,59 +210,34 @@ lua_readfile(lua_State *L) return 2; } -void -lregister(lua_State *L, const char *tableName, const char *funcName, int (*funcPointer)(lua_State *)) -{ - lua_getglobal(L, tableName); - if (!lua_istable(L, -1)) { - lua_pop(L, 1); - lua_newtable(L); - lua_setglobal(L, tableName); - lua_getglobal(L, tableName); - } +#define REG_SIMPLE(n) { #n, lua_ ## n } +static const struct luaL_Reg loaderlib[] = { + REG_SIMPLE(delay), + REG_SIMPLE(getenv), + REG_SIMPLE(perform), + REG_SIMPLE(printc), + REG_SIMPLE(setenv), + REG_SIMPLE(time), + REG_SIMPLE(unsetenv), + { NULL, NULL }, +}; - lua_pushcfunction(L, funcPointer); - lua_setfield(L, -2, funcName); - lua_pop(L, 1); -} +static const struct luaL_Reg iolib[] = { + { "close", lua_closefile }, + REG_SIMPLE(getchar), + REG_SIMPLE(gets), + REG_SIMPLE(ischar), + { "open", lua_openfile }, + { "read", lua_readfile }, + { NULL, NULL }, +}; +#undef REG_SIMPLE - -typedef struct utils_func -{ - int (*func)(lua_State *); - const char *table; - const char *name; -} utils_func; - -static utils_func reg_funcs[] = { - {lua_delay, "loader", "delay"}, - {lua_getenv, "loader", "getenv"}, - {lua_perform, "loader", "perform"}, - {lua_printc, "loader", "printc"}, - {lua_setenv, "loader", "setenv"}, - {lua_time, "loader", "time"}, - {lua_unsetenv, "loader", "unsetenv"}, - - {lua_closefile, "io", "close"}, - {lua_getchar, "io", "getchar"}, - {lua_gets, "io", "gets"}, - {lua_ischar, "io", "ischar"}, - {lua_openfile, "io", "open"}, - {lua_readfile, "io", "read"}, - - {NULL, NULL, NULL}, - }; - void register_utils(lua_State *L) { - utils_func *f = reg_funcs; - - while (f->func != NULL && f->name != NULL) { - if (f->table != NULL) - lregister(L, f->table, f->name, f->func); - else - lua_register(L, f->name, f->func); - ++f; - } + luaL_newlib(L, loaderlib); + lua_setglobal(L, "loader"); + luaL_newlib(L, iolib); + lua_setglobal(L, "io"); } Modified: head/stand/liblua/lutils.h ============================================================================== --- head/stand/liblua/lutils.h Sat Feb 17 21:47:15 2018 (r329472) +++ head/stand/liblua/lutils.h Sat Feb 17 22:17:21 2018 (r329473) @@ -28,5 +28,4 @@ #include -void lregister(lua_State *, const char *, const char *, int (*fptr)(lua_State *)); void register_utils(lua_State *); From owner-svn-src-all@freebsd.org Sat Feb 17 22:18:40 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 72E6CF15731; Sat, 17 Feb 2018 22:18:40 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 279D46FDB4; Sat, 17 Feb 2018 22:18:40 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 220D422BBE; Sat, 17 Feb 2018 22:18:40 +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 w1HMIeQG094466; Sat, 17 Feb 2018 22:18:40 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1HMId5X094464; Sat, 17 Feb 2018 22:18:39 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201802172218.w1HMId5X094464@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Sat, 17 Feb 2018 22:18:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329474 - head/stand/liblua X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/stand/liblua X-SVN-Commit-Revision: 329474 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Feb 2018 22:18:40 -0000 Author: cem Date: Sat Feb 17 22:18:39 2018 New Revision: 329474 URL: https://svnweb.freebsd.org/changeset/base/329474 Log: liblua: Emulate DIR, opendir, fdopendir, closedir In a similar fashion to FILE, provide thin shims for the standard directory manipulation functions. Reviewed by: imp Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D14417 Modified: head/stand/liblua/lstd.c head/stand/liblua/lstd.h Modified: head/stand/liblua/lstd.c ============================================================================== --- head/stand/liblua/lstd.c Sat Feb 17 22:17:21 2018 (r329473) +++ head/stand/liblua/lstd.c Sat Feb 17 22:18:39 2018 (r329474) @@ -127,6 +127,42 @@ getc(FILE *stream) return EOF; } +DIR * +opendir(const char *name) +{ + DIR *dp; + int fd; + + fd = open(name, O_RDONLY); + if (fd < 0) + return NULL; + dp = fdopendir(fd); + if (dp == NULL) + close(fd); + return dp; +} + +DIR * +fdopendir(int fd) +{ + DIR *dp; + + dp = malloc(sizeof(*dp)); + if (dp == NULL) + return NULL; + dp->fd = fd; + return dp; +} + +int +closedir(DIR *dp) +{ + close(dp->fd); + dp->fd = -1; + free(dp); + return 0; +} + void luai_writestring(const char *s, int i) { Modified: head/stand/liblua/lstd.h ============================================================================== --- head/stand/liblua/lstd.h Sat Feb 17 22:17:21 2018 (r329473) +++ head/stand/liblua/lstd.h Sat Feb 17 22:18:39 2018 (r329474) @@ -43,6 +43,11 @@ typedef struct FILE size_t size; } FILE; +typedef struct DIR +{ + int fd; +} DIR; + FILE *fopen(const char *filename, const char *mode); FILE *freopen( const char *filename, const char *mode, FILE *stream); size_t fread(void *ptr, size_t size, size_t count, FILE *stream); @@ -50,6 +55,9 @@ int fclose(FILE *stream); int ferror(FILE *stream); int feof(FILE *stream); int getc(FILE * stream); +DIR *opendir(const char *name); +DIR *fdopendir(int fd); +int closedir(DIR *); #ifndef EOF #define EOF (-1) From owner-svn-src-all@freebsd.org Sat Feb 17 22:33:26 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DD48BF16CA4; Sat, 17 Feb 2018 22:33:26 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8FCD370A81; Sat, 17 Feb 2018 22:33:26 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8AA4622EFB; Sat, 17 Feb 2018 22:33:26 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1HMXQGm004660; Sat, 17 Feb 2018 22:33:26 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1HMXQOb004659; Sat, 17 Feb 2018 22:33:26 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201802172233.w1HMXQOb004659@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Sat, 17 Feb 2018 22:33:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329475 - head/sys/compat/linuxkpi/common/include/linux X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 329475 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Feb 2018 22:33:27 -0000 Author: hselasky Date: Sat Feb 17 22:33:26 2018 New Revision: 329475 URL: https://svnweb.freebsd.org/changeset/base/329475 Log: Implement get_task_pid() function macro in the LinuxKPI. MFC after: 1 week Submitted by: Johannes Lundberg Sponsored by: Mellanox Technologies Modified: head/sys/compat/linuxkpi/common/include/linux/pid.h Modified: head/sys/compat/linuxkpi/common/include/linux/pid.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/pid.h Sat Feb 17 22:18:39 2018 (r329474) +++ head/sys/compat/linuxkpi/common/include/linux/pid.h Sat Feb 17 22:33:26 2018 (r329475) @@ -58,6 +58,11 @@ enum pid_type { __ts; \ }) +#define get_task_pid(task, type) ({ \ + CTASSERT((type) == PIDTYPE_PID); \ + (task)->task_thread->td_tid; \ +}) + struct task_struct; extern struct task_struct *linux_pid_task(pid_t); extern struct task_struct *linux_get_pid_task(pid_t); From owner-svn-src-all@freebsd.org Sat Feb 17 22:41:21 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 523BBF17518; Sat, 17 Feb 2018 22:41:21 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0569770F42; Sat, 17 Feb 2018 22:41:21 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0063522F48; Sat, 17 Feb 2018 22:41:21 +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 w1HMfKen008058; Sat, 17 Feb 2018 22:41:20 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1HMfKXG008057; Sat, 17 Feb 2018 22:41:20 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201802172241.w1HMfKXG008057@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Sat, 17 Feb 2018 22:41:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329476 - head/sys/compat/linuxkpi/common/include/linux X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 329476 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Feb 2018 22:41:21 -0000 Author: hselasky Date: Sat Feb 17 22:41:20 2018 New Revision: 329476 URL: https://svnweb.freebsd.org/changeset/base/329476 Log: Stub more lockdep function macros in the LinuxKPI. MFC after: 1 week Submitted by: Johannes Lundberg Sponsored by: Mellanox Technologies Modified: head/sys/compat/linuxkpi/common/include/linux/lockdep.h Modified: head/sys/compat/linuxkpi/common/include/linux/lockdep.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/lockdep.h Sat Feb 17 22:33:26 2018 (r329475) +++ head/sys/compat/linuxkpi/common/include/linux/lockdep.h Sat Feb 17 22:41:20 2018 (r329476) @@ -48,5 +48,10 @@ struct lock_class_key { #define lockdep_is_held(m) (sx_xholder(&(m)->sx) == curthread) #define might_lock(m) do { } while (0) +#define might_lock_read(m) do { } while (0) + +#define lock_acquire(...) do { } while (0) +#define lock_release(...) do { } while (0) +#define lock_acquire_shared_recursive(...) do { } while (0) #endif /* _LINUX_LOCKDEP_H_ */ From owner-svn-src-all@freebsd.org Sat Feb 17 22:45:16 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7A525F17AF4; Sat, 17 Feb 2018 22:45:16 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2C16B712CD; Sat, 17 Feb 2018 22:45:16 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 26915230DE; Sat, 17 Feb 2018 22:45:16 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1HMjGm2009854; Sat, 17 Feb 2018 22:45:16 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1HMjGRD009853; Sat, 17 Feb 2018 22:45:16 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201802172245.w1HMjGRD009853@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Sat, 17 Feb 2018 22:45:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329477 - head/sys/compat/linuxkpi/common/include/linux X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 329477 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Feb 2018 22:45:16 -0000 Author: hselasky Date: Sat Feb 17 22:45:15 2018 New Revision: 329477 URL: https://svnweb.freebsd.org/changeset/base/329477 Log: Implement spin_trylock_irq() function macro in the LinuxKPI. MFC after: 1 week Submitted by: Johannes Lundberg Sponsored by: Mellanox Technologies Modified: head/sys/compat/linuxkpi/common/include/linux/spinlock.h Modified: head/sys/compat/linuxkpi/common/include/linux/spinlock.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/spinlock.h Sat Feb 17 22:41:20 2018 (r329476) +++ head/sys/compat/linuxkpi/common/include/linux/spinlock.h Sat Feb 17 22:45:15 2018 (r329477) @@ -98,6 +98,9 @@ typedef struct { __ret; \ }) +#define spin_trylock_irq(_l) \ + spin_trylock(_l) + #define spin_lock_nested(_l, _n) do { \ if (SPIN_SKIP()) \ break; \ From owner-svn-src-all@freebsd.org Sat Feb 17 23:05:20 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5835DF19317; Sat, 17 Feb 2018 23:05:20 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EC81671F6D; Sat, 17 Feb 2018 23:05: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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D8A9123412; Sat, 17 Feb 2018 23:05:19 +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 w1HN5JXB021286; Sat, 17 Feb 2018 23:05:19 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1HN5J6T021285; Sat, 17 Feb 2018 23:05:19 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201802172305.w1HN5J6T021285@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sat, 17 Feb 2018 23:05:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r329478 - stable/11/cddl/contrib/opensolaris/cmd/zpool X-SVN-Group: stable-11 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: stable/11/cddl/contrib/opensolaris/cmd/zpool X-SVN-Commit-Revision: 329478 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Feb 2018 23:05:20 -0000 Author: mav Date: Sat Feb 17 23:05:19 2018 New Revision: 329478 URL: https://svnweb.freebsd.org/changeset/base/329478 Log: MFC r319671: SHA-512 and Skein have been supported by the boot loader for some time. Modified: stable/11/cddl/contrib/opensolaris/cmd/zpool/zpool-features.7 Directory Properties: stable/11/ (props changed) Modified: stable/11/cddl/contrib/opensolaris/cmd/zpool/zpool-features.7 ============================================================================== --- stable/11/cddl/contrib/opensolaris/cmd/zpool/zpool-features.7 Sat Feb 17 22:45:15 2018 (r329477) +++ stable/11/cddl/contrib/opensolaris/cmd/zpool/zpool-features.7 Sat Feb 17 23:05:19 2018 (r329478) @@ -23,7 +23,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 31, 2016 +.Dd June 7, 2017 .Dt ZPOOL-FEATURES 7 .Os .Sh NAME @@ -497,10 +497,6 @@ and will return to being once all filesystems that have ever had their checksum set to .Sy sha512 are destroyed. -.Pp -Booting off of a pools utilizing SHA-512/256 is -.Em NOT -yet supported. .It Sy skein .Bl -column "READ\-ONLY COMPATIBLE" "org.illumos:skein" .It GUID Ta org.illumos:skein @@ -543,12 +539,6 @@ and will return to being once all filesystems that have ever had their checksum set to .Sy skein are destroyed. -.Pp -Booting off of pools using -.Sy skein -is -.Em NOT -supported. .El .Sh SEE ALSO .Xr zpool 8 From owner-svn-src-all@freebsd.org Sat Feb 17 23:23:27 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C1153F1AA9C; Sat, 17 Feb 2018 23:23:27 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6A58572A1A; Sat, 17 Feb 2018 23:23:27 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 604E523768; Sat, 17 Feb 2018 23:23:27 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1HNNR99031046; Sat, 17 Feb 2018 23:23:27 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1HNNRtE031045; Sat, 17 Feb 2018 23:23:27 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201802172323.w1HNNRtE031045@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sat, 17 Feb 2018 23:23:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329479 - head/sys/dev/usb/controller X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/sys/dev/usb/controller X-SVN-Commit-Revision: 329479 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Feb 2018 23:23:27 -0000 Author: ian Date: Sat Feb 17 23:23:27 2018 New Revision: 329479 URL: https://svnweb.freebsd.org/changeset/base/329479 Log: Do not try to deallocate memory that wasn't allocated (you'd think that would be safe, but the function also tries to destroy mutexes that never got created). I guess this can only happen when imx_ehci_detach() is called on the error-exit path from imx_ehci_attach(), and that path never got exercised before today. Modified: head/sys/dev/usb/controller/ehci_imx.c Modified: head/sys/dev/usb/controller/ehci_imx.c ============================================================================== --- head/sys/dev/usb/controller/ehci_imx.c Sat Feb 17 23:05:19 2018 (r329478) +++ head/sys/dev/usb/controller/ehci_imx.c Sat Feb 17 23:23:27 2018 (r329479) @@ -268,6 +268,7 @@ struct imx_ehci_softc { device_t dev; struct resource *ehci_mem_res; /* EHCI core regs. */ struct resource *ehci_irq_res; /* EHCI core IRQ. */ + bool usb_mem_allocated; }; static struct ofw_compat_data compat_data[] = { @@ -331,7 +332,8 @@ imx_ehci_detach(device_t dev) bus_release_resource(dev, SYS_RES_MEMORY, 0, sc->ehci_mem_res); - usb_bus_mem_free_all(&esc->sc_bus, &ehci_iterate_hw_softc); + if (sc->usb_mem_allocated) + usb_bus_mem_free_all(&esc->sc_bus, &ehci_iterate_hw_softc); /* During module unload there are lots of children leftover */ device_delete_children(dev); @@ -413,6 +415,7 @@ imx_ehci_attach(device_t dev) err = ENOMEM; goto out; } + sc->usb_mem_allocated = true; /* * Set handle to USB related registers subregion used by From owner-svn-src-all@freebsd.org Sat Feb 17 23:39:11 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 27282F1BF5D; Sat, 17 Feb 2018 23:39:11 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C191773362; Sat, 17 Feb 2018 23:39:10 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BC5642390B; Sat, 17 Feb 2018 23:39:10 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1HNdAHg036368; Sat, 17 Feb 2018 23:39:10 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1HNdAB0036367; Sat, 17 Feb 2018 23:39:10 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201802172339.w1HNdAB0036367@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sat, 17 Feb 2018 23:39:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329480 - head/sys/dev/sdhci X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/sys/dev/sdhci X-SVN-Commit-Revision: 329480 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Feb 2018 23:39:11 -0000 Author: ian Date: Sat Feb 17 23:39:10 2018 New Revision: 329480 URL: https://svnweb.freebsd.org/changeset/base/329480 Log: Don't call sdhci_cleanup_slot() if sdhci_init_slot() never got called. Also, do callout_init() very early in attach, so that callout_drain() can be called in detach without worrying about whether it ever got init'd. Modified: head/sys/dev/sdhci/fsl_sdhci.c Modified: head/sys/dev/sdhci/fsl_sdhci.c ============================================================================== --- head/sys/dev/sdhci/fsl_sdhci.c Sat Feb 17 23:23:27 2018 (r329479) +++ head/sys/dev/sdhci/fsl_sdhci.c Sat Feb 17 23:39:10 2018 (r329480) @@ -92,6 +92,7 @@ struct fsl_sdhci_softc { uint16_t sdclockreg_freq_bits; uint8_t r1bfix_type; uint8_t hwtype; + bool slot_init_done; }; #define R1BFIX_NONE 0 /* No fix needed at next interrupt. */ @@ -810,6 +811,9 @@ fsl_sdhci_detach(device_t dev) callout_drain(&sc->r1bfix_callout); + if (sc->slot_init_done) + sdhci_cleanup_slot(&sc->slot); + if (sc->intr_cookie != NULL) bus_teardown_intr(dev, sc->irq_res, sc->intr_cookie); if (sc->irq_res != NULL) @@ -817,7 +821,6 @@ fsl_sdhci_detach(device_t dev) rman_get_rid(sc->irq_res), sc->irq_res); if (sc->mem_res != NULL) { - sdhci_cleanup_slot(&sc->slot); bus_release_resource(dev, SYS_RES_MEMORY, rman_get_rid(sc->mem_res), sc->mem_res); } @@ -837,6 +840,8 @@ fsl_sdhci_attach(device_t dev) sc->dev = dev; + callout_init(&sc->r1bfix_callout, 1); + sc->hwtype = ofw_bus_search_compatible(dev, compat_data)->ocd_data; if (sc->hwtype == HWTYPE_NONE) panic("Impossible: not compatible in fsl_sdhci_attach()"); @@ -924,8 +929,8 @@ fsl_sdhci_attach(device_t dev) WR4(sc, SDHC_PROT_CTRL, protctl); #endif - callout_init(&sc->r1bfix_callout, 1); sdhci_init_slot(dev, &sc->slot, 0); + sc->slot_init_done = true; bus_generic_probe(dev); bus_generic_attach(dev); From owner-svn-src-all@freebsd.org Sat Feb 17 23:51:16 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 24387F1D157; Sat, 17 Feb 2018 23:51:16 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CAE1473C7B; Sat, 17 Feb 2018 23:51:15 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C57DA23AE2; Sat, 17 Feb 2018 23:51:15 +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 w1HNpF1j044179; Sat, 17 Feb 2018 23:51:15 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1HNpFnp044178; Sat, 17 Feb 2018 23:51:15 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201802172351.w1HNpFnp044178@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sat, 17 Feb 2018 23:51:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r329481 - stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-11 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Commit-Revision: 329481 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Feb 2018 23:51:16 -0000 Author: mav Date: Sat Feb 17 23:51:15 2018 New Revision: 329481 URL: https://svnweb.freebsd.org/changeset/base/329481 Log: MFC r321104 (by jhibbits): Make ZFS not crash on mount on 32-bit systems ZPL_VERSION is unsigned long long, not an int. With this change, a zpool can be created on a 32-bit system (tested on powerpcspe) and mounted correctly. Modified: stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_history.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_history.c ============================================================================== --- stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_history.c Sat Feb 17 23:39:10 2018 (r329480) +++ stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_history.c Sat Feb 17 23:51:15 2018 (r329481) @@ -539,7 +539,7 @@ void spa_history_log_version(spa_t *spa, const char *operation) { spa_history_log_internal(spa, operation, NULL, - "pool version %llu; software version %llu/%d; uts %s %s %s %s", + "pool version %llu; software version %llu/%llu; uts %s %s %s %s", (u_longlong_t)spa_version(spa), SPA_VERSION, ZPL_VERSION, utsname.nodename, utsname.release, utsname.version, utsname.machine); From owner-svn-src-all@freebsd.org Sat Feb 17 23:55:00 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6D81DF1D81B; Sat, 17 Feb 2018 23:55:00 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 173D87411F; Sat, 17 Feb 2018 23:55:00 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0F05D23C3C; Sat, 17 Feb 2018 23:55:00 +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 w1HNsxYm045831; Sat, 17 Feb 2018 23:54:59 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1HNsxIw045830; Sat, 17 Feb 2018 23:54:59 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201802172354.w1HNsxIw045830@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sat, 17 Feb 2018 23:54:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r329482 - stable/11/sys/cddl/contrib/opensolaris/common/zfs X-SVN-Group: stable-11 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: stable/11/sys/cddl/contrib/opensolaris/common/zfs X-SVN-Commit-Revision: 329482 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Feb 2018 23:55:00 -0000 Author: mav Date: Sat Feb 17 23:54:59 2018 New Revision: 329482 URL: https://svnweb.freebsd.org/changeset/base/329482 Log: MFC r323002 (by emaste): zfs: do not advertise edonr which is not yet supported illumos 4185 ("add new cryptographic checksums to ZFS: SHA-512, Skein, Edon-R") was intentionally merged only partially in r289422, without adding support for skein, sha512 and edonr on FreeBSD. Support for skein and sha512 was added later on, but edonr is still not implemented in FreeBSD. Prior to this commit zfs(8) correctly rejected edonr, but with an error message that claimed support: fk@r500 ~ $zfs set checksum=edonr tank cannot set property for 'tank': 'checksum' must be one of 'on | off | fletcher2 | fletcher4 | sha256 | sha512 | skein | edonr' Modified: stable/11/sys/cddl/contrib/opensolaris/common/zfs/zfs_prop.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/cddl/contrib/opensolaris/common/zfs/zfs_prop.c ============================================================================== --- stable/11/sys/cddl/contrib/opensolaris/common/zfs/zfs_prop.c Sat Feb 17 23:51:15 2018 (r329481) +++ stable/11/sys/cddl/contrib/opensolaris/common/zfs/zfs_prop.c Sat Feb 17 23:54:59 2018 (r329482) @@ -242,11 +242,11 @@ zfs_prop_init(void) ZIO_CHECKSUM_DEFAULT, PROP_INHERIT, ZFS_TYPE_FILESYSTEM | ZFS_TYPE_VOLUME, "on | off | fletcher2 | fletcher4 | sha256 | sha512 | " - "skein | edonr", "CHECKSUM", checksum_table); + "skein", "CHECKSUM", checksum_table); zprop_register_index(ZFS_PROP_DEDUP, "dedup", ZIO_CHECKSUM_OFF, PROP_INHERIT, ZFS_TYPE_FILESYSTEM | ZFS_TYPE_VOLUME, "on | off | verify | sha256[,verify], sha512[,verify], " - "skein[,verify], edonr,verify", "DEDUP", dedup_table); + "skein[,verify]", "DEDUP", dedup_table); zprop_register_index(ZFS_PROP_COMPRESSION, "compression", ZIO_COMPRESS_DEFAULT, PROP_INHERIT, ZFS_TYPE_FILESYSTEM | ZFS_TYPE_VOLUME,