From owner-svn-src-all@freebsd.org Sun Jul 19 01:59:56 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B635E37A717; Sun, 19 Jul 2020 01:59:56 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4B8SjS4PjTz42M2; Sun, 19 Jul 2020 01:59:56 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7AFD81441A; Sun, 19 Jul 2020 01:59:56 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06J1xu7Q060870; Sun, 19 Jul 2020 01:59:56 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06J1xuRB060869; Sun, 19 Jul 2020 01:59:56 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <202007190159.06J1xuRB060869@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Sun, 19 Jul 2020 01:59:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r363315 - stable/12/sbin/newfs_msdos X-SVN-Group: stable-12 X-SVN-Commit-Author: delphij X-SVN-Commit-Paths: stable/12/sbin/newfs_msdos X-SVN-Commit-Revision: 363315 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 19 Jul 2020 01:59:56 -0000 Author: delphij Date: Sun Jul 19 01:59:56 2020 New Revision: 363315 URL: https://svnweb.freebsd.org/changeset/base/363315 Log: MFC r362937: Use KERN_MAXPHYS. Modified: stable/12/sbin/newfs_msdos/mkfs_msdos.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sbin/newfs_msdos/mkfs_msdos.c ============================================================================== --- stable/12/sbin/newfs_msdos/mkfs_msdos.c Sat Jul 18 23:11:40 2020 (r363314) +++ stable/12/sbin/newfs_msdos/mkfs_msdos.c Sun Jul 19 01:59:56 2020 (r363315) @@ -36,8 +36,10 @@ static const char rcsid[] = #include #include #include +#include #include +#include #include #include #include @@ -73,25 +75,6 @@ static const char rcsid[] = #define MAXCLS16 0xfff4U /* maximum FAT16 clusters */ #define MAXCLS32 0xffffff4U /* maximum FAT32 clusters */ -#ifndef CTASSERT -#define CTASSERT(x) _CTASSERT(x, __LINE__) -#define _CTASSERT(x, y) __CTASSERT(x, y) -#define __CTASSERT(x, y) typedef char __assert_ ## y [(x) ? 1 : -1] -#endif - -/* - * For better performance, we want to write larger chunks instead of - * individual sectors (the size can only be 512, 1024, 2048 or 4096 - * bytes). Assert that MAXPHYS can always hold an integer number of - * sectors by asserting that both are power of two numbers and the - * MAXPHYS is greater than MAXBPS. - */ -CTASSERT(powerof2(MAXPHYS)); -CTASSERT(powerof2(MAXBPS)); -CTASSERT(MAXPHYS > MAXBPS); - -const static ssize_t chunksize = MAXPHYS; - #define mincls(fat) ((fat) == 12 ? MINCLS12 : \ (fat) == 16 ? MINCLS16 : \ MINCLS32) @@ -235,6 +218,7 @@ static volatile sig_atomic_t got_siginfo; static void infohandler(int); static int check_mounted(const char *, mode_t); +static ssize_t getchunksize(void); static int getstdfmt(const char *, struct bpb *); static int getdiskinfo(int, const char *, const char *, int, struct bpb *); static void print_bpb(struct bpb *); @@ -267,6 +251,7 @@ mkfs_msdos(const char *fname, const char *dtype, const bool set_res, set_spf, set_spc; int fd, fd1, rv; struct msdos_options o = *op; + ssize_t chunksize; physbuf = NULL; rv = -1; @@ -629,6 +614,7 @@ mkfs_msdos(const char *fname, const char *dtype, const tm = localtime(&now); } + chunksize = getchunksize(); physbuf = malloc(chunksize); if (physbuf == NULL) { warn(NULL); @@ -829,6 +815,47 @@ check_mounted(const char *fname, mode_t mode) } } return 0; +} + +/* + * Get optimal I/O size + */ +static ssize_t +getchunksize(void) +{ + static int chunksize; + + if (chunksize != 0) + return ((ssize_t)chunksize); + +#ifdef KERN_MAXPHYS + int mib[2]; + size_t len; + + mib[0] = CTL_KERN; + mib[1] = KERN_MAXPHYS; + len = sizeof(chunksize); + + if (sysctl(mib, 2, &chunksize, &len, NULL, 0) == -1) { + warn("sysctl: KERN_MAXPHYS, using %zu", (size_t)MAXPHYS); + chunksize = 0; + } +#endif + if (chunksize == 0) + chunksize = MAXPHYS; + + /* + * For better performance, we want to write larger chunks instead of + * individual sectors (the size can only be 512, 1024, 2048 or 4096 + * bytes). Assert that chunksize can always hold an integer number of + * sectors by asserting that both are power of two numbers and the + * chunksize is greater than MAXBPS. + */ + static_assert(powerof2(MAXBPS), "MAXBPS is not power of 2"); + assert(powerof2(chunksize)); + assert(chunksize > MAXBPS); + + return ((ssize_t)chunksize); } /* From owner-svn-src-all@freebsd.org Sun Jul 19 03:02:46 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D5C8537C181; Sun, 19 Jul 2020 03:02:46 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4B8V5y5MDBz45MN; Sun, 19 Jul 2020 03:02:46 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9B1E214DF4; Sun, 19 Jul 2020 03:02:46 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06J32kSR004660; Sun, 19 Jul 2020 03:02:46 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06J32kUW004659; Sun, 19 Jul 2020 03:02:46 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <202007190302.06J32kUW004659@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Sun, 19 Jul 2020 03:02:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r363317 - stable/11/sbin/newfs_msdos X-SVN-Group: stable-11 X-SVN-Commit-Author: delphij X-SVN-Commit-Paths: stable/11/sbin/newfs_msdos X-SVN-Commit-Revision: 363317 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 19 Jul 2020 03:02:46 -0000 Author: delphij Date: Sun Jul 19 03:02:46 2020 New Revision: 363317 URL: https://svnweb.freebsd.org/changeset/base/363317 Log: MFC r362937: Use KERN_MAXPHYS. Modified: stable/11/sbin/newfs_msdos/mkfs_msdos.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sbin/newfs_msdos/mkfs_msdos.c ============================================================================== --- stable/11/sbin/newfs_msdos/mkfs_msdos.c Sun Jul 19 02:14:34 2020 (r363316) +++ stable/11/sbin/newfs_msdos/mkfs_msdos.c Sun Jul 19 03:02:46 2020 (r363317) @@ -36,8 +36,10 @@ static const char rcsid[] = #include #include #include +#include #include +#include #include #include #include @@ -73,25 +75,6 @@ static const char rcsid[] = #define MAXCLS16 0xfff4U /* maximum FAT16 clusters */ #define MAXCLS32 0xffffff4U /* maximum FAT32 clusters */ -#ifndef CTASSERT -#define CTASSERT(x) _CTASSERT(x, __LINE__) -#define _CTASSERT(x, y) __CTASSERT(x, y) -#define __CTASSERT(x, y) typedef char __assert_ ## y [(x) ? 1 : -1] -#endif - -/* - * For better performance, we want to write larger chunks instead of - * individual sectors (the size can only be 512, 1024, 2048 or 4096 - * bytes). Assert that MAXPHYS can always hold an integer number of - * sectors by asserting that both are power of two numbers and the - * MAXPHYS is greater than MAXBPS. - */ -CTASSERT(powerof2(MAXPHYS)); -CTASSERT(powerof2(MAXBPS)); -CTASSERT(MAXPHYS > MAXBPS); - -const static ssize_t chunksize = MAXPHYS; - #define mincls(fat) ((fat) == 12 ? MINCLS12 : \ (fat) == 16 ? MINCLS16 : \ MINCLS32) @@ -235,6 +218,7 @@ static volatile sig_atomic_t got_siginfo; static void infohandler(int); static int check_mounted(const char *, mode_t); +static ssize_t getchunksize(void); static int getstdfmt(const char *, struct bpb *); static int getdiskinfo(int, const char *, const char *, int, struct bpb *); static void print_bpb(struct bpb *); @@ -267,6 +251,7 @@ mkfs_msdos(const char *fname, const char *dtype, const bool set_res, set_spf, set_spc; int fd, fd1, rv; struct msdos_options o = *op; + ssize_t chunksize; physbuf = NULL; rv = -1; @@ -629,6 +614,7 @@ mkfs_msdos(const char *fname, const char *dtype, const tm = localtime(&now); } + chunksize = getchunksize(); physbuf = malloc(chunksize); if (physbuf == NULL) { warn(NULL); @@ -829,6 +815,47 @@ check_mounted(const char *fname, mode_t mode) } } return 0; +} + +/* + * Get optimal I/O size + */ +static ssize_t +getchunksize(void) +{ + static int chunksize; + + if (chunksize != 0) + return ((ssize_t)chunksize); + +#ifdef KERN_MAXPHYS + int mib[2]; + size_t len; + + mib[0] = CTL_KERN; + mib[1] = KERN_MAXPHYS; + len = sizeof(chunksize); + + if (sysctl(mib, 2, &chunksize, &len, NULL, 0) == -1) { + warn("sysctl: KERN_MAXPHYS, using %zu", (size_t)MAXPHYS); + chunksize = 0; + } +#endif + if (chunksize == 0) + chunksize = MAXPHYS; + + /* + * For better performance, we want to write larger chunks instead of + * individual sectors (the size can only be 512, 1024, 2048 or 4096 + * bytes). Assert that chunksize can always hold an integer number of + * sectors by asserting that both are power of two numbers and the + * chunksize is greater than MAXBPS. + */ + static_assert(powerof2(MAXBPS), "MAXBPS is not power of 2"); + assert(powerof2(chunksize)); + assert(chunksize > MAXBPS); + + return ((ssize_t)chunksize); } /* From owner-svn-src-all@freebsd.org Sun Jul 19 06:59:09 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A956E37EEE3; Sun, 19 Jul 2020 06:59:09 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4B8bLj48Brz4Dyq; Sun, 19 Jul 2020 06:59:09 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7192117D13; Sun, 19 Jul 2020 06:59:09 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06J6x9cT044577; Sun, 19 Jul 2020 06:59:09 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06J6x9mA044576; Sun, 19 Jul 2020 06:59:09 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <202007190659.06J6x9mA044576@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Sun, 19 Jul 2020 06:59:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363318 - head/stand/i386/loader X-SVN-Group: head X-SVN-Commit-Author: tsoome X-SVN-Commit-Paths: head/stand/i386/loader X-SVN-Commit-Revision: 363318 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 19 Jul 2020 06:59:09 -0000 Author: tsoome Date: Sun Jul 19 06:59:09 2020 New Revision: 363318 URL: https://svnweb.freebsd.org/changeset/base/363318 Log: loader: cstyle cleanup No functional changes intended. Sponsored by: Netflix, Klara Inc. Modified: head/stand/i386/loader/main.c Modified: head/stand/i386/loader/main.c ============================================================================== --- head/stand/i386/loader/main.c Sun Jul 19 03:02:46 2020 (r363317) +++ head/stand/i386/loader/main.c Sun Jul 19 06:59:09 2020 (r363318) @@ -95,163 +95,171 @@ ptov(uintptr_t x) int main(void) { - int i; + int i; - /* Pick up arguments */ - kargs = (void *)__args; - initial_howto = kargs->howto; - initial_bootdev = kargs->bootdev; - initial_bootinfo = kargs->bootinfo ? (struct bootinfo *)PTOV(kargs->bootinfo) : NULL; + /* Pick up arguments */ + kargs = (void *)__args; + initial_howto = kargs->howto; + initial_bootdev = kargs->bootdev; + initial_bootinfo = kargs->bootinfo ? + (struct bootinfo *)PTOV(kargs->bootinfo) : NULL; - /* Initialize the v86 register set to a known-good state. */ - bzero(&v86, sizeof(v86)); - v86.efl = PSL_RESERVED_DEFAULT | PSL_I; + /* Initialize the v86 register set to a known-good state. */ + bzero(&v86, sizeof(v86)); + v86.efl = PSL_RESERVED_DEFAULT | PSL_I; - /* - * Initialise the heap as early as possible. Once this is done, malloc() is usable. - */ - bios_getmem(); + /* + * Initialise the heap as early as possible. + * Once this is done, malloc() is usable. + */ + bios_getmem(); #if defined(LOADER_BZIP2_SUPPORT) || defined(LOADER_FIREWIRE_SUPPORT) || \ defined(LOADER_GPT_SUPPORT) || defined(LOADER_ZFS_SUPPORT) - if (high_heap_size > 0) { - heap_top = PTOV(high_heap_base + high_heap_size); - heap_bottom = PTOV(high_heap_base); - if (high_heap_base < memtop_copyin) - memtop_copyin = high_heap_base; - } else + if (high_heap_size > 0) { + heap_top = PTOV(high_heap_base + high_heap_size); + heap_bottom = PTOV(high_heap_base); + if (high_heap_base < memtop_copyin) + memtop_copyin = high_heap_base; + } else #endif - { - heap_top = (void *)PTOV(bios_basemem); - heap_bottom = (void *)end; - } - setheap(heap_bottom, heap_top); + { + heap_top = (void *)PTOV(bios_basemem); + heap_bottom = (void *)end; + } + setheap(heap_bottom, heap_top); - /* - * XXX Chicken-and-egg problem; we want to have console output early, but some - * console attributes may depend on reading from eg. the boot device, which we - * can't do yet. - * - * We can use printf() etc. once this is done. - * If the previous boot stage has requested a serial console, prefer that. - */ - bi_setboothowto(initial_howto); - if (initial_howto & RB_MULTIPLE) { - if (initial_howto & RB_SERIAL) - setenv("console", "comconsole vidconsole", 1); - else - setenv("console", "vidconsole comconsole", 1); - } else if (initial_howto & RB_SERIAL) - setenv("console", "comconsole", 1); - else if (initial_howto & RB_MUTE) - setenv("console", "nullconsole", 1); - cons_probe(); + /* + * XXX Chicken-and-egg problem; we want to have console output early, + * but some console attributes may depend on reading from eg. the boot + * device, which we can't do yet. + * + * We can use printf() etc. once this is done. + * If the previous boot stage has requested a serial console, + * prefer that. + */ + bi_setboothowto(initial_howto); + if (initial_howto & RB_MULTIPLE) { + if (initial_howto & RB_SERIAL) + setenv("console", "comconsole vidconsole", 1); + else + setenv("console", "vidconsole comconsole", 1); + } else if (initial_howto & RB_SERIAL) { + setenv("console", "comconsole", 1); + } else if (initial_howto & RB_MUTE) { + setenv("console", "nullconsole", 1); + } + cons_probe(); - /* - * Initialise the block cache. Set the upper limit. - */ - bcache_init(32768, 512); + /* + * Initialise the block cache. Set the upper limit. + */ + bcache_init(32768, 512); - /* - * Special handling for PXE and CD booting. - */ - if (kargs->bootinfo == 0) { /* - * We only want the PXE disk to try to init itself in the below - * walk through devsw if we actually booted off of PXE. + * Special handling for PXE and CD booting. */ - if (kargs->bootflags & KARGS_FLAGS_PXE) - pxe_enable(kargs->pxeinfo ? PTOV(kargs->pxeinfo) : NULL); - else if (kargs->bootflags & KARGS_FLAGS_CD) - bc_add(initial_bootdev); - } + if (kargs->bootinfo == 0) { + /* + * We only want the PXE disk to try to init itself in the below + * walk through devsw if we actually booted off of PXE. + */ + if (kargs->bootflags & KARGS_FLAGS_PXE) + pxe_enable(kargs->pxeinfo ? + PTOV(kargs->pxeinfo) : NULL); + else if (kargs->bootflags & KARGS_FLAGS_CD) + bc_add(initial_bootdev); + } - archsw.arch_autoload = i386_autoload; - archsw.arch_getdev = i386_getdev; - archsw.arch_copyin = i386_copyin; - archsw.arch_copyout = i386_copyout; - archsw.arch_readin = i386_readin; - archsw.arch_isainb = isa_inb; - archsw.arch_isaoutb = isa_outb; - archsw.arch_hypervisor = x86_hypervisor; + archsw.arch_autoload = i386_autoload; + archsw.arch_getdev = i386_getdev; + archsw.arch_copyin = i386_copyin; + archsw.arch_copyout = i386_copyout; + archsw.arch_readin = i386_readin; + archsw.arch_isainb = isa_inb; + archsw.arch_isaoutb = isa_outb; + archsw.arch_hypervisor = x86_hypervisor; #ifdef LOADER_ZFS_SUPPORT - archsw.arch_zfs_probe = i386_zfs_probe; + archsw.arch_zfs_probe = i386_zfs_probe; - /* - * zfsboot and gptzfsboot have always passed KARGS_FLAGS_ZFS, so if that is - * set along with KARGS_FLAGS_EXTARG we know we can interpret the extarg - * data as a struct zfs_boot_args. - */ + /* + * zfsboot and gptzfsboot have always passed KARGS_FLAGS_ZFS, + * so if that is set along with KARGS_FLAGS_EXTARG we know we + * can interpret the extarg data as a struct zfs_boot_args. + */ #define KARGS_EXTARGS_ZFS (KARGS_FLAGS_EXTARG | KARGS_FLAGS_ZFS) - if ((kargs->bootflags & KARGS_EXTARGS_ZFS) == KARGS_EXTARGS_ZFS) { - zargs = (struct zfs_boot_args *)(kargs + 1); - } + if ((kargs->bootflags & KARGS_EXTARGS_ZFS) == KARGS_EXTARGS_ZFS) { + zargs = (struct zfs_boot_args *)(kargs + 1); + } #endif /* LOADER_ZFS_SUPPORT */ #ifdef LOADER_GELI_SUPPORT - /* - * If we decided earlier that we have zfs_boot_args extarg data, and it is - * big enough to contain the embedded geli data (the early zfs_boot_args - * structs weren't), then init the gbdata pointer accordingly. If there is - * extarg data which isn't zfs_boot_args data, determine whether it is - * geli_boot_args data. Recent versions of gptboot set KARGS_FLAGS_GELI to - * indicate that. Earlier versions didn't, but we presume that's what we - * have if the extarg size exactly matches the size of the geli_boot_args - * struct during that pre-flag era. - */ + /* + * If we decided earlier that we have zfs_boot_args extarg data, + * and it is big enough to contain the embedded geli data + * (the early zfs_boot_args structs weren't), then init the gbdata + * pointer accordingly. If there is extarg data which isn't + * zfs_boot_args data, determine whether it is geli_boot_args data. + * Recent versions of gptboot set KARGS_FLAGS_GELI to indicate that. + * Earlier versions didn't, but we presume that's what we + * have if the extarg size exactly matches the size of the + * geli_boot_args struct during that pre-flag era. + */ #define LEGACY_GELI_ARGS_SIZE 260 /* This can never change */ #ifdef LOADER_ZFS_SUPPORT - if (zargs != NULL) { - if (zargs->size > offsetof(struct zfs_boot_args, gelidata)) { - gbdata = &zargs->gelidata; - } - } else + if (zargs != NULL) { + if (zargs->size > offsetof(struct zfs_boot_args, gelidata)) { + gbdata = &zargs->gelidata; + } + } else #endif /* LOADER_ZFS_SUPPORT */ - if ((kargs->bootflags & KARGS_FLAGS_EXTARG) != 0) { - gargs = (struct geli_boot_args *)(kargs + 1); - if ((kargs->bootflags & KARGS_FLAGS_GELI) || - gargs->size == LEGACY_GELI_ARGS_SIZE) { - gbdata = &gargs->gelidata; + if ((kargs->bootflags & KARGS_FLAGS_EXTARG) != 0) { + gargs = (struct geli_boot_args *)(kargs + 1); + if ((kargs->bootflags & KARGS_FLAGS_GELI) || + gargs->size == LEGACY_GELI_ARGS_SIZE) { + gbdata = &gargs->gelidata; + } } - } - if (gbdata != NULL) - import_geli_boot_data(gbdata); + if (gbdata != NULL) + import_geli_boot_data(gbdata); #endif /* LOADER_GELI_SUPPORT */ - /* - * 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)(); - printf("BIOS %dkB/%dkB available memory\n", bios_basemem / 1024, bios_extmem / 1024); - if (initial_bootinfo != NULL) { - initial_bootinfo->bi_basemem = bios_basemem / 1024; - initial_bootinfo->bi_extmem = bios_extmem / 1024; - } + /* + * 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)(); - /* detect ACPI for future reference */ - biosacpi_detect(); + printf("BIOS %dkB/%dkB available memory\n", bios_basemem / 1024, + bios_extmem / 1024); + if (initial_bootinfo != NULL) { + initial_bootinfo->bi_basemem = bios_basemem / 1024; + initial_bootinfo->bi_extmem = bios_extmem / 1024; + } - /* detect SMBIOS for future reference */ - smbios_detect(NULL); + /* detect ACPI for future reference */ + biosacpi_detect(); - /* detect PCI BIOS for future reference */ - biospci_detect(); + /* detect SMBIOS for future reference */ + smbios_detect(NULL); - printf("\n%s", bootprog_info); + /* detect PCI BIOS for future reference */ + biospci_detect(); - extract_currdev(); /* set $currdev and $loaddev */ + printf("\n%s", bootprog_info); + + extract_currdev(); /* set $currdev and $loaddev */ - bios_getsmap(); + bios_getsmap(); - interact(); + interact(); - /* if we ever get here, it is an error */ - return (1); + /* if we ever get here, it is an error */ + return (1); } /* @@ -263,92 +271,105 @@ main(void) static void extract_currdev(void) { - struct i386_devdesc new_currdev; + struct i386_devdesc new_currdev; #ifdef LOADER_ZFS_SUPPORT - char buf[20]; + char buf[20]; #endif - int biosdev = -1; + int biosdev = -1; - /* Assume we are booting from a BIOS disk by default */ - new_currdev.dd.d_dev = &bioshd; + /* Assume we are booting from a BIOS disk by default */ + new_currdev.dd.d_dev = &bioshd; - /* new-style boot loaders such as pxeldr and cdldr */ - if (kargs->bootinfo == 0) { - if ((kargs->bootflags & KARGS_FLAGS_CD) != 0) { - /* we are booting from a CD with cdboot */ - new_currdev.dd.d_dev = &bioscd; - new_currdev.dd.d_unit = bd_bios2unit(initial_bootdev); - } else if ((kargs->bootflags & KARGS_FLAGS_PXE) != 0) { - /* we are booting from pxeldr */ - new_currdev.dd.d_dev = &pxedisk; - new_currdev.dd.d_unit = 0; - } else { - /* we don't know what our boot device is */ - new_currdev.d_kind.biosdisk.slice = -1; - new_currdev.d_kind.biosdisk.partition = 0; - biosdev = -1; - } + /* new-style boot loaders such as pxeldr and cdldr */ + if (kargs->bootinfo == 0) { + if ((kargs->bootflags & KARGS_FLAGS_CD) != 0) { + /* we are booting from a CD with cdboot */ + new_currdev.dd.d_dev = &bioscd; + new_currdev.dd.d_unit = bd_bios2unit(initial_bootdev); + } else if ((kargs->bootflags & KARGS_FLAGS_PXE) != 0) { + /* we are booting from pxeldr */ + new_currdev.dd.d_dev = &pxedisk; + new_currdev.dd.d_unit = 0; + } else { + /* we don't know what our boot device is */ + new_currdev.d_kind.biosdisk.slice = -1; + new_currdev.d_kind.biosdisk.partition = 0; + biosdev = -1; + } #ifdef LOADER_ZFS_SUPPORT - } else if ((kargs->bootflags & KARGS_FLAGS_ZFS) != 0) { - /* zargs was set in main() if we have new style extended argument */ - if (zargs != NULL && - zargs->size >= offsetof(struct zfs_boot_args, primary_pool)) { - /* sufficient data is provided */ - new_currdev.d_kind.zfs.pool_guid = zargs->pool; - new_currdev.d_kind.zfs.root_guid = zargs->root; - if (zargs->size >= sizeof(*zargs) && zargs->primary_vdev != 0) { - sprintf(buf, "%llu", zargs->primary_pool); - setenv("vfs.zfs.boot.primary_pool", buf, 1); - sprintf(buf, "%llu", zargs->primary_vdev); - setenv("vfs.zfs.boot.primary_vdev", buf, 1); - } + } else if ((kargs->bootflags & KARGS_FLAGS_ZFS) != 0) { + /* + * zargs was set in main() if we have new style extended + * argument + */ + if (zargs != NULL && + zargs->size >= + offsetof(struct zfs_boot_args, primary_pool)) { + /* sufficient data is provided */ + new_currdev.d_kind.zfs.pool_guid = zargs->pool; + new_currdev.d_kind.zfs.root_guid = zargs->root; + if (zargs->size >= sizeof(*zargs) && + zargs->primary_vdev != 0) { + sprintf(buf, "%llu", zargs->primary_pool); + setenv("vfs.zfs.boot.primary_pool", buf, 1); + sprintf(buf, "%llu", zargs->primary_vdev); + setenv("vfs.zfs.boot.primary_vdev", buf, 1); + } + } else { + /* old style zfsboot block */ + new_currdev.d_kind.zfs.pool_guid = kargs->zfspool; + new_currdev.d_kind.zfs.root_guid = 0; + } + new_currdev.dd.d_dev = &zfs_dev; +#endif + } else if ((initial_bootdev & B_MAGICMASK) != B_DEVMAGIC) { + /* The passed-in boot device is bad */ + new_currdev.d_kind.biosdisk.slice = -1; + new_currdev.d_kind.biosdisk.partition = 0; + biosdev = -1; } else { - /* old style zfsboot block */ - new_currdev.d_kind.zfs.pool_guid = kargs->zfspool; - new_currdev.d_kind.zfs.root_guid = 0; + new_currdev.d_kind.biosdisk.slice = + B_SLICE(initial_bootdev) - 1; + new_currdev.d_kind.biosdisk.partition = + B_PARTITION(initial_bootdev); + biosdev = initial_bootinfo->bi_bios_dev; + + /* + * If we are booted by an old bootstrap, we have to guess at + * the BIOS unit number. We will lose if there is more than + * one disk type and we are not booting from the + * lowest-numbered disk type (ie. SCSI when IDE also exists). + */ + if ((biosdev == 0) && (B_TYPE(initial_bootdev) != 2)) { + /* + * biosdev doesn't match major, assume harddisk + */ + biosdev = 0x80 + B_UNIT(initial_bootdev); + } } - new_currdev.dd.d_dev = &zfs_dev; -#endif - } else if ((initial_bootdev & B_MAGICMASK) != B_DEVMAGIC) { - /* The passed-in boot device is bad */ - new_currdev.d_kind.biosdisk.slice = -1; - new_currdev.d_kind.biosdisk.partition = 0; - biosdev = -1; - } else { - new_currdev.d_kind.biosdisk.slice = B_SLICE(initial_bootdev) - 1; - new_currdev.d_kind.biosdisk.partition = B_PARTITION(initial_bootdev); - biosdev = initial_bootinfo->bi_bios_dev; /* - * If we are booted by an old bootstrap, we have to guess at the BIOS - * unit number. We will lose if there is more than one disk type - * and we are not booting from the lowest-numbered disk type - * (ie. SCSI when IDE also exists). + * If we are booting off of a BIOS disk and we didn't succeed + * in determining which one we booted off of, just use disk0: + * as a reasonable default. */ - if ((biosdev == 0) && (B_TYPE(initial_bootdev) != 2)) /* biosdev doesn't match major */ - biosdev = 0x80 + B_UNIT(initial_bootdev); /* assume harddisk */ - } + if ((new_currdev.dd.d_dev->dv_type == bioshd.dv_type) && + ((new_currdev.dd.d_unit = bd_bios2unit(biosdev)) == -1)) { + printf("Can't work out which disk we are booting " + "from.\nGuessed BIOS device 0x%x not found by " + "probes, defaulting to disk0:\n", biosdev); + new_currdev.dd.d_unit = 0; + } - /* - * If we are booting off of a BIOS disk and we didn't succeed in determining - * which one we booted off of, just use disk0: as a reasonable default. - */ - if ((new_currdev.dd.d_dev->dv_type == bioshd.dv_type) && - ((new_currdev.dd.d_unit = bd_bios2unit(biosdev)) == -1)) { - printf("Can't work out which disk we are booting from.\n" - "Guessed BIOS device 0x%x not found by probes, defaulting to disk0:\n", biosdev); - new_currdev.dd.d_unit = 0; - } - #ifdef LOADER_ZFS_SUPPORT - if (new_currdev.dd.d_dev->dv_type == DEVT_ZFS) - init_zfs_bootenv(zfs_fmtdev(&new_currdev)); + if (new_currdev.dd.d_dev->dv_type == DEVT_ZFS) + init_zfs_bootenv(zfs_fmtdev(&new_currdev)); #endif - env_setenv("currdev", EV_VOLATILE, i386_fmtdev(&new_currdev), - i386_setcurrdev, env_nounset); - env_setenv("loaddev", EV_VOLATILE, i386_fmtdev(&new_currdev), env_noset, - env_nounset); + env_setenv("currdev", EV_VOLATILE, i386_fmtdev(&new_currdev), + i386_setcurrdev, env_nounset); + env_setenv("loaddev", EV_VOLATILE, i386_fmtdev(&new_currdev), + env_noset, env_nounset); } COMMAND_SET(reboot, "reboot", "reboot the system", command_reboot); @@ -356,22 +377,22 @@ COMMAND_SET(reboot, "reboot", "reboot the system", com static int command_reboot(int argc, char *argv[]) { - int i; + int i; - for (i = 0; devsw[i] != NULL; ++i) - if (devsw[i]->dv_cleanup != NULL) - (devsw[i]->dv_cleanup)(); + for (i = 0; devsw[i] != NULL; ++i) + if (devsw[i]->dv_cleanup != NULL) + (devsw[i]->dv_cleanup)(); - printf("Rebooting...\n"); - delay(1000000); - __exit(0); + printf("Rebooting...\n"); + delay(1000000); + __exit(0); } /* provide this for panic, as it's not in the startup code */ void exit(int code) { - __exit(code); + __exit(code); } COMMAND_SET(heap, "heap", "show heap usage", command_heap); @@ -379,10 +400,10 @@ COMMAND_SET(heap, "heap", "show heap usage", command_h static int command_heap(int argc, char *argv[]) { - mallocstats(); - printf("heap base at %p, top at %p, upper limit at %p\n", heap_bottom, - sbrk(0), heap_top); - return(CMD_OK); + mallocstats(); + printf("heap base at %p, top at %p, upper limit at %p\n", heap_bottom, + sbrk(0), heap_top); + return (CMD_OK); } /* ISA bus access functions for PnP. */ @@ -390,32 +411,32 @@ static int isa_inb(int port) { - return (inb(port)); + return (inb(port)); } static void isa_outb(int port, int value) { - outb(port, value); + outb(port, value); } #ifdef LOADER_ZFS_SUPPORT static void i386_zfs_probe(void) { - char devname[32]; - struct i386_devdesc dev; + char devname[32]; + struct i386_devdesc dev; - /* - * Open all the disks we can find and see if we can reconstruct - * ZFS pools from them. - */ - dev.dd.d_dev = &bioshd; - for (dev.dd.d_unit = 0; bd_unit2bios(&dev) >= 0; dev.dd.d_unit++) { - snprintf(devname, sizeof(devname), "%s%d:", bioshd.dv_name, - dev.dd.d_unit); - zfs_probe_dev(devname, NULL); - } + /* + * Open all the disks we can find and see if we can reconstruct + * ZFS pools from them. + */ + dev.dd.d_dev = &bioshd; + for (dev.dd.d_unit = 0; bd_unit2bios(&dev) >= 0; dev.dd.d_unit++) { + snprintf(devname, sizeof(devname), "%s%d:", bioshd.dv_name, + dev.dd.d_unit); + zfs_probe_dev(devname, NULL); + } } #endif From owner-svn-src-all@freebsd.org Sun Jul 19 09:29:29 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BE18F359959; Sun, 19 Jul 2020 09:29:29 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4B8fh952yVz4Lwn; Sun, 19 Jul 2020 09:29:29 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 913821989C; Sun, 19 Jul 2020 09:29:29 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06J9TTMj038968; Sun, 19 Jul 2020 09:29:29 GMT (envelope-from melifaro@FreeBSD.org) Received: (from melifaro@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06J9TS30038961; Sun, 19 Jul 2020 09:29:28 GMT (envelope-from melifaro@FreeBSD.org) Message-Id: <202007190929.06J9TS30038961@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: melifaro set sender to melifaro@FreeBSD.org using -f From: "Alexander V. Chernikov" Date: Sun, 19 Jul 2020 09:29:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363319 - in head/sys: fs/nfsclient net netinet6 X-SVN-Group: head X-SVN-Commit-Author: melifaro X-SVN-Commit-Paths: in head/sys: fs/nfsclient net netinet6 X-SVN-Commit-Revision: 363319 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 19 Jul 2020 09:29:29 -0000 Author: melifaro Date: Sun Jul 19 09:29:27 2020 New Revision: 363319 URL: https://svnweb.freebsd.org/changeset/base/363319 Log: Transition from rtrequest1_fib() to rib_action(). Remove all variations of rtrequest and their uses and switch to to rib_action(). This is part of the new routing KPI. Submitted by: Neel Chauhan Differential Revision: https://reviews.freebsd.org/D25546 Modified: head/sys/fs/nfsclient/nfs_clvfsops.c head/sys/net/if.c head/sys/net/route.c head/sys/net/route.h head/sys/netinet6/in6_rmx.c head/sys/netinet6/in6_var.h head/sys/netinet6/nd6.c head/sys/netinet6/nd6_rtr.c Modified: head/sys/fs/nfsclient/nfs_clvfsops.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clvfsops.c Sun Jul 19 06:59:09 2020 (r363318) +++ head/sys/fs/nfsclient/nfs_clvfsops.c Sun Jul 19 09:29:27 2020 (r363319) @@ -68,6 +68,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include @@ -466,6 +467,8 @@ nfs_mountroot(struct mount *mp) nd->mygateway.sin_addr.s_addr != 0) { struct sockaddr_in mask, sin; struct epoch_tracker et; + struct rt_addrinfo info; + struct rib_cmd_info rc; bzero((caddr_t)&mask, sizeof(mask)); sin = mask; @@ -474,10 +477,14 @@ nfs_mountroot(struct mount *mp) /* XXX MRT use table 0 for this sort of thing */ NET_EPOCH_ENTER(et); CURVNET_SET(TD_TO_VNET(td)); - error = rtrequest_fib(RTM_ADD, (struct sockaddr *)&sin, - (struct sockaddr *)&nd->mygateway, - (struct sockaddr *)&mask, - RTF_UP | RTF_GATEWAY, NULL, RT_DEFAULT_FIB); + + bzero((caddr_t)&info, sizeof(info)); + info.rti_flags = RTF_UP | RTF_GATEWAY; + info.rti_info[RTAX_DST] = (struct sockaddr *)&sin; + info.rti_info[RTAX_GATEWAY] = (struct sockaddr *)&nd->mygateway; + info.rti_info[RTAX_NETMASK] = (struct sockaddr *)&mask; + + error = rib_action(RT_DEFAULT_FIB, RTM_ADD, &info, &rc); CURVNET_RESTORE(); NET_EPOCH_EXIT(et); if (error) Modified: head/sys/net/if.c ============================================================================== --- head/sys/net/if.c Sun Jul 19 06:59:09 2020 (r363318) +++ head/sys/net/if.c Sun Jul 19 09:29:27 2020 (r363319) @@ -80,6 +80,7 @@ #include #include #include +#include #include #if defined(INET) || defined(INET6) @@ -1845,6 +1846,7 @@ static int ifa_maintain_loopback_route(int cmd, const char *otype, struct ifaddr *ifa, struct sockaddr *ia) { + struct rib_cmd_info rc; struct epoch_tracker et; int error; struct rt_addrinfo info; @@ -1872,7 +1874,7 @@ ifa_maintain_loopback_route(int cmd, const char *otype info.rti_info[RTAX_GATEWAY] = (struct sockaddr *)&null_sdl; link_init_sdl(ifp, (struct sockaddr *)&null_sdl, ifp->if_type); - error = rtrequest1_fib(cmd, &info, NULL, ifp->if_fib); + error = rib_action(ifp->if_fib, cmd, &info, &rc); NET_EPOCH_EXIT(et); if (rti_ifa != NULL) Modified: head/sys/net/route.c ============================================================================== --- head/sys/net/route.c Sun Jul 19 06:59:09 2020 (r363318) +++ head/sys/net/route.c Sun Jul 19 09:29:27 2020 (r363319) @@ -470,7 +470,7 @@ int rib_add_redirect(u_int fibnum, struct sockaddr *dst, struct sockaddr *gateway, struct sockaddr *author, struct ifnet *ifp, int flags, int lifetime_sec) { - struct rtentry *rt; + struct rib_cmd_info rc; int error; struct rt_addrinfo info; struct rt_metrics rti_rmx; @@ -504,7 +504,7 @@ rib_add_redirect(u_int fibnum, struct sockaddr *dst, s info.rti_mflags |= RTV_EXPIRE; info.rti_rmx = &rti_rmx; - error = rtrequest1_fib(RTM_ADD, &info, &rt, fibnum); + error = rib_action(fibnum, RTM_ADD, &info, &rc); ifa_free(ifa); if (error != 0) { @@ -512,9 +512,9 @@ rib_add_redirect(u_int fibnum, struct sockaddr *dst, s return (error); } - RT_LOCK(rt); - flags = rt->rt_flags; - RT_UNLOCK(rt); + RT_LOCK(rc.rc_rt); + flags = rc.rc_rt->rt_flags; + RT_UNLOCK(rc.rc_rt); RTSTAT_INC(rts_dynamic); @@ -602,33 +602,7 @@ ifa_ifwithroute(int flags, const struct sockaddr *dst, return (ifa); } -/* - * Do appropriate manipulations of a routing tree given - * all the bits of info needed - */ -int -rtrequest_fib(int req, - struct sockaddr *dst, - struct sockaddr *gateway, - struct sockaddr *netmask, - int flags, - struct rtentry **ret_nrt, - u_int fibnum) -{ - struct rt_addrinfo info; - if (dst->sa_len == 0) - return(EINVAL); - - bzero((caddr_t)&info, sizeof(info)); - info.rti_flags = flags; - info.rti_info[RTAX_DST] = dst; - info.rti_info[RTAX_GATEWAY] = gateway; - info.rti_info[RTAX_NETMASK] = netmask; - return rtrequest1_fib(req, &info, ret_nrt, fibnum); -} - - /* * Copy most of @rt data into @info. * @@ -1148,73 +1122,6 @@ rt_mpath_unlink(struct rib_head *rnh, struct rt_addrin } #endif -int -rtrequest1_fib(int req, struct rt_addrinfo *info, struct rtentry **ret_nrt, - u_int fibnum) -{ - const struct sockaddr *dst; - struct rib_head *rnh; - struct rib_cmd_info rc; - int error; - - KASSERT((fibnum < rt_numfibs), ("rtrequest1_fib: bad fibnum")); - KASSERT((info->rti_flags & RTF_RNH_LOCKED) == 0, ("rtrequest1_fib: locked")); - NET_EPOCH_ASSERT(); - - dst = info->rti_info[RTAX_DST]; - - switch (dst->sa_family) { - case AF_INET6: - case AF_INET: - /* We support multiple FIBs. */ - break; - default: - fibnum = RT_DEFAULT_FIB; - break; - } - - /* - * Find the correct routing tree to use for this Address Family - */ - rnh = rt_tables_get_rnh(fibnum, dst->sa_family); - if (rnh == NULL) - return (EAFNOSUPPORT); - - /* - * If we are adding a host route then we don't want to put - * a netmask in the tree, nor do we want to clone it. - */ - if (info->rti_flags & RTF_HOST) - info->rti_info[RTAX_NETMASK] = NULL; - - bzero(&rc, sizeof(struct rib_cmd_info)); - error = 0; - switch (req) { - case RTM_DELETE: - error = del_route(rnh, info, &rc); - break; - case RTM_RESOLVE: - /* - * resolve was only used for route cloning - * here for compat - */ - break; - case RTM_ADD: - error = add_route(rnh, info, &rc); - break; - case RTM_CHANGE: - error = change_route(rnh, info, &rc); - break; - default: - error = EOPNOTSUPP; - } - - if (ret_nrt != NULL) - *ret_nrt = rc.rc_rt; - - return (error); -} - void rt_setmetrics(const struct rt_addrinfo *info, struct rtentry *rt) { @@ -1258,7 +1165,7 @@ rtinit1(struct ifaddr *ifa, int cmd, int flags, int fi struct epoch_tracker et; struct sockaddr *dst; struct sockaddr *netmask; - struct rtentry *rt = NULL; + struct rib_cmd_info rc; struct rt_addrinfo info; int error = 0; int startfib, endfib; @@ -1349,7 +1256,7 @@ rtinit1(struct ifaddr *ifa, int cmd, int flags, int fi if (rn == NULL) error = ESRCH; else { - rt = RNTORT(rn); + struct rtentry *rt = RNTORT(rn); /* * for interface route the gateway * gateway is sockaddr_dl, so @@ -1389,14 +1296,14 @@ rtinit1(struct ifaddr *ifa, int cmd, int flags, int fi info.rti_info[RTAX_GATEWAY] = ifa->ifa_addr; info.rti_info[RTAX_NETMASK] = netmask; NET_EPOCH_ENTER(et); - error = rtrequest1_fib(cmd, &info, &rt, fibnum); - if (error == 0 && rt != NULL) { + error = rib_action(fibnum, cmd, &info, &rc); + if (error == 0 && rc.rc_rt != NULL) { /* * notify any listening routing agents of the change */ /* TODO: interface routes/aliases */ - rt_newaddrmsg_fib(cmd, ifa, rt, fibnum); + rt_newaddrmsg_fib(cmd, ifa, rc.rc_rt, fibnum); didwork = 1; } NET_EPOCH_EXIT(et); Modified: head/sys/net/route.h ============================================================================== --- head/sys/net/route.h Sun Jul 19 06:59:09 2020 (r363318) +++ head/sys/net/route.h Sun Jul 19 09:29:27 2020 (r363319) @@ -411,9 +411,6 @@ int rtinit(struct ifaddr *, int, int); * but this will change.. */ int rtioctl_fib(u_long, caddr_t, u_int); -int rtrequest_fib(int, struct sockaddr *, - struct sockaddr *, struct sockaddr *, int, struct rtentry **, u_int); -int rtrequest1_fib(int, struct rt_addrinfo *, struct rtentry **, u_int); int rib_lookup_info(uint32_t, const struct sockaddr *, uint32_t, uint32_t, struct rt_addrinfo *); void rib_free_info(struct rt_addrinfo *info); Modified: head/sys/netinet6/in6_rmx.c ============================================================================== --- head/sys/netinet6/in6_rmx.c Sun Jul 19 06:59:09 2020 (r363318) +++ head/sys/netinet6/in6_rmx.c Sun Jul 19 09:29:27 2020 (r363319) @@ -185,14 +185,3 @@ in6_detachhead(void **head, int off) } #endif -/* - * Extended API for IPv6 FIB support. - */ -int -in6_rtrequest(int req, struct sockaddr *dst, struct sockaddr *gw, - struct sockaddr *mask, int flags, struct rtentry **ret_nrt, u_int fibnum) -{ - - return (rtrequest_fib(req, dst, gw, mask, flags, ret_nrt, fibnum)); -} - Modified: head/sys/netinet6/in6_var.h ============================================================================== --- head/sys/netinet6/in6_var.h Sun Jul 19 06:59:09 2020 (r363318) +++ head/sys/netinet6/in6_var.h Sun Jul 19 09:29:27 2020 (r363319) @@ -915,8 +915,6 @@ void in6_newaddrmsg(struct in6_ifaddr *, int); * Extended API for IPv6 FIB support. */ struct mbuf *ip6_tryforward(struct mbuf *); -int in6_rtrequest(int, struct sockaddr *, struct sockaddr *, - struct sockaddr *, int, struct rtentry **, u_int); #endif /* _KERNEL */ #endif /* _NETINET6_IN6_VAR_H_ */ Modified: head/sys/netinet6/nd6.c ============================================================================== --- head/sys/netinet6/nd6.c Sun Jul 19 06:59:09 2020 (r363318) +++ head/sys/netinet6/nd6.c Sun Jul 19 09:29:27 2020 (r363319) @@ -1564,6 +1564,7 @@ nd6_free_redirect(const struct llentry *ln) int fibnum; struct sockaddr_in6 sin6; struct rt_addrinfo info; + struct rib_cmd_info rc; struct epoch_tracker et; lltable_fill_sa_entry(ln, (struct sockaddr *)&sin6); @@ -1573,7 +1574,7 @@ nd6_free_redirect(const struct llentry *ln) NET_EPOCH_ENTER(et); for (fibnum = 0; fibnum < rt_numfibs; fibnum++) - rtrequest1_fib(RTM_DELETE, &info, NULL, fibnum); + rib_action(fibnum, RTM_DELETE, &info, &rc); NET_EPOCH_EXIT(et); } Modified: head/sys/netinet6/nd6_rtr.c ============================================================================== --- head/sys/netinet6/nd6_rtr.c Sun Jul 19 06:59:09 2020 (r363318) +++ head/sys/netinet6/nd6_rtr.c Sun Jul 19 09:29:27 2020 (r363319) @@ -674,7 +674,8 @@ static void defrouter_addreq(struct nd_defrouter *new) { struct sockaddr_in6 def, mask, gate; - struct rtentry *newrt = NULL; + struct rt_addrinfo info; + struct rib_cmd_info rc; unsigned int fibnum; int error; @@ -688,11 +689,16 @@ defrouter_addreq(struct nd_defrouter *new) gate.sin6_addr = new->rtaddr; fibnum = new->ifp->if_fib; - error = in6_rtrequest(RTM_ADD, (struct sockaddr *)&def, - (struct sockaddr *)&gate, (struct sockaddr *)&mask, - RTF_GATEWAY, &newrt, fibnum); - if (newrt != NULL) - rt_routemsg(RTM_ADD, newrt, new->ifp, 0, fibnum); + bzero((caddr_t)&info, sizeof(info)); + info.rti_flags = RTF_GATEWAY; + info.rti_info[RTAX_DST] = (struct sockaddr *)&def; + info.rti_info[RTAX_GATEWAY] = (struct sockaddr *)&gate; + info.rti_info[RTAX_NETMASK] = (struct sockaddr *)&mask; + + NET_EPOCH_ASSERT(); + error = rib_action(fibnum, RTM_ADD, &info, &rc); + if (rc.rc_rt != NULL) + rt_routemsg(RTM_ADD, rc.rc_rt, new->ifp, 0, fibnum); if (error == 0) new->installed = 1; } @@ -706,7 +712,8 @@ static void defrouter_delreq(struct nd_defrouter *dr) { struct sockaddr_in6 def, mask, gate; - struct rtentry *oldrt = NULL; + struct rt_addrinfo info; + struct rib_cmd_info rc; struct epoch_tracker et; unsigned int fibnum; @@ -720,12 +727,16 @@ defrouter_delreq(struct nd_defrouter *dr) gate.sin6_addr = dr->rtaddr; fibnum = dr->ifp->if_fib; + bzero((caddr_t)&info, sizeof(info)); + info.rti_flags = RTF_GATEWAY; + info.rti_info[RTAX_DST] = (struct sockaddr *)&def; + info.rti_info[RTAX_GATEWAY] = (struct sockaddr *)&gate; + info.rti_info[RTAX_NETMASK] = (struct sockaddr *)&mask; + NET_EPOCH_ENTER(et); - in6_rtrequest(RTM_DELETE, (struct sockaddr *)&def, - (struct sockaddr *)&gate, - (struct sockaddr *)&mask, RTF_GATEWAY, &oldrt, fibnum); - if (oldrt != NULL) - rt_routemsg(RTM_DELETE, oldrt, dr->ifp, 0, fibnum); + rib_action(fibnum, RTM_DELETE, &info, &rc); + if (rc.rc_rt != NULL) + rt_routemsg(RTM_DELETE, rc.rc_rt, dr->ifp, 0, fibnum); NET_EPOCH_EXIT(et); dr->installed = 0; @@ -2009,7 +2020,6 @@ static int nd6_prefix_onlink_rtrequest(struct nd_prefix *pr, struct ifaddr *ifa) { struct sockaddr_dl_short sdl; - struct rtentry *rt; struct sockaddr_in6 mask6; u_long rtflags; int error, a_failure, fibnum, maxfib; @@ -2034,11 +2044,17 @@ nd6_prefix_onlink_rtrequest(struct nd_prefix *pr, stru } a_failure = 0; for (; fibnum < maxfib; fibnum++) { + struct rt_addrinfo info; + struct rib_cmd_info rc; - rt = NULL; - error = in6_rtrequest(RTM_ADD, - (struct sockaddr *)&pr->ndpr_prefix, (struct sockaddr *)&sdl, - (struct sockaddr *)&mask6, rtflags, &rt, fibnum); + bzero((caddr_t)&info, sizeof(info)); + info.rti_flags = rtflags; + info.rti_info[RTAX_DST] = (struct sockaddr *)&pr->ndpr_prefix; + info.rti_info[RTAX_GATEWAY] = (struct sockaddr *)&sdl; + info.rti_info[RTAX_NETMASK] = (struct sockaddr *)&mask6; + + NET_EPOCH_ASSERT(); + error = rib_action(fibnum, RTM_ADD, &info, &rc); if (error != 0) { char ip6buf[INET6_ADDRSTRLEN]; char ip6bufg[INET6_ADDRSTRLEN]; @@ -2061,7 +2077,7 @@ nd6_prefix_onlink_rtrequest(struct nd_prefix *pr, stru } pr->ndpr_stateflags |= NDPRF_ONLINK; - rt_routemsg(RTM_ADD, rt, pr->ndpr_ifp, 0, fibnum); + rt_routemsg(RTM_ADD, rc.rc_rt, pr->ndpr_ifp, 0, fibnum); } /* Return the last error we got. */ @@ -2158,7 +2174,6 @@ nd6_prefix_offlink(struct nd_prefix *pr) struct ifnet *ifp = pr->ndpr_ifp; struct nd_prefix *opr; struct sockaddr_in6 sa6, mask6; - struct rtentry *rt; char ip6buf[INET6_ADDRSTRLEN]; uint64_t genid; int fibnum, maxfib, a_failure; @@ -2191,9 +2206,17 @@ nd6_prefix_offlink(struct nd_prefix *pr) a_failure = 0; NET_EPOCH_ENTER(et); for (; fibnum < maxfib; fibnum++) { - rt = NULL; - error = in6_rtrequest(RTM_DELETE, (struct sockaddr *)&sa6, NULL, - (struct sockaddr *)&mask6, 0, &rt, fibnum); + struct rt_addrinfo info; + struct rib_cmd_info rc; + + bzero((caddr_t)&info, sizeof(info)); + info.rti_flags = RTF_GATEWAY; + info.rti_info[RTAX_DST] = (struct sockaddr *)&sa6; + info.rti_info[RTAX_GATEWAY] = NULL; + info.rti_info[RTAX_NETMASK] = (struct sockaddr *)&mask6; + + NET_EPOCH_ASSERT(); + error = rib_action(fibnum, RTM_DELETE, &info, &rc); if (error != 0) { /* Save last error to return, see rtinit(). */ a_failure = error; @@ -2201,7 +2224,7 @@ nd6_prefix_offlink(struct nd_prefix *pr) } /* report route deletion to the routing socket. */ - rt_routemsg(RTM_DELETE, rt, ifp, 0, fibnum); + rt_routemsg(RTM_DELETE, rc.rc_rt, ifp, 0, fibnum); } NET_EPOCH_EXIT(et); error = a_failure; From owner-svn-src-all@freebsd.org Sun Jul 19 10:53:17 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1ABC735B0E5; Sun, 19 Jul 2020 10:53:17 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4B8hXs0Chtz4Pyj; Sun, 19 Jul 2020 10:53:17 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E02271AA84; Sun, 19 Jul 2020 10:53:16 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06JArGKI093361; Sun, 19 Jul 2020 10:53:16 GMT (envelope-from melifaro@FreeBSD.org) Received: (from melifaro@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06JArFsg093352; Sun, 19 Jul 2020 10:53:15 GMT (envelope-from melifaro@FreeBSD.org) Message-Id: <202007191053.06JArFsg093352@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: melifaro set sender to melifaro@FreeBSD.org using -f From: "Alexander V. Chernikov" Date: Sun, 19 Jul 2020 10:53:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363320 - in head/sys: fs/nfsclient net netinet6 X-SVN-Group: head X-SVN-Commit-Author: melifaro X-SVN-Commit-Paths: in head/sys: fs/nfsclient net netinet6 X-SVN-Commit-Revision: 363320 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 19 Jul 2020 10:53:17 -0000 Author: melifaro Date: Sun Jul 19 10:53:15 2020 New Revision: 363320 URL: https://svnweb.freebsd.org/changeset/base/363320 Log: Temporarly revert r363319 to unbreak the build. Reported by: CI Pointy hat to: melifaro Modified: head/sys/fs/nfsclient/nfs_clvfsops.c head/sys/net/if.c head/sys/net/route.c head/sys/net/route.h head/sys/netinet6/in6_rmx.c head/sys/netinet6/in6_var.h head/sys/netinet6/nd6.c head/sys/netinet6/nd6_rtr.c Modified: head/sys/fs/nfsclient/nfs_clvfsops.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clvfsops.c Sun Jul 19 09:29:27 2020 (r363319) +++ head/sys/fs/nfsclient/nfs_clvfsops.c Sun Jul 19 10:53:15 2020 (r363320) @@ -68,7 +68,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include @@ -467,8 +466,6 @@ nfs_mountroot(struct mount *mp) nd->mygateway.sin_addr.s_addr != 0) { struct sockaddr_in mask, sin; struct epoch_tracker et; - struct rt_addrinfo info; - struct rib_cmd_info rc; bzero((caddr_t)&mask, sizeof(mask)); sin = mask; @@ -477,14 +474,10 @@ nfs_mountroot(struct mount *mp) /* XXX MRT use table 0 for this sort of thing */ NET_EPOCH_ENTER(et); CURVNET_SET(TD_TO_VNET(td)); - - bzero((caddr_t)&info, sizeof(info)); - info.rti_flags = RTF_UP | RTF_GATEWAY; - info.rti_info[RTAX_DST] = (struct sockaddr *)&sin; - info.rti_info[RTAX_GATEWAY] = (struct sockaddr *)&nd->mygateway; - info.rti_info[RTAX_NETMASK] = (struct sockaddr *)&mask; - - error = rib_action(RT_DEFAULT_FIB, RTM_ADD, &info, &rc); + error = rtrequest_fib(RTM_ADD, (struct sockaddr *)&sin, + (struct sockaddr *)&nd->mygateway, + (struct sockaddr *)&mask, + RTF_UP | RTF_GATEWAY, NULL, RT_DEFAULT_FIB); CURVNET_RESTORE(); NET_EPOCH_EXIT(et); if (error) Modified: head/sys/net/if.c ============================================================================== --- head/sys/net/if.c Sun Jul 19 09:29:27 2020 (r363319) +++ head/sys/net/if.c Sun Jul 19 10:53:15 2020 (r363320) @@ -80,7 +80,6 @@ #include #include #include -#include #include #if defined(INET) || defined(INET6) @@ -1846,7 +1845,6 @@ static int ifa_maintain_loopback_route(int cmd, const char *otype, struct ifaddr *ifa, struct sockaddr *ia) { - struct rib_cmd_info rc; struct epoch_tracker et; int error; struct rt_addrinfo info; @@ -1874,7 +1872,7 @@ ifa_maintain_loopback_route(int cmd, const char *otype info.rti_info[RTAX_GATEWAY] = (struct sockaddr *)&null_sdl; link_init_sdl(ifp, (struct sockaddr *)&null_sdl, ifp->if_type); - error = rib_action(ifp->if_fib, cmd, &info, &rc); + error = rtrequest1_fib(cmd, &info, NULL, ifp->if_fib); NET_EPOCH_EXIT(et); if (rti_ifa != NULL) Modified: head/sys/net/route.c ============================================================================== --- head/sys/net/route.c Sun Jul 19 09:29:27 2020 (r363319) +++ head/sys/net/route.c Sun Jul 19 10:53:15 2020 (r363320) @@ -470,7 +470,7 @@ int rib_add_redirect(u_int fibnum, struct sockaddr *dst, struct sockaddr *gateway, struct sockaddr *author, struct ifnet *ifp, int flags, int lifetime_sec) { - struct rib_cmd_info rc; + struct rtentry *rt; int error; struct rt_addrinfo info; struct rt_metrics rti_rmx; @@ -504,7 +504,7 @@ rib_add_redirect(u_int fibnum, struct sockaddr *dst, s info.rti_mflags |= RTV_EXPIRE; info.rti_rmx = &rti_rmx; - error = rib_action(fibnum, RTM_ADD, &info, &rc); + error = rtrequest1_fib(RTM_ADD, &info, &rt, fibnum); ifa_free(ifa); if (error != 0) { @@ -512,9 +512,9 @@ rib_add_redirect(u_int fibnum, struct sockaddr *dst, s return (error); } - RT_LOCK(rc.rc_rt); - flags = rc.rc_rt->rt_flags; - RT_UNLOCK(rc.rc_rt); + RT_LOCK(rt); + flags = rt->rt_flags; + RT_UNLOCK(rt); RTSTAT_INC(rts_dynamic); @@ -602,7 +602,33 @@ ifa_ifwithroute(int flags, const struct sockaddr *dst, return (ifa); } +/* + * Do appropriate manipulations of a routing tree given + * all the bits of info needed + */ +int +rtrequest_fib(int req, + struct sockaddr *dst, + struct sockaddr *gateway, + struct sockaddr *netmask, + int flags, + struct rtentry **ret_nrt, + u_int fibnum) +{ + struct rt_addrinfo info; + if (dst->sa_len == 0) + return(EINVAL); + + bzero((caddr_t)&info, sizeof(info)); + info.rti_flags = flags; + info.rti_info[RTAX_DST] = dst; + info.rti_info[RTAX_GATEWAY] = gateway; + info.rti_info[RTAX_NETMASK] = netmask; + return rtrequest1_fib(req, &info, ret_nrt, fibnum); +} + + /* * Copy most of @rt data into @info. * @@ -1122,6 +1148,73 @@ rt_mpath_unlink(struct rib_head *rnh, struct rt_addrin } #endif +int +rtrequest1_fib(int req, struct rt_addrinfo *info, struct rtentry **ret_nrt, + u_int fibnum) +{ + const struct sockaddr *dst; + struct rib_head *rnh; + struct rib_cmd_info rc; + int error; + + KASSERT((fibnum < rt_numfibs), ("rtrequest1_fib: bad fibnum")); + KASSERT((info->rti_flags & RTF_RNH_LOCKED) == 0, ("rtrequest1_fib: locked")); + NET_EPOCH_ASSERT(); + + dst = info->rti_info[RTAX_DST]; + + switch (dst->sa_family) { + case AF_INET6: + case AF_INET: + /* We support multiple FIBs. */ + break; + default: + fibnum = RT_DEFAULT_FIB; + break; + } + + /* + * Find the correct routing tree to use for this Address Family + */ + rnh = rt_tables_get_rnh(fibnum, dst->sa_family); + if (rnh == NULL) + return (EAFNOSUPPORT); + + /* + * If we are adding a host route then we don't want to put + * a netmask in the tree, nor do we want to clone it. + */ + if (info->rti_flags & RTF_HOST) + info->rti_info[RTAX_NETMASK] = NULL; + + bzero(&rc, sizeof(struct rib_cmd_info)); + error = 0; + switch (req) { + case RTM_DELETE: + error = del_route(rnh, info, &rc); + break; + case RTM_RESOLVE: + /* + * resolve was only used for route cloning + * here for compat + */ + break; + case RTM_ADD: + error = add_route(rnh, info, &rc); + break; + case RTM_CHANGE: + error = change_route(rnh, info, &rc); + break; + default: + error = EOPNOTSUPP; + } + + if (ret_nrt != NULL) + *ret_nrt = rc.rc_rt; + + return (error); +} + void rt_setmetrics(const struct rt_addrinfo *info, struct rtentry *rt) { @@ -1165,7 +1258,7 @@ rtinit1(struct ifaddr *ifa, int cmd, int flags, int fi struct epoch_tracker et; struct sockaddr *dst; struct sockaddr *netmask; - struct rib_cmd_info rc; + struct rtentry *rt = NULL; struct rt_addrinfo info; int error = 0; int startfib, endfib; @@ -1256,7 +1349,7 @@ rtinit1(struct ifaddr *ifa, int cmd, int flags, int fi if (rn == NULL) error = ESRCH; else { - struct rtentry *rt = RNTORT(rn); + rt = RNTORT(rn); /* * for interface route the gateway * gateway is sockaddr_dl, so @@ -1296,14 +1389,14 @@ rtinit1(struct ifaddr *ifa, int cmd, int flags, int fi info.rti_info[RTAX_GATEWAY] = ifa->ifa_addr; info.rti_info[RTAX_NETMASK] = netmask; NET_EPOCH_ENTER(et); - error = rib_action(fibnum, cmd, &info, &rc); - if (error == 0 && rc.rc_rt != NULL) { + error = rtrequest1_fib(cmd, &info, &rt, fibnum); + if (error == 0 && rt != NULL) { /* * notify any listening routing agents of the change */ /* TODO: interface routes/aliases */ - rt_newaddrmsg_fib(cmd, ifa, rc.rc_rt, fibnum); + rt_newaddrmsg_fib(cmd, ifa, rt, fibnum); didwork = 1; } NET_EPOCH_EXIT(et); Modified: head/sys/net/route.h ============================================================================== --- head/sys/net/route.h Sun Jul 19 09:29:27 2020 (r363319) +++ head/sys/net/route.h Sun Jul 19 10:53:15 2020 (r363320) @@ -411,6 +411,9 @@ int rtinit(struct ifaddr *, int, int); * but this will change.. */ int rtioctl_fib(u_long, caddr_t, u_int); +int rtrequest_fib(int, struct sockaddr *, + struct sockaddr *, struct sockaddr *, int, struct rtentry **, u_int); +int rtrequest1_fib(int, struct rt_addrinfo *, struct rtentry **, u_int); int rib_lookup_info(uint32_t, const struct sockaddr *, uint32_t, uint32_t, struct rt_addrinfo *); void rib_free_info(struct rt_addrinfo *info); Modified: head/sys/netinet6/in6_rmx.c ============================================================================== --- head/sys/netinet6/in6_rmx.c Sun Jul 19 09:29:27 2020 (r363319) +++ head/sys/netinet6/in6_rmx.c Sun Jul 19 10:53:15 2020 (r363320) @@ -185,3 +185,14 @@ in6_detachhead(void **head, int off) } #endif +/* + * Extended API for IPv6 FIB support. + */ +int +in6_rtrequest(int req, struct sockaddr *dst, struct sockaddr *gw, + struct sockaddr *mask, int flags, struct rtentry **ret_nrt, u_int fibnum) +{ + + return (rtrequest_fib(req, dst, gw, mask, flags, ret_nrt, fibnum)); +} + Modified: head/sys/netinet6/in6_var.h ============================================================================== --- head/sys/netinet6/in6_var.h Sun Jul 19 09:29:27 2020 (r363319) +++ head/sys/netinet6/in6_var.h Sun Jul 19 10:53:15 2020 (r363320) @@ -915,6 +915,8 @@ void in6_newaddrmsg(struct in6_ifaddr *, int); * Extended API for IPv6 FIB support. */ struct mbuf *ip6_tryforward(struct mbuf *); +int in6_rtrequest(int, struct sockaddr *, struct sockaddr *, + struct sockaddr *, int, struct rtentry **, u_int); #endif /* _KERNEL */ #endif /* _NETINET6_IN6_VAR_H_ */ Modified: head/sys/netinet6/nd6.c ============================================================================== --- head/sys/netinet6/nd6.c Sun Jul 19 09:29:27 2020 (r363319) +++ head/sys/netinet6/nd6.c Sun Jul 19 10:53:15 2020 (r363320) @@ -1564,7 +1564,6 @@ nd6_free_redirect(const struct llentry *ln) int fibnum; struct sockaddr_in6 sin6; struct rt_addrinfo info; - struct rib_cmd_info rc; struct epoch_tracker et; lltable_fill_sa_entry(ln, (struct sockaddr *)&sin6); @@ -1574,7 +1573,7 @@ nd6_free_redirect(const struct llentry *ln) NET_EPOCH_ENTER(et); for (fibnum = 0; fibnum < rt_numfibs; fibnum++) - rib_action(fibnum, RTM_DELETE, &info, &rc); + rtrequest1_fib(RTM_DELETE, &info, NULL, fibnum); NET_EPOCH_EXIT(et); } Modified: head/sys/netinet6/nd6_rtr.c ============================================================================== --- head/sys/netinet6/nd6_rtr.c Sun Jul 19 09:29:27 2020 (r363319) +++ head/sys/netinet6/nd6_rtr.c Sun Jul 19 10:53:15 2020 (r363320) @@ -674,8 +674,7 @@ static void defrouter_addreq(struct nd_defrouter *new) { struct sockaddr_in6 def, mask, gate; - struct rt_addrinfo info; - struct rib_cmd_info rc; + struct rtentry *newrt = NULL; unsigned int fibnum; int error; @@ -689,16 +688,11 @@ defrouter_addreq(struct nd_defrouter *new) gate.sin6_addr = new->rtaddr; fibnum = new->ifp->if_fib; - bzero((caddr_t)&info, sizeof(info)); - info.rti_flags = RTF_GATEWAY; - info.rti_info[RTAX_DST] = (struct sockaddr *)&def; - info.rti_info[RTAX_GATEWAY] = (struct sockaddr *)&gate; - info.rti_info[RTAX_NETMASK] = (struct sockaddr *)&mask; - - NET_EPOCH_ASSERT(); - error = rib_action(fibnum, RTM_ADD, &info, &rc); - if (rc.rc_rt != NULL) - rt_routemsg(RTM_ADD, rc.rc_rt, new->ifp, 0, fibnum); + error = in6_rtrequest(RTM_ADD, (struct sockaddr *)&def, + (struct sockaddr *)&gate, (struct sockaddr *)&mask, + RTF_GATEWAY, &newrt, fibnum); + if (newrt != NULL) + rt_routemsg(RTM_ADD, newrt, new->ifp, 0, fibnum); if (error == 0) new->installed = 1; } @@ -712,8 +706,7 @@ static void defrouter_delreq(struct nd_defrouter *dr) { struct sockaddr_in6 def, mask, gate; - struct rt_addrinfo info; - struct rib_cmd_info rc; + struct rtentry *oldrt = NULL; struct epoch_tracker et; unsigned int fibnum; @@ -727,16 +720,12 @@ defrouter_delreq(struct nd_defrouter *dr) gate.sin6_addr = dr->rtaddr; fibnum = dr->ifp->if_fib; - bzero((caddr_t)&info, sizeof(info)); - info.rti_flags = RTF_GATEWAY; - info.rti_info[RTAX_DST] = (struct sockaddr *)&def; - info.rti_info[RTAX_GATEWAY] = (struct sockaddr *)&gate; - info.rti_info[RTAX_NETMASK] = (struct sockaddr *)&mask; - NET_EPOCH_ENTER(et); - rib_action(fibnum, RTM_DELETE, &info, &rc); - if (rc.rc_rt != NULL) - rt_routemsg(RTM_DELETE, rc.rc_rt, dr->ifp, 0, fibnum); + in6_rtrequest(RTM_DELETE, (struct sockaddr *)&def, + (struct sockaddr *)&gate, + (struct sockaddr *)&mask, RTF_GATEWAY, &oldrt, fibnum); + if (oldrt != NULL) + rt_routemsg(RTM_DELETE, oldrt, dr->ifp, 0, fibnum); NET_EPOCH_EXIT(et); dr->installed = 0; @@ -2020,6 +2009,7 @@ static int nd6_prefix_onlink_rtrequest(struct nd_prefix *pr, struct ifaddr *ifa) { struct sockaddr_dl_short sdl; + struct rtentry *rt; struct sockaddr_in6 mask6; u_long rtflags; int error, a_failure, fibnum, maxfib; @@ -2044,17 +2034,11 @@ nd6_prefix_onlink_rtrequest(struct nd_prefix *pr, stru } a_failure = 0; for (; fibnum < maxfib; fibnum++) { - struct rt_addrinfo info; - struct rib_cmd_info rc; - bzero((caddr_t)&info, sizeof(info)); - info.rti_flags = rtflags; - info.rti_info[RTAX_DST] = (struct sockaddr *)&pr->ndpr_prefix; - info.rti_info[RTAX_GATEWAY] = (struct sockaddr *)&sdl; - info.rti_info[RTAX_NETMASK] = (struct sockaddr *)&mask6; - - NET_EPOCH_ASSERT(); - error = rib_action(fibnum, RTM_ADD, &info, &rc); + rt = NULL; + error = in6_rtrequest(RTM_ADD, + (struct sockaddr *)&pr->ndpr_prefix, (struct sockaddr *)&sdl, + (struct sockaddr *)&mask6, rtflags, &rt, fibnum); if (error != 0) { char ip6buf[INET6_ADDRSTRLEN]; char ip6bufg[INET6_ADDRSTRLEN]; @@ -2077,7 +2061,7 @@ nd6_prefix_onlink_rtrequest(struct nd_prefix *pr, stru } pr->ndpr_stateflags |= NDPRF_ONLINK; - rt_routemsg(RTM_ADD, rc.rc_rt, pr->ndpr_ifp, 0, fibnum); + rt_routemsg(RTM_ADD, rt, pr->ndpr_ifp, 0, fibnum); } /* Return the last error we got. */ @@ -2174,6 +2158,7 @@ nd6_prefix_offlink(struct nd_prefix *pr) struct ifnet *ifp = pr->ndpr_ifp; struct nd_prefix *opr; struct sockaddr_in6 sa6, mask6; + struct rtentry *rt; char ip6buf[INET6_ADDRSTRLEN]; uint64_t genid; int fibnum, maxfib, a_failure; @@ -2206,17 +2191,9 @@ nd6_prefix_offlink(struct nd_prefix *pr) a_failure = 0; NET_EPOCH_ENTER(et); for (; fibnum < maxfib; fibnum++) { - struct rt_addrinfo info; - struct rib_cmd_info rc; - - bzero((caddr_t)&info, sizeof(info)); - info.rti_flags = RTF_GATEWAY; - info.rti_info[RTAX_DST] = (struct sockaddr *)&sa6; - info.rti_info[RTAX_GATEWAY] = NULL; - info.rti_info[RTAX_NETMASK] = (struct sockaddr *)&mask6; - - NET_EPOCH_ASSERT(); - error = rib_action(fibnum, RTM_DELETE, &info, &rc); + rt = NULL; + error = in6_rtrequest(RTM_DELETE, (struct sockaddr *)&sa6, NULL, + (struct sockaddr *)&mask6, 0, &rt, fibnum); if (error != 0) { /* Save last error to return, see rtinit(). */ a_failure = error; @@ -2224,7 +2201,7 @@ nd6_prefix_offlink(struct nd_prefix *pr) } /* report route deletion to the routing socket. */ - rt_routemsg(RTM_DELETE, rc.rc_rt, ifp, 0, fibnum); + rt_routemsg(RTM_DELETE, rt, ifp, 0, fibnum); } NET_EPOCH_EXIT(et); error = a_failure; From owner-svn-src-all@freebsd.org Sun Jul 19 12:22:32 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C1AC535DBBE; Sun, 19 Jul 2020 12:22: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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4B8kWr4mc0z4WY0; Sun, 19 Jul 2020 12:22: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 887881B82A; Sun, 19 Jul 2020 12:22: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 06JCMWmp050441; Sun, 19 Jul 2020 12:22:32 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06JCMWQ2050440; Sun, 19 Jul 2020 12:22:32 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <202007191222.06JCMWQ2050440@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Sun, 19 Jul 2020 12:22:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363321 - head/share/man/man9 X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/share/man/man9 X-SVN-Commit-Revision: 363321 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 19 Jul 2020 12:22:32 -0000 Author: trasz Date: Sun Jul 19 12:22:32 2020 New Revision: 363321 URL: https://svnweb.freebsd.org/changeset/base/363321 Log: Add missing bitset(9) MLINKS. MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D25713 Modified: head/share/man/man9/Makefile Modified: head/share/man/man9/Makefile ============================================================================== --- head/share/man/man9/Makefile Sun Jul 19 10:53:15 2020 (r363320) +++ head/share/man/man9/Makefile Sun Jul 19 12:22:32 2020 (r363321) @@ -607,13 +607,19 @@ MLINKS+=bitset.9 BITSET_DEFINE.9 \ bitset.9 BIT_EMPTY.9 \ bitset.9 BIT_ISFULLSET.9 \ bitset.9 BIT_FFS.9 \ + bitset.9 BIT_FLS.9 \ bitset.9 BIT_COUNT.9 \ bitset.9 BIT_SUBSET.9 \ bitset.9 BIT_OVERLAP.9 \ bitset.9 BIT_CMP.9 \ bitset.9 BIT_OR.9 \ + bitset.9 BIT_OR2.9 \ bitset.9 BIT_AND.9 \ + bitset.9 BIT_AND2.9 \ bitset.9 BIT_ANDNOT.9 \ + bitset.9 BIT_ANDNOT2.9 \ + bitset.9 BIT_XOR.9 \ + bitset.9 BIT_XOR2.9 \ bitset.9 BIT_CLR_ATOMIC.9 \ bitset.9 BIT_SET_ATOMIC.9 \ bitset.9 BIT_SET_ATOMIC_ACQ.9 \ From owner-svn-src-all@freebsd.org Sun Jul 19 12:25:04 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8A33F35DBC4; Sun, 19 Jul 2020 12:25:04 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4B8kZm3CWnz4WWV; Sun, 19 Jul 2020 12:25:04 +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 52F761B6C7; Sun, 19 Jul 2020 12:25:04 +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 06JCP4B9050602; Sun, 19 Jul 2020 12:25:04 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06JCP4IP050600; Sun, 19 Jul 2020 12:25:04 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <202007191225.06JCP4IP050600@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Sun, 19 Jul 2020 12:25:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363322 - head/sys/compat/linux X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/sys/compat/linux X-SVN-Commit-Revision: 363322 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 19 Jul 2020 12:25:04 -0000 Author: trasz Date: Sun Jul 19 12:25:03 2020 New Revision: 363322 URL: https://svnweb.freebsd.org/changeset/base/363322 Log: Make linux(4) support the BLKPBSZGET ioctl. Oracle uses it. MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D25694 Modified: head/sys/compat/linux/linux_ioctl.c head/sys/compat/linux/linux_ioctl.h Modified: head/sys/compat/linux/linux_ioctl.c ============================================================================== --- head/sys/compat/linux/linux_ioctl.c Sun Jul 19 12:22:32 2020 (r363321) +++ head/sys/compat/linux/linux_ioctl.c Sun Jul 19 12:25:03 2020 (r363322) @@ -285,9 +285,9 @@ linux_ioctl_disk(struct thread *td, struct linux_ioctl { struct file *fp; int error; - u_int sectorsize; + u_int sectorsize, psectorsize; uint64_t blksize64; - off_t mediasize; + off_t mediasize, stripesize; error = fget(td, args->fd, &cap_ioctl_rights, &fp); if (error != 0) @@ -327,6 +327,27 @@ linux_ioctl_disk(struct thread *td, struct linux_ioctl return (copyout(§orsize, (void *)args->arg, sizeof(sectorsize))); break; + case LINUX_BLKPBSZGET: + error = fo_ioctl(fp, DIOCGSTRIPESIZE, + (caddr_t)&stripesize, td->td_ucred, td); + if (error != 0) { + fdrop(fp, td); + return (error); + } + if (stripesize > 0 && stripesize <= 4096) { + psectorsize = stripesize; + } else { + error = fo_ioctl(fp, DIOCGSECTORSIZE, + (caddr_t)§orsize, td->td_ucred, td); + if (error != 0) { + fdrop(fp, td); + return (error); + } + psectorsize = sectorsize; + } + fdrop(fp, td); + return (copyout(&psectorsize, (void *)args->arg, + sizeof(psectorsize))); } fdrop(fp, td); return (ENOIOCTL); Modified: head/sys/compat/linux/linux_ioctl.h ============================================================================== --- head/sys/compat/linux/linux_ioctl.h Sun Jul 19 12:22:32 2020 (r363321) +++ head/sys/compat/linux/linux_ioctl.h Sun Jul 19 12:25:03 2020 (r363322) @@ -58,9 +58,10 @@ #define LINUX_BLKSECTGET 0x1267 #define LINUX_BLKSSZGET 0x1268 #define LINUX_BLKGETSIZE64 0x1272 +#define LINUX_BLKPBSZGET 0x127b #define LINUX_IOCTL_DISK_MIN LINUX_BLKROSET -#define LINUX_IOCTL_DISK_MAX LINUX_BLKGETSIZE64 +#define LINUX_IOCTL_DISK_MAX LINUX_BLKPBSZGET /* * hdio From owner-svn-src-all@freebsd.org Sun Jul 19 12:25:07 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2AD2935DD46; Sun, 19 Jul 2020 12:25:07 +0000 (UTC) (envelope-from etnapierala@gmail.com) Received: from mail-lj1-x243.google.com (mail-lj1-x243.google.com [IPv6:2a00:1450:4864:20::243]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4B8kZp113zz4WwK; Sun, 19 Jul 2020 12:25:05 +0000 (UTC) (envelope-from etnapierala@gmail.com) Received: by mail-lj1-x243.google.com with SMTP id x9so17344091ljc.5; Sun, 19 Jul 2020 05:25:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:mail-followup-to :references:mime-version:content-disposition:in-reply-to; bh=APFvNwVxWku7kPe3K2alz344bSwocWzhvDwas+XFE2o=; b=LXZRIrzz3gaM1APw/QGFVeimluWnr97QEag7P5rT9VGbQqB8Wyt6pCMglyw0O1b2XR oA4Het0sHxmbTHsgv8EFAf/eUOC3oPAIgrVEk44gKsAlpDFern/RAuiNjSHf7h6ap1Oo dlzavhi5oV7rp86eRM8mrjE1emvxOJtcqzui0gEM65RpLKu9wFW5zCsTBO6qgHQHF4oU opc/nEgcaBGnAHgmgkrCNoAmwvV2g7YshchKoHqCef6WSSJAgfwPSbBFBX4gq/nwxymY w4v788GZUZ1wgTDex835h+d9jfABTRPRCz4JcVPHiTlTj50S1+x58pTsW+dWwHqvPrgD Tb9A== 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 :mail-followup-to:references:mime-version:content-disposition :in-reply-to; bh=APFvNwVxWku7kPe3K2alz344bSwocWzhvDwas+XFE2o=; b=QoW3sLQt3VFWWPrjCEXnQ3u74cy0tFWZDmdnCVdZWmAccL/CJoVMeyOvI2pjCgSQc3 QCzHzXjFBDlIgAwhbxlUihMqW2dBwMnhIKVbNXDnM1y7w4dsGc6Vc+/L9ESGJPT1f3ev LlSVK0CjKrcWjJEHW89ZTEoOMF0T+sWK5C6x40Uuj9fHu3B8CZX4enEXUvzoXM0yQhVN nVsFLVSrlK92rF4s7StfK5RV8Op+yodhMuPEaaEcWDvy3FgwGtVxV4Bl9GhDML30h7K5 DkIl6ZAnZNMdW+hOEO+TlGyMb1YFRBIXZ3FW1oVp3TXS72CpqwHeqI84bqZnZmp74Ndt ZvYQ== X-Gm-Message-State: AOAM530ihIbjJuCpE5UaS3NpRrBYsSzHpkk1lN//QQ0ofSgb2+EaViEE E2TKpT3kklzDSkFcss+dItpi5mMB X-Google-Smtp-Source: ABdhPJywGjZfKIOslit5PT/4Gag72rpD32ZvliC4ikOZlyTfHvDLmWgdBg97ORq0pngM+M/rk2tbmw== X-Received: by 2002:a5d:4984:: with SMTP id r4mr522608wrq.401.1595161086671; Sun, 19 Jul 2020 05:18:06 -0700 (PDT) Received: from brick (cpc149474-cmbg20-2-0-cust954.5-4.cable.virginm.net. [82.4.199.187]) by smtp.gmail.com with ESMTPSA id n14sm24846294wro.81.2020.07.19.05.18.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 19 Jul 2020 05:18:05 -0700 (PDT) Sender: =?UTF-8?Q?Edward_Tomasz_Napiera=C5=82a?= Date: Thu, 23 Jul 2020 14:40:23 +0100 From: Edward Tomasz Napierala To: Kyle Evans Cc: src-committers , svn-src-all , svn-src-head Subject: Re: svn commit: r353283 - in head: lib lib/libstats share/man/man3 share/mk sys/amd64/conf sys/conf sys/kern sys/sys tools/build/options Message-ID: <20200723134023.GA2314@brick> Mail-Followup-To: Kyle Evans , src-committers , svn-src-all , svn-src-head References: <201910071905.x97J56t0039812@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Rspamd-Queue-Id: 4B8kZp113zz4WwK X-Spamd-Bar: ++ Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=LXZRIrzz; dmarc=none; spf=pass (mx1.freebsd.org: domain of etnapierala@gmail.com designates 2a00:1450:4864:20::243 as permitted sender) smtp.mailfrom=etnapierala@gmail.com X-Spamd-Result: default: False [2.09 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2a00:1450:4000::/36:c]; DATE_IN_FUTURE(4.00)[]; RCVD_COUNT_THREE(0.00)[3]; TO_DN_ALL(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; NEURAL_HAM_SHORT(-0.55)[-0.554]; FORGED_SENDER(0.30)[trasz@freebsd.org,etnapierala@gmail.com]; RECEIVED_SPAMHAUS_PBL(0.00)[82.4.199.187:received]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US]; FROM_NEQ_ENVFROM(0.00)[trasz@freebsd.org,etnapierala@gmail.com]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.83)[-0.828]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-0.83)[-0.825]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[freebsd.org]; RCVD_IN_DNSWL_NONE(0.00)[2a00:1450:4864:20::243:from]; MID_RHS_NOT_FQDN(0.50)[]; GREYLIST(0.00)[pass,body]; RCVD_TLS_ALL(0.00)[] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Jul 2020 12:25:07 -0000 On 0714T0838, Kyle Evans wrote: > On Mon, Oct 7, 2019 at 2:05 PM Edward Tomasz Napierala > wrote: [..] > > Added: head/lib/libstats/Makefile > > ============================================================================== > > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > > +++ head/lib/libstats/Makefile Mon Oct 7 19:05:05 2019 (r353283) > > @@ -0,0 +1,14 @@ > > +# $FreeBSD$ > > + > > +LIB= stats > > +SHLIBDIR?= /lib > > +SHLIB_MAJOR= 0 > > +SRCS= subr_stats.c > > + > > +# To debug, comment WITHOUT_ASSERT_DEBUG= and uncomment CFLAGS:= > > +WITHOUT_ASSERT_DEBUG= > > +#CFLAGS:=${CFLAGS:C/-O[0-9]/-O0 -g3/} -DDIAGNOSTIC > > + > > Hi, > > What exactly is going on here? mjg pointed this out when we were > looking at some runtime assertion related stuff. This looks like it's > imposing an opinion of how it should be built and circumvent the > normal way of doing things. Ideally, this would something more like > with the following patch to just make sure that the CFLAGS > manipulations properly happen when ASSERT_DEBUG is flipped on, and > interested parties that don't want the assertions should turn > ASSERT_DEBUG off. If there's a really really solid reason for libstats > having its own knob, that should be considered as a formal knob rather > than the ad-hockery that appears above. I'm not sure that the > following patch is entirely correct, though; -DDIAGNOSTIC seems to be > needed for assertions, but the -O$n replacement with -O0 -g3 looks > like it should perhaps be split out to a different knob or.. > something. The main chunk of stats(3) source is shared between libstats(3) and the kernel. Thus, DIAGNOSTICS means the same thing: it's not the usual assertions, but an additional debugging mechanism that's supposed to be off by default. Except that we don't have a global knob to turn "userland DIAGNOSTICS" on, so libstats(3) uses its own. We probably shouldn't be overriding WITHOUT_ASSERT_DEBUG, though. [..] From owner-svn-src-all@freebsd.org Sun Jul 19 12:34:20 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CD9AE35DE3F; Sun, 19 Jul 2020 12:34:20 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4B8knS5RZzz4XKZ; Sun, 19 Jul 2020 12:34:20 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9D9681BA76; Sun, 19 Jul 2020 12:34:20 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06JCYKat056468; Sun, 19 Jul 2020 12:34:20 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06JCYJeV056464; Sun, 19 Jul 2020 12:34:19 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <202007191234.06JCYJeV056464@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sun, 19 Jul 2020 12:34:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363323 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 363323 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 19 Jul 2020 12:34:20 -0000 Author: tuexen Date: Sun Jul 19 12:34:19 2020 New Revision: 363323 URL: https://svnweb.freebsd.org/changeset/base/363323 Log: Add reference counts for inp/stcb/net when timers are running. This avoids a use-after-free reported for the userland stack. Thanks to Taylor Brandstetter for suggesting a patch for the userland stack. MFC after: 1 week Modified: head/sys/netinet/sctp_os_bsd.h head/sys/netinet/sctp_pcb.c head/sys/netinet/sctp_var.h head/sys/netinet/sctputil.c head/sys/netinet/sctputil.h Modified: head/sys/netinet/sctp_os_bsd.h ============================================================================== --- head/sys/netinet/sctp_os_bsd.h Sun Jul 19 12:25:03 2020 (r363322) +++ head/sys/netinet/sctp_os_bsd.h Sun Jul 19 12:34:19 2020 (r363323) @@ -269,12 +269,17 @@ typedef struct callout sctp_os_timer_t; #define SCTP_OS_TIMER_INIT(tmr) callout_init(tmr, 1) -#define SCTP_OS_TIMER_START callout_reset -#define SCTP_OS_TIMER_STOP callout_stop -#define SCTP_OS_TIMER_STOP_DRAIN callout_drain -#define SCTP_OS_TIMER_PENDING callout_pending -#define SCTP_OS_TIMER_ACTIVE callout_active -#define SCTP_OS_TIMER_DEACTIVATE callout_deactivate +/* + * NOTE: The next two shouldn't be called directly outside of sctp_timer_start() + * and sctp_timer_stop(), since they don't handle incrementing/decrementing + * relevant reference counts. + */ +#define SCTP_OS_TIMER_START callout_reset +#define SCTP_OS_TIMER_STOP callout_stop +#define SCTP_OS_TIMER_STOP_DRAIN callout_drain +#define SCTP_OS_TIMER_PENDING callout_pending +#define SCTP_OS_TIMER_ACTIVE callout_active +#define SCTP_OS_TIMER_DEACTIVATE callout_deactivate #define sctp_get_tick_count() (ticks) Modified: head/sys/netinet/sctp_pcb.c ============================================================================== --- head/sys/netinet/sctp_pcb.c Sun Jul 19 12:25:03 2020 (r363322) +++ head/sys/netinet/sctp_pcb.c Sun Jul 19 12:34:19 2020 (r363323) @@ -2739,23 +2739,54 @@ sctp_move_pcb_and_assoc(struct sctp_inpcb *old_inp, st } } } - /* - * Now any running timers need to be adjusted since we really don't - * care if they are running or not just blast in the new_inp into - * all of them. - */ - - stcb->asoc.dack_timer.ep = (void *)new_inp; - stcb->asoc.asconf_timer.ep = (void *)new_inp; - stcb->asoc.strreset_timer.ep = (void *)new_inp; - stcb->asoc.shut_guard_timer.ep = (void *)new_inp; - stcb->asoc.autoclose_timer.ep = (void *)new_inp; - stcb->asoc.delete_prim_timer.ep = (void *)new_inp; + /* Now any running timers need to be adjusted. */ + if (stcb->asoc.dack_timer.ep == old_inp) { + SCTP_INP_DECR_REF(old_inp); + stcb->asoc.dack_timer.ep = new_inp; + SCTP_INP_INCR_REF(new_inp); + } + if (stcb->asoc.asconf_timer.ep == old_inp) { + SCTP_INP_DECR_REF(old_inp); + stcb->asoc.asconf_timer.ep = new_inp; + SCTP_INP_INCR_REF(new_inp); + } + if (stcb->asoc.strreset_timer.ep == old_inp) { + SCTP_INP_DECR_REF(old_inp); + stcb->asoc.strreset_timer.ep = new_inp; + SCTP_INP_INCR_REF(new_inp); + } + if (stcb->asoc.shut_guard_timer.ep == old_inp) { + SCTP_INP_DECR_REF(old_inp); + stcb->asoc.shut_guard_timer.ep = new_inp; + SCTP_INP_INCR_REF(new_inp); + } + if (stcb->asoc.autoclose_timer.ep == old_inp) { + SCTP_INP_DECR_REF(old_inp); + stcb->asoc.autoclose_timer.ep = new_inp; + SCTP_INP_INCR_REF(new_inp); + } + if (stcb->asoc.delete_prim_timer.ep == old_inp) { + SCTP_INP_DECR_REF(old_inp); + stcb->asoc.delete_prim_timer.ep = new_inp; + SCTP_INP_INCR_REF(new_inp); + } /* now what about the nets? */ TAILQ_FOREACH(net, &stcb->asoc.nets, sctp_next) { - net->pmtu_timer.ep = (void *)new_inp; - net->hb_timer.ep = (void *)new_inp; - net->rxt_timer.ep = (void *)new_inp; + if (net->pmtu_timer.ep == old_inp) { + SCTP_INP_DECR_REF(old_inp); + net->pmtu_timer.ep = new_inp; + SCTP_INP_INCR_REF(new_inp); + } + if (net->hb_timer.ep == old_inp) { + SCTP_INP_DECR_REF(old_inp); + net->hb_timer.ep = new_inp; + SCTP_INP_INCR_REF(new_inp); + } + if (net->rxt_timer.ep == old_inp) { + SCTP_INP_DECR_REF(old_inp); + net->rxt_timer.ep = new_inp; + SCTP_INP_INCR_REF(new_inp); + } } SCTP_INP_WUNLOCK(new_inp); SCTP_INP_WUNLOCK(old_inp); @@ -3562,7 +3593,7 @@ sctp_inpcb_free(struct sctp_inpcb *inp, int immediate, being_refed++; if (SCTP_ASOC_CREATE_LOCK_CONTENDED(inp)) being_refed++; - + /* NOTE: 0 refcount also means no timers are referencing us. */ if ((inp->refcount) || (being_refed) || (inp->sctp_flags & SCTP_PCB_FLAGS_CLOSE_IP)) { @@ -3584,16 +3615,6 @@ sctp_inpcb_free(struct sctp_inpcb *inp, int immediate, SCTP_INP_WUNLOCK(inp); SCTP_ASOC_CREATE_UNLOCK(inp); SCTP_INP_INFO_WUNLOCK(); - /* - * Now we release all locks. Since this INP cannot be found anymore - * except possibly by the kill timer that might be running. We call - * the drain function here. It should hit the case were it sees the - * ACTIVE flag cleared and exit out freeing us to proceed and - * destroy everything. - */ - if (from != SCTP_CALLED_FROM_INPKILL_TIMER) { - (void)SCTP_OS_TIMER_STOP_DRAIN(&inp->sctp_ep.signature_change.timer); - } #ifdef SCTP_LOG_CLOSING sctp_log_closing(inp, NULL, 5); Modified: head/sys/netinet/sctp_var.h ============================================================================== --- head/sys/netinet/sctp_var.h Sun Jul 19 12:25:03 2020 (r363322) +++ head/sys/netinet/sctp_var.h Sun Jul 19 12:34:19 2020 (r363323) @@ -186,7 +186,6 @@ extern struct pr_usrreqs sctp_usrreqs; #define sctp_free_remote_addr(__net) { \ if ((__net)) { \ if (SCTP_DECREMENT_AND_CHECK_REFCOUNT(&(__net)->ref_count)) { \ - (void)SCTP_OS_TIMER_STOP(&(__net)->rxt_timer.timer); \ RO_NHFREE(&(__net)->ro); \ if ((__net)->src_addr_selected) { \ sctp_free_ifa((__net)->ro._s_addr); \ Modified: head/sys/netinet/sctputil.c ============================================================================== --- head/sys/netinet/sctputil.c Sun Jul 19 12:25:03 2020 (r363322) +++ head/sys/netinet/sctputil.c Sun Jul 19 12:34:19 2020 (r363323) @@ -1713,16 +1713,22 @@ sctp_timeout_handler(void *t) struct sctp_nets *net; struct sctp_timer *tmr; struct mbuf *op_err; - int did_output; int type; int i, secret; + bool did_output, released_asoc_reference; + /* + * If inp, stcb or net are not NULL, then references to these were + * added when the timer was started, and must be released before + * this function returns. + */ tmr = (struct sctp_timer *)t; inp = (struct sctp_inpcb *)tmr->ep; stcb = (struct sctp_tcb *)tmr->tcb; net = (struct sctp_nets *)tmr->net; CURVNET_SET((struct vnet *)tmr->vnet); did_output = 1; + released_asoc_reference = false; #ifdef SCTP_AUDITING_ENABLED sctp_audit_log(0xF0, (uint8_t)tmr->type); @@ -1738,56 +1744,39 @@ sctp_timeout_handler(void *t) KASSERT(stcb == NULL || stcb->sctp_ep == inp, ("sctp_timeout_handler of type %d: inp = %p, stcb->sctp_ep %p", type, stcb, stcb->sctp_ep)); - if (inp) { - SCTP_INP_INCR_REF(inp); - } tmr->stopped_from = 0xa001; - if (stcb) { - atomic_add_int(&stcb->asoc.refcnt, 1); - if (stcb->asoc.state == 0) { - atomic_add_int(&stcb->asoc.refcnt, -1); - if (inp) { - SCTP_INP_DECR_REF(inp); - } - SCTPDBG(SCTP_DEBUG_TIMER2, - "Timer type %d handler exiting due to CLOSED association.\n", - type); - CURVNET_RESTORE(); - return; - } + if ((stcb != NULL) && (stcb->asoc.state == SCTP_STATE_EMPTY)) { + SCTPDBG(SCTP_DEBUG_TIMER2, + "Timer type %d handler exiting due to CLOSED association.\n", + type); + goto out_decr; } tmr->stopped_from = 0xa002; SCTPDBG(SCTP_DEBUG_TIMER2, "Timer type %d goes off.\n", type); if (!SCTP_OS_TIMER_ACTIVE(&tmr->timer)) { - if (inp) { - SCTP_INP_DECR_REF(inp); - } - if (stcb) { - atomic_add_int(&stcb->asoc.refcnt, -1); - } SCTPDBG(SCTP_DEBUG_TIMER2, "Timer type %d handler exiting due to not being active.\n", type); - CURVNET_RESTORE(); - return; + goto out_decr; } tmr->stopped_from = 0xa003; if (stcb) { SCTP_TCB_LOCK(stcb); + /* + * Release reference so that association can be freed if + * necessary below. This is safe now that we have acquired + * the lock. + */ atomic_add_int(&stcb->asoc.refcnt, -1); + released_asoc_reference = true; if ((type != SCTP_TIMER_TYPE_ASOCKILL) && - ((stcb->asoc.state == 0) || + ((stcb->asoc.state == SCTP_STATE_EMPTY) || (stcb->asoc.state & SCTP_STATE_ABOUT_TO_BE_FREED))) { - SCTP_TCB_UNLOCK(stcb); - if (inp) { - SCTP_INP_DECR_REF(inp); - } SCTPDBG(SCTP_DEBUG_TIMER2, "Timer type %d handler exiting due to CLOSED association.\n", type); - CURVNET_RESTORE(); - return; + goto out; } } else if (inp != NULL) { SCTP_INP_WLOCK(inp); @@ -1803,13 +1792,13 @@ sctp_timeout_handler(void *t) /* * Callout has been rescheduled. */ - goto get_out; + goto out; } if (!SCTP_OS_TIMER_ACTIVE(&tmr->timer)) { /* * Not active, so no action. */ - goto get_out; + goto out; } SCTP_OS_TIMER_DEACTIVATE(&tmr->timer); @@ -1836,6 +1825,7 @@ sctp_timeout_handler(void *t) sctp_auditing(4, inp, stcb, net); #endif sctp_chunk_output(inp, stcb, SCTP_OUTPUT_FROM_T3, SCTP_SO_NOT_LOCKED); + did_output = true; if ((stcb->asoc.num_send_timers_up == 0) && (stcb->asoc.sent_queue_cnt > 0)) { struct sctp_tmit_chunk *chk; @@ -1866,8 +1856,7 @@ sctp_timeout_handler(void *t) /* no need to unlock on tcb its gone */ goto out_decr; } - /* We do output but not here */ - did_output = 0; + did_output = false; break; case SCTP_TIMER_TYPE_RECV: KASSERT(inp != NULL && stcb != NULL && net == NULL, @@ -1880,6 +1869,7 @@ sctp_timeout_handler(void *t) sctp_auditing(4, inp, stcb, NULL); #endif sctp_chunk_output(inp, stcb, SCTP_OUTPUT_FROM_SACK_TMR, SCTP_SO_NOT_LOCKED); + did_output = true; break; case SCTP_TIMER_TYPE_SHUTDOWN: KASSERT(inp != NULL && stcb != NULL && net != NULL, @@ -1895,6 +1885,7 @@ sctp_timeout_handler(void *t) sctp_auditing(4, inp, stcb, net); #endif sctp_chunk_output(inp, stcb, SCTP_OUTPUT_FROM_SHUT_TMR, SCTP_SO_NOT_LOCKED); + did_output = true; break; case SCTP_TIMER_TYPE_HEARTBEAT: KASSERT(inp != NULL && stcb != NULL && net != NULL, @@ -1912,6 +1903,9 @@ sctp_timeout_handler(void *t) if (!(net->dest_state & SCTP_ADDR_NOHB)) { sctp_timer_start(SCTP_TIMER_TYPE_HEARTBEAT, inp, stcb, net); sctp_chunk_output(inp, stcb, SCTP_OUTPUT_FROM_HB_TMR, SCTP_SO_NOT_LOCKED); + did_output = true; + } else { + did_output = false; } break; case SCTP_TIMER_TYPE_COOKIE: @@ -1932,6 +1926,7 @@ sctp_timeout_handler(void *t) * respect to where from in chunk_output. */ sctp_chunk_output(inp, stcb, SCTP_OUTPUT_FROM_T3, SCTP_SO_NOT_LOCKED); + did_output = true; break; case SCTP_TIMER_TYPE_NEWCOOKIE: KASSERT(inp != NULL && stcb == NULL && net == NULL, @@ -1953,7 +1948,7 @@ sctp_timeout_handler(void *t) sctp_select_initial_TSN(&inp->sctp_ep); } sctp_timer_start(SCTP_TIMER_TYPE_NEWCOOKIE, inp, NULL, NULL); - did_output = 0; + did_output = false; break; case SCTP_TIMER_TYPE_PATHMTURAISE: KASSERT(inp != NULL && stcb != NULL && net != NULL, @@ -1961,7 +1956,7 @@ sctp_timeout_handler(void *t) type, inp, stcb, net)); SCTP_STAT_INCR(sctps_timopathmtu); sctp_pathmtu_timer(inp, stcb, net); - did_output = 0; + did_output = false; break; case SCTP_TIMER_TYPE_SHUTDOWNACK: KASSERT(inp != NULL && stcb != NULL && net != NULL, @@ -1977,6 +1972,7 @@ sctp_timeout_handler(void *t) sctp_auditing(4, inp, stcb, net); #endif sctp_chunk_output(inp, stcb, SCTP_OUTPUT_FROM_SHUT_ACK_TMR, SCTP_SO_NOT_LOCKED); + did_output = true; break; case SCTP_TIMER_TYPE_ASCONF: KASSERT(inp != NULL && stcb != NULL && net != NULL, @@ -1991,6 +1987,7 @@ sctp_timeout_handler(void *t) sctp_auditing(4, inp, stcb, net); #endif sctp_chunk_output(inp, stcb, SCTP_OUTPUT_FROM_ASCONF_TMR, SCTP_SO_NOT_LOCKED); + did_output = true; break; case SCTP_TIMER_TYPE_SHUTDOWNGUARD: KASSERT(inp != NULL && stcb != NULL && net == NULL, @@ -2000,6 +1997,7 @@ sctp_timeout_handler(void *t) op_err = sctp_generate_cause(SCTP_BASE_SYSCTL(sctp_diag_info_code), "Shutdown guard timer expired"); sctp_abort_an_association(inp, stcb, op_err, SCTP_SO_NOT_LOCKED); + did_output = true; /* no need to unlock on tcb its gone */ goto out_decr; case SCTP_TIMER_TYPE_AUTOCLOSE: @@ -2009,7 +2007,7 @@ sctp_timeout_handler(void *t) SCTP_STAT_INCR(sctps_timoautoclose); sctp_autoclose_timer(inp, stcb); sctp_chunk_output(inp, stcb, SCTP_OUTPUT_FROM_AUTOCLOSE_TMR, SCTP_SO_NOT_LOCKED); - did_output = 0; + did_output = true; break; case SCTP_TIMER_TYPE_STRRESET: KASSERT(inp != NULL && stcb != NULL && net == NULL, @@ -2021,6 +2019,7 @@ sctp_timeout_handler(void *t) goto out_decr; } sctp_chunk_output(inp, stcb, SCTP_OUTPUT_FROM_STRRST_TMR, SCTP_SO_NOT_LOCKED); + did_output = true; break; case SCTP_TIMER_TYPE_INPKILL: KASSERT(inp != NULL && stcb == NULL && net == NULL, @@ -2061,6 +2060,7 @@ sctp_timeout_handler(void *t) ("timeout of type %d: inp = %p, stcb = %p, net = %p", type, inp, stcb, net)); sctp_handle_addr_wq(); + did_output = true; break; case SCTP_TIMER_TYPE_PRIM_DELETED: KASSERT(inp != NULL && stcb != NULL && net == NULL, @@ -2068,20 +2068,22 @@ sctp_timeout_handler(void *t) type, inp, stcb, net)); SCTP_STAT_INCR(sctps_timodelprim); sctp_delete_prim_timer(inp, stcb); + did_output = false; break; default: #ifdef INVARIANTS panic("Unknown timer type %d", type); #else - goto get_out; + did_output = false; + goto out; #endif } #ifdef SCTP_AUDITING_ENABLED sctp_audit_log(0xF1, (uint8_t)type); - if (inp) + if (inp != NULL) sctp_auditing(5, inp, stcb, net); #endif - if ((did_output) && stcb) { + if (did_output && (stcb != NULL)) { /* * Now we need to clean up the control chunk chain if an * ECNE is on it. It must be marked as UNSENT again so next @@ -2091,8 +2093,8 @@ sctp_timeout_handler(void *t) */ sctp_fix_ecn_echo(&stcb->asoc); } -get_out: - if (stcb) { +out: + if (stcb != NULL) { SCTP_TCB_UNLOCK(stcb); } else if (inp != NULL) { SCTP_INP_WUNLOCK(inp); @@ -2101,10 +2103,16 @@ get_out: } out_decr: - if (inp) { + /* These reference counts were incremented in sctp_timer_start(). */ + if (inp != NULL) { SCTP_INP_DECR_REF(inp); } - + if ((stcb != NULL) && !released_asoc_reference) { + atomic_add_int(&stcb->asoc.refcnt, -1); + } + if (net != NULL) { + sctp_free_remote_addr(net); + } out_no_decr: SCTPDBG(SCTP_DEBUG_TIMER2, "Timer type %d handler finished.\n", type); CURVNET_RESTORE(); @@ -2538,6 +2546,19 @@ sctp_timer_start(int t_type, struct sctp_inpcb *inp, s SCTPDBG(SCTP_DEBUG_TIMER2, "Timer type %d started: ticks=%u, inp=%p, stcb=%p, net=%p.\n", t_type, to_ticks, inp, stcb, net); + /* + * If this is a newly scheduled callout, as opposed to a + * rescheduled one, increment relevant reference counts. + */ + if (tmr->ep != NULL) { + SCTP_INP_INCR_REF(inp); + } + if (tmr->tcb != NULL) { + atomic_add_int(&stcb->asoc.refcnt, 1); + } + if (tmr->net != NULL) { + atomic_add_int(&net->ref_count, 1); + } } else { /* * This should not happen, since we checked for pending @@ -2830,9 +2851,26 @@ sctp_timer_stop(int t_type, struct sctp_inpcb *inp, st SCTPDBG(SCTP_DEBUG_TIMER2, "Timer type %d stopped: inp=%p, stcb=%p, net=%p.\n", t_type, inp, stcb, net); - tmr->ep = NULL; - tmr->tcb = NULL; - tmr->net = NULL; + /* + * If the timer was actually stopped, decrement reference + * counts that were incremented in sctp_timer_start(). + */ + if (tmr->ep != NULL) { + SCTP_INP_DECR_REF(inp); + tmr->ep = NULL; + } + if (tmr->tcb != NULL) { + atomic_add_int(&stcb->asoc.refcnt, -1); + tmr->tcb = NULL; + } + if (tmr->net != NULL) { + /* + * Can't use net, since it doesn't work for + * SCTP_TIMER_TYPE_ASCONF. + */ + sctp_free_remote_addr((struct sctp_nets *)tmr->net); + tmr->net = NULL; + } } else { SCTPDBG(SCTP_DEBUG_TIMER2, "Timer type %d not stopped: inp=%p, stcb=%p, net=%p.\n", Modified: head/sys/netinet/sctputil.h ============================================================================== --- head/sys/netinet/sctputil.h Sun Jul 19 12:25:03 2020 (r363322) +++ head/sys/netinet/sctputil.h Sun Jul 19 12:34:19 2020 (r363323) @@ -90,6 +90,14 @@ sctp_notify_stream_reset_add(struct sctp_tcb *stcb, ui void sctp_notify_stream_reset_tsn(struct sctp_tcb *stcb, uint32_t sending_tsn, uint32_t recv_tsn, int flag); +/* + * NOTE: sctp_timer_start() will increment the reference count of any relevant + * structure the timer is referencing, in order to prevent a race condition + * between the timer executing and the structure being freed. + * + * When the timer fires or sctp_timer_stop() is called, these references are + * removed. + */ void sctp_timer_start(int, struct sctp_inpcb *, struct sctp_tcb *, struct sctp_nets *); From owner-svn-src-all@freebsd.org Sun Jul 19 14:42:14 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 017F0360D40; Sun, 19 Jul 2020 14:42:14 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4B8nd16FfTz4fH9; Sun, 19 Jul 2020 14:42:13 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BA0571D434; Sun, 19 Jul 2020 14:42:13 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06JEgD8W038425; Sun, 19 Jul 2020 14:42:13 GMT (envelope-from allanjude@FreeBSD.org) Received: (from allanjude@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06JEgDAp038424; Sun, 19 Jul 2020 14:42:13 GMT (envelope-from allanjude@FreeBSD.org) Message-Id: <202007191442.06JEgDAp038424@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: allanjude set sender to allanjude@FreeBSD.org using -f From: Allan Jude Date: Sun, 19 Jul 2020 14:42:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363324 - head/usr.bin/at X-SVN-Group: head X-SVN-Commit-Author: allanjude X-SVN-Commit-Paths: head/usr.bin/at X-SVN-Commit-Revision: 363324 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 19 Jul 2020 14:42:14 -0000 Author: allanjude Date: Sun Jul 19 14:42:13 2020 New Revision: 363324 URL: https://svnweb.freebsd.org/changeset/base/363324 Log: at(1): Markup environment variables with proper macros Submitted by: debdrup Reported by: 0mp Reviewed by: imp Sponsored by: Klara Inc. Differential Revision: https://reviews.freebsd.org/D25721 Modified: head/usr.bin/at/at.man Modified: head/usr.bin/at/at.man ============================================================================== --- head/usr.bin/at/at.man Sun Jul 19 12:34:19 2020 (r363323) +++ head/usr.bin/at/at.man Sun Jul 19 14:42:13 2020 (r363324) @@ -216,7 +216,11 @@ might not be optimal for every deployment. If a finer granularity is desired, the .Pa /etc/cron.d/at file can be edited and will be read by the system crontab, from which -the SHELL and PATH environment variables are inherited. +the +.Ev SHELL +and +.Ev PATH +environment variables are inherited. .Sh OPTIONS .Bl -tag -width indent .It Fl q Ar queue From owner-svn-src-all@freebsd.org Sun Jul 19 15:16:28 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A489E3616E9; Sun, 19 Jul 2020 15:16:28 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4B8pNX3gpjz3RvN; Sun, 19 Jul 2020 15:16:28 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5DE361DB04; Sun, 19 Jul 2020 15:16:28 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06JFGSE7057286; Sun, 19 Jul 2020 15:16:28 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06JFGRHl057283; Sun, 19 Jul 2020 15:16:27 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <202007191516.06JFGRHl057283@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sun, 19 Jul 2020 15:16:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363325 - in head/sys: kern net80211 X-SVN-Group: head X-SVN-Commit-Author: adrian X-SVN-Commit-Paths: in head/sys: kern net80211 X-SVN-Commit-Revision: 363325 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 19 Jul 2020 15:16:28 -0000 Author: adrian Date: Sun Jul 19 15:16:27 2020 New Revision: 363325 URL: https://svnweb.freebsd.org/changeset/base/363325 Log: [net80211] Add new privileges; restrict what can be done in a jail. Split the MANAGE privilege into MANAGE, SETMAC and CREATE_VAP. + VAP_MANAGE is everything but setting the MAC and creating a VAP. + VAP_SETMAC is setting the MAC address of the VAP. Typically you wouldn't want the jail to be able to modify this. + CREATE_VAP is to create a new VAP. Again, you don't want to be doing this in a jail, but this DOES stop being able to run some corner cases like Dynamic WDS (DWDS) AP in a jail/vnet. We can figure this bit out later. This allows me to run wpa_supplicant in a jail after transferring a STA VAP into it. I unfortunately can't currently set the wlan debugging inside the jail; that would be super useful! Reviewed by: bz Differential Revision: https://reviews.freebsd.org/D25630 Modified: head/sys/kern/kern_jail.c head/sys/net80211/ieee80211_freebsd.c head/sys/net80211/ieee80211_ioctl.c Modified: head/sys/kern/kern_jail.c ============================================================================== --- head/sys/kern/kern_jail.c Sun Jul 19 14:42:13 2020 (r363324) +++ head/sys/kern/kern_jail.c Sun Jul 19 15:16:27 2020 (r363325) @@ -3107,10 +3107,8 @@ prison_priv_check(struct ucred *cred, int priv) /* * 802.11-related privileges. */ - case PRIV_NET80211_GETKEY: -#ifdef notyet - case PRIV_NET80211_MANAGE: /* XXX-BZ discuss with sam@ */ -#endif + case PRIV_NET80211_VAP_GETKEY: + case PRIV_NET80211_VAP_MANAGE: #ifdef notyet /* Modified: head/sys/net80211/ieee80211_freebsd.c ============================================================================== --- head/sys/net80211/ieee80211_freebsd.c Sun Jul 19 14:42:13 2020 (r363324) +++ head/sys/net80211/ieee80211_freebsd.c Sun Jul 19 15:16:27 2020 (r363325) @@ -41,6 +41,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -81,6 +82,10 @@ wlan_clone_create(struct if_clone *ifc, int unit, cadd struct ieee80211vap *vap; struct ieee80211com *ic; int error; + + error = priv_check(curthread, PRIV_NET80211_CREATE_VAP); + if (error) + return error; error = copyin(params, &cp, sizeof(cp)); if (error) Modified: head/sys/net80211/ieee80211_ioctl.c ============================================================================== --- head/sys/net80211/ieee80211_ioctl.c Sun Jul 19 14:42:13 2020 (r363324) +++ head/sys/net80211/ieee80211_ioctl.c Sun Jul 19 15:16:27 2020 (r363325) @@ -106,7 +106,8 @@ ieee80211_ioctl_getkey(struct ieee80211vap *vap, struc ik.ik_flags = wk->wk_flags & (IEEE80211_KEY_XMIT | IEEE80211_KEY_RECV); if (wk->wk_keyix == vap->iv_def_txkey) ik.ik_flags |= IEEE80211_KEY_DEFAULT; - if (priv_check(curthread, PRIV_NET80211_GETKEY) == 0) { + /* XXX TODO: move priv check to ieee80211_freebsd.c */ + if (priv_check(curthread, PRIV_NET80211_VAP_GETKEY) == 0) { /* NB: only root can read key data */ ik.ik_keyrsc = wk->wk_keyrsc[IEEE80211_NONQOS_TID]; ik.ik_keytsc = wk->wk_keytsc; @@ -815,7 +816,8 @@ ieee80211_ioctl_get80211(struct ieee80211vap *vap, u_l return EINVAL; len = (u_int) vap->iv_nw_keys[kid].wk_keylen; /* NB: only root can read WEP keys */ - if (priv_check(curthread, PRIV_NET80211_GETKEY) == 0) { + /* XXX TODO: move priv check to ieee80211_freebsd.c */ + if (priv_check(curthread, PRIV_NET80211_VAP_GETKEY) == 0) { bcopy(vap->iv_nw_keys[kid].wk_key, tmpkey, len); } else { bzero(tmpkey, len); @@ -3636,7 +3638,8 @@ ieee80211_ioctl(struct ifnet *ifp, u_long cmd, caddr_t (struct ieee80211req *) data); break; case SIOCS80211: - error = priv_check(curthread, PRIV_NET80211_MANAGE); + /* XXX TODO: move priv check to ieee80211_freebsd.c */ + error = priv_check(curthread, PRIV_NET80211_VAP_MANAGE); if (error == 0) error = ieee80211_ioctl_set80211(vap, cmd, (struct ieee80211req *) data); @@ -3681,6 +3684,12 @@ ieee80211_ioctl(struct ifnet *ifp, u_long cmd, caddr_t break; } break; + case SIOCSIFLLADDR: + /* XXX TODO: move priv check to ieee80211_freebsd.c */ + error = priv_check(curthread, PRIV_NET80211_VAP_SETMAC); + if (error == 0) + break; + /* Fallthrough */ default: /* * Pass unknown ioctls first to the driver, and if it From owner-svn-src-all@freebsd.org Sun Jul 19 15:16:58 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 86E5836167E; Sun, 19 Jul 2020 15:16:58 +0000 (UTC) (envelope-from kaktus@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4B8pP635hTz3Rwd; Sun, 19 Jul 2020 15:16:58 +0000 (UTC) (envelope-from kaktus@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 42DB61D9B1; Sun, 19 Jul 2020 15:16:58 +0000 (UTC) (envelope-from kaktus@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06JFGwQ6057501; Sun, 19 Jul 2020 15:16:58 GMT (envelope-from kaktus@FreeBSD.org) Received: (from kaktus@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06JFGw9M057500; Sun, 19 Jul 2020 15:16:58 GMT (envelope-from kaktus@FreeBSD.org) Message-Id: <202007191516.06JFGw9M057500@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kaktus set sender to kaktus@FreeBSD.org using -f From: Pawel Biernacki Date: Sun, 19 Jul 2020 15:16:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r363326 - stable/12/usr.bin/truss X-SVN-Group: stable-12 X-SVN-Commit-Author: kaktus X-SVN-Commit-Paths: stable/12/usr.bin/truss X-SVN-Commit-Revision: 363326 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 19 Jul 2020 15:16:58 -0000 Author: kaktus Date: Sun Jul 19 15:16:57 2020 New Revision: 363326 URL: https://svnweb.freebsd.org/changeset/base/363326 Log: MFC r362947 truss: print more information about traced sysctls Modified: stable/12/usr.bin/truss/syscalls.c Modified: stable/12/usr.bin/truss/syscalls.c ============================================================================== --- stable/12/usr.bin/truss/syscalls.c Sun Jul 19 15:16:27 2020 (r363325) +++ stable/12/usr.bin/truss/syscalls.c Sun Jul 19 15:16:57 2020 (r363326) @@ -1558,14 +1558,37 @@ print_cmsgs(FILE *fp, pid_t pid, bool receive, struct } static void -print_sysctl_oid(FILE *fp, int *oid, int len) +print_sysctl_oid(FILE *fp, int *oid, size_t len) { - int i; + size_t i; + bool first; - for (i = 0; i < len; i++) - fprintf(fp, ".%d", oid[i]); + first = true; + fprintf(fp, "{ "); + for (i = 0; i < len; i++) { + fprintf(fp, "%s%d", first ? "" : ".", oid[i]); + first = false; + } + fprintf(fp, " }"); } +static void +print_sysctl(FILE *fp, int *oid, size_t len) +{ + char name[BUFSIZ]; + int qoid[CTL_MAXNAME + 2]; + size_t i; + + qoid[0] = CTL_SYSCTL; + qoid[1] = CTL_SYSCTL_NAME; + memcpy(qoid + 2, oid, len * sizeof(int)); + i = sizeof(name); + if (sysctl(qoid, len + 2, name, &i, 0, 0) == -1) + print_sysctl_oid(fp, oid, len); + else + fprintf(fp, "%s", name); +} + /* * Converts a syscall argument into a string. Said string is * allocated via malloc(), so needs to be free()'d. sc is @@ -2277,9 +2300,8 @@ print_arg(struct syscall_args *sc, unsigned long *args break; case Sysctl: { char name[BUFSIZ]; - int oid[CTL_MAXNAME + 2], qoid[CTL_MAXNAME + 2]; - size_t i; - int len; + int oid[CTL_MAXNAME + 2]; + size_t len; memset(name, 0, sizeof(name)); len = args[sc->offset + 1]; @@ -2293,39 +2315,35 @@ print_arg(struct syscall_args *sc, unsigned long *args fprintf(fp, "debug"); break; case CTL_SYSCTL_NAME: - fprintf(fp, "name"); + fprintf(fp, "name "); print_sysctl_oid(fp, oid + 2, len - 2); break; case CTL_SYSCTL_NEXT: fprintf(fp, "next"); break; case CTL_SYSCTL_NAME2OID: - fprintf(fp, "name2oid"); + fprintf(fp, "name2oid %s", + get_string(pid, + (void *)args[sc->offset + 4], + args[sc->offset + 5])); break; case CTL_SYSCTL_OIDFMT: - fprintf(fp, "oidfmt"); - print_sysctl_oid(fp, oid + 2, len - 2); + fprintf(fp, "oidfmt "); + print_sysctl(fp, oid + 2, len - 2); break; case CTL_SYSCTL_OIDDESCR: - fprintf(fp, "oiddescr"); - print_sysctl_oid(fp, oid + 2, len - 2); + fprintf(fp, "oiddescr "); + print_sysctl(fp, oid + 2, len - 2); break; case CTL_SYSCTL_OIDLABEL: - fprintf(fp, "oidlabel"); - print_sysctl_oid(fp, oid + 2, len - 2); + fprintf(fp, "oidlabel "); + print_sysctl(fp, oid + 2, len - 2); break; default: - print_sysctl_oid(fp, oid + 1, len - 1); + print_sysctl(fp, oid + 1, len - 1); } } else { - qoid[0] = CTL_SYSCTL; - qoid[1] = CTL_SYSCTL_NAME; - memcpy(qoid + 2, oid, len * sizeof(int)); - i = sizeof(name); - if (sysctl(qoid, len + 2, name, &i, 0, 0) == -1) - print_sysctl_oid(fp, qoid + 2, len); - else - fprintf(fp, "%s", name); + print_sysctl(fp, oid, len); } fprintf(fp, "\""); } From owner-svn-src-all@freebsd.org Sun Jul 19 16:07:52 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5E2D1361E70; Sun, 19 Jul 2020 16:07:52 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4B8qWr1Hs1z3Tsr; Sun, 19 Jul 2020 16:07:52 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0C0761DC6C; Sun, 19 Jul 2020 16:07:52 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06JG7pss087748; Sun, 19 Jul 2020 16:07:51 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06JG7pMr087747; Sun, 19 Jul 2020 16:07:51 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <202007191607.06JG7pMr087747@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sun, 19 Jul 2020 16:07:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363327 - head/sys/sys X-SVN-Group: head X-SVN-Commit-Author: adrian X-SVN-Commit-Paths: head/sys/sys X-SVN-Commit-Revision: 363327 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 19 Jul 2020 16:07:52 -0000 Author: adrian Date: Sun Jul 19 16:07:51 2020 New Revision: 363327 URL: https://svnweb.freebsd.org/changeset/base/363327 Log: [net80211] missing from last commit, le whoops Differential Revision:https://reviews.freebsd.org/D25630 Modified: head/sys/sys/priv.h Modified: head/sys/sys/priv.h ============================================================================== --- head/sys/sys/priv.h Sun Jul 19 15:16:57 2020 (r363326) +++ head/sys/sys/priv.h Sun Jul 19 16:07:51 2020 (r363327) @@ -351,8 +351,10 @@ /* * 802.11-related privileges. */ -#define PRIV_NET80211_GETKEY 440 /* Query 802.11 keys. */ -#define PRIV_NET80211_MANAGE 441 /* Administer 802.11. */ +#define PRIV_NET80211_VAP_GETKEY 440 /* Query VAP 802.11 keys. */ +#define PRIV_NET80211_VAP_MANAGE 441 /* Administer 802.11 VAP */ +#define PRIV_NET80211_VAP_SETMAC 442 /* Set VAP MAC address */ +#define PRIV_NET80211_CREATE_VAP 443 /* Create a new VAP */ /* * Placeholder for AppleTalk privileges, not supported anymore. From owner-svn-src-all@freebsd.org Sun Jul 19 17:27:49 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 009AE364784; Sun, 19 Jul 2020 17:27:49 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4B8sJ46DMFz3YJ6; Sun, 19 Jul 2020 17:27:48 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B91621F34F; Sun, 19 Jul 2020 17:27:48 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06JHRmo7036929; Sun, 19 Jul 2020 17:27:48 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06JHRmRD036928; Sun, 19 Jul 2020 17:27:48 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <202007191727.06JHRmRD036928@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sun, 19 Jul 2020 17:27:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363328 - head/sys/dev/an X-SVN-Group: head X-SVN-Commit-Author: adrian X-SVN-Commit-Paths: head/sys/dev/an X-SVN-Commit-Revision: 363328 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 19 Jul 2020 17:27:49 -0000 Author: adrian Date: Sun Jul 19 17:27:48 2020 New Revision: 363328 URL: https://svnweb.freebsd.org/changeset/base/363328 Log: [if_an] unbreak! .. I missed this when checking drivers. Differential Revision: https://reviews.freebsd.org/D25723 Modified: head/sys/dev/an/if_an.c Modified: head/sys/dev/an/if_an.c ============================================================================== --- head/sys/dev/an/if_an.c Sun Jul 19 16:07:51 2020 (r363327) +++ head/sys/dev/an/if_an.c Sun Jul 19 17:27:48 2020 (r363328) @@ -2324,7 +2324,7 @@ an_ioctl(struct ifnet *ifp, u_long command, caddr_t da } break; case SIOCS80211: - if ((error = priv_check(td, PRIV_NET80211_MANAGE))) + if ((error = priv_check(td, PRIV_NET80211_VAP_MANAGE))) goto out; AN_LOCK(sc); sc->areq.an_len = sizeof(sc->areq); From owner-svn-src-all@freebsd.org Sun Jul 19 17:47:56 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 954433649AA; Sun, 19 Jul 2020 17:47:56 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4B8slJ3MHbz3ZY8; Sun, 19 Jul 2020 17:47:56 +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 572571F5AC; Sun, 19 Jul 2020 17:47:56 +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 06JHluZb049505; Sun, 19 Jul 2020 17:47:56 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06JHluPi049504; Sun, 19 Jul 2020 17:47:56 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202007191747.06JHluPi049504@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 19 Jul 2020 17:47:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363329 - head/sys/amd64/amd64 X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/amd64/amd64 X-SVN-Commit-Revision: 363329 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 19 Jul 2020 17:47:56 -0000 Author: kib Date: Sun Jul 19 17:47:55 2020 New Revision: 363329 URL: https://svnweb.freebsd.org/changeset/base/363329 Log: Simplify non-pti syscall entry on amd64. Limit manipulations to use %rax as scratch to the pti portion of the syscall entry code. Submitted by: alc Reviewed by: markj MFC after: 1 week Differential revision: https://reviews.freebsd.org/D25722 Modified: head/sys/amd64/amd64/exception.S Modified: head/sys/amd64/amd64/exception.S ============================================================================== --- head/sys/amd64/amd64/exception.S Sun Jul 19 17:27:48 2020 (r363328) +++ head/sys/amd64/amd64/exception.S Sun Jul 19 17:47:55 2020 (r363329) @@ -526,17 +526,17 @@ prot_addrf: IDTVEC(fast_syscall_pti) swapgs lfence - movq %rax,PCPU(SCRATCH_RAX) cmpq $~0,PCPU(UCR3) je fast_syscall_common + movq %rax,PCPU(SCRATCH_RAX) movq PCPU(KCR3),%rax movq %rax,%cr3 + movq PCPU(SCRATCH_RAX),%rax jmp fast_syscall_common SUPERALIGN_TEXT IDTVEC(fast_syscall) swapgs lfence - movq %rax,PCPU(SCRATCH_RAX) fast_syscall_common: movq %rsp,PCPU(SCRATCH_RSP) movq PCPU(RSP0),%rsp @@ -547,7 +547,6 @@ fast_syscall_common: 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 */ - movq PCPU(SCRATCH_RAX),%rax /* * Save a few arg registers early to free them for use in * handle_ibrs_entry(). %r10 is especially tricky. It is not an From owner-svn-src-all@freebsd.org Sun Jul 19 18:53:20 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 28C56365F4D; Sun, 19 Jul 2020 18:53:20 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4B8vBm03CTz3dRp; Sun, 19 Jul 2020 18:53:20 +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 D9375201D2; Sun, 19 Jul 2020 18:53:19 +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 06JIrJOe092277; Sun, 19 Jul 2020 18:53:19 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06JIrJPP092276; Sun, 19 Jul 2020 18:53:19 GMT (envelope-from ian@FreeBSD.org) Message-Id: <202007191853.06JIrJPP092276@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sun, 19 Jul 2020 18:53:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363330 - head/sys/dev/iicbus X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/sys/dev/iicbus X-SVN-Commit-Revision: 363330 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 19 Jul 2020 18:53:20 -0000 Author: ian Date: Sun Jul 19 18:53:19 2020 New Revision: 363330 URL: https://svnweb.freebsd.org/changeset/base/363330 Log: The ds3231 RTC chip bitmask values for 12- versus 24-hour mode were reversed, flip them so that times in the 20:00:00 to 23:59:59 range read correctly. Reported by: Dr. Rolf Jansen Pointy hat: ian@ Modified: head/sys/dev/iicbus/ds3231reg.h Modified: head/sys/dev/iicbus/ds3231reg.h ============================================================================== --- head/sys/dev/iicbus/ds3231reg.h Sun Jul 19 17:47:55 2020 (r363329) +++ head/sys/dev/iicbus/ds3231reg.h Sun Jul 19 18:53:19 2020 (r363330) @@ -38,8 +38,8 @@ #define DS3231_MINS 0x01 #define DS3231_MINS_MASK 0x7f #define DS3231_HOUR 0x02 -#define DS3231_HOUR_MASK_12HR 0x3f -#define DS3231_HOUR_MASK_24HR 0x1f +#define DS3231_HOUR_MASK_12HR 0x1f +#define DS3231_HOUR_MASK_24HR 0x3f #define DS3231_HOUR_IS_PM 0x20 #define DS3231_HOUR_USE_AMPM 0x40 #define DS3231_WEEKDAY 0x03 From owner-svn-src-all@freebsd.org Sun Jul 19 22:23:55 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A3DC736B935; Sun, 19 Jul 2020 22:23:55 +0000 (UTC) (envelope-from chuck@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4B8zsl3pHrz46kd; Sun, 19 Jul 2020 22:23:55 +0000 (UTC) (envelope-from chuck@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 66AFD229F0; Sun, 19 Jul 2020 22:23:55 +0000 (UTC) (envelope-from chuck@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06JMNtvE021362; Sun, 19 Jul 2020 22:23:55 GMT (envelope-from chuck@FreeBSD.org) Received: (from chuck@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06JMNtQI021361; Sun, 19 Jul 2020 22:23:55 GMT (envelope-from chuck@FreeBSD.org) Message-Id: <202007192223.06JMNtQI021361@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: chuck set sender to chuck@FreeBSD.org using -f From: Chuck Tuffli Date: Sun, 19 Jul 2020 22:23:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r363331 - stable/12/sys/dev/pci X-SVN-Group: stable-12 X-SVN-Commit-Author: chuck X-SVN-Commit-Paths: stable/12/sys/dev/pci X-SVN-Commit-Revision: 363331 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 19 Jul 2020 22:23:55 -0000 Author: chuck Date: Sun Jul 19 22:23:54 2020 New Revision: 363331 URL: https://svnweb.freebsd.org/changeset/base/363331 Log: MFC r362027 pci: loosen PCIe hot-plug requirements Modified: stable/12/sys/dev/pci/pci_pci.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/pci/pci_pci.c ============================================================================== --- stable/12/sys/dev/pci/pci_pci.c Sun Jul 19 18:53:19 2020 (r363330) +++ stable/12/sys/dev/pci/pci_pci.c Sun Jul 19 22:23:54 2020 (r363331) @@ -1070,14 +1070,6 @@ pcib_hotplug_present(struct pcib_softc *sc) if (!pcib_hotplug_inserted(sc)) return (0); - /* - * Require the Electromechanical Interlock to be engaged if - * present. - */ - if (sc->pcie_slot_cap & PCIEM_SLOT_CAP_EIP && - (sc->pcie_slot_sta & PCIEM_SLOT_STA_EIS) == 0) - return (0); - /* Require the Data Link Layer to be active. */ if (!(sc->pcie_link_sta & PCIEM_LINK_STA_DL_ACTIVE)) return (0); @@ -1333,7 +1325,7 @@ pcib_alloc_pcie_irq(struct pcib_softc *sc) rid = 0; sc->pcie_irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, - RF_ACTIVE); + RF_ACTIVE | RF_SHAREABLE); if (sc->pcie_irq == NULL) { device_printf(dev, "Failed to allocate interrupt for PCI-e events\n"); From owner-svn-src-all@freebsd.org Sun Jul 19 22:27:16 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 07A4436B79D; Sun, 19 Jul 2020 22:27:16 +0000 (UTC) (envelope-from chuck@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4B8zxb6ncyz472J; Sun, 19 Jul 2020 22:27:15 +0000 (UTC) (envelope-from chuck@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B340822BD5; Sun, 19 Jul 2020 22:27:15 +0000 (UTC) (envelope-from chuck@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06JMRFjQ021581; Sun, 19 Jul 2020 22:27:15 GMT (envelope-from chuck@FreeBSD.org) Received: (from chuck@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06JMRFWj021580; Sun, 19 Jul 2020 22:27:15 GMT (envelope-from chuck@FreeBSD.org) Message-Id: <202007192227.06JMRFWj021580@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: chuck set sender to chuck@FreeBSD.org using -f From: Chuck Tuffli Date: Sun, 19 Jul 2020 22:27:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r363332 - stable/12/usr.sbin/bhyve X-SVN-Group: stable-12 X-SVN-Commit-Author: chuck X-SVN-Commit-Paths: stable/12/usr.sbin/bhyve X-SVN-Commit-Revision: 363332 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 19 Jul 2020 22:27:16 -0000 Author: chuck Date: Sun Jul 19 22:27:15 2020 New Revision: 363332 URL: https://svnweb.freebsd.org/changeset/base/363332 Log: MFC 362744 bhyve: convert NVMe logging statements Modified: stable/12/usr.sbin/bhyve/pci_nvme.c Directory Properties: stable/12/ (props changed) Modified: stable/12/usr.sbin/bhyve/pci_nvme.c ============================================================================== --- stable/12/usr.sbin/bhyve/pci_nvme.c Sun Jul 19 22:23:54 2020 (r363331) +++ stable/12/usr.sbin/bhyve/pci_nvme.c Sun Jul 19 22:27:15 2020 (r363332) @@ -83,8 +83,8 @@ __FBSDID("$FreeBSD$"); static int nvme_debug = 0; -#define DPRINTF(params) if (nvme_debug) PRINTLN params -#define WPRINTF(params) PRINTLN params +#define DPRINTF(fmt, args...) if (nvme_debug) PRINTLN(fmt, ##args) +#define WPRINTF(fmt, args...) PRINTLN(fmt, ##args) /* defaults; can be overridden */ #define NVME_MSIX_BAR 4 @@ -495,7 +495,7 @@ pci_nvme_init_logpages(struct pci_nvme_softc *sc) static void pci_nvme_reset_locked(struct pci_nvme_softc *sc) { - DPRINTF(("%s", __func__)); + DPRINTF("%s", __func__); sc->regs.cap_lo = (ZERO_BASED(sc->max_qentries) & NVME_CAP_LO_REG_MQES_MASK) | (1 << NVME_CAP_LO_REG_CQR_SHIFT) | @@ -562,23 +562,23 @@ pci_nvme_init_controller(struct vmctx *ctx, struct pci { uint16_t acqs, asqs; - DPRINTF(("%s", __func__)); + DPRINTF("%s", __func__); asqs = (sc->regs.aqa & NVME_AQA_REG_ASQS_MASK) + 1; sc->submit_queues[0].size = asqs; sc->submit_queues[0].qbase = vm_map_gpa(ctx, sc->regs.asq, sizeof(struct nvme_command) * asqs); - DPRINTF(("%s mapping Admin-SQ guest 0x%lx, host: %p", - __func__, sc->regs.asq, sc->submit_queues[0].qbase)); + DPRINTF("%s mapping Admin-SQ guest 0x%lx, host: %p", + __func__, sc->regs.asq, sc->submit_queues[0].qbase); acqs = ((sc->regs.aqa >> NVME_AQA_REG_ACQS_SHIFT) & NVME_AQA_REG_ACQS_MASK) + 1; sc->compl_queues[0].size = acqs; sc->compl_queues[0].qbase = vm_map_gpa(ctx, sc->regs.acq, sizeof(struct nvme_completion) * acqs); - DPRINTF(("%s mapping Admin-CQ guest 0x%lx, host: %p", - __func__, sc->regs.acq, sc->compl_queues[0].qbase)); + DPRINTF("%s mapping Admin-CQ guest 0x%lx, host: %p", + __func__, sc->regs.acq, sc->compl_queues[0].qbase); } static int @@ -634,10 +634,10 @@ nvme_opc_delete_io_sq(struct pci_nvme_softc* sc, struc { uint16_t qid = command->cdw10 & 0xffff; - DPRINTF(("%s DELETE_IO_SQ %u", __func__, qid)); + DPRINTF("%s DELETE_IO_SQ %u", __func__, qid); if (qid == 0 || qid > sc->num_squeues) { - WPRINTF(("%s NOT PERMITTED queue id %u / num_squeues %u", - __func__, qid, sc->num_squeues)); + WPRINTF("%s NOT PERMITTED queue id %u / num_squeues %u", + __func__, qid, sc->num_squeues); pci_nvme_status_tc(&compl->status, NVME_SCT_COMMAND_SPECIFIC, NVME_SC_INVALID_QUEUE_IDENTIFIER); return (1); @@ -657,8 +657,8 @@ nvme_opc_create_io_sq(struct pci_nvme_softc* sc, struc struct nvme_submission_queue *nsq; if ((qid == 0) || (qid > sc->num_squeues)) { - WPRINTF(("%s queue index %u > num_squeues %u", - __func__, qid, sc->num_squeues)); + WPRINTF("%s queue index %u > num_squeues %u", + __func__, qid, sc->num_squeues); pci_nvme_status_tc(&compl->status, NVME_SCT_COMMAND_SPECIFIC, NVME_SC_INVALID_QUEUE_IDENTIFIER); @@ -673,20 +673,20 @@ nvme_opc_create_io_sq(struct pci_nvme_softc* sc, struc nsq->cqid = (command->cdw11 >> 16) & 0xffff; nsq->qpriority = (command->cdw11 >> 1) & 0x03; - DPRINTF(("%s sq %u size %u gaddr %p cqid %u", __func__, - qid, nsq->size, nsq->qbase, nsq->cqid)); + DPRINTF("%s sq %u size %u gaddr %p cqid %u", __func__, + qid, nsq->size, nsq->qbase, nsq->cqid); pci_nvme_status_genc(&compl->status, NVME_SC_SUCCESS); - DPRINTF(("%s completed creating IOSQ qid %u", - __func__, qid)); + DPRINTF("%s completed creating IOSQ qid %u", + __func__, qid); } else { /* * Guest sent non-cont submission queue request. * This setting is unsupported by this emulation. */ - WPRINTF(("%s unsupported non-contig (list-based) " - "create i/o submission queue", __func__)); + WPRINTF("%s unsupported non-contig (list-based) " + "create i/o submission queue", __func__); pci_nvme_status_genc(&compl->status, NVME_SC_INVALID_FIELD); } @@ -699,10 +699,10 @@ nvme_opc_delete_io_cq(struct pci_nvme_softc* sc, struc { uint16_t qid = command->cdw10 & 0xffff; - DPRINTF(("%s DELETE_IO_CQ %u", __func__, qid)); + DPRINTF("%s DELETE_IO_CQ %u", __func__, qid); if (qid == 0 || qid > sc->num_cqueues) { - WPRINTF(("%s queue index %u / num_cqueues %u", - __func__, qid, sc->num_cqueues)); + WPRINTF("%s queue index %u / num_cqueues %u", + __func__, qid, sc->num_cqueues); pci_nvme_status_tc(&compl->status, NVME_SCT_COMMAND_SPECIFIC, NVME_SC_INVALID_QUEUE_IDENTIFIER); return (1); @@ -722,8 +722,8 @@ nvme_opc_create_io_cq(struct pci_nvme_softc* sc, struc struct nvme_completion_queue *ncq; if ((qid == 0) || (qid > sc->num_cqueues)) { - WPRINTF(("%s queue index %u > num_cqueues %u", - __func__, qid, sc->num_cqueues)); + WPRINTF("%s queue index %u > num_cqueues %u", + __func__, qid, sc->num_cqueues); pci_nvme_status_tc(&compl->status, NVME_SCT_COMMAND_SPECIFIC, NVME_SC_INVALID_QUEUE_IDENTIFIER); @@ -744,9 +744,9 @@ nvme_opc_create_io_cq(struct pci_nvme_softc* sc, struc /* * Non-contig completion queue unsupported. */ - WPRINTF(("%s unsupported non-contig (list-based) " + WPRINTF("%s unsupported non-contig (list-based) " "create i/o completion queue", - __func__)); + __func__); /* 0x12 = Invalid Use of Controller Memory Buffer */ pci_nvme_status_genc(&compl->status, 0x12); @@ -762,7 +762,7 @@ nvme_opc_get_log_page(struct pci_nvme_softc* sc, struc uint32_t logsize = (1 + ((command->cdw10 >> 16) & 0xFFF)) * 2; uint8_t logpage = command->cdw10 & 0xFF; - DPRINTF(("%s log page %u len %u", __func__, logpage, logsize)); + DPRINTF("%s log page %u len %u", __func__, logpage, logsize); pci_nvme_status_genc(&compl->status, NVME_SC_SUCCESS); @@ -784,8 +784,8 @@ nvme_opc_get_log_page(struct pci_nvme_softc* sc, struc NVME_COPY_TO_PRP); break; default: - WPRINTF(("%s get log page %x command not supported", - __func__, logpage)); + WPRINTF("%s get log page %x command not supported", + __func__, logpage); pci_nvme_status_tc(&compl->status, NVME_SCT_COMMAND_SPECIFIC, NVME_SC_INVALID_LOG_PAGE); @@ -800,8 +800,8 @@ nvme_opc_identify(struct pci_nvme_softc* sc, struct nv { void *dest; - DPRINTF(("%s identify 0x%x nsid 0x%x", __func__, - command->cdw10 & 0xFF, command->nsid)); + DPRINTF("%s identify 0x%x nsid 0x%x", __func__, + command->cdw10 & 0xFF, command->nsid); switch (command->cdw10 & 0xFF) { case 0x00: /* return Identify Namespace data structure */ @@ -832,8 +832,8 @@ nvme_opc_identify(struct pci_nvme_softc* sc, struct nv case 0x14: case 0x15: default: - DPRINTF(("%s unsupported identify command requested 0x%x", - __func__, command->cdw10 & 0xFF)); + DPRINTF("%s unsupported identify command requested 0x%x", + __func__, command->cdw10 & 0xFF); pci_nvme_status_genc(&compl->status, NVME_SC_INVALID_FIELD); return (1); } @@ -850,29 +850,29 @@ nvme_set_feature_queues(struct pci_nvme_softc* sc, str nqr = command->cdw11 & 0xFFFF; if (nqr == 0xffff) { - WPRINTF(("%s: Illegal NSQR value %#x", __func__, nqr)); + WPRINTF("%s: Illegal NSQR value %#x", __func__, nqr); pci_nvme_status_genc(&compl->status, NVME_SC_INVALID_FIELD); return (-1); } sc->num_squeues = ONE_BASED(nqr); if (sc->num_squeues > sc->max_queues) { - DPRINTF(("NSQR=%u is greater than max %u", sc->num_squeues, - sc->max_queues)); + DPRINTF("NSQR=%u is greater than max %u", sc->num_squeues, + sc->max_queues); sc->num_squeues = sc->max_queues; } nqr = (command->cdw11 >> 16) & 0xFFFF; if (nqr == 0xffff) { - WPRINTF(("%s: Illegal NCQR value %#x", __func__, nqr)); + WPRINTF("%s: Illegal NCQR value %#x", __func__, nqr); pci_nvme_status_genc(&compl->status, NVME_SC_INVALID_FIELD); return (-1); } sc->num_cqueues = ONE_BASED(nqr); if (sc->num_cqueues > sc->max_queues) { - DPRINTF(("NCQR=%u is greater than max %u", sc->num_cqueues, - sc->max_queues)); + DPRINTF("NCQR=%u is greater than max %u", sc->num_cqueues, + sc->max_queues); sc->num_cqueues = sc->max_queues; } @@ -888,33 +888,33 @@ nvme_opc_set_features(struct pci_nvme_softc* sc, struc int feature = command->cdw10 & 0xFF; uint32_t iv; - DPRINTF(("%s feature 0x%x", __func__, feature)); + DPRINTF("%s feature 0x%x", __func__, feature); compl->cdw0 = 0; switch (feature) { case NVME_FEAT_ARBITRATION: - DPRINTF((" arbitration 0x%x", command->cdw11)); + DPRINTF(" arbitration 0x%x", command->cdw11); break; case NVME_FEAT_POWER_MANAGEMENT: - DPRINTF((" power management 0x%x", command->cdw11)); + DPRINTF(" power management 0x%x", command->cdw11); break; case NVME_FEAT_LBA_RANGE_TYPE: - DPRINTF((" lba range 0x%x", command->cdw11)); + DPRINTF(" lba range 0x%x", command->cdw11); break; case NVME_FEAT_TEMPERATURE_THRESHOLD: - DPRINTF((" temperature threshold 0x%x", command->cdw11)); + DPRINTF(" temperature threshold 0x%x", command->cdw11); break; case NVME_FEAT_ERROR_RECOVERY: - DPRINTF((" error recovery 0x%x", command->cdw11)); + DPRINTF(" error recovery 0x%x", command->cdw11); break; case NVME_FEAT_VOLATILE_WRITE_CACHE: - DPRINTF((" volatile write cache 0x%x", command->cdw11)); + DPRINTF(" volatile write cache 0x%x", command->cdw11); break; case NVME_FEAT_NUMBER_OF_QUEUES: nvme_set_feature_queues(sc, command, compl); break; case NVME_FEAT_INTERRUPT_COALESCING: - DPRINTF((" interrupt coalescing 0x%x", command->cdw11)); + DPRINTF(" interrupt coalescing 0x%x", command->cdw11); /* in uS */ sc->intr_coales_aggr_time = ((command->cdw11 >> 8) & 0xFF)*100; @@ -924,8 +924,8 @@ nvme_opc_set_features(struct pci_nvme_softc* sc, struc case NVME_FEAT_INTERRUPT_VECTOR_CONFIGURATION: iv = command->cdw11 & 0xFFFF; - DPRINTF((" interrupt vector configuration 0x%x", - command->cdw11)); + DPRINTF(" interrupt vector configuration 0x%x", + command->cdw11); for (uint32_t i = 0; i < sc->num_cqueues + 1; i++) { if (sc->compl_queues[i].intr_vec == iv) { @@ -939,23 +939,23 @@ nvme_opc_set_features(struct pci_nvme_softc* sc, struc } break; case NVME_FEAT_WRITE_ATOMICITY: - DPRINTF((" write atomicity 0x%x", command->cdw11)); + DPRINTF(" write atomicity 0x%x", command->cdw11); break; case NVME_FEAT_ASYNC_EVENT_CONFIGURATION: - DPRINTF((" async event configuration 0x%x", - command->cdw11)); + DPRINTF(" async event configuration 0x%x", + command->cdw11); sc->async_ev_config = command->cdw11; break; case NVME_FEAT_SOFTWARE_PROGRESS_MARKER: - DPRINTF((" software progress marker 0x%x", - command->cdw11)); + DPRINTF(" software progress marker 0x%x", + command->cdw11); break; case 0x0C: - DPRINTF((" autonomous power state transition 0x%x", - command->cdw11)); + DPRINTF(" autonomous power state transition 0x%x", + command->cdw11); break; default: - WPRINTF(("%s invalid feature", __func__)); + WPRINTF("%s invalid feature", __func__); pci_nvme_status_genc(&compl->status, NVME_SC_INVALID_FIELD); return (1); } @@ -970,22 +970,22 @@ nvme_opc_get_features(struct pci_nvme_softc* sc, struc { int feature = command->cdw10 & 0xFF; - DPRINTF(("%s feature 0x%x", __func__, feature)); + DPRINTF("%s feature 0x%x", __func__, feature); compl->cdw0 = 0; switch (feature) { case NVME_FEAT_ARBITRATION: - DPRINTF((" arbitration")); + DPRINTF(" arbitration"); break; case NVME_FEAT_POWER_MANAGEMENT: - DPRINTF((" power management")); + DPRINTF(" power management"); break; case NVME_FEAT_LBA_RANGE_TYPE: - DPRINTF((" lba range")); + DPRINTF(" lba range"); break; case NVME_FEAT_TEMPERATURE_THRESHOLD: - DPRINTF((" temperature threshold")); + DPRINTF(" temperature threshold"); switch ((command->cdw11 >> 20) & 0x3) { case 0: /* Over temp threshold */ @@ -996,47 +996,47 @@ nvme_opc_get_features(struct pci_nvme_softc* sc, struc compl->cdw0 = 0; break; default: - WPRINTF((" invalid threshold type select")); + WPRINTF(" invalid threshold type select"); pci_nvme_status_genc(&compl->status, NVME_SC_INVALID_FIELD); return (1); } break; case NVME_FEAT_ERROR_RECOVERY: - DPRINTF((" error recovery")); + DPRINTF(" error recovery"); break; case NVME_FEAT_VOLATILE_WRITE_CACHE: - DPRINTF((" volatile write cache")); + DPRINTF(" volatile write cache"); break; case NVME_FEAT_NUMBER_OF_QUEUES: compl->cdw0 = NVME_FEATURE_NUM_QUEUES(sc); - DPRINTF((" number of queues (submit %u, completion %u)", + DPRINTF(" number of queues (submit %u, completion %u)", compl->cdw0 & 0xFFFF, - (compl->cdw0 >> 16) & 0xFFFF)); + (compl->cdw0 >> 16) & 0xFFFF); break; case NVME_FEAT_INTERRUPT_COALESCING: - DPRINTF((" interrupt coalescing")); + DPRINTF(" interrupt coalescing"); break; case NVME_FEAT_INTERRUPT_VECTOR_CONFIGURATION: - DPRINTF((" interrupt vector configuration")); + DPRINTF(" interrupt vector configuration"); break; case NVME_FEAT_WRITE_ATOMICITY: - DPRINTF((" write atomicity")); + DPRINTF(" write atomicity"); break; case NVME_FEAT_ASYNC_EVENT_CONFIGURATION: - DPRINTF((" async event configuration")); + DPRINTF(" async event configuration"); sc->async_ev_config = command->cdw11; break; case NVME_FEAT_SOFTWARE_PROGRESS_MARKER: - DPRINTF((" software progress marker")); + DPRINTF(" software progress marker"); break; case 0x0C: - DPRINTF((" autonomous power state transition")); + DPRINTF(" autonomous power state transition"); break; default: - WPRINTF(("%s invalid feature 0x%x", __func__, feature)); + WPRINTF("%s invalid feature 0x%x", __func__, feature); pci_nvme_status_genc(&compl->status, NVME_SC_INVALID_FIELD); return (1); } @@ -1049,8 +1049,8 @@ static int nvme_opc_abort(struct pci_nvme_softc* sc, struct nvme_command* command, struct nvme_completion* compl) { - DPRINTF(("%s submission queue %u, command ID 0x%x", __func__, - command->cdw10 & 0xFFFF, (command->cdw10 >> 16) & 0xFFFF)); + DPRINTF("%s submission queue %u, command ID 0x%x", __func__, + command->cdw10 & 0xFFFF, (command->cdw10 >> 16) & 0xFFFF); /* TODO: search for the command ID and abort it */ @@ -1063,7 +1063,7 @@ static int nvme_opc_async_event_req(struct pci_nvme_softc* sc, struct nvme_command* command, struct nvme_completion* compl) { - DPRINTF(("%s async event request 0x%x", __func__, command->cdw11)); + DPRINTF("%s async event request 0x%x", __func__, command->cdw11); /* * TODO: raise events when they happen based on the Set Features cmd. @@ -1084,7 +1084,7 @@ pci_nvme_handle_admin_cmd(struct pci_nvme_softc* sc, u struct nvme_completion_queue *cq; uint16_t sqhead; - DPRINTF(("%s index %u", __func__, (uint32_t)value)); + DPRINTF("%s index %u", __func__, (uint32_t)value); sq = &sc->submit_queues[0]; cq = &sc->compl_queues[0]; @@ -1092,12 +1092,12 @@ pci_nvme_handle_admin_cmd(struct pci_nvme_softc* sc, u sqhead = atomic_load_acq_short(&sq->head); if (atomic_testandset_int(&sq->busy, 1)) { - DPRINTF(("%s SQ busy, head %u, tail %u", - __func__, sqhead, sq->tail)); + DPRINTF("%s SQ busy, head %u, tail %u", + __func__, sqhead, sq->tail); return; } - DPRINTF(("sqhead %u, tail %u", sqhead, sq->tail)); + DPRINTF("sqhead %u, tail %u", sqhead, sq->tail); while (sqhead != atomic_load_acq_short(&sq->tail)) { cmd = &(sq->qbase)[sqhead]; @@ -1105,51 +1105,51 @@ pci_nvme_handle_admin_cmd(struct pci_nvme_softc* sc, u switch (cmd->opc) { case NVME_OPC_DELETE_IO_SQ: - DPRINTF(("%s command DELETE_IO_SQ", __func__)); + DPRINTF("%s command DELETE_IO_SQ", __func__); nvme_opc_delete_io_sq(sc, cmd, &compl); break; case NVME_OPC_CREATE_IO_SQ: - DPRINTF(("%s command CREATE_IO_SQ", __func__)); + DPRINTF("%s command CREATE_IO_SQ", __func__); nvme_opc_create_io_sq(sc, cmd, &compl); break; case NVME_OPC_DELETE_IO_CQ: - DPRINTF(("%s command DELETE_IO_CQ", __func__)); + DPRINTF("%s command DELETE_IO_CQ", __func__); nvme_opc_delete_io_cq(sc, cmd, &compl); break; case NVME_OPC_CREATE_IO_CQ: - DPRINTF(("%s command CREATE_IO_CQ", __func__)); + DPRINTF("%s command CREATE_IO_CQ", __func__); nvme_opc_create_io_cq(sc, cmd, &compl); break; case NVME_OPC_GET_LOG_PAGE: - DPRINTF(("%s command GET_LOG_PAGE", __func__)); + DPRINTF("%s command GET_LOG_PAGE", __func__); nvme_opc_get_log_page(sc, cmd, &compl); break; case NVME_OPC_IDENTIFY: - DPRINTF(("%s command IDENTIFY", __func__)); + DPRINTF("%s command IDENTIFY", __func__); nvme_opc_identify(sc, cmd, &compl); break; case NVME_OPC_ABORT: - DPRINTF(("%s command ABORT", __func__)); + DPRINTF("%s command ABORT", __func__); nvme_opc_abort(sc, cmd, &compl); break; case NVME_OPC_SET_FEATURES: - DPRINTF(("%s command SET_FEATURES", __func__)); + DPRINTF("%s command SET_FEATURES", __func__); nvme_opc_set_features(sc, cmd, &compl); break; case NVME_OPC_GET_FEATURES: - DPRINTF(("%s command GET_FEATURES", __func__)); + DPRINTF("%s command GET_FEATURES", __func__); nvme_opc_get_features(sc, cmd, &compl); break; case NVME_OPC_ASYNC_EVENT_REQUEST: - DPRINTF(("%s command ASYNC_EVENT_REQ", __func__)); + DPRINTF("%s command ASYNC_EVENT_REQ", __func__); /* XXX dont care, unhandled for now nvme_opc_async_event_req(sc, cmd, &compl); */ compl.status = NVME_NO_STATUS; break; default: - WPRINTF(("0x%x command is not implemented", - cmd->opc)); + WPRINTF("0x%x command is not implemented", + cmd->opc); pci_nvme_status_genc(&compl.status, NVME_SC_INVALID_OPCODE); } sqhead = (sqhead + 1) % sq->size; @@ -1172,7 +1172,7 @@ pci_nvme_handle_admin_cmd(struct pci_nvme_softc* sc, u } } - DPRINTF(("setting sqhead %u", sqhead)); + DPRINTF("setting sqhead %u", sqhead); atomic_store_short(&sq->head, sqhead); atomic_store_int(&sq->busy, 0); @@ -1207,7 +1207,7 @@ pci_nvme_append_iov_req(struct pci_nvme_softc *sc, str if (iovidx == NVME_MAX_BLOCKIOVS) { int err = 0; - DPRINTF(("large I/O, doing partial req")); + DPRINTF("large I/O, doing partial req"); iovidx = 0; req->io_req.br_iovcnt = 0; @@ -1251,7 +1251,7 @@ pci_nvme_append_iov_req(struct pci_nvme_softc *sc, str void *gptr; if ((lba + size) > sc->nvstore.size) { - WPRINTF(("%s write would overflow RAM", __func__)); + WPRINTF("%s write would overflow RAM", __func__); return (-1); } @@ -1274,9 +1274,9 @@ pci_nvme_set_completion(struct pci_nvme_softc *sc, struct nvme_completion *compl; int phase; - DPRINTF(("%s sqid %d cqid %u cid %u status: 0x%x 0x%x", + DPRINTF("%s sqid %d cqid %u cid %u status: 0x%x 0x%x", __func__, sqid, sq->cqid, cid, NVME_STATUS_GET_SCT(status), - NVME_STATUS_GET_SC(status))); + NVME_STATUS_GET_SC(status)); pthread_mutex_lock(&cq->mtx); @@ -1302,8 +1302,8 @@ pci_nvme_set_completion(struct pci_nvme_softc *sc, if (cq->intr_en & NVME_CQ_INTEN) { pci_generate_msix(sc->nsc_pi, cq->intr_vec); } else { - DPRINTF(("%s: CQ%u interrupt disabled\n", - __func__, sq->cqid)); + DPRINTF("%s: CQ%u interrupt disabled", + __func__, sq->cqid); } } } @@ -1365,7 +1365,7 @@ pci_nvme_io_done(struct blockif_req *br, int err) struct nvme_submission_queue *sq = req->nvme_sq; uint16_t code, status; - DPRINTF(("%s error %d %s", __func__, err, strerror(err))); + DPRINTF("%s error %d %s", __func__, err, strerror(err)); /* TODO return correct error */ code = err ? NVME_SC_DATA_TRANSFER_ERROR : NVME_SC_SUCCESS; @@ -1380,7 +1380,7 @@ pci_nvme_io_partial(struct blockif_req *br, int err) { struct pci_nvme_ioreq *req = br->br_param; - DPRINTF(("%s error %d %s", __func__, err, strerror(err))); + DPRINTF("%s error %d %s", __func__, err, strerror(err)); pthread_cond_signal(&req->cv); } @@ -1519,14 +1519,14 @@ pci_nvme_handle_io_cmd(struct pci_nvme_softc* sc, uint sq = &sc->submit_queues[idx]; if (atomic_testandset_int(&sq->busy, 1)) { - DPRINTF(("%s sqid %u busy", __func__, idx)); + DPRINTF("%s sqid %u busy", __func__, idx); return; } sqhead = atomic_load_acq_short(&sq->head); - DPRINTF(("nvme_handle_io qid %u head %u tail %u cmdlist %p", - idx, sqhead, sq->tail, sq->qbase)); + DPRINTF("nvme_handle_io qid %u head %u tail %u cmdlist %p", + idx, sqhead, sq->tail, sq->qbase); while (sqhead != atomic_load_acq_short(&sq->tail)) { struct nvme_command *cmd; @@ -1549,8 +1549,8 @@ pci_nvme_handle_io_cmd(struct pci_nvme_softc* sc, uint continue; } else if (cmd->opc == 0x08) { /* TODO: write zeroes */ - WPRINTF(("%s write zeroes lba 0x%lx blocks %u", - __func__, lba, cmd->cdw12 & 0xFFFF)); + WPRINTF("%s write zeroes lba 0x%lx blocks %u", + __func__, lba, cmd->cdw12 & 0xFFFF); pci_nvme_status_genc(&status, NVME_SC_SUCCESS); pci_nvme_set_completion(sc, sq, idx, cmd->cid, 0, status, 1); @@ -1584,17 +1584,17 @@ pci_nvme_handle_io_cmd(struct pci_nvme_softc* sc, uint * increase page count */ - DPRINTF(("[h%u:t%u:n%u] %s starting LBA 0x%lx blocks %lu " + DPRINTF("[h%u:t%u:n%u] %s starting LBA 0x%lx blocks %lu " "(%lu-bytes)", sqhead==0 ? sq->size-1 : sqhead-1, sq->tail, sq->size, cmd->opc == NVME_OPC_WRITE ? "WRITE" : "READ", - lba, nblocks, bytes)); + lba, nblocks, bytes); cmd->prp1 &= ~(0x03UL); cmd->prp2 &= ~(0x03UL); - DPRINTF((" prp1 0x%lx prp2 0x%lx", cmd->prp1, cmd->prp2)); + DPRINTF(" prp1 0x%lx prp2 0x%lx", cmd->prp1, cmd->prp2); size = bytes; lba *= sc->nvstore.sectsz; @@ -1652,7 +1652,7 @@ pci_nvme_handle_io_cmd(struct pci_nvme_softc* sc, uint i = 0; } if (prp_list[i] == 0) { - WPRINTF(("PRP2[%d] = 0 !!!", i)); + WPRINTF("PRP2[%d] = 0 !!!", i); err = 1; break; } @@ -1698,8 +1698,8 @@ iodone: err = blockif_write(sc->nvstore.ctx, &req->io_req); break; default: - WPRINTF(("%s unhandled io command 0x%x", - __func__, cmd->opc)); + WPRINTF("%s unhandled io command 0x%x", + __func__, cmd->opc); err = 1; } @@ -1724,8 +1724,8 @@ static void pci_nvme_handle_doorbell(struct vmctx *ctx, struct pci_nvme_softc* sc, uint64_t idx, int is_sq, uint64_t value) { - DPRINTF(("nvme doorbell %lu, %s, val 0x%lx", - idx, is_sq ? "SQ" : "CQ", value & 0xFFFF)); + DPRINTF("nvme doorbell %lu, %s, val 0x%lx", + idx, is_sq ? "SQ" : "CQ", value & 0xFFFF); if (is_sq) { atomic_store_short(&sc->submit_queues[idx].tail, @@ -1736,18 +1736,18 @@ pci_nvme_handle_doorbell(struct vmctx *ctx, struct pci } else { /* submission queue; handle new entries in SQ */ if (idx > sc->num_squeues) { - WPRINTF(("%s SQ index %lu overflow from " + WPRINTF("%s SQ index %lu overflow from " "guest (max %u)", - __func__, idx, sc->num_squeues)); + __func__, idx, sc->num_squeues); return; } pci_nvme_handle_io_cmd(sc, (uint16_t)idx); } } else { if (idx > sc->num_cqueues) { - WPRINTF(("%s queue index %lu overflow from " + WPRINTF("%s queue index %lu overflow from " "guest (max %u)", - __func__, idx, sc->num_cqueues)); + __func__, idx, sc->num_cqueues); return; } @@ -1762,46 +1762,46 @@ pci_nvme_bar0_reg_dumps(const char *func, uint64_t off switch (offset) { case NVME_CR_CAP_LOW: - DPRINTF(("%s %s NVME_CR_CAP_LOW", func, s)); + DPRINTF("%s %s NVME_CR_CAP_LOW", func, s); break; case NVME_CR_CAP_HI: - DPRINTF(("%s %s NVME_CR_CAP_HI", func, s)); + DPRINTF("%s %s NVME_CR_CAP_HI", func, s); break; case NVME_CR_VS: - DPRINTF(("%s %s NVME_CR_VS", func, s)); + DPRINTF("%s %s NVME_CR_VS", func, s); break; case NVME_CR_INTMS: - DPRINTF(("%s %s NVME_CR_INTMS", func, s)); + DPRINTF("%s %s NVME_CR_INTMS", func, s); break; case NVME_CR_INTMC: - DPRINTF(("%s %s NVME_CR_INTMC", func, s)); + DPRINTF("%s %s NVME_CR_INTMC", func, s); break; case NVME_CR_CC: - DPRINTF(("%s %s NVME_CR_CC", func, s)); + DPRINTF("%s %s NVME_CR_CC", func, s); break; case NVME_CR_CSTS: - DPRINTF(("%s %s NVME_CR_CSTS", func, s)); + DPRINTF("%s %s NVME_CR_CSTS", func, s); break; case NVME_CR_NSSR: - DPRINTF(("%s %s NVME_CR_NSSR", func, s)); + DPRINTF("%s %s NVME_CR_NSSR", func, s); break; case NVME_CR_AQA: - DPRINTF(("%s %s NVME_CR_AQA", func, s)); + DPRINTF("%s %s NVME_CR_AQA", func, s); break; case NVME_CR_ASQ_LOW: - DPRINTF(("%s %s NVME_CR_ASQ_LOW", func, s)); + DPRINTF("%s %s NVME_CR_ASQ_LOW", func, s); break; case NVME_CR_ASQ_HI: - DPRINTF(("%s %s NVME_CR_ASQ_HI", func, s)); + DPRINTF("%s %s NVME_CR_ASQ_HI", func, s); break; case NVME_CR_ACQ_LOW: - DPRINTF(("%s %s NVME_CR_ACQ_LOW", func, s)); + DPRINTF("%s %s NVME_CR_ACQ_LOW", func, s); break; case NVME_CR_ACQ_HI: - DPRINTF(("%s %s NVME_CR_ACQ_HI", func, s)); + DPRINTF("%s %s NVME_CR_ACQ_HI", func, s); break; default: - DPRINTF(("unknown nvme bar-0 offset 0x%lx", offset)); + DPRINTF("unknown nvme bar-0 offset 0x%lx", offset); } } @@ -1818,9 +1818,9 @@ pci_nvme_write_bar_0(struct vmctx *ctx, struct pci_nvm int is_sq = (belloffset % 8) < 4; if (belloffset > ((sc->max_queues+1) * 8 - 4)) { - WPRINTF(("guest attempted an overflow write offset " + WPRINTF("guest attempted an overflow write offset " "0x%lx, val 0x%lx in %s", - offset, value, __func__)); + offset, value, __func__); return; } @@ -1828,13 +1828,13 @@ pci_nvme_write_bar_0(struct vmctx *ctx, struct pci_nvm return; } - DPRINTF(("nvme-write offset 0x%lx, size %d, value 0x%lx", - offset, size, value)); + DPRINTF("nvme-write offset 0x%lx, size %d, value 0x%lx", + offset, size, value); if (size != 4) { - WPRINTF(("guest wrote invalid size %d (offset 0x%lx, " + WPRINTF("guest wrote invalid size %d (offset 0x%lx, " "val 0x%lx) to bar0 in %s", - size, offset, value, __func__)); + size, offset, value, __func__); /* TODO: shutdown device */ return; } @@ -1860,12 +1860,12 @@ pci_nvme_write_bar_0(struct vmctx *ctx, struct pci_nvm case NVME_CR_CC: ccreg = (uint32_t)value; - DPRINTF(("%s NVME_CR_CC en %x css %x shn %x iosqes %u " + DPRINTF("%s NVME_CR_CC en %x css %x shn %x iosqes %u " "iocqes %u", __func__, NVME_CC_GET_EN(ccreg), NVME_CC_GET_CSS(ccreg), NVME_CC_GET_SHN(ccreg), NVME_CC_GET_IOSQES(ccreg), - NVME_CC_GET_IOCQES(ccreg))); + NVME_CC_GET_IOCQES(ccreg)); if (NVME_CC_GET_SHN(ccreg)) { /* perform shutdown - flush out data to backend */ @@ -1919,8 +1919,8 @@ pci_nvme_write_bar_0(struct vmctx *ctx, struct pci_nvm (value << 32); break; default: - DPRINTF(("%s unknown offset 0x%lx, value 0x%lx size %d", - __func__, offset, value, size)); + DPRINTF("%s unknown offset 0x%lx, value 0x%lx size %d", + __func__, offset, value, size); } pthread_mutex_unlock(&sc->mtx); } @@ -1933,8 +1933,8 @@ pci_nvme_write(struct vmctx *ctx, int vcpu, struct pci if (baridx == pci_msix_table_bar(pi) || baridx == pci_msix_pba_bar(pi)) { - DPRINTF(("nvme-write baridx %d, msix: off 0x%lx, size %d, " - " value 0x%lx", baridx, offset, size, value)); + DPRINTF("nvme-write baridx %d, msix: off 0x%lx, size %d, " + " value 0x%lx", baridx, offset, size, value); pci_emul_msix_twrite(pi, offset, size, value); return; @@ -1946,8 +1946,8 @@ pci_nvme_write(struct vmctx *ctx, int vcpu, struct pci break; default: - DPRINTF(("%s unknown baridx %d, val 0x%lx", - __func__, baridx, value)); + DPRINTF("%s unknown baridx %d, val 0x%lx", + __func__, baridx, value); } } @@ -1965,7 +1965,7 @@ static uint64_t pci_nvme_read_bar_0(struct pci_nvme_so pthread_mutex_unlock(&sc->mtx); } else { value = 0; - WPRINTF(("pci_nvme: read invalid offset %ld", offset)); + WPRINTF("pci_nvme: read invalid offset %ld", offset); } switch (size) { @@ -1980,8 +1980,8 @@ static uint64_t pci_nvme_read_bar_0(struct pci_nvme_so break; } - DPRINTF((" nvme-read offset 0x%lx, size %d -> value 0x%x", - offset, size, (uint32_t)value)); + DPRINTF(" nvme-read offset 0x%lx, size %d -> value 0x%x", + offset, size, (uint32_t)value); return (value); } @@ -1996,8 +1996,8 @@ pci_nvme_read(struct vmctx *ctx, int vcpu, struct pci_ if (baridx == pci_msix_table_bar(pi) || baridx == pci_msix_pba_bar(pi)) { - DPRINTF(("nvme-read bar: %d, msix: regoff 0x%lx, size %d", - baridx, offset, size)); + DPRINTF("nvme-read bar: %d, msix: regoff 0x%lx, size %d", + baridx, offset, size); return pci_emul_msix_tread(pi, offset, size); } @@ -2007,7 +2007,7 @@ pci_nvme_read(struct vmctx *ctx, int vcpu, struct pci_ return pci_nvme_read_bar_0(sc, offset, size); default: - DPRINTF(("unknown bar %d, 0x%lx", baridx, offset)); + DPRINTF("unknown bar %d, 0x%lx", baridx, offset); } return (0); @@ -2173,23 +2173,23 @@ pci_nvme_init(struct vmctx *ctx, struct pci_devinst *p 2 * sizeof(uint32_t) * (sc->max_queues + 1); pci_membar_sz = MAX(pci_membar_sz, NVME_MMIO_SPACE_MIN); - DPRINTF(("nvme membar size: %u", pci_membar_sz)); + DPRINTF("nvme membar size: %u", pci_membar_sz); error = pci_emul_alloc_bar(pi, 0, PCIBAR_MEM64, pci_membar_sz); if (error) { - WPRINTF(("%s pci alloc mem bar failed", __func__)); + WPRINTF("%s pci alloc mem bar failed", __func__); goto done; } error = pci_emul_add_msixcap(pi, sc->max_queues + 1, NVME_MSIX_BAR); if (error) { - WPRINTF(("%s pci add msixcap failed", __func__)); + WPRINTF("%s pci add msixcap failed", __func__); goto done; } error = pci_emul_add_pciecap(pi, PCIEM_TYPE_ROOT_INT_EP); if (error) { - WPRINTF(("%s pci add Express capability failed", __func__)); + WPRINTF("%s pci add Express capability failed", __func__); goto done; } From owner-svn-src-all@freebsd.org Sun Jul 19 22:37:47 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C22E836B7B6; Sun, 19 Jul 2020 22:37:47 +0000 (UTC) (envelope-from chuck@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4B909l4jxqz47KF; Sun, 19 Jul 2020 22:37:47 +0000 (UTC) (envelope-from chuck@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 85EE322EB1; Sun, 19 Jul 2020 22:37:47 +0000 (UTC) (envelope-from chuck@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06JMbl0g027498; Sun, 19 Jul 2020 22:37:47 GMT (envelope-from chuck@FreeBSD.org) Received: (from chuck@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06JMblXo027497; Sun, 19 Jul 2020 22:37:47 GMT (envelope-from chuck@FreeBSD.org) Message-Id: <202007192237.06JMblXo027497@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: chuck set sender to chuck@FreeBSD.org using -f From: Chuck Tuffli Date: Sun, 19 Jul 2020 22:37:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r363333 - stable/12/usr.sbin/bhyve X-SVN-Group: stable-12 X-SVN-Commit-Author: chuck X-SVN-Commit-Paths: stable/12/usr.sbin/bhyve X-SVN-Commit-Revision: 363333 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 19 Jul 2020 22:37:47 -0000 Author: chuck Date: Sun Jul 19 22:37:47 2020 New Revision: 363333 URL: https://svnweb.freebsd.org/changeset/base/363333 Log: MFC r362745 bhyve: refactor NVMe IO command handling Modified: stable/12/usr.sbin/bhyve/pci_nvme.c Directory Properties: stable/12/ (props changed) Modified: stable/12/usr.sbin/bhyve/pci_nvme.c ============================================================================== --- stable/12/usr.sbin/bhyve/pci_nvme.c Sun Jul 19 22:27:15 2020 (r363332) +++ stable/12/usr.sbin/bhyve/pci_nvme.c Sun Jul 19 22:37:47 2020 (r363333) @@ -3,6 +3,7 @@ * * Copyright (c) 2017 Shunsuke Mie * Copyright (c) 2018 Leon Dang + * Copyright (c) 2020 Chuck Tuffli * * Function crc16 Copyright (c) 2017, Fedor Uporov * Obtained from function ext2_crc16() in sys/fs/ext2fs/ext2_csum.c @@ -1385,6 +1386,122 @@ pci_nvme_io_partial(struct blockif_req *br, int err) pthread_cond_signal(&req->cv); } +static bool +nvme_opc_write_read(struct pci_nvme_softc *sc, + struct nvme_command *cmd, + struct pci_nvme_blockstore *nvstore, + struct pci_nvme_ioreq *req, + uint16_t *status) +{ + uint64_t lba, nblocks, bytes; + size_t offset; + bool is_write = cmd->opc == NVME_OPC_WRITE; + bool pending = false; + + lba = ((uint64_t)cmd->cdw11 << 32) | cmd->cdw10; + nblocks = (cmd->cdw12 & 0xFFFF) + 1; + + offset = lba * nvstore->sectsz; + bytes = nblocks * nvstore->sectsz; + + if ((offset + bytes) > nvstore->size) { + WPRINTF("%s command would exceed LBA range", __func__); + pci_nvme_status_genc(status, NVME_SC_LBA_OUT_OF_RANGE); + goto out; + } + + req->io_req.br_offset = lba; + + /* PRP bits 1:0 must be zero */ + cmd->prp1 &= ~0x3UL; + cmd->prp2 &= ~0x3UL; + + if (nvstore->type == NVME_STOR_RAM) { + uint8_t *buf = nvstore->ctx; + enum nvme_copy_dir dir; + + if (is_write) + dir = NVME_COPY_TO_PRP; + else + dir = NVME_COPY_FROM_PRP; + + if (nvme_prp_memcpy(sc->nsc_pi->pi_vmctx, cmd->prp1, cmd->prp2, + buf + offset, bytes, dir)) + pci_nvme_status_genc(status, + NVME_SC_DATA_TRANSFER_ERROR); + else + pci_nvme_status_genc(status, NVME_SC_SUCCESS); + } else { + uint64_t size; + int err; + + size = MIN(PAGE_SIZE - (cmd->prp1 % PAGE_SIZE), bytes); + if (pci_nvme_append_iov_req(sc, req, cmd->prp1, + size, is_write, offset)) { + pci_nvme_status_genc(status, + NVME_SC_DATA_TRANSFER_ERROR); + goto out; + } + + offset += size; + bytes -= size; + + if (bytes == 0) { + ; + } else if (bytes <= PAGE_SIZE) { + size = bytes; + if (pci_nvme_append_iov_req(sc, req, cmd->prp2, + size, is_write, offset)) { + pci_nvme_status_genc(status, + NVME_SC_DATA_TRANSFER_ERROR); + goto out; + } + } else { + void *vmctx = sc->nsc_pi->pi_vmctx; + uint64_t *prp_list = &cmd->prp2; + uint64_t *last = prp_list; + + /* PRP2 is pointer to a physical region page list */ + while (bytes) { + /* Last entry in list points to the next list */ + if (prp_list == last) { + uint64_t prp = *prp_list; + + prp_list = paddr_guest2host(vmctx, prp, + PAGE_SIZE - (prp % PAGE_SIZE)); + last = prp_list + (NVME_PRP2_ITEMS - 1); + } + + size = MIN(bytes, PAGE_SIZE); + + if (pci_nvme_append_iov_req(sc, req, *prp_list, + size, is_write, offset)) { + pci_nvme_status_genc(status, + NVME_SC_DATA_TRANSFER_ERROR); + goto out; + } + + offset += size; + bytes -= size; + + prp_list++; + } + } + req->io_req.br_callback = pci_nvme_io_done; + if (is_write) + err = blockif_write(nvstore->ctx, &req->io_req); + else + err = blockif_read(nvstore->ctx, &req->io_req); + + if (err) + pci_nvme_status_genc(status, NVME_SC_DATA_TRANSFER_ERROR); + else + pending = true; + } +out: + return (pending); +} + static void pci_nvme_dealloc_sm(struct blockif_req *br, int err) { @@ -1420,14 +1537,15 @@ pci_nvme_dealloc_sm(struct blockif_req *br, int err) } } -static int +static bool nvme_opc_dataset_mgmt(struct pci_nvme_softc *sc, struct nvme_command *cmd, struct pci_nvme_blockstore *nvstore, struct pci_nvme_ioreq *req, uint16_t *status) { - int err = -1; + int err; + bool pending = false; if ((sc->ctrldata.oncs & NVME_ONCS_DSM) == 0) { pci_nvme_status_genc(status, NVME_SC_INVALID_OPCODE); @@ -1462,9 +1580,6 @@ nvme_opc_dataset_mgmt(struct pci_nvme_softc *sc, nvme_prp_memcpy(sc->nsc_pi->pi_vmctx, cmd->prp1, cmd->prp2, (uint8_t *)range, NVME_MAX_DSM_TRIM, NVME_COPY_FROM_PRP); - req->opc = cmd->opc; - req->cid = cmd->cid; - req->nsid = cmd->nsid; /* * If the request is for more than a single range, store * the ranges in the br_iov. Optimize for the common case @@ -1500,11 +1615,13 @@ nvme_opc_dataset_mgmt(struct pci_nvme_softc *sc, err = blockif_delete(nvstore->ctx, &req->io_req); if (err) pci_nvme_status_genc(status, NVME_SC_INTERNAL_DEVICE_ERROR); + else + pending = true; free(range); } out: - return (err); + return (pending); } static void @@ -1513,7 +1630,6 @@ pci_nvme_handle_io_cmd(struct pci_nvme_softc* sc, uint struct nvme_submission_queue *sq; uint16_t status; uint16_t sqhead; - int err; /* handle all submissions up to sq->tail index */ sq = &sc->submit_queues[idx]; @@ -1530,189 +1646,69 @@ pci_nvme_handle_io_cmd(struct pci_nvme_softc* sc, uint while (sqhead != atomic_load_acq_short(&sq->tail)) { struct nvme_command *cmd; - struct pci_nvme_ioreq *req = NULL; - uint64_t lba; - uint64_t nblocks, bytes, size, cpsz; + struct pci_nvme_ioreq *req; + uint32_t nsid; + bool pending; - /* TODO: support scatter gather list handling */ + pending = false; + req = NULL; + status = 0; cmd = &sq->qbase[sqhead]; sqhead = (sqhead + 1) % sq->size; - lba = ((uint64_t)cmd->cdw11 << 32) | cmd->cdw10; + nsid = le32toh(cmd->nsid); + if ((nsid == 0) || (nsid > sc->ctrldata.nn)) { + pci_nvme_status_genc(&status, + NVME_SC_INVALID_NAMESPACE_OR_FORMAT); + status |= + NVME_STATUS_DNR_MASK << NVME_STATUS_DNR_SHIFT; + goto complete; + } - if (cmd->opc == NVME_OPC_FLUSH) { - pci_nvme_status_genc(&status, NVME_SC_SUCCESS); - pci_nvme_set_completion(sc, sq, idx, cmd->cid, 0, - status, 1); - - continue; - } else if (cmd->opc == 0x08) { - /* TODO: write zeroes */ - WPRINTF("%s write zeroes lba 0x%lx blocks %u", - __func__, lba, cmd->cdw12 & 0xFFFF); - pci_nvme_status_genc(&status, NVME_SC_SUCCESS); - pci_nvme_set_completion(sc, sq, idx, cmd->cid, 0, - status, 1); - - continue; + req = pci_nvme_get_ioreq(sc); + if (req == NULL) { + pci_nvme_status_genc(&status, + NVME_SC_INTERNAL_DEVICE_ERROR); + WPRINTF("%s: unable to allocate IO req", __func__); + goto complete; } + req->nvme_sq = sq; + req->sqid = idx; + req->opc = cmd->opc; + req->cid = cmd->cid; + req->nsid = cmd->nsid; - if (sc->nvstore.type == NVME_STOR_BLOCKIF) { - req = pci_nvme_get_ioreq(sc); - req->nvme_sq = sq; - req->sqid = idx; - } - - if (cmd->opc == NVME_OPC_DATASET_MANAGEMENT) { - if (nvme_opc_dataset_mgmt(sc, cmd, &sc->nvstore, req, - &status)) { - pci_nvme_set_completion(sc, sq, idx, cmd->cid, - 0, status, 1); - if (req) - pci_nvme_release_ioreq(sc, req); - } - continue; - } - - nblocks = (cmd->cdw12 & 0xFFFF) + 1; - - bytes = nblocks * sc->nvstore.sectsz; - - /* - * If data starts mid-page and flows into the next page, then - * increase page count - */ - - DPRINTF("[h%u:t%u:n%u] %s starting LBA 0x%lx blocks %lu " - "(%lu-bytes)", - sqhead==0 ? sq->size-1 : sqhead-1, sq->tail, sq->size, - cmd->opc == NVME_OPC_WRITE ? - "WRITE" : "READ", - lba, nblocks, bytes); - - cmd->prp1 &= ~(0x03UL); - cmd->prp2 &= ~(0x03UL); - - DPRINTF(" prp1 0x%lx prp2 0x%lx", cmd->prp1, cmd->prp2); - - size = bytes; - lba *= sc->nvstore.sectsz; - - cpsz = PAGE_SIZE - (cmd->prp1 % PAGE_SIZE); - - if (cpsz > bytes) - cpsz = bytes; - - if (req != NULL) { - req->io_req.br_offset = ((uint64_t)cmd->cdw11 << 32) | - cmd->cdw10; - req->opc = cmd->opc; - req->cid = cmd->cid; - req->nsid = cmd->nsid; - } - - err = pci_nvme_append_iov_req(sc, req, cmd->prp1, cpsz, - cmd->opc == NVME_OPC_WRITE, lba); - lba += cpsz; - size -= cpsz; - - if (size == 0) - goto iodone; - - if (size <= PAGE_SIZE) { - /* prp2 is second (and final) page in transfer */ - - err = pci_nvme_append_iov_req(sc, req, cmd->prp2, - size, - cmd->opc == NVME_OPC_WRITE, - lba); - } else { - uint64_t *prp_list; - int i; - - /* prp2 is pointer to a physical region page list */ - prp_list = paddr_guest2host(sc->nsc_pi->pi_vmctx, - cmd->prp2, PAGE_SIZE); - - i = 0; - while (size != 0) { - cpsz = MIN(size, PAGE_SIZE); - - /* - * Move to linked physical region page list - * in last item. - */ - if (i == (NVME_PRP2_ITEMS-1) && - size > PAGE_SIZE) { - assert((prp_list[i] & (PAGE_SIZE-1)) == 0); - prp_list = paddr_guest2host( - sc->nsc_pi->pi_vmctx, - prp_list[i], PAGE_SIZE); - i = 0; - } - if (prp_list[i] == 0) { - WPRINTF("PRP2[%d] = 0 !!!", i); - err = 1; - break; - } - - err = pci_nvme_append_iov_req(sc, req, - prp_list[i], cpsz, - cmd->opc == NVME_OPC_WRITE, lba); - if (err) - break; - - lba += cpsz; - size -= cpsz; - i++; - } - } - -iodone: - if (sc->nvstore.type == NVME_STOR_RAM) { - uint16_t code, status; - - code = err ? NVME_SC_LBA_OUT_OF_RANGE : - NVME_SC_SUCCESS; - pci_nvme_status_genc(&status, code); - - pci_nvme_set_completion(sc, sq, idx, cmd->cid, 0, - status, 1); - - continue; - } - - - if (err) - goto do_error; - - req->io_req.br_callback = pci_nvme_io_done; - - err = 0; switch (cmd->opc) { + case NVME_OPC_FLUSH: + pci_nvme_status_genc(&status, NVME_SC_SUCCESS); + break; + case NVME_OPC_WRITE: case NVME_OPC_READ: - err = blockif_read(sc->nvstore.ctx, &req->io_req); + pending = nvme_opc_write_read(sc, cmd, &sc->nvstore, + req, &status); break; - case NVME_OPC_WRITE: - err = blockif_write(sc->nvstore.ctx, &req->io_req); + case NVME_OPC_WRITE_ZEROES: + /* TODO: write zeroes + WPRINTF("%s write zeroes lba 0x%lx blocks %u", + __func__, lba, cmd->cdw12 & 0xFFFF); */ + pci_nvme_status_genc(&status, NVME_SC_SUCCESS); break; - default: - WPRINTF("%s unhandled io command 0x%x", - __func__, cmd->opc); - err = 1; + case NVME_OPC_DATASET_MANAGEMENT: + pending = nvme_opc_dataset_mgmt(sc, cmd, &sc->nvstore, + req, &status); + break; + default: + WPRINTF("%s unhandled io command 0x%x", + __func__, cmd->opc); + pci_nvme_status_genc(&status, NVME_SC_INVALID_OPCODE); } - -do_error: - if (err) { - uint16_t status; - - pci_nvme_status_genc(&status, - NVME_SC_DATA_TRANSFER_ERROR); - +complete: + if (!pending) { pci_nvme_set_completion(sc, sq, idx, cmd->cid, 0, - status, 1); - pci_nvme_release_ioreq(sc, req); + status, 1); + if (req != NULL) + pci_nvme_release_ioreq(sc, req); } } From owner-svn-src-all@freebsd.org Sun Jul 19 22:40:03 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 18CC236BD0D; Sun, 19 Jul 2020 22:40:03 +0000 (UTC) (envelope-from chuck@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4B90DL6y5Kz47Ng; Sun, 19 Jul 2020 22:40:02 +0000 (UTC) (envelope-from chuck@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D1B8F22E34; Sun, 19 Jul 2020 22:40:02 +0000 (UTC) (envelope-from chuck@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06JMe2Yg027685; Sun, 19 Jul 2020 22:40:02 GMT (envelope-from chuck@FreeBSD.org) Received: (from chuck@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06JMe2x9027684; Sun, 19 Jul 2020 22:40:02 GMT (envelope-from chuck@FreeBSD.org) Message-Id: <202007192240.06JMe2x9027684@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: chuck set sender to chuck@FreeBSD.org using -f From: Chuck Tuffli Date: Sun, 19 Jul 2020 22:40:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r363334 - stable/12/usr.sbin/bhyve X-SVN-Group: stable-12 X-SVN-Commit-Author: chuck X-SVN-Commit-Paths: stable/12/usr.sbin/bhyve X-SVN-Commit-Revision: 363334 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 19 Jul 2020 22:40:03 -0000 Author: chuck Date: Sun Jul 19 22:40:02 2020 New Revision: 363334 URL: https://svnweb.freebsd.org/changeset/base/363334 Log: MFC r362746 bhyve: implement NVMe Flush command Modified: stable/12/usr.sbin/bhyve/pci_nvme.c Directory Properties: stable/12/ (props changed) Modified: stable/12/usr.sbin/bhyve/pci_nvme.c ============================================================================== --- stable/12/usr.sbin/bhyve/pci_nvme.c Sun Jul 19 22:37:47 2020 (r363333) +++ stable/12/usr.sbin/bhyve/pci_nvme.c Sun Jul 19 22:40:02 2020 (r363334) @@ -58,6 +58,7 @@ #include __FBSDID("$FreeBSD$"); +#include #include #include @@ -1386,7 +1387,47 @@ pci_nvme_io_partial(struct blockif_req *br, int err) pthread_cond_signal(&req->cv); } +/* + * Implements the Flush command. The specification states: + * If a volatile write cache is not present, Flush commands complete + * successfully and have no effect + * in the description of the Volatile Write Cache (VWC) field of the Identify + * Controller data. Therefore, set status to Success if the command is + * not supported (i.e. RAM or as indicated by the blockif). + */ static bool +nvme_opc_flush(struct pci_nvme_softc *sc, + struct nvme_command *cmd, + struct pci_nvme_blockstore *nvstore, + struct pci_nvme_ioreq *req, + uint16_t *status) +{ + bool pending = false; + + if (nvstore->type == NVME_STOR_RAM) { + pci_nvme_status_genc(status, NVME_SC_SUCCESS); + } else { + int err; + + req->io_req.br_callback = pci_nvme_io_done; + + err = blockif_flush(nvstore->ctx, &req->io_req); + switch (err) { + case 0: + pending = true; + break; + case EOPNOTSUPP: + pci_nvme_status_genc(status, NVME_SC_SUCCESS); + break; + default: + pci_nvme_status_genc(status, NVME_SC_INTERNAL_DEVICE_ERROR); + } + } + + return (pending); +} + +static bool nvme_opc_write_read(struct pci_nvme_softc *sc, struct nvme_command *cmd, struct pci_nvme_blockstore *nvstore, @@ -1681,7 +1722,8 @@ pci_nvme_handle_io_cmd(struct pci_nvme_softc* sc, uint switch (cmd->opc) { case NVME_OPC_FLUSH: - pci_nvme_status_genc(&status, NVME_SC_SUCCESS); + pending = nvme_opc_flush(sc, cmd, &sc->nvstore, + req, &status); break; case NVME_OPC_WRITE: case NVME_OPC_READ: From owner-svn-src-all@freebsd.org Sun Jul 19 22:52:42 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id EFD1736BDBF; Sun, 19 Jul 2020 22:52:42 +0000 (UTC) (envelope-from chuck@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4B90Vy62tHz48Br; Sun, 19 Jul 2020 22:52:42 +0000 (UTC) (envelope-from chuck@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B38C222E68; Sun, 19 Jul 2020 22:52:42 +0000 (UTC) (envelope-from chuck@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06JMqgET039652; Sun, 19 Jul 2020 22:52:42 GMT (envelope-from chuck@FreeBSD.org) Received: (from chuck@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06JMqgro039651; Sun, 19 Jul 2020 22:52:42 GMT (envelope-from chuck@FreeBSD.org) Message-Id: <202007192252.06JMqgro039651@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: chuck set sender to chuck@FreeBSD.org using -f From: Chuck Tuffli Date: Sun, 19 Jul 2020 22:52:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r363335 - stable/12/usr.sbin/bhyve X-SVN-Group: stable-12 X-SVN-Commit-Author: chuck X-SVN-Commit-Paths: stable/12/usr.sbin/bhyve X-SVN-Commit-Revision: 363335 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 19 Jul 2020 22:52:43 -0000 Author: chuck Date: Sun Jul 19 22:52:42 2020 New Revision: 363335 URL: https://svnweb.freebsd.org/changeset/base/363335 Log: MFC r362747 bhyve: add a comment explaining NVME dsm option Modified: stable/12/usr.sbin/bhyve/pci_nvme.c Directory Properties: stable/12/ (props changed) Modified: stable/12/usr.sbin/bhyve/pci_nvme.c ============================================================================== --- stable/12/usr.sbin/bhyve/pci_nvme.c Sun Jul 19 22:40:02 2020 (r363334) +++ stable/12/usr.sbin/bhyve/pci_nvme.c Sun Jul 19 22:52:42 2020 (r363335) @@ -34,7 +34,7 @@ * bhyve PCIe-NVMe device emulation. * * options: - * -s ,nvme,devpath,maxq=#,qsz=#,ioslots=#,sectsz=#,ser=A-Z,eui64=# + * -s ,nvme,devpath,maxq=#,qsz=#,ioslots=#,sectsz=#,ser=A-Z,eui64=#,dsm= * * accepted devpath: * /dev/blockdev @@ -47,6 +47,7 @@ * sectsz = sector size (defaults to blockif sector size) * ser = serial number (20-chars max) * eui64 = IEEE Extended Unique Identifier (8 byte value) + * dsm = DataSet Management support. Option is one of auto, enable,disable * */ From owner-svn-src-all@freebsd.org Sun Jul 19 22:55:53 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4AE8636BF65; Sun, 19 Jul 2020 22:55:53 +0000 (UTC) (envelope-from chuck@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4B90Zd1Hzrz48Cd; Sun, 19 Jul 2020 22:55:53 +0000 (UTC) (envelope-from chuck@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0AFE523451; Sun, 19 Jul 2020 22:55:53 +0000 (UTC) (envelope-from chuck@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06JMtqqB039881; Sun, 19 Jul 2020 22:55:52 GMT (envelope-from chuck@FreeBSD.org) Received: (from chuck@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06JMtqNE039880; Sun, 19 Jul 2020 22:55:52 GMT (envelope-from chuck@FreeBSD.org) Message-Id: <202007192255.06JMtqNE039880@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: chuck set sender to chuck@FreeBSD.org using -f From: Chuck Tuffli Date: Sun, 19 Jul 2020 22:55:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r363336 - stable/12/usr.sbin/bhyve X-SVN-Group: stable-12 X-SVN-Commit-Author: chuck X-SVN-Commit-Paths: stable/12/usr.sbin/bhyve X-SVN-Commit-Revision: 363336 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 19 Jul 2020 22:55:53 -0000 Author: chuck Date: Sun Jul 19 22:55:52 2020 New Revision: 363336 URL: https://svnweb.freebsd.org/changeset/base/363336 Log: MFC r362748 bhyve: add locks around NVMe queue accesses Modified: stable/12/usr.sbin/bhyve/pci_nvme.c Directory Properties: stable/12/ (props changed) Modified: stable/12/usr.sbin/bhyve/pci_nvme.c ============================================================================== --- stable/12/usr.sbin/bhyve/pci_nvme.c Sun Jul 19 22:52:42 2020 (r363335) +++ stable/12/usr.sbin/bhyve/pci_nvme.c Sun Jul 19 22:55:52 2020 (r363336) @@ -153,21 +153,21 @@ enum nvme_copy_dir { struct nvme_completion_queue { struct nvme_completion *qbase; + pthread_mutex_t mtx; uint32_t size; uint16_t tail; /* nvme progress */ uint16_t head; /* guest progress */ uint16_t intr_vec; uint32_t intr_en; - pthread_mutex_t mtx; }; struct nvme_submission_queue { struct nvme_command *qbase; + pthread_mutex_t mtx; uint32_t size; uint16_t head; /* nvme progress */ uint16_t tail; /* guest progress */ uint16_t cqid; /* completion queue id */ - int busy; /* queue is being processed */ int qpriority; }; @@ -339,7 +339,63 @@ pci_nvme_toggle_phase(uint16_t *status, int prev) *status |= NVME_STATUS_P; } +/* + * Initialize the requested number or IO Submission and Completion Queues. + * Admin queues are allocated implicitly. + */ static void +pci_nvme_init_queues(struct pci_nvme_softc *sc, uint32_t nsq, uint32_t ncq) +{ + uint32_t i; + + /* + * Allocate and initialize the Submission Queues + */ + if (nsq > NVME_QUEUES) { + WPRINTF("%s: clamping number of SQ from %u to %u", + __func__, nsq, NVME_QUEUES); + nsq = NVME_QUEUES; + } + + sc->num_squeues = nsq; + + sc->submit_queues = calloc(sc->num_squeues + 1, + sizeof(struct nvme_submission_queue)); + if (sc->submit_queues == NULL) { + WPRINTF("%s: SQ allocation failed", __func__); + sc->num_squeues = 0; + } else { + struct nvme_submission_queue *sq = sc->submit_queues; + + for (i = 0; i < sc->num_squeues; i++) + pthread_mutex_init(&sq[i].mtx, NULL); + } + + /* + * Allocate and initialize the Completion Queues + */ + if (ncq > NVME_QUEUES) { + WPRINTF("%s: clamping number of CQ from %u to %u", + __func__, ncq, NVME_QUEUES); + ncq = NVME_QUEUES; + } + + sc->num_cqueues = ncq; + + sc->compl_queues = calloc(sc->num_cqueues + 1, + sizeof(struct nvme_completion_queue)); + if (sc->compl_queues == NULL) { + WPRINTF("%s: CQ allocation failed", __func__); + sc->num_cqueues = 0; + } else { + struct nvme_completion_queue *cq = sc->compl_queues; + + for (i = 0; i < sc->num_cqueues; i++) + pthread_mutex_init(&cq[i].mtx, NULL); + } +} + +static void pci_nvme_init_ctrldata(struct pci_nvme_softc *sc) { struct nvme_controller_data *cd = &sc->ctrldata; @@ -498,6 +554,8 @@ pci_nvme_init_logpages(struct pci_nvme_softc *sc) static void pci_nvme_reset_locked(struct pci_nvme_softc *sc) { + uint32_t i; + DPRINTF("%s", __func__); sc->regs.cap_lo = (ZERO_BASED(sc->max_qentries) & NVME_CAP_LO_REG_MQES_MASK) | @@ -511,44 +569,23 @@ pci_nvme_reset_locked(struct pci_nvme_softc *sc) sc->regs.cc = 0; sc->regs.csts = 0; - sc->num_cqueues = sc->num_squeues = sc->max_queues; - if (sc->submit_queues != NULL) { - for (int i = 0; i < sc->num_squeues + 1; i++) { - /* - * The Admin Submission Queue is at index 0. - * It must not be changed at reset otherwise the - * emulation will be out of sync with the guest. - */ - if (i != 0) { - sc->submit_queues[i].qbase = NULL; - sc->submit_queues[i].size = 0; - sc->submit_queues[i].cqid = 0; - } - sc->submit_queues[i].tail = 0; - sc->submit_queues[i].head = 0; - sc->submit_queues[i].busy = 0; - } - } else - sc->submit_queues = calloc(sc->num_squeues + 1, - sizeof(struct nvme_submission_queue)); + assert(sc->submit_queues != NULL); - if (sc->compl_queues != NULL) { - for (int i = 0; i < sc->num_cqueues + 1; i++) { - /* See Admin Submission Queue note above */ - if (i != 0) { - sc->compl_queues[i].qbase = NULL; - sc->compl_queues[i].size = 0; - } + for (i = 0; i < sc->num_squeues + 1; i++) { + sc->submit_queues[i].qbase = NULL; + sc->submit_queues[i].size = 0; + sc->submit_queues[i].cqid = 0; + sc->submit_queues[i].tail = 0; + sc->submit_queues[i].head = 0; + } - sc->compl_queues[i].tail = 0; - sc->compl_queues[i].head = 0; - } - } else { - sc->compl_queues = calloc(sc->num_cqueues + 1, - sizeof(struct nvme_completion_queue)); + assert(sc->compl_queues != NULL); - for (int i = 0; i < sc->num_cqueues + 1; i++) - pthread_mutex_init(&sc->compl_queues[i].mtx, NULL); + for (i = 0; i < sc->num_cqueues + 1; i++) { + sc->compl_queues[i].qbase = NULL; + sc->compl_queues[i].size = 0; + sc->compl_queues[i].tail = 0; + sc->compl_queues[i].head = 0; } } @@ -1092,14 +1129,9 @@ pci_nvme_handle_admin_cmd(struct pci_nvme_softc* sc, u sq = &sc->submit_queues[0]; cq = &sc->compl_queues[0]; - sqhead = atomic_load_acq_short(&sq->head); + pthread_mutex_lock(&sq->mtx); - if (atomic_testandset_int(&sq->busy, 1)) { - DPRINTF("%s SQ busy, head %u, tail %u", - __func__, sqhead, sq->tail); - return; - } - + sqhead = sq->head; DPRINTF("sqhead %u, tail %u", sqhead, sq->tail); while (sqhead != atomic_load_acq_short(&sq->tail)) { @@ -1161,6 +1193,8 @@ pci_nvme_handle_admin_cmd(struct pci_nvme_softc* sc, u struct nvme_completion *cp; int phase; + pthread_mutex_lock(&cq->mtx); + cp = &(cq->qbase)[cq->tail]; cp->cdw0 = compl.cdw0; cp->sqid = 0; @@ -1172,16 +1206,18 @@ pci_nvme_handle_admin_cmd(struct pci_nvme_softc* sc, u pci_nvme_toggle_phase(&cp->status, phase); cq->tail = (cq->tail + 1) % cq->size; + + pthread_mutex_unlock(&cq->mtx); } } DPRINTF("setting sqhead %u", sqhead); - atomic_store_short(&sq->head, sqhead); - atomic_store_int(&sq->busy, 0); + sq->head = sqhead; if (cq->head != cq->tail) pci_generate_msix(sc->nsc_pi, 0); + pthread_mutex_unlock(&sq->mtx); } static int @@ -1271,7 +1307,7 @@ pci_nvme_append_iov_req(struct pci_nvme_softc *sc, str static void pci_nvme_set_completion(struct pci_nvme_softc *sc, struct nvme_submission_queue *sq, int sqid, uint16_t cid, - uint32_t cdw0, uint16_t status, int ignore_busy) + uint32_t cdw0, uint16_t status) { struct nvme_completion_queue *cq = &sc->compl_queues[sq->cqid]; struct nvme_completion *compl; @@ -1289,7 +1325,7 @@ pci_nvme_set_completion(struct pci_nvme_softc *sc, compl->cdw0 = cdw0; compl->sqid = sqid; - compl->sqhd = atomic_load_acq_short(&sq->head); + compl->sqhd = sq->head; compl->cid = cid; // toggle phase @@ -1374,7 +1410,7 @@ pci_nvme_io_done(struct blockif_req *br, int err) code = err ? NVME_SC_DATA_TRANSFER_ERROR : NVME_SC_SUCCESS; pci_nvme_status_genc(&status, code); - pci_nvme_set_completion(req->sc, sq, req->sqid, req->cid, 0, status, 0); + pci_nvme_set_completion(req->sc, sq, req->sqid, req->cid, 0, status); pci_nvme_release_ioreq(req->sc, req); } @@ -1574,7 +1610,7 @@ pci_nvme_dealloc_sm(struct blockif_req *br, int err) if (done) { pci_nvme_set_completion(sc, req->nvme_sq, req->sqid, - req->cid, 0, status, 0); + req->cid, 0, status); pci_nvme_release_ioreq(sc, req); } } @@ -1676,13 +1712,9 @@ pci_nvme_handle_io_cmd(struct pci_nvme_softc* sc, uint /* handle all submissions up to sq->tail index */ sq = &sc->submit_queues[idx]; - if (atomic_testandset_int(&sq->busy, 1)) { - DPRINTF("%s sqid %u busy", __func__, idx); - return; - } + pthread_mutex_lock(&sq->mtx); - sqhead = atomic_load_acq_short(&sq->head); - + sqhead = sq->head; DPRINTF("nvme_handle_io qid %u head %u tail %u cmdlist %p", idx, sqhead, sq->tail, sq->qbase); @@ -1749,14 +1781,15 @@ pci_nvme_handle_io_cmd(struct pci_nvme_softc* sc, uint complete: if (!pending) { pci_nvme_set_completion(sc, sq, idx, cmd->cid, 0, - status, 1); + status); if (req != NULL) pci_nvme_release_ioreq(sc, req); } } - atomic_store_short(&sq->head, sqhead); - atomic_store_int(&sq->busy, 0); + sq->head = sqhead; + + pthread_mutex_unlock(&sq->mtx); } static void @@ -1767,6 +1800,13 @@ pci_nvme_handle_doorbell(struct vmctx *ctx, struct pci idx, is_sq ? "SQ" : "CQ", value & 0xFFFF); if (is_sq) { + if (idx > sc->num_squeues) { + WPRINTF("%s queue index %lu overflow from " + "guest (max %u)", + __func__, idx, sc->num_squeues); + return; + } + atomic_store_short(&sc->submit_queues[idx].tail, (uint16_t)value); @@ -1790,7 +1830,8 @@ pci_nvme_handle_doorbell(struct vmctx *ctx, struct pci return; } - sc->compl_queues[idx].head = (uint16_t)value; + atomic_store_short(&sc->compl_queues[idx].head, + (uint16_t)value); } } @@ -2235,7 +2276,7 @@ pci_nvme_init(struct vmctx *ctx, struct pci_devinst *p pthread_mutex_init(&sc->mtx, NULL); sem_init(&sc->iosemlock, 0, sc->ioslots); - pci_nvme_reset(sc); + pci_nvme_init_queues(sc, sc->max_queues, sc->max_queues); /* * Controller data depends on Namespace data so initialize Namespace * data first. @@ -2243,6 +2284,8 @@ pci_nvme_init(struct vmctx *ctx, struct pci_devinst *p pci_nvme_init_nsdata(sc, &sc->nsdata, 1, &sc->nvstore); pci_nvme_init_ctrldata(sc); pci_nvme_init_logpages(sc); + + pci_nvme_reset(sc); pci_lintr_request(pi); From owner-svn-src-all@freebsd.org Sun Jul 19 22:58:11 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D81F736C0AB; Sun, 19 Jul 2020 22:58:11 +0000 (UTC) (envelope-from chuck@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4B90dH5KQjz48VG; Sun, 19 Jul 2020 22:58:11 +0000 (UTC) (envelope-from chuck@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9632023452; Sun, 19 Jul 2020 22:58:11 +0000 (UTC) (envelope-from chuck@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06JMwBTr040034; Sun, 19 Jul 2020 22:58:11 GMT (envelope-from chuck@FreeBSD.org) Received: (from chuck@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06JMwB0h040033; Sun, 19 Jul 2020 22:58:11 GMT (envelope-from chuck@FreeBSD.org) Message-Id: <202007192258.06JMwB0h040033@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: chuck set sender to chuck@FreeBSD.org using -f From: Chuck Tuffli Date: Sun, 19 Jul 2020 22:58:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r363337 - stable/12/usr.sbin/bhyve X-SVN-Group: stable-12 X-SVN-Commit-Author: chuck X-SVN-Commit-Paths: stable/12/usr.sbin/bhyve X-SVN-Commit-Revision: 363337 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 19 Jul 2020 22:58:11 -0000 Author: chuck Date: Sun Jul 19 22:58:11 2020 New Revision: 363337 URL: https://svnweb.freebsd.org/changeset/base/363337 Log: MFC r362749 bhyve: Consolidate NVMe CQ update Modified: stable/12/usr.sbin/bhyve/pci_nvme.c Directory Properties: stable/12/ (props changed) Modified: stable/12/usr.sbin/bhyve/pci_nvme.c ============================================================================== --- stable/12/usr.sbin/bhyve/pci_nvme.c Sun Jul 19 22:55:52 2020 (r363336) +++ stable/12/usr.sbin/bhyve/pci_nvme.c Sun Jul 19 22:58:11 2020 (r363337) @@ -329,16 +329,6 @@ pci_nvme_status_genc(uint16_t *status, uint16_t code) pci_nvme_status_tc(status, NVME_SCT_GENERIC, code); } -static __inline void -pci_nvme_toggle_phase(uint16_t *status, int prev) -{ - - if (prev) - *status &= ~NVME_STATUS_P; - else - *status |= NVME_STATUS_P; -} - /* * Initialize the requested number or IO Submission and Completion Queues. * Admin queues are allocated implicitly. @@ -617,6 +607,7 @@ pci_nvme_init_controller(struct vmctx *ctx, struct pci sc->compl_queues[0].size = acqs; sc->compl_queues[0].qbase = vm_map_gpa(ctx, sc->regs.acq, sizeof(struct nvme_completion) * acqs); + DPRINTF("%s mapping Admin-CQ guest 0x%lx, host: %p", __func__, sc->regs.acq, sc->compl_queues[0].qbase); } @@ -668,6 +659,45 @@ nvme_prp_memcpy(struct vmctx *ctx, uint64_t prp1, uint return (0); } +/* + * Write a Completion Queue Entry update + * + * Write the completion and update the doorbell value + */ +static void +pci_nvme_cq_update(struct pci_nvme_softc *sc, + struct nvme_completion_queue *cq, + uint32_t cdw0, + uint16_t cid, + uint16_t sqid, + uint16_t status) +{ + struct nvme_submission_queue *sq = &sc->submit_queues[sqid]; + struct nvme_completion *cqe; + + assert(cq->qbase != NULL); + + pthread_mutex_lock(&cq->mtx); + + cqe = &cq->qbase[cq->tail]; + + /* Flip the phase bit */ + status |= (cqe->status ^ NVME_STATUS_P) & NVME_STATUS_P_MASK; + + cqe->cdw0 = cdw0; + cqe->sqhd = sq->head; + cqe->sqid = sqid; + cqe->cid = cid; + cqe->status = status; + + cq->tail++; + if (cq->tail >= cq->size) { + cq->tail = 0; + } + + pthread_mutex_unlock(&cq->mtx); +} + static int nvme_opc_delete_io_sq(struct pci_nvme_softc* sc, struct nvme_command* command, struct nvme_completion* compl) @@ -757,6 +787,7 @@ static int nvme_opc_create_io_cq(struct pci_nvme_softc* sc, struct nvme_command* command, struct nvme_completion* compl) { + if (command->cdw11 & NVME_CMD_CDW11_PC) { uint16_t qid = command->cdw10 & 0xffff; struct nvme_completion_queue *ncq; @@ -1190,24 +1221,11 @@ pci_nvme_handle_admin_cmd(struct pci_nvme_softc* sc, u sqhead = (sqhead + 1) % sq->size; if (NVME_COMPLETION_VALID(compl)) { - struct nvme_completion *cp; - int phase; - - pthread_mutex_lock(&cq->mtx); - - cp = &(cq->qbase)[cq->tail]; - cp->cdw0 = compl.cdw0; - cp->sqid = 0; - cp->sqhd = sqhead; - cp->cid = cmd->cid; - - phase = NVME_STATUS_GET_P(cp->status); - cp->status = compl.status; - pci_nvme_toggle_phase(&cp->status, phase); - - cq->tail = (cq->tail + 1) % cq->size; - - pthread_mutex_unlock(&cq->mtx); + pci_nvme_cq_update(sc, &sc->compl_queues[0], + compl.cdw0, + cmd->cid, + 0, /* SQID */ + compl.status); } } @@ -1310,32 +1328,16 @@ pci_nvme_set_completion(struct pci_nvme_softc *sc, uint32_t cdw0, uint16_t status) { struct nvme_completion_queue *cq = &sc->compl_queues[sq->cqid]; - struct nvme_completion *compl; - int phase; DPRINTF("%s sqid %d cqid %u cid %u status: 0x%x 0x%x", __func__, sqid, sq->cqid, cid, NVME_STATUS_GET_SCT(status), NVME_STATUS_GET_SC(status)); - pthread_mutex_lock(&cq->mtx); - - assert(cq->qbase != NULL); - - compl = &cq->qbase[cq->tail]; - - compl->cdw0 = cdw0; - compl->sqid = sqid; - compl->sqhd = sq->head; - compl->cid = cid; - - // toggle phase - phase = NVME_STATUS_GET_P(compl->status); - compl->status = status; - pci_nvme_toggle_phase(&compl->status, phase); - - cq->tail = (cq->tail + 1) % cq->size; - - pthread_mutex_unlock(&cq->mtx); + pci_nvme_cq_update(sc, cq, + 0, /* CDW0 */ + cid, + sqid, + status); if (cq->head != cq->tail) { if (cq->intr_en & NVME_CQ_INTEN) { From owner-svn-src-all@freebsd.org Sun Jul 19 23:17:44 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 243BB36C5A7; Sun, 19 Jul 2020 23:17:44 +0000 (UTC) (envelope-from chuck@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4B913q75Gcz49XY; Sun, 19 Jul 2020 23:17:43 +0000 (UTC) (envelope-from chuck@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D1B0C2361A; Sun, 19 Jul 2020 23:17:43 +0000 (UTC) (envelope-from chuck@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06JNHhOE052490; Sun, 19 Jul 2020 23:17:43 GMT (envelope-from chuck@FreeBSD.org) Received: (from chuck@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06JNHhMZ052489; Sun, 19 Jul 2020 23:17:43 GMT (envelope-from chuck@FreeBSD.org) Message-Id: <202007192317.06JNHhMZ052489@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: chuck set sender to chuck@FreeBSD.org using -f From: Chuck Tuffli Date: Sun, 19 Jul 2020 23:17:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r363338 - stable/12/usr.sbin/bhyve X-SVN-Group: stable-12 X-SVN-Commit-Author: chuck X-SVN-Commit-Paths: stable/12/usr.sbin/bhyve X-SVN-Commit-Revision: 363338 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 19 Jul 2020 23:17:44 -0000 Author: chuck Date: Sun Jul 19 23:17:43 2020 New Revision: 363338 URL: https://svnweb.freebsd.org/changeset/base/363338 Log: MFC r362750 bhyve: implement NVMe Namespace Identification Descriptor Modified: stable/12/usr.sbin/bhyve/pci_nvme.c Directory Properties: stable/12/ (props changed) Modified: stable/12/usr.sbin/bhyve/pci_nvme.c ============================================================================== --- stable/12/usr.sbin/bhyve/pci_nvme.c Sun Jul 19 22:58:11 2020 (r363337) +++ stable/12/usr.sbin/bhyve/pci_nvme.c Sun Jul 19 23:17:43 2020 (r363338) @@ -870,10 +870,13 @@ nvme_opc_identify(struct pci_nvme_softc* sc, struct nv struct nvme_completion* compl) { void *dest; + uint16_t status; DPRINTF("%s identify 0x%x nsid 0x%x", __func__, command->cdw10 & 0xFF, command->nsid); + pci_nvme_status_genc(&status, NVME_SC_SUCCESS); + switch (command->cdw10 & 0xFF) { case 0x00: /* return Identify Namespace data structure */ nvme_prp_memcpy(sc->nsc_pi->pi_vmctx, command->prp1, @@ -892,24 +895,30 @@ nvme_opc_identify(struct pci_nvme_softc* sc, struct nv ((uint32_t *)dest)[0] = 1; ((uint32_t *)dest)[1] = 0; break; - case 0x11: - pci_nvme_status_genc(&compl->status, - NVME_SC_INVALID_NAMESPACE_OR_FORMAT); - return (1); case 0x03: /* list of NSID structures in CDW1.NSID, 4096 bytes */ - case 0x10: - case 0x12: - case 0x13: - case 0x14: - case 0x15: + if (command->nsid != 1) { + pci_nvme_status_genc(&status, + NVME_SC_INVALID_NAMESPACE_OR_FORMAT); + break; + } + dest = vm_map_gpa(sc->nsc_pi->pi_vmctx, command->prp1, + sizeof(uint32_t) * 1024); + /* All bytes after the descriptor shall be zero */ + bzero(dest, sizeof(uint32_t) * 1024); + + /* Return NIDT=1 (i.e. EUI64) descriptor */ + ((uint8_t *)dest)[0] = 1; + ((uint8_t *)dest)[1] = sizeof(uint64_t); + bcopy(sc->nsdata.eui64, ((uint8_t *)dest) + 4, sizeof(uint64_t)); + break; default: DPRINTF("%s unsupported identify command requested 0x%x", __func__, command->cdw10 & 0xFF); - pci_nvme_status_genc(&compl->status, NVME_SC_INVALID_FIELD); + pci_nvme_status_genc(&status, NVME_SC_INVALID_FIELD); return (1); } - pci_nvme_status_genc(&compl->status, NVME_SC_SUCCESS); + compl->status = status; return (1); } From owner-svn-src-all@freebsd.org Sun Jul 19 23:19:09 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A934F36C257; Sun, 19 Jul 2020 23:19:09 +0000 (UTC) (envelope-from mhorne@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4B915T42B7z49W0; Sun, 19 Jul 2020 23:19:09 +0000 (UTC) (envelope-from mhorne@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6ED7E23549; Sun, 19 Jul 2020 23:19:09 +0000 (UTC) (envelope-from mhorne@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06JNJ9Mk052609; Sun, 19 Jul 2020 23:19:09 GMT (envelope-from mhorne@FreeBSD.org) Received: (from mhorne@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06JNJ9tp052608; Sun, 19 Jul 2020 23:19:09 GMT (envelope-from mhorne@FreeBSD.org) Message-Id: <202007192319.06JNJ9tp052608@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mhorne set sender to mhorne@FreeBSD.org using -f From: Mitchell Horne Date: Sun, 19 Jul 2020 23:19:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363339 - head/sys/modules X-SVN-Group: head X-SVN-Commit-Author: mhorne X-SVN-Commit-Paths: head/sys/modules X-SVN-Commit-Revision: 363339 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 19 Jul 2020 23:19:09 -0000 Author: mhorne Date: Sun Jul 19 23:19:09 2020 New Revision: 363339 URL: https://svnweb.freebsd.org/changeset/base/363339 Log: Make efirt module dependent on MK_EFI MK_EFI was added to kern.opts.mk in r331099, but is currently unused. Take advantage of that fact and gate the build of efirt behind it. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D24673 Modified: head/sys/modules/Makefile Modified: head/sys/modules/Makefile ============================================================================== --- head/sys/modules/Makefile Sun Jul 19 23:17:43 2020 (r363338) +++ head/sys/modules/Makefile Sun Jul 19 23:19:09 2020 (r363339) @@ -421,6 +421,12 @@ _ktls_ocf= ktls_ocf SUBDIR+= cuse .endif +.if ${MK_EFI} != "no" +.if ${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "amd64" +_efirt= efirt +.endif +.endif + .if (${MK_INET_SUPPORT} != "no" || ${MK_INET6_SUPPORT} != "no") || \ defined(ALL_MODULES) _carp= carp @@ -585,7 +591,6 @@ _cxgb= cxgb .if ${MACHINE_CPUARCH} == "aarch64" _allwinner= allwinner _armv8crypto= armv8crypto -_efirt= efirt _em= em _rockchip= rockchip .endif @@ -707,7 +712,6 @@ _x86bios= x86bios .if ${MACHINE_CPUARCH} == "amd64" _amdgpio= amdgpio _ccp= ccp -_efirt= efirt _iavf= iavf _ioat= ioat _ixl= ixl From owner-svn-src-all@freebsd.org Sun Jul 19 23:20:58 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 040AD36C4F0; Sun, 19 Jul 2020 23:20:58 +0000 (UTC) (envelope-from chuck@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4B917Y6JGxz49v9; Sun, 19 Jul 2020 23:20:57 +0000 (UTC) (envelope-from chuck@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BBB0D232F3; Sun, 19 Jul 2020 23:20:57 +0000 (UTC) (envelope-from chuck@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06JNKvR5054607; Sun, 19 Jul 2020 23:20:57 GMT (envelope-from chuck@FreeBSD.org) Received: (from chuck@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06JNKvHK054606; Sun, 19 Jul 2020 23:20:57 GMT (envelope-from chuck@FreeBSD.org) Message-Id: <202007192320.06JNKvHK054606@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: chuck set sender to chuck@FreeBSD.org using -f From: Chuck Tuffli Date: Sun, 19 Jul 2020 23:20:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r363340 - stable/12/usr.sbin/bhyve X-SVN-Group: stable-12 X-SVN-Commit-Author: chuck X-SVN-Commit-Paths: stable/12/usr.sbin/bhyve X-SVN-Commit-Revision: 363340 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 19 Jul 2020 23:20:58 -0000 Author: chuck Date: Sun Jul 19 23:20:57 2020 New Revision: 363340 URL: https://svnweb.freebsd.org/changeset/base/363340 Log: MFC r362751 bhyve: fix NVMe Get Log Page command Modified: stable/12/usr.sbin/bhyve/pci_nvme.c Directory Properties: stable/12/ (props changed) Modified: stable/12/usr.sbin/bhyve/pci_nvme.c ============================================================================== --- stable/12/usr.sbin/bhyve/pci_nvme.c Sun Jul 19 23:19:09 2020 (r363339) +++ stable/12/usr.sbin/bhyve/pci_nvme.c Sun Jul 19 23:20:57 2020 (r363340) @@ -830,32 +830,42 @@ static int nvme_opc_get_log_page(struct pci_nvme_softc* sc, struct nvme_command* command, struct nvme_completion* compl) { - uint32_t logsize = (1 + ((command->cdw10 >> 16) & 0xFFF)) * 2; + uint32_t logsize; uint8_t logpage = command->cdw10 & 0xFF; DPRINTF("%s log page %u len %u", __func__, logpage, logsize); pci_nvme_status_genc(&compl->status, NVME_SC_SUCCESS); + /* + * Command specifies the number of dwords to return in fields NUMDU + * and NUMDL. This is a zero-based value. + */ + logsize = ((command->cdw11 << 16) | (command->cdw10 >> 16)) + 1; + logsize *= sizeof(uint32_t); + switch (logpage) { case NVME_LOG_ERROR: nvme_prp_memcpy(sc->nsc_pi->pi_vmctx, command->prp1, - command->prp2, (uint8_t *)&sc->err_log, logsize, + command->prp2, (uint8_t *)&sc->err_log, + MIN(logsize, sizeof(sc->err_log)), NVME_COPY_TO_PRP); break; case NVME_LOG_HEALTH_INFORMATION: /* TODO: present some smart info */ nvme_prp_memcpy(sc->nsc_pi->pi_vmctx, command->prp1, - command->prp2, (uint8_t *)&sc->health_log, logsize, + command->prp2, (uint8_t *)&sc->health_log, + MIN(logsize, sizeof(sc->health_log)), NVME_COPY_TO_PRP); break; case NVME_LOG_FIRMWARE_SLOT: nvme_prp_memcpy(sc->nsc_pi->pi_vmctx, command->prp1, - command->prp2, (uint8_t *)&sc->fw_log, logsize, + command->prp2, (uint8_t *)&sc->fw_log, + MIN(logsize, sizeof(sc->fw_log)), NVME_COPY_TO_PRP); break; default: - WPRINTF("%s get log page %x command not supported", + DPRINTF("%s get log page %x command not supported", __func__, logpage); pci_nvme_status_tc(&compl->status, NVME_SCT_COMMAND_SPECIFIC, From owner-svn-src-all@freebsd.org Sun Jul 19 23:24:07 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8444C36CC01; Sun, 19 Jul 2020 23:24:07 +0000 (UTC) (envelope-from chuck@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4B91CC2y9tz4B1d; Sun, 19 Jul 2020 23:24:07 +0000 (UTC) (envelope-from chuck@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4837A23916; Sun, 19 Jul 2020 23:24:07 +0000 (UTC) (envelope-from chuck@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06JNO74K058569; Sun, 19 Jul 2020 23:24:07 GMT (envelope-from chuck@FreeBSD.org) Received: (from chuck@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06JNO74i058568; Sun, 19 Jul 2020 23:24:07 GMT (envelope-from chuck@FreeBSD.org) Message-Id: <202007192324.06JNO74i058568@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: chuck set sender to chuck@FreeBSD.org using -f From: Chuck Tuffli Date: Sun, 19 Jul 2020 23:24:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r363341 - stable/12/usr.sbin/bhyve X-SVN-Group: stable-12 X-SVN-Commit-Author: chuck X-SVN-Commit-Paths: stable/12/usr.sbin/bhyve X-SVN-Commit-Revision: 363341 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 19 Jul 2020 23:24:07 -0000 Author: chuck Date: Sun Jul 19 23:24:06 2020 New Revision: 363341 URL: https://svnweb.freebsd.org/changeset/base/363341 Log: MFC r362752 bhyve: fix NVMe queue creation and deletion Modified: stable/12/usr.sbin/bhyve/pci_nvme.c Directory Properties: stable/12/ (props changed) Modified: stable/12/usr.sbin/bhyve/pci_nvme.c ============================================================================== --- stable/12/usr.sbin/bhyve/pci_nvme.c Sun Jul 19 23:20:57 2020 (r363340) +++ stable/12/usr.sbin/bhyve/pci_nvme.c Sun Jul 19 23:24:06 2020 (r363341) @@ -705,7 +705,8 @@ nvme_opc_delete_io_sq(struct pci_nvme_softc* sc, struc uint16_t qid = command->cdw10 & 0xffff; DPRINTF("%s DELETE_IO_SQ %u", __func__, qid); - if (qid == 0 || qid > sc->num_squeues) { + if (qid == 0 || qid > sc->num_squeues || + (sc->submit_queues[qid].qbase == NULL)) { WPRINTF("%s NOT PERMITTED queue id %u / num_squeues %u", __func__, qid, sc->num_squeues); pci_nvme_status_tc(&compl->status, NVME_SCT_COMMAND_SPECIFIC, @@ -714,6 +715,7 @@ nvme_opc_delete_io_sq(struct pci_nvme_softc* sc, struc } sc->submit_queues[qid].qbase = NULL; + sc->submit_queues[qid].cqid = 0; pci_nvme_status_genc(&compl->status, NVME_SC_SUCCESS); return (1); } @@ -726,7 +728,8 @@ nvme_opc_create_io_sq(struct pci_nvme_softc* sc, struc uint16_t qid = command->cdw10 & 0xffff; struct nvme_submission_queue *nsq; - if ((qid == 0) || (qid > sc->num_squeues)) { + if ((qid == 0) || (qid > sc->num_squeues) || + (sc->submit_queues[qid].qbase != NULL)) { WPRINTF("%s queue index %u > num_squeues %u", __func__, qid, sc->num_squeues); pci_nvme_status_tc(&compl->status, @@ -737,12 +740,39 @@ nvme_opc_create_io_sq(struct pci_nvme_softc* sc, struc nsq = &sc->submit_queues[qid]; nsq->size = ONE_BASED((command->cdw10 >> 16) & 0xffff); + DPRINTF("%s size=%u (max=%u)", __func__, nsq->size, sc->max_qentries); + if ((nsq->size < 2) || (nsq->size > sc->max_qentries)) { + /* + * Queues must specify at least two entries + * NOTE: "MAXIMUM QUEUE SIZE EXCEEDED" was renamed to + * "INVALID QUEUE SIZE" in the NVM Express 1.3 Spec + */ + pci_nvme_status_tc(&compl->status, + NVME_SCT_COMMAND_SPECIFIC, + NVME_SC_MAXIMUM_QUEUE_SIZE_EXCEEDED); + return (1); + } - nsq->qbase = vm_map_gpa(sc->nsc_pi->pi_vmctx, command->prp1, - sizeof(struct nvme_command) * (size_t)nsq->size); nsq->cqid = (command->cdw11 >> 16) & 0xffff; + if ((nsq->cqid == 0) || (nsq->cqid > sc->num_cqueues)) { + pci_nvme_status_tc(&compl->status, + NVME_SCT_COMMAND_SPECIFIC, + NVME_SC_INVALID_QUEUE_IDENTIFIER); + return (1); + } + + if (sc->compl_queues[nsq->cqid].qbase == NULL) { + pci_nvme_status_tc(&compl->status, + NVME_SCT_COMMAND_SPECIFIC, + NVME_SC_COMPLETION_QUEUE_INVALID); + return (1); + } + nsq->qpriority = (command->cdw11 >> 1) & 0x03; + nsq->qbase = vm_map_gpa(sc->nsc_pi->pi_vmctx, command->prp1, + sizeof(struct nvme_command) * (size_t)nsq->size); + DPRINTF("%s sq %u size %u gaddr %p cqid %u", __func__, qid, nsq->size, nsq->qbase, nsq->cqid); @@ -768,9 +798,11 @@ nvme_opc_delete_io_cq(struct pci_nvme_softc* sc, struc struct nvme_completion* compl) { uint16_t qid = command->cdw10 & 0xffff; + uint16_t sqid; DPRINTF("%s DELETE_IO_CQ %u", __func__, qid); - if (qid == 0 || qid > sc->num_cqueues) { + if (qid == 0 || qid > sc->num_cqueues || + (sc->compl_queues[qid].qbase == NULL)) { WPRINTF("%s queue index %u / num_cqueues %u", __func__, qid, sc->num_cqueues); pci_nvme_status_tc(&compl->status, NVME_SCT_COMMAND_SPECIFIC, @@ -778,6 +810,15 @@ nvme_opc_delete_io_cq(struct pci_nvme_softc* sc, struc return (1); } + /* Deleting an Active CQ is an error */ + for (sqid = 1; sqid < sc->num_squeues + 1; sqid++) + if (sc->submit_queues[sqid].cqid == qid) { + pci_nvme_status_tc(&compl->status, + NVME_SCT_COMMAND_SPECIFIC, + NVME_SC_INVALID_QUEUE_DELETION); + return (1); + } + sc->compl_queues[qid].qbase = NULL; pci_nvme_status_genc(&compl->status, NVME_SC_SUCCESS); return (1); @@ -787,41 +828,57 @@ static int nvme_opc_create_io_cq(struct pci_nvme_softc* sc, struct nvme_command* command, struct nvme_completion* compl) { + struct nvme_completion_queue *ncq; + uint16_t qid = command->cdw10 & 0xffff; - if (command->cdw11 & NVME_CMD_CDW11_PC) { - uint16_t qid = command->cdw10 & 0xffff; - struct nvme_completion_queue *ncq; + /* Only support Physically Contiguous queues */ + if ((command->cdw11 & NVME_CMD_CDW11_PC) == 0) { + WPRINTF("%s unsupported non-contig (list-based) " + "create i/o completion queue", + __func__); - if ((qid == 0) || (qid > sc->num_cqueues)) { - WPRINTF("%s queue index %u > num_cqueues %u", - __func__, qid, sc->num_cqueues); - pci_nvme_status_tc(&compl->status, - NVME_SCT_COMMAND_SPECIFIC, - NVME_SC_INVALID_QUEUE_IDENTIFIER); - return (1); - } + pci_nvme_status_genc(&compl->status, NVME_SC_INVALID_FIELD); + return (1); + } - ncq = &sc->compl_queues[qid]; - ncq->intr_en = (command->cdw11 & NVME_CMD_CDW11_IEN) >> 1; - ncq->intr_vec = (command->cdw11 >> 16) & 0xffff; - ncq->size = ONE_BASED((command->cdw10 >> 16) & 0xffff); + if ((qid == 0) || (qid > sc->num_cqueues) || + (sc->compl_queues[qid].qbase != NULL)) { + WPRINTF("%s queue index %u > num_cqueues %u", + __func__, qid, sc->num_cqueues); + pci_nvme_status_tc(&compl->status, + NVME_SCT_COMMAND_SPECIFIC, + NVME_SC_INVALID_QUEUE_IDENTIFIER); + return (1); + } - ncq->qbase = vm_map_gpa(sc->nsc_pi->pi_vmctx, - command->prp1, - sizeof(struct nvme_command) * (size_t)ncq->size); + ncq = &sc->compl_queues[qid]; + ncq->intr_en = (command->cdw11 & NVME_CMD_CDW11_IEN) >> 1; + ncq->intr_vec = (command->cdw11 >> 16) & 0xffff; + if (ncq->intr_vec > (sc->max_queues + 1)) { + pci_nvme_status_tc(&compl->status, + NVME_SCT_COMMAND_SPECIFIC, + NVME_SC_INVALID_INTERRUPT_VECTOR); + return (1); + } - pci_nvme_status_genc(&compl->status, NVME_SC_SUCCESS); - } else { - /* - * Non-contig completion queue unsupported. + ncq->size = ONE_BASED((command->cdw10 >> 16) & 0xffff); + if ((ncq->size < 2) || (ncq->size > sc->max_qentries)) { + /* + * Queues must specify at least two entries + * NOTE: "MAXIMUM QUEUE SIZE EXCEEDED" was renamed to + * "INVALID QUEUE SIZE" in the NVM Express 1.3 Spec */ - WPRINTF("%s unsupported non-contig (list-based) " - "create i/o completion queue", - __func__); - - /* 0x12 = Invalid Use of Controller Memory Buffer */ - pci_nvme_status_genc(&compl->status, 0x12); + pci_nvme_status_tc(&compl->status, + NVME_SCT_COMMAND_SPECIFIC, + NVME_SC_MAXIMUM_QUEUE_SIZE_EXCEEDED); + return (1); } + ncq->qbase = vm_map_gpa(sc->nsc_pi->pi_vmctx, + command->prp1, + sizeof(struct nvme_command) * (size_t)ncq->size); + + pci_nvme_status_genc(&compl->status, NVME_SC_SUCCESS); + return (1); } From owner-svn-src-all@freebsd.org Sun Jul 19 23:27:12 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 58EB236CB24; Sun, 19 Jul 2020 23:27:12 +0000 (UTC) (envelope-from chuck@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4B91Gm24Bgz49xM; Sun, 19 Jul 2020 23:27:12 +0000 (UTC) (envelope-from chuck@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 102F6235E2; Sun, 19 Jul 2020 23:27:12 +0000 (UTC) (envelope-from chuck@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06JNRBQv058775; Sun, 19 Jul 2020 23:27:11 GMT (envelope-from chuck@FreeBSD.org) Received: (from chuck@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06JNRBYM058774; Sun, 19 Jul 2020 23:27:11 GMT (envelope-from chuck@FreeBSD.org) Message-Id: <202007192327.06JNRBYM058774@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: chuck set sender to chuck@FreeBSD.org using -f From: Chuck Tuffli Date: Sun, 19 Jul 2020 23:27:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r363342 - stable/12/usr.sbin/bhyve X-SVN-Group: stable-12 X-SVN-Commit-Author: chuck X-SVN-Commit-Paths: stable/12/usr.sbin/bhyve X-SVN-Commit-Revision: 363342 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 19 Jul 2020 23:27:12 -0000 Author: chuck Date: Sun Jul 19 23:27:11 2020 New Revision: 363342 URL: https://svnweb.freebsd.org/changeset/base/363342 Log: MFC r362753 bhyve: add more compliant NVMe Get/Set Features Modified: stable/12/usr.sbin/bhyve/pci_nvme.c Directory Properties: stable/12/ (props changed) Modified: stable/12/usr.sbin/bhyve/pci_nvme.c ============================================================================== --- stable/12/usr.sbin/bhyve/pci_nvme.c Sun Jul 19 23:24:06 2020 (r363341) +++ stable/12/usr.sbin/bhyve/pci_nvme.c Sun Jul 19 23:27:11 2020 (r363342) @@ -222,6 +222,23 @@ enum nvme_dsm_type { NVME_DATASET_MANAGEMENT_DISABLE, }; +struct pci_nvme_softc; +struct nvme_feature_obj; + +typedef void (*nvme_feature_cb)(struct pci_nvme_softc *, + struct nvme_feature_obj *, + struct nvme_command *, + struct nvme_completion *); + +struct nvme_feature_obj { + uint32_t cdw11; + nvme_feature_cb set; + nvme_feature_cb get; + bool namespace_specific; +}; + +#define NVME_FID_MAX (NVME_FEAT_ENDURANCE_GROUP_EVENT_CONFIGURATION + 1) + struct pci_nvme_softc { struct pci_devinst *nsc_pi; @@ -241,6 +258,7 @@ struct pci_nvme_softc { uint32_t max_queues; /* max number of IO SQ's or CQ's */ uint32_t num_cqueues; uint32_t num_squeues; + bool num_q_is_set; /* Has host set Number of Queues */ struct pci_nvme_ioreq *ioreqs; STAILQ_HEAD(, pci_nvme_ioreq) ioreqs_free; /* free list of ioreqs */ @@ -255,10 +273,7 @@ struct pci_nvme_softc { struct nvme_completion_queue *compl_queues; struct nvme_submission_queue *submit_queues; - /* controller features */ - uint32_t intr_coales_aggr_time; /* 0x08: uS to delay intr */ - uint32_t intr_coales_aggr_thresh; /* 0x08: compl-Q entries */ - uint32_t async_ev_config; /* 0x0B: async event config */ + struct nvme_feature_obj feat[NVME_FID_MAX]; enum nvme_dsm_type dataset_management; }; @@ -303,6 +318,15 @@ static void pci_nvme_io_partial(struct blockif_req *br #define NVME_ONCS_DSM (NVME_CTRLR_DATA_ONCS_DSM_MASK << \ NVME_CTRLR_DATA_ONCS_DSM_SHIFT) +static void nvme_feature_invalid_cb(struct pci_nvme_softc *, + struct nvme_feature_obj *, + struct nvme_command *, + struct nvme_completion *); +static void nvme_feature_num_queues(struct pci_nvme_softc *, + struct nvme_feature_obj *, + struct nvme_command *, + struct nvme_completion *); + static __inline void cpywithpad(char *dst, size_t dst_size, const char *src, char pad) { @@ -542,6 +566,18 @@ pci_nvme_init_logpages(struct pci_nvme_softc *sc) } static void +pci_nvme_init_features(struct pci_nvme_softc *sc) +{ + + sc->feat[0].set = nvme_feature_invalid_cb; + sc->feat[0].get = nvme_feature_invalid_cb; + + sc->feat[NVME_FEAT_LBA_RANGE_TYPE].namespace_specific = true; + sc->feat[NVME_FEAT_ERROR_RECOVERY].namespace_specific = true; + sc->feat[NVME_FEAT_NUMBER_OF_QUEUES].set = nvme_feature_num_queues; +} + +static void pci_nvme_reset_locked(struct pci_nvme_softc *sc) { uint32_t i; @@ -577,6 +613,8 @@ pci_nvme_reset_locked(struct pci_nvme_softc *sc) sc->compl_queues[i].tail = 0; sc->compl_queues[i].head = 0; } + + sc->num_q_is_set = false; } static void @@ -982,24 +1020,144 @@ nvme_opc_identify(struct pci_nvme_softc* sc, struct nv DPRINTF("%s unsupported identify command requested 0x%x", __func__, command->cdw10 & 0xFF); pci_nvme_status_genc(&status, NVME_SC_INVALID_FIELD); - return (1); + break; } compl->status = status; return (1); } -static int -nvme_set_feature_queues(struct pci_nvme_softc* sc, struct nvme_command* command, - struct nvme_completion* compl) +static const char * +nvme_fid_to_name(uint8_t fid) { + const char *name; + + switch (fid) { + case NVME_FEAT_ARBITRATION: + name = "Arbitration"; + break; + case NVME_FEAT_POWER_MANAGEMENT: + name = "Power Management"; + break; + case NVME_FEAT_LBA_RANGE_TYPE: + name = "LBA Range Type"; + break; + case NVME_FEAT_TEMPERATURE_THRESHOLD: + name = "Temperature Threshold"; + break; + case NVME_FEAT_ERROR_RECOVERY: + name = "Error Recovery"; + break; + case NVME_FEAT_VOLATILE_WRITE_CACHE: + name = "Volatile Write Cache"; + break; + case NVME_FEAT_NUMBER_OF_QUEUES: + name = "Number of Queues"; + break; + case NVME_FEAT_INTERRUPT_COALESCING: + name = "Interrupt Coalescing"; + break; + case NVME_FEAT_INTERRUPT_VECTOR_CONFIGURATION: + name = "Interrupt Vector Configuration"; + break; + case NVME_FEAT_WRITE_ATOMICITY: + name = "Write Atomicity Normal"; + break; + case NVME_FEAT_ASYNC_EVENT_CONFIGURATION: + name = "Asynchronous Event Configuration"; + break; + case NVME_FEAT_AUTONOMOUS_POWER_STATE_TRANSITION: + name = "Autonomous Power State Transition"; + break; + case NVME_FEAT_HOST_MEMORY_BUFFER: + name = "Host Memory Buffer"; + break; + case NVME_FEAT_TIMESTAMP: + name = "Timestamp"; + break; + case NVME_FEAT_KEEP_ALIVE_TIMER: + name = "Keep Alive Timer"; + break; + case NVME_FEAT_HOST_CONTROLLED_THERMAL_MGMT: + name = "Host Controlled Thermal Management"; + break; + case NVME_FEAT_NON_OP_POWER_STATE_CONFIG: + name = "Non-Operation Power State Config"; + break; + case NVME_FEAT_READ_RECOVERY_LEVEL_CONFIG: + name = "Read Recovery Level Config"; + break; + case NVME_FEAT_PREDICTABLE_LATENCY_MODE_CONFIG: + name = "Predictable Latency Mode Config"; + break; + case NVME_FEAT_PREDICTABLE_LATENCY_MODE_WINDOW: + name = "Predictable Latency Mode Window"; + break; + case NVME_FEAT_LBA_STATUS_INFORMATION_ATTRIBUTES: + name = "LBA Status Information Report Interval"; + break; + case NVME_FEAT_HOST_BEHAVIOR_SUPPORT: + name = "Host Behavior Support"; + break; + case NVME_FEAT_SANITIZE_CONFIG: + name = "Sanitize Config"; + break; + case NVME_FEAT_ENDURANCE_GROUP_EVENT_CONFIGURATION: + name = "Endurance Group Event Configuration"; + break; + case NVME_FEAT_SOFTWARE_PROGRESS_MARKER: + name = "Software Progress Marker"; + break; + case NVME_FEAT_HOST_IDENTIFIER: + name = "Host Identifier"; + break; + case NVME_FEAT_RESERVATION_NOTIFICATION_MASK: + name = "Reservation Notification Mask"; + break; + case NVME_FEAT_RESERVATION_PERSISTENCE: + name = "Reservation Persistence"; + break; + case NVME_FEAT_NAMESPACE_WRITE_PROTECTION_CONFIG: + name = "Namespace Write Protection Config"; + break; + default: + name = "Unknown"; + break; + } + + return (name); +} + +static void +nvme_feature_invalid_cb(struct pci_nvme_softc *sc, + struct nvme_feature_obj *feat, + struct nvme_command *command, + struct nvme_completion *compl) +{ + + pci_nvme_status_genc(&compl->status, NVME_SC_INVALID_FIELD); +} + +static void +nvme_feature_num_queues(struct pci_nvme_softc *sc, + struct nvme_feature_obj *feat, + struct nvme_command *command, + struct nvme_completion *compl) +{ uint16_t nqr; /* Number of Queues Requested */ + if (sc->num_q_is_set) { + WPRINTF("%s: Number of Queues already set", __func__); + pci_nvme_status_genc(&compl->status, + NVME_SC_COMMAND_SEQUENCE_ERROR); + return; + } + nqr = command->cdw11 & 0xFFFF; if (nqr == 0xffff) { WPRINTF("%s: Illegal NSQR value %#x", __func__, nqr); pci_nvme_status_genc(&compl->status, NVME_SC_INVALID_FIELD); - return (-1); + return; } sc->num_squeues = ONE_BASED(nqr); @@ -1013,7 +1171,7 @@ nvme_set_feature_queues(struct pci_nvme_softc* sc, str if (nqr == 0xffff) { WPRINTF("%s: Illegal NCQR value %#x", __func__, nqr); pci_nvme_status_genc(&compl->status, NVME_SC_INVALID_FIELD); - return (-1); + return; } sc->num_cqueues = ONE_BASED(nqr); @@ -1023,173 +1181,77 @@ nvme_set_feature_queues(struct pci_nvme_softc* sc, str sc->num_cqueues = sc->max_queues; } + /* Patch the command value which will be saved on callback's return */ + command->cdw11 = NVME_FEATURE_NUM_QUEUES(sc); compl->cdw0 = NVME_FEATURE_NUM_QUEUES(sc); - return (0); + sc->num_q_is_set = true; } static int -nvme_opc_set_features(struct pci_nvme_softc* sc, struct nvme_command* command, - struct nvme_completion* compl) +nvme_opc_set_features(struct pci_nvme_softc *sc, struct nvme_command *command, + struct nvme_completion *compl) { - int feature = command->cdw10 & 0xFF; - uint32_t iv; + struct nvme_feature_obj *feat; + uint32_t nsid = command->nsid; + uint8_t fid = command->cdw10 & 0xFF; - DPRINTF("%s feature 0x%x", __func__, feature); - compl->cdw0 = 0; + DPRINTF("%s: Feature ID 0x%x (%s)", __func__, fid, nvme_fid_to_name(fid)); - switch (feature) { - case NVME_FEAT_ARBITRATION: - DPRINTF(" arbitration 0x%x", command->cdw11); - break; - case NVME_FEAT_POWER_MANAGEMENT: - DPRINTF(" power management 0x%x", command->cdw11); - break; - case NVME_FEAT_LBA_RANGE_TYPE: - DPRINTF(" lba range 0x%x", command->cdw11); - break; - case NVME_FEAT_TEMPERATURE_THRESHOLD: - DPRINTF(" temperature threshold 0x%x", command->cdw11); - break; - case NVME_FEAT_ERROR_RECOVERY: - DPRINTF(" error recovery 0x%x", command->cdw11); - break; - case NVME_FEAT_VOLATILE_WRITE_CACHE: - DPRINTF(" volatile write cache 0x%x", command->cdw11); - break; - case NVME_FEAT_NUMBER_OF_QUEUES: - nvme_set_feature_queues(sc, command, compl); - break; - case NVME_FEAT_INTERRUPT_COALESCING: - DPRINTF(" interrupt coalescing 0x%x", command->cdw11); - - /* in uS */ - sc->intr_coales_aggr_time = ((command->cdw11 >> 8) & 0xFF)*100; - - sc->intr_coales_aggr_thresh = command->cdw11 & 0xFF; - break; - case NVME_FEAT_INTERRUPT_VECTOR_CONFIGURATION: - iv = command->cdw11 & 0xFFFF; - - DPRINTF(" interrupt vector configuration 0x%x", - command->cdw11); - - for (uint32_t i = 0; i < sc->num_cqueues + 1; i++) { - if (sc->compl_queues[i].intr_vec == iv) { - if (command->cdw11 & (1 << 16)) - sc->compl_queues[i].intr_en |= - NVME_CQ_INTCOAL; - else - sc->compl_queues[i].intr_en &= - ~NVME_CQ_INTCOAL; - } - } - break; - case NVME_FEAT_WRITE_ATOMICITY: - DPRINTF(" write atomicity 0x%x", command->cdw11); - break; - case NVME_FEAT_ASYNC_EVENT_CONFIGURATION: - DPRINTF(" async event configuration 0x%x", - command->cdw11); - sc->async_ev_config = command->cdw11; - break; - case NVME_FEAT_SOFTWARE_PROGRESS_MARKER: - DPRINTF(" software progress marker 0x%x", - command->cdw11); - break; - case 0x0C: - DPRINTF(" autonomous power state transition 0x%x", - command->cdw11); - break; - default: - WPRINTF("%s invalid feature", __func__); + if (fid >= NVME_FID_MAX) { + DPRINTF("%s invalid feature 0x%x", __func__, fid); pci_nvme_status_genc(&compl->status, NVME_SC_INVALID_FIELD); return (1); } + feat = &sc->feat[fid]; + if (!feat->namespace_specific && + !((nsid == 0) || (nsid == NVME_GLOBAL_NAMESPACE_TAG))) { + pci_nvme_status_tc(&compl->status, NVME_SCT_COMMAND_SPECIFIC, + NVME_SC_FEATURE_NOT_NS_SPECIFIC); + return (1); + } + + compl->cdw0 = 0; pci_nvme_status_genc(&compl->status, NVME_SC_SUCCESS); - return (1); + + if (feat->set) + feat->set(sc, feat, command, compl); + + if (compl->status == NVME_SC_SUCCESS) + feat->cdw11 = command->cdw11; + + return (0); } static int nvme_opc_get_features(struct pci_nvme_softc* sc, struct nvme_command* command, struct nvme_completion* compl) { - int feature = command->cdw10 & 0xFF; + struct nvme_feature_obj *feat; + uint8_t fid = command->cdw10 & 0xFF; - DPRINTF("%s feature 0x%x", __func__, feature); + DPRINTF("%s: Feature ID 0x%x (%s)", __func__, fid, nvme_fid_to_name(fid)); - compl->cdw0 = 0; - - switch (feature) { - case NVME_FEAT_ARBITRATION: - DPRINTF(" arbitration"); - break; - case NVME_FEAT_POWER_MANAGEMENT: - DPRINTF(" power management"); - break; - case NVME_FEAT_LBA_RANGE_TYPE: - DPRINTF(" lba range"); - break; - case NVME_FEAT_TEMPERATURE_THRESHOLD: - DPRINTF(" temperature threshold"); - switch ((command->cdw11 >> 20) & 0x3) { - case 0: - /* Over temp threshold */ - compl->cdw0 = 0xFFFF; - break; - case 1: - /* Under temp threshold */ - compl->cdw0 = 0; - break; - default: - WPRINTF(" invalid threshold type select"); - pci_nvme_status_genc(&compl->status, - NVME_SC_INVALID_FIELD); - return (1); - } - break; - case NVME_FEAT_ERROR_RECOVERY: - DPRINTF(" error recovery"); - break; - case NVME_FEAT_VOLATILE_WRITE_CACHE: - DPRINTF(" volatile write cache"); - break; - case NVME_FEAT_NUMBER_OF_QUEUES: - compl->cdw0 = NVME_FEATURE_NUM_QUEUES(sc); - - DPRINTF(" number of queues (submit %u, completion %u)", - compl->cdw0 & 0xFFFF, - (compl->cdw0 >> 16) & 0xFFFF); - - break; - case NVME_FEAT_INTERRUPT_COALESCING: - DPRINTF(" interrupt coalescing"); - break; - case NVME_FEAT_INTERRUPT_VECTOR_CONFIGURATION: - DPRINTF(" interrupt vector configuration"); - break; - case NVME_FEAT_WRITE_ATOMICITY: - DPRINTF(" write atomicity"); - break; - case NVME_FEAT_ASYNC_EVENT_CONFIGURATION: - DPRINTF(" async event configuration"); - sc->async_ev_config = command->cdw11; - break; - case NVME_FEAT_SOFTWARE_PROGRESS_MARKER: - DPRINTF(" software progress marker"); - break; - case 0x0C: - DPRINTF(" autonomous power state transition"); - break; - default: - WPRINTF("%s invalid feature 0x%x", __func__, feature); + if (fid >= NVME_FID_MAX) { + DPRINTF("%s invalid feature 0x%x", __func__, fid); pci_nvme_status_genc(&compl->status, NVME_SC_INVALID_FIELD); return (1); } + compl->cdw0 = 0; pci_nvme_status_genc(&compl->status, NVME_SC_SUCCESS); - return (1); + + feat = &sc->feat[fid]; + if (feat->get) { + feat->get(sc, feat, command, compl); + } + + if (compl->status == NVME_SC_SUCCESS) { + compl->cdw0 = feat->cdw11; + } + + return (0); } static int @@ -2311,7 +2373,6 @@ pci_nvme_init(struct vmctx *ctx, struct pci_devinst *p pthread_mutex_init(&sc->ioreqs[i].mtx, NULL); pthread_cond_init(&sc->ioreqs[i].cv, NULL); } - sc->intr_coales_aggr_thresh = 1; pci_set_cfgdata16(pi, PCIR_DEVICE, 0x0A0A); pci_set_cfgdata16(pi, PCIR_VENDOR, 0xFB5D); @@ -2362,6 +2423,7 @@ pci_nvme_init(struct vmctx *ctx, struct pci_devinst *p pci_nvme_init_nsdata(sc, &sc->nsdata, 1, &sc->nvstore); pci_nvme_init_ctrldata(sc); pci_nvme_init_logpages(sc); + pci_nvme_init_features(sc); pci_nvme_reset(sc); From owner-svn-src-all@freebsd.org Sun Jul 19 23:29:35 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 27F6136CCAD; Sun, 19 Jul 2020 23:29:35 +0000 (UTC) (envelope-from chuck@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4B91KW0DRPz4BPc; Sun, 19 Jul 2020 23:29:35 +0000 (UTC) (envelope-from chuck@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DF3A223992; Sun, 19 Jul 2020 23:29:34 +0000 (UTC) (envelope-from chuck@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06JNTYCu058946; Sun, 19 Jul 2020 23:29:34 GMT (envelope-from chuck@FreeBSD.org) Received: (from chuck@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06JNTY4B058945; Sun, 19 Jul 2020 23:29:34 GMT (envelope-from chuck@FreeBSD.org) Message-Id: <202007192329.06JNTY4B058945@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: chuck set sender to chuck@FreeBSD.org using -f From: Chuck Tuffli Date: Sun, 19 Jul 2020 23:29:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r363343 - stable/12/usr.sbin/bhyve X-SVN-Group: stable-12 X-SVN-Commit-Author: chuck X-SVN-Commit-Paths: stable/12/usr.sbin/bhyve X-SVN-Commit-Revision: 363343 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 19 Jul 2020 23:29:35 -0000 Author: chuck Date: Sun Jul 19 23:29:34 2020 New Revision: 363343 URL: https://svnweb.freebsd.org/changeset/base/363343 Log: MFC r362754 bhyve: make unsupported NVMe commands a debug message Modified: stable/12/usr.sbin/bhyve/pci_nvme.c Directory Properties: stable/12/ (props changed) Modified: stable/12/usr.sbin/bhyve/pci_nvme.c ============================================================================== --- stable/12/usr.sbin/bhyve/pci_nvme.c Sun Jul 19 23:27:11 2020 (r363342) +++ stable/12/usr.sbin/bhyve/pci_nvme.c Sun Jul 19 23:29:34 2020 (r363343) @@ -1352,7 +1352,7 @@ pci_nvme_handle_admin_cmd(struct pci_nvme_softc* sc, u compl.status = NVME_NO_STATUS; break; default: - WPRINTF("0x%x command is not implemented", + DPRINTF("0x%x command is not implemented", cmd->opc); pci_nvme_status_genc(&compl.status, NVME_SC_INVALID_OPCODE); } From owner-svn-src-all@freebsd.org Sun Jul 19 23:34:02 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8DF3C36CA43; Sun, 19 Jul 2020 23:34:02 +0000 (UTC) (envelope-from chuck@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4B91Qf3D61z4BRD; Sun, 19 Jul 2020 23:34:02 +0000 (UTC) (envelope-from chuck@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 523632383B; Sun, 19 Jul 2020 23:34:02 +0000 (UTC) (envelope-from chuck@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06JNY26M064785; Sun, 19 Jul 2020 23:34:02 GMT (envelope-from chuck@FreeBSD.org) Received: (from chuck@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06JNY2Ko064784; Sun, 19 Jul 2020 23:34:02 GMT (envelope-from chuck@FreeBSD.org) Message-Id: <202007192334.06JNY2Ko064784@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: chuck set sender to chuck@FreeBSD.org using -f From: Chuck Tuffli Date: Sun, 19 Jul 2020 23:34:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r363344 - stable/12/usr.sbin/bhyve X-SVN-Group: stable-12 X-SVN-Commit-Author: chuck X-SVN-Commit-Paths: stable/12/usr.sbin/bhyve X-SVN-Commit-Revision: 363344 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 19 Jul 2020 23:34:02 -0000 Author: chuck Date: Sun Jul 19 23:34:01 2020 New Revision: 363344 URL: https://svnweb.freebsd.org/changeset/base/363344 Log: MFC r362755 bhyve: implement NVMe Format NVM command Modified: stable/12/usr.sbin/bhyve/pci_nvme.c Directory Properties: stable/12/ (props changed) Modified: stable/12/usr.sbin/bhyve/pci_nvme.c ============================================================================== --- stable/12/usr.sbin/bhyve/pci_nvme.c Sun Jul 19 23:29:34 2020 (r363343) +++ stable/12/usr.sbin/bhyve/pci_nvme.c Sun Jul 19 23:34:01 2020 (r363344) @@ -280,6 +280,9 @@ struct pci_nvme_softc { static void pci_nvme_io_partial(struct blockif_req *br, int err); +static struct pci_nvme_ioreq *pci_nvme_get_ioreq(struct pci_nvme_softc *); +static void pci_nvme_release_ioreq(struct pci_nvme_softc *, struct pci_nvme_ioreq *); +static void pci_nvme_io_done(struct blockif_req *, int); /* Controller Configuration utils */ #define NVME_CC_GET_EN(cc) \ @@ -645,6 +648,7 @@ pci_nvme_init_controller(struct vmctx *ctx, struct pci sc->compl_queues[0].size = acqs; sc->compl_queues[0].qbase = vm_map_gpa(ctx, sc->regs.acq, sizeof(struct nvme_completion) * acqs); + sc->compl_queues[0].intr_en = NVME_CQ_INTEN; DPRINTF("%s mapping Admin-CQ guest 0x%lx, host: %p", __func__, sc->regs.acq, sc->compl_queues[0].qbase); @@ -1255,6 +1259,71 @@ nvme_opc_get_features(struct pci_nvme_softc* sc, struc } static int +nvme_opc_format_nvm(struct pci_nvme_softc* sc, struct nvme_command* command, + struct nvme_completion* compl) +{ + uint8_t ses, lbaf, pi; + + /* Only supports Secure Erase Setting - User Data Erase */ + ses = (command->cdw10 >> 9) & 0x7; + if (ses > 0x1) { + pci_nvme_status_genc(&compl->status, NVME_SC_INVALID_FIELD); + return (1); + } + + /* Only supports a single LBA Format */ + lbaf = command->cdw10 & 0xf; + if (lbaf != 0) { + pci_nvme_status_tc(&compl->status, NVME_SCT_COMMAND_SPECIFIC, + NVME_SC_INVALID_FORMAT); + return (1); + } + + /* Doesn't support Protection Infomation */ + pi = (command->cdw10 >> 5) & 0x7; + if (pi != 0) { + pci_nvme_status_genc(&compl->status, NVME_SC_INVALID_FIELD); + return (1); + } + + if (sc->nvstore.type == NVME_STOR_RAM) { + if (sc->nvstore.ctx) + free(sc->nvstore.ctx); + sc->nvstore.ctx = calloc(1, sc->nvstore.size); + pci_nvme_status_genc(&compl->status, NVME_SC_SUCCESS); + } else { + struct pci_nvme_ioreq *req; + int err; + + req = pci_nvme_get_ioreq(sc); + if (req == NULL) { + pci_nvme_status_genc(&compl->status, + NVME_SC_INTERNAL_DEVICE_ERROR); + WPRINTF("%s: unable to allocate IO req", __func__); + return (1); + } + req->nvme_sq = &sc->submit_queues[0]; + req->sqid = 0; + req->opc = command->opc; + req->cid = command->cid; + req->nsid = command->nsid; + + req->io_req.br_offset = 0; + req->io_req.br_resid = sc->nvstore.size; + req->io_req.br_callback = pci_nvme_io_done; + + err = blockif_delete(sc->nvstore.ctx, &req->io_req); + if (err) { + pci_nvme_status_genc(&compl->status, + NVME_SC_INTERNAL_DEVICE_ERROR); + pci_nvme_release_ioreq(sc, req); + } + } + + return (1); +} + +static int nvme_opc_abort(struct pci_nvme_softc* sc, struct nvme_command* command, struct nvme_completion* compl) { @@ -1350,6 +1419,15 @@ pci_nvme_handle_admin_cmd(struct pci_nvme_softc* sc, u nvme_opc_async_event_req(sc, cmd, &compl); */ compl.status = NVME_NO_STATUS; + break; + case NVME_OPC_FORMAT_NVM: + DPRINTF("%s command FORMAT_NVM", __func__); + if ((sc->ctrldata.oacs & + (1 << NVME_CTRLR_DATA_OACS_FORMAT_SHIFT)) == 0) { + pci_nvme_status_genc(&compl.status, NVME_SC_INVALID_OPCODE); + } + compl.status = NVME_NO_STATUS; + nvme_opc_format_nvm(sc, cmd, &compl); break; default: DPRINTF("0x%x command is not implemented", From owner-svn-src-all@freebsd.org Sun Jul 19 23:34:53 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 19C2B36CD42; Sun, 19 Jul 2020 23:34:53 +0000 (UTC) (envelope-from mhorne@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4B91Rc7283z4Bty; Sun, 19 Jul 2020 23:34:52 +0000 (UTC) (envelope-from mhorne@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D3F8523943; Sun, 19 Jul 2020 23:34:52 +0000 (UTC) (envelope-from mhorne@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06JNYq43064881; Sun, 19 Jul 2020 23:34:52 GMT (envelope-from mhorne@FreeBSD.org) Received: (from mhorne@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06JNYqAR064880; Sun, 19 Jul 2020 23:34:52 GMT (envelope-from mhorne@FreeBSD.org) Message-Id: <202007192334.06JNYqAR064880@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mhorne set sender to mhorne@FreeBSD.org using -f From: Mitchell Horne Date: Sun, 19 Jul 2020 23:34:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363345 - head/sys/riscv/riscv X-SVN-Group: head X-SVN-Commit-Author: mhorne X-SVN-Commit-Paths: head/sys/riscv/riscv X-SVN-Commit-Revision: 363345 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 19 Jul 2020 23:34:53 -0000 Author: mhorne Date: Sun Jul 19 23:34:52 2020 New Revision: 363345 URL: https://svnweb.freebsd.org/changeset/base/363345 Log: riscv: look for bootargs in FDT The FDT may contain a short /chosen/bootargs string which we should pass to boot_parse_cmdline. Notably, this allows the use of qemu's -append option to pass things like -s to boot to single user mode. Submitted by: Nathaniel Filardo Reviewed by: mhorne MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D25544 Modified: head/sys/riscv/riscv/machdep.c Modified: head/sys/riscv/riscv/machdep.c ============================================================================== --- head/sys/riscv/riscv/machdep.c Sun Jul 19 23:34:01 2020 (r363344) +++ head/sys/riscv/riscv/machdep.c Sun Jul 19 23:34:52 2020 (r363345) @@ -40,6 +40,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -800,6 +801,19 @@ fake_preload_metadata(struct riscv_bootparams *rvbp) rvbp->kern_phys, rvbp->kern_phys + (lastaddr - KERNBASE)); } +#ifdef FDT +static void +parse_fdt_bootargs(void) +{ + char bootargs[512]; + + bootargs[sizeof(bootargs) - 1] = '\0'; + if (fdt_get_chosen_bootargs(bootargs, sizeof(bootargs) - 1) == 0) { + boothowto |= boot_parse_cmdline(bootargs); + } +} +#endif + static vm_offset_t parse_metadata(void) { @@ -829,6 +843,8 @@ parse_metadata(void) #endif #ifdef FDT try_load_dtb(kmdp); + if (kern_envp == NULL) + parse_fdt_bootargs(); #endif return (lastaddr); } From owner-svn-src-all@freebsd.org Sun Jul 19 23:37:20 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6000836D151; Sun, 19 Jul 2020 23:37:20 +0000 (UTC) (envelope-from chuck@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4B91VS1tHHz4CC3; Sun, 19 Jul 2020 23:37:20 +0000 (UTC) (envelope-from chuck@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 20B69239B0; Sun, 19 Jul 2020 23:37:20 +0000 (UTC) (envelope-from chuck@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06JNbJXA065057; Sun, 19 Jul 2020 23:37:19 GMT (envelope-from chuck@FreeBSD.org) Received: (from chuck@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06JNbJnw065056; Sun, 19 Jul 2020 23:37:19 GMT (envelope-from chuck@FreeBSD.org) Message-Id: <202007192337.06JNbJnw065056@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: chuck set sender to chuck@FreeBSD.org using -f From: Chuck Tuffli Date: Sun, 19 Jul 2020 23:37:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r363346 - stable/12/usr.sbin/bhyve X-SVN-Group: stable-12 X-SVN-Commit-Author: chuck X-SVN-Commit-Paths: stable/12/usr.sbin/bhyve X-SVN-Commit-Revision: 363346 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 19 Jul 2020 23:37:20 -0000 Author: chuck Date: Sun Jul 19 23:37:19 2020 New Revision: 363346 URL: https://svnweb.freebsd.org/changeset/base/363346 Log: MFC r362756 bhyve: refactor NVMe I/O read/write Modified: stable/12/usr.sbin/bhyve/pci_nvme.c Directory Properties: stable/12/ (props changed) Modified: stable/12/usr.sbin/bhyve/pci_nvme.c ============================================================================== --- stable/12/usr.sbin/bhyve/pci_nvme.c Sun Jul 19 23:34:52 2020 (r363345) +++ stable/12/usr.sbin/bhyve/pci_nvme.c Sun Jul 19 23:37:19 2020 (r363346) @@ -1682,6 +1682,108 @@ nvme_opc_flush(struct pci_nvme_softc *sc, return (pending); } +static uint16_t +nvme_write_read_ram(struct pci_nvme_softc *sc, + struct pci_nvme_blockstore *nvstore, + uint64_t prp1, uint64_t prp2, + size_t offset, uint64_t bytes, + bool is_write) +{ + uint8_t *buf = nvstore->ctx; + enum nvme_copy_dir dir; + uint16_t status; + + if (is_write) + dir = NVME_COPY_TO_PRP; + else + dir = NVME_COPY_FROM_PRP; + + if (nvme_prp_memcpy(sc->nsc_pi->pi_vmctx, prp1, prp2, + buf + offset, bytes, dir)) + pci_nvme_status_genc(&status, + NVME_SC_DATA_TRANSFER_ERROR); + else + pci_nvme_status_genc(&status, NVME_SC_SUCCESS); + + return (status); +} + +static uint16_t +nvme_write_read_blockif(struct pci_nvme_softc *sc, + struct pci_nvme_blockstore *nvstore, + struct pci_nvme_ioreq *req, + uint64_t prp1, uint64_t prp2, + size_t offset, uint64_t bytes, + bool is_write) +{ + uint64_t size; + int err; + uint16_t status = NVME_NO_STATUS; + + size = MIN(PAGE_SIZE - (prp1 % PAGE_SIZE), bytes); + if (pci_nvme_append_iov_req(sc, req, prp1, + size, is_write, offset)) { + pci_nvme_status_genc(&status, + NVME_SC_DATA_TRANSFER_ERROR); + goto out; + } + + offset += size; + bytes -= size; + + if (bytes == 0) { + ; + } else if (bytes <= PAGE_SIZE) { + size = bytes; + if (pci_nvme_append_iov_req(sc, req, prp2, + size, is_write, offset)) { + pci_nvme_status_genc(&status, + NVME_SC_DATA_TRANSFER_ERROR); + goto out; + } + } else { + void *vmctx = sc->nsc_pi->pi_vmctx; + uint64_t *prp_list = &prp2; + uint64_t *last = prp_list; + + /* PRP2 is pointer to a physical region page list */ + while (bytes) { + /* Last entry in list points to the next list */ + if (prp_list == last) { + uint64_t prp = *prp_list; + + prp_list = paddr_guest2host(vmctx, prp, + PAGE_SIZE - (prp % PAGE_SIZE)); + last = prp_list + (NVME_PRP2_ITEMS - 1); + } + + size = MIN(bytes, PAGE_SIZE); + + if (pci_nvme_append_iov_req(sc, req, *prp_list, + size, is_write, offset)) { + pci_nvme_status_genc(&status, + NVME_SC_DATA_TRANSFER_ERROR); + goto out; + } + + offset += size; + bytes -= size; + + prp_list++; + } + } + req->io_req.br_callback = pci_nvme_io_done; + if (is_write) + err = blockif_write(nvstore->ctx, &req->io_req); + else + err = blockif_read(nvstore->ctx, &req->io_req); + + if (err) + pci_nvme_status_genc(&status, NVME_SC_DATA_TRANSFER_ERROR); +out: + return (status); +} + static bool nvme_opc_write_read(struct pci_nvme_softc *sc, struct nvme_command *cmd, @@ -1713,85 +1815,13 @@ nvme_opc_write_read(struct pci_nvme_softc *sc, cmd->prp2 &= ~0x3UL; if (nvstore->type == NVME_STOR_RAM) { - uint8_t *buf = nvstore->ctx; - enum nvme_copy_dir dir; - - if (is_write) - dir = NVME_COPY_TO_PRP; - else - dir = NVME_COPY_FROM_PRP; - - if (nvme_prp_memcpy(sc->nsc_pi->pi_vmctx, cmd->prp1, cmd->prp2, - buf + offset, bytes, dir)) - pci_nvme_status_genc(status, - NVME_SC_DATA_TRANSFER_ERROR); - else - pci_nvme_status_genc(status, NVME_SC_SUCCESS); + *status = nvme_write_read_ram(sc, nvstore, cmd->prp1, + cmd->prp2, offset, bytes, is_write); } else { - uint64_t size; - int err; + *status = nvme_write_read_blockif(sc, nvstore, req, + cmd->prp1, cmd->prp2, offset, bytes, is_write); - size = MIN(PAGE_SIZE - (cmd->prp1 % PAGE_SIZE), bytes); - if (pci_nvme_append_iov_req(sc, req, cmd->prp1, - size, is_write, offset)) { - pci_nvme_status_genc(status, - NVME_SC_DATA_TRANSFER_ERROR); - goto out; - } - - offset += size; - bytes -= size; - - if (bytes == 0) { - ; - } else if (bytes <= PAGE_SIZE) { - size = bytes; - if (pci_nvme_append_iov_req(sc, req, cmd->prp2, - size, is_write, offset)) { - pci_nvme_status_genc(status, - NVME_SC_DATA_TRANSFER_ERROR); - goto out; - } - } else { - void *vmctx = sc->nsc_pi->pi_vmctx; - uint64_t *prp_list = &cmd->prp2; - uint64_t *last = prp_list; - - /* PRP2 is pointer to a physical region page list */ - while (bytes) { - /* Last entry in list points to the next list */ - if (prp_list == last) { - uint64_t prp = *prp_list; - - prp_list = paddr_guest2host(vmctx, prp, - PAGE_SIZE - (prp % PAGE_SIZE)); - last = prp_list + (NVME_PRP2_ITEMS - 1); - } - - size = MIN(bytes, PAGE_SIZE); - - if (pci_nvme_append_iov_req(sc, req, *prp_list, - size, is_write, offset)) { - pci_nvme_status_genc(status, - NVME_SC_DATA_TRANSFER_ERROR); - goto out; - } - - offset += size; - bytes -= size; - - prp_list++; - } - } - req->io_req.br_callback = pci_nvme_io_done; - if (is_write) - err = blockif_write(nvstore->ctx, &req->io_req); - else - err = blockif_read(nvstore->ctx, &req->io_req); - - if (err) - pci_nvme_status_genc(status, NVME_SC_DATA_TRANSFER_ERROR); - else + if (*status == NVME_NO_STATUS) pending = true; } out: From owner-svn-src-all@freebsd.org Sun Jul 19 23:40:35 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 291BE36DB0D; Sun, 19 Jul 2020 23:40:35 +0000 (UTC) (envelope-from chuck@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4B91ZC0F8Qz4CSX; Sun, 19 Jul 2020 23:40:35 +0000 (UTC) (envelope-from chuck@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E0FD823BE5; Sun, 19 Jul 2020 23:40:34 +0000 (UTC) (envelope-from chuck@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06JNeYAZ065315; Sun, 19 Jul 2020 23:40:34 GMT (envelope-from chuck@FreeBSD.org) Received: (from chuck@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06JNeY8u065314; Sun, 19 Jul 2020 23:40:34 GMT (envelope-from chuck@FreeBSD.org) Message-Id: <202007192340.06JNeY8u065314@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: chuck set sender to chuck@FreeBSD.org using -f From: Chuck Tuffli Date: Sun, 19 Jul 2020 23:40:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r363347 - stable/12/usr.sbin/bhyve X-SVN-Group: stable-12 X-SVN-Commit-Author: chuck X-SVN-Commit-Paths: stable/12/usr.sbin/bhyve X-SVN-Commit-Revision: 363347 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 19 Jul 2020 23:40:35 -0000 Author: chuck Date: Sun Jul 19 23:40:34 2020 New Revision: 363347 URL: https://svnweb.freebsd.org/changeset/base/363347 Log: MFC r362757 bhyve: base pci_nvme_ioreq size on advertised MDTS Modified: stable/12/usr.sbin/bhyve/pci_nvme.c Directory Properties: stable/12/ (props changed) Modified: stable/12/usr.sbin/bhyve/pci_nvme.c ============================================================================== --- stable/12/usr.sbin/bhyve/pci_nvme.c Sun Jul 19 23:37:19 2020 (r363346) +++ stable/12/usr.sbin/bhyve/pci_nvme.c Sun Jul 19 23:40:34 2020 (r363347) @@ -99,9 +99,16 @@ static int nvme_debug = 0; #define NVME_QUEUES 16 #define NVME_MAX_QENTRIES 2048 +/* Memory Page size Minimum reported in CAP register */ +#define NVME_MPSMIN 0 +/* MPSMIN converted to bytes */ +#define NVME_MPSMIN_BYTES (1 << (12 + NVME_MPSMIN)) #define NVME_PRP2_ITEMS (PAGE_SIZE/sizeof(uint64_t)) -#define NVME_MAX_BLOCKIOVS 512 +#define NVME_MDTS 9 +/* Note the + 1 allows for the initial descriptor to not be page aligned */ +#define NVME_MAX_IOVEC ((1 << NVME_MDTS) + 1) +#define NVME_MAX_DATA_SIZE ((1 << NVME_MDTS) * NVME_MPSMIN_BYTES) /* This is a synthetic status code to indicate there is no status */ #define NVME_NO_STATUS 0xffff @@ -186,6 +193,18 @@ struct pci_nvme_blockstore { uint32_t deallocate:1; }; +/* + * Calculate the number of additional page descriptors for guest IO requests + * based on the advertised Max Data Transfer (MDTS) and given the number of + * default iovec's in a struct blockif_req. + * + * Note the + 1 allows for the initial descriptor to not be page aligned. + */ +#define MDTS_PAD_SIZE \ + NVME_MAX_IOVEC > BLOCKIF_IOV_MAX ? \ + NVME_MAX_IOVEC - BLOCKIF_IOV_MAX : \ + 0 + struct pci_nvme_ioreq { struct pci_nvme_softc *sc; STAILQ_ENTRY(pci_nvme_ioreq) link; @@ -200,17 +219,9 @@ struct pci_nvme_ioreq { uint64_t prev_gpaddr; size_t prev_size; - /* - * lock if all iovs consumed (big IO); - * complete transaction before continuing - */ - pthread_mutex_t mtx; - pthread_cond_t cv; - struct blockif_req io_req; - /* pad to fit up to 512 page descriptors from guest IO request */ - struct iovec iovpadding[NVME_MAX_BLOCKIOVS-BLOCKIF_IOV_MAX]; + struct iovec iovpadding[MDTS_PAD_SIZE]; }; enum nvme_dsm_type { @@ -279,7 +290,6 @@ struct pci_nvme_softc { }; -static void pci_nvme_io_partial(struct blockif_req *br, int err); static struct pci_nvme_ioreq *pci_nvme_get_ioreq(struct pci_nvme_softc *); static void pci_nvme_release_ioreq(struct pci_nvme_softc *, struct pci_nvme_ioreq *); static void pci_nvme_io_done(struct blockif_req *, int); @@ -433,7 +443,7 @@ pci_nvme_init_ctrldata(struct pci_nvme_softc *sc) cd->mic = 0; - cd->mdts = 9; /* max data transfer size (2^mdts * CAP.MPSMIN) */ + cd->mdts = NVME_MDTS; /* max data transfer size (2^mdts * CAP.MPSMIN) */ cd->ver = 0x00010300; @@ -1460,81 +1470,46 @@ pci_nvme_append_iov_req(struct pci_nvme_softc *sc, str { int iovidx; - if (req != NULL) { - /* concatenate contig block-iovs to minimize number of iovs */ - if ((req->prev_gpaddr + req->prev_size) == gpaddr) { - iovidx = req->io_req.br_iovcnt - 1; + if (req == NULL) + return (-1); - req->io_req.br_iov[iovidx].iov_base = - paddr_guest2host(req->sc->nsc_pi->pi_vmctx, - req->prev_gpaddr, size); + if (req->io_req.br_iovcnt == NVME_MAX_IOVEC) { + return (-1); + } - req->prev_size += size; - req->io_req.br_resid += size; + /* concatenate contig block-iovs to minimize number of iovs */ + if ((req->prev_gpaddr + req->prev_size) == gpaddr) { + iovidx = req->io_req.br_iovcnt - 1; - req->io_req.br_iov[iovidx].iov_len = req->prev_size; - } else { - pthread_mutex_lock(&req->mtx); + req->io_req.br_iov[iovidx].iov_base = + paddr_guest2host(req->sc->nsc_pi->pi_vmctx, + req->prev_gpaddr, size); - iovidx = req->io_req.br_iovcnt; - if (iovidx == NVME_MAX_BLOCKIOVS) { - int err = 0; + req->prev_size += size; + req->io_req.br_resid += size; - DPRINTF("large I/O, doing partial req"); + req->io_req.br_iov[iovidx].iov_len = req->prev_size; + } else { + iovidx = req->io_req.br_iovcnt; + if (iovidx == 0) { + req->io_req.br_offset = lba; + req->io_req.br_resid = 0; + req->io_req.br_param = req; + } - iovidx = 0; - req->io_req.br_iovcnt = 0; + req->io_req.br_iov[iovidx].iov_base = + paddr_guest2host(req->sc->nsc_pi->pi_vmctx, + gpaddr, size); - req->io_req.br_callback = pci_nvme_io_partial; + req->io_req.br_iov[iovidx].iov_len = size; - if (!do_write) - err = blockif_read(sc->nvstore.ctx, - &req->io_req); - else - err = blockif_write(sc->nvstore.ctx, - &req->io_req); + req->prev_gpaddr = gpaddr; + req->prev_size = size; + req->io_req.br_resid += size; - /* wait until req completes before cont */ - if (err == 0) - pthread_cond_wait(&req->cv, &req->mtx); - } - if (iovidx == 0) { - req->io_req.br_offset = lba; - req->io_req.br_resid = 0; - req->io_req.br_param = req; - } - - req->io_req.br_iov[iovidx].iov_base = - paddr_guest2host(req->sc->nsc_pi->pi_vmctx, - gpaddr, size); - - req->io_req.br_iov[iovidx].iov_len = size; - - req->prev_gpaddr = gpaddr; - req->prev_size = size; - req->io_req.br_resid += size; - - req->io_req.br_iovcnt++; - - pthread_mutex_unlock(&req->mtx); - } - } else { - /* RAM buffer: read/write directly */ - void *p = sc->nvstore.ctx; - void *gptr; - - if ((lba + size) > sc->nvstore.size) { - WPRINTF("%s write would overflow RAM", __func__); - return (-1); - } - - p = (void *)((uintptr_t)p + (uintptr_t)lba); - gptr = paddr_guest2host(sc->nsc_pi->pi_vmctx, gpaddr, size); - if (do_write) - memcpy(p, gptr, size); - else - memcpy(gptr, p, size); + req->io_req.br_iovcnt++; } + return (0); } @@ -1632,16 +1607,6 @@ pci_nvme_io_done(struct blockif_req *br, int err) pci_nvme_release_ioreq(req->sc, req); } -static void -pci_nvme_io_partial(struct blockif_req *br, int err) -{ - struct pci_nvme_ioreq *req = br->br_param; - - DPRINTF("%s error %d %s", __func__, err, strerror(err)); - - pthread_cond_signal(&req->cv); -} - /* * Implements the Flush command. The specification states: * If a volatile write cache is not present, Flush commands complete @@ -1799,9 +1764,14 @@ nvme_opc_write_read(struct pci_nvme_softc *sc, lba = ((uint64_t)cmd->cdw11 << 32) | cmd->cdw10; nblocks = (cmd->cdw12 & 0xFFFF) + 1; - offset = lba * nvstore->sectsz; bytes = nblocks * nvstore->sectsz; + if (bytes > NVME_MAX_DATA_SIZE) { + WPRINTF("%s command would exceed MDTS", __func__); + pci_nvme_status_genc(status, NVME_SC_INVALID_FIELD); + goto out; + } + offset = lba * nvstore->sectsz; if ((offset + bytes) > nvstore->size) { WPRINTF("%s command would exceed LBA range", __func__); pci_nvme_status_genc(status, NVME_SC_LBA_OUT_OF_RANGE); @@ -2478,8 +2448,6 @@ pci_nvme_init(struct vmctx *ctx, struct pci_devinst *p sc->ioreqs = calloc(sc->ioslots, sizeof(struct pci_nvme_ioreq)); for (int i = 0; i < sc->ioslots; i++) { STAILQ_INSERT_TAIL(&sc->ioreqs_free, &sc->ioreqs[i], link); - pthread_mutex_init(&sc->ioreqs[i].mtx, NULL); - pthread_cond_init(&sc->ioreqs[i].cv, NULL); } pci_set_cfgdata16(pi, PCIR_DEVICE, 0x0A0A); From owner-svn-src-all@freebsd.org Sun Jul 19 23:42:46 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id F104E36D9ED; Sun, 19 Jul 2020 23:42:46 +0000 (UTC) (envelope-from chuck@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4B91ck69DDz4CjN; Sun, 19 Jul 2020 23:42:46 +0000 (UTC) (envelope-from chuck@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B6F0623ABC; Sun, 19 Jul 2020 23:42:46 +0000 (UTC) (envelope-from chuck@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06JNgk38071038; Sun, 19 Jul 2020 23:42:46 GMT (envelope-from chuck@FreeBSD.org) Received: (from chuck@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06JNgk6C071037; Sun, 19 Jul 2020 23:42:46 GMT (envelope-from chuck@FreeBSD.org) Message-Id: <202007192342.06JNgk6C071037@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: chuck set sender to chuck@FreeBSD.org using -f From: Chuck Tuffli Date: Sun, 19 Jul 2020 23:42:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r363348 - stable/12/usr.sbin/bhyve X-SVN-Group: stable-12 X-SVN-Commit-Author: chuck X-SVN-Commit-Paths: stable/12/usr.sbin/bhyve X-SVN-Commit-Revision: 363348 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 19 Jul 2020 23:42:47 -0000 Author: chuck Date: Sun Jul 19 23:42:46 2020 New Revision: 363348 URL: https://svnweb.freebsd.org/changeset/base/363348 Log: MFC r362758 bhyve: validate NVMe deallocate range values Modified: stable/12/usr.sbin/bhyve/pci_nvme.c Directory Properties: stable/12/ (props changed) Modified: stable/12/usr.sbin/bhyve/pci_nvme.c ============================================================================== --- stable/12/usr.sbin/bhyve/pci_nvme.c Sun Jul 19 23:40:34 2020 (r363347) +++ stable/12/usr.sbin/bhyve/pci_nvme.c Sun Jul 19 23:42:46 2020 (r363348) @@ -1876,6 +1876,11 @@ nvme_opc_dataset_mgmt(struct pci_nvme_softc *sc, nvme_prp_memcpy(sc->nsc_pi->pi_vmctx, cmd->prp1, cmd->prp2, (uint8_t *)range, NVME_MAX_DSM_TRIM, NVME_COPY_FROM_PRP); + if ((range[0].starting_lba * sectsz) > nvstore->size) { + pci_nvme_status_genc(status, NVME_SC_LBA_OUT_OF_RANGE); + goto out; + } + /* * If the request is for more than a single range, store * the ranges in the br_iov. Optimize for the common case @@ -1895,6 +1900,10 @@ nvme_opc_dataset_mgmt(struct pci_nvme_softc *sc, struct iovec *iov = req->io_req.br_iov; for (r = 0; r <= nr; r++) { + if ((range[r].starting_lba * sectsz) > nvstore->size) { + pci_nvme_status_genc(status, NVME_SC_LBA_OUT_OF_RANGE); + goto out; + } iov[r].iov_base = (void *)(range[r].starting_lba * sectsz); iov[r].iov_len = range[r].length * sectsz; } From owner-svn-src-all@freebsd.org Sun Jul 19 23:45:49 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E4BC036DC70; Sun, 19 Jul 2020 23:45:49 +0000 (UTC) (envelope-from chuck@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4B91hF53hZz4CxM; Sun, 19 Jul 2020 23:45:49 +0000 (UTC) (envelope-from chuck@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 90D7023D9A; Sun, 19 Jul 2020 23:45:49 +0000 (UTC) (envelope-from chuck@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06JNjnPL071269; Sun, 19 Jul 2020 23:45:49 GMT (envelope-from chuck@FreeBSD.org) Received: (from chuck@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06JNjnau071268; Sun, 19 Jul 2020 23:45:49 GMT (envelope-from chuck@FreeBSD.org) Message-Id: <202007192345.06JNjnau071268@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: chuck set sender to chuck@FreeBSD.org using -f From: Chuck Tuffli Date: Sun, 19 Jul 2020 23:45:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r363349 - stable/12/usr.sbin/bhyve X-SVN-Group: stable-12 X-SVN-Commit-Author: chuck X-SVN-Commit-Paths: stable/12/usr.sbin/bhyve X-SVN-Commit-Revision: 363349 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 19 Jul 2020 23:45:50 -0000 Author: chuck Date: Sun Jul 19 23:45:49 2020 New Revision: 363349 URL: https://svnweb.freebsd.org/changeset/base/363349 Log: MFC r362759 bhyve: implement NVMe SMART data I/O statistics Modified: stable/12/usr.sbin/bhyve/pci_nvme.c Directory Properties: stable/12/ (props changed) Modified: stable/12/usr.sbin/bhyve/pci_nvme.c ============================================================================== --- stable/12/usr.sbin/bhyve/pci_nvme.c Sun Jul 19 23:42:46 2020 (r363348) +++ stable/12/usr.sbin/bhyve/pci_nvme.c Sun Jul 19 23:45:49 2020 (r363349) @@ -218,6 +218,7 @@ struct pci_nvme_ioreq { uint64_t prev_gpaddr; size_t prev_size; + size_t bytes; struct blockif_req io_req; @@ -287,6 +288,14 @@ struct pci_nvme_softc { struct nvme_feature_obj feat[NVME_FID_MAX]; enum nvme_dsm_type dataset_management; + + /* Accounting for SMART data */ + __uint128_t read_data_units; + __uint128_t write_data_units; + __uint128_t read_commands; + __uint128_t write_commands; + uint32_t read_dunits_remainder; + uint32_t write_dunits_remainder; }; @@ -576,6 +585,10 @@ pci_nvme_init_logpages(struct pci_nvme_softc *sc) memset(&sc->err_log, 0, sizeof(sc->err_log)); memset(&sc->health_log, 0, sizeof(sc->health_log)); memset(&sc->fw_log, 0, sizeof(sc->fw_log)); + + /* Set read/write remainder to round up according to spec */ + sc->read_dunits_remainder = 999; + sc->write_dunits_remainder = 999; } static void @@ -961,7 +974,17 @@ nvme_opc_get_log_page(struct pci_nvme_softc* sc, struc NVME_COPY_TO_PRP); break; case NVME_LOG_HEALTH_INFORMATION: - /* TODO: present some smart info */ + pthread_mutex_lock(&sc->mtx); + memcpy(&sc->health_log.data_units_read, &sc->read_data_units, + sizeof(sc->health_log.data_units_read)); + memcpy(&sc->health_log.data_units_written, &sc->write_data_units, + sizeof(sc->health_log.data_units_written)); + memcpy(&sc->health_log.host_read_commands, &sc->read_commands, + sizeof(sc->health_log.host_read_commands)); + memcpy(&sc->health_log.host_write_commands, &sc->write_commands, + sizeof(sc->health_log.host_write_commands)); + pthread_mutex_unlock(&sc->mtx); + nvme_prp_memcpy(sc->nsc_pi->pi_vmctx, command->prp1, command->prp2, (uint8_t *)&sc->health_log, MIN(logsize, sizeof(sc->health_log)), @@ -1464,6 +1487,47 @@ pci_nvme_handle_admin_cmd(struct pci_nvme_softc* sc, u pthread_mutex_unlock(&sq->mtx); } +/* + * Update the Write and Read statistics reported in SMART data + * + * NVMe defines "data unit" as thousand's of 512 byte blocks and is rounded up. + * E.g. 1 data unit is 1 - 1,000 512 byte blocks. 3 data units are 2,001 - 3,000 + * 512 byte blocks. Rounding up is acheived by initializing the remainder to 999. + */ +static void +pci_nvme_stats_write_read_update(struct pci_nvme_softc *sc, uint8_t opc, + size_t bytes, uint16_t status) +{ + + pthread_mutex_lock(&sc->mtx); + switch (opc) { + case NVME_OPC_WRITE: + sc->write_commands++; + if (status != NVME_SC_SUCCESS) + break; + sc->write_dunits_remainder += (bytes / 512); + while (sc->write_dunits_remainder >= 1000) { + sc->write_data_units++; + sc->write_dunits_remainder -= 1000; + } + break; + case NVME_OPC_READ: + sc->read_commands++; + if (status != NVME_SC_SUCCESS) + break; + sc->read_dunits_remainder += (bytes / 512); + while (sc->read_dunits_remainder >= 1000) { + sc->read_data_units++; + sc->read_dunits_remainder -= 1000; + } + break; + default: + DPRINTF("%s: Invalid OPC 0x%02x for stats", __func__, opc); + break; + } + pthread_mutex_unlock(&sc->mtx); +} + static int pci_nvme_append_iov_req(struct pci_nvme_softc *sc, struct pci_nvme_ioreq *req, uint64_t gpaddr, size_t size, int do_write, uint64_t lba) @@ -1604,6 +1668,8 @@ pci_nvme_io_done(struct blockif_req *br, int err) pci_nvme_status_genc(&status, code); pci_nvme_set_completion(req->sc, sq, req->sqid, req->cid, 0, status); + pci_nvme_stats_write_read_update(req->sc, req->opc, + req->bytes, status); pci_nvme_release_ioreq(req->sc, req); } @@ -1778,6 +1844,7 @@ nvme_opc_write_read(struct pci_nvme_softc *sc, goto out; } + req->bytes = bytes; req->io_req.br_offset = lba; /* PRP bits 1:0 must be zero */ @@ -1795,6 +1862,9 @@ nvme_opc_write_read(struct pci_nvme_softc *sc, pending = true; } out: + if (!pending) + pci_nvme_stats_write_read_update(sc, cmd->opc, bytes, *status); + return (pending); } From owner-svn-src-all@freebsd.org Sun Jul 19 23:54:03 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1157E36DEA8; Sun, 19 Jul 2020 23:54:03 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4B91sk6jNKz4DFN; Sun, 19 Jul 2020 23:54:02 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CA0A423E9A; Sun, 19 Jul 2020 23:54:02 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06JNs2kE077345; Sun, 19 Jul 2020 23:54:02 GMT (envelope-from sjg@FreeBSD.org) Received: (from sjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06JNs0gw077337; Sun, 19 Jul 2020 23:54:00 GMT (envelope-from sjg@FreeBSD.org) Message-Id: <202007192354.06JNs0gw077337@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sjg set sender to sjg@FreeBSD.org using -f From: "Simon J. Gerraty" Date: Sun, 19 Jul 2020 23:54:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363350 - in head: lib/libbearssl lib/libc lib/libsecureboot libexec/dma/dmagent libexec/rc/rc.d sbin/veriexec stand/efi/loader stand/i386/loader usr.bin/bmake/unit-tests X-SVN-Group: head X-SVN-Commit-Author: sjg X-SVN-Commit-Paths: in head: lib/libbearssl lib/libc lib/libsecureboot libexec/dma/dmagent libexec/rc/rc.d sbin/veriexec stand/efi/loader stand/i386/loader usr.bin/bmake/unit-tests X-SVN-Commit-Revision: 363350 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 19 Jul 2020 23:54:03 -0000 Author: sjg Date: Sun Jul 19 23:54:00 2020 New Revision: 363350 URL: https://svnweb.freebsd.org/changeset/base/363350 Log: Oops missed Makefile.config Added: head/usr.bin/bmake/unit-tests/Makefile.config (contents, props changed) Modified: head/lib/libbearssl/Makefile.depend head/lib/libc/Makefile head/lib/libsecureboot/local.trust.mk head/libexec/dma/dmagent/Makefile.depend head/libexec/rc/rc.d/tmp head/sbin/veriexec/Makefile.depend head/stand/efi/loader/Makefile head/stand/i386/loader/Makefile Modified: head/lib/libbearssl/Makefile.depend ============================================================================== --- head/lib/libbearssl/Makefile.depend Sun Jul 19 23:45:49 2020 (r363349) +++ head/lib/libbearssl/Makefile.depend Sun Jul 19 23:54:00 2020 (r363350) @@ -2,7 +2,6 @@ # Autogenerated - do NOT edit! DIRDEPS = \ - gnu/lib/csu \ include \ include/xlocale \ lib/${CSU_DIR} \ Modified: head/lib/libc/Makefile ============================================================================== --- head/lib/libc/Makefile Sun Jul 19 23:45:49 2020 (r363349) +++ head/lib/libc/Makefile Sun Jul 19 23:54:00 2020 (r363350) @@ -186,7 +186,7 @@ SUBDIR.${MK_TESTS}+= tests .if (${LIBC_ARCH} == amd64 || ${LIBC_ARCH} == i386) && \ ${.TARGETS:Mall} == all && \ defined(LINKER_FEATURES) && ${LINKER_FEATURES:Mifunc} == "" -.error ${LIBC_ARCH} libc requires linker ifunc support +#.error ${LIBC_ARCH} libc requires linker ifunc support .endif .if !defined(_SKIP_BUILD) Modified: head/lib/libsecureboot/local.trust.mk ============================================================================== --- head/lib/libsecureboot/local.trust.mk Sun Jul 19 23:45:49 2020 (r363349) +++ head/lib/libsecureboot/local.trust.mk Sun Jul 19 23:54:00 2020 (r363350) @@ -8,6 +8,9 @@ # force these for Junos #MANIFEST_SKIP_ALWAYS= boot +MANIFEST_SKIP= boot +XCFLAGS.veopen+= -DMANIFEST_SKIP_MAYBE=\"${MANIFEST_SKIP}\" + VE_HASH_LIST= \ SHA1 \ SHA256 \ @@ -37,6 +40,7 @@ VE_SIGNATURE_EXT_LIST+= \ VE_SIGNATURE_LIST+= OPENPGP VE_SIGNATURE_EXT_LIST+= asc +PYTHON ?= /usr/local/bin/python SIGNER ?= ${SB_TOOLS_PATH:U/volume/buildtools/bin}/sign.py .if exists(${SIGNER}) @@ -99,7 +103,7 @@ ta.h: vc_rsa.pem .endif # we take the mtime of this as our baseline time -#BUILD_UTC_FILE= ecerts.pem +BUILD_UTC_FILE= ecerts.pem #VE_DEBUG_LEVEL=3 #VE_VERBOSE_DEFAULT=1 Modified: head/libexec/dma/dmagent/Makefile.depend ============================================================================== --- head/libexec/dma/dmagent/Makefile.depend Sun Jul 19 23:45:49 2020 (r363349) +++ head/libexec/dma/dmagent/Makefile.depend Sun Jul 19 23:54:00 2020 (r363350) @@ -2,7 +2,6 @@ # Autogenerated - do NOT edit! DIRDEPS = \ - gnu/lib/csu \ include \ include/arpa \ include/xlocale \ @@ -11,7 +10,6 @@ DIRDEPS = \ lib/libcompiler_rt \ secure/lib/libcrypto \ secure/lib/libssl \ - usr.bin/yacc.host \ .include Modified: head/libexec/rc/rc.d/tmp ============================================================================== --- head/libexec/rc/rc.d/tmp Sun Jul 19 23:45:49 2020 (r363349) +++ head/libexec/rc/rc.d/tmp Sun Jul 19 23:54:00 2020 (r363350) @@ -41,6 +41,9 @@ load_rc_config $name mount_tmpmfs() { if ! /bin/df /tmp | grep -q "^/dev/md[0-9].* /tmp"; then + if test -w /tmp/. && checkyesno tmpmfs_clear_mnt; then + (cd /tmp/. && rm -rf .* *) + fi mount_md ${tmpsize} /tmp "${tmpmfs_flags}" chmod 01777 /tmp fi Modified: head/sbin/veriexec/Makefile.depend ============================================================================== --- head/sbin/veriexec/Makefile.depend Sun Jul 19 23:45:49 2020 (r363349) +++ head/sbin/veriexec/Makefile.depend Sun Jul 19 23:54:00 2020 (r363350) @@ -2,7 +2,6 @@ # Autogenerated - do NOT edit! DIRDEPS = \ - gnu/lib/csu \ include \ include/xlocale \ lib/${CSU_DIR} \ @@ -11,6 +10,7 @@ DIRDEPS = \ lib/libcompiler_rt \ lib/libsecureboot \ lib/libveriexec \ + usr.bin/yacc.host \ .include Modified: head/stand/efi/loader/Makefile ============================================================================== --- head/stand/efi/loader/Makefile Sun Jul 19 23:45:49 2020 (r363349) +++ head/stand/efi/loader/Makefile Sun Jul 19 23:54:00 2020 (r363350) @@ -102,3 +102,8 @@ DPADD= ${LDR_INTERP} ${LIBEFI} ${LIBFDT} ${LIBEFI_FDT LDADD= ${LDR_INTERP} ${LIBEFI} ${LIBFDT} ${LIBEFI_FDT} ${LIBSA} .include + +PATH_BOOTABLE_TOKEN=/boot/boot.4th +CFLAGS+= ${XCFLAGS.${.TARGET:T:R}:U} +XCFLAGS.main+= -DPATH_BOOTABLE_TOKEN=\"${PATH_BOOTABLE_TOKEN}\" + Modified: head/stand/i386/loader/Makefile ============================================================================== --- head/stand/i386/loader/Makefile Sun Jul 19 23:45:49 2020 (r363349) +++ head/stand/i386/loader/Makefile Sun Jul 19 23:54:00 2020 (r363350) @@ -1,5 +1,5 @@ # $FreeBSD$ - +.if 0 HAVE_ZFS= ${MK_LOADER_ZFS} LOADER_NET_SUPPORT?= yes @@ -11,6 +11,10 @@ LOADER_MSDOS_SUPPORT?= yes LOADER_UFS_SUPPORT?= yes LOADER_GZIP_SUPPORT?= yes LOADER_BZIP2_SUPPORT?= yes +.else +LOADER_NET_SUPPORT?= yes +LOADER_UFS_SUPPORT?= yes +.endif .include @@ -56,8 +60,8 @@ LIBI386= ${BOOTOBJ}/i386/libi386/libi386.a CFLAGS+= -I${BOOTSRC}/i386 # Debug me! -#CFLAGS+= -g -#LDFLAGS+= -g +CFLAGS+= -g +LDFLAGS+= -g ${LOADER}: ${LOADER}.bin ${BTXLDR} ${BTXKERN} btxld -v -f aout -e ${LOADER_ADDRESS} -o ${.TARGET} -l ${BTXLDR} \ Added: head/usr.bin/bmake/unit-tests/Makefile.config ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/bmake/unit-tests/Makefile.config Sun Jul 19 23:54:00 2020 (r363350) @@ -0,0 +1,11 @@ +# This is a generated file, do NOT edit! +# See contrib/bmake/bsd.after-import.mk +# +# $FreeBSD$ + +SRCTOP?= ${.CURDIR:H:H:H} + +# $Id: Makefile.config.in,v 1.1 2018/12/30 17:14:24 sjg Exp $ + +srcdir= ${SRCTOP}/contrib/bmake/unit-tests +DIFF_FLAGS?= -u From owner-svn-src-all@freebsd.org Sun Jul 19 23:56:21 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D83A336DE20; Sun, 19 Jul 2020 23:56:21 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4B91wP5MNRz4Dfn; Sun, 19 Jul 2020 23:56:21 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9701C23A7B; Sun, 19 Jul 2020 23:56:21 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06JNuLue077541; Sun, 19 Jul 2020 23:56:21 GMT (envelope-from sjg@FreeBSD.org) Received: (from sjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06JNuJJN077533; Sun, 19 Jul 2020 23:56:19 GMT (envelope-from sjg@FreeBSD.org) Message-Id: <202007192356.06JNuJJN077533@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sjg set sender to sjg@FreeBSD.org using -f From: "Simon J. Gerraty" Date: Sun, 19 Jul 2020 23:56:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363351 - in head: lib/libbearssl lib/libc lib/libsecureboot libexec/dma/dmagent libexec/rc/rc.d sbin/veriexec stand/efi/loader stand/i386/loader X-SVN-Group: head X-SVN-Commit-Author: sjg X-SVN-Commit-Paths: in head: lib/libbearssl lib/libc lib/libsecureboot libexec/dma/dmagent libexec/rc/rc.d sbin/veriexec stand/efi/loader stand/i386/loader X-SVN-Commit-Revision: 363351 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 19 Jul 2020 23:56:21 -0000 Author: sjg Date: Sun Jul 19 23:56:19 2020 New Revision: 363351 URL: https://svnweb.freebsd.org/changeset/base/363351 Log: Revert that! Modified: head/lib/libbearssl/Makefile.depend head/lib/libc/Makefile head/lib/libsecureboot/local.trust.mk head/libexec/dma/dmagent/Makefile.depend head/libexec/rc/rc.d/tmp head/sbin/veriexec/Makefile.depend head/stand/efi/loader/Makefile head/stand/i386/loader/Makefile Modified: head/lib/libbearssl/Makefile.depend ============================================================================== --- head/lib/libbearssl/Makefile.depend Sun Jul 19 23:54:00 2020 (r363350) +++ head/lib/libbearssl/Makefile.depend Sun Jul 19 23:56:19 2020 (r363351) @@ -2,6 +2,7 @@ # Autogenerated - do NOT edit! DIRDEPS = \ + gnu/lib/csu \ include \ include/xlocale \ lib/${CSU_DIR} \ Modified: head/lib/libc/Makefile ============================================================================== --- head/lib/libc/Makefile Sun Jul 19 23:54:00 2020 (r363350) +++ head/lib/libc/Makefile Sun Jul 19 23:56:19 2020 (r363351) @@ -186,7 +186,7 @@ SUBDIR.${MK_TESTS}+= tests .if (${LIBC_ARCH} == amd64 || ${LIBC_ARCH} == i386) && \ ${.TARGETS:Mall} == all && \ defined(LINKER_FEATURES) && ${LINKER_FEATURES:Mifunc} == "" -#.error ${LIBC_ARCH} libc requires linker ifunc support +.error ${LIBC_ARCH} libc requires linker ifunc support .endif .if !defined(_SKIP_BUILD) Modified: head/lib/libsecureboot/local.trust.mk ============================================================================== --- head/lib/libsecureboot/local.trust.mk Sun Jul 19 23:54:00 2020 (r363350) +++ head/lib/libsecureboot/local.trust.mk Sun Jul 19 23:56:19 2020 (r363351) @@ -8,9 +8,6 @@ # force these for Junos #MANIFEST_SKIP_ALWAYS= boot -MANIFEST_SKIP= boot -XCFLAGS.veopen+= -DMANIFEST_SKIP_MAYBE=\"${MANIFEST_SKIP}\" - VE_HASH_LIST= \ SHA1 \ SHA256 \ @@ -40,7 +37,6 @@ VE_SIGNATURE_EXT_LIST+= \ VE_SIGNATURE_LIST+= OPENPGP VE_SIGNATURE_EXT_LIST+= asc -PYTHON ?= /usr/local/bin/python SIGNER ?= ${SB_TOOLS_PATH:U/volume/buildtools/bin}/sign.py .if exists(${SIGNER}) @@ -103,7 +99,7 @@ ta.h: vc_rsa.pem .endif # we take the mtime of this as our baseline time -BUILD_UTC_FILE= ecerts.pem +#BUILD_UTC_FILE= ecerts.pem #VE_DEBUG_LEVEL=3 #VE_VERBOSE_DEFAULT=1 Modified: head/libexec/dma/dmagent/Makefile.depend ============================================================================== --- head/libexec/dma/dmagent/Makefile.depend Sun Jul 19 23:54:00 2020 (r363350) +++ head/libexec/dma/dmagent/Makefile.depend Sun Jul 19 23:56:19 2020 (r363351) @@ -2,6 +2,7 @@ # Autogenerated - do NOT edit! DIRDEPS = \ + gnu/lib/csu \ include \ include/arpa \ include/xlocale \ @@ -10,6 +11,7 @@ DIRDEPS = \ lib/libcompiler_rt \ secure/lib/libcrypto \ secure/lib/libssl \ + usr.bin/yacc.host \ .include Modified: head/libexec/rc/rc.d/tmp ============================================================================== --- head/libexec/rc/rc.d/tmp Sun Jul 19 23:54:00 2020 (r363350) +++ head/libexec/rc/rc.d/tmp Sun Jul 19 23:56:19 2020 (r363351) @@ -41,9 +41,6 @@ load_rc_config $name mount_tmpmfs() { if ! /bin/df /tmp | grep -q "^/dev/md[0-9].* /tmp"; then - if test -w /tmp/. && checkyesno tmpmfs_clear_mnt; then - (cd /tmp/. && rm -rf .* *) - fi mount_md ${tmpsize} /tmp "${tmpmfs_flags}" chmod 01777 /tmp fi Modified: head/sbin/veriexec/Makefile.depend ============================================================================== --- head/sbin/veriexec/Makefile.depend Sun Jul 19 23:54:00 2020 (r363350) +++ head/sbin/veriexec/Makefile.depend Sun Jul 19 23:56:19 2020 (r363351) @@ -2,6 +2,7 @@ # Autogenerated - do NOT edit! DIRDEPS = \ + gnu/lib/csu \ include \ include/xlocale \ lib/${CSU_DIR} \ @@ -10,7 +11,6 @@ DIRDEPS = \ lib/libcompiler_rt \ lib/libsecureboot \ lib/libveriexec \ - usr.bin/yacc.host \ .include Modified: head/stand/efi/loader/Makefile ============================================================================== --- head/stand/efi/loader/Makefile Sun Jul 19 23:54:00 2020 (r363350) +++ head/stand/efi/loader/Makefile Sun Jul 19 23:56:19 2020 (r363351) @@ -102,8 +102,3 @@ DPADD= ${LDR_INTERP} ${LIBEFI} ${LIBFDT} ${LIBEFI_FDT LDADD= ${LDR_INTERP} ${LIBEFI} ${LIBFDT} ${LIBEFI_FDT} ${LIBSA} .include - -PATH_BOOTABLE_TOKEN=/boot/boot.4th -CFLAGS+= ${XCFLAGS.${.TARGET:T:R}:U} -XCFLAGS.main+= -DPATH_BOOTABLE_TOKEN=\"${PATH_BOOTABLE_TOKEN}\" - Modified: head/stand/i386/loader/Makefile ============================================================================== --- head/stand/i386/loader/Makefile Sun Jul 19 23:54:00 2020 (r363350) +++ head/stand/i386/loader/Makefile Sun Jul 19 23:56:19 2020 (r363351) @@ -1,5 +1,5 @@ # $FreeBSD$ -.if 0 + HAVE_ZFS= ${MK_LOADER_ZFS} LOADER_NET_SUPPORT?= yes @@ -11,10 +11,6 @@ LOADER_MSDOS_SUPPORT?= yes LOADER_UFS_SUPPORT?= yes LOADER_GZIP_SUPPORT?= yes LOADER_BZIP2_SUPPORT?= yes -.else -LOADER_NET_SUPPORT?= yes -LOADER_UFS_SUPPORT?= yes -.endif .include @@ -60,8 +56,8 @@ LIBI386= ${BOOTOBJ}/i386/libi386/libi386.a CFLAGS+= -I${BOOTSRC}/i386 # Debug me! -CFLAGS+= -g -LDFLAGS+= -g +#CFLAGS+= -g +#LDFLAGS+= -g ${LOADER}: ${LOADER}.bin ${BTXLDR} ${BTXKERN} btxld -v -f aout -e ${LOADER_ADDRESS} -o ${.TARGET} -l ${BTXLDR} \ From owner-svn-src-all@freebsd.org Mon Jul 20 00:17:10 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B823436E278; Mon, 20 Jul 2020 00:17:10 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4B92NQ4j7cz4F7L; Mon, 20 Jul 2020 00:17:10 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 843702419C; Mon, 20 Jul 2020 00:17:10 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06K0HAHE089952; Mon, 20 Jul 2020 00:17:10 GMT (envelope-from sjg@FreeBSD.org) Received: (from sjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06K0H8OH089941; Mon, 20 Jul 2020 00:17:08 GMT (envelope-from sjg@FreeBSD.org) Message-Id: <202007200017.06K0H8OH089941@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sjg set sender to sjg@FreeBSD.org using -f From: "Simon J. Gerraty" Date: Mon, 20 Jul 2020 00:17:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r363352 - in stable/12: contrib/bmake contrib/bmake/filemon contrib/bmake/lst.lib contrib/bmake/mk contrib/bmake/mk/sys contrib/bmake/unit-tests usr.bin/bmake usr.bin/bmake/unit-tests X-SVN-Group: stable-12 X-SVN-Commit-Author: sjg X-SVN-Commit-Paths: in stable/12: contrib/bmake contrib/bmake/filemon contrib/bmake/lst.lib contrib/bmake/mk contrib/bmake/mk/sys contrib/bmake/unit-tests usr.bin/bmake usr.bin/bmake/unit-tests X-SVN-Commit-Revision: 363352 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 20 Jul 2020 00:17:10 -0000 Author: sjg Date: Mon Jul 20 00:17:08 2020 New Revision: 363352 URL: https://svnweb.freebsd.org/changeset/base/363352 Log: Update to bmake-20200710 Key changes include reduced noise at end of failed build log and avoid evaluation of unnecessary terms in conditionals. In META MODE; a target flagged .META is out-of-date if meta file is missing MFC of r361986, r363117 Added: stable/12/contrib/bmake/unit-tests/cond-short.exp stable/12/contrib/bmake/unit-tests/cond-short.mk (contents, props changed) stable/12/usr.bin/bmake/unit-tests/Makefile.config (contents, props changed) Modified: stable/12/contrib/bmake/ChangeLog stable/12/contrib/bmake/FILES stable/12/contrib/bmake/Makefile stable/12/contrib/bmake/VERSION stable/12/contrib/bmake/arch.c stable/12/contrib/bmake/bmake.1 stable/12/contrib/bmake/bmake.cat1 stable/12/contrib/bmake/buf.c stable/12/contrib/bmake/compat.c stable/12/contrib/bmake/cond.c stable/12/contrib/bmake/configure stable/12/contrib/bmake/configure.in stable/12/contrib/bmake/dir.c stable/12/contrib/bmake/dirname.c stable/12/contrib/bmake/filemon/filemon_dev.c stable/12/contrib/bmake/for.c stable/12/contrib/bmake/hash.c stable/12/contrib/bmake/hash.h stable/12/contrib/bmake/job.c stable/12/contrib/bmake/job.h stable/12/contrib/bmake/lst.lib/lstAppend.c stable/12/contrib/bmake/lst.lib/lstAtEnd.c stable/12/contrib/bmake/lst.lib/lstAtFront.c stable/12/contrib/bmake/lst.lib/lstClose.c stable/12/contrib/bmake/lst.lib/lstConcat.c stable/12/contrib/bmake/lst.lib/lstDatum.c stable/12/contrib/bmake/lst.lib/lstDeQueue.c stable/12/contrib/bmake/lst.lib/lstDupl.c stable/12/contrib/bmake/lst.lib/lstEnQueue.c stable/12/contrib/bmake/lst.lib/lstFind.c stable/12/contrib/bmake/lst.lib/lstFindFrom.c stable/12/contrib/bmake/lst.lib/lstFirst.c stable/12/contrib/bmake/lst.lib/lstForEach.c stable/12/contrib/bmake/lst.lib/lstForEachFrom.c stable/12/contrib/bmake/lst.lib/lstInit.c stable/12/contrib/bmake/lst.lib/lstInsert.c stable/12/contrib/bmake/lst.lib/lstIsAtEnd.c stable/12/contrib/bmake/lst.lib/lstIsEmpty.c stable/12/contrib/bmake/lst.lib/lstLast.c stable/12/contrib/bmake/lst.lib/lstNext.c stable/12/contrib/bmake/lst.lib/lstOpen.c stable/12/contrib/bmake/lst.lib/lstPrev.c stable/12/contrib/bmake/lst.lib/lstRemove.c stable/12/contrib/bmake/lst.lib/lstReplace.c stable/12/contrib/bmake/lst.lib/lstSucc.c stable/12/contrib/bmake/main.c stable/12/contrib/bmake/make.1 stable/12/contrib/bmake/make.c stable/12/contrib/bmake/make.h stable/12/contrib/bmake/make_malloc.c stable/12/contrib/bmake/meta.c stable/12/contrib/bmake/meta.h stable/12/contrib/bmake/mk/ChangeLog stable/12/contrib/bmake/mk/FILES stable/12/contrib/bmake/mk/dirdeps-targets.mk stable/12/contrib/bmake/mk/dirdeps.mk stable/12/contrib/bmake/mk/gendirdeps.mk stable/12/contrib/bmake/mk/host-target.mk stable/12/contrib/bmake/mk/init.mk stable/12/contrib/bmake/mk/install-mk stable/12/contrib/bmake/mk/meta2deps.py stable/12/contrib/bmake/mk/mkopt.sh stable/12/contrib/bmake/mk/sys/AIX.mk stable/12/contrib/bmake/mk/sys/Darwin.mk stable/12/contrib/bmake/mk/sys/Generic.mk stable/12/contrib/bmake/mk/sys/HP-UX.mk stable/12/contrib/bmake/mk/sys/IRIX.mk stable/12/contrib/bmake/mk/sys/Linux.mk stable/12/contrib/bmake/mk/sys/NetBSD.mk stable/12/contrib/bmake/mk/sys/OSF1.mk stable/12/contrib/bmake/mk/sys/OpenBSD.mk stable/12/contrib/bmake/mk/sys/SunOS.mk stable/12/contrib/bmake/mk/sys/UnixWare.mk stable/12/contrib/bmake/nonints.h stable/12/contrib/bmake/parse.c stable/12/contrib/bmake/str.c stable/12/contrib/bmake/suff.c stable/12/contrib/bmake/targ.c stable/12/contrib/bmake/trace.c stable/12/contrib/bmake/unit-tests/Makefile stable/12/contrib/bmake/unit-tests/modmatch.mk stable/12/contrib/bmake/unit-tests/modmisc.exp stable/12/contrib/bmake/unit-tests/modmisc.mk stable/12/contrib/bmake/unit-tests/modorder.exp stable/12/contrib/bmake/unit-tests/modorder.mk stable/12/contrib/bmake/unit-tests/sysv.exp stable/12/contrib/bmake/unit-tests/sysv.mk stable/12/contrib/bmake/unit-tests/varmisc.exp stable/12/contrib/bmake/unit-tests/varmisc.mk stable/12/contrib/bmake/util.c stable/12/contrib/bmake/var.c stable/12/usr.bin/bmake/Makefile stable/12/usr.bin/bmake/Makefile.config stable/12/usr.bin/bmake/config.h stable/12/usr.bin/bmake/unit-tests/Makefile Modified: stable/12/contrib/bmake/ChangeLog ============================================================================== --- stable/12/contrib/bmake/ChangeLog Sun Jul 19 23:56:19 2020 (r363351) +++ stable/12/contrib/bmake/ChangeLog Mon Jul 20 00:17:08 2020 (r363352) @@ -1,3 +1,120 @@ +2020-07-10 Simon J Gerraty + + * configure.in: use AC_INCLUDES_DEFAULT rather than AC_HEADER_STDC + + * VERSION (_MAKE_VERSION): 20200710 + Merge with NetBSD make, pick up + o filemon/filemon_dev.c: use O_CLOEXEC rather than extra syscall + o meta.c: target flagged .META is out-of-date if meta file missing + +2020-07-09 Simon J Gerraty + + * VERSION (_MAKE_VERSION): 20200709 + Merge with NetBSD make, pick up + o cond.c: fix for compare_expression when doEval=0 + o unit-tests/Makefile: rework + o filemon/filemon_dev.c: ensure filemon fd is closed on exec. + +2020-07-04 Simon J Gerraty + + * VERSION (_MAKE_VERSION): 20200704 + Merge with NetBSD make, pick up + (most of this by rillig@) + o lots of style and white-space cleanup + o lots more unit tests for variable modifiers + o simplified description of some functions + o str.c: refactor Str_Match + o var.c: debugging output for :@ + constify VarModify parameter + fix :hash modifier on 16-bit platforms + remove unnecessary forward declarations + refactor ApplyModifier_SysV to have less indentation + simplify code for :E and :R + clean up code for :H and :T + refactor ApplyModifiers + + * var.c: we need stdint.h on some platforms to get uint32_t + * unit-test/Makefile: we need to supress the specific error + for RE substitution error in modmisc, since it varies accross + different OS. + +2020-07-02 Simon J Gerraty + + * VERSION (_MAKE_VERSION): 20200702 + Merge with NetBSD make, pick up + o var.c: more improvements to avoiding unnecessary evaluation + use enums for flags + o remove flags arg to Var_Set which outside of var.c is always 0 + +2020-07-01 Simon J Gerraty + + * VERSION (_MAKE_VERSION): 20200701 + Merge with NetBSD make, pick up + o var.c: with change to cond.c; ensure that nested variables + within a variable name are expanded. + o unit-tests/varmisc.mk: test for nested varname + +2020-06-29 Simon J Gerraty + + * VERSION (_MAKE_VERSION): 20200629 + Merge with NetBSD make, pick up + o cond.c: do not eval unnecessary terms of conditionals. + +2020-06-25 Simon J Gerraty + + * VERSION (_MAKE_VERSION): 20200625 + Merge with NetBSD make, pick up + o meta.c: report error if lseek in filemon_read fails + +2020-06-22 Simon J Gerraty + + * VERSION (_MAKE_VERSION): 20200622 + Merge with NetBSD make, pick up + o dieQuietly: ignore OP_SUBMAKE as too aggressive + +2020-06-19 Simon J Gerraty + + * VERSION (_MAKE_VERSION): 20200619 + Merge with NetBSD make, pick up + o str.c: performance improvement for Str_Match for multiple '*' + o dieQuietly: supress the failure output from make + when failing node is a sub-make or a sibling failed. + This cuts down greatly on unhelpful noise at the end of + build log. Disabled by -dj or .MAKE.DIE_QUIETLY=no + +2020-06-10 Simon J Gerraty + + * FILES: add LICENSE to appease some packagers. + This is an attempt to fairly represent the license on almost + 200 files, which are almost all BSD-3-Clause + The few exceptions being more liberal. + + * VERSION (_MAKE_VERSION): 20200610 + Merge with NetBSD make, pick up + o unit test for :Or + +2020-06-06 Simon J Gerraty + + * VERSION (_MAKE_VERSION): 20200606 + Merge with NetBSD make, pick up + o make.1: cleanup + + * Makefile: fix depends for main.o which broke MAKE_VERSION + +2020-06-05 Simon J Gerraty + + * VERSION (_MAKE_VERSION): 20200605 + Merge with NetBSD make, pick up + o dir.c: cached_stats - don't confuse stat and lstat results. + o var.c: add :Or for reverse sort. + +2020-05-24 Simon J Gerraty + + * configure.in: add AC_PROG_CC_C99 for mipspro compiler + also if --with-filemon= specifies path to filemon.h + set use_filemon=dev + * dirname.c: remove include of namespace.h + 2020-05-17 Simon J Gerraty * VERSION (_MAKE_VERSION): 20200517 Modified: stable/12/contrib/bmake/FILES ============================================================================== --- stable/12/contrib/bmake/FILES Sun Jul 19 23:56:19 2020 (r363351) +++ stable/12/contrib/bmake/FILES Mon Jul 20 00:17:08 2020 (r363352) @@ -1,5 +1,6 @@ ChangeLog FILES +LICENSE Makefile Makefile.config.in PSD.doc/Makefile @@ -107,6 +108,8 @@ unit-tests/cond2.exp unit-tests/cond2.mk unit-tests/cond-late.mk unit-tests/cond-late.exp +unit-tests/cond-short.mk +unit-tests/cond-short.exp unit-tests/dollar.exp unit-tests/dollar.mk unit-tests/doterror.exp Modified: stable/12/contrib/bmake/Makefile ============================================================================== --- stable/12/contrib/bmake/Makefile Sun Jul 19 23:56:19 2020 (r363351) +++ stable/12/contrib/bmake/Makefile Mon Jul 20 00:17:08 2020 (r363352) @@ -1,4 +1,4 @@ -# $Id: Makefile,v 1.104 2020/02/06 01:33:54 sjg Exp $ +# $Id: Makefile,v 1.107 2020/06/07 21:18:46 sjg Exp $ PROG= bmake @@ -82,7 +82,7 @@ COPTS.main.c+= "-DMAKE_VERSION=\"${_MAKE_VERSION}\"" # should be set by now USE_FILEMON ?= no .if ${USE_FILEMON:tl} != "no" -.PATH: ${.CURDIR}/filemon +.PATH: ${srcdir}/filemon SRCS+= filemon_${USE_FILEMON}.c COPTS.meta.c+= -DUSE_FILEMON -DUSE_FILEMON_${USE_FILEMON:tu} COPTS.job.c+= ${COPTS.meta.c} @@ -158,7 +158,7 @@ MAN1= ${MAN} .if (${PROG} != "make") CLEANFILES+= my.history .if make(${MAN}) || !exists(${srcdir}/${MAN}) -my.history: ${MAKEFILE} +my.history: @(echo ".Nm"; \ echo "is derived from NetBSD"; \ echo ".Xr make 1 ."; \ @@ -207,7 +207,7 @@ ${OBJS}: config.h # start-delete2 for bsd.after-import.mk # make sure that MAKE_VERSION gets updated. -main.o: ${SRCS} ${.CURDIR}/VERSION +main.o: ${srcdir}/VERSION .if ${MK_AUTOCONF_MK} == "yes" CONFIGURE_DEPS += ${.CURDIR}/VERSION Modified: stable/12/contrib/bmake/VERSION ============================================================================== --- stable/12/contrib/bmake/VERSION Sun Jul 19 23:56:19 2020 (r363351) +++ stable/12/contrib/bmake/VERSION Mon Jul 20 00:17:08 2020 (r363352) @@ -1,2 +1,2 @@ # keep this compatible with sh and make -_MAKE_VERSION=20200517 +_MAKE_VERSION=20200710 Modified: stable/12/contrib/bmake/arch.c ============================================================================== --- stable/12/contrib/bmake/arch.c Sun Jul 19 23:56:19 2020 (r363351) +++ stable/12/contrib/bmake/arch.c Mon Jul 20 00:17:08 2020 (r363352) @@ -1,4 +1,4 @@ -/* $NetBSD: arch.c,v 1.71 2019/10/05 23:35:57 mrg Exp $ */ +/* $NetBSD: arch.c,v 1.73 2020/07/03 08:02:55 rillig Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1993 @@ -69,14 +69,14 @@ */ #ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: arch.c,v 1.71 2019/10/05 23:35:57 mrg Exp $"; +static char rcsid[] = "$NetBSD: arch.c,v 1.73 2020/07/03 08:02:55 rillig Exp $"; #else #include #ifndef lint #if 0 static char sccsid[] = "@(#)arch.c 8.2 (Berkeley) 1/2/94"; #else -__RCSID("$NetBSD: arch.c,v 1.71 2019/10/05 23:35:57 mrg Exp $"); +__RCSID("$NetBSD: arch.c,v 1.73 2020/07/03 08:02:55 rillig Exp $"); #endif #endif /* not lint */ #endif @@ -312,7 +312,7 @@ Arch_ParseArchive(char **linePtr, Lst nodeLst, GNode * free(freeIt); if (result == var_Error) { - return(FAILURE); + return FAILURE; } else { subLibName = TRUE; } @@ -354,7 +354,7 @@ Arch_ParseArchive(char **linePtr, Lst nodeLst, GNode * free(freeIt); if (result == var_Error) { - return(FAILURE); + return FAILURE; } else { doSubst = TRUE; } @@ -372,7 +372,7 @@ Arch_ParseArchive(char **linePtr, Lst nodeLst, GNode * */ if (*cp == '\0') { printf("No closing parenthesis in archive specification\n"); - return (FAILURE); + return FAILURE; } /* @@ -426,7 +426,7 @@ Arch_ParseArchive(char **linePtr, Lst nodeLst, GNode * if (gn == NULL) { free(buf); - return(FAILURE); + return FAILURE; } else { gn->type |= OP_ARCHV; (void)Lst_AtEnd(nodeLst, gn); @@ -437,7 +437,7 @@ Arch_ParseArchive(char **linePtr, Lst nodeLst, GNode * * ourselves. */ free(buf); - return(FAILURE); + return FAILURE; } /* * Free buffer and continue with our work. @@ -461,7 +461,7 @@ Arch_ParseArchive(char **linePtr, Lst nodeLst, GNode * gn = Targ_FindNode(nameBuf, TARG_CREATE); if (gn == NULL) { free(nameBuf); - return (FAILURE); + return FAILURE; } else { /* * We've found the node, but have to make sure the rest of @@ -483,7 +483,7 @@ Arch_ParseArchive(char **linePtr, Lst nodeLst, GNode * gn = Targ_FindNode(nameBuf, TARG_CREATE); free(nameBuf); if (gn == NULL) { - return (FAILURE); + return FAILURE; } else { /* * We've found the node, but have to make sure the rest of the @@ -520,7 +520,7 @@ Arch_ParseArchive(char **linePtr, Lst nodeLst, GNode * } while (*cp != '\0' && isspace ((unsigned char)*cp)); *linePtr = cp; - return (SUCCESS); + return SUCCESS; } /*- @@ -544,7 +544,7 @@ Arch_ParseArchive(char **linePtr, Lst nodeLst, GNode * static int ArchFindArchive(const void *ar, const void *archName) { - return (strcmp(archName, ((const Arch *)ar)->name)); + return strcmp(archName, ((const Arch *)ar)->name); } /*- @@ -602,7 +602,7 @@ ArchStatMember(char *archive, char *member, Boolean ha he = Hash_FindEntry(&ar->members, member); if (he != NULL) { - return ((struct ar_hdr *)Hash_GetValue(he)); + return (struct ar_hdr *)Hash_GetValue(he); } else { /* Try truncated name */ char copy[AR_MAX_NAME_LEN+1]; @@ -614,7 +614,7 @@ ArchStatMember(char *archive, char *member, Boolean ha copy[AR_MAX_NAME_LEN] = '\0'; } if ((he = Hash_FindEntry(&ar->members, copy)) != NULL) - return ((struct ar_hdr *)Hash_GetValue(he)); + return (struct ar_hdr *)Hash_GetValue(he); return NULL; } } @@ -635,7 +635,7 @@ ArchStatMember(char *archive, char *member, Boolean ha return NULL; } else { fclose(arch); - return (&sarh); + return &sarh; } } @@ -753,7 +753,7 @@ ArchStatMember(char *archive, char *member, Boolean ha he = Hash_FindEntry(&ar->members, member); if (he != NULL) { - return ((struct ar_hdr *)Hash_GetValue(he)); + return (struct ar_hdr *)Hash_GetValue(he); } else { return NULL; } @@ -962,7 +962,7 @@ ArchFindMember(char *archive, char *member, struct ar_ fclose(arch); return NULL; } - return (arch); + return arch; } } else #ifdef AR_EFMT1 @@ -996,7 +996,7 @@ ArchFindMember(char *archive, char *member, struct ar_ fclose(arch); return NULL; } - return (arch); + return arch; } if (fseek(arch, -elen, SEEK_CUR) != 0) { fclose(arch); @@ -1152,7 +1152,7 @@ Arch_MTime(GNode *gn) } gn->mtime = modTime; - return (modTime); + return modTime; } /*- @@ -1179,7 +1179,7 @@ Arch_MemMTime(GNode *gn) if (Lst_Open(gn->parents) != SUCCESS) { gn->mtime = 0; - return (0); + return 0; } while ((ln = Lst_Next(gn->parents)) != NULL) { pgn = (GNode *)Lst_Datum(ln); @@ -1211,7 +1211,7 @@ Arch_MemMTime(GNode *gn) Lst_Close(gn->parents); - return (gn->mtime); + return gn->mtime; } /*- @@ -1252,9 +1252,9 @@ Arch_FindLib(GNode *gn, Lst path) free(libName); #ifdef LIBRARIES - Var_Set(TARGET, gn->name, gn, 0); + Var_Set(TARGET, gn->name, gn); #else - Var_Set(TARGET, gn->path == NULL ? gn->name : gn->path, gn, 0); + Var_Set(TARGET, gn->path == NULL ? gn->name : gn->path, gn); #endif /* LIBRARIES */ } @@ -1337,7 +1337,7 @@ Arch_LibOODate(GNode *gn) oodate = FALSE; #endif } - return (oodate); + return oodate; } /*- Modified: stable/12/contrib/bmake/bmake.1 ============================================================================== --- stable/12/contrib/bmake/bmake.1 Sun Jul 19 23:56:19 2020 (r363351) +++ stable/12/contrib/bmake/bmake.1 Mon Jul 20 00:17:08 2020 (r363352) @@ -1,4 +1,4 @@ -.\" $NetBSD: make.1,v 1.273 2018/05/27 01:14:51 christos Exp $ +.\" $NetBSD: make.1,v 1.282 2020/06/06 20:28:42 wiz Exp $ .\" .\" Copyright (c) 1990, 1993 .\" The Regents of the University of California. All rights reserved. @@ -29,7 +29,7 @@ .\" .\" from: @(#)make.1 8.4 (Berkeley) 3/19/94 .\" -.Dd May 26, 2018 +.Dd June 5, 2020 .Dt BMAKE 1 .Os .Sh NAME @@ -272,7 +272,7 @@ that do not depend on the target whose creation caused .It Fl m Ar directory Specify a directory in which to search for sys.mk and makefiles included via the -.Ao Ar file Ac Ns -style +.Li \&< Ns Ar file Ns Li \&> Ns -style include statement. The .Fl m @@ -280,7 +280,7 @@ option can be used multiple times to form a search pat This path will override the default system include path: /usr/share/mk. Furthermore the system include path will be appended to the search path used for -.Qo Ar file Qc Ns -style +.Li \*q Ns Ar file Ns Li \*q Ns -style include statements (see the .Fl I option). @@ -1196,10 +1196,8 @@ but selects all words which do not match .Ar pattern . .It Cm \&:O Order every word in variable alphabetically. -To sort words in -reverse order use the -.Ql Cm \&:O:[-1..1] -combination of modifiers. +.It Cm \&:Or +Order every word in variable in reverse alphabetical order. .It Cm \&:Ox Randomize words in variable. The results will be different each time you are referring to the @@ -1234,7 +1232,7 @@ Quotes every shell meta-character in the variable, and characters so that it can be passed safely through recursive invocations of .Nm . -This is equivalent to: +This is equivalent to: .Sq \&:S/\e\&$/&&/g:Q . .It Cm \&:R Replaces each word in the variable with everything but its suffix. @@ -1429,6 +1427,29 @@ is the substring of .Ar old_string to be replaced in .Ar new_string . +If only +.Ar old_string +contains the pattern matching character +.Ar % , +and +.Ar old_string +matches, then the result is the +.Ar new_string . +If only the +.Ar new_string +contains the pattern matching character +.Ar % , +then it is not treated specially and it is printed as a literal +.Ar % +on match. +If there is more than one pattern matching character +.Ar ( % ) +in either the +.Ar new_string +or +.Ar old_string , +only the first instance is treated specially (as the pattern character); +all subsequent instances are treated as regular characters .Pp Variable expansion occurs in the normal fashion inside both .Ar old_string @@ -1591,6 +1612,11 @@ then the words are output in reverse order. For example, .Ql Cm \&:[-1..1] selects all the words from last to first. +If the list is already ordered, then this effectively reverses +the list, but it is more efficient to use +.Ql Cm \&:Or +instead of +.Ql Cm \&:O:[-1..1] . .\" :[*] .It Cm \&* Causes subsequent modifiers to treat the value as a single word @@ -1623,9 +1649,9 @@ dot .Pq Ql \&. character. Files are included with either -.Cm \&.include Aq Ar file +.Cm \&.include \&< Ns Ar file Ns Cm \&> or -.Cm \&.include Pf \*q Ar file Ns \*q . +.Cm \&.include \&\*q Ns Ar file Ns Cm \&\*q . Variables between the angle brackets or double quotes are expanded to form the file name. If angle brackets are used, the included makefile is expected to be in @@ -2409,9 +2435,9 @@ file). .Sh BUGS The make -syntax is difficult to parse without actually acting of the data. -For instance finding the end of a variable use should involve scanning each -the modifiers using the correct terminator for each field. +syntax is difficult to parse without actually acting on the data. +For instance, finding the end of a variable's use should involve scanning +each of the modifiers, using the correct terminator for each field. In many places make just counts {} and () in order to find the end of a variable expansion. Modified: stable/12/contrib/bmake/bmake.cat1 ============================================================================== --- stable/12/contrib/bmake/bmake.cat1 Sun Jul 19 23:56:19 2020 (r363351) +++ stable/12/contrib/bmake/bmake.cat1 Mon Jul 20 00:17:08 2020 (r363352) @@ -779,9 +779,10 @@ BMAKE(1) FreeBSD General Commands Manua This is identical to `:M', but selects all words which do not match pattern. - :O Order every word in variable alphabetically. To sort words in - reverse order use the `:O:[-1..1]' combination of modifiers. + :O Order every word in variable alphabetically. + :Or Order every word in variable in reverse alphabetical order. + :Ox Randomize words in variable. The results will be different each time you are referring to the modified variable; use the assignment with expansion (`:=') to prevent such behavior. For example, @@ -803,8 +804,12 @@ BMAKE(1) FreeBSD General Commands Manua due uno quattro tre :Q Quotes every shell meta-character in the variable, so that it can be - passed safely through recursive invocations of bmake. + passed safely to the shell. + :q Quotes every shell meta-character in the variable, and also doubles + `$' characters so that it can be passed safely through recursive + invocations of bmake. This is equivalent to: `:S/\$/&&/g:Q'. + :R Replaces each word in the variable with everything but its suffix. :range[=count] @@ -903,7 +908,15 @@ BMAKE(1) FreeBSD General Commands Manua contain the pattern matching character % then it is assumed that they are anchored at the end of each word, so only suffixes or entire words may be replaced. Otherwise % is the substring of - old_string to be replaced in new_string. + old_string to be replaced in new_string. If only old_string con- + tains the pattern matching character %, and old_string matches, then + the result is the new_string. If only the new_string contains the + pattern matching character %, then it is not treated specially and + it is printed as a literal % on match. If there is more than one + pattern matching character (%) in either the new_string or + old_string, only the first instance is treated specially (as the + pattern character); all subsequent instances are treated as regular + characters Variable expansion occurs in the normal fashion inside both old_string and new_string with the single exception that a backslash @@ -1003,7 +1016,9 @@ BMAKE(1) FreeBSD General Commands Manua `:[2..-1]' selects all words from the second word to the last word. If start is greater than end, then the words are out- put in reverse order. For example, `:[-1..1]' selects all - the words from last to first. + the words from last to first. If the list is already + ordered, then this effectively reverses the list, but it is + more efficient to use `:Or' instead of `:O:[-1..1]'. * Causes subsequent modifiers to treat the value as a single word (possibly containing embedded white space). Analogous @@ -1021,7 +1036,7 @@ BMAKE(1) FreeBSD General Commands Manua Makefile inclusion, conditional structures and for loops reminiscent of the C programming language are provided in bmake. All such structures are identified by a line beginning with a single dot (`.') character. - Files are included with either .include <file> or .include "file". Vari- + Files are included with either .include <file> or .include "file". Vari- ables between the angle brackets or double quotes are expanded to form the file name. If angle brackets are used, the included makefile is expected to be in the system makefile directory. If double quotes are @@ -1184,7 +1199,7 @@ BMAKE(1) FreeBSD General Commands Manua the ``make'' or ``defined'' expression is applied to it, depending on the form of the conditional. If the form is `.ifdef', `.ifndef', or `.if' the ``defined'' expression is applied. Similarly, if the form is - `.ifmake' or `.ifnmake, the' ``make'' expression is applied. + `.ifmake' or `.ifnmake', the ``make'' expression is applied. If the conditional evaluates to true the parsing of the makefile contin- ues as before. If it evaluates to false, the following lines are @@ -1533,12 +1548,12 @@ BMAKE(1) FreeBSD General Commands Manua creates an ``FRC'' file). BUGS - The make syntax is difficult to parse without actually acting of the - data. For instance finding the end of a variable use should involve - scanning each the modifiers using the correct terminator for each field. - In many places make just counts {} and () in order to find the end of a - variable expansion. + The make syntax is difficult to parse without actually acting on the + data. For instance, finding the end of a variable's use should involve + scanning each of the modifiers, using the correct terminator for each + field. In many places make just counts {} and () in order to find the + end of a variable expansion. There is no way of escaping a space character in a filename. -FreeBSD 11.1 June 22, 2017 FreeBSD 11.1 +FreeBSD 11.3 June 5, 2020 FreeBSD 11.3 Modified: stable/12/contrib/bmake/buf.c ============================================================================== --- stable/12/contrib/bmake/buf.c Sun Jul 19 23:56:19 2020 (r363351) +++ stable/12/contrib/bmake/buf.c Mon Jul 20 00:17:08 2020 (r363352) @@ -1,4 +1,4 @@ -/* $NetBSD: buf.c,v 1.25 2012/04/24 20:26:58 sjg Exp $ */ +/* $NetBSD: buf.c,v 1.26 2020/07/03 08:02:55 rillig Exp $ */ /* * Copyright (c) 1988, 1989, 1990 The Regents of the University of California. @@ -70,14 +70,14 @@ */ #ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: buf.c,v 1.25 2012/04/24 20:26:58 sjg Exp $"; +static char rcsid[] = "$NetBSD: buf.c,v 1.26 2020/07/03 08:02:55 rillig Exp $"; #else #include #ifndef lint #if 0 static char sccsid[] = "@(#)buf.c 8.1 (Berkeley) 6/6/93"; #else -__RCSID("$NetBSD: buf.c,v 1.25 2012/04/24 20:26:58 sjg Exp $"); +__RCSID("$NetBSD: buf.c,v 1.26 2020/07/03 08:02:55 rillig Exp $"); #endif #endif /* not lint */ #endif @@ -160,7 +160,7 @@ Buf_GetAll(Buffer *bp, int *numBytesPtr) if (numBytesPtr != NULL) *numBytesPtr = bp->count; - return (bp->buffer); + return bp->buffer; } /*- Modified: stable/12/contrib/bmake/compat.c ============================================================================== --- stable/12/contrib/bmake/compat.c Sun Jul 19 23:56:19 2020 (r363351) +++ stable/12/contrib/bmake/compat.c Mon Jul 20 00:17:08 2020 (r363352) @@ -1,4 +1,4 @@ -/* $NetBSD: compat.c,v 1.110 2020/01/19 19:42:32 riastradh Exp $ */ +/* $NetBSD: compat.c,v 1.113 2020/07/03 08:13:23 rillig Exp $ */ /* * Copyright (c) 1988, 1989, 1990 The Regents of the University of California. @@ -70,14 +70,14 @@ */ #ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: compat.c,v 1.110 2020/01/19 19:42:32 riastradh Exp $"; +static char rcsid[] = "$NetBSD: compat.c,v 1.113 2020/07/03 08:13:23 rillig Exp $"; #else #include #ifndef lint #if 0 static char sccsid[] = "@(#)compat.c 8.2 (Berkeley) 3/19/94"; #else -__RCSID("$NetBSD: compat.c,v 1.110 2020/01/19 19:42:32 riastradh Exp $"); +__RCSID("$NetBSD: compat.c,v 1.113 2020/07/03 08:13:23 rillig Exp $"); #endif #endif /* not lint */ #endif @@ -236,7 +236,7 @@ CompatRunCommand(void *cmdp, void *gnp) silent = gn->type & OP_SILENT; errCheck = !(gn->type & OP_IGNORE); doIt = FALSE; - + cmdNode = Lst_Member(gn->commands, cmd); cmdStart = Var_Subst(NULL, cmd, gn, VARF_WANTRES); @@ -249,18 +249,18 @@ CompatRunCommand(void *cmdp, void *gnp) if (*cmdStart == '\0') { free(cmdStart); - return(0); + return 0; } cmd = cmdStart; Lst_Replace(cmdNode, cmdStart); if ((gn->type & OP_SAVE_CMDS) && (gn != ENDNode)) { (void)Lst_AtEnd(ENDNode->commands, cmdStart); - return(0); + return 0; } if (strcmp(cmdStart, "...") == 0) { gn->type |= OP_SAVE_CMDS; - return(0); + return 0; } while ((*cmd == '@') || (*cmd == '-') || (*cmd == '+')) { @@ -287,7 +287,7 @@ CompatRunCommand(void *cmdp, void *gnp) * If we did not end up with a command, just skip it. */ if (!*cmd) - return (0); + return 0; #if !defined(MAKE_NATIVE) /* @@ -307,7 +307,7 @@ CompatRunCommand(void *cmdp, void *gnp) * go to the shell. Therefore treat '=' and ':' like shell * meta characters as documented in make(1). */ - + useShell = needshell(cmd, FALSE); #endif @@ -325,7 +325,7 @@ CompatRunCommand(void *cmdp, void *gnp) * we go... */ if (!doIt && NoExecute(gn)) { - return (0); + return 0; } if (DEBUG(JOB)) fprintf(debug_file, "Execute: '%s'\n", cmd); @@ -377,7 +377,7 @@ again: meta_compat_start(); } #endif - + /* * Fork and execute the single command. If the fork fails, we abort. */ @@ -499,8 +499,8 @@ again: bmake_signal(compatSigno, SIG_DFL); kill(myPid, compatSigno); } - - return (status); + + return status; } /*- @@ -550,7 +550,7 @@ Compat_Make(void *gnp, void *pgnp) if (Lst_Member(gn->iParents, pgn) != NULL) { char *p1; - Var_Set(IMPSRC, Var_Value(TARGET, gn, &p1), pgn, 0); + Var_Set(IMPSRC, Var_Value(TARGET, gn, &p1), pgn); free(p1); } @@ -654,7 +654,7 @@ Compat_Make(void *gnp, void *pgnp) } else { if (Lst_Member(gn->iParents, pgn) != NULL) { char *p1; - Var_Set(IMPSRC, Var_Value(TARGET, gn, &p1), pgn, 0); + Var_Set(IMPSRC, Var_Value(TARGET, gn, &p1), pgn); free(p1); } switch(gn->made) { @@ -681,7 +681,7 @@ Compat_Make(void *gnp, void *pgnp) cohorts: Lst_ForEach(gn->cohorts, Compat_Make, pgnp); - return (0); + return 0; } /*- Modified: stable/12/contrib/bmake/cond.c ============================================================================== --- stable/12/contrib/bmake/cond.c Sun Jul 19 23:56:19 2020 (r363351) +++ stable/12/contrib/bmake/cond.c Mon Jul 20 00:17:08 2020 (r363352) @@ -1,4 +1,4 @@ -/* $NetBSD: cond.c,v 1.75 2017/04/16 20:59:04 riastradh Exp $ */ +/* $NetBSD: cond.c,v 1.79 2020/07/09 22:34:08 sjg Exp $ */ /* * Copyright (c) 1988, 1989, 1990 The Regents of the University of California. @@ -70,14 +70,14 @@ */ #ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: cond.c,v 1.75 2017/04/16 20:59:04 riastradh Exp $"; +static char rcsid[] = "$NetBSD: cond.c,v 1.79 2020/07/09 22:34:08 sjg Exp $"; #else #include #ifndef lint #if 0 static char sccsid[] = "@(#)cond.c 8.2 (Berkeley) 1/2/94"; #else -__RCSID("$NetBSD: cond.c,v 1.75 2017/04/16 20:59:04 riastradh Exp $"); +__RCSID("$NetBSD: cond.c,v 1.79 2020/07/09 22:34:08 sjg Exp $"); #endif #endif /* not lint */ #endif @@ -146,7 +146,7 @@ typedef enum { * last two fields are stored in condInvert and condDefProc, respectively. */ static void CondPushBack(Token); -static int CondGetArg(char **, char **, const char *); +static int CondGetArg(Boolean, char **, char **, const char *); static Boolean CondDoDefined(int, const char *); static int CondStrMatch(const void *, const void *); static Boolean CondDoMake(int, const char *); @@ -186,7 +186,7 @@ static unsigned int cond_min_depth = 0; /* depth at * Indicate when we should be strict about lhs of comparisons. * TRUE when Cond_EvalExpression is called from Cond_Eval (.if etc) * FALSE when Cond_EvalExpression is called from var.c:ApplyModifiers - * since lhs is already expanded and we cannot tell if + * since lhs is already expanded and we cannot tell if * it was a variable reference or not. */ static Boolean lhsStrict; @@ -225,9 +225,6 @@ CondPushBack(Token t) * CondGetArg -- * Find the argument of a built-in function. * - * Input: - * parens TRUE if arg should be bounded by parens - * * Results: * The length of the argument and the address of the argument. * @@ -238,7 +235,7 @@ CondPushBack(Token t) *----------------------------------------------------------------------- */ static int -CondGetArg(char **linePtr, char **argPtr, const char *func) +CondGetArg(Boolean doEval, char **linePtr, char **argPtr, const char *func) { char *cp; int argLen; @@ -259,7 +256,7 @@ CondGetArg(char **linePtr, char **argPtr, const char * * the word 'make' or 'defined' at the beginning of a symbol... */ *argPtr = NULL; - return (0); + return 0; } while (*cp == ' ' || *cp == '\t') { @@ -290,7 +287,8 @@ CondGetArg(char **linePtr, char **argPtr, const char * int len; void *freeIt; - cp2 = Var_Parse(cp, VAR_CMD, VARF_UNDEFERR|VARF_WANTRES, + cp2 = Var_Parse(cp, VAR_CMD, VARF_UNDEFERR| + (doEval ? VARF_WANTRES : 0), &len, &freeIt); Buf_AddBytes(&buf, strlen(cp2), cp2); free(freeIt); @@ -316,11 +314,11 @@ CondGetArg(char **linePtr, char **argPtr, const char * if (func != NULL && *cp++ != ')') { Parse_Error(PARSE_WARNING, "Missing closing parenthesis for %s()", func); - return (0); + return 0; } *linePtr = cp; - return (argLen); + return argLen; } /*- @@ -349,7 +347,7 @@ CondDoDefined(int argLen MAKE_ATTR_UNUSED, const char } free(p1); - return (result); + return result; } /*- @@ -369,7 +367,7 @@ CondDoDefined(int argLen MAKE_ATTR_UNUSED, const char static int CondStrMatch(const void *string, const void *pattern) { - return(!Str_Match(string, pattern)); + return !Str_Match(string, pattern); } /*- @@ -414,14 +412,14 @@ CondDoExists(int argLen MAKE_ATTR_UNUSED, const char * if (DEBUG(COND)) { fprintf(debug_file, "exists(%s) result is \"%s\"\n", arg, path ? path : ""); - } + } if (path != NULL) { result = TRUE; free(path); } else { result = FALSE; } - return (result); + return result; } /*- @@ -443,7 +441,7 @@ CondDoTarget(int argLen MAKE_ATTR_UNUSED, const char * GNode *gn; gn = Targ_FindNode(arg, TARG_NOCREATE); - return (gn != NULL) && !OP_NOP(gn->type); + return gn != NULL && !OP_NOP(gn->type); } /*- @@ -467,7 +465,7 @@ CondDoCommands(int argLen MAKE_ATTR_UNUSED, const char GNode *gn; gn = Targ_FindNode(arg, TARG_NOCREATE); - return (gn != NULL) && !OP_NOP(gn->type) && !Lst_IsEmpty(gn->commands); + return gn != NULL && !OP_NOP(gn->type) && !Lst_IsEmpty(gn->commands); } /*- @@ -577,7 +575,7 @@ CondGetString(Boolean doEval, Boolean *quoted, void ** /* if we are in quotes, then an undefined variable is ok */ str = Var_Parse(condExpr, VAR_CMD, ((!qt && doEval) ? VARF_UNDEFERR : 0) | - VARF_WANTRES, &len, freeIt); + (doEval ? VARF_WANTRES : 0), &len, freeIt); if (str == var_Error) { if (*freeIt) { free(*freeIt); @@ -668,7 +666,7 @@ compare_expression(Boolean doEval) rhs = NULL; lhsFree = rhsFree = FALSE; lhsQuoted = rhsQuoted = FALSE; - + /* * Parse the variable spec and skip over it, saving its * value in lhs. @@ -711,7 +709,7 @@ compare_expression(Boolean doEval) goto done; } /* For .ifxxx compare against zero */ - if (CondCvtArg(lhs, &left)) { + if (CondCvtArg(lhs, &left)) { t = left != 0.0; goto done; } @@ -738,6 +736,11 @@ compare_expression(Boolean doEval) if (!rhs) goto done; + if (!doEval) { + t = TOK_FALSE; + goto done; + } + if (rhsQuoted || lhsQuoted) { do_string_compare: if (((*op != '!') && (*op != '=')) || (op[1] != '=')) { @@ -764,7 +767,7 @@ do_string_compare: * rhs is either a float or an integer. Convert both the * lhs and the rhs to a double and compare the two. */ - + if (!CondCvtArg(lhs, &left) || !CondCvtArg(rhs, &right)) goto do_string_compare; @@ -813,7 +816,7 @@ done: } static int -get_mpt_arg(char **linePtr, char **argPtr, const char *func MAKE_ATTR_UNUSED) +get_mpt_arg(Boolean doEval, char **linePtr, char **argPtr, const char *func MAKE_ATTR_UNUSED) { /* * Use Var_Parse to parse the spec in parens and return @@ -827,7 +830,7 @@ get_mpt_arg(char **linePtr, char **argPtr, const char /* We do all the work here and return the result as the length */ *argPtr = NULL; - val = Var_Parse(cp - 1, VAR_CMD, VARF_WANTRES, &length, &freeIt); + val = Var_Parse(cp - 1, VAR_CMD, doEval ? VARF_WANTRES : 0, &length, &freeIt); /* * Advance *linePtr to beyond the closing ). Note that * we subtract one because 'length' is calculated from 'cp - 1'. @@ -864,7 +867,7 @@ compare_function(Boolean doEval) static const struct fn_def { const char *fn_name; int fn_name_len; - int (*fn_getarg)(char **, char **, const char *); + int (*fn_getarg)(Boolean, char **, char **, const char *); Boolean (*fn_proc)(int, const char *); } fn_defs[] = { { "defined", 7, CondGetArg, CondDoDefined }, @@ -892,7 +895,7 @@ compare_function(Boolean doEval) if (*cp != '(') break; - arglen = fn_def->fn_getarg(&cp, &arg, fn_def->fn_name); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Mon Jul 20 00:20:56 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 060F436E8D0; Mon, 20 Jul 2020 00:20:56 +0000 (UTC) (envelope-from chuck@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4B92Sl6QRQz4FFb; Mon, 20 Jul 2020 00:20:55 +0000 (UTC) (envelope-from chuck@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BFCD823FCE; Mon, 20 Jul 2020 00:20:55 +0000 (UTC) (envelope-from chuck@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06K0KtIn091640; Mon, 20 Jul 2020 00:20:55 GMT (envelope-from chuck@FreeBSD.org) Received: (from chuck@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06K0KtBc091639; Mon, 20 Jul 2020 00:20:55 GMT (envelope-from chuck@FreeBSD.org) Message-Id: <202007200020.06K0KtBc091639@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: chuck set sender to chuck@FreeBSD.org using -f From: Chuck Tuffli Date: Mon, 20 Jul 2020 00:20:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r363353 - stable/12/usr.sbin/bhyve X-SVN-Group: stable-12 X-SVN-Commit-Author: chuck X-SVN-Commit-Paths: stable/12/usr.sbin/bhyve X-SVN-Commit-Revision: 363353 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 20 Jul 2020 00:20:56 -0000 Author: chuck Date: Mon Jul 20 00:20:55 2020 New Revision: 363353 URL: https://svnweb.freebsd.org/changeset/base/363353 Log: MFC r362760 bhyve: validate the NVMe LBA start and count Modified: stable/12/usr.sbin/bhyve/pci_nvme.c Directory Properties: stable/12/ (props changed) Modified: stable/12/usr.sbin/bhyve/pci_nvme.c ============================================================================== --- stable/12/usr.sbin/bhyve/pci_nvme.c Mon Jul 20 00:17:08 2020 (r363352) +++ stable/12/usr.sbin/bhyve/pci_nvme.c Mon Jul 20 00:20:55 2020 (r363353) @@ -1528,6 +1528,34 @@ pci_nvme_stats_write_read_update(struct pci_nvme_softc pthread_mutex_unlock(&sc->mtx); } +/* + * Check if the combination of Starting LBA (slba) and Number of Logical + * Blocks (nlb) exceeds the range of the underlying storage. + * + * Because NVMe specifies the SLBA in blocks as a uint64_t and blockif stores + * the capacity in bytes as a uint64_t, care must be taken to avoid integer + * overflow. + */ +static bool +pci_nvme_out_of_range(struct pci_nvme_blockstore *nvstore, uint64_t slba, + uint32_t nlb) +{ + size_t offset, bytes; + + /* Overflow check of multiplying Starting LBA by the sector size */ + if (slba >> (64 - nvstore->sectsz_bits)) + return (true); + + offset = slba << nvstore->sectsz_bits; + bytes = nlb << nvstore->sectsz_bits; + + /* Overflow check of Number of Logical Blocks */ + if ((nvstore->size - offset) < bytes) + return (true); + + return (false); +} + static int pci_nvme_append_iov_req(struct pci_nvme_softc *sc, struct pci_nvme_ioreq *req, uint64_t gpaddr, size_t size, int do_write, uint64_t lba) @@ -1829,20 +1857,20 @@ nvme_opc_write_read(struct pci_nvme_softc *sc, lba = ((uint64_t)cmd->cdw11 << 32) | cmd->cdw10; nblocks = (cmd->cdw12 & 0xFFFF) + 1; + if (pci_nvme_out_of_range(nvstore, lba, nblocks)) { + WPRINTF("%s command would exceed LBA range", __func__); + pci_nvme_status_genc(status, NVME_SC_LBA_OUT_OF_RANGE); + goto out; + } - bytes = nblocks * nvstore->sectsz; + bytes = nblocks << nvstore->sectsz_bits; if (bytes > NVME_MAX_DATA_SIZE) { WPRINTF("%s command would exceed MDTS", __func__); pci_nvme_status_genc(status, NVME_SC_INVALID_FIELD); goto out; } - offset = lba * nvstore->sectsz; - if ((offset + bytes) > nvstore->size) { - WPRINTF("%s command would exceed LBA range", __func__); - pci_nvme_status_genc(status, NVME_SC_LBA_OUT_OF_RANGE); - goto out; - } + offset = lba << nvstore->sectsz_bits; req->bytes = bytes; req->io_req.br_offset = lba; @@ -1920,8 +1948,9 @@ nvme_opc_dataset_mgmt(struct pci_nvme_softc *sc, if (cmd->cdw11 & NVME_DSM_ATTR_DEALLOCATE) { struct nvme_dsm_range *range; + size_t offset, bytes; uint32_t nr, r; - int sectsz = sc->nvstore.sectsz; + int sectsz_bits = sc->nvstore.sectsz_bits; /* * DSM calls are advisory only, and compliant controllers @@ -1946,10 +1975,13 @@ nvme_opc_dataset_mgmt(struct pci_nvme_softc *sc, nvme_prp_memcpy(sc->nsc_pi->pi_vmctx, cmd->prp1, cmd->prp2, (uint8_t *)range, NVME_MAX_DSM_TRIM, NVME_COPY_FROM_PRP); - if ((range[0].starting_lba * sectsz) > nvstore->size) { + if (pci_nvme_out_of_range(nvstore, range[0].starting_lba, + range[0].length)) { pci_nvme_status_genc(status, NVME_SC_LBA_OUT_OF_RANGE); goto out; } + offset = range[0].starting_lba << sectsz_bits; + bytes = range[0].length << sectsz_bits; /* * If the request is for more than a single range, store @@ -1961,8 +1993,8 @@ nvme_opc_dataset_mgmt(struct pci_nvme_softc *sc, nr = cmd->cdw10 & 0xff; req->io_req.br_iovcnt = 0; - req->io_req.br_offset = range[0].starting_lba * sectsz; - req->io_req.br_resid = range[0].length * sectsz; + req->io_req.br_offset = offset; + req->io_req.br_resid = bytes; if (nr == 0) { req->io_req.br_callback = pci_nvme_io_done; @@ -1970,12 +2002,19 @@ nvme_opc_dataset_mgmt(struct pci_nvme_softc *sc, struct iovec *iov = req->io_req.br_iov; for (r = 0; r <= nr; r++) { - if ((range[r].starting_lba * sectsz) > nvstore->size) { + if (pci_nvme_out_of_range(nvstore, range[r].starting_lba, + range[r].length)) { pci_nvme_status_genc(status, NVME_SC_LBA_OUT_OF_RANGE); goto out; } - iov[r].iov_base = (void *)(range[r].starting_lba * sectsz); - iov[r].iov_len = range[r].length * sectsz; + offset = range[r].starting_lba << sectsz_bits; + bytes = range[r].length << sectsz_bits; + if ((nvstore->size - offset) < bytes) { + pci_nvme_status_genc(status, NVME_SC_LBA_OUT_OF_RANGE); + goto out; + } + iov[r].iov_base = (void *)offset; + iov[r].iov_len = bytes; } req->io_req.br_callback = pci_nvme_dealloc_sm; From owner-svn-src-all@freebsd.org Mon Jul 20 00:33:17 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id ADDB736EE8B; Mon, 20 Jul 2020 00:33:17 +0000 (UTC) (envelope-from chuck@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4B92l141lQz4G1c; Mon, 20 Jul 2020 00:33:17 +0000 (UTC) (envelope-from chuck@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6D8E4246AE; Mon, 20 Jul 2020 00:33:17 +0000 (UTC) (envelope-from chuck@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06K0XHB0001966; Mon, 20 Jul 2020 00:33:17 GMT (envelope-from chuck@FreeBSD.org) Received: (from chuck@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06K0XHvm001965; Mon, 20 Jul 2020 00:33:17 GMT (envelope-from chuck@FreeBSD.org) Message-Id: <202007200033.06K0XHvm001965@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: chuck set sender to chuck@FreeBSD.org using -f From: Chuck Tuffli Date: Mon, 20 Jul 2020 00:33:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r363354 - stable/12/usr.sbin/bhyve X-SVN-Group: stable-12 X-SVN-Commit-Author: chuck X-SVN-Commit-Paths: stable/12/usr.sbin/bhyve X-SVN-Commit-Revision: 363354 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 20 Jul 2020 00:33:17 -0000 Author: chuck Date: Mon Jul 20 00:33:16 2020 New Revision: 363354 URL: https://svnweb.freebsd.org/changeset/base/363354 Log: MFC r362761 bhyve: Add AER support to NVMe emulation Modified: stable/12/usr.sbin/bhyve/pci_nvme.c Directory Properties: stable/12/ (props changed) Modified: stable/12/usr.sbin/bhyve/pci_nvme.c ============================================================================== --- stable/12/usr.sbin/bhyve/pci_nvme.c Mon Jul 20 00:20:55 2020 (r363353) +++ stable/12/usr.sbin/bhyve/pci_nvme.c Mon Jul 20 00:33:16 2020 (r363354) @@ -251,6 +251,11 @@ struct nvme_feature_obj { #define NVME_FID_MAX (NVME_FEAT_ENDURANCE_GROUP_EVENT_CONFIGURATION + 1) +struct pci_nvme_aer { + STAILQ_ENTRY(pci_nvme_aer) link; + uint16_t cid; /* Command ID of the submitted AER */ +}; + struct pci_nvme_softc { struct pci_devinst *nsc_pi; @@ -296,6 +301,9 @@ struct pci_nvme_softc { __uint128_t write_commands; uint32_t read_dunits_remainder; uint32_t write_dunits_remainder; + + STAILQ_HEAD(, pci_nvme_aer) aer_list; + uint32_t aer_count; }; @@ -604,6 +612,93 @@ pci_nvme_init_features(struct pci_nvme_softc *sc) } static void +pci_nvme_aer_init(struct pci_nvme_softc *sc) +{ + + STAILQ_INIT(&sc->aer_list); + sc->aer_count = 0; +} + +static void +pci_nvme_aer_destroy(struct pci_nvme_softc *sc) +{ + struct pci_nvme_aer *aer = NULL; + + while (!STAILQ_EMPTY(&sc->aer_list)) { + aer = STAILQ_FIRST(&sc->aer_list); + STAILQ_REMOVE_HEAD(&sc->aer_list, link); + free(aer); + } + + pci_nvme_aer_init(sc); +} + +static bool +pci_nvme_aer_available(struct pci_nvme_softc *sc) +{ + + return (!STAILQ_EMPTY(&sc->aer_list)); +} + +static bool +pci_nvme_aer_limit_reached(struct pci_nvme_softc *sc) +{ + struct nvme_controller_data *cd = &sc->ctrldata; + + /* AERL is a zero based value while aer_count is one's based */ + return (sc->aer_count == (cd->aerl + 1)); +} + +/* + * Add an Async Event Request + * + * Stores an AER to be returned later if the Controller needs to notify the + * host of an event. + * Note that while the NVMe spec doesn't require Controllers to return AER's + * in order, this implementation does preserve the order. + */ +static int +pci_nvme_aer_add(struct pci_nvme_softc *sc, uint16_t cid) +{ + struct pci_nvme_aer *aer = NULL; + + if (pci_nvme_aer_limit_reached(sc)) + return (-1); + + aer = calloc(1, sizeof(struct pci_nvme_aer)); + if (aer == NULL) + return (-1); + + sc->aer_count++; + + /* Save the Command ID for use in the completion message */ + aer->cid = cid; + STAILQ_INSERT_TAIL(&sc->aer_list, aer, link); + + return (0); +} + +/* + * Get an Async Event Request structure + * + * Returns a pointer to an AER previously submitted by the host or NULL if + * no AER's exist. Caller is responsible for freeing the returned struct. + */ +static struct pci_nvme_aer * +pci_nvme_aer_get(struct pci_nvme_softc *sc) +{ + struct pci_nvme_aer *aer = NULL; + + aer = STAILQ_FIRST(&sc->aer_list); + if (aer != NULL) { + STAILQ_REMOVE_HEAD(&sc->aer_list, link); + sc->aer_count--; + } + + return (aer); +} + +static void pci_nvme_reset_locked(struct pci_nvme_softc *sc) { uint32_t i; @@ -641,6 +736,8 @@ pci_nvme_reset_locked(struct pci_nvme_softc *sc) } sc->num_q_is_set = false; + + pci_nvme_aer_destroy(sc); } static void @@ -1376,13 +1473,26 @@ nvme_opc_async_event_req(struct pci_nvme_softc* sc, { DPRINTF("%s async event request 0x%x", __func__, command->cdw11); + /* Don't exceed the Async Event Request Limit (AERL). */ + if (pci_nvme_aer_limit_reached(sc)) { + pci_nvme_status_tc(&compl->status, NVME_SCT_COMMAND_SPECIFIC, + NVME_SC_ASYNC_EVENT_REQUEST_LIMIT_EXCEEDED); + return (1); + } + + if (pci_nvme_aer_add(sc, command->cid)) { + pci_nvme_status_tc(&compl->status, NVME_SCT_GENERIC, + NVME_SC_INTERNAL_DEVICE_ERROR); + return (1); + } + /* - * TODO: raise events when they happen based on the Set Features cmd. + * Raise events when they happen based on the Set Features cmd. * These events happen async, so only set completion successful if * there is an event reflective of the request to get event. */ - pci_nvme_status_tc(&compl->status, NVME_SCT_COMMAND_SPECIFIC, - NVME_SC_ASYNC_EVENT_REQUEST_LIMIT_EXCEEDED); + compl->status = NVME_NO_STATUS; + return (0); } @@ -1448,10 +1558,7 @@ pci_nvme_handle_admin_cmd(struct pci_nvme_softc* sc, u break; case NVME_OPC_ASYNC_EVENT_REQUEST: DPRINTF("%s command ASYNC_EVENT_REQ", __func__); - /* XXX dont care, unhandled for now nvme_opc_async_event_req(sc, cmd, &compl); - */ - compl.status = NVME_NO_STATUS; break; case NVME_OPC_FORMAT_NVM: DPRINTF("%s command FORMAT_NVM", __func__); @@ -2618,6 +2725,8 @@ pci_nvme_init(struct vmctx *ctx, struct pci_devinst *p pci_nvme_init_ctrldata(sc); pci_nvme_init_logpages(sc); pci_nvme_init_features(sc); + + pci_nvme_aer_init(sc); pci_nvme_reset(sc); From owner-svn-src-all@freebsd.org Mon Jul 20 00:35:43 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5784C36F013; Mon, 20 Jul 2020 00:35:43 +0000 (UTC) (envelope-from chuck@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4B92nq1dqTz4GLS; Mon, 20 Jul 2020 00:35:43 +0000 (UTC) (envelope-from chuck@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 173E924720; Mon, 20 Jul 2020 00:35:43 +0000 (UTC) (envelope-from chuck@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06K0Zg35002149; Mon, 20 Jul 2020 00:35:42 GMT (envelope-from chuck@FreeBSD.org) Received: (from chuck@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06K0ZgTa002148; Mon, 20 Jul 2020 00:35:42 GMT (envelope-from chuck@FreeBSD.org) Message-Id: <202007200035.06K0ZgTa002148@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: chuck set sender to chuck@FreeBSD.org using -f From: Chuck Tuffli Date: Mon, 20 Jul 2020 00:35:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r363355 - stable/12/usr.sbin/bhyve X-SVN-Group: stable-12 X-SVN-Commit-Author: chuck X-SVN-Commit-Paths: stable/12/usr.sbin/bhyve X-SVN-Commit-Revision: 363355 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 20 Jul 2020 00:35:43 -0000 Author: chuck Date: Mon Jul 20 00:35:42 2020 New Revision: 363355 URL: https://svnweb.freebsd.org/changeset/base/363355 Log: MFC r362762 bhyve: add basic NVMe Firmware Commit support Modified: stable/12/usr.sbin/bhyve/pci_nvme.c Directory Properties: stable/12/ (props changed) Modified: stable/12/usr.sbin/bhyve/pci_nvme.c ============================================================================== --- stable/12/usr.sbin/bhyve/pci_nvme.c Mon Jul 20 00:33:16 2020 (r363354) +++ stable/12/usr.sbin/bhyve/pci_nvme.c Mon Jul 20 00:35:42 2020 (r363355) @@ -468,6 +468,9 @@ pci_nvme_init_ctrldata(struct pci_nvme_softc *sc) cd->acl = 2; cd->aerl = 4; + /* Advertise 1, Read-only firmware slot */ + cd->frmw = NVME_CTRLR_DATA_FRMW_SLOT1_RO_MASK | + (1 << NVME_CTRLR_DATA_FRMW_NUM_SLOTS_SHIFT); cd->lpa = 0; /* TODO: support some simple things like SMART */ cd->elpe = 0; /* max error log page entries */ cd->npss = 1; /* number of power states support */ @@ -1555,6 +1558,12 @@ pci_nvme_handle_admin_cmd(struct pci_nvme_softc* sc, u case NVME_OPC_GET_FEATURES: DPRINTF("%s command GET_FEATURES", __func__); nvme_opc_get_features(sc, cmd, &compl); + break; + case NVME_OPC_FIRMWARE_ACTIVATE: + DPRINTF("%s command FIRMWARE_ACTIVATE", __func__); + pci_nvme_status_tc(&compl.status, + NVME_SCT_COMMAND_SPECIFIC, + NVME_SC_INVALID_FIRMWARE_SLOT); break; case NVME_OPC_ASYNC_EVENT_REQUEST: DPRINTF("%s command ASYNC_EVENT_REQ", __func__); From owner-svn-src-all@freebsd.org Mon Jul 20 00:38:22 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 40E6E36F0A5; Mon, 20 Jul 2020 00:38:22 +0000 (UTC) (envelope-from chuck@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4B92rt10c7z4GX2; Mon, 20 Jul 2020 00:38:22 +0000 (UTC) (envelope-from chuck@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 06E8B240F6; Mon, 20 Jul 2020 00:38:22 +0000 (UTC) (envelope-from chuck@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06K0cLeK002309; Mon, 20 Jul 2020 00:38:21 GMT (envelope-from chuck@FreeBSD.org) Received: (from chuck@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06K0cLhB002308; Mon, 20 Jul 2020 00:38:21 GMT (envelope-from chuck@FreeBSD.org) Message-Id: <202007200038.06K0cLhB002308@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: chuck set sender to chuck@FreeBSD.org using -f From: Chuck Tuffli Date: Mon, 20 Jul 2020 00:38:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r363356 - stable/12/usr.sbin/bhyve X-SVN-Group: stable-12 X-SVN-Commit-Author: chuck X-SVN-Commit-Paths: stable/12/usr.sbin/bhyve X-SVN-Commit-Revision: 363356 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 20 Jul 2020 00:38:22 -0000 Author: chuck Date: Mon Jul 20 00:38:21 2020 New Revision: 363356 URL: https://svnweb.freebsd.org/changeset/base/363356 Log: MFC r362763 bhyve: add NVMe Feature Interrupt Vector Config Modified: stable/12/usr.sbin/bhyve/pci_nvme.c Directory Properties: stable/12/ (props changed) Modified: stable/12/usr.sbin/bhyve/pci_nvme.c ============================================================================== --- stable/12/usr.sbin/bhyve/pci_nvme.c Mon Jul 20 00:35:42 2020 (r363355) +++ stable/12/usr.sbin/bhyve/pci_nvme.c Mon Jul 20 00:38:21 2020 (r363356) @@ -356,6 +356,10 @@ static void nvme_feature_num_queues(struct pci_nvme_so struct nvme_feature_obj *, struct nvme_command *, struct nvme_completion *); +static void nvme_feature_iv_config(struct pci_nvme_softc *, + struct nvme_feature_obj *, + struct nvme_command *, + struct nvme_completion *); static __inline void cpywithpad(char *dst, size_t dst_size, const char *src, char pad) @@ -612,6 +616,8 @@ pci_nvme_init_features(struct pci_nvme_softc *sc) sc->feat[NVME_FEAT_LBA_RANGE_TYPE].namespace_specific = true; sc->feat[NVME_FEAT_ERROR_RECOVERY].namespace_specific = true; sc->feat[NVME_FEAT_NUMBER_OF_QUEUES].set = nvme_feature_num_queues; + sc->feat[NVME_FEAT_INTERRUPT_VECTOR_CONFIGURATION].set = + nvme_feature_iv_config; } static void @@ -1273,6 +1279,39 @@ nvme_feature_invalid_cb(struct pci_nvme_softc *sc, { pci_nvme_status_genc(&compl->status, NVME_SC_INVALID_FIELD); +} + +static void +nvme_feature_iv_config(struct pci_nvme_softc *sc, + struct nvme_feature_obj *feat, + struct nvme_command *command, + struct nvme_completion *compl) +{ + uint32_t i; + uint32_t cdw11 = command->cdw11; + uint16_t iv; + bool cd; + + pci_nvme_status_genc(&compl->status, NVME_SC_INVALID_FIELD); + + iv = cdw11 & 0xffff; + cd = cdw11 & (1 << 16); + + if (iv > (sc->max_queues + 1)) { + return; + } + + /* No Interrupt Coalescing (i.e. not Coalescing Disable) for Admin Q */ + if ((iv == 0) && !cd) + return; + + /* Requested Interrupt Vector must be used by a CQ */ + for (i = 0; i < sc->num_cqueues + 1; i++) { + if (sc->compl_queues[i].intr_vec == iv) { + pci_nvme_status_genc(&compl->status, NVME_SC_SUCCESS); + } + } + } static void From owner-svn-src-all@freebsd.org Mon Jul 20 00:39:55 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5091C36F04B; Mon, 20 Jul 2020 00:39:55 +0000 (UTC) (envelope-from chuck@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4B92tg1Q8Fz4GVL; Mon, 20 Jul 2020 00:39:55 +0000 (UTC) (envelope-from chuck@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 147BF240F7; Mon, 20 Jul 2020 00:39:55 +0000 (UTC) (envelope-from chuck@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06K0dsU3002435; Mon, 20 Jul 2020 00:39:54 GMT (envelope-from chuck@FreeBSD.org) Received: (from chuck@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06K0dsGx002434; Mon, 20 Jul 2020 00:39:54 GMT (envelope-from chuck@FreeBSD.org) Message-Id: <202007200039.06K0dsGx002434@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: chuck set sender to chuck@FreeBSD.org using -f From: Chuck Tuffli Date: Mon, 20 Jul 2020 00:39:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r363357 - stable/12/usr.sbin/bhyve X-SVN-Group: stable-12 X-SVN-Commit-Author: chuck X-SVN-Commit-Paths: stable/12/usr.sbin/bhyve X-SVN-Commit-Revision: 363357 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 20 Jul 2020 00:39:55 -0000 Author: chuck Date: Mon Jul 20 00:39:54 2020 New Revision: 363357 URL: https://svnweb.freebsd.org/changeset/base/363357 Log: MFC r362764 bhyve: fix NVMe Get Features, Predictable Latency Modified: stable/12/usr.sbin/bhyve/pci_nvme.c Directory Properties: stable/12/ (props changed) Modified: stable/12/usr.sbin/bhyve/pci_nvme.c ============================================================================== --- stable/12/usr.sbin/bhyve/pci_nvme.c Mon Jul 20 00:38:21 2020 (r363356) +++ stable/12/usr.sbin/bhyve/pci_nvme.c Mon Jul 20 00:39:54 2020 (r363357) @@ -618,6 +618,10 @@ pci_nvme_init_features(struct pci_nvme_softc *sc) sc->feat[NVME_FEAT_NUMBER_OF_QUEUES].set = nvme_feature_num_queues; sc->feat[NVME_FEAT_INTERRUPT_VECTOR_CONFIGURATION].set = nvme_feature_iv_config; + sc->feat[NVME_FEAT_PREDICTABLE_LATENCY_MODE_CONFIG].get = + nvme_feature_invalid_cb; + sc->feat[NVME_FEAT_PREDICTABLE_LATENCY_MODE_WINDOW].get = + nvme_feature_invalid_cb; } static void From owner-svn-src-all@freebsd.org Mon Jul 20 00:42:34 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E3AA036EFD8; Mon, 20 Jul 2020 00:42:34 +0000 (UTC) (envelope-from chuck@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4B92xk5nqTz4GZR; Mon, 20 Jul 2020 00:42:34 +0000 (UTC) (envelope-from chuck@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AA5992488B; Mon, 20 Jul 2020 00:42:34 +0000 (UTC) (envelope-from chuck@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06K0gYdR008567; Mon, 20 Jul 2020 00:42:34 GMT (envelope-from chuck@FreeBSD.org) Received: (from chuck@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06K0gY0s008566; Mon, 20 Jul 2020 00:42:34 GMT (envelope-from chuck@FreeBSD.org) Message-Id: <202007200042.06K0gY0s008566@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: chuck set sender to chuck@FreeBSD.org using -f From: Chuck Tuffli Date: Mon, 20 Jul 2020 00:42:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r363358 - stable/12/usr.sbin/bhyve X-SVN-Group: stable-12 X-SVN-Commit-Author: chuck X-SVN-Commit-Paths: stable/12/usr.sbin/bhyve X-SVN-Commit-Revision: 363358 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 20 Jul 2020 00:42:35 -0000 Author: chuck Date: Mon Jul 20 00:42:34 2020 New Revision: 363358 URL: https://svnweb.freebsd.org/changeset/base/363358 Log: MFC r362765 bhyve: NVMe handle zero length DSM ranges Modified: stable/12/usr.sbin/bhyve/pci_nvme.c Directory Properties: stable/12/ (props changed) Modified: stable/12/usr.sbin/bhyve/pci_nvme.c ============================================================================== --- stable/12/usr.sbin/bhyve/pci_nvme.c Mon Jul 20 00:39:54 2020 (r363357) +++ stable/12/usr.sbin/bhyve/pci_nvme.c Mon Jul 20 00:42:34 2020 (r363358) @@ -2097,6 +2097,8 @@ nvme_opc_dataset_mgmt(struct pci_nvme_softc *sc, struct pci_nvme_ioreq *req, uint16_t *status) { + struct nvme_dsm_range *range; + uint32_t nr, r, non_zero, dr; int err; bool pending = false; @@ -2105,10 +2107,31 @@ nvme_opc_dataset_mgmt(struct pci_nvme_softc *sc, goto out; } + nr = cmd->cdw10 & 0xff; + + /* copy locally because a range entry could straddle PRPs */ + range = calloc(1, NVME_MAX_DSM_TRIM); + if (range == NULL) { + pci_nvme_status_genc(status, NVME_SC_INTERNAL_DEVICE_ERROR); + goto out; + } + nvme_prp_memcpy(sc->nsc_pi->pi_vmctx, cmd->prp1, cmd->prp2, + (uint8_t *)range, NVME_MAX_DSM_TRIM, NVME_COPY_FROM_PRP); + + /* Check for invalid ranges and the number of non-zero lengths */ + non_zero = 0; + for (r = 0; r <= nr; r++) { + if (pci_nvme_out_of_range(nvstore, + range[r].starting_lba, range[r].length)) { + pci_nvme_status_genc(status, NVME_SC_LBA_OUT_OF_RANGE); + goto out; + } + if (range[r].length != 0) + non_zero++; + } + if (cmd->cdw11 & NVME_DSM_ATTR_DEALLOCATE) { - struct nvme_dsm_range *range; size_t offset, bytes; - uint32_t nr, r; int sectsz_bits = sc->nvstore.sectsz_bits; /* @@ -2120,25 +2143,17 @@ nvme_opc_dataset_mgmt(struct pci_nvme_softc *sc, goto out; } - if (req == NULL) { - pci_nvme_status_genc(status, NVME_SC_INTERNAL_DEVICE_ERROR); + /* If all ranges have a zero length, return Success */ + if (non_zero == 0) { + pci_nvme_status_genc(status, NVME_SC_SUCCESS); goto out; } - /* copy locally because a range entry could straddle PRPs */ - range = calloc(1, NVME_MAX_DSM_TRIM); - if (range == NULL) { + if (req == NULL) { pci_nvme_status_genc(status, NVME_SC_INTERNAL_DEVICE_ERROR); goto out; } - nvme_prp_memcpy(sc->nsc_pi->pi_vmctx, cmd->prp1, cmd->prp2, - (uint8_t *)range, NVME_MAX_DSM_TRIM, NVME_COPY_FROM_PRP); - if (pci_nvme_out_of_range(nvstore, range[0].starting_lba, - range[0].length)) { - pci_nvme_status_genc(status, NVME_SC_LBA_OUT_OF_RANGE); - goto out; - } offset = range[0].starting_lba << sectsz_bits; bytes = range[0].length << sectsz_bits; @@ -2149,8 +2164,6 @@ nvme_opc_dataset_mgmt(struct pci_nvme_softc *sc, * * Note that NVMe Number of Ranges is a zero based value */ - nr = cmd->cdw10 & 0xff; - req->io_req.br_iovcnt = 0; req->io_req.br_offset = offset; req->io_req.br_resid = bytes; @@ -2160,20 +2173,20 @@ nvme_opc_dataset_mgmt(struct pci_nvme_softc *sc, } else { struct iovec *iov = req->io_req.br_iov; - for (r = 0; r <= nr; r++) { - if (pci_nvme_out_of_range(nvstore, range[r].starting_lba, - range[r].length)) { - pci_nvme_status_genc(status, NVME_SC_LBA_OUT_OF_RANGE); - goto out; - } + for (r = 0, dr = 0; r <= nr; r++) { offset = range[r].starting_lba << sectsz_bits; bytes = range[r].length << sectsz_bits; + if (bytes == 0) + continue; + if ((nvstore->size - offset) < bytes) { - pci_nvme_status_genc(status, NVME_SC_LBA_OUT_OF_RANGE); + pci_nvme_status_genc(status, + NVME_SC_LBA_OUT_OF_RANGE); goto out; } - iov[r].iov_base = (void *)offset; - iov[r].iov_len = bytes; + iov[dr].iov_base = (void *)offset; + iov[dr].iov_len = bytes; + dr++; } req->io_req.br_callback = pci_nvme_dealloc_sm; @@ -2182,7 +2195,7 @@ nvme_opc_dataset_mgmt(struct pci_nvme_softc *sc, * prev_size to track the number of entries */ req->prev_gpaddr = 0; - req->prev_size = r; + req->prev_size = dr; } err = blockif_delete(nvstore->ctx, &req->io_req); @@ -2190,10 +2203,9 @@ nvme_opc_dataset_mgmt(struct pci_nvme_softc *sc, pci_nvme_status_genc(status, NVME_SC_INTERNAL_DEVICE_ERROR); else pending = true; - - free(range); } out: + free(range); return (pending); } From owner-svn-src-all@freebsd.org Mon Jul 20 00:44:27 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id EB48536EF6F; Mon, 20 Jul 2020 00:44:27 +0000 (UTC) (envelope-from chuck@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4B92zv5yPLz4GgM; Mon, 20 Jul 2020 00:44:27 +0000 (UTC) (envelope-from chuck@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AFED2244B5; Mon, 20 Jul 2020 00:44:27 +0000 (UTC) (envelope-from chuck@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06K0iRFL008733; Mon, 20 Jul 2020 00:44:27 GMT (envelope-from chuck@FreeBSD.org) Received: (from chuck@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06K0iR0t008732; Mon, 20 Jul 2020 00:44:27 GMT (envelope-from chuck@FreeBSD.org) Message-Id: <202007200044.06K0iR0t008732@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: chuck set sender to chuck@FreeBSD.org using -f From: Chuck Tuffli Date: Mon, 20 Jul 2020 00:44:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r363359 - stable/12/usr.sbin/bhyve X-SVN-Group: stable-12 X-SVN-Commit-Author: chuck X-SVN-Commit-Paths: stable/12/usr.sbin/bhyve X-SVN-Commit-Revision: 363359 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 20 Jul 2020 00:44:28 -0000 Author: chuck Date: Mon Jul 20 00:44:27 2020 New Revision: 363359 URL: https://svnweb.freebsd.org/changeset/base/363359 Log: MFC r362766 bhyve: fix NVMe Active Namespace list Modified: stable/12/usr.sbin/bhyve/pci_nvme.c Directory Properties: stable/12/ (props changed) Modified: stable/12/usr.sbin/bhyve/pci_nvme.c ============================================================================== --- stable/12/usr.sbin/bhyve/pci_nvme.c Mon Jul 20 00:42:34 2020 (r363358) +++ stable/12/usr.sbin/bhyve/pci_nvme.c Mon Jul 20 00:44:27 2020 (r363359) @@ -1144,8 +1144,9 @@ nvme_opc_identify(struct pci_nvme_softc* sc, struct nv case 0x02: /* list of 1024 active NSIDs > CDW1.NSID */ dest = vm_map_gpa(sc->nsc_pi->pi_vmctx, command->prp1, sizeof(uint32_t) * 1024); + /* All unused entries shall be zero */ + bzero(dest, sizeof(uint32_t) * 1024); ((uint32_t *)dest)[0] = 1; - ((uint32_t *)dest)[1] = 0; break; case 0x03: /* list of NSID structures in CDW1.NSID, 4096 bytes */ if (command->nsid != 1) { From owner-svn-src-all@freebsd.org Mon Jul 20 01:55:20 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8773537019E; Mon, 20 Jul 2020 01:55:20 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4B94Yh313cz4Jkv; Mon, 20 Jul 2020 01:55:20 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4756C25424; Mon, 20 Jul 2020 01:55:20 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06K1tKlT051223; Mon, 20 Jul 2020 01:55:20 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06K1tKjK051222; Mon, 20 Jul 2020 01:55:20 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <202007200155.06K1tKjK051222@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Mon, 20 Jul 2020 01:55:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363360 - head/sys/geom X-SVN-Group: head X-SVN-Commit-Author: delphij X-SVN-Commit-Paths: head/sys/geom X-SVN-Commit-Revision: 363360 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 20 Jul 2020 01:55:20 -0000 Author: delphij Date: Mon Jul 20 01:55:19 2020 New Revision: 363360 URL: https://svnweb.freebsd.org/changeset/base/363360 Log: Fix indent for if clause. MFC after: 2 weeks Modified: head/sys/geom/geom_ccd.c Modified: head/sys/geom/geom_ccd.c ============================================================================== --- head/sys/geom/geom_ccd.c Mon Jul 20 00:44:27 2020 (r363359) +++ head/sys/geom/geom_ccd.c Mon Jul 20 01:55:19 2020 (r363360) @@ -917,7 +917,7 @@ g_ccd_config(struct gctl_req *req, struct g_class *mp, } else if (!strcmp(verb, "destroy geom")) { gp = gctl_get_geom(req, mp, "geom"); if (gp != NULL) - g_ccd_destroy_geom(req, mp, gp); + g_ccd_destroy_geom(req, mp, gp); } else if (!strcmp(verb, "list")) { g_ccd_list(req, mp); } else { From owner-svn-src-all@freebsd.org Mon Jul 20 12:47:17 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 41C8435DA8B; Mon, 20 Jul 2020 12:47:17 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4B9M1x0mQ6z3yZf; Mon, 20 Jul 2020 12:47:17 +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 D9131CE6E; Mon, 20 Jul 2020 12:47:16 +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 06KClGq8052819; Mon, 20 Jul 2020 12:47:16 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06KClGgB052816; Mon, 20 Jul 2020 12:47:16 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <202007201247.06KClGgB052816@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Mon, 20 Jul 2020 12:47:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363361 - head/tests/sys/opencrypto X-SVN-Group: head X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: head/tests/sys/opencrypto X-SVN-Commit-Revision: 363361 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 20 Jul 2020 12:47:17 -0000 Author: asomers Date: Mon Jul 20 12:47:15 2020 New Revision: 363361 URL: https://svnweb.freebsd.org/changeset/base/363361 Log: tests/sys/opencrypto: use python3 python2 will be EOL soon Reviewed by: lwhsu, jmg MFC after: 2 weeks Sponsored by: Axcient Differential Revision: https://reviews.freebsd.org/D25682 Modified: head/tests/sys/opencrypto/Makefile head/tests/sys/opencrypto/cryptodev.py head/tests/sys/opencrypto/cryptotest.py head/tests/sys/opencrypto/runtests.sh Modified: head/tests/sys/opencrypto/Makefile ============================================================================== --- head/tests/sys/opencrypto/Makefile Mon Jul 20 01:55:19 2020 (r363360) +++ head/tests/sys/opencrypto/Makefile Mon Jul 20 12:47:15 2020 (r363361) @@ -14,7 +14,7 @@ ATF_TESTS_C+= blake2_test poly1305_test TAP_TESTS_SH+= runtests -TEST_METADATA.runtests+= required_programs="python2" +TEST_METADATA.runtests+= required_programs="python3" TEST_METADATA.runtests+= required_user="root" PYMODULES= cryptodev.py cryptodevh.py cryptotest.py Modified: head/tests/sys/opencrypto/cryptodev.py ============================================================================== --- head/tests/sys/opencrypto/cryptodev.py Mon Jul 20 01:55:19 2020 (r363360) +++ head/tests/sys/opencrypto/cryptodev.py Mon Jul 20 12:47:15 2020 (r363361) @@ -1,4 +1,4 @@ -#!/usr/local/bin/python2 +#!/usr/local/bin/python3 # # Copyright (c) 2014 The FreeBSD Foundation # Copyright 2014 John-Mark Gurney @@ -31,7 +31,7 @@ # $FreeBSD$ # -from __future__ import print_function + import array import binascii from fcntl import ioctl Modified: head/tests/sys/opencrypto/cryptotest.py ============================================================================== --- head/tests/sys/opencrypto/cryptotest.py Mon Jul 20 01:55:19 2020 (r363360) +++ head/tests/sys/opencrypto/cryptotest.py Mon Jul 20 12:47:15 2020 (r363361) @@ -1,4 +1,4 @@ -#!/usr/local/bin/python2 +#!/usr/local/bin/python3 # # Copyright (c) 2014 The FreeBSD Foundation # All rights reserved. @@ -30,7 +30,7 @@ # $FreeBSD$ # -from __future__ import print_function + import binascii import errno Modified: head/tests/sys/opencrypto/runtests.sh ============================================================================== --- head/tests/sys/opencrypto/runtests.sh Mon Jul 20 01:55:19 2020 (r363360) +++ head/tests/sys/opencrypto/runtests.sh Mon Jul 20 12:47:15 2020 (r363361) @@ -30,7 +30,7 @@ # $FreeBSD$ # -: ${PYTHON=python2} +: ${PYTHON=python3} if [ ! -d /usr/local/share/nist-kat ]; then echo "1..0 # SKIP: nist-kat package not installed for test vectors" From owner-svn-src-all@freebsd.org Mon Jul 20 13:01:20 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0BC2935DD9F; Mon, 20 Jul 2020 13:01:20 +0000 (UTC) (envelope-from gbe@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4B9ML76bJFz40Q7; Mon, 20 Jul 2020 13:01:19 +0000 (UTC) (envelope-from gbe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C5D98CFBF; Mon, 20 Jul 2020 13:01:19 +0000 (UTC) (envelope-from gbe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06KD1Jaw059327; Mon, 20 Jul 2020 13:01:19 GMT (envelope-from gbe@FreeBSD.org) Received: (from gbe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06KD1JZK059326; Mon, 20 Jul 2020 13:01:19 GMT (envelope-from gbe@FreeBSD.org) Message-Id: <202007201301.06KD1JZK059326@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gbe set sender to gbe@FreeBSD.org using -f From: Gordon Bergling Date: Mon, 20 Jul 2020 13:01:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363362 - head/cddl/contrib/opensolaris/cmd/zpool X-SVN-Group: head X-SVN-Commit-Author: gbe X-SVN-Commit-Paths: head/cddl/contrib/opensolaris/cmd/zpool X-SVN-Commit-Revision: 363362 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 20 Jul 2020 13:01:20 -0000 Author: gbe (doc committer) Date: Mon Jul 20 13:01:19 2020 New Revision: 363362 URL: https://svnweb.freebsd.org/changeset/base/363362 Log: zpool(8): Fix a few typos regarding 'inverval' -> 'interval' PR: 248068 Submitted by: PauAmma Reviewed by: bcr (mentor) Approved by: bcr (mentor) Differential Revision: https://reviews.freebsd.org/D25719 Modified: head/cddl/contrib/opensolaris/cmd/zpool/zpool.8 Modified: head/cddl/contrib/opensolaris/cmd/zpool/zpool.8 ============================================================================== --- head/cddl/contrib/opensolaris/cmd/zpool/zpool.8 Mon Jul 20 12:47:15 2020 (r363361) +++ head/cddl/contrib/opensolaris/cmd/zpool/zpool.8 Mon Jul 20 13:01:19 2020 (r363362) @@ -134,7 +134,7 @@ .Op Fl gLP .Op Ar pool .Ar ... -.Op Ar inverval Op Ar count +.Op Ar interval Op Ar count .Nm .Cm labelclear .Op Fl f @@ -146,7 +146,7 @@ .Op Fl T Cm d Ns | Ns Cm u .Op Ar pool .Ar ... -.Op Ar inverval Op Ar count +.Op Ar interval Op Ar count .Nm .Cm offline .Op Fl t @@ -1654,7 +1654,7 @@ Treat exported or foreign devices as inactive. .Op Fl T Cm d Ns | Ns Cm u .Op Ar pool .Ar ... -.Op Ar inverval Op Ar count +.Op Ar interval Op Ar count .Xc .Pp Lists the given pools along with a health status and space usage. If no From owner-svn-src-all@freebsd.org Mon Jul 20 13:24:51 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2BF7D35E678; Mon, 20 Jul 2020 13:24:51 +0000 (UTC) (envelope-from gbe@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4B9MsH0MCRz423g; Mon, 20 Jul 2020 13:24:51 +0000 (UTC) (envelope-from gbe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CC4B5D0F5; Mon, 20 Jul 2020 13:24:50 +0000 (UTC) (envelope-from gbe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06KDOoIe077930; Mon, 20 Jul 2020 13:24:50 GMT (envelope-from gbe@FreeBSD.org) Received: (from gbe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06KDOoti077929; Mon, 20 Jul 2020 13:24:50 GMT (envelope-from gbe@FreeBSD.org) Message-Id: <202007201324.06KDOoti077929@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gbe set sender to gbe@FreeBSD.org using -f From: Gordon Bergling Date: Mon, 20 Jul 2020 13:24:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363363 - head/lib/geom/eli X-SVN-Group: head X-SVN-Commit-Author: gbe X-SVN-Commit-Paths: head/lib/geom/eli X-SVN-Commit-Revision: 363363 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 20 Jul 2020 13:24:51 -0000 Author: gbe (doc committer) Date: Mon Jul 20 13:24:50 2020 New Revision: 363363 URL: https://svnweb.freebsd.org/changeset/base/363363 Log: geli(8): Add an example on how to use geli(8) with a file as encrypted storage Reviewed by: bcr (mentor) Approved by: bcr (mentor) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D25741 Modified: head/lib/geom/eli/geli.8 Modified: head/lib/geom/eli/geli.8 ============================================================================== --- head/lib/geom/eli/geli.8 Mon Jul 20 13:01:19 2020 (r363362) +++ head/lib/geom/eli/geli.8 Mon Jul 20 13:24:50 2020 (r363363) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 14, 2020 +.Dd July 20, 2020 .Dt GELI 8 .Os .Sh NAME @@ -1095,6 +1095,64 @@ resuming the laptop: # geli resume gpt/private Enter passphrase: .Ed +.Pp +To create a +.Nm +encrypted filesystem with a file as storage device follow this example. +First a file named private0 is created in +.Pa /usr +and attached as a memory disk like +.Pa /dev/md0 +for example. +.Bd -literal -offset indent +# dd if=/dev/zero of=/usr/private0 bs=1m count=256 +# chmod 0600 /usr/private0 +# mdconfig -t vnode -f /usr/private0 +.Ed +.Pp +It is recommended to place the following line in +.Xr rc.conf 5 +to have the memory disk automatically created during boot. +.Bd -literal -offset indent +mdconfig_md0="-t vnode -f /usr/private0" +.Ed +.Pp +After +.Pa /dev/md0 +is created a random key has to be generated and stored in a secure location, +like +.Pa /root +for example. +This key should be protected by a passphrase, which +is requested when geli init is called. +.Bd -literal -offset indent +# dd if=/dev/random of=/root/private0.key bs=64 count=1 +# geli init -K /root/private0.key -s 4096 /dev/md0 +Enter new passphrase: +Reenter new passphrase: +# dd if=/dev/random of=/dev/md0.eli bs=1m +.Ed +.Pp +Once the initialization of the +.Pa /dev/md0.eli +device is ready create a UFS filesystem and mount it for example in +.Pa /private . +.Bd -literal -offset indent +# newfs /dev/md0.eli +# mount /dev/md0.eli /private +.Ed +.Pp +After a system reboot the +.Nm +device can be mounted again with the following commands. +The call of geli attach will ask for the passphrase. +It is recommended to do this procedure after the boot, because otherwise +the boot process would be waiting for the passphrase input. +.Bd -literal -offset indent +# geli attach -k /root/private0.key /dev/md0 +Enter new passphrase: +# mount /dev/md0.eli /private +.Ed .Sh ENCRYPTION MODES .Nm supports two encryption modes: @@ -1157,7 +1215,9 @@ block cipher was implemented by Yoshisato Yanagisawa i .Pp Highest .Nm GELI -metadata version supported by the given FreeBSD version: +metadata version supported by the given +.Fx +version: .Bl -column -offset indent ".Sy FreeBSD" ".Sy version" .It Sy FreeBSD Ta Sy GELI .It Sy version Ta Sy version From owner-svn-src-all@freebsd.org Mon Jul 20 13:30:42 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A4F6035ED7C; Mon, 20 Jul 2020 13:30:42 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4B9N023xjmz42tt; Mon, 20 Jul 2020 13:30:42 +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 6ADCCD5D6; Mon, 20 Jul 2020 13:30:42 +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 06KDUgrG078697; Mon, 20 Jul 2020 13:30:42 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06KDUgqC078696; Mon, 20 Jul 2020 13:30:42 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202007201330.06KDUgqC078696@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 20 Jul 2020 13:30:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r363364 - stable/12/sys/arm64/arm64 X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/12/sys/arm64/arm64 X-SVN-Commit-Revision: 363364 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 20 Jul 2020 13:30:42 -0000 Author: markj Date: Mon Jul 20 13:30:42 2020 New Revision: 363364 URL: https://svnweb.freebsd.org/changeset/base/363364 Log: MFC r363162: Print arm64 physmem info during boot. PR: 243682 Modified: stable/12/sys/arm64/arm64/machdep.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/arm64/arm64/machdep.c ============================================================================== --- stable/12/sys/arm64/arm64/machdep.c Mon Jul 20 13:24:50 2020 (r363363) +++ stable/12/sys/arm64/arm64/machdep.c Mon Jul 20 13:30:42 2020 (r363364) @@ -60,11 +60,14 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include +#include #include #include #include +#include #include #include #include @@ -162,6 +165,26 @@ pan_enable(void) static void cpu_startup(void *dummy) { + vm_paddr_t size; + int i; + + printf("real memory = %ju (%ju MB)\n", ptoa((uintmax_t)realmem), + ptoa((uintmax_t)realmem) / 1024 / 1024); + + if (bootverbose) { + printf("Physical memory chunk(s):\n"); + for (i = 0; phys_avail[i + 1] != 0; i += 2) { + size = phys_avail[i + 1] - phys_avail[i]; + printf("%#016jx - %#016jx, %ju bytes (%ju pages)\n", + (uintmax_t)phys_avail[i], + (uintmax_t)phys_avail[i + 1] - 1, + (uintmax_t)size, (uintmax_t)size / PAGE_SIZE); + } + } + + printf("avail memory = %ju (%ju MB)\n", + ptoa((uintmax_t)vm_free_count()), + ptoa((uintmax_t)vm_free_count()) / 1024 / 1024); undef_init(); identify_cpu(); From owner-svn-src-all@freebsd.org Mon Jul 20 13:37:16 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8BB6F35F79E; Mon, 20 Jul 2020 13:37:16 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4B9N7b3kkDz43Rf; Mon, 20 Jul 2020 13:37:15 +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 63B12DAAF; Mon, 20 Jul 2020 13:37:15 +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 06KDbFJJ084769; Mon, 20 Jul 2020 13:37:15 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06KDbFsS084768; Mon, 20 Jul 2020 13:37:15 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202007201337.06KDbFsS084768@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 20 Jul 2020 13:37:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r363365 - stable/12/sbin/ping X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/12/sbin/ping X-SVN-Commit-Revision: 363365 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 20 Jul 2020 13:37:16 -0000 Author: markj Date: Mon Jul 20 13:37:14 2020 New Revision: 363365 URL: https://svnweb.freebsd.org/changeset/base/363365 Log: MFC r363102: ping(8): Check for integer truncation when handling the value for -s. PR: 239976 Modified: stable/12/sbin/ping/ping.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sbin/ping/ping.c ============================================================================== --- stable/12/sbin/ping/ping.c Mon Jul 20 13:30:42 2020 (r363364) +++ stable/12/sbin/ping/ping.c Mon Jul 20 13:37:14 2020 (r363365) @@ -475,7 +475,7 @@ main(int argc, char *const *argv) break; case 's': /* size of packet to send */ ltmp = strtol(optarg, &ep, 0); - if (*ep || ep == optarg || ltmp < 0) + if (*ep || ep == optarg || ltmp > INT_MAX || ltmp < 0) errx(EX_USAGE, "invalid packet size: `%s'", optarg); if (uid != 0 && ltmp > DEFDATALEN) { From owner-svn-src-all@freebsd.org Mon Jul 20 13:50:12 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 75A6F35FAE6; Mon, 20 Jul 2020 13:50:12 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4B9NQW6nqbz445V; Mon, 20 Jul 2020 13:50:11 +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 44EEDDBB6; Mon, 20 Jul 2020 13:50:11 +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 06KDoBmP091310; Mon, 20 Jul 2020 13:50:11 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06KDoAb2091306; Mon, 20 Jul 2020 13:50:10 GMT (envelope-from mav@FreeBSD.org) Message-Id: <202007201350.06KDoAb2091306@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Mon, 20 Jul 2020 13:50:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r363366 - in stable/12: lib/libpmc lib/libpmc/pmu-events/arch/x86 sys/dev/hwpmc X-SVN-Group: stable-12 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: in stable/12: lib/libpmc lib/libpmc/pmu-events/arch/x86 sys/dev/hwpmc X-SVN-Commit-Revision: 363366 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 20 Jul 2020 13:50:12 -0000 Author: mav Date: Mon Jul 20 13:50:10 2020 New Revision: 363366 URL: https://svnweb.freebsd.org/changeset/base/363366 Log: MFC r363144, r363188: Add stepping to the kern.hwpmc.cpuid string on x86. It follows the equivalent Linux change to be able to differentiate skylakex and cascadelakex, sharing the same model but not stepping. Modified: stable/12/lib/libpmc/libpmc_pmu_util.c stable/12/lib/libpmc/pmu-events/arch/x86/mapfile.csv stable/12/sys/dev/hwpmc/hwpmc_amd.c stable/12/sys/dev/hwpmc/hwpmc_intel.c Directory Properties: stable/12/ (props changed) Modified: stable/12/lib/libpmc/libpmc_pmu_util.c ============================================================================== --- stable/12/lib/libpmc/libpmc_pmu_util.c Mon Jul 20 13:37:14 2020 (r363365) +++ stable/12/lib/libpmc/libpmc_pmu_util.c Mon Jul 20 13:50:10 2020 (r363366) @@ -169,7 +169,7 @@ pmu_events_map_get(const char *cpuid) { regex_t re; regmatch_t pmatch[1]; - size_t s, len; + size_t s; char buf[64]; int match; const struct pmu_events_map *pme; @@ -193,8 +193,8 @@ pmu_events_map_get(const char *cpuid) match = regexec(&re, buf, 1, pmatch, 0); regfree(&re); if (match == 0) { - len = pmatch[0].rm_eo - pmatch[0].rm_so; - if(len == strlen(buf)) + if (pmatch[0].rm_so == 0 && (buf[pmatch[0].rm_eo] == 0 + || buf[pmatch[0].rm_eo] == '-')) return (pme); } } Modified: stable/12/lib/libpmc/pmu-events/arch/x86/mapfile.csv ============================================================================== --- stable/12/lib/libpmc/pmu-events/arch/x86/mapfile.csv Mon Jul 20 13:37:14 2020 (r363365) +++ stable/12/lib/libpmc/pmu-events/arch/x86/mapfile.csv Mon Jul 20 13:50:10 2020 (r363366) @@ -24,19 +24,15 @@ GenuineIntel-6-1E,v2,nehalemep,core GenuineIntel-6-1F,v2,nehalemep,core GenuineIntel-6-1A,v2,nehalemep,core GenuineIntel-6-2E,v2,nehalemex,core -GenuineIntel-6-4E,v24,skylake,core -GenuineIntel-6-5E,v24,skylake,core -GenuineIntel-6-8E,v24,skylake,core -GenuineIntel-6-9E,v24,skylake,core +GenuineIntel-6-[4589]E,v24,skylake,core GenuineIntel-6-37,v13,silvermont,core GenuineIntel-6-4D,v13,silvermont,core GenuineIntel-6-4C,v13,silvermont,core GenuineIntel-6-2A,v15,sandybridge,core GenuineIntel-6-2C,v2,westmereep-dp,core -GenuineIntel-6-2C,v2,westmereep-dp,core GenuineIntel-6-25,v2,westmereep-sp,core GenuineIntel-6-2F,v2,westmereex,core -GenuineIntel-6-55,v1,skylakex,core +GenuineIntel-6-55-[01234],v1,skylakex,core GenuineIntel-6-55-[56789ABCDEF],v1,cascadelakex,core GenuineIntel-6-7D,v1,icelake,core GenuineIntel-6-7E,v1,icelake,core Modified: stable/12/sys/dev/hwpmc/hwpmc_amd.c ============================================================================== --- stable/12/sys/dev/hwpmc/hwpmc_amd.c Mon Jul 20 13:37:14 2020 (r363365) +++ stable/12/sys/dev/hwpmc/hwpmc_amd.c Mon Jul 20 13:50:10 2020 (r363366) @@ -1073,7 +1073,7 @@ pmc_amd_initialize(void) enum pmc_cputype cputype; struct pmc_mdep *pmc_mdep; enum pmc_class class; - int model; + int model, stepping; char *name; /* @@ -1086,12 +1086,13 @@ pmc_amd_initialize(void) name = NULL; model = ((cpu_id & 0xF0000) >> 12) | ((cpu_id & 0xF0) >> 4); + stepping = cpu_id & 0xF; if (CPUID_TO_FAMILY(cpu_id) == 0x17) - snprintf(pmc_cpuid, sizeof(pmc_cpuid), "AuthenticAMD-%d-%02X", - CPUID_TO_FAMILY(cpu_id), model); + snprintf(pmc_cpuid, sizeof(pmc_cpuid), "AuthenticAMD-%d-%02X-%X", + CPUID_TO_FAMILY(cpu_id), model, stepping); if (CPUID_TO_FAMILY(cpu_id) == 0x18) - snprintf(pmc_cpuid, sizeof(pmc_cpuid), "HygonGenuine-%d-%02X", - CPUID_TO_FAMILY(cpu_id), model); + snprintf(pmc_cpuid, sizeof(pmc_cpuid), "HygonGenuine-%d-%02X-%X", + CPUID_TO_FAMILY(cpu_id), model, stepping); switch (cpu_id & 0xF00) { #if defined(__i386__) Modified: stable/12/sys/dev/hwpmc/hwpmc_intel.c ============================================================================== --- stable/12/sys/dev/hwpmc/hwpmc_intel.c Mon Jul 20 13:37:14 2020 (r363365) +++ stable/12/sys/dev/hwpmc/hwpmc_intel.c Mon Jul 20 13:50:10 2020 (r363366) @@ -94,8 +94,8 @@ pmc_intel_initialize(void) model = ((cpu_id & 0xF0000) >> 12) | ((cpu_id & 0xF0) >> 4); stepping = cpu_id & 0xF; - snprintf(pmc_cpuid, sizeof(pmc_cpuid), "GenuineIntel-%d-%02X", - (cpu_id & 0xF00) >> 8, model); + snprintf(pmc_cpuid, sizeof(pmc_cpuid), "GenuineIntel-%d-%02X-%X", + (cpu_id & 0xF00) >> 8, model, stepping); switch (cpu_id & 0xF00) { case 0x600: /* Pentium Pro, Celeron, Pentium II & III */ switch (model) { From owner-svn-src-all@freebsd.org Mon Jul 20 14:28:28 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 32F5B360785; Mon, 20 Jul 2020 14:28:28 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4B9PGh0bPCz46SV; Mon, 20 Jul 2020 14:28:28 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EBD7CE501; Mon, 20 Jul 2020 14:28:27 +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 06KESRiv016207; Mon, 20 Jul 2020 14:28:27 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06KESQ6B016198; Mon, 20 Jul 2020 14:28:26 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202007201428.06KESQ6B016198@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 20 Jul 2020 14:28:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363367 - head/sys/fs/ext2fs X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/fs/ext2fs X-SVN-Commit-Revision: 363367 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 20 Jul 2020 14:28:28 -0000 Author: markj Date: Mon Jul 20 14:28:26 2020 New Revision: 363367 URL: https://svnweb.freebsd.org/changeset/base/363367 Log: ext2fs: Stop checking for failures from malloc(M_WAITOK). PR: 240545 Submitted by: Andrew Reiter Reviewed by: fsu MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D25707 Modified: head/sys/fs/ext2fs/ext2_acl.c head/sys/fs/ext2fs/ext2_alloc.c head/sys/fs/ext2fs/ext2_extents.c head/sys/fs/ext2fs/ext2_lookup.c head/sys/fs/ext2fs/ext2_vnops.c Modified: head/sys/fs/ext2fs/ext2_acl.c ============================================================================== --- head/sys/fs/ext2fs/ext2_acl.c Mon Jul 20 13:50:10 2020 (r363366) +++ head/sys/fs/ext2fs/ext2_acl.c Mon Jul 20 14:28:26 2020 (r363367) @@ -234,8 +234,6 @@ ext2_getacl_posix1e(struct vop_getacl_args *ap) len = sizeof(*ap->a_aclp) + sizeof(struct ext2_acl_header); value = malloc(len, M_ACL, M_WAITOK); - if (!value) - return (ENOMEM); error = vn_extattr_get(ap->a_vp, IO_NODELOCKED, attrnamespace, attrname, &len, value, ap->a_td); Modified: head/sys/fs/ext2fs/ext2_alloc.c ============================================================================== --- head/sys/fs/ext2fs/ext2_alloc.c Mon Jul 20 13:50:10 2020 (r363366) +++ head/sys/fs/ext2fs/ext2_alloc.c Mon Jul 20 14:28:26 2020 (r363367) @@ -425,9 +425,6 @@ ext2_valloc(struct vnode *pvp, int mode, struct ucred } ip = malloc(sizeof(struct inode), M_EXT2NODE, M_WAITOK | M_ZERO); - if (ip == NULL) { - return (ENOMEM); - } /* Allocate a new vnode/inode. */ if ((error = getnewvnode("ext2fs", ump->um_mountp, &ext2_vnodeops, &vp)) != 0) { Modified: head/sys/fs/ext2fs/ext2_extents.c ============================================================================== --- head/sys/fs/ext2fs/ext2_extents.c Mon Jul 20 13:50:10 2020 (r363366) +++ head/sys/fs/ext2fs/ext2_extents.c Mon Jul 20 14:28:26 2020 (r363367) @@ -322,9 +322,6 @@ ext4_ext_fill_path_bdata(struct ext4_extent_path *path ("ext4_ext_fill_path_bdata: bad ep_data")); path->ep_data = malloc(bp->b_bufsize, M_EXT2EXTENTS, M_WAITOK); - if (!path->ep_data) - return (ENOMEM); - memcpy(path->ep_data, bp->b_data, bp->b_bufsize); path->ep_blk = blk; @@ -397,9 +394,6 @@ ext4_ext_find_extent(struct inode *ip, daddr_t block, path = malloc(EXT4_EXT_DEPTH_MAX * sizeof(struct ext4_extent_path), M_EXT2EXTENTS, M_WAITOK | M_ZERO); - if (!path) - return (ENOMEM); - *ppath = path; alloc = 1; } @@ -762,8 +756,6 @@ ext4_ext_split(struct inode *ip, struct ext4_extent_pa /* Allocate new blocks. */ ablks = malloc(sizeof(e4fs_daddr_t) * depth, M_EXT2EXTENTS, M_WAITOK | M_ZERO); - if (!ablks) - return (ENOMEM); for (a = 0; a < depth - at; a++) { newblk = ext4_ext_alloc_meta(ip); if (newblk == 0) @@ -1517,9 +1509,6 @@ ext4_ext_remove_space(struct inode *ip, off_t length, path = malloc(sizeof(struct ext4_extent_path) * (depth + 1), M_EXT2EXTENTS, M_WAITOK | M_ZERO); - if (!path) - return (ENOMEM); - path[0].ep_header = ehp; path[0].ep_depth = depth; i = 0; Modified: head/sys/fs/ext2fs/ext2_lookup.c ============================================================================== --- head/sys/fs/ext2fs/ext2_lookup.c Mon Jul 20 13:50:10 2020 (r363366) +++ head/sys/fs/ext2fs/ext2_lookup.c Mon Jul 20 14:28:26 2020 (r363367) @@ -894,10 +894,6 @@ ext2_add_first_entry(struct vnode *dvp, struct ext2fs_ entry->e2d_reclen = htole16(dirblksize - sizeof(struct ext2fs_direct_tail)); buf = malloc(dirblksize, M_TEMP, M_WAITOK); - if (!buf) { - error = ENOMEM; - goto out; - } memcpy(buf, entry, EXT2_DIR_REC_LEN(entry->e2d_namlen)); ext2_init_dirent_tail(EXT2_DIRENT_TAIL(buf, dirblksize)); ext2_dirent_csum_set(dp, (struct ext2fs_direct_2 *)buf); Modified: head/sys/fs/ext2fs/ext2_vnops.c ============================================================================== --- head/sys/fs/ext2fs/ext2_vnops.c Mon Jul 20 13:50:10 2020 (r363366) +++ head/sys/fs/ext2fs/ext2_vnops.c Mon Jul 20 14:28:26 2020 (r363367) @@ -1077,10 +1077,6 @@ abortit: ext2_dec_nlink(dp); dp->i_flag |= IN_CHANGE; dirbuf = malloc(dp->i_e2fs->e2fs_bsize, M_TEMP, M_WAITOK | M_ZERO); - if (!dirbuf) { - error = ENOMEM; - goto bad; - } error = vn_rdwr(UIO_READ, fvp, (caddr_t)dirbuf, ip->i_e2fs->e2fs_bsize, (off_t)0, UIO_SYSSPACE, IO_NODELOCKED | IO_NOMACCHECK, @@ -1390,12 +1386,6 @@ ext2_mkdir(struct vop_mkdir_args *ap) #define DIRBLKSIZ VTOI(dvp)->i_e2fs->e2fs_bsize dirtemplate.dotdot_reclen = htole16(DIRBLKSIZ - 12); buf = malloc(DIRBLKSIZ, M_TEMP, M_WAITOK | M_ZERO); - if (!buf) { - error = ENOMEM; - ext2_dec_nlink(dp); - dp->i_flag |= IN_CHANGE; - goto bad; - } if (EXT2_HAS_RO_COMPAT_FEATURE(fs, EXT2F_ROCOMPAT_METADATA_CKSUM)) { dirtemplate.dotdot_reclen = htole16(le16toh(dirtemplate.dotdot_reclen) - From owner-svn-src-all@freebsd.org Mon Jul 20 16:12:15 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5839F363363; Mon, 20 Jul 2020 16:12:15 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4B9RZR1kjjz4FRL; Mon, 20 Jul 2020 16:12:15 +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 204FFF77C; Mon, 20 Jul 2020 16:12:15 +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 06KGCFIx083674; Mon, 20 Jul 2020 16:12:15 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06KGCECI083673; Mon, 20 Jul 2020 16:12:14 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <202007201612.06KGCECI083673@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Mon, 20 Jul 2020 16:12:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363368 - head/sys/crypto/via X-SVN-Group: head X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: head/sys/crypto/via X-SVN-Commit-Revision: 363368 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 20 Jul 2020 16:12:15 -0000 Author: asomers Date: Mon Jul 20 16:12:14 2020 New Revision: 363368 URL: https://svnweb.freebsd.org/changeset/base/363368 Log: padlock: fix Via Padlock with 192-bit keys It's been broken since a typo in r359374 Reviewed by: jhb MFC after: 2 weeks Sponsored by: Axcient Differential Revision: https://reviews.freebsd.org/D25710 Modified: head/sys/crypto/via/padlock_cipher.c Modified: head/sys/crypto/via/padlock_cipher.c ============================================================================== --- head/sys/crypto/via/padlock_cipher.c Mon Jul 20 14:28:26 2020 (r363367) +++ head/sys/crypto/via/padlock_cipher.c Mon Jul 20 16:12:14 2020 (r363368) @@ -124,7 +124,7 @@ padlock_cipher_setup(struct padlock_session *ses, { union padlock_cw *cw; - if (csp->csp_cipher_klen != 16 && csp->csp_cipher_klen != 25 && + if (csp->csp_cipher_klen != 16 && csp->csp_cipher_klen != 24 && csp->csp_cipher_klen != 32) { return (EINVAL); } From owner-svn-src-all@freebsd.org Mon Jul 20 16:45:44 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E94CB36384A; Mon, 20 Jul 2020 16:45:44 +0000 (UTC) (envelope-from gbe@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4B9SK455LBz4HW6; Mon, 20 Jul 2020 16:45:44 +0000 (UTC) (envelope-from gbe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8E067FF8A; Mon, 20 Jul 2020 16:45:44 +0000 (UTC) (envelope-from gbe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06KGjice003898; Mon, 20 Jul 2020 16:45:44 GMT (envelope-from gbe@FreeBSD.org) Received: (from gbe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06KGji9d003897; Mon, 20 Jul 2020 16:45:44 GMT (envelope-from gbe@FreeBSD.org) Message-Id: <202007201645.06KGji9d003897@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gbe set sender to gbe@FreeBSD.org using -f From: Gordon Bergling Date: Mon, 20 Jul 2020 16:45:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r363369 - stable/12/usr.sbin/arp X-SVN-Group: stable-12 X-SVN-Commit-Author: gbe X-SVN-Commit-Paths: stable/12/usr.sbin/arp X-SVN-Commit-Revision: 363369 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 20 Jul 2020 16:45:45 -0000 Author: gbe (doc committer) Date: Mon Jul 20 16:45:44 2020 New Revision: 363369 URL: https://svnweb.freebsd.org/changeset/base/363369 Log: MFC r363146: arp(8) clarify the use of the '-a flag' PR: 238146 Submitted by: Andrew Stevenson Reported by: Andrew Stevenson Reviewed by: bcr (mentor) Approved by: bcr (mentor) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D25645 Modified: stable/12/usr.sbin/arp/arp.8 Directory Properties: stable/12/ (props changed) Modified: stable/12/usr.sbin/arp/arp.8 ============================================================================== --- stable/12/usr.sbin/arp/arp.8 Mon Jul 20 16:12:14 2020 (r363368) +++ stable/12/usr.sbin/arp/arp.8 Mon Jul 20 16:45:44 2020 (r363369) @@ -28,7 +28,7 @@ .\" @(#)arp.8 8.1 (Berkeley) 6/6/93 .\" $FreeBSD$ .\" -.Dd April 6, 2017 +.Dd July 13, 2020 .Dt ARP 8 .Os .Sh NAME @@ -87,7 +87,9 @@ See .Xr xo_parse_args 3 for details on command line arguments. .It Fl a -The program displays or deletes all of the current +The program displays or, if it is used with the +.Fl d +flag, deletes all of the current .Tn ARP entries. .It Fl d From owner-svn-src-all@freebsd.org Mon Jul 20 16:48:47 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 33BB2363759; Mon, 20 Jul 2020 16:48:47 +0000 (UTC) (envelope-from gbe@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4B9SNb0d4Tz4Hv2; Mon, 20 Jul 2020 16:48:47 +0000 (UTC) (envelope-from gbe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id ECF8FFD68; Mon, 20 Jul 2020 16:48:46 +0000 (UTC) (envelope-from gbe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06KGmk80004229; Mon, 20 Jul 2020 16:48:46 GMT (envelope-from gbe@FreeBSD.org) Received: (from gbe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06KGmkhr004228; Mon, 20 Jul 2020 16:48:46 GMT (envelope-from gbe@FreeBSD.org) Message-Id: <202007201648.06KGmkhr004228@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gbe set sender to gbe@FreeBSD.org using -f From: Gordon Bergling Date: Mon, 20 Jul 2020 16:48:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r363370 - stable/12/lib/libc/sys X-SVN-Group: stable-12 X-SVN-Commit-Author: gbe X-SVN-Commit-Paths: stable/12/lib/libc/sys X-SVN-Commit-Revision: 363370 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 20 Jul 2020 16:48:47 -0000 Author: gbe (doc committer) Date: Mon Jul 20 16:48:46 2020 New Revision: 363370 URL: https://svnweb.freebsd.org/changeset/base/363370 Log: MFC r363156: lseek(2): Document the seek behavior better and update the POSIX compliance PR: 162765 Submitted by: arundel@ Reported by: arundel@ Reviewed by: bcr (mentor) Approved by: bcr (mentor) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D25646 Modified: stable/12/lib/libc/sys/lseek.2 Directory Properties: stable/12/ (props changed) Modified: stable/12/lib/libc/sys/lseek.2 ============================================================================== --- stable/12/lib/libc/sys/lseek.2 Mon Jul 20 16:45:44 2020 (r363369) +++ stable/12/lib/libc/sys/lseek.2 Mon Jul 20 16:48:46 2020 (r363370) @@ -28,7 +28,7 @@ .\" @(#)lseek.2 8.3 (Berkeley) 4/19/94 .\" $FreeBSD$ .\" -.Dd February 18, 2016 +.Dd July 13, 2020 .Dt LSEEK 2 .Os .Sh NAME @@ -113,11 +113,10 @@ of the existing end-of-file of the file. If data is later written at this point, subsequent reads of the data in the gap return bytes of zeros (until data is actually written into the gap). +However, the +.Fn lseek +system call does not, by itself, extend the size of a file. .Pp -Some devices are incapable of seeking. -The value of the pointer -associated with such a device is undefined. -.Pp A .Qq hole is defined as a contiguous range of bytes in a file, all having the value of @@ -205,13 +204,43 @@ is associated with a pipe, socket, or FIFO. The .Fn lseek system call is expected to conform to -.St -p1003.1-90 . +.St -p1003.1-2008 . +.Pp +The +.Dv SEEK_HOLE +and +.Dv SEEK_DATA +directives, along with the +.Er ENXIO +error, are extensions to that specification. .Sh HISTORY The .Fn lseek function appeared in .At v7 . .Sh BUGS +If the +.Fn lseek +system call is operating on a device which is incapable of seeking, +it will request the seek operation and return successfully, +even though no seek was performed. +Because the +.Ar offset +argument will be stored unconditionally in the file descriptor of that device, +there is no way to confirm if the seek operation succeeded or not +(e.g. using the +.Fn ftell +function). +Device types which are known to be incapable of seeking include +tape drives. +.Pp +The +.Fn lseek +system call will not detect whether media are present in changeable +media devices such as DVD or Blu-ray devices. +A requested seek operation will therefore return sucessfully when no +medium is present. +.Pp This document's use of .Fa whence is incorrect English, but is maintained for historical reasons. From owner-svn-src-all@freebsd.org Mon Jul 20 16:51:19 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8593E363CC0; Mon, 20 Jul 2020 16:51:19 +0000 (UTC) (envelope-from gbe@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4B9SRW2ycHz4JbW; Mon, 20 Jul 2020 16:51:19 +0000 (UTC) (envelope-from gbe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 48B0BFF9A; Mon, 20 Jul 2020 16:51:19 +0000 (UTC) (envelope-from gbe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06KGpJxt006762; Mon, 20 Jul 2020 16:51:19 GMT (envelope-from gbe@FreeBSD.org) Received: (from gbe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06KGpJqe006761; Mon, 20 Jul 2020 16:51:19 GMT (envelope-from gbe@FreeBSD.org) Message-Id: <202007201651.06KGpJqe006761@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gbe set sender to gbe@FreeBSD.org using -f From: Gordon Bergling Date: Mon, 20 Jul 2020 16:51:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r363371 - stable/12/lib/libc/gen X-SVN-Group: stable-12 X-SVN-Commit-Author: gbe X-SVN-Commit-Paths: stable/12/lib/libc/gen X-SVN-Commit-Revision: 363371 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 20 Jul 2020 16:51:19 -0000 Author: gbe (doc committer) Date: Mon Jul 20 16:51:18 2020 New Revision: 363371 URL: https://svnweb.freebsd.org/changeset/base/363371 Log: MFC r363147: gethostname(3): Correct the reference of the undefined value HOST_NAME_MAX PR: 143472 Submitted by: bcran@ Reported by: Jeremy Huddleston Reviewed by: bcr (mentor) Approved by: bcr (mentor) Differential Revision: https://reviews.freebsd.org/D25647 Modified: stable/12/lib/libc/gen/gethostname.3 Directory Properties: stable/12/ (props changed) Modified: stable/12/lib/libc/gen/gethostname.3 ============================================================================== --- stable/12/lib/libc/gen/gethostname.3 Mon Jul 20 16:48:46 2020 (r363370) +++ stable/12/lib/libc/gen/gethostname.3 Mon Jul 20 16:51:18 2020 (r363371) @@ -28,7 +28,7 @@ .\" @(#)gethostname.3 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd August 18, 2003 +.Dd July 13, 2020 .Dt GETHOSTNAME 3 .Os .Sh NAME @@ -68,9 +68,9 @@ which has length This call is restricted to the super-user and is normally used only when the system is bootstrapped. .Pp -Host names are limited to -.Brq Dv HOST_NAME_MAX -characters, not including the trailing null, currently 255. +Applications should use +.Fn sysconf _SC_HOST_NAME_MAX +to find the maximum length of a host name (not including the terminating null). .Sh RETURN VALUES .Rv -std .Sh ERRORS From owner-svn-src-all@freebsd.org Mon Jul 20 17:04:26 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8E284364479; Mon, 20 Jul 2020 17:04:26 +0000 (UTC) (envelope-from luporl@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4B9Skf323hz4KDC; Mon, 20 Jul 2020 17:04:26 +0000 (UTC) (envelope-from luporl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4C45A1013F; Mon, 20 Jul 2020 17:04:26 +0000 (UTC) (envelope-from luporl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06KH4QUv016210; Mon, 20 Jul 2020 17:04:26 GMT (envelope-from luporl@FreeBSD.org) Received: (from luporl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06KH4QeN016209; Mon, 20 Jul 2020 17:04:26 GMT (envelope-from luporl@FreeBSD.org) Message-Id: <202007201704.06KH4QeN016209@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: luporl set sender to luporl@FreeBSD.org using -f From: Leandro Lupori Date: Mon, 20 Jul 2020 17:04:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r363372 - stable/12/libexec/rtld-elf X-SVN-Group: stable-12 X-SVN-Commit-Author: luporl X-SVN-Commit-Paths: stable/12/libexec/rtld-elf X-SVN-Commit-Revision: 363372 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 20 Jul 2020 17:04:26 -0000 Author: luporl Date: Mon Jul 20 17:04:25 2020 New Revision: 363372 URL: https://svnweb.freebsd.org/changeset/base/363372 Log: MFC r362958 Handle non-PLT GNU IFUNC relocations in rtld Modified: stable/12/libexec/rtld-elf/rtld.c Directory Properties: stable/12/ (props changed) Modified: stable/12/libexec/rtld-elf/rtld.c ============================================================================== --- stable/12/libexec/rtld-elf/rtld.c Mon Jul 20 16:51:18 2020 (r363371) +++ stable/12/libexec/rtld-elf/rtld.c Mon Jul 20 17:04:25 2020 (r363372) @@ -3064,7 +3064,8 @@ resolve_object_ifunc(Obj_Entry *obj, bool bind_now, in return (0); obj->ifuncs_resolved = true; if (!obj->irelative && !obj->irelative_nonplt && - !((obj->bind_now || bind_now) && obj->gnu_ifunc)) + !((obj->bind_now || bind_now) && obj->gnu_ifunc) && + !obj->non_plt_gnu_ifunc) return (0); if (obj_disable_relro(obj) == -1 || (obj->irelative && reloc_iresolve(obj, lockstate) == -1) || @@ -3072,6 +3073,8 @@ resolve_object_ifunc(Obj_Entry *obj, bool bind_now, in lockstate) == -1) || ((obj->bind_now || bind_now) && obj->gnu_ifunc && reloc_gnu_ifunc(obj, flags, lockstate) == -1) || + (obj->non_plt_gnu_ifunc && reloc_non_plt(obj, &obj_rtld, + flags | SYMLOOK_IFUNC, lockstate) == -1) || obj_enforce_relro(obj) == -1) return (-1); return (0); From owner-svn-src-all@freebsd.org Mon Jul 20 17:05:44 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D6C7436468E; Mon, 20 Jul 2020 17:05:44 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4B9Sm851kNz4KKR; Mon, 20 Jul 2020 17:05:44 +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 8F5B8101CB; Mon, 20 Jul 2020 17:05:44 +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 06KH5i8p016334; Mon, 20 Jul 2020 17:05:44 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06KH5iE2016333; Mon, 20 Jul 2020 17:05:44 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202007201705.06KH5iE2016333@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 20 Jul 2020 17:05:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363373 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Commit-Revision: 363373 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 20 Jul 2020 17:05:44 -0000 Author: markj Date: Mon Jul 20 17:05:44 2020 New Revision: 363373 URL: https://svnweb.freebsd.org/changeset/base/363373 Log: Fix a memory leak in dsl_scan_visitbp(). This should be triggered only if arc_read() fails, i.e., quite rarely. The same logic is already present in OpenZFS. PR: 247445 Submitted by: jdolecek@NetBSD.org MFC after: 1 week Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c Mon Jul 20 17:04:25 2020 (r363372) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c Mon Jul 20 17:05:44 2020 (r363373) @@ -1789,7 +1789,7 @@ dsl_scan_visitbp(blkptr_t *bp, const zbookmark_phys_t *bp_toread = *bp; if (dsl_scan_recurse(scn, ds, ostype, dnp, bp_toread, zb, tx) != 0) - return; + goto out; /* * If dsl_scan_ddt() has already visited this block, it will have From owner-svn-src-all@freebsd.org Mon Jul 20 17:44:14 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 74120365440; Mon, 20 Jul 2020 17:44:14 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4B9TcZ2VhSz4MYH; Mon, 20 Jul 2020 17:44:14 +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 3926210A11; Mon, 20 Jul 2020 17:44:14 +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 06KHiEhI040793; Mon, 20 Jul 2020 17:44:14 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06KHiEs0040792; Mon, 20 Jul 2020 17:44:14 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202007201744.06KHiEs0040792@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 20 Jul 2020 17:44:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363374 - head/sys/opencrypto X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/opencrypto X-SVN-Commit-Revision: 363374 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 20 Jul 2020 17:44:14 -0000 Author: markj Date: Mon Jul 20 17:44:13 2020 New Revision: 363374 URL: https://svnweb.freebsd.org/changeset/base/363374 Log: crypto(9): Stop checking for failures from malloc(M_WAITOK). PR: 240545 Submitted by: Andrew Reiter Reviewed by: cem, delphij, jhb MFC after: 1 week Event: July 2020 Bugathon Modified: head/sys/opencrypto/cryptodev.c Modified: head/sys/opencrypto/cryptodev.c ============================================================================== --- head/sys/opencrypto/cryptodev.c Mon Jul 20 17:05:44 2020 (r363373) +++ head/sys/opencrypto/cryptodev.c Mon Jul 20 17:44:13 2020 (r363374) @@ -1315,11 +1315,7 @@ cryptodev_key(struct crypt_kop *kop) return (EINVAL); } - krp = (struct cryptkop *)malloc(sizeof *krp, M_XDATA, M_WAITOK|M_ZERO); - if (!krp) { - SDT_PROBE1(opencrypto, dev, ioctl, error, __LINE__); - return (ENOMEM); - } + krp = malloc(sizeof(*krp), M_XDATA, M_WAITOK | M_ZERO); krp->krp_op = kop->crk_op; krp->krp_status = kop->crk_status; krp->krp_iparams = kop->crk_iparams; From owner-svn-src-all@freebsd.org Mon Jul 20 18:22:38 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id ED59E365D51; Mon, 20 Jul 2020 18:22:38 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4B9VSt60rZz4P9k; Mon, 20 Jul 2020 18:22: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 B165211220; Mon, 20 Jul 2020 18:22: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 06KIMcCg065963; Mon, 20 Jul 2020 18:22:38 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06KIMcbI065962; Mon, 20 Jul 2020 18:22:38 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202007201822.06KIMcbI065962@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 20 Jul 2020 18:22:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363375 - head/contrib/elftoolchain/libdwarf X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/contrib/elftoolchain/libdwarf X-SVN-Commit-Revision: 363375 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 20 Jul 2020 18:22:39 -0000 Author: markj Date: Mon Jul 20 18:22:38 2020 New Revision: 363375 URL: https://svnweb.freebsd.org/changeset/base/363375 Log: libdwarf: Hide SHT_NOBITS sections. gnu_debuglink external debug files will contain an .eh_frame section of type SHT_NOBITS. libdwarf does not handle such sections (or rather, it expects all debug sections to not have type SHT_NOBITS). Avoid loading SHT_NOBITS sections, to be consistent with SGI libdwarf's handling of this case. PR: 239516 Diagnosed by: Paco Pascal Reviewed by: emaste (previous version) Event: July 2020 Bugathon MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D25626 Modified: head/contrib/elftoolchain/libdwarf/libdwarf_elf_init.c Modified: head/contrib/elftoolchain/libdwarf/libdwarf_elf_init.c ============================================================================== --- head/contrib/elftoolchain/libdwarf/libdwarf_elf_init.c Mon Jul 20 17:44:13 2020 (r363374) +++ head/contrib/elftoolchain/libdwarf/libdwarf_elf_init.c Mon Jul 20 18:22:38 2020 (r363375) @@ -260,6 +260,9 @@ _dwarf_elf_init(Dwarf_Debug dbg, Elf *elf, Dwarf_Error goto fail_cleanup; } + if (sh.sh_type == SHT_NOBITS) + continue; + if ((name = elf_strptr(elf, e->eo_strndx, sh.sh_name)) == NULL) { DWARF_SET_ELF_ERROR(dbg, error); @@ -312,6 +315,9 @@ _dwarf_elf_init(Dwarf_Debug dbg, Elf *elf, Dwarf_Error ret = DW_DLE_ELF; goto fail_cleanup; } + + if (sh.sh_type == SHT_NOBITS) + continue; memcpy(&e->eo_shdr[j], &sh, sizeof(sh)); From owner-svn-src-all@freebsd.org Mon Jul 20 20:19:57 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5B1EA368AAD; Mon, 20 Jul 2020 20:19:57 +0000 (UTC) (envelope-from luporl@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4B9Y4F1kp5z4X1B; Mon, 20 Jul 2020 20:19:57 +0000 (UTC) (envelope-from luporl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1A90E12441; Mon, 20 Jul 2020 20:19:57 +0000 (UTC) (envelope-from luporl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06KKJuLc035040; Mon, 20 Jul 2020 20:19:56 GMT (envelope-from luporl@FreeBSD.org) Received: (from luporl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06KKJucB035039; Mon, 20 Jul 2020 20:19:56 GMT (envelope-from luporl@FreeBSD.org) Message-Id: <202007202019.06KKJucB035039@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: luporl set sender to luporl@FreeBSD.org using -f From: Leandro Lupori Date: Mon, 20 Jul 2020 20:19:56 +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: r363376 - stable/11/libexec/rtld-elf X-SVN-Group: stable-11 X-SVN-Commit-Author: luporl X-SVN-Commit-Paths: stable/11/libexec/rtld-elf X-SVN-Commit-Revision: 363376 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 20 Jul 2020 20:19:57 -0000 Author: luporl Date: Mon Jul 20 20:19:56 2020 New Revision: 363376 URL: https://svnweb.freebsd.org/changeset/base/363376 Log: MFC r362958 Handle non-PLT GNU IFUNC relocations in rtld Modified: stable/11/libexec/rtld-elf/rtld.c Directory Properties: stable/11/ (props changed) Modified: stable/11/libexec/rtld-elf/rtld.c ============================================================================== --- stable/11/libexec/rtld-elf/rtld.c Mon Jul 20 18:22:38 2020 (r363375) +++ stable/11/libexec/rtld-elf/rtld.c Mon Jul 20 20:19:56 2020 (r363376) @@ -3039,12 +3039,15 @@ resolve_object_ifunc(Obj_Entry *obj, bool bind_now, in if (obj->ifuncs_resolved) return (0); obj->ifuncs_resolved = true; - if (!obj->irelative && !((obj->bind_now || bind_now) && obj->gnu_ifunc)) + if (!obj->irelative && !((obj->bind_now || bind_now) && + obj->gnu_ifunc) && !obj->non_plt_gnu_ifunc) return (0); if (obj_disable_relro(obj) == -1 || (obj->irelative && reloc_iresolve(obj, lockstate) == -1) || ((obj->bind_now || bind_now) && obj->gnu_ifunc && reloc_gnu_ifunc(obj, flags, lockstate) == -1) || + (obj->non_plt_gnu_ifunc && reloc_non_plt(obj, &obj_rtld, + flags | SYMLOOK_IFUNC, lockstate) == -1) || obj_enforce_relro(obj) == -1) return (-1); return (0); From owner-svn-src-all@freebsd.org Mon Jul 20 20:36:33 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D0A303693B3; Mon, 20 Jul 2020 20:36:33 +0000 (UTC) (envelope-from chs@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4B9YRP4cYmz4XqB; Mon, 20 Jul 2020 20:36:33 +0000 (UTC) (envelope-from chs@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7D6B9128CA; Mon, 20 Jul 2020 20:36:33 +0000 (UTC) (envelope-from chs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06KKaXu7046643; Mon, 20 Jul 2020 20:36:33 GMT (envelope-from chs@FreeBSD.org) Received: (from chs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06KKaWQ2046640; Mon, 20 Jul 2020 20:36:32 GMT (envelope-from chs@FreeBSD.org) Message-Id: <202007202036.06KKaWQ2046640@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: chs set sender to chs@FreeBSD.org using -f From: Chuck Silvers Date: Mon, 20 Jul 2020 20:36:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363377 - head/tests/sys/kern X-SVN-Group: head X-SVN-Commit-Author: chs X-SVN-Commit-Paths: head/tests/sys/kern X-SVN-Commit-Revision: 363377 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 20 Jul 2020 20:36:33 -0000 Author: chs Date: Mon Jul 20 20:36:32 2020 New Revision: 363377 URL: https://svnweb.freebsd.org/changeset/base/363377 Log: add a few tests for sendfile. Reviewed by: markj Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D25431 Added: head/tests/sys/kern/sendfile_helper.c (contents, props changed) head/tests/sys/kern/sendfile_test.sh (contents, props changed) Modified: head/tests/sys/kern/Makefile Modified: head/tests/sys/kern/Makefile ============================================================================== --- head/tests/sys/kern/Makefile Mon Jul 20 20:19:56 2020 (r363376) +++ head/tests/sys/kern/Makefile Mon Jul 20 20:36:32 2020 (r363377) @@ -29,6 +29,7 @@ ATF_TESTS_SH+= coredump_phnum_test ATF_TESTS_SH+= sonewconn_overflow TEST_METADATA.sonewconn_overflow+= required_programs="python" TEST_METADATA.sonewconn_overflow+= required_user="root" +ATF_TESTS_SH+= sendfile_test ${PACKAGE}FILES+= sonewconn_overflow.py ${PACKAGE}FILESMODE_sonewconn_overflow.py=0555 @@ -36,6 +37,7 @@ ${PACKAGE}FILESMODE_sonewconn_overflow.py=0555 BINDIR= ${TESTSDIR} PROGS+= coredump_phnum_helper PROGS+= pdeathsig_helper +PROGS+= sendfile_helper CFLAGS.sys_getrandom+= -I${SRCTOP}/sys/contrib/zstd/lib LIBADD.sys_getrandom+= zstd @@ -44,6 +46,7 @@ LIBADD.sys_getrandom+= pthread LIBADD.ptrace_test+= pthread LIBADD.unix_seqpacket_test+= pthread LIBADD.kcov+= pthread +LIBADD.sendfile_helper+= pthread NETBSD_ATF_TESTS_C+= lockf_test NETBSD_ATF_TESTS_C+= mqueue_test Added: head/tests/sys/kern/sendfile_helper.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tests/sys/kern/sendfile_helper.c Mon Jul 20 20:36:32 2020 (r363377) @@ -0,0 +1,147 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2020 Netflix, Inc. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#include +#include +#include +#include + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +static int ls; +static char buf[1024*1024]; +static volatile bool accept_done = false; +static volatile bool read_done = false; + +static void * +server(void *arg) +{ + struct sockaddr_in sin; + ssize_t rv; + socklen_t slen; + int ss; + ssize_t readlen = (uintptr_t)arg; + + slen = sizeof(sin); + ss = accept(ls, (void *)&sin, &slen); + if (ss < 0) + err(1, "accept ls"); + + accept_done = true; + + do { + rv = read(ss, buf, sizeof(buf)); + if (rv == -1) + err(2, "read receiver"); + if (rv == 0) + break; + readlen -= rv; + } while (readlen != 0); + + read_done = true; + + return NULL; +} + +int +main(int argc, char **argv) +{ + pthread_t pt; + struct sockaddr_in sin; + off_t start, len; + socklen_t slen; + int fd, cs, on, flags, error; + + if (argc != 5) + errx(1, "usage: %s ", + getprogname()); + + start = strtoull(argv[2], NULL, 0); + len = strtoull(argv[3], NULL, 0); + flags = strtoul(argv[4], NULL, 0); + + fd = open(argv[1], O_RDONLY); + if (fd < 0) + err(1, "open"); + + ls = socket(PF_INET, SOCK_STREAM, 0); + if (ls < 0) + err(1, "socket ls"); + + on = 1; + if (setsockopt(ls, SOL_SOCKET, SO_REUSEADDR, (void *)&on, + (socklen_t)sizeof(on)) < 0) + err(1, "SO_REUSEADDR"); + + sin.sin_len = sizeof(sin); + sin.sin_family = AF_INET; + sin.sin_addr.s_addr = htonl(INADDR_LOOPBACK); + sin.sin_port = 0; + if (bind(ls, (void *)&sin, sizeof(sin)) < 0) + err(1, "bind ls"); + + slen = sizeof(sin); + if (getsockname(ls, (void *)&sin, &slen) < 0) + err(1, "getsockname"); + + if (listen(ls, 5) < 0) + err(1, "listen ls"); + + error = pthread_create(&pt, NULL, server, (void *)(uintptr_t)len); + if (error) + errc(1, error, "pthread_create"); + + cs = socket(PF_INET, SOCK_STREAM, 0); + if (cs < 0) + err(1, "socket cs"); + + if (connect(cs, (void *)&sin, sizeof(sin)) < 0) + err(1, "connect cs"); + + while (!accept_done) + usleep(1000); + + if (sendfile(fd, cs, start, len, NULL, NULL, flags) < 0) + err(3, "sendfile"); + + while (!read_done) + usleep(1000); + + exit(0); +} Added: head/tests/sys/kern/sendfile_test.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tests/sys/kern/sendfile_test.sh Mon Jul 20 20:36:32 2020 (r363377) @@ -0,0 +1,155 @@ +# SPDX-License-Identifier: BSD-2-Clause-FreeBSD +# +# Copyright (c) 2020 Netflix, Inc. +# +# 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$ + +# +# These tests exercise a few basic cases for the sendfile() syscall: +# - successful operation. +# - sendfile() starts an async disk read but that async I/O fails. +# - sendfile() fails to read an indirect block and thus cannot +# even start an async I/O. +# +# In all cases we request some read ahead in addition to +# the data to be sent to the socket. +# + +MD_DEVS="md.devs" +MNT=/mnt +FILE=$MNT/file +HELPER="$(atf_get_srcdir)/sendfile_helper" +BSIZE=4096 + +atf_test_case io_success cleanup +io_success_head() +{ + atf_set "descr" "sendfile where all disk I/O succeeds" + atf_set "require.user" "root" + atf_set "timeout" 15 +} +io_success_body() +{ + md=$(alloc_md) + common_body_setup $md + + atf_check $HELPER $FILE 0 0x10000 0x10000 +} +io_success_cleanup() +{ + common_cleanup +} + +atf_test_case io_fail_sync cleanup +io_fail_sync_head() +{ + atf_set "descr" "sendfile where we fail to start async I/O" + atf_set "require.user" "root" + atf_set "timeout" 15 +} +io_fail_sync_body() +{ + md=$(alloc_md) + common_body_setup $md + + atf_check gnop configure -r 100 -e 5 ${md}.nop + atf_check -s exit:3 -e ignore $HELPER $FILE $((12 * $BSIZE)) $BSIZE 0x10000 +} +io_fail_sync_cleanup() +{ + common_cleanup +} + +atf_test_case io_fail_async cleanup +io_fail_async_head() +{ + atf_set "descr" "sendfile where an async I/O fails" + atf_set "require.user" "root" + atf_set "timeout" 15 +} +io_fail_async_body() +{ + md=$(alloc_md) + common_body_setup $md + + atf_check gnop configure -r 100 -e 5 ${md}.nop + atf_check -s exit:2 -e ignore $HELPER $FILE 0 $BSIZE 0x10000 +} +io_fail_async_cleanup() +{ + common_cleanup +} + + +atf_init_test_cases() +{ + atf_add_test_case io_success + atf_add_test_case io_fail_sync + atf_add_test_case io_fail_async +} + +alloc_md() +{ + local md + + md=$(mdconfig -a -t swap -s 256M) || atf_fail "mdconfig -a failed" + echo ${md} >> $MD_DEVS + echo ${md} +} + +common_body_setup() +{ + us=$1 + + atf_check -o ignore -e ignore newfs -b $BSIZE -U -j /dev/${us} + atf_check mount /dev/${us} $MNT + atf_check -e ignore dd if=/dev/zero of=$FILE bs=1m count=1 + atf_check umount /mnt + + load_gnop + atf_check gnop create /dev/${us} + atf_check mount /dev/${us}.nop $MNT + atf_check -o ignore ls -l $MNT/file +} + +common_cleanup() +{ + umount -f $MNT + 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_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 Mon Jul 20 21:08:57 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 96B6E369ADC; Mon, 20 Jul 2020 21:08:57 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4B9Z8n3Fvzz4ZCN; Mon, 20 Jul 2020 21:08:57 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 529CB12ECD; Mon, 20 Jul 2020 21:08:57 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06KL8vpN065256; Mon, 20 Jul 2020 21:08:57 GMT (envelope-from vmaffione@FreeBSD.org) Received: (from vmaffione@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06KL8vHu065255; Mon, 20 Jul 2020 21:08:57 GMT (envelope-from vmaffione@FreeBSD.org) Message-Id: <202007202108.06KL8vHu065255@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vmaffione set sender to vmaffione@FreeBSD.org using -f From: Vincenzo Maffione Date: Mon, 20 Jul 2020 21:08:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363378 - head/sys/net X-SVN-Group: head X-SVN-Commit-Author: vmaffione X-SVN-Commit-Paths: head/sys/net X-SVN-Commit-Revision: 363378 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 20 Jul 2020 21:08:57 -0000 Author: vmaffione Date: Mon Jul 20 21:08:56 2020 New Revision: 363378 URL: https://svnweb.freebsd.org/changeset/base/363378 Log: iflib: initialize netmap with the correct number of descriptors In case the network device has a RX or TX control queue, the correct number of TX/RX descriptors is contained in the second entry of the isc_ntxd (or isc_nrxd) array, rather than in the first entry. This case is correctly handled by iflib_device_register() and iflib_pseudo_register(), but not by iflib_netmap_attach(). If the first entry is larger than the second, this can result in a panic. This change fixes the bug by introducing two helper functions that also lead to some code simplification. PR: 247647 MFC after: 3 weeks Differential Revision: https://reviews.freebsd.org/D25541 Modified: head/sys/net/iflib.c Modified: head/sys/net/iflib.c ============================================================================== --- head/sys/net/iflib.c Mon Jul 20 20:36:32 2020 (r363377) +++ head/sys/net/iflib.c Mon Jul 20 21:08:56 2020 (r363378) @@ -730,6 +730,26 @@ MTX_SYSINIT(iflib_cpu_offset, &cpu_offset_mtx, "iflib_ DEBUGNET_DEFINE(iflib); +static int +iflib_num_rx_descs(if_ctx_t ctx) +{ + if_softc_ctx_t scctx = &ctx->ifc_softc_ctx; + if_shared_ctx_t sctx = ctx->ifc_sctx; + uint16_t first_rxq = (sctx->isc_flags & IFLIB_HAS_RXCQ) ? 1 : 0; + + return scctx->isc_nrxd[first_rxq]; +} + +static int +iflib_num_tx_descs(if_ctx_t ctx) +{ + if_softc_ctx_t scctx = &ctx->ifc_softc_ctx; + if_shared_ctx_t sctx = ctx->ifc_sctx; + uint16_t first_txq = (sctx->isc_flags & IFLIB_HAS_TXCQ) ? 1 : 0; + + return scctx->isc_ntxd[first_txq]; +} + #ifdef DEV_NETMAP #include #include @@ -1165,7 +1185,6 @@ static int iflib_netmap_attach(if_ctx_t ctx) { struct netmap_adapter na; - if_softc_ctx_t scctx = &ctx->ifc_softc_ctx; bzero(&na, sizeof(na)); @@ -1174,8 +1193,8 @@ iflib_netmap_attach(if_ctx_t ctx) MPASS(ctx->ifc_softc_ctx.isc_ntxqsets); MPASS(ctx->ifc_softc_ctx.isc_nrxqsets); - na.num_tx_desc = scctx->isc_ntxd[0]; - na.num_rx_desc = scctx->isc_nrxd[0]; + na.num_tx_desc = iflib_num_tx_descs(ctx); + na.num_rx_desc = iflib_num_rx_descs(ctx); na.nm_txsync = iflib_netmap_txsync; na.nm_rxsync = iflib_netmap_rxsync; na.nm_register = iflib_netmap_register; @@ -4590,7 +4609,7 @@ iflib_device_register(device_t dev, void *sc, if_share kobjop_desc_t kobj_desc; kobj_method_t *kobj_method; int err, msix, rid; - uint16_t main_rxq, main_txq; + int num_txd, num_rxd; ctx = malloc(sizeof(* ctx), M_IFLIB, M_WAITOK|M_ZERO); @@ -4640,21 +4659,20 @@ iflib_device_register(device_t dev, void *sc, if_share if (scctx->isc_nrxqsets == 0 || (scctx->isc_nrxqsets_max && scctx->isc_nrxqsets_max < scctx->isc_nrxqsets)) scctx->isc_nrxqsets = scctx->isc_nrxqsets_max; - main_txq = (sctx->isc_flags & IFLIB_HAS_TXCQ) ? 1 : 0; - main_rxq = (sctx->isc_flags & IFLIB_HAS_RXCQ) ? 1 : 0; + num_txd = iflib_num_tx_descs(ctx); + num_rxd = iflib_num_rx_descs(ctx); /* XXX change for per-queue sizes */ device_printf(dev, "Using %d TX descriptors and %d RX descriptors\n", - scctx->isc_ntxd[main_txq], scctx->isc_nrxd[main_rxq]); + num_txd, num_rxd); - if (scctx->isc_tx_nsegments > scctx->isc_ntxd[main_txq] / - MAX_SINGLE_PACKET_FRACTION) - scctx->isc_tx_nsegments = max(1, scctx->isc_ntxd[main_txq] / + if (scctx->isc_tx_nsegments > num_txd / MAX_SINGLE_PACKET_FRACTION) + scctx->isc_tx_nsegments = max(1, num_txd / MAX_SINGLE_PACKET_FRACTION); - if (scctx->isc_tx_tso_segments_max > scctx->isc_ntxd[main_txq] / + if (scctx->isc_tx_tso_segments_max > num_txd / MAX_SINGLE_PACKET_FRACTION) scctx->isc_tx_tso_segments_max = max(1, - scctx->isc_ntxd[main_txq] / MAX_SINGLE_PACKET_FRACTION); + num_txd / MAX_SINGLE_PACKET_FRACTION); /* TSO parameters - dig these out of the data sheet - simply correspond to tag setup */ if (if_getcapabilities(ifp) & IFCAP_TSO) { @@ -4831,14 +4849,13 @@ int iflib_pseudo_register(device_t dev, if_shared_ctx_t sctx, if_ctx_t *ctxp, struct iflib_cloneattach_ctx *clctx) { + int num_txd, num_rxd; int err; if_ctx_t ctx; if_t ifp; if_softc_ctx_t scctx; int i; void *sc; - uint16_t main_txq; - uint16_t main_rxq; ctx = malloc(sizeof(*ctx), M_IFLIB, M_WAITOK|M_ZERO); sc = malloc(sctx->isc_driver->size, M_IFLIB, M_WAITOK|M_ZERO); @@ -4924,21 +4941,20 @@ iflib_pseudo_register(device_t dev, if_shared_ctx_t sc if (scctx->isc_nrxqsets == 0 || (scctx->isc_nrxqsets_max && scctx->isc_nrxqsets_max < scctx->isc_nrxqsets)) scctx->isc_nrxqsets = scctx->isc_nrxqsets_max; - main_txq = (sctx->isc_flags & IFLIB_HAS_TXCQ) ? 1 : 0; - main_rxq = (sctx->isc_flags & IFLIB_HAS_RXCQ) ? 1 : 0; + num_txd = iflib_num_tx_descs(ctx); + num_rxd = iflib_num_rx_descs(ctx); /* XXX change for per-queue sizes */ device_printf(dev, "Using %d TX descriptors and %d RX descriptors\n", - scctx->isc_ntxd[main_txq], scctx->isc_nrxd[main_rxq]); + num_txd, num_rxd); - if (scctx->isc_tx_nsegments > scctx->isc_ntxd[main_txq] / - MAX_SINGLE_PACKET_FRACTION) - scctx->isc_tx_nsegments = max(1, scctx->isc_ntxd[main_txq] / + if (scctx->isc_tx_nsegments > num_txd / MAX_SINGLE_PACKET_FRACTION) + scctx->isc_tx_nsegments = max(1, num_txd / MAX_SINGLE_PACKET_FRACTION); - if (scctx->isc_tx_tso_segments_max > scctx->isc_ntxd[main_txq] / + if (scctx->isc_tx_tso_segments_max > num_txd / MAX_SINGLE_PACKET_FRACTION) scctx->isc_tx_tso_segments_max = max(1, - scctx->isc_ntxd[main_txq] / MAX_SINGLE_PACKET_FRACTION); + num_txd / MAX_SINGLE_PACKET_FRACTION); /* TSO parameters - dig these out of the data sheet - simply correspond to tag setup */ if (if_getcapabilities(ifp) & IFCAP_TSO) { From owner-svn-src-all@freebsd.org Mon Jul 20 22:32:39 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B1A6436BA6B; Mon, 20 Jul 2020 22:32:39 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4B9c1M4CJ3z4f3t; Mon, 20 Jul 2020 22:32:39 +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 73C3D140B8; Mon, 20 Jul 2020 22:32:39 +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 06KMWdgU020608; Mon, 20 Jul 2020 22:32:39 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06KMWddo020607; Mon, 20 Jul 2020 22:32:39 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202007202232.06KMWddo020607@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Mon, 20 Jul 2020 22:32:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363379 - head/sys/opencrypto X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/sys/opencrypto X-SVN-Commit-Revision: 363379 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 20 Jul 2020 22:32:39 -0000 Author: jhb Date: Mon Jul 20 22:32:39 2020 New Revision: 363379 URL: https://svnweb.freebsd.org/changeset/base/363379 Log: Don't dynamically allocate data structures for KTLS crypto requests. Allocate iovec arrays and struct cryptop and struct ocf_operation objects on the stack to reduce avoid the overhead of malloc(). These structures are all small enough to fit on the stack of the KTLS worker threads. Reviewed by: gallatin Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D25692 Modified: head/sys/opencrypto/ktls_ocf.c Modified: head/sys/opencrypto/ktls_ocf.c ============================================================================== --- head/sys/opencrypto/ktls_ocf.c Mon Jul 20 21:08:56 2020 (r363378) +++ head/sys/opencrypto/ktls_ocf.c Mon Jul 20 22:32:39 2020 (r363379) @@ -51,7 +51,6 @@ struct ocf_session { struct ocf_operation { struct ocf_session *os; bool done; - struct iovec iov[0]; }; static MALLOC_DEFINE(M_KTLS_OCF, "ktls_ocf", "OCF KTLS"); @@ -109,18 +108,18 @@ ktls_ocf_tls12_gcm_encrypt(struct ktls_session *tls, { struct uio uio, out_uio, *tag_uio; struct tls_aead_data ad; - struct cryptop *crp; + struct cryptop crp; struct ocf_session *os; - struct ocf_operation *oo; + struct ocf_operation oo; + struct iovec iov[iovcnt + 1]; int i, error; uint16_t tls_comp_len; bool inplace; os = tls->cipher; - oo = malloc(sizeof(*oo) + (iovcnt + 1) * sizeof(struct iovec), - M_KTLS_OCF, M_WAITOK | M_ZERO); - oo->os = os; + oo.os = os; + oo.done = false; uio.uio_iov = iniov; uio.uio_iovcnt = iovcnt; @@ -134,11 +133,11 @@ ktls_ocf_tls12_gcm_encrypt(struct ktls_session *tls, out_uio.uio_segflg = UIO_SYSSPACE; out_uio.uio_td = curthread; - crp = crypto_getreq(os->sid, M_WAITOK); + crypto_initreq(&crp, os->sid); /* Setup the IV. */ - memcpy(crp->crp_iv, tls->params.iv, TLS_AEAD_GCM_LEN); - memcpy(crp->crp_iv + TLS_AEAD_GCM_LEN, hdr + 1, sizeof(uint64_t)); + memcpy(crp.crp_iv, tls->params.iv, TLS_AEAD_GCM_LEN); + memcpy(crp.crp_iv + TLS_AEAD_GCM_LEN, hdr + 1, sizeof(uint64_t)); /* Setup the AAD. */ tls_comp_len = ntohs(hdr->tls_length) - @@ -148,19 +147,19 @@ ktls_ocf_tls12_gcm_encrypt(struct ktls_session *tls, ad.tls_vmajor = hdr->tls_vmajor; ad.tls_vminor = hdr->tls_vminor; ad.tls_length = htons(tls_comp_len); - crp->crp_aad = &ad; - crp->crp_aad_length = sizeof(ad); + crp.crp_aad = &ad; + crp.crp_aad_length = sizeof(ad); /* Compute payload length and determine if encryption is in place. */ inplace = true; - crp->crp_payload_start = 0; + crp.crp_payload_start = 0; for (i = 0; i < iovcnt; i++) { if (iniov[i].iov_base != outiov[i].iov_base) inplace = false; - crp->crp_payload_length += iniov[i].iov_len; + crp.crp_payload_length += iniov[i].iov_len; } - uio.uio_resid = crp->crp_payload_length; - out_uio.uio_resid = crp->crp_payload_length; + uio.uio_resid = crp.crp_payload_length; + out_uio.uio_resid = crp.crp_payload_length; if (inplace) tag_uio = &uio; @@ -168,21 +167,21 @@ ktls_ocf_tls12_gcm_encrypt(struct ktls_session *tls, tag_uio = &out_uio; /* Duplicate iovec and append vector for tag. */ - memcpy(oo->iov, tag_uio->uio_iov, iovcnt * sizeof(struct iovec)); - tag_uio->uio_iov = oo->iov; - tag_uio->uio_iov[iovcnt].iov_base = trailer; - tag_uio->uio_iov[iovcnt].iov_len = AES_GMAC_HASH_LEN; + memcpy(iov, tag_uio->uio_iov, iovcnt * sizeof(struct iovec)); + iov[iovcnt].iov_base = trailer; + iov[iovcnt].iov_len = AES_GMAC_HASH_LEN; + tag_uio->uio_iov = iov; tag_uio->uio_iovcnt++; - crp->crp_digest_start = tag_uio->uio_resid; + crp.crp_digest_start = tag_uio->uio_resid; tag_uio->uio_resid += AES_GMAC_HASH_LEN; - crp->crp_op = CRYPTO_OP_ENCRYPT | CRYPTO_OP_COMPUTE_DIGEST; - crp->crp_flags = CRYPTO_F_CBIMM | CRYPTO_F_IV_SEPARATE; - crypto_use_uio(crp, &uio); + crp.crp_op = CRYPTO_OP_ENCRYPT | CRYPTO_OP_COMPUTE_DIGEST; + crp.crp_flags = CRYPTO_F_CBIMM | CRYPTO_F_IV_SEPARATE; + crypto_use_uio(&crp, &uio); if (!inplace) - crypto_use_output_uio(crp, &out_uio); - crp->crp_opaque = oo; - crp->crp_callback = ktls_ocf_callback; + crypto_use_output_uio(&crp, &out_uio); + crp.crp_opaque = &oo; + crp.crp_callback = ktls_ocf_callback; counter_u64_add(ocf_tls12_gcm_crypts, 1); if (inplace) @@ -190,28 +189,27 @@ ktls_ocf_tls12_gcm_encrypt(struct ktls_session *tls, else counter_u64_add(ocf_separate_output, 1); for (;;) { - error = crypto_dispatch(crp); + error = crypto_dispatch(&crp); if (error) break; mtx_lock(&os->lock); - while (!oo->done) - mtx_sleep(oo, &os->lock, 0, "ocfktls", 0); + while (!oo.done) + mtx_sleep(&oo, &os->lock, 0, "ocfktls", 0); mtx_unlock(&os->lock); - if (crp->crp_etype != EAGAIN) { - error = crp->crp_etype; + if (crp.crp_etype != EAGAIN) { + error = crp.crp_etype; break; } - crp->crp_etype = 0; - crp->crp_flags &= ~CRYPTO_F_DONE; - oo->done = false; + crp.crp_etype = 0; + crp.crp_flags &= ~CRYPTO_F_DONE; + oo.done = false; counter_u64_add(ocf_retries, 1); } - crypto_freereq(crp); - free(oo, M_KTLS_OCF); + crypto_destroyreq(&crp); return (error); } @@ -223,22 +221,19 @@ ktls_ocf_tls13_gcm_encrypt(struct ktls_session *tls, struct uio uio, out_uio; struct tls_aead_data_13 ad; char nonce[12]; - struct cryptop *crp; + struct cryptop crp; struct ocf_session *os; - struct ocf_operation *oo; - struct iovec *iov, *out_iov; + struct ocf_operation oo; + struct iovec iov[iovcnt + 1], out_iov[iovcnt + 1]; int i, error; bool inplace; os = tls->cipher; - oo = malloc(sizeof(*oo) + (iovcnt + 1) * sizeof(*iov) * 2, M_KTLS_OCF, - M_WAITOK | M_ZERO); - oo->os = os; - iov = oo->iov; - out_iov = iov + iovcnt + 2; + oo.os = os; + oo.done = false; - crp = crypto_getreq(os->sid, M_WAITOK); + crypto_initreq(&crp, os->sid); /* Setup the nonce. */ memcpy(nonce, tls->params.iv, tls->params.iv_len); @@ -249,22 +244,22 @@ ktls_ocf_tls13_gcm_encrypt(struct ktls_session *tls, ad.tls_vmajor = hdr->tls_vmajor; ad.tls_vminor = hdr->tls_vminor; ad.tls_length = hdr->tls_length; - crp->crp_aad = &ad; - crp->crp_aad_length = sizeof(ad); + crp.crp_aad = &ad; + crp.crp_aad_length = sizeof(ad); /* Compute payload length and determine if encryption is in place. */ inplace = true; - crp->crp_payload_start = 0; + crp.crp_payload_start = 0; for (i = 0; i < iovcnt; i++) { if (iniov[i].iov_base != outiov[i].iov_base) inplace = false; - crp->crp_payload_length += iniov[i].iov_len; + crp.crp_payload_length += iniov[i].iov_len; } /* Store the record type as the first byte of the trailer. */ trailer[0] = record_type; - crp->crp_payload_length++; - crp->crp_digest_start = crp->crp_payload_length; + crp.crp_payload_length++; + crp.crp_digest_start = crp.crp_payload_length; /* * Duplicate the input iov to append the trailer. Always @@ -277,10 +272,10 @@ ktls_ocf_tls13_gcm_encrypt(struct ktls_session *tls, uio.uio_iov = iov; uio.uio_iovcnt = iovcnt + 1; uio.uio_offset = 0; - uio.uio_resid = crp->crp_payload_length + AES_GMAC_HASH_LEN; + uio.uio_resid = crp.crp_payload_length + AES_GMAC_HASH_LEN; uio.uio_segflg = UIO_SYSSPACE; uio.uio_td = curthread; - crypto_use_uio(crp, &uio); + crypto_use_uio(&crp, &uio); if (!inplace) { /* Duplicate the output iov to append the trailer. */ @@ -290,19 +285,19 @@ ktls_ocf_tls13_gcm_encrypt(struct ktls_session *tls, out_uio.uio_iov = out_iov; out_uio.uio_iovcnt = iovcnt + 1; out_uio.uio_offset = 0; - out_uio.uio_resid = crp->crp_payload_length + + out_uio.uio_resid = crp.crp_payload_length + AES_GMAC_HASH_LEN; out_uio.uio_segflg = UIO_SYSSPACE; out_uio.uio_td = curthread; - crypto_use_output_uio(crp, &out_uio); + crypto_use_output_uio(&crp, &out_uio); } - crp->crp_op = CRYPTO_OP_ENCRYPT | CRYPTO_OP_COMPUTE_DIGEST; - crp->crp_flags = CRYPTO_F_CBIMM | CRYPTO_F_IV_SEPARATE; - crp->crp_opaque = oo; - crp->crp_callback = ktls_ocf_callback; + crp.crp_op = CRYPTO_OP_ENCRYPT | CRYPTO_OP_COMPUTE_DIGEST; + crp.crp_flags = CRYPTO_F_CBIMM | CRYPTO_F_IV_SEPARATE; + crp.crp_opaque = &oo; + crp.crp_callback = ktls_ocf_callback; - memcpy(crp->crp_iv, nonce, sizeof(nonce)); + memcpy(crp.crp_iv, nonce, sizeof(nonce)); counter_u64_add(ocf_tls13_gcm_crypts, 1); if (inplace) @@ -310,28 +305,27 @@ ktls_ocf_tls13_gcm_encrypt(struct ktls_session *tls, else counter_u64_add(ocf_separate_output, 1); for (;;) { - error = crypto_dispatch(crp); + error = crypto_dispatch(&crp); if (error) break; mtx_lock(&os->lock); - while (!oo->done) - mtx_sleep(oo, &os->lock, 0, "ocfktls", 0); + while (!oo.done) + mtx_sleep(&oo, &os->lock, 0, "ocfktls", 0); mtx_unlock(&os->lock); - if (crp->crp_etype != EAGAIN) { - error = crp->crp_etype; + if (crp.crp_etype != EAGAIN) { + error = crp.crp_etype; break; } - crp->crp_etype = 0; - crp->crp_flags &= ~CRYPTO_F_DONE; - oo->done = false; + crp.crp_etype = 0; + crp.crp_flags &= ~CRYPTO_F_DONE; + oo.done = false; counter_u64_add(ocf_retries, 1); } - crypto_freereq(crp); - free(oo, M_KTLS_OCF); + crypto_destroyreq(&crp); return (error); } From owner-svn-src-all@freebsd.org Mon Jul 20 23:47:30 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2804F36D43E; Mon, 20 Jul 2020 23:47:30 +0000 (UTC) (envelope-from rscheff@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4B9dgk0HHrz3T6n; Mon, 20 Jul 2020 23:47:30 +0000 (UTC) (envelope-from rscheff@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DCFD514B6B; Mon, 20 Jul 2020 23:47:29 +0000 (UTC) (envelope-from rscheff@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06KNlTf0063406; Mon, 20 Jul 2020 23:47:29 GMT (envelope-from rscheff@FreeBSD.org) Received: (from rscheff@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06KNlSpO063398; Mon, 20 Jul 2020 23:47:28 GMT (envelope-from rscheff@FreeBSD.org) Message-Id: <202007202347.06KNlSpO063398@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rscheff set sender to rscheff@FreeBSD.org using -f From: Richard Scheffenegger Date: Mon, 20 Jul 2020 23:47:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363380 - head/sys/netinet/cc X-SVN-Group: head X-SVN-Commit-Author: rscheff X-SVN-Commit-Paths: head/sys/netinet/cc X-SVN-Commit-Revision: 363380 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 20 Jul 2020 23:47:30 -0000 Author: rscheff Date: Mon Jul 20 23:47:27 2020 New Revision: 363380 URL: https://svnweb.freebsd.org/changeset/base/363380 Log: Add MODULE_VERSION to TCP loadable congestion control modules. Without versioning information, using preexisting loader / linker code is not easily possible when another module may have dependencies on pre-loaded modules, and also doesn't allow the automatic loading of dependent modules. No functional change of the actual modules. Reviewed by: tuexen (mentor), rgrimes (mentor) Approved by: tuexen (mentor), rgrimes (mentor) MFC after: 2 weeks Sponsored by: NetApp, Inc. Differential Revision: https://reviews.freebsd.org/D25744 Modified: head/sys/netinet/cc/cc_cdg.c head/sys/netinet/cc/cc_chd.c head/sys/netinet/cc/cc_cubic.c head/sys/netinet/cc/cc_dctcp.c head/sys/netinet/cc/cc_hd.c head/sys/netinet/cc/cc_htcp.c head/sys/netinet/cc/cc_newreno.c head/sys/netinet/cc/cc_vegas.c Modified: head/sys/netinet/cc/cc_cdg.c ============================================================================== --- head/sys/netinet/cc/cc_cdg.c Mon Jul 20 22:32:39 2020 (r363379) +++ head/sys/netinet/cc/cc_cdg.c Mon Jul 20 23:47:27 2020 (r363380) @@ -714,5 +714,5 @@ SYSCTL_UINT(_net_inet_tcp_cc_cdg, OID_AUTO, loss_compe "the window backoff for loss based CC compatibility"); DECLARE_CC_MODULE(cdg, &cdg_cc_algo); - +MODULE_VERSION(cdg, 1); MODULE_DEPEND(cdg, ertt, 1, 1, 1); Modified: head/sys/netinet/cc/cc_chd.c ============================================================================== --- head/sys/netinet/cc/cc_chd.c Mon Jul 20 22:32:39 2020 (r363379) +++ head/sys/netinet/cc/cc_chd.c Mon Jul 20 23:47:27 2020 (r363380) @@ -493,4 +493,5 @@ SYSCTL_UINT(_net_inet_tcp_cc_chd, OID_AUTO, use_max, "as the basic delay measurement for the algorithm."); DECLARE_CC_MODULE(chd, &chd_cc_algo); +MODULE_VERSION(chd, 1); MODULE_DEPEND(chd, ertt, 1, 1, 1); Modified: head/sys/netinet/cc/cc_cubic.c ============================================================================== --- head/sys/netinet/cc/cc_cubic.c Mon Jul 20 22:32:39 2020 (r363379) +++ head/sys/netinet/cc/cc_cubic.c Mon Jul 20 23:47:27 2020 (r363380) @@ -473,3 +473,4 @@ cubic_ssthresh_update(struct cc_var *ccv) DECLARE_CC_MODULE(cubic, &cubic_cc_algo); +MODULE_VERSION(cubic, 1); Modified: head/sys/netinet/cc/cc_dctcp.c ============================================================================== --- head/sys/netinet/cc/cc_dctcp.c Mon Jul 20 22:32:39 2020 (r363379) +++ head/sys/netinet/cc/cc_dctcp.c Mon Jul 20 23:47:27 2020 (r363380) @@ -464,3 +464,4 @@ SYSCTL_PROC(_net_inet_tcp_cc_dctcp, OID_AUTO, slowstar "half CWND reduction after the first slow start"); DECLARE_CC_MODULE(dctcp, &dctcp_cc_algo); +MODULE_VERSION(dctcp, 1); Modified: head/sys/netinet/cc/cc_hd.c ============================================================================== --- head/sys/netinet/cc/cc_hd.c Mon Jul 20 22:32:39 2020 (r363379) +++ head/sys/netinet/cc/cc_hd.c Mon Jul 20 23:47:27 2020 (r363380) @@ -251,4 +251,5 @@ SYSCTL_PROC(_net_inet_tcp_cc_hd, OID_AUTO, queue_min, "minimum queueing delay threshold (qmin) in ticks"); DECLARE_CC_MODULE(hd, &hd_cc_algo); +MODULE_VERSION(hd, 1); MODULE_DEPEND(hd, ertt, 1, 1, 1); Modified: head/sys/netinet/cc/cc_htcp.c ============================================================================== --- head/sys/netinet/cc/cc_htcp.c Mon Jul 20 22:32:39 2020 (r363379) +++ head/sys/netinet/cc/cc_htcp.c Mon Jul 20 23:47:27 2020 (r363380) @@ -530,3 +530,4 @@ SYSCTL_UINT(_net_inet_tcp_cc_htcp, OID_AUTO, rtt_scali "enable H-TCP RTT scaling"); DECLARE_CC_MODULE(htcp, &htcp_cc_algo); +MODULE_VERSION(htcp, 1); Modified: head/sys/netinet/cc/cc_newreno.c ============================================================================== --- head/sys/netinet/cc/cc_newreno.c Mon Jul 20 22:32:39 2020 (r363379) +++ head/sys/netinet/cc/cc_newreno.c Mon Jul 20 23:47:27 2020 (r363380) @@ -396,3 +396,4 @@ SYSCTL_PROC(_net_inet_tcp_cc_newreno, OID_AUTO, beta_e "New Reno beta ecn, specified as number between 1 and 100"); DECLARE_CC_MODULE(newreno, &newreno_cc_algo); +MODULE_VERSION(newreno, 1); Modified: head/sys/netinet/cc/cc_vegas.c ============================================================================== --- head/sys/netinet/cc/cc_vegas.c Mon Jul 20 22:32:39 2020 (r363379) +++ head/sys/netinet/cc/cc_vegas.c Mon Jul 20 23:47:27 2020 (r363380) @@ -301,4 +301,5 @@ SYSCTL_PROC(_net_inet_tcp_cc_vegas, OID_AUTO, beta, "vegas beta, specified as number of \"buffers\" (0 < alpha < beta)"); DECLARE_CC_MODULE(vegas, &vegas_cc_algo); +MODULE_VERSION(vegas, 1); MODULE_DEPEND(vegas, ertt, 1, 1, 1); From owner-svn-src-all@freebsd.org Mon Jul 20 23:57:54 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B538036D8E2; Mon, 20 Jul 2020 23:57:54 +0000 (UTC) (envelope-from leres@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4B9dvk4Rksz3TlG; Mon, 20 Jul 2020 23:57:54 +0000 (UTC) (envelope-from leres@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 774CE152E0; Mon, 20 Jul 2020 23:57:54 +0000 (UTC) (envelope-from leres@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06KNvs40069661; Mon, 20 Jul 2020 23:57:54 GMT (envelope-from leres@FreeBSD.org) Received: (from leres@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06KNvrLp069659; Mon, 20 Jul 2020 23:57:53 GMT (envelope-from leres@FreeBSD.org) Message-Id: <202007202357.06KNvrLp069659@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: leres set sender to leres@FreeBSD.org using -f From: Craig Leres Date: Mon, 20 Jul 2020 23:57:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363381 - in head: contrib/netbsd-tests/usr.bin/grep usr.bin/grep X-SVN-Group: head X-SVN-Commit-Author: leres X-SVN-Commit-Paths: in head: contrib/netbsd-tests/usr.bin/grep usr.bin/grep X-SVN-Commit-Revision: 363381 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 20 Jul 2020 23:57:54 -0000 Author: leres (ports committer) Date: Mon Jul 20 23:57:53 2020 New Revision: 363381 URL: https://svnweb.freebsd.org/changeset/base/363381 Log: Fix some regressions with the zgrep(1) wrapper. - Handle whitespace with long flags that take arguments: echo 'foo bar' > test zgrep --regexp='foo bar' test - Do not hang reading from stdin with patterns in a file: echo foobar > test echo foo > pattern zgrep -f pattern test zgrep --file=pattern test - Handle any flags after -e: echo foobar > test zgrep -e foo --ignore-case < test These two are still outstanding problems: - Does not handle flags that take an argument if there is no whitespace: zgrep -enfs /etc/rpc - When more than one -e pattern used matching should occur for all patterns (similar to multiple patterns supplied with -f file). Instead only the last pattern is used for matching: zgrep -e rex -e nfs /etc/rpc (This problem is masked in the unpatched version by the "any flags after -e" problem.) Add tests for the above problems. Update the mange and add references to gzip(1) and zstd(1) and also document the remaining known problems. PR: 247126 Approved by: markj MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D25613 Modified: head/contrib/netbsd-tests/usr.bin/grep/t_grep.sh (contents, props changed) head/usr.bin/grep/zgrep.1 head/usr.bin/grep/zgrep.sh Modified: head/contrib/netbsd-tests/usr.bin/grep/t_grep.sh ============================================================================== --- head/contrib/netbsd-tests/usr.bin/grep/t_grep.sh Mon Jul 20 23:47:27 2020 (r363380) +++ head/contrib/netbsd-tests/usr.bin/grep/t_grep.sh Mon Jul 20 23:57:53 2020 (r363381) @@ -214,6 +214,89 @@ zgrep_body() atf_check -o file:"$(atf_get_srcdir)/d_zgrep.out" zgrep -h line d_input.gz } +atf_test_case zgrep_combined_flags +zgrep_combined_flags_head() +{ + atf_set "descr" "Checks for zgrep wrapper problems with combined flags (PR 247126)" +} +zgrep_combined_flags_body() +{ + atf_expect_fail "known but unsolved zgrep wrapper script regression" + + echo 'foo bar' > test + + atf_check -o inline:"foo bar\n" zgrep -we foo test + # Avoid hang on reading from stdin in the failure case + atf_check -o inline:"foo bar\n" zgrep -wefoo test < /dev/null +} + +atf_test_case zgrep_eflag +zgrep_eflag_head() +{ + atf_set "descr" "Checks for zgrep wrapper problems with -e PATTERN (PR 247126)" +} +zgrep_eflag_body() +{ + echo 'foo bar' > test + + # Avoid hang on reading from stdin in the failure case + atf_check -o inline:"foo bar\n" zgrep -e 'foo bar' test < /dev/null + atf_check -o inline:"foo bar\n" zgrep --regexp='foo bar' test < /dev/null +} + +atf_test_case zgrep_fflag +zgrep_fflag_head() +{ + atf_set "descr" "Checks for zgrep wrapper problems with -f FILE (PR 247126)" +} +zgrep_fflag_body() +{ + echo foo > pattern + echo foobar > test + + # Avoid hang on reading from stdin in the failure case + atf_check -o inline:"foobar\n" zgrep -f pattern test test + + atf_check -o inline:"foobar\n" zgrep -e foo --ignore-case < test +} + +atf_test_case zgrep_multiple_eflags +zgrep_multiple_eflags_head() +{ + atf_set "descr" "Checks for zgrep wrapper problems with multiple -e flags (PR 247126)" +} +zgrep_multiple_eflags_body() +{ + atf_expect_fail "known but unsolved zgrep wrapper script regression" + + echo foobar > test + + atf_check -o inline:"foobar\n" zgrep -e foo -e xxx test +} + +atf_test_case zgrep_empty_eflag +zgrep_empty_eflag_head() +{ + atf_set "descr" "Checks for zgrep wrapper problems with empty -e flags pattern (PR 247126)" +} +zgrep_empty_eflag_body() +{ + echo foobar > test + + atf_check -o inline:"foobar\n" zgrep -e '' test +} + atf_test_case nonexistent nonexistent_head() { @@ -826,6 +909,12 @@ atf_init_test_cases() atf_add_test_case file_exp atf_add_test_case egrep atf_add_test_case zgrep + atf_add_test_case zgrep_combined_flags + atf_add_test_case zgrep_eflag + atf_add_test_case zgrep_empty_eflag + atf_add_test_case zgrep_fflag + atf_add_test_case zgrep_long_eflag + atf_add_test_case zgrep_multiple_eflags atf_add_test_case nonexistent atf_add_test_case context2 # Begin FreeBSD Modified: head/usr.bin/grep/zgrep.1 ============================================================================== --- head/usr.bin/grep/zgrep.1 Mon Jul 20 23:47:27 2020 (r363380) +++ head/usr.bin/grep/zgrep.1 Mon Jul 20 23:57:53 2020 (r363381) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 21, 2018 +.Dd July 20, 2020 .Dt ZGREP 1 .Os .Sh NAME @@ -86,9 +86,29 @@ to read compressed files. .Sh SEE ALSO .Xr bzip2 1 , .Xr grep 1 , -.Xr xz 1 +.Xr gzip 1 , +.Xr xz 1 , +.Xr zstd 1 .Sh AUTHORS This version of the .Nm utility was written by .An Thomas Klausner Aq Mt wiz@NetBSD.org . +.Sh BUGS +.Xr zgrep 1 +does not handle flags that take arguments if there is no whitespace +between the flag and the argument, for example: +.Pp +.Dl "zgrep -enfs /etc/rpc" +.Pp +When more than one +.Fl e +flag is used matching +should occur for any of the patterns (similar to multiple patterns +supplied in a file with the +.Fl f +flag). +.Xr zgrep 1 +only matches the last +.Fl e +pattern. Modified: head/usr.bin/grep/zgrep.sh ============================================================================== --- head/usr.bin/grep/zgrep.sh Mon Jul 20 23:47:27 2020 (r363380) +++ head/usr.bin/grep/zgrep.sh Mon Jul 20 23:57:53 2020 (r363381) @@ -29,6 +29,7 @@ grep=grep zcat=zstdcat endofopts=0 +pattern_file=0 pattern_found=0 grep_args="" hyphen=0 @@ -75,29 +76,46 @@ while [ $# -gt 0 -a ${endofopts} -eq 0 ] do case $1 in # from GNU grep-2.5.1 -- keep in sync! - -[ABCDXdefm]) + --) + shift + endofopts=1 + ;; + --file=*) + pattern_file=1 + grep_args="${grep_args} ${1}" + shift + ;; + --regexp=*) + pattern="${1#--regexp=}" + pattern_found=1 + shift + ;; + --*) + grep_args="${grep_args} $1" + shift + ;; + -*[ABCDXdefm]) if [ $# -lt 2 ] then echo "${prg}: missing argument for $1 flag" >&2 exit 1 fi case $1 in - -e) + -*e) pattern="$2" pattern_found=1 shift 2 - break + continue ;; + -*f) + pattern_file=1 + ;; *) ;; esac grep_args="${grep_args} $1 $2" shift 2 ;; - --) - shift - endofopts=1 - ;; -) hyphen=1 shift @@ -125,7 +143,7 @@ do done # if no -e option was found, take next argument as grep-pattern -if [ ${pattern_found} -lt 1 ] +if [ ${pattern_file} -eq 0 -a ${pattern_found} -eq 0 ] then if [ $# -ge 1 ]; then pattern="$1" @@ -136,6 +154,7 @@ then echo "${prg}: missing pattern" >&2 exit 1 fi + pattern_found=1 fi ret=0 @@ -143,15 +162,24 @@ ret=0 if [ $# -lt 1 ] then # ... on stdin - ${cattool} ${catargs} - | ${grep} ${grep_args} -- "${pattern}" - || ret=$? + if [ ${pattern_file} -eq 0 ]; then + ${cattool} ${catargs} - | ${grep} ${grep_args} -- "${pattern}" - || ret=$? + else + ${cattool} ${catargs} - | ${grep} ${grep_args} -- - || ret=$? + fi else # ... on all files given on the command line if [ ${silent} -lt 1 -a $# -gt 1 ]; then grep_args="-H ${grep_args}" fi for file; do - ${cattool} ${catargs} -- "${file}" | - ${grep} --label="${file}" ${grep_args} -- "${pattern}" - || ret=$? + if [ ${pattern_file} -eq 0 ]; then + ${cattool} ${catargs} -- "${file}" | + ${grep} --label="${file}" ${grep_args} -- "${pattern}" - || ret=$? + else + ${cattool} ${catargs} -- "${file}" | + ${grep} --label="${file}" ${grep_args} -- - || ret=$? + fi done fi From owner-svn-src-all@freebsd.org Tue Jul 21 07:35:04 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BD31837A5AF; Tue, 21 Jul 2020 07:35:04 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4B9r3D4bMyz4G0M; Tue, 21 Jul 2020 07:35:04 +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 819241AC11; Tue, 21 Jul 2020 07:35:04 +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 06L7Z41A057414; Tue, 21 Jul 2020 07:35:04 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06L7Z4HM057413; Tue, 21 Jul 2020 07:35:04 GMT (envelope-from avg@FreeBSD.org) Message-Id: <202007210735.06L7Z4HM057413@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Tue, 21 Jul 2020 07:35:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363382 - head/sys/dev/gpio X-SVN-Group: head X-SVN-Commit-Author: avg X-SVN-Commit-Paths: head/sys/dev/gpio X-SVN-Commit-Revision: 363382 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 21 Jul 2020 07:35:04 -0000 Author: avg Date: Tue Jul 21 07:35:03 2020 New Revision: 363382 URL: https://svnweb.freebsd.org/changeset/base/363382 Log: gpioiic: never drive lines active high I2C communication is done by a combination of driving a line low or letting it float, so that it is either pulled up or driven low by another party. r355276 besides the stated goal of the change -- using the new GPIO API -- also changed the logic, so that active state is signaled by actively driving a line. That worked with iicbb prior to r362042, but stopped working after that commit on at least some hardware. My guess that the breakage was related to getting an ACK bit. A device expected to be able to drive SDA actively low, but controller was actively driving it high for some time. Anyway, this change seems to fix the problem. Tested using gpioiic on Orange Pi PC Plus with HTU21 sensor. Reported by: Nick Kostirya Reviewed by: manu MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D25684 Modified: head/sys/dev/gpio/gpioiic.c Modified: head/sys/dev/gpio/gpioiic.c ============================================================================== --- head/sys/dev/gpio/gpioiic.c Mon Jul 20 23:57:53 2020 (r363381) +++ head/sys/dev/gpio/gpioiic.c Tue Jul 21 07:35:03 2020 (r363382) @@ -191,16 +191,14 @@ static void gpioiic_setsda(device_t dev, int val) { struct gpioiic_softc *sc = device_get_softc(dev); - int err; - /* - * Some controllers cannot set an output value while a pin is in input - * mode; in that case we set the pin again after changing mode. - */ - err = gpio_pin_set_active(sc->sdapin, val); - gpio_pin_setflags(sc->sdapin, GPIO_PIN_OUTPUT | GPIO_PIN_OPENDRAIN); - if (err != 0) - gpio_pin_set_active(sc->sdapin, val); + if (val) { + gpio_pin_setflags(sc->sdapin, GPIO_PIN_INPUT); + } else { + gpio_pin_setflags(sc->sdapin, + GPIO_PIN_OUTPUT | GPIO_PIN_OPENDRAIN); + gpio_pin_set_active(sc->sdapin, 0); + } } static void @@ -208,8 +206,13 @@ gpioiic_setscl(device_t dev, int val) { struct gpioiic_softc *sc = device_get_softc(dev); - gpio_pin_setflags(sc->sclpin, GPIO_PIN_OUTPUT | GPIO_PIN_OPENDRAIN); - gpio_pin_set_active(sc->sclpin, val); + if (val) { + gpio_pin_setflags(sc->sclpin, GPIO_PIN_INPUT); + } else { + gpio_pin_setflags(sc->sclpin, + GPIO_PIN_OUTPUT | GPIO_PIN_OPENDRAIN); + gpio_pin_set_active(sc->sclpin, 0); + } } static int From owner-svn-src-all@freebsd.org Tue Jul 21 07:41:37 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A1C0337A89B; Tue, 21 Jul 2020 07:41:37 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4B9rBn3vJqz4G5Q; Tue, 21 Jul 2020 07:41:37 +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 691B71AB23; Tue, 21 Jul 2020 07:41:37 +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 06L7fbSZ060917; Tue, 21 Jul 2020 07:41:37 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06L7fbZ3060915; Tue, 21 Jul 2020 07:41:37 GMT (envelope-from avg@FreeBSD.org) Message-Id: <202007210741.06L7fbZ3060915@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Tue, 21 Jul 2020 07:41:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363383 - in head/sys/cddl/dev: dtrace/arm fbt/arm X-SVN-Group: head X-SVN-Commit-Author: avg X-SVN-Commit-Paths: in head/sys/cddl/dev: dtrace/arm fbt/arm X-SVN-Commit-Revision: 363383 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 21 Jul 2020 07:41:37 -0000 Author: avg Date: Tue Jul 21 07:41:36 2020 New Revision: 363383 URL: https://svnweb.freebsd.org/changeset/base/363383 Log: dtrace/fbt: fix return probe arguments on arm arg0 should be an offset of the return point within the function, arg1 should be the return value. Previously the return probe had arguments as if for the entry probe. Tested on armv7. andrew noted that the same problem seems to be present on arm64, mips, and riscv. I am not sure if I will get around to fixing those. So, platform users or anyone looking to make a contribution please be aware of this opportunity. Reviewed by: markj MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D25685 Modified: head/sys/cddl/dev/dtrace/arm/dtrace_subr.c head/sys/cddl/dev/fbt/arm/fbt_isa.c Modified: head/sys/cddl/dev/dtrace/arm/dtrace_subr.c ============================================================================== --- head/sys/cddl/dev/dtrace/arm/dtrace_subr.c Tue Jul 21 07:35:03 2020 (r363382) +++ head/sys/cddl/dev/dtrace/arm/dtrace_subr.c Tue Jul 21 07:41:36 2020 (r363383) @@ -248,7 +248,7 @@ dtrace_invop_start(struct trapframe *frame) register_t *r0, *sp; int data, invop, reg, update_sp; - invop = dtrace_invop(frame->tf_pc, frame, frame->tf_pc); + invop = dtrace_invop(frame->tf_pc, frame, frame->tf_r0); switch (invop & DTRACE_INVOP_MASK) { case DTRACE_INVOP_PUSHM: sp = (register_t *)frame->tf_svc_sp; Modified: head/sys/cddl/dev/fbt/arm/fbt_isa.c ============================================================================== --- head/sys/cddl/dev/fbt/arm/fbt_isa.c Tue Jul 21 07:35:03 2020 (r363382) +++ head/sys/cddl/dev/fbt/arm/fbt_isa.c Tue Jul 21 07:41:36 2020 (r363383) @@ -56,9 +56,12 @@ fbt_invop(uintptr_t addr, struct trapframe *frame, uin register_t fifthparam; for (; fbt != NULL; fbt = fbt->fbtp_hashnext) { - if ((uintptr_t)fbt->fbtp_patchpoint == addr) { - cpu->cpu_dtrace_caller = addr; + if ((uintptr_t)fbt->fbtp_patchpoint != addr) + continue; + cpu->cpu_dtrace_caller = addr; + + if (fbt->fbtp_roffset == 0) { /* Get 5th parameter from stack */ DTRACE_CPUFLAG_SET(CPU_DTRACE_NOFAULT); fifthparam = *(register_t *)frame->tf_svc_sp; @@ -67,11 +70,13 @@ fbt_invop(uintptr_t addr, struct trapframe *frame, uin dtrace_probe(fbt->fbtp_id, frame->tf_r0, frame->tf_r1, frame->tf_r2, frame->tf_r3, fifthparam); - - cpu->cpu_dtrace_caller = 0; - - return (fbt->fbtp_rval | (fbt->fbtp_savedval << DTRACE_INVOP_SHIFT)); + } else { + dtrace_probe(fbt->fbtp_id, fbt->fbtp_roffset, rval, + 0, 0, 0); } + + cpu->cpu_dtrace_caller = 0; + return (fbt->fbtp_rval | (fbt->fbtp_savedval << DTRACE_INVOP_SHIFT)); } return (0); @@ -178,6 +183,7 @@ again: fbt->fbtp_rval = DTRACE_INVOP_B; else fbt->fbtp_rval = DTRACE_INVOP_POPM; + fbt->fbtp_roffset = (uintptr_t)instr - (uintptr_t)symval->value; fbt->fbtp_savedval = *instr; fbt->fbtp_patchval = FBT_BREAKPOINT; fbt->fbtp_hashnext = fbt_probetab[FBT_ADDR2NDX(instr)]; From owner-svn-src-all@freebsd.org Tue Jul 21 07:58:40 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 46E9937AF93; Tue, 21 Jul 2020 07:58:40 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4B9rZS18LCz4HLB; Tue, 21 Jul 2020 07:58:40 +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 0B8E71AFB7; Tue, 21 Jul 2020 07:58:40 +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 06L7wdZ4070053; Tue, 21 Jul 2020 07:58:39 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06L7wdct070052; Tue, 21 Jul 2020 07:58:39 GMT (envelope-from avg@FreeBSD.org) Message-Id: <202007210758.06L7wdct070052@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Tue, 21 Jul 2020 07:58:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r363384 - stable/12/sys/sys X-SVN-Group: stable-12 X-SVN-Commit-Author: avg X-SVN-Commit-Paths: stable/12/sys/sys X-SVN-Commit-Revision: 363384 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 21 Jul 2020 07:58:40 -0000 Author: avg Date: Tue Jul 21 07:58:39 2020 New Revision: 363384 URL: https://svnweb.freebsd.org/changeset/base/363384 Log: MFC r340450,r340664,r346176 by imp: fix time conversions to and from sbt Note that the PR is for a change elsewhere (ZFS) that expected the sane behavior of nstosbt(). PR: 247829 Reported by: gbe, others Tested by: gbe, others Modified: stable/12/sys/sys/time.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/sys/time.h ============================================================================== --- stable/12/sys/sys/time.h Tue Jul 21 07:41:36 2020 (r363383) +++ stable/12/sys/sys/time.h Tue Jul 21 07:58:39 2020 (r363384) @@ -161,19 +161,58 @@ sbttobt(sbintime_t _sbt) * Decimal<->sbt conversions. Multiplying or dividing by SBT_1NS results in * large roundoff errors which sbttons() and nstosbt() avoid. Millisecond and * microsecond functions are also provided for completeness. + * + * These functions return the smallest sbt larger or equal to the + * number of seconds requested so that sbttoX(Xtosbt(y)) == y. Unlike + * top of second computations below, which require that we tick at the + * top of second, these need to be rounded up so we do whatever for at + * least as long as requested. + * + * The naive computation we'd do is this + * ((unit * 2^64 / SIFACTOR) + 2^32-1) >> 32 + * However, that overflows. Instead, we compute + * ((unit * 2^63 / SIFACTOR) + 2^31-1) >> 32 + * and use pre-computed constants that are the ceil of the 2^63 / SIFACTOR + * term to ensure we are using exactly the right constant. We use the lesser + * evil of ull rather than a uint64_t cast to ensure we have well defined + * right shift semantics. With these changes, we get all the ns, us and ms + * conversions back and forth right. + * Note: This file is used for both kernel and userland includes, so we can't + * rely on KASSERT being defined, nor can we pollute the namespace by including + * assert.h. */ static __inline int64_t sbttons(sbintime_t _sbt) { + uint64_t ns; - return ((1000000000 * _sbt) >> 32); +#ifdef KASSERT + KASSERT(_sbt >= 0, ("Negative values illegal for sbttons: %jx", _sbt)); +#endif + ns = _sbt; + if (ns >= SBT_1S) + ns = (ns >> 32) * 1000000000; + else + ns = 0; + + return (ns + (1000000000 * (_sbt & 0xffffffffu) >> 32)); } static __inline sbintime_t nstosbt(int64_t _ns) { + sbintime_t sb = 0; - return ((_ns * (((uint64_t)1 << 63) / 500000000)) >> 32); +#ifdef KASSERT + KASSERT(_ns >= 0, ("Negative values illegal for nstosbt: %jd", _ns)); +#endif + if (_ns >= SBT_1S) { + sb = (_ns / 1000000000) * SBT_1S; + _ns = _ns % 1000000000; + } + /* 9223372037 = ceil(2^63 / 1000000000) */ + sb += ((_ns * 9223372037ull) + 0x7fffffff) >> 31; + return (sb); } static __inline int64_t @@ -186,8 +225,18 @@ sbttous(sbintime_t _sbt) static __inline sbintime_t ustosbt(int64_t _us) { + sbintime_t sb = 0; - return ((_us * (((uint64_t)1 << 63) / 500000)) >> 32); +#ifdef KASSERT + KASSERT(_us >= 0, ("Negative values illegal for ustosbt: %jd", _us)); +#endif + if (_us >= SBT_1S) { + sb = (_us / 1000000) * SBT_1S; + _us = _us % 1000000; + } + /* 9223372036855 = ceil(2^63 / 1000000) */ + sb += ((_us * 9223372036855ull) + 0x7fffffff) >> 31; + return (sb); } static __inline int64_t @@ -200,8 +249,18 @@ sbttoms(sbintime_t _sbt) static __inline sbintime_t mstosbt(int64_t _ms) { + sbintime_t sb = 0; - return ((_ms * (((uint64_t)1 << 63) / 500)) >> 32); +#ifdef KASSERT + KASSERT(_ms >= 0, ("Negative values illegal for mstosbt: %jd", _ms)); +#endif + if (_ms >= SBT_1S) { + sb = (_ms / 1000) * SBT_1S; + _ms = _ms % 1000; + } + /* 9223372036854776 = ceil(2^63 / 1000) */ + sb += ((_ms * 9223372036854776ull) + 0x7fffffff) >> 31; + return (sb); } /*- From owner-svn-src-all@freebsd.org Tue Jul 21 08:12:54 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1F37037B4C9; Tue, 21 Jul 2020 08:12:54 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4B9rtt01nnz4JMY; Tue, 21 Jul 2020 08:12:54 +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 BF67D1B44D; Tue, 21 Jul 2020 08:12:53 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06L8CrBh081889; Tue, 21 Jul 2020 08:12:53 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06L8Crvk081888; Tue, 21 Jul 2020 08:12:53 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202007210812.06L8Crvk081888@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 21 Jul 2020 08:12:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r363385 - in stable/12: include sys/sys X-SVN-Group: stable-12 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in stable/12: include sys/sys X-SVN-Commit-Revision: 363385 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 21 Jul 2020 08:12:54 -0000 Author: kib Date: Tue Jul 21 08:12:53 2020 New Revision: 363385 URL: https://svnweb.freebsd.org/changeset/base/363385 Log: MFC r363193: Make CLOCK_REALTIME and TIMER_ABSTIME available for XOPEN_SOURCE >= 500. PR: 247701 Modified: stable/12/include/time.h stable/12/sys/sys/time.h Directory Properties: stable/12/ (props changed) Modified: stable/12/include/time.h ============================================================================== --- stable/12/include/time.h Tue Jul 21 07:58:39 2020 (r363384) +++ stable/12/include/time.h Tue Jul 21 08:12:53 2020 (r363385) @@ -98,12 +98,14 @@ typedef __pid_t pid_t; #endif /* These macros are also in sys/time.h. */ -#if !defined(CLOCK_REALTIME) && __POSIX_VISIBLE >= 200112 +#if !defined(CLOCK_REALTIME) && __POSIX_VISIBLE >= 199506 #define CLOCK_REALTIME 0 -#ifdef __BSD_VISIBLE +#endif /* !defined(CLOCK_REALTIME) && __POSIX_VISIBLE >= 199506 */ +#if !defined(CLOCK_VIRTUAL) && __BSD_VISIBLE #define CLOCK_VIRTUAL 1 #define CLOCK_PROF 2 -#endif +#endif /* !defined(CLOCK_VIRTUAL) && __BSD_VISIBLE */ +#if !defined(CLOCK_MONOTONIC) && __POSIX_VISIBLE >= 200112 #define CLOCK_MONOTONIC 4 #define CLOCK_UPTIME 5 /* FreeBSD-specific. */ #define CLOCK_UPTIME_PRECISE 7 /* FreeBSD-specific. */ @@ -115,14 +117,14 @@ typedef __pid_t pid_t; #define CLOCK_SECOND 13 /* FreeBSD-specific. */ #define CLOCK_THREAD_CPUTIME_ID 14 #define CLOCK_PROCESS_CPUTIME_ID 15 -#endif /* !defined(CLOCK_REALTIME) && __POSIX_VISIBLE >= 200112 */ +#endif /* !defined(CLOCK_MONOTONIC) && __POSIX_VISIBLE >= 200112 */ -#if !defined(TIMER_ABSTIME) && __POSIX_VISIBLE >= 200112 #if __BSD_VISIBLE #define TIMER_RELTIME 0x0 /* relative timer */ #endif +#if !defined(TIMER_ABSTIME) && __POSIX_VISIBLE >= 199506 #define TIMER_ABSTIME 0x1 /* absolute timer */ -#endif /* !defined(TIMER_ABSTIME) && __POSIX_VISIBLE >= 200112 */ +#endif /* !defined(TIMER_ABSTIME) && __POSIX_VISIBLE >= 199506 */ struct tm { int tm_sec; /* seconds after the minute [0-60] */ Modified: stable/12/sys/sys/time.h ============================================================================== --- stable/12/sys/sys/time.h Tue Jul 21 07:58:39 2020 (r363384) +++ stable/12/sys/sys/time.h Tue Jul 21 08:12:53 2020 (r363385) @@ -463,8 +463,12 @@ struct clockinfo { /* These macros are also in time.h. */ #ifndef CLOCK_REALTIME #define CLOCK_REALTIME 0 +#endif +#ifndef CLOCK_VIRTUAL #define CLOCK_VIRTUAL 1 #define CLOCK_PROF 2 +#endif +#ifndef CLOCK_MONOTONIC #define CLOCK_MONOTONIC 4 #define CLOCK_UPTIME 5 /* FreeBSD-specific. */ #define CLOCK_UPTIME_PRECISE 7 /* FreeBSD-specific. */ From owner-svn-src-all@freebsd.org Tue Jul 21 08:13:35 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id F07E337B719; Tue, 21 Jul 2020 08:13:35 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4B9rvg67xkz4JNX; Tue, 21 Jul 2020 08:13:35 +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 9DC881B44F; Tue, 21 Jul 2020 08:13:35 +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 06L8DZ55081998; Tue, 21 Jul 2020 08:13:35 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06L8DZX1081996; Tue, 21 Jul 2020 08:13:35 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202007210813.06L8DZX1081996@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 21 Jul 2020 08:13: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: r363386 - in stable/11: include sys/sys X-SVN-Group: stable-11 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in stable/11: include sys/sys X-SVN-Commit-Revision: 363386 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 21 Jul 2020 08:13:36 -0000 Author: kib Date: Tue Jul 21 08:13:35 2020 New Revision: 363386 URL: https://svnweb.freebsd.org/changeset/base/363386 Log: MFC r363193: Make CLOCK_REALTIME and TIMER_ABSTIME available for XOPEN_SOURCE >= 500. PR: 247701 Modified: stable/11/include/time.h stable/11/sys/sys/time.h Directory Properties: stable/11/ (props changed) Modified: stable/11/include/time.h ============================================================================== --- stable/11/include/time.h Tue Jul 21 08:12:53 2020 (r363385) +++ stable/11/include/time.h Tue Jul 21 08:13:35 2020 (r363386) @@ -96,12 +96,14 @@ typedef __pid_t pid_t; #endif /* These macros are also in sys/time.h. */ -#if !defined(CLOCK_REALTIME) && __POSIX_VISIBLE >= 200112 +#if !defined(CLOCK_REALTIME) && __POSIX_VISIBLE >= 199506 #define CLOCK_REALTIME 0 -#ifdef __BSD_VISIBLE +#endif /* !defined(CLOCK_REALTIME) && __POSIX_VISIBLE >= 199506 */ +#if !defined(CLOCK_VIRTUAL) && __BSD_VISIBLE #define CLOCK_VIRTUAL 1 #define CLOCK_PROF 2 -#endif +#endif /* !defined(CLOCK_VIRTUAL) && __BSD_VISIBLE */ +#if !defined(CLOCK_MONOTONIC) && __POSIX_VISIBLE >= 200112 #define CLOCK_MONOTONIC 4 #define CLOCK_UPTIME 5 /* FreeBSD-specific. */ #define CLOCK_UPTIME_PRECISE 7 /* FreeBSD-specific. */ @@ -113,14 +115,14 @@ typedef __pid_t pid_t; #define CLOCK_SECOND 13 /* FreeBSD-specific. */ #define CLOCK_THREAD_CPUTIME_ID 14 #define CLOCK_PROCESS_CPUTIME_ID 15 -#endif /* !defined(CLOCK_REALTIME) && __POSIX_VISIBLE >= 200112 */ +#endif /* !defined(CLOCK_MONOTONIC) && __POSIX_VISIBLE >= 200112 */ -#if !defined(TIMER_ABSTIME) && __POSIX_VISIBLE >= 200112 #if __BSD_VISIBLE #define TIMER_RELTIME 0x0 /* relative timer */ #endif +#if !defined(TIMER_ABSTIME) && __POSIX_VISIBLE >= 199506 #define TIMER_ABSTIME 0x1 /* absolute timer */ -#endif /* !defined(TIMER_ABSTIME) && __POSIX_VISIBLE >= 200112 */ +#endif /* !defined(TIMER_ABSTIME) && __POSIX_VISIBLE >= 199506 */ struct tm { int tm_sec; /* seconds after the minute [0-60] */ Modified: stable/11/sys/sys/time.h ============================================================================== --- stable/11/sys/sys/time.h Tue Jul 21 08:12:53 2020 (r363385) +++ stable/11/sys/sys/time.h Tue Jul 21 08:13:35 2020 (r363386) @@ -382,8 +382,12 @@ struct clockinfo { /* These macros are also in time.h. */ #ifndef CLOCK_REALTIME #define CLOCK_REALTIME 0 +#endif +#ifndef CLOCK_VIRTUAL #define CLOCK_VIRTUAL 1 #define CLOCK_PROF 2 +#endif +#ifndef CLOCK_MONOTONIC #define CLOCK_MONOTONIC 4 #define CLOCK_UPTIME 5 /* FreeBSD-specific. */ #define CLOCK_UPTIME_PRECISE 7 /* FreeBSD-specific. */ From owner-svn-src-all@freebsd.org Tue Jul 21 10:38:54 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 872C737E6D5; Tue, 21 Jul 2020 10:38:54 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4B9w7L35Lnz4S77; Tue, 21 Jul 2020 10:38:54 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4956B1CA61; Tue, 21 Jul 2020 10:38:54 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06LAcsAX069265; Tue, 21 Jul 2020 10:38:54 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06LAcp2k069253; Tue, 21 Jul 2020 10:38:51 GMT (envelope-from br@FreeBSD.org) Message-Id: <202007211038.06LAcp2k069253@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Tue, 21 Jul 2020 10:38:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363387 - in head/sys: conf dev/iommu x86/iommu X-SVN-Group: head X-SVN-Commit-Author: br X-SVN-Commit-Paths: in head/sys: conf dev/iommu x86/iommu X-SVN-Commit-Revision: 363387 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 21 Jul 2020 10:38:54 -0000 Author: br Date: Tue Jul 21 10:38:51 2020 New Revision: 363387 URL: https://svnweb.freebsd.org/changeset/base/363387 Log: Move the Intel DMAR busdma backend to a generic place so it can be used on other IOMMU systems. Reviewed by: kib Sponsored by: DARPA/AFRL Differential Revision: https://reviews.freebsd.org/D25720 Added: head/sys/dev/iommu/ head/sys/dev/iommu/busdma_iommu.c - copied, changed from r363386, head/sys/x86/iommu/busdma_dmar.c head/sys/dev/iommu/busdma_iommu.h - copied unchanged from r363386, head/sys/x86/iommu/busdma_dmar.h Deleted: head/sys/x86/iommu/busdma_dmar.c head/sys/x86/iommu/busdma_dmar.h Modified: head/sys/conf/files.x86 head/sys/x86/iommu/intel_ctx.c head/sys/x86/iommu/intel_drv.c head/sys/x86/iommu/intel_fault.c head/sys/x86/iommu/intel_gas.c head/sys/x86/iommu/intel_idpgtbl.c head/sys/x86/iommu/intel_intrmap.c head/sys/x86/iommu/intel_qi.c head/sys/x86/iommu/intel_quirks.c head/sys/x86/iommu/intel_utils.c Modified: head/sys/conf/files.x86 ============================================================================== --- head/sys/conf/files.x86 Tue Jul 21 08:13:35 2020 (r363386) +++ head/sys/conf/files.x86 Tue Jul 21 10:38:51 2020 (r363387) @@ -165,6 +165,7 @@ dev/imcsmb/imcsmb.c optional imcsmb dev/imcsmb/imcsmb_pci.c optional imcsmb pci dev/intel/spi.c optional intelspi dev/io/iodev.c optional io +dev/iommu/busdma_iommu.c optional acpi acpi_dmar pci dev/ipmi/ipmi.c optional ipmi dev/ipmi/ipmi_acpi.c optional ipmi acpi dev/ipmi/ipmi_isa.c optional ipmi isa @@ -300,7 +301,6 @@ x86/cpufreq/hwpstate_amd.c optional cpufreq x86/cpufreq/hwpstate_intel.c optional cpufreq x86/cpufreq/p4tcc.c optional cpufreq x86/cpufreq/powernow.c optional cpufreq -x86/iommu/busdma_dmar.c optional acpi acpi_dmar pci x86/iommu/intel_ctx.c optional acpi acpi_dmar pci x86/iommu/intel_drv.c optional acpi acpi_dmar pci x86/iommu/intel_fault.c optional acpi acpi_dmar pci Copied and modified: head/sys/dev/iommu/busdma_iommu.c (from r363386, head/sys/x86/iommu/busdma_dmar.c) ============================================================================== --- head/sys/x86/iommu/busdma_dmar.c Tue Jul 21 08:13:35 2020 (r363386, copy source) +++ head/sys/dev/iommu/busdma_iommu.c Tue Jul 21 10:38:51 2020 (r363387) @@ -67,13 +67,13 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include +#include #include #endif /* - * busdma_dmar.c, the implementation of the busdma(9) interface using - * DMAR units from Intel VT-d. + * busdma_iommu.c, the implementation of the busdma(9) interface using + * IOMMU units from Intel VT-d. */ static bool Copied: head/sys/dev/iommu/busdma_iommu.h (from r363386, head/sys/x86/iommu/busdma_dmar.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/iommu/busdma_iommu.h Tue Jul 21 10:38:51 2020 (r363387, copy of r363386, head/sys/x86/iommu/busdma_dmar.h) @@ -0,0 +1,66 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2013 The FreeBSD Foundation + * All rights reserved. + * + * This software was 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: + * 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 __X86_IOMMU_BUSDMA_DMAR_H +#define __X86_IOMMU_BUSDMA_DMAR_H + +#include + +struct bus_dma_tag_iommu { + struct bus_dma_tag_common common; + struct iommu_ctx *ctx; + device_t owner; + int map_count; + bus_dma_segment_t *segments; +}; + +struct bus_dmamap_iommu { + struct bus_dma_tag_iommu *tag; + struct memdesc mem; + bus_dmamap_callback_t *callback; + void *callback_arg; + struct iommu_map_entries_tailq map_entries; + TAILQ_ENTRY(bus_dmamap_iommu) delay_link; + bool locked; + bool cansleep; + int flags; +}; + +#define BUS_DMAMAP_IOMMU_MALLOC 0x0001 +#define BUS_DMAMAP_IOMMU_KMEM_ALLOC 0x0002 + +extern struct bus_dma_impl bus_dma_iommu_impl; + +bus_dma_tag_t acpi_iommu_get_dma_tag(device_t dev, device_t child); + +#endif Modified: head/sys/x86/iommu/intel_ctx.c ============================================================================== --- head/sys/x86/iommu/intel_ctx.c Tue Jul 21 08:13:35 2020 (r363386) +++ head/sys/x86/iommu/intel_ctx.c Tue Jul 21 10:38:51 2020 (r363387) @@ -66,7 +66,7 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include +#include #include #include #include Modified: head/sys/x86/iommu/intel_drv.c ============================================================================== --- head/sys/x86/iommu/intel_drv.c Tue Jul 21 08:13:35 2020 (r363386) +++ head/sys/x86/iommu/intel_drv.c Tue Jul 21 10:38:51 2020 (r363387) @@ -68,7 +68,7 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include +#include #include #include #include Modified: head/sys/x86/iommu/intel_fault.c ============================================================================== --- head/sys/x86/iommu/intel_fault.c Tue Jul 21 08:13:35 2020 (r363386) +++ head/sys/x86/iommu/intel_fault.c Tue Jul 21 10:38:51 2020 (r363387) @@ -57,7 +57,7 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include +#include #include /* Modified: head/sys/x86/iommu/intel_gas.c ============================================================================== --- head/sys/x86/iommu/intel_gas.c Tue Jul 21 08:13:35 2020 (r363386) +++ head/sys/x86/iommu/intel_gas.c Tue Jul 21 10:38:51 2020 (r363387) @@ -66,7 +66,7 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include +#include #include #include Modified: head/sys/x86/iommu/intel_idpgtbl.c ============================================================================== --- head/sys/x86/iommu/intel_idpgtbl.c Tue Jul 21 08:13:35 2020 (r363386) +++ head/sys/x86/iommu/intel_idpgtbl.c Tue Jul 21 10:38:51 2020 (r363387) @@ -65,7 +65,7 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include +#include #include #include Modified: head/sys/x86/iommu/intel_intrmap.c ============================================================================== --- head/sys/x86/iommu/intel_intrmap.c Tue Jul 21 08:13:35 2020 (r363386) +++ head/sys/x86/iommu/intel_intrmap.c Tue Jul 21 10:38:51 2020 (r363387) @@ -54,7 +54,7 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include +#include #include #include #include Modified: head/sys/x86/iommu/intel_qi.c ============================================================================== --- head/sys/x86/iommu/intel_qi.c Tue Jul 21 08:13:35 2020 (r363386) +++ head/sys/x86/iommu/intel_qi.c Tue Jul 21 10:38:51 2020 (r363387) @@ -57,7 +57,7 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include +#include #include #include Modified: head/sys/x86/iommu/intel_quirks.c ============================================================================== --- head/sys/x86/iommu/intel_quirks.c Tue Jul 21 08:13:35 2020 (r363386) +++ head/sys/x86/iommu/intel_quirks.c Tue Jul 21 10:38:51 2020 (r363387) @@ -59,7 +59,7 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include +#include #include #include #include Modified: head/sys/x86/iommu/intel_utils.c ============================================================================== --- head/sys/x86/iommu/intel_utils.c Tue Jul 21 08:13:35 2020 (r363386) +++ head/sys/x86/iommu/intel_utils.c Tue Jul 21 10:38:51 2020 (r363387) @@ -65,7 +65,7 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include +#include #include #include From owner-svn-src-all@freebsd.org Tue Jul 21 13:50:11 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AB3F135CFA0; Tue, 21 Jul 2020 13:50:11 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BB0N345dXz4f1W; Tue, 21 Jul 2020 13:50:11 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 708BC1F04A; Tue, 21 Jul 2020 13:50:11 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06LDoBDT086635; Tue, 21 Jul 2020 13:50:11 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06LDoApe086632; Tue, 21 Jul 2020 13:50:10 GMT (envelope-from br@FreeBSD.org) Message-Id: <202007211350.06LDoApe086632@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Tue, 21 Jul 2020 13:50:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363388 - in head/sys: dev/iommu sys x86/iommu X-SVN-Group: head X-SVN-Commit-Author: br X-SVN-Commit-Paths: in head/sys: dev/iommu sys x86/iommu X-SVN-Commit-Revision: 363388 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 21 Jul 2020 13:50:11 -0000 Author: br Date: Tue Jul 21 13:50:10 2020 New Revision: 363388 URL: https://svnweb.freebsd.org/changeset/base/363388 Log: Move sys/iommu.h to dev/iommu/ as a part of generic IOMMU busdma backend. Reviewed by: kib Sponsored by: DARPA/AFRL Differential Revision: https://reviews.freebsd.org/D25750 Added: head/sys/dev/iommu/iommu.h - copied unchanged from r363387, head/sys/sys/iommu.h Deleted: head/sys/sys/iommu.h Modified: head/sys/dev/iommu/busdma_iommu.c head/sys/dev/iommu/busdma_iommu.h head/sys/x86/iommu/intel_dmar.h Modified: head/sys/dev/iommu/busdma_iommu.c ============================================================================== --- head/sys/dev/iommu/busdma_iommu.c Tue Jul 21 10:38:51 2020 (r363387) +++ head/sys/dev/iommu/busdma_iommu.c Tue Jul 21 13:50:10 2020 (r363388) @@ -39,7 +39,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include @@ -68,6 +67,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #endif Modified: head/sys/dev/iommu/busdma_iommu.h ============================================================================== --- head/sys/dev/iommu/busdma_iommu.h Tue Jul 21 10:38:51 2020 (r363387) +++ head/sys/dev/iommu/busdma_iommu.h Tue Jul 21 13:50:10 2020 (r363388) @@ -34,7 +34,7 @@ #ifndef __X86_IOMMU_BUSDMA_DMAR_H #define __X86_IOMMU_BUSDMA_DMAR_H -#include +#include struct bus_dma_tag_iommu { struct bus_dma_tag_common common; Copied: head/sys/dev/iommu/iommu.h (from r363387, head/sys/sys/iommu.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/iommu/iommu.h Tue Jul 21 13:50:10 2020 (r363388, copy of r363387, head/sys/sys/iommu.h) @@ -0,0 +1,168 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2013 The FreeBSD Foundation + * All rights reserved. + * + * This software was 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: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _SYS_IOMMU_H_ +#define _SYS_IOMMU_H_ + +#include +#include +#include +#include + +/* Host or physical memory address, after translation. */ +typedef uint64_t iommu_haddr_t; +/* Guest or bus address, before translation. */ +typedef uint64_t iommu_gaddr_t; + +struct bus_dma_tag_common; +struct iommu_map_entry; +TAILQ_HEAD(iommu_map_entries_tailq, iommu_map_entry); + +struct iommu_qi_genseq { + u_int gen; + uint32_t seq; +}; + +struct iommu_map_entry { + iommu_gaddr_t start; + iommu_gaddr_t end; + iommu_gaddr_t first; /* Least start in subtree */ + iommu_gaddr_t last; /* Greatest end in subtree */ + iommu_gaddr_t free_down; /* Max free space below the + current R/B tree node */ + u_int flags; + TAILQ_ENTRY(iommu_map_entry) dmamap_link; /* Link for dmamap entries */ + RB_ENTRY(iommu_map_entry) rb_entry; /* Links for domain entries */ + TAILQ_ENTRY(iommu_map_entry) unroll_link; /* Link for unroll after + dmamap_load failure */ + struct iommu_domain *domain; + struct iommu_qi_genseq gseq; +}; + +#define IOMMU_MAP_ENTRY_PLACE 0x0001 /* Fake entry */ +#define IOMMU_MAP_ENTRY_RMRR 0x0002 /* Permanent, not linked by + dmamap_link */ +#define IOMMU_MAP_ENTRY_MAP 0x0004 /* Busdma created, linked by + dmamap_link */ +#define IOMMU_MAP_ENTRY_UNMAPPED 0x0010 /* No backing pages */ +#define IOMMU_MAP_ENTRY_QI_NF 0x0020 /* qi task, do not free entry */ +#define IOMMU_MAP_ENTRY_READ 0x1000 /* Read permitted */ +#define IOMMU_MAP_ENTRY_WRITE 0x2000 /* Write permitted */ +#define IOMMU_MAP_ENTRY_SNOOP 0x4000 /* Snoop */ +#define IOMMU_MAP_ENTRY_TM 0x8000 /* Transient */ + +struct iommu_unit { + struct mtx lock; + int unit; + + int dma_enabled; + + /* Busdma delayed map load */ + struct task dmamap_load_task; + TAILQ_HEAD(, bus_dmamap_iommu) delayed_maps; + struct taskqueue *delayed_taskqueue; +}; + +/* + * Locking annotations: + * (u) - Protected by iommu unit lock + * (d) - Protected by domain lock + * (c) - Immutable after initialization + */ + +struct iommu_domain { + struct iommu_unit *iommu; /* (c) */ + struct mtx lock; /* (c) */ + struct task unload_task; /* (c) */ + u_int entries_cnt; /* (d) */ + struct iommu_map_entries_tailq unload_entries; /* (d) Entries to + unload */ +}; + +struct iommu_ctx { + struct iommu_domain *domain; /* (c) */ + struct bus_dma_tag_iommu *tag; /* (c) Root tag */ + u_long loads; /* atomic updates, for stat only */ + u_long unloads; /* same */ + u_int flags; /* (u) */ +}; + +/* struct iommu_ctx flags */ +#define IOMMU_CTX_FAULTED 0x0001 /* Fault was reported, + last_fault_rec is valid */ +#define IOMMU_CTX_DISABLED 0x0002 /* Device is disabled, the + ephemeral reference is kept + to prevent context destruction */ + +#define IOMMU_LOCK(unit) mtx_lock(&(unit)->lock) +#define IOMMU_UNLOCK(unit) mtx_unlock(&(unit)->lock) +#define IOMMU_ASSERT_LOCKED(unit) mtx_assert(&(unit)->lock, MA_OWNED) + +#define IOMMU_DOMAIN_LOCK(dom) mtx_lock(&(dom)->lock) +#define IOMMU_DOMAIN_UNLOCK(dom) mtx_unlock(&(dom)->lock) +#define IOMMU_DOMAIN_ASSERT_LOCKED(dom) mtx_assert(&(dom)->lock, MA_OWNED) + +static inline bool +iommu_test_boundary(iommu_gaddr_t start, iommu_gaddr_t size, + iommu_gaddr_t boundary) +{ + + if (boundary == 0) + return (true); + return (start + size <= ((start + boundary) & ~(boundary - 1))); +} + +void iommu_free_ctx(struct iommu_ctx *ctx); +void iommu_free_ctx_locked(struct iommu_unit *iommu, struct iommu_ctx *ctx); +struct iommu_ctx *iommu_get_ctx(struct iommu_unit *, device_t dev, + uint16_t rid, bool id_mapped, bool rmrr_init); +struct iommu_unit *iommu_find(device_t dev, bool verbose); +void iommu_domain_unload_entry(struct iommu_map_entry *entry, bool free); +void iommu_domain_unload(struct iommu_domain *domain, + struct iommu_map_entries_tailq *entries, bool cansleep); + +struct iommu_ctx *iommu_instantiate_ctx(struct iommu_unit *iommu, + device_t dev, bool rmrr); +device_t iommu_get_requester(device_t dev, uint16_t *rid); +int iommu_init_busdma(struct iommu_unit *unit); +void iommu_fini_busdma(struct iommu_unit *unit); +struct iommu_map_entry *iommu_map_alloc_entry(struct iommu_domain *iodom, + u_int flags); +void iommu_map_free_entry(struct iommu_domain *, struct iommu_map_entry *); +int iommu_map(struct iommu_domain *iodom, + const struct bus_dma_tag_common *common, iommu_gaddr_t size, int offset, + u_int eflags, u_int flags, vm_page_t *ma, struct iommu_map_entry **res); +int iommu_map_region(struct iommu_domain *domain, + struct iommu_map_entry *entry, u_int eflags, u_int flags, vm_page_t *ma); + +#endif /* !_SYS_IOMMU_H_ */ Modified: head/sys/x86/iommu/intel_dmar.h ============================================================================== --- head/sys/x86/iommu/intel_dmar.h Tue Jul 21 10:38:51 2020 (r363387) +++ head/sys/x86/iommu/intel_dmar.h Tue Jul 21 13:50:10 2020 (r363388) @@ -34,7 +34,7 @@ #ifndef __X86_IOMMU_INTEL_DMAR_H #define __X86_IOMMU_INTEL_DMAR_H -#include +#include struct dmar_unit; From owner-svn-src-all@freebsd.org Tue Jul 21 13:56:05 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 57C0D35D38B for ; Tue, 21 Jul 2020 13:56:05 +0000 (UTC) (envelope-from freebsd-listen@fabiankeil.de) Received: from smtprelay02.ispgateway.de (smtprelay02.ispgateway.de [80.67.29.24]) (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 4BB0Vr2ByCz4fkQ; Tue, 21 Jul 2020 13:56:04 +0000 (UTC) (envelope-from freebsd-listen@fabiankeil.de) Received: from [84.168.159.83] (helo=fabiankeil.de) by smtprelay02.ispgateway.de with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92.3) (envelope-from ) id 1jxskT-0002qr-Mt; Tue, 21 Jul 2020 15:56:01 +0200 Date: Tue, 21 Jul 2020 15:54:19 +0200 From: Fabian Keil To: Gordon Bergling Cc: svn-src-all@freebsd.org Subject: Re: svn commit: r363363 - head/lib/geom/eli Message-ID: <20200721155419.4b127dac@fabiankeil.de> In-Reply-To: <202007201324.06KDOoti077929@repo.freebsd.org> References: <202007201324.06KDOoti077929@repo.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; boundary="Sig_/uufDM63fUR4rYn8w78y2gF4"; protocol="application/pgp-signature" X-Df-Sender: Nzc1MDY3 X-Rspamd-Queue-Id: 4BB0Vr2ByCz4fkQ X-Spamd-Bar: + Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=none (mx1.freebsd.org: domain of freebsd-listen@fabiankeil.de has no SPF policy when checking 80.67.29.24) smtp.mailfrom=freebsd-listen@fabiankeil.de X-Spamd-Result: default: False [1.06 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; ARC_NA(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_SPAM_SHORT(0.06)[0.059]; MIME_GOOD(-0.20)[multipart/signed,text/plain]; DMARC_NA(0.00)[fabiankeil.de]; AUTH_NA(1.00)[]; RWL_MAILSPIKE_GOOD(0.00)[80.67.29.24:from]; RECEIVED_SPAMHAUS_PBL(0.00)[84.168.159.83:received]; NEURAL_HAM_MEDIUM(-0.06)[-0.059]; RCPT_COUNT_TWO(0.00)[2]; NEURAL_SPAM_LONG(0.36)[0.358]; R_SPF_NA(0.00)[no SPF record]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; ASN(0.00)[asn:8972, ipnet:80.67.16.0/20, country:DE]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[]; RCVD_IN_DNSWL_LOW(-0.10)[80.67.29.24:from] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 21 Jul 2020 13:56:05 -0000 --Sig_/uufDM63fUR4rYn8w78y2gF4 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Gordon Bergling wrote: > Author: gbe (doc committer) > Date: Mon Jul 20 13:24:50 2020 > New Revision: 363363 > URL: https://svnweb.freebsd.org/changeset/base/363363 >=20 > Log: > geli(8): Add an example on how to use geli(8) with a file as encrypted = storage > =20 > Reviewed by: bcr (mentor) > Approved by: bcr (mentor) > MFC after: 1 week > Differential Revision: https://reviews.freebsd.org/D25741 >=20 > Modified: > head/lib/geom/eli/geli.8 >=20 > Modified: head/lib/geom/eli/geli.8 > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=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/lib/geom/eli/geli.8 Mon Jul 20 13:01:19 2020 (r363362) > +++ head/lib/geom/eli/geli.8 Mon Jul 20 13:24:50 2020 (r363363) [...] > +This key should be protected by a passphrase, which > +is requested when geli init is called. > +.Bd -literal -offset indent > +# dd if=3D/dev/random of=3D/root/private0.key bs=3D64 count=3D1 > +# geli init -K /root/private0.key -s 4096 /dev/md0 > +Enter new passphrase: > +Reenter new passphrase: > +# dd if=3D/dev/random of=3D/dev/md0.eli bs=3D1m There seems to be a "geli attach ..." missing after the "geli init ...". > +The call of geli attach will ask for the passphrase. > +It is recommended to do this procedure after the boot, because otherwise > +the boot process would be waiting for the passphrase input. > +.Bd -literal -offset indent > +# geli attach -k /root/private0.key /dev/md0 > +Enter new passphrase: The expected prompt is just "Enter passphrase:". Fabian --Sig_/uufDM63fUR4rYn8w78y2gF4 Content-Type: application/pgp-signature Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- iF0EARECAB0WIQTKUNd6H/m3+ByGULIFiohV/3dUnQUCXxbziwAKCRAFiohV/3dU nX21AKCtcqIlDd+eoKykOE48V4aWcSh2XgCfW2D1KZwA5o0goGZelVuysOlcTtI= =ybAY -----END PGP SIGNATURE----- --Sig_/uufDM63fUR4rYn8w78y2gF4-- From owner-svn-src-all@freebsd.org Tue Jul 21 14:17:37 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7C55035DD1C; Tue, 21 Jul 2020 14:17:37 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BB0zj2hPVz3S1q; Tue, 21 Jul 2020 14:17:37 +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 407AE1F4CC; Tue, 21 Jul 2020 14:17:37 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06LEHbKX005472; Tue, 21 Jul 2020 14:17:37 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06LEHZtv005464; Tue, 21 Jul 2020 14:17:35 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202007211417.06LEHZtv005464@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 21 Jul 2020 14:17:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r363389 - in stable/12/sys: amd64/amd64 i386/i386 mips/mips powerpc/aim powerpc/booke X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in stable/12/sys: amd64/amd64 i386/i386 mips/mips powerpc/aim powerpc/booke X-SVN-Commit-Revision: 363389 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 21 Jul 2020 14:17:37 -0000 Author: markj Date: Tue Jul 21 14:17:35 2020 New Revision: 363389 URL: https://svnweb.freebsd.org/changeset/base/363389 Log: MFC r363266 (by cem): Revert r240317 to prevent leaking pmap entries Modified: stable/12/sys/amd64/amd64/pmap.c stable/12/sys/i386/i386/pmap.c stable/12/sys/mips/mips/pmap.c stable/12/sys/powerpc/aim/mmu_oea.c stable/12/sys/powerpc/aim/mmu_oea64.c stable/12/sys/powerpc/booke/pmap.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/amd64/amd64/pmap.c ============================================================================== --- stable/12/sys/amd64/amd64/pmap.c Tue Jul 21 13:50:10 2020 (r363388) +++ stable/12/sys/amd64/amd64/pmap.c Tue Jul 21 14:17:35 2020 (r363389) @@ -7991,8 +7991,10 @@ pmap_unmapdev(vm_offset_t va, vm_size_t size) return; } } - if (pmap_initialized) + if (pmap_initialized) { + pmap_qremove(va, atop(size)); kva_free(va, size); + } } /* Modified: stable/12/sys/i386/i386/pmap.c ============================================================================== --- stable/12/sys/i386/i386/pmap.c Tue Jul 21 13:50:10 2020 (r363388) +++ stable/12/sys/i386/i386/pmap.c Tue Jul 21 14:17:35 2020 (r363389) @@ -5600,8 +5600,10 @@ pmap_unmapdev(vm_offset_t va, vm_size_t size) return; } } - if (pmap_initialized) + if (pmap_initialized) { + pmap_qremove(va, atop(size)); kva_free(va, size); + } } /* Modified: stable/12/sys/mips/mips/pmap.c ============================================================================== --- stable/12/sys/mips/mips/pmap.c Tue Jul 21 13:50:10 2020 (r363388) +++ stable/12/sys/mips/mips/pmap.c Tue Jul 21 14:17:35 2020 (r363389) @@ -3276,6 +3276,7 @@ pmap_unmapdev(vm_offset_t va, vm_size_t size) base = trunc_page(va); offset = va & PAGE_MASK; size = roundup(size + offset, PAGE_SIZE); + pmap_qremove(base, atop(size)); kva_free(base, size); #endif } Modified: stable/12/sys/powerpc/aim/mmu_oea.c ============================================================================== --- stable/12/sys/powerpc/aim/mmu_oea.c Tue Jul 21 13:50:10 2020 (r363388) +++ stable/12/sys/powerpc/aim/mmu_oea.c Tue Jul 21 14:17:35 2020 (r363389) @@ -2682,6 +2682,7 @@ moea_unmapdev(mmu_t mmu, vm_offset_t va, vm_size_t siz base = trunc_page(va); offset = va & PAGE_MASK; size = roundup(offset + size, PAGE_SIZE); + moea_qremove(base, atop(size)); kva_free(base, size); } } Modified: stable/12/sys/powerpc/aim/mmu_oea64.c ============================================================================== --- stable/12/sys/powerpc/aim/mmu_oea64.c Tue Jul 21 13:50:10 2020 (r363388) +++ stable/12/sys/powerpc/aim/mmu_oea64.c Tue Jul 21 14:17:35 2020 (r363389) @@ -2794,6 +2794,7 @@ moea64_unmapdev(mmu_t mmu, vm_offset_t va, vm_size_t s offset = va & PAGE_MASK; size = roundup2(offset + size, PAGE_SIZE); + moea64_qremove(base, atop(size)); kva_free(base, size); } Modified: stable/12/sys/powerpc/booke/pmap.c ============================================================================== --- stable/12/sys/powerpc/booke/pmap.c Tue Jul 21 13:50:10 2020 (r363388) +++ stable/12/sys/powerpc/booke/pmap.c Tue Jul 21 14:17:35 2020 (r363389) @@ -3686,6 +3686,7 @@ mmu_booke_unmapdev(mmu_t mmu, vm_offset_t va, vm_size_ base = trunc_page(va); offset = va & PAGE_MASK; size = roundup(offset + size, PAGE_SIZE); + mmu_booke_qremove(base, atop(size)); kva_free(base, size); } #endif From owner-svn-src-all@freebsd.org Tue Jul 21 14:25:37 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 089B335E316; Tue, 21 Jul 2020 14:25:37 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BB18w6Srxz3St6; Tue, 21 Jul 2020 14:25:36 +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 C18851F6D2; Tue, 21 Jul 2020 14:25:36 +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 06LEPaBZ011624; Tue, 21 Jul 2020 14:25:36 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06LEPaSR011623; Tue, 21 Jul 2020 14:25:36 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <202007211425.06LEPaSR011623@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Tue, 21 Jul 2020 14:25:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363390 - head/sys/dev/virtio/mmio X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: head/sys/dev/virtio/mmio X-SVN-Commit-Revision: 363390 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 21 Jul 2020 14:25:37 -0000 Author: andrew Date: Tue Jul 21 14:25:36 2020 New Revision: 363390 URL: https://svnweb.freebsd.org/changeset/base/363390 Log: Only write to VIRTIO_MMIO_GUEST_PAGE_SIZE with virtio mmio version 1 This register is only defined for the legacy v1 interface so only write to it when interacting with a legacy device. Sponsored by: Innovate UK Modified: head/sys/dev/virtio/mmio/virtio_mmio.c Modified: head/sys/dev/virtio/mmio/virtio_mmio.c ============================================================================== --- head/sys/dev/virtio/mmio/virtio_mmio.c Tue Jul 21 14:17:35 2020 (r363389) +++ head/sys/dev/virtio/mmio/virtio_mmio.c Tue Jul 21 14:25:36 2020 (r363390) @@ -491,8 +491,10 @@ vtmmio_alloc_virtqueues(device_t dev, int flags, int n if (sc->vtmmio_vqs == NULL) return (ENOMEM); - vtmmio_write_config_4(sc, VIRTIO_MMIO_GUEST_PAGE_SIZE, - (1 << PAGE_SHIFT)); + if (sc->vtmmio_version == 1) { + vtmmio_write_config_4(sc, VIRTIO_MMIO_GUEST_PAGE_SIZE, + (1 << PAGE_SHIFT)); + } for (idx = 0; idx < nvqs; idx++) { vqx = &sc->vtmmio_vqs[idx]; @@ -564,8 +566,10 @@ vtmmio_reinit(device_t dev, uint64_t features) vtmmio_negotiate_features(dev, features); - vtmmio_write_config_4(sc, VIRTIO_MMIO_GUEST_PAGE_SIZE, - (1 << PAGE_SHIFT)); + if (sc->vtmmio_version == 1) { + vtmmio_write_config_4(sc, VIRTIO_MMIO_GUEST_PAGE_SIZE, + (1 << PAGE_SHIFT)); + } for (idx = 0; idx < sc->vtmmio_nvqs; idx++) { error = vtmmio_reinit_virtqueue(sc, idx); From owner-svn-src-all@freebsd.org Tue Jul 21 14:35:51 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 39DDE35E4B4; Tue, 21 Jul 2020 14:35:51 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BB1Nl0pSwz3TNW; Tue, 21 Jul 2020 14:35:51 +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 F30381FC38; Tue, 21 Jul 2020 14:35:50 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06LEZomq018210; Tue, 21 Jul 2020 14:35:50 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06LEZopm018207; Tue, 21 Jul 2020 14:35:50 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202007211435.06LEZopm018207@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 21 Jul 2020 14:35:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r363391 - stable/12/sys/powerpc/aim X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/12/sys/powerpc/aim X-SVN-Commit-Revision: 363391 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 21 Jul 2020 14:35:51 -0000 Author: markj Date: Tue Jul 21 14:35:50 2020 New Revision: 363391 URL: https://svnweb.freebsd.org/changeset/base/363391 Log: Fix the powerpc build after r363389. This is a direct commit to stable/12. Reported by: Jenkins Modified: stable/12/sys/powerpc/aim/mmu_oea.c stable/12/sys/powerpc/aim/mmu_oea64.c Modified: stable/12/sys/powerpc/aim/mmu_oea.c ============================================================================== --- stable/12/sys/powerpc/aim/mmu_oea.c Tue Jul 21 14:25:36 2020 (r363390) +++ stable/12/sys/powerpc/aim/mmu_oea.c Tue Jul 21 14:35:50 2020 (r363391) @@ -2682,7 +2682,7 @@ moea_unmapdev(mmu_t mmu, vm_offset_t va, vm_size_t siz base = trunc_page(va); offset = va & PAGE_MASK; size = roundup(offset + size, PAGE_SIZE); - moea_qremove(base, atop(size)); + moea_qremove(mmu, base, atop(size)); kva_free(base, size); } } Modified: stable/12/sys/powerpc/aim/mmu_oea64.c ============================================================================== --- stable/12/sys/powerpc/aim/mmu_oea64.c Tue Jul 21 14:25:36 2020 (r363390) +++ stable/12/sys/powerpc/aim/mmu_oea64.c Tue Jul 21 14:35:50 2020 (r363391) @@ -2794,7 +2794,7 @@ moea64_unmapdev(mmu_t mmu, vm_offset_t va, vm_size_t s offset = va & PAGE_MASK; size = roundup2(offset + size, PAGE_SIZE); - moea64_qremove(base, atop(size)); + moea64_qremove(mmu, base, atop(size)); kva_free(base, size); } From owner-svn-src-all@freebsd.org Tue Jul 21 14:39:21 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 155AD35E6FA; Tue, 21 Jul 2020 14:39:21 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BB1Sm6qtLz3TkN; Tue, 21 Jul 2020 14:39:20 +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 CDA681FD81; Tue, 21 Jul 2020 14:39:20 +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 06LEdK5R018836; Tue, 21 Jul 2020 14:39:20 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06LEdK3f018834; Tue, 21 Jul 2020 14:39:20 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202007211439.06LEdK3f018834@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Tue, 21 Jul 2020 14:39:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363392 - 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: 363392 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 21 Jul 2020 14:39:21 -0000 Author: mjg Date: Tue Jul 21 14:39:20 2020 New Revision: 363392 URL: https://svnweb.freebsd.org/changeset/base/363392 Log: lockmgr: add a helper for reading the lock value Modified: head/sys/kern/kern_lock.c head/sys/sys/lockmgr.h Modified: head/sys/kern/kern_lock.c ============================================================================== --- head/sys/kern/kern_lock.c Tue Jul 21 14:35:50 2020 (r363391) +++ head/sys/kern/kern_lock.c Tue Jul 21 14:39:20 2020 (r363392) @@ -140,7 +140,7 @@ LK_CAN_SHARE(uintptr_t x, int flags, bool fp) #define lockmgr_xlocked_v(v) \ (((v) & ~(LK_FLAGMASK & ~LK_SHARE)) == (uintptr_t)curthread) -#define lockmgr_xlocked(lk) lockmgr_xlocked_v((lk)->lk_lock) +#define lockmgr_xlocked(lk) lockmgr_xlocked_v(lockmgr_read_value(lk)) static void assert_lockmgr(const struct lock_object *lock, int how); #ifdef DDB @@ -233,7 +233,7 @@ static void lockmgr_note_exclusive_release(struct lock *lk, const char *file, int line) { - if (LK_HOLDER(lk->lk_lock) != LK_KERNPROC) { + if (LK_HOLDER(lockmgr_read_value(lk)) != LK_KERNPROC) { WITNESS_UNLOCK(&lk->lock_object, LOP_EXCLUSIVE, file, line); TD_LOCKS_DEC(curthread); } @@ -246,7 +246,7 @@ lockmgr_xholder(const struct lock *lk) { uintptr_t x; - x = lk->lk_lock; + x = lockmgr_read_value(lk); return ((x & LK_SHARE) ? NULL : (struct thread *)LK_HOLDER(x)); } @@ -309,7 +309,7 @@ wakeupshlk(struct lock *lk, const char *file, int line wakeup_swapper = 0; for (;;) { - x = lk->lk_lock; + x = lockmgr_read_value(lk); if (lockmgr_sunlock_try(lk, &x)) break; @@ -318,7 +318,7 @@ wakeupshlk(struct lock *lk, const char *file, int line * path in order to handle wakeups correctly. */ sleepq_lock(&lk->lock_object); - orig_x = lk->lk_lock; + orig_x = lockmgr_read_value(lk); retry_sleepq: x = orig_x & (LK_ALL_WAITERS | LK_EXCLUSIVE_SPINNERS); v = LK_UNLOCKED; @@ -515,7 +515,7 @@ lockmgr_slock_try(struct lock *lk, uintptr_t *xp, int * waiters, if we fail to acquire the shared lock * loop back and retry. */ - *xp = lk->lk_lock; + *xp = lockmgr_read_value(lk); while (LK_CAN_SHARE(*xp, flags, fp)) { if (atomic_fcmpset_acq_ptr(&lk->lk_lock, xp, *xp + LK_ONE_SHARER)) { @@ -603,7 +603,7 @@ lockmgr_slock_hard(struct lock *lk, u_int flags, struc * probabilly will need to manipulate waiters flags. */ sleepq_lock(&lk->lock_object); - x = lk->lk_lock; + x = lockmgr_read_value(lk); retry_sleepq: /* @@ -772,7 +772,7 @@ lockmgr_xlock_hard(struct lock *lk, u_int flags, struc * probabilly will need to manipulate waiters flags. */ sleepq_lock(&lk->lock_object); - x = lk->lk_lock; + x = lockmgr_read_value(lk); retry_sleepq: /* @@ -889,7 +889,7 @@ lockmgr_upgrade(struct lock *lk, u_int flags, struct l tid = (uintptr_t)curthread; _lockmgr_assert(lk, KA_SLOCKED, file, line); - v = lk->lk_lock; + v = lockmgr_read_value(lk); x = v & LK_ALL_WAITERS; v &= LK_EXCLUSIVE_SPINNERS; @@ -970,7 +970,7 @@ lockmgr_lock_flags(struct lock *lk, u_int flags, struc LOP_EXCLUSIVE, file, line, flags & LK_INTERLOCK ? ilk : NULL); tid = (uintptr_t)curthread; - if (lk->lk_lock == LK_UNLOCKED && + if (lockmgr_read_value(lk) == LK_UNLOCKED && atomic_cmpset_acq_ptr(&lk->lk_lock, LK_UNLOCKED, tid)) { lockmgr_note_exclusive_acquire(lk, 0, 0, file, line, flags); @@ -1054,7 +1054,7 @@ lockmgr_xunlock_hard(struct lock *lk, uintptr_t x, u_i goto out; sleepq_lock(&lk->lock_object); - x = lk->lk_lock; + x = lockmgr_read_value(lk); v = LK_UNLOCKED; /* @@ -1178,7 +1178,7 @@ lockmgr_unlock(struct lock *lk) line = __LINE__; _lockmgr_assert(lk, KA_LOCKED, file, line); - x = lk->lk_lock; + x = lockmgr_read_value(lk); if (__predict_true(x & LK_SHARE) != 0) { lockmgr_note_shared_release(lk, file, line); if (lockmgr_sunlock_try(lk, &x)) { @@ -1292,7 +1292,7 @@ __lockmgr_args(struct lock *lk, u_int flags, struct lo * In order to preserve waiters flags, just spin. */ for (;;) { - x = lk->lk_lock; + x = lockmgr_read_value(lk); MPASS((x & LK_EXCLUSIVE_SPINNERS) == 0); x &= LK_ALL_WAITERS; if (atomic_cmpset_rel_ptr(&lk->lk_lock, tid | x, @@ -1305,7 +1305,7 @@ __lockmgr_args(struct lock *lk, u_int flags, struct lo break; case LK_RELEASE: _lockmgr_assert(lk, KA_LOCKED, file, line); - x = lk->lk_lock; + x = lockmgr_read_value(lk); if (__predict_true(x & LK_SHARE) != 0) { lockmgr_note_shared_release(lk, file, line); @@ -1359,7 +1359,7 @@ __lockmgr_args(struct lock *lk, u_int flags, struct lo * probabilly will need to manipulate waiters flags. */ sleepq_lock(&lk->lock_object); - x = lk->lk_lock; + x = lockmgr_read_value(lk); /* * if the lock has been released while we spun on @@ -1545,7 +1545,7 @@ _lockmgr_disown(struct lock *lk, const char *file, int * In order to preserve waiters flags, just spin. */ for (;;) { - x = lk->lk_lock; + x = lockmgr_read_value(lk); MPASS((x & LK_EXCLUSIVE_SPINNERS) == 0); x &= LK_ALL_WAITERS; if (atomic_cmpset_rel_ptr(&lk->lk_lock, tid | x, @@ -1597,7 +1597,7 @@ lockstatus(const struct lock *lk) int ret; ret = LK_SHARED; - x = lk->lk_lock; + x = lockmgr_read_value(lk); v = LK_HOLDER(x); if ((x & LK_SHARE) == 0) { Modified: head/sys/sys/lockmgr.h ============================================================================== --- head/sys/sys/lockmgr.h Tue Jul 21 14:35:50 2020 (r363391) +++ head/sys/sys/lockmgr.h Tue Jul 21 14:39:20 2020 (r363392) @@ -119,6 +119,7 @@ _lockmgr_args_rw(struct lock *lk, u_int flags, struct /* * Define aliases in order to complete lockmgr KPI. */ +#define lockmgr_read_value(lk) ((lk)->lk_lock) #define lockmgr(lk, flags, ilk) \ _lockmgr_args((lk), (flags), (ilk), LK_WMESG_DEFAULT, \ LK_PRIO_DEFAULT, LK_TIMO_DEFAULT, LOCK_FILE, LOCK_LINE) From owner-svn-src-all@freebsd.org Tue Jul 21 14:41:25 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id EAC8035E44F; Tue, 21 Jul 2020 14:41:25 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BB1W95tDQz3TcD; Tue, 21 Jul 2020 14:41:25 +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 AE2271FD98; Tue, 21 Jul 2020 14:41:25 +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 06LEfPYI021999; Tue, 21 Jul 2020 14:41:25 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06LEfPA9021998; Tue, 21 Jul 2020 14:41:25 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202007211441.06LEfPA9021998@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Tue, 21 Jul 2020 14:41:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363393 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 363393 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 21 Jul 2020 14:41:26 -0000 Author: mjg Date: Tue Jul 21 14:41:25 2020 New Revision: 363393 URL: https://svnweb.freebsd.org/changeset/base/363393 Log: lockmgr: rewrite upgrade to stop always dropping the lock This matches rw and sx locks. Modified: head/sys/kern/kern_lock.c Modified: head/sys/kern/kern_lock.c ============================================================================== --- head/sys/kern/kern_lock.c Tue Jul 21 14:39:20 2020 (r363392) +++ head/sys/kern/kern_lock.c Tue Jul 21 14:41:25 2020 (r363393) @@ -878,9 +878,8 @@ static __noinline int lockmgr_upgrade(struct lock *lk, u_int flags, struct lock_object *ilk, const char *file, int line, struct lockmgr_wait *lwa) { - uintptr_t tid, x, v; + uintptr_t tid, v, setv; int error = 0; - int wakeup_swapper = 0; int op; if (KERNEL_PANICKED()) @@ -889,48 +888,47 @@ lockmgr_upgrade(struct lock *lk, u_int flags, struct l tid = (uintptr_t)curthread; _lockmgr_assert(lk, KA_SLOCKED, file, line); - v = lockmgr_read_value(lk); - x = v & LK_ALL_WAITERS; - v &= LK_EXCLUSIVE_SPINNERS; - /* - * Try to switch from one shared lock to an exclusive one. - * We need to preserve waiters flags during the operation. - */ - if (atomic_cmpset_ptr(&lk->lk_lock, LK_SHARERS_LOCK(1) | x | v, - tid | x)) { - LOCK_LOG_LOCK("XUPGRADE", &lk->lock_object, 0, 0, file, - line); - WITNESS_UPGRADE(&lk->lock_object, LOP_EXCLUSIVE | - LK_TRYWIT(flags), file, line); - LOCKSTAT_RECORD0(lockmgr__upgrade, lk); - TD_SLOCKS_DEC(curthread); - goto out; - } - op = flags & LK_TYPE_MASK; + v = lockmgr_read_value(lk); + for (;;) { + if (LK_SHARERS_LOCK(v) > 1) { + if (op == LK_TRYUPGRADE) { + LOCK_LOG2(lk, "%s: %p failed the nowait upgrade", + __func__, lk); + error = EBUSY; + goto out; + } + if (lockmgr_sunlock_try(lk, &v)) { + lockmgr_note_shared_release(lk, file, line); + goto out_xlock; + } + } + MPASS((v & ~LK_ALL_WAITERS) == LK_SHARERS_LOCK(1)); - /* - * In LK_TRYUPGRADE mode, do not drop the lock, - * returning EBUSY instead. - */ - if (op == LK_TRYUPGRADE) { - LOCK_LOG2(lk, "%s: %p failed the nowait upgrade", - __func__, lk); - error = EBUSY; - goto out; + setv = tid; + setv |= (v & LK_ALL_WAITERS); + + /* + * Try to switch from one shared lock to an exclusive one. + * We need to preserve waiters flags during the operation. + */ + if (atomic_fcmpset_ptr(&lk->lk_lock, &v, setv)) { + LOCK_LOG_LOCK("XUPGRADE", &lk->lock_object, 0, 0, file, + line); + WITNESS_UPGRADE(&lk->lock_object, LOP_EXCLUSIVE | + LK_TRYWIT(flags), file, line); + LOCKSTAT_RECORD0(lockmgr__upgrade, lk); + TD_SLOCKS_DEC(curthread); + goto out; + } } - /* - * We have been unable to succeed in upgrading, so just - * give up the shared lock. - */ - lockmgr_note_shared_release(lk, file, line); - wakeup_swapper |= wakeupshlk(lk, file, line); +out_xlock: error = lockmgr_xlock_hard(lk, flags, ilk, file, line, lwa); flags &= ~LK_INTERLOCK; out: - lockmgr_exit(flags, ilk, wakeup_swapper); + lockmgr_exit(flags, ilk, 0); return (error); } From owner-svn-src-all@freebsd.org Tue Jul 21 14:42:23 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1683735EB97; Tue, 21 Jul 2020 14:42:23 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BB1XG6tPfz3V7j; Tue, 21 Jul 2020 14:42:22 +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 CFBAD1FBFD; Tue, 21 Jul 2020 14:42:22 +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 06LEgMLx024704; Tue, 21 Jul 2020 14:42:22 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06LEgM0R024701; Tue, 21 Jul 2020 14:42:22 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202007211442.06LEgM0R024701@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Tue, 21 Jul 2020 14:42:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363394 - 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: 363394 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 21 Jul 2020 14:42:23 -0000 Author: mjg Date: Tue Jul 21 14:42:22 2020 New Revision: 363394 URL: https://svnweb.freebsd.org/changeset/base/363394 Log: lockmgr: denote recursion with a bit in lock value This reduces excessive reads from the lock. Tested by: pho Modified: head/sys/kern/kern_lock.c head/sys/sys/lockmgr.h Modified: head/sys/kern/kern_lock.c ============================================================================== --- head/sys/kern/kern_lock.c Tue Jul 21 14:41:25 2020 (r363393) +++ head/sys/kern/kern_lock.c Tue Jul 21 14:42:22 2020 (r363394) @@ -736,6 +736,7 @@ lockmgr_xlock_hard(struct lock *lk, u_int flags, struc panic("%s: recursing on non recursive lockmgr %p " "@ %s:%d\n", __func__, lk, file, line); } + atomic_set_ptr(&lk->lk_lock, LK_WRITER_RECURSED); lk->lk_recurse++; LOCK_LOG2(lk, "%s: %p recursing", __func__, lk); LOCK_LOG_LOCK("XLOCK", &lk->lock_object, 0, @@ -1039,9 +1040,11 @@ lockmgr_xunlock_hard(struct lock *lk, uintptr_t x, u_i * The lock is held in exclusive mode. * If the lock is recursed also, then unrecurse it. */ - if (lockmgr_xlocked_v(x) && lockmgr_recursed(lk)) { + if (lockmgr_recursed_v(x)) { LOCK_LOG2(lk, "%s: %p unrecursing", __func__, lk); lk->lk_recurse--; + if (lk->lk_recurse == 0) + atomic_clear_ptr(&lk->lk_lock, LK_WRITER_RECURSED); goto out; } if (tid != LK_KERNPROC) @@ -1187,9 +1190,8 @@ lockmgr_unlock(struct lock *lk) } else { tid = (uintptr_t)curthread; lockmgr_note_exclusive_release(lk, file, line); - if (!lockmgr_recursed(lk) && - atomic_cmpset_rel_ptr(&lk->lk_lock, tid, LK_UNLOCKED)) { - LOCKSTAT_PROFILE_RELEASE_RWLOCK(lockmgr__release, lk, LOCKSTAT_WRITER); + if (x == tid && atomic_cmpset_rel_ptr(&lk->lk_lock, tid, LK_UNLOCKED)) { + LOCKSTAT_PROFILE_RELEASE_RWLOCK(lockmgr__release, lk,LOCKSTAT_WRITER); } else { return (lockmgr_xunlock_hard(lk, x, LK_RELEASE, NULL, file, line)); } Modified: head/sys/sys/lockmgr.h ============================================================================== --- head/sys/sys/lockmgr.h Tue Jul 21 14:41:25 2020 (r363393) +++ head/sys/sys/lockmgr.h Tue Jul 21 14:42:22 2020 (r363394) @@ -42,13 +42,14 @@ #define LK_SHARED_WAITERS 0x02 #define LK_EXCLUSIVE_WAITERS 0x04 #define LK_EXCLUSIVE_SPINNERS 0x08 +#define LK_WRITER_RECURSED 0x10 #define LK_ALL_WAITERS \ (LK_SHARED_WAITERS | LK_EXCLUSIVE_WAITERS) #define LK_FLAGMASK \ - (LK_SHARE | LK_ALL_WAITERS | LK_EXCLUSIVE_SPINNERS) + (LK_SHARE | LK_ALL_WAITERS | LK_EXCLUSIVE_SPINNERS | LK_WRITER_RECURSED) #define LK_HOLDER(x) ((x) & ~LK_FLAGMASK) -#define LK_SHARERS_SHIFT 4 +#define LK_SHARERS_SHIFT 5 #define LK_SHARERS(x) (LK_HOLDER(x) >> LK_SHARERS_SHIFT) #define LK_SHARERS_LOCK(x) ((x) << LK_SHARERS_SHIFT | LK_SHARE) #define LK_ONE_SHARER (1 << LK_SHARERS_SHIFT) @@ -131,8 +132,10 @@ _lockmgr_args_rw(struct lock *lk, u_int flags, struct LOCK_FILE, LOCK_LINE) #define lockmgr_disown(lk) \ _lockmgr_disown((lk), LOCK_FILE, LOCK_LINE) +#define lockmgr_recursed_v(v) \ + (v & LK_WRITER_RECURSED) #define lockmgr_recursed(lk) \ - ((lk)->lk_recurse != 0) + lockmgr_recursed_v((lk)->lk_lock) #define lockmgr_rw(lk, flags, ilk) \ _lockmgr_args_rw((lk), (flags), (ilk), LK_WMESG_DEFAULT, \ LK_PRIO_DEFAULT, LK_TIMO_DEFAULT, LOCK_FILE, LOCK_LINE) From owner-svn-src-all@freebsd.org Tue Jul 21 15:03:37 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1075835EEF1; Tue, 21 Jul 2020 15:03:37 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BB20m6V5vz3W9w; Tue, 21 Jul 2020 15:03:36 +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 C221E20295; Tue, 21 Jul 2020 15:03:36 +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 06LF3aoT036947; Tue, 21 Jul 2020 15:03:36 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06LF3aYK036946; Tue, 21 Jul 2020 15:03:36 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202007211503.06LF3aYK036946@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 21 Jul 2020 15:03:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363395 - head/usr.sbin/traceroute6 X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/usr.sbin/traceroute6 X-SVN-Commit-Revision: 363395 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 21 Jul 2020 15:03:37 -0000 Author: markj Date: Tue Jul 21 15:03:36 2020 New Revision: 363395 URL: https://svnweb.freebsd.org/changeset/base/363395 Log: traceroute6: Fix most warnings at the default WARNS level. Fix some style issues as well. Leave -Wno-cast-aligned set for now, as most of the warnings come casts of CMSG_DATA(), which does provide sufficient alignment in practice. Submitted by: Shubh Gupta Sponsored by: Google (GSOC 2020) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D25603 Modified: head/usr.sbin/traceroute6/Makefile head/usr.sbin/traceroute6/traceroute6.c Modified: head/usr.sbin/traceroute6/Makefile ============================================================================== --- head/usr.sbin/traceroute6/Makefile Tue Jul 21 14:42:22 2020 (r363394) +++ head/usr.sbin/traceroute6/Makefile Tue Jul 21 15:03:36 2020 (r363395) @@ -26,8 +26,8 @@ BINMODE= 4555 CFLAGS+= -DIPSEC -DHAVE_POLL CFLAGS+= -I${.CURDIR} -I${TRACEROUTE_DISTDIR} -I. -WARNS?= 3 - LIBADD= ipsec .include + +CWARNFLAGS+= -Wno-cast-align Modified: head/usr.sbin/traceroute6/traceroute6.c ============================================================================== --- head/usr.sbin/traceroute6/traceroute6.c Tue Jul 21 14:42:22 2020 (r363394) +++ head/usr.sbin/traceroute6/traceroute6.c Tue Jul 21 15:03:36 2020 (r363395) @@ -294,16 +294,14 @@ static const char rcsid[] = #define freehostent(x) #endif -u_char packet[512]; /* last inbound (icmp) packet */ -char *outpacket; /* last output packet */ +static u_char packet[512]; /* last inbound (icmp) packet */ +static char *outpacket; /* last output packet */ int main(int, char *[]); int wait_for_reply(int, struct msghdr *); -#ifdef IPSEC -#ifdef IPSEC_POLICY_IPSEC +#if defined(IPSEC) && defined(IPSEC_POLICY_IPSEC) int setpolicy(int so, char *policy); #endif -#endif void send_probe(int, u_long); void *get_uphdr(struct ip6_hdr *, u_char *); int get_hoplim(struct msghdr *); @@ -318,40 +316,40 @@ u_int16_t tcp_chksum(struct sockaddr_in6 *, struct soc void *, u_int32_t); void usage(void); -int rcvsock; /* receive (icmp) socket file descriptor */ -int sndsock; /* send (raw/udp) socket file descriptor */ +static int rcvsock; /* receive (icmp) socket file descriptor */ +static int sndsock; /* send (raw/udp) socket file descriptor */ -struct msghdr rcvmhdr; -struct iovec rcviov[2]; -int rcvhlim; -struct in6_pktinfo *rcvpktinfo; +static struct msghdr rcvmhdr; +static struct iovec rcviov[2]; +static int rcvhlim; +static struct in6_pktinfo *rcvpktinfo; -struct sockaddr_in6 Src, Dst, Rcv; -u_long datalen = 20; /* How much data */ +static struct sockaddr_in6 Src, Dst, Rcv; +static u_long datalen = 20; /* How much data */ #define ICMP6ECHOLEN 8 /* XXX: 2064 = 127(max hops in type 0 rthdr) * sizeof(ip6_hdr) + 16(margin) */ -char rtbuf[2064]; -struct ip6_rthdr *rth; -struct cmsghdr *cmsg; +static char rtbuf[2064]; +static struct ip6_rthdr *rth; +static struct cmsghdr *cmsg; -char *source = NULL; -char *hostname; +static char *source = NULL; +static char *hostname; -u_long nprobes = 3; -u_long first_hop = 1; -u_long max_hops = 30; -u_int16_t srcport; -u_int16_t port = 32768+666; /* start udp dest port # for probe packets */ -u_int16_t ident; -int options; /* socket options */ -int verbose; -int waittime = 5; /* time to wait for response (in seconds) */ -int nflag; /* print addresses numerically */ -int useproto = IPPROTO_UDP; /* protocol to use to send packet */ -int lflag; /* print both numerical address & hostname */ -int as_path; /* print as numbers for each hop */ -char *as_server = NULL; -void *asn; +static u_long nprobes = 3; +static u_long first_hop = 1; +static u_long max_hops = 30; +static u_int16_t srcport; +static u_int16_t port = 32768+666; /* start udp dest port # for probe packets */ +static u_int16_t ident; +static int options; /* socket options */ +static int verbose; +static int waittime = 5; /* time to wait for response (in seconds) */ +static int nflag; /* print addresses numerically */ +static int useproto = IPPROTO_UDP; /* protocol to use to send packet */ +static int lflag; /* print both numerical address & hostname */ +static int as_path; /* print as numbers for each hop */ +static char *as_server = NULL; +static void *asn; int main(int argc, char *argv[]) @@ -366,6 +364,10 @@ main(int argc, char *argv[]) size_t size, minlen; uid_t uid; u_char type, code; +#if defined(IPSEC) && defined(IPSEC_POLICY_IPSEC) + char ipsec_inpolicy[] = "in bypass"; + char ipsec_outpolicy[] = "out bypass"; +#endif /* * Receive ICMP @@ -628,7 +630,7 @@ main(int argc, char *argv[]) fprintf(stderr, "traceroute6: Warning: %s has multiple " "addresses; using %s\n", hostname, hbuf); } - + freeaddrinfo(res); if (*++argv) { ep = NULL; errno = 0; @@ -705,15 +707,14 @@ main(int argc, char *argv[]) if (options & SO_DONTROUTE) (void) setsockopt(rcvsock, SOL_SOCKET, SO_DONTROUTE, (char *)&on, sizeof(on)); -#ifdef IPSEC -#ifdef IPSEC_POLICY_IPSEC +#if defined(IPSEC) && defined(IPSEC_POLICY_IPSEC) /* * do not raise error even if setsockopt fails, kernel may have ipsec * turned off. */ - if (setpolicy(rcvsock, "in bypass") < 0) + if (setpolicy(rcvsock, ipsec_inpolicy) < 0) errx(1, "%s", ipsec_strerror()); - if (setpolicy(rcvsock, "out bypass") < 0) + if (setpolicy(rcvsock, ipsec_outpolicy) < 0) errx(1, "%s", ipsec_strerror()); #else { @@ -735,8 +736,7 @@ main(int argc, char *argv[]) sizeof(level)); #endif } -#endif /*IPSEC_POLICY_IPSEC*/ -#endif /*IPSEC*/ +#endif /* !(IPSEC && IPSEC_POLICY_IPSEC) */ #ifdef SO_SNDBUF i = datalen; @@ -763,15 +763,14 @@ main(int argc, char *argv[]) exit(1); } } -#ifdef IPSEC -#ifdef IPSEC_POLICY_IPSEC +#if defined(IPSEC) && defined(IPSEC_POLICY_IPSEC) /* * do not raise error even if setsockopt fails, kernel may have ipsec * turned off. */ - if (setpolicy(sndsock, "in bypass") < 0) + if (setpolicy(sndsock, ipsec_inpolicy) < 0) errx(1, "%s", ipsec_strerror()); - if (setpolicy(sndsock, "out bypass") < 0) + if (setpolicy(sndsock, ipsec_outpolicy) < 0) errx(1, "%s", ipsec_strerror()); #else { @@ -793,17 +792,13 @@ main(int argc, char *argv[]) sizeof(level)); #endif } -#endif /*IPSEC_POLICY_IPSEC*/ -#endif /*IPSEC*/ +#endif /* !(IPSEC && IPSEC_POLICY_IPSEC) */ /* * Source selection */ bzero(&Src, sizeof(Src)); if (source) { - struct addrinfo hints, *res; - int error; - memset(&hints, 0, sizeof(hints)); hints.ai_family = AF_INET6; hints.ai_socktype = SOCK_DGRAM; /*dummy*/ @@ -1018,12 +1013,9 @@ wait_for_reply(int sock, struct msghdr *mhdr) #endif } -#ifdef IPSEC -#ifdef IPSEC_POLICY_IPSEC +#if defined(IPSEC) && defined(IPSEC_POLICY_IPSEC) int -setpolicy(so, policy) - int so; - char *policy; +setpolicy(int so, char *policy) { char *buf; @@ -1040,7 +1032,6 @@ setpolicy(so, policy) return 0; } #endif -#endif void send_probe(int seq, u_long hops) @@ -1627,11 +1618,11 @@ static u_int32_t crc_c[256] = { }; u_int32_t -sctp_crc32c(void *packet, u_int32_t len) +sctp_crc32c(void *pack, u_int32_t len) { u_int32_t i, crc32c; u_int8_t byte0, byte1, byte2, byte3; - u_int8_t *buf = (u_int8_t *)packet; + u_int8_t *buf = (u_int8_t *)pack; crc32c = ~0; for (i = 0; i < len; i++) From owner-svn-src-all@freebsd.org Tue Jul 21 16:02:26 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D9E62360690 for ; Tue, 21 Jul 2020 16:02:26 +0000 (UTC) (envelope-from 40532=9e58a387-9abe-4bc3-836c-b0b9712210a9=91=24813111@e.promowagon.fr) Received: from ip3.promowagon.fr (ip3.promowagon.fr [185.31.81.157]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4BB3Jd4RWqz3Z5w for ; Tue, 21 Jul 2020 16:02:24 +0000 (UTC) (envelope-from 40532=9e58a387-9abe-4bc3-836c-b0b9712210a9=91=24813111@e.promowagon.fr) Received: by ip3.promowagon.fr id h2s8oi2l724r for ; Tue, 21 Jul 2020 16:02:17 +0000 (envelope-from <40532=9e58a387-9abe-4bc3-836c-b0b9712210a9=91=24813111@e.promowagon.fr>) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; q=dns/txt; d=promowagon.fr; s=default1k; h=Date:Subject:From:To; bh=7EscYY2rhyLBR5WoN5pxSzzl8ea7XO6SaSDtLdHtuv8=; b=U1RC97OJ4y/Owo24IfBT8Z61eD0I7F5+SG4lOY/9DWMbKvC+wuCpzw6ypjeU/nNpSlkY TuThMGA0QRIWLpoFImlrMvsoW2uFEq01N0hG0F+8Avqt33EKDEAoK4F3ylJUWH7x0g3Kdp emFGYXf3NQgb+4yw37UdP67WFk72IuWmE= MIME-Version: 1.0 Date: Tue, 21 Jul 2020 16:02:17 +0000 Message-ID: <40532=9e58a387-9abe-4bc3-836c-b0b9712210a9=91=24813111@links.indisuivi.fr> Subject: =?utf-8?Q?iPhone_SE_pour_les_PRO_=C3=A0_prix_r=C3=A9duit_!?= From: "=?utf-8?Q?Bouygues_Telecom_Entreprises?=" Reply-To: =?utf-8?Q?Bouygues_Telecom_Entreprises?= To: svn-src-all@freebsd.org List-Unsubscribe-Post: List-Unsubscribe=One-Click X-Message-Type: newsletter X-Rspamd-Queue-Id: 4BB3Jd4RWqz3Z5w X-Spamd-Bar: + Authentication-Results: mx1.freebsd.org; dkim=pass header.d=promowagon.fr header.s=default1k header.b=U1RC97OJ; dmarc=none; spf=pass (mx1.freebsd.org: domain of 40532=9e58a387-9abe-4bc3-836c-b0b9712210a9=91=24813111@e.promowagon.fr designates 185.31.81.157 as permitted sender) smtp.mailfrom=40532=9e58a387-9abe-4bc3-836c-b0b9712210a9=91=24813111@e.promowagon.fr X-Spamd-Result: default: False [1.14 / 15.00]; HAS_REPLYTO(0.00)[info@promowagon.fr]; R_SPF_ALLOW(-0.20)[+ip4:185.31.80.0/22]; REPLYTO_DN_EQ_FROM_DN(0.00)[]; REPLYTO_ADDR_EQ_FROM(0.00)[]; TO_DN_NONE(0.00)[]; DKIM_TRACE(0.00)[promowagon.fr:+]; NEURAL_HAM_SHORT(-0.29)[-0.295]; FROM_EXCESS_QP(1.20)[]; SUBJECT_ENDS_EXCLAIM(0.00)[]; FORGED_SENDER(0.30)[info@promowagon.fr,40532=9e58a387-9abe-4bc3-836c-b0b9712210a9=91=24813111@e.promowagon.fr]; RCVD_COUNT_ZERO(0.00)[0]; MIME_TRACE(0.00)[0:+,1:+,2:~]; ASN(0.00)[asn:47544, ipnet:185.31.80.0/22, country:PL]; FROM_NEQ_ENVFROM(0.00)[info@promowagon.fr,40532=9e58a387-9abe-4bc3-836c-b0b9712210a9=91=24813111@e.promowagon.fr]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.37)[-0.373]; R_DKIM_ALLOW(-0.20)[promowagon.fr:s=default1k]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-0.93)[-0.934]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[svn-src-all@freebsd.org]; HTML_SHORT_LINK_IMG_3(0.50)[]; HAS_LIST_UNSUB(-0.01)[]; RCPT_COUNT_ONE(0.00)[1]; MANY_INVISIBLE_PARTS(0.05)[1]; REPLYTO_EXCESS_QP(1.20)[]; DMARC_NA(0.00)[promowagon.fr] Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.33 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Jul 2020 16:02:26 -0000 Si vous ne visualisez pas ce message correctement [1]cliquez-ici Pour ne plus recevoir nos offres vous pouvez vous d=C3=A9sabonner en bas= de cette page ou bien [2]cliquer ici. References 1. https://links.indisuivi.fr/v/2ZI/p8HvU18q3Dwmd6cZxj7aKa/06749d55 2. https://links.indisuivi.fr/u/2ZI/p8HvU18q3Dwmd6cZxj7aKa/Fd/FA-V9/F/f1= 70117a iPhone SE =C3=A0 partir de 89=E2=82=AC pour toute souscription =C3=A0 un= forfait Neo Entreprises Data [1]logo Bouygues Telecom Entreprises Logo Iphone SE L'iPhone que vous attendiez. A prix inattendu. 89=E2=82=AC au lieu de 399=E2=82=AC^(1) pour toute souscription =C3=A0 un forfait Neo Entreprises Data [2]J'en profite Logo Iphone SE Forfait Neo Entreprises Data Depuis et vers France / Europe Appels, SMS & MMS illimit=C3=A9s + 25 Go Service inclus Smartphone de remplacement en France en cas de panne^(2) [3]J'en profite La meilleure strat=C3=A9gie pour votre croissance, c'est d'=C3=AAtre bien accompagn=C3=A9. *Offre valable jusqu'au 31/07/2020 pour toute nouvelle souscription ou r=C3=A9engagement =C3=A0 un forfait Neo Entreprises Data avec option =C2= =AB mobile associ=C3=A9 =C2=BB, apr=C3=A8s d=C3=A9duction d'une Prime de 90=E2=82= =AC appliqu=C3=A9e sur la 1=C3=A8re facture. Engagement 24 ou 36 mois. BOUYGUES TELECOM - 37-39 rue Boissi=C3=A8re =C2=96 75116 PARIS - S.A au = capital de 712 588 399,56 =E2=82=AC - 397 480 930 R.C.S. Paris References 1. https://links.indisuivi.fr/c/2ZI/cYe/p8HvU18q3Dwmd6cZxj7aKa/Fd/FA-V9/= F/3ece8de7 2. https://links.indisuivi.fr/c/2ZI/cYf/p8HvU18q3Dwmd6cZxj7aKa/Fd/FA-V9/= F/d564c55a 3. https://links.indisuivi.fr/c/2ZI/cYu/p8HvU18q3Dwmd6cZxj7aKa/Fd/FA-V9/= F/a8fa1890 Vous disposez d'un droit d'acc=C3=A8s, de rectification, d'opposition et= de consentement auquel vous avez acc=C3=A8s =C3=A0 partir de cette page = web : [1]Charte des Donn=C3=A9es Personnelles . Vous recevez ce message sur votre adresse email car vous =C3=AAtes inscr= it =C3=A0 notre liste compos=C3=A9e de dirigeants et professionnels. MEDIAZUR - 1 = Rue Prommenade des anglais 06000 Nice. 833 975 758 RCS. Pour stopper la r=C3=A9ception par email de nos messages, suivez ce lie= n : [2]Se d=C3=A9sabonner.. References 1. https://links.indisuivi.fr/c/2ZI/cem/p8HvU18q3Dwmd6cZxj7aKa/Fd/FA-V9/= F/a97bad04 2. https://links.indisuivi.fr/u/2ZI/p8HvU18q3Dwmd6cZxj7aKa/Fd/FA-V9/F/f1= 70117a From owner-svn-src-all@freebsd.org Tue Jul 21 16:17:24 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6AC03361017; Tue, 21 Jul 2020 16:17:24 +0000 (UTC) (envelope-from fernape@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BB3dw2FNDz3cKJ; Tue, 21 Jul 2020 16:17:24 +0000 (UTC) (envelope-from fernape@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3083021096; Tue, 21 Jul 2020 16:17:24 +0000 (UTC) (envelope-from fernape@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06LGHOWS081517; Tue, 21 Jul 2020 16:17:24 GMT (envelope-from fernape@FreeBSD.org) Received: (from fernape@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06LGHO5l081516; Tue, 21 Jul 2020 16:17:24 GMT (envelope-from fernape@FreeBSD.org) Message-Id: <202007211617.06LGHO5l081516@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: fernape set sender to fernape@FreeBSD.org using -f From: =?UTF-8?Q?Fernando_Apestegu=c3=ada?= Date: Tue, 21 Jul 2020 16:17:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363396 - head/usr.bin/netstat X-SVN-Group: head X-SVN-Commit-Author: fernape X-SVN-Commit-Paths: head/usr.bin/netstat X-SVN-Commit-Revision: 363396 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 21 Jul 2020 16:17:24 -0000 Author: fernape (ports committer) Date: Tue Jul 21 16:17:23 2020 New Revision: 363396 URL: https://svnweb.freebsd.org/changeset/base/363396 Log: netstat(1): Add EXAMPLES section * Add small EXAMPLES section * Fix warning reported by mandoc (./netstat.1:747:2: WARNING: skipping paragraph macro: Pp before Ss) Approved by: manpages (gbe) Differential Revision: https://reviews.freebsd.org/D25212 Modified: head/usr.bin/netstat/netstat.1 Modified: head/usr.bin/netstat/netstat.1 ============================================================================== --- head/usr.bin/netstat/netstat.1 Tue Jul 21 15:03:36 2020 (r363395) +++ head/usr.bin/netstat/netstat.1 Tue Jul 21 16:17:23 2020 (r363396) @@ -28,7 +28,7 @@ .\" @(#)netstat.1 8.8 (Berkeley) 4/18/94 .\" $FreeBSD$ .\" -.Dd March 22, 2018 +.Dd July 21, 2020 .Dt NETSTAT 1 .Os .Sh NAME @@ -744,7 +744,6 @@ The flags field shows available ISR handlers: .It Li F Ta Dv NETISR_SNP_FLAGS_M2FLOW Ta "Able to map mbuf to flow id" .El .El -.Pp .Ss GENERAL OPTIONS Some options have the general meaning: .Bl -tag -width flag @@ -798,6 +797,28 @@ Normally attempts to resolve addresses and ports, and display them symbolically. .El +.Sh EXAMPLES +Show packet traffic information (packets, bytes, errors, packet drops, etc) for +interface re0 updated every 2 seconds and exit after 5 outputs: +.Bd -literal -offset indent +$ netstat -w 2 -q 5 -I re0 +.Ed +.Pp +Show statistics for ICMP on any interface: +.Bd -literal -offset indent +$ netstat -s -p icmp +.Ed +.Pp +Show routing tables: +.Bd -literal -offset indent +$ netstat -r +.Ed +.Pp +Same as above, but without resolving numeric addresses and port numbers to +names: +.Bd -literal -offset indent +$ netstat -rn +.Ed .Sh SEE ALSO .Xr fstat 1 , .Xr nfsstat 1 , From owner-svn-src-all@freebsd.org Tue Jul 21 16:21:53 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 60E91361203; Tue, 21 Jul 2020 16:21:53 +0000 (UTC) (envelope-from rscheff@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BB3l51y9sz3cg4; Tue, 21 Jul 2020 16:21:53 +0000 (UTC) (envelope-from rscheff@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2741820D73; Tue, 21 Jul 2020 16:21:53 +0000 (UTC) (envelope-from rscheff@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06LGLrhV086505; Tue, 21 Jul 2020 16:21:53 GMT (envelope-from rscheff@FreeBSD.org) Received: (from rscheff@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06LGLr6u086504; Tue, 21 Jul 2020 16:21:53 GMT (envelope-from rscheff@FreeBSD.org) Message-Id: <202007211621.06LGLr6u086504@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rscheff set sender to rscheff@FreeBSD.org using -f From: Richard Scheffenegger Date: Tue, 21 Jul 2020 16:21:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363397 - head/sys/netinet/cc X-SVN-Group: head X-SVN-Commit-Author: rscheff X-SVN-Commit-Paths: head/sys/netinet/cc X-SVN-Commit-Revision: 363397 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 21 Jul 2020 16:21:53 -0000 Author: rscheff Date: Tue Jul 21 16:21:52 2020 New Revision: 363397 URL: https://svnweb.freebsd.org/changeset/base/363397 Log: Fix style and comment around concave/convex regions in TCP cubic. In cubic, the concave region is when snd_cwnd starts growing slower towards max_cwnd (cwnd at the time of the congestion event), and the convex region is when snd_cwnd starts to grow faster and eventually appearing like slow-start like growth. PR: 238478 Reviewed by: tuexen (mentor), rgrimes (mentor) Approved by: tuexen (mentor), rgrimes (mentor) MFC after: 2 weeks Sponsored by: NetApp, Inc. Differential Revision: https://reviews.freebsd.org/D24657 Modified: head/sys/netinet/cc/cc_cubic.c Modified: head/sys/netinet/cc/cc_cubic.c ============================================================================== --- head/sys/netinet/cc/cc_cubic.c Tue Jul 21 16:17:23 2020 (r363396) +++ head/sys/netinet/cc/cc_cubic.c Tue Jul 21 16:21:52 2020 (r363397) @@ -185,12 +185,11 @@ cubic_ack_received(struct cc_var *ccv, uint16_t type) */ if (CCV(ccv, snd_cwnd) < w_tf) CCV(ccv, snd_cwnd) = ulmin(w_tf, INT_MAX); - } - - else if (CCV(ccv, snd_cwnd) < w_cubic_next) { + } else if (CCV(ccv, snd_cwnd) < w_cubic_next) { /* * Concave or convex region, follow CUBIC * cwnd growth. + * Only update snd_cwnd, if it doesn't shrink. */ if (V_tcp_do_rfc3465) CCV(ccv, snd_cwnd) = ulmin(w_cubic_next, From owner-svn-src-all@freebsd.org Tue Jul 21 16:46:41 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3791C361B07; Tue, 21 Jul 2020 16:46: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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BB4Hj0msBz3dmr; Tue, 21 Jul 2020 16:46:41 +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 F1BA7216A8; Tue, 21 Jul 2020 16:46:40 +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 06LGkequ000657; Tue, 21 Jul 2020 16:46:40 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06LGkeRO000656; Tue, 21 Jul 2020 16:46:40 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <202007211646.06LGkeRO000656@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Tue, 21 Jul 2020 16:46:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363398 - head/lib/libc/sys X-SVN-Group: head X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: head/lib/libc/sys X-SVN-Commit-Revision: 363398 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 21 Jul 2020 16:46:41 -0000 Author: asomers Date: Tue Jul 21 16:46:40 2020 New Revision: 363398 URL: https://svnweb.freebsd.org/changeset/base/363398 Log: [skip ci] document close_range(2) as async-signal-safe Reviewed by: bcr (manpages) MFC after: 2 weeks Sponsored by: Axcient Differential Revision: https://reviews.freebsd.org/D25513 Modified: head/lib/libc/sys/sigaction.2 Modified: head/lib/libc/sys/sigaction.2 ============================================================================== --- head/lib/libc/sys/sigaction.2 Tue Jul 21 16:21:52 2020 (r363397) +++ head/lib/libc/sys/sigaction.2 Tue Jul 21 16:46:40 2020 (r363398) @@ -28,7 +28,7 @@ .\" From: @(#)sigaction.2 8.2 (Berkeley) 4/3/94 .\" $FreeBSD$ .\" -.Dd June 28, 2018 +.Dd June 29, 2020 .Dt SIGACTION 2 .Os .Sh NAME @@ -569,6 +569,7 @@ Extension Interfaces: .Pp .Fn accept4 , .Fn bindat , +.Fn close_range , .Fn closefrom , .Fn connectat , .Fn eaccess , From owner-svn-src-all@freebsd.org Tue Jul 21 17:18:39 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4BFD4362579; Tue, 21 Jul 2020 17:18:39 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BB50b1FtZz3gxX; Tue, 21 Jul 2020 17:18:39 +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 0A1D721D13; Tue, 21 Jul 2020 17:18:39 +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 06LHIcOK021620; Tue, 21 Jul 2020 17:18:38 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06LHIcD9021618; Tue, 21 Jul 2020 17:18:38 GMT (envelope-from mav@FreeBSD.org) Message-Id: <202007211718.06LHIcD9021618@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Tue, 21 Jul 2020 17:18:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363399 - in head/sys: amd64/amd64 i386/i386 X-SVN-Group: head X-SVN-Commit-Author: mav X-SVN-Commit-Paths: in head/sys: amd64/amd64 i386/i386 X-SVN-Commit-Revision: 363399 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 21 Jul 2020 17:18:39 -0000 Author: mav Date: Tue Jul 21 17:18:38 2020 New Revision: 363399 URL: https://svnweb.freebsd.org/changeset/base/363399 Log: Avoid code duplicaiton by using ipi_selected(). MFC after: 2 weeks Modified: head/sys/amd64/amd64/mp_machdep.c head/sys/i386/i386/mp_machdep.c Modified: head/sys/amd64/amd64/mp_machdep.c ============================================================================== --- head/sys/amd64/amd64/mp_machdep.c Tue Jul 21 16:46:40 2020 (r363398) +++ head/sys/amd64/amd64/mp_machdep.c Tue Jul 21 17:18:38 2020 (r363399) @@ -696,13 +696,7 @@ smp_targeted_tlb_shootdown(cpuset_t mask, pmap_t pmap, CPU_CLR(PCPU_GET(cpuid), &other_cpus); } else { other_cpus = mask; - while ((cpu = CPU_FFS(&mask)) != 0) { - cpu--; - CPU_CLR(cpu, &mask); - CTR3(KTR_SMP, "%s: cpu: %d invl ipi op: %x", __func__, - cpu, op); - ipi_send_cpu(cpu, IPI_INVLOP); - } + ipi_selected(mask, IPI_INVLOP); } curcpu_cb(pmap, addr1, addr2); while ((cpu = CPU_FFS(&other_cpus)) != 0) { Modified: head/sys/i386/i386/mp_machdep.c ============================================================================== --- head/sys/i386/i386/mp_machdep.c Tue Jul 21 16:46:40 2020 (r363398) +++ head/sys/i386/i386/mp_machdep.c Tue Jul 21 17:18:38 2020 (r363399) @@ -536,13 +536,7 @@ smp_targeted_tlb_shootdown(cpuset_t mask, u_int vector CPU_CLR(PCPU_GET(cpuid), &other_cpus); } else { other_cpus = mask; - while ((cpu = CPU_FFS(&mask)) != 0) { - cpu--; - CPU_CLR(cpu, &mask); - CTR3(KTR_SMP, "%s: cpu: %d ipi: %x", __func__, - cpu, vector); - ipi_send_cpu(cpu, vector); - } + ipi_selected(mask, vector); } curcpu_cb(pmap, addr1, addr2); while ((cpu = CPU_FFS(&other_cpus)) != 0) { From owner-svn-src-all@freebsd.org Tue Jul 21 17:20:35 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 79B353621A1; Tue, 21 Jul 2020 17:20: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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BB52q2jG5z3yMk; Tue, 21 Jul 2020 17:20: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 40F9B21D14; Tue, 21 Jul 2020 17:20: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 06LHKZFA022533; Tue, 21 Jul 2020 17:20:35 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06LHKZqf022532; Tue, 21 Jul 2020 17:20:35 GMT (envelope-from dim@FreeBSD.org) Message-Id: <202007211720.06LHKZqf022532@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Tue, 21 Jul 2020 17:20:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r363400 - vendor/llvm-project/llvmorg-10.0.1-0-gef32c611aa2 X-SVN-Group: vendor X-SVN-Commit-Author: dim X-SVN-Commit-Paths: vendor/llvm-project/llvmorg-10.0.1-0-gef32c611aa2 X-SVN-Commit-Revision: 363400 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 21 Jul 2020 17:20:35 -0000 Author: dim Date: Tue Jul 21 17:20:34 2020 New Revision: 363400 URL: https://svnweb.freebsd.org/changeset/base/363400 Log: Tag llvm-project branch release/10.x llvmorg-10.0.1-0-gef32c611aa2 (there were no changes outside of the test directories since the previous tag, llvmorg-10.0.1-rc2-0-g77d76b71d7d). Added: vendor/llvm-project/llvmorg-10.0.1-0-gef32c611aa2/ - copied from r363399, vendor/llvm-project/release-10.x/ From owner-svn-src-all@freebsd.org Tue Jul 21 17:34:06 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7D761363007; Tue, 21 Jul 2020 17:34:06 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BB5LQ2mgVz40MZ; Tue, 21 Jul 2020 17:34:06 +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 425CC21E7D; Tue, 21 Jul 2020 17:34:06 +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 06LHY64k033914; Tue, 21 Jul 2020 17:34:06 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06LHY556033912; Tue, 21 Jul 2020 17:34:05 GMT (envelope-from dim@FreeBSD.org) Message-Id: <202007211734.06LHY556033912@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Tue, 21 Jul 2020 17:34:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363401 - in head/lib/clang/include: . llvm/Support X-SVN-Group: head X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in head/lib/clang/include: . llvm/Support X-SVN-Commit-Revision: 363401 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 21 Jul 2020 17:34:06 -0000 Author: dim Date: Tue Jul 21 17:34:05 2020 New Revision: 363401 URL: https://svnweb.freebsd.org/changeset/base/363401 Log: Merge llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and openmp 10.0.1 final (aka llvmorg-10.0.1-0-gef32c611aa2). There were no changes since rc2, except in the upstream regression tests, which we do not ship. Relnotes: yes MFC after: immediately (no material changes except tag) Modified: head/lib/clang/include/VCSVersion.inc head/lib/clang/include/llvm/Support/VCSRevision.h Directory Properties: head/contrib/llvm-project/ (props changed) Modified: head/lib/clang/include/VCSVersion.inc ============================================================================== --- head/lib/clang/include/VCSVersion.inc Tue Jul 21 17:20:34 2020 (r363400) +++ head/lib/clang/include/VCSVersion.inc Tue Jul 21 17:34:05 2020 (r363401) @@ -1,14 +1,14 @@ // $FreeBSD$ -#define LLVM_REVISION "llvmorg-10.0.1-rc2-0-g77d76b71d7d" +#define LLVM_REVISION "llvmorg-10.0.1-0-gef32c611aa2" #define LLVM_REPOSITORY "git@github.com:llvm/llvm-project.git" -#define CLANG_REVISION "llvmorg-10.0.1-rc2-0-g77d76b71d7d" +#define CLANG_REVISION "llvmorg-10.0.1-0-gef32c611aa2" #define CLANG_REPOSITORY "git@github.com:llvm/llvm-project.git" // - -#define LLD_REVISION "llvmorg-10.0.1-rc2-0-g77d76b71d7d-1300007" +#define LLD_REVISION "llvmorg-10.0.1-0-gef32c611aa2-1300007" #define LLD_REPOSITORY "FreeBSD" -#define LLDB_REVISION "llvmorg-10.0.1-rc2-0-g77d76b71d7d" +#define LLDB_REVISION "llvmorg-10.0.1-0-gef32c611aa2" #define LLDB_REPOSITORY "git@github.com:llvm/llvm-project.git" Modified: head/lib/clang/include/llvm/Support/VCSRevision.h ============================================================================== --- head/lib/clang/include/llvm/Support/VCSRevision.h Tue Jul 21 17:20:34 2020 (r363400) +++ head/lib/clang/include/llvm/Support/VCSRevision.h Tue Jul 21 17:34:05 2020 (r363401) @@ -1,3 +1,3 @@ /* $FreeBSD$ */ -#define LLVM_REVISION "llvmorg-10.0.1-rc2-0-g77d76b71d7d" +#define LLVM_REVISION "llvmorg-10.0.1-0-gef32c611aa2" #define LLVM_REPOSITORY "git@github.com:llvm/llvm-project.git" From owner-svn-src-all@freebsd.org Tue Jul 21 19:18:30 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id EC953365481; Tue, 21 Jul 2020 19:18:30 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BB7ft5x5Xz46TT; Tue, 21 Jul 2020 19:18:30 +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 AFA6523583; Tue, 21 Jul 2020 19:18:30 +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 06LJIUD7097711; Tue, 21 Jul 2020 19:18:30 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06LJIUuc097708; Tue, 21 Jul 2020 19:18:30 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <202007211918.06LJIUuc097708@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Tue, 21 Jul 2020 19:18:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363402 - 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: 363402 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 21 Jul 2020 19:18:31 -0000 Author: asomers Date: Tue Jul 21 19:18:29 2020 New Revision: 363402 URL: https://svnweb.freebsd.org/changeset/base/363402 Log: Fix geli's null cipher, and add a test case PR: 247954 Submitted by: jhb (sys), asomers (tests) Reviewed by: jhb (tests), asomers (sys) MFC after: 2 weeks Sponsored by: Axcient Modified: head/sys/geom/eli/g_eli_integrity.c head/sys/geom/eli/g_eli_privacy.c head/tests/sys/geom/class/eli/onetime_test.sh Modified: head/sys/geom/eli/g_eli_integrity.c ============================================================================== --- head/sys/geom/eli/g_eli_integrity.c Tue Jul 21 17:34:05 2020 (r363401) +++ head/sys/geom/eli/g_eli_integrity.c Tue Jul 21 19:18:29 2020 (r363402) @@ -536,13 +536,15 @@ g_eli_auth_run(struct g_eli_worker *wr, struct bio *bp crp->crp_digest_start = 0; crp->crp_payload_start = sc->sc_alen; crp->crp_payload_length = data_secsize; - crp->crp_flags |= CRYPTO_F_IV_SEPARATE; if ((sc->sc_flags & G_ELI_FLAG_FIRST_KEY) == 0) { crp->crp_cipher_key = g_eli_key_hold(sc, dstoff, encr_secsize); } - g_eli_crypto_ivgen(sc, dstoff, crp->crp_iv, - sizeof(crp->crp_iv)); + if (g_eli_ivlen(sc->sc_ealgo) != 0) { + crp->crp_flags |= CRYPTO_F_IV_SEPARATE; + g_eli_crypto_ivgen(sc, dstoff, crp->crp_iv, + sizeof(crp->crp_iv)); + } g_eli_auth_keygen(sc, dstoff, authkey); crp->crp_auth_key = authkey; Modified: head/sys/geom/eli/g_eli_privacy.c ============================================================================== --- head/sys/geom/eli/g_eli_privacy.c Tue Jul 21 17:34:05 2020 (r363401) +++ head/sys/geom/eli/g_eli_privacy.c Tue Jul 21 19:18:29 2020 (r363402) @@ -281,13 +281,15 @@ g_eli_crypto_run(struct g_eli_worker *wr, struct bio * crp->crp_payload_start = 0; crp->crp_payload_length = secsize; - crp->crp_flags |= CRYPTO_F_IV_SEPARATE; if ((sc->sc_flags & G_ELI_FLAG_SINGLE_KEY) == 0) { crp->crp_cipher_key = g_eli_key_hold(sc, dstoff, secsize); } - g_eli_crypto_ivgen(sc, dstoff, crp->crp_iv, - sizeof(crp->crp_iv)); + if (g_eli_ivlen(sc->sc_ealgo) != 0) { + crp->crp_flags |= CRYPTO_F_IV_SEPARATE; + g_eli_crypto_ivgen(sc, dstoff, crp->crp_iv, + sizeof(crp->crp_iv)); + } error = crypto_dispatch(crp); KASSERT(error == 0, ("crypto_dispatch() failed (error=%d)", Modified: head/tests/sys/geom/class/eli/onetime_test.sh ============================================================================== --- head/tests/sys/geom/class/eli/onetime_test.sh Tue Jul 21 17:34:05 2020 (r363401) +++ head/tests/sys/geom/class/eli/onetime_test.sh Tue Jul 21 19:18:29 2020 (r363402) @@ -130,9 +130,54 @@ onetime_d_cleanup() geli_test_cleanup } +atf_test_case onetime cleanup +onetime_null_head() +{ + atf_set "descr" "geli onetime can use the null cipher" + atf_set "require.user" "root" +} +onetime_null_body() +{ + geli_test_setup + + sectors=100 + + dd if=/dev/random of=rnd bs=${MAX_SECSIZE} count=${sectors} status=none + + secsize=512 + ealgo=${cipher%%:*} + keylen=${cipher##*:} + + md=$(attach_md -t malloc -s 100k) + + atf_check -s exit:0 -o ignore -e ignore \ + geli onetime -e null -s ${secsize} ${md} + + atf_check dd if=rnd of=/dev/${md}.eli bs=${secsize} count=${sectors} status=none + + md_rnd=`dd if=rnd bs=${secsize} count=${sectors} status=none | md5` + atf_check_equal 0 $? + md_ddev=`dd if=/dev/${md}.eli bs=${secsize} count=${sectors} status=none | md5` + atf_check_equal 0 $? + md_edev=`dd if=/dev/${md} bs=${secsize} count=${sectors} status=none | md5` + atf_check_equal 0 $? + + if [ ${md_rnd} != ${md_ddev} ]; then + atf_fail "geli did not return the original data" + fi + if [ ${md_rnd} != ${md_edev} ]; then + atf_fail "geli encrypted the data even with the null cipher" + fi +} +onetime_null_cleanup() +{ + geli_test_cleanup +} + atf_init_test_cases() { atf_add_test_case onetime atf_add_test_case onetime_a atf_add_test_case onetime_d + atf_add_test_case onetime_null } From owner-svn-src-all@freebsd.org Tue Jul 21 19:56:15 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 83DF4366508; Tue, 21 Jul 2020 19:56:15 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BB8VR3HKkz48f0; Tue, 21 Jul 2020 19:56:15 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 53EAF23AE5; Tue, 21 Jul 2020 19:56:15 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06LJuFBa022940; Tue, 21 Jul 2020 19:56:15 GMT (envelope-from melifaro@FreeBSD.org) Received: (from melifaro@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06LJuDkD022927; Tue, 21 Jul 2020 19:56:13 GMT (envelope-from melifaro@FreeBSD.org) Message-Id: <202007211956.06LJuDkD022927@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: melifaro set sender to melifaro@FreeBSD.org using -f From: "Alexander V. Chernikov" Date: Tue, 21 Jul 2020 19:56:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363403 - in head/sys: fs/nfsclient net netinet6 nfs X-SVN-Group: head X-SVN-Commit-Author: melifaro X-SVN-Commit-Paths: in head/sys: fs/nfsclient net netinet6 nfs X-SVN-Commit-Revision: 363403 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 21 Jul 2020 19:56:15 -0000 Author: melifaro Date: Tue Jul 21 19:56:13 2020 New Revision: 363403 URL: https://svnweb.freebsd.org/changeset/base/363403 Log: Transition from rtrequest1_fib() to rib_action(). Remove all variations of rtrequest and their uses and switch to to rib_action(). This is part of the new routing KPI. Submitted by: Neel Chauhan Differential Revision: https://reviews.freebsd.org/D25546 Modified: head/sys/fs/nfsclient/nfs_clvfsops.c head/sys/net/if.c head/sys/net/route.c head/sys/net/route.h head/sys/netinet6/in6_rmx.c head/sys/netinet6/in6_var.h head/sys/netinet6/nd6.c head/sys/netinet6/nd6_rtr.c head/sys/nfs/bootp_subr.c Modified: head/sys/fs/nfsclient/nfs_clvfsops.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clvfsops.c Tue Jul 21 19:18:29 2020 (r363402) +++ head/sys/fs/nfsclient/nfs_clvfsops.c Tue Jul 21 19:56:13 2020 (r363403) @@ -68,6 +68,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include @@ -466,6 +467,8 @@ nfs_mountroot(struct mount *mp) nd->mygateway.sin_addr.s_addr != 0) { struct sockaddr_in mask, sin; struct epoch_tracker et; + struct rt_addrinfo info; + struct rib_cmd_info rc; bzero((caddr_t)&mask, sizeof(mask)); sin = mask; @@ -474,10 +477,14 @@ nfs_mountroot(struct mount *mp) /* XXX MRT use table 0 for this sort of thing */ NET_EPOCH_ENTER(et); CURVNET_SET(TD_TO_VNET(td)); - error = rtrequest_fib(RTM_ADD, (struct sockaddr *)&sin, - (struct sockaddr *)&nd->mygateway, - (struct sockaddr *)&mask, - RTF_UP | RTF_GATEWAY, NULL, RT_DEFAULT_FIB); + + bzero((caddr_t)&info, sizeof(info)); + info.rti_flags = RTF_UP | RTF_GATEWAY; + info.rti_info[RTAX_DST] = (struct sockaddr *)&sin; + info.rti_info[RTAX_GATEWAY] = (struct sockaddr *)&nd->mygateway; + info.rti_info[RTAX_NETMASK] = (struct sockaddr *)&mask; + + error = rib_action(RT_DEFAULT_FIB, RTM_ADD, &info, &rc); CURVNET_RESTORE(); NET_EPOCH_EXIT(et); if (error) Modified: head/sys/net/if.c ============================================================================== --- head/sys/net/if.c Tue Jul 21 19:18:29 2020 (r363402) +++ head/sys/net/if.c Tue Jul 21 19:56:13 2020 (r363403) @@ -80,6 +80,7 @@ #include #include #include +#include #include #if defined(INET) || defined(INET6) @@ -1845,6 +1846,7 @@ static int ifa_maintain_loopback_route(int cmd, const char *otype, struct ifaddr *ifa, struct sockaddr *ia) { + struct rib_cmd_info rc; struct epoch_tracker et; int error; struct rt_addrinfo info; @@ -1872,7 +1874,7 @@ ifa_maintain_loopback_route(int cmd, const char *otype info.rti_info[RTAX_GATEWAY] = (struct sockaddr *)&null_sdl; link_init_sdl(ifp, (struct sockaddr *)&null_sdl, ifp->if_type); - error = rtrequest1_fib(cmd, &info, NULL, ifp->if_fib); + error = rib_action(ifp->if_fib, cmd, &info, &rc); NET_EPOCH_EXIT(et); if (rti_ifa != NULL) Modified: head/sys/net/route.c ============================================================================== --- head/sys/net/route.c Tue Jul 21 19:18:29 2020 (r363402) +++ head/sys/net/route.c Tue Jul 21 19:56:13 2020 (r363403) @@ -470,7 +470,7 @@ int rib_add_redirect(u_int fibnum, struct sockaddr *dst, struct sockaddr *gateway, struct sockaddr *author, struct ifnet *ifp, int flags, int lifetime_sec) { - struct rtentry *rt; + struct rib_cmd_info rc; int error; struct rt_addrinfo info; struct rt_metrics rti_rmx; @@ -504,7 +504,7 @@ rib_add_redirect(u_int fibnum, struct sockaddr *dst, s info.rti_mflags |= RTV_EXPIRE; info.rti_rmx = &rti_rmx; - error = rtrequest1_fib(RTM_ADD, &info, &rt, fibnum); + error = rib_action(fibnum, RTM_ADD, &info, &rc); ifa_free(ifa); if (error != 0) { @@ -512,9 +512,9 @@ rib_add_redirect(u_int fibnum, struct sockaddr *dst, s return (error); } - RT_LOCK(rt); - flags = rt->rt_flags; - RT_UNLOCK(rt); + RT_LOCK(rc.rc_rt); + flags = rc.rc_rt->rt_flags; + RT_UNLOCK(rc.rc_rt); RTSTAT_INC(rts_dynamic); @@ -602,33 +602,7 @@ ifa_ifwithroute(int flags, const struct sockaddr *dst, return (ifa); } -/* - * Do appropriate manipulations of a routing tree given - * all the bits of info needed - */ -int -rtrequest_fib(int req, - struct sockaddr *dst, - struct sockaddr *gateway, - struct sockaddr *netmask, - int flags, - struct rtentry **ret_nrt, - u_int fibnum) -{ - struct rt_addrinfo info; - if (dst->sa_len == 0) - return(EINVAL); - - bzero((caddr_t)&info, sizeof(info)); - info.rti_flags = flags; - info.rti_info[RTAX_DST] = dst; - info.rti_info[RTAX_GATEWAY] = gateway; - info.rti_info[RTAX_NETMASK] = netmask; - return rtrequest1_fib(req, &info, ret_nrt, fibnum); -} - - /* * Copy most of @rt data into @info. * @@ -1148,73 +1122,6 @@ rt_mpath_unlink(struct rib_head *rnh, struct rt_addrin } #endif -int -rtrequest1_fib(int req, struct rt_addrinfo *info, struct rtentry **ret_nrt, - u_int fibnum) -{ - const struct sockaddr *dst; - struct rib_head *rnh; - struct rib_cmd_info rc; - int error; - - KASSERT((fibnum < rt_numfibs), ("rtrequest1_fib: bad fibnum")); - KASSERT((info->rti_flags & RTF_RNH_LOCKED) == 0, ("rtrequest1_fib: locked")); - NET_EPOCH_ASSERT(); - - dst = info->rti_info[RTAX_DST]; - - switch (dst->sa_family) { - case AF_INET6: - case AF_INET: - /* We support multiple FIBs. */ - break; - default: - fibnum = RT_DEFAULT_FIB; - break; - } - - /* - * Find the correct routing tree to use for this Address Family - */ - rnh = rt_tables_get_rnh(fibnum, dst->sa_family); - if (rnh == NULL) - return (EAFNOSUPPORT); - - /* - * If we are adding a host route then we don't want to put - * a netmask in the tree, nor do we want to clone it. - */ - if (info->rti_flags & RTF_HOST) - info->rti_info[RTAX_NETMASK] = NULL; - - bzero(&rc, sizeof(struct rib_cmd_info)); - error = 0; - switch (req) { - case RTM_DELETE: - error = del_route(rnh, info, &rc); - break; - case RTM_RESOLVE: - /* - * resolve was only used for route cloning - * here for compat - */ - break; - case RTM_ADD: - error = add_route(rnh, info, &rc); - break; - case RTM_CHANGE: - error = change_route(rnh, info, &rc); - break; - default: - error = EOPNOTSUPP; - } - - if (ret_nrt != NULL) - *ret_nrt = rc.rc_rt; - - return (error); -} - void rt_setmetrics(const struct rt_addrinfo *info, struct rtentry *rt) { @@ -1258,7 +1165,7 @@ rtinit1(struct ifaddr *ifa, int cmd, int flags, int fi struct epoch_tracker et; struct sockaddr *dst; struct sockaddr *netmask; - struct rtentry *rt = NULL; + struct rib_cmd_info rc; struct rt_addrinfo info; int error = 0; int startfib, endfib; @@ -1349,7 +1256,7 @@ rtinit1(struct ifaddr *ifa, int cmd, int flags, int fi if (rn == NULL) error = ESRCH; else { - rt = RNTORT(rn); + struct rtentry *rt = RNTORT(rn); /* * for interface route the gateway * gateway is sockaddr_dl, so @@ -1389,14 +1296,14 @@ rtinit1(struct ifaddr *ifa, int cmd, int flags, int fi info.rti_info[RTAX_GATEWAY] = ifa->ifa_addr; info.rti_info[RTAX_NETMASK] = netmask; NET_EPOCH_ENTER(et); - error = rtrequest1_fib(cmd, &info, &rt, fibnum); - if (error == 0 && rt != NULL) { + error = rib_action(fibnum, cmd, &info, &rc); + if (error == 0 && rc.rc_rt != NULL) { /* * notify any listening routing agents of the change */ /* TODO: interface routes/aliases */ - rt_newaddrmsg_fib(cmd, ifa, rt, fibnum); + rt_newaddrmsg_fib(cmd, ifa, rc.rc_rt, fibnum); didwork = 1; } NET_EPOCH_EXIT(et); Modified: head/sys/net/route.h ============================================================================== --- head/sys/net/route.h Tue Jul 21 19:18:29 2020 (r363402) +++ head/sys/net/route.h Tue Jul 21 19:56:13 2020 (r363403) @@ -411,9 +411,6 @@ int rtinit(struct ifaddr *, int, int); * but this will change.. */ int rtioctl_fib(u_long, caddr_t, u_int); -int rtrequest_fib(int, struct sockaddr *, - struct sockaddr *, struct sockaddr *, int, struct rtentry **, u_int); -int rtrequest1_fib(int, struct rt_addrinfo *, struct rtentry **, u_int); int rib_lookup_info(uint32_t, const struct sockaddr *, uint32_t, uint32_t, struct rt_addrinfo *); void rib_free_info(struct rt_addrinfo *info); Modified: head/sys/netinet6/in6_rmx.c ============================================================================== --- head/sys/netinet6/in6_rmx.c Tue Jul 21 19:18:29 2020 (r363402) +++ head/sys/netinet6/in6_rmx.c Tue Jul 21 19:56:13 2020 (r363403) @@ -185,14 +185,3 @@ in6_detachhead(void **head, int off) } #endif -/* - * Extended API for IPv6 FIB support. - */ -int -in6_rtrequest(int req, struct sockaddr *dst, struct sockaddr *gw, - struct sockaddr *mask, int flags, struct rtentry **ret_nrt, u_int fibnum) -{ - - return (rtrequest_fib(req, dst, gw, mask, flags, ret_nrt, fibnum)); -} - Modified: head/sys/netinet6/in6_var.h ============================================================================== --- head/sys/netinet6/in6_var.h Tue Jul 21 19:18:29 2020 (r363402) +++ head/sys/netinet6/in6_var.h Tue Jul 21 19:56:13 2020 (r363403) @@ -915,8 +915,6 @@ void in6_newaddrmsg(struct in6_ifaddr *, int); * Extended API for IPv6 FIB support. */ struct mbuf *ip6_tryforward(struct mbuf *); -int in6_rtrequest(int, struct sockaddr *, struct sockaddr *, - struct sockaddr *, int, struct rtentry **, u_int); #endif /* _KERNEL */ #endif /* _NETINET6_IN6_VAR_H_ */ Modified: head/sys/netinet6/nd6.c ============================================================================== --- head/sys/netinet6/nd6.c Tue Jul 21 19:18:29 2020 (r363402) +++ head/sys/netinet6/nd6.c Tue Jul 21 19:56:13 2020 (r363403) @@ -1564,6 +1564,7 @@ nd6_free_redirect(const struct llentry *ln) int fibnum; struct sockaddr_in6 sin6; struct rt_addrinfo info; + struct rib_cmd_info rc; struct epoch_tracker et; lltable_fill_sa_entry(ln, (struct sockaddr *)&sin6); @@ -1573,7 +1574,7 @@ nd6_free_redirect(const struct llentry *ln) NET_EPOCH_ENTER(et); for (fibnum = 0; fibnum < rt_numfibs; fibnum++) - rtrequest1_fib(RTM_DELETE, &info, NULL, fibnum); + rib_action(fibnum, RTM_DELETE, &info, &rc); NET_EPOCH_EXIT(et); } Modified: head/sys/netinet6/nd6_rtr.c ============================================================================== --- head/sys/netinet6/nd6_rtr.c Tue Jul 21 19:18:29 2020 (r363402) +++ head/sys/netinet6/nd6_rtr.c Tue Jul 21 19:56:13 2020 (r363403) @@ -674,7 +674,8 @@ static void defrouter_addreq(struct nd_defrouter *new) { struct sockaddr_in6 def, mask, gate; - struct rtentry *newrt = NULL; + struct rt_addrinfo info; + struct rib_cmd_info rc; unsigned int fibnum; int error; @@ -688,11 +689,16 @@ defrouter_addreq(struct nd_defrouter *new) gate.sin6_addr = new->rtaddr; fibnum = new->ifp->if_fib; - error = in6_rtrequest(RTM_ADD, (struct sockaddr *)&def, - (struct sockaddr *)&gate, (struct sockaddr *)&mask, - RTF_GATEWAY, &newrt, fibnum); - if (newrt != NULL) - rt_routemsg(RTM_ADD, newrt, new->ifp, 0, fibnum); + bzero((caddr_t)&info, sizeof(info)); + info.rti_flags = RTF_GATEWAY; + info.rti_info[RTAX_DST] = (struct sockaddr *)&def; + info.rti_info[RTAX_GATEWAY] = (struct sockaddr *)&gate; + info.rti_info[RTAX_NETMASK] = (struct sockaddr *)&mask; + + NET_EPOCH_ASSERT(); + error = rib_action(fibnum, RTM_ADD, &info, &rc); + if (rc.rc_rt != NULL) + rt_routemsg(RTM_ADD, rc.rc_rt, new->ifp, 0, fibnum); if (error == 0) new->installed = 1; } @@ -706,7 +712,8 @@ static void defrouter_delreq(struct nd_defrouter *dr) { struct sockaddr_in6 def, mask, gate; - struct rtentry *oldrt = NULL; + struct rt_addrinfo info; + struct rib_cmd_info rc; struct epoch_tracker et; unsigned int fibnum; @@ -720,12 +727,16 @@ defrouter_delreq(struct nd_defrouter *dr) gate.sin6_addr = dr->rtaddr; fibnum = dr->ifp->if_fib; + bzero((caddr_t)&info, sizeof(info)); + info.rti_flags = RTF_GATEWAY; + info.rti_info[RTAX_DST] = (struct sockaddr *)&def; + info.rti_info[RTAX_GATEWAY] = (struct sockaddr *)&gate; + info.rti_info[RTAX_NETMASK] = (struct sockaddr *)&mask; + NET_EPOCH_ENTER(et); - in6_rtrequest(RTM_DELETE, (struct sockaddr *)&def, - (struct sockaddr *)&gate, - (struct sockaddr *)&mask, RTF_GATEWAY, &oldrt, fibnum); - if (oldrt != NULL) - rt_routemsg(RTM_DELETE, oldrt, dr->ifp, 0, fibnum); + rib_action(fibnum, RTM_DELETE, &info, &rc); + if (rc.rc_rt != NULL) + rt_routemsg(RTM_DELETE, rc.rc_rt, dr->ifp, 0, fibnum); NET_EPOCH_EXIT(et); dr->installed = 0; @@ -2009,7 +2020,6 @@ static int nd6_prefix_onlink_rtrequest(struct nd_prefix *pr, struct ifaddr *ifa) { struct sockaddr_dl_short sdl; - struct rtentry *rt; struct sockaddr_in6 mask6; u_long rtflags; int error, a_failure, fibnum, maxfib; @@ -2034,11 +2044,17 @@ nd6_prefix_onlink_rtrequest(struct nd_prefix *pr, stru } a_failure = 0; for (; fibnum < maxfib; fibnum++) { + struct rt_addrinfo info; + struct rib_cmd_info rc; - rt = NULL; - error = in6_rtrequest(RTM_ADD, - (struct sockaddr *)&pr->ndpr_prefix, (struct sockaddr *)&sdl, - (struct sockaddr *)&mask6, rtflags, &rt, fibnum); + bzero((caddr_t)&info, sizeof(info)); + info.rti_flags = rtflags; + info.rti_info[RTAX_DST] = (struct sockaddr *)&pr->ndpr_prefix; + info.rti_info[RTAX_GATEWAY] = (struct sockaddr *)&sdl; + info.rti_info[RTAX_NETMASK] = (struct sockaddr *)&mask6; + + NET_EPOCH_ASSERT(); + error = rib_action(fibnum, RTM_ADD, &info, &rc); if (error != 0) { char ip6buf[INET6_ADDRSTRLEN]; char ip6bufg[INET6_ADDRSTRLEN]; @@ -2061,7 +2077,7 @@ nd6_prefix_onlink_rtrequest(struct nd_prefix *pr, stru } pr->ndpr_stateflags |= NDPRF_ONLINK; - rt_routemsg(RTM_ADD, rt, pr->ndpr_ifp, 0, fibnum); + rt_routemsg(RTM_ADD, rc.rc_rt, pr->ndpr_ifp, 0, fibnum); } /* Return the last error we got. */ @@ -2158,7 +2174,6 @@ nd6_prefix_offlink(struct nd_prefix *pr) struct ifnet *ifp = pr->ndpr_ifp; struct nd_prefix *opr; struct sockaddr_in6 sa6, mask6; - struct rtentry *rt; char ip6buf[INET6_ADDRSTRLEN]; uint64_t genid; int fibnum, maxfib, a_failure; @@ -2191,9 +2206,17 @@ nd6_prefix_offlink(struct nd_prefix *pr) a_failure = 0; NET_EPOCH_ENTER(et); for (; fibnum < maxfib; fibnum++) { - rt = NULL; - error = in6_rtrequest(RTM_DELETE, (struct sockaddr *)&sa6, NULL, - (struct sockaddr *)&mask6, 0, &rt, fibnum); + struct rt_addrinfo info; + struct rib_cmd_info rc; + + bzero((caddr_t)&info, sizeof(info)); + info.rti_flags = RTF_GATEWAY; + info.rti_info[RTAX_DST] = (struct sockaddr *)&sa6; + info.rti_info[RTAX_GATEWAY] = NULL; + info.rti_info[RTAX_NETMASK] = (struct sockaddr *)&mask6; + + NET_EPOCH_ASSERT(); + error = rib_action(fibnum, RTM_DELETE, &info, &rc); if (error != 0) { /* Save last error to return, see rtinit(). */ a_failure = error; @@ -2201,7 +2224,7 @@ nd6_prefix_offlink(struct nd_prefix *pr) } /* report route deletion to the routing socket. */ - rt_routemsg(RTM_DELETE, rt, ifp, 0, fibnum); + rt_routemsg(RTM_DELETE, rc.rc_rt, ifp, 0, fibnum); } NET_EPOCH_EXIT(et); error = a_failure; Modified: head/sys/nfs/bootp_subr.c ============================================================================== --- head/sys/nfs/bootp_subr.c Tue Jul 21 19:18:29 2020 (r363402) +++ head/sys/nfs/bootp_subr.c Tue Jul 21 19:56:13 2020 (r363403) @@ -68,6 +68,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -979,6 +980,8 @@ bootpc_add_default_route(struct bootpc_ifcontext *ifct int error; struct sockaddr_in defdst; struct sockaddr_in defmask; + struct rt_addrinfo info; + struct rib_cmd_info rc; if (ifctx->gw.sin_addr.s_addr == htonl(INADDR_ANY)) return; @@ -986,9 +989,14 @@ bootpc_add_default_route(struct bootpc_ifcontext *ifct clear_sinaddr(&defdst); clear_sinaddr(&defmask); - error = rtrequest_fib(RTM_ADD, (struct sockaddr *)&defdst, - (struct sockaddr *) &ifctx->gw, (struct sockaddr *)&defmask, - (RTF_UP | RTF_GATEWAY | RTF_STATIC), NULL, RT_DEFAULT_FIB); + bzero((caddr_t)&info, sizeof(info)); + info.rti_flags = RTF_UP | RTF_GATEWAY | RTF_STATIC; + info.rti_info[RTAX_DST] = (struct sockaddr *)&defdst; + info.rti_info[RTAX_NETMASK] = (struct sockaddr *)&defmask; + info.rti_info[RTAX_GATEWAY] = (struct sockaddr *)&ifctx->gw; + + error = rib_action(RT_DEFAULT_FIB, RTM_ADD, &info, &rc); + if (error != 0) { printf("%s: RTM_ADD, error=%d\n", __func__, error); } @@ -1000,6 +1008,8 @@ bootpc_remove_default_route(struct bootpc_ifcontext *i int error; struct sockaddr_in defdst; struct sockaddr_in defmask; + struct rt_addrinfo info; + struct rib_cmd_info rc; if (ifctx->gw.sin_addr.s_addr == htonl(INADDR_ANY)) return; @@ -1007,9 +1017,13 @@ bootpc_remove_default_route(struct bootpc_ifcontext *i clear_sinaddr(&defdst); clear_sinaddr(&defmask); - error = rtrequest_fib(RTM_DELETE, (struct sockaddr *)&defdst, - (struct sockaddr *) &ifctx->gw, (struct sockaddr *)&defmask, - (RTF_UP | RTF_GATEWAY | RTF_STATIC), NULL, RT_DEFAULT_FIB); + bzero((caddr_t)&info, sizeof(info)); + info.rti_flags = RTF_UP | RTF_GATEWAY | RTF_STATIC; + info.rti_info[RTAX_DST] = (struct sockaddr *)&defdst; + info.rti_info[RTAX_NETMASK] = (struct sockaddr *)&defmask; + info.rti_info[RTAX_GATEWAY] = (struct sockaddr *)&ifctx->gw; + + error = rib_action(RT_DEFAULT_FIB, RTM_DELETE, &info, &rc); if (error != 0) { printf("%s: RTM_DELETE, error=%d\n", __func__, error); } From owner-svn-src-all@freebsd.org Tue Jul 21 22:47:03 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2A9D836A4B7; Tue, 21 Jul 2020 22:47:03 +0000 (UTC) (envelope-from mhorne@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BBDHW0Mbdz4LwV; Tue, 21 Jul 2020 22:47:03 +0000 (UTC) (envelope-from mhorne@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E4A8325D05; Tue, 21 Jul 2020 22:47:02 +0000 (UTC) (envelope-from mhorne@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06LMl2eG031298; Tue, 21 Jul 2020 22:47:02 GMT (envelope-from mhorne@FreeBSD.org) Received: (from mhorne@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06LMl2Em031296; Tue, 21 Jul 2020 22:47:02 GMT (envelope-from mhorne@FreeBSD.org) Message-Id: <202007212247.06LMl2Em031296@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mhorne set sender to mhorne@FreeBSD.org using -f From: Mitchell Horne Date: Tue, 21 Jul 2020 22:47:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363404 - in head/sys: kern riscv/riscv X-SVN-Group: head X-SVN-Commit-Author: mhorne X-SVN-Commit-Paths: in head/sys: kern riscv/riscv X-SVN-Commit-Revision: 363404 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 21 Jul 2020 22:47:03 -0000 Author: mhorne Date: Tue Jul 21 22:47:02 2020 New Revision: 363404 URL: https://svnweb.freebsd.org/changeset/base/363404 Log: INTRNG: only shuffle for !EARLY_AP_STARTUP During device attachment, all interrupt sources will bind to the BSP, as it is the only processor online. This means interrupts must be redistributed ("shuffled") later, during SI_SUB_SMP. For the EARLY_AP_STARTUP case, this is no longer true. SI_SUB_SMP will execute much earlier, meaning APs will be online and available before devices begin attachment, and there will therefore be nothing to shuffle. All PIC-conforming interrupt controllers will handle this early distribution properly, except for RISC-V's PLIC. Make the necessary tweak to the PLIC driver. While here, convert irq_assign_cpu from a boolean_t to a bool. Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D25693 Modified: head/sys/kern/subr_intr.c head/sys/riscv/riscv/plic.c Modified: head/sys/kern/subr_intr.c ============================================================================== --- head/sys/kern/subr_intr.c Tue Jul 21 19:56:13 2020 (r363403) +++ head/sys/kern/subr_intr.c Tue Jul 21 22:47:02 2020 (r363404) @@ -128,8 +128,12 @@ static struct intr_irqsrc *irq_sources[NIRQ]; u_int irq_next_free; #ifdef SMP -static boolean_t irq_assign_cpu = FALSE; +#ifdef EARLY_AP_STARTUP +static bool irq_assign_cpu = true; +#else +static bool irq_assign_cpu = false; #endif +#endif /* * - 2 counters for each I/O interrupt. @@ -1191,6 +1195,7 @@ intr_irq_next_cpu(u_int last_cpu, cpuset_t *cpumask) return (last_cpu); } +#ifndef EARLY_AP_STARTUP /* * Distribute all the interrupt sources among the available * CPUs once the AP's have been launched. @@ -1205,7 +1210,7 @@ intr_irq_shuffle(void *arg __unused) return; mtx_lock(&isrc_table_lock); - irq_assign_cpu = TRUE; + irq_assign_cpu = true; for (i = 0; i < NIRQ; i++) { isrc = irq_sources[i]; if (isrc == NULL || isrc->isrc_handlers == 0 || @@ -1231,6 +1236,7 @@ intr_irq_shuffle(void *arg __unused) mtx_unlock(&isrc_table_lock); } SYSINIT(intr_irq_shuffle, SI_SUB_SMP, SI_ORDER_SECOND, intr_irq_shuffle, NULL); +#endif /* !EARLY_AP_STARTUP */ #else u_int @@ -1239,7 +1245,7 @@ intr_irq_next_cpu(u_int current_cpu, cpuset_t *cpumask return (PCPU_GET(cpuid)); } -#endif +#endif /* SMP */ /* * Allocate memory for new intr_map_data structure. Modified: head/sys/riscv/riscv/plic.c ============================================================================== --- head/sys/riscv/riscv/plic.c Tue Jul 21 19:56:13 2020 (r363403) +++ head/sys/riscv/riscv/plic.c Tue Jul 21 22:47:02 2020 (r363404) @@ -408,8 +408,7 @@ plic_setup_intr(device_t dev, struct intr_irqsrc *isrc sc = device_get_softc(dev); src = (struct plic_irqsrc *)isrc; - /* Bind to the boot CPU for now. */ - CPU_SET(PCPU_GET(cpuid), &isrc->isrc_cpu); + CPU_ZERO(&isrc->isrc_cpu); plic_bind_intr(dev, isrc); return (0); From owner-svn-src-all@freebsd.org Tue Jul 21 23:23:09 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7D8B236ACEA; Tue, 21 Jul 2020 23:23:09 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BBF592nQQz4P1X; Tue, 21 Jul 2020 23:23:09 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2AE6826355; Tue, 21 Jul 2020 23:23:09 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06LNN9rB055916; Tue, 21 Jul 2020 23:23:09 GMT (envelope-from mckusick@FreeBSD.org) Received: (from mckusick@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06LNN8Za055914; Tue, 21 Jul 2020 23:23:08 GMT (envelope-from mckusick@FreeBSD.org) Message-Id: <202007212323.06LNN8Za055914@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mckusick set sender to mckusick@FreeBSD.org using -f From: Kirk McKusick Date: Tue, 21 Jul 2020 23:23:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r363405 - in stable/12: bin/ps sys/sys X-SVN-Group: stable-12 X-SVN-Commit-Author: mckusick X-SVN-Commit-Paths: in stable/12: bin/ps sys/sys X-SVN-Commit-Revision: 363405 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 21 Jul 2020 23:23:09 -0000 Author: mckusick Date: Tue Jul 21 23:23:08 2020 New Revision: 363405 URL: https://svnweb.freebsd.org/changeset/base/363405 Log: MFC of 362369 (by Lorenzo Salvadore) and 363192 Refinement of /bin/ps rtprio output Modified: stable/12/bin/ps/print.c stable/12/bin/ps/ps.1 stable/12/sys/sys/rtprio.h Directory Properties: stable/12/ (props changed) Modified: stable/12/bin/ps/print.c ============================================================================== --- stable/12/bin/ps/print.c Tue Jul 21 22:47:02 2020 (r363404) +++ stable/12/bin/ps/print.c Tue Jul 21 23:23:08 2020 (r363405) @@ -717,17 +717,24 @@ priorityr(KINFO *k, VARENT *ve __unused) class = lpri->pri_class; level = lpri->pri_level; switch (class) { - case PRI_ITHD: - asprintf(&str, "intr:%u", level); + case RTP_PRIO_REALTIME: + /* alias for PRI_REALTIME */ + asprintf(&str, "real:%u", level - PRI_MIN_REALTIME); break; - case PRI_REALTIME: - asprintf(&str, "real:%u", level); + case RTP_PRIO_NORMAL: + /* alias for PRI_TIMESHARE */ + if (level >= PRI_MIN_TIMESHARE) + asprintf(&str, "normal:%u", level - PRI_MIN_TIMESHARE); + else + asprintf(&str, "kernel:%u", level - PRI_MIN_KERN); break; - case PRI_TIMESHARE: - asprintf(&str, "normal"); + case RTP_PRIO_IDLE: + /* alias for PRI_IDLE */ + asprintf(&str, "idle:%u", level - PRI_MIN_IDLE); break; - case PRI_IDLE: - asprintf(&str, "idle:%u", level); + case RTP_PRIO_ITHD: + /* alias for PRI_ITHD */ + asprintf(&str, "intr:%u", level - PRI_MIN_ITHD); break; default: asprintf(&str, "%u:%u", class, level); Modified: stable/12/bin/ps/ps.1 ============================================================================== --- stable/12/bin/ps/ps.1 Tue Jul 21 22:47:02 2020 (r363404) +++ stable/12/bin/ps/ps.1 Tue Jul 21 23:23:08 2020 (r363405) @@ -649,7 +649,8 @@ group name (from rgid) .It Cm rss resident set size .It Cm rtprio -realtime priority (101 = not a realtime process) +realtime priority (see +.Xr rtprio 1) .It Cm ruid real user ID .It Cm ruser Modified: stable/12/sys/sys/rtprio.h ============================================================================== --- stable/12/sys/sys/rtprio.h Tue Jul 21 22:47:02 2020 (r363404) +++ stable/12/sys/sys/rtprio.h Tue Jul 21 23:23:08 2020 (r363405) @@ -44,6 +44,7 @@ /* priority types. Start at 1 to catch uninitialized fields. */ +#define RTP_PRIO_ITHD PRI_ITHD /* Interrupt thread. */ #define RTP_PRIO_REALTIME PRI_REALTIME /* real time process */ #define RTP_PRIO_NORMAL PRI_TIMESHARE /* time sharing process */ #define RTP_PRIO_IDLE PRI_IDLE /* idle process */ From owner-svn-src-all@freebsd.org Tue Jul 21 23:36:18 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AF58F36B253; Tue, 21 Jul 2020 23:36:18 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BBFNL4GStz4PhG; Tue, 21 Jul 2020 23:36:18 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 772122660A; Tue, 21 Jul 2020 23:36:18 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06LNaIvu062926; Tue, 21 Jul 2020 23:36:18 GMT (envelope-from wulf@FreeBSD.org) Received: (from wulf@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06LNaISG062925; Tue, 21 Jul 2020 23:36:18 GMT (envelope-from wulf@FreeBSD.org) Message-Id: <202007212336.06LNaISG062925@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: wulf set sender to wulf@FreeBSD.org using -f From: Vladimir Kondratyev Date: Tue, 21 Jul 2020 23:36:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r363406 - stable/12/sys/compat/linuxkpi/common/include/linux X-SVN-Group: stable-12 X-SVN-Commit-Author: wulf X-SVN-Commit-Paths: stable/12/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 363406 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 21 Jul 2020 23:36:18 -0000 Author: wulf Date: Tue Jul 21 23:36:18 2020 New Revision: 363406 URL: https://svnweb.freebsd.org/changeset/base/363406 Log: MFC r363205: linuxkpi: Ignore NULL pointers passed to string parameter of kstr(n)dup That follows Linux and fixes related drm-kmod-5.3 panic. Reviewed by: imp, hselasky Differential Revision: https://reviews.freebsd.org/D25657 Modified: stable/12/sys/compat/linuxkpi/common/include/linux/string.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/compat/linuxkpi/common/include/linux/string.h ============================================================================== --- stable/12/sys/compat/linuxkpi/common/include/linux/string.h Tue Jul 21 23:23:08 2020 (r363405) +++ stable/12/sys/compat/linuxkpi/common/include/linux/string.h Tue Jul 21 23:36:18 2020 (r363406) @@ -103,6 +103,8 @@ kstrdup(const char *string, gfp_t gfp) char *retval; size_t len; + if (string == NULL) + return (NULL); len = strlen(string) + 1; retval = kmalloc(len, gfp); if (retval != NULL) @@ -115,6 +117,8 @@ kstrndup(const char *string, size_t len, gfp_t gfp) { char *retval; + if (string == NULL) + return (NULL); retval = kmalloc(len + 1, gfp); if (retval != NULL) strncpy(retval, string, len); From owner-svn-src-all@freebsd.org Tue Jul 21 23:38:06 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8C31036B4E3; Tue, 21 Jul 2020 23:38:06 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BBFQQ3CXMz4PkQ; Tue, 21 Jul 2020 23:38:06 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 515E8263E6; Tue, 21 Jul 2020 23:38:06 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06LNc68C063068; Tue, 21 Jul 2020 23:38:06 GMT (envelope-from wulf@FreeBSD.org) Received: (from wulf@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06LNc6tN063067; Tue, 21 Jul 2020 23:38:06 GMT (envelope-from wulf@FreeBSD.org) Message-Id: <202007212338.06LNc6tN063067@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: wulf set sender to wulf@FreeBSD.org using -f From: Vladimir Kondratyev Date: Tue, 21 Jul 2020 23:38: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: r363407 - stable/11/sys/compat/linuxkpi/common/include/linux X-SVN-Group: stable-11 X-SVN-Commit-Author: wulf X-SVN-Commit-Paths: stable/11/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 363407 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 21 Jul 2020 23:38:06 -0000 Author: wulf Date: Tue Jul 21 23:38:05 2020 New Revision: 363407 URL: https://svnweb.freebsd.org/changeset/base/363407 Log: MFC 363205: linuxkpi: Ignore NULL pointers passed to string parameter of kstr(n)dup That follows Linux and fixes related drm-kmod-5.3 panic. Reviewed by: imp, hselasky Differential Revision: https://reviews.freebsd.org/D25657 Modified: stable/11/sys/compat/linuxkpi/common/include/linux/string.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/compat/linuxkpi/common/include/linux/string.h ============================================================================== --- stable/11/sys/compat/linuxkpi/common/include/linux/string.h Tue Jul 21 23:36:18 2020 (r363406) +++ stable/11/sys/compat/linuxkpi/common/include/linux/string.h Tue Jul 21 23:38:05 2020 (r363407) @@ -103,6 +103,8 @@ kstrdup(const char *string, gfp_t gfp) char *retval; size_t len; + if (string == NULL) + return (NULL); len = strlen(string) + 1; retval = kmalloc(len, gfp); if (retval != NULL) @@ -115,6 +117,8 @@ kstrndup(const char *string, size_t len, gfp_t gfp) { char *retval; + if (string == NULL) + return (NULL); retval = kmalloc(len + 1, gfp); if (retval != NULL) strncpy(retval, string, len); From owner-svn-src-all@freebsd.org Wed Jul 22 00:44:47 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DA3E636CF57; Wed, 22 Jul 2020 00:44:47 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BBGvM5SZVz4TKB; Wed, 22 Jul 2020 00:44:47 +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 9EDD227357; Wed, 22 Jul 2020 00:44:47 +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 06M0ilXm006767; Wed, 22 Jul 2020 00:44:47 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06M0ildo006766; Wed, 22 Jul 2020 00:44:47 GMT (envelope-from imp@FreeBSD.org) Message-Id: <202007220044.06M0ildo006766@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Wed, 22 Jul 2020 00:44:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363408 - head/libexec/getty X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/libexec/getty X-SVN-Commit-Revision: 363408 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 22 Jul 2020 00:44:47 -0000 Author: imp Date: Wed Jul 22 00:44:47 2020 New Revision: 363408 URL: https://svnweb.freebsd.org/changeset/base/363408 Log: getty appears to date from 3rd edition research unix. That's the oldest man page on TUHS and its 'unix 1972' restoration effort has assembler sources that look like simpler version of what's in the 5th edition. Modified: head/libexec/getty/getty.8 Modified: head/libexec/getty/getty.8 ============================================================================== --- head/libexec/getty/getty.8 Tue Jul 21 23:38:05 2020 (r363407) +++ head/libexec/getty/getty.8 Wed Jul 22 00:44:47 2020 (r363408) @@ -28,7 +28,7 @@ .\" from: @(#)getty.8 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" " -.Dd March 2, 2018 +.Dd July 21, 2020 .Dt GETTY 8 .Os .Sh NAME @@ -122,4 +122,4 @@ does not exist. A .Nm utility appeared in -.At v6 . +.At v3 . From owner-svn-src-all@freebsd.org Wed Jul 22 02:09:11 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7511436E495; Wed, 22 Jul 2020 02:09: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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BBJml2FSzz4X53; Wed, 22 Jul 2020 02:09: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 2BEE527BF3; Wed, 22 Jul 2020 02:09: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 06M29BHL056211; Wed, 22 Jul 2020 02:09:11 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06M29B0c056210; Wed, 22 Jul 2020 02:09:11 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202007220209.06M29B0c056210@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Wed, 22 Jul 2020 02:09:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363409 - head/lib/libbe X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/lib/libbe X-SVN-Commit-Revision: 363409 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 22 Jul 2020 02:09:11 -0000 Author: kevans Date: Wed Jul 22 02:09:10 2020 New Revision: 363409 URL: https://svnweb.freebsd.org/changeset/base/363409 Log: libbe: annotate lbh as __unused in be_is_auto_snapshot_name lbh is included for consistency with other functions and in case future work needs to use it, but it is currently unused. Mark it, and a post-OpenZFS-import world will be able to raise WARNS of libbe to the default (pending some minor changes to openzfs libzfs). MFC after: 3 days Modified: head/lib/libbe/be.c Modified: head/lib/libbe/be.c ============================================================================== --- head/lib/libbe/be.c Wed Jul 22 00:44:47 2020 (r363408) +++ head/lib/libbe/be.c Wed Jul 22 02:09:10 2020 (r363409) @@ -563,7 +563,7 @@ be_setup_snapshot_name(libbe_handle_t *lbh, char *buf, } bool -be_is_auto_snapshot_name(libbe_handle_t *lbh, const char *name) +be_is_auto_snapshot_name(libbe_handle_t *lbh __unused, const char *name) { const char *snap; int day, hour, minute, month, second, serial, year; From owner-svn-src-all@freebsd.org Wed Jul 22 02:14:28 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8756136E741; Wed, 22 Jul 2020 02:14:28 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BBJtr2rjQz4XKZ; Wed, 22 Jul 2020 02:14:28 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 460C9281B1; Wed, 22 Jul 2020 02:14:28 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06M2ESUh062089; Wed, 22 Jul 2020 02:14:28 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06M2ESbg062088; Wed, 22 Jul 2020 02:14:28 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <202007220214.06M2ESbg062088@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Wed, 22 Jul 2020 02:14:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363410 - head/sys/geom X-SVN-Group: head X-SVN-Commit-Author: delphij X-SVN-Commit-Paths: head/sys/geom X-SVN-Commit-Revision: 363410 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 22 Jul 2020 02:14:28 -0000 Author: delphij Date: Wed Jul 22 02:14:27 2020 New Revision: 363410 URL: https://svnweb.freebsd.org/changeset/base/363410 Log: gctl_get_class, gctl_get_geom and gctl_get_provider: provide feedback when the requested argument is missing. Reviewed by: cem MFC after: 2 weeks Differential revision: https://reviews.freebsd.org/D25738 Modified: head/sys/geom/geom_ctl.c Modified: head/sys/geom/geom_ctl.c ============================================================================== --- head/sys/geom/geom_ctl.c Wed Jul 22 02:09:10 2020 (r363409) +++ head/sys/geom/geom_ctl.c Wed Jul 22 02:14:27 2020 (r363410) @@ -396,12 +396,15 @@ gctl_get_class(struct gctl_req *req, char const *arg) struct g_class *cp; p = gctl_get_asciiparam(req, arg); - if (p == NULL) + if (p == NULL) { + gctl_error(req, "Missing %s argument", arg); return (NULL); + } LIST_FOREACH(cp, &g_classes, class) { if (!strcmp(p, cp->name)) return (cp); } + gctl_error(req, "Class not found: \"%s\"", p); return (NULL); } @@ -413,8 +416,10 @@ gctl_get_geom(struct gctl_req *req, struct g_class *mp struct g_geom *gp; p = gctl_get_asciiparam(req, arg); - if (p == NULL) + if (p == NULL) { + gctl_error(req, "Missing %s argument", arg); return (NULL); + } LIST_FOREACH(mp, &g_classes, class) { if (mpr != NULL && mpr != mp) continue; @@ -434,8 +439,10 @@ gctl_get_provider(struct gctl_req *req, char const *ar struct g_provider *pp; p = gctl_get_asciiparam(req, arg); - if (p == NULL) + if (p == NULL) { + gctl_error(req, "Missing '%s' argument", arg); return (NULL); + } pp = g_provider_by_name(p); if (pp != NULL) return (pp); @@ -453,10 +460,8 @@ g_ctl_req(void *arg, int flag __unused) g_topology_assert(); req = arg; mp = gctl_get_class(req, "class"); - if (mp == NULL) { - gctl_error(req, "Class not found"); + if (mp == NULL) return; - } if (mp->ctlreq == NULL) { gctl_error(req, "Class takes no requests"); return; From owner-svn-src-all@freebsd.org Wed Jul 22 02:15:23 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9F61D36EB0F; Wed, 22 Jul 2020 02:15:23 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BBJvv3jqyz4Xcw; Wed, 22 Jul 2020 02:15:23 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6302E281B2; Wed, 22 Jul 2020 02:15:23 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06M2FN19062199; Wed, 22 Jul 2020 02:15:23 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06M2FLga062190; Wed, 22 Jul 2020 02:15:21 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <202007220215.06M2FLga062190@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Wed, 22 Jul 2020 02:15:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363411 - in head/sys/geom: cache concat eli label mirror mountver nop raid3 stripe virstor X-SVN-Group: head X-SVN-Commit-Author: delphij X-SVN-Commit-Paths: in head/sys/geom: cache concat eli label mirror mountver nop raid3 stripe virstor X-SVN-Commit-Revision: 363411 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 22 Jul 2020 02:15:23 -0000 Author: delphij Date: Wed Jul 22 02:15:21 2020 New Revision: 363411 URL: https://svnweb.freebsd.org/changeset/base/363411 Log: Consistently use gctl_get_provider instead of home-grown variants. Reviewed by: cem, imp MFC after: 2 weeks Differential revision: https://reviews.freebsd.org/D25739 Modified: head/sys/geom/cache/g_cache.c head/sys/geom/concat/g_concat.c head/sys/geom/eli/g_eli_ctl.c head/sys/geom/label/g_label.c head/sys/geom/mirror/g_mirror_ctl.c head/sys/geom/mountver/g_mountver.c head/sys/geom/nop/g_nop.c head/sys/geom/raid3/g_raid3_ctl.c head/sys/geom/stripe/g_stripe.c head/sys/geom/virstor/g_virstor.c Modified: head/sys/geom/cache/g_cache.c ============================================================================== --- head/sys/geom/cache/g_cache.c Wed Jul 22 02:14:27 2020 (r363410) +++ head/sys/geom/cache/g_cache.c Wed Jul 22 02:15:21 2020 (r363411) @@ -757,19 +757,9 @@ g_cache_ctl_create(struct gctl_req *req, struct g_clas /* This field is not important here. */ md.md_provsize = 0; - name = gctl_get_asciiparam(req, "arg1"); - if (name == NULL) { - gctl_error(req, "No 'arg1' argument"); + pp = gctl_get_provider(req, "arg1"); + if (pp == NULL) return; - } - if (strncmp(name, _PATH_DEV, strlen(_PATH_DEV)) == 0) - name += strlen(_PATH_DEV); - pp = g_provider_by_name(name); - if (pp == NULL) { - G_CACHE_DEBUG(1, "Provider %s is invalid.", name); - gctl_error(req, "Provider %s is invalid.", name); - return; - } gp = g_cache_create(mp, pp, &md, G_CACHE_TYPE_MANUAL); if (gp == NULL) { gctl_error(req, "Can't create %s.", md.md_name); Modified: head/sys/geom/concat/g_concat.c ============================================================================== --- head/sys/geom/concat/g_concat.c Wed Jul 22 02:14:27 2020 (r363410) +++ head/sys/geom/concat/g_concat.c Wed Jul 22 02:15:21 2020 (r363411) @@ -840,19 +840,9 @@ g_concat_ctl_create(struct gctl_req *req, struct g_cla /* Check all providers are valid */ for (no = 1; no < *nargs; no++) { snprintf(param, sizeof(param), "arg%u", no); - name = gctl_get_asciiparam(req, param); - if (name == NULL) { - gctl_error(req, "No 'arg%u' argument.", no); + pp = gctl_get_provider(req, param); + if (pp == NULL) return; - } - if (strncmp(name, _PATH_DEV, strlen(_PATH_DEV)) == 0) - name += strlen(_PATH_DEV); - pp = g_provider_by_name(name); - if (pp == NULL) { - G_CONCAT_DEBUG(1, "Disk %s is invalid.", name); - gctl_error(req, "Disk %s is invalid.", name); - return; - } } gp = g_concat_create(mp, &md, G_CONCAT_TYPE_MANUAL); @@ -866,15 +856,13 @@ g_concat_ctl_create(struct gctl_req *req, struct g_cla sbuf_printf(sb, "Can't attach disk(s) to %s:", gp->name); for (attached = 0, no = 1; no < *nargs; no++) { snprintf(param, sizeof(param), "arg%u", no); - name = gctl_get_asciiparam(req, param); - if (name == NULL) { - gctl_error(req, "No 'arg%d' argument.", no); - return; + pp = gctl_get_provider(req, param); + if (pp == NULL) { + name = gctl_get_asciiparam(req, param); + MPASS(name != NULL); + sbuf_printf(sb, " %s", name); + continue; } - if (strncmp(name, _PATH_DEV, strlen(_PATH_DEV)) == 0) - name += strlen(_PATH_DEV); - pp = g_provider_by_name(name); - KASSERT(pp != NULL, ("Provider %s disappear?!", name)); if (g_concat_add_disk(sc, pp, no - 1) != 0) { G_CONCAT_DEBUG(1, "Disk %u (%s) not attached to %s.", no, pp->name, gp->name); Modified: head/sys/geom/eli/g_eli_ctl.c ============================================================================== --- head/sys/geom/eli/g_eli_ctl.c Wed Jul 22 02:14:27 2020 (r363410) +++ head/sys/geom/eli/g_eli_ctl.c Wed Jul 22 02:15:21 2020 (r363411) @@ -58,7 +58,6 @@ g_eli_ctl_attach(struct gctl_req *req, struct g_class { struct g_eli_metadata md; struct g_provider *pp; - const char *name; u_char *key, mkey[G_ELI_DATAIVKEYLEN]; int *nargs, *detach, *readonly, *dryrunp; int keysize, error, nkey, dryrun, dummy; @@ -115,22 +114,13 @@ g_eli_ctl_attach(struct gctl_req *req, struct g_class return; } - name = gctl_get_asciiparam(req, "arg0"); - if (name == NULL) { - gctl_error(req, "No 'arg%u' argument.", 0); + pp = gctl_get_provider(req, "arg0"); + if (pp == NULL) return; - } - if (strncmp(name, _PATH_DEV, strlen(_PATH_DEV)) == 0) - name += strlen(_PATH_DEV); - pp = g_provider_by_name(name); - if (pp == NULL) { - gctl_error(req, "Provider %s is invalid.", name); - return; - } error = g_eli_read_metadata(mp, pp, &md); if (error != 0) { gctl_error(req, "Cannot read metadata from %s (error=%d).", - name, error); + pp->name, error); return; } if (md.md_keys == 0x00) { @@ -368,18 +358,9 @@ g_eli_ctl_onetime(struct gctl_req *req, struct g_class /* Not important here. */ bzero(md.md_hash, sizeof(md.md_hash)); - name = gctl_get_asciiparam(req, "arg0"); - if (name == NULL) { - gctl_error(req, "No 'arg%u' argument.", 0); + pp = gctl_get_provider(req, "arg0"); + if (pp == NULL) return; - } - if (strncmp(name, _PATH_DEV, strlen(_PATH_DEV)) == 0) - name += strlen(_PATH_DEV); - pp = g_provider_by_name(name); - if (pp == NULL) { - gctl_error(req, "Provider %s is invalid.", name); - return; - } sectorsize = gctl_get_paraml(req, "sectorsize", sizeof(*sectorsize)); if (sectorsize == NULL) { Modified: head/sys/geom/label/g_label.c ============================================================================== --- head/sys/geom/label/g_label.c Wed Jul 22 02:14:27 2020 (r363410) +++ head/sys/geom/label/g_label.c Wed Jul 22 02:15:21 2020 (r363411) @@ -437,19 +437,9 @@ g_label_ctl_create(struct gctl_req *req, struct g_clas /* * arg1 is the name of provider. */ - name = gctl_get_asciiparam(req, "arg1"); - if (name == NULL) { - gctl_error(req, "No 'arg%d' argument", 1); + pp = gctl_get_provider(req, "arg1"); + if (pp == NULL) return; - } - if (strncmp(name, _PATH_DEV, strlen(_PATH_DEV)) == 0) - name += strlen(_PATH_DEV); - pp = g_provider_by_name(name); - if (pp == NULL) { - G_LABEL_DEBUG(1, "Provider %s is invalid.", name); - gctl_error(req, "Provider %s is invalid.", name); - return; - } /* * arg0 is the label. */ Modified: head/sys/geom/mirror/g_mirror_ctl.c ============================================================================== --- head/sys/geom/mirror/g_mirror_ctl.c Wed Jul 22 02:14:27 2020 (r363410) +++ head/sys/geom/mirror/g_mirror_ctl.c Wed Jul 22 02:15:21 2020 (r363411) @@ -441,34 +441,25 @@ g_mirror_ctl_create(struct gctl_req *req, struct g_cla cp = g_new_consumer(gp); for (no = 1; no < *nargs; no++) { snprintf(param, sizeof(param), "arg%u", no); - name = gctl_get_asciiparam(req, param); - if (name == NULL) { - gctl_error(req, "No 'arg%u' argument.", no); + pp = gctl_get_provider(req, param); + if (pp == NULL) { err: g_destroy_consumer(cp); g_destroy_geom(gp); g_topology_unlock(); return; } - if (strncmp(name, _PATH_DEV, strlen(_PATH_DEV)) == 0) - name += strlen(_PATH_DEV); - pp = g_provider_by_name(name); - if (pp == NULL) { - G_MIRROR_DEBUG(1, "Disk %s is invalid.", name); - gctl_error(req, "Disk %s is invalid.", name); - goto err; - } g_attach(cp, pp); if (g_access(cp, 1, 0, 0) != 0) { - G_MIRROR_DEBUG(1, "Can't open disk %s.", name); - gctl_error(req, "Can't open disk %s.", name); + G_MIRROR_DEBUG(1, "Can't open disk %s.", pp->name); + gctl_error(req, "Can't open disk %s.", pp->name); err2: g_detach(cp); goto err; } if (pp->mediasize == 0 || pp->sectorsize == 0) { - G_MIRROR_DEBUG(1, "Disk %s has no media.", name); - gctl_error(req, "Disk %s has no media.", name); + G_MIRROR_DEBUG(1, "Disk %s has no media.", pp->name); + gctl_error(req, "Disk %s has no media.", pp->name); g_access(cp, -1, 0, 0); goto err2; } @@ -500,12 +491,10 @@ err2: sbuf_printf(sb, "Can't attach disk(s) to %s:", gp->name); for (attached = 0, no = 1; no < *nargs; no++) { snprintf(param, sizeof(param), "arg%u", no); - name = gctl_get_asciiparam(req, param); - if (strncmp(name, _PATH_DEV, strlen(_PATH_DEV)) == 0) - name += strlen(_PATH_DEV); - pp = g_provider_by_name(name); + pp = gctl_get_provider(req, param); if (pp == NULL) { - G_MIRROR_DEBUG(1, "Provider %s disappear?!", name); + name = gctl_get_asciiparam(req, param); + MPASS(name != NULL); sbuf_printf(sb, " %s", name); continue; } @@ -677,30 +666,21 @@ g_mirror_ctl_insert(struct gctl_req *req, struct g_cla g_topology_lock(); for (i = 1, n = 0; i < (u_int)*nargs; i++) { snprintf(param, sizeof(param), "arg%u", i); - name = gctl_get_asciiparam(req, param); - if (name == NULL) { - gctl_error(req, "No 'arg%u' argument.", i); + pp = gctl_get_provider(req, param); + if (pp == NULL) continue; - } - if (g_mirror_find_disk(sc, name) != NULL) { - gctl_error(req, "Provider %s already inserted.", name); + if (g_mirror_find_disk(sc, pp->name) != NULL) { + gctl_error(req, "Provider %s already inserted.", pp->name); continue; } - if (strncmp(name, _PATH_DEV, 5) == 0) - name += 5; - pp = g_provider_by_name(name); - if (pp == NULL) { - gctl_error(req, "Unknown provider %s.", name); - continue; - } cp = g_new_consumer(sc->sc_geom); if (g_attach(cp, pp) != 0) { g_destroy_consumer(cp); - gctl_error(req, "Cannot attach to provider %s.", name); + gctl_error(req, "Cannot attach to provider %s.", pp->name); continue; } if (g_access(cp, 0, 1, 1) != 0) { - gctl_error(req, "Cannot access provider %s.", name); + gctl_error(req, "Cannot access provider %s.", pp->name); err: g_detach(cp); g_destroy_consumer(cp); @@ -709,14 +689,14 @@ err: mdsize = (sc->sc_type == G_MIRROR_TYPE_AUTOMATIC) ? pp->sectorsize : 0; if (sc->sc_provider->mediasize > pp->mediasize - mdsize) { - gctl_error(req, "Provider %s too small.", name); + gctl_error(req, "Provider %s too small.", pp->name); err2: g_access(cp, 0, -1, -1); goto err; } if ((sc->sc_provider->sectorsize % pp->sectorsize) != 0) { gctl_error(req, "Invalid sectorsize of provider %s.", - name); + pp->name); goto err2; } if (sc->sc_type != G_MIRROR_TYPE_AUTOMATIC) { @@ -731,7 +711,7 @@ err2: md.md_dflags |= G_MIRROR_DISK_FLAG_INACTIVE; if (g_mirror_add_disk(sc, pp, &md) != 0) { sc->sc_ndisks--; - gctl_error(req, "Disk %s not inserted.", name); + gctl_error(req, "Disk %s not inserted.", pp->name); } g_topology_lock(); continue; Modified: head/sys/geom/mountver/g_mountver.c ============================================================================== --- head/sys/geom/mountver/g_mountver.c Wed Jul 22 02:14:27 2020 (r363410) +++ head/sys/geom/mountver/g_mountver.c Wed Jul 22 02:15:21 2020 (r363411) @@ -404,7 +404,6 @@ static void g_mountver_ctl_create(struct gctl_req *req, struct g_class *mp) { struct g_provider *pp; - const char *name; char param[16]; int i, *nargs; @@ -421,19 +420,9 @@ g_mountver_ctl_create(struct gctl_req *req, struct g_c } for (i = 0; i < *nargs; i++) { snprintf(param, sizeof(param), "arg%d", i); - name = gctl_get_asciiparam(req, param); - if (name == NULL) { - gctl_error(req, "No 'arg%d' argument", i); + pp = gctl_get_provider(req, param); + if (pp == NULL) return; - } - if (strncmp(name, _PATH_DEV, strlen(_PATH_DEV)) == 0) - name += strlen(_PATH_DEV); - pp = g_provider_by_name(name); - if (pp == NULL) { - G_MOUNTVER_DEBUG(1, "Provider %s is invalid.", name); - gctl_error(req, "Provider %s is invalid.", name); - return; - } if (g_mountver_create(req, mp, pp) != 0) return; } Modified: head/sys/geom/nop/g_nop.c ============================================================================== --- head/sys/geom/nop/g_nop.c Wed Jul 22 02:14:27 2020 (r363410) +++ head/sys/geom/nop/g_nop.c Wed Jul 22 02:15:21 2020 (r363411) @@ -544,7 +544,7 @@ g_nop_ctl_create(struct gctl_req *req, struct g_class intmax_t *val, error, rfailprob, wfailprob, count_until_fail, offset, secsize, size, stripesize, stripeoffset, delaymsec, rdelayprob, wdelayprob; - const char *name, *physpath, *gnopname; + const char *physpath, *gnopname; char param[16]; int i, *nargs; @@ -671,19 +671,9 @@ g_nop_ctl_create(struct gctl_req *req, struct g_class for (i = 0; i < *nargs; i++) { snprintf(param, sizeof(param), "arg%d", i); - name = gctl_get_asciiparam(req, param); - if (name == NULL) { - gctl_error(req, "No 'arg%d' argument", i); + pp = gctl_get_provider(req, param); + if (pp == NULL) return; - } - if (strncmp(name, _PATH_DEV, strlen(_PATH_DEV)) == 0) - name += strlen(_PATH_DEV); - pp = g_provider_by_name(name); - if (pp == NULL) { - G_NOP_DEBUG(1, "Provider %s is invalid.", name); - gctl_error(req, "Provider %s is invalid.", name); - return; - } if (g_nop_create(req, mp, pp, gnopname, error == -1 ? EIO : (int)error, @@ -708,7 +698,6 @@ g_nop_ctl_configure(struct gctl_req *req, struct g_cla struct g_provider *pp; intmax_t *val, delaymsec, error, rdelayprob, rfailprob, wdelayprob, wfailprob, count_until_fail; - const char *name; char param[16]; int i, *nargs; @@ -782,17 +771,12 @@ g_nop_ctl_configure(struct gctl_req *req, struct g_cla for (i = 0; i < *nargs; i++) { snprintf(param, sizeof(param), "arg%d", i); - name = gctl_get_asciiparam(req, param); - if (name == NULL) { - gctl_error(req, "No 'arg%d' argument", i); + pp = gctl_get_provider(req, param); + if (pp == NULL) return; - } - if (strncmp(name, _PATH_DEV, strlen(_PATH_DEV)) == 0) - name += strlen(_PATH_DEV); - pp = g_provider_by_name(name); - if (pp == NULL || pp->geom->class != mp) { - G_NOP_DEBUG(1, "Provider %s is invalid.", name); - gctl_error(req, "Provider %s is invalid.", name); + if (pp->geom->class != mp) { + G_NOP_DEBUG(1, "Provider %s is invalid.", pp->name); + gctl_error(req, "Provider %s is invalid.", pp->name); return; } sc = pp->geom->softc; @@ -879,7 +863,6 @@ g_nop_ctl_reset(struct gctl_req *req, struct g_class * { struct g_nop_softc *sc; struct g_provider *pp; - const char *name; char param[16]; int i, *nargs; @@ -897,17 +880,12 @@ g_nop_ctl_reset(struct gctl_req *req, struct g_class * for (i = 0; i < *nargs; i++) { snprintf(param, sizeof(param), "arg%d", i); - name = gctl_get_asciiparam(req, param); - if (name == NULL) { - gctl_error(req, "No 'arg%d' argument", i); + pp = gctl_get_provider(req, param); + if (pp == NULL) return; - } - if (strncmp(name, _PATH_DEV, strlen(_PATH_DEV)) == 0) - name += strlen(_PATH_DEV); - pp = g_provider_by_name(name); - if (pp == NULL || pp->geom->class != mp) { - G_NOP_DEBUG(1, "Provider %s is invalid.", name); - gctl_error(req, "Provider %s is invalid.", name); + if (pp->geom->class != mp) { + G_NOP_DEBUG(1, "Provider %s is invalid.", pp->name); + gctl_error(req, "Provider %s is invalid.", pp->name); return; } sc = pp->geom->softc; Modified: head/sys/geom/raid3/g_raid3_ctl.c ============================================================================== --- head/sys/geom/raid3/g_raid3_ctl.c Wed Jul 22 02:14:27 2020 (r363410) +++ head/sys/geom/raid3/g_raid3_ctl.c Wed Jul 22 02:15:21 2020 (r363411) @@ -422,24 +422,13 @@ g_raid3_ctl_insert(struct gctl_req *req, struct g_clas gctl_error(req, "No '%s' argument.", "hardcode"); return; } - name = gctl_get_asciiparam(req, "arg1"); - if (name == NULL) { - gctl_error(req, "No 'arg%u' argument.", 1); + pp = gctl_get_provider(req, "arg1"); + if (pp == NULL) return; - } if (gctl_get_param(req, "number", NULL) != NULL) no = gctl_get_paraml(req, "number", sizeof(*no)); else no = NULL; - if (strncmp(name, _PATH_DEV, 5) == 0) - name += 5; - g_topology_lock(); - pp = g_provider_by_name(name); - if (pp == NULL) { - g_topology_unlock(); - gctl_error(req, "Invalid provider."); - return; - } gp = g_new_geomf(mp, "raid3:insert"); gp->orphan = g_raid3_ctl_insert_orphan; cp = g_new_consumer(gp); Modified: head/sys/geom/stripe/g_stripe.c ============================================================================== --- head/sys/geom/stripe/g_stripe.c Wed Jul 22 02:14:27 2020 (r363410) +++ head/sys/geom/stripe/g_stripe.c Wed Jul 22 02:15:21 2020 (r363411) @@ -1091,19 +1091,9 @@ g_stripe_ctl_create(struct gctl_req *req, struct g_cla /* Check all providers are valid */ for (no = 1; no < *nargs; no++) { snprintf(param, sizeof(param), "arg%u", no); - name = gctl_get_asciiparam(req, param); - if (name == NULL) { - gctl_error(req, "No 'arg%u' argument.", no); + pp = gctl_get_provider(req, param); + if (pp == NULL) return; - } - if (strncmp(name, _PATH_DEV, strlen(_PATH_DEV)) == 0) - name += strlen(_PATH_DEV); - pp = g_provider_by_name(name); - if (pp == NULL) { - G_STRIPE_DEBUG(1, "Disk %s is invalid.", name); - gctl_error(req, "Disk %s is invalid.", name); - return; - } } gp = g_stripe_create(mp, &md, G_STRIPE_TYPE_MANUAL); @@ -1117,15 +1107,13 @@ g_stripe_ctl_create(struct gctl_req *req, struct g_cla sbuf_printf(sb, "Can't attach disk(s) to %s:", gp->name); for (attached = 0, no = 1; no < *nargs; no++) { snprintf(param, sizeof(param), "arg%u", no); - name = gctl_get_asciiparam(req, param); - if (name == NULL) { - gctl_error(req, "No 'arg%u' argument.", no); + pp = gctl_get_provider(req, param); + if (pp == NULL) { + name = gctl_get_asciiparam(req, param); + MPASS(name != NULL); + sbuf_printf(sb, " %s", name); continue; } - if (strncmp(name, _PATH_DEV, strlen(_PATH_DEV)) == 0) - name += strlen(_PATH_DEV); - pp = g_provider_by_name(name); - KASSERT(pp != NULL, ("Provider %s disappear?!", name)); if (g_stripe_add_disk(sc, pp, no - 1) != 0) { G_STRIPE_DEBUG(1, "Disk %u (%s) not attached to %s.", no, pp->name, gp->name); Modified: head/sys/geom/virstor/g_virstor.c ============================================================================== --- head/sys/geom/virstor/g_virstor.c Wed Jul 22 02:14:27 2020 (r363410) +++ head/sys/geom/virstor/g_virstor.c Wed Jul 22 02:15:21 2020 (r363411) @@ -313,32 +313,19 @@ virstor_ctl_add(struct gctl_req *req, struct g_class * for (i = 1; i < *nargs; i++) { struct g_virstor_metadata md; char aname[8]; - const char *prov_name; struct g_provider *pp; struct g_consumer *cp; u_int nc; u_int j; snprintf(aname, sizeof aname, "arg%d", i); - prov_name = gctl_get_asciiparam(req, aname); - if (prov_name == NULL) { - gctl_error(req, "Error fetching argument '%s'", aname); - g_topology_unlock(); - return; - } - if (strncmp(prov_name, _PATH_DEV, sizeof(_PATH_DEV) - 1) == 0) - prov_name += sizeof(_PATH_DEV) - 1; - - pp = g_provider_by_name(prov_name); + pp = gctl_get_provider(req, aname); if (pp == NULL) { /* This is the most common error so be verbose about it */ if (added != 0) { - gctl_error(req, "Invalid provider: '%s' (added" - " %u components)", prov_name, added); + gctl_error(req, "Invalid provider. (added" + " %u components)", added); update_metadata(sc); - } else { - gctl_error(req, "Invalid provider: '%s'", - prov_name); } g_topology_unlock(); return; From owner-svn-src-all@freebsd.org Wed Jul 22 06:45:24 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D2D44374510; Wed, 22 Jul 2020 06:45:24 +0000 (UTC) (envelope-from thj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BBQvS5CS4z3X4D; Wed, 22 Jul 2020 06:45:24 +0000 (UTC) (envelope-from thj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 977392B499; Wed, 22 Jul 2020 06:45:24 +0000 (UTC) (envelope-from thj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06M6jOH9029554; Wed, 22 Jul 2020 06:45:24 GMT (envelope-from thj@FreeBSD.org) Received: (from thj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06M6jOO5029553; Wed, 22 Jul 2020 06:45:24 GMT (envelope-from thj@FreeBSD.org) Message-Id: <202007220645.06M6jOO5029553@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: thj set sender to thj@FreeBSD.org using -f From: Tom Jones Date: Wed, 22 Jul 2020 06:45:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r363412 - stable/12/usr.sbin/pkg X-SVN-Group: stable-12 X-SVN-Commit-Author: thj X-SVN-Commit-Paths: stable/12/usr.sbin/pkg X-SVN-Commit-Revision: 363412 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 22 Jul 2020 06:45:24 -0000 Author: thj Date: Wed Jul 22 06:45:24 2020 New Revision: 363412 URL: https://svnweb.freebsd.org/changeset/base/363412 Log: MFC r362541: pkg: Provide a friendlier message when bootstrap fails due to address resolution The current message when bootstapping pkg fails for any reason implies that pkg is not available. We have the error code from fetch so if bootstrap failed due to address resolution say so. Reviewed by: bapt, bz Approved by: bz (co-mentor) Differential Revision: https://reviews.freebsd.org/D25323 Modified: stable/12/usr.sbin/pkg/pkg.c Directory Properties: stable/12/ (props changed) Modified: stable/12/usr.sbin/pkg/pkg.c ============================================================================== --- stable/12/usr.sbin/pkg/pkg.c Wed Jul 22 02:15:21 2020 (r363411) +++ stable/12/usr.sbin/pkg/pkg.c Wed Jul 22 06:45:24 2020 (r363412) @@ -915,10 +915,15 @@ bootstrap_pkg(bool force) fetchfail: warnx("Error fetching %s: %s", url, fetchLastErrString); - fprintf(stderr, "A pre-built version of pkg could not be found for " - "your system.\n"); - fprintf(stderr, "Consider changing PACKAGESITE or installing it from " - "ports: 'ports-mgmt/pkg'.\n"); + if (fetchLastErrCode == FETCH_RESOLV) { + fprintf(stderr, "Address resolution failed for %s.\n", packagesite); + fprintf(stderr, "Consider changing PACKAGESITE.\n"); + } else { + fprintf(stderr, "A pre-built version of pkg could not be found for " + "your system.\n"); + fprintf(stderr, "Consider changing PACKAGESITE or installing it from " + "ports: 'ports-mgmt/pkg'.\n"); + } cleanup: if (fd_sig != -1) { From owner-svn-src-all@freebsd.org Wed Jul 22 06:47:39 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0C7323747B9; Wed, 22 Jul 2020 06:47:39 +0000 (UTC) (envelope-from thj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BBQy26XVYz3Wvb; Wed, 22 Jul 2020 06:47:38 +0000 (UTC) (envelope-from thj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C326A2B1BB; Wed, 22 Jul 2020 06:47:38 +0000 (UTC) (envelope-from thj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06M6lcf6029714; Wed, 22 Jul 2020 06:47:38 GMT (envelope-from thj@FreeBSD.org) Received: (from thj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06M6lcXH029713; Wed, 22 Jul 2020 06:47:38 GMT (envelope-from thj@FreeBSD.org) Message-Id: <202007220647.06M6lcXH029713@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: thj set sender to thj@FreeBSD.org using -f From: Tom Jones Date: Wed, 22 Jul 2020 06:47:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r363413 - stable/12/sys/netinet X-SVN-Group: stable-12 X-SVN-Commit-Author: thj X-SVN-Commit-Paths: stable/12/sys/netinet X-SVN-Commit-Revision: 363413 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 22 Jul 2020 06:47:39 -0000 Author: thj Date: Wed Jul 22 06:47:38 2020 New Revision: 363413 URL: https://svnweb.freebsd.org/changeset/base/363413 Log: MFC r350749, r362275 r350749: Rename IPPROTO 33 from SEP to DCCP IPPROTO 33 is DCCP in the IANA Registry: https://www.iana.org/assignments/protocol-numbers/protocol-numbers.xhtml IPPROTO_SEP was added about 20 years ago in r33804. The entries were added straight from RFC1700, without regard to whether they were used. The reference in RFC1700 for SEP is '[JC120] ', this is an indication that the protocol number was probably in use in a private network. As RFC1700 is no longer the authoritative list of internet numbers and that IANA assinged 33 to DCCP in RFC4340, change the header to the actual authoritative source. Reviewed by: Richard Scheffenegger, bz Approved by: bz (mentor) Differential Revision: https://reviews.freebsd.org/D21178 r362275: Add header definition for RFC4340, Datagram Congestion Control Protocol Add a header definition for DCCP as defined in RFC4340. This header definition is required to perform validation when receiving and forwarding DCCP packets. We do not currently support DCCP. Reviewed by: gallatin, bz Approved by: bz (co-mentor) MFC with: 350749 Differential Revision: https://reviews.freebsd.org/D21179 Added: stable/12/sys/netinet/dccp.h - copied unchanged from r362275, head/sys/netinet/dccp.h Modified: stable/12/sys/netinet/in.h Directory Properties: stable/12/ (props changed) Copied: stable/12/sys/netinet/dccp.h (from r362275, head/sys/netinet/dccp.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/12/sys/netinet/dccp.h Wed Jul 22 06:47:38 2020 (r363413, copy of r362275, head/sys/netinet/dccp.h) @@ -0,0 +1,78 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2019 Tom Jones + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _NETINET_DCCP_H_ +#define _NETINET_DCCP_H_ + +/* DCCP protocol header as per RFC4340 */ +struct dccphdr { + uint16_t d_sport; + uint16_t d_dport; + uint8_t d_doff; +#if BYTE_ORDER == LITTLE_ENDIAN + uint8_t d_cscov:4, + d_ccval:4; +#endif +#if BYTE_ORDER == BIG_ENDIAN + uint8_t d_ccval:4, + d_cscov:4; +#endif + uint8_t d_cksum[2]; +#if BYTE_ORDER == LITTLE_ENDIAN + uint8_t d_res:3, + d_type:4, + d_x:1; +#endif +#if BYTE_ORDER == BIG_ENDIAN + uint8_t d_x:1, + d_type:4, + d_res:3; +#endif + /* + * Provide enough space for both the short (24 bit) sequence number and + * the long (48 bit) sequene number and a leading reserved byte in + * front of the long sequence number. + */ + union dccp_seqno { + uint8_t shortseq[3]; + struct dccp_long_seqno { + uint8_t res; + uint8_t seq[6]; + } longseq; + } d_seqno; +}; + +#define d_seqno_short d_seqno.shortseq; +#define d_seqno_long d_seqno.longseq.seq; + +#define DCCP_SHORTHDR 12 +#define DCCP_LONGHDR 16 +#define DCCP_EXTHDR 0x80 + +#endif /* _NETINET_DCCP_H */ Modified: stable/12/sys/netinet/in.h ============================================================================== --- stable/12/sys/netinet/in.h Wed Jul 22 06:45:24 2020 (r363412) +++ stable/12/sys/netinet/in.h Wed Jul 22 06:47:38 2020 (r363413) @@ -169,7 +169,7 @@ __END_DECLS #define IPPROTO_BLT 30 /* Bulk Data Transfer */ #define IPPROTO_NSP 31 /* Network Services */ #define IPPROTO_INP 32 /* Merit Internodal */ -#define IPPROTO_SEP 33 /* Sequential Exchange */ +#define IPPROTO_DCCP 33 /* Datagram Congestion Control Protocol */ #define IPPROTO_3PC 34 /* Third Party Connect */ #define IPPROTO_IDPR 35 /* InterDomain Policy Routing */ #define IPPROTO_XTP 36 /* XTP */ From owner-svn-src-all@freebsd.org Wed Jul 22 09:04:57 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8F22937715B for ; Wed, 22 Jul 2020 09:04:57 +0000 (UTC) (envelope-from gbe@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BBV0T32mbz3dqZ; Wed, 22 Jul 2020 09:04:57 +0000 (UTC) (envelope-from gbe@freebsd.org) Received: from localhost (p4fd3ae86.dip0.t-ipconnect.de [79.211.174.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: gbe) by smtp.freebsd.org (Postfix) with ESMTPSA id E54A72DC39; Wed, 22 Jul 2020 09:04:56 +0000 (UTC) (envelope-from gbe@freebsd.org) Date: Wed, 22 Jul 2020 11:04:54 +0200 From: Gordon Bergling To: Fabian Keil Cc: svn-src-all@freebsd.org Subject: Re: svn commit: r363363 - head/lib/geom/eli Message-ID: <20200722090454.GA82481@lion.0xfce3.net> References: <202007201324.06KDOoti077929@repo.freebsd.org> <20200721155419.4b127dac@fabiankeil.de> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="YiEDa0DAkWCtVeE4" Content-Disposition: inline In-Reply-To: <20200721155419.4b127dac@fabiankeil.de> X-Url: X-Operating-System: FreeBSD 12.1-STABLE amd64 X-Host-Uptime: 10:58AM up 6 days, 15:08, 6 users, load averages: 0.21, 0.37, 0.35 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 22 Jul 2020 09:04:57 -0000 --YiEDa0DAkWCtVeE4 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Jul 21, 2020 at 03:54:19PM +0200, Fabian Keil wrote: > Gordon Bergling wrote: >=20 > > Author: gbe (doc committer) > > Date: Mon Jul 20 13:24:50 2020 > > New Revision: 363363 > > URL: https://svnweb.freebsd.org/changeset/base/363363 > >=20 > > Log: > > geli(8): Add an example on how to use geli(8) with a file as encrypte= d storage > > =20 > > Reviewed by: bcr (mentor) > > Approved by: bcr (mentor) > > MFC after: 1 week > > Differential Revision: https://reviews.freebsd.org/D25741 > >=20 > > Modified: > > head/lib/geom/eli/geli.8 > >=20 > > Modified: head/lib/geom/eli/geli.8 > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=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/lib/geom/eli/geli.8 Mon Jul 20 13:01:19 2020 (r363362) > > +++ head/lib/geom/eli/geli.8 Mon Jul 20 13:24:50 2020 (r363363) > [...] > > +This key should be protected by a passphrase, which > > +is requested when geli init is called. > > +.Bd -literal -offset indent > > +# dd if=3D/dev/random of=3D/root/private0.key bs=3D64 count=3D1 > > +# geli init -K /root/private0.key -s 4096 /dev/md0 > > +Enter new passphrase: > > +Reenter new passphrase: > > +# dd if=3D/dev/random of=3D/dev/md0.eli bs=3D1m >=20 > There seems to be a "geli attach ..." missing after > the "geli init ...". >=20 > > +The call of geli attach will ask for the passphrase. > > +It is recommended to do this procedure after the boot, because otherwi= se > > +the boot process would be waiting for the passphrase input. > > +.Bd -literal -offset indent > > +# geli attach -k /root/private0.key /dev/md0 > > +Enter new passphrase: >=20 > The expected prompt is just "Enter passphrase:". >=20 > Fabian Hi Fabian, your right. I created a differential with the fixes for the example and com= mit your corrections once the differential is approved. --Gordon --YiEDa0DAkWCtVeE4 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQGTBAEBCgB9FiEEYbWI0KY5X7yH/Fy4OQX2V8rP09wFAl8YATVfFIAAAAAALgAo aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldDYx QjU4OEQwQTYzOTVGQkM4N0ZDNUNCODM5MDVGNjU3Q0FDRkQzREMACgkQOQX2V8rP 09yINAf6AxvuA+nGHaYj38AqSzTUTHsaiBMDRF18gUngKEOboB2dzRH9qXN4pSYE y9vRnAXHKxkrmVJdrJkav1PFWpoQAiZTS/IiRRW2+YVxbnsnsnfWK2IXqOxLmZ47 2T1s37ZkQkJpJcINh9Crxz7LBxIhkLthTPvHNIkGVpZOxUy3CfuMA1tQhPmhdj0l f/Uod0oAbPckQ0SqsDuqKp7HmhCdmbIjGWMytXbim7k7KY2apNZKowGULwhCEmDM j5AHD9MGYRX/N85QAVV698TFhWVVrlPaRkqfaCPoYCDYC+IK3J31qe8CVsSpwOeu wVZ272TRImkaa+hOYF/sg2bXGDaddA== =VzkM -----END PGP SIGNATURE----- --YiEDa0DAkWCtVeE4-- From owner-svn-src-all@freebsd.org Wed Jul 22 10:00:14 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3E0B237841D; Wed, 22 Jul 2020 10:00:14 +0000 (UTC) (envelope-from thj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BBWDG0tStz3ym8; Wed, 22 Jul 2020 10:00:14 +0000 (UTC) (envelope-from thj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 018442D3D6; Wed, 22 Jul 2020 10:00:14 +0000 (UTC) (envelope-from thj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06MA0D6g047495; Wed, 22 Jul 2020 10:00:13 GMT (envelope-from thj@FreeBSD.org) Received: (from thj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06MA0Dmq047494; Wed, 22 Jul 2020 10:00:13 GMT (envelope-from thj@FreeBSD.org) Message-Id: <202007221000.06MA0Dmq047494@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: thj set sender to thj@FreeBSD.org using -f From: Tom Jones Date: Wed, 22 Jul 2020 10:00:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r363414 - stable/12/sys/netpfil/ipfw X-SVN-Group: stable-12 X-SVN-Commit-Author: thj X-SVN-Commit-Paths: stable/12/sys/netpfil/ipfw X-SVN-Commit-Revision: 363414 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 22 Jul 2020 10:00:14 -0000 Author: thj Date: Wed Jul 22 10:00:13 2020 New Revision: 363414 URL: https://svnweb.freebsd.org/changeset/base/363414 Log: MFC r363141: Don't print VNET pointer when initializing dummynet When dummynet initializes it prints a debug message with the current VNET pointer unnecessarily revealing kernel memory layout. This appears to be left over from when the first pieces of vimage support were added. PR: 238658 Submitted by: huangfq.daxian@gmail.com Reviewed by: markj, bz, gnn, kp, melifaro Approved by: jtl (co-mentor), bz (co-mentor) Event: July 2020 Bugathon Differential Revision: https://reviews.freebsd.org/D25619 Modified: stable/12/sys/netpfil/ipfw/ip_dummynet.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/netpfil/ipfw/ip_dummynet.c ============================================================================== --- stable/12/sys/netpfil/ipfw/ip_dummynet.c Wed Jul 22 06:47:38 2020 (r363413) +++ stable/12/sys/netpfil/ipfw/ip_dummynet.c Wed Jul 22 10:00:13 2020 (r363414) @@ -2511,7 +2511,6 @@ ip_dn_init(void) { if (dn_cfg.init_done) return; - printf("DUMMYNET %p with IPv6 initialized (100409)\n", curvnet); dn_cfg.init_done = 1; /* Set defaults here. MSVC does not accept initializers, * and this is also useful for vimages From owner-svn-src-all@freebsd.org Wed Jul 22 12:30:32 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9618937B164; Wed, 22 Jul 2020 12:30:32 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BBZYh3QVdz46lH; Wed, 22 Jul 2020 12:30:32 +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 590342F3BC; Wed, 22 Jul 2020 12:30:32 +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 06MCUWh9039624; Wed, 22 Jul 2020 12:30:32 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06MCUVb5039621; Wed, 22 Jul 2020 12:30:31 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202007221230.06MCUVb5039621@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Wed, 22 Jul 2020 12:30:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363415 - in head/sys: kern sys ufs/ffs X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: in head/sys: kern sys ufs/ffs X-SVN-Commit-Revision: 363415 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 22 Jul 2020 12:30:32 -0000 Author: mjg Date: Wed Jul 22 12:30:31 2020 New Revision: 363415 URL: https://svnweb.freebsd.org/changeset/base/363415 Log: lockmgr: add adaptive spinning It is very conservative. Only spinning when LK_ADAPTIVE is passed, only on exclusive lock and never when any waiters are present. buffer cache is remains not spinning. This reduces total sleep times during buildworld etc., but it does not shorten total real time (culprits are contention in the vm subsystem along with slock + upgrade which is not covered). For microbenchmarks: open3_processes -t 52 (open/close of the same file for writing) ops/s: before: 258845 after: 801638 Reviewed by: kib Tested by: pho Differential Revision: https://reviews.freebsd.org/D25753 Modified: head/sys/kern/kern_lock.c head/sys/sys/lockmgr.h head/sys/ufs/ffs/ffs_vnops.c Modified: head/sys/kern/kern_lock.c ============================================================================== --- head/sys/kern/kern_lock.c Wed Jul 22 10:00:13 2020 (r363414) +++ head/sys/kern/kern_lock.c Wed Jul 22 12:30:31 2020 (r363415) @@ -167,6 +167,12 @@ struct lock_class lock_class_lockmgr = { #endif }; +static __read_mostly bool lk_adaptive = true; +static SYSCTL_NODE(_debug, OID_AUTO, lockmgr, CTLFLAG_RD, NULL, "lockmgr debugging"); +SYSCTL_BOOL(_debug_lockmgr, OID_AUTO, adaptive_spinning, CTLFLAG_RW, &lk_adaptive, + 0, ""); +#define lockmgr_delay locks_delay + struct lockmgr_wait { const char *iwmesg; int ipri; @@ -515,7 +521,6 @@ lockmgr_slock_try(struct lock *lk, uintptr_t *xp, int * waiters, if we fail to acquire the shared lock * loop back and retry. */ - *xp = lockmgr_read_value(lk); while (LK_CAN_SHARE(*xp, flags, fp)) { if (atomic_fcmpset_acq_ptr(&lk->lk_lock, xp, *xp + LK_ONE_SHARER)) { @@ -541,6 +546,38 @@ lockmgr_sunlock_try(struct lock *lk, uintptr_t *xp) return (false); } +static bool +lockmgr_slock_adaptive(struct lock_delay_arg *lda, struct lock *lk, uintptr_t *xp, + int flags) +{ + struct thread *owner; + uintptr_t x; + + x = *xp; + MPASS(x != LK_UNLOCKED); + owner = (struct thread *)LK_HOLDER(x); + for (;;) { + MPASS(owner != curthread); + if (owner == (struct thread *)LK_KERNPROC) + return (false); + if ((x & LK_SHARE) && LK_SHARERS(x) > 0) + return (false); + if (owner == NULL) + return (false); + if (!TD_IS_RUNNING(owner)) + return (false); + if ((x & LK_ALL_WAITERS) != 0) + return (false); + lock_delay(lda); + x = lockmgr_read_value(lk); + if (LK_CAN_SHARE(x, flags, false)) { + *xp = x; + return (true); + } + owner = (struct thread *)LK_HOLDER(x); + } +} + static __noinline int lockmgr_slock_hard(struct lock *lk, u_int flags, struct lock_object *ilk, const char *file, int line, struct lockmgr_wait *lwa) @@ -557,6 +594,7 @@ lockmgr_slock_hard(struct lock *lk, u_int flags, struc uint64_t waittime = 0; int contested = 0; #endif + struct lock_delay_arg lda; if (KERNEL_PANICKED()) goto out; @@ -566,9 +604,31 @@ lockmgr_slock_hard(struct lock *lk, u_int flags, struc if (LK_CAN_WITNESS(flags)) WITNESS_CHECKORDER(&lk->lock_object, LOP_NEWORDER, file, line, flags & LK_INTERLOCK ? ilk : NULL); + lock_delay_arg_init(&lda, &lockmgr_delay); + if (!lk_adaptive) + flags &= ~LK_ADAPTIVE; + x = lockmgr_read_value(lk); + /* + * The lock may already be locked exclusive by curthread, + * avoid deadlock. + */ + if (LK_HOLDER(x) == tid) { + LOCK_LOG2(lk, + "%s: %p already held in exclusive mode", + __func__, lk); + error = EDEADLK; + goto out; + } + for (;;) { if (lockmgr_slock_try(lk, &x, flags, false)) break; + + if ((flags & (LK_ADAPTIVE | LK_INTERLOCK)) == LK_ADAPTIVE) { + if (lockmgr_slock_adaptive(&lda, lk, &x, flags)) + continue; + } + #ifdef HWPMC_HOOKS PMC_SOFT_CALL( , , lock, failed); #endif @@ -576,18 +636,6 @@ lockmgr_slock_hard(struct lock *lk, u_int flags, struc &contested, &waittime); /* - * If the lock is already held by curthread in - * exclusive way avoid a deadlock. - */ - if (LK_HOLDER(x) == tid) { - LOCK_LOG2(lk, - "%s: %p already held in exclusive mode", - __func__, lk); - error = EDEADLK; - break; - } - - /* * If the lock is expected to not sleep just give up * and return. */ @@ -660,6 +708,7 @@ retry_sleepq: } LOCK_LOG2(lk, "%s: %p resuming from the sleep queue", __func__, lk); + x = lockmgr_read_value(lk); } if (error == 0) { #ifdef KDTRACE_HOOKS @@ -682,6 +731,37 @@ out: return (error); } +static bool +lockmgr_xlock_adaptive(struct lock_delay_arg *lda, struct lock *lk, uintptr_t *xp) +{ + struct thread *owner; + uintptr_t x; + + x = *xp; + MPASS(x != LK_UNLOCKED); + owner = (struct thread *)LK_HOLDER(x); + for (;;) { + MPASS(owner != curthread); + if (owner == NULL) + return (false); + if ((x & LK_SHARE) && LK_SHARERS(x) > 0) + return (false); + if (owner == (struct thread *)LK_KERNPROC) + return (false); + if (!TD_IS_RUNNING(owner)) + return (false); + if ((x & LK_ALL_WAITERS) != 0) + return (false); + lock_delay(lda); + x = lockmgr_read_value(lk); + if (x == LK_UNLOCKED) { + *xp = x; + return (true); + } + owner = (struct thread *)LK_HOLDER(x); + } +} + static __noinline int lockmgr_xlock_hard(struct lock *lk, u_int flags, struct lock_object *ilk, const char *file, int line, struct lockmgr_wait *lwa) @@ -699,6 +779,7 @@ lockmgr_xlock_hard(struct lock *lk, u_int flags, struc uint64_t waittime = 0; int contested = 0; #endif + struct lock_delay_arg lda; if (KERNEL_PANICKED()) goto out; @@ -747,10 +828,19 @@ lockmgr_xlock_hard(struct lock *lk, u_int flags, struc goto out; } + x = LK_UNLOCKED; + lock_delay_arg_init(&lda, &lockmgr_delay); + if (!lk_adaptive) + flags &= ~LK_ADAPTIVE; for (;;) { - if (lk->lk_lock == LK_UNLOCKED && - atomic_cmpset_acq_ptr(&lk->lk_lock, LK_UNLOCKED, tid)) - break; + if (x == LK_UNLOCKED) { + if (atomic_fcmpset_acq_ptr(&lk->lk_lock, &x, tid)) + break; + } + if ((flags & (LK_ADAPTIVE | LK_INTERLOCK)) == LK_ADAPTIVE) { + if (lockmgr_xlock_adaptive(&lda, lk, &x)) + continue; + } #ifdef HWPMC_HOOKS PMC_SOFT_CALL( , , lock, failed); #endif @@ -853,6 +943,7 @@ retry_sleepq: } LOCK_LOG2(lk, "%s: %p resuming from the sleep queue", __func__, lk); + x = lockmgr_read_value(lk); } if (error == 0) { #ifdef KDTRACE_HOOKS @@ -954,6 +1045,7 @@ lockmgr_lock_flags(struct lock *lk, u_int flags, struc file, line, flags & LK_INTERLOCK ? ilk : NULL); if (__predict_false(lk->lock_object.lo_flags & LK_NOSHARE)) break; + x = lockmgr_read_value(lk); if (lockmgr_slock_try(lk, &x, flags, true)) { lockmgr_note_shared_acquire(lk, 0, 0, file, line, flags); @@ -1139,12 +1231,13 @@ lockmgr_slock(struct lock *lk, u_int flags, const char if (LK_CAN_WITNESS(flags)) WITNESS_CHECKORDER(&lk->lock_object, LOP_NEWORDER, file, line, NULL); + x = lockmgr_read_value(lk); if (__predict_true(lockmgr_slock_try(lk, &x, flags, true))) { lockmgr_note_shared_acquire(lk, 0, 0, file, line, flags); return (0); } - return (lockmgr_slock_hard(lk, flags, NULL, file, line, NULL)); + return (lockmgr_slock_hard(lk, flags | LK_ADAPTIVE, NULL, file, line, NULL)); } int @@ -1165,7 +1258,7 @@ lockmgr_xlock(struct lock *lk, u_int flags, const char return (0); } - return (lockmgr_xlock_hard(lk, flags, NULL, file, line, NULL)); + return (lockmgr_xlock_hard(lk, flags | LK_ADAPTIVE, NULL, file, line, NULL)); } int Modified: head/sys/sys/lockmgr.h ============================================================================== --- head/sys/sys/lockmgr.h Wed Jul 22 10:00:13 2020 (r363414) +++ head/sys/sys/lockmgr.h Wed Jul 22 12:30:31 2020 (r363415) @@ -170,6 +170,7 @@ _lockmgr_args_rw(struct lock *lk, u_int flags, struct #define LK_SLEEPFAIL 0x000800 #define LK_TIMELOCK 0x001000 #define LK_NODDLKTREAT 0x002000 +#define LK_ADAPTIVE 0x004000 /* * Operations for lockmgr(). Modified: head/sys/ufs/ffs/ffs_vnops.c ============================================================================== --- head/sys/ufs/ffs/ffs_vnops.c Wed Jul 22 10:00:13 2020 (r363414) +++ head/sys/ufs/ffs/ffs_vnops.c Wed Jul 22 12:30:31 2020 (r363415) @@ -445,6 +445,7 @@ ffs_lock(ap) struct lock *lkp; int result; + ap->a_flags |= LK_ADAPTIVE; switch (ap->a_flags & LK_TYPE_MASK) { case LK_SHARED: case LK_UPGRADE: @@ -482,6 +483,7 @@ ffs_lock(ap) } return (result); #else + ap->a_flags |= LK_ADAPTIVE; return (VOP_LOCK1_APV(&ufs_vnodeops, ap)); #endif } From owner-svn-src-all@freebsd.org Wed Jul 22 13:00:57 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6EACC37BCFB; Wed, 22 Jul 2020 13:00:57 +0000 (UTC) (envelope-from gbe@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BBbDn2MDMz49Gh; Wed, 22 Jul 2020 13:00:57 +0000 (UTC) (envelope-from gbe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 350B62FB8B; Wed, 22 Jul 2020 13:00:57 +0000 (UTC) (envelope-from gbe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06MD0vA2060344; Wed, 22 Jul 2020 13:00:57 GMT (envelope-from gbe@FreeBSD.org) Received: (from gbe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06MD0v3B060343; Wed, 22 Jul 2020 13:00:57 GMT (envelope-from gbe@FreeBSD.org) Message-Id: <202007221300.06MD0v3B060343@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gbe set sender to gbe@FreeBSD.org using -f From: Gordon Bergling Date: Wed, 22 Jul 2020 13:00:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363416 - head/lib/geom/eli X-SVN-Group: head X-SVN-Commit-Author: gbe X-SVN-Commit-Paths: head/lib/geom/eli X-SVN-Commit-Revision: 363416 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 22 Jul 2020 13:00:57 -0000 Author: gbe (doc committer) Date: Wed Jul 22 13:00:56 2020 New Revision: 363416 URL: https://svnweb.freebsd.org/changeset/base/363416 Log: geli(8): Add missing commands in the EXAMPLES section - Add a missing 'geli attach' command - Fix the passphrase prompt for a 'geli attach' command Reported by: Fabian Keil Reviewed by: bcr (mentor) Approved by: bcr (mentor) Differential Revision: https://reviews.freebsd.org/D25761 Modified: head/lib/geom/eli/geli.8 Modified: head/lib/geom/eli/geli.8 ============================================================================== --- head/lib/geom/eli/geli.8 Wed Jul 22 12:30:31 2020 (r363415) +++ head/lib/geom/eli/geli.8 Wed Jul 22 13:00:56 2020 (r363416) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 20, 2020 +.Dd July 22, 2020 .Dt GELI 8 .Os .Sh NAME @@ -1130,6 +1130,8 @@ is requested when geli init is called. # geli init -K /root/private0.key -s 4096 /dev/md0 Enter new passphrase: Reenter new passphrase: +# geli attach -k /root/private0.key /dev/md0 +Enter passphrase: # dd if=/dev/random of=/dev/md0.eli bs=1m .Ed .Pp @@ -1150,7 +1152,7 @@ It is recommended to do this procedure after the boot, the boot process would be waiting for the passphrase input. .Bd -literal -offset indent # geli attach -k /root/private0.key /dev/md0 -Enter new passphrase: +Enter passphrase: # mount /dev/md0.eli /private .Ed .Sh ENCRYPTION MODES From owner-svn-src-all@freebsd.org Wed Jul 22 13:49:56 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 244D337D14E; Wed, 22 Jul 2020 13:49:56 +0000 (UTC) (envelope-from thj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BBcKJ06bZz4ClL; Wed, 22 Jul 2020 13:49:56 +0000 (UTC) (envelope-from thj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BE6BF8498; Wed, 22 Jul 2020 13:49:55 +0000 (UTC) (envelope-from thj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06MDnt7o089045; Wed, 22 Jul 2020 13:49:55 GMT (envelope-from thj@FreeBSD.org) Received: (from thj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06MDns4N089040; Wed, 22 Jul 2020 13:49:54 GMT (envelope-from thj@FreeBSD.org) Message-Id: <202007221349.06MDns4N089040@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: thj set sender to thj@FreeBSD.org using -f From: Tom Jones Date: Wed, 22 Jul 2020 13:49:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363417 - in head: etc/mtree sbin/route sbin/route/tests X-SVN-Group: head X-SVN-Commit-Author: thj X-SVN-Commit-Paths: in head: etc/mtree sbin/route sbin/route/tests X-SVN-Commit-Revision: 363417 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 22 Jul 2020 13:49:56 -0000 Author: thj Date: Wed Jul 22 13:49:54 2020 New Revision: 363417 URL: https://svnweb.freebsd.org/changeset/base/363417 Log: Add tests for "add", "change" and "delete" functionality of /sbin/route. Add tests to cover "add", "change" and "delete" functionality of /sbin/route for ipv4 and ipv6. These tests for the existing route tool are the first step towards creating libroute. Submitted by: Ahsan Barkati Sponsored by: Google, Inc. (GSoC 2020) Reviewed by: kp, thj Approved by: bz (mentor) MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D25220 Added: head/sbin/route/tests/ head/sbin/route/tests/Makefile (contents, props changed) head/sbin/route/tests/basic.sh (contents, props changed) head/sbin/route/tests/utils.subr (contents, props changed) Modified: head/etc/mtree/BSD.tests.dist head/sbin/route/Makefile Modified: head/etc/mtree/BSD.tests.dist ============================================================================== --- head/etc/mtree/BSD.tests.dist Wed Jul 22 13:00:56 2020 (r363416) +++ head/etc/mtree/BSD.tests.dist Wed Jul 22 13:49:54 2020 (r363417) @@ -448,6 +448,8 @@ .. ping6 .. + route + .. .. secure lib Modified: head/sbin/route/Makefile ============================================================================== --- head/sbin/route/Makefile Wed Jul 22 13:00:56 2020 (r363416) +++ head/sbin/route/Makefile Wed Jul 22 13:49:54 2020 (r363417) @@ -19,6 +19,9 @@ CFLAGS+= -DINET6 .endif CFLAGS+= -I. +HAS_TESTS= +SUBDIR.${MK_TESTS}+= tests + keywords.h: keywords LC_ALL=C awk '!/^#|^$$/ { \ printf "#define\tK_%s\t%d\n\t{\"%s\", K_%s},\n", \ Added: head/sbin/route/tests/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sbin/route/tests/Makefile Wed Jul 22 13:49:54 2020 (r363417) @@ -0,0 +1,11 @@ +# $FreeBSD$ + +PACKAGE= tests + +ATF_TESTS_SH+= \ + basic + +${PACKAGE}FILES+= \ + utils.subr + +.include Added: head/sbin/route/tests/basic.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sbin/route/tests/basic.sh Wed Jul 22 13:49:54 2020 (r363417) @@ -0,0 +1,125 @@ +#- +# SPDX-License-Identifier: BSD-2-Clause-FreeBSD +# +# Copyright (c) 2020 Ahsan Barkati +# +# 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_get_srcdir)/utils.subr + +atf_test_case "basic_v4" "cleanup" +basic_v4_head() +{ + atf_set descr 'add/change/delete route test for v4' + atf_set require.user root + atf_set require.progs jq +} + +basic_v4_body() +{ + epair=$(vnet_mkepair) + ifconfig ${epair}a 192.0.2.2/24 up + vnet_mkjail alcatraz ${epair}b + jexec alcatraz ifconfig ${epair}b 192.0.2.1/24 up + + # add a new route in the jail + jexec alcatraz route add 192.0.2.3 192.0.2.2 + gateway=$(check_route "alcatraz" "192.0.2.3") + + if [ "${gateway}" != "192.0.2.2" ]; then + atf_fail "Failed to add new route." + fi + + # change the added route + jexec alcatraz route change 192.0.2.3 192.0.2.4 + gateway=$(check_route "alcatraz" "192.0.2.3") + + if [ "${gateway}" != "192.0.2.4" ]; then + atf_fail "Failed to change route." + fi + + # delete the route + jexec alcatraz route delete 192.0.2.3 + gateway=$(check_route "alcatraz" "192.0.2.3") + + if [ "${gateway}" != "" ]; then + atf_fail "Failed to delete route." + fi +} + +basic_v4_cleanup() +{ + vnet_cleanup +} + +atf_test_case "basic_v6" "cleanup" +basic_v6_head() +{ + atf_set descr 'add/change/delete route test for v6' + atf_set require.user root + atf_set require.progs jq +} + +basic_v6_body() +{ + epair=$(vnet_mkepair) + ifconfig ${epair}a inet6 2001:db8:cc4b::1/64 up no_dad + vnet_mkjail alcatraz ${epair}b + jexec alcatraz ifconfig ${epair}b inet6 2001:db8:cc4b::2/64 up no_dad + + # add a new route in the jail + jexec alcatraz route add -6 2001:db8:cc4b::3 2001:db8:cc4b::1 + gateway=$(check_route "alcatraz" "2001:db8:cc4b::3") + + if [ "${gateway}" != "2001:db8:cc4b::1" ]; then + atf_fail "Failed to add new route." + fi + + # change the added route + jexec alcatraz route change -6 2001:db8:cc4b::3 2001:db8:cc4b::4 + gateway=$(check_route "alcatraz" "2001:db8:cc4b::3") + if [ "${gateway}" != "2001:db8:cc4b::4" ]; then + atf_fail "Failed to change route." + fi + + # delete the route + jexec alcatraz route -6 delete 2001:db8:cc4b::3 + gateway=$(check_route "alcatraz" "2001:db8:cc4b::3") + + if [ "${gateway}" != "" ]; then + atf_fail "Failed to delete route." + fi +} + +basic_v6_cleanup() +{ + vnet_cleanup +} + +atf_init_test_cases() +{ + atf_add_test_case "basic_v4" + atf_add_test_case "basic_v6" +} Added: head/sbin/route/tests/utils.subr ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sbin/route/tests/utils.subr Wed Jul 22 13:49:54 2020 (r363417) @@ -0,0 +1,47 @@ +#- +# SPDX-License-Identifier: BSD-2-Clause-FreeBSD +# +# Copyright (c) 2020 Ahsan Barkati +# +# 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_get_srcdir)/../../sys/common/vnet.subr + +check_route() +{ + jname=$1 + dest=$2 + result=$(jexec $jname netstat -r --libxo json) + + # This query selects the JSON item from the array of rt-entry + # for which the destination address is $dest + query=".statistics.\"route-information\".\"route-table\".\"rt-family\"[0].\"rt-entry\"[]|select(.destination==\"${dest}\")" + + # Gateway is then extracted from the JSON item as described above + gateway=$(echo $result | jq -r ${query}.gateway) + + echo ${gateway} +} + From owner-svn-src-all@freebsd.org Wed Jul 22 14:22:36 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 99BCA37E1F3; Wed, 22 Jul 2020 14:22:36 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BBd303qL0z4GJC; Wed, 22 Jul 2020 14:22:36 +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 669E58EC6; Wed, 22 Jul 2020 14:22:36 +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 06MEMa5R013542; Wed, 22 Jul 2020 14:22:36 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06MEMZUK013536; Wed, 22 Jul 2020 14:22:35 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202007221422.06MEMZUK013536@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 22 Jul 2020 14:22:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r363418 - in stable/12: share/man/man4 sys/arm64/conf sys/conf sys/dev/safexcel sys/modules sys/modules/safexcel X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in stable/12: share/man/man4 sys/arm64/conf sys/conf sys/dev/safexcel sys/modules sys/modules/safexcel X-SVN-Commit-Revision: 363418 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 22 Jul 2020 14:22:36 -0000 Author: markj Date: Wed Jul 22 14:22:35 2020 New Revision: 363418 URL: https://svnweb.freebsd.org/changeset/base/363418 Log: MFC r363180, r363182, r363251: Add a driver for the SafeXcel EIP-97. Added: stable/12/share/man/man4/safexcel.4 - copied unchanged from r363180, head/share/man/man4/safexcel.4 stable/12/sys/dev/safexcel/ - copied from r363180, head/sys/dev/safexcel/ stable/12/sys/modules/safexcel/ - copied from r363180, head/sys/modules/safexcel/ Modified: stable/12/share/man/man4/Makefile stable/12/sys/arm64/conf/GENERIC stable/12/sys/conf/files.arm64 stable/12/sys/dev/safexcel/safexcel.c stable/12/sys/dev/safexcel/safexcel_var.h stable/12/sys/modules/Makefile Directory Properties: stable/12/ (props changed) Modified: stable/12/share/man/man4/Makefile ============================================================================== --- stable/12/share/man/man4/Makefile Wed Jul 22 13:49:54 2020 (r363417) +++ stable/12/share/man/man4/Makefile Wed Jul 22 14:22:35 2020 (r363418) @@ -461,6 +461,7 @@ MAN= aac.4 \ rue.4 \ sa.4 \ safe.4 \ + safexcel.4 \ sbp.4 \ sbp_targ.4 \ scc.4 \ Copied: stable/12/share/man/man4/safexcel.4 (from r363180, head/share/man/man4/safexcel.4) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/12/share/man/man4/safexcel.4 Wed Jul 22 14:22:35 2020 (r363418, copy of r363180, head/share/man/man4/safexcel.4) @@ -0,0 +1,84 @@ +.\"- +.\" Copyright (c) 2020 Rubicon Communications, LLC (Netgate) +.\" +.\" 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 June 23, 2020 +.Dt SAFEXCEL 4 +.Os +.Sh NAME +.Nm safexcel +.Nd Inside Secure SafeXcel-IP-97 security packet engine +.Sh SYNOPSIS +To compile this driver into the kernel, +place the following lines in your +kernel configuration file: +.Bd -ragged -offset indent +.Cd "device crypto" +.Cd "device cryptodev" +.Cd "device safexcel" +.Ed +.Pp +Alternatively, to load the driver as a +module at boot time, place the following line in +.Xr loader.conf 5 : +.Bd -literal -offset indent +safexcel_load="YES" +.Ed +.Sh DESCRIPTION +The +.Nm +driver implements +.Xr crypto 4 +support for the cryptographic acceleration functions of the EIP-97 device +found on some Marvell systems-on-chip. +The driver can accelerate the following AES modes: +.Pp +.Bl -bullet -compact +.It +AES-CBC +.It +AES-CTR +.It +AES-XTS +.It +AES-GCM +.It +AES-CCM +.El +.Pp +.Nm +also implements SHA1 and SHA2 transforms, and can combine AES-CBC and AES-CTR +with SHA1-HMAC and SHA2-HMAC for encrypt-then-authenticate operations. +.Sh SEE ALSO +.Xr crypto 4 , +.Xr ipsec 4 , +.Xr random 4 , +.Xr geli 8 , +.Xr crypto 9 +.Sh HISTORY +The +.Nm +driver first appeared in +.Fx 13.0 . Modified: stable/12/sys/arm64/conf/GENERIC ============================================================================== --- stable/12/sys/arm64/conf/GENERIC Wed Jul 22 13:49:54 2020 (r363417) +++ stable/12/sys/arm64/conf/GENERIC Wed Jul 22 14:22:35 2020 (r363418) @@ -238,6 +238,9 @@ device mv_ap806_gicp # Marvell AP806 GICP device aw_rtc # Allwinner Real-time Clock device mv_rtc # Marvell Real-time Clock +# Crypto accelerators +device safexcel # Inside Secure EIP-97 + # Watchdog controllers device aw_wdog # Allwinner Watchdog Modified: stable/12/sys/conf/files.arm64 ============================================================================== --- stable/12/sys/conf/files.arm64 Wed Jul 22 13:49:54 2020 (r363417) +++ stable/12/sys/conf/files.arm64 Wed Jul 22 14:22:35 2020 (r363418) @@ -240,6 +240,7 @@ dev/pci/pci_host_generic_fdt.c optional pci fdt dev/psci/psci.c standard dev/psci/psci_arm64.S standard dev/psci/smccc.c standard +dev/safexcel/safexcel.c optional safexcel fdt dev/sdhci/sdhci_xenon.c optional sdhci_xenon sdhci fdt dev/uart/uart_cpu_arm64.c optional uart dev/uart/uart_dev_mu.c optional uart uart_mu Modified: stable/12/sys/dev/safexcel/safexcel.c ============================================================================== --- head/sys/dev/safexcel/safexcel.c Tue Jul 14 14:09:29 2020 (r363180) +++ stable/12/sys/dev/safexcel/safexcel.c Wed Jul 22 14:22:35 2020 (r363418) @@ -901,7 +901,8 @@ static int safexcel_dma_init(struct safexcel_softc *sc) { struct safexcel_ring *ring; - int error, i, size; + bus_size_t size; + int error, i; for (i = 0; i < sc->sc_config.rings; i++) { ring = &sc->sc_ring[i]; @@ -937,8 +938,9 @@ safexcel_dma_init(struct safexcel_softc *sc) (struct safexcel_cmd_descr *)ring->cdr.dma.vaddr; /* Allocate additional CDR token memory. */ - error = safexcel_dma_alloc_mem(sc, &ring->dma_atok, - sc->sc_config.atok_offset * SAFEXCEL_RING_SIZE); + size = (bus_size_t)sc->sc_config.atok_offset * + SAFEXCEL_RING_SIZE; + error = safexcel_dma_alloc_mem(sc, &ring->dma_atok, size); if (error != 0) { device_printf(sc->sc_dev, "failed to allocate atoken DMA memory, error %d\n", @@ -1144,6 +1146,12 @@ safexcel_probe(device_t dev) return (BUS_PROBE_DEFAULT); } +static void +safexcel_crypto_register(struct safexcel_softc *sc, int alg) +{ + (void)crypto_register(sc->sc_cid, alg, SAFEXCEL_MAX_REQUEST_SIZE, 0); +} + static int safexcel_attach(device_t dev) { @@ -1211,6 +1219,26 @@ safexcel_attach(device_t dev) if (sc->sc_cid < 0) goto err2; + safexcel_crypto_register(sc, CRYPTO_AES_CBC); + safexcel_crypto_register(sc, CRYPTO_AES_ICM); + safexcel_crypto_register(sc, CRYPTO_AES_XTS); + safexcel_crypto_register(sc, CRYPTO_AES_CCM_16); + safexcel_crypto_register(sc, CRYPTO_AES_CCM_CBC_MAC); + safexcel_crypto_register(sc, CRYPTO_AES_NIST_GCM_16); + safexcel_crypto_register(sc, CRYPTO_AES_128_NIST_GMAC); + safexcel_crypto_register(sc, CRYPTO_AES_192_NIST_GMAC); + safexcel_crypto_register(sc, CRYPTO_AES_256_NIST_GMAC); + safexcel_crypto_register(sc, CRYPTO_SHA1); + safexcel_crypto_register(sc, CRYPTO_SHA1_HMAC); + safexcel_crypto_register(sc, CRYPTO_SHA2_224); + safexcel_crypto_register(sc, CRYPTO_SHA2_224_HMAC); + safexcel_crypto_register(sc, CRYPTO_SHA2_256); + safexcel_crypto_register(sc, CRYPTO_SHA2_256_HMAC); + safexcel_crypto_register(sc, CRYPTO_SHA2_384); + safexcel_crypto_register(sc, CRYPTO_SHA2_384_HMAC); + safexcel_crypto_register(sc, CRYPTO_SHA2_512); + safexcel_crypto_register(sc, CRYPTO_SHA2_512_HMAC); + return (0); err2: @@ -1256,7 +1284,6 @@ safexcel_detach(device_t dev) static int safexcel_set_context(struct safexcel_request *req) { - const struct crypto_session_params *csp; struct cryptop *crp; struct safexcel_context_record *ctx; struct safexcel_session *sess; @@ -1264,58 +1291,51 @@ safexcel_set_context(struct safexcel_request *req) int off; crp = req->crp; - csp = crypto_get_params(crp->crp_session); sess = req->sess; ctx = (struct safexcel_context_record *)req->ctx.vaddr; data = (uint8_t *)ctx->data; - if (csp->csp_cipher_alg != 0) { - if (crp->crp_cipher_key != NULL) - memcpy(data, crp->crp_cipher_key, sess->klen); + if (req->enc != NULL) { + if ((req->enc->crd_flags & CRD_F_KEY_EXPLICIT) != 0) + memcpy(data, req->enc->crd_key, sess->klen); else - memcpy(data, csp->csp_cipher_key, sess->klen); + memcpy(data, sess->key, sess->klen); off = sess->klen; - } else if (csp->csp_auth_alg == CRYPTO_AES_NIST_GMAC) { - if (crp->crp_auth_key != NULL) - memcpy(data, crp->crp_auth_key, sess->klen); - else - memcpy(data, csp->csp_auth_key, sess->klen); - off = sess->klen; } else { off = 0; } - switch (csp->csp_cipher_alg) { - case CRYPTO_AES_NIST_GCM_16: - memcpy(data + off, sess->ghash_key, GMAC_BLOCK_LEN); - off += GMAC_BLOCK_LEN; - break; - case CRYPTO_AES_CCM_16: - memcpy(data + off, sess->xcbc_key, - AES_BLOCK_LEN * 2 + sess->klen); - off += AES_BLOCK_LEN * 2 + sess->klen; - break; - case CRYPTO_AES_XTS: - memcpy(data + off, sess->tweak_key, sess->klen); - off += sess->klen; - break; + if (req->enc != NULL) { + switch (req->enc->crd_alg) { + case CRYPTO_AES_NIST_GCM_16: + memcpy(data + off, sess->ghash_key, GMAC_BLOCK_LEN); + off += GMAC_BLOCK_LEN; + break; + case CRYPTO_AES_CCM_16: + memcpy(data + off, sess->xcbc_key, + AES_BLOCK_LEN * 2 + sess->klen); + off += AES_BLOCK_LEN * 2 + sess->klen; + break; + case CRYPTO_AES_XTS: + memcpy(data + off, sess->tweak_key, sess->klen); + off += sess->klen; + break; + } } - switch (csp->csp_auth_alg) { - case CRYPTO_AES_NIST_GMAC: - memcpy(data + off, sess->ghash_key, GMAC_BLOCK_LEN); - off += GMAC_BLOCK_LEN; - break; - case CRYPTO_SHA1_HMAC: - case CRYPTO_SHA2_224_HMAC: - case CRYPTO_SHA2_256_HMAC: - case CRYPTO_SHA2_384_HMAC: - case CRYPTO_SHA2_512_HMAC: - memcpy(data + off, sess->hmac_ipad, sess->statelen); - off += sess->statelen; - memcpy(data + off, sess->hmac_opad, sess->statelen); - off += sess->statelen; - break; + if (req->mac != NULL) { + switch (req->mac->crd_alg) { + case CRYPTO_SHA1_HMAC: + case CRYPTO_SHA2_224_HMAC: + case CRYPTO_SHA2_256_HMAC: + case CRYPTO_SHA2_384_HMAC: + case CRYPTO_SHA2_512_HMAC: + memcpy(data + off, sess->hmac_ipad, sess->statelen); + off += sess->statelen; + memcpy(data + off, sess->hmac_opad, sess->statelen); + off += sess->statelen; + break; + } } return (off); @@ -1331,14 +1351,12 @@ static void safexcel_set_command(struct safexcel_request *req, struct safexcel_cmd_descr *cdesc) { - const struct crypto_session_params *csp; struct cryptop *crp; struct safexcel_session *sess; uint32_t ctrl0, ctrl1, ctxr_len; int alg; crp = req->crp; - csp = crypto_get_params(crp->crp_session); sess = req->sess; ctrl0 = sess->alg | sess->digest | sess->hash; @@ -1347,13 +1365,14 @@ safexcel_set_command(struct safexcel_request *req, ctxr_len = safexcel_set_context(req) / sizeof(uint32_t); ctrl0 |= SAFEXCEL_CONTROL0_SIZE(ctxr_len); - alg = csp->csp_cipher_alg; - if (alg == 0) - alg = csp->csp_auth_alg; + if (req->enc != NULL) + alg = req->enc->crd_alg; + else + alg = req->mac->crd_alg; switch (alg) { case CRYPTO_AES_CCM_16: - if (CRYPTO_OP_IS_ENCRYPT(crp->crp_op)) { + if ((req->enc->crd_flags & CRD_F_ENCRYPT) != 0) { ctrl0 |= SAFEXCEL_CONTROL0_TYPE_HASH_ENCRYPT_OUT | SAFEXCEL_CONTROL0_KEY_EN; } else { @@ -1366,23 +1385,23 @@ safexcel_set_command(struct safexcel_request *req, case CRYPTO_AES_CBC: case CRYPTO_AES_ICM: case CRYPTO_AES_XTS: - if (CRYPTO_OP_IS_ENCRYPT(crp->crp_op)) { + if ((req->enc->crd_flags & CRD_F_ENCRYPT) != 0) { ctrl0 |= SAFEXCEL_CONTROL0_TYPE_CRYPTO_OUT | SAFEXCEL_CONTROL0_KEY_EN; - if (csp->csp_auth_alg != 0) + if (req->mac != NULL) ctrl0 |= SAFEXCEL_CONTROL0_TYPE_ENCRYPT_HASH_OUT; } else { ctrl0 |= SAFEXCEL_CONTROL0_TYPE_CRYPTO_IN | SAFEXCEL_CONTROL0_KEY_EN; - if (csp->csp_auth_alg != 0) + if (req->mac != NULL) { ctrl0 |= SAFEXCEL_CONTROL0_TYPE_HASH_DECRYPT_IN; + ctrl1 |= SAFEXCEL_CONTROL1_HASH_STORE; + } } break; case CRYPTO_AES_NIST_GCM_16: - case CRYPTO_AES_NIST_GMAC: - if (CRYPTO_OP_IS_ENCRYPT(crp->crp_op) || - csp->csp_auth_alg != 0) { + if ((req->enc->crd_flags & CRD_F_ENCRYPT) != 0) { ctrl0 |= SAFEXCEL_CONTROL0_TYPE_CRYPTO_OUT | SAFEXCEL_CONTROL0_KEY_EN | SAFEXCEL_CONTROL0_TYPE_HASH_OUT; @@ -1391,7 +1410,8 @@ safexcel_set_command(struct safexcel_request *req, SAFEXCEL_CONTROL0_KEY_EN | SAFEXCEL_CONTROL0_TYPE_HASH_DECRYPT_IN; } - if (csp->csp_cipher_alg == CRYPTO_AES_NIST_GCM_16) { + if (req->enc != NULL && + req->enc->crd_alg == CRYPTO_AES_NIST_GCM_16) { ctrl1 |= SAFEXCEL_CONTROL1_COUNTER_MODE | SAFEXCEL_CONTROL1_IV0 | SAFEXCEL_CONTROL1_IV1 | SAFEXCEL_CONTROL1_IV2; @@ -1454,11 +1474,28 @@ safexcel_instr_insert_digest(struct safexcel_instr **i *instrp = instr + 1; } +static void +safexcel_instr_retrieve_digest(struct safexcel_instr **instrp, struct safexcel_request *req, int len) +{ + struct safexcel_instr *instr; + + instr = *instrp; + + instr->opcode = SAFEXCEL_INSTR_OPCODE_INSERT; + instr->length = len; + instr->status = SAFEXCEL_INSTR_STATUS_LAST_HASH | + SAFEXCEL_INSTR_STATUS_LAST_PACKET; + instr->instructions = SAFEXCEL_INSTR_INSERT_HASH_DIGEST | + SAFEXCEL_INSTR_DEST_OUTPUT; + + *instrp = instr + 1; +} + /* * Retrieve and verify a digest. */ static void -safexcel_instr_retrieve_digest(struct safexcel_instr **instrp, int len) +safexcel_instr_verify_digest(struct safexcel_instr **instrp, int len) { struct safexcel_instr *instr; @@ -1507,13 +1544,9 @@ static void safexcel_instr_cipher(struct safexcel_request *req, struct safexcel_instr *instr, struct safexcel_cmd_descr *cdesc) { - struct cryptop *crp; - - crp = req->crp; - /* Insert the payload. */ instr->opcode = SAFEXCEL_INSTR_OPCODE_DIRECTION; - instr->length = crp->crp_payload_length; + instr->length = req->enc->crd_len; instr->status = SAFEXCEL_INSTR_STATUS_LAST_PACKET | SAFEXCEL_INSTR_STATUS_LAST_HASH; instr->instructions = SAFEXCEL_INSTR_INS_LAST | @@ -1526,42 +1559,27 @@ static void safexcel_instr_eta(struct safexcel_request *req, struct safexcel_instr *instr, struct safexcel_cmd_descr *cdesc) { - const struct crypto_session_params *csp; - struct cryptop *crp; struct safexcel_instr *start; - crp = req->crp; - csp = crypto_get_params(crp->crp_session); start = instr; - /* Insert the AAD. */ + /* Encrypt any data left in the request. */ instr->opcode = SAFEXCEL_INSTR_OPCODE_DIRECTION; - instr->length = crp->crp_aad_length; - instr->status = crp->crp_payload_length == 0 ? - SAFEXCEL_INSTR_STATUS_LAST_HASH : 0; + instr->length = req->enc->crd_len; + instr->status = SAFEXCEL_INSTR_STATUS_LAST_HASH; instr->instructions = SAFEXCEL_INSTR_INS_LAST | - SAFEXCEL_INSTR_DEST_HASH; + SAFEXCEL_INSTR_DEST_CRYPTO | + SAFEXCEL_INSTR_DEST_HASH | + SAFEXCEL_INSTR_DEST_OUTPUT; instr++; - /* Encrypt any data left in the request. */ - if (crp->crp_payload_length > 0) { - instr->opcode = SAFEXCEL_INSTR_OPCODE_DIRECTION; - instr->length = crp->crp_payload_length; - instr->status = SAFEXCEL_INSTR_STATUS_LAST_HASH; - instr->instructions = SAFEXCEL_INSTR_INS_LAST | - SAFEXCEL_INSTR_DEST_CRYPTO | - SAFEXCEL_INSTR_DEST_HASH | - SAFEXCEL_INSTR_DEST_OUTPUT; - instr++; - } - /* * Compute the digest, or extract it and place it in the output stream. */ - if (CRYPTO_OP_IS_ENCRYPT(crp->crp_op)) + if ((req->enc->crd_flags & CRD_F_ENCRYPT) != 0) safexcel_instr_insert_digest(&instr, req->sess->digestlen); else - safexcel_instr_retrieve_digest(&instr, req->sess->digestlen); + safexcel_instr_retrieve_digest(&instr, req, req->sess->digestlen); cdesc->additional_cdata_size = instr - start; } @@ -1577,7 +1595,7 @@ safexcel_instr_sha_hash(struct safexcel_request *req, /* Pass the input data to the hash engine. */ instr->opcode = SAFEXCEL_INSTR_OPCODE_DIRECTION; - instr->length = crp->crp_payload_length; + instr->length = req->mac->crd_len; instr->status = SAFEXCEL_INSTR_STATUS_LAST_HASH; instr->instructions = SAFEXCEL_INSTR_DEST_HASH; instr++; @@ -1624,7 +1642,7 @@ safexcel_instr_ccm(struct safexcel_request *req, struc * Insert B0 and the AAD length into the input stream. */ instr->opcode = SAFEXCEL_INSTR_OPCODE_INSERT; - instr->length = blen + (crp->crp_aad_length > 0 ? 2 : 0); + instr->length = blen + (req->mac->crd_len > 0 ? 2 : 0); instr->status = 0; instr->instructions = SAFEXCEL_INSTR_DEST_HASH | SAFEXCEL_INSTR_INSERT_IMMEDIATE; @@ -1635,33 +1653,33 @@ safexcel_instr_ccm(struct safexcel_request *req, struc b0[0] = L - 1 | /* payload length size */ ((CCM_CBC_MAX_DIGEST_LEN - 2) / 2) << 3 /* digest length */ | - (crp->crp_aad_length > 0 ? 1 : 0) << 6 /* AAD present bit */; + (req->mac->crd_len > 0 ? 1 : 0) << 6 /* AAD present bit */; memcpy(&b0[1], req->iv, AES_CCM_IV_LEN); - b0[14] = crp->crp_payload_length >> 8; - b0[15] = crp->crp_payload_length & 0xff; + b0[14] = req->enc->crd_len >> 8; + b0[15] = req->enc->crd_len & 0xff; instr += blen / sizeof(*instr); /* Insert the AAD length and data into the input stream. */ - if (crp->crp_aad_length > 0) { + if (req->mac->crd_len > 0) { alenp = (uint8_t *)instr; - alenp[0] = crp->crp_aad_length >> 8; - alenp[1] = crp->crp_aad_length & 0xff; + alenp[0] = req->mac->crd_len >> 8; + alenp[1] = req->mac->crd_len & 0xff; alenp[2] = 0; alenp[3] = 0; instr++; instr->opcode = SAFEXCEL_INSTR_OPCODE_DIRECTION; - instr->length = crp->crp_aad_length; + instr->length = req->mac->crd_len; instr->status = 0; instr->instructions = SAFEXCEL_INSTR_DEST_HASH; instr++; /* Insert zero padding. */ - aalign = (crp->crp_aad_length + 2) & (blen - 1); + aalign = (req->mac->crd_len + 2) & (blen - 1); instr->opcode = SAFEXCEL_INSTR_OPCODE_INSERT; instr->length = aalign == 0 ? 0 : - blen - ((crp->crp_aad_length + 2) & (blen - 1)); - instr->status = crp->crp_payload_length == 0 ? + blen - ((req->mac->crd_len + 2) & (blen - 1)); + instr->status = req->enc->crd_len == 0 ? SAFEXCEL_INSTR_STATUS_LAST_HASH : 0; instr->instructions = SAFEXCEL_INSTR_DEST_HASH; instr++; @@ -1670,10 +1688,10 @@ safexcel_instr_ccm(struct safexcel_request *req, struc safexcel_instr_temp_aes_block(&instr); /* Insert the cipher payload into the input stream. */ - if (crp->crp_payload_length > 0) { + if (req->enc->crd_len > 0) { instr->opcode = SAFEXCEL_INSTR_OPCODE_DIRECTION; - instr->length = crp->crp_payload_length; - instr->status = (crp->crp_payload_length & (blen - 1)) == 0 ? + instr->length = req->enc->crd_len; + instr->status = (req->enc->crd_len & (blen - 1)) == 0 ? SAFEXCEL_INSTR_STATUS_LAST_HASH : 0; instr->instructions = SAFEXCEL_INSTR_DEST_OUTPUT | SAFEXCEL_INSTR_DEST_CRYPTO | @@ -1682,10 +1700,10 @@ safexcel_instr_ccm(struct safexcel_request *req, struc instr++; /* Insert zero padding. */ - if (crp->crp_payload_length & (blen - 1)) { + if (req->enc->crd_len & (blen - 1)) { instr->opcode = SAFEXCEL_INSTR_OPCODE_INSERT; instr->length = blen - - (crp->crp_payload_length & (blen - 1)); + (req->enc->crd_len & (blen - 1)); instr->status = SAFEXCEL_INSTR_STATUS_LAST_HASH; instr->instructions = SAFEXCEL_INSTR_DEST_HASH; instr++; @@ -1695,10 +1713,10 @@ safexcel_instr_ccm(struct safexcel_request *req, struc /* * Compute the digest, or extract it and place it in the output stream. */ - if (CRYPTO_OP_IS_ENCRYPT(crp->crp_op)) + if ((req->enc->crd_flags & CRD_F_ENCRYPT) != 0) safexcel_instr_insert_digest(&instr, req->sess->digestlen); else - safexcel_instr_retrieve_digest(&instr, req->sess->digestlen); + safexcel_instr_verify_digest(&instr, req->sess->digestlen); cdesc->additional_cdata_size = instr - start; } @@ -1718,8 +1736,8 @@ safexcel_instr_gcm(struct safexcel_request *req, struc /* Insert the AAD into the input stream. */ instr->opcode = SAFEXCEL_INSTR_OPCODE_DIRECTION; - instr->length = crp->crp_aad_length; - instr->status = crp->crp_payload_length == 0 ? + instr->length = req->mac->crd_len; + instr->status = req->enc->crd_len == 0 ? SAFEXCEL_INSTR_STATUS_LAST_HASH : 0; instr->instructions = SAFEXCEL_INSTR_INS_LAST | SAFEXCEL_INSTR_DEST_HASH; @@ -1728,9 +1746,9 @@ safexcel_instr_gcm(struct safexcel_request *req, struc safexcel_instr_temp_aes_block(&instr); /* Insert the cipher payload into the input stream. */ - if (crp->crp_payload_length > 0) { + if (req->enc->crd_len > 0) { instr->opcode = SAFEXCEL_INSTR_OPCODE_DIRECTION; - instr->length = crp->crp_payload_length; + instr->length = req->enc->crd_len; instr->status = SAFEXCEL_INSTR_STATUS_LAST_HASH; instr->instructions = SAFEXCEL_INSTR_DEST_OUTPUT | SAFEXCEL_INSTR_DEST_CRYPTO | SAFEXCEL_INSTR_DEST_HASH | @@ -1741,51 +1759,22 @@ safexcel_instr_gcm(struct safexcel_request *req, struc /* * Compute the digest, or extract it and place it in the output stream. */ - if (CRYPTO_OP_IS_ENCRYPT(crp->crp_op)) + if ((req->enc->crd_flags & CRD_F_ENCRYPT) != 0) safexcel_instr_insert_digest(&instr, req->sess->digestlen); else - safexcel_instr_retrieve_digest(&instr, req->sess->digestlen); + safexcel_instr_verify_digest(&instr, req->sess->digestlen); cdesc->additional_cdata_size = instr - start; } static void -safexcel_instr_gmac(struct safexcel_request *req, struct safexcel_instr *instr, - struct safexcel_cmd_descr *cdesc) -{ - struct cryptop *crp; - struct safexcel_instr *start; - - memcpy(cdesc->control_data.token, req->iv, AES_GCM_IV_LEN); - cdesc->control_data.token[3] = htobe32(1); - - crp = req->crp; - start = instr; - - instr->opcode = SAFEXCEL_INSTR_OPCODE_DIRECTION; - instr->length = crp->crp_payload_length; - instr->status = SAFEXCEL_INSTR_STATUS_LAST_HASH; - instr->instructions = SAFEXCEL_INSTR_INS_LAST | - SAFEXCEL_INSTR_DEST_HASH; - instr++; - - safexcel_instr_temp_aes_block(&instr); - - safexcel_instr_insert_digest(&instr, req->sess->digestlen); - - cdesc->additional_cdata_size = instr - start; -} - -static void safexcel_set_token(struct safexcel_request *req) { - const struct crypto_session_params *csp; struct safexcel_cmd_descr *cdesc; struct safexcel_instr *instr; struct safexcel_softc *sc; int ringidx; - csp = crypto_get_params(req->crp->crp_session); cdesc = req->cdesc; sc = req->sc; ringidx = req->sess->ringidx; @@ -1797,8 +1786,7 @@ safexcel_set_token(struct safexcel_request *req) * in the token itself. Otherwise we use an additional token descriptor * and the embedded instruction space is used to store the IV. */ - if (csp->csp_cipher_alg == 0 && - csp->csp_auth_alg != CRYPTO_AES_NIST_GMAC) { + if (req->enc == NULL) { instr = (void *)cdesc->control_data.token; } else { instr = (void *)(sc->sc_ring[ringidx].dma_atok.vaddr + @@ -1807,30 +1795,32 @@ safexcel_set_token(struct safexcel_request *req) cdesc->control_data.options |= SAFEXCEL_OPTION_4_TOKEN_IV_CMD; } - switch (csp->csp_cipher_alg) { - case CRYPTO_AES_NIST_GCM_16: - safexcel_instr_gcm(req, instr, cdesc); - break; - case CRYPTO_AES_CCM_16: - safexcel_instr_ccm(req, instr, cdesc); - break; - case CRYPTO_AES_XTS: - memcpy(cdesc->control_data.token, req->iv, AES_XTS_IV_LEN); - memset(cdesc->control_data.token + - AES_XTS_IV_LEN / sizeof(uint32_t), 0, AES_XTS_IV_LEN); + if (req->enc != NULL) { + switch (req->enc->crd_alg) { + case CRYPTO_AES_NIST_GCM_16: + safexcel_instr_gcm(req, instr, cdesc); + break; + case CRYPTO_AES_CCM_16: + safexcel_instr_ccm(req, instr, cdesc); + break; + case CRYPTO_AES_XTS: + memcpy(cdesc->control_data.token, req->iv, AES_XTS_IV_LEN); + memset(cdesc->control_data.token + + AES_XTS_IV_LEN / sizeof(uint32_t), 0, AES_XTS_IV_LEN); - safexcel_instr_cipher(req, instr, cdesc); - break; - case CRYPTO_AES_CBC: - case CRYPTO_AES_ICM: - memcpy(cdesc->control_data.token, req->iv, AES_BLOCK_LEN); - if (csp->csp_auth_alg != 0) - safexcel_instr_eta(req, instr, cdesc); - else safexcel_instr_cipher(req, instr, cdesc); - break; - default: - switch (csp->csp_auth_alg) { + break; + case CRYPTO_AES_CBC: + case CRYPTO_AES_ICM: + memcpy(cdesc->control_data.token, req->iv, AES_BLOCK_LEN); + if (req->mac != NULL) + safexcel_instr_eta(req, instr, cdesc); + else + safexcel_instr_cipher(req, instr, cdesc); + break; + } + } else { + switch (req->mac->crd_alg) { case CRYPTO_SHA1: case CRYPTO_SHA1_HMAC: case CRYPTO_SHA2_224: @@ -1843,13 +1833,9 @@ safexcel_set_token(struct safexcel_request *req) case CRYPTO_SHA2_512_HMAC: safexcel_instr_sha_hash(req, instr); break; - case CRYPTO_AES_NIST_GMAC: - safexcel_instr_gmac(req, instr, cdesc); - break; default: - panic("unhandled auth request %d", csp->csp_auth_alg); + panic("unhandled auth request %d", req->mac->crd_alg); } - break; } } @@ -1896,8 +1882,8 @@ safexcel_cmd_descr_add(struct safexcel_ring *ring, boo struct safexcel_cmd_descr *cdesc; struct safexcel_cmd_descr_ring *cring; - KASSERT(full_data_len <= SAFEXCEL_MAX_REQUEST_SIZE, - ("%s: request length %u too long", __func__, full_data_len)); + KASSERT(reqlen <= SAFEXCEL_MAX_REQUEST_SIZE, + ("%s: request length %u too long", __func__, reqlen)); mtx_assert(&ring->mtx, MA_OWNED); cring = &ring->cdr; @@ -1978,13 +1964,14 @@ safexcel_append_segs(bus_dma_segment_t *segs, int nseg len -= seglen; start = 0; } + + KASSERT(len == 0, ("%s: %d residual bytes", __func__, len)); } static void safexcel_create_chain_cb(void *arg, bus_dma_segment_t *segs, int nseg, int error) { - const struct crypto_session_params *csp; struct cryptop *crp; struct safexcel_cmd_descr *cdesc; struct safexcel_request *req; @@ -2002,7 +1989,6 @@ safexcel_create_chain_cb(void *arg, bus_dma_segment_t } crp = req->crp; - csp = crypto_get_params(crp->crp_session); sess = req->sess; ring = &req->sc->sc_ring[sess->ringidx]; @@ -2021,23 +2007,30 @@ safexcel_create_chain_cb(void *arg, bus_dma_segment_t */ sglist_reset(ring->cmd_data); sglist_reset(ring->res_data); - if (crp->crp_aad_length != 0) { + if (req->mac != NULL && (req->enc == NULL || + req->enc->crd_alg == CRYPTO_AES_NIST_GCM_16 || + req->enc->crd_alg == CRYPTO_AES_CCM_16)) { safexcel_append_segs(segs, nseg, ring->cmd_data, - crp->crp_aad_start, crp->crp_aad_length); + req->mac->crd_skip, req->mac->crd_len); } - safexcel_append_segs(segs, nseg, ring->cmd_data, - crp->crp_payload_start, crp->crp_payload_length); - if (csp->csp_cipher_alg != 0) { + if (req->enc != NULL) { + safexcel_append_segs(segs, nseg, ring->cmd_data, + req->enc->crd_skip, req->enc->crd_len); safexcel_append_segs(segs, nseg, ring->res_data, - crp->crp_payload_start, crp->crp_payload_length); + req->enc->crd_skip, req->enc->crd_len); } if (sess->digestlen > 0) { - if ((crp->crp_op & CRYPTO_OP_VERIFY_DIGEST) != 0) { + if (req->enc == NULL || + (req->enc->crd_flags & CRD_F_ENCRYPT) != 0) + safexcel_append_segs(segs, nseg, ring->res_data, + req->mac->crd_inject, sess->digestlen); + else if (req->enc->crd_alg == CRYPTO_AES_NIST_GCM_16 || + req->enc->crd_alg == CRYPTO_AES_CCM_16) { safexcel_append_segs(segs, nseg, ring->cmd_data, - crp->crp_digest_start, sess->digestlen); + req->mac->crd_inject, sess->digestlen); } else { safexcel_append_segs(segs, nseg, ring->res_data, - crp->crp_digest_start, sess->digestlen); + req->mac->crd_inject, sess->digestlen); } } @@ -2097,63 +2090,84 @@ safexcel_create_chain_cb(void *arg, bus_dma_segment_t req->rdescs = sg->sg_nseg; } +static void +safexcel_create_chain_cb2(void *arg, bus_dma_segment_t *segs, int nseg, + bus_size_t mapsize __unused, int error) +{ + safexcel_create_chain_cb(arg, segs, nseg, error); +} + +#include static int safexcel_create_chain(struct safexcel_ring *ring, struct safexcel_request *req) { + struct cryptop *crp; int error; req->error = 0; req->cdescs = req->rdescs = 0; + crp = req->crp; - error = bus_dmamap_load_crp(ring->data_dtag, req->dmap, req->crp, - safexcel_create_chain_cb, req, BUS_DMA_NOWAIT); + if ((crp->crp_flags & CRYPTO_F_IOV) != 0) { + error = bus_dmamap_load_uio(ring->data_dtag, req->dmap, + (struct uio *)crp->crp_buf, safexcel_create_chain_cb2, + req, BUS_DMA_NOWAIT); + } else if ((crp->crp_flags & CRYPTO_F_IMBUF) != 0) { + error = bus_dmamap_load_mbuf(ring->data_dtag, req->dmap, + (struct mbuf *)crp->crp_buf, safexcel_create_chain_cb2, + req, BUS_DMA_NOWAIT); + } else { + error = bus_dmamap_load(ring->data_dtag, req->dmap, + crp->crp_buf, crp->crp_ilen, + safexcel_create_chain_cb, req, BUS_DMA_NOWAIT); + } if (error == 0) req->dmap_loaded = true; - - if (req->error != 0) + else if (req->error != 0) error = req->error; - return (error); } -static bool -safexcel_probe_cipher(const struct crypto_session_params *csp) -{ - switch (csp->csp_cipher_alg) { - case CRYPTO_AES_CBC: - case CRYPTO_AES_ICM: - if (csp->csp_ivlen != AES_BLOCK_LEN) - return (false); - break; - case CRYPTO_AES_XTS: - if (csp->csp_ivlen != AES_XTS_IV_LEN) - return (false); - break; - default: - return (false); - } - - return (true); -} - /* * Determine whether the driver can implement a session with the requested * parameters. */ static int -safexcel_probesession(device_t dev, const struct crypto_session_params *csp) +safexcel_probesession(struct cryptoini *enc, struct cryptoini *mac) { - switch (csp->csp_mode) { - case CSP_MODE_CIPHER: - if (!safexcel_probe_cipher(csp)) - return (EINVAL); - break; - case CSP_MODE_DIGEST: - switch (csp->csp_auth_alg) { - case CRYPTO_AES_NIST_GMAC: - if (csp->csp_ivlen != AES_GCM_IV_LEN) + if (enc != NULL) { + switch (enc->cri_alg) { + case CRYPTO_AES_NIST_GCM_16: + if (mac == NULL || + (mac->cri_alg != CRYPTO_AES_128_NIST_GMAC && + mac->cri_alg != CRYPTO_AES_192_NIST_GMAC && + mac->cri_alg != CRYPTO_AES_256_NIST_GMAC)) return (EINVAL); break; + case CRYPTO_AES_CCM_16: + if (mac == NULL || + mac->cri_alg != CRYPTO_AES_CCM_CBC_MAC) + return (EINVAL); + break; + case CRYPTO_AES_CBC: + case CRYPTO_AES_ICM: + if (mac != NULL && + mac->cri_alg != CRYPTO_SHA1_HMAC && + mac->cri_alg != CRYPTO_SHA2_224_HMAC && + mac->cri_alg != CRYPTO_SHA2_256_HMAC && + mac->cri_alg != CRYPTO_SHA2_384_HMAC && + mac->cri_alg != CRYPTO_SHA2_512_HMAC) + return (EINVAL); + break; + case CRYPTO_AES_XTS: + if (mac != NULL) + return (EINVAL); + break; + default: + return (EINVAL); + } + } else { + switch (mac->cri_alg) { case CRYPTO_SHA1: case CRYPTO_SHA1_HMAC: case CRYPTO_SHA2_224: @@ -2168,47 +2182,9 @@ safexcel_probesession(device_t dev, const struct crypt default: return (EINVAL); } - break; - case CSP_MODE_AEAD: - switch (csp->csp_cipher_alg) { - case CRYPTO_AES_NIST_GCM_16: - if (csp->csp_ivlen != AES_GCM_IV_LEN) - return (EINVAL); - break; - case CRYPTO_AES_CCM_16: - if (csp->csp_ivlen != AES_CCM_IV_LEN) - return (EINVAL); - break; - default: - return (EINVAL); - } - break; - case CSP_MODE_ETA: - if (!safexcel_probe_cipher(csp)) - return (EINVAL); - switch (csp->csp_cipher_alg) { - case CRYPTO_AES_CBC: - case CRYPTO_AES_ICM: - /* - * The EIP-97 does not support combining AES-XTS with - * hash operations. - */ - if (csp->csp_auth_alg != CRYPTO_SHA1_HMAC && - csp->csp_auth_alg != CRYPTO_SHA2_224_HMAC && - csp->csp_auth_alg != CRYPTO_SHA2_256_HMAC && - csp->csp_auth_alg != CRYPTO_SHA2_384_HMAC && - csp->csp_auth_alg != CRYPTO_SHA2_512_HMAC) - return (EINVAL); - break; - default: - return (EINVAL); - } - break; - default: - return (EINVAL); } - return (CRYPTODEV_PROBE_HARDWARE); + return (0); } /* @@ -2286,20 +2262,64 @@ safexcel_setkey_hmac_digest(struct auth_hash *ahash, u } } +static void +safexcel_hmac_init_pad(struct auth_hash *axf, const char *key, int klen, + union authctx *auth_ctx, uint8_t padval) +{ + uint8_t hmac_key[HMAC_MAX_BLOCK_LEN]; + u_int i; + + memset(hmac_key, 0, sizeof(hmac_key)); + if (klen > axf->blocksize) { + axf->Init(auth_ctx); + axf->Update(auth_ctx, key, klen); + axf->Final(hmac_key, auth_ctx); + klen = axf->hashsize; + } else { + memcpy(hmac_key, key, klen); + } + + for (i = 0; i < axf->blocksize; i++) + hmac_key[i] ^= padval; + + axf->Init(auth_ctx); + axf->Update(auth_ctx, hmac_key, axf->blocksize); + explicit_bzero(hmac_key, sizeof(hmac_key)); +} + /* * Pre-compute the inner and outer digests used in the HMAC algorithm. */ static void -safexcel_setkey_hmac(const struct crypto_session_params *csp, - struct safexcel_session *sess, const uint8_t *key, int klen) +safexcel_setkey_hmac(struct safexcel_session *sess, int alg, const uint8_t *key, + int klen) { union authctx ctx; struct auth_hash *ahash; - ahash = crypto_auth_hash(csp); - hmac_init_ipad(ahash, key, klen, &ctx); + switch (alg) { *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Wed Jul 22 14:24:42 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 48C0837E1FD; Wed, 22 Jul 2020 14:24:42 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BBd5Q17BXz4GXQ; Wed, 22 Jul 2020 14:24:42 +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 09D7B8D2F; Wed, 22 Jul 2020 14:24:42 +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 06MEOfu5013678; Wed, 22 Jul 2020 14:24:41 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06MEOftg013677; Wed, 22 Jul 2020 14:24:41 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202007221424.06MEOftg013677@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 22 Jul 2020 14:24:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r363419 - stable/12/tests/sys/opencrypto X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/12/tests/sys/opencrypto X-SVN-Commit-Revision: 363419 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 22 Jul 2020 14:24:42 -0000 Author: markj Date: Wed Jul 22 14:24:41 2020 New Revision: 363419 URL: https://svnweb.freebsd.org/changeset/base/363419 Log: MFC r363181: Add safexcel(4) to cryptotest. Modified: stable/12/tests/sys/opencrypto/cryptotest.py Directory Properties: stable/12/ (props changed) Modified: stable/12/tests/sys/opencrypto/cryptotest.py ============================================================================== --- stable/12/tests/sys/opencrypto/cryptotest.py Wed Jul 22 14:22:35 2020 (r363418) +++ stable/12/tests/sys/opencrypto/cryptotest.py Wed Jul 22 14:24:41 2020 (r363419) @@ -47,9 +47,9 @@ def katg(base, glob): raise unittest.SkipTest("Missing %s test vectors" % (base)) return iglob(os.path.join(katdir, base, glob)) -aesmodules = [ 'cryptosoft0', 'aesni0', 'ccr0', 'ccp0' ] +aesmodules = [ 'cryptosoft0', 'aesni0', 'ccr0', 'ccp0', 'safexcel0' ] desmodules = [ 'cryptosoft0', ] -shamodules = [ 'cryptosoft0', 'aesni0', 'ccr0', 'ccp0' ] +shamodules = [ 'cryptosoft0', 'aesni0', 'ccr0', 'ccp0', 'safexcel0' ] def GenTestCase(cname): try: @@ -468,6 +468,7 @@ cryptosoft = GenTestCase('cryptosoft0') aesni = GenTestCase('aesni0') ccr = GenTestCase('ccr0') ccp = GenTestCase('ccp0') +safexcel = GenTestCase('safexcel0') if __name__ == '__main__': unittest.main() From owner-svn-src-all@freebsd.org Wed Jul 22 14:32:50 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3474137E77A; Wed, 22 Jul 2020 14:32:50 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BBdGp0f3Cz4H3v; Wed, 22 Jul 2020 14:32:50 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id ED9309055; Wed, 22 Jul 2020 14:32:49 +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 06MEWnP6019605; Wed, 22 Jul 2020 14:32:49 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06MEWlF4019592; Wed, 22 Jul 2020 14:32:47 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202007221432.06MEWlF4019592@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 22 Jul 2020 14:32:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363420 - in head/sys: compat/linuxkpi/common/src dev/sound/usb dev/usb dev/usb/input dev/usb/storage X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in head/sys: compat/linuxkpi/common/src dev/sound/usb dev/usb dev/usb/input dev/usb/storage X-SVN-Commit-Revision: 363420 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 22 Jul 2020 14:32:50 -0000 Author: markj Date: Wed Jul 22 14:32:47 2020 New Revision: 363420 URL: https://svnweb.freebsd.org/changeset/base/363420 Log: usb(4): Stop checking for failures from malloc(M_WAITOK). Handle the fact that parts of usb(4) can be compiled into the boot loader, where M_WAITOK does not guarantee a successful allocation. PR: 240545 Submitted by: Andrew Reiter (original version) Reviewed by: hselasky MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D25706 Modified: head/sys/compat/linuxkpi/common/src/linux_usb.c head/sys/dev/sound/usb/uaudio.c head/sys/dev/usb/input/uhid.c head/sys/dev/usb/input/uhid_snes.c head/sys/dev/usb/storage/ustorage_fs.c head/sys/dev/usb/usb_dev.c head/sys/dev/usb/usb_device.c head/sys/dev/usb/usb_freebsd.h head/sys/dev/usb/usb_freebsd_loader.h head/sys/dev/usb/usb_generic.c head/sys/dev/usb/usb_mbuf.c head/sys/dev/usb/usb_transfer.c Modified: head/sys/compat/linuxkpi/common/src/linux_usb.c ============================================================================== --- head/sys/compat/linuxkpi/common/src/linux_usb.c Wed Jul 22 14:24:41 2020 (r363419) +++ head/sys/compat/linuxkpi/common/src/linux_usb.c Wed Jul 22 14:32:47 2020 (r363420) @@ -707,8 +707,6 @@ usb_control_msg(struct usb_device *dev, struct usb_hos * 0xFFFF is a FreeBSD specific magic value. */ urb = usb_alloc_urb(0xFFFF, size); - if (urb == NULL) - return (-ENOMEM); urb->dev = dev; urb->endpoint = uhe; @@ -1008,16 +1006,14 @@ usb_alloc_urb(uint16_t iso_packets, uint16_t mem_flags } urb = malloc(size, M_USBDEV, M_WAITOK | M_ZERO); - if (urb) { - cv_init(&urb->cv_wait, "URBWAIT"); - if (iso_packets == 0xFFFF) { - urb->setup_packet = (void *)(urb + 1); - urb->transfer_buffer = (void *)(urb->setup_packet + - sizeof(struct usb_device_request)); - } else { - urb->number_of_packets = iso_packets; - } + cv_init(&urb->cv_wait, "URBWAIT"); + if (iso_packets == 0xFFFF) { + urb->setup_packet = (void *)(urb + 1); + urb->transfer_buffer = (void *)(urb->setup_packet + + sizeof(struct usb_device_request)); + } else { + urb->number_of_packets = iso_packets; } return (urb); } @@ -1722,8 +1718,6 @@ usb_bulk_msg(struct usb_device *udev, struct usb_host_ return (err); urb = usb_alloc_urb(0, 0); - if (urb == NULL) - return (-ENOMEM); usb_fill_bulk_urb(urb, udev, uhe, data, len, usb_linux_wait_complete, NULL); Modified: head/sys/dev/sound/usb/uaudio.c ============================================================================== --- head/sys/dev/sound/usb/uaudio.c Wed Jul 22 14:24:41 2020 (r363419) +++ head/sys/dev/sound/usb/uaudio.c Wed Jul 22 14:32:47 2020 (r363420) @@ -4968,10 +4968,6 @@ uaudio_mixer_fill_info(struct uaudio_softc *sc, iot = malloc(sizeof(struct uaudio_terminal_node) * 256, M_TEMP, M_WAITOK | M_ZERO); - if (iot == NULL) { - DPRINTF("no memory!\n"); - goto done; - } while ((desc = usb_desc_foreach(cd, desc))) { dp = desc; Modified: head/sys/dev/usb/input/uhid.c ============================================================================== --- head/sys/dev/usb/input/uhid.c Wed Jul 22 14:24:41 2020 (r363419) +++ head/sys/dev/usb/input/uhid.c Wed Jul 22 14:32:47 2020 (r363420) @@ -451,10 +451,6 @@ uhid_get_report(struct uhid_softc *sc, uint8_t type, if (kern_data == NULL) { kern_data = malloc(len, M_USBDEV, M_WAITOK); - if (kern_data == NULL) { - err = ENOMEM; - goto done; - } free_data = 1; } err = usbd_req_get_report(sc->sc_udev, NULL, kern_data, @@ -487,10 +483,6 @@ uhid_set_report(struct uhid_softc *sc, uint8_t type, if (kern_data == NULL) { kern_data = malloc(len, M_USBDEV, M_WAITOK); - if (kern_data == NULL) { - err = ENOMEM; - goto done; - } free_data = 1; err = copyin(user_data, kern_data, len); if (err) { Modified: head/sys/dev/usb/input/uhid_snes.c ============================================================================== --- head/sys/dev/usb/input/uhid_snes.c Wed Jul 22 14:24:41 2020 (r363419) +++ head/sys/dev/usb/input/uhid_snes.c Wed Jul 22 14:32:47 2020 (r363420) @@ -168,10 +168,6 @@ uhid_get_report(struct uhid_snes_softc *sc, uint8_t ty if (kern_data == NULL) { kern_data = malloc(len, M_USBDEV, M_WAITOK); - if (kern_data == NULL) { - err = ENOMEM; - goto done; - } free_data = 1; } err = usbd_req_get_report(sc->sc_udev, NULL, kern_data, @@ -203,10 +199,6 @@ uhid_set_report(struct uhid_snes_softc *sc, uint8_t ty if (kern_data == NULL) { kern_data = malloc(len, M_USBDEV, M_WAITOK); - if (kern_data == NULL) { - err = ENOMEM; - goto done; - } free_data = 1; err = copyin(user_data, kern_data, len); if (err) { Modified: head/sys/dev/usb/storage/ustorage_fs.c ============================================================================== --- head/sys/dev/usb/storage/ustorage_fs.c Wed Jul 22 14:24:41 2020 (r363419) +++ head/sys/dev/usb/storage/ustorage_fs.c Wed Jul 22 14:32:47 2020 (r363420) @@ -381,10 +381,6 @@ ustorage_fs_attach(device_t dev) ustorage_fs_ramdisk = malloc(USTORAGE_FS_RAM_SECT << 9, M_USB, M_ZERO | M_WAITOK); - - if (ustorage_fs_ramdisk == NULL) { - return (ENOMEM); - } } sc->sc_lun[0].memory_image = ustorage_fs_ramdisk; sc->sc_lun[0].num_sectors = USTORAGE_FS_RAM_SECT; Modified: head/sys/dev/usb/usb_dev.c ============================================================================== --- head/sys/dev/usb/usb_dev.c Wed Jul 22 14:24:41 2020 (r363419) +++ head/sys/dev/usb/usb_dev.c Wed Jul 22 14:32:47 2020 (r363420) @@ -386,13 +386,11 @@ usb_fifo_alloc(struct mtx *mtx) struct usb_fifo *f; f = malloc(sizeof(*f), M_USBDEV, M_WAITOK | M_ZERO); - if (f != NULL) { - cv_init(&f->cv_io, "FIFO-IO"); - cv_init(&f->cv_drain, "FIFO-DRAIN"); - f->priv_mtx = mtx; - f->refcount = 1; - knlist_init_mtx(&f->selinfo.si_note, mtx); - } + cv_init(&f->cv_io, "FIFO-IO"); + cv_init(&f->cv_drain, "FIFO-DRAIN"); + f->priv_mtx = mtx; + f->refcount = 1; + knlist_init_mtx(&f->selinfo.si_note, mtx); return (f); } @@ -2309,9 +2307,6 @@ usb_alloc_symlink(const char *target) struct usb_symlink *ps; ps = malloc(sizeof(*ps), M_USBDEV, M_WAITOK); - if (ps == NULL) { - return (ps); - } /* XXX no longer needed */ strlcpy(ps->src_path, target, sizeof(ps->src_path)); ps->src_len = strlen(ps->src_path); Modified: head/sys/dev/usb/usb_device.c ============================================================================== --- head/sys/dev/usb/usb_device.c Wed Jul 22 14:24:41 2020 (r363419) +++ head/sys/dev/usb/usb_device.c Wed Jul 22 14:32:47 2020 (r363420) @@ -1785,9 +1785,11 @@ usb_alloc_device(device_t parent_dev, struct usb_bus * return (NULL); } udev = malloc(sizeof(*udev), M_USB, M_WAITOK | M_ZERO); +#if (USB_HAVE_MALLOC_WAITOK == 0) if (udev == NULL) { return (NULL); } +#endif /* initialise our SX-lock */ sx_init_flags(&udev->enum_sx, "USB config SX lock", SX_DUPOK); sx_init_flags(&udev->sr_sx, "USB suspend and resume SX lock", SX_NOWITNESS); Modified: head/sys/dev/usb/usb_freebsd.h ============================================================================== --- head/sys/dev/usb/usb_freebsd.h Wed Jul 22 14:24:41 2020 (r363419) +++ head/sys/dev/usb/usb_freebsd.h Wed Jul 22 14:32:47 2020 (r363420) @@ -53,6 +53,7 @@ #define USB_HAVE_FIXED_CONFIG 0 #define USB_HAVE_FIXED_PORT 0 #define USB_HAVE_DISABLE_ENUM 1 +#define USB_HAVE_MALLOC_WAITOK 1 /* define zero ticks callout value */ #define USB_CALLOUT_ZERO_TICKS 1 Modified: head/sys/dev/usb/usb_freebsd_loader.h ============================================================================== --- head/sys/dev/usb/usb_freebsd_loader.h Wed Jul 22 14:24:41 2020 (r363419) +++ head/sys/dev/usb/usb_freebsd_loader.h Wed Jul 22 14:32:47 2020 (r363420) @@ -53,6 +53,7 @@ #define USB_HAVE_FIXED_CONFIG 0 #define USB_HAVE_FIXED_PORT 0 #define USB_HAVE_DISABLE_ENUM 0 +#define USB_HAVE_MALLOC_WAITOK 0 #define USB_CALLOUT_ZERO_TICKS 1 Modified: head/sys/dev/usb/usb_generic.c ============================================================================== --- head/sys/dev/usb/usb_generic.c Wed Jul 22 14:24:41 2020 (r363419) +++ head/sys/dev/usb/usb_generic.c Wed Jul 22 14:32:47 2020 (r363420) @@ -2339,11 +2339,6 @@ ugen_ioctl_post(struct usb_fifo *f, u_long cmd, void * } f->fs_xfer = malloc(sizeof(f->fs_xfer[0]) * u.pinit->ep_index_max, M_USB, M_WAITOK | M_ZERO); - if (f->fs_xfer == NULL) { - usb_fifo_free_buffer(f); - error = ENOMEM; - break; - } f->fs_ep_max = u.pinit->ep_index_max; f->fs_ep_ptr = u.pinit->pEndpoints; break; Modified: head/sys/dev/usb/usb_mbuf.c ============================================================================== --- head/sys/dev/usb/usb_mbuf.c Wed Jul 22 14:24:41 2020 (r363419) +++ head/sys/dev/usb/usb_mbuf.c Wed Jul 22 14:32:47 2020 (r363420) @@ -78,15 +78,10 @@ usb_alloc_mbufs(struct malloc_type *type, struct usb_i alloc_size = (block_size + sizeof(struct usb_mbuf)) * nblocks; free_ptr = malloc(alloc_size, type, M_WAITOK | M_ZERO); - - if (free_ptr == NULL) { - goto done; - } m_ptr = free_ptr; data_ptr = (void *)(m_ptr + nblocks); while (nblocks--) { - m_ptr->cur_data_ptr = m_ptr->min_data_ptr = data_ptr; @@ -99,6 +94,5 @@ usb_alloc_mbufs(struct malloc_type *type, struct usb_i data_ptr += block_size; } } -done: return (free_ptr); } Modified: head/sys/dev/usb/usb_transfer.c ============================================================================== --- head/sys/dev/usb/usb_transfer.c Wed Jul 22 14:24:41 2020 (r363419) +++ head/sys/dev/usb/usb_transfer.c Wed Jul 22 14:32:47 2020 (r363420) @@ -1342,14 +1342,15 @@ usbd_transfer_setup(struct usb_device *udev, /* allocate zeroed memory */ buf = malloc(parm->size[0], M_USB, M_WAITOK | M_ZERO); - +#if (USB_HAVE_MALLOC_WAITOK == 0) if (buf == NULL) { parm->err = USB_ERR_NOMEM; DPRINTFN(0, "cannot allocate memory block for " "configuration (%d bytes)\n", parm->size[0]); goto done; - } + } +#endif parm->dma_tag_p = USB_ADD_BYTES(buf, parm->size[1]); parm->dma_page_ptr = USB_ADD_BYTES(buf, parm->size[3]); parm->dma_page_cache_ptr = USB_ADD_BYTES(buf, parm->size[4]); From owner-svn-src-all@freebsd.org Wed Jul 22 17:33:36 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9AA5035A440; Wed, 22 Jul 2020 17:33: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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BBjHN3Pd3z4VTy; Wed, 22 Jul 2020 17:33: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 5955AB387; Wed, 22 Jul 2020 17:33: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 06MHXaiV033150; Wed, 22 Jul 2020 17:33:36 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06MHXaNC033149; Wed, 22 Jul 2020 17:33:36 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202007221733.06MHXaNC033149@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Wed, 22 Jul 2020 17:33:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363421 - head/usr.sbin/pkg X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/usr.sbin/pkg X-SVN-Commit-Revision: 363421 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 22 Jul 2020 17:33:36 -0000 Author: kevans Date: Wed Jul 22 17:33:35 2020 New Revision: 363421 URL: https://svnweb.freebsd.org/changeset/base/363421 Log: pkg-bootstrap: complain on improper `pkg bootstrap` usage Right now, the bootstrap will gloss over things like pkg bootstrap -x or pkg bootstrap -f pkg. Make it more clear that this is incorrect, and hint at the correct formatting. Reported by: jhb (IIRC via IRC) Approved by: bapt, jhb, manu MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D24750 Modified: head/usr.sbin/pkg/pkg.c Modified: head/usr.sbin/pkg/pkg.c ============================================================================== --- head/usr.sbin/pkg/pkg.c Wed Jul 22 14:32:47 2020 (r363420) +++ head/usr.sbin/pkg/pkg.c Wed Jul 22 17:33:35 2020 (r363421) @@ -1050,8 +1050,16 @@ main(int argc, char *argv[]) if (argc > 1 && strcmp(argv[1], "bootstrap") == 0) { bootstrap_only = true; - if (argc == 3 && strcmp(argv[2], "-f") == 0) + if (argc > 3) { + fprintf(stderr, "Too many arguments\nUsage: pkg bootstrap [-f]\n"); + exit(EXIT_FAILURE); + } + if (argc == 3 && strcmp(argv[2], "-f") == 0) { force = true; + } else if (argc == 3) { + fprintf(stderr, "Invalid argument specified\nUsage: pkg bootstrap [-f]\n"); + exit(EXIT_FAILURE); + } } if ((bootstrap_only && force) || access(pkgpath, X_OK) == -1) { From owner-svn-src-all@freebsd.org Wed Jul 22 17:36:29 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 877A635A22F; Wed, 22 Jul 2020 17:36:29 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BBjLj30DHz4VY6; Wed, 22 Jul 2020 17:36:29 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 49FC3B418; Wed, 22 Jul 2020 17:36:29 +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 06MHaTEd033340; Wed, 22 Jul 2020 17:36:29 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06MHaTUV033339; Wed, 22 Jul 2020 17:36:29 GMT (envelope-from manu@FreeBSD.org) Message-Id: <202007221736.06MHaTUV033339@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Wed, 22 Jul 2020 17:36:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363422 - head/sys/cam/mmc X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/cam/mmc X-SVN-Commit-Revision: 363422 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 22 Jul 2020 17:36:29 -0000 Author: manu Date: Wed Jul 22 17:36:28 2020 New Revision: 363422 URL: https://svnweb.freebsd.org/changeset/base/363422 Log: mmc_xpt: Fix debug messages PROBE_RESET was printed for PROBE_IDENTIFY, fix this. While here add one for the PROBE_RESET. Submitted by: kibab Modified: head/sys/cam/mmc/mmc_xpt.c Modified: head/sys/cam/mmc/mmc_xpt.c ============================================================================== --- head/sys/cam/mmc/mmc_xpt.c Wed Jul 22 17:33:35 2020 (r363421) +++ head/sys/cam/mmc/mmc_xpt.c Wed Jul 22 17:36:28 2020 (r363422) @@ -574,10 +574,11 @@ mmcprobe_start(struct cam_periph *periph, union ccb *s /* Here is the place where the identify fun begins */ switch (softc->action) { case PROBE_RESET: + CAM_DEBUG(start_ccb->ccb_h.path, CAM_DEBUG_PROBE, ("Start with PROBE_RESET\n")); /* FALLTHROUGH */ case PROBE_IDENTIFY: xpt_path_inq(&start_ccb->cpi, periph->path); - CAM_DEBUG(start_ccb->ccb_h.path, CAM_DEBUG_PROBE, ("Start with PROBE_RESET\n")); + CAM_DEBUG(start_ccb->ccb_h.path, CAM_DEBUG_PROBE, ("Start with PROBE_IDENTIFY\n")); init_standard_ccb(start_ccb, XPT_GET_TRAN_SETTINGS); xpt_action(start_ccb); if (cts->ios.power_mode != power_off) { From owner-svn-src-all@freebsd.org Wed Jul 22 17:37:11 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CFFCD359FD7; Wed, 22 Jul 2020 17:37:11 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BBjMW58GKz4VTH; Wed, 22 Jul 2020 17:37:11 +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 93F02B419; Wed, 22 Jul 2020 17:37:11 +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 06MHbBKU033415; Wed, 22 Jul 2020 17:37:11 GMT (envelope-from lwhsu@FreeBSD.org) Received: (from lwhsu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06MHbBDx033414; Wed, 22 Jul 2020 17:37:11 GMT (envelope-from lwhsu@FreeBSD.org) Message-Id: <202007221737.06MHbBDx033414@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: lwhsu set sender to lwhsu@FreeBSD.org using -f From: Li-Wen Hsu Date: Wed, 22 Jul 2020 17:37:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363423 - head/tests/sys/geom/class/eli X-SVN-Group: head X-SVN-Commit-Author: lwhsu X-SVN-Commit-Paths: head/tests/sys/geom/class/eli X-SVN-Commit-Revision: 363423 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 22 Jul 2020 17:37:11 -0000 Author: lwhsu Date: Wed Jul 22 17:37:11 2020 New Revision: 363423 URL: https://svnweb.freebsd.org/changeset/base/363423 Log: Fix sys.geom.class.eli.onetime_test.onetime after r363402 PR: 247954 X-MFC with: r363402 Sponsored by: The FreeBSD Foundation Modified: head/tests/sys/geom/class/eli/onetime_test.sh Modified: head/tests/sys/geom/class/eli/onetime_test.sh ============================================================================== --- head/tests/sys/geom/class/eli/onetime_test.sh Wed Jul 22 17:36:28 2020 (r363422) +++ head/tests/sys/geom/class/eli/onetime_test.sh Wed Jul 22 17:37:11 2020 (r363423) @@ -130,7 +130,7 @@ onetime_d_cleanup() geli_test_cleanup } -atf_test_case onetime cleanup +atf_test_case onetime_null cleanup onetime_null_head() { atf_set "descr" "geli onetime can use the null cipher" From owner-svn-src-all@freebsd.org Wed Jul 22 18:21:37 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C2A6135B6CC; Wed, 22 Jul 2020 18:21:37 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BBkLn4nxkz4Xy9; Wed, 22 Jul 2020 18:21: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 6DFB4B75C; Wed, 22 Jul 2020 18:21: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 06MILb9P060788; Wed, 22 Jul 2020 18:21:37 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06MILbjm060787; Wed, 22 Jul 2020 18:21:37 GMT (envelope-from manu@FreeBSD.org) Message-Id: <202007221821.06MILbjm060787@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Wed, 22 Jul 2020 18:21:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363424 - head/sys/cam/mmc X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/cam/mmc X-SVN-Commit-Revision: 363424 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 22 Jul 2020 18:21:37 -0000 Author: manu Date: Wed Jul 22 18:21:37 2020 New Revision: 363424 URL: https://svnweb.freebsd.org/changeset/base/363424 Log: mmccam: Use a sbuf for the mmc ident function While here fix a typo. Modified: head/sys/cam/mmc/mmc_xpt.c Modified: head/sys/cam/mmc/mmc_xpt.c ============================================================================== --- head/sys/cam/mmc/mmc_xpt.c Wed Jul 22 17:37:11 2020 (r363423) +++ head/sys/cam/mmc/mmc_xpt.c Wed Jul 22 18:21:37 2020 (r363424) @@ -408,27 +408,47 @@ mmc_announce_periph(struct cam_periph *periph) void mmc_print_ident(struct mmc_params *ident_data) { - printf("Relative addr: %08x\n", ident_data->card_rca); - printf("Card features: <"); - if (ident_data->card_features & CARD_FEATURE_MMC) - printf("MMC "); - if (ident_data->card_features & CARD_FEATURE_MEMORY) - printf("Memory "); - if (ident_data->card_features & CARD_FEATURE_SDHC) - printf("High-Capacity "); - if (ident_data->card_features & CARD_FEATURE_SD20) - printf("SD2.0-Conditions "); - if (ident_data->card_features & CARD_FEATURE_SDIO) - printf("SDIO "); - printf(">\n"); + struct sbuf *sb; + bool space = false; - if (ident_data->card_features & CARD_FEATURE_MEMORY) - printf("Card memory OCR: %08x\n", ident_data->card_ocr); + sb = sbuf_new_auto(); + sbuf_printf(sb, "Relative addr: %08x\n", ident_data->card_rca); + sbuf_printf(sb, "Card features: <"); + if (ident_data->card_features & CARD_FEATURE_MMC) { + sbuf_printf(sb, "MMC"); + space = true; + } + if (ident_data->card_features & CARD_FEATURE_MEMORY) { + sbuf_printf(sb, "%sMemory", space ? " " : ""); + space = true; + } + if (ident_data->card_features & CARD_FEATURE_SDHC) { + sbuf_printf(sb, "%sHigh-Capacity", space ? " " : ""); + space = true; + } + if (ident_data->card_features & CARD_FEATURE_SD20) { + sbuf_printf(sb, "%sSD2.0-Conditions", space ? " " : ""); + space = true; + } + if (ident_data->card_features & CARD_FEATURE_SDIO) { + sbuf_printf(sb, "%sSDIO", space ? " " : ""); + space = true; + } + sbuf_printf(sb, ">\n"); - if (ident_data->card_features & CARD_FEATURE_SDIO) { - printf("Card IO OCR: %08x\n", ident_data->io_ocr); - printf("Number of funcitions: %u\n", ident_data->sdio_func_count); - } + if (ident_data->card_features & CARD_FEATURE_MEMORY) + sbuf_printf(sb, "Card memory OCR: %08x\n", + ident_data->card_ocr); + + if (ident_data->card_features & CARD_FEATURE_SDIO) { + sbuf_printf(sb, "Card IO OCR: %08x\n", ident_data->io_ocr); + sbuf_printf(sb, "Number of functions: %u\n", + ident_data->sdio_func_count); + } + + sbuf_finish(sb); + printf("%s", sbuf_data(sb)); + sbuf_clear(sb); } static void From owner-svn-src-all@freebsd.org Wed Jul 22 18:30:19 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 12CD035B9C4; Wed, 22 Jul 2020 18:30:19 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BBkXp6lgWz4YWl; Wed, 22 Jul 2020 18:30:18 +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 C7011B9B3; Wed, 22 Jul 2020 18:30:18 +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 06MIUIZt064436; Wed, 22 Jul 2020 18:30:18 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06MIUIQQ064434; Wed, 22 Jul 2020 18:30:18 GMT (envelope-from manu@FreeBSD.org) Message-Id: <202007221830.06MIUIQQ064434@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Wed, 22 Jul 2020 18:30:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363425 - in head/sys: cam/mmc dev/sdhci X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: in head/sys: cam/mmc dev/sdhci X-SVN-Commit-Revision: 363425 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 22 Jul 2020 18:30:19 -0000 Author: manu Date: Wed Jul 22 18:30:17 2020 New Revision: 363425 URL: https://svnweb.freebsd.org/changeset/base/363425 Log: mmccam: Add a generic mmccam_start_discovery function This is a generic function start a scan request for the given cam_sim. Other driver can now just use this function to request a new rescan. Submitted by: kibab Modified: head/sys/cam/mmc/mmc_all.h head/sys/cam/mmc/mmc_xpt.c head/sys/dev/sdhci/sdhci.c Modified: head/sys/cam/mmc/mmc_all.h ============================================================================== --- head/sys/cam/mmc/mmc_all.h Wed Jul 22 18:21:37 2020 (r363424) +++ head/sys/cam/mmc/mmc_all.h Wed Jul 22 18:30:17 2020 (r363425) @@ -64,6 +64,7 @@ #ifndef CAM_MMC_ALL_H #define CAM_MMC_ALL_H +#include #include #include @@ -72,5 +73,6 @@ struct ccb_pathinq; struct cam_sim; void mmc_path_inq(struct ccb_pathinq *cpi, const char *hba, const struct cam_sim *sim, size_t maxio); +void mmccam_start_discovery(struct cam_sim *sim); #endif Modified: head/sys/cam/mmc/mmc_xpt.c ============================================================================== --- head/sys/cam/mmc/mmc_xpt.c Wed Jul 22 18:21:37 2020 (r363424) +++ head/sys/cam/mmc/mmc_xpt.c Wed Jul 22 18:30:17 2020 (r363425) @@ -404,6 +404,29 @@ mmc_announce_periph(struct cam_periph *periph) printf("XPT info: CLK %04X, ...\n", cts.proto_specific.mmc.ios.clock); } +void +mmccam_start_discovery(struct cam_sim *sim) { + union ccb *ccb; + uint32_t pathid; + + pathid = cam_sim_path(sim); + ccb = xpt_alloc_ccb_nowait(); + if (ccb == NULL) { + return; + } + + /* + * We create a rescan request for BUS:0:0, since the card + * will be at lun 0. + */ + if (xpt_create_path(&ccb->ccb_h.path, NULL, pathid, + /* target */ 0, /* lun */ 0) != CAM_REQ_CMP) { + xpt_free_ccb(ccb); + return; + } + xpt_rescan(ccb); +} + /* This func is called per attached device :-( */ void mmc_print_ident(struct mmc_params *ident_data) Modified: head/sys/dev/sdhci/sdhci.c ============================================================================== --- head/sys/dev/sdhci/sdhci.c Wed Jul 22 18:21:37 2020 (r363424) +++ head/sys/dev/sdhci/sdhci.c Wed Jul 22 18:30:17 2020 (r363425) @@ -626,29 +626,8 @@ sdhci_card_task(void *arg, int pending __unused) slot_printf(slot, "Card inserted\n"); #ifdef MMCCAM slot->card_present = 1; - union ccb *ccb; - uint32_t pathid; - pathid = cam_sim_path(slot->sim); - ccb = xpt_alloc_ccb_nowait(); - if (ccb == NULL) { - slot_printf(slot, "Unable to alloc CCB for rescan\n"); - SDHCI_UNLOCK(slot); - return; - } - - /* - * We create a rescan request for BUS:0:0, since the card - * will be at lun 0. - */ - if (xpt_create_path(&ccb->ccb_h.path, NULL, pathid, - /* target */ 0, /* lun */ 0) != CAM_REQ_CMP) { - slot_printf(slot, "Unable to create path for rescan\n"); - SDHCI_UNLOCK(slot); - xpt_free_ccb(ccb); - return; - } + mmccam_start_discovery(slot->sim); SDHCI_UNLOCK(slot); - xpt_rescan(ccb); #else d = slot->dev = device_add_child(slot->bus, "mmc", -1); SDHCI_UNLOCK(slot); @@ -672,29 +651,8 @@ sdhci_card_task(void *arg, int pending __unused) slot->dev = NULL; #ifdef MMCCAM slot->card_present = 0; - union ccb *ccb; - uint32_t pathid; - pathid = cam_sim_path(slot->sim); - ccb = xpt_alloc_ccb_nowait(); - if (ccb == NULL) { - slot_printf(slot, "Unable to alloc CCB for rescan\n"); - SDHCI_UNLOCK(slot); - return; - } - - /* - * We create a rescan request for BUS:0:0, since the card - * will be at lun 0. - */ - if (xpt_create_path(&ccb->ccb_h.path, NULL, pathid, - /* target */ 0, /* lun */ 0) != CAM_REQ_CMP) { - slot_printf(slot, "Unable to create path for rescan\n"); - SDHCI_UNLOCK(slot); - xpt_free_ccb(ccb); - return; - } + mmccam_start_discovery(slot->sim); SDHCI_UNLOCK(slot); - xpt_rescan(ccb); #else slot->intmask &= ~sdhci_tuning_intmask(slot); WR4(slot, SDHCI_INT_ENABLE, slot->intmask); From owner-svn-src-all@freebsd.org Wed Jul 22 18:33:37 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9465D35BBE7; Wed, 22 Jul 2020 18:33:37 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BBkcd3TGdz4Yq0; Wed, 22 Jul 2020 18:33: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 5BA8CBE22; Wed, 22 Jul 2020 18:33: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 06MIXbOI070478; Wed, 22 Jul 2020 18:33:37 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06MIXb86070477; Wed, 22 Jul 2020 18:33:37 GMT (envelope-from manu@FreeBSD.org) Message-Id: <202007221833.06MIXb86070477@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Wed, 22 Jul 2020 18:33:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363426 - 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: 363426 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 22 Jul 2020 18:33:37 -0000 Author: manu Date: Wed Jul 22 18:33:36 2020 New Revision: 363426 URL: https://svnweb.freebsd.org/changeset/base/363426 Log: aw_mmc: Start a mmccam discovery when the CD handler is called. Submitted by: kibab Modified: head/sys/arm/allwinner/aw_mmc.c Modified: head/sys/arm/allwinner/aw_mmc.c ============================================================================== --- head/sys/arm/allwinner/aw_mmc.c Wed Jul 22 18:30:17 2020 (r363425) +++ head/sys/arm/allwinner/aw_mmc.c Wed Jul 22 18:33:36 2020 (r363426) @@ -371,6 +371,9 @@ aw_mmc_helper_cd_handler(device_t dev, bool present) struct aw_mmc_softc *sc; sc = device_get_softc(dev); +#ifdef MMCCAM + mmccam_start_discovery(sc->sim); +#else AW_MMC_LOCK(sc); if (present) { if (sc->child == NULL) { @@ -397,6 +400,7 @@ aw_mmc_helper_cd_handler(device_t dev, bool present) } else AW_MMC_UNLOCK(sc); } +#endif /* MMCCAM */ } static int From owner-svn-src-all@freebsd.org Wed Jul 22 19:04:46 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0BC7235D207; Wed, 22 Jul 2020 19:04:46 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BBlJY6Y0zz4byr; Wed, 22 Jul 2020 19:04:45 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C3E73C1C6; Wed, 22 Jul 2020 19:04:45 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06MJ4jGl089098; Wed, 22 Jul 2020 19:04:45 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06MJ4j7l089096; Wed, 22 Jul 2020 19:04:45 GMT (envelope-from manu@FreeBSD.org) Message-Id: <202007221904.06MJ4j7l089096@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Wed, 22 Jul 2020 19:04:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363427 - in head/sys/cam: . mmc X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: in head/sys/cam: . mmc X-SVN-Commit-Revision: 363427 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 22 Jul 2020 19:04:46 -0000 Author: manu Date: Wed Jul 22 19:04:45 2020 New Revision: 363427 URL: https://svnweb.freebsd.org/changeset/base/363427 Log: mmccam: Add support for 1.8V sdcard If the card reports that it support 1.8V signaling switch to this voltage. While here update the list of mode for mmccam. Submitted by: kibab Modified: head/sys/cam/cam_ccb.h head/sys/cam/mmc/mmc_xpt.c Modified: head/sys/cam/cam_ccb.h ============================================================================== --- head/sys/cam/cam_ccb.h Wed Jul 22 18:33:36 2020 (r363426) +++ head/sys/cam/cam_ccb.h Wed Jul 22 19:04:45 2020 (r363427) @@ -1046,14 +1046,41 @@ struct ccb_trans_settings_mmc { #define MMC_PM (1 << 5) #define MMC_BT (1 << 6) #define MMC_BM (1 << 7) +#define MMC_VCCQ (1 << 8) uint32_t ios_valid; /* The folowing is used only for GET_TRAN_SETTINGS */ uint32_t host_ocr; int host_f_min; int host_f_max; -#define MMC_CAP_4_BIT_DATA (1 << 0) /* Can do 4-bit data transfers */ -#define MMC_CAP_8_BIT_DATA (1 << 1) /* Can do 8-bit data transfers */ -#define MMC_CAP_HSPEED (1 << 2) /* Can do High Speed transfers */ +/* Copied from sys/dev/mmc/bridge.h */ +#define MMC_CAP_4_BIT_DATA (1 << 0) /* Can do 4-bit data transfers */ +#define MMC_CAP_8_BIT_DATA (1 << 1) /* Can do 8-bit data transfers */ +#define MMC_CAP_HSPEED (1 << 2) /* Can do High Speed transfers */ +#define MMC_CAP_BOOT_NOACC (1 << 4) /* Cannot access boot partitions */ +#define MMC_CAP_WAIT_WHILE_BUSY (1 << 5) /* Host waits for busy responses */ +#define MMC_CAP_UHS_SDR12 (1 << 6) /* Can do UHS SDR12 */ +#define MMC_CAP_UHS_SDR25 (1 << 7) /* Can do UHS SDR25 */ +#define MMC_CAP_UHS_SDR50 (1 << 8) /* Can do UHS SDR50 */ +#define MMC_CAP_UHS_SDR104 (1 << 9) /* Can do UHS SDR104 */ +#define MMC_CAP_UHS_DDR50 (1 << 10) /* Can do UHS DDR50 */ +#define MMC_CAP_MMC_DDR52_120 (1 << 11) /* Can do eMMC DDR52 at 1.2 V */ +#define MMC_CAP_MMC_DDR52_180 (1 << 12) /* Can do eMMC DDR52 at 1.8 V */ +#define MMC_CAP_MMC_DDR52 (MMC_CAP_MMC_DDR52_120 | MMC_CAP_MMC_DDR52_180) +#define MMC_CAP_MMC_HS200_120 (1 << 13) /* Can do eMMC HS200 at 1.2 V */ +#define MMC_CAP_MMC_HS200_180 (1 << 14) /* Can do eMMC HS200 at 1.8 V */ +#define MMC_CAP_MMC_HS200 (MMC_CAP_MMC_HS200_120| MMC_CAP_MMC_HS200_180) +#define MMC_CAP_MMC_HS400_120 (1 << 15) /* Can do eMMC HS400 at 1.2 V */ +#define MMC_CAP_MMC_HS400_180 (1 << 16) /* Can do eMMC HS400 at 1.8 V */ +#define MMC_CAP_MMC_HS400 (MMC_CAP_MMC_HS400_120 | MMC_CAP_MMC_HS400_180) +#define MMC_CAP_MMC_HSX00_120 (MMC_CAP_MMC_HS200_120 | MMC_CAP_MMC_HS400_120) +#define MMC_CAP_MMC_ENH_STROBE (1 << 17) /* Can do eMMC Enhanced Strobe */ +#define MMC_CAP_SIGNALING_120 (1 << 18) /* Can do signaling at 1.2 V */ +#define MMC_CAP_SIGNALING_180 (1 << 19) /* Can do signaling at 1.8 V */ +#define MMC_CAP_SIGNALING_330 (1 << 20) /* Can do signaling at 3.3 V */ +#define MMC_CAP_DRIVER_TYPE_A (1 << 21) /* Can do Driver Type A */ +#define MMC_CAP_DRIVER_TYPE_C (1 << 22) /* Can do Driver Type C */ +#define MMC_CAP_DRIVER_TYPE_D (1 << 23) /* Can do Driver Type D */ + uint32_t host_caps; uint32_t host_max_data; }; Modified: head/sys/cam/mmc/mmc_xpt.c ============================================================================== --- head/sys/cam/mmc/mmc_xpt.c Wed Jul 22 18:33:36 2020 (r363426) +++ head/sys/cam/mmc/mmc_xpt.c Wed Jul 22 19:04:45 2020 (r363427) @@ -167,6 +167,7 @@ typedef struct { union ccb saved_ccb; uint32_t flags; #define PROBE_FLAG_ACMD_SENT 0x1 /* CMD55 is sent, card expects ACMD */ +#define PROBE_FLAG_HOST_CAN_DO_18V 0x2 /* Host can do 1.8V signaling */ uint8_t acmd41_count; /* how many times ACMD41 has been issued */ struct cam_periph *periph; } mmcprobe_softc; @@ -457,6 +458,9 @@ mmc_print_ident(struct mmc_params *ident_data) sbuf_printf(sb, "%sSDIO", space ? " " : ""); space = true; } + if (ident_data->card_features & CARD_FEATURE_18V) { + sbuf_printf(sb, "%s1.8-Signaling", space ? " " : ""); + } sbuf_printf(sb, ">\n"); if (ident_data->card_features & CARD_FEATURE_MEMORY) @@ -636,6 +640,9 @@ mmcprobe_start(struct cam_periph *periph, union ccb *s init_standard_ccb(start_ccb, XPT_GET_TRAN_SETTINGS); xpt_action(start_ccb); + uint32_t host_caps = cts->host_caps; + if (host_caps & MMC_CAP_SIGNALING_180) + softc->flags |= PROBE_FLAG_HOST_CAN_DO_18V; uint32_t hv = mmc_highest_voltage(cts->host_ocr); init_standard_ccb(start_ccb, XPT_SET_TRAN_SETTINGS); cts->ios.vdd = hv; @@ -1008,6 +1015,18 @@ mmcprobe_done(struct cam_periph *periph, union ccb *do CAM_DEBUG(done_ccb->ccb_h.path, CAM_DEBUG_PROBE, ("Card supports 1.8V signaling\n")); mmcp->card_features |= CARD_FEATURE_18V; + if (softc->flags & PROBE_FLAG_HOST_CAN_DO_18V) { + CAM_DEBUG(done_ccb->ccb_h.path, CAM_DEBUG_PROBE, + ("Host supports 1.8V signaling. Switch voltage!\n")); + done_ccb->ccb_h.func_code = XPT_SET_TRAN_SETTINGS; + done_ccb->ccb_h.flags = CAM_DIR_NONE; + done_ccb->ccb_h.retry_count = 0; + done_ccb->ccb_h.timeout = 100; + done_ccb->ccb_h.cbfcnp = NULL; + done_ccb->cts.proto_specific.mmc.ios.vccq = vccq_180; + done_ccb->cts.proto_specific.mmc.ios_valid = MMC_VCCQ; + xpt_action(done_ccb); + } } } else { CAM_DEBUG(done_ccb->ccb_h.path, CAM_DEBUG_PROBE, From owner-svn-src-all@freebsd.org Wed Jul 22 19:08:05 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BC85B35D31A; Wed, 22 Jul 2020 19:08:05 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BBlNP4VRTz4cRl; Wed, 22 Jul 2020 19:08:05 +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 7D914C4A1; Wed, 22 Jul 2020 19:08:05 +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 06MJ85tT089507; Wed, 22 Jul 2020 19:08:05 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06MJ85q9089506; Wed, 22 Jul 2020 19:08:05 GMT (envelope-from manu@FreeBSD.org) Message-Id: <202007221908.06MJ85q9089506@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Wed, 22 Jul 2020 19:08:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363428 - head/sys/cam/mmc X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/cam/mmc X-SVN-Commit-Revision: 363428 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 22 Jul 2020 19:08:05 -0000 Author: manu Date: Wed Jul 22 19:08:05 2020 New Revision: 363428 URL: https://svnweb.freebsd.org/changeset/base/363428 Log: mmccam: Add support for 1.2V and 1.8V eMMC If the card reports that it support 1.2V or 1.8V signaling switch to this voltage. Submitted by: kibab Modified: head/sys/cam/mmc/mmc_da.c Modified: head/sys/cam/mmc/mmc_da.c ============================================================================== --- head/sys/cam/mmc/mmc_da.c Wed Jul 22 19:04:45 2020 (r363427) +++ head/sys/cam/mmc/mmc_da.c Wed Jul 22 19:08:05 2020 (r363428) @@ -136,6 +136,9 @@ struct sdda_softc { /* Generic switch timeout */ uint32_t cmd6_time; + uint32_t timings; /* Mask of bus timings supported */ + uint32_t vccq_120; /* Mask of bus timings at VCCQ of 1.2 V */ + uint32_t vccq_180; /* Mask of bus timings at VCCQ of 1.8 V */ /* MMC partitions support */ struct sdda_part *part[MMC_PART_MAX]; uint8_t part_curr; /* Partition currently switched to */ @@ -1242,6 +1245,7 @@ sdda_start_init(void *context, union ccb *start_ccb) uint32_t sec_count; int err; int host_f_max; + uint8_t card_type; CAM_DEBUG(periph->path, CAM_DEBUG_TRACE, ("sdda_start_init\n")); /* periph was held for us when this task was enqueued */ @@ -1370,12 +1374,35 @@ sdda_start_init(void *context, union ccb *start_ccb) } if (mmcp->card_features & CARD_FEATURE_MMC && mmc_get_spec_vers(periph) >= 4) { - if (softc->raw_ext_csd[EXT_CSD_CARD_TYPE] - & EXT_CSD_CARD_TYPE_HS_52) + card_type = softc->raw_ext_csd[EXT_CSD_CARD_TYPE]; + if (card_type & EXT_CSD_CARD_TYPE_HS_52) softc->card_f_max = MMC_TYPE_HS_52_MAX; - else if (softc->raw_ext_csd[EXT_CSD_CARD_TYPE] - & EXT_CSD_CARD_TYPE_HS_26) + else if (card_type & EXT_CSD_CARD_TYPE_HS_26) softc->card_f_max = MMC_TYPE_HS_26_MAX; + if ((card_type & EXT_CSD_CARD_TYPE_DDR_52_1_2V) != 0 && + (host_caps & MMC_CAP_SIGNALING_120) != 0) { + setbit(&softc->timings, bus_timing_mmc_ddr52); + setbit(&softc->vccq_120, bus_timing_mmc_ddr52); + CAM_DEBUG(periph->path, CAM_DEBUG_PERIPH, ("Card supports DDR52 at 1.2V\n")); + } + if ((card_type & EXT_CSD_CARD_TYPE_DDR_52_1_8V) != 0 && + (host_caps & MMC_CAP_SIGNALING_180) != 0) { + setbit(&softc->timings, bus_timing_mmc_ddr52); + setbit(&softc->vccq_180, bus_timing_mmc_ddr52); + CAM_DEBUG(periph->path, CAM_DEBUG_PERIPH, ("Card supports DDR52 at 1.8V\n")); + } + if ((card_type & EXT_CSD_CARD_TYPE_HS200_1_2V) != 0 && + (host_caps & MMC_CAP_SIGNALING_120) != 0) { + setbit(&softc->timings, bus_timing_mmc_hs200); + setbit(&softc->vccq_120, bus_timing_mmc_hs200); + CAM_DEBUG(periph->path, CAM_DEBUG_PERIPH, ("Card supports HS200 at 1.2V\n")); + } + if ((card_type & EXT_CSD_CARD_TYPE_HS200_1_8V) != 0 && + (host_caps & MMC_CAP_SIGNALING_180) != 0) { + setbit(&softc->timings, bus_timing_mmc_hs200); + setbit(&softc->vccq_180, bus_timing_mmc_hs200); + CAM_DEBUG(periph->path, CAM_DEBUG_PERIPH, ("Card supports HS200 at 1.8V\n")); + } } } int f_max; @@ -1391,6 +1418,46 @@ finish_hs_tests: f_max = 25000000; } } + /* If possible, set lower-level signaling */ + enum mmc_bus_timing timing; + /* FIXME: MMCCAM supports max. bus_timing_mmc_ddr52 at the moment. */ + for (timing = bus_timing_mmc_ddr52; timing > bus_timing_normal; timing--) { + if (isset(&softc->vccq_120, timing)) { + /* Set VCCQ = 1.2V */ + start_ccb->ccb_h.func_code = XPT_SET_TRAN_SETTINGS; + start_ccb->ccb_h.flags = CAM_DIR_NONE; + start_ccb->ccb_h.retry_count = 0; + start_ccb->ccb_h.timeout = 100; + start_ccb->ccb_h.cbfcnp = NULL; + cts->ios.vccq = vccq_120; + cts->ios_valid = MMC_VCCQ; + xpt_action(start_ccb); + break; + } else if (isset(&softc->vccq_180, timing)) { + /* Set VCCQ = 1.8V */ + start_ccb->ccb_h.func_code = XPT_SET_TRAN_SETTINGS; + start_ccb->ccb_h.flags = CAM_DIR_NONE; + start_ccb->ccb_h.retry_count = 0; + start_ccb->ccb_h.timeout = 100; + start_ccb->ccb_h.cbfcnp = NULL; + cts->ios.vccq = vccq_180; + cts->ios_valid = MMC_VCCQ; + xpt_action(start_ccb); + break; + } else { + /* Set VCCQ = 3.3V */ + start_ccb->ccb_h.func_code = XPT_SET_TRAN_SETTINGS; + start_ccb->ccb_h.flags = CAM_DIR_NONE; + start_ccb->ccb_h.retry_count = 0; + start_ccb->ccb_h.timeout = 100; + start_ccb->ccb_h.cbfcnp = NULL; + cts->ios.vccq = vccq_330; + cts->ios_valid = MMC_VCCQ; + xpt_action(start_ccb); + break; + } + } + /* Set frequency on the controller */ start_ccb->ccb_h.func_code = XPT_SET_TRAN_SETTINGS; start_ccb->ccb_h.flags = CAM_DIR_NONE; From owner-svn-src-all@freebsd.org Wed Jul 22 19:43:56 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 40F8935E46B; Wed, 22 Jul 2020 19:43:56 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BBm9m14bYz4fnT; Wed, 22 Jul 2020 19:43:56 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 092DBC9BE; Wed, 22 Jul 2020 19:43:56 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06MJhtVt014077; Wed, 22 Jul 2020 19:43:55 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06MJht06014076; Wed, 22 Jul 2020 19:43:55 GMT (envelope-from kp@FreeBSD.org) Message-Id: <202007221943.06MJht06014076@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Wed, 22 Jul 2020 19:43:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r363429 - stable/12/sys/net X-SVN-Group: stable-12 X-SVN-Commit-Author: kp X-SVN-Commit-Paths: stable/12/sys/net X-SVN-Commit-Revision: 363429 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 22 Jul 2020 19:43:56 -0000 Author: kp Date: Wed Jul 22 19:43:55 2020 New Revision: 363429 URL: https://svnweb.freebsd.org/changeset/base/363429 Log: MFC r363308: bridge: Don't sleep during epoch While it doesn't trigger INVARIANTS or WITNESS on head it does in stable/12. There's also no reason for it, as we can easily report the out of memory error to the caller (i.e. userspace). All of these can already fail. PR: 248046 Modified: stable/12/sys/net/if_bridge.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/net/if_bridge.c ============================================================================== --- stable/12/sys/net/if_bridge.c Wed Jul 22 19:08:05 2020 (r363428) +++ stable/12/sys/net/if_bridge.c Wed Jul 22 19:43:55 2020 (r363429) @@ -1467,9 +1467,9 @@ bridge_ioctl_gifs(struct bridge_softc *sc, void *arg) bifc->ifbic_len = buflen; return (0); } - BRIDGE_UNLOCK(sc); - outbuf = malloc(buflen, M_TEMP, M_WAITOK | M_ZERO); - BRIDGE_LOCK(sc); + outbuf = malloc(buflen, M_TEMP, M_NOWAIT | M_ZERO); + if (outbuf == NULL) + return (ENOMEM); count = 0; buf = outbuf; @@ -1529,9 +1529,9 @@ bridge_ioctl_rts(struct bridge_softc *sc, void *arg) count++; buflen = sizeof(bareq) * count; - BRIDGE_UNLOCK(sc); - outbuf = malloc(buflen, M_TEMP, M_WAITOK | M_ZERO); - BRIDGE_LOCK(sc); + outbuf = malloc(buflen, M_TEMP, M_NOWAIT | M_ZERO); + if (outbuf == NULL) + return (ENOMEM); count = 0; buf = outbuf; @@ -1857,9 +1857,9 @@ bridge_ioctl_gifsstp(struct bridge_softc *sc, void *ar return (0); } - BRIDGE_UNLOCK(sc); - outbuf = malloc(buflen, M_TEMP, M_WAITOK | M_ZERO); - BRIDGE_LOCK(sc); + outbuf = malloc(buflen, M_TEMP, M_NOWAIT | M_ZERO); + if (outbuf == NULL) + return (ENOMEM); count = 0; buf = outbuf; From owner-svn-src-all@freebsd.org Wed Jul 22 20:13:13 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9622635F363; Wed, 22 Jul 2020 20:13:13 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BBmqY3TFpz4hq7; Wed, 22 Jul 2020 20:13:13 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5A381CBF4; Wed, 22 Jul 2020 20:13:13 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06MKDDGm032682; Wed, 22 Jul 2020 20:13:13 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06MKDD85032681; Wed, 22 Jul 2020 20:13:13 GMT (envelope-from kp@FreeBSD.org) Message-Id: <202007222013.06MKDD85032681@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Wed, 22 Jul 2020 20:13:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r363430 - stable/12/sys/net X-SVN-Group: stable-12 X-SVN-Commit-Author: kp X-SVN-Commit-Paths: stable/12/sys/net X-SVN-Commit-Revision: 363430 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 22 Jul 2020 20:13:13 -0000 Author: kp Date: Wed Jul 22 20:13:12 2020 New Revision: 363430 URL: https://svnweb.freebsd.org/changeset/base/363430 Log: bridge: Enter epoch for bridge_input()/bridge_output() In stable/12 epoch is not as wide as it is in head. The network stack isn't yet in epoch when bridge_input()/bridge_output() get called, so rather than assert this we must enter it ourselves. This is a direct commit to stable/12. PR: 248046 Differential Revision: https://reviews.freebsd.org/D25715 Modified: stable/12/sys/net/if_bridge.c Modified: stable/12/sys/net/if_bridge.c ============================================================================== --- stable/12/sys/net/if_bridge.c Wed Jul 22 19:43:55 2020 (r363429) +++ stable/12/sys/net/if_bridge.c Wed Jul 22 20:13:12 2020 (r363430) @@ -605,7 +605,7 @@ vnet_bridge_uninit(const void *unused __unused) /* Before we can destroy the uma zone, because there are callbacks that * use it. */ - NET_EPOCH_WAIT(); + epoch_drain_callbacks(net_epoch_preempt); uma_zdestroy(V_bridge_rtnode_zone); } @@ -2114,17 +2114,20 @@ static int bridge_output(struct ifnet *ifp, struct mbuf *m, struct sockaddr *sa, struct rtentry *rt) { + struct epoch_tracker et; struct ether_header *eh; struct ifnet *dst_if; struct bridge_softc *sc; uint16_t vlan; - MPASS(in_epoch(net_epoch_preempt)); + NET_EPOCH_ENTER_ET(et); if (m->m_len < ETHER_HDR_LEN) { m = m_pullup(m, ETHER_HDR_LEN); - if (m == NULL) + if (m == NULL) { + NET_EPOCH_EXIT_ET(et); return (0); + } } eh = mtod(m, struct ether_header *); @@ -2189,6 +2192,7 @@ bridge_output(struct ifnet *ifp, struct mbuf *m, struc } if (used == 0) m_freem(m); + NET_EPOCH_EXIT_ET(et); return (0); } @@ -2200,10 +2204,12 @@ sendunicast: bridge_span(sc, m); if ((dst_if->if_drv_flags & IFF_DRV_RUNNING) == 0) { m_freem(m); + NET_EPOCH_EXIT_ET(et); return (0); } bridge_enqueue(sc, dst_if, m); + NET_EPOCH_EXIT_ET(et); return (0); } @@ -2400,6 +2406,7 @@ drop: static struct mbuf * bridge_input(struct ifnet *ifp, struct mbuf *m) { + struct epoch_tracker et; struct bridge_softc *sc = ifp->if_bridge; struct bridge_iflist *bif, *bif2; struct ifnet *bifp; @@ -2408,10 +2415,12 @@ bridge_input(struct ifnet *ifp, struct mbuf *m) uint16_t vlan; int error; - MPASS(in_epoch(net_epoch_preempt)); + NET_EPOCH_ENTER_ET(et); - if ((sc->sc_ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) + if ((sc->sc_ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) { + NET_EPOCH_EXIT_ET(et); return (m); + } bifp = sc->sc_ifp; vlan = VLANTAGOF(m); @@ -2428,10 +2437,12 @@ bridge_input(struct ifnet *ifp, struct mbuf *m) if_inc_counter(bifp, IFCOUNTER_IPACKETS, 1); if_inc_counter(bifp, IFCOUNTER_IBYTES, m->m_pkthdr.len); m_freem(m); + NET_EPOCH_EXIT_ET(et); return (NULL); } bif = bridge_lookup_member_if(sc, ifp); if (bif == NULL) { + NET_EPOCH_EXIT_ET(et); return (m); } @@ -2444,11 +2455,13 @@ bridge_input(struct ifnet *ifp, struct mbuf *m) if (memcmp(eh->ether_dhost, bstp_etheraddr, ETHER_ADDR_LEN) == 0) { bstp_input(&bif->bif_stp, ifp, m); /* consumes mbuf */ + NET_EPOCH_EXIT_ET(et); return (NULL); } if ((bif->bif_flags & IFBIF_STP) && bif->bif_stp.bp_state == BSTP_IFSTATE_DISCARDING) { + NET_EPOCH_EXIT_ET(et); return (m); } @@ -2459,6 +2472,7 @@ bridge_input(struct ifnet *ifp, struct mbuf *m) */ mc = m_dup(m, M_NOWAIT); if (mc == NULL) { + NET_EPOCH_EXIT_ET(et); return (m); } @@ -2485,11 +2499,13 @@ bridge_input(struct ifnet *ifp, struct mbuf *m) } /* Return the original packet for local processing. */ + NET_EPOCH_EXIT_ET(et); return (m); } if ((bif->bif_flags & IFBIF_STP) && bif->bif_stp.bp_state == BSTP_IFSTATE_DISCARDING) { + NET_EPOCH_EXIT_ET(et); return (m); } @@ -2539,10 +2555,12 @@ bridge_input(struct ifnet *ifp, struct mbuf *m) vlan, bif, 0, IFBAF_DYNAMIC); \ if (error && bif->bif_addrmax) { \ m_freem(m); \ + NET_EPOCH_EXIT_ET(et); \ return (NULL); \ } \ } \ m->m_pkthdr.rcvif = iface; \ + NET_EPOCH_EXIT_ET(et); \ return (m); \ } \ \ @@ -2551,6 +2569,7 @@ bridge_input(struct ifnet *ifp, struct mbuf *m) OR_CARP_CHECK_WE_ARE_SRC((iface)) \ ) { \ m_freem(m); \ + NET_EPOCH_EXIT_ET(et); \ return (NULL); \ } @@ -2581,6 +2600,7 @@ bridge_input(struct ifnet *ifp, struct mbuf *m) /* Perform the bridge forwarding function. */ bridge_forward(sc, bif, m); + NET_EPOCH_EXIT_ET(et); return (NULL); } From owner-svn-src-all@freebsd.org Wed Jul 22 20:15:22 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4C7EB35F1EE; Wed, 22 Jul 2020 20:15:22 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BBmt21KQ0z4j24; Wed, 22 Jul 2020 20:15:22 +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 10951D22E; Wed, 22 Jul 2020 20:15:22 +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 06MKFLke032849; Wed, 22 Jul 2020 20:15:21 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06MKFLdR032848; Wed, 22 Jul 2020 20:15:21 GMT (envelope-from mav@FreeBSD.org) Message-Id: <202007222015.06MKFLdR032848@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Wed, 22 Jul 2020 20:15:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363431 - in head/sys: amd64/amd64 i386/i386 X-SVN-Group: head X-SVN-Commit-Author: mav X-SVN-Commit-Paths: in head/sys: amd64/amd64 i386/i386 X-SVN-Commit-Revision: 363431 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 22 Jul 2020 20:15:22 -0000 Author: mav Date: Wed Jul 22 20:15:21 2020 New Revision: 363431 URL: https://svnweb.freebsd.org/changeset/base/363431 Log: Untie nmi_handle_intr() from DEV_ISA. The only part of nmi_handle_intr() depending on ISA is isa_nmi(), which is already wrapped. Entering debugger on NMI does not really depend on ISA. MFC after: 2 weeks Modified: head/sys/amd64/amd64/trap.c head/sys/i386/i386/trap.c Modified: head/sys/amd64/amd64/trap.c ============================================================================== --- head/sys/amd64/amd64/trap.c Wed Jul 22 20:13:12 2020 (r363430) +++ head/sys/amd64/amd64/trap.c Wed Jul 22 20:15:21 2020 (r363431) @@ -350,11 +350,9 @@ trap(struct trapframe *frame) signo = SIGFPE; break; -#ifdef DEV_ISA case T_NMI: nmi_handle_intr(type, frame); return; -#endif case T_OFLOW: /* integer overflow fault */ ucode = FPE_INTOVF; @@ -580,11 +578,9 @@ trap(struct trapframe *frame) #endif break; -#ifdef DEV_ISA case T_NMI: nmi_handle_intr(type, frame); return; -#endif } trap_fatal(frame, 0); Modified: head/sys/i386/i386/trap.c ============================================================================== --- head/sys/i386/i386/trap.c Wed Jul 22 20:13:12 2020 (r363430) +++ head/sys/i386/i386/trap.c Wed Jul 22 20:15:21 2020 (r363431) @@ -407,7 +407,6 @@ user_trctrap_out: signo = SIGFPE; break; -#ifdef DEV_ISA case T_NMI: #ifdef POWERFAIL_NMI #ifndef TIMER_FREQ @@ -423,7 +422,6 @@ user_trctrap_out: nmi_handle_intr(type, frame); return; #endif /* POWERFAIL_NMI */ -#endif /* DEV_ISA */ case T_OFLOW: /* integer overflow fault */ ucode = FPE_INTOVF; @@ -669,7 +667,6 @@ kernel_trctrap: #endif break; -#ifdef DEV_ISA case T_NMI: #ifdef POWERFAIL_NMI if (time_second - lastalert > 10) { @@ -682,7 +679,6 @@ kernel_trctrap: nmi_handle_intr(type, frame); return; #endif /* POWERFAIL_NMI */ -#endif /* DEV_ISA */ } trap_fatal(frame, eva); From owner-svn-src-all@freebsd.org Wed Jul 22 21:06:33 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 68F0D360E56; Wed, 22 Jul 2020 21:06:33 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BBp1527Tpz4lqp; Wed, 22 Jul 2020 21:06:33 +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 27F8FD7D4; Wed, 22 Jul 2020 21:06:33 +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 06ML6WBl063973; Wed, 22 Jul 2020 21:06:33 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06ML6WNp063972; Wed, 22 Jul 2020 21:06:32 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <202007222106.06ML6WNp063972@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Wed, 22 Jul 2020 21:06:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r363432 - stable/12/lib/libc/gen X-SVN-Group: stable-12 X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: stable/12/lib/libc/gen X-SVN-Commit-Revision: 363432 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 22 Jul 2020 21:06:33 -0000 Author: brooks Date: Wed Jul 22 21:06:32 2020 New Revision: 363432 URL: https://svnweb.freebsd.org/changeset/base/363432 Log: MFC r363228: Don't imply that all action values can be OR'd. This is neither POSIX compliant nor what the implementation does. This could be allowed by changing the value of TCSAFLUSH from 2 to 3, but that doesn't seem worthwhile after 25+ years. Reviewed by: imp Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D25659 Modified: stable/12/lib/libc/gen/tcsetattr.3 Directory Properties: stable/12/ (props changed) Modified: stable/12/lib/libc/gen/tcsetattr.3 ============================================================================== --- stable/12/lib/libc/gen/tcsetattr.3 Wed Jul 22 20:15:21 2020 (r363431) +++ stable/12/lib/libc/gen/tcsetattr.3 Wed Jul 22 21:06:32 2020 (r363432) @@ -28,7 +28,7 @@ .\" @(#)tcsetattr.3 8.3 (Berkeley) 1/2/94 .\" $FreeBSD$ .\" -.Dd January 2, 1994 +.Dd July 15, 2020 .Dt TCSETATTR 3 .Os .Sh NAME @@ -221,8 +221,7 @@ termios structure referenced by .Fa tp . The .Fa action -argument is created by -.Em or Ns 'ing +argument is one of the following values, as specified in the include file .In termios.h . .Bl -tag -width "TCSADRAIN" @@ -240,18 +239,20 @@ The change occurs after all output written to .Fa fd has been transmitted to the terminal. Additionally, any input that has been received but not read is discarded. -.It Fa TCSASOFT -If this value is -.Em or Ns 'ed -into the +.El +.Pp +The .Fa action -value, the values of the +may be modified by +.Em or Ns 'ing +in +.Fa TCSASOFT +which causes the values of the .Va c_cflag , .Va c_ispeed , and .Va c_ospeed -fields are ignored. -.El +fields to be ignored. .Pp The 0 baud rate is used to terminate the connection. If 0 is specified as the output speed to the function From owner-svn-src-all@freebsd.org Wed Jul 22 21:17:03 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7EEEB361984; Wed, 22 Jul 2020 21:17:03 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BBpFC2qxpz4n1L; Wed, 22 Jul 2020 21:17:03 +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 40214DE05; Wed, 22 Jul 2020 21:17:03 +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 06MLH3EH070458; Wed, 22 Jul 2020 21:17:03 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06MLH3Hq070457; Wed, 22 Jul 2020 21:17:03 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <202007222117.06MLH3Hq070457@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Wed, 22 Jul 2020 21:17:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r363433 - in stable: 11/sys/x86/x86 12/sys/x86/x86 X-SVN-Group: stable-12 X-SVN-Commit-Author: jkim X-SVN-Commit-Paths: in stable: 11/sys/x86/x86 12/sys/x86/x86 X-SVN-Commit-Revision: 363433 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 22 Jul 2020 21:17:03 -0000 Author: jkim Date: Wed Jul 22 21:17:02 2020 New Revision: 363433 URL: https://svnweb.freebsd.org/changeset/base/363433 Log: MFC: r362509 Assume all TSCs are synchronized for AMD Family 17h processors and later when it has passed the synchronization test. Modified: stable/12/sys/x86/x86/tsc.c Directory Properties: stable/12/ (props changed) Changes in other areas also in this revision: Modified: stable/11/sys/x86/x86/tsc.c Directory Properties: stable/11/ (props changed) Modified: stable/12/sys/x86/x86/tsc.c ============================================================================== --- stable/12/sys/x86/x86/tsc.c Wed Jul 22 21:06:32 2020 (r363432) +++ stable/12/sys/x86/x86/tsc.c Wed Jul 22 21:17:02 2020 (r363433) @@ -530,6 +530,13 @@ retry: case CPU_VENDOR_AMD: case CPU_VENDOR_HYGON: /* + * Processor Programming Reference (PPR) for AMD + * Family 17h states that the TSC uses a common + * reference for all sockets, cores and threads. + */ + if (CPUID_TO_FAMILY(cpu_id) >= 0x17) + return (1000); + /* * Starting with Family 15h processors, TSC clock * source is in the north bridge. Check whether * we have a single-socket/multi-core platform. From owner-svn-src-all@freebsd.org Wed Jul 22 21:17:03 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BDB91361930; Wed, 22 Jul 2020 21:17:03 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BBpFC4hZpz4mmy; Wed, 22 Jul 2020 21:17:03 +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 84E8EDCB2; Wed, 22 Jul 2020 21:17:03 +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 06MLH3Rl070464; Wed, 22 Jul 2020 21:17:03 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06MLH3Nn070463; Wed, 22 Jul 2020 21:17:03 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <202007222117.06MLH3Nn070463@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Wed, 22 Jul 2020 21:17: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: r363433 - in stable: 11/sys/x86/x86 12/sys/x86/x86 X-SVN-Group: stable-11 X-SVN-Commit-Author: jkim X-SVN-Commit-Paths: in stable: 11/sys/x86/x86 12/sys/x86/x86 X-SVN-Commit-Revision: 363433 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 22 Jul 2020 21:17:03 -0000 Author: jkim Date: Wed Jul 22 21:17:02 2020 New Revision: 363433 URL: https://svnweb.freebsd.org/changeset/base/363433 Log: MFC: r362509 Assume all TSCs are synchronized for AMD Family 17h processors and later when it has passed the synchronization test. Modified: stable/11/sys/x86/x86/tsc.c Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/12/sys/x86/x86/tsc.c Directory Properties: stable/12/ (props changed) Modified: stable/11/sys/x86/x86/tsc.c ============================================================================== --- stable/11/sys/x86/x86/tsc.c Wed Jul 22 21:06:32 2020 (r363432) +++ stable/11/sys/x86/x86/tsc.c Wed Jul 22 21:17:02 2020 (r363433) @@ -495,6 +495,13 @@ retry: switch (cpu_vendor_id) { case CPU_VENDOR_AMD: /* + * Processor Programming Reference (PPR) for AMD + * Family 17h states that the TSC uses a common + * reference for all sockets, cores and threads. + */ + if (CPUID_TO_FAMILY(cpu_id) >= 0x17) + return (1000); + /* * Starting with Family 15h processors, TSC clock * source is in the north bridge. Check whether * we have a single-socket/multi-core platform. From owner-svn-src-all@freebsd.org Wed Jul 22 21:30:18 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BBFF33618DA; Wed, 22 Jul 2020 21:30:18 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BBpXV4MVgz4nXr; Wed, 22 Jul 2020 21:30:18 +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 74A68DE9A; Wed, 22 Jul 2020 21:30:18 +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 06MLUIuN076594; Wed, 22 Jul 2020 21:30:18 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06MLUI3c076593; Wed, 22 Jul 2020 21:30:18 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <202007222130.06MLUI3c076593@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Wed, 22 Jul 2020 21:30: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: r363434 - stable/11/lib/libc/gen X-SVN-Group: stable-11 X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: stable/11/lib/libc/gen X-SVN-Commit-Revision: 363434 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 22 Jul 2020 21:30:18 -0000 Author: brooks Date: Wed Jul 22 21:30:18 2020 New Revision: 363434 URL: https://svnweb.freebsd.org/changeset/base/363434 Log: MFC r363228: Don't imply that all action values can be OR'd. This is neither POSIX compliant nor what the implementation does. This could be allowed by changing the value of TCSAFLUSH from 2 to 3, but that doesn't seem worthwhile after 25+ years. Reviewed by: imp Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D25659 Modified: stable/11/lib/libc/gen/tcsetattr.3 Directory Properties: stable/11/ (props changed) Modified: stable/11/lib/libc/gen/tcsetattr.3 ============================================================================== --- stable/11/lib/libc/gen/tcsetattr.3 Wed Jul 22 21:17:02 2020 (r363433) +++ stable/11/lib/libc/gen/tcsetattr.3 Wed Jul 22 21:30:18 2020 (r363434) @@ -28,7 +28,7 @@ .\" @(#)tcsetattr.3 8.3 (Berkeley) 1/2/94 .\" $FreeBSD$ .\" -.Dd January 2, 1994 +.Dd July 15, 2020 .Dt TCSETATTR 3 .Os .Sh NAME @@ -221,8 +221,7 @@ termios structure referenced by .Fa tp . The .Fa action -argument is created by -.Em or Ns 'ing +argument is one of the following values, as specified in the include file .In termios.h . .Bl -tag -width "TCSADRAIN" @@ -240,18 +239,20 @@ The change occurs after all output written to .Fa fd has been transmitted to the terminal. Additionally, any input that has been received but not read is discarded. -.It Fa TCSASOFT -If this value is -.Em or Ns 'ed -into the +.El +.Pp +The .Fa action -value, the values of the +may be modified by +.Em or Ns 'ing +in +.Fa TCSASOFT +which causes the values of the .Va c_cflag , .Va c_ispeed , and .Va c_ospeed -fields are ignored. -.El +fields to be ignored. .Pp The 0 baud rate is used to terminate the connection. If 0 is specified as the output speed to the function From owner-svn-src-all@freebsd.org Wed Jul 22 21:44:52 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9F570361DDE; Wed, 22 Jul 2020 21:44:52 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BBpsJ3TQfz4p6w; Wed, 22 Jul 2020 21:44: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 5B060E3BE; Wed, 22 Jul 2020 21:44: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 06MLiqx0088497; Wed, 22 Jul 2020 21:44:52 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06MLiqjq088496; Wed, 22 Jul 2020 21:44:52 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <202007222144.06MLiqjq088496@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Wed, 22 Jul 2020 21:44:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363435 - head/usr.sbin/mountd X-SVN-Group: head X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: head/usr.sbin/mountd X-SVN-Commit-Revision: 363435 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 22 Jul 2020 21:44:52 -0000 Author: brooks Date: Wed Jul 22 21:44:51 2020 New Revision: 363435 URL: https://svnweb.freebsd.org/changeset/base/363435 Log: Avoid reading one byte before the path buffer. This happens when there's only one component (e.g. "/foo"). This (mostly-harmless) bug has been present since June 1990 when it was commited to mountd.c SCCS version 5.9. Note: the bug is on the second changed line, the first line is changed for visual consistency. Reviewed by: cem, emaste, mckusick, rmacklem Found with: CHERI Obtained from: CheriBSD MFC after: 1 week Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D25759 Modified: head/usr.sbin/mountd/mountd.c Modified: head/usr.sbin/mountd/mountd.c ============================================================================== --- head/usr.sbin/mountd/mountd.c Wed Jul 22 21:30:18 2020 (r363434) +++ head/usr.sbin/mountd/mountd.c Wed Jul 22 21:44:51 2020 (r363435) @@ -3155,9 +3155,9 @@ do_mount(struct exportlist *ep, struct grouplist *grp, goto error_exit; } /* back up over the last component */ - while (*cp == '/' && cp > dirp) + while (cp > dirp && *cp == '/') cp--; - while (*(cp - 1) != '/' && cp > dirp) + while (cp > dirp && *(cp - 1) != '/') cp--; if (cp == dirp) { if (debug) From owner-svn-src-all@freebsd.org Wed Jul 22 22:51:15 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0440B3633BE; Wed, 22 Jul 2020 22:51:15 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BBrKt6100z4sCZ; Wed, 22 Jul 2020 22:51:14 +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 B24FFEA5E; Wed, 22 Jul 2020 22:51:14 +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 06MMpE0l027411; Wed, 22 Jul 2020 22:51:14 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06MMpEdF027410; Wed, 22 Jul 2020 22:51:14 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202007222251.06MMpEdF027410@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Wed, 22 Jul 2020 22:51:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363436 - in head/sys: arm64/arm64 riscv/riscv X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in head/sys: arm64/arm64 riscv/riscv X-SVN-Commit-Revision: 363436 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 22 Jul 2020 22:51:15 -0000 Author: jhb Date: Wed Jul 22 22:51:14 2020 New Revision: 363436 URL: https://svnweb.freebsd.org/changeset/base/363436 Log: Add missing space after switch. Reviewed by: br, emaste Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D25778 Modified: head/sys/arm64/arm64/trap.c head/sys/riscv/riscv/trap.c Modified: head/sys/arm64/arm64/trap.c ============================================================================== --- head/sys/arm64/arm64/trap.c Wed Jul 22 21:44:51 2020 (r363435) +++ head/sys/arm64/arm64/trap.c Wed Jul 22 22:51:14 2020 (r363436) @@ -341,7 +341,7 @@ do_el1h_sync(struct thread *td, struct trapframe *fram break; } - switch(exception) { + switch (exception) { case EXCP_FP_SIMD: case EXCP_TRAP_FP: #ifdef VFP @@ -452,7 +452,7 @@ do_el0_sync(struct thread *td, struct trapframe *frame "do_el0_sync: curthread: %p, esr %lx, elr: %lx, frame: %p", td, esr, frame->tf_elr, frame); - switch(exception) { + switch (exception) { case EXCP_FP_SIMD: case EXCP_TRAP_FP: #ifdef VFP Modified: head/sys/riscv/riscv/trap.c ============================================================================== --- head/sys/riscv/riscv/trap.c Wed Jul 22 21:44:51 2020 (r363435) +++ head/sys/riscv/riscv/trap.c Wed Jul 22 22:51:14 2020 (r363436) @@ -269,7 +269,7 @@ do_trap_supervisor(struct trapframe *frame) CTR3(KTR_TRAP, "do_trap_supervisor: curthread: %p, sepc: %lx, frame: %p", curthread, frame->tf_sepc, frame); - switch(exception) { + switch (exception) { case EXCP_FAULT_LOAD: case EXCP_FAULT_STORE: case EXCP_FAULT_FETCH: @@ -326,7 +326,7 @@ do_trap_user(struct trapframe *frame) CTR3(KTR_TRAP, "do_trap_user: curthread: %p, sepc: %lx, frame: %p", curthread, frame->tf_sepc, frame); - switch(exception) { + switch (exception) { case EXCP_FAULT_LOAD: case EXCP_FAULT_STORE: case EXCP_FAULT_FETCH: From owner-svn-src-all@freebsd.org Wed Jul 22 23:33:38 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D0A88363C64; Wed, 22 Jul 2020 23:33:38 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BBsGp4y2Bz4tvq; Wed, 22 Jul 2020 23:33:38 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8D571F726; Wed, 22 Jul 2020 23:33:38 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06MNXcFu056341; Wed, 22 Jul 2020 23:33:38 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06MNXcpE056339; Wed, 22 Jul 2020 23:33:38 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <202007222333.06MNXcpE056339@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Wed, 22 Jul 2020 23:33:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363437 - head/sys/fs/nfsclient X-SVN-Group: head X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: head/sys/fs/nfsclient X-SVN-Commit-Revision: 363437 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 22 Jul 2020 23:33:38 -0000 Author: rmacklem Date: Wed Jul 22 23:33:37 2020 New Revision: 363437 URL: https://svnweb.freebsd.org/changeset/base/363437 Log: Modify writing to mirrored pNFS DSs to prepare for use of ext_pgs mbufs. This patch modifies writing to mirrored pNFS DSs slightly so that there is only one m_copym() call for a mirrored pair instead of two of them. This call replaces the custom nfsm_copym() call, which is no longer needed and deleted by this patch. The patch does introduce a new nfsm_split() function that only calls m_split() for the non-ext_pgs case. The semantics of nfsm_uiombuflist() is changed to include code that nul pads the generated mbuf list. This was done by nfsm_copym() prior to this patch. The main reason for this change is that it allows the data to be a list of ext_pgs mbufs, since the m_copym() is for the entire mbuf list. This support will be added in a future commit. This patch only affects writing to mirrored flexible file layout pNFS servers. Modified: head/sys/fs/nfsclient/nfs_clcomsubs.c head/sys/fs/nfsclient/nfs_clrpcops.c Modified: head/sys/fs/nfsclient/nfs_clcomsubs.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clcomsubs.c Wed Jul 22 22:51:14 2020 (r363436) +++ head/sys/fs/nfsclient/nfs_clcomsubs.c Wed Jul 22 23:33:37 2020 (r363437) @@ -164,9 +164,9 @@ nfsm_uiombuflist(struct uio *uiop, int siz, struct mbu { char *uiocp; struct mbuf *mp, *mp2, *firstmp; - int xfer, left, mlen; + int i, left, mlen, rem, xfer; int uiosiz, clflg; - char *tcp; + char *mcp, *tcp; KASSERT(uiop->uio_iovcnt == 1, ("nfsm_uiotombuf: iovcnt != 1")); @@ -179,7 +179,9 @@ nfsm_uiombuflist(struct uio *uiop, int siz, struct mbu else NFSMGET(mp); mp->m_len = 0; + mcp = mtod(mp, char *); firstmp = mp2 = mp; + rem = NFSM_RNDUP(siz) - siz; while (siz > 0) { left = uiop->uio_iov->iov_len; uiocp = uiop->uio_iov->iov_base; @@ -194,18 +196,18 @@ nfsm_uiombuflist(struct uio *uiop, int siz, struct mbu else NFSMGET(mp); mp->m_len = 0; + mcp = mtod(mp, char *); mp2->m_next = mp; mp2 = mp; mlen = M_TRAILINGSPACE(mp); } xfer = (left > mlen) ? mlen : left; if (uiop->uio_segflg == UIO_SYSSPACE) - NFSBCOPY(uiocp, mtod(mp, caddr_t) + - mp->m_len, xfer); + NFSBCOPY(uiocp, mcp, xfer); else - copyin(uiocp, mtod(mp, caddr_t) + - mp->m_len, xfer); + copyin(uiocp, mcp, xfer); mp->m_len += xfer; + mcp += xfer; left -= xfer; uiocp += xfer; uiop->uio_offset += xfer; @@ -216,6 +218,13 @@ nfsm_uiombuflist(struct uio *uiop, int siz, struct mbu uiop->uio_iov->iov_base = (void *)tcp; uiop->uio_iov->iov_len -= uiosiz; siz -= uiosiz; + } + if (rem > 0) { + KASSERT(rem <= M_TRAILINGSPACE(mp), + ("nfsm_uiombuflist: no space for padding")); + for (i = 0; i < rem; i++) + *mcp++ = '\0'; + mp->m_len += rem; } if (cpp != NULL) *cpp = mtod(mp, caddr_t) + mp->m_len; Modified: head/sys/fs/nfsclient/nfs_clrpcops.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clrpcops.c Wed Jul 22 22:51:14 2020 (r363436) +++ head/sys/fs/nfsclient/nfs_clrpcops.c Wed Jul 22 23:33:37 2020 (r363437) @@ -158,7 +158,6 @@ static int nfscl_dofflayoutio(vnode_t, struct uio *, i nfsv4stateid_t *, int, struct nfscldevinfo *, struct nfscllayout *, struct nfsclflayout *, uint64_t, uint64_t, int, int, struct mbuf *, struct nfsclwritedsdorpc *, struct ucred *, NFSPROC_T *); -static struct mbuf *nfsm_copym(struct mbuf *, int, int); static int nfsrpc_readds(vnode_t, struct uio *, nfsv4stateid_t *, int *, struct nfsclds *, uint64_t, int, struct nfsfh *, int, int, int, struct ucred *, NFSPROC_T *); @@ -220,6 +219,7 @@ static int nfsrpc_copyrpc(vnode_t, off_t, vnode_t, off struct nfsvattr *, int *, bool, int *, struct ucred *, NFSPROC_T *); static int nfsrpc_seekrpc(vnode_t, off_t *, nfsv4stateid_t *, bool *, int, struct nfsvattr *, int *, struct ucred *); +static struct mbuf *nfsm_split(struct mbuf *, uint64_t); int nfs_pnfsio(task_fn_t *, void *); @@ -5756,7 +5756,7 @@ nfscl_doiods(vnode_t vp, struct uio *uiop, int *iomode struct nfscllayout *layp; struct nfscldevinfo *dip; struct nfsclflayout *rflp; - struct mbuf *m; + struct mbuf *m, *m2; struct nfsclwritedsdorpc *drpc, *tdrpc; nfsv4stateid_t stateid; struct ucred *newcred; @@ -5870,6 +5870,13 @@ nfscl_doiods(vnode_t vp, struct uio *uiop, int *iomode } } for (i = firstmirror; i < mirrorcnt && error == 0; i++){ + m2 = NULL; + if (m != NULL && i < mirrorcnt - 1) + m2 = m_copym(m, 0, M_COPYALL, M_WAITOK); + else { + m2 = m; + m = NULL; + } if ((layp->nfsly_flags & NFSLY_FLEXFILE) != 0) { dev = rflp->nfsfl_ffm[i].dev; dip = nfscl_getdevinfo(nmp->nm_clp, dev, @@ -5886,7 +5893,7 @@ nfscl_doiods(vnode_t vp, struct uio *uiop, int *iomode uiop, iomode, must_commit, &eof, &stateid, rwaccess, dip, layp, rflp, off, xfer, - i, docommit, m, tdrpc, + i, docommit, m2, tdrpc, newcred, p); else error = nfscl_doflayoutio(vp, @@ -5895,8 +5902,11 @@ nfscl_doiods(vnode_t vp, struct uio *uiop, int *iomode dip, layp, rflp, off, xfer, docommit, newcred, p); nfscl_reldevinfo(dip); - } else + } else { + if (m2 != NULL) + m_freem(m2); error = EIO; + } tdrpc++; } if (m != NULL) @@ -5962,38 +5972,6 @@ nfscl_doiods(vnode_t vp, struct uio *uiop, int *iomode } /* - * Make a copy of the mbuf chain and add an mbuf for null padding, as required. - */ -static struct mbuf * -nfsm_copym(struct mbuf *m, int off, int xfer) -{ - struct mbuf *m2, *m3, *m4; - uint32_t *tl; - int rem; - - m2 = m_copym(m, off, xfer, M_WAITOK); - rem = NFSM_RNDUP(xfer) - xfer; - if (rem > 0) { - /* - * The zero padding to a multiple of 4 bytes is required by - * the XDR. So that the mbufs copied by reference aren't - * modified, add an mbuf with the zero'd bytes to the list. - * rem will be a maximum of 3, so one zero'd uint32_t is - * sufficient. - */ - m3 = m2; - while (m3->m_next != NULL) - m3 = m3->m_next; - NFSMGET(m4); - tl = mtod(m4, uint32_t *); - *tl = 0; - m4->m_len = rem; - m3->m_next = m4; - } - return (m2); -} - -/* * Find a file layout that will handle the first bytes of the requested * range and return the information from it needed to the I/O operation. */ @@ -6148,17 +6126,17 @@ nfscl_dofflayoutio(vnode_t vp, struct uio *uiop, int * uint64_t len, int mirror, int docommit, struct mbuf *mp, struct nfsclwritedsdorpc *drpc, struct ucred *cred, NFSPROC_T *p) { - uint64_t transfer, xfer; - int error, rel_off; + uint64_t xfer; + int error; struct nfsnode *np; struct nfsfh *fhp; struct nfsclds **dspp; struct ucred *tcred; - struct mbuf *m; + struct mbuf *m, *m2; + uint32_t copylen; np = VTONFS(vp); error = 0; - rel_off = 0; NFSCL_DEBUG(4, "nfscl_dofflayoutio: off=%ju len=%ju\n", (uintmax_t)off, (uintmax_t)len); /* Loop around, doing I/O for each stripe unit. */ @@ -6176,14 +6154,31 @@ nfscl_dofflayoutio(vnode_t vp, struct uio *uiop, int * } else tcred = cred; if (rwflag == NFSV4OPEN_ACCESSREAD) - transfer = dp->nfsdi_rsize; - else - transfer = dp->nfsdi_wsize; + copylen = dp->nfsdi_rsize; + else { + copylen = dp->nfsdi_wsize; + if (len > copylen && mp != NULL) { + /* + * When a mirrored configuration needs to do + * multiple writes to each mirror, all writes + * except the last one must be a multiple of + * 4 bytes. This is required so that the XDR + * does not need padding. + * If possible, clip the size to an exact + * multiple of the mbuf length, so that the + * split will be on an mbuf boundary. + */ + copylen &= 0xfffffffc; + if (copylen > mp->m_len) + copylen = copylen / mp->m_len * + mp->m_len; + } + } NFSLOCKNODE(np); np->n_flag |= NDSCOMMIT; NFSUNLOCKNODE(np); - if (len > transfer && docommit == 0) - xfer = transfer; + if (len > copylen && docommit == 0) + xfer = copylen; else xfer = len; if (docommit != 0) { @@ -6244,31 +6239,41 @@ nfscl_dofflayoutio(vnode_t vp, struct uio *uiop, int * NFSUNLOCKCLSTATE(); } } else { - m = nfsm_copym(mp, rel_off, xfer); - NFSCL_DEBUG(4, "mcopy reloff=%d xfer=%jd\n", - rel_off, (uintmax_t)xfer); + m = mp; + if (xfer < len) { + /* The mbuf list must be split. */ + m2 = nfsm_split(mp, xfer); + if (m2 != NULL) + mp = m2; + else { + m_freem(mp); + error = EIO; + } + } + NFSCL_DEBUG(4, "mcopy len=%jd xfer=%jd\n", + (uintmax_t)len, (uintmax_t)xfer); /* - * Do the writes after the first loop iteration - * and the write for the last mirror via this + * Do last write to a mirrored DS with this * thread. - * This loop only iterates for small values - * of nfsdi_wsize, which may never occur in - * practice. However, the drpc is completely - * used by the first iteration and, as such, - * cannot be used after that. */ - if (mirror < flp->nfsfl_mirrorcnt - 1 && - rel_off == 0) - error = nfsio_writedsmir(vp, iomode, - must_commit, stateidp, *dspp, off, - xfer, fhp, m, dp->nfsdi_vers, - dp->nfsdi_minorvers, drpc, tcred, - p); - else - error = nfsrpc_writedsmir(vp, iomode, - must_commit, stateidp, *dspp, off, - xfer, fhp, m, dp->nfsdi_vers, - dp->nfsdi_minorvers, tcred, p); + if (error == 0) { + if (mirror < flp->nfsfl_mirrorcnt - 1) + error = nfsio_writedsmir(vp, + iomode, must_commit, + stateidp, *dspp, off, + xfer, fhp, m, + dp->nfsdi_vers, + dp->nfsdi_minorvers, drpc, + tcred, p); + else + error = nfsrpc_writedsmir(vp, + iomode, must_commit, + stateidp, *dspp, off, + xfer, fhp, m, + dp->nfsdi_vers, + dp->nfsdi_minorvers, tcred, + p); + } NFSCL_DEBUG(4, "nfsio_writedsmir=%d\n", error); if (error != 0 && error != EACCES && error != ESTALE) { @@ -6283,7 +6288,6 @@ nfscl_dofflayoutio(vnode_t vp, struct uio *uiop, int * if (error == 0) { len -= xfer; off += xfer; - rel_off += xfer; } if ((dp->nfsdi_flags & NFSDI_TIGHTCOUPLED) == 0) NFSFREECRED(tcred); @@ -8615,3 +8619,14 @@ nfsmout: return (error); } +/* + * Split an mbuf list. For non-M_EXTPG mbufs, just use m_split(). + */ +static struct mbuf * +nfsm_split(struct mbuf *mp, uint64_t xfer) +{ + struct mbuf *m; + + m = m_split(mp, xfer, M_WAITOK); + return (m); +} From owner-svn-src-all@freebsd.org Wed Jul 22 23:35:41 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B3AAB3644B0; Wed, 22 Jul 2020 23:35:41 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BBsK94LVyz4vJb; Wed, 22 Jul 2020 23:35:41 +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 79EC0F12F; Wed, 22 Jul 2020 23:35:41 +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 06MNZfIn056493; Wed, 22 Jul 2020 23:35:41 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06MNZf8r056492; Wed, 22 Jul 2020 23:35:41 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <202007222335.06MNZf8r056492@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Wed, 22 Jul 2020 23:35:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363438 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 363438 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 22 Jul 2020 23:35:41 -0000 Author: brooks Date: Wed Jul 22 23:35:41 2020 New Revision: 363438 URL: https://svnweb.freebsd.org/changeset/base/363438 Log: Use SI_ORDER_(FOURTH|FIFTH) rather than bespoke versions. No functional change. When these SYSINITs were added these macros didn't exist. Reviewed by: imp Obtained from: CheriBSD MFC after: 1 week Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D25758 Modified: head/sys/kern/init_main.c Modified: head/sys/kern/init_main.c ============================================================================== --- head/sys/kern/init_main.c Wed Jul 22 23:33:37 2020 (r363437) +++ head/sys/kern/init_main.c Wed Jul 22 23:35:41 2020 (r363438) @@ -372,18 +372,18 @@ SYSINIT(version, SI_SUB_COPYRIGHT, SI_ORDER_THIRD, pri #ifdef WITNESS static char wit_warn[] = "WARNING: WITNESS option enabled, expect reduced performance.\n"; -SYSINIT(witwarn, SI_SUB_COPYRIGHT, SI_ORDER_THIRD + 1, +SYSINIT(witwarn, SI_SUB_COPYRIGHT, SI_ORDER_FOURTH, print_caddr_t, wit_warn); -SYSINIT(witwarn2, SI_SUB_LAST, SI_ORDER_THIRD + 1, +SYSINIT(witwarn2, SI_SUB_LAST, SI_ORDER_FOURTH, print_caddr_t, wit_warn); #endif #ifdef DIAGNOSTIC static char diag_warn[] = "WARNING: DIAGNOSTIC option enabled, expect reduced performance.\n"; -SYSINIT(diagwarn, SI_SUB_COPYRIGHT, SI_ORDER_THIRD + 2, +SYSINIT(diagwarn, SI_SUB_COPYRIGHT, SI_ORDER_FIFTH, print_caddr_t, diag_warn); -SYSINIT(diagwarn2, SI_SUB_LAST, SI_ORDER_THIRD + 2, +SYSINIT(diagwarn2, SI_SUB_LAST, SI_ORDER_FIFTH, print_caddr_t, diag_warn); #endif From owner-svn-src-all@freebsd.org Wed Jul 22 23:39:59 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0AF783646B3; Wed, 22 Jul 2020 23:39:59 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BBsQ66TBHz4vHL; Wed, 22 Jul 2020 23:39:58 +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 C2AE8F539; Wed, 22 Jul 2020 23:39:58 +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 06MNdwUJ056708; Wed, 22 Jul 2020 23:39:58 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06MNdwBq056707; Wed, 22 Jul 2020 23:39:58 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <202007222339.06MNdwBq056707@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Wed, 22 Jul 2020 23:39:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363439 - head/usr.sbin/mountd X-SVN-Group: head X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: head/usr.sbin/mountd X-SVN-Commit-Revision: 363439 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 22 Jul 2020 23:39:59 -0000 Author: brooks Date: Wed Jul 22 23:39:58 2020 New Revision: 363439 URL: https://svnweb.freebsd.org/changeset/base/363439 Log: Correct a type-mismatch between xdr_long and the variable "bad". Way back in r28911 (August 1997, CVS rev 1.22) we imported a NetBSD information leak fix via OpenBSD. Unfortunatly we failed to track the followup commit that fixed the type of the error code. Apply the change from int to long now. Reviewed by: emaste Found by: CHERI Obtained from: CheriBSD MFC after: 3 days Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D25779 Modified: head/usr.sbin/mountd/mountd.c Modified: head/usr.sbin/mountd/mountd.c ============================================================================== --- head/usr.sbin/mountd/mountd.c Wed Jul 22 23:35:41 2020 (r363438) +++ head/usr.sbin/mountd/mountd.c Wed Jul 22 23:39:58 2020 (r363439) @@ -1091,7 +1091,8 @@ mntsrv(struct svc_req *rqstp, SVCXPRT *transp) struct sockaddr *saddr; u_short sport; char rpcpath[MNTPATHLEN + 1], dirpath[MAXPATHLEN]; - int bad = 0, defset, hostset; + int defset, hostset; + long bad = 0; sigset_t sighup_mask; int numsecflavors, *secflavorsp; From owner-svn-src-all@freebsd.org Thu Jul 23 01:35:25 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B9CAE36735D; Thu, 23 Jul 2020 01:35:25 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BBvzK4WGbz3WQk; Thu, 23 Jul 2020 01:35:25 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7E1B610ACF; Thu, 23 Jul 2020 01:35:25 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06N1ZPda030185; Thu, 23 Jul 2020 01:35:25 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06N1ZPG6030183; Thu, 23 Jul 2020 01:35:25 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <202007230135.06N1ZPG6030183@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Thu, 23 Jul 2020 01:35:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363440 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 363440 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 23 Jul 2020 01:35:25 -0000 Author: tuexen Date: Thu Jul 23 01:35:24 2020 New Revision: 363440 URL: https://svnweb.freebsd.org/changeset/base/363440 Log: Detect and handle an invalid reassembly constellation, which results in a memory leak. Thanks to Felix Weinrank for finding this issue using fuzz testing the userland stack. MFC after: 1 week Modified: head/sys/netinet/sctp_constants.h head/sys/netinet/sctp_indata.c Modified: head/sys/netinet/sctp_constants.h ============================================================================== --- head/sys/netinet/sctp_constants.h Wed Jul 22 23:39:58 2020 (r363439) +++ head/sys/netinet/sctp_constants.h Thu Jul 23 01:35:24 2020 (r363440) @@ -795,6 +795,7 @@ __FBSDID("$FreeBSD$"); #define SCTP_LOC_34 0x00000022 #define SCTP_LOC_35 0x00000023 #define SCTP_LOC_36 0x00000024 +#define SCTP_LOC_37 0x00000025 /* Free assoc codes */ #define SCTP_NORMAL_PROC 0 Modified: head/sys/netinet/sctp_indata.c ============================================================================== --- head/sys/netinet/sctp_indata.c Wed Jul 22 23:39:58 2020 (r363439) +++ head/sys/netinet/sctp_indata.c Thu Jul 23 01:35:24 2020 (r363440) @@ -1567,6 +1567,15 @@ sctp_queue_data_for_reasm(struct sctp_tcb *stcb, struc chk->rec.data.fsn); TAILQ_FOREACH(at, &control->reasm, sctp_next) { if (SCTP_TSN_GT(at->rec.data.fsn, chk->rec.data.fsn)) { + if (chk->rec.data.rcv_flags & SCTP_DATA_LAST_FRAG) { + /* Last not at the end? huh? */ + SCTPDBG(SCTP_DEBUG_XXX, + "Last fragment not last in list: -- abort\n"); + sctp_abort_in_reasm(stcb, control, + chk, abort_flag, + SCTP_FROM_SCTP_INDATA + SCTP_LOC_14); + return; + } /* * This one in queue is bigger than the new * one, insert the new one before at. @@ -1597,7 +1606,7 @@ sctp_queue_data_for_reasm(struct sctp_tcb *stcb, struc at->rec.data.fsn); sctp_abort_in_reasm(stcb, control, chk, abort_flag, - SCTP_FROM_SCTP_INDATA + SCTP_LOC_14); + SCTP_FROM_SCTP_INDATA + SCTP_LOC_15); return; } } @@ -1751,7 +1760,7 @@ sctp_process_a_data_chunk(struct sctp_tcb *stcb, struc * Need to send an abort since we had a empty data chunk. */ op_err = sctp_generate_no_user_data_cause(tsn); - stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_15; + stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_16; sctp_abort_an_association(stcb->sctp_ep, stcb, op_err, SCTP_SO_NOT_LOCKED); *abort_flag = 1; return (0); @@ -1888,7 +1897,7 @@ sctp_process_a_data_chunk(struct sctp_tcb *stcb, struc SCTP_SNPRINTF(msg, sizeof(msg), "Reassembly problem (MID=%8.8x)", mid); err_out: op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); - stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_16; + stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_17; sctp_abort_an_association(stcb->sctp_ep, stcb, op_err, SCTP_SO_NOT_LOCKED); *abort_flag = 1; return (0); @@ -2023,7 +2032,7 @@ sctp_process_a_data_chunk(struct sctp_tcb *stcb, struc (uint16_t)mid); } op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); - stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_17; + stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_18; sctp_abort_an_association(stcb->sctp_ep, stcb, op_err, SCTP_SO_NOT_LOCKED); *abort_flag = 1; return (0); @@ -2597,7 +2606,7 @@ sctp_sack_check(struct sctp_tcb *stcb, int was_a_gap) if (SCTP_OS_TIMER_PENDING(&stcb->asoc.dack_timer.timer)) { sctp_timer_stop(SCTP_TIMER_TYPE_RECV, stcb->sctp_ep, stcb, NULL, - SCTP_FROM_SCTP_INDATA + SCTP_LOC_18); + SCTP_FROM_SCTP_INDATA + SCTP_LOC_19); } sctp_send_shutdown(stcb, ((stcb->asoc.alternate) ? stcb->asoc.alternate : stcb->asoc.primary_destination)); @@ -2648,7 +2657,7 @@ sctp_sack_check(struct sctp_tcb *stcb, int was_a_gap) * there are gaps or duplicates. */ sctp_timer_stop(SCTP_TIMER_TYPE_RECV, stcb->sctp_ep, stcb, NULL, - SCTP_FROM_SCTP_INDATA + SCTP_LOC_19); + SCTP_FROM_SCTP_INDATA + SCTP_LOC_20); sctp_send_sack(stcb, SCTP_SO_NOT_LOCKED); } } else { @@ -2750,7 +2759,7 @@ sctp_process_data(struct mbuf **mm, int iphlen, int *o SCTP_SNPRINTF(msg, sizeof(msg), "%s", "DATA chunk received when I-DATA was negotiated"); op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); - stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_20; + stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_21; sctp_abort_an_association(inp, stcb, op_err, SCTP_SO_NOT_LOCKED); return (2); } @@ -2761,7 +2770,7 @@ sctp_process_data(struct mbuf **mm, int iphlen, int *o SCTP_SNPRINTF(msg, sizeof(msg), "%s", "I-DATA chunk received when DATA was negotiated"); op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); - stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_21; + stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_22; sctp_abort_an_association(inp, stcb, op_err, SCTP_SO_NOT_LOCKED); return (2); } @@ -2786,7 +2795,7 @@ sctp_process_data(struct mbuf **mm, int iphlen, int *o ch->chunk_type == SCTP_DATA ? "DATA" : "I-DATA", chk_length); op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); - stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_22; + stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_23; sctp_abort_an_association(inp, stcb, op_err, SCTP_SO_NOT_LOCKED); return (2); } @@ -2874,7 +2883,7 @@ sctp_process_data(struct mbuf **mm, int iphlen, int *o SCTP_SNPRINTF(msg, sizeof(msg), "Chunk of length %u", chk_length); op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); - stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_23; + stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_24; sctp_abort_an_association(inp, stcb, op_err, SCTP_SO_NOT_LOCKED); return (2); } @@ -4025,7 +4034,7 @@ sctp_express_handle_sack(struct sctp_tcb *stcb, uint32 "Cum ack %8.8x greater or equal than TSN %8.8x", cumack, send_s); op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); - stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_24; + stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_25; sctp_abort_an_association(stcb->sctp_ep, stcb, op_err, SCTP_SO_NOT_LOCKED); return; } @@ -4201,7 +4210,7 @@ sctp_express_handle_sack(struct sctp_tcb *stcb, uint32 net->dest_state &= ~SCTP_ADDR_PF; sctp_timer_stop(SCTP_TIMER_TYPE_HEARTBEAT, stcb->sctp_ep, stcb, net, - SCTP_FROM_SCTP_INDATA + SCTP_LOC_25); + SCTP_FROM_SCTP_INDATA + SCTP_LOC_26); sctp_timer_start(SCTP_TIMER_TYPE_HEARTBEAT, stcb->sctp_ep, stcb, net); asoc->cc_functions.sctp_cwnd_update_exit_pf(stcb, net); /* Done with this net */ @@ -4279,7 +4288,7 @@ again: } else if (SCTP_OS_TIMER_PENDING(&net->rxt_timer.timer)) { sctp_timer_stop(SCTP_TIMER_TYPE_SEND, stcb->sctp_ep, stcb, net, - SCTP_FROM_SCTP_INDATA + SCTP_LOC_26); + SCTP_FROM_SCTP_INDATA + SCTP_LOC_27); } } } @@ -4332,7 +4341,7 @@ again: *abort_now = 1; /* XXX */ op_err = sctp_generate_cause(SCTP_CAUSE_USER_INITIATED_ABT, ""); - stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_27; + stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_28; sctp_abort_an_association(stcb->sctp_ep, stcb, op_err, SCTP_SO_NOT_LOCKED); return; } @@ -4548,7 +4557,7 @@ hopeless_peer: "Cum ack %8.8x greater or equal than TSN %8.8x", cum_ack, send_s); op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); - stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_28; + stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_29; sctp_abort_an_association(stcb->sctp_ep, stcb, op_err, SCTP_SO_NOT_LOCKED); return; } @@ -4580,7 +4589,7 @@ hopeless_peer: /* stop any timers */ TAILQ_FOREACH(net, &asoc->nets, sctp_next) { sctp_timer_stop(SCTP_TIMER_TYPE_SEND, stcb->sctp_ep, - stcb, net, SCTP_FROM_SCTP_INDATA + SCTP_LOC_29); + stcb, net, SCTP_FROM_SCTP_INDATA + SCTP_LOC_30); net->partial_bytes_acked = 0; net->flight_size = 0; } @@ -4780,14 +4789,14 @@ hopeless_peer: if (net->new_pseudo_cumack) sctp_timer_stop(SCTP_TIMER_TYPE_SEND, stcb->sctp_ep, stcb, net, - SCTP_FROM_SCTP_INDATA + SCTP_LOC_30); + SCTP_FROM_SCTP_INDATA + SCTP_LOC_31); } } else { if (accum_moved) { TAILQ_FOREACH(net, &asoc->nets, sctp_next) { sctp_timer_stop(SCTP_TIMER_TYPE_SEND, stcb->sctp_ep, - stcb, net, SCTP_FROM_SCTP_INDATA + SCTP_LOC_31); + stcb, net, SCTP_FROM_SCTP_INDATA + SCTP_LOC_32); } } } @@ -4950,7 +4959,7 @@ hopeless_peer: net->dest_state &= ~SCTP_ADDR_PF; sctp_timer_stop(SCTP_TIMER_TYPE_HEARTBEAT, stcb->sctp_ep, stcb, net, - SCTP_FROM_SCTP_INDATA + SCTP_LOC_32); + SCTP_FROM_SCTP_INDATA + SCTP_LOC_33); sctp_timer_start(SCTP_TIMER_TYPE_HEARTBEAT, stcb->sctp_ep, stcb, net); asoc->cc_functions.sctp_cwnd_update_exit_pf(stcb, net); /* Done with this net */ @@ -4975,7 +4984,7 @@ hopeless_peer: /* stop all timers */ sctp_timer_stop(SCTP_TIMER_TYPE_SEND, stcb->sctp_ep, stcb, net, - SCTP_FROM_SCTP_INDATA + SCTP_LOC_33); + SCTP_FROM_SCTP_INDATA + SCTP_LOC_34); net->flight_size = 0; net->partial_bytes_acked = 0; } @@ -5013,7 +5022,7 @@ hopeless_peer: *abort_now = 1; /* XXX */ op_err = sctp_generate_cause(SCTP_CAUSE_USER_INITIATED_ABT, ""); - stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_34; + stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_35; sctp_abort_an_association(stcb->sctp_ep, stcb, op_err, SCTP_SO_NOT_LOCKED); return; } @@ -5162,7 +5171,7 @@ again: } else if (SCTP_OS_TIMER_PENDING(&net->rxt_timer.timer)) { sctp_timer_stop(SCTP_TIMER_TYPE_SEND, stcb->sctp_ep, stcb, net, - SCTP_FROM_SCTP_INDATA + SCTP_LOC_35); + SCTP_FROM_SCTP_INDATA + SCTP_LOC_36); } } } @@ -5565,7 +5574,7 @@ sctp_handle_forward_tsn(struct sctp_tcb *stcb, "New cum ack %8.8x too high, highest TSN %8.8x", new_cum_tsn, asoc->highest_tsn_inside_map); op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); - stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_36; + stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_37; sctp_abort_an_association(stcb->sctp_ep, stcb, op_err, SCTP_SO_NOT_LOCKED); return; } From owner-svn-src-all@freebsd.org Thu Jul 23 03:08:19 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4183336DC7D; Thu, 23 Jul 2020 03:08:19 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BBy2W14hcz3gm6; Thu, 23 Jul 2020 03:08:19 +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 E3B9811D6D; Thu, 23 Jul 2020 03:08:18 +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 06N38I9i087951; Thu, 23 Jul 2020 03:08:18 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06N38I9U087949; Thu, 23 Jul 2020 03:08:18 GMT (envelope-from cy@FreeBSD.org) Message-Id: <202007230308.06N38I9U087949@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Thu, 23 Jul 2020 03:08:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r363441 - in stable: 11/usr.sbin/wpa/hostapd 11/usr.sbin/wpa/wpa_supplicant 12/usr.sbin/wpa/hostapd 12/usr.sbin/wpa/wpa_supplicant X-SVN-Group: stable-12 X-SVN-Commit-Author: cy X-SVN-Commit-Paths: in stable: 11/usr.sbin/wpa/hostapd 11/usr.sbin/wpa/wpa_supplicant 12/usr.sbin/wpa/hostapd 12/usr.sbin/wpa/wpa_supplicant X-SVN-Commit-Revision: 363441 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 23 Jul 2020 03:08:19 -0000 Author: cy Date: Thu Jul 23 03:08:17 2020 New Revision: 363441 URL: https://svnweb.freebsd.org/changeset/base/363441 Log: MFC r363061: Enable support for IEEE 802.11N, 802.11W, 802.11AC and 802.11.AX to hostapd and wpa_supplicant. Submitted by: bz Relnotes: yes Sponsored by: Rubicon Communications, LLC (d/b/a "Netgate") Modified: stable/12/usr.sbin/wpa/hostapd/Makefile stable/12/usr.sbin/wpa/wpa_supplicant/Makefile Directory Properties: stable/12/ (props changed) Changes in other areas also in this revision: Modified: stable/11/usr.sbin/wpa/hostapd/Makefile stable/11/usr.sbin/wpa/wpa_supplicant/Makefile Directory Properties: stable/11/ (props changed) Modified: stable/12/usr.sbin/wpa/hostapd/Makefile ============================================================================== --- stable/12/usr.sbin/wpa/hostapd/Makefile Thu Jul 23 01:35:24 2020 (r363440) +++ stable/12/usr.sbin/wpa/hostapd/Makefile Thu Jul 23 03:08:17 2020 (r363441) @@ -44,11 +44,15 @@ SRCS= accounting.c \ ieee802_11.c \ ieee802_11_auth.c \ ieee802_11_common.c \ + ieee802_11_he.c \ + ieee802_11_ht.c \ ieee802_11_shared.c \ + ieee802_11_vht.c \ ieee802_1x.c \ ip_addr.c \ l2_packet_freebsd.c \ main.c \ + mbo_ap.c \ ms_funcs.c \ neighbor_db.c \ os_unix.c \ @@ -102,6 +106,11 @@ CFLAGS+=-I${.CURDIR:H}/wpa_supplicant \ -DCONFIG_DRIVER_BSD \ -DCONFIG_DRIVER_RADIUS_ACL \ -DCONFIG_HS20 \ + -DCONFIG_MBO \ + -DCONFIG_IEEE80211N \ + -DCONFIG_IEEE80211W \ + -DCONFIG_IEEE80211AC \ + -DCONFIG_IEEE80211AX \ -DCONFIG_INTERWORKING \ -DCONFIG_PEERKEY \ -DCONFIG_RSN_PREAUTH \ Modified: stable/12/usr.sbin/wpa/wpa_supplicant/Makefile ============================================================================== --- stable/12/usr.sbin/wpa/wpa_supplicant/Makefile Thu Jul 23 01:35:24 2020 (r363440) +++ stable/12/usr.sbin/wpa/wpa_supplicant/Makefile Thu Jul 23 03:08:17 2020 (r363441) @@ -41,6 +41,10 @@ CFLAGS+=-DCONFIG_BACKEND_FILE \ -DCONFIG_DRIVER_WIRED \ -DCONFIG_GAS \ -DCONFIG_IEEE80211R \ + -DCONFIG_IEEE80211N \ + -DCONFIG_IEEE80211W \ + -DCONFIG_IEEE80211AC \ + -DCONFIG_IEEE80211AX \ -DCONFIG_PEERKEY \ -DCONFIG_PRIVSEP \ -DCONFIG_SMARTCARD \ From owner-svn-src-all@freebsd.org Thu Jul 23 03:08:18 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9D80636DCB8; Thu, 23 Jul 2020 03:08:18 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BBy2V3jw3z3gbG; Thu, 23 Jul 2020 03:08:18 +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 6166E1221A; Thu, 23 Jul 2020 03:08:18 +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 06N38IdI087944; Thu, 23 Jul 2020 03:08:18 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06N38IPV087942; Thu, 23 Jul 2020 03:08:18 GMT (envelope-from cy@FreeBSD.org) Message-Id: <202007230308.06N38IPV087942@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Thu, 23 Jul 2020 03:08: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: r363441 - in stable: 11/usr.sbin/wpa/hostapd 11/usr.sbin/wpa/wpa_supplicant 12/usr.sbin/wpa/hostapd 12/usr.sbin/wpa/wpa_supplicant X-SVN-Group: stable-11 X-SVN-Commit-Author: cy X-SVN-Commit-Paths: in stable: 11/usr.sbin/wpa/hostapd 11/usr.sbin/wpa/wpa_supplicant 12/usr.sbin/wpa/hostapd 12/usr.sbin/wpa/wpa_supplicant X-SVN-Commit-Revision: 363441 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 23 Jul 2020 03:08:18 -0000 Author: cy Date: Thu Jul 23 03:08:17 2020 New Revision: 363441 URL: https://svnweb.freebsd.org/changeset/base/363441 Log: MFC r363061: Enable support for IEEE 802.11N, 802.11W, 802.11AC and 802.11.AX to hostapd and wpa_supplicant. Submitted by: bz Relnotes: yes Sponsored by: Rubicon Communications, LLC (d/b/a "Netgate") Modified: stable/11/usr.sbin/wpa/hostapd/Makefile stable/11/usr.sbin/wpa/wpa_supplicant/Makefile Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/12/usr.sbin/wpa/hostapd/Makefile stable/12/usr.sbin/wpa/wpa_supplicant/Makefile Directory Properties: stable/12/ (props changed) Modified: stable/11/usr.sbin/wpa/hostapd/Makefile ============================================================================== --- stable/11/usr.sbin/wpa/hostapd/Makefile Thu Jul 23 01:35:24 2020 (r363440) +++ stable/11/usr.sbin/wpa/hostapd/Makefile Thu Jul 23 03:08:17 2020 (r363441) @@ -44,11 +44,15 @@ SRCS= accounting.c \ ieee802_11.c \ ieee802_11_auth.c \ ieee802_11_common.c \ + ieee802_11_he.c \ + ieee802_11_ht.c \ ieee802_11_shared.c \ + ieee802_11_vht.c \ ieee802_1x.c \ ip_addr.c \ l2_packet_freebsd.c \ main.c \ + mbo_ap.c \ ms_funcs.c \ neighbor_db.c \ os_unix.c \ @@ -102,6 +106,11 @@ CFLAGS+=-I${.CURDIR:H}/wpa_supplicant \ -DCONFIG_DRIVER_BSD \ -DCONFIG_DRIVER_RADIUS_ACL \ -DCONFIG_HS20 \ + -DCONFIG_MBO \ + -DCONFIG_IEEE80211N \ + -DCONFIG_IEEE80211W \ + -DCONFIG_IEEE80211AC \ + -DCONFIG_IEEE80211AX \ -DCONFIG_INTERWORKING \ -DCONFIG_PEERKEY \ -DCONFIG_RSN_PREAUTH \ Modified: stable/11/usr.sbin/wpa/wpa_supplicant/Makefile ============================================================================== --- stable/11/usr.sbin/wpa/wpa_supplicant/Makefile Thu Jul 23 01:35:24 2020 (r363440) +++ stable/11/usr.sbin/wpa/wpa_supplicant/Makefile Thu Jul 23 03:08:17 2020 (r363441) @@ -41,6 +41,10 @@ CFLAGS+=-DCONFIG_BACKEND_FILE \ -DCONFIG_DRIVER_WIRED \ -DCONFIG_GAS \ -DCONFIG_IEEE80211R \ + -DCONFIG_IEEE80211N \ + -DCONFIG_IEEE80211W \ + -DCONFIG_IEEE80211AC \ + -DCONFIG_IEEE80211AX \ -DCONFIG_PEERKEY \ -DCONFIG_PRIVSEP \ -DCONFIG_SMARTCARD \ From owner-svn-src-all@freebsd.org Thu Jul 23 03:24:35 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DEFDB36E63B; Thu, 23 Jul 2020 03:24: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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BByPH5dDRz3ygD; Thu, 23 Jul 2020 03:24: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 A493512749; Thu, 23 Jul 2020 03:24: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 06N3OZ6B000693; Thu, 23 Jul 2020 03:24:35 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06N3OZdM000692; Thu, 23 Jul 2020 03:24:35 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202007230324.06N3OZdM000692@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 23 Jul 2020 03:24:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r363442 - stable/12/sys/net X-SVN-Group: stable-12 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: stable/12/sys/net X-SVN-Commit-Revision: 363442 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 23 Jul 2020 03:24:35 -0000 Author: kevans Date: Thu Jul 23 03:24:35 2020 New Revision: 363442 URL: https://svnweb.freebsd.org/changeset/base/363442 Log: MFC r363244: ether_ifattach: set mtu before calling if_attach() if_attach() -> if_attach_internal() will call if_attachdomain1(ifp) any time an ethernet interface is setup *after* SI_SUB_PROTO_IFATTACHDOMAIN/SI_ORDER_FIRST. This eventually leads to nd6_ifattach() -> nd6_setmtu0() stashing off ifp->if_mtu in ndi->maxmtu *before* ifp->if_mtu has been properly set in some scenarios, e.g., USB ethernet adapter plugged in later on. For interfaces that are created in early boot, we don't have this issue as domains aren't constructed enough for them to attach and thus it gets deferred to domainifattach at SI_SUB_PROTO_IFATTACHDOMAIN/SI_ORDER_SECOND *after* the mtu has been set earlier in ether_ifattach(). PR: 248005 Modified: stable/12/sys/net/if_ethersubr.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/net/if_ethersubr.c ============================================================================== --- stable/12/sys/net/if_ethersubr.c Thu Jul 23 03:08:17 2020 (r363441) +++ stable/12/sys/net/if_ethersubr.c Thu Jul 23 03:24:35 2020 (r363442) @@ -927,8 +927,8 @@ ether_ifattach(struct ifnet *ifp, const u_int8_t *lla) ifp->if_addrlen = ETHER_ADDR_LEN; ifp->if_hdrlen = ETHER_HDR_LEN; - if_attach(ifp); ifp->if_mtu = ETHERMTU; + if_attach(ifp); ifp->if_output = ether_output; ifp->if_input = ether_input; ifp->if_resolvemulti = ether_resolvemulti; From owner-svn-src-all@freebsd.org Thu Jul 23 03:25:32 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6C47236E6B7; Thu, 23 Jul 2020 03:25:32 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BByQN2Hhpz3ySh; Thu, 23 Jul 2020 03:25:32 +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 31EE3120C5; Thu, 23 Jul 2020 03:25:32 +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 06N3PWd3000832; Thu, 23 Jul 2020 03:25:32 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06N3PWL1000831; Thu, 23 Jul 2020 03:25:32 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202007230325.06N3PWL1000831@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 23 Jul 2020 03:25:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r363443 - stable/12/sys/net X-SVN-Group: stable-12 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: stable/12/sys/net X-SVN-Commit-Revision: 363443 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 23 Jul 2020 03:25:32 -0000 Author: kevans Date: Thu Jul 23 03:25:31 2020 New Revision: 363443 URL: https://svnweb.freebsd.org/changeset/base/363443 Log: tuntap: drop redundant if_mtu assignment in tuncreate ether_ifattach will immediately clobber if_mtu with ETHERMTU anyways, just let it happen. Modified: stable/12/sys/net/if_tuntap.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/net/if_tuntap.c ============================================================================== --- stable/12/sys/net/if_tuntap.c Thu Jul 23 03:24:35 2020 (r363442) +++ stable/12/sys/net/if_tuntap.c Thu Jul 23 03:25:31 2020 (r363443) @@ -939,7 +939,6 @@ tuncreate(struct cdev *dev) ifp->if_capenable |= IFCAP_LINKSTATE; if ((tp->tun_flags & TUN_L2) != 0) { - ifp->if_mtu = ETHERMTU; ifp->if_init = tunifinit; ifp->if_start = tunstart_l2; From owner-svn-src-all@freebsd.org Thu Jul 23 08:42:16 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A84093769C3; Thu, 23 Jul 2020 08:42:16 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BC5Rr45HTz4GXT; Thu, 23 Jul 2020 08:42:16 +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 709BA16545; Thu, 23 Jul 2020 08:42:16 +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 06N8gG9X096345; Thu, 23 Jul 2020 08:42:16 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06N8gGHB096344; Thu, 23 Jul 2020 08:42:16 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202007230842.06N8gGHB096344@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Thu, 23 Jul 2020 08:42:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363444 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 363444 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 23 Jul 2020 08:42:16 -0000 Author: mjg Date: Thu Jul 23 08:42:16 2020 New Revision: 363444 URL: https://svnweb.freebsd.org/changeset/base/363444 Log: vm: annotate swap_reserved with __exclusive_cache_line The counter keeps being updated all the time and variables read afterwards share the cacheline. Note this still fundamentally does not scale and needs to be replaced, in the meantime gets a bandaid. brk1_processes -t 52 ops/s: before: 8598298 after: 9098080 Modified: head/sys/vm/swap_pager.c Modified: head/sys/vm/swap_pager.c ============================================================================== --- head/sys/vm/swap_pager.c Thu Jul 23 03:25:31 2020 (r363443) +++ head/sys/vm/swap_pager.c Thu Jul 23 08:42:16 2020 (r363444) @@ -152,7 +152,7 @@ static int nswapdev; /* Number of swap devices */ int swap_pager_avail; static struct sx swdev_syscall_lock; /* serialize swap(on|off) */ -static u_long swap_reserved; +static __exclusive_cache_line u_long swap_reserved; static u_long swap_total; static int sysctl_page_shift(SYSCTL_HANDLER_ARGS); From owner-svn-src-all@freebsd.org Thu Jul 23 09:53:42 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 18164379324 for ; Thu, 23 Jul 2020 09:53:42 +0000 (UTC) (envelope-from campaign-indiatradedata-14483-350-1632121-svn-src-all=freebsd.org@email.indiatradedata.com) Received: from mm6-27.iaires.com (mm6-27.iaires.com [202.162.252.27]) by mx1.freebsd.org (Postfix) with ESMTP id 4BC72F5Rh6z4LnS for ; Thu, 23 Jul 2020 09:53:41 +0000 (UTC) (envelope-from campaign-indiatradedata-14483-350-1632121-svn-src-all=freebsd.org@email.indiatradedata.com) To: svn-src-all@freebsd.org From: Kawanpreet - trade data Reply-To: marketing@indiatradedata.com Subject: CUSTOM TRADE DATABASE - IMPORT/EXPORT Message-ID: <11534707261632121@email.indiatradedata.com> Feedback-ID: 350:14483:20200723151317:nczc MIME-Version: 1.0 Date: Thu, 23 Jul 2020 15:23:41 +0530 X-Rspamd-Queue-Id: 4BC72F5Rh6z4LnS X-Spamd-Bar: ++++ Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of campaign-indiatradedata-14483-350-1632121-svn-src-all=freebsd.org@email.indiatradedata.com designates 202.162.252.27 as permitted sender) smtp.mailfrom=campaign-indiatradedata-14483-350-1632121-svn-src-all=freebsd.org@email.indiatradedata.com X-Spamd-Result: default: False [4.30 / 15.00]; HAS_REPLYTO(0.00)[marketing@indiatradedata.com]; R_SPF_ALLOW(-0.20)[+ip4:202.162.224.0/19]; REPLYTO_ADDR_EQ_FROM(0.00)[]; TO_DN_NONE(0.00)[]; URI_COUNT_ODD(1.00)[1]; NEURAL_HAM_SHORT(-0.48)[-0.482]; SUBJ_ALL_CAPS(2.78)[37]; RCVD_COUNT_ZERO(0.00)[0]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; ASN(0.00)[asn:33480, ipnet:202.162.252.0/24, country:US]; FROM_NEQ_ENVFROM(0.00)[marketing@indiatradedata.com,campaign-indiatradedata-14483-350-1632121-svn-src-all=freebsd.org@email.indiatradedata.com]; ARC_NA(0.00)[]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; HAS_PHPMAILER_SIG(0.00)[]; FORGED_SENDER_VERP_SRS(0.00)[]; HAS_LIST_UNSUB(-0.01)[]; RCPT_COUNT_ONE(0.00)[1]; NEURAL_SPAM_MEDIUM(0.41)[0.414]; DMARC_NA(0.00)[indiatradedata.com]; NEURAL_SPAM_LONG(0.90)[0.899]; RWL_MAILSPIKE_POSSIBLE(0.00)[202.162.252.27:from] Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Content-Filtered-By: Mailman/MimeDel 2.1.33 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Jul 2020 09:53:42 -0000 Subscribe for Import Export custom trade database with company names for 2019-2020 Turkey Bangladesh Bolivia Tanzania Botswana Liberia Nigeria Lesotho Malawi Ghana Russia Mexico Indonesia Vietnam Philippines Latin America CIS Countries And many more countries..... Please let me know if you have any requirement to discuss further on this. Thanks & Regards Kawanpreet Kaur Email - Kawanpreet@exportgenius.in Skype - exportgenius4 Mobile : +91-8586926573 (Export Genius) From owner-svn-src-all@freebsd.org Thu Jul 23 14:03:25 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 521C937F7FF; Thu, 23 Jul 2020 14:03:25 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BCDZP1MTLz4bZg; Thu, 23 Jul 2020 14:03:25 +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 12C631A123; Thu, 23 Jul 2020 14:03:25 +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 06NE3OFN093009; Thu, 23 Jul 2020 14:03:24 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06NE3O7p093008; Thu, 23 Jul 2020 14:03:24 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202007231403.06NE3O7p093008@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 23 Jul 2020 14:03:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363445 - head/sys/dev/ntb/test X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/dev/ntb/test X-SVN-Commit-Revision: 363445 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 23 Jul 2020 14:03:25 -0000 Author: markj Date: Thu Jul 23 14:03:24 2020 New Revision: 363445 URL: https://svnweb.freebsd.org/changeset/base/363445 Log: ntb: Stop checking for failures from malloc(M_WAITOK). PR: 240545 Submitted by: Andrew Reiter Reviewed by: cem, mav MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D25768 Modified: head/sys/dev/ntb/test/ntb_tool.c Modified: head/sys/dev/ntb/test/ntb_tool.c ============================================================================== --- head/sys/dev/ntb/test/ntb_tool.c Thu Jul 23 08:42:16 2020 (r363444) +++ head/sys/dev/ntb/test/ntb_tool.c Thu Jul 23 14:03:24 2020 (r363445) @@ -619,10 +619,6 @@ tool_mw_write_fn(struct sysctl_oid *oidp, struct sysct write: data_buf_size = *buf_size; data_buf = malloc(data_buf_size, M_NTB_TOOL, M_WAITOK | M_ZERO); - if (!data_buf) { - rc = ENOMEM; - goto out; - } if (s_pflag) memset(data_buf, pattern, data_buf_size); @@ -677,7 +673,7 @@ sysctl_local_port_number(SYSCTL_HANDLER_ARGS) return (rc); } -static int +static void tool_init_peers(struct tool_ctx *tc) { int pidx; @@ -685,14 +681,10 @@ tool_init_peers(struct tool_ctx *tc) tc->peer_cnt = ntb_peer_port_count(tc->dev); tc->peers = malloc(tc->peer_cnt * sizeof(*tc->peers), M_NTB_TOOL, M_WAITOK | M_ZERO); - if (tc->peers == NULL) - return (ENOMEM); for (pidx = 0; pidx < tc->peer_cnt; pidx++) { tc->peers[pidx].pidx = pidx; tc->peers[pidx].tc = tc; } - - return (0); } static void @@ -1016,8 +1008,6 @@ tool_init_mws(struct tool_ctx *tc) tc->peers[pidx].inmws = malloc(tc->peers[pidx].inmw_cnt * sizeof(*tc->peers[pidx].inmws), M_NTB_TOOL, M_WAITOK | M_ZERO); - if (tc->peers[pidx].inmws == NULL) - return (ENOMEM); for (widx = 0; widx < tc->peers[pidx].inmw_cnt; widx++) { mw = &tc->peers[pidx].inmws[widx]; @@ -1219,7 +1209,7 @@ sysctl_peer_spad_handle(SYSCTL_HANDLER_ARGS) return (rc); } -static int +static void tool_init_spads(struct tool_ctx *tc) { int sidx, pidx; @@ -1228,8 +1218,6 @@ tool_init_spads(struct tool_ctx *tc) tc->inspad_cnt = ntb_spad_count(tc->dev); tc->inspads = malloc(tc->inspad_cnt * sizeof(*tc->inspads), M_NTB_TOOL, M_WAITOK | M_ZERO); - if (tc->inspads == NULL) - return (ENOMEM); for (sidx = 0; sidx < tc->inspad_cnt; sidx++) { tc->inspads[sidx].sidx = sidx; @@ -1243,8 +1231,6 @@ tool_init_spads(struct tool_ctx *tc) tc->peers[pidx].outspads = malloc(tc->peers[pidx].outspad_cnt * sizeof(*tc->peers[pidx].outspads), M_NTB_TOOL, M_WAITOK | M_ZERO); - if (tc->peers[pidx].outspads == NULL) - return (ENOMEM); for (sidx = 0; sidx < tc->peers[pidx].outspad_cnt; sidx++) { tc->peers[pidx].outspads[sidx].sidx = sidx; @@ -1252,8 +1238,6 @@ tool_init_spads(struct tool_ctx *tc) tc->peers[pidx].outspads[sidx].tc = tc; } } - - return (0); } static void @@ -1450,17 +1434,13 @@ ntb_tool_attach(device_t dev) if (rc) goto out; - rc = tool_init_peers(tc); - if (rc) - goto err_clear_data; + tool_init_peers(tc); rc = tool_init_mws(tc); if (rc) goto err_clear_data; - rc = tool_init_spads(tc); - if (rc) - goto err_clear_mws; + tool_init_spads(tc); rc = tool_init_ntb(tc); if (rc) @@ -1472,7 +1452,6 @@ ntb_tool_attach(device_t dev) err_clear_spads: tool_clear_spads(tc); -err_clear_mws: tool_clear_mws(tc); tool_clear_peers(tc); err_clear_data: From owner-svn-src-all@freebsd.org Thu Jul 23 14:03:38 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 62FE237F98B; Thu, 23 Jul 2020 14:03:38 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BCDZf20Klz4bbY; Thu, 23 Jul 2020 14:03: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 0F1391A35D; Thu, 23 Jul 2020 14:03: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 06NE3b3x093075; Thu, 23 Jul 2020 14:03:37 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06NE3blK093074; Thu, 23 Jul 2020 14:03:37 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202007231403.06NE3blK093074@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 23 Jul 2020 14:03:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363446 - head/sys/fs/cuse X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/fs/cuse X-SVN-Commit-Revision: 363446 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 23 Jul 2020 14:03:38 -0000 Author: markj Date: Thu Jul 23 14:03:37 2020 New Revision: 363446 URL: https://svnweb.freebsd.org/changeset/base/363446 Log: cuse: Stop checking for failures from malloc(M_WAITOK). PR: 240545 Submitted by: Andrew Reiter Reviewed by: hselasky MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D25765 Modified: head/sys/fs/cuse/cuse.c Modified: head/sys/fs/cuse/cuse.c ============================================================================== --- head/sys/fs/cuse/cuse.c Thu Jul 23 14:03:24 2020 (r363445) +++ head/sys/fs/cuse/cuse.c Thu Jul 23 14:03:37 2020 (r363446) @@ -425,8 +425,6 @@ cuse_server_alloc_memory(struct cuse_server *pcs, uint int error; mem = malloc(sizeof(*mem), M_CUSE, M_WAITOK | M_ZERO); - if (mem == NULL) - return (ENOMEM); object = vm_pager_allocate(OBJT_SWAP, NULL, PAGE_SIZE * page_count, VM_PROT_DEFAULT, 0, curthread->td_ucred); @@ -748,8 +746,6 @@ cuse_server_open(struct cdev *dev, int fflags, int dev struct cuse_server *pcs; pcs = malloc(sizeof(*pcs), M_CUSE, M_WAITOK | M_ZERO); - if (pcs == NULL) - return (ENOMEM); if (devfs_set_cdevpriv(pcs, &cuse_server_free)) { printf("Cuse: Cannot set cdevpriv.\n"); @@ -1217,10 +1213,6 @@ cuse_server_ioctl(struct cdev *dev, unsigned long cmd, pcsd = malloc(sizeof(*pcsd), M_CUSE, M_WAITOK | M_ZERO); - if (pcsd == NULL) { - error = ENOMEM; - break; - } pcsd->server = pcs; pcsd->user_dev = pcd->dev; @@ -1430,11 +1422,6 @@ cuse_client_open(struct cdev *dev, int fflags, int dev } pcc = malloc(sizeof(*pcc), M_CUSE, M_WAITOK | M_ZERO); - if (pcc == NULL) { - /* drop reference on server */ - cuse_server_unref(pcs); - return (ENOMEM); - } if (devfs_set_cdevpriv(pcc, &cuse_client_free)) { printf("Cuse: Cannot set cdevpriv.\n"); /* drop reference on server */ From owner-svn-src-all@freebsd.org Thu Jul 23 14:21:47 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1FB2F37FC91; Thu, 23 Jul 2020 14:21:47 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BCDzb05Ccz4cYL; Thu, 23 Jul 2020 14:21:47 +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 C0B221A58F; Thu, 23 Jul 2020 14:21:46 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06NELktX004072; Thu, 23 Jul 2020 14:21:46 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06NELkjZ004070; Thu, 23 Jul 2020 14:21:46 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202007231421.06NELkjZ004070@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 23 Jul 2020 14:21:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363447 - in head/cddl/contrib/opensolaris: cmd/zpool lib/libzfs/common X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in head/cddl/contrib/opensolaris: cmd/zpool lib/libzfs/common X-SVN-Commit-Revision: 363447 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 23 Jul 2020 14:21:47 -0000 Author: markj Date: Thu Jul 23 14:21:45 2020 New Revision: 363447 URL: https://svnweb.freebsd.org/changeset/base/363447 Log: MFOpenZFS: Fix zpool history unbounded memory usage In original implementation, zpool history will read the whole history before printing anything, causing memory usage goes unbounded. We fix this by breaking it into read-print iterations. Reviewed-by: Tom Caputi Reviewed-by: Matt Ahrens Reviewed-by: Igor Kozhukhov Reviewed-by: Brian Behlendorf Signed-off-by: Chunwei Chen Closes #9516 Note, this change changes the libzfs.so ABI by modifying the prototype of zpool_get_history(). Since libzfs is effectively private to the base system it is anticipated that this will not be a problem. PR: 247557 Obtained from: OpenZFS Reported and tested by: Sam Vaughan Discussed with: freqlabs MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D25745 openzfs/zfs@7125a109dcc55628336ff3f58e59e503f4d7694d Modified: head/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c Modified: head/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c ============================================================================== --- head/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c Thu Jul 23 14:03:37 2020 (r363446) +++ head/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c Thu Jul 23 14:21:45 2020 (r363447) @@ -6226,25 +6226,13 @@ typedef struct hist_cbdata { boolean_t internal; } hist_cbdata_t; -/* - * Print out the command history for a specific pool. - */ -static int -get_history_one(zpool_handle_t *zhp, void *data) +static void +print_history_records(nvlist_t *nvhis, hist_cbdata_t *cb) { - nvlist_t *nvhis; nvlist_t **records; uint_t numrecords; - int ret, i; - hist_cbdata_t *cb = (hist_cbdata_t *)data; + int i; - cb->first = B_FALSE; - - (void) printf(gettext("History for '%s':\n"), zpool_get_name(zhp)); - - if ((ret = zpool_get_history(zhp, &nvhis)) != 0) - return (ret); - verify(nvlist_lookup_nvlist_array(nvhis, ZPOOL_HIST_RECORD, &records, &numrecords) == 0); for (i = 0; i < numrecords; i++) { @@ -6344,8 +6332,32 @@ get_history_one(zpool_handle_t *zhp, void *data) (void) printf("]"); (void) printf("\n"); } +} + +/* + * Print out the command history for a specific pool. + */ +static int +get_history_one(zpool_handle_t *zhp, void *data) +{ + nvlist_t *nvhis; + int ret; + hist_cbdata_t *cb = (hist_cbdata_t *)data; + uint64_t off = 0; + boolean_t eof = B_FALSE; + + cb->first = B_FALSE; + + (void) printf(gettext("History for '%s':\n"), zpool_get_name(zhp)); + + while (!eof) { + if ((ret = zpool_get_history(zhp, &nvhis, &off, &eof)) != 0) + return (ret); + + print_history_records(nvhis, cb); + nvlist_free(nvhis); + } (void) printf("\n"); - nvlist_free(nvhis); return (ret); } Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h ============================================================================== --- head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h Thu Jul 23 14:03:37 2020 (r363446) +++ head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h Thu Jul 23 14:21:45 2020 (r363447) @@ -441,7 +441,8 @@ typedef enum { extern char *zpool_vdev_name(libzfs_handle_t *, zpool_handle_t *, nvlist_t *, int name_flags); extern int zpool_upgrade(zpool_handle_t *, uint64_t); -extern int zpool_get_history(zpool_handle_t *, nvlist_t **); +extern int zpool_get_history(zpool_handle_t *, nvlist_t **, uint64_t *, + boolean_t *); extern int zpool_history_unpack(char *, uint64_t, uint64_t *, nvlist_t ***, uint_t *); extern void zpool_obj_to_path(zpool_handle_t *, uint64_t, uint64_t, char *, Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c Thu Jul 23 14:03:37 2020 (r363446) +++ head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c Thu Jul 23 14:21:45 2020 (r363447) @@ -4124,33 +4124,37 @@ zpool_history_unpack(char *buf, uint64_t bytes_read, u * Retrieve the command history of a pool. */ int -zpool_get_history(zpool_handle_t *zhp, nvlist_t **nvhisp) +zpool_get_history(zpool_handle_t *zhp, nvlist_t **nvhisp, uint64_t *off, + boolean_t *eof) { char *buf; uint64_t buflen = HIS_BUF_LEN_DEF; - uint64_t off = 0; nvlist_t **records = NULL; uint_t numrecords = 0; int err, i; + uint64_t start = *off; buf = malloc(buflen); if (buf == NULL) return (ENOMEM); - do { + /* process about 1MB at a time */ + while (*off - start < 1024 * 1024) { uint64_t bytes_read = buflen; uint64_t leftover; - if ((err = get_history(zhp, buf, &off, &bytes_read)) != 0) + if ((err = get_history(zhp, buf, off, &bytes_read)) != 0) break; /* if nothing else was read in, we're at EOF, just return */ - if (bytes_read == 0) + if (bytes_read == 0) { + *eof = B_TRUE; break; + } if ((err = zpool_history_unpack(buf, bytes_read, &leftover, &records, &numrecords)) != 0) break; - off -= leftover; + *off -= leftover; if (leftover == bytes_read) { /* * no progress made, because buffer is not big enough @@ -4165,9 +4169,7 @@ zpool_get_history(zpool_handle_t *zhp, nvlist_t **nvhi break; } } - - /* CONSTCOND */ - } while (1); + } free(buf); From owner-svn-src-all@freebsd.org Thu Jul 23 14:33:26 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4027537FC6B; Thu, 23 Jul 2020 14:33:26 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BCFF20zQkz4dKt; Thu, 23 Jul 2020 14:33:26 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 05B2A1A7BC; Thu, 23 Jul 2020 14:33:26 +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 06NEXPxL011893; Thu, 23 Jul 2020 14:33:25 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06NEXPmn011892; Thu, 23 Jul 2020 14:33:25 GMT (envelope-from mav@FreeBSD.org) Message-Id: <202007231433.06NEXPmn011892@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 23 Jul 2020 14:33:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363448 - head/sbin/nvmecontrol X-SVN-Group: head X-SVN-Commit-Author: mav X-SVN-Commit-Paths: head/sbin/nvmecontrol X-SVN-Commit-Revision: 363448 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 23 Jul 2020 14:33:26 -0000 Author: mav Date: Thu Jul 23 14:33:25 2020 New Revision: 363448 URL: https://svnweb.freebsd.org/changeset/base/363448 Log: Add missing newlines. MFC after: 3 days Modified: head/sbin/nvmecontrol/identify.c Modified: head/sbin/nvmecontrol/identify.c ============================================================================== --- head/sbin/nvmecontrol/identify.c Thu Jul 23 14:21:45 2020 (r363447) +++ head/sbin/nvmecontrol/identify.c Thu Jul 23 14:33:25 2020 (r363448) @@ -151,15 +151,15 @@ print_namespace(struct nvme_namespace_data *nsdata) uint128_to_str(to128(nsdata->nvmcap), cbuf, sizeof(cbuf))); if ((nsdata->nsfeat >> NVME_NS_DATA_NSFEAT_NPVALID_SHIFT) & NVME_NS_DATA_NSFEAT_NPVALID_MASK) { - printf("Preferred Write Granularity: %u blocks", + printf("Preferred Write Granularity: %u blocks\n", nsdata->npwg + 1); - printf("Preferred Write Alignment: %u blocks", + printf("Preferred Write Alignment: %u blocks\n", nsdata->npwa + 1); - printf("Preferred Deallocate Granul: %u blocks", + printf("Preferred Deallocate Granul: %u blocks\n", nsdata->npdg + 1); - printf("Preferred Deallocate Align: %u blocks", + printf("Preferred Deallocate Align: %u blocks\n", nsdata->npda + 1); - printf("Optimal Write Size: %u blocks", + printf("Optimal Write Size: %u blocks\n", nsdata->nows + 1); } printf("Globally Unique Identifier: "); From owner-svn-src-all@freebsd.org Thu Jul 23 15:03:29 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4155E359132; Thu, 23 Jul 2020 15:03:29 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BCFvj12DLz4g5r; Thu, 23 Jul 2020 15:03:29 +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 072111AB73; Thu, 23 Jul 2020 15:03:29 +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 06NF3Sba030709; Thu, 23 Jul 2020 15:03:28 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06NF3S3R030708; Thu, 23 Jul 2020 15:03:28 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202007231503.06NF3S3R030708@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 23 Jul 2020 15:03:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363449 - head/libexec/rc X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/libexec/rc X-SVN-Commit-Revision: 363449 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 23 Jul 2020 15:03:29 -0000 Author: markj Date: Thu Jul 23 15:03:28 2020 New Revision: 363449 URL: https://svnweb.freebsd.org/changeset/base/363449 Log: rc.firewall: Merge two identical conditions into one. No functional change intended. PR: 247949 Submitted by: Jose Luis Duran MFC after: 1 week Modified: head/libexec/rc/rc.firewall Modified: head/libexec/rc/rc.firewall ============================================================================== --- head/libexec/rc/rc.firewall Thu Jul 23 14:33:25 2020 (r363448) +++ head/libexec/rc/rc.firewall Thu Jul 23 15:03:28 2020 (r363449) @@ -222,9 +222,6 @@ case ${firewall_type} in if [ -n "$net6" ]; then ${fwcmd} add pass all from me to ${net6} ${fwcmd} add pass all from ${net6} to me - fi - - if [ -n "$net6" ]; then # Allow any link-local multicast traffic ${fwcmd} add pass all from fe80::/10 to ff02::/16 ${fwcmd} add pass all from ${net6} to ff02::/16 From owner-svn-src-all@freebsd.org Thu Jul 23 17:16:21 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7B1EA35C8ED; Thu, 23 Jul 2020 17:16:21 +0000 (UTC) (envelope-from dougm@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BCJs13686z3ZR9; Thu, 23 Jul 2020 17:16:21 +0000 (UTC) (envelope-from dougm@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 49FFF1C5CB; Thu, 23 Jul 2020 17:16:21 +0000 (UTC) (envelope-from dougm@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06NHGLQZ020980; Thu, 23 Jul 2020 17:16:21 GMT (envelope-from dougm@FreeBSD.org) Received: (from dougm@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06NHGLNF020979; Thu, 23 Jul 2020 17:16:21 GMT (envelope-from dougm@FreeBSD.org) Message-Id: <202007231716.06NHGLNF020979@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dougm set sender to dougm@FreeBSD.org using -f From: Doug Moore Date: Thu, 23 Jul 2020 17:16:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363450 - in head: share/man/man3 sys/sys X-SVN-Group: head X-SVN-Commit-Author: dougm X-SVN-Commit-Paths: in head: share/man/man3 sys/sys X-SVN-Commit-Revision: 363450 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 23 Jul 2020 17:16:21 -0000 Author: dougm Date: Thu Jul 23 17:16:20 2020 New Revision: 363450 URL: https://svnweb.freebsd.org/changeset/base/363450 Log: Rank balanced (RB) trees are a class of balanced trees that includes AVL trees, red-black trees, and others. Weak AVL (wavl) trees are a recently discovered member of that class. This change replaces red-black rebalancing with weak AVL rebalancing in the RB tree macros. Wavl trees sit between AVL and red-black trees in terms of how strictly balance is enforced. They have the stricter balance of AVL trees as the tree is built - a wavl tree is an AVL tree until the first deletion. Once removals start, wavl trees are lazier about rebalancing than AVL trees, so that removals can be fast, but the balance of the tree can decay to that of a red-black tree. Subsequent insertions can push balance back toward the stricter AVL conditions. Removing a node from a wavl tree never requires more than two rotations, which is better than either red-black or AVL trees. Inserting a node into a wavl tree never requires more than two rotations, which matches red-black and AVL trees. The only disadvantage of wavl trees to red-black trees is that more insertions are likely to adjust the tree a bit. That's the cost of keeping the tree more balanced. Testing has shown that for the cases where red-black trees do worst, wavl trees better balance leads to faster lookups, so that if lookups outnumber insertions by a nontrivial amount, lookup time saved exceeds the extra cost of balancing. Reviewed by: alc, gbe, markj Tested by: pho Discussed with: emaste Differential Revision: https://reviews.freebsd.org/D25480 Modified: head/share/man/man3/tree.3 head/sys/sys/tree.h Modified: head/share/man/man3/tree.3 ============================================================================== --- head/share/man/man3/tree.3 Thu Jul 23 15:03:28 2020 (r363449) +++ head/share/man/man3/tree.3 Thu Jul 23 17:16:20 2020 (r363450) @@ -99,7 +99,7 @@ .Nm RB_INSERT , .Nm RB_REMOVE , .Nm RB_REINSERT -.Nd "implementations of splay and red-black trees" +.Nd "implementations of splay and rank-balanced (wavl) trees" .Sh SYNOPSIS .In sys/tree.h .Fn SPLAY_PROTOTYPE NAME TYPE FIELD CMP @@ -195,7 +195,7 @@ .Fn RB_REINSERT NAME "RB_HEAD *head" "struct TYPE *elm" .Sh DESCRIPTION These macros define data structures for different types of trees: -splay trees and red-black trees. +splay trees and rank-balanced (wavl) trees. .Pp In the macro definitions, .Fa TYPE @@ -364,26 +364,26 @@ macro: The .Fn SPLAY_EMPTY macro should be used to check whether a splay tree is empty. -.Sh RED-BLACK TREES -A red-black tree is a binary search tree with the node color as an -extra attribute. -It fulfills a set of conditions: -.Bl -enum -offset indent -.It -Every search path from the root to a leaf consists of the same number of -black nodes. -.It -Each red node (except for the root) has a black parent. -.It -Each leaf node is black. -.El +.Sh RANK-BALANCED TREES +Rank-balanced (RB) trees are a framework for defining height-balanced +binary search trees, including AVL and red-black trees. +Each tree node has an associated rank. +Balance conditions are expressed by conditions on the differences in +rank between any node and its children. +Rank differences are stored in each tree node. +.Pp +The balance conditions implemented by the RB macros lead to weak AVL +(wavl) trees, which combine the best aspects of AVL and red-black +trees. +Wavl trees rebalance after an insertion in the same way AVL trees do, +with the same worst-case time as red-black trees offer, and with +better balance in the resulting tree. +Wavl trees rebalance after a removal in a way that requires less +restructuring, in the worst case, than either AVL or red-black trees +do. Removals can lead to a tree almost as unbalanced as a red-black +tree; insertions lead to a tree becoming as balanced as an AVL tree. .Pp -Every operation on a red-black tree is bounded as -.Fn O "lg n" . -The maximum height of a red-black tree is -.Fn 2lg "n + 1" . -.Pp -A red-black tree is headed by a structure defined by the +A rank-balanced tree is headed by a structure defined by the .Fn RB_HEAD macro. A @@ -488,7 +488,7 @@ The macro initializes the tree referenced by .Fa head . .Pp -The red-black tree can also be initialized statically by using the +The rank-balanced tree can also be initialized statically by using the .Fn RB_INITIALIZER macro like this: .Bd -ragged -offset indent @@ -567,7 +567,7 @@ and will be overwritten to provide safe traversal. .Pp The .Fn RB_EMPTY -macro should be used to check whether a red-black tree is empty. +macro should be used to check whether a rank-balanced tree is empty. .Pp The .Fn RB_REINSERT @@ -581,7 +581,7 @@ a node's key. This is a lower overhead alternative to removing the element and reinserting it again. .Sh EXAMPLES -The following example demonstrates how to declare a red-black tree +The following example demonstrates how to declare a rank-balanced tree holding integers. Values are inserted into it and the contents of the tree are printed in order. @@ -697,6 +697,17 @@ to indicate an error. .Sh SEE ALSO .Xr arb 3 , .Xr queue 3 +.Rs +.%A "Bernhard Haeupler" +.%A "Siddhartha Sen" +.%A "Robert E. Tarjan" +.%T "Rank-Balanced Trees" +.%U "http://sidsen.azurewebsites.net/papers/rb-trees-talg.pdf" +.%J "ACM Transactions on Algorithms" +.%V "11" +.%N "4" +.%D "June 2015" +.Re .Sh HISTORY The tree macros first appeared in .Fx 4.6 . Modified: head/sys/sys/tree.h ============================================================================== --- head/sys/sys/tree.h Thu Jul 23 15:03:28 2020 (r363449) +++ head/sys/sys/tree.h Thu Jul 23 17:16:20 2020 (r363450) @@ -36,7 +36,7 @@ /* * This file defines data structures for different types of trees: - * splay trees and red-black trees. + * splay trees and rank-balanced trees. * * A splay tree is a self-organizing data structure. Every operation * on the tree causes a splay to happen. The splay moves the requested @@ -50,15 +50,24 @@ * and n inserts on an initially empty tree as O((m + n)lg n). The * amortized cost for a sequence of m accesses to a splay tree is O(lg n); * - * A red-black tree is a binary search tree with the node color as an - * extra attribute. It fulfills a set of conditions: - * - every search path from the root to a leaf consists of the - * same number of black nodes, - * - each red node (except for the root) has a black parent, - * - each leaf node is black. + * A rank-balanced tree is a binary search tree with an integer + * rank-difference as an attribute of each pointer from parent to child. + * The sum of the rank-differences on any path from a node down to null is + * the same, and defines the rank of that node. The rank of the null node + * is -1. * - * Every operation on a red-black tree is bounded as O(lg n). - * The maximum height of a red-black tree is 2lg (n+1). + * Different additional conditions define different sorts of balanced + * trees, including "red-black" and "AVL" trees. The set of conditions + * applied here are the "weak-AVL" conditions of Haeupler, Sen and Tarjan: + * - every rank-difference is 1 or 2. + * - the rank of any leaf is 1. + * + * For historical reasons, rank differences that are even are associated + * with the color red (Rank-Even-Difference), and the child that a red edge + * points to is called a red child. + * + * Every operation on a rank-balanced tree is bounded as O(lg n). + * The maximum height of a rank-balanced tree is 2lg (n+1). */ #define SPLAY_HEAD(name, type) \ @@ -294,7 +303,7 @@ void name##_SPLAY_MINMAX(struct name *head, int __comp (x) != NULL; \ (x) = SPLAY_NEXT(name, head, x)) -/* Macros that define a red-black tree */ +/* Macros that define a rank-balanced tree */ #define RB_HEAD(name, type) \ struct name { \ struct type *rbh_root; /* root of the tree */ \ @@ -325,25 +334,16 @@ struct { \ * that the left or right child of the tree node is "red". */ #define RB_UP(elm, field) (elm)->field.rbe_parent -#define RB_BITS(elm, field) *(__uintptr_t *)&RB_UP(elm, field) -#define RB_RED_L (__uintptr_t)1 -#define RB_RED_R (__uintptr_t)2 -#define RB_RED_MASK (__uintptr_t)3 +#define RB_BITS(elm, field) (*(__uintptr_t *)&RB_UP(elm, field)) +#define RB_RED_L ((__uintptr_t)1) +#define RB_RED_R ((__uintptr_t)2) +#define RB_RED_MASK ((__uintptr_t)3) #define RB_FLIP_LEFT(elm, field) (RB_BITS(elm, field) ^= RB_RED_L) #define RB_FLIP_RIGHT(elm, field) (RB_BITS(elm, field) ^= RB_RED_R) #define RB_RED_LEFT(elm, field) ((RB_BITS(elm, field) & RB_RED_L) != 0) #define RB_RED_RIGHT(elm, field) ((RB_BITS(elm, field) & RB_RED_R) != 0) #define RB_PARENT(elm, field) ((__typeof(RB_UP(elm, field))) \ (RB_BITS(elm, field) & ~RB_RED_MASK)) - -/* - * This header may appear in user code where 'bool' is not defined, - * so it defines its own boolean type to avoid breaking that code. - */ -#define RB_BOOL int -#define RB_TRUE 1 -#define RB_FALSE 0 - #define RB_ROOT(head) (head)->rbh_root #define RB_EMPTY(head) (RB_ROOT(head) == NULL) @@ -357,7 +357,7 @@ struct { \ RB_LEFT(elm, field) = RB_RIGHT(elm, field) = NULL; \ } while (/*CONSTCOND*/ 0) -#define RB_COLOR(elm, field) (RB_PARENT(elm, field) == NULL ? RB_FALSE : \ +#define RB_COLOR(elm, field) (RB_PARENT(elm, field) == NULL ? 0 : \ RB_LEFT(RB_PARENT(elm, field), field) == elm ? \ RB_RED_LEFT(RB_PARENT(elm, field), field) : \ RB_RED_RIGHT(RB_PARENT(elm, field), field)) @@ -422,7 +422,8 @@ struct { \ #define RB_PROTOTYPE_INSERT_COLOR(name, type, attr) \ attr void name##_RB_INSERT_COLOR(struct name *, struct type *) #define RB_PROTOTYPE_REMOVE_COLOR(name, type, attr) \ - attr void name##_RB_REMOVE_COLOR(struct name *, struct type *) + attr void name##_RB_REMOVE_COLOR(struct name *, \ + struct type *, struct type *) #define RB_PROTOTYPE_REMOVE(name, type, attr) \ attr struct type *name##_RB_REMOVE(struct name *, struct type *) #define RB_PROTOTYPE_INSERT(name, type, attr) \ @@ -464,123 +465,132 @@ struct { \ attr void \ name##_RB_INSERT_COLOR(struct name *head, struct type *elm) \ { \ - struct type *gparent, *parent; \ + struct type *child, *parent; \ while ((parent = RB_PARENT(elm, field)) != NULL) { \ - if (RB_LEFT(parent, field) == elm) \ - RB_FLIP_LEFT(parent, field); \ - else \ + if (RB_LEFT(parent, field) == elm) { \ + if (RB_RED_LEFT(parent, field)) { \ + RB_FLIP_LEFT(parent, field); \ + return; \ + } \ RB_FLIP_RIGHT(parent, field); \ - if ((gparent = RB_PARENT(parent, field)) == NULL) \ - break; \ - if (RB_RED_LEFT(gparent, field) && \ - RB_RED_RIGHT(gparent, field)) { \ - RB_FLIP_LEFT(gparent, field); \ - RB_FLIP_RIGHT(gparent, field); \ - elm = gparent; \ - continue; \ - } \ - if (RB_RED_LEFT(gparent, field) && \ - parent == RB_LEFT(gparent, field)) { \ - if (RB_RIGHT(parent, field) == elm) { \ - RB_ROTATE_LEFT(head, parent, elm, field);\ - RB_FLIP_RIGHT(parent, field); \ + if (RB_RED_RIGHT(parent, field)) { \ + elm = parent; \ + continue; \ + } \ + if (!RB_RED_RIGHT(elm, field)) { \ RB_FLIP_LEFT(elm, field); \ - parent = elm; \ + RB_ROTATE_LEFT(head, elm, child, field);\ + if (RB_RED_LEFT(child, field)) \ + RB_FLIP_RIGHT(elm, field); \ + else if (RB_RED_RIGHT(child, field)) \ + RB_FLIP_LEFT(parent, field); \ + elm = child; \ } \ - RB_ROTATE_RIGHT(head, gparent, parent, field); \ - RB_FLIP_LEFT(gparent, field); \ - RB_FLIP_RIGHT(parent, field); \ - } else if (RB_RED_RIGHT(gparent, field) && \ - parent == RB_RIGHT(gparent, field)) { \ - if (RB_LEFT(parent, field) == elm) { \ - RB_ROTATE_RIGHT(head, parent, elm, field);\ - RB_FLIP_LEFT(parent, field); \ - RB_FLIP_RIGHT(elm, field); \ - parent = elm; \ + RB_ROTATE_RIGHT(head, parent, elm, field); \ + } else { \ + if (RB_RED_RIGHT(parent, field)) { \ + RB_FLIP_RIGHT(parent, field); \ + return; \ } \ - RB_ROTATE_LEFT(head, gparent, parent, field); \ - RB_FLIP_RIGHT(gparent, field); \ RB_FLIP_LEFT(parent, field); \ + if (RB_RED_LEFT(parent, field)) { \ + elm = parent; \ + continue; \ + } \ + if (!RB_RED_LEFT(elm, field)) { \ + RB_FLIP_RIGHT(elm, field); \ + RB_ROTATE_RIGHT(head, elm, child, field);\ + if (RB_RED_RIGHT(child, field)) \ + RB_FLIP_LEFT(elm, field); \ + else if (RB_RED_LEFT(child, field)) \ + RB_FLIP_RIGHT(parent, field); \ + elm = child; \ + } \ + RB_ROTATE_LEFT(head, parent, elm, field); \ } \ + RB_BITS(elm, field) &= ~RB_RED_MASK; \ break; \ } \ } #define RB_GENERATE_REMOVE_COLOR(name, type, field, attr) \ attr void \ -name##_RB_REMOVE_COLOR(struct name *head, struct type *par) \ +name##_RB_REMOVE_COLOR(struct name *head, \ + struct type *parent, struct type *elm) \ { \ - struct type *gpr, *sib, *nec; \ - RB_BOOL left_elm, left_par, red_gpr; \ - left_par = (RB_LEFT(par, field) == NULL); \ - do { \ - left_elm = left_par; \ - if (left_elm ? \ - !RB_RED_RIGHT(par, field) : \ - !RB_RED_LEFT(par, field)) { \ - gpr = RB_PARENT(par, field); \ - left_par = gpr != NULL && \ - RB_LEFT(gpr, field) == par; \ - red_gpr = gpr == NULL ? \ - RB_TRUE: RB_COLOR(par, field); \ - } \ - if (left_elm) { \ - if (RB_RED_RIGHT(par, field)) { \ - red_gpr = RB_TRUE; \ - RB_ROTATE_LEFT(head, par, gpr, field); \ - RB_FLIP_RIGHT(par, field); \ - RB_FLIP_LEFT(gpr, field); \ + struct type *sib; \ + if (RB_LEFT(parent, field) == elm && \ + RB_RIGHT(parent, field) == elm) { \ + RB_BITS(parent, field) &= ~RB_RED_MASK; \ + elm = parent; \ + parent = RB_PARENT(elm, field); \ + if (parent == NULL) \ + return; \ + } \ + do { \ + if (RB_LEFT(parent, field) == elm) { \ + if (!RB_RED_LEFT(parent, field)) { \ + RB_FLIP_LEFT(parent, field); \ + return; \ } \ - sib = RB_RIGHT(par, field); \ - if (RB_RED_RIGHT(sib, field)) { \ - if (RB_RED_LEFT(sib, field)) { \ - RB_FLIP_LEFT(sib, field); \ - RB_FLIP_RIGHT(par, field); \ - } \ - RB_FLIP_RIGHT(sib, field); \ - } else if (RB_RED_LEFT(sib, field)) { \ - RB_ROTATE_RIGHT(head, sib, nec, field); \ - RB_FLIP_LEFT(sib, field); \ - sib = nec; \ - } else { \ - RB_FLIP_RIGHT(par, field); \ - par = gpr; \ + if (RB_RED_RIGHT(parent, field)) { \ + RB_FLIP_RIGHT(parent, field); \ + elm = parent; \ continue; \ } \ - RB_ROTATE_LEFT(head, par, sib, field); \ - return; \ + sib = RB_RIGHT(parent, field); \ + if ((~RB_BITS(sib, field) & RB_RED_MASK) == 0) {\ + RB_BITS(sib, field) &= ~RB_RED_MASK; \ + elm = parent; \ + continue; \ + } \ + RB_FLIP_RIGHT(sib, field); \ + if (RB_RED_LEFT(sib, field)) \ + RB_FLIP_LEFT(parent, field); \ + else if (!RB_RED_RIGHT(sib, field)) { \ + RB_FLIP_LEFT(parent, field); \ + RB_ROTATE_RIGHT(head, sib, elm, field); \ + if (RB_RED_RIGHT(elm, field)) \ + RB_FLIP_LEFT(sib, field); \ + if (RB_RED_LEFT(elm, field)) \ + RB_FLIP_RIGHT(parent, field); \ + RB_BITS(elm, field) |= RB_RED_MASK; \ + sib = elm; \ + } \ + RB_ROTATE_LEFT(head, parent, sib, field); \ } else { \ - if (RB_RED_LEFT(par, field)) { \ - red_gpr = RB_TRUE; \ - RB_ROTATE_RIGHT(head, par, gpr, field); \ - RB_FLIP_LEFT(par, field); \ - RB_FLIP_RIGHT(gpr, field); \ + if (!RB_RED_RIGHT(parent, field)) { \ + RB_FLIP_RIGHT(parent, field); \ + return; \ } \ - sib = RB_LEFT(par, field); \ - if (RB_RED_LEFT(sib, field)) { \ - if (RB_RED_RIGHT(sib, field)) { \ - RB_FLIP_RIGHT(sib, field); \ - RB_FLIP_LEFT(par, field); \ - } \ - RB_FLIP_LEFT(sib, field); \ - } else if (RB_RED_RIGHT(sib, field)) { \ - RB_ROTATE_LEFT(head, sib, nec, field); \ - RB_FLIP_RIGHT(sib, field); \ - sib = nec; \ - } else { \ - RB_FLIP_LEFT(par, field); \ - par = gpr; \ + if (RB_RED_LEFT(parent, field)) { \ + RB_FLIP_LEFT(parent, field); \ + elm = parent; \ continue; \ } \ - RB_ROTATE_RIGHT(head, par, sib, field); \ - return; \ + sib = RB_LEFT(parent, field); \ + if ((~RB_BITS(sib, field) & RB_RED_MASK) == 0) {\ + RB_BITS(sib, field) &= ~RB_RED_MASK; \ + elm = parent; \ + continue; \ + } \ + RB_FLIP_LEFT(sib, field); \ + if (RB_RED_RIGHT(sib, field)) \ + RB_FLIP_RIGHT(parent, field); \ + else if (!RB_RED_LEFT(sib, field)) { \ + RB_FLIP_RIGHT(parent, field); \ + RB_ROTATE_LEFT(head, sib, elm, field); \ + if (RB_RED_LEFT(elm, field)) \ + RB_FLIP_RIGHT(sib, field); \ + if (RB_RED_RIGHT(elm, field)) \ + RB_FLIP_LEFT(parent, field); \ + RB_BITS(elm, field) |= RB_RED_MASK; \ + sib = elm; \ + } \ + RB_ROTATE_RIGHT(head, parent, sib, field); \ } \ - } while (!red_gpr); \ - if (gpr == NULL); \ - else if (left_par) \ - RB_FLIP_LEFT(gpr, field); \ - else \ - RB_FLIP_RIGHT(gpr, field); \ + break; \ + } while ((parent = RB_PARENT(elm, field)) != NULL); \ } #define RB_GENERATE_REMOVE(name, type, field, attr) \ @@ -588,7 +598,6 @@ attr struct type * \ name##_RB_REMOVE(struct name *head, struct type *elm) \ { \ struct type *child, *old, *parent, *right; \ - RB_BOOL red; \ \ old = elm; \ parent = RB_PARENT(elm, field); \ @@ -600,9 +609,6 @@ name##_RB_REMOVE(struct name *head, struct type *elm) else { \ if ((child = RB_LEFT(right, field)) == NULL) { \ child = RB_RIGHT(right, field); \ - red = RB_RED_RIGHT(old, field); \ - if (red) \ - RB_FLIP_RIGHT(old, field); \ RB_RIGHT(old, field) = child; \ parent = elm = right; \ } else { \ @@ -611,28 +617,17 @@ name##_RB_REMOVE(struct name *head, struct type *elm) while ((child = RB_LEFT(elm, field)) != NULL); \ child = RB_RIGHT(elm, field); \ parent = RB_PARENT(elm, field); \ - red = RB_RED_LEFT(parent, field); \ - if (red) \ - RB_FLIP_LEFT(parent, field); \ RB_LEFT(parent, field) = child; \ - RB_SET_PARENT(RB_RIGHT(old, field), elm, field); \ + RB_SET_PARENT(RB_RIGHT(old, field), elm, field);\ } \ RB_SET_PARENT(RB_LEFT(old, field), elm, field); \ elm->field = old->field; \ } \ - if (elm == child) { \ - red = RB_COLOR(old, field); \ - if (!red); \ - else if (RB_LEFT(parent, field) == old) \ - RB_FLIP_LEFT(parent, field); \ - else \ - RB_FLIP_RIGHT(parent, field); \ - } \ RB_SWAP_CHILD(head, old, elm, field); \ if (child != NULL) \ RB_SET_PARENT(child, parent, field); \ - else if (!red && parent != NULL) \ - name##_RB_REMOVE_COLOR(head, parent); \ + if (parent != NULL) \ + name##_RB_REMOVE_COLOR(head, parent, child); \ while (parent != NULL) { \ RB_AUGMENT(parent); \ parent = RB_PARENT(parent, field); \ From owner-svn-src-all@freebsd.org Thu Jul 23 17:26:54 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 988C335CDC0; Thu, 23 Jul 2020 17:26:54 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BCK5B3R7Hz3b6P; Thu, 23 Jul 2020 17:26:54 +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 5A1731C5F7; Thu, 23 Jul 2020 17:26:54 +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 06NHQsLQ027178; Thu, 23 Jul 2020 17:26:54 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06NHQrZH027174; Thu, 23 Jul 2020 17:26:53 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202007231726.06NHQrZH027174@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Thu, 23 Jul 2020 17:26:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363451 - 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: 363451 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 23 Jul 2020 17:26:54 -0000 Author: mjg Date: Thu Jul 23 17:26:53 2020 New Revision: 363451 URL: https://svnweb.freebsd.org/changeset/base/363451 Log: locks: fix a long standing bug for primitives with kdtrace but without spinning In such a case the second argument to lock_delay_arg_init was NULL which was immediately causing a null pointer deref. Since the sructure is only used for spin count, provide a dedicate routine initializing it. Reported by: andrew Modified: head/sys/kern/kern_mutex.c head/sys/kern/kern_rwlock.c head/sys/kern/kern_sx.c head/sys/sys/lock.h Modified: head/sys/kern/kern_mutex.c ============================================================================== --- head/sys/kern/kern_mutex.c Thu Jul 23 17:16:20 2020 (r363450) +++ head/sys/kern/kern_mutex.c Thu Jul 23 17:26:53 2020 (r363451) @@ -538,7 +538,7 @@ __mtx_lock_sleep(volatile uintptr_t *c, uintptr_t v) #if defined(ADAPTIVE_MUTEXES) lock_delay_arg_init(&lda, &mtx_delay); #elif defined(KDTRACE_HOOKS) - lock_delay_arg_init(&lda, NULL); + lock_delay_arg_init_noadapt(&lda); #endif if (__predict_false(v == MTX_UNOWNED)) Modified: head/sys/kern/kern_rwlock.c ============================================================================== --- head/sys/kern/kern_rwlock.c Thu Jul 23 17:16:20 2020 (r363450) +++ head/sys/kern/kern_rwlock.c Thu Jul 23 17:26:53 2020 (r363451) @@ -475,7 +475,7 @@ __rw_rlock_hard(struct rwlock *rw, struct thread *td, #if defined(ADAPTIVE_RWLOCKS) lock_delay_arg_init(&lda, &rw_delay); #elif defined(KDTRACE_HOOKS) - lock_delay_arg_init(&lda, NULL); + lock_delay_arg_init_noadapt(&lda); #endif #ifdef HWPMC_HOOKS @@ -951,7 +951,7 @@ __rw_wlock_hard(volatile uintptr_t *c, uintptr_t v LOC #if defined(ADAPTIVE_RWLOCKS) lock_delay_arg_init(&lda, &rw_delay); #elif defined(KDTRACE_HOOKS) - lock_delay_arg_init(&lda, NULL); + lock_delay_arg_init_noadapt(&lda); #endif if (__predict_false(v == RW_UNLOCKED)) v = RW_READ_VALUE(rw); Modified: head/sys/kern/kern_sx.c ============================================================================== --- head/sys/kern/kern_sx.c Thu Jul 23 17:16:20 2020 (r363450) +++ head/sys/kern/kern_sx.c Thu Jul 23 17:26:53 2020 (r363451) @@ -623,7 +623,7 @@ _sx_xlock_hard(struct sx *sx, uintptr_t x, int opts LO #if defined(ADAPTIVE_SX) lock_delay_arg_init(&lda, &sx_delay); #elif defined(KDTRACE_HOOKS) - lock_delay_arg_init(&lda, NULL); + lock_delay_arg_init_noadapt(&lda); #endif if (__predict_false(x == SX_LOCK_UNLOCKED)) @@ -1063,7 +1063,7 @@ _sx_slock_hard(struct sx *sx, int opts, uintptr_t x LO #if defined(ADAPTIVE_SX) lock_delay_arg_init(&lda, &sx_delay); #elif defined(KDTRACE_HOOKS) - lock_delay_arg_init(&lda, NULL); + lock_delay_arg_init_noadapt(&lda); #endif #ifdef HWPMC_HOOKS Modified: head/sys/sys/lock.h ============================================================================== --- head/sys/sys/lock.h Thu Jul 23 17:16:20 2020 (r363450) +++ head/sys/sys/lock.h Thu Jul 23 17:26:53 2020 (r363451) @@ -195,6 +195,13 @@ lock_delay_arg_init(struct lock_delay_arg *la, struct la->spin_cnt = 0; } +static inline void +lock_delay_arg_init_noadapt(struct lock_delay_arg *la) +{ + la->delay = 0; + la->spin_cnt = 0; +} + #define lock_delay_spin(n) do { \ u_int _i; \ \ From owner-svn-src-all@freebsd.org Thu Jul 23 17:39:47 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 176F235D4A8; Thu, 23 Jul 2020 17:39:47 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BCKN26vJRz3c2h; Thu, 23 Jul 2020 17:39:46 +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 D09361CD05; Thu, 23 Jul 2020 17:39:46 +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 06NHdkZf033531; Thu, 23 Jul 2020 17:39:46 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06NHdkKA033527; Thu, 23 Jul 2020 17:39:46 GMT (envelope-from cy@FreeBSD.org) Message-Id: <202007231739.06NHdkKA033527@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Thu, 23 Jul 2020 17:39:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363452 - head/libexec/rc/rc.d X-SVN-Group: head X-SVN-Commit-Author: cy X-SVN-Commit-Paths: head/libexec/rc/rc.d X-SVN-Commit-Revision: 363452 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 23 Jul 2020 17:39:47 -0000 Author: cy Date: Thu Jul 23 17:39:45 2020 New Revision: 363452 URL: https://svnweb.freebsd.org/changeset/base/363452 Log: Load ipfilter, ipnat, and ippool rules, and start ipmon in a vnet jail. PR: 248109 Reported by: joeb1@a1poweruser.com MFC after: 2 weeks Modified: head/libexec/rc/rc.d/ipfilter head/libexec/rc/rc.d/ipmon head/libexec/rc/rc.d/ipnat head/libexec/rc/rc.d/ippool Modified: head/libexec/rc/rc.d/ipfilter ============================================================================== --- head/libexec/rc/rc.d/ipfilter Thu Jul 23 17:26:53 2020 (r363451) +++ head/libexec/rc/rc.d/ipfilter Thu Jul 23 17:39:45 2020 (r363452) @@ -5,7 +5,7 @@ # PROVIDE: ipfilter # REQUIRE: FILESYSTEMS -# KEYWORD: nojail +# KEYWORD: nojailvnet . /etc/rc.subr Modified: head/libexec/rc/rc.d/ipmon ============================================================================== --- head/libexec/rc/rc.d/ipmon Thu Jul 23 17:26:53 2020 (r363451) +++ head/libexec/rc/rc.d/ipmon Thu Jul 23 17:39:45 2020 (r363452) @@ -6,7 +6,7 @@ # PROVIDE: ipmon # REQUIRE: FILESYSTEMS hostname sysctl ipfilter # BEFORE: SERVERS -# KEYWORD: nojail +# KEYWORD: nojailvnet . /etc/rc.subr Modified: head/libexec/rc/rc.d/ipnat ============================================================================== --- head/libexec/rc/rc.d/ipnat Thu Jul 23 17:26:53 2020 (r363451) +++ head/libexec/rc/rc.d/ipnat Thu Jul 23 17:39:45 2020 (r363452) @@ -5,7 +5,7 @@ # PROVIDE: ipnat # REQUIRE: ipfilter -# KEYWORD: nojail +# KEYWORD: nojailvnet . /etc/rc.subr Modified: head/libexec/rc/rc.d/ippool ============================================================================== --- head/libexec/rc/rc.d/ippool Thu Jul 23 17:26:53 2020 (r363451) +++ head/libexec/rc/rc.d/ippool Thu Jul 23 17:39:45 2020 (r363452) @@ -6,7 +6,7 @@ # PROVIDE: ippool # REQUIRE: FILESYSTEMS # BEFORE: ipfilter -# KEYWORD: nojail +# KEYWORD: nojailvnet . /etc/rc.subr From owner-svn-src-all@freebsd.org Thu Jul 23 17:39:50 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 47A9035D4A9; Thu, 23 Jul 2020 17:39:50 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BCKN61DYhz3bfy; Thu, 23 Jul 2020 17:39:50 +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 0BB1A1C57B; Thu, 23 Jul 2020 17:39:50 +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 06NHdn7u033592; Thu, 23 Jul 2020 17:39:49 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06NHdnbS033591; Thu, 23 Jul 2020 17:39:49 GMT (envelope-from cy@FreeBSD.org) Message-Id: <202007231739.06NHdnbS033591@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Thu, 23 Jul 2020 17:39:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363453 - head/contrib/ipfilter/man X-SVN-Group: head X-SVN-Commit-Author: cy X-SVN-Commit-Paths: head/contrib/ipfilter/man X-SVN-Commit-Revision: 363453 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 23 Jul 2020 17:39:50 -0000 Author: cy Date: Thu Jul 23 17:39:49 2020 New Revision: 363453 URL: https://svnweb.freebsd.org/changeset/base/363453 Log: Document the IPFILTER_PREDEFINED environment variable. PR: 248088 Reported by: joeb1@a1poweruser.com MFC after: 1 week Modified: head/contrib/ipfilter/man/ipf.8 Modified: head/contrib/ipfilter/man/ipf.8 ============================================================================== --- head/contrib/ipfilter/man/ipf.8 Thu Jul 23 17:39:45 2020 (r363452) +++ head/contrib/ipfilter/man/ipf.8 Thu Jul 23 17:39:49 2020 (r363453) @@ -158,6 +158,15 @@ display the statistics prior to them being zeroed. Zero global statistics held in the kernel for filtering only (this doesn't affect fragment or state statistics). .DT +.SH ENVIRONMENT +.NM utilizes the following environment variable. +.TP +.B IPF_PREDEFINED +ipfilter variables, see VARIABLES in ipf(5), can be specified in this +environment variable providing shell access to ipfilter and ipnat variables. +For example, +.br +IPF_PREDEFINED='my_server="10.1.1.1"; my_client="10.1.1.2";' .SH FILES /dev/ipauth .br From owner-svn-src-all@freebsd.org Thu Jul 23 18:00:04 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5D92535DFF9 for ; Thu, 23 Jul 2020 18:00:04 +0000 (UTC) (envelope-from 010001737cd501a6-34cc6066-95c3-4724-a5f7-7cb00193e223-000000@amazonses.com) Received: from a8-52.smtp-out.amazonses.com (a8-52.smtp-out.amazonses.com [54.240.8.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4BCKqQ2pSjz3dbM for ; Thu, 23 Jul 2020 18:00:02 +0000 (UTC) (envelope-from 010001737cd501a6-34cc6066-95c3-4724-a5f7-7cb00193e223-000000@amazonses.com) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/simple; s=ae7m2yrxjw65l2cqdpjxuucyrvy564tn; d=tarsnap.com; t=1595527201; h=Subject:To:References:From:Message-ID:Date:MIME-Version:In-Reply-To:Content-Type:Content-Transfer-Encoding; bh=2p5uZXfYTYN0hKxn8VqDH2deZOCyD2iG7JLX5Ki1628=; b=ON15ifyBI4UvJrPoU3MdH3qdWJf4eFVHlw9wjPi6JbdZ9ncE8b5SkU/oW4YKV0+s FcWeWBuPbvHugIFM5YnI3oQLrMxAwLRUZ/ma0Tz7xLDcjwVwnRj9uEQF//t1dgBM/JA lAAyNi32mAbufXxrB06aa6ZUHXjIdP4ZSxhv7tbU= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/simple; s=224i4yxa5dv7c2xz3womw6peuasteono; d=amazonses.com; t=1595527201; h=Subject:To:References:From:Message-ID:Date:MIME-Version:In-Reply-To:Content-Type:Content-Transfer-Encoding:Feedback-ID; bh=2p5uZXfYTYN0hKxn8VqDH2deZOCyD2iG7JLX5Ki1628=; b=O/9CFoV5uf7E9r6iVN1Hogicm6Xw0c4talhK2wkFVAUmNbfnmzjaMwBr/7bi0hw6 Y7yKfF1BEGBoItRXMHQIyodNioJjRO2mLjEC0hka5f+4TU3QoBsv3XACJoJf31JGVTC S5pgZHiesc6oRD3+AFaK6pxqcbOryjtwXrl/fpXY= Subject: Please include benchmarks in commit messages (was Re: svn commit: r363450 - in head: share/man/man3 sys/sys) To: Doug Moore , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <202007231716.06NHGLNF020979@repo.freebsd.org> From: Colin Percival Autocrypt: addr=cperciva@tarsnap.com; prefer-encrypt=mutual; keydata= mQGhBElrAAcRBACDfDys4ZtK+ErCJ1HAzYeteKpm3OEsvT/49AjUTLihkF79HhIKrCQU+1KC zv7BwHCMLb6hq30As9L7iFKG7n5QFLFC4Te/VcITUnWHMG/c3ViLOfJGvi+9/nOEHaM1dVJY D6tEp5yM1nHmVQpo9932j4KGuGFR0LhOK5IHXOSfGwCgxSFDPdgxe2OEjWxjGgY+oV3EafcD +JROXCTjlcQiG/OguQH4Vks3mhHfFnEppLxTkDuYgHZQiUtpcT9ssH5khgqoTyMar05OUdAj ZIhNbWDh4LgTj+7ZmvLhXT5Zxw8LX9d7T36aTB8XDQSenDqEtinMWOb0TCBBLbsB8EFG1WTT ESbZci9jJS5yhtktuZoY/eM8uXMD/3k4FWFO80VRRkELSp+XSy/VlSQjyi/rhl2nQq/oOA9F oJbDaB0yq9VNhxP+uFBzBWSqeIX0t1ZWLtNfVFr4TRP5hihI5ICrg/0OpqgisKsU2NFe9xyO hyJLYmfD8ebpDJ/9k30C7Iju9pVrwLm1QgS4S2fqJRcR+U4WbjvP7CgStCVDb2xpbiBQZXJj aXZhbCA8Y3BlcmNpdmFAdGFyc25hcC5jb20+iGEEExECACEFAklrALYCGwMHCwkIBwMCAQQV AggDBBYCAwECHgECF4AACgkQOM7KaQxqam6/igCgn+z2k3V5ggNppmWrZstt1U2lugsAoL7L wS9V9yLtil3oWmHtwpUqYruEuQINBElrAAcQCAD3ZLMIsP4CIDoJORg+YY0lqLVBgcnF7pFb 4Uy2+KvdWofN+DKH61rZLjgXXkNE9M4EQC1B4lGttBP8IY2gs41y3AUogGdyFbidq99rCBz7 LTsgARHwFxZoaHmXyiZLEU1QZuMqwPZV1mCviRhN5E3rRqYNXVcrnXAAuhBpvNyj/ntHvcDN 2/m+ochiuBYueU4kX3lHya7sOj+mTsndcWmQ9soOUyr8O0r/BG088bMn4qqtUw4dl5/pglXk jbl7uOOPinKf0WVd2r6M0wLPJCD4NPHrCWRLLLAjwfjrtoSRvXxDbXhCdgGBa72+K8eYLzVs hgq7tJOoBWzjVK6XRxR7AAMGB/9Mo3iJ2DxqDecd02KCB5BsFDICbJGhPltU7FwrtbC7djSb XUrwsEVLHi4st4cbdGNCWCrp0BRezXZKohKnNAPFOTK++ZfgeKxrV2sJod+Q9RILF86tQ4XF 7A7Yme5hy92t/WgiU4vc/fWbgP8gV/19f8nunaT2E9NSa70mZFjZNu4iuwThoUUO5CV3Wo0Y UISsnRK8XD1+LR3A2qVyLiFRwh/miC1hgLFCTGCQ3GLxZeZzIpYSlGdQJ0L5lixW5ZQD9r1I 8i/8zhE6qRFAM0upUMI3Gt1Oq2w03DiXrZU0Fu/R8Rm8rlnkQKA+95mRTUq1xL5P5NZIi4gJ Z569OPMFiEkEGBECAAkFAklrAAcCGwwACgkQOM7KaQxqam41igCfbaldnFTu5uAdrnrghESv EI3CAo8AoLkNMks1pThl2BJNRm4CtTK9xZeH Message-ID: <010001737cd501a6-34cc6066-95c3-4724-a5f7-7cb00193e223-000000@email.amazonses.com> Date: Thu, 23 Jul 2020 18:00:01 +0000 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <202007231716.06NHGLNF020979@repo.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-SES-Outgoing: 2020.07.23-54.240.8.52 Feedback-ID: 1.us-east-1.Lv9FVjaNvvR5llaqfLoOVbo2VxOELl7cjN0AOyXnPlk=:AmazonSES X-Rspamd-Queue-Id: 4BCKqQ2pSjz3dbM X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; dkim=pass header.d=tarsnap.com header.s=ae7m2yrxjw65l2cqdpjxuucyrvy564tn header.b=ON15ifyB; dkim=pass header.d=amazonses.com header.s=224i4yxa5dv7c2xz3womw6peuasteono header.b=O/9CFoV5; dmarc=pass (policy=none) header.from=tarsnap.com; spf=pass (mx1.freebsd.org: domain of 010001737cd501a6-34cc6066-95c3-4724-a5f7-7cb00193e223-000000@amazonses.com designates 54.240.8.52 as permitted sender) smtp.mailfrom=010001737cd501a6-34cc6066-95c3-4724-a5f7-7cb00193e223-000000@amazonses.com X-Spamd-Result: default: False [-1.39 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.01)[-1.014]; R_DKIM_ALLOW(-0.20)[tarsnap.com:s=ae7m2yrxjw65l2cqdpjxuucyrvy564tn,amazonses.com:s=224i4yxa5dv7c2xz3womw6peuasteono]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:54.240.0.0/18]; MIME_GOOD(-0.10)[text/plain]; NEURAL_HAM_LONG(-1.02)[-1.016]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[tarsnap.com:+,amazonses.com:+]; DMARC_POLICY_ALLOW(-0.50)[tarsnap.com,none]; RCVD_IN_DNSWL_NONE(0.00)[54.240.8.52:from]; NEURAL_HAM_SHORT(-1.16)[-1.164]; FORGED_SENDER(0.30)[cperciva@tarsnap.com,010001737cd501a6-34cc6066-95c3-4724-a5f7-7cb00193e223-000000@amazonses.com]; RCVD_COUNT_ZERO(0.00)[0]; RWL_MAILSPIKE_POSSIBLE(0.00)[54.240.8.52:from]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:14618, ipnet:54.240.8.0/21, country:US]; FROM_NEQ_ENVFROM(0.00)[cperciva@tarsnap.com,010001737cd501a6-34cc6066-95c3-4724-a5f7-7cb00193e223-000000@amazonses.com]; FORGED_MUA_THUNDERBIRD_MSGID_UNKNOWN(2.50)[] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Jul 2020 18:00:04 -0000 [Picking this as an example of a general trend...] On 2020-07-23 10:16, Doug Moore wrote: > [...] > Testing has shown that for the cases where red-black trees do worst, > wavl trees better balance leads to faster lookups, so that if lookups > outnumber insertions by a nontrivial amount, lookup time saved exceeds > the extra cost of balancing. I'd like to request that commits like this include some benchmarks. In the review of these particular changes I see several microbenchmarks for a variety of use cases; it could be helpful to future code spelunkers if these were summarized in the commit message (e.g. "lookup-heavy microbenchmarks saw a X% speedup while write-heavy microbenchmarks saw a Y% slowdown"). It would also be nice to see a macrobenchmark (e.g. buildworld), even (and perhaps *especially*) if the result is "no difference was observed". Again, this is a general request -- this is just the latest in a long series of commits I've seen by many people which have sounded like they could have performance impacts but have not included any quantitative results. -- Colin Percival Security Officer Emeritus, FreeBSD | The power to serve Founder, Tarsnap | www.tarsnap.com | Online backups for the truly paranoid From owner-svn-src-all@freebsd.org Thu Jul 23 18:55:48 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 97BC035FDDF; Thu, 23 Jul 2020 18:55:48 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BCM3m3b6Nz40XR; Thu, 23 Jul 2020 18:55:48 +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 5E6331DBD9; Thu, 23 Jul 2020 18:55:48 +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 06NItmEK084000; Thu, 23 Jul 2020 18:55:48 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06NItmkd083999; Thu, 23 Jul 2020 18:55:48 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <202007231855.06NItmkd083999@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 23 Jul 2020 18:55:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363454 - head/lib/libmd X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/lib/libmd X-SVN-Commit-Revision: 363454 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 23 Jul 2020 18:55:48 -0000 Author: emaste Date: Thu Jul 23 18:55:47 2020 New Revision: 363454 URL: https://svnweb.freebsd.org/changeset/base/363454 Log: libmd: temporarily disable optimized assembly skein1024 implementation It is apparently broken when assembled by contemporary GNU as as well as Clang IAS (which is used in the default configuration). PR: 248221 Reported by: pizzamig Sponsored by: The FreeBSD Foundation Modified: head/lib/libmd/Makefile Modified: head/lib/libmd/Makefile ============================================================================== --- head/lib/libmd/Makefile Thu Jul 23 17:39:49 2020 (r363453) +++ head/lib/libmd/Makefile Thu Jul 23 18:55:47 2020 (r363454) @@ -116,12 +116,12 @@ CFLAGS+= -DSHA1_ASM SRCS+= rmd160.S CFLAGS+= -DRMD160_ASM .endif -.if exists(${MACHINE_ARCH}/skein_block_asm.S) -# Fully unroll all loops in the assembly optimized version -ACFLAGS+= -DSKEIN_LOOP=0 -SRCS+= skein_block_asm.S -CFLAGS+= -DSKEIN_ASM -DSKEIN_USE_ASM=1792 # list of block functions to replace with assembly: 256+512+1024 = 1792 -.endif +#.if exists(${MACHINE_ARCH}/skein_block_asm.S) +## Fully unroll all loops in the assembly optimized version +#ACFLAGS+= -DSKEIN_LOOP=0 +#SRCS+= skein_block_asm.S +#CFLAGS+= -DSKEIN_ASM -DSKEIN_USE_ASM=1792 # list of block functions to replace with assembly: 256+512+1024 = 1792 +#.endif .if exists(${MACHINE_ARCH}/sha.S) || exists(${MACHINE_ARCH}/rmd160.S) || exists(${MACHINE_ARCH}/skein_block_asm.S) ACFLAGS+= -DELF -Wa,--noexecstack .endif From owner-svn-src-all@freebsd.org Thu Jul 23 19:19:33 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E5E92360955; Thu, 23 Jul 2020 19:19:33 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BCMb95qc8z42H2; Thu, 23 Jul 2020 19:19: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 AB5581DC43; Thu, 23 Jul 2020 19:19: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 06NJJXjD096667; Thu, 23 Jul 2020 19:19:33 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06NJJX3p096666; Thu, 23 Jul 2020 19:19:33 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <202007231919.06NJJX3p096666@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 23 Jul 2020 19:19:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363455 - head/sys/modules/crypto X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/sys/modules/crypto X-SVN-Commit-Revision: 363455 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 23 Jul 2020 19:19:34 -0000 Author: emaste Date: Thu Jul 23 19:19:33 2020 New Revision: 363455 URL: https://svnweb.freebsd.org/changeset/base/363455 Log: modules/crypto: disable optimized assembly skein1024 implementation It is presumably broken in the same way as userland skein1024 (see r363454) PR: 248221 Modified: head/sys/modules/crypto/Makefile Modified: head/sys/modules/crypto/Makefile ============================================================================== --- head/sys/modules/crypto/Makefile Thu Jul 23 18:55:47 2020 (r363454) +++ head/sys/modules/crypto/Makefile Thu Jul 23 19:19:33 2020 (r363455) @@ -28,14 +28,14 @@ SRCS += sha1.c sha256c.c sha512c.c SRCS += skein.c skein_block.c # unroll the 256 and 512 loops, half unroll the 1024 CFLAGS.skein_block.c += -DSKEIN_LOOP=995 -.if exists(${MACHINE_ARCH}/skein_block_asm.S) -.PATH: ${SRCTOP}/sys/crypto/skein/${MACHINE_ARCH} -SRCS += skein_block_asm.S -CFLAGS += -DSKEIN_ASM -DSKEIN_USE_ASM=1792 # list of block functions to replace with assembly: 256+512+1024 = 1792 -ACFLAGS += -DELF -Wa,--noexecstack -# Fully unroll all loops in the assembly optimized version -ACFLAGS += -DSKEIN_LOOP=0 -.endif +#.if exists(${MACHINE_ARCH}/skein_block_asm.S) +#.PATH: ${SRCTOP}/sys/crypto/skein/${MACHINE_ARCH} +#SRCS += skein_block_asm.S +#CFLAGS += -DSKEIN_ASM -DSKEIN_USE_ASM=1792 # list of block functions to replace with assembly: 256+512+1024 = 1792 +#ACFLAGS += -DELF -Wa,--noexecstack +## Fully unroll all loops in the assembly optimized version +#ACFLAGS += -DSKEIN_LOOP=0 +#.endif SRCS += siphash.c SRCS += gmac.c gfmult.c SRCS += blake2b-ref.c From owner-svn-src-all@freebsd.org Thu Jul 23 19:43:50 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1E630361D9E; Thu, 23 Jul 2020 19:43:50 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BCN7B02mJz44Pt; Thu, 23 Jul 2020 19:43:50 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D9C391E236; Thu, 23 Jul 2020 19:43:49 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06NJhnVT014999; Thu, 23 Jul 2020 19:43:49 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06NJhnVM014998; Thu, 23 Jul 2020 19:43:49 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <202007231943.06NJhnVM014998@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Thu, 23 Jul 2020 19:43:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363456 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 363456 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 23 Jul 2020 19:43:50 -0000 Author: tuexen Date: Thu Jul 23 19:43:49 2020 New Revision: 363456 URL: https://svnweb.freebsd.org/changeset/base/363456 Log: Clear the pointer to the socket when closing it also in case of an ungraceful operation. This fixes a use-after-free bug found and reported by Taylor Brandstetter of Google by testing the userland stack. MFC after: 1 week Modified: head/sys/netinet/sctp_pcb.c Modified: head/sys/netinet/sctp_pcb.c ============================================================================== --- head/sys/netinet/sctp_pcb.c Thu Jul 23 19:19:33 2020 (r363455) +++ head/sys/netinet/sctp_pcb.c Thu Jul 23 19:43:49 2020 (r363456) @@ -3545,6 +3545,11 @@ sctp_inpcb_free(struct sctp_inpcb *inp, int immediate, cnt = 0; LIST_FOREACH_SAFE(asoc, &inp->sctp_asoc_list, sctp_tcblist, nasoc) { SCTP_TCB_LOCK(asoc); + if (immediate != SCTP_FREE_SHOULD_USE_GRACEFUL_CLOSE) { + /* Disconnect the socket please */ + asoc->sctp_socket = NULL; + SCTP_ADD_SUBSTATE(asoc, SCTP_STATE_CLOSED_SOCKET); + } if (asoc->asoc.state & SCTP_STATE_ABOUT_TO_BE_FREED) { if (asoc->asoc.state & SCTP_STATE_IN_ACCEPT_QUEUE) { SCTP_CLEAR_SUBSTATE(asoc, SCTP_STATE_IN_ACCEPT_QUEUE); From owner-svn-src-all@freebsd.org Thu Jul 23 20:06:24 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B6C2F3623D9; Thu, 23 Jul 2020 20:06:24 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BCNdD4SRWz45sW; Thu, 23 Jul 2020 20:06:24 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 77C6D1E74B; Thu, 23 Jul 2020 20:06:24 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06NK6OmD027419; Thu, 23 Jul 2020 20:06:24 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06NK6Om6027418; Thu, 23 Jul 2020 20:06:24 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <202007232006.06NK6Om6027418@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 23 Jul 2020 20:06:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363457 - head/sbin/md5 X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/sbin/md5 X-SVN-Commit-Revision: 363457 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 23 Jul 2020 20:06:24 -0000 Author: emaste Date: Thu Jul 23 20:06:24 2020 New Revision: 363457 URL: https://svnweb.freebsd.org/changeset/base/363457 Log: md5: return non-zero if built-in tests (-x) fail MFC after: 1 week Sponsored by: The FreeBSD Foundation Modified: head/sbin/md5/md5.c Modified: head/sbin/md5/md5.c ============================================================================== --- head/sbin/md5/md5.c Thu Jul 23 19:43:49 2020 (r363456) +++ head/sbin/md5/md5.c Thu Jul 23 20:06:24 2020 (r363457) @@ -498,10 +498,12 @@ MDTestSuite(const Algorithm_t *alg) for (i = 0; i < MDTESTCOUNT; i++) { (*alg->Data)(MDTestInput[i], strlen(MDTestInput[i]), buffer); printf("%s (\"%s\") = %s", alg->name, MDTestInput[i], buffer); - if (strcmp(buffer, (*alg->TestOutput)[i]) == 0) + if (strcmp(buffer, (*alg->TestOutput)[i]) == 0) { printf(" - verified correct\n"); - else + } else { printf(" - INCORRECT RESULT!\n"); + failed++; + } } } From owner-svn-src-all@freebsd.org Thu Jul 23 20:08:43 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 673E33628A2; Thu, 23 Jul 2020 20:08:43 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BCNgv24J3z45p6; Thu, 23 Jul 2020 20:08:43 +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 2A33F1E4F7; Thu, 23 Jul 2020 20:08:43 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06NK8hV5027576; Thu, 23 Jul 2020 20:08:43 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06NK8h3G027575; Thu, 23 Jul 2020 20:08:43 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202007232008.06NK8h3G027575@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 23 Jul 2020 20:08:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363458 - head/sys/mips/mips X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/sys/mips/mips X-SVN-Commit-Revision: 363458 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 23 Jul 2020 20:08:43 -0000 Author: jhb Date: Thu Jul 23 20:08:42 2020 New Revision: 363458 URL: https://svnweb.freebsd.org/changeset/base/363458 Log: Set si_addr to badvaddr for TLB faults. Reviewed by: kib Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D25775 Modified: head/sys/mips/mips/trap.c Modified: head/sys/mips/mips/trap.c ============================================================================== --- head/sys/mips/mips/trap.c Thu Jul 23 20:06:24 2020 (r363457) +++ head/sys/mips/mips/trap.c Thu Jul 23 20:08:42 2020 (r363458) @@ -740,7 +740,7 @@ dofault: } goto err; } - addr = trapframe->pc; + addr = trapframe->badvaddr; msg = "BAD_PAGE_FAULT"; log_bad_page_fault(msg, trapframe, type); From owner-svn-src-all@freebsd.org Thu Jul 23 21:33:11 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1C961364635; Thu, 23 Jul 2020 21:33:11 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BCQYL6QD0z4BDb; Thu, 23 Jul 2020 21:33:10 +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 C07011F6D6; Thu, 23 Jul 2020 21:33:10 +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 06NLXAnX083357; Thu, 23 Jul 2020 21:33:10 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06NLXAWM083356; Thu, 23 Jul 2020 21:33:10 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202007232133.06NLXAWM083356@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 23 Jul 2020 21:33:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363459 - head/sys/riscv/riscv X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/sys/riscv/riscv X-SVN-Commit-Revision: 363459 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 23 Jul 2020 21:33:11 -0000 Author: jhb Date: Thu Jul 23 21:33:10 2020 New Revision: 363459 URL: https://svnweb.freebsd.org/changeset/base/363459 Log: Pass the right size to memcpy() when copying the array of FP registers. The size of the containing structure was passed instead of the size of the array. This happened to be harmless as the extra word copied is one we copy in the next line anyway. Reported by: CHERI (bounds check violation) Reviewed by: brooks, imp Obtained from: CheriBSD MFC after: 1 week Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D25791 Modified: head/sys/riscv/riscv/machdep.c Modified: head/sys/riscv/riscv/machdep.c ============================================================================== --- head/sys/riscv/riscv/machdep.c Thu Jul 23 20:08:42 2020 (r363458) +++ head/sys/riscv/riscv/machdep.c Thu Jul 23 21:33:10 2020 (r363459) @@ -419,7 +419,7 @@ get_fpcontext(struct thread *td, mcontext_t *mcp) KASSERT((curpcb->pcb_fpflags & ~PCB_FP_USERMASK) == 0, ("Non-userspace FPE flags set in get_fpcontext")); memcpy(mcp->mc_fpregs.fp_x, curpcb->pcb_x, - sizeof(mcp->mc_fpregs)); + sizeof(mcp->mc_fpregs.fp_x)); mcp->mc_fpregs.fp_fcsr = curpcb->pcb_fcsr; mcp->mc_fpregs.fp_flags = curpcb->pcb_fpflags; mcp->mc_flags |= _MC_FP_VALID; @@ -446,7 +446,7 @@ set_fpcontext(struct thread *td, mcontext_t *mcp) curpcb = curthread->td_pcb; /* FPE usage is enabled, override registers. */ memcpy(curpcb->pcb_x, mcp->mc_fpregs.fp_x, - sizeof(mcp->mc_fpregs)); + sizeof(mcp->mc_fpregs.fp_x)); curpcb->pcb_fcsr = mcp->mc_fpregs.fp_fcsr; curpcb->pcb_fpflags = mcp->mc_fpregs.fp_flags & PCB_FP_USERMASK; td->td_frame->tf_sstatus |= SSTATUS_FS_CLEAN; From owner-svn-src-all@freebsd.org Thu Jul 23 21:40:04 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8E62C364B22; Thu, 23 Jul 2020 21:40:04 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BCQjJ2rJxz4Bjb; Thu, 23 Jul 2020 21:40:04 +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 3A1611FAEF; Thu, 23 Jul 2020 21:40:04 +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 06NLe40Q083961; Thu, 23 Jul 2020 21:40:04 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06NLe4UW083960; Thu, 23 Jul 2020 21:40:04 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202007232140.06NLe4UW083960@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 23 Jul 2020 21:40:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363460 - head/sys/arm64/arm64 X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/sys/arm64/arm64 X-SVN-Commit-Revision: 363460 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 23 Jul 2020 21:40:04 -0000 Author: jhb Date: Thu Jul 23 21:40:03 2020 New Revision: 363460 URL: https://svnweb.freebsd.org/changeset/base/363460 Log: Set si_trapno to the exception code from esr. Reviewed by: kib Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D25771 Modified: head/sys/arm64/arm64/trap.c Modified: head/sys/arm64/arm64/trap.c ============================================================================== --- head/sys/arm64/arm64/trap.c Thu Jul 23 21:33:10 2020 (r363459) +++ head/sys/arm64/arm64/trap.c Thu Jul 23 21:40:03 2020 (r363460) @@ -104,7 +104,7 @@ static abort_handler *abort_handlers[] = { }; static __inline void -call_trapsignal(struct thread *td, int sig, int code, void *addr) +call_trapsignal(struct thread *td, int sig, int code, void *addr, int trapno) { ksiginfo_t ksi; @@ -112,6 +112,7 @@ call_trapsignal(struct thread *td, int sig, int code, ksi.ksi_signo = sig; ksi.ksi_code = code; ksi.ksi_addr = addr; + ksi.ksi_trapno = trapno; trapsignal(td, &ksi); } @@ -161,7 +162,8 @@ svc_handler(struct thread *td, struct trapframe *frame syscallenter(td); syscallret(td); } else { - call_trapsignal(td, SIGILL, ILL_ILLOPN, (void *)frame->tf_elr); + call_trapsignal(td, SIGILL, ILL_ILLOPN, (void *)frame->tf_elr, + ESR_ELx_EXCEPTION(frame->tf_esr)); userret(td, frame); } } @@ -177,7 +179,8 @@ align_abort(struct thread *td, struct trapframe *frame panic("Misaligned access from kernel space!"); } - call_trapsignal(td, SIGBUS, BUS_ADRALN, (void *)frame->tf_elr); + call_trapsignal(td, SIGBUS, BUS_ADRALN, (void *)frame->tf_elr, + ESR_ELx_EXCEPTION(frame->tf_esr)); userret(td, frame); } @@ -261,7 +264,8 @@ data_abort(struct thread *td, struct trapframe *frame, error = vm_fault_trap(map, far, ftype, VM_FAULT_NORMAL, &sig, &ucode); if (error != KERN_SUCCESS) { if (lower) { - call_trapsignal(td, sig, ucode, (void *)far); + call_trapsignal(td, sig, ucode, (void *)far, + ESR_ELx_EXCEPTION(esr)); } else { if (td->td_intr_nesting_level == 0 && pcb->pcb_onfault != 0) { @@ -483,24 +487,29 @@ do_el0_sync(struct thread *td, struct trapframe *frame break; case EXCP_UNKNOWN: if (!undef_insn(0, frame)) - call_trapsignal(td, SIGILL, ILL_ILLTRP, (void *)far); + call_trapsignal(td, SIGILL, ILL_ILLTRP, (void *)far, + exception); userret(td, frame); break; case EXCP_SP_ALIGN: - call_trapsignal(td, SIGBUS, BUS_ADRALN, (void *)frame->tf_sp); + call_trapsignal(td, SIGBUS, BUS_ADRALN, (void *)frame->tf_sp, + exception); userret(td, frame); break; case EXCP_PC_ALIGN: - call_trapsignal(td, SIGBUS, BUS_ADRALN, (void *)frame->tf_elr); + call_trapsignal(td, SIGBUS, BUS_ADRALN, (void *)frame->tf_elr, + exception); userret(td, frame); break; case EXCP_BRKPT_EL0: case EXCP_BRK: - call_trapsignal(td, SIGTRAP, TRAP_BRKPT, (void *)frame->tf_elr); + call_trapsignal(td, SIGTRAP, TRAP_BRKPT, (void *)frame->tf_elr, + exception); userret(td, frame); break; case EXCP_MSR: - call_trapsignal(td, SIGILL, ILL_PRVOPC, (void *)frame->tf_elr); + call_trapsignal(td, SIGILL, ILL_PRVOPC, (void *)frame->tf_elr, + exception); userret(td, frame); break; case EXCP_SOFTSTP_EL0: @@ -509,11 +518,12 @@ do_el0_sync(struct thread *td, struct trapframe *frame WRITE_SPECIALREG(mdscr_el1, READ_SPECIALREG(mdscr_el1) & ~DBG_MDSCR_SS); call_trapsignal(td, SIGTRAP, TRAP_TRACE, - (void *)frame->tf_elr); + (void *)frame->tf_elr, exception); userret(td, frame); break; default: - call_trapsignal(td, SIGBUS, BUS_OBJERR, (void *)frame->tf_elr); + call_trapsignal(td, SIGBUS, BUS_OBJERR, (void *)frame->tf_elr, + exception); userret(td, frame); break; } From owner-svn-src-all@freebsd.org Thu Jul 23 21:43:07 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8B94B364F50; Thu, 23 Jul 2020 21:43:07 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BCQmq350Fz4CGQ; Thu, 23 Jul 2020 21:43:07 +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 343F71FD8D; Thu, 23 Jul 2020 21:43:07 +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 06NLh7Rm089485; Thu, 23 Jul 2020 21:43:07 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06NLh7nM089484; Thu, 23 Jul 2020 21:43:07 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202007232143.06NLh7nM089484@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 23 Jul 2020 21:43:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363461 - head/sys/opencrypto X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/sys/opencrypto X-SVN-Commit-Revision: 363461 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 23 Jul 2020 21:43:07 -0000 Author: jhb Date: Thu Jul 23 21:43:06 2020 New Revision: 363461 URL: https://svnweb.freebsd.org/changeset/base/363461 Log: Consolidate duplicated code into a ktls_ocf_dispatch function. This function manages the loop around crypto_dispatch and coordination with ktls_ocf_callback. Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D25757 Modified: head/sys/opencrypto/ktls_ocf.c Modified: head/sys/opencrypto/ktls_ocf.c ============================================================================== --- head/sys/opencrypto/ktls_ocf.c Thu Jul 23 21:40:03 2020 (r363460) +++ head/sys/opencrypto/ktls_ocf.c Thu Jul 23 21:43:06 2020 (r363461) @@ -101,6 +101,40 @@ ktls_ocf_callback(struct cryptop *crp) } static int +ktls_ocf_dispatch(struct ocf_session *os, struct cryptop *crp) +{ + struct ocf_operation oo; + int error; + + oo.os = os; + oo.done = false; + + crp->crp_opaque = &oo; + crp->crp_callback = ktls_ocf_callback; + for (;;) { + error = crypto_dispatch(crp); + if (error) + break; + + mtx_lock(&os->lock); + while (!oo.done) + mtx_sleep(&oo, &os->lock, 0, "ocfktls", 0); + mtx_unlock(&os->lock); + + if (crp->crp_etype != EAGAIN) { + error = crp->crp_etype; + break; + } + + crp->crp_etype = 0; + crp->crp_flags &= ~CRYPTO_F_DONE; + oo.done = false; + counter_u64_add(ocf_retries, 1); + } + return (error); +} + +static int ktls_ocf_tls12_gcm_encrypt(struct ktls_session *tls, const struct tls_record_layer *hdr, uint8_t *trailer, struct iovec *iniov, struct iovec *outiov, int iovcnt, uint64_t seqno, @@ -110,7 +144,6 @@ ktls_ocf_tls12_gcm_encrypt(struct ktls_session *tls, struct tls_aead_data ad; struct cryptop crp; struct ocf_session *os; - struct ocf_operation oo; struct iovec iov[iovcnt + 1]; int i, error; uint16_t tls_comp_len; @@ -118,9 +151,6 @@ ktls_ocf_tls12_gcm_encrypt(struct ktls_session *tls, os = tls->cipher; - oo.os = os; - oo.done = false; - uio.uio_iov = iniov; uio.uio_iovcnt = iovcnt; uio.uio_offset = 0; @@ -180,35 +210,14 @@ ktls_ocf_tls12_gcm_encrypt(struct ktls_session *tls, crypto_use_uio(&crp, &uio); if (!inplace) crypto_use_output_uio(&crp, &out_uio); - crp.crp_opaque = &oo; - crp.crp_callback = ktls_ocf_callback; counter_u64_add(ocf_tls12_gcm_crypts, 1); if (inplace) counter_u64_add(ocf_inplace, 1); else counter_u64_add(ocf_separate_output, 1); - for (;;) { - error = crypto_dispatch(&crp); - if (error) - break; + error = ktls_ocf_dispatch(os, &crp); - mtx_lock(&os->lock); - while (!oo.done) - mtx_sleep(&oo, &os->lock, 0, "ocfktls", 0); - mtx_unlock(&os->lock); - - if (crp.crp_etype != EAGAIN) { - error = crp.crp_etype; - break; - } - - crp.crp_etype = 0; - crp.crp_flags &= ~CRYPTO_F_DONE; - oo.done = false; - counter_u64_add(ocf_retries, 1); - } - crypto_destroyreq(&crp); return (error); } @@ -223,16 +232,12 @@ ktls_ocf_tls13_gcm_encrypt(struct ktls_session *tls, char nonce[12]; struct cryptop crp; struct ocf_session *os; - struct ocf_operation oo; struct iovec iov[iovcnt + 1], out_iov[iovcnt + 1]; int i, error; bool inplace; os = tls->cipher; - oo.os = os; - oo.done = false; - crypto_initreq(&crp, os->sid); /* Setup the nonce. */ @@ -294,8 +299,6 @@ ktls_ocf_tls13_gcm_encrypt(struct ktls_session *tls, crp.crp_op = CRYPTO_OP_ENCRYPT | CRYPTO_OP_COMPUTE_DIGEST; crp.crp_flags = CRYPTO_F_CBIMM | CRYPTO_F_IV_SEPARATE; - crp.crp_opaque = &oo; - crp.crp_callback = ktls_ocf_callback; memcpy(crp.crp_iv, nonce, sizeof(nonce)); @@ -304,26 +307,7 @@ ktls_ocf_tls13_gcm_encrypt(struct ktls_session *tls, counter_u64_add(ocf_inplace, 1); else counter_u64_add(ocf_separate_output, 1); - for (;;) { - error = crypto_dispatch(&crp); - if (error) - break; - - mtx_lock(&os->lock); - while (!oo.done) - mtx_sleep(&oo, &os->lock, 0, "ocfktls", 0); - mtx_unlock(&os->lock); - - if (crp.crp_etype != EAGAIN) { - error = crp.crp_etype; - break; - } - - crp.crp_etype = 0; - crp.crp_flags &= ~CRYPTO_F_DONE; - oo.done = false; - counter_u64_add(ocf_retries, 1); - } + error = ktls_ocf_dispatch(os, &crp); crypto_destroyreq(&crp); return (error); From owner-svn-src-all@freebsd.org Thu Jul 23 22:28:36 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4FA80365633; Thu, 23 Jul 2020 22:28:36 +0000 (UTC) (envelope-from jmg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BCRnJ1Fqnz4FCw; Thu, 23 Jul 2020 22:28:36 +0000 (UTC) (envelope-from jmg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0A17420133; Thu, 23 Jul 2020 22:28:36 +0000 (UTC) (envelope-from jmg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06NMSZie014986; Thu, 23 Jul 2020 22:28:35 GMT (envelope-from jmg@FreeBSD.org) Received: (from jmg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06NMSZaJ014985; Thu, 23 Jul 2020 22:28:35 GMT (envelope-from jmg@FreeBSD.org) Message-Id: <202007232228.06NMSZaJ014985@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jmg set sender to jmg@FreeBSD.org using -f From: John-Mark Gurney Date: Thu, 23 Jul 2020 22:28:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363462 - head/usr.sbin/efibootmgr X-SVN-Group: head X-SVN-Commit-Author: jmg X-SVN-Commit-Paths: head/usr.sbin/efibootmgr X-SVN-Commit-Revision: 363462 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 23 Jul 2020 22:28:36 -0000 Author: jmg Date: Thu Jul 23 22:28:35 2020 New Revision: 363462 URL: https://svnweb.freebsd.org/changeset/base/363462 Log: update example to make it active when creating a new boot method... Clean up some of the sentences and grammar... make igor happy.. Modified: head/usr.sbin/efibootmgr/efibootmgr.8 Modified: head/usr.sbin/efibootmgr/efibootmgr.8 ============================================================================== --- head/usr.sbin/efibootmgr/efibootmgr.8 Thu Jul 23 21:43:06 2020 (r363461) +++ head/usr.sbin/efibootmgr/efibootmgr.8 Thu Jul 23 22:28:35 2020 (r363462) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 24, 2019 +.Dd July 23, 2020 .Dt EFIBOOTMGR 8 .Os .Sh NAME @@ -66,28 +66,34 @@ .Nm .Fl T .Sh "DESCRIPTION" +The .Nm -manipulates how UEFI Boot Managers boot the system. -Methods of booting can be created and destroyed. -Boot methods can be activated or deactivated. -The order of boot methods tried can be changed. -Temporary boot methods can override the usual booting methods. +program manipulates how UEFI Boot Managers boot the system. +It can create and destroy methods for booting along with activating or +deactivating them. +It can also change the defined order of boot methods. +It can create a temporary boot (BootNext) variable that references a +boot method to be tried once upon the next boot. .Pp The UEFI standard defines how hosts may control what is used to bootstrap the system. Each method is encapsulated within a persistent UEFI variable, stored by the UEFI BIOS of the form -.Cm Boot Ns Em XXXX . -These variables are numbered, describe where to load the bootstrap -program from, and whether or not the method is active. -The boot order of these methods is controlled by another variable +.Cm Boot Ns Em XXXX +(where XXXX are uppercase hexadecimal digits). +These variables are numbered, each describing where to load the bootstrap +program from, and whether or not the method is active (used for booting, +otherwise the method will be skipped). +The order of these methods is controlled by another variable, .Cm BootOrder . -The currently booting method is communicated using +The currently booted method is communicated using .Cm BootCurrent . A global timeout can also be set. .Pp .Nm -requires that the kernel efirt module be loaded to get and set these +requires that the kernel module +.Xr efirt 9 +module be present or loaded to get and set these non-volatile variables. .Pp The following options are available: @@ -113,7 +119,7 @@ boot entry. .It Fl c -create Create a new .Cm Boot -variable. +variable (aka method or entry). .It Fl D -dry-run Process but do not change any variables. .It Fl E -esp @@ -136,7 +142,7 @@ The path to and name of the kernel. .It Fl l -loader Ar loader The path to and name of the loader. .It Fl L -label Ar label -An optional description for the entry. +An optional description for the method. .It Fl n -bootnext Set .Ar bootnum @@ -169,32 +175,36 @@ To display the current .Cm Boot related variables in the system: .Pp -.Dl efibootmgr [-v] +.Dl efibootmgr -v .Pp This will display the optional .Cm BootNext -bootnum, -.Cm BootCurrent , -or currently booted bootnum, followed by the optional +(if present), +.Cm BootCurrent +(currently booted method), followed by the optional .Cm Timeout value, any .Cm BootOrder that may be set, followed finally by all currently defined .Cm Boot variables, active or not. -The verbose flag will augment this output with the disk partition uuids, +The verbose flag, +.Pq Fl v , +augments this output with the disk partition uuids, size/offset and device-path of the variable. +The flag will also include any unreferenced (by BootOrder) variables. .Pp The .Nm program can be used to create new EFI boot variables. -To create a new boot var pointing to an installation with its EFI partition -mounted under +The following command may be used to create a new boot method, using +the EFI partition mounted under .Pa /mnt , -the given loader and a label +mark the method active, using +the given loader and label the method .Qq FreeBSD-11 : .Pp -.Dl efibootmgr -c -l /mnt/EFI/freebsd/loader.efi -L FreeBSD-11 +.Dl efibootmgr -a -c -l /mnt/EFI/freebsd/loader.efi -L FreeBSD-11 .Pp This will result in the next available bootnum being assigned to a new UEFI boot variable, and given the label @@ -203,8 +213,11 @@ such as: .Pp .Dl Boot0009 FreeBSD-11 .Pp -Note newly created boot entries are created inactive. -The active state is denoted by an '*' following the +Note newly created boot entries are, by default, created inactive, hence +the reason +.Fl a +flag is specified above so that it will be considered for booting. +The active state is denoted by a '*' following the .Cm Boot Ns Em XXXX name in the output. They are also inserted into the first position of current @@ -217,7 +230,7 @@ booting from, else they are ignored. .Pp Will delete the given boot entry Boot0009. .Pp -To set a given newly created boot entry active use: +To set the given boot entry active: .Pp .Dl efibootmgr -a -b 0009 .Pp @@ -233,6 +246,11 @@ for the next reboot use: .Pp .Dl efibootmgr -o 0009,0003,... .Sh SEE ALSO +.Xr efirt 9 , .Xr efivar 8 , .Xr gpart 8 , .Xr uefi 8 +.Sh STANDARDS +The Unified Extensible Firmware Interface Specification is available +from +.Pa www.uefi.org . From owner-svn-src-all@freebsd.org Thu Jul 23 23:15:59 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id F089036693C; Thu, 23 Jul 2020 23:15:59 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BCSqz67Nkz4H4J; Thu, 23 Jul 2020 23:15:59 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro-274.local (unknown [IPv6:2601:648:8203:2990:19cd:9bb8:2b2d:bc7e]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id 46DD61F0DF; Thu, 23 Jul 2020 23:15:59 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Subject: Re: svn commit: r363188 - in head: lib/libpmc sys/dev/hwpmc To: Alexander Motin , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <202007141811.06EIB6b3008168@repo.freebsd.org> From: John Baldwin Autocrypt: addr=jhb@FreeBSD.org; keydata= mQGiBETQ+XcRBADMFybiq69u+fJRy/0wzqTNS8jFfWaBTs5/OfcV7wWezVmf9sgwn8TW0Dk0 c9MBl0pz+H01dA2ZSGZ5fXlmFIsee1WEzqeJzpiwd/pejPgSzXB9ijbLHZ2/E0jhGBcVy5Yo /Tw5+U/+laeYKu2xb0XPvM0zMNls1ah5OnP9a6Ql6wCgupaoMySb7DXm2LHD1Z9jTsHcAQMD /1jzh2BoHriy/Q2s4KzzjVp/mQO5DSm2z14BvbQRcXU48oAosHA1u3Wrov6LfPY+0U1tG47X 1BGfnQH+rNAaH0livoSBQ0IPI/8WfIW7ub4qV6HYwWKVqkDkqwcpmGNDbz3gfaDht6nsie5Z pcuCcul4M9CW7Md6zzyvktjnbz61BADGDCopfZC4of0Z3Ka0u8Wik6UJOuqShBt1WcFS8ya1 oB4rc4tXfSHyMF63aPUBMxHR5DXeH+EO2edoSwViDMqWk1jTnYza51rbGY+pebLQOVOxAY7k do5Ordl3wklBPMVEPWoZ61SdbcjhHVwaC5zfiskcxj5wwXd2E9qYlBqRg7QeSm9obiBCYWxk d2luIDxqaGJARnJlZUJTRC5vcmc+iGAEExECACAFAkTQ+awCGwMGCwkIBwMCBBUCCAMEFgID AQIeAQIXgAAKCRBy3lIGd+N/BI6RAJ9S97fvbME+3hxzE3JUyUZ6vTewDACdE1stFuSfqMvM jomvZdYxIYyTUpC5Ag0ERND5ghAIAPwsO0B7BL+bz8sLlLoQktGxXwXQfS5cInvL17Dsgnr3 1AKa94j9EnXQyPEj7u0d+LmEe6CGEGDh1OcGFTMVrof2ZzkSy4+FkZwMKJpTiqeaShMh+Goj XlwIMDxyADYvBIg3eN5YdFKaPQpfgSqhT+7El7w+wSZZD8pPQuLAnie5iz9C8iKy4/cMSOrH YUK/tO+Nhw8Jjlw94Ik0T80iEhI2t+XBVjwdfjbq3HrJ0ehqdBwukyeJRYKmbn298KOFQVHO EVbHA4rF/37jzaMadK43FgJ0SAhPPF5l4l89z5oPu0b/+5e2inA3b8J3iGZxywjM+Csq1tqz hltEc7Q+E08AAwUIAL+15XH8bPbjNJdVyg2CMl10JNW2wWg2Q6qdljeaRqeR6zFus7EZTwtX sNzs5bP8y51PSUDJbeiy2RNCNKWFMndM22TZnk3GNG45nQd4OwYK0RZVrikalmJY5Q6m7Z16 4yrZgIXFdKj2t8F+x613/SJW1lIr9/bDp4U9tw0V1g3l2dFtD3p3ZrQ3hpoDtoK70ioIAjjH aIXIAcm3FGZFXy503DOA0KaTWwvOVdYCFLm3zWuSOmrX/GsEc7ovasOWwjPn878qVjbUKWwx Q4QkF4OhUV9zPtf9tDSAZ3x7QSwoKbCoRCZ/xbyTUPyQ1VvNy/mYrBcYlzHodsaqUDjHuW+I SQQYEQIACQUCRND5ggIbDAAKCRBy3lIGd+N/BCO8AJ9j1dWVQWxw/YdTbEyrRKOY8YZNwwCf afMAg8QvmOWnHx3wl8WslCaXaE8= Message-ID: <70e7319b-93d6-a9d2-cf70-73a6a26616a5@FreeBSD.org> Date: Thu, 23 Jul 2020 16:15:57 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:68.0) Gecko/20100101 Thunderbird/68.6.0 MIME-Version: 1.0 In-Reply-To: <202007141811.06EIB6b3008168@repo.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Jul 2020 23:16:00 -0000 On 7/14/20 11:11 AM, Alexander Motin wrote: > Author: mav > Date: Tue Jul 14 18:11:05 2020 > New Revision: 363188 > URL: https://svnweb.freebsd.org/changeset/base/363188 > > Log: > Add stepping to the kern.hwpmc.cpuid string on x86. > > It follows the equivalent Linux change to be able to differentiate > skylakex and cascadelakex, sharing the same model but not stepping. > > This fixes skylakex handling broken by r363144. Unfortunately this breaks compatibility meaning you can't use an older libpmc with a newer kernel module after this change. Perhaps we don't consider libpmc stable, but this was really annoying as I booted a test kernel today on an older Haswell box whose world is from before this change and pmc doesn't work at all. (pmccontrol -L doesn't list any valid counters as the older libpmc presumably chokes on the additional suffix and doesn't match anything) -- John Baldwin From owner-svn-src-all@freebsd.org Thu Jul 23 23:29:52 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8B33F366F33; Thu, 23 Jul 2020 23:29:52 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BCT802t6Mz4J44; Thu, 23 Jul 2020 23:29:52 +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 460AE20A47; Thu, 23 Jul 2020 23:29:52 +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 06NNTqeQ051771; Thu, 23 Jul 2020 23:29:52 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06NNTo4d051764; Thu, 23 Jul 2020 23:29:50 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <202007232329.06NNTo4d051764@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Thu, 23 Jul 2020 23:29:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363463 - head/tests/sys/geom/class/mirror X-SVN-Group: head X-SVN-Commit-Author: bdrewery X-SVN-Commit-Paths: head/tests/sys/geom/class/mirror X-SVN-Commit-Revision: 363463 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 23 Jul 2020 23:29:52 -0000 Author: bdrewery Date: Thu Jul 23 23:29:50 2020 New Revision: 363463 URL: https://svnweb.freebsd.org/changeset/base/363463 Log: Limit gmirror failpoint tests to the test worker This avoids injecting errors into the test system's mirrors. gnop seems like a good solution here but it injects errors at the wrong place vs where these tests expect and does not support a 'max global count' like the failpoints do with 'n*' syntax. Reviewed by: cem, vangyzen Sponsored by: Dell EMC Isilon Modified: head/tests/sys/geom/class/mirror/10_test.sh head/tests/sys/geom/class/mirror/11_test.sh head/tests/sys/geom/class/mirror/12_test.sh head/tests/sys/geom/class/mirror/13_test.sh head/tests/sys/geom/class/mirror/9_test.sh head/tests/sys/geom/class/mirror/conf.sh head/tests/sys/geom/class/mirror/sync_error.sh Modified: head/tests/sys/geom/class/mirror/10_test.sh ============================================================================== --- head/tests/sys/geom/class/mirror/10_test.sh Thu Jul 23 22:28:35 2020 (r363462) +++ head/tests/sys/geom/class/mirror/10_test.sh Thu Jul 23 23:29:50 2020 (r363463) @@ -30,7 +30,7 @@ tmp2=$(mktemp $base.XXXXXX) EIO=5 # gmirror should retry a failed read from the other mirror. -sysctl ${regreadfp}="1*return(${EIO})" +sysctl ${regreadfp}="1*return(${EIO})[pid $(gmirror_worker_pid)]" dd if=/dev/mirror/$name of=$tmp1 iseek=256 bs=$ddbs count=1 >/dev/null 2>&1 dd if=/dev/$us1 of=$tmp2 iseek=256 bs=$ddbs count=1 >/dev/null 2>&1 sysctl ${regreadfp}='off' Modified: head/tests/sys/geom/class/mirror/11_test.sh ============================================================================== --- head/tests/sys/geom/class/mirror/11_test.sh Thu Jul 23 22:28:35 2020 (r363462) +++ head/tests/sys/geom/class/mirror/11_test.sh Thu Jul 23 23:29:50 2020 (r363463) @@ -31,7 +31,7 @@ tmp2=$(mktemp $base.XXXXXX) ENXIO=6 # gmirror has special handling for ENXIO. It does not mark the failed component # as broken, allowing it to rejoin the mirror automatically when it appears. -sysctl ${regreadfp}="1*return(${ENXIO})" +sysctl ${regreadfp}="1*return(${ENXIO})[pid $(gmirror_worker_pid)]" dd if=/dev/mirror/$name of=$tmp1 iseek=512 bs=$ddbs count=1 >/dev/null 2>&1 dd if=/dev/$us1 of=$tmp2 iseek=512 bs=$ddbs count=1 >/dev/null 2>&1 sysctl ${regreadfp}='off' Modified: head/tests/sys/geom/class/mirror/12_test.sh ============================================================================== --- head/tests/sys/geom/class/mirror/12_test.sh Thu Jul 23 22:28:35 2020 (r363462) +++ head/tests/sys/geom/class/mirror/12_test.sh Thu Jul 23 23:29:50 2020 (r363463) @@ -29,7 +29,7 @@ dd if=/dev/random of=$tmp1 bs=$ddbs count=1 >/dev/null EIO=5 # gmirror should kick one of the mirrors out after hitting EIO. -sysctl ${regwritefp}="1*return(${EIO})" +sysctl ${regwritefp}="1*return(${EIO})[pid $(gmirror_worker_pid)]" dd if=$tmp1 of=/dev/mirror/$name bs=$ddbs count=1 >/dev/null 2>&1 dd if=/dev/mirror/$name of=$tmp2 bs=$ddbs count=1 >/dev/null 2>&1 sysctl ${regwritefp}='off' Modified: head/tests/sys/geom/class/mirror/13_test.sh ============================================================================== --- head/tests/sys/geom/class/mirror/13_test.sh Thu Jul 23 22:28:35 2020 (r363462) +++ head/tests/sys/geom/class/mirror/13_test.sh Thu Jul 23 23:29:50 2020 (r363463) @@ -31,7 +31,7 @@ dd if=/dev/random of=$tmp1 bs=$ddbs count=1 >/dev/null ENXIO=6 # gmirror has special handling for ENXIO. It does not mark the failed component # as broken, allowing it to rejoin the mirror automatically when it appears. -sysctl ${regwritefp}="1*return(${ENXIO})" +sysctl ${regwritefp}="1*return(${ENXIO})[pid $(gmirror_worker_pid)]" dd if=$tmp1 of=/dev/mirror/$name bs=$ddbs count=1 >/dev/null 2>&1 dd if=/dev/mirror/$name of=$tmp2 bs=$ddbs count=1 >/dev/null 2>&1 sysctl ${regwritefp}='off' Modified: head/tests/sys/geom/class/mirror/9_test.sh ============================================================================== --- head/tests/sys/geom/class/mirror/9_test.sh Thu Jul 23 22:28:35 2020 (r363462) +++ head/tests/sys/geom/class/mirror/9_test.sh Thu Jul 23 23:29:50 2020 (r363463) @@ -26,7 +26,7 @@ devwait # Break one of the mirrors by forcing a single metadata write error. # When dd closes the mirror provider, gmirror will attempt to mark the mirrors # clean, and will kick one of the mirrors out upon hitting the error. -sysctl debug.fail_point.g_mirror_metadata_write='1*return(5)' || exit 1 +sysctl debug.fail_point.g_mirror_metadata_write="1*return(5)[pid $(gmirror_worker_pid)]" || exit 1 dd if=/dev/random of=/dev/mirror/$name bs=$ddbs count=1 >/dev/null 2>&1 sysctl debug.fail_point.g_mirror_metadata_write='off' || exit 1 Modified: head/tests/sys/geom/class/mirror/conf.sh ============================================================================== --- head/tests/sys/geom/class/mirror/conf.sh Thu Jul 23 22:28:35 2020 (r363462) +++ head/tests/sys/geom/class/mirror/conf.sh Thu Jul 23 23:29:50 2020 (r363463) @@ -12,6 +12,11 @@ gmirror_test_cleanup() } trap gmirror_test_cleanup ABRT EXIT INT TERM +gmirror_worker_pid() +{ + pgrep -S -n "g_mirror mirror\..*" +} + syncwait() { while $(gmirror status -s $name | grep -q SYNCHRONIZING); do Modified: head/tests/sys/geom/class/mirror/sync_error.sh ============================================================================== --- head/tests/sys/geom/class/mirror/sync_error.sh Thu Jul 23 22:28:35 2020 (r363462) +++ head/tests/sys/geom/class/mirror/sync_error.sh Thu Jul 23 23:29:50 2020 (r363463) @@ -28,7 +28,7 @@ sync_read_error_2_disks_body() atf_check gmirror label $name $md1 devwait - atf_check -s ignore -e empty -o not-empty sysctl ${REG_READ_FP}='1*return(5)' + atf_check -s ignore -e empty -o not-empty sysctl ${REG_READ_FP}="1*return(5)[pid $(gmirror_worker_pid)]" # If a read error occurs while synchronizing and the mirror contains # a single active disk, gmirror has no choice but to fail the @@ -75,7 +75,7 @@ sync_read_error_3_disks_body() atf_check gmirror insert $name $md2 syncwait - atf_check -s exit:0 -e empty -o not-empty sysctl ${REG_READ_FP}='1*return(5)' + atf_check -s exit:0 -e empty -o not-empty sysctl ${REG_READ_FP}="1*return(5)[pid $(gmirror_worker_pid)]" # If a read error occurs while synchronizing a new disk, and we have # multiple active disks, we retry the read after an error. The disk From owner-svn-src-all@freebsd.org Thu Jul 23 23:44:25 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 159E8367632; Thu, 23 Jul 2020 23:44:25 +0000 (UTC) (envelope-from mavbsd@gmail.com) Received: from mail-qt1-x843.google.com (mail-qt1-x843.google.com [IPv6:2607:f8b0:4864:20::843]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BCTSm2cf3z4JX6; Thu, 23 Jul 2020 23:44:24 +0000 (UTC) (envelope-from mavbsd@gmail.com) Received: by mail-qt1-x843.google.com with SMTP id s16so5742374qtn.7; Thu, 23 Jul 2020 16:44:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:to:references:from:autocrypt:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=RCtvvkd+SIgcH/G771VJseT+mcW5HOE0x7VpjBjF3hI=; b=Ll538WqSbFqxegdLxGv0EY1fLizFR4C+6HDjp++eawXq86tnLSdTeHJDk9nOHb/cI9 usnug1FNqSV8/Dt/dnjgGT2iLGzcWVMtfLsDCbEgvHQ1ULFMmayKDFHGNHPpXjAz+/z8 FBWTratHCVpAnF+WUqLjoxzYQYEChnY96VGJ1H59chSLhczX3hVskr/T70Uel8OqcLGK j4o6KI+tUDu7gZjtbPkjF+nWhFolbAAbZ+Ev5U5b/wcXlZf9MJaHnAFWEHmBZ1XWptLr MysH12Z0fJpC1Uu94O0vyGYQBo5Sd5WnLYg6w+LldZhlyiubz0LUOoD0IqJN2wwtCh4A d4VQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:subject:to:references:from:autocrypt :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=RCtvvkd+SIgcH/G771VJseT+mcW5HOE0x7VpjBjF3hI=; b=bs9w6x75Sy3NvRBTVqWoi67vMsss14T9LDAbzxNilkkrznfW2sJpQsXWUBZdGyprui N0F6mKq5956Earuiz+kavES1YMswIScOLnf3hPt9gR4ekmQCcoIJSH18I5wyfSagWUXy Sz3iTZyy6ggLBlISdC27jnTsjSZM/ikWF2TK8C7IeSc0LxlohEtd4rlKVnHos+ApZLqJ RH76tpV8Wd/1Tcx3n68h2+uJPhMM0nVZ6hplwFtB7Y5Eu0Z8vTNcL25zCEhnrVSEa40e UEtdDjuA0OTOZAeoznRuL7eWTycTMox+9TVfBOSTmH7ssIWDYiKD8xRXMjT3Vqapunro I7ug== X-Gm-Message-State: AOAM531vL4Sm0PexsYrq+egybUDSJTe4tTnUsZ59FX+oSRIrbgs6y9y6 rhvC+pree9V+rdNlCxFy33pGSp4YTaM= X-Google-Smtp-Source: ABdhPJzg8ofOqdFtcZsDjFbAT29/nHhSAWjFbKJmXFMD7cQz8SZEq0NzS9YnQmPsMxeIjgzaG0JXqQ== X-Received: by 2002:aed:238d:: with SMTP id j13mr7012822qtc.220.1595547863143; Thu, 23 Jul 2020 16:44:23 -0700 (PDT) Received: from spectre.mavhome.dp.ua ([2600:1700:3580:3560:228:f8ff:fe04:d12]) by smtp.gmail.com with ESMTPSA id 205sm4027997qkn.104.2020.07.23.16.44.22 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 23 Jul 2020 16:44:22 -0700 (PDT) Sender: Alexander Motin Subject: Re: svn commit: r363188 - in head: lib/libpmc sys/dev/hwpmc To: John Baldwin , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <202007141811.06EIB6b3008168@repo.freebsd.org> <70e7319b-93d6-a9d2-cf70-73a6a26616a5@FreeBSD.org> From: Alexander Motin Autocrypt: addr=mav@FreeBSD.org; prefer-encrypt=mutual; keydata= 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 Message-ID: Date: Thu, 23 Jul 2020 19:44:21 -0400 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:68.0) Gecko/20100101 Thunderbird/68.0 MIME-Version: 1.0 In-Reply-To: <70e7319b-93d6-a9d2-cf70-73a6a26616a5@FreeBSD.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4BCTSm2cf3z4JX6 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=Ll538WqS; dmarc=none; spf=pass (mx1.freebsd.org: domain of mavbsd@gmail.com designates 2607:f8b0:4864:20::843 as permitted sender) smtp.mailfrom=mavbsd@gmail.com X-Spamd-Result: default: False [-2.30 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; MID_RHS_MATCH_FROM(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36:c]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[FreeBSD.org]; NEURAL_HAM_LONG(-1.02)[-1.023]; TO_DN_SOME(0.00)[]; RCVD_COUNT_THREE(0.00)[3]; NEURAL_HAM_MEDIUM(-0.99)[-0.990]; DKIM_TRACE(0.00)[gmail.com:+]; NEURAL_HAM_SHORT(-0.09)[-0.085]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::843:from]; FORGED_SENDER(0.30)[mav@FreeBSD.org,mavbsd@gmail.com]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; FROM_NEQ_ENVFROM(0.00)[mav@FreeBSD.org,mavbsd@gmail.com]; RCVD_TLS_ALL(0.00)[] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Jul 2020 23:44:25 -0000 On 23.07.2020 19:15, John Baldwin wrote: > On 7/14/20 11:11 AM, Alexander Motin wrote: >> Author: mav >> Date: Tue Jul 14 18:11:05 2020 >> New Revision: 363188 >> URL: https://svnweb.freebsd.org/changeset/base/363188 >> >> Log: >> Add stepping to the kern.hwpmc.cpuid string on x86. >> >> It follows the equivalent Linux change to be able to differentiate >> skylakex and cascadelakex, sharing the same model but not stepping. >> >> This fixes skylakex handling broken by r363144. > > Unfortunately this breaks compatibility meaning you can't use an older > libpmc with a newer kernel module after this change. Perhaps we don't > consider libpmc stable, but this was really annoying as I booted a test > kernel today on an older Haswell box whose world is from before this > change and pmc doesn't work at all. (pmccontrol -L doesn't list any > valid counters as the older libpmc presumably chokes on the additional > suffix and doesn't match anything) Unfortunately so. I've added other way compatibility, but can't change the past. Do you think it is critical enough to add more compat shims, like extra sysctls? -- Alexander Motin From owner-svn-src-all@freebsd.org Thu Jul 23 23:47:40 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D39B23676C3; Thu, 23 Jul 2020 23:47:40 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: from mail-wr1-x444.google.com (mail-wr1-x444.google.com [IPv6:2a00:1450:4864:20::444]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BCTXX5JNRz4JvS; Thu, 23 Jul 2020 23:47:40 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: by mail-wr1-x444.google.com with SMTP id b6so6692707wrs.11; Thu, 23 Jul 2020 16:47:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=GB8C7WKLa0GBJSBhu7Jpio9r5sGKZGUC/oyWAjSBxdw=; b=QrRTfFEuNrGrfHYVHbMMytnlaIx8qN3uh+hIlc5si8wlrEis0BwUTk7T+y7t2hzlwW +1jrMk+X+zmgs/Tj2YixvkD5Aj3IuX7Qe9yUmZDDjnmUYLYZkdvunsHqEX9b+3O7Z3Yv 02WT+ihTVUoXIuwOyvn31GRn8YYKSVDYWNAK5X+a1+ujGXMrPuJ6fLLWIka4ig1IXcU9 IvAx274Og8PSWTyk3S170cIxW0/dJp8pUN26e2bFMcJFjLa7TnRbejaq4Gg2qhesFiPt D/DV4JjdzOBYBbq30K39yIuLx6SWxeqGUyJs4/+y5aVtYNSw+/ipzGVW1DZAUnzKFsgs 1ttA== 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=GB8C7WKLa0GBJSBhu7Jpio9r5sGKZGUC/oyWAjSBxdw=; b=maouhb948eNOMdTI71K0dxIeJGN/TpgOlNShYm/lHl0Kjk/ffoR+OmWtaWVGqYYVAo vsSSsP2Lb/GxYS0cHnkXWckDmGGV55E07aVBZhWr5fc3e+38d/voZHVDZf/h9cc3b6Mf TFx4FV9Ft+pJ8mi1f4Cza2u272NkaVtZC5MrcS3Xj7yf2eZDToX2roQq6dE+y+7T2I38 M/EWma4I5f/mZNnjuwdGi/2moF2mi7reU9jdPOQdrSp+N2+dAou4ovJ5znjrL8fEoyPt pGce3ohbSIoPOQi5Df2ToqS8r7VCXHGsU9FDbfeHLbfXc+GazY+CzZM5RXsGEycOj+eG bF+A== X-Gm-Message-State: AOAM5315KXM3B03aIAQLYd1Uj2Rpbt/NcHxF0by9349hA//ksspZS9PD eIr6D/jzZ2OThHu8uYndSohW3IzHvIqU3Qe6vZ5d9A== X-Google-Smtp-Source: ABdhPJyFx6gsYaGL05OM9oqZutLv5+/9R7U0bjqO9M2O4z+TUhESi3yEota3Rizf1m35qhBrBzGZYTjZEOAU//Md0eU= X-Received: by 2002:adf:82b2:: with SMTP id 47mr5857210wrc.17.1595548059237; Thu, 23 Jul 2020 16:47:39 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a5d:614c:0:0:0:0:0 with HTTP; Thu, 23 Jul 2020 16:47:38 -0700 (PDT) In-Reply-To: References: <202007141811.06EIB6b3008168@repo.freebsd.org> <70e7319b-93d6-a9d2-cf70-73a6a26616a5@FreeBSD.org> From: Mateusz Guzik Date: Fri, 24 Jul 2020 01:47:38 +0200 Message-ID: Subject: Re: svn commit: r363188 - in head: lib/libpmc sys/dev/hwpmc To: Alexander Motin Cc: John Baldwin , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 4BCTXX5JNRz4JvS X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US]; REPLY(-4.00)[] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Jul 2020 23:47:40 -0000 I don't think that's worth the effort. However, versioning would be nice. Then tooling could nicely crap out immediately instead of giving funny results (or no results). On 7/24/20, Alexander Motin wrote: > On 23.07.2020 19:15, John Baldwin wrote: >> On 7/14/20 11:11 AM, Alexander Motin wrote: >>> Author: mav >>> Date: Tue Jul 14 18:11:05 2020 >>> New Revision: 363188 >>> URL: https://svnweb.freebsd.org/changeset/base/363188 >>> >>> Log: >>> Add stepping to the kern.hwpmc.cpuid string on x86. >>> >>> It follows the equivalent Linux change to be able to differentiate >>> skylakex and cascadelakex, sharing the same model but not stepping. >>> >>> This fixes skylakex handling broken by r363144. >> >> Unfortunately this breaks compatibility meaning you can't use an older >> libpmc with a newer kernel module after this change. Perhaps we don't >> consider libpmc stable, but this was really annoying as I booted a test >> kernel today on an older Haswell box whose world is from before this >> change and pmc doesn't work at all. (pmccontrol -L doesn't list any >> valid counters as the older libpmc presumably chokes on the additional >> suffix and doesn't match anything) > > Unfortunately so. I've added other way compatibility, but can't change > the past. Do you think it is critical enough to add more compat shims, > like extra sysctls? > > -- > Alexander Motin > -- Mateusz Guzik From owner-svn-src-all@freebsd.org Thu Jul 23 23:48:20 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2AF7C36790A; Thu, 23 Jul 2020 23:48:20 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BCTYJ0QSFz4K5l; Thu, 23 Jul 2020 23:48:20 +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 CCFD420FF0; Thu, 23 Jul 2020 23:48:19 +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 06NNmJWk063849; Thu, 23 Jul 2020 23:48:19 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06NNmJ6o063845; Thu, 23 Jul 2020 23:48:19 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202007232348.06NNmJ6o063845@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 23 Jul 2020 23:48:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363464 - in head: share/man/man4 sys/kern sys/opencrypto sys/sys X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in head: share/man/man4 sys/kern sys/opencrypto sys/sys X-SVN-Commit-Revision: 363464 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 23 Jul 2020 23:48:20 -0000 Author: jhb Date: Thu Jul 23 23:48:18 2020 New Revision: 363464 URL: https://svnweb.freebsd.org/changeset/base/363464 Log: Add support for KTLS RX via software decryption. Allow TLS records to be decrypted in the kernel after being received by a NIC. At a high level this is somewhat similar to software KTLS for the transmit path except in reverse. Protocols enqueue mbufs containing encrypted TLS records (or portions of records) into the tail of a socket buffer and the KTLS layer decrypts those records before returning them to userland applications. However, there is an important difference: - In the transmit case, the socket buffer is always a single "record" holding a chain of mbufs. Not-yet-encrypted mbufs are marked not ready (M_NOTREADY) and released to protocols for transmit by marking mbufs ready once their data is encrypted. - In the receive case, incoming (encrypted) data appended to the socket buffer is still a single stream of data from the protocol, but decrypted TLS records are stored as separate records in the socket buffer and read individually via recvmsg(). Initially I tried to make this work by marking incoming mbufs as M_NOTREADY, but there didn't seemed to be a non-gross way to deal with picking a portion of the mbuf chain and turning it into a new record in the socket buffer after decrypting the TLS record it contained (along with prepending a control message). Also, such mbufs would also need to be "pinned" in some way while they are being decrypted such that a concurrent sbcut() wouldn't free them out from under the thread performing decryption. As such, I settled on the following solution: - Socket buffers now contain an additional chain of mbufs (sb_mtls, sb_mtlstail, and sb_tlscc) containing encrypted mbufs appended by the protocol layer. These mbufs are still marked M_NOTREADY, but soreceive*() generally don't know about them (except that they will block waiting for data to be decrypted for a blocking read). - Each time a new mbuf is appended to this TLS mbuf chain, the socket buffer peeks at the TLS record header at the head of the chain to determine the encrypted record's length. If enough data is queued for the TLS record, the socket is placed on a per-CPU TLS workqueue (reusing the existing KTLS workqueues and worker threads). - The worker thread loops over the TLS mbuf chain decrypting records until it runs out of data. Each record is detached from the TLS mbuf chain while it is being decrypted to keep the mbufs "pinned". However, a new sb_dtlscc field tracks the character count of the detached record and sbcut()/sbdrop() is updated to account for the detached record. After the record is decrypted, the worker thread first checks to see if sbcut() dropped the record. If so, it is freed (can happen when a socket is closed with pending data). Otherwise, the header and trailer are stripped from the original mbufs, a control message is created holding the decrypted TLS header, and the decrypted TLS record is appended to the "normal" socket buffer chain. (Side note: the SBCHECK() infrastucture was very useful as I was able to add assertions there about the TLS chain that caught several bugs during development.) Tested by: rmacklem (various versions) Relnotes: yes Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D24628 Modified: head/share/man/man4/tcp.4 head/sys/kern/uipc_ktls.c head/sys/kern/uipc_sockbuf.c head/sys/kern/uipc_socket.c head/sys/opencrypto/ktls_ocf.c head/sys/sys/ktls.h head/sys/sys/sockbuf.h head/sys/sys/socketvar.h Modified: head/share/man/man4/tcp.4 ============================================================================== --- head/share/man/man4/tcp.4 Thu Jul 23 23:29:50 2020 (r363463) +++ head/share/man/man4/tcp.4 Thu Jul 23 23:48:18 2020 (r363464) @@ -34,7 +34,7 @@ .\" From: @(#)tcp.4 8.1 (Berkeley) 6/5/93 .\" $FreeBSD$ .\" -.Dd April 27, 2020 +.Dd July 23, 2020 .Dt TCP 4 .Os .Sh NAME @@ -356,10 +356,22 @@ control message along with the decrypted payload. The control message contains a .Vt struct tls_get_record which includes fields from the TLS record header. -If a corrupted TLS record is received, +If an invalid or corrupted TLS record is received, recvmsg 2 -will fail with -.Dv EBADMSG . +will fail with one of the following errors: +.Bl -tag -width Er +.It Bq Er EINVAL +The version fields in a TLS record's header did not match the version required +by the +.Vt struct tls_so_enable +structure used to enable in-kernel TLS. +.It Bq Er EMSGSIZE +A TLS record's length was either too small or too large. +.It Bq Er EMSGSIZE +The connection was closed after sending a truncated TLS record. +.It Bq Er EBADMSG +The TLS record failed to match the included authentication tag. +.El .Pp At present, only a single receive key may be set on a socket. As such, users of this option must disable rekeying. Modified: head/sys/kern/uipc_ktls.c ============================================================================== --- head/sys/kern/uipc_ktls.c Thu Jul 23 23:29:50 2020 (r363463) +++ head/sys/kern/uipc_ktls.c Thu Jul 23 23:48:18 2020 (r363464) @@ -78,7 +78,8 @@ __FBSDID("$FreeBSD$"); struct ktls_wq { struct mtx mtx; - STAILQ_HEAD(, mbuf) head; + STAILQ_HEAD(, mbuf) m_head; + STAILQ_HEAD(, socket) so_head; bool running; } __aligned(CACHE_LINE_SIZE); @@ -130,10 +131,16 @@ static counter_u64_t ktls_tasks_active; SYSCTL_COUNTER_U64(_kern_ipc_tls, OID_AUTO, tasks_active, CTLFLAG_RD, &ktls_tasks_active, "Number of active tasks"); -static counter_u64_t ktls_cnt_on; -SYSCTL_COUNTER_U64(_kern_ipc_tls_stats, OID_AUTO, so_inqueue, CTLFLAG_RD, - &ktls_cnt_on, "Number of TLS records in queue to tasks for SW crypto"); +static counter_u64_t ktls_cnt_tx_queued; +SYSCTL_COUNTER_U64(_kern_ipc_tls_stats, OID_AUTO, sw_tx_inqueue, CTLFLAG_RD, + &ktls_cnt_tx_queued, + "Number of TLS records in queue to tasks for SW encryption"); +static counter_u64_t ktls_cnt_rx_queued; +SYSCTL_COUNTER_U64(_kern_ipc_tls_stats, OID_AUTO, sw_rx_inqueue, CTLFLAG_RD, + &ktls_cnt_rx_queued, + "Number of TLS sockets in queue to tasks for SW decryption"); + static counter_u64_t ktls_offload_total; SYSCTL_COUNTER_U64(_kern_ipc_tls_stats, OID_AUTO, offload_total, CTLFLAG_RD, &ktls_offload_total, @@ -148,6 +155,10 @@ static counter_u64_t ktls_offload_active; SYSCTL_COUNTER_U64(_kern_ipc_tls_stats, OID_AUTO, active, CTLFLAG_RD, &ktls_offload_active, "Total Active TLS sessions"); +static counter_u64_t ktls_offload_corrupted_records; +SYSCTL_COUNTER_U64(_kern_ipc_tls_stats, OID_AUTO, corrupted_records, CTLFLAG_RD, + &ktls_offload_corrupted_records, "Total corrupted TLS records received"); + static counter_u64_t ktls_offload_failed_crypto; SYSCTL_COUNTER_U64(_kern_ipc_tls_stats, OID_AUTO, failed_crypto, CTLFLAG_RD, &ktls_offload_failed_crypto, "Total TLS crypto failures"); @@ -333,10 +344,12 @@ ktls_init(void *dummy __unused) int error, i; ktls_tasks_active = counter_u64_alloc(M_WAITOK); - ktls_cnt_on = counter_u64_alloc(M_WAITOK); + ktls_cnt_tx_queued = counter_u64_alloc(M_WAITOK); + ktls_cnt_rx_queued = counter_u64_alloc(M_WAITOK); ktls_offload_total = counter_u64_alloc(M_WAITOK); ktls_offload_enable_calls = counter_u64_alloc(M_WAITOK); ktls_offload_active = counter_u64_alloc(M_WAITOK); + ktls_offload_corrupted_records = counter_u64_alloc(M_WAITOK); ktls_offload_failed_crypto = counter_u64_alloc(M_WAITOK); ktls_switch_to_ifnet = counter_u64_alloc(M_WAITOK); ktls_switch_to_sw = counter_u64_alloc(M_WAITOK); @@ -369,7 +382,8 @@ ktls_init(void *dummy __unused) * work queue for each CPU. */ CPU_FOREACH(i) { - STAILQ_INIT(&ktls_wq[i].head); + STAILQ_INIT(&ktls_wq[i].m_head); + STAILQ_INIT(&ktls_wq[i].so_head); mtx_init(&ktls_wq[i].mtx, "ktls work queue", NULL, MTX_DEF); error = kproc_kthread_add(ktls_work_thread, &ktls_wq[i], &ktls_proc, &td, 0, 0, "KTLS", "thr_%d", i); @@ -855,7 +869,7 @@ ktls_try_ifnet(struct socket *so, struct ktls_session } static int -ktls_try_sw(struct socket *so, struct ktls_session *tls) +ktls_try_sw(struct socket *so, struct ktls_session *tls, int direction) { struct rm_priotracker prio; struct ktls_crypto_backend *be; @@ -870,7 +884,7 @@ ktls_try_sw(struct socket *so, struct ktls_session *tl if (ktls_allow_unload) rm_rlock(&ktls_backends_lock, &prio); LIST_FOREACH(be, &ktls_backends, next) { - if (be->try(so, tls) == 0) + if (be->try(so, tls, direction) == 0) break; KASSERT(tls->cipher == NULL, ("ktls backend leaked a cipher pointer")); @@ -896,6 +910,61 @@ ktls_try_sw(struct socket *so, struct ktls_session *tl return (0); } +/* + * KTLS RX stores data in the socket buffer as a list of TLS records, + * where each record is stored as a control message containg the TLS + * header followed by data mbufs containing the decrypted data. This + * is different from KTLS TX which always uses an mb_ext_pgs mbuf for + * both encrypted and decrypted data. TLS records decrypted by a NIC + * should be queued to the socket buffer as records, but encrypted + * data which needs to be decrypted by software arrives as a stream of + * regular mbufs which need to be converted. In addition, there may + * already be pending encrypted data in the socket buffer when KTLS RX + * is enabled. + * + * To manage not-yet-decrypted data for KTLS RX, the following scheme + * is used: + * + * - A single chain of NOTREADY mbufs is hung off of sb_mtls. + * + * - ktls_check_rx checks this chain of mbufs reading the TLS header + * from the first mbuf. Once all of the data for that TLS record is + * queued, the socket is queued to a worker thread. + * + * - The worker thread calls ktls_decrypt to decrypt TLS records in + * the TLS chain. Each TLS record is detached from the TLS chain, + * decrypted, and inserted into the regular socket buffer chain as + * record starting with a control message holding the TLS header and + * a chain of mbufs holding the encrypted data. + */ + +static void +sb_mark_notready(struct sockbuf *sb) +{ + struct mbuf *m; + + m = sb->sb_mb; + sb->sb_mtls = m; + sb->sb_mb = NULL; + sb->sb_mbtail = NULL; + sb->sb_lastrecord = NULL; + for (; m != NULL; m = m->m_next) { + KASSERT(m->m_nextpkt == NULL, ("%s: m_nextpkt != NULL", + __func__)); + KASSERT((m->m_flags & M_NOTAVAIL) == 0, ("%s: mbuf not avail", + __func__)); + KASSERT(sb->sb_acc >= m->m_len, ("%s: sb_acc < m->m_len", + __func__)); + m->m_flags |= M_NOTREADY; + sb->sb_acc -= m->m_len; + sb->sb_tlscc += m->m_len; + sb->sb_mtlstail = m; + } + KASSERT(sb->sb_acc == 0 && sb->sb_tlscc == sb->sb_ccc, + ("%s: acc %u tlscc %u ccc %u", __func__, sb->sb_acc, sb->sb_tlscc, + sb->sb_ccc)); +} + int ktls_enable_rx(struct socket *so, struct tls_enable *en) { @@ -924,16 +993,20 @@ ktls_enable_rx(struct socket *so, struct tls_enable *e if (en->cipher_algorithm == CRYPTO_AES_CBC && !ktls_cbc_enable) return (ENOTSUP); + /* TLS 1.3 is not yet supported. */ + if (en->tls_vmajor == TLS_MAJOR_VER_ONE && + en->tls_vminor == TLS_MINOR_VER_THREE) + return (ENOTSUP); + error = ktls_create_session(so, en, &tls); if (error) return (error); - /* TLS RX offload is only supported on TOE currently. */ #ifdef TCP_OFFLOAD error = ktls_try_toe(so, tls, KTLS_RX); -#else - error = EOPNOTSUPP; + if (error) #endif + error = ktls_try_sw(so, tls, KTLS_RX); if (error) { ktls_cleanup(tls); @@ -942,7 +1015,13 @@ ktls_enable_rx(struct socket *so, struct tls_enable *e /* Mark the socket as using TLS offload. */ SOCKBUF_LOCK(&so->so_rcv); + so->so_rcv.sb_tls_seqno = be64dec(en->rec_seq); so->so_rcv.sb_tls_info = tls; + so->so_rcv.sb_flags |= SB_TLS_RX; + + /* Mark existing data as not ready until it can be decrypted. */ + sb_mark_notready(&so->so_rcv); + ktls_check_rx(&so->so_rcv); SOCKBUF_UNLOCK(&so->so_rcv); counter_u64_add(ktls_offload_total, 1); @@ -993,7 +1072,7 @@ ktls_enable_tx(struct socket *so, struct tls_enable *e #endif error = ktls_try_ifnet(so, tls, false); if (error) - error = ktls_try_sw(so, tls); + error = ktls_try_sw(so, tls, KTLS_TX); if (error) { ktls_cleanup(tls); @@ -1098,7 +1177,7 @@ ktls_set_tx_mode(struct socket *so, int mode) if (mode == TCP_TLS_MODE_IFNET) error = ktls_try_ifnet(so, tls_new, true); else - error = ktls_try_sw(so, tls_new); + error = ktls_try_sw(so, tls_new, KTLS_TX); if (error) { counter_u64_add(ktls_switch_failed, 1); ktls_free(tls_new); @@ -1422,6 +1501,345 @@ ktls_frame(struct mbuf *top, struct ktls_session *tls, } void +ktls_check_rx(struct sockbuf *sb) +{ + struct tls_record_layer hdr; + struct ktls_wq *wq; + struct socket *so; + bool running; + + SOCKBUF_LOCK_ASSERT(sb); + KASSERT(sb->sb_flags & SB_TLS_RX, ("%s: sockbuf %p isn't TLS RX", + __func__, sb)); + so = __containerof(sb, struct socket, so_rcv); + + if (sb->sb_flags & SB_TLS_RX_RUNNING) + return; + + /* Is there enough queued for a TLS header? */ + if (sb->sb_tlscc < sizeof(hdr)) { + if ((sb->sb_state & SBS_CANTRCVMORE) != 0 && sb->sb_tlscc != 0) + so->so_error = EMSGSIZE; + return; + } + + m_copydata(sb->sb_mtls, 0, sizeof(hdr), (void *)&hdr); + + /* Is the entire record queued? */ + if (sb->sb_tlscc < sizeof(hdr) + ntohs(hdr.tls_length)) { + if ((sb->sb_state & SBS_CANTRCVMORE) != 0) + so->so_error = EMSGSIZE; + return; + } + + sb->sb_flags |= SB_TLS_RX_RUNNING; + + soref(so); + wq = &ktls_wq[so->so_rcv.sb_tls_info->wq_index]; + mtx_lock(&wq->mtx); + STAILQ_INSERT_TAIL(&wq->so_head, so, so_ktls_rx_list); + running = wq->running; + mtx_unlock(&wq->mtx); + if (!running) + wakeup(wq); + counter_u64_add(ktls_cnt_rx_queued, 1); +} + +static struct mbuf * +ktls_detach_record(struct sockbuf *sb, int len) +{ + struct mbuf *m, *n, *top; + int remain; + + SOCKBUF_LOCK_ASSERT(sb); + MPASS(len <= sb->sb_tlscc); + + /* + * If TLS chain is the exact size of the record, + * just grab the whole record. + */ + top = sb->sb_mtls; + if (sb->sb_tlscc == len) { + sb->sb_mtls = NULL; + sb->sb_mtlstail = NULL; + goto out; + } + + /* + * While it would be nice to use m_split() here, we need + * to know exactly what m_split() allocates to update the + * accounting, so do it inline instead. + */ + remain = len; + for (m = top; remain > m->m_len; m = m->m_next) + remain -= m->m_len; + + /* Easy case: don't have to split 'm'. */ + if (remain == m->m_len) { + sb->sb_mtls = m->m_next; + if (sb->sb_mtls == NULL) + sb->sb_mtlstail = NULL; + m->m_next = NULL; + goto out; + } + + /* + * Need to allocate an mbuf to hold the remainder of 'm'. Try + * with M_NOWAIT first. + */ + n = m_get(M_NOWAIT, MT_DATA); + if (n == NULL) { + /* + * Use M_WAITOK with socket buffer unlocked. If + * 'sb_mtls' changes while the lock is dropped, return + * NULL to force the caller to retry. + */ + SOCKBUF_UNLOCK(sb); + + n = m_get(M_WAITOK, MT_DATA); + + SOCKBUF_LOCK(sb); + if (sb->sb_mtls != top) { + m_free(n); + return (NULL); + } + } + n->m_flags |= M_NOTREADY; + + /* Store remainder in 'n'. */ + n->m_len = m->m_len - remain; + if (m->m_flags & M_EXT) { + n->m_data = m->m_data + remain; + mb_dupcl(n, m); + } else { + bcopy(mtod(m, caddr_t) + remain, mtod(n, caddr_t), n->m_len); + } + + /* Trim 'm' and update accounting. */ + m->m_len -= n->m_len; + sb->sb_tlscc -= n->m_len; + sb->sb_ccc -= n->m_len; + + /* Account for 'n'. */ + sballoc_ktls_rx(sb, n); + + /* Insert 'n' into the TLS chain. */ + sb->sb_mtls = n; + n->m_next = m->m_next; + if (sb->sb_mtlstail == m) + sb->sb_mtlstail = n; + + /* Detach the record from the TLS chain. */ + m->m_next = NULL; + +out: + MPASS(m_length(top, NULL) == len); + for (m = top; m != NULL; m = m->m_next) + sbfree_ktls_rx(sb, m); + sb->sb_tlsdcc = len; + sb->sb_ccc += len; + SBCHECK(sb); + return (top); +} + +static int +m_segments(struct mbuf *m, int skip) +{ + int count; + + while (skip >= m->m_len) { + skip -= m->m_len; + m = m->m_next; + } + + for (count = 0; m != NULL; count++) + m = m->m_next; + return (count); +} + +static void +ktls_decrypt(struct socket *so) +{ + char tls_header[MBUF_PEXT_HDR_LEN]; + struct ktls_session *tls; + struct sockbuf *sb; + struct tls_record_layer *hdr; + struct tls_get_record tgr; + struct mbuf *control, *data, *m; + uint64_t seqno; + int error, remain, tls_len, trail_len; + + hdr = (struct tls_record_layer *)tls_header; + sb = &so->so_rcv; + SOCKBUF_LOCK(sb); + KASSERT(sb->sb_flags & SB_TLS_RX_RUNNING, + ("%s: socket %p not running", __func__, so)); + + tls = sb->sb_tls_info; + MPASS(tls != NULL); + + for (;;) { + /* Is there enough queued for a TLS header? */ + if (sb->sb_tlscc < tls->params.tls_hlen) + break; + + m_copydata(sb->sb_mtls, 0, tls->params.tls_hlen, tls_header); + tls_len = sizeof(*hdr) + ntohs(hdr->tls_length); + + if (hdr->tls_vmajor != tls->params.tls_vmajor || + hdr->tls_vminor != tls->params.tls_vminor) + error = EINVAL; + else if (tls_len < tls->params.tls_hlen || tls_len > + tls->params.tls_hlen + TLS_MAX_MSG_SIZE_V10_2 + + tls->params.tls_tlen) + error = EMSGSIZE; + else + error = 0; + if (__predict_false(error != 0)) { + /* + * We have a corrupted record and are likely + * out of sync. The connection isn't + * recoverable at this point, so abort it. + */ + SOCKBUF_UNLOCK(sb); + counter_u64_add(ktls_offload_corrupted_records, 1); + + CURVNET_SET(so->so_vnet); + so->so_proto->pr_usrreqs->pru_abort(so); + so->so_error = error; + CURVNET_RESTORE(); + goto deref; + } + + /* Is the entire record queued? */ + if (sb->sb_tlscc < tls_len) + break; + + /* + * Split out the portion of the mbuf chain containing + * this TLS record. + */ + data = ktls_detach_record(sb, tls_len); + if (data == NULL) + continue; + MPASS(sb->sb_tlsdcc == tls_len); + + seqno = sb->sb_tls_seqno; + sb->sb_tls_seqno++; + SBCHECK(sb); + SOCKBUF_UNLOCK(sb); + + error = tls->sw_decrypt(tls, hdr, data, seqno, &trail_len); + if (error) { + counter_u64_add(ktls_offload_failed_crypto, 1); + + SOCKBUF_LOCK(sb); + if (sb->sb_tlsdcc == 0) { + /* + * sbcut/drop/flush discarded these + * mbufs. + */ + m_freem(data); + break; + } + + /* + * Drop this TLS record's data, but keep + * decrypting subsequent records. + */ + sb->sb_ccc -= tls_len; + sb->sb_tlsdcc = 0; + + CURVNET_SET(so->so_vnet); + so->so_error = EBADMSG; + sorwakeup_locked(so); + CURVNET_RESTORE(); + + m_freem(data); + + SOCKBUF_LOCK(sb); + continue; + } + + /* Allocate the control mbuf. */ + tgr.tls_type = hdr->tls_type; + tgr.tls_vmajor = hdr->tls_vmajor; + tgr.tls_vminor = hdr->tls_vminor; + tgr.tls_length = htobe16(tls_len - tls->params.tls_hlen - + trail_len); + control = sbcreatecontrol_how(&tgr, sizeof(tgr), + TLS_GET_RECORD, IPPROTO_TCP, M_WAITOK); + + SOCKBUF_LOCK(sb); + if (sb->sb_tlsdcc == 0) { + /* sbcut/drop/flush discarded these mbufs. */ + MPASS(sb->sb_tlscc == 0); + m_freem(data); + m_freem(control); + break; + } + + /* + * Clear the 'dcc' accounting in preparation for + * adding the decrypted record. + */ + sb->sb_ccc -= tls_len; + sb->sb_tlsdcc = 0; + SBCHECK(sb); + + /* If there is no payload, drop all of the data. */ + if (tgr.tls_length == htobe16(0)) { + m_freem(data); + data = NULL; + } else { + /* Trim header. */ + remain = tls->params.tls_hlen; + while (remain > 0) { + if (data->m_len > remain) { + data->m_data += remain; + data->m_len -= remain; + break; + } + remain -= data->m_len; + data = m_free(data); + } + + /* Trim trailer and clear M_NOTREADY. */ + remain = be16toh(tgr.tls_length); + m = data; + for (m = data; remain > m->m_len; m = m->m_next) { + m->m_flags &= ~M_NOTREADY; + remain -= m->m_len; + } + m->m_len = remain; + m_freem(m->m_next); + m->m_next = NULL; + m->m_flags &= ~M_NOTREADY; + + /* Set EOR on the final mbuf. */ + m->m_flags |= M_EOR; + } + + sbappendcontrol_locked(sb, data, control, 0); + } + + sb->sb_flags &= ~SB_TLS_RX_RUNNING; + + if ((sb->sb_state & SBS_CANTRCVMORE) != 0 && sb->sb_tlscc > 0) + so->so_error = EMSGSIZE; + + sorwakeup_locked(so); + +deref: + SOCKBUF_UNLOCK_ASSERT(sb); + + CURVNET_SET(so->so_vnet); + SOCK_LOCK(so); + sorele(so); + CURVNET_RESTORE(); +} + +void ktls_enqueue_to_free(struct mbuf *m) { struct ktls_wq *wq; @@ -1431,7 +1849,7 @@ ktls_enqueue_to_free(struct mbuf *m) m->m_epg_flags |= EPG_FLAG_2FREE; wq = &ktls_wq[m->m_epg_tls->wq_index]; mtx_lock(&wq->mtx); - STAILQ_INSERT_TAIL(&wq->head, m, m_epg_stailq); + STAILQ_INSERT_TAIL(&wq->m_head, m, m_epg_stailq); running = wq->running; mtx_unlock(&wq->mtx); if (!running) @@ -1461,12 +1879,12 @@ ktls_enqueue(struct mbuf *m, struct socket *so, int pa wq = &ktls_wq[m->m_epg_tls->wq_index]; mtx_lock(&wq->mtx); - STAILQ_INSERT_TAIL(&wq->head, m, m_epg_stailq); + STAILQ_INSERT_TAIL(&wq->m_head, m, m_epg_stailq); running = wq->running; mtx_unlock(&wq->mtx); if (!running) wakeup(wq); - counter_u64_add(ktls_cnt_on, 1); + counter_u64_add(ktls_cnt_tx_queued, 1); } static __noinline void @@ -1618,31 +2036,41 @@ ktls_work_thread(void *ctx) { struct ktls_wq *wq = ctx; struct mbuf *m, *n; - STAILQ_HEAD(, mbuf) local_head; + struct socket *so, *son; + STAILQ_HEAD(, mbuf) local_m_head; + STAILQ_HEAD(, socket) local_so_head; #if defined(__aarch64__) || defined(__amd64__) || defined(__i386__) fpu_kern_thread(0); #endif for (;;) { mtx_lock(&wq->mtx); - while (STAILQ_EMPTY(&wq->head)) { + while (STAILQ_EMPTY(&wq->m_head) && + STAILQ_EMPTY(&wq->so_head)) { wq->running = false; mtx_sleep(wq, &wq->mtx, 0, "-", 0); wq->running = true; } - STAILQ_INIT(&local_head); - STAILQ_CONCAT(&local_head, &wq->head); + STAILQ_INIT(&local_m_head); + STAILQ_CONCAT(&local_m_head, &wq->m_head); + STAILQ_INIT(&local_so_head); + STAILQ_CONCAT(&local_so_head, &wq->so_head); mtx_unlock(&wq->mtx); - STAILQ_FOREACH_SAFE(m, &local_head, m_epg_stailq, n) { + STAILQ_FOREACH_SAFE(m, &local_m_head, m_epg_stailq, n) { if (m->m_epg_flags & EPG_FLAG_2FREE) { ktls_free(m->m_epg_tls); uma_zfree(zone_mbuf, m); } else { ktls_encrypt(m); - counter_u64_add(ktls_cnt_on, -1); + counter_u64_add(ktls_cnt_tx_queued, -1); } + } + + STAILQ_FOREACH_SAFE(so, &local_so_head, so_ktls_rx_list, son) { + ktls_decrypt(so); + counter_u64_add(ktls_cnt_rx_queued, -1); } } } Modified: head/sys/kern/uipc_sockbuf.c ============================================================================== --- head/sys/kern/uipc_sockbuf.c Thu Jul 23 23:29:50 2020 (r363463) +++ head/sys/kern/uipc_sockbuf.c Thu Jul 23 23:48:18 2020 (r363464) @@ -70,6 +70,8 @@ u_long sb_max_adj = static u_long sb_efficiency = 8; /* parameter for sbreserve() */ +static void sbcompress_ktls_rx(struct sockbuf *sb, struct mbuf *m, + struct mbuf *n); static struct mbuf *sbcut_internal(struct sockbuf *sb, int len); static void sbflush_internal(struct sockbuf *sb); @@ -334,7 +336,52 @@ sbfree(struct sockbuf *sb, struct mbuf *m) sb->sb_sndptroff -= m->m_len; } +#ifdef KERN_TLS /* + * Similar to sballoc/sbfree but does not adjust state associated with + * the sb_mb chain such as sb_fnrdy or sb_sndptr*. Also assumes mbufs + * are not ready. + */ +void +sballoc_ktls_rx(struct sockbuf *sb, struct mbuf *m) +{ + + SOCKBUF_LOCK_ASSERT(sb); + + sb->sb_ccc += m->m_len; + sb->sb_tlscc += m->m_len; + + sb->sb_mbcnt += MSIZE; + sb->sb_mcnt += 1; + + if (m->m_flags & M_EXT) { + sb->sb_mbcnt += m->m_ext.ext_size; + sb->sb_ccnt += 1; + } +} + +void +sbfree_ktls_rx(struct sockbuf *sb, struct mbuf *m) +{ + +#if 0 /* XXX: not yet: soclose() call path comes here w/o lock. */ + SOCKBUF_LOCK_ASSERT(sb); +#endif + + sb->sb_ccc -= m->m_len; + sb->sb_tlscc -= m->m_len; + + sb->sb_mbcnt -= MSIZE; + sb->sb_mcnt -= 1; + + if (m->m_flags & M_EXT) { + sb->sb_mbcnt -= m->m_ext.ext_size; + sb->sb_ccnt -= 1; + } +} +#endif + +/* * Socantsendmore indicates that no more data will be sent on the socket; it * would normally be applied to a socket when the user informs the system * that no more data is to be sent, by the protocol code (in case @@ -370,6 +417,10 @@ socantrcvmore_locked(struct socket *so) SOCKBUF_LOCK_ASSERT(&so->so_rcv); so->so_rcv.sb_state |= SBS_CANTRCVMORE; +#ifdef KERN_TLS + if (so->so_rcv.sb_flags & SB_TLS_RX) + ktls_check_rx(&so->so_rcv); +#endif sorwakeup_locked(so); mtx_assert(SOCKBUF_MTX(&so->so_rcv), MA_NOTOWNED); } @@ -770,6 +821,24 @@ sblastmbufchk(struct sockbuf *sb, const char *file, in } panic("%s from %s:%u", __func__, file, line); } + +#ifdef KERN_TLS + m = sb->sb_mtls; + while (m && m->m_next) + m = m->m_next; + + if (m != sb->sb_mtlstail) { + printf("%s: sb_mtls %p sb_mtlstail %p last %p\n", + __func__, sb->sb_mtls, sb->sb_mtlstail, m); + printf("TLS packet tree:\n"); + printf("\t"); + for (m = sb->sb_mtls; m != NULL; m = m->m_next) { + printf("%p ", m); + } + printf("\n"); + panic("%s from %s:%u", __func__, file, line); + } +#endif } #endif /* SOCKBUF_DEBUG */ @@ -847,7 +916,30 @@ sbappend(struct sockbuf *sb, struct mbuf *m, int flags SOCKBUF_UNLOCK(sb); } +#ifdef KERN_TLS /* + * Append an mbuf containing encrypted TLS data. The data + * is marked M_NOTREADY until it has been decrypted and + * stored as a TLS record. + */ +static void +sbappend_ktls_rx(struct sockbuf *sb, struct mbuf *m) +{ + struct mbuf *n; + + SBLASTMBUFCHK(sb); + + /* Remove all packet headers and mbuf tags to get a pure data chain. */ + m_demote(m, 1, 0); + + for (n = m; n != NULL; n = n->m_next) + n->m_flags |= M_NOTREADY; + sbcompress_ktls_rx(sb, m, sb->sb_mtlstail); + ktls_check_rx(sb); +} +#endif + +/* * This version of sbappend() should only be used when the caller absolutely * knows that there will never be more than one record in the socket buffer, * that is, a stream protocol (such as TCP). @@ -858,6 +950,19 @@ sbappendstream_locked(struct sockbuf *sb, struct mbuf SOCKBUF_LOCK_ASSERT(sb); KASSERT(m->m_nextpkt == NULL,("sbappendstream 0")); + +#ifdef KERN_TLS + /* + * Decrypted TLS records are appended as records via + * sbappendrecord(). TCP passes encrypted TLS records to this + * function which must be scheduled for decryption. + */ + if (sb->sb_flags & SB_TLS_RX) { + sbappend_ktls_rx(sb, m); + return; + } +#endif + KASSERT(sb->sb_mb == sb->sb_lastrecord,("sbappendstream 1")); SBLASTMBUFCHK(sb); @@ -896,6 +1001,9 @@ sbcheck(struct sockbuf *sb, const char *file, int line { struct mbuf *m, *n, *fnrdy; u_long acc, ccc, mbcnt; +#ifdef KERN_TLS + u_long tlscc; +#endif SOCKBUF_LOCK_ASSERT(sb); @@ -931,9 +1039,46 @@ sbcheck(struct sockbuf *sb, const char *file, int line mbcnt += m->m_ext.ext_size; } } +#ifdef KERN_TLS + /* + * Account for mbufs "detached" by ktls_detach_record() while + * they are decrypted by ktls_decrypt(). tlsdcc gives a count + * of the detached bytes that are included in ccc. The mbufs + * and clusters are not included in the socket buffer + * accounting. + */ + ccc += sb->sb_tlsdcc; + + tlscc = 0; + for (m = sb->sb_mtls; m; m = m->m_next) { + if (m->m_nextpkt != NULL) { + printf("sb %p TLS mbuf %p with nextpkt\n", sb, m); + goto fail; + } + if ((m->m_flags & M_NOTREADY) == 0) { + printf("sb %p TLS mbuf %p ready\n", sb, m); + goto fail; + } + tlscc += m->m_len; + ccc += m->m_len; + mbcnt += MSIZE; + if (m->m_flags & M_EXT) /*XXX*/ /* pretty sure this is bogus */ + mbcnt += m->m_ext.ext_size; + } + + if (sb->sb_tlscc != tlscc) { + printf("tlscc %ld/%u dcc %u\n", tlscc, sb->sb_tlscc, + sb->sb_tlsdcc); + goto fail; + } +#endif if (acc != sb->sb_acc || ccc != sb->sb_ccc || mbcnt != sb->sb_mbcnt) { printf("acc %ld/%u ccc %ld/%u mbcnt %ld/%u\n", acc, sb->sb_acc, ccc, sb->sb_ccc, mbcnt, sb->sb_mbcnt); +#ifdef KERN_TLS + printf("tlscc %ld/%u dcc %u\n", tlscc, sb->sb_tlscc, + sb->sb_tlsdcc); +#endif goto fail; } return; @@ -1209,14 +1354,72 @@ sbcompress(struct sockbuf *sb, struct mbuf *m, struct SBLASTMBUFCHK(sb); } +#ifdef KERN_TLS /* + * A version of sbcompress() for encrypted TLS RX mbufs. These mbufs + * are appended to the 'sb_mtls' chain instead of 'sb_mb' and are also + * a bit simpler (no EOR markers, always MT_DATA, etc.). + */ +static void +sbcompress_ktls_rx(struct sockbuf *sb, struct mbuf *m, struct mbuf *n) +{ + + SOCKBUF_LOCK_ASSERT(sb); + + while (m) { + KASSERT((m->m_flags & M_EOR) == 0, + ("TLS RX mbuf %p with EOR", m)); + KASSERT(m->m_type == MT_DATA, + ("TLS RX mbuf %p is not MT_DATA", m)); + KASSERT((m->m_flags & M_NOTREADY) != 0, + ("TLS RX mbuf %p ready", m)); + KASSERT((m->m_flags & M_EXTPG) == 0, + ("TLS RX mbuf %p unmapped", m)); + + if (m->m_len == 0) { + m = m_free(m); + continue; + } + + /* + * Even though both 'n' and 'm' are NOTREADY, it's ok + * to coalesce the data. + */ + if (n && + M_WRITABLE(n) && + ((sb->sb_flags & SB_NOCOALESCE) == 0) && + !(n->m_flags & (M_EXTPG)) && + m->m_len <= MCLBYTES / 4 && /* XXX: Don't copy too much */ + m->m_len <= M_TRAILINGSPACE(n)) { + m_copydata(m, 0, m->m_len, mtodo(n, n->m_len)); + n->m_len += m->m_len; + sb->sb_ccc += m->m_len; + sb->sb_tlscc += m->m_len; + m = m_free(m); + continue; + } + if (n) + n->m_next = m; + else + sb->sb_mtls = m; + sb->sb_mtlstail = m; + sballoc_ktls_rx(sb, m); + n = m; + m = m->m_next; + n->m_next = NULL; + } + SBLASTMBUFCHK(sb); +} +#endif + +/* * Free all mbufs in a sockbuf. Check that all resources are reclaimed. */ static void sbflush_internal(struct sockbuf *sb) { - while (sb->sb_mbcnt) { + while (sb->sb_mbcnt || sb->sb_tlsdcc) { /* * Don't call sbcut(sb, 0) if the leading mbuf is non-empty: * we would loop forever. Panic instead. @@ -1254,6 +1457,7 @@ static struct mbuf * sbcut_internal(struct sockbuf *sb, int len) { struct mbuf *m, *next, *mfree; + bool is_tls; KASSERT(len >= 0, ("%s: len is %d but it is supposed to be >= 0", __func__, len)); @@ -1261,10 +1465,25 @@ sbcut_internal(struct sockbuf *sb, int len) __func__, len, sb->sb_ccc)); next = (m = sb->sb_mb) ? m->m_nextpkt : 0; + is_tls = false; mfree = NULL; while (len > 0) { if (m == NULL) { +#ifdef KERN_TLS + if (next == NULL && !is_tls) { + if (sb->sb_tlsdcc != 0) { + MPASS(len >= sb->sb_tlsdcc); + len -= sb->sb_tlsdcc; + sb->sb_ccc -= sb->sb_tlsdcc; + sb->sb_tlsdcc = 0; + if (len == 0) + break; + } + next = sb->sb_mtls; + is_tls = true; + } +#endif KASSERT(next, ("%s: no next, len %d", __func__, len)); m = next; next = m->m_nextpkt; @@ -1283,12 +1502,17 @@ sbcut_internal(struct sockbuf *sb, int len) break; } len -= m->m_len; - sbfree(sb, m); +#ifdef KERN_TLS + if (is_tls) + sbfree_ktls_rx(sb, m); + else +#endif + sbfree(sb, m); /* * Do not put M_NOTREADY buffers to the free list, they * are referenced from outside. */ - if (m->m_flags & M_NOTREADY) + if (m->m_flags & M_NOTREADY && !is_tls) m = m->m_next; else { struct mbuf *n; @@ -1314,6 +1538,14 @@ sbcut_internal(struct sockbuf *sb, int len) mfree = m; m = n; } +#ifdef KERN_TLS + if (is_tls) { *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Fri Jul 24 00:02:14 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 34928368171; Fri, 24 Jul 2020 00:02:14 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BCTsL0SKQz4L7j; Fri, 24 Jul 2020 00:02:14 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro-274.local (unknown [IPv6:2601:648:8203:2990:19cd:9bb8:2b2d:bc7e]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id 7692D1F6FC; Fri, 24 Jul 2020 00:02:13 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Subject: Re: svn commit: r363188 - in head: lib/libpmc sys/dev/hwpmc To: Alexander Motin , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <202007141811.06EIB6b3008168@repo.freebsd.org> <70e7319b-93d6-a9d2-cf70-73a6a26616a5@FreeBSD.org> From: John Baldwin Autocrypt: addr=jhb@FreeBSD.org; keydata= mQGiBETQ+XcRBADMFybiq69u+fJRy/0wzqTNS8jFfWaBTs5/OfcV7wWezVmf9sgwn8TW0Dk0 c9MBl0pz+H01dA2ZSGZ5fXlmFIsee1WEzqeJzpiwd/pejPgSzXB9ijbLHZ2/E0jhGBcVy5Yo /Tw5+U/+laeYKu2xb0XPvM0zMNls1ah5OnP9a6Ql6wCgupaoMySb7DXm2LHD1Z9jTsHcAQMD /1jzh2BoHriy/Q2s4KzzjVp/mQO5DSm2z14BvbQRcXU48oAosHA1u3Wrov6LfPY+0U1tG47X 1BGfnQH+rNAaH0livoSBQ0IPI/8WfIW7ub4qV6HYwWKVqkDkqwcpmGNDbz3gfaDht6nsie5Z pcuCcul4M9CW7Md6zzyvktjnbz61BADGDCopfZC4of0Z3Ka0u8Wik6UJOuqShBt1WcFS8ya1 oB4rc4tXfSHyMF63aPUBMxHR5DXeH+EO2edoSwViDMqWk1jTnYza51rbGY+pebLQOVOxAY7k do5Ordl3wklBPMVEPWoZ61SdbcjhHVwaC5zfiskcxj5wwXd2E9qYlBqRg7QeSm9obiBCYWxk d2luIDxqaGJARnJlZUJTRC5vcmc+iGAEExECACAFAkTQ+awCGwMGCwkIBwMCBBUCCAMEFgID AQIeAQIXgAAKCRBy3lIGd+N/BI6RAJ9S97fvbME+3hxzE3JUyUZ6vTewDACdE1stFuSfqMvM jomvZdYxIYyTUpC5Ag0ERND5ghAIAPwsO0B7BL+bz8sLlLoQktGxXwXQfS5cInvL17Dsgnr3 1AKa94j9EnXQyPEj7u0d+LmEe6CGEGDh1OcGFTMVrof2ZzkSy4+FkZwMKJpTiqeaShMh+Goj XlwIMDxyADYvBIg3eN5YdFKaPQpfgSqhT+7El7w+wSZZD8pPQuLAnie5iz9C8iKy4/cMSOrH YUK/tO+Nhw8Jjlw94Ik0T80iEhI2t+XBVjwdfjbq3HrJ0ehqdBwukyeJRYKmbn298KOFQVHO EVbHA4rF/37jzaMadK43FgJ0SAhPPF5l4l89z5oPu0b/+5e2inA3b8J3iGZxywjM+Csq1tqz hltEc7Q+E08AAwUIAL+15XH8bPbjNJdVyg2CMl10JNW2wWg2Q6qdljeaRqeR6zFus7EZTwtX sNzs5bP8y51PSUDJbeiy2RNCNKWFMndM22TZnk3GNG45nQd4OwYK0RZVrikalmJY5Q6m7Z16 4yrZgIXFdKj2t8F+x613/SJW1lIr9/bDp4U9tw0V1g3l2dFtD3p3ZrQ3hpoDtoK70ioIAjjH aIXIAcm3FGZFXy503DOA0KaTWwvOVdYCFLm3zWuSOmrX/GsEc7ovasOWwjPn878qVjbUKWwx Q4QkF4OhUV9zPtf9tDSAZ3x7QSwoKbCoRCZ/xbyTUPyQ1VvNy/mYrBcYlzHodsaqUDjHuW+I SQQYEQIACQUCRND5ggIbDAAKCRBy3lIGd+N/BCO8AJ9j1dWVQWxw/YdTbEyrRKOY8YZNwwCf afMAg8QvmOWnHx3wl8WslCaXaE8= Message-ID: Date: Thu, 23 Jul 2020 17:02:12 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:68.0) Gecko/20100101 Thunderbird/68.6.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Jul 2020 00:02:14 -0000 On 7/23/20 4:44 PM, Alexander Motin wrote: > On 23.07.2020 19:15, John Baldwin wrote: >> On 7/14/20 11:11 AM, Alexander Motin wrote: >>> Author: mav >>> Date: Tue Jul 14 18:11:05 2020 >>> New Revision: 363188 >>> URL: https://svnweb.freebsd.org/changeset/base/363188 >>> >>> Log: >>> Add stepping to the kern.hwpmc.cpuid string on x86. >>> >>> It follows the equivalent Linux change to be able to differentiate >>> skylakex and cascadelakex, sharing the same model but not stepping. >>> >>> This fixes skylakex handling broken by r363144. >> >> Unfortunately this breaks compatibility meaning you can't use an older >> libpmc with a newer kernel module after this change. Perhaps we don't >> consider libpmc stable, but this was really annoying as I booted a test >> kernel today on an older Haswell box whose world is from before this >> change and pmc doesn't work at all. (pmccontrol -L doesn't list any >> valid counters as the older libpmc presumably chokes on the additional >> suffix and doesn't match anything) > > Unfortunately so. I've added other way compatibility, but can't change > the past. Do you think it is critical enough to add more compat shims, > like extra sysctls? I don't see a viable way to do it non-terribly. Assuming you've already MFC'd this it might warrant a line in the release notes for 12.2. -- John Baldwin From owner-svn-src-all@freebsd.org Fri Jul 24 00:22:35 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7200E3682E9; Fri, 24 Jul 2020 00:22:35 +0000 (UTC) (envelope-from gshapiro@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BCVJq1h0Vz4LxT; Fri, 24 Jul 2020 00:22:35 +0000 (UTC) (envelope-from gshapiro@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 02D0321A18; Fri, 24 Jul 2020 00:22:35 +0000 (UTC) (envelope-from gshapiro@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06O0MYjR088663; Fri, 24 Jul 2020 00:22:34 GMT (envelope-from gshapiro@FreeBSD.org) Received: (from gshapiro@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06O0MYSv088657; Fri, 24 Jul 2020 00:22:34 GMT (envelope-from gshapiro@FreeBSD.org) Message-Id: <202007240022.06O0MYSv088657@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gshapiro set sender to gshapiro@FreeBSD.org using -f From: Gregory Neil Shapiro Date: Fri, 24 Jul 2020 00:22:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r363465 - in stable/12: contrib/sendmail contrib/sendmail/cf contrib/sendmail/cf/cf contrib/sendmail/cf/feature contrib/sendmail/cf/m4 contrib/sendmail/cf/ostype contrib/sendmail/contri... X-SVN-Group: stable-12 X-SVN-Commit-Author: gshapiro X-SVN-Commit-Paths: in stable/12: contrib/sendmail contrib/sendmail/cf contrib/sendmail/cf/cf contrib/sendmail/cf/feature contrib/sendmail/cf/m4 contrib/sendmail/cf/ostype contrib/sendmail/contrib contrib/sendmail/doc/op... X-SVN-Commit-Revision: 363465 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 24 Jul 2020 00:22:35 -0000 Author: gshapiro Date: Fri Jul 24 00:22:33 2020 New Revision: 363465 URL: https://svnweb.freebsd.org/changeset/base/363465 Log: MFC: Merge sendmail 8.16.1 to HEAD: See contrib/sendmail/RELEASE_NOTES for details Includes build infrastructure & config updates required for changes in 8.16.1 Added: stable/12/contrib/sendmail/cf/feature/blocklist_recipients.m4 - copied unchanged from r363233, head/contrib/sendmail/cf/feature/blocklist_recipients.m4 stable/12/contrib/sendmail/cf/feature/check_cert_altnames.m4 - copied unchanged from r363233, head/contrib/sendmail/cf/feature/check_cert_altnames.m4 stable/12/contrib/sendmail/cf/feature/tls_failures.m4 - copied unchanged from r363233, head/contrib/sendmail/cf/feature/tls_failures.m4 stable/12/contrib/sendmail/include/sm/notify.h - copied unchanged from r363233, head/contrib/sendmail/include/sm/notify.h stable/12/contrib/sendmail/libsm/notify.c - copied unchanged from r363233, head/contrib/sendmail/libsm/notify.c stable/12/contrib/sendmail/libsm/t-notify.c - copied unchanged from r363233, head/contrib/sendmail/libsm/t-notify.c stable/12/contrib/sendmail/libsmdb/smcdb.c - copied unchanged from r363233, head/contrib/sendmail/libsmdb/smcdb.c stable/12/contrib/sendmail/src/ratectrl.h - copied unchanged from r363233, head/contrib/sendmail/src/ratectrl.h stable/12/contrib/sendmail/src/tls.h - copied unchanged from r363233, head/contrib/sendmail/src/tls.h stable/12/contrib/sendmail/src/tlsh.c - copied unchanged from r363233, head/contrib/sendmail/src/tlsh.c Modified: stable/12/contrib/sendmail/CACerts stable/12/contrib/sendmail/FREEBSD-upgrade stable/12/contrib/sendmail/KNOWNBUGS stable/12/contrib/sendmail/LICENSE stable/12/contrib/sendmail/PGPKEYS stable/12/contrib/sendmail/README stable/12/contrib/sendmail/RELEASE_NOTES stable/12/contrib/sendmail/cf/README stable/12/contrib/sendmail/cf/cf/Makefile stable/12/contrib/sendmail/cf/cf/knecht.mc stable/12/contrib/sendmail/cf/cf/submit.cf stable/12/contrib/sendmail/cf/feature/bcc.m4 stable/12/contrib/sendmail/cf/feature/blacklist_recipients.m4 stable/12/contrib/sendmail/cf/feature/dnsbl.m4 stable/12/contrib/sendmail/cf/feature/enhdnsbl.m4 stable/12/contrib/sendmail/cf/m4/cfhead.m4 stable/12/contrib/sendmail/cf/m4/proto.m4 stable/12/contrib/sendmail/cf/m4/version.m4 stable/12/contrib/sendmail/cf/ostype/hpux10.m4 stable/12/contrib/sendmail/cf/ostype/hpux9.m4 stable/12/contrib/sendmail/contrib/cidrexpand stable/12/contrib/sendmail/contrib/dnsblaccess.m4 stable/12/contrib/sendmail/contrib/expn.pl stable/12/contrib/sendmail/contrib/mmuegel stable/12/contrib/sendmail/doc/op/op.me stable/12/contrib/sendmail/editmap/Makefile stable/12/contrib/sendmail/editmap/editmap.c stable/12/contrib/sendmail/include/libmilter/mfapi.h stable/12/contrib/sendmail/include/libmilter/mfdef.h stable/12/contrib/sendmail/include/libsmdb/smdb.h stable/12/contrib/sendmail/include/sendmail/pathnames.h stable/12/contrib/sendmail/include/sendmail/sendmail.h stable/12/contrib/sendmail/include/sm/assert.h stable/12/contrib/sendmail/include/sm/bdb.h stable/12/contrib/sendmail/include/sm/cdefs.h stable/12/contrib/sendmail/include/sm/clock.h stable/12/contrib/sendmail/include/sm/conf.h stable/12/contrib/sendmail/include/sm/config.h stable/12/contrib/sendmail/include/sm/debug.h stable/12/contrib/sendmail/include/sm/errstring.h stable/12/contrib/sendmail/include/sm/gen.h stable/12/contrib/sendmail/include/sm/heap.h stable/12/contrib/sendmail/include/sm/io.h stable/12/contrib/sendmail/include/sm/ldap.h stable/12/contrib/sendmail/include/sm/limits.h stable/12/contrib/sendmail/include/sm/os/sm_os_freebsd.h stable/12/contrib/sendmail/include/sm/rpool.h stable/12/contrib/sendmail/include/sm/sem.h stable/12/contrib/sendmail/include/sm/shm.h stable/12/contrib/sendmail/include/sm/string.h stable/12/contrib/sendmail/include/sm/test.h stable/12/contrib/sendmail/include/sm/types.h stable/12/contrib/sendmail/include/sm/varargs.h stable/12/contrib/sendmail/include/sm/xtrap.h stable/12/contrib/sendmail/libmilter/Makefile stable/12/contrib/sendmail/libmilter/README stable/12/contrib/sendmail/libmilter/comm.c stable/12/contrib/sendmail/libmilter/docs/api.html stable/12/contrib/sendmail/libmilter/docs/design.html stable/12/contrib/sendmail/libmilter/docs/index.html stable/12/contrib/sendmail/libmilter/docs/installation.html stable/12/contrib/sendmail/libmilter/docs/overview.html stable/12/contrib/sendmail/libmilter/docs/sample.html stable/12/contrib/sendmail/libmilter/docs/smfi_addheader.html stable/12/contrib/sendmail/libmilter/docs/smfi_addrcpt.html stable/12/contrib/sendmail/libmilter/docs/smfi_addrcpt_par.html stable/12/contrib/sendmail/libmilter/docs/smfi_chgfrom.html stable/12/contrib/sendmail/libmilter/docs/smfi_chgheader.html stable/12/contrib/sendmail/libmilter/docs/smfi_delrcpt.html stable/12/contrib/sendmail/libmilter/docs/smfi_getpriv.html stable/12/contrib/sendmail/libmilter/docs/smfi_getsymval.html stable/12/contrib/sendmail/libmilter/docs/smfi_insheader.html stable/12/contrib/sendmail/libmilter/docs/smfi_main.html stable/12/contrib/sendmail/libmilter/docs/smfi_opensocket.html stable/12/contrib/sendmail/libmilter/docs/smfi_progress.html stable/12/contrib/sendmail/libmilter/docs/smfi_quarantine.html stable/12/contrib/sendmail/libmilter/docs/smfi_register.html stable/12/contrib/sendmail/libmilter/docs/smfi_replacebody.html stable/12/contrib/sendmail/libmilter/docs/smfi_setbacklog.html stable/12/contrib/sendmail/libmilter/docs/smfi_setconn.html stable/12/contrib/sendmail/libmilter/docs/smfi_setdbg.html stable/12/contrib/sendmail/libmilter/docs/smfi_setmlreply.html stable/12/contrib/sendmail/libmilter/docs/smfi_setpriv.html stable/12/contrib/sendmail/libmilter/docs/smfi_setreply.html stable/12/contrib/sendmail/libmilter/docs/smfi_setsymlist.html stable/12/contrib/sendmail/libmilter/docs/smfi_settimeout.html stable/12/contrib/sendmail/libmilter/docs/smfi_stop.html stable/12/contrib/sendmail/libmilter/docs/smfi_version.html stable/12/contrib/sendmail/libmilter/docs/xxfi_abort.html stable/12/contrib/sendmail/libmilter/docs/xxfi_body.html stable/12/contrib/sendmail/libmilter/docs/xxfi_close.html stable/12/contrib/sendmail/libmilter/docs/xxfi_connect.html stable/12/contrib/sendmail/libmilter/docs/xxfi_data.html stable/12/contrib/sendmail/libmilter/docs/xxfi_envfrom.html stable/12/contrib/sendmail/libmilter/docs/xxfi_envrcpt.html stable/12/contrib/sendmail/libmilter/docs/xxfi_eoh.html stable/12/contrib/sendmail/libmilter/docs/xxfi_eom.html stable/12/contrib/sendmail/libmilter/docs/xxfi_header.html stable/12/contrib/sendmail/libmilter/docs/xxfi_helo.html stable/12/contrib/sendmail/libmilter/docs/xxfi_negotiate.html stable/12/contrib/sendmail/libmilter/docs/xxfi_unknown.html stable/12/contrib/sendmail/libmilter/engine.c stable/12/contrib/sendmail/libmilter/example.c stable/12/contrib/sendmail/libmilter/handler.c stable/12/contrib/sendmail/libmilter/libmilter.h stable/12/contrib/sendmail/libmilter/listener.c stable/12/contrib/sendmail/libmilter/main.c stable/12/contrib/sendmail/libmilter/monitor.c stable/12/contrib/sendmail/libmilter/sm_gethost.c stable/12/contrib/sendmail/libmilter/smfi.c stable/12/contrib/sendmail/libmilter/worker.c stable/12/contrib/sendmail/libsm/Makefile stable/12/contrib/sendmail/libsm/Makefile.m4 stable/12/contrib/sendmail/libsm/assert.c stable/12/contrib/sendmail/libsm/clock.c stable/12/contrib/sendmail/libsm/config.c stable/12/contrib/sendmail/libsm/debug.c stable/12/contrib/sendmail/libsm/errstring.c stable/12/contrib/sendmail/libsm/exc.c stable/12/contrib/sendmail/libsm/findfp.c stable/12/contrib/sendmail/libsm/flags.c stable/12/contrib/sendmail/libsm/fopen.c stable/12/contrib/sendmail/libsm/fpos.c stable/12/contrib/sendmail/libsm/fscanf.c stable/12/contrib/sendmail/libsm/io.html stable/12/contrib/sendmail/libsm/ldap.c stable/12/contrib/sendmail/libsm/local.h stable/12/contrib/sendmail/libsm/makebuf.c stable/12/contrib/sendmail/libsm/mbdb.c stable/12/contrib/sendmail/libsm/memstat.c stable/12/contrib/sendmail/libsm/niprop.c stable/12/contrib/sendmail/libsm/refill.c stable/12/contrib/sendmail/libsm/rewind.c stable/12/contrib/sendmail/libsm/rpool.c stable/12/contrib/sendmail/libsm/sem.c stable/12/contrib/sendmail/libsm/signal.c stable/12/contrib/sendmail/libsm/stdio.c stable/12/contrib/sendmail/libsm/strdup.c stable/12/contrib/sendmail/libsm/strerror.c stable/12/contrib/sendmail/libsm/string.c stable/12/contrib/sendmail/libsm/strio.c stable/12/contrib/sendmail/libsm/strto.c stable/12/contrib/sendmail/libsm/syslogio.c stable/12/contrib/sendmail/libsm/t-event.c stable/12/contrib/sendmail/libsm/t-exc.c stable/12/contrib/sendmail/libsm/t-heap.c stable/12/contrib/sendmail/libsm/t-scanf.c stable/12/contrib/sendmail/libsm/t-sem.c stable/12/contrib/sendmail/libsm/vfprintf.c stable/12/contrib/sendmail/libsm/vfscanf.c stable/12/contrib/sendmail/libsmdb/Makefile stable/12/contrib/sendmail/libsmdb/Makefile.m4 stable/12/contrib/sendmail/libsmdb/smdb.c stable/12/contrib/sendmail/libsmdb/smdb1.c stable/12/contrib/sendmail/libsmdb/smdb2.c stable/12/contrib/sendmail/libsmdb/smndbm.c stable/12/contrib/sendmail/libsmutil/Makefile stable/12/contrib/sendmail/libsmutil/cf.c stable/12/contrib/sendmail/libsmutil/safefile.c stable/12/contrib/sendmail/mail.local/Makefile stable/12/contrib/sendmail/mail.local/mail.local.c stable/12/contrib/sendmail/mailstats/Makefile stable/12/contrib/sendmail/mailstats/mailstats.c stable/12/contrib/sendmail/makemap/Makefile stable/12/contrib/sendmail/makemap/Makefile.m4 stable/12/contrib/sendmail/makemap/makemap.8 stable/12/contrib/sendmail/makemap/makemap.c stable/12/contrib/sendmail/praliases/Makefile stable/12/contrib/sendmail/praliases/praliases.c stable/12/contrib/sendmail/rmail/Makefile stable/12/contrib/sendmail/rmail/rmail.c stable/12/contrib/sendmail/smrsh/Makefile stable/12/contrib/sendmail/smrsh/smrsh.c stable/12/contrib/sendmail/src/Makefile stable/12/contrib/sendmail/src/Makefile.m4 stable/12/contrib/sendmail/src/README stable/12/contrib/sendmail/src/TRACEFLAGS stable/12/contrib/sendmail/src/alias.c stable/12/contrib/sendmail/src/arpadate.c stable/12/contrib/sendmail/src/bf.c stable/12/contrib/sendmail/src/collect.c stable/12/contrib/sendmail/src/conf.c stable/12/contrib/sendmail/src/conf.h stable/12/contrib/sendmail/src/control.c stable/12/contrib/sendmail/src/daemon.c stable/12/contrib/sendmail/src/daemon.h stable/12/contrib/sendmail/src/deliver.c stable/12/contrib/sendmail/src/domain.c stable/12/contrib/sendmail/src/envelope.c stable/12/contrib/sendmail/src/err.c stable/12/contrib/sendmail/src/headers.c stable/12/contrib/sendmail/src/macro.c stable/12/contrib/sendmail/src/main.c stable/12/contrib/sendmail/src/map.c stable/12/contrib/sendmail/src/map.h stable/12/contrib/sendmail/src/mci.c stable/12/contrib/sendmail/src/milter.c stable/12/contrib/sendmail/src/mime.c stable/12/contrib/sendmail/src/parseaddr.c stable/12/contrib/sendmail/src/queue.c stable/12/contrib/sendmail/src/ratectrl.c stable/12/contrib/sendmail/src/readcf.c stable/12/contrib/sendmail/src/recipient.c stable/12/contrib/sendmail/src/sasl.c stable/12/contrib/sendmail/src/savemail.c stable/12/contrib/sendmail/src/sendmail.h stable/12/contrib/sendmail/src/sfsasl.c stable/12/contrib/sendmail/src/sfsasl.h stable/12/contrib/sendmail/src/sm_resolve.c stable/12/contrib/sendmail/src/sm_resolve.h stable/12/contrib/sendmail/src/srvrsmtp.c stable/12/contrib/sendmail/src/stab.c stable/12/contrib/sendmail/src/timers.c stable/12/contrib/sendmail/src/tls.c stable/12/contrib/sendmail/src/udb.c stable/12/contrib/sendmail/src/usersmtp.c stable/12/contrib/sendmail/src/util.c stable/12/contrib/sendmail/src/version.c stable/12/contrib/sendmail/test/Results stable/12/contrib/sendmail/vacation/Makefile stable/12/contrib/sendmail/vacation/vacation.c stable/12/etc/sendmail/freebsd.mc stable/12/etc/sendmail/freebsd.submit.mc stable/12/lib/libsm/Makefile stable/12/lib/libsmdb/Makefile stable/12/usr.sbin/sendmail/Makefile Directory Properties: stable/12/ (props changed) Modified: stable/12/contrib/sendmail/CACerts ============================================================================== --- stable/12/contrib/sendmail/CACerts Thu Jul 23 23:48:18 2020 (r363464) +++ stable/12/contrib/sendmail/CACerts Fri Jul 24 00:22:33 2020 (r363465) @@ -1,4 +1,3 @@ -# $Id: CACerts,v 8.6 2013-01-18 15:14:17 ca Exp $ # This file contains some CA certificates that are used to sign the # certificates of mail servers of members of the sendmail consortium # who may reply to questions etc sent to sendmail.org. @@ -10,189 +9,92 @@ Certificate: Data: Version: 3 (0x2) Serial Number: - 92:91:67:de:e0:ef:2c:e4 + 81:9d:41:0f:40:55:ac:4a Signature Algorithm: sha1WithRSAEncryption - Issuer: C=US, ST=California, L=Berkeley, O=Endmail Org, OU=MTA, CN=Claus Assmann CA RSA 2015/emailAddress=ca+ca-rsa2015@esmtp.org + Issuer: C=US, ST=California, L=Berkeley, O=Endmail Org, OU=MTA, CN=CA/emailAddress=ca+ca-rsa2018@esmtp.org Validity - Not Before: Mar 2 19:15:29 2015 GMT - Not After : Mar 1 19:15:29 2018 GMT - Subject: C=US, ST=California, L=Berkeley, O=Endmail Org, OU=MTA, CN=Claus Assmann CA RSA 2015/emailAddress=ca+ca-rsa2015@esmtp.org + Not Before: Feb 27 02:30:55 2018 GMT + Not After : Feb 26 02:30:55 2021 GMT + Subject: C=US, ST=California, L=Berkeley, O=Endmail Org, OU=MTA, CN=CA/emailAddress=ca+ca-rsa2018@esmtp.org Subject Public Key Info: Public Key Algorithm: rsaEncryption Public-Key: (2048 bit) Modulus: - 00:b9:1a:a1:56:ce:cb:16:af:4f:96:ba:2a:70:31: - 70:d3:86:6c:7a:46:26:47:42:3f:de:49:57:3e:08: - 1e:10:25:bf:06:8f:ca:fd:f4:5e:6a:01:7d:31:4d: - 50:88:18:43:71:66:65:42:9c:90:97:0d:95:f2:14: - ef:d7:5e:77:ef:7d:b5:49:3f:02:bb:83:20:f7:e6: - fc:9a:cd:13:df:60:41:28:8e:39:07:a6:a4:40:98: - 15:1e:46:b6:04:2e:f9:ab:32:d1:8b:fe:52:81:f1: - d2:e1:c3:cf:bf:ab:40:a7:f0:e4:e5:a2:82:37:30: - 8c:10:7d:aa:a8:7c:7e:76:cc:5f:1a:24:d0:8c:94: - f6:f2:7f:4a:be:2f:38:67:c0:06:e6:9e:51:ad:55: - d0:cb:26:71:cf:f4:af:7d:5a:41:81:16:fb:26:ec: - f0:35:01:6e:db:f9:e9:00:d7:d0:89:7b:cf:88:16: - 8b:1c:8f:77:1f:5d:ef:70:04:28:76:c5:1b:c6:23: - 8d:49:6b:f0:b8:21:56:d6:7d:68:6c:be:21:e3:e6: - e3:1d:6f:a5:ea:dc:83:e4:27:b3:6f:5f:1b:3d:33: - a1:d5:d3:f0:73:1a:12:eb:d9:95:00:71:59:16:b4: - e4:60:38:b2:2e:7f:b7:d4:c5:e9:3f:74:e4:48:38: - 29:89 + 00:b8:a3:8d:79:28:c1:1f:9c:11:74:43:26:e1:3b: + cc:14:87:5b:6b:64:4c:ed:79:1b:7f:2a:03:d0:7b: + ef:9e:88:b0:64:36:ee:58:ef:fd:d9:c7:20:b3:71: + e9:6d:1e:a7:bc:c1:7c:3b:fe:2a:e4:16:2f:bc:d6: + 2c:f5:98:f9:c4:21:1c:ca:c3:7e:57:89:c8:a9:2f: + da:6b:9b:52:d6:c9:9d:98:97:6d:08:7c:a6:37:4e: + d4:26:bb:db:73:b0:38:ef:7d:1e:dd:8e:dd:8e:17: + 2f:a0:3d:a9:0e:4d:f0:2b:b8:14:23:33:ad:c8:a0: + e5:9d:0f:27:ad:83:a2:78:90:05:ec:29:06:91:07: + 45:6c:5f:ba:8e:1d:f1:d7:1b:2d:f9:99:ba:2e:27: + e1:03:7d:e9:d2:54:35:cc:39:79:07:83:d8:93:9b: + d6:ef:72:ab:d4:63:8e:6b:f7:00:66:5f:77:e8:b6: + bc:de:5f:8c:d0:ce:1a:c4:db:03:9d:e4:ee:0a:ec: + 77:c5:f2:30:69:7e:70:12:e5:c2:4a:28:3f:e7:19: + eb:af:41:fb:e6:a6:1d:b5:fd:2b:99:03:f5:20:90: + 38:73:bd:43:70:da:cf:1f:34:5d:ab:17:4b:73:cf: + f9:3d:e1:a2:79:14:de:d8:40:85:82:c4:5a:84:82: + 32:f1 Exponent: 65537 (0x10001) X509v3 extensions: X509v3 Subject Key Identifier: - B1:69:DB:5E:9B:CE:1A:B4:1D:B2:6A:FC:5A:22:97:B6:24:14:6F:32 + 42:37:75:E7:8F:12:CF:D9:EB:21:22:7D:8A:E8:49:21:FD:E2:3A:3A X509v3 Authority Key Identifier: - keyid:B1:69:DB:5E:9B:CE:1A:B4:1D:B2:6A:FC:5A:22:97:B6:24:14:6F:32 - DirName:/C=US/ST=California/L=Berkeley/O=Endmail Org/OU=MTA/CN=Claus Assmann CA RSA 2015/emailAddress=ca+ca-rsa2015@esmtp.org - serial:92:91:67:DE:E0:EF:2C:E4 - + keyid:42:37:75:E7:8F:12:CF:D9:EB:21:22:7D:8A:E8:49:21:FD:E2:3A:3A + DirName:/C=US/ST=California/L=Berkeley/O=Endmail Org/OU=MTA/CN=CA/emailAddress=ca+ca-rsa2018@esmtp.org + serial:81:9D:41:0F:40:55:AC:4A X509v3 Basic Constraints: CA:TRUE X509v3 Subject Alternative Name: - email:ca+ca-rsa2015@esmtp.org + email:ca+ca-rsa2018@esmtp.org X509v3 Issuer Alternative Name: - email:ca+ca-rsa2015@esmtp.org + email:ca+ca-rsa2018@esmtp.org Signature Algorithm: sha1WithRSAEncryption - 0a:ce:07:39:77:08:c5:3a:00:04:e8:a0:3b:f7:d2:4c:79:02: - 23:0b:da:c0:55:39:82:71:0a:0c:83:e2:de:f2:3b:fe:23:bc: - 9b:13:34:d1:29:0a:16:3f:01:7d:9f:fb:4b:aa:12:dc:3b:7e: - b9:27:7b:ec:0c:3f:c0:d9:f5:d8:a8:a1:9c:1c:3a:2f:40:df: - 27:1a:1a:a0:74:00:19:b7:82:0e:f9:45:86:bf:32:da:0e:72: - 0a:4c:2c:39:21:63:c3:1f:61:6e:e2:4d:ba:7a:26:1a:15:ce: - b1:f6:1a:59:04:70:ed:e8:72:05:4c:fc:84:c6:a5:f4:e2:4a: - 40:e4:42:70:87:9a:a7:02:26:3a:47:34:09:e0:7b:88:ca:fb: - 99:d9:9b:bb:0c:52:8a:93:d5:59:30:0b:55:42:b4:bb:d2:b1: - 49:55:81:a4:70:a0:49:19:f2:4f:61:94:af:e9:d7:62:68:65: - 97:67:00:26:b8:9b:b2:2c:d0:2c:83:7d:3e:b3:31:73:b9:55: - 49:53:fa:a3:ad:1b:02:67:08:9e:ce:9e:eb:9f:47:0d:6c:95: - e9:6c:30:92:c1:94:67:ad:d9:e3:b9:61:ea:a9:72:98:81:3a: - 62:80:70:20:9a:3e:c4:1f:6f:bd:b4:00:ec:b1:fe:71:da:91: - 15:89:f7:8f ------BEGIN CERTIFICATE----- -MIIFJzCCBA+gAwIBAgIJAJKRZ97g7yzkMA0GCSqGSIb3DQEBBQUAMIGlMQswCQYD -VQQGEwJVUzETMBEGA1UECAwKQ2FsaWZvcm5pYTERMA8GA1UEBwwIQmVya2VsZXkx -FDASBgNVBAoMC0VuZG1haWwgT3JnMQwwCgYDVQQLDANNVEExIjAgBgNVBAMMGUNs -YXVzIEFzc21hbm4gQ0EgUlNBIDIwMTUxJjAkBgkqhkiG9w0BCQEWF2NhK2NhLXJz -YTIwMTVAZXNtdHAub3JnMB4XDTE1MDMwMjE5MTUyOVoXDTE4MDMwMTE5MTUyOVow -gaUxCzAJBgNVBAYTAlVTMRMwEQYDVQQIDApDYWxpZm9ybmlhMREwDwYDVQQHDAhC -ZXJrZWxleTEUMBIGA1UECgwLRW5kbWFpbCBPcmcxDDAKBgNVBAsMA01UQTEiMCAG -A1UEAwwZQ2xhdXMgQXNzbWFubiBDQSBSU0EgMjAxNTEmMCQGCSqGSIb3DQEJARYX -Y2ErY2EtcnNhMjAxNUBlc210cC5vcmcwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAw -ggEKAoIBAQC5GqFWzssWr0+WuipwMXDThmx6RiZHQj/eSVc+CB4QJb8Gj8r99F5q -AX0xTVCIGENxZmVCnJCXDZXyFO/XXnfvfbVJPwK7gyD35vyazRPfYEEojjkHpqRA -mBUeRrYELvmrMtGL/lKB8dLhw8+/q0Cn8OTlooI3MIwQfaqofH52zF8aJNCMlPby -f0q+LzhnwAbmnlGtVdDLJnHP9K99WkGBFvsm7PA1AW7b+ekA19CJe8+IFoscj3cf -Xe9wBCh2xRvGI41Ja/C4IVbWfWhsviHj5uMdb6Xq3IPkJ7NvXxs9M6HV0/BzGhLr -2ZUAcVkWtORgOLIuf7fUxek/dORIOCmJAgMBAAGjggFWMIIBUjAdBgNVHQ4EFgQU -sWnbXpvOGrQdsmr8WiKXtiQUbzIwgdoGA1UdIwSB0jCBz4AUsWnbXpvOGrQdsmr8 -WiKXtiQUbzKhgaukgagwgaUxCzAJBgNVBAYTAlVTMRMwEQYDVQQIDApDYWxpZm9y -bmlhMREwDwYDVQQHDAhCZXJrZWxleTEUMBIGA1UECgwLRW5kbWFpbCBPcmcxDDAK -BgNVBAsMA01UQTEiMCAGA1UEAwwZQ2xhdXMgQXNzbWFubiBDQSBSU0EgMjAxNTEm -MCQGCSqGSIb3DQEJARYXY2ErY2EtcnNhMjAxNUBlc210cC5vcmeCCQCSkWfe4O8s -5DAMBgNVHRMEBTADAQH/MCIGA1UdEQQbMBmBF2NhK2NhLXJzYTIwMTVAZXNtdHAu -b3JnMCIGA1UdEgQbMBmBF2NhK2NhLXJzYTIwMTVAZXNtdHAub3JnMA0GCSqGSIb3 -DQEBBQUAA4IBAQAKzgc5dwjFOgAE6KA799JMeQIjC9rAVTmCcQoMg+Le8jv+I7yb -EzTRKQoWPwF9n/tLqhLcO365J3vsDD/A2fXYqKGcHDovQN8nGhqgdAAZt4IO+UWG -vzLaDnIKTCw5IWPDH2Fu4k26eiYaFc6x9hpZBHDt6HIFTPyExqX04kpA5EJwh5qn -AiY6RzQJ4HuIyvuZ2Zu7DFKKk9VZMAtVQrS70rFJVYGkcKBJGfJPYZSv6ddiaGWX -ZwAmuJuyLNAsg30+szFzuVVJU/qjrRsCZwiezp7rn0cNbJXpbDCSwZRnrdnjuWHq -qXKYgTpigHAgmj7EH2+9tADssf5x2pEVifeP ------END CERTIFICATE----- + 0b:4c:e5:c2:ed:0a:e5:7b:95:29:22:d4:8f:5f:cb:1b:b1:e3: + 4c:fc:90:e7:2e:97:87:87:a2:63:0d:6d:4d:f0:1f:0d:84:11: + dc:df:b7:fa:c3:c6:2e:07:e9:a0:e9:a6:9f:54:17:ad:1a:d0: + 36:be:31:cc:a5:85:a0:45:4a:87:45:80:7e:de:ea:97:68:e0: + 2b:09:5d:9a:31:6f:f5:78:22:c5:66:2a:99:70:9e:6d:c4:ab: + f6:90:01:70:53:07:66:6c:a6:b5:ce:4b:36:05:83:87:0c:a7: + e0:1e:34:d0:5e:76:a4:20:71:cd:9d:c1:ae:82:27:e0:6f:16: + 57:74:e7:63:9f:d0:3d:72:91:6d:97:a4:82:23:84:dd:6e:0d: + da:43:00:a7:ce:2f:f8:79:04:67:6a:e5:b0:ab:30:d8:f1:90: + 10:43:3b:09:77:27:34:a4:d4:c0:25:4e:21:32:a3:ab:60:1c: + 9d:6e:e2:65:39:51:7f:cd:9f:88:3a:7e:f4:38:af:7b:5b:a7: + bb:7b:70:97:21:59:fc:5c:55:a1:db:74:0a:37:1e:33:97:5f: + 70:32:98:b3:d9:99:4e:08:3c:de:01:82:17:9b:49:d7:fa:c9: + 45:8d:93:cc:42:d6:36:f2:39:3a:47:28:3f:6f:6a:e5:23:f3: + 5c:d4:a3:1b - -Certificate: - Data: - Version: 3 (0x2) - Serial Number: - f1:41:b3:3d:ba:bd:33:49 - Signature Algorithm: sha1WithRSAEncryption - Issuer: C=US, ST=California, L=Berkeley, O=Endmail Org, OU=MTA, CN=Claus Assmann CA RSA 2012/emailAddress=ca+ca-rsa2012@esmtp.org - Validity - Not Before: Mar 10 02:47:46 2012 GMT - Not After : Mar 10 02:47:46 2015 GMT - Subject: C=US, ST=California, L=Berkeley, O=Endmail Org, OU=MTA, CN=Claus Assmann CA RSA 2012/emailAddress=ca+ca-rsa2012@esmtp.org - Subject Public Key Info: - Public Key Algorithm: rsaEncryption - Public-Key: (2048 bit) - Modulus: - 00:a2:80:fc:c6:ce:7f:60:38:65:f4:38:f9:7a:d9: - 87:fd:47:eb:3f:2c:4a:c9:38:77:6a:77:94:92:7f: - 83:3d:99:57:2c:5f:37:bb:ba:12:10:17:56:fa:eb: - 43:a6:4b:4c:1e:30:32:07:94:2f:5a:d8:65:49:29: - fa:24:d1:f0:0b:45:2d:e5:d5:cb:7d:60:dc:a6:ce: - a4:47:35:30:ee:5e:8d:c2:30:e7:a7:63:32:b0:59: - 80:cc:8c:99:64:77:8f:50:8e:88:51:47:36:ea:9a: - f3:b4:c0:8c:a6:ab:c6:42:57:88:b9:5f:9f:61:15: - bb:79:65:93:ca:a9:fd:17:eb:87:26:8b:eb:b7:2b: - 7e:33:05:2b:ba:c0:46:f7:08:fd:da:c1:50:9b:3d: - 26:83:5c:53:97:89:2c:cc:5f:f2:7b:a8:b7:3d:fb: - f2:b4:89:0d:43:ef:18:5c:21:75:71:cc:f0:c2:a3: - 84:69:c0:a7:f3:9b:de:c1:c7:5a:5c:7e:68:da:49: - 71:af:58:a8:51:9f:bd:f9:3d:bb:a5:92:fa:7b:1d: - 52:f5:fe:90:59:95:27:65:a4:af:97:9a:4f:01:39: - 59:7d:08:6f:a1:8f:42:47:49:bf:12:52:53:39:74: - 8d:62:3b:bd:4c:4f:05:0f:c4:b9:3e:da:a8:0e:96: - 05:2d - Exponent: 65537 (0x10001) - X509v3 extensions: - X509v3 Subject Key Identifier: - 08:38:E3:88:92:53:6E:F1:56:69:27:44:B5:4C:A0:18:CA:06:97:EB - X509v3 Authority Key Identifier: - keyid:08:38:E3:88:92:53:6E:F1:56:69:27:44:B5:4C:A0:18:CA:06:97:EB - DirName:/C=US/ST=California/L=Berkeley/O=Endmail Org/OU=MTA/CN=Claus Assmann CA RSA 2012/emailAddress=ca+ca-rsa2012@esmtp.org - serial:F1:41:B3:3D:BA:BD:33:49 - - X509v3 Basic Constraints: - CA:TRUE - X509v3 Subject Alternative Name: - email:ca+ca-rsa2012@esmtp.org - X509v3 Issuer Alternative Name: - email:ca+ca-rsa2012@esmtp.org - Signature Algorithm: sha1WithRSAEncryption - 9a:8f:4d:23:5b:30:80:e1:94:e4:66:9c:3a:17:8b:79:49:5b: - ec:5d:e5:a1:22:2d:71:37:a1:51:e7:1d:b1:0d:a9:9b:aa:a9: - 0d:c7:cd:d6:24:f9:e0:f0:57:be:4f:74:0c:4b:7a:42:4c:70: - 19:2e:8e:eb:cb:1b:00:26:27:eb:1c:42:33:d5:ec:32:b4:6c: - 7d:a3:04:a1:5c:00:49:c9:0d:4c:4d:28:37:06:22:77:ec:40: - 15:25:3a:23:84:ae:1f:da:90:dd:c9:dc:27:ee:7c:ec:e5:df: - b8:ba:1e:3f:ee:c2:91:a2:3f:22:92:1e:f3:06:7e:aa:e9:c3: - 11:2d:3d:2f:85:f7:fc:d7:e2:f8:6d:70:a6:40:62:69:e7:52: - ed:1b:19:38:72:86:08:a1:3d:47:c8:68:82:41:db:db:2a:52: - 25:d7:49:aa:9e:c5:83:22:7d:2f:0b:df:8c:90:2d:b5:aa:33: - c7:9b:e8:39:8f:bb:79:5b:13:2d:4e:a9:69:59:c7:09:26:e2: - b5:53:80:86:72:bb:7c:be:e9:46:5b:d8:b2:78:42:d6:5d:c3: - bb:3a:3b:5f:0f:e8:c3:60:fb:88:9f:3a:2b:9f:d3:7d:9f:c7: - 32:aa:4d:34:a7:66:a1:25:16:95:a6:69:e7:86:a3:5c:b9:b9: - df:58:05:e3 -----BEGIN CERTIFICATE----- -MIIFJzCCBA+gAwIBAgIJAPFBsz26vTNJMA0GCSqGSIb3DQEBBQUAMIGlMQswCQYD -VQQGEwJVUzETMBEGA1UECBMKQ2FsaWZvcm5pYTERMA8GA1UEBxMIQmVya2VsZXkx -FDASBgNVBAoTC0VuZG1haWwgT3JnMQwwCgYDVQQLEwNNVEExIjAgBgNVBAMTGUNs -YXVzIEFzc21hbm4gQ0EgUlNBIDIwMTIxJjAkBgkqhkiG9w0BCQEWF2NhK2NhLXJz -YTIwMTJAZXNtdHAub3JnMB4XDTEyMDMxMDAyNDc0NloXDTE1MDMxMDAyNDc0Nlow -gaUxCzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpDYWxpZm9ybmlhMREwDwYDVQQHEwhC -ZXJrZWxleTEUMBIGA1UEChMLRW5kbWFpbCBPcmcxDDAKBgNVBAsTA01UQTEiMCAG -A1UEAxMZQ2xhdXMgQXNzbWFubiBDQSBSU0EgMjAxMjEmMCQGCSqGSIb3DQEJARYX -Y2ErY2EtcnNhMjAxMkBlc210cC5vcmcwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAw -ggEKAoIBAQCigPzGzn9gOGX0OPl62Yf9R+s/LErJOHdqd5SSf4M9mVcsXze7uhIQ -F1b660OmS0weMDIHlC9a2GVJKfok0fALRS3l1ct9YNymzqRHNTDuXo3CMOenYzKw -WYDMjJlkd49QjohRRzbqmvO0wIymq8ZCV4i5X59hFbt5ZZPKqf0X64cmi+u3K34z -BSu6wEb3CP3awVCbPSaDXFOXiSzMX/J7qLc9+/K0iQ1D7xhcIXVxzPDCo4RpwKfz -m97Bx1pcfmjaSXGvWKhRn735Pbulkvp7HVL1/pBZlSdlpK+Xmk8BOVl9CG+hj0JH -Sb8SUlM5dI1iO71MTwUPxLk+2qgOlgUtAgMBAAGjggFWMIIBUjAdBgNVHQ4EFgQU -CDjjiJJTbvFWaSdEtUygGMoGl+swgdoGA1UdIwSB0jCBz4AUCDjjiJJTbvFWaSdE -tUygGMoGl+uhgaukgagwgaUxCzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpDYWxpZm9y -bmlhMREwDwYDVQQHEwhCZXJrZWxleTEUMBIGA1UEChMLRW5kbWFpbCBPcmcxDDAK -BgNVBAsTA01UQTEiMCAGA1UEAxMZQ2xhdXMgQXNzbWFubiBDQSBSU0EgMjAxMjEm -MCQGCSqGSIb3DQEJARYXY2ErY2EtcnNhMjAxMkBlc210cC5vcmeCCQDxQbM9ur0z -STAMBgNVHRMEBTADAQH/MCIGA1UdEQQbMBmBF2NhK2NhLXJzYTIwMTJAZXNtdHAu -b3JnMCIGA1UdEgQbMBmBF2NhK2NhLXJzYTIwMTJAZXNtdHAub3JnMA0GCSqGSIb3 -DQEBBQUAA4IBAQCaj00jWzCA4ZTkZpw6F4t5SVvsXeWhIi1xN6FR5x2xDambqqkN -x83WJPng8Fe+T3QMS3pCTHAZLo7ryxsAJifrHEIz1ewytGx9owShXABJyQ1MTSg3 -BiJ37EAVJTojhK4f2pDdydwn7nzs5d+4uh4/7sKRoj8ikh7zBn6q6cMRLT0vhff8 -1+L4bXCmQGJp51LtGxk4coYIoT1HyGiCQdvbKlIl10mqnsWDIn0vC9+MkC21qjPH -m+g5j7t5WxMtTqlpWccJJuK1U4CGcrt8vulGW9iyeELWXcO7OjtfD+jDYPuInzor -n9N9n8cyqk00p2ahJRaVpmnnhqNcubnfWAXj +MIIE4jCCA8qgAwIBAgIJAIGdQQ9AVaxKMA0GCSqGSIb3DQEBBQUAMIGOMQswCQYD +VQQGEwJVUzETMBEGA1UECAwKQ2FsaWZvcm5pYTERMA8GA1UEBwwIQmVya2VsZXkx +FDASBgNVBAoMC0VuZG1haWwgT3JnMQwwCgYDVQQLDANNVEExCzAJBgNVBAMMAkNB +MSYwJAYJKoZIhvcNAQkBFhdjYStjYS1yc2EyMDE4QGVzbXRwLm9yZzAeFw0xODAy +MjcwMjMwNTVaFw0yMTAyMjYwMjMwNTVaMIGOMQswCQYDVQQGEwJVUzETMBEGA1UE +CAwKQ2FsaWZvcm5pYTERMA8GA1UEBwwIQmVya2VsZXkxFDASBgNVBAoMC0VuZG1h +aWwgT3JnMQwwCgYDVQQLDANNVEExCzAJBgNVBAMMAkNBMSYwJAYJKoZIhvcNAQkB +FhdjYStjYS1yc2EyMDE4QGVzbXRwLm9yZzCCASIwDQYJKoZIhvcNAQEBBQADggEP +ADCCAQoCggEBALijjXkowR+cEXRDJuE7zBSHW2tkTO15G38qA9B7756IsGQ27ljv +/dnHILNx6W0ep7zBfDv+KuQWL7zWLPWY+cQhHMrDfleJyKkv2mubUtbJnZiXbQh8 +pjdO1Ca723OwOO99Ht2O3Y4XL6A9qQ5N8Cu4FCMzrcig5Z0PJ62DoniQBewpBpEH +RWxfuo4d8dcbLfmZui4n4QN96dJUNcw5eQeD2JOb1u9yq9Rjjmv3AGZfd+i2vN5f +jNDOGsTbA53k7grsd8XyMGl+cBLlwkooP+cZ669B++amHbX9K5kD9SCQOHO9Q3Da +zx80XasXS3PP+T3honkU3thAhYLEWoSCMvECAwEAAaOCAT8wggE7MB0GA1UdDgQW +BBRCN3XnjxLP2eshIn2K6Ekh/eI6OjCBwwYDVR0jBIG7MIG4gBRCN3XnjxLP2esh +In2K6Ekh/eI6OqGBlKSBkTCBjjELMAkGA1UEBhMCVVMxEzARBgNVBAgMCkNhbGlm +b3JuaWExETAPBgNVBAcMCEJlcmtlbGV5MRQwEgYDVQQKDAtFbmRtYWlsIE9yZzEM +MAoGA1UECwwDTVRBMQswCQYDVQQDDAJDQTEmMCQGCSqGSIb3DQEJARYXY2ErY2Et +cnNhMjAxOEBlc210cC5vcmeCCQCBnUEPQFWsSjAMBgNVHRMEBTADAQH/MCIGA1Ud +EQQbMBmBF2NhK2NhLXJzYTIwMThAZXNtdHAub3JnMCIGA1UdEgQbMBmBF2NhK2Nh +LXJzYTIwMThAZXNtdHAub3JnMA0GCSqGSIb3DQEBBQUAA4IBAQALTOXC7Qrle5Up +ItSPX8sbseNM/JDnLpeHh6JjDW1N8B8NhBHc37f6w8YuB+mg6aafVBetGtA2vjHM +pYWgRUqHRYB+3uqXaOArCV2aMW/1eCLFZiqZcJ5txKv2kAFwUwdmbKa1zks2BYOH +DKfgHjTQXnakIHHNncGugifgbxZXdOdjn9A9cpFtl6SCI4Tdbg3aQwCnzi/4eQRn +auWwqzDY8ZAQQzsJdyc0pNTAJU4hMqOrYBydbuJlOVF/zZ+IOn70OK97W6e7e3CX +IVn8XFWh23QKNx4zl19wMpiz2ZlOCDzeAYIXm0nX+slFjZPMQtY28jk6Ryg/b2rl +I/Nc1KMb -----END CERTIFICATE----- Modified: stable/12/contrib/sendmail/FREEBSD-upgrade ============================================================================== --- stable/12/contrib/sendmail/FREEBSD-upgrade Thu Jul 23 23:48:18 2020 (r363464) +++ stable/12/contrib/sendmail/FREEBSD-upgrade Fri Jul 24 00:22:33 2020 (r363465) @@ -1,6 +1,6 @@ $FreeBSD$ -sendmail 8.15.2 +sendmail 8.16.1 originals can be found at: ftp://ftp.sendmail.org/pub/sendmail/ For the import of sendmail, the following directories were renamed: @@ -13,12 +13,16 @@ http://www.freebsd.org/doc/en_US.ISO8859-1/articles/co Then merged using: -% set FSVN=svn+ssh://svn.freebsd.org/base +% set FSVN=svn+ssh://repo.freebsd.org/base % svn checkout $FSVN/head/contrib/sendmail head % cd head -% svn merge --accept=postpone $FSVN/vendor/sendmail/dist . -% svn rm --force */Build [e-v]*/*.0 cf/cf/generic-*.cf cf/cf/Build -% svn rm --force Build devtools doc/op/op.ps src/makesendmail src/sysexits.h +### Replace XXXXXX with import revision number in next command: +% svn merge -c rXXXXXX --accept=postpone '^/vendor/sendmail/dist' . +% svn resolve --accept working cf/cf/Build \ + cf/cf/generic-{bsd4.4,hpux{9,10},linux,mpeix,nextstep3.3,osf1,solaris,sunos4.1,ultrix4}.cf \ + devtools doc/op/op.ps editmap/editmap.0 mail.local/mail.local.0 mailstats/mailstats.0 \ + makemap/makemap.0 praliases/praliases.0 rmail/rmail.0 smrsh/smrsh.0 \ + src/{aliases,mailq,newaliases,sendmail}.0 vacation/vacation.0 % svn propset -R svn:keywords FreeBSD=%H . % svn propdel svn:keywords libmilter/docs/*.jpg % svn diff --no-diff-deleted --old=$FSVN/vendor/sendmail/dist --new=. @@ -98,4 +102,4 @@ infrastructure in FreeBSD: usr.sbin/mailwrapper/Makefile gshapiro@FreeBSD.org -06-July-2015 +23-July-2020 Modified: stable/12/contrib/sendmail/KNOWNBUGS ============================================================================== --- stable/12/contrib/sendmail/KNOWNBUGS Thu Jul 23 23:48:18 2020 (r363464) +++ stable/12/contrib/sendmail/KNOWNBUGS Fri Jul 24 00:22:33 2020 (r363465) @@ -271,4 +271,3 @@ Kresolve sequence dnsmx canon be used if set instead of LOCAL_RELAY ($R). This will be fixed in a future version. -$Revision: 8.61 $, Last updated $Date: 2011-04-07 17:48:23 $ Modified: stable/12/contrib/sendmail/LICENSE ============================================================================== --- stable/12/contrib/sendmail/LICENSE Thu Jul 23 23:48:18 2020 (r363464) +++ stable/12/contrib/sendmail/LICENSE Fri Jul 24 00:22:33 2020 (r363465) @@ -37,7 +37,7 @@ each of the following conditions is met: the "Copyright Notice" refers to the following language: "Copyright (c) 1998-2014 Proofpoint, Inc. All rights reserved." -3. Neither the name of Proofpoint, Inc. nor the University of California nor +4. Neither the name of Proofpoint, Inc. nor the University of California nor names of their contributors may be used to endorse or promote products derived from this software without specific prior written permission. The name "sendmail" is a trademark of Proofpoint, Inc. Modified: stable/12/contrib/sendmail/PGPKEYS ============================================================================== --- stable/12/contrib/sendmail/PGPKEYS Thu Jul 23 23:48:18 2020 (r363464) +++ stable/12/contrib/sendmail/PGPKEYS Fri Jul 24 00:22:33 2020 (r363465) @@ -8,140 +8,1092 @@ GPG: gpg --import PGPKEYS Other versions of PGP may require you to separate each key into a separate file and add them one at a time. -Type Bits KeyID Created Expires Algorithm Use -pub 1024 0x16F4CCE9 1999-06-23 ---------- RSA Sign & Encrypt -f16 Fingerprint16 = 18 A4 51 78 CA 72 D4 A7 ED 80 BA 8A C4 98 71 1D -uid Sendmail Security +Note that PGP 2.X and 5.X are deprecated and may not properly +function with newer keys. +pub 4096R/CA28E5A4 2016-03-04 +fingerprint: 8E6A 5575 0635 A7EA F56C FE80 3D67 CBA7 CA28 E5A4 +uid Sendmail Security + -----BEGIN PGP PUBLIC KEY BLOCK----- -Version: GnuPG v1.2.4 (Darwin) +Version: GnuPG v1 -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 -gpExpdV7qPrw9k01j5rod5PjZlG8zV0= -=SR28 +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 +9T92qg== +=xY3m -----END PGP PUBLIC KEY BLOCK----- +pub rsa4096/0xD583210EF51471A7 2020-04-08 [SC] + Key fingerprint = ADFD B709 FE1E A682 E585 5971 D583 210E F514 71A7 +uid [ full ] Sendmail Signing Key/2020 +sub rsa4096/0x5C092A1B257B1C27 2020-04-08 [E] + +-----BEGIN PGP PUBLIC KEY BLOCK----- + +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 +4XUsDQOZ8aKrTpMO+Q== +=jgHV +-----END PGP PUBLIC KEY BLOCK----- + + +pub rsa4096/0x09E01FA03C0C504E 2019-01-09 [SC] + Key fingerprint = 50A3 0309 8EA2 DD7B CBEE 2ADA 09E0 1FA0 3C0C 504E +uid Sendmail Signing Key/2019 +sub rsa4096/0xEF9F24EFDC48FA66 2019-01-09 [E] + +-----BEGIN PGP PUBLIC KEY BLOCK----- + +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 *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Fri Jul 24 00:23:28 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 73962368745; Fri, 24 Jul 2020 00:23:28 +0000 (UTC) (envelope-from gshapiro@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BCVKr1w3nz4MJV; Fri, 24 Jul 2020 00:23:28 +0000 (UTC) (envelope-from gshapiro@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 24BA9219C9; Fri, 24 Jul 2020 00:23:28 +0000 (UTC) (envelope-from gshapiro@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06O0NSBo088747; Fri, 24 Jul 2020 00:23:28 GMT (envelope-from gshapiro@FreeBSD.org) Received: (from gshapiro@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06O0NRnI088742; Fri, 24 Jul 2020 00:23:27 GMT (envelope-from gshapiro@FreeBSD.org) Message-Id: <202007240023.06O0NRnI088742@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gshapiro set sender to gshapiro@FreeBSD.org using -f From: Gregory Neil Shapiro Date: Fri, 24 Jul 2020 00:23: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: r363466 - in stable/11: contrib/sendmail contrib/sendmail/cf contrib/sendmail/cf/cf contrib/sendmail/cf/feature contrib/sendmail/cf/m4 contrib/sendmail/cf/ostype contrib/sendmail/contri... X-SVN-Group: stable-11 X-SVN-Commit-Author: gshapiro X-SVN-Commit-Paths: in stable/11: contrib/sendmail contrib/sendmail/cf contrib/sendmail/cf/cf contrib/sendmail/cf/feature contrib/sendmail/cf/m4 contrib/sendmail/cf/ostype contrib/sendmail/contrib contrib/sendmail/doc/op... X-SVN-Commit-Revision: 363466 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 24 Jul 2020 00:23:28 -0000 Author: gshapiro Date: Fri Jul 24 00:23:26 2020 New Revision: 363466 URL: https://svnweb.freebsd.org/changeset/base/363466 Log: MFC: Merge sendmail 8.16.1 from HEAD: See contrib/sendmail/RELEASE_NOTES for details Includes build infrastructure & config updates required for changes in 8.16.1 Added: stable/11/contrib/sendmail/cf/feature/blocklist_recipients.m4 - copied unchanged from r363233, head/contrib/sendmail/cf/feature/blocklist_recipients.m4 stable/11/contrib/sendmail/cf/feature/check_cert_altnames.m4 - copied unchanged from r363233, head/contrib/sendmail/cf/feature/check_cert_altnames.m4 stable/11/contrib/sendmail/cf/feature/tls_failures.m4 - copied unchanged from r363233, head/contrib/sendmail/cf/feature/tls_failures.m4 stable/11/contrib/sendmail/include/sm/notify.h - copied unchanged from r363233, head/contrib/sendmail/include/sm/notify.h stable/11/contrib/sendmail/libsm/notify.c - copied unchanged from r363233, head/contrib/sendmail/libsm/notify.c stable/11/contrib/sendmail/libsm/t-notify.c - copied unchanged from r363233, head/contrib/sendmail/libsm/t-notify.c stable/11/contrib/sendmail/libsmdb/smcdb.c - copied unchanged from r363233, head/contrib/sendmail/libsmdb/smcdb.c stable/11/contrib/sendmail/src/ratectrl.h - copied unchanged from r363233, head/contrib/sendmail/src/ratectrl.h stable/11/contrib/sendmail/src/tls.h - copied unchanged from r363233, head/contrib/sendmail/src/tls.h stable/11/contrib/sendmail/src/tlsh.c - copied unchanged from r363233, head/contrib/sendmail/src/tlsh.c Modified: stable/11/contrib/sendmail/CACerts stable/11/contrib/sendmail/FREEBSD-upgrade stable/11/contrib/sendmail/KNOWNBUGS stable/11/contrib/sendmail/PGPKEYS stable/11/contrib/sendmail/README stable/11/contrib/sendmail/RELEASE_NOTES stable/11/contrib/sendmail/cf/README stable/11/contrib/sendmail/cf/cf/Makefile stable/11/contrib/sendmail/cf/cf/knecht.mc stable/11/contrib/sendmail/cf/cf/submit.cf stable/11/contrib/sendmail/cf/feature/bcc.m4 stable/11/contrib/sendmail/cf/feature/blacklist_recipients.m4 stable/11/contrib/sendmail/cf/feature/dnsbl.m4 stable/11/contrib/sendmail/cf/feature/enhdnsbl.m4 stable/11/contrib/sendmail/cf/m4/cfhead.m4 stable/11/contrib/sendmail/cf/m4/proto.m4 stable/11/contrib/sendmail/cf/m4/version.m4 stable/11/contrib/sendmail/cf/ostype/hpux10.m4 stable/11/contrib/sendmail/cf/ostype/hpux9.m4 stable/11/contrib/sendmail/contrib/cidrexpand stable/11/contrib/sendmail/contrib/dnsblaccess.m4 stable/11/contrib/sendmail/contrib/expn.pl stable/11/contrib/sendmail/contrib/mmuegel stable/11/contrib/sendmail/doc/op/op.me stable/11/contrib/sendmail/editmap/Makefile stable/11/contrib/sendmail/editmap/editmap.c stable/11/contrib/sendmail/include/libmilter/mfapi.h stable/11/contrib/sendmail/include/libmilter/mfdef.h stable/11/contrib/sendmail/include/libsmdb/smdb.h stable/11/contrib/sendmail/include/sendmail/pathnames.h stable/11/contrib/sendmail/include/sendmail/sendmail.h stable/11/contrib/sendmail/include/sm/assert.h stable/11/contrib/sendmail/include/sm/bdb.h stable/11/contrib/sendmail/include/sm/cdefs.h stable/11/contrib/sendmail/include/sm/clock.h stable/11/contrib/sendmail/include/sm/conf.h stable/11/contrib/sendmail/include/sm/config.h stable/11/contrib/sendmail/include/sm/debug.h stable/11/contrib/sendmail/include/sm/errstring.h stable/11/contrib/sendmail/include/sm/gen.h stable/11/contrib/sendmail/include/sm/heap.h stable/11/contrib/sendmail/include/sm/io.h stable/11/contrib/sendmail/include/sm/ldap.h stable/11/contrib/sendmail/include/sm/limits.h stable/11/contrib/sendmail/include/sm/os/sm_os_freebsd.h stable/11/contrib/sendmail/include/sm/rpool.h stable/11/contrib/sendmail/include/sm/sem.h stable/11/contrib/sendmail/include/sm/shm.h stable/11/contrib/sendmail/include/sm/string.h stable/11/contrib/sendmail/include/sm/test.h stable/11/contrib/sendmail/include/sm/types.h stable/11/contrib/sendmail/include/sm/varargs.h stable/11/contrib/sendmail/include/sm/xtrap.h stable/11/contrib/sendmail/libmilter/Makefile stable/11/contrib/sendmail/libmilter/README stable/11/contrib/sendmail/libmilter/comm.c stable/11/contrib/sendmail/libmilter/docs/api.html stable/11/contrib/sendmail/libmilter/docs/design.html stable/11/contrib/sendmail/libmilter/docs/index.html stable/11/contrib/sendmail/libmilter/docs/installation.html stable/11/contrib/sendmail/libmilter/docs/overview.html stable/11/contrib/sendmail/libmilter/docs/sample.html stable/11/contrib/sendmail/libmilter/docs/smfi_addheader.html stable/11/contrib/sendmail/libmilter/docs/smfi_addrcpt.html stable/11/contrib/sendmail/libmilter/docs/smfi_addrcpt_par.html stable/11/contrib/sendmail/libmilter/docs/smfi_chgfrom.html stable/11/contrib/sendmail/libmilter/docs/smfi_chgheader.html stable/11/contrib/sendmail/libmilter/docs/smfi_delrcpt.html stable/11/contrib/sendmail/libmilter/docs/smfi_getpriv.html stable/11/contrib/sendmail/libmilter/docs/smfi_getsymval.html stable/11/contrib/sendmail/libmilter/docs/smfi_insheader.html stable/11/contrib/sendmail/libmilter/docs/smfi_main.html stable/11/contrib/sendmail/libmilter/docs/smfi_opensocket.html stable/11/contrib/sendmail/libmilter/docs/smfi_progress.html stable/11/contrib/sendmail/libmilter/docs/smfi_quarantine.html stable/11/contrib/sendmail/libmilter/docs/smfi_register.html stable/11/contrib/sendmail/libmilter/docs/smfi_replacebody.html stable/11/contrib/sendmail/libmilter/docs/smfi_setbacklog.html stable/11/contrib/sendmail/libmilter/docs/smfi_setconn.html stable/11/contrib/sendmail/libmilter/docs/smfi_setdbg.html stable/11/contrib/sendmail/libmilter/docs/smfi_setmlreply.html stable/11/contrib/sendmail/libmilter/docs/smfi_setpriv.html stable/11/contrib/sendmail/libmilter/docs/smfi_setreply.html stable/11/contrib/sendmail/libmilter/docs/smfi_setsymlist.html stable/11/contrib/sendmail/libmilter/docs/smfi_settimeout.html stable/11/contrib/sendmail/libmilter/docs/smfi_stop.html stable/11/contrib/sendmail/libmilter/docs/smfi_version.html stable/11/contrib/sendmail/libmilter/docs/xxfi_abort.html stable/11/contrib/sendmail/libmilter/docs/xxfi_body.html stable/11/contrib/sendmail/libmilter/docs/xxfi_close.html stable/11/contrib/sendmail/libmilter/docs/xxfi_connect.html stable/11/contrib/sendmail/libmilter/docs/xxfi_data.html stable/11/contrib/sendmail/libmilter/docs/xxfi_envfrom.html stable/11/contrib/sendmail/libmilter/docs/xxfi_envrcpt.html stable/11/contrib/sendmail/libmilter/docs/xxfi_eoh.html stable/11/contrib/sendmail/libmilter/docs/xxfi_eom.html stable/11/contrib/sendmail/libmilter/docs/xxfi_header.html stable/11/contrib/sendmail/libmilter/docs/xxfi_helo.html stable/11/contrib/sendmail/libmilter/docs/xxfi_negotiate.html stable/11/contrib/sendmail/libmilter/docs/xxfi_unknown.html stable/11/contrib/sendmail/libmilter/engine.c stable/11/contrib/sendmail/libmilter/example.c stable/11/contrib/sendmail/libmilter/handler.c stable/11/contrib/sendmail/libmilter/libmilter.h stable/11/contrib/sendmail/libmilter/listener.c stable/11/contrib/sendmail/libmilter/main.c stable/11/contrib/sendmail/libmilter/monitor.c stable/11/contrib/sendmail/libmilter/sm_gethost.c stable/11/contrib/sendmail/libmilter/smfi.c stable/11/contrib/sendmail/libmilter/worker.c stable/11/contrib/sendmail/libsm/Makefile stable/11/contrib/sendmail/libsm/Makefile.m4 stable/11/contrib/sendmail/libsm/assert.c stable/11/contrib/sendmail/libsm/clock.c stable/11/contrib/sendmail/libsm/config.c stable/11/contrib/sendmail/libsm/debug.c stable/11/contrib/sendmail/libsm/errstring.c stable/11/contrib/sendmail/libsm/exc.c stable/11/contrib/sendmail/libsm/findfp.c stable/11/contrib/sendmail/libsm/flags.c stable/11/contrib/sendmail/libsm/fopen.c stable/11/contrib/sendmail/libsm/fpos.c stable/11/contrib/sendmail/libsm/fscanf.c stable/11/contrib/sendmail/libsm/io.html stable/11/contrib/sendmail/libsm/ldap.c stable/11/contrib/sendmail/libsm/local.h stable/11/contrib/sendmail/libsm/makebuf.c stable/11/contrib/sendmail/libsm/mbdb.c stable/11/contrib/sendmail/libsm/memstat.c stable/11/contrib/sendmail/libsm/niprop.c stable/11/contrib/sendmail/libsm/refill.c stable/11/contrib/sendmail/libsm/rewind.c stable/11/contrib/sendmail/libsm/rpool.c stable/11/contrib/sendmail/libsm/sem.c stable/11/contrib/sendmail/libsm/signal.c stable/11/contrib/sendmail/libsm/stdio.c stable/11/contrib/sendmail/libsm/strdup.c stable/11/contrib/sendmail/libsm/strerror.c stable/11/contrib/sendmail/libsm/string.c stable/11/contrib/sendmail/libsm/strio.c stable/11/contrib/sendmail/libsm/strto.c stable/11/contrib/sendmail/libsm/syslogio.c stable/11/contrib/sendmail/libsm/t-event.c stable/11/contrib/sendmail/libsm/t-exc.c stable/11/contrib/sendmail/libsm/t-heap.c stable/11/contrib/sendmail/libsm/t-scanf.c stable/11/contrib/sendmail/libsm/t-sem.c stable/11/contrib/sendmail/libsm/vfprintf.c stable/11/contrib/sendmail/libsm/vfscanf.c stable/11/contrib/sendmail/libsmdb/Makefile stable/11/contrib/sendmail/libsmdb/Makefile.m4 stable/11/contrib/sendmail/libsmdb/smdb.c stable/11/contrib/sendmail/libsmdb/smdb1.c stable/11/contrib/sendmail/libsmdb/smdb2.c stable/11/contrib/sendmail/libsmdb/smndbm.c stable/11/contrib/sendmail/libsmutil/Makefile stable/11/contrib/sendmail/libsmutil/cf.c stable/11/contrib/sendmail/libsmutil/safefile.c stable/11/contrib/sendmail/mail.local/Makefile stable/11/contrib/sendmail/mail.local/mail.local.c stable/11/contrib/sendmail/mailstats/Makefile stable/11/contrib/sendmail/mailstats/mailstats.c stable/11/contrib/sendmail/makemap/Makefile stable/11/contrib/sendmail/makemap/Makefile.m4 stable/11/contrib/sendmail/makemap/makemap.8 stable/11/contrib/sendmail/makemap/makemap.c stable/11/contrib/sendmail/praliases/Makefile stable/11/contrib/sendmail/praliases/praliases.c stable/11/contrib/sendmail/rmail/Makefile stable/11/contrib/sendmail/rmail/rmail.c stable/11/contrib/sendmail/smrsh/Makefile stable/11/contrib/sendmail/smrsh/smrsh.c stable/11/contrib/sendmail/src/Makefile stable/11/contrib/sendmail/src/Makefile.m4 stable/11/contrib/sendmail/src/README stable/11/contrib/sendmail/src/TRACEFLAGS stable/11/contrib/sendmail/src/alias.c stable/11/contrib/sendmail/src/arpadate.c stable/11/contrib/sendmail/src/bf.c stable/11/contrib/sendmail/src/collect.c stable/11/contrib/sendmail/src/conf.c stable/11/contrib/sendmail/src/conf.h stable/11/contrib/sendmail/src/control.c stable/11/contrib/sendmail/src/daemon.c stable/11/contrib/sendmail/src/daemon.h stable/11/contrib/sendmail/src/deliver.c stable/11/contrib/sendmail/src/domain.c stable/11/contrib/sendmail/src/envelope.c stable/11/contrib/sendmail/src/err.c stable/11/contrib/sendmail/src/headers.c stable/11/contrib/sendmail/src/macro.c stable/11/contrib/sendmail/src/main.c stable/11/contrib/sendmail/src/map.c stable/11/contrib/sendmail/src/map.h stable/11/contrib/sendmail/src/mci.c stable/11/contrib/sendmail/src/milter.c stable/11/contrib/sendmail/src/mime.c stable/11/contrib/sendmail/src/parseaddr.c stable/11/contrib/sendmail/src/queue.c stable/11/contrib/sendmail/src/ratectrl.c stable/11/contrib/sendmail/src/readcf.c stable/11/contrib/sendmail/src/recipient.c stable/11/contrib/sendmail/src/sasl.c stable/11/contrib/sendmail/src/savemail.c stable/11/contrib/sendmail/src/sendmail.h stable/11/contrib/sendmail/src/sfsasl.c stable/11/contrib/sendmail/src/sfsasl.h stable/11/contrib/sendmail/src/sm_resolve.c stable/11/contrib/sendmail/src/sm_resolve.h stable/11/contrib/sendmail/src/srvrsmtp.c stable/11/contrib/sendmail/src/stab.c stable/11/contrib/sendmail/src/timers.c stable/11/contrib/sendmail/src/tls.c stable/11/contrib/sendmail/src/udb.c stable/11/contrib/sendmail/src/usersmtp.c stable/11/contrib/sendmail/src/util.c stable/11/contrib/sendmail/src/version.c stable/11/contrib/sendmail/test/Results stable/11/contrib/sendmail/vacation/Makefile stable/11/contrib/sendmail/vacation/vacation.c stable/11/etc/sendmail/freebsd.mc stable/11/etc/sendmail/freebsd.submit.mc stable/11/lib/libsm/Makefile stable/11/lib/libsmdb/Makefile stable/11/usr.sbin/sendmail/Makefile Directory Properties: stable/11/ (props changed) Modified: stable/11/contrib/sendmail/CACerts ============================================================================== --- stable/11/contrib/sendmail/CACerts Fri Jul 24 00:22:33 2020 (r363465) +++ stable/11/contrib/sendmail/CACerts Fri Jul 24 00:23:26 2020 (r363466) @@ -1,4 +1,3 @@ -# $Id: CACerts,v 8.6 2013-01-18 15:14:17 ca Exp $ # This file contains some CA certificates that are used to sign the # certificates of mail servers of members of the sendmail consortium # who may reply to questions etc sent to sendmail.org. @@ -10,189 +9,92 @@ Certificate: Data: Version: 3 (0x2) Serial Number: - 92:91:67:de:e0:ef:2c:e4 + 81:9d:41:0f:40:55:ac:4a Signature Algorithm: sha1WithRSAEncryption - Issuer: C=US, ST=California, L=Berkeley, O=Endmail Org, OU=MTA, CN=Claus Assmann CA RSA 2015/emailAddress=ca+ca-rsa2015@esmtp.org + Issuer: C=US, ST=California, L=Berkeley, O=Endmail Org, OU=MTA, CN=CA/emailAddress=ca+ca-rsa2018@esmtp.org Validity - Not Before: Mar 2 19:15:29 2015 GMT - Not After : Mar 1 19:15:29 2018 GMT - Subject: C=US, ST=California, L=Berkeley, O=Endmail Org, OU=MTA, CN=Claus Assmann CA RSA 2015/emailAddress=ca+ca-rsa2015@esmtp.org + Not Before: Feb 27 02:30:55 2018 GMT + Not After : Feb 26 02:30:55 2021 GMT + Subject: C=US, ST=California, L=Berkeley, O=Endmail Org, OU=MTA, CN=CA/emailAddress=ca+ca-rsa2018@esmtp.org Subject Public Key Info: Public Key Algorithm: rsaEncryption Public-Key: (2048 bit) Modulus: - 00:b9:1a:a1:56:ce:cb:16:af:4f:96:ba:2a:70:31: - 70:d3:86:6c:7a:46:26:47:42:3f:de:49:57:3e:08: - 1e:10:25:bf:06:8f:ca:fd:f4:5e:6a:01:7d:31:4d: - 50:88:18:43:71:66:65:42:9c:90:97:0d:95:f2:14: - ef:d7:5e:77:ef:7d:b5:49:3f:02:bb:83:20:f7:e6: - fc:9a:cd:13:df:60:41:28:8e:39:07:a6:a4:40:98: - 15:1e:46:b6:04:2e:f9:ab:32:d1:8b:fe:52:81:f1: - d2:e1:c3:cf:bf:ab:40:a7:f0:e4:e5:a2:82:37:30: - 8c:10:7d:aa:a8:7c:7e:76:cc:5f:1a:24:d0:8c:94: - f6:f2:7f:4a:be:2f:38:67:c0:06:e6:9e:51:ad:55: - d0:cb:26:71:cf:f4:af:7d:5a:41:81:16:fb:26:ec: - f0:35:01:6e:db:f9:e9:00:d7:d0:89:7b:cf:88:16: - 8b:1c:8f:77:1f:5d:ef:70:04:28:76:c5:1b:c6:23: - 8d:49:6b:f0:b8:21:56:d6:7d:68:6c:be:21:e3:e6: - e3:1d:6f:a5:ea:dc:83:e4:27:b3:6f:5f:1b:3d:33: - a1:d5:d3:f0:73:1a:12:eb:d9:95:00:71:59:16:b4: - e4:60:38:b2:2e:7f:b7:d4:c5:e9:3f:74:e4:48:38: - 29:89 + 00:b8:a3:8d:79:28:c1:1f:9c:11:74:43:26:e1:3b: + cc:14:87:5b:6b:64:4c:ed:79:1b:7f:2a:03:d0:7b: + ef:9e:88:b0:64:36:ee:58:ef:fd:d9:c7:20:b3:71: + e9:6d:1e:a7:bc:c1:7c:3b:fe:2a:e4:16:2f:bc:d6: + 2c:f5:98:f9:c4:21:1c:ca:c3:7e:57:89:c8:a9:2f: + da:6b:9b:52:d6:c9:9d:98:97:6d:08:7c:a6:37:4e: + d4:26:bb:db:73:b0:38:ef:7d:1e:dd:8e:dd:8e:17: + 2f:a0:3d:a9:0e:4d:f0:2b:b8:14:23:33:ad:c8:a0: + e5:9d:0f:27:ad:83:a2:78:90:05:ec:29:06:91:07: + 45:6c:5f:ba:8e:1d:f1:d7:1b:2d:f9:99:ba:2e:27: + e1:03:7d:e9:d2:54:35:cc:39:79:07:83:d8:93:9b: + d6:ef:72:ab:d4:63:8e:6b:f7:00:66:5f:77:e8:b6: + bc:de:5f:8c:d0:ce:1a:c4:db:03:9d:e4:ee:0a:ec: + 77:c5:f2:30:69:7e:70:12:e5:c2:4a:28:3f:e7:19: + eb:af:41:fb:e6:a6:1d:b5:fd:2b:99:03:f5:20:90: + 38:73:bd:43:70:da:cf:1f:34:5d:ab:17:4b:73:cf: + f9:3d:e1:a2:79:14:de:d8:40:85:82:c4:5a:84:82: + 32:f1 Exponent: 65537 (0x10001) X509v3 extensions: X509v3 Subject Key Identifier: - B1:69:DB:5E:9B:CE:1A:B4:1D:B2:6A:FC:5A:22:97:B6:24:14:6F:32 + 42:37:75:E7:8F:12:CF:D9:EB:21:22:7D:8A:E8:49:21:FD:E2:3A:3A X509v3 Authority Key Identifier: - keyid:B1:69:DB:5E:9B:CE:1A:B4:1D:B2:6A:FC:5A:22:97:B6:24:14:6F:32 - DirName:/C=US/ST=California/L=Berkeley/O=Endmail Org/OU=MTA/CN=Claus Assmann CA RSA 2015/emailAddress=ca+ca-rsa2015@esmtp.org - serial:92:91:67:DE:E0:EF:2C:E4 - + keyid:42:37:75:E7:8F:12:CF:D9:EB:21:22:7D:8A:E8:49:21:FD:E2:3A:3A + DirName:/C=US/ST=California/L=Berkeley/O=Endmail Org/OU=MTA/CN=CA/emailAddress=ca+ca-rsa2018@esmtp.org + serial:81:9D:41:0F:40:55:AC:4A X509v3 Basic Constraints: CA:TRUE X509v3 Subject Alternative Name: - email:ca+ca-rsa2015@esmtp.org + email:ca+ca-rsa2018@esmtp.org X509v3 Issuer Alternative Name: - email:ca+ca-rsa2015@esmtp.org + email:ca+ca-rsa2018@esmtp.org Signature Algorithm: sha1WithRSAEncryption - 0a:ce:07:39:77:08:c5:3a:00:04:e8:a0:3b:f7:d2:4c:79:02: - 23:0b:da:c0:55:39:82:71:0a:0c:83:e2:de:f2:3b:fe:23:bc: - 9b:13:34:d1:29:0a:16:3f:01:7d:9f:fb:4b:aa:12:dc:3b:7e: - b9:27:7b:ec:0c:3f:c0:d9:f5:d8:a8:a1:9c:1c:3a:2f:40:df: - 27:1a:1a:a0:74:00:19:b7:82:0e:f9:45:86:bf:32:da:0e:72: - 0a:4c:2c:39:21:63:c3:1f:61:6e:e2:4d:ba:7a:26:1a:15:ce: - b1:f6:1a:59:04:70:ed:e8:72:05:4c:fc:84:c6:a5:f4:e2:4a: - 40:e4:42:70:87:9a:a7:02:26:3a:47:34:09:e0:7b:88:ca:fb: - 99:d9:9b:bb:0c:52:8a:93:d5:59:30:0b:55:42:b4:bb:d2:b1: - 49:55:81:a4:70:a0:49:19:f2:4f:61:94:af:e9:d7:62:68:65: - 97:67:00:26:b8:9b:b2:2c:d0:2c:83:7d:3e:b3:31:73:b9:55: - 49:53:fa:a3:ad:1b:02:67:08:9e:ce:9e:eb:9f:47:0d:6c:95: - e9:6c:30:92:c1:94:67:ad:d9:e3:b9:61:ea:a9:72:98:81:3a: - 62:80:70:20:9a:3e:c4:1f:6f:bd:b4:00:ec:b1:fe:71:da:91: - 15:89:f7:8f ------BEGIN CERTIFICATE----- -MIIFJzCCBA+gAwIBAgIJAJKRZ97g7yzkMA0GCSqGSIb3DQEBBQUAMIGlMQswCQYD -VQQGEwJVUzETMBEGA1UECAwKQ2FsaWZvcm5pYTERMA8GA1UEBwwIQmVya2VsZXkx -FDASBgNVBAoMC0VuZG1haWwgT3JnMQwwCgYDVQQLDANNVEExIjAgBgNVBAMMGUNs -YXVzIEFzc21hbm4gQ0EgUlNBIDIwMTUxJjAkBgkqhkiG9w0BCQEWF2NhK2NhLXJz -YTIwMTVAZXNtdHAub3JnMB4XDTE1MDMwMjE5MTUyOVoXDTE4MDMwMTE5MTUyOVow -gaUxCzAJBgNVBAYTAlVTMRMwEQYDVQQIDApDYWxpZm9ybmlhMREwDwYDVQQHDAhC -ZXJrZWxleTEUMBIGA1UECgwLRW5kbWFpbCBPcmcxDDAKBgNVBAsMA01UQTEiMCAG -A1UEAwwZQ2xhdXMgQXNzbWFubiBDQSBSU0EgMjAxNTEmMCQGCSqGSIb3DQEJARYX -Y2ErY2EtcnNhMjAxNUBlc210cC5vcmcwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAw -ggEKAoIBAQC5GqFWzssWr0+WuipwMXDThmx6RiZHQj/eSVc+CB4QJb8Gj8r99F5q -AX0xTVCIGENxZmVCnJCXDZXyFO/XXnfvfbVJPwK7gyD35vyazRPfYEEojjkHpqRA -mBUeRrYELvmrMtGL/lKB8dLhw8+/q0Cn8OTlooI3MIwQfaqofH52zF8aJNCMlPby -f0q+LzhnwAbmnlGtVdDLJnHP9K99WkGBFvsm7PA1AW7b+ekA19CJe8+IFoscj3cf -Xe9wBCh2xRvGI41Ja/C4IVbWfWhsviHj5uMdb6Xq3IPkJ7NvXxs9M6HV0/BzGhLr -2ZUAcVkWtORgOLIuf7fUxek/dORIOCmJAgMBAAGjggFWMIIBUjAdBgNVHQ4EFgQU -sWnbXpvOGrQdsmr8WiKXtiQUbzIwgdoGA1UdIwSB0jCBz4AUsWnbXpvOGrQdsmr8 -WiKXtiQUbzKhgaukgagwgaUxCzAJBgNVBAYTAlVTMRMwEQYDVQQIDApDYWxpZm9y -bmlhMREwDwYDVQQHDAhCZXJrZWxleTEUMBIGA1UECgwLRW5kbWFpbCBPcmcxDDAK -BgNVBAsMA01UQTEiMCAGA1UEAwwZQ2xhdXMgQXNzbWFubiBDQSBSU0EgMjAxNTEm -MCQGCSqGSIb3DQEJARYXY2ErY2EtcnNhMjAxNUBlc210cC5vcmeCCQCSkWfe4O8s -5DAMBgNVHRMEBTADAQH/MCIGA1UdEQQbMBmBF2NhK2NhLXJzYTIwMTVAZXNtdHAu -b3JnMCIGA1UdEgQbMBmBF2NhK2NhLXJzYTIwMTVAZXNtdHAub3JnMA0GCSqGSIb3 -DQEBBQUAA4IBAQAKzgc5dwjFOgAE6KA799JMeQIjC9rAVTmCcQoMg+Le8jv+I7yb -EzTRKQoWPwF9n/tLqhLcO365J3vsDD/A2fXYqKGcHDovQN8nGhqgdAAZt4IO+UWG -vzLaDnIKTCw5IWPDH2Fu4k26eiYaFc6x9hpZBHDt6HIFTPyExqX04kpA5EJwh5qn -AiY6RzQJ4HuIyvuZ2Zu7DFKKk9VZMAtVQrS70rFJVYGkcKBJGfJPYZSv6ddiaGWX -ZwAmuJuyLNAsg30+szFzuVVJU/qjrRsCZwiezp7rn0cNbJXpbDCSwZRnrdnjuWHq -qXKYgTpigHAgmj7EH2+9tADssf5x2pEVifeP ------END CERTIFICATE----- + 0b:4c:e5:c2:ed:0a:e5:7b:95:29:22:d4:8f:5f:cb:1b:b1:e3: + 4c:fc:90:e7:2e:97:87:87:a2:63:0d:6d:4d:f0:1f:0d:84:11: + dc:df:b7:fa:c3:c6:2e:07:e9:a0:e9:a6:9f:54:17:ad:1a:d0: + 36:be:31:cc:a5:85:a0:45:4a:87:45:80:7e:de:ea:97:68:e0: + 2b:09:5d:9a:31:6f:f5:78:22:c5:66:2a:99:70:9e:6d:c4:ab: + f6:90:01:70:53:07:66:6c:a6:b5:ce:4b:36:05:83:87:0c:a7: + e0:1e:34:d0:5e:76:a4:20:71:cd:9d:c1:ae:82:27:e0:6f:16: + 57:74:e7:63:9f:d0:3d:72:91:6d:97:a4:82:23:84:dd:6e:0d: + da:43:00:a7:ce:2f:f8:79:04:67:6a:e5:b0:ab:30:d8:f1:90: + 10:43:3b:09:77:27:34:a4:d4:c0:25:4e:21:32:a3:ab:60:1c: + 9d:6e:e2:65:39:51:7f:cd:9f:88:3a:7e:f4:38:af:7b:5b:a7: + bb:7b:70:97:21:59:fc:5c:55:a1:db:74:0a:37:1e:33:97:5f: + 70:32:98:b3:d9:99:4e:08:3c:de:01:82:17:9b:49:d7:fa:c9: + 45:8d:93:cc:42:d6:36:f2:39:3a:47:28:3f:6f:6a:e5:23:f3: + 5c:d4:a3:1b - -Certificate: - Data: - Version: 3 (0x2) - Serial Number: - f1:41:b3:3d:ba:bd:33:49 - Signature Algorithm: sha1WithRSAEncryption - Issuer: C=US, ST=California, L=Berkeley, O=Endmail Org, OU=MTA, CN=Claus Assmann CA RSA 2012/emailAddress=ca+ca-rsa2012@esmtp.org - Validity - Not Before: Mar 10 02:47:46 2012 GMT - Not After : Mar 10 02:47:46 2015 GMT - Subject: C=US, ST=California, L=Berkeley, O=Endmail Org, OU=MTA, CN=Claus Assmann CA RSA 2012/emailAddress=ca+ca-rsa2012@esmtp.org - Subject Public Key Info: - Public Key Algorithm: rsaEncryption - Public-Key: (2048 bit) - Modulus: - 00:a2:80:fc:c6:ce:7f:60:38:65:f4:38:f9:7a:d9: - 87:fd:47:eb:3f:2c:4a:c9:38:77:6a:77:94:92:7f: - 83:3d:99:57:2c:5f:37:bb:ba:12:10:17:56:fa:eb: - 43:a6:4b:4c:1e:30:32:07:94:2f:5a:d8:65:49:29: - fa:24:d1:f0:0b:45:2d:e5:d5:cb:7d:60:dc:a6:ce: - a4:47:35:30:ee:5e:8d:c2:30:e7:a7:63:32:b0:59: - 80:cc:8c:99:64:77:8f:50:8e:88:51:47:36:ea:9a: - f3:b4:c0:8c:a6:ab:c6:42:57:88:b9:5f:9f:61:15: - bb:79:65:93:ca:a9:fd:17:eb:87:26:8b:eb:b7:2b: - 7e:33:05:2b:ba:c0:46:f7:08:fd:da:c1:50:9b:3d: - 26:83:5c:53:97:89:2c:cc:5f:f2:7b:a8:b7:3d:fb: - f2:b4:89:0d:43:ef:18:5c:21:75:71:cc:f0:c2:a3: - 84:69:c0:a7:f3:9b:de:c1:c7:5a:5c:7e:68:da:49: - 71:af:58:a8:51:9f:bd:f9:3d:bb:a5:92:fa:7b:1d: - 52:f5:fe:90:59:95:27:65:a4:af:97:9a:4f:01:39: - 59:7d:08:6f:a1:8f:42:47:49:bf:12:52:53:39:74: - 8d:62:3b:bd:4c:4f:05:0f:c4:b9:3e:da:a8:0e:96: - 05:2d - Exponent: 65537 (0x10001) - X509v3 extensions: - X509v3 Subject Key Identifier: - 08:38:E3:88:92:53:6E:F1:56:69:27:44:B5:4C:A0:18:CA:06:97:EB - X509v3 Authority Key Identifier: - keyid:08:38:E3:88:92:53:6E:F1:56:69:27:44:B5:4C:A0:18:CA:06:97:EB - DirName:/C=US/ST=California/L=Berkeley/O=Endmail Org/OU=MTA/CN=Claus Assmann CA RSA 2012/emailAddress=ca+ca-rsa2012@esmtp.org - serial:F1:41:B3:3D:BA:BD:33:49 - - X509v3 Basic Constraints: - CA:TRUE - X509v3 Subject Alternative Name: - email:ca+ca-rsa2012@esmtp.org - X509v3 Issuer Alternative Name: - email:ca+ca-rsa2012@esmtp.org - Signature Algorithm: sha1WithRSAEncryption - 9a:8f:4d:23:5b:30:80:e1:94:e4:66:9c:3a:17:8b:79:49:5b: - ec:5d:e5:a1:22:2d:71:37:a1:51:e7:1d:b1:0d:a9:9b:aa:a9: - 0d:c7:cd:d6:24:f9:e0:f0:57:be:4f:74:0c:4b:7a:42:4c:70: - 19:2e:8e:eb:cb:1b:00:26:27:eb:1c:42:33:d5:ec:32:b4:6c: - 7d:a3:04:a1:5c:00:49:c9:0d:4c:4d:28:37:06:22:77:ec:40: - 15:25:3a:23:84:ae:1f:da:90:dd:c9:dc:27:ee:7c:ec:e5:df: - b8:ba:1e:3f:ee:c2:91:a2:3f:22:92:1e:f3:06:7e:aa:e9:c3: - 11:2d:3d:2f:85:f7:fc:d7:e2:f8:6d:70:a6:40:62:69:e7:52: - ed:1b:19:38:72:86:08:a1:3d:47:c8:68:82:41:db:db:2a:52: - 25:d7:49:aa:9e:c5:83:22:7d:2f:0b:df:8c:90:2d:b5:aa:33: - c7:9b:e8:39:8f:bb:79:5b:13:2d:4e:a9:69:59:c7:09:26:e2: - b5:53:80:86:72:bb:7c:be:e9:46:5b:d8:b2:78:42:d6:5d:c3: - bb:3a:3b:5f:0f:e8:c3:60:fb:88:9f:3a:2b:9f:d3:7d:9f:c7: - 32:aa:4d:34:a7:66:a1:25:16:95:a6:69:e7:86:a3:5c:b9:b9: - df:58:05:e3 -----BEGIN CERTIFICATE----- -MIIFJzCCBA+gAwIBAgIJAPFBsz26vTNJMA0GCSqGSIb3DQEBBQUAMIGlMQswCQYD -VQQGEwJVUzETMBEGA1UECBMKQ2FsaWZvcm5pYTERMA8GA1UEBxMIQmVya2VsZXkx -FDASBgNVBAoTC0VuZG1haWwgT3JnMQwwCgYDVQQLEwNNVEExIjAgBgNVBAMTGUNs -YXVzIEFzc21hbm4gQ0EgUlNBIDIwMTIxJjAkBgkqhkiG9w0BCQEWF2NhK2NhLXJz -YTIwMTJAZXNtdHAub3JnMB4XDTEyMDMxMDAyNDc0NloXDTE1MDMxMDAyNDc0Nlow -gaUxCzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpDYWxpZm9ybmlhMREwDwYDVQQHEwhC -ZXJrZWxleTEUMBIGA1UEChMLRW5kbWFpbCBPcmcxDDAKBgNVBAsTA01UQTEiMCAG -A1UEAxMZQ2xhdXMgQXNzbWFubiBDQSBSU0EgMjAxMjEmMCQGCSqGSIb3DQEJARYX -Y2ErY2EtcnNhMjAxMkBlc210cC5vcmcwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAw -ggEKAoIBAQCigPzGzn9gOGX0OPl62Yf9R+s/LErJOHdqd5SSf4M9mVcsXze7uhIQ -F1b660OmS0weMDIHlC9a2GVJKfok0fALRS3l1ct9YNymzqRHNTDuXo3CMOenYzKw -WYDMjJlkd49QjohRRzbqmvO0wIymq8ZCV4i5X59hFbt5ZZPKqf0X64cmi+u3K34z -BSu6wEb3CP3awVCbPSaDXFOXiSzMX/J7qLc9+/K0iQ1D7xhcIXVxzPDCo4RpwKfz -m97Bx1pcfmjaSXGvWKhRn735Pbulkvp7HVL1/pBZlSdlpK+Xmk8BOVl9CG+hj0JH -Sb8SUlM5dI1iO71MTwUPxLk+2qgOlgUtAgMBAAGjggFWMIIBUjAdBgNVHQ4EFgQU -CDjjiJJTbvFWaSdEtUygGMoGl+swgdoGA1UdIwSB0jCBz4AUCDjjiJJTbvFWaSdE -tUygGMoGl+uhgaukgagwgaUxCzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpDYWxpZm9y -bmlhMREwDwYDVQQHEwhCZXJrZWxleTEUMBIGA1UEChMLRW5kbWFpbCBPcmcxDDAK -BgNVBAsTA01UQTEiMCAGA1UEAxMZQ2xhdXMgQXNzbWFubiBDQSBSU0EgMjAxMjEm -MCQGCSqGSIb3DQEJARYXY2ErY2EtcnNhMjAxMkBlc210cC5vcmeCCQDxQbM9ur0z -STAMBgNVHRMEBTADAQH/MCIGA1UdEQQbMBmBF2NhK2NhLXJzYTIwMTJAZXNtdHAu -b3JnMCIGA1UdEgQbMBmBF2NhK2NhLXJzYTIwMTJAZXNtdHAub3JnMA0GCSqGSIb3 -DQEBBQUAA4IBAQCaj00jWzCA4ZTkZpw6F4t5SVvsXeWhIi1xN6FR5x2xDambqqkN -x83WJPng8Fe+T3QMS3pCTHAZLo7ryxsAJifrHEIz1ewytGx9owShXABJyQ1MTSg3 -BiJ37EAVJTojhK4f2pDdydwn7nzs5d+4uh4/7sKRoj8ikh7zBn6q6cMRLT0vhff8 -1+L4bXCmQGJp51LtGxk4coYIoT1HyGiCQdvbKlIl10mqnsWDIn0vC9+MkC21qjPH -m+g5j7t5WxMtTqlpWccJJuK1U4CGcrt8vulGW9iyeELWXcO7OjtfD+jDYPuInzor -n9N9n8cyqk00p2ahJRaVpmnnhqNcubnfWAXj +MIIE4jCCA8qgAwIBAgIJAIGdQQ9AVaxKMA0GCSqGSIb3DQEBBQUAMIGOMQswCQYD +VQQGEwJVUzETMBEGA1UECAwKQ2FsaWZvcm5pYTERMA8GA1UEBwwIQmVya2VsZXkx +FDASBgNVBAoMC0VuZG1haWwgT3JnMQwwCgYDVQQLDANNVEExCzAJBgNVBAMMAkNB +MSYwJAYJKoZIhvcNAQkBFhdjYStjYS1yc2EyMDE4QGVzbXRwLm9yZzAeFw0xODAy +MjcwMjMwNTVaFw0yMTAyMjYwMjMwNTVaMIGOMQswCQYDVQQGEwJVUzETMBEGA1UE +CAwKQ2FsaWZvcm5pYTERMA8GA1UEBwwIQmVya2VsZXkxFDASBgNVBAoMC0VuZG1h +aWwgT3JnMQwwCgYDVQQLDANNVEExCzAJBgNVBAMMAkNBMSYwJAYJKoZIhvcNAQkB +FhdjYStjYS1yc2EyMDE4QGVzbXRwLm9yZzCCASIwDQYJKoZIhvcNAQEBBQADggEP +ADCCAQoCggEBALijjXkowR+cEXRDJuE7zBSHW2tkTO15G38qA9B7756IsGQ27ljv +/dnHILNx6W0ep7zBfDv+KuQWL7zWLPWY+cQhHMrDfleJyKkv2mubUtbJnZiXbQh8 +pjdO1Ca723OwOO99Ht2O3Y4XL6A9qQ5N8Cu4FCMzrcig5Z0PJ62DoniQBewpBpEH +RWxfuo4d8dcbLfmZui4n4QN96dJUNcw5eQeD2JOb1u9yq9Rjjmv3AGZfd+i2vN5f +jNDOGsTbA53k7grsd8XyMGl+cBLlwkooP+cZ669B++amHbX9K5kD9SCQOHO9Q3Da +zx80XasXS3PP+T3honkU3thAhYLEWoSCMvECAwEAAaOCAT8wggE7MB0GA1UdDgQW +BBRCN3XnjxLP2eshIn2K6Ekh/eI6OjCBwwYDVR0jBIG7MIG4gBRCN3XnjxLP2esh +In2K6Ekh/eI6OqGBlKSBkTCBjjELMAkGA1UEBhMCVVMxEzARBgNVBAgMCkNhbGlm +b3JuaWExETAPBgNVBAcMCEJlcmtlbGV5MRQwEgYDVQQKDAtFbmRtYWlsIE9yZzEM +MAoGA1UECwwDTVRBMQswCQYDVQQDDAJDQTEmMCQGCSqGSIb3DQEJARYXY2ErY2Et +cnNhMjAxOEBlc210cC5vcmeCCQCBnUEPQFWsSjAMBgNVHRMEBTADAQH/MCIGA1Ud +EQQbMBmBF2NhK2NhLXJzYTIwMThAZXNtdHAub3JnMCIGA1UdEgQbMBmBF2NhK2Nh +LXJzYTIwMThAZXNtdHAub3JnMA0GCSqGSIb3DQEBBQUAA4IBAQALTOXC7Qrle5Up +ItSPX8sbseNM/JDnLpeHh6JjDW1N8B8NhBHc37f6w8YuB+mg6aafVBetGtA2vjHM +pYWgRUqHRYB+3uqXaOArCV2aMW/1eCLFZiqZcJ5txKv2kAFwUwdmbKa1zks2BYOH +DKfgHjTQXnakIHHNncGugifgbxZXdOdjn9A9cpFtl6SCI4Tdbg3aQwCnzi/4eQRn +auWwqzDY8ZAQQzsJdyc0pNTAJU4hMqOrYBydbuJlOVF/zZ+IOn70OK97W6e7e3CX +IVn8XFWh23QKNx4zl19wMpiz2ZlOCDzeAYIXm0nX+slFjZPMQtY28jk6Ryg/b2rl +I/Nc1KMb -----END CERTIFICATE----- Modified: stable/11/contrib/sendmail/FREEBSD-upgrade ============================================================================== --- stable/11/contrib/sendmail/FREEBSD-upgrade Fri Jul 24 00:22:33 2020 (r363465) +++ stable/11/contrib/sendmail/FREEBSD-upgrade Fri Jul 24 00:23:26 2020 (r363466) @@ -1,6 +1,6 @@ $FreeBSD$ -sendmail 8.15.2 +sendmail 8.16.1 originals can be found at: ftp://ftp.sendmail.org/pub/sendmail/ For the import of sendmail, the following directories were renamed: @@ -13,12 +13,16 @@ http://www.freebsd.org/doc/en_US.ISO8859-1/articles/co Then merged using: -% set FSVN=svn+ssh://svn.freebsd.org/base +% set FSVN=svn+ssh://repo.freebsd.org/base % svn checkout $FSVN/head/contrib/sendmail head % cd head -% svn merge --accept=postpone $FSVN/vendor/sendmail/dist . -% svn rm --force */Build [e-v]*/*.0 cf/cf/generic-*.cf cf/cf/Build -% svn rm --force Build devtools doc/op/op.ps src/makesendmail src/sysexits.h +### Replace XXXXXX with import revision number in next command: +% svn merge -c rXXXXXX --accept=postpone '^/vendor/sendmail/dist' . +% svn resolve --accept working cf/cf/Build \ + cf/cf/generic-{bsd4.4,hpux{9,10},linux,mpeix,nextstep3.3,osf1,solaris,sunos4.1,ultrix4}.cf \ + devtools doc/op/op.ps editmap/editmap.0 mail.local/mail.local.0 mailstats/mailstats.0 \ + makemap/makemap.0 praliases/praliases.0 rmail/rmail.0 smrsh/smrsh.0 \ + src/{aliases,mailq,newaliases,sendmail}.0 vacation/vacation.0 % svn propset -R svn:keywords FreeBSD=%H . % svn propdel svn:keywords libmilter/docs/*.jpg % svn diff --no-diff-deleted --old=$FSVN/vendor/sendmail/dist --new=. @@ -98,4 +102,4 @@ infrastructure in FreeBSD: usr.sbin/mailwrapper/Makefile gshapiro@FreeBSD.org -06-July-2015 +23-July-2020 Modified: stable/11/contrib/sendmail/KNOWNBUGS ============================================================================== --- stable/11/contrib/sendmail/KNOWNBUGS Fri Jul 24 00:22:33 2020 (r363465) +++ stable/11/contrib/sendmail/KNOWNBUGS Fri Jul 24 00:23:26 2020 (r363466) @@ -271,4 +271,3 @@ Kresolve sequence dnsmx canon be used if set instead of LOCAL_RELAY ($R). This will be fixed in a future version. -$Revision: 8.61 $, Last updated $Date: 2011-04-07 17:48:23 $ Modified: stable/11/contrib/sendmail/PGPKEYS ============================================================================== --- stable/11/contrib/sendmail/PGPKEYS Fri Jul 24 00:22:33 2020 (r363465) +++ stable/11/contrib/sendmail/PGPKEYS Fri Jul 24 00:23:26 2020 (r363466) @@ -8,140 +8,1092 @@ GPG: gpg --import PGPKEYS Other versions of PGP may require you to separate each key into a separate file and add them one at a time. -Type Bits KeyID Created Expires Algorithm Use -pub 1024 0x16F4CCE9 1999-06-23 ---------- RSA Sign & Encrypt -f16 Fingerprint16 = 18 A4 51 78 CA 72 D4 A7 ED 80 BA 8A C4 98 71 1D -uid Sendmail Security +Note that PGP 2.X and 5.X are deprecated and may not properly +function with newer keys. +pub 4096R/CA28E5A4 2016-03-04 +fingerprint: 8E6A 5575 0635 A7EA F56C FE80 3D67 CBA7 CA28 E5A4 +uid Sendmail Security + -----BEGIN PGP PUBLIC KEY BLOCK----- -Version: GnuPG v1.2.4 (Darwin) +Version: GnuPG v1 -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 -gpExpdV7qPrw9k01j5rod5PjZlG8zV0= -=SR28 +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 +9T92qg== +=xY3m -----END PGP PUBLIC KEY BLOCK----- +pub rsa4096/0xD583210EF51471A7 2020-04-08 [SC] + Key fingerprint = ADFD B709 FE1E A682 E585 5971 D583 210E F514 71A7 +uid [ full ] Sendmail Signing Key/2020 +sub rsa4096/0x5C092A1B257B1C27 2020-04-08 [E] + +-----BEGIN PGP PUBLIC KEY BLOCK----- + +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 +4XUsDQOZ8aKrTpMO+Q== +=jgHV +-----END PGP PUBLIC KEY BLOCK----- + + +pub rsa4096/0x09E01FA03C0C504E 2019-01-09 [SC] + Key fingerprint = 50A3 0309 8EA2 DD7B CBEE 2ADA 09E0 1FA0 3C0C 504E +uid Sendmail Signing Key/2019 +sub rsa4096/0xEF9F24EFDC48FA66 2019-01-09 [E] + +-----BEGIN PGP PUBLIC KEY BLOCK----- + +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 +HcRQfq7rqZkS3NE+iD9D/lUyXVYfH9A= +=jN/3 +-----END PGP PUBLIC KEY BLOCK----- + *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Fri Jul 24 00:35:22 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 76219368B44; Fri, 24 Jul 2020 00:35:22 +0000 (UTC) (envelope-from jmg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BCVbZ2byPz4MVK; Fri, 24 Jul 2020 00:35:22 +0000 (UTC) (envelope-from jmg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3C77D21D5E; Fri, 24 Jul 2020 00:35:22 +0000 (UTC) (envelope-from jmg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06O0ZMUX094934; Fri, 24 Jul 2020 00:35:22 GMT (envelope-from jmg@FreeBSD.org) Received: (from jmg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06O0ZME9094933; Fri, 24 Jul 2020 00:35:22 GMT (envelope-from jmg@FreeBSD.org) Message-Id: <202007240035.06O0ZME9094933@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jmg set sender to jmg@FreeBSD.org using -f From: John-Mark Gurney Date: Fri, 24 Jul 2020 00:35:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363467 - head/share/man/man9 X-SVN-Group: head X-SVN-Commit-Author: jmg X-SVN-Commit-Paths: head/share/man/man9 X-SVN-Commit-Revision: 363467 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 24 Jul 2020 00:35:22 -0000 Author: jmg Date: Fri Jul 24 00:35:21 2020 New Revision: 363467 URL: https://svnweb.freebsd.org/changeset/base/363467 Log: document that m_get2 only accepts up to MJUMPAGESIZE.. Modified: head/share/man/man9/mbuf.9 Modified: head/share/man/man9/mbuf.9 ============================================================================== --- head/share/man/man9/mbuf.9 Fri Jul 24 00:23:26 2020 (r363466) +++ head/share/man/man9/mbuf.9 Fri Jul 24 00:35:21 2020 (r363467) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 28, 2019 +.Dd July 23, 2020 .Dt MBUF 9 .Os .\" @@ -574,6 +574,9 @@ for non-critical paths. Allocate an .Vt mbuf with enough space to hold specified amount of data. +If the size is is larger than +.Dv MJUMPAGESIZE , NULL +will be returned. .It Fn m_getm orig len how type Allocate .Fa len From owner-svn-src-all@freebsd.org Fri Jul 24 00:47:15 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5A355369202; Fri, 24 Jul 2020 00:47:15 +0000 (UTC) (envelope-from jmg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BCVsH1kCwz4N4p; Fri, 24 Jul 2020 00:47:15 +0000 (UTC) (envelope-from jmg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1EB3A2157C; Fri, 24 Jul 2020 00:47:15 +0000 (UTC) (envelope-from jmg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06O0lEK9001244; Fri, 24 Jul 2020 00:47:14 GMT (envelope-from jmg@FreeBSD.org) Received: (from jmg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06O0lEIa001243; Fri, 24 Jul 2020 00:47:14 GMT (envelope-from jmg@FreeBSD.org) Message-Id: <202007240047.06O0lEIa001243@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jmg set sender to jmg@FreeBSD.org using -f From: John-Mark Gurney Date: Fri, 24 Jul 2020 00:47:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363468 - head/share/man/man9 X-SVN-Group: head X-SVN-Commit-Author: jmg X-SVN-Commit-Paths: head/share/man/man9 X-SVN-Commit-Revision: 363468 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 24 Jul 2020 00:47:15 -0000 Author: jmg Date: Fri Jul 24 00:47:14 2020 New Revision: 363468 URL: https://svnweb.freebsd.org/changeset/base/363468 Log: fix up docs for m_getjcl as well.. Modified: head/share/man/man9/mbuf.9 Modified: head/share/man/man9/mbuf.9 ============================================================================== --- head/share/man/man9/mbuf.9 Fri Jul 24 00:35:21 2020 (r363467) +++ head/share/man/man9/mbuf.9 Fri Jul 24 00:47:14 2020 (r363468) @@ -635,9 +635,12 @@ on failure. .It Fn m_getjcl how type flags size This is like .Fn m_getcl -but it the size of the cluster allocated will be large enough for +but the specified .Fa size -bytes. +of the cluster to be allocated must be one of +.Dv MCLBYTES , MJUMPAGESIZE , MJUM9BYTES , +or +.Dv MJUM16BYTES. .It Fn m_free mbuf Frees .Vt mbuf . From owner-svn-src-all@freebsd.org Fri Jul 24 01:25:58 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 62C1536A05D; Fri, 24 Jul 2020 01:25:58 +0000 (UTC) (envelope-from gshapiro@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BCWjy1zKYz4Q4r; Fri, 24 Jul 2020 01:25:58 +0000 (UTC) (envelope-from gshapiro@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2273021F64; Fri, 24 Jul 2020 01:25:58 +0000 (UTC) (envelope-from gshapiro@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06O1Pvx8025755; Fri, 24 Jul 2020 01:25:57 GMT (envelope-from gshapiro@FreeBSD.org) Received: (from gshapiro@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06O1PvTx025754; Fri, 24 Jul 2020 01:25:57 GMT (envelope-from gshapiro@FreeBSD.org) Message-Id: <202007240125.06O1PvTx025754@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gshapiro set sender to gshapiro@FreeBSD.org using -f From: Gregory Neil Shapiro Date: Fri, 24 Jul 2020 01:25: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: r363469 - stable/11/release/doc/en_US.ISO8859-1/relnotes X-SVN-Group: stable-11 X-SVN-Commit-Author: gshapiro X-SVN-Commit-Paths: stable/11/release/doc/en_US.ISO8859-1/relnotes X-SVN-Commit-Revision: 363469 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 24 Jul 2020 01:25:58 -0000 Author: gshapiro Date: Fri Jul 24 01:25:57 2020 New Revision: 363469 URL: https://svnweb.freebsd.org/changeset/base/363469 Log: Note the merge of sendmail 8.16.1 from HEAD Modified: stable/11/release/doc/en_US.ISO8859-1/relnotes/article.xml Modified: stable/11/release/doc/en_US.ISO8859-1/relnotes/article.xml ============================================================================== --- stable/11/release/doc/en_US.ISO8859-1/relnotes/article.xml Fri Jul 24 00:47:14 2020 (r363468) +++ stable/11/release/doc/en_US.ISO8859-1/relnotes/article.xml Fri Jul 24 01:25:57 2020 (r363469) @@ -306,6 +306,9 @@ OpenPAM has been updated to the latest upstream version. + + sendmail has + been updated to version 8.16.1. From owner-svn-src-all@freebsd.org Fri Jul 24 08:40:06 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 44AED376107; Fri, 24 Jul 2020 08:40:06 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BCjLt19n5z4DTD; Fri, 24 Jul 2020 08:40:06 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 086872764D; Fri, 24 Jul 2020 08:40:06 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06O8e5Me023896; Fri, 24 Jul 2020 08:40:05 GMT (envelope-from arichardson@FreeBSD.org) Received: (from arichardson@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06O8e4c3023890; Fri, 24 Jul 2020 08:40:04 GMT (envelope-from arichardson@FreeBSD.org) Message-Id: <202007240840.06O8e4c3023890@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arichardson set sender to arichardson@FreeBSD.org using -f From: Alex Richardson Date: Fri, 24 Jul 2020 08:40:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363471 - in head/sys: amd64/conf arm64/conf i386/conf powerpc/conf riscv/conf X-SVN-Group: head X-SVN-Commit-Author: arichardson X-SVN-Commit-Paths: in head/sys: amd64/conf arm64/conf i386/conf powerpc/conf riscv/conf X-SVN-Commit-Revision: 363471 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 24 Jul 2020 08:40:06 -0000 Author: arichardson Date: Fri Jul 24 08:40:04 2020 New Revision: 363471 URL: https://svnweb.freebsd.org/changeset/base/363471 Log: Include TMPFS in all the GENERIC kernel configs Being able to use tmpfs without kernel modules is very useful when building small MFS_ROOT kernels without a real file system. Including TMPFS also matches arm/GENERIC and the MIPS std.MALTA configs. Compiling TMPFS only adds 4 .c files so this should not make much of a difference to NO_MODULES build times (as we do for our minimal RISC-V images). Reviewed By: br (earlier version for riscv), brooks, emaste Differential Revision: https://reviews.freebsd.org/D25317 Modified: head/sys/amd64/conf/GENERIC head/sys/arm64/conf/GENERIC head/sys/i386/conf/GENERIC head/sys/powerpc/conf/GENERIC head/sys/powerpc/conf/GENERIC64 head/sys/riscv/conf/GENERIC Modified: head/sys/amd64/conf/GENERIC ============================================================================== --- head/sys/amd64/conf/GENERIC Fri Jul 24 02:19:00 2020 (r363470) +++ head/sys/amd64/conf/GENERIC Fri Jul 24 08:40:04 2020 (r363471) @@ -51,6 +51,7 @@ options MSDOSFS # MSDOS Filesystem options CD9660 # ISO 9660 Filesystem options PROCFS # Process filesystem (requires PSEUDOFS) options PSEUDOFS # Pseudo-filesystem framework +options TMPFS # Efficient memory filesystem options GEOM_RAID # Soft RAID functionality. options GEOM_LABEL # Provides labelization options EFIRT # EFI Runtime Services support Modified: head/sys/arm64/conf/GENERIC ============================================================================== --- head/sys/arm64/conf/GENERIC Fri Jul 24 02:19:00 2020 (r363470) +++ head/sys/arm64/conf/GENERIC Fri Jul 24 08:40:04 2020 (r363471) @@ -50,6 +50,7 @@ options MSDOSFS # MSDOS Filesystem options CD9660 # ISO 9660 Filesystem options PROCFS # Process filesystem (requires PSEUDOFS) options PSEUDOFS # Pseudo-filesystem framework +options TMPFS # Efficient memory filesystem options GEOM_RAID # Soft RAID functionality. options GEOM_LABEL # Provides labelization options COMPAT_FREEBSD32 # Compatible with FreeBSD/arm Modified: head/sys/i386/conf/GENERIC ============================================================================== --- head/sys/i386/conf/GENERIC Fri Jul 24 02:19:00 2020 (r363470) +++ head/sys/i386/conf/GENERIC Fri Jul 24 08:40:04 2020 (r363471) @@ -50,6 +50,7 @@ options MSDOSFS # MSDOS Filesystem options CD9660 # ISO 9660 Filesystem options PROCFS # Process filesystem (requires PSEUDOFS) options PSEUDOFS # Pseudo-filesystem framework +options TMPFS # Efficient memory filesystem options GEOM_RAID # Soft RAID functionality. options GEOM_LABEL # Provides labelization options COMPAT_FREEBSD4 # Compatible with FreeBSD4 Modified: head/sys/powerpc/conf/GENERIC ============================================================================== --- head/sys/powerpc/conf/GENERIC Fri Jul 24 02:19:00 2020 (r363470) +++ head/sys/powerpc/conf/GENERIC Fri Jul 24 08:40:04 2020 (r363471) @@ -57,6 +57,7 @@ options MSDOSFS #MSDOS Filesystem options CD9660 #ISO 9660 Filesystem options PROCFS #Process filesystem (requires PSEUDOFS) options PSEUDOFS #Pseudo-filesystem framework +options TMPFS #Efficient memory filesystem options GEOM_PART_APM #Apple Partition Maps. options GEOM_PART_GPT #GUID Partition Tables. options GEOM_LABEL #Provides labelization Modified: head/sys/powerpc/conf/GENERIC64 ============================================================================== --- head/sys/powerpc/conf/GENERIC64 Fri Jul 24 02:19:00 2020 (r363470) +++ head/sys/powerpc/conf/GENERIC64 Fri Jul 24 08:40:04 2020 (r363471) @@ -62,6 +62,7 @@ options MSDOSFS #MSDOS Filesystem options CD9660 #ISO 9660 Filesystem options PROCFS #Process filesystem (requires PSEUDOFS) options PSEUDOFS #Pseudo-filesystem framework +options TMPFS #Efficient memory filesystem options GEOM_PART_APM #Apple Partition Maps. options GEOM_PART_GPT #GUID Partition Tables. options GEOM_LABEL #Provides labelization Modified: head/sys/riscv/conf/GENERIC ============================================================================== --- head/sys/riscv/conf/GENERIC Fri Jul 24 02:19:00 2020 (r363470) +++ head/sys/riscv/conf/GENERIC Fri Jul 24 08:40:04 2020 (r363471) @@ -47,6 +47,7 @@ options MSDOSFS # MSDOS Filesystem options CD9660 # ISO 9660 Filesystem options PROCFS # Process filesystem (requires PSEUDOFS) options PSEUDOFS # Pseudo-filesystem framework +options TMPFS # Efficient memory filesystem options GEOM_PART_GPT # GUID Partition Tables. options GEOM_RAID # Soft RAID functionality. options GEOM_LABEL # Provides labelization From owner-svn-src-all@freebsd.org Fri Jul 24 13:23:33 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 494E2365566; Fri, 24 Jul 2020 13:23:33 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BCqdx1Bd7z4WMh; Fri, 24 Jul 2020 13:23: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 0C2A8B215; Fri, 24 Jul 2020 13:23: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 06ODNWvg008517; Fri, 24 Jul 2020 13:23:32 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06ODNWUr008515; Fri, 24 Jul 2020 13:23:32 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202007241323.06ODNWUr008515@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Fri, 24 Jul 2020 13:23:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363472 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 363472 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 24 Jul 2020 13:23:33 -0000 Author: mjg Date: Fri Jul 24 13:23:32 2020 New Revision: 363472 URL: https://svnweb.freebsd.org/changeset/base/363472 Log: vm: fix swap reservation leak and clean up surrounding code The code did not subtract from the global counter if per-uid reservation failed. Cleanup highlights: - load overcommit once - move per-uid manipulation to dedicated routines - don't fetch wire count if requested size is below the limit - convert return type from int to bool - ifdef the routines with _KERNEL to keep vm.h compilable by userspace Reviewed by: kib (previous version) Differential Revision: https://reviews.freebsd.org/D25787 Modified: head/sys/vm/swap_pager.c head/sys/vm/vm.h Modified: head/sys/vm/swap_pager.c ============================================================================== --- head/sys/vm/swap_pager.c Fri Jul 24 08:40:04 2020 (r363471) +++ head/sys/vm/swap_pager.c Fri Jul 24 13:23:32 2020 (r363472) @@ -202,101 +202,141 @@ sysctl_page_shift(SYSCTL_HANDLER_ARGS) return (sysctl_handle_64(oidp, &newval, 0, req)); } -int +static bool +swap_reserve_by_cred_rlimit(u_long pincr, struct ucred *cred, int oc) +{ + struct uidinfo *uip; + u_long prev; + + uip = cred->cr_ruidinfo; + + prev = atomic_fetchadd_long(&uip->ui_vmsize, pincr); + if ((oc & SWAP_RESERVE_RLIMIT_ON) != 0 && + prev + pincr > lim_cur(curthread, RLIMIT_SWAP) && + priv_check(curthread, PRIV_VM_SWAP_NORLIMIT) != 0) { + prev = atomic_fetchadd_long(&uip->ui_vmsize, -pincr); + KASSERT(prev >= pincr, ("negative vmsize for uid = %d\n", uip->ui_uid)); + return (false); + } + return (true); +} + +static void +swap_release_by_cred_rlimit(u_long pdecr, struct ucred *cred) +{ + struct uidinfo *uip; +#ifdef INVARIANTS + u_long prev; +#endif + + uip = cred->cr_ruidinfo; + +#ifdef INVARIANTS + prev = atomic_fetchadd_long(&uip->ui_vmsize, -pdecr); + KASSERT(prev >= pdecr, ("negative vmsize for uid = %d\n", uip->ui_uid)); +#else + atomic_subtract_long(&uip->ui_vmsize, pdecr); +#endif +} + +static void +swap_reserve_force_rlimit(u_long pincr, struct ucred *cred) +{ + struct uidinfo *uip; + + uip = cred->cr_ruidinfo; + atomic_add_long(&uip->ui_vmsize, pincr); +} + +bool swap_reserve(vm_ooffset_t incr) { return (swap_reserve_by_cred(incr, curthread->td_ucred)); } -int +bool swap_reserve_by_cred(vm_ooffset_t incr, struct ucred *cred) { u_long r, s, prev, pincr; - int res, error; +#ifdef RACCT + int error; +#endif + int oc; static int curfail; static struct timeval lastfail; - struct uidinfo *uip; - uip = cred->cr_ruidinfo; - KASSERT((incr & PAGE_MASK) == 0, ("%s: incr: %ju & PAGE_MASK", __func__, (uintmax_t)incr)); #ifdef RACCT - if (racct_enable) { + if (RACCT_ENABLED()) { PROC_LOCK(curproc); error = racct_add(curproc, RACCT_SWAP, incr); PROC_UNLOCK(curproc); if (error != 0) - return (0); + return (false); } #endif pincr = atop(incr); - res = 0; prev = atomic_fetchadd_long(&swap_reserved, pincr); r = prev + pincr; - if (overcommit & SWAP_RESERVE_ALLOW_NONWIRED) { - s = vm_cnt.v_page_count - vm_cnt.v_free_reserved - + s = swap_total; + oc = atomic_load_int(&overcommit); + if (r > s && (oc & SWAP_RESERVE_ALLOW_NONWIRED) != 0) { + s += vm_cnt.v_page_count - vm_cnt.v_free_reserved - vm_wire_count(); - } else - s = 0; - s += swap_total; - if ((overcommit & SWAP_RESERVE_FORCE_ON) == 0 || r <= s || - (error = priv_check(curthread, PRIV_VM_SWAP_NOQUOTA)) == 0) { - res = 1; - } else { + } + if ((oc & SWAP_RESERVE_FORCE_ON) != 0 && r > s && + priv_check(curthread, PRIV_VM_SWAP_NOQUOTA) != 0) { prev = atomic_fetchadd_long(&swap_reserved, -pincr); - if (prev < pincr) - panic("swap_reserved < incr on overcommit fail"); + KASSERT(prev >= pincr, ("swap_reserved < incr on overcommit fail")); + goto out_error; } - if (res) { - prev = atomic_fetchadd_long(&uip->ui_vmsize, pincr); - if ((overcommit & SWAP_RESERVE_RLIMIT_ON) != 0 && - prev + pincr > lim_cur(curthread, RLIMIT_SWAP) && - priv_check(curthread, PRIV_VM_SWAP_NORLIMIT)) { - res = 0; - prev = atomic_fetchadd_long(&uip->ui_vmsize, -pincr); - if (prev < pincr) - panic("uip->ui_vmsize < incr on overcommit fail"); - } + + if (!swap_reserve_by_cred_rlimit(pincr, cred, oc)) { + prev = atomic_fetchadd_long(&swap_reserved, -pincr); + KASSERT(prev >= pincr, ("swap_reserved < incr on overcommit fail")); + goto out_error; } - if (!res && ppsratecheck(&lastfail, &curfail, 1)) { + + return (true); + +out_error: + if (ppsratecheck(&lastfail, &curfail, 1)) { printf("uid %d, pid %d: swap reservation for %jd bytes failed\n", - uip->ui_uid, curproc->p_pid, incr); + cred->cr_ruidinfo->ui_uid, curproc->p_pid, incr); } - #ifdef RACCT - if (racct_enable && !res) { + if (RACCT_ENABLED()) { PROC_LOCK(curproc); racct_sub(curproc, RACCT_SWAP, incr); PROC_UNLOCK(curproc); } #endif - return (res); + return (false); } void swap_reserve_force(vm_ooffset_t incr) { - struct uidinfo *uip; u_long pincr; KASSERT((incr & PAGE_MASK) == 0, ("%s: incr: %ju & PAGE_MASK", __func__, (uintmax_t)incr)); - PROC_LOCK(curproc); #ifdef RACCT - if (racct_enable) + if (RACCT_ENABLED()) { + PROC_LOCK(curproc); racct_add_force(curproc, RACCT_SWAP, incr); + PROC_UNLOCK(curproc); + } #endif pincr = atop(incr); atomic_add_long(&swap_reserved, pincr); - uip = curproc->p_ucred->cr_ruidinfo; - atomic_add_long(&uip->ui_vmsize, pincr); - PROC_UNLOCK(curproc); + swap_reserve_force_rlimit(pincr, curthread->td_ucred); } void @@ -313,22 +353,23 @@ swap_release(vm_ooffset_t decr) void swap_release_by_cred(vm_ooffset_t decr, struct ucred *cred) { - u_long prev, pdecr; - struct uidinfo *uip; + u_long pdecr; +#ifdef INVARIANTS + u_long prev; +#endif - uip = cred->cr_ruidinfo; - KASSERT((decr & PAGE_MASK) == 0, ("%s: decr: %ju & PAGE_MASK", __func__, (uintmax_t)decr)); pdecr = atop(decr); +#ifdef INVARIANTS prev = atomic_fetchadd_long(&swap_reserved, -pdecr); - if (prev < pdecr) - panic("swap_reserved < decr"); + KASSERT(prev >= pdecr, ("swap_reserved < decr")); +#else + atomic_subtract_long(&swap_reserved, pdecr); +#endif - prev = atomic_fetchadd_long(&uip->ui_vmsize, -pdecr); - if (prev < pdecr) - printf("negative vmsize for uid = %d\n", uip->ui_uid); + swap_release_by_cred_rlimit(pdecr, cred); #ifdef RACCT if (racct_enable) racct_sub_cred(cred, RACCT_SWAP, decr); Modified: head/sys/vm/vm.h ============================================================================== --- head/sys/vm/vm.h Fri Jul 24 08:40:04 2020 (r363471) +++ head/sys/vm/vm.h Fri Jul 24 13:23:32 2020 (r363472) @@ -150,13 +150,15 @@ extern int old_mlock; extern int vm_ndomains; +#ifdef _KERNEL struct ucred; -int swap_reserve(vm_ooffset_t incr); -int swap_reserve_by_cred(vm_ooffset_t incr, struct ucred *cred); +bool swap_reserve(vm_ooffset_t incr); +bool swap_reserve_by_cred(vm_ooffset_t incr, struct ucred *cred); void swap_reserve_force(vm_ooffset_t incr); void swap_release(vm_ooffset_t decr); void swap_release_by_cred(vm_ooffset_t decr, struct ucred *cred); void swapper(void); +#endif #endif /* VM_H */ From owner-svn-src-all@freebsd.org Fri Jul 24 14:17:37 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B4C8F367DB1; Fri, 24 Jul 2020 14:17:37 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BCrrK4Kdgz4ZmV; Fri, 24 Jul 2020 14:17:37 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 78B22B6CA; Fri, 24 Jul 2020 14:17:37 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06OEHb0j040501; Fri, 24 Jul 2020 14:17:37 GMT (envelope-from 0mp@FreeBSD.org) Received: (from 0mp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06OEHb5o040500; Fri, 24 Jul 2020 14:17:37 GMT (envelope-from 0mp@FreeBSD.org) Message-Id: <202007241417.06OEHb5o040500@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: 0mp set sender to 0mp@FreeBSD.org using -f From: Mateusz Piotrowski <0mp@FreeBSD.org> Date: Fri, 24 Jul 2020 14:17:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363473 - head/share/man/man8 X-SVN-Group: head X-SVN-Commit-Author: 0mp X-SVN-Commit-Paths: head/share/man/man8 X-SVN-Commit-Revision: 363473 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 24 Jul 2020 14:17:37 -0000 Author: 0mp (doc,ports committer) Date: Fri Jul 24 14:17:37 2020 New Revision: 363473 URL: https://svnweb.freebsd.org/changeset/base/363473 Log: Document that force_depend() supports only /etc/rc.d scripts Currently, force_depend() from rc.subr(8) does not support depending on scripts outside of /etc/rc.d (like /usr/local/etc/rc.d). The /etc/rc.d path is hard-coded into force_depend(). MFC after: 1 week Modified: head/share/man/man8/rc.subr.8 Modified: head/share/man/man8/rc.subr.8 ============================================================================== --- head/share/man/man8/rc.subr.8 Fri Jul 24 13:23:32 2020 (r363472) +++ head/share/man/man8/rc.subr.8 Fri Jul 24 14:17:37 2020 (r363473) @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 5, 2019 +.Dd July 24, 2020 .Dt RC.SUBR 8 .Os .Sh NAME @@ -237,8 +237,13 @@ The .Ar name argument is the .Xr basename 1 -component of the path to the script, usually -.Pa /etc/rc.d/name . +component of the path to the script located at +.Pa /etc/rc.d +(scripts stored in other locations like +.Pa /usr/local/etc/rc.d +cannot be contolled with +.Ic force_depend +currently). If the script fails for any reason it will output a warning and return with a return value of 1. If it was successful From owner-svn-src-all@freebsd.org Fri Jul 24 14:38:12 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7C5AA3685B3 for ; Fri, 24 Jul 2020 14:38:12 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound5a.ore.mailhop.org (outbound5a.ore.mailhop.org [44.233.67.66]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4BCsJ3681dz4byQ for ; Fri, 24 Jul 2020 14:38:11 +0000 (UTC) (envelope-from ian@freebsd.org) ARC-Seal: i=1; a=rsa-sha256; t=1595601485; cv=none; d=outbound.mailhop.org; s=arc-outbound20181012; b=EnwqWcRkFI/ao5ioFwPz7kFhBct6nc/BGAN5r4K/++V2KVwIE/pNi5UtvNtITNNgFzcJuJV5Q1Ost ZBruKTwS+dh/VV1B++kOb1stwvHVGgyJF2R1lvnVOkMzNmBdCXxTqDuarc7g3DTfL6hjKn98F/YZxu wgkEESuWY7gOFemssXswhMGJodV2b2kz7bvbj8PWAUPG2jt7O6lykHfQp2dWI3s5oghetZaQ1HxKVt AXtnjJOovF4WrR75l7G282B6jyvUYgfyhDNlH4tmnXA1uwl7Sei4CYSPWztlIKBjor5SEgLg/we0ZN 7Iq4PNKUijhdqljOg6h5PLHPJ4adQQQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=arc-outbound20181012; h=content-transfer-encoding:mime-version:content-type:references:in-reply-to: date:to:from:subject:message-id:dkim-signature:from; bh=tewp3R+HBkMwrftQuKAcvza52G7qoCteA9Erzma1T5E=; b=l+eO/WgKjmcwUX539rTOAq+4YP4UEg2klBGaN2oECAvVrtc17pYL/KHY7dzoRKb5fvjVeUY9XFKYZ x+hk4un+xnhaiC3o1uFSJSJfM423oHBPpHfatEQ38HG2ak7pPvYzQrugwiCOjDHcos0ma7e6O3o2CJ Vlm3WtlcG9VKkprwTl3nFQmdAyXWAtz+5cdqIe8EJb5ar6vDDgZ0RPBMh5XWgGy8bN7TMwUMzcQCuk jOHJR2ZbzY7WzZYaoih8PGNZT8L1v7R4NG8qC97zdO7C900sVFiJbEfiKbwpCSHHUCH8mkp0X3DKes jqcD6g/hCiEbIDkq15+M1hb0oNNhS9A== ARC-Authentication-Results: i=1; outbound3.ore.mailhop.org; spf=softfail smtp.mailfrom=freebsd.org smtp.remote-ip=67.177.211.60; dmarc=none header.from=freebsd.org; arc=none header.oldest-pass=0; DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=dkim-high; h=content-transfer-encoding:mime-version:content-type:references:in-reply-to: date:to:from:subject:message-id:from; bh=tewp3R+HBkMwrftQuKAcvza52G7qoCteA9Erzma1T5E=; b=abJjmEsTs++z0WoXG2oabwryxNpA0KphS/BqIvp6DiEMinfD289VWRSJd+ZM8PdoAYBsd0Hk1JPr6 q3XMob08hm0Kp/f7THkBlEQgum3EI2DzPsGdYUUcYIq+QTz23sxUxaJu38nuOLSYBdnJcuL7+98RP2 z0Pz1mbKrkxuHyr3hP4vDeOjrX8VgRoh8xtaQuc7wCcW6In/MmRMRxj7pgrnPt7ah1UjuUX25dYI71 AghO9r6APv/JunheR9aL5tV3lD4bRi/JoD78BDo0pK7NIXF0JrOEWcPeZzS+wYOJlFCJjzUheDqNEP JXajKVTdFMEOZXfOqIxFA69tiCL+lZg== X-MHO-RoutePath: aGlwcGll X-MHO-User: 471ff6fb-cdbb-11ea-a2ba-9f0c275c2f69 X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 67.177.211.60 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (c-67-177-211-60.hsd1.co.comcast.net [67.177.211.60]) by outbound3.ore.mailhop.org (Halon) with ESMTPSA id 471ff6fb-cdbb-11ea-a2ba-9f0c275c2f69; Fri, 24 Jul 2020 14:38:03 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id 06OEc2vP087395; Fri, 24 Jul 2020 08:38:02 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: <15ccc289072db724ab5a8ac4efa9be5d456040ee.camel@freebsd.org> Subject: Re: svn commit: r363473 - head/share/man/man8 From: Ian Lepore To: Mateusz Piotrowski <0mp@FreeBSD.org>, src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Fri, 24 Jul 2020 08:38:02 -0600 In-Reply-To: <202007241417.06OEHb5o040500@repo.freebsd.org> References: <202007241417.06OEHb5o040500@repo.freebsd.org> Content-Type: text/plain; charset="ASCII" X-Mailer: Evolution 3.28.5 FreeBSD GNOME Team Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4BCsJ3681dz4byQ X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [0.00 / 15.00]; local_wl_from(0.00)[freebsd.org]; ASN(0.00)[asn:16509, ipnet:44.224.0.0/11, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Jul 2020 14:38:12 -0000 On Fri, 2020-07-24 at 14:17 +0000, Mateusz Piotrowski wrote: > Author: 0mp (doc,ports committer) > Date: Fri Jul 24 14:17:37 2020 > New Revision: 363473 > URL: https://svnweb.freebsd.org/changeset/base/363473 > > [...] > @@ -237,8 +237,13 @@ The > .Ar name > argument is the > .Xr basename 1 > -component of the path to the script, usually > -.Pa /etc/rc.d/name . > +component of the path to the script located at > +.Pa /etc/rc.d > +(scripts stored in other locations like grammar: "like" should be "such as" > +.Pa /usr/local/etc/rc.d > +cannot be contolled with typo: controlled -- Ian From owner-svn-src-all@freebsd.org Fri Jul 24 14:51:28 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E0DF4368EA4; Fri, 24 Jul 2020 14:51:28 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BCsbN5dJNz4cWp; Fri, 24 Jul 2020 14:51:28 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A4761BFBF; Fri, 24 Jul 2020 14:51:28 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06OEpSD3061927; Fri, 24 Jul 2020 14:51:28 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06OEpSot061925; Fri, 24 Jul 2020 14:51:28 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202007241451.06OEpSot061925@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Fri, 24 Jul 2020 14:51:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r363474 - stable/12/contrib/netcat X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/12/contrib/netcat X-SVN-Commit-Revision: 363474 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 24 Jul 2020 14:51:28 -0000 Author: markj Date: Fri Jul 24 14:51:28 2020 New Revision: 363474 URL: https://svnweb.freebsd.org/changeset/base/363474 Log: MFC r363084: Add a --sctp flag to nc. Modified: stable/12/contrib/netcat/nc.1 stable/12/contrib/netcat/netcat.c Directory Properties: stable/12/ (props changed) Modified: stable/12/contrib/netcat/nc.1 ============================================================================== --- stable/12/contrib/netcat/nc.1 Fri Jul 24 14:17:37 2020 (r363473) +++ stable/12/contrib/netcat/nc.1 Fri Jul 24 14:51:28 2020 (r363474) @@ -41,6 +41,7 @@ .Op Fl I Ar length .Op Fl i Ar interval .Op Fl -no-tcpopt +.Op Fl -sctp .Op Fl O Ar length .Op Fl P Ar proxy_username .Op Fl p Ar source_port @@ -181,6 +182,8 @@ hostnames or ports. Disables the use of TCP options on the socket, by setting the boolean TCP_NOOPT socket option. +.It Fl -sctp +Use SCTP instead of the default option of TCP. .It Fl O Ar length Specifies the size of the TCP send buffer. .It Fl P Ar proxy_username Modified: stable/12/contrib/netcat/netcat.c ============================================================================== --- stable/12/contrib/netcat/netcat.c Fri Jul 24 14:17:37 2020 (r363473) +++ stable/12/contrib/netcat/netcat.c Fri Jul 24 14:51:28 2020 (r363474) @@ -88,6 +88,7 @@ int lflag; /* Bind to local port */ int Nflag; /* shutdown() network socket */ int nflag; /* Don't do name look up */ int FreeBSD_Oflag; /* Do not use TCP options */ +int FreeBSD_sctp; /* Use SCTP */ char *Pflag; /* Proxy username */ char *pflag; /* Localport flag */ int rflag; /* Random ports flag */ @@ -153,6 +154,7 @@ main(int argc, char *argv[]) char unix_dg_tmp_socket_buf[UNIX_DG_TMP_SOCKET_SIZE]; struct option longopts[] = { { "no-tcpopt", no_argument, &FreeBSD_Oflag, 1 }, + { "sctp", no_argument, &FreeBSD_sctp, 1 }, { NULL, 0, NULL, 0 } }; @@ -310,6 +312,9 @@ main(int argc, char *argv[]) if (Tflag < 0 || Tflag > 255 || errstr || errno) errx(1, "illegal tos value %s", optarg); break; + case 0: + /* Long option. */ + break; default: usage(1); } @@ -340,6 +345,12 @@ main(int argc, char *argv[]) errx(1, "cannot use -z and -l"); if (!lflag && kflag) errx(1, "must use -l with -k"); + if (FreeBSD_sctp) { + if (uflag) + errx(1, "cannot use -u and --sctp"); + if (family == AF_UNIX) + errx(1, "cannot use -U and --sctp"); + } /* Get name of temporary socket for unix datagram client */ if ((family == AF_UNIX) && uflag && !lflag) { @@ -359,7 +370,8 @@ main(int argc, char *argv[]) memset(&hints, 0, sizeof(struct addrinfo)); hints.ai_family = family; hints.ai_socktype = uflag ? SOCK_DGRAM : SOCK_STREAM; - hints.ai_protocol = uflag ? IPPROTO_UDP : IPPROTO_TCP; + hints.ai_protocol = uflag ? IPPROTO_UDP : + FreeBSD_sctp ? IPPROTO_SCTP : IPPROTO_TCP; if (nflag) hints.ai_flags |= AI_NUMERICHOST; } @@ -368,6 +380,9 @@ main(int argc, char *argv[]) if (uflag) errx(1, "no proxy support for UDP mode"); + if (FreeBSD_sctp) + errx(1, "no proxy support for SCTP mode"); + if (lflag) errx(1, "no proxy support for listen"); @@ -1330,6 +1345,7 @@ help(void) \t-N Shutdown the network socket after EOF on stdin\n\ \t-n Suppress name/port resolutions\n\ \t--no-tcpopt Disable TCP options\n\ + \t--sctp\t SCTP mode\n\ \t-O length TCP send buffer length\n\ \t-P proxyuser\tUsername for proxy authentication\n\ \t-p port\t Specify local port for remote connects\n\ @@ -1348,7 +1364,7 @@ help(void) \t-z Zero-I/O mode [used for scanning]\n\ Port numbers can be individual or ranges: lo-hi [inclusive]\n"); #ifdef IPSEC - fprintf(stderr, "See ipsec_set_policy(3) for -e argument format\n"); + fprintf(stderr, "\tSee ipsec_set_policy(3) for -e argument format\n"); #endif exit(1); } @@ -1388,6 +1404,7 @@ usage(int ret) #else "usage: nc [-46DdFhklNnrStUuvz] [-I length] [-i interval] [-O length]\n" #endif + "\t [--no-tcpopt] [--sctp]\n" "\t [-P proxy_username] [-p source_port] [-s source] [-T ToS]\n" "\t [-V rtable] [-w timeout] [-X proxy_protocol]\n" "\t [-x proxy_address[:port]] [destination] [port]\n"); From owner-svn-src-all@freebsd.org Fri Jul 24 15:04:34 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id EB990369075; Fri, 24 Jul 2020 15:04:34 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BCstV5ZT0z4dK3; Fri, 24 Jul 2020 15:04:34 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A2B8EC06E; Fri, 24 Jul 2020 15:04:34 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06OF4YpG071651; Fri, 24 Jul 2020 15:04:34 GMT (envelope-from 0mp@FreeBSD.org) Received: (from 0mp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06OF4Yug071650; Fri, 24 Jul 2020 15:04:34 GMT (envelope-from 0mp@FreeBSD.org) Message-Id: <202007241504.06OF4Yug071650@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: 0mp set sender to 0mp@FreeBSD.org using -f From: Mateusz Piotrowski <0mp@FreeBSD.org> Date: Fri, 24 Jul 2020 15:04:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363475 - head/share/man/man8 X-SVN-Group: head X-SVN-Commit-Author: 0mp X-SVN-Commit-Paths: head/share/man/man8 X-SVN-Commit-Revision: 363475 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 24 Jul 2020 15:04:35 -0000 Author: 0mp (doc,ports committer) Date: Fri Jul 24 15:04:34 2020 New Revision: 363475 URL: https://svnweb.freebsd.org/changeset/base/363475 Log: Fix grammar issues and typos Reported by: ian MFC after: 1 week Modified: head/share/man/man8/rc.subr.8 Modified: head/share/man/man8/rc.subr.8 ============================================================================== --- head/share/man/man8/rc.subr.8 Fri Jul 24 14:51:28 2020 (r363474) +++ head/share/man/man8/rc.subr.8 Fri Jul 24 15:04:34 2020 (r363475) @@ -239,9 +239,9 @@ argument is the .Xr basename 1 component of the path to the script located at .Pa /etc/rc.d -(scripts stored in other locations like +(scripts stored in other locations such as .Pa /usr/local/etc/rc.d -cannot be contolled with +cannot be controlled with .Ic force_depend currently). If the script fails for any reason it will output a warning From owner-svn-src-all@freebsd.org Fri Jul 24 16:41:16 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5844F36BA9A; Fri, 24 Jul 2020 16:41:16 +0000 (UTC) (envelope-from gbe@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BCw241jfHz3WHV; Fri, 24 Jul 2020 16:41:16 +0000 (UTC) (envelope-from gbe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1E275D444; Fri, 24 Jul 2020 16:41:16 +0000 (UTC) (envelope-from gbe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06OGfFU4041743; Fri, 24 Jul 2020 16:41:15 GMT (envelope-from gbe@FreeBSD.org) Received: (from gbe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06OGfFUC041742; Fri, 24 Jul 2020 16:41:15 GMT (envelope-from gbe@FreeBSD.org) Message-Id: <202007241641.06OGfFUC041742@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gbe set sender to gbe@FreeBSD.org using -f From: Gordon Bergling Date: Fri, 24 Jul 2020 16:41:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r363476 - stable/12/sbin/mount_nfs X-SVN-Group: stable-12 X-SVN-Commit-Author: gbe X-SVN-Commit-Paths: stable/12/sbin/mount_nfs X-SVN-Commit-Revision: 363476 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 24 Jul 2020 16:41:16 -0000 Author: gbe (doc committer) Date: Fri Jul 24 16:41:15 2020 New Revision: 363476 URL: https://svnweb.freebsd.org/changeset/base/363476 Log: MFC r363288: mount_nfs(8): document alternate form of the gssname option PR: 238506 Submitted by: Greg Veldman Reviewed by: 0mp, bcr (mentor) Approved by: bcr (mentor) Differential Revision: https://reviews.freebsd.org/D25667 Modified: stable/12/sbin/mount_nfs/mount_nfs.8 Directory Properties: stable/12/ (props changed) Modified: stable/12/sbin/mount_nfs/mount_nfs.8 ============================================================================== --- stable/12/sbin/mount_nfs/mount_nfs.8 Fri Jul 24 15:04:34 2020 (r363475) +++ stable/12/sbin/mount_nfs/mount_nfs.8 Fri Jul 24 16:41:15 2020 (r363476) @@ -157,7 +157,16 @@ should be specified without instance or domain and is .Dq "host" , .Dq "nfs" or -.Dq "root" . +.Dq "root" , +although the form +.Sm off +.Aq Ar service +@ +.Aq Ar fqdn +.Sm on +can also be used if the local system's +.Xr gethostname 3 +value does not match the host-based principal in the keytab. .It Cm hard Same as not specifying .Cm soft . From owner-svn-src-all@freebsd.org Fri Jul 24 16:44:36 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 86F4436B869; Fri, 24 Jul 2020 16:44:36 +0000 (UTC) (envelope-from gbe@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BCw5w33B9z3WcH; Fri, 24 Jul 2020 16:44:36 +0000 (UTC) (envelope-from gbe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4B3E4D79A; Fri, 24 Jul 2020 16:44:36 +0000 (UTC) (envelope-from gbe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06OGia63046732; Fri, 24 Jul 2020 16:44:36 GMT (envelope-from gbe@FreeBSD.org) Received: (from gbe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06OGiaRj046731; Fri, 24 Jul 2020 16:44:36 GMT (envelope-from gbe@FreeBSD.org) Message-Id: <202007241644.06OGiaRj046731@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gbe set sender to gbe@FreeBSD.org using -f From: Gordon Bergling Date: Fri, 24 Jul 2020 16:44:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r363477 - stable/12/share/man/man4 X-SVN-Group: stable-12 X-SVN-Commit-Author: gbe X-SVN-Commit-Paths: stable/12/share/man/man4 X-SVN-Commit-Revision: 363477 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 24 Jul 2020 16:44:36 -0000 Author: gbe (doc committer) Date: Fri Jul 24 16:44:35 2020 New Revision: 363477 URL: https://svnweb.freebsd.org/changeset/base/363477 Log: MFC r363287: iwm(4): Document limitations of the driver PR: 247874 Submitted by: Charles Ross Reviewed by: brueffer, markj Approved by: brueffer Differential Revision: https://reviews.freebsd.org/D25666 Modified: stable/12/share/man/man4/iwm.4 Directory Properties: stable/12/ (props changed) Modified: stable/12/share/man/man4/iwm.4 ============================================================================== --- stable/12/share/man/man4/iwm.4 Fri Jul 24 16:41:15 2020 (r363476) +++ stable/12/share/man/man4/iwm.4 Fri Jul 24 16:44:35 2020 (r363477) @@ -105,6 +105,12 @@ For more information on configuring this device, see This driver requires the firmware built with the .Nm iwmfw module to work. +.Pp +Currently, +.Nm +only supports 802.11b and 802.11g modes. +It will not associate to access points that are configured to operate only +in 802.11n or 802.11ac modes. .Sh EXAMPLES Join an existing BSS network (i.e., connect to an access point): .Bd -literal -offset indent From owner-svn-src-all@freebsd.org Fri Jul 24 16:58:14 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 22DD936C22F; Fri, 24 Jul 2020 16:58:14 +0000 (UTC) (envelope-from jmallett@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BCwPf06vPz3Y7J; Fri, 24 Jul 2020 16:58:14 +0000 (UTC) (envelope-from jmallett@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D771ED92D; Fri, 24 Jul 2020 16:58:13 +0000 (UTC) (envelope-from jmallett@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06OGwDL6053909; Fri, 24 Jul 2020 16:58:13 GMT (envelope-from jmallett@FreeBSD.org) Received: (from jmallett@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06OGwDeU053908; Fri, 24 Jul 2020 16:58:13 GMT (envelope-from jmallett@FreeBSD.org) Message-Id: <202007241658.06OGwDeU053908@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jmallett set sender to jmallett@FreeBSD.org using -f From: Juli Mallett Date: Fri, 24 Jul 2020 16:58:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363478 - head/usr.sbin/rwhod X-SVN-Group: head X-SVN-Commit-Author: jmallett X-SVN-Commit-Paths: head/usr.sbin/rwhod X-SVN-Commit-Revision: 363478 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 24 Jul 2020 16:58:14 -0000 Author: jmallett Date: Fri Jul 24 16:58:13 2020 New Revision: 363478 URL: https://svnweb.freebsd.org/changeset/base/363478 Log: Remove reference to nlist(3) missed in SCCS revision 5.26 by mckusick when converting rwhod(8) to using kern.boottime ather than extracting the boot time from kernel memory directly. Reviewed by: imp Modified: head/usr.sbin/rwhod/rwhod.8 Modified: head/usr.sbin/rwhod/rwhod.8 ============================================================================== --- head/usr.sbin/rwhod/rwhod.8 Fri Jul 24 16:44:35 2020 (r363477) +++ head/usr.sbin/rwhod/rwhod.8 Fri Jul 24 16:58:13 2020 (r363478) @@ -215,15 +215,6 @@ format described above. .Pp Status messages are generated approximately once every 3 minutes. -The -.Nm -utility performs an -.Xr nlist 3 -on -.Pa /boot/kernel/kernel -every 30 minutes to guard against -the possibility that this file is not the system -image currently operating. .Sh SEE ALSO .Xr ruptime 1 , .Xr rwho 1 From owner-svn-src-all@freebsd.org Fri Jul 24 17:11:14 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A9A9F36C89D; Fri, 24 Jul 2020 17:11:14 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BCwhf46Zdz3Yxr; Fri, 24 Jul 2020 17:11:14 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 70CDDD576; Fri, 24 Jul 2020 17:11:14 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06OHBEo5065128; Fri, 24 Jul 2020 17:11:14 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06OHBE7g065127; Fri, 24 Jul 2020 17:11:14 GMT (envelope-from manu@FreeBSD.org) Message-Id: <202007241711.06OHBE7g065127@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Fri, 24 Jul 2020 17:11:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363479 - head/sys/cam/mmc X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/cam/mmc X-SVN-Commit-Revision: 363479 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 24 Jul 2020 17:11:14 -0000 Author: manu Date: Fri Jul 24 17:11:14 2020 New Revision: 363479 URL: https://svnweb.freebsd.org/changeset/base/363479 Log: mmccam: Add some aliases for non-mmccam to mmccam transition A new tunable is present, kern.cam.sdda.mmcsd_compat to enable this feature or not (default is enabled) Modified: head/sys/cam/mmc/mmc_da.c Modified: head/sys/cam/mmc/mmc_da.c ============================================================================== --- head/sys/cam/mmc/mmc_da.c Fri Jul 24 16:58:13 2020 (r363478) +++ head/sys/cam/mmc/mmc_da.c Fri Jul 24 17:11:14 2020 (r363479) @@ -43,6 +43,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -186,6 +187,13 @@ static void sdda_init_switch_part(struct cam_periph *p static int mmc_select_card(struct cam_periph *periph, union ccb *ccb, uint32_t rca); static inline uint32_t mmc_get_sector_size(struct cam_periph *periph) {return MMC_SECTOR_SIZE;} +static SYSCTL_NODE(_kern_cam, OID_AUTO, sdda, CTLFLAG_RD | CTLFLAG_MPSAFE, 0, + "CAM Direct Access Disk driver"); + +static int sdda_mmcsd_compat = 1; +SYSCTL_INT(_kern_cam_sdda, OID_AUTO, mmcsd_compat, CTLFLAG_RDTUN, + &sdda_mmcsd_compat, 1, "Enable creation of mmcsd aliases."); + /* TODO: actually issue GET_TRAN_SETTINGS to get R/O status */ static inline bool sdda_get_read_only(struct cam_periph *periph, union ccb *start_ccb) { @@ -1604,6 +1612,9 @@ sdda_add_part(struct cam_periph *periph, u_int type, c part->disk->d_stripesize = 0; part->disk->d_fwsectors = 0; part->disk->d_fwheads = 0; + + if (sdda_mmcsd_compat) + disk_add_alias(part->disk, "mmcsd"); /* * Acquire a reference to the periph before we register with GEOM. From owner-svn-src-all@freebsd.org Fri Jul 24 17:28:25 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1F73D36D05D; Fri, 24 Jul 2020 17:28:25 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BCx4T03Vzz3bHf; Fri, 24 Jul 2020 17:28:25 +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 D9464DD6D; Fri, 24 Jul 2020 17:28:24 +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 06OHSOxJ073602; Fri, 24 Jul 2020 17:28:24 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06OHSObm073601; Fri, 24 Jul 2020 17:28:24 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202007241728.06OHSObm073601@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Fri, 24 Jul 2020 17:28:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363480 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 363480 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 24 Jul 2020 17:28:25 -0000 Author: mjg Date: Fri Jul 24 17:28:24 2020 New Revision: 363480 URL: https://svnweb.freebsd.org/changeset/base/363480 Log: lockmgr: add missing 'continue' to account for spuriously failed fcmpset PR: 248245 Reported by: gbe Noted by: markj Fixes by: r363415 ("lockmgr: add adaptive spinning") Modified: head/sys/kern/kern_lock.c Modified: head/sys/kern/kern_lock.c ============================================================================== --- head/sys/kern/kern_lock.c Fri Jul 24 17:11:14 2020 (r363479) +++ head/sys/kern/kern_lock.c Fri Jul 24 17:28:24 2020 (r363480) @@ -836,6 +836,7 @@ lockmgr_xlock_hard(struct lock *lk, u_int flags, struc if (x == LK_UNLOCKED) { if (atomic_fcmpset_acq_ptr(&lk->lk_lock, &x, tid)) break; + continue; } if ((flags & (LK_ADAPTIVE | LK_INTERLOCK)) == LK_ADAPTIVE) { if (lockmgr_xlock_adaptive(&lda, lk, &x)) From owner-svn-src-all@freebsd.org Fri Jul 24 17:32:10 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DC70B36D4AF; Fri, 24 Jul 2020 17:32:10 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BCx8p5x2wz3bx5; Fri, 24 Jul 2020 17:32:10 +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 949DDE231; Fri, 24 Jul 2020 17:32:10 +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 06OHWA6v077567; Fri, 24 Jul 2020 17:32:10 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06OHWAp5077565; Fri, 24 Jul 2020 17:32:10 GMT (envelope-from cem@FreeBSD.org) Message-Id: <202007241732.06OHWAp5077565@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Fri, 24 Jul 2020 17:32:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363481 - in head/sys: kern sys X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: in head/sys: kern sys X-SVN-Commit-Revision: 363481 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 24 Jul 2020 17:32:10 -0000 Author: cem Date: Fri Jul 24 17:32:10 2020 New Revision: 363481 URL: https://svnweb.freebsd.org/changeset/base/363481 Log: Use SMR to provide safe unlocked lookup for pctries from SMR zones Adapt r358130, for the almost identical vm_radix, to the pctrie subsystem. Like that change, the tree is kept correct for readers with store barriers and careful ordering. Existing locks serialize writers. Add a PCTRIE_DEFINE_SMR() wrapper that takes an additional smr_t parameter and instantiates a FOO_PCTRIE_LOOKUP_UNLOCKED() function, in addition to the usual definitions created by PCTRIE_DEFINE(). Interface consumers will be introduced in later commits. As future work, it might be nice to add vm_radix algorithms missing from generic pctrie to the pctrie interface, and then adapt vm_radix to use pctrie. Reported by: Attilio Reviewed by: markj Sponsored by: Isilon Differential Revision: https://reviews.freebsd.org/D25781 Modified: head/sys/kern/subr_pctrie.c head/sys/sys/pctrie.h Modified: head/sys/kern/subr_pctrie.c ============================================================================== --- head/sys/kern/subr_pctrie.c Fri Jul 24 17:28:24 2020 (r363480) +++ head/sys/kern/subr_pctrie.c Fri Jul 24 17:32:10 2020 (r363481) @@ -55,6 +55,9 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include /* smr.h depends on struct thread. */ +#include +#include #ifdef DDB #include @@ -72,18 +75,27 @@ __FBSDID("$FreeBSD$"); #define PCTRIE_UNITLEVEL(lev) \ ((uint64_t)1 << ((lev) * PCTRIE_WIDTH)) +struct pctrie_node; +typedef SMR_POINTER(struct pctrie_node *) smr_pctnode_t; + struct pctrie_node { - uint64_t pn_owner; /* Owner of record. */ - uint16_t pn_count; /* Valid children. */ - uint16_t pn_clev; /* Current level. */ - void *pn_child[PCTRIE_COUNT]; /* Child nodes. */ + uint64_t pn_owner; /* Owner of record. */ + uint16_t pn_count; /* Valid children. */ + uint8_t pn_clev; /* Current level. */ + int8_t pn_last; /* Zero last ptr. */ + smr_pctnode_t pn_child[PCTRIE_COUNT]; /* Child nodes. */ }; +enum pctrie_access { PCTRIE_SMR, PCTRIE_LOCKED, PCTRIE_UNSERIALIZED }; + +static __inline void pctrie_node_store(smr_pctnode_t *p, void *val, + enum pctrie_access access); + /* * Allocate a node. Pre-allocation should ensure that the request * will always be satisfied. */ -static __inline struct pctrie_node * +static struct pctrie_node * pctrie_node_get(struct pctrie *ptree, pctrie_alloc_t allocfn, uint64_t owner, uint16_t count, uint16_t clevel) { @@ -92,10 +104,20 @@ pctrie_node_get(struct pctrie *ptree, pctrie_alloc_t a node = allocfn(ptree); if (node == NULL) return (NULL); + + /* + * We want to clear the last child pointer after the final section + * has exited so lookup can not return false negatives. It is done + * here because it will be cache-cold in the dtor callback. + */ + if (node->pn_last != 0) { + pctrie_node_store(&node->pn_child[node->pn_last - 1], NULL, + PCTRIE_UNSERIALIZED); + node->pn_last = 0; + } node->pn_owner = owner; node->pn_count = count; node->pn_clev = clevel; - return (node); } @@ -104,7 +126,7 @@ pctrie_node_get(struct pctrie *ptree, pctrie_alloc_t a */ static __inline void pctrie_node_put(struct pctrie *ptree, struct pctrie_node *node, - pctrie_free_t freefn) + pctrie_free_t freefn, int8_t last) { #ifdef INVARIANTS int slot; @@ -112,10 +134,14 @@ pctrie_node_put(struct pctrie *ptree, struct pctrie_no KASSERT(node->pn_count == 0, ("pctrie_node_put: node %p has %d children", node, node->pn_count)); - for (slot = 0; slot < PCTRIE_COUNT; slot++) - KASSERT(node->pn_child[slot] == NULL, - ("pctrie_node_put: node %p has a child", node)); + for (slot = 0; slot < PCTRIE_COUNT; slot++) { + if (slot == last) + continue; + KASSERT(smr_unserialized_load(&node->pn_child[slot], true) == + NULL, ("pctrie_node_put: node %p has a child", node)); + } #endif + node->pn_last = last + 1; freefn(ptree, node); } @@ -144,23 +170,58 @@ pctrie_trimkey(uint64_t index, uint16_t level) } /* - * Get the root node for a tree. + * Fetch a node pointer from a slot. */ static __inline struct pctrie_node * -pctrie_getroot(struct pctrie *ptree) +pctrie_node_load(smr_pctnode_t *p, smr_t smr, enum pctrie_access access) { + switch (access) { + case PCTRIE_UNSERIALIZED: + return (smr_unserialized_load(p, true)); + case PCTRIE_LOCKED: + return (smr_serialized_load(p, true)); + case PCTRIE_SMR: + return (smr_entered_load(p, smr)); + } + __assert_unreachable(); +} - return ((struct pctrie_node *)ptree->pt_root); +static __inline void +pctrie_node_store(smr_pctnode_t *p, void *v, enum pctrie_access access) +{ + switch (access) { + case PCTRIE_UNSERIALIZED: + smr_unserialized_store(p, v, true); + break; + case PCTRIE_LOCKED: + smr_serialized_store(p, v, true); + break; + case PCTRIE_SMR: + panic("%s: Not supported in SMR section.", __func__); + break; + default: + __assert_unreachable(); + break; + } } /* + * Get the root node for a tree. + */ +static __inline struct pctrie_node * +pctrie_root_load(struct pctrie *ptree, smr_t smr, enum pctrie_access access) +{ + return (pctrie_node_load((smr_pctnode_t *)&ptree->pt_root, smr, access)); +} + +/* * Set the root node for a tree. */ static __inline void -pctrie_setroot(struct pctrie *ptree, struct pctrie_node *node) +pctrie_root_store(struct pctrie *ptree, struct pctrie_node *node, + enum pctrie_access access) { - - ptree->pt_root = (uintptr_t)node; + pctrie_node_store((smr_pctnode_t *)&ptree->pt_root, node, access); } /* @@ -188,12 +249,13 @@ pctrie_toval(struct pctrie_node *node) */ static __inline void pctrie_addval(struct pctrie_node *node, uint64_t index, uint16_t clev, - uint64_t *val) + uint64_t *val, enum pctrie_access access) { int slot; slot = pctrie_slot(index, clev); - node->pn_child[slot] = (void *)((uintptr_t)val | PCTRIE_ISLEAF); + pctrie_node_store(&node->pn_child[slot], + (void *)((uintptr_t)val | PCTRIE_ISLEAF), access); } /* @@ -237,20 +299,23 @@ static void pctrie_reclaim_allnodes_int(struct pctrie *ptree, struct pctrie_node *node, pctrie_free_t freefn) { + struct pctrie_node *child; int slot; KASSERT(node->pn_count <= PCTRIE_COUNT, ("pctrie_reclaim_allnodes_int: bad count in node %p", node)); for (slot = 0; node->pn_count != 0; slot++) { - if (node->pn_child[slot] == NULL) + child = pctrie_node_load(&node->pn_child[slot], NULL, + PCTRIE_UNSERIALIZED); + if (child == NULL) continue; - if (!pctrie_isleaf(node->pn_child[slot])) - pctrie_reclaim_allnodes_int(ptree, - node->pn_child[slot], freefn); - node->pn_child[slot] = NULL; + if (!pctrie_isleaf(child)) + pctrie_reclaim_allnodes_int(ptree, child, freefn); + pctrie_node_store(&node->pn_child[slot], NULL, + PCTRIE_UNSERIALIZED); node->pn_count--; } - pctrie_node_put(ptree, node, freefn); + pctrie_node_put(ptree, node, freefn, -1); } /* @@ -262,6 +327,7 @@ pctrie_zone_init(void *mem, int size __unused, int fla struct pctrie_node *node; node = mem; + node->pn_last = 0; memset(node->pn_child, 0, sizeof(node->pn_child)); return (0); } @@ -281,8 +347,8 @@ int pctrie_insert(struct pctrie *ptree, uint64_t *val, pctrie_alloc_t allocfn) { uint64_t index, newind; - void **parentp; struct pctrie_node *node, *tmp; + smr_pctnode_t *parentp; uint64_t *m; int slot; uint16_t clev; @@ -293,12 +359,12 @@ pctrie_insert(struct pctrie *ptree, uint64_t *val, pct * The owner of record for root is not really important because it * will never be used. */ - node = pctrie_getroot(ptree); + node = pctrie_root_load(ptree, NULL, PCTRIE_LOCKED); if (node == NULL) { ptree->pt_root = (uintptr_t)val | PCTRIE_ISLEAF; return (0); } - parentp = (void **)&ptree->pt_root; + parentp = (smr_pctnode_t *)&ptree->pt_root; for (;;) { if (pctrie_isleaf(node)) { m = pctrie_toval(node); @@ -310,20 +376,25 @@ pctrie_insert(struct pctrie *ptree, uint64_t *val, pct pctrie_trimkey(index, clev + 1), 2, clev); if (tmp == NULL) return (ENOMEM); - *parentp = tmp; - pctrie_addval(tmp, index, clev, val); - pctrie_addval(tmp, *m, clev, m); + /* These writes are not yet visible due to ordering. */ + pctrie_addval(tmp, index, clev, val, + PCTRIE_UNSERIALIZED); + pctrie_addval(tmp, *m, clev, m, PCTRIE_UNSERIALIZED); + /* Synchronize to make leaf visible. */ + pctrie_node_store(parentp, tmp, PCTRIE_LOCKED); return (0); } else if (pctrie_keybarr(node, index)) break; slot = pctrie_slot(index, node->pn_clev); - if (node->pn_child[slot] == NULL) { + parentp = &node->pn_child[slot]; + tmp = pctrie_node_load(parentp, NULL, PCTRIE_LOCKED); + if (tmp == NULL) { node->pn_count++; - pctrie_addval(node, index, node->pn_clev, val); + pctrie_addval(node, index, node->pn_clev, val, + PCTRIE_LOCKED); return (0); } - parentp = &node->pn_child[slot]; - node = node->pn_child[slot]; + node = tmp; } /* @@ -337,10 +408,12 @@ pctrie_insert(struct pctrie *ptree, uint64_t *val, pct pctrie_trimkey(index, clev + 1), 2, clev); if (tmp == NULL) return (ENOMEM); - *parentp = tmp; - pctrie_addval(tmp, index, clev, val); slot = pctrie_slot(newind, clev); - tmp->pn_child[slot] = node; + /* These writes are not yet visible due to ordering. */ + pctrie_addval(tmp, index, clev, val, PCTRIE_UNSERIALIZED); + pctrie_node_store(&tmp->pn_child[slot], node, PCTRIE_UNSERIALIZED); + /* Synchronize to make the above visible. */ + pctrie_node_store(parentp, tmp, PCTRIE_LOCKED); return (0); } @@ -349,33 +422,63 @@ pctrie_insert(struct pctrie *ptree, uint64_t *val, pct * Returns the value stored at the index. If the index is not present, * NULL is returned. */ -uint64_t * -pctrie_lookup(struct pctrie *ptree, uint64_t index) +static __always_inline uint64_t * +_pctrie_lookup(struct pctrie *ptree, uint64_t index, smr_t smr, + enum pctrie_access access) { struct pctrie_node *node; uint64_t *m; int slot; - node = pctrie_getroot(ptree); + node = pctrie_root_load(ptree, smr, access); while (node != NULL) { if (pctrie_isleaf(node)) { m = pctrie_toval(node); if (*m == index) return (m); - else - break; - } else if (pctrie_keybarr(node, index)) break; + } + if (pctrie_keybarr(node, index)) + break; slot = pctrie_slot(index, node->pn_clev); - node = node->pn_child[slot]; + node = pctrie_node_load(&node->pn_child[slot], smr, access); } return (NULL); } /* - * Look up the nearest entry at a position bigger than or equal to index. + * Returns the value stored at the index, assuming access is externally + * synchronized by a lock. + * + * If the index is not present, NULL is returned. */ uint64_t * +pctrie_lookup(struct pctrie *ptree, uint64_t index) +{ + return (_pctrie_lookup(ptree, index, NULL, PCTRIE_LOCKED)); +} + +/* + * Returns the value stored at the index without requiring an external lock. + * + * If the index is not present, NULL is returned. + */ +uint64_t * +pctrie_lookup_unlocked(struct pctrie *ptree, uint64_t index, smr_t smr) +{ + uint64_t *res; + + smr_enter(smr); + res = _pctrie_lookup(ptree, index, smr, PCTRIE_SMR); + smr_exit(smr); + return (res); +} + +/* + * Look up the nearest entry at a position bigger than or equal to index, + * assuming access is externally synchronized by a lock. + */ +uint64_t * pctrie_lookup_ge(struct pctrie *ptree, uint64_t index) { struct pctrie_node *stack[PCTRIE_LIMIT]; @@ -388,7 +491,7 @@ pctrie_lookup_ge(struct pctrie *ptree, uint64_t index) unsigned tos; int slot; - node = pctrie_getroot(ptree); + node = pctrie_root_load(ptree, NULL, PCTRIE_LOCKED); if (node == NULL) return (NULL); else if (pctrie_isleaf(node)) { @@ -404,7 +507,7 @@ pctrie_lookup_ge(struct pctrie *ptree, uint64_t index) * If the keys differ before the current bisection node, * then the search key might rollback to the earliest * available bisection node or to the smallest key - * in the current node (if the owner is bigger than the + * in the current node (if the owner is greater than the * search key). */ if (pctrie_keybarr(node, index)) { @@ -439,7 +542,8 @@ ascend: ("pctrie_lookup_ge: keybarr failed")); } slot = pctrie_slot(index, node->pn_clev); - child = node->pn_child[slot]; + child = pctrie_node_load(&node->pn_child[slot], NULL, + PCTRIE_LOCKED); if (pctrie_isleaf(child)) { m = pctrie_toval(child); if (*m >= index) @@ -457,7 +561,8 @@ ascend: do { index += inc; slot++; - child = node->pn_child[slot]; + child = pctrie_node_load(&node->pn_child[slot], + NULL, PCTRIE_LOCKED); if (pctrie_isleaf(child)) { m = pctrie_toval(child); if (*m >= index) @@ -470,7 +575,7 @@ ascend: ("pctrie_lookup_ge: child is radix node")); /* - * If a value or edge bigger than the search slot is not found + * If a value or edge greater than the search slot is not found * in the current node, ascend to the next higher-level node. */ goto ascend; @@ -485,7 +590,8 @@ descend: } /* - * Look up the nearest entry at a position less than or equal to index. + * Look up the nearest entry at a position less than or equal to index, + * assuming access is externally synchronized by a lock. */ uint64_t * pctrie_lookup_le(struct pctrie *ptree, uint64_t index) @@ -500,7 +606,7 @@ pctrie_lookup_le(struct pctrie *ptree, uint64_t index) unsigned tos; int slot; - node = pctrie_getroot(ptree); + node = pctrie_root_load(ptree, NULL, PCTRIE_LOCKED); if (node == NULL) return (NULL); else if (pctrie_isleaf(node)) { @@ -553,7 +659,8 @@ ascend: ("pctrie_lookup_le: keybarr failed")); } slot = pctrie_slot(index, node->pn_clev); - child = node->pn_child[slot]; + child = pctrie_node_load(&node->pn_child[slot], NULL, + PCTRIE_LOCKED); if (pctrie_isleaf(child)) { m = pctrie_toval(child); if (*m <= index) @@ -571,7 +678,8 @@ ascend: do { index -= inc; slot--; - child = node->pn_child[slot]; + child = pctrie_node_load(&node->pn_child[slot], + NULL, PCTRIE_LOCKED); if (pctrie_isleaf(child)) { m = pctrie_toval(child); if (*m <= index) @@ -605,16 +713,16 @@ descend: void pctrie_remove(struct pctrie *ptree, uint64_t index, pctrie_free_t freefn) { - struct pctrie_node *node, *parent; + struct pctrie_node *node, *parent, *tmp; uint64_t *m; int i, slot; - node = pctrie_getroot(ptree); + node = pctrie_root_load(ptree, NULL, PCTRIE_LOCKED); if (pctrie_isleaf(node)) { m = pctrie_toval(node); if (*m != index) panic("%s: invalid key found", __func__); - pctrie_setroot(ptree, NULL); + pctrie_root_store(ptree, NULL, PCTRIE_LOCKED); return; } parent = NULL; @@ -622,34 +730,46 @@ pctrie_remove(struct pctrie *ptree, uint64_t index, pc if (node == NULL) panic("pctrie_remove: impossible to locate the key"); slot = pctrie_slot(index, node->pn_clev); - if (pctrie_isleaf(node->pn_child[slot])) { - m = pctrie_toval(node->pn_child[slot]); + tmp = pctrie_node_load(&node->pn_child[slot], NULL, + PCTRIE_LOCKED); + if (pctrie_isleaf(tmp)) { + m = pctrie_toval(tmp); if (*m != index) panic("%s: invalid key found", __func__); - node->pn_child[slot] = NULL; + pctrie_node_store(&node->pn_child[slot], NULL, + PCTRIE_LOCKED); node->pn_count--; if (node->pn_count > 1) break; - for (i = 0; i < PCTRIE_COUNT; i++) - if (node->pn_child[i] != NULL) + for (i = 0; i < PCTRIE_COUNT; i++) { + tmp = pctrie_node_load(&node->pn_child[i], + NULL, PCTRIE_LOCKED); + if (tmp != NULL) break; + } KASSERT(i != PCTRIE_COUNT, ("%s: invalid node configuration", __func__)); if (parent == NULL) - pctrie_setroot(ptree, node->pn_child[i]); + pctrie_root_store(ptree, tmp, PCTRIE_LOCKED); else { slot = pctrie_slot(index, parent->pn_clev); - KASSERT(parent->pn_child[slot] == node, + KASSERT(pctrie_node_load( + &parent->pn_child[slot], NULL, + PCTRIE_LOCKED) == node, ("%s: invalid child value", __func__)); - parent->pn_child[slot] = node->pn_child[i]; + pctrie_node_store(&parent->pn_child[slot], tmp, + PCTRIE_LOCKED); } + /* + * The child is still valid and we can not zero the + * pointer until all SMR references are gone. + */ node->pn_count--; - node->pn_child[i] = NULL; - pctrie_node_put(ptree, node, freefn); + pctrie_node_put(ptree, node, freefn, i); break; } parent = node; - node = node->pn_child[slot]; + node = tmp; } } @@ -663,10 +783,10 @@ pctrie_reclaim_allnodes(struct pctrie *ptree, pctrie_f { struct pctrie_node *root; - root = pctrie_getroot(ptree); + root = pctrie_root_load(ptree, NULL, PCTRIE_LOCKED); if (root == NULL) return; - pctrie_setroot(ptree, NULL); + pctrie_root_store(ptree, NULL, PCTRIE_UNSERIALIZED); if (!pctrie_isleaf(root)) pctrie_reclaim_allnodes_int(ptree, root, freefn); } @@ -677,7 +797,7 @@ pctrie_reclaim_allnodes(struct pctrie *ptree, pctrie_f */ DB_SHOW_COMMAND(pctrienode, db_show_pctrienode) { - struct pctrie_node *node; + struct pctrie_node *node, *tmp; int i; if (!have_addr) @@ -686,12 +806,14 @@ DB_SHOW_COMMAND(pctrienode, db_show_pctrienode) db_printf("node %p, owner %jx, children count %u, level %u:\n", (void *)node, (uintmax_t)node->pn_owner, node->pn_count, node->pn_clev); - for (i = 0; i < PCTRIE_COUNT; i++) - if (node->pn_child[i] != NULL) + for (i = 0; i < PCTRIE_COUNT; i++) { + tmp = pctrie_node_load(&node->pn_child[i], NULL, + PCTRIE_UNSERIALIZED); + if (tmp != NULL) db_printf("slot: %d, val: %p, value: %p, clev: %d\n", - i, (void *)node->pn_child[i], - pctrie_isleaf(node->pn_child[i]) ? - pctrie_toval(node->pn_child[i]) : NULL, + i, (void *)tmp, + pctrie_isleaf(tmp) ? pctrie_toval(tmp) : NULL, node->pn_clev); + } } #endif /* DDB */ Modified: head/sys/sys/pctrie.h ============================================================================== --- head/sys/sys/pctrie.h Fri Jul 24 17:28:24 2020 (r363480) +++ head/sys/sys/pctrie.h Fri Jul 24 17:32:10 2020 (r363481) @@ -34,9 +34,21 @@ #define _SYS_PCTRIE_H_ #include +#include #ifdef _KERNEL +#define PCTRIE_DEFINE_SMR(name, type, field, allocfn, freefn, smr) \ + PCTRIE_DEFINE(name, type, field, allocfn, freefn) \ + \ +static __inline struct type * \ +name##_PCTRIE_LOOKUP_UNLOCKED(struct pctrie *ptree, uint64_t key) \ +{ \ + \ + return name##_PCTRIE_VAL2PTR(pctrie_lookup_unlocked(ptree, \ + key, (smr))); \ +} \ + #define PCTRIE_DEFINE(name, type, field, allocfn, freefn) \ \ CTASSERT(sizeof(((struct type *)0)->field) == sizeof(uint64_t)); \ @@ -114,6 +126,8 @@ int pctrie_insert(struct pctrie *ptree, uint64_t *val uint64_t *pctrie_lookup(struct pctrie *ptree, uint64_t key); uint64_t *pctrie_lookup_ge(struct pctrie *ptree, uint64_t key); uint64_t *pctrie_lookup_le(struct pctrie *ptree, uint64_t key); +uint64_t *pctrie_lookup_unlocked(struct pctrie *ptree, uint64_t key, + smr_t smr); void pctrie_reclaim_allnodes(struct pctrie *ptree, pctrie_free_t freefn); void pctrie_remove(struct pctrie *ptree, uint64_t key, From owner-svn-src-all@freebsd.org Fri Jul 24 17:34:06 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0D80236D479; Fri, 24 Jul 2020 17:34:06 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BCxC16dmTz3bs2; Fri, 24 Jul 2020 17:34: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 C8473DEDA; Fri, 24 Jul 2020 17:34: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 06OHY5Zu080450; Fri, 24 Jul 2020 17:34:05 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06OHY53J080448; Fri, 24 Jul 2020 17:34:05 GMT (envelope-from cem@FreeBSD.org) Message-Id: <202007241734.06OHY53J080448@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Fri, 24 Jul 2020 17:34:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363482 - in head/sys: kern sys X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: in head/sys: kern sys X-SVN-Commit-Revision: 363482 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 24 Jul 2020 17:34:06 -0000 Author: cem Date: Fri Jul 24 17:34:04 2020 New Revision: 363482 URL: https://svnweb.freebsd.org/changeset/base/363482 Log: Add unlocked/SMR fast path to getblk() Convert the bufobj tries to an SMR zone/PCTRIE and add a gbincore_unlocked() API wrapping this functionality. Use it for a fast path in getblkx(), falling back to locked lookup if we raced a thread changing the buf's identity. Reported by: Attilio Reviewed by: kib, markj Testing: pho (in progress) Sponsored by: Isilon Differential Revision: https://reviews.freebsd.org/D25782 Modified: head/sys/kern/vfs_bio.c head/sys/kern/vfs_subr.c head/sys/sys/buf.h Modified: head/sys/kern/vfs_bio.c ============================================================================== --- head/sys/kern/vfs_bio.c Fri Jul 24 17:32:10 2020 (r363481) +++ head/sys/kern/vfs_bio.c Fri Jul 24 17:34:04 2020 (r363482) @@ -3849,7 +3849,7 @@ getblkx(struct vnode *vp, daddr_t blkno, daddr_t dblkn struct buf *bp; struct bufobj *bo; daddr_t d_blkno; - int bsize, error, maxsize, vmio; + int bsize, error, maxsize, vmio, lockflags; off_t offset; CTR3(KTR_BUF, "getblk(%p, %ld, %d)", vp, (long)blkno, size); @@ -3864,11 +3864,33 @@ getblkx(struct vnode *vp, daddr_t blkno, daddr_t dblkn bo = &vp->v_bufobj; d_blkno = dblkno; + + /* Attempt lockless lookup first. */ + bp = gbincore_unlocked(bo, blkno); + if (bp == NULL) + goto newbuf_unlocked; + + lockflags = LK_EXCLUSIVE | LK_SLEEPFAIL | + ((flags & GB_LOCK_NOWAIT) ? LK_NOWAIT : 0); + + error = BUF_TIMELOCK(bp, lockflags, NULL, "getblku", slpflag, + slptimeo); + if (error == EINTR || error == ERESTART) + return (error); + else if (error != 0) + goto loop; + + /* Verify buf identify has not changed since lookup. */ + if (bp->b_bufobj == bo && bp->b_lblkno == blkno) + goto foundbuf_fastpath; + + /* It changed, fallback to locked lookup. */ + BUF_UNLOCK_RAW(bp); + loop: BO_RLOCK(bo); bp = gbincore(bo, blkno); if (bp != NULL) { - int lockflags; /* * Buffer is in-core. If the buffer is not busy nor managed, * it must be on a queue. @@ -3890,8 +3912,10 @@ loop: /* We timed out or were interrupted. */ else if (error != 0) return (error); + +foundbuf_fastpath: /* If recursed, assume caller knows the rules. */ - else if (BUF_LOCKRECURSED(bp)) + if (BUF_LOCKRECURSED(bp)) goto end; /* @@ -3989,6 +4013,7 @@ loop: * buffer is also considered valid (not marked B_INVAL). */ BO_RUNLOCK(bo); +newbuf_unlocked: /* * If the user does not want us to create the buffer, bail out * here. Modified: head/sys/kern/vfs_subr.c ============================================================================== --- head/sys/kern/vfs_subr.c Fri Jul 24 17:32:10 2020 (r363481) +++ head/sys/kern/vfs_subr.c Fri Jul 24 17:34:04 2020 (r363482) @@ -234,6 +234,7 @@ static struct mtx __exclusive_cache_line vnode_list_mt struct nfs_public nfs_pub; static uma_zone_t buf_trie_zone; +static smr_t buf_trie_smr; /* Zone for allocation of new vnodes - used exclusively by getnewvnode() */ static uma_zone_t vnode_zone; @@ -491,17 +492,16 @@ static int vnsz2log; static void * buf_trie_alloc(struct pctrie *ptree) { - - return uma_zalloc(buf_trie_zone, M_NOWAIT); + return (uma_zalloc_smr(buf_trie_zone, M_NOWAIT)); } static void buf_trie_free(struct pctrie *ptree, void *node) { - - uma_zfree(buf_trie_zone, node); + uma_zfree_smr(buf_trie_zone, node); } -PCTRIE_DEFINE(BUF, buf, b_lblkno, buf_trie_alloc, buf_trie_free); +PCTRIE_DEFINE_SMR(BUF, buf, b_lblkno, buf_trie_alloc, buf_trie_free, + buf_trie_smr); /* * Initialize the vnode management data structures. @@ -675,7 +675,8 @@ vntblinit(void *dummy __unused) */ buf_trie_zone = uma_zcreate("BUF TRIE", pctrie_node_size(), NULL, NULL, pctrie_zone_init, NULL, UMA_ALIGN_PTR, - UMA_ZONE_NOFREE); + UMA_ZONE_NOFREE | UMA_ZONE_SMR); + buf_trie_smr = uma_zone_get_smr(buf_trie_zone); uma_prealloc(buf_trie_zone, nbuf); vnodes_created = counter_u64_alloc(M_WAITOK); @@ -2330,7 +2331,25 @@ gbincore(struct bufobj *bo, daddr_t lblkno) bp = BUF_PCTRIE_LOOKUP(&bo->bo_clean.bv_root, lblkno); if (bp != NULL) return (bp); - return BUF_PCTRIE_LOOKUP(&bo->bo_dirty.bv_root, lblkno); + return (BUF_PCTRIE_LOOKUP(&bo->bo_dirty.bv_root, lblkno)); +} + +/* + * Look up a buf using the buffer tries, without the bufobj lock. This relies + * on SMR for safe lookup, and bufs being in a no-free zone to provide type + * stability of the result. Like other lockless lookups, the found buf may + * already be invalid by the time this function returns. + */ +struct buf * +gbincore_unlocked(struct bufobj *bo, daddr_t lblkno) +{ + struct buf *bp; + + ASSERT_BO_UNLOCKED(bo); + bp = BUF_PCTRIE_LOOKUP_UNLOCKED(&bo->bo_clean.bv_root, lblkno); + if (bp != NULL) + return (bp); + return (BUF_PCTRIE_LOOKUP_UNLOCKED(&bo->bo_dirty.bv_root, lblkno)); } /* Modified: head/sys/sys/buf.h ============================================================================== --- head/sys/sys/buf.h Fri Jul 24 17:32:10 2020 (r363481) +++ head/sys/sys/buf.h Fri Jul 24 17:34:04 2020 (r363482) @@ -326,6 +326,9 @@ extern const char *buf_wmesg; /* Default buffer lock KASSERT(((bp)->b_flags & B_REMFREE) == 0, \ ("BUF_UNLOCK %p while B_REMFREE is still set.", (bp))); \ \ + BUF_UNLOCK_RAW((bp)); \ +} while (0) +#define BUF_UNLOCK_RAW(bp) do { \ (void)_lockmgr_args(&(bp)->b_lock, LK_RELEASE, NULL, \ LK_WMESG_DEFAULT, LK_PRIO_DEFAULT, LK_TIMO_DEFAULT, \ LOCK_FILE, LOCK_LINE); \ @@ -547,6 +550,7 @@ void vfs_busy_pages_acquire(struct buf *bp); void vfs_busy_pages_release(struct buf *bp); struct buf *incore(struct bufobj *, daddr_t); struct buf *gbincore(struct bufobj *, daddr_t); +struct buf *gbincore_unlocked(struct bufobj *, daddr_t); struct buf *getblk(struct vnode *, daddr_t, int, int, int, int); int getblkx(struct vnode *vp, daddr_t blkno, daddr_t dblkno, int size, int slpflag, int slptimeo, int flags, struct buf **bpp); From owner-svn-src-all@freebsd.org Fri Jul 24 17:34:44 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DCBD036D5C6; Fri, 24 Jul 2020 17:34:44 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BCxCm5bFRz3cMc; Fri, 24 Jul 2020 17:34:44 +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 A468DE319; Fri, 24 Jul 2020 17:34:44 +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 06OHYiAM080534; Fri, 24 Jul 2020 17:34:44 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06OHYiGK080533; Fri, 24 Jul 2020 17:34:44 GMT (envelope-from cem@FreeBSD.org) Message-Id: <202007241734.06OHYiGK080533@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Fri, 24 Jul 2020 17:34:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363483 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 363483 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 24 Jul 2020 17:34:44 -0000 Author: cem Date: Fri Jul 24 17:34:44 2020 New Revision: 363483 URL: https://svnweb.freebsd.org/changeset/base/363483 Log: Use gbincore_unlocked for unprotected incore() Reviewed by: markj Sponsored by: Isilon Differential Revision: https://reviews.freebsd.org/D25790 Modified: head/sys/kern/vfs_bio.c Modified: head/sys/kern/vfs_bio.c ============================================================================== --- head/sys/kern/vfs_bio.c Fri Jul 24 17:34:04 2020 (r363482) +++ head/sys/kern/vfs_bio.c Fri Jul 24 17:34:44 2020 (r363483) @@ -3576,12 +3576,7 @@ flushbufqueues(struct vnode *lvp, struct bufdomain *bd struct buf * incore(struct bufobj *bo, daddr_t blkno) { - struct buf *bp; - - BO_RLOCK(bo); - bp = gbincore(bo, blkno); - BO_RUNLOCK(bo); - return (bp); + return (gbincore_unlocked(bo, blkno)); } /* From owner-svn-src-all@freebsd.org Fri Jul 24 17:45:07 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0BD3636DD8D; Fri, 24 Jul 2020 17:45:07 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BCxRk6d6nz3cnr; Fri, 24 Jul 2020 17:45:06 +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 C2CC1E4C4; Fri, 24 Jul 2020 17:45:06 +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 06OHj6Pi086861; Fri, 24 Jul 2020 17:45:06 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06OHj6ej086860; Fri, 24 Jul 2020 17:45:06 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <202007241745.06OHj6ej086860@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Fri, 24 Jul 2020 17:45:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r363484 - stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-12 X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Commit-Revision: 363484 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 24 Jul 2020 17:45:07 -0000 Author: asomers Date: Fri Jul 24 17:45:06 2020 New Revision: 363484 URL: https://svnweb.freebsd.org/changeset/base/363484 Log: MFC r362891: Fix page fault in zfsctl_snapdir_getattr Must acquire the z_teardown_lock before accessing the zfsvfs_t object. I can't reproduce this panic on demand, but this looks like the correct solution. PR: 247668 Reviewed by: avg Sponsored by: Axcient Differential Revision: https://reviews.freebsd.org/D25543 Modified: stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c ============================================================================== --- stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c Fri Jul 24 17:34:44 2020 (r363483) +++ stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c Fri Jul 24 17:45:06 2020 (r363484) @@ -1120,12 +1120,13 @@ zfsctl_snapdir_getattr(ap) vnode_t *vp = ap->a_vp; vattr_t *vap = ap->a_vap; zfsvfs_t *zfsvfs = vp->v_vfsp->vfs_data; - dsl_dataset_t *ds = dmu_objset_ds(zfsvfs->z_os); + dsl_dataset_t *ds; sfs_node_t *node = vp->v_data; uint64_t snap_count; int err; ZFS_ENTER(zfsvfs); + ds = dmu_objset_ds(zfsvfs->z_os); zfsctl_common_getattr(vp, vap); vap->va_ctime = dmu_objset_snap_cmtime(zfsvfs->z_os); vap->va_mtime = vap->va_ctime; From owner-svn-src-all@freebsd.org Fri Jul 24 17:56:19 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1359B36E1EB; Fri, 24 Jul 2020 17:56:19 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BCxhf4cFRz3dg4; Fri, 24 Jul 2020 17:56:18 +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 7C801E2C7; Fri, 24 Jul 2020 17:56:18 +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 06OHuIuJ093205; Fri, 24 Jul 2020 17:56:18 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06OHuIZL093204; Fri, 24 Jul 2020 17:56:18 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <202007241756.06OHuIZL093204@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Fri, 24 Jul 2020 17:56: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: r363485 - stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-11 X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Commit-Revision: 363485 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 24 Jul 2020 17:56:19 -0000 Author: asomers Date: Fri Jul 24 17:56:17 2020 New Revision: 363485 URL: https://svnweb.freebsd.org/changeset/base/363485 Log: MFC r362891: Fix page fault in zfsctl_snapdir_getattr Must acquire the z_teardown_lock before accessing the zfsvfs_t object. I can't reproduce this panic on demand, but this looks like the correct solution. PR: 247668 Reviewed by: avg Sponsored by: Axcient Differential Revision: https://reviews.freebsd.org/D25543 Modified: stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c ============================================================================== --- stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c Fri Jul 24 17:45:06 2020 (r363484) +++ stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c Fri Jul 24 17:56:17 2020 (r363485) @@ -1118,12 +1118,13 @@ zfsctl_snapdir_getattr(ap) vnode_t *vp = ap->a_vp; vattr_t *vap = ap->a_vap; zfsvfs_t *zfsvfs = vp->v_vfsp->vfs_data; - dsl_dataset_t *ds = dmu_objset_ds(zfsvfs->z_os); + dsl_dataset_t *ds; sfs_node_t *node = vp->v_data; uint64_t snap_count; int err; ZFS_ENTER(zfsvfs); + ds = dmu_objset_ds(zfsvfs->z_os); zfsctl_common_getattr(vp, vap); vap->va_ctime = dmu_objset_snap_cmtime(zfsvfs->z_os); vap->va_mtime = vap->va_ctime; From owner-svn-src-all@freebsd.org Fri Jul 24 18:19:26 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6A20536F124; Fri, 24 Jul 2020 18:19:26 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BCyCL231rz3gY8; Fri, 24 Jul 2020 18:19:26 +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 262AAEA8F; Fri, 24 Jul 2020 18:19:26 +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 06OIJPVd007118; Fri, 24 Jul 2020 18:19:25 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06OIJPBT007115; Fri, 24 Jul 2020 18:19:25 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <202007241819.06OIJPBT007115@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Fri, 24 Jul 2020 18:19:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r363486 - in stable/12: sys/geom/eli tests/sys/geom/class/eli X-SVN-Group: stable-12 X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: in stable/12: sys/geom/eli tests/sys/geom/class/eli X-SVN-Commit-Revision: 363486 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 24 Jul 2020 18:19:26 -0000 Author: asomers Date: Fri Jul 24 18:19:25 2020 New Revision: 363486 URL: https://svnweb.freebsd.org/changeset/base/363486 Log: MFC r363014: geli: enable direct dispatch geli does all of its crypto operations in a separate thread pool, so g_eli_start, g_eli_read_done, and g_eli_write_done don't actually do very much work. Enabling direct dispatch eliminates the g_up/g_down bottlenecks, doubling IOPs on my system. This change does not affect the thread pool. Reviewed by: markj Sponsored by: Axcient Differential Revision: https://reviews.freebsd.org/D25587 Added: stable/12/tests/sys/geom/class/eli/reentrancy_test.sh - copied unchanged from r363014, head/tests/sys/geom/class/eli/reentrancy_test.sh Modified: stable/12/sys/geom/eli/g_eli.c stable/12/tests/sys/geom/class/eli/Makefile Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/geom/eli/g_eli.c ============================================================================== --- stable/12/sys/geom/eli/g_eli.c Fri Jul 24 17:56:17 2020 (r363485) +++ stable/12/sys/geom/eli/g_eli.c Fri Jul 24 18:19:25 2020 (r363486) @@ -642,6 +642,7 @@ g_eli_read_metadata(struct g_class *mp, struct g_provi gp->orphan = g_eli_orphan_spoil_assert; gp->spoiled = g_eli_orphan_spoil_assert; cp = g_new_consumer(gp); + cp->flags |= G_CF_DIRECT_SEND | G_CF_DIRECT_RECEIVE; error = g_attach(cp, pp); if (error != 0) goto end; @@ -778,6 +779,7 @@ g_eli_create(struct gctl_req *req, struct g_class *mp, pp = NULL; cp = g_new_consumer(gp); + cp->flags |= G_CF_DIRECT_SEND | G_CF_DIRECT_RECEIVE; error = g_attach(cp, bpp); if (error != 0) { if (req != NULL) { @@ -865,6 +867,7 @@ g_eli_create(struct gctl_req *req, struct g_class *mp, * Create decrypted provider. */ pp = g_new_providerf(gp, "%s%s", bpp->name, G_ELI_SUFFIX); + pp->flags |= G_PF_DIRECT_SEND | G_PF_DIRECT_RECEIVE; pp->mediasize = sc->sc_mediasize; pp->sectorsize = sc->sc_sectorsize; Modified: stable/12/tests/sys/geom/class/eli/Makefile ============================================================================== --- stable/12/tests/sys/geom/class/eli/Makefile Fri Jul 24 17:56:17 2020 (r363485) +++ stable/12/tests/sys/geom/class/eli/Makefile Fri Jul 24 18:19:25 2020 (r363486) @@ -16,6 +16,7 @@ ATF_TESTS_SH+= integrity_test ATF_TESTS_SH+= kill_test ATF_TESTS_SH+= misc_test ATF_TESTS_SH+= onetime_test +ATF_TESTS_SH+= reentrancy_test ATF_TESTS_SH+= resize_test ATF_TESTS_SH+= setkey_test Copied: stable/12/tests/sys/geom/class/eli/reentrancy_test.sh (from r363014, head/tests/sys/geom/class/eli/reentrancy_test.sh) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/12/tests/sys/geom/class/eli/reentrancy_test.sh Fri Jul 24 18:19:25 2020 (r363486, copy of r363014, head/tests/sys/geom/class/eli/reentrancy_test.sh) @@ -0,0 +1,69 @@ +# $FreeBSD$ + +# Test various operations for geli-on-geli providers, to ensure that geli is +# reentrant. + +. $(atf_get_srcdir)/conf.sh + +init_test() +{ + cipher=$1 + aalgo=$2 + secsize=$3 + ealgo=${cipher%%:*} + keylen=${cipher##*:} + + atf_check dd if=/dev/random of=testdata bs=$secsize count=1 status=none + atf_check dd if=/dev/random of=keyfile bs=$secsize count=16 status=none + + # Create the lower geli device + atf_check -s exit:0 -e ignore \ + geli init -B none -a $aalgo -e $ealgo -l $keylen -P -K keyfile \ + -s $secsize ${md} + atf_check geli attach -p -k keyfile ${md} + # Create the upper geli device + atf_check -s exit:0 -e ignore \ + geli init -B none -a $aalgo -e $ealgo -l $keylen -P -K keyfile \ + -s $secsize ${md}.eli + atf_check geli attach -p -k keyfile ${md}.eli + echo ${md} > layered_md_device + + # Ensure we can read and write. + atf_check dd if=testdata of=/dev/${md}.eli.eli bs=$secsize count=1 \ + status=none + atf_check dd if=/dev/${md}.eli.eli of=cmpdata bs=$secsize count=1 \ + status=none + atf_check cmp -s testdata cmpdata + + geli detach ${md}.eli 2>/dev/null +} + +atf_test_case init cleanup +init_head() +{ + atf_set "descr" "Initialize a geli provider on top of another" + atf_set "require.user" "root" + atf_set "timeout" 600 +} +init_body() +{ + sectors=2 + geli_test_setup + + for_each_geli_config init_test +} +init_cleanup() +{ + if [ -f layered_md_device ]; then + while read provider; do + [ -c /dev/${md}.eli.eli ] && \ + geli detach $md.eli.eli 2>/dev/null + done < layered_md_device + fi + geli_test_cleanup +} + +atf_init_test_cases() +{ + atf_add_test_case init +} From owner-svn-src-all@freebsd.org Fri Jul 24 18:43:47 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A6AA036F464; Fri, 24 Jul 2020 18:43:47 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BCylR41Hjz3yRB; Fri, 24 Jul 2020 18:43:47 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6E8F4EF50; Fri, 24 Jul 2020 18:43:47 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06OIhlg5025357; Fri, 24 Jul 2020 18:43:47 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06OIhlqn025356; Fri, 24 Jul 2020 18:43:47 GMT (envelope-from manu@FreeBSD.org) Message-Id: <202007241843.06OIhlqn025356@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Fri, 24 Jul 2020 18:43:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363487 - head/sys/cam/mmc X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/cam/mmc X-SVN-Commit-Revision: 363487 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 24 Jul 2020 18:43:47 -0000 Author: manu Date: Fri Jul 24 18:43:46 2020 New Revision: 363487 URL: https://svnweb.freebsd.org/changeset/base/363487 Log: mmccam: Make non bootverbose more readable Remove some debug printfs. Convert some to CAM_DEBUG Only print some when bootverbose is set. Modified: head/sys/cam/mmc/mmc_xpt.c Modified: head/sys/cam/mmc/mmc_xpt.c ============================================================================== --- head/sys/cam/mmc/mmc_xpt.c Fri Jul 24 18:19:25 2020 (r363486) +++ head/sys/cam/mmc/mmc_xpt.c Fri Jul 24 18:43:46 2020 (r363487) @@ -179,7 +179,6 @@ mmc_alloc_device(struct cam_eb *bus, struct cam_et *ta { struct cam_ed *device; - printf("mmc_alloc_device()\n"); device = xpt_alloc_device(bus, target, lun_id); if (device == NULL) return (NULL); @@ -282,7 +281,8 @@ mmc_scan_lun(struct cam_periph *periph, struct cam_pat xpt_done(request_ccb); } } else { - xpt_print(path, " Set up the mmcprobe device...\n"); + if (bootverbose) + xpt_print(path, " Set up the mmcprobe device...\n"); status = cam_periph_alloc(mmcprobe_register, NULL, mmcprobe_cleanup, @@ -829,7 +829,6 @@ mmcprobe_done(struct cam_periph *periph, union ccb *do /* FALLTHROUGH */ case PROBE_IDENTIFY: { - printf("Starting completion of PROBE_RESET\n"); CAM_DEBUG(done_ccb->ccb_h.path, CAM_DEBUG_PROBE, ("done with PROBE_RESET\n")); mmcio = &done_ccb->mmcio; err = mmcio->cmd.error; @@ -1149,7 +1148,7 @@ mmcprobe_done(struct cam_periph *periph, union ccb *do xpt_schedule(periph, priority); /* Drop freeze taken due to CAM_DEV_QFREEZE flag set. */ int frozen = cam_release_devq(path, 0, 0, 0, FALSE); - printf("mmc_probedone: remaining freezecnt %d\n", frozen); + CAM_DEBUG(done_ccb->ccb_h.path, CAM_DEBUG_PROBE, ("mmc_probedone: remaining freezecnt %d\n", frozen)); if (softc->action == PROBE_DONE) { /* Notify the system that the device is found! */ From owner-svn-src-all@freebsd.org Fri Jul 24 18:44:50 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AA88936F657; Fri, 24 Jul 2020 18:44:50 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BCymf43wxz3ydZ; Fri, 24 Jul 2020 18:44:50 +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 6FB2FF115; Fri, 24 Jul 2020 18:44:50 +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 06OIiosX025493; Fri, 24 Jul 2020 18:44:50 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06OIioLb025492; Fri, 24 Jul 2020 18:44:50 GMT (envelope-from manu@FreeBSD.org) Message-Id: <202007241844.06OIioLb025492@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Fri, 24 Jul 2020 18:44:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363488 - 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: 363488 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 24 Jul 2020 18:44:50 -0000 Author: manu Date: Fri Jul 24 18:44:50 2020 New Revision: 363488 URL: https://svnweb.freebsd.org/changeset/base/363488 Log: mmccam: aw_mmc: Only print the new ios value under bootverbose Modified: head/sys/arm/allwinner/aw_mmc.c Modified: head/sys/arm/allwinner/aw_mmc.c ============================================================================== --- head/sys/arm/allwinner/aw_mmc.c Fri Jul 24 18:43:46 2020 (r363487) +++ head/sys/arm/allwinner/aw_mmc.c Fri Jul 24 18:44:50 2020 (r363488) @@ -300,31 +300,38 @@ aw_mmc_cam_settran_settings(struct aw_mmc_softc *sc, u /* Update only requested fields */ if (cts->ios_valid & MMC_CLK) { ios->clock = new_ios->clock; - device_printf(sc->aw_dev, "Clock => %d\n", ios->clock); + if (bootverbose) + device_printf(sc->aw_dev, "Clock => %d\n", ios->clock); } if (cts->ios_valid & MMC_VDD) { ios->vdd = new_ios->vdd; - device_printf(sc->aw_dev, "VDD => %d\n", ios->vdd); + if (bootverbose) + device_printf(sc->aw_dev, "VDD => %d\n", ios->vdd); } if (cts->ios_valid & MMC_CS) { ios->chip_select = new_ios->chip_select; - device_printf(sc->aw_dev, "CS => %d\n", ios->chip_select); + if (bootverbose) + device_printf(sc->aw_dev, "CS => %d\n", ios->chip_select); } if (cts->ios_valid & MMC_BW) { ios->bus_width = new_ios->bus_width; - device_printf(sc->aw_dev, "Bus width => %d\n", ios->bus_width); + if (bootverbose) + device_printf(sc->aw_dev, "Bus width => %d\n", ios->bus_width); } if (cts->ios_valid & MMC_PM) { ios->power_mode = new_ios->power_mode; - device_printf(sc->aw_dev, "Power mode => %d\n", ios->power_mode); + if (bootverbose) + device_printf(sc->aw_dev, "Power mode => %d\n", ios->power_mode); } if (cts->ios_valid & MMC_BT) { ios->timing = new_ios->timing; - device_printf(sc->aw_dev, "Timing => %d\n", ios->timing); + if (bootverbose) + device_printf(sc->aw_dev, "Timing => %d\n", ios->timing); } if (cts->ios_valid & MMC_BM) { ios->bus_mode = new_ios->bus_mode; - device_printf(sc->aw_dev, "Bus mode => %d\n", ios->bus_mode); + if (bootverbose) + device_printf(sc->aw_dev, "Bus mode => %d\n", ios->bus_mode); } return (aw_mmc_update_ios(sc->aw_dev, NULL)); From owner-svn-src-all@freebsd.org Fri Jul 24 19:52:53 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 95B9B371BF2; Fri, 24 Jul 2020 19:52:53 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BD0H93QS2z4Bfv; Fri, 24 Jul 2020 19:52:53 +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 5973AF961; Fri, 24 Jul 2020 19:52:53 +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 06OJqrD3080974; Fri, 24 Jul 2020 19:52:53 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06OJqrIZ080972; Fri, 24 Jul 2020 19:52:53 GMT (envelope-from manu@FreeBSD.org) Message-Id: <202007241952.06OJqrIZ080972@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Fri, 24 Jul 2020 19:52:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363489 - head/sys/dev/mmc/host X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/dev/mmc/host X-SVN-Commit-Revision: 363489 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 24 Jul 2020 19:52:53 -0000 Author: manu Date: Fri Jul 24 19:52:52 2020 New Revision: 363489 URL: https://svnweb.freebsd.org/changeset/base/363489 Log: dwmmc: Add MMCCAM part Add support for MMCCAM for dwmmc Submitted by: kibab Tested On: Rock64, RockPro64 Modified: head/sys/dev/mmc/host/dwmmc.c head/sys/dev/mmc/host/dwmmc_var.h Modified: head/sys/dev/mmc/host/dwmmc.c ============================================================================== --- head/sys/dev/mmc/host/dwmmc.c Fri Jul 24 18:44:50 2020 (r363488) +++ head/sys/dev/mmc/host/dwmmc.c Fri Jul 24 19:52:52 2020 (r363489) @@ -68,9 +68,23 @@ __FBSDID("$FreeBSD$"); #include #include +#include "opt_mmccam.h" + +#ifdef MMCCAM +#include +#include +#include +#include +#include +#endif + #include "mmcbr_if.h" +#ifdef DEBUG +#define dprintf(fmt, args...) printf(fmt, ##args) +#else #define dprintf(x, arg...) +#endif #define READ4(_sc, _reg) \ bus_read_4((_sc)->res[0], _reg) @@ -129,6 +143,14 @@ static int dma_stop(struct dwmmc_softc *); static void pio_read(struct dwmmc_softc *, struct mmc_command *); static void pio_write(struct dwmmc_softc *, struct mmc_command *); static void dwmmc_handle_card_present(struct dwmmc_softc *sc, bool is_present); +static int dwmmc_switch_vccq(device_t, device_t); +#ifdef MMCCAM +static void dwmmc_cam_action(struct cam_sim *, union ccb *); +static void dwmmc_cam_poll(struct cam_sim *); +static int dwmmc_cam_settran_settings(struct dwmmc_softc *, union ccb *); +static int dwmmc_cam_request(struct dwmmc_softc *, union ccb *); +static void dwmmc_cam_handle_mmcio(struct cam_sim *, union ccb *); +#endif static struct resource_spec dwmmc_spec[] = { { SYS_RES_MEMORY, 0, RF_ACTIVE }, @@ -286,8 +308,18 @@ static void dwmmc_cmd_done(struct dwmmc_softc *sc) { struct mmc_command *cmd; +#ifdef MMCCAM + union ccb *ccb; +#endif +#ifdef MMCCAM + ccb = sc->ccb; + if (ccb == NULL) + return; + cmd = &ccb->mmcio.cmd; +#else cmd = sc->curcmd; +#endif if (cmd == NULL) return; @@ -432,6 +464,9 @@ dwmmc_card_task(void *arg, int pending __unused) { struct dwmmc_softc *sc = arg; +#ifdef MMCCAM + mmccam_start_discovery(sc->sim); +#else DWMMC_LOCK(sc); if (READ4(sc, SDMMC_CDETECT) == 0) { @@ -459,6 +494,7 @@ dwmmc_card_task(void *arg, int pending __unused) } else DWMMC_UNLOCK(sc); } +#endif /* MMCCAM */ } static int @@ -721,12 +757,40 @@ dwmmc_attach(device_t dev) TIMEOUT_TASK_INIT(taskqueue_swi_giant, &sc->card_delayed_task, 0, dwmmc_card_task, sc); +#ifdef MMCCAM + sc->ccb = NULL; + if ((sc->devq = cam_simq_alloc(1)) == NULL) { + goto fail; + } + + mtx_init(&sc->sim_mtx, "dwmmcsim", NULL, MTX_DEF); + sc->sim = cam_sim_alloc_dev(dwmmc_cam_action, dwmmc_cam_poll, + "dw_mmc_sim", sc, dev, + &sc->sim_mtx, 1, 1, sc->devq); + + if (sc->sim == NULL) { + cam_simq_free(sc->devq); + device_printf(dev, "cannot allocate CAM SIM\n"); + goto fail; + } + + mtx_lock(&sc->sim_mtx); + if (xpt_bus_register(sc->sim, sc->dev, 0) != 0) { + device_printf(sc->dev, "cannot register SCSI pass-through bus\n"); + cam_sim_free(sc->sim, FALSE); + cam_simq_free(sc->devq); + mtx_unlock(&sc->sim_mtx); + goto fail; + } + +fail: + mtx_unlock(&sc->sim_mtx); +#endif /* * Schedule a card detection as we won't get an interrupt * if the card is inserted when we attach */ dwmmc_card_task(sc, 0); - return (0); } @@ -1041,15 +1105,17 @@ dwmmc_start_cmd(struct dwmmc_softc *sc, struct mmc_com uint32_t blksz; uint32_t cmdr; + dprintf("%s\n", __func__); sc->curcmd = cmd; data = cmd->data; if ((sc->hwtype & HWTYPE_MASK) == HWTYPE_ROCKCHIP) dwmmc_setup_bus(sc, sc->host.ios.clock); +#ifndef MMCCAM /* XXX Upper layers don't always set this */ cmd->mrq = sc->req; - +#endif /* Begin setting up command register. */ cmdr = cmd->opcode; @@ -1119,11 +1185,23 @@ dwmmc_start_cmd(struct dwmmc_softc *sc, struct mmc_com static void dwmmc_next_operation(struct dwmmc_softc *sc) { + struct mmc_command *cmd; + dprintf("%s\n", __func__); +#ifdef MMCCAM + union ccb *ccb; + + ccb = sc->ccb; + if (ccb == NULL) + return; + cmd = &ccb->mmcio.cmd; +#else struct mmc_request *req; req = sc->req; if (req == NULL) return; + cmd = req->cmd; +#endif sc->acd_rcvd = 0; sc->dto_rcvd = 0; @@ -1140,17 +1218,26 @@ dwmmc_next_operation(struct dwmmc_softc *sc) if (sc->flags & PENDING_CMD) { sc->flags &= ~PENDING_CMD; - dwmmc_start_cmd(sc, req->cmd); + dwmmc_start_cmd(sc, cmd); return; } else if (sc->flags & PENDING_STOP && !sc->use_auto_stop) { sc->flags &= ~PENDING_STOP; - dwmmc_start_cmd(sc, req->stop); + /// XXX: What to do with this? + //dwmmc_start_cmd(sc, req->stop); return; } +#ifdef MMCCAM + sc->ccb = NULL; + sc->curcmd = NULL; + ccb->ccb_h.status = + (ccb->mmcio.cmd.error == 0 ? CAM_REQ_CMP : CAM_REQ_CMP_ERR); + xpt_done(ccb); +#else sc->req = NULL; sc->curcmd = NULL; req->done(req); +#endif } static int @@ -1164,6 +1251,9 @@ dwmmc_request(device_t brdev, device_t reqdev, struct DWMMC_LOCK(sc); +#ifdef MMCCAM + sc->flags |= PENDING_CMD; +#else if (sc->req != NULL) { DWMMC_UNLOCK(sc); return (EBUSY); @@ -1173,6 +1263,7 @@ dwmmc_request(device_t brdev, device_t reqdev, struct sc->flags |= PENDING_CMD; if (sc->req->stop) sc->flags |= PENDING_STOP; +#endif dwmmc_next_operation(sc); DWMMC_UNLOCK(sc); @@ -1326,6 +1417,230 @@ dwmmc_write_ivar(device_t bus, device_t child, int whi } return (0); } + +/* Note: this function likely belongs to the specific driver impl */ +static int +dwmmc_switch_vccq(device_t dev, device_t child) +{ + device_printf(dev, "This is a default impl of switch_vccq() that always fails\n"); + return EINVAL; +} + +#ifdef MMCCAM +static void +dwmmc_cam_handle_mmcio(struct cam_sim *sim, union ccb *ccb) +{ + struct dwmmc_softc *sc; + + sc = cam_sim_softc(sim); + + dwmmc_cam_request(sc, ccb); +} + +static void +dwmmc_cam_action(struct cam_sim *sim, union ccb *ccb) +{ + struct dwmmc_softc *sc; + + sc = cam_sim_softc(sim); + if (sc == NULL) { + ccb->ccb_h.status = CAM_SEL_TIMEOUT; + xpt_done(ccb); + return; + } + + mtx_assert(&sc->sim_mtx, MA_OWNED); + + switch (ccb->ccb_h.func_code) { + case XPT_PATH_INQ: + /* XXX: correctly calculate maxio here */ + mmc_path_inq(&ccb->cpi, "Deglitch Networks", sim, MMC_SECTOR_SIZE); + break; + + case XPT_GET_TRAN_SETTINGS: + { + struct ccb_trans_settings *cts = &ccb->cts; + + if (bootverbose) + device_printf(sc->dev, "Got XPT_GET_TRAN_SETTINGS\n"); + + cts->protocol = PROTO_MMCSD; + cts->protocol_version = 1; + cts->transport = XPORT_MMCSD; + cts->transport_version = 1; + cts->xport_specific.valid = 0; + cts->proto_specific.mmc.host_ocr = sc->host.host_ocr; + cts->proto_specific.mmc.host_f_min = sc->host.f_min; + cts->proto_specific.mmc.host_f_max = sc->host.f_max; + cts->proto_specific.mmc.host_caps = sc->host.caps; + /* XXX: correctly calculate host_max_data */ + cts->proto_specific.mmc.host_max_data = 1; + memcpy(&cts->proto_specific.mmc.ios, &sc->host.ios, sizeof(struct mmc_ios)); + ccb->ccb_h.status = CAM_REQ_CMP; + break; + } + case XPT_SET_TRAN_SETTINGS: + { + if (bootverbose) + device_printf(sc->dev, "Got XPT_SET_TRAN_SETTINGS\n"); + dwmmc_cam_settran_settings(sc, ccb); + ccb->ccb_h.status = CAM_REQ_CMP; + break; + } + case XPT_RESET_BUS: { + struct ccb_trans_settings_mmc *cts; + + cts = &ccb->cts.proto_specific.mmc; + cts->ios_valid = MMC_PM; + cts->ios.power_mode = power_off; + /* Power off the MMC bus */ + if (dwmmc_cam_settran_settings(sc, ccb) != 0) { + device_printf(sc->dev,"cannot power down the MMC bus\n"); + ccb->ccb_h.status = CAM_REQ_CMP_ERR; + break; + } + + /* Soft Reset controller and run initialization again */ + if (dwmmc_ctrl_reset(sc, (SDMMC_CTRL_RESET | + SDMMC_CTRL_FIFO_RESET | + SDMMC_CTRL_DMA_RESET)) != 0) { + device_printf(sc->dev, "cannot reset the controller\n"); + ccb->ccb_h.status = CAM_REQ_CMP_ERR; + break; + } + + cts->ios_valid = MMC_PM; + cts->ios.power_mode = power_on; + /* Power off the MMC bus */ + if (dwmmc_cam_settran_settings(sc, ccb) != 0) { + device_printf(sc->dev, "cannot power on the MMC bus\n"); + ccb->ccb_h.status = CAM_REQ_CMP_ERR; + break; + } + + ccb->ccb_h.status = CAM_REQ_CMP; + break; + } + case XPT_MMC_IO: + /* + * Here is the HW-dependent part of + * sending the command to the underlying h/w + * At some point in the future an interrupt comes. + * Then the request will be marked as completed. + */ + ccb->ccb_h.status = CAM_REQ_INPROG; + + dwmmc_cam_handle_mmcio(sim, ccb); + return; + /* NOTREACHED */ + break; + default: + ccb->ccb_h.status = CAM_REQ_INVALID; + break; + } + xpt_done(ccb); + return; +} + +static void +dwmmc_cam_poll(struct cam_sim *sim) +{ + return; +} + +static int +dwmmc_cam_settran_settings(struct dwmmc_softc *sc, union ccb *ccb) +{ + struct mmc_ios *ios; + struct mmc_ios *new_ios; + struct ccb_trans_settings_mmc *cts; + int res; + + ios = &sc->host.ios; + + cts = &ccb->cts.proto_specific.mmc; + new_ios = &cts->ios; + + /* Update only requested fields */ + if (cts->ios_valid & MMC_CLK) { + ios->clock = new_ios->clock; + if (bootverbose) + device_printf(sc->dev, "Clock => %d\n", ios->clock); + } + if (cts->ios_valid & MMC_VDD) { + ios->vdd = new_ios->vdd; + if (bootverbose) + device_printf(sc->dev, "VDD => %d\n", ios->vdd); + } + if (cts->ios_valid & MMC_CS) { + ios->chip_select = new_ios->chip_select; + if (bootverbose) + device_printf(sc->dev, "CS => %d\n", ios->chip_select); + } + if (cts->ios_valid & MMC_BW) { + ios->bus_width = new_ios->bus_width; + if (bootverbose) + device_printf(sc->dev, "Bus width => %d\n", ios->bus_width); + } + if (cts->ios_valid & MMC_PM) { + ios->power_mode = new_ios->power_mode; + if (bootverbose) + device_printf(sc->dev, "Power mode => %d\n", ios->power_mode); + } + if (cts->ios_valid & MMC_BT) { + ios->timing = new_ios->timing; + if (bootverbose) + device_printf(sc->dev, "Timing => %d\n", ios->timing); + } + if (cts->ios_valid & MMC_BM) { + ios->bus_mode = new_ios->bus_mode; + if (bootverbose) + device_printf(sc->dev, "Bus mode => %d\n", ios->bus_mode); + } + if (cts->ios_valid & MMC_VCCQ) { + ios->vccq = new_ios->vccq; + if (bootverbose) + device_printf(sc->dev, "VCCQ => %d\n", ios->vccq); + res = dwmmc_switch_vccq(sc->dev, NULL); + device_printf(sc->dev, "VCCQ switch result: %d\n", res); + } + + return (dwmmc_update_ios(sc->dev, NULL)); +} + +static int +dwmmc_cam_request(struct dwmmc_softc *sc, union ccb *ccb) +{ + struct ccb_mmcio *mmcio; + + mmcio = &ccb->mmcio; + + DWMMC_LOCK(sc); + +#ifdef DEBUG + if (__predict_false(bootverbose)) { + device_printf(sc->dev, "CMD%u arg %#x flags %#x dlen %u dflags %#x\n", + mmcio->cmd.opcode, mmcio->cmd.arg, mmcio->cmd.flags, + mmcio->cmd.data != NULL ? (unsigned int) mmcio->cmd.data->len : 0, + mmcio->cmd.data != NULL ? mmcio->cmd.data->flags: 0); + } +#endif + if (mmcio->cmd.data != NULL) { + if (mmcio->cmd.data->len == 0 || mmcio->cmd.data->flags == 0) + panic("data->len = %d, data->flags = %d -- something is b0rked", + (int)mmcio->cmd.data->len, mmcio->cmd.data->flags); + } + if (sc->ccb != NULL) { + device_printf(sc->dev, "Controller still has an active command\n"); + return (EBUSY); + } + sc->ccb = ccb; + DWMMC_UNLOCK(sc); + dwmmc_request(sc->dev, NULL, NULL); + + return (0); +} +#endif static device_method_t dwmmc_methods[] = { /* Bus interface */ Modified: head/sys/dev/mmc/host/dwmmc_var.h ============================================================================== --- head/sys/dev/mmc/host/dwmmc_var.h Fri Jul 24 18:44:50 2020 (r363488) +++ head/sys/dev/mmc/host/dwmmc_var.h Fri Jul 24 19:52:52 2020 (r363489) @@ -39,6 +39,8 @@ #include #endif +#include "opt_mmccam.h" + enum { HWTYPE_NONE, HWTYPE_ALTERA, @@ -54,7 +56,14 @@ struct dwmmc_softc { struct mmc_host host; struct mmc_fdt_helper mmc_helper; struct mtx sc_mtx; +#ifdef MMCCAM + union ccb * ccb; + struct cam_devq * devq; + struct cam_sim * sim; + struct mtx sim_mtx; +#else struct mmc_request *req; +#endif struct mmc_command *curcmd; uint32_t flags; uint32_t hwtype; From owner-svn-src-all@freebsd.org Fri Jul 24 19:54:16 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3FD9737228C; Fri, 24 Jul 2020 19:54: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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BD0Jm0xJ8z4Bv8; Fri, 24 Jul 2020 19:54:16 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 042F7FC38; Fri, 24 Jul 2020 19:54:16 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06OJsFW9081113; Fri, 24 Jul 2020 19:54:15 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06OJsFvh081112; Fri, 24 Jul 2020 19:54:15 GMT (envelope-from mav@FreeBSD.org) Message-Id: <202007241954.06OJsFvh081112@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 24 Jul 2020 19:54:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363490 - head/sys/x86/x86 X-SVN-Group: head X-SVN-Commit-Author: mav X-SVN-Commit-Paths: head/sys/x86/x86 X-SVN-Commit-Revision: 363490 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 24 Jul 2020 19:54:16 -0000 Author: mav Date: Fri Jul 24 19:54:15 2020 New Revision: 363490 URL: https://svnweb.freebsd.org/changeset/base/363490 Log: Make lapic_ipi_vectored(APIC_IPI_DEST_SELF) NMI safe. Sending IPI to self or all CPUs does not require write into upper part of the ICR, prone to races. Previously the code disabled interrupts, but it was not enough for NMIs. Instead of that when possible write only lower part of the register, or use special SELF IPI register in x2APIC mode. This also removes ICR reads used to preserve reserved bits on write. It was there from the beginning, but I failed to find explanation why, neither I see Linux doing it. Specification even tells that ICR content may be lost in deep C-states, so if hardware does not bother to preserve it, why should we? MFC after: 2 weeks Sponsored by: iXsystems, Inc. Modified: head/sys/x86/x86/local_apic.c Modified: head/sys/x86/x86/local_apic.c ============================================================================== --- head/sys/x86/x86/local_apic.c Fri Jul 24 19:52:52 2020 (r363489) +++ head/sys/x86/x86/local_apic.c Fri Jul 24 19:54:15 2020 (r363490) @@ -254,22 +254,6 @@ lapic_write32_nofence(enum LAPIC_REGISTERS reg, uint32 #ifdef SMP static uint64_t -lapic_read_icr(void) -{ - uint64_t v; - uint32_t vhi, vlo; - - if (x2apic_mode) { - v = rdmsr(MSR_APIC_000 + LAPIC_ICR_LO); - } else { - vhi = lapic_read32(LAPIC_ICR_HI); - vlo = lapic_read32(LAPIC_ICR_LO); - v = ((uint64_t)vhi << 32) | vlo; - } - return (v); -} - -static uint64_t lapic_read_icr_lo(void) { @@ -279,6 +263,7 @@ lapic_read_icr_lo(void) static void lapic_write_icr(uint32_t vhi, uint32_t vlo) { + register_t saveintr; uint64_t v; if (x2apic_mode) { @@ -286,10 +271,32 @@ lapic_write_icr(uint32_t vhi, uint32_t vlo) mfence(); wrmsr(MSR_APIC_000 + LAPIC_ICR_LO, v); } else { + saveintr = intr_disable(); lapic_write32(LAPIC_ICR_HI, vhi); lapic_write32(LAPIC_ICR_LO, vlo); + intr_restore(saveintr); } } + +static void +lapic_write_icr_lo(uint32_t vlo) +{ + + if (x2apic_mode) { + mfence(); + wrmsr(MSR_APIC_000 + LAPIC_ICR_LO, vlo); + } else { + lapic_write32(LAPIC_ICR_LO, vlo); + } +} + +static void +lapic_write_self_ipi(uint32_t vector) +{ + + KASSERT(x2apic_mode, ("SELF IPI write in xAPIC mode")); + wrmsr(MSR_APIC_000 + LAPIC_SELF_IPI, vector); +} #endif /* SMP */ static void @@ -1991,9 +1998,7 @@ native_lapic_ipi_wait(int delay) static void native_lapic_ipi_raw(register_t icrlo, u_int dest) { - uint64_t icr; - uint32_t vhi, vlo; - register_t saveintr; + uint32_t icrhi; /* XXX: Need more sanity checking of icrlo? */ KASSERT(x2apic_mode || lapic_map != NULL, @@ -2004,35 +2009,15 @@ native_lapic_ipi_raw(register_t icrlo, u_int dest) KASSERT((icrlo & APIC_ICRLO_RESV_MASK) == 0, ("%s: reserved bits set in ICR LO register", __func__)); - /* Set destination in ICR HI register if it is being used. */ - if (!x2apic_mode) { - saveintr = intr_disable(); - icr = lapic_read_icr(); - } - if ((icrlo & APIC_DEST_MASK) == APIC_DEST_DESTFLD) { - if (x2apic_mode) { - vhi = dest; - } else { - vhi = icr >> 32; - vhi &= ~APIC_ID_MASK; - vhi |= dest << APIC_ID_SHIFT; - } + if (x2apic_mode) + icrhi = dest; + else + icrhi = dest << APIC_ID_SHIFT; + lapic_write_icr(icrhi, icrlo); } else { - vhi = 0; + lapic_write_icr_lo(icrlo); } - - /* Program the contents of the IPI and dispatch it. */ - if (x2apic_mode) { - vlo = icrlo; - } else { - vlo = icr; - vlo &= APIC_ICRLO_RESV_MASK; - vlo |= icrlo; - } - lapic_write_icr(vhi, vlo); - if (!x2apic_mode) - intr_restore(saveintr); } #define BEFORE_SPIN 50000 @@ -2048,33 +2033,38 @@ native_lapic_ipi_vectored(u_int vector, int dest) KASSERT((vector & ~APIC_VECTOR_MASK) == 0, ("%s: invalid vector %d", __func__, vector)); - icrlo = APIC_DESTMODE_PHY | APIC_TRIGMOD_EDGE | APIC_LEVEL_ASSERT; - - /* - * NMI IPIs are just fake vectors used to send a NMI. Use special rules - * regarding NMIs if passed, otherwise specify the vector. - */ - if (vector >= IPI_NMI_FIRST) - icrlo |= APIC_DELMODE_NMI; - else - icrlo |= vector | APIC_DELMODE_FIXED; destfield = 0; switch (dest) { case APIC_IPI_DEST_SELF: - icrlo |= APIC_DEST_SELF; + if (x2apic_mode && vector < IPI_NMI_FIRST) { + lapic_write_self_ipi(vector); + return; + } + icrlo = APIC_DEST_SELF; break; case APIC_IPI_DEST_ALL: - icrlo |= APIC_DEST_ALLISELF; + icrlo = APIC_DEST_ALLISELF; break; case APIC_IPI_DEST_OTHERS: - icrlo |= APIC_DEST_ALLESELF; + icrlo = APIC_DEST_ALLESELF; break; default: + icrlo = 0; KASSERT(x2apic_mode || (dest & ~(APIC_ID_MASK >> APIC_ID_SHIFT)) == 0, ("%s: invalid destination 0x%x", __func__, dest)); destfield = dest; } + + /* + * NMI IPIs are just fake vectors used to send a NMI. Use special rules + * regarding NMIs if passed, otherwise specify the vector. + */ + if (vector >= IPI_NMI_FIRST) + icrlo |= APIC_DELMODE_NMI; + else + icrlo |= vector | APIC_DELMODE_FIXED; + icrlo |= APIC_DESTMODE_PHY | APIC_TRIGMOD_EDGE | APIC_LEVEL_ASSERT; /* Wait for an earlier IPI to finish. */ if (!lapic_ipi_wait(BEFORE_SPIN)) { From owner-svn-src-all@freebsd.org Fri Jul 24 20:09:53 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0849C3727A6; Fri, 24 Jul 2020 20:09:53 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BD0fm6BVjz4CVq; Fri, 24 Jul 2020 20:09:52 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B7B62FD15; Fri, 24 Jul 2020 20:09:52 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06OK9qZb088034; Fri, 24 Jul 2020 20:09:52 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06OK9qfN088033; Fri, 24 Jul 2020 20:09:52 GMT (envelope-from kp@FreeBSD.org) Message-Id: <202007242009.06OK9qfN088033@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Fri, 24 Jul 2020 20:09:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r363491 - stable/12/sys/net X-SVN-Group: stable-12 X-SVN-Commit-Author: kp X-SVN-Commit-Paths: stable/12/sys/net X-SVN-Commit-Revision: 363491 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 24 Jul 2020 20:09:53 -0000 Author: kp Date: Fri Jul 24 20:09:52 2020 New Revision: 363491 URL: https://svnweb.freebsd.org/changeset/base/363491 Log: bridge: Fix mismerges from r360345 In r362650 we merged r360345. This required manual changes due to the differences in EPOCH macros between head and stable/12, and was done imperfectly. This is a direct commit to stable/12. PR: 248046 Modified: stable/12/sys/net/if_bridge.c Modified: stable/12/sys/net/if_bridge.c ============================================================================== --- stable/12/sys/net/if_bridge.c Fri Jul 24 19:54:15 2020 (r363490) +++ stable/12/sys/net/if_bridge.c Fri Jul 24 20:09:52 2020 (r363491) @@ -189,41 +189,14 @@ extern void nd6_setmtu(struct ifnet *); */ #define BRIDGE_LOCK_INIT(_sc) do { \ mtx_init(&(_sc)->sc_mtx, "if_bridge", NULL, MTX_DEF); \ - cv_init(&(_sc)->sc_cv, "if_bridge_cv"); \ } while (0) #define BRIDGE_LOCK_DESTROY(_sc) do { \ mtx_destroy(&(_sc)->sc_mtx); \ - cv_destroy(&(_sc)->sc_cv); \ } while (0) #define BRIDGE_LOCK(_sc) mtx_lock(&(_sc)->sc_mtx) #define BRIDGE_UNLOCK(_sc) mtx_unlock(&(_sc)->sc_mtx) #define BRIDGE_LOCK_ASSERT(_sc) mtx_assert(&(_sc)->sc_mtx, MA_OWNED) #define BRIDGE_UNLOCK_ASSERT(_sc) mtx_assert(&(_sc)->sc_mtx, MA_NOTOWNED) -#define BRIDGE_LOCK2REF(_sc, _err) do { \ - mtx_assert(&(_sc)->sc_mtx, MA_OWNED); \ - if ((_sc)->sc_iflist_xcnt > 0) \ - (_err) = EBUSY; \ - else \ - (_sc)->sc_iflist_ref++; \ - mtx_unlock(&(_sc)->sc_mtx); \ -} while (0) -#define BRIDGE_UNREF(_sc) do { \ - mtx_lock(&(_sc)->sc_mtx); \ - (_sc)->sc_iflist_ref--; \ - if (((_sc)->sc_iflist_xcnt > 0) && ((_sc)->sc_iflist_ref == 0)) \ - cv_broadcast(&(_sc)->sc_cv); \ - mtx_unlock(&(_sc)->sc_mtx); \ -} while (0) -#define BRIDGE_XLOCK(_sc) do { \ - mtx_assert(&(_sc)->sc_mtx, MA_OWNED); \ - (_sc)->sc_iflist_xcnt++; \ - while ((_sc)->sc_iflist_ref > 0) \ - cv_wait(&(_sc)->sc_cv, &(_sc)->sc_mtx); \ -} while (0) -#define BRIDGE_XDROP(_sc) do { \ - mtx_assert(&(_sc)->sc_mtx, MA_OWNED); \ - (_sc)->sc_iflist_xcnt--; \ -} while (0) /* * Bridge interface list entry. @@ -265,13 +238,10 @@ struct bridge_softc { struct ifnet *sc_ifp; /* make this an interface */ LIST_ENTRY(bridge_softc) sc_list; struct mtx sc_mtx; - struct cv sc_cv; uint32_t sc_brtmax; /* max # of addresses */ uint32_t sc_brtcnt; /* cur. # of addresses */ uint32_t sc_brttimeout; /* rt timeout in seconds */ struct callout sc_brcallout; /* bridge callout */ - uint32_t sc_iflist_ref; /* refcount for sc_iflist */ - uint32_t sc_iflist_xcnt; /* refcount for sc_iflist */ CK_LIST_HEAD(, bridge_iflist) sc_iflist; /* member interface list */ CK_LIST_HEAD(, bridge_rtnode) *sc_rthash; /* our forwarding table */ CK_LIST_HEAD(, bridge_rtnode) sc_rtlist; /* list version of above */ @@ -790,7 +760,9 @@ bridge_clone_destroy(struct ifnet *ifp) { struct bridge_softc *sc = ifp->if_softc; struct bridge_iflist *bif; + struct epoch_tracker et; + NET_EPOCH_ENTER_ET(et); BRIDGE_LOCK(sc); bridge_stop(ifp, 1); @@ -815,6 +787,8 @@ bridge_clone_destroy(struct ifnet *ifp) BRIDGE_LIST_UNLOCK(); bstp_detach(&sc->sc_stp); + NET_EPOCH_EXIT_ET(et); + ether_ifdetach(ifp); if_free(ifp); @@ -994,7 +968,6 @@ bridge_mutecaps(struct bridge_softc *sc) mask &= bif->bif_savedcaps; } - BRIDGE_XLOCK(sc); CK_LIST_FOREACH(bif, &sc->sc_iflist, bif_next) { enabled = bif->bif_ifp->if_capenable; enabled &= ~BRIDGE_IFCAPS_STRIP; @@ -1005,8 +978,6 @@ bridge_mutecaps(struct bridge_softc *sc) bridge_set_ifcap(sc, bif, enabled); BRIDGE_LOCK(sc); } - BRIDGE_XDROP(sc); - } static void @@ -1107,9 +1078,7 @@ bridge_delete_member(struct bridge_softc *sc, struct b bstp_disable(&bif->bif_stp); ifs->if_bridge = NULL; - BRIDGE_XLOCK(sc); CK_LIST_REMOVE(bif, bif_next); - BRIDGE_XDROP(sc); /* * If removing the interface that gave the bridge its mac address, set @@ -1245,7 +1214,6 @@ bridge_ioctl_add(struct bridge_softc *sc, void *arg) * If any, remove all inet6 addresses from the member * interfaces. */ - BRIDGE_XLOCK(sc); CK_LIST_FOREACH(bif, &sc->sc_iflist, bif_next) { if (in6ifa_llaonifp(bif->bif_ifp)) { BRIDGE_UNLOCK(sc); @@ -1258,7 +1226,6 @@ bridge_ioctl_add(struct bridge_softc *sc, void *arg) bif->bif_ifp->if_xname); } } - BRIDGE_XDROP(sc); if (in6ifa_llaonifp(ifs)) { BRIDGE_UNLOCK(sc); in6_ifdetach(ifs); From owner-svn-src-all@freebsd.org Fri Jul 24 20:10:28 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9A39C372727; Fri, 24 Jul 2020 20:10:28 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BD0gS3gV7z4CtG; Fri, 24 Jul 2020 20:10:28 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 606C0FC56; Fri, 24 Jul 2020 20:10:28 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06OKAS1S088294; Fri, 24 Jul 2020 20:10:28 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06OKASRt088293; Fri, 24 Jul 2020 20:10:28 GMT (envelope-from kp@FreeBSD.org) Message-Id: <202007242010.06OKASRt088293@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Fri, 24 Jul 2020 20:10:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r363492 - stable/12/sys/net X-SVN-Group: stable-12 X-SVN-Commit-Author: kp X-SVN-Commit-Paths: stable/12/sys/net X-SVN-Commit-Revision: 363492 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 24 Jul 2020 20:10:28 -0000 Author: kp Date: Fri Jul 24 20:10:27 2020 New Revision: 363492 URL: https://svnweb.freebsd.org/changeset/base/363492 Log: bridge: Enter epoch for bridge_transmit() Just like the change done for bridge_input()/bridge_output() in r363430 we must enter epoch ourselves, because its coverage is not as wide as in head. This is a direct commit to stable/12. PR: 248046 Modified: stable/12/sys/net/if_bridge.c Modified: stable/12/sys/net/if_bridge.c ============================================================================== --- stable/12/sys/net/if_bridge.c Fri Jul 24 20:09:52 2020 (r363491) +++ stable/12/sys/net/if_bridge.c Fri Jul 24 20:10:27 2020 (r363492) @@ -2189,11 +2189,14 @@ sendunicast: static int bridge_transmit(struct ifnet *ifp, struct mbuf *m) { + struct epoch_tracker et; struct bridge_softc *sc; struct ether_header *eh; struct ifnet *dst_if; int error = 0; + NET_EPOCH_ENTER_ET(et); + sc = ifp->if_softc; ETHER_BPF_MTAP(ifp, m); @@ -2205,6 +2208,8 @@ bridge_transmit(struct ifnet *ifp, struct mbuf *m) error = bridge_enqueue(sc, dst_if, m); } else bridge_broadcast(sc, ifp, m, 0); + + NET_EPOCH_EXIT_ET(et); return (error); } From owner-svn-src-all@freebsd.org Fri Jul 24 20:44:51 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A9A9D373BA8; Fri, 24 Jul 2020 20:44:51 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BD1R73q4Gz4GD3; Fri, 24 Jul 2020 20:44:51 +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 4D7ED106DB; Fri, 24 Jul 2020 20:44:51 +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 06OKip3r013389; Fri, 24 Jul 2020 20:44:51 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06OKio9e013387; Fri, 24 Jul 2020 20:44:50 GMT (envelope-from mav@FreeBSD.org) Message-Id: <202007242044.06OKio9e013387@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 24 Jul 2020 20:44:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363493 - in head/sys/x86: include x86 X-SVN-Group: head X-SVN-Commit-Author: mav X-SVN-Commit-Paths: in head/sys/x86: include x86 X-SVN-Commit-Revision: 363493 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 24 Jul 2020 20:44:51 -0000 Author: mav Date: Fri Jul 24 20:44:50 2020 New Revision: 363493 URL: https://svnweb.freebsd.org/changeset/base/363493 Log: Use APIC_IPI_DEST_OTHERS for bitmapped IPIs too. It should save bunch of LAPIC register accesses. MFC after: 2 weeks Modified: head/sys/x86/include/x86_smp.h head/sys/x86/x86/mp_x86.c Modified: head/sys/x86/include/x86_smp.h ============================================================================== --- head/sys/x86/include/x86_smp.h Fri Jul 24 20:10:27 2020 (r363492) +++ head/sys/x86/include/x86_smp.h Fri Jul 24 20:44:50 2020 (r363493) @@ -107,6 +107,5 @@ void smp_masked_invltlb(cpuset_t mask, struct pmap *pm smp_invl_cb_t curcpu_cb); void mem_range_AP_init(void); void topo_probe(void); -void ipi_send_cpu(int cpu, u_int ipi); #endif Modified: head/sys/x86/x86/mp_x86.c ============================================================================== --- head/sys/x86/x86/mp_x86.c Fri Jul 24 20:10:27 2020 (r363492) +++ head/sys/x86/x86/mp_x86.c Fri Jul 24 20:44:50 2020 (r363493) @@ -1233,32 +1233,39 @@ ipi_startup(int apic_id, int vector) DELAY(200); /* wait ~200uS */ } +static bool +ipi_bitmap_set(int cpu, u_int ipi) +{ + u_int bitmap, old, new; + u_int *cpu_bitmap; + + bitmap = 1 << ipi; + cpu_bitmap = &cpuid_to_pcpu[cpu]->pc_ipi_bitmap; + old = *cpu_bitmap; + for (;;) { + if ((old & bitmap) != 0) + break; + new = old | bitmap; + if (atomic_fcmpset_int(cpu_bitmap, &old, new)) + break; + } + return (old != 0); +} + /* * Send an IPI to specified CPU handling the bitmap logic. */ -void +static void ipi_send_cpu(int cpu, u_int ipi) { - u_int bitmap, old, new; - u_int *cpu_bitmap; KASSERT((u_int)cpu < MAXCPU && cpu_apic_ids[cpu] != -1, ("IPI to non-existent CPU %d", cpu)); if (IPI_IS_BITMAPED(ipi)) { - bitmap = 1 << ipi; - ipi = IPI_BITMAP_VECTOR; - cpu_bitmap = &cpuid_to_pcpu[cpu]->pc_ipi_bitmap; - old = *cpu_bitmap; - for (;;) { - if ((old & bitmap) == bitmap) - break; - new = old | bitmap; - if (atomic_fcmpset_int(cpu_bitmap, &old, new)) - break; - } - if (old) + if (ipi_bitmap_set(cpu, ipi)) return; + ipi = IPI_BITMAP_VECTOR; } lapic_ipi_vectored(ipi, cpu_apic_ids[cpu]); } @@ -1366,23 +1373,28 @@ void ipi_all_but_self(u_int ipi) { cpuset_t other_cpus; + int cpu, c; - other_cpus = all_cpus; - CPU_CLR(PCPU_GET(cpuid), &other_cpus); - if (IPI_IS_BITMAPED(ipi)) { - ipi_selected(other_cpus, ipi); - return; - } - /* * IPI_STOP_HARD maps to a NMI and the trap handler needs a bit * of help in order to understand what is the source. * Set the mask of receiving CPUs for this purpose. */ - if (ipi == IPI_STOP_HARD) + if (ipi == IPI_STOP_HARD) { + other_cpus = all_cpus; + CPU_CLR(PCPU_GET(cpuid), &other_cpus); CPU_OR_ATOMIC(&ipi_stop_nmi_pending, &other_cpus); + } CTR2(KTR_SMP, "%s: ipi: %x", __func__, ipi); + if (IPI_IS_BITMAPED(ipi)) { + cpu = PCPU_GET(cpuid); + CPU_FOREACH(c) { + if (c != cpu) + ipi_bitmap_set(c, ipi); + } + ipi = IPI_BITMAP_VECTOR; + } lapic_ipi_vectored(ipi, APIC_IPI_DEST_OTHERS); } From owner-svn-src-all@freebsd.org Fri Jul 24 20:48:13 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6AD0A373D2B; Fri, 24 Jul 2020 20:48:13 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BD1W11jYBz4GKq; Fri, 24 Jul 2020 20:48:13 +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 0373D105A3; Fri, 24 Jul 2020 20:48:13 +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 06OKmCdu013761; Fri, 24 Jul 2020 20:48:12 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06OKm7vm013727; Fri, 24 Jul 2020 20:48:07 GMT (envelope-from dim@FreeBSD.org) Message-Id: <202007242048.06OKm7vm013727@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Fri, 24 Jul 2020 20:48:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r363494 - in stable/12: . contrib/llvm-project contrib/llvm-project/clang/include/clang/AST contrib/llvm-project/clang/include/clang/Basic contrib/llvm-project/clang/include/clang/Drive... X-SVN-Group: stable-12 X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in stable/12: . contrib/llvm-project contrib/llvm-project/clang/include/clang/AST contrib/llvm-project/clang/include/clang/Basic contrib/llvm-project/clang/include/clang/Driver contrib/llvm-project/cl... X-SVN-Commit-Revision: 363494 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 24 Jul 2020 20:48:13 -0000 Author: dim Date: Fri Jul 24 20:48:06 2020 New Revision: 363494 URL: https://svnweb.freebsd.org/changeset/base/363494 Log: Merge llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and openmp 10.0.1 final (aka llvmorg-10.0.1-0-gef32c611aa2). MFC r359582 (by emaste): lldb: use lua as the default script language In the FreeBSD base system we do not have Python support in lldb, but will have Lua support. Make Lua the default. This needs to be made into a configure-time option; that is being discussed upstream and will appear in a future lldb import. For now carry this change as a tiny patch to our copy of lldb. MFC r359599 (by emaste): lldb: add rule to generate LLDBWrapLua.cpp Building lldb's lua/python bindings requires swig, but we do not want to include it in the FreeBSD base system (as a build tool) because it has non-trivial dependencies. As a workaround, add a make rule to generate LLDBWrapLua.cpp, and we will commit the generated file. Requires the swig30 package. Reviewed by: brooks Discussed with: dim Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D24265 MFC r359600 (by emaste): lldb: commit generated LLDBWrapLua.cpp MFC r359606 (by emaste): lldb: build and enable lua script bindings Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D24266 MFC r360697: In r358396 I merged llvm upstream commit 2e24219d3, which fixed "error: unsupported relocation on symbol" when assembling arm 'adr' pseudo instructions. However, the upstream commit did not take big-endian arm into account. Applying the same changes to the big-endian handling is straightforward, thanks to Andrew Turner and Peter Smith for the hint. This will also be submitted upstream. MFC r360702: Merge commit 4ca2cad94 from llvm git (by Justin Hibbits): [PowerPC] Add clang -msvr4-struct-return for 32-bit ELF Summary: Change the default ABI to be compatible with GCC. For 32-bit ELF targets other than Linux, Clang now returns small structs in registers r3/r4. This affects FreeBSD, NetBSD, OpenBSD. There is no change for 32-bit Linux, where Clang continues to return all structs in memory. Add clang options -maix-struct-return (to return structs in memory) and -msvr4-struct-return (to return structs in registers) to be compatible with gcc. These options are only for PPC32; reject them on PPC64 and other targets. The options are like -fpcc-struct-return and -freg-struct-return for X86_32, and use similar code. To actually return a struct in registers, coerce it to an integer of the same size. LLVM may optimize the code to remove unnecessary accesses to memory, and will return i32 in r3 or i64 in r3:r4. Fixes PR#40736 Patch by George Koehler! Reviewed By: jhibbits, nemanjai Differential Revision: https://reviews.llvm.org/D73290 Requested by: jhibbits MFC r361410: Merge llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and openmp llvmorg-10.0.1-rc1-0-gf79cd71e145 (aka 10.0.1 rc1). MFC r362235 (by kp): llvm: Default to -mno-relax on RISC-V Compiling on a RISC-V system fails with 'relocation R_RISCV_ALIGN requires unimplemented linker relaxation; recompile with -mno-relax'. Our default linker (ld.lld) doesn't support relaxation, so default to no-relax so we don't generate object files the linker can't handle. Reviewed by: mhorne Sponsored by: Axiado Differential Revision: https://reviews.freebsd.org/D25210 MFC r362445: Merge llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and openmp llvmorg-10.0.0-97-g6f71678ecd2 (not quite 10.0.1 rc2, as more fixes are still pending). MFC r362587 (by cem): Add WITH_CLANG_FORMAT option clang-format is enabled conditional on either WITH_CLANG_EXTRAS or WITH_CLANG_FORMAT. Some sources in libclang are build conditional on either rule, and obviously the clang-format binary itself depends on the rule. clang-format could still use a manual page. Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D25427 MFC r362609: Merge llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and openmp llvmorg-10.0.0-129-gd24d5c8e308. Getting closer to 10.0.1-rc2. MFC r362679: Regenerate ReStructuredText based manpages for llvm-project tools: * bugpoint.1 * clang.1 * llc.1 * lldb.1 * lli.1 * llvm-ar.1 * llvm-as.1 * llvm-bcanalyzer.1 * llvm-cov.1 * llvm-diff.1 * llvm-dis.1 * llvm-dwarfdump.1 * llvm-extract.1 * llvm-link.1 * llvm-mca.1 * llvm-nm.1 * llvm-pdbutil.1 * llvm-profdata.1 * llvm-symbolizer.1 * llvm-tblgen.1 * opt.1 Add newly generated manpages for: * llvm-addr2line.1 (this is an alias of llvm-symbolizer) * llvm-cxxfilt.1 * llvm-objcopy.1 * llvm-ranlib.1 (this is an alias of llvm-ar) Note that llvm-objdump.1 is an exception, as upstream has both a plain .1 file, and a .rst variant. These will have to be reconciled upstream first. MFC r362680: Follow-up to r362679, add more entries to OptionalObsoleteFiles.inc MFC r362719: Merge llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and openmp llvmorg-10.0.1-rc2-0-g77d76b71d7d. Also add a few more llvm utilities under WITH_CLANG_EXTRAS: * llvm-dwp, a utility for merging DWARF 5 Split DWARF .dwo files into .dwp (DWARF package files) * llvm-size, a size(1) replacement * llvm-strings, a strings(1) replacement MFC r362733: Remove older llvm-ranlib.1 entry from ObsoleteFiles.inc, as it has gotten its own manpage now, and should be no longer be removed by "make delete-old". MFC r362734: Fix llvm-strings.1 not installing, this was a copy/paste error. MFC r363401: Merge llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and openmp 10.0.1 final (aka llvmorg-10.0.1-0-gef32c611aa2). There were no changes since rc2, except in the upstream regression tests, which we do not ship. Relnotes: yes Added: stable/12/contrib/llvm-project/compiler-rt/lib/builtins/riscv/int_mul_impl.inc - copied unchanged from r362719, head/contrib/llvm-project/compiler-rt/lib/builtins/riscv/int_mul_impl.inc stable/12/contrib/llvm-project/compiler-rt/lib/builtins/riscv/muldi3.S - copied unchanged from r362719, head/contrib/llvm-project/compiler-rt/lib/builtins/riscv/muldi3.S stable/12/contrib/llvm-project/llvm/include/llvm/CodeGen/RDFGraph.h - copied unchanged from r362609, head/contrib/llvm-project/llvm/include/llvm/CodeGen/RDFGraph.h stable/12/contrib/llvm-project/llvm/include/llvm/CodeGen/RDFLiveness.h - copied unchanged from r362609, head/contrib/llvm-project/llvm/include/llvm/CodeGen/RDFLiveness.h stable/12/contrib/llvm-project/llvm/include/llvm/CodeGen/RDFRegisters.h - copied unchanged from r362609, head/contrib/llvm-project/llvm/include/llvm/CodeGen/RDFRegisters.h stable/12/contrib/llvm-project/llvm/lib/CodeGen/RDFGraph.cpp - copied unchanged from r362609, head/contrib/llvm-project/llvm/lib/CodeGen/RDFGraph.cpp stable/12/contrib/llvm-project/llvm/lib/CodeGen/RDFLiveness.cpp - copied unchanged from r362609, head/contrib/llvm-project/llvm/lib/CodeGen/RDFLiveness.cpp stable/12/contrib/llvm-project/llvm/lib/CodeGen/RDFRegisters.cpp - copied unchanged from r362609, head/contrib/llvm-project/llvm/lib/CodeGen/RDFRegisters.cpp stable/12/contrib/llvm-project/llvm/lib/Target/AArch64/AArch64SchedThunderX3T110.td - copied unchanged from r362445, head/contrib/llvm-project/llvm/lib/Target/AArch64/AArch64SchedThunderX3T110.td stable/12/contrib/llvm-project/llvm/lib/Target/X86/ImmutableGraph.h - copied unchanged from r362609, head/contrib/llvm-project/llvm/lib/Target/X86/ImmutableGraph.h stable/12/contrib/llvm-project/llvm/lib/Target/X86/X86IndirectThunks.cpp - copied unchanged from r362609, head/contrib/llvm-project/llvm/lib/Target/X86/X86IndirectThunks.cpp stable/12/contrib/llvm-project/llvm/lib/Target/X86/X86LoadValueInjectionLoadHardening.cpp - copied unchanged from r362609, head/contrib/llvm-project/llvm/lib/Target/X86/X86LoadValueInjectionLoadHardening.cpp stable/12/contrib/llvm-project/llvm/lib/Target/X86/X86LoadValueInjectionRetHardening.cpp - copied unchanged from r362609, head/contrib/llvm-project/llvm/lib/Target/X86/X86LoadValueInjectionRetHardening.cpp stable/12/contrib/llvm-project/llvm/tools/llvm-dwp/ - copied from r362719, head/contrib/llvm-project/llvm/tools/llvm-dwp/ stable/12/contrib/llvm-project/llvm/tools/llvm-size/ - copied from r362719, head/contrib/llvm-project/llvm/tools/llvm-size/ stable/12/contrib/llvm-project/llvm/tools/llvm-strings/ - copied from r362719, head/contrib/llvm-project/llvm/tools/llvm-strings/ stable/12/lib/clang/liblldb/LLDBWrapLua.cpp - copied unchanged from r359600, head/lib/clang/liblldb/LLDBWrapLua.cpp stable/12/tools/build/options/WITH_CLANG_FORMAT - copied unchanged from r362587, head/tools/build/options/WITH_CLANG_FORMAT stable/12/usr.bin/clang/llvm-ar/llvm-ranlib.1 - copied unchanged from r362679, head/usr.bin/clang/llvm-ar/llvm-ranlib.1 stable/12/usr.bin/clang/llvm-cxxfilt/llvm-cxxfilt.1 - copied unchanged from r362679, head/usr.bin/clang/llvm-cxxfilt/llvm-cxxfilt.1 stable/12/usr.bin/clang/llvm-dwp/ - copied from r362719, head/usr.bin/clang/llvm-dwp/ stable/12/usr.bin/clang/llvm-objcopy/llvm-objcopy.1 - copied unchanged from r362679, head/usr.bin/clang/llvm-objcopy/llvm-objcopy.1 stable/12/usr.bin/clang/llvm-size/ - copied from r362719, head/usr.bin/clang/llvm-size/ stable/12/usr.bin/clang/llvm-strings/ - copied from r362719, head/usr.bin/clang/llvm-strings/ stable/12/usr.bin/clang/llvm-symbolizer/llvm-addr2line.1 - copied unchanged from r362679, head/usr.bin/clang/llvm-symbolizer/llvm-addr2line.1 Deleted: stable/12/contrib/llvm-project/llvm/lib/Target/Hexagon/RDFGraph.cpp stable/12/contrib/llvm-project/llvm/lib/Target/Hexagon/RDFGraph.h stable/12/contrib/llvm-project/llvm/lib/Target/Hexagon/RDFLiveness.cpp stable/12/contrib/llvm-project/llvm/lib/Target/Hexagon/RDFLiveness.h stable/12/contrib/llvm-project/llvm/lib/Target/Hexagon/RDFRegisters.cpp stable/12/contrib/llvm-project/llvm/lib/Target/Hexagon/RDFRegisters.h stable/12/contrib/llvm-project/llvm/lib/Target/X86/X86RetpolineThunks.cpp Modified: stable/12/Makefile.inc1 stable/12/ObsoleteFiles.inc stable/12/UPDATING stable/12/contrib/llvm-project/FREEBSD-Xlist stable/12/contrib/llvm-project/clang/include/clang/AST/DeclBase.h stable/12/contrib/llvm-project/clang/include/clang/Basic/Attr.td stable/12/contrib/llvm-project/clang/include/clang/Driver/Options.td stable/12/contrib/llvm-project/clang/lib/AST/DeclBase.cpp stable/12/contrib/llvm-project/clang/lib/AST/ExprConstant.cpp stable/12/contrib/llvm-project/clang/lib/AST/RawCommentList.cpp stable/12/contrib/llvm-project/clang/lib/Basic/Targets/PPC.h stable/12/contrib/llvm-project/clang/lib/CodeGen/CodeGenModule.cpp stable/12/contrib/llvm-project/clang/lib/CodeGen/TargetInfo.cpp stable/12/contrib/llvm-project/clang/lib/Driver/SanitizerArgs.cpp stable/12/contrib/llvm-project/clang/lib/Driver/ToolChain.cpp stable/12/contrib/llvm-project/clang/lib/Driver/ToolChains/Arch/RISCV.cpp stable/12/contrib/llvm-project/clang/lib/Driver/ToolChains/Arch/X86.cpp stable/12/contrib/llvm-project/clang/lib/Driver/ToolChains/Clang.cpp stable/12/contrib/llvm-project/clang/lib/Driver/ToolChains/Darwin.cpp stable/12/contrib/llvm-project/clang/lib/Driver/ToolChains/Gnu.cpp stable/12/contrib/llvm-project/clang/lib/Driver/ToolChains/Gnu.h stable/12/contrib/llvm-project/clang/lib/Driver/ToolChains/Hurd.cpp stable/12/contrib/llvm-project/clang/lib/Driver/ToolChains/Hurd.h stable/12/contrib/llvm-project/clang/lib/Driver/ToolChains/Linux.cpp stable/12/contrib/llvm-project/clang/lib/Driver/ToolChains/Linux.h stable/12/contrib/llvm-project/clang/lib/Format/TokenAnnotator.cpp stable/12/contrib/llvm-project/clang/lib/Frontend/CompilerInvocation.cpp stable/12/contrib/llvm-project/clang/lib/Sema/SemaTemplate.cpp stable/12/contrib/llvm-project/clang/lib/Sema/SemaTemplateInstantiate.cpp stable/12/contrib/llvm-project/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp stable/12/contrib/llvm-project/clang/lib/Sema/TreeTransform.h stable/12/contrib/llvm-project/clang/lib/Tooling/Syntax/Tokens.cpp stable/12/contrib/llvm-project/clang/utils/TableGen/ClangAttrEmitter.cpp stable/12/contrib/llvm-project/compiler-rt/lib/builtins/riscv/mulsi3.S stable/12/contrib/llvm-project/compiler-rt/lib/profile/GCDAProfiling.c stable/12/contrib/llvm-project/libcxx/include/array stable/12/contrib/llvm-project/lld/COFF/Chunks.h stable/12/contrib/llvm-project/lld/COFF/DLL.cpp stable/12/contrib/llvm-project/lld/COFF/MarkLive.cpp stable/12/contrib/llvm-project/lld/ELF/Driver.cpp stable/12/contrib/llvm-project/lld/ELF/InputSection.cpp stable/12/contrib/llvm-project/lld/ELF/InputSection.h stable/12/contrib/llvm-project/lld/ELF/OutputSections.cpp stable/12/contrib/llvm-project/lld/ELF/ScriptLexer.cpp stable/12/contrib/llvm-project/lld/ELF/ScriptParser.cpp stable/12/contrib/llvm-project/lld/ELF/Writer.cpp stable/12/contrib/llvm-project/lldb/include/lldb/lldb-enumerations.h stable/12/contrib/llvm-project/lldb/source/Core/CoreProperties.td stable/12/contrib/llvm-project/llvm/include/llvm/Analysis/ValueLattice.h stable/12/contrib/llvm-project/llvm/include/llvm/DebugInfo/CodeView/GlobalTypeTableBuilder.h stable/12/contrib/llvm-project/llvm/include/llvm/IR/IntrinsicsPowerPC.td stable/12/contrib/llvm-project/llvm/include/llvm/Support/AArch64TargetParser.def stable/12/contrib/llvm-project/llvm/include/llvm/Support/ManagedStatic.h stable/12/contrib/llvm-project/llvm/include/llvm/Target/TargetSelectionDAG.td stable/12/contrib/llvm-project/llvm/lib/Analysis/LazyValueInfo.cpp stable/12/contrib/llvm-project/llvm/lib/Analysis/ValueLattice.cpp stable/12/contrib/llvm-project/llvm/lib/CodeGen/BranchFolding.cpp stable/12/contrib/llvm-project/llvm/lib/CodeGen/MachineSink.cpp stable/12/contrib/llvm-project/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp stable/12/contrib/llvm-project/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp stable/12/contrib/llvm-project/llvm/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp stable/12/contrib/llvm-project/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp stable/12/contrib/llvm-project/llvm/lib/DebugInfo/CodeView/MergingTypeTableBuilder.cpp stable/12/contrib/llvm-project/llvm/lib/DebugInfo/CodeView/TypeStreamMerger.cpp stable/12/contrib/llvm-project/llvm/lib/DebugInfo/PDB/Native/TpiStreamBuilder.cpp stable/12/contrib/llvm-project/llvm/lib/LTO/LTO.cpp stable/12/contrib/llvm-project/llvm/lib/MC/MCObjectFileInfo.cpp stable/12/contrib/llvm-project/llvm/lib/Target/AArch64/AArch64.td stable/12/contrib/llvm-project/llvm/lib/Target/AArch64/AArch64BranchTargets.cpp stable/12/contrib/llvm-project/llvm/lib/Target/AArch64/AArch64FrameLowering.cpp stable/12/contrib/llvm-project/llvm/lib/Target/AArch64/AArch64SchedA53.td stable/12/contrib/llvm-project/llvm/lib/Target/AArch64/AArch64SchedA57.td stable/12/contrib/llvm-project/llvm/lib/Target/AArch64/AArch64SchedCyclone.td stable/12/contrib/llvm-project/llvm/lib/Target/AArch64/AArch64SchedExynosM3.td stable/12/contrib/llvm-project/llvm/lib/Target/AArch64/AArch64SchedExynosM4.td stable/12/contrib/llvm-project/llvm/lib/Target/AArch64/AArch64SchedExynosM5.td stable/12/contrib/llvm-project/llvm/lib/Target/AArch64/AArch64SchedFalkor.td stable/12/contrib/llvm-project/llvm/lib/Target/AArch64/AArch64SchedKryo.td stable/12/contrib/llvm-project/llvm/lib/Target/AArch64/AArch64SchedThunderX.td stable/12/contrib/llvm-project/llvm/lib/Target/AArch64/AArch64SchedThunderX2T99.td stable/12/contrib/llvm-project/llvm/lib/Target/AArch64/AArch64Subtarget.cpp stable/12/contrib/llvm-project/llvm/lib/Target/AArch64/AArch64Subtarget.h stable/12/contrib/llvm-project/llvm/lib/Target/ARM/MCTargetDesc/ARMAsmBackend.cpp stable/12/contrib/llvm-project/llvm/lib/Target/BPF/BPFISelDAGToDAG.cpp stable/12/contrib/llvm-project/llvm/lib/Target/BPF/BPFMISimplifyPatchable.cpp stable/12/contrib/llvm-project/llvm/lib/Target/BPF/BTFDebug.cpp stable/12/contrib/llvm-project/llvm/lib/Target/Hexagon/HexagonOptAddrMode.cpp stable/12/contrib/llvm-project/llvm/lib/Target/Hexagon/HexagonRDFOpt.cpp stable/12/contrib/llvm-project/llvm/lib/Target/Hexagon/RDFCopy.cpp stable/12/contrib/llvm-project/llvm/lib/Target/Hexagon/RDFCopy.h stable/12/contrib/llvm-project/llvm/lib/Target/Hexagon/RDFDeadCode.cpp stable/12/contrib/llvm-project/llvm/lib/Target/Hexagon/RDFDeadCode.h stable/12/contrib/llvm-project/llvm/lib/Target/PowerPC/P9InstrResources.td stable/12/contrib/llvm-project/llvm/lib/Target/PowerPC/PPC.td stable/12/contrib/llvm-project/llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp stable/12/contrib/llvm-project/llvm/lib/Target/PowerPC/PPCISelLowering.cpp stable/12/contrib/llvm-project/llvm/lib/Target/PowerPC/PPCISelLowering.h stable/12/contrib/llvm-project/llvm/lib/Target/PowerPC/PPCInstrAltivec.td stable/12/contrib/llvm-project/llvm/lib/Target/PowerPC/PPCInstrInfo.cpp stable/12/contrib/llvm-project/llvm/lib/Target/PowerPC/PPCInstrVSX.td stable/12/contrib/llvm-project/llvm/lib/Target/PowerPC/PPCSubtarget.h stable/12/contrib/llvm-project/llvm/lib/Target/RISCV/RISCVFrameLowering.cpp stable/12/contrib/llvm-project/llvm/lib/Target/RISCV/RISCVISelLowering.cpp stable/12/contrib/llvm-project/llvm/lib/Target/X86/X86.h stable/12/contrib/llvm-project/llvm/lib/Target/X86/X86.td stable/12/contrib/llvm-project/llvm/lib/Target/X86/X86AsmPrinter.cpp stable/12/contrib/llvm-project/llvm/lib/Target/X86/X86FastISel.cpp stable/12/contrib/llvm-project/llvm/lib/Target/X86/X86FrameLowering.cpp stable/12/contrib/llvm-project/llvm/lib/Target/X86/X86ISelDAGToDAG.cpp stable/12/contrib/llvm-project/llvm/lib/Target/X86/X86ISelLowering.cpp stable/12/contrib/llvm-project/llvm/lib/Target/X86/X86ISelLowering.h stable/12/contrib/llvm-project/llvm/lib/Target/X86/X86IndirectBranchTracking.cpp stable/12/contrib/llvm-project/llvm/lib/Target/X86/X86InstrCompiler.td stable/12/contrib/llvm-project/llvm/lib/Target/X86/X86InstrControl.td stable/12/contrib/llvm-project/llvm/lib/Target/X86/X86InstrInfo.cpp stable/12/contrib/llvm-project/llvm/lib/Target/X86/X86InstrInfo.td stable/12/contrib/llvm-project/llvm/lib/Target/X86/X86MCInstLower.cpp stable/12/contrib/llvm-project/llvm/lib/Target/X86/X86Subtarget.h stable/12/contrib/llvm-project/llvm/lib/Target/X86/X86TargetMachine.cpp stable/12/contrib/llvm-project/llvm/lib/Target/X86/X86TargetMachine.h stable/12/contrib/llvm-project/llvm/lib/Transforms/Coroutines/CoroSplit.cpp stable/12/contrib/llvm-project/llvm/lib/Transforms/IPO/GlobalOpt.cpp stable/12/contrib/llvm-project/llvm/lib/Transforms/InstCombine/InstCombineAddSub.cpp stable/12/contrib/llvm-project/llvm/lib/Transforms/Instrumentation/GCOVProfiling.cpp stable/12/contrib/llvm-project/llvm/lib/Transforms/Scalar/IndVarSimplify.cpp stable/12/contrib/llvm-project/llvm/lib/Transforms/Scalar/SimplifyCFGPass.cpp stable/12/contrib/llvm-project/llvm/lib/Transforms/Utils/ValueMapper.cpp stable/12/contrib/llvm-project/llvm/tools/llvm-objcopy/ELF/Object.cpp stable/12/contrib/llvm-project/llvm/tools/llvm-objcopy/llvm-objcopy.cpp stable/12/etc/mtree/BSD.debug.dist stable/12/etc/mtree/BSD.usr.dist stable/12/lib/clang/freebsd_cc_version.h stable/12/lib/clang/headers/Makefile stable/12/lib/clang/include/VCSVersion.inc stable/12/lib/clang/include/clang/Basic/Version.inc stable/12/lib/clang/include/clang/Config/config.h stable/12/lib/clang/include/lld/Common/Version.inc stable/12/lib/clang/include/lldb/Host/Config.h stable/12/lib/clang/include/llvm/Config/config.h stable/12/lib/clang/include/llvm/Config/llvm-config.h stable/12/lib/clang/include/llvm/Support/VCSRevision.h stable/12/lib/clang/libclang/Makefile stable/12/lib/clang/liblldb/Makefile stable/12/lib/clang/libllvm/Makefile stable/12/lib/libclang_rt/Makefile.inc stable/12/share/mk/src.opts.mk stable/12/sys/sys/param.h stable/12/targets/pseudo/bootstrap-tools/Makefile stable/12/targets/pseudo/clang/Makefile.depend stable/12/tools/build/mk/OptionalObsoleteFiles.inc stable/12/usr.bin/clang/Makefile stable/12/usr.bin/clang/bugpoint/bugpoint.1 stable/12/usr.bin/clang/clang/clang.1 stable/12/usr.bin/clang/llc/llc.1 stable/12/usr.bin/clang/lldb/Makefile stable/12/usr.bin/clang/lldb/lldb.1 stable/12/usr.bin/clang/lli/lli.1 stable/12/usr.bin/clang/llvm-ar/Makefile stable/12/usr.bin/clang/llvm-ar/llvm-ar.1 stable/12/usr.bin/clang/llvm-as/llvm-as.1 stable/12/usr.bin/clang/llvm-bcanalyzer/llvm-bcanalyzer.1 stable/12/usr.bin/clang/llvm-cov/llvm-cov.1 stable/12/usr.bin/clang/llvm-cxxfilt/Makefile stable/12/usr.bin/clang/llvm-diff/llvm-diff.1 stable/12/usr.bin/clang/llvm-dis/llvm-dis.1 stable/12/usr.bin/clang/llvm-dwarfdump/llvm-dwarfdump.1 stable/12/usr.bin/clang/llvm-extract/llvm-extract.1 stable/12/usr.bin/clang/llvm-link/llvm-link.1 stable/12/usr.bin/clang/llvm-mca/llvm-mca.1 stable/12/usr.bin/clang/llvm-nm/llvm-nm.1 stable/12/usr.bin/clang/llvm-objcopy/Makefile stable/12/usr.bin/clang/llvm-objdump/llvm-objdump.1 stable/12/usr.bin/clang/llvm-pdbutil/llvm-pdbutil.1 stable/12/usr.bin/clang/llvm-profdata/llvm-profdata.1 stable/12/usr.bin/clang/llvm-strings/Makefile stable/12/usr.bin/clang/llvm-symbolizer/Makefile stable/12/usr.bin/clang/llvm-symbolizer/llvm-symbolizer.1 stable/12/usr.bin/clang/llvm-tblgen/llvm-tblgen.1 stable/12/usr.bin/clang/opt/opt.1 Directory Properties: stable/12/ (props changed) Modified: stable/12/Makefile.inc1 ============================================================================== --- stable/12/Makefile.inc1 Fri Jul 24 20:44:50 2020 (r363493) +++ stable/12/Makefile.inc1 Fri Jul 24 20:48:06 2020 (r363494) @@ -659,7 +659,7 @@ BSARGS= DESTDIR= \ MK_HTML=no NO_LINT=yes MK_MAN=no \ -DNO_PIC MK_PROFILE=no -DNO_SHARED \ -DNO_CPU_CFLAGS MK_WARNS=no MK_CTF=no \ - MK_CLANG_EXTRAS=no MK_CLANG_FULL=no \ + MK_CLANG_EXTRAS=no MK_CLANG_FORMAT=no MK_CLANG_FULL=no \ MK_LLDB=no MK_RETPOLINE=no MK_TESTS=no \ MK_INCLUDES=yes @@ -680,7 +680,7 @@ TMAKE= \ SSP_CFLAGS= \ -DNO_LINT \ -DNO_CPU_CFLAGS MK_WARNS=no MK_CTF=no \ - MK_CLANG_EXTRAS=no MK_CLANG_FULL=no \ + MK_CLANG_EXTRAS=no MK_CLANG_FORMAT=no MK_CLANG_FULL=no \ MK_LLDB=no MK_RETPOLINE=no MK_TESTS=no # cross-tools stage @@ -2445,6 +2445,7 @@ NXBMAKEARGS+= \ -DNO_PIC \ SSP_CFLAGS= \ MK_CLANG_EXTRAS=no \ + MK_CLANG_FORMAT=no \ MK_CLANG_FULL=no \ MK_CTF=no \ MK_DEBUG_FILES=no \ Modified: stable/12/ObsoleteFiles.inc ============================================================================== --- stable/12/ObsoleteFiles.inc Fri Jul 24 20:44:50 2020 (r363493) +++ stable/12/ObsoleteFiles.inc Fri Jul 24 20:48:06 2020 (r363494) @@ -38,6 +38,257 @@ # xargs -n1 | sort | uniq -d; # done +# 20200722: new clang import which bumps version from 10.0.0 to 10.0.1. +OLD_FILES+=usr/lib/clang/10.0.0/include/cuda_wrappers/algorithm +OLD_FILES+=usr/lib/clang/10.0.0/include/cuda_wrappers/complex +OLD_FILES+=usr/lib/clang/10.0.0/include/cuda_wrappers/new +OLD_DIRS+=usr/lib/clang/10.0.0/include/cuda_wrappers +OLD_FILES+=usr/lib/clang/10.0.0/include/fuzzer/FuzzedDataProvider.h +OLD_DIRS+=usr/lib/clang/10.0.0/include/fuzzer +OLD_FILES+=usr/lib/clang/10.0.0/include/openmp_wrappers/__clang_openmp_math.h +OLD_FILES+=usr/lib/clang/10.0.0/include/openmp_wrappers/__clang_openmp_math_declares.h +OLD_FILES+=usr/lib/clang/10.0.0/include/openmp_wrappers/cmath +OLD_FILES+=usr/lib/clang/10.0.0/include/openmp_wrappers/math.h +OLD_DIRS+=usr/lib/clang/10.0.0/include/openmp_wrappers +OLD_FILES+=usr/lib/clang/10.0.0/include/ppc_wrappers/emmintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/ppc_wrappers/mm_malloc.h +OLD_FILES+=usr/lib/clang/10.0.0/include/ppc_wrappers/mmintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/ppc_wrappers/pmmintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/ppc_wrappers/smmintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/ppc_wrappers/tmmintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/ppc_wrappers/xmmintrin.h +OLD_DIRS+=usr/lib/clang/10.0.0/include/ppc_wrappers +OLD_FILES+=usr/lib/clang/10.0.0/include/profile/InstrProfData.inc +OLD_DIRS+=usr/lib/clang/10.0.0/include/profile +OLD_FILES+=usr/lib/clang/10.0.0/include/sanitizer/allocator_interface.h +OLD_FILES+=usr/lib/clang/10.0.0/include/sanitizer/asan_interface.h +OLD_FILES+=usr/lib/clang/10.0.0/include/sanitizer/common_interface_defs.h +OLD_FILES+=usr/lib/clang/10.0.0/include/sanitizer/coverage_interface.h +OLD_FILES+=usr/lib/clang/10.0.0/include/sanitizer/dfsan_interface.h +OLD_FILES+=usr/lib/clang/10.0.0/include/sanitizer/hwasan_interface.h +OLD_FILES+=usr/lib/clang/10.0.0/include/sanitizer/linux_syscall_hooks.h +OLD_FILES+=usr/lib/clang/10.0.0/include/sanitizer/lsan_interface.h +OLD_FILES+=usr/lib/clang/10.0.0/include/sanitizer/msan_interface.h +OLD_FILES+=usr/lib/clang/10.0.0/include/sanitizer/netbsd_syscall_hooks.h +OLD_FILES+=usr/lib/clang/10.0.0/include/sanitizer/scudo_interface.h +OLD_FILES+=usr/lib/clang/10.0.0/include/sanitizer/tsan_interface.h +OLD_FILES+=usr/lib/clang/10.0.0/include/sanitizer/tsan_interface_atomic.h +OLD_FILES+=usr/lib/clang/10.0.0/include/sanitizer/ubsan_interface.h +OLD_DIRS+=usr/lib/clang/10.0.0/include/sanitizer +OLD_FILES+=usr/lib/clang/10.0.0/include/xray/xray_interface.h +OLD_FILES+=usr/lib/clang/10.0.0/include/xray/xray_log_interface.h +OLD_FILES+=usr/lib/clang/10.0.0/include/xray/xray_records.h +OLD_DIRS+=usr/lib/clang/10.0.0/include/xray +OLD_FILES+=usr/lib/clang/10.0.0/include/__clang_cuda_builtin_vars.h +OLD_FILES+=usr/lib/clang/10.0.0/include/__clang_cuda_cmath.h +OLD_FILES+=usr/lib/clang/10.0.0/include/__clang_cuda_complex_builtins.h +OLD_FILES+=usr/lib/clang/10.0.0/include/__clang_cuda_device_functions.h +OLD_FILES+=usr/lib/clang/10.0.0/include/__clang_cuda_intrinsics.h +OLD_FILES+=usr/lib/clang/10.0.0/include/__clang_cuda_libdevice_declares.h +OLD_FILES+=usr/lib/clang/10.0.0/include/__clang_cuda_math_forward_declares.h +OLD_FILES+=usr/lib/clang/10.0.0/include/__clang_cuda_runtime_wrapper.h +OLD_FILES+=usr/lib/clang/10.0.0/include/__stddef_max_align_t.h +OLD_FILES+=usr/lib/clang/10.0.0/include/__wmmintrin_aes.h +OLD_FILES+=usr/lib/clang/10.0.0/include/__wmmintrin_pclmul.h +OLD_FILES+=usr/lib/clang/10.0.0/include/adxintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/altivec.h +OLD_FILES+=usr/lib/clang/10.0.0/include/ammintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/arm64intr.h +OLD_FILES+=usr/lib/clang/10.0.0/include/arm_acle.h +OLD_FILES+=usr/lib/clang/10.0.0/include/arm_cmse.h +OLD_FILES+=usr/lib/clang/10.0.0/include/arm_fp16.h +OLD_FILES+=usr/lib/clang/10.0.0/include/arm_mve.h +OLD_FILES+=usr/lib/clang/10.0.0/include/arm_neon.h +OLD_FILES+=usr/lib/clang/10.0.0/include/armintr.h +OLD_FILES+=usr/lib/clang/10.0.0/include/avx2intrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/avx512bf16intrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/avx512bitalgintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/avx512bwintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/avx512cdintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/avx512dqintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/avx512erintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/avx512fintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/avx512ifmaintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/avx512ifmavlintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/avx512pfintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/avx512vbmi2intrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/avx512vbmiintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/avx512vbmivlintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/avx512vlbf16intrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/avx512vlbitalgintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/avx512vlbwintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/avx512vlcdintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/avx512vldqintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/avx512vlintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/avx512vlvbmi2intrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/avx512vlvnniintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/avx512vlvp2intersectintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/avx512vnniintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/avx512vp2intersectintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/avx512vpopcntdqintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/avx512vpopcntdqvlintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/avxintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/bmi2intrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/bmiintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/cetintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/cldemoteintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/clflushoptintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/clwbintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/clzerointrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/cpuid.h +OLD_FILES+=usr/lib/clang/10.0.0/include/emmintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/enqcmdintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/f16cintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/fma4intrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/fmaintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/fxsrintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/gfniintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/htmintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/htmxlintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/ia32intrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/immintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/invpcidintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/lwpintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/lzcntintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/mm3dnow.h +OLD_FILES+=usr/lib/clang/10.0.0/include/mm_malloc.h +OLD_FILES+=usr/lib/clang/10.0.0/include/mmintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/module.modulemap +OLD_FILES+=usr/lib/clang/10.0.0/include/movdirintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/msa.h +OLD_FILES+=usr/lib/clang/10.0.0/include/mwaitxintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/nmmintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/opencl-c-base.h +OLD_FILES+=usr/lib/clang/10.0.0/include/opencl-c.h +OLD_FILES+=usr/lib/clang/10.0.0/include/pconfigintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/pkuintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/pmmintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/popcntintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/prfchwintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/ptwriteintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/rdseedintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/rtmintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/s390intrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/sgxintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/shaintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/smmintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/tbmintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/tmmintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/vadefs.h +OLD_FILES+=usr/lib/clang/10.0.0/include/vaesintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/vecintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/vpclmulqdqintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/waitpkgintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/wbnoinvdintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/wmmintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/x86intrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/xmmintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/xopintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/xsavecintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/xsaveintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/xsaveoptintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/xsavesintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/xtestintrin.h +OLD_DIRS+=usr/lib/clang/10.0.0/include +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.asan-aarch64.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.asan-aarch64.so +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.asan-arm.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.asan-arm.so +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.asan-armhf.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.asan-armhf.so +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.asan-i386.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.asan-i386.so +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.asan-preinit-aarch64.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.asan-preinit-arm.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.asan-preinit-armhf.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.asan-preinit-i386.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.asan-preinit-x86_64.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.asan-x86_64.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.asan-x86_64.so +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.asan_cxx-aarch64.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.asan_cxx-arm.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.asan_cxx-armhf.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.asan_cxx-i386.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.asan_cxx-x86_64.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.cfi-aarch64.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.cfi-arm.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.cfi-armhf.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.cfi-i386.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.cfi-x86_64.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.cfi_diag-aarch64.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.cfi_diag-arm.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.cfi_diag-armhf.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.cfi_diag-i386.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.cfi_diag-x86_64.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.dd-aarch64.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.dd-x86_64.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.fuzzer-aarch64.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.fuzzer-x86_64.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.fuzzer_no_main-aarch64.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.fuzzer_no_main-x86_64.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.msan-aarch64.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.msan-x86_64.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.msan_cxx-aarch64.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.msan_cxx-x86_64.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.profile-aarch64.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.profile-arm.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.profile-armhf.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.profile-i386.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.profile-powerpc.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.profile-powerpc64.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.profile-x86_64.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.safestack-aarch64.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.safestack-i386.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.safestack-x86_64.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.stats-aarch64.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.stats-arm.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.stats-armhf.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.stats-i386.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.stats-x86_64.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.stats_client-aarch64.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.stats_client-arm.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.stats_client-armhf.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.stats_client-i386.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.stats_client-x86_64.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.tsan-aarch64.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.tsan-x86_64.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.tsan_cxx-aarch64.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.tsan_cxx-x86_64.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.ubsan_minimal-aarch64.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.ubsan_minimal-arm.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.ubsan_minimal-armhf.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.ubsan_minimal-i386.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.ubsan_minimal-x86_64.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.ubsan_standalone-aarch64.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.ubsan_standalone-arm.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.ubsan_standalone-armhf.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.ubsan_standalone-i386.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.ubsan_standalone-x86_64.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.ubsan_standalone_cxx-aarch64.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.ubsan_standalone_cxx-arm.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.ubsan_standalone_cxx-armhf.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.ubsan_standalone_cxx-i386.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.ubsan_standalone_cxx-x86_64.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.xray-aarch64.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.xray-arm.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.xray-armhf.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.xray-basic-aarch64.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.xray-basic-arm.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.xray-basic-armhf.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.xray-basic-x86_64.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.xray-fdr-aarch64.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.xray-fdr-arm.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.xray-fdr-armhf.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.xray-fdr-x86_64.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.xray-profiling-aarch64.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.xray-profiling-arm.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.xray-profiling-armhf.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.xray-profiling-x86_64.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.xray-x86_64.a +OLD_DIRS+=usr/lib/clang/10.0.0/lib/freebsd +OLD_DIRS+=usr/lib/clang/10.0.0/lib +OLD_DIRS+=usr/lib/clang/10.0.0 + # 20200516: Remove bogus man links OLD_FILES+=usr/share/man/man3/getauusernam_R.3.gz OLD_FILES+=usr/share/man/man3/getauclassnam_3.3.gz @@ -5375,7 +5626,6 @@ OLD_FILES+=usr/include/clang/3.3/x86intrin.h OLD_FILES+=usr/include/clang/3.3/xmmintrin.h OLD_FILES+=usr/include/clang/3.3/xopintrin.h OLD_FILES+=usr/share/man/man1/llvm-prof.1.gz -OLD_FILES+=usr/share/man/man1/llvm-ranlib.1.gz OLD_DIRS+=usr/include/clang/3.3 # 20140216: nve(4) removed OLD_FILES+=usr/share/man/man4/if_nve.4.gz Modified: stable/12/UPDATING ============================================================================== --- stable/12/UPDATING Fri Jul 24 20:44:50 2020 (r363493) +++ stable/12/UPDATING Fri Jul 24 20:48:06 2020 (r363494) @@ -16,6 +16,12 @@ 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. +20200722: + Clang, llvm, lld, lldb, compiler-rt, libc++, libunwind and openmp have + been upgraded to 10.0.1. Please see the 20141231 entry below for + information about prerequisites and upgrading, if you are not already + using clang 3.5.0 or higher. + 20200708: read(2) of a directory fd is now rejected by default. root may re-enable it for the entire system with the Modified: stable/12/contrib/llvm-project/FREEBSD-Xlist ============================================================================== --- stable/12/contrib/llvm-project/FREEBSD-Xlist Fri Jul 24 20:44:50 2020 (r363493) +++ stable/12/contrib/llvm-project/FREEBSD-Xlist Fri Jul 24 20:48:06 2020 (r363494) @@ -3,6 +3,7 @@ .clang-format .clang-tidy .git-blame-ignore-revs +.github/ .gitignore CONTRIBUTING.md README.md @@ -264,6 +265,7 @@ lldb/.clang-format lldb/.gitignore lldb/CMakeLists.txt lldb/CODE_OWNERS.txt +lldb/bindings/CMakeLists.txt lldb/cmake/ lldb/docs/.htaccess lldb/docs/CMakeLists.txt @@ -529,6 +531,7 @@ llvm/lib/ExecutionEngine/PerfJITEvents/CMakeLists.txt llvm/lib/ExecutionEngine/PerfJITEvents/LLVMBuild.txt llvm/lib/ExecutionEngine/RuntimeDyld/CMakeLists.txt llvm/lib/ExecutionEngine/RuntimeDyld/LLVMBuild.txt +llvm/lib/Extensions/ llvm/lib/Frontend/CMakeLists.txt llvm/lib/Frontend/LLVMBuild.txt llvm/lib/Frontend/OpenMP/CMakeLists.txt @@ -861,7 +864,8 @@ llvm/tools/llvm-dis/LLVMBuild.txt llvm/tools/llvm-dwarfdump/CMakeLists.txt llvm/tools/llvm-dwarfdump/LLVMBuild.txt llvm/tools/llvm-dwarfdump/fuzzer/ -llvm/tools/llvm-dwp/ +llvm/tools/llvm-dwp/CMakeLists.txt +llvm/tools/llvm-dwp/LLVMBuild.txt llvm/tools/llvm-elfabi/ llvm/tools/llvm-exegesis/ llvm/tools/llvm-extract/CMakeLists.txt @@ -908,12 +912,14 @@ llvm/tools/llvm-reduce/ llvm/tools/llvm-rtdyld/CMakeLists.txt llvm/tools/llvm-rtdyld/LLVMBuild.txt llvm/tools/llvm-shlib/ -llvm/tools/llvm-size/ +llvm/tools/llvm-size/CMakeLists.txt +llvm/tools/llvm-size/LLVMBuild.txt llvm/tools/llvm-special-case-list-fuzzer/ llvm/tools/llvm-split/ llvm/tools/llvm-stress/CMakeLists.txt llvm/tools/llvm-stress/LLVMBuild.txt -llvm/tools/llvm-strings/ +llvm/tools/llvm-strings/CMakeLists.txt +llvm/tools/llvm-strings/LLVMBuild.txt llvm/tools/llvm-symbolizer/CMakeLists.txt llvm/tools/llvm-undname/ llvm/tools/llvm-xray/CMakeLists.txt Modified: stable/12/contrib/llvm-project/clang/include/clang/AST/DeclBase.h ============================================================================== --- stable/12/contrib/llvm-project/clang/include/clang/AST/DeclBase.h Fri Jul 24 20:44:50 2020 (r363493) +++ stable/12/contrib/llvm-project/clang/include/clang/AST/DeclBase.h Fri Jul 24 20:48:06 2020 (r363494) @@ -856,14 +856,15 @@ class alignas(8) Decl { (public) return getParentFunctionOrMethod() == nullptr; } - /// Returns true if this declaration lexically is inside a function. - /// It recognizes non-defining declarations as well as members of local - /// classes: + /// Returns true if this declaration is lexically inside a function or inside + /// a variable initializer. It recognizes non-defining declarations as well + /// as members of local classes: /// \code /// void foo() { void bar(); } /// void foo2() { class ABC { void bar(); }; } + /// inline int x = [](){ return 0; }; /// \endcode - bool isLexicallyWithinFunctionOrMethod() const; + bool isInLocalScope() const; /// If this decl is defined inside a function/method/block it returns /// the corresponding DeclContext, otherwise it returns null. Modified: stable/12/contrib/llvm-project/clang/include/clang/Basic/Attr.td ============================================================================== --- stable/12/contrib/llvm-project/clang/include/clang/Basic/Attr.td Fri Jul 24 20:44:50 2020 (r363493) +++ stable/12/contrib/llvm-project/clang/include/clang/Basic/Attr.td Fri Jul 24 20:48:06 2020 (r363494) @@ -685,7 +685,7 @@ def XRayLogArgs : InheritableAttr { def PatchableFunctionEntry : InheritableAttr, - TargetSpecificAttr> { + TargetSpecificAttr> { let Spellings = [GCC<"patchable_function_entry">]; let Subjects = SubjectList<[Function, ObjCMethod]>; let Args = [UnsignedArgument<"Count">, DefaultIntArgument<"Offset", 0>]; Modified: stable/12/contrib/llvm-project/clang/include/clang/Driver/Options.td ============================================================================== --- stable/12/contrib/llvm-project/clang/include/clang/Driver/Options.td Fri Jul 24 20:44:50 2020 (r363493) +++ stable/12/contrib/llvm-project/clang/include/clang/Driver/Options.td Fri Jul 24 20:48:06 2020 (r363494) @@ -2267,6 +2267,14 @@ def mspeculative_load_hardening : Flag<["-"], "mspecul Group, Flags<[CoreOption,CC1Option]>; def mno_speculative_load_hardening : Flag<["-"], "mno-speculative-load-hardening">, Group, Flags<[CoreOption]>; +def mlvi_hardening : Flag<["-"], "mlvi-hardening">, Group, Flags<[CoreOption,DriverOption]>, + HelpText<"Enable all mitigations for Load Value Injection (LVI)">; +def mno_lvi_hardening : Flag<["-"], "mno-lvi-hardening">, Group, Flags<[CoreOption,DriverOption]>, + HelpText<"Disable mitigations for Load Value Injection (LVI)">; +def mlvi_cfi : Flag<["-"], "mlvi-cfi">, Group, Flags<[CoreOption,DriverOption]>, + HelpText<"Enable only control-flow mitigations for Load Value Injection (LVI)">; +def mno_lvi_cfi : Flag<["-"], "mno-lvi-cfi">, Group, Flags<[CoreOption,DriverOption]>, + HelpText<"Disable control-flow mitigations for Load Value Injection (LVI)">; def mrelax : Flag<["-"], "mrelax">, Group, HelpText<"Enable linker relaxation">; @@ -2439,6 +2447,12 @@ def mlongcall: Flag<["-"], "mlongcall">, Group; def mno_longcall : Flag<["-"], "mno-longcall">, Group; +def maix_struct_return : Flag<["-"], "maix-struct-return">, + Group, Flags<[CC1Option]>, + HelpText<"Return all structs in memory (PPC32 only)">; +def msvr4_struct_return : Flag<["-"], "msvr4-struct-return">, + Group, Flags<[CC1Option]>, + HelpText<"Return small structs in registers (PPC32 only)">; def mvx : Flag<["-"], "mvx">, Group; def mno_vx : Flag<["-"], "mno-vx">, Group; Modified: stable/12/contrib/llvm-project/clang/lib/AST/DeclBase.cpp ============================================================================== --- stable/12/contrib/llvm-project/clang/lib/AST/DeclBase.cpp Fri Jul 24 20:44:50 2020 (r363493) +++ stable/12/contrib/llvm-project/clang/lib/AST/DeclBase.cpp Fri Jul 24 20:48:06 2020 (r363494) @@ -332,13 +332,16 @@ void Decl::setDeclContextsImpl(DeclContext *SemaDC, De } } -bool Decl::isLexicallyWithinFunctionOrMethod() const { +bool Decl::isInLocalScope() const { const DeclContext *LDC = getLexicalDeclContext(); while (true) { if (LDC->isFunctionOrMethod()) return true; if (!isa(LDC)) return false; + if (const auto *CRD = dyn_cast(LDC)) + if (CRD->isLambda()) + return true; LDC = LDC->getLexicalParent(); } return false; Modified: stable/12/contrib/llvm-project/clang/lib/AST/ExprConstant.cpp ============================================================================== --- stable/12/contrib/llvm-project/clang/lib/AST/ExprConstant.cpp Fri Jul 24 20:44:50 2020 (r363493) +++ stable/12/contrib/llvm-project/clang/lib/AST/ExprConstant.cpp Fri Jul 24 20:48:06 2020 (r363494) @@ -8593,6 +8593,10 @@ bool PointerExprEvaluator::VisitBuiltinCallExpr(const static bool EvaluateArrayNewInitList(EvalInfo &Info, LValue &This, APValue &Result, const InitListExpr *ILE, QualType AllocType); +static bool EvaluateArrayNewConstructExpr(EvalInfo &Info, LValue &This, + APValue &Result, + const CXXConstructExpr *CCE, + QualType AllocType); bool PointerExprEvaluator::VisitCXXNewExpr(const CXXNewExpr *E) { if (!Info.getLangOpts().CPlusPlus2a) @@ -8642,6 +8646,7 @@ bool PointerExprEvaluator::VisitCXXNewExpr(const CXXNe const Expr *Init = E->getInitializer(); const InitListExpr *ResizedArrayILE = nullptr; + const CXXConstructExpr *ResizedArrayCCE = nullptr; QualType AllocType = E->getAllocatedType(); if (Optional ArraySize = E->getArraySize()) { @@ -8685,7 +8690,7 @@ bool PointerExprEvaluator::VisitCXXNewExpr(const CXXNe // -- the new-initializer is a braced-init-list and the number of // array elements for which initializers are provided [...] // exceeds the number of elements to initialize - if (Init) { + if (Init && !isa(Init)) { auto *CAT = Info.Ctx.getAsConstantArrayType(Init->getType()); assert(CAT && "unexpected type for array initializer"); @@ -8708,6 +8713,8 @@ bool PointerExprEvaluator::VisitCXXNewExpr(const CXXNe // special handling for this case when we initialize. if (InitBound != AllocBound) ResizedArrayILE = cast(Init); + } else if (Init) { + ResizedArrayCCE = cast(Init); } AllocType = Info.Ctx.getConstantArrayType(AllocType, ArrayBound, nullptr, @@ -8772,6 +8779,10 @@ bool PointerExprEvaluator::VisitCXXNewExpr(const CXXNe if (!EvaluateArrayNewInitList(Info, Result, *Val, ResizedArrayILE, AllocType)) return false; + } else if (ResizedArrayCCE) { + if (!EvaluateArrayNewConstructExpr(Info, Result, *Val, ResizedArrayCCE, + AllocType)) + return false; } else if (Init) { if (!EvaluateInPlace(*Val, Info, Result, Init)) return false; @@ -9595,6 +9606,16 @@ static bool EvaluateArrayNewInitList(EvalInfo &Info, L "not an array rvalue"); return ArrayExprEvaluator(Info, This, Result) .VisitInitListExpr(ILE, AllocType); +} + +static bool EvaluateArrayNewConstructExpr(EvalInfo &Info, LValue &This, + APValue &Result, + const CXXConstructExpr *CCE, + QualType AllocType) { + assert(CCE->isRValue() && CCE->getType()->isArrayType() && + "not an array rvalue"); + return ArrayExprEvaluator(Info, This, Result) + .VisitCXXConstructExpr(CCE, This, &Result, AllocType); } // Return true iff the given array filler may depend on the element index. Modified: stable/12/contrib/llvm-project/clang/lib/AST/RawCommentList.cpp ============================================================================== --- stable/12/contrib/llvm-project/clang/lib/AST/RawCommentList.cpp Fri Jul 24 20:44:50 2020 (r363493) +++ stable/12/contrib/llvm-project/clang/lib/AST/RawCommentList.cpp Fri Jul 24 20:48:06 2020 (r363494) @@ -430,7 +430,7 @@ std::string RawComment::getFormattedText(const SourceM }; auto DropTrailingNewLines = [](std::string &Str) { - while (Str.back() == '\n') + while (!Str.empty() && Str.back() == '\n') Str.pop_back(); }; Modified: stable/12/contrib/llvm-project/clang/lib/Basic/Targets/PPC.h ============================================================================== --- stable/12/contrib/llvm-project/clang/lib/Basic/Targets/PPC.h Fri Jul 24 20:44:50 2020 (r363493) +++ stable/12/contrib/llvm-project/clang/lib/Basic/Targets/PPC.h Fri Jul 24 20:48:06 2020 (r363494) @@ -276,11 +276,12 @@ class LLVM_LIBRARY_VISIBILITY PPCTargetInfo : public T break; case 'Q': // Memory operand that is an offset from a register (it is // usually better to use `m' or `es' in asm statements) + Info.setAllowsRegister(); + LLVM_FALLTHROUGH; case 'Z': // Memory operand that is an indexed or indirect from a // register (it is usually better to use `m' or `es' in // asm statements) Info.setAllowsMemory(); - Info.setAllowsRegister(); break; case 'R': // AIX TOC entry case 'a': // Address operand that is an indexed or indirect from a Modified: stable/12/contrib/llvm-project/clang/lib/CodeGen/CodeGenModule.cpp ============================================================================== --- stable/12/contrib/llvm-project/clang/lib/CodeGen/CodeGenModule.cpp Fri Jul 24 20:44:50 2020 (r363493) +++ stable/12/contrib/llvm-project/clang/lib/CodeGen/CodeGenModule.cpp Fri Jul 24 20:48:06 2020 (r363494) @@ -1847,9 +1847,16 @@ void CodeGenModule::SetFunctionAttributes(GlobalDecl G else if (const auto *SA = FD->getAttr()) F->setSection(SA->getName()); + // If we plan on emitting this inline builtin, we can't treat it as a builtin. if (FD->isInlineBuiltinDeclaration()) { - F->addAttribute(llvm::AttributeList::FunctionIndex, - llvm::Attribute::NoBuiltin); + const FunctionDecl *FDBody; + bool HasBody = FD->hasBody(FDBody); + (void)HasBody; + assert(HasBody && "Inline builtin declarations should always have an " + "available body!"); + if (shouldEmitFunction(FDBody)) + F->addAttribute(llvm::AttributeList::FunctionIndex, + llvm::Attribute::NoBuiltin); } if (FD->isReplaceableGlobalAllocationFunction()) { Modified: stable/12/contrib/llvm-project/clang/lib/CodeGen/TargetInfo.cpp ============================================================================== --- stable/12/contrib/llvm-project/clang/lib/CodeGen/TargetInfo.cpp Fri Jul 24 20:44:50 2020 (r363493) +++ stable/12/contrib/llvm-project/clang/lib/CodeGen/TargetInfo.cpp Fri Jul 24 20:48:06 2020 (r363494) @@ -4123,22 +4123,39 @@ namespace { /// PPC32_SVR4_ABIInfo - The 32-bit PowerPC ELF (SVR4) ABI information. class PPC32_SVR4_ABIInfo : public DefaultABIInfo { bool IsSoftFloatABI; + bool IsRetSmallStructInRegABI; CharUnits getParamTypeAlignment(QualType Ty) const; public: - PPC32_SVR4_ABIInfo(CodeGen::CodeGenTypes &CGT, bool SoftFloatABI) - : DefaultABIInfo(CGT), IsSoftFloatABI(SoftFloatABI) {} + PPC32_SVR4_ABIInfo(CodeGen::CodeGenTypes &CGT, bool SoftFloatABI, + bool RetSmallStructInRegABI) + : DefaultABIInfo(CGT), IsSoftFloatABI(SoftFloatABI), + IsRetSmallStructInRegABI(RetSmallStructInRegABI) {} + ABIArgInfo classifyReturnType(QualType RetTy) const; + + void computeInfo(CGFunctionInfo &FI) const override { + if (!getCXXABI().classifyReturnType(FI)) + FI.getReturnInfo() = classifyReturnType(FI.getReturnType()); + for (auto &I : FI.arguments()) + I.info = classifyArgumentType(I.type); + } + Address EmitVAArg(CodeGenFunction &CGF, Address VAListAddr, QualType Ty) const override; }; class PPC32TargetCodeGenInfo : public TargetCodeGenInfo { public: - PPC32TargetCodeGenInfo(CodeGenTypes &CGT, bool SoftFloatABI) - : TargetCodeGenInfo(new PPC32_SVR4_ABIInfo(CGT, SoftFloatABI)) {} + PPC32TargetCodeGenInfo(CodeGenTypes &CGT, bool SoftFloatABI, + bool RetSmallStructInRegABI) + : TargetCodeGenInfo(new PPC32_SVR4_ABIInfo(CGT, SoftFloatABI, + RetSmallStructInRegABI)) {} + static bool isStructReturnInRegABI(const llvm::Triple &Triple, + const CodeGenOptions &Opts); + int getDwarfEHStackPointer(CodeGen::CodeGenModule &M) const override { // This is recovered from gcc output. return 1; // r1 is the dedicated stack pointer @@ -4173,6 +4190,34 @@ CharUnits PPC32_SVR4_ABIInfo::getParamTypeAlignment(Qu return CharUnits::fromQuantity(4); } +ABIArgInfo PPC32_SVR4_ABIInfo::classifyReturnType(QualType RetTy) const { + uint64_t Size; + + // -msvr4-struct-return puts small aggregates in GPR3 and GPR4. + if (isAggregateTypeForABI(RetTy) && IsRetSmallStructInRegABI && + (Size = getContext().getTypeSize(RetTy)) <= 64) { + // System V ABI (1995), page 3-22, specified: + // > A structure or union whose size is less than or equal to 8 bytes + // > shall be returned in r3 and r4, as if it were first stored in the + // > 8-byte aligned memory area and then the low addressed word were + // > loaded into r3 and the high-addressed word into r4. Bits beyond + // > the last member of the structure or union are not defined. + // + // GCC for big-endian PPC32 inserts the pad before the first member, + // not "beyond the last member" of the struct. To stay compatible + // with GCC, we coerce the struct to an integer of the same size. + // LLVM will extend it and return i32 in r3, or i64 in r3:r4. + if (Size == 0) + return ABIArgInfo::getIgnore(); + else { + llvm::Type *CoerceTy = llvm::Type::getIntNTy(getVMContext(), Size); + return ABIArgInfo::getDirect(CoerceTy); + } + } + + return DefaultABIInfo::classifyReturnType(RetTy); +} + // TODO: this implementation is now likely redundant with // DefaultABIInfo::EmitVAArg. Address PPC32_SVR4_ABIInfo::EmitVAArg(CodeGenFunction &CGF, Address VAList, @@ -4328,6 +4373,25 @@ Address PPC32_SVR4_ABIInfo::EmitVAArg(CodeGenFunction return Result; } +bool PPC32TargetCodeGenInfo::isStructReturnInRegABI( + const llvm::Triple &Triple, const CodeGenOptions &Opts) { + assert(Triple.getArch() == llvm::Triple::ppc); + + switch (Opts.getStructReturnConvention()) { + case CodeGenOptions::SRCK_Default: + break; + case CodeGenOptions::SRCK_OnStack: // -maix-struct-return + return false; + case CodeGenOptions::SRCK_InRegs: // -msvr4-struct-return + return true; + } + + if (Triple.isOSBinFormatELF() && !Triple.isOSLinux()) + return true; + + return false; +} + bool PPC32TargetCodeGenInfo::initDwarfEHRegSizeTable(CodeGen::CodeGenFunction &CGF, llvm::Value *Address) const { @@ -9613,7 +9677,8 @@ ABIArgInfo RISCVABIInfo::classifyArgumentType(QualType uint64_t Size = getContext().getTypeSize(Ty); // Pass floating point values via FPRs if possible. - if (IsFixed && Ty->isFloatingType() && FLen >= Size && ArgFPRsLeft) { + if (IsFixed && Ty->isFloatingType() && !Ty->isComplexType() && + FLen >= Size && ArgFPRsLeft) { ArgFPRsLeft--; return ABIArgInfo::getDirect(); } @@ -9852,10 +9917,14 @@ const TargetCodeGenInfo &CodeGenModule::getTargetCodeG return SetCGInfo(new ARMTargetCodeGenInfo(Types, Kind)); } - case llvm::Triple::ppc: + case llvm::Triple::ppc: { + bool IsSoftFloat = + CodeGenOpts.FloatABI == "soft" || getTarget().hasFeature("spe"); + bool RetSmallStructInRegABI = + PPC32TargetCodeGenInfo::isStructReturnInRegABI(Triple, CodeGenOpts); return SetCGInfo( - new PPC32TargetCodeGenInfo(Types, CodeGenOpts.FloatABI == "soft" || - getTarget().hasFeature("spe"))); + new PPC32TargetCodeGenInfo(Types, IsSoftFloat, RetSmallStructInRegABI)); + } case llvm::Triple::ppc64: if (Triple.isOSBinFormatELF()) { PPC64_SVR4_ABIInfo::ABIKind Kind = PPC64_SVR4_ABIInfo::ELFv1; Modified: stable/12/contrib/llvm-project/clang/lib/Driver/SanitizerArgs.cpp ============================================================================== --- stable/12/contrib/llvm-project/clang/lib/Driver/SanitizerArgs.cpp Fri Jul 24 20:44:50 2020 (r363493) +++ stable/12/contrib/llvm-project/clang/lib/Driver/SanitizerArgs.cpp Fri Jul 24 20:48:06 2020 (r363494) @@ -454,8 +454,7 @@ SanitizerArgs::SanitizerArgs(const ToolChain &TC, << lastArgumentForMask(D, Args, Kinds & NeedsLTO) << "-flto"; } - if ((Kinds & SanitizerKind::ShadowCallStack) && - TC.getTriple().getArch() == llvm::Triple::aarch64 && + if ((Kinds & SanitizerKind::ShadowCallStack) && TC.getTriple().isAArch64() && !llvm::AArch64::isX18ReservedByDefault(TC.getTriple()) && !Args.hasArg(options::OPT_ffixed_x18)) { D.Diag(diag::err_drv_argument_only_allowed_with) Modified: stable/12/contrib/llvm-project/clang/lib/Driver/ToolChain.cpp ============================================================================== --- stable/12/contrib/llvm-project/clang/lib/Driver/ToolChain.cpp Fri Jul 24 20:44:50 2020 (r363493) +++ stable/12/contrib/llvm-project/clang/lib/Driver/ToolChain.cpp Fri Jul 24 20:48:06 2020 (r363494) @@ -954,15 +954,12 @@ SanitizerMask ToolChain::getSupportedSanitizers() cons if (getTriple().getArch() == llvm::Triple::x86 || getTriple().getArch() == llvm::Triple::x86_64 || getTriple().getArch() == llvm::Triple::arm || - getTriple().getArch() == llvm::Triple::aarch64 || getTriple().getArch() == llvm::Triple::wasm32 || - getTriple().getArch() == llvm::Triple::wasm64) + getTriple().getArch() == llvm::Triple::wasm64 || getTriple().isAArch64()) Res |= SanitizerKind::CFIICall; - if (getTriple().getArch() == llvm::Triple::x86_64 || - getTriple().getArch() == llvm::Triple::aarch64) + if (getTriple().getArch() == llvm::Triple::x86_64 || getTriple().isAArch64()) Res |= SanitizerKind::ShadowCallStack; - if (getTriple().getArch() == llvm::Triple::aarch64 || - getTriple().getArch() == llvm::Triple::aarch64_be) + if (getTriple().isAArch64()) Res |= SanitizerKind::MemTag; return Res; } Modified: stable/12/contrib/llvm-project/clang/lib/Driver/ToolChains/Arch/RISCV.cpp ============================================================================== --- stable/12/contrib/llvm-project/clang/lib/Driver/ToolChains/Arch/RISCV.cpp Fri Jul 24 20:44:50 2020 (r363493) +++ stable/12/contrib/llvm-project/clang/lib/Driver/ToolChains/Arch/RISCV.cpp Fri Jul 24 20:48:06 2020 (r363494) @@ -426,8 +426,9 @@ void riscv::getRISCVTargetFeatures(const Driver &D, co if (Args.hasArg(options::OPT_ffixed_x31)) Features.push_back("+reserve-x31"); - // -mrelax is default, unless -mno-relax is specified. - if (Args.hasFlag(options::OPT_mrelax, options::OPT_mno_relax, true)) + // FreeBSD local, because ld.lld doesn't support relaxations + // -mno-relax is default, unless -mrelax is specified. + if (Args.hasFlag(options::OPT_mrelax, options::OPT_mno_relax, false)) Features.push_back("+relax"); else Features.push_back("-relax"); Modified: stable/12/contrib/llvm-project/clang/lib/Driver/ToolChains/Arch/X86.cpp ============================================================================== --- stable/12/contrib/llvm-project/clang/lib/Driver/ToolChains/Arch/X86.cpp Fri Jul 24 20:44:50 2020 (r363493) +++ stable/12/contrib/llvm-project/clang/lib/Driver/ToolChains/Arch/X86.cpp Fri Jul 24 20:48:06 2020 (r363494) @@ -147,6 +147,7 @@ void x86::getX86TargetFeatures(const Driver &D, const // flags). This is a bit hacky but keeps existing usages working. We should // consider deprecating this and instead warn if the user requests external // retpoline thunks and *doesn't* request some form of retpolines. + auto SpectreOpt = clang::driver::options::ID::OPT_INVALID; if (Args.hasArgNoClaim(options::OPT_mretpoline, options::OPT_mno_retpoline, options::OPT_mspeculative_load_hardening, options::OPT_mno_speculative_load_hardening)) { @@ -154,12 +155,14 @@ void x86::getX86TargetFeatures(const Driver &D, const false)) { Features.push_back("+retpoline-indirect-calls"); Features.push_back("+retpoline-indirect-branches"); + SpectreOpt = options::OPT_mretpoline; } else if (Args.hasFlag(options::OPT_mspeculative_load_hardening, options::OPT_mno_speculative_load_hardening, false)) { // On x86, speculative load hardening relies on at least using retpolines // for indirect calls. Features.push_back("+retpoline-indirect-calls"); + SpectreOpt = options::OPT_mspeculative_load_hardening; } } else if (Args.hasFlag(options::OPT_mretpoline_external_thunk, options::OPT_mno_retpoline_external_thunk, false)) { @@ -167,6 +170,26 @@ void x86::getX86TargetFeatures(const Driver &D, const // eventually switch to an error here. Features.push_back("+retpoline-indirect-calls"); Features.push_back("+retpoline-indirect-branches"); + SpectreOpt = options::OPT_mretpoline_external_thunk; + } + + auto LVIOpt = clang::driver::options::ID::OPT_INVALID; + if (Args.hasFlag(options::OPT_mlvi_hardening, options::OPT_mno_lvi_hardening, + false)) { + Features.push_back("+lvi-load-hardening"); + Features.push_back("+lvi-cfi"); // load hardening implies CFI protection + LVIOpt = options::OPT_mlvi_hardening; + } else if (Args.hasFlag(options::OPT_mlvi_cfi, options::OPT_mno_lvi_cfi, + false)) { + Features.push_back("+lvi-cfi"); + LVIOpt = options::OPT_mlvi_cfi; + } + + if (SpectreOpt != clang::driver::options::ID::OPT_INVALID && + LVIOpt != clang::driver::options::ID::OPT_INVALID) { + D.Diag(diag::err_drv_argument_not_allowed_with) + << D.getOpts().getOptionName(SpectreOpt) + << D.getOpts().getOptionName(LVIOpt); } // Now add any that the user explicitly requested on the command line, Modified: stable/12/contrib/llvm-project/clang/lib/Driver/ToolChains/Clang.cpp ============================================================================== --- stable/12/contrib/llvm-project/clang/lib/Driver/ToolChains/Clang.cpp Fri Jul 24 20:44:50 2020 (r363493) +++ stable/12/contrib/llvm-project/clang/lib/Driver/ToolChains/Clang.cpp Fri Jul 24 20:48:06 2020 (r363494) @@ -4421,6 +4421,19 @@ void Clang::ConstructJob(Compilation &C, const JobActi CmdArgs.push_back(A->getValue()); } + if (Arg *A = Args.getLastArg(options::OPT_maix_struct_return, + options::OPT_msvr4_struct_return)) { + if (TC.getArch() != llvm::Triple::ppc) { + D.Diag(diag::err_drv_unsupported_opt_for_target) + << A->getSpelling() << RawTriple.str(); + } else if (A->getOption().matches(options::OPT_maix_struct_return)) { + CmdArgs.push_back("-maix-struct-return"); + } else { + assert(A->getOption().matches(options::OPT_msvr4_struct_return)); + CmdArgs.push_back("-msvr4-struct-return"); + } + } + if (Arg *A = Args.getLastArg(options::OPT_fpcc_struct_return, options::OPT_freg_struct_return)) { if (TC.getArch() != llvm::Triple::x86) { Modified: stable/12/contrib/llvm-project/clang/lib/Driver/ToolChains/Darwin.cpp ============================================================================== --- stable/12/contrib/llvm-project/clang/lib/Driver/ToolChains/Darwin.cpp Fri Jul 24 20:44:50 2020 (r363493) +++ stable/12/contrib/llvm-project/clang/lib/Driver/ToolChains/Darwin.cpp Fri Jul 24 20:48:06 2020 (r363494) @@ -1146,6 +1146,7 @@ void Darwin::addProfileRTLibs(const ArgList &Args, addExportedSymbol(CmdArgs, "___gcov_flush"); addExportedSymbol(CmdArgs, "_flush_fn_list"); addExportedSymbol(CmdArgs, "_writeout_fn_list"); + addExportedSymbol(CmdArgs, "_reset_fn_list"); } else { addExportedSymbol(CmdArgs, "___llvm_profile_filename"); addExportedSymbol(CmdArgs, "___llvm_profile_raw_version"); Modified: stable/12/contrib/llvm-project/clang/lib/Driver/ToolChains/Gnu.cpp ============================================================================== --- stable/12/contrib/llvm-project/clang/lib/Driver/ToolChains/Gnu.cpp Fri Jul 24 20:44:50 2020 (r363493) +++ stable/12/contrib/llvm-project/clang/lib/Driver/ToolChains/Gnu.cpp Fri Jul 24 20:48:06 2020 (r363494) @@ -309,7 +309,7 @@ static const char *getLDMOption(const llvm::Triple &T, } } -static bool getPIE(const ArgList &Args, const toolchains::Linux &ToolChain) { +static bool getPIE(const ArgList &Args, const ToolChain &TC) { if (Args.hasArg(options::OPT_shared) || Args.hasArg(options::OPT_static) || Args.hasArg(options::OPT_r) || Args.hasArg(options::OPT_static_pie)) return false; @@ -317,17 +317,16 @@ static bool getPIE(const ArgList &Args, const toolchai Arg *A = Args.getLastArg(options::OPT_pie, options::OPT_no_pie, options::OPT_nopie); if (!A) - return ToolChain.isPIEDefault(); + return TC.isPIEDefault(); return A->getOption().matches(options::OPT_pie); } -static bool getStaticPIE(const ArgList &Args, - const toolchains::Linux &ToolChain) { +static bool getStaticPIE(const ArgList &Args, const ToolChain &TC) { bool HasStaticPIE = Args.hasArg(options::OPT_static_pie); // -no-pie is an alias for -nopie. So, handling -nopie takes care of // -no-pie as well. if (HasStaticPIE && Args.hasArg(options::OPT_nopie)) { - const Driver &D = ToolChain.getDriver(); + const Driver &D = TC.getDriver(); const llvm::opt::OptTable &Opts = D.getOpts(); const char *StaticPIEName = Opts.getOptionName(options::OPT_static_pie); const char *NoPIEName = Opts.getOptionName(options::OPT_nopie); @@ -346,8 +345,12 @@ void tools::gnutools::Linker::ConstructJob(Compilation const InputInfoList &Inputs, const ArgList &Args, const char *LinkingOutput) const { - const toolchains::Linux &ToolChain = - static_cast(getToolChain()); + // FIXME: The Linker class constructor takes a ToolChain and not a + // Generic_ELF, so the static_cast might return a reference to a invalid + // instance (see PR45061). Ideally, the Linker constructor needs to take a + // Generic_ELF instead. + const toolchains::Generic_ELF &ToolChain = + static_cast(getToolChain()); const Driver &D = ToolChain.getDriver(); const llvm::Triple &Triple = getToolChain().getEffectiveTriple(); @@ -418,8 +421,7 @@ void tools::gnutools::Linker::ConstructJob(Compilation if (isAndroid) CmdArgs.push_back("--warn-shared-textrel"); - for (const auto &Opt : ToolChain.ExtraOpts) - CmdArgs.push_back(Opt.c_str()); + ToolChain.addExtraOpts(CmdArgs); CmdArgs.push_back("--eh-frame-hdr"); Modified: stable/12/contrib/llvm-project/clang/lib/Driver/ToolChains/Gnu.h ============================================================================== --- stable/12/contrib/llvm-project/clang/lib/Driver/ToolChains/Gnu.h Fri Jul 24 20:44:50 2020 (r363493) +++ stable/12/contrib/llvm-project/clang/lib/Driver/ToolChains/Gnu.h Fri Jul 24 20:48:06 2020 (r363494) @@ -356,6 +356,12 @@ class LLVM_LIBRARY_VISIBILITY Generic_ELF : public Gen void addClangTargetOptions(const llvm::opt::ArgList &DriverArgs, llvm::opt::ArgStringList &CC1Args, Action::OffloadKind DeviceOffloadKind) const override; + + virtual std::string getDynamicLinker(const llvm::opt::ArgList &Args) const { + return {}; + } + + virtual void addExtraOpts(llvm::opt::ArgStringList &CmdArgs) const {} }; } // end namespace toolchains Modified: stable/12/contrib/llvm-project/clang/lib/Driver/ToolChains/Hurd.cpp ============================================================================== --- stable/12/contrib/llvm-project/clang/lib/Driver/ToolChains/Hurd.cpp Fri Jul 24 20:44:50 2020 (r363493) +++ stable/12/contrib/llvm-project/clang/lib/Driver/ToolChains/Hurd.cpp Fri Jul 24 20:48:06 2020 (r363494) @@ -61,8 +61,7 @@ static StringRef getOSLibDir(const llvm::Triple &Tripl return Triple.isArch32Bit() ? "lib" : "lib64"; } -Hurd::Hurd(const Driver &D, const llvm::Triple &Triple, - const ArgList &Args) +Hurd::Hurd(const Driver &D, const llvm::Triple &Triple, const ArgList &Args) : Generic_ELF(D, Triple, Args) { std::string SysRoot = computeSysRoot(); path_list &Paths = getFilePaths(); @@ -169,4 +168,9 @@ void Hurd::AddClangSystemIncludeArgs(const ArgList &Dr addExternCSystemInclude(DriverArgs, CC1Args, SysRoot + "/include"); addExternCSystemInclude(DriverArgs, CC1Args, SysRoot + "/usr/include"); +} + +void Hurd::addExtraOpts(llvm::opt::ArgStringList &CmdArgs) const { + for (const auto &Opt : ExtraOpts) + CmdArgs.push_back(Opt.c_str()); } Modified: stable/12/contrib/llvm-project/clang/lib/Driver/ToolChains/Hurd.h ============================================================================== --- stable/12/contrib/llvm-project/clang/lib/Driver/ToolChains/Hurd.h Fri Jul 24 20:44:50 2020 (r363493) +++ stable/12/contrib/llvm-project/clang/lib/Driver/ToolChains/Hurd.h Fri Jul 24 20:48:06 2020 (r363494) @@ -27,9 +27,11 @@ class LLVM_LIBRARY_VISIBILITY Hurd : public Generic_EL AddClangSystemIncludeArgs(const llvm::opt::ArgList &DriverArgs, llvm::opt::ArgStringList &CC1Args) const override; - virtual std::string computeSysRoot() const; + std::string computeSysRoot() const; - virtual std::string getDynamicLinker(const llvm::opt::ArgList &Args) const; + std::string getDynamicLinker(const llvm::opt::ArgList &Args) const override; + + void addExtraOpts(llvm::opt::ArgStringList &CmdArgs) const override; std::vector ExtraOpts; Modified: stable/12/contrib/llvm-project/clang/lib/Driver/ToolChains/Linux.cpp ============================================================================== --- stable/12/contrib/llvm-project/clang/lib/Driver/ToolChains/Linux.cpp Fri Jul 24 20:44:50 2020 (r363493) +++ stable/12/contrib/llvm-project/clang/lib/Driver/ToolChains/Linux.cpp Fri Jul 24 20:48:06 2020 (r363494) @@ -986,3 +986,8 @@ void Linux::addProfileRTLibs(const llvm::opt::ArgList Twine("-u", llvm::getInstrProfRuntimeHookVarName()))); ToolChain::addProfileRTLibs(Args, CmdArgs); } + +void Linux::addExtraOpts(llvm::opt::ArgStringList &CmdArgs) const { + for (const auto &Opt : ExtraOpts) + CmdArgs.push_back(Opt.c_str()); +} Modified: stable/12/contrib/llvm-project/clang/lib/Driver/ToolChains/Linux.h ============================================================================== --- stable/12/contrib/llvm-project/clang/lib/Driver/ToolChains/Linux.h Fri Jul 24 20:44:50 2020 (r363493) +++ stable/12/contrib/llvm-project/clang/lib/Driver/ToolChains/Linux.h Fri Jul 24 20:48:06 2020 (r363494) @@ -42,7 +42,9 @@ class LLVM_LIBRARY_VISIBILITY Linux : public Generic_E llvm::opt::ArgStringList &CmdArgs) const override; virtual std::string computeSysRoot() const; - virtual std::string getDynamicLinker(const llvm::opt::ArgList &Args) const; + std::string getDynamicLinker(const llvm::opt::ArgList &Args) const override; + + void addExtraOpts(llvm::opt::ArgStringList &CmdArgs) const override; std::vector ExtraOpts; Modified: stable/12/contrib/llvm-project/clang/lib/Format/TokenAnnotator.cpp ============================================================================== --- stable/12/contrib/llvm-project/clang/lib/Format/TokenAnnotator.cpp Fri Jul 24 20:44:50 2020 (r363493) +++ stable/12/contrib/llvm-project/clang/lib/Format/TokenAnnotator.cpp Fri Jul 24 20:48:06 2020 (r363494) @@ -2176,6 +2176,10 @@ static bool isFunctionDeclarationName(const FormatToke Next = Next->Next; continue; } + if (Next->is(TT_TemplateOpener) && Next->MatchingParen) { + Next = Next->MatchingParen; + continue; + } break; } @@ -2705,20 +2709,40 @@ bool TokenAnnotator::spaceRequiredBetween(const Annota tok::l_square)); if (Right.is(tok::star) && Left.is(tok::l_paren)) return false; - if (Right.isOneOf(tok::star, tok::amp, tok::ampamp) && - (Left.is(tok::identifier) || Left.isSimpleTypeSpecifier()) && - // Space between the type and the * in: - // operator void*() - // operator char*() - // operator /*comment*/ const char*() - // operator volatile /*comment*/ char*() - // operator Foo*() - // dependent on PointerAlignment style. - Left.Previous && - (Left.Previous->endsSequence(tok::kw_operator) || - Left.Previous->endsSequence(tok::kw_const, tok::kw_operator) || - Left.Previous->endsSequence(tok::kw_volatile, tok::kw_operator))) - return (Style.PointerAlignment != FormatStyle::PAS_Left); + if (Right.is(tok::star) && Left.is(tok::star)) + return false; + if (Right.isOneOf(tok::star, tok::amp, tok::ampamp)) { + const FormatToken *Previous = &Left; + while (Previous && !Previous->is(tok::kw_operator)) { + if (Previous->is(tok::identifier) || Previous->isSimpleTypeSpecifier()) { + Previous = Previous->getPreviousNonComment(); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Fri Jul 24 20:52:10 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B92CB373AD5; Fri, 24 Jul 2020 20:52:10 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BD1bZ4XD7z4Gwj; Fri, 24 Jul 2020 20:52:10 +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 7FEFD1043E; Fri, 24 Jul 2020 20:52:10 +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 06OKqA44019926; Fri, 24 Jul 2020 20:52:10 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06OKqAg2019924; Fri, 24 Jul 2020 20:52:10 GMT (envelope-from mav@FreeBSD.org) Message-Id: <202007242052.06OKqAg2019924@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 24 Jul 2020 20:52:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363495 - in head/sys/x86: include x86 X-SVN-Group: head X-SVN-Commit-Author: mav X-SVN-Commit-Paths: in head/sys/x86: include x86 X-SVN-Commit-Revision: 363495 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 24 Jul 2020 20:52:10 -0000 Author: mav Date: Fri Jul 24 20:52:09 2020 New Revision: 363495 URL: https://svnweb.freebsd.org/changeset/base/363495 Log: Introduce ipi_self_from_nmi(). It allows safe IPI sending to current CPU from NMI context. Unlike other ipi_*() functions this waits for delivery to leave LAPIC in a state safe for interrupted code. MFC after: 2 weeks Sponsored by: iXsystems, Inc. Modified: head/sys/x86/include/x86_smp.h head/sys/x86/x86/mp_x86.c Modified: head/sys/x86/include/x86_smp.h ============================================================================== --- head/sys/x86/include/x86_smp.h Fri Jul 24 20:48:06 2020 (r363494) +++ head/sys/x86/include/x86_smp.h Fri Jul 24 20:52:09 2020 (r363495) @@ -97,6 +97,7 @@ void ipi_bitmap_handler(struct trapframe frame); void ipi_cpu(int cpu, u_int ipi); int ipi_nmi_handler(void); void ipi_selected(cpuset_t cpus, u_int ipi); +void ipi_self_from_nmi(u_int vector); void set_interrupt_apic_ids(void); void smp_cache_flush(smp_invl_cb_t curcpu_cb); void smp_masked_invlpg(cpuset_t mask, vm_offset_t addr, struct pmap *pmap, Modified: head/sys/x86/x86/mp_x86.c ============================================================================== --- head/sys/x86/x86/mp_x86.c Fri Jul 24 20:48:06 2020 (r363494) +++ head/sys/x86/x86/mp_x86.c Fri Jul 24 20:52:09 2020 (r363495) @@ -1398,6 +1398,21 @@ ipi_all_but_self(u_int ipi) lapic_ipi_vectored(ipi, APIC_IPI_DEST_OTHERS); } +void +ipi_self_from_nmi(u_int vector) +{ + + lapic_ipi_vectored(vector, APIC_IPI_DEST_SELF); + + /* Wait for IPI to finish. */ + if (!lapic_ipi_wait(50000)) { + if (KERNEL_PANICKED()) + return; + else + panic("APIC: IPI is stuck"); + } +} + int ipi_nmi_handler(void) { From owner-svn-src-all@freebsd.org Fri Jul 24 20:54:14 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 14948373DE1; Fri, 24 Jul 2020 20:54:14 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BD1dx6FPYz4HHh; Fri, 24 Jul 2020 20:54:13 +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 BA2AD100F6; Fri, 24 Jul 2020 20:54:13 +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 06OKsDnb020123; Fri, 24 Jul 2020 20:54:13 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06OKs8vn020092; Fri, 24 Jul 2020 20:54:08 GMT (envelope-from dim@FreeBSD.org) Message-Id: <202007242054.06OKs8vn020092@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Fri, 24 Jul 2020 20:54: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: r363496 - in stable/11: . contrib/llvm-project contrib/llvm-project/clang/include/clang/AST contrib/llvm-project/clang/include/clang/Basic contrib/llvm-project/clang/include/clang/Drive... X-SVN-Group: stable-11 X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in stable/11: . contrib/llvm-project contrib/llvm-project/clang/include/clang/AST contrib/llvm-project/clang/include/clang/Basic contrib/llvm-project/clang/include/clang/Driver contrib/llvm-project/cl... X-SVN-Commit-Revision: 363496 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 24 Jul 2020 20:54:14 -0000 Author: dim Date: Fri Jul 24 20:54:07 2020 New Revision: 363496 URL: https://svnweb.freebsd.org/changeset/base/363496 Log: Merge llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and openmp 10.0.1 final (aka llvmorg-10.0.1-0-gef32c611aa2). MFC r360702: Merge commit 4ca2cad94 from llvm git (by Justin Hibbits): [PowerPC] Add clang -msvr4-struct-return for 32-bit ELF Summary: Change the default ABI to be compatible with GCC. For 32-bit ELF targets other than Linux, Clang now returns small structs in registers r3/r4. This affects FreeBSD, NetBSD, OpenBSD. There is no change for 32-bit Linux, where Clang continues to return all structs in memory. Add clang options -maix-struct-return (to return structs in memory) and -msvr4-struct-return (to return structs in registers) to be compatible with gcc. These options are only for PPC32; reject them on PPC64 and other targets. The options are like -fpcc-struct-return and -freg-struct-return for X86_32, and use similar code. To actually return a struct in registers, coerce it to an integer of the same size. LLVM may optimize the code to remove unnecessary accesses to memory, and will return i32 in r3 or i64 in r3:r4. Fixes PR#40736 Patch by George Koehler! Reviewed By: jhibbits, nemanjai Differential Revision: https://reviews.llvm.org/D73290 Requested by: jhibbits MFC r361410: Merge llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and openmp llvmorg-10.0.1-rc1-0-gf79cd71e145 (aka 10.0.1 rc1). MFC r362235 (by kp): llvm: Default to -mno-relax on RISC-V Compiling on a RISC-V system fails with 'relocation R_RISCV_ALIGN requires unimplemented linker relaxation; recompile with -mno-relax'. Our default linker (ld.lld) doesn't support relaxation, so default to no-relax so we don't generate object files the linker can't handle. Reviewed by: mhorne Sponsored by: Axiado Differential Revision: https://reviews.freebsd.org/D25210 MFC r362445: Merge llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and openmp llvmorg-10.0.0-97-g6f71678ecd2 (not quite 10.0.1 rc2, as more fixes are still pending). MFC r362587 (by cem): Add WITH_CLANG_FORMAT option clang-format is enabled conditional on either WITH_CLANG_EXTRAS or WITH_CLANG_FORMAT. Some sources in libclang are build conditional on either rule, and obviously the clang-format binary itself depends on the rule. clang-format could still use a manual page. Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D25427 MFC r362609: Merge llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and openmp llvmorg-10.0.0-129-gd24d5c8e308. Getting closer to 10.0.1-rc2. MFC r362679: Regenerate ReStructuredText based manpages for llvm-project tools: * bugpoint.1 * clang.1 * llc.1 * lldb.1 * lli.1 * llvm-ar.1 * llvm-as.1 * llvm-bcanalyzer.1 * llvm-cov.1 * llvm-diff.1 * llvm-dis.1 * llvm-dwarfdump.1 * llvm-extract.1 * llvm-link.1 * llvm-mca.1 * llvm-nm.1 * llvm-pdbutil.1 * llvm-profdata.1 * llvm-symbolizer.1 * llvm-tblgen.1 * opt.1 Add newly generated manpages for: * llvm-addr2line.1 (this is an alias of llvm-symbolizer) * llvm-cxxfilt.1 * llvm-objcopy.1 * llvm-ranlib.1 (this is an alias of llvm-ar) Note that llvm-objdump.1 is an exception, as upstream has both a plain .1 file, and a .rst variant. These will have to be reconciled upstream first. MFC r362680: Follow-up to r362679, add more entries to OptionalObsoleteFiles.inc MFC r362719: Merge llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and openmp llvmorg-10.0.1-rc2-0-g77d76b71d7d. Also add a few more llvm utilities under WITH_CLANG_EXTRAS: * llvm-dwp, a utility for merging DWARF 5 Split DWARF .dwo files into .dwp (DWARF package files) * llvm-size, a size(1) replacement * llvm-strings, a strings(1) replacement MFC r362733: Remove older llvm-ranlib.1 entry from ObsoleteFiles.inc, as it has gotten its own manpage now, and should be no longer be removed by "make delete-old". MFC r362734: Fix llvm-strings.1 not installing, this was a copy/paste error. MFC r363401: Merge llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and openmp 10.0.1 final (aka llvmorg-10.0.1-0-gef32c611aa2). There were no changes since rc2, except in the upstream regression tests, which we do not ship. Relnotes: yes Added: stable/11/contrib/llvm-project/compiler-rt/lib/builtins/riscv/int_mul_impl.inc - copied unchanged from r362719, head/contrib/llvm-project/compiler-rt/lib/builtins/riscv/int_mul_impl.inc stable/11/contrib/llvm-project/compiler-rt/lib/builtins/riscv/muldi3.S - copied unchanged from r362719, head/contrib/llvm-project/compiler-rt/lib/builtins/riscv/muldi3.S stable/11/contrib/llvm-project/llvm/include/llvm/CodeGen/RDFGraph.h - copied unchanged from r362609, head/contrib/llvm-project/llvm/include/llvm/CodeGen/RDFGraph.h stable/11/contrib/llvm-project/llvm/include/llvm/CodeGen/RDFLiveness.h - copied unchanged from r362609, head/contrib/llvm-project/llvm/include/llvm/CodeGen/RDFLiveness.h stable/11/contrib/llvm-project/llvm/include/llvm/CodeGen/RDFRegisters.h - copied unchanged from r362609, head/contrib/llvm-project/llvm/include/llvm/CodeGen/RDFRegisters.h stable/11/contrib/llvm-project/llvm/lib/CodeGen/RDFGraph.cpp - copied unchanged from r362609, head/contrib/llvm-project/llvm/lib/CodeGen/RDFGraph.cpp stable/11/contrib/llvm-project/llvm/lib/CodeGen/RDFLiveness.cpp - copied unchanged from r362609, head/contrib/llvm-project/llvm/lib/CodeGen/RDFLiveness.cpp stable/11/contrib/llvm-project/llvm/lib/CodeGen/RDFRegisters.cpp - copied unchanged from r362609, head/contrib/llvm-project/llvm/lib/CodeGen/RDFRegisters.cpp stable/11/contrib/llvm-project/llvm/lib/Target/AArch64/AArch64SchedThunderX3T110.td - copied unchanged from r362445, head/contrib/llvm-project/llvm/lib/Target/AArch64/AArch64SchedThunderX3T110.td stable/11/contrib/llvm-project/llvm/lib/Target/X86/ImmutableGraph.h - copied unchanged from r362609, head/contrib/llvm-project/llvm/lib/Target/X86/ImmutableGraph.h stable/11/contrib/llvm-project/llvm/lib/Target/X86/X86IndirectThunks.cpp - copied unchanged from r362609, head/contrib/llvm-project/llvm/lib/Target/X86/X86IndirectThunks.cpp stable/11/contrib/llvm-project/llvm/lib/Target/X86/X86LoadValueInjectionLoadHardening.cpp - copied unchanged from r362609, head/contrib/llvm-project/llvm/lib/Target/X86/X86LoadValueInjectionLoadHardening.cpp stable/11/contrib/llvm-project/llvm/lib/Target/X86/X86LoadValueInjectionRetHardening.cpp - copied unchanged from r362609, head/contrib/llvm-project/llvm/lib/Target/X86/X86LoadValueInjectionRetHardening.cpp stable/11/contrib/llvm-project/llvm/tools/llvm-dwp/ - copied from r362719, head/contrib/llvm-project/llvm/tools/llvm-dwp/ stable/11/contrib/llvm-project/llvm/tools/llvm-size/ - copied from r362719, head/contrib/llvm-project/llvm/tools/llvm-size/ stable/11/contrib/llvm-project/llvm/tools/llvm-strings/ - copied from r362719, head/contrib/llvm-project/llvm/tools/llvm-strings/ stable/11/tools/build/options/WITH_CLANG_FORMAT - copied unchanged from r362587, head/tools/build/options/WITH_CLANG_FORMAT stable/11/usr.bin/clang/llvm-ar/llvm-ranlib.1 - copied unchanged from r362679, head/usr.bin/clang/llvm-ar/llvm-ranlib.1 stable/11/usr.bin/clang/llvm-cxxfilt/llvm-cxxfilt.1 - copied unchanged from r362679, head/usr.bin/clang/llvm-cxxfilt/llvm-cxxfilt.1 stable/11/usr.bin/clang/llvm-dwp/ - copied from r362719, head/usr.bin/clang/llvm-dwp/ stable/11/usr.bin/clang/llvm-objcopy/llvm-objcopy.1 - copied unchanged from r362679, head/usr.bin/clang/llvm-objcopy/llvm-objcopy.1 stable/11/usr.bin/clang/llvm-size/ - copied from r362719, head/usr.bin/clang/llvm-size/ stable/11/usr.bin/clang/llvm-strings/ - copied from r362719, head/usr.bin/clang/llvm-strings/ stable/11/usr.bin/clang/llvm-symbolizer/llvm-addr2line.1 - copied unchanged from r362679, head/usr.bin/clang/llvm-symbolizer/llvm-addr2line.1 Deleted: stable/11/contrib/llvm-project/llvm/lib/Target/Hexagon/RDFGraph.cpp stable/11/contrib/llvm-project/llvm/lib/Target/Hexagon/RDFGraph.h stable/11/contrib/llvm-project/llvm/lib/Target/Hexagon/RDFLiveness.cpp stable/11/contrib/llvm-project/llvm/lib/Target/Hexagon/RDFLiveness.h stable/11/contrib/llvm-project/llvm/lib/Target/Hexagon/RDFRegisters.cpp stable/11/contrib/llvm-project/llvm/lib/Target/Hexagon/RDFRegisters.h stable/11/contrib/llvm-project/llvm/lib/Target/X86/X86RetpolineThunks.cpp Modified: stable/11/Makefile.inc1 stable/11/ObsoleteFiles.inc stable/11/UPDATING stable/11/contrib/llvm-project/FREEBSD-Xlist stable/11/contrib/llvm-project/clang/include/clang/AST/DeclBase.h stable/11/contrib/llvm-project/clang/include/clang/Basic/Attr.td stable/11/contrib/llvm-project/clang/include/clang/Driver/Options.td stable/11/contrib/llvm-project/clang/lib/AST/DeclBase.cpp stable/11/contrib/llvm-project/clang/lib/AST/ExprConstant.cpp stable/11/contrib/llvm-project/clang/lib/AST/RawCommentList.cpp stable/11/contrib/llvm-project/clang/lib/Basic/Targets/PPC.h stable/11/contrib/llvm-project/clang/lib/CodeGen/CodeGenModule.cpp stable/11/contrib/llvm-project/clang/lib/CodeGen/TargetInfo.cpp stable/11/contrib/llvm-project/clang/lib/Driver/SanitizerArgs.cpp stable/11/contrib/llvm-project/clang/lib/Driver/ToolChain.cpp stable/11/contrib/llvm-project/clang/lib/Driver/ToolChains/Arch/RISCV.cpp stable/11/contrib/llvm-project/clang/lib/Driver/ToolChains/Arch/X86.cpp stable/11/contrib/llvm-project/clang/lib/Driver/ToolChains/Clang.cpp stable/11/contrib/llvm-project/clang/lib/Driver/ToolChains/Darwin.cpp stable/11/contrib/llvm-project/clang/lib/Driver/ToolChains/Gnu.cpp stable/11/contrib/llvm-project/clang/lib/Driver/ToolChains/Gnu.h stable/11/contrib/llvm-project/clang/lib/Driver/ToolChains/Hurd.cpp stable/11/contrib/llvm-project/clang/lib/Driver/ToolChains/Hurd.h stable/11/contrib/llvm-project/clang/lib/Driver/ToolChains/Linux.cpp stable/11/contrib/llvm-project/clang/lib/Driver/ToolChains/Linux.h stable/11/contrib/llvm-project/clang/lib/Format/TokenAnnotator.cpp stable/11/contrib/llvm-project/clang/lib/Frontend/CompilerInvocation.cpp stable/11/contrib/llvm-project/clang/lib/Sema/SemaTemplate.cpp stable/11/contrib/llvm-project/clang/lib/Sema/SemaTemplateInstantiate.cpp stable/11/contrib/llvm-project/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp stable/11/contrib/llvm-project/clang/lib/Sema/TreeTransform.h stable/11/contrib/llvm-project/clang/lib/Tooling/Syntax/Tokens.cpp stable/11/contrib/llvm-project/clang/utils/TableGen/ClangAttrEmitter.cpp stable/11/contrib/llvm-project/compiler-rt/lib/builtins/riscv/mulsi3.S stable/11/contrib/llvm-project/compiler-rt/lib/profile/GCDAProfiling.c stable/11/contrib/llvm-project/libcxx/include/array stable/11/contrib/llvm-project/lld/COFF/Chunks.h stable/11/contrib/llvm-project/lld/COFF/DLL.cpp stable/11/contrib/llvm-project/lld/COFF/MarkLive.cpp stable/11/contrib/llvm-project/lld/ELF/Driver.cpp stable/11/contrib/llvm-project/lld/ELF/InputSection.cpp stable/11/contrib/llvm-project/lld/ELF/InputSection.h stable/11/contrib/llvm-project/lld/ELF/OutputSections.cpp stable/11/contrib/llvm-project/lld/ELF/ScriptLexer.cpp stable/11/contrib/llvm-project/lld/ELF/ScriptParser.cpp stable/11/contrib/llvm-project/lld/ELF/Writer.cpp stable/11/contrib/llvm-project/llvm/include/llvm/Analysis/ValueLattice.h stable/11/contrib/llvm-project/llvm/include/llvm/DebugInfo/CodeView/GlobalTypeTableBuilder.h stable/11/contrib/llvm-project/llvm/include/llvm/IR/IntrinsicsPowerPC.td stable/11/contrib/llvm-project/llvm/include/llvm/Support/AArch64TargetParser.def stable/11/contrib/llvm-project/llvm/include/llvm/Support/ManagedStatic.h stable/11/contrib/llvm-project/llvm/include/llvm/Target/TargetSelectionDAG.td stable/11/contrib/llvm-project/llvm/lib/Analysis/LazyValueInfo.cpp stable/11/contrib/llvm-project/llvm/lib/Analysis/ValueLattice.cpp stable/11/contrib/llvm-project/llvm/lib/CodeGen/BranchFolding.cpp stable/11/contrib/llvm-project/llvm/lib/CodeGen/MachineSink.cpp stable/11/contrib/llvm-project/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp stable/11/contrib/llvm-project/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp stable/11/contrib/llvm-project/llvm/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp stable/11/contrib/llvm-project/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp stable/11/contrib/llvm-project/llvm/lib/DebugInfo/CodeView/MergingTypeTableBuilder.cpp stable/11/contrib/llvm-project/llvm/lib/DebugInfo/CodeView/TypeStreamMerger.cpp stable/11/contrib/llvm-project/llvm/lib/DebugInfo/PDB/Native/TpiStreamBuilder.cpp stable/11/contrib/llvm-project/llvm/lib/LTO/LTO.cpp stable/11/contrib/llvm-project/llvm/lib/MC/MCObjectFileInfo.cpp stable/11/contrib/llvm-project/llvm/lib/Target/AArch64/AArch64.td stable/11/contrib/llvm-project/llvm/lib/Target/AArch64/AArch64BranchTargets.cpp stable/11/contrib/llvm-project/llvm/lib/Target/AArch64/AArch64FrameLowering.cpp stable/11/contrib/llvm-project/llvm/lib/Target/AArch64/AArch64SchedA53.td stable/11/contrib/llvm-project/llvm/lib/Target/AArch64/AArch64SchedA57.td stable/11/contrib/llvm-project/llvm/lib/Target/AArch64/AArch64SchedCyclone.td stable/11/contrib/llvm-project/llvm/lib/Target/AArch64/AArch64SchedExynosM3.td stable/11/contrib/llvm-project/llvm/lib/Target/AArch64/AArch64SchedExynosM4.td stable/11/contrib/llvm-project/llvm/lib/Target/AArch64/AArch64SchedExynosM5.td stable/11/contrib/llvm-project/llvm/lib/Target/AArch64/AArch64SchedFalkor.td stable/11/contrib/llvm-project/llvm/lib/Target/AArch64/AArch64SchedKryo.td stable/11/contrib/llvm-project/llvm/lib/Target/AArch64/AArch64SchedThunderX.td stable/11/contrib/llvm-project/llvm/lib/Target/AArch64/AArch64SchedThunderX2T99.td stable/11/contrib/llvm-project/llvm/lib/Target/AArch64/AArch64Subtarget.cpp stable/11/contrib/llvm-project/llvm/lib/Target/AArch64/AArch64Subtarget.h stable/11/contrib/llvm-project/llvm/lib/Target/BPF/BPFISelDAGToDAG.cpp stable/11/contrib/llvm-project/llvm/lib/Target/BPF/BPFMISimplifyPatchable.cpp stable/11/contrib/llvm-project/llvm/lib/Target/BPF/BTFDebug.cpp stable/11/contrib/llvm-project/llvm/lib/Target/Hexagon/HexagonOptAddrMode.cpp stable/11/contrib/llvm-project/llvm/lib/Target/Hexagon/HexagonRDFOpt.cpp stable/11/contrib/llvm-project/llvm/lib/Target/Hexagon/RDFCopy.cpp stable/11/contrib/llvm-project/llvm/lib/Target/Hexagon/RDFCopy.h stable/11/contrib/llvm-project/llvm/lib/Target/Hexagon/RDFDeadCode.cpp stable/11/contrib/llvm-project/llvm/lib/Target/Hexagon/RDFDeadCode.h stable/11/contrib/llvm-project/llvm/lib/Target/PowerPC/P9InstrResources.td stable/11/contrib/llvm-project/llvm/lib/Target/PowerPC/PPC.td stable/11/contrib/llvm-project/llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp stable/11/contrib/llvm-project/llvm/lib/Target/PowerPC/PPCISelLowering.cpp stable/11/contrib/llvm-project/llvm/lib/Target/PowerPC/PPCISelLowering.h stable/11/contrib/llvm-project/llvm/lib/Target/PowerPC/PPCInstrAltivec.td stable/11/contrib/llvm-project/llvm/lib/Target/PowerPC/PPCInstrInfo.cpp stable/11/contrib/llvm-project/llvm/lib/Target/PowerPC/PPCInstrVSX.td stable/11/contrib/llvm-project/llvm/lib/Target/PowerPC/PPCSubtarget.h stable/11/contrib/llvm-project/llvm/lib/Target/RISCV/RISCVFrameLowering.cpp stable/11/contrib/llvm-project/llvm/lib/Target/RISCV/RISCVISelLowering.cpp stable/11/contrib/llvm-project/llvm/lib/Target/X86/X86.h stable/11/contrib/llvm-project/llvm/lib/Target/X86/X86.td stable/11/contrib/llvm-project/llvm/lib/Target/X86/X86AsmPrinter.cpp stable/11/contrib/llvm-project/llvm/lib/Target/X86/X86FastISel.cpp stable/11/contrib/llvm-project/llvm/lib/Target/X86/X86FrameLowering.cpp stable/11/contrib/llvm-project/llvm/lib/Target/X86/X86ISelDAGToDAG.cpp stable/11/contrib/llvm-project/llvm/lib/Target/X86/X86ISelLowering.cpp stable/11/contrib/llvm-project/llvm/lib/Target/X86/X86ISelLowering.h stable/11/contrib/llvm-project/llvm/lib/Target/X86/X86IndirectBranchTracking.cpp stable/11/contrib/llvm-project/llvm/lib/Target/X86/X86InstrCompiler.td stable/11/contrib/llvm-project/llvm/lib/Target/X86/X86InstrControl.td stable/11/contrib/llvm-project/llvm/lib/Target/X86/X86InstrInfo.cpp stable/11/contrib/llvm-project/llvm/lib/Target/X86/X86InstrInfo.td stable/11/contrib/llvm-project/llvm/lib/Target/X86/X86MCInstLower.cpp stable/11/contrib/llvm-project/llvm/lib/Target/X86/X86Subtarget.h stable/11/contrib/llvm-project/llvm/lib/Target/X86/X86TargetMachine.cpp stable/11/contrib/llvm-project/llvm/lib/Target/X86/X86TargetMachine.h stable/11/contrib/llvm-project/llvm/lib/Transforms/Coroutines/CoroSplit.cpp stable/11/contrib/llvm-project/llvm/lib/Transforms/IPO/GlobalOpt.cpp stable/11/contrib/llvm-project/llvm/lib/Transforms/InstCombine/InstCombineAddSub.cpp stable/11/contrib/llvm-project/llvm/lib/Transforms/Instrumentation/GCOVProfiling.cpp stable/11/contrib/llvm-project/llvm/lib/Transforms/Scalar/IndVarSimplify.cpp stable/11/contrib/llvm-project/llvm/lib/Transforms/Scalar/SimplifyCFGPass.cpp stable/11/contrib/llvm-project/llvm/lib/Transforms/Utils/ValueMapper.cpp stable/11/contrib/llvm-project/llvm/tools/llvm-objcopy/ELF/Object.cpp stable/11/contrib/llvm-project/llvm/tools/llvm-objcopy/llvm-objcopy.cpp stable/11/etc/mtree/BSD.debug.dist stable/11/etc/mtree/BSD.usr.dist stable/11/lib/clang/freebsd_cc_version.h stable/11/lib/clang/headers/Makefile stable/11/lib/clang/include/VCSVersion.inc stable/11/lib/clang/include/clang/Basic/Version.inc stable/11/lib/clang/include/clang/Config/config.h stable/11/lib/clang/include/lld/Common/Version.inc stable/11/lib/clang/include/llvm/Config/config.h stable/11/lib/clang/include/llvm/Config/llvm-config.h stable/11/lib/clang/include/llvm/Support/VCSRevision.h stable/11/lib/clang/libclang/Makefile stable/11/lib/clang/libllvm/Makefile stable/11/lib/libclang_rt/Makefile.inc stable/11/share/mk/src.opts.mk stable/11/sys/sys/param.h stable/11/targets/pseudo/bootstrap-tools/Makefile stable/11/targets/pseudo/clang/Makefile.depend stable/11/tools/build/mk/OptionalObsoleteFiles.inc stable/11/usr.bin/clang/Makefile stable/11/usr.bin/clang/bugpoint/bugpoint.1 stable/11/usr.bin/clang/clang/clang.1 stable/11/usr.bin/clang/llc/llc.1 stable/11/usr.bin/clang/lldb/lldb.1 stable/11/usr.bin/clang/lli/lli.1 stable/11/usr.bin/clang/llvm-ar/Makefile stable/11/usr.bin/clang/llvm-ar/llvm-ar.1 stable/11/usr.bin/clang/llvm-as/llvm-as.1 stable/11/usr.bin/clang/llvm-bcanalyzer/llvm-bcanalyzer.1 stable/11/usr.bin/clang/llvm-cov/llvm-cov.1 stable/11/usr.bin/clang/llvm-cxxfilt/Makefile stable/11/usr.bin/clang/llvm-diff/llvm-diff.1 stable/11/usr.bin/clang/llvm-dis/llvm-dis.1 stable/11/usr.bin/clang/llvm-dwarfdump/llvm-dwarfdump.1 stable/11/usr.bin/clang/llvm-extract/llvm-extract.1 stable/11/usr.bin/clang/llvm-link/llvm-link.1 stable/11/usr.bin/clang/llvm-mca/llvm-mca.1 stable/11/usr.bin/clang/llvm-nm/llvm-nm.1 stable/11/usr.bin/clang/llvm-objcopy/Makefile stable/11/usr.bin/clang/llvm-objdump/llvm-objdump.1 stable/11/usr.bin/clang/llvm-pdbutil/llvm-pdbutil.1 stable/11/usr.bin/clang/llvm-profdata/llvm-profdata.1 stable/11/usr.bin/clang/llvm-strings/Makefile stable/11/usr.bin/clang/llvm-symbolizer/Makefile stable/11/usr.bin/clang/llvm-symbolizer/llvm-symbolizer.1 stable/11/usr.bin/clang/llvm-tblgen/llvm-tblgen.1 stable/11/usr.bin/clang/opt/opt.1 Directory Properties: stable/11/ (props changed) stable/11/contrib/llvm-project/clang/ (props changed) stable/11/contrib/llvm-project/compiler-rt/ (props changed) stable/11/contrib/llvm-project/libcxx/ (props changed) stable/11/contrib/llvm-project/lld/ (props changed) stable/11/contrib/llvm-project/lldb/ (props changed) stable/11/contrib/llvm-project/llvm/ (props changed) Modified: stable/11/Makefile.inc1 ============================================================================== --- stable/11/Makefile.inc1 Fri Jul 24 20:52:09 2020 (r363495) +++ stable/11/Makefile.inc1 Fri Jul 24 20:54:07 2020 (r363496) @@ -518,7 +518,7 @@ BSARGS= DESTDIR= \ MK_HTML=no NO_LINT=yes MK_MAN=no \ -DNO_PIC MK_PROFILE=no -DNO_SHARED \ -DNO_CPU_CFLAGS MK_WARNS=no MK_CTF=no \ - MK_CLANG_EXTRAS=no MK_CLANG_FULL=no \ + MK_CLANG_EXTRAS=no MK_CLANG_FORMAT=no MK_CLANG_FULL=no \ MK_LLDB=no MK_TESTS=no \ MK_INCLUDES=yes @@ -535,7 +535,7 @@ TMAKE= MAKEOBJDIRPREFIX=${OBJTREE} \ SSP_CFLAGS= \ -DNO_LINT \ -DNO_CPU_CFLAGS MK_WARNS=no MK_CTF=no \ - MK_CLANG_EXTRAS=no MK_CLANG_FULL=no \ + MK_CLANG_EXTRAS=no MK_CLANG_FORMAT=no MK_CLANG_FULL=no \ MK_LLDB=no MK_TESTS=no # cross-tools stage @@ -2004,7 +2004,7 @@ NXBMAKE= ${NXBENV} ${MAKE} \ MK_HTML=no NO_LINT=yes MK_MAN=no \ -DNO_PIC MK_PROFILE=no -DNO_SHARED \ -DNO_CPU_CFLAGS MK_WARNS=no MK_CTF=no \ - MK_CLANG_EXTRAS=no MK_CLANG_FULL=no \ + MK_CLANG_EXTRAS=no MK_CLANG_FORMAT=no MK_CLANG_FULL=no \ MK_LLDB=no MK_DEBUG_FILES=no # native-xtools is the current target for qemu-user cross builds of ports Modified: stable/11/ObsoleteFiles.inc ============================================================================== --- stable/11/ObsoleteFiles.inc Fri Jul 24 20:52:09 2020 (r363495) +++ stable/11/ObsoleteFiles.inc Fri Jul 24 20:54:07 2020 (r363496) @@ -38,6 +38,257 @@ # xargs -n1 | sort | uniq -d; # done +# 20200723: new clang import which bumps version from 10.0.0 to 10.0.1.s +OLD_FILES+=usr/lib/clang/10.0.0/include/cuda_wrappers/algorithm +OLD_FILES+=usr/lib/clang/10.0.0/include/cuda_wrappers/complex +OLD_FILES+=usr/lib/clang/10.0.0/include/cuda_wrappers/new +OLD_DIRS+=usr/lib/clang/10.0.0/include/cuda_wrappers +OLD_FILES+=usr/lib/clang/10.0.0/include/fuzzer/FuzzedDataProvider.h +OLD_DIRS+=usr/lib/clang/10.0.0/include/fuzzer +OLD_FILES+=usr/lib/clang/10.0.0/include/openmp_wrappers/__clang_openmp_math.h +OLD_FILES+=usr/lib/clang/10.0.0/include/openmp_wrappers/__clang_openmp_math_declares.h +OLD_FILES+=usr/lib/clang/10.0.0/include/openmp_wrappers/cmath +OLD_FILES+=usr/lib/clang/10.0.0/include/openmp_wrappers/math.h +OLD_DIRS+=usr/lib/clang/10.0.0/include/openmp_wrappers +OLD_FILES+=usr/lib/clang/10.0.0/include/ppc_wrappers/emmintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/ppc_wrappers/mm_malloc.h +OLD_FILES+=usr/lib/clang/10.0.0/include/ppc_wrappers/mmintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/ppc_wrappers/pmmintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/ppc_wrappers/smmintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/ppc_wrappers/tmmintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/ppc_wrappers/xmmintrin.h +OLD_DIRS+=usr/lib/clang/10.0.0/include/ppc_wrappers +OLD_FILES+=usr/lib/clang/10.0.0/include/profile/InstrProfData.inc +OLD_DIRS+=usr/lib/clang/10.0.0/include/profile +OLD_FILES+=usr/lib/clang/10.0.0/include/sanitizer/allocator_interface.h +OLD_FILES+=usr/lib/clang/10.0.0/include/sanitizer/asan_interface.h +OLD_FILES+=usr/lib/clang/10.0.0/include/sanitizer/common_interface_defs.h +OLD_FILES+=usr/lib/clang/10.0.0/include/sanitizer/coverage_interface.h +OLD_FILES+=usr/lib/clang/10.0.0/include/sanitizer/dfsan_interface.h +OLD_FILES+=usr/lib/clang/10.0.0/include/sanitizer/hwasan_interface.h +OLD_FILES+=usr/lib/clang/10.0.0/include/sanitizer/linux_syscall_hooks.h +OLD_FILES+=usr/lib/clang/10.0.0/include/sanitizer/lsan_interface.h +OLD_FILES+=usr/lib/clang/10.0.0/include/sanitizer/msan_interface.h +OLD_FILES+=usr/lib/clang/10.0.0/include/sanitizer/netbsd_syscall_hooks.h +OLD_FILES+=usr/lib/clang/10.0.0/include/sanitizer/scudo_interface.h +OLD_FILES+=usr/lib/clang/10.0.0/include/sanitizer/tsan_interface.h +OLD_FILES+=usr/lib/clang/10.0.0/include/sanitizer/tsan_interface_atomic.h +OLD_FILES+=usr/lib/clang/10.0.0/include/sanitizer/ubsan_interface.h +OLD_DIRS+=usr/lib/clang/10.0.0/include/sanitizer +OLD_FILES+=usr/lib/clang/10.0.0/include/xray/xray_interface.h +OLD_FILES+=usr/lib/clang/10.0.0/include/xray/xray_log_interface.h +OLD_FILES+=usr/lib/clang/10.0.0/include/xray/xray_records.h +OLD_DIRS+=usr/lib/clang/10.0.0/include/xray +OLD_FILES+=usr/lib/clang/10.0.0/include/__clang_cuda_builtin_vars.h +OLD_FILES+=usr/lib/clang/10.0.0/include/__clang_cuda_cmath.h +OLD_FILES+=usr/lib/clang/10.0.0/include/__clang_cuda_complex_builtins.h +OLD_FILES+=usr/lib/clang/10.0.0/include/__clang_cuda_device_functions.h +OLD_FILES+=usr/lib/clang/10.0.0/include/__clang_cuda_intrinsics.h +OLD_FILES+=usr/lib/clang/10.0.0/include/__clang_cuda_libdevice_declares.h +OLD_FILES+=usr/lib/clang/10.0.0/include/__clang_cuda_math_forward_declares.h +OLD_FILES+=usr/lib/clang/10.0.0/include/__clang_cuda_runtime_wrapper.h +OLD_FILES+=usr/lib/clang/10.0.0/include/__stddef_max_align_t.h +OLD_FILES+=usr/lib/clang/10.0.0/include/__wmmintrin_aes.h +OLD_FILES+=usr/lib/clang/10.0.0/include/__wmmintrin_pclmul.h +OLD_FILES+=usr/lib/clang/10.0.0/include/adxintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/altivec.h +OLD_FILES+=usr/lib/clang/10.0.0/include/ammintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/arm64intr.h +OLD_FILES+=usr/lib/clang/10.0.0/include/arm_acle.h +OLD_FILES+=usr/lib/clang/10.0.0/include/arm_cmse.h +OLD_FILES+=usr/lib/clang/10.0.0/include/arm_fp16.h +OLD_FILES+=usr/lib/clang/10.0.0/include/arm_mve.h +OLD_FILES+=usr/lib/clang/10.0.0/include/arm_neon.h +OLD_FILES+=usr/lib/clang/10.0.0/include/armintr.h +OLD_FILES+=usr/lib/clang/10.0.0/include/avx2intrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/avx512bf16intrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/avx512bitalgintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/avx512bwintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/avx512cdintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/avx512dqintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/avx512erintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/avx512fintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/avx512ifmaintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/avx512ifmavlintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/avx512pfintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/avx512vbmi2intrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/avx512vbmiintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/avx512vbmivlintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/avx512vlbf16intrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/avx512vlbitalgintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/avx512vlbwintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/avx512vlcdintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/avx512vldqintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/avx512vlintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/avx512vlvbmi2intrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/avx512vlvnniintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/avx512vlvp2intersectintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/avx512vnniintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/avx512vp2intersectintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/avx512vpopcntdqintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/avx512vpopcntdqvlintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/avxintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/bmi2intrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/bmiintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/cetintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/cldemoteintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/clflushoptintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/clwbintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/clzerointrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/cpuid.h +OLD_FILES+=usr/lib/clang/10.0.0/include/emmintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/enqcmdintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/f16cintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/fma4intrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/fmaintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/fxsrintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/gfniintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/htmintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/htmxlintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/ia32intrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/immintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/invpcidintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/lwpintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/lzcntintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/mm3dnow.h +OLD_FILES+=usr/lib/clang/10.0.0/include/mm_malloc.h +OLD_FILES+=usr/lib/clang/10.0.0/include/mmintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/module.modulemap +OLD_FILES+=usr/lib/clang/10.0.0/include/movdirintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/msa.h +OLD_FILES+=usr/lib/clang/10.0.0/include/mwaitxintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/nmmintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/opencl-c-base.h +OLD_FILES+=usr/lib/clang/10.0.0/include/opencl-c.h +OLD_FILES+=usr/lib/clang/10.0.0/include/pconfigintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/pkuintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/pmmintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/popcntintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/prfchwintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/ptwriteintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/rdseedintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/rtmintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/s390intrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/sgxintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/shaintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/smmintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/tbmintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/tmmintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/vadefs.h +OLD_FILES+=usr/lib/clang/10.0.0/include/vaesintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/vecintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/vpclmulqdqintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/waitpkgintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/wbnoinvdintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/wmmintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/x86intrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/xmmintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/xopintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/xsavecintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/xsaveintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/xsaveoptintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/xsavesintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/xtestintrin.h +OLD_DIRS+=usr/lib/clang/10.0.0/include +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.asan-aarch64.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.asan-aarch64.so +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.asan-arm.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.asan-arm.so +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.asan-armhf.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.asan-armhf.so +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.asan-i386.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.asan-i386.so +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.asan-preinit-aarch64.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.asan-preinit-arm.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.asan-preinit-armhf.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.asan-preinit-i386.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.asan-preinit-x86_64.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.asan-x86_64.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.asan-x86_64.so +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.asan_cxx-aarch64.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.asan_cxx-arm.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.asan_cxx-armhf.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.asan_cxx-i386.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.asan_cxx-x86_64.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.cfi-aarch64.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.cfi-arm.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.cfi-armhf.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.cfi-i386.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.cfi-x86_64.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.cfi_diag-aarch64.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.cfi_diag-arm.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.cfi_diag-armhf.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.cfi_diag-i386.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.cfi_diag-x86_64.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.dd-aarch64.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.dd-x86_64.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.fuzzer-aarch64.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.fuzzer-x86_64.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.fuzzer_no_main-aarch64.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.fuzzer_no_main-x86_64.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.msan-aarch64.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.msan-x86_64.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.msan_cxx-aarch64.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.msan_cxx-x86_64.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.profile-aarch64.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.profile-arm.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.profile-armhf.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.profile-i386.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.profile-powerpc.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.profile-powerpc64.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.profile-x86_64.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.safestack-aarch64.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.safestack-i386.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.safestack-x86_64.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.stats-aarch64.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.stats-arm.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.stats-armhf.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.stats-i386.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.stats-x86_64.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.stats_client-aarch64.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.stats_client-arm.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.stats_client-armhf.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.stats_client-i386.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.stats_client-x86_64.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.tsan-aarch64.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.tsan-x86_64.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.tsan_cxx-aarch64.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.tsan_cxx-x86_64.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.ubsan_minimal-aarch64.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.ubsan_minimal-arm.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.ubsan_minimal-armhf.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.ubsan_minimal-i386.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.ubsan_minimal-x86_64.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.ubsan_standalone-aarch64.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.ubsan_standalone-arm.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.ubsan_standalone-armhf.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.ubsan_standalone-i386.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.ubsan_standalone-x86_64.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.ubsan_standalone_cxx-aarch64.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.ubsan_standalone_cxx-arm.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.ubsan_standalone_cxx-armhf.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.ubsan_standalone_cxx-i386.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.ubsan_standalone_cxx-x86_64.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.xray-aarch64.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.xray-arm.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.xray-armhf.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.xray-basic-aarch64.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.xray-basic-arm.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.xray-basic-armhf.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.xray-basic-x86_64.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.xray-fdr-aarch64.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.xray-fdr-arm.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.xray-fdr-armhf.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.xray-fdr-x86_64.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.xray-profiling-aarch64.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.xray-profiling-arm.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.xray-profiling-armhf.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.xray-profiling-x86_64.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.xray-x86_64.a +OLD_DIRS+=usr/lib/clang/10.0.0/lib/freebsd +OLD_DIRS+=usr/lib/clang/10.0.0/lib +OLD_DIRS+=usr/lib/clang/10.0.0 + # 20200507: new clang import which bumps version from 9.0.1 to 10.0.0. OLD_FILES+=usr/lib/clang/9.0.1/include/cuda_wrappers/algorithm OLD_FILES+=usr/lib/clang/9.0.1/include/cuda_wrappers/complex @@ -3993,7 +4244,6 @@ OLD_FILES+=usr/include/clang/3.3/x86intrin.h OLD_FILES+=usr/include/clang/3.3/xmmintrin.h OLD_FILES+=usr/include/clang/3.3/xopintrin.h OLD_FILES+=usr/share/man/man1/llvm-prof.1.gz -OLD_FILES+=usr/share/man/man1/llvm-ranlib.1.gz OLD_DIRS+=usr/include/clang/3.3 # 20140216: nve(4) removed OLD_FILES+=usr/share/man/man4/if_nve.4.gz Modified: stable/11/UPDATING ============================================================================== --- stable/11/UPDATING Fri Jul 24 20:52:09 2020 (r363495) +++ stable/11/UPDATING Fri Jul 24 20:54:07 2020 (r363496) @@ -16,6 +16,12 @@ 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. +20200723: + Clang, llvm, lld, lldb, compiler-rt, libc++, libunwind and openmp have + been upgraded to 10.0.1. Please see the 20141231 entry below for + information about prerequisites and upgrading, if you are not already + using clang 3.5.0 or higher. + 20200507: Clang, llvm, lld, lldb, compiler-rt, libc++, libunwind and openmp have been upgraded to 10.0.0. Please see the 20141231 entry below for Modified: stable/11/contrib/llvm-project/FREEBSD-Xlist ============================================================================== --- stable/11/contrib/llvm-project/FREEBSD-Xlist Fri Jul 24 20:52:09 2020 (r363495) +++ stable/11/contrib/llvm-project/FREEBSD-Xlist Fri Jul 24 20:54:07 2020 (r363496) @@ -3,6 +3,7 @@ .clang-format .clang-tidy .git-blame-ignore-revs +.github/ .gitignore CONTRIBUTING.md README.md @@ -264,6 +265,7 @@ lldb/.clang-format lldb/.gitignore lldb/CMakeLists.txt lldb/CODE_OWNERS.txt +lldb/bindings/CMakeLists.txt lldb/cmake/ lldb/docs/.htaccess lldb/docs/CMakeLists.txt @@ -529,6 +531,7 @@ llvm/lib/ExecutionEngine/PerfJITEvents/CMakeLists.txt llvm/lib/ExecutionEngine/PerfJITEvents/LLVMBuild.txt llvm/lib/ExecutionEngine/RuntimeDyld/CMakeLists.txt llvm/lib/ExecutionEngine/RuntimeDyld/LLVMBuild.txt +llvm/lib/Extensions/ llvm/lib/Frontend/CMakeLists.txt llvm/lib/Frontend/LLVMBuild.txt llvm/lib/Frontend/OpenMP/CMakeLists.txt @@ -861,7 +864,8 @@ llvm/tools/llvm-dis/LLVMBuild.txt llvm/tools/llvm-dwarfdump/CMakeLists.txt llvm/tools/llvm-dwarfdump/LLVMBuild.txt llvm/tools/llvm-dwarfdump/fuzzer/ -llvm/tools/llvm-dwp/ +llvm/tools/llvm-dwp/CMakeLists.txt +llvm/tools/llvm-dwp/LLVMBuild.txt llvm/tools/llvm-elfabi/ llvm/tools/llvm-exegesis/ llvm/tools/llvm-extract/CMakeLists.txt @@ -908,12 +912,14 @@ llvm/tools/llvm-reduce/ llvm/tools/llvm-rtdyld/CMakeLists.txt llvm/tools/llvm-rtdyld/LLVMBuild.txt llvm/tools/llvm-shlib/ -llvm/tools/llvm-size/ +llvm/tools/llvm-size/CMakeLists.txt +llvm/tools/llvm-size/LLVMBuild.txt llvm/tools/llvm-special-case-list-fuzzer/ llvm/tools/llvm-split/ llvm/tools/llvm-stress/CMakeLists.txt llvm/tools/llvm-stress/LLVMBuild.txt -llvm/tools/llvm-strings/ +llvm/tools/llvm-strings/CMakeLists.txt +llvm/tools/llvm-strings/LLVMBuild.txt llvm/tools/llvm-symbolizer/CMakeLists.txt llvm/tools/llvm-undname/ llvm/tools/llvm-xray/CMakeLists.txt Modified: stable/11/contrib/llvm-project/clang/include/clang/AST/DeclBase.h ============================================================================== --- stable/11/contrib/llvm-project/clang/include/clang/AST/DeclBase.h Fri Jul 24 20:52:09 2020 (r363495) +++ stable/11/contrib/llvm-project/clang/include/clang/AST/DeclBase.h Fri Jul 24 20:54:07 2020 (r363496) @@ -856,14 +856,15 @@ class alignas(8) Decl { (public) return getParentFunctionOrMethod() == nullptr; } - /// Returns true if this declaration lexically is inside a function. - /// It recognizes non-defining declarations as well as members of local - /// classes: + /// Returns true if this declaration is lexically inside a function or inside + /// a variable initializer. It recognizes non-defining declarations as well + /// as members of local classes: /// \code /// void foo() { void bar(); } /// void foo2() { class ABC { void bar(); }; } + /// inline int x = [](){ return 0; }; /// \endcode - bool isLexicallyWithinFunctionOrMethod() const; + bool isInLocalScope() const; /// If this decl is defined inside a function/method/block it returns /// the corresponding DeclContext, otherwise it returns null. Modified: stable/11/contrib/llvm-project/clang/include/clang/Basic/Attr.td ============================================================================== --- stable/11/contrib/llvm-project/clang/include/clang/Basic/Attr.td Fri Jul 24 20:52:09 2020 (r363495) +++ stable/11/contrib/llvm-project/clang/include/clang/Basic/Attr.td Fri Jul 24 20:54:07 2020 (r363496) @@ -685,7 +685,7 @@ def XRayLogArgs : InheritableAttr { def PatchableFunctionEntry : InheritableAttr, - TargetSpecificAttr> { + TargetSpecificAttr> { let Spellings = [GCC<"patchable_function_entry">]; let Subjects = SubjectList<[Function, ObjCMethod]>; let Args = [UnsignedArgument<"Count">, DefaultIntArgument<"Offset", 0>]; Modified: stable/11/contrib/llvm-project/clang/include/clang/Driver/Options.td ============================================================================== --- stable/11/contrib/llvm-project/clang/include/clang/Driver/Options.td Fri Jul 24 20:52:09 2020 (r363495) +++ stable/11/contrib/llvm-project/clang/include/clang/Driver/Options.td Fri Jul 24 20:54:07 2020 (r363496) @@ -2267,6 +2267,14 @@ def mspeculative_load_hardening : Flag<["-"], "mspecul Group, Flags<[CoreOption,CC1Option]>; def mno_speculative_load_hardening : Flag<["-"], "mno-speculative-load-hardening">, Group, Flags<[CoreOption]>; +def mlvi_hardening : Flag<["-"], "mlvi-hardening">, Group, Flags<[CoreOption,DriverOption]>, + HelpText<"Enable all mitigations for Load Value Injection (LVI)">; +def mno_lvi_hardening : Flag<["-"], "mno-lvi-hardening">, Group, Flags<[CoreOption,DriverOption]>, + HelpText<"Disable mitigations for Load Value Injection (LVI)">; +def mlvi_cfi : Flag<["-"], "mlvi-cfi">, Group, Flags<[CoreOption,DriverOption]>, + HelpText<"Enable only control-flow mitigations for Load Value Injection (LVI)">; +def mno_lvi_cfi : Flag<["-"], "mno-lvi-cfi">, Group, Flags<[CoreOption,DriverOption]>, + HelpText<"Disable control-flow mitigations for Load Value Injection (LVI)">; def mrelax : Flag<["-"], "mrelax">, Group, HelpText<"Enable linker relaxation">; @@ -2439,6 +2447,12 @@ def mlongcall: Flag<["-"], "mlongcall">, Group; def mno_longcall : Flag<["-"], "mno-longcall">, Group; +def maix_struct_return : Flag<["-"], "maix-struct-return">, + Group, Flags<[CC1Option]>, + HelpText<"Return all structs in memory (PPC32 only)">; +def msvr4_struct_return : Flag<["-"], "msvr4-struct-return">, + Group, Flags<[CC1Option]>, + HelpText<"Return small structs in registers (PPC32 only)">; def mvx : Flag<["-"], "mvx">, Group; def mno_vx : Flag<["-"], "mno-vx">, Group; Modified: stable/11/contrib/llvm-project/clang/lib/AST/DeclBase.cpp ============================================================================== --- stable/11/contrib/llvm-project/clang/lib/AST/DeclBase.cpp Fri Jul 24 20:52:09 2020 (r363495) +++ stable/11/contrib/llvm-project/clang/lib/AST/DeclBase.cpp Fri Jul 24 20:54:07 2020 (r363496) @@ -332,13 +332,16 @@ void Decl::setDeclContextsImpl(DeclContext *SemaDC, De } } -bool Decl::isLexicallyWithinFunctionOrMethod() const { +bool Decl::isInLocalScope() const { const DeclContext *LDC = getLexicalDeclContext(); while (true) { if (LDC->isFunctionOrMethod()) return true; if (!isa(LDC)) return false; + if (const auto *CRD = dyn_cast(LDC)) + if (CRD->isLambda()) + return true; LDC = LDC->getLexicalParent(); } return false; Modified: stable/11/contrib/llvm-project/clang/lib/AST/ExprConstant.cpp ============================================================================== --- stable/11/contrib/llvm-project/clang/lib/AST/ExprConstant.cpp Fri Jul 24 20:52:09 2020 (r363495) +++ stable/11/contrib/llvm-project/clang/lib/AST/ExprConstant.cpp Fri Jul 24 20:54:07 2020 (r363496) @@ -8593,6 +8593,10 @@ bool PointerExprEvaluator::VisitBuiltinCallExpr(const static bool EvaluateArrayNewInitList(EvalInfo &Info, LValue &This, APValue &Result, const InitListExpr *ILE, QualType AllocType); +static bool EvaluateArrayNewConstructExpr(EvalInfo &Info, LValue &This, + APValue &Result, + const CXXConstructExpr *CCE, + QualType AllocType); bool PointerExprEvaluator::VisitCXXNewExpr(const CXXNewExpr *E) { if (!Info.getLangOpts().CPlusPlus2a) @@ -8642,6 +8646,7 @@ bool PointerExprEvaluator::VisitCXXNewExpr(const CXXNe const Expr *Init = E->getInitializer(); const InitListExpr *ResizedArrayILE = nullptr; + const CXXConstructExpr *ResizedArrayCCE = nullptr; QualType AllocType = E->getAllocatedType(); if (Optional ArraySize = E->getArraySize()) { @@ -8685,7 +8690,7 @@ bool PointerExprEvaluator::VisitCXXNewExpr(const CXXNe // -- the new-initializer is a braced-init-list and the number of // array elements for which initializers are provided [...] // exceeds the number of elements to initialize - if (Init) { + if (Init && !isa(Init)) { auto *CAT = Info.Ctx.getAsConstantArrayType(Init->getType()); assert(CAT && "unexpected type for array initializer"); @@ -8708,6 +8713,8 @@ bool PointerExprEvaluator::VisitCXXNewExpr(const CXXNe // special handling for this case when we initialize. if (InitBound != AllocBound) ResizedArrayILE = cast(Init); + } else if (Init) { + ResizedArrayCCE = cast(Init); } AllocType = Info.Ctx.getConstantArrayType(AllocType, ArrayBound, nullptr, @@ -8772,6 +8779,10 @@ bool PointerExprEvaluator::VisitCXXNewExpr(const CXXNe if (!EvaluateArrayNewInitList(Info, Result, *Val, ResizedArrayILE, AllocType)) return false; + } else if (ResizedArrayCCE) { + if (!EvaluateArrayNewConstructExpr(Info, Result, *Val, ResizedArrayCCE, + AllocType)) + return false; } else if (Init) { if (!EvaluateInPlace(*Val, Info, Result, Init)) return false; @@ -9595,6 +9606,16 @@ static bool EvaluateArrayNewInitList(EvalInfo &Info, L "not an array rvalue"); return ArrayExprEvaluator(Info, This, Result) .VisitInitListExpr(ILE, AllocType); +} + +static bool EvaluateArrayNewConstructExpr(EvalInfo &Info, LValue &This, + APValue &Result, + const CXXConstructExpr *CCE, + QualType AllocType) { + assert(CCE->isRValue() && CCE->getType()->isArrayType() && + "not an array rvalue"); + return ArrayExprEvaluator(Info, This, Result) + .VisitCXXConstructExpr(CCE, This, &Result, AllocType); } // Return true iff the given array filler may depend on the element index. Modified: stable/11/contrib/llvm-project/clang/lib/AST/RawCommentList.cpp ============================================================================== --- stable/11/contrib/llvm-project/clang/lib/AST/RawCommentList.cpp Fri Jul 24 20:52:09 2020 (r363495) +++ stable/11/contrib/llvm-project/clang/lib/AST/RawCommentList.cpp Fri Jul 24 20:54:07 2020 (r363496) @@ -430,7 +430,7 @@ std::string RawComment::getFormattedText(const SourceM }; auto DropTrailingNewLines = [](std::string &Str) { - while (Str.back() == '\n') + while (!Str.empty() && Str.back() == '\n') Str.pop_back(); }; Modified: stable/11/contrib/llvm-project/clang/lib/Basic/Targets/PPC.h ============================================================================== --- stable/11/contrib/llvm-project/clang/lib/Basic/Targets/PPC.h Fri Jul 24 20:52:09 2020 (r363495) +++ stable/11/contrib/llvm-project/clang/lib/Basic/Targets/PPC.h Fri Jul 24 20:54:07 2020 (r363496) @@ -276,11 +276,12 @@ class LLVM_LIBRARY_VISIBILITY PPCTargetInfo : public T break; case 'Q': // Memory operand that is an offset from a register (it is // usually better to use `m' or `es' in asm statements) + Info.setAllowsRegister(); + LLVM_FALLTHROUGH; case 'Z': // Memory operand that is an indexed or indirect from a // register (it is usually better to use `m' or `es' in // asm statements) Info.setAllowsMemory(); - Info.setAllowsRegister(); break; case 'R': // AIX TOC entry case 'a': // Address operand that is an indexed or indirect from a Modified: stable/11/contrib/llvm-project/clang/lib/CodeGen/CodeGenModule.cpp ============================================================================== --- stable/11/contrib/llvm-project/clang/lib/CodeGen/CodeGenModule.cpp Fri Jul 24 20:52:09 2020 (r363495) +++ stable/11/contrib/llvm-project/clang/lib/CodeGen/CodeGenModule.cpp Fri Jul 24 20:54:07 2020 (r363496) @@ -1847,9 +1847,16 @@ void CodeGenModule::SetFunctionAttributes(GlobalDecl G else if (const auto *SA = FD->getAttr()) F->setSection(SA->getName()); + // If we plan on emitting this inline builtin, we can't treat it as a builtin. if (FD->isInlineBuiltinDeclaration()) { - F->addAttribute(llvm::AttributeList::FunctionIndex, - llvm::Attribute::NoBuiltin); + const FunctionDecl *FDBody; + bool HasBody = FD->hasBody(FDBody); + (void)HasBody; + assert(HasBody && "Inline builtin declarations should always have an " + "available body!"); + if (shouldEmitFunction(FDBody)) + F->addAttribute(llvm::AttributeList::FunctionIndex, + llvm::Attribute::NoBuiltin); } if (FD->isReplaceableGlobalAllocationFunction()) { Modified: stable/11/contrib/llvm-project/clang/lib/CodeGen/TargetInfo.cpp ============================================================================== --- stable/11/contrib/llvm-project/clang/lib/CodeGen/TargetInfo.cpp Fri Jul 24 20:52:09 2020 (r363495) +++ stable/11/contrib/llvm-project/clang/lib/CodeGen/TargetInfo.cpp Fri Jul 24 20:54:07 2020 (r363496) @@ -4123,22 +4123,39 @@ namespace { /// PPC32_SVR4_ABIInfo - The 32-bit PowerPC ELF (SVR4) ABI information. class PPC32_SVR4_ABIInfo : public DefaultABIInfo { bool IsSoftFloatABI; + bool IsRetSmallStructInRegABI; CharUnits getParamTypeAlignment(QualType Ty) const; public: - PPC32_SVR4_ABIInfo(CodeGen::CodeGenTypes &CGT, bool SoftFloatABI) - : DefaultABIInfo(CGT), IsSoftFloatABI(SoftFloatABI) {} + PPC32_SVR4_ABIInfo(CodeGen::CodeGenTypes &CGT, bool SoftFloatABI, + bool RetSmallStructInRegABI) + : DefaultABIInfo(CGT), IsSoftFloatABI(SoftFloatABI), + IsRetSmallStructInRegABI(RetSmallStructInRegABI) {} + ABIArgInfo classifyReturnType(QualType RetTy) const; + + void computeInfo(CGFunctionInfo &FI) const override { + if (!getCXXABI().classifyReturnType(FI)) + FI.getReturnInfo() = classifyReturnType(FI.getReturnType()); + for (auto &I : FI.arguments()) + I.info = classifyArgumentType(I.type); + } + Address EmitVAArg(CodeGenFunction &CGF, Address VAListAddr, QualType Ty) const override; }; class PPC32TargetCodeGenInfo : public TargetCodeGenInfo { public: - PPC32TargetCodeGenInfo(CodeGenTypes &CGT, bool SoftFloatABI) - : TargetCodeGenInfo(new PPC32_SVR4_ABIInfo(CGT, SoftFloatABI)) {} + PPC32TargetCodeGenInfo(CodeGenTypes &CGT, bool SoftFloatABI, + bool RetSmallStructInRegABI) + : TargetCodeGenInfo(new PPC32_SVR4_ABIInfo(CGT, SoftFloatABI, + RetSmallStructInRegABI)) {} + static bool isStructReturnInRegABI(const llvm::Triple &Triple, + const CodeGenOptions &Opts); + int getDwarfEHStackPointer(CodeGen::CodeGenModule &M) const override { // This is recovered from gcc output. return 1; // r1 is the dedicated stack pointer @@ -4173,6 +4190,34 @@ CharUnits PPC32_SVR4_ABIInfo::getParamTypeAlignment(Qu return CharUnits::fromQuantity(4); } +ABIArgInfo PPC32_SVR4_ABIInfo::classifyReturnType(QualType RetTy) const { + uint64_t Size; + + // -msvr4-struct-return puts small aggregates in GPR3 and GPR4. + if (isAggregateTypeForABI(RetTy) && IsRetSmallStructInRegABI && + (Size = getContext().getTypeSize(RetTy)) <= 64) { + // System V ABI (1995), page 3-22, specified: + // > A structure or union whose size is less than or equal to 8 bytes + // > shall be returned in r3 and r4, as if it were first stored in the + // > 8-byte aligned memory area and then the low addressed word were + // > loaded into r3 and the high-addressed word into r4. Bits beyond + // > the last member of the structure or union are not defined. + // + // GCC for big-endian PPC32 inserts the pad before the first member, + // not "beyond the last member" of the struct. To stay compatible + // with GCC, we coerce the struct to an integer of the same size. + // LLVM will extend it and return i32 in r3, or i64 in r3:r4. + if (Size == 0) + return ABIArgInfo::getIgnore(); + else { + llvm::Type *CoerceTy = llvm::Type::getIntNTy(getVMContext(), Size); + return ABIArgInfo::getDirect(CoerceTy); + } + } + + return DefaultABIInfo::classifyReturnType(RetTy); +} + // TODO: this implementation is now likely redundant with // DefaultABIInfo::EmitVAArg. Address PPC32_SVR4_ABIInfo::EmitVAArg(CodeGenFunction &CGF, Address VAList, @@ -4328,6 +4373,25 @@ Address PPC32_SVR4_ABIInfo::EmitVAArg(CodeGenFunction return Result; } +bool PPC32TargetCodeGenInfo::isStructReturnInRegABI( + const llvm::Triple &Triple, const CodeGenOptions &Opts) { + assert(Triple.getArch() == llvm::Triple::ppc); + + switch (Opts.getStructReturnConvention()) { + case CodeGenOptions::SRCK_Default: + break; + case CodeGenOptions::SRCK_OnStack: // -maix-struct-return + return false; + case CodeGenOptions::SRCK_InRegs: // -msvr4-struct-return + return true; + } + + if (Triple.isOSBinFormatELF() && !Triple.isOSLinux()) + return true; + + return false; +} + bool PPC32TargetCodeGenInfo::initDwarfEHRegSizeTable(CodeGen::CodeGenFunction &CGF, llvm::Value *Address) const { @@ -9613,7 +9677,8 @@ ABIArgInfo RISCVABIInfo::classifyArgumentType(QualType uint64_t Size = getContext().getTypeSize(Ty); // Pass floating point values via FPRs if possible. - if (IsFixed && Ty->isFloatingType() && FLen >= Size && ArgFPRsLeft) { + if (IsFixed && Ty->isFloatingType() && !Ty->isComplexType() && + FLen >= Size && ArgFPRsLeft) { ArgFPRsLeft--; return ABIArgInfo::getDirect(); } @@ -9852,10 +9917,14 @@ const TargetCodeGenInfo &CodeGenModule::getTargetCodeG return SetCGInfo(new ARMTargetCodeGenInfo(Types, Kind)); } - case llvm::Triple::ppc: + case llvm::Triple::ppc: { + bool IsSoftFloat = + CodeGenOpts.FloatABI == "soft" || getTarget().hasFeature("spe"); + bool RetSmallStructInRegABI = + PPC32TargetCodeGenInfo::isStructReturnInRegABI(Triple, CodeGenOpts); return SetCGInfo( - new PPC32TargetCodeGenInfo(Types, CodeGenOpts.FloatABI == "soft" || - getTarget().hasFeature("spe"))); + new PPC32TargetCodeGenInfo(Types, IsSoftFloat, RetSmallStructInRegABI)); + } case llvm::Triple::ppc64: if (Triple.isOSBinFormatELF()) { PPC64_SVR4_ABIInfo::ABIKind Kind = PPC64_SVR4_ABIInfo::ELFv1; Modified: stable/11/contrib/llvm-project/clang/lib/Driver/SanitizerArgs.cpp ============================================================================== --- stable/11/contrib/llvm-project/clang/lib/Driver/SanitizerArgs.cpp Fri Jul 24 20:52:09 2020 (r363495) +++ stable/11/contrib/llvm-project/clang/lib/Driver/SanitizerArgs.cpp Fri Jul 24 20:54:07 2020 (r363496) @@ -454,8 +454,7 @@ SanitizerArgs::SanitizerArgs(const ToolChain &TC, << lastArgumentForMask(D, Args, Kinds & NeedsLTO) << "-flto"; } - if ((Kinds & SanitizerKind::ShadowCallStack) && - TC.getTriple().getArch() == llvm::Triple::aarch64 && + if ((Kinds & SanitizerKind::ShadowCallStack) && TC.getTriple().isAArch64() && !llvm::AArch64::isX18ReservedByDefault(TC.getTriple()) && !Args.hasArg(options::OPT_ffixed_x18)) { D.Diag(diag::err_drv_argument_only_allowed_with) Modified: stable/11/contrib/llvm-project/clang/lib/Driver/ToolChain.cpp ============================================================================== --- stable/11/contrib/llvm-project/clang/lib/Driver/ToolChain.cpp Fri Jul 24 20:52:09 2020 (r363495) +++ stable/11/contrib/llvm-project/clang/lib/Driver/ToolChain.cpp Fri Jul 24 20:54:07 2020 (r363496) @@ -954,15 +954,12 @@ SanitizerMask ToolChain::getSupportedSanitizers() cons if (getTriple().getArch() == llvm::Triple::x86 || getTriple().getArch() == llvm::Triple::x86_64 || getTriple().getArch() == llvm::Triple::arm || - getTriple().getArch() == llvm::Triple::aarch64 || getTriple().getArch() == llvm::Triple::wasm32 || - getTriple().getArch() == llvm::Triple::wasm64) + getTriple().getArch() == llvm::Triple::wasm64 || getTriple().isAArch64()) Res |= SanitizerKind::CFIICall; - if (getTriple().getArch() == llvm::Triple::x86_64 || - getTriple().getArch() == llvm::Triple::aarch64) + if (getTriple().getArch() == llvm::Triple::x86_64 || getTriple().isAArch64()) Res |= SanitizerKind::ShadowCallStack; - if (getTriple().getArch() == llvm::Triple::aarch64 || - getTriple().getArch() == llvm::Triple::aarch64_be) + if (getTriple().isAArch64()) Res |= SanitizerKind::MemTag; return Res; } Modified: stable/11/contrib/llvm-project/clang/lib/Driver/ToolChains/Arch/RISCV.cpp ============================================================================== --- stable/11/contrib/llvm-project/clang/lib/Driver/ToolChains/Arch/RISCV.cpp Fri Jul 24 20:52:09 2020 (r363495) +++ stable/11/contrib/llvm-project/clang/lib/Driver/ToolChains/Arch/RISCV.cpp Fri Jul 24 20:54:07 2020 (r363496) @@ -426,8 +426,9 @@ void riscv::getRISCVTargetFeatures(const Driver &D, co if (Args.hasArg(options::OPT_ffixed_x31)) Features.push_back("+reserve-x31"); - // -mrelax is default, unless -mno-relax is specified. - if (Args.hasFlag(options::OPT_mrelax, options::OPT_mno_relax, true)) + // FreeBSD local, because ld.lld doesn't support relaxations + // -mno-relax is default, unless -mrelax is specified. + if (Args.hasFlag(options::OPT_mrelax, options::OPT_mno_relax, false)) Features.push_back("+relax"); else Features.push_back("-relax"); Modified: stable/11/contrib/llvm-project/clang/lib/Driver/ToolChains/Arch/X86.cpp ============================================================================== --- stable/11/contrib/llvm-project/clang/lib/Driver/ToolChains/Arch/X86.cpp Fri Jul 24 20:52:09 2020 (r363495) +++ stable/11/contrib/llvm-project/clang/lib/Driver/ToolChains/Arch/X86.cpp Fri Jul 24 20:54:07 2020 (r363496) @@ -147,6 +147,7 @@ void x86::getX86TargetFeatures(const Driver &D, const // flags). This is a bit hacky but keeps existing usages working. We should // consider deprecating this and instead warn if the user requests external // retpoline thunks and *doesn't* request some form of retpolines. + auto SpectreOpt = clang::driver::options::ID::OPT_INVALID; if (Args.hasArgNoClaim(options::OPT_mretpoline, options::OPT_mno_retpoline, options::OPT_mspeculative_load_hardening, options::OPT_mno_speculative_load_hardening)) { @@ -154,12 +155,14 @@ void x86::getX86TargetFeatures(const Driver &D, const false)) { Features.push_back("+retpoline-indirect-calls"); Features.push_back("+retpoline-indirect-branches"); + SpectreOpt = options::OPT_mretpoline; } else if (Args.hasFlag(options::OPT_mspeculative_load_hardening, options::OPT_mno_speculative_load_hardening, false)) { // On x86, speculative load hardening relies on at least using retpolines // for indirect calls. Features.push_back("+retpoline-indirect-calls"); + SpectreOpt = options::OPT_mspeculative_load_hardening; } } else if (Args.hasFlag(options::OPT_mretpoline_external_thunk, options::OPT_mno_retpoline_external_thunk, false)) { @@ -167,6 +170,26 @@ void x86::getX86TargetFeatures(const Driver &D, const // eventually switch to an error here. Features.push_back("+retpoline-indirect-calls"); Features.push_back("+retpoline-indirect-branches"); + SpectreOpt = options::OPT_mretpoline_external_thunk; + } + + auto LVIOpt = clang::driver::options::ID::OPT_INVALID; + if (Args.hasFlag(options::OPT_mlvi_hardening, options::OPT_mno_lvi_hardening, + false)) { + Features.push_back("+lvi-load-hardening"); + Features.push_back("+lvi-cfi"); // load hardening implies CFI protection + LVIOpt = options::OPT_mlvi_hardening; + } else if (Args.hasFlag(options::OPT_mlvi_cfi, options::OPT_mno_lvi_cfi, + false)) { + Features.push_back("+lvi-cfi"); + LVIOpt = options::OPT_mlvi_cfi; + } + + if (SpectreOpt != clang::driver::options::ID::OPT_INVALID && + LVIOpt != clang::driver::options::ID::OPT_INVALID) { + D.Diag(diag::err_drv_argument_not_allowed_with) + << D.getOpts().getOptionName(SpectreOpt) + << D.getOpts().getOptionName(LVIOpt); } // Now add any that the user explicitly requested on the command line, Modified: stable/11/contrib/llvm-project/clang/lib/Driver/ToolChains/Clang.cpp ============================================================================== --- stable/11/contrib/llvm-project/clang/lib/Driver/ToolChains/Clang.cpp Fri Jul 24 20:52:09 2020 (r363495) +++ stable/11/contrib/llvm-project/clang/lib/Driver/ToolChains/Clang.cpp Fri Jul 24 20:54:07 2020 (r363496) @@ -4421,6 +4421,19 @@ void Clang::ConstructJob(Compilation &C, const JobActi CmdArgs.push_back(A->getValue()); } + if (Arg *A = Args.getLastArg(options::OPT_maix_struct_return, + options::OPT_msvr4_struct_return)) { + if (TC.getArch() != llvm::Triple::ppc) { + D.Diag(diag::err_drv_unsupported_opt_for_target) + << A->getSpelling() << RawTriple.str(); + } else if (A->getOption().matches(options::OPT_maix_struct_return)) { + CmdArgs.push_back("-maix-struct-return"); + } else { + assert(A->getOption().matches(options::OPT_msvr4_struct_return)); + CmdArgs.push_back("-msvr4-struct-return"); + } + } + if (Arg *A = Args.getLastArg(options::OPT_fpcc_struct_return, options::OPT_freg_struct_return)) { if (TC.getArch() != llvm::Triple::x86) { Modified: stable/11/contrib/llvm-project/clang/lib/Driver/ToolChains/Darwin.cpp ============================================================================== --- stable/11/contrib/llvm-project/clang/lib/Driver/ToolChains/Darwin.cpp Fri Jul 24 20:52:09 2020 (r363495) +++ stable/11/contrib/llvm-project/clang/lib/Driver/ToolChains/Darwin.cpp Fri Jul 24 20:54:07 2020 (r363496) @@ -1146,6 +1146,7 @@ void Darwin::addProfileRTLibs(const ArgList &Args, addExportedSymbol(CmdArgs, "___gcov_flush"); addExportedSymbol(CmdArgs, "_flush_fn_list"); addExportedSymbol(CmdArgs, "_writeout_fn_list"); + addExportedSymbol(CmdArgs, "_reset_fn_list"); } else { addExportedSymbol(CmdArgs, "___llvm_profile_filename"); addExportedSymbol(CmdArgs, "___llvm_profile_raw_version"); Modified: stable/11/contrib/llvm-project/clang/lib/Driver/ToolChains/Gnu.cpp ============================================================================== --- stable/11/contrib/llvm-project/clang/lib/Driver/ToolChains/Gnu.cpp Fri Jul 24 20:52:09 2020 (r363495) +++ stable/11/contrib/llvm-project/clang/lib/Driver/ToolChains/Gnu.cpp Fri Jul 24 20:54:07 2020 (r363496) @@ -309,7 +309,7 @@ static const char *getLDMOption(const llvm::Triple &T, } } -static bool getPIE(const ArgList &Args, const toolchains::Linux &ToolChain) { +static bool getPIE(const ArgList &Args, const ToolChain &TC) { if (Args.hasArg(options::OPT_shared) || Args.hasArg(options::OPT_static) || Args.hasArg(options::OPT_r) || Args.hasArg(options::OPT_static_pie)) return false; @@ -317,17 +317,16 @@ static bool getPIE(const ArgList &Args, const toolchai Arg *A = Args.getLastArg(options::OPT_pie, options::OPT_no_pie, options::OPT_nopie); if (!A) - return ToolChain.isPIEDefault(); + return TC.isPIEDefault(); return A->getOption().matches(options::OPT_pie); } -static bool getStaticPIE(const ArgList &Args, - const toolchains::Linux &ToolChain) { +static bool getStaticPIE(const ArgList &Args, const ToolChain &TC) { bool HasStaticPIE = Args.hasArg(options::OPT_static_pie); // -no-pie is an alias for -nopie. So, handling -nopie takes care of // -no-pie as well. if (HasStaticPIE && Args.hasArg(options::OPT_nopie)) { - const Driver &D = ToolChain.getDriver(); + const Driver &D = TC.getDriver(); const llvm::opt::OptTable &Opts = D.getOpts(); const char *StaticPIEName = Opts.getOptionName(options::OPT_static_pie); const char *NoPIEName = Opts.getOptionName(options::OPT_nopie); @@ -346,8 +345,12 @@ void tools::gnutools::Linker::ConstructJob(Compilation const InputInfoList &Inputs, const ArgList &Args, const char *LinkingOutput) const { - const toolchains::Linux &ToolChain = - static_cast(getToolChain()); + // FIXME: The Linker class constructor takes a ToolChain and not a + // Generic_ELF, so the static_cast might return a reference to a invalid + // instance (see PR45061). Ideally, the Linker constructor needs to take a + // Generic_ELF instead. + const toolchains::Generic_ELF &ToolChain = + static_cast(getToolChain()); const Driver &D = ToolChain.getDriver(); const llvm::Triple &Triple = getToolChain().getEffectiveTriple(); @@ -418,8 +421,7 @@ void tools::gnutools::Linker::ConstructJob(Compilation if (isAndroid) CmdArgs.push_back("--warn-shared-textrel"); - for (const auto &Opt : ToolChain.ExtraOpts) - CmdArgs.push_back(Opt.c_str()); + ToolChain.addExtraOpts(CmdArgs); CmdArgs.push_back("--eh-frame-hdr"); Modified: stable/11/contrib/llvm-project/clang/lib/Driver/ToolChains/Gnu.h ============================================================================== --- stable/11/contrib/llvm-project/clang/lib/Driver/ToolChains/Gnu.h Fri Jul 24 20:52:09 2020 (r363495) +++ stable/11/contrib/llvm-project/clang/lib/Driver/ToolChains/Gnu.h Fri Jul 24 20:54:07 2020 (r363496) @@ -356,6 +356,12 @@ class LLVM_LIBRARY_VISIBILITY Generic_ELF : public Gen void addClangTargetOptions(const llvm::opt::ArgList &DriverArgs, llvm::opt::ArgStringList &CC1Args, Action::OffloadKind DeviceOffloadKind) const override; + + virtual std::string getDynamicLinker(const llvm::opt::ArgList &Args) const { + return {}; + } + + virtual void addExtraOpts(llvm::opt::ArgStringList &CmdArgs) const {} }; } // end namespace toolchains Modified: stable/11/contrib/llvm-project/clang/lib/Driver/ToolChains/Hurd.cpp ============================================================================== --- stable/11/contrib/llvm-project/clang/lib/Driver/ToolChains/Hurd.cpp Fri Jul 24 20:52:09 2020 (r363495) +++ stable/11/contrib/llvm-project/clang/lib/Driver/ToolChains/Hurd.cpp Fri Jul 24 20:54:07 2020 (r363496) @@ -61,8 +61,7 @@ static StringRef getOSLibDir(const llvm::Triple &Tripl return Triple.isArch32Bit() ? "lib" : "lib64"; } -Hurd::Hurd(const Driver &D, const llvm::Triple &Triple, - const ArgList &Args) +Hurd::Hurd(const Driver &D, const llvm::Triple &Triple, const ArgList &Args) : Generic_ELF(D, Triple, Args) { std::string SysRoot = computeSysRoot(); path_list &Paths = getFilePaths(); @@ -169,4 +168,9 @@ void Hurd::AddClangSystemIncludeArgs(const ArgList &Dr addExternCSystemInclude(DriverArgs, CC1Args, SysRoot + "/include"); addExternCSystemInclude(DriverArgs, CC1Args, SysRoot + "/usr/include"); +} + +void Hurd::addExtraOpts(llvm::opt::ArgStringList &CmdArgs) const { + for (const auto &Opt : ExtraOpts) + CmdArgs.push_back(Opt.c_str()); } Modified: stable/11/contrib/llvm-project/clang/lib/Driver/ToolChains/Hurd.h ============================================================================== --- stable/11/contrib/llvm-project/clang/lib/Driver/ToolChains/Hurd.h Fri Jul 24 20:52:09 2020 (r363495) +++ stable/11/contrib/llvm-project/clang/lib/Driver/ToolChains/Hurd.h Fri Jul 24 20:54:07 2020 (r363496) @@ -27,9 +27,11 @@ class LLVM_LIBRARY_VISIBILITY Hurd : public Generic_EL AddClangSystemIncludeArgs(const llvm::opt::ArgList &DriverArgs, llvm::opt::ArgStringList &CC1Args) const override; - virtual std::string computeSysRoot() const; + std::string computeSysRoot() const; - virtual std::string getDynamicLinker(const llvm::opt::ArgList &Args) const; + std::string getDynamicLinker(const llvm::opt::ArgList &Args) const override; + + void addExtraOpts(llvm::opt::ArgStringList &CmdArgs) const override; std::vector ExtraOpts; Modified: stable/11/contrib/llvm-project/clang/lib/Driver/ToolChains/Linux.cpp ============================================================================== --- stable/11/contrib/llvm-project/clang/lib/Driver/ToolChains/Linux.cpp Fri Jul 24 20:52:09 2020 (r363495) +++ stable/11/contrib/llvm-project/clang/lib/Driver/ToolChains/Linux.cpp Fri Jul 24 20:54:07 2020 (r363496) @@ -986,3 +986,8 @@ void Linux::addProfileRTLibs(const llvm::opt::ArgList Twine("-u", llvm::getInstrProfRuntimeHookVarName()))); ToolChain::addProfileRTLibs(Args, CmdArgs); } + +void Linux::addExtraOpts(llvm::opt::ArgStringList &CmdArgs) const { + for (const auto &Opt : ExtraOpts) + CmdArgs.push_back(Opt.c_str()); +} Modified: stable/11/contrib/llvm-project/clang/lib/Driver/ToolChains/Linux.h ============================================================================== --- stable/11/contrib/llvm-project/clang/lib/Driver/ToolChains/Linux.h Fri Jul 24 20:52:09 2020 (r363495) +++ stable/11/contrib/llvm-project/clang/lib/Driver/ToolChains/Linux.h Fri Jul 24 20:54:07 2020 (r363496) @@ -42,7 +42,9 @@ class LLVM_LIBRARY_VISIBILITY Linux : public Generic_E llvm::opt::ArgStringList &CmdArgs) const override; virtual std::string computeSysRoot() const; - virtual std::string getDynamicLinker(const llvm::opt::ArgList &Args) const; + std::string getDynamicLinker(const llvm::opt::ArgList &Args) const override; + + void addExtraOpts(llvm::opt::ArgStringList &CmdArgs) const override; std::vector ExtraOpts; Modified: stable/11/contrib/llvm-project/clang/lib/Format/TokenAnnotator.cpp ============================================================================== --- stable/11/contrib/llvm-project/clang/lib/Format/TokenAnnotator.cpp Fri Jul 24 20:52:09 2020 (r363495) +++ stable/11/contrib/llvm-project/clang/lib/Format/TokenAnnotator.cpp Fri Jul 24 20:54:07 2020 (r363496) @@ -2176,6 +2176,10 @@ static bool isFunctionDeclarationName(const FormatToke Next = Next->Next; continue; } + if (Next->is(TT_TemplateOpener) && Next->MatchingParen) { + Next = Next->MatchingParen; + continue; + } break; } @@ -2705,20 +2709,40 @@ bool TokenAnnotator::spaceRequiredBetween(const Annota tok::l_square)); if (Right.is(tok::star) && Left.is(tok::l_paren)) return false; - if (Right.isOneOf(tok::star, tok::amp, tok::ampamp) && - (Left.is(tok::identifier) || Left.isSimpleTypeSpecifier()) && - // Space between the type and the * in: - // operator void*() - // operator char*() - // operator /*comment*/ const char*() - // operator volatile /*comment*/ char*() - // operator Foo*() - // dependent on PointerAlignment style. - Left.Previous && - (Left.Previous->endsSequence(tok::kw_operator) || - Left.Previous->endsSequence(tok::kw_const, tok::kw_operator) || - Left.Previous->endsSequence(tok::kw_volatile, tok::kw_operator))) - return (Style.PointerAlignment != FormatStyle::PAS_Left); + if (Right.is(tok::star) && Left.is(tok::star)) + return false; + if (Right.isOneOf(tok::star, tok::amp, tok::ampamp)) { + const FormatToken *Previous = &Left; + while (Previous && !Previous->is(tok::kw_operator)) { + if (Previous->is(tok::identifier) || Previous->isSimpleTypeSpecifier()) { *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Fri Jul 24 21:05:18 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id EC8D2374242; Fri, 24 Jul 2020 21:05:18 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BD1tk5zvFz4HhQ; Fri, 24 Jul 2020 21:05:18 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mx1.sbone.de (cross.sbone.de [195.201.62.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mx1.sbone.de", Issuer "SBone.DE" (not verified)) (Authenticated sender: bz/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 97BFC29346; Fri, 24 Jul 2020 21:05:18 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mail.sbone.de (mail.sbone.de [IPv6:fde9:577b:c1a9:31::2013:587]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.sbone.de (Postfix) with ESMTPS id 131118D4A161; Fri, 24 Jul 2020 21:05:17 +0000 (UTC) Received: from content-filter.sbone.de (content-filter.sbone.de [IPv6:fde9:577b:c1a9:31::2013:2742]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPS id 7591AE707B2; Fri, 24 Jul 2020 21:05:16 +0000 (UTC) X-Virus-Scanned: amavisd-new at sbone.de Received: from mail.sbone.de ([IPv6:fde9:577b:c1a9:31::2013:587]) by content-filter.sbone.de (content-filter.sbone.de [fde9:577b:c1a9:31::2013:2742]) (amavisd-new, port 10024) with ESMTP id Ry5k20ncIVdJ; Fri, 24 Jul 2020 21:05:15 +0000 (UTC) Received: from [127.0.0.1] (unknown [IPv6:fde9:577b:c1a9:4902:1d87:f7f2:9fc6:8b4]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPSA id 32943E707B0; Fri, 24 Jul 2020 21:05:15 +0000 (UTC) From: "Bjoern A. Zeeb" To: "Emmanuel Vadot" Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r363489 - head/sys/dev/mmc/host Date: Fri, 24 Jul 2020 21:05:14 +0000 X-Mailer: MailMate (2.0BETAr6146) Message-ID: <9F813757-E66A-449D-9571-570669A3C891@FreeBSD.org> In-Reply-To: <202007241952.06OJqrIZ080972@repo.freebsd.org> References: <202007241952.06OJqrIZ080972@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 24 Jul 2020 21:05:19 -0000 On 24 Jul 2020, at 19:52, Emmanuel Vadot wrote: > Author: manu > Date: Fri Jul 24 19:52:52 2020 > New Revision: 363489 > URL: https://svnweb.freebsd.org/changeset/base/363489 > > Log: > dwmmc: Add MMCCAM part > > Add support for MMCCAM for dwmmc > > Submitted by: kibab > Tested On: Rock64, RockPro64 And nanopc-t4. Thank you both for all the work!!! From owner-svn-src-all@freebsd.org Fri Jul 24 21:14:59 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DC55F3746CF; Fri, 24 Jul 2020 21:14:59 +0000 (UTC) (envelope-from kibab@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BD25v5KB9z4JBX; Fri, 24 Jul 2020 21:14:59 +0000 (UTC) (envelope-from kibab@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 959FA10C1A; Fri, 24 Jul 2020 21:14:59 +0000 (UTC) (envelope-from kibab@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06OLExnG032706; Fri, 24 Jul 2020 21:14:59 GMT (envelope-from kibab@FreeBSD.org) Received: (from kibab@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06OLExIJ032705; Fri, 24 Jul 2020 21:14:59 GMT (envelope-from kibab@FreeBSD.org) Message-Id: <202007242114.06OLExIJ032705@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kibab set sender to kibab@FreeBSD.org using -f From: Ilya Bakulin Date: Fri, 24 Jul 2020 21:14:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363497 - head/sbin/camcontrol X-SVN-Group: head X-SVN-Commit-Author: kibab X-SVN-Commit-Paths: head/sbin/camcontrol X-SVN-Commit-Revision: 363497 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 24 Jul 2020 21:14:59 -0000 Author: kibab Date: Fri Jul 24 21:14:59 2020 New Revision: 363497 URL: https://svnweb.freebsd.org/changeset/base/363497 Log: Make it possible to get/set MMC frequency from camcontrol Enhance camcontrol(8) so that it's possible to manually set frequency for SD/MMC cards. While here, display more information about the current controller, such as supported operating modes and VCCQ voltages, as well as current VCCQ voltage. Reviewed by: manu Approved by: imp (mentor) Differential Revision: https://reviews.freebsd.org/D25795 Modified: head/sbin/camcontrol/camcontrol.c Modified: head/sbin/camcontrol/camcontrol.c ============================================================================== --- head/sbin/camcontrol/camcontrol.c Fri Jul 24 20:54:07 2020 (r363496) +++ head/sbin/camcontrol/camcontrol.c Fri Jul 24 21:14:59 2020 (r363497) @@ -190,7 +190,7 @@ static struct camcontrol_opts option_table[] = { {"rescan", CAM_CMD_RESCAN, CAM_ARG_NONE, NULL}, {"reset", CAM_CMD_RESET, CAM_ARG_NONE, NULL}, {"cmd", CAM_CMD_SCSI_CMD, CAM_ARG_NONE, scsicmd_opts}, - {"mmcsdcmd", CAM_CMD_MMCSD_CMD, CAM_ARG_NONE, "c:a:f:Wb:l:41S:I"}, + {"mmcsdcmd", CAM_CMD_MMCSD_CMD, CAM_ARG_NONE, "c:a:F:f:Wb:l:41S:I"}, {"command", CAM_CMD_SCSI_CMD, CAM_ARG_NONE, scsicmd_opts}, {"smpcmd", CAM_CMD_SMP_CMD, CAM_ARG_NONE, "r:R:"}, {"smprg", CAM_CMD_SMP_RG, CAM_ARG_NONE, smprg_opts}, @@ -7833,10 +7833,12 @@ mmcsdcmd(struct cam_device *device, int argc, char **a int retval; int is_write = 0; int is_bw_4 = 0, is_bw_1 = 0; + int is_frequency = 0; int is_highspeed = 0, is_stdspeed = 0; int is_info_request = 0; int flags = 0; uint8_t mmc_data_byte = 0; + uint32_t mmc_frequency = 0; /* For IO_RW_EXTENDED command */ uint8_t *mmc_data = NULL; @@ -7873,6 +7875,10 @@ mmcsdcmd(struct cam_device *device, int argc, char **a case 'I': is_info_request = 1; break; + case 'F': + is_frequency = 1; + mmc_frequency = strtol(optarg, NULL, 0); + break; case 'c': mmc_opcode = strtol(optarg, NULL, 0); if (mmc_opcode < 0) { @@ -7978,6 +7984,23 @@ mmcsdcmd(struct cam_device *device, int argc, char **a return (retval); } + if (is_frequency) { + struct ccb_trans_settings_mmc *cts; + ccb->ccb_h.func_code = XPT_SET_TRAN_SETTINGS; + ccb->ccb_h.flags = 0; + cts = &ccb->cts.proto_specific.mmc; + cts->ios.clock = mmc_frequency; + cts->ios_valid = MMC_CLK; + if (((retval = cam_send_ccb(device, ccb)) < 0) + || ((ccb->ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP)) { + warn("Error sending command"); + } else { + printf("Parameters set OK\n"); + } + cam_freeccb(ccb); + return (retval); + } + // Switch bus speed instead of sending IO command if (is_stdspeed || is_highspeed) { struct ccb_trans_settings_mmc *cts; @@ -8011,13 +8034,48 @@ mmcsdcmd(struct cam_device *device, int argc, char **a printf("Host OCR: 0x%x\n", cts->host_ocr); printf("Min frequency: %u KHz\n", cts->host_f_min / 1000); printf("Max frequency: %u MHz\n", cts->host_f_max / 1000000); - printf("Supported bus width: "); + printf("Supported bus width:\n"); if (cts->host_caps & MMC_CAP_4_BIT_DATA) printf(" 4 bit\n"); if (cts->host_caps & MMC_CAP_8_BIT_DATA) printf(" 8 bit\n"); - printf("\nCurrent settings:\n"); - printf("Bus width: "); + + printf("Supported operating modes:\n"); + if (cts->host_caps & MMC_CAP_HSPEED) + printf(" Can do High Speed transfers\n"); + if (cts->host_caps & MMC_CAP_UHS_SDR12) + printf(" Can do UHS SDR12\n"); + if (cts->host_caps & MMC_CAP_UHS_SDR25) + printf(" Can do UHS SDR25\n"); + if (cts->host_caps & MMC_CAP_UHS_SDR50) + printf(" Can do UHS SDR50\n"); + if (cts->host_caps & MMC_CAP_UHS_SDR104) + printf(" Can do UHS SDR104\n"); + if (cts->host_caps & MMC_CAP_UHS_DDR50) + printf(" Can do UHS DDR50\n"); + if (cts->host_caps & MMC_CAP_MMC_DDR52_120) + printf(" Can do eMMC DDR52 at 1.2V\n"); + if (cts->host_caps & MMC_CAP_MMC_DDR52_180) + printf(" Can do eMMC DDR52 at 1.8V\n"); + if (cts->host_caps & MMC_CAP_MMC_HS200_120) + printf(" Can do eMMC HS200 at 1.2V\n"); + if (cts->host_caps & MMC_CAP_MMC_HS200_180) + printf(" Can do eMMC HS200 at 1.8V\n"); + if (cts->host_caps & MMC_CAP_MMC_HS400_120) + printf(" Can do eMMC HS400 at 1.2V\n"); + if (cts->host_caps & MMC_CAP_MMC_HS400_180) + printf(" Can do eMMC HS400 at 1.8V\n"); + + printf("Supported VCCQ voltages:\n"); + if (cts->host_caps & MMC_CAP_SIGNALING_120) + printf(" 1.2V\n"); + if (cts->host_caps & MMC_CAP_SIGNALING_180) + printf(" 1.8V\n"); + if (cts->host_caps & MMC_CAP_SIGNALING_330) + printf(" 3.3V\n"); + + printf("Current settings:\n"); + printf(" Bus width: "); switch (cts->ios.bus_width) { case bus_width_1: printf("1 bit\n"); @@ -8029,10 +8087,23 @@ mmcsdcmd(struct cam_device *device, int argc, char **a printf("8 bit\n"); break; } - printf("Freq: %d.%03d MHz%s\n", + printf(" Freq: %d.%03d MHz%s\n", cts->ios.clock / 1000000, (cts->ios.clock / 1000) % 1000, - cts->ios.timing == bus_timing_hs ? "(high-speed timing)" : ""); + cts->ios.timing == bus_timing_hs ? " (high-speed timing)" : ""); + + printf(" VCCQ: "); + switch (cts->ios.vccq) { + case vccq_330: + printf("3.3V\n"); + break; + case vccq_180: + printf("1.8V\n"); + break; + case vccq_120: + printf("1.2V\n"); + break; + } return (0); } From owner-svn-src-all@freebsd.org Fri Jul 24 21:26:44 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 353E6374CCD; Fri, 24 Jul 2020 21:26:44 +0000 (UTC) (envelope-from gbe@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BD2MS07kHz4Jjs; Fri, 24 Jul 2020 21:26:44 +0000 (UTC) (envelope-from gbe@freebsd.org) Received: from localhost (p4fd3ae86.dip0.t-ipconnect.de [79.211.174.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: gbe) by smtp.freebsd.org (Postfix) with ESMTPSA id 7E4CF28FBA; Fri, 24 Jul 2020 21:26:43 +0000 (UTC) (envelope-from gbe@freebsd.org) Date: Fri, 24 Jul 2020 23:26:43 +0200 From: Gordon Bergling To: Ilya Bakulin Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r363497 - head/sbin/camcontrol Message-ID: <20200724212643.GA68779@lion.0xfce3.net> References: <202007242114.06OLExIJ032705@repo.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="8t9RHnE3ZwKMSgU+" Content-Disposition: inline In-Reply-To: <202007242114.06OLExIJ032705@repo.freebsd.org> X-Url: X-Operating-System: FreeBSD 12.1-STABLE amd64 X-Host-Uptime: 11:24PM up 9 days, 3:32, 5 users, load averages: 0.21, 0.18, 0.20 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 24 Jul 2020 21:26:44 -0000 --8t9RHnE3ZwKMSgU+ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Thanks, this will become very handy when working on IO infrastructure. --Gordon On Fri, Jul 24, 2020 at 09:14:59PM +0000, Ilya Bakulin wrote: > Author: kibab > Date: Fri Jul 24 21:14:59 2020 > New Revision: 363497 > URL: https://svnweb.freebsd.org/changeset/base/363497 >=20 > Log: > Make it possible to get/set MMC frequency from camcontrol > =20 > Enhance camcontrol(8) so that it's possible to manually set frequency f= or SD/MMC cards. > While here, display more information about the current controller, such= as > supported operating modes and VCCQ voltages, as well as current VCCQ vo= ltage. > =20 > Reviewed by: manu > Approved by: imp (mentor) > Differential Revision: https://reviews.freebsd.org/D25795 >=20 > Modified: > head/sbin/camcontrol/camcontrol.c >=20 > Modified: head/sbin/camcontrol/camcontrol.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sbin/camcontrol/camcontrol.c Fri Jul 24 20:54:07 2020 (r363496) > +++ head/sbin/camcontrol/camcontrol.c Fri Jul 24 21:14:59 2020 (r363497) > @@ -190,7 +190,7 @@ static struct camcontrol_opts option_table[] =3D { > {"rescan", CAM_CMD_RESCAN, CAM_ARG_NONE, NULL}, > {"reset", CAM_CMD_RESET, CAM_ARG_NONE, NULL}, > {"cmd", CAM_CMD_SCSI_CMD, CAM_ARG_NONE, scsicmd_opts}, > - {"mmcsdcmd", CAM_CMD_MMCSD_CMD, CAM_ARG_NONE, "c:a:f:Wb:l:41S:I"}, > + {"mmcsdcmd", CAM_CMD_MMCSD_CMD, CAM_ARG_NONE, "c:a:F:f:Wb:l:41S:I"}, > {"command", CAM_CMD_SCSI_CMD, CAM_ARG_NONE, scsicmd_opts}, > {"smpcmd", CAM_CMD_SMP_CMD, CAM_ARG_NONE, "r:R:"}, > {"smprg", CAM_CMD_SMP_RG, CAM_ARG_NONE, smprg_opts}, > @@ -7833,10 +7833,12 @@ mmcsdcmd(struct cam_device *device, int argc, cha= r **a > int retval; > int is_write =3D 0; > int is_bw_4 =3D 0, is_bw_1 =3D 0; > + int is_frequency =3D 0; > int is_highspeed =3D 0, is_stdspeed =3D 0; > int is_info_request =3D 0; > int flags =3D 0; > uint8_t mmc_data_byte =3D 0; > + uint32_t mmc_frequency =3D 0; > =20 > /* For IO_RW_EXTENDED command */ > uint8_t *mmc_data =3D NULL; > @@ -7873,6 +7875,10 @@ mmcsdcmd(struct cam_device *device, int argc, char= **a > case 'I': > is_info_request =3D 1; > break; > + case 'F': > + is_frequency =3D 1; > + mmc_frequency =3D strtol(optarg, NULL, 0); > + break; > case 'c': > mmc_opcode =3D strtol(optarg, NULL, 0); > if (mmc_opcode < 0) { > @@ -7978,6 +7984,23 @@ mmcsdcmd(struct cam_device *device, int argc, char= **a > return (retval); > } > =20 > + if (is_frequency) { > + struct ccb_trans_settings_mmc *cts; > + ccb->ccb_h.func_code =3D XPT_SET_TRAN_SETTINGS; > + ccb->ccb_h.flags =3D 0; > + cts =3D &ccb->cts.proto_specific.mmc; > + cts->ios.clock =3D mmc_frequency; > + cts->ios_valid =3D MMC_CLK; > + if (((retval =3D cam_send_ccb(device, ccb)) < 0) > + || ((ccb->ccb_h.status & CAM_STATUS_MASK) !=3D CAM_REQ_CMP)) { > + warn("Error sending command"); > + } else { > + printf("Parameters set OK\n"); > + } > + cam_freeccb(ccb); > + return (retval); > + } > + > // Switch bus speed instead of sending IO command > if (is_stdspeed || is_highspeed) { > struct ccb_trans_settings_mmc *cts; > @@ -8011,13 +8034,48 @@ mmcsdcmd(struct cam_device *device, int argc, cha= r **a > printf("Host OCR: 0x%x\n", cts->host_ocr); > printf("Min frequency: %u KHz\n", cts->host_f_min / 1000); > printf("Max frequency: %u MHz\n", cts->host_f_max / 1000000); > - printf("Supported bus width: "); > + printf("Supported bus width:\n"); > if (cts->host_caps & MMC_CAP_4_BIT_DATA) > printf(" 4 bit\n"); > if (cts->host_caps & MMC_CAP_8_BIT_DATA) > printf(" 8 bit\n"); > - printf("\nCurrent settings:\n"); > - printf("Bus width: "); > + > + printf("Supported operating modes:\n"); > + if (cts->host_caps & MMC_CAP_HSPEED) > + printf(" Can do High Speed transfers\n"); > + if (cts->host_caps & MMC_CAP_UHS_SDR12) > + printf(" Can do UHS SDR12\n"); > + if (cts->host_caps & MMC_CAP_UHS_SDR25) > + printf(" Can do UHS SDR25\n"); > + if (cts->host_caps & MMC_CAP_UHS_SDR50) > + printf(" Can do UHS SDR50\n"); > + if (cts->host_caps & MMC_CAP_UHS_SDR104) > + printf(" Can do UHS SDR104\n"); > + if (cts->host_caps & MMC_CAP_UHS_DDR50) > + printf(" Can do UHS DDR50\n"); > + if (cts->host_caps & MMC_CAP_MMC_DDR52_120) > + printf(" Can do eMMC DDR52 at 1.2V\n"); > + if (cts->host_caps & MMC_CAP_MMC_DDR52_180) > + printf(" Can do eMMC DDR52 at 1.8V\n"); > + if (cts->host_caps & MMC_CAP_MMC_HS200_120) > + printf(" Can do eMMC HS200 at 1.2V\n"); > + if (cts->host_caps & MMC_CAP_MMC_HS200_180) > + printf(" Can do eMMC HS200 at 1.8V\n"); > + if (cts->host_caps & MMC_CAP_MMC_HS400_120) > + printf(" Can do eMMC HS400 at 1.2V\n"); > + if (cts->host_caps & MMC_CAP_MMC_HS400_180) > + printf(" Can do eMMC HS400 at 1.8V\n"); > + > + printf("Supported VCCQ voltages:\n"); > + if (cts->host_caps & MMC_CAP_SIGNALING_120) > + printf(" 1.2V\n"); > + if (cts->host_caps & MMC_CAP_SIGNALING_180) > + printf(" 1.8V\n"); > + if (cts->host_caps & MMC_CAP_SIGNALING_330) > + printf(" 3.3V\n"); > + > + printf("Current settings:\n"); > + printf(" Bus width: "); > switch (cts->ios.bus_width) { > case bus_width_1: > printf("1 bit\n"); > @@ -8029,10 +8087,23 @@ mmcsdcmd(struct cam_device *device, int argc, cha= r **a > printf("8 bit\n"); > break; > } > - printf("Freq: %d.%03d MHz%s\n", > + printf(" Freq: %d.%03d MHz%s\n", > cts->ios.clock / 1000000, > (cts->ios.clock / 1000) % 1000, > - cts->ios.timing =3D=3D bus_timing_hs ? "(high-speed timing)" : = ""); > + cts->ios.timing =3D=3D bus_timing_hs ? " (high-speed timing)" := ""); > + > + printf(" VCCQ: "); > + switch (cts->ios.vccq) { > + case vccq_330: > + printf("3.3V\n"); > + break; > + case vccq_180: > + printf("1.8V\n"); > + break; > + case vccq_120: > + printf("1.2V\n"); > + break; > + } > return (0); > } > =20 > _______________________________________________ > 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" --8t9RHnE3ZwKMSgU+ Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQGTBAEBCgB9FiEEYbWI0KY5X7yH/Fy4OQX2V8rP09wFAl8bUhFfFIAAAAAALgAo aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldDYx QjU4OEQwQTYzOTVGQkM4N0ZDNUNCODM5MDVGNjU3Q0FDRkQzREMACgkQOQX2V8rP 09xREQf7Bd785gGsafHvLxLomLDLsljXnrbvILvS806SsC8Y0+x0pTo6gk2x2Dfp bjBXVJcTXtAlKUj3nd6Fd2preNx5D6MD/574ejpt6+wf/Fn4568lTSXCL0UjtjBb Ju4LpZw9LFdx5m8um7RWiTlQUlZRXWwGuFQH5mlssa3KcGB4bA4VCVWWYSBYIAGw GS81P8J1TZnlvPvk4jiWoF5TJedpvDw16v7PBHFDxMntoImgeRMWmSEjCIUPn9OR F0tzgTy93IbLpZBM7Y6oIB+phSfW0DYHLZ4xVSlTI8IRq4nOoUa6xHvhUdkUr9ER R2u6xuhmIcPN1x5BvvQMjoqoFEAYMg== =rD9G -----END PGP SIGNATURE----- --8t9RHnE3ZwKMSgU+-- From owner-svn-src-all@freebsd.org Fri Jul 24 23:15:44 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 11E2F37663D; Fri, 24 Jul 2020 23:15:44 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BD4nC6sCgz4PSr; Fri, 24 Jul 2020 23:15:43 +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 CE76E1258D; Fri, 24 Jul 2020 23:15:43 +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 06ONFhXm009360; Fri, 24 Jul 2020 23:15:43 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06ONFh3P009357; Fri, 24 Jul 2020 23:15:43 GMT (envelope-from np@FreeBSD.org) Message-Id: <202007242315.06ONFh3P009357@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Fri, 24 Jul 2020 23:15:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363498 - in head/sys/dev/cxgbe: common cudbg X-SVN-Group: head X-SVN-Commit-Author: np X-SVN-Commit-Paths: in head/sys/dev/cxgbe: common cudbg X-SVN-Commit-Revision: 363498 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 24 Jul 2020 23:15:44 -0000 Author: np Date: Fri Jul 24 23:15:42 2020 New Revision: 363498 URL: https://svnweb.freebsd.org/changeset/base/363498 Log: cxgbe(4): Some updates to the common code. Obtained from: Chelsio Communications MFC after: 1 week Sponsored by: Chelsio Communications Modified: head/sys/dev/cxgbe/common/common.h head/sys/dev/cxgbe/common/t4_hw.c head/sys/dev/cxgbe/common/t4_hw.h head/sys/dev/cxgbe/cudbg/cudbg_lib.c Modified: head/sys/dev/cxgbe/common/common.h ============================================================================== --- head/sys/dev/cxgbe/common/common.h Fri Jul 24 21:14:59 2020 (r363497) +++ head/sys/dev/cxgbe/common/common.h Fri Jul 24 23:15:42 2020 (r363498) @@ -299,6 +299,7 @@ struct chip_params { u16 vfcount; u32 sge_fl_db; u16 mps_tcam_size; + u16 rss_nentries; }; /* VF-only parameters. */ @@ -377,6 +378,7 @@ struct adapter_params { unsigned int hash_filter:1; unsigned int filter2_wr_support:1; unsigned int port_caps32:1; + unsigned int smac_add_support:1; unsigned int ofldq_wr_cred; unsigned int eo_wr_cred; @@ -783,8 +785,27 @@ int t4_set_rxmode(struct adapter *adap, unsigned int m int t4_alloc_mac_filt(struct adapter *adap, unsigned int mbox, unsigned int viid, bool free, unsigned int naddr, const u8 **addr, u16 *idx, u64 *hash, bool sleep_ok); +int t4_free_mac_filt(struct adapter *adap, unsigned int mbox, + unsigned int viid, unsigned int naddr, + const u8 **addr, bool sleep_ok); +int t4_free_encap_mac_filt(struct adapter *adap, unsigned int viid, + int idx, bool sleep_ok); +int t4_free_raw_mac_filt(struct adapter *adap, unsigned int viid, + const u8 *addr, const u8 *mask, unsigned int idx, + u8 lookup_type, u8 port_id, bool sleep_ok); +int t4_alloc_raw_mac_filt(struct adapter *adap, unsigned int viid, + const u8 *addr, const u8 *mask, unsigned int idx, + u8 lookup_type, u8 port_id, bool sleep_ok); +int t4_alloc_encap_mac_filt(struct adapter *adap, unsigned int viid, + const u8 *addr, const u8 *mask, unsigned int vni, + unsigned int vni_mask, u8 dip_hit, u8 lookup_type, + bool sleep_ok); int t4_change_mac(struct adapter *adap, unsigned int mbox, unsigned int viid, int idx, const u8 *addr, bool persist, uint16_t *smt_idx); +int t4_del_mac(struct adapter *adap, unsigned int mbox, unsigned int viid, + const u8 *addr, bool smac); +int t4_add_mac(struct adapter *adap, unsigned int mbox, unsigned int viid, + int idx, const u8 *addr, bool persist, u8 *smt_idx, bool smac); int t4_set_addr_hash(struct adapter *adap, unsigned int mbox, unsigned int viid, bool ucast, u64 vec, bool sleep_ok); int t4_enable_vi_params(struct adapter *adap, unsigned int mbox, @@ -797,6 +818,10 @@ int t4_mdio_rd(struct adapter *adap, unsigned int mbox unsigned int mmd, unsigned int reg, unsigned int *valp); int t4_mdio_wr(struct adapter *adap, unsigned int mbox, unsigned int phy_addr, unsigned int mmd, unsigned int reg, unsigned int val); +int t4_i2c_io(struct adapter *adap, unsigned int mbox, + int port, unsigned int devid, + unsigned int offset, unsigned int len, + u8 *buf, bool write); int t4_i2c_rd(struct adapter *adap, unsigned int mbox, int port, unsigned int devid, unsigned int offset, unsigned int len, @@ -821,7 +846,7 @@ int t4_sge_ctxt_rd(struct adapter *adap, unsigned int enum ctxt_type ctype, u32 *data); int t4_sge_ctxt_rd_bd(struct adapter *adap, unsigned int cid, enum ctxt_type ctype, u32 *data); -int t4_sge_ctxt_flush(struct adapter *adap, unsigned int mbox); +int t4_sge_ctxt_flush(struct adapter *adap, unsigned int mbox, int ctxt_type); const char *t4_link_down_rc_str(unsigned char link_down_rc); int t4_update_port_info(struct port_info *pi); int t4_handle_fw_rpl(struct adapter *adap, const __be64 *rpl); @@ -854,6 +879,10 @@ void t4_tp_tm_pio_read(struct adapter *adap, u32 *buff u32 start_index, bool sleep_ok); void t4_tp_mib_read(struct adapter *adap, u32 *buff, u32 nregs, u32 start_index, bool sleep_ok); +int t4_configure_ringbb(struct adapter *adap); +int t4_configure_add_smac(struct adapter *adap); +int t4_set_vlan_acl(struct adapter *adap, unsigned int mbox, unsigned int vf, + u16 vlan); static inline int t4vf_query_params(struct adapter *adapter, unsigned int nparams, const u32 *params, Modified: head/sys/dev/cxgbe/common/t4_hw.c ============================================================================== --- head/sys/dev/cxgbe/common/t4_hw.c Fri Jul 24 21:14:59 2020 (r363497) +++ head/sys/dev/cxgbe/common/t4_hw.c Fri Jul 24 23:15:42 2020 (r363498) @@ -1359,8 +1359,7 @@ void t4_get_regs(struct adapter *adap, u8 *buf, size_t 0x9608, 0x9638, 0x9640, 0x96f4, 0x9800, 0x9808, - 0x9820, 0x983c, - 0x9850, 0x9864, + 0x9810, 0x9864, 0x9c00, 0x9c6c, 0x9c80, 0x9cec, 0x9d00, 0x9d6c, @@ -1369,7 +1368,7 @@ void t4_get_regs(struct adapter *adap, u8 *buf, size_t 0x9e80, 0x9eec, 0x9f00, 0x9f6c, 0x9f80, 0xa020, - 0xd004, 0xd004, + 0xd000, 0xd004, 0xd010, 0xd03c, 0xdfc0, 0xdfe0, 0xe000, 0x1106c, @@ -1410,10 +1409,8 @@ void t4_get_regs(struct adapter *adap, u8 *buf, size_t 0x1a0b0, 0x1a0e4, 0x1a0ec, 0x1a0f8, 0x1a100, 0x1a108, - 0x1a114, 0x1a120, - 0x1a128, 0x1a130, - 0x1a138, 0x1a138, - 0x1a190, 0x1a1c4, + 0x1a114, 0x1a130, + 0x1a138, 0x1a1c4, 0x1a1fc, 0x1a1fc, 0x1e008, 0x1e00c, 0x1e040, 0x1e044, @@ -2084,7 +2081,7 @@ void t4_get_regs(struct adapter *adap, u8 *buf, size_t 0x1180, 0x1184, 0x1190, 0x1194, 0x11a0, 0x11a4, - 0x11b0, 0x11b4, + 0x11b0, 0x11c4, 0x11fc, 0x1274, 0x1280, 0x133c, 0x1800, 0x18fc, @@ -2140,7 +2137,7 @@ void t4_get_regs(struct adapter *adap, u8 *buf, size_t 0x7e4c, 0x7e78, 0x7e80, 0x7edc, 0x7ee8, 0x7efc, - 0x8dc0, 0x8de4, + 0x8dc0, 0x8de0, 0x8df8, 0x8e04, 0x8e10, 0x8e84, 0x8ea0, 0x8f88, @@ -2154,8 +2151,7 @@ void t4_get_regs(struct adapter *adap, u8 *buf, size_t 0x9640, 0x9704, 0x9710, 0x971c, 0x9800, 0x9808, - 0x9820, 0x983c, - 0x9850, 0x9864, + 0x9810, 0x9864, 0x9c00, 0x9c6c, 0x9c80, 0x9cec, 0x9d00, 0x9d6c, @@ -2164,7 +2160,7 @@ void t4_get_regs(struct adapter *adap, u8 *buf, size_t 0x9e80, 0x9eec, 0x9f00, 0x9f6c, 0x9f80, 0xa020, - 0xd004, 0xd03c, + 0xd000, 0xd03c, 0xd100, 0xd118, 0xd200, 0xd214, 0xd220, 0xd234, @@ -2198,7 +2194,6 @@ void t4_get_regs(struct adapter *adap, u8 *buf, size_t 0x191d0, 0x191e8, 0x19238, 0x19290, 0x192a4, 0x192b0, - 0x192bc, 0x192bc, 0x19348, 0x1934c, 0x193f8, 0x19418, 0x19420, 0x19428, @@ -2216,7 +2211,7 @@ void t4_get_regs(struct adapter *adap, u8 *buf, size_t 0x19d00, 0x19d28, 0x19d50, 0x19d78, 0x19d94, 0x19d98, - 0x19da0, 0x19dc8, + 0x19da0, 0x19de0, 0x19df0, 0x19e10, 0x19e50, 0x19e6c, 0x19ea0, 0x19ebc, @@ -2232,10 +2227,8 @@ void t4_get_regs(struct adapter *adap, u8 *buf, size_t 0x1a0b0, 0x1a0e4, 0x1a0ec, 0x1a0f8, 0x1a100, 0x1a108, - 0x1a114, 0x1a120, - 0x1a128, 0x1a130, - 0x1a138, 0x1a138, - 0x1a190, 0x1a1c4, + 0x1a114, 0x1a130, + 0x1a138, 0x1a1c4, 0x1a1fc, 0x1a1fc, 0x1e008, 0x1e00c, 0x1e040, 0x1e044, @@ -3357,7 +3350,7 @@ int t4_get_tp_version(struct adapter *adapter, u32 *ve * this in the Firmware Version Format since it's convenient. Return * 0 on success, -ENOENT if no Expansion ROM is present. */ -int t4_get_exprom_version(struct adapter *adap, u32 *vers) +int t4_get_exprom_version(struct adapter *adapter, u32 *vers) { struct exprom_header { unsigned char hdr_arr[16]; /* must start with 0x55aa */ @@ -3367,7 +3360,7 @@ int t4_get_exprom_version(struct adapter *adap, u32 *v sizeof(u32))]; int ret; - ret = t4_read_flash(adap, FLASH_EXP_ROM_START, + ret = t4_read_flash(adapter, FLASH_EXP_ROM_START, ARRAY_SIZE(exprom_header_buf), exprom_header_buf, 0); if (ret) @@ -5703,8 +5696,9 @@ int t4_read_rss(struct adapter *adapter, u16 *map) { u32 val; int i, ret; + int rss_nentries = adapter->chip_params->rss_nentries; - for (i = 0; i < RSS_NENTRIES / 2; ++i) { + for (i = 0; i < rss_nentries / 2; ++i) { ret = rd_rss_row(adapter, i, &val); if (ret) return ret; @@ -7374,14 +7368,16 @@ void t4_sge_decode_idma_state(struct adapter *adapter, * Issues a FW command through the given mailbox to flush the * SGE context cache. */ -int t4_sge_ctxt_flush(struct adapter *adap, unsigned int mbox) +int t4_sge_ctxt_flush(struct adapter *adap, unsigned int mbox, int ctxt_type) { int ret; u32 ldst_addrspace; struct fw_ldst_cmd c; memset(&c, 0, sizeof(c)); - ldst_addrspace = V_FW_LDST_CMD_ADDRSPACE(FW_LDST_ADDRSPC_SGE_EGRC); + ldst_addrspace = V_FW_LDST_CMD_ADDRSPACE(ctxt_type == CTXT_EGRESS ? + FW_LDST_ADDRSPC_SGE_EGRC : + FW_LDST_ADDRSPC_SGE_INGC); c.op_to_addrspace = cpu_to_be32(V_FW_CMD_OP(FW_LDST_CMD) | F_FW_CMD_REQUEST | F_FW_CMD_READ | ldst_addrspace); @@ -8035,6 +8031,111 @@ int t4_set_rxmode(struct adapter *adap, unsigned int m } /** + * t4_alloc_encap_mac_filt - Adds a mac entry in mps tcam with VNI support + * @adap: the adapter + * @viid: the VI id + * @mac: the MAC address + * @mask: the mask + * @vni: the VNI id for the tunnel protocol + * @vni_mask: mask for the VNI id + * @dip_hit: to enable DIP match for the MPS entry + * @lookup_type: MAC address for inner (1) or outer (0) header + * @sleep_ok: call is allowed to sleep + * + * Allocates an MPS entry with specified MAC address and VNI value. + * + * Returns a negative error number or the allocated index for this mac. + */ +int t4_alloc_encap_mac_filt(struct adapter *adap, unsigned int viid, + const u8 *addr, const u8 *mask, unsigned int vni, + unsigned int vni_mask, u8 dip_hit, u8 lookup_type, + bool sleep_ok) +{ + struct fw_vi_mac_cmd c; + struct fw_vi_mac_vni *p = c.u.exact_vni; + int ret = 0; + u32 val; + + memset(&c, 0, sizeof(c)); + c.op_to_viid = cpu_to_be32(V_FW_CMD_OP(FW_VI_MAC_CMD) | + F_FW_CMD_REQUEST | F_FW_CMD_WRITE | + V_FW_VI_MAC_CMD_VIID(viid)); + val = V_FW_CMD_LEN16(1) | + V_FW_VI_MAC_CMD_ENTRY_TYPE(FW_VI_MAC_TYPE_EXACTMAC_VNI); + c.freemacs_to_len16 = cpu_to_be32(val); + p->valid_to_idx = cpu_to_be16(F_FW_VI_MAC_CMD_VALID | + V_FW_VI_MAC_CMD_IDX(FW_VI_MAC_ADD_MAC)); + memcpy(p->macaddr, addr, sizeof(p->macaddr)); + memcpy(p->macaddr_mask, mask, sizeof(p->macaddr_mask)); + + p->lookup_type_to_vni = cpu_to_be32(V_FW_VI_MAC_CMD_VNI(vni) | + V_FW_VI_MAC_CMD_DIP_HIT(dip_hit) | + V_FW_VI_MAC_CMD_LOOKUP_TYPE(lookup_type)); + p->vni_mask_pkd = cpu_to_be32(V_FW_VI_MAC_CMD_VNI_MASK(vni_mask)); + + ret = t4_wr_mbox_meat(adap, adap->mbox, &c, sizeof(c), &c, sleep_ok); + if (ret == 0) + ret = G_FW_VI_MAC_CMD_IDX(be16_to_cpu(p->valid_to_idx)); + return ret; +} + +/** + * t4_alloc_raw_mac_filt - Adds a mac entry in mps tcam + * @adap: the adapter + * @viid: the VI id + * @mac: the MAC address + * @mask: the mask + * @idx: index at which to add this entry + * @port_id: the port index + * @lookup_type: MAC address for inner (1) or outer (0) header + * @sleep_ok: call is allowed to sleep + * + * Adds the mac entry at the specified index using raw mac interface. + * + * Returns a negative error number or the allocated index for this mac. + */ +int t4_alloc_raw_mac_filt(struct adapter *adap, unsigned int viid, + const u8 *addr, const u8 *mask, unsigned int idx, + u8 lookup_type, u8 port_id, bool sleep_ok) +{ + int ret = 0; + struct fw_vi_mac_cmd c; + struct fw_vi_mac_raw *p = &c.u.raw; + u32 val; + + memset(&c, 0, sizeof(c)); + c.op_to_viid = cpu_to_be32(V_FW_CMD_OP(FW_VI_MAC_CMD) | + F_FW_CMD_REQUEST | F_FW_CMD_WRITE | + V_FW_VI_MAC_CMD_VIID(viid)); + val = V_FW_CMD_LEN16(1) | + V_FW_VI_MAC_CMD_ENTRY_TYPE(FW_VI_MAC_TYPE_RAW); + c.freemacs_to_len16 = cpu_to_be32(val); + + /* Specify that this is an inner mac address */ + p->raw_idx_pkd = cpu_to_be32(V_FW_VI_MAC_CMD_RAW_IDX(idx)); + + /* Lookup Type. Outer header: 0, Inner header: 1 */ + p->data0_pkd = cpu_to_be32(V_DATALKPTYPE(lookup_type) | + V_DATAPORTNUM(port_id)); + /* Lookup mask and port mask */ + p->data0m_pkd = cpu_to_be64(V_DATALKPTYPE(M_DATALKPTYPE) | + V_DATAPORTNUM(M_DATAPORTNUM)); + + /* Copy the address and the mask */ + memcpy((u8 *)&p->data1[0] + 2, addr, ETHER_ADDR_LEN); + memcpy((u8 *)&p->data1m[0] + 2, mask, ETHER_ADDR_LEN); + + ret = t4_wr_mbox_meat(adap, adap->mbox, &c, sizeof(c), &c, sleep_ok); + if (ret == 0) { + ret = G_FW_VI_MAC_CMD_RAW_IDX(be32_to_cpu(p->raw_idx_pkd)); + if (ret != idx) + ret = -ENOMEM; + } + + return ret; +} + +/** * t4_alloc_mac_filt - allocates exact-match filters for MAC addresses * @adap: the adapter * @mbox: mailbox to use for the FW command @@ -8128,6 +8229,168 @@ int t4_alloc_mac_filt(struct adapter *adap, unsigned i } /** + * t4_free_encap_mac_filt - frees MPS entry at given index + * @adap: the adapter + * @viid: the VI id + * @idx: index of MPS entry to be freed + * @sleep_ok: call is allowed to sleep + * + * Frees the MPS entry at supplied index + * + * Returns a negative error number or zero on success + */ +int t4_free_encap_mac_filt(struct adapter *adap, unsigned int viid, + int idx, bool sleep_ok) +{ + struct fw_vi_mac_exact *p; + struct fw_vi_mac_cmd c; + u8 addr[] = {0,0,0,0,0,0}; + int ret = 0; + u32 exact; + + memset(&c, 0, sizeof(c)); + c.op_to_viid = cpu_to_be32(V_FW_CMD_OP(FW_VI_MAC_CMD) | + F_FW_CMD_REQUEST | + F_FW_CMD_WRITE | + V_FW_CMD_EXEC(0) | + V_FW_VI_MAC_CMD_VIID(viid)); + exact = V_FW_VI_MAC_CMD_ENTRY_TYPE(FW_VI_MAC_TYPE_EXACTMAC); + c.freemacs_to_len16 = cpu_to_be32(V_FW_VI_MAC_CMD_FREEMACS(0) | + exact | + V_FW_CMD_LEN16(1)); + p = c.u.exact; + p->valid_to_idx = cpu_to_be16(F_FW_VI_MAC_CMD_VALID | + V_FW_VI_MAC_CMD_IDX(idx)); + memcpy(p->macaddr, addr, sizeof(p->macaddr)); + + ret = t4_wr_mbox_meat(adap, adap->mbox, &c, sizeof(c), &c, sleep_ok); + return ret; +} + +/** + * t4_free_raw_mac_filt - Frees a raw mac entry in mps tcam + * @adap: the adapter + * @viid: the VI id + * @addr: the MAC address + * @mask: the mask + * @idx: index of the entry in mps tcam + * @lookup_type: MAC address for inner (1) or outer (0) header + * @port_id: the port index + * @sleep_ok: call is allowed to sleep + * + * Removes the mac entry at the specified index using raw mac interface. + * + * Returns a negative error number on failure. + */ +int t4_free_raw_mac_filt(struct adapter *adap, unsigned int viid, + const u8 *addr, const u8 *mask, unsigned int idx, + u8 lookup_type, u8 port_id, bool sleep_ok) +{ + struct fw_vi_mac_cmd c; + struct fw_vi_mac_raw *p = &c.u.raw; + u32 raw; + + memset(&c, 0, sizeof(c)); + c.op_to_viid = cpu_to_be32(V_FW_CMD_OP(FW_VI_MAC_CMD) | + F_FW_CMD_REQUEST | F_FW_CMD_WRITE | + V_FW_CMD_EXEC(0) | + V_FW_VI_MAC_CMD_VIID(viid)); + raw = V_FW_VI_MAC_CMD_ENTRY_TYPE(FW_VI_MAC_TYPE_RAW); + c.freemacs_to_len16 = cpu_to_be32(V_FW_VI_MAC_CMD_FREEMACS(0) | + raw | + V_FW_CMD_LEN16(1)); + + p->raw_idx_pkd = cpu_to_be32(V_FW_VI_MAC_CMD_RAW_IDX(idx) | + FW_VI_MAC_ID_BASED_FREE); + + /* Lookup Type. Outer header: 0, Inner header: 1 */ + p->data0_pkd = cpu_to_be32(V_DATALKPTYPE(lookup_type) | + V_DATAPORTNUM(port_id)); + /* Lookup mask and port mask */ + p->data0m_pkd = cpu_to_be64(V_DATALKPTYPE(M_DATALKPTYPE) | + V_DATAPORTNUM(M_DATAPORTNUM)); + + /* Copy the address and the mask */ + memcpy((u8 *)&p->data1[0] + 2, addr, ETHER_ADDR_LEN); + memcpy((u8 *)&p->data1m[0] + 2, mask, ETHER_ADDR_LEN); + + return t4_wr_mbox_meat(adap, adap->mbox, &c, sizeof(c), &c, sleep_ok); +} + +/** + * t4_free_mac_filt - frees exact-match filters of given MAC addresses + * @adap: the adapter + * @mbox: mailbox to use for the FW command + * @viid: the VI id + * @naddr: the number of MAC addresses to allocate filters for (up to 7) + * @addr: the MAC address(es) + * @sleep_ok: call is allowed to sleep + * + * Frees the exact-match filter for each of the supplied addresses + * + * Returns a negative error number or the number of filters freed. + */ +int t4_free_mac_filt(struct adapter *adap, unsigned int mbox, + unsigned int viid, unsigned int naddr, + const u8 **addr, bool sleep_ok) +{ + int offset, ret = 0; + struct fw_vi_mac_cmd c; + unsigned int nfilters = 0; + unsigned int max_naddr = adap->chip_params->mps_tcam_size; + unsigned int rem = naddr; + + if (naddr > max_naddr) + return -EINVAL; + + for (offset = 0; offset < (int)naddr ; /**/) { + unsigned int fw_naddr = (rem < ARRAY_SIZE(c.u.exact) + ? rem + : ARRAY_SIZE(c.u.exact)); + size_t len16 = DIV_ROUND_UP(offsetof(struct fw_vi_mac_cmd, + u.exact[fw_naddr]), 16); + struct fw_vi_mac_exact *p; + int i; + + memset(&c, 0, sizeof(c)); + c.op_to_viid = cpu_to_be32(V_FW_CMD_OP(FW_VI_MAC_CMD) | + F_FW_CMD_REQUEST | + F_FW_CMD_WRITE | + V_FW_CMD_EXEC(0) | + V_FW_VI_MAC_CMD_VIID(viid)); + c.freemacs_to_len16 = + cpu_to_be32(V_FW_VI_MAC_CMD_FREEMACS(0) | + V_FW_CMD_LEN16(len16)); + + for (i = 0, p = c.u.exact; i < (int)fw_naddr; i++, p++) { + p->valid_to_idx = cpu_to_be16( + F_FW_VI_MAC_CMD_VALID | + V_FW_VI_MAC_CMD_IDX(FW_VI_MAC_MAC_BASED_FREE)); + memcpy(p->macaddr, addr[offset+i], sizeof(p->macaddr)); + } + + ret = t4_wr_mbox_meat(adap, mbox, &c, sizeof(c), &c, sleep_ok); + if (ret) + break; + + for (i = 0, p = c.u.exact; i < fw_naddr; i++, p++) { + u16 index = G_FW_VI_MAC_CMD_IDX( + be16_to_cpu(p->valid_to_idx)); + + if (index < max_naddr) + nfilters++; + } + + offset += fw_naddr; + rem -= fw_naddr; + } + + if (ret == 0) + ret = nfilters; + return ret; +} + +/** * t4_change_mac - modifies the exact-match filter for a MAC address * @adap: the adapter * @mbox: mailbox to use for the FW command @@ -8916,6 +9179,7 @@ const struct chip_params *t4_get_chip_params(int chipi .vfcount = 128, .sge_fl_db = F_DBPRIO, .mps_tcam_size = NUM_MPS_CLS_SRAM_L_INSTANCES, + .rss_nentries = RSS_NENTRIES, }, { /* T5 */ @@ -8928,6 +9192,7 @@ const struct chip_params *t4_get_chip_params(int chipi .vfcount = 128, .sge_fl_db = F_DBPRIO | F_DBTYPE, .mps_tcam_size = NUM_MPS_T5_CLS_SRAM_L_INSTANCES, + .rss_nentries = RSS_NENTRIES, }, { /* T6 */ @@ -8940,6 +9205,7 @@ const struct chip_params *t4_get_chip_params(int chipi .vfcount = 256, .sge_fl_db = 0, .mps_tcam_size = NUM_MPS_T5_CLS_SRAM_L_INSTANCES, + .rss_nentries = T6_RSS_NENTRIES, }, }; @@ -9728,15 +9994,15 @@ int t4_cim_read_la(struct adapter *adap, u32 *la_buf, if (ret) break; - /* address can't exceed 0xfff (UpDbgLaRdPtr is of 12-bits) */ - idx = (idx + 1) & M_UPDBGLARDPTR; - /* - * Bits 0-3 of UpDbgLaRdPtr can be between 0000 to 1001 to + /* Bits 0-3 of UpDbgLaRdPtr can be between 0000 to 1001 to * identify the 32-bit portion of the full 312-bit data */ - if (is_t6(adap)) - while ((idx & 0xf) > 9) - idx = (idx + 1) % M_UPDBGLARDPTR; + if (is_t6(adap) && (idx & 0xf) >= 9) + idx = (idx & 0xff0) + 0x10; + else + idx++; + /* address can't exceed 0xfff */ + idx &= M_UPDBGLARDPTR; } restart: if (cfg & F_UPDBGLAEN) { @@ -10479,88 +10745,81 @@ void t4_clr_port_stats(struct adapter *adap, int idx) } /** - * t4_i2c_rd - read I2C data from adapter + * t4_i2c_io - read/write I2C data from adapter * @adap: the adapter * @port: Port number if per-port device; <0 if not * @devid: per-port device ID or absolute device ID * @offset: byte offset into device I2C space * @len: byte length of I2C space data - * @buf: buffer in which to return I2C data - * - * Reads the I2C data from the indicated device and location. + * @buf: buffer in which to return I2C data for read + * buffer which holds the I2C data for write + * @write: if true, do a write; else do a read + * Reads/Writes the I2C data from/to the indicated device and location. */ -int t4_i2c_rd(struct adapter *adap, unsigned int mbox, +int t4_i2c_io(struct adapter *adap, unsigned int mbox, int port, unsigned int devid, unsigned int offset, unsigned int len, - u8 *buf) + u8 *buf, bool write) { - u32 ldst_addrspace; - struct fw_ldst_cmd ldst; - int ret; + struct fw_ldst_cmd ldst_cmd, ldst_rpl; + unsigned int i2c_max = sizeof(ldst_cmd.u.i2c.data); + int ret = 0; - if (port >= 4 || - devid >= 256 || - offset >= 256 || - len > sizeof ldst.u.i2c.data) + if (len > I2C_PAGE_SIZE) return -EINVAL; - memset(&ldst, 0, sizeof ldst); - ldst_addrspace = V_FW_LDST_CMD_ADDRSPACE(FW_LDST_ADDRSPC_I2C); - ldst.op_to_addrspace = + /* Dont allow reads that spans multiple pages */ + if (offset < I2C_PAGE_SIZE && offset + len > I2C_PAGE_SIZE) + return -EINVAL; + + memset(&ldst_cmd, 0, sizeof(ldst_cmd)); + ldst_cmd.op_to_addrspace = cpu_to_be32(V_FW_CMD_OP(FW_LDST_CMD) | F_FW_CMD_REQUEST | - F_FW_CMD_READ | - ldst_addrspace); - ldst.cycles_to_len16 = cpu_to_be32(FW_LEN16(ldst)); - ldst.u.i2c.pid = (port < 0 ? 0xff : port); - ldst.u.i2c.did = devid; - ldst.u.i2c.boffset = offset; - ldst.u.i2c.blen = len; - ret = t4_wr_mbox(adap, mbox, &ldst, sizeof ldst, &ldst); - if (!ret) - memcpy(buf, ldst.u.i2c.data, len); + (write ? F_FW_CMD_WRITE : F_FW_CMD_READ) | + V_FW_LDST_CMD_ADDRSPACE(FW_LDST_ADDRSPC_I2C)); + ldst_cmd.cycles_to_len16 = cpu_to_be32(FW_LEN16(ldst_cmd)); + ldst_cmd.u.i2c.pid = (port < 0 ? 0xff : port); + ldst_cmd.u.i2c.did = devid; + + while (len > 0) { + unsigned int i2c_len = (len < i2c_max) ? len : i2c_max; + + ldst_cmd.u.i2c.boffset = offset; + ldst_cmd.u.i2c.blen = i2c_len; + + if (write) + memcpy(ldst_cmd.u.i2c.data, buf, i2c_len); + + ret = t4_wr_mbox(adap, mbox, &ldst_cmd, sizeof(ldst_cmd), + write ? NULL : &ldst_rpl); + if (ret) + break; + + if (!write) + memcpy(buf, ldst_rpl.u.i2c.data, i2c_len); + offset += i2c_len; + buf += i2c_len; + len -= i2c_len; + } + return ret; } -/** - * t4_i2c_wr - write I2C data to adapter - * @adap: the adapter - * @port: Port number if per-port device; <0 if not - * @devid: per-port device ID or absolute device ID - * @offset: byte offset into device I2C space - * @len: byte length of I2C space data - * @buf: buffer containing new I2C data - * - * Write the I2C data to the indicated device and location. - */ -int t4_i2c_wr(struct adapter *adap, unsigned int mbox, +int t4_i2c_rd(struct adapter *adap, unsigned int mbox, int port, unsigned int devid, unsigned int offset, unsigned int len, u8 *buf) { - u32 ldst_addrspace; - struct fw_ldst_cmd ldst; + return t4_i2c_io(adap, mbox, port, devid, offset, len, buf, false); +} - if (port >= 4 || - devid >= 256 || - offset >= 256 || - len > sizeof ldst.u.i2c.data) - return -EINVAL; - - memset(&ldst, 0, sizeof ldst); - ldst_addrspace = V_FW_LDST_CMD_ADDRSPACE(FW_LDST_ADDRSPC_I2C); - ldst.op_to_addrspace = - cpu_to_be32(V_FW_CMD_OP(FW_LDST_CMD) | - F_FW_CMD_REQUEST | - F_FW_CMD_WRITE | - ldst_addrspace); - ldst.cycles_to_len16 = cpu_to_be32(FW_LEN16(ldst)); - ldst.u.i2c.pid = (port < 0 ? 0xff : port); - ldst.u.i2c.did = devid; - ldst.u.i2c.boffset = offset; - ldst.u.i2c.blen = len; - memcpy(ldst.u.i2c.data, buf, len); - return t4_wr_mbox(adap, mbox, &ldst, sizeof ldst, &ldst); +int t4_i2c_wr(struct adapter *adap, unsigned int mbox, + int port, unsigned int devid, + unsigned int offset, unsigned int len, + u8 *buf) +{ + return t4_i2c_io(adap, mbox, port, devid, offset, len, buf, true); } /** @@ -10826,4 +11085,220 @@ int t4_set_devlog_level(struct adapter *adapter, unsig devlog_cmd.retval_len16 = cpu_to_be32(FW_LEN16(devlog_cmd)); return t4_wr_mbox(adapter, adapter->mbox, &devlog_cmd, sizeof(devlog_cmd), &devlog_cmd); +} + +int t4_configure_add_smac(struct adapter *adap) +{ + unsigned int param, val; + int ret = 0; + + adap->params.smac_add_support = 0; + param = (V_FW_PARAMS_MNEM(FW_PARAMS_MNEM_DEV) | + V_FW_PARAMS_PARAM_X(FW_PARAMS_PARAM_DEV_ADD_SMAC)); + /* Query FW to check if FW supports adding source mac address + * to TCAM feature or not. + * If FW returns 1, driver can use this feature and driver need to send + * FW_PARAMS_PARAM_DEV_ADD_SMAC write command with value 1 to + * enable adding smac to TCAM. + */ + ret = t4_query_params(adap, adap->mbox, adap->pf, 0, 1, ¶m, &val); + if (ret) + return ret; + + if (val == 1) { + ret = t4_set_params(adap, adap->mbox, adap->pf, 0, 1, + ¶m, &val); + if (!ret) + /* Firmware allows adding explicit TCAM entries. + * Save this internally. + */ + adap->params.smac_add_support = 1; + } + + return ret; +} + +int t4_configure_ringbb(struct adapter *adap) +{ + unsigned int param, val; + int ret = 0; + + param = (V_FW_PARAMS_MNEM(FW_PARAMS_MNEM_DEV) | + V_FW_PARAMS_PARAM_X(FW_PARAMS_PARAM_DEV_RING_BACKBONE)); + /* Query FW to check if FW supports ring switch feature or not. + * If FW returns 1, driver can use this feature and driver need to send + * FW_PARAMS_PARAM_DEV_RING_BACKBONE write command with value 1 to + * enable the ring backbone configuration. + */ + ret = t4_query_params(adap, adap->mbox, adap->pf, 0, 1, ¶m, &val); + if (ret < 0) { + CH_ERR(adap, "Querying FW using Ring backbone params command failed, err=%d\n", + ret); + goto out; + } + + if (val != 1) { + CH_ERR(adap, "FW doesnot support ringbackbone features\n"); + goto out; + } + + ret = t4_set_params(adap, adap->mbox, adap->pf, 0, 1, ¶m, &val); + if (ret < 0) { + CH_ERR(adap, "Could not set Ringbackbone, err= %d\n", + ret); + goto out; + } + +out: + return ret; +} + +/* + * t4_set_vlan_acl - Set a VLAN id for the specified VF + * @adapter: the adapter + * @mbox: mailbox to use for the FW command + * @vf: one of the VFs instantiated by the specified PF + * @vlan: The vlanid to be set + * + */ +int t4_set_vlan_acl(struct adapter *adap, unsigned int mbox, unsigned int vf, + u16 vlan) +{ + struct fw_acl_vlan_cmd vlan_cmd; + unsigned int enable; + + enable = (vlan ? F_FW_ACL_VLAN_CMD_EN : 0); + memset(&vlan_cmd, 0, sizeof(vlan_cmd)); + vlan_cmd.op_to_vfn = cpu_to_be32(V_FW_CMD_OP(FW_ACL_VLAN_CMD) | + F_FW_CMD_REQUEST | + F_FW_CMD_WRITE | + F_FW_CMD_EXEC | + V_FW_ACL_VLAN_CMD_PFN(adap->pf) | + V_FW_ACL_VLAN_CMD_VFN(vf)); + vlan_cmd.en_to_len16 = cpu_to_be32(enable | FW_LEN16(vlan_cmd)); + /* Drop all packets that donot match vlan id */ + vlan_cmd.dropnovlan_fm = (enable + ? (F_FW_ACL_VLAN_CMD_DROPNOVLAN | + F_FW_ACL_VLAN_CMD_FM) + : 0); + if (enable != 0) { + vlan_cmd.nvlan = 1; + vlan_cmd.vlanid[0] = cpu_to_be16(vlan); + } + + return t4_wr_mbox(adap, adap->mbox, &vlan_cmd, sizeof(vlan_cmd), NULL); +} + +/** + * t4_del_mac - Removes the exact-match filter for a MAC address + * @adap: the adapter + * @mbox: mailbox to use for the FW command + * @viid: the VI id + * @addr: the MAC address value + * @smac: if true, delete from only the smac region of MPS + * + * Modifies an exact-match filter and sets it to the new MAC address if + * @idx >= 0, or adds the MAC address to a new filter if @idx < 0. In the + * latter case the address is added persistently if @persist is %true. + * + * Returns a negative error number or the index of the filter with the new + * MAC value. Note that this index may differ from @idx. + */ +int t4_del_mac(struct adapter *adap, unsigned int mbox, unsigned int viid, + const u8 *addr, bool smac) +{ + int ret; + struct fw_vi_mac_cmd c; + struct fw_vi_mac_exact *p = c.u.exact; + unsigned int max_mac_addr = adap->chip_params->mps_tcam_size; + + memset(&c, 0, sizeof(c)); + c.op_to_viid = cpu_to_be32(V_FW_CMD_OP(FW_VI_MAC_CMD) | + F_FW_CMD_REQUEST | F_FW_CMD_WRITE | + V_FW_VI_MAC_CMD_VIID(viid)); + c.freemacs_to_len16 = cpu_to_be32( + V_FW_CMD_LEN16(1) | + (smac ? F_FW_VI_MAC_CMD_IS_SMAC : 0)); + + memcpy(p->macaddr, addr, sizeof(p->macaddr)); + p->valid_to_idx = cpu_to_be16( + F_FW_VI_MAC_CMD_VALID | + V_FW_VI_MAC_CMD_IDX(FW_VI_MAC_MAC_BASED_FREE)); + + ret = t4_wr_mbox(adap, mbox, &c, sizeof(c), &c); + if (ret == 0) { + ret = G_FW_VI_MAC_CMD_IDX(be16_to_cpu(p->valid_to_idx)); + if (ret < max_mac_addr) + return -ENOMEM; + } + + return ret; +} + +/** + * t4_add_mac - Adds an exact-match filter for a MAC address + * @adap: the adapter + * @mbox: mailbox to use for the FW command + * @viid: the VI id + * @idx: index of existing filter for old value of MAC address, or -1 + * @addr: the new MAC address value + * @persist: whether a new MAC allocation should be persistent + * @add_smt: if true also add the address to the HW SMT + * @smac: if true, update only the smac region of MPS + * + * Modifies an exact-match filter and sets it to the new MAC address if + * @idx >= 0, or adds the MAC address to a new filter if @idx < 0. In the + * latter case the address is added persistently if @persist is %true. + * + * Returns a negative error number or the index of the filter with the new + * MAC value. Note that this index may differ from @idx. + */ +int t4_add_mac(struct adapter *adap, unsigned int mbox, unsigned int viid, + int idx, const u8 *addr, bool persist, u8 *smt_idx, bool smac) +{ + int ret, mode; + struct fw_vi_mac_cmd c; + struct fw_vi_mac_exact *p = c.u.exact; + unsigned int max_mac_addr = adap->chip_params->mps_tcam_size; + + if (idx < 0) /* new allocation */ + idx = persist ? FW_VI_MAC_ADD_PERSIST_MAC : FW_VI_MAC_ADD_MAC; + mode = smt_idx ? FW_VI_MAC_SMT_AND_MPSTCAM : FW_VI_MAC_MPS_TCAM_ENTRY; + + memset(&c, 0, sizeof(c)); + c.op_to_viid = cpu_to_be32(V_FW_CMD_OP(FW_VI_MAC_CMD) | + F_FW_CMD_REQUEST | F_FW_CMD_WRITE | + V_FW_VI_MAC_CMD_VIID(viid)); + c.freemacs_to_len16 = cpu_to_be32( + V_FW_CMD_LEN16(1) | + (smac ? F_FW_VI_MAC_CMD_IS_SMAC : 0)); + p->valid_to_idx = cpu_to_be16(F_FW_VI_MAC_CMD_VALID | + V_FW_VI_MAC_CMD_SMAC_RESULT(mode) | + V_FW_VI_MAC_CMD_IDX(idx)); + memcpy(p->macaddr, addr, sizeof(p->macaddr)); + + ret = t4_wr_mbox(adap, mbox, &c, sizeof(c), &c); + if (ret == 0) { + ret = G_FW_VI_MAC_CMD_IDX(be16_to_cpu(p->valid_to_idx)); + if (ret >= max_mac_addr) + return -ENOMEM; + if (smt_idx) { + /* Does fw supports returning smt_idx? */ + if (adap->params.viid_smt_extn_support) + *smt_idx = G_FW_VI_MAC_CMD_SMTID(be32_to_cpu(c.op_to_viid)); + else { + /* In T4/T5, SMT contains 256 SMAC entries + * organized in 128 rows of 2 entries each. + * In T6, SMT contains 256 SMAC entries in + * 256 rows. + */ + if (chip_id(adap) <= CHELSIO_T5) + *smt_idx = ((viid & M_FW_VIID_VIN) << 1); + else + *smt_idx = (viid & M_FW_VIID_VIN); + } + } + } + + return ret; } Modified: head/sys/dev/cxgbe/common/t4_hw.h ============================================================================== --- head/sys/dev/cxgbe/common/t4_hw.h Fri Jul 24 21:14:59 2020 (r363497) +++ head/sys/dev/cxgbe/common/t4_hw.h Fri Jul 24 23:15:42 2020 (r363498) @@ -43,6 +43,7 @@ enum { EEPROMVSIZE = 32768, /* Serial EEPROM virtual address space size */ EEPROMPFSIZE = 1024, /* EEPROM writable area size for PFn, n>0 */ RSS_NENTRIES = 2048, /* # of entries in RSS mapping table */ + T6_RSS_NENTRIES = 4096, TCB_SIZE = 128, /* TCB size */ NMTUS = 16, /* size of MTU table */ NCCTRL_WIN = 32, /* # of congestion control windows */ @@ -92,6 +93,7 @@ enum { SGE_CTXT_SIZE = 24, /* size of SGE context */ SGE_NTIMERS = 6, /* # of interrupt holdoff timer values */ SGE_NCOUNTERS = 4, /* # of interrupt packet counter values */ + SGE_NDBQTIMERS = 8, /* # of Doorbell Queue Timer values */ SGE_MAX_IQ_SIZE = 65520, SGE_FLBUF_SIZES = 16, }; @@ -298,5 +300,15 @@ enum { #define M_SGE_TIMESTAMP 0xfffffffffffffffULL #define V_SGE_TIMESTAMP(x) ((__u64)(x) << S_SGE_TIMESTAMP) #define G_SGE_TIMESTAMP(x) (((__u64)(x) >> S_SGE_TIMESTAMP) & M_SGE_TIMESTAMP) + +#define I2C_DEV_ADDR_A0 0xa0 +#define I2C_DEV_ADDR_A2 0xa2 +#define I2C_PAGE_SIZE 0x100 +#define SFP_DIAG_TYPE_ADDR 0x5c +#define SFP_DIAG_TYPE_LEN 0x1 +#define SFF_8472_COMP_ADDR 0x5e +#define SFF_8472_COMP_LEN 0x1 +#define SFF_REV_ADDR 0x1 +#define SFF_REV_LEN 0x1 #endif /* __T4_HW_H */ Modified: head/sys/dev/cxgbe/cudbg/cudbg_lib.c ============================================================================== --- head/sys/dev/cxgbe/cudbg/cudbg_lib.c Fri Jul 24 21:14:59 2020 (r363497) +++ head/sys/dev/cxgbe/cudbg/cudbg_lib.c Fri Jul 24 23:15:42 2020 (r363498) @@ -576,7 +576,7 @@ static int collect_rss(struct cudbg_init *pdbg_init, u32 size; int rc = 0; - size = RSS_NENTRIES * sizeof(u16); + size = padap->chip_params->rss_nentries * sizeof(u16); rc = get_scratch_buff(dbg_buff, size, &scratch_buff); if (rc) goto err; From owner-svn-src-all@freebsd.org Fri Jul 24 23:17:11 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 009FB3768EF; Fri, 24 Jul 2020 23:17:11 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BD4pt63T1z4Pl7; Fri, 24 Jul 2020 23:17:10 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B30BA12513; Fri, 24 Jul 2020 23:17:10 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06ONHAuB009499; Fri, 24 Jul 2020 23:17:10 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06ONHAd7009496; Fri, 24 Jul 2020 23:17:10 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <202007242317.06ONHAd7009496@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Fri, 24 Jul 2020 23:17:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363499 - in head/sys/fs: nfs nfsclient X-SVN-Group: head X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: in head/sys/fs: nfs nfsclient X-SVN-Commit-Revision: 363499 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 24 Jul 2020 23:17:11 -0000 Author: rmacklem Date: Fri Jul 24 23:17:09 2020 New Revision: 363499 URL: https://svnweb.freebsd.org/changeset/base/363499 Log: Add support for ext_pgs mbufs to nfsm_uiombuflist() and nfsm_split(). This patch uses a slightly different algorithm for nfsm_uiombuflist() for the non-ext_pgs case, where a variable called "mcp" is maintained, pointing to the current location that mbuf data can be filled into. This avoids use of mtod(mp, char *) + mp->m_len to calculate the location, since this does not work for ext_pgs mbufs and I think it makes the algorithm more readable. This change should not result in semantic changes for the non-ext_pgs case. The patch also deletes come unneeded code. It also adds support for anonymous page ext_pgs mbufs to nfsm_split(). This is another in the series of commits that add support to the NFS client and server for building RPC messages in ext_pgs mbufs with anonymous pages. This is useful so that the entire mbuf list does not need to be copied before calling sosend() when NFS over TLS is enabled. At this time for this case, use of ext_pgs mbufs cannot be enabled, since ktls_encrypt() replaces the unencrypted data with encrypted data in place. Until such time as this can be enabled, there should be no semantic change. Also, note that this code is only used by the NFS client for a mirrored pNFS server. Modified: head/sys/fs/nfs/nfs_var.h head/sys/fs/nfsclient/nfs_clcomsubs.c head/sys/fs/nfsclient/nfs_clrpcops.c Modified: head/sys/fs/nfs/nfs_var.h ============================================================================== --- head/sys/fs/nfs/nfs_var.h Fri Jul 24 23:15:42 2020 (r363498) +++ head/sys/fs/nfs/nfs_var.h Fri Jul 24 23:17:09 2020 (r363499) @@ -365,7 +365,7 @@ struct mbuf *nfsm_add_ext_pgs(struct mbuf *, int, int /* nfs_clcomsubs.c */ void nfsm_uiombuf(struct nfsrv_descript *, struct uio *, int); -struct mbuf *nfsm_uiombuflist(struct uio *, int, struct mbuf **, char **); +struct mbuf *nfsm_uiombuflist(struct uio *, int, u_int); nfsuint64 *nfscl_getcookie(struct nfsnode *, off_t off, int); u_int8_t *nfscl_getmyip(struct nfsmount *, struct in6_addr *, int *); int nfsm_getfh(struct nfsrv_descript *, struct nfsfh **); Modified: head/sys/fs/nfsclient/nfs_clcomsubs.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clcomsubs.c Fri Jul 24 23:15:42 2020 (r363498) +++ head/sys/fs/nfsclient/nfs_clcomsubs.c Fri Jul 24 23:17:09 2020 (r363499) @@ -160,26 +160,33 @@ nfsm_uiombuf(struct nfsrv_descript *nd, struct uio *ui * NOTE: can ony handle iovcnt == 1 */ struct mbuf * -nfsm_uiombuflist(struct uio *uiop, int siz, struct mbuf **mbp, char **cpp) +nfsm_uiombuflist(struct uio *uiop, int siz, u_int maxext) { char *uiocp; struct mbuf *mp, *mp2, *firstmp; - int i, left, mlen, rem, xfer; + int extpg, extpgsiz = 0, i, left, mlen, rem, xfer; int uiosiz, clflg; char *mcp, *tcp; KASSERT(uiop->uio_iovcnt == 1, ("nfsm_uiotombuf: iovcnt != 1")); - if (siz > ncl_mbuf_mlen) /* or should it >= MCLBYTES ?? */ - clflg = 1; - else - clflg = 0; - if (clflg != 0) - NFSMCLGET(mp, M_WAITOK); - else - NFSMGET(mp); + if (maxext > 0) { + mp = mb_alloc_ext_plus_pages(PAGE_SIZE, M_WAITOK); + mcp = (char *)(void *)PHYS_TO_DMAP(mp->m_epg_pa[0]); + extpg = 0; + extpgsiz = PAGE_SIZE; + } else { + if (siz > ncl_mbuf_mlen) /* or should it >= MCLBYTES ?? */ + clflg = 1; + else + clflg = 0; + if (clflg != 0) + NFSMCLGET(mp, M_WAITOK); + else + NFSMGET(mp); + mcp = mtod(mp, char *); + } mp->m_len = 0; - mcp = mtod(mp, char *); firstmp = mp2 = mp; rem = NFSM_RNDUP(siz) - siz; while (siz > 0) { @@ -189,17 +196,28 @@ nfsm_uiombuflist(struct uio *uiop, int siz, struct mbu left = siz; uiosiz = left; while (left > 0) { - mlen = M_TRAILINGSPACE(mp); - if (mlen == 0) { - if (clflg) - NFSMCLGET(mp, M_WAITOK); - else - NFSMGET(mp); - mp->m_len = 0; - mcp = mtod(mp, char *); - mp2->m_next = mp; - mp2 = mp; + if (maxext > 0) + mlen = extpgsiz; + else mlen = M_TRAILINGSPACE(mp); + if (mlen == 0) { + if (maxext > 0) { + mp = nfsm_add_ext_pgs(mp, maxext, + &extpg); + mlen = extpgsiz = PAGE_SIZE; + mcp = (char *)(void *)PHYS_TO_DMAP( + mp->m_epg_pa[extpg]); + } else { + if (clflg) + NFSMCLGET(mp, M_WAITOK); + else + NFSMGET(mp); + mcp = mtod(mp, char *); + mlen = M_TRAILINGSPACE(mp); + mp->m_len = 0; + mp2->m_next = mp; + mp2 = mp; + } } xfer = (left > mlen) ? mlen : left; if (uiop->uio_segflg == UIO_SYSSPACE) @@ -208,6 +226,10 @@ nfsm_uiombuflist(struct uio *uiop, int siz, struct mbu copyin(uiocp, mcp, xfer); mp->m_len += xfer; mcp += xfer; + if (maxext > 0) { + extpgsiz -= xfer; + mp->m_epg_last_len += xfer; + } left -= xfer; uiocp += xfer; uiop->uio_offset += xfer; @@ -220,16 +242,15 @@ nfsm_uiombuflist(struct uio *uiop, int siz, struct mbu siz -= uiosiz; } if (rem > 0) { - KASSERT(rem <= M_TRAILINGSPACE(mp), + KASSERT((mp->m_flags & M_EXTPG) != 0 || + rem <= M_TRAILINGSPACE(mp), ("nfsm_uiombuflist: no space for padding")); for (i = 0; i < rem; i++) *mcp++ = '\0'; mp->m_len += rem; + if (maxext > 0) + mp->m_epg_last_len += rem; } - if (cpp != NULL) - *cpp = mtod(mp, caddr_t) + mp->m_len; - if (mbp != NULL) - *mbp = mp; return (firstmp); } Modified: head/sys/fs/nfsclient/nfs_clrpcops.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clrpcops.c Fri Jul 24 23:15:42 2020 (r363498) +++ head/sys/fs/nfsclient/nfs_clrpcops.c Fri Jul 24 23:17:09 2020 (r363499) @@ -5862,7 +5862,7 @@ nfscl_doiods(vnode_t vp, struct uio *uiop, int *iomode uiop->uio_iov->iov_base; iovlen = uiop->uio_iov->iov_len; m = nfsm_uiombuflist(uiop, len, - NULL, NULL); + 0); } tdrpc = drpc = malloc(sizeof(*drpc) * (mirrorcnt - 1), M_TEMP, M_WAITOK | @@ -6545,12 +6545,6 @@ nfsrpc_writedsmir(vnode_t vp, int *iomode, int *must_c if (len > 0) { /* Put data in mbuf chain. */ nd->nd_mb->m_next = m; - /* Set nd_mb and nd_bpos to end of data. */ - while (m->m_next != NULL) - m = m->m_next; - nd->nd_mb = m; - nd->nd_bpos = mtod(m, char *) + m->m_len; - NFSCL_DEBUG(4, "nfsrpc_writedsmir: lastmb len=%d\n", m->m_len); } nrp = dsp->nfsclds_sockp; if (nrp == NULL) @@ -8625,8 +8619,97 @@ nfsmout: static struct mbuf * nfsm_split(struct mbuf *mp, uint64_t xfer) { - struct mbuf *m; + struct mbuf *m, *m2; + vm_page_t pg; + int i, j, left, pgno, plen, trim; + char *cp, *cp2; - m = m_split(mp, xfer, M_WAITOK); - return (m); + if ((mp->m_flags & M_EXTPG) == 0) { + m = m_split(mp, xfer, M_WAITOK); + return (m); + } + + /* Find the correct mbuf to split at. */ + for (m = mp; m != NULL && xfer > m->m_len; m = m->m_next) + xfer -= m->m_len; + if (m == NULL) + return (NULL); + + /* If xfer == m->m_len, we can just split the mbuf list. */ + if (xfer == m->m_len) { + m2 = m->m_next; + m->m_next = NULL; + return (m2); + } + + /* Find the page to split at. */ + pgno = 0; + left = xfer; + do { + if (pgno == 0) + plen = m_epg_pagelen(m, 0, m->m_epg_1st_off); + else + plen = m_epg_pagelen(m, pgno, 0); + if (left <= plen) + break; + left -= plen; + pgno++; + } while (pgno < m->m_epg_npgs); + if (pgno == m->m_epg_npgs) + panic("nfsm_split: eroneous ext_pgs mbuf"); + + m2 = mb_alloc_ext_pgs(M_WAITOK, mb_free_mext_pgs); + m2->m_epg_flags |= EPG_FLAG_ANON; + + /* + * If left < plen, allocate a new page for the new mbuf + * and copy the data after left in the page to this new + * page. + */ + if (left < plen) { + do { + pg = vm_page_alloc(NULL, 0, VM_ALLOC_NORMAL | + VM_ALLOC_NOOBJ | VM_ALLOC_NODUMP | + VM_ALLOC_WIRED); + if (pg == NULL) + vm_wait(NULL); + } while (pg == NULL); + m2->m_epg_pa[0] = VM_PAGE_TO_PHYS(pg); + m2->m_epg_npgs = 1; + + /* Copy the data after left to the new page. */ + trim = plen - left; + cp = (char *)(void *)PHYS_TO_DMAP(m->m_epg_pa[pgno]); + if (pgno == 0) + cp += m->m_epg_1st_off; + cp += left; + cp2 = (char *)(void *)PHYS_TO_DMAP(m2->m_epg_pa[0]); + if (pgno == m->m_epg_npgs - 1) + m2->m_epg_last_len = trim; + else { + cp2 += PAGE_SIZE - trim; + m2->m_epg_1st_off = PAGE_SIZE - trim; + m2->m_epg_last_len = m->m_epg_last_len; + } + memcpy(cp2, cp, trim); + m2->m_len = trim; + } else { + m2->m_len = 0; + m2->m_epg_last_len = m->m_epg_last_len; + } + + /* Move the pages beyond pgno to the new mbuf. */ + for (i = pgno + 1, j = m2->m_epg_npgs; i < m->m_epg_npgs; i++, j++) { + m2->m_epg_pa[j] = m->m_epg_pa[i]; + /* Never moves page 0. */ + m2->m_len += m_epg_pagelen(m, i, 0); + } + m2->m_epg_npgs = j; + m->m_epg_npgs = pgno + 1; + m->m_epg_last_len = left; + m->m_len = xfer; + + m2->m_next = m->m_next; + m->m_next = NULL; + return (m2); } From owner-svn-src-all@freebsd.org Fri Jul 24 23:44:36 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7B12A37780E; Fri, 24 Jul 2020 23:44:36 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BD5QX2Szwz4QvX; Fri, 24 Jul 2020 23:44:36 +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 3805712840; Fri, 24 Jul 2020 23:44:36 +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 06ONial8028115; Fri, 24 Jul 2020 23:44:36 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06ONiaEd028114; Fri, 24 Jul 2020 23:44:36 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202007242344.06ONiaEd028114@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Fri, 24 Jul 2020 23:44:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r363500 - stable/12/sys/amd64/amd64 X-SVN-Group: stable-12 X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: stable/12/sys/amd64/amd64 X-SVN-Commit-Revision: 363500 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 24 Jul 2020 23:44:36 -0000 Author: mjg Date: Fri Jul 24 23:44:35 2020 New Revision: 363500 URL: https://svnweb.freebsd.org/changeset/base/363500 Log: MFC r352874: amd64 pmap: batch chunk removal in pmap_remove_pages Modified: stable/12/sys/amd64/amd64/pmap.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/amd64/amd64/pmap.c ============================================================================== --- stable/12/sys/amd64/amd64/pmap.c Fri Jul 24 23:17:09 2020 (r363499) +++ stable/12/sys/amd64/amd64/pmap.c Fri Jul 24 23:44:35 2020 (r363500) @@ -1111,7 +1111,10 @@ static caddr_t crashdumpmap; #define MAPDEV_SETATTR 0x00000002 /* Modify existing attrs. */ #define MAPDEV_ASSERTVALID 0x00000004 /* Assert mapping validity. */ +TAILQ_HEAD(pv_chunklist, pv_chunk); + static void free_pv_chunk(struct pv_chunk *pc); +static void free_pv_chunk_batch(struct pv_chunklist *batch); static void free_pv_entry(pmap_t pmap, pv_entry_t pv); static pv_entry_t get_pv_entry(pmap_t pmap, struct rwlock **lockp); static int popcnt_pc_map_pq(uint64_t *map); @@ -4313,13 +4316,10 @@ free_pv_entry(pmap_t pmap, pv_entry_t pv) } static void -free_pv_chunk(struct pv_chunk *pc) +free_pv_chunk_dequeued(struct pv_chunk *pc) { vm_page_t m; - mtx_lock(&pv_chunks_mutex); - TAILQ_REMOVE(&pv_chunks, pc, pc_lru); - mtx_unlock(&pv_chunks_mutex); PV_STAT(atomic_subtract_int(&pv_entry_spare, _NPCPV)); PV_STAT(atomic_subtract_int(&pc_chunk_count, 1)); PV_STAT(atomic_add_int(&pc_chunk_frees, 1)); @@ -4330,6 +4330,35 @@ free_pv_chunk(struct pv_chunk *pc) vm_page_free(m); } +static void +free_pv_chunk(struct pv_chunk *pc) +{ + + mtx_lock(&pv_chunks_mutex); + TAILQ_REMOVE(&pv_chunks, pc, pc_lru); + mtx_unlock(&pv_chunks_mutex); + free_pv_chunk_dequeued(pc); +} + +static void +free_pv_chunk_batch(struct pv_chunklist *batch) +{ + struct pv_chunk *pc, *npc; + + if (TAILQ_EMPTY(batch)) + return; + + mtx_lock(&pv_chunks_mutex); + TAILQ_FOREACH(pc, batch, pc_list) { + TAILQ_REMOVE(&pv_chunks, pc, pc_lru); + } + mtx_unlock(&pv_chunks_mutex); + + TAILQ_FOREACH_SAFE(pc, batch, pc_list, npc) { + free_pv_chunk_dequeued(pc); + } +} + /* * Returns a new PV entry, allocating a new PV chunk from the system when * needed. If this PV chunk allocation fails and a PV list lock pointer was @@ -6946,6 +6975,7 @@ pmap_remove_pages(pmap_t pmap) pt_entry_t *pte, tpte; pt_entry_t PG_M, PG_RW, PG_V; struct spglist free; + struct pv_chunklist free_chunks; vm_page_t m, mpte, mt; pv_entry_t pv; struct md_page *pvh; @@ -6981,6 +7011,7 @@ pmap_remove_pages(pmap_t pmap) PG_V = pmap_valid_bit(pmap); PG_RW = pmap_rw_bit(pmap); + TAILQ_INIT(&free_chunks); SLIST_INIT(&free); PMAP_LOCK(pmap); TAILQ_FOREACH_SAFE(pc, &pmap->pm_pvchunk, pc_list, npc) { @@ -7108,13 +7139,14 @@ pmap_remove_pages(pmap_t pmap) PV_STAT(atomic_subtract_long(&pv_entry_count, freed)); if (allfree) { TAILQ_REMOVE(&pmap->pm_pvchunk, pc, pc_list); - free_pv_chunk(pc); + TAILQ_INSERT_TAIL(&free_chunks, pc, pc_list); } } if (lock != NULL) rw_wunlock(lock); pmap_invalidate_all(pmap); pmap_pkru_deassign_all(pmap); + free_pv_chunk_batch(&free_chunks); PMAP_UNLOCK(pmap); vm_page_free_pages_toq(&free, true); } From owner-svn-src-all@freebsd.org Fri Jul 24 23:45:43 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A2B03377173; Fri, 24 Jul 2020 23:45: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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BD5Rq3vShz4QyG; Fri, 24 Jul 2020 23:45: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 698B5129C3; Fri, 24 Jul 2020 23:45: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 06ONjhSD028255; Fri, 24 Jul 2020 23:45:43 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06ONjguV028251; Fri, 24 Jul 2020 23:45:42 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202007242345.06ONjguV028251@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Fri, 24 Jul 2020 23:45:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r363501 - in stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs: . sys X-SVN-Group: stable-12 X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: in stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs: . sys X-SVN-Commit-Revision: 363501 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 24 Jul 2020 23:45:43 -0000 Author: mjg Date: Fri Jul 24 23:45:42 2020 New Revision: 363501 URL: https://svnweb.freebsd.org/changeset/base/363501 Log: MFC r357282: zfs: fix spurious lock contention during path lookup Modified: stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_acl.h stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_acl.c stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_acl.h ============================================================================== --- stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_acl.h Fri Jul 24 23:44:35 2020 (r363500) +++ stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_acl.h Fri Jul 24 23:45:42 2020 (r363501) @@ -214,7 +214,10 @@ void zfs_oldace_byteswap(ace_t *, int); void zfs_ace_byteswap(void *, size_t, boolean_t); extern boolean_t zfs_has_access(struct znode *zp, cred_t *cr); extern int zfs_zaccess(struct znode *, int, int, boolean_t, cred_t *); +#ifdef illumos int zfs_fastaccesschk_execute(struct znode *, cred_t *); +#endif +int zfs_freebsd_fastaccesschk_execute(struct vnode *, cred_t *); extern int zfs_zaccess_rwx(struct znode *, mode_t, int, cred_t *); extern int zfs_zaccess_unix(struct znode *, mode_t, cred_t *); extern int zfs_acl_access(struct znode *, int, cred_t *); Modified: stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_acl.c ============================================================================== --- stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_acl.c Fri Jul 24 23:44:35 2020 (r363500) +++ stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_acl.c Fri Jul 24 23:45:42 2020 (r363501) @@ -2299,7 +2299,41 @@ zfs_zaccess_append(znode_t *zp, uint32_t *working_mode check_privs, B_FALSE, cr)); } +/* + * Check if VEXEC is allowed. + * + * This routine is based on zfs_fastaccesschk_execute which has slowpath + * calling zfs_zaccess. This would be incorrect on FreeBSD (see + * zfs_freebsd_access for the difference). Thus this variant let's the + * caller handle the slowpath (if necessary). + * + * We only check for ZFS_NO_EXECS_DENIED and fail early. This routine can + * be extended to cover more cases, but the flag covers the majority. + */ int +zfs_freebsd_fastaccesschk_execute(struct vnode *vp, cred_t *cr) +{ + boolean_t is_attr; + znode_t *zdp = VTOZ(vp); + + ASSERT_VOP_LOCKED(vp, __func__); + + if (zdp->z_pflags & ZFS_AV_QUARANTINED) + return (1); + + is_attr = ((zdp->z_pflags & ZFS_XATTR) && + (ZTOV(zdp)->v_type == VDIR)); + if (is_attr) + return (1); + + if (zdp->z_pflags & ZFS_NO_EXECS_DENIED) + return (0); + + return (1); +} + +#ifdef illumos +int zfs_fastaccesschk_execute(znode_t *zdp, cred_t *cr) { boolean_t owner = B_FALSE; @@ -2365,6 +2399,7 @@ slow: ZFS_EXIT(zdp->z_zfsvfs); return (error); } +#endif /* * Determine whether Access should be granted/denied. Modified: stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c ============================================================================== --- stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Fri Jul 24 23:44:35 2020 (r363500) +++ stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Fri Jul 24 23:45:42 2020 (r363501) @@ -4915,6 +4915,11 @@ zfs_freebsd_access(ap) accmode_t accmode; int error = 0; + if (ap->a_accmode == VEXEC) { + if (zfs_freebsd_fastaccesschk_execute(ap->a_vp, ap->a_cred) == 0) + return (0); + } + /* * ZFS itself only knowns about VREAD, VWRITE, VEXEC and VAPPEND, */ From owner-svn-src-all@freebsd.org Sat Jul 25 00:01:58 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 12EE1378148; Sat, 25 Jul 2020 00:01:58 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BD5pZ031rz4Rpm; Sat, 25 Jul 2020 00:01: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 BAE4F12C1A; Sat, 25 Jul 2020 00:01: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 06P01vmn041026; Sat, 25 Jul 2020 00:01:57 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06P01vOI041025; Sat, 25 Jul 2020 00:01:57 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202007250001.06P01vOI041025@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Sat, 25 Jul 2020 00:01:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r363503 - stable/12/sys/kern X-SVN-Group: stable-12 X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: stable/12/sys/kern X-SVN-Commit-Revision: 363503 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 25 Jul 2020 00:01:58 -0000 Author: mjg Date: Sat Jul 25 00:01:57 2020 New Revision: 363503 URL: https://svnweb.freebsd.org/changeset/base/363503 Log: MFC r347503,r347505,r347510,r352177,r352178,r352183,r352612,r352617, r352631,r352810,r352811,r352812,r352813,r354893,r355124,r355125, r356880,r356883,r356915 cache: push sdt probes in cache_zap_locked to code doing the work cache: bump numcache on entry, while here fix lnumcache type cache: fix a brainfart in r347505 cache: assorted cleanups cache: change the formula for calculating lock array sizes cache: avoid excessive relocking on entry removal during lookup cache: jump in negative success instead of positive cache: count evictions of negatve entries cache: tidy up handling of negative entries cache: stop recalculating upper limit each time a new entry is added cache: make negative list shrinking a little bit concurrent cache: stop requeuing negative entries on the hot list cache: decrease ncnegfactor to 5 cache: minor stat cleanup cache: fix numcache accounting on entry cache: stop reusing .. entries on enter cache: convert numcachehv to counter(9) on 64-bit platforms cache: counter_u64_add_protected -> counter_u64_add cache: make numcachehv use counter(9) on all archs Modified: stable/12/sys/kern/vfs_cache.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/kern/vfs_cache.c ============================================================================== --- stable/12/sys/kern/vfs_cache.c Fri Jul 24 23:51:08 2020 (r363502) +++ stable/12/sys/kern/vfs_cache.c Sat Jul 25 00:01:57 2020 (r363503) @@ -91,10 +91,10 @@ SDT_PROBE_DEFINE1(vfs, namecache, purge_negative, done SDT_PROBE_DEFINE1(vfs, namecache, purgevfs, done, "struct mount *"); SDT_PROBE_DEFINE3(vfs, namecache, zap, done, "struct vnode *", "char *", "struct vnode *"); -SDT_PROBE_DEFINE3(vfs, namecache, zap_negative, done, "struct vnode *", - "char *", "int"); -SDT_PROBE_DEFINE3(vfs, namecache, shrink_negative, done, "struct vnode *", - "char *", "int"); +SDT_PROBE_DEFINE2(vfs, namecache, zap_negative, done, "struct vnode *", + "char *"); +SDT_PROBE_DEFINE2(vfs, namecache, shrink_negative, done, "struct vnode *", + "char *"); /* * This structure describes the elements in the cache of recent @@ -108,7 +108,6 @@ struct namecache { struct vnode *nc_dvp; /* vnode of parent of name */ union { struct vnode *nu_vp; /* vnode the name refers to */ - u_int nu_neghits; /* negative entry hits */ } n_un; u_char nc_flag; /* flag bits */ u_char nc_nlen; /* length of name */ @@ -131,7 +130,6 @@ struct namecache_ts { }; #define nc_vp n_un.nu_vp -#define nc_neghits n_un.nu_neghits /* * Flags in namecache.nc_flag @@ -201,31 +199,22 @@ static __read_mostly LIST_HEAD(nchashhead, namecache) static u_long __read_mostly nchash; /* size of hash table */ SYSCTL_ULONG(_debug, OID_AUTO, nchash, CTLFLAG_RD, &nchash, 0, "Size of namecache hash table"); -static u_long __read_mostly ncnegfactor = 12; /* ratio of negative entries */ +static u_long __read_mostly ncnegfactor = 5; /* ratio of negative entries */ SYSCTL_ULONG(_vfs, OID_AUTO, ncnegfactor, CTLFLAG_RW, &ncnegfactor, 0, "Ratio of negative namecache entries"); static u_long __exclusive_cache_line numneg; /* number of negative entries allocated */ -SYSCTL_ULONG(_debug, OID_AUTO, numneg, CTLFLAG_RD, &numneg, 0, - "Number of negative entries in namecache"); static u_long __exclusive_cache_line numcache;/* number of cache entries allocated */ -SYSCTL_ULONG(_debug, OID_AUTO, numcache, CTLFLAG_RD, &numcache, 0, - "Number of namecache entries"); -static u_long __exclusive_cache_line numcachehv;/* number of cache entries with vnodes held */ -SYSCTL_ULONG(_debug, OID_AUTO, numcachehv, CTLFLAG_RD, &numcachehv, 0, - "Number of namecache entries with vnodes held"); -u_int __read_mostly ncsizefactor = 2; +u_int ncsizefactor = 2; SYSCTL_UINT(_vfs, OID_AUTO, ncsizefactor, CTLFLAG_RW, &ncsizefactor, 0, "Size factor for namecache"); static u_int __read_mostly ncpurgeminvnodes; SYSCTL_UINT(_vfs, OID_AUTO, ncpurgeminvnodes, CTLFLAG_RW, &ncpurgeminvnodes, 0, "Number of vnodes below which purgevfs ignores the request"); -static u_int __read_mostly ncneghitsrequeue = 8; -SYSCTL_UINT(_vfs, OID_AUTO, ncneghitsrequeue, CTLFLAG_RW, &ncneghitsrequeue, 0, - "Number of hits to requeue a negative entry in the LRU list"); +static u_int __read_mostly ncsize; /* the size as computed on creation or resizing */ struct nchstats nchstats; /* cache effectiveness statistics */ -static struct mtx ncneg_shrink_lock; +static struct mtx __exclusive_cache_line ncneg_shrink_lock; static int shrink_list_turn; struct neglist { @@ -235,6 +224,7 @@ struct neglist { static struct neglist __read_mostly *neglists; static struct neglist ncneg_hot; +static u_long numhotneg; #define numneglists (ncneghash + 1) static u_int __read_mostly ncneghash; @@ -358,6 +348,7 @@ static SYSCTL_NODE(_vfs, OID_AUTO, cache, CTLFLAG_RW, SYSCTL_COUNTER_U64(_vfs_cache, OID_AUTO, name, CTLFLAG_RD, &name, descr); STATNODE_ULONG(numneg, "Number of negative cache entries"); STATNODE_ULONG(numcache, "Number of cache entries"); +STATNODE_COUNTER(numcachehv, "Number of namecache entries with vnodes held"); STATNODE_COUNTER(numcalls, "Number of cache lookups"); STATNODE_COUNTER(dothits, "Number of '.' hits"); STATNODE_COUNTER(dotdothits, "Number of '..' hits"); @@ -377,11 +368,20 @@ STATNODE_COUNTER(numfullpathfail2, "Number of fullpath search errors (VOP_VPTOCNP failures)"); STATNODE_COUNTER(numfullpathfail4, "Number of fullpath search errors (ENOMEM)"); STATNODE_COUNTER(numfullpathfound, "Number of successful fullpath calls"); +STATNODE_COUNTER(zap_and_exit_bucket_relock_success, + "Number of successful removals after relocking"); static long zap_and_exit_bucket_fail; STATNODE_ULONG(zap_and_exit_bucket_fail, "Number of times zap_and_exit failed to lock"); +static long zap_and_exit_bucket_fail2; STATNODE_ULONG(zap_and_exit_bucket_fail2, + "Number of times zap_and_exit failed to lock"); static long cache_lock_vnodes_cel_3_failures; STATNODE_ULONG(cache_lock_vnodes_cel_3_failures, "Number of times 3-way vnode locking failed"); +STATNODE_ULONG(numhotneg, "Number of hot negative entries"); +STATNODE_COUNTER(numneg_evicted, + "Number of negative entries evicted when adding a new entry"); +STATNODE_COUNTER(shrinking_skipped, + "Number of times shrinking was already in progress"); static void cache_zap_locked(struct namecache *ncp, bool neg_locked); static int vn_fullpath1(struct thread *td, struct vnode *vp, struct vnode *rdir, @@ -393,7 +393,7 @@ static int cache_yield; SYSCTL_INT(_vfs_cache, OID_AUTO, yield, CTLFLAG_RD, &cache_yield, 0, "Number of times cache called yield"); -static void +static void __noinline cache_maybe_yield(void) { @@ -452,12 +452,14 @@ cache_assert_bucket_locked(struct namecache *ncp, int #define cache_assert_bucket_locked(x, y) do { } while (0) #endif -#define cache_sort(x, y) _cache_sort((void **)(x), (void **)(y)) +#define cache_sort_vnodes(x, y) _cache_sort_vnodes((void **)(x), (void **)(y)) static void -_cache_sort(void **p1, void **p2) +_cache_sort_vnodes(void **p1, void **p2) { void *tmp; + MPASS(*p1 != NULL || *p2 != NULL); + if (*p1 > *p2) { tmp = *p2; *p2 = *p1; @@ -505,8 +507,7 @@ static int cache_trylock_vnodes(struct mtx *vlp1, struct mtx *vlp2) { - cache_sort(&vlp1, &vlp2); - MPASS(vlp2 != NULL); + cache_sort_vnodes(&vlp1, &vlp2); if (vlp1 != NULL) { if (!mtx_trylock(vlp1)) @@ -522,6 +523,19 @@ cache_trylock_vnodes(struct mtx *vlp1, struct mtx *vlp } static void +cache_lock_vnodes(struct mtx *vlp1, struct mtx *vlp2) +{ + + MPASS(vlp1 != NULL || vlp2 != NULL); + MPASS(vlp1 <= vlp2); + + if (vlp1 != NULL) + mtx_lock(vlp1); + if (vlp2 != NULL) + mtx_lock(vlp2); +} + +static void cache_unlock_vnodes(struct mtx *vlp1, struct mtx *vlp2) { @@ -650,8 +664,6 @@ SYSCTL_PROC(_debug_hashstat, OID_AUTO, nchash, CTLTYPE * * A variation of LRU scheme is used. New entries are hashed into one of * numneglists cold lists. Entries get promoted to the hot list on first hit. - * Partial LRU for the hot list is maintained by requeueing them every - * ncneghitsrequeue hits. * * The shrinker will demote hot list head and evict from the cold list in a * round-robin manner. @@ -660,30 +672,15 @@ static void cache_negative_hit(struct namecache *ncp) { struct neglist *neglist; - u_int hits; MPASS(ncp->nc_flag & NCF_NEGATIVE); - hits = atomic_fetchadd_int(&ncp->nc_neghits, 1); - if (ncp->nc_flag & NCF_HOTNEGATIVE) { - if ((hits % ncneghitsrequeue) != 0) - return; - mtx_lock(&ncneg_hot.nl_lock); - if (ncp->nc_flag & NCF_HOTNEGATIVE) { - TAILQ_REMOVE(&ncneg_hot.nl_list, ncp, nc_dst); - TAILQ_INSERT_TAIL(&ncneg_hot.nl_list, ncp, nc_dst); - mtx_unlock(&ncneg_hot.nl_lock); - return; - } - /* - * The shrinker cleared the flag and removed the entry from - * the hot list. Put it back. - */ - } else { - mtx_lock(&ncneg_hot.nl_lock); - } + if (ncp->nc_flag & NCF_HOTNEGATIVE) + return; neglist = NCP2NEGLIST(ncp); + mtx_lock(&ncneg_hot.nl_lock); mtx_lock(&neglist->nl_lock); if (!(ncp->nc_flag & NCF_HOTNEGATIVE)) { + numhotneg++; TAILQ_REMOVE(&neglist->nl_list, ncp, nc_dst); TAILQ_INSERT_TAIL(&ncneg_hot.nl_list, ncp, nc_dst); ncp->nc_flag |= NCF_HOTNEGATIVE; @@ -737,6 +734,7 @@ cache_negative_remove(struct namecache *ncp, bool neg_ if (ncp->nc_flag & NCF_HOTNEGATIVE) { mtx_assert(&ncneg_hot.nl_lock, MA_OWNED); TAILQ_REMOVE(&ncneg_hot.nl_list, ncp, nc_dst); + numhotneg--; } else { mtx_assert(&neglist->nl_lock, MA_OWNED); TAILQ_REMOVE(&neglist->nl_list, ncp, nc_dst); @@ -782,8 +780,11 @@ cache_negative_zap_one(void) struct mtx *dvlp; struct rwlock *blp; - if (!mtx_trylock(&ncneg_shrink_lock)) + if (mtx_owner(&ncneg_shrink_lock) != NULL || + !mtx_trylock(&ncneg_shrink_lock)) { + counter_u64_add(shrinking_skipped, 1); return; + } mtx_lock(&ncneg_hot.nl_lock); ncp = TAILQ_FIRST(&ncneg_hot.nl_list); @@ -793,8 +794,10 @@ cache_negative_zap_one(void) TAILQ_REMOVE(&ncneg_hot.nl_list, ncp, nc_dst); TAILQ_INSERT_TAIL(&neglist->nl_list, ncp, nc_dst); ncp->nc_flag &= ~NCF_HOTNEGATIVE; + numhotneg--; mtx_unlock(&neglist->nl_lock); } + mtx_unlock(&ncneg_hot.nl_lock); cache_negative_shrink_select(shrink_list_turn, &ncp, &neglist); shrink_list_turn++; @@ -802,16 +805,14 @@ cache_negative_zap_one(void) shrink_list_turn = 0; if (ncp == NULL && shrink_list_turn == 0) cache_negative_shrink_select(shrink_list_turn, &ncp, &neglist); - if (ncp == NULL) { - mtx_unlock(&ncneg_hot.nl_lock); - goto out; - } + mtx_unlock(&ncneg_shrink_lock); + if (ncp == NULL) + return; MPASS(ncp->nc_flag & NCF_NEGATIVE); dvlp = VP2VNODELOCK(ncp->nc_dvp); blp = NCP2BUCKETLOCK(ncp); mtx_unlock(&neglist->nl_lock); - mtx_unlock(&ncneg_hot.nl_lock); mtx_lock(dvlp); rw_wlock(blp); mtx_lock(&neglist->nl_lock); @@ -819,18 +820,16 @@ cache_negative_zap_one(void) if (ncp != ncp2 || dvlp != VP2VNODELOCK(ncp2->nc_dvp) || blp != NCP2BUCKETLOCK(ncp2) || !(ncp2->nc_flag & NCF_NEGATIVE)) { ncp = NULL; - goto out_unlock_all; - } - SDT_PROBE3(vfs, namecache, shrink_negative, done, ncp->nc_dvp, - ncp->nc_name, ncp->nc_neghits); + } else { + SDT_PROBE2(vfs, namecache, shrink_negative, done, ncp->nc_dvp, + ncp->nc_name); - cache_zap_locked(ncp, true); -out_unlock_all: + cache_zap_locked(ncp, true); + counter_u64_add(numneg_evicted, 1); + } mtx_unlock(&neglist->nl_lock); rw_wunlock(blp); mtx_unlock(dvlp); -out: - mtx_unlock(&ncneg_shrink_lock); cache_free(ncp); } @@ -851,19 +850,16 @@ cache_zap_locked(struct namecache *ncp, bool neg_locke CTR2(KTR_VFS, "cache_zap(%p) vp %p", ncp, (ncp->nc_flag & NCF_NEGATIVE) ? NULL : ncp->nc_vp); + LIST_REMOVE(ncp, nc_hash); if (!(ncp->nc_flag & NCF_NEGATIVE)) { SDT_PROBE3(vfs, namecache, zap, done, ncp->nc_dvp, ncp->nc_name, ncp->nc_vp); - } else { - SDT_PROBE3(vfs, namecache, zap_negative, done, ncp->nc_dvp, - ncp->nc_name, ncp->nc_neghits); - } - LIST_REMOVE(ncp, nc_hash); - if (!(ncp->nc_flag & NCF_NEGATIVE)) { TAILQ_REMOVE(&ncp->nc_vp->v_cache_dst, ncp, nc_dst); if (ncp == ncp->nc_vp->v_cache_dd) ncp->nc_vp->v_cache_dd = NULL; } else { + SDT_PROBE2(vfs, namecache, zap_negative, done, ncp->nc_dvp, + ncp->nc_name); cache_negative_remove(ncp, neg_locked); } if (ncp->nc_flag & NCF_ISDOTDOT) { @@ -873,7 +869,7 @@ cache_zap_locked(struct namecache *ncp, bool neg_locke LIST_REMOVE(ncp, nc_src); if (LIST_EMPTY(&ncp->nc_dvp->v_cache_src)) { ncp->nc_flag |= NCF_DVDROP; - atomic_subtract_rel_long(&numcachehv, 1); + counter_u64_add(numcachehv, -1); } } atomic_subtract_rel_long(&numcache, 1); @@ -926,7 +922,7 @@ cache_zap_locked_vnode_kl2(struct namecache *ncp, stru mtx_unlock(*vlpp); *vlpp = NULL; } - cache_sort(&vlp1, &vlp2); + cache_sort_vnodes(&vlp1, &vlp2); if (vlp1 == pvlp) { mtx_lock(vlp2); to_unlock = vlp2; @@ -952,7 +948,7 @@ out_relock: return (false); } -static int +static int __noinline cache_zap_locked_vnode(struct namecache *ncp, struct vnode *vp) { struct mtx *pvlp, *vlp1, *vlp2, *to_unlock; @@ -971,7 +967,7 @@ cache_zap_locked_vnode(struct namecache *ncp, struct v blp = NCP2BUCKETLOCK(ncp); vlp1 = VP2VNODELOCK(ncp->nc_dvp); vlp2 = VP2VNODELOCK(ncp->nc_vp); - cache_sort(&vlp1, &vlp2); + cache_sort_vnodes(&vlp1, &vlp2); if (vlp1 == pvlp) { mtx_lock(vlp2); to_unlock = vlp2; @@ -991,10 +987,47 @@ out: return (error); } +/* + * If trylocking failed we can get here. We know enough to take all needed locks + * in the right order and re-lookup the entry. + */ static int -cache_zap_wlocked_bucket(struct namecache *ncp, struct rwlock *blp) +cache_zap_unlocked_bucket(struct namecache *ncp, struct componentname *cnp, + struct vnode *dvp, struct mtx *dvlp, struct mtx *vlp, uint32_t hash, + struct rwlock *blp) { + struct namecache *rncp; + + cache_assert_bucket_locked(ncp, RA_UNLOCKED); + + cache_sort_vnodes(&dvlp, &vlp); + cache_lock_vnodes(dvlp, vlp); + rw_wlock(blp); + LIST_FOREACH(rncp, (NCHHASH(hash)), nc_hash) { + if (rncp == ncp && rncp->nc_dvp == dvp && + rncp->nc_nlen == cnp->cn_namelen && + !bcmp(rncp->nc_name, cnp->cn_nameptr, rncp->nc_nlen)) + break; + } + if (rncp != NULL) { + cache_zap_locked(rncp, false); + rw_wunlock(blp); + cache_unlock_vnodes(dvlp, vlp); + counter_u64_add(zap_and_exit_bucket_relock_success, 1); + return (0); + } + + rw_wunlock(blp); + cache_unlock_vnodes(dvlp, vlp); + return (EAGAIN); +} + +static int __noinline +cache_zap_wlocked_bucket(struct namecache *ncp, struct componentname *cnp, + uint32_t hash, struct rwlock *blp) +{ struct mtx *dvlp, *vlp; + struct vnode *dvp; cache_assert_bucket_locked(ncp, RA_WLOCKED); @@ -1009,14 +1042,17 @@ cache_zap_wlocked_bucket(struct namecache *ncp, struct return (0); } + dvp = ncp->nc_dvp; rw_wunlock(blp); - return (EAGAIN); + return (cache_zap_unlocked_bucket(ncp, cnp, dvp, dvlp, vlp, hash, blp)); } -static int -cache_zap_rlocked_bucket(struct namecache *ncp, struct rwlock *blp) +static int __noinline +cache_zap_rlocked_bucket(struct namecache *ncp, struct componentname *cnp, + uint32_t hash, struct rwlock *blp) { struct mtx *dvlp, *vlp; + struct vnode *dvp; cache_assert_bucket_locked(ncp, RA_RLOCKED); @@ -1033,8 +1069,9 @@ cache_zap_rlocked_bucket(struct namecache *ncp, struct return (0); } + dvp = ncp->nc_dvp; rw_runlock(blp); - return (EAGAIN); + return (cache_zap_unlocked_bucket(ncp, cnp, dvp, dvlp, vlp, hash, blp)); } static int @@ -1049,7 +1086,7 @@ cache_zap_wlocked_bucket_kl(struct namecache *ncp, str vlp = NULL; if (!(ncp->nc_flag & NCF_NEGATIVE)) vlp = VP2VNODELOCK(ncp->nc_vp); - cache_sort(&dvlp, &vlp); + cache_sort_vnodes(&dvlp, &vlp); if (*vlpp1 == dvlp && *vlpp2 == vlp) { cache_zap_locked(ncp, false); @@ -1196,14 +1233,13 @@ retry: goto out_no_entry; } - counter_u64_add(numposzaps, 1); - - error = cache_zap_wlocked_bucket(ncp, blp); - if (error != 0) { + error = cache_zap_wlocked_bucket(ncp, cnp, hash, blp); + if (__predict_false(error != 0)) { zap_and_exit_bucket_fail++; cache_maybe_yield(); goto retry; } + counter_u64_add(numposzaps, 1); cache_free(ncp); return (0); out_no_entry: @@ -1323,7 +1359,7 @@ retry: } /* We failed to find an entry */ - if (ncp == NULL) { + if (__predict_false(ncp == NULL)) { rw_runlock(blp); SDT_PROBE3(vfs, namecache, lookup, miss, dvp, cnp->cn_nameptr, NULL); @@ -1331,35 +1367,17 @@ retry: return (0); } - /* We found a "positive" match, return the vnode */ - if (!(ncp->nc_flag & NCF_NEGATIVE)) { - counter_u64_add(numposhits, 1); - *vpp = ncp->nc_vp; - CTR4(KTR_VFS, "cache_lookup(%p, %s) found %p via ncp %p", - dvp, cnp->cn_nameptr, *vpp, ncp); - SDT_PROBE3(vfs, namecache, lookup, hit, dvp, ncp->nc_name, - *vpp); - cache_out_ts(ncp, tsp, ticksp); - goto success; - } + if (ncp->nc_flag & NCF_NEGATIVE) + goto negative_success; -negative_success: - /* We found a negative match, and want to create it, so purge */ - if (cnp->cn_nameiop == CREATE) { - counter_u64_add(numnegzaps, 1); - goto zap_and_exit; - } - - counter_u64_add(numneghits, 1); - cache_negative_hit(ncp); - if (ncp->nc_flag & NCF_WHITE) - cnp->cn_flags |= ISWHITEOUT; - SDT_PROBE2(vfs, namecache, lookup, hit__negative, dvp, - ncp->nc_name); + /* We found a "positive" match, return the vnode */ + counter_u64_add(numposhits, 1); + *vpp = ncp->nc_vp; + CTR4(KTR_VFS, "cache_lookup(%p, %s) found %p via ncp %p", + dvp, cnp->cn_nameptr, *vpp, ncp); + SDT_PROBE3(vfs, namecache, lookup, hit, dvp, ncp->nc_name, + *vpp); cache_out_ts(ncp, tsp, ticksp); - cache_lookup_unlock(blp, dvlp); - return (ENOENT); - success: /* * On success we return a locked and ref'd vnode as per the lookup @@ -1393,13 +1411,30 @@ success: } return (-1); +negative_success: + /* We found a negative match, and want to create it, so purge */ + if (cnp->cn_nameiop == CREATE) { + counter_u64_add(numnegzaps, 1); + goto zap_and_exit; + } + + counter_u64_add(numneghits, 1); + cache_negative_hit(ncp); + if (ncp->nc_flag & NCF_WHITE) + cnp->cn_flags |= ISWHITEOUT; + SDT_PROBE2(vfs, namecache, lookup, hit__negative, dvp, + ncp->nc_name); + cache_out_ts(ncp, tsp, ticksp); + cache_lookup_unlock(blp, dvlp); + return (ENOENT); + zap_and_exit: if (blp != NULL) - error = cache_zap_rlocked_bucket(ncp, blp); + error = cache_zap_rlocked_bucket(ncp, cnp, hash, blp); else error = cache_zap_locked_vnode(ncp, dvp); - if (error != 0) { - zap_and_exit_bucket_fail++; + if (__predict_false(error != 0)) { + zap_and_exit_bucket_fail2++; cache_maybe_yield(); goto retry; } @@ -1435,7 +1470,7 @@ cache_lock_vnodes_cel(struct celockstate *cel, struct vlp1 = VP2VNODELOCK(vp); vlp2 = VP2VNODELOCK(dvp); - cache_sort(&vlp1, &vlp2); + cache_sort_vnodes(&vlp1, &vlp2); if (vlp1 != NULL) { mtx_lock(vlp1); @@ -1505,7 +1540,7 @@ cache_lock_buckets_cel(struct celockstate *cel, struct MPASS(cel->blp[0] == NULL); MPASS(cel->blp[1] == NULL); - cache_sort(&blp1, &blp2); + cache_sort_vnodes(&blp1, &blp2); if (blp1 != NULL) { rw_wlock(blp1); @@ -1619,6 +1654,33 @@ cache_enter_unlock(struct celockstate *cel) cache_unlock_vnodes_cel(cel); } +static void __noinline +cache_enter_dotdot_prep(struct vnode *dvp, struct vnode *vp, + struct componentname *cnp) +{ + struct celockstate cel; + struct namecache *ncp; + uint32_t hash; + int len; + + if (dvp->v_cache_dd == NULL) + return; + len = cnp->cn_namelen; + cache_celockstate_init(&cel); + hash = cache_get_hash(cnp->cn_nameptr, len, dvp); + cache_enter_lock_dd(&cel, dvp, vp, hash); + ncp = dvp->v_cache_dd; + if (ncp != NULL && (ncp->nc_flag & NCF_ISDOTDOT)) { + KASSERT(ncp->nc_dvp == dvp, ("wrong isdotdot parent")); + cache_zap_locked(ncp, false); + } else { + ncp = NULL; + } + dvp->v_cache_dd = NULL; + cache_enter_unlock(&cel); + cache_free(ncp); +} + /* * Add an entry to the cache. */ @@ -1630,12 +1692,10 @@ cache_enter_time(struct vnode *dvp, struct vnode *vp, struct namecache *ncp, *n2, *ndd; struct namecache_ts *ncp_ts, *n2_ts; struct nchashhead *ncpp; - struct neglist *neglist; uint32_t hash; int flag; int len; - bool neg_locked; - int lnumcache; + u_long lnumcache; CTR3(KTR_VFS, "cache_enter(%p, %p, %s)", dvp, vp, cnp->cn_nameptr); VNASSERT(vp == NULL || (vp->v_iflag & VI_DOOMED) == 0, vp, @@ -1646,69 +1706,28 @@ cache_enter_time(struct vnode *dvp, struct vnode *vp, if (__predict_false(!doingcache)) return; + flag = 0; + if (__predict_false(cnp->cn_nameptr[0] == '.')) { + if (cnp->cn_namelen == 1) + return; + if (cnp->cn_namelen == 2 && cnp->cn_nameptr[1] == '.') { + cache_enter_dotdot_prep(dvp, vp, cnp); + flag = NCF_ISDOTDOT; + } + } + /* * Avoid blowout in namecache entries. */ - if (__predict_false(numcache >= desiredvnodes * ncsizefactor)) + lnumcache = atomic_fetchadd_long(&numcache, 1) + 1; + if (__predict_false(lnumcache >= ncsize)) { + atomic_add_long(&numcache, -1); return; + } cache_celockstate_init(&cel); ndd = NULL; ncp_ts = NULL; - flag = 0; - if (cnp->cn_nameptr[0] == '.') { - if (cnp->cn_namelen == 1) - return; - if (cnp->cn_namelen == 2 && cnp->cn_nameptr[1] == '.') { - len = cnp->cn_namelen; - hash = cache_get_hash(cnp->cn_nameptr, len, dvp); - cache_enter_lock_dd(&cel, dvp, vp, hash); - /* - * If dotdot entry already exists, just retarget it - * to new parent vnode, otherwise continue with new - * namecache entry allocation. - */ - if ((ncp = dvp->v_cache_dd) != NULL && - ncp->nc_flag & NCF_ISDOTDOT) { - KASSERT(ncp->nc_dvp == dvp, - ("wrong isdotdot parent")); - neg_locked = false; - if (ncp->nc_flag & NCF_NEGATIVE || vp == NULL) { - neglist = NCP2NEGLIST(ncp); - mtx_lock(&ncneg_hot.nl_lock); - mtx_lock(&neglist->nl_lock); - neg_locked = true; - } - if (!(ncp->nc_flag & NCF_NEGATIVE)) { - TAILQ_REMOVE(&ncp->nc_vp->v_cache_dst, - ncp, nc_dst); - } else { - cache_negative_remove(ncp, true); - } - if (vp != NULL) { - TAILQ_INSERT_HEAD(&vp->v_cache_dst, - ncp, nc_dst); - ncp->nc_flag &= ~(NCF_NEGATIVE|NCF_HOTNEGATIVE); - } else { - ncp->nc_flag &= ~(NCF_HOTNEGATIVE); - ncp->nc_flag |= NCF_NEGATIVE; - cache_negative_insert(ncp, true); - } - if (neg_locked) { - mtx_unlock(&neglist->nl_lock); - mtx_unlock(&ncneg_hot.nl_lock); - } - ncp->nc_vp = vp; - cache_enter_unlock(&cel); - return; - } - dvp->v_cache_dd = NULL; - cache_enter_unlock(&cel); - cache_celockstate_init(&cel); - SDT_PROBE3(vfs, namecache, enter, done, dvp, "..", vp); - flag = NCF_ISDOTDOT; - } - } /* * Calculate the hash key and setup as much of the new @@ -1800,7 +1819,7 @@ cache_enter_time(struct vnode *dvp, struct vnode *vp, if (flag != NCF_ISDOTDOT) { if (LIST_EMPTY(&dvp->v_cache_src)) { vhold(dvp); - atomic_add_rel_long(&numcachehv, 1); + counter_u64_add(numcachehv, 1); } LIST_INSERT_HEAD(&dvp->v_cache_src, ncp, nc_src); } @@ -1828,7 +1847,6 @@ cache_enter_time(struct vnode *dvp, struct vnode *vp, ncp->nc_name); } cache_enter_unlock(&cel); - lnumcache = atomic_fetchadd_long(&numcache, 1) + 1; if (numneg * ncnegfactor > lnumcache) cache_negative_zap_one(); cache_free(ndd); @@ -1875,20 +1893,23 @@ nchinit(void *dummy __unused) NULL, NULL, NULL, NULL, UMA_ALIGNOF(struct namecache_ts), UMA_ZONE_ZINIT); + ncsize = desiredvnodes * ncsizefactor; nchashtbl = hashinit(desiredvnodes * 2, M_VFSCACHE, &nchash); - ncbuckethash = cache_roundup_2(mp_ncpus * 64) - 1; + ncbuckethash = cache_roundup_2(mp_ncpus * mp_ncpus) - 1; + if (ncbuckethash < 7) /* arbitrarily chosen to avoid having one lock */ + ncbuckethash = 7; if (ncbuckethash > nchash) ncbuckethash = nchash; bucketlocks = malloc(sizeof(*bucketlocks) * numbucketlocks, M_VFSCACHE, M_WAITOK | M_ZERO); for (i = 0; i < numbucketlocks; i++) rw_init_flags(&bucketlocks[i], "ncbuc", RW_DUPOK | RW_RECURSE); - ncvnodehash = cache_roundup_2(mp_ncpus * 64) - 1; + ncvnodehash = ncbuckethash; vnodelocks = malloc(sizeof(*vnodelocks) * numvnodelocks, M_VFSCACHE, M_WAITOK | M_ZERO); for (i = 0; i < numvnodelocks; i++) mtx_init(&vnodelocks[i], "ncvn", NULL, MTX_DUPOK | MTX_RECURSE); - ncpurgeminvnodes = numbucketlocks; + ncpurgeminvnodes = numbucketlocks * 2; ncneghash = 3; neglists = malloc(sizeof(*neglists) * numneglists, M_VFSCACHE, @@ -1902,6 +1923,7 @@ nchinit(void *dummy __unused) mtx_init(&ncneg_shrink_lock, "ncnegs", NULL, MTX_DEF); + numcachehv = counter_u64_alloc(M_WAITOK); numcalls = counter_u64_alloc(M_WAITOK); dothits = counter_u64_alloc(M_WAITOK); dotdothits = counter_u64_alloc(M_WAITOK); @@ -1917,6 +1939,9 @@ nchinit(void *dummy __unused) numfullpathfail2 = counter_u64_alloc(M_WAITOK); numfullpathfail4 = counter_u64_alloc(M_WAITOK); numfullpathfound = counter_u64_alloc(M_WAITOK); + zap_and_exit_bucket_relock_success = counter_u64_alloc(M_WAITOK); + numneg_evicted = counter_u64_alloc(M_WAITOK); + shrinking_skipped = counter_u64_alloc(M_WAITOK); } SYSINIT(vfs, SI_SUB_VFS, SI_ORDER_SECOND, nchinit, NULL); @@ -1927,8 +1952,10 @@ cache_changesize(int newmaxvnodes) u_long new_nchash, old_nchash; struct namecache *ncp; uint32_t hash; + int newncsize; int i; + newncsize = newmaxvnodes * ncsizefactor; newmaxvnodes = cache_roundup_2(newmaxvnodes * 2); if (newmaxvnodes < numbucketlocks) newmaxvnodes = numbucketlocks; @@ -1958,6 +1985,7 @@ cache_changesize(int newmaxvnodes) LIST_INSERT_HEAD(NCHHASH(hash), ncp, nc_hash); } } + ncsize = newncsize; cache_unlock_all_buckets(); cache_unlock_all_vnodes(); free(old_nchashtbl, M_VFSCACHE); From owner-svn-src-all@freebsd.org Sat Jul 25 00:03:24 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A19A33781CD; Sat, 25 Jul 2020 00:03:24 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BD5rD3mcFz4S44; Sat, 25 Jul 2020 00:03:24 +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 65CAF12BFC; Sat, 25 Jul 2020 00:03:24 +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 06P03OO9041167; Sat, 25 Jul 2020 00:03:24 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06P03OuB041166; Sat, 25 Jul 2020 00:03:24 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202007250003.06P03OuB041166@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Sat, 25 Jul 2020 00:03:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r363504 - stable/12/sys/kern X-SVN-Group: stable-12 X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: stable/12/sys/kern X-SVN-Commit-Revision: 363504 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 25 Jul 2020 00:03:24 -0000 Author: mjg Date: Sat Jul 25 00:03:23 2020 New Revision: 363504 URL: https://svnweb.freebsd.org/changeset/base/363504 Log: MFC r363297: Short-circuit tdfind when looking for the calling thread. Modified: stable/12/sys/kern/kern_thread.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/kern/kern_thread.c ============================================================================== --- stable/12/sys/kern/kern_thread.c Sat Jul 25 00:01:57 2020 (r363503) +++ stable/12/sys/kern/kern_thread.c Sat Jul 25 00:03:23 2020 (r363504) @@ -1260,6 +1260,14 @@ tdfind(lwpid_t tid, pid_t pid) struct thread *td; int run = 0; + td = curthread; + if (td->td_tid == tid) { + if (pid != -1 && td->td_proc->p_pid != pid) + return (NULL); + PROC_LOCK(td->td_proc); + return (td); + } + rw_rlock(&tidhash_lock); LIST_FOREACH(td, TIDHASH(tid), td_hash) { if (td->td_tid == tid) { From owner-svn-src-all@freebsd.org Sat Jul 25 00:24:12 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 60E3A378A8B; Sat, 25 Jul 2020 00:24: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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BD6JD1zrCz4Sxy; Sat, 25 Jul 2020 00:24:12 +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 28AF612ED4; Sat, 25 Jul 2020 00:24:12 +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 06P0OCiA053638; Sat, 25 Jul 2020 00:24:12 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06P0OBOp053636; Sat, 25 Jul 2020 00:24:11 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202007250024.06P0OBOp053636@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Sat, 25 Jul 2020 00:24:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r363505 - in stable/12: lib/libc/amd64/string sys/amd64/amd64 X-SVN-Group: stable-12 X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: in stable/12: lib/libc/amd64/string sys/amd64/amd64 X-SVN-Commit-Revision: 363505 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 25 Jul 2020 00:24:12 -0000 Author: mjg Date: Sat Jul 25 00:24:11 2020 New Revision: 363505 URL: https://svnweb.freebsd.org/changeset/base/363505 Log: MFC r357208,r357309,r357239,r357310 amd64: revamp memcmp amd64: speed up failing case for memcmp amd64: sync up libc memcmp with the kernel version (r357208) amd64: sync up libc memcmp with the kernel version (r357309) Modified: stable/12/lib/libc/amd64/string/memcmp.S stable/12/sys/amd64/amd64/support.S Directory Properties: stable/12/ (props changed) Modified: stable/12/lib/libc/amd64/string/memcmp.S ============================================================================== --- stable/12/lib/libc/amd64/string/memcmp.S Sat Jul 25 00:03:23 2020 (r363504) +++ stable/12/lib/libc/amd64/string/memcmp.S Sat Jul 25 00:24:11 2020 (r363505) @@ -31,91 +31,176 @@ #include __FBSDID("$FreeBSD$"); +#define ALIGN_TEXT .p2align 4,0x90 /* 16-byte alignment, nop filled */ + ENTRY(memcmp) - cmpq $16,%rdx - jae 5f -1: - testq %rdx,%rdx - je 3f - xorl %ecx,%ecx -2: - movzbl (%rdi,%rcx,1),%eax - movzbl (%rsi,%rcx,1),%r8d - cmpb %r8b,%al - jne 4f - addq $1,%rcx - cmpq %rcx,%rdx - jz 3f - movzbl (%rdi,%rcx,1),%eax - movzbl (%rsi,%rcx,1),%r8d - cmpb %r8b,%al - jne 4f - addq $1,%rcx - cmpq %rcx,%rdx - jz 3f - movzbl (%rdi,%rcx,1),%eax - movzbl (%rsi,%rcx,1),%r8d - cmpb %r8b,%al - jne 4f - addq $1,%rcx - cmpq %rcx,%rdx - jz 3f - movzbl (%rdi,%rcx,1),%eax - movzbl (%rsi,%rcx,1),%r8d - cmpb %r8b,%al - jne 4f - addq $1,%rcx - cmpq %rcx,%rdx - jne 2b -3: xorl %eax,%eax +10: + cmpq $16,%rdx + ja 101632f + +100816: + cmpb $8,%dl + jl 100408f + movq (%rdi),%r8 + movq (%rsi),%r9 + cmpq %r8,%r9 + jne 80f + movq -8(%rdi,%rdx),%r8 + movq -8(%rsi,%rdx),%r9 + cmpq %r8,%r9 + jne 10081608f ret -4: +100408: + cmpb $4,%dl + jl 100204f + movl (%rdi),%r8d + movl (%rsi),%r9d + cmpl %r8d,%r9d + jne 80f + movl -4(%rdi,%rdx),%r8d + movl -4(%rsi,%rdx),%r9d + cmpl %r8d,%r9d + jne 10040804f + ret +100204: + cmpb $2,%dl + jl 100001f + movzwl (%rdi),%r8d + movzwl (%rsi),%r9d + cmpl %r8d,%r9d + jne 1f + movzwl -2(%rdi,%rdx),%r8d + movzwl -2(%rsi,%rdx),%r9d + cmpl %r8d,%r9d + jne 1f + ret +100001: + cmpb $1,%dl + jl 100000f + movzbl (%rdi),%eax + movzbl (%rsi),%r8d subl %r8d,%eax +100000: ret -5: +ALIGN_TEXT +101632: cmpq $32,%rdx - jae 7f -6: - /* - * 8 bytes - */ + ja 103200f movq (%rdi),%r8 movq (%rsi),%r9 cmpq %r8,%r9 - jne 1b - leaq 8(%rdi),%rdi - leaq 8(%rsi),%rsi - subq $8,%rdx - cmpq $8,%rdx - jae 6b - jl 1b - jmp 3b -7: - /* - * 32 bytes - */ - movq (%rsi),%r8 + jne 80f + movq 8(%rdi),%r8 movq 8(%rsi),%r9 - subq (%rdi),%r8 - subq 8(%rdi),%r9 - or %r8,%r9 - jnz 1b + cmpq %r8,%r9 + jne 10163208f + movq -16(%rdi,%rdx),%r8 + movq -16(%rsi,%rdx),%r9 + cmpq %r8,%r9 + jne 10163216f + movq -8(%rdi,%rdx),%r8 + movq -8(%rsi,%rdx),%r9 + cmpq %r8,%r9 + jne 10163224f + ret +ALIGN_TEXT +103200: + movq (%rdi),%r8 + movq 8(%rdi),%r9 + subq (%rsi),%r8 + subq 8(%rsi),%r9 + orq %r8,%r9 + jnz 10320000f - movq 16(%rsi),%r8 - movq 24(%rsi),%r9 - subq 16(%rdi),%r8 - subq 24(%rdi),%r9 - or %r8,%r9 - jnz 1b + movq 16(%rdi),%r8 + movq 24(%rdi),%r9 + subq 16(%rsi),%r8 + subq 24(%rsi),%r9 + orq %r8,%r9 + jnz 10320016f leaq 32(%rdi),%rdi leaq 32(%rsi),%rsi subq $32,%rdx cmpq $32,%rdx - jae 7b - jnz 1b - jmp 3b + jae 103200b + cmpb $0,%dl + jne 10b + ret + +/* + * Mismatch was found. + * + * Before we compute it we narrow down the range (16 -> 8 -> 4 bytes). + */ +ALIGN_TEXT +10320016: + leaq 16(%rdi),%rdi + leaq 16(%rsi),%rsi +10320000: + movq (%rdi),%r8 + movq (%rsi),%r9 + cmpq %r8,%r9 + jne 80f + leaq 8(%rdi),%rdi + leaq 8(%rsi),%rsi + jmp 80f +ALIGN_TEXT +10081608: +10163224: + leaq -8(%rdi,%rdx),%rdi + leaq -8(%rsi,%rdx),%rsi + jmp 80f +ALIGN_TEXT +10163216: + leaq -16(%rdi,%rdx),%rdi + leaq -16(%rsi,%rdx),%rsi + jmp 80f +ALIGN_TEXT +10163208: + leaq 8(%rdi),%rdi + leaq 8(%rsi),%rsi + jmp 80f +ALIGN_TEXT +10040804: + leaq -4(%rdi,%rdx),%rdi + leaq -4(%rsi,%rdx),%rsi + jmp 1f + +ALIGN_TEXT +80: + movl (%rdi),%r8d + movl (%rsi),%r9d + cmpl %r8d,%r9d + jne 1f + leaq 4(%rdi),%rdi + leaq 4(%rsi),%rsi + +/* + * We have up to 4 bytes to inspect. + */ +1: + movzbl (%rdi),%eax + movzbl (%rsi),%r8d + cmpb %r8b,%al + jne 2f + + movzbl 1(%rdi),%eax + movzbl 1(%rsi),%r8d + cmpb %r8b,%al + jne 2f + + movzbl 2(%rdi),%eax + movzbl 2(%rsi),%r8d + cmpb %r8b,%al + jne 2f + + movzbl 3(%rdi),%eax + movzbl 3(%rsi),%r8d +2: + subl %r8d,%eax + ret END(memcmp) .section .note.GNU-stack,"",%progbits Modified: stable/12/sys/amd64/amd64/support.S ============================================================================== --- stable/12/sys/amd64/amd64/support.S Sat Jul 25 00:03:23 2020 (r363504) +++ stable/12/sys/amd64/amd64/support.S Sat Jul 25 00:24:11 2020 (r363505) @@ -107,96 +107,185 @@ END(sse2_pagezero) /* * memcmpy(b1, b2, len) - * rdi,rsi,len + * rdi,rsi,rdx */ ENTRY(memcmp) PUSH_FRAME_POINTER - cmpq $16,%rdx - jae 5f -1: - testq %rdx,%rdx - je 3f - xorl %ecx,%ecx -2: - movzbl (%rdi,%rcx,1),%eax - movzbl (%rsi,%rcx,1),%r8d - cmpb %r8b,%al - jne 4f - addq $1,%rcx - cmpq %rcx,%rdx - jz 3f - movzbl (%rdi,%rcx,1),%eax - movzbl (%rsi,%rcx,1),%r8d - cmpb %r8b,%al - jne 4f - addq $1,%rcx - cmpq %rcx,%rdx - jz 3f - movzbl (%rdi,%rcx,1),%eax - movzbl (%rsi,%rcx,1),%r8d - cmpb %r8b,%al - jne 4f - addq $1,%rcx - cmpq %rcx,%rdx - jz 3f - movzbl (%rdi,%rcx,1),%eax - movzbl (%rsi,%rcx,1),%r8d - cmpb %r8b,%al - jne 4f - addq $1,%rcx - cmpq %rcx,%rdx - jne 2b -3: + xorl %eax,%eax +10: + cmpq $16,%rdx + ja 101632f + +100816: + cmpb $8,%dl + jl 100408f + movq (%rdi),%r8 + movq (%rsi),%r9 + cmpq %r8,%r9 + jne 80f + movq -8(%rdi,%rdx),%r8 + movq -8(%rsi,%rdx),%r9 + cmpq %r8,%r9 + jne 10081608f POP_FRAME_POINTER ret -4: +100408: + cmpb $4,%dl + jl 100204f + movl (%rdi),%r8d + movl (%rsi),%r9d + cmpl %r8d,%r9d + jne 80f + movl -4(%rdi,%rdx),%r8d + movl -4(%rsi,%rdx),%r9d + cmpl %r8d,%r9d + jne 10040804f + POP_FRAME_POINTER + ret +100204: + cmpb $2,%dl + jl 100001f + movzwl (%rdi),%r8d + movzwl (%rsi),%r9d + cmpl %r8d,%r9d + jne 1f + movzwl -2(%rdi,%rdx),%r8d + movzwl -2(%rsi,%rdx),%r9d + cmpl %r8d,%r9d + jne 1f + POP_FRAME_POINTER + ret +100001: + cmpb $1,%dl + jl 100000f + movzbl (%rdi),%eax + movzbl (%rsi),%r8d subl %r8d,%eax +100000: POP_FRAME_POINTER ret -5: +ALIGN_TEXT +101632: cmpq $32,%rdx - jae 7f -6: - /* - * 8 bytes - */ - movq (%rdi),%r8 - movq (%rsi),%r9 - cmpq %r8,%r9 - jne 1b + ja 103200f + movq (%rdi),%r8 + movq (%rsi),%r9 + cmpq %r8,%r9 + jne 80f + movq 8(%rdi),%r8 + movq 8(%rsi),%r9 + cmpq %r8,%r9 + jne 10163208f + movq -16(%rdi,%rdx),%r8 + movq -16(%rsi,%rdx),%r9 + cmpq %r8,%r9 + jne 10163216f + movq -8(%rdi,%rdx),%r8 + movq -8(%rsi,%rdx),%r9 + cmpq %r8,%r9 + jne 10163224f + POP_FRAME_POINTER + ret +ALIGN_TEXT +103200: + movq (%rdi),%r8 + movq 8(%rdi),%r9 + subq (%rsi),%r8 + subq 8(%rsi),%r9 + orq %r8,%r9 + jnz 10320000f + + movq 16(%rdi),%r8 + movq 24(%rdi),%r9 + subq 16(%rsi),%r8 + subq 24(%rsi),%r9 + orq %r8,%r9 + jnz 10320016f + + leaq 32(%rdi),%rdi + leaq 32(%rsi),%rsi + subq $32,%rdx + cmpq $32,%rdx + jae 103200b + cmpb $0,%dl + jne 10b + POP_FRAME_POINTER + ret + +/* + * Mismatch was found. + * + * Before we compute it we narrow down the range (16 -> 8 -> 4 bytes). + */ +ALIGN_TEXT +10320016: + leaq 16(%rdi),%rdi + leaq 16(%rsi),%rsi +10320000: + movq (%rdi),%r8 + movq (%rsi),%r9 + cmpq %r8,%r9 + jne 80f leaq 8(%rdi),%rdi leaq 8(%rsi),%rsi - subq $8,%rdx - cmpq $8,%rdx - jae 6b - jl 1b - jmp 3b -7: - /* - * 32 bytes - */ - movq (%rsi),%r8 - movq 8(%rsi),%r9 - subq (%rdi),%r8 - subq 8(%rdi),%r9 - or %r8,%r9 - jnz 1b + jmp 80f +ALIGN_TEXT +10081608: +10163224: + leaq -8(%rdi,%rdx),%rdi + leaq -8(%rsi,%rdx),%rsi + jmp 80f +ALIGN_TEXT +10163216: + leaq -16(%rdi,%rdx),%rdi + leaq -16(%rsi,%rdx),%rsi + jmp 80f +ALIGN_TEXT +10163208: + leaq 8(%rdi),%rdi + leaq 8(%rsi),%rsi + jmp 80f +ALIGN_TEXT +10040804: + leaq -4(%rdi,%rdx),%rdi + leaq -4(%rsi,%rdx),%rsi + jmp 1f - movq 16(%rsi),%r8 - movq 24(%rsi),%r9 - subq 16(%rdi),%r8 - subq 24(%rdi),%r9 - or %r8,%r9 - jnz 1b +ALIGN_TEXT +80: + movl (%rdi),%r8d + movl (%rsi),%r9d + cmpl %r8d,%r9d + jne 1f + leaq 4(%rdi),%rdi + leaq 4(%rsi),%rsi - leaq 32(%rdi),%rdi - leaq 32(%rsi),%rsi - subq $32,%rdx - cmpq $32,%rdx - jae 7b - jnz 1b - jmp 3b +/* + * We have up to 4 bytes to inspect. + */ +1: + movzbl (%rdi),%eax + movzbl (%rsi),%r8d + cmpb %r8b,%al + jne 2f + + movzbl 1(%rdi),%eax + movzbl 1(%rsi),%r8d + cmpb %r8b,%al + jne 2f + + movzbl 2(%rdi),%eax + movzbl 2(%rsi),%r8d + cmpb %r8b,%al + jne 2f + + movzbl 3(%rdi),%eax + movzbl 3(%rsi),%r8d +2: + subl %r8d,%eax + POP_FRAME_POINTER + ret END(memcmp) /* From owner-svn-src-all@freebsd.org Sat Jul 25 00:37:36 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 36F7D378A5E; Sat, 25 Jul 2020 00:37:36 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BD6bh0Wbbz4TWk; Sat, 25 Jul 2020 00:37:36 +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 E53501302F; Sat, 25 Jul 2020 00:37:35 +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 06P0bZk8060288; Sat, 25 Jul 2020 00:37:35 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06P0bZU0060284; Sat, 25 Jul 2020 00:37:35 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202007250037.06P0bZU0060284@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Sat, 25 Jul 2020 00:37:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r363506 - in stable/12/sys: fs/devfs kern X-SVN-Group: stable-12 X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: in stable/12/sys: fs/devfs kern X-SVN-Commit-Revision: 363506 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 25 Jul 2020 00:37:36 -0000 Author: mjg Date: Sat Jul 25 00:37:34 2020 New Revision: 363506 URL: https://svnweb.freebsd.org/changeset/base/363506 Log: MFC r355228: devfs: introduce a per-dev lock to protect ->si_devsw Modified: stable/12/sys/fs/devfs/devfs_devs.c stable/12/sys/fs/devfs/devfs_int.h stable/12/sys/kern/kern_conf.c stable/12/sys/kern/subr_witness.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/fs/devfs/devfs_devs.c ============================================================================== --- stable/12/sys/fs/devfs/devfs_devs.c Sat Jul 25 00:24:11 2020 (r363505) +++ stable/12/sys/fs/devfs/devfs_devs.c Sat Jul 25 00:37:34 2020 (r363506) @@ -138,6 +138,8 @@ devfs_alloc(int flags) if (cdp == NULL) return (NULL); + mtx_init(&cdp->cdp_threadlock, "devthrd", NULL, MTX_DEF); + cdp->cdp_dirents = &cdp->cdp_dirent0; cdev = &cdp->cdp_c; @@ -180,6 +182,7 @@ devfs_free(struct cdev *cdev) devfs_free_cdp_inode(cdp->cdp_inode); if (cdp->cdp_maxdirent > 0) free(cdp->cdp_dirents, M_DEVFS2); + mtx_destroy(&cdp->cdp_threadlock); free(cdp, M_CDEVP); } Modified: stable/12/sys/fs/devfs/devfs_int.h ============================================================================== --- stable/12/sys/fs/devfs/devfs_int.h Sat Jul 25 00:24:11 2020 (r363505) +++ stable/12/sys/fs/devfs/devfs_int.h Sat Jul 25 00:37:34 2020 (r363506) @@ -70,6 +70,8 @@ struct cdev_priv { void *cdp_dtr_cb_arg; LIST_HEAD(, cdev_privdata) cdp_fdpriv; + + struct mtx cdp_threadlock; }; #define cdev2priv(c) __containerof(c, struct cdev_priv, cdp_c) Modified: stable/12/sys/kern/kern_conf.c ============================================================================== --- stable/12/sys/kern/kern_conf.c Sat Jul 25 00:24:11 2020 (r363505) +++ stable/12/sys/kern/kern_conf.c Sat Jul 25 00:37:34 2020 (r363506) @@ -186,16 +186,16 @@ dev_refthread(struct cdev *dev, int *ref) *ref = 0; return (dev->si_devsw); } - dev_lock(); + cdp = cdev2priv(dev); + mtx_lock(&cdp->cdp_threadlock); csw = dev->si_devsw; if (csw != NULL) { - cdp = cdev2priv(dev); if ((cdp->cdp_flags & CDP_SCHED_DTR) == 0) atomic_add_long(&dev->si_threadcount, 1); else csw = NULL; } - dev_unlock(); + mtx_unlock(&cdp->cdp_threadlock); *ref = 1; return (csw); } @@ -222,19 +222,21 @@ devvn_refthread(struct vnode *vp, struct cdev **devp, } csw = NULL; - dev_lock(); + VI_LOCK(vp); dev = vp->v_rdev; if (dev == NULL) { - dev_unlock(); + VI_UNLOCK(vp); return (NULL); } cdp = cdev2priv(dev); + mtx_lock(&cdp->cdp_threadlock); if ((cdp->cdp_flags & CDP_SCHED_DTR) == 0) { csw = dev->si_devsw; if (csw != NULL) atomic_add_long(&dev->si_threadcount, 1); } - dev_unlock(); + mtx_unlock(&cdp->cdp_threadlock); + VI_UNLOCK(vp); if (csw != NULL) { *devp = dev; *ref = 1; @@ -1132,20 +1134,26 @@ destroy_devl(struct cdev *dev) dev->si_flags &= ~SI_CLONELIST; } + mtx_lock(&cdp->cdp_threadlock); csw = dev->si_devsw; dev->si_devsw = NULL; /* already NULL for SI_ALIAS */ while (csw != NULL && csw->d_purge != NULL && dev->si_threadcount) { csw->d_purge(dev); + mtx_unlock(&cdp->cdp_threadlock); msleep(csw, &devmtx, PRIBIO, "devprg", hz/10); + mtx_lock(&cdp->cdp_threadlock); if (dev->si_threadcount) printf("Still %lu threads in %s\n", dev->si_threadcount, devtoname(dev)); } while (dev->si_threadcount != 0) { /* Use unique dummy wait ident */ + mtx_unlock(&cdp->cdp_threadlock); msleep(&csw, &devmtx, PRIBIO, "devdrn", hz / 10); + mtx_lock(&cdp->cdp_threadlock); } + mtx_unlock(&cdp->cdp_threadlock); dev_unlock(); if ((cdp->cdp_flags & CDP_UNREF_DTR) == 0) { /* avoid out of order notify events */ Modified: stable/12/sys/kern/subr_witness.c ============================================================================== --- stable/12/sys/kern/subr_witness.c Sat Jul 25 00:24:11 2020 (r363505) +++ stable/12/sys/kern/subr_witness.c Sat Jul 25 00:37:34 2020 (r363506) @@ -602,6 +602,7 @@ static struct witness_order_list_entry order_lists[] = { "vm map (system)", &lock_class_mtx_sleep }, { "vnode interlock", &lock_class_mtx_sleep }, { "cdev", &lock_class_mtx_sleep }, + { "devthrd", &lock_class_mtx_sleep }, { NULL, NULL }, /* * VM From owner-svn-src-all@freebsd.org Sat Jul 25 03:49:34 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9EA1A37C3EB; Sat, 25 Jul 2020 03:49:34 +0000 (UTC) (envelope-from nyan@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BDBsB3pRnz4fLg; Sat, 25 Jul 2020 03:49:34 +0000 (UTC) (envelope-from nyan@FreeBSD.org) Received: from localhost (sakura.ccs.furiru.org [IPv6:2001:2f0:104:8060::1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: nyan/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 2B6782C6C5; Sat, 25 Jul 2020 03:49:32 +0000 (UTC) (envelope-from nyan@FreeBSD.org) Date: Sat, 25 Jul 2020 12:49:11 +0900 (JST) Message-Id: <20200725.124911.256350108759170094.nyan@FreeBSD.org> To: erj@FreeBSD.org Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r362063 - head/sys/dev/e1000 From: Yoshihiro Takahashi In-Reply-To: <202006111559.05BFxnSa070435@repo.freebsd.org> References: <202006111559.05BFxnSa070435@repo.freebsd.org> X-Mailer: Mew version 6.8 on Emacs 26.3 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.33 Precedence: list List-Id: "SVN commit messages 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, 25 Jul 2020 03:49:34 -0000 Please merge this change to stable/12 branch until a proper fix is done. --- Yoshihiro Takahashi In article <202006111559.05BFxnSa070435@repo.freebsd.org> Eric Joyner writes: > Author: erj > Date: Thu Jun 11 15:59:49 2020 > New Revision: 362063 > URL: https://svnweb.freebsd.org/changeset/base/362063 > > Log: > em(4): Always reinit interface when adding/removing VLAN > > This partially reverts r361053 since there have been reports > by users that this breaks some functionality for em(4) > devices; it seems at first glance that some sort of interface > restart is required for those cards. > > This isn't a proper fix; this unbreaks those users until a proper > fix is found for their issues. > > PR: 240818 > Reported by: Marek Zarychta > MFC after: 3 days > > Modified: > head/sys/dev/e1000/if_em.c > > Modified: head/sys/dev/e1000/if_em.c > ============================================================================== > --- head/sys/dev/e1000/if_em.c Thu Jun 11 15:17:13 2020 (r362062) > +++ head/sys/dev/e1000/if_em.c Thu Jun 11 15:59:49 2020 (r362063) > @@ -4059,7 +4059,6 @@ em_if_needs_restart(if_ctx_t ctx __unused, enum iflib_ > { > switch (event) { > case IFLIB_RESTART_VLAN_CONFIG: > - return (false); > default: > return (true); > } From owner-svn-src-all@freebsd.org Sat Jul 25 04:13:38 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id ECDFD37CA77; Sat, 25 Jul 2020 04:13:38 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BDCNy60M8z4g2y; Sat, 25 Jul 2020 04:13: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 B102315F0E; Sat, 25 Jul 2020 04:13: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 06P4DckQ001815; Sat, 25 Jul 2020 04:13:38 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06P4DcT8001813; Sat, 25 Jul 2020 04:13:38 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202007250413.06P4DcT8001813@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sat, 25 Jul 2020 04:13:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-svnadmin@freebsd.org Subject: svn commit: r363509 - svnadmin/conf X-SVN-Group: svnadmin X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: svnadmin/conf X-SVN-Commit-Revision: 363509 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 25 Jul 2020 04:13:39 -0000 Author: kevans Date: Sat Jul 25 04:13:38 2020 New Revision: 363509 URL: https://svnweb.freebsd.org/changeset/base/363509 Log: Welcome Rob Wing as a src committer. Rob's done some excellent work with libbe/bectl, along with assorted other improvements in userland. As they say, no good deed goes unpunished. Mentors: kevans, allanjude Approved by: core Modified: svnadmin/conf/access svnadmin/conf/mentors Modified: svnadmin/conf/access ============================================================================== --- svnadmin/conf/access Sat Jul 25 02:55:33 2020 (r363508) +++ svnadmin/conf/access Sat Jul 25 04:13:38 2020 (r363509) @@ -164,6 +164,7 @@ pluknet pstef ram ray +rew rgrimes rlibby rmacklem Modified: svnadmin/conf/mentors ============================================================================== --- svnadmin/conf/mentors Sat Jul 25 02:55:33 2020 (r363508) +++ svnadmin/conf/mentors Sat Jul 25 04:13:38 2020 (r363509) @@ -21,6 +21,7 @@ kadesai ken Co-mentor: scottl, ambrisko mjoras rstone nick philip Co-mentor: kp ram ken Co-mentor: mav +rew kevans Co-mentor: allanjude rscheff tuexen Co-mentor: rgrimes scottph scottl Co-mentor: emaste, jhb thj jtl Co-mentor: bz From owner-svn-src-all@freebsd.org Sat Jul 25 06:32:24 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9867437FF84; Sat, 25 Jul 2020 06:32:24 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BDGT43WPPz3YK7; Sat, 25 Jul 2020 06:32:24 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5CF9D17172; Sat, 25 Jul 2020 06:32:24 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06P6WOhm090817; Sat, 25 Jul 2020 06:32:24 GMT (envelope-from mmel@FreeBSD.org) Received: (from mmel@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06P6WOjS090816; Sat, 25 Jul 2020 06:32:24 GMT (envelope-from mmel@FreeBSD.org) Message-Id: <202007250632.06P6WOjS090816@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmel set sender to mmel@FreeBSD.org using -f From: Michal Meloun Date: Sat, 25 Jul 2020 06:32:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363510 - head/sys/dev/extres/clk X-SVN-Group: head X-SVN-Commit-Author: mmel X-SVN-Commit-Paths: head/sys/dev/extres/clk X-SVN-Commit-Revision: 363510 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 25 Jul 2020 06:32:24 -0000 Author: mmel Date: Sat Jul 25 06:32:23 2020 New Revision: 363510 URL: https://svnweb.freebsd.org/changeset/base/363510 Log: Revert r363123. As Emanuel poited me the Linux processes these clock assignments in forward order, not in reversed. I misread the original code. Tha problem with wrong order for assigned clocks found in tegra (and some imx) DT should be reanalyzed and solved by different way. MFC with: r363123 Reported by; manu Modified: head/sys/dev/extres/clk/clk.c Modified: head/sys/dev/extres/clk/clk.c ============================================================================== --- head/sys/dev/extres/clk/clk.c Sat Jul 25 04:13:38 2020 (r363509) +++ head/sys/dev/extres/clk/clk.c Sat Jul 25 06:32:23 2020 (r363510) @@ -1407,7 +1407,7 @@ clk_set_assigned(device_t dev, phandle_t node) if (ofw_bus_parse_xref_list_get_length(node, "assigned-clock-parents", "#clock-cells", &nparents) != 0) nparents = -1; - for (i = nclocks - 1; i >= 0; i--) { + for (i = 0; i < nclocks; i++) { /* First get the clock we are supposed to modify */ rv = clk_get_by_ofw_index_prop(dev, 0, "assigned-clocks", i, &clk); From owner-svn-src-all@freebsd.org Sat Jul 25 07:14:34 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 42BC93A1DB8; Sat, 25 Jul 2020 07:14: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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BDHPk12fmz3b8y; Sat, 25 Jul 2020 07:14: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 07AF918015; Sat, 25 Jul 2020 07:14: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 06P7EX5G016498; Sat, 25 Jul 2020 07:14:33 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06P7EXHu016497; Sat, 25 Jul 2020 07:14:33 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202007250714.06P7EXHu016497@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Sat, 25 Jul 2020 07:14:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363511 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 363511 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 25 Jul 2020 07:14:34 -0000 Author: mjg Date: Sat Jul 25 07:14:33 2020 New Revision: 363511 URL: https://svnweb.freebsd.org/changeset/base/363511 Log: Do a lockless check in kthread_suspend_check Otherwise an idle system running lockstat sleep 10 reports contention on process lock comming from bufdaemon. While here fix a style nit. Modified: head/sys/kern/kern_kthread.c Modified: head/sys/kern/kern_kthread.c ============================================================================== --- head/sys/kern/kern_kthread.c Sat Jul 25 06:32:23 2020 (r363510) +++ head/sys/kern/kern_kthread.c Sat Jul 25 07:14:33 2020 (r363511) @@ -441,12 +441,15 @@ kthread_suspend_check(void) panic("%s: curthread is not a valid kthread", __func__); /* - * As long as the double-lock protection is used when accessing the - * TDF_KTH_SUSP flag, synchronizing the read operation via proc mutex - * is fine. + * Setting the TDF_KTH_SUSP flag is protected by process lock. + * + * Do an unlocked read first to avoid serializing with all other threads + * in the common case of not suspending. */ + if ((td->td_flags & TDF_KTH_SUSP) == 0) + return; PROC_LOCK(p); - while (td->td_flags & TDF_KTH_SUSP) { + while ((td->td_flags & TDF_KTH_SUSP) != 0) { wakeup(&td->td_flags); msleep(&td->td_flags, &p->p_mtx, PPAUSE, "ktsusp", 0); } From owner-svn-src-all@freebsd.org Sat Jul 25 07:15:24 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 396973A2017; Sat, 25 Jul 2020 07:15:24 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BDHQg73Kvz3b9b; Sat, 25 Jul 2020 07:15:23 +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 D504417BFD; Sat, 25 Jul 2020 07:15:23 +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 06P7FNDw016608; Sat, 25 Jul 2020 07:15:23 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06P7FNMJ016607; Sat, 25 Jul 2020 07:15:23 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202007250715.06P7FNMJ016607@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Sat, 25 Jul 2020 07:15:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363512 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 363512 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 25 Jul 2020 07:15:24 -0000 Author: mjg Date: Sat Jul 25 07:15:23 2020 New Revision: 363512 URL: https://svnweb.freebsd.org/changeset/base/363512 Log: Guard sbcompress_ktls_rx with KERN_TLS Fixes a compilation warning after r363464 Modified: head/sys/kern/uipc_sockbuf.c Modified: head/sys/kern/uipc_sockbuf.c ============================================================================== --- head/sys/kern/uipc_sockbuf.c Sat Jul 25 07:14:33 2020 (r363511) +++ head/sys/kern/uipc_sockbuf.c Sat Jul 25 07:15:23 2020 (r363512) @@ -70,8 +70,10 @@ u_long sb_max_adj = static u_long sb_efficiency = 8; /* parameter for sbreserve() */ +#ifdef KERN_TLS static void sbcompress_ktls_rx(struct sockbuf *sb, struct mbuf *m, struct mbuf *n); +#endif static struct mbuf *sbcut_internal(struct sockbuf *sb, int len); static void sbflush_internal(struct sockbuf *sb); From owner-svn-src-all@freebsd.org Sat Jul 25 07:45:45 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 861AA3A2B12; Sat, 25 Jul 2020 07:45:45 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BDJ5j356Kz3cVb; Sat, 25 Jul 2020 07:45:45 +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 4E3E718807; Sat, 25 Jul 2020 07:45:45 +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 06P7jjOK035457; Sat, 25 Jul 2020 07:45:45 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06P7jjNE035456; Sat, 25 Jul 2020 07:45:45 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202007250745.06P7jjNE035456@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Sat, 25 Jul 2020 07:45:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363513 - head/sys/sys X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/sys X-SVN-Commit-Revision: 363513 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 25 Jul 2020 07:45:45 -0000 Author: mjg Date: Sat Jul 25 07:45:44 2020 New Revision: 363513 URL: https://svnweb.freebsd.org/changeset/base/363513 Log: Remove leftover macros for long gone vmsize mtx Modified: head/sys/sys/resourcevar.h Modified: head/sys/sys/resourcevar.h ============================================================================== --- head/sys/sys/resourcevar.h Sat Jul 25 07:15:23 2020 (r363512) +++ head/sys/sys/resourcevar.h Sat Jul 25 07:45:44 2020 (r363513) @@ -109,9 +109,6 @@ struct uidinfo { #endif }; -#define UIDINFO_VMSIZE_LOCK(ui) mtx_lock(&((ui)->ui_vmsize_mtx)) -#define UIDINFO_VMSIZE_UNLOCK(ui) mtx_unlock(&((ui)->ui_vmsize_mtx)) - struct proc; struct rusage_ext; struct thread; From owner-svn-src-all@freebsd.org Sat Jul 25 07:48:20 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C36043A2AB8; Sat, 25 Jul 2020 07:48:20 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BDJ8h4pdyz3clG; Sat, 25 Jul 2020 07:48:20 +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 885DE18809; Sat, 25 Jul 2020 07:48:20 +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 06P7mKp7035665; Sat, 25 Jul 2020 07:48:20 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06P7mKVA035664; Sat, 25 Jul 2020 07:48:20 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202007250748.06P7mKVA035664@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Sat, 25 Jul 2020 07:48:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363514 - head/sys/sys X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/sys X-SVN-Commit-Revision: 363514 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 25 Jul 2020 07:48:20 -0000 Author: mjg Date: Sat Jul 25 07:48:20 2020 New Revision: 363514 URL: https://svnweb.freebsd.org/changeset/base/363514 Log: Remove duplicated content from _eventhandler.h Modified: head/sys/sys/_eventhandler.h Modified: head/sys/sys/_eventhandler.h ============================================================================== --- head/sys/sys/_eventhandler.h Sat Jul 25 07:45:44 2020 (r363513) +++ head/sys/sys/_eventhandler.h Sat Jul 25 07:48:20 2020 (r363514) @@ -70,75 +70,3 @@ struct eventhandler_entry_ ## name \ struct __hack #endif -/*- - * SPDX-License-Identifier: BSD-2-Clause-FreeBSD - * - * Copyright (c) 1999 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. - * - * $FreeBSD$ - */ - -#ifndef _SYS__EVENTHANDLER_H_ -#define _SYS__EVENTHANDLER_H_ - -#include - -struct eventhandler_entry { - TAILQ_ENTRY(eventhandler_entry) ee_link; - int ee_priority; -#define EHE_DEAD_PRIORITY (-1) - void *ee_arg; -}; - -typedef struct eventhandler_entry *eventhandler_tag; - -/* - * You can optionally use the EVENTHANDLER_LIST and EVENTHANDLER_DIRECT macros - * to pre-define a symbol for the eventhandler list. This symbol can be used by - * EVENTHANDLER_DIRECT_INVOKE, which has the advantage of not needing to do a - * locked search of the global list of eventhandler lists. At least - * EVENTHANDLER_LIST_DEFINE must be be used for EVENTHANDLER_DIRECT_INVOKE to - * work. EVENTHANDLER_LIST_DECLARE is only needed if the call to - * EVENTHANDLER_DIRECT_INVOKE is in a different compilation unit from - * EVENTHANDLER_LIST_DEFINE. If the events are even relatively high frequency - * it is suggested that you directly define a list for them. - */ -struct eventhandler_list; -#define EVENTHANDLER_LIST_DECLARE(name) \ -extern struct eventhandler_list *_eventhandler_list_ ## name \ - -/* - * Event handlers need to be declared, but do not need to be defined. The - * declaration must be in scope wherever the handler is to be invoked. - */ -#define EVENTHANDLER_DECLARE(name, type) \ -struct eventhandler_entry_ ## name \ -{ \ - struct eventhandler_entry ee; \ - type eh_func; \ -}; \ -struct __hack - -#endif From owner-svn-src-all@freebsd.org Sat Jul 25 09:28:40 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6587D3A4E5B; Sat, 25 Jul 2020 09:28:40 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BDLNS2RNqz400q; Sat, 25 Jul 2020 09:28:40 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1CB1919919; Sat, 25 Jul 2020 09:28:40 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06P9Sejk099639; Sat, 25 Jul 2020 09:28:40 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06P9SdDX099633; Sat, 25 Jul 2020 09:28:39 GMT (envelope-from br@FreeBSD.org) Message-Id: <202007250928.06P9SdDX099633@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Sat, 25 Jul 2020 09:28:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363515 - in head/sys: dev/iommu x86/iommu X-SVN-Group: head X-SVN-Commit-Author: br X-SVN-Commit-Paths: in head/sys: dev/iommu x86/iommu X-SVN-Commit-Revision: 363515 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 25 Jul 2020 09:28:40 -0000 Author: br Date: Sat Jul 25 09:28:38 2020 New Revision: 363515 URL: https://svnweb.freebsd.org/changeset/base/363515 Log: Split-out the Intel GAS (Guest Address Space) management component from Intel DMAR support, so it can be used on other IOMMU systems. Reviewed by: kib Sponsored by: DARPA/AFRL Differential Revision: https://reviews.freebsd.org/D25743 Modified: head/sys/dev/iommu/iommu.h head/sys/x86/iommu/intel_ctx.c head/sys/x86/iommu/intel_dmar.h head/sys/x86/iommu/intel_drv.c head/sys/x86/iommu/intel_gas.c head/sys/x86/iommu/intel_idpgtbl.c head/sys/x86/iommu/intel_utils.c Modified: head/sys/dev/iommu/iommu.h ============================================================================== --- head/sys/dev/iommu/iommu.h Sat Jul 25 07:48:20 2020 (r363514) +++ head/sys/dev/iommu/iommu.h Sat Jul 25 09:28:38 2020 (r363515) @@ -48,6 +48,10 @@ struct bus_dma_tag_common; struct iommu_map_entry; TAILQ_HEAD(iommu_map_entries_tailq, iommu_map_entry); +RB_HEAD(iommu_gas_entries_tree, iommu_map_entry); +RB_PROTOTYPE(iommu_gas_entries_tree, iommu_map_entry, rb_entry, + iommu_gas_cmp_entries); + struct iommu_qi_genseq { u_int gen; uint32_t seq; @@ -107,6 +111,11 @@ struct iommu_domain { u_int entries_cnt; /* (d) */ struct iommu_map_entries_tailq unload_entries; /* (d) Entries to unload */ + struct iommu_gas_entries_tree rb_root; /* (d) */ + iommu_gaddr_t end; /* (c) Highest address + 1 in + the guest AS */ + struct iommu_map_entry *first_place, *last_place; /* (d) */ + u_int flags; /* (u) */ }; struct iommu_ctx { Modified: head/sys/x86/iommu/intel_ctx.c ============================================================================== --- head/sys/x86/iommu/intel_ctx.c Sat Jul 25 07:48:20 2020 (r363514) +++ head/sys/x86/iommu/intel_ctx.c Sat Jul 25 09:28:38 2020 (r363515) @@ -132,7 +132,7 @@ device_tag_init(struct dmar_ctx *ctx, device_t dev) bus_addr_t maxaddr; domain = (struct dmar_domain *)ctx->context.domain; - maxaddr = MIN(domain->end, BUS_SPACE_MAXADDR); + maxaddr = MIN(domain->iodom.end, BUS_SPACE_MAXADDR); ctx->context.tag->common.ref_count = 1; /* Prevent free */ ctx->context.tag->common.impl = &bus_dma_iommu_impl; ctx->context.tag->common.boundary = 0; @@ -186,7 +186,7 @@ ctx_id_entry_init(struct dmar_ctx *ctx, dmar_ctx_entry pci_get_function(ctx->context.tag->owner), ctxp->ctx1, ctxp->ctx2)); - if ((domain->flags & DMAR_DOMAIN_IDMAP) != 0 && + if ((domain->iodom.flags & DMAR_DOMAIN_IDMAP) != 0 && (unit->hw_ecap & DMAR_ECAP_PT) != 0) { KASSERT(domain->pgtbl_obj == NULL, ("ctx %p non-null pgtbl_obj", ctx)); @@ -254,7 +254,7 @@ domain_init_rmrr(struct dmar_domain *domain, device_t * and round as neccesary. * * We also allow the overlapping RMRR entries, see - * dmar_gas_alloc_region(). + * iommu_gas_alloc_region(). */ start = entry->start; end = entry->end; @@ -282,7 +282,8 @@ domain_init_rmrr(struct dmar_domain *domain, device_t ma[i] = vm_page_getfake(entry->start + PAGE_SIZE * i, VM_MEMATTR_DEFAULT); } - error1 = dmar_gas_map_region(domain, entry, + error1 = iommu_gas_map_region((struct iommu_domain *)domain, + entry, IOMMU_MAP_ENTRY_READ | IOMMU_MAP_ENTRY_WRITE, IOMMU_MF_CANWAIT | IOMMU_MF_RMRR, ma); /* @@ -294,7 +295,7 @@ domain_init_rmrr(struct dmar_domain *domain, device_t if (error1 == 0 && entry->end != entry->start) { IOMMU_LOCK(domain->iodom.iommu); domain->refs++; /* XXXKIB prevent free */ - domain->flags |= DMAR_DOMAIN_RMRR; + domain->iodom.flags |= DMAR_DOMAIN_RMRR; IOMMU_UNLOCK(domain->iodom.iommu); } else { if (error1 != 0) { @@ -308,7 +309,8 @@ domain_init_rmrr(struct dmar_domain *domain, device_t error = error1; } TAILQ_REMOVE(&rmrr_entries, entry, unroll_link); - dmar_gas_free_entry(domain, entry); + iommu_gas_free_entry((struct iommu_domain *)domain, + entry); } for (i = 0; i < size; i++) vm_page_putfake(ma[i]); @@ -320,6 +322,7 @@ domain_init_rmrr(struct dmar_domain *domain, device_t static struct dmar_domain * dmar_domain_alloc(struct dmar_unit *dmar, bool id_mapped) { + struct iommu_domain *iodom; struct dmar_domain *domain; int error, id, mgaw; @@ -327,9 +330,10 @@ dmar_domain_alloc(struct dmar_unit *dmar, bool id_mapp if (id == -1) return (NULL); domain = malloc(sizeof(*domain), M_DMAR_DOMAIN, M_WAITOK | M_ZERO); + iodom = (struct iommu_domain *)domain; domain->domain = id; LIST_INIT(&domain->contexts); - RB_INIT(&domain->rb_root); + RB_INIT(&domain->iodom.rb_root); TAILQ_INIT(&domain->iodom.unload_entries); TASK_INIT(&domain->iodom.unload_task, 0, dmar_domain_unload_task, domain); @@ -343,29 +347,29 @@ dmar_domain_alloc(struct dmar_unit *dmar, bool id_mapp * It is useful for the identity mapping, and less so for the * virtualized bus address space. */ - domain->end = id_mapped ? ptoa(Maxmem) : BUS_SPACE_MAXADDR; - mgaw = dmar_maxaddr2mgaw(dmar, domain->end, !id_mapped); + domain->iodom.end = id_mapped ? ptoa(Maxmem) : BUS_SPACE_MAXADDR; + mgaw = dmar_maxaddr2mgaw(dmar, domain->iodom.end, !id_mapped); error = domain_set_agaw(domain, mgaw); if (error != 0) goto fail; if (!id_mapped) /* Use all supported address space for remapping. */ - domain->end = 1ULL << (domain->agaw - 1); + domain->iodom.end = 1ULL << (domain->agaw - 1); - dmar_gas_init_domain(domain); + iommu_gas_init_domain((struct iommu_domain *)domain); if (id_mapped) { if ((dmar->hw_ecap & DMAR_ECAP_PT) == 0) { domain->pgtbl_obj = domain_get_idmap_pgtbl(domain, - domain->end); + domain->iodom.end); } - domain->flags |= DMAR_DOMAIN_IDMAP; + domain->iodom.flags |= DMAR_DOMAIN_IDMAP; } else { error = domain_alloc_pgtbl(domain); if (error != 0) goto fail; /* Disable local apic region access */ - error = dmar_gas_reserve_region(domain, 0xfee00000, + error = iommu_gas_reserve_region(iodom, 0xfee00000, 0xfeefffff + 1); if (error != 0) goto fail; @@ -436,12 +440,12 @@ dmar_domain_destroy(struct dmar_domain *domain) ("destroying dom %p with ctx_cnt %d", domain, domain->ctx_cnt)); KASSERT(domain->refs == 0, ("destroying dom %p with refs %d", domain, domain->refs)); - if ((domain->flags & DMAR_DOMAIN_GAS_INITED) != 0) { + if ((domain->iodom.flags & DMAR_DOMAIN_GAS_INITED) != 0) { DMAR_DOMAIN_LOCK(domain); - dmar_gas_fini_domain(domain); + iommu_gas_fini_domain((struct iommu_domain *)domain); DMAR_DOMAIN_UNLOCK(domain); } - if ((domain->flags & DMAR_DOMAIN_PGTBL_INITED) != 0) { + if ((domain->iodom.flags & DMAR_DOMAIN_PGTBL_INITED) != 0) { if (domain->pgtbl_obj != NULL) DMAR_DOMAIN_PGLOCK(domain); domain_free_pgtbl(domain); @@ -639,7 +643,7 @@ dmar_move_ctx_to_domain(struct dmar_domain *domain, st /* If flush failed, rolling back would not work as well. */ printf("dmar%d rid %x domain %d->%d %s-mapped\n", dmar->iommu.unit, ctx->rid, old_domain->domain, domain->domain, - (domain->flags & DMAR_DOMAIN_IDMAP) != 0 ? "id" : "re"); + (domain->iodom.flags & DMAR_DOMAIN_IDMAP) != 0 ? "id" : "re"); dmar_unref_domain_locked(dmar, old_domain); TD_PINNED_ASSERT; return (error); @@ -663,7 +667,7 @@ dmar_unref_domain_locked(struct dmar_unit *dmar, struc return; } - KASSERT((domain->flags & DMAR_DOMAIN_RMRR) == 0, + KASSERT((domain->iodom.flags & DMAR_DOMAIN_RMRR) == 0, ("lost ref on RMRR domain %p", domain)); LIST_REMOVE(domain, link); @@ -781,17 +785,17 @@ dmar_find_ctx_locked(struct dmar_unit *dmar, uint16_t void dmar_domain_free_entry(struct iommu_map_entry *entry, bool free) { - struct dmar_domain *domain; + struct iommu_domain *domain; - domain = (struct dmar_domain *)entry->domain; - DMAR_DOMAIN_LOCK(domain); + domain = entry->domain; + IOMMU_DOMAIN_LOCK(domain); if ((entry->flags & IOMMU_MAP_ENTRY_RMRR) != 0) - dmar_gas_free_region(domain, entry); + iommu_gas_free_region(domain, entry); else - dmar_gas_free_space(domain, entry); - DMAR_DOMAIN_UNLOCK(domain); + iommu_gas_free_space(domain, entry); + IOMMU_DOMAIN_UNLOCK(domain); if (free) - dmar_gas_free_entry(domain, entry); + iommu_gas_free_entry(domain, entry); else entry->flags = 0; } Modified: head/sys/x86/iommu/intel_dmar.h ============================================================================== --- head/sys/x86/iommu/intel_dmar.h Sat Jul 25 07:48:20 2020 (r363514) +++ head/sys/x86/iommu/intel_dmar.h Sat Jul 25 09:28:38 2020 (r363515) @@ -38,10 +38,6 @@ struct dmar_unit; -RB_HEAD(dmar_gas_entries_tree, iommu_map_entry); -RB_PROTOTYPE(dmar_gas_entries_tree, iommu_map_entry, rb_entry, - dmar_gas_cmp_entries); - /* * Locking annotations: * (u) - Protected by iommu unit lock @@ -68,17 +64,12 @@ struct dmar_domain { int pglvl; /* (c) The pagelevel */ int awlvl; /* (c) The pagelevel as the bitmask, to set in context entry */ - iommu_gaddr_t end; /* (c) Highest address + 1 in - the guest AS */ u_int ctx_cnt; /* (u) Number of contexts owned */ u_int refs; /* (u) Refs, including ctx */ struct dmar_unit *dmar; /* (c) */ LIST_ENTRY(dmar_domain) link; /* (u) Member in the dmar list */ LIST_HEAD(, dmar_ctx) contexts; /* (u) */ vm_object_t pgtbl_obj; /* (c) Page table pages */ - u_int flags; /* (u) */ - struct dmar_gas_entries_tree rb_root; /* (d) */ - struct iommu_map_entry *first_place, *last_place; /* (d) */ u_int batch_no; }; @@ -269,7 +260,7 @@ void dmar_qi_invalidate_iec(struct dmar_unit *unit, u_ vm_object_t domain_get_idmap_pgtbl(struct dmar_domain *domain, iommu_gaddr_t maxaddr); void put_idmap_pgtbl(vm_object_t obj); -int domain_map_buf(struct dmar_domain *domain, iommu_gaddr_t base, +int domain_map_buf(struct iommu_domain *domain, iommu_gaddr_t base, iommu_gaddr_t size, vm_page_t *ma, uint64_t pflags, int flags); int domain_unmap_buf(struct dmar_domain *domain, iommu_gaddr_t base, iommu_gaddr_t size, int flags); @@ -295,22 +286,22 @@ void dmar_domain_unload(struct dmar_domain *domain, struct iommu_map_entries_tailq *entries, bool cansleep); void dmar_domain_free_entry(struct iommu_map_entry *entry, bool free); -void dmar_gas_init_domain(struct dmar_domain *domain); -void dmar_gas_fini_domain(struct dmar_domain *domain); -struct iommu_map_entry *dmar_gas_alloc_entry(struct dmar_domain *domain, +void iommu_gas_init_domain(struct iommu_domain *domain); +void iommu_gas_fini_domain(struct iommu_domain *domain); +struct iommu_map_entry *iommu_gas_alloc_entry(struct iommu_domain *domain, u_int flags); -void dmar_gas_free_entry(struct dmar_domain *domain, +void iommu_gas_free_entry(struct iommu_domain *domain, struct iommu_map_entry *entry); -void dmar_gas_free_space(struct dmar_domain *domain, +void iommu_gas_free_space(struct iommu_domain *domain, struct iommu_map_entry *entry); -int dmar_gas_map(struct dmar_domain *domain, +int iommu_gas_map(struct iommu_domain *domain, const struct bus_dma_tag_common *common, iommu_gaddr_t size, int offset, u_int eflags, u_int flags, vm_page_t *ma, struct iommu_map_entry **res); -void dmar_gas_free_region(struct dmar_domain *domain, +void iommu_gas_free_region(struct iommu_domain *domain, struct iommu_map_entry *entry); -int dmar_gas_map_region(struct dmar_domain *domain, +int iommu_gas_map_region(struct iommu_domain *domain, struct iommu_map_entry *entry, u_int eflags, u_int flags, vm_page_t *ma); -int dmar_gas_reserve_region(struct dmar_domain *domain, iommu_gaddr_t start, +int iommu_gas_reserve_region(struct iommu_domain *domain, iommu_gaddr_t start, iommu_gaddr_t end); void dmar_dev_parse_rmrr(struct dmar_domain *domain, int dev_domain, @@ -342,7 +333,7 @@ extern iommu_haddr_t dmar_high; extern int haw; extern int dmar_tbl_pagecnt; extern int dmar_batch_coalesce; -extern int dmar_check_free; +extern int iommu_check_free; static inline uint32_t dmar_read4(const struct dmar_unit *unit, int reg) Modified: head/sys/x86/iommu/intel_drv.c ============================================================================== --- head/sys/x86/iommu/intel_drv.c Sat Jul 25 07:48:20 2020 (r363514) +++ head/sys/x86/iommu/intel_drv.c Sat Jul 25 09:28:38 2020 (r363515) @@ -176,7 +176,7 @@ dmar_identify(driver_t *driver, device_t parent) if (!dmar_enable) return; #ifdef INVARIANTS - TUNABLE_INT_FETCH("hw.dmar.check_free", &dmar_check_free); + TUNABLE_INT_FETCH("hw.iommu.check_free", &iommu_check_free); #endif status = AcpiGetTable(ACPI_SIG_DMAR, 1, (ACPI_TABLE_HEADER **)&dmartbl); if (ACPI_FAILURE(status)) @@ -945,7 +945,8 @@ dmar_rmrr_iter(ACPI_DMAR_HEADER *dmarh, void *arg) match = dmar_match_devscope(devscope, ria->dev_busno, ria->dev_path, ria->dev_path_len); if (match == 1) { - entry = dmar_gas_alloc_entry(ria->domain, + entry = iommu_gas_alloc_entry( + (struct iommu_domain *)ria->domain, DMAR_PGF_WAITOK); entry->start = resmem->BaseAddress; /* The RMRR entry end address is inclusive. */ @@ -1152,15 +1153,18 @@ dmar_print_ctx(struct dmar_ctx *ctx) static void dmar_print_domain(struct dmar_domain *domain, bool show_mappings) { + struct iommu_domain *iodom; struct iommu_map_entry *entry; struct dmar_ctx *ctx; + iodom = (struct iommu_domain *)domain; + db_printf( " @%p dom %d mgaw %d agaw %d pglvl %d end %jx refs %d\n" " ctx_cnt %d flags %x pgobj %p map_ents %u\n", domain, domain->domain, domain->mgaw, domain->agaw, domain->pglvl, - (uintmax_t)domain->end, domain->refs, domain->ctx_cnt, - domain->flags, domain->pgtbl_obj, domain->iodom.entries_cnt); + (uintmax_t)domain->iodom.end, domain->refs, domain->ctx_cnt, + domain->iodom.flags, domain->pgtbl_obj, domain->iodom.entries_cnt); if (!LIST_EMPTY(&domain->contexts)) { db_printf(" Contexts:\n"); LIST_FOREACH(ctx, &domain->contexts, link) @@ -1169,7 +1173,7 @@ dmar_print_domain(struct dmar_domain *domain, bool sho if (!show_mappings) return; db_printf(" mapped:\n"); - RB_FOREACH(entry, dmar_gas_entries_tree, &domain->rb_root) { + RB_FOREACH(entry, iommu_gas_entries_tree, &iodom->rb_root) { dmar_print_domain_entry(entry); if (db_pager_quit) break; Modified: head/sys/x86/iommu/intel_gas.c ============================================================================== --- head/sys/x86/iommu/intel_gas.c Sat Jul 25 07:48:20 2020 (r363514) +++ head/sys/x86/iommu/intel_gas.c Sat Jul 25 09:28:38 2020 (r363515) @@ -32,7 +32,7 @@ #include __FBSDID("$FreeBSD$"); -#define RB_AUGMENT(entry) dmar_gas_augment_entry(entry) +#define RB_AUGMENT(entry) iommu_gas_augment_entry(entry) #include #include @@ -63,12 +63,15 @@ __FBSDID("$FreeBSD$"); #include #include #include +#if defined(__amd64__) || defined(__i386__) #include #include #include #include +#include #include #include +#endif /* * Guest Address Space management. @@ -87,7 +90,7 @@ intel_gas_init(void) SYSINIT(intel_gas, SI_SUB_DRIVERS, SI_ORDER_FIRST, intel_gas_init, NULL); struct iommu_map_entry * -dmar_gas_alloc_entry(struct dmar_domain *domain, u_int flags) +iommu_gas_alloc_entry(struct iommu_domain *domain, u_int flags) { struct iommu_map_entry *res; @@ -97,25 +100,25 @@ dmar_gas_alloc_entry(struct dmar_domain *domain, u_int res = uma_zalloc(iommu_map_entry_zone, ((flags & DMAR_PGF_WAITOK) != 0 ? M_WAITOK : M_NOWAIT) | M_ZERO); if (res != NULL) { - res->domain = (struct iommu_domain *)domain; - atomic_add_int(&domain->iodom.entries_cnt, 1); + res->domain = domain; + atomic_add_int(&domain->entries_cnt, 1); } return (res); } void -dmar_gas_free_entry(struct dmar_domain *domain, struct iommu_map_entry *entry) +iommu_gas_free_entry(struct iommu_domain *domain, struct iommu_map_entry *entry) { - KASSERT(domain == (struct dmar_domain *)entry->domain, + KASSERT(domain == (struct iommu_domain *)entry->domain, ("mismatched free domain %p entry %p entry->domain %p", domain, entry, entry->domain)); - atomic_subtract_int(&domain->iodom.entries_cnt, 1); + atomic_subtract_int(&domain->entries_cnt, 1); uma_zfree(iommu_map_entry_zone, entry); } static int -dmar_gas_cmp_entries(struct iommu_map_entry *a, struct iommu_map_entry *b) +iommu_gas_cmp_entries(struct iommu_map_entry *a, struct iommu_map_entry *b) { /* Last entry have zero size, so <= */ @@ -137,7 +140,7 @@ dmar_gas_cmp_entries(struct iommu_map_entry *a, struct } static void -dmar_gas_augment_entry(struct iommu_map_entry *entry) +iommu_gas_augment_entry(struct iommu_map_entry *entry) { struct iommu_map_entry *child; iommu_gaddr_t free_down; @@ -159,18 +162,18 @@ dmar_gas_augment_entry(struct iommu_map_entry *entry) entry->free_down = free_down; } -RB_GENERATE(dmar_gas_entries_tree, iommu_map_entry, rb_entry, - dmar_gas_cmp_entries); +RB_GENERATE(iommu_gas_entries_tree, iommu_map_entry, rb_entry, + iommu_gas_cmp_entries); #ifdef INVARIANTS static void -dmar_gas_check_free(struct dmar_domain *domain) +iommu_gas_check_free(struct iommu_domain *domain) { struct iommu_map_entry *entry, *l, *r; iommu_gaddr_t v; - RB_FOREACH(entry, dmar_gas_entries_tree, &domain->rb_root) { - KASSERT(domain == (struct dmar_domain *)entry->domain, + RB_FOREACH(entry, iommu_gas_entries_tree, &domain->rb_root) { + KASSERT(domain == (struct iommu_domain *)entry->domain, ("mismatched free domain %p entry %p entry->domain %p", domain, entry, entry->domain)); l = RB_LEFT(entry, rb_entry); @@ -190,85 +193,88 @@ dmar_gas_check_free(struct dmar_domain *domain) #endif static bool -dmar_gas_rb_insert(struct dmar_domain *domain, struct iommu_map_entry *entry) +iommu_gas_rb_insert(struct iommu_domain *domain, struct iommu_map_entry *entry) { struct iommu_map_entry *found; - found = RB_INSERT(dmar_gas_entries_tree, &domain->rb_root, entry); + found = RB_INSERT(iommu_gas_entries_tree, + &domain->rb_root, entry); return (found == NULL); } static void -dmar_gas_rb_remove(struct dmar_domain *domain, struct iommu_map_entry *entry) +iommu_gas_rb_remove(struct iommu_domain *domain, struct iommu_map_entry *entry) { - RB_REMOVE(dmar_gas_entries_tree, &domain->rb_root, entry); + RB_REMOVE(iommu_gas_entries_tree, &domain->rb_root, entry); } void -dmar_gas_init_domain(struct dmar_domain *domain) +iommu_gas_init_domain(struct iommu_domain *domain) { struct iommu_map_entry *begin, *end; - begin = dmar_gas_alloc_entry(domain, DMAR_PGF_WAITOK); - end = dmar_gas_alloc_entry(domain, DMAR_PGF_WAITOK); + begin = iommu_gas_alloc_entry(domain, DMAR_PGF_WAITOK); + end = iommu_gas_alloc_entry(domain, DMAR_PGF_WAITOK); - DMAR_DOMAIN_LOCK(domain); - KASSERT(domain->iodom.entries_cnt == 2, ("dirty domain %p", domain)); - KASSERT(RB_EMPTY(&domain->rb_root), ("non-empty entries %p", domain)); + IOMMU_DOMAIN_LOCK(domain); + KASSERT(domain->entries_cnt == 2, ("dirty domain %p", domain)); + KASSERT(RB_EMPTY(&domain->rb_root), + ("non-empty entries %p", domain)); begin->start = 0; - begin->end = DMAR_PAGE_SIZE; + begin->end = IOMMU_PAGE_SIZE; begin->flags = IOMMU_MAP_ENTRY_PLACE | IOMMU_MAP_ENTRY_UNMAPPED; - dmar_gas_rb_insert(domain, begin); + iommu_gas_rb_insert(domain, begin); end->start = domain->end; end->end = domain->end; end->flags = IOMMU_MAP_ENTRY_PLACE | IOMMU_MAP_ENTRY_UNMAPPED; - dmar_gas_rb_insert(domain, end); + iommu_gas_rb_insert(domain, end); domain->first_place = begin; domain->last_place = end; domain->flags |= DMAR_DOMAIN_GAS_INITED; - DMAR_DOMAIN_UNLOCK(domain); + IOMMU_DOMAIN_UNLOCK(domain); } void -dmar_gas_fini_domain(struct dmar_domain *domain) +iommu_gas_fini_domain(struct iommu_domain *domain) { struct iommu_map_entry *entry, *entry1; - DMAR_DOMAIN_ASSERT_LOCKED(domain); - KASSERT(domain->iodom.entries_cnt == 2, + IOMMU_DOMAIN_ASSERT_LOCKED(domain); + KASSERT(domain->entries_cnt == 2, ("domain still in use %p", domain)); - entry = RB_MIN(dmar_gas_entries_tree, &domain->rb_root); + entry = RB_MIN(iommu_gas_entries_tree, &domain->rb_root); KASSERT(entry->start == 0, ("start entry start %p", domain)); - KASSERT(entry->end == DMAR_PAGE_SIZE, ("start entry end %p", domain)); + KASSERT(entry->end == IOMMU_PAGE_SIZE, ("start entry end %p", domain)); KASSERT(entry->flags == IOMMU_MAP_ENTRY_PLACE, ("start entry flags %p", domain)); - RB_REMOVE(dmar_gas_entries_tree, &domain->rb_root, entry); - dmar_gas_free_entry(domain, entry); + RB_REMOVE(iommu_gas_entries_tree, &domain->rb_root, entry); + iommu_gas_free_entry(domain, entry); - entry = RB_MAX(dmar_gas_entries_tree, &domain->rb_root); + entry = RB_MAX(iommu_gas_entries_tree, &domain->rb_root); KASSERT(entry->start == domain->end, ("end entry start %p", domain)); KASSERT(entry->end == domain->end, ("end entry end %p", domain)); KASSERT(entry->flags == IOMMU_MAP_ENTRY_PLACE, ("end entry flags %p", domain)); - RB_REMOVE(dmar_gas_entries_tree, &domain->rb_root, entry); - dmar_gas_free_entry(domain, entry); + RB_REMOVE(iommu_gas_entries_tree, &domain->rb_root, entry); + iommu_gas_free_entry(domain, entry); - RB_FOREACH_SAFE(entry, dmar_gas_entries_tree, &domain->rb_root, + RB_FOREACH_SAFE(entry, iommu_gas_entries_tree, &domain->rb_root, entry1) { KASSERT((entry->flags & IOMMU_MAP_ENTRY_RMRR) != 0, ("non-RMRR entry left %p", domain)); - RB_REMOVE(dmar_gas_entries_tree, &domain->rb_root, entry); - dmar_gas_free_entry(domain, entry); + RB_REMOVE(iommu_gas_entries_tree, &domain->rb_root, + entry); + iommu_gas_free_entry(domain, entry); } } -struct dmar_gas_match_args { - struct dmar_domain *domain; +struct iommu_gas_match_args { + struct iommu_domain *domain; iommu_gaddr_t size; int offset; const struct bus_dma_tag_common *common; @@ -277,25 +283,25 @@ struct dmar_gas_match_args { }; /* - * The interval [beg, end) is a free interval between two dmar_map_entries. + * The interval [beg, end) is a free interval between two iommu_map_entries. * maxaddr is an upper bound on addresses that can be allocated. Try to * allocate space in the free interval, subject to the conditions expressed * by a, and return 'true' if and only if the allocation attempt succeeds. */ static bool -dmar_gas_match_one(struct dmar_gas_match_args *a, iommu_gaddr_t beg, +iommu_gas_match_one(struct iommu_gas_match_args *a, iommu_gaddr_t beg, iommu_gaddr_t end, iommu_gaddr_t maxaddr) { iommu_gaddr_t bs, start; - a->entry->start = roundup2(beg + DMAR_PAGE_SIZE, + a->entry->start = roundup2(beg + IOMMU_PAGE_SIZE, a->common->alignment); if (a->entry->start + a->size > maxaddr) return (false); - /* DMAR_PAGE_SIZE to create gap after new entry. */ - if (a->entry->start < beg + DMAR_PAGE_SIZE || - a->entry->start + a->size + a->offset + DMAR_PAGE_SIZE > end) + /* IOMMU_PAGE_SIZE to create gap after new entry. */ + if (a->entry->start < beg + IOMMU_PAGE_SIZE || + a->entry->start + a->size + a->offset + IOMMU_PAGE_SIZE > end) return (false); /* No boundary crossing. */ @@ -311,8 +317,8 @@ dmar_gas_match_one(struct dmar_gas_match_args *a, iomm bs = rounddown2(a->entry->start + a->offset + a->common->boundary, a->common->boundary); start = roundup2(bs, a->common->alignment); - /* DMAR_PAGE_SIZE to create gap after new entry. */ - if (start + a->offset + a->size + DMAR_PAGE_SIZE <= end && + /* IOMMU_PAGE_SIZE to create gap after new entry. */ + if (start + a->offset + a->size + IOMMU_PAGE_SIZE <= end && start + a->offset + a->size <= maxaddr && iommu_test_boundary(start + a->offset, a->size, a->common->boundary)) { @@ -337,7 +343,7 @@ dmar_gas_match_one(struct dmar_gas_match_args *a, iomm } static void -dmar_gas_match_insert(struct dmar_gas_match_args *a) +iommu_gas_match_insert(struct iommu_gas_match_args *a) { bool found; @@ -351,84 +357,84 @@ dmar_gas_match_insert(struct dmar_gas_match_args *a) */ a->entry->end = a->entry->start + a->size; - found = dmar_gas_rb_insert(a->domain, a->entry); + found = iommu_gas_rb_insert(a->domain, a->entry); KASSERT(found, ("found dup %p start %jx size %jx", a->domain, (uintmax_t)a->entry->start, (uintmax_t)a->size)); a->entry->flags = IOMMU_MAP_ENTRY_MAP; } static int -dmar_gas_lowermatch(struct dmar_gas_match_args *a, struct iommu_map_entry *entry) +iommu_gas_lowermatch(struct iommu_gas_match_args *a, struct iommu_map_entry *entry) { struct iommu_map_entry *child; child = RB_RIGHT(entry, rb_entry); if (child != NULL && entry->end < a->common->lowaddr && - dmar_gas_match_one(a, entry->end, child->first, + iommu_gas_match_one(a, entry->end, child->first, a->common->lowaddr)) { - dmar_gas_match_insert(a); + iommu_gas_match_insert(a); return (0); } - if (entry->free_down < a->size + a->offset + DMAR_PAGE_SIZE) + if (entry->free_down < a->size + a->offset + IOMMU_PAGE_SIZE) return (ENOMEM); if (entry->first >= a->common->lowaddr) return (ENOMEM); child = RB_LEFT(entry, rb_entry); - if (child != NULL && 0 == dmar_gas_lowermatch(a, child)) + if (child != NULL && 0 == iommu_gas_lowermatch(a, child)) return (0); if (child != NULL && child->last < a->common->lowaddr && - dmar_gas_match_one(a, child->last, entry->start, + iommu_gas_match_one(a, child->last, entry->start, a->common->lowaddr)) { - dmar_gas_match_insert(a); + iommu_gas_match_insert(a); return (0); } child = RB_RIGHT(entry, rb_entry); - if (child != NULL && 0 == dmar_gas_lowermatch(a, child)) + if (child != NULL && 0 == iommu_gas_lowermatch(a, child)) return (0); return (ENOMEM); } static int -dmar_gas_uppermatch(struct dmar_gas_match_args *a, struct iommu_map_entry *entry) +iommu_gas_uppermatch(struct iommu_gas_match_args *a, struct iommu_map_entry *entry) { struct iommu_map_entry *child; - if (entry->free_down < a->size + a->offset + DMAR_PAGE_SIZE) + if (entry->free_down < a->size + a->offset + IOMMU_PAGE_SIZE) return (ENOMEM); if (entry->last < a->common->highaddr) return (ENOMEM); child = RB_LEFT(entry, rb_entry); - if (child != NULL && 0 == dmar_gas_uppermatch(a, child)) + if (child != NULL && 0 == iommu_gas_uppermatch(a, child)) return (0); if (child != NULL && child->last >= a->common->highaddr && - dmar_gas_match_one(a, child->last, entry->start, + iommu_gas_match_one(a, child->last, entry->start, a->domain->end)) { - dmar_gas_match_insert(a); + iommu_gas_match_insert(a); return (0); } child = RB_RIGHT(entry, rb_entry); if (child != NULL && entry->end >= a->common->highaddr && - dmar_gas_match_one(a, entry->end, child->first, + iommu_gas_match_one(a, entry->end, child->first, a->domain->end)) { - dmar_gas_match_insert(a); + iommu_gas_match_insert(a); return (0); } - if (child != NULL && 0 == dmar_gas_uppermatch(a, child)) + if (child != NULL && 0 == iommu_gas_uppermatch(a, child)) return (0); return (ENOMEM); } static int -dmar_gas_find_space(struct dmar_domain *domain, +iommu_gas_find_space(struct iommu_domain *domain, const struct bus_dma_tag_common *common, iommu_gaddr_t size, int offset, u_int flags, struct iommu_map_entry *entry) { - struct dmar_gas_match_args a; + struct iommu_gas_match_args a; int error; - DMAR_DOMAIN_ASSERT_LOCKED(domain); + IOMMU_DOMAIN_ASSERT_LOCKED(domain); KASSERT(entry->flags == 0, ("dirty entry %p %p", domain, entry)); - KASSERT((size & DMAR_PAGE_MASK) == 0, ("size %jx", (uintmax_t)size)); + KASSERT((size & IOMMU_PAGE_MASK) == 0, ("size %jx", (uintmax_t)size)); a.domain = domain; a.size = size; @@ -439,42 +445,43 @@ dmar_gas_find_space(struct dmar_domain *domain, /* Handle lower region. */ if (common->lowaddr > 0) { - error = dmar_gas_lowermatch(&a, RB_ROOT(&domain->rb_root)); + error = iommu_gas_lowermatch(&a, + RB_ROOT(&domain->rb_root)); if (error == 0) return (0); KASSERT(error == ENOMEM, - ("error %d from dmar_gas_lowermatch", error)); + ("error %d from iommu_gas_lowermatch", error)); } /* Handle upper region. */ if (common->highaddr >= domain->end) return (ENOMEM); - error = dmar_gas_uppermatch(&a, RB_ROOT(&domain->rb_root)); + error = iommu_gas_uppermatch(&a, RB_ROOT(&domain->rb_root)); KASSERT(error == ENOMEM, - ("error %d from dmar_gas_uppermatch", error)); + ("error %d from iommu_gas_uppermatch", error)); return (error); } static int -dmar_gas_alloc_region(struct dmar_domain *domain, struct iommu_map_entry *entry, +iommu_gas_alloc_region(struct iommu_domain *domain, struct iommu_map_entry *entry, u_int flags) { struct iommu_map_entry *next, *prev; bool found; - DMAR_DOMAIN_ASSERT_LOCKED(domain); + IOMMU_DOMAIN_ASSERT_LOCKED(domain); - if ((entry->start & DMAR_PAGE_MASK) != 0 || - (entry->end & DMAR_PAGE_MASK) != 0) + if ((entry->start & IOMMU_PAGE_MASK) != 0 || + (entry->end & IOMMU_PAGE_MASK) != 0) return (EINVAL); if (entry->start >= entry->end) return (EINVAL); if (entry->end >= domain->end) return (EINVAL); - next = RB_NFIND(dmar_gas_entries_tree, &domain->rb_root, entry); + next = RB_NFIND(iommu_gas_entries_tree, &domain->rb_root, entry); KASSERT(next != NULL, ("next must be non-null %p %jx", domain, (uintmax_t)entry->start)); - prev = RB_PREV(dmar_gas_entries_tree, &domain->rb_root, next); + prev = RB_PREV(iommu_gas_entries_tree, &domain->rb_root, next); /* prev could be NULL */ /* @@ -504,15 +511,15 @@ dmar_gas_alloc_region(struct dmar_domain *domain, stru if (prev != NULL && prev->end > entry->start) { /* This assumes that prev is the placeholder entry. */ - dmar_gas_rb_remove(domain, prev); + iommu_gas_rb_remove(domain, prev); prev = NULL; } if (next->start < entry->end) { - dmar_gas_rb_remove(domain, next); + iommu_gas_rb_remove(domain, next); next = NULL; } - found = dmar_gas_rb_insert(domain, entry); + found = iommu_gas_rb_insert(domain, entry); KASSERT(found, ("found RMRR dup %p start %jx end %jx", domain, (uintmax_t)entry->start, (uintmax_t)entry->end)); if ((flags & IOMMU_MF_RMRR) != 0) @@ -520,8 +527,8 @@ dmar_gas_alloc_region(struct dmar_domain *domain, stru #ifdef INVARIANTS struct iommu_map_entry *ip, *in; - ip = RB_PREV(dmar_gas_entries_tree, &domain->rb_root, entry); - in = RB_NEXT(dmar_gas_entries_tree, &domain->rb_root, entry); + ip = RB_PREV(iommu_gas_entries_tree, &domain->rb_root, entry); + in = RB_NEXT(iommu_gas_entries_tree, &domain->rb_root, entry); KASSERT(prev == NULL || ip == prev, ("RMRR %p (%jx %jx) prev %p (%jx %jx) ins prev %p (%jx %jx)", entry, entry->start, entry->end, prev, @@ -538,45 +545,45 @@ dmar_gas_alloc_region(struct dmar_domain *domain, stru } void -dmar_gas_free_space(struct dmar_domain *domain, struct iommu_map_entry *entry) +iommu_gas_free_space(struct iommu_domain *domain, struct iommu_map_entry *entry) { - DMAR_DOMAIN_ASSERT_LOCKED(domain); + IOMMU_DOMAIN_ASSERT_LOCKED(domain); KASSERT((entry->flags & (IOMMU_MAP_ENTRY_PLACE | IOMMU_MAP_ENTRY_RMRR | IOMMU_MAP_ENTRY_MAP)) == IOMMU_MAP_ENTRY_MAP, ("permanent entry %p %p", domain, entry)); - dmar_gas_rb_remove(domain, entry); + iommu_gas_rb_remove(domain, entry); entry->flags &= ~IOMMU_MAP_ENTRY_MAP; #ifdef INVARIANTS - if (dmar_check_free) - dmar_gas_check_free(domain); + if (iommu_check_free) + iommu_gas_check_free(domain); #endif } void -dmar_gas_free_region(struct dmar_domain *domain, struct iommu_map_entry *entry) +iommu_gas_free_region(struct iommu_domain *domain, struct iommu_map_entry *entry) { struct iommu_map_entry *next, *prev; - DMAR_DOMAIN_ASSERT_LOCKED(domain); + IOMMU_DOMAIN_ASSERT_LOCKED(domain); KASSERT((entry->flags & (IOMMU_MAP_ENTRY_PLACE | IOMMU_MAP_ENTRY_RMRR | IOMMU_MAP_ENTRY_MAP)) == IOMMU_MAP_ENTRY_RMRR, ("non-RMRR entry %p %p", domain, entry)); - prev = RB_PREV(dmar_gas_entries_tree, &domain->rb_root, entry); - next = RB_NEXT(dmar_gas_entries_tree, &domain->rb_root, entry); - dmar_gas_rb_remove(domain, entry); + prev = RB_PREV(iommu_gas_entries_tree, &domain->rb_root, entry); + next = RB_NEXT(iommu_gas_entries_tree, &domain->rb_root, entry); + iommu_gas_rb_remove(domain, entry); entry->flags &= ~IOMMU_MAP_ENTRY_RMRR; if (prev == NULL) - dmar_gas_rb_insert(domain, domain->first_place); + iommu_gas_rb_insert(domain, domain->first_place); if (next == NULL) - dmar_gas_rb_insert(domain, domain->last_place); + iommu_gas_rb_insert(domain, domain->last_place); } int -dmar_gas_map(struct dmar_domain *domain, +iommu_gas_map(struct iommu_domain *domain, const struct bus_dma_tag_common *common, iommu_gaddr_t size, int offset, u_int eflags, u_int flags, vm_page_t *ma, struct iommu_map_entry **res) { @@ -586,38 +593,34 @@ dmar_gas_map(struct dmar_domain *domain, KASSERT((flags & ~(IOMMU_MF_CANWAIT | IOMMU_MF_CANSPLIT)) == 0, ("invalid flags 0x%x", flags)); - entry = dmar_gas_alloc_entry(domain, + entry = iommu_gas_alloc_entry(domain, (flags & IOMMU_MF_CANWAIT) != 0 ? DMAR_PGF_WAITOK : 0); if (entry == NULL) return (ENOMEM); - DMAR_DOMAIN_LOCK(domain); - error = dmar_gas_find_space(domain, common, size, offset, flags, + IOMMU_DOMAIN_LOCK(domain); + error = iommu_gas_find_space(domain, common, size, offset, flags, entry); if (error == ENOMEM) { - DMAR_DOMAIN_UNLOCK(domain); - dmar_gas_free_entry(domain, entry); + IOMMU_DOMAIN_UNLOCK(domain); + iommu_gas_free_entry(domain, entry); return (error); } #ifdef INVARIANTS - if (dmar_check_free) - dmar_gas_check_free(domain); + if (iommu_check_free) + iommu_gas_check_free(domain); #endif KASSERT(error == 0, - ("unexpected error %d from dmar_gas_find_entry", error)); + ("unexpected error %d from iommu_gas_find_entry", error)); KASSERT(entry->end < domain->end, ("allocated GPA %jx, max GPA %jx", (uintmax_t)entry->end, (uintmax_t)domain->end)); entry->flags |= eflags; - DMAR_DOMAIN_UNLOCK(domain); + IOMMU_DOMAIN_UNLOCK(domain); error = domain_map_buf(domain, entry->start, entry->end - entry->start, - ma, - ((eflags & IOMMU_MAP_ENTRY_READ) != 0 ? DMAR_PTE_R : 0) | - ((eflags & IOMMU_MAP_ENTRY_WRITE) != 0 ? DMAR_PTE_W : 0) | - ((eflags & IOMMU_MAP_ENTRY_SNOOP) != 0 ? DMAR_PTE_SNP : 0) | - ((eflags & IOMMU_MAP_ENTRY_TM) != 0 ? DMAR_PTE_TM : 0), - (flags & IOMMU_MF_CANWAIT) != 0 ? DMAR_PGF_WAITOK : 0); + ma, eflags, + ((flags & IOMMU_MF_CANWAIT) != 0 ? DMAR_PGF_WAITOK : 0)); if (error == ENOMEM) { - dmar_domain_unload_entry(entry, true); + iommu_domain_unload_entry(entry, true); return (error); } KASSERT(error == 0, @@ -628,7 +631,7 @@ dmar_gas_map(struct dmar_domain *domain, } int -dmar_gas_map_region(struct dmar_domain *domain, struct iommu_map_entry *entry, +iommu_gas_map_region(struct iommu_domain *domain, struct iommu_map_entry *entry, u_int eflags, u_int flags, vm_page_t *ma) { iommu_gaddr_t start; @@ -640,26 +643,22 @@ dmar_gas_map_region(struct dmar_domain *domain, struct ("invalid flags 0x%x", flags)); start = entry->start; - DMAR_DOMAIN_LOCK(domain); - error = dmar_gas_alloc_region(domain, entry, flags); + IOMMU_DOMAIN_LOCK(domain); + error = iommu_gas_alloc_region(domain, entry, flags); if (error != 0) { - DMAR_DOMAIN_UNLOCK(domain); + IOMMU_DOMAIN_UNLOCK(domain); return (error); } entry->flags |= eflags; - DMAR_DOMAIN_UNLOCK(domain); + IOMMU_DOMAIN_UNLOCK(domain); if (entry->end == entry->start) return (0); error = domain_map_buf(domain, entry->start, entry->end - entry->start, - ma + OFF_TO_IDX(start - entry->start), - ((eflags & IOMMU_MAP_ENTRY_READ) != 0 ? DMAR_PTE_R : 0) | - ((eflags & IOMMU_MAP_ENTRY_WRITE) != 0 ? DMAR_PTE_W : 0) | - ((eflags & IOMMU_MAP_ENTRY_SNOOP) != 0 ? DMAR_PTE_SNP : 0) | - ((eflags & IOMMU_MAP_ENTRY_TM) != 0 ? DMAR_PTE_TM : 0), - (flags & IOMMU_MF_CANWAIT) != 0 ? DMAR_PGF_WAITOK : 0); + ma + OFF_TO_IDX(start - entry->start), eflags, + ((flags & IOMMU_MF_CANWAIT) != 0 ? DMAR_PGF_WAITOK : 0)); if (error == ENOMEM) { - dmar_domain_unload_entry(entry, false); + iommu_domain_unload_entry(entry, false); return (error); } KASSERT(error == 0, @@ -669,74 +668,62 @@ dmar_gas_map_region(struct dmar_domain *domain, struct } int -dmar_gas_reserve_region(struct dmar_domain *domain, iommu_gaddr_t start, +iommu_gas_reserve_region(struct iommu_domain *domain, iommu_gaddr_t start, iommu_gaddr_t end) { struct iommu_map_entry *entry; int error; - entry = dmar_gas_alloc_entry(domain, DMAR_PGF_WAITOK); + entry = iommu_gas_alloc_entry(domain, DMAR_PGF_WAITOK); entry->start = start; entry->end = end; - DMAR_DOMAIN_LOCK(domain); - error = dmar_gas_alloc_region(domain, entry, IOMMU_MF_CANWAIT); + IOMMU_DOMAIN_LOCK(domain); + error = iommu_gas_alloc_region(domain, entry, IOMMU_MF_CANWAIT); if (error == 0) entry->flags |= IOMMU_MAP_ENTRY_UNMAPPED; - DMAR_DOMAIN_UNLOCK(domain); + IOMMU_DOMAIN_UNLOCK(domain); if (error != 0) - dmar_gas_free_entry(domain, entry); + iommu_gas_free_entry(domain, entry); return (error); } struct iommu_map_entry * -iommu_map_alloc_entry(struct iommu_domain *iodom, u_int flags) +iommu_map_alloc_entry(struct iommu_domain *domain, u_int flags) { - struct dmar_domain *domain; struct iommu_map_entry *res; - domain = (struct dmar_domain *)iodom; + res = iommu_gas_alloc_entry(domain, flags); - res = dmar_gas_alloc_entry(domain, flags); - return (res); } void -iommu_map_free_entry(struct iommu_domain *iodom, struct iommu_map_entry *entry) +iommu_map_free_entry(struct iommu_domain *domain, struct iommu_map_entry *entry) { - struct dmar_domain *domain; - domain = (struct dmar_domain *)iodom; - - dmar_gas_free_entry(domain, entry); + iommu_gas_free_entry(domain, entry); } *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Sat Jul 25 10:29:49 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3FE733A6123; Sat, 25 Jul 2020 10:29:49 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BDMl10wN9z42sQ; Sat, 25 Jul 2020 10:29:49 +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 DE2B81A1CF; Sat, 25 Jul 2020 10:29:48 +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 06PATmfG037394; Sat, 25 Jul 2020 10:29:48 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06PATmVJ037392; Sat, 25 Jul 2020 10:29:48 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202007251029.06PATmVJ037392@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Sat, 25 Jul 2020 10:29:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363516 - head/sys/sys X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/sys X-SVN-Commit-Revision: 363516 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 25 Jul 2020 10:29:49 -0000 Author: mjg Date: Sat Jul 25 10:29:48 2020 New Revision: 363516 URL: https://svnweb.freebsd.org/changeset/base/363516 Log: seqc: add a sleepable variant and convert some routines to macros This temporarily duplicates some code. Macro conversion convinces clang to carry predicts into consumers. Added: head/sys/sys/_seqc.h (contents, props changed) Modified: head/sys/sys/seqc.h Added: head/sys/sys/_seqc.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/sys/_seqc.h Sat Jul 25 10:29:48 2020 (r363516) @@ -0,0 +1,11 @@ +/*- + * This file is in the public domain. + */ +/* $FreeBSD$ */ + +#ifndef _SYS__SEQC_H_ +#define _SYS__SEQC_H_ + +typedef uint32_t seqc_t; + +#endif /* _SYS__SEQC_H */ Modified: head/sys/sys/seqc.h ============================================================================== --- head/sys/sys/seqc.h Sat Jul 25 09:28:38 2020 (r363515) +++ head/sys/sys/seqc.h Sat Jul 25 10:29:48 2020 (r363516) @@ -36,7 +36,7 @@ /* * seqc_t may be included in structs visible to userspace */ -typedef uint32_t seqc_t; +#include #ifdef _KERNEL @@ -45,13 +45,15 @@ typedef uint32_t seqc_t; #include -static __inline bool -seqc_in_modify(seqc_t seqcp) -{ +/* + * Predicts from inline functions are not honored by clang. + */ +#define seqc_in_modify(seqc) ({ \ + seqc_t __seqc = (seqc); \ + \ + __predict_false(__seqc & 1); \ +}) - return (seqcp & 1); -} - static __inline void seqc_write_begin(seqc_t *seqcp) { @@ -86,7 +88,7 @@ seqc_read(const seqc_t *seqcp) for (;;) { ret = seqc_read_any(seqcp); - if (__predict_false(seqc_in_modify(ret))) { + if (seqc_in_modify(ret)) { cpu_spinwait(); continue; } @@ -96,19 +98,38 @@ seqc_read(const seqc_t *seqcp) return (ret); } -static __inline bool -seqc_consistent_nomb(const seqc_t *seqcp, seqc_t oldseqc) +#define seqc_consistent_nomb(seqcp, oldseqc) ({ \ + const seqc_t *__seqcp = (seqcp); \ + seqc_t __oldseqc = (oldseqc); \ + \ + MPASS(!(seqc_in_modify(__oldseqc))); \ + __predict_true(*__seqcp == __oldseqc); \ +}) + +#define seqc_consistent(seqcp, oldseqc) ({ \ + atomic_thread_fence_acq(); \ + seqc_consistent_nomb(seqcp, oldseqc); \ +}) + +/* + * Variant which does not critical enter/exit. + */ +static __inline void +seqc_sleepable_write_begin(seqc_t *seqcp) { - return (*seqcp == oldseqc); + MPASS(!seqc_in_modify(*seqcp)); + *seqcp += 1; + atomic_thread_fence_rel(); } -static __inline bool -seqc_consistent(const seqc_t *seqcp, seqc_t oldseqc) +static __inline void +seqc_sleepable_write_end(seqc_t *seqcp) { - atomic_thread_fence_acq(); - return (seqc_consistent_nomb(seqcp, oldseqc)); + atomic_thread_fence_rel(); + *seqcp += 1; + MPASS(!seqc_in_modify(*seqcp)); } #endif /* _KERNEL */ From owner-svn-src-all@freebsd.org Sat Jul 25 10:31:54 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 623EC3A659A; Sat, 25 Jul 2020 10:31:54 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BDMnQ2L1jz437D; Sat, 25 Jul 2020 10:31:54 +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 32BFF1A689; Sat, 25 Jul 2020 10:31:54 +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 06PAVsC3040688; Sat, 25 Jul 2020 10:31:54 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06PAVrMO040681; Sat, 25 Jul 2020 10:31:53 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202007251031.06PAVrMO040681@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Sat, 25 Jul 2020 10:31:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363517 - in head/sys: cddl/compat/opensolaris/kern kern sys X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: in head/sys: cddl/compat/opensolaris/kern kern sys X-SVN-Commit-Revision: 363517 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 25 Jul 2020 10:31:54 -0000 Author: mjg Date: Sat Jul 25 10:31:52 2020 New Revision: 363517 URL: https://svnweb.freebsd.org/changeset/base/363517 Log: vfs: introduce vnode sequence counters Modified on each permission change and link/unlink. Reviewed by: kib Tested by: pho (in a patchset) Differential Revision: https://reviews.freebsd.org/D25573 Modified: head/sys/cddl/compat/opensolaris/kern/opensolaris_vfs.c head/sys/kern/vfs_mount.c head/sys/kern/vfs_subr.c head/sys/kern/vnode_if.src head/sys/sys/vnode.h Modified: head/sys/cddl/compat/opensolaris/kern/opensolaris_vfs.c ============================================================================== --- head/sys/cddl/compat/opensolaris/kern/opensolaris_vfs.c Sat Jul 25 10:29:48 2020 (r363516) +++ head/sys/cddl/compat/opensolaris/kern/opensolaris_vfs.c Sat Jul 25 10:31:52 2020 (r363517) @@ -154,6 +154,7 @@ mount_snapshot(kthread_t *td, vnode_t **vpp, const cha vput(vp); return (error); } + vn_seqc_write_begin(vp); VOP_UNLOCK(vp); /* @@ -206,6 +207,7 @@ mount_snapshot(kthread_t *td, vnode_t **vpp, const cha VI_LOCK(vp); vp->v_iflag &= ~VI_MOUNT; VI_UNLOCK(vp); + vn_seqc_write_end(vp); vput(vp); vfs_unbusy(mp); vfs_freeopts(mp->mnt_optnew); @@ -241,6 +243,7 @@ mount_snapshot(kthread_t *td, vnode_t **vpp, const cha vfs_event_signal(NULL, VQ_MOUNT, 0); if (VFS_ROOT(mp, LK_EXCLUSIVE, &mvp)) panic("mount: lost mount"); + vn_seqc_write_end(vp); VOP_UNLOCK(vp); vfs_op_exit(mp); vfs_unbusy(mp); Modified: head/sys/kern/vfs_mount.c ============================================================================== --- head/sys/kern/vfs_mount.c Sat Jul 25 10:29:48 2020 (r363516) +++ head/sys/kern/vfs_mount.c Sat Jul 25 10:31:52 2020 (r363517) @@ -947,6 +947,7 @@ vfs_domount_first( vput(vp); return (error); } + vn_seqc_write_begin(vp); VOP_UNLOCK(vp); /* Allocate and initialize the filesystem. */ @@ -979,9 +980,11 @@ vfs_domount_first( VI_LOCK(vp); vp->v_iflag &= ~VI_MOUNT; VI_UNLOCK(vp); + vn_seqc_write_end(vp); vrele(vp); return (error); } + vn_seqc_write_begin(newdp); VOP_UNLOCK(newdp); if (mp->mnt_opt != NULL) @@ -1018,6 +1021,8 @@ vfs_domount_first( EVENTHANDLER_DIRECT_INVOKE(vfs_mounted, mp, newdp, td); VOP_UNLOCK(newdp); mountcheckdirs(vp, newdp); + vn_seqc_write_end(vp); + vn_seqc_write_end(newdp); vrele(newdp); if ((mp->mnt_flag & MNT_RDONLY) == 0) vfs_allocate_syncvnode(mp); @@ -1094,7 +1099,9 @@ vfs_domount_update( VOP_UNLOCK(vp); vfs_op_enter(mp); + vn_seqc_write_begin(vp); + rootvp = NULL; MNT_ILOCK(mp); if ((mp->mnt_kern_flag & MNTK_UNMOUNT) != 0) { MNT_IUNLOCK(mp); @@ -1108,8 +1115,6 @@ vfs_domount_update( mp->mnt_kern_flag &= ~MNTK_ASYNC; rootvp = vfs_cache_root_clear(mp); MNT_IUNLOCK(mp); - if (rootvp != NULL) - vrele(rootvp); mp->mnt_optnew = *optlist; vfs_mergeopts(mp->mnt_optnew, mp->mnt_opt); @@ -1233,6 +1238,11 @@ vfs_domount_update( vfs_deallocate_syncvnode(mp); end: vfs_op_exit(mp); + if (rootvp != NULL) { + vn_seqc_write_end(rootvp); + vrele(rootvp); + } + vn_seqc_write_end(vp); vfs_unbusy(mp); VI_LOCK(vp); vp->v_iflag &= ~VI_MOUNT; @@ -1723,14 +1733,19 @@ dounmount(struct mount *mp, int flags, struct thread * } mp->mnt_kern_flag |= MNTK_UNMOUNT; rootvp = vfs_cache_root_clear(mp); + if (coveredvp != NULL) + vn_seqc_write_begin(coveredvp); if (flags & MNT_NONBUSY) { MNT_IUNLOCK(mp); error = vfs_check_usecounts(mp); MNT_ILOCK(mp); if (error != 0) { + vn_seqc_write_end(coveredvp); dounmount_cleanup(mp, coveredvp, MNTK_UNMOUNT); - if (rootvp != NULL) + if (rootvp != NULL) { + vn_seqc_write_end(rootvp); vrele(rootvp); + } return (error); } } @@ -1759,22 +1774,19 @@ dounmount(struct mount *mp, int flags, struct thread * ("%s: invalid return value for msleep in the drain path @ %s:%d", __func__, __FILE__, __LINE__)); - if (rootvp != NULL) + /* + * We want to keep the vnode around so that we can vn_seqc_write_end + * after we are done with unmount. Downgrade our reference to a mere + * hold count so that we don't interefere with anything. + */ + if (rootvp != NULL) { + vhold(rootvp); vrele(rootvp); + } if (mp->mnt_flag & MNT_EXPUBLIC) vfs_setpublicfs(NULL, NULL, NULL); - /* - * From now, we can claim that the use reference on the - * coveredvp is ours, and the ref can be released only by - * successfull unmount by us, or left for later unmount - * attempt. The previously acquired hold reference is no - * longer needed to protect the vnode from reuse. - */ - if (coveredvp != NULL) - vdrop(coveredvp); - vfs_periodic(mp, MNT_WAIT); MNT_ILOCK(mp); async_flag = mp->mnt_flag & MNT_ASYNC; @@ -1809,8 +1821,15 @@ dounmount(struct mount *mp, int flags, struct thread * } vfs_op_exit_locked(mp); MNT_IUNLOCK(mp); - if (coveredvp) + if (coveredvp) { + vn_seqc_write_end(coveredvp); VOP_UNLOCK(coveredvp); + vdrop(coveredvp); + } + if (rootvp != NULL) { + vn_seqc_write_end(rootvp); + vdrop(rootvp); + } return (error); } mtx_lock(&mountlist_mtx); @@ -1819,7 +1838,13 @@ dounmount(struct mount *mp, int flags, struct thread * EVENTHANDLER_DIRECT_INVOKE(vfs_unmounted, mp, td); if (coveredvp != NULL) { coveredvp->v_mountedhere = NULL; + vn_seqc_write_end(coveredvp); VOP_UNLOCK(coveredvp); + vdrop(coveredvp); + } + if (rootvp != NULL) { + vn_seqc_write_end(rootvp); + vdrop(rootvp); } vfs_event_signal(NULL, VQ_UNMOUNT, 0); if (rootvnode != NULL && mp == rootvnode->v_mount) { Modified: head/sys/kern/vfs_subr.c ============================================================================== --- head/sys/kern/vfs_subr.c Sat Jul 25 10:29:48 2020 (r363516) +++ head/sys/kern/vfs_subr.c Sat Jul 25 10:31:52 2020 (r363517) @@ -1761,6 +1761,12 @@ freevnode(struct vnode *vp) * so as not to contaminate the freshly allocated vnode. */ CTR2(KTR_VFS, "%s: destroying the vnode %p", __func__, vp); + /* + * Paired with vgone. + */ + vn_seqc_write_end_locked(vp); + VNPASS(vp->v_seqc_users == 0, vp); + bo = &vp->v_bufobj; VNASSERT(vp->v_data == NULL, vp, ("cleaned vnode isn't")); VNPASS(vp->v_holdcnt == VHOLD_NO_SMR, vp); @@ -4018,6 +4024,10 @@ vgonel(struct vnode *vp) */ if (vp->v_irflag & VIRF_DOOMED) return; + /* + * Paired with freevnode. + */ + vn_seqc_write_begin_locked(vp); vunlazy_gone(vp); vp->v_irflag |= VIRF_DOOMED; @@ -4160,8 +4170,9 @@ vn_printf(struct vnode *vp, const char *fmt, ...) printf("%p: ", (void *)vp); printf("type %s\n", typename[vp->v_type]); holdcnt = atomic_load_int(&vp->v_holdcnt); - printf(" usecount %d, writecount %d, refcount %d", - vp->v_usecount, vp->v_writecount, holdcnt & ~VHOLD_ALL_FLAGS); + printf(" usecount %d, writecount %d, refcount %d seqc users %d", + vp->v_usecount, vp->v_writecount, holdcnt & ~VHOLD_ALL_FLAGS, + vp->v_seqc_users); switch (vp->v_type) { case VDIR: printf(" mountedhere %p\n", vp->v_mountedhere); @@ -5508,6 +5519,14 @@ vop_rename_pre(void *ap) ASSERT_VOP_LOCKED(a->a_tvp, "vop_rename: tvp not locked"); ASSERT_VOP_LOCKED(a->a_tdvp, "vop_rename: tdvp not locked"); #endif + /* + * It may be tempting to add vn_seqc_write_begin/end calls here and + * in vop_rename_post but that's not going to work out since some + * filesystems relookup vnodes mid-rename. This is probably a bug. + * + * For now filesystems are expected to do the relevant calls after they + * decide what vnodes to operate on. + */ if (a->a_tdvp != a->a_fdvp) vhold(a->a_fdvp); if (a->a_tvp != a->a_fvp) @@ -5589,69 +5608,193 @@ vop_need_inactive_post(void *ap, int rc) #endif void +vop_create_pre(void *ap) +{ + struct vop_create_args *a; + struct vnode *dvp; + + a = ap; + dvp = a->a_dvp; + vn_seqc_write_begin(dvp); +} + +void vop_create_post(void *ap, int rc) { - struct vop_create_args *a = ap; + struct vop_create_args *a; + struct vnode *dvp; + a = ap; + dvp = a->a_dvp; + vn_seqc_write_end(dvp); if (!rc) - VFS_KNOTE_LOCKED(a->a_dvp, NOTE_WRITE); + VFS_KNOTE_LOCKED(dvp, NOTE_WRITE); } void +vop_whiteout_pre(void *ap) +{ + struct vop_whiteout_args *a; + struct vnode *dvp; + + a = ap; + dvp = a->a_dvp; + vn_seqc_write_begin(dvp); +} + +void +vop_whiteout_post(void *ap, int rc) +{ + struct vop_whiteout_args *a; + struct vnode *dvp; + + a = ap; + dvp = a->a_dvp; + vn_seqc_write_end(dvp); +} + +void +vop_deleteextattr_pre(void *ap) +{ + struct vop_deleteextattr_args *a; + struct vnode *vp; + + a = ap; + vp = a->a_vp; + vn_seqc_write_begin(vp); +} + +void vop_deleteextattr_post(void *ap, int rc) { - struct vop_deleteextattr_args *a = ap; + struct vop_deleteextattr_args *a; + struct vnode *vp; + a = ap; + vp = a->a_vp; + vn_seqc_write_end(vp); if (!rc) VFS_KNOTE_LOCKED(a->a_vp, NOTE_ATTRIB); } void +vop_link_pre(void *ap) +{ + struct vop_link_args *a; + struct vnode *vp, *tdvp; + + a = ap; + vp = a->a_vp; + tdvp = a->a_tdvp; + vn_seqc_write_begin(vp); + vn_seqc_write_begin(tdvp); +} + +void vop_link_post(void *ap, int rc) { - struct vop_link_args *a = ap; + struct vop_link_args *a; + struct vnode *vp, *tdvp; + a = ap; + vp = a->a_vp; + tdvp = a->a_tdvp; + vn_seqc_write_end(vp); + vn_seqc_write_end(tdvp); if (!rc) { - VFS_KNOTE_LOCKED(a->a_vp, NOTE_LINK); - VFS_KNOTE_LOCKED(a->a_tdvp, NOTE_WRITE); + VFS_KNOTE_LOCKED(vp, NOTE_LINK); + VFS_KNOTE_LOCKED(tdvp, NOTE_WRITE); } } void +vop_mkdir_pre(void *ap) +{ + struct vop_mkdir_args *a; + struct vnode *dvp; + + a = ap; + dvp = a->a_dvp; + vn_seqc_write_begin(dvp); +} + +void vop_mkdir_post(void *ap, int rc) { - struct vop_mkdir_args *a = ap; + struct vop_mkdir_args *a; + struct vnode *dvp; + a = ap; + dvp = a->a_dvp; + vn_seqc_write_end(dvp); if (!rc) - VFS_KNOTE_LOCKED(a->a_dvp, NOTE_WRITE | NOTE_LINK); + VFS_KNOTE_LOCKED(dvp, NOTE_WRITE | NOTE_LINK); } void +vop_mknod_pre(void *ap) +{ + struct vop_mknod_args *a; + struct vnode *dvp; + + a = ap; + dvp = a->a_dvp; + vn_seqc_write_begin(dvp); +} + +void vop_mknod_post(void *ap, int rc) { - struct vop_mknod_args *a = ap; + struct vop_mknod_args *a; + struct vnode *dvp; + a = ap; + dvp = a->a_dvp; + vn_seqc_write_end(dvp); if (!rc) - VFS_KNOTE_LOCKED(a->a_dvp, NOTE_WRITE); + VFS_KNOTE_LOCKED(dvp, NOTE_WRITE); } void vop_reclaim_post(void *ap, int rc) { - struct vop_reclaim_args *a = ap; + struct vop_reclaim_args *a; + struct vnode *vp; + a = ap; + vp = a->a_vp; + ASSERT_VOP_IN_SEQC(vp); if (!rc) - VFS_KNOTE_LOCKED(a->a_vp, NOTE_REVOKE); + VFS_KNOTE_LOCKED(vp, NOTE_REVOKE); } void +vop_remove_pre(void *ap) +{ + struct vop_remove_args *a; + struct vnode *dvp, *vp; + + a = ap; + dvp = a->a_dvp; + vp = a->a_vp; + vn_seqc_write_begin(dvp); + vn_seqc_write_begin(vp); +} + +void vop_remove_post(void *ap, int rc) { - struct vop_remove_args *a = ap; + struct vop_remove_args *a; + struct vnode *dvp, *vp; + a = ap; + dvp = a->a_dvp; + vp = a->a_vp; + vn_seqc_write_end(dvp); + vn_seqc_write_end(vp); if (!rc) { - VFS_KNOTE_LOCKED(a->a_dvp, NOTE_WRITE); - VFS_KNOTE_LOCKED(a->a_vp, NOTE_DELETE); + VFS_KNOTE_LOCKED(dvp, NOTE_WRITE); + VFS_KNOTE_LOCKED(vp, NOTE_DELETE); } } @@ -5694,41 +5837,127 @@ vop_rename_post(void *ap, int rc) } void +vop_rmdir_pre(void *ap) +{ + struct vop_rmdir_args *a; + struct vnode *dvp, *vp; + + a = ap; + dvp = a->a_dvp; + vp = a->a_vp; + vn_seqc_write_begin(dvp); + vn_seqc_write_begin(vp); +} + +void vop_rmdir_post(void *ap, int rc) { - struct vop_rmdir_args *a = ap; + struct vop_rmdir_args *a; + struct vnode *dvp, *vp; + a = ap; + dvp = a->a_dvp; + vp = a->a_vp; + vn_seqc_write_end(dvp); + vn_seqc_write_end(vp); if (!rc) { - VFS_KNOTE_LOCKED(a->a_dvp, NOTE_WRITE | NOTE_LINK); - VFS_KNOTE_LOCKED(a->a_vp, NOTE_DELETE); + VFS_KNOTE_LOCKED(dvp, NOTE_WRITE | NOTE_LINK); + VFS_KNOTE_LOCKED(vp, NOTE_DELETE); } } void +vop_setattr_pre(void *ap) +{ + struct vop_setattr_args *a; + struct vnode *vp; + + a = ap; + vp = a->a_vp; + vn_seqc_write_begin(vp); +} + +void vop_setattr_post(void *ap, int rc) { - struct vop_setattr_args *a = ap; + struct vop_setattr_args *a; + struct vnode *vp; + a = ap; + vp = a->a_vp; + vn_seqc_write_end(vp); if (!rc) - VFS_KNOTE_LOCKED(a->a_vp, NOTE_ATTRIB); + VFS_KNOTE_LOCKED(vp, NOTE_ATTRIB); } void +vop_setacl_pre(void *ap) +{ + struct vop_setacl_args *a; + struct vnode *vp; + + a = ap; + vp = a->a_vp; + vn_seqc_write_begin(vp); +} + +void +vop_setacl_post(void *ap, int rc __unused) +{ + struct vop_setacl_args *a; + struct vnode *vp; + + a = ap; + vp = a->a_vp; + vn_seqc_write_end(vp); +} + +void +vop_setextattr_pre(void *ap) +{ + struct vop_setextattr_args *a; + struct vnode *vp; + + a = ap; + vp = a->a_vp; + vn_seqc_write_begin(vp); +} + +void vop_setextattr_post(void *ap, int rc) { - struct vop_setextattr_args *a = ap; + struct vop_setextattr_args *a; + struct vnode *vp; + a = ap; + vp = a->a_vp; + vn_seqc_write_end(vp); if (!rc) - VFS_KNOTE_LOCKED(a->a_vp, NOTE_ATTRIB); + VFS_KNOTE_LOCKED(vp, NOTE_ATTRIB); } void +vop_symlink_pre(void *ap) +{ + struct vop_symlink_args *a; + struct vnode *dvp; + + a = ap; + dvp = a->a_dvp; + vn_seqc_write_begin(dvp); +} + +void vop_symlink_post(void *ap, int rc) { - struct vop_symlink_args *a = ap; + struct vop_symlink_args *a; + struct vnode *dvp; + a = ap; + dvp = a->a_dvp; + vn_seqc_write_end(dvp); if (!rc) - VFS_KNOTE_LOCKED(a->a_dvp, NOTE_WRITE); + VFS_KNOTE_LOCKED(dvp, NOTE_WRITE); } void @@ -6281,6 +6510,8 @@ vfs_cache_root_clear(struct mount *mp) */ MPASS(mp->mnt_vfs_ops > 0); vp = mp->mnt_rootvnode; + if (vp != NULL) + vn_seqc_write_begin(vp); mp->mnt_rootvnode = NULL; return (vp); } @@ -6576,4 +6807,45 @@ vn_dir_check_exec(struct vnode *vp, struct componentna } return (VOP_ACCESS(vp, VEXEC, cnp->cn_cred, cnp->cn_thread)); +} + +void +vn_seqc_write_begin_locked(struct vnode *vp) +{ + + ASSERT_VI_LOCKED(vp, __func__); + VNPASS(vp->v_holdcnt > 0, vp); + VNPASS(vp->v_seqc_users >= 0, vp); + vp->v_seqc_users++; + if (vp->v_seqc_users == 1) + seqc_sleepable_write_begin(&vp->v_seqc); +} + +void +vn_seqc_write_begin(struct vnode *vp) +{ + + VI_LOCK(vp); + vn_seqc_write_begin_locked(vp); + VI_UNLOCK(vp); +} + +void +vn_seqc_write_end_locked(struct vnode *vp) +{ + + ASSERT_VI_LOCKED(vp, __func__); + VNPASS(vp->v_seqc_users > 0, vp); + vp->v_seqc_users--; + if (vp->v_seqc_users == 0) + seqc_sleepable_write_end(&vp->v_seqc); +} + +void +vn_seqc_write_end(struct vnode *vp) +{ + + VI_LOCK(vp); + vn_seqc_write_end_locked(vp); + VI_UNLOCK(vp); } Modified: head/sys/kern/vnode_if.src ============================================================================== --- head/sys/kern/vnode_if.src Sat Jul 25 10:29:48 2020 (r363516) +++ head/sys/kern/vnode_if.src Sat Jul 25 10:31:52 2020 (r363517) @@ -88,6 +88,7 @@ vop_cachedlookup { %% create dvp E E E %% create vpp - L - +%! create pre vop_create_pre %! create post vop_create_post vop_create { @@ -99,6 +100,8 @@ vop_create { %% whiteout dvp E E E +%! whiteout pre vop_whiteout_pre +%! whiteout post vop_whiteout_post vop_whiteout { IN struct vnode *dvp; @@ -109,6 +112,7 @@ vop_whiteout { %% mknod dvp E E E %% mknod vpp - L - +%! mknod pre vop_mknod_pre %! mknod post vop_mknod_post vop_mknod { @@ -172,6 +176,7 @@ vop_getattr { %% setattr vp E E E +%! setattr pre vop_setattr_pre %! setattr post vop_setattr_post vop_setattr { @@ -260,6 +265,7 @@ vop_fsync { %% remove dvp E E E %% remove vp E E E +%! remove pre vop_remove_pre %! remove post vop_remove_post vop_remove { @@ -271,6 +277,7 @@ vop_remove { %% link tdvp E E E %% link vp E E E +%! link pre vop_link_pre %! link post vop_link_post vop_link { @@ -295,6 +302,7 @@ vop_rename { %% mkdir dvp E E E %% mkdir vpp - E - +%! mkdir pre vop_mkdir_pre %! mkdir post vop_mkdir_post vop_mkdir { @@ -307,6 +315,7 @@ vop_mkdir { %% rmdir dvp E E E %% rmdir vp E E E +%! rmdir pre vop_rmdir_pre %! rmdir post vop_rmdir_post vop_rmdir { @@ -318,6 +327,7 @@ vop_rmdir { %% symlink dvp E E E %% symlink vpp - E - +%! symlink pre vop_symlink_pre %! symlink post vop_symlink_post vop_symlink { @@ -523,6 +533,8 @@ vop_getacl { %% setacl vp E E E +%! setacl pre vop_setacl_pre +%! setacl post vop_setacl_post vop_setacl { IN struct vnode *vp; @@ -589,6 +601,7 @@ vop_openextattr { %% deleteextattr vp E E E +%! deleteextattr pre vop_deleteextattr_pre %! deleteextattr post vop_deleteextattr_post vop_deleteextattr { @@ -601,6 +614,7 @@ vop_deleteextattr { %% setextattr vp E E E +%! setextattr pre vop_setextattr_pre %! setextattr post vop_setextattr_post vop_setextattr { Modified: head/sys/sys/vnode.h ============================================================================== --- head/sys/sys/vnode.h Sat Jul 25 10:29:48 2020 (r363516) +++ head/sys/sys/vnode.h Sat Jul 25 10:31:52 2020 (r363517) @@ -45,6 +45,7 @@ #include #include #include +#include /* * The vnode is the focus of all file activity in UNIX. There is a @@ -105,6 +106,7 @@ struct vnode { */ enum vtype v_type:8; /* u vnode type */ short v_irflag; /* i frequently read flags */ + seqc_t v_seqc; /* i modification count */ struct vop_vector *v_op; /* u vnode operations vector */ void *v_data; /* u private data for fs */ @@ -175,6 +177,7 @@ struct vnode { short v_dbatchcpu; /* i LRU requeue deferral batch */ int v_writecount; /* I ref count of writers or (negative) text users */ + int v_seqc_users; /* i modifications pending */ u_int v_hash; }; @@ -539,6 +542,18 @@ void assert_vop_unlocked(struct vnode *vp, const char #define ASSERT_VOP_LOCKED(vp, str) assert_vop_locked((vp), (str)) #define ASSERT_VOP_UNLOCKED(vp, str) assert_vop_unlocked((vp), (str)) +#define ASSERT_VOP_IN_SEQC(vp) do { \ + struct vnode *_vp = (vp); \ + \ + VNPASS(seqc_in_modify(_vp->v_seqc), _vp); \ +} while (0) + +#define ASSERT_VOP_NOT_IN_SEQC(vp) do { \ + struct vnode *_vp = (vp); \ + \ + VNPASS(!seqc_in_modify(_vp->v_seqc), _vp); \ +} while (0) + #else /* !DEBUG_VFS_LOCKS */ #define ASSERT_VI_LOCKED(vp, str) ((void)0) @@ -546,6 +561,10 @@ void assert_vop_unlocked(struct vnode *vp, const char #define ASSERT_VOP_ELOCKED(vp, str) ((void)0) #define ASSERT_VOP_LOCKED(vp, str) ((void)0) #define ASSERT_VOP_UNLOCKED(vp, str) ((void)0) + +#define ASSERT_VOP_IN_SEQC(vp) ((void)0) +#define ASSERT_VOP_NOT_IN_SEQC(vp) ((void)0) + #endif /* DEBUG_VFS_LOCKS */ @@ -738,6 +757,13 @@ int vn_io_fault_uiomove(char *data, int xfersize, stru int vn_io_fault_pgmove(vm_page_t ma[], vm_offset_t offset, int xfersize, struct uio *uio); +void vn_seqc_write_begin_locked(struct vnode *vp); +void vn_seqc_write_begin(struct vnode *vp); +void vn_seqc_write_end_locked(struct vnode *vp); +void vn_seqc_write_end(struct vnode *vp); +#define vn_seqc_read_any(vp) seqc_read_any(&(vp)->v_seqc) +#define vn_seqc_consistent(vp, seq) seqc_consistent(&(vp)->v_seqc, seq) + #define vn_rangelock_unlock(vp, cookie) \ rangelock_unlock(&(vp)->v_rl, (cookie), VI_MTX(vp)) #define vn_rangelock_unlock_range(vp, cookie, start, end) \ @@ -804,23 +830,37 @@ int dead_write(struct vop_write_args *ap); /* These are called from within the actual VOPS. */ void vop_close_post(void *a, int rc); +void vop_create_pre(void *a); void vop_create_post(void *a, int rc); +void vop_whiteout_pre(void *a); +void vop_whiteout_post(void *a, int rc); +void vop_deleteextattr_pre(void *a); void vop_deleteextattr_post(void *a, int rc); +void vop_link_pre(void *a); void vop_link_post(void *a, int rc); void vop_lookup_post(void *a, int rc); void vop_lookup_pre(void *a); +void vop_mkdir_pre(void *a); void vop_mkdir_post(void *a, int rc); +void vop_mknod_pre(void *a); void vop_mknod_post(void *a, int rc); void vop_open_post(void *a, int rc); void vop_read_post(void *a, int rc); void vop_readdir_post(void *a, int rc); void vop_reclaim_post(void *a, int rc); +void vop_remove_pre(void *a); void vop_remove_post(void *a, int rc); void vop_rename_post(void *a, int rc); void vop_rename_pre(void *a); +void vop_rmdir_pre(void *a); void vop_rmdir_post(void *a, int rc); +void vop_setattr_pre(void *a); void vop_setattr_post(void *a, int rc); +void vop_setacl_pre(void *a); +void vop_setacl_post(void *a, int rc); +void vop_setextattr_pre(void *a); void vop_setextattr_post(void *a, int rc); +void vop_symlink_pre(void *a); void vop_symlink_post(void *a, int rc); int vop_sigdefer(struct vop_vector *vop, struct vop_generic_args *a); From owner-svn-src-all@freebsd.org Sat Jul 25 10:32:47 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A133C3A675F; Sat, 25 Jul 2020 10:32:47 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BDMpR3r2jz438n; Sat, 25 Jul 2020 10:32:47 +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 67B471A6C7; Sat, 25 Jul 2020 10:32:47 +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 06PAWl5a043380; Sat, 25 Jul 2020 10:32:47 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06PAWjP1043373; Sat, 25 Jul 2020 10:32:45 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202007251032.06PAWjP1043373@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Sat, 25 Jul 2020 10:32:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363518 - in head/sys: kern security/mac sys X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: in head/sys: kern security/mac sys X-SVN-Commit-Revision: 363518 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 25 Jul 2020 10:32:47 -0000 Author: mjg Date: Sat Jul 25 10:32:45 2020 New Revision: 363518 URL: https://svnweb.freebsd.org/changeset/base/363518 Log: vfs: add the infrastructure for lockless lookup Reviewed by: kib Tested by: pho (in a patchset) Differential Revision: https://reviews.freebsd.org/D25577 Modified: head/sys/kern/kern_descrip.c head/sys/kern/vfs_subr.c head/sys/kern/vnode_if.src head/sys/security/mac/mac_framework.h head/sys/sys/filedesc.h head/sys/sys/mount.h head/sys/sys/vnode.h Modified: head/sys/kern/kern_descrip.c ============================================================================== --- head/sys/kern/kern_descrip.c Sat Jul 25 10:31:52 2020 (r363517) +++ head/sys/kern/kern_descrip.c Sat Jul 25 10:32:45 2020 (r363518) @@ -102,8 +102,8 @@ MALLOC_DECLARE(M_FADVISE); static __read_mostly uma_zone_t file_zone; static __read_mostly uma_zone_t filedesc0_zone; -static __read_mostly uma_zone_t pwd_zone; -static __read_mostly smr_t pwd_smr; +__read_mostly uma_zone_t pwd_zone; +VFS_SMR_DECLARE; static int closefp(struct filedesc *fdp, int fd, struct file *fp, struct thread *td, int holdleaders); @@ -3343,21 +3343,30 @@ pwd_hold(struct thread *td) fdp = td->td_proc->p_fd; - smr_enter(pwd_smr); - pwd = smr_entered_load(&fdp->fd_pwd, pwd_smr); + vfs_smr_enter(); + pwd = vfs_smr_entered_load(&fdp->fd_pwd); MPASS(pwd != NULL); if (__predict_true(refcount_acquire_if_not_zero(&pwd->pwd_refcount))) { - smr_exit(pwd_smr); + vfs_smr_exit(); return (pwd); } - smr_exit(pwd_smr); + vfs_smr_exit(); FILEDESC_SLOCK(fdp); pwd = pwd_hold_filedesc(fdp); MPASS(pwd != NULL); - FILEDESC_SUNLOCK(fdp); return (pwd); } +struct pwd * +pwd_get_smr(void) +{ + struct pwd *pwd; + + pwd = vfs_smr_entered_load(&curproc->p_fd->fd_pwd); + MPASS(pwd != NULL); + return (pwd); +} + static struct pwd * pwd_alloc(void) { @@ -4368,7 +4377,11 @@ filelistinit(void *dummy) NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, 0); pwd_zone = uma_zcreate("PWD", sizeof(struct pwd), NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_SMR); - pwd_smr = uma_zone_get_smr(pwd_zone); + /* + * XXXMJG this is a temporary hack due to boot ordering issues against + * the vnode zone. + */ + vfs_smr = uma_zone_get_smr(pwd_zone); mtx_init(&sigio_lock, "sigio lock", NULL, MTX_DEF); } SYSINIT(select, SI_SUB_LOCK, SI_ORDER_FIRST, filelistinit, NULL); Modified: head/sys/kern/vfs_subr.c ============================================================================== --- head/sys/kern/vfs_subr.c Sat Jul 25 10:31:52 2020 (r363517) +++ head/sys/kern/vfs_subr.c Sat Jul 25 10:32:45 2020 (r363518) @@ -664,8 +664,8 @@ vntblinit(void *dummy __unused) vnode_list_reclaim_marker = vn_alloc_marker(NULL); TAILQ_INSERT_HEAD(&vnode_list, vnode_list_reclaim_marker, v_vnodelist); vnode_zone = uma_zcreate("VNODE", sizeof (struct vnode), NULL, NULL, - vnode_init, vnode_fini, UMA_ALIGN_PTR, UMA_ZONE_SMR); - vfs_smr = uma_zone_get_smr(vnode_zone); + vnode_init, vnode_fini, UMA_ALIGN_PTR, 0); + uma_zone_set_smr(vnode_zone, vfs_smr); vnodepoll_zone = uma_zcreate("VNODEPOLL", sizeof (struct vpollinfo), NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, 0); /* @@ -2914,6 +2914,22 @@ vget_prep(struct vnode *vp) return (vs); } +void +vget_abort(struct vnode *vp, enum vgetstate vs) +{ + + switch (vs) { + case VGET_USECOUNT: + vrele(vp); + break; + case VGET_HOLDCNT: + vdrop(vp); + break; + default: + __assert_unreachable(); + } +} + int vget(struct vnode *vp, int flags, struct thread *td) { @@ -2925,7 +2941,7 @@ vget(struct vnode *vp, int flags, struct thread *td) return (vget_finish(vp, flags, vs)); } -static int __noinline +static void __noinline vget_finish_vchr(struct vnode *vp) { @@ -2941,7 +2957,7 @@ vget_finish_vchr(struct vnode *vp) #else refcount_release(&vp->v_holdcnt); #endif - return (0); + return; } VI_LOCK(vp); @@ -2953,18 +2969,17 @@ vget_finish_vchr(struct vnode *vp) refcount_release(&vp->v_holdcnt); #endif VI_UNLOCK(vp); - return (0); + return; } v_incr_devcount(vp); refcount_acquire(&vp->v_usecount); VI_UNLOCK(vp); - return (0); } int vget_finish(struct vnode *vp, int flags, enum vgetstate vs) { - int error, old; + int error; if ((flags & LK_INTERLOCK) != 0) ASSERT_VI_LOCKED(vp, __func__); @@ -2976,20 +2991,32 @@ vget_finish(struct vnode *vp, int flags, enum vgetstat error = vn_lock(vp, flags); if (__predict_false(error != 0)) { - if (vs == VGET_USECOUNT) - vrele(vp); - else - vdrop(vp); + vget_abort(vp, vs); CTR2(KTR_VFS, "%s: impossible to lock vnode %p", __func__, vp); return (error); } + vget_finish_ref(vp, vs); + return (0); +} + +void +vget_finish_ref(struct vnode *vp, enum vgetstate vs) +{ + int old; + + VNPASS(vs == VGET_HOLDCNT || vs == VGET_USECOUNT, vp); + VNPASS(vp->v_holdcnt > 0, vp); + VNPASS(vs == VGET_HOLDCNT || vp->v_usecount > 0, vp); + if (vs == VGET_USECOUNT) - return (0); + return; - if (__predict_false(vp->v_type == VCHR)) - return (vget_finish_vchr(vp)); + if (__predict_false(vp->v_type == VCHR)) { + vget_finish_vchr(vp); + return; + } /* * We hold the vnode. If the usecount is 0 it will be utilized to keep @@ -3006,7 +3033,6 @@ vget_finish(struct vnode *vp, int flags, enum vgetstat refcount_release(&vp->v_holdcnt); #endif } - return (0); } /* @@ -4424,6 +4450,7 @@ DB_SHOW_COMMAND(mount, db_show_mount) MNT_KERN_FLAG(MNTK_LOOKUP_EXCL_DOTDOT); MNT_KERN_FLAG(MNTK_MARKER); MNT_KERN_FLAG(MNTK_USES_BCACHE); + MNT_KERN_FLAG(MNTK_FPLOOKUP); MNT_KERN_FLAG(MNTK_NOASYNC); MNT_KERN_FLAG(MNTK_UNMOUNT); MNT_KERN_FLAG(MNTK_MWAIT); @@ -5240,6 +5267,38 @@ out: } /* + * VOP_FPLOOKUP_VEXEC routines are subject to special circumstances, see + * the comment above cache_fplookup for details. + * + * We never deny as priv_check_cred calls are not yet supported, see vaccess. + */ +int +vaccess_vexec_smr(mode_t file_mode, uid_t file_uid, gid_t file_gid, struct ucred *cred) +{ + + VFS_SMR_ASSERT_ENTERED(); + + /* Check the owner. */ + if (cred->cr_uid == file_uid) { + if (file_mode & S_IXUSR) + return (0); + return (EAGAIN); + } + + /* Otherwise, check the groups (first match) */ + if (groupmember(file_gid, cred)) { + if (file_mode & S_IXGRP) + return (0); + return (EAGAIN); + } + + /* Otherwise, check everyone else. */ + if (file_mode & S_IXOTH) + return (0); + return (EAGAIN); +} + +/* * Common filesystem object access control check routine. Accepts a * vnode's type, "mode", uid and gid, requested access mode, credentials, * and optional call-by-reference privused argument allowing vaccess() @@ -5537,6 +5596,20 @@ vop_rename_pre(void *ap) } #ifdef DEBUG_VFS_LOCKS +void +vop_fplookup_vexec_pre(void *ap __unused) +{ + + VFS_SMR_ASSERT_ENTERED(); +} + +void +vop_fplookup_vexec_post(void *ap __unused, int rc __unused) +{ + + VFS_SMR_ASSERT_ENTERED(); +} + void vop_strategy_pre(void *ap) { Modified: head/sys/kern/vnode_if.src ============================================================================== --- head/sys/kern/vnode_if.src Sat Jul 25 10:31:52 2020 (r363517) +++ head/sys/kern/vnode_if.src Sat Jul 25 10:32:45 2020 (r363518) @@ -146,6 +146,17 @@ vop_close { }; +%% fplookup_vexec vp - - - +%! fplookup_vexec pre vop_fplookup_vexec_pre +%! fplookup_vexec post vop_fplookup_vexec_post + +vop_fplookup_vexec { + IN struct vnode *vp; + IN struct ucred *cred; + IN struct thread *td; +}; + + %% access vp L L L vop_access { Modified: head/sys/security/mac/mac_framework.h ============================================================================== --- head/sys/security/mac/mac_framework.h Sat Jul 25 10:31:52 2020 (r363517) +++ head/sys/security/mac/mac_framework.h Sat Jul 25 10:32:45 2020 (r363518) @@ -422,13 +422,14 @@ int mac_vnode_check_listextattr(struct ucred *cred, st int mac_vnode_check_lookup_impl(struct ucred *cred, struct vnode *dvp, struct componentname *cnp); extern bool mac_vnode_check_lookup_fp_flag; +#define mac_vnode_check_lookup_enabled() __predict_false(mac_vnode_check_lookup_fp_flag) static inline int mac_vnode_check_lookup(struct ucred *cred, struct vnode *dvp, struct componentname *cnp) { mac_vnode_assert_locked(dvp, "mac_vnode_check_lookup"); - if (__predict_false(mac_vnode_check_lookup_fp_flag)) + if (mac_vnode_check_lookup_enabled()) return (mac_vnode_check_lookup_impl(cred, dvp, cnp)); return (0); } Modified: head/sys/sys/filedesc.h ============================================================================== --- head/sys/sys/filedesc.h Sat Jul 25 10:31:52 2020 (r363517) +++ head/sys/sys/filedesc.h Sat Jul 25 10:32:45 2020 (r363518) @@ -311,6 +311,7 @@ pwd_set(struct filedesc *fdp, struct pwd *newpwd) smr_serialized_store(&fdp->fd_pwd, newpwd, (FILEDESC_XLOCK_ASSERT(fdp), true)); } +struct pwd *pwd_get_smr(void); #endif /* _KERNEL */ Modified: head/sys/sys/mount.h ============================================================================== --- head/sys/sys/mount.h Sat Jul 25 10:31:52 2020 (r363517) +++ head/sys/sys/mount.h Sat Jul 25 10:32:45 2020 (r363518) @@ -420,6 +420,7 @@ void __mnt_vnode_markerfree_lazy(struct vnode #define MNTK_TEXT_REFS 0x00008000 /* Keep use ref for text */ #define MNTK_VMSETSIZE_BUG 0x00010000 #define MNTK_UNIONFS 0x00020000 /* A hack for F_ISUNIONSTACK */ +#define MNTK_FPLOOKUP 0x00040000 /* fast path lookup is supported */ #define MNTK_NOASYNC 0x00800000 /* disable async */ #define MNTK_UNMOUNT 0x01000000 /* unmount in progress */ #define MNTK_MWAIT 0x02000000 /* waiting for unmount to finish */ Modified: head/sys/sys/vnode.h ============================================================================== --- head/sys/sys/vnode.h Sat Jul 25 10:31:52 2020 (r363517) +++ head/sys/sys/vnode.h Sat Jul 25 10:32:45 2020 (r363518) @@ -666,6 +666,8 @@ int vn_path_to_global_path(struct thread *td, struct v int vaccess(enum vtype type, mode_t file_mode, uid_t file_uid, gid_t file_gid, accmode_t accmode, struct ucred *cred, int *privused); +int vaccess_vexec_smr(mode_t file_mode, uid_t file_uid, gid_t file_gid, + struct ucred *cred); int vaccess_acl_nfs4(enum vtype type, uid_t file_uid, gid_t file_gid, struct acl *aclp, accmode_t accmode, struct ucred *cred, int *privused); @@ -682,6 +684,8 @@ int vget(struct vnode *vp, int flags, struct thread *t enum vgetstate vget_prep_smr(struct vnode *vp); enum vgetstate vget_prep(struct vnode *vp); int vget_finish(struct vnode *vp, int flags, enum vgetstate vs); +void vget_finish_ref(struct vnode *vp, enum vgetstate vs); +void vget_abort(struct vnode *vp, enum vgetstate vs); void vgone(struct vnode *vp); void vhold(struct vnode *); void vholdl(struct vnode *); @@ -865,6 +869,8 @@ void vop_symlink_post(void *a, int rc); int vop_sigdefer(struct vop_vector *vop, struct vop_generic_args *a); #ifdef DEBUG_VFS_LOCKS +void vop_fplookup_vexec_pre(void *a); +void vop_fplookup_vexec_post(void *a, int rc); void vop_strategy_pre(void *a); void vop_lock_pre(void *a); void vop_lock_post(void *a, int rc); @@ -872,6 +878,8 @@ void vop_unlock_pre(void *a); void vop_need_inactive_pre(void *a); void vop_need_inactive_post(void *a, int rc); #else +#define vop_fplookup_vexec_pre(x) do { } while (0) +#define vop_fplookup_vexec_post(x, y) do { } while (0) #define vop_strategy_pre(x) do { } while (0) #define vop_lock_pre(x) do { } while (0) #define vop_lock_post(x, y) do { } while (0) @@ -1025,9 +1033,17 @@ int vn_dir_check_exec(struct vnode *vp, struct compone #define VFS_SMR() vfs_smr #define vfs_smr_enter() smr_enter(VFS_SMR()) #define vfs_smr_exit() smr_exit(VFS_SMR()) +#define vfs_smr_entered_load(ptr) smr_entered_load((ptr), VFS_SMR()) #define VFS_SMR_ASSERT_ENTERED() SMR_ASSERT_ENTERED(VFS_SMR()) #define VFS_SMR_ASSERT_NOT_ENTERED() SMR_ASSERT_NOT_ENTERED(VFS_SMR()) #define VFS_SMR_ZONE_SET(zone) uma_zone_set_smr((zone), VFS_SMR()) + +#define vn_load_v_data_smr(vp) ({ \ + struct vnode *_vp = (vp); \ + \ + VFS_SMR_ASSERT_ENTERED(); \ + atomic_load_ptr(&(_vp)->v_data); \ +}) #endif /* _KERNEL */ From owner-svn-src-all@freebsd.org Sat Jul 25 10:37:16 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 19A673A67F0; Sat, 25 Jul 2020 10:37:16 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BDMvb5dM6z43nG; Sat, 25 Jul 2020 10:37:15 +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 A4C9119E7A; Sat, 25 Jul 2020 10:37:15 +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 06PAbFde043848; Sat, 25 Jul 2020 10:37:15 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06PAbFAZ043845; Sat, 25 Jul 2020 10:37:15 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202007251037.06PAbFAZ043845@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Sat, 25 Jul 2020 10:37:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363519 - 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: 363519 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 25 Jul 2020 10:37:16 -0000 Author: mjg Date: Sat Jul 25 10:37:15 2020 New Revision: 363519 URL: https://svnweb.freebsd.org/changeset/base/363519 Log: vfs: lockless lookup Provides full scalability as long as all visited filesystems support the lookup and terminal vnodes are different. Inner workings are explained in the comment above cache_fplookup. Capabilities and fd-relative lookups are not supported and will result in immediate fallback to regular code. Symlinks, ".." in the path, mount points without support for lockless lookup and mismatched counters will result in an attempt to get a reference to the directory vnode and continue in regular lookup. If this fails, the entire operation is aborted and regular lookup starts from scratch. However, care is taken that data is not copied again from userspace. Sample benchmark: incremental -j 104 bzImage on tmpfs: before: 142.96s user 1025.63s system 4924% cpu 23.731 total after: 147.36s user 313.40s system 3216% cpu 14.326 total Sample microbenchmark: access calls to separate files in /tmpfs, 104 workers, ops/s: before: 2165816 after: 151216530 Reviewed by: kib Tested by: pho (in a patchset) Differential Revision: https://reviews.freebsd.org/D25578 Modified: head/sys/kern/vfs_cache.c head/sys/kern/vfs_lookup.c head/sys/sys/namei.h Modified: head/sys/kern/vfs_cache.c ============================================================================== --- head/sys/kern/vfs_cache.c Sat Jul 25 10:32:45 2020 (r363518) +++ head/sys/kern/vfs_cache.c Sat Jul 25 10:37:15 2020 (r363519) @@ -55,6 +55,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -67,6 +68,11 @@ __FBSDID("$FreeBSD$"); #include #endif +#include + +#include +#include + #ifdef DDB #include #endif @@ -100,6 +106,10 @@ SDT_PROBE_DEFINE2(vfs, namecache, zap_negative, done, SDT_PROBE_DEFINE2(vfs, namecache, shrink_negative, done, "struct vnode *", "char *"); +SDT_PROBE_DEFINE3(vfs, fplookup, lookup, done, "struct nameidata", "int", "bool"); +SDT_PROBE_DECLARE(vfs, namei, lookup, entry); +SDT_PROBE_DECLARE(vfs, namei, lookup, return); + /* * This structure describes the elements in the cache of recent * names looked up by namei. @@ -2835,3 +2845,859 @@ DB_SHOW_COMMAND(vpath, db_show_vpath) } #endif + +extern uma_zone_t namei_zone; + +static bool __read_frequently cache_fast_lookup = true; +SYSCTL_BOOL(_vfs, OID_AUTO, cache_fast_lookup, CTLFLAG_RW, + &cache_fast_lookup, 0, ""); + +#define CACHE_FPL_FAILED -2020 + +static void +cache_fpl_cleanup_cnp(struct componentname *cnp) +{ + + uma_zfree(namei_zone, cnp->cn_pnbuf); +#ifdef DIAGNOSTIC + cnp->cn_pnbuf = NULL; + cnp->cn_nameptr = NULL; +#endif +} + +static void +cache_fpl_handle_root(struct nameidata *ndp, struct vnode **dpp) +{ + struct componentname *cnp; + + cnp = &ndp->ni_cnd; + while (*(cnp->cn_nameptr) == '/') { + cnp->cn_nameptr++; + ndp->ni_pathlen--; + } + + *dpp = ndp->ni_rootdir; +} + +/* + * Components of nameidata (or objects it can point to) which may + * need restoring in case fast path lookup fails. + */ +struct nameidata_saved { + int cn_flags; + long cn_namelen; + char *cn_nameptr; + size_t ni_pathlen; +}; + +struct cache_fpl { + int line; + enum cache_fpl_status status; + bool in_smr; + struct nameidata *ndp; + struct nameidata_saved snd; + struct componentname *cnp; + struct vnode *dvp; + seqc_t dvp_seqc; + struct vnode *tvp; + seqc_t tvp_seqc; + struct pwd *pwd; +}; + +static void +cache_fpl_checkpoint(struct cache_fpl *fpl, struct nameidata_saved *snd) +{ + + snd->cn_flags = fpl->ndp->ni_cnd.cn_flags; + snd->cn_namelen = fpl->ndp->ni_cnd.cn_namelen; + snd->cn_nameptr = fpl->ndp->ni_cnd.cn_nameptr; + snd->ni_pathlen = fpl->ndp->ni_pathlen; +} + +static void +cache_fpl_restore(struct cache_fpl *fpl, struct nameidata_saved *snd) +{ + + fpl->ndp->ni_cnd.cn_flags = snd->cn_flags; + fpl->ndp->ni_cnd.cn_namelen = snd->cn_namelen; + fpl->ndp->ni_cnd.cn_nameptr = snd->cn_nameptr; + fpl->ndp->ni_pathlen = snd->ni_pathlen; +} + +#ifdef INVARIANTS +#define cache_fpl_smr_assert_entered(fpl) ({ \ + struct cache_fpl *_fpl = (fpl); \ + MPASS(_fpl->in_smr == true); \ + VFS_SMR_ASSERT_ENTERED(); \ +}) +#define cache_fpl_smr_assert_not_entered(fpl) ({ \ + struct cache_fpl *_fpl = (fpl); \ + MPASS(_fpl->in_smr == false); \ + VFS_SMR_ASSERT_NOT_ENTERED(); \ +}) +#else +#define cache_fpl_smr_assert_entered(fpl) do { } while (0) +#define cache_fpl_smr_assert_not_entered(fpl) do { } while (0) +#endif + +#define cache_fpl_smr_enter(fpl) ({ \ + struct cache_fpl *_fpl = (fpl); \ + MPASS(_fpl->in_smr == false); \ + vfs_smr_enter(); \ + _fpl->in_smr = true; \ +}) + +#define cache_fpl_smr_exit(fpl) ({ \ + struct cache_fpl *_fpl = (fpl); \ + MPASS(_fpl->in_smr == true); \ + vfs_smr_exit(); \ + _fpl->in_smr = false; \ +}) + +static int +cache_fpl_aborted_impl(struct cache_fpl *fpl, int line) +{ + + if (fpl->status != CACHE_FPL_STATUS_UNSET) { + KASSERT(fpl->status == CACHE_FPL_STATUS_PARTIAL, + ("%s: converting to abort from %d at %d, set at %d\n", + __func__, fpl->status, line, fpl->line)); + } + fpl->status = CACHE_FPL_STATUS_ABORTED; + fpl->line = line; + return (CACHE_FPL_FAILED); +} + +#define cache_fpl_aborted(x) cache_fpl_aborted_impl((x), __LINE__) + +static int +cache_fpl_partial_impl(struct cache_fpl *fpl, int line) +{ + + KASSERT(fpl->status == CACHE_FPL_STATUS_UNSET, + ("%s: setting to partial at %d, but already set to %d at %d\n", + __func__, line, fpl->status, fpl->line)); + cache_fpl_smr_assert_entered(fpl); + fpl->status = CACHE_FPL_STATUS_PARTIAL; + fpl->line = line; + return (CACHE_FPL_FAILED); +} + +#define cache_fpl_partial(x) cache_fpl_partial_impl((x), __LINE__) + +static int +cache_fpl_handled_impl(struct cache_fpl *fpl, int error, int line) +{ + + KASSERT(fpl->status == CACHE_FPL_STATUS_UNSET, + ("%s: setting to handled at %d, but already set to %d at %d\n", + __func__, line, fpl->status, fpl->line)); + cache_fpl_smr_assert_not_entered(fpl); + MPASS(error != CACHE_FPL_FAILED); + fpl->status = CACHE_FPL_STATUS_HANDLED; + fpl->line = line; + return (error); +} + +#define cache_fpl_handled(x, e) cache_fpl_handled_impl((x), (e), __LINE__) + +#define CACHE_FPL_SUPPORTED_CN_FLAGS \ + (LOCKLEAF | FOLLOW | LOCKSHARED | SAVENAME | ISOPEN | AUDITVNODE1) + +static bool +cache_can_fplookup(struct cache_fpl *fpl) +{ + struct nameidata *ndp; + struct componentname *cnp; + struct thread *td; + + ndp = fpl->ndp; + cnp = fpl->cnp; + td = cnp->cn_thread; + + if (!cache_fast_lookup) { + cache_fpl_aborted(fpl); + return (false); + } +#ifdef MAC + if (mac_vnode_check_lookup_enabled()) { + cache_fpl_aborted(fpl); + return (false); + } +#endif + if ((cnp->cn_flags & ~CACHE_FPL_SUPPORTED_CN_FLAGS) != 0) { + cache_fpl_aborted(fpl); + return (false); + } + if ((cnp->cn_flags & LOCKLEAF) == 0) { + cache_fpl_aborted(fpl); + return (false); + } + if (cnp->cn_nameiop != LOOKUP) { + cache_fpl_aborted(fpl); + return (false); + } + if (ndp->ni_dirfd != AT_FDCWD) { + cache_fpl_aborted(fpl); + return (false); + } + if (IN_CAPABILITY_MODE(td)) { + cache_fpl_aborted(fpl); + return (false); + } + if (AUDITING_TD(td)) { + cache_fpl_aborted(fpl); + return (false); + } + if (ndp->ni_startdir != NULL) { + cache_fpl_aborted(fpl); + return (false); + } + return (true); +} + +static bool +cache_fplookup_vnode_supported(struct vnode *vp) +{ + + return (vp->v_type != VLNK); +} + +/* + * The target vnode is not supported, prepare for the slow path to take over. + */ +static int +cache_fplookup_partial_setup(struct cache_fpl *fpl) +{ + struct componentname *cnp; + enum vgetstate dvs; + struct vnode *dvp; + struct pwd *pwd; + seqc_t dvp_seqc; + + cnp = fpl->cnp; + dvp = fpl->dvp; + dvp_seqc = fpl->dvp_seqc; + + dvs = vget_prep_smr(dvp); + if (dvs == VGET_NONE) { + cache_fpl_smr_exit(fpl); + return (cache_fpl_aborted(fpl)); + } + + cache_fpl_smr_exit(fpl); + + vget_finish_ref(dvp, dvs); + if (!vn_seqc_consistent(dvp, dvp_seqc)) { + vrele(dvp); + return (cache_fpl_aborted(fpl)); + } + + pwd = pwd_hold(curthread); + if (fpl->pwd != pwd) { + vrele(dvp); + pwd_drop(pwd); + return (cache_fpl_aborted(fpl)); + } + + fpl->ndp->ni_startdir = dvp; + return (0); +} + +static int +cache_fplookup_final(struct cache_fpl *fpl) +{ + struct componentname *cnp; + enum vgetstate tvs; + struct vnode *dvp, *tvp; + seqc_t dvp_seqc, tvp_seqc; + int error; + + cnp = fpl->cnp; + dvp = fpl->dvp; + dvp_seqc = fpl->dvp_seqc; + tvp = fpl->tvp; + tvp_seqc = fpl->tvp_seqc; + + VNPASS(cache_fplookup_vnode_supported(dvp), dvp); + MPASS((cnp->cn_flags & LOCKLEAF) != 0); + + tvs = vget_prep_smr(tvp); + if (tvs == VGET_NONE) { + return (cache_fpl_partial(fpl)); + } + + if (!vn_seqc_consistent(dvp, dvp_seqc)) { + cache_fpl_smr_exit(fpl); + vget_abort(tvp, tvs); + return (cache_fpl_aborted(fpl)); + } + + cache_fpl_smr_exit(fpl); + + error = vget_finish(tvp, cnp->cn_lkflags, tvs); + if (error != 0) { + return (cache_fpl_aborted(fpl)); + } + + if (!vn_seqc_consistent(tvp, tvp_seqc)) { + vput(tvp); + return (cache_fpl_aborted(fpl)); + } + + return (cache_fpl_handled(fpl, 0)); +} + +static int +cache_fplookup_next(struct cache_fpl *fpl) +{ + struct componentname *cnp; + struct namecache *ncp; + struct negstate *negstate; + struct vnode *dvp, *tvp; + u_char nc_flag; + uint32_t hash; + bool neg_hot; + + cnp = fpl->cnp; + dvp = fpl->dvp; + + if (__predict_false(cnp->cn_namelen == 1 && cnp->cn_nameptr[0] == '.')) { + fpl->tvp = dvp; + fpl->tvp_seqc = vn_seqc_read_any(dvp); + if (seqc_in_modify(fpl->tvp_seqc)) { + return (cache_fpl_aborted(fpl)); + } + return (0); + } + + hash = cache_get_hash(cnp->cn_nameptr, cnp->cn_namelen, dvp); + + CK_LIST_FOREACH(ncp, (NCHHASH(hash)), nc_hash) { + counter_u64_add(numchecks, 1); + if (ncp->nc_dvp == dvp && ncp->nc_nlen == cnp->cn_namelen && + !bcmp(ncp->nc_name, cnp->cn_nameptr, ncp->nc_nlen)) + break; + } + + /* + * If there is no entry we have to punt to the slow path to perform + * actual lookup. Should there be nothing with this name a negative + * entry will be created. + */ + if (__predict_false(ncp == NULL)) { + return (cache_fpl_partial(fpl)); + } + + tvp = atomic_load_ptr(&ncp->nc_vp); + nc_flag = atomic_load_char(&ncp->nc_flag); + if ((nc_flag & NCF_NEGATIVE) != 0) { + negstate = NCP2NEGSTATE(ncp); + neg_hot = ((negstate->neg_flag & NEG_HOT) != 0); + if (__predict_false(cache_ncp_invalid(ncp))) { + return (cache_fpl_partial(fpl)); + } + if (__predict_false((nc_flag & NCF_WHITE) != 0)) { + return (cache_fpl_partial(fpl)); + } + if (!neg_hot) { + /* + * TODO + * Promoting to hot negative requires locks, thus is + * left not yet supported for simplicity. + */ + return (cache_fpl_partial(fpl)); + } + SDT_PROBE2(vfs, namecache, lookup, hit__negative, dvp, + ncp->nc_name); + counter_u64_add(numneghits, 1); + cache_fpl_smr_exit(fpl); + return (cache_fpl_handled(fpl, ENOENT)); + } + + if (__predict_false(cache_ncp_invalid(ncp))) { + return (cache_fpl_partial(fpl)); + } + + fpl->tvp = tvp; + fpl->tvp_seqc = vn_seqc_read_any(tvp); + if (seqc_in_modify(fpl->tvp_seqc)) { + return (cache_fpl_partial(fpl)); + } + + if (!cache_fplookup_vnode_supported(tvp)) { + return (cache_fpl_partial(fpl)); + } + + counter_u64_add(numposhits, 1); + SDT_PROBE3(vfs, namecache, lookup, hit, dvp, ncp->nc_name, tvp); + return (0); +} + +static bool +cache_fplookup_mp_supported(struct mount *mp) +{ + + if (mp == NULL) + return (false); + if ((mp->mnt_kern_flag & MNTK_FPLOOKUP) == 0) + return (false); + if ((mp->mnt_flag & MNT_UNION) != 0) + return (false); + return (true); +} + +/* + * Walk up the mount stack (if any). + * + * Correctness is provided in the following ways: + * - all vnodes are protected from freeing with SMR + * - struct mount objects are type stable making them always safe to access + * - stability of the particular mount is provided by busying it + * - relationship between the vnode which is mounted on and the mount is + * verified with the vnode sequence counter after busying + * - association between root vnode of the mount and the mount is protected + * by busy + * + * From that point on we can read the sequence counter of the root vnode + * and get the next mount on the stack (if any) using the same protection. + * + * By the end of successful walk we are guaranteed the reached state was + * indeed present at least at some point which matches the regular lookup. + */ +static int +cache_fplookup_climb_mount(struct cache_fpl *fpl) +{ + struct mount *mp, *prev_mp; + struct vnode *vp; + seqc_t vp_seqc; + + vp = fpl->tvp; + vp_seqc = fpl->tvp_seqc; + if (vp->v_type != VDIR) + return (0); + + mp = atomic_load_ptr(&vp->v_mountedhere); + if (mp == NULL) + return (0); + + prev_mp = NULL; + for (;;) { + if (!vfs_op_thread_enter(mp)) { + if (prev_mp != NULL) + vfs_op_thread_exit(prev_mp); + return (cache_fpl_partial(fpl)); + } + if (prev_mp != NULL) + vfs_op_thread_exit(prev_mp); + if (!vn_seqc_consistent(vp, vp_seqc)) { + vfs_op_thread_exit(mp); + return (cache_fpl_partial(fpl)); + } + if (!cache_fplookup_mp_supported(mp)) { + vfs_op_thread_exit(mp); + return (cache_fpl_partial(fpl)); + } + vp = atomic_load_ptr(&mp->mnt_rootvnode); + if (vp == NULL || VN_IS_DOOMED(vp)) { + vfs_op_thread_exit(mp); + return (cache_fpl_partial(fpl)); + } + vp_seqc = vn_seqc_read_any(vp); + if (seqc_in_modify(vp_seqc)) { + vfs_op_thread_exit(mp); + return (cache_fpl_partial(fpl)); + } + prev_mp = mp; + mp = atomic_load_ptr(&vp->v_mountedhere); + if (mp == NULL) + break; + } + + vfs_op_thread_exit(prev_mp); + fpl->tvp = vp; + fpl->tvp_seqc = vp_seqc; + return (0); +} + +/* + * Parse the path. + * + * The code is mostly copy-pasted from regular lookup, see lookup(). + * The structure is maintained along with comments for easier maintenance. + * Deduplicating the code will become feasible after fast path lookup + * becomes more feature-complete. + */ +static int +cache_fplookup_parse(struct cache_fpl *fpl) +{ + struct nameidata *ndp; + struct componentname *cnp; + char *cp; + char *prev_ni_next; /* saved ndp->ni_next */ + size_t prev_ni_pathlen; /* saved ndp->ni_pathlen */ + + ndp = fpl->ndp; + cnp = fpl->cnp; + + /* + * Search a new directory. + * + * The last component of the filename is left accessible via + * cnp->cn_nameptr for callers that need the name. Callers needing + * the name set the SAVENAME flag. When done, they assume + * responsibility for freeing the pathname buffer. + */ + for (cp = cnp->cn_nameptr; *cp != 0 && *cp != '/'; cp++) + continue; + cnp->cn_namelen = cp - cnp->cn_nameptr; + if (cnp->cn_namelen > NAME_MAX) { + cache_fpl_smr_exit(fpl); + return (cache_fpl_handled(fpl, ENAMETOOLONG)); + } + prev_ni_pathlen = ndp->ni_pathlen; + ndp->ni_pathlen -= cnp->cn_namelen; + KASSERT(ndp->ni_pathlen <= PATH_MAX, + ("%s: ni_pathlen underflow to %zd\n", __func__, ndp->ni_pathlen)); + prev_ni_next = ndp->ni_next; + ndp->ni_next = cp; + + /* + * Replace multiple slashes by a single slash and trailing slashes + * by a null. This must be done before VOP_LOOKUP() because some + * fs's don't know about trailing slashes. Remember if there were + * trailing slashes to handle symlinks, existing non-directories + * and non-existing files that won't be directories specially later. + */ + while (*cp == '/' && (cp[1] == '/' || cp[1] == '\0')) { + cp++; + ndp->ni_pathlen--; + if (*cp == '\0') { + /* + * TODO + * Regular lookup performs the following: + * *ndp->ni_next = '\0'; + * cnp->cn_flags |= TRAILINGSLASH; + * + * Which is problematic since it modifies data read + * from userspace. Then if fast path lookup was to + * abort we would have to either restore it or convey + * the flag. Since this is a corner case just ignore + * it for simplicity. + */ + return (cache_fpl_partial(fpl)); + } + } + ndp->ni_next = cp; + + cnp->cn_flags |= MAKEENTRY; + + if (cnp->cn_namelen == 2 && + cnp->cn_nameptr[1] == '.' && cnp->cn_nameptr[0] == '.') + cnp->cn_flags |= ISDOTDOT; + else + cnp->cn_flags &= ~ISDOTDOT; + if (*ndp->ni_next == 0) + cnp->cn_flags |= ISLASTCN; + else + cnp->cn_flags &= ~ISLASTCN; + + /* + * Check for degenerate name (e.g. / or "") + * which is a way of talking about a directory, + * e.g. like "/." or ".". + * + * TODO + * Another corner case handled by the regular lookup + */ + if (__predict_false(cnp->cn_nameptr[0] == '\0')) { + return (cache_fpl_partial(fpl)); + } + return (0); +} + +static void +cache_fplookup_parse_advance(struct cache_fpl *fpl) +{ + struct nameidata *ndp; + struct componentname *cnp; + + ndp = fpl->ndp; + cnp = fpl->cnp; + + cnp->cn_nameptr = ndp->ni_next; + while (*cnp->cn_nameptr == '/') { + cnp->cn_nameptr++; + ndp->ni_pathlen--; + } +} + +static int +cache_fplookup_impl(struct vnode *dvp, struct cache_fpl *fpl) +{ + struct nameidata *ndp; + struct componentname *cnp; + struct mount *mp; + int error; + + error = CACHE_FPL_FAILED; + ndp = fpl->ndp; + ndp->ni_lcf = 0; + cnp = fpl->cnp; + cnp->cn_lkflags = LK_SHARED; + if ((cnp->cn_flags & LOCKSHARED) == 0) + cnp->cn_lkflags = LK_EXCLUSIVE; + + cache_fpl_checkpoint(fpl, &fpl->snd); + + fpl->dvp = dvp; + fpl->dvp_seqc = vn_seqc_read_any(fpl->dvp); + if (seqc_in_modify(fpl->dvp_seqc)) { + cache_fpl_aborted(fpl); + goto out; + } + mp = atomic_load_ptr(&fpl->dvp->v_mount); + if (!cache_fplookup_mp_supported(mp)) { + cache_fpl_aborted(fpl); + goto out; + } + + VNPASS(cache_fplookup_vnode_supported(fpl->dvp), fpl->dvp); + + for (;;) { + error = cache_fplookup_parse(fpl); + if (__predict_false(error != 0)) { + break; + } + + if (cnp->cn_flags & ISDOTDOT) { + error = cache_fpl_partial(fpl); + break; + } + + VNPASS(cache_fplookup_vnode_supported(fpl->dvp), fpl->dvp); + + error = VOP_FPLOOKUP_VEXEC(fpl->dvp, cnp->cn_cred, cnp->cn_thread); + if (__predict_false(error != 0)) { + switch (error) { + case EAGAIN: + case EOPNOTSUPP: /* can happen when racing against vgone */ + cache_fpl_partial(fpl); + break; + default: + /* + * See the API contract for VOP_FPLOOKUP_VEXEC. + */ + if (!vn_seqc_consistent(fpl->dvp, fpl->dvp_seqc)) { + error = cache_fpl_aborted(fpl); + } else { + cache_fpl_smr_exit(fpl); + cache_fpl_handled(fpl, error); + } + break; + } + break; + } + + error = cache_fplookup_next(fpl); + if (__predict_false(error != 0)) { + break; + } + + VNPASS(!seqc_in_modify(fpl->tvp_seqc), fpl->tvp); + + error = cache_fplookup_climb_mount(fpl); + if (__predict_false(error != 0)) { + break; + } + + VNPASS(!seqc_in_modify(fpl->tvp_seqc), fpl->tvp); + + if (cnp->cn_flags & ISLASTCN) { + error = cache_fplookup_final(fpl); + break; + } + + if (!vn_seqc_consistent(fpl->dvp, fpl->dvp_seqc)) { + error = cache_fpl_aborted(fpl); + break; + } + + fpl->dvp = fpl->tvp; + fpl->dvp_seqc = fpl->tvp_seqc; + + cache_fplookup_parse_advance(fpl); + cache_fpl_checkpoint(fpl, &fpl->snd); + } +out: + switch (fpl->status) { + case CACHE_FPL_STATUS_UNSET: + __assert_unreachable(); + break; + case CACHE_FPL_STATUS_PARTIAL: + cache_fpl_smr_assert_entered(fpl); + return (cache_fplookup_partial_setup(fpl)); + case CACHE_FPL_STATUS_ABORTED: + if (fpl->in_smr) + cache_fpl_smr_exit(fpl); + return (CACHE_FPL_FAILED); + case CACHE_FPL_STATUS_HANDLED: + cache_fpl_smr_assert_not_entered(fpl); + if (__predict_false(error != 0)) { + ndp->ni_dvp = NULL; + ndp->ni_vp = NULL; + cache_fpl_cleanup_cnp(cnp); + return (error); + } + ndp->ni_dvp = fpl->dvp; + ndp->ni_vp = fpl->tvp; + if (cnp->cn_flags & SAVENAME) + cnp->cn_flags |= HASBUF; + else + cache_fpl_cleanup_cnp(cnp); + return (error); + } +} + +/* + * Fast path lookup protected with SMR and sequence counters. + * + * Note: all VOP_FPLOOKUP_VEXEC routines have a comment referencing this one. + * + * Filesystems can opt in by setting the MNTK_FPLOOKUP flag and meeting criteria + * outlined below. + * + * Traditional vnode lookup conceptually looks like this: + * + * vn_lock(current); + * for (;;) { + * next = find(); + * vn_lock(next); + * vn_unlock(current); + * current = next; + * if (last) + * break; + * } + * return (current); + * + * Each jump to the next vnode is safe memory-wise and atomic with respect to + * any modifications thanks to holding respective locks. + * + * The same guarantee can be provided with a combination of safe memory + * reclamation and sequence counters instead. If all operations which affect + * the relationship between the current vnode and the one we are looking for + * also modify the counter, we can verify whether all the conditions held as + * we made the jump. This includes things like permissions, mount points etc. + * Counter modification is provided by enclosing relevant places in + * vn_seqc_write_begin()/end() calls. + * + * Thus this translates to: + * + * vfs_smr_enter(); + * dvp_seqc = seqc_read_any(dvp); + * if (seqc_in_modify(dvp_seqc)) // someone is altering the vnode + * abort(); + * for (;;) { + * tvp = find(); + * tvp_seqc = seqc_read_any(tvp); + * if (seqc_in_modify(tvp_seqc)) // someone is altering the target vnode + * abort(); + * if (!seqc_consistent(dvp, dvp_seqc) // someone is altering the vnode + * abort(); + * dvp = tvp; // we know nothing of importance has changed + * dvp_seqc = tvp_seqc; // store the counter for the tvp iteration + * if (last) + * break; + * } + * vget(); // secure the vnode + * if (!seqc_consistent(tvp, tvp_seqc) // final check + * abort(); + * // at this point we know nothing has changed for any parent<->child pair + * // as they were crossed during the lookup, meaning we matched the guarantee + * // of the locked variant + * return (tvp); + * + * The API contract for VOP_FPLOOKUP_VEXEC routines is as follows: + * - they are called while within vfs_smr protection which they must never exit + * - EAGAIN can be returned to denote checking could not be performed, it is + * always valid to return it + * - if the sequence counter has not changed the result must be valid + * - if the sequence counter has changed both false positives and false negatives + * are permitted (since the result will be rejected later) + * - for simple cases of unix permission checks vaccess_vexec_smr can be used + * + * Caveats to watch out for: + * - vnodes are passed unlocked and unreferenced with nothing stopping + * VOP_RECLAIM, in turn meaning that ->v_data can become NULL. It is advised + * to use atomic_load_ptr to fetch it. + * - the aforementioned object can also get freed, meaning absent other means it + * should be protected with vfs_smr + * - either safely checking permissions as they are modified or guaranteeing + * their stability is left to the routine + */ +int +cache_fplookup(struct nameidata *ndp, enum cache_fpl_status *status, + struct pwd **pwdp) +{ + struct cache_fpl fpl; + struct pwd *pwd; + struct vnode *dvp; + struct componentname *cnp; + struct nameidata_saved orig; + int error; + + *status = CACHE_FPL_STATUS_UNSET; + bzero(&fpl, sizeof(fpl)); + fpl.status = CACHE_FPL_STATUS_UNSET; + fpl.ndp = ndp; + fpl.cnp = &ndp->ni_cnd; + MPASS(curthread == fpl.cnp->cn_thread); + + if (!cache_can_fplookup(&fpl)) { + SDT_PROBE3(vfs, fplookup, lookup, done, ndp, fpl.line, fpl.status); + *status = fpl.status; + return (EOPNOTSUPP); + } + + cache_fpl_checkpoint(&fpl, &orig); + + cache_fpl_smr_enter(&fpl); + pwd = pwd_get_smr(); + fpl.pwd = pwd; + ndp->ni_rootdir = pwd->pwd_rdir; + ndp->ni_topdir = pwd->pwd_jdir; + + cnp = fpl.cnp; + cnp->cn_nameptr = cnp->cn_pnbuf; + if (cnp->cn_pnbuf[0] == '/') { + cache_fpl_handle_root(ndp, &dvp); + } else { + MPASS(ndp->ni_dirfd == AT_FDCWD); + dvp = pwd->pwd_cdir; + } + + SDT_PROBE4(vfs, namei, lookup, entry, dvp, cnp->cn_pnbuf, cnp->cn_flags, true); + + error = cache_fplookup_impl(dvp, &fpl); + cache_fpl_smr_assert_not_entered(&fpl); + SDT_PROBE3(vfs, fplookup, lookup, done, ndp, fpl.line, fpl.status); + + *status = fpl.status; + switch (fpl.status) { + case CACHE_FPL_STATUS_UNSET: + __assert_unreachable(); + break; + case CACHE_FPL_STATUS_HANDLED: + SDT_PROBE3(vfs, namei, lookup, return, error, + (error == 0 ? ndp->ni_vp : NULL), true); + break; + case CACHE_FPL_STATUS_PARTIAL: + *pwdp = fpl.pwd; + cache_fpl_restore(&fpl, &fpl.snd); + break; + case CACHE_FPL_STATUS_ABORTED: + cache_fpl_restore(&fpl, &orig); + break; + } + return (error); +} Modified: head/sys/kern/vfs_lookup.c ============================================================================== --- head/sys/kern/vfs_lookup.c Sat Jul 25 10:32:45 2020 (r363518) +++ head/sys/kern/vfs_lookup.c Sat Jul 25 10:37:15 2020 (r363519) @@ -71,9 +71,9 @@ __FBSDID("$FreeBSD$"); #undef NAMEI_DIAGNOSTIC SDT_PROVIDER_DECLARE(vfs); -SDT_PROBE_DEFINE3(vfs, namei, lookup, entry, "struct vnode *", "char *", - "unsigned long"); -SDT_PROBE_DEFINE2(vfs, namei, lookup, return, "int", "struct vnode *"); +SDT_PROBE_DEFINE4(vfs, namei, lookup, entry, "struct vnode *", "char *", + "unsigned long", "bool"); +SDT_PROBE_DEFINE3(vfs, namei, lookup, return, "int", "struct vnode *", "bool"); /* Allocation zone for namei. */ uma_zone_t namei_zone; @@ -280,78 +280,22 @@ namei_handle_root(struct nameidata *ndp, struct vnode return (0); } -/* - * Convert a pathname into a pointer to a locked vnode. - * - * The FOLLOW flag is set when symbolic links are to be followed - * when they occur at the end of the name translation process. - * Symbolic links are always followed for all other pathname - * components other than the last. - * - * The segflg defines whether the name is to be copied from user - * space or kernel space. - * - * Overall outline of namei: - * - * copy in name - * get starting directory - * while (!done && !error) { - * call lookup to search path. - * if symbolic link, massage name in buffer and continue - * } - */ -int -namei(struct nameidata *ndp) +static int +namei_setup(struct nameidata *ndp, struct vnode **dpp, struct pwd **pwdp) { - char *cp; /* pointer into pathname argument */ - struct vnode *dp; /* the directory we are searching */ - struct iovec aiov; /* uio for reading symbolic links */ struct componentname *cnp; struct file *dfp; struct thread *td; - struct proc *p; struct pwd *pwd; cap_rights_t rights; struct filecaps dirfd_caps; - struct uio auio; - int error, linklen, startdir_used; + int error, startdir_used; cnp = &ndp->ni_cnd; td = cnp->cn_thread; - p = td->td_proc; - ndp->ni_cnd.cn_cred = ndp->ni_cnd.cn_thread->td_ucred; - KASSERT(cnp->cn_cred && p, ("namei: bad cred/proc")); - KASSERT((cnp->cn_nameiop & (~OPMASK)) == 0, - ("namei: nameiop contaminated with flags")); - KASSERT((cnp->cn_flags & OPMASK) == 0, - ("namei: flags contaminated with nameiops")); - MPASS(ndp->ni_startdir == NULL || ndp->ni_startdir->v_type == VDIR || - ndp->ni_startdir->v_type == VBAD); - TAILQ_INIT(&ndp->ni_cap_tracker); - ndp->ni_lcf = 0; - /* We will set this ourselves if we need it. */ - cnp->cn_flags &= ~TRAILINGSLASH; + *pwdp = NULL; - /* - * Get a buffer for the name to be translated, and copy the - * name into the buffer. - */ - if ((cnp->cn_flags & HASBUF) == 0) - cnp->cn_pnbuf = uma_zalloc(namei_zone, M_WAITOK); - if (ndp->ni_segflg == UIO_SYSSPACE) - error = copystr(ndp->ni_dirp, cnp->cn_pnbuf, MAXPATHLEN, - &ndp->ni_pathlen); - else - error = copyinstr(ndp->ni_dirp, cnp->cn_pnbuf, MAXPATHLEN, - &ndp->ni_pathlen); - - /* - * Don't allow empty pathnames. - */ - if (error == 0 && *cnp->cn_pnbuf == '\0') - error = ENOENT; - #ifdef CAPABILITY_MODE /* * In capability mode, lookups must be restricted to happen in @@ -366,31 +310,19 @@ namei(struct nameidata *ndp) * previously walked by us, which prevents an escape from * the relative root. */ - if (error == 0 && IN_CAPABILITY_MODE(td) && - (cnp->cn_flags & NOCAPCHECK) == 0) { + if (IN_CAPABILITY_MODE(td) && (cnp->cn_flags & NOCAPCHECK) == 0) { ndp->ni_lcf |= NI_LCF_STRICTRELATIVE; if (ndp->ni_dirfd == AT_FDCWD) { *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Sat Jul 25 10:38:06 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7A6E43A6B2D; Sat, 25 Jul 2020 10:38:06 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BDMwZ33w1z43y9; Sat, 25 Jul 2020 10:38:06 +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 4D2411A65E; Sat, 25 Jul 2020 10:38:06 +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 06PAc6aL043970; Sat, 25 Jul 2020 10:38:06 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06PAc5VH043965; Sat, 25 Jul 2020 10:38:05 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202007251038.06PAc5VH043965@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Sat, 25 Jul 2020 10:38:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363520 - in head/sys/ufs: ffs ufs X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: in head/sys/ufs: ffs ufs X-SVN-Commit-Revision: 363520 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 25 Jul 2020 10:38:06 -0000 Author: mjg Date: Sat Jul 25 10:38:05 2020 New Revision: 363520 URL: https://svnweb.freebsd.org/changeset/base/363520 Log: ufs: add support for lockless lookup ACLs are not supported, meaning their presence will force the use of the old lookup. Reviewed by: kib Tested by: pho (in a patchset) Differential Revision: https://reviews.freebsd.org/D25579 Modified: head/sys/ufs/ffs/ffs_vfsops.c head/sys/ufs/ffs/ffs_vnops.c head/sys/ufs/ufs/inode.h head/sys/ufs/ufs/ufs_acl.c head/sys/ufs/ufs/ufs_vnops.c Modified: head/sys/ufs/ffs/ffs_vfsops.c ============================================================================== --- head/sys/ufs/ffs/ffs_vfsops.c Sat Jul 25 10:37:15 2020 (r363519) +++ head/sys/ufs/ffs/ffs_vfsops.c Sat Jul 25 10:38:05 2020 (r363520) @@ -84,6 +84,7 @@ __FBSDID("$FreeBSD$"); #include static uma_zone_t uma_inode, uma_ufs1, uma_ufs2; +VFS_SMR_DECLARE; static int ffs_mountfs(struct vnode *, struct mount *, struct thread *); static void ffs_oldfscompat_read(struct fs *, struct ufsmount *, @@ -393,6 +394,7 @@ ffs_mount(struct mount *mp) uma_ufs2 = uma_zcreate("FFS2 dinode", sizeof(struct ufs2_dinode), NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, 0); + VFS_SMR_ZONE_SET(uma_inode); } vfs_deleteopt(mp->mnt_optnew, "groupquota"); @@ -455,6 +457,7 @@ ffs_mount(struct mount *mp) } MNT_ILOCK(mp); + mp->mnt_kern_flag &= ~MNTK_FPLOOKUP; mp->mnt_flag |= mntorflags; MNT_IUNLOCK(mp); /* @@ -795,6 +798,17 @@ ffs_mount(struct mount *mp) } } } + + MNT_ILOCK(mp); + /* + * This is racy versus lookup, see ufs_fplookup_vexec for details. + */ + if ((mp->mnt_kern_flag & MNTK_FPLOOKUP) != 0) + panic("MNTK_FPLOOKUP set on mount %p when it should not be", mp); + if ((mp->mnt_flag & (MNT_ACLS | MNT_NFS4ACLS)) == 0) + mp->mnt_kern_flag |= MNTK_FPLOOKUP; + MNT_IUNLOCK(mp); + vfs_mountedfrom(mp, fspec); return (0); } @@ -1968,14 +1982,14 @@ ffs_vgetf(mp, ino, flags, vpp, ffs_flags) ump = VFSTOUFS(mp); fs = ump->um_fs; - ip = uma_zalloc(uma_inode, M_WAITOK | M_ZERO); + ip = uma_zalloc_smr(uma_inode, M_WAITOK | M_ZERO); /* Allocate a new vnode/inode. */ error = getnewvnode("ufs", mp, fs->fs_magic == FS_UFS1_MAGIC ? &ffs_vnodeops1 : &ffs_vnodeops2, &vp); if (error) { *vpp = NULL; - uma_zfree(uma_inode, ip); + uma_zfree_smr(uma_inode, ip); return (error); } /* @@ -2004,7 +2018,7 @@ ffs_vgetf(mp, ino, flags, vpp, ffs_flags) vp->v_vflag |= VV_FORCEINSMQ; error = insmntque(vp, mp); if (error != 0) { - uma_zfree(uma_inode, ip); + uma_zfree_smr(uma_inode, ip); *vpp = NULL; return (error); } @@ -2327,7 +2341,7 @@ ffs_ifree(struct ufsmount *ump, struct inode *ip) uma_zfree(uma_ufs1, ip->i_din1); else if (ip->i_din2 != NULL) uma_zfree(uma_ufs2, ip->i_din2); - uma_zfree(uma_inode, ip); + uma_zfree_smr(uma_inode, ip); } static int dobkgrdwrite = 1; Modified: head/sys/ufs/ffs/ffs_vnops.c ============================================================================== --- head/sys/ufs/ffs/ffs_vnops.c Sat Jul 25 10:37:15 2020 (r363519) +++ head/sys/ufs/ffs/ffs_vnops.c Sat Jul 25 10:38:05 2020 (r363520) @@ -905,8 +905,10 @@ ffs_write(ap) if ((ip->i_mode & (ISUID | ISGID)) && resid > uio->uio_resid && ap->a_cred) { if (priv_check_cred(ap->a_cred, PRIV_VFS_RETAINSUGID)) { - ip->i_mode &= ~(ISUID | ISGID); + vn_seqc_write_begin(vp); + UFS_INODE_SET_MODE(ip, ip->i_mode & ~(ISUID | ISGID)); DIP_SET(ip, i_mode, ip->i_mode); + vn_seqc_write_end(vp); } } if (error) { @@ -1152,8 +1154,10 @@ ffs_extwrite(struct vnode *vp, struct uio *uio, int io */ if ((ip->i_mode & (ISUID | ISGID)) && resid > uio->uio_resid && ucred) { if (priv_check_cred(ucred, PRIV_VFS_RETAINSUGID)) { - ip->i_mode &= ~(ISUID | ISGID); + vn_seqc_write_begin(vp); + UFS_INODE_SET_MODE(ip, ip->i_mode & ~(ISUID | ISGID)); dp->di_mode = ip->i_mode; + vn_seqc_write_end(vp); } } if (error) { Modified: head/sys/ufs/ufs/inode.h ============================================================================== --- head/sys/ufs/ufs/inode.h Sat Jul 25 10:37:15 2020 (r363519) +++ head/sys/ufs/ufs/inode.h Sat Jul 25 10:38:05 2020 (r363520) @@ -43,6 +43,7 @@ #include #include #include +#include /* * This must agree with the definition in . @@ -149,6 +150,14 @@ struct inode { #define UFS_INODE_FLAG_LAZY_MASK_ASSERTABLE \ (UFS_INODE_FLAG_LAZY_MASK & ~(IN_LAZYMOD | IN_LAZYACCESS)) +#define UFS_INODE_SET_MODE(ip, mode) do { \ + struct inode *_ip = (ip); \ + int _mode = (mode); \ + \ + ASSERT_VOP_IN_SEQC(ITOV(_ip)); \ + atomic_store_short(&(_ip)->i_mode, _mode); \ +} while (0) + #define UFS_INODE_SET_FLAG(ip, flags) do { \ struct inode *_ip = (ip); \ struct vnode *_vp = ITOV(_ip); \ @@ -229,6 +238,7 @@ struct indir { /* Convert between inode pointers and vnode pointers. */ #define VTOI(vp) ((struct inode *)(vp)->v_data) +#define VTOI_SMR(vp) ((struct inode *)vn_load_v_data_smr(vp)) #define ITOV(ip) ((ip)->i_vnode) /* Determine if soft dependencies are being done */ Modified: head/sys/ufs/ufs/ufs_acl.c ============================================================================== --- head/sys/ufs/ufs/ufs_acl.c Sat Jul 25 10:37:15 2020 (r363519) +++ head/sys/ufs/ufs/ufs_acl.c Sat Jul 25 10:38:05 2020 (r363520) @@ -139,9 +139,11 @@ ufs_sync_acl_from_inode(struct inode *ip, struct acl * void ufs_sync_inode_from_acl(struct acl *acl, struct inode *ip) { + int newmode; - ip->i_mode &= ACL_PRESERVE_MASK; - ip->i_mode |= acl_posix1e_acl_to_mode(acl); + newmode = ip->i_mode & ACL_PRESERVE_MASK; + newmode |= acl_posix1e_acl_to_mode(acl); + UFS_INODE_SET_MODE(ip, newmode); DIP_SET(ip, i_mode, ip->i_mode); } @@ -381,7 +383,7 @@ int ufs_setacl_nfs4_internal(struct vnode *vp, struct acl *aclp, struct thread *td) { int error; - mode_t mode; + mode_t mode, newmode; struct inode *ip = VTOI(vp); KASSERT(acl_nfs4_check(aclp, vp->v_type == VDIR) == 0, @@ -418,8 +420,9 @@ ufs_setacl_nfs4_internal(struct vnode *vp, struct acl acl_nfs4_sync_mode_from_acl(&mode, aclp); - ip->i_mode &= ACL_PRESERVE_MASK; - ip->i_mode |= mode; + newmode = ip->i_mode & ACL_PRESERVE_MASK; + newmode |= mode; + UFS_INODE_SET_MODE(ip, newmode); DIP_SET(ip, i_mode, ip->i_mode); UFS_INODE_SET_FLAG(ip, IN_CHANGE); Modified: head/sys/ufs/ufs/ufs_vnops.c ============================================================================== --- head/sys/ufs/ufs/ufs_vnops.c Sat Jul 25 10:37:15 2020 (r363519) +++ head/sys/ufs/ufs/ufs_vnops.c Sat Jul 25 10:38:05 2020 (r363520) @@ -63,6 +63,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include @@ -96,10 +97,12 @@ FEATURE(suiddir, "Give all new files in directory the same ownership as the directory"); #endif +VFS_SMR_DECLARE; #include static vop_accessx_t ufs_accessx; +static vop_fplookup_vexec_t ufs_fplookup_vexec; static int ufs_chmod(struct vnode *, int, struct ucred *, struct thread *); static int ufs_chown(struct vnode *, uid_t, gid_t, struct ucred *, struct thread *); static vop_close_t ufs_close; @@ -422,6 +425,46 @@ ufs_accessx(ap) return (error); } +/* + * VOP_FPLOOKUP_VEXEC routines are subject to special circumstances, see + * the comment above cache_fplookup for details. + */ +static int +ufs_fplookup_vexec(ap) + struct vop_fplookup_vexec_args /* { + struct vnode *a_vp; + struct ucred *a_cred; + struct thread *a_td; + } */ *ap; +{ + struct vnode *vp; + struct inode *ip; + struct ucred *cred; + mode_t all_x, mode; + + vp = ap->a_vp; + ip = VTOI_SMR(vp); + if (__predict_false(ip == NULL)) + return (EAGAIN); + + /* + * XXX ACL race + * + * ACLs are not supported and UFS clears/sets this flag on mount and + * remount. However, we may still be racing with seeing them and there + * is no provision to make sure they were accounted for. This matches + * the behavior of the locked case, since the lookup there is also + * racy: mount takes no measures to block anyone from progressing. + */ + all_x = S_IXUSR | S_IXGRP | S_IXOTH; + mode = atomic_load_short(&ip->i_mode); + if (__predict_true((mode & all_x) == all_x)) + return (0); + + cred = ap->a_cred; + return (vaccess_vexec_smr(mode, ip->i_uid, ip->i_gid, cred)); +} + /* ARGSUSED */ static int ufs_getattr(ap) @@ -711,7 +754,7 @@ ufs_chmod(vp, mode, cred, td) struct thread *td; { struct inode *ip = VTOI(vp); - int error; + int newmode, error; /* * To modify the permissions on a file, must possess VADMIN @@ -744,8 +787,9 @@ ufs_chmod(vp, mode, cred, td) return (error); } - ip->i_mode &= ~ALLPERMS; - ip->i_mode |= (mode & ALLPERMS); + newmode = ip->i_mode & ~ALLPERMS; + newmode |= (mode & ALLPERMS); + UFS_INODE_SET_MODE(ip, newmode); DIP_SET(ip, i_mode, ip->i_mode); UFS_INODE_SET_FLAG(ip, IN_CHANGE); #ifdef UFS_ACL @@ -869,7 +913,7 @@ good: UFS_INODE_SET_FLAG(ip, IN_CHANGE); if ((ip->i_mode & (ISUID | ISGID)) && (ouid != uid || ogid != gid)) { if (priv_check_cred(cred, PRIV_VFS_RETAINSUGID)) { - ip->i_mode &= ~(ISUID | ISGID); + UFS_INODE_SET_MODE(ip, ip->i_mode & ~(ISUID | ISGID)); DIP_SET(ip, i_mode, ip->i_mode); } } @@ -1111,7 +1155,10 @@ ufs_rename(ap) int error = 0; struct mount *mp; ino_t ino; + bool want_seqc_end; + want_seqc_end = false; + #ifdef INVARIANTS if ((tcnp->cn_flags & HASBUF) == 0 || (fcnp->cn_flags & HASBUF) == 0) @@ -1315,6 +1362,13 @@ relock: tdp->i_effnlink == 0) panic("Bad effnlink fip %p, fdp %p, tdp %p", fip, fdp, tdp); + if (tvp != NULL) + vn_seqc_write_begin(tvp); + vn_seqc_write_begin(tdvp); + vn_seqc_write_begin(fvp); + vn_seqc_write_begin(fdvp); + want_seqc_end = true; + /* * 1) Bump link count while we're moving stuff * around. If we crash somewhere before @@ -1513,6 +1567,14 @@ relock: cache_purge_negative(tdvp); unlockout: + if (want_seqc_end) { + if (tvp != NULL) + vn_seqc_write_end(tvp); + vn_seqc_write_end(tdvp); + vn_seqc_write_end(fvp); + vn_seqc_write_end(fdvp); + } + vput(fdvp); vput(fvp); if (tvp) @@ -1556,6 +1618,14 @@ bad: goto unlockout; releout: + if (want_seqc_end) { + if (tvp != NULL) + vn_seqc_write_end(tvp); + vn_seqc_write_end(tdvp); + vn_seqc_write_end(fvp); + vn_seqc_write_end(fdvp); + } + vrele(fdvp); vrele(fvp); vrele(tdvp); @@ -1590,7 +1660,7 @@ ufs_do_posix1e_acl_inheritance_dir(struct vnode *dvp, */ if (acl->acl_cnt != 0) { dmode = acl_posix1e_newfilemode(dmode, acl); - ip->i_mode = dmode; + UFS_INODE_SET_MODE(ip, dmode); DIP_SET(ip, i_mode, dmode); *dacl = *acl; ufs_sync_acl_from_inode(ip, acl); @@ -1602,7 +1672,7 @@ ufs_do_posix1e_acl_inheritance_dir(struct vnode *dvp, /* * Just use the mode as-is. */ - ip->i_mode = dmode; + UFS_INODE_SET_MODE(ip, dmode); DIP_SET(ip, i_mode, dmode); error = 0; goto out; @@ -1673,7 +1743,7 @@ ufs_do_posix1e_acl_inheritance_file(struct vnode *dvp, * the it's not defined case. */ mode = acl_posix1e_newfilemode(mode, acl); - ip->i_mode = mode; + UFS_INODE_SET_MODE(ip, mode); DIP_SET(ip, i_mode, mode); ufs_sync_acl_from_inode(ip, acl); break; @@ -1684,7 +1754,7 @@ ufs_do_posix1e_acl_inheritance_file(struct vnode *dvp, /* * Just use the mode as-is. */ - ip->i_mode = mode; + UFS_INODE_SET_MODE(ip, mode); DIP_SET(ip, i_mode, mode); error = 0; goto out; @@ -1796,6 +1866,7 @@ ufs_mkdir(ap) error = UFS_VALLOC(dvp, dmode, cnp->cn_cred, &tvp); if (error) goto out; + vn_seqc_write_begin(tvp); ip = VTOI(tvp); ip->i_gid = dp->i_gid; DIP_SET(ip, i_gid, dp->i_gid); @@ -1846,6 +1917,7 @@ ufs_mkdir(ap) if (DOINGSOFTDEP(tvp)) softdep_revert_link(dp, ip); UFS_VFREE(tvp, ip->i_number, dmode); + vn_seqc_write_end(tvp); vgone(tvp); vput(tvp); return (error); @@ -1861,6 +1933,7 @@ ufs_mkdir(ap) if (DOINGSOFTDEP(tvp)) softdep_revert_link(dp, ip); UFS_VFREE(tvp, ip->i_number, dmode); + vn_seqc_write_end(tvp); vgone(tvp); vput(tvp); return (error); @@ -1868,7 +1941,7 @@ ufs_mkdir(ap) #endif #endif /* !SUIDDIR */ UFS_INODE_SET_FLAG(ip, IN_ACCESS | IN_CHANGE | IN_UPDATE); - ip->i_mode = dmode; + UFS_INODE_SET_MODE(ip, dmode); DIP_SET(ip, i_mode, dmode); tvp->v_type = VDIR; /* Rest init'd in getnewvnode(). */ ip->i_effnlink = 2; @@ -1974,6 +2047,7 @@ ufs_mkdir(ap) bad: if (error == 0) { *ap->a_vpp = tvp; + vn_seqc_write_end(tvp); } else { dp->i_effnlink--; dp->i_nlink--; @@ -1989,6 +2063,7 @@ bad: UFS_INODE_SET_FLAG(ip, IN_CHANGE); if (DOINGSOFTDEP(tvp)) softdep_revert_mkdir(dp, ip); + vn_seqc_write_end(tvp); vgone(tvp); vput(tvp); } @@ -2637,8 +2712,9 @@ ufs_makeinode(mode, dvp, vpp, cnp, callfunc) } #endif #endif /* !SUIDDIR */ + vn_seqc_write_begin(tvp); /* Mostly to cover asserts */ UFS_INODE_SET_FLAG(ip, IN_ACCESS | IN_CHANGE | IN_UPDATE); - ip->i_mode = mode; + UFS_INODE_SET_MODE(ip, mode); DIP_SET(ip, i_mode, mode); tvp->v_type = IFTOVT(mode); /* Rest init'd in getnewvnode(). */ ip->i_effnlink = 1; @@ -2648,7 +2724,7 @@ ufs_makeinode(mode, dvp, vpp, cnp, callfunc) softdep_setup_create(VTOI(dvp), ip); if ((ip->i_mode & ISGID) && !groupmember(ip->i_gid, cnp->cn_cred) && priv_check_cred(cnp->cn_cred, PRIV_VFS_SETGID)) { - ip->i_mode &= ~ISGID; + UFS_INODE_SET_MODE(ip, ip->i_mode & ~ISGID); DIP_SET(ip, i_mode, ip->i_mode); } @@ -2688,6 +2764,7 @@ ufs_makeinode(mode, dvp, vpp, cnp, callfunc) error = ufs_direnter(dvp, tvp, &newdir, cnp, NULL, 0); if (error) goto bad; + vn_seqc_write_end(tvp); *vpp = tvp; return (0); @@ -2702,6 +2779,7 @@ bad: UFS_INODE_SET_FLAG(ip, IN_CHANGE); if (DOINGSOFTDEP(tvp)) softdep_revert_create(VTOI(dvp), ip); + vn_seqc_write_end(tvp); vgone(tvp); vput(tvp); return (error); @@ -2740,6 +2818,7 @@ struct vop_vector ufs_vnodeops = { .vop_write = VOP_PANIC, .vop_accessx = ufs_accessx, .vop_bmap = ufs_bmap, + .vop_fplookup_vexec = ufs_fplookup_vexec, .vop_cachedlookup = ufs_lookup, .vop_close = ufs_close, .vop_create = ufs_create, From owner-svn-src-all@freebsd.org Sat Jul 25 10:38:46 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 056283A6CB9; Sat, 25 Jul 2020 10:38: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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BDMxK6Nzxz4459; Sat, 25 Jul 2020 10:38:45 +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 C004619E7D; Sat, 25 Jul 2020 10:38:45 +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 06PAcjep044066; Sat, 25 Jul 2020 10:38:45 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06PAci9w044061; Sat, 25 Jul 2020 10:38:44 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202007251038.06PAci9w044061@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Sat, 25 Jul 2020 10:38:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363521 - head/sys/fs/tmpfs X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/fs/tmpfs X-SVN-Commit-Revision: 363521 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 25 Jul 2020 10:38:46 -0000 Author: mjg Date: Sat Jul 25 10:38:44 2020 New Revision: 363521 URL: https://svnweb.freebsd.org/changeset/base/363521 Log: tmpfs: add support for lockless lookup Reviewed by: kib Tested by: pho (in a patchset) Differential Revision: https://reviews.freebsd.org/D25580 Modified: head/sys/fs/tmpfs/tmpfs.h head/sys/fs/tmpfs/tmpfs_subr.c head/sys/fs/tmpfs/tmpfs_vfsops.c head/sys/fs/tmpfs/tmpfs_vnops.c head/sys/fs/tmpfs/tmpfs_vnops.h Modified: head/sys/fs/tmpfs/tmpfs.h ============================================================================== --- head/sys/fs/tmpfs/tmpfs.h Sat Jul 25 10:38:05 2020 (r363520) +++ head/sys/fs/tmpfs/tmpfs.h Sat Jul 25 10:38:44 2020 (r363521) @@ -526,6 +526,9 @@ VP_TO_TMPFS_NODE(struct vnode *vp) return (node); } +#define VP_TO_TMPFS_NODE_SMR(vp) \ + ((struct tmpfs_node *)vn_load_v_data_smr(vp)) + static inline struct tmpfs_node * VP_TO_TMPFS_DIR(struct vnode *vp) { Modified: head/sys/fs/tmpfs/tmpfs_subr.c ============================================================================== --- head/sys/fs/tmpfs/tmpfs_subr.c Sat Jul 25 10:38:05 2020 (r363520) +++ head/sys/fs/tmpfs/tmpfs_subr.c Sat Jul 25 10:38:44 2020 (r363521) @@ -75,6 +75,7 @@ static long tmpfs_pages_reserved = TMPFS_PAGES_MINRESE static uma_zone_t tmpfs_dirent_pool; static uma_zone_t tmpfs_node_pool; +VFS_SMR_DECLARE; static int tmpfs_node_ctor(void *mem, int size, void *arg, int flags) @@ -131,6 +132,7 @@ tmpfs_subr_init(void) tmpfs_node_pool = uma_zcreate("TMPFS node", sizeof(struct tmpfs_node), tmpfs_node_ctor, tmpfs_node_dtor, tmpfs_node_init, tmpfs_node_fini, UMA_ALIGN_PTR, 0); + VFS_SMR_ZONE_SET(tmpfs_node_pool); } void @@ -288,7 +290,7 @@ tmpfs_alloc_node(struct mount *mp, struct tmpfs_mount if ((mp->mnt_kern_flag & MNT_RDONLY) != 0) return (EROFS); - nnode = uma_zalloc_arg(tmpfs_node_pool, tmp, M_WAITOK); + nnode = uma_zalloc_smr(tmpfs_node_pool, M_WAITOK); /* Generic initialization. */ nnode->tn_type = type; @@ -435,7 +437,7 @@ tmpfs_free_node_locked(struct tmpfs_mount *tmp, struct panic("tmpfs_free_node: type %p %d", node, (int)node->tn_type); } - uma_zfree(tmpfs_node_pool, node); + uma_zfree_smr(tmpfs_node_pool, node); TMPFS_LOCK(tmp); tmpfs_free_tmp(tmp); return (true); @@ -1621,8 +1623,10 @@ tmpfs_chmod(struct vnode *vp, mode_t mode, struct ucre { int error; struct tmpfs_node *node; + mode_t newmode; ASSERT_VOP_ELOCKED(vp, "chmod"); + ASSERT_VOP_IN_SEQC(vp); node = VP_TO_TMPFS_NODE(vp); @@ -1656,10 +1660,10 @@ tmpfs_chmod(struct vnode *vp, mode_t mode, struct ucre return (error); } + newmode = node->tn_mode & ~ALLPERMS; + newmode |= mode & ALLPERMS; + atomic_store_short(&node->tn_mode, newmode); - node->tn_mode &= ~ALLPERMS; - node->tn_mode |= mode & ALLPERMS; - node->tn_status |= TMPFS_NODE_CHANGED; ASSERT_VOP_ELOCKED(vp, "chmod2"); @@ -1682,8 +1686,10 @@ tmpfs_chown(struct vnode *vp, uid_t uid, gid_t gid, st struct tmpfs_node *node; uid_t ouid; gid_t ogid; + mode_t newmode; ASSERT_VOP_ELOCKED(vp, "chown"); + ASSERT_VOP_IN_SEQC(vp); node = VP_TO_TMPFS_NODE(vp); @@ -1729,8 +1735,10 @@ tmpfs_chown(struct vnode *vp, uid_t uid, gid_t gid, st node->tn_status |= TMPFS_NODE_CHANGED; if ((node->tn_mode & (S_ISUID | S_ISGID)) && (ouid != uid || ogid != gid)) { - if (priv_check_cred(cred, PRIV_VFS_RETAINSUGID)) - node->tn_mode &= ~(S_ISUID | S_ISGID); + if (priv_check_cred(cred, PRIV_VFS_RETAINSUGID)) { + newmode = node->tn_mode & ~(S_ISUID | S_ISGID); + atomic_store_short(&node->tn_mode, newmode); + } } ASSERT_VOP_ELOCKED(vp, "chown2"); Modified: head/sys/fs/tmpfs/tmpfs_vfsops.c ============================================================================== --- head/sys/fs/tmpfs/tmpfs_vfsops.c Sat Jul 25 10:38:05 2020 (r363520) +++ head/sys/fs/tmpfs/tmpfs_vfsops.c Sat Jul 25 10:38:44 2020 (r363521) @@ -462,6 +462,8 @@ tmpfs_mount(struct mount *mp) mp->mnt_flag |= MNT_LOCAL; mp->mnt_kern_flag |= MNTK_LOOKUP_SHARED | MNTK_EXTENDED_SHARED | MNTK_TEXT_REFS | MNTK_NOMSYNC; + if (!nonc) + mp->mnt_kern_flag |= MNTK_FPLOOKUP; MNT_IUNLOCK(mp); mp->mnt_data = tmp; Modified: head/sys/fs/tmpfs/tmpfs_vnops.c ============================================================================== --- head/sys/fs/tmpfs/tmpfs_vnops.c Sat Jul 25 10:38:05 2020 (r363520) +++ head/sys/fs/tmpfs/tmpfs_vnops.c Sat Jul 25 10:38:44 2020 (r363521) @@ -55,6 +55,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -64,6 +65,7 @@ __FBSDID("$FreeBSD$"); #include SYSCTL_DECL(_vfs_tmpfs); +VFS_SMR_DECLARE; static volatile int tmpfs_rename_restarts; SYSCTL_INT(_vfs_tmpfs, OID_AUTO, rename_restarts, CTLFLAG_RD, @@ -317,7 +319,33 @@ tmpfs_close(struct vop_close_args *v) return (0); } +/* + * VOP_FPLOOKUP_VEXEC routines are subject to special circumstances, see + * the comment above cache_fplookup for details. + */ int +tmpfs_fplookup_vexec(struct vop_fplookup_vexec_args *v) +{ + struct vnode *vp; + struct tmpfs_node *node; + struct ucred *cred; + mode_t all_x, mode; + + vp = v->a_vp; + node = VP_TO_TMPFS_NODE_SMR(vp); + if (__predict_false(node == NULL)) + return (EAGAIN); + + all_x = S_IXUSR | S_IXGRP | S_IXOTH; + mode = atomic_load_short(&node->tn_mode); + if (__predict_true((mode & all_x) == all_x)) + return (0); + + cred = v->a_cred; + return (vaccess_vexec_smr(mode, node->tn_uid, node->tn_gid, cred)); +} + +int tmpfs_access(struct vop_access_args *v) { struct vnode *vp = v->a_vp; @@ -427,6 +455,7 @@ tmpfs_setattr(struct vop_setattr_args *v) int error; MPASS(VOP_ISLOCKED(vp)); + ASSERT_VOP_IN_SEQC(vp); error = 0; @@ -497,6 +526,7 @@ tmpfs_write(struct vop_write_args *v) struct tmpfs_node *node; off_t oldsize; int error, ioflag; + mode_t newmode; vp = v->a_vp; uio = v->a_uio; @@ -527,8 +557,12 @@ tmpfs_write(struct vop_write_args *v) node->tn_status |= TMPFS_NODE_ACCESSED | TMPFS_NODE_MODIFIED | TMPFS_NODE_CHANGED; if (node->tn_mode & (S_ISUID | S_ISGID)) { - if (priv_check_cred(v->a_cred, PRIV_VFS_RETAINSUGID)) - node->tn_mode &= ~(S_ISUID | S_ISGID); + if (priv_check_cred(v->a_cred, PRIV_VFS_RETAINSUGID)) { + newmode = node->tn_mode & ~(S_ISUID | S_ISGID); + vn_seqc_write_begin(vp); + atomic_store_short(&node->tn_mode, newmode); + vn_seqc_write_end(vp); + } } if (error != 0) (void)tmpfs_reg_resize(vp, oldsize, TRUE); @@ -806,12 +840,15 @@ tmpfs_rename(struct vop_rename_args *v) struct tmpfs_node *tnode; struct tmpfs_node *tdnode; int error; + bool want_seqc_end; MPASS(VOP_ISLOCKED(tdvp)); MPASS(IMPLIES(tvp != NULL, VOP_ISLOCKED(tvp))); MPASS(fcnp->cn_flags & HASBUF); MPASS(tcnp->cn_flags & HASBUF); + want_seqc_end = false; + /* * Disallow cross-device renames. * XXX Why isn't this done by the caller? @@ -852,6 +889,13 @@ tmpfs_rename(struct vop_rename_args *v) } } + if (tvp != NULL) + vn_seqc_write_begin(tvp); + vn_seqc_write_begin(tdvp); + vn_seqc_write_begin(fvp); + vn_seqc_write_begin(fdvp); + want_seqc_end = true; + tmp = VFS_TO_TMPFS(tdvp->v_mount); tdnode = VP_TO_TMPFS_DIR(tdvp); tnode = (tvp == NULL) ? NULL : VP_TO_TMPFS_NODE(tvp); @@ -1065,6 +1109,14 @@ out_locked: VOP_UNLOCK(fdvp); out: + if (want_seqc_end) { + if (tvp != NULL) + vn_seqc_write_end(tvp); + vn_seqc_write_end(tdvp); + vn_seqc_write_end(fvp); + vn_seqc_write_end(fdvp); + } + /* * Release target nodes. * XXX: I don't understand when tdvp can be the same as tvp, but @@ -1621,6 +1673,7 @@ struct vop_vector tmpfs_vnodeop_entries = { .vop_mknod = tmpfs_mknod, .vop_open = tmpfs_open, .vop_close = tmpfs_close, + .vop_fplookup_vexec = tmpfs_fplookup_vexec, .vop_access = tmpfs_access, .vop_getattr = tmpfs_getattr, .vop_setattr = tmpfs_setattr, Modified: head/sys/fs/tmpfs/tmpfs_vnops.h ============================================================================== --- head/sys/fs/tmpfs/tmpfs_vnops.h Sat Jul 25 10:38:05 2020 (r363520) +++ head/sys/fs/tmpfs/tmpfs_vnops.h Sat Jul 25 10:38:44 2020 (r363521) @@ -49,6 +49,7 @@ extern struct vop_vector tmpfs_vnodeop_entries; extern struct vop_vector tmpfs_vnodeop_nonc_entries; vop_access_t tmpfs_access; +vop_fplookup_vexec_t tmpfs_fplookup_vexec; vop_getattr_t tmpfs_getattr; vop_setattr_t tmpfs_setattr; vop_pathconf_t tmpfs_pathconf; From owner-svn-src-all@freebsd.org Sat Jul 25 10:39:42 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C3D583A6F81; Sat, 25 Jul 2020 10:39: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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BDMyQ4npfz44GL; Sat, 25 Jul 2020 10:39: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 87B091A7A2; Sat, 25 Jul 2020 10:39: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 06PAdg35044191; Sat, 25 Jul 2020 10:39:42 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06PAdfv9044187; Sat, 25 Jul 2020 10:39:41 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202007251039.06PAdfv9044187@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Sat, 25 Jul 2020 10:39:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363522 - in head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs: . sys X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: in head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs: . sys X-SVN-Commit-Revision: 363522 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 25 Jul 2020 10:39:42 -0000 Author: mjg Date: Sat Jul 25 10:39:41 2020 New Revision: 363522 URL: https://svnweb.freebsd.org/changeset/base/363522 Log: zfs: add support for lockless lookup Tested by: pho (in a patchset, previous version) Differential Revision: https://reviews.freebsd.org/D25581 Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_znode.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_acl.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_znode.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_znode.h Sat Jul 25 10:38:44 2020 (r363521) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_znode.h Sat Jul 25 10:39:41 2020 (r363522) @@ -246,6 +246,8 @@ VTOZ(vnode_t *vp) #define VTOZ(VP) ((znode_t *)(VP)->v_data) #endif +#define VTOZ_SMR(VP) ((znode_t *)vn_load_v_data_smr(VP)) + /* Called on entry to each ZFS vnode and vfs operation */ #define ZFS_ENTER(zfsvfs) \ { \ Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_acl.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_acl.c Sat Jul 25 10:38:44 2020 (r363521) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_acl.c Sat Jul 25 10:39:41 2020 (r363522) @@ -1146,6 +1146,7 @@ zfs_acl_chown_setattr(znode_t *zp) ASSERT_VOP_ELOCKED(ZTOV(zp), __func__); ASSERT(MUTEX_HELD(&zp->z_acl_lock)); + ASSERT_VOP_IN_SEQC(ZTOV(zp)); if ((error = zfs_acl_node_read(zp, &aclp, B_FALSE)) == 0) zp->z_mode = zfs_mode_compute(zp->z_mode, aclp, @@ -1172,6 +1173,8 @@ zfs_aclset_common(znode_t *zp, zfs_acl_t *aclp, cred_t uint64_t ctime[2]; int count = 0; zfs_acl_phys_t acl_phys; + + ASSERT_VOP_IN_SEQC(ZTOV(zp)); mode = zp->z_mode; Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Sat Jul 25 10:38:44 2020 (r363521) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Sat Jul 25 10:39:41 2020 (r363522) @@ -1391,6 +1391,9 @@ zfs_domount(vfs_t *vfsp, char *osname) vfsp->vfs_data = zfsvfs; vfsp->mnt_flag |= MNT_LOCAL; +#if defined(_KERNEL) && !defined(KMEM_DEBUG) + vfsp->mnt_kern_flag |= MNTK_FPLOOKUP; +#endif vfsp->mnt_kern_flag |= MNTK_LOOKUP_SHARED; vfsp->mnt_kern_flag |= MNTK_SHARED_WRITES; vfsp->mnt_kern_flag |= MNTK_EXTENDED_SHARED; 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 Sat Jul 25 10:38:44 2020 (r363521) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Sat Jul 25 10:39:41 2020 (r363522) @@ -38,6 +38,7 @@ #include #include #include +#include #include #include #include @@ -78,6 +79,8 @@ #include #include +VFS_SMR_DECLARE; + /* * Programming rules. * @@ -3698,6 +3701,7 @@ zfs_rename(vnode_t *sdvp, vnode_t **svpp, struct compo char *snm = scnp->cn_nameptr; char *tnm = tcnp->cn_nameptr; int error = 0; + bool want_seqc_end = false; /* Reject renames across filesystems. */ if ((*svpp)->v_mount != tdvp->v_mount || @@ -3828,6 +3832,14 @@ zfs_rename(vnode_t *sdvp, vnode_t **svpp, struct compo } } + vn_seqc_write_begin(*svpp); + vn_seqc_write_begin(sdvp); + if (*tvpp != NULL) + vn_seqc_write_begin(*tvpp); + if (tdvp != *tvpp) + vn_seqc_write_begin(tdvp); + want_seqc_end = true; + vnevent_rename_src(*svpp, sdvp, scnp->cn_nameptr, ct); if (tzp) vnevent_rename_dest(*tvpp, tdvp, tnm, ct); @@ -3914,10 +3926,20 @@ zfs_rename(vnode_t *sdvp, vnode_t **svpp, struct compo unlockout: /* all 4 vnodes are locked, ZFS_ENTER called */ ZFS_EXIT(zfsvfs); + if (want_seqc_end) { + vn_seqc_write_end(*svpp); + vn_seqc_write_end(sdvp); + if (*tvpp != NULL) + vn_seqc_write_end(*tvpp); + if (tdvp != *tvpp) + vn_seqc_write_end(tdvp); + want_seqc_end = false; + } VOP_UNLOCK(*svpp); VOP_UNLOCK(sdvp); out: /* original two vnodes are locked */ + MPASS(!want_seqc_end); if (error == 0 && zfsvfs->z_os->os_sync == ZFS_SYNC_ALWAYS) zil_commit(zilog, 0); @@ -4861,7 +4883,32 @@ zfs_freebsd_write(ap) ap->a_cred, NULL)); } +/* + * VOP_FPLOOKUP_VEXEC routines are subject to special circumstances, see + * the comment above cache_fplookup for details. + */ static int +zfs_freebsd_fplookup_vexec(struct vop_fplookup_vexec_args *v) +{ + vnode_t *vp; + znode_t *zp; + uint64_t pflags; + + vp = v->a_vp; + zp = VTOZ_SMR(vp); + if (__predict_false(zp == NULL)) + return (EAGAIN); + pflags = atomic_load_64(&zp->z_pflags); + if (pflags & ZFS_AV_QUARANTINED) + return (EAGAIN); + if (pflags & ZFS_XATTR) + return (EAGAIN); + if ((pflags & ZFS_NO_EXECS_DENIED) == 0) + return (EAGAIN); + return (0); +} + +static int zfs_freebsd_access(ap) struct vop_access_args /* { struct vnode *a_vp; @@ -5998,6 +6045,7 @@ struct vop_vector zfs_vnodeops = { .vop_inactive = zfs_freebsd_inactive, .vop_need_inactive = zfs_freebsd_need_inactive, .vop_reclaim = zfs_freebsd_reclaim, + .vop_fplookup_vexec = zfs_freebsd_fplookup_vexec, .vop_access = zfs_freebsd_access, .vop_allocate = VOP_EINVAL, .vop_lookup = zfs_cache_lookup, @@ -6066,6 +6114,7 @@ VFS_VOP_VECTOR_REGISTER(zfs_fifoops); */ struct vop_vector zfs_shareops = { .vop_default = &default_vnodeops, + .vop_fplookup_vexec = zfs_freebsd_fplookup_vexec, .vop_access = zfs_freebsd_access, .vop_inactive = zfs_freebsd_inactive, .vop_reclaim = zfs_freebsd_reclaim, Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c Sat Jul 25 10:38:44 2020 (r363521) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c Sat Jul 25 10:39:41 2020 (r363522) @@ -99,7 +99,12 @@ SYSCTL_INT(_debug_sizeof, OID_AUTO, znode, CTLFLAG_RD, */ krwlock_t zfsvfs_lock; +#if defined(_KERNEL) && !defined(KMEM_DEBUG) +#define _ZFS_USE_SMR +static uma_zone_t znode_uma_zone; +#else static kmem_cache_t *znode_cache = NULL; +#endif /*ARGSUSED*/ static void @@ -366,6 +371,23 @@ zfs_znode_move(void *buf, void *newbuf, size_t size, v } #endif /* illumos */ +#ifdef _ZFS_USE_SMR +VFS_SMR_DECLARE; + +static int +zfs_znode_cache_constructor_smr(void *mem, int size __unused, void *private, int flags) +{ + + return (zfs_znode_cache_constructor(mem, private, flags)); +} + +static void +zfs_znode_cache_destructor_smr(void *mem, int size __unused, void *private) +{ + + zfs_znode_cache_destructor(mem, private); +} + void zfs_znode_init(void) { @@ -373,6 +395,34 @@ zfs_znode_init(void) * Initialize zcache */ rw_init(&zfsvfs_lock, NULL, RW_DEFAULT, NULL); + ASSERT(znode_uma_zone == NULL); + znode_uma_zone = uma_zcreate("zfs_znode_cache", + sizeof (znode_t), zfs_znode_cache_constructor_smr, + zfs_znode_cache_destructor_smr, NULL, NULL, 0, 0); + VFS_SMR_ZONE_SET(znode_uma_zone); +} + +static znode_t * +zfs_znode_alloc_kmem(int flags) +{ + + return (uma_zalloc_smr(znode_uma_zone, flags)); +} + +static void +zfs_znode_free_kmem(znode_t *zp) +{ + + uma_zfree_smr(znode_uma_zone, zp); +} +#else +void +zfs_znode_init(void) +{ + /* + * Initialize zcache + */ + rw_init(&zfsvfs_lock, NULL, RW_DEFAULT, NULL); ASSERT(znode_cache == NULL); znode_cache = kmem_cache_create("zfs_znode_cache", sizeof (znode_t), 0, zfs_znode_cache_constructor, @@ -380,6 +430,21 @@ zfs_znode_init(void) kmem_cache_set_move(znode_cache, zfs_znode_move); } +static znode_t * +zfs_znode_alloc_kmem(int flags) +{ + + return (kmem_cache_alloc(znode_cache, flags)); +} + +static void +zfs_znode_free_kmem(znode_t *zp) +{ + + kmem_cache_free(znode_cache, zp); +} +#endif + void zfs_znode_fini(void) { @@ -393,9 +458,17 @@ zfs_znode_fini(void) /* * Cleanup zcache */ - if (znode_cache) +#ifdef _ZFS_USE_SMR + if (znode_uma_zone) { + uma_zdestroy(znode_uma_zone); + znode_uma_zone = NULL; + } +#else + if (znode_cache) { kmem_cache_destroy(znode_cache); - znode_cache = NULL; + znode_cache = NULL; + } +#endif rw_destroy(&zfsvfs_lock); } @@ -508,7 +581,7 @@ zfs_create_share_dir(zfsvfs_t *zfsvfs, dmu_tx_t *tx) vattr.va_uid = crgetuid(kcred); vattr.va_gid = crgetgid(kcred); - sharezp = kmem_cache_alloc(znode_cache, KM_SLEEP); + sharezp = zfs_znode_alloc_kmem(KM_SLEEP); ASSERT(!POINTER_IS_VALID(sharezp->z_zfsvfs)); sharezp->z_moved = 0; sharezp->z_unlinked = 0; @@ -527,7 +600,7 @@ zfs_create_share_dir(zfsvfs_t *zfsvfs, dmu_tx_t *tx) zfs_acl_ids_free(&acl_ids); sa_handle_destroy(sharezp->z_sa_hdl); - kmem_cache_free(znode_cache, sharezp); + zfs_znode_free_kmem(sharezp); return (error); } @@ -642,13 +715,18 @@ zfs_znode_alloc(zfsvfs_t *zfsvfs, dmu_buf_t *db, int b int count = 0; int error; - zp = kmem_cache_alloc(znode_cache, KM_SLEEP); + zp = zfs_znode_alloc_kmem(KM_SLEEP); +#ifndef _ZFS_USE_SMR + KASSERT((zfsvfs->z_parent->z_vfs->mnt_kern_flag & MNTK_FPLOOKUP) == 0, + ("%s: fast path lookup enabled without smr", __func__)); +#endif + KASSERT(curthread->td_vp_reserved != NULL, ("zfs_znode_alloc: getnewvnode without preallocated vnode")); error = getnewvnode("zfs", zfsvfs->z_parent->z_vfs, &zfs_vnodeops, &vp); if (error != 0) { - kmem_cache_free(znode_cache, zp); + zfs_znode_free_kmem(zp); return (NULL); } zp->z_vnode = vp; @@ -695,7 +773,7 @@ zfs_znode_alloc(zfsvfs_t *zfsvfs, dmu_buf_t *db, int b sa_handle_destroy(zp->z_sa_hdl); zfs_vnode_forget(vp); zp->z_vnode = NULL; - kmem_cache_free(znode_cache, zp); + zfs_znode_free_kmem(zp); return (NULL); } @@ -1061,6 +1139,8 @@ zfs_xvattr_set(znode_t *zp, xvattr_t *xvap, dmu_tx_t * xoap = xva_getxoptattr(xvap); ASSERT(xoap); + ASSERT_VOP_IN_SEQC(ZTOV(zp)); + if (XVA_ISSET_REQ(xvap, XAT_CREATETIME)) { uint64_t times[2]; ZFS_TIME_ENCODE(&xoap->xoa_createtime, times); @@ -1490,7 +1570,7 @@ zfs_znode_free(znode_t *zp) zp->z_acl_cached = NULL; } - kmem_cache_free(znode_cache, zp); + zfs_znode_free_kmem(zp); #ifdef illumos VFS_RELE(zfsvfs->z_vfs); @@ -1950,7 +2030,7 @@ zfs_create_fs(objset_t *os, cred_t *cr, nvlist_t *zplp zfsvfs = kmem_zalloc(sizeof (zfsvfs_t), KM_SLEEP); - rootzp = kmem_cache_alloc(znode_cache, KM_SLEEP); + rootzp = zfs_znode_alloc_kmem(KM_SLEEP); ASSERT(!POINTER_IS_VALID(rootzp->z_zfsvfs)); rootzp->z_moved = 0; rootzp->z_unlinked = 0; @@ -1994,7 +2074,7 @@ zfs_create_fs(objset_t *os, cred_t *cr, nvlist_t *zplp POINTER_INVALIDATE(&rootzp->z_zfsvfs); sa_handle_destroy(rootzp->z_sa_hdl); - kmem_cache_free(znode_cache, rootzp); + zfs_znode_free_kmem(rootzp); /* * Create shares directory From owner-svn-src-all@freebsd.org Sat Jul 25 10:40:38 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B85123A7218; Sat, 25 Jul 2020 10:40:38 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BDMzV4TNxz44by; Sat, 25 Jul 2020 10:40:38 +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 72C2F1A1F3; Sat, 25 Jul 2020 10:40:38 +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 06PAecTb044335; Sat, 25 Jul 2020 10:40:38 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06PAec7C044334; Sat, 25 Jul 2020 10:40:38 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202007251040.06PAec7C044334@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Sat, 25 Jul 2020 10:40:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363523 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 363523 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 25 Jul 2020 10:40:38 -0000 Author: mjg Date: Sat Jul 25 10:40:38 2020 New Revision: 363523 URL: https://svnweb.freebsd.org/changeset/base/363523 Log: vfs: add support for !LOCKLEAF to lockless lookup Tested by: pho (in a patchset) Differential Revision: https://reviews.freebsd.org/D23916 Modified: head/sys/kern/vfs_cache.c Modified: head/sys/kern/vfs_cache.c ============================================================================== --- head/sys/kern/vfs_cache.c Sat Jul 25 10:39:41 2020 (r363522) +++ head/sys/kern/vfs_cache.c Sat Jul 25 10:40:38 2020 (r363523) @@ -3029,10 +3029,6 @@ cache_can_fplookup(struct cache_fpl *fpl) cache_fpl_aborted(fpl); return (false); } - if ((cnp->cn_flags & LOCKLEAF) == 0) { - cache_fpl_aborted(fpl); - return (false); - } if (cnp->cn_nameiop != LOOKUP) { cache_fpl_aborted(fpl); return (false); @@ -3120,7 +3116,6 @@ cache_fplookup_final(struct cache_fpl *fpl) tvp_seqc = fpl->tvp_seqc; VNPASS(cache_fplookup_vnode_supported(dvp), dvp); - MPASS((cnp->cn_flags & LOCKLEAF) != 0); tvs = vget_prep_smr(tvp); if (tvs == VGET_NONE) { @@ -3135,13 +3130,20 @@ cache_fplookup_final(struct cache_fpl *fpl) cache_fpl_smr_exit(fpl); - error = vget_finish(tvp, cnp->cn_lkflags, tvs); - if (error != 0) { - return (cache_fpl_aborted(fpl)); + if ((cnp->cn_flags & LOCKLEAF) != 0) { + error = vget_finish(tvp, cnp->cn_lkflags, tvs); + if (error != 0) { + return (cache_fpl_aborted(fpl)); + } + } else { + vget_finish_ref(tvp, tvs); } if (!vn_seqc_consistent(tvp, tvp_seqc)) { - vput(tvp); + if ((cnp->cn_flags & LOCKLEAF) != 0) + vput(tvp); + else + vrele(tvp); return (cache_fpl_aborted(fpl)); } From owner-svn-src-all@freebsd.org Sat Jul 25 11:34:50 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E8ABA360CD2; Sat, 25 Jul 2020 11:34:50 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BDPB26DyMz474P; Sat, 25 Jul 2020 11:34:50 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9F1F61B23D; Sat, 25 Jul 2020 11:34:50 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06PBYoSP082124; Sat, 25 Jul 2020 11:34:50 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06PBYoqJ082122; Sat, 25 Jul 2020 11:34:50 GMT (envelope-from br@FreeBSD.org) Message-Id: <202007251134.06PBYoqJ082122@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Sat, 25 Jul 2020 11:34:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363524 - in head/sys: conf dev/iommu x86/iommu X-SVN-Group: head X-SVN-Commit-Author: br X-SVN-Commit-Paths: in head/sys: conf dev/iommu x86/iommu X-SVN-Commit-Revision: 363524 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 25 Jul 2020 11:34:51 -0000 Author: br Date: Sat Jul 25 11:34:50 2020 New Revision: 363524 URL: https://svnweb.freebsd.org/changeset/base/363524 Log: Move Intel GAS to dev/iommu/ as now a part of generic iommu framework. Reviewed by: kib Sponsored by: DARPA/AFRL Differential Revision: https://reviews.freebsd.org/D25799 Added: head/sys/dev/iommu/iommu_gas.c - copied unchanged from r363523, head/sys/x86/iommu/intel_gas.c Deleted: head/sys/x86/iommu/intel_gas.c Modified: head/sys/conf/files.x86 Modified: head/sys/conf/files.x86 ============================================================================== --- head/sys/conf/files.x86 Sat Jul 25 10:40:38 2020 (r363523) +++ head/sys/conf/files.x86 Sat Jul 25 11:34:50 2020 (r363524) @@ -166,6 +166,7 @@ dev/imcsmb/imcsmb_pci.c optional imcsmb pci dev/intel/spi.c optional intelspi dev/io/iodev.c optional io dev/iommu/busdma_iommu.c optional acpi acpi_dmar pci +dev/iommu/iommu_gas.c optional acpi acpi_dmar pci dev/ipmi/ipmi.c optional ipmi dev/ipmi/ipmi_acpi.c optional ipmi acpi dev/ipmi/ipmi_isa.c optional ipmi isa @@ -304,7 +305,6 @@ x86/cpufreq/powernow.c optional cpufreq x86/iommu/intel_ctx.c optional acpi acpi_dmar pci x86/iommu/intel_drv.c optional acpi acpi_dmar pci x86/iommu/intel_fault.c optional acpi acpi_dmar pci -x86/iommu/intel_gas.c optional acpi acpi_dmar pci x86/iommu/intel_idpgtbl.c optional acpi acpi_dmar pci x86/iommu/intel_intrmap.c optional acpi acpi_dmar pci x86/iommu/intel_qi.c optional acpi acpi_dmar pci Copied: head/sys/dev/iommu/iommu_gas.c (from r363523, head/sys/x86/iommu/intel_gas.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/iommu/iommu_gas.c Sat Jul 25 11:34:50 2020 (r363524, copy of r363523, head/sys/x86/iommu/intel_gas.c) @@ -0,0 +1,729 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2013 The FreeBSD Foundation + * All rights reserved. + * + * This software was 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: + * 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$"); + +#define RB_AUGMENT(entry) iommu_gas_augment_entry(entry) + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#if defined(__amd64__) || defined(__i386__) +#include +#include +#include +#include +#include +#include +#include +#endif + +/* + * Guest Address Space management. + */ + +static uma_zone_t iommu_map_entry_zone; + +static void +intel_gas_init(void) +{ + + iommu_map_entry_zone = uma_zcreate("IOMMU_MAP_ENTRY", + sizeof(struct iommu_map_entry), NULL, NULL, + NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_NODUMP); +} +SYSINIT(intel_gas, SI_SUB_DRIVERS, SI_ORDER_FIRST, intel_gas_init, NULL); + +struct iommu_map_entry * +iommu_gas_alloc_entry(struct iommu_domain *domain, u_int flags) +{ + struct iommu_map_entry *res; + + KASSERT((flags & ~(DMAR_PGF_WAITOK)) == 0, + ("unsupported flags %x", flags)); + + res = uma_zalloc(iommu_map_entry_zone, ((flags & DMAR_PGF_WAITOK) != + 0 ? M_WAITOK : M_NOWAIT) | M_ZERO); + if (res != NULL) { + res->domain = domain; + atomic_add_int(&domain->entries_cnt, 1); + } + return (res); +} + +void +iommu_gas_free_entry(struct iommu_domain *domain, struct iommu_map_entry *entry) +{ + + KASSERT(domain == (struct iommu_domain *)entry->domain, + ("mismatched free domain %p entry %p entry->domain %p", domain, + entry, entry->domain)); + atomic_subtract_int(&domain->entries_cnt, 1); + uma_zfree(iommu_map_entry_zone, entry); +} + +static int +iommu_gas_cmp_entries(struct iommu_map_entry *a, struct iommu_map_entry *b) +{ + + /* Last entry have zero size, so <= */ + KASSERT(a->start <= a->end, ("inverted entry %p (%jx, %jx)", + a, (uintmax_t)a->start, (uintmax_t)a->end)); + KASSERT(b->start <= b->end, ("inverted entry %p (%jx, %jx)", + b, (uintmax_t)b->start, (uintmax_t)b->end)); + KASSERT(a->end <= b->start || b->end <= a->start || + a->end == a->start || b->end == b->start, + ("overlapping entries %p (%jx, %jx) %p (%jx, %jx)", + a, (uintmax_t)a->start, (uintmax_t)a->end, + b, (uintmax_t)b->start, (uintmax_t)b->end)); + + if (a->end < b->end) + return (-1); + else if (b->end < a->end) + return (1); + return (0); +} + +static void +iommu_gas_augment_entry(struct iommu_map_entry *entry) +{ + struct iommu_map_entry *child; + iommu_gaddr_t free_down; + + free_down = 0; + if ((child = RB_LEFT(entry, rb_entry)) != NULL) { + free_down = MAX(free_down, child->free_down); + free_down = MAX(free_down, entry->start - child->last); + entry->first = child->first; + } else + entry->first = entry->start; + + if ((child = RB_RIGHT(entry, rb_entry)) != NULL) { + free_down = MAX(free_down, child->free_down); + free_down = MAX(free_down, child->first - entry->end); + entry->last = child->last; + } else + entry->last = entry->end; + entry->free_down = free_down; +} + +RB_GENERATE(iommu_gas_entries_tree, iommu_map_entry, rb_entry, + iommu_gas_cmp_entries); + +#ifdef INVARIANTS +static void +iommu_gas_check_free(struct iommu_domain *domain) +{ + struct iommu_map_entry *entry, *l, *r; + iommu_gaddr_t v; + + RB_FOREACH(entry, iommu_gas_entries_tree, &domain->rb_root) { + KASSERT(domain == (struct iommu_domain *)entry->domain, + ("mismatched free domain %p entry %p entry->domain %p", + domain, entry, entry->domain)); + l = RB_LEFT(entry, rb_entry); + r = RB_RIGHT(entry, rb_entry); + v = 0; + if (l != NULL) { + v = MAX(v, l->free_down); + v = MAX(v, entry->start - l->last); + } + if (r != NULL) { + v = MAX(v, r->free_down); + v = MAX(v, r->first - entry->end); + } + MPASS(entry->free_down == v); + } +} +#endif + +static bool +iommu_gas_rb_insert(struct iommu_domain *domain, struct iommu_map_entry *entry) +{ + struct iommu_map_entry *found; + + found = RB_INSERT(iommu_gas_entries_tree, + &domain->rb_root, entry); + return (found == NULL); +} + +static void +iommu_gas_rb_remove(struct iommu_domain *domain, struct iommu_map_entry *entry) +{ + + RB_REMOVE(iommu_gas_entries_tree, &domain->rb_root, entry); +} + +void +iommu_gas_init_domain(struct iommu_domain *domain) +{ + struct iommu_map_entry *begin, *end; + + begin = iommu_gas_alloc_entry(domain, DMAR_PGF_WAITOK); + end = iommu_gas_alloc_entry(domain, DMAR_PGF_WAITOK); + + IOMMU_DOMAIN_LOCK(domain); + KASSERT(domain->entries_cnt == 2, ("dirty domain %p", domain)); + KASSERT(RB_EMPTY(&domain->rb_root), + ("non-empty entries %p", domain)); + + begin->start = 0; + begin->end = IOMMU_PAGE_SIZE; + begin->flags = IOMMU_MAP_ENTRY_PLACE | IOMMU_MAP_ENTRY_UNMAPPED; + iommu_gas_rb_insert(domain, begin); + + end->start = domain->end; + end->end = domain->end; + end->flags = IOMMU_MAP_ENTRY_PLACE | IOMMU_MAP_ENTRY_UNMAPPED; + iommu_gas_rb_insert(domain, end); + + domain->first_place = begin; + domain->last_place = end; + domain->flags |= DMAR_DOMAIN_GAS_INITED; + IOMMU_DOMAIN_UNLOCK(domain); +} + +void +iommu_gas_fini_domain(struct iommu_domain *domain) +{ + struct iommu_map_entry *entry, *entry1; + + IOMMU_DOMAIN_ASSERT_LOCKED(domain); + KASSERT(domain->entries_cnt == 2, + ("domain still in use %p", domain)); + + entry = RB_MIN(iommu_gas_entries_tree, &domain->rb_root); + KASSERT(entry->start == 0, ("start entry start %p", domain)); + KASSERT(entry->end == IOMMU_PAGE_SIZE, ("start entry end %p", domain)); + KASSERT(entry->flags == IOMMU_MAP_ENTRY_PLACE, + ("start entry flags %p", domain)); + RB_REMOVE(iommu_gas_entries_tree, &domain->rb_root, entry); + iommu_gas_free_entry(domain, entry); + + entry = RB_MAX(iommu_gas_entries_tree, &domain->rb_root); + KASSERT(entry->start == domain->end, ("end entry start %p", domain)); + KASSERT(entry->end == domain->end, ("end entry end %p", domain)); + KASSERT(entry->flags == IOMMU_MAP_ENTRY_PLACE, + ("end entry flags %p", domain)); + RB_REMOVE(iommu_gas_entries_tree, &domain->rb_root, entry); + iommu_gas_free_entry(domain, entry); + + RB_FOREACH_SAFE(entry, iommu_gas_entries_tree, &domain->rb_root, + entry1) { + KASSERT((entry->flags & IOMMU_MAP_ENTRY_RMRR) != 0, + ("non-RMRR entry left %p", domain)); + RB_REMOVE(iommu_gas_entries_tree, &domain->rb_root, + entry); + iommu_gas_free_entry(domain, entry); + } +} + +struct iommu_gas_match_args { + struct iommu_domain *domain; + iommu_gaddr_t size; + int offset; + const struct bus_dma_tag_common *common; + u_int gas_flags; + struct iommu_map_entry *entry; +}; + +/* + * The interval [beg, end) is a free interval between two iommu_map_entries. + * maxaddr is an upper bound on addresses that can be allocated. Try to + * allocate space in the free interval, subject to the conditions expressed + * by a, and return 'true' if and only if the allocation attempt succeeds. + */ +static bool +iommu_gas_match_one(struct iommu_gas_match_args *a, iommu_gaddr_t beg, + iommu_gaddr_t end, iommu_gaddr_t maxaddr) +{ + iommu_gaddr_t bs, start; + + a->entry->start = roundup2(beg + IOMMU_PAGE_SIZE, + a->common->alignment); + if (a->entry->start + a->size > maxaddr) + return (false); + + /* IOMMU_PAGE_SIZE to create gap after new entry. */ + if (a->entry->start < beg + IOMMU_PAGE_SIZE || + a->entry->start + a->size + a->offset + IOMMU_PAGE_SIZE > end) + return (false); + + /* No boundary crossing. */ + if (iommu_test_boundary(a->entry->start + a->offset, a->size, + a->common->boundary)) + return (true); + + /* + * The start + offset to start + offset + size region crosses + * the boundary. Check if there is enough space after the + * next boundary after the beg. + */ + bs = rounddown2(a->entry->start + a->offset + a->common->boundary, + a->common->boundary); + start = roundup2(bs, a->common->alignment); + /* IOMMU_PAGE_SIZE to create gap after new entry. */ + if (start + a->offset + a->size + IOMMU_PAGE_SIZE <= end && + start + a->offset + a->size <= maxaddr && + iommu_test_boundary(start + a->offset, a->size, + a->common->boundary)) { + a->entry->start = start; + return (true); + } + + /* + * Not enough space to align at the requested boundary, or + * boundary is smaller than the size, but allowed to split. + * We already checked that start + size does not overlap maxaddr. + * + * XXXKIB. It is possible that bs is exactly at the start of + * the next entry, then we do not have gap. Ignore for now. + */ + if ((a->gas_flags & IOMMU_MF_CANSPLIT) != 0) { + a->size = bs - a->entry->start; + return (true); + } + + return (false); +} + +static void +iommu_gas_match_insert(struct iommu_gas_match_args *a) +{ + bool found; + + /* + * The prev->end is always aligned on the page size, which + * causes page alignment for the entry->start too. The size + * is checked to be multiple of the page size. + * + * The page sized gap is created between consequent + * allocations to ensure that out-of-bounds accesses fault. + */ + a->entry->end = a->entry->start + a->size; + + found = iommu_gas_rb_insert(a->domain, a->entry); + KASSERT(found, ("found dup %p start %jx size %jx", + a->domain, (uintmax_t)a->entry->start, (uintmax_t)a->size)); + a->entry->flags = IOMMU_MAP_ENTRY_MAP; +} + +static int +iommu_gas_lowermatch(struct iommu_gas_match_args *a, struct iommu_map_entry *entry) +{ + struct iommu_map_entry *child; + + child = RB_RIGHT(entry, rb_entry); + if (child != NULL && entry->end < a->common->lowaddr && + iommu_gas_match_one(a, entry->end, child->first, + a->common->lowaddr)) { + iommu_gas_match_insert(a); + return (0); + } + if (entry->free_down < a->size + a->offset + IOMMU_PAGE_SIZE) + return (ENOMEM); + if (entry->first >= a->common->lowaddr) + return (ENOMEM); + child = RB_LEFT(entry, rb_entry); + if (child != NULL && 0 == iommu_gas_lowermatch(a, child)) + return (0); + if (child != NULL && child->last < a->common->lowaddr && + iommu_gas_match_one(a, child->last, entry->start, + a->common->lowaddr)) { + iommu_gas_match_insert(a); + return (0); + } + child = RB_RIGHT(entry, rb_entry); + if (child != NULL && 0 == iommu_gas_lowermatch(a, child)) + return (0); + return (ENOMEM); +} + +static int +iommu_gas_uppermatch(struct iommu_gas_match_args *a, struct iommu_map_entry *entry) +{ + struct iommu_map_entry *child; + + if (entry->free_down < a->size + a->offset + IOMMU_PAGE_SIZE) + return (ENOMEM); + if (entry->last < a->common->highaddr) + return (ENOMEM); + child = RB_LEFT(entry, rb_entry); + if (child != NULL && 0 == iommu_gas_uppermatch(a, child)) + return (0); + if (child != NULL && child->last >= a->common->highaddr && + iommu_gas_match_one(a, child->last, entry->start, + a->domain->end)) { + iommu_gas_match_insert(a); + return (0); + } + child = RB_RIGHT(entry, rb_entry); + if (child != NULL && entry->end >= a->common->highaddr && + iommu_gas_match_one(a, entry->end, child->first, + a->domain->end)) { + iommu_gas_match_insert(a); + return (0); + } + if (child != NULL && 0 == iommu_gas_uppermatch(a, child)) + return (0); + return (ENOMEM); +} + +static int +iommu_gas_find_space(struct iommu_domain *domain, + const struct bus_dma_tag_common *common, iommu_gaddr_t size, + int offset, u_int flags, struct iommu_map_entry *entry) +{ + struct iommu_gas_match_args a; + int error; + + IOMMU_DOMAIN_ASSERT_LOCKED(domain); + KASSERT(entry->flags == 0, ("dirty entry %p %p", domain, entry)); + KASSERT((size & IOMMU_PAGE_MASK) == 0, ("size %jx", (uintmax_t)size)); + + a.domain = domain; + a.size = size; + a.offset = offset; + a.common = common; + a.gas_flags = flags; + a.entry = entry; + + /* Handle lower region. */ + if (common->lowaddr > 0) { + error = iommu_gas_lowermatch(&a, + RB_ROOT(&domain->rb_root)); + if (error == 0) + return (0); + KASSERT(error == ENOMEM, + ("error %d from iommu_gas_lowermatch", error)); + } + /* Handle upper region. */ + if (common->highaddr >= domain->end) + return (ENOMEM); + error = iommu_gas_uppermatch(&a, RB_ROOT(&domain->rb_root)); + KASSERT(error == ENOMEM, + ("error %d from iommu_gas_uppermatch", error)); + return (error); +} + +static int +iommu_gas_alloc_region(struct iommu_domain *domain, struct iommu_map_entry *entry, + u_int flags) +{ + struct iommu_map_entry *next, *prev; + bool found; + + IOMMU_DOMAIN_ASSERT_LOCKED(domain); + + if ((entry->start & IOMMU_PAGE_MASK) != 0 || + (entry->end & IOMMU_PAGE_MASK) != 0) + return (EINVAL); + if (entry->start >= entry->end) + return (EINVAL); + if (entry->end >= domain->end) + return (EINVAL); + + next = RB_NFIND(iommu_gas_entries_tree, &domain->rb_root, entry); + KASSERT(next != NULL, ("next must be non-null %p %jx", domain, + (uintmax_t)entry->start)); + prev = RB_PREV(iommu_gas_entries_tree, &domain->rb_root, next); + /* prev could be NULL */ + + /* + * Adapt to broken BIOSes which specify overlapping RMRR + * entries. + * + * XXXKIB: this does not handle a case when prev or next + * entries are completely covered by the current one, which + * extends both ways. + */ + if (prev != NULL && prev->end > entry->start && + (prev->flags & IOMMU_MAP_ENTRY_PLACE) == 0) { + if ((flags & IOMMU_MF_RMRR) == 0 || + (prev->flags & IOMMU_MAP_ENTRY_RMRR) == 0) + return (EBUSY); + entry->start = prev->end; + } + if (next->start < entry->end && + (next->flags & IOMMU_MAP_ENTRY_PLACE) == 0) { + if ((flags & IOMMU_MF_RMRR) == 0 || + (next->flags & IOMMU_MAP_ENTRY_RMRR) == 0) + return (EBUSY); + entry->end = next->start; + } + if (entry->end == entry->start) + return (0); + + if (prev != NULL && prev->end > entry->start) { + /* This assumes that prev is the placeholder entry. */ + iommu_gas_rb_remove(domain, prev); + prev = NULL; + } + if (next->start < entry->end) { + iommu_gas_rb_remove(domain, next); + next = NULL; + } + + found = iommu_gas_rb_insert(domain, entry); + KASSERT(found, ("found RMRR dup %p start %jx end %jx", + domain, (uintmax_t)entry->start, (uintmax_t)entry->end)); + if ((flags & IOMMU_MF_RMRR) != 0) + entry->flags = IOMMU_MAP_ENTRY_RMRR; + +#ifdef INVARIANTS + struct iommu_map_entry *ip, *in; + ip = RB_PREV(iommu_gas_entries_tree, &domain->rb_root, entry); + in = RB_NEXT(iommu_gas_entries_tree, &domain->rb_root, entry); + KASSERT(prev == NULL || ip == prev, + ("RMRR %p (%jx %jx) prev %p (%jx %jx) ins prev %p (%jx %jx)", + entry, entry->start, entry->end, prev, + prev == NULL ? 0 : prev->start, prev == NULL ? 0 : prev->end, + ip, ip == NULL ? 0 : ip->start, ip == NULL ? 0 : ip->end)); + KASSERT(next == NULL || in == next, + ("RMRR %p (%jx %jx) next %p (%jx %jx) ins next %p (%jx %jx)", + entry, entry->start, entry->end, next, + next == NULL ? 0 : next->start, next == NULL ? 0 : next->end, + in, in == NULL ? 0 : in->start, in == NULL ? 0 : in->end)); +#endif + + return (0); +} + +void +iommu_gas_free_space(struct iommu_domain *domain, struct iommu_map_entry *entry) +{ + + IOMMU_DOMAIN_ASSERT_LOCKED(domain); + KASSERT((entry->flags & (IOMMU_MAP_ENTRY_PLACE | IOMMU_MAP_ENTRY_RMRR | + IOMMU_MAP_ENTRY_MAP)) == IOMMU_MAP_ENTRY_MAP, + ("permanent entry %p %p", domain, entry)); + + iommu_gas_rb_remove(domain, entry); + entry->flags &= ~IOMMU_MAP_ENTRY_MAP; +#ifdef INVARIANTS + if (iommu_check_free) + iommu_gas_check_free(domain); +#endif +} + +void +iommu_gas_free_region(struct iommu_domain *domain, struct iommu_map_entry *entry) +{ + struct iommu_map_entry *next, *prev; + + IOMMU_DOMAIN_ASSERT_LOCKED(domain); + KASSERT((entry->flags & (IOMMU_MAP_ENTRY_PLACE | IOMMU_MAP_ENTRY_RMRR | + IOMMU_MAP_ENTRY_MAP)) == IOMMU_MAP_ENTRY_RMRR, + ("non-RMRR entry %p %p", domain, entry)); + + prev = RB_PREV(iommu_gas_entries_tree, &domain->rb_root, entry); + next = RB_NEXT(iommu_gas_entries_tree, &domain->rb_root, entry); + iommu_gas_rb_remove(domain, entry); + entry->flags &= ~IOMMU_MAP_ENTRY_RMRR; + + if (prev == NULL) + iommu_gas_rb_insert(domain, domain->first_place); + if (next == NULL) + iommu_gas_rb_insert(domain, domain->last_place); +} + +int +iommu_gas_map(struct iommu_domain *domain, + const struct bus_dma_tag_common *common, iommu_gaddr_t size, int offset, + u_int eflags, u_int flags, vm_page_t *ma, struct iommu_map_entry **res) +{ + struct iommu_map_entry *entry; + int error; + + KASSERT((flags & ~(IOMMU_MF_CANWAIT | IOMMU_MF_CANSPLIT)) == 0, + ("invalid flags 0x%x", flags)); + + entry = iommu_gas_alloc_entry(domain, + (flags & IOMMU_MF_CANWAIT) != 0 ? DMAR_PGF_WAITOK : 0); + if (entry == NULL) + return (ENOMEM); + IOMMU_DOMAIN_LOCK(domain); + error = iommu_gas_find_space(domain, common, size, offset, flags, + entry); + if (error == ENOMEM) { + IOMMU_DOMAIN_UNLOCK(domain); + iommu_gas_free_entry(domain, entry); + return (error); + } +#ifdef INVARIANTS + if (iommu_check_free) + iommu_gas_check_free(domain); +#endif + KASSERT(error == 0, + ("unexpected error %d from iommu_gas_find_entry", error)); + KASSERT(entry->end < domain->end, ("allocated GPA %jx, max GPA %jx", + (uintmax_t)entry->end, (uintmax_t)domain->end)); + entry->flags |= eflags; + IOMMU_DOMAIN_UNLOCK(domain); + + error = domain_map_buf(domain, entry->start, entry->end - entry->start, + ma, eflags, + ((flags & IOMMU_MF_CANWAIT) != 0 ? DMAR_PGF_WAITOK : 0)); + if (error == ENOMEM) { + iommu_domain_unload_entry(entry, true); + return (error); + } + KASSERT(error == 0, + ("unexpected error %d from domain_map_buf", error)); + + *res = entry; + return (0); +} + +int +iommu_gas_map_region(struct iommu_domain *domain, struct iommu_map_entry *entry, + u_int eflags, u_int flags, vm_page_t *ma) +{ + iommu_gaddr_t start; + int error; + + KASSERT(entry->flags == 0, ("used RMRR entry %p %p %x", domain, + entry, entry->flags)); + KASSERT((flags & ~(IOMMU_MF_CANWAIT | IOMMU_MF_RMRR)) == 0, + ("invalid flags 0x%x", flags)); + + start = entry->start; + IOMMU_DOMAIN_LOCK(domain); + error = iommu_gas_alloc_region(domain, entry, flags); + if (error != 0) { + IOMMU_DOMAIN_UNLOCK(domain); + return (error); + } + entry->flags |= eflags; + IOMMU_DOMAIN_UNLOCK(domain); + if (entry->end == entry->start) + return (0); + + error = domain_map_buf(domain, entry->start, entry->end - entry->start, + ma + OFF_TO_IDX(start - entry->start), eflags, + ((flags & IOMMU_MF_CANWAIT) != 0 ? DMAR_PGF_WAITOK : 0)); + if (error == ENOMEM) { + iommu_domain_unload_entry(entry, false); + return (error); + } + KASSERT(error == 0, + ("unexpected error %d from domain_map_buf", error)); + + return (0); +} + +int +iommu_gas_reserve_region(struct iommu_domain *domain, iommu_gaddr_t start, + iommu_gaddr_t end) +{ + struct iommu_map_entry *entry; + int error; + + entry = iommu_gas_alloc_entry(domain, DMAR_PGF_WAITOK); + entry->start = start; + entry->end = end; + IOMMU_DOMAIN_LOCK(domain); + error = iommu_gas_alloc_region(domain, entry, IOMMU_MF_CANWAIT); + if (error == 0) + entry->flags |= IOMMU_MAP_ENTRY_UNMAPPED; + IOMMU_DOMAIN_UNLOCK(domain); + if (error != 0) + iommu_gas_free_entry(domain, entry); + return (error); +} + +struct iommu_map_entry * +iommu_map_alloc_entry(struct iommu_domain *domain, u_int flags) +{ + struct iommu_map_entry *res; + + res = iommu_gas_alloc_entry(domain, flags); + + return (res); +} + +void +iommu_map_free_entry(struct iommu_domain *domain, struct iommu_map_entry *entry) +{ + + iommu_gas_free_entry(domain, entry); +} + +int +iommu_map(struct iommu_domain *domain, + const struct bus_dma_tag_common *common, iommu_gaddr_t size, int offset, + u_int eflags, u_int flags, vm_page_t *ma, struct iommu_map_entry **res) +{ + int error; + + error = iommu_gas_map(domain, common, size, offset, eflags, flags, + ma, res); + + return (error); +} + +int +iommu_map_region(struct iommu_domain *domain, struct iommu_map_entry *entry, + u_int eflags, u_int flags, vm_page_t *ma) +{ + int error; + + error = iommu_gas_map_region(domain, entry, eflags, flags, ma); + + return (error); +} From owner-svn-src-all@freebsd.org Sat Jul 25 11:57:41 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C9BE036125B; Sat, 25 Jul 2020 11:57:41 +0000 (UTC) (envelope-from pstef@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BDPhP4TNLz47kX; Sat, 25 Jul 2020 11:57:41 +0000 (UTC) (envelope-from pstef@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 76FB51B66A; Sat, 25 Jul 2020 11:57:41 +0000 (UTC) (envelope-from pstef@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06PBvfdT095562; Sat, 25 Jul 2020 11:57:41 GMT (envelope-from pstef@FreeBSD.org) Received: (from pstef@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06PBvdBo095555; Sat, 25 Jul 2020 11:57:39 GMT (envelope-from pstef@FreeBSD.org) Message-Id: <202007251157.06PBvdBo095555@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pstef set sender to pstef@FreeBSD.org using -f From: Piotr Pawel Stefaniak Date: Sat, 25 Jul 2020 11:57:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r363525 - in stable/12: bin/csh bin/sh share/skel X-SVN-Group: stable-12 X-SVN-Commit-Author: pstef X-SVN-Commit-Paths: in stable/12: bin/csh bin/sh share/skel X-SVN-Commit-Revision: 363525 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 25 Jul 2020 11:57:41 -0000 Author: pstef Date: Sat Jul 25 11:57:39 2020 New Revision: 363525 URL: https://svnweb.freebsd.org/changeset/base/363525 Log: MFC r342576-342577,342645,342812,342881,343231,343399 (by trasz): r342577 Make sh(1) collapse $HOME into "~" in PS1 r342576 Simplify the way we set the default sh(1) PS1 r342645 Add current working directory to the default sh prompt r342812 Give sh(1) a proper default prompt instead of just "$". r342881 Make sh(1) recognize the default $HOME r343231 Don't mess with BLOCKSIZE in shell startup files r343399 Make sh(1) support \u in PS1 Modified: stable/12/bin/csh/csh.login stable/12/bin/csh/dot.cshrc stable/12/bin/sh/parser.c stable/12/bin/sh/profile stable/12/bin/sh/sh.1 stable/12/share/skel/dot.cshrc stable/12/share/skel/dot.profile stable/12/share/skel/dot.shrc Directory Properties: stable/12/ (props changed) Modified: stable/12/bin/csh/csh.login ============================================================================== --- stable/12/bin/csh/csh.login Sat Jul 25 11:34:50 2020 (r363524) +++ stable/12/bin/csh/csh.login Sat Jul 25 11:57:39 2020 (r363525) @@ -1,9 +1,6 @@ # $FreeBSD$ # # System-wide .login file for csh(1). -# Uncomment this to give you the default 4.2 behavior, where disk -# information is shown in K-Blocks -# setenv BLOCKSIZE K # # For the setting of languages and character sets please see # login.conf(5) and in particular the charset and lang options. Modified: stable/12/bin/csh/dot.cshrc ============================================================================== --- stable/12/bin/csh/dot.cshrc Sat Jul 25 11:34:50 2020 (r363524) +++ stable/12/bin/csh/dot.cshrc Sat Jul 25 11:57:39 2020 (r363525) @@ -23,7 +23,6 @@ set path = (/sbin /bin /usr/sbin /usr/bin /usr/local/s setenv EDITOR vi setenv PAGER less -setenv BLOCKSIZE K if ($?prompt) then # An interactive shell -- set some stuff up Modified: stable/12/bin/sh/parser.c ============================================================================== --- stable/12/bin/sh/parser.c Sat Jul 25 11:34:50 2020 (r363524) +++ stable/12/bin/sh/parser.c Sat Jul 25 11:57:39 2020 (r363525) @@ -40,6 +40,8 @@ static char sccsid[] = "@(#)parser.c 8.7 (Berkeley) 5/ #include __FBSDID("$FreeBSD$"); +#include +#include #include #include #include @@ -130,6 +132,7 @@ static void synexpect(int) __dead2; static void synerror(const char *) __dead2; static void setprompt(int); static int pgetc_linecont(void); +static void getusername(char *, size_t); static void * @@ -1969,6 +1972,53 @@ pgetc_linecont(void) return (c); } + +static struct passwd * +getpwlogin(void) +{ + const char *login; + + login = getlogin(); + if (login == NULL) + return (NULL); + + return (getpwnam(login)); +} + + +static void +getusername(char *name, size_t namelen) +{ + static char cached_name[MAXLOGNAME]; + struct passwd *pw; + uid_t euid; + + if (cached_name[0] == '\0') { + euid = geteuid(); + + /* + * Handle the case when there is more than one + * login with the same UID, or when the login + * returned by getlogin(2) does no longer match + * the current UID. + */ + pw = getpwlogin(); + if (pw == NULL || pw->pw_uid != euid) + pw = getpwuid(euid); + + if (pw != NULL) { + strlcpy(cached_name, pw->pw_name, + sizeof(cached_name)); + } else { + snprintf(cached_name, sizeof(cached_name), + "%u", euid); + } + } + + strlcpy(name, cached_name, namelen); +} + + /* * called by editline -- any expansions to the prompt * should be added here. @@ -1978,7 +2028,9 @@ getprompt(void *unused __unused) { static char ps[PROMPTLEN]; const char *fmt; + const char *home; const char *pwd; + size_t homelen; int i, trim; static char internal_error[] = "??"; @@ -2025,6 +2077,17 @@ getprompt(void *unused __unused) break; /* + * User name. + */ + case 'u': + ps[i] = '\0'; + getusername(&ps[i], PROMPTLEN - i); + /* Skip to end of username. */ + while (ps[i + 1] != '\0') + i++; + break; + + /* * Working directory. * * \W specifies just the final component, @@ -2039,8 +2102,24 @@ getprompt(void *unused __unused) *pwd == '/' && pwd[1] != '\0') strlcpy(&ps[i], strrchr(pwd, '/') + 1, PROMPTLEN - i); - else - strlcpy(&ps[i], pwd, PROMPTLEN - i); + else { + home = lookupvar("HOME"); + if (home != NULL) + homelen = strlen(home); + if (home != NULL && + strcmp(home, "/") != 0 && + strncmp(pwd, home, homelen) == 0 && + (pwd[homelen] == '/' || + pwd[homelen] == '\0')) { + strlcpy(&ps[i], "~", + PROMPTLEN - i); + strlcpy(&ps[i + 1], + pwd + homelen, + PROMPTLEN - i - 1); + } else { + strlcpy(&ps[i], pwd, PROMPTLEN - i); + } + } /* Skip to end of path. */ while (ps[i + 1] != '\0') i++; Modified: stable/12/bin/sh/profile ============================================================================== --- stable/12/bin/sh/profile Sat Jul 25 11:34:50 2020 (r363524) +++ stable/12/bin/sh/profile Sat Jul 25 11:57:39 2020 (r363525) @@ -2,10 +2,6 @@ # # System-wide .profile file for sh(1). # -# Uncomment this to give you the default 4.2 behavior, where disk -# information is shown in K-Blocks -# BLOCKSIZE=K; export BLOCKSIZE -# # For the setting of languages and character sets please see # login.conf(5) and in particular the charset and lang options. # For full locales list check /usr/share/locale/* Modified: stable/12/bin/sh/sh.1 ============================================================================== --- stable/12/bin/sh/sh.1 Sat Jul 25 11:34:50 2020 (r363524) +++ stable/12/bin/sh/sh.1 Sat Jul 25 11:57:39 2020 (r363525) @@ -1417,6 +1417,8 @@ which are replaced by the given information: This system's fully-qualified hostname (FQDN). .It Li \eh This system's hostname. +.It Li \eu +User name. .It Li \eW The final component of the current working directory. .It Li \ew Modified: stable/12/share/skel/dot.cshrc ============================================================================== --- stable/12/share/skel/dot.cshrc Sat Jul 25 11:34:50 2020 (r363524) +++ stable/12/share/skel/dot.cshrc Sat Jul 25 11:57:39 2020 (r363525) @@ -15,7 +15,6 @@ alias ll ls -lAF # These are normally set through /etc/login.conf. You may override them here # if wanted. # set path = (/sbin /bin /usr/sbin /usr/bin /usr/local/sbin /usr/local/bin $HOME/bin) -# setenv BLOCKSIZE K # A righteous umask # umask 22 Modified: stable/12/share/skel/dot.profile ============================================================================== --- stable/12/share/skel/dot.profile Sat Jul 25 11:34:50 2020 (r363524) +++ stable/12/share/skel/dot.profile Sat Jul 25 11:57:39 2020 (r363525) @@ -8,7 +8,6 @@ # These are normally set through /etc/login.conf. You may override them here # if wanted. # PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin:$HOME/bin; export PATH -# BLOCKSIZE=K; export BLOCKSIZE # Setting TERM is normally done through /etc/ttys. Do only override # if you're sure that you'll never log in via telnet or xterm or a @@ -20,6 +19,9 @@ PAGER=less; export PAGER # set ENV to a file invoked each time sh is started for interactive use. ENV=$HOME/.shrc; export ENV + +# Let sh(1) know it's at home, despite /home being a symlink. +if [ "$PWD" != "$HOME" ] && [ "$PWD" -ef "$HOME" ] ; then cd ; fi # Query terminal size; useful for serial lines. if [ -x /usr/bin/resizewin ] ; then /usr/bin/resizewin -z ; fi Modified: stable/12/share/skel/dot.shrc ============================================================================== --- stable/12/share/skel/dot.shrc Sat Jul 25 11:34:50 2020 (r363524) +++ stable/12/share/skel/dot.shrc Sat Jul 25 11:57:39 2020 (r363525) @@ -32,12 +32,8 @@ alias g='egrep -i' # alias rm='rm -i' -# # set prompt: ``username@hostname$ '' -# PS1="`whoami`@`hostname | sed 's/\..*//'`" -# case `id -u` in -# 0) PS1="${PS1}# ";; -# *) PS1="${PS1}$ ";; -# esac +# set prompt: ``username@hostname:directory $ '' +PS1="\u@\h:\w \\$ " # search path for cd(1) # CDPATH=:$HOME From owner-svn-src-all@freebsd.org Sat Jul 25 14:27:12 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id F0DF4365C7F; Sat, 25 Jul 2020 14:27:12 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BDT0w62tjz4HdD; Sat, 25 Jul 2020 14:27:12 +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 B2A9E1D41C; Sat, 25 Jul 2020 14:27:12 +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 06PERCBp092317; Sat, 25 Jul 2020 14:27:12 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06PERCfJ092311; Sat, 25 Jul 2020 14:27:12 GMT (envelope-from cy@FreeBSD.org) Message-Id: <202007251427.06PERCfJ092311@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Sat, 25 Jul 2020 14:27: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: r363526 - in stable: 11/contrib/ipfilter/man 11/contrib/ipfilter/tools 12/contrib/ipfilter/man 12/contrib/ipfilter/tools X-SVN-Group: stable-11 X-SVN-Commit-Author: cy X-SVN-Commit-Paths: in stable: 11/contrib/ipfilter/man 11/contrib/ipfilter/tools 12/contrib/ipfilter/man 12/contrib/ipfilter/tools X-SVN-Commit-Revision: 363526 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 25 Jul 2020 14:27:13 -0000 Author: cy Date: Sat Jul 25 14:27:12 2020 New Revision: 363526 URL: https://svnweb.freebsd.org/changeset/base/363526 Log: MFC r363277-r363283 r363277: Only use the use_inet6 variable when INET6 is a build option. This is a prerequisite to upcoming argument processing cleanups which will resolve consistency as was done with ippool previously. PR: 247952 r363278: fr_family (the protocol family) must be AF_INET or AF_INET6, as in the kernel, not an arbitrary 4 or 6. This only affected printing ipfilter stats and rules from a kernel dump. (This is currently undocumented.) PR: 247952 r363279: Historically ipfstat listings and stats only listed IPv4 or IPv6 output. ipfstat would list IPv4 outputs by default while -6 would produce IPv6 outputs. This commit combines the ipfstat -i and -o outputs into one listing of IPv4 and IPv6 rules. The -4 option lists only IPv4 rules (as the default before) while -6 continues to list only rules that affect IPv6. PR: 247952 Reported by: joeb1@a1poweruser.com r363280: ipfstat -t defaults to IPv4 output. Make consistent with ipfstat -i and ipfstat -o where without an argument IPv4 and IPv6 states are shown. Use -4 and -6 to limit the display to IPv4 or IPv6 respectively. PR: 247952 r363281: Make ipfstat -t header generic when IPv4 and IPv6 output are displayed in the same display. PR: 247952 r363282: The output from usage() need not contain usage for -t when STATETOP is not compiled in. PR: 247952 Modified: stable/11/contrib/ipfilter/man/ipfstat.8 stable/11/contrib/ipfilter/tools/ipfstat.c Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/12/contrib/ipfilter/man/ipfstat.8 stable/12/contrib/ipfilter/tools/ipfstat.c Directory Properties: stable/12/ (props changed) Modified: stable/11/contrib/ipfilter/man/ipfstat.8 ============================================================================== --- stable/11/contrib/ipfilter/man/ipfstat.8 Sat Jul 25 11:57:39 2020 (r363525) +++ stable/11/contrib/ipfilter/man/ipfstat.8 Sat Jul 25 14:27:12 2020 (r363526) @@ -5,7 +5,7 @@ ipfstat \- reports on packet filter statistics and fil .SH SYNOPSIS .B ipfstat [ -.B \-6aAdfghIilnoRsv +.B \-46aAdfghIilnoRsv ] .br .B ipfstat -t @@ -35,6 +35,11 @@ is to retrieve and display the accumulated statistics accumulated over time as the kernel has put packets through the filter. .SH OPTIONS .TP +.B \-4 +Display filter lists and states for IPv4, if available. This is the default +when displaying states. \fB-4\fP and \fB-6\fP is the default when +displaying lists. +.TP .B \-6 Display filter lists and states for IPv6, if available. .TP @@ -190,4 +195,5 @@ more entries is to resize the screen. .SH SEE ALSO ipf(8) .SH BUGS -none known. +\fB-4\fP and \fB-6\fP are only valid with \fB-i\fP, \fB-o\fP, and \fB-t\fP. +An error should result when used with other arguments. Modified: stable/11/contrib/ipfilter/tools/ipfstat.c ============================================================================== --- stable/11/contrib/ipfilter/tools/ipfstat.c Sat Jul 25 11:57:39 2020 (r363525) +++ stable/11/contrib/ipfilter/tools/ipfstat.c Sat Jul 25 14:27:12 2020 (r363526) @@ -57,7 +57,10 @@ static wordtab_t *state_fields = NULL; int nohdrfields = 0; int opts = 0; +#ifdef USE_INET6 +int use_inet4 = 0; int use_inet6 = 0; +#endif int live_kernel = 1; int state_fd = -1; int ipf_fd = -1; @@ -163,16 +166,18 @@ static void usage(name) char *name; { #ifdef USE_INET6 - fprintf(stderr, "Usage: %s [-6aAdfghIilnoRsv]\n", name); + fprintf(stderr, "Usage: %s [-46aAdfghIilnoRsv]\n", name); #else - fprintf(stderr, "Usage: %s [-aAdfghIilnoRsv]\n", name); + fprintf(stderr, "Usage: %s [-4aAdfghIilnoRsv]\n", name); #endif fprintf(stderr, " %s [-M corefile] [-N symbol-list]\n", name); +#ifdef STATETOP #ifdef USE_INET6 - fprintf(stderr, " %s -t [-6C] ", name); + fprintf(stderr, " %s -t [-46C] ", name); #else - fprintf(stderr, " %s -t [-C] ", name); + fprintf(stderr, " %s -t [-4C] ", name); #endif +#endif fprintf(stderr, "[-D destination address] [-P protocol] [-S source address] [-T refresh time]\n"); exit(1); } @@ -206,9 +211,9 @@ int main(argc,argv) u_32_t frf; #ifdef USE_INET6 - options = "6aACdfghIilnostvD:m:M:N:O:P:RS:T:"; + options = "46aACdfghIilnostvD:m:M:N:O:P:RS:T:"; #else - options = "aACdfghIilnostvD:m:M:N:O:P:RS:T:"; + options = "4aACdfghIilnostvD:m:M:N:O:P:RS:T:"; #endif saddr.in4.s_addr = INADDR_ANY; /* default any v4 source addr */ @@ -283,6 +288,9 @@ int main(argc,argv) switch (c) { #ifdef USE_INET6 + case '4' : + use_inet4 = 1; + break; case '6' : use_inet6 = 1; break; @@ -385,6 +393,19 @@ int main(argc,argv) break; } } +#ifdef USE_INET6 + if ((use_inet4 || use_inet6) && + !(opts & (OPT_INQUE | OPT_OUTQUE | OPT_STATETOP))) { +#ifdef STATETOP + FPRINTF(stderr, "No -i, -o, or -t given with -4 or -6\n"); +#else + FPRINTF(stderr, "No -i or -o given with -4 or -6\n"); +#endif + exit(-2); + } + if (use_inet4 == 0 && use_inet6 == 0) + use_inet4 = use_inet6 = 1; +#endif if (live_kernel == 1) { bzero((char *)&fio, sizeof(fio)); @@ -410,8 +431,13 @@ int main(argc,argv) #ifdef STATETOP else if (opts & OPT_STATETOP) topipstates(saddr, daddr, sport, dport, protocol, - use_inet6 ? 6 : 4, refreshtime, topclosed, filter); +#ifdef USE_INET6 + use_inet6 && use_inet4 ? 0 : use_inet6 && !use_inet4 ? 6 : 4, +#else + 4, #endif +#endif + refreshtime, topclosed, filter); else if (opts & OPT_AUTHSTATS) showauthstates(frauthstp); else if (opts & OPT_GROUPS) @@ -805,15 +831,21 @@ printlivelist(fiop, out, set, fp, group, comment) if (rule.iri_rule == NULL) break; #ifdef USE_INET6 - if (use_inet6 != 0) { + if (use_inet6 != 0 && use_inet4 == 0) { if (fp->fr_family != 0 && fp->fr_family != AF_INET6) continue; - } else + } else if (use_inet4 != 0 && use_inet6 == 0) { #endif - { if (fp->fr_family != 0 && fp->fr_family != AF_INET) continue; +#ifdef USE_INET6 + } else { + if (fp->fr_family != 0 && + fp->fr_family != AF_INET && fp->fr_family != AF_INET6) + continue; } +#endif + if (fp->fr_data != NULL) fp->fr_data = (char *)fp + fp->fr_size; @@ -904,13 +936,21 @@ static void printdeadlist(fiop, out, set, fp, group, c return; } fp = &fb; - if (use_inet6 != 0) { - if (fp->fr_family != 0 && fp->fr_family != 6) +#ifdef USE_INET6 + if (use_inet6 != 0 && use_inet4 == 0) { + if (fp->fr_family != 0 && fp->fr_family != AF_INET6) continue; + } else if (use_inet4 != 0 && use_inet6 == 0) { +#endif + if (fp->fr_family != 0 && fp->fr_family != AF_INET) + continue; +#ifdef USE_INET6 } else { - if (fp->fr_family != 0 && fp->fr_family != 4) + if (fp->fr_family != 0 && + fp->fr_family != AF_INET && fp->fr_family != AF_INET6) continue; } +#endif data = NULL; type = fb.fr_type & ~FR_T_BUILTIN; @@ -1338,7 +1378,7 @@ static void topipstates(saddr, daddr, sport, dport, pr if (ipsstp->iss_list == NULL) break; - if (ips.is_v != ver) + if (ver != 0 && ips.is_v != ver) continue; if ((filter != NULL) && @@ -1906,7 +1946,7 @@ static void parse_ipportstr(argument, ip, port) ok = 1; #ifdef USE_INET6 ip->in6 = in6addr_any; - } else if (use_inet6 && inet_pton(AF_INET6, s, &ip->in6)) { + } else if (use_inet6 && !use_inet4 && inet_pton(AF_INET6, s, &ip->in6)) { ok = 1; #endif } else if (inet_aton(s, &ip->in4)) @@ -1944,6 +1984,9 @@ static char *getip(v, addr) static char hostbuf[MAXHOSTNAMELEN+1]; #endif + if (v == 0) + return ("any"); + if (v == 4) return inet_ntoa(addr->in4); @@ -2047,7 +2090,7 @@ static int sort_srcip(a, b) register const statetop_t *bp = b; #ifdef USE_INET6 - if (use_inet6) { + if (use_inet6 && !use_inet4) { if (IP6_EQ(&ap->st_src, &bp->st_src)) return 0; else if (IP6_GT(&ap->st_src, &bp->st_src)) @@ -2087,7 +2130,7 @@ static int sort_dstip(a, b) register const statetop_t *bp = b; #ifdef USE_INET6 - if (use_inet6) { + if (use_inet6 && !use_inet4) { if (IP6_EQ(&ap->st_dst, &bp->st_dst)) return 0; else if (IP6_GT(&ap->st_dst, &bp->st_dst)) From owner-svn-src-all@freebsd.org Sat Jul 25 14:27:13 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 82A96366303; Sat, 25 Jul 2020 14:27:13 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BDT0x2xRPz4HmQ; Sat, 25 Jul 2020 14:27:13 +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 483891D223; Sat, 25 Jul 2020 14:27:13 +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 06PERDfp092324; Sat, 25 Jul 2020 14:27:13 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06PERC23092322; Sat, 25 Jul 2020 14:27:12 GMT (envelope-from cy@FreeBSD.org) Message-Id: <202007251427.06PERC23092322@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Sat, 25 Jul 2020 14:27:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r363526 - in stable: 11/contrib/ipfilter/man 11/contrib/ipfilter/tools 12/contrib/ipfilter/man 12/contrib/ipfilter/tools X-SVN-Group: stable-12 X-SVN-Commit-Author: cy X-SVN-Commit-Paths: in stable: 11/contrib/ipfilter/man 11/contrib/ipfilter/tools 12/contrib/ipfilter/man 12/contrib/ipfilter/tools X-SVN-Commit-Revision: 363526 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 25 Jul 2020 14:27:13 -0000 Author: cy Date: Sat Jul 25 14:27:12 2020 New Revision: 363526 URL: https://svnweb.freebsd.org/changeset/base/363526 Log: MFC r363277-r363283 r363277: Only use the use_inet6 variable when INET6 is a build option. This is a prerequisite to upcoming argument processing cleanups which will resolve consistency as was done with ippool previously. PR: 247952 r363278: fr_family (the protocol family) must be AF_INET or AF_INET6, as in the kernel, not an arbitrary 4 or 6. This only affected printing ipfilter stats and rules from a kernel dump. (This is currently undocumented.) PR: 247952 r363279: Historically ipfstat listings and stats only listed IPv4 or IPv6 output. ipfstat would list IPv4 outputs by default while -6 would produce IPv6 outputs. This commit combines the ipfstat -i and -o outputs into one listing of IPv4 and IPv6 rules. The -4 option lists only IPv4 rules (as the default before) while -6 continues to list only rules that affect IPv6. PR: 247952 Reported by: joeb1@a1poweruser.com r363280: ipfstat -t defaults to IPv4 output. Make consistent with ipfstat -i and ipfstat -o where without an argument IPv4 and IPv6 states are shown. Use -4 and -6 to limit the display to IPv4 or IPv6 respectively. PR: 247952 r363281: Make ipfstat -t header generic when IPv4 and IPv6 output are displayed in the same display. PR: 247952 r363282: The output from usage() need not contain usage for -t when STATETOP is not compiled in. PR: 247952 Modified: stable/12/contrib/ipfilter/man/ipfstat.8 stable/12/contrib/ipfilter/tools/ipfstat.c Directory Properties: stable/12/ (props changed) Changes in other areas also in this revision: Modified: stable/11/contrib/ipfilter/man/ipfstat.8 stable/11/contrib/ipfilter/tools/ipfstat.c Directory Properties: stable/11/ (props changed) Modified: stable/12/contrib/ipfilter/man/ipfstat.8 ============================================================================== --- stable/12/contrib/ipfilter/man/ipfstat.8 Sat Jul 25 11:57:39 2020 (r363525) +++ stable/12/contrib/ipfilter/man/ipfstat.8 Sat Jul 25 14:27:12 2020 (r363526) @@ -5,7 +5,7 @@ ipfstat \- reports on packet filter statistics and fil .SH SYNOPSIS .B ipfstat [ -.B \-6aAdfghIilnoRsv +.B \-46aAdfghIilnoRsv ] .br .B ipfstat -t @@ -35,6 +35,11 @@ is to retrieve and display the accumulated statistics accumulated over time as the kernel has put packets through the filter. .SH OPTIONS .TP +.B \-4 +Display filter lists and states for IPv4, if available. This is the default +when displaying states. \fB-4\fP and \fB-6\fP is the default when +displaying lists. +.TP .B \-6 Display filter lists and states for IPv6, if available. .TP @@ -190,4 +195,5 @@ more entries is to resize the screen. .SH SEE ALSO ipf(8) .SH BUGS -none known. +\fB-4\fP and \fB-6\fP are only valid with \fB-i\fP, \fB-o\fP, and \fB-t\fP. +An error should result when used with other arguments. Modified: stable/12/contrib/ipfilter/tools/ipfstat.c ============================================================================== --- stable/12/contrib/ipfilter/tools/ipfstat.c Sat Jul 25 11:57:39 2020 (r363525) +++ stable/12/contrib/ipfilter/tools/ipfstat.c Sat Jul 25 14:27:12 2020 (r363526) @@ -57,7 +57,10 @@ static wordtab_t *state_fields = NULL; int nohdrfields = 0; int opts = 0; +#ifdef USE_INET6 +int use_inet4 = 0; int use_inet6 = 0; +#endif int live_kernel = 1; int state_fd = -1; int ipf_fd = -1; @@ -163,16 +166,18 @@ static void usage(name) char *name; { #ifdef USE_INET6 - fprintf(stderr, "Usage: %s [-6aAdfghIilnoRsv]\n", name); + fprintf(stderr, "Usage: %s [-46aAdfghIilnoRsv]\n", name); #else - fprintf(stderr, "Usage: %s [-aAdfghIilnoRsv]\n", name); + fprintf(stderr, "Usage: %s [-4aAdfghIilnoRsv]\n", name); #endif fprintf(stderr, " %s [-M corefile] [-N symbol-list]\n", name); +#ifdef STATETOP #ifdef USE_INET6 - fprintf(stderr, " %s -t [-6C] ", name); + fprintf(stderr, " %s -t [-46C] ", name); #else - fprintf(stderr, " %s -t [-C] ", name); + fprintf(stderr, " %s -t [-4C] ", name); #endif +#endif fprintf(stderr, "[-D destination address] [-P protocol] [-S source address] [-T refresh time]\n"); exit(1); } @@ -206,9 +211,9 @@ int main(argc,argv) u_32_t frf; #ifdef USE_INET6 - options = "6aACdfghIilnostvD:m:M:N:O:P:RS:T:"; + options = "46aACdfghIilnostvD:m:M:N:O:P:RS:T:"; #else - options = "aACdfghIilnostvD:m:M:N:O:P:RS:T:"; + options = "4aACdfghIilnostvD:m:M:N:O:P:RS:T:"; #endif saddr.in4.s_addr = INADDR_ANY; /* default any v4 source addr */ @@ -283,6 +288,9 @@ int main(argc,argv) switch (c) { #ifdef USE_INET6 + case '4' : + use_inet4 = 1; + break; case '6' : use_inet6 = 1; break; @@ -385,6 +393,19 @@ int main(argc,argv) break; } } +#ifdef USE_INET6 + if ((use_inet4 || use_inet6) && + !(opts & (OPT_INQUE | OPT_OUTQUE | OPT_STATETOP))) { +#ifdef STATETOP + FPRINTF(stderr, "No -i, -o, or -t given with -4 or -6\n"); +#else + FPRINTF(stderr, "No -i or -o given with -4 or -6\n"); +#endif + exit(-2); + } + if (use_inet4 == 0 && use_inet6 == 0) + use_inet4 = use_inet6 = 1; +#endif if (live_kernel == 1) { bzero((char *)&fio, sizeof(fio)); @@ -410,8 +431,13 @@ int main(argc,argv) #ifdef STATETOP else if (opts & OPT_STATETOP) topipstates(saddr, daddr, sport, dport, protocol, - use_inet6 ? 6 : 4, refreshtime, topclosed, filter); +#ifdef USE_INET6 + use_inet6 && use_inet4 ? 0 : use_inet6 && !use_inet4 ? 6 : 4, +#else + 4, #endif +#endif + refreshtime, topclosed, filter); else if (opts & OPT_AUTHSTATS) showauthstates(frauthstp); else if (opts & OPT_GROUPS) @@ -805,15 +831,21 @@ printlivelist(fiop, out, set, fp, group, comment) if (rule.iri_rule == NULL) break; #ifdef USE_INET6 - if (use_inet6 != 0) { + if (use_inet6 != 0 && use_inet4 == 0) { if (fp->fr_family != 0 && fp->fr_family != AF_INET6) continue; - } else + } else if (use_inet4 != 0 && use_inet6 == 0) { #endif - { if (fp->fr_family != 0 && fp->fr_family != AF_INET) continue; +#ifdef USE_INET6 + } else { + if (fp->fr_family != 0 && + fp->fr_family != AF_INET && fp->fr_family != AF_INET6) + continue; } +#endif + if (fp->fr_data != NULL) fp->fr_data = (char *)fp + fp->fr_size; @@ -904,13 +936,21 @@ static void printdeadlist(fiop, out, set, fp, group, c return; } fp = &fb; - if (use_inet6 != 0) { - if (fp->fr_family != 0 && fp->fr_family != 6) +#ifdef USE_INET6 + if (use_inet6 != 0 && use_inet4 == 0) { + if (fp->fr_family != 0 && fp->fr_family != AF_INET6) continue; + } else if (use_inet4 != 0 && use_inet6 == 0) { +#endif + if (fp->fr_family != 0 && fp->fr_family != AF_INET) + continue; +#ifdef USE_INET6 } else { - if (fp->fr_family != 0 && fp->fr_family != 4) + if (fp->fr_family != 0 && + fp->fr_family != AF_INET && fp->fr_family != AF_INET6) continue; } +#endif data = NULL; type = fb.fr_type & ~FR_T_BUILTIN; @@ -1338,7 +1378,7 @@ static void topipstates(saddr, daddr, sport, dport, pr if (ipsstp->iss_list == NULL) break; - if (ips.is_v != ver) + if (ver != 0 && ips.is_v != ver) continue; if ((filter != NULL) && @@ -1906,7 +1946,7 @@ static void parse_ipportstr(argument, ip, port) ok = 1; #ifdef USE_INET6 ip->in6 = in6addr_any; - } else if (use_inet6 && inet_pton(AF_INET6, s, &ip->in6)) { + } else if (use_inet6 && !use_inet4 && inet_pton(AF_INET6, s, &ip->in6)) { ok = 1; #endif } else if (inet_aton(s, &ip->in4)) @@ -1944,6 +1984,9 @@ static char *getip(v, addr) static char hostbuf[MAXHOSTNAMELEN+1]; #endif + if (v == 0) + return ("any"); + if (v == 4) return inet_ntoa(addr->in4); @@ -2047,7 +2090,7 @@ static int sort_srcip(a, b) register const statetop_t *bp = b; #ifdef USE_INET6 - if (use_inet6) { + if (use_inet6 && !use_inet4) { if (IP6_EQ(&ap->st_src, &bp->st_src)) return 0; else if (IP6_GT(&ap->st_src, &bp->st_src)) @@ -2087,7 +2130,7 @@ static int sort_dstip(a, b) register const statetop_t *bp = b; #ifdef USE_INET6 - if (use_inet6) { + if (use_inet6 && !use_inet4) { if (IP6_EQ(&ap->st_dst, &bp->st_dst)) return 0; else if (IP6_GT(&ap->st_dst, &bp->st_dst)) From owner-svn-src-all@freebsd.org Sat Jul 25 15:19:41 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CD8D436777A; Sat, 25 Jul 2020 15:19:41 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BDV9T5629z4LZh; Sat, 25 Jul 2020 15:19:41 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 766451DC93; Sat, 25 Jul 2020 15:19:41 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06PFJfNC024562; Sat, 25 Jul 2020 15:19:41 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06PFJciC024547; Sat, 25 Jul 2020 15:19:38 GMT (envelope-from mav@FreeBSD.org) Message-Id: <202007251519.06PFJciC024547@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sat, 25 Jul 2020 15:19:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363527 - in head: share/man/man9 sys/amd64/amd64 sys/amd64/include sys/i386/i386 sys/kern sys/sys sys/x86/include sys/x86/x86 sys/x86/xen X-SVN-Group: head X-SVN-Commit-Author: mav X-SVN-Commit-Paths: in head: share/man/man9 sys/amd64/amd64 sys/amd64/include sys/i386/i386 sys/kern sys/sys sys/x86/include sys/x86/x86 sys/x86/xen X-SVN-Commit-Revision: 363527 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 25 Jul 2020 15:19:41 -0000 Author: mav Date: Sat Jul 25 15:19:38 2020 New Revision: 363527 URL: https://svnweb.freebsd.org/changeset/base/363527 Log: Allow swi_sched() to be called from NMI context. For purposes of handling hardware error reported via NMIs I need a way to escape NMI context, being too restrictive to do something significant. To do it this change introduces new swi_sched() flag SWI_FROMNMI, making it careful about used KPIs. On platforms allowing IPI sending from NMI context (x86 for now) it immediately wakes clk_intr_event via new IPI_SWI, otherwise it works just like SWI_DELAY. To handle the delayed SWIs this patch calls clk_intr_event on every hardclock() tick. MFC after: 2 weeks Sponsored by: iXsystems, Inc. Differential Revision: https://reviews.freebsd.org/D25754 Modified: head/share/man/man9/swi.9 head/sys/amd64/amd64/apic_vector.S head/sys/amd64/amd64/mp_machdep.c head/sys/amd64/include/smp.h head/sys/i386/i386/apic_vector.s head/sys/i386/i386/mp_machdep.c head/sys/kern/kern_clock.c head/sys/kern/kern_intr.c head/sys/sys/interrupt.h head/sys/x86/include/apicvar.h head/sys/x86/include/x86_smp.h head/sys/x86/x86/mp_x86.c head/sys/x86/xen/xen_apic.c Modified: head/share/man/man9/swi.9 ============================================================================== --- head/share/man/man9/swi.9 Sat Jul 25 14:27:12 2020 (r363526) +++ head/share/man/man9/swi.9 Sat Jul 25 15:19:38 2020 (r363527) @@ -23,7 +23,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 19, 2012 +.Dd July 25, 2020 .Dt SWI 9 .Os .Sh NAME @@ -132,7 +132,7 @@ The .Fa flags argument specifies how and when the handler should be run and is a mask of one or more of the following flags: -.Bl -tag -width SWI_DELAY +.Bl -tag -width SWI_FROMNMI .It Dv SWI_DELAY Specifies that the kernel should mark the specified handler as needing to run, but the kernel should not schedule the software interrupt thread to run. @@ -146,6 +146,13 @@ functionality performed by .Fn setdelayed in earlier versions of .Fx . +.It Dv SWI_FROMNMI +Specifies that +.Fn swi_sched +is called from NMI context and should be careful about used KPIs. +On platforms allowing IPI sending from NMI context it immediately wakes +.Va clk_intr_event +via the IPI, otherwise it works just like SWI_DELAY. .El .Pp The Modified: head/sys/amd64/amd64/apic_vector.S ============================================================================== --- head/sys/amd64/amd64/apic_vector.S Sat Jul 25 14:27:12 2020 (r363526) +++ head/sys/amd64/amd64/apic_vector.S Sat Jul 25 15:19:38 2020 (r363527) @@ -206,6 +206,16 @@ IDTVEC(spuriousint) jmp doreti /* + * Executed by a CPU when it receives an IPI_SWI. + */ + INTR_HANDLER ipi_swi + call as_lapic_eoi + FAKE_MCOUNT(TF_RIP(%rsp)) + call ipi_swi_handler + MEXITCOUNT + jmp doreti + +/* * Executed by a CPU when it receives a RENDEZVOUS IPI from another CPU. * * - Calls the generic rendezvous action function. Modified: head/sys/amd64/amd64/mp_machdep.c ============================================================================== --- head/sys/amd64/amd64/mp_machdep.c Sat Jul 25 14:27:12 2020 (r363526) +++ head/sys/amd64/amd64/mp_machdep.c Sat Jul 25 15:19:38 2020 (r363527) @@ -223,6 +223,10 @@ cpu_mp_start(void) setidt(IPI_SUSPEND, pti ? IDTVEC(cpususpend_pti) : IDTVEC(cpususpend), SDT_SYSIGT, SEL_KPL, 0); + /* Install an IPI for calling delayed SWI */ + setidt(IPI_SWI, pti ? IDTVEC(ipi_swi_pti) : IDTVEC(ipi_swi), + SDT_SYSIGT, SEL_KPL, 0); + /* Set boot_cpu_id if needed. */ if (boot_cpu_id == -1) { boot_cpu_id = PCPU_GET(apic_id); Modified: head/sys/amd64/include/smp.h ============================================================================== --- head/sys/amd64/include/smp.h Sat Jul 25 14:27:12 2020 (r363526) +++ head/sys/amd64/include/smp.h Sat Jul 25 15:19:38 2020 (r363527) @@ -32,6 +32,7 @@ inthand_t IDTVEC(invlop_pti), IDTVEC(invlop), IDTVEC(ipi_intr_bitmap_handler_pti), + IDTVEC(ipi_swi_pti), IDTVEC(cpustop_pti), IDTVEC(cpususpend_pti), IDTVEC(rendezvous_pti); Modified: head/sys/i386/i386/apic_vector.s ============================================================================== --- head/sys/i386/i386/apic_vector.s Sat Jul 25 14:27:12 2020 (r363526) +++ head/sys/i386/i386/apic_vector.s Sat Jul 25 15:19:38 2020 (r363527) @@ -309,6 +309,23 @@ IDTVEC(cpususpend) jmp doreti /* + * Executed by a CPU when it receives an IPI_SWI. + */ + .text + SUPERALIGN_TEXT +IDTVEC(ipi_swi) + PUSH_FRAME + SET_KERNEL_SREGS + cld + KENTER + call as_lapic_eoi + FAKE_MCOUNT(TF_EIP(%esp)) + movl $ipi_swi_handler, %eax + call *%eax + MEXITCOUNT + jmp doreti + +/* * Executed by a CPU when it receives a RENDEZVOUS IPI from another CPU. * * - Calls the generic rendezvous action function. Modified: head/sys/i386/i386/mp_machdep.c ============================================================================== --- head/sys/i386/i386/mp_machdep.c Sat Jul 25 14:27:12 2020 (r363526) +++ head/sys/i386/i386/mp_machdep.c Sat Jul 25 15:19:38 2020 (r363527) @@ -188,6 +188,10 @@ cpu_mp_start(void) setidt(IPI_SUSPEND, IDTVEC(cpususpend), SDT_SYS386IGT, SEL_KPL, GSEL(GCODE_SEL, SEL_KPL)); + /* Install an IPI for calling delayed SWI */ + setidt(IPI_SWI, IDTVEC(ipi_swi), + SDT_SYS386IGT, SEL_KPL, GSEL(GCODE_SEL, SEL_KPL)); + /* Set boot_cpu_id if needed. */ if (boot_cpu_id == -1) { boot_cpu_id = PCPU_GET(apic_id); Modified: head/sys/kern/kern_clock.c ============================================================================== --- head/sys/kern/kern_clock.c Sat Jul 25 14:27:12 2020 (r363526) +++ head/sys/kern/kern_clock.c Sat Jul 25 15:19:38 2020 (r363527) @@ -508,6 +508,7 @@ hardclock(int cnt, int usermode) if (i > 0 && i <= newticks) watchdog_fire(); } + intr_event_handle(clk_intr_event, NULL); } if (curcpu == CPU_FIRST()) cpu_tick_calibration(); Modified: head/sys/kern/kern_intr.c ============================================================================== --- head/sys/kern/kern_intr.c Sat Jul 25 14:27:12 2020 (r363526) +++ head/sys/kern/kern_intr.c Sat Jul 25 15:19:38 2020 (r363527) @@ -60,6 +60,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #ifdef DDB #include @@ -85,6 +86,7 @@ struct intr_entropy { uintptr_t event; }; +struct intr_event *clk_intr_event; struct intr_event *tty_intr_event; void *vm_ih; struct proc *intrproc; @@ -1018,7 +1020,7 @@ swi_add(struct intr_event **eventp, const char *name, void *arg, int pri, enum intr_type flags, void **cookiep) { struct intr_event *ie; - int error; + int error = 0; if (flags & INTR_ENTROPY) return (EINVAL); @@ -1036,8 +1038,10 @@ swi_add(struct intr_event **eventp, const char *name, if (eventp != NULL) *eventp = ie; } - error = intr_event_add_handler(ie, name, NULL, handler, arg, - PI_SWI(pri), flags, cookiep); + if (handler != NULL) { + error = intr_event_add_handler(ie, name, NULL, handler, arg, + PI_SWI(pri), flags, cookiep); + } return (error); } @@ -1055,9 +1059,11 @@ swi_sched(void *cookie, int flags) CTR3(KTR_INTR, "swi_sched: %s %s need=%d", ie->ie_name, ih->ih_name, ih->ih_need); - entropy.event = (uintptr_t)ih; - entropy.td = curthread; - random_harvest_queue(&entropy, sizeof(entropy), RANDOM_SWI); + if ((flags & SWI_FROMNMI) == 0) { + entropy.event = (uintptr_t)ih; + entropy.td = curthread; + random_harvest_queue(&entropy, sizeof(entropy), RANDOM_SWI); + } /* * Set ih_need for this handler so that if the ithread is already @@ -1066,7 +1072,16 @@ swi_sched(void *cookie, int flags) */ ih->ih_need = 1; - if (!(flags & SWI_DELAY)) { + if (flags & SWI_DELAY) + return; + + if (flags & SWI_FROMNMI) { +#if defined(SMP) && (defined(__i386__) || defined(__amd64__)) + KASSERT(ie == clk_intr_event, + ("SWI_FROMNMI used not with clk_intr_event")); + ipi_self_from_nmi(IPI_SWI); +#endif + } else { VM_CNT_INC(v_soft); error = intr_event_schedule_thread(ie); KASSERT(error == 0, ("stray software interrupt")); @@ -1346,6 +1361,8 @@ intr_event_handle(struct intr_event *ie, struct trapfr CK_SLIST_FOREACH(ih, &ie->ie_handlers, ih_next) { if ((ih->ih_flags & IH_SUSP) != 0) continue; + if ((ie->ie_flags & IE_SOFT) != 0 && ih->ih_need == 0) + continue; if (ih->ih_filter == NULL) { thread = true; continue; @@ -1570,6 +1587,9 @@ static void start_softintr(void *dummy) { + if (swi_add(&clk_intr_event, "clk", NULL, NULL, SWI_CLOCK, + INTR_MPSAFE, NULL)) + panic("died while creating clk swi ithread"); if (swi_add(NULL, "vm", swi_vm, NULL, SWI_VM, INTR_MPSAFE, &vm_ih)) panic("died while creating vm swi ithread"); } Modified: head/sys/sys/interrupt.h ============================================================================== --- head/sys/sys/interrupt.h Sat Jul 25 14:27:12 2020 (r363526) +++ head/sys/sys/interrupt.h Sat Jul 25 15:19:38 2020 (r363527) @@ -133,7 +133,8 @@ struct intr_event { #define IE_SOFT 0x000001 /* Software interrupt. */ #define IE_ADDING_THREAD 0x000004 /* Currently building an ithread. */ -/* Flags to pass to sched_swi. */ +/* Flags to pass to swi_sched. */ +#define SWI_FROMNMI 0x1 #define SWI_DELAY 0x2 /* @@ -151,6 +152,7 @@ struct intr_event { struct proc; +extern struct intr_event *clk_intr_event; extern struct intr_event *tty_intr_event; extern void *vm_ih; Modified: head/sys/x86/include/apicvar.h ============================================================================== --- head/sys/x86/include/apicvar.h Sat Jul 25 14:27:12 2020 (r363526) +++ head/sys/x86/include/apicvar.h Sat Jul 25 15:19:38 2020 (r363527) @@ -130,7 +130,8 @@ #define IPI_STOP (APIC_IPI_INTS + 6) /* Stop CPU until restarted. */ #define IPI_SUSPEND (APIC_IPI_INTS + 7) /* Suspend CPU until restarted. */ -#define IPI_DYN_FIRST (APIC_IPI_INTS + 8) +#define IPI_SWI (APIC_IPI_INTS + 8) /* Run clk_intr_event. */ +#define IPI_DYN_FIRST (APIC_IPI_INTS + 9) #define IPI_DYN_LAST (254) /* IPIs allocated at runtime */ /* Modified: head/sys/x86/include/x86_smp.h ============================================================================== --- head/sys/x86/include/x86_smp.h Sat Jul 25 14:27:12 2020 (r363526) +++ head/sys/x86/include/x86_smp.h Sat Jul 25 15:19:38 2020 (r363527) @@ -76,6 +76,7 @@ extern u_long *ipi_rendezvous_counts[MAXCPU]; /* IPI handlers */ inthand_t IDTVEC(ipi_intr_bitmap_handler), /* Bitmap based IPIs */ + IDTVEC(ipi_swi), /* Runs delayed SWI */ IDTVEC(cpustop), /* CPU stops & waits to be restarted */ IDTVEC(cpususpend), /* CPU suspends & waits to be resumed */ IDTVEC(rendezvous); /* handle CPU rendezvous */ @@ -96,6 +97,7 @@ void ipi_all_but_self(u_int ipi); void ipi_bitmap_handler(struct trapframe frame); void ipi_cpu(int cpu, u_int ipi); int ipi_nmi_handler(void); +void ipi_swi_handler(struct trapframe frame); void ipi_selected(cpuset_t cpus, u_int ipi); void ipi_self_from_nmi(u_int vector); void set_interrupt_apic_ids(void); Modified: head/sys/x86/x86/mp_x86.c ============================================================================== --- head/sys/x86/x86/mp_x86.c Sat Jul 25 14:27:12 2020 (r363526) +++ head/sys/x86/x86/mp_x86.c Sat Jul 25 15:19:38 2020 (r363527) @@ -47,6 +47,7 @@ __FBSDID("$FreeBSD$"); #ifdef GPROF #include #endif +#include #include #include #include @@ -1618,6 +1619,16 @@ cpususpend_handler(void) CPU_CLR_ATOMIC(cpu, &resuming_cpus); CPU_CLR_ATOMIC(cpu, &suspended_cpus); CPU_CLR_ATOMIC(cpu, &toresume_cpus); +} + +/* + * Handle an IPI_SWI by waking delayed SWI thread. + */ +void +ipi_swi_handler(struct trapframe frame) +{ + + intr_event_handle(clk_intr_event, &frame); } /* Modified: head/sys/x86/xen/xen_apic.c ============================================================================== --- head/sys/x86/xen/xen_apic.c Sat Jul 25 14:27:12 2020 (r363526) +++ head/sys/x86/xen/xen_apic.c Sat Jul 25 15:19:38 2020 (r363527) @@ -76,6 +76,7 @@ static driver_filter_t xen_invlcache; static driver_filter_t xen_ipi_bitmap_handler; static driver_filter_t xen_cpustop_handler; static driver_filter_t xen_cpususpend_handler; +static driver_filter_t xen_ipi_swi_handler; #endif /*---------------------------------- Macros ----------------------------------*/ @@ -103,6 +104,7 @@ static struct xen_ipi_handler xen_ipis[] = [IPI_TO_IDX(IPI_BITMAP_VECTOR)] = { xen_ipi_bitmap_handler, "b" }, [IPI_TO_IDX(IPI_STOP)] = { xen_cpustop_handler, "st" }, [IPI_TO_IDX(IPI_SUSPEND)] = { xen_cpususpend_handler, "sp" }, + [IPI_TO_IDX(IPI_SWI)] = { xen_ipi_swi_handler, "sw" }, }; #endif @@ -519,6 +521,15 @@ xen_cpususpend_handler(void *arg) { cpususpend_handler(); + return (FILTER_HANDLED); +} + +static int +xen_ipi_swi_handler(void *arg) +{ + struct trapframe *frame = arg; + + ipi_swi_handler(*frame); return (FILTER_HANDLED); } From owner-svn-src-all@freebsd.org Sat Jul 25 15:34:30 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 280E6368322; Sat, 25 Jul 2020 15:34:30 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BDVVZ0GQCz4MCB; Sat, 25 Jul 2020 15:34:30 +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 E07EA1E13E; Sat, 25 Jul 2020 15:34: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 06PFYTG6037099; Sat, 25 Jul 2020 15:34:29 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06PFYTHN037098; Sat, 25 Jul 2020 15:34:29 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202007251534.06PFYTHN037098@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Sat, 25 Jul 2020 15:34:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363528 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 363528 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 25 Jul 2020 15:34:30 -0000 Author: mjg Date: Sat Jul 25 15:34:29 2020 New Revision: 363528 URL: https://svnweb.freebsd.org/changeset/base/363528 Log: fd: put back FILEDESC_SUNLOCK to pwd_hold lost during rebase Reported by: pho Modified: head/sys/kern/kern_descrip.c Modified: head/sys/kern/kern_descrip.c ============================================================================== --- head/sys/kern/kern_descrip.c Sat Jul 25 15:19:38 2020 (r363527) +++ head/sys/kern/kern_descrip.c Sat Jul 25 15:34:29 2020 (r363528) @@ -3354,6 +3354,7 @@ pwd_hold(struct thread *td) FILEDESC_SLOCK(fdp); pwd = pwd_hold_filedesc(fdp); MPASS(pwd != NULL); + FILEDESC_SUNLOCK(fdp); return (pwd); } From owner-svn-src-all@freebsd.org Sat Jul 25 18:09:05 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8D26236BAA2; Sat, 25 Jul 2020 18:09:05 +0000 (UTC) (envelope-from jmg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BDYwx3Br9z4VQ2; Sat, 25 Jul 2020 18:09:05 +0000 (UTC) (envelope-from jmg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 510E91F84A; Sat, 25 Jul 2020 18:09:05 +0000 (UTC) (envelope-from jmg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06PI95bk031652; Sat, 25 Jul 2020 18:09:05 GMT (envelope-from jmg@FreeBSD.org) Received: (from jmg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06PI95PU031651; Sat, 25 Jul 2020 18:09:05 GMT (envelope-from jmg@FreeBSD.org) Message-Id: <202007251809.06PI95PU031651@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jmg set sender to jmg@FreeBSD.org using -f From: John-Mark Gurney Date: Sat, 25 Jul 2020 18:09:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363531 - head/sys/dev/usb/net X-SVN-Group: head X-SVN-Commit-Author: jmg X-SVN-Commit-Paths: head/sys/dev/usb/net X-SVN-Commit-Revision: 363531 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 25 Jul 2020 18:09:05 -0000 Author: jmg Date: Sat Jul 25 18:09:04 2020 New Revision: 363531 URL: https://svnweb.freebsd.org/changeset/base/363531 Log: clean up whitespace... Modified: head/sys/dev/usb/net/if_ure.c head/sys/dev/usb/net/if_urereg.h Modified: head/sys/dev/usb/net/if_ure.c ============================================================================== --- head/sys/dev/usb/net/if_ure.c Sat Jul 25 17:22:45 2020 (r363530) +++ head/sys/dev/usb/net/if_ure.c Sat Jul 25 18:09:04 2020 (r363531) @@ -239,7 +239,7 @@ ure_read_1(struct ure_softc *sc, uint16_t reg, uint16_ shift = (reg & 3) << 3; reg &= ~3; - + ure_read_mem(sc, reg, index, &temp, 4); val = UGETDW(temp); val >>= shift; @@ -385,7 +385,7 @@ ure_miibus_writereg(device_t dev, int phy, int reg, in locked = mtx_owned(&sc->sc_mtx); if (!locked) URE_LOCK(sc); - + ure_ocp_reg_write(sc, URE_OCP_BASE_MII + reg * 2, val); if (!locked) @@ -751,7 +751,7 @@ ure_init(struct usb_ether *ue) ure_write_2(sc, URE_PLA_FMC, URE_MCU_TYPE_PLA, ure_read_2(sc, URE_PLA_FMC, URE_MCU_TYPE_PLA) | URE_FMC_FCR_MCU_EN); - + /* Enable transmit and receive. */ ure_write_1(sc, URE_PLA_CR, URE_MCU_TYPE_PLA, ure_read_1(sc, URE_PLA_CR, URE_MCU_TYPE_PLA) | URE_CR_RE | @@ -975,7 +975,7 @@ ure_rtl8152_init(struct ure_softc *sc) ure_read_2(sc, URE_USB_USB_CTRL, URE_MCU_TYPE_USB) | URE_RX_AGG_DISABLE); - /* Disable ALDPS. */ + /* Disable ALDPS. */ ure_ocp_reg_write(sc, URE_OCP_ALDPS_CONFIG, URE_ENPDNPS | URE_LINKENA | URE_DIS_SDSAVE); uether_pause(&sc->sc_ue, hz / 50); @@ -1005,7 +1005,7 @@ ure_rtl8153_init(struct ure_softc *sc) ure_write_mem(sc, URE_USB_TOLERANCE, URE_MCU_TYPE_USB | URE_BYTE_EN_SIX_BYTES, u1u2, sizeof(u1u2)); - for (i = 0; i < URE_TIMEOUT; i++) { + for (i = 0; i < URE_TIMEOUT; i++) { if (ure_read_2(sc, URE_PLA_BOOT_CTRL, URE_MCU_TYPE_PLA) & URE_AUTOLOAD_DONE) break; @@ -1015,7 +1015,7 @@ ure_rtl8153_init(struct ure_softc *sc) device_printf(sc->sc_ue.ue_dev, "timeout waiting for chip autoload\n"); - for (i = 0; i < URE_TIMEOUT; i++) { + for (i = 0; i < URE_TIMEOUT; i++) { val = ure_ocp_reg_read(sc, URE_OCP_PHY_STATUS) & URE_PHY_STAT_MASK; if (val == URE_PHY_STAT_LAN_ON || val == URE_PHY_STAT_PWRDN) @@ -1025,7 +1025,7 @@ ure_rtl8153_init(struct ure_softc *sc) if (i == URE_TIMEOUT) device_printf(sc->sc_ue.ue_dev, "timeout waiting for phy to stabilize\n"); - + ure_write_2(sc, URE_USB_U2P3_CTRL, URE_MCU_TYPE_USB, ure_read_2(sc, URE_USB_U2P3_CTRL, URE_MCU_TYPE_USB) & ~URE_U2P3_ENABLE); @@ -1057,7 +1057,7 @@ ure_rtl8153_init(struct ure_softc *sc) ure_write_1(sc, URE_USB_CSR_DUMMY2, URE_MCU_TYPE_USB, ure_read_1(sc, URE_USB_CSR_DUMMY2, URE_MCU_TYPE_USB) | URE_EP4_FULL_FC); - + ure_write_2(sc, URE_USB_WDT11_CTRL, URE_MCU_TYPE_USB, ure_read_2(sc, URE_USB_WDT11_CTRL, URE_MCU_TYPE_USB) & ~URE_TIMER11_EN); @@ -1065,7 +1065,7 @@ ure_rtl8153_init(struct ure_softc *sc) ure_write_2(sc, URE_PLA_LED_FEATURE, URE_MCU_TYPE_PLA, ure_read_2(sc, URE_PLA_LED_FEATURE, URE_MCU_TYPE_PLA) & ~URE_LED_MODE_MASK); - + if ((sc->sc_chip & URE_CHIP_VER_5C10) && usbd_get_speed(sc->sc_ue.ue_udev) != USB_SPEED_SUPER) val = URE_LPM_TIMER_500MS; @@ -1112,7 +1112,7 @@ ure_rtl8153_init(struct ure_softc *sc) ure_write_2(sc, URE_USB_U2P3_CTRL, URE_MCU_TYPE_USB, val); memset(u1u2, 0x00, sizeof(u1u2)); - ure_write_mem(sc, URE_USB_TOLERANCE, + ure_write_mem(sc, URE_USB_TOLERANCE, URE_MCU_TYPE_USB | URE_BYTE_EN_SIX_BYTES, u1u2, sizeof(u1u2)); /* Disable ALDPS. */ @@ -1162,7 +1162,7 @@ ure_disable_teredo(struct ure_softc *sc) { ure_write_4(sc, URE_PLA_TEREDO_CFG, URE_MCU_TYPE_PLA, - ure_read_4(sc, URE_PLA_TEREDO_CFG, URE_MCU_TYPE_PLA) & + ure_read_4(sc, URE_PLA_TEREDO_CFG, URE_MCU_TYPE_PLA) & ~(URE_TEREDO_SEL | URE_TEREDO_RS_EVENT_MASK | URE_OOB_TEREDO_EN)); ure_write_2(sc, URE_PLA_WDT6_CTRL, URE_MCU_TYPE_PLA, URE_WDT6_SET_MODE); @@ -1194,7 +1194,7 @@ ure_init_fifo(struct ure_softc *sc) } if (sc->sc_chip & URE_CHIP_VER_5C00) { ure_ocp_reg_write(sc, URE_OCP_EEE_CFG, - ure_ocp_reg_read(sc, URE_OCP_EEE_CFG) & + ure_ocp_reg_read(sc, URE_OCP_EEE_CFG) & ~URE_CTAP_SHORT_EN); } ure_ocp_reg_write(sc, URE_OCP_POWER_CFG, Modified: head/sys/dev/usb/net/if_urereg.h ============================================================================== --- head/sys/dev/usb/net/if_urereg.h Sat Jul 25 17:22:45 2020 (r363530) +++ head/sys/dev/usb/net/if_urereg.h Sat Jul 25 18:09:04 2020 (r363531) @@ -195,19 +195,19 @@ #define URE_CRWECR_CONFIG 0xc0 /* PLA_OOB_CTRL */ -#define URE_NOW_IS_OOB 0x80 -#define URE_TXFIFO_EMPTY 0x20 -#define URE_RXFIFO_EMPTY 0x10 -#define URE_LINK_LIST_READY 0x02 -#define URE_DIS_MCU_CLROOB 0x01 +#define URE_NOW_IS_OOB 0x80 +#define URE_TXFIFO_EMPTY 0x20 +#define URE_RXFIFO_EMPTY 0x10 +#define URE_LINK_LIST_READY 0x02 +#define URE_DIS_MCU_CLROOB 0x01 #define URE_FIFO_EMPTY (URE_TXFIFO_EMPTY | URE_RXFIFO_EMPTY) /* PLA_MISC_1 */ -#define URE_RXDY_GATED_EN 0x0008 +#define URE_RXDY_GATED_EN 0x0008 /* PLA_SFF_STS_7 */ -#define URE_RE_INIT_LL 0x8000 -#define URE_MCU_BORW_EN 0x4000 +#define URE_RE_INIT_LL 0x8000 +#define URE_MCU_BORW_EN 0x4000 /* PLA_CPCR */ #define URE_CPCR_RX_VLAN 0x0040 @@ -344,14 +344,14 @@ #define URE_SEL_RXIDLE 0x0100 /* OCP_ALDPS_CONFIG */ -#define URE_ENPWRSAVE 0x8000 -#define URE_ENPDNPS 0x0200 -#define URE_LINKENA 0x0100 +#define URE_ENPWRSAVE 0x8000 +#define URE_ENPDNPS 0x0200 +#define URE_LINKENA 0x0100 #define URE_DIS_SDSAVE 0x0010 /* OCP_PHY_STATUS */ #define URE_PHY_STAT_MASK 0x0007 -#define URE_PHY_STAT_LAN_ON 3 +#define URE_PHY_STAT_LAN_ON 3 #define URE_PHY_STAT_PWRDN 5 /* OCP_POWER_CFG */ From owner-svn-src-all@freebsd.org Sat Jul 25 18:29:11 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id EBB8E36C05F; Sat, 25 Jul 2020 18:29:11 +0000 (UTC) (envelope-from dougm@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BDZN76K6Xz4W72; Sat, 25 Jul 2020 18:29:11 +0000 (UTC) (envelope-from dougm@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9D9231FECA; Sat, 25 Jul 2020 18:29:11 +0000 (UTC) (envelope-from dougm@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06PITB02043946; Sat, 25 Jul 2020 18:29:11 GMT (envelope-from dougm@FreeBSD.org) Received: (from dougm@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06PITBKk043942; Sat, 25 Jul 2020 18:29:11 GMT (envelope-from dougm@FreeBSD.org) Message-Id: <202007251829.06PITBKk043942@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dougm set sender to dougm@FreeBSD.org using -f From: Doug Moore Date: Sat, 25 Jul 2020 18:29:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363532 - in head/sys: kern sys vm X-SVN-Group: head X-SVN-Commit-Author: dougm X-SVN-Commit-Paths: in head/sys: kern sys vm X-SVN-Commit-Revision: 363532 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 25 Jul 2020 18:29:12 -0000 Author: dougm Date: Sat Jul 25 18:29:10 2020 New Revision: 363532 URL: https://svnweb.freebsd.org/changeset/base/363532 Log: Fix an overflow bug in the blist allocator that needlessly capped max swap size by dividing a value, which was always a multiple of 64, by 64. Remove the code that reduced max swap size down to that cap. Eliminate the distinction between BLIST_BMAP_RADIX and BLIST_META_RADIX. Call them both BLIST_RADIX. Make improvments to the blist self-test code to silence compiler warnings and to test larger blists. Reported by: jmallett Reviewed by: alc Discussed with: kib Tested by: pho Differential Revision: https://reviews.freebsd.org/D25736 Modified: head/sys/kern/subr_blist.c head/sys/sys/blist.h head/sys/vm/swap_pager.c Modified: head/sys/kern/subr_blist.c ============================================================================== --- head/sys/kern/subr_blist.c Sat Jul 25 18:09:04 2020 (r363531) +++ head/sys/kern/subr_blist.c Sat Jul 25 18:29:10 2020 (r363532) @@ -36,15 +36,14 @@ * * A radix tree controls access to pieces of the bitmap, and includes * auxiliary information at each interior node about the availabilty of - * contiguous free blocks in the subtree rooted at that node. Two radix - * constants are involved: one for the size of the bitmaps contained in the - * leaf nodes (BLIST_BMAP_RADIX), and one for the number of descendents of - * each of the meta (interior) nodes (BLIST_META_RADIX). Each subtree is - * associated with a range of blocks. The root of any subtree stores a - * hint field that defines an upper bound on the size of the largest - * allocation that can begin in the associated block range. A hint is an - * upper bound on a potential allocation, but not necessarily a tight upper - * bound. + * contiguous free blocks in the subtree rooted at that node. A radix + * constant defines the size of the bitmaps contained in a leaf node + * and the number of descendents of each of the meta (interior) nodes. + * Each subtree is associated with a range of blocks. The root of any + * subtree stores a hint field that defines an upper bound on the size + * of the largest allocation that can begin in the associated block + * range. A hint is an upper bound on a potential allocation, but not + * necessarily a tight upper bound. * * The bitmap field in each node directs the search for available blocks. * For a leaf node, a bit is set if the corresponding block is free. For a @@ -64,17 +63,16 @@ * * LAYOUT: The radix tree is laid out recursively using a linear array. * Each meta node is immediately followed (laid out sequentially in - * memory) by BLIST_META_RADIX lower level nodes. This is a recursive + * memory) by BLIST_RADIX lower-level nodes. This is a recursive * structure but one that can be easily scanned through a very simple * 'skip' calculation. The memory allocation is only large enough to * cover the number of blocks requested at creation time. Nodes that * represent blocks beyond that limit, nodes that would never be read * or written, are not allocated, so that the last of the - * BLIST_META_RADIX lower level nodes of a some nodes may not be - * allocated. + * BLIST_RADIX lower-level nodes of a some nodes may not be allocated. * * NOTE: the allocator cannot currently allocate more than - * BLIST_BMAP_RADIX blocks per call. It will panic with 'allocation too + * BLIST_RADIX blocks per call. It will panic with 'allocation too * large' if you try. This is an area that could use improvement. The * radix is large enough that this restriction does not effect the swap * system, though. Currently only the allocation code is affected by @@ -152,24 +150,19 @@ static void blst_radix_print(blmeta_t *scan, daddr_t b static MALLOC_DEFINE(M_SWAP, "SWAP", "Swap space"); #endif -_Static_assert(BLIST_BMAP_RADIX % BLIST_META_RADIX == 0, - "radix divisibility error"); -#define BLIST_BMAP_MASK (BLIST_BMAP_RADIX - 1) -#define BLIST_META_MASK (BLIST_META_RADIX - 1) +#define BLIST_MASK (BLIST_RADIX - 1) /* * For a subtree that can represent the state of up to 'radix' blocks, the - * number of leaf nodes of the subtree is L=radix/BLIST_BMAP_RADIX. If 'm' - * is short for BLIST_META_RADIX, then for a tree of height h with L=m**h + * number of leaf nodes of the subtree is L=radix/BLIST_RADIX. If 'm' + * is short for BLIST_RADIX, then for a tree of height h with L=m**h * leaf nodes, the total number of tree nodes is 1 + m + m**2 + ... + m**h, * or, equivalently, (m**(h+1)-1)/(m-1). This quantity is called 'skip' * in the 'meta' functions that process subtrees. Since integer division * discards remainders, we can express this computation as * skip = (m * m**h) / (m - 1) - * skip = (m * (radix / BLIST_BMAP_RADIX)) / (m - 1) - * and since m divides BLIST_BMAP_RADIX, we can simplify further to - * skip = (radix / (BLIST_BMAP_RADIX / m)) / (m - 1) - * skip = radix / ((BLIST_BMAP_RADIX / m) * (m - 1)) + * skip = (m * (radix / m)) / (m - 1) + * skip = radix / (m - 1) * so that simple integer division by a constant can safely be used for the * calculation. */ @@ -177,8 +170,7 @@ static inline daddr_t radix_to_skip(daddr_t radix) { - return (radix / - ((BLIST_BMAP_RADIX / BLIST_META_RADIX) * BLIST_META_MASK)); + return (radix / BLIST_MASK); } /* @@ -189,7 +181,7 @@ bitrange(int n, int count) { return (((u_daddr_t)-1 << n) & - ((u_daddr_t)-1 >> (BLIST_BMAP_RADIX - (n + count)))); + ((u_daddr_t)-1 >> (BLIST_RADIX - (n + count)))); } /* @@ -201,7 +193,7 @@ generic_bitpos(u_daddr_t mask) int hi, lo, mid; lo = 0; - hi = BLIST_BMAP_RADIX; + hi = BLIST_RADIX; while (lo + 1 < hi) { mid = (lo + hi) >> 1; if (mask & bitrange(0, mid)) @@ -238,7 +230,7 @@ bitpos(u_daddr_t mask) * flags - malloc flags * * The smallest blist consists of a single leaf node capable of - * managing BLIST_BMAP_RADIX blocks. + * managing BLIST_RADIX blocks. */ blist_t blist_create(daddr_t blocks, int flags) @@ -252,11 +244,8 @@ blist_create(daddr_t blocks, int flags) * Calculate the radix and node count used for scanning. */ nodes = 1; - radix = BLIST_BMAP_RADIX; - while (radix <= blocks) { - nodes += 1 + (blocks - 1) / radix; - radix *= BLIST_META_RADIX; - } + for (radix = 1; radix <= blocks / BLIST_RADIX; radix *= BLIST_RADIX) + nodes += 1 + (blocks - 1) / radix / BLIST_RADIX; bl = malloc(offsetof(struct blist, bl_root[nodes]), M_SWAP, flags | M_ZERO); @@ -549,19 +538,12 @@ blist_stats(blist_t bl, struct sbuf *s) init_gap_stats(stats); nodes = 0; - i = bl->bl_radix; - while (i < bl->bl_radix + bl->bl_blocks) { + radix = bl->bl_radix; + for (i = 0; i < bl->bl_blocks; ) { /* - * Find max size subtree starting at i. - */ - radix = BLIST_BMAP_RADIX; - while (((i / radix) & BLIST_META_MASK) == 0) - radix *= BLIST_META_RADIX; - - /* * Check for skippable subtrees starting at i. */ - while (radix > BLIST_BMAP_RADIX) { + while (radix != 1) { if (bl->bl_root[nodes].bm_bitmap == 0) { if (gap_stats_counting(stats)) update_gap_stats(stats, i); @@ -572,9 +554,9 @@ blist_stats(blist_t bl, struct sbuf *s) * Skip subtree root. */ nodes++; - radix /= BLIST_META_RADIX; + radix /= BLIST_RADIX; } - if (radix == BLIST_BMAP_RADIX) { + if (radix == 1) { /* * Scan leaf. */ @@ -588,8 +570,16 @@ blist_stats(blist_t bl, struct sbuf *s) diff ^= bitrange(digit, 1); } } - nodes += radix_to_skip(radix); - i += radix; + nodes += radix_to_skip(radix * BLIST_RADIX); + i += radix * BLIST_RADIX; + + /* + * Find max size subtree starting at i. + */ + for (radix = 1; + ((i / BLIST_RADIX / radix) & BLIST_MASK) == 0; + radix *= BLIST_RADIX) + ; } update_gap_stats(stats, i); dump_gap_stats(stats, s); @@ -623,13 +613,13 @@ blst_next_leaf_alloc(blmeta_t *scan, daddr_t start, in daddr_t blk; int avail, digit; - start += BLIST_BMAP_RADIX; - for (blk = start; blk - start < maxcount; blk += BLIST_BMAP_RADIX) { + start += BLIST_RADIX; + for (blk = start; blk - start < maxcount; blk += BLIST_RADIX) { /* Skip meta-nodes, as long as they promise more free blocks. */ - radix = BLIST_BMAP_RADIX; + radix = BLIST_RADIX; while (((++scan)->bm_bitmap & 1) == 1 && - ((blk / radix) & BLIST_META_MASK) == 0) - radix *= BLIST_META_RADIX; + ((blk / radix) & BLIST_MASK) == 0) + radix *= BLIST_RADIX; if (~scan->bm_bitmap != 0) { /* * Either there is no next leaf with any free blocks, @@ -647,39 +637,37 @@ blst_next_leaf_alloc(blmeta_t *scan, daddr_t start, in return (avail); } maxcount = imin(avail, maxcount); - if (maxcount % BLIST_BMAP_RADIX == 0) { + if (maxcount % BLIST_RADIX == 0) { /* * There was no next leaf. Back scan up to * last leaf. */ - --scan; - while (radix != BLIST_BMAP_RADIX) { - radix /= BLIST_META_RADIX; + do { + radix /= BLIST_RADIX; --scan; - } - blk -= BLIST_BMAP_RADIX; + } while (radix != 1); + blk -= BLIST_RADIX; } } } /* * 'scan' is the last leaf that provides blocks. Clear from 1 to - * BLIST_BMAP_RADIX bits to represent the allocation of those last - * blocks. + * BLIST_RADIX bits to represent the allocation of those last blocks. */ - if (maxcount % BLIST_BMAP_RADIX != 0) - scan->bm_bitmap &= ~bitrange(0, maxcount % BLIST_BMAP_RADIX); + if (maxcount % BLIST_RADIX != 0) + scan->bm_bitmap &= ~bitrange(0, maxcount % BLIST_RADIX); else scan->bm_bitmap = 0; for (;;) { /* Back up over meta-nodes, clearing bits if necessary. */ - blk -= BLIST_BMAP_RADIX; - radix = BLIST_BMAP_RADIX; - while ((digit = ((blk / radix) & BLIST_META_MASK)) == 0) { + blk -= BLIST_RADIX; + for (radix = BLIST_RADIX; + (digit = ((blk / radix) & BLIST_MASK)) == 0; + radix *= BLIST_RADIX) { if ((scan--)->bm_bitmap == 0) scan->bm_bitmap ^= 1; - radix *= BLIST_META_RADIX; } if ((scan--)->bm_bitmap == 0) scan[-digit * radix_to_skip(radix)].bm_bitmap ^= @@ -734,17 +722,17 @@ blst_leaf_alloc(blmeta_t *scan, daddr_t blk, int *coun } /* Discard any candidates that appear before blk. */ - if ((blk & BLIST_BMAP_MASK) != 0) { - if ((~mask & bitrange(0, blk & BLIST_BMAP_MASK)) != 0) { + if ((blk & BLIST_MASK) != 0) { + if ((~mask & bitrange(0, blk & BLIST_MASK)) != 0) { /* Grow bighint in case all discarded bits are set. */ - bighint += blk & BLIST_BMAP_MASK; - mask |= bitrange(0, blk & BLIST_BMAP_MASK); + bighint += blk & BLIST_MASK; + mask |= bitrange(0, blk & BLIST_MASK); if (~mask == 0) { scan->bm_bighint = bighint; return (SWAPBLK_NONE); } } - blk -= blk & BLIST_BMAP_MASK; + blk -= blk & BLIST_MASK; } /* @@ -763,17 +751,17 @@ blst_leaf_alloc(blmeta_t *scan, daddr_t blk, int *coun hi = lo + maxcount; *count = hi - lo; mask = ~bitrange(lo, *count); - } else if (maxcount <= BLIST_BMAP_RADIX - lo) { + } else if (maxcount <= BLIST_RADIX - lo) { /* All the blocks we can use are available here. */ hi = lo + maxcount; *count = maxcount; mask = ~bitrange(lo, *count); - if (hi == BLIST_BMAP_RADIX) + if (hi == BLIST_RADIX) scan->bm_bighint = bighint; } else { /* Check next leaf for some of the blocks we want or need. */ - count1 = *count - (BLIST_BMAP_RADIX - lo); - maxcount -= BLIST_BMAP_RADIX - lo; + count1 = *count - (BLIST_RADIX - lo); + maxcount -= BLIST_RADIX - lo; hi = blst_next_leaf_alloc(scan, blk, count1, maxcount); if (hi < count1) /* @@ -785,7 +773,7 @@ blst_leaf_alloc(blmeta_t *scan, daddr_t blk, int *coun * this leaf. */ return (SWAPBLK_NONE); - *count = BLIST_BMAP_RADIX - lo + hi; + *count = BLIST_RADIX - lo + hi; scan->bm_bighint = bighint; } @@ -811,16 +799,15 @@ blst_meta_alloc(blmeta_t *scan, daddr_t cursor, int *c bool scan_from_start; int digit; - if (radix == BLIST_BMAP_RADIX) + if (radix == 1) return (blst_leaf_alloc(scan, cursor, count, maxcount)); - blk = cursor & -radix; + blk = cursor & -(radix * BLIST_RADIX); scan_from_start = (cursor == blk); - radix /= BLIST_META_RADIX; skip = radix_to_skip(radix); mask = scan->bm_bitmap; /* Discard any candidates that appear before cursor. */ - digit = (cursor / radix) & BLIST_META_MASK; + digit = (cursor / radix) & BLIST_MASK; mask &= (u_daddr_t)-1 << digit; if (mask == 0) return (SWAPBLK_NONE); @@ -846,7 +833,7 @@ blst_meta_alloc(blmeta_t *scan, daddr_t cursor, int *c * The allocation might fit beginning in the i'th subtree. */ r = blst_meta_alloc(&scan[i], cursor + digit * radix, - count, maxcount, radix); + count, maxcount, radix / BLIST_RADIX); if (r != SWAPBLK_NONE) { if (scan[i].bm_bitmap == 0) scan->bm_bitmap ^= bitrange(digit, 1); @@ -860,7 +847,7 @@ blst_meta_alloc(blmeta_t *scan, daddr_t cursor, int *c * We couldn't allocate count in this subtree. If the whole tree was * scanned, and the last tree node is allocated, update bighint. */ - if (scan_from_start && !(digit == BLIST_META_RADIX - 1 && + if (scan_from_start && !(digit == BLIST_RADIX - 1 && scan[i].bm_bighint == BLIST_MAX_ALLOC)) scan->bm_bighint = *count - 1; @@ -882,7 +869,7 @@ blst_leaf_free(blmeta_t *scan, daddr_t blk, int count) * \_________/\__/ * count n */ - mask = bitrange(blk & BLIST_BMAP_MASK, count); + mask = bitrange(blk & BLIST_MASK, count); KASSERT((scan->bm_bitmap & mask) == 0, ("freeing free block: %jx, size %d, mask %jx", (uintmax_t)blk, count, (uintmax_t)scan->bm_bitmap & mask)); @@ -913,20 +900,26 @@ blst_meta_free(blmeta_t *scan, daddr_t freeBlk, daddr_ */ scan->bm_bighint = BLIST_MAX_ALLOC; - if (radix == BLIST_BMAP_RADIX) + if (radix == 1) return (blst_leaf_free(scan, freeBlk, count)); - endBlk = ummin(freeBlk + count, (freeBlk + radix) & -radix); - radix /= BLIST_META_RADIX; + endBlk = freeBlk + count; + blk = (freeBlk + radix * BLIST_RADIX) & -(radix * BLIST_RADIX); + /* + * blk is first block past the end of the range of this meta node, + * or 0 in case of overflow. + */ + if (blk != 0) + endBlk = ummin(endBlk, blk); skip = radix_to_skip(radix); blk = freeBlk & -radix; - digit = (blk / radix) & BLIST_META_MASK; - endDigit = 1 + (((endBlk - 1) / radix) & BLIST_META_MASK); + digit = (blk / radix) & BLIST_MASK; + endDigit = 1 + (((endBlk - 1) / radix) & BLIST_MASK); scan->bm_bitmap |= bitrange(digit, endDigit - digit); for (i = 1 + digit * skip; blk < endBlk; i += skip) { blk += radix; count = ummin(blk, endBlk) - freeBlk; - blst_meta_free(&scan[i], freeBlk, count, radix); + blst_meta_free(&scan[i], freeBlk, count, radix / BLIST_RADIX); freeBlk = blk; } } @@ -947,7 +940,7 @@ blst_copy(blmeta_t *scan, daddr_t blk, daddr_t radix, * Leaf node */ - if (radix == BLIST_BMAP_RADIX) { + if (radix == 1) { u_daddr_t v = scan->bm_bitmap; if (v == (u_daddr_t)-1) { @@ -975,14 +968,14 @@ blst_copy(blmeta_t *scan, daddr_t blk, daddr_t radix, } endBlk = blk + count; - radix /= BLIST_META_RADIX; skip = radix_to_skip(radix); for (i = 1; blk < endBlk; i += skip) { blk += radix; count = radix; if (blk >= endBlk) count -= blk - endBlk; - blst_copy(&scan[i], blk - radix, radix, dest, count); + blst_copy(&scan[i], blk - radix, + radix / BLIST_RADIX, dest, count); } } @@ -999,7 +992,7 @@ blst_leaf_fill(blmeta_t *scan, daddr_t blk, int count) daddr_t nblks; u_daddr_t mask; - mask = bitrange(blk & BLIST_BMAP_MASK, count); + mask = bitrange(blk & BLIST_MASK, count); /* Count the number of blocks that we are allocating. */ nblks = bitcount64(scan->bm_bitmap & mask); @@ -1022,20 +1015,27 @@ blst_meta_fill(blmeta_t *scan, daddr_t allocBlk, daddr daddr_t blk, endBlk, i, nblks, skip; int digit; - if (radix == BLIST_BMAP_RADIX) + if (radix == 1) return (blst_leaf_fill(scan, allocBlk, count)); - endBlk = ummin(allocBlk + count, (allocBlk + radix) & -radix); - radix /= BLIST_META_RADIX; + endBlk = allocBlk + count; + blk = (allocBlk + radix * BLIST_RADIX) & -(radix * BLIST_RADIX); + /* + * blk is first block past the end of the range of this meta node, + * or 0 in case of overflow. + */ + if (blk != 0) + endBlk = ummin(endBlk, blk); skip = radix_to_skip(radix); blk = allocBlk & -radix; nblks = 0; while (blk < endBlk) { - digit = (blk / radix) & BLIST_META_MASK; + digit = (blk / radix) & BLIST_MASK; i = 1 + digit * skip; blk += radix; count = ummin(blk, endBlk) - allocBlk; - nblks += blst_meta_fill(&scan[i], allocBlk, count, radix); + nblks += blst_meta_fill(&scan[i], allocBlk, count, + radix / BLIST_RADIX); if (scan[i].bm_bitmap == 0) scan->bm_bitmap &= ~((u_daddr_t)1 << digit); allocBlk = blk; @@ -1052,12 +1052,12 @@ blst_radix_print(blmeta_t *scan, daddr_t blk, daddr_t u_daddr_t mask; int digit; - if (radix == BLIST_BMAP_RADIX) { + if (radix == 1) { printf( "%*.*s(%08llx,%lld): bitmap %0*llx big=%lld\n", tab, tab, "", - (long long)blk, (long long)radix, - 1 + (BLIST_BMAP_RADIX - 1) / 4, + (long long)blk, (long long)BLIST_RADIX, + (int)(1 + (BLIST_RADIX - 1) / 4), (long long)scan->bm_bitmap, (long long)scan->bm_bighint ); @@ -1067,14 +1067,13 @@ blst_radix_print(blmeta_t *scan, daddr_t blk, daddr_t printf( "%*.*s(%08llx): subtree (%lld/%lld) bitmap %0*llx big=%lld {\n", tab, tab, "", - (long long)blk, (long long)radix, - (long long)radix, - 1 + (BLIST_META_RADIX - 1) / 4, + (long long)blk, (long long)radix * BLIST_RADIX, + (long long)radix * BLIST_RADIX, + (int)(1 + (BLIST_RADIX - 1) / 4), (long long)scan->bm_bitmap, (long long)scan->bm_bighint ); - radix /= BLIST_META_RADIX; skip = radix_to_skip(radix); tab += 4; @@ -1083,7 +1082,7 @@ blst_radix_print(blmeta_t *scan, daddr_t blk, daddr_t do { digit = bitpos(mask); blst_radix_print(&scan[1 + digit * skip], blk + digit * radix, - radix, tab); + radix / BLIST_RADIX, tab); } while ((mask ^= bitrange(digit, 1)) != 0); tab -= 4; @@ -1100,7 +1099,7 @@ blst_radix_print(blmeta_t *scan, daddr_t blk, daddr_t int main(int ac, char **av) { - int size = BLIST_META_RADIX * BLIST_BMAP_RADIX; + daddr_t size = BLIST_RADIX * BLIST_RADIX; int i; blist_t bl; struct sbuf *s; @@ -1108,7 +1107,7 @@ main(int ac, char **av) for (i = 1; i < ac; ++i) { const char *ptr = av[i]; if (*ptr != '-') { - size = strtol(ptr, NULL, 0); + size = strtoll(ptr, NULL, 0); continue; } ptr += 2; @@ -1116,6 +1115,10 @@ main(int ac, char **av) exit(1); } bl = blist_create(size, M_WAITOK); + if (bl == NULL) { + fprintf(stderr, "blist_create failed\n"); + exit(1); + } blist_free(bl, 0, size); for (;;) { @@ -1124,7 +1127,7 @@ main(int ac, char **av) int count = 0, maxcount = 0; printf("%lld/%lld/%lld> ", (long long)blist_avail(bl), - (long long)size, (long long)bl->bl_radix); + (long long)size, (long long)bl->bl_radix * BLIST_RADIX); fflush(stdout); if (fgets(buf, sizeof(buf), stdin) == NULL) break; Modified: head/sys/sys/blist.h ============================================================================== --- head/sys/sys/blist.h Sat Jul 25 18:09:04 2020 (r363531) +++ head/sys/sys/blist.h Sat Jul 25 18:29:10 2020 (r363532) @@ -85,10 +85,9 @@ typedef struct blist { blmeta_t bl_root[1]; /* root of radix tree */ } *blist_t; -#define BLIST_BMAP_RADIX (sizeof(u_daddr_t)*8) -#define BLIST_META_RADIX BLIST_BMAP_RADIX +#define BLIST_RADIX (sizeof(u_daddr_t) * 8) -#define BLIST_MAX_ALLOC BLIST_BMAP_RADIX +#define BLIST_MAX_ALLOC BLIST_RADIX struct sbuf; Modified: head/sys/vm/swap_pager.c ============================================================================== --- head/sys/vm/swap_pager.c Sat Jul 25 18:09:04 2020 (r363531) +++ head/sys/vm/swap_pager.c Sat Jul 25 18:29:10 2020 (r363532) @@ -2369,7 +2369,6 @@ swaponsomething(struct vnode *vp, void *id, u_long nbl { struct swdevt *sp, *tsp; daddr_t dvbase; - u_long mblocks; /* * nblks is in DEV_BSIZE'd chunks, convert to PAGE_SIZE'd chunks. @@ -2380,19 +2379,8 @@ swaponsomething(struct vnode *vp, void *id, u_long nbl nblks &= ~(ctodb(1) - 1); nblks = dbtoc(nblks); - /* - * If we go beyond this, we get overflows in the radix - * tree bitmap code. - */ - mblocks = 0x40000000 / BLIST_META_RADIX; - if (nblks > mblocks) { - printf( - "WARNING: reducing swap size to maximum of %luMB per unit\n", - mblocks / 1024 / 1024 * PAGE_SIZE); - nblks = mblocks; - } - sp = malloc(sizeof *sp, M_VMPGDATA, M_WAITOK | M_ZERO); + sp->sw_blist = blist_create(nblks, M_WAITOK); sp->sw_vp = vp; sp->sw_id = id; sp->sw_dev = dev; @@ -2402,7 +2390,6 @@ swaponsomething(struct vnode *vp, void *id, u_long nbl sp->sw_close = close; sp->sw_flags = flags; - sp->sw_blist = blist_create(nblks, M_WAITOK); /* * Do not free the first blocks in order to avoid overwriting * any bsd label at the front of the partition From owner-svn-src-all@freebsd.org Sat Jul 25 19:07:14 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 689F736CBBD; Sat, 25 Jul 2020 19:07:14 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BDbD21v88z4Xs9; Sat, 25 Jul 2020 19:07:14 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1FC2020812; Sat, 25 Jul 2020 19:07:14 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06PJ7DAI068671; Sat, 25 Jul 2020 19:07:13 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06PJ7DRk068666; Sat, 25 Jul 2020 19:07:13 GMT (envelope-from br@FreeBSD.org) Message-Id: <202007251907.06PJ7DRk068666@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Sat, 25 Jul 2020 19:07:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363533 - in head/sys: dev/iommu x86/iommu X-SVN-Group: head X-SVN-Commit-Author: br X-SVN-Commit-Paths: in head/sys: dev/iommu x86/iommu X-SVN-Commit-Revision: 363533 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 25 Jul 2020 19:07:14 -0000 Author: br Date: Sat Jul 25 19:07:12 2020 New Revision: 363533 URL: https://svnweb.freebsd.org/changeset/base/363533 Log: o Move iommu gas prototypes, DMAR flags to iommu.h; o Move hw.dmar sysctl node to iommu_gas.c. Reviewed by: kib Sponsored by: DARPA/AFRL Differential Revision: https://reviews.freebsd.org/D25802 Modified: head/sys/dev/iommu/iommu.h head/sys/dev/iommu/iommu_gas.c head/sys/x86/iommu/intel_dmar.h head/sys/x86/iommu/intel_drv.c head/sys/x86/iommu/intel_utils.c Modified: head/sys/dev/iommu/iommu.h ============================================================================== --- head/sys/dev/iommu/iommu.h Sat Jul 25 18:29:10 2020 (r363532) +++ head/sys/dev/iommu/iommu.h Sat Jul 25 19:07:12 2020 (r363533) @@ -133,6 +133,24 @@ struct iommu_ctx { ephemeral reference is kept to prevent context destruction */ +#define DMAR_DOMAIN_GAS_INITED 0x0001 +#define DMAR_DOMAIN_PGTBL_INITED 0x0002 +#define DMAR_DOMAIN_IDMAP 0x0010 /* Domain uses identity + page table */ +#define DMAR_DOMAIN_RMRR 0x0020 /* Domain contains RMRR entry, + cannot be turned off */ + +/* Map flags */ +#define IOMMU_MF_CANWAIT 0x0001 +#define IOMMU_MF_CANSPLIT 0x0002 +#define IOMMU_MF_RMRR 0x0004 + +#define DMAR_PGF_WAITOK 0x0001 +#define DMAR_PGF_ZERO 0x0002 +#define DMAR_PGF_ALLOC 0x0004 +#define DMAR_PGF_NOALLOC 0x0008 +#define DMAR_PGF_OBJL 0x0010 + #define IOMMU_LOCK(unit) mtx_lock(&(unit)->lock) #define IOMMU_UNLOCK(unit) mtx_unlock(&(unit)->lock) #define IOMMU_ASSERT_LOCKED(unit) mtx_assert(&(unit)->lock, MA_OWNED) @@ -173,5 +191,23 @@ int iommu_map(struct iommu_domain *iodom, u_int eflags, u_int flags, vm_page_t *ma, struct iommu_map_entry **res); int iommu_map_region(struct iommu_domain *domain, struct iommu_map_entry *entry, u_int eflags, u_int flags, vm_page_t *ma); + +void iommu_gas_init_domain(struct iommu_domain *domain); +void iommu_gas_fini_domain(struct iommu_domain *domain); +struct iommu_map_entry *iommu_gas_alloc_entry(struct iommu_domain *domain, + u_int flags); +void iommu_gas_free_entry(struct iommu_domain *domain, + struct iommu_map_entry *entry); +void iommu_gas_free_space(struct iommu_domain *domain, + struct iommu_map_entry *entry); +int iommu_gas_map(struct iommu_domain *domain, + const struct bus_dma_tag_common *common, iommu_gaddr_t size, int offset, + u_int eflags, u_int flags, vm_page_t *ma, struct iommu_map_entry **res); +void iommu_gas_free_region(struct iommu_domain *domain, + struct iommu_map_entry *entry); +int iommu_gas_map_region(struct iommu_domain *domain, + struct iommu_map_entry *entry, u_int eflags, u_int flags, vm_page_t *ma); +int iommu_gas_reserve_region(struct iommu_domain *domain, iommu_gaddr_t start, + iommu_gaddr_t end); #endif /* !_SYS_IOMMU_H_ */ Modified: head/sys/dev/iommu/iommu_gas.c ============================================================================== --- head/sys/dev/iommu/iommu_gas.c Sat Jul 25 18:29:10 2020 (r363532) +++ head/sys/dev/iommu/iommu_gas.c Sat Jul 25 19:07:12 2020 (r363533) @@ -79,6 +79,10 @@ __FBSDID("$FreeBSD$"); static uma_zone_t iommu_map_entry_zone; +#ifdef INVARIANTS +static int iommu_check_free; +#endif + static void intel_gas_init(void) { @@ -727,3 +731,11 @@ iommu_map_region(struct iommu_domain *domain, struct i return (error); } + +#ifdef INVARIANTS +static SYSCTL_NODE(_hw, OID_AUTO, iommu, CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, + ""); +SYSCTL_INT(_hw_iommu, OID_AUTO, check_free, CTLFLAG_RWTUN, + &iommu_check_free, 0, + "Check the GPA RBtree for free_down and free_after validity"); +#endif Modified: head/sys/x86/iommu/intel_dmar.h ============================================================================== --- head/sys/x86/iommu/intel_dmar.h Sat Jul 25 18:29:10 2020 (r363532) +++ head/sys/x86/iommu/intel_dmar.h Sat Jul 25 19:07:12 2020 (r363533) @@ -81,13 +81,6 @@ struct dmar_ctx { u_int refs; /* (u) References from tags */ }; -#define DMAR_DOMAIN_GAS_INITED 0x0001 -#define DMAR_DOMAIN_PGTBL_INITED 0x0002 -#define DMAR_DOMAIN_IDMAP 0x0010 /* Domain uses identity - page table */ -#define DMAR_DOMAIN_RMRR 0x0020 /* Domain contains RMRR entry, - cannot be turned off */ - #define DMAR_DOMAIN_PGLOCK(dom) VM_OBJECT_WLOCK((dom)->pgtbl_obj) #define DMAR_DOMAIN_PGTRYLOCK(dom) VM_OBJECT_TRYWLOCK((dom)->pgtbl_obj) #define DMAR_DOMAIN_PGUNLOCK(dom) VM_OBJECT_WUNLOCK((dom)->pgtbl_obj) @@ -286,24 +279,6 @@ void dmar_domain_unload(struct dmar_domain *domain, struct iommu_map_entries_tailq *entries, bool cansleep); void dmar_domain_free_entry(struct iommu_map_entry *entry, bool free); -void iommu_gas_init_domain(struct iommu_domain *domain); -void iommu_gas_fini_domain(struct iommu_domain *domain); -struct iommu_map_entry *iommu_gas_alloc_entry(struct iommu_domain *domain, - u_int flags); -void iommu_gas_free_entry(struct iommu_domain *domain, - struct iommu_map_entry *entry); -void iommu_gas_free_space(struct iommu_domain *domain, - struct iommu_map_entry *entry); -int iommu_gas_map(struct iommu_domain *domain, - const struct bus_dma_tag_common *common, iommu_gaddr_t size, int offset, - u_int eflags, u_int flags, vm_page_t *ma, struct iommu_map_entry **res); -void iommu_gas_free_region(struct iommu_domain *domain, - struct iommu_map_entry *entry); -int iommu_gas_map_region(struct iommu_domain *domain, - struct iommu_map_entry *entry, u_int eflags, u_int flags, vm_page_t *ma); -int iommu_gas_reserve_region(struct iommu_domain *domain, iommu_gaddr_t start, - iommu_gaddr_t end); - void dmar_dev_parse_rmrr(struct dmar_domain *domain, int dev_domain, int dev_busno, const void *dev_path, int dev_path_len, struct iommu_map_entries_tailq *rmrr_entries); @@ -318,22 +293,10 @@ void dmar_fini_irt(struct dmar_unit *unit); void dmar_set_buswide_ctx(struct iommu_unit *unit, u_int busno); bool dmar_is_buswide_ctx(struct dmar_unit *unit, u_int busno); -/* Map flags */ -#define IOMMU_MF_CANWAIT 0x0001 -#define IOMMU_MF_CANSPLIT 0x0002 -#define IOMMU_MF_RMRR 0x0004 - -#define DMAR_PGF_WAITOK 0x0001 -#define DMAR_PGF_ZERO 0x0002 -#define DMAR_PGF_ALLOC 0x0004 -#define DMAR_PGF_NOALLOC 0x0008 -#define DMAR_PGF_OBJL 0x0010 - extern iommu_haddr_t dmar_high; extern int haw; extern int dmar_tbl_pagecnt; extern int dmar_batch_coalesce; -extern int iommu_check_free; static inline uint32_t dmar_read4(const struct dmar_unit *unit, int reg) Modified: head/sys/x86/iommu/intel_drv.c ============================================================================== --- head/sys/x86/iommu/intel_drv.c Sat Jul 25 18:29:10 2020 (r363532) +++ head/sys/x86/iommu/intel_drv.c Sat Jul 25 19:07:12 2020 (r363533) @@ -175,9 +175,6 @@ dmar_identify(driver_t *driver, device_t parent) TUNABLE_INT_FETCH("hw.dmar.enable", &dmar_enable); if (!dmar_enable) return; -#ifdef INVARIANTS - TUNABLE_INT_FETCH("hw.iommu.check_free", &iommu_check_free); -#endif status = AcpiGetTable(ACPI_SIG_DMAR, 1, (ACPI_TABLE_HEADER **)&dmartbl); if (ACPI_FAILURE(status)) return; Modified: head/sys/x86/iommu/intel_utils.c ============================================================================== --- head/sys/x86/iommu/intel_utils.c Sat Jul 25 18:29:10 2020 (r363532) +++ head/sys/x86/iommu/intel_utils.c Sat Jul 25 19:07:12 2020 (r363533) @@ -667,10 +667,3 @@ SYSCTL_PROC(_hw_dmar, OID_AUTO, timeout, CTLTYPE_U64 | CTLFLAG_RW | CTLFLAG_MPSAFE, 0, 0, dmar_timeout_sysctl, "QU", "Timeout for command wait, in nanoseconds"); -#ifdef INVARIANTS -int iommu_check_free; -SYSCTL_INT(_hw_dmar, OID_AUTO, check_free, CTLFLAG_RWTUN, - &iommu_check_free, 0, - "Check the GPA RBtree for free_down and free_after validity"); -#endif - From owner-svn-src-all@freebsd.org Sat Jul 25 21:37:08 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E70513715C8; Sat, 25 Jul 2020 21:37:08 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BDfY05pJpz3S0j; Sat, 25 Jul 2020 21:37:08 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9168B22506; Sat, 25 Jul 2020 21:37:08 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06PLb8lU060266; Sat, 25 Jul 2020 21:37:08 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06PLb834060262; Sat, 25 Jul 2020 21:37:08 GMT (envelope-from br@FreeBSD.org) Message-Id: <202007252137.06PLb834060262@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Sat, 25 Jul 2020 21:37:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363534 - in head/sys: dev/iommu x86/iommu X-SVN-Group: head X-SVN-Commit-Author: br X-SVN-Commit-Paths: in head/sys: dev/iommu x86/iommu X-SVN-Commit-Revision: 363534 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 25 Jul 2020 21:37:09 -0000 Author: br Date: Sat Jul 25 21:37:07 2020 New Revision: 363534 URL: https://svnweb.freebsd.org/changeset/base/363534 Log: o Make the _hw_iommu sysctl node non-static; o Move the dmar sysctl knobs to _hw_iommu_dmar. Reviewed by: kib Sponsored by: DARPA/AFRL Differential Revision: https://reviews.freebsd.org/D25807 Modified: head/sys/dev/iommu/iommu.h head/sys/dev/iommu/iommu_gas.c head/sys/x86/iommu/intel_utils.c Modified: head/sys/dev/iommu/iommu.h ============================================================================== --- head/sys/dev/iommu/iommu.h Sat Jul 25 19:07:12 2020 (r363533) +++ head/sys/dev/iommu/iommu.h Sat Jul 25 21:37:07 2020 (r363534) @@ -35,6 +35,7 @@ #define _SYS_IOMMU_H_ #include +#include #include #include #include @@ -209,5 +210,7 @@ int iommu_gas_map_region(struct iommu_domain *domain, struct iommu_map_entry *entry, u_int eflags, u_int flags, vm_page_t *ma); int iommu_gas_reserve_region(struct iommu_domain *domain, iommu_gaddr_t start, iommu_gaddr_t end); + +SYSCTL_DECL(_hw_iommu); #endif /* !_SYS_IOMMU_H_ */ Modified: head/sys/dev/iommu/iommu_gas.c ============================================================================== --- head/sys/dev/iommu/iommu_gas.c Sat Jul 25 19:07:12 2020 (r363533) +++ head/sys/dev/iommu/iommu_gas.c Sat Jul 25 21:37:07 2020 (r363534) @@ -732,9 +732,9 @@ iommu_map_region(struct iommu_domain *domain, struct i return (error); } +SYSCTL_NODE(_hw, OID_AUTO, iommu, CTLFLAG_RW | CTLFLAG_MPSAFE, NULL, ""); + #ifdef INVARIANTS -static SYSCTL_NODE(_hw, OID_AUTO, iommu, CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, - ""); SYSCTL_INT(_hw_iommu, OID_AUTO, check_free, CTLFLAG_RWTUN, &iommu_check_free, 0, "Check the GPA RBtree for free_down and free_after validity"); Modified: head/sys/x86/iommu/intel_utils.c ============================================================================== --- head/sys/x86/iommu/intel_utils.c Sat Jul 25 19:07:12 2020 (r363533) +++ head/sys/x86/iommu/intel_utils.c Sat Jul 25 21:37:07 2020 (r363534) @@ -655,15 +655,15 @@ dmar_timeout_sysctl(SYSCTL_HANDLER_ARGS) return (error); } -static SYSCTL_NODE(_hw, OID_AUTO, dmar, CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, - ""); -SYSCTL_INT(_hw_dmar, OID_AUTO, tbl_pagecnt, CTLFLAG_RD, +static SYSCTL_NODE(_hw_iommu, OID_AUTO, dmar, CTLFLAG_RD | CTLFLAG_MPSAFE, + NULL, ""); +SYSCTL_INT(_hw_iommu_dmar, OID_AUTO, tbl_pagecnt, CTLFLAG_RD, &dmar_tbl_pagecnt, 0, "Count of pages used for DMAR pagetables"); -SYSCTL_INT(_hw_dmar, OID_AUTO, batch_coalesce, CTLFLAG_RWTUN, +SYSCTL_INT(_hw_iommu_dmar, OID_AUTO, batch_coalesce, CTLFLAG_RWTUN, &dmar_batch_coalesce, 0, "Number of qi batches between interrupt"); -SYSCTL_PROC(_hw_dmar, OID_AUTO, timeout, +SYSCTL_PROC(_hw_iommu_dmar, OID_AUTO, timeout, CTLTYPE_U64 | CTLFLAG_RW | CTLFLAG_MPSAFE, 0, 0, dmar_timeout_sysctl, "QU", "Timeout for command wait, in nanoseconds"); From owner-svn-src-all@freebsd.org Sat Jul 25 23:06:48 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BA0C03734B0; Sat, 25 Jul 2020 23:06:48 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BDhXS4GMNz3X2Z; Sat, 25 Jul 2020 23:06:48 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 75C6423413; Sat, 25 Jul 2020 23:06:48 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06PN6maK015462; Sat, 25 Jul 2020 23:06:48 GMT (envelope-from truckman@FreeBSD.org) Received: (from truckman@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06PN6lRU015458; Sat, 25 Jul 2020 23:06:47 GMT (envelope-from truckman@FreeBSD.org) Message-Id: <202007252306.06PN6lRU015458@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: truckman set sender to truckman@FreeBSD.org using -f From: Don Lewis Date: Sat, 25 Jul 2020 23:06:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r363535 - in stable/12: libexec/ftpd usr.bin/localedef usr.sbin/rrenumd X-SVN-Group: stable-12 X-SVN-Commit-Author: truckman X-SVN-Commit-Paths: in stable/12: libexec/ftpd usr.bin/localedef usr.sbin/rrenumd X-SVN-Commit-Revision: 363535 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 25 Jul 2020 23:06:48 -0000 Author: truckman Date: Sat Jul 25 23:06:47 2020 New Revision: 363535 URL: https://svnweb.freebsd.org/changeset/base/363535 Log: MFC r362569 (by jkim): Fix build with recent byacc. Modified: stable/12/libexec/ftpd/ftpcmd.y stable/12/usr.bin/localedef/localedef.c stable/12/usr.bin/localedef/localedef.h stable/12/usr.sbin/rrenumd/parser.y Directory Properties: stable/12/ (props changed) Modified: stable/12/libexec/ftpd/ftpcmd.y ============================================================================== --- stable/12/libexec/ftpd/ftpcmd.y Sat Jul 25 21:37:07 2020 (r363534) +++ stable/12/libexec/ftpd/ftpcmd.y Sat Jul 25 23:06:47 2020 (r363535) @@ -74,6 +74,8 @@ __FBSDID("$FreeBSD$"); #include "extern.h" #include "pathnames.h" +#define yylex ftpcmd_yylex + off_t restart_point; static int cmd_type; Modified: stable/12/usr.bin/localedef/localedef.c ============================================================================== --- stable/12/usr.bin/localedef/localedef.c Sat Jul 25 21:37:07 2020 (r363534) +++ stable/12/usr.bin/localedef/localedef.c Sat Jul 25 23:06:47 2020 (r363535) @@ -273,7 +273,9 @@ main(int argc, char **argv) init_numeric(); init_time(); +#if YYDEBUG yydebug = 0; +#endif (void) setlocale(LC_ALL, ""); Modified: stable/12/usr.bin/localedef/localedef.h ============================================================================== --- stable/12/usr.bin/localedef/localedef.h Sat Jul 25 21:37:07 2020 (r363534) +++ stable/12/usr.bin/localedef/localedef.h Sat Jul 25 23:06:47 2020 (r363535) @@ -47,7 +47,9 @@ extern int mb_cur_max; extern int mb_cur_min; extern int last_kw; extern int verbose; +#if YYDEBUG extern int yydebug; +#endif extern int lineno; extern int undefok; /* mostly ignore undefined symbols */ extern int warnok; Modified: stable/12/usr.sbin/rrenumd/parser.y ============================================================================== --- stable/12/usr.sbin/rrenumd/parser.y Sat Jul 25 21:37:07 2020 (r363534) +++ stable/12/usr.sbin/rrenumd/parser.y Sat Jul 25 23:06:47 2020 (r363535) @@ -141,7 +141,7 @@ statement: debug_statement: DEBUG_CMD flag EOS { -#ifdef YYDEBUG +#if YYDEBUG yydebug = $2; #endif /* YYDEBUG */ } From owner-svn-src-all@freebsd.org Sat Jul 25 23:08:52 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8558E3734BA; Sat, 25 Jul 2020 23:08:52 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BDhZr31VNz3X0c; Sat, 25 Jul 2020 23:08:52 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4AD7B232C9; Sat, 25 Jul 2020 23:08:52 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06PN8qXj015615; Sat, 25 Jul 2020 23:08:52 GMT (envelope-from truckman@FreeBSD.org) Received: (from truckman@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06PN8pZK015611; Sat, 25 Jul 2020 23:08:51 GMT (envelope-from truckman@FreeBSD.org) Message-Id: <202007252308.06PN8pZK015611@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: truckman set sender to truckman@FreeBSD.org using -f From: Don Lewis Date: Sat, 25 Jul 2020 23:08:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r363536 - in stable/11: libexec/ftpd usr.bin/localedef usr.sbin/rrenumd X-SVN-Group: stable-11 X-SVN-Commit-Author: truckman X-SVN-Commit-Paths: in stable/11: libexec/ftpd usr.bin/localedef usr.sbin/rrenumd X-SVN-Commit-Revision: 363536 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 25 Jul 2020 23:08:52 -0000 Author: truckman Date: Sat Jul 25 23:08:51 2020 New Revision: 363536 URL: https://svnweb.freebsd.org/changeset/base/363536 Log: MFC r362569 (by jkim): Fix build with recent byacc. S3curity: Modified: stable/11/libexec/ftpd/ftpcmd.y stable/11/usr.bin/localedef/localedef.c stable/11/usr.bin/localedef/localedef.h stable/11/usr.sbin/rrenumd/parser.y Directory Properties: stable/11/ (props changed) Modified: stable/11/libexec/ftpd/ftpcmd.y ============================================================================== --- stable/11/libexec/ftpd/ftpcmd.y Sat Jul 25 23:06:47 2020 (r363535) +++ stable/11/libexec/ftpd/ftpcmd.y Sat Jul 25 23:08:51 2020 (r363536) @@ -72,6 +72,8 @@ __FBSDID("$FreeBSD$"); #include "extern.h" #include "pathnames.h" +#define yylex ftpcmd_yylex + off_t restart_point; static int cmd_type; Modified: stable/11/usr.bin/localedef/localedef.c ============================================================================== --- stable/11/usr.bin/localedef/localedef.c Sat Jul 25 23:06:47 2020 (r363535) +++ stable/11/usr.bin/localedef/localedef.c Sat Jul 25 23:08:51 2020 (r363536) @@ -257,7 +257,9 @@ main(int argc, char **argv) init_numeric(); init_time(); +#if YYDEBUG yydebug = 0; +#endif (void) setlocale(LC_ALL, ""); Modified: stable/11/usr.bin/localedef/localedef.h ============================================================================== --- stable/11/usr.bin/localedef/localedef.h Sat Jul 25 23:06:47 2020 (r363535) +++ stable/11/usr.bin/localedef/localedef.h Sat Jul 25 23:08:51 2020 (r363536) @@ -47,7 +47,9 @@ extern int mb_cur_max; extern int mb_cur_min; extern int last_kw; extern int verbose; +#if YYDEBUG extern int yydebug; +#endif extern int lineno; extern int undefok; /* mostly ignore undefined symbols */ extern int warnok; Modified: stable/11/usr.sbin/rrenumd/parser.y ============================================================================== --- stable/11/usr.sbin/rrenumd/parser.y Sat Jul 25 23:06:47 2020 (r363535) +++ stable/11/usr.sbin/rrenumd/parser.y Sat Jul 25 23:08:51 2020 (r363536) @@ -139,7 +139,7 @@ statement: debug_statement: DEBUG_CMD flag EOS { -#ifdef YYDEBUG +#if YYDEBUG yydebug = $2; #endif /* YYDEBUG */ }