From owner-svn-src-head@freebsd.org Sun Feb 21 13:04:00 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0E81AAAF6EC; Sun, 21 Feb 2016 13:04:00 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BA8A91C1C; Sun, 21 Feb 2016 13:03:59 +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 u1LD3wi3036584; Sun, 21 Feb 2016 13:03:58 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1LD3wG9036582; Sun, 21 Feb 2016 13:03:58 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201602211303.u1LD3wG9036582@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sun, 21 Feb 2016 13:03:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295844 - in head/cddl/contrib/opensolaris/cmd: zfs zpool X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Feb 2016 13:04:00 -0000 Author: dim Date: Sun Feb 21 13:03:58 2016 New Revision: 295844 URL: https://svnweb.freebsd.org/changeset/base/295844 Log: Fix "invalid type '(null)'" usage messages in zfs(8) and zpool(8). Currently, zfs(8) and zpool(8) print "invalid type '(null)'" or similar messages, if you pass in invalid types, sources or column names for "zfs get", "zfs list" and "zpool get". This is because the commands use getsubopt(3), and in case of failure, they print 'value', which is NULL when sub options don't match. They should print 'suboptarg' instead, which is the documented way to get at the non-matching sub option value. Reviewed by: smh MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D5365 Modified: head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c head/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c Modified: head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c ============================================================================== --- head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Sat Feb 20 22:58:33 2016 (r295843) +++ head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Sun Feb 21 13:03:58 2016 (r295844) @@ -1713,7 +1713,7 @@ zfs_do_get(int argc, char **argv) default: (void) fprintf(stderr, gettext("invalid column name " - "'%s'\n"), value); + "'%s'\n"), suboptarg); usage(B_FALSE); } } @@ -1750,7 +1750,7 @@ zfs_do_get(int argc, char **argv) default: (void) fprintf(stderr, gettext("invalid source " - "'%s'\n"), value); + "'%s'\n"), suboptarg); usage(B_FALSE); } } @@ -1786,7 +1786,7 @@ zfs_do_get(int argc, char **argv) default: (void) fprintf(stderr, gettext("invalid type '%s'\n"), - value); + suboptarg); usage(B_FALSE); } } @@ -3156,7 +3156,7 @@ zfs_do_list(int argc, char **argv) default: (void) fprintf(stderr, gettext("invalid type '%s'\n"), - value); + suboptarg); usage(B_FALSE); } } Modified: head/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c ============================================================================== --- head/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c Sat Feb 20 22:58:33 2016 (r295843) +++ head/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c Sun Feb 21 13:03:58 2016 (r295844) @@ -5431,7 +5431,7 @@ zpool_do_get(int argc, char **argv) default: (void) fprintf(stderr, gettext("invalid column name " - "'%s'\n"), value); + "'%s'\n"), suboptarg); usage(B_FALSE); } } From owner-svn-src-head@freebsd.org Sun Feb 21 14:36:51 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 67286AAF885; Sun, 21 Feb 2016 14:36:51 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 33CCF1DB9; Sun, 21 Feb 2016 14:36:51 +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 u1LEao8n063706; Sun, 21 Feb 2016 14:36:50 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1LEaokw063705; Sun, 21 Feb 2016 14:36:50 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201602211436.u1LEaokw063705@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Sun, 21 Feb 2016 14:36:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295854 - head/bin/dd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Feb 2016 14:36:51 -0000 Author: trasz Date: Sun Feb 21 14:36:50 2016 New Revision: 295854 URL: https://svnweb.freebsd.org/changeset/base/295854 Log: Make the "invalid numeric value" error message actually displayable (was a dead code before). Submitted by: bde@ (earlier version) Reviewed by: bde@ MFC after: 1 month Sponsored by: The FreeBSD Foundation Modified: head/bin/dd/args.c Modified: head/bin/dd/args.c ============================================================================== --- head/bin/dd/args.c Sun Feb 21 13:54:22 2016 (r295853) +++ head/bin/dd/args.c Sun Feb 21 14:36:50 2016 (r295854) @@ -422,11 +422,10 @@ get_num(const char *val) errno = 0; num = strtoumax(val, &expr, 0); - if (errno != 0) /* Overflow or underflow. */ - err(1, "%s", oper); - if (expr == val) /* No valid digits. */ - errx(1, "%s: illegal numeric value", oper); + errx(1, "%s: invalid numeric value", oper); + if (errno != 0) + err(1, "%s", oper); mult = postfix_to_mult(*expr); @@ -472,11 +471,10 @@ get_off_t(const char *val) errno = 0; num = strtoimax(val, &expr, 0); - if (errno != 0) /* Overflow or underflow. */ - err(1, "%s", oper); - if (expr == val) /* No valid digits. */ - errx(1, "%s: illegal numeric value", oper); + errx(1, "%s: invalid numeric value", oper); + if (errno != 0) + err(1, "%s", oper); mult = postfix_to_mult(*expr); From owner-svn-src-head@freebsd.org Sun Feb 21 14:56:07 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2CF58AB020D; Sun, 21 Feb 2016 14:56:07 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DE3931C1C; Sun, 21 Feb 2016 14:56:06 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1LEu5OM069843; Sun, 21 Feb 2016 14:56:05 GMT (envelope-from des@FreeBSD.org) Received: (from des@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1LEu57C069842; Sun, 21 Feb 2016 14:56:05 GMT (envelope-from des@FreeBSD.org) Message-Id: <201602211456.u1LEu57C069842@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: des set sender to des@FreeBSD.org using -f From: =?UTF-8?Q?Dag-Erling_Sm=c3=b8rgrav?= Date: Sun, 21 Feb 2016 14:56:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295856 - head/sys/compat/linprocfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Feb 2016 14:56:07 -0000 Author: des Date: Sun Feb 21 14:56:05 2016 New Revision: 295856 URL: https://svnweb.freebsd.org/changeset/base/295856 Log: Implement /proc/$$/limits. PR: 207386 Submitted by: Szymon Śliwa MFC after: 3 weeks Modified: head/sys/compat/linprocfs/linprocfs.c Modified: head/sys/compat/linprocfs/linprocfs.c ============================================================================== --- head/sys/compat/linprocfs/linprocfs.c Sun Feb 21 14:50:37 2016 (r295855) +++ head/sys/compat/linprocfs/linprocfs.c Sun Feb 21 14:56:05 2016 (r295856) @@ -61,6 +61,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -1366,6 +1367,67 @@ linprocfs_dofdescfs(PFS_FILL_ARGS) return (0); } +/* + * Filler function for proc/pid/limits + */ + +#define RLIM_NONE -1 + +static const struct limit_info { + const char *desc; + const char *unit; + unsigned long long rlim_id; +} limits_info[] = { + { "Max cpu time", "seconds", RLIMIT_CPU }, + { "Max file size", "bytes", RLIMIT_FSIZE }, + { "Max data size", "bytes", RLIMIT_DATA }, + { "Max stack size", "bytes", RLIMIT_STACK }, + { "Max core file size", "bytes", RLIMIT_CORE }, + { "Max resident set", "bytes", RLIMIT_RSS }, + { "Max processes", "processes", RLIMIT_NPROC }, + { "Max open files", "files", RLIMIT_NOFILE }, + { "Max locked memory", "bytes", RLIMIT_MEMLOCK }, + { "Max address space", "bytes", RLIMIT_AS }, + { "Max file locks", "locks", RLIM_INFINITY }, + { "Max pending signals", "signals", RLIM_INFINITY }, + { "Max msgqueue size", "bytes", RLIM_NONE }, + { "Max nice priority", "", RLIM_NONE }, + { "Max realtime priority", "", RLIM_NONE }, + { "Max realtime timeout", "us", RLIM_INFINITY }, + { 0, 0, 0 } +}; + +static int +linprocfs_doproclimits(PFS_FILL_ARGS) +{ + const struct limit_info *li; + struct rlimit li_rlimits; + struct plimit *cur_proc_lim; + + cur_proc_lim = lim_alloc(); + lim_copy(cur_proc_lim, p->p_limit); + sbuf_printf(sb, "%-26s%-21s%-21s%-10s\n", "Limit", "Soft Limit", + "Hard Limit", "Units"); + for (li = limits_info; li->desc != NULL; ++li) { + if (li->rlim_id != RLIM_INFINITY && li->rlim_id != RLIM_NONE) + li_rlimits = cur_proc_lim->pl_rlimit[li->rlim_id]; + else { + li_rlimits.rlim_cur = 0; + li_rlimits.rlim_max = 0; + } + if (li->rlim_id == RLIM_INFINITY || + li_rlimits.rlim_cur == RLIM_INFINITY) + sbuf_printf(sb, "%-26s%-21s%-21s%-10s\n", + li->desc, "unlimited", "unlimited", li->unit); + else + sbuf_printf(sb, "%-26s%-21ld%-21ld%-10s\n", + li->desc, (long)li_rlimits.rlim_cur, + (long)li_rlimits.rlim_max, li->unit); + } + lim_free(cur_proc_lim); + return (0); +} + /* * Filler function for proc/sys/kernel/random/uuid @@ -1504,6 +1566,8 @@ linprocfs_init(PFS_INIT_ARGS) NULL, NULL, NULL, 0); pfs_create_file(dir, "auxv", &linprocfs_doauxv, NULL, &procfs_candebug, NULL, PFS_RD|PFS_RAWRD); + pfs_create_file(dir, "limits", &linprocfs_doproclimits, + NULL, NULL, NULL, PFS_RD); /* /proc/scsi/... */ dir = pfs_create_dir(root, "scsi", NULL, NULL, NULL, 0); From owner-svn-src-head@freebsd.org Sun Feb 21 14:59:26 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 22183AB03D6; Sun, 21 Feb 2016 14:59:26 +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 mx1.freebsd.org (Postfix) with ESMTPS id E377B1E49; Sun, 21 Feb 2016 14:59:25 +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 u1LExOjS070006; Sun, 21 Feb 2016 14:59:24 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1LExO7h070005; Sun, 21 Feb 2016 14:59:24 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201602211459.u1LExO7h070005@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sun, 21 Feb 2016 14:59:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295857 - head/contrib/binutils/bfd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Feb 2016 14:59:26 -0000 Author: ian Date: Sun Feb 21 14:59:24 2016 New Revision: 295857 URL: https://svnweb.freebsd.org/changeset/base/295857 Log: Unconditionally set e_ident[OSABI]=ELFOSABI_FREEBSD in arm binary headers. When the armv6 support was imported from a project branch, this complex conditional logic and related #define'd values came along, but it's really not clear what the intent of it all was. The effect, however, was that OSABI was always set to zero, which is "UNIX System V ABI". Having the wrong value there causes pkg(8) to avoid looking inside arm elf binaries to determine shared-lib required/provides info for packaging. Modified: head/contrib/binutils/bfd/elf32-arm.c Modified: head/contrib/binutils/bfd/elf32-arm.c ============================================================================== --- head/contrib/binutils/bfd/elf32-arm.c Sun Feb 21 14:56:05 2016 (r295856) +++ head/contrib/binutils/bfd/elf32-arm.c Sun Feb 21 14:59:24 2016 (r295857) @@ -59,13 +59,6 @@ #define elf_info_to_howto 0 #define elf_info_to_howto_rel elf32_arm_info_to_howto -#define ARM_ELF_ABI_VERSION 0 -#ifdef __FreeBSD__ -#define ARM_ELF_OS_ABI_VERSION ELFOSABI_FREEBSD -#else -#define ARM_ELF_OS_ABI_VERSION ELFOSABI_ARM -#endif - static struct elf_backend_data elf32_arm_vxworks_bed; /* Note: code such as elf32_arm_reloc_type_lookup expect to use e.g. @@ -9377,11 +9370,8 @@ elf32_arm_post_process_headers (bfd * ab i_ehdrp = elf_elfheader (abfd); - if (EF_ARM_EABI_VERSION (i_ehdrp->e_flags) == EF_ARM_EABI_UNKNOWN) - i_ehdrp->e_ident[EI_OSABI] = ARM_ELF_OS_ABI_VERSION; - else - i_ehdrp->e_ident[EI_OSABI] = 0; - i_ehdrp->e_ident[EI_ABIVERSION] = ARM_ELF_ABI_VERSION; + i_ehdrp->e_ident[EI_OSABI] = ELFOSABI_FREEBSD; + i_ehdrp->e_ident[EI_ABIVERSION] = 0; if (link_info) { From owner-svn-src-head@freebsd.org Sun Feb 21 16:45:24 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 24E8BAAF571; Sun, 21 Feb 2016 16:45:24 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EBC93120C; Sun, 21 Feb 2016 16:45:23 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1LGjNtL003451; Sun, 21 Feb 2016 16:45:23 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1LGjNZE003450; Sun, 21 Feb 2016 16:45:23 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201602211645.u1LGjNZE003450@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Sun, 21 Feb 2016 16:45:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295861 - head/sys/dev/pms/freebsd/driver/ini/src X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Feb 2016 16:45:24 -0000 Author: pfg Date: Sun Feb 21 16:45:22 2016 New Revision: 295861 URL: https://svnweb.freebsd.org/changeset/base/295861 Log: ostiInitiatorIOCompleted(): wrong sizeof() argument. Detected by: PVS Static Analysis CID: 1331601, 1331523 Modified: head/sys/dev/pms/freebsd/driver/ini/src/osapi.c Modified: head/sys/dev/pms/freebsd/driver/ini/src/osapi.c ============================================================================== --- head/sys/dev/pms/freebsd/driver/ini/src/osapi.c Sun Feb 21 16:27:55 2016 (r295860) +++ head/sys/dev/pms/freebsd/driver/ini/src/osapi.c Sun Feb 21 16:45:22 2016 (r295861) @@ -313,7 +313,7 @@ ostiInitiatorIOCompleted(tiRoot_t * } sense_len = MIN( pSenseData->senseLen, pccb->senseLen - csio->sense_resid ); - bzero(&csio->sense_data, sizeof(&csio->sense_data)); + bzero(&csio->sense_data, sizeof(csio->sense_data)); AGTIAPI_PRINTK("ostiInitiatorIOCompleted: check condition copying\n"); memcpy( (void *)pccb->pSenseData, pSenseData->senseData, From owner-svn-src-head@freebsd.org Sun Feb 21 16:47:27 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 089CFAAF6F0; Sun, 21 Feb 2016 16:47:27 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: from mail-wm0-x22f.google.com (mail-wm0-x22f.google.com [IPv6:2a00:1450:400c:c09::22f]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 94A6A1509; Sun, 21 Feb 2016 16:47:26 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: by mail-wm0-x22f.google.com with SMTP id a4so132652423wme.1; Sun, 21 Feb 2016 08:47:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:content-transfer-encoding :in-reply-to:user-agent; bh=EkA8UInL4aAJfTqbiescXULKMKboXFxWFP4V+OJej+k=; b=vpJlc14N4HlSimDJFcp3xCuQYCRGQy93ca9dxIebdr499txUqbzqOony0mQe7pGr/C JkLFj+ePRTROwi36XPSJy2KIrkqe4aaw9ZaxGhWnY1bb7NFx6ze8g6Zjpia/1hLI8hQr N8YxC6ioW0fFsqrz3J6WkhH/U/LzUz4lIEWq+6AK5B1IqtjUZ1kjGmen01UfERO+N2l1 WZApw8P54DbOfwJni1LVPl6XBa2tPxugb+iHC45GaLZskgFdkLREU6LOInXUyXPxCHu5 2Gu5kR0R19Z/rFPFCrwXX7yYXj2gqHG6XJXnnTdTcmIYQb/x+Qx9KboRiH2B9QllOwTj o3tg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-type:content-disposition :content-transfer-encoding:in-reply-to:user-agent; bh=EkA8UInL4aAJfTqbiescXULKMKboXFxWFP4V+OJej+k=; b=LpHW4H3ahvqPhXR7Sftm5rHLNSiMaIGZ1eWDrObiyH4dZWpEWZGcz84A1yW4aw8fNR mFZmfKW64dKL8UUILlaFW/WWUuU7sE4decxESZuV4cf7M6oKb7ZBOJR6QFcMBREcxbRF Bu0hgTwIMeA+C4Xqzzg+lGEh2ynlgACvSxOfulVxtv0obQNcCl9RjzNAB0eu48fU0eqP URyJx9CGkTfLW84IeSVwAdcCjxR4Nr4Az37IQai5kwgQBemtPO6U9uxFChCoxhak7JRj VD8744+Kft949Lg6v8SiZLSlTB9gZfQ8XjrKbuhQ5RcMcpgNYEqIXj34vue5yhDHEyr0 thCg== X-Gm-Message-State: AG10YOTnHXyqamKyMlafD7EO5OJ9sMGOGKPuq/md2jONPXWdvrHIhz1vIVgC2E2pmxh5YA== X-Received: by 10.194.190.6 with SMTP id gm6mr24148662wjc.115.1456073245152; Sun, 21 Feb 2016 08:47:25 -0800 (PST) Received: from dft-labs.eu (n1x0n-1-pt.tunnel.tserv5.lon1.ipv6.he.net. [2001:470:1f08:1f7::2]) by smtp.gmail.com with ESMTPSA id i5sm20689876wja.23.2016.02.21.08.47.23 (version=TLS1_2 cipher=AES128-SHA bits=128/128); Sun, 21 Feb 2016 08:47:24 -0800 (PST) Date: Sun, 21 Feb 2016 17:47:22 +0100 From: Mateusz Guzik To: Dag-Erling =?utf-8?B?U23DuHJncmF2?= Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, Szymon =?utf-8?B?xZpsaXdh?= Subject: Re: svn commit: r295856 - head/sys/compat/linprocfs Message-ID: <20160221164722.GB4399@dft-labs.eu> References: <201602211456.u1LEu57C069842@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <201602211456.u1LEu57C069842@repo.freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Feb 2016 16:47:27 -0000 On Sun, Feb 21, 2016 at 02:56:05PM +0000, Dag-Erling Smørgrav wrote: First of all I received this patch over a month ago and then I forgot a about it, for which I have to apologize. Now back to business. > Author: des > Date: Sun Feb 21 14:56:05 2016 > New Revision: 295856 > URL: https://svnweb.freebsd.org/changeset/base/295856 > > Log: > Implement /proc/$$/limits. > > PR: 207386 > Submitted by: Szymon Śliwa > MFC after: 3 weeks > > Modified: > head/sys/compat/linprocfs/linprocfs.c > > Modified: head/sys/compat/linprocfs/linprocfs.c > ============================================================================== > --- head/sys/compat/linprocfs/linprocfs.c Sun Feb 21 14:50:37 2016 (r295855) > +++ head/sys/compat/linprocfs/linprocfs.c Sun Feb 21 14:56:05 2016 (r295856) > @@ -61,6 +61,7 @@ __FBSDID("$FreeBSD$"); > #include > #include > #include > +#include > #include > #include > #include > @@ -1366,6 +1367,67 @@ linprocfs_dofdescfs(PFS_FILL_ARGS) > return (0); > } > > +/* > + * Filler function for proc/pid/limits > + */ > + > +#define RLIM_NONE -1 > + > +static const struct limit_info { > + const char *desc; > + const char *unit; > + unsigned long long rlim_id; > +} limits_info[] = { > + { "Max cpu time", "seconds", RLIMIT_CPU }, > + { "Max file size", "bytes", RLIMIT_FSIZE }, > + { "Max data size", "bytes", RLIMIT_DATA }, > + { "Max stack size", "bytes", RLIMIT_STACK }, > + { "Max core file size", "bytes", RLIMIT_CORE }, > + { "Max resident set", "bytes", RLIMIT_RSS }, > + { "Max processes", "processes", RLIMIT_NPROC }, > + { "Max open files", "files", RLIMIT_NOFILE }, > + { "Max locked memory", "bytes", RLIMIT_MEMLOCK }, > + { "Max address space", "bytes", RLIMIT_AS }, > + { "Max file locks", "locks", RLIM_INFINITY }, > + { "Max pending signals", "signals", RLIM_INFINITY }, > + { "Max msgqueue size", "bytes", RLIM_NONE }, > + { "Max nice priority", "", RLIM_NONE }, > + { "Max realtime priority", "", RLIM_NONE }, > + { "Max realtime timeout", "us", RLIM_INFINITY }, > + { 0, 0, 0 } > +}; > + > +static int > +linprocfs_doproclimits(PFS_FILL_ARGS) > +{ > + const struct limit_info *li; > + struct rlimit li_rlimits; > + struct plimit *cur_proc_lim; > + 'cur' is a bad part for a name here. For instance 'curthread' refers to the thread executing the code. Now 'cur' strongly implies this is a pointer to limits from the current thread. This also is not the standard name used for pointers to plimit. > + cur_proc_lim = lim_alloc(); I presume this function is called with the process unlocked. If it was locked, bound sleep property of the mtx would conflict with unbodung sleep possibly induced by lim_alloc. But there is no reason to allocate anything. > + lim_copy(cur_proc_lim, p->p_limit); If the process is unlocked, this has to be wrong. The target process may be in the process of changing its limits leading to this code reading a pointer to a buffer which is freed before lim_copy accesses it. The limit structure is maintained with a reference counter. Thus the correct thing to do is to lock the process, grab the reference, unlock the process, do what you need to do with the structure and finally unref it. Interestingly the correct thing to do is implemented here: http://fxr.watson.org/fxr/source/fs/procfs/procfs_rlimit.c#L112 I have not verified correctness of the rest of the patch. > + sbuf_printf(sb, "%-26s%-21s%-21s%-10s\n", "Limit", "Soft Limit", > + "Hard Limit", "Units"); > + for (li = limits_info; li->desc != NULL; ++li) { > + if (li->rlim_id != RLIM_INFINITY && li->rlim_id != RLIM_NONE) > + li_rlimits = cur_proc_lim->pl_rlimit[li->rlim_id]; > + else { > + li_rlimits.rlim_cur = 0; > + li_rlimits.rlim_max = 0; > + } > + if (li->rlim_id == RLIM_INFINITY || > + li_rlimits.rlim_cur == RLIM_INFINITY) > + sbuf_printf(sb, "%-26s%-21s%-21s%-10s\n", > + li->desc, "unlimited", "unlimited", li->unit); > + else > + sbuf_printf(sb, "%-26s%-21ld%-21ld%-10s\n", > + li->desc, (long)li_rlimits.rlim_cur, > + (long)li_rlimits.rlim_max, li->unit); > + } > + lim_free(cur_proc_lim); > + return (0); > +} > + > > /* > * Filler function for proc/sys/kernel/random/uuid > @@ -1504,6 +1566,8 @@ linprocfs_init(PFS_INIT_ARGS) > NULL, NULL, NULL, 0); > pfs_create_file(dir, "auxv", &linprocfs_doauxv, > NULL, &procfs_candebug, NULL, PFS_RD|PFS_RAWRD); > + pfs_create_file(dir, "limits", &linprocfs_doproclimits, > + NULL, NULL, NULL, PFS_RD); > > /* /proc/scsi/... */ > dir = pfs_create_dir(root, "scsi", NULL, NULL, NULL, 0); -- Mateusz Guzik From owner-svn-src-head@freebsd.org Sun Feb 21 16:48:38 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E5D4DAAF7B8; Sun, 21 Feb 2016 16:48:38 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B784E1836; Sun, 21 Feb 2016 16:48:38 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1LGmbDh003673; Sun, 21 Feb 2016 16:48:37 GMT (envelope-from jilles@FreeBSD.org) Received: (from jilles@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1LGmbFJ003672; Sun, 21 Feb 2016 16:48:37 GMT (envelope-from jilles@FreeBSD.org) Message-Id: <201602211648.u1LGmbFJ003672@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jilles set sender to jilles@FreeBSD.org using -f From: Jilles Tjoelker Date: Sun, 21 Feb 2016 16:48:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295862 - head/bin/sh X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Feb 2016 16:48:39 -0000 Author: jilles Date: Sun Feb 21 16:48:37 2016 New Revision: 295862 URL: https://svnweb.freebsd.org/changeset/base/295862 Log: sh: Remove unnecessary flushouts while reading script. Output is flushed when a builtin is done or immediately after writing it (error messages, set -v output, prompts). Modified: head/bin/sh/input.c Modified: head/bin/sh/input.c ============================================================================== --- head/bin/sh/input.c Sun Feb 21 16:45:22 2016 (r295861) +++ head/bin/sh/input.c Sun Feb 21 16:48:37 2016 (r295862) @@ -212,8 +212,6 @@ preadbuffer(void) } if (parsenleft == EOF_NLEFT || parsefile->buf == NULL) return PEOF; - flushout(&output); - flushout(&errout); again: if (parselleft <= 0) { From owner-svn-src-head@freebsd.org Sun Feb 21 18:17:10 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7A1ACAAFB6B; Sun, 21 Feb 2016 18:17:10 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4A8AF1EBE; Sun, 21 Feb 2016 18:17:10 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1LIH943029668; Sun, 21 Feb 2016 18:17:09 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1LIH9h4029667; Sun, 21 Feb 2016 18:17:09 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201602211817.u1LIH9h4029667@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sun, 21 Feb 2016 18:17:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295863 - head/sys/i386/i386 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Feb 2016 18:17:10 -0000 Author: ian Date: Sun Feb 21 18:17:09 2016 New Revision: 295863 URL: https://svnweb.freebsd.org/changeset/base/295863 Log: Minor style cleanups. Submitted by: bde Modified: head/sys/i386/i386/machdep.c Modified: head/sys/i386/i386/machdep.c ============================================================================== --- head/sys/i386/i386/machdep.c Sun Feb 21 16:48:37 2016 (r295862) +++ head/sys/i386/i386/machdep.c Sun Feb 21 18:17:09 2016 (r295863) @@ -2463,8 +2463,8 @@ init386(first) metadata_missing = 1; } - if (bootinfo.bi_envp) - init_static_kenv((caddr_t)bootinfo.bi_envp + KERNBASE, 0); + if (bootinfo.bi_envp != 0) + init_static_kenv((char *)bootinfo.bi_envp + KERNBASE, 0); else init_static_kenv(NULL, 0); From owner-svn-src-head@freebsd.org Sun Feb 21 18:35:02 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B0EC1AB0293; Sun, 21 Feb 2016 18:35:02 +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 mx1.freebsd.org (Postfix) with ESMTPS id 7DF55178E; Sun, 21 Feb 2016 18:35:02 +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 u1LIZ16n035392; Sun, 21 Feb 2016 18:35:01 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1LIZ1Hu035391; Sun, 21 Feb 2016 18:35:01 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201602211835.u1LIZ1Hu035391@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sun, 21 Feb 2016 18:35:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295864 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Feb 2016 18:35:02 -0000 Author: ian Date: Sun Feb 21 18:35:01 2016 New Revision: 295864 URL: https://svnweb.freebsd.org/changeset/base/295864 Log: Allow a dynamic env to override a compiled-in static env by passing in the override indication in the env data. Submitted by: bde Modified: head/sys/kern/kern_environment.c Modified: head/sys/kern/kern_environment.c ============================================================================== --- head/sys/kern/kern_environment.c Sun Feb 21 18:17:09 2016 (r295863) +++ head/sys/kern/kern_environment.c Sun Feb 21 18:35:01 2016 (r295864) @@ -217,6 +217,9 @@ done: * environment obtained from a boot loader, or to provide an empty buffer into * which MD code can store an initial environment using kern_setenv() calls. * + * When a copy of an initial environment is passed in, we start by scanning that + * env for overrides to the compiled-in envmode and hintmode variables. + * * If the global envmode is 1, the environment is initialized from the global * static_env[], regardless of the arguments passed. This implements the env * keyword described in config(5). In this case env_pos is set to env_len, @@ -238,6 +241,14 @@ done: void init_static_kenv(char *buf, size_t len) { + char *cp; + + for (cp = buf; cp != NULL && cp[0] != '\0'; cp += strlen(cp) + 1) { + if (strcmp(cp, "static_env.disabled=1") == 0) + envmode = 0; + if (strcmp(cp, "static_hints.disabled=1") == 0) + hintmode = 0; + } if (envmode == 1) { kern_envp = static_env; From owner-svn-src-head@freebsd.org Sun Feb 21 18:51:50 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 447A2AB09B9; Sun, 21 Feb 2016 18:51:50 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1B32B1097; Sun, 21 Feb 2016 18:51:50 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1LIpnb7041324; Sun, 21 Feb 2016 18:51:49 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1LIpnnF041323; Sun, 21 Feb 2016 18:51:49 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201602211851.u1LIpnnF041323@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Sun, 21 Feb 2016 18:51:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295865 - head/sys/dev/rtwn X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Feb 2016 18:51:50 -0000 Author: avos Date: Sun Feb 21 18:51:48 2016 New Revision: 295865 URL: https://svnweb.freebsd.org/changeset/base/295865 Log: rtwn: import r290048. - Fix scanning from AUTH state. Tested by: Simone Mario Lombardo PR: 203105 Reviewed by: kevlo Approved by: adrian (mentor) Differential Revision: https://reviews.freebsd.org/D4820 Modified: head/sys/dev/rtwn/if_rtwn.c Modified: head/sys/dev/rtwn/if_rtwn.c ============================================================================== --- head/sys/dev/rtwn/if_rtwn.c Sun Feb 21 18:35:01 2016 (r295864) +++ head/sys/dev/rtwn/if_rtwn.c Sun Feb 21 18:51:48 2016 (r295865) @@ -168,6 +168,8 @@ static void rtwn_get_txpower(struct rtwn uint16_t[]); static void rtwn_set_txpower(struct rtwn_softc *, struct ieee80211_channel *, struct ieee80211_channel *); +static void rtwn_set_rx_bssid_all(struct rtwn_softc *, int); +static void rtwn_set_gain(struct rtwn_softc *, uint8_t); static void rtwn_scan_start(struct ieee80211com *); static void rtwn_scan_end(struct ieee80211com *); static void rtwn_set_channel(struct ieee80211com *); @@ -1237,22 +1239,6 @@ rtwn_newstate(struct ieee80211vap *vap, rtwn_set_led(sc, RTWN_LED_LINK, 0); break; case IEEE80211_S_SCAN: - if (vap->iv_state != IEEE80211_S_SCAN) { - /* Allow Rx from any BSSID. */ - rtwn_write_4(sc, R92C_RCR, - rtwn_read_4(sc, R92C_RCR) & - ~(R92C_RCR_CBSSID_DATA | R92C_RCR_CBSSID_BCN)); - - /* Set gain for scanning. */ - reg = rtwn_bb_read(sc, R92C_OFDM0_AGCCORE1(0)); - reg = RW(reg, R92C_OFDM0_AGCCORE1_GAIN, 0x20); - rtwn_bb_write(sc, R92C_OFDM0_AGCCORE1(0), reg); - - reg = rtwn_bb_read(sc, R92C_OFDM0_AGCCORE1(1)); - reg = RW(reg, R92C_OFDM0_AGCCORE1_GAIN, 0x20); - rtwn_bb_write(sc, R92C_OFDM0_AGCCORE1(1), reg); - } - /* Make link LED blink during scan. */ rtwn_set_led(sc, RTWN_LED_LINK, !sc->ledlink); @@ -1261,14 +1247,6 @@ rtwn_newstate(struct ieee80211vap *vap, rtwn_read_1(sc, R92C_TXPAUSE) | 0x0f); break; case IEEE80211_S_AUTH: - /* Set initial gain under link. */ - reg = rtwn_bb_read(sc, R92C_OFDM0_AGCCORE1(0)); - reg = RW(reg, R92C_OFDM0_AGCCORE1_GAIN, 0x32); - rtwn_bb_write(sc, R92C_OFDM0_AGCCORE1(0), reg); - - reg = rtwn_bb_read(sc, R92C_OFDM0_AGCCORE1(1)); - reg = RW(reg, R92C_OFDM0_AGCCORE1_GAIN, 0x32); - rtwn_bb_write(sc, R92C_OFDM0_AGCCORE1(1), reg); rtwn_set_chan(sc, ic->ic_curchan, NULL); break; case IEEE80211_S_RUN: @@ -2684,17 +2662,56 @@ rtwn_set_txpower(struct rtwn_softc *sc, } static void +rtwn_set_rx_bssid_all(struct rtwn_softc *sc, int enable) +{ + uint32_t reg; + + reg = rtwn_read_4(sc, R92C_RCR); + if (enable) + reg &= ~R92C_RCR_CBSSID_BCN; + else + reg |= R92C_RCR_CBSSID_BCN; + rtwn_write_4(sc, R92C_RCR, reg); +} + +static void +rtwn_set_gain(struct rtwn_softc *sc, uint8_t gain) +{ + uint32_t reg; + + reg = rtwn_bb_read(sc, R92C_OFDM0_AGCCORE1(0)); + reg = RW(reg, R92C_OFDM0_AGCCORE1_GAIN, gain); + rtwn_bb_write(sc, R92C_OFDM0_AGCCORE1(0), reg); + + reg = rtwn_bb_read(sc, R92C_OFDM0_AGCCORE1(1)); + reg = RW(reg, R92C_OFDM0_AGCCORE1_GAIN, gain); + rtwn_bb_write(sc, R92C_OFDM0_AGCCORE1(1), reg); +} + +static void rtwn_scan_start(struct ieee80211com *ic) { + struct rtwn_softc *sc = ic->ic_softc; - /* XXX do nothing? */ + RTWN_LOCK(sc); + /* Receive beacons / probe responses from any BSSID. */ + rtwn_set_rx_bssid_all(sc, 1); + /* Set gain for scanning. */ + rtwn_set_gain(sc, 0x20); + RTWN_UNLOCK(sc); } static void rtwn_scan_end(struct ieee80211com *ic) { + struct rtwn_softc *sc = ic->ic_softc; - /* XXX do nothing? */ + RTWN_LOCK(sc); + /* Restore limitations. */ + rtwn_set_rx_bssid_all(sc, 0); + /* Set gain under link. */ + rtwn_set_gain(sc, 0x32); + RTWN_UNLOCK(sc); } static void From owner-svn-src-head@freebsd.org Sun Feb 21 18:54:19 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 01D6FAB0AF9; Sun, 21 Feb 2016 18:54:19 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C618514A1; Sun, 21 Feb 2016 18:54:18 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1LIsHAa041705; Sun, 21 Feb 2016 18:54:17 GMT (envelope-from jilles@FreeBSD.org) Received: (from jilles@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1LIsHKm041704; Sun, 21 Feb 2016 18:54:17 GMT (envelope-from jilles@FreeBSD.org) Message-Id: <201602211854.u1LIsHKm041704@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jilles set sender to jilles@FreeBSD.org using -f From: Jilles Tjoelker Date: Sun, 21 Feb 2016 18:54:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295866 - head/bin/sh X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Feb 2016 18:54:19 -0000 Author: jilles Date: Sun Feb 21 18:54:17 2016 New Revision: 295866 URL: https://svnweb.freebsd.org/changeset/base/295866 Log: sh: Optimize setprompt(0). Avoid doing work to print an empty prompt (such as when reading scripts). Modified: head/bin/sh/parser.c Modified: head/bin/sh/parser.c ============================================================================== --- head/bin/sh/parser.c Sun Feb 21 18:51:48 2016 (r295865) +++ head/bin/sh/parser.c Sun Feb 21 18:54:17 2016 (r295866) @@ -1930,6 +1930,8 @@ static void setprompt(int which) { whichprompt = which; + if (which == 0) + return; #ifndef NO_HISTORY if (!el) From owner-svn-src-head@freebsd.org Sun Feb 21 18:58:07 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 169EFAB0C9C; Sun, 21 Feb 2016 18:58:07 +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 mx1.freebsd.org (Postfix) with ESMTPS id DC2AB178A; Sun, 21 Feb 2016 18:58:06 +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 u1LIw5f8041875; Sun, 21 Feb 2016 18:58:05 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1LIw5ST041874; Sun, 21 Feb 2016 18:58:05 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201602211858.u1LIw5ST041874@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sun, 21 Feb 2016 18:58:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295867 - head/usr.sbin/config X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Feb 2016 18:58:07 -0000 Author: ian Date: Sun Feb 21 18:58:05 2016 New Revision: 295867 URL: https://svnweb.freebsd.org/changeset/base/295867 Log: Document the ability to override compiled-in env and hints using variables in the bootloader-provided env. Modified: head/usr.sbin/config/config.5 Modified: head/usr.sbin/config/config.5 ============================================================================== --- head/usr.sbin/config/config.5 Sun Feb 21 18:54:17 2016 (r295866) +++ head/usr.sbin/config/config.5 Sun Feb 21 18:58:05 2016 (r295867) @@ -23,7 +23,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 3, 2005 +.Dd February 21, 2016 .Dt CONFIG 5 .Os .Sh NAME @@ -118,7 +118,8 @@ The kernel normally uses an environment by .Xr loader 8 . This directive makes the kernel ignore the boot environment and use -the compiled-in environment instead. +the compiled-in environment instead, unless the boot environment contains +.Va static_env.disabled=1 . .Pp This directive is useful for setting kernel tunables in embedded environments that do not start from @@ -141,7 +142,9 @@ time (see .Xr device.hints 5 ) . This directive configures the kernel to use the static device configuration listed in -.Ar filename . +.Ar filename , +unless the boot environment contains +.Va static_hints.disabled=1 . The file .Ar filename must conform to the syntax specified by From owner-svn-src-head@freebsd.org Sun Feb 21 20:58:25 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B00E9AAF697; Sun, 21 Feb 2016 20:58:25 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7DC123E2; Sun, 21 Feb 2016 20:58:25 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1LKwOpf076242; Sun, 21 Feb 2016 20:58:24 GMT (envelope-from jilles@FreeBSD.org) Received: (from jilles@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1LKwO69076241; Sun, 21 Feb 2016 20:58:24 GMT (envelope-from jilles@FreeBSD.org) Message-Id: <201602212058.u1LKwO69076241@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jilles set sender to jilles@FreeBSD.org using -f From: Jilles Tjoelker Date: Sun, 21 Feb 2016 20:58:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295868 - head/bin/sh X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Feb 2016 20:58:25 -0000 Author: jilles Date: Sun Feb 21 20:58:24 2016 New Revision: 295868 URL: https://svnweb.freebsd.org/changeset/base/295868 Log: sh: Don't hash alias name when there are no aliases. Modified: head/bin/sh/alias.c Modified: head/bin/sh/alias.c ============================================================================== --- head/bin/sh/alias.c Sun Feb 21 18:58:05 2016 (r295867) +++ head/bin/sh/alias.c Sun Feb 21 20:58:24 2016 (r295868) @@ -144,9 +144,11 @@ rmaliases(void) struct alias * lookupalias(const char *name, int check) { - struct alias *ap = *hashalias(name); + struct alias *ap; - for (; ap; ap = ap->next) { + if (aliases == 0) + return (NULL); + for (ap = *hashalias(name); ap; ap = ap->next) { if (equal(name, ap->name)) { if (check && (ap->flag & ALIASINUSE)) return (NULL); From owner-svn-src-head@freebsd.org Sun Feb 21 21:20:24 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8DAF4AAFEDA; Sun, 21 Feb 2016 21:20:24 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5EE4CE36; Sun, 21 Feb 2016 21:20:24 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1LLKN02082429; Sun, 21 Feb 2016 21:20:23 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1LLKNs7082427; Sun, 21 Feb 2016 21:20:23 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201602212120.u1LLKNs7082427@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Sun, 21 Feb 2016 21:20:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295869 - in head/sys/boot/efi: include libefi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Feb 2016 21:20:24 -0000 Author: andrew Date: Sun Feb 21 21:20:23 2016 New Revision: 295869 URL: https://svnweb.freebsd.org/changeset/base/295869 Log: Make efi_time and EFI_GetTimeOfDay static, neither are used by other parts of the efi code. Sponsored by: ABT Systems Ltd Modified: head/sys/boot/efi/include/efilib.h head/sys/boot/efi/libefi/time.c Modified: head/sys/boot/efi/include/efilib.h ============================================================================== --- head/sys/boot/efi/include/efilib.h Sun Feb 21 20:58:24 2016 (r295868) +++ head/sys/boot/efi/include/efilib.h Sun Feb 21 21:20:23 2016 (r295869) @@ -46,7 +46,6 @@ int efi_handle_lookup(EFI_HANDLE, struct int efi_handle_update_dev(EFI_HANDLE, struct devsw *, int, uint64_t); int efi_status_to_errno(EFI_STATUS); -time_t efi_time(EFI_TIME *); EFI_STATUS main(int argc, CHAR16 *argv[]); void exit(EFI_STATUS status); Modified: head/sys/boot/efi/libefi/time.c ============================================================================== --- head/sys/boot/efi/libefi/time.c Sun Feb 21 20:58:24 2016 (r295868) +++ head/sys/boot/efi/libefi/time.c Sun Feb 21 21:20:23 2016 (r295869) @@ -58,7 +58,7 @@ __FBSDID("$FreeBSD$"); #define SECSPERHOUR ( 60*60 ) #define SECSPERDAY (24 * SECSPERHOUR) -time_t +static time_t efi_time(EFI_TIME *ETime) { /* @@ -164,7 +164,7 @@ efi_time(EFI_TIME *ETime) return UTime; } -int +static int EFI_GetTimeOfDay( OUT struct timeval *tp, OUT struct timezone *tzp From owner-svn-src-head@freebsd.org Sun Feb 21 22:00:48 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 799EDAB0E59; Sun, 21 Feb 2016 22:00:48 +0000 (UTC) (envelope-from andrew@fubar.geek.nz) Received: from kif.fubar.geek.nz (kif.fubar.geek.nz [178.62.119.249]) by mx1.freebsd.org (Postfix) with ESMTP id 4C5B01E3F; Sun, 21 Feb 2016 22:00:48 +0000 (UTC) (envelope-from andrew@fubar.geek.nz) Received: from zapp.Home (5ec39667.skybroadband.com [94.195.150.103]) by kif.fubar.geek.nz (Postfix) with ESMTPSA id 856D4D78FE; Sun, 21 Feb 2016 22:00:14 +0000 (UTC) Date: Sun, 21 Feb 2016 22:00:05 +0000 From: Andrew Turner To: Alan Somers Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r295768 - head/usr.sbin/iostat Message-ID: <20160221220005.2b73b8e1@zapp.Home> In-Reply-To: <201602182008.u1IK81vg092127@repo.freebsd.org> References: <201602182008.u1IK81vg092127@repo.freebsd.org> X-Mailer: Claws Mail 3.13.2 (GTK+ 2.24.29; amd64-portbld-freebsd11.0) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Feb 2016 22:00:48 -0000 On Thu, 18 Feb 2016 20:08:01 +0000 (UTC) Alan Somers wrote: > Author: asomers > Date: Thu Feb 18 20:08:01 2016 > New Revision: 295768 > URL: https://svnweb.freebsd.org/changeset/base/295768 > > Log: > Fix compiler warnings in iostat > > Raise WARNS from 1 to 6 (the default) This breaks building with gcc: ===> usr.sbin/ifmcstat (all) ===> usr.sbin/iostat (all) cc1: warnings being treated as errors /scratch/tmp/andrew/head-git/usr.sbin/iostat/iostat.c: In function 'devstats': /scratch/tmp/andrew/head-git/usr.sbin/iostat/iostat.c:800: warning: declaration of 'devname' shadows a global declaration /scratch/tmp/andrew/obj/powerpc.powerpc/scratch/tmp/andrew/head-git/tmp/usr/include/stdlib.h:282: warning: shadowed declaration is here /scratch/tmp/andrew/head-git/usr.sbin/iostat/iostat.c: In function 'cpustats': /scratch/tmp/andrew/head-git/usr.sbin/iostat/iostat.c:982: warning: declaration of 'time' shadows a global declaration /scratch/tmp/andrew/obj/powerpc.powerpc/scratch/tmp/andrew/head-git/tmp/usr/include/time.h:154: warning: shadowed declaration is here *** Error code 1 Stop. make[4]: stopped in /scratch/tmp/andrew/head-git/usr.sbin/iostat *** Error code 1 Stop. make[3]: stopped in /scratch/tmp/andrew/head-git/usr.sbin *** Error code 1 Stop. make[2]: stopped in /scratch/tmp/andrew/head-git *** Error code 1 Stop. make[1]: stopped in /scratch/tmp/andrew/head-git *** Error code 1 Stop. make: stopped in /scratch/tmp/andrew/head-git -Wshadow is added to the warning flags with WARNS >= 4. Andrew From owner-svn-src-head@freebsd.org Sun Feb 21 23:08:51 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 092A2AB062A; Sun, 21 Feb 2016 23:08:51 +0000 (UTC) (envelope-from asomers@gmail.com) Received: from mail-oi0-x22d.google.com (mail-oi0-x22d.google.com [IPv6:2607:f8b0:4003:c06::22d]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C66CF184D; Sun, 21 Feb 2016 23:08:50 +0000 (UTC) (envelope-from asomers@gmail.com) Received: by mail-oi0-x22d.google.com with SMTP id x21so44561912oix.2; Sun, 21 Feb 2016 15:08:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=gDqi9CHa3XuGiEq6HszBYJSOUFFnEJI9hIURBV8nl3k=; b=YIPhc0im+3zyK7BqiyWLCzX6IJhV7//psdca10bnnAbl06eI1bORW4fl5K75VSsmo1 xuYsjEFQiYO2ZYgTI+PLl1UmnyrqD79sdKEj9IRu9yeXcFo0c+eQyQU26w7lWaZN+3kP EJgqXyrTAcMTepKXHp4NbvrIAqPd+Vj2mmD+e3uaRragwqB2GJ2uUEIoUPIK+i8n4Aeg kRVkJlTk+4310Pcd0+gxOzK2U8uJbCtvII0b63DulGVeTcxY9hBYSZVbvn5nmHz+lrFe Y7LWOgimtcEzd63UGtLQSaAJNg1s+bzhzfk64x1Kv4ktN4Uq4iesK9WqCTk0T6PAfPFm B60w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=gDqi9CHa3XuGiEq6HszBYJSOUFFnEJI9hIURBV8nl3k=; b=J8vrSh2FrS9TGXXOeMXtTnQZ/YeqCQXzKO167GNJ7098mdaxX/svWtqFo70wOFpOAk 7NyDagWdPhBRqA2fIHz9HqpEKfH5HSw+3IwnQaZHLHgaQBPkoUJaCxU+x+6T3lhlUGWK 8rBFIXbJTcTEqLPReIYOvO/Xc5BVdfX7SfPhr/P+CP5DmVu2PRwAS1HAOspTCDhBfAVK xs+V+EhbL8Et2sFc+LYodV7H8jhYrwEuHY3dgJVDnIi1O7DOztv9LK7qMEidBXpE8S6c O+RuFm6ohedLZQu+i+1/ePw4g04ttfMsPTYHIkd03F/6TtRURiw1Y9vpAVbgTO0xH5bj 4zrA== X-Gm-Message-State: AG10YOS+ftlM0RvYubDGBg9FmiLgJmLTuY6iklaw/dZLJL48gNGaAjXaT+P6jZ0JvenqvBBBPzzpfadjvE+woQ== MIME-Version: 1.0 X-Received: by 10.202.216.4 with SMTP id p4mr18268464oig.86.1456096130100; Sun, 21 Feb 2016 15:08:50 -0800 (PST) Sender: asomers@gmail.com Received: by 10.202.64.138 with HTTP; Sun, 21 Feb 2016 15:08:49 -0800 (PST) In-Reply-To: <20160221220005.2b73b8e1@zapp.Home> References: <201602182008.u1IK81vg092127@repo.freebsd.org> <20160221220005.2b73b8e1@zapp.Home> Date: Sun, 21 Feb 2016 16:08:49 -0700 X-Google-Sender-Auth: 40fXxNeORyPV1tm2y2kTU4OnomU Message-ID: Subject: Re: svn commit: r295768 - head/usr.sbin/iostat From: Alan Somers To: Andrew Turner Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Feb 2016 23:08:51 -0000 On Sun, Feb 21, 2016 at 3:00 PM, Andrew Turner wrote: > On Thu, 18 Feb 2016 20:08:01 +0000 (UTC) > Alan Somers wrote: > >> Author: asomers >> Date: Thu Feb 18 20:08:01 2016 >> New Revision: 295768 >> URL: https://svnweb.freebsd.org/changeset/base/295768 >> >> Log: >> Fix compiler warnings in iostat >> >> Raise WARNS from 1 to 6 (the default) > > This breaks building with gcc: > I'll fix it in the morning. Thanks for reporting it. From owner-svn-src-head@freebsd.org Mon Feb 22 00:48:55 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B6542AB0C42; Mon, 22 Feb 2016 00:48:55 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8E8001BBB; Mon, 22 Feb 2016 00:48:55 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1M0msV9042813; Mon, 22 Feb 2016 00:48:54 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1M0msZh042808; Mon, 22 Feb 2016 00:48:54 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201602220048.u1M0msZh042808@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Mon, 22 Feb 2016 00:48:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295871 - in head/sys: conf dev/usb/wlan modules/usb modules/usb/urtwn X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Feb 2016 00:48:55 -0000 Author: avos Date: Mon Feb 22 00:48:53 2016 New Revision: 295871 URL: https://svnweb.freebsd.org/changeset/base/295871 Log: urtwn: add an option to compile the driver without firmware specific code - Add URTWN_WITHOUT_UCODE option (will disable any firmware specific code when set). - Do not exclude the driver from build when MK_SOURCELESS_UCODE is set (URTWN_WITHOUT_UCODE will be enforced unconditionally). - Do not abort initialization when firmware cannot be loaded; behave like the URTWN_WITHOUT_UCODE option was set. - Drop some unused variables from urtwn_softc structure. Tested with RTL8188EU and RTL8188CUS in HOSTAP and STA modes. Reviewed by: kevlo Approved by: adrian (mentor) Differential Revision: https://reviews.freebsd.org/D4849 Modified: head/sys/conf/options head/sys/dev/usb/wlan/if_urtwn.c head/sys/dev/usb/wlan/if_urtwnvar.h head/sys/modules/usb/Makefile head/sys/modules/usb/urtwn/Makefile Modified: head/sys/conf/options ============================================================================== --- head/sys/conf/options Sun Feb 21 22:34:09 2016 (r295870) +++ head/sys/conf/options Mon Feb 22 00:48:53 2016 (r295871) @@ -673,6 +673,9 @@ UPLCOM_INTR_INTERVAL opt_uplcom.h UVSCOM_DEFAULT_OPKTSIZE opt_uvscom.h UVSCOM_INTR_INTERVAL opt_uvscom.h +# options for the Realtek RTL8188*U/RTL8192CU driver (urtwn) +URTWN_WITHOUT_UCODE opt_urtwn.h + # Embedded system options INIT_PATH Modified: head/sys/dev/usb/wlan/if_urtwn.c ============================================================================== --- head/sys/dev/usb/wlan/if_urtwn.c Sun Feb 21 22:34:09 2016 (r295870) +++ head/sys/dev/usb/wlan/if_urtwn.c Mon Feb 22 00:48:53 2016 (r295871) @@ -26,6 +26,7 @@ __FBSDID("$FreeBSD$"); */ #include "opt_wlan.h" +#include "opt_urtwn.h" #include #include @@ -308,11 +309,13 @@ static void urtwn_parent(struct ieee802 static int urtwn_r92c_power_on(struct urtwn_softc *); static int urtwn_r88e_power_on(struct urtwn_softc *); static int urtwn_llt_init(struct urtwn_softc *); +#ifndef URTWN_WITHOUT_UCODE static void urtwn_fw_reset(struct urtwn_softc *); static void urtwn_r88e_fw_reset(struct urtwn_softc *); static int urtwn_fw_loadpage(struct urtwn_softc *, int, const uint8_t *, int); static int urtwn_load_firmware(struct urtwn_softc *); +#endif static int urtwn_dma_init(struct urtwn_softc *); static int urtwn_mac_init(struct urtwn_softc *); static void urtwn_bb_init(struct urtwn_softc *); @@ -1376,6 +1379,13 @@ urtwn_fw_cmd(struct urtwn_softc *sc, uin usb_error_t error; int ntries; + if (!(sc->sc_flags & URTWN_FW_LOADED)) { + URTWN_DPRINTF(sc, URTWN_DEBUG_FIRMWARE, "%s: firmware " + "was not loaded; command (id %d) will be discarded\n", + __func__, id); + return (0); + } + /* Wait for current FW box to be empty. */ for (ntries = 0; ntries < 100; ntries++) { if (!(urtwn_read_1(sc, R92C_HMETFR) & (1 << sc->fwcur))) @@ -3275,6 +3285,7 @@ urtwn_llt_init(struct urtwn_softc *sc) return (error); } +#ifndef URTWN_WITHOUT_UCODE static void urtwn_fw_reset(struct urtwn_softc *sc) { @@ -3457,6 +3468,7 @@ fail: firmware_put(fw, FIRMWARE_UNLOAD); return (error); } +#endif static int urtwn_dma_init(struct urtwn_softc *sc) @@ -4786,10 +4798,12 @@ urtwn_init(struct urtwn_softc *sc) urtwn_write_1(sc, R92C_BCN_MAX_ERR, 0xff); } +#ifndef URTWN_WITHOUT_UCODE /* Load 8051 microcode. */ error = urtwn_load_firmware(sc); - if (error != 0) - goto fail; + if (error == 0) + sc->sc_flags |= URTWN_FW_LOADED; +#endif /* Initialize MAC/BB/RF blocks. */ error = urtwn_mac_init(sc); @@ -4892,7 +4906,8 @@ urtwn_stop(struct urtwn_softc *sc) return; } - sc->sc_flags &= ~(URTWN_RUNNING | URTWN_TEMP_MEASURED); + sc->sc_flags &= ~(URTWN_RUNNING | URTWN_FW_LOADED | + URTWN_TEMP_MEASURED); sc->thcal_lctemp = 0; callout_stop(&sc->sc_watchdog_ch); urtwn_abort_xfers(sc); @@ -4991,6 +5006,8 @@ static devclass_t urtwn_devclass; DRIVER_MODULE(urtwn, uhub, urtwn_driver, urtwn_devclass, NULL, NULL); MODULE_DEPEND(urtwn, usb, 1, 1, 1); MODULE_DEPEND(urtwn, wlan, 1, 1, 1); +#ifndef URTWN_WITHOUT_UCODE MODULE_DEPEND(urtwn, firmware, 1, 1, 1); +#endif MODULE_VERSION(urtwn, 1); USB_PNP_HOST_INFO(urtwn_devs); Modified: head/sys/dev/usb/wlan/if_urtwnvar.h ============================================================================== --- head/sys/dev/usb/wlan/if_urtwnvar.h Sun Feb 21 22:34:09 2016 (r295870) +++ head/sys/dev/usb/wlan/if_urtwnvar.h Mon Feb 22 00:48:53 2016 (r295871) @@ -155,7 +155,8 @@ struct urtwn_softc { uint8_t sc_flags; #define URTWN_FLAG_CCK_HIPWR 0x01 #define URTWN_DETACHED 0x02 -#define URTWN_RUNNING 0x04 +#define URTWN_RUNNING 0x04 +#define URTWN_FW_LOADED 0x08 #define URTWN_TEMP_MEASURED 0x10 u_int chip; @@ -196,11 +197,6 @@ struct urtwn_softc { urtwn_datahead sc_tx_inactive; urtwn_datahead sc_tx_pending; - const char *fwname; - const struct firmware *fw_fp; - struct urtwn_fw_info fw; - void *fw_virtaddr; - union urtwn_rom rom; uint16_t last_rom_addr; Modified: head/sys/modules/usb/Makefile ============================================================================== --- head/sys/modules/usb/Makefile Sun Feb 21 22:34:09 2016 (r295870) +++ head/sys/modules/usb/Makefile Mon Feb 22 00:48:53 2016 (r295871) @@ -47,7 +47,7 @@ SUBDIR = usb SUBDIR += ${_dwc_otg} ehci ${_musb} ohci uhci xhci ${_uss820dci} ${_at91dci} \ ${_atmegadci} ${_avr32dci} ${_rsu} ${_rsufw} ${_saf1761otg} SUBDIR += ${_rum} ${_run} ${_runfw} ${_uath} upgt usie ural ${_zyd} ${_urtw} -SUBDIR += ${_urtwn} ${_urtwnfw} +SUBDIR += urtwn ${_urtwnfw} SUBDIR += atp uhid ukbd ums udbp ufm uep wsp ugold uled SUBDIR += ucom u3g uark ubsa ubser uchcom ucycom ufoma uftdi ugensa uipaq ulpt \ umct umcs umodem umoscom uplcom uslcom uvisor uvscom @@ -70,7 +70,6 @@ _rum= rum _uath= uath _zyd= zyd _kue= kue -_urtwn= urtwn _urtwnfw= urtwnfw _run= run _runfw= runfw Modified: head/sys/modules/usb/urtwn/Makefile ============================================================================== --- head/sys/modules/usb/urtwn/Makefile Sun Feb 21 22:34:09 2016 (r295870) +++ head/sys/modules/usb/urtwn/Makefile Mon Feb 22 00:48:53 2016 (r295871) @@ -2,9 +2,16 @@ .PATH: ${.CURDIR}/../../../dev/usb/wlan +.include + KMOD = if_urtwn SRCS = if_urtwn.c if_urtwnreg.h if_urtwnvar.h \ bus_if.h device_if.h \ - opt_bus.h opt_usb.h opt_wlan.h usb_if.h usbdevs.h + opt_bus.h opt_urtwn.h opt_usb.h opt_wlan.h usb_if.h usbdevs.h + +.if ${MK_SOURCELESS_UCODE} == "no" +opt_urtwn.h: + @echo "#define URTWN_WITHOUT_UCODE 1" > ${.TARGET} +.endif .include From owner-svn-src-head@freebsd.org Mon Feb 22 00:58:06 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 09751AAF027; Mon, 22 Feb 2016 00:58:06 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CEE481171; Mon, 22 Feb 2016 00:58:05 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1M0w4uW045798; Mon, 22 Feb 2016 00:58:04 GMT (envelope-from yongari@FreeBSD.org) Received: (from yongari@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1M0w4fB045796; Mon, 22 Feb 2016 00:58:04 GMT (envelope-from yongari@FreeBSD.org) Message-Id: <201602220058.u1M0w4fB045796@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: yongari set sender to yongari@FreeBSD.org using -f From: Pyun YongHyeon Date: Mon, 22 Feb 2016 00:58:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295873 - in head/sys/dev: msk sk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Feb 2016 00:58:06 -0000 Author: yongari Date: Mon Feb 22 00:58:04 2016 New Revision: 295873 URL: https://svnweb.freebsd.org/changeset/base/295873 Log: ifnet lock was changed to use sx(9) long time ago. Don't hold a driver lock for if_free(9). Modified: head/sys/dev/msk/if_msk.c head/sys/dev/sk/if_sk.c Modified: head/sys/dev/msk/if_msk.c ============================================================================== --- head/sys/dev/msk/if_msk.c Mon Feb 22 00:49:35 2016 (r295872) +++ head/sys/dev/msk/if_msk.c Mon Feb 22 00:58:04 2016 (r295873) @@ -2059,11 +2059,11 @@ msk_detach(device_t dev) msk_txrx_dma_free(sc_if); bus_generic_detach(dev); - if (ifp) - if_free(ifp); sc = sc_if->msk_softc; sc->msk_if[sc_if->msk_port] = NULL; MSK_IF_UNLOCK(sc_if); + if (ifp) + if_free(ifp); return (0); } Modified: head/sys/dev/sk/if_sk.c ============================================================================== --- head/sys/dev/sk/if_sk.c Mon Feb 22 00:49:35 2016 (r295872) +++ head/sys/dev/sk/if_sk.c Mon Feb 22 00:58:04 2016 (r295873) @@ -1833,8 +1833,6 @@ sk_detach(dev) ether_ifdetach(ifp); SK_IF_LOCK(sc_if); } - if (ifp) - if_free(ifp); /* * We're generally called from skc_detach() which is using * device_delete_child() to get to here. It's already trashed @@ -1848,6 +1846,8 @@ sk_detach(dev) sk_dma_jumbo_free(sc_if); sk_dma_free(sc_if); SK_IF_UNLOCK(sc_if); + if (ifp) + if_free(ifp); return(0); } From owner-svn-src-head@freebsd.org Mon Feb 22 01:15:04 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 019F1AAF7CC; Mon, 22 Feb 2016 01:15:04 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D0B1F19AE; Mon, 22 Feb 2016 01:15:03 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1M1F2Eg051540; Mon, 22 Feb 2016 01:15:02 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1M1F29V051537; Mon, 22 Feb 2016 01:15:02 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201602220115.u1M1F29V051537@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Mon, 22 Feb 2016 01:15:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295874 - head/sys/dev/usb/wlan X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Feb 2016 01:15:04 -0000 Author: avos Date: Mon Feb 22 01:15:02 2016 New Revision: 295874 URL: https://svnweb.freebsd.org/changeset/base/295874 Log: urtwn: shutdown the device properly - R92C path: NetBSD (mostly) - R88E path: TP-Link driver Tested with RTL8188EU and RTL8188CUS. Reviewed by: kevlo Approved by: adrian (mentor) Differential Revision: https://reviews.freebsd.org/D5198 Modified: head/sys/dev/usb/wlan/if_urtwn.c head/sys/dev/usb/wlan/if_urtwnreg.h head/sys/dev/usb/wlan/if_urtwnvar.h Modified: head/sys/dev/usb/wlan/if_urtwn.c ============================================================================== --- head/sys/dev/usb/wlan/if_urtwn.c Mon Feb 22 00:58:04 2016 (r295873) +++ head/sys/dev/usb/wlan/if_urtwn.c Mon Feb 22 01:15:02 2016 (r295874) @@ -308,6 +308,8 @@ static void urtwn_start(struct urtwn_so static void urtwn_parent(struct ieee80211com *); static int urtwn_r92c_power_on(struct urtwn_softc *); static int urtwn_r88e_power_on(struct urtwn_softc *); +static void urtwn_r92c_power_off(struct urtwn_softc *); +static void urtwn_r88e_power_off(struct urtwn_softc *); static int urtwn_llt_init(struct urtwn_softc *); #ifndef URTWN_WITHOUT_UCODE static void urtwn_fw_reset(struct urtwn_softc *); @@ -1782,6 +1784,7 @@ urtwn_read_rom(struct urtwn_softc *sc) sc->sc_rf_write = urtwn_r92c_rf_write; sc->sc_power_on = urtwn_r92c_power_on; + sc->sc_power_off = urtwn_r92c_power_off; return (0); } @@ -1809,6 +1812,7 @@ urtwn_r88e_read_rom(struct urtwn_softc * sc->sc_rf_write = urtwn_r88e_rf_write; sc->sc_power_on = urtwn_r88e_power_on; + sc->sc_power_off = urtwn_r88e_power_off; return (0); } @@ -3235,7 +3239,7 @@ urtwn_r88e_power_on(struct urtwn_softc * /* Enable LDO normal mode. */ error = urtwn_write_1(sc, R92C_LPLDO_CTRL, - urtwn_read_1(sc, R92C_LPLDO_CTRL) & ~0x10); + urtwn_read_1(sc, R92C_LPLDO_CTRL) & ~R92C_LPLDO_CTRL_SLEEP); if (error != USB_ERR_NORMAL_COMPLETION) return (EIO); @@ -3254,6 +3258,269 @@ urtwn_r88e_power_on(struct urtwn_softc * return (0); } +static __inline void +urtwn_power_off(struct urtwn_softc *sc) +{ + + return sc->sc_power_off(sc); +} + +static void +urtwn_r92c_power_off(struct urtwn_softc *sc) +{ + uint32_t reg; + + /* Block all Tx queues. */ + urtwn_write_1(sc, R92C_TXPAUSE, R92C_TX_QUEUE_ALL); + + /* Disable RF */ + urtwn_rf_write(sc, 0, 0, 0); + + urtwn_write_1(sc, R92C_APSD_CTRL, R92C_APSD_CTRL_OFF); + + /* Reset BB state machine */ + urtwn_write_1(sc, R92C_SYS_FUNC_EN, + R92C_SYS_FUNC_EN_USBD | R92C_SYS_FUNC_EN_USBA | + R92C_SYS_FUNC_EN_BB_GLB_RST); + urtwn_write_1(sc, R92C_SYS_FUNC_EN, + R92C_SYS_FUNC_EN_USBD | R92C_SYS_FUNC_EN_USBA); + + /* + * Reset digital sequence + */ +#ifndef URTWN_WITHOUT_UCODE + if (urtwn_read_1(sc, R92C_MCUFWDL) & R92C_MCUFWDL_RDY) { + /* Reset MCU ready status */ + urtwn_write_1(sc, R92C_MCUFWDL, 0); + + /* If firmware in ram code, do reset */ + urtwn_fw_reset(sc); + } +#endif + + /* Reset MAC and Enable 8051 */ + urtwn_write_1(sc, R92C_SYS_FUNC_EN + 1, + (R92C_SYS_FUNC_EN_CPUEN | + R92C_SYS_FUNC_EN_ELDR | + R92C_SYS_FUNC_EN_HWPDN) >> 8); + + /* Reset MCU ready status */ + urtwn_write_1(sc, R92C_MCUFWDL, 0); + + /* Disable MAC clock */ + urtwn_write_2(sc, R92C_SYS_CLKR, + R92C_SYS_CLKR_ANAD16V_EN | + R92C_SYS_CLKR_ANA8M | + R92C_SYS_CLKR_LOADER_EN | + R92C_SYS_CLKR_80M_SSC_DIS | + R92C_SYS_CLKR_SYS_EN | + R92C_SYS_CLKR_RING_EN | + 0x4000); + + /* Disable AFE PLL */ + urtwn_write_1(sc, R92C_AFE_PLL_CTRL, 0x80); + + /* Gated AFE DIG_CLOCK */ + urtwn_write_2(sc, R92C_AFE_XTAL_CTRL, 0x880F); + + /* Isolated digital to PON */ + urtwn_write_1(sc, R92C_SYS_ISO_CTRL, + R92C_SYS_ISO_CTRL_MD2PP | + R92C_SYS_ISO_CTRL_PA2PCIE | + R92C_SYS_ISO_CTRL_PD2CORE | + R92C_SYS_ISO_CTRL_IP2MAC | + R92C_SYS_ISO_CTRL_DIOP | + R92C_SYS_ISO_CTRL_DIOE); + + /* + * Pull GPIO PIN to balance level and LED control + */ + /* 1. Disable GPIO[7:0] */ + urtwn_write_2(sc, R92C_GPIO_IOSEL, 0x0000); + + reg = urtwn_read_4(sc, R92C_GPIO_PIN_CTRL) & ~0x0000ff00; + reg |= ((reg << 8) & 0x0000ff00) | 0x00ff0000; + urtwn_write_4(sc, R92C_GPIO_PIN_CTRL, reg); + + /* Disable GPIO[10:8] */ + urtwn_write_1(sc, R92C_MAC_PINMUX_CFG, 0x00); + + reg = urtwn_read_2(sc, R92C_GPIO_IO_SEL) & ~0x00f0; + reg |= (((reg & 0x000f) << 4) | 0x0780); + urtwn_write_2(sc, R92C_GPIO_IO_SEL, reg); + + /* Disable LED0 & 1 */ + urtwn_write_2(sc, R92C_LEDCFG0, 0x8080); + + /* + * Reset digital sequence + */ + /* Disable ELDR clock */ + urtwn_write_2(sc, R92C_SYS_CLKR, + R92C_SYS_CLKR_ANAD16V_EN | + R92C_SYS_CLKR_ANA8M | + R92C_SYS_CLKR_LOADER_EN | + R92C_SYS_CLKR_80M_SSC_DIS | + R92C_SYS_CLKR_SYS_EN | + R92C_SYS_CLKR_RING_EN | + 0x4000); + + /* Isolated ELDR to PON */ + urtwn_write_1(sc, R92C_SYS_ISO_CTRL + 1, + (R92C_SYS_ISO_CTRL_DIOR | + R92C_SYS_ISO_CTRL_PWC_EV12V) >> 8); + + /* + * Disable analog sequence + */ + /* Disable A15 power */ + urtwn_write_1(sc, R92C_LDOA15_CTRL, R92C_LDOA15_CTRL_OBUF); + /* Disable digital core power */ + urtwn_write_1(sc, R92C_LDOV12D_CTRL, + urtwn_read_1(sc, R92C_LDOV12D_CTRL) & + ~R92C_LDOV12D_CTRL_LDV12_EN); + + /* Enter PFM mode */ + urtwn_write_1(sc, R92C_SPS0_CTRL, 0x23); + + /* Set USB suspend */ + urtwn_write_2(sc, R92C_APS_FSMCO, + R92C_APS_FSMCO_APDM_HOST | + R92C_APS_FSMCO_AFSM_HSUS | + R92C_APS_FSMCO_PFM_ALDN); + + /* Lock ISO/CLK/Power control register. */ + urtwn_write_1(sc, R92C_RSV_CTRL, 0x0E); +} + +static void +urtwn_r88e_power_off(struct urtwn_softc *sc) +{ + uint8_t reg; + int ntries; + + /* Disable any kind of TX reports. */ + urtwn_write_1(sc, R88E_TX_RPT_CTRL, + urtwn_read_1(sc, R88E_TX_RPT_CTRL) & + ~(R88E_TX_RPT1_ENA | R88E_TX_RPT2_ENA)); + + /* Stop Rx. */ + urtwn_write_1(sc, R92C_CR, 0); + + /* Move card to Low Power State. */ + /* Block all Tx queues. */ + urtwn_write_1(sc, R92C_TXPAUSE, R92C_TX_QUEUE_ALL); + + for (ntries = 0; ntries < 20; ntries++) { + /* Should be zero if no packet is transmitting. */ + if (urtwn_read_4(sc, R88E_SCH_TXCMD) == 0) + break; + + urtwn_ms_delay(sc); + } + if (ntries == 20) { + device_printf(sc->sc_dev, "%s: failed to block Tx queues\n", + __func__); + return; + } + + /* CCK and OFDM are disabled, and clock are gated. */ + urtwn_write_1(sc, R92C_SYS_FUNC_EN, + urtwn_read_1(sc, R92C_SYS_FUNC_EN) & ~R92C_SYS_FUNC_EN_BBRSTB); + + urtwn_ms_delay(sc); + + /* Reset MAC TRX */ + urtwn_write_1(sc, R92C_CR, + R92C_CR_HCI_TXDMA_EN | R92C_CR_HCI_RXDMA_EN | + R92C_CR_TXDMA_EN | R92C_CR_RXDMA_EN | + R92C_CR_PROTOCOL_EN | R92C_CR_SCHEDULE_EN); + + /* check if removed later */ + urtwn_write_1(sc, R92C_CR + 1, + urtwn_read_1(sc, R92C_CR + 1) & ~(R92C_CR_ENSEC >> 8)); + + /* Respond TxOK to scheduler */ + urtwn_write_1(sc, R92C_DUAL_TSF_RST, + urtwn_read_1(sc, R92C_DUAL_TSF_RST) | 0x20); + + /* If firmware in ram code, do reset. */ +#ifndef URTWN_WITHOUT_UCODE + if (urtwn_read_1(sc, R92C_MCUFWDL) & R92C_MCUFWDL_RDY) + urtwn_r88e_fw_reset(sc); +#endif + + /* Reset MCU ready status. */ + urtwn_write_1(sc, R92C_MCUFWDL, 0x00); + + /* Disable 32k. */ + urtwn_write_1(sc, R88E_32K_CTRL, + urtwn_read_1(sc, R88E_32K_CTRL) & ~0x01); + + /* Move card to Disabled state. */ + /* Turn off RF. */ + urtwn_write_1(sc, R92C_RF_CTRL, 0); + + /* LDO Sleep mode. */ + urtwn_write_1(sc, R92C_LPLDO_CTRL, + urtwn_read_1(sc, R92C_LPLDO_CTRL) | R92C_LPLDO_CTRL_SLEEP); + + /* Turn off MAC by HW state machine */ + urtwn_write_1(sc, R92C_APS_FSMCO + 1, + urtwn_read_1(sc, R92C_APS_FSMCO + 1) | + (R92C_APS_FSMCO_APFM_OFF >> 8)); + + for (ntries = 0; ntries < 20; ntries++) { + /* Wait until it will be disabled. */ + if ((urtwn_read_1(sc, R92C_APS_FSMCO + 1) & + (R92C_APS_FSMCO_APFM_OFF >> 8)) == 0) + break; + + urtwn_ms_delay(sc); + } + if (ntries == 20) { + device_printf(sc->sc_dev, "%s: could not turn off MAC\n", + __func__); + return; + } + + /* schmit trigger */ + urtwn_write_1(sc, R92C_AFE_XTAL_CTRL + 2, + urtwn_read_1(sc, R92C_AFE_XTAL_CTRL + 2) | 0x80); + + /* Enable WL suspend. */ + urtwn_write_1(sc, R92C_APS_FSMCO + 1, + (urtwn_read_1(sc, R92C_APS_FSMCO + 1) & ~0x10) | 0x08); + + /* Enable bandgap mbias in suspend. */ + urtwn_write_1(sc, R92C_APS_FSMCO + 3, 0); + + /* Clear SIC_EN register. */ + urtwn_write_1(sc, R92C_GPIO_MUXCFG + 1, + urtwn_read_1(sc, R92C_GPIO_MUXCFG + 1) & ~0x10); + + /* Set USB suspend enable local register */ + urtwn_write_1(sc, R92C_USB_SUSPEND, + urtwn_read_1(sc, R92C_USB_SUSPEND) | 0x10); + + /* Reset MCU IO Wrapper. */ + reg = urtwn_read_1(sc, R92C_RSV_CTRL + 1); + urtwn_write_1(sc, R92C_RSV_CTRL + 1, reg & ~0x08); + urtwn_write_1(sc, R92C_RSV_CTRL + 1, reg | 0x08); + + /* marked as 'For Power Consumption' code. */ + urtwn_write_1(sc, R92C_GPIO_OUT, urtwn_read_1(sc, R92C_GPIO_IN)); + urtwn_write_1(sc, R92C_GPIO_IOSEL, 0xff); + + urtwn_write_1(sc, R92C_GPIO_IO_SEL, + urtwn_read_1(sc, R92C_GPIO_IO_SEL) << 4); + urtwn_write_1(sc, R92C_GPIO_MOD, + urtwn_read_1(sc, R92C_GPIO_MOD) | 0x0f); + + /* Set LNA, TRSW, EX_PA Pin to output mode. */ + urtwn_write_4(sc, R88E_BB_PAD_CTRL, 0x00080808); +} + static int urtwn_llt_init(struct urtwn_softc *sc) { @@ -4910,9 +5177,10 @@ urtwn_stop(struct urtwn_softc *sc) URTWN_TEMP_MEASURED); sc->thcal_lctemp = 0; callout_stop(&sc->sc_watchdog_ch); - urtwn_abort_xfers(sc); + urtwn_abort_xfers(sc); urtwn_drain_mbufq(sc); + urtwn_power_off(sc); URTWN_UNLOCK(sc); } Modified: head/sys/dev/usb/wlan/if_urtwnreg.h ============================================================================== --- head/sys/dev/usb/wlan/if_urtwnreg.h Mon Feb 22 00:58:04 2016 (r295873) +++ head/sys/dev/usb/wlan/if_urtwnreg.h Mon Feb 22 01:15:02 2016 (r295874) @@ -70,6 +70,10 @@ #define R92C_GPIO_IO_SEL 0x042 #define R92C_MAC_PINMUX_CFG 0x043 #define R92C_GPIO_PIN_CTRL 0x044 +#define R92C_GPIO_IN 0x044 +#define R92C_GPIO_OUT 0x045 +#define R92C_GPIO_IOSEL 0x046 +#define R92C_GPIO_MOD 0x047 #define R92C_GPIO_INTM 0x048 #define R92C_LEDCFG0 0x04c #define R92C_LEDCFG1 0x04d @@ -79,6 +83,7 @@ #define R92C_FSISR 0x054 #define R92C_HSIMR 0x058 #define R92C_HSISR 0x05c +#define R88E_BB_PAD_CTRL 0x064 #define R92C_MCUFWDL 0x080 #define R92C_HMEBOX_EXT(idx) (0x088 + (idx) * 2) #define R88E_HIMR 0x0b0 @@ -117,6 +122,7 @@ #define R92C_MBIST_START 0x174 #define R92C_MBIST_DONE 0x178 #define R92C_MBIST_FAIL 0x17c +#define R88E_32K_CTRL 0x194 #define R92C_C2HEVT_MSG_NORMAL 0x1a0 #define R92C_C2HEVT_MSG_TEST 0x1b8 #define R92C_C2HEVT_CLEAR 0x1bf @@ -204,6 +210,7 @@ #define R92C_BE_ADMTIME 0x5c8 #define R92C_EDCA_RANDOM_GEN 0x5cc #define R92C_SCH_TXCMD 0x5d0 +#define R88E_SCH_TXCMD 0x5f8 /* WMAC Configuration. */ #define R92C_APSD_CTRL 0x600 #define R92C_BWOPMODE 0x603 @@ -303,13 +310,30 @@ #define R92C_RF_CTRL_RSTB 0x02 #define R92C_RF_CTRL_SDMRSTB 0x04 +/* Bits for R92C_LDOA15_CTRL. */ +#define R92C_LDOA15_CTRL_EN 0x01 +#define R92C_LDOA15_CTRL_STBY 0x02 +#define R92C_LDOA15_CTRL_OBUF 0x04 +#define R92C_LDOA15_CTRL_REG_VOS 0x08 + /* Bits for R92C_LDOV12D_CTRL. */ #define R92C_LDOV12D_CTRL_LDV12_EN 0x01 +/* Bits for R92C_LPLDO_CTRL. */ +#define R92C_LPLDO_CTRL_SLEEP 0x10 + /* Bits for R92C_AFE_XTAL_CTRL. */ #define R92C_AFE_XTAL_CTRL_ADDR_M 0x007ff800 #define R92C_AFE_XTAL_CTRL_ADDR_S 11 +/* Bits for R92C_AFE_PLL_CTRL. */ +#define R92C_AFE_PLL_CTRL_EN 0x0001 +#define R92C_AFE_PLL_CTRL_320_EN 0x0002 +#define R92C_AFE_PLL_CTRL_FREF_SEL 0x0004 +#define R92C_AFE_PLL_CTRL_EDGE_SEL 0x0008 +#define R92C_AFE_PLL_CTRL_WDOGB 0x0010 +#define R92C_AFE_PLL_CTRL_LPFEN 0x0020 + /* Bits for R92C_EFUSE_CTRL. */ #define R92C_EFUSE_CTRL_DATA_M 0x000000ff #define R92C_EFUSE_CTRL_DATA_S 0 @@ -748,6 +772,7 @@ /* * USB registers. */ +#define R92C_USB_SUSPEND 0xfe10 #define R92C_USB_INFO 0xfe17 #define R92C_USB_SPECIAL_OPTION 0xfe55 #define R92C_USB_HCPWM 0xfe57 Modified: head/sys/dev/usb/wlan/if_urtwnvar.h ============================================================================== --- head/sys/dev/usb/wlan/if_urtwnvar.h Mon Feb 22 00:58:04 2016 (r295873) +++ head/sys/dev/usb/wlan/if_urtwnvar.h Mon Feb 22 01:15:02 2016 (r295874) @@ -172,6 +172,7 @@ struct urtwn_softc { void (*sc_rf_write)(struct urtwn_softc *, int, uint8_t, uint32_t); int (*sc_power_on)(struct urtwn_softc *); + void (*sc_power_off)(struct urtwn_softc *); struct ieee80211_node *node_list[R88E_MACID_MAX + 1]; struct mtx nt_mtx; From owner-svn-src-head@freebsd.org Mon Feb 22 05:11:33 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 41393AAF013; Mon, 22 Feb 2016 05:11:33 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail106.syd.optusnet.com.au (mail106.syd.optusnet.com.au [211.29.132.42]) by mx1.freebsd.org (Postfix) with ESMTP id 025551E4F; Mon, 22 Feb 2016 05:11:32 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from c110-21-41-193.carlnfd1.nsw.optusnet.com.au (c110-21-41-193.carlnfd1.nsw.optusnet.com.au [110.21.41.193]) by mail106.syd.optusnet.com.au (Postfix) with ESMTPS id A32D23C2804; Mon, 22 Feb 2016 16:11:24 +1100 (AEDT) Date: Mon, 22 Feb 2016 16:11:23 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Ian Lepore cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r295864 - head/sys/kern In-Reply-To: <201602211835.u1LIZ1Hu035391@repo.freebsd.org> Message-ID: <20160222161058.K887@besplex.bde.org> References: <201602211835.u1LIZ1Hu035391@repo.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=KvuwojiN c=1 sm=1 tr=0 a=73JWPhLeruqQCjN69UNZtQ==:117 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=kj9zAlcOel0A:10 a=9mB8JzU7MPS8jGCe_BsA:9 a=CjuIK1q_8ugA:10 a=TKddWFKLSf4A:10 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Feb 2016 05:11:33 -0000 On Sun, 21 Feb 2016, Ian Lepore wrote: > Log: > Allow a dynamic env to override a compiled-in static env by passing in the > override indication in the env data. > > Submitted by: bde Thanks. Bruce From owner-svn-src-head@freebsd.org Mon Feb 22 06:17:28 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 334A6AB07FF; Mon, 22 Feb 2016 06:17:28 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0E18417CE; Mon, 22 Feb 2016 06:17:27 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1M6HRY0039276; Mon, 22 Feb 2016 06:17:27 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1M6HQKw039274; Mon, 22 Feb 2016 06:17:26 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201602220617.u1M6HQKw039274@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Mon, 22 Feb 2016 06:17:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295875 - head/sys/dev/hyperv/netvsc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Feb 2016 06:17:28 -0000 Author: sephe Date: Mon Feb 22 06:17:26 2016 New Revision: 295875 URL: https://svnweb.freebsd.org/changeset/base/295875 Log: hyperv/hn: Rename TX related function and struct fields a bit Preamble to implement the ifnet.if_transmit method. Reviewed by: adrian Approved by: adrian (mentor) MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D5344 Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.h head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.h ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_net_vsc.h Mon Feb 22 01:15:02 2016 (r295874) +++ head/sys/dev/hyperv/netvsc/hv_net_vsc.h Mon Feb 22 06:17:26 2016 (r295875) @@ -1030,7 +1030,7 @@ struct hn_tx_ring { int hn_sched_tx; struct taskqueue *hn_tx_taskq; - struct task hn_start_task; + struct task hn_tx_task; struct task hn_txeof_task; struct mtx hn_tx_lock; Modified: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Mon Feb 22 01:15:02 2016 (r295874) +++ head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Mon Feb 22 06:17:26 2016 (r295875) @@ -298,8 +298,8 @@ static int hn_create_tx_ring(struct hn_s static void hn_destroy_tx_ring(struct hn_tx_ring *); static int hn_create_tx_data(struct hn_softc *); static void hn_destroy_tx_data(struct hn_softc *); -static void hn_start_taskfunc(void *xsc, int pending); -static void hn_txeof_taskfunc(void *xsc, int pending); +static void hn_start_taskfunc(void *, int); +static void hn_start_txeof_taskfunc(void *, int); static void hn_stop_tx_tasks(struct hn_softc *); static int hn_encap(struct hn_tx_ring *, struct hn_txdesc *, struct mbuf **); static void hn_create_rx_data(struct hn_softc *sc); @@ -1555,7 +1555,7 @@ hn_start(struct ifnet *ifp) return; } do_sched: - taskqueue_enqueue(txr->hn_tx_taskq, &txr->hn_start_task); + taskqueue_enqueue(txr->hn_tx_taskq, &txr->hn_tx_task); } static void @@ -1577,7 +1577,7 @@ hn_start_txeof(struct hn_tx_ring *txr) mtx_unlock(&txr->hn_tx_lock); if (sched) { taskqueue_enqueue(txr->hn_tx_taskq, - &txr->hn_start_task); + &txr->hn_tx_task); } } else { do_sched: @@ -2103,8 +2103,8 @@ hn_create_tx_ring(struct hn_softc *sc, i #endif txr->hn_tx_taskq = sc->hn_tx_taskq; - TASK_INIT(&txr->hn_start_task, 0, hn_start_taskfunc, txr); - TASK_INIT(&txr->hn_txeof_task, 0, hn_txeof_taskfunc, txr); + TASK_INIT(&txr->hn_tx_task, 0, hn_start_taskfunc, txr); + TASK_INIT(&txr->hn_txeof_task, 0, hn_start_txeof_taskfunc, txr); txr->hn_direct_tx_size = hn_direct_tx_size; if (hv_vmbus_protocal_version >= HV_VMBUS_VERSION_WIN8_1) @@ -2399,7 +2399,7 @@ hn_start_taskfunc(void *xtxr, int pendin } static void -hn_txeof_taskfunc(void *xtxr, int pending __unused) +hn_start_txeof_taskfunc(void *xtxr, int pending __unused) { struct hn_tx_ring *txr = xtxr; @@ -2417,7 +2417,7 @@ hn_stop_tx_tasks(struct hn_softc *sc) for (i = 0; i < sc->hn_tx_ring_cnt; ++i) { struct hn_tx_ring *txr = &sc->hn_tx_ring[i]; - taskqueue_drain(txr->hn_tx_taskq, &txr->hn_start_task); + taskqueue_drain(txr->hn_tx_taskq, &txr->hn_tx_task); taskqueue_drain(txr->hn_tx_taskq, &txr->hn_txeof_task); } } From owner-svn-src-head@freebsd.org Mon Feb 22 06:22:49 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 48AC3AB0A22; Mon, 22 Feb 2016 06:22:49 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F30241C10; Mon, 22 Feb 2016 06:22:48 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1M6MmNi041949; Mon, 22 Feb 2016 06:22:48 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1M6MlTm041947; Mon, 22 Feb 2016 06:22:47 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201602220622.u1M6MlTm041947@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Mon, 22 Feb 2016 06:22:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295876 - head/sys/dev/hyperv/netvsc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Feb 2016 06:22:49 -0000 Author: sephe Date: Mon Feb 22 06:22:47 2016 New Revision: 295876 URL: https://svnweb.freebsd.org/changeset/base/295876 Log: hyperv/hn: Staticize and rename packet TX done function It is only used in hv_netvsc_drv_freebsd.c; and rename it to hn_tx_done() mainly to reserve "xmit" for ifnet.if_transmit implement. While I'm here, remove unapplied comment. Reviewed by: adrian Approved by: adrian (mentor) MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D5345 Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.h head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.h ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_net_vsc.h Mon Feb 22 06:17:26 2016 (r295875) +++ head/sys/dev/hyperv/netvsc/hv_net_vsc.h Mon Feb 22 06:22:47 2016 (r295876) @@ -1086,7 +1086,6 @@ typedef struct hn_softc { extern int hv_promisc_mode; void netvsc_linkstatus_callback(struct hv_device *device_obj, uint32_t status); -void netvsc_xmit_completion(void *context); void hv_nv_on_receive_completion(struct hv_device *device, uint64_t tid, uint32_t status); netvsc_dev *hv_nv_on_device_add(struct hv_device *device, Modified: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Mon Feb 22 06:17:26 2016 (r295875) +++ head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Mon Feb 22 06:22:47 2016 (r295876) @@ -653,17 +653,10 @@ hn_txdesc_hold(struct hn_txdesc *txd) atomic_add_int(&txd->refs, 1); } -/* - * Send completion processing - * - * Note: It looks like offset 0 of buf is reserved to hold the softc - * pointer. The sc pointer is not currently needed in this function, and - * it is not presently populated by the TX function. - */ -void -netvsc_xmit_completion(void *context) +static void +hn_tx_done(void *xpkt) { - netvsc_packet *packet = context; + netvsc_packet *packet = xpkt; struct hn_txdesc *txd; struct hn_tx_ring *txr; @@ -905,7 +898,7 @@ done: txd->m = m_head; /* Set the completion routine */ - packet->compl.send.on_send_completion = netvsc_xmit_completion; + packet->compl.send.on_send_completion = hn_tx_done; packet->compl.send.send_completion_context = packet; packet->compl.send.send_completion_tid = (uint64_t)(uintptr_t)txd; From owner-svn-src-head@freebsd.org Mon Feb 22 06:27:16 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EFFBEAB0BAE; Mon, 22 Feb 2016 06:27:16 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail107.syd.optusnet.com.au (mail107.syd.optusnet.com.au [211.29.132.53]) by mx1.freebsd.org (Postfix) with ESMTP id B779D1DF0; Mon, 22 Feb 2016 06:27:16 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from c110-21-41-193.carlnfd1.nsw.optusnet.com.au (c110-21-41-193.carlnfd1.nsw.optusnet.com.au [110.21.41.193]) by mail107.syd.optusnet.com.au (Postfix) with ESMTPS id 52C8FD44F87; Mon, 22 Feb 2016 17:27:15 +1100 (AEDT) Date: Mon, 22 Feb 2016 17:27:15 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Edward Tomasz Napierala cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r295854 - head/bin/dd In-Reply-To: <201602211436.u1LEaokw063705@repo.freebsd.org> Message-ID: <20160222165540.W887@besplex.bde.org> References: <201602211436.u1LEaokw063705@repo.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=EfU1O6SC c=1 sm=1 tr=0 a=73JWPhLeruqQCjN69UNZtQ==:117 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=kj9zAlcOel0A:10 a=0lN02kvMIj7ZGMO8T6wA:9 a=JEOMfYCwILfcGJts:21 a=gc74SzTQ1ZaEyj_F:21 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Feb 2016 06:27:17 -0000 On Sun, 21 Feb 2016, Edward Tomasz Napierala wrote: > Log: > Make the "invalid numeric value" error message actually displayable > (was a dead code before). > > Submitted by: bde@ (earlier version) > Reviewed by: bde@ Thanks. > Modified: > head/bin/dd/args.c > > Modified: head/bin/dd/args.c > ============================================================================== > --- head/bin/dd/args.c Sun Feb 21 13:54:22 2016 (r295853) > +++ head/bin/dd/args.c Sun Feb 21 14:36:50 2016 (r295854) > @@ -422,11 +422,10 @@ get_num(const char *val) > > errno = 0; > num = strtoumax(val, &expr, 0); > - if (errno != 0) /* Overflow or underflow. */ > - err(1, "%s", oper); > - > if (expr == val) /* No valid digits. */ > - errx(1, "%s: illegal numeric value", oper); > + errx(1, "%s: invalid numeric value", oper); > + if (errno != 0) > + err(1, "%s", oper); > > mult = postfix_to_mult(*expr); > > ... This is to avoid the POSIX bug that the strto*() family "helpfully" sets errno for cases not specified by C90, C99 or C11. POSIX requires setting errno to EINVAL if the base is unsupported or no conversion could be performed. The FreeBSD man page says that the conversion error is unportable. The base error is equally unportable, but the man page doesn't mention it. This breaks code like the above which depends on the Standard C bhaviour of only setting errno to ERANGE. The code happens to do a generic check on errno first, and that prevents the more specific handling for a conversion error from being reached. Standard C in general allows errno to be clobbered on success, but for functions that are documented to set errno like the strto*() family, it intends to require only the documented settings. The above code is an example showing that settings to non-Standard C values are little different from gratuitous clobbering. Bruce From owner-svn-src-head@freebsd.org Mon Feb 22 06:28:19 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DEF0BAB0C4B; Mon, 22 Feb 2016 06:28:19 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 982E31F40; Mon, 22 Feb 2016 06:28:19 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1M6SI7T042168; Mon, 22 Feb 2016 06:28:18 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1M6SIEF042166; Mon, 22 Feb 2016 06:28:18 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201602220628.u1M6SIEF042166@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Mon, 22 Feb 2016 06:28:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295877 - head/sys/dev/hyperv/netvsc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Feb 2016 06:28:20 -0000 Author: sephe Date: Mon Feb 22 06:28:18 2016 New Revision: 295877 URL: https://svnweb.freebsd.org/changeset/base/295877 Log: hyperv/hn: Add TX method for txeof processing. Preamble to implement ifnet.if_transmit method. Reviewed by: adrian Approved by: adrian (mentor) MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D5346 Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.h head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.h ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_net_vsc.h Mon Feb 22 06:22:47 2016 (r295876) +++ head/sys/dev/hyperv/netvsc/hv_net_vsc.h Mon Feb 22 06:28:18 2016 (r295877) @@ -1026,9 +1026,10 @@ struct hn_tx_ring { #endif int hn_txdesc_cnt; int hn_txdesc_avail; - int hn_txeof; + int hn_has_txeof; int hn_sched_tx; + void (*hn_txeof)(struct hn_tx_ring *); struct taskqueue *hn_tx_taskq; struct task hn_tx_task; struct task hn_txeof_task; Modified: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Mon Feb 22 06:22:47 2016 (r295876) +++ head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Mon Feb 22 06:28:18 2016 (r295877) @@ -664,7 +664,7 @@ hn_tx_done(void *xpkt) packet->compl.send.send_completion_tid; txr = txd->txr; - txr->hn_txeof = 1; + txr->hn_has_txeof = 1; hn_txdesc_put(txr, txd); } @@ -684,11 +684,11 @@ netvsc_channel_rollup(struct hv_device * } #endif - if (!txr->hn_txeof) + if (!txr->hn_has_txeof) return; - txr->hn_txeof = 0; - hn_start_txeof(txr); + txr->hn_has_txeof = 0; + txr->hn_txeof(txr); } /* @@ -976,12 +976,12 @@ again: * commands to run? Ask netvsc_channel_rollup() * to kick start later. */ - txr->hn_txeof = 1; + txr->hn_has_txeof = 1; if (!send_failed) { txr->hn_send_failed++; send_failed = 1; /* - * Try sending again after set hn_txeof; + * Try sending again after set hn_has_txeof; * in case that we missed the last * netvsc_channel_rollup(). */ @@ -2111,6 +2111,8 @@ hn_create_tx_ring(struct hn_softc *sc, i */ txr->hn_sched_tx = 1; + txr->hn_txeof = hn_start_txeof; /* TODO: if_transmit */ + parent_dtag = bus_get_dma_tag(sc->hn_dev); /* DMA tag for RNDIS messages. */ From owner-svn-src-head@freebsd.org Mon Feb 22 09:02:28 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 897A7AAF0FE; Mon, 22 Feb 2016 09:02:28 +0000 (UTC) (envelope-from skra@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4E47212EB; Mon, 22 Feb 2016 09:02:28 +0000 (UTC) (envelope-from skra@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1M92RYq088450; Mon, 22 Feb 2016 09:02:27 GMT (envelope-from skra@FreeBSD.org) Received: (from skra@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1M92KoN088386; Mon, 22 Feb 2016 09:02:20 GMT (envelope-from skra@FreeBSD.org) Message-Id: <201602220902.u1M92KoN088386@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: skra set sender to skra@FreeBSD.org using -f From: Svatopluk Kraus Date: Mon, 22 Feb 2016 09:02:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295880 - in head: share/man/man9 sys/amd64/cloudabi64 sys/amd64/vmm/amd sys/arm/annapurna/alpine sys/arm/arm sys/arm64/arm64 sys/arm64/cloudabi64 sys/compat/linuxkpi/common/include/lin... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Feb 2016 09:02:28 -0000 Author: skra Date: Mon Feb 22 09:02:20 2016 New Revision: 295880 URL: https://svnweb.freebsd.org/changeset/base/295880 Log: As is included from , there is no need to include it explicitly when is already included. Reviewed by: alc, kib Differential Revision: https://reviews.freebsd.org/D5373 Modified: head/share/man/man9/bios.9 head/sys/amd64/cloudabi64/cloudabi64_sysvec.c head/sys/amd64/vmm/amd/npt.c head/sys/amd64/vmm/amd/svm.c head/sys/arm/annapurna/alpine/alpine_machdep.c head/sys/arm/arm/mp_machdep.c head/sys/arm64/arm64/minidump_machdep.c head/sys/arm64/cloudabi64/cloudabi64_sysvec.c head/sys/compat/linuxkpi/common/include/linux/dma-mapping.h head/sys/compat/linuxkpi/common/include/linux/list.h head/sys/compat/linuxkpi/common/src/linux_compat.c head/sys/compat/linuxkpi/common/src/linux_pci.c head/sys/dev/ce/if_ce.c head/sys/dev/cp/if_cp.c head/sys/dev/drm/drmP.h head/sys/dev/drm2/drmP.h head/sys/dev/fb/machfb.c head/sys/dev/isci/isci_oem_parameters.c head/sys/dev/ntb/if_ntb/if_ntb.c head/sys/dev/ntb/ntb_hw/ntb_hw.c head/sys/dev/pms/freebsd/driver/ini/src/agtiapi.c head/sys/dev/rt/if_rt.c head/sys/dev/siba/siba_pcib.c head/sys/dev/vt/hw/efifb/efifb.c head/sys/i386/bios/mca_machdep.c head/sys/i386/pci/pci_cfgreg.c head/sys/mips/adm5120/admpci.c head/sys/mips/atheros/ar71xx_fixup.c head/sys/mips/atheros/ar71xx_pci.c head/sys/mips/atheros/ar71xx_spi.c head/sys/mips/atheros/ar724x_pci.c head/sys/mips/atheros/if_arge.c head/sys/mips/atheros/qca955x_pci.c head/sys/mips/cavium/cvmx_config.h head/sys/mips/cavium/octopci.c head/sys/mips/idt/idtpci.c head/sys/mips/malta/gt_pci.c head/sys/mips/mips/minidump_machdep.c head/sys/mips/mips/nexus.c head/sys/mips/nlm/xlp_simplebus.c head/sys/mips/rt305x/rt305x_pci.c head/sys/mips/sibyte/sb_zbpci.c head/sys/powerpc/aim/slb.c head/sys/powerpc/ofw/ofw_real.c head/sys/powerpc/ofw/rtas.c head/sys/powerpc/powermac/macgpio.c head/sys/powerpc/powermac/macio.c head/sys/powerpc/powermac/platform_powermac.c head/sys/powerpc/powerpc/genassym.c head/sys/powerpc/powerpc/trap.c head/sys/powerpc/ps3/if_glc.c head/sys/powerpc/ps3/platform_ps3.c head/sys/powerpc/ps3/ps3_syscons.c head/sys/powerpc/ps3/ps3bus.c head/sys/powerpc/ps3/ps3cdrom.c head/sys/powerpc/ps3/ps3disk.c head/sys/powerpc/pseries/platform_chrp.c head/sys/powerpc/psim/iobus.c head/sys/sparc64/pci/fire.c head/sys/sparc64/sparc64/iommu.c head/sys/sparc64/sparc64/tlb.c head/sys/x86/acpica/acpi_wakeup.c head/sys/x86/x86/nexus.c Modified: head/share/man/man9/bios.9 ============================================================================== --- head/share/man/man9/bios.9 Mon Feb 22 08:22:08 2016 (r295879) +++ head/share/man/man9/bios.9 Mon Feb 22 09:02:20 2016 (r295880) @@ -38,7 +38,6 @@ .In vm/vm.h .In vm/pmap.h .In machine/param.h -.In machine/pmap.h .In machine/pc/bios.h .Ft uint32_t .Fn bios_sigsearch "uint32_t start" "u_char *sig" "int siglen" "int paralen" "int sigofs" Modified: head/sys/amd64/cloudabi64/cloudabi64_sysvec.c ============================================================================== --- head/sys/amd64/cloudabi64/cloudabi64_sysvec.c Mon Feb 22 08:22:08 2016 (r295879) +++ head/sys/amd64/cloudabi64/cloudabi64_sysvec.c Mon Feb 22 09:02:20 2016 (r295880) @@ -36,7 +36,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include Modified: head/sys/amd64/vmm/amd/npt.c ============================================================================== --- head/sys/amd64/vmm/amd/npt.c Mon Feb 22 08:22:08 2016 (r295879) +++ head/sys/amd64/vmm/amd/npt.c Mon Feb 22 09:02:20 2016 (r295880) @@ -36,8 +36,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include - #include "npt.h" SYSCTL_DECL(_hw_vmm); Modified: head/sys/amd64/vmm/amd/svm.c ============================================================================== --- head/sys/amd64/vmm/amd/svm.c Mon Feb 22 08:22:08 2016 (r295879) +++ head/sys/amd64/vmm/amd/svm.c Mon Feb 22 09:02:20 2016 (r295880) @@ -41,7 +41,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include #include Modified: head/sys/arm/annapurna/alpine/alpine_machdep.c ============================================================================== --- head/sys/arm/annapurna/alpine/alpine_machdep.c Mon Feb 22 08:22:08 2016 (r295879) +++ head/sys/arm/annapurna/alpine/alpine_machdep.c Mon Feb 22 09:02:20 2016 (r295880) @@ -42,7 +42,6 @@ __FBSDID("$FreeBSD$"); #include #include /* For trapframe_t, used in */ #include -#include #include #include #include Modified: head/sys/arm/arm/mp_machdep.c ============================================================================== --- head/sys/arm/arm/mp_machdep.c Mon Feb 22 08:22:08 2016 (r295879) +++ head/sys/arm/arm/mp_machdep.c Mon Feb 22 09:02:20 2016 (r295880) @@ -50,7 +50,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include Modified: head/sys/arm64/arm64/minidump_machdep.c ============================================================================== --- head/sys/arm64/arm64/minidump_machdep.c Mon Feb 22 08:22:08 2016 (r295879) +++ head/sys/arm64/arm64/minidump_machdep.c Mon Feb 22 09:02:20 2016 (r295880) @@ -52,7 +52,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include #include Modified: head/sys/arm64/cloudabi64/cloudabi64_sysvec.c ============================================================================== --- head/sys/arm64/cloudabi64/cloudabi64_sysvec.c Mon Feb 22 08:22:08 2016 (r295879) +++ head/sys/arm64/cloudabi64/cloudabi64_sysvec.c Mon Feb 22 09:02:20 2016 (r295880) @@ -36,7 +36,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include Modified: head/sys/compat/linuxkpi/common/include/linux/dma-mapping.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/dma-mapping.h Mon Feb 22 08:22:08 2016 (r295879) +++ head/sys/compat/linuxkpi/common/include/linux/dma-mapping.h Mon Feb 22 09:02:20 2016 (r295880) @@ -47,7 +47,6 @@ #include #include -#include enum dma_data_direction { DMA_BIDIRECTIONAL = 0, Modified: head/sys/compat/linuxkpi/common/include/linux/list.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/list.h Mon Feb 22 08:22:08 2016 (r295879) +++ head/sys/compat/linuxkpi/common/include/linux/list.h Mon Feb 22 09:02:20 2016 (r295880) @@ -68,7 +68,6 @@ #include #include #include -#include #define prefetch(x) Modified: head/sys/compat/linuxkpi/common/src/linux_compat.c ============================================================================== --- head/sys/compat/linuxkpi/common/src/linux_compat.c Mon Feb 22 08:22:08 2016 (r295879) +++ head/sys/compat/linuxkpi/common/src/linux_compat.c Mon Feb 22 09:02:20 2016 (r295880) @@ -50,7 +50,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include Modified: head/sys/compat/linuxkpi/common/src/linux_pci.c ============================================================================== --- head/sys/compat/linuxkpi/common/src/linux_pci.c Mon Feb 22 08:22:08 2016 (r295879) +++ head/sys/compat/linuxkpi/common/src/linux_pci.c Mon Feb 22 09:02:20 2016 (r295880) @@ -44,7 +44,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include Modified: head/sys/dev/ce/if_ce.c ============================================================================== --- head/sys/dev/ce/if_ce.c Mon Feb 22 08:22:08 2016 (r295879) +++ head/sys/dev/ce/if_ce.c Mon Feb 22 09:02:20 2016 (r295880) @@ -76,7 +76,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include /* If we don't have Cronyx's sppp version, we don't have fr support via sppp */ #ifndef PP_FR Modified: head/sys/dev/cp/if_cp.c ============================================================================== --- head/sys/dev/cp/if_cp.c Mon Feb 22 08:22:08 2016 (r295879) +++ head/sys/dev/cp/if_cp.c Mon Feb 22 09:02:20 2016 (r295880) @@ -67,7 +67,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include /* If we don't have Cronyx's sppp version, we don't have fr support via sppp */ #ifndef PP_FR Modified: head/sys/dev/drm/drmP.h ============================================================================== --- head/sys/dev/drm/drmP.h Mon Feb 22 08:22:08 2016 (r295879) +++ head/sys/dev/drm/drmP.h Mon Feb 22 09:02:20 2016 (r295880) @@ -76,7 +76,6 @@ struct drm_file; #include #include #include -#include #include #include #if defined(__i386__) || defined(__amd64__) Modified: head/sys/dev/drm2/drmP.h ============================================================================== --- head/sys/dev/drm2/drmP.h Mon Feb 22 08:22:08 2016 (r295879) +++ head/sys/dev/drm2/drmP.h Mon Feb 22 09:02:20 2016 (r295880) @@ -77,7 +77,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #if defined(__i386__) || defined(__amd64__) Modified: head/sys/dev/fb/machfb.c ============================================================================== --- head/sys/dev/fb/machfb.c Mon Feb 22 08:22:08 2016 (r295879) +++ head/sys/dev/fb/machfb.c Mon Feb 22 09:02:20 2016 (r295880) @@ -56,7 +56,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include Modified: head/sys/dev/isci/isci_oem_parameters.c ============================================================================== --- head/sys/dev/isci/isci_oem_parameters.c Mon Feb 22 08:22:08 2016 (r295879) +++ head/sys/dev/isci/isci_oem_parameters.c Mon Feb 22 09:02:20 2016 (r295880) @@ -34,7 +34,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include Modified: head/sys/dev/ntb/if_ntb/if_ntb.c ============================================================================== --- head/sys/dev/ntb/if_ntb/if_ntb.c Mon Feb 22 08:22:08 2016 (r295879) +++ head/sys/dev/ntb/if_ntb/if_ntb.c Mon Feb 22 09:02:20 2016 (r295880) @@ -57,7 +57,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include Modified: head/sys/dev/ntb/ntb_hw/ntb_hw.c ============================================================================== --- head/sys/dev/ntb/ntb_hw/ntb_hw.c Mon Feb 22 08:22:08 2016 (r295879) +++ head/sys/dev/ntb/ntb_hw/ntb_hw.c Mon Feb 22 09:02:20 2016 (r295880) @@ -45,7 +45,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include Modified: head/sys/dev/pms/freebsd/driver/ini/src/agtiapi.c ============================================================================== --- head/sys/dev/pms/freebsd/driver/ini/src/agtiapi.c Mon Feb 22 08:22:08 2016 (r295879) +++ head/sys/dev/pms/freebsd/driver/ini/src/agtiapi.c Mon Feb 22 09:02:20 2016 (r295880) @@ -43,7 +43,6 @@ __FBSDID("$FreeBSD$"); #include #include // 1. for vtophys #include // 2. for vtophys -#include // 3. for vtophys (yes, three) #include // For pci_get macros #include #include Modified: head/sys/dev/rt/if_rt.c ============================================================================== --- head/sys/dev/rt/if_rt.c Mon Feb 22 08:22:08 2016 (r295879) +++ head/sys/dev/rt/if_rt.c Mon Feb 22 09:02:20 2016 (r295880) @@ -54,7 +54,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include Modified: head/sys/dev/siba/siba_pcib.c ============================================================================== --- head/sys/dev/siba/siba_pcib.c Mon Feb 22 08:22:08 2016 (r295879) +++ head/sys/dev/siba/siba_pcib.c Mon Feb 22 09:02:20 2016 (r295880) @@ -47,7 +47,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include Modified: head/sys/dev/vt/hw/efifb/efifb.c ============================================================================== --- head/sys/dev/vt/hw/efifb/efifb.c Mon Feb 22 08:22:08 2016 (r295879) +++ head/sys/dev/vt/hw/efifb/efifb.c Mon Feb 22 09:02:20 2016 (r295880) @@ -43,7 +43,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include Modified: head/sys/i386/bios/mca_machdep.c ============================================================================== --- head/sys/i386/bios/mca_machdep.c Mon Feb 22 08:22:08 2016 (r295879) +++ head/sys/i386/bios/mca_machdep.c Mon Feb 22 09:02:20 2016 (r295880) @@ -33,7 +33,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include Modified: head/sys/i386/pci/pci_cfgreg.c ============================================================================== --- head/sys/i386/pci/pci_cfgreg.c Mon Feb 22 08:22:08 2016 (r295879) +++ head/sys/i386/pci/pci_cfgreg.c Mon Feb 22 09:02:20 2016 (r295880) @@ -51,7 +51,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #ifdef XBOX #include Modified: head/sys/mips/adm5120/admpci.c ============================================================================== --- head/sys/mips/adm5120/admpci.c Mon Feb 22 08:22:08 2016 (r295879) +++ head/sys/mips/adm5120/admpci.c Mon Feb 22 09:02:20 2016 (r295880) @@ -79,7 +79,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include Modified: head/sys/mips/atheros/ar71xx_fixup.c ============================================================================== --- head/sys/mips/atheros/ar71xx_fixup.c Mon Feb 22 08:22:08 2016 (r295879) +++ head/sys/mips/atheros/ar71xx_fixup.c Mon Feb 22 09:02:20 2016 (r295880) @@ -49,7 +49,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include Modified: head/sys/mips/atheros/ar71xx_pci.c ============================================================================== --- head/sys/mips/atheros/ar71xx_pci.c Mon Feb 22 08:22:08 2016 (r295879) +++ head/sys/mips/atheros/ar71xx_pci.c Mon Feb 22 09:02:20 2016 (r295880) @@ -49,7 +49,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include Modified: head/sys/mips/atheros/ar71xx_spi.c ============================================================================== --- head/sys/mips/atheros/ar71xx_spi.c Mon Feb 22 08:22:08 2016 (r295879) +++ head/sys/mips/atheros/ar71xx_spi.c Mon Feb 22 09:02:20 2016 (r295880) @@ -44,7 +44,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include Modified: head/sys/mips/atheros/ar724x_pci.c ============================================================================== --- head/sys/mips/atheros/ar724x_pci.c Mon Feb 22 08:22:08 2016 (r295879) +++ head/sys/mips/atheros/ar724x_pci.c Mon Feb 22 09:02:20 2016 (r295880) @@ -48,7 +48,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include Modified: head/sys/mips/atheros/if_arge.c ============================================================================== --- head/sys/mips/atheros/if_arge.c Mon Feb 22 08:22:08 2016 (r295879) +++ head/sys/mips/atheros/if_arge.c Mon Feb 22 09:02:20 2016 (r295880) @@ -65,7 +65,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include Modified: head/sys/mips/atheros/qca955x_pci.c ============================================================================== --- head/sys/mips/atheros/qca955x_pci.c Mon Feb 22 08:22:08 2016 (r295879) +++ head/sys/mips/atheros/qca955x_pci.c Mon Feb 22 09:02:20 2016 (r295880) @@ -49,7 +49,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include Modified: head/sys/mips/cavium/cvmx_config.h ============================================================================== --- head/sys/mips/cavium/cvmx_config.h Mon Feb 22 08:22:08 2016 (r295879) +++ head/sys/mips/cavium/cvmx_config.h Mon Feb 22 09:02:20 2016 (r295880) @@ -50,7 +50,6 @@ #include #include -#include #include #define asm __asm Modified: head/sys/mips/cavium/octopci.c ============================================================================== --- head/sys/mips/cavium/octopci.c Mon Feb 22 08:22:08 2016 (r295879) +++ head/sys/mips/cavium/octopci.c Mon Feb 22 09:02:20 2016 (r295880) @@ -46,7 +46,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include Modified: head/sys/mips/idt/idtpci.c ============================================================================== --- head/sys/mips/idt/idtpci.c Mon Feb 22 08:22:08 2016 (r295879) +++ head/sys/mips/idt/idtpci.c Mon Feb 22 09:02:20 2016 (r295880) @@ -80,7 +80,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include Modified: head/sys/mips/malta/gt_pci.c ============================================================================== --- head/sys/mips/malta/gt_pci.c Mon Feb 22 08:22:08 2016 (r295879) +++ head/sys/mips/malta/gt_pci.c Mon Feb 22 09:02:20 2016 (r295880) @@ -59,7 +59,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include Modified: head/sys/mips/mips/minidump_machdep.c ============================================================================== --- head/sys/mips/mips/minidump_machdep.c Mon Feb 22 08:22:08 2016 (r295879) +++ head/sys/mips/mips/minidump_machdep.c Mon Feb 22 09:02:20 2016 (r295880) @@ -39,7 +39,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include Modified: head/sys/mips/mips/nexus.c ============================================================================== --- head/sys/mips/mips/nexus.c Mon Feb 22 08:22:08 2016 (r295879) +++ head/sys/mips/mips/nexus.c Mon Feb 22 09:02:20 2016 (r295880) @@ -54,7 +54,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include Modified: head/sys/mips/nlm/xlp_simplebus.c ============================================================================== --- head/sys/mips/nlm/xlp_simplebus.c Mon Feb 22 08:22:08 2016 (r295879) +++ head/sys/mips/nlm/xlp_simplebus.c Mon Feb 22 09:02:20 2016 (r295880) @@ -41,7 +41,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include Modified: head/sys/mips/rt305x/rt305x_pci.c ============================================================================== --- head/sys/mips/rt305x/rt305x_pci.c Mon Feb 22 08:22:08 2016 (r295879) +++ head/sys/mips/rt305x/rt305x_pci.c Mon Feb 22 09:02:20 2016 (r295880) @@ -54,7 +54,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include Modified: head/sys/mips/sibyte/sb_zbpci.c ============================================================================== --- head/sys/mips/sibyte/sb_zbpci.c Mon Feb 22 08:22:08 2016 (r295879) +++ head/sys/mips/sibyte/sb_zbpci.c Mon Feb 22 09:02:20 2016 (r295880) @@ -44,7 +44,6 @@ #include #include -#include #include #include Modified: head/sys/powerpc/aim/slb.c ============================================================================== --- head/sys/powerpc/aim/slb.c Mon Feb 22 08:22:08 2016 (r295879) +++ head/sys/powerpc/aim/slb.c Mon Feb 22 09:02:20 2016 (r295880) @@ -44,7 +44,6 @@ #include #include -#include #include uintptr_t moea64_get_unique_vsid(void); Modified: head/sys/powerpc/ofw/ofw_real.c ============================================================================== --- head/sys/powerpc/ofw/ofw_real.c Mon Feb 22 08:22:08 2016 (r295879) +++ head/sys/powerpc/ofw/ofw_real.c Mon Feb 22 09:02:20 2016 (r295880) @@ -71,7 +71,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include Modified: head/sys/powerpc/ofw/rtas.c ============================================================================== --- head/sys/powerpc/ofw/rtas.c Mon Feb 22 08:22:08 2016 (r295879) +++ head/sys/powerpc/ofw/rtas.c Mon Feb 22 09:02:20 2016 (r295880) @@ -41,7 +41,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include Modified: head/sys/powerpc/powermac/macgpio.c ============================================================================== --- head/sys/powerpc/powermac/macgpio.c Mon Feb 22 08:22:08 2016 (r295879) +++ head/sys/powerpc/powermac/macgpio.c Mon Feb 22 09:02:20 2016 (r295880) @@ -42,7 +42,6 @@ #include #include -#include #include #include Modified: head/sys/powerpc/powermac/macio.c ============================================================================== --- head/sys/powerpc/powermac/macio.c Mon Feb 22 08:22:08 2016 (r295879) +++ head/sys/powerpc/powermac/macio.c Mon Feb 22 09:02:20 2016 (r295880) @@ -44,7 +44,6 @@ #include #include -#include #include #include Modified: head/sys/powerpc/powermac/platform_powermac.c ============================================================================== --- head/sys/powerpc/powermac/platform_powermac.c Mon Feb 22 08:22:08 2016 (r295879) +++ head/sys/powerpc/powermac/platform_powermac.c Mon Feb 22 09:02:20 2016 (r295880) @@ -44,7 +44,6 @@ __FBSDID("$FreeBSD$"); #include /* For save_fpu() */ #include #include -#include #include #include #include Modified: head/sys/powerpc/powerpc/genassym.c ============================================================================== --- head/sys/powerpc/powerpc/genassym.c Mon Feb 22 08:22:08 2016 (r295879) +++ head/sys/powerpc/powerpc/genassym.c Mon Feb 22 09:02:20 2016 (r295880) @@ -52,7 +52,6 @@ #include #include -#include #include #include Modified: head/sys/powerpc/powerpc/trap.c ============================================================================== --- head/sys/powerpc/powerpc/trap.c Mon Feb 22 08:22:08 2016 (r295879) +++ head/sys/powerpc/powerpc/trap.c Mon Feb 22 09:02:20 2016 (r295880) @@ -68,7 +68,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include Modified: head/sys/powerpc/ps3/if_glc.c ============================================================================== --- head/sys/powerpc/ps3/if_glc.c Mon Feb 22 08:22:08 2016 (r295879) +++ head/sys/powerpc/ps3/if_glc.c Mon Feb 22 09:02:20 2016 (r295880) @@ -51,7 +51,6 @@ #include #include #include -#include #include #include #include Modified: head/sys/powerpc/ps3/platform_ps3.c ============================================================================== --- head/sys/powerpc/ps3/platform_ps3.c Mon Feb 22 08:22:08 2016 (r295879) +++ head/sys/powerpc/ps3/platform_ps3.c Mon Feb 22 09:02:20 2016 (r295880) @@ -44,7 +44,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include Modified: head/sys/powerpc/ps3/ps3_syscons.c ============================================================================== --- head/sys/powerpc/ps3/ps3_syscons.c Mon Feb 22 08:22:08 2016 (r295879) +++ head/sys/powerpc/ps3/ps3_syscons.c Mon Feb 22 09:02:20 2016 (r295880) @@ -40,7 +40,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include Modified: head/sys/powerpc/ps3/ps3bus.c ============================================================================== --- head/sys/powerpc/ps3/ps3bus.c Mon Feb 22 08:22:08 2016 (r295879) +++ head/sys/powerpc/ps3/ps3bus.c Mon Feb 22 09:02:20 2016 (r295880) @@ -43,7 +43,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include "ps3bus.h" Modified: head/sys/powerpc/ps3/ps3cdrom.c ============================================================================== --- head/sys/powerpc/ps3/ps3cdrom.c Mon Feb 22 08:22:08 2016 (r295879) +++ head/sys/powerpc/ps3/ps3cdrom.c Mon Feb 22 09:02:20 2016 (r295880) @@ -46,7 +46,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include Modified: head/sys/powerpc/ps3/ps3disk.c ============================================================================== --- head/sys/powerpc/ps3/ps3disk.c Mon Feb 22 08:22:08 2016 (r295879) +++ head/sys/powerpc/ps3/ps3disk.c Mon Feb 22 09:02:20 2016 (r295880) @@ -47,7 +47,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include Modified: head/sys/powerpc/pseries/platform_chrp.c ============================================================================== --- head/sys/powerpc/pseries/platform_chrp.c Mon Feb 22 08:22:08 2016 (r295879) +++ head/sys/powerpc/pseries/platform_chrp.c Mon Feb 22 09:02:20 2016 (r295880) @@ -42,7 +42,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include Modified: head/sys/powerpc/psim/iobus.c ============================================================================== --- head/sys/powerpc/psim/iobus.c Mon Feb 22 08:22:08 2016 (r295879) +++ head/sys/powerpc/psim/iobus.c Mon Feb 22 09:02:20 2016 (r295880) @@ -50,7 +50,6 @@ #include #include #include -#include #include Modified: head/sys/sparc64/pci/fire.c ============================================================================== --- head/sys/sparc64/pci/fire.c Mon Feb 22 08:22:08 2016 (r295879) +++ head/sys/sparc64/pci/fire.c Mon Feb 22 09:02:20 2016 (r295880) @@ -69,7 +69,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include Modified: head/sys/sparc64/sparc64/iommu.c ============================================================================== --- head/sys/sparc64/sparc64/iommu.c Mon Feb 22 08:22:08 2016 (r295879) +++ head/sys/sparc64/sparc64/iommu.c Mon Feb 22 09:02:20 2016 (r295880) @@ -101,7 +101,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include Modified: head/sys/sparc64/sparc64/tlb.c ============================================================================== --- head/sys/sparc64/sparc64/tlb.c Mon Feb 22 08:22:08 2016 (r295879) +++ head/sys/sparc64/sparc64/tlb.c Mon Feb 22 09:02:20 2016 (r295880) @@ -41,7 +41,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include #include Modified: head/sys/x86/acpica/acpi_wakeup.c ============================================================================== --- head/sys/x86/acpica/acpi_wakeup.c Mon Feb 22 08:22:08 2016 (r295879) +++ head/sys/x86/acpica/acpi_wakeup.c Mon Feb 22 09:02:20 2016 (r295880) @@ -56,7 +56,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include Modified: head/sys/x86/x86/nexus.c ============================================================================== --- head/sys/x86/x86/nexus.c Mon Feb 22 08:22:08 2016 (r295879) +++ head/sys/x86/x86/nexus.c Mon Feb 22 09:02:20 2016 (r295880) @@ -63,7 +63,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include From owner-svn-src-head@freebsd.org Mon Feb 22 09:04:39 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 92239AAF1F8; Mon, 22 Feb 2016 09:04:39 +0000 (UTC) (envelope-from skra@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6A1CD14EA; Mon, 22 Feb 2016 09:04:39 +0000 (UTC) (envelope-from skra@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1M94c0u088572; Mon, 22 Feb 2016 09:04:38 GMT (envelope-from skra@FreeBSD.org) Received: (from skra@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1M94bWQ088559; Mon, 22 Feb 2016 09:04:37 GMT (envelope-from skra@FreeBSD.org) Message-Id: <201602220904.u1M94bWQ088559@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: skra set sender to skra@FreeBSD.org using -f From: Svatopluk Kraus Date: Mon, 22 Feb 2016 09:04:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295881 - in head: lib/libvmmapi share/man/man9 sys/arm/arm sys/arm64/arm64 sys/dev/drm sys/dev/drm2 sys/mips/mips sys/mips/nlm sys/mips/nlm/dev/net sys/mips/rmi sys/mips/rmi/dev/nlge X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Feb 2016 09:04:39 -0000 Author: skra Date: Mon Feb 22 09:04:36 2016 New Revision: 295881 URL: https://svnweb.freebsd.org/changeset/base/295881 Log: As is included from , there is no need to include it explicitly when is already included. Reviewed by: alc, kib Differential Revision: https://reviews.freebsd.org/D5378 Modified: head/lib/libvmmapi/vmmapi.c head/share/man/man9/bios.9 head/sys/arm/arm/debug_monitor.c head/sys/arm64/arm64/debug_monitor.c head/sys/dev/drm/drmP.h head/sys/dev/drm2/drmP.h head/sys/mips/mips/stack_machdep.c head/sys/mips/nlm/cms.c head/sys/mips/nlm/dev/net/xlpge.c head/sys/mips/rmi/dev/nlge/if_nlge.c head/sys/mips/rmi/fmn.c head/sys/mips/rmi/iodi.c Modified: head/lib/libvmmapi/vmmapi.c ============================================================================== --- head/lib/libvmmapi/vmmapi.c Mon Feb 22 09:02:20 2016 (r295880) +++ head/lib/libvmmapi/vmmapi.c Mon Feb 22 09:04:36 2016 (r295881) @@ -38,7 +38,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include Modified: head/share/man/man9/bios.9 ============================================================================== --- head/share/man/man9/bios.9 Mon Feb 22 09:02:20 2016 (r295880) +++ head/share/man/man9/bios.9 Mon Feb 22 09:04:36 2016 (r295881) @@ -37,7 +37,6 @@ .In sys/param.h .In vm/vm.h .In vm/pmap.h -.In machine/param.h .In machine/pc/bios.h .Ft uint32_t .Fn bios_sigsearch "uint32_t start" "u_char *sig" "int siglen" "int paralen" "int sigofs" Modified: head/sys/arm/arm/debug_monitor.c ============================================================================== --- head/sys/arm/arm/debug_monitor.c Mon Feb 22 09:02:20 2016 (r295880) +++ head/sys/arm/arm/debug_monitor.c Mon Feb 22 09:04:36 2016 (r295881) @@ -43,7 +43,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include Modified: head/sys/arm64/arm64/debug_monitor.c ============================================================================== --- head/sys/arm64/arm64/debug_monitor.c Mon Feb 22 09:02:20 2016 (r295880) +++ head/sys/arm64/arm64/debug_monitor.c Mon Feb 22 09:04:36 2016 (r295881) @@ -40,7 +40,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include Modified: head/sys/dev/drm/drmP.h ============================================================================== --- head/sys/dev/drm/drmP.h Mon Feb 22 09:02:20 2016 (r295880) +++ head/sys/dev/drm/drmP.h Mon Feb 22 09:04:36 2016 (r295881) @@ -75,7 +75,6 @@ struct drm_file; #include #include #include -#include #include #include #if defined(__i386__) || defined(__amd64__) Modified: head/sys/dev/drm2/drmP.h ============================================================================== --- head/sys/dev/drm2/drmP.h Mon Feb 22 09:02:20 2016 (r295880) +++ head/sys/dev/drm2/drmP.h Mon Feb 22 09:04:36 2016 (r295881) @@ -76,7 +76,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #if defined(__i386__) || defined(__amd64__) Modified: head/sys/mips/mips/stack_machdep.c ============================================================================== --- head/sys/mips/mips/stack_machdep.c Mon Feb 22 09:02:20 2016 (r295880) +++ head/sys/mips/mips/stack_machdep.c Mon Feb 22 09:04:36 2016 (r295881) @@ -35,7 +35,6 @@ __FBSDID("$FreeBSD$"); #include -#include #include #include Modified: head/sys/mips/nlm/cms.c ============================================================================== --- head/sys/mips/nlm/cms.c Mon Feb 22 09:02:20 2016 (r295880) +++ head/sys/mips/nlm/cms.c Mon Feb 22 09:04:36 2016 (r295881) @@ -53,7 +53,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include Modified: head/sys/mips/nlm/dev/net/xlpge.c ============================================================================== --- head/sys/mips/nlm/dev/net/xlpge.c Mon Feb 22 09:02:20 2016 (r295880) +++ head/sys/mips/nlm/dev/net/xlpge.c Mon Feb 22 09:04:36 2016 (r295881) @@ -72,7 +72,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include /* for DELAY */ #include Modified: head/sys/mips/rmi/dev/nlge/if_nlge.c ============================================================================== --- head/sys/mips/rmi/dev/nlge/if_nlge.c Mon Feb 22 09:02:20 2016 (r295880) +++ head/sys/mips/rmi/dev/nlge/if_nlge.c Mon Feb 22 09:04:36 2016 (r295881) @@ -94,7 +94,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include /* for DELAY */ #include Modified: head/sys/mips/rmi/fmn.c ============================================================================== --- head/sys/mips/rmi/fmn.c Mon Feb 22 09:02:20 2016 (r295880) +++ head/sys/mips/rmi/fmn.c Mon Feb 22 09:04:36 2016 (r295881) @@ -53,7 +53,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include #include Modified: head/sys/mips/rmi/iodi.c ============================================================================== --- head/sys/mips/rmi/iodi.c Mon Feb 22 09:02:20 2016 (r295880) +++ head/sys/mips/rmi/iodi.c Mon Feb 22 09:04:36 2016 (r295881) @@ -48,7 +48,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include /* for DELAY */ #include From owner-svn-src-head@freebsd.org Mon Feb 22 09:08:08 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E9DCCAAF34A; Mon, 22 Feb 2016 09:08:07 +0000 (UTC) (envelope-from skra@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C20FF184A; Mon, 22 Feb 2016 09:08:07 +0000 (UTC) (envelope-from skra@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1M9860E088748; Mon, 22 Feb 2016 09:08:06 GMT (envelope-from skra@FreeBSD.org) Received: (from skra@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1M9848P088730; Mon, 22 Feb 2016 09:08:05 GMT (envelope-from skra@FreeBSD.org) Message-Id: <201602220908.u1M9848P088730@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: skra set sender to skra@FreeBSD.org using -f From: Svatopluk Kraus Date: Mon, 22 Feb 2016 09:08:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295882 - in head/sys: amd64/amd64 amd64/vmm arm/arm arm64/arm64 cddl/dev/dtrace/aarch64 cddl/dev/dtrace/arm cddl/dev/dtrace/mips compat/linux compat/svr4 dev/hyperv/netvsc riscv/riscv X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Feb 2016 09:08:08 -0000 Author: skra Date: Mon Feb 22 09:08:04 2016 New Revision: 295882 URL: https://svnweb.freebsd.org/changeset/base/295882 Log: As is included from , there is no need to include it explicitly when is already included. Suggested by: alc Reviewed by: alc Differential Revision: https://reviews.freebsd.org/D5379 Modified: head/sys/amd64/amd64/minidump_machdep.c head/sys/amd64/vmm/vmm.c head/sys/arm/arm/genassym.c head/sys/arm/arm/pmap-v6.c head/sys/arm/arm/trap-v6.c head/sys/arm64/arm64/minidump_machdep.c head/sys/arm64/arm64/trap.c head/sys/cddl/dev/dtrace/aarch64/dtrace_isa.c head/sys/cddl/dev/dtrace/arm/dtrace_isa.c head/sys/cddl/dev/dtrace/mips/dtrace_isa.c head/sys/compat/linux/linux_util.h head/sys/compat/svr4/svr4_misc.c head/sys/compat/svr4/svr4_util.h head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c head/sys/riscv/riscv/genassym.c head/sys/riscv/riscv/minidump_machdep.c head/sys/riscv/riscv/trap.c Modified: head/sys/amd64/amd64/minidump_machdep.c ============================================================================== --- head/sys/amd64/amd64/minidump_machdep.c Mon Feb 22 09:04:36 2016 (r295881) +++ head/sys/amd64/amd64/minidump_machdep.c Mon Feb 22 09:08:04 2016 (r295882) @@ -46,7 +46,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include CTASSERT(sizeof(struct kerneldumpheader) == 512); Modified: head/sys/amd64/vmm/vmm.c ============================================================================== --- head/sys/amd64/vmm/vmm.c Mon Feb 22 09:04:36 2016 (r295881) +++ head/sys/amd64/vmm/vmm.c Mon Feb 22 09:08:04 2016 (r295882) @@ -58,7 +58,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include Modified: head/sys/arm/arm/genassym.c ============================================================================== --- head/sys/arm/arm/genassym.c Mon Feb 22 09:04:36 2016 (r295881) +++ head/sys/arm/arm/genassym.c Mon Feb 22 09:08:04 2016 (r295882) @@ -40,7 +40,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include #include Modified: head/sys/arm/arm/pmap-v6.c ============================================================================== --- head/sys/arm/arm/pmap-v6.c Mon Feb 22 09:04:36 2016 (r295881) +++ head/sys/arm/arm/pmap-v6.c Mon Feb 22 09:08:04 2016 (r295882) @@ -121,7 +121,6 @@ __FBSDID("$FreeBSD$"); #endif #include -#include #include #include Modified: head/sys/arm/arm/trap-v6.c ============================================================================== --- head/sys/arm/arm/trap-v6.c Mon Feb 22 09:04:36 2016 (r295881) +++ head/sys/arm/arm/trap-v6.c Mon Feb 22 09:08:04 2016 (r295882) @@ -58,7 +58,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #ifdef KDB #include Modified: head/sys/arm64/arm64/minidump_machdep.c ============================================================================== --- head/sys/arm64/arm64/minidump_machdep.c Mon Feb 22 09:04:36 2016 (r295881) +++ head/sys/arm64/arm64/minidump_machdep.c Mon Feb 22 09:08:04 2016 (r295882) @@ -53,7 +53,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include CTASSERT(sizeof(struct kerneldumpheader) == 512); Modified: head/sys/arm64/arm64/trap.c ============================================================================== --- head/sys/arm64/arm64/trap.c Mon Feb 22 09:04:36 2016 (r295881) +++ head/sys/arm64/arm64/trap.c Mon Feb 22 09:08:04 2016 (r295882) @@ -52,7 +52,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #ifdef KDTRACE_HOOKS #include Modified: head/sys/cddl/dev/dtrace/aarch64/dtrace_isa.c ============================================================================== --- head/sys/cddl/dev/dtrace/aarch64/dtrace_isa.c Mon Feb 22 09:04:36 2016 (r295881) +++ head/sys/cddl/dev/dtrace/aarch64/dtrace_isa.c Mon Feb 22 09:08:04 2016 (r295882) @@ -44,7 +44,6 @@ #include #include #include -#include #include #include #include Modified: head/sys/cddl/dev/dtrace/arm/dtrace_isa.c ============================================================================== --- head/sys/cddl/dev/dtrace/arm/dtrace_isa.c Mon Feb 22 09:04:36 2016 (r295881) +++ head/sys/cddl/dev/dtrace/arm/dtrace_isa.c Mon Feb 22 09:08:04 2016 (r295882) @@ -44,7 +44,6 @@ #include #include #include -#include #include #include #include Modified: head/sys/cddl/dev/dtrace/mips/dtrace_isa.c ============================================================================== --- head/sys/cddl/dev/dtrace/mips/dtrace_isa.c Mon Feb 22 09:04:36 2016 (r295881) +++ head/sys/cddl/dev/dtrace/mips/dtrace_isa.c Mon Feb 22 09:08:04 2016 (r295882) @@ -44,7 +44,6 @@ #include #include #include -#include #include #include #include Modified: head/sys/compat/linux/linux_util.h ============================================================================== --- head/sys/compat/linux/linux_util.h Mon Feb 22 09:04:36 2016 (r295881) +++ head/sys/compat/linux/linux_util.h Mon Feb 22 09:08:04 2016 (r295882) @@ -37,7 +37,6 @@ #include #include #include -#include #include #include #include Modified: head/sys/compat/svr4/svr4_misc.c ============================================================================== --- head/sys/compat/svr4/svr4_misc.c Mon Feb 22 09:04:36 2016 (r295881) +++ head/sys/compat/svr4/svr4_misc.c Mon Feb 22 09:08:04 2016 (r295882) @@ -84,7 +84,6 @@ __FBSDID("$FreeBSD$"); #include -#include #include #include #include Modified: head/sys/compat/svr4/svr4_util.h ============================================================================== --- head/sys/compat/svr4/svr4_util.h Mon Feb 22 09:04:36 2016 (r295881) +++ head/sys/compat/svr4/svr4_util.h Mon Feb 22 09:08:04 2016 (r295882) @@ -35,7 +35,6 @@ #include #include #include -#include #include #include #include Modified: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Mon Feb 22 09:04:36 2016 (r295881) +++ head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Mon Feb 22 09:08:04 2016 (r295882) @@ -100,7 +100,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include Modified: head/sys/riscv/riscv/genassym.c ============================================================================== --- head/sys/riscv/riscv/genassym.c Mon Feb 22 09:04:36 2016 (r295881) +++ head/sys/riscv/riscv/genassym.c Mon Feb 22 09:08:04 2016 (r295882) @@ -47,7 +47,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include #include Modified: head/sys/riscv/riscv/minidump_machdep.c ============================================================================== --- head/sys/riscv/riscv/minidump_machdep.c Mon Feb 22 09:04:36 2016 (r295881) +++ head/sys/riscv/riscv/minidump_machdep.c Mon Feb 22 09:08:04 2016 (r295882) @@ -45,7 +45,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include CTASSERT(sizeof(struct kerneldumpheader) == 512); Modified: head/sys/riscv/riscv/trap.c ============================================================================== --- head/sys/riscv/riscv/trap.c Mon Feb 22 09:04:36 2016 (r295881) +++ head/sys/riscv/riscv/trap.c Mon Feb 22 09:08:04 2016 (r295882) @@ -57,7 +57,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include From owner-svn-src-head@freebsd.org Mon Feb 22 09:10:25 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3BF91AAF41B; Mon, 22 Feb 2016 09:10:25 +0000 (UTC) (envelope-from skra@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EEC1A1A2D; Mon, 22 Feb 2016 09:10:24 +0000 (UTC) (envelope-from skra@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1M9ANYj088884; Mon, 22 Feb 2016 09:10:23 GMT (envelope-from skra@FreeBSD.org) Received: (from skra@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1M9ANIe088878; Mon, 22 Feb 2016 09:10:23 GMT (envelope-from skra@FreeBSD.org) Message-Id: <201602220910.u1M9ANIe088878@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: skra set sender to skra@FreeBSD.org using -f From: Svatopluk Kraus Date: Mon, 22 Feb 2016 09:10:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295883 - in head/sys: amd64/vmm arm/mv dev/altera/avgen dev/vt/hw/efifb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Feb 2016 09:10:25 -0000 Author: skra Date: Mon Feb 22 09:10:23 2016 New Revision: 295883 URL: https://svnweb.freebsd.org/changeset/base/295883 Log: As is included from , there is no need to include it explicitly when is already included. Reviewed by: alc, kib Differential Revision: https://reviews.freebsd.org/D5380 Modified: head/sys/amd64/vmm/vmm.c head/sys/arm/mv/mvvar.h head/sys/dev/altera/avgen/altera_avgen.c head/sys/dev/altera/avgen/altera_avgen_fdt.c head/sys/dev/altera/avgen/altera_avgen_nexus.c head/sys/dev/vt/hw/efifb/efifb.c Modified: head/sys/amd64/vmm/vmm.c ============================================================================== --- head/sys/amd64/vmm/vmm.c Mon Feb 22 09:08:04 2016 (r295882) +++ head/sys/amd64/vmm/vmm.c Mon Feb 22 09:10:23 2016 (r295883) @@ -53,7 +53,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include #include Modified: head/sys/arm/mv/mvvar.h ============================================================================== --- head/sys/arm/mv/mvvar.h Mon Feb 22 09:08:04 2016 (r295882) +++ head/sys/arm/mv/mvvar.h Mon Feb 22 09:10:23 2016 (r295883) @@ -44,7 +44,6 @@ #include #include #include -#include #include Modified: head/sys/dev/altera/avgen/altera_avgen.c ============================================================================== --- head/sys/dev/altera/avgen/altera_avgen.c Mon Feb 22 09:08:04 2016 (r295882) +++ head/sys/dev/altera/avgen/altera_avgen.c Mon Feb 22 09:10:23 2016 (r295883) @@ -47,7 +47,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include Modified: head/sys/dev/altera/avgen/altera_avgen_fdt.c ============================================================================== --- head/sys/dev/altera/avgen/altera_avgen_fdt.c Mon Feb 22 09:08:04 2016 (r295882) +++ head/sys/dev/altera/avgen/altera_avgen_fdt.c Mon Feb 22 09:10:23 2016 (r295883) @@ -47,7 +47,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include Modified: head/sys/dev/altera/avgen/altera_avgen_nexus.c ============================================================================== --- head/sys/dev/altera/avgen/altera_avgen_nexus.c Mon Feb 22 09:08:04 2016 (r295882) +++ head/sys/dev/altera/avgen/altera_avgen_nexus.c Mon Feb 22 09:10:23 2016 (r295883) @@ -47,7 +47,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include Modified: head/sys/dev/vt/hw/efifb/efifb.c ============================================================================== --- head/sys/dev/vt/hw/efifb/efifb.c Mon Feb 22 09:08:04 2016 (r295882) +++ head/sys/dev/vt/hw/efifb/efifb.c Mon Feb 22 09:10:23 2016 (r295883) @@ -39,7 +39,6 @@ __FBSDID("$FreeBSD$"); #include "opt_platform.h" #include -#include #include #include #include From owner-svn-src-head@freebsd.org Mon Feb 22 09:56:14 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C980EAB0ADD; Mon, 22 Feb 2016 09:56:14 +0000 (UTC) (envelope-from theraven@FreeBSD.org) Received: from theravensnest.org (theraven.freebsd.your.org [216.14.102.27]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cloud.theravensnest.org", Issuer "StartCom Class 1 Primary Intermediate Server CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 9DDFF122B; Mon, 22 Feb 2016 09:56:14 +0000 (UTC) (envelope-from theraven@FreeBSD.org) Received: from [192.168.0.7] (cpc91230-cmbg18-2-0-cust661.5-4.cable.virginm.net [82.1.230.150]) (authenticated bits=0) by theravensnest.org (8.15.2/8.15.2) with ESMTPSA id u1M9uAnd096362 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 22 Feb 2016 09:56:12 GMT (envelope-from theraven@FreeBSD.org) X-Authentication-Warning: theravensnest.org: Host cpc91230-cmbg18-2-0-cust661.5-4.cable.virginm.net [82.1.230.150] claimed to be [192.168.0.7] Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2104\)) Subject: Re: svn commit: r295768 - head/usr.sbin/iostat From: David Chisnall In-Reply-To: <83BB8467-4C40-4CF1-B394-1376C9D97FCF@FreeBSD.org> Date: Mon, 22 Feb 2016 09:56:05 +0000 Cc: Alan Somers , Sergey Kandaurov , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Transfer-Encoding: quoted-printable Message-Id: <156A6796-D62B-4977-893B-E4E727578412@FreeBSD.org> References: <201602182008.u1IK81vg092127@repo.freebsd.org> <83BB8467-4C40-4CF1-B394-1376C9D97FCF@FreeBSD.org> To: Dimitry Andric X-Mailer: Apple Mail (2.2104) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Feb 2016 09:56:14 -0000 On 19 Feb 2016, at 23:23, Dimitry Andric wrote: >=20 > This warning is only produced when you use -Wall -W, and then = initialize > structs partially, i.e. you initialize some fields but not others. I > think this is a quite reasonable warning for a high warning level. The warning is annoying in many ways. You ought to be able to zero = initialise any struct with {0}, but clang objects if you do this and = requires every field to be filled in. This warning really shouldn=E2=80=99= t be enabled with -Wall, because it has too hight a false positive rate. With regard to Bruce=E2=80=99s comment about padding, this is a known = issue in C11. There is an open DR about it and it=E2=80=99s scheduled = for discussion at the WG14 meeting in London in April. David From owner-svn-src-head@freebsd.org Mon Feb 22 10:15:10 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DBFAEAAF6C5; Mon, 22 Feb 2016 10:15:09 +0000 (UTC) (envelope-from koobs.freebsd@gmail.com) Received: from mail-pf0-x236.google.com (mail-pf0-x236.google.com [IPv6:2607:f8b0:400e:c00::236]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A8ED81211; Mon, 22 Feb 2016 10:15:09 +0000 (UTC) (envelope-from koobs.freebsd@gmail.com) Received: by mail-pf0-x236.google.com with SMTP id q63so90462047pfb.0; Mon, 22 Feb 2016 02:15:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:reply-to:subject:references:to:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-type :content-transfer-encoding; bh=x51s0mbk73kv42NYraWeOP+nu4LexG7jtqJAR5S4dLY=; b=UbJpJuA+6WGtS5+5qZwG1Kjf8UI0neCdJjC94o4MIhsi+KsN9y7U2O8cj/AYiHPfAr MCsZqUTddOKlI3bfLSRRK1gS/vrXGx06ErVQ74Idcx+g/EARTW+oVJFYyIxqqMX9H/DV z6mmD/ZfF8kDKGIqTeMMLwrH1Fdoo/F48eCxEkGPoVwhZOn35i/pry0mRavCX5TyMEdt m/e2IP6YyC9f+yA/ZLjqEpO8Yo+2FAU4oM5LjN1JB9VzbV4okJbSMSJg8oWw4SCX1T/v oEb8y89sV1WoCqp6o/9/McwA4lWk1SoYbGgoZ1TReRMvjDp9Vym2+ewrBQVOYCaQb+tl ET+w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:reply-to:subject:references:to:cc:from :message-id:date:user-agent:mime-version:in-reply-to:content-type :content-transfer-encoding; bh=x51s0mbk73kv42NYraWeOP+nu4LexG7jtqJAR5S4dLY=; b=hw+l2EtyEctDUL7cosDoc3LHJH+Hk6KpfQQUwUddL7bhsF+aSTP1Zc+f3VHocmCmOx bZ1bpEEw96Jl7gmHwW4EXQ8xm1SakQM10zRrAgF548ilePt/HNsWYq9TfNNOMNz8ijHJ NSzKmQJpaIRJBnM2ruJv6jf+oFLWw36PyzFEBUv2sMLuV9sII37RkizZv9tgpCe/OYq4 j7sDw7z69iRfbplHZ+E1nwmIdYkSNETI2KSsaLX4hVKbdXAhXexgVavF69xBFKYmr1qb eeuFHn4urjXyeYZXcc/AnoA6+tOKGFyF388kQIafWGWAj/PTtTKxp3npl5k9M0IlaD1q wqaA== X-Gm-Message-State: AG10YORP1jCbxy9XlWA3qAfwuRTF0GqSNaLGvYnyKkkJ/tgCv1ccPEXW5Z9R+59x4Lfozw== X-Received: by 10.98.87.80 with SMTP id l77mr36911718pfb.101.1456136109171; Mon, 22 Feb 2016 02:15:09 -0800 (PST) Received: from ?IPv6:2001:44b8:31ae:7b01:1822:a961:f0af:d233? (2001-44b8-31ae-7b01-1822-a961-f0af-d233.static.ipv6.internode.on.net. [2001:44b8:31ae:7b01:1822:a961:f0af:d233]) by smtp.gmail.com with ESMTPSA id s90sm35624027pfa.49.2016.02.22.02.15.05 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 22 Feb 2016 02:15:08 -0800 (PST) Sender: Kubilay Kocak Reply-To: koobs@FreeBSD.org Subject: Re: svn commit: r295768 - head/usr.sbin/iostat References: <201602182008.u1IK81vg092127@repo.freebsd.org> <83BB8467-4C40-4CF1-B394-1376C9D97FCF@FreeBSD.org> <156A6796-D62B-4977-893B-E4E727578412@FreeBSD.org> To: David Chisnall , Dimitry Andric Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , Sergey Kandaurov , "src-committers@freebsd.org" , Alan Somers From: Kubilay Kocak X-Enigmail-Draft-Status: N1110 Message-ID: Date: Mon, 22 Feb 2016 21:15:01 +1100 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.0 MIME-Version: 1.0 In-Reply-To: <156A6796-D62B-4977-893B-E4E727578412@FreeBSD.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Feb 2016 10:15:10 -0000 On 22/02/2016 8:56 PM, David Chisnall wrote: > On 19 Feb 2016, at 23:23, Dimitry Andric wrote: >> >> This warning is only produced when you use -Wall -W, and then >> initialize structs partially, i.e. you initialize some fields but >> not others. I think this is a quite reasonable warning for a high >> warning level. > > The warning is annoying in many ways. You ought to be able to zero > initialise any struct with {0}, but clang objects if you do this and > requires every field to be filled in. This warning really shouldn’t > be enabled with -Wall, because it has too hight a false positive > rate. For the lay persons among us (I'm genuinely interested), what are the the downsides to requiring initialization of all fields? And in addition, the upsides, if any, of 'deferred' field initialization? Is there a proper term for the above? > With regard to Bruce’s comment about padding, this is a known issue > in C11. There is an open DR about it and it’s scheduled for > discussion at the WG14 meeting in London in April. > > David > Koobs From owner-svn-src-head@freebsd.org Mon Feb 22 10:41:26 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AAE5FAB048D; Mon, 22 Feb 2016 10:41:26 +0000 (UTC) (envelope-from theraven@FreeBSD.org) Received: from theravensnest.org (theraven.freebsd.your.org [216.14.102.27]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cloud.theravensnest.org", Issuer "StartCom Class 1 Primary Intermediate Server CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 6F1DC134B; Mon, 22 Feb 2016 10:41:25 +0000 (UTC) (envelope-from theraven@FreeBSD.org) Received: from [192.168.0.7] (cpc91230-cmbg18-2-0-cust661.5-4.cable.virginm.net [82.1.230.150]) (authenticated bits=0) by theravensnest.org (8.15.2/8.15.2) with ESMTPSA id u1MAfNc7096702 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 22 Feb 2016 10:41:24 GMT (envelope-from theraven@FreeBSD.org) X-Authentication-Warning: theravensnest.org: Host cpc91230-cmbg18-2-0-cust661.5-4.cable.virginm.net [82.1.230.150] claimed to be [192.168.0.7] Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2104\)) Subject: Re: svn commit: r295768 - head/usr.sbin/iostat From: David Chisnall In-Reply-To: Date: Mon, 22 Feb 2016 10:41:17 +0000 Cc: Dimitry Andric , "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , Sergey Kandaurov , "src-committers@freebsd.org" , Alan Somers Content-Transfer-Encoding: quoted-printable Message-Id: <08BD1DAA-4B07-48C3-BEF2-4D4FBDB5071F@FreeBSD.org> References: <201602182008.u1IK81vg092127@repo.freebsd.org> <83BB8467-4C40-4CF1-B394-1376C9D97FCF@FreeBSD.org> <156A6796-D62B-4977-893B-E4E727578412@FreeBSD.org> To: koobs@FreeBSD.org X-Mailer: Apple Mail (2.2104) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Feb 2016 10:41:26 -0000 On 22 Feb 2016, at 10:15, Kubilay Kocak wrote: >=20 > For the lay persons among us (I'm genuinely interested), what are the > the downsides to requiring initialization of all fields? Explicit initialisation, or initialisation in general? Being able to initialise the entire structure with code that will always = initialise everything with zero makes the code less fragile because you = can add a field to the structure and not have to find all of the places = where it=E2=80=99s initialised. The clang warning makes it easy to find = the places you need to change, but now you have code churn for no good = reason. Implicit initialisation is often useful for generating more efficient = code. If you=E2=80=99re intialising with a bunch of common fields, the = compiler will end up creating a static variable and doing a memcpy = (which the back end may optimise), which is very cheap. A load of code = in libc ends up like this. > And in addition, the upsides, if any, of 'deferred' field = initialization? The same as the upsides for deferred variable initialization. Modern = compilers are good at tracking intraprocedural data flow. If you = don=E2=80=99t initialise a field, then the compiler can typically tell = that you=E2=80=99ve read from a field but not written to it. It=E2=80=99s= generally good defensive programming for zero to have a well-defined = meaning (C codifies this for pointers, Go codifies it for all structure = types), but if you haven=E2=80=99t done this then the zero may be a = valid but incorrect value and no amount of static analysis can tell you = that the programmer did something that is valid but wrong. Some = languages with richer type systems explicitly encode the invalidity of = the variable in its type and transform it to the valid version once it = is initialised (some also provide maybe types as a programmer-level = constructs. You can implement them fairly trivially in C++, see for = example LLVM=E2=80=99s ErrorOr<> template). Sane coding style for C (not style(9)) typically includes the principle = of minimum scope, where variables must be declared as close to possible = their initialisation. This helps minimise these problems, because you = either declare the variable where it is initialised, or (if = initialisation is conditional) right next to it where you can clearly = see that it has been initialised on all code paths. Unfortunately, as = you can see from the PVS results, style(9) could have been carefully = designed to maximise the introduction of accidental bugs. David From owner-svn-src-head@freebsd.org Mon Feb 22 11:47:31 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 67866AAF04D; Mon, 22 Feb 2016 11:47:31 +0000 (UTC) (envelope-from skra@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3EE2714B4; Mon, 22 Feb 2016 11:47:31 +0000 (UTC) (envelope-from skra@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1MBlU11036289; Mon, 22 Feb 2016 11:47:30 GMT (envelope-from skra@FreeBSD.org) Received: (from skra@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1MBlSdi036270; Mon, 22 Feb 2016 11:47:28 GMT (envelope-from skra@FreeBSD.org) Message-Id: <201602221147.u1MBlSdi036270@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: skra set sender to skra@FreeBSD.org using -f From: Svatopluk Kraus Date: Mon, 22 Feb 2016 11:47:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295885 - in head/sys/arm: allwinner allwinner/a20 altera/socfpga amlogic/aml8726 annapurna/alpine broadcom/bcm2835 conf freescale/imx freescale/vybrid mv/armadaxp qemu rockchip samsung... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Feb 2016 11:47:31 -0000 Author: skra Date: Mon Feb 22 11:47:28 2016 New Revision: 295885 URL: https://svnweb.freebsd.org/changeset/base/295885 Log: Move ARM_L2_PIPT option to std.armv6 for all armv6 platforms. Only L2 PIPT cache is supported for __ARM_ARCH >= 6. In fact, this is just a pure proclamation as this option is used only in armv4 specific files now. Modified: head/sys/arm/allwinner/a20/std.a20 head/sys/arm/allwinner/std.a10 head/sys/arm/altera/socfpga/std.socfpga head/sys/arm/amlogic/aml8726/std.aml8726 head/sys/arm/annapurna/alpine/std.alpine head/sys/arm/broadcom/bcm2835/std.bcm2836 head/sys/arm/conf/std.armv6 head/sys/arm/freescale/imx/std.imx51 head/sys/arm/freescale/imx/std.imx53 head/sys/arm/freescale/imx/std.imx6 head/sys/arm/freescale/vybrid/std.vybrid head/sys/arm/mv/armadaxp/std.armadaxp head/sys/arm/qemu/std.virt head/sys/arm/rockchip/std.rk30xx head/sys/arm/samsung/exynos/std.exynos5250 head/sys/arm/samsung/exynos/std.exynos5420 head/sys/arm/ti/am335x/std.am335x head/sys/arm/ti/omap4/std.omap4 head/sys/arm/xilinx/std.zynq7 Modified: head/sys/arm/allwinner/a20/std.a20 ============================================================================== --- head/sys/arm/allwinner/a20/std.a20 Mon Feb 22 09:49:45 2016 (r295884) +++ head/sys/arm/allwinner/a20/std.a20 Mon Feb 22 11:47:28 2016 (r295885) @@ -8,8 +8,6 @@ makeoptions CONF_CFLAGS="-march=armv7a" makeoptions KERNVIRTADDR=0xc0200000 options KERNVIRTADDR=0xc0200000 -options ARM_L2_PIPT - options IPI_IRQ_START=0 options IPI_IRQ_END=15 Modified: head/sys/arm/allwinner/std.a10 ============================================================================== --- head/sys/arm/allwinner/std.a10 Mon Feb 22 09:49:45 2016 (r295884) +++ head/sys/arm/allwinner/std.a10 Mon Feb 22 11:47:28 2016 (r295885) @@ -8,7 +8,5 @@ makeoptions CONF_CFLAGS="-march=armv7a" makeoptions KERNVIRTADDR=0xc0200000 options KERNVIRTADDR=0xc0200000 -options ARM_L2_PIPT - files "../allwinner/files.allwinner" files "../allwinner/files.a10" Modified: head/sys/arm/altera/socfpga/std.socfpga ============================================================================== --- head/sys/arm/altera/socfpga/std.socfpga Mon Feb 22 09:49:45 2016 (r295884) +++ head/sys/arm/altera/socfpga/std.socfpga Mon Feb 22 11:47:28 2016 (r295885) @@ -7,8 +7,6 @@ makeoptions CONF_CFLAGS="-march=armv7a" makeoptions KERNVIRTADDR=0xc0f00000 options KERNVIRTADDR=0xc0f00000 -options ARM_L2_PIPT - options IPI_IRQ_START=0 options IPI_IRQ_END=15 Modified: head/sys/arm/amlogic/aml8726/std.aml8726 ============================================================================== --- head/sys/arm/amlogic/aml8726/std.aml8726 Mon Feb 22 09:49:45 2016 (r295884) +++ head/sys/arm/amlogic/aml8726/std.aml8726 Mon Feb 22 11:47:28 2016 (r295885) @@ -17,8 +17,6 @@ device fdt_pinctrl files "../amlogic/aml8726/files.aml8726" -options ARM_L2_PIPT - # Set all global interrupts to be edge triggered, active high. options GIC_DEFAULT_ICFGR_INIT=0xffffffff Modified: head/sys/arm/annapurna/alpine/std.alpine ============================================================================== --- head/sys/arm/annapurna/alpine/std.alpine Mon Feb 22 09:49:45 2016 (r295884) +++ head/sys/arm/annapurna/alpine/std.alpine Mon Feb 22 11:47:28 2016 (r295885) @@ -10,8 +10,6 @@ options KERNVIRTADDR=0xa0200000 makeoptions KERNBASE=0xa0000000 options KERNBASE=0xa0000000 -options ARM_L2_PIPT - options IPI_IRQ_START=0 options IPI_IRQ_END=15 Modified: head/sys/arm/broadcom/bcm2835/std.bcm2836 ============================================================================== --- head/sys/arm/broadcom/bcm2835/std.bcm2836 Mon Feb 22 09:49:45 2016 (r295884) +++ head/sys/arm/broadcom/bcm2835/std.bcm2836 Mon Feb 22 11:47:28 2016 (r295885) @@ -5,7 +5,6 @@ cpu CPU_CORTEXA makeoptions CONF_CFLAGS="-march=armv7a" options SOC_BCM2836 -options ARM_L2_PIPT options IPI_IRQ_START=76 files "../broadcom/bcm2835/files.bcm2836" Modified: head/sys/arm/conf/std.armv6 ============================================================================== --- head/sys/arm/conf/std.armv6 Mon Feb 22 09:49:45 2016 (r295884) +++ head/sys/arm/conf/std.armv6 Mon Feb 22 11:47:28 2016 (r295885) @@ -2,6 +2,8 @@ # # $FreeBSD$ +options ARM_L2_PIPT # Only L2 PIPT is supported + options PREEMPTION # Enable kernel thread preemption options INET # InterNETworking options INET6 # IPv6 communications protocols Modified: head/sys/arm/freescale/imx/std.imx51 ============================================================================== --- head/sys/arm/freescale/imx/std.imx51 Mon Feb 22 09:49:45 2016 (r295884) +++ head/sys/arm/freescale/imx/std.imx51 Mon Feb 22 11:47:28 2016 (r295885) @@ -2,7 +2,6 @@ machine arm armv6 cpu CPU_CORTEXA makeoptions CONF_CFLAGS="-march=armv7a" -options ARM_L2_PIPT options KERNVIRTADDR=0xc0100000 makeoptions KERNVIRTADDR=0xc0100000 Modified: head/sys/arm/freescale/imx/std.imx53 ============================================================================== --- head/sys/arm/freescale/imx/std.imx53 Mon Feb 22 09:49:45 2016 (r295884) +++ head/sys/arm/freescale/imx/std.imx53 Mon Feb 22 11:47:28 2016 (r295885) @@ -2,7 +2,6 @@ machine arm armv6 cpu CPU_CORTEXA makeoptions CONF_CFLAGS="-march=armv7a" -options ARM_L2_PIPT options KERNVIRTADDR=0xc0100000 makeoptions KERNVIRTADDR=0xc0100000 Modified: head/sys/arm/freescale/imx/std.imx6 ============================================================================== --- head/sys/arm/freescale/imx/std.imx6 Mon Feb 22 09:49:45 2016 (r295884) +++ head/sys/arm/freescale/imx/std.imx6 Mon Feb 22 11:47:28 2016 (r295885) @@ -2,7 +2,6 @@ machine arm armv6 cpu CPU_CORTEXA makeoptions CONF_CFLAGS="-march=armv7a" -options ARM_L2_PIPT options KERNVIRTADDR = 0xc2000000 makeoptions KERNVIRTADDR = 0xc2000000 Modified: head/sys/arm/freescale/vybrid/std.vybrid ============================================================================== --- head/sys/arm/freescale/vybrid/std.vybrid Mon Feb 22 09:49:45 2016 (r295884) +++ head/sys/arm/freescale/vybrid/std.vybrid Mon Feb 22 11:47:28 2016 (r295885) @@ -7,6 +7,4 @@ makeoptions CONF_CFLAGS="-march=armv7a" makeoptions KERNVIRTADDR=0xc0100000 options KERNVIRTADDR=0xc0100000 -options ARM_L2_PIPT - files "../freescale/vybrid/files.vybrid" Modified: head/sys/arm/mv/armadaxp/std.armadaxp ============================================================================== --- head/sys/arm/mv/armadaxp/std.armadaxp Mon Feb 22 09:49:45 2016 (r295884) +++ head/sys/arm/mv/armadaxp/std.armadaxp Mon Feb 22 11:47:28 2016 (r295885) @@ -2,5 +2,3 @@ makeoptions KERNVIRTADDR=0xc0200000 options KERNVIRTADDR=0xc0200000 - -options ARM_L2_PIPT Modified: head/sys/arm/qemu/std.virt ============================================================================== --- head/sys/arm/qemu/std.virt Mon Feb 22 09:49:45 2016 (r295884) +++ head/sys/arm/qemu/std.virt Mon Feb 22 11:47:28 2016 (r295885) @@ -2,7 +2,6 @@ machine arm armv6 cpu CPU_CORTEXA makeoptions CONF_CFLAGS="-march=armv7a" -options ARM_L2_PIPT options KERNVIRTADDR = 0xc1000000 makeoptions KERNVIRTADDR = 0xc1000000 Modified: head/sys/arm/rockchip/std.rk30xx ============================================================================== --- head/sys/arm/rockchip/std.rk30xx Mon Feb 22 09:49:45 2016 (r295884) +++ head/sys/arm/rockchip/std.rk30xx Mon Feb 22 11:47:28 2016 (r295885) @@ -8,8 +8,6 @@ makeoptions CONF_CFLAGS="-march=armv7a" makeoptions KERNVIRTADDR=0xc0400000 options KERNVIRTADDR=0xc0400000 -options ARM_L2_PIPT - options IPI_IRQ_START=0 options IPI_IRQ_END=15 Modified: head/sys/arm/samsung/exynos/std.exynos5250 ============================================================================== --- head/sys/arm/samsung/exynos/std.exynos5250 Mon Feb 22 09:49:45 2016 (r295884) +++ head/sys/arm/samsung/exynos/std.exynos5250 Mon Feb 22 11:47:28 2016 (r295885) @@ -7,8 +7,6 @@ makeoptions CONF_CFLAGS="-march=armv7a" makeoptions KERNVIRTADDR=0xc0f00000 options KERNVIRTADDR=0xc0f00000 -options ARM_L2_PIPT - options IPI_IRQ_START=0 options IPI_IRQ_END=15 Modified: head/sys/arm/samsung/exynos/std.exynos5420 ============================================================================== --- head/sys/arm/samsung/exynos/std.exynos5420 Mon Feb 22 09:49:45 2016 (r295884) +++ head/sys/arm/samsung/exynos/std.exynos5420 Mon Feb 22 11:47:28 2016 (r295885) @@ -7,8 +7,6 @@ makeoptions CONF_CFLAGS="-march=armv7a" makeoptions KERNVIRTADDR=0xc0f00000 options KERNVIRTADDR=0xc0f00000 -options ARM_L2_PIPT - options IPI_IRQ_START=0 options IPI_IRQ_END=15 Modified: head/sys/arm/ti/am335x/std.am335x ============================================================================== --- head/sys/arm/ti/am335x/std.am335x Mon Feb 22 09:49:45 2016 (r295884) +++ head/sys/arm/ti/am335x/std.am335x Mon Feb 22 11:47:28 2016 (r295885) @@ -7,5 +7,3 @@ options KERNVIRTADDR=0xc0200000 # Used makeoptions KERNVIRTADDR=0xc0200000 options SOC_TI_AM335X - -options ARM_L2_PIPT Modified: head/sys/arm/ti/omap4/std.omap4 ============================================================================== --- head/sys/arm/ti/omap4/std.omap4 Mon Feb 22 09:49:45 2016 (r295884) +++ head/sys/arm/ti/omap4/std.omap4 Mon Feb 22 11:47:28 2016 (r295885) @@ -7,5 +7,3 @@ options KERNVIRTADDR=0xc0200000 # Used makeoptions KERNVIRTADDR=0xc0200000 options SOC_OMAP4 - -options ARM_L2_PIPT Modified: head/sys/arm/xilinx/std.zynq7 ============================================================================== --- head/sys/arm/xilinx/std.zynq7 Mon Feb 22 09:49:45 2016 (r295884) +++ head/sys/arm/xilinx/std.zynq7 Mon Feb 22 11:47:28 2016 (r295885) @@ -12,7 +12,5 @@ files "../xilinx/files.zynq7" options KERNVIRTADDR=0xc0100000 # Used in ldscript.arm makeoptions KERNVIRTADDR=0xc0100000 -options ARM_L2_PIPT - options IPI_IRQ_START=0 options IPI_IRQ_END=15 From owner-svn-src-head@freebsd.org Mon Feb 22 12:57:10 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4A409AB0DDA; Mon, 22 Feb 2016 12:57:10 +0000 (UTC) (envelope-from skra@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F156313BC; Mon, 22 Feb 2016 12:57:09 +0000 (UTC) (envelope-from skra@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1MCv8FN057376; Mon, 22 Feb 2016 12:57:08 GMT (envelope-from skra@FreeBSD.org) Received: (from skra@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1MCv8Q8057375; Mon, 22 Feb 2016 12:57:08 GMT (envelope-from skra@FreeBSD.org) Message-Id: <201602221257.u1MCv8Q8057375@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: skra set sender to skra@FreeBSD.org using -f From: Svatopluk Kraus Date: Mon, 22 Feb 2016 12:57:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295887 - head/sys/arm/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Feb 2016 12:57:10 -0000 Author: skra Date: Mon Feb 22 12:57:08 2016 New Revision: 295887 URL: https://svnweb.freebsd.org/changeset/base/295887 Log: Remove armv6 specific part from armv4 specific file and update comment. No functional change. Modified: head/sys/arm/arm/trap-v4.c Modified: head/sys/arm/arm/trap-v4.c ============================================================================== --- head/sys/arm/arm/trap-v4.c Mon Feb 22 12:28:23 2016 (r295886) +++ head/sys/arm/arm/trap-v4.c Mon Feb 22 12:57:08 2016 (r295887) @@ -94,7 +94,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include #include @@ -312,16 +311,13 @@ abort_handler(struct trapframe *tf, int } /* - * We need to know whether the page should be mapped as R or R/W. On - * armv6 and later the fault status register indicates whether the - * access was a read or write. Prior to armv6, we know that a - * permission fault can only be the result of a write to a read-only - * location, so we can deal with those quickly. Otherwise we need to - * disassemble the faulting instruction to determine if it was a write. + * We need to know whether the page should be mapped as R or R/W. + * On armv4, the fault status register does not indicate whether + * the access was a read or write. We know that a permission fault + * can only be the result of a write to a read-only location, so we + * can deal with those quickly. Otherwise we need to disassemble + * the faulting instruction to determine if it was a write. */ -#if __ARM_ARCH >= 6 - ftype = (fsr & FAULT_WNR) ? VM_PROT_READ | VM_PROT_WRITE : VM_PROT_READ; -#else if (IS_PERMISSION_FAULT(fsr)) ftype = VM_PROT_WRITE; else { @@ -338,7 +334,6 @@ abort_handler(struct trapframe *tf, int ftype = VM_PROT_READ; } } -#endif /* * See if the fault is as a result of ref/mod emulation, From owner-svn-src-head@freebsd.org Mon Feb 22 13:34:44 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A917DAB02D5; Mon, 22 Feb 2016 13:34:44 +0000 (UTC) (envelope-from wma@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 76A251AA0; Mon, 22 Feb 2016 13:34:44 +0000 (UTC) (envelope-from wma@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1MDYhwQ069138; Mon, 22 Feb 2016 13:34:43 GMT (envelope-from wma@FreeBSD.org) Received: (from wma@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1MDYhQg069137; Mon, 22 Feb 2016 13:34:43 GMT (envelope-from wma@FreeBSD.org) Message-Id: <201602221334.u1MDYhQg069137@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: wma set sender to wma@FreeBSD.org using -f From: Wojciech Macek Date: Mon, 22 Feb 2016 13:34:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295888 - head/sys/arm64/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Feb 2016 13:34:44 -0000 Author: wma Date: Mon Feb 22 13:34:43 2016 New Revision: 295888 URL: https://svnweb.freebsd.org/changeset/base/295888 Log: Add Intel 10Gb support to ARM64 GENERIC kernel config Obtained from: Semihalf Sponsored by: Cavium Approved by: cognet (mentor) Reviewed by: zbb Differential revision: https://reviews.freebsd.org/D5347 Modified: head/sys/arm64/conf/GENERIC Modified: head/sys/arm64/conf/GENERIC ============================================================================== --- head/sys/arm64/conf/GENERIC Mon Feb 22 12:57:08 2016 (r295887) +++ head/sys/arm64/conf/GENERIC Mon Feb 22 13:34:43 2016 (r295888) @@ -103,6 +103,7 @@ device mii device miibus # MII bus support device em # Intel PRO/1000 Gigabit Ethernet Family device igb # Intel PRO/1000 PCIE Server Gigabit Family +device ix # Intel 10Gb Ethernet Family device msk # Marvell/SysKonnect Yukon II Gigabit Ethernet device vnic # Cavium ThunderX NIC From owner-svn-src-head@freebsd.org Mon Feb 22 13:52:09 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DBAF2AB0BE1; Mon, 22 Feb 2016 13:52:09 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A8A6B1623; Mon, 22 Feb 2016 13:52:09 +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 u1MDq8bQ074874; Mon, 22 Feb 2016 13:52:08 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1MDq8DU074873; Mon, 22 Feb 2016 13:52:08 GMT (envelope-from br@FreeBSD.org) Message-Id: <201602221352.u1MDq8DU074873@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Mon, 22 Feb 2016 13:52:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295889 - head/sys/riscv/riscv X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Feb 2016 13:52:10 -0000 Author: br Date: Mon Feb 22 13:52:08 2016 New Revision: 295889 URL: https://svnweb.freebsd.org/changeset/base/295889 Log: Fix ktrace call. Modified: head/sys/riscv/riscv/machdep.c Modified: head/sys/riscv/riscv/machdep.c ============================================================================== --- head/sys/riscv/riscv/machdep.c Mon Feb 22 13:34:43 2016 (r295888) +++ head/sys/riscv/riscv/machdep.c Mon Feb 22 13:52:08 2016 (r295889) @@ -555,7 +555,7 @@ sendsig(sig_t catcher, ksiginfo_t *ksi, tf->tf_ra = (register_t)(sysent->sv_psstrings - *(sysent->sv_szsigcode)); - CTR3(KTR_SIG, "sendsig: return td=%p pc=%#x sp=%#x", td, tf->tf_elr, + CTR3(KTR_SIG, "sendsig: return td=%p pc=%#x sp=%#x", td, tf->tf_sepc, tf->tf_sp); PROC_LOCK(p); From owner-svn-src-head@freebsd.org Mon Feb 22 14:01:48 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 075FBAB10E1; Mon, 22 Feb 2016 14:01:48 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D67241A92; Mon, 22 Feb 2016 14:01:47 +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 u1ME1kjC075866; Mon, 22 Feb 2016 14:01:46 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1ME1ka0075864; Mon, 22 Feb 2016 14:01:46 GMT (envelope-from br@FreeBSD.org) Message-Id: <201602221401.u1ME1ka0075864@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Mon, 22 Feb 2016 14:01:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295890 - in head/sys: conf riscv/riscv X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Feb 2016 14:01:48 -0000 Author: br Date: Mon Feb 22 14:01:46 2016 New Revision: 295890 URL: https://svnweb.freebsd.org/changeset/base/295890 Log: Provide stack(9) MD stubs for RISC-V so ktr(9) can be compiled in. Added: head/sys/riscv/riscv/stack_machdep.c (contents, props changed) Modified: head/sys/conf/files.riscv Modified: head/sys/conf/files.riscv ============================================================================== --- head/sys/conf/files.riscv Mon Feb 22 13:52:08 2016 (r295889) +++ head/sys/conf/files.riscv Mon Feb 22 14:01:46 2016 (r295890) @@ -34,9 +34,10 @@ riscv/riscv/machdep.c standard riscv/riscv/mem.c standard riscv/riscv/nexus.c standard riscv/riscv/pmap.c standard -riscv/riscv/sys_machdep.c standard +riscv/riscv/stack_machdep.c standard riscv/riscv/support.S standard riscv/riscv/swtch.S standard +riscv/riscv/sys_machdep.c standard riscv/riscv/trap.c standard riscv/riscv/timer.c standard riscv/riscv/uio_machdep.c standard Added: head/sys/riscv/riscv/stack_machdep.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/riscv/riscv/stack_machdep.c Mon Feb 22 14:01:46 2016 (r295890) @@ -0,0 +1,63 @@ +/*- + * Copyright (c) 2016 Ruslan Bukin + * All rights reserved. + * + * Portions of this software were developed by SRI International and the + * University of Cambridge Computer Laboratory under DARPA/AFRL contract + * FA8750-10-C-0237 ("CTSRD"), as part of the DARPA CRASH research programme. + * + * Portions of this software were developed by the University of Cambridge + * Computer Laboratory as part of the CTSRD Project, with support from the + * UK Higher Education Innovation Fund (HEIF). + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include + +#include +#include + +void +stack_save_td(struct stack *st, struct thread *td) +{ + +} + +int +stack_save_td_running(struct stack *st, struct thread *td) +{ + + return (EOPNOTSUPP); +} + +void +stack_save(struct stack *st) +{ + +} From owner-svn-src-head@freebsd.org Mon Feb 22 14:13:06 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D7173AB1499; Mon, 22 Feb 2016 14:13:06 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A8EF6113D; Mon, 22 Feb 2016 14:13:06 +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 u1MED55I080698; Mon, 22 Feb 2016 14:13:05 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1MED50F080697; Mon, 22 Feb 2016 14:13:05 GMT (envelope-from br@FreeBSD.org) Message-Id: <201602221413.u1MED50F080697@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Mon, 22 Feb 2016 14:13:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295891 - head/sys/riscv/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Feb 2016 14:13:06 -0000 Author: br Date: Mon Feb 22 14:13:05 2016 New Revision: 295891 URL: https://svnweb.freebsd.org/changeset/base/295891 Log: Remove duplicates. Modified: head/sys/riscv/include/atomic.h Modified: head/sys/riscv/include/atomic.h ============================================================================== --- head/sys/riscv/include/atomic.h Mon Feb 22 14:01:46 2016 (r295890) +++ head/sys/riscv/include/atomic.h Mon Feb 22 14:13:05 2016 (r295891) @@ -399,10 +399,6 @@ atomic_store_rel_64(volatile uint64_t *p *p = val; } -#define atomic_add_acq_int atomic_add_acq_32 -#define atomic_clear_acq_int atomic_clear_acq_32 -#define atomic_cmpset_acq_int atomic_cmpset_acq_32 - #define atomic_add_acq_long atomic_add_acq_64 #define atomic_clear_acq_long atomic_add_acq_64 #define atomic_cmpset_acq_long atomic_cmpset_acq_64 From owner-svn-src-head@freebsd.org Mon Feb 22 14:19:46 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B78E0AB177C; Mon, 22 Feb 2016 14:19:46 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 84B8E1A43; Mon, 22 Feb 2016 14:19:46 +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 u1MEJjMZ081802; Mon, 22 Feb 2016 14:19:45 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1MEJjPF081801; Mon, 22 Feb 2016 14:19:45 GMT (envelope-from br@FreeBSD.org) Message-Id: <201602221419.u1MEJjPF081801@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Mon, 22 Feb 2016 14:19:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295892 - head/sys/riscv/riscv X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Feb 2016 14:19:46 -0000 Author: br Date: Mon Feb 22 14:19:45 2016 New Revision: 295892 URL: https://svnweb.freebsd.org/changeset/base/295892 Log: Fix comment. Modified: head/sys/riscv/riscv/timer.c Modified: head/sys/riscv/riscv/timer.c ============================================================================== --- head/sys/riscv/riscv/timer.c Mon Feb 22 14:13:05 2016 (r295891) +++ head/sys/riscv/riscv/timer.c Mon Feb 22 14:19:45 2016 (r295892) @@ -145,8 +145,9 @@ riscv_tmr_intr(void *arg) /* * Clear interrupt pending bit. - * Note sip register is unimplemented in Spike simulator, - * so use machine command to clear in mip. + * Note: SIP_STIP bit is not implemented in sip register + * in Spike simulator, so use machine command to clear + * interrupt pending bit in mip. */ machine_command(ECALL_CLEAR_PENDING, 0); From owner-svn-src-head@freebsd.org Mon Feb 22 14:54:52 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6A810AAF79B; Mon, 22 Feb 2016 14:54:52 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 382821E80; Mon, 22 Feb 2016 14:54:52 +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 u1MEsp7g093659; Mon, 22 Feb 2016 14:54:51 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1MEspOc093658; Mon, 22 Feb 2016 14:54:51 GMT (envelope-from br@FreeBSD.org) Message-Id: <201602221454.u1MEspOc093658@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Mon, 22 Feb 2016 14:54:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295893 - head/sys/riscv/riscv X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Feb 2016 14:54:52 -0000 Author: br Date: Mon Feb 22 14:54:50 2016 New Revision: 295893 URL: https://svnweb.freebsd.org/changeset/base/295893 Log: Add basic trap handlers for illegal instruction and breakpoint exceptions. Modified: head/sys/riscv/riscv/trap.c Modified: head/sys/riscv/riscv/trap.c ============================================================================== --- head/sys/riscv/riscv/trap.c Mon Feb 22 14:19:45 2016 (r295892) +++ head/sys/riscv/riscv/trap.c Mon Feb 22 14:54:50 2016 (r295893) @@ -270,6 +270,17 @@ do_trap_supervisor(struct trapframe *fra case EXCP_INSTR_ACCESS_FAULT: data_abort(frame, 0); break; + case EXCP_INSTR_BREAKPOINT: +#ifdef KDB + kdb_trap(exception, 0, frame); +#else + dump_regs(frame); + panic("No debugger in kernel.\n"); +#endif + case EXCP_INSTR_ILLEGAL: + dump_regs(frame); + panic("Illegal instruction at %x\n", frame->tf_sepc); + break; default: dump_regs(frame); panic("Unknown kernel exception %x badaddr %lx\n", @@ -281,6 +292,10 @@ void do_trap_user(struct trapframe *frame) { uint64_t exception; + struct thread *td; + + td = curthread; + td->td_frame = frame; exception = (frame->tf_scause & EXCP_MASK); if (frame->tf_scause & EXCP_INTR) { @@ -302,6 +317,14 @@ do_trap_user(struct trapframe *frame) frame->tf_sepc += 4; /* Next instruction */ svc_handler(frame); break; + case EXCP_INSTR_ILLEGAL: + call_trapsignal(td, SIGILL, ILL_ILLTRP, (void *)frame->tf_sepc); + userret(td, frame); + break; + case EXCP_INSTR_BREAKPOINT: + call_trapsignal(td, SIGTRAP, TRAP_BRKPT, (void *)frame->tf_sepc); + userret(td, frame); + break; default: dump_regs(frame); panic("Unknown userland exception %x badaddr %lx\n", From owner-svn-src-head@freebsd.org Mon Feb 22 15:00:09 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4FDB8AAF9E4; Mon, 22 Feb 2016 15:00:09 +0000 (UTC) (envelope-from andrew@fubar.geek.nz) Received: from kif.fubar.geek.nz (kif.fubar.geek.nz [178.62.119.249]) by mx1.freebsd.org (Postfix) with ESMTP id D798E1114; Mon, 22 Feb 2016 15:00:08 +0000 (UTC) (envelope-from andrew@fubar.geek.nz) Received: from zapp.Home (bcdc6733.skybroadband.com [188.220.103.51]) by kif.fubar.geek.nz (Postfix) with ESMTPSA id 3C87BD7A17; Mon, 22 Feb 2016 15:00:05 +0000 (UTC) Date: Mon, 22 Feb 2016 15:00:03 +0000 From: Andrew Turner To: Ruslan Bukin Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r295890 - in head/sys: conf riscv/riscv Message-ID: <20160222150003.14a888b2@zapp.Home> In-Reply-To: <201602221401.u1ME1ka0075864@repo.freebsd.org> References: <201602221401.u1ME1ka0075864@repo.freebsd.org> X-Mailer: Claws Mail 3.13.2 (GTK+ 2.24.29; amd64-portbld-freebsd11.0) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Feb 2016 15:00:09 -0000 On Mon, 22 Feb 2016 14:01:46 +0000 (UTC) Ruslan Bukin wrote: > Author: br > Date: Mon Feb 22 14:01:46 2016 > New Revision: 295890 > URL: https://svnweb.freebsd.org/changeset/base/295890 > > Log: > Provide stack(9) MD stubs for RISC-V so ktr(9) can be compiled in. > > Added: > head/sys/riscv/riscv/stack_machdep.c (contents, props changed) > Modified: > head/sys/conf/files.riscv > > Modified: head/sys/conf/files.riscv > ============================================================================== > --- head/sys/conf/files.riscv Mon Feb 22 13:52:08 2016 > (r295889) +++ head/sys/conf/files.riscv Mon Feb 22 14:01:46 > 2016 (r295890) @@ -34,9 +34,10 @@ > riscv/riscv/machdep.c standard > riscv/riscv/mem.c standard > riscv/riscv/nexus.c standard > riscv/riscv/pmap.c standard > -riscv/riscv/sys_machdep.c standard > +riscv/riscv/stack_machdep.c standard This is to "optional ddb | stack" on other architectures. Andrew From owner-svn-src-head@freebsd.org Mon Feb 22 18:53:57 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 36BF4AB1933; Mon, 22 Feb 2016 18:53:57 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DE65918F3; Mon, 22 Feb 2016 18:53:56 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1MIrtK4064060; Mon, 22 Feb 2016 18:53:55 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1MIrt5V064059; Mon, 22 Feb 2016 18:53:55 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201602221853.u1MIrt5V064059@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Mon, 22 Feb 2016 18:53:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295895 - head/sys/boot/uboot/lib X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Feb 2016 18:53:57 -0000 Author: ian Date: Mon Feb 22 18:53:55 2016 New Revision: 295895 URL: https://svnweb.freebsd.org/changeset/base/295895 Log: If the user has set a u-boot env var named rootpath, automatically import it into the loader(8) env as dhcp.root-path, so that it overrides any dhcp/bootp server-provided path. Now if you have a dhcp server available you can easily net-boot a u-boot system even if you don't control the dhcp server config, by setting just two variables in the u-boot env: loaderdev=net rootpath=: Previously you had to either accept all the dhcp parameters from the server without the ability to locally provide the rootpath, or you had to forego dhcp and set more vars (ipaddr, netmask, serverip, rootpath). Modified: head/sys/boot/uboot/lib/net.c Modified: head/sys/boot/uboot/lib/net.c ============================================================================== --- head/sys/boot/uboot/lib/net.c Mon Feb 22 17:18:36 2016 (r295894) +++ head/sys/boot/uboot/lib/net.c Mon Feb 22 18:53:55 2016 (r295895) @@ -108,9 +108,19 @@ get_env_net_params() char *envstr; in_addr_t rootaddr, serveraddr; - /* Silently get out right away if we don't have rootpath. */ - if (ub_env_get("rootpath") == NULL) + /* + * Silently get out right away if we don't have rootpath, because none + * of the other info we obtain below is sufficient to boot without it. + * + * If we do have rootpath, copy it into the global var and also set + * dhcp.root-path in the env. If we don't get all the other info from + * the u-boot env below, we will still try dhcp/bootp, but the server- + * provided path will not replace the user-provided value we set here. + */ + if ((envstr = ub_env_get("rootpath")) == NULL) return; + strlcpy(rootpath, envstr, sizeof(rootpath)); + setenv("dhcp.root-path", rootpath, 0); /* * Our own IP address must be valid. Silently get out if it's not set, @@ -154,9 +164,6 @@ get_env_net_params() * There must be a rootpath. It may be ip:/path or it may be just the * path in which case the ip needs to be in serverip. */ - if ((envstr = ub_env_get("rootpath")) == NULL) - return; - strncpy(rootpath, envstr, sizeof(rootpath) - 1); rootaddr = net_parse_rootpath(); if (rootaddr == INADDR_NONE) rootaddr = serveraddr; From owner-svn-src-head@freebsd.org Mon Feb 22 19:57:15 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EA56BAB1518; Mon, 22 Feb 2016 19:57:15 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebi.us (glebi.us [96.95.210.25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cell.glebi.us", Issuer "cell.glebi.us" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id B77401CF6; Mon, 22 Feb 2016 19:57:15 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebi.us (localhost [127.0.0.1]) by cell.glebi.us (8.15.2/8.15.2) with ESMTPS id u1MJvEEb037116 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Mon, 22 Feb 2016 11:57:14 -0800 (PST) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebi.us (8.15.2/8.15.2/Submit) id u1MJvELK037115; Mon, 22 Feb 2016 11:57:14 -0800 (PST) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebi.us: glebius set sender to glebius@FreeBSD.org using -f Date: Mon, 22 Feb 2016 11:57:14 -0800 From: Gleb Smirnoff To: Conrad Meyer Cc: Benjamin Kaduk , Alan Somers , "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , Sergey Kandaurov , "src-committers@freebsd.org" Subject: Re: svn commit: r295768 - head/usr.sbin/iostat Message-ID: <20160222195713.GC1945@FreeBSD.org> References: <201602182008.u1IK81vg092127@repo.freebsd.org> <20160219230612.GR1945@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Feb 2016 19:57:16 -0000 On Fri, Feb 19, 2016 at 04:50:40PM -0800, Conrad Meyer wrote: C> > It is not quite as simple as this would make it sound. The elements or C> > members of an aggregate (e.g.) structure type are initialized as if it were C> > an object of static storage duration (i.e., to zero) if the initializer list C> > does not contain enough initializers for all members of the aggregate type, C> > per item 21 of section 6.7.8 of n1256.pdf. However, such initialization C> > does not necessarily need to zero any padding bytes that are present, which C> > may take unspecified values. Personally, I think this particular clang C> > warning can be too aggressive, especially for complex structs, but on the C> > other hand given the indeterminateness of padding, bzero/memset are often a C> > better choice anyway. C> C> By definition, padding byte contents are unused. There is no reason C> their values matter one way or another, so why do we care about the C> distinction between bzero and member zero initialization? Well, one can run bcmp() or a hashing function over entire structure, in that case contents of padding matter. But I still don't want to see this warning in -Wall, since it kills very useful C99 initializers. The code, that runs bcmp() or hashes over structs, should take care, and we shouldn't pessimize the entire build for its sake. -- Totus tuus, Glebius. From owner-svn-src-head@freebsd.org Mon Feb 22 21:01:26 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BBC00AB124C; Mon, 22 Feb 2016 21:01:26 +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 mx1.freebsd.org (Postfix) with ESMTPS id 8D35E1289; Mon, 22 Feb 2016 21:01:26 +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 u1ML1Pvh001072; Mon, 22 Feb 2016 21:01:25 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1ML1P4s001071; Mon, 22 Feb 2016 21:01:25 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201602222101.u1ML1P4s001071@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Mon, 22 Feb 2016 21:01:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295899 - head/sys/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Feb 2016 21:01:26 -0000 Author: bdrewery Date: Mon Feb 22 21:01:25 2016 New Revision: 295899 URL: https://svnweb.freebsd.org/changeset/base/295899 Log: Always remove .depend.* in case switching between FAST_DEPEND on/off. This was missed in r295666. Sponsored by: EMC / Isilon Storage Division Modified: head/sys/conf/kern.post.mk Modified: head/sys/conf/kern.post.mk ============================================================================== --- head/sys/conf/kern.post.mk Mon Feb 22 20:20:10 2016 (r295898) +++ head/sys/conf/kern.post.mk Mon Feb 22 21:01:25 2016 (r295899) @@ -222,10 +222,9 @@ _MKDEPCC:= ${CC:N${CCACHE_BIN}} SRCS= assym.s vnode_if.h ${BEFORE_DEPEND} ${CFILES} \ ${SYSTEM_CFILES} ${GEN_CFILES} ${SFILES} \ ${MFILES:T:S/.m$/.h/} -DEPENDFILES= .depend +DEPENDFILES= .depend .depend.* .if ${MK_FAST_DEPEND} == "yes" && \ (${.MAKE.MODE:Unormal:Mmeta} == "" || ${.MAKE.MODE:Unormal:Mnofilemon} != "") -DEPENDFILES+= .depend.* DEPEND_CFLAGS+= -MD -MP -MF.depend.${.TARGET} DEPEND_CFLAGS+= -MT${.TARGET} .if defined(.PARSEDIR) From owner-svn-src-head@freebsd.org Mon Feb 22 21:40:54 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A18FDAB016A; Mon, 22 Feb 2016 21:40:54 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4D4C11A59; Mon, 22 Feb 2016 21:40:54 +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 u1MLerOa012714; Mon, 22 Feb 2016 21:40:53 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1MLerC9012713; Mon, 22 Feb 2016 21:40:53 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201602222140.u1MLerC9012713@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Mon, 22 Feb 2016 21:40:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295900 - head/usr.sbin/iostat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Feb 2016 21:40:54 -0000 Author: asomers Date: Mon Feb 22 21:40:53 2016 New Revision: 295900 URL: https://svnweb.freebsd.org/changeset/base/295900 Log: Fix the usr.sbin/iostat build with GCC, broken by r295768 Renamed some local variables for compatibility with -Wshadow Reported by: Andrew Turner Tested by: ken MFC after: 4 weeks X-MFC-with: 295768 Sponsored by: Spectra Logic Corp Modified: head/usr.sbin/iostat/iostat.c Modified: head/usr.sbin/iostat/iostat.c ============================================================================== --- head/usr.sbin/iostat/iostat.c Mon Feb 22 21:01:25 2016 (r295899) +++ head/usr.sbin/iostat/iostat.c Mon Feb 22 21:40:53 2016 (r295900) @@ -797,7 +797,7 @@ devstats(int perf_select, long double et long double total_mb, blocks_per_second, total_duration; long double ms_per_other, ms_per_read, ms_per_write, ms_per_transaction; int firstline = 1; - char *devname; + char *devicename; if (xflag > 0) { printf(" extended device statistics "); @@ -871,7 +871,7 @@ devstats(int perf_select, long double et } if (xflag > 0) { - if (asprintf(&devname, "%s%d", + if (asprintf(&devicename, "%s%d", cur.dinfo->devices[di].device_name, cur.dinfo->devices[di].unit_number) == -1) err(1, "asprintf"); @@ -887,7 +887,7 @@ devstats(int perf_select, long double et printf("%-8.8s %5d %5d %8.1Lf " "%8.1Lf %5d %5d %5d %5d " "%4" PRIu64 " %3.0Lf ", - devname, + devicename, (int)transfers_per_second_read, (int)transfers_per_second_write, mb_per_second_read * 1024, @@ -900,7 +900,7 @@ devstats(int perf_select, long double et printf("%-8.8s %11.1Lf %11.1Lf " "%12.1Lf %12.1Lf %4" PRIu64 " %10.1Lf %9.1Lf ", - devname, + devicename, (long double)total_transfers_read, (long double)total_transfers_write, (long double) @@ -925,7 +925,7 @@ devstats(int perf_select, long double et } printf("\n"); } - free(devname); + free(devicename); } else if (oflag > 0) { int msdig = (ms_per_transaction < 100.0) ? 1 : 0; @@ -979,15 +979,15 @@ static void cpustats(void) { int state; - double time; + double cptime; - time = 0.0; + cptime = 0.0; for (state = 0; state < CPUSTATES; ++state) - time += cur.cp_time[state]; + cptime += cur.cp_time[state]; for (state = 0; state < CPUSTATES; ++state) printf(" %2.0f", - rint(100. * cur.cp_time[state] / (time ? time : 1))); + rint(100. * cur.cp_time[state] / (cptime ? cptime : 1))); } static int From owner-svn-src-head@freebsd.org Mon Feb 22 22:16:34 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2B8B3AB0FD8; Mon, 22 Feb 2016 22:16:34 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F16041EDB; Mon, 22 Feb 2016 22:16:33 +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 u1MMGW3V023472; Mon, 22 Feb 2016 22:16:32 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1MMGW0m023471; Mon, 22 Feb 2016 22:16:32 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201602222216.u1MMGW0m023471@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Mon, 22 Feb 2016 22:16:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295901 - head/contrib/binutils/bfd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Feb 2016 22:16:34 -0000 Author: dim Date: Mon Feb 22 22:16:32 2016 New Revision: 295901 URL: https://svnweb.freebsd.org/changeset/base/295901 Log: Fix a problem in ld, causing it to sometimes print messages similar to "invalid string offset 65521 >= 27261 for section `.strtab'". for object files produced by recent versions of clang. In BFD's elf_create_symbuf() function, the size of the symbol buffer ('ssymbuf') is not calculated correctly, and the initial value for the 'ssym' variable is off by one, since 'ssymbuf' has shndx_count + 1 members. MFC after: 1 week Modified: head/contrib/binutils/bfd/elf.c Modified: head/contrib/binutils/bfd/elf.c ============================================================================== --- head/contrib/binutils/bfd/elf.c Mon Feb 22 21:40:53 2016 (r295900) +++ head/contrib/binutils/bfd/elf.c Mon Feb 22 22:16:32 2016 (r295901) @@ -8934,14 +8934,14 @@ elf_create_symbuf (bfd_size_type symcoun shndx_count++; ssymbuf = bfd_malloc ((shndx_count + 1) * sizeof (*ssymbuf) - + (indbufend - indbuf) * sizeof (*ssymbuf)); + + (indbufend - indbuf) * sizeof (*ssym)); if (ssymbuf == NULL) { free (indbuf); return NULL; } - ssym = (struct elf_symbuf_symbol *) (ssymbuf + shndx_count); + ssym = (struct elf_symbuf_symbol *) (ssymbuf + shndx_count + 1); ssymbuf->ssym = NULL; ssymbuf->count = shndx_count; ssymbuf->st_shndx = 0; From owner-svn-src-head@freebsd.org Mon Feb 22 22:58:01 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EACE4AB1D9C; Mon, 22 Feb 2016 22:58:01 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from tensor.andric.com (tensor.andric.com [IPv6:2001:7b8:3a7:1:2d0:b7ff:fea0:8c26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "tensor.andric.com", Issuer "COMODO RSA Domain Validation Secure Server CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AE4081295; Mon, 22 Feb 2016 22:58:01 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from [IPv6:2001:7b8:3a7::8dd7:5393:bc62:ce77] (unknown [IPv6:2001:7b8:3a7:0:8dd7:5393:bc62:ce77]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id B8C6420F62; Mon, 22 Feb 2016 23:57:56 +0100 (CET) Subject: Re: svn commit: r295768 - head/usr.sbin/iostat Mime-Version: 1.0 (Mac OS X Mail 9.2 \(3112\)) Content-Type: multipart/signed; boundary="Apple-Mail=_D1F9D041-9575-40FF-B2B4-EE6F1905BBE9"; protocol="application/pgp-signature"; micalg=pgp-sha1 X-Pgp-Agent: GPGMail 2.6b2 (ebbf3ef) From: Dimitry Andric In-Reply-To: <156A6796-D62B-4977-893B-E4E727578412@FreeBSD.org> Date: Mon, 22 Feb 2016 23:57:43 +0100 Cc: Alan Somers , Sergey Kandaurov , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Message-Id: References: <201602182008.u1IK81vg092127@repo.freebsd.org> <83BB8467-4C40-4CF1-B394-1376C9D97FCF@FreeBSD.org> <156A6796-D62B-4977-893B-E4E727578412@FreeBSD.org> To: David Chisnall X-Mailer: Apple Mail (2.3112) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Feb 2016 22:58:02 -0000 --Apple-Mail=_D1F9D041-9575-40FF-B2B4-EE6F1905BBE9 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 On 22 Feb 2016, at 10:56, David Chisnall wrote: >=20 > On 19 Feb 2016, at 23:23, Dimitry Andric wrote: >>=20 >> This warning is only produced when you use -Wall -W, and then = initialize >> structs partially, i.e. you initialize some fields but not others. I >> think this is a quite reasonable warning for a high warning level. >=20 > The warning is annoying in many ways. You ought to be able to zero = initialise any struct with {0}, but clang objects if you do this and = requires every field to be filled in. This warning really shouldn=E2=80=99= t be enabled with -Wall, because it has too hight a false positive rate. It isn't, it is in -W (a.k.a -Wextra). But gcc also warns in this case. = E.g. if I use this example: struct foo { int i; int j; } bar[] =3D { { 42 }, { 43 } }; I get the following warnings from gcc -Wextra: $ gcc -Wextra -c initializers.c initializers.c:5:2: warning: missing initializer for field 'j' of = 'struct foo' [-Wmissing-field-initializers] { 42 }, ^ initializers.c:3:6: note: 'j' declared here int j; ^ initializers.c:6:2: warning: missing initializer for field 'j' of = 'struct foo' [-Wmissing-field-initializers] { 43 } ^ initializers.c:3:6: note: 'j' declared here int j; ^ Note that the warnings disappear if C99 initializers are used. -Dimitry --Apple-Mail=_D1F9D041-9575-40FF-B2B4-EE6F1905BBE9 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.0.29 iEYEARECAAYFAlbLknQACgkQsF6jCi4glqM5bQCghdAFmccwUc2pODSEp86SEgSw miUAoKK7lNvPr4ojr/PKxizoVorQy112 =+hXe -----END PGP SIGNATURE----- --Apple-Mail=_D1F9D041-9575-40FF-B2B4-EE6F1905BBE9-- From owner-svn-src-head@freebsd.org Tue Feb 23 01:08:40 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 79AF3AB1176; Tue, 23 Feb 2016 01:08:40 +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 mx1.freebsd.org (Postfix) with ESMTPS id 54C311A61; Tue, 23 Feb 2016 01:08:40 +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 u1N18des076455; Tue, 23 Feb 2016 01:08:39 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1N18db1076454; Tue, 23 Feb 2016 01:08:39 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201602230108.u1N18db1076454@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Tue, 23 Feb 2016 01:08:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295904 - head/sys/arm/freescale/imx X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Feb 2016 01:08:40 -0000 Author: ian Date: Tue Feb 23 01:08:39 2016 New Revision: 295904 URL: https://svnweb.freebsd.org/changeset/base/295904 Log: Make imx6 systems work again after recent import of new dts files. Linux-driven changes to the way the chip's two interrupt controllers are defined (we only support one of them) led to no interrupt processing, so the system would hang after device instantiation. This workaround just rewrites the FDT data on the fly to get interrupt handling back under the control of the main GIC device. If/when we ever support deep sleep modes that involve powering down the main GIC, we'll have to undo this change, write a driver for the GPC-PIC, and somehow manage the handoff of responsibilities between the two drivers as the chip transitions in/out of deep sleep mode. Modified: head/sys/arm/freescale/imx/imx6_machdep.c Modified: head/sys/arm/freescale/imx/imx6_machdep.c ============================================================================== --- head/sys/arm/freescale/imx/imx6_machdep.c Tue Feb 23 00:45:27 2016 (r295903) +++ head/sys/arm/freescale/imx/imx6_machdep.c Tue Feb 23 01:08:39 2016 (r295904) @@ -94,6 +94,74 @@ fdt_pic_decode_t fdt_pic_table[] = { }; #endif +/* + * Fix FDT data related to interrupts. + * + * Driven by the needs of linux and its drivers (as always), the published FDT + * data for imx6 now sets the interrupt parent for most devices to the GPC + * interrupt controller, which is for use when the chip is in deep-sleep mode. + * We don't support deep sleep or have a GPC-PIC driver; we need all interrupts + * to be handled by the GIC. + * + * Luckily, the change to the FDT data was to assign the GPC as the interrupt + * parent for the soc node and letting that get inherited by all other devices + * (except a few that directly name GIC as their interrupt parent). So we can + * set the world right by just changing the interrupt-parent property of the soc + * node to refer to GIC instead of GPC. This will get us by until we write our + * own GPC driver (or until linux changes its mind and the FDT data again). + * + * We validate that we have data that looks like we expect before changing it: + * - SOC node exists and has GPC as its interrupt parent. + * - GPC node exists and has GIC as its interrupt parent. + * - GIC node exists and is its own interrupt parent. + * + * This applies to all models of imx6. Luckily all of them have the devices + * involved at the same addresses on the same busses, so we don't need any + * per-soc logic. We handle this at platform attach time rather than via the + * fdt_fixup_table, because the latter requires matching on the FDT "model" + * property, and this applies to all boards including those not yet invented. + */ +static void +fix_fdt_interrupt_data(void) +{ + phandle_t gicipar, gicnode, gicxref; + phandle_t gpcipar, gpcnode, gpcxref; + phandle_t socipar, socnode; + int result; + + socnode = OF_finddevice("/soc"); + if (socnode == -1) + return; + result = OF_getencprop(socnode, "interrupt-parent", &socipar, + sizeof(socipar)); + if (result <= 0) + return; + + gicnode = OF_finddevice("/soc/interrupt-controller@00a01000"); + if (gicnode == -1) + return; + result = OF_getencprop(gicnode, "interrupt-parent", &gicipar, + sizeof(gicipar)); + if (result <= 0) + return; + gicxref = OF_xref_from_node(gicnode); + + gpcnode = OF_finddevice("/soc/aips-bus@02000000/gpc@020dc000"); + if (gpcnode == -1) + return; + result = OF_getencprop(gpcnode, "interrupt-parent", &gpcipar, + sizeof(gpcipar)); + if (result <= 0) + return; + gpcxref = OF_xref_from_node(gpcnode); + + if (socipar != gpcxref || gpcipar != gicxref || gicipar != gicxref) + return; + + gicxref = cpu_to_fdt32(gicxref); + OF_setprop(socnode, "interrupt-parent", &gicxref, sizeof(gicxref)); +} + static vm_offset_t imx6_lastaddr(platform_t plat) { @@ -104,6 +172,10 @@ imx6_lastaddr(platform_t plat) static int imx6_attach(platform_t plat) { + + /* Fix soc interrupt-parent property. */ + fix_fdt_interrupt_data(); + /* Inform the MPCore timer driver that its clock is variable. */ arm_tmr_change_frequency(ARM_TMR_FREQUENCY_VARIES); From owner-svn-src-head@freebsd.org Tue Feb 23 01:19:27 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EB244AB167C; Tue, 23 Feb 2016 01:19:27 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A58F4206; Tue, 23 Feb 2016 01:19:27 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1N1JQZi079493; Tue, 23 Feb 2016 01:19:26 GMT (envelope-from marius@FreeBSD.org) Received: (from marius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1N1JQIs079488; Tue, 23 Feb 2016 01:19:26 GMT (envelope-from marius@FreeBSD.org) Message-Id: <201602230119.u1N1JQIs079488@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: marius set sender to marius@FreeBSD.org using -f From: Marius Strobl Date: Tue, 23 Feb 2016 01:19:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295906 - head/sys/dev/e1000 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Feb 2016 01:19:28 -0000 Author: marius Date: Tue Feb 23 01:19:26 2016 New Revision: 295906 URL: https://svnweb.freebsd.org/changeset/base/295906 Log: Fix and clean up usage of DMA and TSO segments: - At Intel it is believed that most of their products support "only" 40 DMA segments so lower {EM,IGB}_MAX_SCATTER accordingly. Actually, 40 is more than plenty to handle full size TSO packets so it doesn't make sense to further distinguish between MAC variants that really can do 64 DMA segments. Moreover, capping at 40 DMA segments limits the stack usage of {em,igb}_xmit() that - given the rare use of more than these - previously hardly was justifiable, while still being sufficient to avoid the problems seen with em(4) and EM_MAX_SCATTER set to 32. - In igb(4), pass the actually supported TSO parameters up the stack. Previously, the defaults set in if_attach_internal() were applied, i. e. a maximum of 35 TSO segments, which made supporting more than these in the driver pointless. However, this might explain why no problems were seen with IGB_MAX_SCATTER at 64. - In em(4), take the 5 m_pullup(9) invocations performed by em_xmit() in the TSO case into account when reporting TSO parameters upwards. In the worst case, each of these calls will add another mbuf and, thus, the requirement for an additional DMA segment. So for best performance, it doesn't make sense to advertize a maximum of TSO segments that typically will require defragmentation in em_xmit(). Again, this leaves enough room to handle full size TSO packets. - Drop TSO macros from if_lem.h given that corresponding MACS don't support TSO in the first place. Reviewed by: erj, sbruno, jeffrey.e.pieper_intel.com Approved by: erj MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D5238 Modified: head/sys/dev/e1000/if_em.c head/sys/dev/e1000/if_em.h head/sys/dev/e1000/if_igb.c head/sys/dev/e1000/if_igb.h head/sys/dev/e1000/if_lem.h Modified: head/sys/dev/e1000/if_em.c ============================================================================== --- head/sys/dev/e1000/if_em.c Tue Feb 23 01:09:35 2016 (r295905) +++ head/sys/dev/e1000/if_em.c Tue Feb 23 01:19:26 2016 (r295906) @@ -3193,9 +3193,11 @@ em_setup_interface(device_t dev, struct if_setflags(ifp, IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST); if_setioctlfn(ifp, em_ioctl); if_setgetcounterfn(ifp, em_get_counter); + /* TSO parameters */ ifp->if_hw_tsomax = IP_MAXPACKET; - ifp->if_hw_tsomaxsegcount = EM_MAX_SCATTER; + /* Take m_pullup(9)'s in em_xmit() w/ TSO into acount. */ + ifp->if_hw_tsomaxsegcount = EM_MAX_SCATTER - 5; ifp->if_hw_tsomaxsegsize = EM_TSO_SEG_SIZE; #ifdef EM_MULTIQUEUE Modified: head/sys/dev/e1000/if_em.h ============================================================================== --- head/sys/dev/e1000/if_em.h Tue Feb 23 01:09:35 2016 (r295905) +++ head/sys/dev/e1000/if_em.h Tue Feb 23 01:19:26 2016 (r295906) @@ -269,7 +269,7 @@ #define HW_DEBUGOUT1(S, A) if (DEBUG_HW) printf(S "\n", A) #define HW_DEBUGOUT2(S, A, B) if (DEBUG_HW) printf(S "\n", A, B) -#define EM_MAX_SCATTER 64 +#define EM_MAX_SCATTER 40 #define EM_VFTA_SIZE 128 #define EM_TSO_SIZE (65535 + sizeof(struct ether_vlan_header)) #define EM_TSO_SEG_SIZE 4096 /* Max dma segment size */ Modified: head/sys/dev/e1000/if_igb.c ============================================================================== --- head/sys/dev/e1000/if_igb.c Tue Feb 23 01:09:35 2016 (r295905) +++ head/sys/dev/e1000/if_igb.c Tue Feb 23 01:19:26 2016 (r295906) @@ -3139,6 +3139,12 @@ igb_setup_interface(device_t dev, struct ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST; ifp->if_ioctl = igb_ioctl; ifp->if_get_counter = igb_get_counter; + + /* TSO parameters */ + ifp->if_hw_tsomax = IP_MAXPACKET; + ifp->if_hw_tsomaxsegcount = IGB_MAX_SCATTER; + ifp->if_hw_tsomaxsegsize = IGB_TSO_SEG_SIZE; + #ifndef IGB_LEGACY_TX ifp->if_transmit = igb_mq_start; ifp->if_qflush = igb_qflush; Modified: head/sys/dev/e1000/if_igb.h ============================================================================== --- head/sys/dev/e1000/if_igb.h Tue Feb 23 01:09:35 2016 (r295905) +++ head/sys/dev/e1000/if_igb.h Tue Feb 23 01:19:26 2016 (r295906) @@ -278,7 +278,7 @@ #define HW_DEBUGOUT1(S, A) if (DEBUG_HW) printf(S "\n", A) #define HW_DEBUGOUT2(S, A, B) if (DEBUG_HW) printf(S "\n", A, B) -#define IGB_MAX_SCATTER 64 +#define IGB_MAX_SCATTER 40 #define IGB_VFTA_SIZE 128 #define IGB_BR_SIZE 4096 /* ring buf size */ #define IGB_TSO_SIZE (65535 + sizeof(struct ether_vlan_header)) Modified: head/sys/dev/e1000/if_lem.h ============================================================================== --- head/sys/dev/e1000/if_lem.h Tue Feb 23 01:09:35 2016 (r295905) +++ head/sys/dev/e1000/if_lem.h Tue Feb 23 01:19:26 2016 (r295906) @@ -236,10 +236,8 @@ #define HW_DEBUGOUT1(S, A) if (DEBUG_HW) printf(S "\n", A) #define HW_DEBUGOUT2(S, A, B) if (DEBUG_HW) printf(S "\n", A, B) -#define EM_MAX_SCATTER 64 +#define EM_MAX_SCATTER 40 #define EM_VFTA_SIZE 128 -#define EM_TSO_SIZE (65535 + sizeof(struct ether_vlan_header)) -#define EM_TSO_SEG_SIZE 4096 /* Max dma segment size */ #define EM_MSIX_MASK 0x01F00000 /* For 82574 use */ #define ETH_ZLEN 60 #define ETH_ADDR_LEN 6 From owner-svn-src-head@freebsd.org Tue Feb 23 01:56:59 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E45E9AB0B2D; Tue, 23 Feb 2016 01:56:59 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B51451A22; Tue, 23 Feb 2016 01:56:59 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1N1uwBY091287; Tue, 23 Feb 2016 01:56:58 GMT (envelope-from kevlo@FreeBSD.org) Received: (from kevlo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1N1uwaC091285; Tue, 23 Feb 2016 01:56:58 GMT (envelope-from kevlo@FreeBSD.org) Message-Id: <201602230156.u1N1uwaC091285@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevlo set sender to kevlo@FreeBSD.org using -f From: Kevin Lo Date: Tue, 23 Feb 2016 01:56:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295907 - in head/sys/dev/usb: . wlan X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Feb 2016 01:57:00 -0000 Author: kevlo Date: Tue Feb 23 01:56:58 2016 New Revision: 295907 URL: https://svnweb.freebsd.org/changeset/base/295907 Log: Add device ID for 'AboCom 802.11n' usb. PR: 207412 Submitted by: Philippe Michaud-Boudreault Modified: head/sys/dev/usb/usbdevs head/sys/dev/usb/wlan/if_urtwn.c Modified: head/sys/dev/usb/usbdevs ============================================================================== --- head/sys/dev/usb/usbdevs Tue Feb 23 01:19:26 2016 (r295906) +++ head/sys/dev/usb/usbdevs Tue Feb 23 01:56:58 2016 (r295907) @@ -835,6 +835,7 @@ product ABOCOM RT2573_4 0xb21e RT2573 product ABOCOM RTL8188CU_1 0x8188 RTL8188CU product ABOCOM RTL8188CU_2 0x8189 RTL8188CU product ABOCOM RTL8192CU 0x8178 RTL8192CU +product ABOCOM RTL8188EU 0x8179 RTL8188EU product ABOCOM WUG2700 0xb21f WUG2700 /* Acton Research Corp. */ Modified: head/sys/dev/usb/wlan/if_urtwn.c ============================================================================== --- head/sys/dev/usb/wlan/if_urtwn.c Tue Feb 23 01:19:26 2016 (r295906) +++ head/sys/dev/usb/wlan/if_urtwn.c Tue Feb 23 01:56:58 2016 (r295907) @@ -176,6 +176,7 @@ static const STRUCT_USB_HOST_ID urtwn_de URTWN_DEV(TRENDNET, RTL8192CU), URTWN_DEV(ZYXEL, RTL8192CU), /* URTWN_RTL8188E */ + URTWN_RTL8188E_DEV(ABOCOM, RTL8188EU), URTWN_RTL8188E_DEV(DLINK, DWA123D1), URTWN_RTL8188E_DEV(DLINK, DWA125D1), URTWN_RTL8188E_DEV(ELECOM, WDC150SU2M), From owner-svn-src-head@freebsd.org Tue Feb 23 02:28:20 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6EDC4AB17AA; Tue, 23 Feb 2016 02:28:20 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 42835A33; Tue, 23 Feb 2016 02:28:20 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1N2SJ7d000479; Tue, 23 Feb 2016 02:28:19 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1N2SJql000478; Tue, 23 Feb 2016 02:28:19 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201602230228.u1N2SJql000478@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Tue, 23 Feb 2016 02:28:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295908 - head/sys/powerpc/mpc85xx X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Feb 2016 02:28:20 -0000 Author: jhibbits Date: Tue Feb 23 02:28:19 2016 New Revision: 295908 URL: https://svnweb.freebsd.org/changeset/base/295908 Log: Allow the size argument for law_enable() to be non-power-of-2. Although the local access windows are powers of 2 in size, allow arguments that aren't power of 2, and round up. Modified: head/sys/powerpc/mpc85xx/mpc85xx.c Modified: head/sys/powerpc/mpc85xx/mpc85xx.c ============================================================================== --- head/sys/powerpc/mpc85xx/mpc85xx.c Tue Feb 23 01:56:58 2016 (r295907) +++ head/sys/powerpc/mpc85xx/mpc85xx.c Tue Feb 23 02:28:19 2016 (r295908) @@ -157,7 +157,8 @@ law_find_free(void) return (i); } -#define _LAW_SR(trgt,size) (0x80000000 | (trgt << 20) | (ffsl(size) - 2)) +#define _LAW_SR(trgt,size) (0x80000000 | (trgt << 20) | \ + (flsl(size + (size - 1)) - 2)) int law_enable(int trgt, uint64_t bar, uint32_t size) From owner-svn-src-head@freebsd.org Tue Feb 23 02:57:47 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 16035AB034E; Tue, 23 Feb 2016 02:57:47 +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 mx1.freebsd.org (Postfix) with ESMTPS id D808918EC; Tue, 23 Feb 2016 02:57:46 +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 u1N2vj34009462; Tue, 23 Feb 2016 02:57:45 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1N2vjgF009461; Tue, 23 Feb 2016 02:57:45 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201602230257.u1N2vjgF009461@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Tue, 23 Feb 2016 02:57:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295909 - head/sys/dev/uart X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Feb 2016 02:57:47 -0000 Author: ian Date: Tue Feb 23 02:57:45 2016 New Revision: 295909 URL: https://svnweb.freebsd.org/changeset/base/295909 Log: Now that we have OF_decode_addr(), with proper MD implementations, to obtain the bus space tag and handle for a uart console, use the values returned by that routine to set the global uart_bus_space_mem, instead of assuming that there will be a global variable named fdtbus_bs_tag to set it from. Also, use OF_getencprop() instead calling fdt32_to_cpu() separately. Modified: head/sys/dev/uart/uart_cpu_fdt.c Modified: head/sys/dev/uart/uart_cpu_fdt.c ============================================================================== --- head/sys/dev/uart/uart_cpu_fdt.c Tue Feb 23 02:28:19 2016 (r295908) +++ head/sys/dev/uart/uart_cpu_fdt.c Tue Feb 23 02:57:45 2016 (r295909) @@ -136,9 +136,6 @@ uart_cpu_getdev(int devtype, struct uart char *cp; int err; - uart_bus_space_mem = fdtbus_bs_tag; - uart_bus_space_io = NULL; - /* Allow overriding the FDT using the environment. */ class = &uart_ns8250_class; err = uart_getenv(devtype, di, class); @@ -195,10 +192,8 @@ uart_cpu_getdev(int devtype, struct uart if (uart_fdt_get_shift(node, &shift) != 0) shift = uart_getregshift(class); - if (OF_getprop(node, "current-speed", &br, sizeof(br)) <= 0) + if (OF_getencprop(node, "current-speed", &br, sizeof(br)) <= 0) br = 0; - else - br = fdt32_to_cpu(br); /* * Finalize configuration. @@ -212,5 +207,9 @@ uart_cpu_getdev(int devtype, struct uart di->stopbits = 1; di->parity = UART_PARITY_NONE; - return (OF_decode_addr(node, 0, &di->bas.bst, &di->bas.bsh, NULL)); + err = OF_decode_addr(node, 0, &di->bas.bst, &di->bas.bsh, NULL); + uart_bus_space_mem = di->bas.bst; + uart_bus_space_io = NULL; + + return (err); } From owner-svn-src-head@freebsd.org Tue Feb 23 03:01:47 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BF049AB0594; Tue, 23 Feb 2016 03:01:47 +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 mx1.freebsd.org (Postfix) with ESMTPS id 918D01D9A; Tue, 23 Feb 2016 03:01:47 +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 u1N31k5f012562; Tue, 23 Feb 2016 03:01:46 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1N31kdH012561; Tue, 23 Feb 2016 03:01:46 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201602230301.u1N31kdH012561@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Tue, 23 Feb 2016 03:01:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295910 - head/sys/dev/uart X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Feb 2016 03:01:47 -0000 Author: ian Date: Tue Feb 23 03:01:46 2016 New Revision: 295910 URL: https://svnweb.freebsd.org/changeset/base/295910 Log: This code no longer references fdtbus_bs_tag, no need for a special extern declaration of it for aarch64. Modified: head/sys/dev/uart/uart_cpu_fdt.c Modified: head/sys/dev/uart/uart_cpu_fdt.c ============================================================================== --- head/sys/dev/uart/uart_cpu_fdt.c Tue Feb 23 02:57:45 2016 (r295909) +++ head/sys/dev/uart/uart_cpu_fdt.c Tue Feb 23 03:01:46 2016 (r295910) @@ -54,10 +54,6 @@ __FBSDID("$FreeBSD$"); #include #include -#ifdef __aarch64__ -extern bus_space_tag_t fdtbus_bs_tag; -#endif - /* * UART console routines. */ From owner-svn-src-head@freebsd.org Tue Feb 23 03:34:37 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8F1EDAB1234; Tue, 23 Feb 2016 03:34:37 +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 mx1.freebsd.org (Postfix) with ESMTPS id 63592E73; Tue, 23 Feb 2016 03:34:37 +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 u1N3YaU8021318; Tue, 23 Feb 2016 03:34:36 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1N3YaxK021317; Tue, 23 Feb 2016 03:34:36 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201602230334.u1N3YaxK021317@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Tue, 23 Feb 2016 03:34:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295911 - head/sys/dev/uart X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Feb 2016 03:34:37 -0000 Author: ian Date: Tue Feb 23 03:34:36 2016 New Revision: 295911 URL: https://svnweb.freebsd.org/changeset/base/295911 Log: Stop using the global fdtbus_bs_tag and instead use the tag from the softc that was set up properly at init time. Modified: head/sys/dev/uart/uart_dev_lpc.c Modified: head/sys/dev/uart/uart_dev_lpc.c ============================================================================== --- head/sys/dev/uart/uart_dev_lpc.c Tue Feb 23 03:01:46 2016 (r295910) +++ head/sys/dev/uart/uart_dev_lpc.c Tue Feb 23 03:34:36 2016 (r295911) @@ -32,7 +32,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include @@ -49,9 +48,9 @@ __FBSDID("$FreeBSD$"); static bus_space_handle_t bsh_clkpwr; #define lpc_ns8250_get_clkreg(_bas, _reg) \ - bus_space_read_4(fdtbus_bs_tag, bsh_clkpwr, (_reg)) + bus_space_read_4((_bas)->bst, bsh_clkpwr, (_reg)) #define lpc_ns8250_set_clkreg(_bas, _reg, _val) \ - bus_space_write_4(fdtbus_bs_tag, bsh_clkpwr, (_reg), (_val)) + bus_space_write_4((_bas)->bst, bsh_clkpwr, (_reg), (_val)) /* * Clear pending interrupts. THRE is cleared by reading IIR. Data @@ -292,7 +291,7 @@ lpc_ns8250_init(struct uart_bas *bas, in u_long clkmode; /* Enable UART clock */ - bus_space_map(fdtbus_bs_tag, LPC_CLKPWR_PHYS_BASE, LPC_CLKPWR_SIZE, 0, + bus_space_map(bas->bst, LPC_CLKPWR_PHYS_BASE, LPC_CLKPWR_SIZE, 0, &bsh_clkpwr); clkmode = lpc_ns8250_get_clkreg(bas, LPC_UART_CLKMODE); lpc_ns8250_set_clkreg(bas, LPC_UART_CLKMODE, clkmode | From owner-svn-src-head@freebsd.org Tue Feb 23 07:13:23 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6E61BAB1AA3; Tue, 23 Feb 2016 07:13: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 mx1.freebsd.org (Postfix) with ESMTPS id 40BB25DF; Tue, 23 Feb 2016 07:13: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 u1N7DM31084046; Tue, 23 Feb 2016 07:13:22 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1N7DMd1084045; Tue, 23 Feb 2016 07:13:22 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201602230713.u1N7DMd1084045@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Tue, 23 Feb 2016 07:13:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295914 - head/contrib/libarchive/libarchive X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Feb 2016 07:13:23 -0000 Author: delphij Date: Tue Feb 23 07:13:22 2016 New Revision: 295914 URL: https://svnweb.freebsd.org/changeset/base/295914 Log: MFV r295913: Partially apply upstream changeset 6e06b1c8 (kientzle). Limit filter recursion level to 25 (instead of infinite). This fixes a potential crash issue discovered by Alexander Cherepanov. PR: 207362 Reported by: Robert Clausecker Obtained from: libarchive github project Modified: head/contrib/libarchive/libarchive/archive_read.c Directory Properties: head/contrib/libarchive/ (props changed) head/contrib/libarchive/libarchive/ (props changed) Modified: head/contrib/libarchive/libarchive/archive_read.c ============================================================================== --- head/contrib/libarchive/libarchive/archive_read.c Tue Feb 23 07:04:54 2016 (r295913) +++ head/contrib/libarchive/libarchive/archive_read.c Tue Feb 23 07:13:22 2016 (r295914) @@ -545,13 +545,13 @@ archive_read_open1(struct archive *_a) static int choose_filters(struct archive_read *a) { - int number_bidders, i, bid, best_bid; + int number_bidders, i, bid, best_bid, n; struct archive_read_filter_bidder *bidder, *best_bidder; struct archive_read_filter *filter; ssize_t avail; int r; - for (;;) { + for (n = 0; n < 25; ++n) { number_bidders = sizeof(a->bidders) / sizeof(a->bidders[0]); best_bid = 0; @@ -597,6 +597,9 @@ choose_filters(struct archive_read *a) return (ARCHIVE_FATAL); } } + archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT, + "Input requires too many filters for decoding"); + return (ARCHIVE_FATAL); } /* From owner-svn-src-head@freebsd.org Tue Feb 23 09:20:34 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8306AAAF0F2; Tue, 23 Feb 2016 09:20:34 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5DADD1D4; Tue, 23 Feb 2016 09:20:34 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1N9KX99019339; Tue, 23 Feb 2016 09:20:33 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1N9KXCx019338; Tue, 23 Feb 2016 09:20:33 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201602230920.u1N9KXCx019338@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Tue, 23 Feb 2016 09:20:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295916 - head/sys/dev/hyperv/netvsc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Feb 2016 09:20:34 -0000 Author: sephe Date: Tue Feb 23 09:20:33 2016 New Revision: 295916 URL: https://svnweb.freebsd.org/changeset/base/295916 Log: hyperv/hn: Factor out hn_send_pkt() from hn_start_locked() It will be shared w/ the upcoming ifnet.if_transmit method implementation. No functional change. MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D5385 Modified: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Modified: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Tue Feb 23 08:12:39 2016 (r295915) +++ head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Tue Feb 23 09:20:33 2016 (r295916) @@ -905,6 +905,68 @@ done: } /* + * NOTE: + * If this function fails, then txd will be freed, but the mbuf + * associated w/ the txd will _not_ be freed. + */ +static int +hn_send_pkt(struct ifnet *ifp, struct hv_device *device_ctx, + struct hn_tx_ring *txr, struct hn_txdesc *txd) +{ + int error, send_failed = 0; + +again: + /* + * Make sure that txd is not freed before ETHER_BPF_MTAP. + */ + hn_txdesc_hold(txd); + error = hv_nv_on_send(device_ctx, &txd->netvsc_pkt); + if (!error) { + ETHER_BPF_MTAP(ifp, txd->m); + if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1); + } + hn_txdesc_put(txr, txd); + + if (__predict_false(error)) { + int freed; + + /* + * This should "really rarely" happen. + * + * XXX Too many RX to be acked or too many sideband + * commands to run? Ask netvsc_channel_rollup() + * to kick start later. + */ + txr->hn_has_txeof = 1; + if (!send_failed) { + txr->hn_send_failed++; + send_failed = 1; + /* + * Try sending again after set hn_has_txeof; + * in case that we missed the last + * netvsc_channel_rollup(). + */ + goto again; + } + if_printf(ifp, "send failed\n"); + + /* + * Caller will perform further processing on the + * associated mbuf, so don't free it in hn_txdesc_put(); + * only unload it from the DMA map in hn_txdesc_put(), + * if it was loaded. + */ + txd->m = NULL; + freed = hn_txdesc_put(txr, txd); + KASSERT(freed != 0, + ("fail to free txd upon send error")); + + txr->hn_send_failed++; + } + return error; +} + +/* * Start a transmit of one or more packets */ static int @@ -922,9 +984,9 @@ hn_start_locked(struct hn_tx_ring *txr, return 0; while (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) { - int error, send_failed = 0; struct hn_txdesc *txd; struct mbuf *m_head; + int error; IFQ_DRV_DEQUEUE(&ifp->if_snd, m_head); if (m_head == NULL) @@ -953,52 +1015,10 @@ hn_start_locked(struct hn_tx_ring *txr, /* Both txd and m_head are freed */ continue; } -again: - /* - * Make sure that txd is not freed before ETHER_BPF_MTAP. - */ - hn_txdesc_hold(txd); - error = hv_nv_on_send(device_ctx, &txd->netvsc_pkt); - if (!error) { - ETHER_BPF_MTAP(ifp, m_head); - if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1); - } - hn_txdesc_put(txr, txd); + error = hn_send_pkt(ifp, device_ctx, txr, txd); if (__predict_false(error)) { - int freed; - - /* - * This should "really rarely" happen. - * - * XXX Too many RX to be acked or too many sideband - * commands to run? Ask netvsc_channel_rollup() - * to kick start later. - */ - txr->hn_has_txeof = 1; - if (!send_failed) { - txr->hn_send_failed++; - send_failed = 1; - /* - * Try sending again after set hn_has_txeof; - * in case that we missed the last - * netvsc_channel_rollup(). - */ - goto again; - } - if_printf(ifp, "send failed\n"); - - /* - * This mbuf will be prepended, don't free it - * in hn_txdesc_put(); only unload it from the - * DMA map in hn_txdesc_put(), if it was loaded. - */ - txd->m = NULL; - freed = hn_txdesc_put(txr, txd); - KASSERT(freed != 0, - ("fail to free txd upon send error")); - - txr->hn_send_failed++; + /* txd is freed, but m_head is not */ IF_PREPEND(&ifp->if_snd, m_head); atomic_set_int(&ifp->if_drv_flags, IFF_DRV_OACTIVE); break; From owner-svn-src-head@freebsd.org Tue Feb 23 09:22:01 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9E08DAAF2C3; Tue, 23 Feb 2016 09:22:01 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5597D857; Tue, 23 Feb 2016 09:22:01 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1N9M09c022124; Tue, 23 Feb 2016 09:22:00 GMT (envelope-from ed@FreeBSD.org) Received: (from ed@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1N9M0sh022123; Tue, 23 Feb 2016 09:22:00 GMT (envelope-from ed@FreeBSD.org) Message-Id: <201602230922.u1N9M0sh022123@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ed set sender to ed@FreeBSD.org using -f From: Ed Schouten Date: Tue, 23 Feb 2016 09:22:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295917 - head/sys/compat/cloudabi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Feb 2016 09:22:01 -0000 Author: ed Date: Tue Feb 23 09:22:00 2016 New Revision: 295917 URL: https://svnweb.freebsd.org/changeset/base/295917 Log: Make handling of mmap()'s prot argument more strict. - Make the system call fail if prot contains bits other than read, write and exec. - Similar to OpenBSD's W^X, don't allow write and exec to be set at the same time. I'd like to see for now what happens if we enforce this policy unconditionally. If it turns out that this is far too strict, we'll loosen this requirement. Modified: head/sys/compat/cloudabi/cloudabi_mem.c Modified: head/sys/compat/cloudabi/cloudabi_mem.c ============================================================================== --- head/sys/compat/cloudabi/cloudabi_mem.c Tue Feb 23 09:20:33 2016 (r295916) +++ head/sys/compat/cloudabi/cloudabi_mem.c Tue Feb 23 09:22:00 2016 (r295917) @@ -35,18 +35,26 @@ __FBSDID("$FreeBSD$"); /* Converts CloudABI's memory protection flags to FreeBSD's. */ static int -convert_mprot(cloudabi_mprot_t in) +convert_mprot(cloudabi_mprot_t in, int *out) { - int out; - out = 0; + /* Unknown protection flags. */ + if ((in & ~(CLOUDABI_PROT_EXEC | CLOUDABI_PROT_WRITE | + CLOUDABI_PROT_READ)) != 0) + return (ENOTSUP); + /* W^X: Write and exec cannot be enabled at the same time. */ + if ((in & (CLOUDABI_PROT_EXEC | CLOUDABI_PROT_WRITE)) == + (CLOUDABI_PROT_EXEC | CLOUDABI_PROT_WRITE)) + return (ENOTSUP); + + *out = 0; if (in & CLOUDABI_PROT_EXEC) - out |= PROT_EXEC; + *out |= PROT_EXEC; if (in & CLOUDABI_PROT_WRITE) - out |= PROT_WRITE; + *out |= PROT_WRITE; if (in & CLOUDABI_PROT_READ) - out |= PROT_READ; - return (out); + *out |= PROT_READ; + return (0); } int @@ -98,10 +106,10 @@ cloudabi_sys_mem_map(struct thread *td, struct mmap_args mmap_args = { .addr = uap->addr, .len = uap->len, - .prot = convert_mprot(uap->prot), .fd = uap->fd, .pos = uap->off }; + int error; /* Translate flags. */ if (uap->flags & CLOUDABI_MAP_ANON) @@ -113,6 +121,11 @@ cloudabi_sys_mem_map(struct thread *td, if (uap->flags & CLOUDABI_MAP_SHARED) mmap_args.flags |= MAP_SHARED; + /* Translate protection. */ + error = convert_mprot(uap->prot, &mmap_args.prot); + if (error != 0) + return (error); + return (sys_mmap(td, &mmap_args)); } @@ -123,8 +136,13 @@ cloudabi_sys_mem_protect(struct thread * struct mprotect_args mprotect_args = { .addr = uap->addr, .len = uap->len, - .prot = convert_mprot(uap->prot), }; + int error; + + /* Translate protection. */ + error = convert_mprot(uap->prot, &mprotect_args.prot); + if (error != 0) + return (error); return (sys_mprotect(td, &mprotect_args)); } From owner-svn-src-head@freebsd.org Tue Feb 23 09:25:21 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7E1BFAAF4A9; Tue, 23 Feb 2016 09:25:21 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 507FBC8E; Tue, 23 Feb 2016 09:25:21 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1N9PKJ8022550; Tue, 23 Feb 2016 09:25:20 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1N9PKga022549; Tue, 23 Feb 2016 09:25:20 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201602230925.u1N9PKga022549@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Tue, 23 Feb 2016 09:25:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295918 - head/sys/dev/hyperv/netvsc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Feb 2016 09:25:21 -0000 Author: sephe Date: Tue Feb 23 09:25:20 2016 New Revision: 295918 URL: https://svnweb.freebsd.org/changeset/base/295918 Log: hyperv/hn: Use IFQ_DRV_PREPEND instead of IF_PREPEND IF_PREPEND promises out-of-order packet sending when the TX desc list is depleted. It was overlooked and copied blindly when the transmission path was partially rewritten. MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D5386 Modified: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Modified: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Tue Feb 23 09:22:00 2016 (r295917) +++ head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Tue Feb 23 09:25:20 2016 (r295918) @@ -998,14 +998,14 @@ hn_start_locked(struct hn_tx_ring *txr, * dispatch this packet sending (and sending of any * following up packets) to tx taskqueue. */ - IF_PREPEND(&ifp->if_snd, m_head); + IFQ_DRV_PREPEND(&ifp->if_snd, m_head); return 1; } txd = hn_txdesc_get(txr); if (txd == NULL) { txr->hn_no_txdescs++; - IF_PREPEND(&ifp->if_snd, m_head); + IFQ_DRV_PREPEND(&ifp->if_snd, m_head); atomic_set_int(&ifp->if_drv_flags, IFF_DRV_OACTIVE); break; } @@ -1019,7 +1019,7 @@ hn_start_locked(struct hn_tx_ring *txr, error = hn_send_pkt(ifp, device_ctx, txr, txd); if (__predict_false(error)) { /* txd is freed, but m_head is not */ - IF_PREPEND(&ifp->if_snd, m_head); + IFQ_DRV_PREPEND(&ifp->if_snd, m_head); atomic_set_int(&ifp->if_drv_flags, IFF_DRV_OACTIVE); break; } From owner-svn-src-head@freebsd.org Tue Feb 23 09:29:47 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 12942AAF6D8; Tue, 23 Feb 2016 09:29:47 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D9714ECD; Tue, 23 Feb 2016 09:29:46 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1N9Tj8e022720; Tue, 23 Feb 2016 09:29:45 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1N9TjlE022719; Tue, 23 Feb 2016 09:29:45 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201602230929.u1N9TjlE022719@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Tue, 23 Feb 2016 09:29:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295919 - head/sys/dev/hyperv/storvsc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Feb 2016 09:29:47 -0000 Author: sephe Date: Tue Feb 23 09:29:45 2016 New Revision: 295919 URL: https://svnweb.freebsd.org/changeset/base/295919 Log: hyperv/stor: Fix print format Detected by: PVS Static Analysis MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D5388 Modified: head/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c Modified: head/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c ============================================================================== --- head/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c Tue Feb 23 09:25:20 2016 (r295918) +++ head/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c Tue Feb 23 09:29:45 2016 (r295919) @@ -810,8 +810,8 @@ hv_storvsc_rescan_target(struct storvsc_ if (xpt_create_path(&ccb->ccb_h.path, NULL, pathid, targetid, CAM_LUN_WILDCARD) != CAM_REQ_CMP) { - printf("unable to create path for rescan, pathid: %d," - "targetid: %d\n", pathid, targetid); + printf("unable to create path for rescan, pathid: %u," + "targetid: %u\n", pathid, targetid); xpt_free_ccb(ccb); return; } From owner-svn-src-head@freebsd.org Tue Feb 23 10:12:52 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0AEC5AB1F58; Tue, 23 Feb 2016 10:12:52 +0000 (UTC) (envelope-from skra@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D036E19D1; Tue, 23 Feb 2016 10:12:51 +0000 (UTC) (envelope-from skra@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1NACoRC039301; Tue, 23 Feb 2016 10:12:50 GMT (envelope-from skra@FreeBSD.org) Received: (from skra@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1NACowq039299; Tue, 23 Feb 2016 10:12:50 GMT (envelope-from skra@FreeBSD.org) Message-Id: <201602231012.u1NACowq039299@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: skra set sender to skra@FreeBSD.org using -f From: Svatopluk Kraus Date: Tue, 23 Feb 2016 10:12:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295920 - in head/sys/arm: arm include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Feb 2016 10:12:52 -0000 Author: skra Date: Tue Feb 23 10:12:50 2016 New Revision: 295920 URL: https://svnweb.freebsd.org/changeset/base/295920 Log: Remove redundant __ARM_ARCH >= 6 check in armv6 specific files. Modified: head/sys/arm/arm/cpu_asm-v6.S head/sys/arm/include/cpu-v6.h Modified: head/sys/arm/arm/cpu_asm-v6.S ============================================================================== --- head/sys/arm/arm/cpu_asm-v6.S Tue Feb 23 09:29:45 2016 (r295919) +++ head/sys/arm/arm/cpu_asm-v6.S Tue Feb 23 10:12:50 2016 (r295920) @@ -34,16 +34,9 @@ #include #include -#if __ARM_ARCH >= 6 #define GET_PCB(tmp) \ - mrc CP15_TPIDRPRW(tmp); \ - add tmp, tmp, #(TD_PCB) -#else -.Lcurpcb: - .word _C_LABEL(__pcpu) + PC_CURPCB -#define GET_PCB(tmp) \ - ldr tmp, .Lcurpcb -#endif + mrc CP15_TPIDRPRW(tmp); \ + add tmp, tmp, #(TD_PCB) /* * Define cache functions used by startup code, which counts on the fact that Modified: head/sys/arm/include/cpu-v6.h ============================================================================== --- head/sys/arm/include/cpu-v6.h Tue Feb 23 09:29:45 2016 (r295919) +++ head/sys/arm/include/cpu-v6.h Tue Feb 23 10:12:50 2016 (r295920) @@ -177,15 +177,12 @@ _RF0(cp15_dfar_get, CP15_DFAR(%0)) _RF0(cp15_ifar_get, CP15_IFAR(%0)) _RF0(cp15_l2ctlr_get, CP15_L2CTLR(%0)) #endif -/* ARMv6+ and XScale */ _RF0(cp15_actlr_get, CP15_ACTLR(%0)) _WF1(cp15_actlr_set, CP15_ACTLR(%0)) -#if __ARM_ARCH >= 6 _WF1(cp15_ats1cpr_set, CP15_ATS1CPR(%0)) _WF1(cp15_ats1cpw_set, CP15_ATS1CPW(%0)) _RF0(cp15_par_get, CP15_PAR(%0)) _RF0(cp15_sctlr_get, CP15_SCTLR(%0)) -#endif /*CPU id registers */ _RF0(cp15_midr_get, CP15_MIDR(%0)) From owner-svn-src-head@freebsd.org Tue Feb 23 14:21:47 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C75D6AB2147; Tue, 23 Feb 2016 14:21:47 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7FE52C0F; Tue, 23 Feb 2016 14:21:47 +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 u1NELkjK014093; Tue, 23 Feb 2016 14:21:46 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1NELk3V014090; Tue, 23 Feb 2016 14:21:46 GMT (envelope-from br@FreeBSD.org) Message-Id: <201602231421.u1NELk3V014090@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Tue, 23 Feb 2016 14:21:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295921 - in head/sys: boot/fdt/dts/riscv riscv/riscv X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Feb 2016 14:21:47 -0000 Author: br Date: Tue Feb 23 14:21:46 2016 New Revision: 295921 URL: https://svnweb.freebsd.org/changeset/base/295921 Log: o Grab physical memory regions information from the device tree. o Increase memory size. Modified: head/sys/boot/fdt/dts/riscv/qemu.dts head/sys/boot/fdt/dts/riscv/spike.dts head/sys/riscv/riscv/machdep.c Modified: head/sys/boot/fdt/dts/riscv/qemu.dts ============================================================================== --- head/sys/boot/fdt/dts/riscv/qemu.dts Tue Feb 23 10:12:50 2016 (r295920) +++ head/sys/boot/fdt/dts/riscv/qemu.dts Tue Feb 23 14:21:46 2016 (r295921) @@ -49,7 +49,7 @@ memory { device_type = "memory"; - reg = <0x0 0x8000000>; /* 128MB at 0x0 */ + reg = <0x0 0x40000000>; /* 1GB at 0x0 */ }; soc { Modified: head/sys/boot/fdt/dts/riscv/spike.dts ============================================================================== --- head/sys/boot/fdt/dts/riscv/spike.dts Tue Feb 23 10:12:50 2016 (r295920) +++ head/sys/boot/fdt/dts/riscv/spike.dts Tue Feb 23 14:21:46 2016 (r295921) @@ -49,7 +49,7 @@ memory { device_type = "memory"; - reg = <0x0 0x8000000>; /* 128MB at 0x0 */ + reg = <0x0 0x40000000>; /* 1GB at 0x0 */ }; soc { Modified: head/sys/riscv/riscv/machdep.c ============================================================================== --- head/sys/riscv/riscv/machdep.c Tue Feb 23 10:12:50 2016 (r295920) +++ head/sys/riscv/riscv/machdep.c Tue Feb 23 14:21:46 2016 (r295921) @@ -729,9 +729,13 @@ fake_preload_metadata(struct riscv_bootp void initriscv(struct riscv_bootparams *rvbp) { + struct mem_region mem_regions[FDT_MEM_REGIONS]; vm_offset_t lastaddr; + int mem_regions_sz; vm_size_t kernlen; + uint32_t memsize; caddr_t kmdp; + int i; /* Set the module data location */ lastaddr = fake_preload_metadata(rvbp); @@ -752,11 +756,12 @@ initriscv(struct riscv_bootparams *rvbp) /* Load the physical memory ranges */ physmap_idx = 0; - /* - * RISCVTODO: figure out whether platform provides ranges, - * or grab from FDT. - */ - add_physmap_entry(0, 0x8000000, physmap, &physmap_idx); + /* Grab physical memory regions information from device tree. */ + if (fdt_get_mem_regions(mem_regions, &mem_regions_sz, &memsize) != 0) + panic("Cannot get physical memory regions"); + for (i = 0; i < mem_regions_sz; i++) + add_physmap_entry(mem_regions[i].mr_start, + mem_regions[i].mr_size, physmap, &physmap_idx); /* Set the pcpu data, this is needed by pmap_bootstrap */ pcpup = &__pcpu[0]; From owner-svn-src-head@freebsd.org Tue Feb 23 14:29:23 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 953FBAB2474; Tue, 23 Feb 2016 14:29:23 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6628B1076; Tue, 23 Feb 2016 14:29:23 +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 u1NETMlf014424; Tue, 23 Feb 2016 14:29:22 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1NETM0k014423; Tue, 23 Feb 2016 14:29:22 GMT (envelope-from br@FreeBSD.org) Message-Id: <201602231429.u1NETM0k014423@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Tue, 23 Feb 2016 14:29:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295922 - head/sys/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Feb 2016 14:29:23 -0000 Author: br Date: Tue Feb 23 14:29:22 2016 New Revision: 295922 URL: https://svnweb.freebsd.org/changeset/base/295922 Log: Set a dependencies for stack(9) RISC-V MD part. Pointed out by: andrew Modified: head/sys/conf/files.riscv Modified: head/sys/conf/files.riscv ============================================================================== --- head/sys/conf/files.riscv Tue Feb 23 14:21:46 2016 (r295921) +++ head/sys/conf/files.riscv Tue Feb 23 14:29:22 2016 (r295922) @@ -34,7 +34,7 @@ riscv/riscv/machdep.c standard riscv/riscv/mem.c standard riscv/riscv/nexus.c standard riscv/riscv/pmap.c standard -riscv/riscv/stack_machdep.c standard +riscv/riscv/stack_machdep.c optional ddb | stack riscv/riscv/support.S standard riscv/riscv/swtch.S standard riscv/riscv/sys_machdep.c standard From owner-svn-src-head@freebsd.org Tue Feb 23 14:58:21 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6A67CAB2D7B; Tue, 23 Feb 2016 14:58:21 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3C20C1E59; Tue, 23 Feb 2016 14:58:21 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1NEwKRM023124; Tue, 23 Feb 2016 14:58:20 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1NEwK1G023123; Tue, 23 Feb 2016 14:58:20 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201602231458.u1NEwK1G023123@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Tue, 23 Feb 2016 14:58:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295923 - head/sys/dev/usb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Feb 2016 14:58:21 -0000 Author: hselasky Date: Tue Feb 23 14:58:20 2016 New Revision: 295923 URL: https://svnweb.freebsd.org/changeset/base/295923 Log: Be more verbose when truncating number of HID items. Suggested by: Larry Rosenman MFC after: 1 week Modified: head/sys/dev/usb/usb_hid.c Modified: head/sys/dev/usb/usb_hid.c ============================================================================== --- head/sys/dev/usb/usb_hid.c Tue Feb 23 14:29:22 2016 (r295922) +++ head/sys/dev/usb/usb_hid.c Tue Feb 23 14:58:20 2016 (r295923) @@ -354,7 +354,8 @@ hid_get_item(struct hid_data *s, struct /* range check usage count */ if (c->loc.count > 255) { DPRINTFN(0, "Number of " - "items truncated to 255\n"); + "items(%u) truncated to 255\n", + (unsigned)(c->loc.count)); s->ncount = 255; } else s->ncount = c->loc.count; From owner-svn-src-head@freebsd.org Tue Feb 23 15:21:14 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A5BBCAB1652; Tue, 23 Feb 2016 15:21:14 +0000 (UTC) (envelope-from dwmalone@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7890010AB; Tue, 23 Feb 2016 15:21:14 +0000 (UTC) (envelope-from dwmalone@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1NFLDwU029759; Tue, 23 Feb 2016 15:21:13 GMT (envelope-from dwmalone@FreeBSD.org) Received: (from dwmalone@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1NFLDIU029758; Tue, 23 Feb 2016 15:21:13 GMT (envelope-from dwmalone@FreeBSD.org) Message-Id: <201602231521.u1NFLDIU029758@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dwmalone set sender to dwmalone@FreeBSD.org using -f From: David Malone Date: Tue, 23 Feb 2016 15:21:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295924 - head/lib/libc/db/hash X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Feb 2016 15:21:14 -0000 Author: dwmalone Date: Tue Feb 23 15:21:13 2016 New Revision: 295924 URL: https://svnweb.freebsd.org/changeset/base/295924 Log: If we close or sync a hash-based db file, make sure to call fsync to make sure the changes are on disk. The people at pfSense noticed that it didn't always make it to the disk soon enough with soft updates. Differential Revision: https://reviews.freebsd.org/D5186 Reviewed by: garga, vangyzen, bapt, se MFC after: 1 week Modified: head/lib/libc/db/hash/hash.c Modified: head/lib/libc/db/hash/hash.c ============================================================================== --- head/lib/libc/db/hash/hash.c Tue Feb 23 14:58:20 2016 (r295923) +++ head/lib/libc/db/hash/hash.c Tue Feb 23 15:21:13 2016 (r295924) @@ -422,8 +422,10 @@ hdestroy(HTAB *hashp) if (hashp->tmp_buf) free(hashp->tmp_buf); - if (hashp->fp != -1) + if (hashp->fp != -1) { + (void)_fsync(hashp->fp); (void)_close(hashp->fp); + } free(hashp); @@ -458,6 +460,8 @@ hash_sync(const DB *dbp, u_int32_t flags return (0); if (__buf_free(hashp, 0, 1) || flush_meta(hashp)) return (ERROR); + if (hashp->fp != -1 && _fsync(hashp->fp) != 0) + return (ERROR); hashp->new_file = 0; return (0); } From owner-svn-src-head@freebsd.org Tue Feb 23 15:28:14 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CDF9AAB1A61; Tue, 23 Feb 2016 15:28:14 +0000 (UTC) (envelope-from dwmalone@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8520B147E; Tue, 23 Feb 2016 15:28:14 +0000 (UTC) (envelope-from dwmalone@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1NFSDYh033452; Tue, 23 Feb 2016 15:28:13 GMT (envelope-from dwmalone@FreeBSD.org) Received: (from dwmalone@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1NFSDQd033451; Tue, 23 Feb 2016 15:28:13 GMT (envelope-from dwmalone@FreeBSD.org) Message-Id: <201602231528.u1NFSDQd033451@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dwmalone set sender to dwmalone@FreeBSD.org using -f From: David Malone Date: Tue, 23 Feb 2016 15:28:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295925 - head/usr.sbin/pwd_mkdb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Feb 2016 15:28:14 -0000 Author: dwmalone Date: Tue Feb 23 15:28:13 2016 New Revision: 295925 URL: https://svnweb.freebsd.org/changeset/base/295925 Log: Following revision r295924, the changes to a db file should be fsynced before the file is closed. Consequently, it shouldn't be necessary to open the file with O_SYNC any more. This improves the performance of building large .db files for large password files a lot and should resolve this problem: https://forums.freebsd.org/threads/10-2-pre-pwd_mkdb-slow-on-larger-master-passwd.52700/ Differential Revision: https://reviews.freebsd.org/D5186 Reviewed by: garga, vangyzen, bapt, se MFC after: 1 week Modified: head/usr.sbin/pwd_mkdb/pwd_mkdb.c Modified: head/usr.sbin/pwd_mkdb/pwd_mkdb.c ============================================================================== --- head/usr.sbin/pwd_mkdb/pwd_mkdb.c Tue Feb 23 15:21:13 2016 (r295924) +++ head/usr.sbin/pwd_mkdb/pwd_mkdb.c Tue Feb 23 15:28:13 2016 (r295925) @@ -228,14 +228,14 @@ main(int argc, char *argv[]) clean = FILE_INSECURE; cp(buf2, buf, PERM_INSECURE); dp = dbopen(buf, - O_RDWR|O_EXCL|O_SYNC, PERM_INSECURE, DB_HASH, &openinfo); + O_RDWR|O_EXCL, PERM_INSECURE, DB_HASH, &openinfo); if (dp == NULL) error(buf); clean = FILE_SECURE; cp(sbuf2, sbuf, PERM_SECURE); sdp = dbopen(sbuf, - O_RDWR|O_EXCL|O_SYNC, PERM_SECURE, DB_HASH, &openinfo); + O_RDWR|O_EXCL, PERM_SECURE, DB_HASH, &openinfo); if (sdp == NULL) error(sbuf); @@ -292,13 +292,13 @@ main(int argc, char *argv[]) method = 0; } else { dp = dbopen(buf, - O_RDWR|O_CREAT|O_EXCL|O_SYNC, PERM_INSECURE, DB_HASH, &openinfo); + O_RDWR|O_CREAT|O_EXCL, PERM_INSECURE, DB_HASH, &openinfo); if (dp == NULL) error(buf); clean = FILE_INSECURE; sdp = dbopen(sbuf, - O_RDWR|O_CREAT|O_EXCL|O_SYNC, PERM_SECURE, DB_HASH, &openinfo); + O_RDWR|O_CREAT|O_EXCL, PERM_SECURE, DB_HASH, &openinfo); if (sdp == NULL) error(sbuf); clean = FILE_SECURE; From owner-svn-src-head@freebsd.org Tue Feb 23 17:53:41 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 58F26AB1902; Tue, 23 Feb 2016 17:53:41 +0000 (UTC) (envelope-from rrs@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 102219CF; Tue, 23 Feb 2016 17:53:40 +0000 (UTC) (envelope-from rrs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1NHregP078636; Tue, 23 Feb 2016 17:53:40 GMT (envelope-from rrs@FreeBSD.org) Received: (from rrs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1NHrdhU078634; Tue, 23 Feb 2016 17:53:39 GMT (envelope-from rrs@FreeBSD.org) Message-Id: <201602231753.u1NHrdhU078634@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rrs set sender to rrs@FreeBSD.org using -f From: Randall Stewart Date: Tue, 23 Feb 2016 17:53:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295927 - in head/sys/netinet: . tcp_stacks X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Feb 2016 17:53:41 -0000 Author: rrs Date: Tue Feb 23 17:53:39 2016 New Revision: 295927 URL: https://svnweb.freebsd.org/changeset/base/295927 Log: This fixes the fastpath code to have a better module initialization sequence when included in loader.conf. It also fixes it so that no matter if some one incorrectly specifies a load order, the lists and such will be initialized on demand at that time so no one can make that mistake. Reviewed by: hiren Differential Revision: D5189 Modified: head/sys/netinet/tcp_stacks/fastpath.c head/sys/netinet/tcp_subr.c Modified: head/sys/netinet/tcp_stacks/fastpath.c ============================================================================== --- head/sys/netinet/tcp_stacks/fastpath.c Tue Feb 23 16:01:34 2016 (r295926) +++ head/sys/netinet/tcp_stacks/fastpath.c Tue Feb 23 17:53:39 2016 (r295927) @@ -2453,4 +2453,4 @@ static moduledata_t new_tcp_fastpaths = }; MODULE_VERSION(kern_tcpfastpaths, 1); -DECLARE_MODULE(kern_tcpfastpaths, new_tcp_fastpaths, SI_SUB_PSEUDO, SI_ORDER_ANY); +DECLARE_MODULE(kern_tcpfastpaths, new_tcp_fastpaths, SI_SUB_PROTO_DOMAIN, SI_ORDER_ANY); Modified: head/sys/netinet/tcp_subr.c ============================================================================== --- head/sys/netinet/tcp_subr.c Tue Feb 23 16:01:34 2016 (r295926) +++ head/sys/netinet/tcp_subr.c Tue Feb 23 17:53:39 2016 (r295927) @@ -263,9 +263,20 @@ static struct tcp_function_block tcp_def 0 }; +int t_functions_inited = 0; struct tcp_funchead t_functions; static struct tcp_function_block *tcp_func_set_ptr = &tcp_def_funcblk; +static void +init_tcp_functions() +{ + if (t_functions_inited == 0) { + TAILQ_INIT(&t_functions); + rw_init_flags(&tcp_function_lock, "tcp_func_lock" , 0); + t_functions_inited = 1; + } +} + static struct tcp_function_block * find_tcp_functions_locked(struct tcp_function_set *fs) { @@ -503,6 +514,9 @@ register_tcp_functions(struct tcp_functi struct tcp_function *n; struct tcp_function_set fs; + if (t_functions_inited == 0) { + init_tcp_functions(); + } if ((blk->tfb_tcp_output == NULL) || (blk->tfb_tcp_do_segment == NULL) || (blk->tfb_tcp_ctloutput == NULL) || @@ -681,8 +695,7 @@ tcp_init(void) tcp_finwait2_timeout = TCPTV_FINWAIT2_TIMEOUT; tcp_tcbhashsize = hashsize; /* Setup the tcp function block list */ - TAILQ_INIT(&t_functions); - rw_init_flags(&tcp_function_lock, "tcp_func_lock" , 0); + init_tcp_functions(); register_tcp_functions(&tcp_def_funcblk, M_WAITOK); if (tcp_soreceive_stream) { From owner-svn-src-head@freebsd.org Tue Feb 23 18:17:02 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D6A56AB236F; Tue, 23 Feb 2016 18:17:02 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8F6CE1781; Tue, 23 Feb 2016 18:17:02 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1NIH1Bt084652; Tue, 23 Feb 2016 18:17:01 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1NIH1PD084650; Tue, 23 Feb 2016 18:17:01 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201602231817.u1NIH1PD084650@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Tue, 23 Feb 2016 18:17:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295928 - head/sys/dev/usb/controller X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Feb 2016 18:17:02 -0000 Author: hselasky Date: Tue Feb 23 18:17:01 2016 New Revision: 295928 URL: https://svnweb.freebsd.org/changeset/base/295928 Log: Configure the correct bMaxPacketSize for control endpoints before requesting the initial complete device descriptor and not as part of the subsequent babble error recovery. Babble means that the received USB packet was bigger than than configured maximum packet size. This only affects enumeration of FULL speed USB devices which use a bMaxPacketSize different from 8 bytes. This patch might help fix enumeration of USB devices which exhibit USB I/O errors in dmesg during boot. MFC after: 1 week Modified: head/sys/dev/usb/controller/xhci.c head/sys/dev/usb/controller/xhci.h Modified: head/sys/dev/usb/controller/xhci.c ============================================================================== --- head/sys/dev/usb/controller/xhci.c Tue Feb 23 17:53:39 2016 (r295927) +++ head/sys/dev/usb/controller/xhci.c Tue Feb 23 18:17:01 2016 (r295928) @@ -2358,6 +2358,8 @@ xhci_configure_endpoint(struct usb_devic /* store endpoint mode */ pepext->trb_ep_mode = ep_mode; + /* store bMaxPacketSize for control endpoints */ + pepext->trb_ep_maxp = edesc->wMaxPacketSize[0]; usb_pc_cpu_flush(pepext->page_cache); if (ep_mode == USB_EP_MODE_STREAMS) { @@ -2904,6 +2906,17 @@ xhci_transfer_insert(struct usb_xfer *xf return (USB_ERR_NOMEM); } + /* check if bMaxPacketSize changed */ + if (xfer->flags_int.control_xfr != 0 && + pepext->trb_ep_maxp != xfer->endpoint->edesc->wMaxPacketSize[0]) { + + DPRINTFN(8, "Reconfigure control endpoint\n"); + + /* force driver to reconfigure endpoint */ + pepext->trb_halted = 1; + pepext->trb_running = 0; + } + /* check for stopped condition, after putting transfer on interrupt queue */ if (pepext->trb_running == 0) { struct xhci_softc *sc = XHCI_BUS2SC(xfer->xroot->bus); Modified: head/sys/dev/usb/controller/xhci.h ============================================================================== --- head/sys/dev/usb/controller/xhci.h Tue Feb 23 17:53:39 2016 (r295927) +++ head/sys/dev/usb/controller/xhci.h Tue Feb 23 18:17:01 2016 (r295928) @@ -383,6 +383,7 @@ struct xhci_endpoint_ext { uint8_t trb_halted; uint8_t trb_running; uint8_t trb_ep_mode; + uint8_t trb_ep_maxp; }; enum { From owner-svn-src-head@freebsd.org Tue Feb 23 18:50:35 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9B188AB10EF; Tue, 23 Feb 2016 18:50:35 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6C4D5CBF; Tue, 23 Feb 2016 18:50:35 +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 u1NIoYuv093803; Tue, 23 Feb 2016 18:50:34 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1NIoY4S093802; Tue, 23 Feb 2016 18:50:34 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201602231850.u1NIoY4S093802@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Tue, 23 Feb 2016 18:50:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295929 - head/sys/netinet6 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Feb 2016 18:50:35 -0000 Author: tuexen Date: Tue Feb 23 18:50:34 2016 New Revision: 295929 URL: https://svnweb.freebsd.org/changeset/base/295929 Log: Don't leak an address in an error path. CID: 1351729 MFC after: 3 days Modified: head/sys/netinet6/sctp6_usrreq.c Modified: head/sys/netinet6/sctp6_usrreq.c ============================================================================== --- head/sys/netinet6/sctp6_usrreq.c Tue Feb 23 18:17:01 2016 (r295928) +++ head/sys/netinet6/sctp6_usrreq.c Tue Feb 23 18:50:34 2016 (r295929) @@ -1009,6 +1009,7 @@ sctp6_getaddr(struct socket *so, struct stcb = LIST_FIRST(&inp->sctp_asoc_list); if (stcb == NULL) { SCTP_INP_RUNLOCK(inp); + SCTP_FREE_SONAME(sin6); SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP6_USRREQ, ENOENT); return (ENOENT); } @@ -1028,6 +1029,7 @@ sctp6_getaddr(struct socket *so, struct if ((!fnd) || (sin_a6 == NULL)) { /* punt */ SCTP_INP_RUNLOCK(inp); + SCTP_FREE_SONAME(sin6); SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP6_USRREQ, ENOENT); return (ENOENT); } From owner-svn-src-head@freebsd.org Tue Feb 23 19:56:31 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1A9CFAB29A7; Tue, 23 Feb 2016 19:56:31 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EA29CB67; Tue, 23 Feb 2016 19:56:30 +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 u1NJuT04014241; Tue, 23 Feb 2016 19:56:29 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1NJuTQ2014235; Tue, 23 Feb 2016 19:56:29 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201602231956.u1NJuTQ2014235@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 23 Feb 2016 19:56:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295930 - head/usr.bin/truss X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Feb 2016 19:56:31 -0000 Author: jhb Date: Tue Feb 23 19:56:29 2016 New Revision: 295930 URL: https://svnweb.freebsd.org/changeset/base/295930 Log: Add support for displaying thread IDs to truss(1). - Consolidate duplicate code for printing the metadata at the start of each line into a shared function. - Add an -H option which will log the thread ID of the relevant thread for each event. While here, remove some extraneous calls to clock_gettime() in print_syscall() and print_syscall_ret(). The caller of print_syscall_ret() always updates the current thread's "after" time before it is called. Reviewed by: kib MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D5363 Modified: head/usr.bin/truss/extern.h head/usr.bin/truss/main.c head/usr.bin/truss/setup.c head/usr.bin/truss/syscalls.c head/usr.bin/truss/truss.1 head/usr.bin/truss/truss.h Modified: head/usr.bin/truss/extern.h ============================================================================== --- head/usr.bin/truss/extern.h Tue Feb 23 18:50:34 2016 (r295929) +++ head/usr.bin/truss/extern.h Tue Feb 23 19:56:29 2016 (r295930) @@ -31,6 +31,7 @@ * $FreeBSD$ */ +extern int print_line_prefix(struct trussinfo *); extern void setup_and_wait(struct trussinfo *, char **); extern void start_tracing(struct trussinfo *, pid_t); extern void restore_proc(int); Modified: head/usr.bin/truss/main.c ============================================================================== --- head/usr.bin/truss/main.c Tue Feb 23 18:50:34 2016 (r295929) +++ head/usr.bin/truss/main.c Tue Feb 23 19:56:29 2016 (r295930) @@ -96,7 +96,7 @@ main(int ac, char **av) trussinfo->curthread = NULL; LIST_INIT(&trussinfo->proclist); init_syscalls(); - while ((c = getopt(ac, av, "p:o:facedDs:S")) != -1) { + while ((c = getopt(ac, av, "p:o:facedDs:SH")) != -1) { switch (c) { case 'p': /* specified pid */ pid = atoi(optarg); @@ -132,6 +132,9 @@ main(int ac, char **av) case 'S': /* Don't trace signals */ trussinfo->flags |= NOSIGS; break; + case 'H': + trussinfo->flags |= DISPLAYTIDS; + break; default: usage(); } Modified: head/usr.bin/truss/setup.c ============================================================================== --- head/usr.bin/truss/setup.c Tue Feb 23 18:50:34 2016 (r295929) +++ head/usr.bin/truss/setup.c Tue Feb 23 19:56:29 2016 (r295930) @@ -439,26 +439,46 @@ exit_syscall(struct trussinfo *info, str } } -static void -report_exit(struct trussinfo *info, siginfo_t *si) +int +print_line_prefix(struct trussinfo *info) { struct timespec timediff; + struct threadinfo *t; + int len; - if (info->flags & FOLLOWFORKS) - fprintf(info->outfile, "%5d: ", si->si_pid); - clock_gettime(CLOCK_REALTIME, &info->curthread->after); + len = 0; + t = info->curthread; + if (info->flags & (FOLLOWFORKS | DISPLAYTIDS)) { + if (info->flags & FOLLOWFORKS) + len += fprintf(info->outfile, "%5d", t->proc->pid); + if ((info->flags & (FOLLOWFORKS | DISPLAYTIDS)) == + (FOLLOWFORKS | DISPLAYTIDS)) + len += fprintf(info->outfile, " "); + if (info->flags & DISPLAYTIDS) + len += fprintf(info->outfile, "%6d", t->tid); + len += fprintf(info->outfile, ": "); + } if (info->flags & ABSOLUTETIMESTAMPS) { - timespecsubt(&info->curthread->after, &info->start_time, - &timediff); - fprintf(info->outfile, "%jd.%09ld ", (intmax_t)timediff.tv_sec, - timediff.tv_nsec); + timespecsubt(&t->after, &info->start_time, &timediff); + len += fprintf(info->outfile, "%jd.%09ld ", + (intmax_t)timediff.tv_sec, timediff.tv_nsec); } if (info->flags & RELATIVETIMESTAMPS) { - timespecsubt(&info->curthread->after, &info->curthread->before, - &timediff); - fprintf(info->outfile, "%jd.%09ld ", (intmax_t)timediff.tv_sec, - timediff.tv_nsec); + timespecsubt(&t->after, &t->before, &timediff); + len += fprintf(info->outfile, "%jd.%09ld ", + (intmax_t)timediff.tv_sec, timediff.tv_nsec); } + return (len); +} + +static void +report_exit(struct trussinfo *info, siginfo_t *si) +{ + struct threadinfo *t; + + t = info->curthread; + clock_gettime(CLOCK_REALTIME, &t->after); + print_line_prefix(info); if (si->si_code == CLD_EXITED) fprintf(info->outfile, "process exit, rval = %u\n", si->si_status); @@ -469,48 +489,26 @@ report_exit(struct trussinfo *info, sigi } static void -report_new_child(struct trussinfo *info, pid_t pid) +report_new_child(struct trussinfo *info) { - struct timespec timediff; + struct threadinfo *t; - clock_gettime(CLOCK_REALTIME, &info->curthread->after); - assert(info->flags & FOLLOWFORKS); - fprintf(info->outfile, "%5d: ", pid); - if (info->flags & ABSOLUTETIMESTAMPS) { - timespecsubt(&info->curthread->after, &info->start_time, - &timediff); - fprintf(info->outfile, "%jd.%09ld ", (intmax_t)timediff.tv_sec, - timediff.tv_nsec); - } - if (info->flags & RELATIVETIMESTAMPS) { - timediff.tv_sec = 0; - timediff.tv_nsec = 0; - fprintf(info->outfile, "%jd.%09ld ", (intmax_t)timediff.tv_sec, - timediff.tv_nsec); - } + t = info->curthread; + clock_gettime(CLOCK_REALTIME, &t->after); + t->before = t->after; + print_line_prefix(info); fprintf(info->outfile, "\n"); } static void report_signal(struct trussinfo *info, siginfo_t *si) { - struct timespec timediff; + struct threadinfo *t; char *signame; - if (info->flags & FOLLOWFORKS) - fprintf(info->outfile, "%5d: ", si->si_pid); - if (info->flags & ABSOLUTETIMESTAMPS) { - timespecsubt(&info->curthread->after, &info->start_time, - &timediff); - fprintf(info->outfile, "%jd.%09ld ", (intmax_t)timediff.tv_sec, - timediff.tv_nsec); - } - if (info->flags & RELATIVETIMESTAMPS) { - timespecsubt(&info->curthread->after, &info->curthread->before, - &timediff); - fprintf(info->outfile, "%jd.%09ld ", (intmax_t)timediff.tv_sec, - timediff.tv_nsec); - } + t = info->curthread; + clock_gettime(CLOCK_REALTIME, &t->after); + print_line_prefix(info); signame = strsig(si->si_status); fprintf(info->outfile, "SIGNAL %u (%s)\n", si->si_status, signame == NULL ? "?" : signame); @@ -572,7 +570,7 @@ eventloop(struct trussinfo *info) pending_signal = 0; } else if (pl.pl_flags & PL_FLAG_CHILD) { if ((info->flags & COUNTONLY) == 0) - report_new_child(info, si.si_pid); + report_new_child(info); pending_signal = 0; } else { if ((info->flags & NOSIGS) == 0) Modified: head/usr.bin/truss/syscalls.c ============================================================================== --- head/usr.bin/truss/syscalls.c Tue Feb 23 18:50:34 2016 (r295929) +++ head/usr.bin/truss/syscalls.c Tue Feb 23 19:56:29 2016 (r295930) @@ -2005,38 +2005,18 @@ print_arg(struct syscall_args *sc, unsig void print_syscall(struct trussinfo *trussinfo) { - struct timespec timediff; struct threadinfo *t; const char *name; char **s_args; int i, len, nargs; - len = 0; t = trussinfo->curthread; - if (trussinfo->flags & FOLLOWFORKS) - len += fprintf(trussinfo->outfile, "%5d: ", - t->proc->pid); name = t->cs.name; nargs = t->cs.nargs; s_args = t->cs.s_args; - if (name != NULL && (strcmp(name, "execve") == 0 || - strcmp(name, "exit") == 0)) { - clock_gettime(CLOCK_REALTIME, &t->after); - } - - if (trussinfo->flags & ABSOLUTETIMESTAMPS) { - timespecsubt(&t->after, &trussinfo->start_time, &timediff); - len += fprintf(trussinfo->outfile, "%jd.%09ld ", - (intmax_t)timediff.tv_sec, timediff.tv_nsec); - } - - if (trussinfo->flags & RELATIVETIMESTAMPS) { - timespecsubt(&t->after, &t->before, &timediff); - len += fprintf(trussinfo->outfile, "%jd.%09ld ", - (intmax_t)timediff.tv_sec, timediff.tv_nsec); - } + len = print_line_prefix(trussinfo); len += fprintf(trussinfo->outfile, "%s(", name); for (i = 0; i < nargs; i++) { @@ -2063,7 +2043,6 @@ print_syscall_ret(struct trussinfo *trus t = trussinfo->curthread; sc = t->cs.sc; if (trussinfo->flags & COUNTONLY) { - clock_gettime(CLOCK_REALTIME, &t->after); timespecsubt(&t->after, &t->before, &timediff); timespecadd(&sc->time, &timediff, &sc->time); sc->ncalls++; Modified: head/usr.bin/truss/truss.1 ============================================================================== --- head/usr.bin/truss/truss.1 Tue Feb 23 18:50:34 2016 (r295929) +++ head/usr.bin/truss/truss.1 Tue Feb 23 19:56:29 2016 (r295930) @@ -1,6 +1,6 @@ .\" $FreeBSD$ .\" -.Dd October 9, 2015 +.Dd February 23, 2016 .Dt TRUSS 1 .Os .Sh NAME @@ -8,12 +8,12 @@ .Nd trace system calls .Sh SYNOPSIS .Nm -.Op Fl facedDS +.Op Fl facedDHS .Op Fl o Ar file .Op Fl s Ar strsize .Fl p Ar pid .Nm -.Op Fl facedDS +.Op Fl facedDHS .Op Fl o Ar file .Op Fl s Ar strsize .Ar command Op Ar args @@ -32,6 +32,10 @@ Trace descendants of the original traced .Xr fork 2 , .Xr vfork 2 , etc. +To distinguish events between processes, +the process ID +.Pq PID +of the process is included in the output of each event. .It Fl a Show the argument strings that are passed in each .Xr execve 2 @@ -52,6 +56,8 @@ since the trace was started. .It Fl D Include timestamps in the output showing the time elapsed since the last recorded event. +.It Fl H +Include the thread ID of in the output of each event. .It Fl S Do not display information about signals received by the process. (Normally, Modified: head/usr.bin/truss/truss.h ============================================================================== --- head/usr.bin/truss/truss.h Tue Feb 23 18:50:34 2016 (r295929) +++ head/usr.bin/truss/truss.h Tue Feb 23 19:56:29 2016 (r295930) @@ -35,6 +35,7 @@ #define EXECVEARGS 0x00000010 #define EXECVEENVS 0x00000020 #define COUNTONLY 0x00000040 +#define DISPLAYTIDS 0x00000080 struct procinfo; struct trussinfo; From owner-svn-src-head@freebsd.org Tue Feb 23 20:00:58 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0D94FAB2B61; Tue, 23 Feb 2016 20:00:58 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D51EEE18; Tue, 23 Feb 2016 20:00:57 +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 u1NK0vmn014463; Tue, 23 Feb 2016 20:00:57 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1NK0trn014450; Tue, 23 Feb 2016 20:00:55 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201602232000.u1NK0trn014450@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 23 Feb 2016 20:00:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295931 - in head: lib/libsysdecode usr.bin/kdump usr.bin/truss X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Feb 2016 20:00:58 -0000 Author: jhb Date: Tue Feb 23 20:00:55 2016 New Revision: 295931 URL: https://svnweb.freebsd.org/changeset/base/295931 Log: Add handling for non-native error values to libsysdecode. Add two new functions, sysdecode_abi_to_freebsd_errno() and sysdecode_freebsd_to_abi_errno(), which convert errno values between the native FreeBSD ABI and other supported ABIs. Note that the mappings are not necessarily perfect meaning in some cases multiple errors in one ABI might map to a single error in another ABI. In that case, the reverse mapping will return one of the errors that maps, but which error is non-deterministic. Change truss to always report the raw error value to the user but use libsysdecode to map it to a native errno value that can be used with strerror() to generate a description. Previously truss reported the "converted" error value. Now the user will always see the exact error value that the application sees. Change kdump to report the truly raw error value to the user. Previously kdump would report the absolute value of the raw error value (so for Linux binaries it didn't output the FreeBSD error value, but the positive value of the Linux error). Now it reports the real (i.e. negative) error value for Linux binaries. Also, use libsysdecode to convert the native FreeBSD error reported in the ktrace record to the raw error used by the ABI. This means that the Linux ABI can now be handled directly in ktrsysret() and removes the need for linux_ktrsysret(). Reviewed by: bdrewery, kib Helpful notes: wblock (manpage) Differential Revision: https://reviews.freebsd.org/D5314 Added: head/lib/libsysdecode/errno.c (contents, props changed) head/lib/libsysdecode/sysdecode_abi_to_freebsd_errno.3 (contents, props changed) Deleted: head/usr.bin/truss/cloudabi.c head/usr.bin/truss/cloudabi.h Modified: head/lib/libsysdecode/Makefile head/lib/libsysdecode/sysdecode.3 head/lib/libsysdecode/sysdecode.h head/lib/libsysdecode/sysdecode_syscallnames.3 head/usr.bin/kdump/kdump.c head/usr.bin/truss/Makefile head/usr.bin/truss/aarch64-cloudabi64.c head/usr.bin/truss/amd64-cloudabi64.c head/usr.bin/truss/amd64-linux32.c head/usr.bin/truss/i386-linux.c head/usr.bin/truss/syscalls.c Modified: head/lib/libsysdecode/Makefile ============================================================================== --- head/lib/libsysdecode/Makefile Tue Feb 23 19:56:29 2016 (r295930) +++ head/lib/libsysdecode/Makefile Tue Feb 23 20:00:55 2016 (r295931) @@ -4,15 +4,17 @@ LIB= sysdecode -SRCS= ioctl.c syscallnames.c utrace.c +SRCS= errno.c ioctl.c syscallnames.c utrace.c INCS= sysdecode.h CFLAGS+= -I${.CURDIR}/../../sys MAN+= sysdecode.3 \ + sysdecode_abi_to_freebsd_errno.3 \ sysdecode_ioctlname.3 \ sysdecode_syscallnames.3 \ sysdecode_utrace.3 +MLINKS+= sysdecode_abi_to_freebsd_errno.3 sysdecode_freebsd_to_abi_errno.3 CLEANFILES= ioctl.c Added: head/lib/libsysdecode/errno.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libsysdecode/errno.c Tue Feb 23 20:00:55 2016 (r295931) @@ -0,0 +1,209 @@ +/*- + * Copyright (c) 2015 John H. Baldwin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include + +#if defined(__i386__) || defined(__amd64__) +/* + * Linux syscalls return negative errno's, we do positive and map them + * Reference: + * FreeBSD: src/sys/sys/errno.h + * Linux: linux-2.6.17.8/include/asm-generic/errno-base.h + * linux-2.6.17.8/include/asm-generic/errno.h + */ +static int bsd_to_linux_errno[ELAST + 1] = { + -0, -1, -2, -3, -4, -5, -6, -7, -8, -9, + -10, -35, -12, -13, -14, -15, -16, -17, -18, -19, + -20, -21, -22, -23, -24, -25, -26, -27, -28, -29, + -30, -31, -32, -33, -34, -11,-115,-114, -88, -89, + -90, -91, -92, -93, -94, -95, -96, -97, -98, -99, + -100,-101,-102,-103,-104,-105,-106,-107,-108,-109, + -110,-111, -40, -36,-112,-113, -39, -11, -87,-122, + -116, -66, -6, -6, -6, -6, -6, -37, -38, -9, + -6, -6, -43, -42, -75,-125, -84, -95, -16, -74, + -72, -67, -71 +}; +#endif + +#if defined(__aarch64__) || defined(__amd64__) +#include + +static const int cloudabi_errno_table[] = { + [CLOUDABI_E2BIG] = E2BIG, + [CLOUDABI_EACCES] = EACCES, + [CLOUDABI_EADDRINUSE] = EADDRINUSE, + [CLOUDABI_EADDRNOTAVAIL] = EADDRNOTAVAIL, + [CLOUDABI_EAFNOSUPPORT] = EAFNOSUPPORT, + [CLOUDABI_EAGAIN] = EAGAIN, + [CLOUDABI_EALREADY] = EALREADY, + [CLOUDABI_EBADF] = EBADF, + [CLOUDABI_EBADMSG] = EBADMSG, + [CLOUDABI_EBUSY] = EBUSY, + [CLOUDABI_ECANCELED] = ECANCELED, + [CLOUDABI_ECHILD] = ECHILD, + [CLOUDABI_ECONNABORTED] = ECONNABORTED, + [CLOUDABI_ECONNREFUSED] = ECONNREFUSED, + [CLOUDABI_ECONNRESET] = ECONNRESET, + [CLOUDABI_EDEADLK] = EDEADLK, + [CLOUDABI_EDESTADDRREQ] = EDESTADDRREQ, + [CLOUDABI_EDOM] = EDOM, + [CLOUDABI_EDQUOT] = EDQUOT, + [CLOUDABI_EEXIST] = EEXIST, + [CLOUDABI_EFAULT] = EFAULT, + [CLOUDABI_EFBIG] = EFBIG, + [CLOUDABI_EHOSTUNREACH] = EHOSTUNREACH, + [CLOUDABI_EIDRM] = EIDRM, + [CLOUDABI_EILSEQ] = EILSEQ, + [CLOUDABI_EINPROGRESS] = EINPROGRESS, + [CLOUDABI_EINTR] = EINTR, + [CLOUDABI_EINVAL] = EINVAL, + [CLOUDABI_EIO] = EIO, + [CLOUDABI_EISCONN] = EISCONN, + [CLOUDABI_EISDIR] = EISDIR, + [CLOUDABI_ELOOP] = ELOOP, + [CLOUDABI_EMFILE] = EMFILE, + [CLOUDABI_EMLINK] = EMLINK, + [CLOUDABI_EMSGSIZE] = EMSGSIZE, + [CLOUDABI_EMULTIHOP] = EMULTIHOP, + [CLOUDABI_ENAMETOOLONG] = ENAMETOOLONG, + [CLOUDABI_ENETDOWN] = ENETDOWN, + [CLOUDABI_ENETRESET] = ENETRESET, + [CLOUDABI_ENETUNREACH] = ENETUNREACH, + [CLOUDABI_ENFILE] = ENFILE, + [CLOUDABI_ENOBUFS] = ENOBUFS, + [CLOUDABI_ENODEV] = ENODEV, + [CLOUDABI_ENOENT] = ENOENT, + [CLOUDABI_ENOEXEC] = ENOEXEC, + [CLOUDABI_ENOLCK] = ENOLCK, + [CLOUDABI_ENOLINK] = ENOLINK, + [CLOUDABI_ENOMEM] = ENOMEM, + [CLOUDABI_ENOMSG] = ENOMSG, + [CLOUDABI_ENOPROTOOPT] = ENOPROTOOPT, + [CLOUDABI_ENOSPC] = ENOSPC, + [CLOUDABI_ENOSYS] = ENOSYS, + [CLOUDABI_ENOTCONN] = ENOTCONN, + [CLOUDABI_ENOTDIR] = ENOTDIR, + [CLOUDABI_ENOTEMPTY] = ENOTEMPTY, + [CLOUDABI_ENOTRECOVERABLE] = ENOTRECOVERABLE, + [CLOUDABI_ENOTSOCK] = ENOTSOCK, + [CLOUDABI_ENOTSUP] = ENOTSUP, + [CLOUDABI_ENOTTY] = ENOTTY, + [CLOUDABI_ENXIO] = ENXIO, + [CLOUDABI_EOVERFLOW] = EOVERFLOW, + [CLOUDABI_EOWNERDEAD] = EOWNERDEAD, + [CLOUDABI_EPERM] = EPERM, + [CLOUDABI_EPIPE] = EPIPE, + [CLOUDABI_EPROTO] = EPROTO, + [CLOUDABI_EPROTONOSUPPORT] = EPROTONOSUPPORT, + [CLOUDABI_EPROTOTYPE] = EPROTOTYPE, + [CLOUDABI_ERANGE] = ERANGE, + [CLOUDABI_EROFS] = EROFS, + [CLOUDABI_ESPIPE] = ESPIPE, + [CLOUDABI_ESRCH] = ESRCH, + [CLOUDABI_ESTALE] = ESTALE, + [CLOUDABI_ETIMEDOUT] = ETIMEDOUT, + [CLOUDABI_ETXTBSY] = ETXTBSY, + [CLOUDABI_EXDEV] = EXDEV, + [CLOUDABI_ENOTCAPABLE] = ENOTCAPABLE, +}; +#endif + +int +sysdecode_abi_to_freebsd_errno(enum sysdecode_abi abi, int error) +{ + + switch (abi) { + case SYSDECODE_ABI_FREEBSD: + case SYSDECODE_ABI_FREEBSD32: + return (error); +#if defined(__i386__) || defined(__amd64__) + case SYSDECODE_ABI_LINUX: + case SYSDECODE_ABI_LINUX32: { + unsigned int i; + + /* + * This is imprecise since it returns the first + * matching errno. + */ + for (i = 0; i < nitems(bsd_to_linux_errno); i++) { + if (error == bsd_to_linux_errno[i]) + return (i); + } + break; + } +#endif +#if defined(__aarch64__) || defined(__amd64__) + case SYSDECODE_ABI_CLOUDABI64: + if (error >= 0 && + (unsigned int)error < nitems(cloudabi_errno_table)) + return (cloudabi_errno_table[error]); + break; +#endif + default: + break; + } + return (INT_MAX); +} + +int +sysdecode_freebsd_to_abi_errno(enum sysdecode_abi abi, int error) +{ + + switch (abi) { + case SYSDECODE_ABI_FREEBSD: + case SYSDECODE_ABI_FREEBSD32: + return (error); +#if defined(__i386__) || defined(__amd64__) + case SYSDECODE_ABI_LINUX: + case SYSDECODE_ABI_LINUX32: + if (error >= 0 && error <= ELAST) + return (bsd_to_linux_errno[error]); + break; +#endif +#if defined(__aarch64__) || defined(__amd64__) + case SYSDECODE_ABI_CLOUDABI64: { + unsigned int i; + + for (i = 0; i < nitems(cloudabi_errno_table); i++) { + if (error == cloudabi_errno_table[i]) + return (i); + } + break; + } +#endif + default: + break; + } + return (INT_MAX); +} + Modified: head/lib/libsysdecode/sysdecode.3 ============================================================================== --- head/lib/libsysdecode/sysdecode.3 Tue Feb 23 19:56:29 2016 (r295930) +++ head/lib/libsysdecode/sysdecode.3 Tue Feb 23 20:00:55 2016 (r295931) @@ -64,6 +64,7 @@ Supported on aarch64 and amd64. A placeholder for use when the ABI is not known. .El .Sh SEE ALSO +.Xr sysdecode_abi_to_freebsd_errno 3 , .Xr sysdecode_ioctlname 3 , .Xr sysdecode_syscallnames 3 , .Xr sysdecode_utrace 3 Modified: head/lib/libsysdecode/sysdecode.h ============================================================================== --- head/lib/libsysdecode/sysdecode.h Tue Feb 23 19:56:29 2016 (r295930) +++ head/lib/libsysdecode/sysdecode.h Tue Feb 23 20:00:55 2016 (r295931) @@ -38,6 +38,8 @@ enum sysdecode_abi { SYSDECODE_ABI_CLOUDABI64 }; +int sysdecode_abi_to_freebsd_errno(enum sysdecode_abi _abi, int _error); +int sysdecode_freebsd_to_abi_errno(enum sysdecode_abi _abi, int _error); const char *sysdecode_ioctlname(unsigned long _val); const char *sysdecode_syscallname(enum sysdecode_abi _abi, unsigned int _code); int sysdecode_utrace(FILE *_fp, void *_buf, size_t _len); Added: head/lib/libsysdecode/sysdecode_abi_to_freebsd_errno.3 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libsysdecode/sysdecode_abi_to_freebsd_errno.3 Tue Feb 23 20:00:55 2016 (r295931) @@ -0,0 +1,94 @@ +.\" +.\" Copyright (c) 2016 John Baldwin +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd February 23, 2016 +.Dt sysdecode_abi_to_freebsd_errno 3 +.Os +.Sh NAME +.Nm sysdecode_abi_to_freebsd_errno , +.Nm sysdecode_freebsd_to_abi_errno +.Nd translate error numbers between process ABIs +.Sh LIBRARY +.Lb libsysdecode +.Sh SYNOPSIS +.Ft int +.Fn sysdecode_abi_to_freebsd_errno "enum sysdecode_abi abi" "int error" +.Ft int +.Fn sysdecode_freebsd_to_abi_errno "enum sysdecode_abi abi" "int error" +.Sh DESCRIPTION +The +.Fn sysdecode_abi_to_freebsd_errno +function returns the native +.Xr errno 3 +value that corresponds to the error indicated by +.Fa error +for the process ABI +.Fa abi . +If +.Fa error +does not identify a valid error for +.Fa abi , +.Dv INT_MAX +is returned. +.Pp +The +.Fn sysdecode_freebsd_to_abi_errno +function the error value for the process ABI +.Fa abi +that corresponds to the native +.Xr errno 3 +value +.Fa error . +If +.Fa error +does not identify a valid +.Xr errno 3 +error, +.Dv INT_MAX +is returned. +.Pp +Note that the mappings between native +.Xr errno 3 +values and errors for other ABIs are not exhaustive. +If a mapping does not exist, +these functions return +.Dv INT_MAX . +In addition, multiple error values in one ABI may map to a single +error in another ABI. +.Sh RETURN VALUES +These functions return an error value on success or +.Dv INT_MAX +if +.Fa error +is not valid. +.Pp +For the list of supported ABIs, +see +.Xr sysdecode 3 . +.Sh SEE ALSO +.Xr sysdecode 3 , +.Xr sysdecode_syscallnames 3 Modified: head/lib/libsysdecode/sysdecode_syscallnames.3 ============================================================================== --- head/lib/libsysdecode/sysdecode_syscallnames.3 Tue Feb 23 19:56:29 2016 (r295930) +++ head/lib/libsysdecode/sysdecode_syscallnames.3 Tue Feb 23 20:00:55 2016 (r295931) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 24, 2016 +.Dd January 30, 2016 .Dt sysdecode_syscallnames 3 .Os .Sh NAME @@ -64,4 +64,5 @@ or .Fa ABI is invalid . .Sh SEE ALSO -.Xr sysdecode 3 +.Xr sysdecode 3 , +.Xr sysdecode_abi_to_freebsd_errno 3 Modified: head/usr.bin/kdump/kdump.c ============================================================================== --- head/usr.bin/kdump/kdump.c Tue Feb 23 19:56:29 2016 (r295930) +++ head/usr.bin/kdump/kdump.c Tue Feb 23 20:00:55 2016 (r295931) @@ -142,28 +142,6 @@ static struct ktr_header ktr_header; c = ','; \ } while (0) -#if defined(__amd64__) || defined(__i386__) - -void linux_ktrsysret(struct ktr_sysret *, u_int); - -/* - * from linux.h - * Linux syscalls return negative errno's, we do positive and map them - */ -static int bsd_to_linux_errno[ELAST + 1] = { - -0, -1, -2, -3, -4, -5, -6, -7, -8, -9, - -10, -35, -12, -13, -14, -15, -16, -17, -18, -19, - -20, -21, -22, -23, -24, -25, -26, -27, -28, -29, - -30, -31, -32, -33, -34, -11,-115,-114, -88, -89, - -90, -91, -92, -93, -94, -95, -96, -97, -98, -99, - -100,-101,-102,-103,-104,-105,-106,-107,-108,-109, - -110,-111, -40, -36,-112,-113, -39, -11, -87,-122, - -116, -66, -6, -6, -6, -6, -6, -37, -38, -9, - -6, -6, -43, -42, -75,-125, -84, -95, -16, -74, - -72, -67, -71 -}; -#endif - struct proc_info { TAILQ_ENTRY(proc_info) info; @@ -393,13 +371,7 @@ main(int argc, char *argv[]) ktrsyscall((struct ktr_syscall *)m, sv_flags); break; case KTR_SYSRET: -#if defined(__amd64__) || defined(__i386__) - if ((sv_flags & SV_ABI_MASK) == SV_ABI_LINUX) - linux_ktrsysret((struct ktr_sysret *)m, - sv_flags); - else -#endif - ktrsysret((struct ktr_sysret *)m, sv_flags); + ktrsysret((struct ktr_sysret *)m, sv_flags); break; case KTR_NAMEI: case KTR_SYSCTL: @@ -1366,7 +1338,8 @@ ktrsysret(struct ktr_sysret *ktr, u_int else if (error == EJUSTRETURN) printf("JUSTRETURN"); else { - printf("-1 errno %d", ktr->ktr_error); + printf("-1 errno %d", sysdecode_freebsd_to_abi_errno( + syscallabi(sv_flags), error)); if (fancy) printf(" %s", strerror(ktr->ktr_error)); } @@ -1852,44 +1825,6 @@ ktrfaultend(struct ktr_faultend *ktr) printf("\n"); } -#if defined(__amd64__) || defined(__i386__) -void -linux_ktrsysret(struct ktr_sysret *ktr, u_int sv_flags) -{ - register_t ret = ktr->ktr_retval; - int error = ktr->ktr_error; - - syscallname(ktr->ktr_code, sv_flags); - printf(" "); - - if (error == 0) { - if (fancy) { - printf("%ld", (long)ret); - if (ret < 0 || ret > 9) - printf("/%#lx", (unsigned long)ret); - } else { - if (decimal) - printf("%ld", (long)ret); - else - printf("%#lx", (unsigned long)ret); - } - } else if (error == ERESTART) - printf("RESTART"); - else if (error == EJUSTRETURN) - printf("JUSTRETURN"); - else { - if (ktr->ktr_error <= ELAST + 1) - error = abs(bsd_to_linux_errno[ktr->ktr_error]); - else - error = 999; - printf("-1 errno %d", error); - if (fancy) - printf(" %s", strerror(ktr->ktr_error)); - } - putchar('\n'); -} -#endif - void usage(void) { Modified: head/usr.bin/truss/Makefile ============================================================================== --- head/usr.bin/truss/Makefile Tue Feb 23 19:56:29 2016 (r295930) +++ head/usr.bin/truss/Makefile Tue Feb 23 20:00:55 2016 (r295931) @@ -2,7 +2,7 @@ NO_WERROR= PROG= truss -SRCS= cloudabi.c main.c setup.c syscalls.c +SRCS= main.c setup.c syscalls.c LIBADD= sysdecode Modified: head/usr.bin/truss/aarch64-cloudabi64.c ============================================================================== --- head/usr.bin/truss/aarch64-cloudabi64.c Tue Feb 23 19:56:29 2016 (r295930) +++ head/usr.bin/truss/aarch64-cloudabi64.c Tue Feb 23 20:00:55 2016 (r295931) @@ -31,11 +31,9 @@ __FBSDID("$FreeBSD$"); #include -#include #include #include -#include "cloudabi.h" #include "truss.h" static int @@ -74,8 +72,6 @@ aarch64_cloudabi64_fetch_retval(struct t retval[0] = regs.x[0]; retval[1] = regs.x[1]; *errorp = (regs.spsr & PSR_C) != 0; - if (*errorp) - retval[0] = cloudabi_convert_errno(retval[0]); return (0); } Modified: head/usr.bin/truss/amd64-cloudabi64.c ============================================================================== --- head/usr.bin/truss/amd64-cloudabi64.c Tue Feb 23 19:56:29 2016 (r295930) +++ head/usr.bin/truss/amd64-cloudabi64.c Tue Feb 23 20:00:55 2016 (r295931) @@ -31,11 +31,9 @@ __FBSDID("$FreeBSD$"); #include -#include #include #include -#include "cloudabi.h" #include "truss.h" static int @@ -83,8 +81,6 @@ amd64_cloudabi64_fetch_retval(struct tru retval[0] = regs.r_rax; retval[1] = regs.r_rdx; *errorp = (regs.r_rflags & PSL_C) != 0; - if (*errorp) - retval[0] = cloudabi_convert_errno(retval[0]); return (0); } Modified: head/usr.bin/truss/amd64-linux32.c ============================================================================== --- head/usr.bin/truss/amd64-linux32.c Tue Feb 23 19:56:29 2016 (r295930) +++ head/usr.bin/truss/amd64-linux32.c Tue Feb 23 20:00:55 2016 (r295931) @@ -83,28 +83,12 @@ amd64_linux32_fetch_args(struct trussinf return (0); } -/* - * Linux syscalls return negative errno's, we do positive and map them - */ -static const int bsd_to_linux_errno[] = { - -0, -1, -2, -3, -4, -5, -6, -7, -8, -9, - -10, -35, -12, -13, -14, -15, -16, -17, -18, -19, - -20, -21, -22, -23, -24, -25, -26, -27, -28, -29, - -30, -31, -32, -33, -34, -11,-115,-114, -88, -89, - -90, -91, -92, -93, -94, -95, -96, -97, -98, -99, - -100,-101,-102,-103,-104,-105,-106,-107,-108,-109, - -110,-111, -40, -36,-112,-113, -39, -11, -87,-122, - -116, -66, -6, -6, -6, -6, -6, -37, -38, -9, - -6, -}; - static int amd64_linux32_fetch_retval(struct trussinfo *trussinfo, long *retval, int *errorp) { struct reg regs; lwpid_t tid; - size_t i; tid = trussinfo->curthread->tid; if (ptrace(PT_GETREGS, tid, (caddr_t)®s, 0) < 0) { @@ -117,17 +101,6 @@ amd64_linux32_fetch_retval(struct trussi *errorp = !!(regs.r_rflags & PSL_C); if (*errorp) retval[0] = (int)retval[0]; - - if (*errorp) { - for (i = 0; i < nitems(bsd_to_linux_errno); i++) { - if (retval[0] == bsd_to_linux_errno[i]) { - retval[0] = i; - return (0); - } - } - - /* XXX: How to handle unknown errors? */ - } return (0); } Modified: head/usr.bin/truss/i386-linux.c ============================================================================== --- head/usr.bin/truss/i386-linux.c Tue Feb 23 19:56:29 2016 (r295930) +++ head/usr.bin/truss/i386-linux.c Tue Feb 23 20:00:55 2016 (r295931) @@ -83,27 +83,11 @@ i386_linux_fetch_args(struct trussinfo * return (0); } -/* - * Linux syscalls return negative errno's, we do positive and map them - */ -static const int bsd_to_linux_errno[] = { - -0, -1, -2, -3, -4, -5, -6, -7, -8, -9, - -10, -35, -12, -13, -14, -15, -16, -17, -18, -19, - -20, -21, -22, -23, -24, -25, -26, -27, -28, -29, - -30, -31, -32, -33, -34, -11,-115,-114, -88, -89, - -90, -91, -92, -93, -94, -95, -96, -97, -98, -99, - -100,-101,-102,-103,-104,-105,-106,-107,-108,-109, - -110,-111, -40, -36,-112,-113, -39, -11, -87,-122, - -116, -66, -6, -6, -6, -6, -6, -37, -38, -9, - -6, -}; - static int i386_linux_fetch_retval(struct trussinfo *trussinfo, long *retval, int *errorp) { struct reg regs; lwpid_t tid; - size_t i; tid = trussinfo->curthread->tid; if (ptrace(PT_GETREGS, tid, (caddr_t)®s, 0) < 0) { @@ -114,17 +98,6 @@ i386_linux_fetch_retval(struct trussinfo retval[0] = regs.r_eax; retval[1] = regs.r_edx; *errorp = !!(regs.r_eflags & PSL_C); - - if (*errorp) { - for (i = 0; i < nitems(bsd_to_linux_errno); i++) { - if (retval[0] == bsd_to_linux_errno[i]) { - retval[0] = i; - return (0); - } - } - - /* XXX: How to handle unknown errors? */ - } return (0); } Modified: head/usr.bin/truss/syscalls.c ============================================================================== --- head/usr.bin/truss/syscalls.c Tue Feb 23 19:56:29 2016 (r295930) +++ head/usr.bin/truss/syscalls.c Tue Feb 23 20:00:55 2016 (r295931) @@ -2039,6 +2039,7 @@ print_syscall_ret(struct trussinfo *trus struct timespec timediff; struct threadinfo *t; struct syscall *sc; + int error; t = trussinfo->curthread; sc = t->cs.sc; @@ -2053,9 +2054,12 @@ print_syscall_ret(struct trussinfo *trus print_syscall(trussinfo); fflush(trussinfo->outfile); - if (errorp) + if (errorp) { + error = sysdecode_abi_to_freebsd_errno(t->proc->abi->abi, + retval[0]); fprintf(trussinfo->outfile, " ERR#%ld '%s'\n", retval[0], - strerror(retval[0])); + error == INT_MAX ? "Unknown error" : strerror(error)); + } #ifndef __LP64__ else if (sc->ret_type == 2) { off_t off; From owner-svn-src-head@freebsd.org Tue Feb 23 21:11:43 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8E26EAB2634; Tue, 23 Feb 2016 21:11:43 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6102D1637; Tue, 23 Feb 2016 21:11:43 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1NLBggW037392; Tue, 23 Feb 2016 21:11:42 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1NLBg22037391; Tue, 23 Feb 2016 21:11:42 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201602232111.u1NLBg22037391@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Tue, 23 Feb 2016 21:11:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295932 - head/sys/net80211 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Feb 2016 21:11:43 -0000 Author: avos Date: Tue Feb 23 21:11:42 2016 New Revision: 295932 URL: https://svnweb.freebsd.org/changeset/base/295932 Log: net80211: fix TIM cleanup. Remove duplicate 'ni->ni_associd = 0' assignment from ieee80211_node_leave(), since it breaks iv_set_tim() in ic->ic_node_cleanup() (associd is cleared right after this call). Tested with RTL8188EU (HOSTAP mode) and WUSB54GC (STA mode, with powersaving enabled). Approved by: adrian (mentor) Differential Revision: https://reviews.freebsd.org/D5398 Modified: head/sys/net80211/ieee80211_node.c Modified: head/sys/net80211/ieee80211_node.c ============================================================================== --- head/sys/net80211/ieee80211_node.c Tue Feb 23 20:00:55 2016 (r295931) +++ head/sys/net80211/ieee80211_node.c Tue Feb 23 21:11:42 2016 (r295932) @@ -2683,7 +2683,6 @@ ieee80211_node_leave(struct ieee80211_no IEEE80211_LOCK(ic); IEEE80211_AID_CLR(vap, ni->ni_associd); - ni->ni_associd = 0; vap->iv_sta_assoc--; ic->ic_sta_assoc--; From owner-svn-src-head@freebsd.org Tue Feb 23 21:21:48 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 62BDFAB2B5A; Tue, 23 Feb 2016 21:21:48 +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 mx1.freebsd.org (Postfix) with ESMTPS id 360141D0C; Tue, 23 Feb 2016 21:21:48 +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 u1NLLlld039690; Tue, 23 Feb 2016 21:21:47 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1NLLlkZ039689; Tue, 23 Feb 2016 21:21:47 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201602232121.u1NLLlkZ039689@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Tue, 23 Feb 2016 21:21:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295933 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Feb 2016 21:21:48 -0000 Author: bdrewery Date: Tue Feb 23 21:21:47 2016 New Revision: 295933 URL: https://svnweb.freebsd.org/changeset/base/295933 Log: Fix build after r29592. Modified: head/sys/netinet/tcp_subr.c Modified: head/sys/netinet/tcp_subr.c ============================================================================== --- head/sys/netinet/tcp_subr.c Tue Feb 23 21:11:42 2016 (r295932) +++ head/sys/netinet/tcp_subr.c Tue Feb 23 21:21:47 2016 (r295933) @@ -268,7 +268,7 @@ struct tcp_funchead t_functions; static struct tcp_function_block *tcp_func_set_ptr = &tcp_def_funcblk; static void -init_tcp_functions() +init_tcp_functions(void) { if (t_functions_inited == 0) { TAILQ_INIT(&t_functions); From owner-svn-src-head@freebsd.org Tue Feb 23 22:02:26 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 877F0AB1CC5; Tue, 23 Feb 2016 22:02:26 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 54D8213D6; Tue, 23 Feb 2016 22:02:26 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1NM2PKx051851; Tue, 23 Feb 2016 22:02:25 GMT (envelope-from oshogbo@FreeBSD.org) Received: (from oshogbo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1NM2Pv2051850; Tue, 23 Feb 2016 22:02:25 GMT (envelope-from oshogbo@FreeBSD.org) Message-Id: <201602232202.u1NM2Pv2051850@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: oshogbo set sender to oshogbo@FreeBSD.org using -f From: Mariusz Zaborski Date: Tue, 23 Feb 2016 22:02:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295934 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Feb 2016 22:02:26 -0000 Author: oshogbo Date: Tue Feb 23 22:02:25 2016 New Revision: 295934 URL: https://svnweb.freebsd.org/changeset/base/295934 Log: According to the sys/kern/capabilities.conf, gethostid(3) should be allowed. Pointed out by: Milosz Kaniewski Approved by: pjd (mentor) MFC after: 3 days Sponsored by: Wheel Systems, http://wheelsystems.com Modified: head/sys/kern/kern_mib.c Modified: head/sys/kern/kern_mib.c ============================================================================== --- head/sys/kern/kern_mib.c Tue Feb 23 21:21:47 2016 (r295933) +++ head/sys/kern/kern_mib.c Tue Feb 23 22:02:25 2016 (r295934) @@ -422,7 +422,7 @@ sysctl_hostid(SYSCTL_HANDLER_ARGS) } SYSCTL_PROC(_kern, KERN_HOSTID, hostid, - CTLTYPE_ULONG | CTLFLAG_RW | CTLFLAG_PRISON | CTLFLAG_MPSAFE, + CTLTYPE_ULONG | CTLFLAG_RW | CTLFLAG_PRISON | CTLFLAG_MPSAFE | CTFLAG_CAPRD, NULL, 0, sysctl_hostid, "LU", "Host ID"); /* From owner-svn-src-head@freebsd.org Tue Feb 23 22:22:17 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 57841AB24C6; Tue, 23 Feb 2016 22:22:17 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2B1741EDD; Tue, 23 Feb 2016 22:22:17 +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 u1NMMGIb057648; Tue, 23 Feb 2016 22:22:16 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1NMMGAL057647; Tue, 23 Feb 2016 22:22:16 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <201602232222.u1NMMGAL057647@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Tue, 23 Feb 2016 22:22:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295935 - head/sys/dev/acpica X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Feb 2016 22:22:17 -0000 Author: jkim Date: Tue Feb 23 22:22:15 2016 New Revision: 295935 URL: https://svnweb.freebsd.org/changeset/base/295935 Log: Fix style(9) bugs. Modified: head/sys/dev/acpica/acpi_video.c Modified: head/sys/dev/acpica/acpi_video.c ============================================================================== --- head/sys/dev/acpica/acpi_video.c Tue Feb 23 22:02:25 2016 (r295934) +++ head/sys/dev/acpica/acpi_video.c Tue Feb 23 22:22:15 2016 (r295935) @@ -602,14 +602,16 @@ acpi_video_vo_bind(struct acpi_video_out vo->handle = handle; vo->vo_numlevels = vo_get_brightness_levels(handle, &vo->vo_levels); if (vo->vo_numlevels >= 2) { - if (vo->vo_fullpower == -1 - || acpi_video_vo_check_level(vo, vo->vo_fullpower) != 0) + if (vo->vo_fullpower == -1 || + acpi_video_vo_check_level(vo, vo->vo_fullpower) != 0) { /* XXX - can't deal with rebinding... */ vo->vo_fullpower = vo->vo_levels[BCL_FULLPOWER]; - if (vo->vo_economy == -1 - || acpi_video_vo_check_level(vo, vo->vo_economy) != 0) + } + if (vo->vo_economy == -1 || + acpi_video_vo_check_level(vo, vo->vo_economy) != 0) { /* XXX - see above. */ vo->vo_economy = vo->vo_levels[BCL_ECONOMY]; + } } if (vo->vo_levels != NULL) AcpiInstallNotifyHandler(handle, ACPI_DEVICE_NOTIFY, From owner-svn-src-head@freebsd.org Tue Feb 23 22:30:46 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E85D3AB2730; Tue, 23 Feb 2016 22:30:46 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BB97A2E0; Tue, 23 Feb 2016 22:30:46 +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 u1NMUjvI059788; Tue, 23 Feb 2016 22:30:45 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1NMUj6S059787; Tue, 23 Feb 2016 22:30:45 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <201602232230.u1NMUj6S059787@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Tue, 23 Feb 2016 22:30:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295936 - head/sys/dev/acpica X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Feb 2016 22:30:47 -0000 Author: jkim Date: Tue Feb 23 22:30:45 2016 New Revision: 295936 URL: https://svnweb.freebsd.org/changeset/base/295936 Log: Fix white spaces. Modified: head/sys/dev/acpica/acpi_video.c Modified: head/sys/dev/acpica/acpi_video.c ============================================================================== --- head/sys/dev/acpica/acpi_video.c Tue Feb 23 22:22:15 2016 (r295935) +++ head/sys/dev/acpica/acpi_video.c Tue Feb 23 22:30:45 2016 (r295936) @@ -608,7 +608,7 @@ acpi_video_vo_bind(struct acpi_video_out vo->vo_fullpower = vo->vo_levels[BCL_FULLPOWER]; } if (vo->vo_economy == -1 || - acpi_video_vo_check_level(vo, vo->vo_economy) != 0) { + acpi_video_vo_check_level(vo, vo->vo_economy) != 0) { /* XXX - see above. */ vo->vo_economy = vo->vo_levels[BCL_ECONOMY]; } From owner-svn-src-head@freebsd.org Tue Feb 23 22:44:02 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E73B1AB2BD2; Tue, 23 Feb 2016 22:44:02 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9F704B73; Tue, 23 Feb 2016 22:44:02 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1NMi1NS063434; Tue, 23 Feb 2016 22:44:01 GMT (envelope-from jilles@FreeBSD.org) Received: (from jilles@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1NMi1uk063430; Tue, 23 Feb 2016 22:44:01 GMT (envelope-from jilles@FreeBSD.org) Message-Id: <201602232244.u1NMi1uk063430@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jilles set sender to jilles@FreeBSD.org using -f From: Jilles Tjoelker Date: Tue, 23 Feb 2016 22:44:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295937 - in head/bin/sh: . tests/parser X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Feb 2016 22:44:03 -0000 Author: jilles Date: Tue Feb 23 22:44:01 2016 New Revision: 295937 URL: https://svnweb.freebsd.org/changeset/base/295937 Log: sh: Fix set -v and multiline history after r295825. r295825 erroneously dropped the newline from the input data for 'set -v' output and multiline history. Reported by: vangyzen Added: head/bin/sh/tests/parser/set-v1.0 (contents, props changed) head/bin/sh/tests/parser/set-v1.0.stderr (contents, props changed) Modified: head/bin/sh/input.c head/bin/sh/tests/parser/Makefile Modified: head/bin/sh/input.c ============================================================================== --- head/bin/sh/input.c Tue Feb 23 22:30:45 2016 (r295936) +++ head/bin/sh/input.c Tue Feb 23 22:44:01 2016 (r295937) @@ -242,7 +242,8 @@ again: parsenleft = parselleft; parselleft = 0; } else /* *q == '\n' */ { - parsenleft = q - parsenextc + 1; + q++; + parsenleft = q - parsenextc; parselleft -= parsenleft; } parsenleft--; Modified: head/bin/sh/tests/parser/Makefile ============================================================================== --- head/bin/sh/tests/parser/Makefile Tue Feb 23 22:30:45 2016 (r295936) +++ head/bin/sh/tests/parser/Makefile Tue Feb 23 22:44:01 2016 (r295937) @@ -79,6 +79,7 @@ FILES+= only-redir2.0 FILES+= only-redir3.0 FILES+= only-redir4.0 FILES+= pipe-not1.0 +FILES+= set-v1.0 set-v1.0.stderr FILES+= var-assign1.0 .include Added: head/bin/sh/tests/parser/set-v1.0 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/bin/sh/tests/parser/set-v1.0 Tue Feb 23 22:44:01 2016 (r295937) @@ -0,0 +1,8 @@ +# $FreeBSD$ + +${SH} <<\EOF +echo one >&2 +set -v +echo two >&2 +echo three >&2 +EOF Added: head/bin/sh/tests/parser/set-v1.0.stderr ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/bin/sh/tests/parser/set-v1.0.stderr Tue Feb 23 22:44:01 2016 (r295937) @@ -0,0 +1,5 @@ +one +echo two >&2 +two +echo three >&2 +three From owner-svn-src-head@freebsd.org Tue Feb 23 22:50:46 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 74321AB2DA5; Tue, 23 Feb 2016 22:50:46 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 433BEDB3; Tue, 23 Feb 2016 22:50:46 +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 u1NMoji8064296; Tue, 23 Feb 2016 22:50:45 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1NMojE1064295; Tue, 23 Feb 2016 22:50:45 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <201602232250.u1NMojE1064295@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Tue, 23 Feb 2016 22:50:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295938 - head/sys/dev/acpica X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Feb 2016 22:50:46 -0000 Author: jkim Date: Tue Feb 23 22:50:45 2016 New Revision: 295938 URL: https://svnweb.freebsd.org/changeset/base/295938 Log: Remove brightness notify handler before reinstalling new one. Modified: head/sys/dev/acpica/acpi_video.c Modified: head/sys/dev/acpica/acpi_video.c ============================================================================== --- head/sys/dev/acpica/acpi_video.c Tue Feb 23 22:44:01 2016 (r295937) +++ head/sys/dev/acpica/acpi_video.c Tue Feb 23 22:50:45 2016 (r295938) @@ -597,8 +597,12 @@ acpi_video_vo_bind(struct acpi_video_out { ACPI_SERIAL_BEGIN(video_output); - if (vo->vo_levels != NULL) + if (vo->vo_levels != NULL) { + AcpiRemoveNotifyHandler(vo->handle, ACPI_DEVICE_NOTIFY, + acpi_video_vo_notify_handler); AcpiOsFree(vo->vo_levels); + vo->vo_levels = NULL; + } vo->handle = handle; vo->vo_numlevels = vo_get_brightness_levels(handle, &vo->vo_levels); if (vo->vo_numlevels >= 2) { From owner-svn-src-head@freebsd.org Tue Feb 23 22:55:45 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7F087AB2F9C; Tue, 23 Feb 2016 22:55:45 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5170B10F1; Tue, 23 Feb 2016 22:55:45 +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 u1NMti2b066451; Tue, 23 Feb 2016 22:55:44 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1NMtiFq066450; Tue, 23 Feb 2016 22:55:44 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <201602232255.u1NMtiFq066450@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Tue, 23 Feb 2016 22:55:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295939 - head/sys/dev/acpica X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Feb 2016 22:55:45 -0000 Author: jkim Date: Tue Feb 23 22:55:44 2016 New Revision: 295939 URL: https://svnweb.freebsd.org/changeset/base/295939 Log: Silence PVS-Studio warning (V595). Modified: head/sys/dev/acpica/acpi_video.c Modified: head/sys/dev/acpica/acpi_video.c ============================================================================== --- head/sys/dev/acpica/acpi_video.c Tue Feb 23 22:50:45 2016 (r295938) +++ head/sys/dev/acpica/acpi_video.c Tue Feb 23 22:55:44 2016 (r295939) @@ -616,10 +616,9 @@ acpi_video_vo_bind(struct acpi_video_out /* XXX - see above. */ vo->vo_economy = vo->vo_levels[BCL_ECONOMY]; } - } - if (vo->vo_levels != NULL) AcpiInstallNotifyHandler(handle, ACPI_DEVICE_NOTIFY, acpi_video_vo_notify_handler, vo); + } ACPI_SERIAL_END(video_output); } From owner-svn-src-head@freebsd.org Tue Feb 23 23:09:47 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5EDF9AB130F; Tue, 23 Feb 2016 23:09:47 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2D4EF1598; Tue, 23 Feb 2016 23:09:47 +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 u1NN9k0d069358; Tue, 23 Feb 2016 23:09:46 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1NN9kUF069357; Tue, 23 Feb 2016 23:09:46 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <201602232309.u1NN9kUF069357@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Tue, 23 Feb 2016 23:09:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295940 - head/sys/dev/acpica X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Feb 2016 23:09:47 -0000 Author: jkim Date: Tue Feb 23 23:09:45 2016 New Revision: 295940 URL: https://svnweb.freebsd.org/changeset/base/295940 Log: Silence PVS-Studio warning (V595). Modified: head/sys/dev/acpica/acpi_ec.c Modified: head/sys/dev/acpica/acpi_ec.c ============================================================================== --- head/sys/dev/acpica/acpi_ec.c Tue Feb 23 22:55:44 2016 (r295939) +++ head/sys/dev/acpica/acpi_ec.c Tue Feb 23 23:09:45 2016 (r295940) @@ -434,9 +434,7 @@ out: params->gpe_bit, (params->glk) ? ", GLK" : "", ecdt ? ", ECDT" : ""); device_set_desc_copy(dev, desc); - } - - if (ret > 0 && params) + } else free(params, M_TEMP); if (buf.Pointer) AcpiOsFree(buf.Pointer); From owner-svn-src-head@freebsd.org Tue Feb 23 23:37:12 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4225AAB1D83; Tue, 23 Feb 2016 23:37:12 +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 mx1.freebsd.org (Postfix) with ESMTPS id 0A53D23E; Tue, 23 Feb 2016 23:37:11 +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 u1NNbBNU078225; Tue, 23 Feb 2016 23:37:11 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1NNbBfA078224; Tue, 23 Feb 2016 23:37:11 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201602232337.u1NNbBfA078224@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Tue, 23 Feb 2016 23:37:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295941 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Feb 2016 23:37:12 -0000 Author: bdrewery Date: Tue Feb 23 23:37:10 2016 New Revision: 295941 URL: https://svnweb.freebsd.org/changeset/base/295941 Log: Fix build after r295934. Modified: head/sys/kern/kern_mib.c Modified: head/sys/kern/kern_mib.c ============================================================================== --- head/sys/kern/kern_mib.c Tue Feb 23 23:09:45 2016 (r295940) +++ head/sys/kern/kern_mib.c Tue Feb 23 23:37:10 2016 (r295941) @@ -422,7 +422,7 @@ sysctl_hostid(SYSCTL_HANDLER_ARGS) } SYSCTL_PROC(_kern, KERN_HOSTID, hostid, - CTLTYPE_ULONG | CTLFLAG_RW | CTLFLAG_PRISON | CTLFLAG_MPSAFE | CTFLAG_CAPRD, + CTLTYPE_ULONG | CTLFLAG_RW | CTLFLAG_PRISON | CTLFLAG_MPSAFE | CTLFLAG_CAPRD, NULL, 0, sysctl_hostid, "LU", "Host ID"); /* From owner-svn-src-head@freebsd.org Tue Feb 23 23:38:08 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BAA40AB1E8C; Tue, 23 Feb 2016 23:38:08 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id A917C3F4; Tue, 23 Feb 2016 23:38:08 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [IPv6:::1]) by freefall.freebsd.org (Postfix) with ESMTP id A24921CBE; Tue, 23 Feb 2016 23:38:08 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [172.31.3.2]) by mail.xzibition.com (Postfix) with ESMTP id 5534D1D236; Tue, 23 Feb 2016 23:38:08 +0000 (UTC) X-Virus-Scanned: amavisd-new at mail.xzibition.com Received: from mail.xzibition.com ([172.31.3.2]) by mail.xzibition.com (mail.xzibition.com [172.31.3.2]) (amavisd-new, port 10026) with LMTP id 7V8OnZJL9JgO; Tue, 23 Feb 2016 23:38:05 +0000 (UTC) Subject: Re: svn commit: r295934 - head/sys/kern DKIM-Filter: OpenDKIM Filter v2.9.2 mail.xzibition.com ABE8C1D230 To: Mariusz Zaborski , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201602232202.u1NM2Pv2051850@repo.freebsd.org> From: Bryan Drewery Openpgp: id=F9173CB2C3AAEA7A5C8A1F0935D771BB6E4697CF; url=http://www.shatow.net/bryan/bryan2.asc Organization: FreeBSD Message-ID: <56CCED5A.3020307@FreeBSD.org> Date: Tue, 23 Feb 2016 15:38:02 -0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 MIME-Version: 1.0 In-Reply-To: <201602232202.u1NM2Pv2051850@repo.freebsd.org> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="gjMEI3rm4VcwexsOj2waiee7rlrkJH2gu" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Feb 2016 23:38:08 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --gjMEI3rm4VcwexsOj2waiee7rlrkJH2gu Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 2/23/2016 2:02 PM, Mariusz Zaborski wrote: > Author: oshogbo > Date: Tue Feb 23 22:02:25 2016 > New Revision: 295934 > URL: https://svnweb.freebsd.org/changeset/base/295934 >=20 > Log: > According to the sys/kern/capabilities.conf, gethostid(3) should be a= llowed. > =20 > Pointed out by: Milosz Kaniewski > Approved by: pjd (mentor) > MFC after: 3 days > Sponsored by: Wheel Systems, http://wheelsystems.com >=20 > Modified: > head/sys/kern/kern_mib.c >=20 > Modified: head/sys/kern/kern_mib.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/kern/kern_mib.c Tue Feb 23 21:21:47 2016 (r295933) > +++ head/sys/kern/kern_mib.c Tue Feb 23 22:02:25 2016 (r295934) > @@ -422,7 +422,7 @@ sysctl_hostid(SYSCTL_HANDLER_ARGS) > } > =20 > SYSCTL_PROC(_kern, KERN_HOSTID, hostid, > - CTLTYPE_ULONG | CTLFLAG_RW | CTLFLAG_PRISON | CTLFLAG_MPSAFE, > + CTLTYPE_ULONG | CTLFLAG_RW | CTLFLAG_PRISON | CTLFLAG_MPSAFE | CTF= LAG_CAPRD, It is spelled wrong. Fixed in r295941, be sure to MFC that too. > NULL, 0, sysctl_hostid, "LU", "Host ID"); > =20 > /* >=20 --=20 Regards, Bryan Drewery --gjMEI3rm4VcwexsOj2waiee7rlrkJH2gu Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBAgAGBQJWzO1aAAoJEDXXcbtuRpfPI3MH/3CuJlWBsvp09TbPoM92BBRK qoZsaMN2qjhQm/S/uehkp9egqYKEEr2LBWGFaWmMMggV5t2Z7LDosCGW7lEwjRk+ jZq+GiXnl8pQSLXd79ScEcZdAn6uFnycQPDOf/8IXiEqpVTWBP9aOhsVF/8eMOVU kUSBRCnyNsCVoMFESXdrCEXosHAmEfLBZDMS2fOk/ACzLsB52WX/GBSvuUH/xewp BfHOtoz1YzQFOk4cXH/avZVODymRNENX4r1T1XM/q1TbvIRz65eYS1IU2H7RhK4k QEP7G1bUx1KRFN0XB08VS/5lgk9vnEMWfM1RZIE97EszTNnx2OtjzbSvWGGhdH0= =29Wc -----END PGP SIGNATURE----- --gjMEI3rm4VcwexsOj2waiee7rlrkJH2gu-- From owner-svn-src-head@freebsd.org Tue Feb 23 23:57:25 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D0599AB27D8; Tue, 23 Feb 2016 23:57:25 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9F7CBF29; Tue, 23 Feb 2016 23:57:25 +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 u1NNvOCX084199; Tue, 23 Feb 2016 23:57:24 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1NNvOse084198; Tue, 23 Feb 2016 23:57:24 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <201602232357.u1NNvOse084198@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Tue, 23 Feb 2016 23:57:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295942 - head/sys/x86/isa X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Feb 2016 23:57:25 -0000 Author: jkim Date: Tue Feb 23 23:57:24 2016 New Revision: 295942 URL: https://svnweb.freebsd.org/changeset/base/295942 Log: Silence PVS-Studio warning (V595). It can never be NULL here. Modified: head/sys/x86/isa/clock.c Modified: head/sys/x86/isa/clock.c ============================================================================== --- head/sys/x86/isa/clock.c Tue Feb 23 23:37:10 2016 (r295941) +++ head/sys/x86/isa/clock.c Tue Feb 23 23:57:24 2016 (r295942) @@ -166,7 +166,7 @@ clkintr(void *arg) mtx_unlock_spin(&clock_lock); } - if (sc && sc->et.et_active && sc->mode != MODE_STOP) + if (sc->et.et_active && sc->mode != MODE_STOP) sc->et.et_event_cb(&sc->et, sc->et.et_arg); #ifdef DEV_MCA From owner-svn-src-head@freebsd.org Tue Feb 23 23:59:10 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5CBF0AB291D; Tue, 23 Feb 2016 23:59:10 +0000 (UTC) (envelope-from sobomax@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 29D1311A1; Tue, 23 Feb 2016 23:59:10 +0000 (UTC) (envelope-from sobomax@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1NNx9HB084345; Tue, 23 Feb 2016 23:59:09 GMT (envelope-from sobomax@FreeBSD.org) Received: (from sobomax@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1NNx8uV084339; Tue, 23 Feb 2016 23:59:08 GMT (envelope-from sobomax@FreeBSD.org) Message-Id: <201602232359.u1NNx8uV084339@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sobomax set sender to sobomax@FreeBSD.org using -f From: Maxim Sobolev Date: Tue, 23 Feb 2016 23:59:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295943 - in head: share/man/man4 sys/conf sys/geom/uzip sys/modules/geom/geom_uzip usr.bin/mkuzip X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Feb 2016 23:59:10 -0000 Author: sobomax Date: Tue Feb 23 23:59:08 2016 New Revision: 295943 URL: https://svnweb.freebsd.org/changeset/base/295943 Log: Improve mkuzip(8) and geom_uzip(4), merge in LZMA support from mkulzma(8) and geom_uncompress(4): 1. mkuzip(8): - Proper support for eliminating all-zero blocks when compressing an image. This feature is already supported by the geom_uzip(4) module and CLOOP format in general, so it's just a matter of making mkuzip(8) match. It should be noted, however that this feature while it sounds great, results in very slight improvement in the overall compression ratio, since compressing default 16k all-zero block produces only 39 bytes compressed output block, which is 99.8% compression ratio. With typical average compression ratio of amd64 binaries and data being around 60-70% the difference between 99.8% and 100.0% is not that great further diluted by the ratio of number of zero blocks in the uncompressed image to the overall number of blocks being less than 0.5 (typically). However, this may be important from performance standpoint, so that kernel are not spinning its wheels decompressing those empty blocks every time this zero region is read. It could also be important when you create huge image mostly filled with zero blocks for testing purposes. - New feature allowing to de-duplicate output image. It turns out that if you twist CLOOP format a bit you can do that as well. And unlike zero-blocks elimination, this gives a noticeable improvement in the overall compression ratio, reducing output image by something like 3-4% on my test UFS2 3GB image consisting of full FreeBSD base system plus some of the packages (openjdk, apache etc), about 2.3GB worth of file data (800+MB compressed). The only caveat is that images created with this feature "on" would not work on older versions of FeeBSDxi kernel, hence it's turned off by default. - provide options to control both features and document them in manual page. - merge in all relevant LZMA compression support from the mkulzma(8), add new option to select between both. - switch license from ad-hoc beerware into standard 2-clause BSD. 2. geom_uzip(4): - implement support for de-duplicated images; - optimize some code paths to handle "all-zero" blocks without reading any compressed data; - beef up manual page to explain that geom_uzip(4) is not limited only to md(4) images. The compressed data can be written to the block device and accessed directly via magic of GEOM(4) and devfs(4), including to mount root fs from a compressed drive. - convert debug log code from being compiled in conditionally into being present all the time and provide two sysctls to turn it on or off. Due to intended use of the module, it can be used in environments where there may not be a luxury to put new kernel with debug code enabled. Having those options handy allows debug issues without as much problem by just having access to serial console or network shell access to a box/appliance. The resulting additional CPU cycles are just few int comparisons and branches, and those are minuscule when compared to data decompression which is the main feature of the module. - hopefully improve robustness and resiliency of the geom_uzip(4) by performing some of the data validation / range checking on the TOC entries and rejecting to attach to an image if those checks fail. - merge in all relevant LZMA decompression support from the geom_uncompress(4), enable automatically when appropriate format is indicated in the header. - move compilation work into its own worker thread so that it does not clog g_up. This allows multiple instances work in parallel utilizing smp cores. - document new knobs in the manual page. Reviewed by: adrian MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D5333 Added: head/sys/geom/uzip/g_uzip.h (contents, props changed) head/sys/geom/uzip/g_uzip_cloop.h (contents, props changed) head/sys/geom/uzip/g_uzip_dapi.h (contents, props changed) head/sys/geom/uzip/g_uzip_lzma.c (contents, props changed) head/sys/geom/uzip/g_uzip_lzma.h (contents, props changed) head/sys/geom/uzip/g_uzip_softc.h (contents, props changed) head/sys/geom/uzip/g_uzip_wrkthr.c (contents, props changed) head/sys/geom/uzip/g_uzip_wrkthr.h (contents, props changed) head/sys/geom/uzip/g_uzip_zlib.c (contents, props changed) head/sys/geom/uzip/g_uzip_zlib.h (contents, props changed) head/usr.bin/mkuzip/mkuz_blockcache.c (contents, props changed) head/usr.bin/mkuzip/mkuz_blockcache.h (contents, props changed) head/usr.bin/mkuzip/mkuz_cloop.h (contents, props changed) head/usr.bin/mkuzip/mkuz_lzma.c (contents, props changed) head/usr.bin/mkuzip/mkuz_lzma.h (contents, props changed) head/usr.bin/mkuzip/mkuz_zlib.c (contents, props changed) head/usr.bin/mkuzip/mkuz_zlib.h (contents, props changed) head/usr.bin/mkuzip/mkuzip.h (contents, props changed) Modified: head/share/man/man4/geom_uzip.4 head/sys/conf/files head/sys/geom/uzip/g_uzip.c head/sys/modules/geom/geom_uzip/Makefile head/usr.bin/mkuzip/Makefile head/usr.bin/mkuzip/mkuzip.8 head/usr.bin/mkuzip/mkuzip.c Modified: head/share/man/man4/geom_uzip.4 ============================================================================== --- head/share/man/man4/geom_uzip.4 Tue Feb 23 23:57:24 2016 (r295942) +++ head/share/man/man4/geom_uzip.4 Tue Feb 23 23:59:08 2016 (r295943) @@ -30,7 +30,7 @@ .Os .Sh NAME .Nm geom_uzip -.Nd "GEOM based compressed disk images" +.Nd "GEOM based compressed disk images and partitions" .Sh SYNOPSIS To compile this driver into the kernel, place the following line in your @@ -51,7 +51,7 @@ The framework provides support for compressed read-only disk images. This allows significant storage savings at the expense of -a little CPU time on each read. +a some CPU time on each read. Data written in the GEOM label area allows .Nm to detect compressed images which have been created with @@ -63,17 +63,53 @@ creates a unique .Pa md#.uzip device for each image. .Pp +.Nm +is not limited to supporting only +.Xr md 4 +images. +The image can also reside on a block device. +.Pq For example, a disk, USB flash drive, DVD-ROM, etc. +The appropriate device node will appear with the +.Pa .uzip +suffix. +.Bd -literal -offset indent +# gpart show da0 +=> 0 7833600 da0 BSD (3.7G) + 0 2097152 1 freebsd-ufs (1.0G) + 2097152 5736448 - free - (2.7G) +# gpart add -t freebsd-ufs -s 1G da0 +da0b added +# dd if=/tmp/20160217_dcomp_zcomp.uzip bs=256k of=/dev/da0b +3190+1 records in +3190+1 records out +836331008 bytes transferred in 111.021489 secs (7533055 bytes/sec) +# fsck -t ffs /dev/da0b.uzip +** /dev/da0b.uzip (NO WRITE) +** Last Mounted on /mnt +** Phase 1 - Check Blocks and Sizes +** Phase 2 - Check Pathnames +** Phase 3 - Check Connectivity +** Phase 4 - Check Reference Counts +** Phase 5 - Check Cyl groups +97455 files, 604242 used, 184741 free (2349 frags, 22799 blocks, + 0.3% fragmentation) +# mount -o ro /dev/da0b.uzip /mnt +# df /dev/da0b.uzip +Filesystem 1K-blocks Used Avail Capacity Mounted on +/dev/da0b.uzip 3155932 2416968 738964 77% /mnt +.Ed +.Pp The .Nm -device is subsequently used by the +device is subsequently used by .Fx -kernel to access the disk images. +kernel to access the uncompressed data. The .Nm driver does not allow write operations to the underlying disk image. To check which -.Xr md 4 -devices match a given +.Dq providers +match a given .Nm device: .Bd -literal -offset indent @@ -83,13 +119,44 @@ Providers: 1. Name: md1.uzip Mediasize: 22003712 (21M) Sectorsize: 512 - Mode: r1w0e1 Consumers: 1. Name: md1 Mediasize: 9563648 (9.1M) Sectorsize: 512 - Mode: r1w0e1 + +Geom name: da0b.uzip +Providers: +1. Name: da0b.uzip + Mediasize: 3355443200 (3.1G) + Sectorsize: 512 +Consumers: +1. Name: da0b + Mediasize: 1073741824 (1.0G) + Sectorsize: 512 .Ed +.Pp +.Nm +allows mounting the root file system from a compressed disk partition by +setting the +.Dv vfs.root.mountfrom +tunable. +See +.Xr loader.conf 5 +for details. +.Sh DIAGNOSTICS +Several flags are provided for tracing +.Nm +I/O operations and TOC parsing via the following sysctls. +.Bl -tag -width indent +.It Va kern.geom.uzip.debug +Log level. +Zero disables logging. +Higher values enable more verbose debug logging for +.Nm . +Supported levels are from 0 (no logging) to 4 (maximum amount of logging). +.It Va kern.geom.uzip.debug_block +Log operations involving compressed cluster number. +.El .Sh SEE ALSO .Xr GEOM 4 , .Xr md 4 , @@ -101,5 +168,12 @@ The .Nm driver was written by .An Max Khon Aq Mt fjoe@FreeBSD.org . +The block de-duplication code as well as some +.Nm +driver optimizations have been contributed by +.An Maxim Sobolev Aq Mt sobomax@FreeBSD.org . +The LZMA decompression support and CLOOP 3.0 support have been added by +.An Aleksandr Rybalko Aq Mt ray@FreeBSD.org . +.Pp This manual page was written by .An Ceri Davies Aq Mt ceri@FreeBSD.org . Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Tue Feb 23 23:57:24 2016 (r295942) +++ head/sys/conf/files Tue Feb 23 23:59:08 2016 (r295943) @@ -3083,21 +3083,24 @@ geom/shsec/g_shsec.c optional geom_shse geom/stripe/g_stripe.c optional geom_stripe geom/uncompress/g_uncompress.c optional geom_uncompress contrib/xz-embedded/freebsd/xz_malloc.c \ - optional xz_embedded | geom_uncompress \ + optional xz_embedded | geom_uncompress | geom_uzip \ compile-with "${NORMAL_C} -I$S/contrib/xz-embedded/freebsd/ -I$S/contrib/xz-embedded/linux/lib/xz/ -I$S/contrib/xz-embedded/linux/include/linux/" contrib/xz-embedded/linux/lib/xz/xz_crc32.c \ - optional xz_embedded | geom_uncompress \ + optional xz_embedded | geom_uncompress | geom_uzip \ compile-with "${NORMAL_C} -I$S/contrib/xz-embedded/freebsd/ -I$S/contrib/xz-embedded/linux/lib/xz/ -I$S/contrib/xz-embedded/linux/include/linux/" contrib/xz-embedded/linux/lib/xz/xz_dec_bcj.c \ - optional xz_embedded | geom_uncompress \ + optional xz_embedded | geom_uncompress | geom_uzip \ compile-with "${NORMAL_C} -I$S/contrib/xz-embedded/freebsd/ -I$S/contrib/xz-embedded/linux/lib/xz/ -I$S/contrib/xz-embedded/linux/include/linux/" contrib/xz-embedded/linux/lib/xz/xz_dec_lzma2.c \ - optional xz_embedded | geom_uncompress \ + optional xz_embedded | geom_uncompress | geom_uzip \ compile-with "${NORMAL_C} -I$S/contrib/xz-embedded/freebsd/ -I$S/contrib/xz-embedded/linux/lib/xz/ -I$S/contrib/xz-embedded/linux/include/linux/" contrib/xz-embedded/linux/lib/xz/xz_dec_stream.c \ - optional xz_embedded | geom_uncompress \ + optional xz_embedded | geom_uncompress | geom_uzip \ compile-with "${NORMAL_C} -I$S/contrib/xz-embedded/freebsd/ -I$S/contrib/xz-embedded/linux/lib/xz/ -I$S/contrib/xz-embedded/linux/include/linux/" geom/uzip/g_uzip.c optional geom_uzip +geom/uzip/g_uzip_lzma.c optional geom_uzip +geom/uzip/g_uzip_wrkthr.c optional geom_uzip +geom/uzip/g_uzip_zlib.c optional geom_uzip geom/vinum/geom_vinum.c optional geom_vinum geom/vinum/geom_vinum_create.c optional geom_vinum geom/vinum/geom_vinum_drive.c optional geom_vinum Modified: head/sys/geom/uzip/g_uzip.c ============================================================================== --- head/sys/geom/uzip/g_uzip.c Tue Feb 23 23:57:24 2016 (r295942) +++ head/sys/geom/uzip/g_uzip.c Tue Feb 23 23:59:08 2016 (r295943) @@ -1,6 +1,7 @@ /*- * Copyright (c) 2004 Max Khon * Copyright (c) 2014 Juniper Networks, Inc. + * Copyright (c) 2006-2016 Maxim Sobolev * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -38,91 +39,116 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include +#include #include -FEATURE(geom_uzip, "GEOM uzip read-only compressed disks support"); +MALLOC_DEFINE(M_GEOM_UZIP, "geom_uzip", "GEOM UZIP data structures"); + +#include +#include +#include +#include +#include +#include +#include + +FEATURE(geom_uzip, "GEOM read-only compressed disks support"); + +struct g_uzip_blk { + uint64_t offset; + uint32_t blen; +#define BLEN_UNDEF UINT32_MAX +}; + +#ifndef ABS +#define ABS(a) ((a) < 0 ? -(a) : (a)) +#endif + +#define BLK_IN_RANGE(mcn, bcn, ilen) \ + (((bcn) != BLEN_UNDEF) && ( \ + ((ilen) >= 0 && (mcn >= bcn) && (mcn <= ((intmax_t)(bcn) + (ilen)))) || \ + ((ilen) < 0 && (mcn <= bcn) && (mcn >= ((intmax_t)(bcn) + (ilen)))) \ + )) -#undef GEOM_UZIP_DEBUG #ifdef GEOM_UZIP_DEBUG -#define DPRINTF(a) printf a +# define GEOM_UZIP_DBG_DEFAULT 3 #else -#define DPRINTF(a) +# define GEOM_UZIP_DBG_DEFAULT 0 #endif -static MALLOC_DEFINE(M_GEOM_UZIP, "geom_uzip", "GEOM UZIP data structures"); +#define GUZ_DBG_ERR 1 +#define GUZ_DBG_INFO 2 +#define GUZ_DBG_IO 3 +#define GUZ_DBG_TOC 4 + +SYSCTL_DECL(_kern_geom); +SYSCTL_NODE(_kern_geom, OID_AUTO, uzip, CTLFLAG_RW, 0, "GEOM_UZIP stuff"); +static u_int g_uzip_debug = GEOM_UZIP_DBG_DEFAULT; +SYSCTL_UINT(_kern_geom_uzip, OID_AUTO, debug, CTLFLAG_RWTUN, &g_uzip_debug, 0, + "Debug level (0-4)"); +static u_int g_uzip_debug_block = BLEN_UNDEF; +SYSCTL_UINT(_kern_geom_uzip, OID_AUTO, debug_block, CTLFLAG_RWTUN, + &g_uzip_debug_block, 0, "Debug operations around specific cluster#"); + +#define DPRINTF(lvl, a) \ + if ((lvl) <= g_uzip_debug) { \ + printf a; \ + } +#define DPRINTF_BLK(lvl, cn, a) \ + if ((lvl) <= g_uzip_debug || \ + BLK_IN_RANGE(cn, g_uzip_debug_block, 8) || \ + BLK_IN_RANGE(cn, g_uzip_debug_block, -8)) { \ + printf a; \ + } +#define DPRINTF_BRNG(lvl, bcn, ecn, a) \ + if (bcn >= ecn) { \ + printf("DPRINTF_BRNG: invalid range (%ju, %ju), BUG BUG " \ + "BUG!\n", (uintmax_t)bcn, (uintmax_t)ecn); \ + } else if (((lvl) <= g_uzip_debug) || \ + BLK_IN_RANGE(g_uzip_debug_block, bcn, \ + (intmax_t)ecn - (intmax_t)bcn)) { \ + printf a; \ + } #define UZIP_CLASS_NAME "UZIP" /* * Maximum allowed valid block size (to prevent foot-shooting) */ -#define MAX_BLKSZ (MAXPHYS - MAXPHYS / 1000 - 12) +#define MAX_BLKSZ (MAXPHYS) -/* - * Integer values (block size, number of blocks, offsets) - * are stored in big-endian (network) order on disk and struct cloop_header - * and in native order in struct g_uzip_softc - */ - -#define CLOOP_MAGIC_LEN 128 static char CLOOP_MAGIC_START[] = "#!/bin/sh\n"; -struct cloop_header { - char magic[CLOOP_MAGIC_LEN]; /* cloop magic */ - uint32_t blksz; /* block size */ - uint32_t nblocks; /* number of blocks */ -}; - -struct g_uzip_softc { - uint32_t blksz; /* block size */ - uint32_t nblocks; /* number of blocks */ - uint64_t *offsets; - - struct mtx last_mtx; - uint32_t last_blk; /* last blk no */ - char *last_buf; /* last blk data */ - int req_total; /* total requests */ - int req_cached; /* cached requests */ -}; - -static void g_uzip_done(struct bio *bp); +static void g_uzip_read_done(struct bio *bp); +static void g_uzip_do(struct g_uzip_softc *, struct bio *bp); static void g_uzip_softc_free(struct g_uzip_softc *sc, struct g_geom *gp) { if (gp != NULL) { - DPRINTF(("%s: %d requests, %d cached\n", + DPRINTF(GUZ_DBG_INFO, ("%s: %d requests, %d cached\n", gp->name, sc->req_total, sc->req_cached)); } - if (sc->offsets != NULL) { - free(sc->offsets, M_GEOM_UZIP); - sc->offsets = NULL; - } + + mtx_lock(&sc->queue_mtx); + sc->wrkthr_flags |= GUZ_SHUTDOWN; + wakeup(sc); + while (!(sc->wrkthr_flags & GUZ_EXITING)) { + msleep(sc->procp, &sc->queue_mtx, PRIBIO, "guzfree", + hz / 10); + } + mtx_unlock(&sc->queue_mtx); + + sc->dcp->free(sc->dcp); + free(sc->toc, M_GEOM_UZIP); + mtx_destroy(&sc->queue_mtx); mtx_destroy(&sc->last_mtx); free(sc->last_buf, M_GEOM_UZIP); free(sc, M_GEOM_UZIP); } -static void * -z_alloc(void *nil, u_int type, u_int size) -{ - void *ptr; - - ptr = malloc(type * size, M_GEOM_UZIP, M_NOWAIT); - - return (ptr); -} - -static void -z_free(void *nil, void *ptr) -{ - - free(ptr, M_GEOM_UZIP); -} - static int g_uzip_cached(struct g_geom *gp, struct bio *bp) { @@ -144,8 +170,9 @@ g_uzip_cached(struct g_geom *gp, struct sc->req_cached++; mtx_unlock(&sc->last_mtx); - DPRINTF(("%s/%s: %p: offset=%jd: got %jd bytes from cache\n", - __func__, gp->name, bp, (intmax_t)ofs, (intmax_t)usz)); + DPRINTF(GUZ_DBG_IO, ("%s/%s: %p: offset=%jd: got %jd bytes " + "from cache\n", __func__, gp->name, bp, (intmax_t)ofs, + (intmax_t)usz)); bp->bio_completed += usz; bp->bio_resid -= usz; @@ -160,6 +187,19 @@ g_uzip_cached(struct g_geom *gp, struct return (0); } +#define BLK_ENDS(sc, bi) ((sc)->toc[(bi)].offset + \ + (sc)->toc[(bi)].blen) + +#define BLK_IS_CONT(sc, bi) (BLK_ENDS((sc), (bi) - 1) == \ + (sc)->toc[(bi)].offset) +#define BLK_IS_NIL(sc, bi) ((sc)->toc[(bi)].blen == 0) + +#define TOFF_2_BOFF(sc, pp, bi) ((sc)->toc[(bi)].offset - \ + (sc)->toc[(bi)].offset % (pp)->sectorsize) +#define TLEN_2_BLEN(sc, pp, bp, ei) ((BLK_ENDS((sc), (ei)) - \ + (bp)->bio_offset + (pp)->sectorsize - 1) / \ + (pp)->sectorsize * (pp)->sectorsize) + static int g_uzip_request(struct g_geom *gp, struct bio *bp) { @@ -167,21 +207,14 @@ g_uzip_request(struct g_geom *gp, struct struct bio *bp2; struct g_consumer *cp; struct g_provider *pp; - off_t ofs; - size_t start_blk, end_blk; + off_t ofs, start_blk_ofs; + size_t i, start_blk, end_blk, zsize; if (g_uzip_cached(gp, bp) != 0) return (1); sc = gp->softc; - bp2 = g_clone_bio(bp); - if (bp2 == NULL) { - g_io_deliver(bp, ENOMEM); - return (1); - } - bp2->bio_done = g_uzip_done; - cp = LIST_FIRST(&gp->consumer); pp = cp->provider; @@ -191,17 +224,54 @@ g_uzip_request(struct g_geom *gp, struct end_blk = (ofs + bp->bio_resid + sc->blksz - 1) / sc->blksz; KASSERT(end_blk <= sc->nblocks, ("end_blk out of range")); - DPRINTF(("%s/%s: %p: start=%u (%jd), end=%u (%jd)\n", - __func__, gp->name, bp, - (u_int)start_blk, (intmax_t)sc->offsets[start_blk], - (u_int)end_blk, (intmax_t)sc->offsets[end_blk])); + for (; BLK_IS_NIL(sc, start_blk) && start_blk < end_blk; start_blk++) { + /* Fill in any leading Nil blocks */ + start_blk_ofs = ofs % sc->blksz; + zsize = MIN(sc->blksz - start_blk_ofs, bp->bio_resid); + DPRINTF_BLK(GUZ_DBG_IO, start_blk, ("%s/%s: %p/%ju: " + "filling %ju zero bytes\n", __func__, gp->name, gp, + (uintmax_t)bp->bio_completed, (uintmax_t)zsize)); + bzero(bp->bio_data + bp->bio_completed, zsize); + bp->bio_completed += zsize; + bp->bio_resid -= zsize; + ofs += zsize; + } + + if (start_blk == end_blk) { + KASSERT(bp->bio_resid == 0, ("bp->bio_resid is invalid")); + /* + * No non-Nil data is left, complete request immediately. + */ + DPRINTF(GUZ_DBG_IO, ("%s/%s: %p: all done returning %ju " + "bytes\n", __func__, gp->name, gp, + (uintmax_t)bp->bio_completed)); + g_io_deliver(bp, 0); + return (1); + } - bp2->bio_offset = sc->offsets[start_blk] - - sc->offsets[start_blk] % pp->sectorsize; + for (i = start_blk + 1; i < end_blk; i++) { + /* Trim discontinuous areas if any */ + if (!BLK_IS_CONT(sc, i)) { + end_blk = i; + break; + } + } + + DPRINTF_BRNG(GUZ_DBG_IO, start_blk, end_blk, ("%s/%s: %p: " + "start=%u (%ju), end=%u (%ju)\n", __func__, gp->name, bp, + (u_int)start_blk, (uintmax_t)sc->toc[start_blk].offset, + (u_int)end_blk, (uintmax_t)BLK_ENDS(sc, end_blk - 1))); + + bp2 = g_clone_bio(bp); + if (bp2 == NULL) { + g_io_deliver(bp, ENOMEM); + return (1); + } + bp2->bio_done = g_uzip_read_done; + + bp2->bio_offset = TOFF_2_BOFF(sc, pp, start_blk); while (1) { - bp2->bio_length = sc->offsets[end_blk] - bp2->bio_offset; - bp2->bio_length = (bp2->bio_length + pp->sectorsize - 1) / - pp->sectorsize * pp->sectorsize; + bp2->bio_length = TLEN_2_BLEN(sc, pp, bp2, end_blk - 1); if (bp2->bio_length <= MAXPHYS) break; @@ -215,8 +285,8 @@ g_uzip_request(struct g_geom *gp, struct return (1); } - DPRINTF(("%s/%s: %p: reading %jd bytes from offset %jd\n", - __func__, gp->name, bp, + DPRINTF_BRNG(GUZ_DBG_IO, start_blk, end_blk, ("%s/%s: %p: " + "reading %jd bytes from offset %jd\n", __func__, gp->name, bp, (intmax_t)bp2->bio_length, (intmax_t)bp2->bio_offset)); g_io_request(bp2, cp); @@ -224,21 +294,36 @@ g_uzip_request(struct g_geom *gp, struct } static void -g_uzip_done(struct bio *bp) +g_uzip_read_done(struct bio *bp) +{ + struct bio *bp2; + struct g_geom *gp; + struct g_uzip_softc *sc; + + bp2 = bp->bio_parent; + gp = bp2->bio_to->geom; + sc = gp->softc; + + mtx_lock(&sc->queue_mtx); + bioq_disksort(&sc->bio_queue, bp); + mtx_unlock(&sc->queue_mtx); + wakeup(sc); +} + +static void +g_uzip_do(struct g_uzip_softc *sc, struct bio *bp) { - z_stream zs; struct bio *bp2; struct g_provider *pp; struct g_consumer *cp; struct g_geom *gp; - struct g_uzip_softc *sc; char *data, *data2; off_t ofs; - size_t blk, blkofs, len, ulen; + size_t blk, blkofs, len, ulen, firstblk; + int err; bp2 = bp->bio_parent; gp = bp2->bio_to->geom; - sc = gp->softc; cp = LIST_FIRST(&gp->consumer); pp = cp->provider; @@ -253,46 +338,47 @@ g_uzip_done(struct bio *bp) goto done; } - zs.zalloc = z_alloc; - zs.zfree = z_free; - if (inflateInit(&zs) != Z_OK) { - bp2->bio_error = EILSEQ; - goto done; - } - ofs = bp2->bio_offset + bp2->bio_completed; - blk = ofs / sc->blksz; + firstblk = blk = ofs / sc->blksz; blkofs = ofs % sc->blksz; - data = bp->bio_data + sc->offsets[blk] % pp->sectorsize; + data = bp->bio_data + sc->toc[blk].offset % pp->sectorsize; data2 = bp2->bio_data + bp2->bio_completed; while (bp->bio_completed && bp2->bio_resid) { + if (blk > firstblk && !BLK_IS_CONT(sc, blk)) { + DPRINTF_BLK(GUZ_DBG_IO, blk, ("%s/%s: %p: backref'ed " + "cluster #%u requested, looping around\n", + __func__, gp->name, bp2, (u_int)blk)); + goto done; + } ulen = MIN(sc->blksz - blkofs, bp2->bio_resid); - len = sc->offsets[blk + 1] - sc->offsets[blk]; - DPRINTF(("%s/%s: %p/%ju: data2=%p, ulen=%u, data=%p, len=%u\n", - __func__, gp->name, gp, bp->bio_completed, - data2, (u_int)ulen, data, (u_int)len)); + len = sc->toc[blk].blen; + DPRINTF(GUZ_DBG_IO, ("%s/%s: %p/%ju: data2=%p, ulen=%u, " + "data=%p, len=%u\n", __func__, gp->name, gp, + bp->bio_completed, data2, (u_int)ulen, data, (u_int)len)); if (len == 0) { /* All zero block: no cache update */ bzero(data2, ulen); } else if (len <= bp->bio_completed) { - zs.next_in = data; - zs.avail_in = len; - zs.next_out = sc->last_buf; - zs.avail_out = sc->blksz; mtx_lock(&sc->last_mtx); - if (inflate(&zs, Z_FINISH) != Z_STREAM_END) { + err = sc->dcp->decompress(sc->dcp, gp->name, data, + len, sc->last_buf); + if (err != 0) { sc->last_blk = -1; mtx_unlock(&sc->last_mtx); - inflateEnd(&zs); bp2->bio_error = EILSEQ; + DPRINTF(GUZ_DBG_ERR, ("%s/%s: decompress" + "(%p) failed\n", __func__, gp->name, + sc->dcp)); goto done; } sc->last_blk = blk; memcpy(data2, sc->last_buf + blkofs, ulen); mtx_unlock(&sc->last_mtx); - if (inflateReset(&zs) != Z_OK) { - inflateEnd(&zs); + err = sc->dcp->rewind(sc->dcp, gp->name); + if (err != 0) { bp2->bio_error = EILSEQ; + DPRINTF(GUZ_DBG_ERR, ("%s/%s: rewind(%p) " + "failed\n", __func__, gp->name, sc->dcp)); goto done; } data += len; @@ -307,9 +393,6 @@ g_uzip_done(struct bio *bp) blk++; } - if (inflateEnd(&zs) != Z_OK) - bp2->bio_error = EILSEQ; - done: /* Finish processing the request. */ free(bp->bio_data, M_GEOM_UZIP); @@ -330,9 +413,9 @@ g_uzip_start(struct bio *bp) pp = bp->bio_to; gp = pp->geom; - DPRINTF(("%s/%s: %p: cmd=%d, offset=%jd, length=%jd, buffer=%p\n", - __func__, gp->name, bp, bp->bio_cmd, (intmax_t)bp->bio_offset, - (intmax_t)bp->bio_length, bp->bio_data)); + DPRINTF(GUZ_DBG_IO, ("%s/%s: %p: cmd=%d, offset=%jd, length=%jd, " + "buffer=%p\n", __func__, gp->name, bp, bp->bio_cmd, + (intmax_t)bp->bio_offset, (intmax_t)bp->bio_length, bp->bio_data)); sc = gp->softc; sc->req_total++; @@ -392,6 +475,92 @@ g_uzip_spoiled(struct g_consumer *cp) g_wither_geom(gp, ENXIO); } +static int +g_uzip_parse_toc(struct g_uzip_softc *sc, struct g_provider *pp, + struct g_geom *gp) +{ + uint32_t i, j, backref_to; + uint64_t max_offset, min_offset; + + min_offset = sizeof(struct cloop_header) + + (sc->nblocks + 1) * sizeof(uint64_t); + max_offset = sc->toc[0].offset - 1; + for (i = 0; i < sc->nblocks; i++) { + /* First do some bounds checking */ + if ((sc->toc[i].offset < min_offset) || + (sc->toc[i].offset >= pp->mediasize)) { + goto error_offset; + } + DPRINTF_BLK(GUZ_DBG_IO, i, ("%s: cluster #%u " + "sc->toc[i].offset=%ju max_offset=%ju\n", gp->name, + (u_int)i, (uintmax_t)sc->toc[i].offset, + (uintmax_t)max_offset)); + backref_to = BLEN_UNDEF; + if (sc->toc[i].offset < max_offset) { + /* + * For the backref'ed blocks search already parsed + * TOC entries for the matching offset and copy the + * size from matched entry. + */ + for (j = 0; j <= i; j++) { + if (sc->toc[j].offset == sc->toc[i].offset && + !BLK_IS_NIL(sc, j)) { + break; + } + if (j != i) { + continue; + } + DPRINTF(GUZ_DBG_ERR, ("%s: cannot match " + "backref'ed offset at cluster #%u\n", + gp->name, i)); + return (-1); + } + sc->toc[i].blen = sc->toc[j].blen; + backref_to = j; + } else { + /* + * For the "normal blocks" seek forward until we hit + * block whose offset is larger than ours and assume + * it's going to be the next one. + */ + for (j = i + 1; j < sc->nblocks; j++) { + if (sc->toc[j].offset > max_offset) { + break; + } + } + sc->toc[i].blen = sc->toc[j].offset - + sc->toc[i].offset; + if (BLK_ENDS(sc, i) > pp->mediasize) { + DPRINTF(GUZ_DBG_ERR, ("%s: cluster #%u " + "extends past media boundary (%ju > %ju)\n", + gp->name, (u_int)i, + (uintmax_t)BLK_ENDS(sc, i), + (intmax_t)pp->mediasize)); + return (-1); + } + KASSERT(max_offset <= sc->toc[i].offset, ( + "%s: max_offset is incorrect: %ju", + gp->name, (uintmax_t)max_offset)); + max_offset = BLK_ENDS(sc, i) - 1; + } + DPRINTF_BLK(GUZ_DBG_TOC, i, ("%s: cluster #%u, original %u " + "bytes, in %u bytes", gp->name, i, sc->blksz, + sc->toc[i].blen)); + if (backref_to != BLEN_UNDEF) { + DPRINTF_BLK(GUZ_DBG_TOC, i, (" (->#%u)", + (u_int)backref_to)); + } + DPRINTF_BLK(GUZ_DBG_TOC, i, ("\n")); + } + return (0); + +error_offset: + DPRINTF(GUZ_DBG_ERR, ("%s: cluster #%u: invalid offset %ju, " + "min_offset=%ju mediasize=%jd\n", gp->name, (u_int)i, + sc->toc[i].offset, min_offset, pp->mediasize)); + return (-1); +} + static struct g_geom * g_uzip_taste(struct g_class *mp, struct g_provider *pp, int flags) { @@ -403,6 +572,10 @@ g_uzip_taste(struct g_class *mp, struct struct g_geom *gp; struct g_provider *pp2; struct g_uzip_softc *sc; + enum { + GEOM_UZIP = 1, + GEOM_ULZMA + } type; g_trace(G_T_TOPOLOGY, "%s(%s,%s)", __func__, mp->name, pp->name); g_topology_assert(); @@ -422,10 +595,7 @@ g_uzip_taste(struct g_class *mp, struct if (error == 0) error = g_access(cp, 1, 0, 0); if (error) { - g_detach(cp); - g_destroy_consumer(cp); - g_destroy_geom(gp); - return (NULL); + goto e1; } g_topology_unlock(); @@ -433,22 +603,47 @@ g_uzip_taste(struct g_class *mp, struct * Read cloop header, look for CLOOP magic, perform * other validity checks. */ - DPRINTF(("%s: media sectorsize %u, mediasize %jd\n", + DPRINTF(GUZ_DBG_INFO, ("%s: media sectorsize %u, mediasize %jd\n", gp->name, pp->sectorsize, (intmax_t)pp->mediasize)); buf = g_read_data(cp, 0, pp->sectorsize, NULL); if (buf == NULL) - goto err; + goto e2; header = (struct cloop_header *) buf; if (strncmp(header->magic, CLOOP_MAGIC_START, sizeof(CLOOP_MAGIC_START) - 1) != 0) { - DPRINTF(("%s: no CLOOP magic\n", gp->name)); - goto err; - } - if (header->magic[0x0b] != 'V' || header->magic[0x0c] < '2') { - DPRINTF(("%s: image version too old\n", gp->name)); - goto err; + DPRINTF(GUZ_DBG_ERR, ("%s: no CLOOP magic\n", gp->name)); + goto e3; } + switch (header->magic[CLOOP_OFS_COMPR]) { + case CLOOP_COMP_LZMA: + case CLOOP_COMP_LZMA_DDP: + type = GEOM_ULZMA; + if (header->magic[CLOOP_OFS_VERSN] < CLOOP_MINVER_LZMA) { + DPRINTF(GUZ_DBG_ERR, ("%s: image version too old\n", + gp->name)); + goto e3; + } + DPRINTF(GUZ_DBG_INFO, ("%s: GEOM_UZIP_LZMA image found\n", + gp->name)); + break; + case CLOOP_COMP_LIBZ: + case CLOOP_COMP_LIBZ_DDP: + type = GEOM_UZIP; + if (header->magic[CLOOP_OFS_VERSN] < CLOOP_MINVER_ZLIB) { + DPRINTF(GUZ_DBG_ERR, ("%s: image version too old\n", + gp->name)); + goto e3; + } + DPRINTF(GUZ_DBG_INFO, ("%s: GEOM_UZIP_ZLIB image found\n", + gp->name)); + break; + default: + DPRINTF(GUZ_DBG_ERR, ("%s: unsupported image type\n", + gp->name)); + goto e3; + } + /* * Initialize softc and read offsets. */ @@ -459,7 +654,7 @@ g_uzip_taste(struct g_class *mp, struct if (sc->blksz % 512 != 0) { printf("%s: block size (%u) should be multiple of 512.\n", gp->name, sc->blksz); - goto err; + goto e4; } if (sc->blksz > MAX_BLKSZ) { printf("%s: block size (%u) should not be larger than %d.\n", @@ -470,15 +665,17 @@ g_uzip_taste(struct g_class *mp, struct total_offsets * sizeof(uint64_t) > pp->mediasize) { printf("%s: media too small for %u blocks\n", gp->name, sc->nblocks); - goto err; + goto e4; } - sc->offsets = malloc( - total_offsets * sizeof(uint64_t), M_GEOM_UZIP, M_WAITOK); + sc->toc = malloc(total_offsets * sizeof(struct g_uzip_blk), + M_GEOM_UZIP, M_WAITOK | M_ZERO); offsets_read = MIN(total_offsets, (pp->sectorsize - sizeof(*header)) / sizeof(uint64_t)); - for (i = 0; i < offsets_read; i++) - sc->offsets[i] = be64toh(((uint64_t *) (header + 1))[i]); - DPRINTF(("%s: %u offsets in the first sector\n", + for (i = 0; i < offsets_read; i++) { + sc->toc[i].offset = be64toh(((uint64_t *) (header + 1))[i]); + sc->toc[i].blen = BLEN_UNDEF; + } + DPRINTF(GUZ_DBG_INFO, ("%s: %u offsets in the first sector\n", gp->name, offsets_read)); for (blk = 1; offsets_read < total_offsets; blk++) { uint32_t nread; @@ -487,25 +684,59 @@ g_uzip_taste(struct g_class *mp, struct buf = g_read_data( cp, blk * pp->sectorsize, pp->sectorsize, NULL); if (buf == NULL) - goto err; + goto e5; nread = MIN(total_offsets - offsets_read, pp->sectorsize / sizeof(uint64_t)); - DPRINTF(("%s: %u offsets read from sector %d\n", + DPRINTF(GUZ_DBG_TOC, ("%s: %u offsets read from sector %d\n", gp->name, nread, blk)); for (i = 0; i < nread; i++) { - sc->offsets[offsets_read + i] = + sc->toc[offsets_read + i].offset = be64toh(((uint64_t *) buf)[i]); + sc->toc[offsets_read + i].blen = BLEN_UNDEF; } offsets_read += nread; } free(buf, M_GEOM); - DPRINTF(("%s: done reading offsets\n", gp->name)); + buf = NULL; + offsets_read -= 1; + DPRINTF(GUZ_DBG_INFO, ("%s: done reading %u block offsets from %u " + "sectors\n", gp->name, offsets_read, blk)); + if (sc->nblocks != offsets_read) { + DPRINTF(GUZ_DBG_ERR, ("%s: read %s offsets than expected " + "blocks\n", gp->name, + sc->nblocks < offsets_read ? "more" : "less")); + goto e5; + } + /* Massage TOC (table of contents), make sure it is sound */ + if (g_uzip_parse_toc(sc, pp, gp) != 0) { + DPRINTF(GUZ_DBG_ERR, ("%s: TOC error\n", gp->name)); + goto e5; + } mtx_init(&sc->last_mtx, "geom_uzip cache", NULL, MTX_DEF); + mtx_init(&sc->queue_mtx, "geom_uzip wrkthread", NULL, MTX_DEF); + bioq_init(&sc->bio_queue); sc->last_blk = -1; sc->last_buf = malloc(sc->blksz, M_GEOM_UZIP, M_WAITOK); sc->req_total = 0; sc->req_cached = 0; + if (type == GEOM_UZIP) { + sc->dcp = g_uzip_zlib_ctor(sc->blksz); + } else { + sc->dcp = g_uzip_lzma_ctor(sc->blksz); + } + if (sc->dcp == NULL) { + goto e6; + } + + sc->uzip_do = &g_uzip_do; + + error = kproc_create(g_uzip_wrkthr, sc, &sc->procp, 0, 0, "%s", + gp->name); + if (error != 0) { + goto e7; + } + g_topology_lock(); pp2 = g_new_providerf(gp, "%s", gp->name); pp2->sectorsize = 512; @@ -515,22 +746,31 @@ g_uzip_taste(struct g_class *mp, struct g_error_provider(pp2, 0); g_access(cp, -1, 0, 0); - DPRINTF(("%s: taste ok (%d, %jd), (%d, %d), %x\n", - gp->name, - pp2->sectorsize, (intmax_t)pp2->mediasize, + DPRINTF(GUZ_DBG_INFO, ("%s: taste ok (%d, %jd), (%d, %d), %x\n", + gp->name, pp2->sectorsize, (intmax_t)pp2->mediasize, pp2->stripeoffset, pp2->stripesize, pp2->flags)); - DPRINTF(("%s: %u x %u blocks\n", gp->name, sc->nblocks, sc->blksz)); + DPRINTF(GUZ_DBG_INFO, ("%s: %u x %u blocks\n", gp->name, sc->nblocks, + sc->blksz)); return (gp); -err: - g_topology_lock(); - g_access(cp, -1, 0, 0); - if (buf != NULL) +e7: + sc->dcp->free(sc->dcp); +e6: + free(sc->last_buf, M_GEOM); + mtx_destroy(&sc->queue_mtx); + mtx_destroy(&sc->last_mtx); +e5: + free(sc->toc, M_GEOM); +e4: + free(gp->softc, M_GEOM_UZIP); +e3: + if (buf != NULL) { free(buf, M_GEOM); - if (gp->softc != NULL) { - g_uzip_softc_free(gp->softc, NULL); - gp->softc = NULL; } +e2: + g_topology_lock(); + g_access(cp, -1, 0, 0); +e1: g_detach(cp); g_destroy_consumer(cp); g_destroy_geom(gp); @@ -547,7 +787,8 @@ g_uzip_destroy_geom(struct gctl_req *req g_topology_assert(); if (gp->softc == NULL) { - DPRINTF(("%s(%s): gp->softc == NULL\n", __func__, gp->name)); + DPRINTF(GUZ_DBG_ERR, ("%s(%s): gp->softc == NULL\n", __func__, + gp->name)); return (ENXIO); } Added: head/sys/geom/uzip/g_uzip.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/geom/uzip/g_uzip.h Tue Feb 23 23:59:08 2016 (r295943) @@ -0,0 +1,35 @@ +/*- + * Copyright (c) 2004 Max Khon + * Copyright (c) 2014 Juniper Networks, Inc. + * Copyright (c) 2006-2016 Maxim Sobolev + * 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$ + */ + +#if !defined(M_GEOM_UZIP) +MALLOC_DECLARE(M_GEOM_UZIP); +#endif + +#define DEFINE_RAW_METHOD(func, rval, args...) typedef rval (*func##_t)(args) Added: head/sys/geom/uzip/g_uzip_cloop.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/geom/uzip/g_uzip_cloop.h Tue Feb 23 23:59:08 2016 (r295943) @@ -0,0 +1,55 @@ +/* + * Copyright (c) 2004-2016 Maxim Sobolev + * 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) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Wed Feb 24 00:01:11 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6986BAB2A73; Wed, 24 Feb 2016 00:01:11 +0000 (UTC) (envelope-from jimharris@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 38C9D13E1; Wed, 24 Feb 2016 00:01:11 +0000 (UTC) (envelope-from jimharris@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1O01Aq3084519; Wed, 24 Feb 2016 00:01:10 GMT (envelope-from jimharris@FreeBSD.org) Received: (from jimharris@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1O01AKT084518; Wed, 24 Feb 2016 00:01:10 GMT (envelope-from jimharris@FreeBSD.org) Message-Id: <201602240001.u1O01AKT084518@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jimharris set sender to jimharris@FreeBSD.org using -f From: Jim Harris Date: Wed, 24 Feb 2016 00:01:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295944 - head/sys/dev/nvme X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Feb 2016 00:01:11 -0000 Author: jimharris Date: Wed Feb 24 00:01:10 2016 New Revision: 295944 URL: https://svnweb.freebsd.org/changeset/base/295944 Log: nvme: fix intx handler to not dereference ioq during initialization This was a regression from r293328, which deferred allocation of the controller's ioq array until after interrupts are enabled during boot. PR: 207432 Reported and tested by: Andy Carrel MFC after: 3 days Sponsored by: Intel Modified: head/sys/dev/nvme/nvme_ctrlr.c Modified: head/sys/dev/nvme/nvme_ctrlr.c ============================================================================== --- head/sys/dev/nvme/nvme_ctrlr.c Tue Feb 23 23:59:08 2016 (r295943) +++ head/sys/dev/nvme/nvme_ctrlr.c Wed Feb 24 00:01:10 2016 (r295944) @@ -810,7 +810,7 @@ nvme_ctrlr_intx_handler(void *arg) nvme_qpair_process_completions(&ctrlr->adminq); - if (ctrlr->ioq[0].cpl) + if (ctrlr->ioq && ctrlr->ioq[0].cpl) nvme_qpair_process_completions(&ctrlr->ioq[0]); nvme_mmio_write_4(ctrlr, intmc, 1); From owner-svn-src-head@freebsd.org Wed Feb 24 00:39:42 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 27246AB1AB8; Wed, 24 Feb 2016 00:39:42 +0000 (UTC) (envelope-from sobomax@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C4AAEBA1; Wed, 24 Feb 2016 00:39:41 +0000 (UTC) (envelope-from sobomax@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1O0debg096581; Wed, 24 Feb 2016 00:39:40 GMT (envelope-from sobomax@FreeBSD.org) Received: (from sobomax@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1O0dboB096541; Wed, 24 Feb 2016 00:39:37 GMT (envelope-from sobomax@FreeBSD.org) Message-Id: <201602240039.u1O0dboB096541@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sobomax set sender to sobomax@FreeBSD.org using -f From: Maxim Sobolev Date: Wed, 24 Feb 2016 00:39:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295945 - in head: . share/man/man4 sys/boot/forth sys/conf sys/geom/uncompress sys/mips/conf sys/modules/geom sys/modules/geom/geom_uncompress targets/pseudo/userland usr.bin usr.bin/m... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Feb 2016 00:39:42 -0000 Author: sobomax Date: Wed Feb 24 00:39:36 2016 New Revision: 295945 URL: https://svnweb.freebsd.org/changeset/base/295945 Log: Obsolete mkulzma(8) and geom_uncompress(4), their functionality is now provided by mkuzip(8) and geom_uzip(4) respectively. MFC after: 1 month Deleted: head/share/man/man4/geom_uncompress.4 head/sys/geom/uncompress/ head/sys/modules/geom/geom_uncompress/ head/usr.bin/mkulzma/ Modified: head/ObsoleteFiles.inc head/share/man/man4/Makefile head/share/man/man4/geom_map.4 head/sys/boot/forth/loader.conf head/sys/conf/files head/sys/mips/conf/ALFA_HORNET_UB head/sys/mips/conf/AP121 head/sys/mips/conf/AP135 head/sys/mips/conf/AP143 head/sys/mips/conf/AP91 head/sys/mips/conf/AP93 head/sys/mips/conf/AP96 head/sys/mips/conf/CARAMBOLA2 head/sys/mips/conf/DB120 head/sys/mips/conf/DIR-655A1 head/sys/mips/conf/DIR-825B1 head/sys/mips/conf/DIR-825C1 head/sys/mips/conf/ENH200 head/sys/mips/conf/MT7620 head/sys/mips/conf/ONIONOMEGA head/sys/mips/conf/PB47 head/sys/mips/conf/PB92 head/sys/mips/conf/PICOSTATION_M2HP head/sys/mips/conf/ROUTERSTATION head/sys/mips/conf/RSPRO head/sys/mips/conf/RT305X head/sys/mips/conf/RT5350 head/sys/mips/conf/TL-ARCHERC7V2 head/sys/mips/conf/TL-WDR4300 head/sys/mips/conf/TL-WR1043NDv2 head/sys/mips/conf/TL-WR740Nv4 head/sys/mips/conf/TP-WN1043ND head/sys/mips/conf/WZR-300HP head/sys/mips/conf/WZR-HPAG300H head/sys/modules/geom/Makefile head/targets/pseudo/userland/Makefile.depend head/usr.bin/Makefile Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Wed Feb 24 00:01:10 2016 (r295944) +++ head/ObsoleteFiles.inc Wed Feb 24 00:39:36 2016 (r295945) @@ -38,6 +38,8 @@ # xargs -n1 | sort | uniq -d; # done +# 20160223: functionality from mkulzma(1) merged into mkuzip(1) +OLD_FILES+=usr/bin/mkulzma # 20160211: Remove obsolete unbound-control-setup OLD_FILES+=usr/sbin/unbound-control-setup # 20160116: Update mandoc to cvs snapshot 20160116 Modified: head/share/man/man4/Makefile ============================================================================== --- head/share/man/man4/Makefile Wed Feb 24 00:01:10 2016 (r295944) +++ head/share/man/man4/Makefile Wed Feb 24 00:39:36 2016 (r295945) @@ -165,7 +165,6 @@ MAN= aac.4 \ geom_fox.4 \ geom_linux_lvm.4 \ geom_map.4 \ - geom_uncompress.4 \ geom_uzip.4 \ gif.4 \ gpio.4 \ Modified: head/share/man/man4/geom_map.4 ============================================================================== --- head/share/man/man4/geom_map.4 Wed Feb 24 00:01:10 2016 (r295944) +++ head/share/man/man4/geom_map.4 Wed Feb 24 00:39:36 2016 (r295945) @@ -78,7 +78,7 @@ or by using 0 DISK cfid0 8388608 4 hd 0 sc 0 1 MAP map/config 131072 4 i 5 o 8257536 entry 0 dsize 131072 1 MAP map/rootfs 6881280 4 i 4 o 1376256 entry 0 dsize 6881280 -2 UNCOMPRESS map/rootfs.uncompress 18677760 512 +2 UZIP map/rootfs.uzip 18677760 512 1 MAP map/kernel 1114112 4 i 3 o 262144 entry 0 dsize 1114112 1 MAP map/upgrade 7995392 4 i 2 o 262144 entry 0 dsize 7995392 1 MAP map/factory 65536 4 i 1 o 196608 entry 0 dsize 65536 Modified: head/sys/boot/forth/loader.conf ============================================================================== --- head/sys/boot/forth/loader.conf Wed Feb 24 00:01:10 2016 (r295944) +++ head/sys/boot/forth/loader.conf Wed Feb 24 00:39:36 2016 (r295945) @@ -238,7 +238,6 @@ geom_nop_load="NO" # Transparent disk d geom_raid3_load="NO" # RAID3 disk driver (see graid3(8)) geom_shsec_load="NO" # Shared secret disk driver (see gshsec(8)) geom_stripe_load="NO" # RAID0 disk driver (see gstripe(8)) -geom_uncompress_load="NO" # Compressed disk images driver (see mkulzma(8)) geom_uzip_load="NO" # Compressed disk images driver (see mkuzip(8)) geom_vinum_load="NO" # Concatenated/mirror/raid driver (see vinum(4)) Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Wed Feb 24 00:01:10 2016 (r295944) +++ head/sys/conf/files Wed Feb 24 00:39:36 2016 (r295945) @@ -3081,21 +3081,20 @@ geom/raid3/g_raid3.c optional geom_raid geom/raid3/g_raid3_ctl.c optional geom_raid3 geom/shsec/g_shsec.c optional geom_shsec geom/stripe/g_stripe.c optional geom_stripe -geom/uncompress/g_uncompress.c optional geom_uncompress contrib/xz-embedded/freebsd/xz_malloc.c \ - optional xz_embedded | geom_uncompress | geom_uzip \ + optional xz_embedded | geom_uzip \ compile-with "${NORMAL_C} -I$S/contrib/xz-embedded/freebsd/ -I$S/contrib/xz-embedded/linux/lib/xz/ -I$S/contrib/xz-embedded/linux/include/linux/" contrib/xz-embedded/linux/lib/xz/xz_crc32.c \ - optional xz_embedded | geom_uncompress | geom_uzip \ + optional xz_embedded | geom_uzip \ compile-with "${NORMAL_C} -I$S/contrib/xz-embedded/freebsd/ -I$S/contrib/xz-embedded/linux/lib/xz/ -I$S/contrib/xz-embedded/linux/include/linux/" contrib/xz-embedded/linux/lib/xz/xz_dec_bcj.c \ - optional xz_embedded | geom_uncompress | geom_uzip \ + optional xz_embedded | geom_uzip \ compile-with "${NORMAL_C} -I$S/contrib/xz-embedded/freebsd/ -I$S/contrib/xz-embedded/linux/lib/xz/ -I$S/contrib/xz-embedded/linux/include/linux/" contrib/xz-embedded/linux/lib/xz/xz_dec_lzma2.c \ - optional xz_embedded | geom_uncompress | geom_uzip \ + optional xz_embedded | geom_uzip \ compile-with "${NORMAL_C} -I$S/contrib/xz-embedded/freebsd/ -I$S/contrib/xz-embedded/linux/lib/xz/ -I$S/contrib/xz-embedded/linux/include/linux/" contrib/xz-embedded/linux/lib/xz/xz_dec_stream.c \ - optional xz_embedded | geom_uncompress | geom_uzip \ + optional xz_embedded | geom_uzip \ compile-with "${NORMAL_C} -I$S/contrib/xz-embedded/freebsd/ -I$S/contrib/xz-embedded/linux/lib/xz/ -I$S/contrib/xz-embedded/linux/include/linux/" geom/uzip/g_uzip.c optional geom_uzip geom/uzip/g_uzip_lzma.c optional geom_uzip @@ -3458,7 +3457,7 @@ libkern/strvalid.c standard libkern/timingsafe_bcmp.c standard libkern/zlib.c optional crypto | geom_uzip | ipsec | \ mxge | netgraph_deflate | \ - ddb_ctf | gzio | geom_uncompress + ddb_ctf | gzio net/altq/altq_cbq.c optional altq net/altq/altq_cdnr.c optional altq net/altq/altq_codel.c optional altq Modified: head/sys/mips/conf/ALFA_HORNET_UB ============================================================================== --- head/sys/mips/conf/ALFA_HORNET_UB Wed Feb 24 00:01:10 2016 (r295944) +++ head/sys/mips/conf/ALFA_HORNET_UB Wed Feb 24 00:39:36 2016 (r295945) @@ -49,11 +49,11 @@ device arswitch options AR71XX_ENV_UBOOT # uzip - to boot natively from flash -device geom_uncompress -options GEOM_UNCOMPRESS +device geom_uzip +options GEOM_UZIP # Used for the static uboot partition map device geom_map # Boot off of the rootfs, as defined in the geom_map setup. -options ROOTDEVNAME=\"ufs:map/rootfs.uncompress\" +options ROOTDEVNAME=\"ufs:map/rootfs.uzip\" Modified: head/sys/mips/conf/AP121 ============================================================================== --- head/sys/mips/conf/AP121 Wed Feb 24 00:01:10 2016 (r295944) +++ head/sys/mips/conf/AP121 Wed Feb 24 00:39:36 2016 (r295945) @@ -43,11 +43,11 @@ device arswitch options AR71XX_ENV_UBOOT # uzip - to boot natively from flash -device geom_uncompress -options GEOM_UNCOMPRESS +device geom_uzip +options GEOM_UZIP # Used for the static uboot partition map device geom_map # Boot off of the rootfs, as defined in the geom_map setup. -options ROOTDEVNAME=\"ufs:map/rootfs.uncompress\" +options ROOTDEVNAME=\"ufs:map/rootfs.uzip\" Modified: head/sys/mips/conf/AP135 ============================================================================== --- head/sys/mips/conf/AP135 Wed Feb 24 00:01:10 2016 (r295944) +++ head/sys/mips/conf/AP135 Wed Feb 24 00:39:36 2016 (r295945) @@ -46,8 +46,8 @@ device arswitch options AR71XX_ENV_UBOOT # uzip - to boot natively from flash -device geom_uncompress -options GEOM_UNCOMPRESS +device geom_uzip +options GEOM_UZIP # Used for the static uboot partition map device geom_map @@ -64,7 +64,7 @@ device firmware # Used by the above options ATH_EEPROM_FIRMWARE # Boot off of the rootfs, as defined in the geom_map setup. -options ROOTDEVNAME=\"ufs:map/rootfs.uncompress\" +options ROOTDEVNAME=\"ufs:map/rootfs.uzip\" # Default to accept options IPFIREWALL_DEFAULT_TO_ACCEPT Modified: head/sys/mips/conf/AP143 ============================================================================== --- head/sys/mips/conf/AP143 Wed Feb 24 00:01:10 2016 (r295944) +++ head/sys/mips/conf/AP143 Wed Feb 24 00:39:36 2016 (r295945) @@ -43,11 +43,11 @@ device arswitch options AR71XX_ENV_UBOOT # uzip - to boot natively from flash -device geom_uncompress -options GEOM_UNCOMPRESS +device geom_uzip +options GEOM_UZIP # Used for the static uboot partition map device geom_map # Boot off of the rootfs, as defined in the geom_map setup. -options ROOTDEVNAME=\"ufs:map/rootfs.uncompress\" +options ROOTDEVNAME=\"ufs:map/rootfs.uzip\" Modified: head/sys/mips/conf/AP91 ============================================================================== --- head/sys/mips/conf/AP91 Wed Feb 24 00:01:10 2016 (r295944) +++ head/sys/mips/conf/AP91 Wed Feb 24 00:39:36 2016 (r295945) @@ -38,9 +38,9 @@ options NO_SWAPPING # options MSDOSFS # uncompress - to boot read-only lzma natively from flash -device geom_uncompress -options GEOM_UNCOMPRESS -options ROOTDEVNAME=\"ufs:/dev/map/rootfs.uncompress\" +device geom_uzip +options GEOM_UZIP +options ROOTDEVNAME=\"ufs:/dev/map/rootfs.uzip\" # Not enough space for these.. nooptions INVARIANTS Modified: head/sys/mips/conf/AP93 ============================================================================== --- head/sys/mips/conf/AP93 Wed Feb 24 00:01:10 2016 (r295944) +++ head/sys/mips/conf/AP93 Wed Feb 24 00:39:36 2016 (r295945) @@ -26,9 +26,9 @@ options AR71XX_ENV_UBOOT options MSDOSFS # uncompress - to boot read-only lzma natively from flash -device geom_uncompress -options GEOM_UNCOMPRESS -options ROOTDEVNAME=\"ufs:/dev/map/rootfs.uncompress\" +device geom_uzip +options GEOM_UZIP +options ROOTDEVNAME=\"ufs:/dev/map/rootfs.uzip\" # Used for the static uboot partition map device geom_map Modified: head/sys/mips/conf/AP96 ============================================================================== --- head/sys/mips/conf/AP96 Wed Feb 24 00:01:10 2016 (r295944) +++ head/sys/mips/conf/AP96 Wed Feb 24 00:39:36 2016 (r295945) @@ -27,9 +27,9 @@ options AR71XX_ENV_UBOOT options MSDOSFS # uncompress - to boot read-only lzma natively from flash -device geom_uncompress -options GEOM_UNCOMPRESS -options ROOTDEVNAME=\"ufs:/dev/map/rootfs.uncompress\" +device geom_uzip +options GEOM_UZIP +options ROOTDEVNAME=\"ufs:/dev/map/rootfs.uzip\" # Used for the static uboot partition map device geom_map Modified: head/sys/mips/conf/CARAMBOLA2 ============================================================================== --- head/sys/mips/conf/CARAMBOLA2 Wed Feb 24 00:01:10 2016 (r295944) +++ head/sys/mips/conf/CARAMBOLA2 Wed Feb 24 00:39:36 2016 (r295945) @@ -45,11 +45,11 @@ device arswitch options AR71XX_ENV_UBOOT # uzip - to boot natively from flash -device geom_uncompress -options GEOM_UNCOMPRESS +device geom_uzip +options GEOM_UZIP # Used for the static uboot partition map device geom_map # Boot off of the rootfs, as defined in the geom_map setup. -options ROOTDEVNAME=\"ufs:map/rootfs.uncompress\" +options ROOTDEVNAME=\"ufs:map/rootfs.uzip\" Modified: head/sys/mips/conf/DB120 ============================================================================== --- head/sys/mips/conf/DB120 Wed Feb 24 00:01:10 2016 (r295944) +++ head/sys/mips/conf/DB120 Wed Feb 24 00:39:36 2016 (r295945) @@ -38,8 +38,8 @@ device arswitch options AR71XX_ENV_UBOOT # uzip - to boot natively from flash -device geom_uncompress -options GEOM_UNCOMPRESS +device geom_uzip +options GEOM_UZIP # Used for the static uboot partition map device geom_map @@ -51,4 +51,4 @@ device firmware # Used by the above options ATH_EEPROM_FIRMWARE # Boot off of the rootfs, as defined in the geom_map setup. -options ROOTDEVNAME=\"ufs:map/rootfs.uncompress\" +options ROOTDEVNAME=\"ufs:map/rootfs.uzip\" Modified: head/sys/mips/conf/DIR-655A1 ============================================================================== --- head/sys/mips/conf/DIR-655A1 Wed Feb 24 00:01:10 2016 (r295944) +++ head/sys/mips/conf/DIR-655A1 Wed Feb 24 00:39:36 2016 (r295945) @@ -41,8 +41,8 @@ device arswitch options AR71XX_ENV_UBOOT # uzip - to boot natively from flash -device geom_uncompress -options GEOM_UNCOMPRESS +device geom_uzip +options GEOM_UZIP # Used for the static uboot partition map device geom_map @@ -52,7 +52,7 @@ device firmware # Used by the above options ATH_EEPROM_FIRMWARE # Boot off of the rootfs, as defined in the geom_map setup. -options ROOTDEVNAME=\"ufs:map/rootfs.uncompress\" +options ROOTDEVNAME=\"ufs:map/rootfs.uzip\" # Default to accept options IPFIREWALL_DEFAULT_TO_ACCEPT Modified: head/sys/mips/conf/DIR-825B1 ============================================================================== --- head/sys/mips/conf/DIR-825B1 Wed Feb 24 00:01:10 2016 (r295944) +++ head/sys/mips/conf/DIR-825B1 Wed Feb 24 00:39:36 2016 (r295945) @@ -54,11 +54,11 @@ options NO_SYSCTL_DESCR # GEOM modules device geom_map # to get access to the SPI flash partitions -device geom_uncompress # compressed in-memory filesystem hackery! -options GEOM_UNCOMPRESS +device geom_uzip # compressed in-memory filesystem hackery! +options GEOM_UZIP options GEOM_PART_GPT -options ROOTDEVNAME=\"ufs:/dev/map/rootfs.uncompress\" +options ROOTDEVNAME=\"ufs:/dev/map/rootfs.uzip\" options AR71XX_REALMEM=64*1024*1024 options AR71XX_ENV_UBOOT Modified: head/sys/mips/conf/DIR-825C1 ============================================================================== --- head/sys/mips/conf/DIR-825C1 Wed Feb 24 00:01:10 2016 (r295944) +++ head/sys/mips/conf/DIR-825C1 Wed Feb 24 00:39:36 2016 (r295945) @@ -58,11 +58,11 @@ device firmware options ATH_EEPROM_FIRMWARE # Boot off of the rootfs, as defined in the geom_map setup. -options ROOTDEVNAME=\"ufs:map/rootfs.uncompress\" +options ROOTDEVNAME=\"ufs:map/rootfs.uzip\" # In order to netboot, you have to build the mfsroot into the kernel # 19443712 or 19M is the biggest rootfs via netboot this thing supports #options MD_ROOT # md device usable as a potential root device #options MD_ROOT_SIZE=19444 #makeoptions MFS_IMAGE=/tftpboot/mfsroot-dir825c1.img.ulzma -#options ROOTDEVNAME=\"ufs:md0.uncompress\" +#options ROOTDEVNAME=\"ufs:md0.uzip\" Modified: head/sys/mips/conf/ENH200 ============================================================================== --- head/sys/mips/conf/ENH200 Wed Feb 24 00:01:10 2016 (r295944) +++ head/sys/mips/conf/ENH200 Wed Feb 24 00:39:36 2016 (r295945) @@ -26,9 +26,9 @@ options AR71XX_ENV_UBOOT options MSDOSFS # uncompress - to boot read-only lzma natively from flash -device geom_uncompress -options GEOM_UNCOMPRESS -options ROOTDEVNAME=\"ufs:/dev/map/rootfs.uncompress\" +device geom_uzip +options GEOM_UZIP +options ROOTDEVNAME=\"ufs:/dev/map/rootfs.uzip\" # Used for the static uboot partition map device geom_map Modified: head/sys/mips/conf/MT7620 ============================================================================== --- head/sys/mips/conf/MT7620 Wed Feb 24 00:01:10 2016 (r295944) +++ head/sys/mips/conf/MT7620 Wed Feb 24 00:39:36 2016 (r295945) @@ -65,7 +65,7 @@ options PSEUDOFS #Pseudo-filesystem fr #options BOOTP_WIRED_TO=rt0 #options BOOTP_COMPAT #options CD9660 # ISO 9660 Filesystem -#options ROOTDEVNAME=\"cd9660:/dev/map/rootfs.uncompress\" +#options ROOTDEVNAME=\"cd9660:/dev/map/rootfs.uzip\" #options TMPFS # TMP Memory Filesystem options FFS #Berkeley Fast Filesystem Modified: head/sys/mips/conf/ONIONOMEGA ============================================================================== --- head/sys/mips/conf/ONIONOMEGA Wed Feb 24 00:01:10 2016 (r295944) +++ head/sys/mips/conf/ONIONOMEGA Wed Feb 24 00:39:36 2016 (r295945) @@ -45,11 +45,11 @@ device arswitch options AR71XX_ENV_UBOOT # uzip - to boot natively from flash -device geom_uncompress -options GEOM_UNCOMPRESS +device geom_uzip +options GEOM_UZIP # Used for the static uboot partition map device geom_map # Boot off of the rootfs, as defined in the geom_map setup. -options ROOTDEVNAME=\"ufs:map/rootfs.uncompress\" +options ROOTDEVNAME=\"ufs:map/rootfs.uzip\" Modified: head/sys/mips/conf/PB47 ============================================================================== --- head/sys/mips/conf/PB47 Wed Feb 24 00:01:10 2016 (r295944) +++ head/sys/mips/conf/PB47 Wed Feb 24 00:39:36 2016 (r295945) @@ -32,11 +32,11 @@ options AR71XX_REALMEM=64*1024*1024 options MSDOSFS # uncompress - to boot read-only lzma natively from flash -device geom_uncompress -options GEOM_UNCOMPRESS +device geom_uzip +options GEOM_UZIP # Used for the static uboot partition map device geom_map # Boot off of the rootfs, as defined in the geom_map setup. -options ROOTDEVNAME=\"ufs:map/rootfs.uncompress\" +options ROOTDEVNAME=\"ufs:map/rootfs.uzip\" Modified: head/sys/mips/conf/PB92 ============================================================================== --- head/sys/mips/conf/PB92 Wed Feb 24 00:01:10 2016 (r295944) +++ head/sys/mips/conf/PB92 Wed Feb 24 00:39:36 2016 (r295945) @@ -54,9 +54,9 @@ options FFS #options UFS_DIRHASH #Improve performance on big directories # Support uncompress lzma rootfs -device geom_uncompress -options GEOM_UNCOMPRESS -options ROOTDEVNAME=\"ufs:/dev/map/rootfs.uncompress\" +device geom_uzip +options GEOM_UZIP +options ROOTDEVNAME=\"ufs:/dev/map/rootfs.uzip\" # PCI bus device pci Modified: head/sys/mips/conf/PICOSTATION_M2HP ============================================================================== --- head/sys/mips/conf/PICOSTATION_M2HP Wed Feb 24 00:01:10 2016 (r295944) +++ head/sys/mips/conf/PICOSTATION_M2HP Wed Feb 24 00:39:36 2016 (r295945) @@ -38,9 +38,9 @@ options NO_SWAPPING # options MSDOSFS # uncompress - to boot read-only lzma natively from flash -device geom_uncompress -options GEOM_UNCOMPRESS -options ROOTDEVNAME=\"ufs:/dev/map/rootfs.uncompress\" +device geom_uzip +options GEOM_UZIP +options ROOTDEVNAME=\"ufs:/dev/map/rootfs.uzip\" # Not enough space for these.. nooptions INVARIANTS Modified: head/sys/mips/conf/ROUTERSTATION ============================================================================== --- head/sys/mips/conf/ROUTERSTATION Wed Feb 24 00:01:10 2016 (r295944) +++ head/sys/mips/conf/ROUTERSTATION Wed Feb 24 00:39:36 2016 (r295945) @@ -14,8 +14,8 @@ hints "ROUTERSTATION.hints" # GEOM modules device geom_redboot # to get access to the SPI flash partitions -device geom_uncompress # compressed in-memory filesystem support -options GEOM_UNCOMPRESS +device geom_uzip # compressed in-memory filesystem support +options GEOM_UZIP # For DOS options MSDOSFS @@ -27,4 +27,4 @@ device etherswitch device ukswitch # Boot path - redboot MFS -options ROOTDEVNAME=\"ufs:redboot/rootfs.uncompress\" +options ROOTDEVNAME=\"ufs:redboot/rootfs.uzip\" Modified: head/sys/mips/conf/RSPRO ============================================================================== --- head/sys/mips/conf/RSPRO Wed Feb 24 00:01:10 2016 (r295944) +++ head/sys/mips/conf/RSPRO Wed Feb 24 00:39:36 2016 (r295945) @@ -15,8 +15,8 @@ device pcf2123_rtc # GEOM modules device geom_redboot # to get access to the SPI flash partitions -device geom_uncompress # compressed in-memory filesystem support -options GEOM_UNCOMPRESS +device geom_uzip # compressed in-memory filesystem support +options GEOM_UZIP # For DOS options MSDOSFS @@ -28,5 +28,5 @@ device etherswitch device arswitch # Boot off of flash -options ROOTDEVNAME=\"ufs:redboot/rootfs.uncompress\" +options ROOTDEVNAME=\"ufs:redboot/rootfs.uzip\" Modified: head/sys/mips/conf/RT305X ============================================================================== --- head/sys/mips/conf/RT305X Wed Feb 24 00:01:10 2016 (r295944) +++ head/sys/mips/conf/RT305X Wed Feb 24 00:39:36 2016 (r295945) @@ -64,7 +64,7 @@ options BOOTP_NFSV3 options BOOTP_WIRED_TO=rt0 options BOOTP_COMPAT options CD9660 # ISO 9660 Filesystem -options ROOTDEVNAME=\"cd9660:/dev/map/rootfs.uncompress\" +options ROOTDEVNAME=\"cd9660:/dev/map/rootfs.uzip\" options TMPFS # TMP Memory Filesystem #options FFS #Berkeley Fast Filesystem Modified: head/sys/mips/conf/RT5350 ============================================================================== --- head/sys/mips/conf/RT5350 Wed Feb 24 00:01:10 2016 (r295944) +++ head/sys/mips/conf/RT5350 Wed Feb 24 00:39:36 2016 (r295945) @@ -67,10 +67,10 @@ options TMPFS # TMP Memory Filesystem options FFS #Berkeley Fast Filesystem #options ROOTDEVNAME=\"nfs:193.178.153.200:/bsdmips\" -#device geom_uncompress -#options GEOM_UNCOMPRESS +#device geom_uzip +#options GEOM_UZIP #options MD_ROOT -#options ROOTDEVNAME=\"ufs:md0.uncompress\" +#options ROOTDEVNAME=\"ufs:md0.uzip\" # Options for making kernel less hangry makeoptions INLINE_LIMIT=1024 Modified: head/sys/mips/conf/TL-ARCHERC7V2 ============================================================================== --- head/sys/mips/conf/TL-ARCHERC7V2 Wed Feb 24 00:01:10 2016 (r295944) +++ head/sys/mips/conf/TL-ARCHERC7V2 Wed Feb 24 00:39:36 2016 (r295945) @@ -46,8 +46,8 @@ options MSDOSFS options AR71XX_ENV_UBOOT # uzip - to boot natively from flash -device geom_uncompress -options GEOM_UNCOMPRESS +device geom_uzip +options GEOM_UZIP # Used for the static uboot partition map device geom_map @@ -64,7 +64,7 @@ device firmware # Used by the above options ATH_EEPROM_FIRMWARE # Boot off of the rootfs, as defined in the geom_map setup. -options ROOTDEVNAME=\"ufs:map/rootfs.uncompress\" +options ROOTDEVNAME=\"ufs:map/rootfs.uzip\" # Default to accept options IPFIREWALL_DEFAULT_TO_ACCEPT Modified: head/sys/mips/conf/TL-WDR4300 ============================================================================== --- head/sys/mips/conf/TL-WDR4300 Wed Feb 24 00:01:10 2016 (r295944) +++ head/sys/mips/conf/TL-WDR4300 Wed Feb 24 00:39:36 2016 (r295945) @@ -38,8 +38,8 @@ options MSDOSFS options AR71XX_ENV_UBOOT # uzip - to boot natively from flash -device geom_uncompress -options GEOM_UNCOMPRESS +device geom_uzip +options GEOM_UZIP # Used for the static uboot partition map device geom_map @@ -51,4 +51,4 @@ device firmware # Used by the above options ATH_EEPROM_FIRMWARE # Boot off of the rootfs, as defined in the geom_map setup. -options ROOTDEVNAME=\"ufs:map/rootfs.uncompress\" +options ROOTDEVNAME=\"ufs:map/rootfs.uzip\" Modified: head/sys/mips/conf/TL-WR1043NDv2 ============================================================================== --- head/sys/mips/conf/TL-WR1043NDv2 Wed Feb 24 00:01:10 2016 (r295944) +++ head/sys/mips/conf/TL-WR1043NDv2 Wed Feb 24 00:39:36 2016 (r295945) @@ -34,8 +34,8 @@ options MSDOSFS options AR71XX_ENV_UBOOT # uzip - to boot natively from flash -device geom_uncompress -options GEOM_UNCOMPRESS +device geom_uzip +options GEOM_UZIP # Used for the static uboot partition map device geom_map @@ -47,7 +47,7 @@ device geom_map #options ATH_EEPROM_FIRMWARE # Boot off of the rootfs, as defined in the geom_map setup. -options ROOTDEVNAME=\"ufs:map/rootfs.uncompress\" +options ROOTDEVNAME=\"ufs:map/rootfs.uzip\" # Default to accept options IPFIREWALL_DEFAULT_TO_ACCEPT Modified: head/sys/mips/conf/TL-WR740Nv4 ============================================================================== --- head/sys/mips/conf/TL-WR740Nv4 Wed Feb 24 00:01:10 2016 (r295944) +++ head/sys/mips/conf/TL-WR740Nv4 Wed Feb 24 00:39:36 2016 (r295945) @@ -43,13 +43,13 @@ device arswitch options AR71XX_ENV_UBOOT # uzip - to boot natively from flash -device geom_uncompress -options GEOM_UNCOMPRESS +device geom_uzip +options GEOM_UZIP # Used for the static uboot partition map device geom_map # Boot off of the rootfs, as defined in the geom_map setup. -# options ROOTDEVNAME=\"ufs:map/rootfs.uncompress\" +# options ROOTDEVNAME=\"ufs:map/rootfs.uzip\" # Note: we don't fit in 4MB flash, so the rootfs must be on USB for now options ROOTDEVNAME=\"ufs:da0\" Modified: head/sys/mips/conf/TP-WN1043ND ============================================================================== --- head/sys/mips/conf/TP-WN1043ND Wed Feb 24 00:01:10 2016 (r295944) +++ head/sys/mips/conf/TP-WN1043ND Wed Feb 24 00:39:36 2016 (r295945) @@ -37,14 +37,14 @@ options MSDOSFS options AR71XX_ENV_UBOOT # uncompress - to boot natively from flash -device geom_uncompress -options GEOM_UNCOMPRESS +device geom_uzip +options GEOM_UZIP # Used for the static uboot partition map device geom_map # Boot off of the rootfs, as defined in the geom_map setup. -options ROOTDEVNAME=\"ufs:map/rootfs.uncompress\" +options ROOTDEVNAME=\"ufs:map/rootfs.uzip\" # We bite the performance overhead for now; the kernel won't # fit if the mutexes are inlined. Modified: head/sys/mips/conf/WZR-300HP ============================================================================== --- head/sys/mips/conf/WZR-300HP Wed Feb 24 00:01:10 2016 (r295944) +++ head/sys/mips/conf/WZR-300HP Wed Feb 24 00:39:36 2016 (r295945) @@ -26,9 +26,9 @@ options BOOTVERBOSE # GEOM modules device geom_map # to get access to the SPI flash partitions -device geom_uncompress # compressed in-memory filesystem hackery! +device geom_uzip # compressed in-memory filesystem hackery! -options ROOTDEVNAME=\"ufs:/dev/map/rootfs.uncompress\" +options ROOTDEVNAME=\"ufs:/dev/map/rootfs.uzip\" options AR71XX_ATH_EEPROM # Fetch EEPROM/PCI config from flash options ATH_EEPROM_FIRMWARE # Use EEPROM from flash Modified: head/sys/mips/conf/WZR-HPAG300H ============================================================================== --- head/sys/mips/conf/WZR-HPAG300H Wed Feb 24 00:01:10 2016 (r295944) +++ head/sys/mips/conf/WZR-HPAG300H Wed Feb 24 00:39:36 2016 (r295945) @@ -25,10 +25,10 @@ options AR71XX_ENV_UBOOT options BOOTVERBOSE # GEOM modules -device geom_uncompress # compressed in-memory filesystem hackery! +device geom_uzip # compressed in-memory filesystem hackery! device geom_map # to get access to the SPI flash partitions -options ROOTDEVNAME=\"ufs:/dev/map/rootfs.uncompress\" +options ROOTDEVNAME=\"ufs:/dev/map/rootfs.uzip\" options AR71XX_ATH_EEPROM # Fetch EEPROM/PCI config from flash options ATH_EEPROM_FIRMWARE # Use EEPROM from flash Modified: head/sys/modules/geom/Makefile ============================================================================== --- head/sys/modules/geom/Makefile Wed Feb 24 00:01:10 2016 (r295944) +++ head/sys/modules/geom/Makefile Wed Feb 24 00:39:36 2016 (r295945) @@ -21,7 +21,6 @@ SUBDIR= geom_bde \ geom_sched \ geom_shsec \ geom_stripe \ - geom_uncompress \ geom_uzip \ geom_vinum \ geom_virstor \ Modified: head/targets/pseudo/userland/Makefile.depend ============================================================================== --- head/targets/pseudo/userland/Makefile.depend Wed Feb 24 00:01:10 2016 (r295944) +++ head/targets/pseudo/userland/Makefile.depend Wed Feb 24 00:39:36 2016 (r295945) @@ -297,7 +297,6 @@ DIRDEPS+= \ usr.bin/mklocale \ usr.bin/mkstr \ usr.bin/mktemp \ - usr.bin/mkulzma \ usr.bin/mkuzip \ usr.bin/msgs \ usr.bin/mt \ Modified: head/usr.bin/Makefile ============================================================================== --- head/usr.bin/Makefile Wed Feb 24 00:01:10 2016 (r295944) +++ head/usr.bin/Makefile Wed Feb 24 00:39:36 2016 (r295945) @@ -99,7 +99,6 @@ SUBDIR= alias \ mkimg \ mklocale \ mktemp \ - mkulzma \ mkuzip \ mt \ ncal \ From owner-svn-src-head@freebsd.org Wed Feb 24 00:42:45 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 19D53AB1D3D; Wed, 24 Feb 2016 00:42:45 +0000 (UTC) (envelope-from erj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EA6FAF71; Wed, 24 Feb 2016 00:42:44 +0000 (UTC) (envelope-from erj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1O0giwQ099193; Wed, 24 Feb 2016 00:42:44 GMT (envelope-from erj@FreeBSD.org) Received: (from erj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1O0giUN099192; Wed, 24 Feb 2016 00:42:44 GMT (envelope-from erj@FreeBSD.org) Message-Id: <201602240042.u1O0giUN099192@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: erj set sender to erj@FreeBSD.org using -f From: Eric Joyner Date: Wed, 24 Feb 2016 00:42:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295946 - head/sys/dev/ixl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Feb 2016 00:42:45 -0000 Author: erj Date: Wed Feb 24 00:42:43 2016 New Revision: 295946 URL: https://svnweb.freebsd.org/changeset/base/295946 Log: ixl(4): Fix potential driver interrupt setup issues and startup crash. - Limit queue autoconfiguration to 8 queues to prevent the driver from requesting a large number of MSI-X vectors at boot. - Fix potential kernel panic that occurs when the driver loads and cannot get all requested MSIX vectors. Instead, attach() will fail with an error. - Move taskqueue setup to later in attach() to prevent having to free taskqueues if some other error in attach() occurs. Differential Revision: https://reviews.freebsd.org/D5205 MFC after: 1 month Tested by: jeffrey.e.pieper@intel.com Sponsored by: Intel Corporation Modified: head/sys/dev/ixl/if_ixl.c Modified: head/sys/dev/ixl/if_ixl.c ============================================================================== --- head/sys/dev/ixl/if_ixl.c Wed Feb 24 00:39:36 2016 (r295945) +++ head/sys/dev/ixl/if_ixl.c Wed Feb 24 00:42:43 2016 (r295946) @@ -115,6 +115,8 @@ static int ixl_init_msix(struct ixl_pf * static void ixl_configure_msix(struct ixl_pf *); static void ixl_configure_itr(struct ixl_pf *); static void ixl_configure_legacy(struct ixl_pf *); +static void ixl_init_taskqueues(struct ixl_pf *); +static void ixl_free_taskqueues(struct ixl_pf *); static void ixl_free_pci_resources(struct ixl_pf *); static void ixl_local_timer(void *); static int ixl_setup_interface(device_t, struct ixl_vsi *); @@ -642,7 +644,7 @@ ixl_attach(device_t dev) else error = ixl_assign_vsi_legacy(pf); if (error) - goto err_late; + goto err_mac_hmc; if (((hw->aq.fw_maj_ver == 4) && (hw->aq.fw_min_ver < 33)) || (hw->aq.fw_maj_ver < 4)) { @@ -667,7 +669,7 @@ ixl_attach(device_t dev) error = ixl_switch_config(pf); if (error) { device_printf(dev, "Initial switch config failed: %d\n", error); - goto err_mac_hmc; + goto err_late; } /* Limit phy interrupts to link and modules failure */ @@ -680,6 +682,9 @@ ixl_attach(device_t dev) bus = ixl_get_bus_info(hw, dev); i40e_set_pci_config_data(hw, bus); + /* Initialize taskqueues */ + ixl_init_taskqueues(pf); + /* Initialize statistics */ ixl_pf_reset_stats(pf); ixl_update_stats_counters(pf); @@ -748,7 +753,6 @@ ixl_detach(device_t dev) struct ixl_pf *pf = device_get_softc(dev); struct i40e_hw *hw = &pf->hw; struct ixl_vsi *vsi = &pf->vsi; - struct ixl_queue *que = vsi->queues; i40e_status status; #ifdef PCI_IOV int error; @@ -777,13 +781,7 @@ ixl_detach(device_t dev) IXL_PF_UNLOCK(pf); } - for (int i = 0; i < vsi->num_queues; i++, que++) { - if (que->tq) { - taskqueue_drain(que->tq, &que->task); - taskqueue_drain(que->tq, &que->tx_task); - taskqueue_free(que->tq); - } - } + ixl_free_taskqueues(pf); /* Shutdown LAN HMC */ status = i40e_shutdown_lan_hmc(hw); @@ -1990,6 +1988,58 @@ ixl_assign_vsi_legacy(struct ixl_pf *pf) return (0); } +static void +ixl_init_taskqueues(struct ixl_pf *pf) +{ + struct ixl_vsi *vsi = &pf->vsi; + struct ixl_queue *que = vsi->queues; + device_t dev = pf->dev; + + /* Tasklet for Admin Queue */ + TASK_INIT(&pf->adminq, 0, ixl_do_adminq, pf); +#ifdef PCI_IOV + /* VFLR Tasklet */ + TASK_INIT(&pf->vflr_task, 0, ixl_handle_vflr, pf); +#endif + + /* Create and start PF taskqueue */ + pf->tq = taskqueue_create_fast("ixl_adm", M_NOWAIT, + taskqueue_thread_enqueue, &pf->tq); + taskqueue_start_threads(&pf->tq, 1, PI_NET, "%s adminq", + device_get_nameunit(dev)); + + /* Create queue tasks and start queue taskqueues */ + for (int i = 0; i < vsi->num_queues; i++, que++) { + TASK_INIT(&que->tx_task, 0, ixl_deferred_mq_start, que); + TASK_INIT(&que->task, 0, ixl_handle_que, que); + que->tq = taskqueue_create_fast("ixl_que", M_NOWAIT, + taskqueue_thread_enqueue, &que->tq); +#ifdef RSS + CPU_SETOF(cpu_id, &cpu_mask); + taskqueue_start_threads_cpuset(&que->tq, 1, PI_NET, + &cpu_mask, "%s (bucket %d)", + device_get_nameunit(dev), cpu_id); +#else + taskqueue_start_threads(&que->tq, 1, PI_NET, + "%s (que %d)", device_get_nameunit(dev), que->me); +#endif + } + +} + +static void +ixl_free_taskqueues(struct ixl_pf *pf) +{ + struct ixl_vsi *vsi = &pf->vsi; + struct ixl_queue *que = vsi->queues; + + if (pf->tq) + taskqueue_free(pf->tq); + for (int i = 0; i < vsi->num_queues; i++, que++) { + if (que->tq) + taskqueue_free(que->tq); + } +} /********************************************************************* * @@ -2028,17 +2078,6 @@ ixl_assign_vsi_msix(struct ixl_pf *pf) } bus_describe_intr(dev, pf->res, pf->tag, "aq"); pf->admvec = vector; - /* Tasklet for Admin Queue */ - TASK_INIT(&pf->adminq, 0, ixl_do_adminq, pf); - -#ifdef PCI_IOV - TASK_INIT(&pf->vflr_task, 0, ixl_handle_vflr, pf); -#endif - - pf->tq = taskqueue_create_fast("ixl_adm", M_NOWAIT, - taskqueue_thread_enqueue, &pf->tq); - taskqueue_start_threads(&pf->tq, 1, PI_NET, "%s adminq", - device_get_nameunit(pf->dev)); ++vector; /* Now set up the stations */ @@ -2069,19 +2108,6 @@ ixl_assign_vsi_msix(struct ixl_pf *pf) #endif bus_bind_intr(dev, que->res, cpu_id); que->msix = vector; - TASK_INIT(&que->tx_task, 0, ixl_deferred_mq_start, que); - TASK_INIT(&que->task, 0, ixl_handle_que, que); - que->tq = taskqueue_create_fast("ixl_que", M_NOWAIT, - taskqueue_thread_enqueue, &que->tq); -#ifdef RSS - CPU_SETOF(cpu_id, &cpu_mask); - taskqueue_start_threads_cpuset(&que->tq, 1, PI_NET, - &cpu_mask, "%s (bucket %d)", - device_get_nameunit(dev), cpu_id); -#else - taskqueue_start_threads(&que->tq, 1, PI_NET, - "%s que", device_get_nameunit(dev)); -#endif } return (0); @@ -2144,9 +2170,15 @@ ixl_init_msix(struct ixl_pf *pf) /* Figure out a reasonable auto config value */ queues = (mp_ncpus > (available - 1)) ? (available - 1) : mp_ncpus; - /* Override with hardcoded value if sane */ + /* Override with hardcoded value if it's less than autoconfig count */ if ((ixl_max_queues != 0) && (ixl_max_queues <= queues)) queues = ixl_max_queues; + else if ((ixl_max_queues != 0) && (ixl_max_queues > queues)) + device_printf(dev, "ixl_max_queues > # of cpus, using " + "autoconfig amount...\n"); + /* Or limit maximum auto-configured queues to 8 */ + else if ((ixl_max_queues == 0) && (queues > 8)) + queues = 8; #ifdef RSS /* If we're doing RSS, clamp at the number of RSS buckets */ From owner-svn-src-head@freebsd.org Wed Feb 24 01:11:52 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 746CBAB27E6; Wed, 24 Feb 2016 01:11:52 +0000 (UTC) (envelope-from erj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 45F871E93; Wed, 24 Feb 2016 01:11:52 +0000 (UTC) (envelope-from erj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1O1BpUO006413; Wed, 24 Feb 2016 01:11:51 GMT (envelope-from erj@FreeBSD.org) Received: (from erj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1O1BptU006411; Wed, 24 Feb 2016 01:11:51 GMT (envelope-from erj@FreeBSD.org) Message-Id: <201602240111.u1O1BptU006411@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: erj set sender to erj@FreeBSD.org using -f From: Eric Joyner Date: Wed, 24 Feb 2016 01:11:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295947 - head/sys/dev/ixl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Feb 2016 01:11:52 -0000 Author: erj Date: Wed Feb 24 01:11:51 2016 New Revision: 295947 URL: https://svnweb.freebsd.org/changeset/base/295947 Log: ixl(4)/ixlv(4): Remove a couple unnecessary register writes/flushes. The one in ixl_xmit() has brought up to us as being unnecessary at least a couple times. Differential Revision: https://reviews.freebsd.org/D5208 Tested by: jeffrey.e.pieper@intel.com Sponsored by: Intel Corporation Modified: head/sys/dev/ixl/if_ixl.c head/sys/dev/ixl/ixl_txrx.c Modified: head/sys/dev/ixl/if_ixl.c ============================================================================== --- head/sys/dev/ixl/if_ixl.c Wed Feb 24 00:42:43 2016 (r295946) +++ head/sys/dev/ixl/if_ixl.c Wed Feb 24 01:11:51 2016 (r295947) @@ -2912,7 +2912,6 @@ ixl_initialize_vsi(struct ixl_vsi *vsi) device_printf(dev, "Fail in init_rx_ring %d\n", i); break; } - wr32(vsi->hw, I40E_QRX_TAIL(que->me), 0); #ifdef DEV_NETMAP /* preserve queue */ if (vsi->ifp->if_capenable & IFCAP_NETMAP) { Modified: head/sys/dev/ixl/ixl_txrx.c ============================================================================== --- head/sys/dev/ixl/ixl_txrx.c Wed Feb 24 00:42:43 2016 (r295946) +++ head/sys/dev/ixl/ixl_txrx.c Wed Feb 24 01:11:51 2016 (r295947) @@ -390,7 +390,6 @@ ixl_xmit(struct ixl_queue *que, struct m ++txr->total_packets; wr32(hw, txr->tail, i); - ixl_flush(hw); /* Mark outstanding work */ if (que->busy == 0) que->busy = 1; From owner-svn-src-head@freebsd.org Wed Feb 24 01:25:15 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8BE90AB2BFF; Wed, 24 Feb 2016 01:25:15 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6C519762; Wed, 24 Feb 2016 01:25:15 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (c-73-231-226-104.hsd1.ca.comcast.net [73.231.226.104]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 878F3B94A; Tue, 23 Feb 2016 20:25:13 -0500 (EST) From: John Baldwin To: Randall Stewart Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r295927 - in head/sys/netinet: . tcp_stacks Date: Tue, 23 Feb 2016 17:25:09 -0800 Message-ID: <7907269.jj0Ooylupy@ralph.baldwin.cx> User-Agent: KMail/4.14.3 (FreeBSD/10.2-STABLE; KDE/4.14.3; amd64; ; ) In-Reply-To: <201602231753.u1NHrdhU078634@repo.freebsd.org> References: <201602231753.u1NHrdhU078634@repo.freebsd.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Tue, 23 Feb 2016 20:25:13 -0500 (EST) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Feb 2016 01:25:15 -0000 On Tuesday, February 23, 2016 05:53:39 PM Randall Stewart wrote: > Author: rrs > Date: Tue Feb 23 17:53:39 2016 > New Revision: 295927 > URL: https://svnweb.freebsd.org/changeset/base/295927 > > Log: > This fixes the fastpath code to have a better module initialization sequence when > included in loader.conf. It also fixes it so that no matter if some one incorrectly > specifies a load order, the lists and such will be initialized on demand at that > time so no one can make that mistake. > > Reviewed by: hiren > Differential Revision: D5189 > > Modified: > head/sys/netinet/tcp_stacks/fastpath.c > head/sys/netinet/tcp_subr.c > > Modified: head/sys/netinet/tcp_stacks/fastpath.c > ============================================================================== > --- head/sys/netinet/tcp_stacks/fastpath.c Tue Feb 23 16:01:34 2016 (r295926) > +++ head/sys/netinet/tcp_stacks/fastpath.c Tue Feb 23 17:53:39 2016 (r295927) > @@ -2453,4 +2453,4 @@ static moduledata_t new_tcp_fastpaths = > }; > > MODULE_VERSION(kern_tcpfastpaths, 1); > -DECLARE_MODULE(kern_tcpfastpaths, new_tcp_fastpaths, SI_SUB_PSEUDO, SI_ORDER_ANY); > +DECLARE_MODULE(kern_tcpfastpaths, new_tcp_fastpaths, SI_SUB_PROTO_DOMAIN, SI_ORDER_ANY); > > Modified: head/sys/netinet/tcp_subr.c > ============================================================================== > --- head/sys/netinet/tcp_subr.c Tue Feb 23 16:01:34 2016 (r295926) > +++ head/sys/netinet/tcp_subr.c Tue Feb 23 17:53:39 2016 (r295927) > @@ -263,9 +263,20 @@ static struct tcp_function_block tcp_def > 0 > }; > > +int t_functions_inited = 0; > struct tcp_funchead t_functions; > static struct tcp_function_block *tcp_func_set_ptr = &tcp_def_funcblk; > > +static void > +init_tcp_functions() > +{ > + if (t_functions_inited == 0) { > + TAILQ_INIT(&t_functions); > + rw_init_flags(&tcp_function_lock, "tcp_func_lock" , 0); > + t_functions_inited = 1; > + } You could use TAILQ_INITIALIZER and RW_SYSINIT instead of this helper function to provide more deteriministic initialization. -- John Baldwin From owner-svn-src-head@freebsd.org Wed Feb 24 01:32:14 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6FB07AB2E93; Wed, 24 Feb 2016 01:32:14 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4AA0CC23; Wed, 24 Feb 2016 01:32:14 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1O1WDJ3012544; Wed, 24 Feb 2016 01:32:13 GMT (envelope-from araujo@FreeBSD.org) Received: (from araujo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1O1WD0d012541; Wed, 24 Feb 2016 01:32:13 GMT (envelope-from araujo@FreeBSD.org) Message-Id: <201602240132.u1O1WD0d012541@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: araujo set sender to araujo@FreeBSD.org using -f From: Marcelo Araujo Date: Wed, 24 Feb 2016 01:32:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295949 - in head: etc etc/defaults share/man/man8 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Feb 2016 01:32:14 -0000 Author: araujo Date: Wed Feb 24 01:32:12 2016 New Revision: 295949 URL: https://svnweb.freebsd.org/changeset/base/295949 Log: - Add a global option where we can protect processes when swap space is exhausted. How to use: Basically we need to add on rc.conf an another option like: If we want to protect only the main processes. syslogd_oomprotect="YES" If we want to protect all future children of the specified processes. syslogd_oomprotect="ALL" PR: 204741 (based on) Submitted by: eugen@grosbein.net Reviewed by: jhb, allanjude, rpokala and bapt MFC after: 4 weeks Relnotes: Yes Sponsored by: gandi.net Differential Revision: https://reviews.freebsd.org/D5176 Modified: head/etc/defaults/rc.conf head/etc/rc.subr head/share/man/man8/rc.subr.8 Modified: head/etc/defaults/rc.conf ============================================================================== --- head/etc/defaults/rc.conf Wed Feb 24 01:30:50 2016 (r295948) +++ head/etc/defaults/rc.conf Wed Feb 24 01:32:12 2016 (r295949) @@ -253,6 +253,7 @@ hostapd_enable="NO" # Run hostap daemon syslogd_enable="YES" # Run syslog daemon (or NO). syslogd_program="/usr/sbin/syslogd" # path to syslogd, if you want a different one. syslogd_flags="-s" # Flags to syslogd (if enabled). +syslogd_oomprotect="YES" # Don't kill syslogd when swap space is exhausted. altlog_proglist="" # List of chrooted applicatioins in /var inetd_enable="NO" # Run the network daemon dispatcher (YES/NO). inetd_program="/usr/sbin/inetd" # path to inetd, if you want a different one. Modified: head/etc/rc.subr ============================================================================== --- head/etc/rc.subr Wed Feb 24 01:30:50 2016 (r295948) +++ head/etc/rc.subr Wed Feb 24 01:32:12 2016 (r295949) @@ -45,6 +45,7 @@ _rc_subr_loaded="YES" SYSCTL="/sbin/sysctl" SYSCTL_N="${SYSCTL} -n" SYSCTL_W="${SYSCTL}" +PROTECT="/usr/bin/protect" ID="/usr/bin/id" IDCMD="if [ -x $ID ]; then $ID -un; fi" PS="/bin/ps -ww" @@ -755,6 +756,8 @@ check_startmsgs() # # ${name}_nice n Nice level to run ${command} at. # +# ${name}_oomprotect n Don't kill ${command} when swap space is exhausted. +# # ${name}_user n User to run ${command} as, using su(1) if not # using ${name}_chroot. # Requires /usr to be mounted. @@ -944,7 +947,8 @@ run_rc_command() _nice=\$${name}_nice _user=\$${name}_user \ _group=\$${name}_group _groups=\$${name}_groups \ _fib=\$${name}_fib _env=\$${name}_env \ - _prepend=\$${name}_prepend _login_class=\${${name}_login_class:-daemon} + _prepend=\$${name}_prepend _login_class=\${${name}_login_class:-daemon} \ + _oomprotect=\$${name}_oomprotect if [ -n "$_user" ]; then # unset $_user if running as that user if [ "$_user" = "$(eval $IDCMD)" ]; then @@ -1182,6 +1186,26 @@ $command $rc_flags $command_args" ;; esac + + # Apply protect(1) to the PID if ${name}_oomprotect is set. + case "$rc_arg" in + start) + if [ -n "$_oomprotect" ]; then + if [ -f "${PROTECT}" ]; then + pid=$(check_process $command) + case $_oomprotect in + [Aa][Ll][Ll]) + ${PROTECT} -i -p ${pid} + ;; + [Yy][Ee][Ss]) + ${PROTECT} -p ${pid} + ;; + esac + fi + fi + ;; + esac + return $_return done Modified: head/share/man/man8/rc.subr.8 ============================================================================== --- head/share/man/man8/rc.subr.8 Wed Feb 24 01:30:50 2016 (r295948) +++ head/share/man/man8/rc.subr.8 Wed Feb 24 01:32:12 2016 (r295949) @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 12, 2014 +.Dd February 4, 2016 .Dt RC.SUBR 8 .Os .Sh NAME @@ -604,6 +604,16 @@ as. Only supported after .Pa /usr is mounted. +.It Va ${name}_oomprotect +.Xr protect 1 +.Va command +from being killed when swap space is exhausted. +If +.Em YES +is used, no child processes are protected. +If +.Em ALL , +protect all child processes. .It Va ${name}_program Full path to the command. Overrides From owner-svn-src-head@freebsd.org Wed Feb 24 01:58:42 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 76AF0AB1B55; Wed, 24 Feb 2016 01:58:42 +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 mx1.freebsd.org (Postfix) with ESMTPS id 339021767; Wed, 24 Feb 2016 01:58:42 +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 u1O1wfZ6020750; Wed, 24 Feb 2016 01:58:41 GMT (envelope-from mckusick@FreeBSD.org) Received: (from mckusick@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1O1wfhp020749; Wed, 24 Feb 2016 01:58:41 GMT (envelope-from mckusick@FreeBSD.org) Message-Id: <201602240158.u1O1wfhp020749@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mckusick set sender to mckusick@FreeBSD.org using -f From: Kirk McKusick Date: Wed, 24 Feb 2016 01:58:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295950 - head/sys/ufs/ffs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Feb 2016 01:58:42 -0000 Author: mckusick Date: Wed Feb 24 01:58:40 2016 New Revision: 295950 URL: https://svnweb.freebsd.org/changeset/base/295950 Log: The UFS filesystem requires that the last block of a file always be allocated. When shortening the length of a file in which the new end of the file contains a hole, the hole must have a block allocated. Reported by: Maxim Sobolev Reviewed by: kib Tested by: Peter Holm Modified: head/sys/ufs/ffs/ffs_inode.c Modified: head/sys/ufs/ffs/ffs_inode.c ============================================================================== --- head/sys/ufs/ffs/ffs_inode.c Wed Feb 24 01:32:12 2016 (r295949) +++ head/sys/ufs/ffs/ffs_inode.c Wed Feb 24 01:58:40 2016 (r295950) @@ -184,7 +184,7 @@ ffs_truncate(vp, length, flags, cred) struct inode *ip; ufs2_daddr_t bn, lbn, lastblock, lastiblock[NIADDR], indir_lbn[NIADDR]; ufs2_daddr_t oldblks[NDADDR + NIADDR], newblks[NDADDR + NIADDR]; - ufs2_daddr_t count, blocksreleased = 0, datablocks; + ufs2_daddr_t count, blocksreleased = 0, datablocks, blkno; struct bufobj *bo; struct fs *fs; struct buf *bp; @@ -192,7 +192,7 @@ ffs_truncate(vp, length, flags, cred) int softdeptrunc, journaltrunc; int needextclean, extblocks; int offset, size, level, nblocks; - int i, error, allerror; + int i, error, allerror, indiroff; off_t osize; ip = VTOI(vp); @@ -329,16 +329,57 @@ ffs_truncate(vp, length, flags, cred) ip->i_flag |= IN_CHANGE | IN_UPDATE; return (ffs_update(vp, !DOINGASYNC(vp))); } - if (DOINGSOFTDEP(vp)) { + /* + * Lookup block number for a given offset. Zero length files + * have no blocks, so return a blkno of -1. + */ + lbn = lblkno(fs, length - 1); + if (length == 0) { + blkno = -1; + } else if (lbn < NDADDR) { + blkno = DIP(ip, i_db[lbn]); + } else { + error = UFS_BALLOC(vp, lblktosize(fs, (off_t)lbn), fs->fs_bsize, + cred, BA_METAONLY, &bp); + if (error) + return (error); + indiroff = (lbn - NDADDR) % NINDIR(fs); + if (ip->i_ump->um_fstype == UFS1) + blkno = ((ufs1_daddr_t *)(bp->b_data))[indiroff]; + else + blkno = ((ufs2_daddr_t *)(bp->b_data))[indiroff]; + /* + * If the block number is non-zero, then the indirect block + * must have been previously allocated and need not be written. + * If the block number is zero, then we may have allocated + * the indirect block and hence need to write it out. + */ + if (blkno != 0) + brelse(bp); + else if (DOINGSOFTDEP(vp) || DOINGASYNC(vp)) + bdwrite(bp); + else + bwrite(bp); + } + /* + * If the block number at the new end of the file is zero, + * then we must allocate it to ensure that the last block of + * the file is allocated. Soft updates does not handle this + * case, so here we have to clean up the soft updates data + * structures describing the allocation past the truncation + * point. Finding and deallocating those structures is a lot of + * work. Since partial truncation with a hole at the end occurs + * rarely, we solve the problem by syncing the file so that it + * will have no soft updates data structures left. + */ + if (blkno == 0 && (error = ffs_syncvnode(vp, MNT_WAIT, 0)) != 0) + return (error); + if (blkno != 0 && DOINGSOFTDEP(vp)) { if (softdeptrunc == 0 && journaltrunc == 0) { /* - * If a file is only partially truncated, then - * we have to clean up the data structures - * describing the allocation past the truncation - * point. Finding and deallocating those structures - * is a lot of work. Since partial truncation occurs - * rarely, we solve the problem by syncing the file - * so that it will have no data structures left. + * If soft updates cannot handle this truncation, + * clean up soft dependency data structures and + * fall through to the synchronous truncation. */ if ((error = ffs_syncvnode(vp, MNT_WAIT, 0)) != 0) return (error); @@ -358,15 +399,17 @@ ffs_truncate(vp, length, flags, cred) } } /* - * Shorten the size of the file. If the file is not being - * truncated to a block boundary, the contents of the - * partial block following the end of the file must be - * zero'ed in case it ever becomes accessible again because - * of subsequent file growth. Directories however are not + * Shorten the size of the file. If the last block of the + * shortened file is unallocated, we must allocate it. + * Additionally, if the file is not being truncated to a + * block boundary, the contents of the partial block + * following the end of the file must be zero'ed in + * case it ever becomes accessible again because of + * subsequent file growth. Directories however are not * zero'ed as they should grow back initialized to empty. */ offset = blkoff(fs, length); - if (offset == 0) { + if (blkno != 0 && offset == 0) { ip->i_size = length; DIP_SET(ip, i_size, length); } else { @@ -390,7 +433,7 @@ ffs_truncate(vp, length, flags, cred) ip->i_size = length; DIP_SET(ip, i_size, length); size = blksize(fs, ip, lbn); - if (vp->v_type != VDIR) + if (vp->v_type != VDIR && offset != 0) bzero((char *)bp->b_data + offset, (u_int)(size - offset)); /* Kirk's code has reallocbuf(bp, size, 1) here */ From owner-svn-src-head@freebsd.org Wed Feb 24 02:52:51 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 456C3AB2FC5; Wed, 24 Feb 2016 02:52:51 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 179D41253; Wed, 24 Feb 2016 02:52:51 +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 u1O2qoo0038419; Wed, 24 Feb 2016 02:52:50 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1O2qoXW038417; Wed, 24 Feb 2016 02:52:50 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201602240252.u1O2qoXW038417@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Wed, 24 Feb 2016 02:52:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295952 - head/sys/geom/uzip X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Feb 2016 02:52:51 -0000 Author: adrian Date: Wed Feb 24 02:52:49 2016 New Revision: 295952 URL: https://svnweb.freebsd.org/changeset/base/295952 Log: Fixes to make it compile under gcc-4.2. Modified: head/sys/geom/uzip/g_uzip.c head/sys/geom/uzip/g_uzip.h Modified: head/sys/geom/uzip/g_uzip.c ============================================================================== --- head/sys/geom/uzip/g_uzip.c Wed Feb 24 02:34:11 2016 (r295951) +++ head/sys/geom/uzip/g_uzip.c Wed Feb 24 02:52:49 2016 (r295952) @@ -43,8 +43,6 @@ __FBSDID("$FreeBSD$"); #include -MALLOC_DEFINE(M_GEOM_UZIP, "geom_uzip", "GEOM UZIP data structures"); - #include #include #include @@ -53,6 +51,8 @@ MALLOC_DEFINE(M_GEOM_UZIP, "geom_uzip", #include #include +MALLOC_DEFINE(M_GEOM_UZIP, "geom_uzip", "GEOM UZIP data structures"); + FEATURE(geom_uzip, "GEOM read-only compressed disks support"); struct g_uzip_blk { Modified: head/sys/geom/uzip/g_uzip.h ============================================================================== --- head/sys/geom/uzip/g_uzip.h Wed Feb 24 02:34:11 2016 (r295951) +++ head/sys/geom/uzip/g_uzip.h Wed Feb 24 02:52:49 2016 (r295952) @@ -27,9 +27,11 @@ * * $FreeBSD$ */ +#ifndef __GEOM_G_UZIP_H__ +#define __GEOM_G_UZIP_H__ -#if !defined(M_GEOM_UZIP) MALLOC_DECLARE(M_GEOM_UZIP); -#endif #define DEFINE_RAW_METHOD(func, rval, args...) typedef rval (*func##_t)(args) + +#endif /* __GEOM_G_UZIP_H__ */ From owner-svn-src-head@freebsd.org Wed Feb 24 03:06:27 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CB691AB18B9; Wed, 24 Feb 2016 03:06:27 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9BF3E304; Wed, 24 Feb 2016 03:06:27 +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 u1O36QdH042318; Wed, 24 Feb 2016 03:06:26 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1O36QS8042316; Wed, 24 Feb 2016 03:06:26 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201602240306.u1O36QS8042316@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Wed, 24 Feb 2016 03:06:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295956 - head/sys/mips/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Feb 2016 03:06:27 -0000 Author: adrian Date: Wed Feb 24 03:06:26 2016 New Revision: 295956 URL: https://svnweb.freebsd.org/changeset/base/295956 Log: Migrate UNCOMPRESS -> UZIP Modified: head/sys/mips/conf/DIR-825C1 head/sys/mips/conf/MT7620 Modified: head/sys/mips/conf/DIR-825C1 ============================================================================== --- head/sys/mips/conf/DIR-825C1 Wed Feb 24 03:05:05 2016 (r295955) +++ head/sys/mips/conf/DIR-825C1 Wed Feb 24 03:06:26 2016 (r295956) @@ -48,7 +48,7 @@ options AR71XX_ENV_UBOOT device geom_map # uzip - to boot natively from flash -options GEOM_UNCOMPRESS +options GEOM_UZIP options GEOM_PART_GPT # yes, this board has a PCI connected atheros device Modified: head/sys/mips/conf/MT7620 ============================================================================== --- head/sys/mips/conf/MT7620 Wed Feb 24 03:05:05 2016 (r295955) +++ head/sys/mips/conf/MT7620 Wed Feb 24 03:06:26 2016 (r295956) @@ -93,7 +93,7 @@ options FFS #Berkeley Fast Filesystem options MROUTING # Multicast routing options IPFIREWALL_DEFAULT_TO_ACCEPT -options GEOM_UNCOMPRESS +options GEOM_UZIP options MD_ROOT options ROOTDEVNAME=\"ufs:da0s1\" From owner-svn-src-head@freebsd.org Wed Feb 24 05:01:20 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 24E54AB2DC9; Wed, 24 Feb 2016 05:01:20 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AFCA5102D; Wed, 24 Feb 2016 05:01:19 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1O51IAK074610; Wed, 24 Feb 2016 05:01:18 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1O51IPq074604; Wed, 24 Feb 2016 05:01:18 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201602240501.u1O51IPq074604@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Wed, 24 Feb 2016 05:01:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295958 - in head/sys: conf dev/hyperv/include dev/hyperv/utilities modules/hyperv/utilities X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Feb 2016 05:01:20 -0000 Author: sephe Date: Wed Feb 24 05:01:18 2016 New Revision: 295958 URL: https://svnweb.freebsd.org/changeset/base/295958 Log: hyperv/utils: Code rearrange and cleanup Split heartbeat, shutdown and timesync out of utils code and name them properly. Submitted by: Jun Su Reviewed by: adrian, sephe, Hongjiang Zhang MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D5216 Added: head/sys/dev/hyperv/utilities/hv_heartbeat.c (contents, props changed) head/sys/dev/hyperv/utilities/hv_shutdown.c (contents, props changed) head/sys/dev/hyperv/utilities/hv_timesync.c (contents, props changed) head/sys/dev/hyperv/utilities/hv_util.h (contents, props changed) Modified: head/sys/conf/files.amd64 head/sys/conf/files.i386 head/sys/dev/hyperv/include/hyperv.h head/sys/dev/hyperv/utilities/hv_kvp.c head/sys/dev/hyperv/utilities/hv_kvp.h head/sys/dev/hyperv/utilities/hv_util.c head/sys/modules/hyperv/utilities/Makefile Modified: head/sys/conf/files.amd64 ============================================================================== --- head/sys/conf/files.amd64 Wed Feb 24 03:08:58 2016 (r295957) +++ head/sys/conf/files.amd64 Wed Feb 24 05:01:18 2016 (r295958) @@ -266,7 +266,10 @@ dev/hyperv/netvsc/hv_netvsc_drv_freebsd. dev/hyperv/netvsc/hv_rndis_filter.c optional hyperv dev/hyperv/stordisengage/hv_ata_pci_disengage.c optional hyperv dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c optional hyperv +dev/hyperv/utilities/hv_heartbeat.c optional hyperv dev/hyperv/utilities/hv_kvp.c optional hyperv +dev/hyperv/utilities/hv_shutdown.c optional hyperv +dev/hyperv/utilities/hv_timesync.c optional hyperv dev/hyperv/utilities/hv_util.c optional hyperv dev/hyperv/vmbus/hv_channel.c optional hyperv dev/hyperv/vmbus/hv_channel_mgmt.c optional hyperv Modified: head/sys/conf/files.i386 ============================================================================== --- head/sys/conf/files.i386 Wed Feb 24 03:08:58 2016 (r295957) +++ head/sys/conf/files.i386 Wed Feb 24 05:01:18 2016 (r295958) @@ -240,7 +240,10 @@ dev/hyperv/netvsc/hv_netvsc_drv_freebsd. dev/hyperv/netvsc/hv_rndis_filter.c optional hyperv dev/hyperv/stordisengage/hv_ata_pci_disengage.c optional hyperv dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c optional hyperv +dev/hyperv/utilities/hv_heartbeat.c optional hyperv dev/hyperv/utilities/hv_kvp.c optional hyperv +dev/hyperv/utilities/hv_shutdown.c optional hyperv +dev/hyperv/utilities/hv_timesync.c optional hyperv dev/hyperv/utilities/hv_util.c optional hyperv dev/hyperv/vmbus/hv_channel.c optional hyperv dev/hyperv/vmbus/hv_channel_mgmt.c optional hyperv Modified: head/sys/dev/hyperv/include/hyperv.h ============================================================================== --- head/sys/dev/hyperv/include/hyperv.h Wed Feb 24 03:08:58 2016 (r295957) +++ head/sys/dev/hyperv/include/hyperv.h Wed Feb 24 05:01:18 2016 (r295958) @@ -919,40 +919,5 @@ hv_get_phys_addr(void *virt) return (ret); } - -/** - * KVP related structures - * - */ -typedef struct hv_vmbus_service { - hv_guid guid; /* Hyper-V GUID */ - char *name; /* name of service */ - boolean_t enabled; /* service enabled */ - void* context; - struct task task; - /* - * function to initialize service - */ - int (*init)(struct hv_vmbus_service *); - - /* - * function to process Hyper-V messages - */ - void (*callback)(void *); - - /* - * function to uninitilize service - */ - int (*uninit)(struct hv_vmbus_service *); -} hv_vmbus_service; - -extern uint8_t* receive_buffer[]; -extern hv_vmbus_service service_table[]; extern uint32_t hv_vmbus_protocal_version; - -void hv_kvp_callback(void *context); -int hv_kvp_init(hv_vmbus_service *serv); -void hv_kvp_deinit(void); - #endif /* __HYPERV_H__ */ - Added: head/sys/dev/hyperv/utilities/hv_heartbeat.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/hyperv/utilities/hv_heartbeat.c Wed Feb 24 05:01:18 2016 (r295958) @@ -0,0 +1,129 @@ +/*- + * Copyright (c) 2014 Microsoft Corp. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice unmodified, this list of conditions, and the following + * disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#include +#include +#include +#include +#include +#include +#include + +#include +#include "hv_util.h" + +/* Heartbeat Service */ +static hv_guid service_guid = { .data = + {0x39, 0x4f, 0x16, 0x57, 0x15, 0x91, 0x78, 0x4e, + 0xab, 0x55, 0x38, 0x2f, 0x3b, 0xd5, 0x42, 0x2d} }; + +/** + * Process heartbeat message + */ +static void +hv_heartbeat_cb(void *context) +{ + uint8_t* buf; + hv_vmbus_channel* channel; + uint32_t recvlen; + uint64_t requestid; + int ret; + + struct hv_vmbus_heartbeat_msg_data* heartbeat_msg; + struct hv_vmbus_icmsg_hdr* icmsghdrp; + hv_util_sc *softc; + + softc = (hv_util_sc*)context; + buf = softc->receive_buffer;; + channel = softc->hv_dev->channel; + + ret = hv_vmbus_channel_recv_packet(channel, buf, PAGE_SIZE, &recvlen, + &requestid); + + if ((ret == 0) && recvlen > 0) { + + icmsghdrp = (struct hv_vmbus_icmsg_hdr *) + &buf[sizeof(struct hv_vmbus_pipe_hdr)]; + + if (icmsghdrp->icmsgtype == HV_ICMSGTYPE_NEGOTIATE) { + hv_negotiate_version(icmsghdrp, NULL, buf); + + } else { + heartbeat_msg = + (struct hv_vmbus_heartbeat_msg_data *) + &buf[sizeof(struct hv_vmbus_pipe_hdr) + + sizeof(struct hv_vmbus_icmsg_hdr)]; + + heartbeat_msg->seq_num += 1; + } + + icmsghdrp->icflags = HV_ICMSGHDRFLAG_TRANSACTION | + HV_ICMSGHDRFLAG_RESPONSE; + + hv_vmbus_channel_send_packet(channel, buf, recvlen, requestid, + HV_VMBUS_PACKET_TYPE_DATA_IN_BAND, 0); + } +} + +static int +hv_heartbeat_probe(device_t dev) +{ + const char *p = vmbus_get_type(dev); + if (!memcmp(p, &service_guid, sizeof(hv_guid))) { + device_set_desc(dev, "Hyper-V Heartbeat Service"); + return BUS_PROBE_DEFAULT; + } + + return ENXIO; +} + +static int +hv_heartbeat_attach(device_t dev) +{ + hv_util_sc *softc = (hv_util_sc*)device_get_softc(dev); + + softc->callback = hv_heartbeat_cb; + + return hv_util_attach(dev); +} + +static device_method_t heartbeat_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, hv_heartbeat_probe), + DEVMETHOD(device_attach, hv_heartbeat_attach), + DEVMETHOD(device_detach, hv_util_detach), + { 0, 0 } +}; + +static driver_t heartbeat_driver = { "hvheartbeat", heartbeat_methods, sizeof(hv_util_sc)}; + +static devclass_t heartbeat_devclass; + +DRIVER_MODULE(hv_heartbeat, vmbus, heartbeat_driver, heartbeat_devclass, NULL, NULL); +MODULE_VERSION(hv_heartbeat, 1); +MODULE_DEPEND(hv_heartbeat, vmbus, 1, 1, 1); Modified: head/sys/dev/hyperv/utilities/hv_kvp.c ============================================================================== --- head/sys/dev/hyperv/utilities/hv_kvp.c Wed Feb 24 03:08:58 2016 (r295957) +++ head/sys/dev/hyperv/utilities/hv_kvp.c Wed Feb 24 05:01:18 2016 (r295958) @@ -63,6 +63,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include "hv_util.h" #include "unicode.h" #include "hv_kvp.h" @@ -74,8 +75,6 @@ __FBSDID("$FreeBSD$"); /* hv_kvp debug control */ static int hv_kvp_log = 0; -SYSCTL_INT(_dev, OID_AUTO, hv_kvp_log, CTLFLAG_RW, &hv_kvp_log, 0, - "hv_kvp log"); #define hv_kvp_log_error(...) do { \ if (hv_kvp_log > 0) \ @@ -87,6 +86,10 @@ SYSCTL_INT(_dev, OID_AUTO, hv_kvp_log, C log(LOG_INFO, "hv_kvp: " __VA_ARGS__); \ } while (0) +static hv_guid service_guid = { .data = + {0xe7, 0xf4, 0xa0, 0xa9, 0x45, 0x5a, 0x96, 0x4d, + 0xb8, 0x27, 0x8a, 0x84, 0x1e, 0x8c, 0x3, 0xe6} }; + /* character device prototypes */ static d_open_t hv_kvp_dev_open; static d_close_t hv_kvp_dev_close; @@ -94,12 +97,6 @@ static d_read_t hv_kvp_dev_daemon_read; static d_write_t hv_kvp_dev_daemon_write; static d_poll_t hv_kvp_dev_daemon_poll; -/* hv_kvp prototypes */ -static int hv_kvp_req_in_progress(void); -static void hv_kvp_transaction_init(uint32_t, hv_vmbus_channel *, uint64_t, uint8_t *); -static void hv_kvp_send_msg_to_daemon(void); -static void hv_kvp_process_request(void *context, int pending); - /* hv_kvp character device structure */ static struct cdevsw hv_kvp_cdevsw = { @@ -111,67 +108,67 @@ static struct cdevsw hv_kvp_cdevsw = .d_poll = hv_kvp_dev_daemon_poll, .d_name = "hv_kvp_dev", }; -static struct cdev *hv_kvp_dev; -static struct hv_kvp_msg *hv_kvp_dev_buf; -struct proc *daemon_task; -static struct selinfo hv_kvp_selinfo; /* * Global state to track and synchronize multiple * KVP transaction requests from the host. */ -static struct { +typedef struct hv_kvp_sc { + struct hv_util_sc util_sc; - /* Unless specified the pending mutex should be + /* Unless specified the pending mutex should be * used to alter the values of the following paramters: * 1. req_in_progress * 2. req_timed_out - * 3. pending_reqs. */ - struct mtx pending_mutex; - + struct mtx pending_mutex; + + struct task task; + /* To track if transaction is active or not */ - boolean_t req_in_progress; + boolean_t req_in_progress; /* Tracks if daemon did not reply back in time */ - boolean_t req_timed_out; + boolean_t req_timed_out; /* Tracks if daemon is serving a request currently */ boolean_t daemon_busy; - /* Count of KVP requests from Hyper-V. */ - uint64_t pending_reqs; - - - /* Length of host message */ - uint32_t host_msg_len; - /* Pointer to channel */ - hv_vmbus_channel *channelp; + /* Length of host message */ + uint32_t host_msg_len; /* Host message id */ - uint64_t host_msg_id; - + uint64_t host_msg_id; + /* Current kvp message from the host */ - struct hv_kvp_msg *host_kvp_msg; - + struct hv_kvp_msg *host_kvp_msg; + /* Current kvp message for daemon */ - struct hv_kvp_msg daemon_kvp_msg; - + struct hv_kvp_msg daemon_kvp_msg; + /* Rcv buffer for communicating with the host*/ - uint8_t *rcv_buf; - + uint8_t *rcv_buf; + /* Device semaphore to control communication */ - struct sema dev_sema; - + struct sema dev_sema; + /* Indicates if daemon registered with driver */ - boolean_t register_done; - + boolean_t register_done; + /* Character device status */ - boolean_t dev_accessed; -} kvp_globals; + boolean_t dev_accessed; + + struct cdev *hv_kvp_dev; -/* global vars */ -MALLOC_DECLARE(M_HV_KVP_DEV_BUF); -MALLOC_DEFINE(M_HV_KVP_DEV_BUF, "hv_kvp_dev buffer", "buffer for hv_kvp_dev module"); + struct proc *daemon_task; + + struct selinfo hv_kvp_selinfo; +} hv_kvp_sc; + +/* hv_kvp prototypes */ +static int hv_kvp_req_in_progress(hv_kvp_sc *sc); +static void hv_kvp_transaction_init(hv_kvp_sc *sc, uint32_t, uint64_t, uint8_t *); +static void hv_kvp_send_msg_to_daemon(hv_kvp_sc *sc); +static void hv_kvp_process_request(void *context, int pending); /* * hv_kvp low level functions @@ -181,10 +178,10 @@ MALLOC_DEFINE(M_HV_KVP_DEV_BUF, "hv_kvp_ * Check if kvp transaction is in progres */ static int -hv_kvp_req_in_progress(void) +hv_kvp_req_in_progress(hv_kvp_sc *sc) { - return (kvp_globals.req_in_progress); + return (sc->req_in_progress); } @@ -192,18 +189,17 @@ hv_kvp_req_in_progress(void) * This routine is called whenever a message is received from the host */ static void -hv_kvp_transaction_init(uint32_t rcv_len, hv_vmbus_channel *rcv_channel, +hv_kvp_transaction_init(hv_kvp_sc *sc, uint32_t rcv_len, uint64_t request_id, uint8_t *rcv_buf) { - + /* Store all the relevant message details in the global structure */ /* Do not need to use mutex for req_in_progress here */ - kvp_globals.req_in_progress = true; - kvp_globals.host_msg_len = rcv_len; - kvp_globals.channelp = rcv_channel; - kvp_globals.host_msg_id = request_id; - kvp_globals.rcv_buf = rcv_buf; - kvp_globals.host_kvp_msg = (struct hv_kvp_msg *)&rcv_buf[ + sc->req_in_progress = true; + sc->host_msg_len = rcv_len; + sc->host_msg_id = request_id; + sc->rcv_buf = rcv_buf; + sc->host_kvp_msg = (struct hv_kvp_msg *)&rcv_buf[ sizeof(struct hv_vmbus_pipe_hdr) + sizeof(struct hv_vmbus_icmsg_hdr)]; } @@ -255,12 +251,12 @@ hv_kvp_negotiate_version(struct hv_vmbus * Convert ip related info in umsg from utf8 to utf16 and store in hmsg */ static int -hv_kvp_convert_utf8_ipinfo_to_utf16(struct hv_kvp_msg *umsg, +hv_kvp_convert_utf8_ipinfo_to_utf16(struct hv_kvp_msg *umsg, struct hv_kvp_ip_msg *host_ip_msg) { int err_ip, err_subnet, err_gway, err_dns, err_adap; int UNUSED_FLAG = 1; - + utf8_to_utf16((uint16_t *)host_ip_msg->kvp_ip_val.ip_addr, MAX_IP_ADDR_SIZE, (char *)umsg->body.kvp_ip_val.ip_addr, @@ -291,7 +287,7 @@ hv_kvp_convert_utf8_ipinfo_to_utf16(stru strlen((char *)umsg->body.kvp_ip_val.adapter_id), UNUSED_FLAG, &err_adap); - + host_ip_msg->kvp_ip_val.dhcp_enabled = umsg->body.kvp_ip_val.dhcp_enabled; host_ip_msg->kvp_ip_val.addr_family = umsg->body.kvp_ip_val.addr_family; @@ -386,7 +382,7 @@ hv_kvp_convert_utf16_ipinfo_to_utf8(stru MAX_IP_ADDR_SIZE, UNUSED_FLAG, &err_subnet); - + utf16_to_utf8((char *)umsg->body.kvp_ip_val.gate_way, MAX_GATEWAY_SIZE, (uint16_t *)host_ip_msg->kvp_ip_val.gate_way, MAX_GATEWAY_SIZE, @@ -408,16 +404,13 @@ hv_kvp_convert_utf16_ipinfo_to_utf8(stru * Ensure utf16_utf8 takes care of the additional string terminating char!! */ static void -hv_kvp_convert_hostmsg_to_usermsg(void) +hv_kvp_convert_hostmsg_to_usermsg(struct hv_kvp_msg *hmsg, struct hv_kvp_msg *umsg) { int utf_err = 0; uint32_t value_type; - struct hv_kvp_ip_msg *host_ip_msg = (struct hv_kvp_ip_msg *) - kvp_globals.host_kvp_msg; - - struct hv_kvp_msg *hmsg = kvp_globals.host_kvp_msg; - struct hv_kvp_msg *umsg = &kvp_globals.daemon_kvp_msg; + struct hv_kvp_ip_msg *host_ip_msg; + host_ip_msg = (struct hv_kvp_ip_msg*)hmsg; memset(umsg, 0, sizeof(struct hv_kvp_msg)); umsg->kvp_hdr.operation = hmsg->kvp_hdr.operation; @@ -522,14 +515,12 @@ hv_kvp_convert_hostmsg_to_usermsg(void) * Prepare a host kvp msg based on user kvp msg (utf8 to utf16) */ static int -hv_kvp_convert_usermsg_to_hostmsg(void) +hv_kvp_convert_usermsg_to_hostmsg(struct hv_kvp_msg *umsg, struct hv_kvp_msg *hmsg) { int hkey_len = 0, hvalue_len = 0, utf_err = 0; struct hv_kvp_exchg_msg_value *host_exchg_data; char *key_name, *value; - struct hv_kvp_msg *umsg = &kvp_globals.daemon_kvp_msg; - struct hv_kvp_msg *hmsg = kvp_globals.host_kvp_msg; struct hv_kvp_ip_msg *host_ip_msg = (struct hv_kvp_ip_msg *)hmsg; switch (hmsg->kvp_hdr.operation) { @@ -561,7 +552,7 @@ hv_kvp_convert_usermsg_to_hostmsg(void) if ((hkey_len < 0) || (hvalue_len < 0)) return (HV_KVP_E_FAIL); - + return (KVP_SUCCESS); case HV_KVP_OP_GET: @@ -577,9 +568,9 @@ hv_kvp_convert_usermsg_to_hostmsg(void) /* Use values by string */ host_exchg_data->value_type = HV_REG_SZ; - if ((hkey_len < 0) || (hvalue_len < 0)) + if ((hkey_len < 0) || (hvalue_len < 0)) return (HV_KVP_E_FAIL); - + return (KVP_SUCCESS); default: @@ -592,22 +583,22 @@ hv_kvp_convert_usermsg_to_hostmsg(void) * Send the response back to the host. */ static void -hv_kvp_respond_host(int error) +hv_kvp_respond_host(hv_kvp_sc *sc, int error) { struct hv_vmbus_icmsg_hdr *hv_icmsg_hdrp; hv_icmsg_hdrp = (struct hv_vmbus_icmsg_hdr *) - &kvp_globals.rcv_buf[sizeof(struct hv_vmbus_pipe_hdr)]; + &sc->rcv_buf[sizeof(struct hv_vmbus_pipe_hdr)]; if (error) error = HV_KVP_E_FAIL; hv_icmsg_hdrp->status = error; hv_icmsg_hdrp->icflags = HV_ICMSGHDRFLAG_TRANSACTION | HV_ICMSGHDRFLAG_RESPONSE; - - error = hv_vmbus_channel_send_packet(kvp_globals.channelp, - kvp_globals.rcv_buf, - kvp_globals.host_msg_len, kvp_globals.host_msg_id, + + error = hv_vmbus_channel_send_packet(sc->util_sc.hv_dev->channel, + sc->rcv_buf, + sc->host_msg_len, sc->host_msg_id, HV_VMBUS_PACKET_TYPE_DATA_IN_BAND, 0); if (error) @@ -621,16 +612,19 @@ hv_kvp_respond_host(int error) * and the host */ static void -hv_kvp_send_msg_to_daemon(void) +hv_kvp_send_msg_to_daemon(hv_kvp_sc *sc) { + struct hv_kvp_msg *hmsg = sc->host_kvp_msg; + struct hv_kvp_msg *umsg = &sc->daemon_kvp_msg; + /* Prepare kvp_msg to be sent to user */ - hv_kvp_convert_hostmsg_to_usermsg(); + hv_kvp_convert_hostmsg_to_usermsg(hmsg, umsg); /* Send the msg to user via function deamon_read - setting sema */ - sema_post(&kvp_globals.dev_sema); + sema_post(&sc->dev_sema); /* We should wake up the daemon, in case it's doing poll() */ - selwakeup(&hv_kvp_selinfo); + selwakeup(&sc->hv_kvp_selinfo); } @@ -642,95 +636,80 @@ static void hv_kvp_process_request(void *context, int pending) { uint8_t *kvp_buf; - hv_vmbus_channel *channel = context; + hv_vmbus_channel *channel; uint32_t recvlen = 0; uint64_t requestid; struct hv_vmbus_icmsg_hdr *icmsghdrp; int ret = 0; - uint64_t pending_cnt = 1; - + hv_kvp_sc *sc; + hv_kvp_log_info("%s: entering hv_kvp_process_request\n", __func__); - kvp_buf = receive_buffer[HV_KVP]; + + sc = (hv_kvp_sc*)context; + kvp_buf = sc->util_sc.receive_buffer;; + channel = sc->util_sc.hv_dev->channel; + ret = hv_vmbus_channel_recv_packet(channel, kvp_buf, 2 * PAGE_SIZE, &recvlen, &requestid); - /* - * We start counting only after the daemon registers - * and therefore there could be requests pending in - * the VMBus that are not reflected in pending_cnt. - * Therefore we continue reading as long as either of - * the below conditions is true. - */ + while ((ret == 0) && (recvlen > 0)) { - while ((pending_cnt>0) || ((ret == 0) && (recvlen > 0))) { + icmsghdrp = (struct hv_vmbus_icmsg_hdr *) + &kvp_buf[sizeof(struct hv_vmbus_pipe_hdr)]; - if ((ret == 0) && (recvlen>0)) { - - icmsghdrp = (struct hv_vmbus_icmsg_hdr *) - &kvp_buf[sizeof(struct hv_vmbus_pipe_hdr)]; - - hv_kvp_transaction_init(recvlen, channel, requestid, kvp_buf); - if (icmsghdrp->icmsgtype == HV_ICMSGTYPE_NEGOTIATE) { - hv_kvp_negotiate_version(icmsghdrp, NULL, kvp_buf); - hv_kvp_respond_host(ret); - - /* - * It is ok to not acquire the mutex before setting - * req_in_progress here because negotiation is the - * first thing that happens and hence there is no - * chance of a race condition. - */ - - kvp_globals.req_in_progress = false; - hv_kvp_log_info("%s :version negotiated\n", __func__); - - } else { - if (!kvp_globals.daemon_busy) { - - hv_kvp_log_info("%s: issuing qury to daemon\n", __func__); - mtx_lock(&kvp_globals.pending_mutex); - kvp_globals.req_timed_out = false; - kvp_globals.daemon_busy = true; - mtx_unlock(&kvp_globals.pending_mutex); - - hv_kvp_send_msg_to_daemon(); - hv_kvp_log_info("%s: waiting for daemon\n", __func__); - } - - /* Wait 5 seconds for daemon to respond back */ - tsleep(&kvp_globals, 0, "kvpworkitem", 5 * hz); - hv_kvp_log_info("%s: came out of wait\n", __func__); + hv_kvp_transaction_init(sc, recvlen, requestid, kvp_buf); + if (icmsghdrp->icmsgtype == HV_ICMSGTYPE_NEGOTIATE) { + hv_kvp_negotiate_version(icmsghdrp, NULL, kvp_buf); + hv_kvp_respond_host(sc, ret); + + /* + * It is ok to not acquire the mutex before setting + * req_in_progress here because negotiation is the + * first thing that happens and hence there is no + * chance of a race condition. + */ + + sc->req_in_progress = false; + hv_kvp_log_info("%s :version negotiated\n", __func__); + + } else { + if (!sc->daemon_busy) { + + hv_kvp_log_info("%s: issuing qury to daemon\n", __func__); + mtx_lock(&sc->pending_mutex); + sc->req_timed_out = false; + sc->daemon_busy = true; + mtx_unlock(&sc->pending_mutex); + + hv_kvp_send_msg_to_daemon(sc); + hv_kvp_log_info("%s: waiting for daemon\n", __func__); } + + /* Wait 5 seconds for daemon to respond back */ + tsleep(sc, 0, "kvpworkitem", 5 * hz); + hv_kvp_log_info("%s: came out of wait\n", __func__); } - mtx_lock(&kvp_globals.pending_mutex); - + mtx_lock(&sc->pending_mutex); + /* Notice that once req_timed_out is set to true * it will remain true until the next request is * sent to the daemon. The response from daemon - * is forwarded to host only when this flag is - * false. + * is forwarded to host only when this flag is + * false. */ - kvp_globals.req_timed_out = true; + sc->req_timed_out = true; /* * Cancel request if so need be. */ - if (hv_kvp_req_in_progress()) { + if (hv_kvp_req_in_progress(sc)) { hv_kvp_log_info("%s: request was still active after wait so failing\n", __func__); - hv_kvp_respond_host(HV_KVP_E_FAIL); - kvp_globals.req_in_progress = false; + hv_kvp_respond_host(sc, HV_KVP_E_FAIL); + sc->req_in_progress = false; } - - /* - * Decrement pending request count and - */ - if (kvp_globals.pending_reqs>0) { - kvp_globals.pending_reqs = kvp_globals.pending_reqs - 1; - } - pending_cnt = kvp_globals.pending_reqs; - - mtx_unlock(&kvp_globals.pending_mutex); + + mtx_unlock(&sc->pending_mutex); /* * Try reading next buffer @@ -738,104 +717,43 @@ hv_kvp_process_request(void *context, in recvlen = 0; ret = hv_vmbus_channel_recv_packet(channel, kvp_buf, 2 * PAGE_SIZE, &recvlen, &requestid); - hv_kvp_log_info("%s: read: context %p, pending_cnt %llu ret =%d, recvlen=%d\n", - __func__, context, (unsigned long long)pending_cnt, ret, recvlen); - } + hv_kvp_log_info("%s: read: context %p, ret =%d, recvlen=%d\n", + __func__, context, ret, recvlen); + } } /* * Callback routine that gets called whenever there is a message from host */ -void +static void hv_kvp_callback(void *context) { - uint64_t pending_cnt = 0; - - if (kvp_globals.register_done == false) { - kvp_globals.channelp = context; - TASK_INIT(&service_table[HV_KVP].task, 0, hv_kvp_process_request, context); - } else { - mtx_lock(&kvp_globals.pending_mutex); - kvp_globals.pending_reqs = kvp_globals.pending_reqs + 1; - pending_cnt = kvp_globals.pending_reqs; - mtx_unlock(&kvp_globals.pending_mutex); - if (pending_cnt == 1) { - hv_kvp_log_info("%s: Queuing work item\n", __func__); - taskqueue_enqueue(taskqueue_thread, &service_table[HV_KVP].task); - } - } -} - - -/* - * This function is called by the hv_kvp_init - - * creates character device hv_kvp_dev - * allocates memory to hv_kvp_dev_buf - * - */ -static int -hv_kvp_dev_init(void) -{ - int error = 0; - - /* initialize semaphore */ - sema_init(&kvp_globals.dev_sema, 0, "hv_kvp device semaphore"); - /* create character device */ - error = make_dev_p(MAKEDEV_CHECKNAME | MAKEDEV_WAITOK, - &hv_kvp_dev, - &hv_kvp_cdevsw, - 0, - UID_ROOT, - GID_WHEEL, - 0640, - "hv_kvp_dev"); - - if (error != 0) - return (error); - + hv_kvp_sc *sc = (hv_kvp_sc*)context; /* - * Malloc with M_WAITOK flag will never fail. - */ - hv_kvp_dev_buf = malloc(sizeof(*hv_kvp_dev_buf), M_HV_KVP_DEV_BUF, M_WAITOK | - M_ZERO); - - return (0); -} - - -/* - * This function is called by the hv_kvp_deinit - - * destroy character device - */ -static void -hv_kvp_dev_destroy(void) -{ - - if (daemon_task != NULL) { - PROC_LOCK(daemon_task); - kern_psignal(daemon_task, SIGKILL); - PROC_UNLOCK(daemon_task); + The first request from host will not be handled until daemon is registered. + when callback is triggered without a registered daemon, callback just return. + When a new daemon gets regsitered, this callbcak is trigged from _write op. + */ + if (sc->register_done) { + hv_kvp_log_info("%s: Queuing work item\n", __func__); + taskqueue_enqueue(taskqueue_thread, &sc->task); } - - destroy_dev(hv_kvp_dev); - free(hv_kvp_dev_buf, M_HV_KVP_DEV_BUF); - return; } - static int hv_kvp_dev_open(struct cdev *dev, int oflags, int devtype, struct thread *td) { - + hv_kvp_sc *sc = (hv_kvp_sc*)dev->si_drv1; + hv_kvp_log_info("%s: Opened device \"hv_kvp_device\" successfully.\n", __func__); - if (kvp_globals.dev_accessed) + if (sc->dev_accessed) return (-EBUSY); - - daemon_task = curproc; - kvp_globals.dev_accessed = true; - kvp_globals.daemon_busy = false; + + sc->daemon_task = curproc; + sc->dev_accessed = true; + sc->daemon_busy = false; return (0); } @@ -844,10 +762,11 @@ static int hv_kvp_dev_close(struct cdev *dev __unused, int fflag __unused, int devtype __unused, struct thread *td __unused) { + hv_kvp_sc *sc = (hv_kvp_sc*)dev->si_drv1; hv_kvp_log_info("%s: Closing device \"hv_kvp_device\".\n", __func__); - kvp_globals.dev_accessed = false; - kvp_globals.register_done = false; + sc->dev_accessed = false; + sc->register_done = false; return (0); } @@ -857,18 +776,21 @@ hv_kvp_dev_close(struct cdev *dev __unus * acts as a send to daemon */ static int -hv_kvp_dev_daemon_read(struct cdev *dev __unused, struct uio *uio, int ioflag __unused) +hv_kvp_dev_daemon_read(struct cdev *dev, struct uio *uio, int ioflag __unused) { size_t amt; int error = 0; + struct hv_kvp_msg *hv_kvp_dev_buf; + hv_kvp_sc *sc = (hv_kvp_sc*)dev->si_drv1; /* Check hv_kvp daemon registration status*/ - if (!kvp_globals.register_done) + if (!sc->register_done) return (KVP_ERROR); - sema_wait(&kvp_globals.dev_sema); + sema_wait(&sc->dev_sema); - memcpy(hv_kvp_dev_buf, &kvp_globals.daemon_kvp_msg, sizeof(struct hv_kvp_msg)); + hv_kvp_dev_buf = malloc(sizeof(*hv_kvp_dev_buf), M_TEMP, M_WAITOK); + memcpy(hv_kvp_dev_buf, &sc->daemon_kvp_msg, sizeof(struct hv_kvp_msg)); amt = MIN(uio->uio_resid, uio->uio_offset >= BUFFERSIZE + 1 ? 0 : BUFFERSIZE + 1 - uio->uio_offset); @@ -876,6 +798,7 @@ hv_kvp_dev_daemon_read(struct cdev *dev if ((error = uiomove(hv_kvp_dev_buf, amt, uio)) != 0) hv_kvp_log_info("%s: hv_kvp uiomove read failed!\n", __func__); + free(hv_kvp_dev_buf, M_TEMP); return (error); } @@ -885,29 +808,30 @@ hv_kvp_dev_daemon_read(struct cdev *dev * acts as a recieve from daemon */ static int -hv_kvp_dev_daemon_write(struct cdev *dev __unused, struct uio *uio, int ioflag __unused) +hv_kvp_dev_daemon_write(struct cdev *dev, struct uio *uio, int ioflag __unused) { size_t amt; int error = 0; + struct hv_kvp_msg *hv_kvp_dev_buf; + hv_kvp_sc *sc = (hv_kvp_sc*)dev->si_drv1; uio->uio_offset = 0; + hv_kvp_dev_buf = malloc(sizeof(*hv_kvp_dev_buf), M_TEMP, M_WAITOK); amt = MIN(uio->uio_resid, BUFFERSIZE); error = uiomove(hv_kvp_dev_buf, amt, uio); - if (error != 0) + if (error != 0) { + free(hv_kvp_dev_buf, M_TEMP); return (error); + } + memcpy(&sc->daemon_kvp_msg, hv_kvp_dev_buf, sizeof(struct hv_kvp_msg)); - memcpy(&kvp_globals.daemon_kvp_msg, hv_kvp_dev_buf, sizeof(struct hv_kvp_msg)); - - if (kvp_globals.register_done == false) { - if (kvp_globals.daemon_kvp_msg.kvp_hdr.operation == HV_KVP_OP_REGISTER) { - - kvp_globals.register_done = true; - if (kvp_globals.channelp) { - - hv_kvp_callback(kvp_globals.channelp); - } + free(hv_kvp_dev_buf, M_TEMP); + if (sc->register_done == false) { + if (sc->daemon_kvp_msg.kvp_hdr.operation == HV_KVP_OP_REGISTER) { + sc->register_done = true; + hv_kvp_callback(dev->si_drv1); } else { hv_kvp_log_info("%s, KVP Registration Failed\n", __func__); @@ -915,18 +839,20 @@ hv_kvp_dev_daemon_write(struct cdev *dev } } else { - mtx_lock(&kvp_globals.pending_mutex); + mtx_lock(&sc->pending_mutex); - if(!kvp_globals.req_timed_out) { - - hv_kvp_convert_usermsg_to_hostmsg(); - hv_kvp_respond_host(KVP_SUCCESS); - wakeup(&kvp_globals); - kvp_globals.req_in_progress = false; + if(!sc->req_timed_out) { + struct hv_kvp_msg *hmsg = sc->host_kvp_msg; + struct hv_kvp_msg *umsg = &sc->daemon_kvp_msg; + + hv_kvp_convert_usermsg_to_hostmsg(umsg, hmsg); + hv_kvp_respond_host(sc, KVP_SUCCESS); + wakeup(sc); + sc->req_in_progress = false; } - kvp_globals.daemon_busy = false; - mtx_unlock(&kvp_globals.pending_mutex); + sc->daemon_busy = false; + mtx_unlock(&sc->pending_mutex); } return (error); @@ -938,53 +864,106 @@ hv_kvp_dev_daemon_write(struct cdev *dev * for daemon to read. */ static int -hv_kvp_dev_daemon_poll(struct cdev *dev __unused, int events, struct thread *td) +hv_kvp_dev_daemon_poll(struct cdev *dev, int events, struct thread *td) { int revents = 0; + hv_kvp_sc *sc = (hv_kvp_sc*)dev->si_drv1; - mtx_lock(&kvp_globals.pending_mutex); + mtx_lock(&sc->pending_mutex); /* * We check global flag daemon_busy for the data availiability for * userland to read. Deamon_busy is set to true before driver has data * for daemon to read. It is set to false after daemon sends * then response back to driver. */ - if (kvp_globals.daemon_busy == true) + if (sc->daemon_busy == true) revents = POLLIN; else - selrecord(td, &hv_kvp_selinfo); + selrecord(td, &sc->hv_kvp_selinfo); - mtx_unlock(&kvp_globals.pending_mutex); + mtx_unlock(&sc->pending_mutex); return (revents); } +static int +hv_kvp_probe(device_t dev) +{ + const char *p = vmbus_get_type(dev); + if (!memcmp(p, &service_guid, sizeof(hv_guid))) { + device_set_desc(dev, "Hyper-V KVP Service"); + return BUS_PROBE_DEFAULT; + } -/* - * hv_kvp initialization function - * called from hv_util service. - * - */ -int -hv_kvp_init(hv_vmbus_service *srv) + return ENXIO; +} + +static int +hv_kvp_attach(device_t dev) { - int error = 0; + int error; + struct sysctl_oid_list *child; + struct sysctl_ctx_list *ctx; - memset(&kvp_globals, 0, sizeof(kvp_globals)); + hv_kvp_sc *sc = (hv_kvp_sc*)device_get_softc(dev); - error = hv_kvp_dev_init(); - mtx_init(&kvp_globals.pending_mutex, "hv-kvp pending mutex", + sc->util_sc.callback = hv_kvp_callback; + sema_init(&sc->dev_sema, 0, "hv_kvp device semaphore"); + mtx_init(&sc->pending_mutex, "hv-kvp pending mutex", NULL, MTX_DEF); - return (error); -} + ctx = device_get_sysctl_ctx(dev); + child = SYSCTL_CHILDREN(device_get_sysctl_tree(dev)); + SYSCTL_ADD_INT(ctx, child, OID_AUTO, "hv_kvp_log", + CTLFLAG_RW, &hv_kvp_log, 0, "Hyperv KVP service log level"); -void -hv_kvp_deinit(void) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Wed Feb 24 05:16:26 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 15D94AB226D; Wed, 24 Feb 2016 05:16:26 +0000 (UTC) (envelope-from sobomax@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D0D4215F4; Wed, 24 Feb 2016 05:16:25 +0000 (UTC) (envelope-from sobomax@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1O5GOMb079558; Wed, 24 Feb 2016 05:16:24 GMT (envelope-from sobomax@FreeBSD.org) Received: (from sobomax@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1O5GOhV079556; Wed, 24 Feb 2016 05:16:24 GMT (envelope-from sobomax@FreeBSD.org) Message-Id: <201602240516.u1O5GOhV079556@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sobomax set sender to sobomax@FreeBSD.org using -f From: Maxim Sobolev Date: Wed, 24 Feb 2016 05:16:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295959 - in head: share/man/man4 sys/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Feb 2016 05:16:26 -0000 Author: sobomax Date: Wed Feb 24 05:16:24 2016 New Revision: 295959 URL: https://svnweb.freebsd.org/changeset/base/295959 Log: Kill few remaininng instances of GEOM_UNCOMPRESS. Modified: head/share/man/man4/geom.4 head/sys/conf/NOTES Modified: head/share/man/man4/geom.4 ============================================================================== --- head/share/man/man4/geom.4 Wed Feb 24 05:01:18 2016 (r295958) +++ head/share/man/man4/geom.4 Wed Feb 24 05:16:24 2016 (r295959) @@ -73,7 +73,6 @@ .Cd options GEOM_SHSEC .Cd options GEOM_STRIPE .Cd options GEOM_SUNLABEL -.Cd options GEOM_UNCOMPRESS .Cd options GEOM_UZIP .Cd options GEOM_VIRSTOR .Cd options GEOM_VOL Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Wed Feb 24 05:01:18 2016 (r295958) +++ head/sys/conf/NOTES Wed Feb 24 05:16:24 2016 (r295959) @@ -177,7 +177,6 @@ options GEOM_RAID3 # RAID3 functionali options GEOM_SHSEC # Shared secret. options GEOM_STRIPE # Disk striping. options GEOM_SUNLABEL # Sun/Solaris partitioning -options GEOM_UNCOMPRESS # Read-only compressed disks (lzma, zip) options GEOM_UZIP # Read-only compressed disks options GEOM_VINUM # Vinum logical volume manager options GEOM_VIRSTOR # Virtual storage. From owner-svn-src-head@freebsd.org Wed Feb 24 05:17:53 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A5158AB22ED; Wed, 24 Feb 2016 05:17:53 +0000 (UTC) (envelope-from sobomax@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 76DEE184B; Wed, 24 Feb 2016 05:17:53 +0000 (UTC) (envelope-from sobomax@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1O5HqqY079645; Wed, 24 Feb 2016 05:17:52 GMT (envelope-from sobomax@FreeBSD.org) Received: (from sobomax@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1O5Hqtc079644; Wed, 24 Feb 2016 05:17:52 GMT (envelope-from sobomax@FreeBSD.org) Message-Id: <201602240517.u1O5Hqtc079644@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sobomax set sender to sobomax@FreeBSD.org using -f From: Maxim Sobolev Date: Wed, 24 Feb 2016 05:17:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295960 - head/sys/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Feb 2016 05:17:53 -0000 Author: sobomax Date: Wed Feb 24 05:17:52 2016 New Revision: 295960 URL: https://svnweb.freebsd.org/changeset/base/295960 Log: o kill few remaining references to the GEOM_UNCOMPRESS; o add GEOM_UZIP_DEBUG. Modified: head/sys/conf/options Modified: head/sys/conf/options ============================================================================== --- head/sys/conf/options Wed Feb 24 05:16:24 2016 (r295959) +++ head/sys/conf/options Wed Feb 24 05:17:52 2016 (r295960) @@ -132,9 +132,8 @@ GEOM_RAID3 opt_geom.h GEOM_SHSEC opt_geom.h GEOM_STRIPE opt_geom.h GEOM_SUNLABEL opt_geom.h -GEOM_UNCOMPRESS opt_geom.h -GEOM_UNCOMPRESS_DEBUG opt_geom.h GEOM_UZIP opt_geom.h +GEOM_UZIP_DEBUG opt_geom.h GEOM_VINUM opt_geom.h GEOM_VIRSTOR opt_geom.h GEOM_VOL opt_geom.h From owner-svn-src-head@freebsd.org Wed Feb 24 05:22:01 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C7BD9AB2468 for ; Wed, 24 Feb 2016 05:22:01 +0000 (UTC) (envelope-from sobomax@sippysoft.com) Received: from mail-wm0-x22b.google.com (mail-wm0-x22b.google.com [IPv6:2a00:1450:400c:c09::22b]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 560F11C34 for ; Wed, 24 Feb 2016 05:22:01 +0000 (UTC) (envelope-from sobomax@sippysoft.com) Received: by mail-wm0-x22b.google.com with SMTP id g62so228709082wme.0 for ; Tue, 23 Feb 2016 21:22:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sippysoft-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=X1gns6+s/JbcgVVhRxVVeDRVicGjuXkBIG0mii18L3U=; b=q9noXtn2zKaNhzya11FGN0Yx5qXjBr+k7/XDaTjgFW8Jm8h8iw4iGXQFvyynvvq53k 6vhScBYwxOVIl3qdCyvohLLU7YiUsVNWovDvrzU6Jsj9YVLxyPedsjvjXtE6xPS37O9C xR2/1ia/RGb822+l5kkQznW5YDLPb+WYEEnyTfuIAtoghpoDnoGnRfRnn8v8ShT6EfMc 9aZUnih9ip8NMmQOtWFc3jdKPEGnfQM/YTk6enO+bsaZuEWohc93kmSe8xTiNnp6/+mf yYjUp71C2gB1E7NzqPUDtc/aNbZ6FHueUiwiwBo42tEEObwksV8CKqNE465Jt+btRjLx oD1A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=X1gns6+s/JbcgVVhRxVVeDRVicGjuXkBIG0mii18L3U=; b=fj5iK54ugxOZZnZ/5TaYH9GsfxSXrE8s7Zw0c2pm68G2TrK6r1yCOeWBmBIXGJI1jD lHSuBbSZ22zUdAy5rsKVpUQFtxvtO/a6os3L9IZRhD3dS9glvS4KlqUMu3F2otny+yaz Pq3WB+mjp+XAU9+skyDvA7btbRH0A08a4CKgTjapZP+GocUHEaW/ovMoFhCBsfiVlVFY TXOAD+1FLJRWdURjfOrhsS5/EdClQ/WW78LFzB+Vm86URlR0m/kFp7FC+bKN6q4Thu8A LDVQqs+zLLRjnAQABKoPkCWeSmRHRbBfTfrc+LuE/WloBbAd5pz57EzO8k1UNEVjfhwY lE0w== X-Gm-Message-State: AG10YOS4B4nyVbyiTNtmU9zZ3GwoCDtaWoqj7VYXguJrvIkk3BUdPetZ3795q/ti/faLPRWpjrm58VzwN9sRn1ED MIME-Version: 1.0 X-Received: by 10.28.92.195 with SMTP id q186mr21016847wmb.37.1456291318685; Tue, 23 Feb 2016 21:21:58 -0800 (PST) Received: by 10.27.218.12 with HTTP; Tue, 23 Feb 2016 21:21:58 -0800 (PST) In-Reply-To: <201602240306.u1O36QS8042316@repo.freebsd.org> References: <201602240306.u1O36QS8042316@repo.freebsd.org> Date: Tue, 23 Feb 2016 21:21:58 -0800 Message-ID: Subject: Re: svn: head/sys/mips/conf From: Maxim Sobolev To: Adrian Chadd Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.20 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Feb 2016 05:22:01 -0000 Thanks Adrian, sorry, missed those. I've also noticed that few of the MIPS configs use: device geom_uncompress Few: option GEOM_UNCOMPRESS and majority actually both: device geom_uncompress option GEOM_UNCOMPRESS I think the canonical form is "option GEOM_ZZZ", but at least it should not be both. :) Maybe somebody needs to go over it and clean it up in one sweep. On Tue, Feb 23, 2016 at 7:06 PM, Adrian Chadd wrote: > Author: adrian > Date: Wed Feb 24 03:06:26 2016 > New Revision: 295956 > URL: https://svnweb.freebsd.org/changeset/base/295956 > > Log: > Migrate UNCOMPRESS -> UZIP > > Modified: > head/sys/mips/conf/DIR-825C1 > head/sys/mips/conf/MT7620 > > Modified: head/sys/mips/conf/DIR-825C1 > > ============================================================================== > --- head/sys/mips/conf/DIR-825C1 Wed Feb 24 03:05:05 2016 > (r295955) > +++ head/sys/mips/conf/DIR-825C1 Wed Feb 24 03:06:26 2016 > (r295956) > @@ -48,7 +48,7 @@ options AR71XX_ENV_UBOOT > device geom_map > > # uzip - to boot natively from flash > -options GEOM_UNCOMPRESS > +options GEOM_UZIP > options GEOM_PART_GPT > > # yes, this board has a PCI connected atheros device > > Modified: head/sys/mips/conf/MT7620 > > ============================================================================== > --- head/sys/mips/conf/MT7620 Wed Feb 24 03:05:05 2016 (r295955) > +++ head/sys/mips/conf/MT7620 Wed Feb 24 03:06:26 2016 (r295956) > @@ -93,7 +93,7 @@ options FFS #Berkeley Fast > Filesystem > options MROUTING # Multicast routing > options IPFIREWALL_DEFAULT_TO_ACCEPT > > -options GEOM_UNCOMPRESS > +options GEOM_UZIP > options MD_ROOT > options ROOTDEVNAME=\"ufs:da0s1\" > > > -- Maksym Sobolyev Sippy Software, Inc. Internet Telephony (VoIP) Experts Tel (Canada): +1-778-783-0474 Tel (Toll-Free): +1-855-747-7779 Fax: +1-866-857-6942 Web: http://www.sippysoft.com MSN: sales@sippysoft.com Skype: SippySoft From owner-svn-src-head@freebsd.org Wed Feb 24 05:25:33 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 09275AB27A4; Wed, 24 Feb 2016 05:25:33 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-oi0-x22d.google.com (mail-oi0-x22d.google.com [IPv6:2607:f8b0:4003:c06::22d]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C04CB1E85; Wed, 24 Feb 2016 05:25:32 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: by mail-oi0-x22d.google.com with SMTP id w5so7314300oie.3; Tue, 23 Feb 2016 21:25:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc; bh=90d46eO7zxb9sVG6xc1CcFzfHYDW2E4vlLXslorvn7I=; b=RmFQIkGaptbkyq6rQ0g8uNkugxE6GDxp58CbNnAupKeglj6tRVotd3BOsWOaymPiXw qjUEzjYqXJwpPjp/P60GREQXs3SLNqT0ueRIo2SKRZ/5cseEy87DvBx91bafOaxX6qW6 Z4qeJ09OcDUkHqaYUpcA/BnFCrVrei8NVJ6dRHj9wQOb422UACAF0LVIEoDKjYe4x8Wm h3bH8ocvxD3SRPlOvEqSECGyfA5yW4n8LjNRepl633M4FumW6RFDT/YYQNtg2OhmyS1D ZI407GvHqEDCucYMU/JrSWaeNgJMbvrd2U//3IVY8cQ1GPXwUAwUHA6q1N9RrPtAePF6 Rm0A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:date :message-id:subject:from:to:cc; bh=90d46eO7zxb9sVG6xc1CcFzfHYDW2E4vlLXslorvn7I=; b=IVXLdcxay01xIQA30L1z8WmNvv6LctWoJqWwtFbGkHhc7lvPsN4II5n5eEymcsdSmS KI4M1At/H7wdooQkWo2qJDlLr1I5GZtFhwIAy29ZBuJQXHkmWXExXOSDGObrIYMDggRv K0U8y8NliEQGELjpxnjFIiCKMqXltBmEmdmAZUIWVs161VwxOBFO2qTtmr1f5WqrjWxf u2iJH/JKR3az4pRTpXVEfodvCLH6v31TR80Pnoy74tIgm0c2JuKnB/mJB+RYF1ZGUh+R oZrKRSi5wbEGCwkzj/d1U+P//wRAbZjpDscnAIQC3HrTVAGsh6rqRVElXdbROQTZ1wOb r79A== X-Gm-Message-State: AG10YOQ057Q3KXzdIEcKmZPRaemvhc4EpJYTVBo0Tq1TxxUQ8wNnWvKsvBXzLOO9i8qL0aKGTavtualHqwyjoQ== MIME-Version: 1.0 X-Received: by 10.50.36.105 with SMTP id p9mr19576260igj.22.1456291531984; Tue, 23 Feb 2016 21:25:31 -0800 (PST) Sender: adrian.chadd@gmail.com Received: by 10.36.14.19 with HTTP; Tue, 23 Feb 2016 21:25:31 -0800 (PST) In-Reply-To: References: <201602240306.u1O36QS8042316@repo.freebsd.org> Date: Tue, 23 Feb 2016 21:25:31 -0800 X-Google-Sender-Auth: 6fPSW0Mof9cqU490Ies2D_4UPYk Message-ID: Subject: Re: svn: head/sys/mips/conf From: Adrian Chadd To: Maxim Sobolev Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Feb 2016 05:25:33 -0000 I'll do them soonish. :) -a On 23 February 2016 at 21:21, Maxim Sobolev wrote: > Thanks Adrian, sorry, missed those. I've also noticed that few of the MIPS > configs use: > > device geom_uncompress > > Few: > > option GEOM_UNCOMPRESS > > and majority actually both: > > device geom_uncompress > option GEOM_UNCOMPRESS > > I think the canonical form is "option GEOM_ZZZ", but at least it should not > be both. :) > > Maybe somebody needs to go over it and clean it up in one sweep. > > On Tue, Feb 23, 2016 at 7:06 PM, Adrian Chadd wrote: >> >> Author: adrian >> Date: Wed Feb 24 03:06:26 2016 >> New Revision: 295956 >> URL: https://svnweb.freebsd.org/changeset/base/295956 >> >> Log: >> Migrate UNCOMPRESS -> UZIP >> >> Modified: >> head/sys/mips/conf/DIR-825C1 >> head/sys/mips/conf/MT7620 >> >> Modified: head/sys/mips/conf/DIR-825C1 >> >> ============================================================================== >> --- head/sys/mips/conf/DIR-825C1 Wed Feb 24 03:05:05 2016 >> (r295955) >> +++ head/sys/mips/conf/DIR-825C1 Wed Feb 24 03:06:26 2016 >> (r295956) >> @@ -48,7 +48,7 @@ options AR71XX_ENV_UBOOT >> device geom_map >> >> # uzip - to boot natively from flash >> -options GEOM_UNCOMPRESS >> +options GEOM_UZIP >> options GEOM_PART_GPT >> >> # yes, this board has a PCI connected atheros device >> >> Modified: head/sys/mips/conf/MT7620 >> >> ============================================================================== >> --- head/sys/mips/conf/MT7620 Wed Feb 24 03:05:05 2016 (r295955) >> +++ head/sys/mips/conf/MT7620 Wed Feb 24 03:06:26 2016 (r295956) >> @@ -93,7 +93,7 @@ options FFS #Berkeley Fast >> Filesystem >> options MROUTING # Multicast routing >> options IPFIREWALL_DEFAULT_TO_ACCEPT >> >> -options GEOM_UNCOMPRESS >> +options GEOM_UZIP >> options MD_ROOT >> options ROOTDEVNAME=\"ufs:da0s1\" >> >> > > > > -- > Maksym Sobolyev > Sippy Software, Inc. > Internet Telephony (VoIP) Experts > Tel (Canada): +1-778-783-0474 > Tel (Toll-Free): +1-855-747-7779 > Fax: +1-866-857-6942 > Web: http://www.sippysoft.com > MSN: sales@sippysoft.com > Skype: SippySoft From owner-svn-src-head@freebsd.org Wed Feb 24 06:05:32 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F0255AB099D; Wed, 24 Feb 2016 06:05:32 +0000 (UTC) (envelope-from wma@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BA68A146F; Wed, 24 Feb 2016 06:05:32 +0000 (UTC) (envelope-from wma@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1O65Vfs094095; Wed, 24 Feb 2016 06:05:31 GMT (envelope-from wma@FreeBSD.org) Received: (from wma@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1O65VZm094086; Wed, 24 Feb 2016 06:05:31 GMT (envelope-from wma@FreeBSD.org) Message-Id: <201602240605.u1O65VZm094086@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: wma set sender to wma@FreeBSD.org using -f From: Wojciech Macek Date: Wed, 24 Feb 2016 06:05:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295962 - in head/sys: arm64/cavium conf dev/pci X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Feb 2016 06:05:33 -0000 Author: wma Date: Wed Feb 24 06:05:30 2016 New Revision: 295962 URL: https://svnweb.freebsd.org/changeset/base/295962 Log: Make pci_host_generic and thunderx_pci common * provided OFW interface for pci_host_generic (for handling devices which are present in DTS under the PCI node) * removed support for internal PCI from arm64/cavium * cleaned up and made most of the code common Obtained from: Semihalf Sponsored by: Cavium Approved by: cognet (mentor) Reviewed by: zbb Differential revision: https://reviews.freebsd.org/D5261 Added: head/sys/dev/pci/pci_host_generic.h (contents, props changed) Deleted: head/sys/arm64/cavium/thunder_pcie.c Modified: head/sys/arm64/cavium/thunder_pcie_common.c head/sys/arm64/cavium/thunder_pcie_common.h head/sys/arm64/cavium/thunder_pcie_fdt.c head/sys/arm64/cavium/thunder_pcie_pem.c head/sys/arm64/cavium/thunder_pcie_pem.h head/sys/arm64/cavium/thunder_pcie_pem_fdt.c head/sys/conf/files.arm64 head/sys/dev/pci/pci_host_generic.c Modified: head/sys/arm64/cavium/thunder_pcie_common.c ============================================================================== --- head/sys/arm64/cavium/thunder_pcie_common.c Wed Feb 24 05:40:03 2016 (r295961) +++ head/sys/arm64/cavium/thunder_pcie_common.c Wed Feb 24 06:05:30 2016 (r295962) @@ -32,6 +32,8 @@ #include __FBSDID("$FreeBSD$"); +#include "opt_platform.h" + #include #include #include @@ -43,17 +45,31 @@ __FBSDID("$FreeBSD$"); #include #include +#ifdef FDT +#include +#include +#include +#include +#endif + +#include +#include +#include +#include + #include "thunder_pcie_common.h" MALLOC_DEFINE(M_THUNDER_PCIE, "Thunder PCIe driver", "Thunder PCIe driver memory"); +#define THUNDER_CFG_BASE_TO_ECAM(x) ((((x) >> 36UL) & 0x3) | (((x) >> 42UL) & 0x4)) + uint32_t range_addr_is_pci(struct pcie_range *ranges, uint64_t addr, uint64_t size) { struct pcie_range *r; int tuple; - for (tuple = 0; tuple < RANGES_TUPLES_MAX; tuple++) { + for (tuple = 0; tuple < MAX_RANGES_TUPLES; tuple++) { r = &ranges[tuple]; if (addr >= r->pci_base && addr < (r->pci_base + r->size) && @@ -73,7 +89,7 @@ range_addr_is_phys(struct pcie_range *ra struct pcie_range *r; int tuple; - for (tuple = 0; tuple < RANGES_TUPLES_MAX; tuple++) { + for (tuple = 0; tuple < MAX_RANGES_TUPLES; tuple++) { r = &ranges[tuple]; if (addr >= r->phys_base && addr < (r->phys_base + r->size) && @@ -95,7 +111,7 @@ range_addr_pci_to_phys(struct pcie_range int tuple; /* Find physical address corresponding to given bus address */ - for (tuple = 0; tuple < RANGES_TUPLES_MAX; tuple++) { + for (tuple = 0; tuple < MAX_RANGES_TUPLES; tuple++) { r = &ranges[tuple]; if (pci_addr >= r->pci_base && pci_addr < (r->pci_base + r->size)) { @@ -109,3 +125,20 @@ range_addr_pci_to_phys(struct pcie_range return (0); } +int +thunder_pcie_identify_ecam(device_t dev, int *ecam) +{ + rman_res_t start; + + /* Check if we're running on Cavium ThunderX */ + if (!CPU_MATCH(CPU_IMPL_MASK | CPU_PART_MASK, + CPU_IMPL_CAVIUM, CPU_PART_THUNDER, 0, 0)) + return (EINVAL); + + start = bus_get_resource_start(dev, SYS_RES_MEMORY, 0); + *ecam = THUNDER_CFG_BASE_TO_ECAM(start); + + device_printf(dev, "ThunderX quirk, setting ECAM to %d\n", *ecam); + + return (0); +} Modified: head/sys/arm64/cavium/thunder_pcie_common.h ============================================================================== --- head/sys/arm64/cavium/thunder_pcie_common.h Wed Feb 24 05:40:03 2016 (r295961) +++ head/sys/arm64/cavium/thunder_pcie_common.h Wed Feb 24 06:05:30 2016 (r295962) @@ -29,43 +29,15 @@ #ifndef _CAVIUM_THUNDER_PCIE_COMMON_H_ #define _CAVIUM_THUNDER_PCIE_COMMON_H_ -#define RANGES_TUPLES_MAX 6 -#define RANGES_TUPLES_INVALID (RANGES_TUPLES_MAX + 1) - DECLARE_CLASS(thunder_pcie_driver); DECLARE_CLASS(thunder_pem_driver); MALLOC_DECLARE(M_THUNDER_PCIE); -struct pcie_range { - uint64_t pci_base; - uint64_t phys_base; - uint64_t size; - uint64_t flags; -}; - -struct thunder_pcie_softc { - struct pcie_range ranges[RANGES_TUPLES_MAX]; - struct rman mem_rman; - struct resource *res; - int ecam; - device_t dev; -}; - uint32_t range_addr_is_pci(struct pcie_range *, uint64_t, uint64_t); uint32_t range_addr_is_phys(struct pcie_range *, uint64_t, uint64_t); uint64_t range_addr_pci_to_phys(struct pcie_range *, uint64_t); -int thunder_common_alloc_msi(device_t, device_t, int, int, int *); -int thunder_common_alloc_msix(device_t, device_t, int *); -int thunder_common_map_msi(device_t, device_t, int, uint64_t *, uint32_t *); -int thunder_common_release_msi(device_t, device_t, int, int *); -int thunder_common_release_msix(device_t, device_t, int); - -struct resource *thunder_pcie_alloc_resource(device_t, - device_t, int, int *, rman_res_t, rman_res_t, rman_res_t, u_int); -int thunder_pcie_release_resource(device_t, device_t, int, int, - struct resource *); -int thunder_pcie_attach(device_t); +int thunder_pcie_identify_ecam(device_t, int *); #endif /* _CAVIUM_THUNDER_PCIE_COMMON_H_ */ Modified: head/sys/arm64/cavium/thunder_pcie_fdt.c ============================================================================== --- head/sys/arm64/cavium/thunder_pcie_fdt.c Wed Feb 24 05:40:03 2016 (r295961) +++ head/sys/arm64/cavium/thunder_pcie_fdt.c Wed Feb 24 06:05:30 2016 (r295962) @@ -45,53 +45,24 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include "thunder_pcie_common.h" -#define OFW_CELL_TO_UINT64(cell) \ - (((uint64_t)(*(cell)) << 32) | (uint64_t)(*((cell) + 1))) - -#define SPACE_CODE_SHIFT 24 -#define SPACE_CODE_MASK 0x3 -#define SPACE_CODE_IO_SPACE 0x1 -#define PROPS_CELL_SIZE 1 -#define PCI_ADDR_CELL_SIZE 2 - -static int thunder_pcie_fdt_probe(device_t); static int thunder_pcie_fdt_attach(device_t); - -static struct resource * thunder_pcie_ofw_bus_alloc_res(device_t, device_t, - int, int *, rman_res_t, rman_res_t, rman_res_t, u_int); -static int thunder_pcie_ofw_bus_rel_res(device_t, device_t, int, int, - struct resource *); - -static const struct ofw_bus_devinfo *thunder_pcie_ofw_get_devinfo(device_t, - device_t); +static int thunder_pcie_fdt_probe(device_t); static device_method_t thunder_pcie_fdt_methods[] = { /* Device interface */ DEVMETHOD(device_probe, thunder_pcie_fdt_probe), DEVMETHOD(device_attach, thunder_pcie_fdt_attach), - /* Bus interface */ - DEVMETHOD(bus_alloc_resource, thunder_pcie_ofw_bus_alloc_res), - DEVMETHOD(bus_release_resource, thunder_pcie_ofw_bus_rel_res), - DEVMETHOD(bus_activate_resource, bus_generic_activate_resource), - - /* ofw_bus interface */ - DEVMETHOD(ofw_bus_get_devinfo, thunder_pcie_ofw_get_devinfo), - DEVMETHOD(ofw_bus_get_compat, ofw_bus_gen_get_compat), - DEVMETHOD(ofw_bus_get_model, ofw_bus_gen_get_model), - DEVMETHOD(ofw_bus_get_name, ofw_bus_gen_get_name), - DEVMETHOD(ofw_bus_get_node, ofw_bus_gen_get_node), - DEVMETHOD(ofw_bus_get_type, ofw_bus_gen_get_type), - /* End */ DEVMETHOD_END }; DEFINE_CLASS_1(pcib, thunder_pcie_fdt_driver, thunder_pcie_fdt_methods, - sizeof(struct thunder_pcie_softc), thunder_pcie_driver); + sizeof(struct generic_pcie_softc), generic_pcie_driver); static devclass_t thunder_pcie_fdt_devclass; @@ -100,17 +71,21 @@ DRIVER_MODULE(thunder_pcib, simplebus, t DRIVER_MODULE(thunder_pcib, ofwbus, thunder_pcie_fdt_driver, thunder_pcie_fdt_devclass, 0, 0); -static int thunder_pcie_fdt_ranges(device_t); -static int thunder_pcie_ofw_bus_attach(device_t); static int thunder_pcie_fdt_probe(device_t dev) { + /* Check if we're running on Cavium ThunderX */ + if (!CPU_MATCH(CPU_IMPL_MASK | CPU_PART_MASK, + CPU_IMPL_CAVIUM, CPU_PART_THUNDER, 0, 0)) + return (ENXIO); + if (!ofw_bus_status_okay(dev)) return (ENXIO); - if (ofw_bus_is_compatible(dev, "cavium,thunder-pcie") || + if (ofw_bus_is_compatible(dev, "pci-host-ecam-generic") || + ofw_bus_is_compatible(dev, "cavium,thunder-pcie") || ofw_bus_is_compatible(dev, "cavium,pci-host-thunder-ecam")) { device_set_desc(dev, "Cavium Integrated PCI/PCI-E Controller"); return (BUS_PROBE_DEFAULT); @@ -122,261 +97,11 @@ thunder_pcie_fdt_probe(device_t dev) static int thunder_pcie_fdt_attach(device_t dev) { - int err; - - /* Retrieve 'ranges' property from FDT */ - if (thunder_pcie_fdt_ranges(dev) != 0) - return (ENXIO); - - err = thunder_pcie_ofw_bus_attach(dev); - if (err != 0) - return (err); - - return (thunder_pcie_attach(dev)); -} - -static __inline void -get_addr_size_cells(phandle_t node, pcell_t *addr_cells, pcell_t *size_cells) -{ - - *addr_cells = 2; - /* Find address cells if present */ - OF_getencprop(node, "#address-cells", addr_cells, sizeof(*addr_cells)); - - *size_cells = 2; - /* Find size cells if present */ - OF_getencprop(node, "#size-cells", size_cells, sizeof(*size_cells)); -} - -static int -thunder_pcie_fdt_ranges(device_t dev) -{ - struct thunder_pcie_softc *sc; - phandle_t node; - pcell_t pci_addr_cells, parent_addr_cells, size_cells; - pcell_t attributes; - pcell_t *ranges_buf, *cell_ptr; - int cells_count, tuples_count; - int tuple; - int rv; + struct generic_pcie_softc *sc; sc = device_get_softc(dev); - node = ofw_bus_get_node(dev); - - get_addr_size_cells(node, &pci_addr_cells, &size_cells); - - /* Find parent address cells if present */ - if (OF_getencprop(OF_parent(node), "#address-cells", - &parent_addr_cells, sizeof(parent_addr_cells)) < sizeof(parent_addr_cells)) - parent_addr_cells = 2; - - /* Check if FDT format matches driver requirements */ - if ((parent_addr_cells != 2) || (pci_addr_cells != 3) || - (size_cells != 2)) { - device_printf(dev, - "Unexpected number of address or size cells in FDT " - " %d:%d:%d\n", - parent_addr_cells, pci_addr_cells, size_cells); - return (ENXIO); - } + thunder_pcie_identify_ecam(dev, &sc->ecam); - cells_count = OF_getencprop_alloc(node, "ranges", - sizeof(pcell_t), (void **)&ranges_buf); - if (cells_count == -1) { - device_printf(dev, "Error parsing FDT 'ranges' property\n"); - return (ENXIO); - } - - tuples_count = cells_count / - (pci_addr_cells + parent_addr_cells + size_cells); - if (tuples_count > RANGES_TUPLES_MAX) { - device_printf(dev, - "Unexpected number of 'ranges' tuples in FDT\n"); - rv = ENXIO; - goto out; - } - - cell_ptr = ranges_buf; - - for (tuple = 0; tuple < tuples_count; tuple++) { - /* - * TUPLE FORMAT: - * attributes - 32-bit attributes field - * PCI address - bus address combined of two cells in - * a following format: - * - * PA address - physical address combined of two cells in - * a following format: - * - * size - range size combined of two cells in - * a following format: - * - */ - attributes = *cell_ptr; - attributes = (attributes >> SPACE_CODE_SHIFT) & SPACE_CODE_MASK; - if (attributes == SPACE_CODE_IO_SPACE) { - /* Internal PCIe does not support IO space, ignore. */ - sc->ranges[tuple].phys_base = 0; - sc->ranges[tuple].size = 0; - cell_ptr += - (pci_addr_cells + parent_addr_cells + size_cells); - continue; - } - cell_ptr += PROPS_CELL_SIZE; - sc->ranges[tuple].pci_base = OFW_CELL_TO_UINT64(cell_ptr); - cell_ptr += PCI_ADDR_CELL_SIZE; - sc->ranges[tuple].phys_base = OFW_CELL_TO_UINT64(cell_ptr); - cell_ptr += parent_addr_cells; - sc->ranges[tuple].size = OFW_CELL_TO_UINT64(cell_ptr); - cell_ptr += size_cells; - - if (bootverbose) { - device_printf(dev, - "\tPCI addr: 0x%jx, CPU addr: 0x%jx, Size: 0x%jx\n", - sc->ranges[tuple].pci_base, - sc->ranges[tuple].phys_base, - sc->ranges[tuple].size); - } - - } - for (; tuple < RANGES_TUPLES_MAX; tuple++) { - /* zero-fill remaining tuples to mark empty elements in array */ - sc->ranges[tuple].phys_base = 0; - sc->ranges[tuple].size = 0; - } - - rv = 0; -out: - free(ranges_buf, M_OFWPROP); - return (rv); -} - -/* OFW bus interface */ -struct thunder_pcie_ofw_devinfo { - struct ofw_bus_devinfo di_dinfo; - struct resource_list di_rl; -}; - -static const struct ofw_bus_devinfo * -thunder_pcie_ofw_get_devinfo(device_t bus __unused, device_t child) -{ - struct thunder_pcie_ofw_devinfo *di; - - di = device_get_ivars(child); - return (&di->di_dinfo); -} - -static struct resource * -thunder_pcie_ofw_bus_alloc_res(device_t bus, device_t child, int type, int *rid, - rman_res_t start, rman_res_t end, rman_res_t count, u_int flags) -{ - struct thunder_pcie_softc *sc; - struct thunder_pcie_ofw_devinfo *di; - struct resource_list_entry *rle; - int i; - - /* For PCIe devices that do not have FDT nodes, use PCIB method */ - if ((int)ofw_bus_get_node(child) <= 0) { - return (thunder_pcie_alloc_resource(bus, child, type, rid, - start, end, count, flags)); - } - - sc = device_get_softc(bus); - - if (RMAN_IS_DEFAULT_RANGE(start, end)) { - if ((di = device_get_ivars(child)) == NULL) - return (NULL); - if (type == SYS_RES_IOPORT) - type = SYS_RES_MEMORY; - - /* Find defaults for this rid */ - rle = resource_list_find(&di->di_rl, type, *rid); - if (rle == NULL) - return (NULL); - - start = rle->start; - end = rle->end; - count = rle->count; - } - - if (type == SYS_RES_MEMORY) { - /* Remap through ranges property */ - for (i = 0; i < RANGES_TUPLES_MAX; i++) { - if (start >= sc->ranges[i].phys_base && end < - sc->ranges[i].pci_base + sc->ranges[i].size) { - start -= sc->ranges[i].phys_base; - start += sc->ranges[i].pci_base; - end -= sc->ranges[i].phys_base; - end += sc->ranges[i].pci_base; - break; - } - } - - if (i == RANGES_TUPLES_MAX) { - device_printf(bus, "Could not map resource " - "%#lx-%#lx\n", start, end); - return (NULL); - } - } - - return (bus_generic_alloc_resource(bus, child, type, rid, start, end, - count, flags)); -} - -static int -thunder_pcie_ofw_bus_rel_res(device_t bus, device_t child, int type, int rid, - struct resource *res) -{ - - /* For PCIe devices that do not have FDT nodes, use PCIB method */ - if ((int)ofw_bus_get_node(child) <= 0) { - return (thunder_pcie_release_resource(bus, - child, type, rid, res)); - } - - return (bus_generic_release_resource(bus, child, type, rid, res)); + return (pci_host_generic_attach(dev)); } -/* Helper functions */ - -static int -thunder_pcie_ofw_bus_attach(device_t dev) -{ - struct thunder_pcie_ofw_devinfo *di; - device_t child; - phandle_t parent, node; - pcell_t addr_cells, size_cells; - - parent = ofw_bus_get_node(dev); - if (parent > 0) { - get_addr_size_cells(parent, &addr_cells, &size_cells); - /* Iterate through all bus subordinates */ - for (node = OF_child(parent); node > 0; node = OF_peer(node)) { - /* Allocate and populate devinfo. */ - di = malloc(sizeof(*di), M_THUNDER_PCIE, M_WAITOK | M_ZERO); - if (ofw_bus_gen_setup_devinfo(&di->di_dinfo, node) != 0) { - free(di, M_THUNDER_PCIE); - continue; - } - - /* Initialize and populate resource list. */ - resource_list_init(&di->di_rl); - ofw_bus_reg_to_rl(dev, node, addr_cells, size_cells, - &di->di_rl); - ofw_bus_intr_to_rl(dev, node, &di->di_rl, NULL); - - /* Add newbus device for this FDT node */ - child = device_add_child(dev, NULL, -1); - if (child == NULL) { - resource_list_free(&di->di_rl); - ofw_bus_gen_destroy_devinfo(&di->di_dinfo); - free(di, M_THUNDER_PCIE); - continue; - } - - device_set_ivars(child, di); - } - } - - return (0); -} Modified: head/sys/arm64/cavium/thunder_pcie_pem.c ============================================================================== --- head/sys/arm64/cavium/thunder_pcie_pem.c Wed Feb 24 05:40:03 2016 (r295961) +++ head/sys/arm64/cavium/thunder_pcie_pem.c Wed Feb 24 06:05:30 2016 (r295962) @@ -32,6 +32,8 @@ #include __FBSDID("$FreeBSD$"); +#include "opt_platform.h" + #include #include #include @@ -41,8 +43,16 @@ __FBSDID("$FreeBSD$"); #include #include +#ifdef FDT +#include +#include +#include +#include +#endif + #include #include +#include #include #include Modified: head/sys/arm64/cavium/thunder_pcie_pem.h ============================================================================== --- head/sys/arm64/cavium/thunder_pcie_pem.h Wed Feb 24 05:40:03 2016 (r295961) +++ head/sys/arm64/cavium/thunder_pcie_pem.h Wed Feb 24 06:05:30 2016 (r295962) @@ -39,7 +39,7 @@ struct thunder_pem_softc { struct resource *reg; bus_space_tag_t reg_bst; bus_space_handle_t reg_bsh; - struct pcie_range ranges[RANGES_TUPLES_MAX]; + struct pcie_range ranges[MAX_RANGES_TUPLES]; struct rman mem_rman; struct rman io_rman; bus_space_handle_t pem_sli_base; Modified: head/sys/arm64/cavium/thunder_pcie_pem_fdt.c ============================================================================== --- head/sys/arm64/cavium/thunder_pcie_pem_fdt.c Wed Feb 24 05:40:03 2016 (r295961) +++ head/sys/arm64/cavium/thunder_pcie_pem_fdt.c Wed Feb 24 06:05:30 2016 (r295962) @@ -28,6 +28,8 @@ #include __FBSDID("$FreeBSD$"); +#include "opt_platform.h" + #include #include #include @@ -44,6 +46,11 @@ __FBSDID("$FreeBSD$"); #include #include +#include +#include +#include +#include + #include "thunder_pcie_common.h" #include "thunder_pcie_pem.h" Modified: head/sys/conf/files.arm64 ============================================================================== --- head/sys/conf/files.arm64 Wed Feb 24 05:40:03 2016 (r295961) +++ head/sys/conf/files.arm64 Wed Feb 24 06:05:30 2016 (r295962) @@ -52,7 +52,6 @@ arm64/arm64/uma_machdep.c standard arm64/arm64/unwind.c optional ddb | kdtrace_hooks | stack arm64/arm64/vfp.c standard arm64/arm64/vm_machdep.c standard -arm64/cavium/thunder_pcie.c optional soc_cavm_thunderx pci arm64/cavium/thunder_pcie_fdt.c optional soc_cavm_thunderx pci fdt arm64/cavium/thunder_pcie_pem.c optional soc_cavm_thunderx pci arm64/cavium/thunder_pcie_pem_fdt.c optional soc_cavm_thunderx pci fdt Modified: head/sys/dev/pci/pci_host_generic.c ============================================================================== --- head/sys/dev/pci/pci_host_generic.c Wed Feb 24 05:40:03 2016 (r295961) +++ head/sys/dev/pci/pci_host_generic.c Wed Feb 24 06:05:30 2016 (r295962) @@ -33,6 +33,8 @@ #include __FBSDID("$FreeBSD$"); +#include "opt_platform.h" + #include #include #include @@ -51,6 +53,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -74,9 +77,6 @@ __FBSDID("$FreeBSD$"); (((func) & PCIE_FUNC_MASK) << PCIE_FUNC_SHIFT) | \ ((reg) & PCIE_REG_MASK)) -#define MAX_RANGES_TUPLES 5 -#define MIN_RANGES_TUPLES 2 - #define PCI_IO_WINDOW_OFFSET 0x1000 #define SPACE_CODE_SHIFT 24 @@ -85,34 +85,15 @@ __FBSDID("$FreeBSD$"); #define PROPS_CELL_SIZE 1 #define PCI_ADDR_CELL_SIZE 2 -struct pcie_range { - uint64_t pci_base; - uint64_t phys_base; - uint64_t size; - uint64_t flags; -#define FLAG_IO (1 << 0) -#define FLAG_MEM (1 << 1) -}; - -struct generic_pcie_softc { - struct pcie_range ranges[MAX_RANGES_TUPLES]; - int nranges; - struct rman mem_rman; - struct rman io_rman; - struct resource *res; - struct resource *res1; - int ecam; - bus_space_tag_t bst; - bus_space_handle_t bsh; - device_t dev; - bus_space_handle_t ioh; - struct ofw_bus_iinfo pci_iinfo; +/* OFW bus interface */ +struct generic_pcie_ofw_devinfo { + struct ofw_bus_devinfo di_dinfo; + struct resource_list di_rl; }; /* Forward prototypes */ static int generic_pcie_probe(device_t dev); -static int generic_pcie_attach(device_t dev); static int parse_pci_mem_ranges(struct generic_pcie_softc *sc); static uint32_t generic_pcie_read_config(device_t dev, u_int bus, u_int slot, u_int func, u_int reg, int bytes); @@ -126,8 +107,33 @@ static int generic_pcie_write_ivar(devic static struct resource *generic_pcie_alloc_resource(device_t dev, device_t child, int type, int *rid, rman_res_t start, rman_res_t end, rman_res_t count, u_int flags); +static struct resource *generic_pcie_alloc_resource_ofw(device_t, device_t, + int, int *, rman_res_t, rman_res_t, rman_res_t, u_int); +static struct resource *generic_pcie_alloc_resource_pcie(device_t dev, + device_t child, int type, int *rid, rman_res_t start, rman_res_t end, + rman_res_t count, u_int flags); static int generic_pcie_release_resource(device_t dev, device_t child, int type, int rid, struct resource *res); +static int generic_pcie_release_resource_ofw(device_t, device_t, int, int, + struct resource *); +static int generic_pcie_release_resource_pcie(device_t, device_t, int, int, + struct resource *); +static int generic_pcie_ofw_bus_attach(device_t); +static const struct ofw_bus_devinfo *generic_pcie_ofw_get_devinfo(device_t, + device_t); + +static __inline void +get_addr_size_cells(phandle_t node, pcell_t *addr_cells, pcell_t *size_cells) +{ + + *addr_cells = 2; + /* Find address cells if present */ + OF_getencprop(node, "#address-cells", addr_cells, sizeof(*addr_cells)); + + *size_cells = 2; + /* Find size cells if present */ + OF_getencprop(node, "#size-cells", size_cells, sizeof(*size_cells)); +} static int generic_pcie_probe(device_t dev) @@ -138,14 +144,14 @@ generic_pcie_probe(device_t dev) if (ofw_bus_is_compatible(dev, "pci-host-ecam-generic")) { device_set_desc(dev, "Generic PCI host controller"); - return (BUS_PROBE_DEFAULT); + return (BUS_PROBE_GENERIC); } return (ENXIO); } -static int -generic_pcie_attach(device_t dev) +int +pci_host_generic_attach(device_t dev) { struct generic_pcie_softc *sc; uint64_t phys_base; @@ -158,6 +164,17 @@ generic_pcie_attach(device_t dev) sc = device_get_softc(dev); sc->dev = dev; + /* Retrieve 'ranges' property from FDT */ + if (bootverbose) + device_printf(dev, "parsing FDT for ECAM%d:\n", + sc->ecam); + if (parse_pci_mem_ranges(sc)) + return (ENXIO); + + /* Attach OFW bus */ + if (generic_pcie_ofw_bus_attach(dev) != 0) + return (ENXIO); + rid = 0; sc->res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, RF_ACTIVE); if (sc->res == NULL) { @@ -173,13 +190,6 @@ generic_pcie_attach(device_t dev) sc->io_rman.rm_type = RMAN_ARRAY; sc->io_rman.rm_descr = "PCIe IO window"; - /* Retrieve 'ranges' property from FDT */ - if (bootverbose) - device_printf(dev, "parsing FDT for ECAM%d:\n", - sc->ecam); - if (parse_pci_mem_ranges(sc)) - return (ENXIO); - /* Initialize rman and allocate memory regions */ error = rman_init(&sc->mem_rman); if (error) { @@ -220,7 +230,6 @@ generic_pcie_attach(device_t dev) ofw_bus_setup_iinfo(ofw_bus_get_node(dev), &sc->pci_iinfo, sizeof(cell_t)); - device_add_child(dev, "pci", -1); return (bus_generic_attach(dev)); } @@ -314,7 +323,8 @@ generic_pcie_read_config(device_t dev, u uint64_t offset; uint32_t data; - if (bus > 255 || slot > 31 || func > 7 || reg > 4095) + if ((bus > PCI_BUSMAX) || (slot > PCI_SLOTMAX) || + (func > PCI_FUNCMAX) || (reg > PCIE_REGMAX)) return (~0U); sc = device_get_softc(dev); @@ -349,7 +359,8 @@ generic_pcie_write_config(device_t dev, bus_space_tag_t t; uint64_t offset; - if (bus > 255 || slot > 31 || func > 7 || reg > 4095) + if ((bus > PCI_BUSMAX) || (slot > PCI_SLOTMAX) || + (func > PCI_FUNCMAX) || (reg > PCIE_REGMAX)) return; sc = device_get_softc(dev); @@ -434,7 +445,8 @@ generic_pcie_read_ivar(device_t dev, dev return (0); } - device_printf(dev, "ERROR: Unknown index.\n"); + if (bootverbose) + device_printf(dev, "ERROR: Unknown index %d.\n", index); return (ENOENT); } @@ -463,7 +475,7 @@ generic_pcie_rman(struct generic_pcie_so } static int -generic_pcie_release_resource(device_t dev, device_t child, int type, +generic_pcie_release_resource_pcie(device_t dev, device_t child, int type, int rid, struct resource *res) { struct generic_pcie_softc *sc; @@ -480,10 +492,41 @@ generic_pcie_release_resource(device_t d return (bus_generic_release_resource(dev, child, type, rid, res)); } +static int +generic_pcie_release_resource(device_t dev, device_t child, int type, + int rid, struct resource *res) +{ + + /* For PCIe devices that do not have FDT nodes, use PCIB method */ + if ((int)ofw_bus_get_node(child) <= 0) { + return (generic_pcie_release_resource_pcie(dev, + child, type, rid, res)); + } + + /* For other devices use OFW method */ + return (generic_pcie_release_resource_ofw(dev, + child, type, rid, res)); +} + static struct resource * generic_pcie_alloc_resource(device_t dev, device_t child, int type, int *rid, rman_res_t start, rman_res_t end, rman_res_t count, u_int flags) { + + /* For PCIe devices that do not have FDT nodes, use PCIB method */ + if ((int)ofw_bus_get_node(child) <= 0) + return (generic_pcie_alloc_resource_pcie(dev, child, type, rid, + start, end, count, flags)); + + /* For other devices use OFW method */ + return (generic_pcie_alloc_resource_ofw(dev, child, type, rid, + start, end, count, flags)); +} + +static struct resource * +generic_pcie_alloc_resource_pcie(device_t dev, device_t child, int type, int *rid, + rman_res_t start, rman_res_t end, rman_res_t count, u_int flags) +{ struct generic_pcie_softc *sc; struct resource *res; struct rman *rm; @@ -516,11 +559,9 @@ generic_pcie_alloc_resource(device_t dev return (res); fail: - if (bootverbose) { - device_printf(dev, "%s FAIL: type=%d, rid=%d, " - "start=%016lx, end=%016lx, count=%016lx, flags=%x\n", - __func__, type, *rid, start, end, count, flags); - } + device_printf(dev, "%s FAIL: type=%d, rid=%d, " + "start=%016lx, end=%016lx, count=%016lx, flags=%x\n", + __func__, type, *rid, start, end, count, flags); return (NULL); } @@ -617,7 +658,7 @@ generic_pcie_deactivate_resource(device_ static device_method_t generic_pcie_methods[] = { DEVMETHOD(device_probe, generic_pcie_probe), - DEVMETHOD(device_attach, generic_pcie_attach), + DEVMETHOD(device_attach, pci_host_generic_attach), DEVMETHOD(bus_read_ivar, generic_pcie_read_ivar), DEVMETHOD(bus_write_ivar, generic_pcie_write_ivar), DEVMETHOD(bus_alloc_resource, generic_pcie_alloc_resource), @@ -641,18 +682,137 @@ static device_method_t generic_pcie_meth DEVMETHOD(pcib_map_msi, arm_map_msi), #endif + /* ofw_bus interface */ + DEVMETHOD(ofw_bus_get_devinfo, generic_pcie_ofw_get_devinfo), + DEVMETHOD(ofw_bus_get_compat, ofw_bus_gen_get_compat), + DEVMETHOD(ofw_bus_get_model, ofw_bus_gen_get_model), + DEVMETHOD(ofw_bus_get_name, ofw_bus_gen_get_name), + DEVMETHOD(ofw_bus_get_node, ofw_bus_gen_get_node), + DEVMETHOD(ofw_bus_get_type, ofw_bus_gen_get_type), + DEVMETHOD_END }; -static driver_t generic_pcie_driver = { - "pcib", - generic_pcie_methods, - sizeof(struct generic_pcie_softc), -}; +static const struct ofw_bus_devinfo * +generic_pcie_ofw_get_devinfo(device_t bus __unused, device_t child) +{ + struct generic_pcie_ofw_devinfo *di; + + di = device_get_ivars(child); + return (&di->di_dinfo); +} + +static struct resource * +generic_pcie_alloc_resource_ofw(device_t bus, device_t child, int type, int *rid, + rman_res_t start, rman_res_t end, rman_res_t count, u_int flags) +{ + struct generic_pcie_softc *sc; + struct generic_pcie_ofw_devinfo *di; + struct resource_list_entry *rle; + int i; -static devclass_t generic_pcie_devclass; + sc = device_get_softc(bus); + + if ((start == 0UL) && (end == ~0UL)) { + if ((di = device_get_ivars(child)) == NULL) + return (NULL); + if (type == SYS_RES_IOPORT) + type = SYS_RES_MEMORY; + + /* Find defaults for this rid */ + rle = resource_list_find(&di->di_rl, type, *rid); + if (rle == NULL) + return (NULL); + + start = rle->start; + end = rle->end; + count = rle->count; + } + + if (type == SYS_RES_MEMORY) { + /* Remap through ranges property */ + for (i = 0; i < MAX_RANGES_TUPLES; i++) { + if (start >= sc->ranges[i].phys_base && end < + sc->ranges[i].pci_base + sc->ranges[i].size) { + start -= sc->ranges[i].phys_base; + start += sc->ranges[i].pci_base; + end -= sc->ranges[i].phys_base; + end += sc->ranges[i].pci_base; + break; + } + } + + if (i == MAX_RANGES_TUPLES) { + device_printf(bus, "Could not map resource " + "%#lx-%#lx\n", start, end); + return (NULL); + } + } + + return (bus_generic_alloc_resource(bus, child, type, rid, start, end, + count, flags)); +} + +static int +generic_pcie_release_resource_ofw(device_t bus, device_t child, int type, int rid, + struct resource *res) +{ + + return (bus_generic_release_resource(bus, child, type, rid, res)); +} + +/* Helper functions */ + +static int +generic_pcie_ofw_bus_attach(device_t dev) +{ + struct generic_pcie_ofw_devinfo *di; + device_t child; + phandle_t parent, node; + pcell_t addr_cells, size_cells; + + parent = ofw_bus_get_node(dev); + if (parent > 0) { + get_addr_size_cells(parent, &addr_cells, &size_cells); + /* Iterate through all bus subordinates */ + for (node = OF_child(parent); node > 0; node = OF_peer(node)) { + + /* Allocate and populate devinfo. */ + di = malloc(sizeof(*di), M_DEVBUF, M_WAITOK | M_ZERO); + if (ofw_bus_gen_setup_devinfo(&di->di_dinfo, node) != 0) { + free(di, M_DEVBUF); + continue; + } + + /* Initialize and populate resource list. */ + resource_list_init(&di->di_rl); + ofw_bus_reg_to_rl(dev, node, addr_cells, size_cells, + &di->di_rl); + ofw_bus_intr_to_rl(dev, node, &di->di_rl, NULL); + + /* Add newbus device for this FDT node */ + child = device_add_child(dev, NULL, -1); + if (child == NULL) { + resource_list_free(&di->di_rl); + ofw_bus_gen_destroy_devinfo(&di->di_dinfo); + free(di, M_DEVBUF); + continue; + } + + device_set_ivars(child, di); + } + } + + return (0); +} + +DEFINE_CLASS_0(pcib, generic_pcie_driver, + generic_pcie_methods, sizeof(struct generic_pcie_softc)); + +devclass_t generic_pcie_devclass; DRIVER_MODULE(pcib, simplebus, generic_pcie_driver, -generic_pcie_devclass, 0, 0); + generic_pcie_devclass, 0, 0); DRIVER_MODULE(pcib, ofwbus, generic_pcie_driver, -generic_pcie_devclass, 0, 0); + generic_pcie_devclass, 0, 0); + Added: head/sys/dev/pci/pci_host_generic.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/pci/pci_host_generic.h Wed Feb 24 06:05:30 2016 (r295962) @@ -0,0 +1,71 @@ +/* + * Copyright (c) 2015 Ruslan Bukin + * Copyright (c) 2015 The FreeBSD Foundation + * All rights reserved. + * + * This software was developed by Semihalf. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * + * $FreeBSD$ + * + */ + +#ifndef __PCI_HOST_GENERIC_H_ +#define __PCI_HOST_GENERIC_H_ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Wed Feb 24 08:54:51 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8386BAB2237; Wed, 24 Feb 2016 08:54:51 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4F4B61EEA; Wed, 24 Feb 2016 08:54:51 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1O8somK042821; Wed, 24 Feb 2016 08:54:50 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1O8soQK042820; Wed, 24 Feb 2016 08:54:50 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201602240854.u1O8soQK042820@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Wed, 24 Feb 2016 08:54:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295964 - head/sys/dev/hyperv/vmbus X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Feb 2016 08:54:51 -0000 Author: sephe Date: Wed Feb 24 08:54:50 2016 New Revision: 295964 URL: https://svnweb.freebsd.org/changeset/base/295964 Log: hyperv/vmbus: Use free(9) for interrupt page; it is allocated by malloc(9) MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D5417 Modified: head/sys/dev/hyperv/vmbus/hv_connection.c Modified: head/sys/dev/hyperv/vmbus/hv_connection.c ============================================================================== --- head/sys/dev/hyperv/vmbus/hv_connection.c Wed Feb 24 07:53:57 2016 (r295963) +++ head/sys/dev/hyperv/vmbus/hv_connection.c Wed Feb 24 08:54:50 2016 (r295964) @@ -248,10 +248,7 @@ hv_vmbus_connect(void) { mtx_destroy(&hv_vmbus_g_connection.channel_msg_lock); if (hv_vmbus_g_connection.interrupt_page != NULL) { - contigfree( - hv_vmbus_g_connection.interrupt_page, - PAGE_SIZE, - M_DEVBUF); + free(hv_vmbus_g_connection.interrupt_page, M_DEVBUF); hv_vmbus_g_connection.interrupt_page = NULL; } @@ -279,7 +276,7 @@ hv_vmbus_disconnect(void) { ret = hv_vmbus_post_message(&msg, sizeof(hv_vmbus_channel_unload)); - contigfree(hv_vmbus_g_connection.interrupt_page, PAGE_SIZE, M_DEVBUF); + free(hv_vmbus_g_connection.interrupt_page, M_DEVBUF); mtx_destroy(&hv_vmbus_g_connection.channel_msg_lock); From owner-svn-src-head@freebsd.org Wed Feb 24 10:54:27 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 77F26AB3393; Wed, 24 Feb 2016 10:54:27 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 488DC1752; Wed, 24 Feb 2016 10:54:27 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1OAsQMK077957; Wed, 24 Feb 2016 10:54:26 GMT (envelope-from ed@FreeBSD.org) Received: (from ed@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1OAsQOk077956; Wed, 24 Feb 2016 10:54:26 GMT (envelope-from ed@FreeBSD.org) Message-Id: <201602241054.u1OAsQOk077956@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ed set sender to ed@FreeBSD.org using -f From: Ed Schouten Date: Wed, 24 Feb 2016 10:54:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295965 - head/sys/compat/cloudabi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Feb 2016 10:54:27 -0000 Author: ed Date: Wed Feb 24 10:54:26 2016 New Revision: 295965 URL: https://svnweb.freebsd.org/changeset/base/295965 Log: Call cap_rights_init() properly. Even though or'ing the individual rights works in this specific case, it may not work in general. Pass them in as varargs. Modified: head/sys/compat/cloudabi/cloudabi_sock.c Modified: head/sys/compat/cloudabi/cloudabi_sock.c ============================================================================== --- head/sys/compat/cloudabi/cloudabi_sock.c Wed Feb 24 08:54:50 2016 (r295964) +++ head/sys/compat/cloudabi/cloudabi_sock.c Wed Feb 24 10:54:26 2016 (r295965) @@ -208,7 +208,7 @@ cloudabi_sys_sock_stat_get(struct thread int error; error = getsock_cap(td, uap->fd, cap_rights_init(&rights, - CAP_GETSOCKOPT | CAP_GETPEERNAME | CAP_GETSOCKNAME), &fp, NULL); + CAP_GETSOCKOPT, CAP_GETPEERNAME, CAP_GETSOCKNAME), &fp, NULL); if (error != 0) return (error); so = fp->f_data; From owner-svn-src-head@freebsd.org Wed Feb 24 11:58:16 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8A42EAB29BD; Wed, 24 Feb 2016 11:58:16 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5BDD8189D; Wed, 24 Feb 2016 11:58:16 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1OBwFXF096059; Wed, 24 Feb 2016 11:58:15 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1OBwFNq096058; Wed, 24 Feb 2016 11:58:15 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201602241158.u1OBwFNq096058@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 24 Feb 2016 11:58:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295966 - head/sys/amd64/amd64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Feb 2016 11:58:16 -0000 Author: kib Date: Wed Feb 24 11:58:15 2016 New Revision: 295966 URL: https://svnweb.freebsd.org/changeset/base/295966 Log: Return dst as the result from memcpy(9) on amd64. PR: 207422 MFC after: 1 week Modified: head/sys/amd64/amd64/support.S Modified: head/sys/amd64/amd64/support.S ============================================================================== --- head/sys/amd64/amd64/support.S Wed Feb 24 10:54:26 2016 (r295965) +++ head/sys/amd64/amd64/support.S Wed Feb 24 11:58:15 2016 (r295966) @@ -151,6 +151,7 @@ END(bcopy) */ ENTRY(memcpy) PUSH_FRAME_POINTER + movq %rdi,%rax movq %rdx,%rcx shrq $3,%rcx /* copy by 64-bit words */ cld /* copy forwards */ From owner-svn-src-head@freebsd.org Wed Feb 24 12:28:50 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 689B5AB25AD; Wed, 24 Feb 2016 12:28:50 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3B504136F; Wed, 24 Feb 2016 12:28:50 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1OCSnKT004879; Wed, 24 Feb 2016 12:28:49 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1OCSnce004878; Wed, 24 Feb 2016 12:28:49 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201602241228.u1OCSnce004878@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Wed, 24 Feb 2016 12:28:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295967 - head/sys/netipsec X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Feb 2016 12:28:50 -0000 Author: ae Date: Wed Feb 24 12:28:49 2016 New Revision: 295967 URL: https://svnweb.freebsd.org/changeset/base/295967 Log: Fix useless check. m_pkthdr.len should be equal to orglen. MFC after: 2 weeks Modified: head/sys/netipsec/key.c Modified: head/sys/netipsec/key.c ============================================================================== --- head/sys/netipsec/key.c Wed Feb 24 11:58:15 2016 (r295966) +++ head/sys/netipsec/key.c Wed Feb 24 12:28:49 2016 (r295967) @@ -7204,8 +7204,7 @@ key_parse(struct mbuf *m, struct socket orglen = PFKEY_UNUNIT64(msg->sadb_msg_len); target = KEY_SENDUP_ONE; - if ((m->m_flags & M_PKTHDR) == 0 || - m->m_pkthdr.len != m->m_pkthdr.len) { + if ((m->m_flags & M_PKTHDR) == 0 || m->m_pkthdr.len != orglen) { ipseclog((LOG_DEBUG, "%s: invalid message length.\n",__func__)); PFKEYSTAT_INC(out_invlen); error = EINVAL; From owner-svn-src-head@freebsd.org Wed Feb 24 12:31:43 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C3646AB2799; Wed, 24 Feb 2016 12:31:43 +0000 (UTC) (envelope-from oshogbo.vx@gmail.com) Received: from mail-wm0-x22b.google.com (mail-wm0-x22b.google.com [IPv6:2a00:1450:400c:c09::22b]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5B11E1828; Wed, 24 Feb 2016 12:31:43 +0000 (UTC) (envelope-from oshogbo.vx@gmail.com) Received: by mail-wm0-x22b.google.com with SMTP id g62so27658572wme.0; Wed, 24 Feb 2016 04:31:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=EFqZHCAZmBy+pr1AV/vLEAy4vuwHCagbR70LnDcqqkU=; b=vu9feRcZ09DpakpRLYHV3mmCBDaR+OlcHSUrTknK2t0SwIas/jfC26kmu68bwHZbPt YFQ4DHc7Af3DvHPaxRU+S+lgQCmcxUPxP4AD1Dpgw3ZGDd8A2/ILuuvQZXjL5rcn8hDf 1rTDOHI7HB96Ti3YIpgrGKuvRb86AgnsRfVr/bz8nDQmjKhVGroSSoOOdiqigFwO9uvj X34+d4Lj0eqrFEocRoKKk1m4U+CMvtiHkaBFFYXRDxj3A8784QF/DPTkSQBR33CHDDwb WI0eZYyTbcm/iJpvxNIt0Gm7VUvRRMUG4XxMzsY51Ux0QKzM7SIGpoD6kNDdJd4K7tdq KVrw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=EFqZHCAZmBy+pr1AV/vLEAy4vuwHCagbR70LnDcqqkU=; b=eccbIpL/fQfaWqytR4Y4P9GmXuW1LPGUKJsfx8/Y/85OxknDz0DpR9eLJlmJrIAa4C lO8q0CQRVQI8FJrnRwSlRYw9v9EvfwcqJPdojDxy/PRREfsJPlSACLDkMiXW0j/sLXt7 hr7bNJH+sLi89Q8KH9N7DB5Sxy3S61b3amJu1sFHvzEuSRL83c6bc1wS48BSwhUbjeFr e8vmwSRWbBz1hcw95N6Mvd+YF/jfkWouSzF8i1pheQzT+N1waF6qI+B3Rq4HIbzlAX2l ipaxLnel+y4zw/OUo1iD4TKZnAiYEE/JGxQ0PNEwaEpebYp7rXgkZvy7j0dGFRZWE7fv jb+w== X-Gm-Message-State: AG10YOQPTCq037ohqhELRoBtH2oSEICYd95Bt8FSkeaQ4XMs8V5fTFTCfVuCzWHmYNhTJPuDStFADxoVLtvh2w== MIME-Version: 1.0 X-Received: by 10.194.174.73 with SMTP id bq9mr38710505wjc.145.1456317100856; Wed, 24 Feb 2016 04:31:40 -0800 (PST) Sender: oshogbo.vx@gmail.com Received: by 10.194.34.106 with HTTP; Wed, 24 Feb 2016 04:31:40 -0800 (PST) In-Reply-To: <56CCED5A.3020307@FreeBSD.org> References: <201602232202.u1NM2Pv2051850@repo.freebsd.org> <56CCED5A.3020307@FreeBSD.org> Date: Wed, 24 Feb 2016 13:31:40 +0100 X-Google-Sender-Auth: UV3QJTh6s7PNXarpKtgisBuOby8 Message-ID: Subject: Re: svn commit: r295934 - head/sys/kern From: Mariusz Zaborski To: Bryan Drewery Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.20 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Feb 2016 12:31:44 -0000 Thank you! On 24 February 2016 at 00:38, Bryan Drewery wrote: > On 2/23/2016 2:02 PM, Mariusz Zaborski wrote: > > Author: oshogbo > > Date: Tue Feb 23 22:02:25 2016 > > New Revision: 295934 > > URL: https://svnweb.freebsd.org/changeset/base/295934 > > > > Log: > > According to the sys/kern/capabilities.conf, gethostid(3) should be > allowed. > > > > Pointed out by: Milosz Kaniewski > > Approved by: pjd (mentor) > > MFC after: 3 days > > Sponsored by: Wheel Systems, http://wheelsystems.com > > > > Modified: > > head/sys/kern/kern_mib.c > > > > Modified: head/sys/kern/kern_mib.c > > > ============================================================================== > > --- head/sys/kern/kern_mib.c Tue Feb 23 21:21:47 2016 (r295933) > > +++ head/sys/kern/kern_mib.c Tue Feb 23 22:02:25 2016 (r295934) > > @@ -422,7 +422,7 @@ sysctl_hostid(SYSCTL_HANDLER_ARGS) > > } > > > > SYSCTL_PROC(_kern, KERN_HOSTID, hostid, > > - CTLTYPE_ULONG | CTLFLAG_RW | CTLFLAG_PRISON | CTLFLAG_MPSAFE, > > + CTLTYPE_ULONG | CTLFLAG_RW | CTLFLAG_PRISON | CTLFLAG_MPSAFE | > CTFLAG_CAPRD, > > It is spelled wrong. Fixed in r295941, be sure to MFC that too. > > > NULL, 0, sysctl_hostid, "LU", "Host ID"); > > > > /* > > > > > > -- > Regards, > Bryan Drewery > > From owner-svn-src-head@freebsd.org Wed Feb 24 13:16:04 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DA784AB39D8; Wed, 24 Feb 2016 13:16:04 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id ACCC6107F; Wed, 24 Feb 2016 13:16:04 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1ODG3Yl019171; Wed, 24 Feb 2016 13:16:03 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1ODG3oT019169; Wed, 24 Feb 2016 13:16:03 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201602241316.u1ODG3oT019169@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Wed, 24 Feb 2016 13:16:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295969 - in head: sbin/ipfw sys/netpfil/ipfw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Feb 2016 13:16:05 -0000 Author: ae Date: Wed Feb 24 13:16:03 2016 New Revision: 295969 URL: https://svnweb.freebsd.org/changeset/base/295969 Log: Fix bug in filling and handling ipfw's O_DSCP opcode. Due to integer overflow CS4 token was handled as BE. PR: 207459 MFC after: 1 week Modified: head/sbin/ipfw/ipfw2.c head/sys/netpfil/ipfw/ip_fw2.c Modified: head/sbin/ipfw/ipfw2.c ============================================================================== --- head/sbin/ipfw/ipfw2.c Wed Feb 24 12:37:35 2016 (r295968) +++ head/sbin/ipfw/ipfw2.c Wed Feb 24 13:16:03 2016 (r295969) @@ -1029,7 +1029,7 @@ fill_dscp(ipfw_insn *cmd, char *av, int errx(EX_DATAERR, "Invalid DSCP value"); } - if (code > 32) + if (code >= 32) *high |= 1 << (code - 32); else *low |= 1 << code; Modified: head/sys/netpfil/ipfw/ip_fw2.c ============================================================================== --- head/sys/netpfil/ipfw/ip_fw2.c Wed Feb 24 12:37:35 2016 (r295968) +++ head/sys/netpfil/ipfw/ip_fw2.c Wed Feb 24 13:16:03 2016 (r295969) @@ -1711,7 +1711,7 @@ do { \ break; /* DSCP bitmask is stored as low_u32 high_u32 */ - if (x > 32) + if (x >= 32) match = *(p + 1) & (1 << (x - 32)); else match = *p & (1 << x); From owner-svn-src-head@freebsd.org Wed Feb 24 15:15:48 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1EC93AB1961; Wed, 24 Feb 2016 15:15:48 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EF2231245; Wed, 24 Feb 2016 15:15:47 +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 u1OFFlQ9053717; Wed, 24 Feb 2016 15:15:47 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1OFFk4q053714; Wed, 24 Feb 2016 15:15:46 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201602241515.u1OFFk4q053714@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 24 Feb 2016 15:15:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295971 - in head/sys: kern sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Feb 2016 15:15:48 -0000 Author: kib Date: Wed Feb 24 15:15:46 2016 New Revision: 295971 URL: https://svnweb.freebsd.org/changeset/base/295971 Log: Provide more correct sizing of the KVA consumed by a vnode, used by the virtvnodes calculation. Include the size of fs-specific v_data as the nfs nclnode inline, the NFS nclnode is bigger than either ZFS znode or UFS inode. Include the size of namecache_ts and short cache path element, multiplied by the name cache population factor, again inline. Inline defines are used to avoid pollution of the vnode.h with the subsystem-private objects. Non-significant unsynchronized changes of the definitions are fine, we do not care about that precision, and e.g. ZFS consumes much malloced memory per vnode for reasons unaccounted in the formula. Lower the partition of kmem dedicated to vnodes, from 1/7 to 1/10. The measures reduce vnode cache pressure on kmem and bring the vnode cache memory use below some apparent thresholds that were exceeded by r291244 due to more robust vnode reuse. Reported and tested by: marius (i386, previous version) Reviewed by: bde Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Modified: head/sys/kern/vfs_cache.c head/sys/kern/vfs_subr.c head/sys/sys/vnode.h Modified: head/sys/kern/vfs_cache.c ============================================================================== --- head/sys/kern/vfs_cache.c Wed Feb 24 13:48:40 2016 (r295970) +++ head/sys/kern/vfs_cache.c Wed Feb 24 15:15:46 2016 (r295971) @@ -171,7 +171,7 @@ SYSCTL_ULONG(_debug, OID_AUTO, numcache, static u_long 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"); -static u_int ncsizefactor = 2; +u_int ncsizefactor = 2; SYSCTL_UINT(_vfs, OID_AUTO, ncsizefactor, CTLFLAG_RW, &ncsizefactor, 0, "Size factor for namecache"); Modified: head/sys/kern/vfs_subr.c ============================================================================== --- head/sys/kern/vfs_subr.c Wed Feb 24 13:48:40 2016 (r295970) +++ head/sys/kern/vfs_subr.c Wed Feb 24 15:15:46 2016 (r295971) @@ -407,6 +407,27 @@ vnode_fini(void *mem, int size) rw_destroy(BO_LOCKPTR(bo)); } +/* + * Provide the size of NFS nclnode and NFS fh for calculation of the + * vnode memory consumption. The size is specified directly to + * eliminate dependency on NFS-private header. + * + * Other filesystems may use bigger or smaller (like UFS and ZFS) + * private inode data, but the NFS-based estimation is ample enough. + * Still, we care about differences in the size between 64- and 32-bit + * platforms. + * + * Namecache structure size is heuristically + * sizeof(struct namecache_ts) + CACHE_PATH_CUTOFF + 1. + */ +#ifdef _LP64 +#define NFS_NCLNODE_SZ (528 + 64) +#define NC_SZ 148 +#else +#define NFS_NCLNODE_SZ (360 + 32) +#define NC_SZ 92 +#endif + static void vntblinit(void *dummy __unused) { @@ -422,12 +443,12 @@ vntblinit(void *dummy __unused) * marginal ratio of desiredvnodes to the physical memory size is * 1:64. However, desiredvnodes is limited by the kernel's heap * size. The memory required by desiredvnodes vnodes and vm objects - * must not exceed 1/7th of the kernel's heap size. + * must not exceed 1/10th of the kernel's heap size. */ physvnodes = maxproc + pgtok(vm_cnt.v_page_count) / 64 + 3 * min(98304 * 16, pgtok(vm_cnt.v_page_count)) / 64; - virtvnodes = vm_kmem_size / (7 * (sizeof(struct vm_object) + - sizeof(struct vnode))); + virtvnodes = vm_kmem_size / (10 * (sizeof(struct vm_object) + + sizeof(struct vnode) + NC_SZ * ncsizefactor + NFS_NCLNODE_SZ)); desiredvnodes = min(physvnodes, virtvnodes); if (desiredvnodes > MAXVNODES_MAX) { if (bootverbose) Modified: head/sys/sys/vnode.h ============================================================================== --- head/sys/sys/vnode.h Wed Feb 24 13:48:40 2016 (r295970) +++ head/sys/sys/vnode.h Wed Feb 24 15:15:46 2016 (r295971) @@ -372,6 +372,8 @@ struct vattr { MALLOC_DECLARE(M_VNODE); #endif +extern u_int ncsizefactor; + /* * Convert between vnode types and inode formats (since POSIX.1 * defines mode word of stat structure in terms of inode formats). From owner-svn-src-head@freebsd.org Wed Feb 24 16:50:37 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2B2A8AB3D41; Wed, 24 Feb 2016 16:50:37 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CEC241EC3; Wed, 24 Feb 2016 16:50:36 +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 u1OGoZuA080209; Wed, 24 Feb 2016 16:50:35 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1OGoYh2080192; Wed, 24 Feb 2016 16:50:34 GMT (envelope-from br@FreeBSD.org) Message-Id: <201602241650.u1OGoYh2080192@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Wed, 24 Feb 2016 16:50:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295972 - in head/sys: boot/fdt/dts/riscv conf riscv/conf riscv/htif riscv/include riscv/riscv X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Feb 2016 16:50:37 -0000 Author: br Date: Wed Feb 24 16:50:34 2016 New Revision: 295972 URL: https://svnweb.freebsd.org/changeset/base/295972 Log: Add support for symmetric multiprocessing (SMP). Tested on Spike simulator with 2 and 16 cores (tlb enabled), so set MAXCPU to 16 at this time. This uses FDT data to get information about CPUs (code based on arm64 mp_machdep). Invalidate entire TLB cache as it is the only way yet. Sponsored by: DARPA, AFRL Sponsored by: HEIF5 Added: head/sys/riscv/riscv/mp_machdep.c (contents, props changed) Modified: head/sys/boot/fdt/dts/riscv/spike.dts head/sys/conf/files.riscv head/sys/riscv/conf/GENERIC head/sys/riscv/htif/htif.c head/sys/riscv/htif/htif_block.c head/sys/riscv/htif/htif_console.c head/sys/riscv/include/intr.h head/sys/riscv/include/param.h head/sys/riscv/include/pcpu.h head/sys/riscv/include/riscvreg.h head/sys/riscv/include/smp.h head/sys/riscv/riscv/cpufunc_asm.S head/sys/riscv/riscv/exception.S head/sys/riscv/riscv/genassym.c head/sys/riscv/riscv/intr_machdep.c head/sys/riscv/riscv/locore.S head/sys/riscv/riscv/machdep.c head/sys/riscv/riscv/pmap.c head/sys/riscv/riscv/swtch.S Modified: head/sys/boot/fdt/dts/riscv/spike.dts ============================================================================== --- head/sys/boot/fdt/dts/riscv/spike.dts Wed Feb 24 15:15:46 2016 (r295971) +++ head/sys/boot/fdt/dts/riscv/spike.dts Wed Feb 24 16:50:34 2016 (r295972) @@ -43,6 +43,23 @@ #size-cells = <1>; #interrupt-cells = <1>; + cpus { + #address-cells = <1>; + #size-cells = <0>; + + cpu@0 { + device_type = "cpu"; + compatible = "riscv,rv64i"; + reg = <0x40002000>; + }; + + cpu@1 { + device_type = "cpu"; + compatible = "riscv,rv64i"; + reg = <0x4000a000>; + }; + }; + aliases { console0 = &console0; }; Modified: head/sys/conf/files.riscv ============================================================================== --- head/sys/conf/files.riscv Wed Feb 24 15:15:46 2016 (r295971) +++ head/sys/conf/files.riscv Wed Feb 24 16:50:34 2016 (r295972) @@ -1,6 +1,7 @@ # $FreeBSD$ crypto/blowfish/bf_enc.c optional crypto | ipsec crypto/des/des_enc.c optional crypto | ipsec | netsmb +dev/ofw/ofw_cpu.c optional fdt kern/kern_clocksource.c standard kern/subr_dummy_vdso_tc.c standard libkern/bcmp.c standard @@ -29,8 +30,9 @@ riscv/riscv/intr_machdep.c standard riscv/riscv/in_cksum.c optional inet | inet6 riscv/riscv/identcpu.c standard riscv/riscv/locore.S standard no-obj -riscv/riscv/minidump_machdep.c standard riscv/riscv/machdep.c standard +riscv/riscv/minidump_machdep.c standard +riscv/riscv/mp_machdep.c optional smp riscv/riscv/mem.c standard riscv/riscv/nexus.c standard riscv/riscv/pmap.c standard Modified: head/sys/riscv/conf/GENERIC ============================================================================== --- head/sys/riscv/conf/GENERIC Wed Feb 24 15:15:46 2016 (r295971) +++ head/sys/riscv/conf/GENERIC Wed Feb 24 16:50:34 2016 (r295972) @@ -70,7 +70,13 @@ options MAC # TrustedBSD MAC Framewor options RACCT # Resource accounting framework options RACCT_DEFAULT_TO_DISABLED # Set kern.racct.enable=0 by default options RCTL # Resource limits -# options SMP +options SMP + +# Uncomment for memory disk +# options MD_ROOT +# options MD_ROOT_SIZE=8192 # 8MB ram disk +# makeoptions MFS_IMAGE=/path/to/img +# options ROOTDEVNAME=\"ufs:/dev/md0\" # Debugging support. Always need this: # options KDB # Enable kernel debugger support. Modified: head/sys/riscv/htif/htif.c ============================================================================== --- head/sys/riscv/htif/htif.c Wed Feb 24 15:15:46 2016 (r295971) +++ head/sys/riscv/htif/htif.c Wed Feb 24 16:50:34 2016 (r295972) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2015 Ruslan Bukin + * Copyright (c) 2015-2016 Ruslan Bukin * All rights reserved. * * Portions of this software were developed by SRI International and the @@ -62,7 +62,7 @@ __FBSDID("$FreeBSD$"); #include "htif.h" static struct resource_spec htif_spec[] = { - { SYS_RES_IRQ, 0, RF_ACTIVE }, + { SYS_RES_IRQ, 0, RF_ACTIVE | RF_SHAREABLE}, { -1, 0 } }; @@ -126,9 +126,9 @@ htif_intr(void *arg) sc = arg; - htif_handle_entry(sc); + csr_clear(sip, SIP_SSIP); - csr_clear(sip, SIE_SSIE); + htif_handle_entry(sc); return (FILTER_HANDLED); } Modified: head/sys/riscv/htif/htif_block.c ============================================================================== --- head/sys/riscv/htif/htif_block.c Wed Feb 24 15:15:46 2016 (r295971) +++ head/sys/riscv/htif/htif_block.c Wed Feb 24 16:50:34 2016 (r295972) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2015 Ruslan Bukin + * Copyright (c) 2015-2016 Ruslan Bukin * All rights reserved. * * Portions of this software were developed by SRI International and the @@ -117,6 +117,9 @@ htif_blk_intr(void *arg, uint64_t entry) if (sc->curtag == data) { sc->cmd_done = 1; wakeup(&sc->intr_chan); + } else { + device_printf(sc->dev, "Unexpected tag %d (should be %d)\n", + data, sc->curtag); } } @@ -212,6 +215,8 @@ htif_blk_task(void *arg) HTIF_BLK_UNLOCK(sc); if (bp->bio_cmd == BIO_READ || bp->bio_cmd == BIO_WRITE) { + HTIF_BLK_LOCK(sc); + req.offset = (bp->bio_pblkno * sc->disk->d_sectorsize); req.size = bp->bio_bcount; paddr = vtophys(bp->bio_data); @@ -233,7 +238,6 @@ htif_blk_task(void *arg) htif_command(cmd); /* Wait for interrupt */ - HTIF_BLK_LOCK(sc); i = 0; while (sc->cmd_done == 0) { msleep(&sc->intr_chan, &sc->sc_mtx, PRIBIO, "intr", hz/2); Modified: head/sys/riscv/htif/htif_console.c ============================================================================== --- head/sys/riscv/htif/htif_console.c Wed Feb 24 15:15:46 2016 (r295971) +++ head/sys/riscv/htif/htif_console.c Wed Feb 24 16:50:34 2016 (r295972) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2015 Ruslan Bukin + * Copyright (c) 2015-2016 Ruslan Bukin * All rights reserved. * * Portions of this software were developed by SRI International and the @@ -89,6 +89,7 @@ CONSOLE_DRIVER(riscv); #define MAX_BURST_LEN 1 #define QUEUE_SIZE 256 #define CONSOLE_DEFAULT_ID 1ul +#define SPIN_IN_MACHINE_MODE 1 struct queue_entry { uint64_t data; @@ -109,7 +110,12 @@ htif_putc(int c) cmd |= (CONSOLE_DEFAULT_ID << HTIF_DEV_ID_SHIFT); cmd |= c; +#ifdef SPIN_IN_MACHINE_MODE + machine_command(ECALL_HTIF_LOWPUTC, cmd); +#else htif_command(cmd); +#endif + } static uint8_t @@ -141,6 +147,7 @@ riscv_putc(int c) htif_putc(c); +#ifndef SPIN_IN_MACHINE_MODE /* Wait for an interrupt */ __asm __volatile( "li %0, 1\n" /* counter = 1 */ @@ -153,6 +160,7 @@ riscv_putc(int c) "2:" : "=&r"(counter), "=&r"(val) : "r"(cc) ); +#endif } #ifdef EARLY_PRINTF Modified: head/sys/riscv/include/intr.h ============================================================================== --- head/sys/riscv/include/intr.h Wed Feb 24 15:15:46 2016 (r295971) +++ head/sys/riscv/include/intr.h Wed Feb 24 16:50:34 2016 (r295972) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2015 Ruslan Bukin + * Copyright (c) 2015-2016 Ruslan Bukin * All rights reserved. * * Portions of this software were developed by SRI International and the @@ -51,4 +51,16 @@ typedef unsigned long * riscv_intrcnt_t; riscv_intrcnt_t riscv_intrcnt_create(const char *); void riscv_intrcnt_setname(riscv_intrcnt_t, const char *); +#ifdef SMP +void riscv_setup_ipihandler(driver_filter_t *); +void riscv_unmask_ipi(void); +#endif + +enum { + IRQ_SOFTWARE, + IRQ_TIMER, + IRQ_HTIF, + NIRQS +}; + #endif /* !_MACHINE_INTR_MACHDEP_H_ */ Modified: head/sys/riscv/include/param.h ============================================================================== --- head/sys/riscv/include/param.h Wed Feb 24 15:15:46 2016 (r295971) +++ head/sys/riscv/include/param.h Wed Feb 24 16:50:34 2016 (r295972) @@ -51,7 +51,7 @@ #if defined(SMP) || defined(KLD_MODULE) #ifndef MAXCPU -#define MAXCPU 2 +#define MAXCPU 16 #endif #else #define MAXCPU 1 Modified: head/sys/riscv/include/pcpu.h ============================================================================== --- head/sys/riscv/include/pcpu.h Wed Feb 24 15:15:46 2016 (r295971) +++ head/sys/riscv/include/pcpu.h Wed Feb 24 16:50:34 2016 (r295972) @@ -1,7 +1,16 @@ /*- * Copyright (c) 1999 Luoqi Chen + * Copyright (c) 2015-2016 Ruslan Bukin * All rights reserved. * + * Portions of this software were developed by SRI International and the + * University of Cambridge Computer Laboratory under DARPA/AFRL contract + * FA8750-10-C-0237 ("CTSRD"), as part of the DARPA CRASH research programme. + * + * Portions of this software were developed by the University of Cambridge + * Computer Laboratory as part of the CTSRD Project, with support from the + * UK Higher Education Innovation Fund (HEIF). + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -36,7 +45,10 @@ #define ALT_STACK_SIZE 128 #define PCPU_MD_FIELDS \ - char __pad[129] + uint32_t pc_pending_ipis; /* IPIs pending to this CPU */ \ + uint64_t pc_sptbr; /* L0 page table base (VA) */ \ + uint64_t pc_reg; /* CPU MMIO base (PA) */ \ + char __pad[109] #ifdef _KERNEL Modified: head/sys/riscv/include/riscvreg.h ============================================================================== --- head/sys/riscv/include/riscvreg.h Wed Feb 24 15:15:46 2016 (r295971) +++ head/sys/riscv/include/riscvreg.h Wed Feb 24 16:50:34 2016 (r295972) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2015 Ruslan Bukin + * Copyright (c) 2015-2016 Ruslan Bukin * All rights reserved. * * Portions of this software were developed by SRI International and the @@ -38,12 +38,16 @@ #define _MACHINE_RISCVREG_H_ /* Machine mode requests */ -#define ECALL_MTIMECMP 0x1 -#define ECALL_CLEAR_PENDING 0x2 -#define ECALL_HTIF_CMD 0x3 -#define ECALL_HTIF_GET_ENTRY 0x4 -#define ECALL_MCPUID_GET 0x5 -#define ECALL_MIMPID_GET 0x6 +#define ECALL_MTIMECMP 0x01 +#define ECALL_CLEAR_PENDING 0x02 +#define ECALL_HTIF_CMD 0x03 +#define ECALL_HTIF_GET_ENTRY 0x04 +#define ECALL_MCPUID_GET 0x05 +#define ECALL_MIMPID_GET 0x06 +#define ECALL_SEND_IPI 0x07 +#define ECALL_CLEAR_IPI 0x08 +#define ECALL_HTIF_LOWPUTC 0x09 +#define ECALL_MIE_SET 0x10 #define EXCP_SHIFT 0 #define EXCP_MASK (0xf << EXCP_SHIFT) @@ -109,9 +113,14 @@ #define SIE_SSIE (1 << 1) #define SIE_STIE (1 << 5) -/* Note: sip register is not yet implement in Spike simulator */ +/* Note: sip register has no SIP_STIP bit in Spike simulator */ +#define SIP_SSIP (1 << 1) #define SIP_STIP (1 << 5) +#define NCSRS 4096 +#define CSR_IPI 0x783 +#define XLEN 8 + #define CSR_ZIMM(val) \ (__builtin_constant_p(val) && ((u_long)(val) < 32)) Modified: head/sys/riscv/include/smp.h ============================================================================== --- head/sys/riscv/include/smp.h Wed Feb 24 15:15:46 2016 (r295971) +++ head/sys/riscv/include/smp.h Wed Feb 24 16:50:34 2016 (r295972) @@ -1 +1,55 @@ -/* $FreeBSD$ */ +/*- + * Copyright (c) 2016 Ruslan Bukin + * All rights reserved. + * + * Portions of this software were developed by SRI International and the + * University of Cambridge Computer Laboratory under DARPA/AFRL contract + * FA8750-10-C-0237 ("CTSRD"), as part of the DARPA CRASH research programme. + * + * Portions of this software were developed by the University of Cambridge + * Computer Laboratory as part of the CTSRD Project, with support from the + * UK Higher Education Innovation Fund (HEIF). + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _MACHINE_SMP_H_ +#define _MACHINE_SMP_H_ + +#include + +#define IPI_AST (1 << 0) +#define IPI_PREEMPT (1 << 1) +#define IPI_RENDEZVOUS (1 << 2) +#define IPI_STOP (1 << 3) +#define IPI_STOP_HARD (1 << 4) +#define IPI_HARDCLOCK (1 << 5) + +void ipi_all_but_self(u_int ipi); +void ipi_cpu(int cpu, u_int ipi); +void ipi_selected(cpuset_t cpus, u_int ipi); + +extern struct pcb stoppcbs[]; + +#endif /* !_MACHINE_SMP_H_ */ Modified: head/sys/riscv/riscv/cpufunc_asm.S ============================================================================== --- head/sys/riscv/riscv/cpufunc_asm.S Wed Feb 24 15:15:46 2016 (r295971) +++ head/sys/riscv/riscv/cpufunc_asm.S Wed Feb 24 16:50:34 2016 (r295972) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2015 Ruslan Bukin + * Copyright (c) 2015-2016 Ruslan Bukin * All rights reserved. * * Portions of this software were developed by SRI International and the @@ -64,7 +64,7 @@ END(riscv_tlb_flushID_SE) * void riscv_dcache_wb_range(vm_offset_t, vm_size_t) */ ENTRY(riscv_dcache_wb_range) - /* RISCVTODO */ + sfence.vm ret END(riscv_dcache_wb_range) @@ -72,7 +72,7 @@ END(riscv_dcache_wb_range) * void riscv_dcache_wbinv_range(vm_offset_t, vm_size_t) */ ENTRY(riscv_dcache_wbinv_range) - /* RISCVTODO */ + sfence.vm ret END(riscv_dcache_wbinv_range) @@ -80,7 +80,7 @@ END(riscv_dcache_wbinv_range) * void riscv_dcache_inv_range(vm_offset_t, vm_size_t) */ ENTRY(riscv_dcache_inv_range) - /* RISCVTODO */ + sfence.vm ret END(riscv_dcache_inv_range) @@ -88,7 +88,8 @@ END(riscv_dcache_inv_range) * void riscv_idcache_wbinv_range(vm_offset_t, vm_size_t) */ ENTRY(riscv_idcache_wbinv_range) - /* RISCVTODO */ + fence.i + sfence.vm ret END(riscv_idcache_wbinv_range) @@ -96,6 +97,6 @@ END(riscv_idcache_wbinv_range) * void riscv_icache_sync_range(vm_offset_t, vm_size_t) */ ENTRY(riscv_icache_sync_range) - /* RISCVTODO */ + fence.i ret END(riscv_icache_sync_range) Modified: head/sys/riscv/riscv/exception.S ============================================================================== --- head/sys/riscv/riscv/exception.S Wed Feb 24 15:15:46 2016 (r295971) +++ head/sys/riscv/riscv/exception.S Wed Feb 24 16:50:34 2016 (r295972) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2015 Ruslan Bukin + * Copyright (c) 2015-2016 Ruslan Bukin * All rights reserved. * * Portions of this software were developed by SRI International and the @@ -229,6 +229,7 @@ bad_trap: j bad_trap user_trap: + /* Save state */ csrrw sp, mscratch, sp addi sp, sp, -64 sd t0, (8 * 0)(sp) @@ -282,7 +283,31 @@ machine_interrupt: j 1b software_interrupt: - /* Redirect to supervisor */ + li t0, MIP_MSIP + csrc mip, t0 + li t0, MIP_SSIP + csrs mip, t0 + + /* If PRV1 is PRV_U (user) then serve the trap */ + csrr t0, mstatus + li t1, (MSTATUS_PRV_M << MSTATUS_PRV1_SHIFT) + and t0, t0, t1 + beqz t0, 1f + + /* + * If PRV1 is supervisor and interrupts were enabled, + * then serve the trap. + */ + csrr t0, mstatus + li t1, (SR_IE1 | (MSTATUS_PRV_M << MSTATUS_PRV1_SHIFT)) + and t0, t0, t1 + li t1, (SR_IE1 | (MSTATUS_PRV_S << MSTATUS_PRV1_SHIFT)) + beq t0, t1, 1f + + j exit + +1: + /* Serve a trap in supervisor mode */ j exit_mrts timer_interrupt: @@ -294,17 +319,20 @@ timer_interrupt: li t0, MIP_MTIP csrc mip, t0 - /* Post supervisor software interrupt */ + /* Post supervisor timer interrupt */ li t0, MIP_STIP csrs mip, t0 - /* If PRV1 is PRV_U (user) then serve a trap */ + /* If PRV1 is PRV_U (user) then serve the trap */ csrr t0, mstatus li t1, (MSTATUS_PRV_M << MSTATUS_PRV1_SHIFT) and t0, t0, t1 beqz t0, 1f - /* If PRV1 is supervisor and interrupts were enabled, then serve a trap */ + /* + * If PRV1 is supervisor and interrupts were enabled, + * then serve the trap. + */ csrr t0, mstatus li t1, (SR_IE1 | (MSTATUS_PRV_M << MSTATUS_PRV1_SHIFT)) and t0, t0, t1 @@ -332,25 +360,35 @@ htif_interrupt: la t0, console_intr li t1, 1 sd t1, 0(t0) - j 3f + + /* Check if there is any other pending event */ + j 1b 2: /* Save entry */ - la t0, htif_ring_cursor - beqz t0, 3f /* not initialized */ - ld t0, 0(t0) /* load struct */ - sd t5, 0(t0) /* put entry */ + la t0, htif_ring + csrr t1, mhartid + li t4, (HTIF_RING_SIZE + 16) + mulw t4, t4, t1 + add t0, t0, t4 + li t4, (HTIF_RING_SIZE) + add t0, t0, t4 /* t0 == htif_ring_cursor */ + + ld t1, 0(t0) /* load ptr to cursor */ + sd t5, 0(t1) /* put entry */ li t4, 1 - sd t4, 8(t0) /* mark used */ - ld t4, 16(t0) /* take next */ + sd t4, 8(t1) /* mark used */ + ld t4, 16(t1) /* take next */ /* Update cursor */ - la t0, htif_ring_cursor sd t4, 0(t0) /* Post supervisor software interrupt */ li t0, MIP_SSIP csrs mip, t0 + /* Check if there is any other pending event */ + j 1b + 3: j exit @@ -369,6 +407,18 @@ supervisor_call: beq t5, t4, mcpuid_get li t4, ECALL_MIMPID_GET beq t5, t4, mimpid_get + li t4, ECALL_SEND_IPI + beq t5, t4, send_ipi + li t4, ECALL_CLEAR_IPI + beq t5, t4, clear_ipi + li t4, ECALL_HTIF_LOWPUTC + beq t5, t4, htif_lowputc + li t4, ECALL_MIE_SET + beq t5, t4, mie_set + j exit_next_instr + +mie_set: + csrs mie, t6 j exit_next_instr mcpuid_get: @@ -379,28 +429,111 @@ mimpid_get: csrr t6, mimpid j exit_next_instr +send_ipi: + /* CPU mmio base in t6 */ + mv t0, t6 + li t2, (CSR_IPI * XLEN) + add t0, t0, t2 /* t0 = CSR_IPI */ + li t2, 1 + sd t2, 0(t0) + j exit_next_instr + +clear_ipi: + /* Do only clear if there are no new entries in HTIF ring */ + la t0, htif_ring + csrr t2, mhartid + li t4, (HTIF_RING_SIZE + 16) + mulw t4, t4, t2 + add t0, t0, t4 + li t4, (HTIF_RING_SIZE) + add t0, t0, t4 /* t0 == ptr to htif_ring_cursor */ + ld t2, 8(t0) /* load htif_ring_last */ + ld t2, 8(t2) /* load used */ + bnez t2, 1f + + /* Clear supervisor software interrupt pending bit */ + li t0, MIP_SSIP + csrc mip, t0 + +1: + j exit_next_instr + htif_get_entry: + /* Get a htif_ring for current core */ + la t0, htif_ring + csrr t2, mhartid + li t4, (HTIF_RING_SIZE + 16) + mulw t4, t4, t2 + add t0, t0, t4 + li t4, (HTIF_RING_SIZE + 8) + add t0, t0, t4 /* t0 == htif_ring_last */ + + /* Check for new entries */ li t6, 0 /* preset return value */ - la t0, htif_ring_last - ld t0, 0(t0) /* load struct */ - ld t4, 8(t0) /* get used */ - beqz t4, 1f - ld t6, 0(t0) /* get entry */ + ld t2, 0(t0) /* load ptr to last */ + ld t4, 8(t2) /* get used */ + beqz t4, 1f /* No new entries. Exit */ + + /* Get one */ + ld t6, 0(t2) /* get entry */ li t4, 0 - sd t4, 8(t0) /* mark free */ - sd t4, 0(t0) /* free entry, just in case */ - ld t4, 16(t0) /* take next */ - la t0, htif_ring_last - sd t4, 0(t0) + sd t4, 8(t2) /* mark free */ + sd t4, 0(t2) /* free entry, just in case */ + ld t4, 16(t2) /* take next */ + sd t4, 0(t0) /* update ptr to last */ 1: /* Exit. Result is stored in t6 */ j exit_next_instr htif_cmd: +1: mv t0, t6 + csrrw t0, mtohost, t0 + bnez t0, 1b + j exit_next_instr + +htif_lowputc: 1: + mv t0, t6 csrrw t0, mtohost, t0 bnez t0, 1b + +2: + li t4, 0 + csrrw t5, mfromhost, t4 + beqz t5, 2b + + /* Console PUT intr ? */ + mv t2, t5 + srli t2, t2, 48 + li t3, 0x0101 + beq t2, t3, 3f + + /* Not a console PUT, so save entry */ + la t0, htif_ring + csrr t2, mhartid + li t4, (HTIF_RING_SIZE + 16) + mulw t4, t4, t2 + add t0, t0, t4 + li t4, (HTIF_RING_SIZE) + add t0, t0, t4 /* t0 == htif_ring_cursor */ + + ld t2, 0(t0) /* load ptr to cursor */ + sd t5, 0(t2) /* put entry */ + li t4, 1 + sd t4, 8(t2) /* mark used */ + ld t4, 16(t2) /* take next */ + /* Update cursor */ + sd t4, 0(t0) + + /* Post supervisor software interrupt */ + li t0, MIP_SSIP + csrs mip, t0 + + /* Wait for console intr again */ + j 2b + +3: j exit_next_instr set_mtimecmp: Modified: head/sys/riscv/riscv/genassym.c ============================================================================== --- head/sys/riscv/riscv/genassym.c Wed Feb 24 15:15:46 2016 (r295971) +++ head/sys/riscv/riscv/genassym.c Wed Feb 24 16:50:34 2016 (r295972) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2015 Ruslan Bukin + * Copyright (c) 2015-2016 Ruslan Bukin * All rights reserved. * * Portions of this software were developed by SRI International and the @@ -75,6 +75,7 @@ ASSYM(PCB_A, offsetof(struct pcb, pcb_a) ASSYM(SF_UC, offsetof(struct sigframe, sf_uc)); ASSYM(PC_CURPCB, offsetof(struct pcpu, pc_curpcb)); +ASSYM(PC_SPTBR, offsetof(struct pcpu, pc_sptbr)); ASSYM(PC_CURTHREAD, offsetof(struct pcpu, pc_curthread)); ASSYM(TD_PCB, offsetof(struct thread, td_pcb)); Modified: head/sys/riscv/riscv/intr_machdep.c ============================================================================== --- head/sys/riscv/riscv/intr_machdep.c Wed Feb 24 15:15:46 2016 (r295971) +++ head/sys/riscv/riscv/intr_machdep.c Wed Feb 24 16:50:34 2016 (r295972) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2015 Ruslan Bukin + * Copyright (c) 2015-2016 Ruslan Bukin * All rights reserved. * * Portions of this software were developed by SRI International and the @@ -38,7 +38,9 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include +#include #include #include @@ -46,12 +48,9 @@ __FBSDID("$FreeBSD$"); #include #include -enum { - IRQ_SOFTWARE, - IRQ_TIMER, - IRQ_HTIF, - NIRQS -}; +#ifdef SMP +#include +#endif u_long intrcnt[NIRQS]; size_t sintrcnt = sizeof(intrcnt); @@ -159,8 +158,12 @@ riscv_setup_intr(const char *name, drive riscv_unmask_irq((void*)(uintptr_t)irq); } - intr_event_add_handler(event, name, filt, handler, arg, + error = intr_event_add_handler(event, name, filt, handler, arg, intr_priority(flags), flags, cookiep); + if (error) { + printf("Failed to setup intr: %d\n", irq); + return (error); + } riscv_intrcnt_setname(riscv_intr_counters[irq], event->ie_fullname); @@ -221,3 +224,74 @@ riscv_cpu_intr(struct trapframe *frame) critical_exit(); } + +#ifdef SMP +void +riscv_setup_ipihandler(driver_filter_t *filt) +{ + + riscv_setup_intr("ipi", filt, NULL, NULL, IRQ_SOFTWARE, + INTR_TYPE_MISC, NULL); +} + +void +riscv_unmask_ipi(void) +{ + + csr_set(sie, SIE_SSIE); +} + +/* Sending IPI */ +static void +ipi_send(struct pcpu *pc, int ipi) +{ + + CTR3(KTR_SMP, "%s: cpu=%d, ipi=%x", __func__, pc->pc_cpuid, ipi); + + atomic_set_32(&pc->pc_pending_ipis, ipi); + machine_command(ECALL_SEND_IPI, pc->pc_reg); + + CTR1(KTR_SMP, "%s: sent", __func__); +} + +void +ipi_all_but_self(u_int ipi) +{ + cpuset_t other_cpus; + + other_cpus = all_cpus; + CPU_CLR(PCPU_GET(cpuid), &other_cpus); + + CTR2(KTR_SMP, "%s: ipi: %x", __func__, ipi); + ipi_selected(other_cpus, ipi); +} + +void +ipi_cpu(int cpu, u_int ipi) +{ + cpuset_t cpus; + + CPU_ZERO(&cpus); + CPU_SET(cpu, &cpus); + + CTR3(KTR_SMP, "%s: cpu: %d, ipi: %x\n", __func__, cpu, ipi); + ipi_send(cpuid_to_pcpu[cpu], ipi); +} + +void +ipi_selected(cpuset_t cpus, u_int ipi) +{ + struct pcpu *pc; + + CTR1(KTR_SMP, "ipi_selected: ipi: %x", ipi); + + STAILQ_FOREACH(pc, &cpuhead, pc_allcpu) { + if (CPU_ISSET(pc->pc_cpuid, &cpus)) { + CTR3(KTR_SMP, "%s: pc: %p, ipi: %x\n", __func__, pc, + ipi); + ipi_send(pc, ipi); + } + } +} + +#endif Modified: head/sys/riscv/riscv/locore.S ============================================================================== --- head/sys/riscv/riscv/locore.S Wed Feb 24 15:15:46 2016 (r295971) +++ head/sys/riscv/riscv/locore.S Wed Feb 24 16:50:34 2016 (r295972) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2015 Ruslan Bukin + * Copyright (c) 2015-2016 Ruslan Bukin * All rights reserved. * * Portions of this software were developed by SRI International and the @@ -43,8 +43,55 @@ #include #include -#define HTIF_RING_SIZE (64) -#define HTIF_RING_LAST (24 * (HTIF_RING_SIZE - 1)) +#define HTIF_RING_NENTRIES (512) +#define HTIF_RING_ENTRY_SZ (24) +#define HTIF_RING_SIZE (HTIF_RING_ENTRY_SZ * HTIF_RING_NENTRIES) +#define HW_STACK_SIZE (96) + +/* + * Event queue for each CPU core: + * + * struct htif_ring { + * uint64_t data; + * uint64_t used; + * uint64_t next; + * } htif_ring[HTIF_RING_NENTRIES]; + * uint64_t htif_ring_cursor; + * uint64_t htif_ring_last; + */ + +.macro build_ring + la t0, htif_ring +#ifdef SMP + csrr a0, mhartid + li s0, (HTIF_RING_SIZE + 16) + mulw s0, a0, s0 + add t0, t0, s0 +#endif + li t1, 0 + sd t1, 0(t0) /* zero data */ + sd t1, 8(t0) /* zero used */ + mv t2, t0 + mv t3, t0 + li t5, (HTIF_RING_SIZE - HTIF_RING_ENTRY_SZ) + li t6, 0 + add t4, t0, t5 +1: + addi t3, t3, 24 /* pointer to next */ + beq t3, t4, 2f /* finish */ + sd t3, 16(t2) /* store pointer */ + addi t2, t2, 24 /* next entry */ + addi t6, t6, 1 /* counter */ + j 1b +2: + sd t0, 16(t3) /* last -> first */ + + li t2, (HTIF_RING_SIZE) + add s0, t0, t2 + sd t0, 0(s0) /* cursor */ + sd t0, 8(s0) /* last */ + /* finish building ring */ +.endm .globl kernbase .set kernbase, KERNBASE @@ -74,33 +121,14 @@ mentry: .align 8 .globl _start _start: - li s11, KERNBASE + /* Direct secondary cores to mpentry */ + csrr a0, mhartid + bnez a0, mpentry - /* Build ring */ - la t0, htif_ring - li t1, 0 - sd t1, 0(t0) /* zero data */ - sd t1, 8(t0) /* zero used */ - mv t2, t0 - mv t3, t0 - li t5, HTIF_RING_LAST - li t6, 0 - add t4, t0, t5 -1: - addi t3, t3, 24 /* pointer to next */ - beq t3, t4, 2f /* finish */ - sd t3, 16(t2) /* store pointer */ - addi t2, t2, 24 /* next entry */ - addi t6, t6, 1 /* counter */ - j 1b -2: - sd t0, 16(t3) /* last -> first */ - la t1, htif_ring_cursor - sd t0, 0(t1) - la t1, htif_ring_last - sd t0, 0(t1) - /* finish building ring */ + /* Build event queue for current core */ + build_ring + /* Setup machine-mode stack for CPU 0 */ la t0, hardstack_end csrw mscratch, t0 @@ -129,7 +157,14 @@ _start: li a6, PTE_SIZE mulw a5, a5, a6 add t0, s1, a5 + /* Store it to pagetable_l0 for each cpu */ + li t1, MAXCPU + li t2, PAGE_SIZE +1: sd t6, 0(t0) + add t0, t0, t2 + addi t1, t1, -1 + bnez t1, 1b /* Level 1 */ la s1, pagetable_l1 @@ -177,8 +212,16 @@ _start: (MSTATUS_PRV_U << MSTATUS_PRV2_SHIFT)); csrw mstatus, s0 + /* + * Enable machine-mode software interrupts + * so we can deliver IPI to this core. + */ + li t0, MIE_MSIE + csrs mie, t0 + /* Exit from machine mode */ la t0, .Lmmu_on + li s11, KERNBASE add t0, t0, s11 csrw mepc, t0 eret @@ -213,24 +256,16 @@ initstack: .space (PAGE_SIZE * KSTACK_PAGES) initstack_end: hardstack: - .space (PAGE_SIZE) + .space (HW_STACK_SIZE * MAXCPU) hardstack_end: .globl htif_ring htif_ring: - .space (24 * 1024) - - .globl htif_ring_cursor -htif_ring_cursor: - .space (8) - - .globl htif_ring_last -htif_ring_last: - .space (8) + .space ((HTIF_RING_SIZE + 16) * MAXCPU) .globl console_intr console_intr: - .space (8) + .space (8) ENTRY(sigcode) mv a0, sp @@ -259,7 +294,7 @@ szsigcode: .align 12 .globl pagetable_l0 pagetable_l0: - .space PAGE_SIZE + .space (PAGE_SIZE * MAXCPU) pagetable_l1: .space PAGE_SIZE pagetable_l2: @@ -270,4 +305,95 @@ pagetable_end: init_pt_va: .quad pagetable_l2 /* XXX: Keep page tables VA */ +#ifndef SMP +ENTRY(mpentry) +1: + wfi + j 1b +END(mpentry) +#else +/* + * mpentry(unsigned long) + * + * Called by a core when it is being brought online. + * The data in x0 is passed straight to init_secondary. + */ +ENTRY(mpentry) + /* *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Wed Feb 24 16:52:04 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 83F6AAB3E67; Wed, 24 Feb 2016 16:52:04 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 511951D6; Wed, 24 Feb 2016 16:52:04 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1OGq3Jb080811; Wed, 24 Feb 2016 16:52:03 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1OGq3Yf080810; Wed, 24 Feb 2016 16:52:03 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201602241652.u1OGq3Yf080810@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Wed, 24 Feb 2016 16:52:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295973 - head/lib/libc/db/btree X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Feb 2016 16:52:04 -0000 Author: pfg Date: Wed Feb 24 16:52:03 2016 New Revision: 295973 URL: https://svnweb.freebsd.org/changeset/base/295973 Log: db(3): Fix aliasing warnings from modern GCC. Obtained from: NetBSD (CVS Rev. 1.20) Modified: head/lib/libc/db/btree/bt_split.c Modified: head/lib/libc/db/btree/bt_split.c ============================================================================== --- head/lib/libc/db/btree/bt_split.c Wed Feb 24 16:50:34 2016 (r295972) +++ head/lib/libc/db/btree/bt_split.c Wed Feb 24 16:52:03 2016 (r295973) @@ -236,9 +236,12 @@ __bt_split(BTREE *t, PAGE *sp, const DBT WR_BINTERNAL(dest, nksize ? nksize : bl->ksize, rchild->pgno, bl->flags & P_BIGKEY); memmove(dest, bl->bytes, nksize ? nksize : bl->ksize); - if (bl->flags & P_BIGKEY && - bt_preserve(t, *(pgno_t *)bl->bytes) == RET_ERROR) - goto err1; + if (bl->flags & P_BIGKEY) { + pgno_t pgno; + memcpy(&pgno, bl->bytes, sizeof(pgno)); + if (bt_preserve(t, pgno) == RET_ERROR) + goto err1; + } break; case P_RINTERNAL: /* @@ -544,9 +547,12 @@ bt_broot(BTREE *t, PAGE *h, PAGE *l, PAG * If the key is on an overflow page, mark the overflow chain * so it isn't deleted when the leaf copy of the key is deleted. */ - if (bl->flags & P_BIGKEY && - bt_preserve(t, *(pgno_t *)bl->bytes) == RET_ERROR) - return (RET_ERROR); + if (bl->flags & P_BIGKEY) { + pgno_t pgno; + memcpy(&pgno, bl->bytes, sizeof(pgno)); + if (bt_preserve(t, pgno) == RET_ERROR) + return (RET_ERROR); + } break; case P_BINTERNAL: bi = GETBINTERNAL(r, 0); From owner-svn-src-head@freebsd.org Wed Feb 24 17:10:33 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6972CAB29E8; Wed, 24 Feb 2016 17:10:33 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3CA1B1112; Wed, 24 Feb 2016 17:10:33 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1OHAWcL086143; Wed, 24 Feb 2016 17:10:32 GMT (envelope-from ed@FreeBSD.org) Received: (from ed@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1OHAWwM086142; Wed, 24 Feb 2016 17:10:32 GMT (envelope-from ed@FreeBSD.org) Message-Id: <201602241710.u1OHAWwM086142@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ed set sender to ed@FreeBSD.org using -f From: Ed Schouten Date: Wed, 24 Feb 2016 17:10:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295974 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Feb 2016 17:10:33 -0000 Author: ed Date: Wed Feb 24 17:10:32 2016 New Revision: 295974 URL: https://svnweb.freebsd.org/changeset/base/295974 Log: Make asynchronous connection failures on UNIX sockets fail with ECONNRESET. While making CloudABI work well on Linux, I discovered that I had a FreeBSD-ism in one of my unit tests. The test did the following: - Create UNIX socket 1, bind it, make it listen. - Create UNIX socket 2, connect it to UNIX socket 1. - Close UNIX socket 1. - Obtain SO_ERROR from socket 2. On FreeBSD this returns ECONNABORTED, while on Linux it returns ECONNRESET. I dug through some of the relevant specifications[1] and it looks like Linux is all right here. ECONNABORTED should only be returned when the local connection (socket 2) is aborted; not the peer (socket 1). It is of course slightly misleading: the function in which we set this error is called uipc_abort(), but keep in mind that we're aborting the peer, thus resetting the local socket. [1] http://pubs.opengroup.org/onlinepubs/9699919799/functions/connect.html Reviewed by: cem Sponsored by: Nuxi, the Netherlands Differential Revision: https://reviews.freebsd.org/D5419 Modified: head/sys/kern/uipc_usrreq.c Modified: head/sys/kern/uipc_usrreq.c ============================================================================== --- head/sys/kern/uipc_usrreq.c Wed Feb 24 16:52:03 2016 (r295973) +++ head/sys/kern/uipc_usrreq.c Wed Feb 24 17:10:32 2016 (r295974) @@ -354,7 +354,7 @@ uipc_abort(struct socket *so) unp2 = unp->unp_conn; if (unp2 != NULL) { UNP_PCB_LOCK(unp2); - unp_drop(unp2, ECONNABORTED); + unp_drop(unp2, ECONNRESET); UNP_PCB_UNLOCK(unp2); } UNP_PCB_UNLOCK(unp); From owner-svn-src-head@freebsd.org Wed Feb 24 17:14:13 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1C271AB2CEB; Wed, 24 Feb 2016 17:14:13 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E02FB17FD; Wed, 24 Feb 2016 17:14:12 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1OHEBl7088761; Wed, 24 Feb 2016 17:14:11 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1OHEBoA088760; Wed, 24 Feb 2016 17:14:11 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201602241714.u1OHEBoA088760@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Wed, 24 Feb 2016 17:14:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295975 - head/lib/libc/db/recno X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Feb 2016 17:14:13 -0000 Author: pfg Date: Wed Feb 24 17:14:11 2016 New Revision: 295975 URL: https://svnweb.freebsd.org/changeset/base/295975 Log: db(3): Fix aliasing warnings from modern GCC. While here also drop a malloc cast. Obtained from: NetBSD (CVS Rev. 1.18 - 1.20) Modified: head/lib/libc/db/recno/rec_put.c Modified: head/lib/libc/db/recno/rec_put.c ============================================================================== --- head/lib/libc/db/recno/rec_put.c Wed Feb 24 17:10:32 2016 (r295974) +++ head/lib/libc/db/recno/rec_put.c Wed Feb 24 17:14:11 2016 (r295975) @@ -140,8 +140,7 @@ einval: errno = EINVAL; return (RET_ERROR); if (nrec > t->bt_nrecs + 1) { if (F_ISSET(t, R_FIXLEN)) { - if ((tdata.data = - (void *)malloc(t->bt_reclen)) == NULL) + if ((tdata.data = malloc(t->bt_reclen)) == NULL) return (RET_ERROR); tdata.size = t->bt_reclen; memset(tdata.data, t->bt_bval, tdata.size); @@ -208,7 +207,7 @@ __rec_iput(BTREE *t, recno_t nrec, const return (RET_ERROR); tdata.data = db; tdata.size = NOVFLSIZE; - *(pgno_t *)db = pg; + memcpy(db, &pg, sizeof(pg)); *(u_int32_t *)(db + sizeof(pgno_t)) = data->size; dflags = P_BIGDATA; data = &tdata; From owner-svn-src-head@freebsd.org Wed Feb 24 17:14:45 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D904AAB2DBD for ; Wed, 24 Feb 2016 17:14:45 +0000 (UTC) (envelope-from steven.hartland@multiplay.co.uk) Received: from mail-wm0-x22d.google.com (mail-wm0-x22d.google.com [IPv6:2a00:1450:400c:c09::22d]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7A0101A5C for ; Wed, 24 Feb 2016 17:14:45 +0000 (UTC) (envelope-from steven.hartland@multiplay.co.uk) Received: by mail-wm0-x22d.google.com with SMTP id g62so282248962wme.1 for ; Wed, 24 Feb 2016 09:14:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=multiplay-co-uk.20150623.gappssmtp.com; s=20150623; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-type:content-transfer-encoding; bh=L8UC9JdLv+AaeNeERenq+MY/PTucY6tg4CWqYolKBZM=; b=lBGYNzHukhEbcjlYOdpgB0XuJNZvZn1Z1fXzxWefiT28KdoOquOiFfM6gxZ/Ygt7hg wEZA9BFJP6lYSZafUJZOsX9Umq/ZYcmB4amsZhZa0dHKPwGU+L9YOMyOg9vNKP9aFxZV QQaq31M/UZXkzs6jIGIw1oxH9ee1GySIV44WF3ufgdFa3V8aYALlH+7uh15qVK+7Sr+K 3aoYo8RxANN088ZTd7z9XdzJ02s1b4Are+Ow8lYgPCVDcRYO1PdT+4SkzSkyOZtkiLL1 vQCIlQ+Wpj0Zl8l523XBtuM6X+rbVJuYVoh2z1ItDs4sqrZNSSI/AtsVhNoaSvprZ5A8 eqVA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-type :content-transfer-encoding; bh=L8UC9JdLv+AaeNeERenq+MY/PTucY6tg4CWqYolKBZM=; b=KPruNc1DHjG9SKc3Dxg24Z59aasiYcCV1nqYuPiFFzJSdkNXbWS6HzEAkZ4EHiTDvS d0cYA9GxuNCpTfY9dslpN5G1RKzxhVh0E6KLBP/sz+N90yDimOJDlrERtm9+ioCE4D9I BX3zQTuO3g1QU237fAbmlyfxekzyi7zs8zMYEHitr72EZgVftVJf3nol2C2LWfwAkLcO 6KSsR0P/rezuMnQ5IUY6X+fbWvEG6Z/+0c+zi9oi4vacBexDgn212MZE5KMET0TSc3H3 Q1Qf3sTvb++UBpy0mOWZ663M7p7TaRlk2Wp3h+7sO+ykwh0lfr8dgYeFnlS8kN04+hj+ iKbg== X-Gm-Message-State: AG10YORiwN8y2GKrO7fVMI3vZEMbdEX0QhXsZU6P5U3zUn4ihaj2ELF078ZJqu/g9kiDO6oR X-Received: by 10.194.61.209 with SMTP id s17mr39847455wjr.35.1456334083655; Wed, 24 Feb 2016 09:14:43 -0800 (PST) Received: from [10.10.1.58] (liv3d.labs.multiplay.co.uk. [82.69.141.171]) by smtp.gmail.com with ESMTPSA id u9sm32291445wmd.4.2016.02.24.09.14.41 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 24 Feb 2016 09:14:42 -0800 (PST) Subject: Re: svn commit: r295974 - head/sys/kern To: Ed Schouten , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201602241710.u1OHAWwM086142@repo.freebsd.org> From: Steven Hartland Message-ID: <56CDE508.5000903@multiplay.co.uk> Date: Wed, 24 Feb 2016 17:14:48 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 MIME-Version: 1.0 In-Reply-To: <201602241710.u1OHAWwM086142@repo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Feb 2016 17:14:46 -0000 This should really be commented to this effect in the code otherwise someone reading the source will think its a mistake. On 24/02/2016 17:10, Ed Schouten wrote: > Author: ed > Date: Wed Feb 24 17:10:32 2016 > New Revision: 295974 > URL: https://svnweb.freebsd.org/changeset/base/295974 > > Log: > Make asynchronous connection failures on UNIX sockets fail with ECONNRESET. > > While making CloudABI work well on Linux, I discovered that I had a > FreeBSD-ism in one of my unit tests. The test did the following: > > - Create UNIX socket 1, bind it, make it listen. > - Create UNIX socket 2, connect it to UNIX socket 1. > - Close UNIX socket 1. > - Obtain SO_ERROR from socket 2. > > On FreeBSD this returns ECONNABORTED, while on Linux it returns > ECONNRESET. I dug through some of the relevant specifications[1] and it > looks like Linux is all right here. ECONNABORTED should only be returned > when the local connection (socket 2) is aborted; not the peer (socket 1). > > It is of course slightly misleading: the function in which we set this > error is called uipc_abort(), but keep in mind that we're aborting the > peer, thus resetting the local socket. > > [1] http://pubs.opengroup.org/onlinepubs/9699919799/functions/connect.html > > Reviewed by: cem > Sponsored by: Nuxi, the Netherlands > Differential Revision: https://reviews.freebsd.org/D5419 > > Modified: > head/sys/kern/uipc_usrreq.c > > Modified: head/sys/kern/uipc_usrreq.c > ============================================================================== > --- head/sys/kern/uipc_usrreq.c Wed Feb 24 16:52:03 2016 (r295973) > +++ head/sys/kern/uipc_usrreq.c Wed Feb 24 17:10:32 2016 (r295974) > @@ -354,7 +354,7 @@ uipc_abort(struct socket *so) > unp2 = unp->unp_conn; > if (unp2 != NULL) { > UNP_PCB_LOCK(unp2); > - unp_drop(unp2, ECONNABORTED); > + unp_drop(unp2, ECONNRESET); > UNP_PCB_UNLOCK(unp2); > } > UNP_PCB_UNLOCK(unp); > From owner-svn-src-head@freebsd.org Wed Feb 24 17:18:29 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DB7DCAB3006; Wed, 24 Feb 2016 17:18:29 +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 mx1.freebsd.org (Postfix) with ESMTPS id AC8011DA7; Wed, 24 Feb 2016 17:18:29 +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 u1OHISLw089060; Wed, 24 Feb 2016 17:18:28 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1OHISws089059; Wed, 24 Feb 2016 17:18:28 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201602241718.u1OHISws089059@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Wed, 24 Feb 2016 17:18:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295976 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Feb 2016 17:18:30 -0000 Author: bdrewery Date: Wed Feb 24 17:18:28 2016 New Revision: 295976 URL: https://svnweb.freebsd.org/changeset/base/295976 Log: PROGS: Only recurse on called targets like done for SUBDIR in r291635. MFC after: 2 weeks Sponsored by: EMC / Isilon Storage Division Modified: head/share/mk/bsd.progs.mk Modified: head/share/mk/bsd.progs.mk ============================================================================== --- head/share/mk/bsd.progs.mk Wed Feb 24 17:14:11 2016 (r295975) +++ head/share/mk/bsd.progs.mk Wed Feb 24 17:18:28 2016 (r295976) @@ -134,6 +134,8 @@ $p.$t: .PHONY .MAKE # Depend main pseudo targets on all PROG.pseudo targets too. .for t in ${PROGS_TARGETS:O:u} +.if make(${t}) $t: ${PROGS:%=%.$t} +.endif .endfor .endif # !empty(PROGS) && !defined(_RECURSING_PROGS) && !defined(PROG) From owner-svn-src-head@freebsd.org Wed Feb 24 17:18:33 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5F0BEAB3025; Wed, 24 Feb 2016 17:18:33 +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 mx1.freebsd.org (Postfix) with ESMTPS id 2F37E1DC7; Wed, 24 Feb 2016 17:18:33 +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 u1OHIWGV089108; Wed, 24 Feb 2016 17:18:32 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1OHIWuH089105; Wed, 24 Feb 2016 17:18:32 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201602241718.u1OHIWuH089105@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Wed, 24 Feb 2016 17:18:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295977 - in head/usr.bin: mkcsmapper_static mkesdb_static X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Feb 2016 17:18:33 -0000 Author: bdrewery Date: Wed Feb 24 17:18:31 2016 New Revision: 295977 URL: https://svnweb.freebsd.org/changeset/base/295977 Log: Properly fix these builds by adding NO_WMISSING_VARIABLE_DECLARATIONS from r249657. This reverts r284374. MFC after: 2 weeks Sponsored by: EMC / Isilon Storage Division Modified: head/usr.bin/mkcsmapper_static/Makefile head/usr.bin/mkesdb_static/Makefile Modified: head/usr.bin/mkcsmapper_static/Makefile ============================================================================== --- head/usr.bin/mkcsmapper_static/Makefile Wed Feb 24 17:18:28 2016 (r295976) +++ head/usr.bin/mkcsmapper_static/Makefile Wed Feb 24 17:18:31 2016 (r295977) @@ -7,9 +7,7 @@ SRCS= citrus_bcs.c citrus_db_factory.c c citrus_lookup_factory.c citrus_pivot_factory.c MAN= NO_SHARED= yes -.if ${MACHINE} == "host" -NO_WARNS= yes -.endif +NO_WMISSING_VARIABLE_DECLARATIONS= build-tools: mkcsmapper_static Modified: head/usr.bin/mkesdb_static/Makefile ============================================================================== --- head/usr.bin/mkesdb_static/Makefile Wed Feb 24 17:18:28 2016 (r295976) +++ head/usr.bin/mkesdb_static/Makefile Wed Feb 24 17:18:31 2016 (r295977) @@ -7,9 +7,7 @@ SRCS= citrus_bcs.c citrus_db_factory.c c citrus_lookup_factory.c MAN= NO_SHARED= yes -.if ${MACHINE} == "host" -NO_WARNS= yes -.endif +NO_WMISSING_VARIABLE_DECLARATIONS= build-tools: mkesdb_static From owner-svn-src-head@freebsd.org Wed Feb 24 17:18:37 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8CEB2AB3056; Wed, 24 Feb 2016 17:18:37 +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 mx1.freebsd.org (Postfix) with ESMTPS id 437271F08; Wed, 24 Feb 2016 17:18:37 +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 u1OHIapq089157; Wed, 24 Feb 2016 17:18:36 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1OHIZSq089153; Wed, 24 Feb 2016 17:18:35 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201602241718.u1OHIZSq089153@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Wed, 24 Feb 2016 17:18:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295978 - in head: lib/libcxxrt usr.bin/mkcsmapper_static usr.bin/mkesdb_static usr.bin/mkuzip X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Feb 2016 17:18:37 -0000 Author: bdrewery Date: Wed Feb 24 17:18:35 2016 New Revision: 295978 URL: https://svnweb.freebsd.org/changeset/base/295978 Log: DIRDEPS_BUILD: Update dependencies. Sponsored by: EMC / Isilon Storage Division Added: head/usr.bin/mkesdb_static/Makefile.depend - copied, changed from r295977, head/usr.bin/mkcsmapper_static/Makefile.depend Modified: head/lib/libcxxrt/Makefile.depend.host head/usr.bin/mkcsmapper_static/Makefile.depend head/usr.bin/mkuzip/Makefile.depend Modified: head/lib/libcxxrt/Makefile.depend.host ============================================================================== --- head/lib/libcxxrt/Makefile.depend.host Wed Feb 24 17:18:31 2016 (r295977) +++ head/lib/libcxxrt/Makefile.depend.host Wed Feb 24 17:18:35 2016 (r295978) @@ -2,7 +2,6 @@ # Autogenerated - do NOT edit! DIRDEPS = \ - usr.bin/clang/clang \ .include Modified: head/usr.bin/mkcsmapper_static/Makefile.depend ============================================================================== --- head/usr.bin/mkcsmapper_static/Makefile.depend Wed Feb 24 17:18:31 2016 (r295977) +++ head/usr.bin/mkcsmapper_static/Makefile.depend Wed Feb 24 17:18:35 2016 (r295978) @@ -2,12 +2,15 @@ # Autogenerated - do NOT edit! DIRDEPS = \ + gnu/lib/csu \ + gnu/lib/libgcc \ include \ include/arpa \ include/xlocale \ lib/${CSU_DIR} \ lib/libc \ lib/libcompiler_rt \ + usr.bin/yacc.host \ .include Copied and modified: head/usr.bin/mkesdb_static/Makefile.depend (from r295977, head/usr.bin/mkcsmapper_static/Makefile.depend) ============================================================================== --- head/usr.bin/mkcsmapper_static/Makefile.depend Wed Feb 24 17:18:31 2016 (r295977, copy source) +++ head/usr.bin/mkesdb_static/Makefile.depend Wed Feb 24 17:18:35 2016 (r295978) @@ -2,12 +2,15 @@ # Autogenerated - do NOT edit! DIRDEPS = \ + gnu/lib/csu \ + gnu/lib/libgcc \ include \ include/arpa \ include/xlocale \ lib/${CSU_DIR} \ lib/libc \ lib/libcompiler_rt \ + usr.bin/yacc.host \ .include Modified: head/usr.bin/mkuzip/Makefile.depend ============================================================================== --- head/usr.bin/mkuzip/Makefile.depend Wed Feb 24 17:18:31 2016 (r295977) +++ head/usr.bin/mkuzip/Makefile.depend Wed Feb 24 17:18:35 2016 (r295978) @@ -9,6 +9,9 @@ DIRDEPS = \ lib/${CSU_DIR} \ lib/libc \ lib/libcompiler_rt \ + lib/liblzma \ + lib/libmd \ + lib/libthr \ lib/libz \ From owner-svn-src-head@freebsd.org Wed Feb 24 17:18:47 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3C2C3AB309B; Wed, 24 Feb 2016 17:18:47 +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 mx1.freebsd.org (Postfix) with ESMTPS id 073761191; Wed, 24 Feb 2016 17:18:46 +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 u1OHIjB1089301; Wed, 24 Feb 2016 17:18:45 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1OHIhpx089206; Wed, 24 Feb 2016 17:18:43 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201602241718.u1OHIhpx089206@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Wed, 24 Feb 2016 17:18:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295979 - in head: kerberos5/lib/libasn1 kerberos5/lib/libgssapi_krb5 kerberos5/lib/libgssapi_spnego kerberos5/lib/libhdb kerberos5/lib/libheimntlm kerberos5/lib/libhx509 kerberos5/lib/... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Feb 2016 17:18:47 -0000 Author: bdrewery Date: Wed Feb 24 17:18:43 2016 New Revision: 295979 URL: https://svnweb.freebsd.org/changeset/base/295979 Log: DIRDEPS_BUILD: Add some missing build dependencies for kerberos5. Sponsored by: EMC / Isilon Storage Division Modified: head/kerberos5/lib/libasn1/Makefile.depend head/kerberos5/lib/libgssapi_krb5/Makefile.depend head/kerberos5/lib/libgssapi_spnego/Makefile.depend head/kerberos5/lib/libhdb/Makefile.depend head/kerberos5/lib/libheimntlm/Makefile.depend head/kerberos5/lib/libhx509/Makefile.depend head/kerberos5/lib/libkadm5clnt/Makefile.depend head/kerberos5/lib/libkadm5srv/Makefile.depend head/kerberos5/lib/libkafs5/Makefile.depend head/kerberos5/lib/libkrb5/Makefile.depend head/kerberos5/lib/libroken/Makefile.depend head/kerberos5/lib/libvers/Makefile.depend head/kerberos5/lib/libwind/Makefile.depend head/kerberos5/libexec/ipropd-master/Makefile.depend head/kerberos5/libexec/ipropd-slave/Makefile.depend head/kerberos5/libexec/kdigest/Makefile.depend head/kerberos5/tools/asn1_compile/Makefile.depend head/kerberos5/tools/slc/Makefile.depend head/kerberos5/usr.bin/hxtool/Makefile.depend head/kerberos5/usr.bin/kadmin/Makefile.depend head/kerberos5/usr.bin/kcc/Makefile.depend head/kerberos5/usr.sbin/iprop-log/Makefile.depend head/kerberos5/usr.sbin/ktutil/Makefile.depend head/targets/pseudo/hosttools/Makefile.depend Modified: head/kerberos5/lib/libasn1/Makefile.depend ============================================================================== --- head/kerberos5/lib/libasn1/Makefile.depend Wed Feb 24 17:18:35 2016 (r295978) +++ head/kerberos5/lib/libasn1/Makefile.depend Wed Feb 24 17:18:43 2016 (r295979) @@ -8,10 +8,12 @@ DIRDEPS = \ include/arpa \ include/xlocale \ kerberos5/lib/libroken \ + kerberos5/tools/asn1_compile.host \ lib/${CSU_DIR} \ lib/libc \ lib/libcom_err \ lib/libcompiler_rt \ + usr.bin/compile_et.host \ .include Modified: head/kerberos5/lib/libgssapi_krb5/Makefile.depend ============================================================================== --- head/kerberos5/lib/libgssapi_krb5/Makefile.depend Wed Feb 24 17:18:35 2016 (r295978) +++ head/kerberos5/lib/libgssapi_krb5/Makefile.depend Wed Feb 24 17:18:43 2016 (r295979) @@ -19,6 +19,7 @@ DIRDEPS = \ lib/libcompiler_rt \ lib/libgssapi \ secure/lib/libcrypto \ + usr.bin/compile_et.host \ .include Modified: head/kerberos5/lib/libgssapi_spnego/Makefile.depend ============================================================================== --- head/kerberos5/lib/libgssapi_spnego/Makefile.depend Wed Feb 24 17:18:35 2016 (r295978) +++ head/kerberos5/lib/libgssapi_spnego/Makefile.depend Wed Feb 24 17:18:43 2016 (r295979) @@ -11,6 +11,7 @@ DIRDEPS = \ kerberos5/lib/libheimbase \ kerberos5/lib/libkrb5 \ kerberos5/lib/libroken \ + kerberos5/tools/asn1_compile.host \ lib/${CSU_DIR} \ lib/libc \ lib/libcompiler_rt \ Modified: head/kerberos5/lib/libhdb/Makefile.depend ============================================================================== --- head/kerberos5/lib/libhdb/Makefile.depend Wed Feb 24 17:18:35 2016 (r295978) +++ head/kerberos5/lib/libhdb/Makefile.depend Wed Feb 24 17:18:43 2016 (r295979) @@ -13,12 +13,14 @@ DIRDEPS = \ kerberos5/lib/libkrb5 \ kerberos5/lib/libroken \ kerberos5/lib/libwind \ + kerberos5/tools/asn1_compile.host \ lib/${CSU_DIR} \ lib/libc \ lib/libcom_err \ lib/libcompiler_rt \ lib/libsqlite3 \ secure/lib/libcrypto \ + usr.bin/compile_et.host \ .include Modified: head/kerberos5/lib/libheimntlm/Makefile.depend ============================================================================== --- head/kerberos5/lib/libheimntlm/Makefile.depend Wed Feb 24 17:18:35 2016 (r295978) +++ head/kerberos5/lib/libheimntlm/Makefile.depend Wed Feb 24 17:18:43 2016 (r295979) @@ -15,6 +15,7 @@ DIRDEPS = \ lib/libcom_err \ lib/libcompiler_rt \ secure/lib/libcrypto \ + usr.bin/compile_et.host \ .include Modified: head/kerberos5/lib/libhx509/Makefile.depend ============================================================================== --- head/kerberos5/lib/libhx509/Makefile.depend Wed Feb 24 17:18:35 2016 (r295978) +++ head/kerberos5/lib/libhx509/Makefile.depend Wed Feb 24 17:18:43 2016 (r295979) @@ -10,11 +10,13 @@ DIRDEPS = \ kerberos5/lib/libasn1 \ kerberos5/lib/libroken \ kerberos5/lib/libwind \ + kerberos5/tools/asn1_compile.host \ lib/${CSU_DIR} \ lib/libc \ lib/libcom_err \ lib/libcompiler_rt \ secure/lib/libcrypto \ + usr.bin/compile_et.host \ usr.bin/yacc.host \ Modified: head/kerberos5/lib/libkadm5clnt/Makefile.depend ============================================================================== --- head/kerberos5/lib/libkadm5clnt/Makefile.depend Wed Feb 24 17:18:35 2016 (r295978) +++ head/kerberos5/lib/libkadm5clnt/Makefile.depend Wed Feb 24 17:18:43 2016 (r295979) @@ -15,6 +15,7 @@ DIRDEPS = \ lib/libc \ lib/libcom_err \ lib/libcompiler_rt \ + usr.bin/compile_et.host \ .include Modified: head/kerberos5/lib/libkadm5srv/Makefile.depend ============================================================================== --- head/kerberos5/lib/libkadm5srv/Makefile.depend Wed Feb 24 17:18:35 2016 (r295978) +++ head/kerberos5/lib/libkadm5srv/Makefile.depend Wed Feb 24 17:18:43 2016 (r295979) @@ -15,6 +15,7 @@ DIRDEPS = \ lib/libc \ lib/libcom_err \ lib/libcompiler_rt \ + usr.bin/compile_et.host \ .include Modified: head/kerberos5/lib/libkafs5/Makefile.depend ============================================================================== --- head/kerberos5/lib/libkafs5/Makefile.depend Wed Feb 24 17:18:35 2016 (r295978) +++ head/kerberos5/lib/libkafs5/Makefile.depend Wed Feb 24 17:18:43 2016 (r295979) @@ -14,6 +14,7 @@ DIRDEPS = \ lib/libc \ lib/libcompiler_rt \ secure/lib/libcrypto \ + usr.bin/compile_et.host \ .include Modified: head/kerberos5/lib/libkrb5/Makefile.depend ============================================================================== --- head/kerberos5/lib/libkrb5/Makefile.depend Wed Feb 24 17:18:35 2016 (r295978) +++ head/kerberos5/lib/libkrb5/Makefile.depend Wed Feb 24 17:18:43 2016 (r295979) @@ -19,6 +19,7 @@ DIRDEPS = \ lib/libcompiler_rt \ lib/libcrypt \ secure/lib/libcrypto \ + usr.bin/compile_et.host \ .include Modified: head/kerberos5/lib/libroken/Makefile.depend ============================================================================== --- head/kerberos5/lib/libroken/Makefile.depend Wed Feb 24 17:18:35 2016 (r295978) +++ head/kerberos5/lib/libroken/Makefile.depend Wed Feb 24 17:18:43 2016 (r295979) @@ -7,6 +7,7 @@ DIRDEPS = \ include \ include/arpa \ include/xlocale \ + kerberos5/tools/make-roken.host \ lib/${CSU_DIR} \ lib/libc \ lib/libcompiler_rt \ Modified: head/kerberos5/lib/libvers/Makefile.depend ============================================================================== --- head/kerberos5/lib/libvers/Makefile.depend Wed Feb 24 17:18:35 2016 (r295978) +++ head/kerberos5/lib/libvers/Makefile.depend Wed Feb 24 17:18:43 2016 (r295979) @@ -5,6 +5,7 @@ DIRDEPS = \ include \ include/arpa \ include/xlocale \ + kerberos5/tools/make-roken.host \ .include Modified: head/kerberos5/lib/libwind/Makefile.depend ============================================================================== --- head/kerberos5/lib/libwind/Makefile.depend Wed Feb 24 17:18:35 2016 (r295978) +++ head/kerberos5/lib/libwind/Makefile.depend Wed Feb 24 17:18:43 2016 (r295979) @@ -12,6 +12,7 @@ DIRDEPS = \ lib/libc \ lib/libcom_err \ lib/libcompiler_rt \ + usr.bin/compile_et.host \ .include Modified: head/kerberos5/libexec/ipropd-master/Makefile.depend ============================================================================== --- head/kerberos5/libexec/ipropd-master/Makefile.depend Wed Feb 24 17:18:35 2016 (r295978) +++ head/kerberos5/libexec/ipropd-master/Makefile.depend Wed Feb 24 17:18:43 2016 (r295979) @@ -25,6 +25,7 @@ DIRDEPS = \ lib/libsqlite3 \ lib/libthr \ secure/lib/libcrypto \ + usr.bin/compile_et.host \ .include Modified: head/kerberos5/libexec/ipropd-slave/Makefile.depend ============================================================================== --- head/kerberos5/libexec/ipropd-slave/Makefile.depend Wed Feb 24 17:18:35 2016 (r295978) +++ head/kerberos5/libexec/ipropd-slave/Makefile.depend Wed Feb 24 17:18:43 2016 (r295979) @@ -25,6 +25,7 @@ DIRDEPS = \ lib/libsqlite3 \ lib/libthr \ secure/lib/libcrypto \ + usr.bin/compile_et.host \ .include Modified: head/kerberos5/libexec/kdigest/Makefile.depend ============================================================================== --- head/kerberos5/libexec/kdigest/Makefile.depend Wed Feb 24 17:18:35 2016 (r295978) +++ head/kerberos5/libexec/kdigest/Makefile.depend Wed Feb 24 17:18:43 2016 (r295979) @@ -18,6 +18,7 @@ DIRDEPS = \ kerberos5/lib/libsl \ kerberos5/lib/libvers \ kerberos5/lib/libwind \ + kerberos5/tools/slc.host \ lib/${CSU_DIR} \ lib/libc \ lib/libcom_err \ Modified: head/kerberos5/tools/asn1_compile/Makefile.depend ============================================================================== --- head/kerberos5/tools/asn1_compile/Makefile.depend Wed Feb 24 17:18:35 2016 (r295978) +++ head/kerberos5/tools/asn1_compile/Makefile.depend Wed Feb 24 17:18:43 2016 (r295979) @@ -9,6 +9,7 @@ DIRDEPS = \ include/xlocale \ kerberos5/lib/libroken \ kerberos5/lib/libvers \ + kerberos5/tools/make-roken.host \ lib/${CSU_DIR} \ lib/libc \ lib/libcompiler_rt \ Modified: head/kerberos5/tools/slc/Makefile.depend ============================================================================== --- head/kerberos5/tools/slc/Makefile.depend Wed Feb 24 17:18:35 2016 (r295978) +++ head/kerberos5/tools/slc/Makefile.depend Wed Feb 24 17:18:43 2016 (r295979) @@ -9,6 +9,7 @@ DIRDEPS = \ include/xlocale \ kerberos5/lib/libroken \ kerberos5/lib/libvers \ + kerberos5/tools/make-roken.host \ lib/${CSU_DIR} \ lib/libc \ lib/libcompiler_rt \ Modified: head/kerberos5/usr.bin/hxtool/Makefile.depend ============================================================================== --- head/kerberos5/usr.bin/hxtool/Makefile.depend Wed Feb 24 17:18:35 2016 (r295978) +++ head/kerberos5/usr.bin/hxtool/Makefile.depend Wed Feb 24 17:18:43 2016 (r295979) @@ -13,6 +13,7 @@ DIRDEPS = \ kerberos5/lib/libsl \ kerberos5/lib/libvers \ kerberos5/lib/libwind \ + kerberos5/tools/slc.host \ lib/${CSU_DIR} \ lib/libc \ lib/libcom_err \ Modified: head/kerberos5/usr.bin/kadmin/Makefile.depend ============================================================================== --- head/kerberos5/usr.bin/kadmin/Makefile.depend Wed Feb 24 17:18:35 2016 (r295978) +++ head/kerberos5/usr.bin/kadmin/Makefile.depend Wed Feb 24 17:18:43 2016 (r295979) @@ -19,6 +19,7 @@ DIRDEPS = \ kerberos5/lib/libsl \ kerberos5/lib/libvers \ kerberos5/lib/libwind \ + kerberos5/tools/slc.host \ lib/${CSU_DIR} \ lib/libc \ lib/libcom_err \ Modified: head/kerberos5/usr.bin/kcc/Makefile.depend ============================================================================== --- head/kerberos5/usr.bin/kcc/Makefile.depend Wed Feb 24 17:18:35 2016 (r295978) +++ head/kerberos5/usr.bin/kcc/Makefile.depend Wed Feb 24 17:18:43 2016 (r295979) @@ -17,6 +17,7 @@ DIRDEPS = \ kerberos5/lib/libsl \ kerberos5/lib/libvers \ kerberos5/lib/libwind \ + kerberos5/tools/slc.host \ lib/${CSU_DIR} \ lib/libc \ lib/libcom_err \ Modified: head/kerberos5/usr.sbin/iprop-log/Makefile.depend ============================================================================== --- head/kerberos5/usr.sbin/iprop-log/Makefile.depend Wed Feb 24 17:18:35 2016 (r295978) +++ head/kerberos5/usr.sbin/iprop-log/Makefile.depend Wed Feb 24 17:18:43 2016 (r295979) @@ -18,6 +18,7 @@ DIRDEPS = \ kerberos5/lib/libsl \ kerberos5/lib/libvers \ kerberos5/lib/libwind \ + kerberos5/tools/slc.host \ lib/${CSU_DIR} \ lib/libc \ lib/libcom_err \ @@ -28,6 +29,7 @@ DIRDEPS = \ lib/libthr \ lib/ncurses/ncursesw \ secure/lib/libcrypto \ + usr.bin/compile_et.host \ .include Modified: head/kerberos5/usr.sbin/ktutil/Makefile.depend ============================================================================== --- head/kerberos5/usr.sbin/ktutil/Makefile.depend Wed Feb 24 17:18:35 2016 (r295978) +++ head/kerberos5/usr.sbin/ktutil/Makefile.depend Wed Feb 24 17:18:43 2016 (r295979) @@ -17,6 +17,7 @@ DIRDEPS = \ kerberos5/lib/libsl \ kerberos5/lib/libvers \ kerberos5/lib/libwind \ + kerberos5/tools/slc.host \ lib/${CSU_DIR} \ lib/libc \ lib/libcom_err \ Modified: head/targets/pseudo/hosttools/Makefile.depend ============================================================================== --- head/targets/pseudo/hosttools/Makefile.depend Wed Feb 24 17:18:35 2016 (r295978) +++ head/targets/pseudo/hosttools/Makefile.depend Wed Feb 24 17:18:43 2016 (r295979) @@ -2,6 +2,10 @@ # This file is not autogenerated - take care! +.if !defined(MK_KERBEROS) +.include +.endif + DIRDEPS = \ lib/clang/include.host \ lib/libc++.host \ @@ -20,6 +24,13 @@ DIRDEPS = \ usr.bin/xlint/xlint.host \ usr.sbin/config.host \ +.if ${MK_KERBEROS} != "no" +DIRDEPS+= \ + kerberos5/tools/asn1_compile.host \ + kerberos5/tools/make-roken.host \ + usr.bin/compile_et.host \ + +.endif .include From owner-svn-src-head@freebsd.org Wed Feb 24 17:18:50 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A838CAB30D3; Wed, 24 Feb 2016 17:18:50 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7833011C6; Wed, 24 Feb 2016 17:18:50 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1OHInCB089388; Wed, 24 Feb 2016 17:18:49 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1OHInwg089387; Wed, 24 Feb 2016 17:18:49 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201602241718.u1OHInwg089387@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Wed, 24 Feb 2016 17:18:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295980 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Feb 2016 17:18:50 -0000 Author: bdrewery Date: Wed Feb 24 17:18:49 2016 New Revision: 295980 URL: https://svnweb.freebsd.org/changeset/base/295980 Log: Support a WANT_MAKE_VERSION. This will be used soon for .dinclude support in FAST_DEPEND. MFC after: 2 weeks Sponsored by: EMC / Isilon Storage Division Modified: head/Makefile Modified: head/Makefile ============================================================================== --- head/Makefile Wed Feb 24 17:18:43 2016 (r295979) +++ head/Makefile Wed Feb 24 17:18:49 2016 (r295980) @@ -297,11 +297,9 @@ kernel: buildkernel installkernel # Perform a few tests to determine if the installed tools are adequate # for building the world. # -# Note: if we ever need to care about the version of bmake, simply testing -# MAKE_VERSION against a required version should suffice. -# upgrade_checks: -.if ${HAVE_MAKE} != ${WANT_MAKE} +.if ${HAVE_MAKE} != ${WANT_MAKE} || \ + (defined(WANT_MAKE_VERSION) && ${MAKE_VERSION} < ${WANT_MAKE_VERSION}) @(cd ${.CURDIR} && ${MAKE} ${WANT_MAKE:S,^f,,}) .endif From owner-svn-src-head@freebsd.org Wed Feb 24 17:18:54 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 12D37AB3112; Wed, 24 Feb 2016 17:18:54 +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 mx1.freebsd.org (Postfix) with ESMTPS id C1B4312C5; Wed, 24 Feb 2016 17:18:53 +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 u1OHIqtY089433; Wed, 24 Feb 2016 17:18:52 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1OHIqNx089432; Wed, 24 Feb 2016 17:18:52 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201602241718.u1OHIqNx089432@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Wed, 24 Feb 2016 17:18:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295981 - head/tools/tools/net80211/w00t X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Feb 2016 17:18:54 -0000 Author: bdrewery Date: Wed Feb 24 17:18:52 2016 New Revision: 295981 URL: https://svnweb.freebsd.org/changeset/base/295981 Log: Convert to LIBADD. Sponsored by: EMC / Isilon Storage Division Modified: head/tools/tools/net80211/w00t/Makefile.inc Modified: head/tools/tools/net80211/w00t/Makefile.inc ============================================================================== --- head/tools/tools/net80211/w00t/Makefile.inc Wed Feb 24 17:18:49 2016 (r295980) +++ head/tools/tools/net80211/w00t/Makefile.inc Wed Feb 24 17:18:52 2016 (r295981) @@ -2,9 +2,10 @@ W00T= ../libw00t # NB: we get crc32 from -lz -DPADD= ${W00T}/libw00t.a ${LIBCRYPTO} ${LIBZ} +DPADD= ${W00T}/libw00t.a LDFLAGS= -L${W00T} -LDADD= -lw00t -lcrypto -lz +LDADD= -lw00t +LIBADD+= crypto z BINDIR= /usr/local/bin CFLAGS= -g -I${W00T} From owner-svn-src-head@freebsd.org Wed Feb 24 17:18:57 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2050EAB313F; Wed, 24 Feb 2016 17:18:57 +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 mx1.freebsd.org (Postfix) with ESMTPS id E44911434; Wed, 24 Feb 2016 17:18:56 +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 u1OHIt7g089479; Wed, 24 Feb 2016 17:18:55 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1OHItct089478; Wed, 24 Feb 2016 17:18:55 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201602241718.u1OHItct089478@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Wed, 24 Feb 2016 17:18:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295982 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Feb 2016 17:18:57 -0000 Author: bdrewery Date: Wed Feb 24 17:18:55 2016 New Revision: 295982 URL: https://svnweb.freebsd.org/changeset/base/295982 Log: Follow-up r295667 with fixes for SRCS defined. cleandepend should always remove CLEANDEPEND* if they are not empty, but bsd.dep.mk should not add the tags entries unless SRCS is defined as it did before. The .depend file itself it still always removed to avoid accidentally keeping a stale one around as done in r295666. Sponsored by: EMC / Isilon Storage Division Modified: head/share/mk/bsd.dep.mk Modified: head/share/mk/bsd.dep.mk ============================================================================== --- head/share/mk/bsd.dep.mk Wed Feb 24 17:18:52 2016 (r295981) +++ head/share/mk/bsd.dep.mk Wed Feb 24 17:18:55 2016 (r295982) @@ -268,6 +268,7 @@ afterdepend: .endif .endif +.if defined(SRCS) .if ${CTAGS:T} == "gtags" CLEANDEPENDFILES+= GPATH GRTAGS GSYMS GTAGS .if defined(HTML) @@ -276,15 +277,16 @@ CLEANDEPENDDIRS+= HTML .else CLEANDEPENDFILES+= tags .endif +.endif .if !target(cleandepend) cleandepend: -.if defined(SRCS) +.if !empty(CLEANDEPENDFILES) rm -f ${CLEANDEPENDFILES} +.endif .if !empty(CLEANDEPENDDIRS) rm -rf ${CLEANDEPENDDIRS} .endif .endif -.endif .if !target(checkdpadd) && (defined(DPADD) || defined(LDADD)) _LDADD_FROM_DPADD= ${DPADD:R:T:C;^lib(.*)$;-l\1;g} From owner-svn-src-head@freebsd.org Wed Feb 24 17:19:03 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A5F54AB3170; Wed, 24 Feb 2016 17:19:03 +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 mx1.freebsd.org (Postfix) with ESMTPS id 52BF3178D; Wed, 24 Feb 2016 17:19:03 +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 u1OHJ2Kq089575; Wed, 24 Feb 2016 17:19:02 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1OHJ2ev089574; Wed, 24 Feb 2016 17:19:02 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201602241719.u1OHJ2ev089574@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Wed, 24 Feb 2016 17:19:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295984 - head/sys/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Feb 2016 17:19:03 -0000 Author: bdrewery Date: Wed Feb 24 17:19:02 2016 New Revision: 295984 URL: https://svnweb.freebsd.org/changeset/base/295984 Log: Support beforebuild in the kernel. Sponsored by: EMC / Isilon Storage Division Modified: head/sys/conf/kern.post.mk Modified: head/sys/conf/kern.post.mk ============================================================================== --- head/sys/conf/kern.post.mk Wed Feb 24 17:18:58 2016 (r295983) +++ head/sys/conf/kern.post.mk Wed Feb 24 17:19:02 2016 (r295984) @@ -86,7 +86,8 @@ ports-${__target}: .ORDER: kernel-install modules-install -kernel-all: ${KERNEL_KO} ${KERNEL_EXTRA} +beforebuild: .PHONY +kernel-all: beforebuild .WAIT ${KERNEL_KO} ${KERNEL_EXTRA} kernel-cleandir: kernel-clean kernel-cleandepend From owner-svn-src-head@freebsd.org Wed Feb 24 17:19:11 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3E64CAB31DE; Wed, 24 Feb 2016 17:19:11 +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 mx1.freebsd.org (Postfix) with ESMTPS id DFB201AF4; Wed, 24 Feb 2016 17:19:10 +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 u1OHJ91Y089673; Wed, 24 Feb 2016 17:19:09 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1OHJ9Ro089671; Wed, 24 Feb 2016 17:19:09 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201602241719.u1OHJ9Ro089671@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Wed, 24 Feb 2016 17:19:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295986 - in head: share/mk sys/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Feb 2016 17:19:11 -0000 Author: bdrewery Date: Wed Feb 24 17:19:09 2016 New Revision: 295986 URL: https://svnweb.freebsd.org/changeset/base/295986 Log: FAST_DEPEND: Don't waste time generating an empty .depend file. The .depend file will still be generated if _EXTRADEPEND is used. The target is kept with a dependency on DPSRCS though so that 'make depend' will generate all files. Sponsored by: EMC / Isilon Storage Division Modified: head/share/mk/bsd.dep.mk head/sys/conf/kern.post.mk Modified: head/share/mk/bsd.dep.mk ============================================================================== --- head/share/mk/bsd.dep.mk Wed Feb 24 17:19:05 2016 (r295985) +++ head/share/mk/bsd.dep.mk Wed Feb 24 17:19:09 2016 (r295986) @@ -246,6 +246,8 @@ MKDEP_CXXFLAGS= ${CXXFLAGS:M-nostdinc*} .endif # ${MK_FAST_DEPEND} == "no" DPSRCS+= ${SRCS} +# FAST_DEPEND will only generate a .depend if _EXTRADEPEND is used but +# the target is created to allow 'make depend' to generate files. ${DEPENDFILE}: ${DPSRCS} .if ${MK_FAST_DEPEND} == "no" rm -f ${DEPENDFILE} @@ -260,8 +262,6 @@ ${DEPENDFILE}: ${DPSRCS} ${.ALLSRC:M*.cc} ${.ALLSRC:M*.C} ${.ALLSRC:M*.cpp} ${.ALLSRC:M*.cxx} .else .endif -.else - : > ${.TARGET} .endif # ${MK_FAST_DEPEND} == "no" .if target(_EXTRADEPEND) _EXTRADEPEND: .USE Modified: head/sys/conf/kern.post.mk ============================================================================== --- head/sys/conf/kern.post.mk Wed Feb 24 17:19:05 2016 (r295985) +++ head/sys/conf/kern.post.mk Wed Feb 24 17:19:09 2016 (r295986) @@ -278,8 +278,6 @@ ${__obj}: ${OBJS_DEPEND_GUESS.${__obj}} ${MAKE} -V SFILES_CDDL | \ CC="${_MKDEPCC}" xargs mkdep -a -f ${.TARGET}.tmp ${ZFS_ASM_CFLAGS} mv ${.TARGET}.tmp ${.TARGET} -.else - : > ${.TARGET} .endif _ILINKS= machine From owner-svn-src-head@freebsd.org Wed Feb 24 17:19:00 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 78CE5AB315B; Wed, 24 Feb 2016 17:19:00 +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 mx1.freebsd.org (Postfix) with ESMTPS id 27E1315BB; Wed, 24 Feb 2016 17:19:00 +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 u1OHIxXa089526; Wed, 24 Feb 2016 17:18:59 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1OHIxYA089525; Wed, 24 Feb 2016 17:18:59 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201602241718.u1OHIxYA089525@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Wed, 24 Feb 2016 17:18:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295983 - head/sys/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Feb 2016 17:19:00 -0000 Author: bdrewery Date: Wed Feb 24 17:18:58 2016 New Revision: 295983 URL: https://svnweb.freebsd.org/changeset/base/295983 Log: Remove ilinks in cleandepend directly via CLEANDEPENDFILES. The 'cleanilinks' target is kept since it may still be useful as added in r200178, though never documented. Sponsored by: EMC / Isilon Storage Division Modified: head/sys/conf/kmod.mk Modified: head/sys/conf/kmod.mk ============================================================================== --- head/sys/conf/kmod.mk Wed Feb 24 17:18:55 2016 (r295982) +++ head/sys/conf/kmod.mk Wed Feb 24 17:18:58 2016 (r295983) @@ -452,7 +452,7 @@ ${OBJS}: opt_global.h .include -cleandepend: cleanilinks +CLEANDEPENDFILES+= ${_ILINKS} # .depend needs include links so we remove them only together. cleanilinks: rm -f ${_ILINKS} From owner-svn-src-head@freebsd.org Wed Feb 24 17:19:07 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C2F3EAB31A9; Wed, 24 Feb 2016 17:19:07 +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 mx1.freebsd.org (Postfix) with ESMTPS id 620C21981; Wed, 24 Feb 2016 17:19:07 +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 u1OHJ6Jh089627; Wed, 24 Feb 2016 17:19:06 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1OHJ5uX089622; Wed, 24 Feb 2016 17:19:05 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201602241719.u1OHJ5uX089622@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Wed, 24 Feb 2016 17:19:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295985 - in head: share/mk sys/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Feb 2016 17:19:07 -0000 Author: bdrewery Date: Wed Feb 24 17:19:05 2016 New Revision: 295985 URL: https://svnweb.freebsd.org/changeset/base/295985 Log: FAST_DEPEND: Rework how guessed dependencies are handled. Rather than depend on .depend not existing, check the actual .depend.OBJ file that will be used for that object. If it doesn't exist then use the guessed dependencies. FAST_DEPEND may never have a .depend file. Not having one means all of the previous logic would over-depend all object files on all headers which is not what we wanted. It also means that if a .depend is generated before a build is done for _EXTRADEPEND (such as for PROG or LIB) then all of these dependencies would not be used since the .depend wasn't generated from mkdep and the real .depend.* files are not generated until the build. Sponsored by: EMC / Isilon Storage Division Modified: head/share/mk/bsd.dep.mk head/share/mk/bsd.lib.mk head/share/mk/bsd.prog.mk head/sys/conf/kern.post.mk head/sys/conf/kmod.mk Modified: head/share/mk/bsd.dep.mk ============================================================================== --- head/share/mk/bsd.dep.mk Wed Feb 24 17:19:02 2016 (r295984) +++ head/share/mk/bsd.dep.mk Wed Feb 24 17:19:05 2016 (r295985) @@ -94,19 +94,21 @@ _SKIP_READ_DEPEND= 1 .if defined(SRCS) CLEANFILES?= -.if ${MK_FAST_DEPEND} == "yes" || !exists(${.OBJDIR}/${DEPENDFILE}) .for _S in ${SRCS:N*.[dhly]} -${_S:R}.o: ${_S} -.endfor +OBJS_DEPEND_GUESS.${_S:R}.o= ${_S} +.if ${MK_FAST_DEPEND} == "no" && !exists(${.OBJDIR}/${DEPENDFILE}) +${_S:R}.o: ${OBJS_DEPEND_GUESS.${_S:R}.o} .endif +.endfor # Lexical analyzers .for _LSRC in ${SRCS:M*.l:N*/*} .for _LC in ${_LSRC:R}.c ${_LC}: ${_LSRC} ${LEX} ${LFLAGS} -o${.TARGET} ${.ALLSRC} -.if ${MK_FAST_DEPEND} == "yes" || !exists(${.OBJDIR}/${DEPENDFILE}) -${_LC:R}.o: ${_LC} +OBJS_DEPEND_GUESS.${_LC:R}.o= ${_LC} +.if ${MK_FAST_DEPEND} == "no" && !exists(${.OBJDIR}/${DEPENDFILE}) +${_LC:R}.o: ${OBJS_DEPEND_GUESS.${_LC:R}.o} .endif SRCS:= ${SRCS:S/${_LSRC}/${_LC}/} CLEANFILES+= ${_LC} @@ -136,8 +138,9 @@ CLEANFILES+= ${_YH} ${_YC}: ${_YSRC} ${YACC} ${YFLAGS} -o ${_YC} ${.ALLSRC} .endif -.if ${MK_FAST_DEPEND} == "yes" || !exists(${.OBJDIR}/${DEPENDFILE}) -${_YC:R}.o: ${_YC} +OBJS_DEPEND_GUESS.${_YC:R}.o= ${_YC} +.if ${MK_FAST_DEPEND} == "no" && !exists(${.OBJDIR}/${DEPENDFILE}) +${_YC:R}.o: ${OBJS_DEPEND_GUESS.${_YC:R}.o} .endif .endfor .endfor @@ -195,7 +198,7 @@ DEPENDFILES_OBJS= ${DEPENDOBJS:O:u:${DEP .for __depend_obj in ${DEPENDFILES_OBJS} .sinclude "${__depend_obj}" .endfor -.endif +.endif # !defined(_SKIP_READ_DEPEND) .endif # ${MK_FAST_DEPEND} == "yes" .endif # defined(SRCS) @@ -208,6 +211,18 @@ beforedepend: afterdepend: beforedepend .endif +# Guess some dependencies for when no ${DEPENDFILE}.OBJ is generated yet. +# Done here to support meta mode as well which does not always need +# the CFLAGS modifications or .depend.* included. +.if ${MK_FAST_DEPEND} == "yes" +.for __obj in ${DEPENDOBJS:O:u} +.if !exists(${.OBJDIR}/${DEPENDFILE}.${__obj}) +${__obj}: ${OBJS_DEPEND_GUESS} +${__obj}: ${OBJS_DEPEND_GUESS.${__obj}} +.endif +.endfor +.endif + .if !target(depend) .if defined(SRCS) depend: beforedepend ${DEPENDFILE} afterdepend Modified: head/share/mk/bsd.lib.mk ============================================================================== --- head/share/mk/bsd.lib.mk Wed Feb 24 17:19:02 2016 (r295984) +++ head/share/mk/bsd.lib.mk Wed Feb 24 17:19:05 2016 (r295985) @@ -415,28 +415,31 @@ lint: ${SRCS:M*.c} .include .endif -.include - -.if ${MK_FAST_DEPEND} == "yes" || !exists(${.OBJDIR}/${DEPENDFILE}) .if defined(LIB) && !empty(LIB) -.if !exists(${.OBJDIR}/${DEPENDFILE}) -${OBJS} ${STATICOBJS} ${POBJS}: ${SRCS:M*.h} +OBJS_DEPEND_GUESS+= ${SRCS:M*.h} +.if ${MK_FAST_DEPEND} == "no" && !exists(${.OBJDIR}/${DEPENDFILE}) +${OBJS} ${STATICOBJS} ${POBJS}: ${OBJS_DEPEND_GUESS} .endif .for _S in ${SRCS:N*.[hly]} -${_S:R}.po: ${_S} +OBJS_DEPEND_GUESS.${_S:R}.po= ${_S} +.if ${MK_FAST_DEPEND} == "no" && !exists(${.OBJDIR}/${DEPENDFILE}) +${_S:R}.po: ${OBJS_DEPEND_GUESS.${_S:R}.po} +.endif .endfor .endif .if defined(SHLIB_NAME) || \ defined(INSTALL_PIC_ARCHIVE) && defined(LIB) && !empty(LIB) -.if !exists(${.OBJDIR}/${DEPENDFILE}) -${SOBJS}: ${SRCS:M*.h} +.if ${MK_FAST_DEPEND} == "no" && !exists(${.OBJDIR}/${DEPENDFILE}) +${SOBJS}: ${OBJS_DEPEND_GUESS} .endif .for _S in ${SRCS:N*.[hly]} -${_S:R}.So: ${_S} -.endfor +OBJS_DEPEND_GUESS.${_S:R}.So= ${_S} +.if ${MK_FAST_DEPEND} == "no" && !exists(${.OBJDIR}/${DEPENDFILE}) +${_S:R}.So: ${OBJS_DEPEND_GUESS.${_S:R}.So} .endif +.endfor .endif +.include .include - .include Modified: head/share/mk/bsd.prog.mk ============================================================================== --- head/share/mk/bsd.prog.mk Wed Feb 24 17:19:02 2016 (r295984) +++ head/share/mk/bsd.prog.mk Wed Feb 24 17:19:05 2016 (r295985) @@ -275,12 +275,13 @@ lint: ${SRCS:M*.c} .include .endif -.include - -.if defined(PROG) && !exists(${.OBJDIR}/${DEPENDFILE}) -${OBJS}: ${SRCS:M*.h} +.if defined(PROG) +OBJS_DEPEND_GUESS+= ${SRCS:M*.h} +.if ${MK_FAST_DEPEND} == "no" && !exists(${.OBJDIR}/${DEPENDFILE}) +${OBJS}: ${OBJS_DEPEND_GUESS} +.endif .endif +.include .include - .include Modified: head/sys/conf/kern.post.mk ============================================================================== --- head/sys/conf/kern.post.mk Wed Feb 24 17:19:02 2016 (r295984) +++ head/sys/conf/kern.post.mk Wed Feb 24 17:19:05 2016 (r295985) @@ -143,8 +143,10 @@ ${FULLKERNEL}: ${SYSTEM_DEP} vers.o .endif ${SYSTEM_LD_TAIL} -.if !exists(${.OBJDIR}/.depend) -${SYSTEM_OBJS}: assym.s vnode_if.h ${BEFORE_DEPEND:M*.h} ${MFILES:T:S/.m$/.h/} +OBJS_DEPEND_GUESS+= assym.s vnode_if.h ${BEFORE_DEPEND:M*.h} \ + ${MFILES:T:S/.m$/.h/} +.if ${MK_FAST_DEPEND} == "no" && !exists(${.OBJDIR}/.depend) +${SYSTEM_OBJS}: ${OBJS_DEPEND_GUESS} .endif LNFILES= ${CFILES:T:S/.c$/.ln/} @@ -239,10 +241,18 @@ CFLAGS+= ${DEPEND_CFLAGS} DEPENDOBJS+= ${SYSTEM_OBJS} genassym.o DEPENDFILES_OBJS= ${DEPENDOBJS:O:u:C/^/.depend./} .if !defined(_SKIP_READ_DEPEND) -.for __depend_obj in ${DEPENDFILES_OBJS} -.sinclude "${__depend_obj}" -.endfor +.for __obj in ${DEPENDOBJS} +.if exists(${.OBJDIR}/.depend.${__obj}) +.include ".depend.${__obj}" +.else +# Guess some dependencies for when no .depend.OBJ is generated yet. +.if ${SYSTEM_OBJS:M${__obj}} +${__obj}: ${OBJS_DEPEND_GUESS} .endif +${__obj}: ${OBJS_DEPEND_GUESS.${__obj}} +.endif +.endfor +.endif # !defined(_SKIP_READ_DEPEND) .endif # ${MK_FAST_DEPEND} == "yes" .NOPATH: .depend ${DEPENDFILES_OBJS} Modified: head/sys/conf/kmod.mk ============================================================================== --- head/sys/conf/kmod.mk Wed Feb 24 17:19:02 2016 (r295984) +++ head/sys/conf/kmod.mk Wed Feb 24 17:19:05 2016 (r295985) @@ -450,16 +450,16 @@ lint: ${SRCS} ${OBJS}: opt_global.h .endif -.include - CLEANDEPENDFILES+= ${_ILINKS} # .depend needs include links so we remove them only together. cleanilinks: rm -f ${_ILINKS} -.if !exists(${.OBJDIR}/${DEPENDFILE}) -${OBJS}: ${SRCS:M*.h} +OBJS_DEPEND_GUESS+= ${SRCS:M*.h} +.if ${MK_FAST_DEPEND} == "no" && !exists(${.OBJDIR}/${DEPENDFILE}) +${OBJS}: ${OBJS_DEPEND_GUESS} .endif +.include .include .include "kern.mk" From owner-svn-src-head@freebsd.org Wed Feb 24 17:19:15 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3CC3FAB3212; Wed, 24 Feb 2016 17:19:15 +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 mx1.freebsd.org (Postfix) with ESMTPS id ED4811CF4; Wed, 24 Feb 2016 17:19:14 +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 u1OHJDXX089725; Wed, 24 Feb 2016 17:19:13 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1OHJDJS089720; Wed, 24 Feb 2016 17:19:13 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201602241719.u1OHJDJS089720@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Wed, 24 Feb 2016 17:19:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295987 - in head: share/mk sys/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Feb 2016 17:19:15 -0000 Author: bdrewery Date: Wed Feb 24 17:19:13 2016 New Revision: 295987 URL: https://svnweb.freebsd.org/changeset/base/295987 Log: Hook the meta/nofilemon build into using FAST_DEPEND. FAST_DEPEND is intended to be the "skip 'make depend' and mkdep" feature. Since DIRDEPS_BUILD does this already with some of its own hacks, and filemon doesn't need this, and nofilemon does, teach it how to handle each of these cases. In meta+filemon mode filemon will handle dependencies itself via the meta mode logic in bmake. We still want to set MK_FAST_DEPEND=yes to enable some logic that indicates that 'make depend' is skipped in the traditional sense. The actual .depend.* files will be skipped. When nofilemon is set though we still need to track and generate dependencies. Sponsored by: EMC / Isilon Storage Division Modified: head/share/mk/bsd.dep.mk head/share/mk/bsd.opts.mk head/share/mk/local.meta.sys.mk head/sys/conf/kern.opts.mk head/sys/conf/kern.post.mk Modified: head/share/mk/bsd.dep.mk ============================================================================== --- head/share/mk/bsd.dep.mk Wed Feb 24 17:19:09 2016 (r295986) +++ head/share/mk/bsd.dep.mk Wed Feb 24 17:19:13 2016 (r295987) @@ -173,14 +173,24 @@ ${_D}.po: ${_DSRC} ${POBJS:S/^${_D}.po$/ .endfor -.if ${MK_FAST_DEPEND} == "yes" && \ - (${.MAKE.MODE:Mmeta} == "" || ${.MAKE.MODE:Mnofilemon} != "") +.if !empty(.MAKE.MODE:Mmeta) && empty(.MAKE.MODE:Mnofilemon) +_meta_filemon= 1 +.endif +.if ${MK_FAST_DEPEND} == "yes" DEPEND_MP?= -MP # Handle OBJS=../somefile.o hacks. Just replace '/' rather than use :T to # avoid collisions. DEPEND_FILTER= C,/,_,g +DEPENDSRCS= ${SRCS:M*.[cSC]} ${SRCS:M*.cxx} ${SRCS:M*.cpp} ${SRCS:M*.cc} +.if !empty(DEPENDSRCS) +DEPENDOBJS+= ${DEPENDSRCS:R:S,$,.o,} +.endif +DEPENDFILES_OBJS= ${DEPENDOBJS:O:u:${DEPEND_FILTER}:C/^/${DEPENDFILE}./} DEPEND_CFLAGS+= -MD ${DEPEND_MP} -MF${DEPENDFILE}.${.TARGET:${DEPEND_FILTER}} DEPEND_CFLAGS+= -MT${.TARGET} +# Skip generating or including .depend.* files if in meta+filemon mode since +# it will track dependencies itself. OBJS_DEPEND_GUESS is still used though. +.if !defined(_meta_filemon) .if defined(.PARSEDIR) # Only add in DEPEND_CFLAGS for CFLAGS on files we expect from DEPENDOBJS # as those are the only ones we will include. @@ -189,34 +199,34 @@ CFLAGS+= ${${DEPEND_CFLAGS_CONDITION}:?$ .else CFLAGS+= ${DEPEND_CFLAGS} .endif -DEPENDSRCS= ${SRCS:M*.[cSC]} ${SRCS:M*.cxx} ${SRCS:M*.cpp} ${SRCS:M*.cc} -.if !empty(DEPENDSRCS) -DEPENDOBJS+= ${DEPENDSRCS:R:S,$,.o,} -.endif -DEPENDFILES_OBJS= ${DEPENDOBJS:O:u:${DEPEND_FILTER}:C/^/${DEPENDFILE}./} .if !defined(_SKIP_READ_DEPEND) .for __depend_obj in ${DEPENDFILES_OBJS} .sinclude "${__depend_obj}" .endfor .endif # !defined(_SKIP_READ_DEPEND) +.endif # !defined(_meta_filemon) .endif # ${MK_FAST_DEPEND} == "yes" .endif # defined(SRCS) .if ${MK_DIRDEPS_BUILD} == "yes" .include +# If using filemon then _EXTRADEPEND is skipped since it is not needed. +.if empty(.MAKE.MODE:Mnofilemon) # this depend: bypasses that below # the dependency helps when bootstrapping depend: beforedepend ${DPSRCS} ${SRCS} afterdepend beforedepend: afterdepend: beforedepend .endif +.endif # Guess some dependencies for when no ${DEPENDFILE}.OBJ is generated yet. -# Done here to support meta mode as well which does not always need -# the CFLAGS modifications or .depend.* included. +# For meta+filemon the .meta file is checked for since it is the dependency +# file used. .if ${MK_FAST_DEPEND} == "yes" .for __obj in ${DEPENDOBJS:O:u} -.if !exists(${.OBJDIR}/${DEPENDFILE}.${__obj}) +.if (defined(_meta_filemon) && !exists(${.OBJDIR}/${__obj}.meta)) || \ + (!defined(_meta_filemon) && !exists(${.OBJDIR}/${DEPENDFILE}.${__obj})) ${__obj}: ${OBJS_DEPEND_GUESS} ${__obj}: ${OBJS_DEPEND_GUESS.${__obj}} .endif Modified: head/share/mk/bsd.opts.mk ============================================================================== --- head/share/mk/bsd.opts.mk Wed Feb 24 17:19:09 2016 (r295986) +++ head/share/mk/bsd.opts.mk Wed Feb 24 17:19:13 2016 (r295987) @@ -77,7 +77,14 @@ __DEFAULT_NO_OPTIONS = \ __DEFAULT_DEPENDENT_OPTIONS = \ STAGING_MAN/STAGING \ STAGING_PROG/STAGING \ - + + +# Enable FAST_DEPEND by default for the meta build. +.if !empty(.MAKE.MODE:Mmeta) +__DEFAULT_YES_OPTIONS+= FAST_DEPEND +__DEFAULT_NO_OPTIONS:= ${__DEFAULT_NO_OPTIONS:NFAST_DEPEND} +.endif + .include # Modified: head/share/mk/local.meta.sys.mk ============================================================================== --- head/share/mk/local.meta.sys.mk Wed Feb 24 17:19:09 2016 (r295986) +++ head/share/mk/local.meta.sys.mk Wed Feb 24 17:19:13 2016 (r295987) @@ -6,6 +6,7 @@ # we need this until there is an alternative MK_INSTALL_AS_USER= yes +MK_FAST_DEPEND= yes _default_makeobjdir=$${.CURDIR:S,^$${SRCTOP},$${OBJTOP},} Modified: head/sys/conf/kern.opts.mk ============================================================================== --- head/sys/conf/kern.opts.mk Wed Feb 24 17:19:09 2016 (r295986) +++ head/sys/conf/kern.opts.mk Wed Feb 24 17:19:13 2016 (r295987) @@ -49,6 +49,12 @@ __DEFAULT_NO_OPTIONS = \ NAND \ OFED +# Enable FAST_DEPEND by default for the meta build. +.if !empty(.MAKE.MODE:Unormal:Mmeta) +__DEFAULT_YES_OPTIONS+= FAST_DEPEND +__DEFAULT_NO_OPTIONS:= ${__DEFAULT_NO_OPTIONS:NFAST_DEPEND} +.endif + # Some options are totally broken on some architectures. We disable # them. If you need to enable them on an experimental basis, you # must change this code. Modified: head/sys/conf/kern.post.mk ============================================================================== --- head/sys/conf/kern.post.mk Wed Feb 24 17:19:09 2016 (r295986) +++ head/sys/conf/kern.post.mk Wed Feb 24 17:19:13 2016 (r295987) @@ -226,10 +226,17 @@ SRCS= assym.s vnode_if.h ${BEFORE_DEPEND ${SYSTEM_CFILES} ${GEN_CFILES} ${SFILES} \ ${MFILES:T:S/.m$/.h/} DEPENDFILES= .depend .depend.* -.if ${MK_FAST_DEPEND} == "yes" && \ - (${.MAKE.MODE:Unormal:Mmeta} == "" || ${.MAKE.MODE:Unormal:Mnofilemon} != "") +# Skip generating or including .depend.* files if in meta+filemon mode since +# it will track dependencies itself. OBJS_DEPEND_GUESS is still used though. +.if !empty(.MAKE.MODE:Unormal:Mmeta) && empty(.MAKE.MODE:Unormal:Mnofilemon) +_meta_filemon= 1 +.endif +.if ${MK_FAST_DEPEND} == "yes" +DEPENDOBJS+= ${SYSTEM_OBJS} genassym.o +DEPENDFILES_OBJS= ${DEPENDOBJS:O:u:C/^/.depend./} DEPEND_CFLAGS+= -MD -MP -MF.depend.${.TARGET} DEPEND_CFLAGS+= -MT${.TARGET} +.if !defined(_meta_filemon) .if defined(.PARSEDIR) # Only add in DEPEND_CFLAGS for CFLAGS on files we expect from DEPENDOBJS # as those are the only ones we will include. @@ -238,22 +245,28 @@ CFLAGS+= ${${DEPEND_CFLAGS_CONDITION}:?$ .else CFLAGS+= ${DEPEND_CFLAGS} .endif -DEPENDOBJS+= ${SYSTEM_OBJS} genassym.o -DEPENDFILES_OBJS= ${DEPENDOBJS:O:u:C/^/.depend./} .if !defined(_SKIP_READ_DEPEND) -.for __obj in ${DEPENDOBJS} -.if exists(${.OBJDIR}/.depend.${__obj}) -.include ".depend.${__obj}" -.else -# Guess some dependencies for when no .depend.OBJ is generated yet. +.for __depend_obj in ${DEPENDFILES_OBJS} +.sinclude "${__depend_obj}" +.endfor +.endif # !defined(_SKIP_READ_DEPEND) +.endif # !defined(_meta_filemon) +.endif # ${MK_FAST_DEPEND} == "yes" + +# Guess some dependencies for when no ${DEPENDFILE}.OBJ is generated yet. +# For meta+filemon the .meta file is checked for since it is the dependency +# file used. +.if ${MK_FAST_DEPEND} == "yes" +.for __obj in ${DEPENDOBJS:O:u} +.if (defined(_meta_filemon) && !exists(${.OBJDIR}/${__obj}.meta)) || \ + (!defined(_meta_filemon) && !exists(${.OBJDIR}/.depend.${__obj})) .if ${SYSTEM_OBJS:M${__obj}} ${__obj}: ${OBJS_DEPEND_GUESS} .endif ${__obj}: ${OBJS_DEPEND_GUESS.${__obj}} .endif .endfor -.endif # !defined(_SKIP_READ_DEPEND) -.endif # ${MK_FAST_DEPEND} == "yes" +.endif .NOPATH: .depend ${DEPENDFILES_OBJS} From owner-svn-src-head@freebsd.org Wed Feb 24 17:19:20 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 72567AB3273; Wed, 24 Feb 2016 17:19:20 +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 mx1.freebsd.org (Postfix) with ESMTPS id 19D2B1EE1; Wed, 24 Feb 2016 17:19:20 +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 u1OHJJZ7089776; Wed, 24 Feb 2016 17:19:19 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1OHJI1d089769; Wed, 24 Feb 2016 17:19:18 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201602241719.u1OHJI1d089769@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Wed, 24 Feb 2016 17:19:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295988 - in head: kerberos5/lib/libasn1 kerberos5/lib/libhdb kerberos5/lib/libheimntlm kerberos5/lib/libhx509 lib/clang share/mk sys/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Feb 2016 17:19:20 -0000 Author: bdrewery Date: Wed Feb 24 17:19:18 2016 New Revision: 295988 URL: https://svnweb.freebsd.org/changeset/base/295988 Log: FAST_DEPEND: Always run depend via beforebuild which removes many hacks. This will generate dependencies rather than depending on the previous behavior of depending on the guessed OBJS: *.h dependecies or a user running 'make depend'. Experimentation showed that depending only on headers was not enough and prone to .ORDER errors. Downstream users may also have added dependencies into beforedepend or afterdepend targets. The safest way to ensure dependencies are generated before build is to run 'make depend' beforehand rather than just depending on DPSRCS+SRCS. Note that the OBJS_DEPEND_GUESS mechanism (a.k.a .if !exists(.depend) then foo.o: *.h) is still useful as it improves incremental builds with missing .depend.* files and allows 'make foo.o' to usually work, while this 'beforebuild: depend' ensures that the build will always find all dependencies. The 'make foo.o' case has no means of a 'beforebuild' hook. This also removes several hacks in the DIRDEPS_BUILD: - NO_INSTALL_INCLUDES is no longer needed as it mostly was to work around .ORDER problems with building the needed headers early. - DIRDEPS_BUILD: It is no longer necesarry to track "local dependencies" in Makefile.depend. These were only in Makefile.depend for 'clean builds' since nothing would generate the files due to skipping 'make depend' and early dependency bugs that have been fixed, such as adding headers into SRCS for the OBJS_DEPEND_GUESS mechanism. Normally if a .depend file does not exist then a dependency is added by bsd.lib.mk/bsd.prog.mk from OBJS: *.h. However, meta.autodep.mk creates a .depend file from created meta files and inserts that into Makefile.depend. It also only tracks *.[ch] files though which can miss some dependencies that are hooked into 'make depend'. This .depend that is created then breaks incremental builds due to the !exists(.depend) checks for OBJS_DEPEND_GUESS. The goal was to skip 'make depend' yet it only really works the first time. After that files are not generated as expected, which r288966 tried to address but was using buildfiles: rather than beforebuild: and was reverted in r291725. As noted previously, depending only on headers in beforebuild: would create .ORDER errors in some cases. meta.autodep.mk is still used to generate Makefile.depend though via: gendirdeps: Makefile.depend .END: gendirdeps This commit allows removing all of the "local dependencies" in Makefile.depend which cuts down on churn and removes some of the arch-dependent Makefile.depend files. The "local dependencies" were also problematic for bootstrapping. Sponsored by: EMC / Isilon Storage Division Modified: head/kerberos5/lib/libasn1/Makefile head/kerberos5/lib/libhdb/Makefile head/kerberos5/lib/libheimntlm/Makefile head/kerberos5/lib/libhx509/Makefile head/lib/clang/clang.build.mk head/share/mk/bsd.dep.mk head/sys/conf/kern.post.mk Modified: head/kerberos5/lib/libasn1/Makefile ============================================================================== --- head/kerberos5/lib/libasn1/Makefile Wed Feb 24 17:19:13 2016 (r295987) +++ head/kerberos5/lib/libasn1/Makefile Wed Feb 24 17:19:18 2016 (r295988) @@ -116,11 +116,6 @@ ${GEN_KX509}: kx509.asn1 .hx.h: ${CP} ${.IMPSRC} ${.TARGET} -# This makefile generates a lot of its headers -# so tell bsd.sys.mk not to try and stage them before they are built. -# Note: this is rare -NO_BEFOREBUILD_INCLUDES= - .include .SUFFIXES: .h .c .x .hx Modified: head/kerberos5/lib/libhdb/Makefile ============================================================================== --- head/kerberos5/lib/libhdb/Makefile Wed Feb 24 17:19:13 2016 (r295987) +++ head/kerberos5/lib/libhdb/Makefile Wed Feb 24 17:19:18 2016 (r295988) @@ -97,11 +97,6 @@ ${GEN}: hdb.asn1 .hx.h: ${CP} ${.IMPSRC} ${.TARGET} -# This makefile generates a lot of its headers -# so tell bsd.sys.mk not to try and stage them before they are built. -# Note: this is rare -NO_BEFOREBUILD_INCLUDES= - .include .SUFFIXES: .h .c .x .hx Modified: head/kerberos5/lib/libheimntlm/Makefile ============================================================================== --- head/kerberos5/lib/libheimntlm/Makefile Wed Feb 24 17:19:13 2016 (r295987) +++ head/kerberos5/lib/libheimntlm/Makefile Wed Feb 24 17:19:18 2016 (r295988) @@ -3,7 +3,7 @@ LIB= heimntlm LDFLAGS= -Wl,--no-undefined LIBADD= crypto com_err krb5 roken -SRCS= ntlm.c ntlm_err.c +SRCS= ntlm.c ntlm_err.c ntlm_err.h INCS= heimntlm.h heimntlm-protos.h ntlm_err.h CFLAGS+=-I${KRB5DIR}/lib/ntlm -I${KRB5DIR}/lib/roken VERSION_MAP= ${KRB5DIR}/lib/ntlm/version-script.map Modified: head/kerberos5/lib/libhx509/Makefile ============================================================================== --- head/kerberos5/lib/libhx509/Makefile Wed Feb 24 17:19:13 2016 (r295987) +++ head/kerberos5/lib/libhx509/Makefile Wed Feb 24 17:19:18 2016 (r295988) @@ -290,11 +290,6 @@ ${GEN_CRMF}: crmf.asn1 .hx.h: ${CP} ${.IMPSRC} ${.TARGET} -# This makefile generates a lot of its headers -# so tell bsd.sys.mk not to try and stage them before they are built. -# Note: this is rare -NO_BEFOREBUILD_INCLUDES= - .include .SUFFIXES: .h .c .x .hx Modified: head/lib/clang/clang.build.mk ============================================================================== --- head/lib/clang/clang.build.mk Wed Feb 24 17:19:13 2016 (r295987) +++ head/lib/clang/clang.build.mk Wed Feb 24 17:19:18 2016 (r295988) @@ -237,7 +237,3 @@ Checkers.inc.h: ${CLANG_SRCS}/lib/Static SRCS+= ${TGHDRS:C/$/.inc.h/} CLEANFILES+= ${TGHDRS:C/$/.inc.h/} ${TGHDRS:C/$/.inc.d/} - -# if we are not doing explicit 'make depend', there is -# nothing to cause these to be generated. -beforebuild: ${SRCS:M*.inc.h} Modified: head/share/mk/bsd.dep.mk ============================================================================== --- head/share/mk/bsd.dep.mk Wed Feb 24 17:19:13 2016 (r295987) +++ head/share/mk/bsd.dep.mk Wed Feb 24 17:19:18 2016 (r295988) @@ -209,6 +209,8 @@ CFLAGS+= ${DEPEND_CFLAGS} .endif # defined(SRCS) .if ${MK_DIRDEPS_BUILD} == "yes" +# Prevent meta.autodep.mk from tracking "local dependencies". +.depend: .include # If using filemon then _EXTRADEPEND is skipped since it is not needed. .if empty(.MAKE.MODE:Mnofilemon) @@ -231,7 +233,14 @@ ${__obj}: ${OBJS_DEPEND_GUESS} ${__obj}: ${OBJS_DEPEND_GUESS.${__obj}} .endif .endfor + +# Always run 'make depend' to generate dependencies early and to avoid the +# need for manually running it. The dirdeps build should only do this in +# sub-makes though since MAKELEVEL0 is for dirdeps calculations. +.if ${MK_DIRDEPS_BUILD} == "no" || ${.MAKE.LEVEL} > 0 +beforebuild: depend .endif +.endif # ${MK_FAST_DEPEND} == "yes" .if !target(depend) .if defined(SRCS) Modified: head/sys/conf/kern.post.mk ============================================================================== --- head/sys/conf/kern.post.mk Wed Feb 24 17:19:13 2016 (r295987) +++ head/sys/conf/kern.post.mk Wed Feb 24 17:19:18 2016 (r295988) @@ -251,6 +251,12 @@ CFLAGS+= ${DEPEND_CFLAGS} .endfor .endif # !defined(_SKIP_READ_DEPEND) .endif # !defined(_meta_filemon) + +# Always run 'make depend' to generate dependencies early and to avoid the +# need for manually running it. For the kernel this is mostly a NOP since +# all dependencies are correctly added or accounted for. This is mostly to +# ensure downstream uses of kernel-depend are handled. +beforebuild: kernel-depend .endif # ${MK_FAST_DEPEND} == "yes" # Guess some dependencies for when no ${DEPENDFILE}.OBJ is generated yet. From owner-svn-src-head@freebsd.org Wed Feb 24 17:20:13 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C3F20AB3384; Wed, 24 Feb 2016 17:20:13 +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 mx1.freebsd.org (Postfix) with ESMTPS id 8C56F1230; Wed, 24 Feb 2016 17:20:13 +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 u1OHKCYR089872; Wed, 24 Feb 2016 17:20:12 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1OHKBAU089859; Wed, 24 Feb 2016 17:20:11 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201602241720.u1OHKBAU089859@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Wed, 24 Feb 2016 17:20:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295989 - in head: bin/csh bin/expr bin/rmail bin/sh cddl/lib/libdtrace gnu/lib/csu gnu/lib/libgcc gnu/lib/libgcov gnu/lib/libgomp gnu/lib/libregex gnu/lib/libstdc++ gnu/lib/libsupc++ g... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Feb 2016 17:20:13 -0000 Author: bdrewery Date: Wed Feb 24 17:20:11 2016 New Revision: 295989 URL: https://svnweb.freebsd.org/changeset/base/295989 Log: DIRDEPS_BUILD: Regenerate without local dependencies. These are no longer needed after the recent 'beforebuild: depend' changes and hooking DIRDEPS_BUILD into a subset of FAST_DEPEND which supports skipping 'make depend'. Sponsored by: EMC / Isilon Storage Division Added: head/gnu/usr.bin/binutils/ld/Makefile.depend - copied, changed from r295988, head/bin/expr/Makefile.depend head/gnu/usr.bin/binutils/libbfd/Makefile.depend - copied, changed from r295988, head/gnu/usr.bin/cc/libcpp/Makefile.depend head/gnu/usr.bin/gdb/kgdb/Makefile.depend - copied, changed from r295988, head/gnu/usr.bin/gdb/gdb/Makefile.depend head/gnu/usr.bin/gdb/libgdb/Makefile.depend - copied, changed from r295988, head/usr.sbin/ntp/libntp/Makefile.depend Deleted: head/gnu/usr.bin/binutils/ld/Makefile.depend.amd64 head/gnu/usr.bin/binutils/libbfd/Makefile.depend.amd64 head/gnu/usr.bin/gdb/kgdb/Makefile.depend.amd64 head/gnu/usr.bin/gdb/libgdb/Makefile.depend.amd64 Modified: head/bin/csh/Makefile.depend head/bin/expr/Makefile.depend head/bin/rmail/Makefile.depend head/bin/sh/Makefile.depend head/cddl/lib/libdtrace/Makefile.depend head/gnu/lib/csu/Makefile.depend head/gnu/lib/libgcc/Makefile.depend head/gnu/lib/libgcov/Makefile.depend head/gnu/lib/libgomp/Makefile.depend head/gnu/lib/libregex/Makefile.depend head/gnu/lib/libstdc++/Makefile.depend head/gnu/lib/libsupc++/Makefile.depend head/gnu/usr.bin/binutils/ld/Makefile.depend.host head/gnu/usr.bin/binutils/libbfd/Makefile.depend.host head/gnu/usr.bin/binutils/libbinutils/Makefile.depend head/gnu/usr.bin/cc/cc1/Makefile.depend head/gnu/usr.bin/cc/cc1plus/Makefile.depend head/gnu/usr.bin/cc/cc_tools/Makefile.depend head/gnu/usr.bin/cc/libcpp/Makefile.depend head/gnu/usr.bin/diff3/Makefile.depend head/gnu/usr.bin/dtc/Makefile.depend head/gnu/usr.bin/gdb/gdb/Makefile.depend head/gnu/usr.bin/gdb/gdbtui/Makefile.depend head/gnu/usr.bin/groff/src/libs/libgroff/Makefile.depend head/gnu/usr.bin/groff/src/preproc/eqn/Makefile.depend head/gnu/usr.bin/groff/src/preproc/pic/Makefile.depend head/gnu/usr.bin/groff/src/preproc/refer/Makefile.depend head/gnu/usr.bin/groff/src/roff/troff/Makefile.depend head/gnu/usr.bin/sdiff/Makefile.depend head/kerberos5/lib/libasn1/Makefile.depend head/kerberos5/lib/libgssapi_krb5/Makefile.depend head/kerberos5/lib/libgssapi_spnego/Makefile.depend head/kerberos5/lib/libhdb/Makefile.depend head/kerberos5/lib/libheimntlm/Makefile.depend head/kerberos5/lib/libhx509/Makefile.depend head/kerberos5/lib/libkadm5clnt/Makefile.depend head/kerberos5/lib/libkadm5srv/Makefile.depend head/kerberos5/lib/libkrb5/Makefile.depend head/kerberos5/lib/libroken/Makefile.depend head/kerberos5/lib/libvers/Makefile.depend head/kerberos5/lib/libwind/Makefile.depend head/kerberos5/libexec/ipropd-master/Makefile.depend head/kerberos5/libexec/ipropd-slave/Makefile.depend head/kerberos5/libexec/kdigest/Makefile.depend head/kerberos5/tools/asn1_compile/Makefile.depend head/kerberos5/tools/make-roken/Makefile.depend head/kerberos5/tools/slc/Makefile.depend head/kerberos5/usr.bin/hxtool/Makefile.depend head/kerberos5/usr.bin/kadmin/Makefile.depend head/kerberos5/usr.bin/kcc/Makefile.depend head/kerberos5/usr.sbin/iprop-log/Makefile.depend head/kerberos5/usr.sbin/ktutil/Makefile.depend head/lib/clang/libclanganalysis/Makefile.depend head/lib/clang/libclangarcmigrate/Makefile.depend head/lib/clang/libclangast/Makefile.depend head/lib/clang/libclangbasic/Makefile.depend head/lib/clang/libclangcodegen/Makefile.depend head/lib/clang/libclangdriver/Makefile.depend head/lib/clang/libclangedit/Makefile.depend head/lib/clang/libclangfrontend/Makefile.depend head/lib/clang/libclangfrontendtool/Makefile.depend head/lib/clang/libclanglex/Makefile.depend head/lib/clang/libclangparse/Makefile.depend head/lib/clang/libclangrewrite/Makefile.depend head/lib/clang/libclangrewritefrontend/Makefile.depend head/lib/clang/libclangsema/Makefile.depend head/lib/clang/libclangserialization/Makefile.depend head/lib/clang/libclangstaticanalyzercheckers/Makefile.depend head/lib/clang/libclangstaticanalyzercore/Makefile.depend head/lib/clang/libclangstaticanalyzerfrontend/Makefile.depend head/lib/clang/liblldbAPI/Makefile.depend head/lib/clang/liblldbBreakpoint/Makefile.depend head/lib/clang/liblldbCommands/Makefile.depend head/lib/clang/liblldbCore/Makefile.depend head/lib/clang/liblldbDataFormatters/Makefile.depend head/lib/clang/liblldbExpression/Makefile.depend head/lib/clang/liblldbInterpreter/Makefile.depend head/lib/clang/liblldbPluginABISysV_arm/Makefile.depend head/lib/clang/liblldbPluginABISysV_arm64/Makefile.depend head/lib/clang/liblldbPluginABISysV_i386/Makefile.depend head/lib/clang/liblldbPluginABISysV_mips/Makefile.depend head/lib/clang/liblldbPluginABISysV_mips64/Makefile.depend head/lib/clang/liblldbPluginABISysV_ppc/Makefile.depend head/lib/clang/liblldbPluginABISysV_ppc64/Makefile.depend head/lib/clang/liblldbPluginABISysV_x86_64/Makefile.depend head/lib/clang/liblldbPluginCXXItaniumABI/Makefile.depend head/lib/clang/liblldbPluginDynamicLoaderPosixDYLD/Makefile.depend head/lib/clang/liblldbPluginInstrumentationRuntimeAddressSanitizer/Makefile.depend head/lib/clang/liblldbPluginJITLoaderGDB/Makefile.depend head/lib/clang/liblldbPluginMemoryHistoryASan/Makefile.depend head/lib/clang/liblldbPluginProcessFreeBSD/Makefile.depend head/lib/clang/liblldbPluginProcessGDBRemote/Makefile.depend head/lib/clang/liblldbPluginProcessUtility/Makefile.depend head/lib/clang/liblldbPluginSymbolFileDWARF/Makefile.depend head/lib/clang/liblldbPluginSymbolFileSymtab/Makefile.depend head/lib/clang/liblldbPluginSymbolVendorELF/Makefile.depend head/lib/clang/liblldbSymbol/Makefile.depend head/lib/clang/liblldbTarget/Makefile.depend head/lib/clang/libllvmaarch64asmparser/Makefile.depend head/lib/clang/libllvmaarch64codegen/Makefile.depend head/lib/clang/libllvmaarch64desc/Makefile.depend head/lib/clang/libllvmaarch64disassembler/Makefile.depend head/lib/clang/libllvmaarch64instprinter/Makefile.depend head/lib/clang/libllvmaarch64utils/Makefile.depend head/lib/clang/libllvmanalysis/Makefile.depend head/lib/clang/libllvmarmasmparser/Makefile.depend head/lib/clang/libllvmarmcodegen/Makefile.depend head/lib/clang/libllvmarmdesc/Makefile.depend head/lib/clang/libllvmarmdisassembler/Makefile.depend head/lib/clang/libllvmarminfo/Makefile.depend head/lib/clang/libllvmarminstprinter/Makefile.depend head/lib/clang/libllvmasmprinter/Makefile.depend head/lib/clang/libllvmbitreader/Makefile.depend head/lib/clang/libllvmcodegen/Makefile.depend head/lib/clang/libllvmcore/Makefile.depend head/lib/clang/libllvminstcombine/Makefile.depend head/lib/clang/libllvminstrumentation/Makefile.depend head/lib/clang/libllvminterpreter/Makefile.depend head/lib/clang/libllvmipa/Makefile.depend head/lib/clang/libllvmipo/Makefile.depend head/lib/clang/libllvmlibdriver/Makefile.depend head/lib/clang/libllvmlto/Makefile.depend head/lib/clang/libllvmmipsasmparser/Makefile.depend head/lib/clang/libllvmmipscodegen/Makefile.depend head/lib/clang/libllvmmipsdesc/Makefile.depend head/lib/clang/libllvmmipsdisassembler/Makefile.depend head/lib/clang/libllvmmipsinfo/Makefile.depend head/lib/clang/libllvmmipsinstprinter/Makefile.depend head/lib/clang/libllvmobjcarcopts/Makefile.depend head/lib/clang/libllvmpasses/Makefile.depend head/lib/clang/libllvmpowerpcasmparser/Makefile.depend head/lib/clang/libllvmpowerpccodegen/Makefile.depend head/lib/clang/libllvmpowerpcdesc/Makefile.depend head/lib/clang/libllvmpowerpcdisassembler/Makefile.depend head/lib/clang/libllvmpowerpcinfo/Makefile.depend head/lib/clang/libllvmpowerpcinstprinter/Makefile.depend head/lib/clang/libllvmscalaropts/Makefile.depend head/lib/clang/libllvmselectiondag/Makefile.depend head/lib/clang/libllvmsparcasmparser/Makefile.depend head/lib/clang/libllvmsparccodegen/Makefile.depend head/lib/clang/libllvmsparcdesc/Makefile.depend head/lib/clang/libllvmsparcdisassembler/Makefile.depend head/lib/clang/libllvmsparcinfo/Makefile.depend head/lib/clang/libllvmsparcinstprinter/Makefile.depend head/lib/clang/libllvmtarget/Makefile.depend head/lib/clang/libllvmtransformutils/Makefile.depend head/lib/clang/libllvmvectorize/Makefile.depend head/lib/clang/libllvmx86asmparser/Makefile.depend head/lib/clang/libllvmx86codegen/Makefile.depend head/lib/clang/libllvmx86desc/Makefile.depend head/lib/clang/libllvmx86disassembler/Makefile.depend head/lib/clang/libllvmx86info/Makefile.depend head/lib/clang/libllvmx86instprinter/Makefile.depend head/lib/libc++/Makefile.depend head/lib/libc/Makefile.depend head/lib/libdwarf/Makefile.depend head/lib/libedit/Makefile.depend head/lib/libelf/Makefile.depend head/lib/libfetch/Makefile.depend head/lib/libipsec/Makefile.depend head/lib/libmd/Makefile.depend head/lib/libmilter/Makefile.depend head/lib/libpcap/Makefile.depend head/lib/librpcsvc/Makefile.depend head/lib/libsm/Makefile.depend head/lib/libsmdb/Makefile.depend head/lib/libsmutil/Makefile.depend head/lib/libstand/Makefile.depend head/lib/libsysdecode/Makefile.depend head/lib/libunbound/Makefile.depend head/lib/libypclnt/Makefile.depend head/lib/ncurses/form/Makefile.depend head/lib/ncurses/formw/Makefile.depend head/lib/ncurses/menu/Makefile.depend head/lib/ncurses/menuw/Makefile.depend head/lib/ncurses/ncurses/Makefile.depend head/lib/ncurses/ncursesw/Makefile.depend head/lib/ncurses/panel/Makefile.depend head/lib/ncurses/panelw/Makefile.depend head/libexec/dma/dmagent/Makefile.depend head/libexec/ftpd/Makefile.depend head/libexec/mail.local/Makefile.depend head/libexec/smrsh/Makefile.depend head/libexec/ypxfr/Makefile.depend head/sbin/atm/atmconfig/Makefile.depend head/sbin/devd/Makefile.depend head/sbin/gbde/Makefile.depend head/sbin/hastctl/Makefile.depend head/sbin/hastd/Makefile.depend head/sbin/ipf/ipf/Makefile.depend head/sbin/ipf/ipftest/Makefile.depend head/sbin/ipf/ipmon/Makefile.depend head/sbin/ipf/ipnat/Makefile.depend head/sbin/ipf/ippool/Makefile.depend head/sbin/pfctl/Makefile.depend head/sbin/route/Makefile.depend head/sbin/setkey/Makefile.depend head/secure/lib/libcrypto/Makefile.depend head/sys/boot/efi/loader/Makefile.depend head/sys/boot/ficl/Makefile.depend head/sys/boot/ficl32/Makefile.depend head/sys/boot/i386/loader/Makefile.depend head/sys/boot/i386/zfsloader/Makefile.depend head/sys/boot/libstand32/Makefile.depend head/sys/boot/userboot/ficl/Makefile.depend head/sys/boot/userboot/libstand/Makefile.depend head/sys/boot/userboot/userboot/Makefile.depend head/sys/modules/filemon/Makefile.depend head/tools/tools/ath/ath_ee_9300_print/Makefile.depend head/usr.bin/ar/Makefile.depend head/usr.bin/awk/Makefile.depend head/usr.bin/bc/Makefile.depend head/usr.bin/clang/bugpoint/Makefile.depend head/usr.bin/clang/clang/Makefile.depend head/usr.bin/clang/llc/Makefile.depend head/usr.bin/clang/llvm-dis/Makefile.depend head/usr.bin/clang/llvm-lto/Makefile.depend head/usr.bin/clang/opt/Makefile.depend head/usr.bin/colldef/Makefile.depend head/usr.bin/compile_et/Makefile.depend head/usr.bin/find/Makefile.depend head/usr.bin/getconf/Makefile.depend head/usr.bin/iscsictl/Makefile.depend head/usr.bin/kdump/Makefile.depend head/usr.bin/lex/Makefile.depend head/usr.bin/localedef/Makefile.depend head/usr.bin/m4/Makefile.depend head/usr.bin/mkcsmapper/Makefile.depend head/usr.bin/mkcsmapper_static/Makefile.depend head/usr.bin/mkesdb/Makefile.depend head/usr.bin/mkesdb_static/Makefile.depend head/usr.bin/mklocale/Makefile.depend head/usr.bin/netstat/Makefile.depend head/usr.bin/top/Makefile.depend head/usr.bin/vacation/Makefile.depend head/usr.bin/xlint/lint1/Makefile.depend head/usr.sbin/acpi/iasl/Makefile.depend head/usr.sbin/amd/amd/Makefile.depend head/usr.sbin/amd/fsinfo/Makefile.depend head/usr.sbin/amd/libamu/Makefile.depend head/usr.sbin/apmd/Makefile.depend head/usr.sbin/auditdistd/Makefile.depend head/usr.sbin/autofs/Makefile.depend head/usr.sbin/bluetooth/bthidcontrol/Makefile.depend head/usr.sbin/bluetooth/bthidd/Makefile.depend head/usr.sbin/bluetooth/hcsecd/Makefile.depend head/usr.sbin/bootparamd/bootparamd/Makefile.depend head/usr.sbin/bootparamd/callbootd/Makefile.depend head/usr.sbin/bsnmpd/bsnmpd/Makefile.depend head/usr.sbin/bsnmpd/modules/snmp_atm/Makefile.depend head/usr.sbin/bsnmpd/modules/snmp_bridge/Makefile.depend head/usr.sbin/bsnmpd/modules/snmp_hast/Makefile.depend head/usr.sbin/bsnmpd/modules/snmp_hostres/Makefile.depend head/usr.sbin/bsnmpd/modules/snmp_lm75/Makefile.depend head/usr.sbin/bsnmpd/modules/snmp_mibII/Makefile.depend head/usr.sbin/bsnmpd/modules/snmp_netgraph/Makefile.depend head/usr.sbin/bsnmpd/modules/snmp_pf/Makefile.depend head/usr.sbin/bsnmpd/modules/snmp_target/Makefile.depend head/usr.sbin/bsnmpd/modules/snmp_usm/Makefile.depend head/usr.sbin/bsnmpd/modules/snmp_vacm/Makefile.depend head/usr.sbin/bsnmpd/modules/snmp_wlan/Makefile.depend head/usr.sbin/config/Makefile.depend head/usr.sbin/crunch/crunchgen/Makefile.depend head/usr.sbin/ctld/Makefile.depend head/usr.sbin/editmap/Makefile.depend head/usr.sbin/fifolog/lib/Makefile.depend head/usr.sbin/gssd/Makefile.depend head/usr.sbin/jail/Makefile.depend head/usr.sbin/kbdcontrol/Makefile.depend head/usr.sbin/keyserv/Makefile.depend head/usr.sbin/mailstats/Makefile.depend head/usr.sbin/makemap/Makefile.depend head/usr.sbin/ndiscvt/Makefile.depend head/usr.sbin/ntp/libntp/Makefile.depend head/usr.sbin/ntp/ntpd/Makefile.depend head/usr.sbin/ntp/ntpdate/Makefile.depend head/usr.sbin/ntp/ntpdc/Makefile.depend head/usr.sbin/ntp/ntpq/Makefile.depend head/usr.sbin/praliases/Makefile.depend head/usr.sbin/rpc.lockd/Makefile.depend head/usr.sbin/rpc.statd/Makefile.depend head/usr.sbin/rpc.yppasswdd/Makefile.depend head/usr.sbin/rpc.ypupdated/Makefile.depend head/usr.sbin/rpc.ypxfrd/Makefile.depend head/usr.sbin/rrenumd/Makefile.depend head/usr.sbin/sendmail/Makefile.depend head/usr.sbin/tcpdump/tcpdump/Makefile.depend head/usr.sbin/traceroute/Makefile.depend head/usr.sbin/yppush/Makefile.depend head/usr.sbin/ypserv/Makefile.depend Modified: head/bin/csh/Makefile.depend ============================================================================== --- head/bin/csh/Makefile.depend Wed Feb 24 17:19:18 2016 (r295988) +++ head/bin/csh/Makefile.depend Wed Feb 24 17:20:11 2016 (r295989) @@ -18,226 +18,4 @@ DIRDEPS = \ .if ${DEP_RELDIR} == ${_DEP_RELDIR} # local dependencies - needed for -jN in clean tree -ed.chared.o: ed.defns.h -ed.chared.o: sh.err.h -ed.chared.o: tc.const.h -ed.chared.po: ed.defns.h -ed.chared.po: sh.err.h -ed.chared.po: tc.const.h -ed.defns.o: sh.err.h -ed.defns.o: tc.const.h -ed.defns.po: sh.err.h -ed.defns.po: tc.const.h -ed.init.o: ed.defns.h -ed.init.o: sh.err.h -ed.init.o: tc.const.h -ed.init.po: ed.defns.h -ed.init.po: sh.err.h -ed.init.po: tc.const.h -ed.inputl.o: ed.defns.h -ed.inputl.o: sh.err.h -ed.inputl.o: tc.const.h -ed.inputl.po: ed.defns.h -ed.inputl.po: sh.err.h -ed.inputl.po: tc.const.h -ed.refresh.o: sh.err.h -ed.refresh.o: tc.const.h -ed.refresh.po: sh.err.h -ed.refresh.po: tc.const.h -ed.screen.o: ed.defns.h -ed.screen.o: sh.err.h -ed.screen.o: tc.const.h -ed.screen.po: ed.defns.h -ed.screen.po: sh.err.h -ed.screen.po: tc.const.h -ed.term.o: sh.err.h -ed.term.o: tc.const.h -ed.term.po: sh.err.h -ed.term.po: tc.const.h -ed.xmap.o: ed.defns.h -ed.xmap.o: sh.err.h -ed.xmap.o: tc.const.h -ed.xmap.po: ed.defns.h -ed.xmap.po: sh.err.h -ed.xmap.po: tc.const.h -glob.o: sh.err.h -glob.o: tc.const.h -glob.po: sh.err.h -glob.po: tc.const.h -mi.termios.o: sh.err.h -mi.termios.o: tc.const.h -mi.termios.po: sh.err.h -mi.termios.po: tc.const.h -sh.char.o: sh.err.h -sh.char.o: tc.const.h -sh.char.po: sh.err.h -sh.char.po: tc.const.h -sh.dir.o: sh.err.h -sh.dir.o: tc.const.h -sh.dir.po: sh.err.h -sh.dir.po: tc.const.h -sh.dol.o: sh.err.h -sh.dol.o: tc.const.h -sh.dol.po: sh.err.h -sh.dol.po: tc.const.h -sh.err.o: sh.err.h -sh.err.o: tc.const.h -sh.err.po: sh.err.h -sh.err.po: tc.const.h -sh.exec.o: sh.err.h -sh.exec.o: tc.const.h -sh.exec.po: sh.err.h -sh.exec.po: tc.const.h -sh.exp.o: sh.err.h -sh.exp.o: tc.const.h -sh.exp.po: sh.err.h -sh.exp.po: tc.const.h -sh.file.o: sh.err.h -sh.file.o: tc.const.h -sh.file.po: sh.err.h -sh.file.po: tc.const.h -sh.func.o: sh.err.h -sh.func.o: tc.const.h -sh.func.po: sh.err.h -sh.func.po: tc.const.h -sh.glob.o: sh.err.h -sh.glob.o: tc.const.h -sh.glob.po: sh.err.h -sh.glob.po: tc.const.h -sh.hist.o: sh.err.h -sh.hist.o: tc.const.h -sh.hist.po: sh.err.h -sh.hist.po: tc.const.h -sh.init.o: sh.err.h -sh.init.o: tc.const.h -sh.init.po: sh.err.h -sh.init.po: tc.const.h -sh.lex.o: sh.err.h -sh.lex.o: tc.const.h -sh.lex.po: sh.err.h -sh.lex.po: tc.const.h -sh.misc.o: sh.err.h -sh.misc.o: tc.const.h -sh.misc.po: sh.err.h -sh.misc.po: tc.const.h -sh.o: sh.err.h -sh.o: tc.const.h -sh.parse.o: sh.err.h -sh.parse.o: tc.const.h -sh.parse.po: sh.err.h -sh.parse.po: tc.const.h -sh.po: sh.err.h -sh.po: tc.const.h -sh.print.o: sh.err.h -sh.print.o: tc.const.h -sh.print.po: sh.err.h -sh.print.po: tc.const.h -sh.proc.o: sh.err.h -sh.proc.o: tc.const.h -sh.proc.po: sh.err.h -sh.proc.po: tc.const.h -sh.sem.o: sh.err.h -sh.sem.o: tc.const.h -sh.sem.po: sh.err.h -sh.sem.po: tc.const.h -sh.set.o: sh.err.h -sh.set.o: tc.const.h -sh.set.po: sh.err.h -sh.set.po: tc.const.h -sh.time.o: sh.err.h -sh.time.o: tc.const.h -sh.time.po: sh.err.h -sh.time.po: tc.const.h -tc.alloc.o: sh.err.h -tc.alloc.o: tc.const.h -tc.alloc.po: sh.err.h -tc.alloc.po: tc.const.h -tc.bind.o: ed.defns.h -tc.bind.o: sh.err.h -tc.bind.o: tc.const.h -tc.bind.po: ed.defns.h -tc.bind.po: sh.err.h -tc.bind.po: tc.const.h -tc.const.o: sh.err.h -tc.const.o: tc.const.h -tc.const.po: sh.err.h -tc.const.po: tc.const.h -tc.defs.o: sh.err.h -tc.defs.o: tc.const.h -tc.defs.o: tc.defs.c -tc.defs.po: sh.err.h -tc.defs.po: tc.const.h -tc.defs.po: tc.defs.c -tc.disc.o: sh.err.h -tc.disc.o: tc.const.h -tc.disc.po: sh.err.h -tc.disc.po: tc.const.h -tc.func.o: ed.defns.h -tc.func.o: sh.err.h -tc.func.o: tc.const.h -tc.func.po: ed.defns.h -tc.func.po: sh.err.h -tc.func.po: tc.const.h -tc.nls.o: sh.err.h -tc.nls.o: tc.const.h -tc.nls.po: sh.err.h -tc.nls.po: tc.const.h -tc.os.o: ed.defns.h -tc.os.o: sh.err.h -tc.os.o: tc.const.h -tc.os.po: ed.defns.h -tc.os.po: sh.err.h -tc.os.po: tc.const.h -tc.printf.o: sh.err.h -tc.printf.o: tc.const.h -tc.printf.po: sh.err.h -tc.printf.po: tc.const.h -tc.prompt.o: sh.err.h -tc.prompt.o: tc.const.h -tc.prompt.po: sh.err.h -tc.prompt.po: tc.const.h -tc.sched.o: sh.err.h -tc.sched.o: tc.const.h -tc.sched.po: sh.err.h -tc.sched.po: tc.const.h -tc.sig.o: sh.err.h -tc.sig.o: tc.const.h -tc.sig.po: sh.err.h -tc.sig.po: tc.const.h -tc.str.o: sh.err.h -tc.str.o: tc.const.h -tc.str.po: sh.err.h -tc.str.po: tc.const.h -tc.vers.o: sh.err.h -tc.vers.o: tc.const.h -tc.vers.po: sh.err.h -tc.vers.po: tc.const.h -tc.who.o: sh.err.h -tc.who.o: tc.const.h -tc.who.po: sh.err.h -tc.who.po: tc.const.h -tw.color.o: sh.err.h -tw.color.o: tc.const.h -tw.color.po: sh.err.h -tw.color.po: tc.const.h -tw.comp.o: sh.err.h -tw.comp.o: tc.const.h -tw.comp.po: sh.err.h -tw.comp.po: tc.const.h -tw.help.o: sh.err.h -tw.help.o: tc.const.h -tw.help.po: sh.err.h -tw.help.po: tc.const.h -tw.init.o: sh.err.h -tw.init.o: tc.const.h -tw.init.po: sh.err.h -tw.init.po: tc.const.h -tw.parse.o: sh.err.h -tw.parse.o: tc.const.h -tw.parse.po: sh.err.h -tw.parse.po: tc.const.h -tw.spell.o: sh.err.h -tw.spell.o: tc.const.h -tw.spell.po: sh.err.h -tw.spell.po: tc.const.h .endif Modified: head/bin/expr/Makefile.depend ============================================================================== --- head/bin/expr/Makefile.depend Wed Feb 24 17:19:18 2016 (r295988) +++ head/bin/expr/Makefile.depend Wed Feb 24 17:20:11 2016 (r295989) @@ -16,6 +16,4 @@ DIRDEPS = \ .if ${DEP_RELDIR} == ${_DEP_RELDIR} # local dependencies - needed for -jN in clean tree -expr.o: expr.c -expr.po: expr.c .endif Modified: head/bin/rmail/Makefile.depend ============================================================================== --- head/bin/rmail/Makefile.depend Wed Feb 24 17:19:18 2016 (r295988) +++ head/bin/rmail/Makefile.depend Wed Feb 24 17:20:11 2016 (r295989) @@ -16,6 +16,4 @@ DIRDEPS = \ .if ${DEP_RELDIR} == ${_DEP_RELDIR} # local dependencies - needed for -jN in clean tree -rmail.o: sm_os.h -rmail.po: sm_os.h .endif Modified: head/bin/sh/Makefile.depend ============================================================================== --- head/bin/sh/Makefile.depend Wed Feb 24 17:19:18 2016 (r295988) +++ head/bin/sh/Makefile.depend Wed Feb 24 17:20:11 2016 (r295989) @@ -17,98 +17,4 @@ DIRDEPS = \ .if ${DEP_RELDIR} == ${_DEP_RELDIR} # local dependencies - needed for -jN in clean tree -alias.o: builtins.h -alias.po: builtins.h -arith_yylex.o: syntax.h -arith_yylex.po: syntax.h -builtins.o: builtins.c -builtins.o: builtins.h -builtins.po: builtins.c -builtins.po: builtins.h -cd.o: builtins.h -cd.o: nodes.h -cd.po: builtins.h -cd.po: nodes.h -echo.o: builtins.h -echo.po: builtins.h -error.o: nodes.h -error.po: nodes.h -eval.o: builtins.h -eval.o: nodes.h -eval.o: syntax.h -eval.po: builtins.h -eval.po: nodes.h -eval.po: syntax.h -exec.o: builtins.h -exec.o: nodes.h -exec.o: syntax.h -exec.po: builtins.h -exec.po: nodes.h -exec.po: syntax.h -expand.o: builtins.h -expand.o: nodes.h -expand.o: syntax.h -expand.po: builtins.h -expand.po: nodes.h -expand.po: syntax.h -histedit.o: builtins.h -histedit.po: builtins.h -input.o: syntax.h -input.po: syntax.h -jobs.o: builtins.h -jobs.o: nodes.h -jobs.o: syntax.h -jobs.po: builtins.h -jobs.po: nodes.h -jobs.po: syntax.h -kill.o: builtins.h -kill.po: builtins.h -main.o: builtins.h -main.o: nodes.h -main.po: builtins.h -main.po: nodes.h -miscbltin.o: syntax.h -miscbltin.po: syntax.h -mystring.o: syntax.h -mystring.po: syntax.h -nodes.o: nodes.c -nodes.o: nodes.h -nodes.po: nodes.c -nodes.po: nodes.h -options.o: builtins.h -options.o: nodes.h -options.po: builtins.h -options.po: nodes.h -output.o: syntax.h -output.po: syntax.h -parser.o: nodes.h -parser.o: syntax.h -parser.o: token.h -parser.po: nodes.h -parser.po: syntax.h -parser.po: token.h -printf.o: builtins.h -printf.po: builtins.h -redir.o: nodes.h -redir.po: nodes.h -show.o: nodes.h -show.po: nodes.h -syntax.o: syntax.c -syntax.o: syntax.h -syntax.po: syntax.c -syntax.po: syntax.h -test.o: builtins.h -test.po: builtins.h -trap.o: builtins.h -trap.o: nodes.h -trap.o: syntax.h -trap.po: builtins.h -trap.po: nodes.h -trap.po: syntax.h -var.o: builtins.h -var.o: nodes.h -var.o: syntax.h -var.po: builtins.h -var.po: nodes.h -var.po: syntax.h .endif Modified: head/cddl/lib/libdtrace/Makefile.depend ============================================================================== --- head/cddl/lib/libdtrace/Makefile.depend Wed Feb 24 17:19:18 2016 (r295988) +++ head/cddl/lib/libdtrace/Makefile.depend Wed Feb 24 17:20:11 2016 (r295989) @@ -22,31 +22,4 @@ DIRDEPS = \ .if ${DEP_RELDIR} == ${_DEP_RELDIR} # local dependencies - needed for -jN in clean tree -dt_cc.So: dt_grammar.h -dt_cc.o: dt_grammar.h -dt_cc.po: dt_grammar.h -dt_cg.So: dt_grammar.h -dt_cg.o: dt_grammar.h -dt_cg.po: dt_grammar.h -dt_errtags.So: dt_errtags.c -dt_errtags.o: dt_errtags.c -dt_errtags.po: dt_errtags.c -dt_grammar.So: dt_grammar.c -dt_grammar.o: dt_grammar.c -dt_grammar.po: dt_grammar.c -dt_lex.So: dt_grammar.h -dt_lex.So: dt_lex.c -dt_lex.o: dt_grammar.h -dt_lex.o: dt_lex.c -dt_lex.po: dt_grammar.h -dt_lex.po: dt_lex.c -dt_names.So: dt_names.c -dt_names.o: dt_names.c -dt_names.po: dt_names.c -dt_parser.So: dt_grammar.h -dt_parser.o: dt_grammar.h -dt_parser.po: dt_grammar.h -dt_xlator.So: dt_grammar.h -dt_xlator.o: dt_grammar.h -dt_xlator.po: dt_grammar.h .endif Modified: head/gnu/lib/csu/Makefile.depend ============================================================================== --- head/gnu/lib/csu/Makefile.depend Wed Feb 24 17:19:18 2016 (r295988) +++ head/gnu/lib/csu/Makefile.depend Wed Feb 24 17:20:11 2016 (r295989) @@ -10,34 +10,4 @@ DIRDEPS = \ .if ${DEP_RELDIR} == ${_DEP_RELDIR} # local dependencies - needed for -jN in clean tree -crtbegin.o: options.h -crtbegin.o: tconfig.h -crtbegin.o: tm.h -crtbegin.po: options.h -crtbegin.po: tconfig.h -crtbegin.po: tm.h -crtbeginS.o: options.h -crtbeginS.o: tconfig.h -crtbeginS.o: tm.h -crtbeginS.po: options.h -crtbeginS.po: tconfig.h -crtbeginS.po: tm.h -crtbeginT.o: options.h -crtbeginT.o: tconfig.h -crtbeginT.o: tm.h -crtbeginT.po: options.h -crtbeginT.po: tconfig.h -crtbeginT.po: tm.h -crtend.o: options.h -crtend.o: tconfig.h -crtend.o: tm.h -crtend.po: options.h -crtend.po: tconfig.h -crtend.po: tm.h -crtendS.o: options.h -crtendS.o: tconfig.h -crtendS.o: tm.h -crtendS.po: options.h -crtendS.po: tconfig.h -crtendS.po: tm.h .endif Modified: head/gnu/lib/libgcc/Makefile.depend ============================================================================== --- head/gnu/lib/libgcc/Makefile.depend Wed Feb 24 17:19:18 2016 (r295988) +++ head/gnu/lib/libgcc/Makefile.depend Wed Feb 24 17:20:11 2016 (r295989) @@ -13,274 +13,4 @@ DIRDEPS = \ .if ${DEP_RELDIR} == ${_DEP_RELDIR} # local dependencies - needed for -jN in clean tree -__main.So: options.h -__main.So: tconfig.h -__main.So: tm.h -_absvdi2.So: options.h -_absvdi2.So: tconfig.h -_absvdi2.So: tm.h -_absvsi2.So: options.h -_absvsi2.So: tconfig.h -_absvsi2.So: tm.h -_addvdi3.So: options.h -_addvdi3.So: tconfig.h -_addvdi3.So: tm.h -_addvsi3.So: options.h -_addvsi3.So: tconfig.h -_addvsi3.So: tm.h -_ashldi3.So: options.h -_ashldi3.So: tconfig.h -_ashldi3.So: tm.h -_ashrdi3.So: options.h -_ashrdi3.So: tconfig.h -_ashrdi3.So: tm.h -_bswapdi2.So: options.h -_bswapdi2.So: tconfig.h -_bswapdi2.So: tm.h -_bswapsi2.So: options.h -_bswapsi2.So: tconfig.h -_bswapsi2.So: tm.h -_clear_cache.So: options.h -_clear_cache.So: tconfig.h -_clear_cache.So: tm.h -_clz.So: options.h -_clz.So: tconfig.h -_clz.So: tm.h -_clzdi2.So: options.h -_clzdi2.So: tconfig.h -_clzdi2.So: tm.h -_clzsi2.So: options.h -_clzsi2.So: tconfig.h -_clzsi2.So: tm.h -_cmpdi2.So: options.h -_cmpdi2.So: tconfig.h -_cmpdi2.So: tm.h -_ctors.So: options.h -_ctors.So: tconfig.h -_ctors.So: tm.h -_ctzdi2.So: options.h -_ctzdi2.So: tconfig.h -_ctzdi2.So: tm.h -_ctzsi2.So: options.h -_ctzsi2.So: tconfig.h -_ctzsi2.So: tm.h -_divdc3.So: options.h -_divdc3.So: tconfig.h -_divdc3.So: tm.h -_divdi3.So: options.h -_divdi3.So: tconfig.h -_divdi3.So: tm.h -_divsc3.So: options.h -_divsc3.So: tconfig.h -_divsc3.So: tm.h -_divtc3.So: options.h -_divtc3.So: tconfig.h -_divtc3.So: tm.h -_divxc3.So: options.h -_divxc3.So: tconfig.h -_divxc3.So: tm.h -_enable_execute_stack.So: options.h -_enable_execute_stack.So: tconfig.h -_enable_execute_stack.So: tm.h -_ffsdi2.So: options.h -_ffsdi2.So: tconfig.h -_ffsdi2.So: tm.h -_ffssi2.So: options.h -_ffssi2.So: tconfig.h -_ffssi2.So: tm.h -_fixdfdi.So: options.h -_fixdfdi.So: tconfig.h -_fixdfdi.So: tm.h -_fixsfdi.So: options.h -_fixsfdi.So: tconfig.h -_fixsfdi.So: tm.h -_fixtfdi.So: options.h -_fixtfdi.So: tconfig.h -_fixtfdi.So: tm.h -_fixunsdfdi.So: options.h -_fixunsdfdi.So: tconfig.h -_fixunsdfdi.So: tm.h -_fixunsdfsi.So: options.h -_fixunsdfsi.So: tconfig.h -_fixunsdfsi.So: tm.h -_fixunssfdi.So: options.h -_fixunssfdi.So: tconfig.h -_fixunssfdi.So: tm.h -_fixunssfsi.So: options.h -_fixunssfsi.So: tconfig.h -_fixunssfsi.So: tm.h -_fixunstfdi.So: options.h -_fixunstfdi.So: tconfig.h -_fixunstfdi.So: tm.h -_fixunsxfdi.So: options.h -_fixunsxfdi.So: tconfig.h -_fixunsxfdi.So: tm.h -_fixunsxfsi.So: options.h -_fixunsxfsi.So: tconfig.h -_fixunsxfsi.So: tm.h -_fixxfdi.So: options.h -_fixxfdi.So: tconfig.h -_fixxfdi.So: tm.h -_floatdidf.So: options.h -_floatdidf.So: tconfig.h -_floatdidf.So: tm.h -_floatdisf.So: options.h -_floatdisf.So: tconfig.h -_floatdisf.So: tm.h -_floatditf.So: options.h -_floatditf.So: tconfig.h -_floatditf.So: tm.h -_floatdixf.So: options.h -_floatdixf.So: tconfig.h -_floatdixf.So: tm.h -_floatundidf.So: options.h -_floatundidf.So: tconfig.h -_floatundidf.So: tm.h -_floatundisf.So: options.h -_floatundisf.So: tconfig.h -_floatundisf.So: tm.h -_floatunditf.So: options.h -_floatunditf.So: tconfig.h -_floatunditf.So: tm.h -_floatundixf.So: options.h -_floatundixf.So: tconfig.h -_floatundixf.So: tm.h -_lshrdi3.So: options.h -_lshrdi3.So: tconfig.h -_lshrdi3.So: tm.h -_moddi3.So: options.h -_moddi3.So: tconfig.h -_moddi3.So: tm.h -_muldc3.So: options.h -_muldc3.So: tconfig.h -_muldc3.So: tm.h -_muldi3.So: options.h -_muldi3.So: tconfig.h -_muldi3.So: tm.h -_mulsc3.So: options.h -_mulsc3.So: tconfig.h -_mulsc3.So: tm.h -_multc3.So: options.h -_multc3.So: tconfig.h -_multc3.So: tm.h -_mulvdi3.So: options.h -_mulvdi3.So: tconfig.h -_mulvdi3.So: tm.h -_mulvsi3.So: options.h -_mulvsi3.So: tconfig.h -_mulvsi3.So: tm.h -_mulxc3.So: options.h -_mulxc3.So: tconfig.h -_mulxc3.So: tm.h -_negdi2.So: options.h -_negdi2.So: tconfig.h -_negdi2.So: tm.h -_negvdi2.So: options.h -_negvdi2.So: tconfig.h -_negvdi2.So: tm.h -_negvsi2.So: options.h -_negvsi2.So: tconfig.h -_negvsi2.So: tm.h -_paritydi2.So: options.h -_paritydi2.So: tconfig.h -_paritydi2.So: tm.h -_paritysi2.So: options.h -_paritysi2.So: tconfig.h -_paritysi2.So: tm.h -_popcount_tab.So: options.h -_popcount_tab.So: tconfig.h -_popcount_tab.So: tm.h -_popcountdi2.So: options.h -_popcountdi2.So: tconfig.h -_popcountdi2.So: tm.h -_popcountsi2.So: options.h -_popcountsi2.So: tconfig.h -_popcountsi2.So: tm.h -_powidf2.So: options.h -_powidf2.So: tconfig.h -_powidf2.So: tm.h -_powisf2.So: options.h -_powisf2.So: tconfig.h -_powisf2.So: tm.h -_powitf2.So: options.h -_powitf2.So: tconfig.h -_powitf2.So: tm.h -_powixf2.So: options.h -_powixf2.So: tconfig.h -_powixf2.So: tm.h -_subvdi3.So: options.h -_subvdi3.So: tconfig.h -_subvdi3.So: tm.h -_subvsi3.So: options.h -_subvsi3.So: tconfig.h -_subvsi3.So: tm.h -_trampoline.So: options.h -_trampoline.So: tconfig.h -_trampoline.So: tm.h -_ucmpdi2.So: options.h -_ucmpdi2.So: tconfig.h -_ucmpdi2.So: tm.h -_udiv_w_sdiv.So: options.h -_udiv_w_sdiv.So: tconfig.h -_udiv_w_sdiv.So: tm.h -_udivdi3.So: options.h -_udivdi3.So: tconfig.h -_udivdi3.So: tm.h -_udivmoddi4.So: options.h -_udivmoddi4.So: tconfig.h -_udivmoddi4.So: tm.h -_umoddi3.So: options.h -_umoddi3.So: tconfig.h -_umoddi3.So: tm.h -unwind-c.So: tconfig.h -unwind-c.So: unwind.h -unwind-c.o: tconfig.h -unwind-c.o: unwind.h -unwind-c.po: tconfig.h -unwind-c.po: unwind.h -unwind-dw2-fde-glibc.So: gthr-default.h -unwind-dw2-fde-glibc.So: options.h -unwind-dw2-fde-glibc.So: tconfig.h -unwind-dw2-fde-glibc.So: tm.h -unwind-dw2-fde-glibc.So: unwind.h -unwind-dw2-fde-glibc.o: gthr-default.h -unwind-dw2-fde-glibc.o: options.h -unwind-dw2-fde-glibc.o: tconfig.h -unwind-dw2-fde-glibc.o: tm.h -unwind-dw2-fde-glibc.o: unwind.h -unwind-dw2-fde-glibc.po: gthr-default.h -unwind-dw2-fde-glibc.po: options.h -unwind-dw2-fde-glibc.po: tconfig.h -unwind-dw2-fde-glibc.po: tm.h -unwind-dw2-fde-glibc.po: unwind.h -unwind-dw2.So: gthr-default.h -unwind-dw2.So: options.h -unwind-dw2.So: tconfig.h -unwind-dw2.So: tm.h -unwind-dw2.So: unwind.h -unwind-dw2.o: gthr-default.h -unwind-dw2.o: options.h -unwind-dw2.o: tconfig.h -unwind-dw2.o: tm.h -unwind-dw2.o: unwind.h -unwind-dw2.po: gthr-default.h -unwind-dw2.po: options.h -unwind-dw2.po: tconfig.h -unwind-dw2.po: tm.h -unwind-dw2.po: unwind.h -unwind-sjlj.So: gthr-default.h -unwind-sjlj.So: options.h -unwind-sjlj.So: tconfig.h -unwind-sjlj.So: tm.h -unwind-sjlj.So: unwind.h -unwind-sjlj.o: gthr-default.h -unwind-sjlj.o: options.h -unwind-sjlj.o: tconfig.h -unwind-sjlj.o: tm.h -unwind-sjlj.o: unwind.h -unwind-sjlj.po: gthr-default.h -unwind-sjlj.po: options.h -unwind-sjlj.po: tconfig.h -unwind-sjlj.po: tm.h -unwind-sjlj.po: unwind.h .endif Modified: head/gnu/lib/libgcov/Makefile.depend ============================================================================== --- head/gnu/lib/libgcov/Makefile.depend Wed Feb 24 17:19:18 2016 (r295988) +++ head/gnu/lib/libgcov/Makefile.depend Wed Feb 24 17:20:11 2016 (r295989) @@ -10,116 +10,4 @@ DIRDEPS = \ .if ${DEP_RELDIR} == ${_DEP_RELDIR} # local dependencies - needed for -jN in clean tree -_gcov.o: gcov-iov.h -_gcov.o: options.h -_gcov.o: tconfig.h -_gcov.o: tm.h -_gcov.po: gcov-iov.h -_gcov.po: options.h -_gcov.po: tconfig.h -_gcov.po: tm.h -_gcov_execl.o: gcov-iov.h -_gcov_execl.o: options.h -_gcov_execl.o: tconfig.h -_gcov_execl.o: tm.h -_gcov_execl.po: gcov-iov.h -_gcov_execl.po: options.h -_gcov_execl.po: tconfig.h -_gcov_execl.po: tm.h -_gcov_execle.o: gcov-iov.h -_gcov_execle.o: options.h -_gcov_execle.o: tconfig.h -_gcov_execle.o: tm.h -_gcov_execle.po: gcov-iov.h -_gcov_execle.po: options.h -_gcov_execle.po: tconfig.h -_gcov_execle.po: tm.h -_gcov_execlp.o: gcov-iov.h -_gcov_execlp.o: options.h -_gcov_execlp.o: tconfig.h -_gcov_execlp.o: tm.h -_gcov_execlp.po: gcov-iov.h -_gcov_execlp.po: options.h -_gcov_execlp.po: tconfig.h -_gcov_execlp.po: tm.h -_gcov_execv.o: gcov-iov.h -_gcov_execv.o: options.h -_gcov_execv.o: tconfig.h -_gcov_execv.o: tm.h -_gcov_execv.po: gcov-iov.h -_gcov_execv.po: options.h -_gcov_execv.po: tconfig.h -_gcov_execv.po: tm.h -_gcov_execve.o: gcov-iov.h -_gcov_execve.o: options.h -_gcov_execve.o: tconfig.h -_gcov_execve.o: tm.h -_gcov_execve.po: gcov-iov.h -_gcov_execve.po: options.h -_gcov_execve.po: tconfig.h -_gcov_execve.po: tm.h -_gcov_execvp.o: gcov-iov.h -_gcov_execvp.o: options.h -_gcov_execvp.o: tconfig.h -_gcov_execvp.o: tm.h -_gcov_execvp.po: gcov-iov.h -_gcov_execvp.po: options.h -_gcov_execvp.po: tconfig.h -_gcov_execvp.po: tm.h -_gcov_fork.o: gcov-iov.h -_gcov_fork.o: options.h -_gcov_fork.o: tconfig.h -_gcov_fork.o: tm.h -_gcov_fork.po: gcov-iov.h -_gcov_fork.po: options.h -_gcov_fork.po: tconfig.h -_gcov_fork.po: tm.h -_gcov_interval_profiler.o: gcov-iov.h -_gcov_interval_profiler.o: options.h -_gcov_interval_profiler.o: tconfig.h -_gcov_interval_profiler.o: tm.h -_gcov_interval_profiler.po: gcov-iov.h -_gcov_interval_profiler.po: options.h -_gcov_interval_profiler.po: tconfig.h -_gcov_interval_profiler.po: tm.h -_gcov_merge_add.o: gcov-iov.h -_gcov_merge_add.o: options.h -_gcov_merge_add.o: tconfig.h -_gcov_merge_add.o: tm.h -_gcov_merge_add.po: gcov-iov.h -_gcov_merge_add.po: options.h -_gcov_merge_add.po: tconfig.h -_gcov_merge_add.po: tm.h -_gcov_merge_delta.o: gcov-iov.h -_gcov_merge_delta.o: options.h -_gcov_merge_delta.o: tconfig.h -_gcov_merge_delta.o: tm.h -_gcov_merge_delta.po: gcov-iov.h -_gcov_merge_delta.po: options.h -_gcov_merge_delta.po: tconfig.h -_gcov_merge_delta.po: tm.h -_gcov_merge_single.o: gcov-iov.h -_gcov_merge_single.o: options.h -_gcov_merge_single.o: tconfig.h -_gcov_merge_single.o: tm.h -_gcov_merge_single.po: gcov-iov.h -_gcov_merge_single.po: options.h -_gcov_merge_single.po: tconfig.h -_gcov_merge_single.po: tm.h -_gcov_one_value_profiler.o: gcov-iov.h -_gcov_one_value_profiler.o: options.h -_gcov_one_value_profiler.o: tconfig.h -_gcov_one_value_profiler.o: tm.h -_gcov_one_value_profiler.po: gcov-iov.h -_gcov_one_value_profiler.po: options.h -_gcov_one_value_profiler.po: tconfig.h -_gcov_one_value_profiler.po: tm.h -_gcov_pow2_profiler.o: gcov-iov.h -_gcov_pow2_profiler.o: options.h -_gcov_pow2_profiler.o: tconfig.h -_gcov_pow2_profiler.o: tm.h -_gcov_pow2_profiler.po: gcov-iov.h -_gcov_pow2_profiler.po: options.h -_gcov_pow2_profiler.po: tconfig.h -_gcov_pow2_profiler.po: tm.h .endif Modified: head/gnu/lib/libgomp/Makefile.depend ============================================================================== --- head/gnu/lib/libgomp/Makefile.depend Wed Feb 24 17:19:18 2016 (r295988) +++ head/gnu/lib/libgomp/Makefile.depend Wed Feb 24 17:20:11 2016 (r295989) @@ -15,70 +15,4 @@ DIRDEPS = \ .if ${DEP_RELDIR} == ${_DEP_RELDIR} # local dependencies - needed for -jN in clean tree -affinity.So: gstdint.h -affinity.o: gstdint.h -affinity.po: gstdint.h -alloc.So: gstdint.h -alloc.o: gstdint.h -alloc.po: gstdint.h -bar.So: gstdint.h -bar.o: gstdint.h -bar.po: gstdint.h -barrier.So: gstdint.h -barrier.o: gstdint.h -barrier.po: gstdint.h -critical.So: gstdint.h -critical.o: gstdint.h -critical.po: gstdint.h -env.So: gstdint.h -env.So: libgomp_f.h -env.o: gstdint.h -env.o: libgomp_f.h -env.po: gstdint.h -env.po: libgomp_f.h -error.So: gstdint.h -error.o: gstdint.h -error.po: gstdint.h -fortran.So: gstdint.h -fortran.So: libgomp_f.h -fortran.o: gstdint.h -fortran.o: libgomp_f.h -fortran.po: gstdint.h -fortran.po: libgomp_f.h -iter.So: gstdint.h -iter.o: gstdint.h -iter.po: gstdint.h -lock.So: gstdint.h -lock.o: gstdint.h -lock.po: gstdint.h -loop.So: gstdint.h -loop.o: gstdint.h -loop.po: gstdint.h -ordered.So: gstdint.h -ordered.o: gstdint.h -ordered.po: gstdint.h -parallel.So: gstdint.h -parallel.o: gstdint.h -parallel.po: gstdint.h -proc.So: gstdint.h -proc.o: gstdint.h -proc.po: gstdint.h -sections.So: gstdint.h -sections.o: gstdint.h -sections.po: gstdint.h -sem.So: gstdint.h -sem.o: gstdint.h -sem.po: gstdint.h -single.So: gstdint.h -single.o: gstdint.h -single.po: gstdint.h -team.So: gstdint.h -team.o: gstdint.h -team.po: gstdint.h -time.So: gstdint.h -time.o: gstdint.h -time.po: gstdint.h -work.So: gstdint.h -work.o: gstdint.h -work.po: gstdint.h .endif Modified: head/gnu/lib/libregex/Makefile.depend ============================================================================== --- head/gnu/lib/libregex/Makefile.depend Wed Feb 24 17:19:18 2016 (r295988) +++ head/gnu/lib/libregex/Makefile.depend Wed Feb 24 17:20:11 2016 (r295989) @@ -15,7 +15,4 @@ DIRDEPS = \ .if ${DEP_RELDIR} == ${_DEP_RELDIR} # local dependencies - needed for -jN in clean tree -gnuregex.So: gnuregex.c -gnuregex.o: gnuregex.c -gnuregex.po: gnuregex.c .endif Modified: head/gnu/lib/libstdc++/Makefile.depend ============================================================================== --- head/gnu/lib/libstdc++/Makefile.depend Wed Feb 24 17:19:18 2016 (r295988) +++ head/gnu/lib/libstdc++/Makefile.depend Wed Feb 24 17:20:11 2016 (r295989) @@ -16,52 +16,4 @@ DIRDEPS = \ .if ${DEP_RELDIR} == ${_DEP_RELDIR} # local dependencies - needed for -jN in clean tree -atomicity.So: atomicity.cc -atomicity.o: atomicity.cc -atomicity.po: atomicity.cc -eh_alloc.So: unwind.h -eh_alloc.o: unwind.h -eh_alloc.po: unwind.h -eh_arm.So: unwind.h -eh_arm.o: unwind.h -eh_arm.po: unwind.h -eh_aux_runtime.So: unwind.h -eh_aux_runtime.o: unwind.h -eh_aux_runtime.po: unwind.h -eh_call.So: unwind.h -eh_call.o: unwind.h -eh_call.po: unwind.h -eh_catch.So: unwind.h -eh_catch.o: unwind.h -eh_catch.po: unwind.h -eh_exception.So: unwind.h -eh_exception.o: unwind.h -eh_exception.po: unwind.h -eh_globals.So: unwind.h -eh_globals.o: unwind.h -eh_globals.po: unwind.h -eh_personality.So: unwind.h -eh_personality.o: unwind.h -eh_personality.po: unwind.h -eh_term_handler.So: unwind.h -eh_term_handler.o: unwind.h -eh_term_handler.po: unwind.h -eh_terminate.So: unwind.h -eh_terminate.o: unwind.h -eh_terminate.po: unwind.h -eh_throw.So: unwind.h -eh_throw.o: unwind.h -eh_throw.po: unwind.h -eh_type.So: unwind.h -eh_type.o: unwind.h -eh_type.po: unwind.h -eh_unex_handler.So: unwind.h -eh_unex_handler.o: unwind.h -eh_unex_handler.po: unwind.h -pure.So: unwind.h -pure.o: unwind.h -pure.po: unwind.h -vec.So: unwind.h -vec.o: unwind.h -vec.po: unwind.h .endif Modified: head/gnu/lib/libsupc++/Makefile.depend ============================================================================== --- head/gnu/lib/libsupc++/Makefile.depend Wed Feb 24 17:19:18 2016 (r295988) +++ head/gnu/lib/libsupc++/Makefile.depend Wed Feb 24 17:20:11 2016 (r295989) @@ -16,49 +16,4 @@ DIRDEPS = \ .if ${DEP_RELDIR} == ${_DEP_RELDIR} # local dependencies - needed for -jN in clean tree -eh_alloc.So: unwind.h -eh_alloc.o: unwind.h -eh_alloc.po: unwind.h -eh_arm.So: unwind.h -eh_arm.o: unwind.h -eh_arm.po: unwind.h -eh_aux_runtime.So: unwind.h -eh_aux_runtime.o: unwind.h -eh_aux_runtime.po: unwind.h -eh_call.So: unwind.h -eh_call.o: unwind.h -eh_call.po: unwind.h -eh_catch.So: unwind.h -eh_catch.o: unwind.h -eh_catch.po: unwind.h -eh_exception.So: unwind.h -eh_exception.o: unwind.h -eh_exception.po: unwind.h -eh_globals.So: unwind.h -eh_globals.o: unwind.h -eh_globals.po: unwind.h -eh_personality.So: unwind.h -eh_personality.o: unwind.h -eh_personality.po: unwind.h -eh_term_handler.So: unwind.h -eh_term_handler.o: unwind.h -eh_term_handler.po: unwind.h -eh_terminate.So: unwind.h -eh_terminate.o: unwind.h -eh_terminate.po: unwind.h -eh_throw.So: unwind.h -eh_throw.o: unwind.h -eh_throw.po: unwind.h -eh_type.So: unwind.h -eh_type.o: unwind.h -eh_type.po: unwind.h -eh_unex_handler.So: unwind.h -eh_unex_handler.o: unwind.h -eh_unex_handler.po: unwind.h -pure.So: unwind.h -pure.o: unwind.h *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Wed Feb 24 17:20:23 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B2B31AB33B8; Wed, 24 Feb 2016 17:20:23 +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 mx1.freebsd.org (Postfix) with ESMTPS id 868081296; Wed, 24 Feb 2016 17:20:23 +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 u1OHKMeZ089921; Wed, 24 Feb 2016 17:20:22 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1OHKM78089919; Wed, 24 Feb 2016 17:20:22 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201602241720.u1OHKM78089919@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Wed, 24 Feb 2016 17:20:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295990 - in head: . targets/pseudo/kernel X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Feb 2016 17:20:23 -0000 Author: bdrewery Date: Wed Feb 24 17:20:22 2016 New Revision: 295990 URL: https://svnweb.freebsd.org/changeset/base/295990 Log: FAST_DEPEND: Skip 'make depend' for buildworld and kernel since it is auto-ran now. Sponsored by: EMC / Isilon Storage Division Modified: head/Makefile.inc1 head/targets/pseudo/kernel/Makefile Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Wed Feb 24 17:20:11 2016 (r295989) +++ head/Makefile.inc1 Wed Feb 24 17:20:22 2016 (r295990) @@ -145,6 +145,16 @@ CLEANDIR= clean cleandepend CLEANDIR= cleandir .endif +# FAST_DEPEND can skip depend tree-walks. +.if ${MK_FAST_DEPEND} == "yes" +NO_DEPEND= t +NO_KERNELDEPEND=t +.endif +# Ensure shell checks later have a value. +.if defined(NO_DEPEND) +NO_DEPEND= t +.endif + LOCAL_TOOL_DIRS?= PACKAGEDIR?= ${DESTDIR}/${DISTDIR} @@ -772,7 +782,11 @@ WMAKE_TGTS+= _worldtmp _legacy WMAKE_TGTS+= _bootstrap-tools .endif WMAKE_TGTS+= _cleanobj _obj _build-tools _cross-tools -WMAKE_TGTS+= _includes _libraries _depend everything +WMAKE_TGTS+= _includes _libraries +.if !defined(NO_DEPEND) +WMAKE_TGTS+= _depend +.endif +WMAKE_TGTS+= everything .if defined(LIB32TMP) && ${MK_LIB32} != "no" && empty(SUBDIR_OVERRIDE) WMAKE_TGTS+= build32 .endif @@ -1403,7 +1417,7 @@ legacy: cd ${.CURDIR}/${_tool}; \ ${MAKE} DIRPRFX=${_tool}/ obj; \ ${MAKE} DIRPRFX=${_tool}/ DESTDIR=${MAKEOBJDIRPREFIX}/legacy includes; \ - ${MAKE} DIRPRFX=${_tool}/ depend; \ + if [ -z "${NO_DEPEND}" ]; then ${MAKE} DIRPRFX=${_tool}/ depend; fi; \ ${MAKE} DIRPRFX=${_tool}/ all; \ ${MAKE} DIRPRFX=${_tool}/ DESTDIR=${MAKEOBJDIRPREFIX}/legacy install .endfor @@ -1551,7 +1565,7 @@ ${_bt}-${_tool}: .PHONY .MAKE ${_+_}@${ECHODIR} "===> ${_tool} (obj,depend,all,install)"; \ cd ${.CURDIR}/${_tool}; \ ${MAKE} DIRPRFX=${_tool}/ obj; \ - ${MAKE} DIRPRFX=${_tool}/ depend; \ + if [ -z "${NO_DEPEND}" ]; then ${MAKE} DIRPRFX=${_tool}/ depend; fi; \ ${MAKE} DIRPRFX=${_tool}/ all; \ ${MAKE} DIRPRFX=${_tool}/ DESTDIR=${MAKEOBJDIRPREFIX}/legacy install @@ -1600,7 +1614,7 @@ build-tools_${_tool}: .PHONY ${_+_}@${ECHODIR} "===> ${_tool} (obj,depend,all)"; \ cd ${.CURDIR}/${_tool}; \ ${MAKE} DIRPRFX=${_tool}/ obj; \ - ${MAKE} DIRPRFX=${_tool}/ depend; \ + if [ -z "${NO_DEPEND}" ]; then ${MAKE} DIRPRFX=${_tool}/ depend; fi; \ ${MAKE} DIRPRFX=${_tool}/ all build-tools: build-tools_${_tool} .endfor @@ -1684,7 +1698,7 @@ cross-tools: .MAKE .PHONY ${_+_}@${ECHODIR} "===> ${_tool} (obj,depend,all,install)"; \ cd ${.CURDIR}/${_tool}; \ ${MAKE} DIRPRFX=${_tool}/ obj; \ - ${MAKE} DIRPRFX=${_tool}/ depend; \ + if [ -z "${NO_DEPEND}" ]; then ${MAKE} DIRPRFX=${_tool}/ depend; fi; \ ${MAKE} DIRPRFX=${_tool}/ all; \ ${MAKE} DIRPRFX=${_tool}/ DESTDIR=${MAKEOBJDIRPREFIX} install .endfor @@ -1716,7 +1730,7 @@ native-xtools: .PHONY ${_+_}@${ECHODIR} "===> ${_gperf} (obj,depend,all,install)"; \ cd ${.CURDIR}/${_gperf}; \ ${NXBMAKE} DIRPRFX=${_gperf}/ obj; \ - ${NXBMAKE} DIRPRFX=${_gperf}/ depend; \ + if [ -z "${NO_DEPEND}" ]; then ${NXBMAKE} DIRPRFX=${_gperf}/ depend; fi; \ ${NXBMAKE} DIRPRFX=${_gperf}/ all; \ ${NXBMAKE} DIRPRFX=${_gperf}/ DESTDIR=${OBJTREE}/gperf_for_gcc install .endif @@ -1791,7 +1805,7 @@ native-xtools: .PHONY ${_+_}@${ECHODIR} "===> ${_tool} (obj,depend,all,install)"; \ cd ${.CURDIR}/${_tool}; \ ${NXBMAKE} DIRPRFX=${_tool}/ obj; \ - ${NXBMAKE} DIRPRFX=${_tool}/ depend; \ + if [ -z "${NO_DEPEND}" ]; then ${NXBMAKE} DIRPRFX=${_tool}/ depend; fi; \ ${NXBMAKE} DIRPRFX=${_tool}/ all; \ ${NXBMAKE} DIRPRFX=${_tool}/ DESTDIR=${NXBDESTDIR} install .endfor @@ -2021,7 +2035,7 @@ ${_lib}__PL: .PHONY .MAKE ${_+_}@${ECHODIR} "===> ${_lib} (obj,depend,all,install)"; \ cd ${.CURDIR}/${_lib}; \ ${MAKE} MK_TESTS=no DIRPRFX=${_lib}/ obj; \ - ${MAKE} MK_TESTS=no DIRPRFX=${_lib}/ depend; \ + if [ -z "${NO_DEPEND}" ]; then ${MAKE} MK_TESTS=no DIRPRFX=${_lib}/ depend; fi; \ ${MAKE} MK_TESTS=no MK_PROFILE=no -DNO_PIC \ DIRPRFX=${_lib}/ all; \ ${MAKE} MK_TESTS=no MK_PROFILE=no -DNO_PIC \ @@ -2035,7 +2049,7 @@ ${_lib}__L: .PHONY .MAKE ${_+_}@${ECHODIR} "===> ${_lib} (obj,depend,all,install)"; \ cd ${.CURDIR}/${_lib}; \ ${MAKE} MK_TESTS=no DIRPRFX=${_lib}/ obj; \ - ${MAKE} MK_TESTS=no DIRPRFX=${_lib}/ depend; \ + if [ -z "${NO_DEPEND}" ]; then ${MAKE} MK_TESTS=no DIRPRFX=${_lib}/ depend; fi; \ ${MAKE} MK_TESTS=no DIRPRFX=${_lib}/ all; \ ${MAKE} MK_TESTS=no DIRPRFX=${_lib}/ install .endif @@ -2048,7 +2062,7 @@ lib/libpam__L: .PHONY .MAKE ${_+_}@${ECHODIR} "===> lib/libpam (obj,depend,all,install)"; \ cd ${.CURDIR}/lib/libpam; \ ${MAKE} MK_TESTS=no DIRPRFX=lib/libpam/ obj; \ - ${MAKE} MK_TESTS=no DIRPRFX=lib/libpam/ depend; \ + if [ -z "${NO_DEPEND}" ]; then ${MAKE} MK_TESTS=no DIRPRFX=lib/libpam/ depend; fi; \ ${MAKE} MK_TESTS=no DIRPRFX=lib/libpam/ \ -D_NO_LIBPAM_SO_YET all; \ ${MAKE} MK_TESTS=no DIRPRFX=lib/libpam/ \ @@ -2346,7 +2360,7 @@ _xb-bootstrap-tools: .PHONY ${_+_}@${ECHODIR} "===> ${_tool} (obj,depend,all,install)"; \ cd ${.CURDIR}/${_tool}; \ ${CDMAKE} DIRPRFX=${_tool}/ obj; \ - ${CDMAKE} DIRPRFX=${_tool}/ depend; \ + if [ -z "${NO_DEPEND}" ]; then ${CDMAKE} DIRPRFX=${_tool}/ depend; fi; \ ${CDMAKE} DIRPRFX=${_tool}/ all; \ ${CDMAKE} DIRPRFX=${_tool}/ DESTDIR=${CDTMP} install .endfor @@ -2366,7 +2380,7 @@ _xb-cross-tools: .PHONY ${_+_}@${ECHODIR} "===> xdev ${_tool} (obj,depend,all)"; \ cd ${.CURDIR}/${_tool}; \ ${CDMAKE} DIRPRFX=${_tool}/ obj; \ - ${CDMAKE} DIRPRFX=${_tool}/ depend; \ + if [ -z "${NO_DEPEND}" ]; then ${CDMAKE} DIRPRFX=${_tool}/ depend; fi; \ ${CDMAKE} DIRPRFX=${_tool}/ all .endfor Modified: head/targets/pseudo/kernel/Makefile ============================================================================== --- head/targets/pseudo/kernel/Makefile Wed Feb 24 17:20:11 2016 (r295989) +++ head/targets/pseudo/kernel/Makefile Wed Feb 24 17:20:22 2016 (r295990) @@ -14,7 +14,6 @@ ${KERNCONF}.config: .MAKE .META mkdir -p ${KERN_OBJDIR:H} (cd ${KERN_CONFDIR} && \ ${CONFIG} ${CONFIGARGS} -d ${KERN_OBJDIR} ${KERNCONF}) - (cd ${KERN_OBJDIR} && ${.MAKE} depend) @touch $@ # we need to pass curdirOk=yes to meta mode, since we want .meta files From owner-svn-src-head@freebsd.org Wed Feb 24 17:20:27 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1403EAB33E4; Wed, 24 Feb 2016 17:20:27 +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 mx1.freebsd.org (Postfix) with ESMTPS id D5E951388; Wed, 24 Feb 2016 17:20:26 +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 u1OHKPS6089967; Wed, 24 Feb 2016 17:20:25 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1OHKP1O089966; Wed, 24 Feb 2016 17:20:25 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201602241720.u1OHKP1O089966@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Wed, 24 Feb 2016 17:20:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295991 - head/targets X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Feb 2016 17:20:27 -0000 Author: bdrewery Date: Wed Feb 24 17:20:25 2016 New Revision: 295991 URL: https://svnweb.freebsd.org/changeset/base/295991 Log: DIRDEPS_BUILD: Allow 'make destroy*' to work from top-level. Sponsored by: EMC / Isilon Storage Division Modified: head/targets/Makefile.xtras Modified: head/targets/Makefile.xtras ============================================================================== --- head/targets/Makefile.xtras Wed Feb 24 17:20:22 2016 (r295990) +++ head/targets/Makefile.xtras Wed Feb 24 17:20:25 2016 (r295991) @@ -51,6 +51,7 @@ show-help: not-valid-target: @echo "ERROR: '${_TARGETS}' is not a valid target for ${MACHINE}." +.include .for t in ${_TARGETS:Nlove} .if !target($t) From owner-svn-src-head@freebsd.org Wed Feb 24 17:20:30 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 35415AB3414; Wed, 24 Feb 2016 17:20:30 +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 mx1.freebsd.org (Postfix) with ESMTPS id E02B213D3; Wed, 24 Feb 2016 17:20:29 +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 u1OHKSvb090014; Wed, 24 Feb 2016 17:20:28 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1OHKS0P090013; Wed, 24 Feb 2016 17:20:28 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201602241720.u1OHKS0P090013@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Wed, 24 Feb 2016 17:20:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295992 - head/targets X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Feb 2016 17:20:30 -0000 Author: bdrewery Date: Wed Feb 24 17:20:28 2016 New Revision: 295992 URL: https://svnweb.freebsd.org/changeset/base/295992 Log: DIRDEPS_BUILD: Allow destroy-(arch|host|stage) from top-level. Sponsored by: EMC / Isilon Storage Division Modified: head/targets/Makefile.xtras Modified: head/targets/Makefile.xtras ============================================================================== --- head/targets/Makefile.xtras Wed Feb 24 17:20:25 2016 (r295991) +++ head/targets/Makefile.xtras Wed Feb 24 17:20:28 2016 (r295992) @@ -29,6 +29,9 @@ no-default: .if make(show-valid-targets) OTHER_TARGETS = \ destroy \ + destroy-arch \ + destroy-host \ + destroy-stage \ BUILD_TARGETS != cd ${_here} && \ find . \( -name Makefile.depend -o -name ${.MAKE.DEPENDFILE:T} \) | \ From owner-svn-src-head@freebsd.org Wed Feb 24 17:20:33 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 906DDAB3437; Wed, 24 Feb 2016 17:20:33 +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 mx1.freebsd.org (Postfix) with ESMTPS id 424F11511; Wed, 24 Feb 2016 17:20:32 +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 u1OHKVMF090059; Wed, 24 Feb 2016 17:20:31 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1OHKVNQ090058; Wed, 24 Feb 2016 17:20:31 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201602241720.u1OHKVNQ090058@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Wed, 24 Feb 2016 17:20:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295993 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Feb 2016 17:20:33 -0000 Author: bdrewery Date: Wed Feb 24 17:20:31 2016 New Revision: 295993 URL: https://svnweb.freebsd.org/changeset/base/295993 Log: Show full DIRPRFX in subdir parallel target name. For example when building, from buildworld, lib/atf/libatf-c++/tests/detail: --- all_subdir_atf --- is now: --- all_subdir_lib/atf/libatf-c++/tests/detail --- Sponsored by: EMC / Isilon Storage Division Modified: head/share/mk/bsd.subdir.mk Modified: head/share/mk/bsd.subdir.mk ============================================================================== --- head/share/mk/bsd.subdir.mk Wed Feb 24 17:20:28 2016 (r295992) +++ head/share/mk/bsd.subdir.mk Wed Feb 24 17:20:31 2016 (r295993) @@ -138,14 +138,14 @@ __subdir_targets= .if ${__dir} == .WAIT __subdir_targets+= .WAIT .else -__subdir_targets+= ${__target}_subdir_${__dir} +__subdir_targets+= ${__target}_subdir_${DIRPRFX}${__dir} __deps= .if ${_is_standalone_target} == 0 .for __dep in ${SUBDIR_DEPEND_${__dir}} -__deps+= ${__target}_subdir_${__dep} +__deps+= ${__target}_subdir_${DIRPRFX}${__dep} .endfor .endif -${__target}_subdir_${__dir}: .PHONY .MAKE ${__deps} +${__target}_subdir_${DIRPRFX}${__dir}: .PHONY .MAKE ${__deps} .if !defined(NO_SUBDIR) @${_+_}target=${__target:realinstall=install}; \ dir=${__dir}; \ From owner-svn-src-head@freebsd.org Wed Feb 24 17:20:37 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 312C3AB3463; Wed, 24 Feb 2016 17:20:37 +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 mx1.freebsd.org (Postfix) with ESMTPS id 3F6FF1621; Wed, 24 Feb 2016 17:20:36 +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 u1OHKZPR090107; Wed, 24 Feb 2016 17:20:35 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1OHKZKb090106; Wed, 24 Feb 2016 17:20:35 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201602241720.u1OHKZKb090106@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Wed, 24 Feb 2016 17:20:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295994 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Feb 2016 17:20:37 -0000 Author: bdrewery Date: Wed Feb 24 17:20:34 2016 New Revision: 295994 URL: https://svnweb.freebsd.org/changeset/base/295994 Log: PROGS: Remove the 'build one' optimization since it breaks 'build multiple' Given PROG1 PROG2, 'make PROG1' would work but 'make PROG1 PROG2' would not. Just build them as normal in a sub-make to avoid any issues. MFC after: 2 weeks Sponsored by: EMC / Isilon Storage Division Modified: head/share/mk/bsd.progs.mk Modified: head/share/mk/bsd.progs.mk ============================================================================== --- head/share/mk/bsd.progs.mk Wed Feb 24 17:20:31 2016 (r295993) +++ head/share/mk/bsd.progs.mk Wed Feb 24 17:20:34 2016 (r295994) @@ -27,18 +27,6 @@ UPDATE_DEPENDFILE_PROG = ${PROGS:[1]} .export UPDATE_DEPENDFILE_PROG .endif -.ifndef PROG -# They may have asked us to build just one -.for t in ${PROGS} -.if make($t) -.if ${PROGS_CXX:U:M${t}} -PROG_CXX ?= $t -.endif -PROG ?= $t -.endif -.endfor -.endif - .if defined(PROG) # just one of many PROG_OVERRIDE_VARS += BINDIR BINGRP BINOWN BINMODE DPSRCS MAN NO_WERROR \ From owner-svn-src-head@freebsd.org Wed Feb 24 17:53:53 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 65651AB21F7 for ; Wed, 24 Feb 2016 17:53:53 +0000 (UTC) (envelope-from ed@nuxi.nl) Received: from mail-yk0-x233.google.com (mail-yk0-x233.google.com [IPv6:2607:f8b0:4002:c07::233]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 34D0F1DC6 for ; Wed, 24 Feb 2016 17:53:53 +0000 (UTC) (envelope-from ed@nuxi.nl) Received: by mail-yk0-x233.google.com with SMTP id u9so11188185ykd.1 for ; Wed, 24 Feb 2016 09:53:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nuxi-nl.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=29xvUeuMTdRdkAgKqeki+rSy4yndfil7iUDRHMh1ZCI=; b=oCRwPGxBz+wvmrywxBowgYTmvKt7D7xhccbenhoVxU8HWQGFANFHAF5BiCXXwIVoxh pRoJ8CkUPZSlqWNMBhOo0M6UyXVyY9vl1ZJdR55DvTGtjT7d0B0AOTqaXXuBFu0D7xEg ctydQVPIYgVp7EEqTDU9RmqmNNCBOPLuvv5eT36nP7qJUcuXUDvmWkEqzKlGphNwc/Lt xs8IavMviOkb5JXwiisIfG36KEscxHHqyNeePB4PjbaY8E7iHp5W1n3sWaOH0LcgpXgT ll8E8OjUP9QpP1dwiwavwIFKzOH/qSkqxr8yWZQTRV/ry5yC7eYE6U/+ak7jqZHJbSg7 7/sg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=29xvUeuMTdRdkAgKqeki+rSy4yndfil7iUDRHMh1ZCI=; b=fv9PRYJn603h+OH30SD89HQIcMu/RfNh2Ao6cj1rMAZ6FtDGX9nIMC1BewyJeNaenG +uM28SYkqWZA4mvQZC0J0tr/mGa71B/RLoPY2fFkeSybqC705lF7myEqnEevkUgngNtB 7pFmClFkHvMhL7Mh4V3TbAdRaDdZonmt0LNCGjzIBkgEeoz/nfeU5OXJzjkcvpGa93WG lrHnhPElIAzVKENbkbu0+AXwNvX4wGOAKfY7B6V23v6mt30Hfy6v85FUCOHyraqN+0Hk IMMPZtJ+I588IsBsJrRvAnzdn9D169NEWxR7IrT+EYxwU/8UkD+3c2eLFGcQofQll7li 8Pag== X-Gm-Message-State: AG10YORWeqTJ1NnB5IHEAzXHevZ6JlH8J1nHITsH0IyYremNHAMKv2kq/27SrokYJsuQ4KPnCid6Oi4ia9HinA== MIME-Version: 1.0 X-Received: by 10.37.78.5 with SMTP id c5mr21165414ybb.53.1456336432174; Wed, 24 Feb 2016 09:53:52 -0800 (PST) Received: by 10.129.148.6 with HTTP; Wed, 24 Feb 2016 09:53:52 -0800 (PST) In-Reply-To: <56CDE508.5000903@multiplay.co.uk> References: <201602241710.u1OHAWwM086142@repo.freebsd.org> <56CDE508.5000903@multiplay.co.uk> Date: Wed, 24 Feb 2016 18:53:52 +0100 Message-ID: Subject: Re: svn commit: r295974 - head/sys/kern From: Ed Schouten To: Steven Hartland Cc: Ed Schouten , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Feb 2016 17:53:53 -0000 Hi Steven, 2016-02-24 18:14 GMT+01:00 Steven Hartland : > This should really be commented to this effect in the code otherwise someone > reading the source will think its a mistake. Good point. I also looked at the code a bit more and it looks like we now call unp_drop() with errno == ECONNRESET unconditionally, meaning we can simplify the code a bit. What do you think of the following patch? http://80386.nl/pub/20160224-socket-econnreset.txt Thanks, -- Ed Schouten Nuxi, 's-Hertogenbosch, the Netherlands KvK-nr.: 62051717 From owner-svn-src-head@freebsd.org Wed Feb 24 19:07:36 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 663DBAB3EF9; Wed, 24 Feb 2016 19:07:36 +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 mx1.freebsd.org (Postfix) with ESMTPS id 37FB715D9; Wed, 24 Feb 2016 19:07:36 +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 u1OJ7ZBZ022037; Wed, 24 Feb 2016 19:07:35 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1OJ7Zw8022036; Wed, 24 Feb 2016 19:07:35 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201602241907.u1OJ7Zw8022036@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Wed, 24 Feb 2016 19:07:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295995 - head/share/man/man5 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Feb 2016 19:07:36 -0000 Author: bdrewery Date: Wed Feb 24 19:07:35 2016 New Revision: 295995 URL: https://svnweb.freebsd.org/changeset/base/295995 Log: BDECFLAGS has not been available since r82604 removed /etc/defaults/make.conf. WARNS=6 has provided BDECFLAGS since r94332 as well. MFC after: 1 week Sponsored by: EMC / Isilon Storage Division Modified: head/share/man/man5/make.conf.5 Modified: head/share/man/man5/make.conf.5 ============================================================================== --- head/share/man/man5/make.conf.5 Wed Feb 24 17:20:34 2016 (r295994) +++ head/share/man/man5/make.conf.5 Wed Feb 24 19:07:35 2016 (r295995) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 12, 2015 +.Dd February 24, 2016 .Dt MAKE.CONF 5 .Os .Sh NAME @@ -141,16 +141,6 @@ Optimization levels other than and .Fl O2 are not supported. -.Va BDECFLAGS -is provided as a set of -.Xr cc 1 -settings suggested by -.An Bruce Evans Aq Mt bde@FreeBSD.org -for developing and testing changes. -They can be used, if set, by: -.Bd -literal -offset indent -CFLAGS+=${BDECFLAGS} -.Ed .It Va CPUTYPE .Pq Vt str Controls which processor should be targeted for generated From owner-svn-src-head@freebsd.org Wed Feb 24 19:15:09 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6B9AEAB2259; Wed, 24 Feb 2016 19:15:09 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id 57DAE1C4C; Wed, 24 Feb 2016 19:15:09 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [IPv6:::1]) by freefall.freebsd.org (Postfix) with ESMTP id 528DE161A; Wed, 24 Feb 2016 19:15:09 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [172.31.3.2]) by mail.xzibition.com (Postfix) with ESMTP id 087BA17CE4; Wed, 24 Feb 2016 19:15:09 +0000 (UTC) X-Virus-Scanned: amavisd-new at mail.xzibition.com Received: from mail.xzibition.com ([172.31.3.2]) by mail.xzibition.com (mail.xzibition.com [172.31.3.2]) (amavisd-new, port 10026) with LMTP id Jk-ILFChVKNH; Wed, 24 Feb 2016 19:15:06 +0000 (UTC) Subject: Re: svn commit: r293068 - in head/etc: . mtree DKIM-Filter: OpenDKIM Filter v2.9.2 mail.xzibition.com D967217CDC References: <201601030432.u034W6en043633@repo.freebsd.org> <20160111221614.GC79262@spindle.one-eyed-alien.net> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org To: Warner Losh From: Bryan Drewery Openpgp: id=F9173CB2C3AAEA7A5C8A1F0935D771BB6E4697CF; url=http://www.shatow.net/bryan/bryan2.asc Organization: FreeBSD Message-ID: <56CE0137.4010403@FreeBSD.org> Date: Wed, 24 Feb 2016 11:15:03 -0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 MIME-Version: 1.0 In-Reply-To: <20160111221614.GC79262@spindle.one-eyed-alien.net> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="U70VfFe5GrJBiHOSS1xJ6vJDawEegd30Q" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Feb 2016 19:15:09 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --U70VfFe5GrJBiHOSS1xJ6vJDawEegd30Q Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable > On 03 Jan 2016, at 05:32, Warner Losh wrote: >> Author: imp >> Date: Sun Jan 3 04:32:05 2016 >> New Revision: 293068 >> URL: https://svnweb.freebsd.org/changeset/base/293068 >> >> Log: >> Add libsoft to the tree, just like lib32. Is this commit complete? I only see mtree extractions, but no build or install changes to get the libraries. --=20 Regards, Bryan Drewery --U70VfFe5GrJBiHOSS1xJ6vJDawEegd30Q Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBAgAGBQJWzgE3AAoJEDXXcbtuRpfP3VcH/R+NMVpB9gV/twvLBGd4B5mh cf7W+8iTyTLxp2xUqeT3BZJlT9U9so+NVgT4PktQv1ZsjjnS4qXcefnT2G+42Eez VFgjQB4z9Q7CZ57aNJdfh7myCQ7MQAnKzYAm3GEEILHTgxQK5iVg+zuht86f/fOy CVNsf7QkJofWXpC+9x0hTbMjtwTrO0mzp0XiNobMgyd3fU8yxKA+Law+q8FrHrhz b5/u1ExC/H/QSkbZmd+8DNT9rRjF2QdSpDIsUUgxLmePBqnsK44reauoduQPIo9H h6WuM5MchOim66C9BjYSfP2d5+5C3Fw9hY9gOeo1BK6o2CbddwqqnVfmt8B3+xA= =KbKk -----END PGP SIGNATURE----- --U70VfFe5GrJBiHOSS1xJ6vJDawEegd30Q-- From owner-svn-src-head@freebsd.org Wed Feb 24 19:19:27 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3E366AB2410; Wed, 24 Feb 2016 19:19:27 +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 mx1.freebsd.org (Postfix) with ESMTPS id 147AD1EF0; Wed, 24 Feb 2016 19:19:27 +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 u1OJJQjC025120; Wed, 24 Feb 2016 19:19:26 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1OJJQew025119; Wed, 24 Feb 2016 19:19:26 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201602241919.u1OJJQew025119@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Wed, 24 Feb 2016 19:19:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295996 - head/share/man/man5 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Feb 2016 19:19:27 -0000 Author: bdrewery Date: Wed Feb 24 19:19:25 2016 New Revision: 295996 URL: https://svnweb.freebsd.org/changeset/base/295996 Log: Regenerate Modified: head/share/man/man5/src.conf.5 Modified: head/share/man/man5/src.conf.5 ============================================================================== --- head/share/man/man5/src.conf.5 Wed Feb 24 19:07:35 2016 (r295995) +++ head/share/man/man5/src.conf.5 Wed Feb 24 19:19:25 2016 (r295996) @@ -1,7 +1,7 @@ .\" DO NOT EDIT-- this file is automatically generated. .\" from FreeBSD: head/tools/build/options/makeman 292283 2015-12-15 18:42:30Z bdrewery .\" $FreeBSD$ -.Dd January 9, 2016 +.Dd February 24, 2016 .Dt SRC.CONF 5 .Os .Sh NAME @@ -165,10 +165,16 @@ The resulting system cannot build progra .Pp It is a default setting on arm64/aarch64. +.It Va WITH_BINUTILS +.\" from FreeBSD: head/tools/build/options/WITH_BINUTILS 295491 2016-02-11 00:14:00Z emaste +Set to build and install binutils (as, ld, objcopy, and objdump) as part +of the normal system build. +.Pp +It is a default setting on +amd64/amd64, arm/arm, arm/armeb, arm/armv6, arm/armv6hf, i386/i386, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, pc98/i386, powerpc/powerpc, powerpc/powerpc64 and sparc64/sparc64. .It Va WITHOUT_BINUTILS_BOOTSTRAP -.\" from FreeBSD: head/tools/build/options/WITHOUT_BINUTILS_BOOTSTRAP 264660 2014-04-18 17:03:58Z imp -Set to not build binutils (as, c++-filt, gconv, -ld, nm, objcopy, objdump, readelf, size and strip) +.\" from FreeBSD: head/tools/build/options/WITHOUT_BINUTILS_BOOTSTRAP 295490 2016-02-10 23:57:09Z emaste +Set to not build binutils (as, ld, objcopy and objdump) as part of the bootstrap process. .Bf -symbolic The option does not work for build targets unless some alternative @@ -177,6 +183,13 @@ toolchain is provided. .Pp It is a default setting on arm64/aarch64. +.It Va WITH_BINUTILS_BOOTSTRAP +.\" from FreeBSD: head/tools/build/options/WITH_BINUTILS_BOOTSTRAP 295491 2016-02-11 00:14:00Z emaste +Set build binutils (as, ld, objcopy and objdump) +as part of the bootstrap process. +.Pp +It is a default setting on +amd64/amd64, arm/arm, arm/armeb, arm/armv6, arm/armv6hf, i386/i386, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, pc98/i386, powerpc/powerpc, powerpc/powerpc64 and sparc64/sparc64. .It Va WITHOUT_BLUETOOTH .\" from FreeBSD: head/tools/build/options/WITHOUT_BLUETOOTH 156932 2006-03-21 07:50:50Z ru Set to not build Bluetooth related kernel modules, programs and libraries. @@ -504,6 +517,8 @@ When set, it also enforces the following .Pp .Bl -item -compact .It +.Va WITH_FAST_DEPEND +.It .Va WITH_INSTALL_AS_USER .El .Pp @@ -601,6 +616,14 @@ instead of the one from GNU Binutils. .Pp It is a default setting on arm64/aarch64. +.It Va WITHOUT_ELFTOOLCHAIN_BOOTSTRAP +.\" from FreeBSD: head/tools/build/options/WITHOUT_ELFTOOLCHAIN_BOOTSTRAP 295491 2016-02-11 00:14:00Z emaste +Set to not build ELF Tool Chain tools +(addr2line, nm, size, strings and strip) +as part of the bootstrap process. +.Bf -symbolic +An alternate bootstrap tool chain must be provided. +.Ef .It Va WITHOUT_EXAMPLES .\" from FreeBSD: head/tools/build/options/WITHOUT_EXAMPLES 156938 2006-03-21 09:06:24Z ru Set to avoid installing examples to @@ -702,6 +725,13 @@ Set to not build .Pp It is a default setting on arm64/aarch64. +.It Va WITH_GDB +.\" from FreeBSD: head/tools/build/options/WITH_GDB 295493 2016-02-11 00:30:51Z emaste +Set to build +.Xr gdb 1 . +.Pp +It is a default setting on +amd64/amd64, arm/arm, arm/armeb, arm/armv6, arm/armv6hf, i386/i386, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, pc98/i386, powerpc/powerpc, powerpc/powerpc64 and sparc64/sparc64. .It Va WITHOUT_GNU .\" from FreeBSD: head/tools/build/options/WITHOUT_GNU 174550 2007-12-12 16:43:17Z ru Set to not build contributed GNU software as a part of the base system. From owner-svn-src-head@freebsd.org Wed Feb 24 20:03:00 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 477F3AA675B; Wed, 24 Feb 2016 20:03:00 +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 mx1.freebsd.org (Postfix) with ESMTPS id 1870780C; Wed, 24 Feb 2016 20:03:00 +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 u1OK2xW6039725; Wed, 24 Feb 2016 20:02:59 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1OK2xsY039724; Wed, 24 Feb 2016 20:02:59 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201602242002.u1OK2xsY039724@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Wed, 24 Feb 2016 20:02:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295997 - head/sys/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Feb 2016 20:03:00 -0000 Author: bdrewery Date: Wed Feb 24 20:02:58 2016 New Revision: 295997 URL: https://svnweb.freebsd.org/changeset/base/295997 Log: Remove hack from r2408 that is no longer needed. Sponsored by: EMC / Isilon Storage Division Modified: head/sys/conf/kern.post.mk Modified: head/sys/conf/kern.post.mk ============================================================================== --- head/sys/conf/kern.post.mk Wed Feb 24 19:19:25 2016 (r295996) +++ head/sys/conf/kern.post.mk Wed Feb 24 20:02:58 2016 (r295997) @@ -181,9 +181,6 @@ hack.So: Makefile ${CC} ${HACK_EXTRA_FLAGS} -nostdlib hack.c -o hack.So rm -f hack.c -# This rule stops ./assym.s in .depend from causing problems. -./assym.s: assym.s - assym.s: $S/kern/genassym.sh genassym.o NM='${NM}' NMFLAGS='${NMFLAGS}' sh $S/kern/genassym.sh genassym.o > ${.TARGET} From owner-svn-src-head@freebsd.org Wed Feb 24 20:04:42 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DFDDFAA6829; Wed, 24 Feb 2016 20:04:42 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AA7FC991; Wed, 24 Feb 2016 20:04:42 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1OK4fWv039824; Wed, 24 Feb 2016 20:04:41 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1OK4fxW039823; Wed, 24 Feb 2016 20:04:41 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201602242004.u1OK4fxW039823@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 24 Feb 2016 20:04:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295998 - head/share/man/man9 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Feb 2016 20:04:43 -0000 Author: kib Date: Wed Feb 24 20:04:41 2016 New Revision: 295998 URL: https://svnweb.freebsd.org/changeset/base/295998 Log: Remove references to Giant in the description of vrele(9). Add notes about vnode lock and sleeping. Reported by: julian Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Modified: head/share/man/man9/vrele.9 Modified: head/share/man/man9/vrele.9 ============================================================================== --- head/share/man/man9/vrele.9 Wed Feb 24 20:02:58 2016 (r295997) +++ head/share/man/man9/vrele.9 Wed Feb 24 20:04:41 2016 (r295998) @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 20, 2010 +.Dd February 24, 2015 .Dt VRELE 9 .Os .Sh NAME @@ -81,9 +81,11 @@ If the .Va v_usecount field of the non-doomed vnode reaches zero, then it will be inactivated and placed on the free list. -Since the functions might need to call VOPs for the vnode, the -.Va Giant -mutex should be conditionally locked around the call. +.Pp +The +.Fn vrele +function may lock the vnode. +All three functions may sleep. .Pp The hold count for the vnode is always greater or equal to the usecount. Non-forced unmount fails when mount point owns a vnode that has non-zero From owner-svn-src-head@freebsd.org Wed Feb 24 20:28:46 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CFAFEAB22DB; Wed, 24 Feb 2016 20:28:46 +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 mx1.freebsd.org (Postfix) with ESMTPS id A119D15AE; Wed, 24 Feb 2016 20:28:46 +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 u1OKSjBx045928; Wed, 24 Feb 2016 20:28:45 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1OKSj43045927; Wed, 24 Feb 2016 20:28:45 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201602242028.u1OKSj43045927@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Wed, 24 Feb 2016 20:28:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295999 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Feb 2016 20:28:46 -0000 Author: bdrewery Date: Wed Feb 24 20:28:45 2016 New Revision: 295999 URL: https://svnweb.freebsd.org/changeset/base/295999 Log: FAST_DEPEND: Still need to remove DEPENDFILE when rebuilding. This avoids _EXTRADEPEND adding duplicate entries. Sponsored by: EMC / Isilon Storage Division Modified: head/share/mk/bsd.dep.mk Modified: head/share/mk/bsd.dep.mk ============================================================================== --- head/share/mk/bsd.dep.mk Wed Feb 24 20:04:41 2016 (r295998) +++ head/share/mk/bsd.dep.mk Wed Feb 24 20:28:45 2016 (r295999) @@ -268,8 +268,10 @@ DPSRCS+= ${SRCS} # FAST_DEPEND will only generate a .depend if _EXTRADEPEND is used but # the target is created to allow 'make depend' to generate files. ${DEPENDFILE}: ${DPSRCS} -.if ${MK_FAST_DEPEND} == "no" +.if exists(${.OBJDIR}/${DEPENDFILE}) rm -f ${DEPENDFILE} +.endif +.if ${MK_FAST_DEPEND} == "no" .if !empty(DPSRCS:M*.[cS]) ${MKDEPCMD} -f ${DEPENDFILE} -a ${MKDEP} \ ${MKDEP_CFLAGS} ${.ALLSRC:M*.[cS]} From owner-svn-src-head@freebsd.org Wed Feb 24 20:28:50 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9451AAB2301; Wed, 24 Feb 2016 20:28:50 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 26AFB15CA; Wed, 24 Feb 2016 20:28:49 +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 u1OKSmg0045973; Wed, 24 Feb 2016 20:28:48 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1OKSmwS045972; Wed, 24 Feb 2016 20:28:48 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201602242028.u1OKSmwS045972@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Wed, 24 Feb 2016 20:28:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r296000 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Feb 2016 20:28:50 -0000 Author: bdrewery Date: Wed Feb 24 20:28:48 2016 New Revision: 296000 URL: https://svnweb.freebsd.org/changeset/base/296000 Log: PROGS: Only the main process will install INCS. MFC after: 2 weeks Sponsored by: EMC / Isilon Storage Division Modified: head/share/mk/bsd.progs.mk Modified: head/share/mk/bsd.progs.mk ============================================================================== --- head/share/mk/bsd.progs.mk Wed Feb 24 20:28:45 2016 (r295999) +++ head/share/mk/bsd.progs.mk Wed Feb 24 20:28:48 2016 (r296000) @@ -62,7 +62,8 @@ UPDATE_DEPENDFILE = NO # These are handled by the main make process. .ifdef _RECURSING_PROGS -_PROGS_GLOBAL_VARS= CLEANFILES CLEANDIRS FILESGROUPS SCRIPTS CONFGROUPS +_PROGS_GLOBAL_VARS= CLEANFILES CLEANDIRS CONFGROUPS FILESGROUPS INCSGROUPS \ + SCRIPTS .for v in ${_PROGS_GLOBAL_VARS} $v = .endfor From owner-svn-src-head@freebsd.org Wed Feb 24 20:32:25 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E98DAAB25DE; Wed, 24 Feb 2016 20:32:25 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B79A51CCE; Wed, 24 Feb 2016 20:32:25 +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 u1OKWOGX048863; Wed, 24 Feb 2016 20:32:24 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1OKWOgf048862; Wed, 24 Feb 2016 20:32:24 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201602242032.u1OKWOgf048862@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 24 Feb 2016 20:32:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r296001 - head/share/man/man9 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Feb 2016 20:32:26 -0000 Author: kib Date: Wed Feb 24 20:32:24 2016 New Revision: 296001 URL: https://svnweb.freebsd.org/changeset/base/296001 Log: Fix year. Noted by: bdrewery MFC after: 2 weeks Modified: head/share/man/man9/vrele.9 Modified: head/share/man/man9/vrele.9 ============================================================================== --- head/share/man/man9/vrele.9 Wed Feb 24 20:28:48 2016 (r296000) +++ head/share/man/man9/vrele.9 Wed Feb 24 20:32:24 2016 (r296001) @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 24, 2015 +.Dd February 24, 2016 .Dt VRELE 9 .Os .Sh NAME From owner-svn-src-head@freebsd.org Wed Feb 24 21:19:46 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1EA2CAB37AD; Wed, 24 Feb 2016 21:19:46 +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 mx1.freebsd.org (Postfix) with ESMTPS id DDFB411D6; Wed, 24 Feb 2016 21:19:45 +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 u1OLJi6U060834; Wed, 24 Feb 2016 21:19:44 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1OLJirr060833; Wed, 24 Feb 2016 21:19:44 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201602242119.u1OLJirr060833@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Wed, 24 Feb 2016 21:19:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r296002 - head/gnu/lib/libgcc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Feb 2016 21:19:46 -0000 Author: bdrewery Date: Wed Feb 24 21:19:44 2016 New Revision: 296002 URL: https://svnweb.freebsd.org/changeset/base/296002 Log: Don't hide AR command as bsd.lib.mk's r283925 changed as well. MFC after: 2 weeks Sponsored by: EMC / Isilon Storage Division Modified: head/gnu/lib/libgcc/Makefile Modified: head/gnu/lib/libgcc/Makefile ============================================================================== --- head/gnu/lib/libgcc/Makefile Wed Feb 24 20:32:24 2016 (r296001) +++ head/gnu/lib/libgcc/Makefile Wed Feb 24 21:19:44 2016 (r296002) @@ -380,7 +380,7 @@ CLEANFILES += libgcc.map libgcc_eh.a: ${EH_OBJS_T} @${ECHO} building static gcc_eh library @rm -f ${.TARGET} - @${AR} ${ARFLAGS} ${.TARGET} `lorder ${EH_OBJS_T} | tsort -q` + ${AR} ${ARFLAGS} ${.TARGET} `lorder ${EH_OBJS_T} | tsort -q` ${RANLIB} ${RANLIBFLAGS} ${.TARGET} _LIBS+= libgcc_eh.a @@ -389,7 +389,7 @@ _LIBS+= libgcc_eh.a libgcc_eh_p.a: ${EH_OBJS_P} @${ECHO} building profiled gcc_eh library @rm -f ${.TARGET} - @${AR} ${ARFLAGS} ${.TARGET} `lorder ${EH_OBJS_P} | tsort -q` + ${AR} ${ARFLAGS} ${.TARGET} `lorder ${EH_OBJS_P} | tsort -q` ${RANLIB} ${RANLIBFLAGS} ${.TARGET} _LIBS+= libgcc_eh_p.a From owner-svn-src-head@freebsd.org Wed Feb 24 22:00:36 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6BD24AB2759; Wed, 24 Feb 2016 22:00:36 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3F8EBDF1; Wed, 24 Feb 2016 22:00:36 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1OM0ZiR072978; Wed, 24 Feb 2016 22:00:35 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1OM0Z3m072977; Wed, 24 Feb 2016 22:00:35 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201602242200.u1OM0Z3m072977@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 24 Feb 2016 22:00:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r296009 - head/sys/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Feb 2016 22:00:36 -0000 Author: kib Date: Wed Feb 24 22:00:35 2016 New Revision: 296009 URL: https://svnweb.freebsd.org/changeset/base/296009 Log: In bpf_getdltlist(), do not call copyout(9) while holding bpf lock. Copy the data into temprorary malloced buffer and drop the lock for copyout. Reported, reviewed and tested by: cem Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/net/bpf.c Modified: head/sys/net/bpf.c ============================================================================== --- head/sys/net/bpf.c Wed Feb 24 21:41:28 2016 (r296008) +++ head/sys/net/bpf.c Wed Feb 24 22:00:35 2016 (r296009) @@ -2681,26 +2681,44 @@ bpf_ifdetach(void *arg __unused, struct static int bpf_getdltlist(struct bpf_d *d, struct bpf_dltlist *bfl) { - int n, error; struct ifnet *ifp; struct bpf_if *bp; + u_int *lst; + int error, n, n1; BPF_LOCK_ASSERT(); ifp = d->bd_bif->bif_ifp; +again: + n1 = 0; + LIST_FOREACH(bp, &bpf_iflist, bif_next) { + if (bp->bif_ifp == ifp) + n1++; + } + if (bfl->bfl_list == NULL) { + bfl->bfl_len = n1; + return (0); + } + if (n1 > bfl->bfl_len) + return (ENOMEM); + BPF_UNLOCK(); + lst = malloc(n1 * sizeof(u_int), M_TEMP, M_WAITOK); n = 0; - error = 0; + BPF_LOCK(); LIST_FOREACH(bp, &bpf_iflist, bif_next) { if (bp->bif_ifp != ifp) continue; - if (bfl->bfl_list != NULL) { - if (n >= bfl->bfl_len) - return (ENOMEM); - error = copyout(&bp->bif_dlt, - bfl->bfl_list + n, sizeof(u_int)); + if (n > n1) { + free(lst, M_TEMP); + goto again; } + lst[n] = bp->bif_dlt; n++; } + BPF_UNLOCK(); + error = copyout(lst, bfl->bfl_list, sizeof(u_int) * n); + free(lst, M_TEMP); + BPF_LOCK(); bfl->bfl_len = n; return (error); } From owner-svn-src-head@freebsd.org Wed Feb 24 22:27:20 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 84F78AB3278; Wed, 24 Feb 2016 22:27:20 +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 mx1.freebsd.org (Postfix) with ESMTPS id 335371E95; Wed, 24 Feb 2016 22:27:20 +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 u1OMRJC7081668; Wed, 24 Feb 2016 22:27:19 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1OMRJ3R081667; Wed, 24 Feb 2016 22:27:19 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201602242227.u1OMRJ3R081667@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Wed, 24 Feb 2016 22:27:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r296012 - head/gnu/lib/libgcc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Feb 2016 22:27:20 -0000 Author: bdrewery Date: Wed Feb 24 22:27:18 2016 New Revision: 296012 URL: https://svnweb.freebsd.org/changeset/base/296012 Log: OBJS and POBJS have not been used since r215127. r215127 disabled building of libgcc.a. MFC after: 2 weeks Sponsored by: EMC / Isilon Storage Division Modified: head/gnu/lib/libgcc/Makefile Modified: head/gnu/lib/libgcc/Makefile ============================================================================== --- head/gnu/lib/libgcc/Makefile Wed Feb 24 22:07:56 2016 (r296011) +++ head/gnu/lib/libgcc/Makefile Wed Feb 24 22:27:18 2016 (r296012) @@ -33,7 +33,7 @@ CFLAGS+= -DIN_GCC -DIN_LIBGCC2 -D__GCC_F LDFLAGS+= -nodefaultlibs LIBADD+= c -OBJS= # added to below in various ways depending on TARGET_CPUARCH +SOBJS= # added to below in various ways depending on TARGET_CPUARCH #--------------------------------------------------------------------------- # @@ -252,7 +252,7 @@ OBJ_GRPS += FPBIT DPBIT ${T}_OBJS_T = ${${T}_FUNCS:S/$/.o/} ${T}_OBJS_P = ${${T}_FUNCS:S/$/.po/} ${T}_OBJS_S = ${${T}_FUNCS:S/$/.So/} -OBJS += ${${T}_FUNCS:S/$/.o/} +SOBJS += ${${T}_FUNCS:S/$/.So/} ${${T}_OBJS_T}: ${${T}_CFILE} ${COMMONHDRS} ${CC_T} ${${T}_CFLAGS} -DL${.PREFIX} -o ${.TARGET} ${.ALLSRC:M*.c} @@ -267,9 +267,7 @@ ${${T}_OBJS_S}: ${${T}_CFILE} ${COMMONHD # Extra objects coming from separate files # .if !empty(LIB2ADD) -OBJS += ${LIB2ADD:R:S/$/.o/} SOBJS += ${LIB2ADD:R:S/$/.So/} -POBJS += ${LIB2ADD:R:S/$/.po/} .endif #----------------------------------------------------------------------- @@ -295,7 +293,7 @@ ASM_T = ${LIB1ASMFUNCS:S/$/.o/} ASM_P = ${LIB1ASMFUNCS:S/$/.po/} ASM_S = ${LIB1ASMFUNCS:S/$/.So/} ASM_V = ${LIB1ASMFUNCS:S/$/.vis/} -OBJS += ${LIB1ASMFUNCS:S/$/.o/} +SOBJS += ${LIB1ASMFUNCS:S/$/.So/} ${ASM_T}: ${LIB1ASMSRC} ${.PREFIX}.vis ${CC} -x assembler-with-cpp -c ${CFLAGS} -DL${.PREFIX} \ @@ -363,7 +361,7 @@ SHLIB_MAPFILES += ${GCCDIR}/config/arm/ .endif VERSION_MAP = libgcc.map -libgcc.map: ${SHLIB_MKMAP} ${SHLIB_MAPFILES} ${SOBJS} ${OBJS:R:S/$/.So/} +libgcc.map: ${SHLIB_MKMAP} ${SHLIB_MAPFILES} ${SOBJS} ( ${NM} -pg ${SOBJS};echo %% ; \ cat ${SHLIB_MAPFILES} \ | sed -e '/^[ ]*#/d' \ From owner-svn-src-head@freebsd.org Wed Feb 24 22:27:23 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 87F5BAB3298; Wed, 24 Feb 2016 22:27:23 +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 mx1.freebsd.org (Postfix) with ESMTPS id 5C6011EB7; Wed, 24 Feb 2016 22:27:23 +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 u1OMRMEK081715; Wed, 24 Feb 2016 22:27:22 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1OMRMSD081714; Wed, 24 Feb 2016 22:27:22 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201602242227.u1OMRMSD081714@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Wed, 24 Feb 2016 22:27:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r296013 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Feb 2016 22:27:23 -0000 Author: bdrewery Date: Wed Feb 24 22:27:22 2016 New Revision: 296013 URL: https://svnweb.freebsd.org/changeset/base/296013 Log: Add more STANDALONE_SUBDIR_TARGETS. Sponsored by: EMC / Isilon Storage Division Modified: head/share/mk/bsd.subdir.mk Modified: head/share/mk/bsd.subdir.mk ============================================================================== --- head/share/mk/bsd.subdir.mk Wed Feb 24 22:27:18 2016 (r296012) +++ head/share/mk/bsd.subdir.mk Wed Feb 24 22:27:22 2016 (r296013) @@ -47,8 +47,15 @@ SUBDIR_TARGETS+= \ # Described above. STANDALONE_SUBDIR_TARGETS+= \ - obj check checkdpadd clean cleandepend cleandir \ - cleanilinks cleanobj installconfig \ + all-man buildconfig buildfiles buildincludes check checkdpadd \ + clean cleandepend cleandir cleanilinks cleanobj files includes \ + installconfig installincludes installfiles maninstall manlint \ + obj objlink \ + +# It is safe to install in parallel when staging. +.if defined(NO_ROOT) +STANDALONE_SUBDIR_TARGETS+= realinstall +.endif .include From owner-svn-src-head@freebsd.org Wed Feb 24 22:27:26 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B4F07AB32C4; Wed, 24 Feb 2016 22:27:26 +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 mx1.freebsd.org (Postfix) with ESMTPS id 7C3D81F5D; Wed, 24 Feb 2016 22:27:26 +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 u1OMRPhH081762; Wed, 24 Feb 2016 22:27:25 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1OMRPKH081761; Wed, 24 Feb 2016 22:27:25 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201602242227.u1OMRPKH081761@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Wed, 24 Feb 2016 22:27:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r296014 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Feb 2016 22:27:26 -0000 Author: bdrewery Date: Wed Feb 24 22:27:25 2016 New Revision: 296014 URL: https://svnweb.freebsd.org/changeset/base/296014 Log: Add order for installworld/installkernel. MFC after: 2 weeks Sponsored by: EMC / Isilon Storage Division Modified: head/Makefile Modified: head/Makefile ============================================================================== --- head/Makefile Wed Feb 24 22:27:22 2016 (r296013) +++ head/Makefile Wed Feb 24 22:27:25 2016 (r296014) @@ -138,6 +138,7 @@ TGTS+= ${BITGTS} .ORDER: buildworld distributeworld .ORDER: buildworld buildkernel .ORDER: installworld distribution +.ORDER: installworld installkernel .ORDER: buildkernel installkernel .ORDER: buildkernel installkernel.debug .ORDER: buildkernel reinstallkernel From owner-svn-src-head@freebsd.org Thu Feb 25 01:03:35 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 86DFCAB355C; Thu, 25 Feb 2016 01:03:35 +0000 (UTC) (envelope-from jmcneill@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5319F19D7; Thu, 25 Feb 2016 01:03:35 +0000 (UTC) (envelope-from jmcneill@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1P13YMe027872; Thu, 25 Feb 2016 01:03:34 GMT (envelope-from jmcneill@FreeBSD.org) Received: (from jmcneill@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1P13YKd027871; Thu, 25 Feb 2016 01:03:34 GMT (envelope-from jmcneill@FreeBSD.org) Message-Id: <201602250103.u1P13YKd027871@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jmcneill set sender to jmcneill@FreeBSD.org using -f From: Jared McNeill Date: Thu, 25 Feb 2016 01:03:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r296017 - head/share/misc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Feb 2016 01:03:35 -0000 Author: jmcneill Date: Thu Feb 25 01:03:34 2016 New Revision: 296017 URL: https://svnweb.freebsd.org/changeset/base/296017 Log: Add myself as src committer. Approved by: gonzo (mentor) Modified: head/share/misc/committers-src.dot Modified: head/share/misc/committers-src.dot ============================================================================== --- head/share/misc/committers-src.dot Thu Feb 25 00:37:51 2016 (r296016) +++ head/share/misc/committers-src.dot Thu Feb 25 01:03:34 2016 (r296017) @@ -200,6 +200,7 @@ jkim [label="Jung-uk Kim\njkim@FreeBSD.o jkoshy [label="A. Joseph Koshy\njkoshy@FreeBSD.org\n1998/05/13"] jlh [label="Jeremie Le Hen\njlh@FreeBSD.org\n2012/04/22"] jls [label="Jordan Sissel\njls@FreeBSD.org\n2006/12/06"] +jmcneill [label="Jared McNeill\njmcneill@FreeBSD.org\n2016/02/24"] jmg [label="John-Mark Gurney\njmg@FreeBSD.org\n1997/02/13"] jmmv [label="Julio Merino\njmmv@FreeBSD.org\n2013/11/02"] joerg [label="Joerg Wunsch\njoerg@FreeBSD.org\n1993/11/14"] @@ -340,6 +341,7 @@ day1 -> alm day1 -> dg adrian -> avos +adrian -> jmcneill adrian -> lidl adrian -> loos adrian -> monthadar @@ -470,6 +472,8 @@ gnn -> erj gnn -> kp gnn -> jtl +gonzo -> jmcneill + grehan -> bryanv grog -> edwin From owner-svn-src-head@freebsd.org Thu Feb 25 01:10:58 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2D5ADAB3A83; Thu, 25 Feb 2016 01:10:58 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EEF1D365; Thu, 25 Feb 2016 01:10:57 +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 u1P1AuG7028915; Thu, 25 Feb 2016 01:10:56 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1P1AucG028913; Thu, 25 Feb 2016 01:10:56 GMT (envelope-from np@FreeBSD.org) Message-Id: <201602250110.u1P1AucG028913@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Thu, 25 Feb 2016 01:10:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r296018 - head/sys/dev/cxgbe X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Feb 2016 01:10:58 -0000 Author: np Date: Thu Feb 25 01:10:56 2016 New Revision: 296018 URL: https://svnweb.freebsd.org/changeset/base/296018 Log: cxgbe(4): Add a sysctl to retrieve the maximum speed/bandwidth supported by a port. dev.cxgbe..max_speed dev.cxl..max_speed Sponsored by: Chelsio Communications Modified: head/sys/dev/cxgbe/adapter.h head/sys/dev/cxgbe/t4_main.c Modified: head/sys/dev/cxgbe/adapter.h ============================================================================== --- head/sys/dev/cxgbe/adapter.h Thu Feb 25 01:03:34 2016 (r296017) +++ head/sys/dev/cxgbe/adapter.h Thu Feb 25 01:10:56 2016 (r296018) @@ -1011,6 +1011,22 @@ is_40G_port(const struct port_info *pi) } static inline int +port_top_speed(const struct port_info *pi) +{ + + if (pi->link_cfg.supported & FW_PORT_CAP_SPEED_100G) + return (100); + if (pi->link_cfg.supported & FW_PORT_CAP_SPEED_40G) + return (40); + if (pi->link_cfg.supported & FW_PORT_CAP_SPEED_10G) + return (10); + if (pi->link_cfg.supported & FW_PORT_CAP_SPEED_1G) + return (1); + + return (0); +} + +static inline int tx_resume_threshold(struct sge_eq *eq) { Modified: head/sys/dev/cxgbe/t4_main.c ============================================================================== --- head/sys/dev/cxgbe/t4_main.c Thu Feb 25 01:03:34 2016 (r296017) +++ head/sys/dev/cxgbe/t4_main.c Thu Feb 25 01:10:56 2016 (r296018) @@ -5499,6 +5499,9 @@ cxgbe_sysctls(struct port_info *pi) CTLTYPE_STRING | CTLFLAG_RW, pi, PAUSE_TX, sysctl_pause_settings, "A", "PAUSE settings (bit 0 = rx_pause, bit 1 = tx_pause)"); + SYSCTL_ADD_INT(ctx, children, OID_AUTO, "max_speed", CTLFLAG_RD, NULL, + port_top_speed(pi), "max speed (in Gbps)"); + /* * dev.cxgbe.X.stats. */ From owner-svn-src-head@freebsd.org Thu Feb 25 01:24:04 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 408B1AB2260; Thu, 25 Feb 2016 01:24:04 +0000 (UTC) (envelope-from jmcneill@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EB5A3FE3; Thu, 25 Feb 2016 01:24:03 +0000 (UTC) (envelope-from jmcneill@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1P1O2ff033698; Thu, 25 Feb 2016 01:24:02 GMT (envelope-from jmcneill@FreeBSD.org) Received: (from jmcneill@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1P1O27Y033697; Thu, 25 Feb 2016 01:24:02 GMT (envelope-from jmcneill@FreeBSD.org) Message-Id: <201602250124.u1P1O27Y033697@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jmcneill set sender to jmcneill@FreeBSD.org using -f From: Jared McNeill Date: Thu, 25 Feb 2016 01:24:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r296019 - head/sys/arm/allwinner X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Feb 2016 01:24:04 -0000 Author: jmcneill Date: Thu Feb 25 01:24:02 2016 New Revision: 296019 URL: https://svnweb.freebsd.org/changeset/base/296019 Log: Fix dedicated DMA transfers. For sources and destinations marked "noincr", the previous code was incorrectly programming the dedicated DMA channel control register using bit definitions for normal DMA channels. This code path is not currently used, but will be used by the HDMI audio driver in review. Reviewed by: andrew Approved by: gonzo (mentor) Differential Revision: https://reviews.freebsd.org/D5382 Modified: head/sys/arm/allwinner/a10_dmac.c Modified: head/sys/arm/allwinner/a10_dmac.c ============================================================================== --- head/sys/arm/allwinner/a10_dmac.c Thu Feb 25 01:10:56 2016 (r296018) +++ head/sys/arm/allwinner/a10_dmac.c Thu Feb 25 01:24:02 2016 (r296019) @@ -222,8 +222,8 @@ a10dmac_set_config(device_t dev, void *p { struct a10dmac_channel *ch = priv; uint32_t val; - unsigned int dst_dw, dst_bl, dst_bs, dst_wc; - unsigned int src_dw, src_bl, src_bs, src_wc; + unsigned int dst_dw, dst_bl, dst_bs, dst_wc, dst_am; + unsigned int src_dw, src_bl, src_bs, src_wc, src_am; switch (cfg->dst_width) { case 8: @@ -284,16 +284,23 @@ a10dmac_set_config(device_t dev, void *p (src_dw << AWIN_DMA_CTL_SRC_DATA_WIDTH_SHIFT) | (src_bl << AWIN_DMA_CTL_SRC_BURST_LEN_SHIFT) | (cfg->src_drqtype << AWIN_DMA_CTL_SRC_DRQ_TYPE_SHIFT); - if (cfg->dst_noincr) { - val |= AWIN_NDMA_CTL_DST_ADDR_NOINCR; - } - if (cfg->src_noincr) { - val |= AWIN_NDMA_CTL_SRC_ADDR_NOINCR; - } if (ch->ch_type == CH_NDMA) { + if (cfg->dst_noincr) + val |= AWIN_NDMA_CTL_DST_ADDR_NOINCR; + if (cfg->src_noincr) + val |= AWIN_NDMA_CTL_SRC_ADDR_NOINCR; + DMACH_WRITE(ch, AWIN_NDMA_CTL_REG, val); } else { + dst_am = cfg->dst_noincr ? AWIN_DDMA_CTL_DMA_ADDR_IO : + AWIN_DDMA_CTL_DMA_ADDR_LINEAR; + src_am = cfg->src_noincr ? AWIN_DDMA_CTL_DMA_ADDR_IO : + AWIN_DDMA_CTL_DMA_ADDR_LINEAR; + + val |= (dst_am << AWIN_DDMA_CTL_DST_ADDR_MODE_SHIFT); + val |= (src_am << AWIN_DDMA_CTL_SRC_ADDR_MODE_SHIFT); + DMACH_WRITE(ch, AWIN_DDMA_CTL_REG, val); dst_bs = cfg->dst_blksize - 1; From owner-svn-src-head@freebsd.org Thu Feb 25 02:46:49 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 48191AB20E9; Thu, 25 Feb 2016 02:46:49 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0FB7A1988; Thu, 25 Feb 2016 02:46:48 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1P2kmw9057255; Thu, 25 Feb 2016 02:46:48 GMT (envelope-from smh@FreeBSD.org) Received: (from smh@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1P2klFq057254; Thu, 25 Feb 2016 02:46:47 GMT (envelope-from smh@FreeBSD.org) Message-Id: <201602250246.u1P2klFq057254@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: smh set sender to smh@FreeBSD.org using -f From: Steven Hartland Date: Thu, 25 Feb 2016 02:46:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r296020 - head/sys/dev/mrsas X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Feb 2016 02:46:49 -0000 Author: smh Date: Thu Feb 25 02:46:47 2016 New Revision: 296020 URL: https://svnweb.freebsd.org/changeset/base/296020 Log: Fix NULL pointer dereferences Fix NULL pointer dereferences identified as V522 by PVS-Studio. MFC after: 1 week Sponsored by: Multiplay Modified: head/sys/dev/mrsas/mrsas.c Modified: head/sys/dev/mrsas/mrsas.c ============================================================================== --- head/sys/dev/mrsas/mrsas.c Thu Feb 25 01:24:02 2016 (r296019) +++ head/sys/dev/mrsas/mrsas.c Thu Feb 25 02:46:47 2016 (r296020) @@ -1274,14 +1274,12 @@ mrsas_get_softc_instance(struct cdev *de * Application */ sc = mrsas_mgmt_info.sc_ptr[user_ioc->host_no]; - if ((user_ioc->host_no >= mrsas_mgmt_info.max_index) || (sc == NULL)) { - if (sc == NULL) - mrsas_dprint(sc, MRSAS_FAULT, - "There is no Controller number %d .\n", user_ioc->host_no); - else - mrsas_dprint(sc, MRSAS_FAULT, - "Invalid Controller number %d .\n", user_ioc->host_no); - } + if (sc == NULL) + printf("There is no Controller number %d\n", + user_ioc->host_no); + else if (user_ioc->host_no >= mrsas_mgmt_info.max_index) + mrsas_dprint(sc, MRSAS_FAULT, + "Invalid Controller number %d\n", user_ioc->host_no); } return sc; @@ -4023,8 +4021,8 @@ mrsas_aen_handler(struct mrsas_softc *sc u_int32_t seq_num; int error; - if (!sc) { - device_printf(sc->mrsas_dev, "invalid instance!\n"); + if (sc == NULL) { + printf("invalid instance!\n"); return; } if (sc->evt_detail_mem) { From owner-svn-src-head@freebsd.org Thu Feb 25 03:01:26 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7638BAB27F8; Thu, 25 Feb 2016 03:01:26 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 41940804; Thu, 25 Feb 2016 03:01:26 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1P31PIW062512; Thu, 25 Feb 2016 03:01:25 GMT (envelope-from smh@FreeBSD.org) Received: (from smh@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1P31Plt062511; Thu, 25 Feb 2016 03:01:25 GMT (envelope-from smh@FreeBSD.org) Message-Id: <201602250301.u1P31Plt062511@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: smh set sender to smh@FreeBSD.org using -f From: Steven Hartland Date: Thu, 25 Feb 2016 03:01:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r296021 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Feb 2016 03:01:26 -0000 Author: smh Date: Thu Feb 25 03:01:24 2016 New Revision: 296021 URL: https://svnweb.freebsd.org/changeset/base/296021 Log: Removed unused label and fix mutex_exit order Remove unused done label from zfs_setacl fixing PVS-Studio V729. Fix mutex_exit order to mirror the mutex_enter order. MFC after: 1 week Sponsored by: Multiplay Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_acl.c 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 Thu Feb 25 02:46:47 2016 (r296020) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_acl.c Thu Feb 25 03:01:24 2016 (r296021) @@ -1994,8 +1994,8 @@ top: zfs_sa_upgrade_txholds(tx, zp); error = dmu_tx_assign(tx, TXG_NOWAIT); if (error) { - mutex_exit(&zp->z_acl_lock); mutex_exit(&zp->z_lock); + mutex_exit(&zp->z_acl_lock); if (error == ERESTART) { dmu_tx_wait(tx); @@ -2020,7 +2020,6 @@ top: if (fuidp) zfs_fuid_info_free(fuidp); dmu_tx_commit(tx); -done: mutex_exit(&zp->z_lock); mutex_exit(&zp->z_acl_lock); From owner-svn-src-head@freebsd.org Thu Feb 25 03:21:27 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 62FD3AB1221; Thu, 25 Feb 2016 03:21:27 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1BF6D13B7; Thu, 25 Feb 2016 03:21:27 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1P3LQin066674; Thu, 25 Feb 2016 03:21:26 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1P3LQto066672; Thu, 25 Feb 2016 03:21:26 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201602250321.u1P3LQto066672@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Thu, 25 Feb 2016 03:21:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r296022 - head/sys/dev/hyperv/netvsc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Feb 2016 03:21:27 -0000 Author: sephe Date: Thu Feb 25 03:21:25 2016 New Revision: 296022 URL: https://svnweb.freebsd.org/changeset/base/296022 Log: hyperv/hn: Implement ifnet.if_transmit method It will be turned on by default later. MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D5415 Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.h head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.h ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_net_vsc.h Thu Feb 25 03:01:24 2016 (r296021) +++ head/sys/dev/hyperv/netvsc/hv_net_vsc.h Thu Feb 25 03:21:25 2016 (r296022) @@ -1034,6 +1034,9 @@ struct hn_tx_ring { struct task hn_tx_task; struct task hn_txeof_task; + struct buf_ring *hn_mbuf_br; + int hn_oactive; + struct mtx hn_tx_lock; struct hn_softc *hn_sc; Modified: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Thu Feb 25 03:01:24 2016 (r296021) +++ head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Thu Feb 25 03:21:25 2016 (r296022) @@ -272,6 +272,10 @@ static int hn_bind_tx_taskq = -1; SYSCTL_INT(_hw_hn, OID_AUTO, bind_tx_taskq, CTLFLAG_RDTUN, &hn_bind_tx_taskq, 0, "Bind TX taskqueue to the specified cpu"); +static int hn_use_if_start = 1; +SYSCTL_INT(_hw_hn, OID_AUTO, use_if_start, CTLFLAG_RDTUN, + &hn_use_if_start, 0, "Use if_start TX method"); + /* * Forward declarations */ @@ -305,6 +309,13 @@ static void hn_create_rx_data(struct hn_ static void hn_destroy_rx_data(struct hn_softc *sc); static void hn_set_tx_chimney_size(struct hn_softc *, int); +static int hn_transmit(struct ifnet *, struct mbuf *); +static void hn_xmit_qflush(struct ifnet *); +static int hn_xmit(struct hn_tx_ring *, int); +static void hn_xmit_txeof(struct hn_tx_ring *); +static void hn_xmit_taskfunc(void *, int); +static void hn_xmit_txeof_taskfunc(void *, int); + static int hn_ifmedia_upd(struct ifnet *ifp __unused) { @@ -422,13 +433,18 @@ netvsc_attach(device_t dev) ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST; ifp->if_ioctl = hn_ioctl; - ifp->if_start = hn_start; ifp->if_init = hn_ifinit; /* needed by hv_rf_on_device_add() code */ ifp->if_mtu = ETHERMTU; - IFQ_SET_MAXLEN(&ifp->if_snd, 512); - ifp->if_snd.ifq_drv_maxlen = 511; - IFQ_SET_READY(&ifp->if_snd); + if (hn_use_if_start) { + ifp->if_start = hn_start; + IFQ_SET_MAXLEN(&ifp->if_snd, 512); + ifp->if_snd.ifq_drv_maxlen = 511; + IFQ_SET_READY(&ifp->if_snd); + } else { + ifp->if_transmit = hn_transmit; + ifp->if_qflush = hn_xmit_qflush; + } ifmedia_init(&sc->hn_media, 0, hn_ifmedia_upd, hn_ifmedia_sts); ifmedia_add(&sc->hn_media, IFM_ETHER | IFM_AUTO, 0, NULL); @@ -924,6 +940,12 @@ again: if (!error) { ETHER_BPF_MTAP(ifp, txd->m); if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1); + if (!hn_use_if_start) { + if_inc_counter(ifp, IFCOUNTER_OBYTES, + txd->m->m_pkthdr.len); + if (txd->m->m_flags & M_MCAST) + if_inc_counter(ifp, IFCOUNTER_OMCASTS, 1); + } } hn_txdesc_put(txr, txd); @@ -976,6 +998,8 @@ hn_start_locked(struct hn_tx_ring *txr, struct ifnet *ifp = sc->hn_ifp; struct hv_device *device_ctx = vmbus_get_devctx(sc->hn_dev); + KASSERT(hn_use_if_start, + ("hn_start_locked is called, when if_start is disabled")); KASSERT(txr == &sc->hn_tx_ring[0], ("not the first TX ring")); mtx_assert(&txr->hn_tx_lock, MA_OWNED); @@ -1530,7 +1554,7 @@ static void hn_stop(hn_softc_t *sc) { struct ifnet *ifp; - int ret; + int ret, i; struct hv_device *device_ctx = vmbus_get_devctx(sc->hn_dev); ifp = sc->hn_ifp; @@ -1540,6 +1564,9 @@ hn_stop(hn_softc_t *sc) atomic_clear_int(&ifp->if_drv_flags, (IFF_DRV_RUNNING | IFF_DRV_OACTIVE)); + for (i = 0; i < sc->hn_tx_ring_cnt; ++i) + sc->hn_tx_ring[i].hn_oactive = 0; + if_link_state_change(ifp, LINK_STATE_DOWN); sc->hn_initdone = 0; @@ -1612,7 +1639,7 @@ hn_ifinit_locked(hn_softc_t *sc) { struct ifnet *ifp; struct hv_device *device_ctx = vmbus_get_devctx(sc->hn_dev); - int ret; + int ret, i; ifp = sc->hn_ifp; @@ -1628,7 +1655,11 @@ hn_ifinit_locked(hn_softc_t *sc) } else { sc->hn_initdone = 1; } + atomic_clear_int(&ifp->if_drv_flags, IFF_DRV_OACTIVE); + for (i = 0; i < sc->hn_tx_ring_cnt; ++i) + sc->hn_tx_ring[i].hn_oactive = 0; + atomic_set_int(&ifp->if_drv_flags, IFF_DRV_RUNNING); if_link_state_change(ifp, LINK_STATE_UP); } @@ -2115,8 +2146,18 @@ hn_create_tx_ring(struct hn_softc *sc, i #endif txr->hn_tx_taskq = sc->hn_tx_taskq; - TASK_INIT(&txr->hn_tx_task, 0, hn_start_taskfunc, txr); - TASK_INIT(&txr->hn_txeof_task, 0, hn_start_txeof_taskfunc, txr); + + if (hn_use_if_start) { + txr->hn_txeof = hn_start_txeof; + TASK_INIT(&txr->hn_tx_task, 0, hn_start_taskfunc, txr); + TASK_INIT(&txr->hn_txeof_task, 0, hn_start_txeof_taskfunc, txr); + } else { + txr->hn_txeof = hn_xmit_txeof; + TASK_INIT(&txr->hn_tx_task, 0, hn_xmit_taskfunc, txr); + TASK_INIT(&txr->hn_txeof_task, 0, hn_xmit_txeof_taskfunc, txr); + txr->hn_mbuf_br = buf_ring_alloc(txr->hn_txdesc_cnt, M_NETVSC, + M_WAITOK, &txr->hn_tx_lock); + } txr->hn_direct_tx_size = hn_direct_tx_size; if (hv_vmbus_protocal_version >= HV_VMBUS_VERSION_WIN8_1) @@ -2130,8 +2171,6 @@ hn_create_tx_ring(struct hn_softc *sc, i */ txr->hn_sched_tx = 1; - txr->hn_txeof = hn_start_txeof; /* TODO: if_transmit */ - parent_dtag = bus_get_dma_tag(sc->hn_dev); /* DMA tag for RNDIS messages. */ @@ -2248,6 +2287,11 @@ hn_create_tx_ring(struct hn_softc *sc, i SYSCTL_ADD_INT(ctx, child, OID_AUTO, "txdesc_avail", CTLFLAG_RD, &txr->hn_txdesc_avail, 0, "# of available TX descs"); + if (!hn_use_if_start) { + SYSCTL_ADD_INT(ctx, child, OID_AUTO, "oactive", + CTLFLAG_RD, &txr->hn_oactive, 0, + "over active"); + } } } @@ -2298,6 +2342,9 @@ hn_destroy_tx_ring(struct hn_tx_ring *tx free(txr->hn_txdesc, M_NETVSC); txr->hn_txdesc = NULL; + if (txr->hn_mbuf_br != NULL) + buf_ring_free(txr->hn_mbuf_br, M_NETVSC); + #ifndef HN_USE_TXDESC_BUFRING mtx_destroy(&txr->hn_txlist_spin); #endif @@ -2311,7 +2358,12 @@ hn_create_tx_data(struct hn_softc *sc) struct sysctl_ctx_list *ctx; int i; - sc->hn_tx_ring_cnt = 1; /* TODO: vRSS */ + if (hn_use_if_start) { + /* ifnet.if_start only needs one TX ring */ + sc->hn_tx_ring_cnt = 1; + } else { + sc->hn_tx_ring_cnt = 1; /* TODO: vRSS */ + } sc->hn_tx_ring = malloc(sizeof(struct hn_tx_ring) * sc->hn_tx_ring_cnt, M_NETVSC, M_WAITOK | M_ZERO); @@ -2436,6 +2488,166 @@ hn_stop_tx_tasks(struct hn_softc *sc) } } +static int +hn_xmit(struct hn_tx_ring *txr, int len) +{ + struct hn_softc *sc = txr->hn_sc; + struct ifnet *ifp = sc->hn_ifp; + struct hv_device *device_ctx = vmbus_get_devctx(sc->hn_dev); + struct mbuf *m_head; + + mtx_assert(&txr->hn_tx_lock, MA_OWNED); + KASSERT(hn_use_if_start == 0, + ("hn_xmit is called, when if_start is enabled")); + + if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0 || txr->hn_oactive) + return 0; + + while ((m_head = drbr_peek(ifp, txr->hn_mbuf_br)) != NULL) { + struct hn_txdesc *txd; + int error; + + if (len > 0 && m_head->m_pkthdr.len > len) { + /* + * This sending could be time consuming; let callers + * dispatch this packet sending (and sending of any + * following up packets) to tx taskqueue. + */ + drbr_putback(ifp, txr->hn_mbuf_br, m_head); + return 1; + } + + txd = hn_txdesc_get(txr); + if (txd == NULL) { + txr->hn_no_txdescs++; + drbr_putback(ifp, txr->hn_mbuf_br, m_head); + txr->hn_oactive = 1; + break; + } + + error = hn_encap(txr, txd, &m_head); + if (error) { + /* Both txd and m_head are freed; discard */ + drbr_advance(ifp, txr->hn_mbuf_br); + continue; + } + + error = hn_send_pkt(ifp, device_ctx, txr, txd); + if (__predict_false(error)) { + /* txd is freed, but m_head is not */ + drbr_putback(ifp, txr->hn_mbuf_br, m_head); + txr->hn_oactive = 1; + break; + } + + /* Sent */ + drbr_advance(ifp, txr->hn_mbuf_br); + } + return 0; +} + +static int +hn_transmit(struct ifnet *ifp, struct mbuf *m) +{ + struct hn_softc *sc = ifp->if_softc; + struct hn_tx_ring *txr; + int error; + + /* TODO: vRSS, TX ring selection */ + txr = &sc->hn_tx_ring[0]; + + error = drbr_enqueue(ifp, txr->hn_mbuf_br, m); + if (error) + return error; + + if (txr->hn_oactive) + return 0; + + if (txr->hn_sched_tx) + goto do_sched; + + if (mtx_trylock(&txr->hn_tx_lock)) { + int sched; + + sched = hn_xmit(txr, txr->hn_direct_tx_size); + mtx_unlock(&txr->hn_tx_lock); + if (!sched) + return 0; + } +do_sched: + taskqueue_enqueue(txr->hn_tx_taskq, &txr->hn_tx_task); + return 0; +} + +static void +hn_xmit_qflush(struct ifnet *ifp) +{ + struct hn_softc *sc = ifp->if_softc; + int i; + + for (i = 0; i < sc->hn_tx_ring_cnt; ++i) { + struct hn_tx_ring *txr = &sc->hn_tx_ring[i]; + struct mbuf *m; + + mtx_lock(&txr->hn_tx_lock); + while ((m = buf_ring_dequeue_sc(txr->hn_mbuf_br)) != NULL) + m_freem(m); + mtx_unlock(&txr->hn_tx_lock); + } + if_qflush(ifp); +} + +static void +hn_xmit_txeof(struct hn_tx_ring *txr) +{ + + if (txr->hn_sched_tx) + goto do_sched; + + if (mtx_trylock(&txr->hn_tx_lock)) { + int sched; + + txr->hn_oactive = 0; + sched = hn_xmit(txr, txr->hn_direct_tx_size); + mtx_unlock(&txr->hn_tx_lock); + if (sched) { + taskqueue_enqueue(txr->hn_tx_taskq, + &txr->hn_tx_task); + } + } else { +do_sched: + /* + * Release the oactive earlier, with the hope, that + * others could catch up. The task will clear the + * oactive again with the hn_tx_lock to avoid possible + * races. + */ + txr->hn_oactive = 0; + taskqueue_enqueue(txr->hn_tx_taskq, &txr->hn_txeof_task); + } +} + +static void +hn_xmit_taskfunc(void *xtxr, int pending __unused) +{ + struct hn_tx_ring *txr = xtxr; + + mtx_lock(&txr->hn_tx_lock); + hn_xmit(txr, 0); + mtx_unlock(&txr->hn_tx_lock); +} + +static void +hn_xmit_txeof_taskfunc(void *xtxr, int pending __unused) +{ + struct hn_tx_ring *txr = xtxr; + + mtx_lock(&txr->hn_tx_lock); + txr->hn_oactive = 0; + hn_xmit(txr, 0); + mtx_unlock(&txr->hn_tx_lock); +} + static void hn_tx_taskq_create(void *arg __unused) { From owner-svn-src-head@freebsd.org Thu Feb 25 04:32:18 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8B4E8AB3D9F; Thu, 25 Feb 2016 04:32:18 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 552B7371; Thu, 25 Feb 2016 04:32:18 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1P4WHQi089497; Thu, 25 Feb 2016 04:32:17 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1P4WHHO089496; Thu, 25 Feb 2016 04:32:17 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201602250432.u1P4WHHO089496@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Thu, 25 Feb 2016 04:32:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r296023 - head/sys/dev/cy X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Feb 2016 04:32:18 -0000 Author: jhibbits Date: Thu Feb 25 04:32:17 2016 New Revision: 296023 URL: https://svnweb.freebsd.org/changeset/base/296023 Log: Fix the build. Pointy-hat to: jhibbits Spotted by: bde Modified: head/sys/dev/cy/cy_pci.c Modified: head/sys/dev/cy/cy_pci.c ============================================================================== --- head/sys/dev/cy/cy_pci.c Thu Feb 25 03:21:25 2016 (r296022) +++ head/sys/dev/cy/cy_pci.c Thu Feb 25 04:32:17 2016 (r296023) @@ -114,7 +114,7 @@ cy_pci_attach(dev) mem_res = NULL; ioport_rid = CY_PCI_BASE_ADDR1; - ioport_res = bus_alloc_resource_(dev, SYS_RES_IOPORT, &ioport_rid, + ioport_res = bus_alloc_resource_any(dev, SYS_RES_IOPORT, &ioport_rid, RF_ACTIVE); if (ioport_res == NULL) { device_printf(dev, "ioport resource allocation failed\n"); From owner-svn-src-head@freebsd.org Thu Feb 25 07:03:11 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C2689AB383B; Thu, 25 Feb 2016 07:03:11 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 94DE8AEC; Thu, 25 Feb 2016 07:03:11 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1P73ADK032751; Thu, 25 Feb 2016 07:03:10 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1P73AhJ032750; Thu, 25 Feb 2016 07:03:10 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201602250703.u1P73AhJ032750@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Thu, 25 Feb 2016 07:03:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r296024 - head/sys/dev/hyperv/netvsc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Feb 2016 07:03:11 -0000 Author: sephe Date: Thu Feb 25 07:03:10 2016 New Revision: 296024 URL: https://svnweb.freebsd.org/changeset/base/296024 Log: hyperv/hn: Hold the TX ring lock then drain TX desc buf_ring Reported by: Hongxiong Xian MFC after: 1 week Sponsored by: Microsoft OSTC Modified: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Modified: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Thu Feb 25 04:32:17 2016 (r296023) +++ head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Thu Feb 25 07:03:10 2016 (r296024) @@ -2326,8 +2326,10 @@ hn_destroy_tx_ring(struct hn_tx_ring *tx hn_txdesc_dmamap_destroy(txd); } #else + mtx_lock(&txr->hn_tx_lock); while ((txd = buf_ring_dequeue_sc(txr->hn_txdesc_br)) != NULL) hn_txdesc_dmamap_destroy(txd); + mtx_unlock(&txr->hn_tx_lock); #endif if (txr->hn_tx_data_dtag != NULL) From owner-svn-src-head@freebsd.org Thu Feb 25 07:34:00 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F279AAB26EC; Thu, 25 Feb 2016 07:34:00 +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 mx1.freebsd.org (Postfix) with ESMTPS id C29B81A29; Thu, 25 Feb 2016 07:34:00 +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 u1P7XxRB041747; Thu, 25 Feb 2016 07:33:59 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1P7Xxoh041746; Thu, 25 Feb 2016 07:33:59 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201602250733.u1P7Xxoh041746@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Thu, 25 Feb 2016 07:33:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r296025 - head/sys/netpfil/pf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Feb 2016 07:34:01 -0000 Author: kp Date: Thu Feb 25 07:33:59 2016 New Revision: 296025 URL: https://svnweb.freebsd.org/changeset/base/296025 Log: pf: Fix possible out-of-bounds write In the DIOCRSETADDRS ioctl() handler we allocate a table for struct pfr_addrs, which is processed in pfr_set_addrs(). At the users request we also provide feedback on the deleted addresses, by storing them after the new list ('bcopy(&ad, addr + size + i, sizeof(ad));' in pfr_set_addrs()). This means we write outside the bounds of the buffer we've just allocated. We need to look at pfrio_size2 instead (i.e. the size the user reserved for our feedback). That'd allow a malicious user to specify a smaller pfrio_size2 than pfrio_size though, in which case we'd still read outside of the allocated buffer. Instead we allocate the largest of the two values. Reported By: Paul J Murphy PR: 207463 MFC after: 5 days Differential Revision: https://reviews.freebsd.org/D5426 Modified: head/sys/netpfil/pf/pf_ioctl.c Modified: head/sys/netpfil/pf/pf_ioctl.c ============================================================================== --- head/sys/netpfil/pf/pf_ioctl.c Thu Feb 25 07:03:10 2016 (r296024) +++ head/sys/netpfil/pf/pf_ioctl.c Thu Feb 25 07:33:59 2016 (r296025) @@ -2718,13 +2718,14 @@ DIOCCHANGEADDR_error: case DIOCRSETADDRS: { struct pfioc_table *io = (struct pfioc_table *)addr; struct pfr_addr *pfras; - size_t totlen; + size_t totlen, count; if (io->pfrio_esize != sizeof(struct pfr_addr)) { error = ENODEV; break; } - totlen = io->pfrio_size * sizeof(struct pfr_addr); + count = max(io->pfrio_size, io->pfrio_size2); + totlen = count * sizeof(struct pfr_addr); pfras = malloc(totlen, M_TEMP, M_WAITOK); error = copyin(io->pfrio_buffer, pfras, totlen); if (error) { From owner-svn-src-head@freebsd.org Thu Feb 25 07:41:41 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0C7D1AB2B64; Thu, 25 Feb 2016 07:41:41 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-ig0-x230.google.com (mail-ig0-x230.google.com [IPv6:2607:f8b0:4001:c05::230]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D3908192; Thu, 25 Feb 2016 07:41:40 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: by mail-ig0-x230.google.com with SMTP id y8so8215687igp.1; Wed, 24 Feb 2016 23:41:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc; bh=c8YCSTrWmAHgk+yXX9oW52yfQemsiUAqRK4JjbQmMU4=; b=xE86Svx2Gr8COlNy/4t9F/R1xOyPfSbKgYLSqrXoNi6okQtiIgD/QtlUeaQIGaL+aU win9+dcdnNDsDMdx2zfQx0fEvqRoiczOIYAv0b2CWiKckY9Mwgkz0DsxqKD2sOUJKJZ0 AHKZCHCKs/ZgEmOsFBsJBe/9wkXUumwJmqX41IpZdgoN3XBCy6RrW62APeO0CSjGzELd iu7Yy5DVVOd1qVGuYLMEG2B+Hq0DVYbTq5YTmkJicDrh+UWAKmTXcZ8NS1MeDFRX6w4P VW2HicUNyxO4Y7ZoNU2RK9qCuJU2by8uo4f6i9jQnRuyiDgvVkMVRaonXHWYeDdflZzL FrDQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc; bh=c8YCSTrWmAHgk+yXX9oW52yfQemsiUAqRK4JjbQmMU4=; b=D5SdpXAraoUHSG0oJi/Cw81qil9TmWOcfAM9p0z4oJJ+jMwajvtlkNCQ+EHatTObz6 AyllRxQuyXOoY8EFS8wuDgl6pigbD47LHuS7UzcNVI3+vcOw4wd07+z/HBjpgoLAnJfd lKNDdjc//Lv68DKdjRyhELMdZXArkNjvRP8Jl0w/d+aoxUuhFr25yAeI9tEpw+UIWoOY nHwYY5rhtBKwu8XPPLdOFv0SZIgp0R4Pah5I0r25INvCDe7wCBIHTG5p2JCqO4jDOtIT A8q0a+onJ4DSaOw1ZQqqpfvPRKzm4lhArDYo/o+R7FYz2jdqMUueK7BjUSgUfK3unmv0 1lBA== X-Gm-Message-State: AG10YOQHegqzwFPei68AtZb0BX8V4gAsoq7IzXVoQgIdoMaO5Nc9zde1UJB3k1HOKpKjxEzpVGWh8s1XeJWECg== MIME-Version: 1.0 X-Received: by 10.50.171.225 with SMTP id ax1mr864107igc.61.1456386100201; Wed, 24 Feb 2016 23:41:40 -0800 (PST) Received: by 10.36.14.19 with HTTP; Wed, 24 Feb 2016 23:41:40 -0800 (PST) In-Reply-To: <201602250733.u1P7Xxoh041746@repo.freebsd.org> References: <201602250733.u1P7Xxoh041746@repo.freebsd.org> Date: Wed, 24 Feb 2016 23:41:40 -0800 Message-ID: Subject: Re: svn commit: r296025 - head/sys/netpfil/pf From: Adrian Chadd To: Kristof Provost Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Feb 2016 07:41:41 -0000 .. what's capping totlen so one doesn't run out of memory? -a On 24 February 2016 at 23:33, Kristof Provost wrote: > Author: kp > Date: Thu Feb 25 07:33:59 2016 > New Revision: 296025 > URL: https://svnweb.freebsd.org/changeset/base/296025 > > Log: > pf: Fix possible out-of-bounds write > > In the DIOCRSETADDRS ioctl() handler we allocate a table for struct pfr_addrs, > which is processed in pfr_set_addrs(). At the users request we also provide > feedback on the deleted addresses, by storing them after the new list > ('bcopy(&ad, addr + size + i, sizeof(ad));' in pfr_set_addrs()). > > This means we write outside the bounds of the buffer we've just allocated. > We need to look at pfrio_size2 instead (i.e. the size the user reserved for our > feedback). That'd allow a malicious user to specify a smaller pfrio_size2 than > pfrio_size though, in which case we'd still read outside of the allocated > buffer. Instead we allocate the largest of the two values. > > Reported By: Paul J Murphy > PR: 207463 > MFC after: 5 days > Differential Revision: https://reviews.freebsd.org/D5426 > > Modified: > head/sys/netpfil/pf/pf_ioctl.c > > Modified: head/sys/netpfil/pf/pf_ioctl.c > ============================================================================== > --- head/sys/netpfil/pf/pf_ioctl.c Thu Feb 25 07:03:10 2016 (r296024) > +++ head/sys/netpfil/pf/pf_ioctl.c Thu Feb 25 07:33:59 2016 (r296025) > @@ -2718,13 +2718,14 @@ DIOCCHANGEADDR_error: > case DIOCRSETADDRS: { > struct pfioc_table *io = (struct pfioc_table *)addr; > struct pfr_addr *pfras; > - size_t totlen; > + size_t totlen, count; > > if (io->pfrio_esize != sizeof(struct pfr_addr)) { > error = ENODEV; > break; > } > - totlen = io->pfrio_size * sizeof(struct pfr_addr); > + count = max(io->pfrio_size, io->pfrio_size2); > + totlen = count * sizeof(struct pfr_addr); > pfras = malloc(totlen, M_TEMP, M_WAITOK); > error = copyin(io->pfrio_buffer, pfras, totlen); > if (error) { > From owner-svn-src-head@freebsd.org Thu Feb 25 07:54:28 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 83D7AAB3F14; Thu, 25 Feb 2016 07:54:28 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-yw0-f172.google.com (mail-yw0-f172.google.com [209.85.161.172]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4E294D47; Thu, 25 Feb 2016 07:54:27 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-yw0-f172.google.com with SMTP id e63so36467450ywc.3; Wed, 24 Feb 2016 23:54:27 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:reply-to:in-reply-to:references :date:message-id:subject:from:to:cc:content-type; bh=sXG9uxo3mMSmhaRFXpiwGADjMO1SCJtPEvko5/up624=; b=Zjt0KP4IxrY2tfY9dtWrhHGIbjiAuid6wIr4C7C4cq+J1tUmkCs+TapxfwALMtcLnx Fh2waTCEKP9jyePmTFJJCIFeA+vY2qJVgzAjAXiKcUAKw1a71nqaFF7JI3+mMXRpbHLN 0S2bT5hx6YD8HMBmugigc+4QyEUFeYPolOXQbCaShezll7zYqjA38UrtQBOQQ1EAQEda JPmyIfqpzlwMX9WYn4sdfX3JFGfiQaA/yXJFy+bxWT5pgmL8D6vNj3Ra2Rg2nWSZi+vf zHMOzpumpvrmT1fRkIddSX2G2sPMu6Nhv742Cd82qMZ+fSd1sYnBIRhSaTE+3opTOfXx QSdg== X-Gm-Message-State: AG10YOTjrdcLKb8XleO6YCAk5lzPk7bMmW1iMcHx0OAPhCiT1cJcZlZY5Zdf8s/GT7MHew== X-Received: by 10.129.75.197 with SMTP id y188mr24345174ywa.291.1456386476377; Wed, 24 Feb 2016 23:47:56 -0800 (PST) Received: from mail-yw0-f175.google.com (mail-yw0-f175.google.com. [209.85.161.175]) by smtp.gmail.com with ESMTPSA id g187sm5165895ywd.51.2016.02.24.23.47.55 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 24 Feb 2016 23:47:56 -0800 (PST) Received: by mail-yw0-f175.google.com with SMTP id e63so36372214ywc.3; Wed, 24 Feb 2016 23:47:55 -0800 (PST) MIME-Version: 1.0 X-Received: by 10.129.105.3 with SMTP id e3mr22161692ywc.237.1456386475780; Wed, 24 Feb 2016 23:47:55 -0800 (PST) Reply-To: cem@FreeBSD.org Received: by 10.37.115.82 with HTTP; Wed, 24 Feb 2016 23:47:55 -0800 (PST) In-Reply-To: References: <201602250733.u1P7Xxoh041746@repo.freebsd.org> Date: Wed, 24 Feb 2016 23:47:55 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r296025 - head/sys/netpfil/pf From: Conrad Meyer To: Adrian Chadd Cc: Kristof Provost , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Feb 2016 07:54:28 -0000 On Wed, Feb 24, 2016 at 11:41 PM, Adrian Chadd wrote: > .. what's capping totlen so one doesn't run out of memory? There was a DoS vector before (user controlled io->pfrio_size) and basically the same DoS vector now (either of io->pfrio_size or io->pfrio_size2). This change isn't a regression. Still, it should be fixed. Best, Conrad > On 24 February 2016 at 23:33, Kristof Provost wrote: >> ... >> Modified: head/sys/netpfil/pf/pf_ioctl.c >> ============================================================================== >> --- head/sys/netpfil/pf/pf_ioctl.c Thu Feb 25 07:03:10 2016 (r296024) >> +++ head/sys/netpfil/pf/pf_ioctl.c Thu Feb 25 07:33:59 2016 (r296025) >> @@ -2718,13 +2718,14 @@ DIOCCHANGEADDR_error: >> case DIOCRSETADDRS: { >> struct pfioc_table *io = (struct pfioc_table *)addr; >> struct pfr_addr *pfras; >> - size_t totlen; >> + size_t totlen, count; >> >> if (io->pfrio_esize != sizeof(struct pfr_addr)) { >> error = ENODEV; >> break; >> } >> - totlen = io->pfrio_size * sizeof(struct pfr_addr); >> + count = max(io->pfrio_size, io->pfrio_size2); >> + totlen = count * sizeof(struct pfr_addr); >> pfras = malloc(totlen, M_TEMP, M_WAITOK); >> error = copyin(io->pfrio_buffer, pfras, totlen); >> if (error) { >> > From owner-svn-src-head@freebsd.org Thu Feb 25 09:17:45 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8FD2EAB4BD1; Thu, 25 Feb 2016 09:17:45 +0000 (UTC) (envelope-from kp@vega.codepro.be) Received: from venus.codepro.be (venus.codepro.be [IPv6:2a01:4f8:162:1127::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.codepro.be", Issuer "Gandi Standard SSL CA 2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 56EC71771; Thu, 25 Feb 2016 09:17:45 +0000 (UTC) (envelope-from kp@vega.codepro.be) Received: from vega.codepro.be (unknown [172.16.1.3]) by venus.codepro.be (Postfix) with ESMTP id AF2B01987B; Thu, 25 Feb 2016 10:17:41 +0100 (CET) Received: by vega.codepro.be (Postfix, from userid 1001) id A810F7F542; Thu, 25 Feb 2016 10:17:41 +0100 (CET) Date: Thu, 25 Feb 2016 10:17:41 +0100 From: Kristof Provost To: Conrad Meyer Cc: Adrian Chadd , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Subject: Re: svn commit: r296025 - head/sys/netpfil/pf Message-ID: <20160225091741.GF3003@vega.codepro.be> References: <201602250733.u1P7Xxoh041746@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: X-Checked-By-NSA: Probably User-Agent: Mutt/1.5.24 (2015-08-30) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Feb 2016 09:17:45 -0000 On 2016-02-24 23:47:55 (-0800), Conrad Meyer wrote: > On Wed, Feb 24, 2016 at 11:41 PM, Adrian Chadd wrote: > > .. what's capping totlen so one doesn't run out of memory? > > There was a DoS vector before (user controlled io->pfrio_size) and > basically the same DoS vector now (either of io->pfrio_size or > io->pfrio_size2). This change isn't a regression. Still, it should > be fixed. > It's an M_WAITOK allocation, so if the user asks for more memory than is available the thread will sleep. I'd assumed that if the user terminates the thread the sleep will wake, the allocation will fail and the ioctl() will return an error. Perhaps we should do what OpenBSD do, and not allocate the temporary buffer at all. They copy in/out the individual entries one by one. On the other hand, one could still exhaust memory by inserting large numbers of addresses in the table. I'm a little wary of adding arbitrary limits to the number of entries in a table, because this bug (and #192677) show that users do actually insert 100.000 addresses in a table. Regards, Kristof From owner-svn-src-head@freebsd.org Thu Feb 25 09:27:52 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3C2F6AB4F3A; Thu, 25 Feb 2016 09:27:52 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1079B1E34; Thu, 25 Feb 2016 09:27:51 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1P9RoVW073622; Thu, 25 Feb 2016 09:27:50 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1P9RorO073619; Thu, 25 Feb 2016 09:27:50 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201602250927.u1P9RorO073619@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Thu, 25 Feb 2016 09:27:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r296028 - in head/sys/dev/hyperv: netvsc vmbus X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Feb 2016 09:27:52 -0000 Author: sephe Date: Thu Feb 25 09:27:50 2016 New Revision: 296028 URL: https://svnweb.freebsd.org/changeset/base/296028 Log: hyperv: Wait 5 seconds for hyperv result, instead of 500ms This addresses various devices (network, stoarge) attach failure. Reported by: Hongxiong Xian Tested by: Hongxiong Xian MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D5435 Modified: head/sys/dev/hyperv/netvsc/hv_rndis_filter.c head/sys/dev/hyperv/vmbus/hv_channel.c head/sys/dev/hyperv/vmbus/hv_connection.c Modified: head/sys/dev/hyperv/netvsc/hv_rndis_filter.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_rndis_filter.c Thu Feb 25 08:17:31 2016 (r296027) +++ head/sys/dev/hyperv/netvsc/hv_rndis_filter.c Thu Feb 25 09:27:50 2016 (r296028) @@ -352,7 +352,7 @@ hv_rf_send_offload_request(struct hv_dev goto cleanup; } - ret = sema_timedwait(&request->wait_sema, 500); + ret = sema_timedwait(&request->wait_sema, 5 * hz); if (ret != 0) { device_printf(dev, "hv send offload request timeout\n"); goto cleanup; @@ -619,7 +619,7 @@ hv_rf_set_packet_filter(rndis_device *de * us when the response has arrived. In the failure case, * sema_timedwait() returns a non-zero status after waiting 5 seconds. */ - ret = sema_timedwait(&request->wait_sema, 500); + ret = sema_timedwait(&request->wait_sema, 5 * hz); if (ret == 0) { /* Response received, check status */ set_complete = &request->response_msg.msg.set_complete; Modified: head/sys/dev/hyperv/vmbus/hv_channel.c ============================================================================== --- head/sys/dev/hyperv/vmbus/hv_channel.c Thu Feb 25 08:17:31 2016 (r296027) +++ head/sys/dev/hyperv/vmbus/hv_channel.c Thu Feb 25 09:27:50 2016 (r296028) @@ -30,6 +30,7 @@ __FBSDID("$FreeBSD$"); #include +#include #include #include #include @@ -194,7 +195,7 @@ hv_vmbus_channel_open( if (ret != 0) goto cleanup; - ret = sema_timedwait(&open_info->wait_sema, 500); /* KYS 5 seconds */ + ret = sema_timedwait(&open_info->wait_sema, 5 * hz); /* KYS 5 seconds */ if (ret) { if(bootverbose) @@ -439,7 +440,7 @@ hv_vmbus_channel_establish_gpadl( } } - ret = sema_timedwait(&msg_info->wait_sema, 500); /* KYS 5 seconds*/ + ret = sema_timedwait(&msg_info->wait_sema, 5 * hz); /* KYS 5 seconds*/ if (ret != 0) goto cleanup; @@ -499,7 +500,7 @@ hv_vmbus_channel_teardown_gpdal( if (ret != 0) goto cleanup; - ret = sema_timedwait(&info->wait_sema, 500); /* KYS 5 seconds */ + ret = sema_timedwait(&info->wait_sema, 5 * hz); /* KYS 5 seconds */ cleanup: /* Modified: head/sys/dev/hyperv/vmbus/hv_connection.c ============================================================================== --- head/sys/dev/hyperv/vmbus/hv_connection.c Thu Feb 25 08:17:31 2016 (r296027) +++ head/sys/dev/hyperv/vmbus/hv_connection.c Thu Feb 25 09:27:50 2016 (r296028) @@ -27,6 +27,7 @@ */ #include +#include #include #include #include @@ -121,7 +122,7 @@ hv_vmbus_negotiate_version(hv_vmbus_chan /** * Wait for the connection response */ - ret = sema_timedwait(&msg_info->wait_sema, 500); /* KYS 5 seconds */ + ret = sema_timedwait(&msg_info->wait_sema, 5 * hz); /* KYS 5 seconds */ mtx_lock_spin(&hv_vmbus_g_connection.channel_msg_lock); TAILQ_REMOVE( From owner-svn-src-head@freebsd.org Thu Feb 25 10:08:03 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 98EFCAB2ECC; Thu, 25 Feb 2016 10:08:03 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 17A7E14C2; Thu, 25 Feb 2016 10:08:02 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id u1PA7vx0002035 (version=TLSv1 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Thu, 25 Feb 2016 12:07:57 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua u1PA7vx0002035 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id u1PA7vSu002034; Thu, 25 Feb 2016 12:07:57 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Thu, 25 Feb 2016 12:07:57 +0200 From: Konstantin Belousov To: Kristof Provost Cc: Conrad Meyer , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Subject: Re: svn commit: r296025 - head/sys/netpfil/pf Message-ID: <20160225100757.GA67250@kib.kiev.ua> References: <201602250733.u1P7Xxoh041746@repo.freebsd.org> <20160225091741.GF3003@vega.codepro.be> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160225091741.GF3003@vega.codepro.be> User-Agent: Mutt/1.5.24 (2015-08-30) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Feb 2016 10:08:03 -0000 On Thu, Feb 25, 2016 at 10:17:41AM +0100, Kristof Provost wrote: > On 2016-02-24 23:47:55 (-0800), Conrad Meyer wrote: > > On Wed, Feb 24, 2016 at 11:41 PM, Adrian Chadd wrote: > > > .. what's capping totlen so one doesn't run out of memory? > > > > There was a DoS vector before (user controlled io->pfrio_size) and > > basically the same DoS vector now (either of io->pfrio_size or > > io->pfrio_size2). This change isn't a regression. Still, it should > > be fixed. > > > It's an M_WAITOK allocation, so if the user asks for more memory than is > available the thread will sleep. I'd assumed that if the user terminates > the thread the sleep will wake, the allocation will fail and the ioctl() > will return an error. M_WAITOK allocations still panic when requested amount of KVA is unreasonable. I am curious what do you mean by 'user terminating the thread'. The sleep in malloc() is uninterruptible by signal, and user does not have any other way to disturb the execution. > > Perhaps we should do what OpenBSD do, and not allocate the temporary > buffer at all. They copy in/out the individual entries one by one. On > the other hand, one could still exhaust memory by inserting large > numbers of addresses in the table. But note that accesses to the user memory may fault, which puts whole VM and VFS subsystems (and possibly the network as well, if user supplied address is backed by mapped NFS file) after the locks owned at the moment of copyin() call. From owner-svn-src-head@freebsd.org Thu Feb 25 10:26:22 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9479BAB365B; Thu, 25 Feb 2016 10:26:22 +0000 (UTC) (envelope-from kp@vega.codepro.be) Received: from venus.codepro.be (venus.codepro.be [IPv6:2a01:4f8:162:1127::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.codepro.be", Issuer "Gandi Standard SSL CA 2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5BD281F40; Thu, 25 Feb 2016 10:26:22 +0000 (UTC) (envelope-from kp@vega.codepro.be) Received: from vega.codepro.be (unknown [172.16.1.3]) by venus.codepro.be (Postfix) with ESMTP id 1B6BE1996E; Thu, 25 Feb 2016 11:26:18 +0100 (CET) Received: by vega.codepro.be (Postfix, from userid 1001) id 142B37F591; Thu, 25 Feb 2016 11:26:18 +0100 (CET) Date: Thu, 25 Feb 2016 11:26:18 +0100 From: Kristof Provost To: Konstantin Belousov Cc: Conrad Meyer , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Subject: Re: svn commit: r296025 - head/sys/netpfil/pf Message-ID: <20160225102617.GG3003@vega.codepro.be> References: <201602250733.u1P7Xxoh041746@repo.freebsd.org> <20160225091741.GF3003@vega.codepro.be> <20160225100757.GA67250@kib.kiev.ua> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20160225100757.GA67250@kib.kiev.ua> X-Checked-By-NSA: Probably User-Agent: Mutt/1.5.24 (2015-08-30) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Feb 2016 10:26:22 -0000 On 2016-02-25 12:07:57 (+0200), Konstantin Belousov wrote: > On Thu, Feb 25, 2016 at 10:17:41AM +0100, Kristof Provost wrote: > > On 2016-02-24 23:47:55 (-0800), Conrad Meyer wrote: > > > On Wed, Feb 24, 2016 at 11:41 PM, Adrian Chadd wrote: > > > > .. what's capping totlen so one doesn't run out of memory? > > > > > > There was a DoS vector before (user controlled io->pfrio_size) and > > > basically the same DoS vector now (either of io->pfrio_size or > > > io->pfrio_size2). This change isn't a regression. Still, it should > > > be fixed. > > > > > It's an M_WAITOK allocation, so if the user asks for more memory than is > > available the thread will sleep. I'd assumed that if the user terminates > > the thread the sleep will wake, the allocation will fail and the ioctl() > > will return an error. > M_WAITOK allocations still panic when requested amount of KVA is > unreasonable. > > I am curious what do you mean by 'user terminating the thread'. The > sleep in malloc() is uninterruptible by signal, and user does not have > any other way to disturb the execution. > Ah, so my assumptions about malloc() are incorrect. That's good to know. > > Perhaps we should do what OpenBSD do, and not allocate the temporary > > buffer at all. They copy in/out the individual entries one by one. On > > the other hand, one could still exhaust memory by inserting large > > numbers of addresses in the table. > But note that accesses to the user memory may fault, which puts whole > VM and VFS subsystems (and possibly the network as well, if user > supplied address is backed by mapped NFS file) after the locks owned > at the moment of copyin() call. > That's a good point. We could handle those accesses failing, but sleeping with the PF_RULES_WLOCK held would be a bad idea. I suppose we could just change M_WAITOK into M_NOWAIT and return ENOMEM if it fails. The only downside I can see is that it's more likely for a call to fail if there's not a lot of free memory. There's actually a decent number of cases where that'd have to be done, but it doesn't look particularly hard to do. Regards, Kristof From owner-svn-src-head@freebsd.org Thu Feb 25 11:18:44 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 26D65AB49B1; Thu, 25 Feb 2016 11:18:44 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 97FDA1EB1; Thu, 25 Feb 2016 11:18:43 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id u1PBIcJR061766 (version=TLSv1 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Thu, 25 Feb 2016 13:18:38 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua u1PBIcJR061766 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id u1PBIckm061765; Thu, 25 Feb 2016 13:18:38 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Thu, 25 Feb 2016 13:18:38 +0200 From: Konstantin Belousov To: Kristof Provost Cc: Conrad Meyer , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Subject: Re: svn commit: r296025 - head/sys/netpfil/pf Message-ID: <20160225111838.GC67250@kib.kiev.ua> References: <201602250733.u1P7Xxoh041746@repo.freebsd.org> <20160225091741.GF3003@vega.codepro.be> <20160225100757.GA67250@kib.kiev.ua> <20160225102617.GG3003@vega.codepro.be> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160225102617.GG3003@vega.codepro.be> User-Agent: Mutt/1.5.24 (2015-08-30) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Feb 2016 11:18:44 -0000 On Thu, Feb 25, 2016 at 11:26:18AM +0100, Kristof Provost wrote: > That's a good point. We could handle those accesses failing, but > sleeping with the PF_RULES_WLOCK held would be a bad idea. > > I suppose we could just change M_WAITOK into M_NOWAIT and return ENOMEM > if it fails. The only downside I can see is that it's more likely for a > call to fail if there's not a lot of free memory. As you rightfully noted, use of M_NOWAIT at the top-half of the kernel causes random user-visible failures, which are caused by unrelated events and its interaction with the pagedaemon activities. Typical kernel code applies somewhat more complex algorithms to e.g. calculate the memory requirements, drop the locks and alloc everything, then re-acquire the locks and recheck the conditions. > > There's actually a decent number of cases where that'd have to be done, > but it doesn't look particularly hard to do. From owner-svn-src-head@freebsd.org Thu Feb 25 12:17:42 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9FBBFAB1639; Thu, 25 Feb 2016 12:17:42 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 69DE5980; Thu, 25 Feb 2016 12:17:42 +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 u1PCHfvc024268; Thu, 25 Feb 2016 12:17:41 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1PCHfhu024264; Thu, 25 Feb 2016 12:17:41 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201602251217.u1PCHfhu024264@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Thu, 25 Feb 2016 12:17:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r296029 - in head/sys: arm/allwinner arm/allwinner/a31 conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Feb 2016 12:17:42 -0000 Author: andrew Date: Thu Feb 25 12:17:41 2016 New Revision: 296029 URL: https://svnweb.freebsd.org/changeset/base/296029 Log: Add the Allwinner A31 and A31s padconf support. It's currently unused, but will be needed when we bring in further support for these SoCs. Submitted by: Emmanuel Vadot Differential Revision: https://reviews.freebsd.org/D5340 Added: head/sys/arm/allwinner/a31/ head/sys/arm/allwinner/a31/a31_padconf.c (contents, props changed) head/sys/arm/allwinner/a31/a31s_padconf.c (contents, props changed) Modified: head/sys/arm/allwinner/a10_gpio.c head/sys/conf/options.arm Modified: head/sys/arm/allwinner/a10_gpio.c ============================================================================== --- head/sys/arm/allwinner/a10_gpio.c Thu Feb 25 09:27:50 2016 (r296028) +++ head/sys/arm/allwinner/a10_gpio.c Thu Feb 25 12:17:41 2016 (r296029) @@ -81,6 +81,8 @@ __FBSDID("$FreeBSD$"); static struct ofw_compat_data compat_data[] = { {"allwinner,sun4i-a10-pinctrl", 1}, {"allwinner,sun7i-a20-pinctrl", 1}, + {"allwinner,sun6i-a31-pinctrl", 1}, + {"allwinner,sun6i-a31s-pinctrl", 1}, {NULL, 0} }; @@ -106,6 +108,16 @@ extern const struct allwinner_padconf a1 extern const struct allwinner_padconf a20_padconf; #endif +/* Defined in a31_padconf.c */ +#ifdef SOC_ALLWINNER_A31 +extern const struct allwinner_padconf a31_padconf; +#endif + +/* Defined in a31s_padconf.c */ +#ifdef SOC_ALLWINNER_A31S +extern const struct allwinner_padconf a31s_padconf; +#endif + #define A10_GPIO_LOCK(_sc) mtx_lock_spin(&(_sc)->sc_mtx) #define A10_GPIO_UNLOCK(_sc) mtx_unlock_spin(&(_sc)->sc_mtx) #define A10_GPIO_LOCK_ASSERT(_sc) mtx_assert(&(_sc)->sc_mtx, MA_OWNED) @@ -568,6 +580,16 @@ a10_gpio_attach(device_t dev) sc->padconf = &a20_padconf; break; #endif +#ifdef SOC_ALLWINNER_A31 + case ALLWINNERSOC_A31: + sc->padconf = &a31_padconf; + break; +#endif +#ifdef SOC_ALLWINNER_A31S + case ALLWINNERSOC_A31S: + sc->padconf = &a31s_padconf; + break; +#endif default: return (ENOENT); } Added: head/sys/arm/allwinner/a31/a31_padconf.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/allwinner/a31/a31_padconf.c Thu Feb 25 12:17:41 2016 (r296029) @@ -0,0 +1,216 @@ +/*- + * Copyright (c) 2016 Emmanuel Vadot + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include + +#include + +const static struct allwinner_pins a31_pins[] = { + {"PA0", 0, 0, {"gpio_in", "gpio_out", "gmac", "lcd1", "uart1", NULL, NULL, NULL}}, + {"PA1", 0, 1, {"gpio_in", "gpio_out", "gmac", "lcd1", "uart1", NULL, NULL, NULL}}, + {"PA2", 0, 2, {"gpio_in", "gpio_out", "gmac", "lcd1", "uart1", NULL, NULL, NULL}}, + {"PA3", 0, 3, {"gpio_in", "gpio_out", "gmac", "lcd1", "uart1", NULL, NULL, NULL}}, + {"PA4", 0, 4, {"gpio_in", "gpio_out", "gmac", "lcd1", "uart1", NULL, NULL, NULL}}, + {"PA5", 0, 5, {"gpio_in", "gpio_out", "gmac", "lcd1", "uart1", NULL, NULL, NULL}}, + {"PA6", 0, 6, {"gpio_in", "gpio_out", "gmac", "lcd1", "uart1", NULL, NULL, NULL}}, + {"PA7", 0, 7, {"gpio_in", "gpio_out", "gmac", "lcd1", "uart1", NULL, NULL, NULL}}, + {"PA8", 0, 8, {"gpio_in", "gpio_out", "gmac", "lcd1", NULL, NULL, NULL, NULL}}, + {"PA9", 0, 9, {"gpio_in", "gpio_out", "gmac", "lcd1", NULL, NULL, NULL, NULL}}, + {"PA10", 0, 10, {"gpio_in", "gpio_out", "gmac", "lcd1", "mmc3", "mmc2", NULL, NULL}}, + {"PA11", 0, 11, {"gpio_in", "gpio_out", "gmac", "lcd1", "mmc3", "mmc2", NULL, NULL}}, + {"PA12", 0, 12, {"gpio_in", "gpio_out", "gmac", "lcd1", "mmc3", "mmc2", NULL, NULL}}, + {"PA13", 0, 13, {"gpio_in", "gpio_out", "gmac", "lcd1", "mmc3", "mmc2", NULL, NULL}}, + {"PA14", 0, 14, {"gpio_in", "gpio_out", "gmac", "lcd1", "mmc3", "mmc2", NULL, NULL}}, + {"PA15", 0, 15, {"gpio_in", "gpio_out", "gmac", "lcd1", "dmic", NULL, NULL, NULL}}, + {"PA16", 0, 16, {"gpio_in", "gpio_out", "gmac", "lcd1", "dmic", NULL, NULL, NULL}}, + {"PA17", 0, 17, {"gpio_in", "gpio_out", "gmac", "lcd1", "clk_out_b", NULL, NULL, NULL}}, + {"PA18", 0, 17, {"gpio_in", "gpio_out", "gmac", "lcd1", "pwm3", NULL, NULL, NULL}}, + {"PA19", 0, 17, {"gpio_in", "gpio_out", "gmac", "lcd1", "pwm3", NULL, NULL, NULL}}, + {"PA20", 0, 17, {"gpio_in", "gpio_out", "gmac", "lcd1", "spi3", NULL, NULL, NULL}}, + {"PA21", 0, 17, {"gpio_in", "gpio_out", "gmac", "lcd1", "spi3", NULL, NULL, NULL}}, + {"PA22", 0, 17, {"gpio_in", "gpio_out", "gmac", "lcd1", "spi3", NULL, NULL, NULL}}, + {"PA23", 0, 17, {"gpio_in", "gpio_out", "gmac", "lcd1", "spi3", NULL, NULL, NULL}}, + {"PA24", 0, 17, {"gpio_in", "gpio_out", "gmac", "lcd1", "spi3", NULL, NULL, NULL}}, + {"PA25", 0, 17, {"gpio_in", "gpio_out", "gmac", "lcd1", "spi3", NULL, NULL, NULL}}, + {"PA26", 0, 17, {"gpio_in", "gpio_out", "gmac", "lcd1", "clk_out_c", NULL, NULL, NULL}}, + {"PA27", 0, 17, {"gpio_in", "gpio_out", "gmac", "lcd1", NULL, NULL, NULL, NULL}}, + + {"PB0", 1, 0, {"gpio_in", "gpio_out", "i2s0", "uart3", "csi", NULL, NULL, NULL}}, + {"PB1", 1, 1, {"gpio_in", "gpio_out", "i2s0", NULL, NULL, NULL, NULL, NULL}}, + {"PB2", 1, 2, {"gpio_in", "gpio_out", "i2s0", NULL, NULL, NULL, NULL, NULL}}, + {"PB3", 1, 3, {"gpio_in", "gpio_out", "i2s0", NULL, NULL, NULL, NULL, NULL}}, + {"PB4", 1, 4, {"gpio_in", "gpio_out", "i2s0", "uart3", NULL, NULL, NULL, NULL}}, + {"PB5", 1, 5, {"gpio_in", "gpio_out", "i2s0", "uart3", "i2c3", NULL, NULL, NULL}}, + {"PB6", 1, 6, {"gpio_in", "gpio_out", "i2s0", "uart3", "i2c3", NULL, NULL, NULL}}, + {"PB7", 1, 7, {"gpio_in", "gpio_out", "i2s0", NULL, NULL, NULL, NULL, NULL}}, + + {"PC0", 2, 0, {"gpio_in", "gpio_out", "nand0", "spi0", NULL, NULL, NULL, NULL}}, + {"PC1", 2, 1, {"gpio_in", "gpio_out", "nand0", "spi0", NULL, NULL, NULL, NULL}}, + {"PC2", 2, 2, {"gpio_in", "gpio_out", "nand0", "spi0", NULL, NULL, NULL, NULL}}, + {"PC3", 2, 3, {"gpio_in", "gpio_out", "nand0", NULL, NULL, NULL, NULL, NULL}}, + {"PC4", 2, 4, {"gpio_in", "gpio_out", "nand0", NULL, NULL, NULL, NULL, NULL}}, + {"PC5", 2, 5, {"gpio_in", "gpio_out", "nand0", NULL, NULL, NULL, NULL, NULL}}, + {"PC6", 2, 6, {"gpio_in", "gpio_out", "nand0", "mmc2", "mmc3", NULL, NULL, NULL}}, + {"PC7", 2, 7, {"gpio_in", "gpio_out", "nand0", "mmc2", "mmc3", NULL, NULL, NULL}}, + {"PC8", 2, 8, {"gpio_in", "gpio_out", "nand0", "mmc2", "mmc3", NULL, NULL, NULL}}, + {"PC9", 2, 9, {"gpio_in", "gpio_out", "nand0", "mmc2", "mmc3", NULL, NULL, NULL}}, + {"PC10", 2, 10, {"gpio_in", "gpio_out", "nand0", "mmc2", "mmc3", NULL, NULL, NULL}}, + {"PC11", 2, 11, {"gpio_in", "gpio_out", "nand0", "mmc2", "mmc3", NULL, NULL, NULL}}, + {"PC12", 2, 12, {"gpio_in", "gpio_out", "nand0", "mmc2", "mmc3", NULL, NULL, NULL}}, + {"PC13", 2, 13, {"gpio_in", "gpio_out", "nand0", "mmc2", "mmc3", NULL, NULL, NULL}}, + {"PC14", 2, 14, {"gpio_in", "gpio_out", "nand0", "mmc2", "mmc3", NULL, NULL, NULL}}, + {"PC15", 2, 15, {"gpio_in", "gpio_out", "nand0", "mmc2", "mmc3", NULL, NULL, NULL}}, + {"PC16", 2, 16, {"gpio_in", "gpio_out", "nand0", "nand1", NULL, NULL, NULL, NULL}}, + {"PC17", 2, 17, {"gpio_in", "gpio_out", "nand0", "nand1", NULL, NULL, NULL, NULL}}, + {"PC18", 2, 18, {"gpio_in", "gpio_out", "nand0", "nand1", NULL, NULL, NULL, NULL}}, + {"PC19", 2, 19, {"gpio_in", "gpio_out", "nand0", "nand1", NULL, NULL, NULL, NULL}}, + {"PC20", 2, 20, {"gpio_in", "gpio_out", "nand0", "nand1", NULL, NULL, NULL, NULL}}, + {"PC21", 2, 21, {"gpio_in", "gpio_out", "nand0", "nand1", NULL, NULL, NULL, NULL}}, + {"PC22", 2, 22, {"gpio_in", "gpio_out", "nand0", "nand1", NULL, NULL, NULL, NULL}}, + {"PC23", 2, 23, {"gpio_in", "gpio_out", "nand0", "nand1", NULL, NULL, NULL, NULL}}, + {"PC24", 2, 24, {"gpio_in", "gpio_out", "nand0", "mmc2", "mmc3", NULL, NULL, NULL}}, + {"PC25", 2, 24, {"gpio_in", "gpio_out", "nand0", NULL, NULL, NULL, NULL, NULL}}, + {"PC26", 2, 24, {"gpio_in", "gpio_out", "nand0", NULL, NULL, NULL, NULL, NULL}}, + {"PC27", 2, 24, {"gpio_in", "gpio_out", NULL, "spi0",NULL, NULL, NULL, NULL}}, + + {"PD0", 3, 0, {"gpio_in", "gpio_out", "lcd0", "lvds0", NULL, NULL, NULL, NULL}}, + {"PD1", 3, 1, {"gpio_in", "gpio_out", "lcd0", "lvds0", NULL, NULL, NULL, NULL}}, + {"PD2", 3, 2, {"gpio_in", "gpio_out", "lcd0", "lvds0", NULL, NULL, NULL, NULL}}, + {"PD3", 3, 3, {"gpio_in", "gpio_out", "lcd0", "lvds0", NULL, NULL, NULL, NULL}}, + {"PD4", 3, 4, {"gpio_in", "gpio_out", "lcd0", "lvds0", NULL, NULL, NULL, NULL}}, + {"PD5", 3, 5, {"gpio_in", "gpio_out", "lcd0", "lvds0", NULL, NULL, NULL, NULL}}, + {"PD6", 3, 6, {"gpio_in", "gpio_out", "lcd0", "lvds0", NULL, NULL, NULL, NULL}}, + {"PD7", 3, 7, {"gpio_in", "gpio_out", "lcd0", "lvds0", NULL, NULL, NULL, NULL}}, + {"PD8", 3, 8, {"gpio_in", "gpio_out", "lcd0", "lvds0", NULL, NULL, NULL, NULL}}, + {"PD9", 3, 9, {"gpio_in", "gpio_out", "lcd0", "lvds0", NULL, NULL, NULL, NULL}}, + {"PD10", 3, 10, {"gpio_in", "gpio_out", "lcd0", "lvds1", NULL, NULL, NULL, NULL}}, + {"PD11", 3, 11, {"gpio_in", "gpio_out", "lcd0", "lvds1", NULL, NULL, NULL, NULL}}, + {"PD12", 3, 12, {"gpio_in", "gpio_out", "lcd0", "lvds1", NULL, NULL, NULL, NULL}}, + {"PD13", 3, 13, {"gpio_in", "gpio_out", "lcd0", "lvds1", NULL, NULL, NULL, NULL}}, + {"PD14", 3, 14, {"gpio_in", "gpio_out", "lcd0", "lvds1", NULL, NULL, NULL, NULL}}, + {"PD15", 3, 15, {"gpio_in", "gpio_out", "lcd0", "lvds1", NULL, NULL, NULL, NULL}}, + {"PD16", 3, 16, {"gpio_in", "gpio_out", "lcd0", "lvds1", NULL, NULL, NULL, NULL}}, + {"PD17", 3, 17, {"gpio_in", "gpio_out", "lcd0", "lvds1", NULL, NULL, NULL, NULL}}, + {"PD18", 3, 18, {"gpio_in", "gpio_out", "lcd0", "lvds1", NULL, NULL, NULL, NULL}}, + {"PD19", 3, 19, {"gpio_in", "gpio_out", "lcd0", "lvds1", NULL, NULL, NULL, NULL}}, + {"PD20", 3, 20, {"gpio_in", "gpio_out", "lcd0", NULL, NULL, NULL, NULL, NULL}}, + {"PD21", 3, 21, {"gpio_in", "gpio_out", "lcd0", NULL, NULL, NULL, NULL, NULL}}, + {"PD22", 3, 22, {"gpio_in", "gpio_out", "lcd0", NULL, NULL, NULL, NULL, NULL}}, + {"PD23", 3, 23, {"gpio_in", "gpio_out", "lcd0", NULL, NULL, NULL, NULL, NULL}}, + {"PD24", 3, 24, {"gpio_in", "gpio_out", "lcd0", NULL, NULL, NULL, NULL, NULL}}, + {"PD25", 3, 25, {"gpio_in", "gpio_out", "lcd0", NULL, NULL, NULL, NULL, NULL}}, + {"PD26", 3, 26, {"gpio_in", "gpio_out", "lcd0", NULL, NULL, NULL, NULL, NULL}}, + {"PD27", 3, 27, {"gpio_in", "gpio_out", "lcd0", NULL, NULL, NULL, NULL, NULL}}, + + {"PE0", 4, 0, {"gpio_in", "gpio_out", "csi", "ts", NULL, NULL, NULL, NULL}}, + {"PE1", 4, 1, {"gpio_in", "gpio_out", "csi", "ts", NULL, NULL, NULL, NULL}}, + {"PE2", 4, 2, {"gpio_in", "gpio_out", "csi", "ts", NULL, NULL, NULL, NULL}}, + {"PE3", 4, 3, {"gpio_in", "gpio_out", "csi", "ts", NULL, NULL, NULL, NULL}}, + {"PE4", 4, 4, {"gpio_in", "gpio_out", "csi", "uart5", NULL, NULL, NULL, NULL}}, + {"PE5", 4, 5, {"gpio_in", "gpio_out", "csi", "uart5", NULL, NULL, NULL, NULL}}, + {"PE6", 4, 6, {"gpio_in", "gpio_out", "csi", "uart5", NULL, NULL, NULL, NULL}}, + {"PE7", 4, 7, {"gpio_in", "gpio_out", "csi", "uart5", NULL, NULL, NULL, NULL}}, + {"PE8", 4, 8, {"gpio_in", "gpio_out", "csi", "ts", NULL, NULL, NULL, NULL}}, + {"PE9", 4, 9, {"gpio_in", "gpio_out", "csi", "ts", NULL, NULL, NULL, NULL}}, + {"PE10", 4, 10, {"gpio_in", "gpio_out", "csi", "ts", NULL, NULL, NULL, NULL}}, + {"PE11", 4, 11, {"gpio_in", "gpio_out", "csi", "ts", NULL, NULL, NULL, NULL}}, + {"PE12", 4, 11, {"gpio_in", "gpio_out", "csi", "ts", NULL, NULL, NULL, NULL}}, + {"PE13", 4, 11, {"gpio_in", "gpio_out", "csi", "ts", NULL, NULL, NULL, NULL}}, + {"PE14", 4, 11, {"gpio_in", "gpio_out", "csi", "ts", NULL, NULL, NULL, NULL}}, + {"PE15", 4, 11, {"gpio_in", "gpio_out", "csi", "ts", NULL, NULL, NULL, NULL}}, + {"PE16", 4, 11, {"gpio_in", "gpio_out", "csi", NULL, NULL, NULL, NULL, NULL}}, + + {"PF0", 5, 0, {"gpio_in", "gpio_out", "mmc0", NULL, "jtag", NULL, NULL, NULL}}, + {"PF1", 5, 1, {"gpio_in", "gpio_out", "mmc0", NULL, "jtag", NULL, NULL, NULL}}, + {"PF2", 5, 2, {"gpio_in", "gpio_out", "mmc0", NULL, "uart0", NULL, NULL, NULL}}, + {"PF3", 5, 3, {"gpio_in", "gpio_out", "mmc0", NULL, "jtag", NULL, NULL, NULL}}, + {"PF4", 5, 4, {"gpio_in", "gpio_out", "mmc0", NULL, "uart0", NULL, NULL, NULL}}, + {"PF5", 5, 5, {"gpio_in", "gpio_out", "mmc0", NULL, "jtag", NULL, NULL, NULL}}, + + {"PG0", 6, 0, {"gpio_in", "gpio_out", "mmc1", NULL, NULL, NULL, NULL, NULL}}, + {"PG1", 6, 1, {"gpio_in", "gpio_out", "mmc1", NULL, NULL, NULL, NULL, NULL}}, + {"PG2", 6, 2, {"gpio_in", "gpio_out", "mmc1", NULL, NULL, NULL, NULL, NULL}}, + {"PG3", 6, 3, {"gpio_in", "gpio_out", "mmc1", NULL, NULL, NULL, NULL, NULL}}, + {"PG4", 6, 4, {"gpio_in", "gpio_out", "mmc1", NULL, NULL, NULL, NULL, NULL}}, + {"PG5", 6, 5, {"gpio_in", "gpio_out", "mmc1", NULL, NULL, NULL, NULL, NULL}}, + {"PG6", 6, 6, {"gpio_in", "gpio_out", "uart2", NULL, NULL, NULL, NULL, NULL}}, + {"PG7", 6, 7, {"gpio_in", "gpio_out", "uart2", NULL, NULL, NULL, NULL, NULL}}, + {"PG8", 6, 8, {"gpio_in", "gpio_out", "uart2", NULL, NULL, NULL, NULL, NULL}}, + {"PG9", 6, 9, {"gpio_in", "gpio_out", "uart2", NULL, NULL, NULL, NULL, NULL}}, + {"PG10", 6, 10, {"gpio_in", "gpio_out", "i2c3", "usb", NULL, NULL, NULL, NULL}}, + {"PG11", 6, 11, {"gpio_in", "gpio_out", "i2c3", "usb", NULL, NULL, NULL, NULL}}, + {"PG12", 6, 11, {"gpio_in", "gpio_out", "spi1", "i2s1", NULL, NULL, NULL, NULL}}, + {"PG13", 6, 11, {"gpio_in", "gpio_out", "spi1", "i2s1", NULL, NULL, NULL, NULL}}, + {"PG14", 6, 11, {"gpio_in", "gpio_out", "spi1", "i2s1", NULL, NULL, NULL, NULL}}, + {"PG15", 6, 11, {"gpio_in", "gpio_out", "spi1", "i2s1", NULL, NULL, NULL, NULL}}, + {"PG16", 6, 11, {"gpio_in", "gpio_out", "spi1", "i2s1", NULL, NULL, NULL, NULL}}, + {"PG17", 6, 11, {"gpio_in", "gpio_out", "uart4", NULL, NULL, NULL, NULL, NULL}}, + {"PG18", 6, 11, {"gpio_in", "gpio_out", "uart4", NULL, NULL, NULL, NULL, NULL}}, + + {"PH0", 7, 0, {"gpio_in", "gpio_out", "nand1", NULL, NULL, NULL, NULL, NULL}}, + {"PH1", 7, 1, {"gpio_in", "gpio_out", "nand1", NULL, NULL, NULL, NULL, NULL}}, + {"PH2", 7, 2, {"gpio_in", "gpio_out", "nand1", NULL, NULL, NULL, NULL, NULL}}, + {"PH3", 7, 3, {"gpio_in", "gpio_out", "nand1", NULL, NULL, NULL, NULL, NULL}}, + {"PH4", 7, 4, {"gpio_in", "gpio_out", "nand1", NULL, NULL, NULL, NULL, NULL}}, + {"PH5", 7, 5, {"gpio_in", "gpio_out", "nand1", NULL, NULL, NULL, NULL, NULL}}, + {"PH6", 7, 6, {"gpio_in", "gpio_out", "nand1", NULL, NULL, NULL, NULL, NULL}}, + {"PH7", 7, 7, {"gpio_in", "gpio_out", "nand1", NULL, NULL, NULL, NULL, NULL}}, + {"PH8", 7, 8, {"gpio_in", "gpio_out", "nand1", NULL, NULL, NULL, NULL, NULL}}, + {"PH9", 7, 9, {"gpio_in", "gpio_out", "spi2", "jtag", "pwm1", NULL, NULL, NULL}}, + {"PH10", 7, 10, {"gpio_in", "gpio_out", "spi2", "jtag", "pwm1", NULL, NULL, NULL}}, + {"PH11", 7, 11, {"gpio_in", "gpio_out", "spi2", "jtag", "pwm2", NULL, NULL, NULL}}, + {"PH12", 7, 12, {"gpio_in", "gpio_out", "spi2", "jtag", "pwm2", NULL, NULL, NULL}}, + {"PH13", 7, 13, {"gpio_in", "gpio_out", "pwm0", NULL, NULL, NULL, NULL, NULL}}, + {"PH14", 7, 14, {"gpio_in", "gpio_out", "i2c0", NULL, NULL, NULL, NULL, NULL}}, + {"PH15", 7, 15, {"gpio_in", "gpio_out", "i2c0", NULL, NULL, NULL, NULL, NULL}}, + {"PH16", 7, 16, {"gpio_in", "gpio_out", "i2c1", NULL, NULL, NULL, NULL, NULL}}, + {"PH17", 7, 17, {"gpio_in", "gpio_out", "i2c1", NULL, NULL, NULL, NULL, NULL}}, + {"PH18", 7, 18, {"gpio_in", "gpio_out", "i2c2", NULL, NULL, NULL, NULL, NULL}}, + {"PH19", 7, 19, {"gpio_in", "gpio_out", "i2c2", NULL, NULL, NULL, NULL, NULL}}, + {"PH20", 7, 20, {"gpio_in", "gpio_out", "uart0", NULL, NULL, NULL, NULL, NULL}}, + {"PH21", 7, 21, {"gpio_in", "gpio_out", "uart0", NULL, NULL, NULL, NULL, NULL}}, + {"PH22", 7, 22, {"gpio_in", "gpio_out", NULL, NULL, NULL, NULL, NULL, NULL}}, + {"PH23", 7, 23, {"gpio_in", "gpio_out", NULL, NULL, NULL, NULL, NULL, NULL}}, + {"PH24", 7, 24, {"gpio_in", "gpio_out", NULL, NULL, NULL, NULL, NULL, NULL}}, + {"PH25", 7, 25, {"gpio_in", "gpio_out", NULL, NULL, NULL, NULL, NULL, NULL}}, + {"PH26", 7, 26, {"gpio_in", "gpio_out", NULL, NULL, NULL, NULL, NULL, NULL}}, + {"PH27", 7, 27, {"gpio_in", "gpio_out", NULL, NULL, NULL, NULL, NULL, NULL}}, + {"PH28", 7, 27, {"gpio_in", "gpio_out", NULL, NULL, NULL, NULL, NULL, NULL}}, + {"PH29", 7, 27, {"gpio_in", "gpio_out", "nand1", NULL, NULL, NULL, NULL, NULL}}, + {"PH30", 7, 27, {"gpio_in", "gpio_out", "nand1", NULL, NULL, NULL, NULL, NULL}}, +}; + +const struct allwinner_padconf a31_padconf = { + .npins = nitems(a31_pins), + .pins = a31_pins, +}; Added: head/sys/arm/allwinner/a31/a31s_padconf.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/allwinner/a31/a31s_padconf.c Thu Feb 25 12:17:41 2016 (r296029) @@ -0,0 +1,196 @@ +/*- + * Copyright (c) 2016 Emmanuel Vadot + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include + +#include + +const static struct allwinner_pins a31s_pins[] = { + {"PA0", 0, 0, {"gpio_in", "gpio_out", "gmac", NULL, "uart1", NULL, NULL, NULL}}, + {"PA1", 0, 1, {"gpio_in", "gpio_out", "gmac", NULL, "uart1", NULL, NULL, NULL}}, + {"PA2", 0, 2, {"gpio_in", "gpio_out", "gmac", NULL, "uart1", NULL, NULL, NULL}}, + {"PA3", 0, 3, {"gpio_in", "gpio_out", "gmac", NULL, "uart1", NULL, NULL, NULL}}, + {"PA4", 0, 4, {"gpio_in", "gpio_out", "gmac", NULL, "uart1", NULL, NULL, NULL}}, + {"PA5", 0, 5, {"gpio_in", "gpio_out", "gmac", NULL, "uart1", NULL, NULL, NULL}}, + {"PA6", 0, 6, {"gpio_in", "gpio_out", "gmac", NULL, "uart1", NULL, NULL, NULL}}, + {"PA7", 0, 7, {"gpio_in", "gpio_out", "gmac", NULL, "uart1", NULL, NULL, NULL}}, + {"PA8", 0, 8, {"gpio_in", "gpio_out", "gmac", NULL, NULL, NULL, NULL, NULL}}, + {"PA9", 0, 9, {"gpio_in", "gpio_out", "gmac", NULL, NULL, NULL, NULL, NULL}}, + {"PA10", 0, 10, {"gpio_in", "gpio_out", "gmac", NULL, "mmc3", "mmc2", NULL, NULL}}, + {"PA11", 0, 11, {"gpio_in", "gpio_out", "gmac", NULL, "mmc3", "mmc2", NULL, NULL}}, + {"PA12", 0, 12, {"gpio_in", "gpio_out", "gmac", NULL, "mmc3", "mmc2", NULL, NULL}}, + {"PA13", 0, 13, {"gpio_in", "gpio_out", "gmac", NULL, "mmc3", "mmc2", NULL, NULL}}, + {"PA14", 0, 14, {"gpio_in", "gpio_out", "gmac", NULL, "mmc3", "mmc2", NULL, NULL}}, + {"PA15", 0, 15, {"gpio_in", "gpio_out", "gmac", NULL, "dmic", NULL, NULL, NULL}}, + {"PA16", 0, 16, {"gpio_in", "gpio_out", "gmac", NULL, "dmic", NULL, NULL, NULL}}, + {"PA17", 0, 17, {"gpio_in", "gpio_out", "gmac", NULL, "clk_out_b", NULL, NULL, NULL}}, + {"PA18", 0, 17, {"gpio_in", "gpio_out", "gmac", NULL, "pwm3", NULL, NULL, NULL}}, + {"PA19", 0, 17, {"gpio_in", "gpio_out", "gmac", NULL, "pwm3", NULL, NULL, NULL}}, + {"PA20", 0, 17, {"gpio_in", "gpio_out", "gmac", NULL, "spi3", NULL, NULL, NULL}}, + {"PA21", 0, 17, {"gpio_in", "gpio_out", "gmac", NULL, "spi3", NULL, NULL, NULL}}, + {"PA22", 0, 17, {"gpio_in", "gpio_out", "gmac", NULL, "spi3", NULL, NULL, NULL}}, + {"PA23", 0, 17, {"gpio_in", "gpio_out", "gmac", NULL, "spi3", NULL, NULL, NULL}}, + {"PA24", 0, 17, {"gpio_in", "gpio_out", "gmac", NULL, "spi3", NULL, NULL, NULL}}, + {"PA25", 0, 17, {"gpio_in", "gpio_out", "gmac", NULL, "spi3", NULL, NULL, NULL}}, + {"PA26", 0, 17, {"gpio_in", "gpio_out", "gmac", NULL, "clk_out_c", NULL, NULL, NULL}}, + {"PA27", 0, 17, {"gpio_in", "gpio_out", "gmac", NULL, NULL, NULL, NULL, NULL}}, + + {"PB0", 1, 0, {"gpio_in", "gpio_out", "i2s0", "uart3", NULL , NULL, NULL, NULL}}, + {"PB1", 1, 1, {"gpio_in", "gpio_out", "i2s0", NULL, NULL, NULL, NULL, NULL}}, + {"PB2", 1, 2, {"gpio_in", "gpio_out", "i2s0", NULL, NULL, NULL, NULL, NULL}}, + {"PB3", 1, 3, {"gpio_in", "gpio_out", "i2s0", NULL, NULL, NULL, NULL, NULL}}, + {"PB4", 1, 4, {"gpio_in", "gpio_out", "i2s0", "uart3", NULL, NULL, NULL, NULL}}, + {"PB5", 1, 5, {"gpio_in", "gpio_out", "i2s0", "uart3", "i2c3", NULL, NULL, NULL}}, + {"PB6", 1, 6, {"gpio_in", "gpio_out", "i2s0", "uart3", "i2c3", NULL, NULL, NULL}}, + {"PB7", 1, 7, {"gpio_in", "gpio_out", "i2s0", NULL, NULL, NULL, NULL, NULL}}, + + {"PC0", 2, 0, {"gpio_in", "gpio_out", "nand0", "spi0", NULL, NULL, NULL, NULL}}, + {"PC1", 2, 1, {"gpio_in", "gpio_out", "nand0", "spi0", NULL, NULL, NULL, NULL}}, + {"PC2", 2, 2, {"gpio_in", "gpio_out", "nand0", "spi0", NULL, NULL, NULL, NULL}}, + {"PC3", 2, 3, {"gpio_in", "gpio_out", "nand0", NULL, NULL, NULL, NULL, NULL}}, + {"PC4", 2, 4, {"gpio_in", "gpio_out", "nand0", NULL, NULL, NULL, NULL, NULL}}, + {"PC5", 2, 5, {"gpio_in", "gpio_out", "nand0", NULL, NULL, NULL, NULL, NULL}}, + {"PC6", 2, 6, {"gpio_in", "gpio_out", "nand0", "mmc2", "mmc3", NULL, NULL, NULL}}, + {"PC7", 2, 7, {"gpio_in", "gpio_out", "nand0", "mmc2", "mmc3", NULL, NULL, NULL}}, + {"PC8", 2, 8, {"gpio_in", "gpio_out", "nand0", "mmc2", "mmc3", NULL, NULL, NULL}}, + {"PC9", 2, 9, {"gpio_in", "gpio_out", "nand0", "mmc2", "mmc3", NULL, NULL, NULL}}, + {"PC10", 2, 10, {"gpio_in", "gpio_out", "nand0", "mmc2", "mmc3", NULL, NULL, NULL}}, + {"PC11", 2, 11, {"gpio_in", "gpio_out", "nand0", "mmc2", "mmc3", NULL, NULL, NULL}}, + {"PC12", 2, 12, {"gpio_in", "gpio_out", "nand0", "mmc2", "mmc3", NULL, NULL, NULL}}, + {"PC13", 2, 13, {"gpio_in", "gpio_out", "nand0", "mmc2", "mmc3", NULL, NULL, NULL}}, + {"PC14", 2, 14, {"gpio_in", "gpio_out", "nand0", "mmc2", "mmc3", NULL, NULL, NULL}}, + {"PC15", 2, 15, {"gpio_in", "gpio_out", "nand0", "mmc2", "mmc3", NULL, NULL, NULL}}, + {"PC24", 2, 24, {"gpio_in", "gpio_out", "nand0", "mmc2", "mmc3", NULL, NULL, NULL}}, + {"PC25", 2, 24, {"gpio_in", "gpio_out", "nand0", NULL, NULL, NULL, NULL, NULL}}, + {"PC26", 2, 24, {"gpio_in", "gpio_out", "nand0", NULL, NULL, NULL, NULL, NULL}}, + {"PC27", 2, 24, {"gpio_in", "gpio_out", NULL, "spi0",NULL, NULL, NULL, NULL}}, + + {"PD0", 3, 0, {"gpio_in", "gpio_out", "lcd0", "lvds0", NULL, NULL, NULL, NULL}}, + {"PD1", 3, 1, {"gpio_in", "gpio_out", "lcd0", "lvds0", NULL, NULL, NULL, NULL}}, + {"PD2", 3, 2, {"gpio_in", "gpio_out", "lcd0", "lvds0", NULL, NULL, NULL, NULL}}, + {"PD3", 3, 3, {"gpio_in", "gpio_out", "lcd0", "lvds0", NULL, NULL, NULL, NULL}}, + {"PD4", 3, 4, {"gpio_in", "gpio_out", "lcd0", "lvds0", NULL, NULL, NULL, NULL}}, + {"PD5", 3, 5, {"gpio_in", "gpio_out", "lcd0", "lvds0", NULL, NULL, NULL, NULL}}, + {"PD6", 3, 6, {"gpio_in", "gpio_out", "lcd0", "lvds0", NULL, NULL, NULL, NULL}}, + {"PD7", 3, 7, {"gpio_in", "gpio_out", "lcd0", "lvds0", NULL, NULL, NULL, NULL}}, + {"PD8", 3, 8, {"gpio_in", "gpio_out", "lcd0", "lvds0", NULL, NULL, NULL, NULL}}, + {"PD9", 3, 9, {"gpio_in", "gpio_out", "lcd0", "lvds0", NULL, NULL, NULL, NULL}}, + {"PD10", 3, 10, {"gpio_in", "gpio_out", "lcd0", NULL, NULL, NULL, NULL, NULL}}, + {"PD11", 3, 11, {"gpio_in", "gpio_out", "lcd0", NULL, NULL, NULL, NULL, NULL}}, + {"PD12", 3, 12, {"gpio_in", "gpio_out", "lcd0", NULL, NULL, NULL, NULL, NULL}}, + {"PD13", 3, 13, {"gpio_in", "gpio_out", "lcd0", NULL, NULL, NULL, NULL, NULL}}, + {"PD14", 3, 14, {"gpio_in", "gpio_out", "lcd0", NULL, NULL, NULL, NULL, NULL}}, + {"PD15", 3, 15, {"gpio_in", "gpio_out", "lcd0", NULL, NULL, NULL, NULL, NULL}}, + {"PD16", 3, 16, {"gpio_in", "gpio_out", "lcd0", NULL, NULL, NULL, NULL, NULL}}, + {"PD17", 3, 17, {"gpio_in", "gpio_out", "lcd0", NULL, NULL, NULL, NULL, NULL}}, + {"PD18", 3, 18, {"gpio_in", "gpio_out", "lcd0", NULL, NULL, NULL, NULL, NULL}}, + {"PD19", 3, 19, {"gpio_in", "gpio_out", "lcd0", NULL, NULL, NULL, NULL, NULL}}, + {"PD20", 3, 20, {"gpio_in", "gpio_out", "lcd0", NULL, NULL, NULL, NULL, NULL}}, + {"PD21", 3, 21, {"gpio_in", "gpio_out", "lcd0", NULL, NULL, NULL, NULL, NULL}}, + {"PD22", 3, 22, {"gpio_in", "gpio_out", "lcd0", NULL, NULL, NULL, NULL, NULL}}, + {"PD23", 3, 23, {"gpio_in", "gpio_out", "lcd0", NULL, NULL, NULL, NULL, NULL}}, + {"PD24", 3, 24, {"gpio_in", "gpio_out", "lcd0", NULL, NULL, NULL, NULL, NULL}}, + {"PD25", 3, 25, {"gpio_in", "gpio_out", "lcd0", NULL, NULL, NULL, NULL, NULL}}, + {"PD26", 3, 26, {"gpio_in", "gpio_out", "lcd0", NULL, NULL, NULL, NULL, NULL}}, + {"PD27", 3, 27, {"gpio_in", "gpio_out", "lcd0", NULL, NULL, NULL, NULL, NULL}}, + + {"PE0", 4, 0, {"gpio_in", "gpio_out", "csi", "ts", NULL, NULL, NULL, NULL}}, + {"PE1", 4, 1, {"gpio_in", "gpio_out", "csi", "ts", NULL, NULL, NULL, NULL}}, + {"PE2", 4, 2, {"gpio_in", "gpio_out", "csi", "ts", NULL, NULL, NULL, NULL}}, + {"PE3", 4, 3, {"gpio_in", "gpio_out", "csi", "ts", NULL, NULL, NULL, NULL}}, + {"PE4", 4, 4, {"gpio_in", "gpio_out", "csi", "uart5", NULL, NULL, NULL, NULL}}, + {"PE5", 4, 5, {"gpio_in", "gpio_out", "csi", "uart5", NULL, NULL, NULL, NULL}}, + {"PE6", 4, 6, {"gpio_in", "gpio_out", "csi", "uart5", NULL, NULL, NULL, NULL}}, + {"PE7", 4, 7, {"gpio_in", "gpio_out", "csi", "uart5", NULL, NULL, NULL, NULL}}, + {"PE8", 4, 8, {"gpio_in", "gpio_out", "csi", "ts", NULL, NULL, NULL, NULL}}, + {"PE9", 4, 9, {"gpio_in", "gpio_out", "csi", "ts", NULL, NULL, NULL, NULL}}, + {"PE10", 4, 10, {"gpio_in", "gpio_out", "csi", "ts", NULL, NULL, NULL, NULL}}, + {"PE11", 4, 11, {"gpio_in", "gpio_out", "csi", "ts", NULL, NULL, NULL, NULL}}, + {"PE12", 4, 11, {"gpio_in", "gpio_out", "csi", "ts", NULL, NULL, NULL, NULL}}, + {"PE13", 4, 11, {"gpio_in", "gpio_out", "csi", "ts", NULL, NULL, NULL, NULL}}, + {"PE14", 4, 11, {"gpio_in", "gpio_out", "csi", "ts", NULL, NULL, NULL, NULL}}, + {"PE15", 4, 11, {"gpio_in", "gpio_out", "csi", "ts", NULL, NULL, NULL, NULL}}, + + {"PF0", 5, 0, {"gpio_in", "gpio_out", "mmc0", NULL, "jtag", NULL, NULL, NULL}}, + {"PF1", 5, 1, {"gpio_in", "gpio_out", "mmc0", NULL, "jtag", NULL, NULL, NULL}}, + {"PF2", 5, 2, {"gpio_in", "gpio_out", "mmc0", NULL, "uart0", NULL, NULL, NULL}}, + {"PF3", 5, 3, {"gpio_in", "gpio_out", "mmc0", NULL, "jtag", NULL, NULL, NULL}}, + {"PF4", 5, 4, {"gpio_in", "gpio_out", "mmc0", NULL, "uart0", NULL, NULL, NULL}}, + {"PF5", 5, 5, {"gpio_in", "gpio_out", "mmc0", NULL, "jtag", NULL, NULL, NULL}}, + + {"PG0", 6, 0, {"gpio_in", "gpio_out", "mmc1", NULL, NULL, NULL, NULL, NULL}}, + {"PG1", 6, 1, {"gpio_in", "gpio_out", "mmc1", NULL, NULL, NULL, NULL, NULL}}, + {"PG2", 6, 2, {"gpio_in", "gpio_out", "mmc1", NULL, NULL, NULL, NULL, NULL}}, + {"PG3", 6, 3, {"gpio_in", "gpio_out", "mmc1", NULL, NULL, NULL, NULL, NULL}}, + {"PG4", 6, 4, {"gpio_in", "gpio_out", "mmc1", NULL, NULL, NULL, NULL, NULL}}, + {"PG5", 6, 5, {"gpio_in", "gpio_out", "mmc1", NULL, NULL, NULL, NULL, NULL}}, + {"PG6", 6, 6, {"gpio_in", "gpio_out", "uart2", NULL, NULL, NULL, NULL, NULL}}, + {"PG7", 6, 7, {"gpio_in", "gpio_out", "uart2", NULL, NULL, NULL, NULL, NULL}}, + {"PG8", 6, 8, {"gpio_in", "gpio_out", "uart2", NULL, NULL, NULL, NULL, NULL}}, + {"PG9", 6, 9, {"gpio_in", "gpio_out", "uart2", NULL, NULL, NULL, NULL, NULL}}, + {"PG10", 6, 10, {"gpio_in", "gpio_out", "i2c3", NULL, NULL, NULL, NULL, NULL}}, + {"PG11", 6, 11, {"gpio_in", "gpio_out", "i2c3", NULL, NULL, NULL, NULL, NULL}}, + {"PG12", 6, 11, {"gpio_in", "gpio_out", "spi1", "i2s1", NULL, NULL, NULL, NULL}}, + {"PG13", 6, 11, {"gpio_in", "gpio_out", "spi1", "i2s1", NULL, NULL, NULL, NULL}}, + {"PG14", 6, 11, {"gpio_in", "gpio_out", "spi1", "i2s1", NULL, NULL, NULL, NULL}}, + {"PG15", 6, 11, {"gpio_in", "gpio_out", "spi1", "i2s1", NULL, NULL, NULL, NULL}}, + {"PG16", 6, 11, {"gpio_in", "gpio_out", "spi1", "i2s1", NULL, NULL, NULL, NULL}}, + {"PG17", 6, 11, {"gpio_in", "gpio_out", "uart4", NULL, NULL, NULL, NULL, NULL}}, + {"PG18", 6, 11, {"gpio_in", "gpio_out", "uart4", NULL, NULL, NULL, NULL, NULL}}, + + {"PH9", 7, 9, {"gpio_in", "gpio_out", "spi2", "jtag", "pwm1", NULL, NULL, NULL}}, + {"PH10", 7, 10, {"gpio_in", "gpio_out", "spi2", "jtag", "pwm1", NULL, NULL, NULL}}, + {"PH11", 7, 11, {"gpio_in", "gpio_out", "spi2", "jtag", "pwm2", NULL, NULL, NULL}}, + {"PH12", 7, 12, {"gpio_in", "gpio_out", "spi2", "jtag", "pwm2", NULL, NULL, NULL}}, + {"PH13", 7, 13, {"gpio_in", "gpio_out", "pwm0", NULL, NULL, NULL, NULL, NULL}}, + {"PH14", 7, 14, {"gpio_in", "gpio_out", "i2c0", NULL, NULL, NULL, NULL, NULL}}, + {"PH15", 7, 15, {"gpio_in", "gpio_out", "i2c0", NULL, NULL, NULL, NULL, NULL}}, + {"PH16", 7, 16, {"gpio_in", "gpio_out", "i2c1", NULL, NULL, NULL, NULL, NULL}}, + {"PH17", 7, 17, {"gpio_in", "gpio_out", "i2c1", NULL, NULL, NULL, NULL, NULL}}, + {"PH18", 7, 18, {"gpio_in", "gpio_out", "i2c2", NULL, NULL, NULL, NULL, NULL}}, + {"PH19", 7, 19, {"gpio_in", "gpio_out", "i2c2", NULL, NULL, NULL, NULL, NULL}}, + {"PH20", 7, 20, {"gpio_in", "gpio_out", "uart0", NULL, NULL, NULL, NULL, NULL}}, + {"PH21", 7, 21, {"gpio_in", "gpio_out", "uart0", NULL, NULL, NULL, NULL, NULL}}, + {"PH22", 7, 22, {"gpio_in", "gpio_out", NULL, NULL, NULL, NULL, NULL, NULL}}, + {"PH23", 7, 23, {"gpio_in", "gpio_out", NULL, NULL, NULL, NULL, NULL, NULL}}, + {"PH24", 7, 24, {"gpio_in", "gpio_out", NULL, NULL, NULL, NULL, NULL, NULL}}, + {"PH25", 7, 25, {"gpio_in", "gpio_out", NULL, NULL, NULL, NULL, NULL, NULL}}, + {"PH26", 7, 26, {"gpio_in", "gpio_out", NULL, NULL, NULL, NULL, NULL, NULL}}, + {"PH27", 7, 27, {"gpio_in", "gpio_out", NULL, NULL, NULL, NULL, NULL, NULL}}, + {"PH28", 7, 27, {"gpio_in", "gpio_out", NULL, NULL, NULL, NULL, NULL, NULL}}, +}; + +const struct allwinner_padconf a31s_padconf = { + .npins = nitems(a31s_pins), + .pins = a31s_pins, +}; Modified: head/sys/conf/options.arm ============================================================================== --- head/sys/conf/options.arm Thu Feb 25 09:27:50 2016 (r296028) +++ head/sys/conf/options.arm Thu Feb 25 12:17:41 2016 (r296029) @@ -40,6 +40,8 @@ PV_STATS opt_pmap.h QEMU_WORKAROUNDS opt_global.h SOC_ALLWINNER_A10 opt_global.h SOC_ALLWINNER_A20 opt_global.h +SOC_ALLWINNER_A31 opt_global.h +SOC_ALLWINNER_A31S opt_global.h SOC_BCM2835 opt_global.h SOC_BCM2836 opt_global.h SOC_IMX51 opt_global.h From owner-svn-src-head@freebsd.org Thu Feb 25 14:12:52 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A95EFAAF7B8; Thu, 25 Feb 2016 14:12:52 +0000 (UTC) (envelope-from zbb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6A7617CD; Thu, 25 Feb 2016 14:12:52 +0000 (UTC) (envelope-from zbb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1PECpUa059738; Thu, 25 Feb 2016 14:12:51 GMT (envelope-from zbb@FreeBSD.org) Received: (from zbb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1PECpla059736; Thu, 25 Feb 2016 14:12:51 GMT (envelope-from zbb@FreeBSD.org) Message-Id: <201602251412.u1PECpla059736@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: zbb set sender to zbb@FreeBSD.org using -f From: Zbigniew Bodek Date: Thu, 25 Feb 2016 14:12:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r296030 - head/sys/dev/vnic X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Feb 2016 14:12:52 -0000 Author: zbb Date: Thu Feb 25 14:12:51 2016 New Revision: 296030 URL: https://svnweb.freebsd.org/changeset/base/296030 Log: Add support for hardware Tx and Rx checksums to VNIC driver - The network controller verifies Rx TCP/UDP/SCTP checksums by default. Communicate this to the stack when the packet is not marked as erroneous to avoid redundant checksum calculation in kernel. - It is not uncommon to get the mbuf with m_len that is less than the minimal size for the IP, TCP, UDP, etc. when HW checsumming is enabled. To avoid data corruption performed by the HW that is intended to write IP and TCP/UDP/SCTP checksums to the data segment, the mbuf needs to be pulled up by the required number of bytes. - Make sure that one can modify the mbufs that require checsum calculation rather than check for NULL mbuf on each transmission. Reviewed by: wma Obtained from: Semihalf Sponsored by: Cavium Differential Revision: https://reviews.freebsd.org/D5320 Modified: head/sys/dev/vnic/nicvf_main.c head/sys/dev/vnic/nicvf_queues.c Modified: head/sys/dev/vnic/nicvf_main.c ============================================================================== --- head/sys/dev/vnic/nicvf_main.c Thu Feb 25 12:17:41 2016 (r296029) +++ head/sys/dev/vnic/nicvf_main.c Thu Feb 25 14:12:51 2016 (r296030) @@ -353,6 +353,13 @@ nicvf_setup_ifnet(struct nicvf *nic) if_setmtu(ifp, ETHERMTU); if_setcapabilities(ifp, IFCAP_VLAN_MTU); + /* + * HW offload capabilities + */ + /* IP/TCP/UDP HW checksums */ + if_setcapabilitiesbit(ifp, IFCAP_HWCSUM, 0); + if_sethwassistbits(ifp, (CSUM_IP | CSUM_TCP | CSUM_UDP), 0); + #ifdef DEVICE_POLLING #error "DEVICE_POLLING not supported in VNIC driver yet" if_setcapabilitiesbit(ifp, IFCAP_POLLING, 0); @@ -500,6 +507,10 @@ nicvf_if_ioctl(struct ifnet *ifp, u_long /* No work to do except acknowledge the change took. */ ifp->if_capenable ^= IFCAP_VLAN_MTU; } + if (mask & IFCAP_TXCSUM) + ifp->if_capenable ^= IFCAP_TXCSUM; + if (mask & IFCAP_RXCSUM) + ifp->if_capenable ^= IFCAP_RXCSUM; break; default: @@ -591,6 +602,7 @@ nicvf_if_transmit(struct ifnet *ifp, str struct nicvf *nic = if_getsoftc(ifp); struct queue_set *qs = nic->qs; struct snd_queue *sq; + struct mbuf *mtmp; int qidx; int err = 0; @@ -610,16 +622,24 @@ nicvf_if_transmit(struct ifnet *ifp, str if ((if_getdrvflags(ifp) & (IFF_DRV_RUNNING | IFF_DRV_OACTIVE)) != IFF_DRV_RUNNING) { - if (mbuf != NULL) - err = drbr_enqueue(ifp, sq->br, mbuf); + err = drbr_enqueue(ifp, sq->br, mbuf); return (err); } - if (mbuf != NULL) { + if (mbuf->m_next != NULL && + (mbuf->m_pkthdr.csum_flags & + (CSUM_IP | CSUM_TCP | CSUM_UDP | CSUM_SCTP)) != 0) { + if (M_WRITABLE(mbuf) == 0) { + mtmp = m_dup(mbuf, M_NOWAIT); + m_freem(mbuf); + if (mtmp == NULL) + return (ENOBUFS); + mbuf = mtmp; + } + } err = drbr_enqueue(ifp, sq->br, mbuf); if (err != 0) return (err); - } taskqueue_enqueue(sq->snd_taskq, &sq->snd_task); Modified: head/sys/dev/vnic/nicvf_queues.c ============================================================================== --- head/sys/dev/vnic/nicvf_queues.c Thu Feb 25 12:17:41 2016 (r296029) +++ head/sys/dev/vnic/nicvf_queues.c Thu Feb 25 14:12:51 2016 (r296030) @@ -29,6 +29,9 @@ #include __FBSDID("$FreeBSD$"); +#include "opt_inet.h" +#include "opt_inet6.h" + #include #include #include @@ -64,6 +67,16 @@ __FBSDID("$FreeBSD$"); #include #include +#include +#include +#include +#include +#include +#include +#include +#include +#include + #include #include @@ -1658,11 +1671,17 @@ nicvf_sq_free_used_descs(struct nicvf *n * Add SQ HEADER subdescriptor. * First subdescriptor for every send descriptor. */ -static __inline void +static __inline int nicvf_sq_add_hdr_subdesc(struct snd_queue *sq, int qentry, int subdesc_cnt, struct mbuf *mbuf, int len) { struct sq_hdr_subdesc *hdr; + struct ether_vlan_header *eh; +#ifdef INET + struct ip *ip; +#endif + uint16_t etype; + int ehdrlen, iphlen, poff; hdr = (struct sq_hdr_subdesc *)GET_SQ_DESC(sq, qentry); sq->snd_buff[qentry].mbuf = mbuf; @@ -1675,7 +1694,93 @@ nicvf_sq_add_hdr_subdesc(struct snd_queu hdr->subdesc_cnt = subdesc_cnt; hdr->tot_len = len; - /* ARM64TODO: Implement HW checksums calculation */ + if (mbuf->m_pkthdr.csum_flags != 0) { + hdr->csum_l3 = 1; /* Enable IP csum calculation */ + + eh = mtod(mbuf, struct ether_vlan_header *); + if (eh->evl_encap_proto == htons(ETHERTYPE_VLAN)) { + ehdrlen = ETHER_HDR_LEN + ETHER_VLAN_ENCAP_LEN; + etype = ntohs(eh->evl_proto); + } else { + ehdrlen = ETHER_HDR_LEN; + etype = ntohs(eh->evl_encap_proto); + } + + if (mbuf->m_len < ehdrlen + sizeof(struct ip)) { + mbuf = m_pullup(mbuf, ehdrlen + sizeof(struct ip)); + sq->snd_buff[qentry].mbuf = mbuf; + if (mbuf == NULL) + return (ENOBUFS); + } + + switch (etype) { +#ifdef INET6 + case ETHERTYPE_IPV6: + /* ARM64TODO: Add support for IPv6 */ + hdr->csum_l3 = 0; + sq->snd_buff[qentry].mbuf = NULL; + return (ENXIO); +#endif +#ifdef INET + case ETHERTYPE_IP: + ip = (struct ip *)(mbuf->m_data + ehdrlen); + ip->ip_sum = 0; + iphlen = ip->ip_hl << 2; + poff = ehdrlen + iphlen; + + switch (ip->ip_p) { + case IPPROTO_TCP: + if ((mbuf->m_pkthdr.csum_flags & CSUM_TCP) == 0) + break; + + if (mbuf->m_len < (poff + sizeof(struct tcphdr))) { + mbuf = m_pullup(mbuf, poff + sizeof(struct tcphdr)); + sq->snd_buff[qentry].mbuf = mbuf; + if (mbuf == NULL) + return (ENOBUFS); + } + hdr->csum_l4 = SEND_L4_CSUM_TCP; + break; + case IPPROTO_UDP: + if ((mbuf->m_pkthdr.csum_flags & CSUM_UDP) == 0) + break; + + if (mbuf->m_len < (poff + sizeof(struct udphdr))) { + mbuf = m_pullup(mbuf, poff + sizeof(struct udphdr)); + sq->snd_buff[qentry].mbuf = mbuf; + if (mbuf == NULL) + return (ENOBUFS); + } + hdr->csum_l4 = SEND_L4_CSUM_UDP; + break; + case IPPROTO_SCTP: + if ((mbuf->m_pkthdr.csum_flags & CSUM_SCTP) == 0) + break; + + if (mbuf->m_len < (poff + sizeof(struct sctphdr))) { + mbuf = m_pullup(mbuf, poff + sizeof(struct sctphdr)); + sq->snd_buff[qentry].mbuf = mbuf; + if (mbuf == NULL) + return (ENOBUFS); + } + hdr->csum_l4 = SEND_L4_CSUM_SCTP; + break; + default: + break; + } + break; +#endif + default: + hdr->csum_l3 = 0; + return (0); + } + + hdr->l3_offset = ehdrlen; + hdr->l4_offset = ehdrlen + iphlen; + } else + hdr->csum_l3 = 0; + + return (0); } /* @@ -1734,8 +1839,12 @@ nicvf_tx_mbuf_locked(struct snd_queue *s qentry = nicvf_get_sq_desc(sq, subdesc_cnt); /* Add SQ header subdesc */ - nicvf_sq_add_hdr_subdesc(sq, qentry, subdesc_cnt - 1, mbuf, + err = nicvf_sq_add_hdr_subdesc(sq, qentry, subdesc_cnt - 1, mbuf, mbuf->m_pkthdr.len); + if (err != 0) { + bus_dmamap_unload(sq->snd_buff_dmat, snd_buff->dmap); + return (err); + } /* Add SQ gather subdescs */ for (seg = 0; seg < nsegs; seg++) { @@ -1806,6 +1915,25 @@ nicvf_get_rcv_mbuf(struct nicvf *nic, st m_fixhdr(mbuf); mbuf->m_pkthdr.flowid = cqe_rx->rq_idx; M_HASHTYPE_SET(mbuf, M_HASHTYPE_OPAQUE); + if (__predict_true((if_getcapenable(nic->ifp) & IFCAP_RXCSUM) != 0)) { + /* + * HW by default verifies IP & TCP/UDP/SCTP checksums + */ + + /* XXX: Do we need to include IP with options too? */ + if (__predict_true(cqe_rx->l3_type == L3TYPE_IPV4 || + cqe_rx->l3_type == L3TYPE_IPV6)) { + mbuf->m_pkthdr.csum_flags = + (CSUM_IP_CHECKED | CSUM_IP_VALID); + } + if (cqe_rx->l4_type == L4TYPE_TCP || + cqe_rx->l4_type == L4TYPE_UDP || + cqe_rx->l4_type == L4TYPE_SCTP) { + mbuf->m_pkthdr.csum_flags |= + (CSUM_DATA_VALID | CSUM_PSEUDO_HDR); + mbuf->m_pkthdr.csum_data = htons(0xffff); + } + } } return (mbuf); From owner-svn-src-head@freebsd.org Thu Feb 25 14:14:47 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D8AFAAAF8B7; Thu, 25 Feb 2016 14:14:47 +0000 (UTC) (envelope-from zbb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 97DD1A39; Thu, 25 Feb 2016 14:14:47 +0000 (UTC) (envelope-from zbb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1PEEk9d059929; Thu, 25 Feb 2016 14:14:46 GMT (envelope-from zbb@FreeBSD.org) Received: (from zbb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1PEEkpQ059926; Thu, 25 Feb 2016 14:14:46 GMT (envelope-from zbb@FreeBSD.org) Message-Id: <201602251414.u1PEEkpQ059926@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: zbb set sender to zbb@FreeBSD.org using -f From: Zbigniew Bodek Date: Thu, 25 Feb 2016 14:14:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r296031 - head/sys/dev/vnic X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Feb 2016 14:14:48 -0000 Author: zbb Date: Thu Feb 25 14:14:46 2016 New Revision: 296031 URL: https://svnweb.freebsd.org/changeset/base/296031 Log: Enable LRO support for VNIC driver Support for software LRO when enabled in the capabilities Reviewed by: wma Obtained from: Semihalf Sponsored by: Cavium Differential Revision: https://reviews.freebsd.org/D5321 Modified: head/sys/dev/vnic/nicvf_main.c head/sys/dev/vnic/nicvf_queues.c head/sys/dev/vnic/nicvf_queues.h Modified: head/sys/dev/vnic/nicvf_main.c ============================================================================== --- head/sys/dev/vnic/nicvf_main.c Thu Feb 25 14:12:51 2016 (r296030) +++ head/sys/dev/vnic/nicvf_main.c Thu Feb 25 14:14:46 2016 (r296031) @@ -67,6 +67,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include @@ -353,6 +354,7 @@ nicvf_setup_ifnet(struct nicvf *nic) if_setmtu(ifp, ETHERMTU); if_setcapabilities(ifp, IFCAP_VLAN_MTU); + if_setcapabilitiesbit(ifp, IFCAP_LRO, 0); /* * HW offload capabilities */ @@ -404,9 +406,11 @@ static int nicvf_if_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) { struct nicvf *nic; + struct rcv_queue *rq; struct ifreq *ifr; uint32_t flags; int mask, err; + int rq_idx; #if defined(INET) || defined(INET6) struct ifaddr *ifa; boolean_t avoid_reset = FALSE; @@ -511,6 +515,30 @@ nicvf_if_ioctl(struct ifnet *ifp, u_long ifp->if_capenable ^= IFCAP_TXCSUM; if (mask & IFCAP_RXCSUM) ifp->if_capenable ^= IFCAP_RXCSUM; + if (mask & IFCAP_LRO) { + /* + * Lock the driver for a moment to avoid + * mismatch in per-queue settings. + */ + NICVF_CORE_LOCK(nic); + ifp->if_capenable ^= IFCAP_LRO; + if ((if_getdrvflags(nic->ifp) & IFF_DRV_RUNNING) != 0) { + /* + * Now disable LRO for subsequent packets. + * Atomicity of this change is not necessary + * as we don't need precise toggle of this + * feature for all threads processing the + * completion queue. + */ + for (rq_idx = 0; + rq_idx < nic->qs->rq_cnt; rq_idx++) { + rq = &nic->qs->rq[rq_idx]; + rq->lro_enabled = !rq->lro_enabled; + } + } + NICVF_CORE_UNLOCK(nic); + } + break; default: Modified: head/sys/dev/vnic/nicvf_queues.c ============================================================================== --- head/sys/dev/vnic/nicvf_queues.c Thu Feb 25 14:12:51 2016 (r296030) +++ head/sys/dev/vnic/nicvf_queues.c Thu Feb 25 14:14:46 2016 (r296031) @@ -637,10 +637,12 @@ nicvf_rcv_pkt_handler(struct nicvf *nic, struct cqe_rx_t *cqe_rx, int cqe_type) { struct mbuf *mbuf; + struct rcv_queue *rq; int rq_idx; int err = 0; rq_idx = cqe_rx->rq_idx; + rq = &nic->qs->rq[rq_idx]; /* Check for errors */ err = nicvf_check_cqe_rx_errs(nic, cq, cqe_rx); @@ -659,6 +661,19 @@ nicvf_rcv_pkt_handler(struct nicvf *nic, return (0); } + if (rq->lro_enabled && + ((cqe_rx->l3_type == L3TYPE_IPV4) && (cqe_rx->l4_type == L4TYPE_TCP)) && + (mbuf->m_pkthdr.csum_flags & (CSUM_DATA_VALID | CSUM_PSEUDO_HDR)) == + (CSUM_DATA_VALID | CSUM_PSEUDO_HDR)) { + /* + * At this point it is known that there are no errors in the + * packet. Attempt to LRO enqueue. Send to stack if no resources + * or enqueue error. + */ + if ((rq->lro.lro_cnt != 0) && + (tcp_lro_rx(&rq->lro, mbuf, 0) == 0)) + return (0); + } /* * Push this packet to the stack later to avoid * unlocking completion task in the middle of work. @@ -726,7 +741,11 @@ nicvf_cq_intr_handler(struct nicvf *nic, int cqe_count, cqe_head; struct queue_set *qs = nic->qs; struct cmp_queue *cq = &qs->cq[cq_idx]; + struct rcv_queue *rq; struct cqe_rx_t *cq_desc; + struct lro_ctrl *lro; + struct lro_entry *queued; + int rq_idx; int cmp_err; NICVF_CMP_LOCK(cq); @@ -801,6 +820,17 @@ done: if_setdrvflagbits(nic->ifp, IFF_DRV_RUNNING, IFF_DRV_OACTIVE); } out: + /* + * Flush any outstanding LRO work + */ + rq_idx = cq_idx; + rq = &nic->qs->rq[rq_idx]; + lro = &rq->lro; + while ((queued = SLIST_FIRST(&lro->lro_active)) != NULL) { + SLIST_REMOVE_HEAD(&lro->lro_active, next); + tcp_lro_flush(lro, queued); + } + NICVF_CMP_UNLOCK(cq); ifp = nic->ifp; @@ -1241,18 +1271,39 @@ nicvf_rcv_queue_config(struct nicvf *nic union nic_mbx mbx = {}; struct rcv_queue *rq; struct rq_cfg rq_cfg; + struct ifnet *ifp; + struct lro_ctrl *lro; + + ifp = nic->ifp; rq = &qs->rq[qidx]; rq->enable = enable; + lro = &rq->lro; + /* Disable receive queue */ nicvf_queue_reg_write(nic, NIC_QSET_RQ_0_7_CFG, qidx, 0); if (!rq->enable) { nicvf_reclaim_rcv_queue(nic, qs, qidx); + /* Free LRO memory */ + tcp_lro_free(lro); + rq->lro_enabled = FALSE; return; } + /* Configure LRO if enabled */ + rq->lro_enabled = FALSE; + if ((if_getcapenable(ifp) & IFCAP_LRO) != 0) { + if (tcp_lro_init(lro) != 0) { + device_printf(nic->dev, + "Failed to initialize LRO for RXQ%d\n", qidx); + } else { + rq->lro_enabled = TRUE; + lro->ifp = nic->ifp; + } + } + rq->cq_qs = qs->vnic_id; rq->cq_idx = qidx; rq->start_rbdr_qs = qs->vnic_id; Modified: head/sys/dev/vnic/nicvf_queues.h ============================================================================== --- head/sys/dev/vnic/nicvf_queues.h Thu Feb 25 14:12:51 2016 (r296030) +++ head/sys/dev/vnic/nicvf_queues.h Thu Feb 25 14:14:46 2016 (r296031) @@ -275,6 +275,9 @@ struct rcv_queue { uint8_t start_qs_rbdr_idx; /* RBDR idx in the above QS */ uint8_t caching; struct rx_tx_queue_stats stats; + + boolean_t lro_enabled; + struct lro_ctrl lro; } __aligned(CACHE_LINE_SIZE); struct cmp_queue { From owner-svn-src-head@freebsd.org Thu Feb 25 14:17:14 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EEBBDAAFA6C; Thu, 25 Feb 2016 14:17:14 +0000 (UTC) (envelope-from zbb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BD603DC1; Thu, 25 Feb 2016 14:17:14 +0000 (UTC) (envelope-from zbb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1PEHD9R060288; Thu, 25 Feb 2016 14:17:13 GMT (envelope-from zbb@FreeBSD.org) Received: (from zbb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1PEHDja060287; Thu, 25 Feb 2016 14:17:13 GMT (envelope-from zbb@FreeBSD.org) Message-Id: <201602251417.u1PEHDja060287@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: zbb set sender to zbb@FreeBSD.org using -f From: Zbigniew Bodek Date: Thu, 25 Feb 2016 14:17:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r296032 - head/sys/dev/vnic X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Feb 2016 14:17:15 -0000 Author: zbb Date: Thu Feb 25 14:17:13 2016 New Revision: 296032 URL: https://svnweb.freebsd.org/changeset/base/296032 Log: Prefetch next CQ descriptor in Completion Queue handling loop of VNIC Reviewed by: wma Obtained from: Semihalf Sponsored by: Cavium Differential Revision: https://reviews.freebsd.org/D5322 Modified: head/sys/dev/vnic/nicvf_queues.c Modified: head/sys/dev/vnic/nicvf_queues.c ============================================================================== --- head/sys/dev/vnic/nicvf_queues.c Thu Feb 25 14:14:46 2016 (r296031) +++ head/sys/dev/vnic/nicvf_queues.c Thu Feb 25 14:17:13 2016 (r296032) @@ -768,6 +768,8 @@ nicvf_cq_intr_handler(struct nicvf *nic, cq_desc = (struct cqe_rx_t *)GET_CQ_DESC(cq, cqe_head); cqe_head++; cqe_head &= (cq->dmem.q_len - 1); + /* Prefetch next CQ descriptor */ + __builtin_prefetch((struct cqe_rx_t *)GET_CQ_DESC(cq, cqe_head)); dprintf(nic->dev, "CQ%d cq_desc->cqe_type %d\n", cq_idx, cq_desc->cqe_type); From owner-svn-src-head@freebsd.org Thu Feb 25 14:19:03 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E9408AAFB68; Thu, 25 Feb 2016 14:19:03 +0000 (UTC) (envelope-from zbb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B83D8F51; Thu, 25 Feb 2016 14:19:03 +0000 (UTC) (envelope-from zbb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1PEJ2u9060390; Thu, 25 Feb 2016 14:19:02 GMT (envelope-from zbb@FreeBSD.org) Received: (from zbb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1PEJ2GR060389; Thu, 25 Feb 2016 14:19:02 GMT (envelope-from zbb@FreeBSD.org) Message-Id: <201602251419.u1PEJ2GR060389@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: zbb set sender to zbb@FreeBSD.org using -f From: Zbigniew Bodek Date: Thu, 25 Feb 2016 14:19:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r296033 - head/sys/dev/vnic X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Feb 2016 14:19:04 -0000 Author: zbb Date: Thu Feb 25 14:19:02 2016 New Revision: 296033 URL: https://svnweb.freebsd.org/changeset/base/296033 Log: Enable HWSTATS capability for VNIC VNIC manages counters in hardware hence it is desired to have this option enabled to avoid redundant stats update in ether_input_internal(). Reviewed by: wma Obtained from: Semihalf Sponsored by: Cavium Differential Revision: https://reviews.freebsd.org/D5323 Modified: head/sys/dev/vnic/nicvf_main.c Modified: head/sys/dev/vnic/nicvf_main.c ============================================================================== --- head/sys/dev/vnic/nicvf_main.c Thu Feb 25 14:17:13 2016 (r296032) +++ head/sys/dev/vnic/nicvf_main.c Thu Feb 25 14:19:02 2016 (r296033) @@ -360,6 +360,7 @@ nicvf_setup_ifnet(struct nicvf *nic) */ /* IP/TCP/UDP HW checksums */ if_setcapabilitiesbit(ifp, IFCAP_HWCSUM, 0); + if_setcapabilitiesbit(ifp, IFCAP_HWSTATS, 0); if_sethwassistbits(ifp, (CSUM_IP | CSUM_TCP | CSUM_UDP), 0); #ifdef DEVICE_POLLING From owner-svn-src-head@freebsd.org Thu Feb 25 14:21:05 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A1EFCAAFDBD; Thu, 25 Feb 2016 14:21:05 +0000 (UTC) (envelope-from zbb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6E2E212D1; Thu, 25 Feb 2016 14:21:05 +0000 (UTC) (envelope-from zbb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1PEL4pi060617; Thu, 25 Feb 2016 14:21:04 GMT (envelope-from zbb@FreeBSD.org) Received: (from zbb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1PEL4jS060616; Thu, 25 Feb 2016 14:21:04 GMT (envelope-from zbb@FreeBSD.org) Message-Id: <201602251421.u1PEL4jS060616@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: zbb set sender to zbb@FreeBSD.org using -f From: Zbigniew Bodek Date: Thu, 25 Feb 2016 14:21:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r296034 - head/sys/dev/vnic X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Feb 2016 14:21:05 -0000 Author: zbb Date: Thu Feb 25 14:21:04 2016 New Revision: 296034 URL: https://svnweb.freebsd.org/changeset/base/296034 Log: Clean-up network interface settings for VNIC - Remove unrelevant bits - Remove redundant code - Reset variables and then set given bits Reviewed by: wma Obtained from: Semihalf Sponsored by: Cavium Differential Revision: https://reviews.freebsd.org/D5324 Modified: head/sys/dev/vnic/nicvf_main.c Modified: head/sys/dev/vnic/nicvf_main.c ============================================================================== --- head/sys/dev/vnic/nicvf_main.c Thu Feb 25 14:19:02 2016 (r296033) +++ head/sys/dev/vnic/nicvf_main.c Thu Feb 25 14:21:04 2016 (r296034) @@ -348,27 +348,24 @@ nicvf_setup_ifnet(struct nicvf *nic) if_setinitfn(ifp, nicvf_if_init); if_setgetcounterfn(ifp, nicvf_if_getcounter); - /* Set send queue len to number to default maximum */ - if_setsendqlen(ifp, IFQ_MAXLEN); - if_setsendqready(ifp); if_setmtu(ifp, ETHERMTU); - if_setcapabilities(ifp, IFCAP_VLAN_MTU); + /* Reset caps */ + if_setcapabilities(ifp, 0); + + /* Set the default values */ + if_setcapabilitiesbit(ifp, IFCAP_VLAN_MTU, 0); if_setcapabilitiesbit(ifp, IFCAP_LRO, 0); - /* - * HW offload capabilities - */ /* IP/TCP/UDP HW checksums */ if_setcapabilitiesbit(ifp, IFCAP_HWCSUM, 0); if_setcapabilitiesbit(ifp, IFCAP_HWSTATS, 0); - if_sethwassistbits(ifp, (CSUM_IP | CSUM_TCP | CSUM_UDP), 0); + /* + * HW offload enable + */ + if_clearhwassist(ifp); + if_sethwassistbits(ifp, (CSUM_IP | CSUM_TCP | CSUM_UDP | CSUM_SCTP), 0); -#ifdef DEVICE_POLLING -#error "DEVICE_POLLING not supported in VNIC driver yet" - if_setcapabilitiesbit(ifp, IFCAP_POLLING, 0); -#endif if_setcapenable(ifp, if_getcapabilities(ifp)); - if_setmtu(ifp, ETHERMTU); return (0); } From owner-svn-src-head@freebsd.org Thu Feb 25 14:23:03 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AC4FAAAFEDF; Thu, 25 Feb 2016 14:23:03 +0000 (UTC) (envelope-from zbb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 67BDC178A; Thu, 25 Feb 2016 14:23:03 +0000 (UTC) (envelope-from zbb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1PEN2ZE063400; Thu, 25 Feb 2016 14:23:02 GMT (envelope-from zbb@FreeBSD.org) Received: (from zbb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1PEN2Fg063397; Thu, 25 Feb 2016 14:23:02 GMT (envelope-from zbb@FreeBSD.org) Message-Id: <201602251423.u1PEN2Fg063397@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: zbb set sender to zbb@FreeBSD.org using -f From: Zbigniew Bodek Date: Thu, 25 Feb 2016 14:23:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r296035 - head/sys/dev/vnic X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Feb 2016 14:23:03 -0000 Author: zbb Date: Thu Feb 25 14:23:02 2016 New Revision: 296035 URL: https://svnweb.freebsd.org/changeset/base/296035 Log: Improve VNIC performance on Tx path by immediate packet transmission Don't postpone Tx if the Tx lock can be acquired now. This gives 3x better performance on egress. Reviewed by: wma Obtained from: Semihalf Sponsored by: Cavium Differential Revision: https://reviews.freebsd.org/D5325 Modified: head/sys/dev/vnic/nicvf_main.c head/sys/dev/vnic/nicvf_queues.c head/sys/dev/vnic/nicvf_queues.h Modified: head/sys/dev/vnic/nicvf_main.c ============================================================================== --- head/sys/dev/vnic/nicvf_main.c Thu Feb 25 14:21:04 2016 (r296034) +++ head/sys/dev/vnic/nicvf_main.c Thu Feb 25 14:23:02 2016 (r296035) @@ -663,11 +663,18 @@ nicvf_if_transmit(struct ifnet *ifp, str mbuf = mtmp; } } + + if (NICVF_TX_TRYLOCK(sq) != 0) { + err = nicvf_tx_mbuf_locked(sq, mbuf); + NICVF_TX_UNLOCK(sq); + return (err); + } else { err = drbr_enqueue(ifp, sq->br, mbuf); if (err != 0) return (err); - taskqueue_enqueue(sq->snd_taskq, &sq->snd_task); + taskqueue_enqueue(sq->snd_taskq, &sq->snd_task); + } return (0); } Modified: head/sys/dev/vnic/nicvf_queues.c ============================================================================== --- head/sys/dev/vnic/nicvf_queues.c Thu Feb 25 14:21:04 2016 (r296034) +++ head/sys/dev/vnic/nicvf_queues.c Thu Feb 25 14:23:02 2016 (r296035) @@ -98,7 +98,6 @@ __FBSDID("$FreeBSD$"); MALLOC_DECLARE(M_NICVF); static void nicvf_free_snd_queue(struct nicvf *, struct snd_queue *); -static int nicvf_tx_mbuf_locked(struct snd_queue *, struct mbuf *); static struct mbuf * nicvf_get_rcv_mbuf(struct nicvf *, struct cqe_rx_t *); static void nicvf_sq_disable(struct nicvf *, int); static void nicvf_sq_enable(struct nicvf *, struct snd_queue *, int); @@ -1856,7 +1855,7 @@ static inline void nicvf_sq_add_gather_s } /* Put an mbuf to a SQ for packet transfer. */ -static int +int nicvf_tx_mbuf_locked(struct snd_queue *sq, struct mbuf *mbuf) { bus_dma_segment_t segs[256]; Modified: head/sys/dev/vnic/nicvf_queues.h ============================================================================== --- head/sys/dev/vnic/nicvf_queues.h Thu Feb 25 14:21:04 2016 (r296034) +++ head/sys/dev/vnic/nicvf_queues.h Thu Feb 25 14:23:02 2016 (r296035) @@ -385,6 +385,8 @@ void nicvf_disable_intr(struct nicvf *, void nicvf_clear_intr(struct nicvf *, int, int); int nicvf_is_intr_enabled(struct nicvf *, int, int); +int nicvf_tx_mbuf_locked(struct snd_queue *, struct mbuf *); + /* Register access APIs */ void nicvf_reg_write(struct nicvf *, uint64_t, uint64_t); uint64_t nicvf_reg_read(struct nicvf *, uint64_t); From owner-svn-src-head@freebsd.org Thu Feb 25 14:24:33 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A0496AAFFAC; Thu, 25 Feb 2016 14:24:33 +0000 (UTC) (envelope-from zbb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 72EF91988; Thu, 25 Feb 2016 14:24:33 +0000 (UTC) (envelope-from zbb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1PEOWeM063493; Thu, 25 Feb 2016 14:24:32 GMT (envelope-from zbb@FreeBSD.org) Received: (from zbb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1PEOWlk063492; Thu, 25 Feb 2016 14:24:32 GMT (envelope-from zbb@FreeBSD.org) Message-Id: <201602251424.u1PEOWlk063492@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: zbb set sender to zbb@FreeBSD.org using -f From: Zbigniew Bodek Date: Thu, 25 Feb 2016 14:24:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r296036 - head/sys/dev/vnic X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Feb 2016 14:24:33 -0000 Author: zbb Date: Thu Feb 25 14:24:32 2016 New Revision: 296036 URL: https://svnweb.freebsd.org/changeset/base/296036 Log: Remove soft reset from the VNIC's PF driver This is not needed and causes revid register of the PCI configuration space to clear on Pass2.0. Reviewed by: wma Obtained from: Semihalf Sponsored by: Cavium Differential Revision: https://reviews.freebsd.org/D5421 Modified: head/sys/dev/vnic/nic_main.c Modified: head/sys/dev/vnic/nic_main.c ============================================================================== --- head/sys/dev/vnic/nic_main.c Thu Feb 25 14:23:02 2016 (r296035) +++ head/sys/dev/vnic/nic_main.c Thu Feb 25 14:24:32 2016 (r296036) @@ -628,9 +628,6 @@ nic_init_hw(struct nicpf *nic) { int i; - /* Reset NIC, in case the driver is repeatedly inserted and removed */ - nic_reg_write(nic, NIC_PF_SOFT_RESET, 1); - /* Enable NIC HW block */ nic_reg_write(nic, NIC_PF_CFG, 0x3); From owner-svn-src-head@freebsd.org Thu Feb 25 14:26:15 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2B3DDAB30C2; Thu, 25 Feb 2016 14:26:15 +0000 (UTC) (envelope-from zbb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0A4181BE9; Thu, 25 Feb 2016 14:26:14 +0000 (UTC) (envelope-from zbb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1PEQEoK063595; Thu, 25 Feb 2016 14:26:14 GMT (envelope-from zbb@FreeBSD.org) Received: (from zbb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1PEQDCR063592; Thu, 25 Feb 2016 14:26:13 GMT (envelope-from zbb@FreeBSD.org) Message-Id: <201602251426.u1PEQDCR063592@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: zbb set sender to zbb@FreeBSD.org using -f From: Zbigniew Bodek Date: Thu, 25 Feb 2016 14:26:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r296037 - head/sys/dev/vnic X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Feb 2016 14:26:15 -0000 Author: zbb Date: Thu Feb 25 14:26:13 2016 New Revision: 296037 URL: https://svnweb.freebsd.org/changeset/base/296037 Log: Fix VNIC support for Pass2.0 ThunderX chips - Check chip revision using pass1_silicon() routine. - Configure CPI correctly for Pass2.0 Reviewed by: wma Obtained from: Semihalf Sponsored by: Cavium Differential Revision: https://reviews.freebsd.org/D5422 Modified: head/sys/dev/vnic/nic.h head/sys/dev/vnic/nic_main.c head/sys/dev/vnic/nic_reg.h Modified: head/sys/dev/vnic/nic.h ============================================================================== --- head/sys/dev/vnic/nic.h Thu Feb 25 14:24:32 2016 (r296036) +++ head/sys/dev/vnic/nic.h Thu Feb 25 14:26:13 2016 (r296037) @@ -42,6 +42,9 @@ #define PCI_CFG_REG_BAR_NUM 0 #define PCI_MSIX_REG_BAR_NUM 4 +/* PCI revision IDs */ +#define PCI_REVID_PASS2 8 + /* NIC SRIOV VF count */ #define MAX_NUM_VFS_SUPPORTED 128 #define DEFAULT_NUM_VF_ENABLED 8 @@ -483,6 +486,14 @@ nic_get_node_id(struct resource *res) return ((addr >> NIC_NODE_ID_SHIFT) & NIC_NODE_ID_MASK); } +static __inline boolean_t +pass1_silicon(device_t dev) +{ + + /* Check if the chip revision is < Pass2 */ + return (pci_get_revid(dev) < PCI_REVID_PASS2); +} + int nicvf_send_msg_to_pf(struct nicvf *vf, union nic_mbx *mbx); #endif /* NIC_H */ Modified: head/sys/dev/vnic/nic_main.c ============================================================================== --- head/sys/dev/vnic/nic_main.c Thu Feb 25 14:24:32 2016 (r296036) +++ head/sys/dev/vnic/nic_main.c Thu Feb 25 14:26:13 2016 (r296037) @@ -87,7 +87,6 @@ struct nicvf_info { struct nicpf { device_t dev; - uint8_t rev_id; uint8_t node; u_int flags; uint8_t num_vf_en; /* No of VF enabled */ @@ -200,7 +199,6 @@ nicpf_attach(device_t dev) } nic->node = nic_get_node_id(nic->reg_base); - nic->rev_id = pci_read_config(dev, PCIR_REVID, 1); /* Enable Traffic Network Switch (TNS) bypass mode by default */ nic->flags &= ~NIC_TNS_ENABLED; @@ -416,7 +414,7 @@ nic_send_msg_to_vf(struct nicpf *nic, in * when PF writes to MBOX(1), in next revisions when * PF writes to MBOX(0) */ - if (nic->rev_id == 0) { + if (pass1_silicon(nic->dev)) { nic_reg_write(nic, mbx_addr + 0, msg[0]); nic_reg_write(nic, mbx_addr + 8, msg[1]); } else { @@ -729,8 +727,17 @@ nic_config_cpi(struct nicpf *nic, struct padd = cpi % 8; /* 3 bits CS out of 6bits DSCP */ /* Leave RSS_SIZE as '0' to disable RSS */ - nic_reg_write(nic, NIC_PF_CPI_0_2047_CFG | (cpi << 3), - (vnic << 24) | (padd << 16) | (rssi_base + rssi)); + if (pass1_silicon(nic->dev)) { + nic_reg_write(nic, NIC_PF_CPI_0_2047_CFG | (cpi << 3), + (vnic << 24) | (padd << 16) | (rssi_base + rssi)); + } else { + /* Set MPI_ALG to '0' to disable MCAM parsing */ + nic_reg_write(nic, NIC_PF_CPI_0_2047_CFG | (cpi << 3), + (padd << 16)); + /* MPI index is same as CPI if MPI_ALG is not enabled */ + nic_reg_write(nic, NIC_PF_MPI_0_2047_CFG | (cpi << 3), + (vnic << 24) | (rssi_base + rssi)); + } if ((rssi + 1) >= cfg->rq_cnt) continue; Modified: head/sys/dev/vnic/nic_reg.h ============================================================================== --- head/sys/dev/vnic/nic_reg.h Thu Feb 25 14:24:32 2016 (r296036) +++ head/sys/dev/vnic/nic_reg.h Thu Feb 25 14:26:13 2016 (r296037) @@ -107,6 +107,7 @@ #define NIC_PF_ECC3_DBE_ENA_W1C (0x2710) #define NIC_PF_ECC3_DBE_ENA_W1S (0x2718) #define NIC_PF_CPI_0_2047_CFG (0x200000) +#define NIC_PF_MPI_0_2047_CFG (0x210000) #define NIC_PF_RSSI_0_4097_RQ (0x220000) #define NIC_PF_LMAC_0_7_CFG (0x240000) #define NIC_PF_LMAC_0_7_SW_XOFF (0x242000) From owner-svn-src-head@freebsd.org Thu Feb 25 14:28:11 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E840FAB319E; Thu, 25 Feb 2016 14:28:11 +0000 (UTC) (envelope-from zbb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BAB2A1DAB; Thu, 25 Feb 2016 14:28:11 +0000 (UTC) (envelope-from zbb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1PESAOZ063713; Thu, 25 Feb 2016 14:28:10 GMT (envelope-from zbb@FreeBSD.org) Received: (from zbb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1PESAv1063711; Thu, 25 Feb 2016 14:28:10 GMT (envelope-from zbb@FreeBSD.org) Message-Id: <201602251428.u1PESAv1063711@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: zbb set sender to zbb@FreeBSD.org using -f From: Zbigniew Bodek Date: Thu, 25 Feb 2016 14:28:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r296038 - head/sys/dev/vnic X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Feb 2016 14:28:12 -0000 Author: zbb Date: Thu Feb 25 14:28:10 2016 New Revision: 296038 URL: https://svnweb.freebsd.org/changeset/base/296038 Log: Enable CQ count threshold interrupt on VNIC Pass2.0 On Pass2.0 can trigger interrupt on both timer and CQ count. Reviewed by: wma Obtained from: Semihalf Sponsored by: Cavium Differential Revision: https://reviews.freebsd.org/D5423 Modified: head/sys/dev/vnic/nicvf_queues.c head/sys/dev/vnic/nicvf_queues.h Modified: head/sys/dev/vnic/nicvf_queues.c ============================================================================== --- head/sys/dev/vnic/nicvf_queues.c Thu Feb 25 14:26:13 2016 (r296037) +++ head/sys/dev/vnic/nicvf_queues.c Thu Feb 25 14:28:10 2016 (r296038) @@ -940,7 +940,7 @@ nicvf_init_cmp_queue(struct nicvf *nic, } cq->desc = cq->dmem.base; - cq->thresh = CMP_QUEUE_CQE_THRESH; + cq->thresh = pass1_silicon(nic->dev) ? 0 : CMP_QUEUE_CQE_THRESH; cq->nic = nic; cq->idx = qidx; nic->cq_coalesce_usecs = (CMP_QUEUE_TIMER_THRESH * 0.05) - 1; Modified: head/sys/dev/vnic/nicvf_queues.h ============================================================================== --- head/sys/dev/vnic/nicvf_queues.h Thu Feb 25 14:26:13 2016 (r296037) +++ head/sys/dev/vnic/nicvf_queues.h Thu Feb 25 14:28:10 2016 (r296038) @@ -96,7 +96,7 @@ */ #define CMP_QSIZE CMP_QUEUE_SIZE2 #define CMP_QUEUE_LEN (1UL << (CMP_QSIZE + 10)) -#define CMP_QUEUE_CQE_THRESH 0 +#define CMP_QUEUE_CQE_THRESH 32 #define CMP_QUEUE_TIMER_THRESH 220 /* 10usec */ #define RBDR_SIZE RBDR_SIZE0 From owner-svn-src-head@freebsd.org Thu Feb 25 14:29:58 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D9F2FAB330E; Thu, 25 Feb 2016 14:29:58 +0000 (UTC) (envelope-from zbb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B6B1F1F88; Thu, 25 Feb 2016 14:29:58 +0000 (UTC) (envelope-from zbb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1PETveE063816; Thu, 25 Feb 2016 14:29:57 GMT (envelope-from zbb@FreeBSD.org) Received: (from zbb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1PETvxQ063810; Thu, 25 Feb 2016 14:29:57 GMT (envelope-from zbb@FreeBSD.org) Message-Id: <201602251429.u1PETvxQ063810@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: zbb set sender to zbb@FreeBSD.org using -f From: Zbigniew Bodek Date: Thu, 25 Feb 2016 14:29:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r296039 - head/sys/dev/vnic X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Feb 2016 14:29:58 -0000 Author: zbb Date: Thu Feb 25 14:29:57 2016 New Revision: 296039 URL: https://svnweb.freebsd.org/changeset/base/296039 Log: Introduce HW TSO support for VNIC This feature was added in Pass2.0. Significantly improves VNIC's TCP performance on Tx. Reviewed by: wma Obtained from: Semihalf Sponsored by: Cavium Differential Revision: https://reviews.freebsd.org/D5424 Modified: head/sys/dev/vnic/nic.h head/sys/dev/vnic/nicvf_main.c head/sys/dev/vnic/nicvf_queues.c head/sys/dev/vnic/nicvf_queues.h head/sys/dev/vnic/q_struct.h Modified: head/sys/dev/vnic/nic.h ============================================================================== --- head/sys/dev/vnic/nic.h Thu Feb 25 14:28:10 2016 (r296038) +++ head/sys/dev/vnic/nic.h Thu Feb 25 14:29:57 2016 (r296039) @@ -292,6 +292,7 @@ struct nicvf { uint8_t max_queues; struct resource *reg_base; boolean_t link_up; + boolean_t hw_tso; uint8_t duplex; uint32_t speed; uint8_t cpi_alg; Modified: head/sys/dev/vnic/nicvf_main.c ============================================================================== --- head/sys/dev/vnic/nicvf_main.c Thu Feb 25 14:28:10 2016 (r296038) +++ head/sys/dev/vnic/nicvf_main.c Thu Feb 25 14:29:57 2016 (r296039) @@ -66,6 +66,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include @@ -194,6 +195,9 @@ nicvf_attach(device_t dev) nic->pnicvf = nic; NICVF_CORE_LOCK_INIT(nic); + /* Enable HW TSO on Pass2 */ + if (!pass1_silicon(dev)) + nic->hw_tso = TRUE; rid = VNIC_VF_REG_RID; nic->reg_base = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, @@ -356,6 +360,14 @@ nicvf_setup_ifnet(struct nicvf *nic) /* Set the default values */ if_setcapabilitiesbit(ifp, IFCAP_VLAN_MTU, 0); if_setcapabilitiesbit(ifp, IFCAP_LRO, 0); + if (nic->hw_tso) { + /* TSO */ + if_setcapabilitiesbit(ifp, IFCAP_TSO4, 0); + /* TSO parameters */ + ifp->if_hw_tsomax = NICVF_TSO_MAXSIZE; + ifp->if_hw_tsomaxsegcount = NICVF_TSO_NSEGS; + ifp->if_hw_tsomaxsegsize = MCLBYTES; + } /* IP/TCP/UDP HW checksums */ if_setcapabilitiesbit(ifp, IFCAP_HWCSUM, 0); if_setcapabilitiesbit(ifp, IFCAP_HWSTATS, 0); @@ -364,7 +376,8 @@ nicvf_setup_ifnet(struct nicvf *nic) */ if_clearhwassist(ifp); if_sethwassistbits(ifp, (CSUM_IP | CSUM_TCP | CSUM_UDP | CSUM_SCTP), 0); - + if (nic->hw_tso) + if_sethwassistbits(ifp, (CSUM_TSO), 0); if_setcapenable(ifp, if_getcapabilities(ifp)); return (0); @@ -513,6 +526,8 @@ nicvf_if_ioctl(struct ifnet *ifp, u_long ifp->if_capenable ^= IFCAP_TXCSUM; if (mask & IFCAP_RXCSUM) ifp->if_capenable ^= IFCAP_RXCSUM; + if ((mask & IFCAP_TSO4) && nic->hw_tso) + ifp->if_capenable ^= IFCAP_TSO4; if (mask & IFCAP_LRO) { /* * Lock the driver for a moment to avoid Modified: head/sys/dev/vnic/nicvf_queues.c ============================================================================== --- head/sys/dev/vnic/nicvf_queues.c Thu Feb 25 14:28:10 2016 (r296038) +++ head/sys/dev/vnic/nicvf_queues.c Thu Feb 25 14:29:57 2016 (r296039) @@ -1070,8 +1070,8 @@ nicvf_init_snd_queue(struct nicvf *nic, BUS_SPACE_MAXADDR, /* lowaddr */ BUS_SPACE_MAXADDR, /* highaddr */ NULL, NULL, /* filtfunc, filtfuncarg */ - NICVF_TXBUF_MAXSIZE, /* maxsize */ - NICVF_TXBUF_NSEGS, /* nsegments */ + NICVF_TSO_MAXSIZE, /* maxsize */ + NICVF_TSO_NSEGS, /* nsegments */ MCLBYTES, /* maxsegsize */ 0, /* flags */ NULL, NULL, /* lockfunc, lockfuncarg */ @@ -1727,14 +1727,18 @@ static __inline int nicvf_sq_add_hdr_subdesc(struct snd_queue *sq, int qentry, int subdesc_cnt, struct mbuf *mbuf, int len) { + struct nicvf *nic; struct sq_hdr_subdesc *hdr; struct ether_vlan_header *eh; #ifdef INET struct ip *ip; + struct tcphdr *th; #endif uint16_t etype; int ehdrlen, iphlen, poff; + nic = sq->nic; + hdr = (struct sq_hdr_subdesc *)GET_SQ_DESC(sq, qentry); sq->snd_buff[qentry].mbuf = mbuf; @@ -1746,18 +1750,25 @@ nicvf_sq_add_hdr_subdesc(struct snd_queu hdr->subdesc_cnt = subdesc_cnt; hdr->tot_len = len; - if (mbuf->m_pkthdr.csum_flags != 0) { - hdr->csum_l3 = 1; /* Enable IP csum calculation */ - - eh = mtod(mbuf, struct ether_vlan_header *); - if (eh->evl_encap_proto == htons(ETHERTYPE_VLAN)) { - ehdrlen = ETHER_HDR_LEN + ETHER_VLAN_ENCAP_LEN; - etype = ntohs(eh->evl_proto); - } else { - ehdrlen = ETHER_HDR_LEN; - etype = ntohs(eh->evl_encap_proto); - } + eh = mtod(mbuf, struct ether_vlan_header *); + if (eh->evl_encap_proto == htons(ETHERTYPE_VLAN)) { + ehdrlen = ETHER_HDR_LEN + ETHER_VLAN_ENCAP_LEN; + etype = ntohs(eh->evl_proto); + } else { + ehdrlen = ETHER_HDR_LEN; + etype = ntohs(eh->evl_encap_proto); + } + switch (etype) { +#ifdef INET6 + case ETHERTYPE_IPV6: + /* ARM64TODO: Add support for IPv6 */ + hdr->csum_l3 = 0; + sq->snd_buff[qentry].mbuf = NULL; + return (ENXIO); +#endif +#ifdef INET + case ETHERTYPE_IP: if (mbuf->m_len < ehdrlen + sizeof(struct ip)) { mbuf = m_pullup(mbuf, ehdrlen + sizeof(struct ip)); sq->snd_buff[qentry].mbuf = mbuf; @@ -1765,21 +1776,13 @@ nicvf_sq_add_hdr_subdesc(struct snd_queu return (ENOBUFS); } - switch (etype) { -#ifdef INET6 - case ETHERTYPE_IPV6: - /* ARM64TODO: Add support for IPv6 */ - hdr->csum_l3 = 0; - sq->snd_buff[qentry].mbuf = NULL; - return (ENXIO); -#endif -#ifdef INET - case ETHERTYPE_IP: - ip = (struct ip *)(mbuf->m_data + ehdrlen); - ip->ip_sum = 0; - iphlen = ip->ip_hl << 2; - poff = ehdrlen + iphlen; + ip = (struct ip *)(mbuf->m_data + ehdrlen); + ip->ip_sum = 0; + iphlen = ip->ip_hl << 2; + poff = ehdrlen + iphlen; + if (mbuf->m_pkthdr.csum_flags != 0) { + hdr->csum_l3 = 1; /* Enable IP csum calculation */ switch (ip->ip_p) { case IPPROTO_TCP: if ((mbuf->m_pkthdr.csum_flags & CSUM_TCP) == 0) @@ -1820,17 +1823,28 @@ nicvf_sq_add_hdr_subdesc(struct snd_queu default: break; } - break; -#endif - default: - hdr->csum_l3 = 0; - return (0); + hdr->l3_offset = ehdrlen; + hdr->l4_offset = ehdrlen + iphlen; } - hdr->l3_offset = ehdrlen; - hdr->l4_offset = ehdrlen + iphlen; - } else + if ((mbuf->m_pkthdr.tso_segsz != 0) && nic->hw_tso) { + /* + * Extract ip again as m_data could have been modified. + */ + ip = (struct ip *)(mbuf->m_data + ehdrlen); + th = (struct tcphdr *)((caddr_t)ip + iphlen); + + hdr->tso = 1; + hdr->tso_start = ehdrlen + iphlen + (th->th_off * 4); + hdr->tso_max_paysize = mbuf->m_pkthdr.tso_segsz; + hdr->inner_l3_offset = ehdrlen - 2; + nic->drv_stats.tx_tso++; + } + break; +#endif + default: hdr->csum_l3 = 0; + } return (0); } @@ -1859,10 +1873,11 @@ int nicvf_tx_mbuf_locked(struct snd_queue *sq, struct mbuf *mbuf) { bus_dma_segment_t segs[256]; + struct nicvf *nic; struct snd_buff *snd_buff; size_t seg; int nsegs, qentry; - int subdesc_cnt = MIN_SQ_DESC_PER_PKT_XMIT - 1; + int subdesc_cnt; int err; NICVF_TX_LOCK_ASSERT(sq); @@ -1880,7 +1895,11 @@ nicvf_tx_mbuf_locked(struct snd_queue *s } /* Set how many subdescriptors is required */ - subdesc_cnt += nsegs; + nic = sq->nic; + if (mbuf->m_pkthdr.tso_segsz != 0 && nic->hw_tso) + subdesc_cnt = MIN_SQ_DESC_PER_PKT_XMIT; + else + subdesc_cnt = MIN_SQ_DESC_PER_PKT_XMIT + nsegs - 1; if (subdesc_cnt > sq->free_cnt) { /* ARM64TODO: Add mbuf defragmentation if we lack descriptors */ Modified: head/sys/dev/vnic/nicvf_queues.h ============================================================================== --- head/sys/dev/vnic/nicvf_queues.h Thu Feb 25 14:28:10 2016 (r296038) +++ head/sys/dev/vnic/nicvf_queues.h Thu Feb 25 14:29:57 2016 (r296039) @@ -131,10 +131,13 @@ #define NICVF_RCV_BUF_ALIGN_LEN(addr) \ (NICVF_ALIGNED_ADDR((addr), NICVF_RCV_BUF_ALIGN_BYTES) - (addr)) -#define NICVF_TXBUF_MAXSIZE 9212 /* Total max payload without TSO */ +#define NICVF_TXBUF_MAXSIZE NIC_HW_MAX_FRS /* Total max payload without TSO */ #define NICVF_TXBUF_NSEGS 256 /* Single command is at most 256 buffers (hdr + 255 subcmds) */ - +/* TSO-related definitions */ +#define NICVF_TSO_MAXSIZE IP_MAXPACKET +#define NICVF_TSO_NSEGS NICVF_TXBUF_NSEGS +#define NICVF_TSO_HEADER_SIZE 128 /* Queue enable/disable */ #define NICVF_SQ_EN (1UL << 19) Modified: head/sys/dev/vnic/q_struct.h ============================================================================== --- head/sys/dev/vnic/q_struct.h Thu Feb 25 14:28:10 2016 (r296038) +++ head/sys/dev/vnic/q_struct.h Thu Feb 25 14:29:57 2016 (r296039) @@ -565,25 +565,28 @@ struct sq_hdr_subdesc { uint64_t subdesc_cnt:8; uint64_t csum_l4:2; uint64_t csum_l3:1; - uint64_t rsvd0:5; + uint64_t csum_inner_l4:2; + uint64_t csum_inner_l3:1; + uint64_t rsvd0:2; uint64_t l4_offset:8; uint64_t l3_offset:8; uint64_t rsvd1:4; uint64_t tot_len:20; /* W0 */ - uint64_t tso_sdc_cont:8; - uint64_t tso_sdc_first:8; - uint64_t tso_l4_offset:8; - uint64_t tso_flags_last:12; - uint64_t tso_flags_first:12; - uint64_t rsvd2:2; + uint64_t rsvd2:24; + uint64_t inner_l4_offset:8; + uint64_t inner_l3_offset:8; + uint64_t tso_start:8; + uint64_t rsvd3:2; uint64_t tso_max_paysize:14; /* W1 */ #elif defined(__LITTLE_ENDIAN_BITFIELD) uint64_t tot_len:20; uint64_t rsvd1:4; uint64_t l3_offset:8; uint64_t l4_offset:8; - uint64_t rsvd0:5; + uint64_t rsvd0:2; + uint64_t csum_inner_l3:1; + uint64_t csum_inner_l4:2; uint64_t csum_l3:1; uint64_t csum_l4:2; uint64_t subdesc_cnt:8; @@ -594,12 +597,11 @@ struct sq_hdr_subdesc { uint64_t subdesc_type:4; /* W0 */ uint64_t tso_max_paysize:14; - uint64_t rsvd2:2; - uint64_t tso_flags_first:12; - uint64_t tso_flags_last:12; - uint64_t tso_l4_offset:8; - uint64_t tso_sdc_first:8; - uint64_t tso_sdc_cont:8; /* W1 */ + uint64_t rsvd3:2; + uint64_t tso_start:8; + uint64_t inner_l3_offset:8; + uint64_t inner_l4_offset:8; + uint64_t rsvd2:24; #endif }; From owner-svn-src-head@freebsd.org Thu Feb 25 16:50:38 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 82304AB455C; Thu, 25 Feb 2016 16:50:38 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 58B5F1E3; Thu, 25 Feb 2016 16:50:38 +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 u1PGobuw006296; Thu, 25 Feb 2016 16:50:37 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1PGoa1q006291; Thu, 25 Feb 2016 16:50:36 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201602251650.u1PGoa1q006291@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Thu, 25 Feb 2016 16:50:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r296041 - head/sys/arm/allwinner X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Feb 2016 16:50:38 -0000 Author: andrew Date: Thu Feb 25 16:50:36 2016 New Revision: 296041 URL: https://svnweb.freebsd.org/changeset/base/296041 Log: Add support for the Allwinner A31 watchdog to the existing A10 watchdog driver. This mostly involves selecting the register offsets to use at runtime based on the hardware we are talking to. Submitted by: Emmanuel Vadot Differential Revision: https://reviews.freebsd.org/D5327 Added: head/sys/arm/allwinner/aw_wdog.c - copied, changed from r296040, head/sys/arm/allwinner/a10_wdog.c head/sys/arm/allwinner/aw_wdog.h - copied, changed from r296040, head/sys/arm/allwinner/a10_wdog.h Deleted: head/sys/arm/allwinner/a10_wdog.c head/sys/arm/allwinner/a10_wdog.h Modified: head/sys/arm/allwinner/allwinner_machdep.c head/sys/arm/allwinner/files.allwinner Modified: head/sys/arm/allwinner/allwinner_machdep.c ============================================================================== --- head/sys/arm/allwinner/allwinner_machdep.c Thu Feb 25 15:33:55 2016 (r296040) +++ head/sys/arm/allwinner/allwinner_machdep.c Thu Feb 25 16:50:36 2016 (r296041) @@ -50,7 +50,7 @@ __FBSDID("$FreeBSD$"); #include -#include +#include #include #include "platform_if.h" @@ -134,7 +134,7 @@ bus_dma_get_range_nb(void) void cpu_reset() { - a10wd_watchdog_reset(); + aw_wdog_watchdog_reset(); printf("Reset failed!\n"); while (1); } Copied and modified: head/sys/arm/allwinner/aw_wdog.c (from r296040, head/sys/arm/allwinner/a10_wdog.c) ============================================================================== --- head/sys/arm/allwinner/a10_wdog.c Thu Feb 25 15:33:55 2016 (r296040, copy source) +++ head/sys/arm/allwinner/aw_wdog.c Thu Feb 25 16:50:36 2016 (r296041) @@ -1,5 +1,6 @@ /*- * Copyright (c) 2013 Oleksandr Tymoshenko + * Copyright (c) 2016 Emmanuel Vadot * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -45,24 +46,30 @@ __FBSDID("$FreeBSD$"); #include #include -#include +#include #define READ(_sc, _r) bus_read_4((_sc)->res, (_r)) #define WRITE(_sc, _r, _v) bus_write_4((_sc)->res, (_r), (_v)) -#define WDOG_CTRL 0x00 -#define WDOG_CTRL_RESTART (1 << 0) -#define WDOG_MODE 0x04 -#define WDOG_MODE_INTVL_SHIFT 3 -#define WDOG_MODE_RST_EN (1 << 1) -#define WDOG_MODE_EN (1 << 0) +#define A10_WDOG_CTRL 0x00 +#define A31_WDOG_CTRL 0x10 +#define WDOG_CTRL_RESTART (1 << 0) +#define A10_WDOG_MODE 0x04 +#define A31_WDOG_MODE 0x18 +#define A10_WDOG_MODE_INTVL_SHIFT 3 +#define A31_WDOG_MODE_INTVL_SHIFT 4 +#define A10_WDOG_MODE_RST_EN (1 << 1) +#define WDOG_MODE_EN (1 << 0) +#define A31_WDOG_CONFIG 0x14 +#define A31_WDOG_CONFIG_RST_EN_SYSTEM (1 << 0) +#define A31_WDOG_CONFIG_RST_EN_INT (2 << 0) -struct a10wd_interval { +struct aw_wdog_interval { uint64_t milliseconds; unsigned int value; }; -struct a10wd_interval wd_intervals[] = { +struct aw_wdog_interval wd_intervals[] = { { 500, 0 }, { 1000, 1 }, { 2000, 2 }, @@ -78,38 +85,58 @@ struct a10wd_interval wd_intervals[] = { { 0, 0 } /* sentinel */ }; -static struct a10wd_softc *a10wd_sc = NULL; +static struct aw_wdog_softc *aw_wdog_sc = NULL; -struct a10wd_softc { +struct aw_wdog_softc { device_t dev; struct resource * res; struct mtx mtx; + uint8_t wdog_ctrl; + uint8_t wdog_mode; + uint8_t wdog_mode_intvl_shift; + uint8_t wdog_mode_en; + uint8_t wdog_config; + uint8_t wdog_config_value; }; -static void a10wd_watchdog_fn(void *private, u_int cmd, int *error); +#define A10_WATCHDOG 1 +#define A31_WATCHDOG 2 + +static struct ofw_compat_data compat_data[] = { + {"allwinner,sun4i-a10-wdt", A10_WATCHDOG}, + {"allwinner,sun6i-a31-wdt", A31_WATCHDOG}, + {NULL, 0} +}; + +static void aw_wdog_watchdog_fn(void *private, u_int cmd, int *error); static int -a10wd_probe(device_t dev) +aw_wdog_probe(device_t dev) { + struct aw_wdog_softc *sc; + + sc = device_get_softc(dev); if (!ofw_bus_status_okay(dev)) return (ENXIO); - - if (ofw_bus_is_compatible(dev, "allwinner,sun4i-a10-wdt")) { + switch (ofw_bus_search_compatible(dev, compat_data)->ocd_data) { + case A10_WATCHDOG: device_set_desc(dev, "Allwinner A10 Watchdog"); return (BUS_PROBE_DEFAULT); + case A31_WATCHDOG: + device_set_desc(dev, "Allwinner A31 Watchdog"); + return (BUS_PROBE_DEFAULT); } - return (ENXIO); } static int -a10wd_attach(device_t dev) +aw_wdog_attach(device_t dev) { - struct a10wd_softc *sc; + struct aw_wdog_softc *sc; int rid; - if (a10wd_sc != NULL) + if (aw_wdog_sc != NULL) return (ENXIO); sc = device_get_softc(dev); @@ -122,17 +149,37 @@ a10wd_attach(device_t dev) return (ENXIO); } - a10wd_sc = sc; - mtx_init(&sc->mtx, "A10 Watchdog", "a10wd", MTX_DEF); - EVENTHANDLER_REGISTER(watchdog_list, a10wd_watchdog_fn, sc, 0); + aw_wdog_sc = sc; + + switch (ofw_bus_search_compatible(dev, compat_data)->ocd_data) { + case A10_WATCHDOG: + sc->wdog_ctrl = A10_WDOG_CTRL; + sc->wdog_mode = A10_WDOG_MODE; + sc->wdog_mode_intvl_shift = A10_WDOG_MODE_INTVL_SHIFT; + sc->wdog_mode_en = A10_WDOG_MODE_RST_EN | WDOG_MODE_EN; + break; + case A31_WATCHDOG: + sc->wdog_ctrl = A31_WDOG_CTRL; + sc->wdog_mode = A31_WDOG_MODE; + sc->wdog_mode_intvl_shift = A31_WDOG_MODE_INTVL_SHIFT; + sc->wdog_mode_en = WDOG_MODE_EN; + sc->wdog_config = A31_WDOG_CONFIG; + sc->wdog_config_value = A31_WDOG_CONFIG_RST_EN_SYSTEM; + break; + default: + bus_release_resource(dev, SYS_RES_MEMORY, rid, sc->res); + return (ENXIO); + } + mtx_init(&sc->mtx, "AW Watchdog", "aw_wdog", MTX_DEF); + EVENTHANDLER_REGISTER(watchdog_list, aw_wdog_watchdog_fn, sc, 0); return (0); } static void -a10wd_watchdog_fn(void *private, u_int cmd, int *error) +aw_wdog_watchdog_fn(void *private, u_int cmd, int *error) { - struct a10wd_softc *sc; + struct aw_wdog_softc *sc; uint64_t ms; int i; @@ -144,64 +191,69 @@ a10wd_watchdog_fn(void *private, u_int c if (cmd > 0) { ms = ((uint64_t)1 << (cmd & WD_INTERVAL)) / 1000000; i = 0; - while (wd_intervals[i].milliseconds && + while (wd_intervals[i].milliseconds && (ms > wd_intervals[i].milliseconds)) i++; if (wd_intervals[i].milliseconds) { - WRITE(sc, WDOG_MODE, - (wd_intervals[i].value << WDOG_MODE_INTVL_SHIFT) | - WDOG_MODE_EN | WDOG_MODE_RST_EN); - WRITE(sc, WDOG_CTRL, WDOG_CTRL_RESTART); + WRITE(sc, sc->wdog_mode, + (wd_intervals[i].value << sc->wdog_mode_intvl_shift) | + sc->wdog_mode_en); + WRITE(sc, sc->wdog_ctrl, WDOG_CTRL_RESTART); + if (sc->wdog_config) + WRITE(sc, sc->wdog_config, + sc->wdog_config_value); *error = 0; } else { - /* + /* * Can't arm * disable watchdog as watchdog(9) requires */ device_printf(sc->dev, "Can't arm, timeout is more than 16 sec\n"); mtx_unlock(&sc->mtx); - WRITE(sc, WDOG_MODE, 0); + WRITE(sc, sc->wdog_mode, 0); return; } } else - WRITE(sc, WDOG_MODE, 0); + WRITE(sc, sc->wdog_mode, 0); mtx_unlock(&sc->mtx); } void -a10wd_watchdog_reset() +aw_wdog_watchdog_reset() { - if (a10wd_sc == NULL) { + if (aw_wdog_sc == NULL) { printf("Reset: watchdog device has not been initialized\n"); return; } - WRITE(a10wd_sc, WDOG_MODE, - (wd_intervals[0].value << WDOG_MODE_INTVL_SHIFT) | - WDOG_MODE_EN | WDOG_MODE_RST_EN); - + WRITE(aw_wdog_sc, aw_wdog_sc->wdog_mode, + (wd_intervals[0].value << aw_wdog_sc->wdog_mode_intvl_shift) | + aw_wdog_sc->wdog_mode_en); + if (aw_wdog_sc->wdog_config) + WRITE(aw_wdog_sc, aw_wdog_sc->wdog_config, + aw_wdog_sc->wdog_config_value); while(1) ; } -static device_method_t a10wd_methods[] = { - DEVMETHOD(device_probe, a10wd_probe), - DEVMETHOD(device_attach, a10wd_attach), +static device_method_t aw_wdog_methods[] = { + DEVMETHOD(device_probe, aw_wdog_probe), + DEVMETHOD(device_attach, aw_wdog_attach), DEVMETHOD_END }; -static driver_t a10wd_driver = { - "a10wd", - a10wd_methods, - sizeof(struct a10wd_softc), +static driver_t aw_wdog_driver = { + "aw_wdog", + aw_wdog_methods, + sizeof(struct aw_wdog_softc), }; -static devclass_t a10wd_devclass; +static devclass_t aw_wdog_devclass; -DRIVER_MODULE(a10wd, simplebus, a10wd_driver, a10wd_devclass, 0, 0); +DRIVER_MODULE(aw_wdog, simplebus, aw_wdog_driver, aw_wdog_devclass, 0, 0); Copied and modified: head/sys/arm/allwinner/aw_wdog.h (from r296040, head/sys/arm/allwinner/a10_wdog.h) ============================================================================== --- head/sys/arm/allwinner/a10_wdog.h Thu Feb 25 15:33:55 2016 (r296040, copy source) +++ head/sys/arm/allwinner/aw_wdog.h Thu Feb 25 16:50:36 2016 (r296041) @@ -26,10 +26,10 @@ * $FreeBSD$ * */ -#ifndef __A10_WDOG_H__ -#define __A10_WDOG_H__ +#ifndef __AW_WDOG_H__ +#define __AW_WDOG_H__ -void a10wd_watchdog_reset(void); +void aw_wdog_watchdog_reset(void); -#endif /*__A10_WDOG_H__*/ +#endif /*__AW_WDOG_H__*/ Modified: head/sys/arm/allwinner/files.allwinner ============================================================================== --- head/sys/arm/allwinner/files.allwinner Thu Feb 25 15:33:55 2016 (r296040) +++ head/sys/arm/allwinner/files.allwinner Thu Feb 25 16:50:36 2016 (r296041) @@ -10,7 +10,7 @@ arm/allwinner/a10_ehci.c optional ehci arm/allwinner/a10_gpio.c optional gpio arm/allwinner/a10_mmc.c optional mmc arm/allwinner/a10_sramc.c standard -arm/allwinner/a10_wdog.c standard +arm/allwinner/aw_wdog.c standard arm/allwinner/a20/a20_cpu_cfg.c standard arm/allwinner/allwinner_machdep.c standard arm/allwinner/axp209.c optional axp209 From owner-svn-src-head@freebsd.org Thu Feb 25 17:43:34 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 01140AB3EFC; Thu, 25 Feb 2016 17:43:34 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C4CBD37E; Thu, 25 Feb 2016 17:43:33 +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 u1PHhWFE023798; Thu, 25 Feb 2016 17:43:32 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1PHhW5K023797; Thu, 25 Feb 2016 17:43:32 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201602251743.u1PHhW5K023797@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 25 Feb 2016 17:43:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r296042 - head/usr.bin/kdump X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Feb 2016 17:43:34 -0000 Author: jhb Date: Thu Feb 25 17:43:32 2016 New Revision: 296042 URL: https://svnweb.freebsd.org/changeset/base/296042 Log: Add simple support for CloudABI processes to kdump(1). This does not decode arguments to system calls but should properly decode system call names and error return values. Reviewed by: ed Differential Revision: https://reviews.freebsd.org/D5412 Modified: head/usr.bin/kdump/kdump.c Modified: head/usr.bin/kdump/kdump.c ============================================================================== --- head/usr.bin/kdump/kdump.c Thu Feb 25 16:50:36 2016 (r296041) +++ head/usr.bin/kdump/kdump.c Thu Feb 25 17:43:32 2016 (r296042) @@ -520,6 +520,9 @@ abidump(struct ktr_header *kth) case SV_ABI_FREEBSD: abi = "F"; break; + case SV_ABI_CLOUDABI: + abi = "C"; + break; default: abi = "U"; break; @@ -674,6 +677,10 @@ syscallabi(u_int sv_flags) #endif return (SYSDECODE_ABI_LINUX); #endif +#if defined(__aarch64__) || defined(__amd64__) + case SV_ABI_CLOUDABI: + return (SYSDECODE_ABI_CLOUDABI64); +#endif default: return (SYSDECODE_ABI_UNKNOWN); } From owner-svn-src-head@freebsd.org Thu Feb 25 18:23:44 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 432A7AB4D52; Thu, 25 Feb 2016 18:23:44 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D4AE8282; Thu, 25 Feb 2016 18:23:43 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1PINh8M036740; Thu, 25 Feb 2016 18:23:43 GMT (envelope-from oshogbo@FreeBSD.org) Received: (from oshogbo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1PINe3W036719; Thu, 25 Feb 2016 18:23:41 GMT (envelope-from oshogbo@FreeBSD.org) Message-Id: <201602251823.u1PINe3W036719@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: oshogbo set sender to oshogbo@FreeBSD.org using -f From: Mariusz Zaborski Date: Thu, 25 Feb 2016 18:23:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r296047 - in head: . contrib/mdocml contrib/tcpdump etc/defaults etc/mtree etc/rc.d gnu/usr.bin/groff/tmac lib lib/libc/posix1e lib/libcapsicum lib/libcasper lib/libcasper/libcasper lib... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Feb 2016 18:23:44 -0000 Author: oshogbo Date: Thu Feb 25 18:23:40 2016 New Revision: 296047 URL: https://svnweb.freebsd.org/changeset/base/296047 Log: Convert casperd(8) daemon to the libcasper. After calling the cap_init(3) function Casper will fork from it's original process, using pdfork(2). Forking from a process has a lot of advantages: 1. We have the same cwd as the original process. 2. The same uid, gid and groups. 3. The same MAC labels. 4. The same descriptor table. 5. The same routing table. 6. The same umask. 7. The same cpuset(1). From now services are also in form of libraries. We also removed libcapsicum at all and converts existing program using Casper to new architecture. Discussed with: pjd, jonathan, ed, drysdale@google.com, emaste Partially reviewed by: drysdale@google.com, bdrewery Approved by: pjd (mentor) Differential Revision: https://reviews.freebsd.org/D4277 Added: head/lib/libcasper/libcasper/ head/lib/libcasper/libcasper/Makefile (contents, props changed) head/lib/libcasper/libcasper/libcasper.3 (contents, props changed) head/lib/libcasper/libcasper/libcasper.c (contents, props changed) head/lib/libcasper/libcasper/libcasper.h (contents, props changed) head/lib/libcasper/libcasper/libcasper_impl.c (contents, props changed) head/lib/libcasper/libcasper/libcasper_impl.h (contents, props changed) head/lib/libcasper/libcasper/libcasper_service.c (contents, props changed) head/lib/libcasper/libcasper/libcasper_service.h (contents, props changed) head/lib/libcasper/libcasper/service.c (contents, props changed) head/lib/libcasper/libcasper/zygote.c (contents, props changed) head/lib/libcasper/libcasper/zygote.h (contents, props changed) head/lib/libcasper/services/ head/lib/libcasper/services/Makefile (contents, props changed) head/lib/libcasper/services/cap_dns/ head/lib/libcasper/services/cap_dns/Makefile (contents, props changed) head/lib/libcasper/services/cap_dns/cap_dns.c (contents, props changed) head/lib/libcasper/services/cap_dns/cap_dns.h (contents, props changed) head/lib/libcasper/services/cap_grp/ head/lib/libcasper/services/cap_grp/Makefile (contents, props changed) head/lib/libcasper/services/cap_grp/cap_grp.c (contents, props changed) head/lib/libcasper/services/cap_grp/cap_grp.h (contents, props changed) head/lib/libcasper/services/cap_pwd/ head/lib/libcasper/services/cap_pwd/Makefile (contents, props changed) head/lib/libcasper/services/cap_pwd/cap_pwd.c (contents, props changed) head/lib/libcasper/services/cap_pwd/cap_pwd.h (contents, props changed) head/lib/libcasper/services/cap_random/ head/lib/libcasper/services/cap_random/Makefile (contents, props changed) head/lib/libcasper/services/cap_random/cap_random.c (contents, props changed) head/lib/libcasper/services/cap_random/cap_random.h (contents, props changed) head/lib/libcasper/services/cap_sysctl/ head/lib/libcasper/services/cap_sysctl/Makefile (contents, props changed) head/lib/libcasper/services/cap_sysctl/cap_sysctl.c (contents, props changed) head/lib/libcasper/services/cap_sysctl/cap_sysctl.h (contents, props changed) head/tools/regression/capsicum/libcasper/ head/tools/regression/capsicum/libcasper/Makefile (contents, props changed) head/tools/regression/capsicum/libcasper/dns.c (contents, props changed) head/tools/regression/capsicum/libcasper/grp.c (contents, props changed) head/tools/regression/capsicum/libcasper/pwd.c (contents, props changed) head/tools/regression/capsicum/libcasper/sysctl.c (contents, props changed) Deleted: head/etc/rc.d/casperd head/lib/libcapsicum/ head/lib/libcasper/libcasper.c head/lib/libcasper/libcasper.h head/lib/libcasper/libcasper_impl.h head/libexec/casper/Makefile head/libexec/casper/dns/Makefile head/libexec/casper/dns/dns.c head/libexec/casper/grp/Makefile head/libexec/casper/grp/grp.c head/libexec/casper/pwd/Makefile head/libexec/casper/pwd/pwd.c head/libexec/casper/random/Makefile head/libexec/casper/random/random.c head/libexec/casper/sysctl/Makefile head/libexec/casper/sysctl/sysctl.c head/sbin/casperd/Makefile head/sbin/casperd/casperd.8 head/sbin/casperd/casperd.c head/sbin/casperd/zygote.c head/sbin/casperd/zygote.h head/tools/regression/capsicum/libcapsicum/ Modified: head/Makefile.inc1 head/ObsoleteFiles.inc head/contrib/mdocml/lib.in head/contrib/tcpdump/addrtoname.c head/contrib/tcpdump/config.h.in head/contrib/tcpdump/configure head/contrib/tcpdump/configure.in head/contrib/tcpdump/tcpdump.c head/etc/defaults/rc.conf head/etc/mtree/BSD.debug.dist head/etc/mtree/BSD.include.dist head/etc/mtree/BSD.root.dist head/etc/rc.d/Makefile head/gnu/usr.bin/groff/tmac/mdoc.local.in head/lib/Makefile head/lib/libc/posix1e/posix1e.3 head/lib/libcasper/Makefile head/libexec/Makefile head/libexec/rtld-elf/paths.h head/sbin/Makefile head/sbin/ping/Makefile head/sbin/ping/Makefile.depend head/sbin/ping/ping.c head/share/man/man4/capsicum.4 head/share/mk/bsd.libnames.mk head/share/mk/src.libnames.mk head/targets/pseudo/userland/Makefile.depend head/targets/pseudo/userland/lib/Makefile.depend head/targets/pseudo/userland/libexec/Makefile.depend head/usr.bin/kdump/Makefile head/usr.bin/kdump/kdump.c head/usr.sbin/tcpdump/tcpdump/Makefile head/usr.sbin/tcpdump/tcpdump/config.h Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Thu Feb 25 18:20:54 2016 (r296046) +++ head/Makefile.inc1 Thu Feb 25 18:23:40 2016 (r296047) @@ -585,7 +585,7 @@ _worldtmp: .PHONY rm -f ${OBJTREE}${.CURDIR}/usr.bin/kdump/kdump_subr.c .endif .for _dir in \ - lib usr legacy/bin legacy/usr + lib lib/casper usr legacy/bin legacy/usr mkdir -p ${WORLDTMP}/${_dir} .endfor mtree -deU -f ${.CURDIR}/etc/mtree/BSD.usr.dist \ @@ -1870,7 +1870,7 @@ _prebuild_libs= ${_kerberos5_lib_libasn1 lib/libfigpar \ ${_lib_libgssapi} \ lib/libkiconv lib/libkvm lib/liblzma lib/libmd lib/libnv \ - ${_lib_libcapsicum} \ + ${_lib_casper} \ lib/ncurses/ncurses lib/ncurses/ncursesw \ lib/libopie lib/libpam ${_lib_libthr} \ ${_lib_libradius} lib/libsbuf lib/libtacplus \ @@ -1910,11 +1910,11 @@ _ofed_lib= contrib/ofed/usr.lib/ .endif .if ${MK_CASPER} != "no" -_lib_libcapsicum=lib/libcapsicum +_lib_casper= lib/libcasper .endif -lib/libcapsicum__L: lib/libnv__L lib/libpjdlog__L: lib/libutil__L +lib/libcasper__L: lib/libnv__L lib/liblzma__L: lib/libthr__L _generic_libs= ${_cddl_lib} gnu/lib ${_kerberos5_lib} lib ${_secure_lib} usr.bin/lex/lib ${_ofed_lib} Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Thu Feb 25 18:20:54 2016 (r296046) +++ head/ObsoleteFiles.inc Thu Feb 25 18:23:40 2016 (r296047) @@ -38,6 +38,25 @@ # xargs -n1 | sort | uniq -d; # done +# 20160225: Remove casperd and libcapsicum. +OLD_FILES+=sbin/casperd +OLD_FILES+=etc/rc.d/casperd +OLD_FILES+=usr/share/man/man8/casperd.8.gz +OLD_FILES+=usr/include/libcapsicum.h +OLD_FILES+=usr/include/libcapsicum_service.h +OLD_FILES+=usr/include/libcapsicum.h +OLD_FILES+=usr/share/man/man3/libcapsicum.3.gz +OLD_FILES+=usr/include/libcapsicum_dns.h +OLD_FILES+=usr/include/libcapsicum_grp.h +OLD_FILES+=usr/include/libcapsicum_impl.h +OLD_FILES+=usr/include/libcapsicum_pwd.h +OLD_FILES+=usr/include/libcapsicum_random.h +OLD_FILES+=usr/include/libcapsicum_sysctl.h +OLD_FILES+=libexec/casper/dns +OLD_FILES+=libexec/casper/grp +OLD_FILES+=libexec/casper/pwd +OLD_FILES+=libexec/casper/random +OLD_FILES+=libexec/casper/sysctl # 20160223: functionality from mkulzma(1) merged into mkuzip(1) OLD_FILES+=usr/bin/mkulzma # 20160211: Remove obsolete unbound-control-setup Modified: head/contrib/mdocml/lib.in ============================================================================== --- head/contrib/mdocml/lib.in Thu Feb 25 18:20:54 2016 (r296046) +++ head/contrib/mdocml/lib.in Thu Feb 25 18:23:40 2016 (r296047) @@ -34,7 +34,7 @@ LINE("libc", "Standard C\\~Library (lib LINE("libc_r", "Reentrant C\\~Library (libc_r, \\-lc_r)") LINE("libcalendar", "Calendar Arithmetic Library (libcalendar, \\-lcalendar)") LINE("libcam", "Common Access Method User Library (libcam, \\-lcam)") -LINE("libcapsicum", "Capsicum Library (libcapsicum, \\-lcapsicum)") +LINE("libcasper", "Casper Library (libcasper, \\-lcapser)") LINE("libcdk", "Curses Development Kit Library (libcdk, \\-lcdk)") LINE("libcipher", "FreeSec Crypt Library (libcipher, \\-lcipher)") LINE("libcompat", "Compatibility Library (libcompat, \\-lcompat)") Modified: head/contrib/tcpdump/addrtoname.c ============================================================================== --- head/contrib/tcpdump/addrtoname.c Thu Feb 25 18:20:54 2016 (r296046) +++ head/contrib/tcpdump/addrtoname.c Thu Feb 25 18:23:40 2016 (r296047) @@ -29,10 +29,10 @@ #include "config.h" #endif -#ifdef HAVE_CAPSICUM -#include -#include -#endif /* HAVE_CAPSICUM */ +#ifdef HAVE_CAPSPER +#include +#include +#endif /* HAVE_CAPSPER */ #include #ifdef USE_ETHER_NTOHOST @@ -204,7 +204,7 @@ intoa(uint32_t addr) static uint32_t f_netmask; static uint32_t f_localnet; -#ifdef HAVE_CAPSICUM +#ifdef HAVE_CAPSPER extern cap_channel_t *capdns; #endif @@ -252,7 +252,7 @@ getname(netdissect_options *ndo, const u */ if (!ndo->ndo_nflag && (addr & f_netmask) == f_localnet) { -#ifdef HAVE_CAPSICUM +#ifdef HAVE_CAPSPER if (capdns != NULL) { hp = cap_gethostbyaddr(capdns, (char *)&addr, 4, AF_INET); @@ -309,7 +309,7 @@ getname6(netdissect_options *ndo, const * Do not print names if -n was given. */ if (!ndo->ndo_nflag) { -#ifdef HAVE_CAPSICUM +#ifdef HAVE_CAPSPER if (capdns != NULL) { hp = cap_gethostbyaddr(capdns, (char *)&addr, sizeof(addr), AF_INET6); Modified: head/contrib/tcpdump/config.h.in ============================================================================== --- head/contrib/tcpdump/config.h.in Thu Feb 25 18:20:54 2016 (r296046) +++ head/contrib/tcpdump/config.h.in Thu Feb 25 18:23:40 2016 (r296047) @@ -10,7 +10,7 @@ #undef HAVE_BPF_DUMP /* capsicum support available */ -#undef HAVE_CAPSICUM +#undef HAVE_CAPSPER /* Define to 1 if you have the `cap_enter' function. */ #undef HAVE_CAP_ENTER Modified: head/contrib/tcpdump/configure ============================================================================== --- head/contrib/tcpdump/configure Thu Feb 25 18:20:54 2016 (r296046) +++ head/contrib/tcpdump/configure Thu Feb 25 18:23:40 2016 (r296047) @@ -4566,7 +4566,7 @@ fi $as_echo_n "checking whether to sandbox using capsicum... " >&6; } if test "x$ac_lbl_capsicum_function_seen" = "xyes" -a "x$ac_lbl_capsicum_function_not_seen" != "xyes"; then -$as_echo "#define HAVE_CAPSICUM 1" >>confdefs.h +$as_echo "#define HAVE_CAPSPER 1" >>confdefs.h { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } Modified: head/contrib/tcpdump/configure.in ============================================================================== --- head/contrib/tcpdump/configure.in Thu Feb 25 18:20:54 2016 (r296046) +++ head/contrib/tcpdump/configure.in Thu Feb 25 18:23:40 2016 (r296047) @@ -222,7 +222,7 @@ if test ! -z "$with_sandbox-capsicum" && fi AC_MSG_CHECKING([whether to sandbox using capsicum]) if test "x$ac_lbl_capsicum_function_seen" = "xyes" -a "x$ac_lbl_capsicum_function_not_seen" != "xyes"; then - AC_DEFINE(HAVE_CAPSICUM, 1, [capsicum support available]) + AC_DEFINE(HAVE_CASPER, 1, [casper support available]) AC_MSG_RESULT(yes) else AC_MSG_RESULT(no) Modified: head/contrib/tcpdump/tcpdump.c ============================================================================== --- head/contrib/tcpdump/tcpdump.c Thu Feb 25 18:20:54 2016 (r296046) +++ head/contrib/tcpdump/tcpdump.c Thu Feb 25 18:23:40 2016 (r296047) @@ -87,17 +87,16 @@ extern int SIZE_BUF; #include #include #endif /* __FreeBSD__ */ -#ifdef HAVE_CAPSICUM -#include -#include -#include +#ifdef HAVE_CAPSPER +#include +#include #include #include #include #include #include #include -#endif /* HAVE_CAPSICUM */ +#endif /* HAVE_CAPSPER */ #include #include #include @@ -161,7 +160,7 @@ static int infoprint; char *program_name; -#ifdef HAVE_CAPSICUM +#ifdef HAVE_CAPSPER cap_channel_t *capdns; #endif @@ -485,7 +484,7 @@ struct dump_info { char *CurrentFileName; pcap_t *pd; pcap_dumper_t *p; -#ifdef HAVE_CAPSICUM +#ifdef HAVE_CAPSPER int dirfd; #endif }; @@ -909,7 +908,7 @@ get_next_file(FILE *VFile, char *ptr) return ret; } -#ifdef HAVE_CAPSICUM +#ifdef HAVE_CAPSPER static cap_channel_t * capdns_setup(void) { @@ -918,10 +917,8 @@ capdns_setup(void) int families[2]; capcas = cap_init(); - if (capcas == NULL) { - warning("unable to contact casperd"); - return (NULL); - } + if (capcas == NULL) + error("unable to create casper process"); capdnsloc = cap_service_open(capcas, "system.dns"); /* Casper capability no longer needed. */ cap_close(capcas); @@ -938,7 +935,7 @@ capdns_setup(void) return (capdnsloc); } -#endif /* HAVE_CAPSICUM */ +#endif /* HAVE_CAPSPER */ #ifdef HAVE_PCAP_SET_TSTAMP_PRECISION static int @@ -970,7 +967,7 @@ tstamp_precision_to_string(int precision } #endif -#ifdef HAVE_CAPSICUM +#ifdef HAVE_CAPSPER /* * Ensure that, on a dump file's descriptor, we have all the rights * necessary to make the standard I/O library work with an fdopen()ed @@ -1070,9 +1067,9 @@ main(int argc, char **argv) #endif int status; FILE *VFile; -#ifdef HAVE_CAPSICUM +#ifdef HAVE_CAPSPER cap_rights_t rights; -#endif /* HAVE_CAPSICUM */ +#endif /* HAVE_CAPSPER */ int cansandbox; #ifdef WIN32 @@ -1613,7 +1610,7 @@ main(int argc, char **argv) if (pd == NULL) error("%s", ebuf); -#ifdef HAVE_CAPSICUM +#ifdef HAVE_CAPSPER cap_rights_init(&rights, CAP_READ); if (cap_rights_limit(fileno(pcap_file(pd)), &rights) < 0 && errno != ENOSYS) { @@ -1850,10 +1847,10 @@ main(int argc, char **argv) exit(0); } -#ifdef HAVE_CAPSICUM +#ifdef HAVE_CAPSPER if (!nflag) capdns = capdns_setup(); -#endif /* HAVE_CAPSICUM */ +#endif /* HAVE_CAPSPER */ init_addrtoname(gndo, localnet, netmask); init_checksum(); @@ -1921,7 +1918,7 @@ main(int argc, char **argv) if (pcap_setfilter(pd, &fcode) < 0) error("%s", pcap_geterr(pd)); -#ifdef HAVE_CAPSICUM +#ifdef HAVE_CAPSPER if (RFileName == NULL && VFileName == NULL) { static const unsigned long cmds[] = { BIOCGSTATS }; @@ -1971,11 +1968,11 @@ main(int argc, char **argv) #endif /* HAVE_LIBCAP_NG */ if (p == NULL) error("%s", pcap_geterr(pd)); -#ifdef HAVE_CAPSICUM +#ifdef HAVE_CAPSPER set_dumper_capsicum_rights(p); #endif if (Cflag != 0 || Gflag != 0) { -#ifdef HAVE_CAPSICUM +#ifdef HAVE_CAPSPER dumpinfo.WFileName = strdup(basename(WFileName)); dumpinfo.dirfd = open(dirname(WFileName), O_DIRECTORY | O_RDONLY); @@ -1993,7 +1990,7 @@ main(int argc, char **argv) errno != ENOSYS) { error("unable to limit dump descriptor fcntls"); } -#else /* !HAVE_CAPSICUM */ +#else /* !HAVE_CAPSPER */ dumpinfo.WFileName = WFileName; #endif callback = dump_packet_and_trunc; @@ -2069,7 +2066,7 @@ main(int argc, char **argv) #ifdef __FreeBSD__ cansandbox = (VFileName == NULL && zflag == NULL); -#ifdef HAVE_CAPSICUM +#ifdef HAVE_CAPSPER cansandbox = (cansandbox && (nflag || capdns != NULL)); #else cansandbox = (cansandbox && nflag); @@ -2125,7 +2122,7 @@ main(int argc, char **argv) pd = pcap_open_offline(RFileName, ebuf); if (pd == NULL) error("%s", ebuf); -#ifdef HAVE_CAPSICUM +#ifdef HAVE_CAPSPER cap_rights_init(&rights, CAP_READ); if (cap_rights_limit(fileno(pcap_file(pd)), &rights) < 0 && errno != ENOSYS) { @@ -2328,7 +2325,7 @@ dump_packet_and_trunc(u_char *user, cons /* If the time is greater than the specified window, rotate */ if (t - Gflag_time >= Gflag) { -#ifdef HAVE_CAPSICUM +#ifdef HAVE_CAPSPER FILE *fp; int fd; #endif @@ -2386,7 +2383,7 @@ dump_packet_and_trunc(u_char *user, cons capng_update(CAPNG_ADD, CAPNG_EFFECTIVE, CAP_DAC_OVERRIDE); capng_apply(CAPNG_SELECT_BOTH); #endif /* HAVE_LIBCAP_NG */ -#ifdef HAVE_CAPSICUM +#ifdef HAVE_CAPSPER fd = openat(dump_info->dirfd, dump_info->CurrentFileName, O_CREAT | O_WRONLY | O_TRUNC, 0644); @@ -2400,7 +2397,7 @@ dump_packet_and_trunc(u_char *user, cons dump_info->CurrentFileName); } dump_info->p = pcap_dump_fopen(dump_info->pd, fp); -#else /* !HAVE_CAPSICUM */ +#else /* !HAVE_CAPSPER */ dump_info->p = pcap_dump_open(dump_info->pd, dump_info->CurrentFileName); #endif #ifdef HAVE_LIBCAP_NG @@ -2409,7 +2406,7 @@ dump_packet_and_trunc(u_char *user, cons #endif /* HAVE_LIBCAP_NG */ if (dump_info->p == NULL) error("%s", pcap_geterr(pd)); -#ifdef HAVE_CAPSICUM +#ifdef HAVE_CAPSPER set_dumper_capsicum_rights(dump_info->p); #endif } @@ -2426,7 +2423,7 @@ dump_packet_and_trunc(u_char *user, cons if (size == -1) error("ftell fails on output file"); if (size > Cflag) { -#ifdef HAVE_CAPSICUM +#ifdef HAVE_CAPSPER FILE *fp; int fd; #endif @@ -2458,7 +2455,7 @@ dump_packet_and_trunc(u_char *user, cons capng_update(CAPNG_ADD, CAPNG_EFFECTIVE, CAP_DAC_OVERRIDE); capng_apply(CAPNG_SELECT_BOTH); #endif /* HAVE_LIBCAP_NG */ -#ifdef HAVE_CAPSICUM +#ifdef HAVE_CAPSPER fd = openat(dump_info->dirfd, dump_info->CurrentFileName, O_CREAT | O_WRONLY | O_TRUNC, 0644); if (fd < 0) { @@ -2471,7 +2468,7 @@ dump_packet_and_trunc(u_char *user, cons dump_info->CurrentFileName); } dump_info->p = pcap_dump_fopen(dump_info->pd, fp); -#else /* !HAVE_CAPSICUM */ +#else /* !HAVE_CAPSPER */ dump_info->p = pcap_dump_open(dump_info->pd, dump_info->CurrentFileName); #endif #ifdef HAVE_LIBCAP_NG @@ -2480,7 +2477,7 @@ dump_packet_and_trunc(u_char *user, cons #endif /* HAVE_LIBCAP_NG */ if (dump_info->p == NULL) error("%s", pcap_geterr(pd)); -#ifdef HAVE_CAPSICUM +#ifdef HAVE_CAPSPER set_dumper_capsicum_rights(dump_info->p); #endif } Modified: head/etc/defaults/rc.conf ============================================================================== --- head/etc/defaults/rc.conf Thu Feb 25 18:20:54 2016 (r296046) +++ head/etc/defaults/rc.conf Thu Feb 25 18:23:40 2016 (r296047) @@ -681,7 +681,6 @@ newsyslog_enable="YES" # Run newsyslog a newsyslog_flags="-CN" # Newsyslog flags to create marked files mixer_enable="YES" # Run the sound mixer. opensm_enable="NO" # Opensm(8) for infiniband devices defaults to off -casperd_enable="YES" # casperd(8) daemon # rctl(8) requires kernel options RACCT and RCTL rctl_enable="YES" # Load rctl(8) rules on boot Modified: head/etc/mtree/BSD.debug.dist ============================================================================== --- head/etc/mtree/BSD.debug.dist Thu Feb 25 18:20:54 2016 (r296046) +++ head/etc/mtree/BSD.debug.dist Thu Feb 25 18:23:40 2016 (r296047) @@ -15,8 +15,6 @@ lib geom .. - .. - libexec casper .. .. Modified: head/etc/mtree/BSD.include.dist ============================================================================== --- head/etc/mtree/BSD.include.dist Thu Feb 25 18:20:54 2016 (r296046) +++ head/etc/mtree/BSD.include.dist Thu Feb 25 18:23:40 2016 (r296047) @@ -93,6 +93,8 @@ scsi .. .. + casper + .. crypto .. dev Modified: head/etc/mtree/BSD.root.dist ============================================================================== --- head/etc/mtree/BSD.root.dist Thu Feb 25 18:20:54 2016 (r296046) +++ head/etc/mtree/BSD.root.dist Thu Feb 25 18:23:40 2016 (r296047) @@ -80,12 +80,12 @@ .. .. lib + casper + .. geom .. .. libexec - casper - .. resolvconf .. .. Modified: head/etc/rc.d/Makefile ============================================================================== --- head/etc/rc.d/Makefile Thu Feb 25 18:20:54 2016 (r296046) +++ head/etc/rc.d/Makefile Thu Feb 25 18:23:40 2016 (r296047) @@ -21,7 +21,6 @@ FILES= DAEMON \ ${_bluetooth} \ bridge \ ${_bthidd} \ - ${_casperd} \ cleanvar \ cleartmp \ cron \ @@ -176,10 +175,6 @@ FILES+= bootparams FILES+= bsnmpd .endif -.if ${MK_CASPER} != "no" -_casperd= casperd -.endif - .if ${MK_CCD} != "no" FILES+= ccd .endif Modified: head/gnu/usr.bin/groff/tmac/mdoc.local.in ============================================================================== --- head/gnu/usr.bin/groff/tmac/mdoc.local.in Thu Feb 25 18:20:54 2016 (r296046) +++ head/gnu/usr.bin/groff/tmac/mdoc.local.in Thu Feb 25 18:23:40 2016 (r296047) @@ -34,7 +34,7 @@ .\" FreeBSD .Lb values .ds doc-str-Lb-libarchive Streaming Archive Library (libarchive, \-larchive) .ds doc-str-Lb-libbluetooth Bluetooth User Library (libbluetooth, \-lbluetooth) -.ds doc-str-Lb-libcapsicum Capsicum Library (libcapsicum, \-lcapsicum) +.ds doc-str-Lb-libcseper Casper Library (libcapsicum, \-lcasper) .ds doc-str-Lb-libcuse Userland Character Device Library (libcuse, \-lcuse) .ds doc-str-Lb-libedit Line Editor and History Library (libedit, \-ledit) .ds doc-str-Lb-libefi EFI Runtime Services Library (libefi, \-lefi) Modified: head/lib/Makefile ============================================================================== --- head/lib/Makefile Thu Feb 25 18:20:54 2016 (r296046) +++ head/lib/Makefile Thu Feb 25 18:23:40 2016 (r296047) @@ -36,7 +36,6 @@ SUBDIR= ${SUBDIR_ORDERED} \ libbz2 \ libcalendar \ libcam \ - ${_libcapsicum} \ ${_libcasper} \ ${_libcom_err} \ libcompat \ @@ -135,8 +134,7 @@ SUBDIR_DEPEND_libbsnmp= ${_libnetgraph} SUBDIR_DEPEND_libc++:= libcxxrt SUBDIR_DEPEND_libc= libcompiler_rt SUBDIR_DEPEND_libcam= libsbuf -SUBDIR_DEPEND_libcapsicum= libnv -SUBDIR_DEPEND_libcasper= libcapsicum libnv libpjdlog +SUBDIR_DEPEND_libcasper= libnv SUBDIR_DEPEND_libdevstat= libkvm SUBDIR_DEPEND_libdpv= libfigpar ncurses libutil SUBDIR_DEPEND_libedit= ncurses @@ -171,7 +169,6 @@ _libbsnmp= libbsnmp .endif .if ${MK_CASPER} != "no" -_libcapsicum= libcapsicum _libcasper= libcasper .endif Modified: head/lib/libc/posix1e/posix1e.3 ============================================================================== --- head/lib/libc/posix1e/posix1e.3 Thu Feb 25 18:20:54 2016 (r296046) +++ head/lib/libc/posix1e/posix1e.3 Thu Feb 25 18:23:40 2016 (r296047) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 15, 2014 +.Dd February 25, 2016 .Dt POSIX1E 3 .Os .Sh NAME @@ -94,7 +94,7 @@ for mandatory access control labels. .Xr acl 3 , .Xr extattr 3 , .Xr libbsm 3 , -.Xr libcapsicum 3 , +.Xr libcasper 3 , .Xr mac 3 , .Xr capsicum 4 , .Xr ffs 7 , Modified: head/lib/libcasper/Makefile ============================================================================== --- head/lib/libcasper/Makefile Thu Feb 25 18:20:54 2016 (r296046) +++ head/lib/libcasper/Makefile Thu Feb 25 18:23:40 2016 (r296047) @@ -1,19 +1,6 @@ # $FreeBSD$ -LIB= casper +SUBDIR= libcasper +SUBDIR+= services -SHLIB_MAJOR= 0 -SHLIBDIR?= /lib - -SRCS= libcasper.c -INCS= libcasper.h - -LIBADD= capsicum nv pjdlog - -CFLAGS+=-I${.CURDIR} -CFLAGS+=-I${.CURDIR}/../libpjdlog -CFLAGS+=-I${.CURDIR}/../../sbin/casper - -WARNS?= 6 - -.include +.include Added: head/lib/libcasper/libcasper/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libcasper/libcasper/Makefile Thu Feb 25 18:23:40 2016 (r296047) @@ -0,0 +1,38 @@ +# $FreeBSD$ + +LIB= casper + +SHLIB_MAJOR= 0 +SHLIBDIR?= /lib + +SRCS= libcasper.c +SRCS+= libcasper_impl.c +SRCS+= libcasper_service.c +SRCS+= service.c +SRCS+= zygote.c + +INCS= libcasper.h +INCS+= libcasper_service.h + +LIBADD= nv + +CFLAGS+=-I${.CURDIR} + +WARNS?= 6 + +MAN+= libcasper.3 + +MLINKS+=libcasper.3 cap_init.3 +MLINKS+=libcasper.3 cap_wrap.3 +MLINKS+=libcasper.3 cap_unwrap.3 +MLINKS+=libcasper.3 cap_sock.3 +MLINKS+=libcasper.3 cap_clone.3 +MLINKS+=libcasper.3 cap_close.3 +MLINKS+=libcasper.3 cap_limit_get.3 +MLINKS+=libcasper.3 cap_limit_set.3 +MLINKS+=libcasper.3 cap_send_nvlist.3 +MLINKS+=libcasper.3 cap_recv_nvlist.3 +MLINKS+=libcasper.3 cap_xfer_nvlist.3 +MLINKS+=libcasper.3 cap_service_open.3 + +.include Added: head/lib/libcasper/libcasper/libcasper.3 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libcasper/libcasper/libcasper.3 Thu Feb 25 18:23:40 2016 (r296047) @@ -0,0 +1,295 @@ +.\" Copyright (c) 2013 The FreeBSD Foundation +.\" All rights reserved. +.\" +.\" This documentation was written by Pawel Jakub Dawidek 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 AUTHORS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd February 25, 2016 +.Dt LIBCASPER 3 +.Os +.Sh NAME +.Nm cap_init , +.Nm cap_wrap , +.Nm cap_unwrap , +.Nm cap_sock , +.Nm cap_clone , +.Nm cap_close , +.Nm cap_limit_get , +.Nm cap_limit_set , +.Nm cap_send_nvlist , +.Nm cap_recv_nvlist , +.Nm cap_xfer_nvlist , +.Nm cap_service_open +.Nd "library for handling application capabilities" +.Sh LIBRARY +.Lb libcasper +.Sh SYNOPSIS +.In libcasper.h +.In nv.h +.Ft "cap_channel_t *" +.Fn cap_init "void" +.Ft "cap_channel_t *" +.Fn cap_wrap "int sock" +.Ft "int" +.Fn cap_unwrap "cap_channel_t *chan" +.Ft "int" +.Fn cap_sock "const cap_channel_t *chan" +.Ft "cap_channel_t *" +.Fn cap_clone "const cap_channel_t *chan" +.Ft "void" +.Fn cap_close "cap_channel_t *chan" +.Ft "int" +.Fn cap_limit_get "const cap_channel_t *chan" "nvlist_t **limitsp" +.Ft "int" +.Fn cap_limit_set "const cap_channel_t *chan" "nvlist_t *limits" +.Ft "int" +.Fn cap_send_nvlist "const cap_channel_t *chan" "const nvlist_t *nvl" +.Ft "nvlist_t *" +.Fn cap_recv_nvlist "const cap_channel_t *chan" "int flags" +.Ft "nvlist_t *" +.Fn cap_xfer_nvlist "const cap_channel_t *chan" "nvlist_t *nvl" "int flags" +.Ft "cap_channel_t *" +.Fn cap_service_open "const cap_channel_t *chan" "const char *name" +.Sh DESCRIPTION +The +.Nm libcapsicum +library allows to manage application capabilities through the casper process. +.Pp +The application capability (represented by the +.Vt cap_channel_t +type) is a communication channel between the caller and the casper process +daemon or an instance of one of its services. +A capability to the casper process obtained with the +.Fn cap_init +function allows to create capabilities to casper's services via the +.Fn cap_service_open +function. +.Pp +The +.Fn cap_init +function opens capability to the casper process. +.Pp +The +.Fn cap_wrap +function creates +.Vt cap_channel_t +based on the given socket. +The function is used when capability is inherited through +.Xr execve 2 +or send over +.Xr unix 4 +domain socket as a regular file descriptor and has to be represented as +.Vt cap_channel_t +again. +.Pp +The +.Fn cap_unwrap +function is the opposite of the +.Fn cap_wrap +function. +It frees the +.Vt cap_channel_t +structure and returns +.Xr unix 4 +domain socket associated with it. +.Pp +The +.Fn cap_clone +function clones the given capability. +.Pp +The +.Fn cap_close +function closes the given capability. +.Pp +The +.Fn cap_sock +function returns +.Xr unix 4 +domain socket descriptor associated with the given capability for use with +system calls like +.Xr kevent 2 , +.Xr poll 2 +and +.Xr select 2 . +.Pp +The +.Fn cap_limit_get +function stores current limits of the given capability in the +.Fa limitsp +argument. +If the function return +.Va 0 +and +.Dv NULL +is stored in +.Fa limitsp +it means there are no limits set. +.Pp +The +.Fn cap_limit_set +function sets limits for the given capability. +The limits are provided as nvlist. +The exact format depends on the service the capability represents. +.Pp +The +.Fn cap_send_nvlist +function sends the given nvlist over the given capability. +This is low level interface to communicate with casper services. +Most services should provide higher level API. +.Pp +The +.Fn cap_recv_nvlist +function receives the given nvlist over the given capability. +The +.Fa flags +argument defines what type the top nvlist is expected to be. +If the nvlist flags do not match the flags passed to +.Fn cap_recv_nvlist , +the nvlist will not be returned. +.Pp +The +.Fn cap_xfer_nvlist +function sends the given nvlist, destroys it and receives new nvlist in +response over the given capability. +The +.Fa flags +argument defines what type the top nvlist is expected to be. +If the nvlist flags do not match the flags passed to +.Fn cap_xfer_nvlist , +the nvlist will not be returned. +It does not matter if the function succeeds or fails, the nvlist given +for sending will always be destroyed once the function returns. +.Pp +The +.Fn cap_service_open +function opens casper service of the given name through casper capability +obtained via the +.Fn cap_init +function. +The function returns capability that provides access to opened service. +.Sh RETURN VALUES +The +.Fn cap_clone , +.Fn cap_init , +.Fn cap_recv_nvlist , +.Fn cap_service_open , +.Fn cap_wrap +and +.Fn cap_xfer_nvlist +functions return +.Dv NULL +and set the +.Va errno +variable on failure. +.Pp +The +.Fn cap_limit_get , +.Fn cap_limit_set +and +.Fn cap_send_nvlist +functions return +.Dv -1 +and set the +.Va errno +variable on failure. +.Pp +The +.Fn cap_close , +.Fn cap_sock +and +.Fn cap_unwrap +functions always succeed. +.Sh EXAMPLES +The following example first opens capability to the casper then using this +capability creates new capability to the +.Nm system.dns +casper service and uses the latter capability to resolve IP address. +.Bd -literal +cap_channel_t *capcas, *capdns; +nvlist_t *limits; +const char *ipstr = "127.0.0.1"; +struct in_addr ip; +struct hostent *hp; + +/* Open capability to the Casper. */ +capcas = cap_init(); +if (capcas == NULL) + err(1, "Unable to contact Casper"); + +/* Enter capability mode sandbox. */ +if (cap_enter() < 0 && errno != ENOSYS) + err(1, "Unable to enter capability mode"); + +/* Use Casper capability to create capability to the system.dns service. */ +capdns = cap_service_open(capcas, "system.dns"); +if (capdns == NULL) + err(1, "Unable to open system.dns service"); + +/* Close Casper capability, we don't need it anymore. */ +cap_close(capcas); + +/* Limit system.dns to reverse DNS lookups and IPv4 addresses. */ +limits = nvlist_create(0); +nvlist_add_string(limits, "type", "ADDR"); +nvlist_add_number(limits, "family", (uint64_t)AF_INET); +if (cap_limit_set(capdns, limits) < 0) + err(1, "Unable to limit access to the system.dns service"); + +/* Convert IP address in C-string to in_addr. */ +if (!inet_aton(ipstr, &ip)) + errx(1, "Unable to parse IP address %s.", ipstr); + +/* Find hostname for the given IP address. */ +hp = cap_gethostbyaddr(capdns, (const void *)&ip, sizeof(ip), AF_INET); +if (hp == NULL) + errx(1, "No name associated with %s.", ipstr); + +printf("Name associated with %s is %s.\\n", ipstr, hp->h_name); +.Ed +.Sh SEE ALSO +.Xr cap_enter 2 , +.Xr execve 2 , +.Xr kevent 2 , +.Xr poll 2 , +.Xr select 2 , +.Xr cap_gethostbyaddr 3 , +.Xr err 3 , +.Xr gethostbyaddr 3 , +.Xr inet_aton 3 , +.Xr nv 3 , +.Xr capsicum 4 , +.Xr unix 4 +.Sh AUTHORS +The +.Nm libcasper +library was implemented by +.An Pawel Jakub Dawidek Aq Mt pawel@dawidek.net +under sponsorship from the FreeBSD Foundation. +The +.Nm libcasper +new architecture was implemented by +.An Mariusz Zaborski Aq Mt oshogbo@FreeBSD.org +. Added: head/lib/libcasper/libcasper/libcasper.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libcasper/libcasper/libcasper.c Thu Feb 25 18:23:40 2016 (r296047) @@ -0,0 +1,337 @@ +/*- + * Copyright (c) 2012-2013 The FreeBSD Foundation + * Copyright (c) 2015 Mariusz Zaborski + * All rights reserved. + * + * This software was developed by Pawel Jakub Dawidek 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 AUTHORS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +#include "libcasper.h" +#include "libcasper_impl.h" + +/* + * Structure describing communication channel between two separated processes. + */ +#define CAP_CHANNEL_MAGIC 0xcac8a31 +struct cap_channel { + /* + * Magic value helps to ensure that a pointer to the right structure is + * passed to our functions. + */ + int cch_magic; + /* Socket descriptor for IPC. */ + int cch_sock; + /* Process descriptor for casper. */ + int cch_pd; +}; + +static bool +cap_add_pd(cap_channel_t *chan, int pd) +{ + + if (!fd_is_valid(pd)) + return (false); + chan->cch_pd = pd; + return (true); +} + +cap_channel_t * +cap_init(void) +{ + pid_t pid; + int sock[2], serrno, pfd; + bool ret; + cap_channel_t *chan; + + if (socketpair(PF_UNIX, SOCK_STREAM | SOCK_NONBLOCK, 0, + sock) == -1) { + return (NULL); + } + + pid = pdfork(&pfd, 0); + if (pid == 0) { + /* Parent. */ + close(sock[0]); + casper_main_loop(sock[1]); + /* NOTREACHED. */ + } else if (pid > 0) { + /* Child. */ + close(sock[1]); + chan = cap_wrap(sock[0]); + if (chan == NULL) { + serrno = errno; + close(sock[0]); + close(pfd); + errno = serrno; + return (NULL); + } + ret = cap_add_pd(chan, pfd); + assert(ret); + return (chan); + } + + /* Error. */ + serrno = errno; + close(sock[0]); + close(sock[1]); + errno = serrno; + return (NULL); +} *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Thu Feb 25 19:06:45 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C0CA5AB4C6D; Thu, 25 Feb 2016 19:06:45 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9A25F1E08; Thu, 25 Feb 2016 19:06:45 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1PJ6iNn049359; Thu, 25 Feb 2016 19:06:44 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1PJ6iCK049357; Thu, 25 Feb 2016 19:06:44 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201602251906.u1PJ6iCK049357@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Thu, 25 Feb 2016 19:06:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r296054 - head/usr.bin/talk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Feb 2016 19:06:46 -0000 Author: pfg Date: Thu Feb 25 19:06:44 2016 New Revision: 296054 URL: https://svnweb.freebsd.org/changeset/base/296054 Log: talk(1): Replace select(2) with poll(2) Hinted by: OpenBSD and NetBSD Modified: head/usr.bin/talk/ctl_transact.c head/usr.bin/talk/io.c Modified: head/usr.bin/talk/ctl_transact.c ============================================================================== --- head/usr.bin/talk/ctl_transact.c Thu Feb 25 18:49:48 2016 (r296053) +++ head/usr.bin/talk/ctl_transact.c Thu Feb 25 19:06:44 2016 (r296054) @@ -38,6 +38,7 @@ static const char sccsid[] = "@(#)ctl_tr #include #include +#include #include "talk.h" #include "talk_ctl.h" @@ -52,23 +53,20 @@ static const char sccsid[] = "@(#)ctl_tr void ctl_transact(struct in_addr target, CTL_MSG lmsg, int type, CTL_RESPONSE *rp) { - fd_set read_mask, ctl_mask; + struct pollfd pfd[1]; int nready = 0, cc; - struct timeval wait; lmsg.type = type; daemon_addr.sin_addr = target; daemon_addr.sin_port = daemon_port; - FD_ZERO(&ctl_mask); - FD_SET(ctl_sockt, &ctl_mask); + pfd[0].fd = ctl_sockt; + pfd[0].events = POLLIN; /* * Keep sending the message until a response of * the proper type is obtained. */ do { - wait.tv_sec = CTL_WAIT; - wait.tv_usec = 0; /* resend message until a response is obtained */ do { cc = sendto(ctl_sockt, (char *)&lmsg, sizeof (lmsg), 0, @@ -79,8 +77,7 @@ ctl_transact(struct in_addr target, CTL_ continue; p_error("Error on write to talk daemon"); } - read_mask = ctl_mask; - nready = select(32, &read_mask, 0, 0, &wait); + nready = poll(pfd, 1, CTL_WAIT * 1000); if (nready < 0) { if (errno == EINTR) continue; @@ -99,10 +96,7 @@ ctl_transact(struct in_addr target, CTL_ continue; p_error("Error on read from talk daemon"); } - read_mask = ctl_mask; - /* an immediate poll */ - timerclear(&wait); - nready = select(32, &read_mask, 0, 0, &wait); + nready = poll(pfd, 1, 0); } while (nready > 0 && (rp->vers != TALK_VERSION || rp->type != type)); } while (rp->vers != TALK_VERSION || rp->type != type); Modified: head/usr.bin/talk/io.c ============================================================================== --- head/usr.bin/talk/io.c Thu Feb 25 18:49:48 2016 (r296053) +++ head/usr.bin/talk/io.c Thu Feb 25 19:06:44 2016 (r296054) @@ -46,6 +46,7 @@ static const char sccsid[] = "@(#)io.c 8 #include #include #include +#include #include #include #include @@ -67,8 +68,8 @@ void talk(void) { struct hostent *hp, *hp2; + struct pollfd fds[2]; int nb; - fd_set read_set; wchar_t buf[BUFSIZ]; char **addr, *his_machine_name; FILE *sockfp; @@ -107,10 +108,11 @@ talk(void) * Wait on both the other process (sockt) and standard input. */ for (;;) { - FD_ZERO(&read_set); - FD_SET(sockt, &read_set); - FD_SET(fileno(stdin), &read_set); - nb = select(32, &read_set, 0, 0, NULL); + fds[0].fd = fileno(stdin); + fds[0].events = POLLIN; + fds[1].fd = sockt; + fds[1].events = POLLIN; + nb = poll(fds, 2, INFTIM); if (gotwinch) { resize_display(); gotwinch = 0; @@ -119,10 +121,10 @@ talk(void) if (errno == EINTR) continue; /* Panic, we don't know what happened. */ - p_error("Unexpected error from select"); + p_error("Unexpected error from poll"); quit(); } - if (FD_ISSET(sockt, &read_set)) { + if (fds[1].revents & POLLIN) { wint_t w; /* There is data on sockt. */ @@ -133,7 +135,7 @@ talk(void) } display(&his_win, &w); } - if (FD_ISSET(fileno(stdin), &read_set)) { + if (fds[0].revents & POLLIN) { wint_t w; if ((w = getwchar()) != WEOF) { From owner-svn-src-head@freebsd.org Thu Feb 25 19:26:16 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 072AAAB3873; Thu, 25 Feb 2016 19:26:16 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AD42FE98; Thu, 25 Feb 2016 19:26:15 +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 u1PJQEVf055243; Thu, 25 Feb 2016 19:26:14 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1PJQEjq055241; Thu, 25 Feb 2016 19:26:14 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201602251926.u1PJQEjq055241@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 25 Feb 2016 19:26:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r296057 - in head/sys/modules: linux linux64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Feb 2016 19:26:16 -0000 Author: emaste Date: Thu Feb 25 19:26:14 2016 New Revision: 296057 URL: https://svnweb.freebsd.org/changeset/base/296057 Log: pass -fPIC to the assembler, not linker -fPIC has no effect on linking although it seems to be ignored by GNU ld.bfd. However, it causes ld.lld to terminate with an invalid argument error. Reviewed by: dchagin, kib MFC after: 1 month Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D5444 Modified: head/sys/modules/linux/Makefile head/sys/modules/linux64/Makefile Modified: head/sys/modules/linux/Makefile ============================================================================== --- head/sys/modules/linux/Makefile Thu Feb 25 19:21:46 2016 (r296056) +++ head/sys/modules/linux/Makefile Thu Feb 25 19:26:14 2016 (r296057) @@ -51,9 +51,9 @@ linux${SFX}_assym.h: linux${SFX}_genassy linux${SFX}_locore.o: linux${SFX}_assym.h assym.s ${CC} -x assembler-with-cpp -DLOCORE -m32 -shared -s \ -pipe -I. -I${SYSDIR} -Werror -Wall -fno-common -nostdinc -nostdlib \ - -fno-omit-frame-pointer \ + -fno-omit-frame-pointer -fPIC \ -Wl,-T${.CURDIR}/../../${MACHINE_CPUARCH}/linux${SFX}/${VDSO}.lds.s \ - -Wl,-soname=${VDSO}.so.1,--eh-frame-hdr,-fPIC,-warn-common \ + -Wl,-soname=${VDSO}.so.1,--eh-frame-hdr,-warn-common \ ${.IMPSRC} -o ${.TARGET} linux${SFX}_support.o: linux${SFX}_assym.h assym.s Modified: head/sys/modules/linux64/Makefile ============================================================================== --- head/sys/modules/linux64/Makefile Thu Feb 25 19:21:46 2016 (r296056) +++ head/sys/modules/linux64/Makefile Thu Feb 25 19:26:14 2016 (r296057) @@ -27,9 +27,9 @@ linux_assym.h: linux_genassym.o linux_locore.o: linux_locore.s linux_assym.h ${CC} -x assembler-with-cpp -DLOCORE -shared -mcmodel=small \ - -pipe -I. -I${SYSDIR} -Werror -Wall -fno-common -nostdinc \ + -pipe -I. -I${SYSDIR} -Werror -Wall -fno-common -fPIC -nostdinc \ -Wl,-T${.CURDIR}/../../${MACHINE_CPUARCH}/linux/${VDSO}.lds.s \ - -Wl,-soname=${VDSO}.so.1,-fPIC,-warn-common -nostdlib \ + -Wl,-soname=${VDSO}.so.1,-warn-common -nostdlib \ ${.IMPSRC} -o ${.TARGET} ${VDSO}.so: linux_locore.o From owner-svn-src-head@freebsd.org Thu Feb 25 19:29:56 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DF731AB3A1B; Thu, 25 Feb 2016 19:29:56 +0000 (UTC) (envelope-from sgalabov@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id ABF9F123A; Thu, 25 Feb 2016 19:29:56 +0000 (UTC) (envelope-from sgalabov@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1PJTteN055454; Thu, 25 Feb 2016 19:29:55 GMT (envelope-from sgalabov@FreeBSD.org) Received: (from sgalabov@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1PJTtcL055453; Thu, 25 Feb 2016 19:29:55 GMT (envelope-from sgalabov@FreeBSD.org) Message-Id: <201602251929.u1PJTtcL055453@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sgalabov set sender to sgalabov@FreeBSD.org using -f From: Stanislav Galabov Date: Thu, 25 Feb 2016 19:29:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r296059 - head/share/misc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Feb 2016 19:29:57 -0000 Author: sgalabov Date: Thu Feb 25 19:29:55 2016 New Revision: 296059 URL: https://svnweb.freebsd.org/changeset/base/296059 Log: Add myself as src committer Approved by: adrian (mentor) Differential Revision: https://reviews.freebsd.org/D5438 M committers-src.dot Modified: head/share/misc/committers-src.dot Modified: head/share/misc/committers-src.dot ============================================================================== --- head/share/misc/committers-src.dot Thu Feb 25 19:28:57 2016 (r296058) +++ head/share/misc/committers-src.dot Thu Feb 25 19:29:55 2016 (r296059) @@ -287,6 +287,7 @@ scottl [label="Scott Long\nscottl@FreeBS se [label="Stefan Esser\nse@FreeBSD.org\n1994/08/26"] sephe [label="Sepherosa Ziehau\nsephe@FreeBSD.org\n2007/03/28"] sepotvin [label="Stephane E. Potvin\nsepotvin@FreeBSD.org\n2007/02/15"] +sgalabov [label="Stanislav Galabov\nsgalabov@FreeBSD.org\n2016/02/24"] simon [label="Simon L. Nielsen\nsimon@FreeBSD.org\n2006/03/07"] sjg [label="Simon J. Gerraty\nsjg@FreeBSD.org\n2012/10/23"] skra [label="Svatopluk Kraus\nskra@FreeBSD.org\n2015/10/28"] @@ -348,6 +349,7 @@ adrian -> monthadar adrian -> ray adrian -> rmh adrian -> sephe +adrian -> sgalabov ae -> melifaro From owner-svn-src-head@freebsd.org Thu Feb 25 19:58:25 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 11D3DAB44A9; Thu, 25 Feb 2016 19:58: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 mx1.freebsd.org (Postfix) with ESMTPS id E0B2F1CF; Thu, 25 Feb 2016 19:58:24 +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 u1PJwNgP064141; Thu, 25 Feb 2016 19:58:23 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1PJwN8A064137; Thu, 25 Feb 2016 19:58:23 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201602251958.u1PJwN8A064137@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 25 Feb 2016 19:58:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r296060 - in head/sys: compat/freebsd32 kern sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Feb 2016 19:58:25 -0000 Author: markj Date: Thu Feb 25 19:58:23 2016 New Revision: 296060 URL: https://svnweb.freebsd.org/changeset/base/296060 Log: Improve error handling for posix_fallocate(2) and posix_fadvise(2). - Set td_errno so that ktrace and dtrace can obtain the syscall error number in the usual way. - Pass negative error numbers directly to the syscall layer, as they're not intended to be returned to userland. Reviewed by: kib Sponsored by: EMC / Isilon Storage Division Differential Revision: https://reviews.freebsd.org/D5425 Modified: head/sys/compat/freebsd32/freebsd32_misc.c head/sys/kern/sys_generic.c head/sys/kern/vfs_syscalls.c head/sys/sys/syscallsubr.h Modified: head/sys/compat/freebsd32/freebsd32_misc.c ============================================================================== --- head/sys/compat/freebsd32/freebsd32_misc.c Thu Feb 25 19:29:55 2016 (r296059) +++ head/sys/compat/freebsd32/freebsd32_misc.c Thu Feb 25 19:58:23 2016 (r296060) @@ -2965,21 +2965,22 @@ int freebsd32_posix_fallocate(struct thread *td, struct freebsd32_posix_fallocate_args *uap) { + int error; - td->td_retval[0] = kern_posix_fallocate(td, uap->fd, + error = kern_posix_fallocate(td, uap->fd, PAIR32TO64(off_t, uap->offset), PAIR32TO64(off_t, uap->len)); - return (0); + return (kern_posix_error(td, error)); } int freebsd32_posix_fadvise(struct thread *td, struct freebsd32_posix_fadvise_args *uap) { + int error; - td->td_retval[0] = kern_posix_fadvise(td, uap->fd, - PAIR32TO64(off_t, uap->offset), PAIR32TO64(off_t, uap->len), - uap->advice); - return (0); + error = kern_posix_fadvise(td, uap->fd, PAIR32TO64(off_t, uap->offset), + PAIR32TO64(off_t, uap->len), uap->advice); + return (kern_posix_error(td, error)); } int Modified: head/sys/kern/sys_generic.c ============================================================================== --- head/sys/kern/sys_generic.c Thu Feb 25 19:29:55 2016 (r296059) +++ head/sys/kern/sys_generic.c Thu Feb 25 19:58:23 2016 (r296060) @@ -1910,3 +1910,19 @@ selectinit(void *dummy __unused) NULL, NULL, UMA_ALIGN_PTR, 0); mtxpool_select = mtx_pool_create("select mtxpool", 128, MTX_DEF); } + +/* + * Set up a syscall return value that follows the convention specified for + * posix_* functions. + */ +int +kern_posix_error(struct thread *td, int error) +{ + + if (error <= 0) + return (error); + td->td_errno = error; + td->td_pflags |= TDP_NERRNO; + td->td_retval[0] = error; + return (0); +} Modified: head/sys/kern/vfs_syscalls.c ============================================================================== --- head/sys/kern/vfs_syscalls.c Thu Feb 25 19:29:55 2016 (r296059) +++ head/sys/kern/vfs_syscalls.c Thu Feb 25 19:58:23 2016 (r296060) @@ -4533,10 +4533,10 @@ kern_posix_fallocate(struct thread *td, int sys_posix_fallocate(struct thread *td, struct posix_fallocate_args *uap) { + int error; - td->td_retval[0] = kern_posix_fallocate(td, uap->fd, uap->offset, - uap->len); - return (0); + error = kern_posix_fallocate(td, uap->fd, uap->offset, uap->len); + return (kern_posix_error(td, error)); } /* @@ -4668,8 +4668,9 @@ out: int sys_posix_fadvise(struct thread *td, struct posix_fadvise_args *uap) { + int error; - td->td_retval[0] = kern_posix_fadvise(td, uap->fd, uap->offset, - uap->len, uap->advice); - return (0); + error = kern_posix_fadvise(td, uap->fd, uap->offset, uap->len, + uap->advice); + return (kern_posix_error(td, error)); } Modified: head/sys/sys/syscallsubr.h ============================================================================== --- head/sys/sys/syscallsubr.h Thu Feb 25 19:29:55 2016 (r296059) +++ head/sys/sys/syscallsubr.h Thu Feb 25 19:58:23 2016 (r296060) @@ -158,6 +158,7 @@ int kern_pipe(struct thread *td, int fil struct filecaps *fcaps1, struct filecaps *fcaps2); int kern_poll(struct thread *td, struct pollfd *fds, u_int nfds, struct timespec *tsp, sigset_t *uset); +int kern_posix_error(struct thread *td, int error); int kern_posix_fadvise(struct thread *td, int fd, off_t offset, off_t len, int advice); int kern_posix_fallocate(struct thread *td, int fd, off_t offset, From owner-svn-src-head@freebsd.org Thu Feb 25 20:02:44 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 08245AB46D4; Thu, 25 Feb 2016 20:02:44 +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 mx1.freebsd.org (Postfix) with ESMTPS id CD691948; Thu, 25 Feb 2016 20:02:43 +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 u1PK2gd9066729; Thu, 25 Feb 2016 20:02:42 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1PK2gOQ066727; Thu, 25 Feb 2016 20:02:42 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201602252002.u1PK2gOQ066727@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Thu, 25 Feb 2016 20:02:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r296062 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Feb 2016 20:02:44 -0000 Author: bdrewery Date: Thu Feb 25 20:02:42 2016 New Revision: 296062 URL: https://svnweb.freebsd.org/changeset/base/296062 Log: Fix build without FAST_DEPEND and without running 'make depend' after r295985. The OBJS_DEPEND_GUESS mechanism required moving the bsd.dep.mk inclusion to after the checks, but left DEPENDFILE not-yet-set. Move it to bsd.own.mk to resolve this. Pointyhat to: bdrewery Reported by: antoine (ports failures) Sponsored by: EMC / Isilon Storage Division Modified: head/share/mk/bsd.dep.mk head/share/mk/bsd.own.mk Modified: head/share/mk/bsd.dep.mk ============================================================================== --- head/share/mk/bsd.dep.mk Thu Feb 25 20:02:30 2016 (r296061) +++ head/share/mk/bsd.dep.mk Thu Feb 25 20:02:42 2016 (r296062) @@ -61,7 +61,6 @@ _MKDEPCC:= ${CC:N${CCACHE_BIN}} _MKDEPCC+= ${DEPFLAGS} .endif MKDEPCMD?= CC='${_MKDEPCC}' mkdep -DEPENDFILE?= .depend .if ${MK_DIRDEPS_BUILD} == "no" .MAKE.DEPENDFILE= ${DEPENDFILE} .endif Modified: head/share/mk/bsd.own.mk ============================================================================== --- head/share/mk/bsd.own.mk Thu Feb 25 20:02:30 2016 (r296061) +++ head/share/mk/bsd.own.mk Thu Feb 25 20:02:42 2016 (r296062) @@ -257,6 +257,8 @@ XZ_CMD?= xz # overriden by Makefiles, but the user may choose to set this in src.conf(5). TESTSBASE?= /usr/tests +DEPENDFILE?= .depend + # Compat for the moment -- old bsd.own.mk only included this when _WITHOUT_SRCCONF # wasn't defined. bsd.ports.mk and friends depend on this behavior. Remove in 12. .if !defined(_WITHOUT_SRCCONF) From owner-svn-src-head@freebsd.org Thu Feb 25 20:12:07 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F2177AB4A79; Thu, 25 Feb 2016 20:12:06 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C30AE1070; Thu, 25 Feb 2016 20:12:06 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1PKC5Ts070057; Thu, 25 Feb 2016 20:12:05 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1PKC5Bn070053; Thu, 25 Feb 2016 20:12:05 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201602252012.u1PKC5Bn070053@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 25 Feb 2016 20:12:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r296063 - head/sys/netinet6 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Feb 2016 20:12:07 -0000 Author: markj Date: Thu Feb 25 20:12:05 2016 New Revision: 296063 URL: https://svnweb.freebsd.org/changeset/base/296063 Log: Lock the NDP default router list and count defrouter references. This addresses a number of race conditions that can cause crashes as a result of unsynchronized access to the list. PR: 206904 Tested by: Larry Rosenman , Kevin Bowling MFC after: 2 months Differential Revision: https://reviews.freebsd.org/D5315 Modified: head/sys/netinet6/nd6.c head/sys/netinet6/nd6.h head/sys/netinet6/nd6_nbr.c head/sys/netinet6/nd6_rtr.c Modified: head/sys/netinet6/nd6.c ============================================================================== --- head/sys/netinet6/nd6.c Thu Feb 25 20:02:42 2016 (r296062) +++ head/sys/netinet6/nd6.c Thu Feb 25 20:12:05 2016 (r296063) @@ -115,6 +115,7 @@ static eventhandler_tag lle_event_eh, if VNET_DEFINE(struct nd_drhead, nd_defrouter); VNET_DEFINE(struct nd_prhead, nd_prefix); +VNET_DEFINE(struct rwlock, nd6_lock); VNET_DEFINE(int, nd6_recalc_reachtm_interval) = ND6_RECALC_REACHTM_INTERVAL; #define V_nd6_recalc_reachtm_interval VNET(nd6_recalc_reachtm_interval) @@ -205,6 +206,8 @@ void nd6_init(void) { + rw_init(&V_nd6_lock, "nd6"); + LIST_INIT(&V_nd_prefix); /* initialization of the default router list */ @@ -235,6 +238,7 @@ nd6_destroy() EVENTHANDLER_DEREGISTER(lle_event, lle_event_eh); EVENTHANDLER_DEREGISTER(iflladdr_event, iflladdr_event_eh); } + rw_destroy(&V_nd6_lock); } #endif @@ -884,6 +888,7 @@ void nd6_timer(void *arg) { CURVNET_SET((struct vnet *) arg); + struct nd_drhead drq; struct nd_defrouter *dr, *ndr; struct nd_prefix *pr, *npr; struct in6_ifaddr *ia6, *nia6; @@ -891,10 +896,18 @@ nd6_timer(void *arg) callout_reset(&V_nd6_timer_ch, V_nd6_prune * hz, nd6_timer, curvnet); + TAILQ_INIT(&drq); + /* expire default router list */ - TAILQ_FOREACH_SAFE(dr, &V_nd_defrouter, dr_entry, ndr) { + ND6_WLOCK(); + TAILQ_FOREACH_SAFE(dr, &V_nd_defrouter, dr_entry, ndr) if (dr->expire && dr->expire < time_uptime) - defrtrlist_del(dr); + defrouter_unlink(dr, &drq); + ND6_WUNLOCK(); + + while ((dr = TAILQ_FIRST(&drq)) != NULL) { + TAILQ_REMOVE(&drq, dr, dr_entry); + defrouter_del(dr); } /* @@ -1089,29 +1102,37 @@ regen_tmpaddr(struct in6_ifaddr *ia6) void nd6_purge(struct ifnet *ifp) { + struct nd_drhead drq; struct nd_defrouter *dr, *ndr; struct nd_prefix *pr, *npr; + TAILQ_INIT(&drq); + /* * Nuke default router list entries toward ifp. * We defer removal of default router list entries that is installed * in the routing table, in order to keep additional side effects as * small as possible. */ + ND6_WLOCK(); TAILQ_FOREACH_SAFE(dr, &V_nd_defrouter, dr_entry, ndr) { if (dr->installed) continue; - if (dr->ifp == ifp) - defrtrlist_del(dr); + defrouter_unlink(dr, &drq); } TAILQ_FOREACH_SAFE(dr, &V_nd_defrouter, dr_entry, ndr) { if (!dr->installed) continue; - if (dr->ifp == ifp) - defrtrlist_del(dr); + defrouter_unlink(dr, &drq); + } + ND6_WUNLOCK(); + + while ((dr = TAILQ_FIRST(&drq)) != NULL) { + TAILQ_REMOVE(&drq, dr, dr_entry); + defrouter_del(dr); } /* Nuke prefix list entries toward ifp */ @@ -1357,8 +1378,8 @@ nd6_free(struct llentry *ln, int gc) /* cancel timer */ nd6_llinfo_settimer_locked(ln, -1); + dr = NULL; ifp = ln->lle_tbl->llt_ifp; - if (ND_IFINFO(ifp)->flags & ND6_IFF_ACCEPT_RTADV) { dr = defrouter_lookup(&ln->r_l3addr.addr6, ifp); @@ -1385,6 +1406,7 @@ nd6_free(struct llentry *ln, int gc) LLE_REMREF(ln); LLE_WUNLOCK(ln); + defrouter_rele(dr); return; } @@ -1465,6 +1487,8 @@ nd6_free(struct llentry *ln, int gc) IF_AFDATA_UNLOCK(ifp); llentry_free(ln); + if (dr != NULL) + defrouter_rele(dr); } static int @@ -1525,12 +1549,13 @@ nd6_rtrequest(int req, struct rtentry *r /* * check for default route */ - if (IN6_ARE_ADDR_EQUAL(&in6addr_any, - &SIN6(rt_key(rt))->sin6_addr)) { - + if (IN6_ARE_ADDR_EQUAL(&in6addr_any, + &SIN6(rt_key(rt))->sin6_addr)) { dr = defrouter_lookup(&gateway->sin6_addr, ifp); - if (dr != NULL) + if (dr != NULL) { dr->installed = 0; + defrouter_rele(dr); + } } break; } @@ -1718,12 +1743,22 @@ nd6_ioctl(u_long cmd, caddr_t data, stru case SIOCSRTRFLUSH_IN6: { /* flush all the default routers */ - struct nd_defrouter *dr, *next; + struct nd_drhead drq; + struct nd_defrouter *dr; + + TAILQ_INIT(&drq); defrouter_reset(); - TAILQ_FOREACH_SAFE(dr, &V_nd_defrouter, dr_entry, next) { - defrtrlist_del(dr); + + ND6_WLOCK(); + while ((dr = TAILQ_FIRST(&V_nd_defrouter)) != NULL) + defrouter_unlink(dr, &drq); + ND6_WUNLOCK(); + while ((dr = TAILQ_FIRST(&drq)) != NULL) { + TAILQ_REMOVE(&drq, dr, dr_entry); + defrouter_del(dr); } + defrouter_select(); break; } @@ -2535,30 +2570,33 @@ nd6_sysctl_drlist(SYSCTL_HANDLER_ARGS) struct nd_defrouter *dr; int error; - if (req->newptr) + if (req->newptr != NULL) return (EPERM); + error = sysctl_wire_old_buffer(req, 0); + if (error != 0) + return (error); + bzero(&d, sizeof(d)); d.rtaddr.sin6_family = AF_INET6; d.rtaddr.sin6_len = sizeof(d.rtaddr); - /* - * XXX locking - */ + ND6_RLOCK(); TAILQ_FOREACH(dr, &V_nd_defrouter, dr_entry) { d.rtaddr.sin6_addr = dr->rtaddr; error = sa6_recoverscope(&d.rtaddr); if (error != 0) - return (error); + break; d.flags = dr->raflags; d.rtlifetime = dr->rtlifetime; d.expire = dr->expire + (time_second - time_uptime); d.if_index = dr->ifp->if_index; error = SYSCTL_OUT(req, &d, sizeof(d)); if (error != 0) - return (error); + break; } - return (0); + ND6_RUNLOCK(); + return (error); } static int Modified: head/sys/netinet6/nd6.h ============================================================================== --- head/sys/netinet6/nd6.h Thu Feb 25 20:02:42 2016 (r296062) +++ head/sys/netinet6/nd6.h Thu Feb 25 20:12:05 2016 (r296063) @@ -240,6 +240,7 @@ struct nd_defrouter { u_long expire; struct ifnet *ifp; int installed; /* is installed into kernel routing table */ + u_int refcnt; }; struct nd_prefixctl { @@ -339,6 +340,19 @@ VNET_DECLARE(int, nd6_onlink_ns_rfc4861) #define V_nd6_debug VNET(nd6_debug) #define V_nd6_onlink_ns_rfc4861 VNET(nd6_onlink_ns_rfc4861) +/* Lock for the prefix and default router lists. */ +VNET_DECLARE(struct rwlock, nd6_lock); +#define V_nd6_lock VNET(nd6_lock) + +#define ND6_RLOCK() rw_rlock(&V_nd6_lock) +#define ND6_RUNLOCK() rw_runlock(&V_nd6_lock) +#define ND6_WLOCK() rw_wlock(&V_nd6_lock) +#define ND6_WUNLOCK() rw_wunlock(&V_nd6_lock) +#define ND6_WLOCK_ASSERT() rw_assert(&V_nd6_lock, RA_WLOCKED) +#define ND6_RLOCK_ASSERT() rw_assert(&V_nd6_lock, RA_RLOCKED) +#define ND6_LOCK_ASSERT() rw_assert(&V_nd6_lock, RA_LOCKED) +#define ND6_UNLOCK_ASSERT() rw_assert(&V_nd6_lock, RA_UNLOCKED) + #define nd6log(x) do { if (V_nd6_debug) log x; } while (/*CONSTCOND*/ 0) VNET_DECLARE(struct callout, nd6_timer_ch); @@ -443,12 +457,17 @@ void nd6_rs_input(struct mbuf *, int, in void nd6_ra_input(struct mbuf *, int, int); void defrouter_reset(void); void defrouter_select(void); -void defrtrlist_del(struct nd_defrouter *); +void defrouter_ref(struct nd_defrouter *); +void defrouter_rele(struct nd_defrouter *); +void defrouter_remove(struct nd_defrouter *); +void defrouter_unlink(struct nd_defrouter *, struct nd_drhead *); +void defrouter_del(struct nd_defrouter *); void prelist_remove(struct nd_prefix *); int nd6_prelist_add(struct nd_prefixctl *, struct nd_defrouter *, struct nd_prefix **); void pfxlist_onlink_check(void); struct nd_defrouter *defrouter_lookup(struct in6_addr *, struct ifnet *); +struct nd_defrouter *defrouter_lookup_locked(struct in6_addr *, struct ifnet *); struct nd_prefix *nd6_prefix_lookup(struct nd_prefixctl *); void rt6_flush(struct in6_addr *, struct ifnet *); int nd6_setdefaultiface(int); Modified: head/sys/netinet6/nd6_nbr.c ============================================================================== --- head/sys/netinet6/nd6_nbr.c Thu Feb 25 20:02:42 2016 (r296062) +++ head/sys/netinet6/nd6_nbr.c Thu Feb 25 20:12:05 2016 (r296063) @@ -858,25 +858,28 @@ nd6_na_input(struct mbuf *m, int off, in * update the Destination Cache entries. */ struct nd_defrouter *dr; - struct in6_addr *in6; struct ifnet *nd6_ifp; - in6 = &ln->r_l3addr.addr6; - nd6_ifp = lltable_get_ifp(ln->lle_tbl); - dr = defrouter_lookup(in6, nd6_ifp); - if (dr) - defrtrlist_del(dr); - else if (ND_IFINFO(nd6_ifp)->flags & - ND6_IFF_ACCEPT_RTADV) { - /* - * Even if the neighbor is not in the default - * router list, the neighbor may be used - * as a next hop for some destinations - * (e.g. redirect case). So we must - * call rt6_flush explicitly. - */ - rt6_flush(&ip6->ip6_src, ifp); + ND6_WLOCK(); + dr = defrouter_lookup_locked(&ln->r_l3addr.addr6, + nd6_ifp); + if (dr != NULL) { + /* releases the ND lock */ + defrouter_remove(dr); + dr = NULL; + } else { + ND6_WUNLOCK(); + if ((ND_IFINFO(nd6_ifp)->flags & ND6_IFF_ACCEPT_RTADV) != 0) { + /* + * Even if the neighbor is not in the default + * router list, the neighbor may be used + * as a next hop for some destinations + * (e.g. redirect case). So we must + * call rt6_flush explicitly. + */ + rt6_flush(&ip6->ip6_src, ifp); + } } } ln->ln_router = is_router; Modified: head/sys/netinet6/nd6_rtr.c ============================================================================== --- head/sys/netinet6/nd6_rtr.c Thu Feb 25 20:02:42 2016 (r296062) +++ head/sys/netinet6/nd6_rtr.c Thu Feb 25 20:12:05 2016 (r296063) @@ -39,6 +39,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -220,6 +221,8 @@ nd6_ra_input(struct mbuf *m, int off, in struct nd_defrouter *dr; char ip6bufs[INET6_ADDRSTRLEN], ip6bufd[INET6_ADDRSTRLEN]; + dr = NULL; + /* * We only accept RAs only when the per-interface flag * ND6_IFF_ACCEPT_RTADV is on the receiving interface. @@ -369,6 +372,10 @@ nd6_ra_input(struct mbuf *m, int off, in (void)prelist_update(&pr, dr, m, mcast); } } + if (dr != NULL) { + defrouter_rele(dr); + dr = NULL; + } /* * MTU @@ -446,10 +453,6 @@ nd6_ra_input(struct mbuf *m, int off, in m_freem(m); } -/* - * default router list proccessing sub routines - */ - /* tell the change to user processes watching the routing socket. */ static void nd6_rtmsg(int cmd, struct rtentry *rt) @@ -478,6 +481,10 @@ nd6_rtmsg(int cmd, struct rtentry *rt) ifa_free(ifa); } +/* + * default router list proccessing sub routines + */ + static void defrouter_addreq(struct nd_defrouter *new) { @@ -506,16 +513,43 @@ defrouter_addreq(struct nd_defrouter *ne } struct nd_defrouter * -defrouter_lookup(struct in6_addr *addr, struct ifnet *ifp) +defrouter_lookup_locked(struct in6_addr *addr, struct ifnet *ifp) { struct nd_defrouter *dr; - TAILQ_FOREACH(dr, &V_nd_defrouter, dr_entry) { - if (dr->ifp == ifp && IN6_ARE_ADDR_EQUAL(addr, &dr->rtaddr)) + ND6_LOCK_ASSERT(); + TAILQ_FOREACH(dr, &V_nd_defrouter, dr_entry) + if (dr->ifp == ifp && IN6_ARE_ADDR_EQUAL(addr, &dr->rtaddr)) { + defrouter_ref(dr); return (dr); - } + } + return (NULL); +} - return (NULL); /* search failed */ +struct nd_defrouter * +defrouter_lookup(struct in6_addr *addr, struct ifnet *ifp) +{ + struct nd_defrouter *dr; + + ND6_RLOCK(); + dr = defrouter_lookup_locked(addr, ifp); + ND6_RUNLOCK(); + return (dr); +} + +void +defrouter_ref(struct nd_defrouter *dr) +{ + + refcount_acquire(&dr->refcnt); +} + +void +defrouter_rele(struct nd_defrouter *dr) +{ + + if (refcount_release(&dr->refcnt)) + free(dr, M_IP6NDP); } /* @@ -550,15 +584,41 @@ defrouter_delreq(struct nd_defrouter *dr } /* - * remove all default routes from default router list + * Remove all default routes from default router list. */ void defrouter_reset(void) { - struct nd_defrouter *dr; + struct nd_defrouter *dr, **dra; + int count, i; + + count = i = 0; + /* + * We can't delete routes with the ND lock held, so make a copy of the + * current default router list and use that when deleting routes. + */ + ND6_RLOCK(); TAILQ_FOREACH(dr, &V_nd_defrouter, dr_entry) - defrouter_delreq(dr); + count++; + ND6_RUNLOCK(); + + dra = malloc(count * sizeof(*dra), M_TEMP, M_WAITOK | M_ZERO); + + ND6_RLOCK(); + TAILQ_FOREACH(dr, &V_nd_defrouter, dr_entry) { + if (i == count) + break; + defrouter_ref(dr); + dra[i++] = dr; + } + ND6_RUNLOCK(); + + for (i = 0; i < count && dra[i] != NULL; i++) { + defrouter_delreq(dra[i]); + defrouter_rele(dra[i]); + } + free(dra, M_TEMP); /* * XXX should we also nuke any default routers in the kernel, by @@ -566,12 +626,49 @@ defrouter_reset(void) */ } +/* + * Remove a router from the global list and free it. + * + * The ND lock must be held and is released before returning. The caller must + * hold a reference on the router object. + */ void -defrtrlist_del(struct nd_defrouter *dr) +defrouter_remove(struct nd_defrouter *dr) +{ + + ND6_WLOCK_ASSERT(); + KASSERT(dr->refcnt >= 2, ("unexpected refcount 0x%x", dr->refcnt)); + + defrouter_unlink(dr, NULL); + ND6_WUNLOCK(); + defrouter_del(dr); + defrouter_rele(dr); +} + +/* + * Remove a router from the global list and optionally stash it in a + * caller-supplied queue. + * + * The ND lock must be held. + */ +void +defrouter_unlink(struct nd_defrouter *dr, struct nd_drhead *drq) +{ + + ND6_WLOCK_ASSERT(); + TAILQ_REMOVE(&V_nd_defrouter, dr, dr_entry); + if (drq != NULL) + TAILQ_INSERT_TAIL(drq, dr, dr_entry); +} + +void +defrouter_del(struct nd_defrouter *dr) { struct nd_defrouter *deldr = NULL; struct nd_prefix *pr; + ND6_UNLOCK_ASSERT(); + /* * Flush all the routing table entries that use the router * as a next hop. @@ -583,7 +680,6 @@ defrtrlist_del(struct nd_defrouter *dr) deldr = dr; defrouter_delreq(dr); } - TAILQ_REMOVE(&V_nd_defrouter, dr, dr_entry); /* * Also delete all the pointers to the router in each prefix lists. @@ -603,7 +699,10 @@ defrtrlist_del(struct nd_defrouter *dr) if (deldr) defrouter_select(); - free(dr, M_IP6NDP); + /* + * Release the list reference. + */ + defrouter_rele(dr); } /* @@ -630,27 +729,32 @@ defrtrlist_del(struct nd_defrouter *dr) void defrouter_select(void) { - struct nd_defrouter *dr, *selected_dr = NULL, *installed_dr = NULL; + struct nd_defrouter *dr, *selected_dr, *installed_dr; struct llentry *ln = NULL; + ND6_RLOCK(); /* * Let's handle easy case (3) first: * If default router list is empty, there's nothing to be done. */ - if (TAILQ_EMPTY(&V_nd_defrouter)) + if (TAILQ_EMPTY(&V_nd_defrouter)) { + ND6_RUNLOCK(); return; + } /* * Search for a (probably) reachable router from the list. * We just pick up the first reachable one (if any), assuming that * the ordering rule of the list described in defrtrlist_update(). */ + selected_dr = installed_dr = NULL; TAILQ_FOREACH(dr, &V_nd_defrouter, dr_entry) { IF_AFDATA_RLOCK(dr->ifp); if (selected_dr == NULL && (ln = nd6_lookup(&dr->rtaddr, 0, dr->ifp)) && ND6_IS_LLINFO_PROBREACH(ln)) { selected_dr = dr; + defrouter_ref(selected_dr); } IF_AFDATA_RUNLOCK(dr->ifp); if (ln != NULL) { @@ -658,12 +762,15 @@ defrouter_select(void) ln = NULL; } - if (dr->installed && installed_dr == NULL) - installed_dr = dr; - else if (dr->installed && installed_dr) { - /* this should not happen. warn for diagnosis. */ - log(LOG_ERR, "defrouter_select: more than one router" - " is installed\n"); + if (dr->installed) { + if (installed_dr == NULL) { + installed_dr = dr; + defrouter_ref(installed_dr); + } else { + /* this should not happen. warn for diagnosis. */ + log(LOG_ERR, + "defrouter_select: more than one router is installed\n"); + } } } /* @@ -675,21 +782,25 @@ defrouter_select(void) * or when the new one has a really higher preference value. */ if (selected_dr == NULL) { - if (installed_dr == NULL || !TAILQ_NEXT(installed_dr, dr_entry)) + if (installed_dr == NULL || + TAILQ_NEXT(installed_dr, dr_entry) == NULL) selected_dr = TAILQ_FIRST(&V_nd_defrouter); else selected_dr = TAILQ_NEXT(installed_dr, dr_entry); - } else if (installed_dr) { + defrouter_ref(selected_dr); + } else if (installed_dr != NULL) { IF_AFDATA_RLOCK(installed_dr->ifp); if ((ln = nd6_lookup(&installed_dr->rtaddr, 0, installed_dr->ifp)) && ND6_IS_LLINFO_PROBREACH(ln) && rtpref(selected_dr) <= rtpref(installed_dr)) { + defrouter_rele(selected_dr); selected_dr = installed_dr; } IF_AFDATA_RUNLOCK(installed_dr->ifp); if (ln != NULL) LLE_RUNLOCK(ln); } + ND6_RUNLOCK(); /* * If the selected router is different than the installed one, @@ -697,10 +808,13 @@ defrouter_select(void) * Note that the selected router is never NULL here. */ if (installed_dr != selected_dr) { - if (installed_dr) + if (installed_dr != NULL) { defrouter_delreq(installed_dr); + defrouter_rele(installed_dr); + } defrouter_addreq(selected_dr); } + defrouter_rele(selected_dr); } /* @@ -736,10 +850,11 @@ defrtrlist_update(struct nd_defrouter *n struct nd_defrouter *dr, *n; int oldpref; - if ((dr = defrouter_lookup(&new->rtaddr, new->ifp)) != NULL) { - /* entry exists */ + ND6_WLOCK(); + if ((dr = defrouter_lookup_locked(&new->rtaddr, new->ifp)) != NULL) { if (new->rtlifetime == 0) { - defrtrlist_del(dr); + /* releases the ND lock */ + defrouter_remove(dr); return (NULL); } @@ -755,8 +870,10 @@ defrtrlist_update(struct nd_defrouter *n * to sort the entries. Also make sure the selected * router is still installed in the kernel. */ - if (dr->installed && rtpref(new) == oldpref) + if (dr->installed && rtpref(new) == oldpref) { + ND6_WUNLOCK(); return (dr); + } /* * The preferred router may have changed, so relocate this @@ -768,13 +885,19 @@ defrtrlist_update(struct nd_defrouter *n } /* entry does not exist */ - if (new->rtlifetime == 0) + if (new->rtlifetime == 0) { + ND6_WUNLOCK(); return (NULL); + } n = malloc(sizeof(*n), M_IP6NDP, M_NOWAIT | M_ZERO); - if (n == NULL) + if (n == NULL) { + ND6_WUNLOCK(); return (NULL); + } memcpy(n, new, sizeof(*n)); + /* Initialize with an extra reference for the caller. */ + refcount_init(&n->refcnt, 2); insert: /* @@ -789,10 +912,11 @@ insert: if (rtpref(n) > rtpref(dr)) break; } - if (dr) + if (dr != NULL) TAILQ_INSERT_BEFORE(dr, n, dr_entry); else TAILQ_INSERT_TAIL(&V_nd_defrouter, n, dr_entry); + ND6_WUNLOCK(); defrouter_select(); @@ -821,6 +945,7 @@ pfxrtr_add(struct nd_prefix *pr, struct if (new == NULL) return; new->router = dr; + defrouter_ref(dr); LIST_INSERT_HEAD(&pr->ndpr_advrtrs, new, pfr_entry); @@ -830,7 +955,9 @@ pfxrtr_add(struct nd_prefix *pr, struct static void pfxrtr_del(struct nd_pfxrouter *pfr) { + LIST_REMOVE(pfr, pfr_entry); + defrouter_rele(pfr->router); free(pfr, M_IP6NDP); } @@ -1345,6 +1472,7 @@ pfxlist_onlink_check() * that does not advertise any prefixes. */ if (pr == NULL) { + ND6_RLOCK(); TAILQ_FOREACH(dr, &V_nd_defrouter, dr_entry) { struct nd_prefix *pr0; @@ -1355,6 +1483,7 @@ pfxlist_onlink_check() if (pfxrtr != NULL) break; } + ND6_RUNLOCK(); } if (pr != NULL || (!TAILQ_EMPTY(&V_nd_defrouter) && pfxrtr == NULL)) { /* From owner-svn-src-head@freebsd.org Thu Feb 25 20:17:20 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7D745AB4C0F; Thu, 25 Feb 2016 20:17:20 +0000 (UTC) (envelope-from jmcneill@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4759E15BB; Thu, 25 Feb 2016 20:17:20 +0000 (UTC) (envelope-from jmcneill@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1PKHJJr070368; Thu, 25 Feb 2016 20:17:19 GMT (envelope-from jmcneill@FreeBSD.org) Received: (from jmcneill@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1PKHJcb070363; Thu, 25 Feb 2016 20:17:19 GMT (envelope-from jmcneill@FreeBSD.org) Message-Id: <201602252017.u1PKHJcb070363@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jmcneill set sender to jmcneill@FreeBSD.org using -f From: Jared McNeill Date: Thu, 25 Feb 2016 20:17:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r296064 - in head/sys: arm/allwinner arm/arm arm/conf boot/fdt/dts/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Feb 2016 20:17:20 -0000 Author: jmcneill Date: Thu Feb 25 20:17:18 2016 New Revision: 296064 URL: https://svnweb.freebsd.org/changeset/base/296064 Log: Add Allwinner A20 HDMI support. The HDMI driver will attach a framebuffer device when a display is connected. If the EDID can be read and contains a preferred mode, it will be used. Otherwise the framebuffer will default to 800x600. In addition, if the EDID contains a CEA-861 extension block and the "basic audio" flag is set, audio playback at 48kHz 16-bit stereo is enabled on the controller. Reviewed by: andrew Approved by: gonzo (mentor) Differential Revision: https://reviews.freebsd.org/D5383 Added: head/sys/arm/allwinner/a10_fb.c (contents, props changed) head/sys/arm/allwinner/a10_hdmi.c (contents, props changed) head/sys/arm/allwinner/a10_hdmiaudio.c (contents, props changed) head/sys/boot/fdt/dts/arm/sun7i-a20-hdmi.dtsi (contents, props changed) Modified: head/sys/arm/allwinner/a10_clk.c head/sys/arm/allwinner/a10_clk.h head/sys/arm/allwinner/files.allwinner head/sys/arm/arm/hdmi_if.m head/sys/arm/conf/A20 head/sys/boot/fdt/dts/arm/cubieboard2.dts Modified: head/sys/arm/allwinner/a10_clk.c ============================================================================== --- head/sys/arm/allwinner/a10_clk.c Thu Feb 25 20:12:05 2016 (r296063) +++ head/sys/arm/allwinner/a10_clk.c Thu Feb 25 20:17:18 2016 (r296064) @@ -43,6 +43,18 @@ __FBSDID("$FreeBSD$"); #include "a10_clk.h" +#define TCON_PLL_WORST 1000000 +#define TCON_PLL_N_MIN 1 +#define TCON_PLL_N_MAX 15 +#define TCON_PLL_M_MIN 9 +#define TCON_PLL_M_MAX 127 +#define TCON_PLLREF_SINGLE 3000 /* kHz */ +#define TCON_PLLREF_DOUBLE 6000 /* kHz */ +#define TCON_RATE_KHZ(rate_hz) ((rate_hz) / 1000) +#define TCON_RATE_HZ(rate_khz) ((rate_khz) * 1000) +#define HDMI_DEFAULT_RATE 297000000 +#define DEBE_DEFAULT_RATE 300000000 + struct a10_ccm_softc { struct resource *res; bus_space_tag_t bst; @@ -307,6 +319,47 @@ a10_clk_pll2_set_rate(unsigned int freq) return (0); } +static int +a10_clk_pll3_set_rate(unsigned int freq) +{ + struct a10_ccm_softc *sc; + uint32_t reg_value; + int m; + + sc = a10_ccm_sc; + if (sc == NULL) + return (ENXIO); + + if (freq == 0) { + /* Disable PLL3 */ + ccm_write_4(sc, CCM_PLL3_CFG, 0); + return (0); + } + + m = freq / TCON_RATE_HZ(TCON_PLLREF_SINGLE); + + reg_value = CCM_PLL_CFG_ENABLE | CCM_PLL3_CFG_MODE_SEL_INT | m; + ccm_write_4(sc, CCM_PLL3_CFG, reg_value); + + return (0); +} + +static unsigned int +a10_clk_pll5x_get_rate(void) +{ + struct a10_ccm_softc *sc; + uint32_t k, n, p, reg_value; + + sc = a10_ccm_sc; + reg_value = ccm_read_4(sc, CCM_PLL5_CFG); + n = ((reg_value & CCM_PLL_CFG_FACTOR_N) >> CCM_PLL_CFG_FACTOR_N_SHIFT); + k = ((reg_value & CCM_PLL_CFG_FACTOR_K) >> CCM_PLL_CFG_FACTOR_K_SHIFT) + + 1; + p = ((reg_value & CCM_PLL5_CFG_OUT_EXT_DIV_P) >> CCM_PLL5_CFG_OUT_EXT_DIV_P_SHIFT); + + return ((CCM_CLK_REF_FREQ * n * k) >> p); +} + int a10_clk_ahci_activate(void) { @@ -465,3 +518,190 @@ a10_clk_codec_activate(unsigned int freq return (0); } + +static void +calc_tcon_pll(int f_ref, int f_out, int *pm, int *pn) +{ + int best, m, n, f_cur, diff; + + best = TCON_PLL_WORST; + for (n = TCON_PLL_N_MIN; n <= TCON_PLL_N_MAX; n++) { + for (m = TCON_PLL_M_MIN; m <= TCON_PLL_M_MAX; m++) { + f_cur = (m * f_ref) / n; + diff = f_out - f_cur; + if (diff > 0 && diff < best) { + best = diff; + *pm = m; + *pn = n; + } + } + } +} + +int +a10_clk_debe_activate(void) +{ + struct a10_ccm_softc *sc; + int pll_rate, clk_div; + uint32_t reg_value; + + sc = a10_ccm_sc; + if (sc == NULL) + return (ENXIO); + + /* Leave reset */ + reg_value = ccm_read_4(sc, CCM_BE0_SCLK); + reg_value |= CCM_BE_CLK_RESET; + ccm_write_4(sc, CCM_BE0_SCLK, reg_value); + + pll_rate = a10_clk_pll5x_get_rate(); + + clk_div = howmany(pll_rate, DEBE_DEFAULT_RATE); + + /* Set BE0 source to PLL5 (DDR external peripheral clock) */ + reg_value = CCM_BE_CLK_RESET; + reg_value |= (CCM_BE_CLK_SRC_SEL_PLL5 << CCM_BE_CLK_SRC_SEL_SHIFT); + reg_value |= (clk_div - 1); + ccm_write_4(sc, CCM_BE0_SCLK, reg_value); + + /* Gating AHB clock for BE0 */ + reg_value = ccm_read_4(sc, CCM_AHB_GATING1); + reg_value |= CCM_AHB_GATING_DE_BE0; + ccm_write_4(sc, CCM_AHB_GATING1, reg_value); + + /* Enable DRAM clock to BE0 */ + reg_value = ccm_read_4(sc, CCM_DRAM_CLK); + reg_value |= CCM_DRAM_CLK_BE0_CLK_ENABLE; + ccm_write_4(sc, CCM_DRAM_CLK, reg_value); + + /* Enable BE0 clock */ + reg_value = ccm_read_4(sc, CCM_BE0_SCLK); + reg_value |= CCM_BE_CLK_SCLK_GATING; + ccm_write_4(sc, CCM_BE0_SCLK, reg_value); + + return (0); +} + +int +a10_clk_lcd_activate(void) +{ + struct a10_ccm_softc *sc; + uint32_t reg_value; + + sc = a10_ccm_sc; + if (sc == NULL) + return (ENXIO); + + /* Clear LCD0 reset */ + reg_value = ccm_read_4(sc, CCM_LCD0_CH0_CLK); + reg_value |= CCM_LCD_CH0_RESET; + ccm_write_4(sc, CCM_LCD0_CH0_CLK, reg_value); + + /* Gating AHB clock for LCD0 */ + reg_value = ccm_read_4(sc, CCM_AHB_GATING1); + reg_value |= CCM_AHB_GATING_LCD0; + ccm_write_4(sc, CCM_AHB_GATING1, reg_value); + + return (0); +} + +int +a10_clk_tcon_activate(unsigned int freq) +{ + struct a10_ccm_softc *sc; + int m, n, m2, n2, f_single, f_double, dbl, src_sel; + + sc = a10_ccm_sc; + if (sc == NULL) + return (ENXIO); + + m = n = m2 = n2 = 0; + dbl = 0; + + calc_tcon_pll(TCON_PLLREF_SINGLE, TCON_RATE_KHZ(freq), &m, &n); + calc_tcon_pll(TCON_PLLREF_DOUBLE, TCON_RATE_KHZ(freq), &m2, &n2); + + f_single = n ? (m * TCON_PLLREF_SINGLE) / n : 0; + f_double = n2 ? (m2 * TCON_PLLREF_DOUBLE) / n2 : 0; + + if (f_double > f_single) { + dbl = 1; + m = m2; + n = n2; + } + src_sel = dbl ? CCM_LCD_CH1_SRC_SEL_PLL3_2X : CCM_LCD_CH1_SRC_SEL_PLL3; + + if (n == 0 || m == 0) + return (EINVAL); + + /* Set PLL3 to the closest possible rate */ + a10_clk_pll3_set_rate(TCON_RATE_HZ(m * TCON_PLLREF_SINGLE)); + + /* Enable LCD0 CH1 clock */ + ccm_write_4(sc, CCM_LCD0_CH1_CLK, + CCM_LCD_CH1_SCLK2_GATING | CCM_LCD_CH1_SCLK1_GATING | + (src_sel << CCM_LCD_CH1_SRC_SEL_SHIFT) | (n - 1)); + + return (0); +} + +int +a10_clk_tcon_get_config(int *pdiv, int *pdbl) +{ + struct a10_ccm_softc *sc; + uint32_t reg_value; + int src; + + sc = a10_ccm_sc; + if (sc == NULL) + return (ENXIO); + + reg_value = ccm_read_4(sc, CCM_LCD0_CH1_CLK); + + *pdiv = (reg_value & CCM_LCD_CH1_CLK_DIV_RATIO_M) + 1; + + src = (reg_value & CCM_LCD_CH1_SRC_SEL) >> CCM_LCD_CH1_SRC_SEL_SHIFT; + switch (src) { + case CCM_LCD_CH1_SRC_SEL_PLL3: + case CCM_LCD_CH1_SRC_SEL_PLL7: + *pdbl = 0; + break; + case CCM_LCD_CH1_SRC_SEL_PLL3_2X: + case CCM_LCD_CH1_SRC_SEL_PLL7_2X: + *pdbl = 1; + break; + } + + return (0); +} + +int +a10_clk_hdmi_activate(void) +{ + struct a10_ccm_softc *sc; + uint32_t reg_value; + int error; + + sc = a10_ccm_sc; + if (sc == NULL) + return (ENXIO); + + /* Set PLL3 to 297MHz */ + error = a10_clk_pll3_set_rate(HDMI_DEFAULT_RATE); + if (error != 0) + return (error); + + /* Enable HDMI clock, source PLL3 */ + reg_value = ccm_read_4(sc, CCM_HDMI_CLK); + reg_value |= CCM_HDMI_CLK_SCLK_GATING; + reg_value &= ~CCM_HDMI_CLK_SRC_SEL; + reg_value |= (CCM_HDMI_CLK_SRC_SEL_PLL3 << CCM_HDMI_CLK_SRC_SEL_SHIFT); + ccm_write_4(sc, CCM_HDMI_CLK, reg_value); + + /* Gating AHB clock for HDMI */ + reg_value = ccm_read_4(sc, CCM_AHB_GATING1); + reg_value |= CCM_AHB_GATING_HDMI; + ccm_write_4(sc, CCM_AHB_GATING1, reg_value); + + return (0); +} Modified: head/sys/arm/allwinner/a10_clk.h ============================================================================== --- head/sys/arm/allwinner/a10_clk.h Thu Feb 25 20:12:05 2016 (r296063) +++ head/sys/arm/allwinner/a10_clk.h Thu Feb 25 20:17:18 2016 (r296064) @@ -120,9 +120,14 @@ /* AHB_GATING_REG1 */ #define CCM_AHB_GATING_GMAC (1 << 17) +#define CCM_AHB_GATING_DE_BE1 (1 << 13) +#define CCM_AHB_GATING_DE_BE0 (1 << 12) +#define CCM_AHB_GATING_HDMI (1 << 11) +#define CCM_AHB_GATING_LCD1 (1 << 5) +#define CCM_AHB_GATING_LCD0 (1 << 4) /* APB1_GATING_REG */ -#define CCM_APB1_GATING_TWI (1 << 0) +#define CCM_APB1_GATING_TWI (1 << 0) #define CCM_USB_PHY (1 << 8) #define CCM_USB0_RESET (1 << 0) @@ -144,6 +149,17 @@ #define CCM_PLL2_CFG_PREDIV 0x1f #define CCM_PLL2_CFG_PREDIV_SHIFT 0 +#define CCM_PLL3_CFG_MODE_SEL_SHIFT 15 +#define CCM_PLL3_CFG_MODE_SEL_FRACT (0 << CCM_PLL3_CFG_MODE_SEL_SHIFT) +#define CCM_PLL3_CFG_MODE_SEL_INT (1 << CCM_PLL3_CFG_MODE_SEL_SHIFT) +#define CCM_PLL3_CFG_FUNC_SET_SHIFT 14 +#define CCM_PLL3_CFG_FUNC_SET_270MHZ (0 << CCM_PLL3_CFG_FUNC_SET_SHIFT) +#define CCM_PLL3_CFG_FUNC_SET_297MHZ (1 << CCM_PLL3_CFG_FUNC_SET_SHIFT) +#define CCM_PLL3_CFG_FACTOR_M 0x7f + +#define CCM_PLL5_CFG_OUT_EXT_DIV_P 0x30000 +#define CCM_PLL5_CFG_OUT_EXT_DIV_P_SHIFT 16 + #define CCM_PLL6_CFG_SATA_CLKEN (1U << 14) #define CCM_SD_CLK_SRC_SEL 0x3000000 @@ -160,6 +176,49 @@ #define CCM_AUDIO_CODEC_ENABLE (1U << 31) +#define CCM_LCD_CH0_SCLK_GATING (1U << 31) +#define CCM_LCD_CH0_RESET (1U << 30) +#define CCM_LCD_CH0_SRC_SEL 0x03000000 +#define CCM_LCD_CH0_SRC_SEL_SHIFT 24 +#define CCM_LCD_CH0_SRC_SEL_PLL3 0 +#define CCM_LCD_CH0_SRC_SEL_PLL7 1 +#define CCM_LCD_CH0_SRC_SEL_PLL3_2X 2 +#define CCM_LCD_CH0_SRC_SEL_PLL6_2X 3 + +#define CCM_LCD_CH1_SCLK2_GATING (1U << 31) +#define CCM_LCD_CH1_SRC_SEL 0x03000000 +#define CCM_LCD_CH1_SRC_SEL_SHIFT 24 +#define CCM_LCD_CH1_SRC_SEL_PLL3 0 +#define CCM_LCD_CH1_SRC_SEL_PLL7 1 +#define CCM_LCD_CH1_SRC_SEL_PLL3_2X 2 +#define CCM_LCD_CH1_SRC_SEL_PLL7_2X 3 +#define CCM_LCD_CH1_SCLK1_GATING (1U << 15) +#define CCM_LCD_CH1_SCLK1_SRC_SEL_SHIFT 11 +#define CCM_LCD_CH1_SCLK1_SRC_SEL_SCLK2 0 +#define CCM_LCD_CH1_SCLK1_SRC_SEL_SCLK2_DIV2 1 +#define CCM_LCD_CH1_CLK_DIV_RATIO_M 0xf + +#define CCM_DRAM_CLK_BE1_CLK_ENABLE (1U << 27) +#define CCM_DRAM_CLK_BE0_CLK_ENABLE (1U << 26) + +#define CCM_BE_CLK_SCLK_GATING (1U << 31) +#define CCM_BE_CLK_RESET (1U << 30) +#define CCM_BE_CLK_SRC_SEL 0x03000000 +#define CCM_BE_CLK_SRC_SEL_SHIFT 24 +#define CCM_BE_CLK_SRC_SEL_PLL3 0 +#define CCM_BE_CLK_SRC_SEL_PLL7 1 +#define CCM_BE_CLK_SRC_SEL_PLL5 2 +#define CCM_BE_CLK_DIV_RATIO_M 0xf + +#define CCM_HDMI_CLK_SCLK_GATING (1U << 31) +#define CCM_HDMI_CLK_SRC_SEL 0x03000000 +#define CCM_HDMI_CLK_SRC_SEL_SHIFT 24 +#define CCM_HDMI_CLK_SRC_SEL_PLL3 0 +#define CCM_HDMI_CLK_SRC_SEL_PLL7 1 +#define CCM_HDMI_CLK_SRC_SEL_PLL3_2X 2 +#define CCM_HDMI_CLK_SRC_SEL_PLL7_2X 3 +#define CCM_HDMI_CLK_DIV_RATIO_M 0xf + #define CCM_CLK_REF_FREQ 24000000U int a10_clk_usb_activate(void); @@ -172,5 +231,10 @@ int a10_clk_mmc_cfg(int, int); int a10_clk_i2c_activate(int); int a10_clk_dmac_activate(void); int a10_clk_codec_activate(unsigned int); +int a10_clk_debe_activate(void); +int a10_clk_lcd_activate(void); +int a10_clk_tcon_activate(unsigned int); +int a10_clk_tcon_get_config(int *, int *); +int a10_clk_hdmi_activate(void); #endif /* _A10_CLK_H_ */ Added: head/sys/arm/allwinner/a10_fb.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/allwinner/a10_fb.c Thu Feb 25 20:17:18 2016 (r296064) @@ -0,0 +1,545 @@ +/*- + * Copyright (c) 2016 Jared McNeill + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +/* + * Allwinner A10/A20 Framebuffer + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include +#include + +#include +#include + +#include + +#include "fb_if.h" +#include "hdmi_if.h" + +#define FB_DEFAULT_W 800 +#define FB_DEFAULT_H 600 +#define FB_DEFAULT_REF 60 +#define FB_BPP 32 +#define FB_ALIGN 0x1000 + +#define HDMI_ENABLE_DELAY 20000 + +#define DOT_CLOCK_TO_HZ(c) ((c) * 1000) + +/* Display backend */ +#define DEBE_REG_START 0x800 +#define DEBE_REG_END 0x1000 +#define DEBE_REG_WIDTH 4 +#define DEBE_MODCTL 0x800 +#define MODCTL_ITLMOD_EN (1 << 28) +#define MODCTL_OUT_SEL_MASK (0x7 << 20) +#define MODCTL_OUT_SEL(sel) ((sel) << 20) +#define OUT_SEL_LCD 0 +#define MODCTL_LAY0_EN (1 << 8) +#define MODCTL_START_CTL (1 << 1) +#define MODCTL_EN (1 << 0) +#define DEBE_DISSIZE 0x808 +#define DIS_HEIGHT(h) (((h) - 1) << 16) +#define DIS_WIDTH(w) (((w) - 1) << 0) +#define DEBE_LAYSIZE0 0x810 +#define LAY_HEIGHT(h) (((h) - 1) << 16) +#define LAY_WIDTH(w) (((w) - 1) << 0) +#define DEBE_LAYCOOR0 0x820 +#define LAY_XCOOR(x) ((x) << 16) +#define LAY_YCOOR(y) ((y) << 0) +#define DEBE_LAYLINEWIDTH0 0x840 +#define DEBE_LAYFB_L32ADD0 0x850 +#define LAYFB_L32ADD(pa) ((pa) << 3) +#define DEBE_LAYFB_H4ADD 0x860 +#define LAY0FB_H4ADD(pa) ((pa) >> 29) +#define DEBE_REGBUFFCTL 0x870 +#define REGBUFFCTL_LOAD (1 << 0) +#define DEBE_ATTCTL1 0x8a0 +#define ATTCTL1_FBFMT(fmt) ((fmt) << 8) +#define FBFMT_XRGB8888 9 +#define ATTCTL1_FBPS(ps) ((ps) << 0) +#define FBPS_32BPP_ARGB 0 + +/* Timing controller */ +#define TCON_GCTL 0x000 +#define GCTL_TCON_EN (1 << 31) +#define GCTL_IO_MAP_SEL_TCON1 (1 << 0) +#define TCON_GINT1 0x008 +#define GINT1_TCON1_LINENO(n) (((n) + 2) << 0) +#define TCON0_DCLK 0x044 +#define DCLK_EN 0xf0000000 +#define TCON1_CTL 0x090 +#define TCON1_EN (1 << 31) +#define INTERLACE_EN (1 << 20) +#define TCON1_SRC_SEL(src) ((src) << 0) +#define TCON1_SRC_CH1 0 +#define TCON1_SRC_CH2 1 +#define TCON1_SRC_BLUE 2 +#define TCON1_START_DELAY(sd) ((sd) << 4) +#define TCON1_BASIC0 0x094 +#define TCON1_BASIC1 0x098 +#define TCON1_BASIC2 0x09c +#define TCON1_BASIC3 0x0a0 +#define TCON1_BASIC4 0x0a4 +#define TCON1_BASIC5 0x0a8 +#define BASIC_X(x) (((x) - 1) << 16) +#define BASIC_Y(y) (((y) - 1) << 0) +#define BASIC3_HT(ht) (((ht) - 1) << 16) +#define BASIC3_HBP(hbp) (((hbp) - 1) << 0) +#define BASIC4_VT(vt) ((vt) << 16) +#define BASIC4_VBP(vbp) (((vbp) - 1) << 0) +#define BASIC5_HSPW(hspw) (((hspw) - 1) << 16) +#define BASIC5_VSPW(vspw) (((vspw) - 1) << 0) +#define TCON1_IO_POL 0x0f0 +#define IO_POL_IO2_INV (1 << 26) +#define IO_POL_PHSYNC (1 << 25) +#define IO_POL_PVSYNC (1 << 24) +#define TCON1_IO_TRI 0x0f4 +#define IO0_OUTPUT_TRI_EN (1 << 24) +#define IO1_OUTPUT_TRI_EN (1 << 25) +#define IO_TRI_MASK 0xffffffff +#define START_DELAY(vbl) (MIN(32, (vbl)) - 2) +#define VBLANK_LEN(vt, vd, i) ((((vt) << (i)) >> 1) - (vd) - 2) +#define VTOTAL(vt) ((vt) * 2) +#define DIVIDE(x, y) (((x) + ((y) / 2)) / (y)) + +struct a10fb_softc { + device_t dev; + device_t fbdev; + struct resource *res[2]; + + /* Framebuffer */ + struct fb_info info; + size_t fbsize; + bus_addr_t paddr; + vm_offset_t vaddr; + + /* HDMI */ + eventhandler_tag hdmi_evh; +}; + +static struct resource_spec a10fb_spec[] = { + { SYS_RES_MEMORY, 0, RF_ACTIVE }, /* DEBE */ + { SYS_RES_MEMORY, 1, RF_ACTIVE }, /* TCON */ + { -1, 0 } +}; + +#define DEBE_READ(sc, reg) bus_read_4((sc)->res[0], (reg)) +#define DEBE_WRITE(sc, reg, val) bus_write_4((sc)->res[0], (reg), (val)) + +#define TCON_READ(sc, reg) bus_read_4((sc)->res[1], (reg)) +#define TCON_WRITE(sc, reg, val) bus_write_4((sc)->res[1], (reg), (val)) + +static int +a10fb_allocfb(struct a10fb_softc *sc) +{ + sc->vaddr = kmem_alloc_contig(kernel_arena, sc->fbsize, + M_NOWAIT | M_ZERO, 0, ~0, FB_ALIGN, 0, VM_MEMATTR_WRITE_COMBINING); + if (sc->vaddr == 0) { + device_printf(sc->dev, "failed to allocate FB memory\n"); + return (ENOMEM); + } + sc->paddr = pmap_kextract(sc->vaddr); + + return (0); +} + +static void +a10fb_freefb(struct a10fb_softc *sc) +{ + kmem_free(kernel_arena, sc->vaddr, sc->fbsize); +} + +static void +a10fb_setup_debe(struct a10fb_softc *sc, const struct videomode *mode) +{ + int width, height, interlace, reg; + uint32_t val; + + interlace = !!(mode->flags & VID_INTERLACE); + width = mode->hdisplay; + height = mode->vdisplay << interlace; + + /* Enable DEBE clocks */ + a10_clk_debe_activate(); + + /* Initialize all registers to 0 */ + for (reg = DEBE_REG_START; reg < DEBE_REG_END; reg += DEBE_REG_WIDTH) + DEBE_WRITE(sc, reg, 0); + + /* Enable display backend */ + DEBE_WRITE(sc, DEBE_MODCTL, MODCTL_EN); + + /* Set display size */ + DEBE_WRITE(sc, DEBE_DISSIZE, DIS_HEIGHT(height) | DIS_WIDTH(width)); + + /* Set layer 0 size, position, and stride */ + DEBE_WRITE(sc, DEBE_LAYSIZE0, LAY_HEIGHT(height) | LAY_WIDTH(width)); + DEBE_WRITE(sc, DEBE_LAYCOOR0, LAY_XCOOR(0) | LAY_YCOOR(0)); + DEBE_WRITE(sc, DEBE_LAYLINEWIDTH0, width * FB_BPP); + + /* Point layer 0 to FB memory */ + DEBE_WRITE(sc, DEBE_LAYFB_L32ADD0, LAYFB_L32ADD(sc->paddr)); + DEBE_WRITE(sc, DEBE_LAYFB_H4ADD, LAY0FB_H4ADD(sc->paddr)); + + /* Set backend format and pixel sequence */ + DEBE_WRITE(sc, DEBE_ATTCTL1, ATTCTL1_FBFMT(FBFMT_XRGB8888) | + ATTCTL1_FBPS(FBPS_32BPP_ARGB)); + + /* Enable layer 0, output to LCD, setup interlace */ + val = DEBE_READ(sc, DEBE_MODCTL); + val |= MODCTL_LAY0_EN; + val &= ~MODCTL_OUT_SEL_MASK; + val |= MODCTL_OUT_SEL(OUT_SEL_LCD); + if (interlace) + val |= MODCTL_ITLMOD_EN; + else + val &= ~MODCTL_ITLMOD_EN; + DEBE_WRITE(sc, DEBE_MODCTL, val); + + /* Commit settings */ + DEBE_WRITE(sc, DEBE_REGBUFFCTL, REGBUFFCTL_LOAD); + + /* Start DEBE */ + val = DEBE_READ(sc, DEBE_MODCTL); + val |= MODCTL_START_CTL; + DEBE_WRITE(sc, DEBE_MODCTL, val); +} + +static void +a10fb_setup_tcon(struct a10fb_softc *sc, const struct videomode *mode) +{ + u_int interlace, hspw, hbp, vspw, vbp, vbl, width, height, start_delay; + u_int vtotal, framerate, clk; + uint32_t val; + + interlace = !!(mode->flags & VID_INTERLACE); + width = mode->hdisplay; + height = mode->vdisplay; + hspw = mode->hsync_end - mode->hsync_start; + hbp = mode->htotal - mode->hsync_start; + vspw = mode->vsync_end - mode->vsync_start; + vbp = mode->vtotal - mode->vsync_start; + vbl = VBLANK_LEN(mode->vtotal, mode->vdisplay, interlace); + start_delay = START_DELAY(vbl); + + /* Enable LCD clocks */ + a10_clk_lcd_activate(); + + /* Disable TCON and TCON1 */ + TCON_WRITE(sc, TCON_GCTL, 0); + TCON_WRITE(sc, TCON1_CTL, 0); + + /* Enable clocks */ + TCON_WRITE(sc, TCON0_DCLK, DCLK_EN); + + /* Disable IO and data output ports */ + TCON_WRITE(sc, TCON1_IO_TRI, IO_TRI_MASK); + + /* Disable TCON and select TCON1 */ + TCON_WRITE(sc, TCON_GCTL, GCTL_IO_MAP_SEL_TCON1); + + /* Source width and height */ + TCON_WRITE(sc, TCON1_BASIC0, BASIC_X(width) | BASIC_Y(height)); + /* Scaler width and height */ + TCON_WRITE(sc, TCON1_BASIC1, BASIC_X(width) | BASIC_Y(height)); + /* Output width and height */ + TCON_WRITE(sc, TCON1_BASIC2, BASIC_X(width) | BASIC_Y(height)); + /* Horizontal total and back porch */ + TCON_WRITE(sc, TCON1_BASIC3, BASIC3_HT(mode->htotal) | BASIC3_HBP(hbp)); + /* Vertical total and back porch */ + vtotal = VTOTAL(mode->vtotal); + if (interlace) { + framerate = DIVIDE(DIVIDE(DOT_CLOCK_TO_HZ(mode->dot_clock), + mode->htotal), mode->vtotal); + clk = mode->htotal * (VTOTAL(mode->vtotal) + 1) * framerate; + if ((clk / 2) == DOT_CLOCK_TO_HZ(mode->dot_clock)) + vtotal += 1; + } + TCON_WRITE(sc, TCON1_BASIC4, BASIC4_VT(vtotal) | BASIC4_VBP(vbp)); + /* Horizontal and vertical sync */ + TCON_WRITE(sc, TCON1_BASIC5, BASIC5_HSPW(hspw) | BASIC5_VSPW(vspw)); + /* Polarity */ + val = IO_POL_IO2_INV; + if (mode->flags & VID_PHSYNC) + val |= IO_POL_PHSYNC; + if (mode->flags & VID_PVSYNC) + val |= IO_POL_PVSYNC; + TCON_WRITE(sc, TCON1_IO_POL, val); + + /* Set scan line for TCON1 line trigger */ + TCON_WRITE(sc, TCON_GINT1, GINT1_TCON1_LINENO(start_delay)); + + /* Enable TCON1 */ + val = TCON1_EN; + if (interlace) + val |= INTERLACE_EN; + val |= TCON1_START_DELAY(start_delay); + val |= TCON1_SRC_SEL(TCON1_SRC_CH1); + TCON_WRITE(sc, TCON1_CTL, val); + + /* Setup PLL */ + a10_clk_tcon_activate(DOT_CLOCK_TO_HZ(mode->dot_clock)); +} + +static void +a10fb_enable_tcon(struct a10fb_softc *sc, int onoff) +{ + uint32_t val; + + /* Enable TCON */ + val = TCON_READ(sc, TCON_GCTL); + if (onoff) + val |= GCTL_TCON_EN; + else + val &= ~GCTL_TCON_EN; + TCON_WRITE(sc, TCON_GCTL, val); + + /* Enable TCON1 IO0/IO1 outputs */ + val = TCON_READ(sc, TCON1_IO_TRI); + if (onoff) + val &= ~(IO0_OUTPUT_TRI_EN | IO1_OUTPUT_TRI_EN); + else + val |= (IO0_OUTPUT_TRI_EN | IO1_OUTPUT_TRI_EN); + TCON_WRITE(sc, TCON1_IO_TRI, val); +} + +static int +a10fb_configure(struct a10fb_softc *sc, const struct videomode *mode) +{ + size_t fbsize; + int error; + + fbsize = round_page(mode->hdisplay * mode->vdisplay * (FB_BPP / NBBY)); + + /* Detach the old FB device */ + if (sc->fbdev != NULL) { + device_delete_child(sc->dev, sc->fbdev); + sc->fbdev = NULL; + } + + /* If the FB size has changed, free the old FB memory */ + if (sc->fbsize > 0 && sc->fbsize != fbsize) { + a10fb_freefb(sc); + sc->vaddr = 0; + } + + /* Allocate the FB if necessary */ + sc->fbsize = fbsize; + if (sc->vaddr == 0) { + error = a10fb_allocfb(sc); + if (error != 0) { + device_printf(sc->dev, "failed to allocate FB memory\n"); + return (ENXIO); + } + } + + /* Setup display backend */ + a10fb_setup_debe(sc, mode); + + /* Setup display timing controller */ + a10fb_setup_tcon(sc, mode); + + /* Attach framebuffer device */ + sc->info.fb_name = device_get_nameunit(sc->dev); + sc->info.fb_vbase = (intptr_t)sc->vaddr; + sc->info.fb_pbase = sc->paddr; + sc->info.fb_size = sc->fbsize; + sc->info.fb_bpp = sc->info.fb_depth = FB_BPP; + sc->info.fb_stride = mode->hdisplay * (FB_BPP / NBBY); + sc->info.fb_width = mode->hdisplay; + sc->info.fb_height = mode->vdisplay; + + sc->fbdev = device_add_child(sc->dev, "fbd", device_get_unit(sc->dev)); + if (sc->fbdev == NULL) { + device_printf(sc->dev, "failed to add fbd child\n"); + return (ENOENT); + } + + error = device_probe_and_attach(sc->fbdev); + if (error != 0) { + device_printf(sc->dev, "failed to attach fbd device\n"); + return (error); + } + + return (0); +} + +static void +a10fb_hdmi_event(void *arg, device_t hdmi_dev) +{ + const struct videomode *mode; + struct videomode hdmi_mode; + struct a10fb_softc *sc; + struct edid_info ei; + uint8_t *edid; + uint32_t edid_len; + int error; + + sc = arg; + edid = NULL; + edid_len = 0; + mode = NULL; + + error = HDMI_GET_EDID(hdmi_dev, &edid, &edid_len); + if (error != 0) { + device_printf(sc->dev, "failed to get EDID: %d\n", error); + } else { + error = edid_parse(edid, &ei); + if (error != 0) { + device_printf(sc->dev, "failed to parse EDID: %d\n", + error); + } else { + if (bootverbose) + edid_print(&ei); + mode = ei.edid_preferred_mode; + } + } + + /* If the preferred mode could not be determined, use the default */ + if (mode == NULL) + mode = pick_mode_by_ref(FB_DEFAULT_W, FB_DEFAULT_H, + FB_DEFAULT_REF); + + if (mode == NULL) { + device_printf(sc->dev, "failed to find usable video mode\n"); + return; + } + + if (bootverbose) + device_printf(sc->dev, "using %dx%d\n", + mode->hdisplay, mode->vdisplay); + + /* Disable HDMI */ + HDMI_ENABLE(hdmi_dev, 0); + + /* Disable timing controller */ + a10fb_enable_tcon(sc, 0); + + /* Configure DEBE and TCON */ + error = a10fb_configure(sc, mode); + if (error != 0) { + device_printf(sc->dev, "failed to configure FB: %d\n", error); + return; + } + + hdmi_mode = *mode; + hdmi_mode.hskew = mode->hsync_end - mode->hsync_start; + hdmi_mode.flags |= VID_HSKEW; + HDMI_SET_VIDEOMODE(hdmi_dev, &hdmi_mode); + + /* Enable timing controller */ + a10fb_enable_tcon(sc, 1); + + DELAY(HDMI_ENABLE_DELAY); + + /* Enable HDMI */ + HDMI_ENABLE(hdmi_dev, 1); +} + +static int +a10fb_probe(device_t dev) +{ + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + + if (!ofw_bus_is_compatible(dev, "allwinner,sun7i-a20-fb")) + return (ENXIO); + + device_set_desc(dev, "Allwinner Framebuffer"); + return (BUS_PROBE_DEFAULT); +} + +static int +a10fb_attach(device_t dev) +{ + struct a10fb_softc *sc; + + sc = device_get_softc(dev); + + sc->dev = dev; + + if (bus_alloc_resources(dev, a10fb_spec, sc->res)) { + device_printf(dev, "cannot allocate resources for device\n"); + return (ENXIO); + } + + sc->hdmi_evh = EVENTHANDLER_REGISTER(hdmi_event, + a10fb_hdmi_event, sc, 0); + + return (0); +} + +static struct fb_info * +a10fb_fb_getinfo(device_t dev) +{ + struct a10fb_softc *sc; + + sc = device_get_softc(dev); + + return (&sc->info); +} + +static device_method_t a10fb_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, a10fb_probe), + DEVMETHOD(device_attach, a10fb_attach), + + /* FB interface */ + DEVMETHOD(fb_getinfo, a10fb_fb_getinfo), + + DEVMETHOD_END +}; + +static driver_t a10fb_driver = { + "fb", + a10fb_methods, + sizeof(struct a10fb_softc), +}; + +static devclass_t a10fb_devclass; + +DRIVER_MODULE(fb, simplebus, a10fb_driver, a10fb_devclass, 0, 0); Added: head/sys/arm/allwinner/a10_hdmi.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/allwinner/a10_hdmi.c Thu Feb 25 20:17:18 2016 (r296064) @@ -0,0 +1,601 @@ +/*- + * Copyright (c) 2016 Jared McNeill + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +/* + * Allwinner A10/A20 HDMI TX + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include + +#include + +#include +#include + +#include +#include + +#include + +#include "hdmi_if.h" + +#define HDMI_CTRL 0x004 +#define CTRL_MODULE_EN (1 << 31) +#define HDMI_INT_STATUS 0x008 +#define HDMI_HPD 0x00c +#define HPD_DET (1 << 0) +#define HDMI_VID_CTRL 0x010 +#define VID_CTRL_VIDEO_EN (1 << 31) +#define VID_CTRL_HDMI_MODE (1 << 30) +#define VID_CTRL_INTERLACE (1 << 4) +#define VID_CTRL_REPEATER_2X (1 << 0) +#define HDMI_VID_TIMING0 0x014 +#define VID_ACT_V(v) (((v) - 1) << 16) +#define VID_ACT_H(h) (((h) - 1) << 0) +#define HDMI_VID_TIMING1 0x018 +#define VID_VBP(vbp) (((vbp) - 1) << 16) +#define VID_HBP(hbp) (((hbp) - 1) << 0) +#define HDMI_VID_TIMING2 0x01c +#define VID_VFP(vfp) (((vfp) - 1) << 16) +#define VID_HFP(hfp) (((hfp) - 1) << 0) +#define HDMI_VID_TIMING3 0x020 +#define VID_VSPW(vspw) (((vspw) - 1) << 16) +#define VID_HSPW(hspw) (((hspw) - 1) << 0) +#define HDMI_VID_TIMING4 0x024 +#define TX_CLOCK_NORMAL 0x03e00000 +#define VID_VSYNC_ACTSEL (1 << 1) +#define VID_HSYNC_ACTSEL (1 << 0) +#define HDMI_AUD_CTRL 0x040 +#define AUD_CTRL_EN (1 << 31) +#define AUD_CTRL_RST (1 << 30) +#define HDMI_ADMA_CTRL 0x044 +#define HDMI_ADMA_MODE (1 << 31) +#define HDMI_ADMA_MODE_DDMA (0 << 31) +#define HDMI_ADMA_MODE_NDMA (1 << 31) +#define HDMI_AUD_FMT 0x048 +#define AUD_FMT_CH(n) ((n) - 1) +#define HDMI_PCM_CTRL 0x04c +#define HDMI_AUD_CTS 0x050 *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Thu Feb 25 20:48:26 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1BDA7AB4D8C; Thu, 25 Feb 2016 20:48:26 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D14DB11B8; Thu, 25 Feb 2016 20:48:25 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1PKmO6T079985; Thu, 25 Feb 2016 20:48:24 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1PKmNKn079969; Thu, 25 Feb 2016 20:48:23 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201602252048.u1PKmNKn079969@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Thu, 25 Feb 2016 20:48:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r296066 - in head/sys/arm: allwinner/a20 altera/socfpga amlogic/aml8726 annapurna/alpine arm broadcom/bcm2835 freescale/imx include mv/armada38x mv/armadaxp qemu rockchip samsung/exynos... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Feb 2016 20:48:26 -0000 Author: andrew Date: Thu Feb 25 20:48:23 2016 New Revision: 296066 URL: https://svnweb.freebsd.org/changeset/base/296066 Log: Remove platform_ipi_send, it's an unneeded as all implementations are identical. Sponsored by: ABT Systems Ltd Modified: head/sys/arm/allwinner/a20/a20_mp.c head/sys/arm/altera/socfpga/socfpga_mp.c head/sys/arm/amlogic/aml8726/aml8726_mp.c head/sys/arm/annapurna/alpine/alpine_machdep_mp.c head/sys/arm/arm/mp_machdep.c head/sys/arm/broadcom/bcm2835/bcm2836_mp.c head/sys/arm/freescale/imx/imx6_mp.c head/sys/arm/include/smp.h head/sys/arm/mv/armada38x/armada38x_mp.c head/sys/arm/mv/armadaxp/armadaxp_mp.c head/sys/arm/qemu/virt_mp.c head/sys/arm/rockchip/rk30xx_mp.c head/sys/arm/samsung/exynos/exynos5_mp.c head/sys/arm/ti/omap4/omap4_mp.c head/sys/arm/xilinx/zy7_mp.c Modified: head/sys/arm/allwinner/a20/a20_mp.c ============================================================================== --- head/sys/arm/allwinner/a20/a20_mp.c Thu Feb 25 20:43:25 2016 (r296065) +++ head/sys/arm/allwinner/a20/a20_mp.c Thu Feb 25 20:48:23 2016 (r296066) @@ -153,10 +153,3 @@ platform_mp_start_ap(void) armv7_sev(); bus_space_unmap(fdtbus_bs_tag, cpucfg, CPUCFG_SIZE); } - -void -platform_ipi_send(cpuset_t cpus, u_int ipi) -{ - - pic_ipi_send(cpus, ipi); -} Modified: head/sys/arm/altera/socfpga/socfpga_mp.c ============================================================================== --- head/sys/arm/altera/socfpga/socfpga_mp.c Thu Feb 25 20:43:25 2016 (r296065) +++ head/sys/arm/altera/socfpga/socfpga_mp.c Thu Feb 25 20:48:23 2016 (r296066) @@ -174,10 +174,3 @@ platform_mp_start_ap(void) bus_space_unmap(fdtbus_bs_tag, rst, RSTMGR_SIZE); bus_space_unmap(fdtbus_bs_tag, ram, RAM_SIZE); } - -void -platform_ipi_send(cpuset_t cpus, u_int ipi) -{ - - pic_ipi_send(cpus, ipi); -} Modified: head/sys/arm/amlogic/aml8726/aml8726_mp.c ============================================================================== --- head/sys/arm/amlogic/aml8726/aml8726_mp.c Thu Feb 25 20:43:25 2016 (r296065) +++ head/sys/arm/amlogic/aml8726/aml8726_mp.c Thu Feb 25 20:48:23 2016 (r296066) @@ -534,13 +534,6 @@ platform_mp_start_ap(void) memset(&aml8726_smp, 0, sizeof(aml8726_smp)); } -void -platform_ipi_send(cpuset_t cpus, u_int ipi) -{ - - pic_ipi_send(cpus, ipi); -} - /* * Stub drivers for cosmetic purposes. */ Modified: head/sys/arm/annapurna/alpine/alpine_machdep_mp.c ============================================================================== --- head/sys/arm/annapurna/alpine/alpine_machdep_mp.c Thu Feb 25 20:43:25 2016 (r296065) +++ head/sys/arm/annapurna/alpine/alpine_machdep_mp.c Thu Feb 25 20:48:23 2016 (r296066) @@ -324,10 +324,3 @@ alpine_serdes_resource_get(uint32_t grou return (0); } - -void -platform_ipi_send(cpuset_t cpus, u_int ipi) -{ - - pic_ipi_send(cpus, ipi); -} Modified: head/sys/arm/arm/mp_machdep.c ============================================================================== --- head/sys/arm/arm/mp_machdep.c Thu Feb 25 20:43:25 2016 (r296065) +++ head/sys/arm/arm/mp_machdep.c Thu Feb 25 20:48:23 2016 (r296066) @@ -499,7 +499,7 @@ ipi_all_but_self(u_int ipi) other_cpus = all_cpus; CPU_CLR(PCPU_GET(cpuid), &other_cpus); CTR2(KTR_SMP, "%s: ipi: %x", __func__, ipi); - platform_ipi_send(other_cpus, ipi); + pic_ipi_send(other_cpus, ipi); } void @@ -511,7 +511,7 @@ ipi_cpu(int cpu, u_int ipi) CPU_SET(cpu, &cpus); CTR3(KTR_SMP, "%s: cpu: %d, ipi: %x", __func__, cpu, ipi); - platform_ipi_send(cpus, ipi); + pic_ipi_send(cpus, ipi); } void @@ -519,6 +519,6 @@ ipi_selected(cpuset_t cpus, u_int ipi) { CTR2(KTR_SMP, "%s: ipi: %x", __func__, ipi); - platform_ipi_send(cpus, ipi); + pic_ipi_send(cpus, ipi); } Modified: head/sys/arm/broadcom/bcm2835/bcm2836_mp.c ============================================================================== --- head/sys/arm/broadcom/bcm2835/bcm2836_mp.c Thu Feb 25 20:43:25 2016 (r296065) +++ head/sys/arm/broadcom/bcm2835/bcm2836_mp.c Thu Feb 25 20:48:23 2016 (r296066) @@ -193,10 +193,3 @@ void pic_ipi_clear(int ipi) { } - -void -platform_ipi_send(cpuset_t cpus, u_int ipi) -{ - - pic_ipi_send(cpus, ipi); -} Modified: head/sys/arm/freescale/imx/imx6_mp.c ============================================================================== --- head/sys/arm/freescale/imx/imx6_mp.c Thu Feb 25 20:43:25 2016 (r296065) +++ head/sys/arm/freescale/imx/imx6_mp.c Thu Feb 25 20:48:23 2016 (r296066) @@ -173,10 +173,3 @@ platform_mp_start_ap(void) bus_space_unmap(fdtbus_bs_tag, scu, SCU_SIZE); bus_space_unmap(fdtbus_bs_tag, src, SRC_SIZE); } - -void -platform_ipi_send(cpuset_t cpus, u_int ipi) -{ - - pic_ipi_send(cpus, ipi); -} Modified: head/sys/arm/include/smp.h ============================================================================== --- head/sys/arm/include/smp.h Thu Feb 25 20:43:25 2016 (r296065) +++ head/sys/arm/include/smp.h Thu Feb 25 20:48:23 2016 (r296066) @@ -49,8 +49,6 @@ int platform_mp_probe(void); void platform_mp_start_ap(void); void platform_mp_init_secondary(void); -void platform_ipi_send(cpuset_t cpus, u_int ipi); - /* global data in mp_machdep.c */ extern struct pcb stoppcbs[]; Modified: head/sys/arm/mv/armada38x/armada38x_mp.c ============================================================================== --- head/sys/arm/mv/armada38x/armada38x_mp.c Thu Feb 25 20:43:25 2016 (r296065) +++ head/sys/arm/mv/armada38x/armada38x_mp.c Thu Feb 25 20:48:23 2016 (r296066) @@ -157,10 +157,3 @@ platform_mp_start_ap(void) /* Release CPU1 from reset */ cpu_reset_deassert(); } - -void -platform_ipi_send(cpuset_t cpus, u_int ipi) -{ - - pic_ipi_send(cpus, ipi); -} Modified: head/sys/arm/mv/armadaxp/armadaxp_mp.c ============================================================================== --- head/sys/arm/mv/armadaxp/armadaxp_mp.c Thu Feb 25 20:43:25 2016 (r296065) +++ head/sys/arm/mv/armadaxp/armadaxp_mp.c Thu Feb 25 20:48:23 2016 (r296066) @@ -186,10 +186,3 @@ platform_mp_start_ap(void) armadaxp_init_coher_fabric(); } - -void -platform_ipi_send(cpuset_t cpus, u_int ipi) -{ - - pic_ipi_send(cpus, ipi); -} Modified: head/sys/arm/qemu/virt_mp.c ============================================================================== --- head/sys/arm/qemu/virt_mp.c Thu Feb 25 20:43:25 2016 (r296065) +++ head/sys/arm/qemu/virt_mp.c Thu Feb 25 20:48:23 2016 (r296066) @@ -103,11 +103,5 @@ platform_mp_init_secondary(void) { intr_pic_init_secondary(); -} - -void -platform_ipi_send(cpuset_t cpus, u_int ipi) -{ - pic_ipi_send(cpus, ipi); } Modified: head/sys/arm/rockchip/rk30xx_mp.c ============================================================================== --- head/sys/arm/rockchip/rk30xx_mp.c Thu Feb 25 20:43:25 2016 (r296065) +++ head/sys/arm/rockchip/rk30xx_mp.c Thu Feb 25 20:48:23 2016 (r296066) @@ -186,10 +186,3 @@ platform_mp_start_ap(void) bus_space_unmap(fdtbus_bs_tag, imem, IMEM_SIZE); bus_space_unmap(fdtbus_bs_tag, pmu, PMU_SIZE); } - -void -platform_ipi_send(cpuset_t cpus, u_int ipi) -{ - - pic_ipi_send(cpus, ipi); -} Modified: head/sys/arm/samsung/exynos/exynos5_mp.c ============================================================================== --- head/sys/arm/samsung/exynos/exynos5_mp.c Thu Feb 25 20:43:25 2016 (r296065) +++ head/sys/arm/samsung/exynos/exynos5_mp.c Thu Feb 25 20:48:23 2016 (r296066) @@ -142,10 +142,3 @@ platform_mp_start_ap(void) bus_space_unmap(fdtbus_bs_tag, sysram, 0x100); bus_space_unmap(fdtbus_bs_tag, pmu, 0x20000); } - -void -platform_ipi_send(cpuset_t cpus, u_int ipi) -{ - - pic_ipi_send(cpus, ipi); -} Modified: head/sys/arm/ti/omap4/omap4_mp.c ============================================================================== --- head/sys/arm/ti/omap4/omap4_mp.c Thu Feb 25 20:43:25 2016 (r296065) +++ head/sys/arm/ti/omap4/omap4_mp.c Thu Feb 25 20:48:23 2016 (r296066) @@ -80,9 +80,3 @@ platform_mp_start_ap(void) armv7_sev(); bus_space_unmap(fdtbus_bs_tag, scu_addr, 0x1000); } - -void -platform_ipi_send(cpuset_t cpus, u_int ipi) -{ - pic_ipi_send(cpus, ipi); -} Modified: head/sys/arm/xilinx/zy7_mp.c ============================================================================== --- head/sys/arm/xilinx/zy7_mp.c Thu Feb 25 20:43:25 2016 (r296065) +++ head/sys/arm/xilinx/zy7_mp.c Thu Feb 25 20:48:23 2016 (r296066) @@ -110,10 +110,3 @@ platform_mp_start_ap(void) /* Wake up CPU1. */ armv7_sev(); } - -void -platform_ipi_send(cpuset_t cpus, u_int ipi) -{ - - pic_ipi_send(cpus, ipi); -} From owner-svn-src-head@freebsd.org Thu Feb 25 21:04:53 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 81656AB4430; Thu, 25 Feb 2016 21:04:53 +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 mx1.freebsd.org (Postfix) with ESMTPS id 50C231EB9; Thu, 25 Feb 2016 21:04:53 +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 u1PL4qeP085834; Thu, 25 Feb 2016 21:04:52 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1PL4qAp085833; Thu, 25 Feb 2016 21:04:52 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201602252104.u1PL4qAp085833@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Thu, 25 Feb 2016 21:04:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r296067 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Feb 2016 21:04:53 -0000 Author: bdrewery Date: Thu Feb 25 21:04:52 2016 New Revision: 296067 URL: https://svnweb.freebsd.org/changeset/base/296067 Log: Slightly lessen the amount of job target output for SUBDIR_PARALLEL. Sponsored by: EMC / Isilon Storage Division Modified: head/share/mk/bsd.subdir.mk Modified: head/share/mk/bsd.subdir.mk ============================================================================== --- head/share/mk/bsd.subdir.mk Thu Feb 25 20:48:23 2016 (r296066) +++ head/share/mk/bsd.subdir.mk Thu Feb 25 21:04:52 2016 (r296067) @@ -152,7 +152,7 @@ __deps= __deps+= ${__target}_subdir_${DIRPRFX}${__dep} .endfor .endif -${__target}_subdir_${DIRPRFX}${__dir}: .PHONY .MAKE ${__deps} +${__target}_subdir_${DIRPRFX}${__dir}: .PHONY .MAKE .SILENT ${__deps} .if !defined(NO_SUBDIR) @${_+_}target=${__target:realinstall=install}; \ dir=${__dir}; \ From owner-svn-src-head@freebsd.org Thu Feb 25 21:05:06 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2965AAB4469; Thu, 25 Feb 2016 21:05:06 +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 mx1.freebsd.org (Postfix) with ESMTPS id D2B8A7F; Thu, 25 Feb 2016 21:05:05 +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 u1PL5495085896; Thu, 25 Feb 2016 21:05:04 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1PL54jw085892; Thu, 25 Feb 2016 21:05:04 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201602252105.u1PL54jw085892@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Thu, 25 Feb 2016 21:05:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r296068 - in head/share/i18n: csmapper esdb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Feb 2016 21:05:06 -0000 Author: bdrewery Date: Thu Feb 25 21:05:04 2016 New Revision: 296068 URL: https://svnweb.freebsd.org/changeset/base/296068 Log: Remove realall references from initial NetBSD import in r219019. We've never had a realall. Sponsored by: EMC / Isilon Storage Division Modified: head/share/i18n/csmapper/Makefile head/share/i18n/csmapper/Makefile.part head/share/i18n/esdb/Makefile head/share/i18n/esdb/Makefile.part Modified: head/share/i18n/csmapper/Makefile ============================================================================== --- head/share/i18n/csmapper/Makefile Thu Feb 25 21:04:52 2016 (r296067) +++ head/share/i18n/csmapper/Makefile Thu Feb 25 21:05:04 2016 (r296068) @@ -32,7 +32,6 @@ FILES+= charset.pivot charset.pivot.pvdb CLEANFILES+= charset.pivot charset.pivot.pvdb all: ${FILES} -realall: ${FILES} .include "./Makefile.inc" .include Modified: head/share/i18n/csmapper/Makefile.part ============================================================================== --- head/share/i18n/csmapper/Makefile.part Thu Feb 25 21:04:52 2016 (r296067) +++ head/share/i18n/csmapper/Makefile.part Thu Feb 25 21:05:04 2016 (r296068) @@ -73,7 +73,6 @@ FILES+= ${MAPS} CLEANFILES+= ${MAPS} .endif -realall: all all: ${FILES} mapper.dir.${ESUBDIR} charset.pivot.${ESUBDIR} .include "./Makefile.inc" Modified: head/share/i18n/esdb/Makefile ============================================================================== --- head/share/i18n/esdb/Makefile Thu Feb 25 21:04:52 2016 (r296067) +++ head/share/i18n/esdb/Makefile Thu Feb 25 21:05:04 2016 (r296068) @@ -29,7 +29,6 @@ esdb.alias.db: esdb.alias ${MKESDB} -m -o ${.TARGET} ${.ALLSRC} all: ${FILES} -realall: ${FILES} .include "./Makefile.inc" .include Modified: head/share/i18n/esdb/Makefile.part ============================================================================== --- head/share/i18n/esdb/Makefile.part Thu Feb 25 21:04:52 2016 (r296067) +++ head/share/i18n/esdb/Makefile.part Thu Feb 25 21:05:04 2016 (r296068) @@ -60,8 +60,7 @@ esdb.alias.${ESUBDIR}: ${PARTFILE} ${ALI .endfor echo >>${.TARGET} -all: realall -realall: esdb.dir.${ESUBDIR} esdb.alias.${ESUBDIR} codesets +all: esdb.dir.${ESUBDIR} esdb.alias.${ESUBDIR} codesets codesets: ${ESDB} .if !defined(NO_PREPROC) From owner-svn-src-head@freebsd.org Thu Feb 25 22:13:44 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E969FAB3F38; Thu, 25 Feb 2016 22:13:44 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BBF3D285; Thu, 25 Feb 2016 22:13:44 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1PMDhuh006317; Thu, 25 Feb 2016 22:13:43 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1PMDha4006316; Thu, 25 Feb 2016 22:13:43 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201602252213.u1PMDha4006316@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Thu, 25 Feb 2016 22:13:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r296070 - head/sys/arm/qemu X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Feb 2016 22:13:45 -0000 Author: andrew Date: Thu Feb 25 22:13:43 2016 New Revision: 296070 URL: https://svnweb.freebsd.org/changeset/base/296070 Log: Fix a mistake that crept in when moving between git and svn, pic_ipi_send should not be called from platform_mp_init_secondary. Sponsored by: ABT Systems Ltd Modified: head/sys/arm/qemu/virt_mp.c Modified: head/sys/arm/qemu/virt_mp.c ============================================================================== --- head/sys/arm/qemu/virt_mp.c Thu Feb 25 22:07:32 2016 (r296069) +++ head/sys/arm/qemu/virt_mp.c Thu Feb 25 22:13:43 2016 (r296070) @@ -103,5 +103,4 @@ platform_mp_init_secondary(void) { intr_pic_init_secondary(); - pic_ipi_send(cpus, ipi); } From owner-svn-src-head@freebsd.org Thu Feb 25 22:44:02 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1920DAB4A2A; Thu, 25 Feb 2016 22:44:02 +0000 (UTC) (envelope-from davidcs@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C18BA1483; Thu, 25 Feb 2016 22:44:01 +0000 (UTC) (envelope-from davidcs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1PMi0PJ015610; Thu, 25 Feb 2016 22:44:00 GMT (envelope-from davidcs@FreeBSD.org) Received: (from davidcs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1PMi0AZ015608; Thu, 25 Feb 2016 22:44:00 GMT (envelope-from davidcs@FreeBSD.org) Message-Id: <201602252244.u1PMi0AZ015608@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: davidcs set sender to davidcs@FreeBSD.org using -f From: David C Somayajulu Date: Thu, 25 Feb 2016 22:44:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r296071 - in head/sys: dev/bxe modules/bxe X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Feb 2016 22:44:02 -0000 Author: davidcs Date: Thu Feb 25 22:44:00 2016 New Revision: 296071 URL: https://svnweb.freebsd.org/changeset/base/296071 Log: Upgrade the firmware carried in driver and loaded during hardware initialization (a.k.a STORM firmware) to version 7.13.1 (latest version) Modified: head/sys/dev/bxe/57710_init_values.c head/sys/dev/bxe/57710_int_offsets.h head/sys/dev/bxe/57711_init_values.c head/sys/dev/bxe/57711_int_offsets.h head/sys/dev/bxe/57712_init_values.c head/sys/dev/bxe/57712_int_offsets.h head/sys/dev/bxe/bxe.c head/sys/dev/bxe/bxe.h head/sys/dev/bxe/bxe_elink.c head/sys/dev/bxe/bxe_elink.h head/sys/dev/bxe/bxe_stats.c head/sys/dev/bxe/ecore_fw_defs.h head/sys/dev/bxe/ecore_hsi.h head/sys/dev/bxe/ecore_init.h head/sys/dev/bxe/ecore_init_ops.h head/sys/dev/bxe/ecore_mfw_req.h head/sys/dev/bxe/ecore_reg.h head/sys/dev/bxe/ecore_sp.c head/sys/dev/bxe/ecore_sp.h head/sys/modules/bxe/Makefile Modified: head/sys/dev/bxe/57710_init_values.c ============================================================================== --- head/sys/dev/bxe/57710_init_values.c Thu Feb 25 22:13:43 2016 (r296070) +++ head/sys/dev/bxe/57710_init_values.c Thu Feb 25 22:44:00 2016 (r296071) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2007-2014 QLogic Corporation. All rights reserved. + * Copyright (c) 2007-2017 QLogic Corporation. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -11,7 +11,7 @@ * 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 COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS' + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS @@ -104,19 +104,19 @@ static const struct raw_op init_ops_e1[] /* #define CFC_COMMON_START 88 */ {OP_ZR, 0x104c00, 0x100}, {OP_WR, 0x104028, 0x10}, - {OP_WR, 0x104044, 0x3fff}, + {OP_SW, 0x104040, 0x20469}, {OP_WR, 0x104058, 0x280000}, {OP_WR, 0x104084, 0x84924a}, {OP_WR, 0x104058, 0x0}, /* #define CFC_COMMON_END 89 */ /* #define CSDM_COMMON_START 110 */ - {OP_SW, 0xc2008, 0x30469}, - {OP_SW, 0xc201c, 0x4046c}, - {OP_SW, 0xc2038, 0x110470}, + {OP_SW, 0xc2008, 0x3046b}, + {OP_SW, 0xc201c, 0x4046e}, + {OP_SW, 0xc2038, 0x110472}, {OP_ZR, 0xc207c, 0x4f}, - {OP_SW, 0xc21b8, 0x110481}, + {OP_SW, 0xc21b8, 0x110483}, {OP_ZR, 0xc21fc, 0xf}, - {OP_SW, 0xc2238, 0x40492}, + {OP_SW, 0xc2238, 0x40494}, {OP_RD, 0xc2248, 0x0}, {OP_RD, 0xc224c, 0x0}, {OP_RD, 0xc2250, 0x0}, @@ -141,76 +141,76 @@ static const struct raw_op init_ops_e1[] /* #define CSDM_COMMON_END 111 */ /* #define CSEM_COMMON_START 132 */ {OP_FW, 0x200400, 0xe00000}, - {OP_WR_64, 0x200780, 0x100496}, + {OP_WR_64, 0x200780, 0x100498}, {OP_ZR, 0x220000, 0x1600}, {OP_ZR, 0x228000, 0x40}, {OP_ZR, 0x223bd0, 0x8}, {OP_ZR, 0x224800, 0x6}, - {OP_SW, 0x224818, 0x40498}, + {OP_SW, 0x224818, 0x4049a}, {OP_ZR, 0x224828, 0xc}, - {OP_SW, 0x224858, 0x4049c}, + {OP_SW, 0x224858, 0x4049e}, {OP_ZR, 0x224868, 0xc}, - {OP_SW, 0x224898, 0x404a0}, + {OP_SW, 0x224898, 0x404a2}, {OP_ZR, 0x2248a8, 0xc}, - {OP_SW, 0x2248d8, 0x404a4}, + {OP_SW, 0x2248d8, 0x404a6}, {OP_ZR, 0x2248e8, 0xc}, - {OP_SW, 0x224918, 0x404a8}, + {OP_SW, 0x224918, 0x404aa}, {OP_ZR, 0x224928, 0xc}, - {OP_SW, 0x224958, 0x404ac}, + {OP_SW, 0x224958, 0x404ae}, {OP_ZR, 0x224968, 0xc}, - {OP_SW, 0x224998, 0x404b0}, + {OP_SW, 0x224998, 0x404b2}, {OP_ZR, 0x2249a8, 0xc}, - {OP_SW, 0x2249d8, 0x404b4}, + {OP_SW, 0x2249d8, 0x404b6}, {OP_ZR, 0x2249e8, 0xc}, - {OP_SW, 0x224a18, 0x404b8}, + {OP_SW, 0x224a18, 0x404ba}, {OP_ZR, 0x224a28, 0xc}, - {OP_SW, 0x224a58, 0x404bc}, + {OP_SW, 0x224a58, 0x404be}, {OP_ZR, 0x224a68, 0xc}, - {OP_SW, 0x224a98, 0x404c0}, + {OP_SW, 0x224a98, 0x404c2}, {OP_ZR, 0x224aa8, 0xc}, - {OP_SW, 0x224ad8, 0x404c4}, + {OP_SW, 0x224ad8, 0x404c6}, {OP_ZR, 0x224ae8, 0xc}, - {OP_SW, 0x224b18, 0x404c8}, + {OP_SW, 0x224b18, 0x404ca}, {OP_ZR, 0x224b28, 0xc}, - {OP_SW, 0x224b58, 0x404cc}, + {OP_SW, 0x224b58, 0x404ce}, {OP_ZR, 0x224b68, 0xc}, - {OP_SW, 0x224b98, 0x404d0}, + {OP_SW, 0x224b98, 0x404d2}, {OP_ZR, 0x224ba8, 0xc}, - {OP_SW, 0x224bd8, 0x404d4}, + {OP_SW, 0x224bd8, 0x404d6}, {OP_ZR, 0x224be8, 0xc}, - {OP_SW, 0x224c18, 0x404d8}, + {OP_SW, 0x224c18, 0x404da}, {OP_ZR, 0x224c28, 0xc}, - {OP_SW, 0x224c58, 0x404dc}, + {OP_SW, 0x224c58, 0x404de}, {OP_ZR, 0x224c68, 0xc}, - {OP_SW, 0x224c98, 0x404e0}, + {OP_SW, 0x224c98, 0x404e2}, {OP_ZR, 0x224ca8, 0xc}, - {OP_SW, 0x224cd8, 0x404e4}, + {OP_SW, 0x224cd8, 0x404e6}, {OP_ZR, 0x224ce8, 0xc}, - {OP_SW, 0x224d18, 0x404e8}, + {OP_SW, 0x224d18, 0x404ea}, {OP_ZR, 0x224d28, 0xc}, - {OP_SW, 0x224d58, 0x404ec}, + {OP_SW, 0x224d58, 0x404ee}, {OP_ZR, 0x224d68, 0xc}, - {OP_SW, 0x224d98, 0x404f0}, + {OP_SW, 0x224d98, 0x404f2}, {OP_ZR, 0x224da8, 0xc}, - {OP_SW, 0x224dd8, 0x404f4}, + {OP_SW, 0x224dd8, 0x404f6}, {OP_ZR, 0x224de8, 0xc}, - {OP_SW, 0x224e18, 0x404f8}, + {OP_SW, 0x224e18, 0x404fa}, {OP_ZR, 0x224e28, 0xc}, - {OP_SW, 0x224e58, 0x404fc}, + {OP_SW, 0x224e58, 0x404fe}, {OP_ZR, 0x224e68, 0xc}, - {OP_SW, 0x224e98, 0x40500}, + {OP_SW, 0x224e98, 0x40502}, {OP_ZR, 0x224ea8, 0xc}, - {OP_SW, 0x224ed8, 0x40504}, + {OP_SW, 0x224ed8, 0x40506}, {OP_ZR, 0x224ee8, 0xc}, - {OP_SW, 0x224f18, 0x40508}, + {OP_SW, 0x224f18, 0x4050a}, {OP_ZR, 0x224f28, 0xc}, - {OP_SW, 0x224f58, 0x4050c}, + {OP_SW, 0x224f58, 0x4050e}, {OP_ZR, 0x224f68, 0xc}, - {OP_SW, 0x224f98, 0x40510}, + {OP_SW, 0x224f98, 0x40512}, {OP_ZR, 0x224fa8, 0xc}, - {OP_SW, 0x224fd8, 0x40514}, + {OP_SW, 0x224fd8, 0x40516}, {OP_ZR, 0x224fe8, 0x6}, - {OP_SW, 0x225198, 0x40518}, + {OP_SW, 0x225198, 0x4051a}, {OP_WR, 0x238000, 0x10}, {OP_WR, 0x238040, 0x12}, {OP_WR, 0x238080, 0x30}, @@ -227,16 +227,16 @@ static const struct raw_op init_ops_e1[] {OP_IF_MODE_AND, 2, 0x4}, /* emul */ {OP_WR, 0x238300, 0x138}, {OP_WR, 0x238340, 0x0}, - {OP_FW, 0x240000, 0x27300000}, - {OP_WR_64, 0x249cc0, 0x6ace051c}, + {OP_FW, 0x240000, 0x22600000}, + {OP_WR_64, 0x248980, 0x6d36051e}, {OP_RD, 0x200000, 0x0}, {OP_RD, 0x200004, 0x0}, {OP_RD, 0x200008, 0x0}, {OP_RD, 0x20000c, 0x0}, {OP_RD, 0x200010, 0x0}, {OP_RD, 0x200014, 0x0}, - {OP_SW, 0x200020, 0x1a051e}, - {OP_SW, 0x2000a4, 0x20538}, + {OP_SW, 0x200020, 0x1a0520}, + {OP_SW, 0x2000a4, 0x2053a}, {OP_WR, 0x200224, 0x0}, {OP_WR, 0x200234, 0x0}, {OP_WR, 0x20024c, 0x0}, @@ -259,17 +259,17 @@ static const struct raw_op init_ops_e1[] /* #define CSEM_PORT1_END 137 */ /* #define DMAE_COMMON_START 176 */ {OP_ZR, 0x102400, 0xe0}, - {OP_SW, 0x10201c, 0x2053a}, + {OP_SW, 0x10201c, 0x2053c}, {OP_WR, 0x1020c0, 0x1}, - {OP_SW, 0x102004, 0x2053c}, + {OP_SW, 0x102004, 0x2053e}, /* #define DMAE_COMMON_END 177 */ /* #define DORQ_COMMON_START 198 */ {OP_WR, 0x170008, 0x2}, {OP_WR, 0x17002c, 0x3}, - {OP_SW, 0x170038, 0x2053e}, - {OP_SW, 0x170044, 0x60540}, - {OP_SW, 0x170060, 0x50546}, - {OP_SW, 0x170078, 0x2054b}, + {OP_SW, 0x170038, 0x20540}, + {OP_SW, 0x170044, 0x60542}, + {OP_SW, 0x170060, 0x50548}, + {OP_SW, 0x170078, 0x2054d}, {OP_WR, 0x170004, 0xf}, /* #define DORQ_COMMON_END 199 */ /* #define HC_COMMON_START 220 */ @@ -280,7 +280,7 @@ static const struct raw_op init_ops_e1[] {OP_ZR, 0x108040, 0x2}, {OP_ZR, 0x108028, 0x2}, {OP_WR, 0x108038, 0x10}, - {OP_SW, 0x108040, 0x2054d}, + {OP_SW, 0x108040, 0x2054f}, {OP_WR, 0x108050, 0x0}, {OP_WR, 0x108100, 0x0}, {OP_ZR, 0x108120, 0x2}, @@ -300,7 +300,7 @@ static const struct raw_op init_ops_e1[] {OP_ZR, 0x108048, 0x2}, {OP_ZR, 0x108030, 0x2}, {OP_WR, 0x10803c, 0x10}, - {OP_SW, 0x108048, 0x2054f}, + {OP_SW, 0x108048, 0x20551}, {OP_WR, 0x108054, 0x0}, {OP_WR, 0x108104, 0x0}, {OP_ZR, 0x108128, 0x2}, @@ -318,13 +318,13 @@ static const struct raw_op init_ops_e1[] /* #define MISC_COMMON_START 264 */ {OP_WR, 0xa468, 0xaffdc}, {OP_WR, 0xa280, 0x1}, - {OP_SW, 0xa294, 0x40551}, + {OP_SW, 0xa294, 0x40553}, {OP_WR, 0xa4fc, 0xff000000}, /* #define MISC_COMMON_END 265 */ /* #define NIG_COMMON_START 286 */ - {OP_SW, 0x100b4, 0x20555}, + {OP_SW, 0x100b4, 0x20557}, {OP_WR, 0x100dc, 0x1}, - {OP_SW, 0x10100, 0x20557}, + {OP_SW, 0x10100, 0x20559}, /* #define NIG_COMMON_END 287 */ /* #define NIG_PORT0_START 288 */ {OP_WR, 0x1007c, 0x300000}, @@ -355,7 +355,7 @@ static const struct raw_op init_ops_e1[] /* #define PBF_COMMON_START 308 */ {OP_WR, 0x140000, 0x1}, {OP_WR, 0x14000c, 0x1}, - {OP_SW, 0x140040, 0x20559}, + {OP_SW, 0x140040, 0x2055b}, {OP_WR, 0x14000c, 0x0}, {OP_WR, 0x140000, 0x0}, {OP_WR, 0x14006c, 0x0}, @@ -373,16 +373,16 @@ static const struct raw_op init_ops_e1[] {OP_WR, 0x140060, 0x0}, /* #define PBF_PORT1_END 313 */ /* #define PRS_COMMON_START 352 */ - {OP_SW, 0x40004, 0x12055b}, - {OP_SW, 0x40054, 0x3056d}, + {OP_SW, 0x40004, 0x12055d}, + {OP_SW, 0x40054, 0x3056f}, {OP_WR, 0x40070, 0x4}, - {OP_SW, 0x40078, 0x40570}, + {OP_SW, 0x40078, 0x40572}, {OP_ZR, 0x40088, 0x5}, - {OP_SW, 0x4009c, 0x30574}, + {OP_SW, 0x4009c, 0x30576}, {OP_ZR, 0x400a8, 0x4}, - {OP_SW, 0x400b8, 0x50577}, + {OP_SW, 0x400b8, 0x50579}, {OP_ZR, 0x400cc, 0x4}, - {OP_SW, 0x400dc, 0x4057c}, + {OP_SW, 0x400dc, 0x4057e}, {OP_ZR, 0x400ec, 0x4}, {OP_RD, 0x40124, 0x0}, {OP_RD, 0x40128, 0x0}, @@ -391,67 +391,67 @@ static const struct raw_op init_ops_e1[] {OP_WR, 0x40134, 0xf}, /* #define PRS_COMMON_END 353 */ /* #define PXP2_COMMON_START 374 */ - {OP_SW, 0x120490, 0x220580}, + {OP_SW, 0x120490, 0x220582}, {OP_WR, 0x120520, 0x2}, {OP_WR, 0x120388, 0x64}, {OP_WR, 0x120390, 0x8}, - {OP_SW, 0x12039c, 0x305a2}, + {OP_SW, 0x12039c, 0x305a4}, {OP_WR, 0x1203bc, 0x4}, {OP_WR, 0x1203c4, 0x4}, {OP_WR, 0x1203d0, 0x0}, {OP_WR, 0x1203dc, 0x0}, {OP_WR, 0x12036c, 0x1}, {OP_WR, 0x120368, 0x3f}, - {OP_SW, 0x1201bc, 0x3c05a5}, - {OP_SW, 0x1202b0, 0x205e1}, - {OP_SW, 0x120324, 0x205e3}, + {OP_SW, 0x1201bc, 0x3c05a7}, + {OP_SW, 0x1202b0, 0x205e3}, + {OP_SW, 0x120324, 0x205e5}, {OP_WR, 0x1201b0, 0x1}, /* #define PXP2_COMMON_END 375 */ /* #define PXP_COMMON_START 396 */ - {OP_WB, 0x103800, 0x505e5}, - {OP_WB, 0x103c00, 0x505ea}, - {OP_WB, 0x103c20, 0x505ef}, + {OP_WB, 0x103800, 0x505e7}, + {OP_WB, 0x103c00, 0x505ec}, + {OP_WB, 0x103c20, 0x505f1}, /* #define PXP_COMMON_END 397 */ /* #define QM_COMMON_START 418 */ - {OP_SW, 0x168030, 0x805f4}, + {OP_SW, 0x168030, 0x805f6}, {OP_WR, 0x168054, 0x2}, - {OP_SW, 0x168060, 0x505fc}, + {OP_SW, 0x168060, 0x505fe}, {OP_ZR, 0x168074, 0x7}, - {OP_SW, 0x168090, 0x20601}, - {OP_SW, 0x16809c, 0x50603}, + {OP_SW, 0x168090, 0x20603}, + {OP_SW, 0x16809c, 0x50605}, {OP_ZR, 0x1680b0, 0x7}, - {OP_SW, 0x1680cc, 0x80608}, + {OP_SW, 0x1680cc, 0x8060a}, {OP_WR, 0x1680f0, 0x7}, {OP_ZR, 0x1680f4, 0xc}, - {OP_SW, 0x168124, 0x40610}, + {OP_SW, 0x168124, 0x40612}, {OP_ZR, 0x168134, 0xc}, - {OP_SW, 0x168164, 0x3b0614}, + {OP_SW, 0x168164, 0x3b0616}, {OP_ZR, 0x168250, 0x4}, - {OP_SW, 0x168260, 0x2064f}, + {OP_SW, 0x168260, 0x20651}, {OP_ZR, 0x168268, 0x8}, - {OP_SW, 0x168288, 0x80651}, + {OP_SW, 0x168288, 0x80653}, {OP_ZR, 0x1682a8, 0xa}, {OP_WR, 0x168804, 0x4}, - {OP_SW, 0x16880c, 0x100659}, + {OP_SW, 0x16880c, 0x10065b}, {OP_WR, 0x1680ec, 0xff}, /* #define QM_COMMON_END 419 */ /* #define SRC_COMMON_START 440 */ - {OP_SW, 0x40408, 0x140669}, + {OP_SW, 0x40408, 0x14066b}, /* #define SRC_COMMON_END 441 */ /* #define TCM_COMMON_START 462 */ - {OP_SW, 0x50044, 0x2067d}, - {OP_SW, 0x50050, 0x4067f}, + {OP_SW, 0x50044, 0x2067f}, + {OP_SW, 0x50050, 0x40681}, {OP_ZR, 0x50060, 0x4}, - {OP_SW, 0x50090, 0x130683}, + {OP_SW, 0x50090, 0x130685}, {OP_WR, 0x50114, 0x1}, - {OP_SW, 0x5011c, 0x20696}, + {OP_SW, 0x5011c, 0x20698}, {OP_WR, 0x50204, 0x1}, - {OP_SW, 0x5020c, 0x20698}, - {OP_SW, 0x5021c, 0x3069a}, + {OP_SW, 0x5020c, 0x2069a}, + {OP_SW, 0x5021c, 0x3069c}, {OP_ZR, 0x50240, 0xa}, - {OP_SW, 0x50280, 0x20069d}, + {OP_SW, 0x50280, 0x20069f}, {OP_ZR, 0x54000, 0xd00}, - {OP_SW, 0x50004, 0x1006bd}, + {OP_SW, 0x50004, 0x1006bf}, /* #define TCM_COMMON_END 463 */ /* #define TCM_PORT0_START 464 */ {OP_WR, 0x500e0, 0xe}, @@ -461,7 +461,7 @@ static const struct raw_op init_ops_e1[] /* #define TCM_PORT1_END 467 */ /* #define TM_COMMON_START 484 */ {OP_ZR, 0x164024, 0x2}, - {OP_SW, 0x164030, 0x306cd}, + {OP_SW, 0x164030, 0x306cf}, {OP_WR, 0x164044, 0x20}, {OP_WR, 0x164070, 0x1c}, {OP_WR, 0x164208, 0x1}, @@ -479,7 +479,7 @@ static const struct raw_op init_ops_e1[] {OP_WR, 0x16401c, 0x9c}, {OP_WR, 0x164000, 0x1}, {OP_WR, 0x1640d8, 0x1}, - {OP_SW, 0x164008, 0x306d0}, + {OP_SW, 0x164008, 0x306d2}, /* #define TM_COMMON_END 485 */ /* #define TM_PORT0_START 486 */ {OP_WR, 0x164240, 0x0}, @@ -492,10 +492,10 @@ static const struct raw_op init_ops_e1[] {OP_WB_ZR, 0x164280, 0x2}, /* #define TM_PORT1_END 489 */ /* #define TSDM_COMMON_START 506 */ - {OP_SW, 0x42008, 0x406d3}, - {OP_SW, 0x4201c, 0x406d7}, + {OP_SW, 0x42008, 0x406d5}, + {OP_SW, 0x4201c, 0x406d9}, {OP_ZR, 0x42038, 0x80}, - {OP_SW, 0x42238, 0x406db}, + {OP_SW, 0x42238, 0x406dd}, {OP_RD, 0x42248, 0x0}, {OP_RD, 0x4224c, 0x0}, {OP_RD, 0x42250, 0x0}, @@ -520,17 +520,17 @@ static const struct raw_op init_ops_e1[] /* #define TSDM_COMMON_END 507 */ /* #define TSEM_COMMON_START 528 */ {OP_FW, 0x180400, 0xd80000}, - {OP_WR_64, 0x180760, 0x1406df}, + {OP_WR_64, 0x180760, 0x1406e1}, {OP_ZR, 0x1a0000, 0x1600}, {OP_ZR, 0x1a8000, 0x40}, - {OP_SW, 0x1a08b0, 0x206e1}, - {OP_SW, 0x1a19c8, 0x206e3}, - {OP_SW, 0x1a2fc0, 0x406e5}, + {OP_SW, 0x1a08b0, 0x206e3}, + {OP_SW, 0x1a19c8, 0x206e5}, + {OP_SW, 0x1a2fc0, 0x406e7}, {OP_ZR, 0x1a2fd0, 0x6}, - {OP_SW, 0x1a2fe8, 0x206e9}, - {OP_SW, 0x1a3000, 0x3f906eb}, + {OP_SW, 0x1a2fe8, 0x206eb}, + {OP_SW, 0x1a3000, 0x3f906ed}, {OP_ZR, 0x1a3fe4, 0x7}, - {OP_SW, 0x1a4870, 0x40ae4}, + {OP_SW, 0x1a4870, 0x40ae6}, {OP_WR, 0x1b8000, 0x34}, {OP_WR, 0x1b8040, 0x18}, {OP_WR, 0x1b8080, 0xc}, @@ -547,16 +547,16 @@ static const struct raw_op init_ops_e1[] {OP_IF_MODE_AND, 2, 0x4}, /* emul */ {OP_WR, 0x1b8300, 0x138}, {OP_WR, 0x1b8340, 0x0}, - {OP_FW, 0x1c0000, 0x535c0000}, - {OP_WR_64, 0x1d4d70, 0x56520ae8}, + {OP_FW, 0x1c0000, 0x48600000}, + {OP_WR_64, 0x1d2180, 0x5bd00aea}, {OP_RD, 0x180000, 0x0}, {OP_RD, 0x180004, 0x0}, {OP_RD, 0x180008, 0x0}, {OP_RD, 0x18000c, 0x0}, {OP_RD, 0x180010, 0x0}, {OP_RD, 0x180014, 0x0}, - {OP_SW, 0x180020, 0x1a0aea}, - {OP_SW, 0x1800a4, 0x20b04}, + {OP_SW, 0x180020, 0x1a0aec}, + {OP_SW, 0x1800a4, 0x20b06}, {OP_WR, 0x180224, 0x0}, {OP_WR, 0x180234, 0x0}, {OP_WR, 0x18024c, 0x0}, @@ -570,11 +570,11 @@ static const struct raw_op init_ops_e1[] {OP_ZR, 0x1a2500, 0x10}, {OP_ZR, 0x1a2580, 0x12}, {OP_ZR, 0x1a2610, 0x12}, - {OP_SW, 0x1a2fb0, 0x20b06}, + {OP_SW, 0x1a2fb0, 0x20b08}, {OP_ZR, 0x1a4000, 0x6}, {OP_ZR, 0x1a4030, 0x2}, {OP_ZR, 0x1a4820, 0x2}, - {OP_SW, 0x1a4c50, 0x20b08}, + {OP_SW, 0x1a4c50, 0x20b0a}, /* #define TSEM_PORT0_END 531 */ /* #define TSEM_PORT1_START 532 */ {OP_ZR, 0x1a0810, 0x2}, @@ -583,26 +583,26 @@ static const struct raw_op init_ops_e1[] {OP_ZR, 0x1a2540, 0x10}, {OP_ZR, 0x1a25c8, 0x12}, {OP_ZR, 0x1a2658, 0x12}, - {OP_SW, 0x1a2fb8, 0x20b0a}, + {OP_SW, 0x1a2fb8, 0x20b0c}, {OP_ZR, 0x1a4018, 0x6}, {OP_ZR, 0x1a4038, 0x2}, {OP_ZR, 0x1a4828, 0x2}, - {OP_SW, 0x1a4c58, 0x20b0c}, + {OP_SW, 0x1a4c58, 0x20b0e}, /* #define TSEM_PORT1_END 533 */ /* #define UCM_COMMON_START 550 */ {OP_WR, 0xe004c, 0x32}, - {OP_SW, 0xe0054, 0x40b0e}, + {OP_SW, 0xe0054, 0x40b10}, {OP_ZR, 0xe0064, 0x4}, - {OP_SW, 0xe0094, 0x130b12}, + {OP_SW, 0xe0094, 0x130b14}, {OP_WR, 0xe0144, 0x1}, - {OP_SW, 0xe014c, 0x20b25}, + {OP_SW, 0xe014c, 0x20b27}, {OP_WR, 0xe0204, 0x1}, - {OP_SW, 0xe020c, 0x20b27}, - {OP_SW, 0xe021c, 0x40b29}, - {OP_SW, 0xe0280, 0x1b0b2d}, + {OP_SW, 0xe020c, 0x20b29}, + {OP_SW, 0xe021c, 0x40b2b}, + {OP_SW, 0xe0280, 0x1b0b2f}, {OP_ZR, 0xe02ec, 0x17}, {OP_ZR, 0xe2000, 0x800}, - {OP_SW, 0xe0004, 0x110b48}, + {OP_SW, 0xe0004, 0x110b4a}, /* #define UCM_COMMON_END 551 */ /* #define UCM_PORT0_START 552 */ {OP_WR, 0xe0110, 0xf}, @@ -614,13 +614,13 @@ static const struct raw_op init_ops_e1[] {OP_WR, 0xc1000, 0x28}, /* #define UPB_COMMON_END 573 */ /* #define USDM_COMMON_START 594 */ - {OP_SW, 0xc4008, 0x40b59}, - {OP_SW, 0xc401c, 0x40b5d}, - {OP_SW, 0xc4038, 0x20b61}, + {OP_SW, 0xc4008, 0x40b5b}, + {OP_SW, 0xc401c, 0x40b5f}, + {OP_SW, 0xc4038, 0x20b63}, {OP_ZR, 0xc4040, 0x5e}, {OP_WR, 0xc41b8, 0x1}, {OP_ZR, 0xc41bc, 0x1f}, - {OP_SW, 0xc4238, 0x40b63}, + {OP_SW, 0xc4238, 0x40b65}, {OP_RD, 0xc4248, 0x0}, {OP_RD, 0xc424c, 0x0}, {OP_RD, 0xc4250, 0x0}, @@ -646,13 +646,13 @@ static const struct raw_op init_ops_e1[] /* #define USDM_COMMON_END 595 */ /* #define USEM_COMMON_START 616 */ {OP_FW, 0x300400, 0xda0000}, - {OP_WR_64, 0x300768, 0x130b67}, + {OP_WR_64, 0x300768, 0x130b69}, {OP_ZR, 0x320000, 0x1600}, {OP_ZR, 0x328000, 0x40}, - {OP_SW, 0x321830, 0x20b69}, - {OP_SW, 0x322e70, 0x40b6b}, + {OP_SW, 0x321830, 0x20b6b}, + {OP_SW, 0x322e70, 0x40b6d}, {OP_ZR, 0x325080, 0x8}, - {OP_SW, 0x3250a0, 0x20b6f}, + {OP_SW, 0x3250a0, 0x20b71}, {OP_WR, 0x338000, 0x1a}, {OP_WR, 0x338040, 0x4e}, {OP_WR, 0x338080, 0x10}, @@ -669,16 +669,16 @@ static const struct raw_op init_ops_e1[] {OP_IF_MODE_AND, 2, 0x4}, /* emul */ {OP_WR, 0x338300, 0x138}, {OP_WR, 0x338340, 0x0}, - {OP_FW, 0x340000, 0x59440000}, - {OP_WR_64, 0x356510, 0x535e0b71}, + {OP_FW, 0x340000, 0x88540000}, + {OP_WR_64, 0x362150, 0x3bd60b73}, {OP_RD, 0x300000, 0x0}, {OP_RD, 0x300004, 0x0}, {OP_RD, 0x300008, 0x0}, {OP_RD, 0x30000c, 0x0}, {OP_RD, 0x300010, 0x0}, {OP_RD, 0x300014, 0x0}, - {OP_SW, 0x300020, 0x1a0b73}, - {OP_SW, 0x3000a4, 0x20b8d}, + {OP_SW, 0x300020, 0x1a0b75}, + {OP_SW, 0x3000a4, 0x20b8f}, {OP_WR, 0x300224, 0x0}, {OP_WR, 0x300234, 0x0}, {OP_WR, 0x30024c, 0x0}, @@ -733,23 +733,23 @@ static const struct raw_op init_ops_e1[] /* #define USEM_PORT1_END 621 */ /* #define XCM_COMMON_START 638 */ {OP_WR, 0x20058, 0x32}, - {OP_SW, 0x20060, 0x40b8f}, + {OP_SW, 0x20060, 0x40b91}, {OP_ZR, 0x20070, 0x4}, - {OP_SW, 0x200a0, 0xe0b93}, - {OP_SW, 0x200dc, 0x70ba1}, + {OP_SW, 0x200a0, 0xe0b95}, + {OP_SW, 0x200dc, 0x70ba3}, {OP_WR, 0x200fc, 0x6}, {OP_WR, 0x20120, 0x0}, {OP_WR, 0x20134, 0x2}, {OP_WR, 0x201b0, 0x1}, {OP_WR, 0x2020c, 0x1}, - {OP_SW, 0x20214, 0x20ba8}, + {OP_SW, 0x20214, 0x20baa}, {OP_WR, 0x20404, 0x1}, - {OP_SW, 0x2040c, 0x20baa}, - {OP_SW, 0x2041c, 0x40bac}, - {OP_SW, 0x20480, 0x1f0bb0}, + {OP_SW, 0x2040c, 0x20bac}, + {OP_SW, 0x2041c, 0x40bae}, + {OP_SW, 0x20480, 0x1f0bb2}, {OP_ZR, 0x204fc, 0x13}, {OP_ZR, 0x28000, 0x2000}, - {OP_SW, 0x20004, 0x140bcf}, + {OP_SW, 0x20004, 0x140bd1}, /* #define XCM_COMMON_END 639 */ /* #define XCM_PORT0_START 640 */ {OP_WR, 0x20108, 0xc8}, @@ -775,15 +775,15 @@ static const struct raw_op init_ops_e1[] {OP_WR, 0x161000, 0x28}, /* #define XPB_COMMON_END 661 */ /* #define XSDM_COMMON_START 682 */ - {OP_SW, 0x166008, 0x30be3}, - {OP_SW, 0x16601c, 0x40be6}, - {OP_SW, 0x166038, 0xd0bea}, + {OP_SW, 0x166008, 0x30be5}, + {OP_SW, 0x16601c, 0x40be8}, + {OP_SW, 0x166038, 0xd0bec}, {OP_ZR, 0x16606c, 0x13}, - {OP_SW, 0x1660b8, 0x20bf7}, + {OP_SW, 0x1660b8, 0x20bf9}, {OP_ZR, 0x1660c0, 0x3e}, {OP_WR, 0x1661b8, 0x1}, {OP_ZR, 0x1661bc, 0x1f}, - {OP_SW, 0x166238, 0x40bf9}, + {OP_SW, 0x166238, 0x40bfb}, {OP_RD, 0x166248, 0x0}, {OP_RD, 0x16624c, 0x0}, {OP_RD, 0x166250, 0x0}, @@ -808,19 +808,19 @@ static const struct raw_op init_ops_e1[] /* #define XSDM_COMMON_END 683 */ /* #define XSEM_COMMON_START 704 */ {OP_FW, 0x280400, 0xda0000}, - {OP_WR_64, 0x280768, 0x130bfd}, + {OP_WR_64, 0x280768, 0x130bff}, {OP_ZR, 0x2a0000, 0x1600}, {OP_ZR, 0x2a8000, 0x40}, - {OP_SW, 0x2a2500, 0x20bff}, - {OP_SW, 0x2a2960, 0x40c01}, - {OP_SW, 0x2a2f48, 0x20c05}, - {OP_SW, 0x2a3368, 0x20c07}, - {OP_SW, 0x2a3920, 0x20c09}, - {OP_SW, 0x2a3930, 0x20c0b}, - {OP_SW, 0x2a3ac8, 0x20c0d}, + {OP_SW, 0x2a2500, 0x20c01}, + {OP_SW, 0x2a2960, 0x40c03}, + {OP_SW, 0x2a2f48, 0x20c07}, + {OP_SW, 0x2a3368, 0x20c09}, + {OP_SW, 0x2a3920, 0x20c0b}, + {OP_SW, 0x2a3930, 0x20c0d}, + {OP_SW, 0x2a3ac8, 0x20c0f}, {OP_ZR, 0x2a3ad0, 0x6}, - {OP_SW, 0x2a3b98, 0x20c0f}, - {OP_SW, 0x2a3c20, 0x40c11}, + {OP_SW, 0x2a3b98, 0x20c11}, + {OP_SW, 0x2a3c20, 0x40c13}, {OP_WR, 0x2a3cd0, 0x0}, {OP_WR, 0x2b8000, 0x0}, {OP_WR, 0x2b8040, 0x18}, @@ -840,16 +840,16 @@ static const struct raw_op init_ops_e1[] {OP_WR, 0x2b8340, 0x0}, {OP_IF_MODE_AND, 1, 0x20}, /* port2 */ {OP_WR, 0x2a3cd4, 0x0}, - {OP_FW, 0x2c0000, 0x6c0c0000}, - {OP_WR_64, 0x2db030, 0x49fa0c15}, + {OP_FW, 0x2c0000, 0x64e40000}, + {OP_WR_64, 0x2d9390, 0x4d8e0c17}, {OP_RD, 0x280000, 0x0}, {OP_RD, 0x280004, 0x0}, {OP_RD, 0x280008, 0x0}, {OP_RD, 0x28000c, 0x0}, {OP_RD, 0x280010, 0x0}, {OP_RD, 0x280014, 0x0}, - {OP_SW, 0x280020, 0x1a0c17}, - {OP_SW, 0x2800a4, 0x20c31}, + {OP_SW, 0x280020, 0x1a0c19}, + {OP_SW, 0x2800a4, 0x20c33}, {OP_WR, 0x280224, 0x0}, {OP_WR, 0x280234, 0x0}, {OP_WR, 0x28024c, 0x0}, @@ -860,8 +860,8 @@ static const struct raw_op init_ops_e1[] {OP_ZR, 0x2a3910, 0x2}, {OP_ZR, 0x2a3938, 0x20}, {OP_ZR, 0x2a3a38, 0x10}, - {OP_SW, 0x2a3ae8, 0x20c33}, - {OP_SW, 0x2a3af8, 0x100c35}, + {OP_SW, 0x2a3ae8, 0x20c35}, + {OP_SW, 0x2a3af8, 0x100c37}, {OP_ZR, 0x2a3c30, 0x2}, {OP_ZR, 0x2a5000, 0x2}, {OP_ZR, 0x2a5010, 0x2}, @@ -874,8 +874,8 @@ static const struct raw_op init_ops_e1[] {OP_ZR, 0x2a3918, 0x2}, {OP_ZR, 0x2a39b8, 0x20}, {OP_ZR, 0x2a3a78, 0x10}, - {OP_SW, 0x2a3af0, 0x20c45}, - {OP_SW, 0x2a3b38, 0x100c47}, + {OP_SW, 0x2a3af0, 0x20c47}, + {OP_SW, 0x2a3b38, 0x100c49}, {OP_ZR, 0x2a3c38, 0x2}, {OP_ZR, 0x2a5008, 0x2}, {OP_ZR, 0x2a5018, 0x2}, @@ -888,20 +888,20 @@ static const struct raw_op init_ops_e1[] {OP_ZR, 0xa000, 0x16}, /* #define MISC_AEU_COMMON_END 727 */ /* #define MISC_AEU_PORT0_START 728 */ - {OP_SW, 0xa06c, 0x60c57}, + {OP_SW, 0xa06c, 0x60c59}, {OP_ZR, 0xa084, 0x5}, {OP_WR, 0xa098, 0xfe00000}, {OP_ZR, 0xa09c, 0x14}, - {OP_SW, 0xa0ec, 0x80c5d}, + {OP_SW, 0xa0ec, 0x80c5f}, {OP_ZR, 0xa22c, 0x4}, {OP_WR, 0xa060, 0x307}, /* #define MISC_AEU_PORT0_END 729 */ /* #define MISC_AEU_PORT1_START 730 */ - {OP_SW, 0xa10c, 0x60c65}, + {OP_SW, 0xa10c, 0x60c67}, {OP_ZR, 0xa124, 0x5}, {OP_WR, 0xa138, 0xfe00000}, {OP_ZR, 0xa13c, 0x14}, - {OP_SW, 0xa18c, 0x80c6b}, + {OP_SW, 0xa18c, 0x80c6d}, {OP_ZR, 0xa23c, 0x4}, {OP_WR, 0xa064, 0x307}, /* #define MISC_AEU_PORT1_END 731 */ @@ -1183,14 +1183,15 @@ static const uint32_t init_data_e1[] = { 0x00000000, 0x00100000, 0x00000000, 0xffffffff, 0x00cfffff, 0x00000000, 0x00000000, 0x000000cc, 0x00000000, 0x00200000, 0x00000000, 0xffffffff, 0x00cfffff, 0x00000000, 0x00000000, 0x000000cc, 0x00000000, 0x00400000, - 0x00000000, 0x00000a11, 0x00000a00, 0x00000a04, 0x0000ffff, 0x0000ffff, - 0x0000ffff, 0x0000ffff, 0x00000020, 0x00000021, 0x00000022, 0x00000023, - 0x00000024, 0x00000025, 0x00000026, 0x00000027, 0x00000028, 0x00000029, - 0x0000002a, 0x0000002b, 0x0000002c, 0x0000002d, 0x0000002e, 0x0000002f, - 0x00000010, 0x00000001, 0x00000001, 0x00000001, 0x00000001, 0x00000001, + 0x00000000, 0x00000200, 0x00003dff, 0x00000a11, 0x00000a00, 0x00000a04, + 0x0000ffff, 0x0000ffff, 0x0000ffff, 0x0000ffff, 0x00000020, 0x00000021, + 0x00000022, 0x00000023, 0x00000024, 0x00000025, 0x00000026, 0x00000027, + 0x00000028, 0x00000029, 0x0000002a, 0x0000002b, 0x0000002c, 0x0000002d, + 0x0000002e, 0x0000002f, 0x00000010, 0x00000001, 0x00000001, 0x00000001, 0x00000001, 0x00000001, 0x00000001, 0x00000001, 0x00000001, 0x00000001, 0x00000001, 0x00000001, 0x00000001, 0x00000001, 0x00000001, 0x00000001, - 0x07ffffff, 0x0000003f, 0x07ffffff, 0x0000000f, 0x00007ff8, 0x00007ff8, + 0x00000001, 0x00000001, 0x07ffffff, 0x0000003f, 0x07ffffff, 0x0000000f, + 0x00007ff8, 0x00007ff8, 0x0000ff1c, 0x0fffffff, 0x0000ff1c, 0x0fffffff, 0x0000ff1c, 0x0fffffff, 0x0000ff1c, 0x0fffffff, 0x0000ff1c, 0x0fffffff, 0x0000ff1c, 0x0fffffff, 0x0000ff1c, 0x0fffffff, 0x0000ff1c, 0x0fffffff, 0x0000ff1c, 0x0fffffff, 0x0000ff1c, 0x0fffffff, 0x0000ff1c, 0x0fffffff, @@ -1211,347 +1212,346 @@ static const uint32_t init_data_e1[] = { 0x0000ff1c, 0x0fffffff, 0x0000ff1c, 0x0fffffff, 0x0000ff1c, 0x0fffffff, 0x0000ff1c, 0x0fffffff, 0x0000ff1c, 0x0fffffff, 0x0000ff1c, 0x0fffffff, 0x0000ff1c, 0x0fffffff, 0x0000ff1c, 0x0fffffff, 0x0000ff1c, 0x0fffffff, - 0x0000ff1c, 0x0fffffff, 0x0000ff1c, 0x0fffffff, 0x0000ff1c, 0x0fffffff, - 0x0000ff1c, 0x0fffffff, 0x0000ff00, 0x00000000, 0x0000ff00, 0x00000000, - 0x00000312, 0x00003500, 0x00000001, 0x00000002, 0x00000003, 0x00000000, - 0x00000004, 0x00000001, 0x00000000, 0x00000001, 0x00000004, 0x00000000, - 0x00000001, 0x00000003, 0x00000000, 0x00000001, 0x00000004, 0x00000000, - 0x00000001, 0x00000003, 0x00000000, 0x00000001, 0x00000004, 0x00000000, - 0x00000004, 0x00000003, 0x00000000, 0x00000000, 0x00003fff, 0x000003ff, - 0x00000000, 0x00000001, 0x00000001, 0x00000001, 0x007c1004, 0x00000004, - 0x00000000, 0x00000002, 0x00000090, 0x00000090, 0x00800090, 0x08100000, - 0x0000008a, 0x00000080, 0x00000081, 0x00000080, 0x00000006, 0x000007d0, - 0x0000076c, 0x0000ffff, 0x0000ffff, 0x0000ffff, 0x0000ffff, 0x071d2911, - 0x00000000, 0x009c0424, 0x00000000, 0x00000001, 0x00000001, 0x00000001, - 0x00000001, 0x00000001, 0x00007fff, 0x000000ff, 0x000000ff, 0x000000ff, - 0x000000ff, 0x000000ff, 0x000000ff, 0x000000ff, 0x000000ff, 0x0000003e, - 0x00000000, 0x0000003f, 0x0000003f, 0x0000003f, 0x00000000, 0x0000003f, - 0x0000003f, 0x0000003f, 0x0000000f, 0x00000043, 0x00000000, 0x00000006, - 0x00000000, 0x12170000, 0x22170000, 0x32170000, 0x12150000, 0x22150000, - 0x32150000, 0x02100000, 0x00100000, 0x10100000, 0x20100000, 0x30100000, - 0x00100000, 0x12140000, 0x22140000, 0x32140000, 0x00e38340, 0xffffffff, - 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, - 0xffffffff, 0xf0003000, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, - 0xffffffff, 0xffffffff, 0xffffffff, 0xffff3328, 0xffff3338, 0xffffffff, - 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, + 0x0000ff1c, 0x0fffffff, 0x0000ff1c, 0x0fffffff, 0x0000ff00, 0x00000000, + 0x0000ff00, 0x00000000, 0x00000002, 0x00001500, 0x00000001, 0x00000002, + 0x00000003, 0x00000000, 0x00000004, 0x00000001, 0x00000000, 0x00000001, + 0x00000004, 0x00000000, 0x00000001, 0x00000003, 0x00000000, 0x00000001, + 0x00000004, 0x00000000, 0x00000001, 0x00000003, 0x00000000, 0x00000001, + 0x00000004, 0x00000000, 0x00000004, 0x00000003, 0x00000000, 0x00000000, + 0x00003fff, 0x000003ff, 0x00000000, 0x00000001, 0x00000001, 0x00000001, + 0x007c1004, 0x00000004, 0x00000000, 0x00000002, 0x00000090, 0x00000090, + 0x00800090, 0x08100000, 0x0000008a, 0x00000080, 0x00000081, 0x00000080, + 0x00000006, 0x000007d0, 0x0000076c, 0x0000ffff, 0x0000ffff, 0x0000ffff, + 0x0000ffff, 0x071d2911, 0x00000000, 0x009c0424, 0x00000000, 0x00000001, + 0x00000001, 0x00000001, 0x00000001, 0x00000001, 0x00007fff, 0x000000ff, + 0x000000ff, 0x000000ff, 0x000000ff, 0x000000ff, 0x000000ff, 0x000000ff, + 0x000000ff, 0x0000003e, 0x00000000, 0x0000003f, 0x0000003f, 0x0000003f, + 0x00000000, 0x0000003f, 0x0000003f, 0x0000003f, 0x0000000f, 0x00000043, + 0x00000000, 0x00000006, 0x00000000, 0x12170000, 0x22170000, 0x32170000, + 0x12150000, 0x22150000, 0x32150000, 0x02100000, 0x00100000, 0x10100000, + 0x20100000, 0x30100000, 0x00100000, 0x12140000, 0x22140000, 0x32140000, + 0x00e38340, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, + 0xffffffff, 0xffffffff, 0xffffffff, 0xf0003000, 0xffffffff, 0xffffffff, + 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffff3328, + 0xffff3338, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, - 0xffffffff, 0x00003c10, 0x00000008, 0x00000000, 0x00000000, 0x00000040, - 0x00001808, 0x00000803, 0x00000803, 0x00000040, 0x00000003, 0x00000803, - 0x00000803, 0x00000803, 0x00010003, 0x00000803, 0x00000803, 0x00000003, - 0x00000003, 0x00000003, 0x00000003, 0x00000003, 0x00000003, 0x00000003, + 0xffffffff, 0xffffffff, 0xffffffff, 0x00003c10, 0x00000008, 0x00000000, + 0x00000000, 0x00000040, 0x00001808, 0x00000803, 0x00000803, 0x00000040, + 0x00000003, 0x00000803, 0x00000803, 0x00000803, 0x00010003, 0x00000803, + 0x00000803, 0x00000003, 0x00000003, 0x00000003, 0x00000003, 0x00000003, 0x00000003, 0x00000003, 0x00000003, 0x00000003, 0x00000003, 0x00000003, - 0x00000003, 0x00000003, 0x00002403, 0x0000002f, 0x00000009, 0x00000019, - 0x00000184, 0x00000183, 0x00000306, 0x00000019, 0x00000006, 0x00000306, - 0x00000306, 0x00000306, 0x00000c86, 0x00000306, 0x00000306, 0x00000006, + 0x00000003, 0x00000003, 0x00000003, 0x00000003, 0x00002403, 0x0000002f, + 0x00000009, 0x00000019, 0x00000184, 0x00000183, 0x00000306, 0x00000019, + 0x00000006, 0x00000306, 0x00000306, 0x00000306, 0x00000c86, 0x00000306, + 0x00000306, 0x00000006, 0x00000006, 0x00000006, 0x00000006, 0x00000006, 0x00000006, 0x00000006, 0x00000006, 0x00000006, 0x00000006, 0x00000006, - 0x00000006, 0x00000006, 0x00000006, 0x00000006, 0x00000006, 0x00000006, - 0x00000006, 0x00000006, 0x00000306, 0x00000013, 0x00000006, 0x00001004, - 0x00001004, 0x00106440, 0x00106440, 0x00000000, 0x00000000, 0x00000000, - 0x00000000, 0x00002000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, - 0x00002000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00002000, - 0x0000007c, 0x0000003d, 0x0000003f, 0x0000009c, 0x00000006, 0x00000005, - 0x0000000a, 0x00000005, 0x00000140, 0x00000140, 0x00000000, 0x00000000, - 0x000000c0, 0x0000013f, 0x00007fff, 0x00000048, 0x00000048, 0x00000000, - 0x00000000, 0x00000048, 0x00000004, 0x00000004, 0x00000004, 0x00000004, - 0x00000004, 0x00000004, 0x00000004, 0x00000004, 0x00000004, 0x00000009, - 0x0000000b, 0x0000000a, 0x00000004, 0x00000009, 0x0000000b, 0x0000000a, + 0x00000006, 0x00000006, 0x00000006, 0x00000006, 0x00000306, 0x00000013, + 0x00000006, 0x00001004, 0x00001004, 0x00106440, 0x00106440, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00002000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00002000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00002000, 0x0000007c, 0x0000003d, 0x0000003f, 0x0000009c, + 0x00000006, 0x00000005, 0x0000000a, 0x00000005, 0x00000140, 0x00000140, + 0x00000000, 0x00000000, 0x000000c0, 0x0000013f, 0x00007fff, 0x00000048, + 0x00000048, 0x00000000, 0x00000000, 0x00000048, 0x00000004, 0x00000004, + 0x00000004, 0x00000004, 0x00000004, 0x00000004, 0x00000004, 0x00000004, + 0x00000004, 0x00000009, 0x0000000b, 0x0000000a, 0x00000004, 0x00000009, + 0x0000000b, 0x0000000a, 0x00000001, 0x00000001, 0x00000001, 0x00000001, 0x00000001, 0x00000001, 0x00000001, 0x00000001, 0x00000001, 0x00000001, + 0x00000001, 0x00000001, 0x00000004, 0x00000009, 0x0000000b, 0x0000000a, 0x00000001, 0x00000001, 0x00000001, 0x00000001, 0x00000001, 0x00000001, - 0x00000004, 0x00000009, 0x0000000b, 0x0000000a, 0x00000001, 0x00000001, 0x00000001, 0x00000001, 0x00000001, 0x00000001, 0x00000001, 0x00000001, - 0x00000001, 0x00000001, 0x00000001, 0x00000001, 0x00000004, 0x00000009, - 0x0000000b, 0x0000000a, 0x00000000, 0x00000000, 0x00000800, 0x00000200, - 0x000001ff, 0x00000400, 0x00000000, 0x00000000, 0x1e491e49, 0x1e491e49, - 0x0e490e49, 0x0e490e49, 0xffffffff, 0x00000000, 0xffffffff, 0x00000000, - 0x000025e4, 0x00008000, 0x00000013, 0x0fff0fff, 0x00000000, 0x00000000, - 0x0fff0fff, 0x10001000, 0x10001000, 0x20002000, 0x20002000, 0x80008000, - 0x80008000, 0x40004000, 0x40004000, 0x00000000, 0x00000001, 0x01010101, - 0x01200101, 0x20010101, 0x01011001, 0x01010101, 0x01200101, 0x20010101, - 0x01011001, 0x20010101, 0x01011001, 0x01010101, 0x01200101, 0x20010101, - 0x01011001, 0x01010101, 0x01200101, 0x00000123, 0x00000123, 0x00000123, + 0x00000004, 0x00000009, 0x0000000b, 0x0000000a, 0x00000000, 0x00000000, + 0x00000800, 0x00000200, 0x000001ff, 0x00000400, 0x00000000, 0x00000000, + 0x1e491e49, 0x1e491e49, 0x0e490e49, 0x0e490e49, 0xffffffff, 0x00000000, + 0xffffffff, 0x00000000, 0x000025e4, 0x00008000, 0x00000013, 0x0fff0fff, + 0x00000000, 0x00000000, 0x0fff0fff, 0x10001000, 0x10001000, 0x20002000, + 0x20002000, 0x80008000, 0x80008000, 0x40004000, 0x40004000, 0x00000000, + 0x00000001, 0x01010101, 0x01200101, 0x20010101, 0x01011001, 0x01010101, + 0x01200101, 0x20010101, 0x01011001, 0x20010101, 0x01011001, 0x01010101, + 0x01200101, 0x20010101, 0x01011001, 0x01010101, 0x01200101, 0x00000123, 0x00000123, 0x00000123, 0x00000123, 0x00000123, 0x00000123, 0x00000123, 0x00000123, 0x00000123, 0x00000123, 0x00000123, 0x00000123, 0x00000123, - 0x00000123, 0x00000123, 0x00000123, 0x00000123, 0x00000123, 0x00000020, - 0x00000032, 0x00000007, 0x00000007, 0x00000000, 0x00000008, 0x02150020, - 0x02150020, 0x00000030, 0x08100000, 0x00000033, 0x00000030, 0x00000031, - 0x00000002, 0x00000005, 0x00000006, 0x00000002, 0x00000002, 0x00000000, - 0x00000005, 0x00000002, 0x00000002, 0x00000002, 0x00000001, 0x00000006, - 0x00000001, 0x00000002, 0x00000040, 0x00000040, 0x00000020, 0x00000013, - 0x00000020, 0x00010000, 0x000204c0, 0x00030980, 0x00040e40, 0x00051300, - 0x000617c0, 0x00071c80, 0x00082140, 0x00092600, 0x000a2ac0, 0x000b2f80, - 0x000c3440, 0x000d3900, 0x000e3dc0, 0x000f4280, 0x00104740, 0x00114c00, - 0x001250c0, 0x00135580, 0x00145a40, 0x00155f00, 0x001663c0, 0x00176880, - 0x00186d40, 0x00197200, 0x001a76c0, 0x001b7b80, 0x001c8040, 0x001d8500, - 0x001e89c0, 0x001f8e80, 0x00009340, 0x00000001, 0x00000001, 0x00000001, - 0x00000001, 0x00000001, 0x00000001, 0x00000001, 0x00000001, 0x00000001, - 0x00000001, 0x00000001, 0x00000001, 0x00000001, 0x00000001, 0x00000001, - 0x00000001, 0x00000008, 0x0000000c, 0x00000010, 0x00000001, 0x00000001, - 0x00000001, 0x00000211, 0x00000200, 0x00000204, 0x00000219, 0x0000ffff, - 0x0000ffff, 0x0000ffff, 0x0000ffff, 0x07ffffff, 0x0000003f, 0x07ffffff, - 0x0000000f, 0x00007ff8, 0x00007ff8, 0x00000000, 0x140aff00, 0x00000000, - 0x00000001, 0x00201001, 0x00000000, 0x01008600, 0x00000100, 0x00000001, - 0x00000000, 0x00008602, 0x00000000, 0x00000000, 0x00000000, 0x00008604, - 0x00000000, 0x00000000, 0x00000000, 0x00008606, 0x00000000, 0x00000000, - 0x00000000, 0x00008608, 0x00000000, 0x00000000, 0x00000000, 0x0000860a, - 0x00000000, 0x00000000, 0x00000000, 0x0000860c, 0x00000000, 0x00000000, - 0x00000000, 0x0000860e, 0x00000000, 0x00000000, 0x00000000, 0x00008610, - 0x00000000, 0x00000000, 0x00000000, 0x00008612, 0x00000000, 0x00000000, - 0x00000000, 0x00008614, 0x00000000, 0x00000000, 0x00000000, 0x00008616, - 0x00000000, 0x00000000, 0x00000000, 0x00008618, 0x00000000, 0x00000000, - 0x00000000, 0x0000861a, 0x00000000, 0x00000000, 0x00000000, 0x0000861c, - 0x00000000, 0x00000000, 0x00000000, 0x0000861e, 0x00000000, 0x00000000, - 0x00000000, 0x00008620, 0x00000000, 0x00000000, 0x00000000, 0x00008622, - 0x00000000, 0x00000000, 0x00000000, 0x00008624, 0x00000000, 0x00000000, - 0x00000000, 0x00008626, 0x00000000, 0x00000000, 0x00000000, 0x00008628, - 0x00000000, 0x00000000, 0x00000000, 0x0000862a, 0x00000000, 0x00000000, - 0x00000000, 0x0000862c, 0x00000000, 0x00000000, 0x00000000, 0x0000862e, - 0x00000000, 0x00000000, 0x00000000, 0x00008630, 0x00000000, 0x00000000, - 0x00000000, 0x00008632, 0x00000000, 0x00000000, 0x00000000, 0x00008634, - 0x00000000, 0x00000000, 0x00000000, 0x00008636, 0x00000000, 0x00000000, - 0x00000000, 0x00008638, 0x00000000, 0x00000000, 0x00000000, 0x0000863a, - 0x00000000, 0x00000000, 0x00000000, 0x0000863c, 0x00000000, 0x00000000, - 0x00000000, 0x0000863e, 0x00000000, 0x00000000, 0x00000000, 0x00008640, - 0x00000000, 0x00000000, 0x00000000, 0x00008642, 0x00000000, 0x00000000, - 0x00000000, 0x00008644, 0x00000000, 0x00000000, 0x00000000, 0x00008646, - 0x00000000, 0x00000000, 0x00000000, 0x00008648, 0x00000000, 0x00000000, - 0x00000000, 0x0000864a, 0x00000000, 0x00000000, 0x00000000, 0x0000864c, - 0x00000000, 0x00000000, 0x00000000, 0x0000864e, 0x00000000, 0x00000000, - 0x00000000, 0x00008650, 0x00000000, 0x00000000, 0x00000000, 0x00008652, - 0x00000000, 0x00000000, 0x00000000, 0x00008654, 0x00000000, 0x00000000, - 0x00000000, 0x00008656, 0x00000000, 0x00000000, 0x00000000, 0x00008658, - 0x00000000, 0x00000000, 0x00000000, 0x0000865a, 0x00000000, 0x00000000, - 0x00000000, 0x0000865c, 0x00000000, 0x00000000, 0x00000000, 0x0000865e, - 0x00000000, 0x00000000, 0x00000000, 0x00008660, 0x00000000, 0x00000000, - 0x00000000, 0x00008662, 0x00000000, 0x00000000, 0x00000000, 0x00008664, - 0x00000000, 0x00000000, 0x00000000, 0x00008666, 0x00000000, 0x00000000, - 0x00000000, 0x00008668, 0x00000000, 0x00000000, 0x00000000, 0x0000866a, - 0x00000000, 0x00000000, 0x00000000, 0x0000866c, 0x00000000, 0x00000000, - 0x00000000, 0x0000866e, 0x00000000, 0x00000000, 0x00000000, 0x00008670, - 0x00000000, 0x00000000, 0x00000000, 0x00008672, 0x00000000, 0x00000000, - 0x00000000, 0x00008674, 0x00000000, 0x00000000, 0x00000000, 0x00008676, - 0x00000000, 0x00000000, 0x00000000, 0x00008678, 0x00000000, 0x00000000, - 0x00000000, 0x0000867a, 0x00000000, 0x00000000, 0x00000000, 0x0000867c, - 0x00000000, 0x00000000, 0x00000000, 0x0000867e, 0x00000000, 0x00000000, - 0x00000000, 0x00008680, 0x00000000, 0x00000000, 0x00000000, 0x00008682, - 0x00000000, 0x00000000, 0x00000000, 0x00008684, 0x00000000, 0x00000000, - 0x00000000, 0x00008686, 0x00000000, 0x00000000, 0x00000000, 0x00008688, - 0x00000000, 0x00000000, 0x00000000, 0x0000868a, 0x00000000, 0x00000000, - 0x00000000, 0x0000868c, 0x00000000, 0x00000000, 0x00000000, 0x0000868e, - 0x00000000, 0x00000000, 0x00000000, 0x00008690, 0x00000000, 0x00000000, - 0x00000000, 0x00008692, 0x00000000, 0x00000000, 0x00000000, 0x00008694, - 0x00000000, 0x00000000, 0x00000000, 0x00008696, 0x00000000, 0x00000000, - 0x00000000, 0x00008698, 0x00000000, 0x00000000, 0x00000000, 0x0000869a, - 0x00000000, 0x00000000, 0x00000000, 0x0000869c, 0x00000000, 0x00000000, - 0x00000000, 0x0000869e, 0x00000000, 0x00000000, 0x00000000, 0x000086a0, - 0x00000000, 0x00000000, 0x00000000, 0x000086a2, 0x00000000, 0x00000000, - 0x00000000, 0x000086a4, 0x00000000, 0x00000000, 0x00000000, 0x000086a6, - 0x00000000, 0x00000000, 0x00000000, 0x000086a8, 0x00000000, 0x00000000, - 0x00000000, 0x000086aa, 0x00000000, 0x00000000, 0x00000000, 0x000086ac, - 0x00000000, 0x00000000, 0x00000000, 0x000086ae, 0x00000000, 0x00000000, - 0x00000000, 0x000086b0, 0x00000000, 0x00000000, 0x00000000, 0x000086b2, - 0x00000000, 0x00000000, 0x00000000, 0x000086b4, 0x00000000, 0x00000000, - 0x00000000, 0x000086b6, 0x00000000, 0x00000000, 0x00000000, 0x000086b8, - 0x00000000, 0x00000000, 0x00000000, 0x000086ba, 0x00000000, 0x00000000, - 0x00000000, 0x000086bc, 0x00000000, 0x00000000, 0x00000000, 0x000086be, - 0x00000000, 0x00000000, 0x00000000, 0x000086c0, 0x00000000, 0x00000000, - 0x00000000, 0x000086c2, 0x00000000, 0x00000000, 0x00000000, 0x000086c4, - 0x00000000, 0x00000000, 0x00000000, 0x000086c6, 0x00000000, 0x00000000, - 0x00000000, 0x000086c8, 0x00000000, 0x00000000, 0x00000000, 0x000086ca, - 0x00000000, 0x00000000, 0x00000000, 0x000086cc, 0x00000000, 0x00000000, - 0x00000000, 0x000086ce, 0x00000000, 0x00000000, 0x00000000, 0x000086d0, - 0x00000000, 0x00000000, 0x00000000, 0x000086d2, 0x00000000, 0x00000000, - 0x00000000, 0x000086d4, 0x00000000, 0x00000000, 0x00000000, 0x000086d6, - 0x00000000, 0x00000000, 0x00000000, 0x000086d8, 0x00000000, 0x00000000, - 0x00000000, 0x000086da, 0x00000000, 0x00000000, 0x00000000, 0x000086dc, - 0x00000000, 0x00000000, 0x00000000, 0x000086de, 0x00000000, 0x00000000, - 0x00000000, 0x000086e0, 0x00000000, 0x00000000, 0x00000000, 0x000086e2, - 0x00000000, 0x00000000, 0x00000000, 0x000086e4, 0x00000000, 0x00000000, - 0x00000000, 0x000086e6, 0x00000000, 0x00000000, 0x00000000, 0x000086e8, - 0x00000000, 0x00000000, 0x00000000, 0x000086ea, 0x00000000, 0x00000000, - 0x00000000, 0x000086ec, 0x00000000, 0x00000000, 0x00000000, 0x000086ee, - 0x00000000, 0x00000000, 0x00000000, 0x000086f0, 0x00000000, 0x00000000, - 0x00000000, 0x000086f2, 0x00000000, 0x00000000, 0x00000000, 0x000086f4, - 0x00000000, 0x00000000, 0x00000000, 0x000086f6, 0x00000000, 0x00000000, - 0x00000000, 0x000086f8, 0x00000000, 0x00000000, 0x00000000, 0x000086fa, - 0x00000000, 0x00000000, 0x00000000, 0x000086fc, 0x00000000, 0x00000000, - 0x00000000, 0x000086fe, 0x00000000, 0x00000000, 0x00000000, 0x00008700, - 0x00000000, 0x00000000, 0x00000000, 0x00008702, 0x00000000, 0x00000000, - 0x00000000, 0x00008704, 0x00000000, 0x00000000, 0x00000000, 0x00008706, - 0x00000000, 0x00000000, 0x00000000, 0x00008708, 0x00000000, 0x00000000, - 0x00000000, 0x0000870a, 0x00000000, 0x00000000, 0x00000000, 0x0000870c, - 0x00000000, 0x00000000, 0x00000000, 0x0000870e, 0x00000000, 0x00000000, - 0x00000000, 0x00008710, 0x00000000, 0x00000000, 0x00000000, 0x00008712, - 0x00000000, 0x00000000, 0x00000000, 0x00008714, 0x00000000, 0x00000000, - 0x00000000, 0x00008716, 0x00000000, 0x00000000, 0x00000000, 0x00008718, - 0x00000000, 0x00000000, 0x00000000, 0x0000871a, 0x00000000, 0x00000000, - 0x00000000, 0x0000871c, 0x00000000, 0x00000000, 0x00000000, 0x0000871e, - 0x00000000, 0x00000000, 0x00000000, 0x00008720, 0x00000000, 0x00000000, - 0x00000000, 0x00008722, 0x00000000, 0x00000000, 0x00000000, 0x00008724, - 0x00000000, 0x00000000, 0x00000000, 0x00008726, 0x00000000, 0x00000000, - 0x00000000, 0x00008728, 0x00000000, 0x00000000, 0x00000000, 0x0000872a, - 0x00000000, 0x00000000, 0x00000000, 0x0000872c, 0x00000000, 0x00000000, - 0x00000000, 0x0000872e, 0x00000000, 0x00000000, 0x00000000, 0x00008730, - 0x00000000, 0x00000000, 0x00000000, 0x00008732, 0x00000000, 0x00000000, - 0x00000000, 0x00008734, 0x00000000, 0x00000000, 0x00000000, 0x00008736, - 0x00000000, 0x00000000, 0x00000000, 0x00008738, 0x00000000, 0x00000000, - 0x00000000, 0x0000873a, 0x00000000, 0x00000000, 0x00000000, 0x0000873c, - 0x00000000, 0x00000000, 0x00000000, 0x0000873e, 0x00000000, 0x00000000, - 0x00000000, 0x00008740, 0x00000000, 0x00000000, 0x00000000, 0x00008742, - 0x00000000, 0x00000000, 0x00000000, 0x00008744, 0x00000000, 0x00000000, - 0x00000000, 0x00008746, 0x00000000, 0x00000000, 0x00000000, 0x00008748, - 0x00000000, 0x00000000, 0x00000000, 0x0000874a, 0x00000000, 0x00000000, - 0x00000000, 0x0000874c, 0x00000000, 0x00000000, 0x00000000, 0x0000874e, - 0x00000000, 0x00000000, 0x00000000, 0x00008750, 0x00000000, 0x00000000, - 0x00000000, 0x00008752, 0x00000000, 0x00000000, 0x00000000, 0x00008754, - 0x00000000, 0x00000000, 0x00000000, 0x00008756, 0x00000000, 0x00000000, - 0x00000000, 0x00008758, 0x00000000, 0x00000000, 0x00000000, 0x0000875a, - 0x00000000, 0x00000000, 0x00000000, 0x0000875c, 0x00000000, 0x00000000, - 0x00000000, 0x0000875e, 0x00000000, 0x00000000, 0x00000000, 0x00008760, - 0x00000000, 0x00000000, 0x00000000, 0x00008762, 0x00000000, 0x00000000, - 0x00000000, 0x00008764, 0x00000000, 0x00000000, 0x00000000, 0x00008766, - 0x00000000, 0x00000000, 0x00000000, 0x00008768, 0x00000000, 0x00000000, - 0x00000000, 0x0000876a, 0x00000000, 0x00000000, 0x00000000, 0x0000876c, - 0x00000000, 0x00000000, 0x00000000, 0x0000876e, 0x00000000, 0x00000000, - 0x00000000, 0x00008770, 0x00000000, 0x00000000, 0x00000000, 0x00008772, - 0x00000000, 0x00000000, 0x00000000, 0x00008774, 0x00000000, 0x00000000, - 0x00000000, 0x00008776, 0x00000000, 0x00000000, 0x00000000, 0x00008778, - 0x00000000, 0x00000000, 0x00000000, 0x0000877a, 0x00000000, 0x00000000, - 0x00000000, 0x0000877c, 0x00000000, 0x00000000, 0x00000000, 0x0000877e, - 0x00000000, 0x00000000, 0x00000000, 0x00008780, 0x00000000, 0x00000000, - 0x00000000, 0x00008782, 0x00000000, 0x00000000, 0x00000000, 0x00008784, - 0x00000000, 0x00000000, 0x00000000, 0x00008786, 0x00000000, 0x00000000, - 0x00000000, 0x00008788, 0x00000000, 0x00000000, 0x00000000, 0x0000878a, - 0x00000000, 0x00000000, 0x00000000, 0x0000878c, 0x00000000, 0x00000000, - 0x00000000, 0x0000878e, 0x00000000, 0x00000000, 0x00000000, 0x00008790, - 0x00000000, 0x00000000, 0x00000000, 0x00008792, 0x00000000, 0x00000000, - 0x00000000, 0x00008794, 0x00000000, 0x00000000, 0x00000000, 0x00008796, - 0x00000000, 0x00000000, 0x00000000, 0x00008798, 0x00000000, 0x00000000, - 0x00000000, 0x0000879a, 0x00000000, 0x00000000, 0x00000000, 0x0000879c, - 0x00000000, 0x00000000, 0x00000000, 0x0000879e, 0x00000000, 0x00000000, - 0x00000000, 0x000087a0, 0x00000000, 0x00000000, 0x00000000, 0x000087a2, - 0x00000000, 0x00000000, 0x00000000, 0x000087a4, 0x00000000, 0x00000000, - 0x00000000, 0x000087a6, 0x00000000, 0x00000000, 0x00000000, 0x000087a8, - 0x00000000, 0x00000000, 0x00000000, 0x000087aa, 0x00000000, 0x00000000, - 0x00000000, 0x000087ac, 0x00000000, 0x00000000, 0x00000000, 0x000087ae, - 0x00000000, 0x00000000, 0x00000000, 0x000087b0, 0x00000000, 0x00000000, - 0x00000000, 0x000087b2, 0x00000000, 0x00000000, 0x00000000, 0x000087b4, - 0x00000000, 0x00000000, 0x00000000, 0x000087b6, 0x00000000, 0x00000000, *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Fri Feb 26 00:50:55 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A9069AB448D; Fri, 26 Feb 2016 00:50:55 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from gw.catspoiler.org (unknown [IPv6:2602:304:b010:ef20::f2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "gw.catspoiler.org", Issuer "gw.catspoiler.org" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 8CA79E62; Fri, 26 Feb 2016 00:50:55 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from FreeBSD.org (mousie.catspoiler.org [192.168.101.2]) by gw.catspoiler.org (8.15.2/8.15.2) with ESMTP id u1Q0og8T010950; Thu, 25 Feb 2016 16:50:46 -0800 (PST) (envelope-from truckman@FreeBSD.org) Message-Id: <201602260050.u1Q0og8T010950@gw.catspoiler.org> Date: Thu, 25 Feb 2016 16:50:41 -0800 (PST) From: Don Lewis Subject: Re: svn commit: r296025 - head/sys/netpfil/pf To: kostikbel@gmail.com cc: kp@FreeBSD.org, cem@FreeBSD.org, src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org In-Reply-To: <20160225100757.GA67250@kib.kiev.ua> MIME-Version: 1.0 Content-Type: TEXT/plain; charset=us-ascii X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Feb 2016 00:50:55 -0000 On 25 Feb, Konstantin Belousov wrote: > On Thu, Feb 25, 2016 at 10:17:41AM +0100, Kristof Provost wrote: >> On 2016-02-24 23:47:55 (-0800), Conrad Meyer wrote: >> > On Wed, Feb 24, 2016 at 11:41 PM, Adrian Chadd wrote: >> > > .. what's capping totlen so one doesn't run out of memory? >> > >> > There was a DoS vector before (user controlled io->pfrio_size) and >> > basically the same DoS vector now (either of io->pfrio_size or >> > io->pfrio_size2). This change isn't a regression. Still, it should >> > be fixed. >> > >> It's an M_WAITOK allocation, so if the user asks for more memory than is >> available the thread will sleep. I'd assumed that if the user terminates >> the thread the sleep will wake, the allocation will fail and the ioctl() >> will return an error. > M_WAITOK allocations still panic when requested amount of KVA is > unreasonable. > > I am curious what do you mean by 'user terminating the thread'. The > sleep in malloc() is uninterruptible by signal, and user does not have > any other way to disturb the execution. > >> >> Perhaps we should do what OpenBSD do, and not allocate the temporary >> buffer at all. They copy in/out the individual entries one by one. On >> the other hand, one could still exhaust memory by inserting large >> numbers of addresses in the table. > But note that accesses to the user memory may fault, which puts whole > VM and VFS subsystems (and possibly the network as well, if user > supplied address is backed by mapped NFS file) after the locks owned > at the moment of copyin() call. Well, you could wire the user buffer like is done for sysctl buffers. That removes the KVA constraint, but it basically just moves the problem elsewhere. As I recall, we have limits on wired memory, though I believe it is less restrictive for transient requests. It's been ages since I looked at this. From owner-svn-src-head@freebsd.org Fri Feb 26 01:52:35 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 14EE2AB48F1; Fri, 26 Feb 2016 01:52:35 +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 mx1.freebsd.org (Postfix) with ESMTPS id D8C6EA60; Fri, 26 Feb 2016 01:52:34 +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 u1Q1qXYr070859; Fri, 26 Feb 2016 01:52:33 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1Q1qXVp070858; Fri, 26 Feb 2016 01:52:33 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201602260152.u1Q1qXVp070858@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Fri, 26 Feb 2016 01:52:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r296075 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Feb 2016 01:52:35 -0000 Author: bdrewery Date: Fri Feb 26 01:52:33 2016 New Revision: 296075 URL: https://svnweb.freebsd.org/changeset/base/296075 Log: Let CLEANDEPENDFILES actually be set before bsd.dep.mk. This fixes 'cleandepend' for kmods after r295983. Pointyhat to: bdrewery Sponsored by: EMC / Isilon Storage Division Modified: head/share/mk/bsd.dep.mk Modified: head/share/mk/bsd.dep.mk ============================================================================== --- head/share/mk/bsd.dep.mk Fri Feb 26 00:10:52 2016 (r296074) +++ head/share/mk/bsd.dep.mk Fri Feb 26 01:52:33 2016 (r296075) @@ -64,7 +64,7 @@ MKDEPCMD?= CC='${_MKDEPCC}' mkdep .if ${MK_DIRDEPS_BUILD} == "no" .MAKE.DEPENDFILE= ${DEPENDFILE} .endif -CLEANDEPENDFILES= ${DEPENDFILE} ${DEPENDFILE}.* +CLEANDEPENDFILES+= ${DEPENDFILE} ${DEPENDFILE}.* # Keep `tags' here, before SRCS are mangled below for `depend'. .if !target(tags) && defined(SRCS) && !defined(NO_TAGS) From owner-svn-src-head@freebsd.org Fri Feb 26 02:26:21 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 07F09AB431C; Fri, 26 Feb 2016 02:26:21 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C7DCE15C0; Fri, 26 Feb 2016 02:26:20 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1Q2QJHn079624; Fri, 26 Feb 2016 02:26:19 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1Q2QJZG079623; Fri, 26 Feb 2016 02:26:19 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201602260226.u1Q2QJZG079623@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Fri, 26 Feb 2016 02:26:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r296076 - head/sys/dev/hyperv/vmbus X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Feb 2016 02:26:21 -0000 Author: sephe Date: Fri Feb 26 02:26:19 2016 New Revision: 296076 URL: https://svnweb.freebsd.org/changeset/base/296076 Log: hyperv: Use atomic_fetchadd_int to get GPADL id. Reviewed by: Hongjiang Zhang MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D5439 Modified: head/sys/dev/hyperv/vmbus/hv_channel.c Modified: head/sys/dev/hyperv/vmbus/hv_channel.c ============================================================================== --- head/sys/dev/hyperv/vmbus/hv_channel.c Fri Feb 26 01:52:33 2016 (r296075) +++ head/sys/dev/hyperv/vmbus/hv_channel.c Fri Feb 26 02:26:19 2016 (r296076) @@ -384,17 +384,22 @@ hv_vmbus_channel_establish_gpadl( hv_vmbus_channel_msg_info* curr; uint32_t next_gpadl_handle; - next_gpadl_handle = hv_vmbus_g_connection.next_gpadl_handle; - atomic_add_int((int*) &hv_vmbus_g_connection.next_gpadl_handle, 1); + next_gpadl_handle = atomic_fetchadd_int( + &hv_vmbus_g_connection.next_gpadl_handle, 1); ret = vmbus_channel_create_gpadl_header( contig_buffer, size, &msg_info, &msg_count); - if(ret != 0) { /* if(allocation failed) return immediately */ - /* reverse atomic_add_int above */ - atomic_subtract_int((int*) - &hv_vmbus_g_connection.next_gpadl_handle, 1); - return ret; + if(ret != 0) { + /* + * XXX + * We can _not_ even revert the above incremental, + * if multiple GPADL establishments are running + * parallelly, decrement the global next_gpadl_handle + * is calling for _big_ trouble. A better solution + * is to have a 0-based GPADL id bitmap ... + */ + return ret; } sema_init(&msg_info->wait_sema, 0, "Open Info Sema"); From owner-svn-src-head@freebsd.org Fri Feb 26 03:34:10 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8A910AB58B6; Fri, 26 Feb 2016 03:34:10 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4C20D186D; Fri, 26 Feb 2016 03:34:10 +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 u1Q3Y9Hp000791; Fri, 26 Feb 2016 03:34:09 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1Q3Y8O6000785; Fri, 26 Feb 2016 03:34:08 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201602260334.u1Q3Y8O6000785@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Fri, 26 Feb 2016 03:34:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r296077 - in head/sys/dev/bhnd: . bcma bhndb cores cores/chipc cores/pci nvram siba tools X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Feb 2016 03:34:10 -0000 Author: adrian Date: Fri Feb 26 03:34:08 2016 New Revision: 296077 URL: https://svnweb.freebsd.org/changeset/base/296077 Log: Bring over the initial rewrite of the broadcom bus support found in their SoCs and various chips (including, famously, their wifi chips.) This is "just" (all 20,000 lines of it) code to enumerate the various versions of busses inside these devices, including the PCI bridge and the direct SIBA bridge found in MIPS chips. It also includes shared code for some bus operations (suspend, resume, etc); EEPROM/SROM/etc parsing and other things that are shared between chips. Eventually this'll replace the code that bwi/bwn uses for the internal bus, as well as some apparently upcoming mips74k broadcom SoC support which uses bwn! Thanks to Landon Fuller for all this work! Obtained from: https://github.com/landonf/freebsd/compare/user/landonf/bcm4331-CURRENT Added: head/sys/dev/bhnd/ head/sys/dev/bhnd/bcma/ head/sys/dev/bhnd/bcma/bcma.c (contents, props changed) head/sys/dev/bhnd/bcma/bcma.h (contents, props changed) head/sys/dev/bhnd/bcma/bcma_bhndb.c (contents, props changed) head/sys/dev/bhnd/bcma/bcma_dmp.h (contents, props changed) head/sys/dev/bhnd/bcma/bcma_erom.c (contents, props changed) head/sys/dev/bhnd/bcma/bcma_eromreg.h (contents, props changed) head/sys/dev/bhnd/bcma/bcma_eromvar.h (contents, props changed) head/sys/dev/bhnd/bcma/bcma_subr.c (contents, props changed) head/sys/dev/bhnd/bcma/bcmavar.h (contents, props changed) head/sys/dev/bhnd/bcmsrom_fmt.h (contents, props changed) head/sys/dev/bhnd/bcmsrom_tbl.h (contents, props changed) head/sys/dev/bhnd/bhnd.c (contents, props changed) head/sys/dev/bhnd/bhnd.h (contents, props changed) head/sys/dev/bhnd/bhnd_bus_if.m (contents, props changed) head/sys/dev/bhnd/bhnd_core.h (contents, props changed) head/sys/dev/bhnd/bhnd_ids.h (contents, props changed) head/sys/dev/bhnd/bhnd_subr.c (contents, props changed) head/sys/dev/bhnd/bhnd_types.h (contents, props changed) head/sys/dev/bhnd/bhndb/ head/sys/dev/bhnd/bhndb/bhndb.c (contents, props changed) head/sys/dev/bhnd/bhndb/bhndb.h (contents, props changed) head/sys/dev/bhnd/bhndb/bhndb_bus_if.m (contents, props changed) head/sys/dev/bhnd/bhndb/bhndb_hwdata.c (contents, props changed) head/sys/dev/bhnd/bhndb/bhndb_hwdata.h (contents, props changed) head/sys/dev/bhnd/bhndb/bhndb_if.m (contents, props changed) head/sys/dev/bhnd/bhndb/bhndb_pci.c (contents, props changed) head/sys/dev/bhnd/bhndb/bhndb_pci_hwdata.c (contents, props changed) head/sys/dev/bhnd/bhndb/bhndb_pci_hwdata.h (contents, props changed) head/sys/dev/bhnd/bhndb/bhndb_pcireg.h (contents, props changed) head/sys/dev/bhnd/bhndb/bhndb_pcivar.h (contents, props changed) head/sys/dev/bhnd/bhndb/bhndb_private.h (contents, props changed) head/sys/dev/bhnd/bhndb/bhndb_subr.c (contents, props changed) head/sys/dev/bhnd/bhndb/bhndbvar.h (contents, props changed) head/sys/dev/bhnd/bhndreg.h (contents, props changed) head/sys/dev/bhnd/bhndvar.h (contents, props changed) head/sys/dev/bhnd/cores/ head/sys/dev/bhnd/cores/chipc/ head/sys/dev/bhnd/cores/chipc/bhnd_chipc_if.m (contents, props changed) head/sys/dev/bhnd/cores/chipc/chipc.c (contents, props changed) head/sys/dev/bhnd/cores/chipc/chipc.h (contents, props changed) head/sys/dev/bhnd/cores/chipc/chipcreg.h (contents, props changed) head/sys/dev/bhnd/cores/chipc/chipcvar.h (contents, props changed) head/sys/dev/bhnd/cores/pci/ head/sys/dev/bhnd/cores/pci/bhnd_pci.c (contents, props changed) head/sys/dev/bhnd/cores/pci/bhnd_pci_hostb.c (contents, props changed) head/sys/dev/bhnd/cores/pci/bhnd_pcib.c (contents, props changed) head/sys/dev/bhnd/cores/pci/bhnd_pcibvar.h (contents, props changed) head/sys/dev/bhnd/cores/pci/bhnd_pcireg.h (contents, props changed) head/sys/dev/bhnd/cores/pci/bhnd_pcivar.h (contents, props changed) head/sys/dev/bhnd/cores/pci/mdio_pcie.c (contents, props changed) head/sys/dev/bhnd/cores/pci/mdio_pciereg.h (contents, props changed) head/sys/dev/bhnd/cores/pci/mdio_pcievar.h (contents, props changed) head/sys/dev/bhnd/nvram/ head/sys/dev/bhnd/nvram/bhnd_nvram.h (contents, props changed) head/sys/dev/bhnd/nvram/bhnd_nvram_if.m (contents, props changed) head/sys/dev/bhnd/siba/ head/sys/dev/bhnd/siba/siba.c (contents, props changed) head/sys/dev/bhnd/siba/siba.h (contents, props changed) head/sys/dev/bhnd/siba/siba_bhndb.c (contents, props changed) head/sys/dev/bhnd/siba/siba_nexus.c (contents, props changed) head/sys/dev/bhnd/siba/siba_subr.c (contents, props changed) head/sys/dev/bhnd/siba/sibareg.h (contents, props changed) head/sys/dev/bhnd/siba/sibavar.h (contents, props changed) head/sys/dev/bhnd/tools/ head/sys/dev/bhnd/tools/bus_macro.sh (contents, props changed) Added: head/sys/dev/bhnd/bcma/bcma.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/bhnd/bcma/bcma.c Fri Feb 26 03:34:08 2016 (r296077) @@ -0,0 +1,482 @@ +/*- + * Copyright (c) 2015 Landon Fuller + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer, + * without modification. + * 2. Redistributions in binary form must reproduce at minimum a disclaimer + * similar to the "NO WARRANTY" disclaimer below ("Disclaimer") and any + * redistribution must be conditioned upon including a substantially + * similar Disclaimer requirement for further binary redistribution. + * + * NO WARRANTY + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF NONINFRINGEMENT, MERCHANTIBILITY + * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL + * THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, + * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER + * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF + * THE POSSIBILITY OF SUCH DAMAGES. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include + +#include + +#include "bcmavar.h" + +#include "bcma_eromreg.h" +#include "bcma_eromvar.h" + +int +bcma_probe(device_t dev) +{ + device_set_desc(dev, "BCMA BHND bus"); + return (BUS_PROBE_DEFAULT); +} + +int +bcma_attach(device_t dev) +{ + struct bcma_devinfo *dinfo; + device_t *devs, child; + int ndevs; + int error; + + + if ((error = device_get_children(dev, &devs, &ndevs))) + return (error); + + /* + * Map our children's agent register block. + */ + for (int i = 0; i < ndevs; i++) { + bhnd_addr_t addr; + bhnd_size_t size; + rman_res_t r_start, r_count, r_end; + + child = devs[i]; + dinfo = device_get_ivars(child); + + KASSERT(!device_is_suspended(child), + ("bcma(4) stateful suspend handling requires that devices " + "not be suspended before bcma_attach()")); + + /* Verify that the agent register block exists and is + * mappable */ + if (bhnd_get_port_rid(child, BHND_PORT_AGENT, 0, 0) == -1) + continue; + + /* Fetch the address of the agent register block */ + error = bhnd_get_region_addr(child, BHND_PORT_AGENT, 0, 0, + &addr, &size); + if (error) { + device_printf(dev, "failed fetching agent register " + "block address for core %d\n", i); + goto cleanup; + } + + /* Allocate the resource */ + r_start = addr; + r_count = size; + r_end = r_start + r_count - 1; + + dinfo->rid_agent = 0; + dinfo->res_agent = bhnd_alloc_resource(dev, SYS_RES_MEMORY, + &dinfo->rid_agent, r_start, r_end, r_count, RF_ACTIVE); + if (dinfo->res_agent == NULL) { + device_printf(dev, "failed allocating agent register " + "block for core %d\n", i); + error = ENXIO; + goto cleanup; + } + } + +cleanup: + free(devs, M_BHND); + if (error) + return (error); + + return (bhnd_generic_attach(dev)); +} + +int +bcma_detach(device_t dev) +{ + return (bhnd_generic_detach(dev)); +} + +static int +bcma_read_ivar(device_t dev, device_t child, int index, uintptr_t *result) +{ + const struct bcma_devinfo *dinfo; + const struct bhnd_core_info *ci; + + dinfo = device_get_ivars(child); + ci = &dinfo->corecfg->core_info; + + switch (index) { + case BHND_IVAR_VENDOR: + *result = ci->vendor; + return (0); + case BHND_IVAR_DEVICE: + *result = ci->device; + return (0); + case BHND_IVAR_HWREV: + *result = ci->hwrev; + return (0); + case BHND_IVAR_DEVICE_CLASS: + *result = bhnd_core_class(ci); + return (0); + case BHND_IVAR_VENDOR_NAME: + *result = (uintptr_t) bhnd_vendor_name(ci->vendor); + return (0); + case BHND_IVAR_DEVICE_NAME: + *result = (uintptr_t) bhnd_core_name(ci); + return (0); + case BHND_IVAR_CORE_INDEX: + *result = ci->core_idx; + return (0); + case BHND_IVAR_CORE_UNIT: + *result = ci->unit; + return (0); + default: + return (ENOENT); + } +} + +static int +bcma_write_ivar(device_t dev, device_t child, int index, uintptr_t value) +{ + switch (index) { + case BHND_IVAR_VENDOR: + case BHND_IVAR_DEVICE: + case BHND_IVAR_HWREV: + case BHND_IVAR_DEVICE_CLASS: + case BHND_IVAR_VENDOR_NAME: + case BHND_IVAR_DEVICE_NAME: + case BHND_IVAR_CORE_INDEX: + case BHND_IVAR_CORE_UNIT: + return (EINVAL); + default: + return (ENOENT); + } +} + +static void +bcma_child_deleted(device_t dev, device_t child) +{ + struct bcma_devinfo *dinfo = device_get_ivars(child); + if (dinfo != NULL) + bcma_free_dinfo(dev, dinfo); +} + +static struct resource_list * +bcma_get_resource_list(device_t dev, device_t child) +{ + struct bcma_devinfo *dinfo = device_get_ivars(child); + return (&dinfo->resources); +} + + +static int +bcma_reset_core(device_t dev, device_t child, uint16_t flags) +{ + struct bcma_devinfo *dinfo; + + if (device_get_parent(child) != dev) + BHND_BUS_RESET_CORE(device_get_parent(dev), child, flags); + + dinfo = device_get_ivars(child); + + /* Can't reset the core without access to the agent registers */ + if (dinfo->res_agent == NULL) + return (ENODEV); + + // TODO - perform reset + + return (ENXIO); +} + +static int +bcma_suspend_core(device_t dev, device_t child) +{ + struct bcma_devinfo *dinfo; + + if (device_get_parent(child) != dev) + BHND_BUS_SUSPEND_CORE(device_get_parent(dev), child); + + dinfo = device_get_ivars(child); + + /* Can't suspend the core without access to the agent registers */ + if (dinfo->res_agent == NULL) + return (ENODEV); + + // TODO - perform suspend + + return (ENXIO); +} + +static u_int +bcma_get_port_count(device_t dev, device_t child, bhnd_port_type type) +{ + struct bcma_devinfo *dinfo; + + /* delegate non-bus-attached devices to our parent */ + if (device_get_parent(child) != dev) + return (BHND_BUS_GET_PORT_COUNT(device_get_parent(dev), child, + type)); + + dinfo = device_get_ivars(child); + switch (type) { + case BHND_PORT_DEVICE: + return (dinfo->corecfg->num_dev_ports); + case BHND_PORT_BRIDGE: + return (dinfo->corecfg->num_bridge_ports); + case BHND_PORT_AGENT: + return (dinfo->corecfg->num_wrapper_ports); + } +} + +static u_int +bcma_get_region_count(device_t dev, device_t child, bhnd_port_type type, + u_int port_num) +{ + struct bcma_devinfo *dinfo; + struct bcma_sport_list *ports; + struct bcma_sport *port; + + /* delegate non-bus-attached devices to our parent */ + if (device_get_parent(child) != dev) + return (BHND_BUS_GET_REGION_COUNT(device_get_parent(dev), child, + type, port_num)); + + dinfo = device_get_ivars(child); + ports = bcma_corecfg_get_port_list(dinfo->corecfg, type); + + STAILQ_FOREACH(port, ports, sp_link) { + if (port->sp_num == port_num) + return (port->sp_num_maps); + } + + /* not found */ + return (0); +} + +static int +bcma_get_port_rid(device_t dev, device_t child, bhnd_port_type port_type, + u_int port_num, u_int region_num) +{ + struct bcma_devinfo *dinfo; + struct bcma_map *map; + struct bcma_sport_list *ports; + struct bcma_sport *port; + + dinfo = device_get_ivars(child); + ports = bcma_corecfg_get_port_list(dinfo->corecfg, port_type); + + STAILQ_FOREACH(port, ports, sp_link) { + if (port->sp_num != port_num) + continue; + + STAILQ_FOREACH(map, &port->sp_maps, m_link) + if (map->m_region_num == region_num) + return map->m_rid; + } + + return -1; +} + +static int +bcma_decode_port_rid(device_t dev, device_t child, int type, int rid, + bhnd_port_type *port_type, u_int *port_num, u_int *region_num) +{ + struct bcma_devinfo *dinfo; + struct bcma_map *map; + struct bcma_sport_list *ports; + struct bcma_sport *port; + + dinfo = device_get_ivars(child); + + /* Ports are always memory mapped */ + if (type != SYS_RES_MEMORY) + return (EINVAL); + + /* Starting with the most likely device list, search all three port + * lists */ + bhnd_port_type types[] = { + BHND_PORT_DEVICE, + BHND_PORT_AGENT, + BHND_PORT_BRIDGE + }; + + for (int i = 0; i < nitems(types); i++) { + ports = bcma_corecfg_get_port_list(dinfo->corecfg, types[i]); + + STAILQ_FOREACH(port, ports, sp_link) { + STAILQ_FOREACH(map, &port->sp_maps, m_link) { + if (map->m_rid != rid) + continue; + + *port_type = port->sp_type; + *port_num = port->sp_num; + *region_num = map->m_region_num; + return (0); + } + } + } + + return (ENOENT); +} + +static int +bcma_get_region_addr(device_t dev, device_t child, bhnd_port_type port_type, + u_int port_num, u_int region_num, bhnd_addr_t *addr, bhnd_size_t *size) +{ + struct bcma_devinfo *dinfo; + struct bcma_map *map; + struct bcma_sport_list *ports; + struct bcma_sport *port; + + dinfo = device_get_ivars(child); + ports = bcma_corecfg_get_port_list(dinfo->corecfg, port_type); + + /* Search the port list */ + STAILQ_FOREACH(port, ports, sp_link) { + if (port->sp_num != port_num) + continue; + + STAILQ_FOREACH(map, &port->sp_maps, m_link) { + if (map->m_region_num != region_num) + continue; + + /* Found! */ + *addr = map->m_base; + *size = map->m_size; + return (0); + } + } + + return (ENOENT); +} + +/** + * Scan a device enumeration ROM table, adding all valid discovered cores to + * the bus. + * + * @param bus The bcma bus. + * @param erom_res An active resource mapping the EROM core. + * @param erom_offset Base offset of the EROM core's register mapping. + */ +int +bcma_add_children(device_t bus, struct resource *erom_res, bus_size_t erom_offset) +{ + struct bcma_erom erom; + struct bcma_corecfg *corecfg; + struct bcma_devinfo *dinfo; + device_t child; + int error; + + dinfo = NULL; + corecfg = NULL; + + /* Initialize our reader */ + error = bcma_erom_open(&erom, erom_res, erom_offset); + if (error) + return (error); + + /* Add all cores. */ + while (!error) { + /* Parse next core */ + error = bcma_erom_parse_corecfg(&erom, &corecfg); + if (error && error == ENOENT) { + return (0); + } else if (error) { + goto failed; + } + + /* Allocate per-device bus info */ + dinfo = bcma_alloc_dinfo(bus, corecfg); + if (dinfo == NULL) { + error = ENXIO; + goto failed; + } + + /* The dinfo instance now owns the corecfg value */ + corecfg = NULL; + + /* Add the child device */ + child = device_add_child(bus, NULL, -1); + if (child == NULL) { + error = ENXIO; + goto failed; + } + + /* The child device now owns the dinfo pointer */ + device_set_ivars(child, dinfo); + dinfo = NULL; + + /* If pins are floating or the hardware is otherwise + * unpopulated, the device shouldn't be used. */ + if (bhnd_is_hw_disabled(child)) + device_disable(child); + } + + /* Hit EOF parsing cores? */ + if (error == ENOENT) + return (0); + +failed: + if (dinfo != NULL) + bcma_free_dinfo(bus, dinfo); + + if (corecfg != NULL) + bcma_free_corecfg(corecfg); + + return (error); +} + + +static device_method_t bcma_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, bcma_probe), + DEVMETHOD(device_attach, bcma_attach), + DEVMETHOD(device_detach, bcma_detach), + + /* Bus interface */ + DEVMETHOD(bus_child_deleted, bcma_child_deleted), + DEVMETHOD(bus_read_ivar, bcma_read_ivar), + DEVMETHOD(bus_write_ivar, bcma_write_ivar), + DEVMETHOD(bus_get_resource_list, bcma_get_resource_list), + + /* BHND interface */ + DEVMETHOD(bhnd_bus_reset_core, bcma_reset_core), + DEVMETHOD(bhnd_bus_suspend_core, bcma_suspend_core), + DEVMETHOD(bhnd_bus_get_port_count, bcma_get_port_count), + DEVMETHOD(bhnd_bus_get_region_count, bcma_get_region_count), + DEVMETHOD(bhnd_bus_get_port_rid, bcma_get_port_rid), + DEVMETHOD(bhnd_bus_decode_port_rid, bcma_decode_port_rid), + DEVMETHOD(bhnd_bus_get_region_addr, bcma_get_region_addr), + + DEVMETHOD_END +}; + +DEFINE_CLASS_1(bhnd, bcma_driver, bcma_methods, sizeof(struct bcma_softc), bhnd_driver); +MODULE_VERSION(bcma, 1); +MODULE_DEPEND(bcma, bhnd, 1, 1, 1); Added: head/sys/dev/bhnd/bcma/bcma.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/bhnd/bcma/bcma.h Fri Feb 26 03:34:08 2016 (r296077) @@ -0,0 +1,49 @@ +/*- + * Copyright (c) 2015 Landon Fuller + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer, + * without modification. + * 2. Redistributions in binary form must reproduce at minimum a disclaimer + * similar to the "NO WARRANTY" disclaimer below ("Disclaimer") and any + * redistribution must be conditioned upon including a substantially + * similar Disclaimer requirement for further binary redistribution. + * + * NO WARRANTY + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF NONINFRINGEMENT, MERCHANTIBILITY + * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL + * THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, + * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER + * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF + * THE POSSIBILITY OF SUCH DAMAGES. + * + * $FreeBSD$ + */ + +#ifndef _BCMA_BCMA_H_ +#define _BCMA_BCMA_H_ + +#include +#include +#include +#include +#include + +#include + +/* + * Broadcom AMBA backplane types and data structures. + */ + +DECLARE_CLASS(bcma_driver); + +#endif /* _BCMA_BCMA_H_ */ \ No newline at end of file Added: head/sys/dev/bhnd/bcma/bcma_bhndb.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/bhnd/bcma/bcma_bhndb.c Fri Feb 26 03:34:08 2016 (r296077) @@ -0,0 +1,183 @@ +/*- + * Copyright (c) 2015 Landon Fuller + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer, + * without modification. + * 2. Redistributions in binary form must reproduce at minimum a disclaimer + * similar to the "NO WARRANTY" disclaimer below ("Disclaimer") and any + * redistribution must be conditioned upon including a substantially + * similar Disclaimer requirement for further binary redistribution. + * + * NO WARRANTY + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF NONINFRINGEMENT, MERCHANTIBILITY + * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL + * THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, + * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER + * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF + * THE POSSIBILITY OF SUCH DAMAGES. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include + +#include +#include +#include + +#include "bcmavar.h" + +#include "bcma_eromreg.h" +#include "bcma_eromvar.h" + +/* + * Supports attachment of bcma(4) bus devices via a bhndb bridge. + */ + +static int +bcma_bhndb_probe(device_t dev) +{ + const struct bhnd_chipid *cid; + + /* Check bus type */ + cid = BHNDB_GET_CHIPID(device_get_parent(dev), dev); + if (cid->chip_type != BHND_CHIPTYPE_BCMA) + return (ENXIO); + + /* Delegate to default probe implementation */ + return (bcma_probe(dev)); +} + +static int +bcma_bhndb_attach(device_t dev) +{ + const struct bhnd_chipid *cid; + struct resource *erom_res; + int error; + int rid; + + cid = BHNDB_GET_CHIPID(device_get_parent(dev), dev); + + /* Map the EROM resource and enumerate our children. */ + rid = 0; + erom_res = bus_alloc_resource(dev, SYS_RES_MEMORY, &rid, cid->enum_addr, + cid->enum_addr + BCMA_EROM_TABLE_SIZE, BCMA_EROM_TABLE_SIZE, + RF_ACTIVE); + if (erom_res == NULL) { + device_printf(dev, "failed to allocate EROM resource\n"); + return (ENXIO); + } + + error = bcma_add_children(dev, erom_res, BCMA_EROM_TABLE_START); + + /* Clean up */ + bus_release_resource(dev, SYS_RES_MEMORY, rid, erom_res); + if (error) + return (error); + + /* Initialize full bridge configuration */ + error = BHNDB_INIT_FULL_CONFIG(device_get_parent(dev), dev, + bhndb_bcma_priority_table); + if (error) + return (error); + + /* Call our superclass' implementation */ + return (bcma_attach(dev)); +} + +static int +bcma_bhndb_suspend_child(device_t dev, device_t child) +{ + struct bcma_devinfo *dinfo; + int error; + + if (device_get_parent(child) != dev) + BUS_SUSPEND_CHILD(device_get_parent(dev), child); + + if (device_is_suspended(child)) + return (EBUSY); + + dinfo = device_get_ivars(child); + + /* Suspend the child */ + if ((error = bhnd_generic_br_suspend_child(dev, child))) + return (error); + + /* Suspend child's agent resource */ + if (dinfo->res_agent != NULL) + BHNDB_SUSPEND_RESOURCE(device_get_parent(dev), dev, + SYS_RES_MEMORY, dinfo->res_agent->res); + + return (0); +} + +static int +bcma_bhndb_resume_child(device_t dev, device_t child) +{ + struct bcma_devinfo *dinfo; + int error; + + if (device_get_parent(child) != dev) + BUS_SUSPEND_CHILD(device_get_parent(dev), child); + + if (!device_is_suspended(child)) + return (EBUSY); + + dinfo = device_get_ivars(child); + + /* Resume child's agent resource */ + if (dinfo->res_agent != NULL) { + error = BHNDB_RESUME_RESOURCE(device_get_parent(dev), dev, + SYS_RES_MEMORY, dinfo->res_agent->res); + if (error) + return (error); + } + + /* Resume the child */ + if ((error = bhnd_generic_br_resume_child(dev, child))) { + /* On failure, re-suspend the agent resource */ + if (dinfo->res_agent != NULL) { + BHNDB_SUSPEND_RESOURCE(device_get_parent(dev), dev, + SYS_RES_MEMORY, dinfo->res_agent->res); + } + + return (error); + } + + return (0); +} + +static device_method_t bcma_bhndb_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, bcma_bhndb_probe), + DEVMETHOD(device_attach, bcma_bhndb_attach), + + /* Bus interface */ + DEVMETHOD(bus_suspend_child, bcma_bhndb_suspend_child), + DEVMETHOD(bus_resume_child, bcma_bhndb_resume_child), + + DEVMETHOD_END +}; + +DEFINE_CLASS_1(bhnd, bcma_bhndb_driver, bcma_bhndb_methods, + sizeof(struct bcma_softc), bcma_driver); + +DRIVER_MODULE(bcma_bhndb, bhndb, bcma_bhndb_driver, bhnd_devclass, NULL, NULL); + +MODULE_VERSION(bcma_bhndb, 1); +MODULE_DEPEND(bcma_bhndb, bcma, 1, 1, 1); +MODULE_DEPEND(bcma_bhndb, bhndb, 1, 1, 1); Added: head/sys/dev/bhnd/bcma/bcma_dmp.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/bhnd/bcma/bcma_dmp.h Fri Feb 26 03:34:08 2016 (r296077) @@ -0,0 +1,193 @@ +/*- + * Copyright (c) 2015 Landon Fuller + * Copyright (c) 2010 Broadcom Corporation + * + * Portions of this file were derived from the aidmp.h header + * distributed with Broadcom's initial brcm80211 Linux driver release, as + * contributed to the Linux staging repository. + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY + * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION + * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN + * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + * $FreeBSD$ + */ + +#ifndef _BCMA_BCMA_DMP_H_ +#define _BCMA_BCMA_DMP_H_ + +/* + * PL-368 Device Management Plugin (DMP) Registers & Constants + * + * The "DMP" core used in Broadcom HND devices has been described + * by Broadcom engineers (and in published header files) as being + * ARM's PL-368 "Device Management Plugin" system IP, included with + * the CoreLink AMBA Designer tooling. + * + * Documentation for the PL-368 is not publicly available, however, + * and the only public reference by ARM to its existence appears to be + * in the proprietary "NIC-301 Interconnect Device Management (PL368)" + * errata publication, available to licensees as part of ARM's + * CoreLink Controllers and Peripherals Engineering Errata. + */ + +/* Out-of-band Router registers */ +#define BCMA_OOB_BUSCONFIG 0x020 +#define BCMA_OOB_STATUSA 0x100 +#define BCMA_OOB_STATUSB 0x104 +#define BCMA_OOB_STATUSC 0x108 +#define BCMA_OOB_STATUSD 0x10c +#define BCMA_OOB_ENABLEA0 0x200 +#define BCMA_OOB_ENABLEA1 0x204 +#define BCMA_OOB_ENABLEA2 0x208 +#define BCMA_OOB_ENABLEA3 0x20c +#define BCMA_OOB_ENABLEB0 0x280 +#define BCMA_OOB_ENABLEB1 0x284 +#define BCMA_OOB_ENABLEB2 0x288 +#define BCMA_OOB_ENABLEB3 0x28c +#define BCMA_OOB_ENABLEC0 0x300 +#define BCMA_OOB_ENABLEC1 0x304 +#define BCMA_OOB_ENABLEC2 0x308 +#define BCMA_OOB_ENABLEC3 0x30c +#define BCMA_OOB_ENABLED0 0x380 +#define BCMA_OOB_ENABLED1 0x384 +#define BCMA_OOB_ENABLED2 0x388 +#define BCMA_OOB_ENABLED3 0x38c +#define BCMA_OOB_ITCR 0xf00 +#define BCMA_OOB_ITIPOOBA 0xf10 +#define BCMA_OOB_ITIPOOBB 0xf14 +#define BCMA_OOB_ITIPOOBC 0xf18 +#define BCMA_OOB_ITIPOOBD 0xf1c +#define BCMA_OOB_ITOPOOBA 0xf30 +#define BCMA_OOB_ITOPOOBB 0xf34 +#define BCMA_OOB_ITOPOOBC 0xf38 +#define BCMA_OOB_ITOPOOBD 0xf3c + +/* DMP wrapper registers */ +#define BCMA_DMP_OOBSELINA30 0x000 +#define BCMA_DMP_OOBSELINA74 0x004 +#define BCMA_DMP_OOBSELINB30 0x020 +#define BCMA_DMP_OOBSELINB74 0x024 +#define BCMA_DMP_OOBSELINC30 0x040 +#define BCMA_DMP_OOBSELINC74 0x044 +#define BCMA_DMP_OOBSELIND30 0x060 +#define BCMA_DMP_OOBSELIND74 0x064 +#define BCMA_DMP_OOBSELOUTA30 0x100 +#define BCMA_DMP_OOBSELOUTA74 0x104 +#define BCMA_DMP_OOBSELOUTB30 0x120 +#define BCMA_DMP_OOBSELOUTB74 0x124 +#define BCMA_DMP_OOBSELOUTC30 0x140 +#define BCMA_DMP_OOBSELOUTC74 0x144 +#define BCMA_DMP_OOBSELOUTD30 0x160 +#define BCMA_DMP_OOBSELOUTD74 0x164 +#define BCMA_DMP_OOBSYNCA 0x200 +#define BCMA_DMP_OOBSELOUTAEN 0x204 +#define BCMA_DMP_OOBSYNCB 0x220 +#define BCMA_DMP_OOBSELOUTBEN 0x224 +#define BCMA_DMP_OOBSYNCC 0x240 +#define BCMA_DMP_OOBSELOUTCEN 0x244 +#define BCMA_DMP_OOBSYNCD 0x260 +#define BCMA_DMP_OOBSELOUTDEN 0x264 +#define BCMA_DMP_OOBAEXTWIDTH 0x300 +#define BCMA_DMP_OOBAINWIDTH 0x304 +#define BCMA_DMP_OOBAOUTWIDTH 0x308 +#define BCMA_DMP_OOBBEXTWIDTH 0x320 +#define BCMA_DMP_OOBBINWIDTH 0x324 +#define BCMA_DMP_OOBBOUTWIDTH 0x328 +#define BCMA_DMP_OOBCEXTWIDTH 0x340 +#define BCMA_DMP_OOBCINWIDTH 0x344 +#define BCMA_DMP_OOBCOUTWIDTH 0x348 +#define BCMA_DMP_OOBDEXTWIDTH 0x360 +#define BCMA_DMP_OOBDINWIDTH 0x364 +#define BCMA_DMP_OOBDOUTWIDTH 0x368 + +// This was inherited from Broadcom's aidmp.h header +// Is it required for any of our use-cases? +#if 0 /* defined(IL_BIGENDIAN) && defined(BCMHND74K) */ +/* Selective swapped defines for those registers we need in + * big-endian code. + */ +#define BCMA_DMP_IOCTRLSET 0x404 +#define BCMA_DMP_IOCTRLCLEAR 0x400 +#define BCMA_DMP_IOCTRL 0x40c +#define BCMA_DMP_IOSTATUS 0x504 +#define BCMA_DMP_RESETCTRL 0x804 +#define BCMA_DMP_RESETSTATUS 0x800 + +#else /* !IL_BIGENDIAN || !BCMHND74K */ + +#define BCMA_DMP_IOCTRLSET 0x400 +#define BCMA_DMP_IOCTRLCLEAR 0x404 +#define BCMA_DMP_IOCTRL 0x408 +#define BCMA_DMP_IOSTATUS 0x500 +#define BCMA_DMP_RESETCTRL 0x800 +#define BCMA_DMP_RESETSTATUS 0x804 + +#endif /* IL_BIGENDIAN && BCMHND74K */ + +#define BCMA_DMP_IOCTRLWIDTH 0x700 +#define BCMA_DMP_IOSTATUSWIDTH 0x704 + +#define BCMA_DMP_RESETREADID 0x808 +#define BCMA_DMP_RESETWRITEID 0x80c +#define BCMA_DMP_ERRLOGCTRL 0xa00 +#define BCMA_DMP_ERRLOGDONE 0xa04 +#define BCMA_DMP_ERRLOGSTATUS 0xa08 +#define BCMA_DMP_ERRLOGADDRLO 0xa0c +#define BCMA_DMP_ERRLOGADDRHI 0xa10 +#define BCMA_DMP_ERRLOGID 0xa14 +#define BCMA_DMP_ERRLOGUSER 0xa18 +#define BCMA_DMP_ERRLOGFLAGS 0xa1c +#define BCMA_DMP_INTSTATUS 0xa00 +#define BCMA_DMP_CONFIG 0xe00 +#define BCMA_DMP_ITCR 0xf00 +#define BCMA_DMP_ITIPOOBA 0xf10 +#define BCMA_DMP_ITIPOOBB 0xf14 +#define BCMA_DMP_ITIPOOBC 0xf18 +#define BCMA_DMP_ITIPOOBD 0xf1c +#define BCMA_DMP_ITIPOOBAOUT 0xf30 +#define BCMA_DMP_ITIPOOBBOUT 0xf34 +#define BCMA_DMP_ITIPOOBCOUT 0xf38 +#define BCMA_DMP_ITIPOOBDOUT 0xf3c +#define BCMA_DMP_ITOPOOBA 0xf50 +#define BCMA_DMP_ITOPOOBB 0xf54 +#define BCMA_DMP_ITOPOOBC 0xf58 +#define BCMA_DMP_ITOPOOBD 0xf5c +#define BCMA_DMP_ITOPOOBAIN 0xf70 +#define BCMA_DMP_ITOPOOBBIN 0xf74 +#define BCMA_DMP_ITOPOOBCIN 0xf78 +#define BCMA_DMP_ITOPOOBDIN 0xf7c +#define BCMA_DMP_ITOPRESET 0xf90 +#define BCMA_DMP_PERIPHERIALID4 0xfd0 +#define BCMA_DMP_PERIPHERIALID5 0xfd4 +#define BCMA_DMP_PERIPHERIALID6 0xfd8 +#define BCMA_DMP_PERIPHERIALID7 0xfdc +#define BCMA_DMP_PERIPHERIALID0 0xfe0 +#define BCMA_DMP_PERIPHERIALID1 0xfe4 +#define BCMA_DMP_PERIPHERIALID2 0xfe8 +#define BCMA_DMP_PERIPHERIALID3 0xfec +#define BCMA_DMP_COMPONENTID0 0xff0 +#define BCMA_DMP_COMPONENTID1 0xff4 +#define BCMA_DMP_COMPONENTID2 0xff8 +#define BCMA_DMP_COMPONENTID3 0xffc + +/* resetctrl */ +#define BMCA_DMP_RC_RESET 1 + +/* config */ +#define BCMA_DMP_CFG_OOB 0x00000020 +#define BCMA_DMP_CFG_IOS 0x00000010 +#define BCMA_DMP_CFGIOC 0x00000008 +#define BCMA_DMP_CFGTO 0x00000004 +#define BCMA_DMP_CFGERRL 0x00000002 +#define BCMA_DMP_CFGRST 0x00000001 + +#endif /* _BCMA_BCMA_DMP_H_ */ Added: head/sys/dev/bhnd/bcma/bcma_erom.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/bhnd/bcma/bcma_erom.c Fri Feb 26 03:34:08 2016 (r296077) @@ -0,0 +1,897 @@ +/*- + * Copyright (c) 2015 Landon Fuller + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer, + * without modification. + * 2. Redistributions in binary form must reproduce at minimum a disclaimer + * similar to the "NO WARRANTY" disclaimer below ("Disclaimer") and any + * redistribution must be conditioned upon including a substantially + * similar Disclaimer requirement for further binary redistribution. + * + * NO WARRANTY + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF NONINFRINGEMENT, MERCHANTIBILITY + * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL + * THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, + * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER + * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF + * THE POSSIBILITY OF SUCH DAMAGES. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include + +#include +#include + +#include "bcma_eromreg.h" +#include "bcma_eromvar.h" + +/* + * BCMA Enumeration ROM (EROM) Table + * + * Provides auto-discovery of BCMA cores on Broadcom's HND SoC. + * + * The EROM core address can be found at BCMA_CC_EROM_ADDR within the + * ChipCommon registers. The table itself is comprised of 32-bit + * type-tagged entries, organized into an array of variable-length + * core descriptor records. + * + * The final core descriptor is followed by a 32-bit BCMA_EROM_TABLE_EOF (0xF) + * marker. + */ + +static const char *erom_entry_type_name (uint8_t entry); +static int erom_read32(struct bcma_erom *erom, uint32_t *entry); +static int erom_skip32(struct bcma_erom *erom); + +static int erom_skip_core(struct bcma_erom *erom); +static int erom_skip_mport(struct bcma_erom *erom); +static int erom_skip_sport_region(struct bcma_erom *erom); + +static int erom_seek_next(struct bcma_erom *erom, uint8_t etype); + +#define EROM_LOG(erom, fmt, ...) \ + device_printf(erom->dev, "erom[0x%llx]: " fmt, \ + (unsigned long long) (erom->offset), ##__VA_ARGS__); + +/** + * Open an EROM table for reading. + * + * @param[out] erom On success, will be populated with a valid EROM + * read state. *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Fri Feb 26 03:34:34 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B98B3AB58F7; Fri, 26 Feb 2016 03:34:34 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 789821A06; Fri, 26 Feb 2016 03:34:34 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1Q3YXEh000861; Fri, 26 Feb 2016 03:34:33 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1Q3YWok000848; Fri, 26 Feb 2016 03:34:32 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201602260334.u1Q3YWok000848@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Fri, 26 Feb 2016 03:34:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r296078 - in head/sys/modules/bhnd: . bcma bcma_bhndb bhndb bhndb_pci cores cores/bhnd_chipc cores/bhnd_pci cores/bhnd_pci_hostb cores/bhnd_pcib nvram siba siba_bhndb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Feb 2016 03:34:34 -0000 Author: adrian Date: Fri Feb 26 03:34:32 2016 New Revision: 296078 URL: https://svnweb.freebsd.org/changeset/base/296078 Log: Add modules support for the bhnd code. Submitted by: Landon Fuller Obtained from: https://github.com/landonf/freebsd/compare/user/landonf/bcm4331-CURRENT Added: head/sys/modules/bhnd/ head/sys/modules/bhnd/Makefile (contents, props changed) head/sys/modules/bhnd/bcma/ head/sys/modules/bhnd/bcma/Makefile (contents, props changed) head/sys/modules/bhnd/bcma_bhndb/ head/sys/modules/bhnd/bcma_bhndb/Makefile (contents, props changed) head/sys/modules/bhnd/bhndb/ head/sys/modules/bhnd/bhndb/Makefile (contents, props changed) head/sys/modules/bhnd/bhndb_pci/ head/sys/modules/bhnd/bhndb_pci/Makefile (contents, props changed) head/sys/modules/bhnd/cores/ head/sys/modules/bhnd/cores/Makefile (contents, props changed) head/sys/modules/bhnd/cores/bhnd_chipc/ head/sys/modules/bhnd/cores/bhnd_chipc/Makefile (contents, props changed) head/sys/modules/bhnd/cores/bhnd_pci/ head/sys/modules/bhnd/cores/bhnd_pci/Makefile (contents, props changed) head/sys/modules/bhnd/cores/bhnd_pci_hostb/ head/sys/modules/bhnd/cores/bhnd_pci_hostb/Makefile (contents, props changed) head/sys/modules/bhnd/cores/bhnd_pcib/ head/sys/modules/bhnd/cores/bhnd_pcib/Makefile (contents, props changed) head/sys/modules/bhnd/nvram/ head/sys/modules/bhnd/nvram/Makefile (contents, props changed) head/sys/modules/bhnd/siba/ head/sys/modules/bhnd/siba/Makefile (contents, props changed) head/sys/modules/bhnd/siba_bhndb/ head/sys/modules/bhnd/siba_bhndb/Makefile (contents, props changed) Added: head/sys/modules/bhnd/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/modules/bhnd/Makefile Fri Feb 26 03:34:32 2016 (r296078) @@ -0,0 +1,21 @@ +# $FreeBSD$ + +.PATH: ${.CURDIR}/../../dev/bhnd + +KMOD= bhnd +SRCS= bhnd.c bhnd_subr.c \ + bhnd_bus_if.c bhnd_bus_if.h + +SRCS+= device_if.h bus_if.h + +SUBDIR= bcma \ + bcma_bhndb \ + bhndb \ + bhndb_pci \ + cores \ + nvram \ + siba \ + siba_bhndb + +.include +.include Added: head/sys/modules/bhnd/bcma/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/modules/bhnd/bcma/Makefile Fri Feb 26 03:34:32 2016 (r296078) @@ -0,0 +1,10 @@ +# $FreeBSD$ + +.PATH: ${.CURDIR}/../../../dev/bhnd/bcma + +KMOD= bcma +SRCS= bcma.c bcma_subr.c bcma_erom.c + +SRCS+= device_if.h bus_if.h bhnd_bus_if.h + +.include Added: head/sys/modules/bhnd/bcma_bhndb/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/modules/bhnd/bcma_bhndb/Makefile Fri Feb 26 03:34:32 2016 (r296078) @@ -0,0 +1,11 @@ +# $FreeBSD$ + +.PATH: ${.CURDIR}/../../../dev/bhnd/bcma + +KMOD= bcma_bhndb +SRCS= bcma_bhndb.c + +SRCS+= bhnd_bus_if.h bhndb_if.h +SRCS+= device_if.h bus_if.h + +.include Added: head/sys/modules/bhnd/bhndb/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/modules/bhnd/bhndb/Makefile Fri Feb 26 03:34:32 2016 (r296078) @@ -0,0 +1,12 @@ +# $FreeBSD$ + +.PATH: ${.CURDIR}/../../../dev/bhnd/bhndb + +KMOD= bhndb +SRCS= bhndb.c bhndb_subr.c bhndb_hwdata.c \ + bhndb_bus_if.c bhndb_bus_if.h \ + bhndb_if.c bhndb_if.h + +SRCS+= device_if.h bus_if.h + +.include Added: head/sys/modules/bhnd/bhndb_pci/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/modules/bhnd/bhndb_pci/Makefile Fri Feb 26 03:34:32 2016 (r296078) @@ -0,0 +1,11 @@ +# $FreeBSD$ + +.PATH: ${.CURDIR}/../../../dev/bhnd/bhndb + +KMOD= bhndb_pci +SRCS= bhndb_pci.c bhndb_pci_hwdata.c +SRCS+= bhnd_bus_if.h bhndb_bus_if.h bhndb_if.h + +SRCS+= device_if.h bus_if.h + +.include Added: head/sys/modules/bhnd/cores/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/modules/bhnd/cores/Makefile Fri Feb 26 03:34:32 2016 (r296078) @@ -0,0 +1,8 @@ +# $FreeBSD$ + +SUBDIR= bhnd_chipc \ + bhnd_pci \ + bhnd_pci_hostb \ + bhnd_pcib + +.include Added: head/sys/modules/bhnd/cores/bhnd_chipc/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/modules/bhnd/cores/bhnd_chipc/Makefile Fri Feb 26 03:34:32 2016 (r296078) @@ -0,0 +1,10 @@ +# $FreeBSD$ + +.PATH: ${.CURDIR}/../../../../dev/bhnd/cores/chipc + +KMOD= bhnd_chipc +SRCS= chipc.c \ + bhnd_chipc_if.c bhnd_chipc_if.h +SRCS+= device_if.h bus_if.h bhnd_bus_if.h + +.include Added: head/sys/modules/bhnd/cores/bhnd_pci/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/modules/bhnd/cores/bhnd_pci/Makefile Fri Feb 26 03:34:32 2016 (r296078) @@ -0,0 +1,11 @@ +# $FreeBSD$ + +.PATH: ${.CURDIR}/../../../../dev/bhnd/cores/pci + +KMOD= bhnd_pci +SRCS= bhnd_pci.c \ + mdio_pcie.c +SRCS+= device_if.h bus_if.h bhnd_bus_if.h \ + mdio_if.h + +.include Added: head/sys/modules/bhnd/cores/bhnd_pci_hostb/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/modules/bhnd/cores/bhnd_pci_hostb/Makefile Fri Feb 26 03:34:32 2016 (r296078) @@ -0,0 +1,9 @@ +# $FreeBSD$ + +.PATH: ${.CURDIR}/../../../../dev/bhnd/cores/pci + +KMOD= bhnd_pci_hostb +SRCS= bhnd_pci_hostb.c +SRCS+= device_if.h bus_if.h bhnd_bus_if.h + +.include Added: head/sys/modules/bhnd/cores/bhnd_pcib/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/modules/bhnd/cores/bhnd_pcib/Makefile Fri Feb 26 03:34:32 2016 (r296078) @@ -0,0 +1,9 @@ +# $FreeBSD$ + +.PATH: ${.CURDIR}/../../../../dev/bhnd/cores/pci + +KMOD= bhnd_pcib +SRCS= bhnd_pcib.c +SRCS+= device_if.h bus_if.h bhnd_bus_if.h + +.include Added: head/sys/modules/bhnd/nvram/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/modules/bhnd/nvram/Makefile Fri Feb 26 03:34:32 2016 (r296078) @@ -0,0 +1,10 @@ +# $FreeBSD$ + +.PATH: ${.CURDIR}/../../../dev/bhnd/nvram + +KMOD= bhnd_nvram +SRCS= bhnd_nvram_if.c bhnd_nvram_if.h + +SRCS+= device_if.h bus_if.h + +.include Added: head/sys/modules/bhnd/siba/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/modules/bhnd/siba/Makefile Fri Feb 26 03:34:32 2016 (r296078) @@ -0,0 +1,10 @@ +# $FreeBSD$ + +.PATH: ${.CURDIR}/../../../dev/bhnd/siba + +KMOD= siba +SRCS= siba.c siba_subr.c + +SRCS+= device_if.h bus_if.h bhnd_bus_if.h + +.include Added: head/sys/modules/bhnd/siba_bhndb/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/modules/bhnd/siba_bhndb/Makefile Fri Feb 26 03:34:32 2016 (r296078) @@ -0,0 +1,11 @@ +# $FreeBSD$ + +.PATH: ${.CURDIR}/../../../dev/bhnd/siba + +KMOD= siba_bhndb +SRCS= siba_bhndb.c + +SRCS+= bhnd_bus_if.h bhndb_if.h +SRCS+= device_if.h bus_if.h + +.include From owner-svn-src-head@freebsd.org Fri Feb 26 08:06:27 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 008B5AB5633; Fri, 26 Feb 2016 08:06:27 +0000 (UTC) (envelope-from sgalabov@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C5661CF6; Fri, 26 Feb 2016 08:06:26 +0000 (UTC) (envelope-from sgalabov@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1Q86Pfr079476; Fri, 26 Feb 2016 08:06:25 GMT (envelope-from sgalabov@FreeBSD.org) Received: (from sgalabov@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1Q86PR1079474; Fri, 26 Feb 2016 08:06:25 GMT (envelope-from sgalabov@FreeBSD.org) Message-Id: <201602260806.u1Q86PR1079474@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sgalabov set sender to sgalabov@FreeBSD.org using -f From: Stanislav Galabov Date: Fri, 26 Feb 2016 08:06:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r296079 - in head/sys/boot: ficl mips/beri/loader X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Feb 2016 08:06:27 -0000 Author: sgalabov Date: Fri Feb 26 08:06:25 2016 New Revision: 296079 URL: https://svnweb.freebsd.org/changeset/base/296079 Log: Currently BERI's loader is including the 32-bit version of the FICL MIPS sysdep.h (sys/boot/ficl/mips/sysdep.h) instead of the 64-bit version (sys/boot/ficl/mips64/sysdep.h). Although this may not be an issue in practice, it would be more correct if the 64-bit version was used. Also, using the 64-bit version would make it easier to add support for 64-bit ubldr on MIPS. Approved by: adrian (mentor) Differential Revision: https://reviews.freebsd.org/D5310 Modified: head/sys/boot/ficl/Makefile head/sys/boot/mips/beri/loader/Makefile Modified: head/sys/boot/ficl/Makefile ============================================================================== --- head/sys/boot/ficl/Makefile Fri Feb 26 03:34:32 2016 (r296078) +++ head/sys/boot/ficl/Makefile Fri Feb 26 08:06:25 2016 (r296079) @@ -55,6 +55,8 @@ CFLAGS+= -m32 -mcpu=powerpc -I. .if ${MACHINE_CPUARCH} == "amd64" && defined(FICL32) FICL_CPUARCH= i386 +.elif ${MACHINE_ARCH} == "mips64" || ${MACHINE_ARCH} == "mips64el" +FICL_CPUARCH= mips64 .else FICL_CPUARCH= ${MACHINE_CPUARCH} .endif Modified: head/sys/boot/mips/beri/loader/Makefile ============================================================================== --- head/sys/boot/mips/beri/loader/Makefile Fri Feb 26 03:34:32 2016 (r296078) +++ head/sys/boot/mips/beri/loader/Makefile Fri Feb 26 08:06:25 2016 (r296079) @@ -72,7 +72,7 @@ CFLAGS+= -DLOADER_BZIP2_SUPPORT # Enable BootForth BOOT_FORTH= yes CFLAGS+= -DBOOT_FORTH -I${.CURDIR}/../../../ficl -CFLAGS+= -I${.CURDIR}/../../../ficl/mips +CFLAGS+= -I${.CURDIR}/../../../ficl/mips64 LIBFICL= ${.OBJDIR}/../../../ficl/libficl.a .endif From owner-svn-src-head@freebsd.org Fri Feb 26 08:16:46 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7FEB5AB5A89; Fri, 26 Feb 2016 08:16:46 +0000 (UTC) (envelope-from sgalabov@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4B992132A; Fri, 26 Feb 2016 08:16:46 +0000 (UTC) (envelope-from sgalabov@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1Q8GjOM082545; Fri, 26 Feb 2016 08:16:45 GMT (envelope-from sgalabov@FreeBSD.org) Received: (from sgalabov@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1Q8Gjn8082541; Fri, 26 Feb 2016 08:16:45 GMT (envelope-from sgalabov@FreeBSD.org) Message-Id: <201602260816.u1Q8Gjn8082541@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sgalabov set sender to sgalabov@FreeBSD.org using -f From: Stanislav Galabov Date: Fri, 26 Feb 2016 08:16:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r296080 - in head/sys/boot: fdt uboot/fdt uboot/lib X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Feb 2016 08:16:46 -0000 Author: sgalabov Date: Fri Feb 26 08:16:44 2016 New Revision: 296080 URL: https://svnweb.freebsd.org/changeset/base/296080 Log: So far bsd.stand.mk wasn't included in the following files: sys/boot/fdt/Makefile sys/boot/uboot/fdt/Makefile sys/boot/uboot/lib/Makefile This causes compilation issues on MIPS due to trying to link PIC with non-PIC code. This revision includes bsd.stand.mk in the above files. Reviewed by: imp Approved by: adrian (mentor) Sponsored by: Smartcom - Bulgaria AD Differential Revision: https://reviews.freebsd.org/D5311 Modified: head/sys/boot/fdt/Makefile head/sys/boot/uboot/fdt/Makefile head/sys/boot/uboot/lib/Makefile Modified: head/sys/boot/fdt/Makefile ============================================================================== --- head/sys/boot/fdt/Makefile Fri Feb 26 08:06:25 2016 (r296079) +++ head/sys/boot/fdt/Makefile Fri Feb 26 08:16:44 2016 (r296080) @@ -26,4 +26,5 @@ CFLAGS+= -m32 CFLAGS+= -Wformat -Wall +.include .include Modified: head/sys/boot/uboot/fdt/Makefile ============================================================================== --- head/sys/boot/uboot/fdt/Makefile Fri Feb 26 08:06:25 2016 (r296079) +++ head/sys/boot/uboot/fdt/Makefile Fri Feb 26 08:16:44 2016 (r296080) @@ -28,6 +28,7 @@ machine: CLEANFILES+= machine +.include .include beforedepend ${OBJS}: machine Modified: head/sys/boot/uboot/lib/Makefile ============================================================================== --- head/sys/boot/uboot/lib/Makefile Fri Feb 26 08:06:25 2016 (r296079) +++ head/sys/boot/uboot/lib/Makefile Fri Feb 26 08:16:44 2016 (r296080) @@ -46,6 +46,7 @@ machine: CLEANFILES+= machine +.include .include beforedepend ${OBJS}: machine From owner-svn-src-head@freebsd.org Fri Feb 26 08:35:06 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 86136AB5EA1; Fri, 26 Feb 2016 08:35:06 +0000 (UTC) (envelope-from wma@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 47FAD1D36; Fri, 26 Feb 2016 08:35:06 +0000 (UTC) (envelope-from wma@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1Q8Z5pI088498; Fri, 26 Feb 2016 08:35:05 GMT (envelope-from wma@FreeBSD.org) Received: (from wma@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1Q8Z5KT088496; Fri, 26 Feb 2016 08:35:05 GMT (envelope-from wma@FreeBSD.org) Message-Id: <201602260835.u1Q8Z5KT088496@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: wma set sender to wma@FreeBSD.org using -f From: Wojciech Macek Date: Fri, 26 Feb 2016 08:35:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r296081 - in head: sys/dev/pci usr.sbin/pciconf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Feb 2016 08:35:06 -0000 Author: wma Date: Fri Feb 26 08:35:04 2016 New Revision: 296081 URL: https://svnweb.freebsd.org/changeset/base/296081 Log: Add support for Enhanced Allocation in pciconf * Modified pciconf to print EA capability structure * Added register description to pcireg.h Obtained from: Semihalf Sponsored by: Cavium Approved by: cognet (mentor) Reviewed by: jhb Differential revision: https://reviews.freebsd.org/D5440 Modified: head/sys/dev/pci/pcireg.h head/usr.sbin/pciconf/cap.c Modified: head/sys/dev/pci/pcireg.h ============================================================================== --- head/sys/dev/pci/pcireg.h Fri Feb 26 08:16:44 2016 (r296080) +++ head/sys/dev/pci/pcireg.h Fri Feb 26 08:35:04 2016 (r296081) @@ -146,6 +146,7 @@ #define PCIY_MSIX 0x11 /* MSI-X */ #define PCIY_SATA 0x12 /* SATA */ #define PCIY_PCIAF 0x13 /* PCI Advanced Features */ +#define PCIY_EA 0x14 /* PCI Extended Allocation */ /* Extended Capability Register Fields */ @@ -586,6 +587,52 @@ #define PCIR_MSI_MASK 0x10 #define PCIR_MSI_PENDING 0x14 +/* PCI Enhanced Allocation registers */ +#define PCIR_EA_NUM_ENT 2 /* Number of Capability Entries */ +#define PCIM_EA_NUM_ENT_MASK 0x3f /* Num Entries Mask */ +#define PCIR_EA_FIRST_ENT 4 /* First EA Entry in List */ +#define PCIR_EA_FIRST_ENT_BRIDGE 8 /* First EA Entry for Bridges */ +#define PCIM_EA_ES 0x00000007 /* Entry Size */ +#define PCIM_EA_BEI 0x000000f0 /* BAR Equivalent Indicator */ +#define PCIM_EA_BEI_OFFSET 4 +/* 0-5 map to BARs 0-5 respectively */ +#define PCIM_EA_BEI_BAR_0 0 +#define PCIM_EA_BEI_BAR_5 5 +#define PCIM_EA_BEI_BAR(x) (((x) >> PCIM_EA_BEI_OFFSET) & 0xf) +#define PCIM_EA_BEI_BRIDGE 0x6 /* Resource behind bridge */ +#define PCIM_EA_BEI_ENI 0x7 /* Equivalent Not Indicated */ +#define PCIM_EA_BEI_ROM 0x8 /* Expansion ROM */ +/* 9-14 map to VF BARs 0-5 respectively */ +#define PCIM_EA_BEI_VF_BAR_0 9 +#define PCIM_EA_BEI_VF_BAR_5 14 +#define PCIM_EA_BEI_RESERVED 0xf /* Reserved - Treat like ENI */ +#define PCIM_EA_PP 0x0000ff00 /* Primary Properties */ +#define PCIM_EA_PP_OFFSET 8 +#define PCIM_EA_SP_OFFSET 16 +#define PCIM_EA_SP 0x00ff0000 /* Secondary Properties */ +#define PCIM_EA_P_MEM 0x00 /* Non-Prefetch Memory */ +#define PCIM_EA_P_MEM_PREFETCH 0x01 /* Prefetchable Memory */ +#define PCIM_EA_P_IO 0x02 /* I/O Space */ +#define PCIM_EA_P_VF_MEM_PREFETCH 0x03 /* VF Prefetchable Memory */ +#define PCIM_EA_P_VF_MEM 0x04 /* VF Non-Prefetch Memory */ +#define PCIM_EA_P_BRIDGE_MEM 0x05 /* Bridge Non-Prefetch Memory */ +#define PCIM_EA_P_BRIDGE_MEM_PREFETCH 0x06 /* Bridge Prefetchable Memory */ +#define PCIM_EA_P_BRIDGE_IO 0x07 /* Bridge I/O Space */ +/* 0x08-0xfc reserved */ +#define PCIM_EA_P_MEM_RESERVED 0xfd /* Reserved Memory */ +#define PCIM_EA_P_IO_RESERVED 0xfe /* Reserved I/O Space */ +#define PCIM_EA_P_UNAVAILABLE 0xff /* Entry Unavailable */ +#define PCIM_EA_WRITABLE 0x40000000 /* Writable: 1 = RW, 0 = HwInit */ +#define PCIM_EA_ENABLE 0x80000000 /* Enable for this entry */ +#define PCIM_EA_BASE 4 /* Base Address Offset */ +#define PCIM_EA_MAX_OFFSET 8 /* MaxOffset (resource length) */ +/* bit 0 is reserved */ +#define PCIM_EA_IS_64 0x00000002 /* 64-bit field flag */ +#define PCIM_EA_FIELD_MASK 0xfffffffc /* For Base & Max Offset */ +/* Bridge config register */ +#define PCIM_EA_SEC_NR(reg) ((reg) & 0xff) +#define PCIM_EA_SUB_NR(reg) (((reg) >> 8) & 0xff) + /* PCI-X definitions */ /* For header type 0 devices */ Modified: head/usr.sbin/pciconf/cap.c ============================================================================== --- head/usr.sbin/pciconf/cap.c Fri Feb 26 08:16:44 2016 (r296080) +++ head/usr.sbin/pciconf/cap.c Fri Feb 26 08:35:04 2016 (r296081) @@ -534,6 +534,141 @@ cap_pciaf(int fd, struct pci_conf *p, ui cap & PCIM_PCIAFCAP_TP ? " TP" : ""); } +static const char * +ea_bei_to_name(uint8_t bei) +{ + static const char *barstr[] = { + "BAR0", "BAR1", "BAR2", "BAR3", "BAR4", "BAR5" + }; + static const char *vfbarstr[] = { + "VFBAR0", "VFBAR1", "VFBAR2", "VFBAR3", "VFBAR4", "VFBAR5" + }; + + if ((bei >= PCIM_EA_BEI_BAR_0) && (bei <= PCIM_EA_BEI_BAR_5)) + return (barstr[bei - PCIM_EA_BEI_BAR_0]); + if ((bei >= PCIM_EA_BEI_VF_BAR_0) && (bei <= PCIM_EA_BEI_VF_BAR_5)) + return (vfbarstr[bei - PCIM_EA_BEI_VF_BAR_0]); + + switch (bei) { + case PCIM_EA_BEI_BRIDGE: + return "BRIDGE"; + case PCIM_EA_BEI_ENI: + return "ENI"; + case PCIM_EA_BEI_ROM: + return "ROM"; + case PCIM_EA_BEI_RESERVED: + default: + return "RSVD"; + } +} + +static const char * +ea_prop_to_name(uint8_t prop) +{ + + switch (prop) { + case PCIM_EA_P_MEM: + return "Non-Prefetchable Memory"; + case PCIM_EA_P_MEM_PREFETCH: + return "Prefetchable Memory"; + case PCIM_EA_P_IO: + return "I/O Space"; + case PCIM_EA_P_VF_MEM_PREFETCH: + return "VF Prefetchable Memory"; + case PCIM_EA_P_VF_MEM: + return "VF Non-Prefetchable Memory"; + case PCIM_EA_P_BRIDGE_MEM: + return "Bridge Non-Prefetchable Memory"; + case PCIM_EA_P_BRIDGE_MEM_PREFETCH: + return "Bridge Prefetchable Memory"; + case PCIM_EA_P_BRIDGE_IO: + return "Bridge I/O Space"; + case PCIM_EA_P_MEM_RESERVED: + return "Reserved Memory"; + case PCIM_EA_P_IO_RESERVED: + return "Reserved I/O Space"; + case PCIM_EA_P_UNAVAILABLE: + return "Unavailable"; + default: + return "Reserved"; + } +} + +static void +cap_ea(int fd, struct pci_conf *p, uint8_t ptr) +{ + int num_ent; + int a, b; + uint32_t bei; + uint32_t val; + int ent_size; + uint32_t dw[4]; + uint32_t flags, flags_pp, flags_sp; + uint64_t base, max_offset; + uint8_t fixed_sub_bus_nr, fixed_sec_bus_nr; + + /* Determine the number of entries */ + num_ent = read_config(fd, &p->pc_sel, ptr + PCIR_EA_NUM_ENT, 2); + num_ent &= PCIM_EA_NUM_ENT_MASK; + + printf("PCI Enhanced Allocation (%d entries)", num_ent); + + /* Find the first entry to care of */ + ptr += PCIR_EA_FIRST_ENT; + + /* Print BUS numbers for bridges */ + if ((p->pc_hdr & PCIM_HDRTYPE) == PCIM_HDRTYPE_BRIDGE) { + val = read_config(fd, &p->pc_sel, ptr, 4); + + fixed_sec_bus_nr = PCIM_EA_SEC_NR(val); + fixed_sub_bus_nr = PCIM_EA_SUB_NR(val); + + printf("\n\t\t BRIDGE, sec bus [%d], sub bus [%d]", + fixed_sec_bus_nr, fixed_sub_bus_nr); + ptr += 4; + } + + for (a = 0; a < num_ent; a++) { + /* Read a number of dwords in the entry */ + val = read_config(fd, &p->pc_sel, ptr, 4); + ptr += 4; + ent_size = (val & PCIM_EA_ES); + + for (b = 0; b < ent_size; b++) { + dw[b] = read_config(fd, &p->pc_sel, ptr, 4); + ptr += 4; + } + + flags = val; + flags_pp = (flags & PCIM_EA_PP) >> PCIM_EA_PP_OFFSET; + flags_sp = (flags & PCIM_EA_SP) >> PCIM_EA_SP_OFFSET; + bei = (PCIM_EA_BEI & val) >> PCIM_EA_BEI_OFFSET; + + base = dw[0] & PCIM_EA_FIELD_MASK; + max_offset = dw[1] | ~PCIM_EA_FIELD_MASK; + b = 2; + if (((dw[0] & PCIM_EA_IS_64) != 0) && (b < ent_size)) { + base |= (uint64_t)dw[b] << 32UL; + b++; + } + if (((dw[1] & PCIM_EA_IS_64) != 0) + && (b < ent_size)) { + max_offset |= (uint64_t)dw[b] << 32UL; + b++; + } + + printf("\n\t\t [%d] %s, %s, %s, base [0x%lx], size [0x%lx]" + "\n\t\t\tPrimary properties [0x%x] (%s)" + "\n\t\t\tSecondary properties [0x%x] (%s)", + bei, ea_bei_to_name(bei), + (flags & PCIM_EA_ENABLE ? "Enabled" : "Disabled"), + (flags & PCIM_EA_WRITABLE ? "Writable" : "Read-only"), + base, max_offset + 1, + flags_pp, ea_prop_to_name(flags_pp), + flags_sp, ea_prop_to_name(flags_sp)); + } +} + void list_caps(int fd, struct pci_conf *p) { @@ -605,6 +740,9 @@ list_caps(int fd, struct pci_conf *p) case PCIY_PCIAF: cap_pciaf(fd, p, ptr); break; + case PCIY_EA: + cap_ea(fd, p, ptr); + break; default: printf("unknown"); break; From owner-svn-src-head@freebsd.org Fri Feb 26 08:43:37 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CE342AB412E; Fri, 26 Feb 2016 08:43:37 +0000 (UTC) (envelope-from wma@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9B2541CE; Fri, 26 Feb 2016 08:43:37 +0000 (UTC) (envelope-from wma@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1Q8haQ1091251; Fri, 26 Feb 2016 08:43:36 GMT (envelope-from wma@FreeBSD.org) Received: (from wma@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1Q8hapN091250; Fri, 26 Feb 2016 08:43:36 GMT (envelope-from wma@FreeBSD.org) Message-Id: <201602260843.u1Q8hapN091250@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: wma set sender to wma@FreeBSD.org using -f From: Wojciech Macek Date: Fri, 26 Feb 2016 08:43:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r296082 - head/sys/dev/uart X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Feb 2016 08:43:37 -0000 Author: wma Date: Fri Feb 26 08:43:36 2016 New Revision: 296082 URL: https://svnweb.freebsd.org/changeset/base/296082 Log: Add ns16550a compatible string in UART 8250 driver Obtained from: Semihalf Submitted by: Michal Stanek Sponsored by: Annapurna Labs Approved by: cognet (mentor) Reviewed by: imp, wma Differential revision: https://reviews.freebsd.org/D5404 Modified: head/sys/dev/uart/uart_dev_ns8250.c Modified: head/sys/dev/uart/uart_dev_ns8250.c ============================================================================== --- head/sys/dev/uart/uart_dev_ns8250.c Fri Feb 26 08:35:04 2016 (r296081) +++ head/sys/dev/uart/uart_dev_ns8250.c Fri Feb 26 08:43:36 2016 (r296082) @@ -397,6 +397,7 @@ struct uart_class uart_ns8250_class = { #ifdef FDT static struct ofw_compat_data compat_data[] = { {"ns16550", (uintptr_t)&uart_ns8250_class}, + {"ns16550a", (uintptr_t)&uart_ns8250_class}, {"snps,dw-apb-uart", (uintptr_t)&uart_ns8250_class}, {NULL, (uintptr_t)NULL}, }; From owner-svn-src-head@freebsd.org Fri Feb 26 09:17:33 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B06D6AB4FB8; Fri, 26 Feb 2016 09:17:33 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8C69A15F9; Fri, 26 Feb 2016 09:17:33 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1Q9HWmt000695; Fri, 26 Feb 2016 09:17:32 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1Q9HWdO000690; Fri, 26 Feb 2016 09:17:32 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201602260917.u1Q9HWdO000690@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Fri, 26 Feb 2016 09:17:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r296083 - in head/sys/dev/hyperv: include netvsc storvsc vmbus X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Feb 2016 09:17:33 -0000 Author: sephe Date: Fri Feb 26 09:17:31 2016 New Revision: 296083 URL: https://svnweb.freebsd.org/changeset/base/296083 Log: hyperv: Remove useless channel inbound_lock It serves no purpose. Reviewed by: Hongjiang Zhang MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D5450 Modified: head/sys/dev/hyperv/include/hyperv.h head/sys/dev/hyperv/netvsc/hv_net_vsc.c head/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c head/sys/dev/hyperv/vmbus/hv_channel.c head/sys/dev/hyperv/vmbus/hv_channel_mgmt.c Modified: head/sys/dev/hyperv/include/hyperv.h ============================================================================== --- head/sys/dev/hyperv/include/hyperv.h Fri Feb 26 08:43:36 2016 (r296082) +++ head/sys/dev/hyperv/include/hyperv.h Fri Feb 26 09:17:31 2016 (r296083) @@ -753,8 +753,6 @@ typedef struct hv_vmbus_channel { */ hv_vmbus_ring_buffer_info inbound; - struct mtx inbound_lock; - struct taskqueue * rxq; struct task channel_task; hv_vmbus_pfn_channel_callback on_channel_callback; Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_net_vsc.c Fri Feb 26 08:43:36 2016 (r296082) +++ head/sys/dev/hyperv/netvsc/hv_net_vsc.c Fri Feb 26 09:17:31 2016 (r296083) @@ -720,9 +720,7 @@ hv_nv_on_device_remove(struct hv_device netvsc_dev *net_dev = sc->net_dev;; /* Stop outbound traffic ie sends and receives completions */ - mtx_lock(&device->channel->inbound_lock); net_dev->destroy = TRUE; - mtx_unlock(&device->channel->inbound_lock); /* Wait for all send completions */ while (net_dev->num_outstanding_sends) { Modified: head/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c ============================================================================== --- head/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c Fri Feb 26 08:43:36 2016 (r296082) +++ head/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c Fri Feb 26 09:17:31 2016 (r296083) @@ -1153,9 +1153,7 @@ storvsc_detach(device_t dev) struct hv_sgl_node *sgl_node = NULL; int j = 0; - mtx_lock(&hv_device->channel->inbound_lock); sc->hs_destroy = TRUE; - mtx_unlock(&hv_device->channel->inbound_lock); /* * At this point, all outbound traffic should be disabled. We Modified: head/sys/dev/hyperv/vmbus/hv_channel.c ============================================================================== --- head/sys/dev/hyperv/vmbus/hv_channel.c Fri Feb 26 08:43:36 2016 (r296082) +++ head/sys/dev/hyperv/vmbus/hv_channel.c Fri Feb 26 09:17:31 2016 (r296083) @@ -537,13 +537,7 @@ hv_vmbus_channel_close_internal(hv_vmbus */ channel->rxq = NULL; taskqueue_drain(rxq, &channel->channel_task); - /* - * Grab the lock to prevent race condition when a packet received - * and unloading driver is in the process. - */ - mtx_lock(&channel->inbound_lock); channel->on_channel_callback = NULL; - mtx_unlock(&channel->inbound_lock); /** * Send a closing message @@ -920,12 +914,6 @@ VmbusProcessChannelEvent(void* context, * callback to NULL. This closes the window. */ - /* - * Disable the lock due to newly added WITNESS check in r277723. - * Will seek other way to avoid race condition. - * -- whu - */ - // mtx_lock(&channel->inbound_lock); if (channel->on_channel_callback != NULL) { arg = channel->channel_callback_context; is_batched_reading = channel->batched_reading; @@ -952,5 +940,4 @@ VmbusProcessChannelEvent(void* context, bytes_to_read = 0; } while (is_batched_reading && (bytes_to_read != 0)); } - // mtx_unlock(&channel->inbound_lock); } Modified: head/sys/dev/hyperv/vmbus/hv_channel_mgmt.c ============================================================================== --- head/sys/dev/hyperv/vmbus/hv_channel_mgmt.c Fri Feb 26 08:43:36 2016 (r296082) +++ head/sys/dev/hyperv/vmbus/hv_channel_mgmt.c Fri Feb 26 09:17:31 2016 (r296083) @@ -140,9 +140,7 @@ hv_vmbus_allocate_channel(void) M_DEVBUF, M_WAITOK | M_ZERO); - mtx_init(&channel->inbound_lock, "channel inbound", NULL, MTX_DEF); mtx_init(&channel->sc_lock, "vmbus multi channel", NULL, MTX_DEF); - TAILQ_INIT(&channel->sc_list_anchor); return (channel); @@ -155,8 +153,6 @@ void hv_vmbus_free_vmbus_channel(hv_vmbus_channel* channel) { mtx_destroy(&channel->sc_lock); - mtx_destroy(&channel->inbound_lock); - free(channel, M_DEVBUF); } From owner-svn-src-head@freebsd.org Fri Feb 26 09:23:18 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A7C08AB52AE; Fri, 26 Feb 2016 09:23:18 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 83ADB1C5D; Fri, 26 Feb 2016 09:23:18 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1Q9NHtB003653; Fri, 26 Feb 2016 09:23:17 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1Q9NHYb003650; Fri, 26 Feb 2016 09:23:17 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201602260923.u1Q9NHYb003650@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Fri, 26 Feb 2016 09:23:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r296084 - in head/sys/dev/hyperv: include storvsc vmbus X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Feb 2016 09:23:18 -0000 Author: sephe Date: Fri Feb 26 09:23:17 2016 New Revision: 296084 URL: https://svnweb.freebsd.org/changeset/base/296084 Log: hyperv: Always set device for channels And unregister hv_device only for primary channels, who own the hv_device. MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D5451 Modified: head/sys/dev/hyperv/include/hyperv.h head/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c head/sys/dev/hyperv/vmbus/hv_channel_mgmt.c Modified: head/sys/dev/hyperv/include/hyperv.h ============================================================================== --- head/sys/dev/hyperv/include/hyperv.h Fri Feb 26 09:17:31 2016 (r296083) +++ head/sys/dev/hyperv/include/hyperv.h Fri Feb 26 09:23:17 2016 (r296084) @@ -828,6 +828,8 @@ typedef struct hv_vmbus_channel { void *per_channel_state; } hv_vmbus_channel; +#define HV_VMBUS_CHAN_ISPRIMARY(chan) ((chan)->primary_channel == NULL) + static inline void hv_set_channel_read_state(hv_vmbus_channel* channel, boolean_t state) { Modified: head/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c ============================================================================== --- head/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c Fri Feb 26 09:17:31 2016 (r296083) +++ head/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c Fri Feb 26 09:23:17 2016 (r296084) @@ -334,7 +334,7 @@ storvsc_handle_sc_creation(void *context int ret = 0; new_channel = (hv_vmbus_channel *)context; - device = new_channel->primary_channel->device; + device = new_channel->device; sc = get_stor_device(device, TRUE); if (sc == NULL) return; @@ -837,12 +837,7 @@ hv_storvsc_on_channel_callback(void *con struct hv_storvsc_request *request; struct vstor_packet *vstor_packet; - if (channel->primary_channel != NULL){ - device = channel->primary_channel->device; - } else { - device = channel->device; - } - + device = channel->device; KASSERT(device, ("device is NULL")); sc = get_stor_device(device, FALSE); Modified: head/sys/dev/hyperv/vmbus/hv_channel_mgmt.c ============================================================================== --- head/sys/dev/hyperv/vmbus/hv_channel_mgmt.c Fri Feb 26 09:17:31 2016 (r296083) +++ head/sys/dev/hyperv/vmbus/hv_channel_mgmt.c Fri Feb 26 09:23:17 2016 (r296084) @@ -211,6 +211,7 @@ vmbus_channel_process_offer(hv_vmbus_cha * It is a sub channel offer, process it. */ new_channel->primary_channel = channel; + new_channel->device = channel->device; mtx_lock(&channel->sc_lock); TAILQ_INSERT_TAIL( &channel->sc_list_anchor, @@ -451,7 +452,10 @@ vmbus_channel_on_offer_rescind_internal( hv_vmbus_channel* channel; channel = (hv_vmbus_channel*)context; - hv_vmbus_child_device_unregister(channel->device); + if (HV_VMBUS_CHAN_ISPRIMARY(channel)) { + /* Only primary channel owns the hv_device */ + hv_vmbus_child_device_unregister(channel->device); + } } /** @@ -672,7 +676,10 @@ hv_vmbus_release_unattached_channels(voi TAILQ_REMOVE(&hv_vmbus_g_connection.channel_anchor, channel, list_entry); - hv_vmbus_child_device_unregister(channel->device); + if (HV_VMBUS_CHAN_ISPRIMARY(channel)) { + /* Only primary channel owns the hv_device */ + hv_vmbus_child_device_unregister(channel->device); + } hv_vmbus_free_vmbus_channel(channel); } bzero(hv_vmbus_g_connection.channels, From owner-svn-src-head@freebsd.org Fri Feb 26 09:29:51 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AAE7AAB544D; Fri, 26 Feb 2016 09:29:51 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7C74E1EA5; Fri, 26 Feb 2016 09:29:51 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1Q9ToMd003890; Fri, 26 Feb 2016 09:29:50 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1Q9Tojk003889; Fri, 26 Feb 2016 09:29:50 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201602260929.u1Q9Tojk003889@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Fri, 26 Feb 2016 09:29:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r296085 - head/sys/dev/hyperv/netvsc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Feb 2016 09:29:51 -0000 Author: sephe Date: Fri Feb 26 09:29:50 2016 New Revision: 296085 URL: https://svnweb.freebsd.org/changeset/base/296085 Log: hyperv/hn: Pass channel as the channel callback argument This is the preamble to pass channel back to hn(4) upon TX/RX done. Reviewed by: Hongjiang Zhang MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D5452 Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.c Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_net_vsc.c Fri Feb 26 09:23:17 2016 (r296084) +++ head/sys/dev/hyperv/netvsc/hv_net_vsc.c Fri Feb 26 09:29:50 2016 (r296085) @@ -679,7 +679,7 @@ hv_nv_on_device_add(struct hv_device *de */ ret = hv_vmbus_channel_open(device->channel, NETVSC_DEVICE_RING_BUFFER_SIZE, NETVSC_DEVICE_RING_BUFFER_SIZE, - NULL, 0, hv_nv_on_channel_callback, device); + NULL, 0, hv_nv_on_channel_callback, device->channel); if (ret != 0) goto cleanup; @@ -972,9 +972,10 @@ retry_send_cmplt: * Net VSC on channel callback */ static void -hv_nv_on_channel_callback(void *context) +hv_nv_on_channel_callback(void *xchan) { - struct hv_device *device = (struct hv_device *)context; + struct hv_vmbus_channel *chan = xchan; + struct hv_device *device = chan->device; netvsc_dev *net_dev; device_t dev = device->device; uint32_t bytes_rxed; @@ -991,7 +992,7 @@ hv_nv_on_channel_callback(void *context) buffer = net_dev->callback_buf; do { - ret = hv_vmbus_channel_recv_packet_raw(device->channel, + ret = hv_vmbus_channel_recv_packet_raw(chan, buffer, bufferlen, &bytes_rxed, &request_id); if (ret == 0) { if (bytes_rxed > 0) { From owner-svn-src-head@freebsd.org Fri Feb 26 09:35:47 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0C9D5AB5683; Fri, 26 Feb 2016 09:35:47 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C26B43CA; Fri, 26 Feb 2016 09:35:46 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1Q9Zj6o006719; Fri, 26 Feb 2016 09:35:45 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1Q9Zjma006714; Fri, 26 Feb 2016 09:35:45 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201602260935.u1Q9Zjma006714@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Fri, 26 Feb 2016 09:35:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r296086 - head/sys/dev/hyperv/netvsc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Feb 2016 09:35:47 -0000 Author: sephe Date: Fri Feb 26 09:35:45 2016 New Revision: 296086 URL: https://svnweb.freebsd.org/changeset/base/296086 Log: hyperv/hn: Pass channel to TX/RX done This is preamble to associate the TX/RX rings to their channel. While I'm here, revoke unused netvsc_recv_rollup. MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D5453 Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.c head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c head/sys/dev/hyperv/netvsc/hv_rndis.h head/sys/dev/hyperv/netvsc/hv_rndis_filter.c head/sys/dev/hyperv/netvsc/hv_rndis_filter.h Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_net_vsc.c Fri Feb 26 09:29:50 2016 (r296085) +++ head/sys/dev/hyperv/netvsc/hv_net_vsc.c Fri Feb 26 09:35:45 2016 (r296086) @@ -63,7 +63,8 @@ static int hv_nv_connect_to_vsp(struct static void hv_nv_on_send_completion(netvsc_dev *net_dev, struct hv_device *device, hv_vm_packet_descriptor *pkt); static void hv_nv_on_receive(netvsc_dev *net_dev, - struct hv_device *device, hv_vm_packet_descriptor *pkt); + struct hv_device *device, struct hv_vmbus_channel *chan, + hv_vm_packet_descriptor *pkt); /* * @@ -865,7 +866,7 @@ hv_nv_on_send(struct hv_device *device, */ static void hv_nv_on_receive(netvsc_dev *net_dev, struct hv_device *device, - hv_vm_packet_descriptor *pkt) + struct hv_vmbus_channel *chan, hv_vm_packet_descriptor *pkt) { hv_vm_transfer_page_packet_header *vm_xfer_page_pkt; nvsp_msg *nvsp_msg_pkt; @@ -915,7 +916,7 @@ hv_nv_on_receive(netvsc_dev *net_dev, st net_vsc_pkt->tot_data_buf_len = vm_xfer_page_pkt->ranges[i].byte_count; - hv_rf_on_receive(net_dev, device, net_vsc_pkt); + hv_rf_on_receive(net_dev, device, chan, net_vsc_pkt); if (net_vsc_pkt->status != nvsp_status_success) { status = nvsp_status_failure; } @@ -928,7 +929,6 @@ hv_nv_on_receive(netvsc_dev *net_dev, st */ hv_nv_on_receive_completion(device, vm_xfer_page_pkt->d.transaction_id, status); - hv_rf_receive_rollup(net_dev); } /* @@ -1002,7 +1002,7 @@ hv_nv_on_channel_callback(void *xchan) hv_nv_on_send_completion(net_dev, device, desc); break; case HV_VMBUS_PACKET_TYPE_DATA_USING_TRANSFER_PAGES: - hv_nv_on_receive(net_dev, device, desc); + hv_nv_on_receive(net_dev, device, chan, desc); break; default: device_printf(dev, @@ -1036,5 +1036,5 @@ hv_nv_on_channel_callback(void *xchan) if (bufferlen > NETVSC_PACKET_SIZE) free(buffer, M_NETVSC); - hv_rf_channel_rollup(net_dev); + hv_rf_channel_rollup(chan); } Modified: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Fri Feb 26 09:29:50 2016 (r296085) +++ head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Fri Feb 26 09:35:45 2016 (r296086) @@ -684,8 +684,9 @@ hn_tx_done(void *xpkt) } void -netvsc_channel_rollup(struct hv_device *device_ctx) +netvsc_channel_rollup(struct hv_vmbus_channel *chan) { + struct hv_device *device_ctx = chan->device; struct hn_softc *sc = device_get_softc(device_ctx->device); struct hn_tx_ring *txr = &sc->hn_tx_ring[0]; /* TODO: vRSS */ #if defined(INET) || defined(INET6) @@ -1135,9 +1136,10 @@ hv_m_append(struct mbuf *m0, int len, c_ * Note: This is no longer used as a callback */ int -netvsc_recv(struct hv_device *device_ctx, netvsc_packet *packet, +netvsc_recv(struct hv_vmbus_channel *chan, netvsc_packet *packet, rndis_tcp_ip_csum_info *csum_info) { + struct hv_device *device_ctx = chan->device; struct hn_softc *sc = device_get_softc(device_ctx->device); struct hn_rx_ring *rxr = &sc->hn_rx_ring[0]; /* TODO: vRSS */ struct mbuf *m_new; @@ -1305,11 +1307,6 @@ skip: return (0); } -void -netvsc_recv_rollup(struct hv_device *device_ctx __unused) -{ -} - /* * Rules for using sc->temp_unusable: * 1. sc->temp_unusable can only be read or written while holding NV_LOCK() Modified: head/sys/dev/hyperv/netvsc/hv_rndis.h ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_rndis.h Fri Feb 26 09:29:50 2016 (r296085) +++ head/sys/dev/hyperv/netvsc/hv_rndis.h Fri Feb 26 09:35:45 2016 (r296086) @@ -1046,11 +1046,11 @@ typedef struct rndismp_rx_bufs_info_ { /* * Externs */ -int netvsc_recv(struct hv_device *device_ctx, - netvsc_packet *packet, - rndis_tcp_ip_csum_info *csum_info); -void netvsc_recv_rollup(struct hv_device *device_ctx); -void netvsc_channel_rollup(struct hv_device *device_ctx); +struct hv_vmbus_channel; + +int netvsc_recv(struct hv_vmbus_channel *chan, + netvsc_packet *packet, rndis_tcp_ip_csum_info *csum_info); +void netvsc_channel_rollup(struct hv_vmbus_channel *chan); void* hv_set_rppi_data(rndis_msg *rndis_mesg, uint32_t rppi_size, Modified: head/sys/dev/hyperv/netvsc/hv_rndis_filter.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_rndis_filter.c Fri Feb 26 09:29:50 2016 (r296085) +++ head/sys/dev/hyperv/netvsc/hv_rndis_filter.c Fri Feb 26 09:35:45 2016 (r296086) @@ -58,6 +58,7 @@ static void hv_rf_receive_response(rndis static void hv_rf_receive_indicate_status(rndis_device *device, rndis_msg *response); static void hv_rf_receive_data(rndis_device *device, rndis_msg *message, + struct hv_vmbus_channel *chan, netvsc_packet *pkt); static int hv_rf_query_device(rndis_device *device, uint32_t oid, void *result, uint32_t *result_size); @@ -405,7 +406,8 @@ hv_rf_receive_indicate_status(rndis_devi * RNDIS filter receive data */ static void -hv_rf_receive_data(rndis_device *device, rndis_msg *message, netvsc_packet *pkt) +hv_rf_receive_data(rndis_device *device, rndis_msg *message, + struct hv_vmbus_channel *chan, netvsc_packet *pkt) { rndis_packet *rndis_pkt; ndis_8021q_info *rppi_vlan_info; @@ -443,14 +445,15 @@ hv_rf_receive_data(rndis_device *device, } csum_info = hv_get_ppi_data(rndis_pkt, tcpip_chksum_info); - netvsc_recv(device->net_dev->dev, pkt, csum_info); + netvsc_recv(chan, pkt, csum_info); } /* * RNDIS filter on receive */ int -hv_rf_on_receive(netvsc_dev *net_dev, struct hv_device *device, netvsc_packet *pkt) +hv_rf_on_receive(netvsc_dev *net_dev, struct hv_device *device, + struct hv_vmbus_channel *chan, netvsc_packet *pkt) { rndis_device *rndis_dev; rndis_msg *rndis_hdr; @@ -473,7 +476,7 @@ hv_rf_on_receive(netvsc_dev *net_dev, st /* data message */ case REMOTE_NDIS_PACKET_MSG: - hv_rf_receive_data(rndis_dev, rndis_hdr, pkt); + hv_rf_receive_data(rndis_dev, rndis_hdr, chan, pkt); break; /* completion messages */ case REMOTE_NDIS_INITIALIZE_CMPLT: @@ -957,32 +960,9 @@ hv_rf_on_send_request_halt_completion(vo request->halt_complete_flag = 1; } -/* - * RNDIS filter when "all" reception is done - */ void -hv_rf_receive_rollup(netvsc_dev *net_dev) +hv_rf_channel_rollup(struct hv_vmbus_channel *chan) { - rndis_device *rndis_dev; - - rndis_dev = (rndis_device *)net_dev->extension; - netvsc_recv_rollup(rndis_dev->net_dev->dev); -} -void -hv_rf_channel_rollup(netvsc_dev *net_dev) -{ - rndis_device *rndis_dev; - - rndis_dev = (rndis_device *)net_dev->extension; - - /* - * This could be called pretty early, so we need - * to make sure everything has been setup. - */ - if (rndis_dev == NULL || - rndis_dev->net_dev == NULL || - rndis_dev->net_dev->dev == NULL) - return; - netvsc_channel_rollup(rndis_dev->net_dev->dev); + netvsc_channel_rollup(chan); } Modified: head/sys/dev/hyperv/netvsc/hv_rndis_filter.h ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_rndis_filter.h Fri Feb 26 09:29:50 2016 (r296085) +++ head/sys/dev/hyperv/netvsc/hv_rndis_filter.h Fri Feb 26 09:35:45 2016 (r296086) @@ -95,11 +95,12 @@ typedef struct rndis_device_ { /* * Externs */ +struct hv_vmbus_channel; -int hv_rf_on_receive(netvsc_dev *net_dev, - struct hv_device *device, netvsc_packet *pkt); +int hv_rf_on_receive(netvsc_dev *net_dev, struct hv_device *device, + struct hv_vmbus_channel *chan, netvsc_packet *pkt); void hv_rf_receive_rollup(netvsc_dev *net_dev); -void hv_rf_channel_rollup(netvsc_dev *net_dev); +void hv_rf_channel_rollup(struct hv_vmbus_channel *chan); int hv_rf_on_device_add(struct hv_device *device, void *additl_info); int hv_rf_on_device_remove(struct hv_device *device, boolean_t destroy_channel); int hv_rf_on_open(struct hv_device *device); From owner-svn-src-head@freebsd.org Fri Feb 26 09:41:02 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B2006AB57F6; Fri, 26 Feb 2016 09:41:02 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 705508A9; Fri, 26 Feb 2016 09:41:02 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1Q9f1wu006932; Fri, 26 Feb 2016 09:41:01 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1Q9f1US006929; Fri, 26 Feb 2016 09:41:01 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201602260941.u1Q9f1US006929@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Fri, 26 Feb 2016 09:41:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r296087 - in head/sys/dev/hyperv: include netvsc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Feb 2016 09:41:02 -0000 Author: sephe Date: Fri Feb 26 09:41:00 2016 New Revision: 296087 URL: https://svnweb.freebsd.org/changeset/base/296087 Log: hyperv/hn: Associate TX/RX ring with channel This fixes the TX/RX ring selection for TX/RX done. MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D5454 Modified: head/sys/dev/hyperv/include/hyperv.h head/sys/dev/hyperv/netvsc/hv_net_vsc.h head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Modified: head/sys/dev/hyperv/include/hyperv.h ============================================================================== --- head/sys/dev/hyperv/include/hyperv.h Fri Feb 26 09:35:45 2016 (r296086) +++ head/sys/dev/hyperv/include/hyperv.h Fri Feb 26 09:41:00 2016 (r296087) @@ -822,10 +822,12 @@ typedef struct hv_vmbus_channel { * This will be NULL for the primary channel. */ struct hv_vmbus_channel *primary_channel; + /* - * Support per channel state for use by vmbus drivers. + * Driver private data */ - void *per_channel_state; + void *hv_chan_priv1; + void *hv_chan_priv2; } hv_vmbus_channel; #define HV_VMBUS_CHAN_ISPRIMARY(chan) ((chan)->primary_channel == NULL) Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.h ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_net_vsc.h Fri Feb 26 09:35:45 2016 (r296086) +++ head/sys/dev/hyperv/netvsc/hv_net_vsc.h Fri Feb 26 09:41:00 2016 (r296087) @@ -1000,6 +1000,7 @@ struct buf_ring; #endif struct hn_rx_ring { + struct ifnet *hn_ifp; struct lro_ctrl hn_lro; /* Trust csum verification on host side */ Modified: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Fri Feb 26 09:35:45 2016 (r296086) +++ head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Fri Feb 26 09:41:00 2016 (r296087) @@ -117,6 +117,8 @@ __FBSDID("$FreeBSD$"); #include "hv_rndis.h" #include "hv_rndis_filter.h" +#define hv_chan_rxr hv_chan_priv1 +#define hv_chan_txr hv_chan_priv2 /* Short for Hyper-V network interface */ #define NETVSC_DEVNAME "hn" @@ -376,6 +378,7 @@ static int netvsc_attach(device_t dev) { struct hv_device *device_ctx = vmbus_get_devctx(dev); + struct hv_vmbus_channel *chan; netvsc_device_info device_info; hn_softc_t *sc; int unit = device_get_unit(dev); @@ -427,6 +430,13 @@ netvsc_attach(device_t dev) hn_create_rx_data(sc); + /* + * Associate the first TX/RX ring w/ the primary channel. + */ + chan = device_ctx->channel; + chan->hv_chan_rxr = &sc->hn_rx_ring[0]; + chan->hv_chan_txr = &sc->hn_tx_ring[0]; + if_initname(ifp, device_get_name(dev), device_get_unit(dev)); ifp->if_dunit = unit; ifp->if_dname = NETVSC_DEVNAME; @@ -686,11 +696,9 @@ hn_tx_done(void *xpkt) void netvsc_channel_rollup(struct hv_vmbus_channel *chan) { - struct hv_device *device_ctx = chan->device; - struct hn_softc *sc = device_get_softc(device_ctx->device); - struct hn_tx_ring *txr = &sc->hn_tx_ring[0]; /* TODO: vRSS */ + struct hn_tx_ring *txr = chan->hv_chan_txr; #if defined(INET) || defined(INET6) - struct hn_rx_ring *rxr = &sc->hn_rx_ring[0]; /* TODO: vRSS */ + struct hn_rx_ring *rxr = chan->hv_chan_rxr; struct lro_ctrl *lro = &rxr->hn_lro; struct lro_entry *queued; @@ -700,7 +708,12 @@ netvsc_channel_rollup(struct hv_vmbus_ch } #endif - if (!txr->hn_has_txeof) + /* + * NOTE: + * 'txr' could be NULL, if multiple channels and + * ifnet.if_start method are enabled. + */ + if (txr == NULL || !txr->hn_has_txeof) return; txr->hn_has_txeof = 0; @@ -1139,22 +1152,13 @@ int netvsc_recv(struct hv_vmbus_channel *chan, netvsc_packet *packet, rndis_tcp_ip_csum_info *csum_info) { - struct hv_device *device_ctx = chan->device; - struct hn_softc *sc = device_get_softc(device_ctx->device); - struct hn_rx_ring *rxr = &sc->hn_rx_ring[0]; /* TODO: vRSS */ + struct hn_rx_ring *rxr = chan->hv_chan_rxr; + struct ifnet *ifp = rxr->hn_ifp; struct mbuf *m_new; - struct ifnet *ifp; int size, do_lro = 0, do_csum = 1; - if (sc == NULL) { - return (0); /* TODO: KYS how can this be! */ - } - - ifp = sc->hn_ifp; - - if (!(ifp->if_drv_flags & IFF_DRV_RUNNING)) { + if (!(ifp->if_drv_flags & IFF_DRV_RUNNING)) return (0); - } /* * Bail out if packet contains more data than configured MTU. @@ -2023,6 +2027,7 @@ hn_create_rx_data(struct hn_softc *sc) rxr->hn_trust_hcsum |= HN_TRUST_HCSUM_UDP; if (hn_trust_hostip) rxr->hn_trust_hcsum |= HN_TRUST_HCSUM_IP; + rxr->hn_ifp = sc->hn_ifp; /* * Initialize LRO. From owner-svn-src-head@freebsd.org Fri Feb 26 09:45:50 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4B060AB5A5B; Fri, 26 Feb 2016 09:45:50 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 008FFC47; Fri, 26 Feb 2016 09:45:49 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1Q9jnum009689; Fri, 26 Feb 2016 09:45:49 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1Q9jmXv009687; Fri, 26 Feb 2016 09:45:48 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201602260945.u1Q9jmXv009687@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Fri, 26 Feb 2016 09:45:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r296088 - head/sys/dev/hyperv/netvsc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Feb 2016 09:45:50 -0000 Author: sephe Date: Fri Feb 26 09:45:48 2016 New Revision: 296088 URL: https://svnweb.freebsd.org/changeset/base/296088 Log: hyperv/hn: Remove the useless num_outstanding_sends We rely on taskqueue draining now. MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D5456 Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.c head/sys/dev/hyperv/netvsc/hv_net_vsc.h Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_net_vsc.c Fri Feb 26 09:41:00 2016 (r296087) +++ head/sys/dev/hyperv/netvsc/hv_net_vsc.c Fri Feb 26 09:45:48 2016 (r296088) @@ -117,7 +117,7 @@ hv_nv_get_inbound_net_device(struct hv_d * permit incoming packets if and only if there * are outstanding sends. */ - if (net_dev->destroy && net_dev->num_outstanding_sends == 0) { + if (net_dev->destroy) { return (NULL); } @@ -723,11 +723,6 @@ hv_nv_on_device_remove(struct hv_device /* Stop outbound traffic ie sends and receives completions */ net_dev->destroy = TRUE; - /* Wait for all send completions */ - while (net_dev->num_outstanding_sends) { - DELAY(100); - } - hv_nv_disconnect_from_vsp(net_dev); /* At this point, no one should be accessing net_dev except in here */ @@ -805,8 +800,6 @@ hv_nv_on_send_completion(netvsc_dev *net net_vsc_pkt->compl.send.send_completion_context); } - - atomic_subtract_int(&net_dev->num_outstanding_sends, 1); } } @@ -818,14 +811,9 @@ hv_nv_on_send_completion(netvsc_dev *net int hv_nv_on_send(struct hv_device *device, netvsc_packet *pkt) { - netvsc_dev *net_dev; nvsp_msg send_msg; int ret; - net_dev = hv_nv_get_outbound_net_device(device); - if (!net_dev) - return (ENODEV); - send_msg.hdr.msg_type = nvsp_msg_1_type_send_rndis_pkt; if (pkt->is_data_pkt) { /* 0 is RMC_DATA */ @@ -851,10 +839,6 @@ hv_nv_on_send(struct hv_device *device, HV_VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED); } - /* Record outstanding send only if send_packet() succeeded */ - if (ret == 0) - atomic_add_int(&net_dev->num_outstanding_sends, 1); - return (ret); } Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.h ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_net_vsc.h Fri Feb 26 09:41:00 2016 (r296087) +++ head/sys/dev/hyperv/netvsc/hv_net_vsc.h Fri Feb 26 09:45:48 2016 (r296088) @@ -893,7 +893,6 @@ typedef struct nvsp_msg_ { */ typedef struct netvsc_dev_ { struct hv_device *dev; - int num_outstanding_sends; /* Send buffer allocated by us but manages by NetVSP */ void *send_buf; From owner-svn-src-head@freebsd.org Fri Feb 26 09:50:37 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 02792AB5D2E; Fri, 26 Feb 2016 09:50:37 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D2448F31; Fri, 26 Feb 2016 09:50:36 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1Q9oZqZ009894; Fri, 26 Feb 2016 09:50:35 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1Q9oZRd009890; Fri, 26 Feb 2016 09:50:35 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201602260950.u1Q9oZRd009890@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Fri, 26 Feb 2016 09:50:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r296089 - head/sys/dev/hyperv/netvsc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Feb 2016 09:50:37 -0000 Author: sephe Date: Fri Feb 26 09:50:35 2016 New Revision: 296089 URL: https://svnweb.freebsd.org/changeset/base/296089 Log: hyperv/hn: Make transmission path channel aware Chimney sending buffer still needs conversion, which will be done along with the upcoming vRSS support. MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D5457 Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.c head/sys/dev/hyperv/netvsc/hv_net_vsc.h head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c head/sys/dev/hyperv/netvsc/hv_rndis_filter.c Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_net_vsc.c Fri Feb 26 09:45:48 2016 (r296088) +++ head/sys/dev/hyperv/netvsc/hv_net_vsc.c Fri Feb 26 09:50:35 2016 (r296089) @@ -809,7 +809,7 @@ hv_nv_on_send_completion(netvsc_dev *net * Returns 0 on success, non-zero on failure. */ int -hv_nv_on_send(struct hv_device *device, netvsc_packet *pkt) +hv_nv_on_send(struct hv_vmbus_channel *chan, netvsc_packet *pkt) { nvsp_msg send_msg; int ret; @@ -829,11 +829,11 @@ hv_nv_on_send(struct hv_device *device, pkt->send_buf_section_size; if (pkt->page_buf_count) { - ret = hv_vmbus_channel_send_packet_pagebuffer(device->channel, + ret = hv_vmbus_channel_send_packet_pagebuffer(chan, pkt->page_buffers, pkt->page_buf_count, &send_msg, sizeof(nvsp_msg), (uint64_t)(uintptr_t)pkt); } else { - ret = hv_vmbus_channel_send_packet(device->channel, + ret = hv_vmbus_channel_send_packet(chan, &send_msg, sizeof(nvsp_msg), (uint64_t)(uintptr_t)pkt, HV_VMBUS_PACKET_TYPE_DATA_IN_BAND, HV_VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED); Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.h ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_net_vsc.h Fri Feb 26 09:45:48 2016 (r296088) +++ head/sys/dev/hyperv/netvsc/hv_net_vsc.h Fri Feb 26 09:50:35 2016 (r296089) @@ -1017,6 +1017,8 @@ struct hn_rx_ring { #define HN_TRUST_HCSUM_TCP 0x0002 #define HN_TRUST_HCSUM_UDP 0x0004 +struct hv_vmbus_channel; + struct hn_tx_ring { #ifndef HN_USE_TXDESC_BUFRING struct mtx hn_txlist_spin; @@ -1039,6 +1041,7 @@ struct hn_tx_ring { struct mtx hn_tx_lock; struct hn_softc *hn_sc; + struct hv_vmbus_channel *hn_chan; int hn_direct_tx_size; int hn_tx_chimney_size; @@ -1096,7 +1099,7 @@ netvsc_dev *hv_nv_on_device_add(struct h void *additional_info); int hv_nv_on_device_remove(struct hv_device *device, boolean_t destroy_channel); -int hv_nv_on_send(struct hv_device *device, netvsc_packet *pkt); +int hv_nv_on_send(struct hv_vmbus_channel *chan, netvsc_packet *pkt); int hv_nv_get_next_send_section(netvsc_dev *net_dev); #endif /* __HV_NET_VSC_H__ */ Modified: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Fri Feb 26 09:45:48 2016 (r296088) +++ head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Fri Feb 26 09:50:35 2016 (r296089) @@ -436,6 +436,7 @@ netvsc_attach(device_t dev) chan = device_ctx->channel; chan->hv_chan_rxr = &sc->hn_rx_ring[0]; chan->hv_chan_txr = &sc->hn_tx_ring[0]; + sc->hn_tx_ring[0].hn_chan = chan; if_initname(ifp, device_get_name(dev), device_get_unit(dev)); ifp->if_dunit = unit; @@ -854,6 +855,8 @@ hn_encap(struct hn_tx_ring *txr, struct /* * Chimney send, if the packet could fit into one chimney buffer. + * + * TODO: vRSS, chimney buffer should be per-channel. */ if (packet->tot_data_buf_len < txr->hn_tx_chimney_size) { netvsc_dev *net_dev = txr->hn_sc->net_dev; @@ -940,8 +943,7 @@ done: * associated w/ the txd will _not_ be freed. */ static int -hn_send_pkt(struct ifnet *ifp, struct hv_device *device_ctx, - struct hn_tx_ring *txr, struct hn_txdesc *txd) +hn_send_pkt(struct ifnet *ifp, struct hn_tx_ring *txr, struct hn_txdesc *txd) { int error, send_failed = 0; @@ -950,7 +952,7 @@ again: * Make sure that txd is not freed before ETHER_BPF_MTAP. */ hn_txdesc_hold(txd); - error = hv_nv_on_send(device_ctx, &txd->netvsc_pkt); + error = hv_nv_on_send(txr->hn_chan, &txd->netvsc_pkt); if (!error) { ETHER_BPF_MTAP(ifp, txd->m); if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1); @@ -1010,7 +1012,6 @@ hn_start_locked(struct hn_tx_ring *txr, { struct hn_softc *sc = txr->hn_sc; struct ifnet *ifp = sc->hn_ifp; - struct hv_device *device_ctx = vmbus_get_devctx(sc->hn_dev); KASSERT(hn_use_if_start, ("hn_start_locked is called, when if_start is disabled")); @@ -1054,7 +1055,7 @@ hn_start_locked(struct hn_tx_ring *txr, continue; } - error = hn_send_pkt(ifp, device_ctx, txr, txd); + error = hn_send_pkt(ifp, txr, txd); if (__predict_false(error)) { /* txd is freed, but m_head is not */ IFQ_DRV_PREPEND(&ifp->if_snd, m_head); @@ -2497,7 +2498,6 @@ hn_xmit(struct hn_tx_ring *txr, int len) { struct hn_softc *sc = txr->hn_sc; struct ifnet *ifp = sc->hn_ifp; - struct hv_device *device_ctx = vmbus_get_devctx(sc->hn_dev); struct mbuf *m_head; mtx_assert(&txr->hn_tx_lock, MA_OWNED); @@ -2536,7 +2536,7 @@ hn_xmit(struct hn_tx_ring *txr, int len) continue; } - error = hn_send_pkt(ifp, device_ctx, txr, txd); + error = hn_send_pkt(ifp, txr, txd); if (__predict_false(error)) { /* txd is freed, but m_head is not */ drbr_putback(ifp, txr->hn_mbuf_br, m_head); Modified: head/sys/dev/hyperv/netvsc/hv_rndis_filter.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_rndis_filter.c Fri Feb 26 09:45:48 2016 (r296088) +++ head/sys/dev/hyperv/netvsc/hv_rndis_filter.c Fri Feb 26 09:50:35 2016 (r296089) @@ -250,7 +250,7 @@ hv_rf_send_request(rndis_device *device, NVSP_1_CHIMNEY_SEND_INVALID_SECTION_INDEX; packet->send_buf_section_size = 0; - ret = hv_nv_on_send(device->net_dev->dev, packet); + ret = hv_nv_on_send(device->net_dev->dev->channel, packet); return (ret); } From owner-svn-src-head@freebsd.org Fri Feb 26 10:24:25 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 74C08AB4DF3; Fri, 26 Feb 2016 10:24:25 +0000 (UTC) (envelope-from wma@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 46EA91EEC; Fri, 26 Feb 2016 10:24:25 +0000 (UTC) (envelope-from wma@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1QAOOCY021180; Fri, 26 Feb 2016 10:24:24 GMT (envelope-from wma@FreeBSD.org) Received: (from wma@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1QAOOPw021179; Fri, 26 Feb 2016 10:24:24 GMT (envelope-from wma@FreeBSD.org) Message-Id: <201602261024.u1QAOOPw021179@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: wma set sender to wma@FreeBSD.org using -f From: Wojciech Macek Date: Fri, 26 Feb 2016 10:24:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r296090 - head/usr.sbin/pciconf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Feb 2016 10:24:25 -0000 Author: wma Date: Fri Feb 26 10:24:24 2016 New Revision: 296090 URL: https://svnweb.freebsd.org/changeset/base/296090 Log: Change format string in pciconf EA to jx Fix compilation error introduced by r296081 Modified: head/usr.sbin/pciconf/cap.c Modified: head/usr.sbin/pciconf/cap.c ============================================================================== --- head/usr.sbin/pciconf/cap.c Fri Feb 26 09:50:35 2016 (r296089) +++ head/usr.sbin/pciconf/cap.c Fri Feb 26 10:24:24 2016 (r296090) @@ -657,13 +657,13 @@ cap_ea(int fd, struct pci_conf *p, uint8 b++; } - printf("\n\t\t [%d] %s, %s, %s, base [0x%lx], size [0x%lx]" + printf("\n\t\t [%d] %s, %s, %s, base [0x%jx], size [0x%jx]" "\n\t\t\tPrimary properties [0x%x] (%s)" "\n\t\t\tSecondary properties [0x%x] (%s)", bei, ea_bei_to_name(bei), (flags & PCIM_EA_ENABLE ? "Enabled" : "Disabled"), - (flags & PCIM_EA_WRITABLE ? "Writable" : "Read-only"), - base, max_offset + 1, + (flags & PCIM_EA_WRITABLE ? "Writable" : "Read-only"), + (uintmax_t)base, (uintmax_t)(max_offset + 1), flags_pp, ea_prop_to_name(flags_pp), flags_sp, ea_prop_to_name(flags_sp)); } From owner-svn-src-head@freebsd.org Fri Feb 26 12:16:12 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D86AEAB4104; Fri, 26 Feb 2016 12:16:12 +0000 (UTC) (envelope-from wma@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B07377F5; Fri, 26 Feb 2016 12:16:12 +0000 (UTC) (envelope-from wma@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1QCGBCT053652; Fri, 26 Feb 2016 12:16:11 GMT (envelope-from wma@FreeBSD.org) Received: (from wma@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1QCGBhW053647; Fri, 26 Feb 2016 12:16:11 GMT (envelope-from wma@FreeBSD.org) Message-Id: <201602261216.u1QCGBhW053647@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: wma set sender to wma@FreeBSD.org using -f From: Wojciech Macek Date: Fri, 26 Feb 2016 12:16:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r296091 - in head/sys: arm64/cavium dev/pci X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Feb 2016 12:16:12 -0000 Author: wma Date: Fri Feb 26 12:16:11 2016 New Revision: 296091 URL: https://svnweb.freebsd.org/changeset/base/296091 Log: Restore ThunderX Pass1.1 PCI changes removed by r295962 If Enhanced Allocation is not used, we can't allocate any random range. All internal devices have hardcoded place where they can be located within PCI address space. Fortunately, we can read this value from BAR. Obtained from: Semihalf Sponsored by: Cavium Approved by: cognet (mentor) Reviewed by: zbb Differential revision: https://reviews.freebsd.org/D5455 Modified: head/sys/arm64/cavium/thunder_pcie_common.c head/sys/arm64/cavium/thunder_pcie_common.h head/sys/arm64/cavium/thunder_pcie_fdt.c head/sys/dev/pci/pci_host_generic.c head/sys/dev/pci/pci_host_generic.h Modified: head/sys/arm64/cavium/thunder_pcie_common.c ============================================================================== --- head/sys/arm64/cavium/thunder_pcie_common.c Fri Feb 26 10:24:24 2016 (r296090) +++ head/sys/arm64/cavium/thunder_pcie_common.c Fri Feb 26 12:16:11 2016 (r296091) @@ -52,8 +52,10 @@ __FBSDID("$FreeBSD$"); #include #endif -#include +#include #include +#include +#include #include #include @@ -142,3 +144,42 @@ thunder_pcie_identify_ecam(device_t dev, return (0); } + +#ifdef THUNDERX_PASS_1_1_ERRATA +struct resource * +thunder_pcie_alloc_resource(device_t dev, device_t child, int type, int *rid, + rman_res_t start, rman_res_t end, rman_res_t count, u_int flags) +{ + pci_addr_t map, testval; + + /* + * If Enhanced Allocation is not used, we can't allocate any random + * range. All internal devices have hardcoded place where they can + * be located within PCI address space. Fortunately, we can read + * this value from BAR. + */ + if (((type == SYS_RES_IOPORT) || (type == SYS_RES_MEMORY)) && + RMAN_IS_DEFAULT_RANGE(start, end)) { + + /* Read BAR manually to get resource address and size */ + pci_read_bar(child, *rid, &map, &testval, NULL); + + /* Mask the information bits */ + if (PCI_BAR_MEM(map)) + map &= PCIM_BAR_MEM_BASE; + else + map &= PCIM_BAR_IO_BASE; + + if (PCI_BAR_MEM(testval)) + testval &= PCIM_BAR_MEM_BASE; + else + testval &= PCIM_BAR_IO_BASE; + + start = map; + end = start + count - 1; + } + + return (pci_host_generic_alloc_resource(dev, child, type, rid, start, + end, count, flags)); +} +#endif Modified: head/sys/arm64/cavium/thunder_pcie_common.h ============================================================================== --- head/sys/arm64/cavium/thunder_pcie_common.h Fri Feb 26 10:24:24 2016 (r296090) +++ head/sys/arm64/cavium/thunder_pcie_common.h Fri Feb 26 12:16:11 2016 (r296091) @@ -39,5 +39,9 @@ uint32_t range_addr_is_phys(struct pcie_ uint64_t range_addr_pci_to_phys(struct pcie_range *, uint64_t); int thunder_pcie_identify_ecam(device_t, int *); +#ifdef THUNDERX_PASS_1_1_ERRATA +struct resource *thunder_pcie_alloc_resource(device_t, + device_t, int, int *, rman_res_t, rman_res_t, rman_res_t, u_int); +#endif #endif /* _CAVIUM_THUNDER_PCIE_COMMON_H_ */ Modified: head/sys/arm64/cavium/thunder_pcie_fdt.c ============================================================================== --- head/sys/arm64/cavium/thunder_pcie_fdt.c Fri Feb 26 10:24:24 2016 (r296090) +++ head/sys/arm64/cavium/thunder_pcie_fdt.c Fri Feb 26 12:16:11 2016 (r296091) @@ -49,6 +49,10 @@ __FBSDID("$FreeBSD$"); #include "thunder_pcie_common.h" +#ifdef THUNDERX_PASS_1_1_ERRATA +static struct resource * thunder_pcie_fdt_alloc_resource(device_t, device_t, + int, int *, rman_res_t, rman_res_t, rman_res_t, u_int); +#endif static int thunder_pcie_fdt_attach(device_t); static int thunder_pcie_fdt_probe(device_t); @@ -56,6 +60,9 @@ static device_method_t thunder_pcie_fdt_ /* Device interface */ DEVMETHOD(device_probe, thunder_pcie_fdt_probe), DEVMETHOD(device_attach, thunder_pcie_fdt_attach), +#ifdef THUNDERX_PASS_1_1_ERRATA + DEVMETHOD(bus_alloc_resource, thunder_pcie_fdt_alloc_resource), +#endif /* End */ DEVMETHOD_END @@ -105,3 +112,17 @@ thunder_pcie_fdt_attach(device_t dev) return (pci_host_generic_attach(dev)); } +#ifdef THUNDERX_PASS_1_1_ERRATA +static struct resource * +thunder_pcie_fdt_alloc_resource(device_t dev, device_t child, int type, int *rid, + rman_res_t start, rman_res_t end, rman_res_t count, u_int flags) +{ + + if ((int)ofw_bus_get_node(child) > 0) + return (pci_host_generic_alloc_resource(dev, child, + type, rid, start, end, count, flags)); + + return (thunder_pcie_alloc_resource(dev, child, + type, rid, start, end, count, flags)); +} +#endif Modified: head/sys/dev/pci/pci_host_generic.c ============================================================================== --- head/sys/dev/pci/pci_host_generic.c Fri Feb 26 10:24:24 2016 (r296090) +++ head/sys/dev/pci/pci_host_generic.c Fri Feb 26 12:16:11 2016 (r296091) @@ -104,9 +104,6 @@ static int generic_pcie_read_ivar(device uintptr_t *result); static int generic_pcie_write_ivar(device_t dev, device_t child, int index, uintptr_t value); -static struct resource *generic_pcie_alloc_resource(device_t dev, - device_t child, int type, int *rid, rman_res_t start, rman_res_t end, - rman_res_t count, u_int flags); static struct resource *generic_pcie_alloc_resource_ofw(device_t, device_t, int, int *, rman_res_t, rman_res_t, rman_res_t, u_int); static struct resource *generic_pcie_alloc_resource_pcie(device_t dev, @@ -508,8 +505,8 @@ generic_pcie_release_resource(device_t d child, type, rid, res)); } -static struct resource * -generic_pcie_alloc_resource(device_t dev, device_t child, int type, int *rid, +struct resource * +pci_host_generic_alloc_resource(device_t dev, device_t child, int type, int *rid, rman_res_t start, rman_res_t end, rman_res_t count, u_int flags) { @@ -661,7 +658,7 @@ static device_method_t generic_pcie_meth DEVMETHOD(device_attach, pci_host_generic_attach), DEVMETHOD(bus_read_ivar, generic_pcie_read_ivar), DEVMETHOD(bus_write_ivar, generic_pcie_write_ivar), - DEVMETHOD(bus_alloc_resource, generic_pcie_alloc_resource), + DEVMETHOD(bus_alloc_resource, pci_host_generic_alloc_resource), DEVMETHOD(bus_adjust_resource, generic_pcie_adjust_resource), DEVMETHOD(bus_release_resource, generic_pcie_release_resource), DEVMETHOD(bus_activate_resource, generic_pcie_activate_resource), Modified: head/sys/dev/pci/pci_host_generic.h ============================================================================== --- head/sys/dev/pci/pci_host_generic.h Fri Feb 26 10:24:24 2016 (r296090) +++ head/sys/dev/pci/pci_host_generic.h Fri Feb 26 12:16:11 2016 (r296091) @@ -66,6 +66,8 @@ struct generic_pcie_softc { extern devclass_t generic_pcie_devclass; DECLARE_CLASS(generic_pcie_driver); +struct resource *pci_host_generic_alloc_resource(device_t, + device_t, int, int *, rman_res_t, rman_res_t, rman_res_t, u_int); int pci_host_generic_attach(device_t); #endif /* __PCI_HOST_GENERIC_H_ */ From owner-svn-src-head@freebsd.org Fri Feb 26 12:46:35 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 911CFAB4FA4; Fri, 26 Feb 2016 12:46:35 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4923917EE; Fri, 26 Feb 2016 12:46:35 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1QCkY1x062528; Fri, 26 Feb 2016 12:46:34 GMT (envelope-from ed@FreeBSD.org) Received: (from ed@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1QCkYu0062527; Fri, 26 Feb 2016 12:46:34 GMT (envelope-from ed@FreeBSD.org) Message-Id: <201602261246.u1QCkYu0062527@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ed set sender to ed@FreeBSD.org using -f From: Ed Schouten Date: Fri, 26 Feb 2016 12:46:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r296092 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Feb 2016 12:46:35 -0000 Author: ed Date: Fri Feb 26 12:46:34 2016 New Revision: 296092 URL: https://svnweb.freebsd.org/changeset/base/296092 Log: Remove the errno argument from unp_drop(). While there, add a comment to clarify that ECONNRESET should always be returned for POSIX conformance. Suggested by: Steven Hartland Modified: head/sys/kern/uipc_usrreq.c Modified: head/sys/kern/uipc_usrreq.c ============================================================================== --- head/sys/kern/uipc_usrreq.c Fri Feb 26 12:16:11 2016 (r296091) +++ head/sys/kern/uipc_usrreq.c Fri Feb 26 12:46:34 2016 (r296092) @@ -280,7 +280,7 @@ static void unp_disconnect(struct unpcb static void unp_dispose(struct mbuf *); static void unp_dispose_so(struct socket *so); static void unp_shutdown(struct unpcb *); -static void unp_drop(struct unpcb *, int); +static void unp_drop(struct unpcb *); static void unp_gc(__unused void *, int); static void unp_scan(struct mbuf *, void (*)(struct filedescent **, int)); static void unp_discard(struct file *); @@ -354,7 +354,7 @@ uipc_abort(struct socket *so) unp2 = unp->unp_conn; if (unp2 != NULL) { UNP_PCB_LOCK(unp2); - unp_drop(unp2, ECONNRESET); + unp_drop(unp2); UNP_PCB_UNLOCK(unp2); } UNP_PCB_UNLOCK(unp); @@ -682,7 +682,7 @@ uipc_detach(struct socket *so) struct unpcb *ref = LIST_FIRST(&unp->unp_refs); UNP_PCB_LOCK(ref); - unp_drop(ref, ECONNRESET); + unp_drop(ref); UNP_PCB_UNLOCK(ref); } local_unp_rights = unp_rights; @@ -1698,7 +1698,7 @@ unp_shutdown(struct unpcb *unp) } static void -unp_drop(struct unpcb *unp, int errno) +unp_drop(struct unpcb *unp) { struct socket *so = unp->unp_socket; struct unpcb *unp2; @@ -1706,7 +1706,12 @@ unp_drop(struct unpcb *unp, int errno) UNP_LINK_WLOCK_ASSERT(); UNP_PCB_LOCK_ASSERT(unp); - so->so_error = errno; + /* + * Regardless of whether the socket's peer dropped the connection + * with this socket by aborting or disconnecting, POSIX requires + * that ECONNRESET is returned. + */ + so->so_error = ECONNRESET; unp2 = unp->unp_conn; if (unp2 == NULL) return; From owner-svn-src-head@freebsd.org Fri Feb 26 13:53:10 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E84A1AB4D63; Fri, 26 Feb 2016 13:53:10 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B24321EBB; Fri, 26 Feb 2016 13:53:10 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1QDr9at083296; Fri, 26 Feb 2016 13:53:09 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1QDr9a3083291; Fri, 26 Feb 2016 13:53:09 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201602261353.u1QDr9a3083291@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Fri, 26 Feb 2016 13:53:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r296093 - in head/sys: arm/allwinner arm/allwinner/a20 arm/allwinner/a31 dev/iicbus/twsi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Feb 2016 13:53:11 -0000 Author: andrew Date: Fri Feb 26 13:53:09 2016 New Revision: 296093 URL: https://svnweb.freebsd.org/changeset/base/296093 Log: Add the start of support for the Allwinner A31 clocks. It only adds support for the i2c, mmc, and gmac clocks. Further clocks can be added as needed. Submitted by: Emmanuel Vadot Reviewed by: jmcneill Differential Revision: https://reviews.freebsd.org/D5339 Added: head/sys/arm/allwinner/a31/a31_clk.c (contents, props changed) head/sys/arm/allwinner/a31/a31_clk.h (contents, props changed) Modified: head/sys/arm/allwinner/a10_mmc.c head/sys/arm/allwinner/a20/a20_if_dwc.c head/sys/dev/iicbus/twsi/a10_twsi.c Modified: head/sys/arm/allwinner/a10_mmc.c ============================================================================== --- head/sys/arm/allwinner/a10_mmc.c Fri Feb 26 12:46:34 2016 (r296092) +++ head/sys/arm/allwinner/a10_mmc.c Fri Feb 26 13:53:09 2016 (r296093) @@ -48,8 +48,10 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include +#include #define A10_MMC_MEMRES 0 #define A10_MMC_IRQRES 1 @@ -144,6 +146,7 @@ a10_mmc_attach(device_t dev) struct a10_mmc_softc *sc; struct sysctl_ctx_list *ctx; struct sysctl_oid_list *tree; + int clk; sc = device_get_softc(dev); sc->a10_dev = dev; @@ -168,7 +171,24 @@ a10_mmc_attach(device_t dev) } /* Activate the module clock. */ - if (a10_clk_mmc_activate(sc->a10_id) != 0) { + switch (allwinner_soc_type()) { +#if defined(SOC_ALLWINNER_A10) || defined(SOC_ALLWINNER_A20) + case ALLWINNERSOC_A10: + case ALLWINNERSOC_A10S: + case ALLWINNERSOC_A20: + clk = a10_clk_mmc_activate(sc->a10_id); + break; +#endif +#if defined(SOC_ALLWINNER_A31) || defined(SOC_ALLWINNER_A31S) + case ALLWINNERSOC_A31: + case ALLWINNERSOC_A31S: + clk = a31_clk_mmc_activate(sc->a10_id); + break; +#endif + default: + clk = -1; + } + if (clk != 0) { bus_teardown_intr(dev, sc->a10_res[A10_MMC_IRQRES], sc->a10_intrhand); bus_release_resources(dev, a10_mmc_res_spec, sc->a10_res); @@ -790,7 +810,23 @@ a10_mmc_update_ios(device_t bus, device_ return (error); /* Set the MMC clock. */ - error = a10_clk_mmc_cfg(sc->a10_id, ios->clock); + switch (allwinner_soc_type()) { +#if defined(SOC_ALLWINNER_A10) || defined(SOC_ALLWINNER_A20) + case ALLWINNERSOC_A10: + case ALLWINNERSOC_A10S: + case ALLWINNERSOC_A20: + error = a10_clk_mmc_cfg(sc->a10_id, ios->clock); + break; +#endif +#if defined(SOC_ALLWINNER_A31) || defined(SOC_ALLWINNER_A31S) + case ALLWINNERSOC_A31: + case ALLWINNERSOC_A31S: + error = a31_clk_mmc_cfg(sc->a10_id, ios->clock); + break; +#endif + default: + error = ENXIO; + } if (error != 0) return (error); Modified: head/sys/arm/allwinner/a20/a20_if_dwc.c ============================================================================== --- head/sys/arm/allwinner/a20/a20_if_dwc.c Fri Feb 26 12:46:34 2016 (r296092) +++ head/sys/arm/allwinner/a20/a20_if_dwc.c Fri Feb 26 13:53:09 2016 (r296093) @@ -40,7 +40,9 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include +#include #include "if_dwc_if.h" @@ -60,9 +62,27 @@ a20_if_dwc_probe(device_t dev) static int a20_if_dwc_init(device_t dev) { + int clk; /* Activate GMAC clock and set the pin mux to rgmii. */ - if (a10_clk_gmac_activate(ofw_bus_get_node(dev)) != 0) { + switch (allwinner_soc_type()) { +#if defined(SOC_ALLWINNER_A10) || defined(SOC_ALLWINNER_A20) + case ALLWINNERSOC_A10: + case ALLWINNERSOC_A10S: + case ALLWINNERSOC_A20: + clk = a10_clk_gmac_activate(ofw_bus_get_node(dev)); + break; +#endif +#if defined(SOC_ALLWINNER_A31) || defined(SOC_ALLWINNER_A31S) + case ALLWINNERSOC_A31: + case ALLWINNERSOC_A31S: + clk = a31_clk_gmac_activate(ofw_bus_get_node(dev)); + break; +#endif + default: + clk = -1; + } + if (clk != 0) { device_printf(dev, "could not activate gmac module\n"); return (ENXIO); } Added: head/sys/arm/allwinner/a31/a31_clk.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/allwinner/a31/a31_clk.c Fri Feb 26 13:53:09 2016 (r296093) @@ -0,0 +1,295 @@ +/*- + * Copyright (c) 2013 Ganbold Tsagaankhuu + * Copyright (c) 2016 Emmanuel Vadot + * 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. + */ + +/* + * Simple clock driver for Allwinner A31 + * Adapted from a10_clk.c +*/ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include + +struct a31_ccm_softc { + struct resource *res; + int pll6_enabled; +}; + +static struct a31_ccm_softc *a31_ccm_sc = NULL; + +#define ccm_read_4(sc, reg) \ + bus_read_4((sc)->res, (reg)) +#define ccm_write_4(sc, reg, val) \ + bus_write_4((sc)->res, (reg), (val)) + +#define PLL6_TIMEOUT 10 + +static int +a31_ccm_probe(device_t dev) +{ + + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + + if (ofw_bus_is_compatible(dev, "allwinner,sun6i-a31-ccm")) { + device_set_desc(dev, "Allwinner Clock Control Module"); + return(BUS_PROBE_DEFAULT); + } + + return (ENXIO); +} + +static int +a31_ccm_attach(device_t dev) +{ + struct a31_ccm_softc *sc = device_get_softc(dev); + int rid = 0; + + if (a31_ccm_sc) + return (ENXIO); + + sc->res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, RF_ACTIVE); + if (!sc->res) { + device_printf(dev, "could not allocate resource\n"); + return (ENXIO); + } + + a31_ccm_sc = sc; + + return (0); +} + +static device_method_t a31_ccm_methods[] = { + DEVMETHOD(device_probe, a31_ccm_probe), + DEVMETHOD(device_attach, a31_ccm_attach), + { 0, 0 } +}; + +static driver_t a31_ccm_driver = { + "a31_ccm", + a31_ccm_methods, + sizeof(struct a31_ccm_softc), +}; + +static devclass_t a31_ccm_devclass; + +EARLY_DRIVER_MODULE(a31_ccm, simplebus, a31_ccm_driver, a31_ccm_devclass, 0, 0, + BUS_PASS_TIMER + BUS_PASS_ORDER_MIDDLE); + +static int +a31_clk_pll6_enable(void) +{ + struct a31_ccm_softc *sc; + uint32_t reg_value; + int i; + + /* Datasheet recommand to use the default 600Mhz value */ + sc = a31_ccm_sc; + if (sc->pll6_enabled) + return (0); + reg_value = ccm_read_4(sc, A31_CCM_PLL6_CFG); + reg_value |= A31_CCM_PLL_CFG_ENABLE; + ccm_write_4(sc, A31_CCM_PLL6_CFG, reg_value); + + /* Wait for PLL to be stable */ + for (i = 0; i < PLL6_TIMEOUT; i++) + if (!(ccm_read_4(sc, A31_CCM_PLL6_CFG) & + A31_CCM_PLL6_CFG_REG_LOCK)) + break; + if (i == PLL6_TIMEOUT) + return (ENXIO); + sc->pll6_enabled = 1; + + return (0); +} + +static unsigned int +a31_clk_pll6_get_rate(void) +{ + struct a31_ccm_softc *sc; + uint32_t k, n, reg_value; + + sc = a31_ccm_sc; + reg_value = ccm_read_4(sc, A31_CCM_PLL6_CFG); + n = ((reg_value & A31_CCM_PLL_CFG_FACTOR_N) >> + A31_CCM_PLL_CFG_FACTOR_N_SHIFT); + k = ((reg_value & A31_CCM_PLL_CFG_FACTOR_K) >> + A31_CCM_PLL_CFG_FACTOR_K_SHIFT) + 1; + + return ((A31_CCM_CLK_REF_FREQ * n * k) / 2); +} + +int +a31_clk_gmac_activate(phandle_t node) +{ + char *phy_type; + struct a31_ccm_softc *sc; + uint32_t reg_value; + + sc = a31_ccm_sc; + if (sc == NULL) + return (ENXIO); + + if (a31_clk_pll6_enable()) + return (ENXIO); + + /* Gating AHB clock for GMAC */ + reg_value = ccm_read_4(sc, A31_CCM_AHB_GATING0); + reg_value |= A31_CCM_AHB_GATING_GMAC; + ccm_write_4(sc, A31_CCM_AHB_GATING0, reg_value); + + /* Set GMAC mode. */ + reg_value = A31_CCM_GMAC_CLK_MII; + if (OF_getprop_alloc(node, "phy-mode", 1, (void **)&phy_type) > 0) { + if (strcasecmp(phy_type, "rgmii") == 0) + reg_value = A31_CCM_GMAC_CLK_RGMII | + A31_CCM_GMAC_MODE_RGMII; + free(phy_type, M_OFWPROP); + } + ccm_write_4(sc, A31_CCM_GMAC_CLK, reg_value); + + /* Reset gmac */ + reg_value = ccm_read_4(sc, A31_CCM_AHB1_RST_REG0); + reg_value |= A31_CCM_AHB1_RST_REG0_GMAC; + ccm_write_4(sc, A31_CCM_AHB1_RST_REG0, reg_value); + + return (0); +} + +int +a31_clk_mmc_activate(int devid) +{ + struct a31_ccm_softc *sc; + uint32_t reg_value; + + sc = a31_ccm_sc; + if (sc == NULL) + return (ENXIO); + + if (a31_clk_pll6_enable()) + return (ENXIO); + + /* Gating AHB clock for SD/MMC */ + reg_value = ccm_read_4(sc, A31_CCM_AHB_GATING0); + reg_value |= A31_CCM_AHB_GATING_SDMMC0 << devid; + ccm_write_4(sc, A31_CCM_AHB_GATING0, reg_value); + + /* Soft reset */ + reg_value = ccm_read_4(sc, A31_CCM_AHB1_RST_REG0); + reg_value |= A31_CCM_AHB1_RST_REG0_SDMMC << devid; + ccm_write_4(sc, A31_CCM_AHB1_RST_REG0, reg_value); + + return (0); +} + +int +a31_clk_mmc_cfg(int devid, int freq) +{ + struct a31_ccm_softc *sc; + uint32_t clksrc, m, n, ophase, phase, reg_value; + unsigned int pll_freq; + + sc = a31_ccm_sc; + if (sc == NULL) + return (ENXIO); + + freq /= 1000; + if (freq <= 400) { + pll_freq = A31_CCM_CLK_REF_FREQ / 1000; + clksrc = A31_CCM_SD_CLK_SRC_SEL_OSC24M; + ophase = 0; + phase = 0; + n = 2; + } else if (freq <= 25000) { + pll_freq = a31_clk_pll6_get_rate() / 1000; + clksrc = A31_CCM_SD_CLK_SRC_SEL_PLL6; + ophase = 0; + phase = 5; + n = 2; + } else if (freq <= 50000) { + pll_freq = a31_clk_pll6_get_rate() / 1000; + clksrc = A31_CCM_SD_CLK_SRC_SEL_PLL6; + ophase = 3; + phase = 5; + n = 0; + } else + return (EINVAL); + m = ((pll_freq / (1 << n)) / (freq)) - 1; + reg_value = ccm_read_4(sc, A31_CCM_MMC0_SCLK_CFG + (devid * 4)); + reg_value &= ~A31_CCM_SD_CLK_SRC_SEL; + reg_value |= (clksrc << A31_CCM_SD_CLK_SRC_SEL_SHIFT); + reg_value &= ~A31_CCM_SD_CLK_PHASE_CTR; + reg_value |= (phase << A31_CCM_SD_CLK_PHASE_CTR_SHIFT); + reg_value &= ~A31_CCM_SD_CLK_DIV_RATIO_N; + reg_value |= (n << A31_CCM_SD_CLK_DIV_RATIO_N_SHIFT); + reg_value &= ~A31_CCM_SD_CLK_OPHASE_CTR; + reg_value |= (ophase << A31_CCM_SD_CLK_OPHASE_CTR_SHIFT); + reg_value &= ~A31_CCM_SD_CLK_DIV_RATIO_M; + reg_value |= m; + reg_value |= A31_CCM_PLL_CFG_ENABLE; + ccm_write_4(sc, A31_CCM_MMC0_SCLK_CFG + (devid * 4), reg_value); + + return (0); +} + +int +a31_clk_i2c_activate(int devid) +{ + struct a31_ccm_softc *sc; + uint32_t reg_value; + + sc = a31_ccm_sc; + if (sc == NULL) + return (ENXIO); + + if (a31_clk_pll6_enable()) + return (ENXIO); + + /* Gating APB clock for I2C/TWI */ + reg_value = ccm_read_4(sc, A31_CCM_APB2_GATING); + reg_value |= A31_CCM_APB2_GATING_TWI << devid; + ccm_write_4(sc, A31_CCM_APB2_GATING, reg_value); + + /* Soft reset */ + reg_value = ccm_read_4(sc, A31_CCM_APB2_RST); + reg_value |= A31_CCM_APB2_RST_TWI << devid; + ccm_write_4(sc, A31_CCM_APB2_RST, reg_value); + + return (0); +} Added: head/sys/arm/allwinner/a31/a31_clk.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/allwinner/a31/a31_clk.h Fri Feb 26 13:53:09 2016 (r296093) @@ -0,0 +1,189 @@ +/*- + * Copyright (c) 2013 Ganbold Tsagaankhuu + * Copyright (c) 2016 Emmanuel Vadot + * 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 _A31_CLK_H_ +#define _A31_CLK_H_ + +#define A31_CCM_PLL1_CFG 0x0000 +#define A31_CCM_PLL2_CFG 0x0008 +#define A31_CCM_PLL3_CFG 0x0010 +#define A31_CCM_PLL4_CFG 0x0018 +#define A31_CCM_PLL5_CFG 0x0020 +#define A31_CCM_PLL6_CFG 0x0028 +#define A31_CCM_PLL7_CFG 0x0030 +#define A31_CCM_PLL8_CFG 0x0038 +#define A31_CCM_MIPI_PLL_CFG 0x0040 +#define A31_CCM_PLL9_CFG 0x0044 +#define A31_CCM_PLL10_CFG 0x0048 +#define A31_CCM_AXI_CFG_REG 0x0050 +#define A31_CCM_AHB1_APB1_CFG 0x0054 +#define A31_CCM_APB2_CLK_DIV 0x0058 +#define A31_CCM_AHB_GATING0 0x0060 +#define A31_CCM_AHB_GATING1 0x0064 +#define A31_CCM_APB1_GATING 0x0068 +#define A31_CCM_APB2_GATING 0x006c +#define A31_CCM_NAND0_SCLK_CFG 0x0080 +#define A31_CCM_NAND1_SCLK_CFG 0x0084 +#define A31_CCM_MMC0_SCLK_CFG 0x0088 +#define A31_CCM_MMC1_SCLK_CFG 0x008c +#define A31_CCM_MMC2_SCLK_CFG 0x0090 +#define A31_CCM_MMC3_SCLK_CFG 0x0094 +#define A31_CCM_TS_CLK 0x0098 +#define A31_CCM_SS_CLK 0x009c +#define A31_CCM_SPI0_CLK 0x00a0 +#define A31_CCM_SPI1_CLK 0x00a4 +#define A31_CCM_SPI2_CLK 0x00a8 +#define A31_CCM_SPI3_CLK 0x00ac +#define A31_CCM_DAUDIO0_CLK 0x00b0 +#define A31_CCM_DAUDIO1_CLK 0x00b4 +#define A31_CCM_USBPHY_CLK 0x00cc +#define A31_CCM_GMAC_CLK 0x00d0 +#define A31_CCM_MDFS_CLK 0x00f0 +#define A31_CCM_DRAM_CLK 0x00f4 +#define A31_CCM_DRAM_GATING 0x0100 +#define A31_CCM_BE0_SCLK 0x0104 +#define A31_CCM_BE1_SCLK 0x0108 +#define A31_CCM_FE0_CLK 0x010c +#define A31_CCM_FE1_CLK 0x0110 +#define A31_CCM_MP_CLK 0x0114 +#define A31_CCM_LCD0_CH0_CLK 0x0118 +#define A31_CCM_LCD1_CH0_CLK 0x011c +#define A31_CCM_LCD0_CH1_CLK 0x012c +#define A31_CCM_LCD1_CH1_CLK 0x0130 +#define A31_CCM_CSI0_CLK 0x0134 +#define A31_CCM_CSI1_CLK 0x0138 +#define A31_CCM_VE_CLK 0x013c +#define A31_CCM_AUDIO_CODEC_CLK 0x0140 +#define A31_CCM_AVS_CLK 0x0144 +#define A31_CCM_DIGITAL_MIC_CLK 0x0148 +#define A31_CCM_HDMI_CLK 0x0150 +#define A31_CCM_PS_CLK 0x0154 +#define A31_CCM_MBUS_SCLK_CFG0 0x015c +#define A31_CCM_MBUS_SCLK_CFG1 0x0160 +#define A31_CCM_MIPI_DSI_CLK 0x0168 +#define A31_CCM_MIPI_CSI0_CLK 0x016c +#define A31_CCM_DRC0_SCLK_CFG 0x0180 +#define A31_CCM_DRC1_SCLK_CFG 0x0184 +#define A31_CCM_DEU0_SCLK_CFG 0x0188 +#define A31_CCM_DEU1_SCLK_CFG 0x018c +#define A31_CCM_GPU_CORE_CLK 0x01a0 +#define A31_CCM_GPU_MEM_CLK 0x01a4 +#define A31_CCM_GPU_HYD_CLK 0x01a8 +#define A31_CCM_ATS_CLK 0x01b0 +#define A31_CCM_TRACE_CLK 0x01b4 +#define A31_CCM_PLL_LOCK_CFG 0x0200 +#define A31_CCM_PLL1_LOCK_CFG 0x0204 +#define A31_CCM_PLL1_BIAS 0x0220 +#define A31_CCM_PLL2_BIAS 0x0224 +#define A31_CCM_PLL3_BIAS 0x0228 +#define A31_CCM_PLL4_BIAS 0x022c +#define A31_CCM_PLL5_BIAS 0x0230 +#define A31_CCM_PLL6_BIAS 0x0234 +#define A31_CCM_PLL7_BIAS 0x0238 +#define A31_CCM_PLL8_BIAS 0x023c +#define A31_CCM_PLL9_BIAS 0x0240 +#define A31_CCM_MIPI_PLL_BIAS 0x0244 +#define A31_CCM_PLL10_BIAS 0x0248 +#define A31_CCM_PLL1_PAT_CFG 0x0280 +#define A31_CCM_PLL2_PAT_CFG 0x0284 +#define A31_CCM_PLL3_PAT_CFG 0x0288 +#define A31_CCM_PLL4_PAT_CFG 0x028c +#define A31_CCM_PLL5_PAT_CFG 0x0290 +#define A31_CCM_PLL6_PAT_CFG 0x0294 +#define A31_CCM_PLL7_PAT_CFG 0x0298 +#define A31_CCM_PLL8_PAT_CFG 0x029c +#define A31_CCM_MIPI_PLL_PAT_CFG 0x02a0 +#define A31_CCM_PLL9_PAT_CFG 0x02a4 +#define A31_CCM_PLL10_PAT_CFG 0x02a8 +#define A31_CCM_AHB1_RST_REG0 0x02c0 +#define A31_CCM_AHB1_RST_REG1 0x02c4 +#define A31_CCM_AHB1_RST_REG2 0x02c8 +#define A31_CCM_APB1_RST 0x02d0 +#define A31_CCM_APB2_RST 0x02d8 +#define A31_CCM_CLK_OUTA 0x0300 +#define A31_CCM_CLK_OUTB 0x0304 +#define A31_CCM_CLK_OUTC 0x0308 + +/* PLL6_CFG_REG */ +#define A31_CCM_PLL6_CFG_REG_LOCK (1 << 28) + +/* AHB_GATING_REG0 */ +#define A31_CCM_AHB_GATING_SDMMC0 (1 << 8) +#define A31_CCM_AHB_GATING_GMAC (1 << 17) + +#define A31_CCM_PLL_CFG_ENABLE (1U << 31) +#define A31_CCM_PLL_CFG_BYPASS (1U << 30) +#define A31_CCM_PLL_CFG_PLL5 (1U << 25) +#define A31_CCM_PLL_CFG_PLL6 (1U << 24) +#define A31_CCM_PLL_CFG_FACTOR_N 0x1f00 +#define A31_CCM_PLL_CFG_FACTOR_N_SHIFT 8 +#define A31_CCM_PLL_CFG_FACTOR_K 0x30 +#define A31_CCM_PLL_CFG_FACTOR_K_SHIFT 4 +#define A31_CCM_PLL_CFG_FACTOR_M 0x3 + +/* APB2_GATING */ +#define A31_CCM_APB2_GATING_TWI (1 << 0) + +/* AHB1_RST_REG0 */ +#define A31_CCM_AHB1_RST_REG0_GMAC (1 << 17) +#define A31_CCM_AHB1_RST_REG0_SDMMC (1 << 8) + +/* APB2_RST_REG */ +#define A31_CCM_APB2_RST_TWI (1 << 0) + + +/* GMAC */ +#define A31_CCM_GMAC_CLK_DELAY_SHIFT 10 +#define A31_CCM_GMAC_CLK_MODE_MASK 0x7 +#define A31_CCM_GMAC_MODE_RGMII (1 << 2) +#define A31_CCM_GMAC_CLK_MII 0x0 +#define A31_CCM_GMAC_CLK_EXT_RGMII 0x1 +#define A31_CCM_GMAC_CLK_RGMII 0x2 + +/* SD/MMC */ +#define A31_CCM_SD_CLK_SRC_SEL 0x3000000 +#define A31_CCM_SD_CLK_SRC_SEL_SHIFT 24 +#define A31_CCM_SD_CLK_SRC_SEL_OSC24M 0 +#define A31_CCM_SD_CLK_SRC_SEL_PLL6 1 +#define A31_CCM_SD_CLK_PHASE_CTR 0x700000 +#define A31_CCM_SD_CLK_PHASE_CTR_SHIFT 20 +#define A31_CCM_SD_CLK_DIV_RATIO_N 0x30000 +#define A31_CCM_SD_CLK_DIV_RATIO_N_SHIFT 16 +#define A31_CCM_SD_CLK_OPHASE_CTR 0x700 +#define A31_CCM_SD_CLK_OPHASE_CTR_SHIFT 8 +#define A31_CCM_SD_CLK_DIV_RATIO_M 0xf + +#define A31_CCM_CLK_REF_FREQ 24000000U + +int a31_clk_gmac_activate(phandle_t); +int a31_clk_mmc_activate(int); +int a31_clk_mmc_cfg(int, int); +int a31_clk_i2c_activate(int); + +#endif /* _A31_CLK_H_ */ Modified: head/sys/dev/iicbus/twsi/a10_twsi.c ============================================================================== --- head/sys/dev/iicbus/twsi/a10_twsi.c Fri Feb 26 12:46:34 2016 (r296092) +++ head/sys/dev/iicbus/twsi/a10_twsi.c Fri Feb 26 13:53:09 2016 (r296093) @@ -49,6 +49,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include "iicbus_if.h" @@ -62,6 +63,15 @@ __FBSDID("$FreeBSD$"); #define TWI_EFR 0x1C #define TWI_LCR 0x20 +#define A10_I2C 1 +#define A31_I2C 2 + +static struct ofw_compat_data compat_data[] = { + {"allwinner,sun4i-a10-i2c", A10_I2C}, + {"allwinner,sun6i-a31-i2c", A31_I2C}, + {NULL, 0}, +}; + static int a10_twsi_probe(device_t dev) { @@ -71,7 +81,7 @@ a10_twsi_probe(device_t dev) if (!ofw_bus_status_okay(dev)) return (ENXIO); - if (!ofw_bus_is_compatible(dev, "allwinner,sun4i-a10-i2c")) + if (ofw_bus_search_compatible(dev, compat_data)->ocd_data == 0) return (ENXIO); device_set_desc(dev, "Allwinner Integrated I2C Bus Controller"); @@ -82,11 +92,30 @@ static int a10_twsi_attach(device_t dev) { struct twsi_softc *sc; + int clk; sc = device_get_softc(dev); /* Activate clock */ - a10_clk_i2c_activate(device_get_unit(dev)); + switch (ofw_bus_search_compatible(dev, compat_data)->ocd_data) { +#if defined(SOC_ALLWINNER_A10) || defined(SOC_ALLWINNER_A20) + case A10_I2C: + clk = a10_clk_i2c_activate(device_get_unit(dev)); + break; +#endif +#if defined(SOC_ALLWINNER_A31) || defined(SOC_ALLWINNER_A31S) + case A31_I2C: + clk = a31_clk_i2c_activate(device_get_unit(dev)); + break; +#endif + default: + clk = -1; + } + + if (clk != 0) { + device_printf(dev, "could not activate i2c clock\n"); + return (ENXIO); + } sc->reg_data = TWI_DATA; sc->reg_slave_addr = TWI_ADDR; From owner-svn-src-head@freebsd.org Fri Feb 26 14:04:02 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1623CAB5102; Fri, 26 Feb 2016 14:04:02 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CCE2D78E; Fri, 26 Feb 2016 14:04:01 +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 u1QE40Zr086406; Fri, 26 Feb 2016 14:04:00 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1QE40pZ086404; Fri, 26 Feb 2016 14:04:00 GMT (envelope-from br@FreeBSD.org) Message-Id: <201602261404.u1QE40pZ086404@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Fri, 26 Feb 2016 14:04:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r296094 - in head/sys/riscv: include riscv X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Feb 2016 14:04:02 -0000 Author: br Date: Fri Feb 26 14:04:00 2016 New Revision: 296094 URL: https://svnweb.freebsd.org/changeset/base/296094 Log: o Use uint64_t for page number as it doesn't fit uint32_t. o Implement growkernel bits for L1 level of pagetables. This allows us to boot with 128GB of physical memory. Sponsored by: DARPA, AFRL Sponsored by: HEIF5 Modified: head/sys/riscv/include/pte.h head/sys/riscv/riscv/pmap.c Modified: head/sys/riscv/include/pte.h ============================================================================== --- head/sys/riscv/include/pte.h Fri Feb 26 13:53:09 2016 (r296093) +++ head/sys/riscv/include/pte.h Fri Feb 26 14:04:00 2016 (r296094) @@ -41,6 +41,7 @@ #ifndef LOCORE typedef uint64_t pd_entry_t; /* page directory entry */ typedef uint64_t pt_entry_t; /* page table entry */ +typedef uint64_t pn_t; /* page number */ #endif /* Level 0 table, 512GiB per entry */ Modified: head/sys/riscv/riscv/pmap.c ============================================================================== --- head/sys/riscv/riscv/pmap.c Fri Feb 26 13:53:09 2016 (r296093) +++ head/sys/riscv/riscv/pmap.c Fri Feb 26 14:04:00 2016 (r296094) @@ -450,7 +450,7 @@ pmap_bootstrap_dmap(vm_offset_t l1pt, vm pd_entry_t *l1; u_int l1_slot; pt_entry_t entry; - u_int pn; + pn_t pn; pa = kernstart & ~L1_OFFSET; va = DMAP_MIN_ADDRESS; @@ -924,7 +924,7 @@ pmap_qenter(vm_offset_t sva, vm_page_t * vm_offset_t va; vm_page_t m; pt_entry_t entry; - u_int pn; + pn_t pn; int i; va = sva; @@ -1143,7 +1143,7 @@ _pmap_alloc_l3(pmap_t pmap, vm_pindex_t vm_page_t m, /*pdppg, */pdpg; pt_entry_t entry; vm_paddr_t phys; - int pn; + pn_t pn; PMAP_LOCK_ASSERT(pmap, MA_OWNED); @@ -1323,7 +1323,7 @@ pmap_growkernel(vm_offset_t addr) vm_page_t nkpg; pd_entry_t *l1, *l2; pt_entry_t entry; - int pn; + pn_t pn; mtx_assert(&kernel_map->system_mtx, MA_OWNED); @@ -1343,10 +1343,11 @@ pmap_growkernel(vm_offset_t addr) pmap_zero_page(nkpg); paddr = VM_PAGE_TO_PHYS(nkpg); - panic("%s: implement grow l1\n", __func__); -#if 0 - pmap_load_store(l1, paddr | L1_TABLE); -#endif + pn = (paddr / PAGE_SIZE); + entry = (PTE_VALID | (PTE_TYPE_PTR << PTE_TYPE_S)); + entry |= (pn << PTE_PPN0_S); + pmap_load_store(l1, entry); + PTE_SYNC(l1); continue; /* try again */ } @@ -1933,9 +1934,9 @@ pmap_enter(pmap_t pmap, vm_offset_t va, vm_page_t mpte, om, l2_m, l3_m; boolean_t nosleep; pt_entry_t entry; - int l2_pn; - int l3_pn; - int pn; + pn_t l2_pn; + pn_t l3_pn; + pn_t pn; va = trunc_page(va); if ((m->oflags & VPO_UNMANAGED) == 0 && !vm_page_xbusied(m)) @@ -2211,7 +2212,7 @@ pmap_enter_quick_locked(pmap_t pmap, vm_ pt_entry_t *l3; vm_paddr_t pa; pt_entry_t entry; - int pn; + pn_t pn; KASSERT(va < kmi.clean_sva || va >= kmi.clean_eva || (m->oflags & VPO_UNMANAGED) != 0, @@ -3084,8 +3085,8 @@ pmap_mincore(pmap_t pmap, vm_offset_t ad void pmap_activate(struct thread *td) { - uint64_t entry; - uint64_t pn; + pt_entry_t entry; + pn_t pn; pmap_t pmap; critical_enter(); From owner-svn-src-head@freebsd.org Fri Feb 26 14:39:40 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E3161AB5BD6; Fri, 26 Feb 2016 14:39:40 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B190515DE; Fri, 26 Feb 2016 14:39:40 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1QEddkk095149; Fri, 26 Feb 2016 14:39:39 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1QEddr9095148; Fri, 26 Feb 2016 14:39:39 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201602261439.u1QEddr9095148@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Fri, 26 Feb 2016 14:39:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r296095 - head/lib/libc/rpc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Feb 2016 14:39:41 -0000 Author: pfg Date: Fri Feb 26 14:39:39 2016 New Revision: 296095 URL: https://svnweb.freebsd.org/changeset/base/296095 Log: rpc: fix failure to clear string by passing the wrong size to memset. Noted by NetBSD's PR/21014 Obtained from: NetBSD (CVS Rev. 1.24, 1.25) MFC after: 1 month Modified: head/lib/libc/rpc/svc_simple.c Modified: head/lib/libc/rpc/svc_simple.c ============================================================================== --- head/lib/libc/rpc/svc_simple.c Fri Feb 26 14:04:00 2016 (r296094) +++ head/lib/libc/rpc/svc_simple.c Fri Feb 26 14:39:39 2016 (r296095) @@ -272,7 +272,7 @@ universal(struct svc_req *rqstp, SVCXPRT /* decode arguments into a CLEAN buffer */ xdrbuf = pl->p_xdrbuf; /* Zero the arguments: reqd ! */ - (void) memset(xdrbuf, 0, sizeof (pl->p_recvsz)); + (void) memset(xdrbuf, 0, (size_t)pl->p_recvsz); /* * Assuming that sizeof (xdrbuf) would be enough * for the arguments; if not then the program From owner-svn-src-head@freebsd.org Fri Feb 26 15:46:16 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5E2F4AB5783; Fri, 26 Feb 2016 15:46:16 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 17AB9191; Fri, 26 Feb 2016 15:46:16 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1QFkFbV016460; Fri, 26 Feb 2016 15:46:15 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1QFkEaC016458; Fri, 26 Feb 2016 15:46:15 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201602261546.u1QFkEaC016458@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 26 Feb 2016 15:46:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r296096 - in head: . share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Feb 2016 15:46:16 -0000 Author: emaste Date: Fri Feb 26 15:46:14 2016 New Revision: 296096 URL: https://svnweb.freebsd.org/changeset/base/296096 Log: Install elftoolchain elfcopy(1) as objcopy(1) by default As of r295661 elfcopy supports PE format for EFI boot binaries and is a viable objcopy implementation for the base system and ports. The (temporary) src.conf knob WITHOUT_ELFCOPY_AS_OBJCOPY knob may be set to obtain the GNU version if necessary. PR: 207091 [exp-run] Relnotes: Yes Sponsored by: The FreeBSD Foundation Modified: head/UPDATING head/share/mk/src.opts.mk Modified: head/UPDATING ============================================================================== --- head/UPDATING Fri Feb 26 14:39:39 2016 (r296095) +++ head/UPDATING Fri Feb 26 15:46:14 2016 (r296096) @@ -31,6 +31,13 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 11 disable the most expensive debugging functionality run "ln -s 'abort:false,junk:false' /etc/malloc.conf".) +20150107: + The ELF object manipulation tool objcopy is now provided by the + ELF Tool Chain project rather than by GNU binutils. It should be a + drop-in replacement, with the addition of arm64 support. The + (temporary) src.conf knob WITHOUT_ELFCOPY_AS_OBJCOPY knob may be set + to obtain the GNU version if necessary. + 20160129: Building ZFS pools on top of zvols is prohibited by default. That feature has never worked safely; it's always been prone to deadlocks. Modified: head/share/mk/src.opts.mk ============================================================================== --- head/share/mk/src.opts.mk Fri Feb 26 14:39:39 2016 (r296095) +++ head/share/mk/src.opts.mk Fri Feb 26 15:46:14 2016 (r296096) @@ -80,6 +80,7 @@ __DEFAULT_YES_OPTIONS = \ DYNAMICROOT \ ED_CRYPTO \ EE \ + ELFCOPY_AS_OBJCOPY \ ELFTOOLCHAIN_BOOTSTRAP \ EXAMPLES \ FDT \ @@ -231,9 +232,9 @@ __DEFAULT_NO_OPTIONS+=CLANG CLANG_BOOTST # In-tree binutils/gcc are older versions without modern architecture support. .if ${__T} == "aarch64" || ${__T} == "riscv64" BROKEN_OPTIONS+=BINUTILS BINUTILS_BOOTSTRAP GCC GCC_BOOTSTRAP GDB -__DEFAULT_YES_OPTIONS+=ELFCOPY_AS_OBJCOPY LLVM_LIBUNWIND +__DEFAULT_YES_OPTIONS+=LLVM_LIBUNWIND .else -__DEFAULT_NO_OPTIONS+=ELFCOPY_AS_OBJCOPY LLVM_LIBUNWIND +__DEFAULT_NO_OPTIONS+=LLVM_LIBUNWIND .endif .if ${__T} == "riscv64" BROKEN_OPTIONS+=PROFILE # "sorry, unimplemented: profiler support for RISC-V" From owner-svn-src-head@freebsd.org Fri Feb 26 15:52:57 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 24191AB5C24; Fri, 26 Feb 2016 15:52:57 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CE066C9F; Fri, 26 Feb 2016 15:52:56 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1QFqtuE019686; Fri, 26 Feb 2016 15:52:55 GMT (envelope-from marcel@FreeBSD.org) Received: (from marcel@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1QFqtGC019685; Fri, 26 Feb 2016 15:52:55 GMT (envelope-from marcel@FreeBSD.org) Message-Id: <201602261552.u1QFqtGC019685@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: marcel set sender to marcel@FreeBSD.org using -f From: Marcel Moolenaar Date: Fri, 26 Feb 2016 15:52:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r296097 - head/sys/boot/userboot/userboot X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Feb 2016 15:52:57 -0000 Author: marcel Date: Fri Feb 26 15:52:55 2016 New Revision: 296097 URL: https://svnweb.freebsd.org/changeset/base/296097 Log: Check that the userboot version is at least 3, rather than 3 exactly. The structure may be of a newer version and as long as it is backward compatible with 3, we can work with it. While here: whitespace nits. Modified: head/sys/boot/userboot/userboot/main.c Modified: head/sys/boot/userboot/userboot/main.c ============================================================================== --- head/sys/boot/userboot/userboot/main.c Fri Feb 26 15:46:14 2016 (r296096) +++ head/sys/boot/userboot/userboot/main.c Fri Feb 26 15:52:55 2016 (r296097) @@ -43,6 +43,7 @@ static void userboot_zfs_probe(void); static int userboot_zfs_found; #endif +/* Minimum version required */ #define USERBOOT_VERSION USERBOOT_VERSION_3 #define MALLOCSZ (10*1024*1024) @@ -64,7 +65,7 @@ void delay(int usec) { - CALLBACK(delay, usec); + CALLBACK(delay, usec); } void @@ -82,11 +83,11 @@ loader_main(struct loader_callbacks *cb, const char *var; int i; - if (version != USERBOOT_VERSION) - abort(); + if (version < USERBOOT_VERSION) + abort(); callbacks = cb; - callbacks_arg = arg; + callbacks_arg = arg; userboot_disk_maxunit = ndisks; /* @@ -95,9 +96,9 @@ loader_main(struct loader_callbacks *cb, */ setheap((void *)mallocbuf, (void *)(mallocbuf + sizeof(mallocbuf))); - /* - * Hook up the console - */ + /* + * Hook up the console + */ cons_probe(); printf("\n"); @@ -192,9 +193,9 @@ extract_currdev(void) } env_setenv("currdev", EV_VOLATILE, userboot_fmtdev(&dev), - userboot_setcurrdev, env_nounset); + userboot_setcurrdev, env_nounset); env_setenv("loaddev", EV_VOLATILE, userboot_fmtdev(&dev), - env_noset, env_nounset); + env_noset, env_nounset); } #if defined(USERBOOT_ZFS_SUPPORT) From owner-svn-src-head@freebsd.org Fri Feb 26 15:54:37 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A797CAB5D59; Fri, 26 Feb 2016 15:54:37 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6B4D7F72; Fri, 26 Feb 2016 15:54:37 +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 u1QFsaub019797; Fri, 26 Feb 2016 15:54:36 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1QFsY2G019781; Fri, 26 Feb 2016 15:54:34 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201602261554.u1QFsY2G019781@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Fri, 26 Feb 2016 15:54:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r296098 - in head/sys/arm: allwinner/a20 altera/socfpga amlogic/aml8726 annapurna/alpine arm broadcom/bcm2835 freescale/imx include mv/armada38x mv/armadaxp qemu rockchip samsung/exynos... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Feb 2016 15:54:37 -0000 Author: andrew Date: Fri Feb 26 15:54:34 2016 New Revision: 296098 URL: https://svnweb.freebsd.org/changeset/base/296098 Log: Remove platform_mp_probe as it's almost identical on most ARM SoCs, and slightly wrong on the others. We should just check if mp_ncpus is set to more than one CPU as we may wish to run on a single core even when SMP is available. Reviewed by: ian Sponsored by: ABT Systems Ltd Differential Revision: https://reviews.freebsd.org/D5458 Modified: head/sys/arm/allwinner/a20/a20_mp.c head/sys/arm/altera/socfpga/socfpga_mp.c head/sys/arm/amlogic/aml8726/aml8726_mp.c head/sys/arm/annapurna/alpine/alpine_machdep_mp.c head/sys/arm/arm/mp_machdep.c head/sys/arm/broadcom/bcm2835/bcm2836_mp.c head/sys/arm/freescale/imx/imx6_mp.c head/sys/arm/include/smp.h head/sys/arm/mv/armada38x/armada38x_mp.c head/sys/arm/mv/armadaxp/armadaxp_mp.c head/sys/arm/qemu/virt_mp.c head/sys/arm/rockchip/rk30xx_mp.c head/sys/arm/samsung/exynos/exynos5_mp.c head/sys/arm/ti/omap4/omap4_mp.c head/sys/arm/xilinx/zy7_mp.c Modified: head/sys/arm/allwinner/a20/a20_mp.c ============================================================================== --- head/sys/arm/allwinner/a20/a20_mp.c Fri Feb 26 15:52:55 2016 (r296097) +++ head/sys/arm/allwinner/a20/a20_mp.c Fri Feb 26 15:54:34 2016 (r296098) @@ -81,16 +81,6 @@ platform_mp_setmaxid(void) mp_maxid = ncpu - 1; } -int -platform_mp_probe(void) -{ - - if (mp_ncpus == 0) - platform_mp_setmaxid(); - - return (mp_ncpus > 1); -} - void platform_mp_start_ap(void) { Modified: head/sys/arm/altera/socfpga/socfpga_mp.c ============================================================================== --- head/sys/arm/altera/socfpga/socfpga_mp.c Fri Feb 26 15:52:55 2016 (r296097) +++ head/sys/arm/altera/socfpga/socfpga_mp.c Fri Feb 26 15:54:34 2016 (r296098) @@ -111,16 +111,6 @@ platform_mp_setmaxid(void) mp_maxid = ncpu - 1; } -int -platform_mp_probe(void) -{ - - if (mp_ncpus == 0) - platform_mp_setmaxid(); - - return (mp_ncpus > 1); -} - void platform_mp_start_ap(void) { Modified: head/sys/arm/amlogic/aml8726/aml8726_mp.c ============================================================================== --- head/sys/arm/amlogic/aml8726/aml8726_mp.c Fri Feb 26 15:52:55 2016 (r296097) +++ head/sys/arm/amlogic/aml8726/aml8726_mp.c Fri Feb 26 15:54:34 2016 (r296098) @@ -433,18 +433,6 @@ moveon: mp_maxid = ncpu - 1; } - -int -platform_mp_probe(void) -{ - - if (mp_ncpus == 0) - platform_mp_setmaxid(); - - return (mp_ncpus > 1); -} - - void platform_mp_start_ap(void) { Modified: head/sys/arm/annapurna/alpine/alpine_machdep_mp.c ============================================================================== --- head/sys/arm/annapurna/alpine/alpine_machdep_mp.c Fri Feb 26 15:52:55 2016 (r296097) +++ head/sys/arm/annapurna/alpine/alpine_machdep_mp.c Fri Feb 26 15:54:34 2016 (r296098) @@ -133,12 +133,6 @@ platform_mp_setmaxid(void) mp_maxid = mp_ncpus - 1; } -int -platform_mp_probe(void) -{ - return (1); -} - static int alpine_get_cpu_resume_base(u_long *pbase, u_long *psize) { Modified: head/sys/arm/arm/mp_machdep.c ============================================================================== --- head/sys/arm/arm/mp_machdep.c Fri Feb 26 15:52:55 2016 (r296097) +++ head/sys/arm/arm/mp_machdep.c Fri Feb 26 15:54:34 2016 (r296098) @@ -86,9 +86,12 @@ void *dpcpu[MAXCPU - 1]; int cpu_mp_probe(void) { + + KASSERT(mp_ncpus != 0, ("cpu_mp_probe: mp_ncpus is unset")); + CPU_SETOF(0, &all_cpus); - return (platform_mp_probe()); + return (mp_ncpus > 1); } /* Start Application Processor via platform specific function */ Modified: head/sys/arm/broadcom/bcm2835/bcm2836_mp.c ============================================================================== --- head/sys/arm/broadcom/bcm2835/bcm2836_mp.c Fri Feb 26 15:52:55 2016 (r296097) +++ head/sys/arm/broadcom/bcm2835/bcm2836_mp.c Fri Feb 26 15:54:34 2016 (r296098) @@ -95,17 +95,6 @@ platform_mp_setmaxid(void) DPRINTF("mp_maxid=%d\n", mp_maxid); } -int -platform_mp_probe(void) -{ - - DPRINTF("platform_mp_probe\n"); - CPU_SETOF(0, &all_cpus); - if (mp_ncpus == 0) - platform_mp_setmaxid(); - return (mp_ncpus > 1); -} - void platform_mp_start_ap(void) { Modified: head/sys/arm/freescale/imx/imx6_mp.c ============================================================================== --- head/sys/arm/freescale/imx/imx6_mp.c Fri Feb 26 15:52:55 2016 (r296097) +++ head/sys/arm/freescale/imx/imx6_mp.c Fri Feb 26 15:54:34 2016 (r296098) @@ -99,17 +99,6 @@ platform_mp_setmaxid(void) mp_maxid = ncpu - 1; } -int -platform_mp_probe(void) -{ - - /* I think platform_mp_setmaxid must get called first, but be safe. */ - if (mp_ncpus == 0) - platform_mp_setmaxid(); - - return (mp_ncpus > 1); -} - void platform_mp_start_ap(void) { Modified: head/sys/arm/include/smp.h ============================================================================== --- head/sys/arm/include/smp.h Fri Feb 26 15:52:55 2016 (r296097) +++ head/sys/arm/include/smp.h Fri Feb 26 15:54:34 2016 (r296098) @@ -45,7 +45,6 @@ int pic_ipi_read(int arg); /* Platform interface */ void platform_mp_setmaxid(void); -int platform_mp_probe(void); void platform_mp_start_ap(void); void platform_mp_init_secondary(void); Modified: head/sys/arm/mv/armada38x/armada38x_mp.c ============================================================================== --- head/sys/arm/mv/armada38x/armada38x_mp.c Fri Feb 26 15:52:55 2016 (r296097) +++ head/sys/arm/mv/armada38x/armada38x_mp.c Fri Feb 26 15:54:34 2016 (r296098) @@ -130,13 +130,6 @@ platform_mp_setmaxid(void) mp_maxid = 1; } -int -platform_mp_probe(void) -{ - - return (mp_ncpus > 1); -} - void platform_mp_init_secondary(void) { Modified: head/sys/arm/mv/armadaxp/armadaxp_mp.c ============================================================================== --- head/sys/arm/mv/armadaxp/armadaxp_mp.c Fri Feb 26 15:52:55 2016 (r296097) +++ head/sys/arm/mv/armadaxp/armadaxp_mp.c Fri Feb 26 15:54:34 2016 (r296098) @@ -87,13 +87,6 @@ platform_mp_setmaxid(void) mp_maxid = mp_ncpus - 1; } -int -platform_mp_probe(void) -{ - - return (mp_ncpus > 1); -} - void platform_mp_init_secondary(void) { Modified: head/sys/arm/qemu/virt_mp.c ============================================================================== --- head/sys/arm/qemu/virt_mp.c Fri Feb 26 15:52:55 2016 (r296097) +++ head/sys/arm/qemu/virt_mp.c Fri Feb 26 15:54:34 2016 (r296098) @@ -46,13 +46,6 @@ __FBSDID("$FreeBSD$"); static int running_cpus; -int -platform_mp_probe(void) -{ - - return (mp_ncpus > 1); -} - static boolean_t virt_maxid(u_int id, phandle_t node, u_int addr_cells, pcell_t *reg) { Modified: head/sys/arm/rockchip/rk30xx_mp.c ============================================================================== --- head/sys/arm/rockchip/rk30xx_mp.c Fri Feb 26 15:52:55 2016 (r296097) +++ head/sys/arm/rockchip/rk30xx_mp.c Fri Feb 26 15:54:34 2016 (r296098) @@ -107,16 +107,6 @@ platform_mp_setmaxid(void) mp_maxid = ncpu - 1; } -int -platform_mp_probe(void) -{ - - if (mp_ncpus == 0) - platform_mp_setmaxid(); - - return (mp_ncpus > 1); -} - void platform_mp_start_ap(void) { Modified: head/sys/arm/samsung/exynos/exynos5_mp.c ============================================================================== --- head/sys/arm/samsung/exynos/exynos5_mp.c Fri Feb 26 15:52:55 2016 (r296097) +++ head/sys/arm/samsung/exynos/exynos5_mp.c Fri Feb 26 15:54:34 2016 (r296098) @@ -89,13 +89,6 @@ platform_mp_setmaxid(void) mp_maxid = mp_ncpus - 1; } -int -platform_mp_probe(void) -{ - - return (mp_ncpus > 1); -} - void platform_mp_start_ap(void) { Modified: head/sys/arm/ti/omap4/omap4_mp.c ============================================================================== --- head/sys/arm/ti/omap4/omap4_mp.c Fri Feb 26 15:52:55 2016 (r296097) +++ head/sys/arm/ti/omap4/omap4_mp.c Fri Feb 26 15:54:34 2016 (r296098) @@ -56,13 +56,6 @@ platform_mp_setmaxid(void) mp_ncpus = 2; } -int -platform_mp_probe(void) -{ - - return (1); -} - void platform_mp_start_ap(void) { Modified: head/sys/arm/xilinx/zy7_mp.c ============================================================================== --- head/sys/arm/xilinx/zy7_mp.c Fri Feb 26 15:52:55 2016 (r296097) +++ head/sys/arm/xilinx/zy7_mp.c Fri Feb 26 15:54:34 2016 (r296098) @@ -61,13 +61,6 @@ platform_mp_setmaxid(void) mp_ncpus = 2; } -int -platform_mp_probe(void) -{ - - return (1); -} - void platform_mp_start_ap(void) { From owner-svn-src-head@freebsd.org Fri Feb 26 15:55:10 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 264BCAB5DC7 for ; Fri, 26 Feb 2016 15:55:10 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: from mail-qk0-x229.google.com (mail-qk0-x229.google.com [IPv6:2607:f8b0:400d:c09::229]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D2A5110D9 for ; Fri, 26 Feb 2016 15:55:09 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: by mail-qk0-x229.google.com with SMTP id s5so33204036qkd.0 for ; Fri, 26 Feb 2016 07:55:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hardenedbsd-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=KIhNk1Aezl0tYHel3NavILql6m5SFz0CAc823xwkcP4=; b=M1Rs4rYZhEgkwozV6QeMS3WBdtk8LLOheL6Dhy+QpsgDgTFitOZXYNkU9md2OupU6S F2imJ924eSyCGbnXKzdx47JoYV6mUf6gesevL9SqwdiGNc9oyMlOIcHgMc9I+TLgbrmq RDIhj7QYMzwFviBmOB9QKfPCzOglGFCPNnCFvPxPTKqnOAuCdX05L4gax2YDbZ3N8yQD 2Inqaem+hQZsw2Aai7t6I9jGEYacROaAZ4f6XY6AFQKBduxac3qw18fJkuPxjNQ1ohCm 1WLgR5735+ublTDH869Y6xB3aw0L0T2jlIm6GS/zvSYDkZgMTKEa3/8J3u+s91AYacKH sRxw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=KIhNk1Aezl0tYHel3NavILql6m5SFz0CAc823xwkcP4=; b=GQwogOe91PM3Jon9OAMXv50ZM/N/YvVd8cWUKzQGm2XmYkiZ7HBm0Abkfmd4JayEex aG5skM6NW+uFoO10VUOBZxBzBCe3l8Zh6L6V6HaevYGi/HKW/pVE2VshATcI8bR3xGwj ZQ997Qf1L7IXt7nM9jrHoR1iDzw3R9GNbsPxBXtOMnPLi7/fNDto0/krZPOMjg8zczhv KelCQCkQe5yw19rY6mIDWd6LhgJZbUZAN1yaEl4edMDGSqmazDhP87LLukiHM2B1fqo3 BpQcicy/s+Ibyr/8lXeaql72DvygDlbZASWOOXDUvuD6WOnC4pZaGNURkqs/Tj12+OaU l5Cw== X-Gm-Message-State: AD7BkJJ0KF4A1G16UX/MyDXXPoAh535Q/+qliFB/xpe9rAnBYyTyO03oFNtyPNWHNFU19JLN X-Received: by 10.55.72.135 with SMTP id v129mr2835702qka.72.1456502109048; Fri, 26 Feb 2016 07:55:09 -0800 (PST) Received: from mutt-hardenedbsd (c-73-135-80-144.hsd1.md.comcast.net. [73.135.80.144]) by smtp.gmail.com with ESMTPSA id s75sm5538127qge.17.2016.02.26.07.55.07 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 26 Feb 2016 07:55:07 -0800 (PST) Date: Fri, 26 Feb 2016 10:55:05 -0500 From: Shawn Webb To: Mariusz Zaborski Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r296047 - in head: . contrib/mdocml contrib/tcpdump etc/defaults etc/mtree etc/rc.d gnu/usr.bin/groff/tmac lib lib/libc/posix1e lib/libcapsicum lib/libcasper lib/libcasper/libcasper lib... Message-ID: <20160226155505.GC6148@mutt-hardenedbsd> References: <201602251823.u1PINe3W036719@repo.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="Sr1nOIr3CvdE5hEN" Content-Disposition: inline In-Reply-To: <201602251823.u1PINe3W036719@repo.freebsd.org> X-Operating-System: FreeBSD mutt-hardenedbsd 11.0-CURRENT-HBSD FreeBSD 11.0-CURRENT-HBSD X-PGP-Key: http://pgp.mit.edu/pks/lookup?op=vindex&search=0x6A84658F52456EEE User-Agent: Mutt/1.5.24 (2015-08-30) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Feb 2016 15:55:10 -0000 --Sr1nOIr3CvdE5hEN Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Feb 25, 2016 at 06:23:40PM +0000, Mariusz Zaborski wrote: > Author: oshogbo > Date: Thu Feb 25 18:23:40 2016 > New Revision: 296047 > URL: https://svnweb.freebsd.org/changeset/base/296047 >=20 > Log: > Convert casperd(8) daemon to the libcasper. > After calling the cap_init(3) function Casper will fork from it's origi= nal > process, using pdfork(2). Forking from a process has a lot of advantage= s: > 1. We have the same cwd as the original process. > 2. The same uid, gid and groups. > 3. The same MAC labels. > 4. The same descriptor table. > 5. The same routing table. > 6. The same umask. > 7. The same cpuset(1). > From now services are also in form of libraries. > We also removed libcapsicum at all and converts existing program using = Casper > to new architecture. > =20 > Discussed with: pjd, jonathan, ed, drysdale@google.com, emaste > Partially reviewed by: drysdale@google.com, bdrewery > Approved by: pjd (mentor) > Differential Revision: https://reviews.freebsd.org/D4277 This commit breaks `cd /usr/src/release; make real-release`. Log of failed build here: http://jenkins.hardenedbsd.org:8180/jenkins/job/HardenedBSD-CURRENT-amd64/l= astFailedBuild/console Reverting this commit makes everything happy again. Thanks, --=20 Shawn Webb HardenedBSD GPG Key ID: 0x6A84658F52456EEE GPG Key Fingerprint: 2ABA B6BD EF6A F486 BE89 3D9E 6A84 658F 5245 6EEE --Sr1nOIr3CvdE5hEN Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJW0HVYAAoJEGqEZY9SRW7uz6UP/3eeHU8DjQKj9KbKl91qAlsR WXB6Zoxei3+xuaypzoUzLQPWYFdgPmgkjQqewYLS0T6duy5c7p2KACpm2DBYDQSN Z22YdGI32s2dhofq01iLug4jSUVAX/wrIyf3SLNVA8w01Q8Pb6UfYfXee518q/Dg 3K2uiajOLIEedzh1bWESVvtApiOn8d5DHF+o0FmHlpr3KbRlkxL0o2fI+B0/b7hz u9zGhs7Jtaj9ZKAOgRZ1aaoiDBrTYCS17AAZ4yFkP+b91T5VdcEfzd18e9bsdj8m QKB2/TTRV1kYDeUhUXCntoltz9EBuyMbtrMhBhEDUrS/3KGgMctx8BJRY/etJzjW Sq+wgELPfvQF6GqIv5aYkoI/LjghgsbBLyKBt0bRPYIfU0WMJ0LjqPSf7R0OmxG9 IyXNXIah+c04Eh/SbIfbbXUoNhGnQBBwVY4A7c/xWfuiOVQQrXcP7pOCdrCmMwJY fVGU6QEAGotn/FHOd9JuJ/7bDTyx4bydElHwui9GB8v0ao7FxWExM01V0oomqr2u RYP7uK9J1gzVAsTPmkZhmpnd6mUaVaOJ7kmfpHUampjw5KpPRr6v33zEep4jvWcm LoWsi/cDZAN5/tvemQIjUJ36Q5F+2g5Us/lDkejEtpWQA8cjy2YAAO41mkPk1n2Y dLWVr0Tc+fwC44PIuY9P =m9h4 -----END PGP SIGNATURE----- --Sr1nOIr3CvdE5hEN-- From owner-svn-src-head@freebsd.org Fri Feb 26 16:00:17 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F32E3AB5168; Fri, 26 Feb 2016 16:00:17 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C2F6F1844; Fri, 26 Feb 2016 16:00:17 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1QG0Git020079; Fri, 26 Feb 2016 16:00:16 GMT (envelope-from marcel@FreeBSD.org) Received: (from marcel@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1QG0GNR020078; Fri, 26 Feb 2016 16:00:16 GMT (envelope-from marcel@FreeBSD.org) Message-Id: <201602261600.u1QG0GNR020078@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: marcel set sender to marcel@FreeBSD.org using -f From: Marcel Moolenaar Date: Fri, 26 Feb 2016 16:00:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r296099 - head/sys/boot/userboot X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Feb 2016 16:00:18 -0000 Author: marcel Date: Fri Feb 26 16:00:16 2016 New Revision: 296099 URL: https://svnweb.freebsd.org/changeset/base/296099 Log: Add vm_set_register() and vm_set_desc() callbacks. These callbacks translate directly into calls to their namesake API functions in libvmmapi. It is an improvement over the existing setreg(), setmsr(), setcr() setgdt() and exec() callbacks in that the new additions give full control and don't assume we're booting FreeBSD, like exec() and don't assume one only wants to set the value of RSP, like setreg(). Modified: head/sys/boot/userboot/userboot.h Modified: head/sys/boot/userboot/userboot.h ============================================================================== --- head/sys/boot/userboot/userboot.h Fri Feb 26 15:54:34 2016 (r296098) +++ head/sys/boot/userboot/userboot.h Fri Feb 26 16:00:16 2016 (r296099) @@ -34,6 +34,14 @@ #define USERBOOT_VERSION_3 3 /* + * Version 4 added more generic callbacks for setting up + * registers and descriptors. The callback structure is + * backward compatible (new callbacks have been added at + * the tail end). + */ +#define USERBOOT_VERSION_4 4 + +/* * Exit codes from the loader */ #define USERBOOT_EXIT_QUIT 1 @@ -195,4 +203,11 @@ struct loader_callbacks { * each invocation will add 1 to the previous value of 'num'. */ const char * (*getenv)(void *arg, int num); + + /* + * Version 4 additions. + */ + int (*vm_set_register)(void *arg, int vcpu, int reg, uint64_t val); + int (*vm_set_desc)(void *arg, int vcpu, int reg, uint64_t base, + u_int limit, u_int access); }; From owner-svn-src-head@freebsd.org Fri Feb 26 16:04:50 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6F9BDAB54D4; Fri, 26 Feb 2016 16:04:50 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4F27310C; Fri, 26 Feb 2016 16:04:50 +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 u1QG4nT5023493; Fri, 26 Feb 2016 16:04:49 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1QG4lW0023475; Fri, 26 Feb 2016 16:04:47 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201602261604.u1QG4lW0023475@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Fri, 26 Feb 2016 16:04:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r296100 - in head/sys/arm: allwinner/a20 altera/socfpga amlogic/aml8726 annapurna/alpine arm broadcom/bcm2835 freescale/imx include mv mv/armada38x mv/armadaxp qemu rockchip samsung/exy... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Feb 2016 16:04:50 -0000 Author: andrew Date: Fri Feb 26 16:04:47 2016 New Revision: 296100 URL: https://svnweb.freebsd.org/changeset/base/296100 Log: Almost all copies of platform_mp_init_secondary just called intr_pic_init_secondary. Replace them with a direct call. On BCM2836 and ARMADA XP we need to add this function, but it can be empty. Reviewed by: ian, imp Sponsored by: ABT Systems Ltd Differential Revision: https://reviews.freebsd.org/D5460 Modified: head/sys/arm/allwinner/a20/a20_mp.c head/sys/arm/altera/socfpga/socfpga_mp.c head/sys/arm/amlogic/aml8726/aml8726_mp.c head/sys/arm/annapurna/alpine/alpine_machdep_mp.c head/sys/arm/arm/mp_machdep.c head/sys/arm/broadcom/bcm2835/bcm2835_intr.c head/sys/arm/broadcom/bcm2835/bcm2836_mp.c head/sys/arm/freescale/imx/imx6_mp.c head/sys/arm/include/smp.h head/sys/arm/mv/armada38x/armada38x_mp.c head/sys/arm/mv/armadaxp/armadaxp_mp.c head/sys/arm/mv/mpic.c head/sys/arm/qemu/virt_mp.c head/sys/arm/rockchip/rk30xx_mp.c head/sys/arm/samsung/exynos/exynos5_mp.c head/sys/arm/ti/omap4/omap4_mp.c head/sys/arm/xilinx/zy7_mp.c Modified: head/sys/arm/allwinner/a20/a20_mp.c ============================================================================== --- head/sys/arm/allwinner/a20/a20_mp.c Fri Feb 26 16:00:16 2016 (r296099) +++ head/sys/arm/allwinner/a20/a20_mp.c Fri Feb 26 16:04:47 2016 (r296100) @@ -59,13 +59,6 @@ __FBSDID("$FreeBSD$"); #define CPUCFG_DBGCTL1 0x1e4 void -platform_mp_init_secondary(void) -{ - - intr_pic_init_secondary(); -} - -void platform_mp_setmaxid(void) { int ncpu; Modified: head/sys/arm/altera/socfpga/socfpga_mp.c ============================================================================== --- head/sys/arm/altera/socfpga/socfpga_mp.c Fri Feb 26 16:00:16 2016 (r296099) +++ head/sys/arm/altera/socfpga/socfpga_mp.c Fri Feb 26 16:04:47 2016 (r296100) @@ -85,13 +85,6 @@ socfpga_trampoline(void) } void -platform_mp_init_secondary(void) -{ - - intr_pic_init_secondary(); -} - -void platform_mp_setmaxid(void) { int hwcpu, ncpu; Modified: head/sys/arm/amlogic/aml8726/aml8726_mp.c ============================================================================== --- head/sys/arm/amlogic/aml8726/aml8726_mp.c Fri Feb 26 16:00:16 2016 (r296099) +++ head/sys/arm/amlogic/aml8726/aml8726_mp.c Fri Feb 26 16:04:47 2016 (r296100) @@ -341,21 +341,6 @@ power_on_cpu(int cpu) } } - -void -platform_mp_init_secondary(void) -{ - - /* - * Consider modifying the timer driver to support - * per-cpu timers and then enabling the timer for - * each AP. - */ - - intr_pic_init_secondary(); -} - - void platform_mp_setmaxid(void) { Modified: head/sys/arm/annapurna/alpine/alpine_machdep_mp.c ============================================================================== --- head/sys/arm/annapurna/alpine/alpine_machdep_mp.c Fri Feb 26 16:00:16 2016 (r296099) +++ head/sys/arm/annapurna/alpine/alpine_machdep_mp.c Fri Feb 26 16:04:47 2016 (r296100) @@ -119,13 +119,6 @@ platform_mp_get_core_cnt(void) } void -platform_mp_init_secondary(void) -{ - - intr_pic_init_secondary(); -} - -void platform_mp_setmaxid(void) { Modified: head/sys/arm/arm/mp_machdep.c ============================================================================== --- head/sys/arm/arm/mp_machdep.c Fri Feb 26 16:00:16 2016 (r296099) +++ head/sys/arm/arm/mp_machdep.c Fri Feb 26 16:04:47 2016 (r296100) @@ -234,7 +234,7 @@ init_secondary(int cpu) cpu_initclocks_ap(); CTR0(KTR_SMP, "go into scheduler"); - platform_mp_init_secondary(); + intr_pic_init_secondary(); /* Enter the scheduler */ sched_throw(NULL); Modified: head/sys/arm/broadcom/bcm2835/bcm2835_intr.c ============================================================================== --- head/sys/arm/broadcom/bcm2835/bcm2835_intr.c Fri Feb 26 16:00:16 2016 (r296099) +++ head/sys/arm/broadcom/bcm2835/bcm2835_intr.c Fri Feb 26 16:04:47 2016 (r296100) @@ -240,3 +240,10 @@ arm_unmask_irq(uintptr_t nb) else printf("arm_mask_irq: Invalid IRQ number: %d\n", nb); } + +#ifdef SMP +void +intr_pic_init_secondary(void) +{ +} +#endif Modified: head/sys/arm/broadcom/bcm2835/bcm2836_mp.c ============================================================================== --- head/sys/arm/broadcom/bcm2835/bcm2836_mp.c Fri Feb 26 16:00:16 2016 (r296099) +++ head/sys/arm/broadcom/bcm2835/bcm2836_mp.c Fri Feb 26 16:04:47 2016 (r296100) @@ -77,12 +77,6 @@ static bus_space_handle_t bs_periph; bus_space_write_4(fdtbus_bs_tag, bs_periph, (addr), (val)) void -platform_mp_init_secondary(void) -{ - -} - -void platform_mp_setmaxid(void) { Modified: head/sys/arm/freescale/imx/imx6_mp.c ============================================================================== --- head/sys/arm/freescale/imx/imx6_mp.c Fri Feb 26 16:00:16 2016 (r296099) +++ head/sys/arm/freescale/imx/imx6_mp.c Fri Feb 26 16:04:47 2016 (r296100) @@ -67,13 +67,6 @@ __FBSDID("$FreeBSD$"); #define SRC_GPR1_C1ARG 0x24 /* Register for Core 1 entry arg */ void -platform_mp_init_secondary(void) -{ - - intr_pic_init_secondary(); -} - -void platform_mp_setmaxid(void) { bus_space_handle_t scu; Modified: head/sys/arm/include/smp.h ============================================================================== --- head/sys/arm/include/smp.h Fri Feb 26 16:00:16 2016 (r296099) +++ head/sys/arm/include/smp.h Fri Feb 26 16:04:47 2016 (r296100) @@ -46,7 +46,6 @@ int pic_ipi_read(int arg); /* Platform interface */ void platform_mp_setmaxid(void); void platform_mp_start_ap(void); -void platform_mp_init_secondary(void); /* global data in mp_machdep.c */ extern struct pcb stoppcbs[]; Modified: head/sys/arm/mv/armada38x/armada38x_mp.c ============================================================================== --- head/sys/arm/mv/armada38x/armada38x_mp.c Fri Feb 26 16:00:16 2016 (r296099) +++ head/sys/arm/mv/armada38x/armada38x_mp.c Fri Feb 26 16:04:47 2016 (r296100) @@ -131,13 +131,6 @@ platform_mp_setmaxid(void) } void -platform_mp_init_secondary(void) -{ - - intr_pic_init_secondary(); -} - -void platform_mp_start_ap(void) { int rv; Modified: head/sys/arm/mv/armadaxp/armadaxp_mp.c ============================================================================== --- head/sys/arm/mv/armadaxp/armadaxp_mp.c Fri Feb 26 16:00:16 2016 (r296099) +++ head/sys/arm/mv/armadaxp/armadaxp_mp.c Fri Feb 26 16:04:47 2016 (r296100) @@ -87,11 +87,6 @@ platform_mp_setmaxid(void) mp_maxid = mp_ncpus - 1; } -void -platform_mp_init_secondary(void) -{ -} - void mptramp(void); void mptramp_end(void); extern vm_offset_t mptramp_pmu_boot; Modified: head/sys/arm/mv/mpic.c ============================================================================== --- head/sys/arm/mv/mpic.c Fri Feb 26 16:00:16 2016 (r296099) +++ head/sys/arm/mv/mpic.c Fri Feb 26 16:04:47 2016 (r296100) @@ -361,6 +361,11 @@ mv_msi_data(int irq, uint64_t *addr, uin #if defined(SMP) void +intr_pic_init_secondary(void) +{ +} + +void pic_ipi_send(cpuset_t cpus, u_int ipi) { uint32_t val, i; Modified: head/sys/arm/qemu/virt_mp.c ============================================================================== --- head/sys/arm/qemu/virt_mp.c Fri Feb 26 16:00:16 2016 (r296099) +++ head/sys/arm/qemu/virt_mp.c Fri Feb 26 16:04:47 2016 (r296100) @@ -90,10 +90,3 @@ platform_mp_start_ap(void) ofw_cpu_early_foreach(virt_start_ap, true); } - -void -platform_mp_init_secondary(void) -{ - - intr_pic_init_secondary(); -} Modified: head/sys/arm/rockchip/rk30xx_mp.c ============================================================================== --- head/sys/arm/rockchip/rk30xx_mp.c Fri Feb 26 16:00:16 2016 (r296099) +++ head/sys/arm/rockchip/rk30xx_mp.c Fri Feb 26 16:04:47 2016 (r296100) @@ -80,13 +80,6 @@ rk30xx_boot2(void) } void -platform_mp_init_secondary(void) -{ - - intr_pic_init_secondary(); -} - -void platform_mp_setmaxid(void) { bus_space_handle_t scu; Modified: head/sys/arm/samsung/exynos/exynos5_mp.c ============================================================================== --- head/sys/arm/samsung/exynos/exynos5_mp.c Fri Feb 26 16:00:16 2016 (r296099) +++ head/sys/arm/samsung/exynos/exynos5_mp.c Fri Feb 26 16:04:47 2016 (r296100) @@ -71,13 +71,6 @@ exynos_get_soc_id(void) } void -platform_mp_init_secondary(void) -{ - - intr_pic_init_secondary(); -} - -void platform_mp_setmaxid(void) { Modified: head/sys/arm/ti/omap4/omap4_mp.c ============================================================================== --- head/sys/arm/ti/omap4/omap4_mp.c Fri Feb 26 16:00:16 2016 (r296099) +++ head/sys/arm/ti/omap4/omap4_mp.c Fri Feb 26 16:04:47 2016 (r296100) @@ -43,12 +43,6 @@ __FBSDID("$FreeBSD$"); #include void -platform_mp_init_secondary(void) -{ - intr_pic_init_secondary(); -} - -void platform_mp_setmaxid(void) { Modified: head/sys/arm/xilinx/zy7_mp.c ============================================================================== --- head/sys/arm/xilinx/zy7_mp.c Fri Feb 26 16:00:16 2016 (r296099) +++ head/sys/arm/xilinx/zy7_mp.c Fri Feb 26 16:04:47 2016 (r296100) @@ -47,13 +47,6 @@ __FBSDID("$FreeBSD$"); #define SCU_CONTROL_ENABLE (1 << 0) void -platform_mp_init_secondary(void) -{ - - intr_pic_init_secondary(); -} - -void platform_mp_setmaxid(void) { From owner-svn-src-head@freebsd.org Fri Feb 26 16:12:21 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 94704AB59BA; Fri, 26 Feb 2016 16:12:21 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6448CC7A; Fri, 26 Feb 2016 16:12:21 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1QGCKHI024543; Fri, 26 Feb 2016 16:12:20 GMT (envelope-from marcel@FreeBSD.org) Received: (from marcel@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1QGCKte024542; Fri, 26 Feb 2016 16:12:20 GMT (envelope-from marcel@FreeBSD.org) Message-Id: <201602261612.u1QGCKte024542@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: marcel set sender to marcel@FreeBSD.org using -f From: Marcel Moolenaar Date: Fri, 26 Feb 2016 16:12:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r296101 - head/usr.sbin/bhyveload X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Feb 2016 16:12:21 -0000 Author: marcel Date: Fri Feb 26 16:12:20 2016 New Revision: 296101 URL: https://svnweb.freebsd.org/changeset/base/296101 Log: Support version 4 of the userboot structure by implementing the vm_set_register() and vm_set_desc() callbacks. Modified: head/usr.sbin/bhyveload/bhyveload.c Modified: head/usr.sbin/bhyveload/bhyveload.c ============================================================================== --- head/usr.sbin/bhyveload/bhyveload.c Fri Feb 26 16:04:47 2016 (r296100) +++ head/usr.sbin/bhyveload/bhyveload.c Fri Feb 26 16:12:20 2016 (r296101) @@ -542,6 +542,21 @@ cb_getenv(void *arg, int num) return (NULL); } +static int +cb_vm_set_register(void *arg, int vcpu, int reg, uint64_t val) +{ + + return (vm_set_register(ctx, vcpu, reg, val)); +} + +static int +cb_vm_set_desc(void *arg, int vcpu, int reg, uint64_t base, u_int limit, + u_int access) +{ + + return (vm_set_desc(ctx, vcpu, reg, base, limit, access)); +} + static struct loader_callbacks cb = { .getc = cb_getc, .putc = cb_putc, @@ -571,6 +586,10 @@ static struct loader_callbacks cb = { .getmem = cb_getmem, .getenv = cb_getenv, + + /* Version 4 additions */ + .vm_set_register = cb_vm_set_register, + .vm_set_desc = cb_vm_set_desc, }; static int @@ -765,7 +784,7 @@ main(int argc, char** argv) addenv("smbios.bios.vendor=BHYVE"); addenv("boot_serial=1"); - func(&cb, NULL, USERBOOT_VERSION_3, ndisks); + func(&cb, NULL, USERBOOT_VERSION_4, ndisks); free(loader); return (0); From owner-svn-src-head@freebsd.org Fri Feb 26 16:15:03 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EBA50AB5B27; Fri, 26 Feb 2016 16:15:03 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A2633E5A; Fri, 26 Feb 2016 16:15:03 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1QGF2eP026626; Fri, 26 Feb 2016 16:15:02 GMT (envelope-from marcel@FreeBSD.org) Received: (from marcel@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1QGF2jb026624; Fri, 26 Feb 2016 16:15:02 GMT (envelope-from marcel@FreeBSD.org) Message-Id: <201602261615.u1QGF2jb026624@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: marcel set sender to marcel@FreeBSD.org using -f From: Marcel Moolenaar Date: Fri, 26 Feb 2016 16:15:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r296102 - head/usr.sbin/bhyveload X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Feb 2016 16:15:04 -0000 Author: marcel Date: Fri Feb 26 16:15:02 2016 New Revision: 296102 URL: https://svnweb.freebsd.org/changeset/base/296102 Log: Add option -C to have the guest memory included in core files. This aids in debugging OS loaders. Modified: head/usr.sbin/bhyveload/bhyveload.8 head/usr.sbin/bhyveload/bhyveload.c Modified: head/usr.sbin/bhyveload/bhyveload.8 ============================================================================== --- head/usr.sbin/bhyveload/bhyveload.8 Fri Feb 26 16:12:20 2016 (r296101) +++ head/usr.sbin/bhyveload/bhyveload.8 Fri Feb 26 16:15:02 2016 (r296102) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 7, 2015 +.Dd February 26, 2016 .Dt BHYVELOAD 8 .Os .Sh NAME @@ -35,6 +35,7 @@ guest inside a bhyve virtual machine .Sh SYNOPSIS .Nm +.Op Fl C .Op Fl S .Op Fl c Ar cons-dev .Op Fl d Ar disk-path @@ -125,6 +126,12 @@ respectively. The default value of .Ar mem-size is 256M. +.It Fl C +Include guest memory in the core file when +.Nm +dumps core. +This is intended for debugging an OS loader as it allows inspection of +the guest memory. .It Fl S Wire guest memory. .El Modified: head/usr.sbin/bhyveload/bhyveload.c ============================================================================== --- head/usr.sbin/bhyveload/bhyveload.c Fri Feb 26 16:12:20 2016 (r296101) +++ head/usr.sbin/bhyveload/bhyveload.c Fri Feb 26 16:15:02 2016 (r296102) @@ -674,7 +674,7 @@ main(int argc, char** argv) consin_fd = STDIN_FILENO; consout_fd = STDOUT_FILENO; - while ((opt = getopt(argc, argv, "Sc:d:e:h:l:m:")) != -1) { + while ((opt = getopt(argc, argv, "CSc:d:e:h:l:m:")) != -1) { switch (opt) { case 'c': error = altcons_open(optarg); @@ -709,6 +709,9 @@ main(int argc, char** argv) if (error != 0) errx(EX_USAGE, "Invalid memsize '%s'", optarg); break; + case 'C': + memflags |= VM_MEM_F_INCORE; + break; case 'S': memflags |= VM_MEM_F_WIRED; break; From owner-svn-src-head@freebsd.org Fri Feb 26 16:18:48 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 956C3AB5C80; Fri, 26 Feb 2016 16:18:48 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6B7201110; Fri, 26 Feb 2016 16:18:48 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1QGIluo026903; Fri, 26 Feb 2016 16:18:47 GMT (envelope-from marcel@FreeBSD.org) Received: (from marcel@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1QGIlbE026902; Fri, 26 Feb 2016 16:18:47 GMT (envelope-from marcel@FreeBSD.org) Message-Id: <201602261618.u1QGIlbE026902@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: marcel set sender to marcel@FreeBSD.org using -f From: Marcel Moolenaar Date: Fri, 26 Feb 2016 16:18:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r296103 - head/sys/amd64/vmm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Feb 2016 16:18:48 -0000 Author: marcel Date: Fri Feb 26 16:18:47 2016 New Revision: 296103 URL: https://svnweb.freebsd.org/changeset/base/296103 Log: Bump VM_MAX_MEMSEGS from 2 to 3 to match the number of VM segment identifiers present in vmmapi.h. In particular, it's now possible to create a VM_FRAMEBUFFER segment. Modified: head/sys/amd64/vmm/vmm.c Modified: head/sys/amd64/vmm/vmm.c ============================================================================== --- head/sys/amd64/vmm/vmm.c Fri Feb 26 16:15:02 2016 (r296102) +++ head/sys/amd64/vmm/vmm.c Fri Feb 26 16:18:47 2016 (r296103) @@ -121,7 +121,7 @@ struct mem_seg { bool sysmem; struct vm_object *object; }; -#define VM_MAX_MEMSEGS 2 +#define VM_MAX_MEMSEGS 3 struct mem_map { vm_paddr_t gpa; From owner-svn-src-head@freebsd.org Fri Feb 26 18:52:07 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 858B2AB4D1B; Fri, 26 Feb 2016 18:52:07 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 531B17D4; Fri, 26 Feb 2016 18:52:07 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1QIq6Ak073976; Fri, 26 Feb 2016 18:52:06 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1QIq6vf073975; Fri, 26 Feb 2016 18:52:06 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201602261852.u1QIq6vf073975@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Fri, 26 Feb 2016 18:52:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r296104 - head/libexec/getty X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Feb 2016 18:52:07 -0000 Author: pfg Date: Fri Feb 26 18:52:06 2016 New Revision: 296104 URL: https://svnweb.freebsd.org/changeset/base/296104 Log: getty(8): Use poll(2) and nanosleep(2) instead of select(2). Sort headers while here. Obtained from: NetBSD (CVS Rev. 1.25 - 1.26) Modified: head/libexec/getty/subr.c Modified: head/libexec/getty/subr.c ============================================================================== --- head/libexec/getty/subr.c Fri Feb 26 16:18:47 2016 (r296103) +++ head/libexec/getty/subr.c Fri Feb 26 18:52:06 2016 (r296104) @@ -38,14 +38,16 @@ static const char rcsid[] = /* * Melbourne getty. */ -#include -#include -#include -#include #include #include #include + +#include +#include +#include #include +#include +#include #include "gettytab.h" #include "pathnames.h" @@ -633,24 +635,21 @@ portselector(void) const char * autobaud(void) { - int rfds; - struct timeval timeout; +struct pollfd set[1]; + struct timespec timeout; char c; const char *type = "9600-baud"; (void)tcflush(0, TCIOFLUSH); - rfds = 1 << 0; - timeout.tv_sec = 5; - timeout.tv_usec = 0; - if (select(32, (fd_set *)&rfds, (fd_set *)NULL, - (fd_set *)NULL, &timeout) <= 0) + set[0].fd = STDIN_FILENO; + set[0].events = POLLIN; + if (poll(set, 1, 5000) <= 0) return (type); if (read(STDIN_FILENO, &c, sizeof(char)) != sizeof(char)) return (type); timeout.tv_sec = 0; - timeout.tv_usec = 20; - (void) select(32, (fd_set *)NULL, (fd_set *)NULL, - (fd_set *)NULL, &timeout); + timeout.tv_nsec = 20000; + (void)nanosleep(&timeout, NULL); (void)tcflush(0, TCIOFLUSH); switch (c & 0377) { From owner-svn-src-head@freebsd.org Fri Feb 26 18:54:28 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1A784AB4DEB; Fri, 26 Feb 2016 18:54:28 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CFFD99A8; Fri, 26 Feb 2016 18:54:27 +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 u1QIsQuf074095; Fri, 26 Feb 2016 18:54:26 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1QIsQrk074094; Fri, 26 Feb 2016 18:54:26 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201602261854.u1QIsQrk074094@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Fri, 26 Feb 2016 18:54:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r296105 - head/sys/arm/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Feb 2016 18:54:28 -0000 Author: andrew Date: Fri Feb 26 18:54:26 2016 New Revision: 296105 URL: https://svnweb.freebsd.org/changeset/base/296105 Log: Make the CUBIEBOARD config include the A10 config with a few needed additions. This is used by the release scripts so we need to keep it around for now. Sponsored by: ABT Systems Ltd Modified: head/sys/arm/conf/CUBIEBOARD Modified: head/sys/arm/conf/CUBIEBOARD ============================================================================== --- head/sys/arm/conf/CUBIEBOARD Fri Feb 26 18:52:06 2016 (r296104) +++ head/sys/arm/conf/CUBIEBOARD Fri Feb 26 18:54:26 2016 (r296105) @@ -19,97 +19,15 @@ # # $FreeBSD$ -ident CUBIEBOARD - -include "std.armv6" -include "../allwinner/std.a10" - -options SOC_ALLWINNER_A10 - -options HZ=100 -options SCHED_4BSD # 4BSD scheduler -options PLATFORM - -# Debugging for use in -current -makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols -options ALT_BREAK_TO_DEBUGGER -#options VERBOSE_SYSINIT # Enable verbose sysinit messages -options KDB # Enable kernel debugger support -# For minimum debugger support (stable branch) use: -#options KDB_TRACE # Print a stack trace for a panic -# For full debugger support use this instead: -options DDB # Enable the kernel debugger -options INVARIANTS # Enable calls of extra sanity checking -options INVARIANT_SUPPORT # Extra sanity checks of internal structures, required by INVARIANTS -options WITNESS # Enable checks to detect deadlocks and cycles -options WITNESS_SKIPSPIN # Don't run witness on spinlocks for speed -#options DIAGNOSTIC +#NO_UNIVERSE -# NFS root from boopt/dhcp -#options BOOTP -#options BOOTP_NFSROOT -#options BOOTP_COMPAT -#options BOOTP_NFSV3 -#options BOOTP_WIRED_TO=cpsw0 +include "A10" +ident CUBIEBOARD # Boot device is 2nd slice on MMC/SD card options ROOTDEVNAME=\"ufs:/dev/da0s2\" -# MMC/SD/SDIO Card slot support -device mmc # mmc/sd bus -device mmcsd # mmc/sd flash cards - -# ATA controllers -device ahci # AHCI-compatible SATA controllers -#device ata # Legacy ATA/SATA controllers - -# Console and misc -device uart -device uart_ns8250 -device pty -device snp -device md -device random # Entropy device - -# I2C support -#device iicbus -#device iic - -# GPIO -device gpio - -device scbus # SCSI bus (required for ATA/SCSI) -device da # Direct Access (disks) -device pass # Passthrough device (direct ATA/SCSI access) - -# USB support -options USB_HOST_ALIGN=64 # Align usb buffers to cache line size. -device usb -options USB_DEBUG -#options USB_REQ_DEBUG -#options USB_VERBOSE -#device uhci -#device ohci -device ehci - -device umass - -# Ethernet -device loop -device ether -device mii -device bpf - -device emac - -# USB ethernet support, requires miibus -device miibus - -# Pinmux -device fdt_pinctrl - # Flattened Device Tree -options FDT # Configure using FDT/DTB data +options FDT options FDT_DTB_STATIC makeoptions FDT_DTS_FILE=cubieboard.dts -makeoptions MODULES_EXTRA=dtb/allwinner From owner-svn-src-head@freebsd.org Fri Feb 26 19:08:38 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E1530AB5319; Fri, 26 Feb 2016 19:08:38 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B4016F68; Fri, 26 Feb 2016 19:08:38 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1QJ8b8e076957; Fri, 26 Feb 2016 19:08:37 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1QJ8bRw076956; Fri, 26 Feb 2016 19:08:37 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201602261908.u1QJ8bRw076956@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Fri, 26 Feb 2016 19:08:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r296106 - head/libexec/getty X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Feb 2016 19:08:39 -0000 Author: pfg Date: Fri Feb 26 19:08:37 2016 New Revision: 296106 URL: https://svnweb.freebsd.org/changeset/base/296106 Log: getty(8): Support VEOL2 and VSTATUS Bring some type cleanups while here. Obtained from: NetBSD Modified: head/libexec/getty/subr.c Modified: head/libexec/getty/subr.c ============================================================================== --- head/libexec/getty/subr.c Fri Feb 26 18:54:26 2016 (r296105) +++ head/libexec/getty/subr.c Fri Feb 26 19:08:37 2016 (r296106) @@ -73,7 +73,7 @@ gettable(const char *name, char *buf) static int firsttime = 1; dba[0] = _PATH_GETTYTAB; - dba[1] = 0; + dba[1] = NULL; if (firsttime) { /* @@ -212,7 +212,8 @@ charvars[] = { &tmode.c_cc[VQUIT], &tmode.c_cc[VSTART], &tmode.c_cc[VSTOP], &tmode.c_cc[VEOF], &tmode.c_cc[VEOL], &tmode.c_cc[VSUSP], &tmode.c_cc[VDSUSP], &tmode.c_cc[VREPRINT], &tmode.c_cc[VDISCARD], - &tmode.c_cc[VWERASE], &tmode.c_cc[VLNEXT], 0 + &tmode.c_cc[VWERASE], &tmode.c_cc[VLNEXT], &tmode.c_cc[VSTATUS], + &tmode.c_cc[VEOL2], 0 }; void @@ -595,7 +596,7 @@ struct portselect { { "B4800", "std.4800" }, { "B9600", "std.9600" }, { "B19200", "std.19200" }, - { 0 } + { NULL, NULL } }; const char * @@ -604,7 +605,7 @@ portselector(void) char c, baud[20]; const char *type = "default"; struct portselect *ps; - int len; + size_t len; alarm(5*60); for (len = 0; len < sizeof (baud) - 1; len++) { From owner-svn-src-head@freebsd.org Fri Feb 26 19:35:52 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DF254AB5EE2; Fri, 26 Feb 2016 19:35:52 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AC5C1108; Fri, 26 Feb 2016 19:35:52 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1QJZpVE086070; Fri, 26 Feb 2016 19:35:51 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1QJZp6K086069; Fri, 26 Feb 2016 19:35:51 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201602261935.u1QJZp6K086069@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Fri, 26 Feb 2016 19:35:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r296107 - head/libexec/getty X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Feb 2016 19:35:53 -0000 Author: pfg Date: Fri Feb 26 19:35:51 2016 New Revision: 296107 URL: https://svnweb.freebsd.org/changeset/base/296107 Log: getty(8): Undo incomplete support VEOL2 and VSTATUS. Forgot to add some definitions for charnames[]. Modified: head/libexec/getty/subr.c Modified: head/libexec/getty/subr.c ============================================================================== --- head/libexec/getty/subr.c Fri Feb 26 19:08:37 2016 (r296106) +++ head/libexec/getty/subr.c Fri Feb 26 19:35:51 2016 (r296107) @@ -212,8 +212,7 @@ charvars[] = { &tmode.c_cc[VQUIT], &tmode.c_cc[VSTART], &tmode.c_cc[VSTOP], &tmode.c_cc[VEOF], &tmode.c_cc[VEOL], &tmode.c_cc[VSUSP], &tmode.c_cc[VDSUSP], &tmode.c_cc[VREPRINT], &tmode.c_cc[VDISCARD], - &tmode.c_cc[VWERASE], &tmode.c_cc[VLNEXT], &tmode.c_cc[VSTATUS], - &tmode.c_cc[VEOL2], 0 + &tmode.c_cc[VWERASE], &tmode.c_cc[VLNEXT], 0 }; void From owner-svn-src-head@freebsd.org Fri Feb 26 19:49:05 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6C8EEAB6393; Fri, 26 Feb 2016 19:49:05 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3F1A4A7F; Fri, 26 Feb 2016 19:49:05 +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 u1QJn4of089333; Fri, 26 Feb 2016 19:49:04 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1QJn42M089332; Fri, 26 Feb 2016 19:49:04 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201602261949.u1QJn42M089332@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 26 Feb 2016 19:49:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r296108 - head/etc/mtree X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Feb 2016 19:49:05 -0000 Author: emaste Date: Fri Feb 26 19:49:04 2016 New Revision: 296108 URL: https://svnweb.freebsd.org/changeset/base/296108 Log: Add debug /libexec directory for rtld-elf debug files Modified: head/etc/mtree/BSD.debug.dist Modified: head/etc/mtree/BSD.debug.dist ============================================================================== --- head/etc/mtree/BSD.debug.dist Fri Feb 26 19:35:51 2016 (r296107) +++ head/etc/mtree/BSD.debug.dist Fri Feb 26 19:49:04 2016 (r296108) @@ -18,6 +18,8 @@ casper .. .. + libexec + .. sbin .. usr From owner-svn-src-head@freebsd.org Fri Feb 26 20:02:03 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 29100AB6808; Fri, 26 Feb 2016 20:02:03 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0404511AF; Fri, 26 Feb 2016 20:02:02 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1QK22ve094839; Fri, 26 Feb 2016 20:02:02 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1QK2298094838; Fri, 26 Feb 2016 20:02:02 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201602262002.u1QK2298094838@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Fri, 26 Feb 2016 20:02:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r296109 - head/libexec/rlogind X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Feb 2016 20:02:03 -0000 Author: pfg Date: Fri Feb 26 20:02:01 2016 New Revision: 296109 URL: https://svnweb.freebsd.org/changeset/base/296109 Log: rlogin(1): Replace select(2) with poll(2). Obtanied from: NetBSD (CVS Rev. 1.27 - 1.28) Modified: head/libexec/rlogind/rlogind.c Modified: head/libexec/rlogind/rlogind.c ============================================================================== --- head/libexec/rlogind/rlogind.c Fri Feb 26 19:49:04 2016 (r296108) +++ head/libexec/rlogind/rlogind.c Fri Feb 26 20:02:01 2016 (r296109) @@ -76,6 +76,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -350,34 +351,27 @@ protocol(int f, int p) nfd = f + 1; else nfd = p + 1; - if (nfd > FD_SETSIZE) { - syslog(LOG_ERR, "select mask too small, increase FD_SETSIZE"); - fatal(f, "internal error (select mask too small)", 0); - } for (;;) { - fd_set ibits, obits, ebits, *omask; + struct pollfd set[2]; - FD_ZERO(&ebits); - FD_ZERO(&ibits); - FD_ZERO(&obits); - omask = (fd_set *)NULL; - if (fcc) { - FD_SET(p, &obits); - omask = &obits; - } else - FD_SET(f, &ibits); + set[0].fd = p; + set[0].events = POLLPRI; + set[1].fd = f; + set[1].events = 0; + if (fcc) + set[0].events |= POLLOUT; + else + set[1].events |= POLLIN; if (pcc >= 0) { - if (pcc) { - FD_SET(f, &obits); - omask = &obits; - } else - FD_SET(p, &ibits); + if (pcc) + set[1].events |= POLLOUT; + else + set[0].events |= POLLIN; } - FD_SET(p, &ebits); - if ((n = select(nfd, &ibits, omask, &ebits, 0)) < 0) { + if ((n = poll(set, 2, INFTIM)) < 0) { if (errno == EINTR) continue; - fatal(f, "select", 1); + fatal(f, "poll", 1); } if (n == 0) { /* shouldn't happen... */ @@ -385,18 +379,16 @@ protocol(int f, int p) continue; } #define pkcontrol(c) ((c)&(TIOCPKT_FLUSHWRITE|TIOCPKT_NOSTOP|TIOCPKT_DOSTOP)) - if (FD_ISSET(p, &ebits)) { + if (set[0].revents & POLLPRI) { cc = read(p, &cntl, 1); if (cc == 1 && pkcontrol(cntl)) { cntl |= oobdata[0]; send(f, &cntl, 1, MSG_OOB); - if (cntl & TIOCPKT_FLUSHWRITE) { + if (cntl & TIOCPKT_FLUSHWRITE) pcc = 0; - FD_CLR(p, &ibits); - } } } - if (FD_ISSET(f, &ibits)) { + if (set[1].revents & POLLIN) { fcc = read(f, fibuf, sizeof(fibuf)); if (fcc < 0 && errno == EWOULDBLOCK) fcc = 0; @@ -422,11 +414,10 @@ protocol(int f, int p) goto top; /* n^2 */ } } - FD_SET(p, &obits); /* try write */ } } - if (FD_ISSET(p, &obits) && fcc > 0) { + if (set[0].revents & POLLOUT && fcc > 0) { cc = write(p, fbp, fcc); if (cc > 0) { fcc -= cc; @@ -434,7 +425,7 @@ protocol(int f, int p) } } - if (FD_ISSET(p, &ibits)) { + if (set[0].revents & POLLIN) { pcc = read(p, pibuf, sizeof (pibuf)); pbp = pibuf; if (pcc < 0 && errno == EWOULDBLOCK) @@ -443,7 +434,6 @@ protocol(int f, int p) break; else if (pibuf[0] == 0) { pbp++, pcc--; - FD_SET(f, &obits); /* try write */ } else { if (pkcontrol(pibuf[0])) { pibuf[0] |= oobdata[0]; @@ -452,18 +442,8 @@ protocol(int f, int p) pcc = 0; } } - if ((FD_ISSET(f, &obits)) && pcc > 0) { + if (set[1].revents & POLLOUT && pcc > 0) { cc = write(f, pbp, pcc); - if (cc < 0 && errno == EWOULDBLOCK) { - /* - * This happens when we try write after read - * from p, but some old kernels balk at large - * writes even when select returns true. - */ - if (!FD_ISSET(p, &ibits)) - sleep(5); - continue; - } if (cc > 0) { pcc -= cc; pbp += cc; From owner-svn-src-head@freebsd.org Fri Feb 26 20:25:28 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 36A25AB6D78; Fri, 26 Feb 2016 20:25:28 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0A7121D89; Fri, 26 Feb 2016 20:25:27 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1QKPRAU000956; Fri, 26 Feb 2016 20:25:27 GMT (envelope-from nwhitehorn@FreeBSD.org) Received: (from nwhitehorn@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1QKPRvh000954; Fri, 26 Feb 2016 20:25:27 GMT (envelope-from nwhitehorn@FreeBSD.org) Message-Id: <201602262025.u1QKPRvh000954@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: nwhitehorn set sender to nwhitehorn@FreeBSD.org using -f From: Nathan Whitehorn Date: Fri, 26 Feb 2016 20:25:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r296111 - head/lib/msun/powerpc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Feb 2016 20:25:28 -0000 Author: nwhitehorn Date: Fri Feb 26 20:25:26 2016 New Revision: 296111 URL: https://svnweb.freebsd.org/changeset/base/296111 Log: Make FPSCR definition endian clean. PR: 207526 Submitted by: Simon Byrne Obtained from: Julia MFC after: 1 month Modified: head/lib/msun/powerpc/fenv.h Modified: head/lib/msun/powerpc/fenv.h ============================================================================== --- head/lib/msun/powerpc/fenv.h Fri Feb 26 20:19:44 2016 (r296110) +++ head/lib/msun/powerpc/fenv.h Fri Feb 26 20:25:26 2016 (r296111) @@ -97,8 +97,13 @@ extern const fenv_t __fe_dfl_env; union __fpscr { double __d; struct { +#if _BYTE_ORDER == _LITTLE_ENDIAN + fenv_t __reg; + __uint32_t __junk; +#else __uint32_t __junk; fenv_t __reg; +#endif } __bits; }; From owner-svn-src-head@freebsd.org Fri Feb 26 20:33:33 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9DC17AB41AC; Fri, 26 Feb 2016 20:33:33 +0000 (UTC) (envelope-from jmcneill@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6CC2C642; Fri, 26 Feb 2016 20:33:33 +0000 (UTC) (envelope-from jmcneill@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1QKXWsH003683; Fri, 26 Feb 2016 20:33:32 GMT (envelope-from jmcneill@FreeBSD.org) Received: (from jmcneill@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1QKXWaM003682; Fri, 26 Feb 2016 20:33:32 GMT (envelope-from jmcneill@FreeBSD.org) Message-Id: <201602262033.u1QKXWaM003682@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jmcneill set sender to jmcneill@FreeBSD.org using -f From: Jared McNeill Date: Fri, 26 Feb 2016 20:33:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r296112 - head/sys/arm/allwinner/a31 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Feb 2016 20:33:33 -0000 Author: jmcneill Date: Fri Feb 26 20:33:32 2016 New Revision: 296112 URL: https://svnweb.freebsd.org/changeset/base/296112 Log: Fix inverted test for lock status while waiting for PLL to become stable. Reviewed by: andrew Approved by: adrian (mentor) Modified: head/sys/arm/allwinner/a31/a31_clk.c Modified: head/sys/arm/allwinner/a31/a31_clk.c ============================================================================== --- head/sys/arm/allwinner/a31/a31_clk.c Fri Feb 26 20:25:26 2016 (r296111) +++ head/sys/arm/allwinner/a31/a31_clk.c Fri Feb 26 20:33:32 2016 (r296112) @@ -129,8 +129,8 @@ a31_clk_pll6_enable(void) /* Wait for PLL to be stable */ for (i = 0; i < PLL6_TIMEOUT; i++) - if (!(ccm_read_4(sc, A31_CCM_PLL6_CFG) & - A31_CCM_PLL6_CFG_REG_LOCK)) + if ((ccm_read_4(sc, A31_CCM_PLL6_CFG) & + A31_CCM_PLL6_CFG_REG_LOCK) == A31_CCM_PLL6_CFG_REG_LOCK) break; if (i == PLL6_TIMEOUT) return (ENXIO); From owner-svn-src-head@freebsd.org Fri Feb 26 20:38:25 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9B9E1AB43A4; Fri, 26 Feb 2016 20:38:25 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 736E48F0; Fri, 26 Feb 2016 20:38:25 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1QKcOWA003897; Fri, 26 Feb 2016 20:38:24 GMT (envelope-from nwhitehorn@FreeBSD.org) Received: (from nwhitehorn@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1QKcOjl003893; Fri, 26 Feb 2016 20:38:24 GMT (envelope-from nwhitehorn@FreeBSD.org) Message-Id: <201602262038.u1QKcOjl003893@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: nwhitehorn set sender to nwhitehorn@FreeBSD.org using -f From: Nathan Whitehorn Date: Fri, 26 Feb 2016 20:38:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r296113 - in head/lib/libc: powerpc powerpc/gen powerpc64 powerpc64/gen X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Feb 2016 20:38:25 -0000 Author: nwhitehorn Date: Fri Feb 26 20:38:23 2016 New Revision: 296113 URL: https://svnweb.freebsd.org/changeset/base/296113 Log: Make unions in PowerPC libc endian-safe. Modified: head/lib/libc/powerpc/_fpmath.h head/lib/libc/powerpc/gen/infinity.c head/lib/libc/powerpc64/_fpmath.h head/lib/libc/powerpc64/gen/infinity.c Modified: head/lib/libc/powerpc/_fpmath.h ============================================================================== --- head/lib/libc/powerpc/_fpmath.h Fri Feb 26 20:33:32 2016 (r296112) +++ head/lib/libc/powerpc/_fpmath.h Fri Feb 26 20:38:23 2016 (r296113) @@ -29,10 +29,17 @@ union IEEEl2bits { long double e; struct { +#if _BYTE_ORDER == _LITTLE_ENDIAN + unsigned int manl :32; + unsigned int manh :20; + unsigned int exp :11; + unsigned int sign :1; +#else /* _BYTE_ORDER == _LITTLE_ENDIAN */ unsigned int sign :1; unsigned int exp :11; unsigned int manh :20; unsigned int manl :32; +#endif } bits; }; Modified: head/lib/libc/powerpc/gen/infinity.c ============================================================================== --- head/lib/libc/powerpc/gen/infinity.c Fri Feb 26 20:33:32 2016 (r296112) +++ head/lib/libc/powerpc/gen/infinity.c Fri Feb 26 20:38:23 2016 (r296113) @@ -11,7 +11,20 @@ __FBSDID("$FreeBSD$"); #include /* bytes for +Infinity on powerpc */ -const union __infinity_un __infinity = { { 0x7f, 0xf0, 0, 0, 0, 0, 0, 0 } }; +const union __infinity_un __infinity = { +#if BYTE_ORDER == BIG_ENDIAN + { 0x7f, 0xf0, 0, 0, 0, 0, 0, 0 } +#else + { 0, 0, 0, 0, 0, 0, 0xf0, 0x7f } +#endif +}; /* bytes for NaN */ -const union __nan_un __nan = { { 0xff, 0xc0, 0, 0 } }; +const union __nan_un __nan = { +#if BYTE_ORDER == BIG_ENDIAN + {0xff, 0xc0, 0, 0} +#else + { 0, 0, 0xc0, 0xff } +#endif +}; + Modified: head/lib/libc/powerpc64/_fpmath.h ============================================================================== --- head/lib/libc/powerpc64/_fpmath.h Fri Feb 26 20:33:32 2016 (r296112) +++ head/lib/libc/powerpc64/_fpmath.h Fri Feb 26 20:38:23 2016 (r296113) @@ -29,10 +29,17 @@ union IEEEl2bits { long double e; struct { +#if _BYTE_ORDER == _LITTLE_ENDIAN + unsigned int manl :32; + unsigned int manh :20; + unsigned int exp :11; + unsigned int sign :1; +#else /* _BYTE_ORDER == _LITTLE_ENDIAN */ unsigned int sign :1; unsigned int exp :11; unsigned int manh :20; unsigned int manl :32; +#endif } bits; }; Modified: head/lib/libc/powerpc64/gen/infinity.c ============================================================================== --- head/lib/libc/powerpc64/gen/infinity.c Fri Feb 26 20:33:32 2016 (r296112) +++ head/lib/libc/powerpc64/gen/infinity.c Fri Feb 26 20:38:23 2016 (r296113) @@ -11,7 +11,20 @@ __FBSDID("$FreeBSD$"); #include /* bytes for +Infinity on powerpc */ -const union __infinity_un __infinity = { { 0x7f, 0xf0, 0, 0, 0, 0, 0, 0 } }; +const union __infinity_un __infinity = { +#if BYTE_ORDER == BIG_ENDIAN + { 0x7f, 0xf0, 0, 0, 0, 0, 0, 0 } +#else + { 0, 0, 0, 0, 0, 0, 0xf0, 0x7f } +#endif +}; /* bytes for NaN */ -const union __nan_un __nan = { { 0xff, 0xc0, 0, 0 } }; +const union __nan_un __nan = { +#if BYTE_ORDER == BIG_ENDIAN + {0xff, 0xc0, 0, 0} +#else + { 0, 0, 0xc0, 0xff } +#endif +}; + From owner-svn-src-head@freebsd.org Fri Feb 26 20:47:10 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4B4A2AB48A1; Fri, 26 Feb 2016 20:47:10 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 193D4DC9; Fri, 26 Feb 2016 20:47:10 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1QKl9mx006796; Fri, 26 Feb 2016 20:47:09 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1QKl9KJ006795; Fri, 26 Feb 2016 20:47:09 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201602262047.u1QKl9KJ006795@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Fri, 26 Feb 2016 20:47:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r296114 - head/sys/net80211 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Feb 2016 20:47:10 -0000 Author: avos Date: Fri Feb 26 20:47:08 2016 New Revision: 296114 URL: https://svnweb.freebsd.org/changeset/base/296114 Log: net80211: fix 'uma_zalloc_arg: zone "32" with non-sleepable locks held' when 'sysctl net.wlan.devices' is executed. PR: 207497 Submitted by: glebius Approved by: adrian (mentor) Modified: head/sys/net80211/ieee80211.c Modified: head/sys/net80211/ieee80211.c ============================================================================== --- head/sys/net80211/ieee80211.c Fri Feb 26 20:38:23 2016 (r296113) +++ head/sys/net80211/ieee80211.c Fri Feb 26 20:47:08 2016 (r296114) @@ -266,21 +266,24 @@ static int sysctl_ieee80211coms(SYSCTL_HANDLER_ARGS) { struct ieee80211com *ic; - struct sbuf *sb; + struct sbuf sb; char *sp; int error; - sb = sbuf_new_auto(); + error = sysctl_wire_old_buffer(req, 0); + if (error) + return (error); + sbuf_new_for_sysctl(&sb, NULL, 8, req); + sbuf_clear_flags(&sb, SBUF_INCLUDENUL); sp = ""; mtx_lock(&ic_list_mtx); LIST_FOREACH(ic, &ic_head, ic_next) { - sbuf_printf(sb, "%s%s", sp, ic->ic_name); + sbuf_printf(&sb, "%s%s", sp, ic->ic_name); sp = " "; } mtx_unlock(&ic_list_mtx); - sbuf_finish(sb); - error = SYSCTL_OUT(req, sbuf_data(sb), sbuf_len(sb) + 1); - sbuf_delete(sb); + error = sbuf_finish(&sb); + sbuf_delete(&sb); return (error); } From owner-svn-src-head@freebsd.org Fri Feb 26 22:13:33 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4B1FBAB6AE2; Fri, 26 Feb 2016 22:13:33 +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 mx1.freebsd.org (Postfix) with ESMTPS id 278F796; Fri, 26 Feb 2016 22:13:33 +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 u1QMDWCA033089; Fri, 26 Feb 2016 22:13:32 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1QMDVjX033086; Fri, 26 Feb 2016 22:13:31 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201602262213.u1QMDVjX033086@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Fri, 26 Feb 2016 22:13:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r296116 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Feb 2016 22:13:33 -0000 Author: bdrewery Date: Fri Feb 26 22:13:31 2016 New Revision: 296116 URL: https://svnweb.freebsd.org/changeset/base/296116 Log: Remove _manpages and _maninstall targets as they are no longer needed. r96164 added them to avoid recursing twice with _SUBDIR. That issue was fixed in bsd.subdir.mk in r291635 for all targets. Sponsored by: EMC / Isilon Storage Division Modified: head/share/mk/bsd.lib.mk head/share/mk/bsd.man.mk head/share/mk/bsd.prog.mk Modified: head/share/mk/bsd.lib.mk ============================================================================== --- head/share/mk/bsd.lib.mk Fri Feb 26 22:03:41 2016 (r296115) +++ head/share/mk/bsd.lib.mk Fri Feb 26 22:13:31 2016 (r296116) @@ -299,7 +299,7 @@ CLEANFILES+= ${_LIBS} .endif .if ${MK_MAN} != "no" && !defined(LIBRARIES_ONLY) -all: _manpages +all: all-man .endif .endif @@ -400,8 +400,8 @@ _libinstall: .include .if ${MK_MAN} != "no" && !defined(LIBRARIES_ONLY) -realinstall: _maninstall -.ORDER: beforeinstall _maninstall +realinstall: maninstall +.ORDER: beforeinstall maninstall .endif .endif Modified: head/share/mk/bsd.man.mk ============================================================================== --- head/share/mk/bsd.man.mk Fri Feb 26 22:03:41 2016 (r296115) +++ head/share/mk/bsd.man.mk Fri Feb 26 22:13:31 2016 (r296116) @@ -71,8 +71,7 @@ MAN+= ${MAN${__sect}} .endfor .endif -_manpages: -all-man: _manpages +all-man: .if ${MK_MANCOMPRESS} == "no" @@ -92,13 +91,13 @@ CLEANFILES+= ${MAN:T:S/$/${FILTEXTENSION CLEANFILES+= ${MAN:T:S/$/${CATEXT}${FILTEXTENSION}/g} .for __page in ${MAN} .for __target in ${__page:T:S/$/${FILTEXTENSION}/g} -_manpages: ${__target} +all-man: ${__target} ${__target}: ${__page} ${MANFILTER} < ${.ALLSRC} > ${.TARGET} .endfor .if defined(MANBUILDCAT) && !empty(MANBUILDCAT) .for __target in ${__page:T:S/$/${CATEXT}${FILTEXTENSION}/g} -_manpages: ${__target} +all-man: ${__target} ${__target}: ${__page} ${MANFILTER} < ${.ALLSRC} | ${MANDOC_CMD} > ${.TARGET} .endfor @@ -111,13 +110,13 @@ CLEANFILES+= ${MAN:T:S/$/${CATEXT}/g} .if defined(MANBUILDCAT) && !empty(MANBUILDCAT) .for __page in ${MAN} .for __target in ${__page:T:S/$/${CATEXT}/g} -_manpages: ${__target} +all-man: ${__target} ${__target}: ${__page} ${MANDOC_CMD} ${.ALLSRC} > ${.TARGET} .endfor .endfor .else -_manpages: ${MAN} +all-man: ${MAN} .endif .endif .endif # defined(MANFILTER) @@ -147,7 +146,7 @@ CLEANFILES+= ${MAN:T:S/$/${MCOMPRESS_EXT CLEANFILES+= ${MAN:T:S/$/${CATEXT}${MCOMPRESS_EXT}/g} .for __page in ${MAN} .for __target in ${__page:T:S/$/${MCOMPRESS_EXT}/} -_manpages: ${__target} +all-man: ${__target} ${__target}: ${__page} .if defined(MANFILTER) ${MANFILTER} < ${.ALLSRC} | ${MCOMPRESS_CMD} > ${.TARGET} @@ -157,7 +156,7 @@ ${__target}: ${__page} .endfor .if defined(MANBUILDCAT) && !empty(MANBUILDCAT) .for __target in ${__page:T:S/$/${CATEXT}${MCOMPRESS_EXT}/} -_manpages: ${__target} +all-man: ${__target} ${__target}: ${__page} .if defined(MANFILTER) ${MANFILTER} < ${.ALLSRC} | ${MANDOC_CMD} | ${MCOMPRESS_CMD} > ${.TARGET} @@ -182,10 +181,9 @@ _MANLINKS+= ${CATDIR}${_osect}${MANSUBDI .endfor .endif -maninstall: _maninstall -_maninstall: +maninstall: .if defined(MAN) && !empty(MAN) -_maninstall: ${MAN} +maninstall: ${MAN} .if ${MK_MANCOMPRESS} == "no" .if defined(MANFILTER) .for __page in ${MAN} Modified: head/share/mk/bsd.prog.mk ============================================================================== --- head/share/mk/bsd.prog.mk Fri Feb 26 22:03:41 2016 (r296115) +++ head/share/mk/bsd.prog.mk Fri Feb 26 22:13:31 2016 (r296116) @@ -150,7 +150,7 @@ all: .else all: ${PROG} ${SCRIPTS} .if ${MK_MAN} != "no" -all: _manpages +all: all-man .endif .endif @@ -258,8 +258,8 @@ NLSNAME?= ${PROG} .include .if ${MK_MAN} != "no" -realinstall: _maninstall -.ORDER: beforeinstall _maninstall +realinstall: maninstall +.ORDER: beforeinstall maninstall .endif .endif # !target(install) From owner-svn-src-head@freebsd.org Fri Feb 26 22:13:37 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 18649AB6AF8; Fri, 26 Feb 2016 22:13:37 +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 mx1.freebsd.org (Postfix) with ESMTPS id C59639A; Fri, 26 Feb 2016 22:13:36 +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 u1QMDZ7E033138; Fri, 26 Feb 2016 22:13:35 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1QMDZix033136; Fri, 26 Feb 2016 22:13:35 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201602262213.u1QMDZix033136@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Fri, 26 Feb 2016 22:13:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r296117 - in head: share/mk sys/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Feb 2016 22:13:37 -0000 Author: bdrewery Date: Fri Feb 26 22:13:35 2016 New Revision: 296117 URL: https://svnweb.freebsd.org/changeset/base/296117 Log: Remove more references to targets we've never had. Sponsored by: EMC / Isilon Storage Division Modified: head/share/mk/bsd.sys.mk head/sys/conf/kern.mk Modified: head/share/mk/bsd.sys.mk ============================================================================== --- head/share/mk/bsd.sys.mk Fri Feb 26 22:13:31 2016 (r296116) +++ head/share/mk/bsd.sys.mk Fri Feb 26 22:13:35 2016 (r296117) @@ -179,11 +179,10 @@ CXXFLAGS+= ${CXXFLAGS.${COMPILER_TYPE}} PHONY_NOTMAIN = afterdepend afterinstall all beforedepend beforeinstall \ beforelinking build build-tools buildconfig buildfiles \ buildincludes check checkdpadd clean cleandepend cleandir \ - cleanobj configure depend dependall distclean distribute exe \ + cleanobj configure depend distclean distribute exe \ files html includes install installconfig installfiles \ - installincludes lint obj objlink objs objwarn realall \ - realdepend realinstall subdir-all subdir-depend \ - subdir-install tags whereobj + installincludes lint obj objlink objs objwarn \ + realinstall tags whereobj # we don't want ${PROG} to be PHONY .PHONY: ${PHONY_NOTMAIN:N${PROG:U}} Modified: head/sys/conf/kern.mk ============================================================================== --- head/sys/conf/kern.mk Fri Feb 26 22:13:31 2016 (r296116) +++ head/sys/conf/kern.mk Fri Feb 26 22:13:35 2016 (r296117) @@ -210,10 +210,10 @@ CFLAGS+= ${CFLAGS.${COMPILER_TYPE}} ${CF PHONY_NOTMAIN = afterdepend afterinstall all beforedepend beforeinstall \ beforelinking build build-tools buildfiles buildincludes \ checkdpadd clean cleandepend cleandir cleanobj configure \ - depend dependall distclean distribute exe \ + depend distclean distribute exe \ html includes install installfiles installincludes lint \ - obj objlink objs objwarn realall realdepend \ - realinstall regress subdir-all subdir-depend subdir-install \ + obj objlink objs objwarn \ + realinstall regress \ tags whereobj .PHONY: ${PHONY_NOTMAIN} From owner-svn-src-head@freebsd.org Fri Feb 26 22:13:40 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 43331AB6B11; Fri, 26 Feb 2016 22:13:40 +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 mx1.freebsd.org (Postfix) with ESMTPS id 1373B21B; Fri, 26 Feb 2016 22:13:40 +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 u1QMDdHO033183; Fri, 26 Feb 2016 22:13:39 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1QMDdhC033182; Fri, 26 Feb 2016 22:13:39 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201602262213.u1QMDdhC033182@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Fri, 26 Feb 2016 22:13:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r296118 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Feb 2016 22:13:40 -0000 Author: bdrewery Date: Fri Feb 26 22:13:38 2016 New Revision: 296118 URL: https://svnweb.freebsd.org/changeset/base/296118 Log: Allow configuring .MAKE.MODE via META_MODE as meta.sys.mk does. meta.sys.mk is only used for the DIRDEPS_BUILD. Sponsored by: EMC / Isilon Storage Division Modified: head/share/mk/sys.mk Modified: head/share/mk/sys.mk ============================================================================== --- head/share/mk/sys.mk Fri Feb 26 22:13:35 2016 (r296117) +++ head/share/mk/sys.mk Fri Feb 26 22:13:38 2016 (r296118) @@ -45,12 +45,15 @@ __ENV_ONLY_OPTIONS:= \ .if ${MK_DIRDEPS_BUILD} == "yes" .sinclude .elif ${MK_META_MODE} == "yes" && defined(.MAKEFLAGS) && ${.MAKEFLAGS:M-B} == "" -.MAKE.MODE= meta verbose +# verbose will show .MAKE.META.PREFIX for each target. +META_MODE= meta verbose .if !exists(/dev/filemon) -.MAKE.MODE+= nofilemon +META_MODE+= nofilemon .endif .endif -.MAKE.MODE?= normal +META_MODE?= normal +.export META_MODE +.MAKE.MODE?= ${META_MODE} .if ${MK_AUTO_OBJ} == "yes" # This needs to be done early - before .PATH is computed From owner-svn-src-head@freebsd.org Fri Feb 26 22:13:43 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8FAF7AB6B40; Fri, 26 Feb 2016 22:13:43 +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 mx1.freebsd.org (Postfix) with ESMTPS id 5DAA1331; Fri, 26 Feb 2016 22:13:43 +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 u1QMDgam033230; Fri, 26 Feb 2016 22:13:42 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1QMDgU2033229; Fri, 26 Feb 2016 22:13:42 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201602262213.u1QMDgU2033229@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Fri, 26 Feb 2016 22:13:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r296119 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Feb 2016 22:13:43 -0000 Author: bdrewery Date: Fri Feb 26 22:13:42 2016 New Revision: 296119 URL: https://svnweb.freebsd.org/changeset/base/296119 Log: Track .meta files for .sh but don't preserve timestamp. See r291320 for more information. Sponsored by: EMC / Isilon Storage Division Modified: head/share/mk/sys.mk Modified: head/share/mk/sys.mk ============================================================================== --- head/share/mk/sys.mk Fri Feb 26 22:13:38 2016 (r296118) +++ head/share/mk/sys.mk Fri Feb 26 22:13:42 2016 (r296119) @@ -282,8 +282,8 @@ YFLAGS ?= -d # non-Posix rule set -.sh: .NOMETA - cp -fp ${.IMPSRC} ${.TARGET} +.sh: + cp -f ${.IMPSRC} ${.TARGET} chmod a+x ${.TARGET} .c.ln: From owner-svn-src-head@freebsd.org Fri Feb 26 22:13:46 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8ABF2AB6B55; Fri, 26 Feb 2016 22:13:46 +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 mx1.freebsd.org (Postfix) with ESMTPS id 5276A641; Fri, 26 Feb 2016 22:13:46 +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 u1QMDjZh033276; Fri, 26 Feb 2016 22:13:45 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1QMDjmm033275; Fri, 26 Feb 2016 22:13:45 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201602262213.u1QMDjmm033275@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Fri, 26 Feb 2016 22:13:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r296120 - head/targets X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Feb 2016 22:13:46 -0000 Author: bdrewery Date: Fri Feb 26 22:13:45 2016 New Revision: 296120 URL: https://svnweb.freebsd.org/changeset/base/296120 Log: Follow-up r295991: Only allow 'make destroy*' to include bsd.obj.mk. Sponsored by: EMC / Isilon Storage Division Modified: head/targets/Makefile.xtras Modified: head/targets/Makefile.xtras ============================================================================== --- head/targets/Makefile.xtras Fri Feb 26 22:13:42 2016 (r296119) +++ head/targets/Makefile.xtras Fri Feb 26 22:13:45 2016 (r296120) @@ -54,7 +54,9 @@ show-help: not-valid-target: @echo "ERROR: '${_TARGETS}' is not a valid target for ${MACHINE}." +.if make(destroy*) .include +.endif .for t in ${_TARGETS:Nlove} .if !target($t) From owner-svn-src-head@freebsd.org Fri Feb 26 22:13:50 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B67EFAB6B92; Fri, 26 Feb 2016 22:13:50 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 820B682A; Fri, 26 Feb 2016 22:13:50 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1QMDnF5033328; Fri, 26 Feb 2016 22:13:49 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1QMDmoD033320; Fri, 26 Feb 2016 22:13:48 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201602262213.u1QMDmoD033320@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Fri, 26 Feb 2016 22:13:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r296121 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Feb 2016 22:13:50 -0000 Author: bdrewery Date: Fri Feb 26 22:13:48 2016 New Revision: 296121 URL: https://svnweb.freebsd.org/changeset/base/296121 Log: DIRDEPS_BUILD: Fix some things building in MAKELEVEL0. For PROGS this was recursing twice since MAKELEVEL0 is for 'dirdeps' which then really builds in a sub-make. Sponsored by: EMC / Isilon Storage Division Modified: head/share/mk/bsd.confs.mk head/share/mk/bsd.crunchgen.mk head/share/mk/bsd.doc.mk head/share/mk/bsd.files.mk head/share/mk/bsd.incs.mk head/share/mk/bsd.info.mk head/share/mk/bsd.progs.mk Modified: head/share/mk/bsd.confs.mk ============================================================================== --- head/share/mk/bsd.confs.mk Fri Feb 26 22:13:45 2016 (r296120) +++ head/share/mk/bsd.confs.mk Fri Feb 26 22:13:48 2016 (r296121) @@ -12,7 +12,9 @@ buildconfig: ${${group}} .endfor .endif +.if !defined(_SKIP_BUILD) all: buildconfig +.endif .if !target(installconfig) .for group in ${CONFGROUPS} Modified: head/share/mk/bsd.crunchgen.mk ============================================================================== --- head/share/mk/bsd.crunchgen.mk Fri Feb 26 22:13:45 2016 (r296120) +++ head/share/mk/bsd.crunchgen.mk Fri Feb 26 22:13:48 2016 (r296121) @@ -70,7 +70,9 @@ LINKS+= ${BINDIR}/${PROG} ${BINDIR}/${A} .endfor .endfor +.if !defined(_SKIP_BUILD) all: ${PROG} +.endif exe: ${PROG} ${CONF}: Makefile Modified: head/share/mk/bsd.doc.mk ============================================================================== --- head/share/mk/bsd.doc.mk Fri Feb 26 22:13:45 2016 (r296120) +++ head/share/mk/bsd.doc.mk Fri Feb 26 22:13:48 2016 (r296121) @@ -107,9 +107,11 @@ COMPAT?= -C .PATH: ${.CURDIR} ${SRCDIR} +.if !defined(_SKIP_BUILD) .for _dev in ${PRINTERDEVICE} all: ${DFILE.${_dev}} .endfor +.endif .if !target(print) .for _dev in ${PRINTERDEVICE} Modified: head/share/mk/bsd.files.mk ============================================================================== --- head/share/mk/bsd.files.mk Fri Feb 26 22:13:45 2016 (r296120) +++ head/share/mk/bsd.files.mk Fri Feb 26 22:13:48 2016 (r296121) @@ -16,7 +16,9 @@ ${${group}}:= ${${group}:O:u} buildfiles: ${${group}} .endfor +.if !defined(_SKIP_BUILD) all: buildfiles +.endif .for group in ${FILESGROUPS} .if defined(${group}) && !empty(${group}) Modified: head/share/mk/bsd.incs.mk ============================================================================== --- head/share/mk/bsd.incs.mk Fri Feb 26 22:13:45 2016 (r296120) +++ head/share/mk/bsd.incs.mk Fri Feb 26 22:13:48 2016 (r296121) @@ -14,7 +14,9 @@ buildincludes: ${${group}} .endfor .endif +.if !defined(_SKIP_BUILD) all: buildincludes +.endif .if !target(installincludes) .for group in ${INCSGROUPS} Modified: head/share/mk/bsd.info.mk ============================================================================== --- head/share/mk/bsd.info.mk Fri Feb 26 22:13:45 2016 (r296120) +++ head/share/mk/bsd.info.mk Fri Feb 26 22:13:48 2016 (r296121) @@ -125,9 +125,10 @@ CLEANFILES+= ${IFILENS} .if !defined(NO_INFOCOMPRESS) CLEANFILES+= ${IFILENS:S/$/${ICOMPRESS_EXT}/} IFILES= ${IFILENS:S/$/${ICOMPRESS_EXT}/:S/.html${ICOMPRESS_EXT}/.html/} -all: ${IFILES} .else IFILES= ${IFILENS} +.endif +.if !defined(_SKIP_BUILD) all: ${IFILES} .endif Modified: head/share/mk/bsd.progs.mk ============================================================================== --- head/share/mk/bsd.progs.mk Fri Feb 26 22:13:45 2016 (r296120) +++ head/share/mk/bsd.progs.mk Fri Feb 26 22:13:48 2016 (r296121) @@ -53,7 +53,9 @@ UPDATE_DEPENDFILE ?= NO # prog.mk will do the rest .else # !defined(PROG) +.if !defined(_SKIP_BUILD) all: ${PROGS} +.endif # We cannot capture dependencies for meta mode here UPDATE_DEPENDFILE = NO From owner-svn-src-head@freebsd.org Fri Feb 26 22:13:54 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7B993AB6BC2; Fri, 26 Feb 2016 22:13:54 +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 mx1.freebsd.org (Postfix) with ESMTPS id 221FE974; Fri, 26 Feb 2016 22:13:53 +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 u1QMDrTn033376; Fri, 26 Feb 2016 22:13:53 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1QMDqEj033374; Fri, 26 Feb 2016 22:13:52 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201602262213.u1QMDqEj033374@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Fri, 26 Feb 2016 22:13:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r296122 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Feb 2016 22:13:54 -0000 Author: bdrewery Date: Fri Feb 26 22:13:52 2016 New Revision: 296122 URL: https://svnweb.freebsd.org/changeset/base/296122 Log: Move PROGS logic to proper place and remove redundant and unneeded logic. - bsd.progs.mk is safe to include regardless of PROGS/PROGS_CXX/SCRIPTS being set. - bsd.progs.mk includes bsd.prog.mk always and will bring in bsd.files.mk and bsd.obj.mk. - DIRDEPS_BUILD: There's no need for _SKIP_BUILD or _SKIP_STAGING as the PROGS were implicitly being built by the staging dependency anyway. This was also preventing other objects from building if they were not part of the staging sets. - DIRDEPS_BUILD: This fixes PROGS without bsd.test.mk not staging. MFC after: 2 weeks Sponsored by: EMC / Isilon Storage Division Modified: head/share/mk/bsd.progs.mk head/share/mk/bsd.test.mk Modified: head/share/mk/bsd.progs.mk ============================================================================== --- head/share/mk/bsd.progs.mk Fri Feb 26 22:13:48 2016 (r296121) +++ head/share/mk/bsd.progs.mk Fri Feb 26 22:13:52 2016 (r296122) @@ -59,11 +59,19 @@ all: ${PROGS} # We cannot capture dependencies for meta mode here UPDATE_DEPENDFILE = NO + +.if ${MK_STAGING} != "no" +.if !empty(PROGS) +stage_files.prog: ${PROGS} +.endif +.endif # ${MK_STAGING} != "no" .endif .endif # PROGS || PROGS_CXX # These are handled by the main make process. .ifdef _RECURSING_PROGS +MK_STAGING= no + _PROGS_GLOBAL_VARS= CLEANFILES CLEANDIRS CONFGROUPS FILESGROUPS INCSGROUPS \ SCRIPTS .for v in ${_PROGS_GLOBAL_VARS} Modified: head/share/mk/bsd.test.mk ============================================================================== --- head/share/mk/bsd.test.mk Fri Feb 26 22:13:48 2016 (r296121) +++ head/share/mk/bsd.test.mk Fri Feb 26 22:13:52 2016 (r296122) @@ -93,30 +93,4 @@ beforecheck realcheck aftercheck check: .ORDER: beforecheck realcheck aftercheck check: beforecheck realcheck aftercheck -.ifdef PROG -# we came here via bsd.progs.mk below -# parent will do staging. -MK_STAGING= no -.endif - -.if !empty(PROGS) || !empty(PROGS_CXX) || !empty(SCRIPTS) .include -.endif -.include - -.if !defined(PROG) && ${MK_STAGING} != "no" -.if !defined(_SKIP_BUILD) -# this will handle staging if needed -_SKIP_STAGING= no -# but we don't want it to build anything -_SKIP_BUILD= -.endif -.if !empty(PROGS) -stage_files.prog: ${PROGS} -.endif -.include -.endif - -.if !target(objwarn) -.include -.endif From owner-svn-src-head@freebsd.org Fri Feb 26 22:13:57 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A964DAB6BF5; Fri, 26 Feb 2016 22:13:57 +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 mx1.freebsd.org (Postfix) with ESMTPS id 4A867AA0; Fri, 26 Feb 2016 22:13:57 +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 u1QMDuja033421; Fri, 26 Feb 2016 22:13:56 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1QMDuCE033420; Fri, 26 Feb 2016 22:13:56 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201602262213.u1QMDuCE033420@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Fri, 26 Feb 2016 22:13:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r296123 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Feb 2016 22:13:57 -0000 Author: bdrewery Date: Fri Feb 26 22:13:56 2016 New Revision: 296123 URL: https://svnweb.freebsd.org/changeset/base/296123 Log: META_MODE: Default to the silent build. Sponsored by: EMC / Isilon Storage Division Modified: head/share/mk/sys.mk Modified: head/share/mk/sys.mk ============================================================================== --- head/share/mk/sys.mk Fri Feb 26 22:13:52 2016 (r296122) +++ head/share/mk/sys.mk Fri Feb 26 22:13:56 2016 (r296123) @@ -47,6 +47,10 @@ __ENV_ONLY_OPTIONS:= \ .elif ${MK_META_MODE} == "yes" && defined(.MAKEFLAGS) && ${.MAKEFLAGS:M-B} == "" # verbose will show .MAKE.META.PREFIX for each target. META_MODE= meta verbose +# silent will hide command output if a .meta file is created. +.if !defined(NO_SILENT) +META_MODE+= silent=yes +.endif .if !exists(/dev/filemon) META_MODE+= nofilemon .endif From owner-svn-src-head@freebsd.org Fri Feb 26 22:14:02 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7190AAB6C46; Fri, 26 Feb 2016 22:14:02 +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 mx1.freebsd.org (Postfix) with ESMTPS id 2A0FAC53; Fri, 26 Feb 2016 22:14:02 +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 u1QME14Z033483; Fri, 26 Feb 2016 22:14:01 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1QME0oM033474; Fri, 26 Feb 2016 22:14:00 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201602262214.u1QME0oM033474@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Fri, 26 Feb 2016 22:14:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r296124 - in head: share/man/man7 share/mk sys/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Feb 2016 22:14:02 -0000 Author: bdrewery Date: Fri Feb 26 22:14:00 2016 New Revision: 296124 URL: https://svnweb.freebsd.org/changeset/base/296124 Log: Import bsd.clang-analyze.mk based on NetBSD's version. This allows 'make analyze' or 'make OBJ.clang-analyzer' to run the Clang static analyzer and present results on stdout. Obtained from: NetBSD (CVS Rev. 1.3) Sponsored by: EMC / Isilon Storage Division Differential Revision: https://reviews.freebsd.org/D5449 Added: head/share/mk/bsd.clang-analyze.mk (contents, props changed) Modified: head/share/man/man7/build.7 head/share/mk/Makefile head/share/mk/bsd.dep.mk head/share/mk/bsd.lib.mk head/share/mk/bsd.prog.mk head/share/mk/bsd.subdir.mk head/share/mk/bsd.sys.mk head/sys/conf/kmod.mk Modified: head/share/man/man7/build.7 ============================================================================== --- head/share/man/man7/build.7 Fri Feb 26 22:13:56 2016 (r296123) +++ head/share/man/man7/build.7 Fri Feb 26 22:14:00 2016 (r296124) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 21, 2015 +.Dd February 26, 2016 .Dt BUILD 7 .Os .Sh NAME @@ -107,6 +107,8 @@ section below, and by the variables docu The following list provides the names and actions for the targets supported by the build system: .Bl -tag -width ".Cm cleandepend" +.It Cm analyze +Run Clang static analyzer against all objects and present output on stdout. .It Cm check Run tests for a given subdirectory. The default directory used is Modified: head/share/mk/Makefile ============================================================================== --- head/share/mk/Makefile Fri Feb 26 22:13:56 2016 (r296123) +++ head/share/mk/Makefile Fri Feb 26 22:14:00 2016 (r296124) @@ -17,6 +17,7 @@ FILES= \ auto.obj.mk \ bsd.README \ bsd.arch.inc.mk \ + bsd.clang-analyze.mk \ bsd.compiler.mk \ bsd.confs.mk \ bsd.cpu.mk \ Added: head/share/mk/bsd.clang-analyze.mk ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/mk/bsd.clang-analyze.mk Fri Feb 26 22:14:00 2016 (r296124) @@ -0,0 +1,105 @@ +# $FreeBSD$ +# +# Support Clang static analyzer on SRCS. +# +# +# +++ variables +++ +# +# CLANG_ANALYZE_CHECKERS Which checkers to run for all sources. +# +# CLANG_ANALYZE_CXX_CHECKERS Which checkers to run for C++ sources. +# +# CLANG_ANALYZE_OUTPUT Output format for generated files. +# text - don't generate extra files. +# html - generate html in obj.plist/ directories. +# plist - generate xml obj.plist files. +# See also: +# contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/Analyses.def +# +# CLANG_ANALYZE_OUTPUT_DIR Sets which directory output set by +# CLANG_ANALYZE_OUTPUT is placed into. +# +# +++ targets +++ +# +# analyze: +# Run the Clang static analyzer against all sources and present +# output on stdout. + +.if !target(____) +____: + +.include + +.if ${COMPILER_TYPE} != "clang" && (make(analyze) || make(*.clang-analyzer)) +.error Clang static analyzer requires clang but found that compiler '${CC}' is ${COMPILER_TYPE} +.endif + +CLANG_ANALYZE_OUTPUT?= text +CLANG_ANALYZE_OUTPUT_DIR?= clang-analyze +CLANG_ANALYZE_FLAGS+= --analyze \ + -Xanalyzer -analyzer-output=${CLANG_ANALYZE_OUTPUT} \ + -o ${CLANG_ANALYZE_OUTPUT_DIR} + +CLANG_ANALYZE_CHECKERS+= core deadcode security unix +CLANG_ANALYZE_CXX_CHECKERS+= cplusplus + +.for checker in ${CLANG_ANALYZE_CHECKERS} +CLANG_ANALYZE_FLAGS+= -Xanalyzer -analyzer-checker=${checker} +.endfor +CLANG_ANALYZE_CXX_FLAGS+= ${CLANG_ANALYZE_FLAGS} +.for checker in ${CLANG_ANALYZE_CXX_CHECKERS} +CLANG_ANALYZE_CXX_FLAGS+= -Xanalyzer -analyzer-checker=${checker} +.endfor + +.SUFFIXES: .c .cc .cpp .cxx .C .clang-analyzer + +CLANG_ANALYZE_CFLAGS= ${CFLAGS:N-Wa,--fatal-warnings} +CLANG_ANALYZE_CXXFLAGS= ${CXXFLAGS:N-Wa,--fatal-warnings} + +.c.clang-analyzer: + ${CC:N${CCACHE_BIN}} ${CLANG_ANALYZE_FLAGS} \ + ${CLANG_ANALYZE_CFLAGS} ${CPPFLAGS} \ + ${COPTS.${.IMPSRC:T}} ${CPUFLAGS.${.IMPSRC:T}} \ + ${CPPFLAGS.${.IMPSRC:T}} ${.IMPSRC} +.cc.clang-analyzer .cpp.clang-analyzer .cxx.clang-analyzer .C.clang-analyzer: + ${CXX:N${CCACHE_BIN}} ${CLANG_ANALYZE_CXX_FLAGS} \ + ${CLANG_ANALYZE_CXXFLAGS} ${CPPFLAGS} \ + ${COPTS.${.IMPSRC:T}} ${CPUFLAGS.${.IMPSRC:T}} \ + ${CPPFLAGS.${.IMPSRC:T}} ${.IMPSRC} + +CLANG_ANALYZE_SRCS= \ + ${SRCS:M*.[cC]} ${SRCS:M*.cc} \ + ${SRCS:M*.cpp} ${SRCS:M*.cxx} \ + ${DPSRCS:M*.[cC]} ${DPSRCS:M*.cc} \ + ${DPSRCS:M*.cpp} ${DPSRCS:M*.cxx} +.if !empty(CLANG_ANALYZE_SRCS) +CLANG_ANALYZE_OBJS= ${CLANG_ANALYZE_SRCS:O:u:R:S,$,.clang-analyzer,} +.NOPATH: ${CLANG_ANALYZE_OBJS} +.endif + +# .depend files aren't relevant here since they reference obj.o rather than +# obj.clang-analyzer, so add in some guesses in case 'make depend' wasn't ran, +# for when directly building 'obj.clang-analyzer'. +.for __obj in ${CLANG_ANALYZE_OBJS} +${__obj}: ${OBJS_DEPEND_GUESS} +${__obj}: ${OBJS_DEPEND_GUESS.${__obj}} +.endfor + +.if ${MK_FAST_DEPEND} == "yes" +beforeanalyze: depend +.endif +beforeanalyze: .PHONY +.if !defined(_RECURSING_PROGS) && !empty(CLANG_ANALYZE_SRCS) && \ + ${CLANG_ANALYZE_OUTPUT} != "text" + mkdir -p ${CLANG_ANALYZE_OUTPUT_DIR} +.endif + +.if !target(analyze) +analyze: beforeanalyze .WAIT ${CLANG_ANALYZE_OBJS} +.endif + +.if exists(${CLANG_ANALYZE_OUTPUT_DIR}) +CLEANDIRS+= ${CLANG_ANALYZE_OUTPUT_DIR} +.endif + +.endif # !target(____) Modified: head/share/mk/bsd.dep.mk ============================================================================== --- head/share/mk/bsd.dep.mk Fri Feb 26 22:13:56 2016 (r296123) +++ head/share/mk/bsd.dep.mk Fri Feb 26 22:14:00 2016 (r296124) @@ -83,7 +83,7 @@ tags: ${SRCS} # Skip reading .depend when not needed to speed up tree-walks # and simple lookups. .if !empty(.MAKEFLAGS:M-V${_V_READ_DEPEND}) || make(obj) || make(clean*) || \ - make(install*) + make(install*) || make(analyze) _SKIP_READ_DEPEND= 1 .if ${MK_DIRDEPS_BUILD} == "no" .MAKE.DEPENDFILE= /dev/null Modified: head/share/mk/bsd.lib.mk ============================================================================== --- head/share/mk/bsd.lib.mk Fri Feb 26 22:13:56 2016 (r296123) +++ head/share/mk/bsd.lib.mk Fri Feb 26 22:14:00 2016 (r296124) @@ -441,5 +441,6 @@ ${_S:R}.So: ${OBJS_DEPEND_GUESS.${_S:R}. .endif .include +.include .include .include Modified: head/share/mk/bsd.prog.mk ============================================================================== --- head/share/mk/bsd.prog.mk Fri Feb 26 22:13:56 2016 (r296123) +++ head/share/mk/bsd.prog.mk Fri Feb 26 22:14:00 2016 (r296124) @@ -283,5 +283,6 @@ ${OBJS}: ${OBJS_DEPEND_GUESS} .endif .include +.include .include .include Modified: head/share/mk/bsd.subdir.mk ============================================================================== --- head/share/mk/bsd.subdir.mk Fri Feb 26 22:13:56 2016 (r296123) +++ head/share/mk/bsd.subdir.mk Fri Feb 26 22:14:00 2016 (r296124) @@ -39,7 +39,7 @@ ____: SUBDIR_TARGETS+= \ - all all-man buildconfig buildfiles buildincludes \ + all all-man analyze buildconfig buildfiles buildincludes \ checkdpadd clean cleandepend cleandir cleanilinks \ cleanobj depend distribute files includes installconfig \ installfiles installincludes realinstall lint maninstall \ Modified: head/share/mk/bsd.sys.mk ============================================================================== --- head/share/mk/bsd.sys.mk Fri Feb 26 22:13:56 2016 (r296123) +++ head/share/mk/bsd.sys.mk Fri Feb 26 22:14:00 2016 (r296124) @@ -176,7 +176,7 @@ CXXFLAGS+= ${CXXFLAGS.${COMPILER_TYPE}} # Tell bmake not to mistake standard targets for things to be searched for # or expect to ever be up-to-date. -PHONY_NOTMAIN = afterdepend afterinstall all beforedepend beforeinstall \ +PHONY_NOTMAIN = analyze afterdepend afterinstall all beforedepend beforeinstall \ beforelinking build build-tools buildconfig buildfiles \ buildincludes check checkdpadd clean cleandepend cleandir \ cleanobj configure depend distclean distribute exe \ Modified: head/sys/conf/kmod.mk ============================================================================== --- head/sys/conf/kmod.mk Fri Feb 26 22:13:56 2016 (r296123) +++ head/sys/conf/kmod.mk Fri Feb 26 22:14:00 2016 (r296124) @@ -461,5 +461,6 @@ ${OBJS}: ${OBJS_DEPEND_GUESS} .endif .include +.include .include .include "kern.mk" From owner-svn-src-head@freebsd.org Fri Feb 26 22:14:06 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 31ED6AB6C82; Fri, 26 Feb 2016 22:14:06 +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 mx1.freebsd.org (Postfix) with ESMTPS id CFF98DBF; Fri, 26 Feb 2016 22:14:05 +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 u1QME4QC033529; Fri, 26 Feb 2016 22:14:04 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1QME42K033527; Fri, 26 Feb 2016 22:14:04 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201602262214.u1QME42K033527@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Fri, 26 Feb 2016 22:14:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r296125 - in head/lib/libcasper: . services X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Feb 2016 22:14:06 -0000 Author: bdrewery Date: Fri Feb 26 22:14:04 2016 New Revision: 296125 URL: https://svnweb.freebsd.org/changeset/base/296125 Log: These can build in parallel. Sponsored by: EMC / Isilon Storage Division Modified: head/lib/libcasper/Makefile head/lib/libcasper/services/Makefile Modified: head/lib/libcasper/Makefile ============================================================================== --- head/lib/libcasper/Makefile Fri Feb 26 22:14:00 2016 (r296124) +++ head/lib/libcasper/Makefile Fri Feb 26 22:14:04 2016 (r296125) @@ -3,4 +3,6 @@ SUBDIR= libcasper SUBDIR+= services +SUBDIR_PARALLEL= + .include Modified: head/lib/libcasper/services/Makefile ============================================================================== --- head/lib/libcasper/services/Makefile Fri Feb 26 22:14:00 2016 (r296124) +++ head/lib/libcasper/services/Makefile Fri Feb 26 22:14:04 2016 (r296125) @@ -6,4 +6,6 @@ SUBDIR+= cap_pwd SUBDIR+= cap_random SUBDIR+= cap_sysctl +SUBDIR_PARALLEL= + .include From owner-svn-src-head@freebsd.org Fri Feb 26 22:14:10 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EB679AB6CBF; Fri, 26 Feb 2016 22:14:10 +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 mx1.freebsd.org (Postfix) with ESMTPS id C8193F4E; Fri, 26 Feb 2016 22:14:10 +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 u1QME98L033584; Fri, 26 Feb 2016 22:14:09 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1QME9Qm033576; Fri, 26 Feb 2016 22:14:09 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201602262214.u1QME9Qm033576@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Fri, 26 Feb 2016 22:14:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r296126 - in head/lib/libcasper: . libcasper services services/cap_dns services/cap_grp services/cap_pwd services/cap_random services/cap_sysctl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Feb 2016 22:14:11 -0000 Author: bdrewery Date: Fri Feb 26 22:14:08 2016 New Revision: 296126 URL: https://svnweb.freebsd.org/changeset/base/296126 Log: Remove unneeded lines. - WARNS can be inherited from lib/Makefile.inc - CFLAGS referred to a non-existent directory and this shouldn't be needed anyhow due to the build picking up includes from WORLDTMP. Sponsored by: EMC / Isilon Storage Division Added: head/lib/libcasper/Makefile.inc (contents, props changed) head/lib/libcasper/services/Makefile.inc (contents, props changed) Modified: head/lib/libcasper/libcasper/Makefile head/lib/libcasper/services/cap_dns/Makefile head/lib/libcasper/services/cap_grp/Makefile head/lib/libcasper/services/cap_pwd/Makefile head/lib/libcasper/services/cap_random/Makefile head/lib/libcasper/services/cap_sysctl/Makefile Added: head/lib/libcasper/Makefile.inc ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libcasper/Makefile.inc Fri Feb 26 22:14:08 2016 (r296126) @@ -0,0 +1,3 @@ +# $FreeBSD$ + +.include "../Makefile.inc" Modified: head/lib/libcasper/libcasper/Makefile ============================================================================== --- head/lib/libcasper/libcasper/Makefile Fri Feb 26 22:14:04 2016 (r296125) +++ head/lib/libcasper/libcasper/Makefile Fri Feb 26 22:14:08 2016 (r296126) @@ -18,8 +18,6 @@ LIBADD= nv CFLAGS+=-I${.CURDIR} -WARNS?= 6 - MAN+= libcasper.3 MLINKS+=libcasper.3 cap_init.3 Added: head/lib/libcasper/services/Makefile.inc ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libcasper/services/Makefile.inc Fri Feb 26 22:14:08 2016 (r296126) @@ -0,0 +1,3 @@ +# $FreeBSD$ + +.include "../Makefile.inc" Modified: head/lib/libcasper/services/cap_dns/Makefile ============================================================================== --- head/lib/libcasper/services/cap_dns/Makefile Fri Feb 26 22:14:04 2016 (r296125) +++ head/lib/libcasper/services/cap_dns/Makefile Fri Feb 26 22:14:08 2016 (r296126) @@ -13,8 +13,5 @@ INCS= cap_dns.h LIBADD= nv CFLAGS+=-I${.CURDIR} -CFLAGS+=-I${.CURDIR}/../libcasper - -WARNS?= 6 .include Modified: head/lib/libcasper/services/cap_grp/Makefile ============================================================================== --- head/lib/libcasper/services/cap_grp/Makefile Fri Feb 26 22:14:04 2016 (r296125) +++ head/lib/libcasper/services/cap_grp/Makefile Fri Feb 26 22:14:08 2016 (r296126) @@ -13,8 +13,5 @@ INCS= cap_grp.h LIBADD= nv CFLAGS+=-I${.CURDIR} -CFLAGS+=-I${.CURDIR}/../libcasper - -WARNS?= 6 .include Modified: head/lib/libcasper/services/cap_pwd/Makefile ============================================================================== --- head/lib/libcasper/services/cap_pwd/Makefile Fri Feb 26 22:14:04 2016 (r296125) +++ head/lib/libcasper/services/cap_pwd/Makefile Fri Feb 26 22:14:08 2016 (r296126) @@ -13,8 +13,5 @@ INCS= cap_pwd.h LIBADD= nv CFLAGS+=-I${.CURDIR} -CFLAGS+=-I${.CURDIR}/../libcasper - -WARNS?= 6 .include Modified: head/lib/libcasper/services/cap_random/Makefile ============================================================================== --- head/lib/libcasper/services/cap_random/Makefile Fri Feb 26 22:14:04 2016 (r296125) +++ head/lib/libcasper/services/cap_random/Makefile Fri Feb 26 22:14:08 2016 (r296126) @@ -13,8 +13,5 @@ INCS= cap_random.h LIBADD= nv CFLAGS+=-I${.CURDIR} -CFLAGS+=-I${.CURDIR}/../libcasper - -WARNS?= 6 .include Modified: head/lib/libcasper/services/cap_sysctl/Makefile ============================================================================== --- head/lib/libcasper/services/cap_sysctl/Makefile Fri Feb 26 22:14:04 2016 (r296125) +++ head/lib/libcasper/services/cap_sysctl/Makefile Fri Feb 26 22:14:08 2016 (r296126) @@ -13,8 +13,5 @@ INCS= cap_sysctl.h LIBADD= nv CFLAGS+=-I${.CURDIR} -CFLAGS+=-I${.CURDIR}/../libcasper - -WARNS?= 6 .include From owner-svn-src-head@freebsd.org Fri Feb 26 22:14:17 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9DDD9AB6D23; Fri, 26 Feb 2016 22:14:17 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5BD5B1177; Fri, 26 Feb 2016 22:14:17 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1QMEGEf033641; Fri, 26 Feb 2016 22:14:16 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1QMEF52033629; Fri, 26 Feb 2016 22:14:15 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201602262214.u1QMEF52033629@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Fri, 26 Feb 2016 22:14:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r296127 - in head: lib/libcasper lib/libcasper/libcasper lib/libcasper/services/cap_dns lib/libcasper/services/cap_grp lib/libcasper/services/cap_pwd lib/libcasper/services/cap_random l... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Feb 2016 22:14:17 -0000 Author: bdrewery Date: Fri Feb 26 22:14:15 2016 New Revision: 296127 URL: https://svnweb.freebsd.org/changeset/base/296127 Log: Update dependencies. Sponsored by: EMC / Isilon Storage Division Added: head/lib/libcasper/libcasper/Makefile.depend - copied, changed from r296126, head/lib/libcasper/Makefile.depend head/lib/libcasper/services/cap_dns/Makefile.depend - copied, changed from r296126, head/lib/libcasper/Makefile.depend head/lib/libcasper/services/cap_grp/Makefile.depend - copied, changed from r296126, head/lib/libcasper/Makefile.depend head/lib/libcasper/services/cap_pwd/Makefile.depend - copied, changed from r296126, head/lib/libcasper/Makefile.depend head/lib/libcasper/services/cap_random/Makefile.depend - copied, changed from r296126, head/lib/libcasper/Makefile.depend head/lib/libcasper/services/cap_sysctl/Makefile.depend (contents, props changed) - copied, changed from r296126, head/lib/libcasper/Makefile.depend Deleted: head/lib/libcasper/Makefile.depend Modified: head/sbin/ping/Makefile.depend head/targets/pseudo/userland/gnu/Makefile.depend head/targets/pseudo/userland/lib/Makefile.depend head/usr.bin/kdump/Makefile.depend head/usr.sbin/tcpdump/tcpdump/Makefile.depend Copied and modified: head/lib/libcasper/libcasper/Makefile.depend (from r296126, head/lib/libcasper/Makefile.depend) ============================================================================== --- head/lib/libcasper/Makefile.depend Fri Feb 26 22:14:08 2016 (r296126, copy source) +++ head/lib/libcasper/libcasper/Makefile.depend Fri Feb 26 22:14:15 2016 (r296127) @@ -8,10 +8,8 @@ DIRDEPS = \ include/xlocale \ lib/${CSU_DIR} \ lib/libc \ - lib/libcapsicum \ lib/libcompiler_rt \ lib/libnv \ - lib/libpjdlog \ .include Copied and modified: head/lib/libcasper/services/cap_dns/Makefile.depend (from r296126, head/lib/libcasper/Makefile.depend) ============================================================================== --- head/lib/libcasper/Makefile.depend Fri Feb 26 22:14:08 2016 (r296126, copy source) +++ head/lib/libcasper/services/cap_dns/Makefile.depend Fri Feb 26 22:14:15 2016 (r296127) @@ -8,10 +8,9 @@ DIRDEPS = \ include/xlocale \ lib/${CSU_DIR} \ lib/libc \ - lib/libcapsicum \ + lib/libcasper/libcasper \ lib/libcompiler_rt \ lib/libnv \ - lib/libpjdlog \ .include Copied and modified: head/lib/libcasper/services/cap_grp/Makefile.depend (from r296126, head/lib/libcasper/Makefile.depend) ============================================================================== --- head/lib/libcasper/Makefile.depend Fri Feb 26 22:14:08 2016 (r296126, copy source) +++ head/lib/libcasper/services/cap_grp/Makefile.depend Fri Feb 26 22:14:15 2016 (r296127) @@ -8,10 +8,9 @@ DIRDEPS = \ include/xlocale \ lib/${CSU_DIR} \ lib/libc \ - lib/libcapsicum \ + lib/libcasper/libcasper \ lib/libcompiler_rt \ lib/libnv \ - lib/libpjdlog \ .include Copied and modified: head/lib/libcasper/services/cap_pwd/Makefile.depend (from r296126, head/lib/libcasper/Makefile.depend) ============================================================================== --- head/lib/libcasper/Makefile.depend Fri Feb 26 22:14:08 2016 (r296126, copy source) +++ head/lib/libcasper/services/cap_pwd/Makefile.depend Fri Feb 26 22:14:15 2016 (r296127) @@ -8,10 +8,9 @@ DIRDEPS = \ include/xlocale \ lib/${CSU_DIR} \ lib/libc \ - lib/libcapsicum \ + lib/libcasper/libcasper \ lib/libcompiler_rt \ lib/libnv \ - lib/libpjdlog \ .include Copied and modified: head/lib/libcasper/services/cap_random/Makefile.depend (from r296126, head/lib/libcasper/Makefile.depend) ============================================================================== --- head/lib/libcasper/Makefile.depend Fri Feb 26 22:14:08 2016 (r296126, copy source) +++ head/lib/libcasper/services/cap_random/Makefile.depend Fri Feb 26 22:14:15 2016 (r296127) @@ -8,10 +8,9 @@ DIRDEPS = \ include/xlocale \ lib/${CSU_DIR} \ lib/libc \ - lib/libcapsicum \ + lib/libcasper/libcasper \ lib/libcompiler_rt \ lib/libnv \ - lib/libpjdlog \ .include Copied and modified: head/lib/libcasper/services/cap_sysctl/Makefile.depend (from r296126, head/lib/libcasper/Makefile.depend) ============================================================================== --- head/lib/libcasper/Makefile.depend Fri Feb 26 22:14:08 2016 (r296126, copy source) +++ head/lib/libcasper/services/cap_sysctl/Makefile.depend Fri Feb 26 22:14:15 2016 (r296127) @@ -8,10 +8,9 @@ DIRDEPS = \ include/xlocale \ lib/${CSU_DIR} \ lib/libc \ - lib/libcapsicum \ + lib/libcasper/libcasper \ lib/libcompiler_rt \ lib/libnv \ - lib/libpjdlog \ .include Modified: head/sbin/ping/Makefile.depend ============================================================================== --- head/sbin/ping/Makefile.depend Fri Feb 26 22:14:08 2016 (r296126) +++ head/sbin/ping/Makefile.depend Fri Feb 26 22:14:15 2016 (r296127) @@ -10,7 +10,7 @@ DIRDEPS = \ lib/${CSU_DIR} \ lib/libc \ lib/libcasper/libcasper \ - lib/libcasper/services \ + lib/libcasper/services/cap_dns \ lib/libcompiler_rt \ lib/libipsec \ lib/libnv \ Modified: head/targets/pseudo/userland/gnu/Makefile.depend ============================================================================== --- head/targets/pseudo/userland/gnu/Makefile.depend Fri Feb 26 22:14:08 2016 (r296126) +++ head/targets/pseudo/userland/gnu/Makefile.depend Fri Feb 26 22:14:15 2016 (r296127) @@ -27,7 +27,6 @@ DIRDEPS = \ gnu/usr.bin/binutils/libbinutils \ gnu/usr.bin/binutils/libiberty \ gnu/usr.bin/binutils/libopcodes \ - gnu/usr.bin/binutils/objcopy \ gnu/usr.bin/binutils/objdump \ gnu/usr.bin/binutils/ranlib \ gnu/usr.bin/dialog \ @@ -112,6 +111,10 @@ DIRDEPS = \ gnu/usr.bin/texinfo/makeinfo \ gnu/usr.bin/texinfo/texindex \ +.if ${MK_ELFCOPY_AS_OBJCOPY} == "no" +DIRDEPS+= gnu/usr.bin/binutils/objcopy +.endif + .if ${MK_GPL_DTC} != "no" DIRDEPS+= gnu/usr.bin/dtc .endif Modified: head/targets/pseudo/userland/lib/Makefile.depend ============================================================================== --- head/targets/pseudo/userland/lib/Makefile.depend Fri Feb 26 22:14:08 2016 (r296126) +++ head/targets/pseudo/userland/lib/Makefile.depend Fri Feb 26 22:14:15 2016 (r296127) @@ -188,7 +188,7 @@ DIRDEPS+= lib/libnandfs .if ${MK_CASPER} != "no" DIRDEPS+= \ - lib/libcasper \ + lib/libcasper/libcasper \ lib/libcasper/services/cap_dns \ lib/libcasper/services/cap_grp \ lib/libcasper/services/cap_pwd \ Modified: head/usr.bin/kdump/Makefile.depend ============================================================================== --- head/usr.bin/kdump/Makefile.depend Fri Feb 26 22:14:08 2016 (r296126) +++ head/usr.bin/kdump/Makefile.depend Fri Feb 26 22:14:15 2016 (r296127) @@ -9,7 +9,9 @@ DIRDEPS = \ include/xlocale \ lib/${CSU_DIR} \ lib/libc \ - lib/libcapsicum \ + lib/libcasper/libcasper \ + lib/libcasper/services/cap_grp \ + lib/libcasper/services/cap_pwd \ lib/libcompiler_rt \ lib/libnv \ lib/libsysdecode \ Modified: head/usr.sbin/tcpdump/tcpdump/Makefile.depend ============================================================================== --- head/usr.sbin/tcpdump/tcpdump/Makefile.depend Fri Feb 26 22:14:08 2016 (r296126) +++ head/usr.sbin/tcpdump/tcpdump/Makefile.depend Fri Feb 26 22:14:15 2016 (r296127) @@ -10,7 +10,8 @@ DIRDEPS = \ include/xlocale \ lib/${CSU_DIR} \ lib/libc \ - lib/libcapsicum \ + lib/libcasper/libcasper \ + lib/libcasper/services/cap_dns \ lib/libcompiler_rt \ lib/libnv \ lib/libpcap \ From owner-svn-src-head@freebsd.org Fri Feb 26 22:14:21 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 01378AB6D58; Fri, 26 Feb 2016 22:14:21 +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 mx1.freebsd.org (Postfix) with ESMTPS id C439B1288; Fri, 26 Feb 2016 22:14:20 +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 u1QMEJKT033687; Fri, 26 Feb 2016 22:14:19 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1QMEJA6033686; Fri, 26 Feb 2016 22:14:19 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201602262214.u1QMEJA6033686@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Fri, 26 Feb 2016 22:14:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r296128 - head/lib/libc/string X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Feb 2016 22:14:21 -0000 Author: bdrewery Date: Fri Feb 26 22:14:19 2016 New Revision: 296128 URL: https://svnweb.freebsd.org/changeset/base/296128 Log: Make it clear that the "size" argument is for the dst string. The rest of the manpage already referenced 'dstsize' but did not rename the variable in the prototype in r257646. MFC after: 3 days Sponsored by: EMC / Isilon Storage Division Modified: head/lib/libc/string/strlcpy.3 Modified: head/lib/libc/string/strlcpy.3 ============================================================================== --- head/lib/libc/string/strlcpy.3 Fri Feb 26 22:14:15 2016 (r296127) +++ head/lib/libc/string/strlcpy.3 Fri Feb 26 22:14:19 2016 (r296128) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 4, 2013 +.Dd February 26, 2016 .Dt STRLCPY 3 .Os .Sh NAME @@ -39,9 +39,9 @@ .Sh SYNOPSIS .In string.h .Ft size_t -.Fn strlcpy "char * restrict dst" "const char * restrict src" "size_t size" +.Fn strlcpy "char * restrict dst" "const char * restrict src" "size_t dstsize" .Ft size_t -.Fn strlcat "char * restrict dst" "const char * restrict src" "size_t size" +.Fn strlcat "char * restrict dst" "const char * restrict src" "size_t dstsize" .Sh DESCRIPTION The .Fn strlcpy From owner-svn-src-head@freebsd.org Fri Feb 26 22:14:26 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EFFEFAB6DAB; Fri, 26 Feb 2016 22:14:25 +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 mx1.freebsd.org (Postfix) with ESMTPS id 8BB0E13D1; Fri, 26 Feb 2016 22:14:25 +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 u1QMEOeV033740; Fri, 26 Feb 2016 22:14:24 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1QMENuK033732; Fri, 26 Feb 2016 22:14:23 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201602262214.u1QMENuK033732@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Fri, 26 Feb 2016 22:14:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r296129 - in head/lib: libdpv libfigpar libgpio libnv libpjdlog libproc libproc/tests X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Feb 2016 22:14:26 -0000 Author: bdrewery Date: Fri Feb 26 22:14:23 2016 New Revision: 296129 URL: https://svnweb.freebsd.org/changeset/base/296129 Log: Remove WARNS inherited fine by ../Makefile.inc. Sponsored by: EMC / Isilon Storage Division Added: head/lib/libproc/Makefile.inc (contents, props changed) Modified: head/lib/libdpv/Makefile head/lib/libfigpar/Makefile head/lib/libgpio/Makefile head/lib/libnv/Makefile head/lib/libpjdlog/Makefile head/lib/libproc/tests/Makefile Modified: head/lib/libdpv/Makefile ============================================================================== --- head/lib/libdpv/Makefile Fri Feb 26 22:14:19 2016 (r296128) +++ head/lib/libdpv/Makefile Fri Feb 26 22:14:23 2016 (r296129) @@ -12,6 +12,4 @@ SRCS= dialog_util.c dialogrc.c dprompt. CFLAGS+= -I${.CURDIR} -WARNS?= 6 - .include Modified: head/lib/libfigpar/Makefile ============================================================================== --- head/lib/libfigpar/Makefile Fri Feb 26 22:14:19 2016 (r296128) +++ head/lib/libfigpar/Makefile Fri Feb 26 22:14:23 2016 (r296129) @@ -16,6 +16,4 @@ CFLAGS+= -I${.CURDIR} SRCS= figpar.c string_m.c -WARNS?= 6 - .include Modified: head/lib/libgpio/Makefile ============================================================================== --- head/lib/libgpio/Makefile Fri Feb 26 22:14:19 2016 (r296128) +++ head/lib/libgpio/Makefile Fri Feb 26 22:14:23 2016 (r296129) @@ -31,6 +31,4 @@ MLINKS= gpio.3 gpio_open.3 \ gpio.3 gpio_pin_invout.3 \ gpio.3 gpio_pin_pulsate.3 -WARNS?= 6 - .include Modified: head/lib/libnv/Makefile ============================================================================== --- head/lib/libnv/Makefile Fri Feb 26 22:14:19 2016 (r296128) +++ head/lib/libnv/Makefile Fri Feb 26 22:14:23 2016 (r296129) @@ -15,8 +15,6 @@ SRCS+= msgio.c SRCS+= nvlist.c SRCS+= nvpair.c -WARNS?= 6 - .if ${MK_TESTS} != "no" SUBDIR+= tests .endif Modified: head/lib/libpjdlog/Makefile ============================================================================== --- head/lib/libpjdlog/Makefile Fri Feb 26 22:14:19 2016 (r296128) +++ head/lib/libpjdlog/Makefile Fri Feb 26 22:14:23 2016 (r296129) @@ -15,6 +15,4 @@ CFLAGS+=-I${.CURDIR} LIBADD= util -WARNS?= 6 - .include Added: head/lib/libproc/Makefile.inc ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libproc/Makefile.inc Fri Feb 26 22:14:23 2016 (r296129) @@ -0,0 +1,3 @@ +# $FreeBSD$ + +.include "../Makefile.inc" Modified: head/lib/libproc/tests/Makefile ============================================================================== --- head/lib/libproc/tests/Makefile Fri Feb 26 22:14:19 2016 (r296128) +++ head/lib/libproc/tests/Makefile Fri Feb 26 22:14:23 2016 (r296129) @@ -12,6 +12,4 @@ LIBADD= elf proc rtld_db util # for testing symbol lookup. STRIP= -WARNS?= 6 - .include From owner-svn-src-head@freebsd.org Fri Feb 26 22:19:34 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7523AAB6F35; Fri, 26 Feb 2016 22:19:34 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id 678FA18C8; Fri, 26 Feb 2016 22:19:34 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [IPv6:::1]) by freefall.freebsd.org (Postfix) with ESMTP id 5F9F71CE2; Fri, 26 Feb 2016 22:19:34 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [172.31.3.2]) by mail.xzibition.com (Postfix) with ESMTP id 1895B141DB; Fri, 26 Feb 2016 22:19:34 +0000 (UTC) X-Virus-Scanned: amavisd-new at mail.xzibition.com Received: from mail.xzibition.com ([172.31.3.2]) by mail.xzibition.com (mail.xzibition.com [172.31.3.2]) (amavisd-new, port 10026) with LMTP id 3tzjD3tWGjzm; Fri, 26 Feb 2016 22:19:31 +0000 (UTC) Subject: Re: svn commit: r296124 - in head: share/man/man7 share/mk sys/conf DKIM-Filter: OpenDKIM Filter v2.9.2 mail.xzibition.com 437E6141D1 To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201602262214.u1QME0oM033474@repo.freebsd.org> From: Bryan Drewery Organization: FreeBSD Message-ID: <56D0CF75.9050306@FreeBSD.org> Date: Fri, 26 Feb 2016 14:19:33 -0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: <201602262214.u1QME0oM033474@repo.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Feb 2016 22:19:34 -0000 On 2/26/16 2:14 PM, Bryan Drewery wrote: > Author: bdrewery > Date: Fri Feb 26 22:14:00 2016 > New Revision: 296124 > URL: https://svnweb.freebsd.org/changeset/base/296124 > > Log: > Import bsd.clang-analyze.mk based on NetBSD's version. > > This allows 'make analyze' or 'make OBJ.clang-analyzer' to run the > Clang static analyzer and present results on stdout. > > Obtained from: NetBSD (CVS Rev. 1.3) > Sponsored by: EMC / Isilon Storage Division > Differential Revision: https://reviews.freebsd.org/D5449 > I just wanted to call special attention to this one. You may find it useful to run in something you maintain. scan-build can achieve the same thing but this one is at least built-in and dependency-free. It doesn't work for the kernel yet. -- Regards, Bryan Drewery From owner-svn-src-head@freebsd.org Fri Feb 26 22:19:40 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B280BAB6F61; Fri, 26 Feb 2016 22:19:40 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6B62E1A05; Fri, 26 Feb 2016 22:19:40 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1QMJduL033944; Fri, 26 Feb 2016 22:19:39 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1QMJd6g033943; Fri, 26 Feb 2016 22:19:39 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201602262219.u1QMJd6g033943@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 26 Feb 2016 22:19:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r296130 - head/etc/mtree X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Feb 2016 22:19:40 -0000 Author: emaste Date: Fri Feb 26 22:19:39 2016 New Revision: 296130 URL: https://svnweb.freebsd.org/changeset/base/296130 Log: Remove libexec/casper debug directory missed in r296047 Modified: head/etc/mtree/BSD.debug.dist Modified: head/etc/mtree/BSD.debug.dist ============================================================================== --- head/etc/mtree/BSD.debug.dist Fri Feb 26 22:14:23 2016 (r296129) +++ head/etc/mtree/BSD.debug.dist Fri Feb 26 22:19:39 2016 (r296130) @@ -15,8 +15,6 @@ lib geom .. - casper - .. .. libexec .. From owner-svn-src-head@freebsd.org Fri Feb 26 22:21:06 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1D764AB4021; Fri, 26 Feb 2016 22:21:06 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id 0F3691C91; Fri, 26 Feb 2016 22:21:06 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [IPv6:::1]) by freefall.freebsd.org (Postfix) with ESMTP id 0712B1F75; Fri, 26 Feb 2016 22:21:06 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [172.31.3.2]) by mail.xzibition.com (Postfix) with ESMTP id CDCFA141F4; Fri, 26 Feb 2016 22:21:05 +0000 (UTC) X-Virus-Scanned: amavisd-new at mail.xzibition.com Received: from mail.xzibition.com ([172.31.3.2]) by mail.xzibition.com (mail.xzibition.com [172.31.3.2]) (amavisd-new, port 10026) with LMTP id pIUFYQ9uG219; Fri, 26 Feb 2016 22:21:03 +0000 (UTC) Subject: Re: svn commit: r296130 - head/etc/mtree DKIM-Filter: OpenDKIM Filter v2.9.2 mail.xzibition.com 10BAD141EC To: Ed Maste , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201602262219.u1QMJd6g033943@repo.freebsd.org> From: Bryan Drewery Organization: FreeBSD Message-ID: <56D0CFD1.8080904@FreeBSD.org> Date: Fri, 26 Feb 2016 14:21:05 -0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: <201602262219.u1QMJd6g033943@repo.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Feb 2016 22:21:06 -0000 On 2/26/16 2:19 PM, Ed Maste wrote: > Author: emaste > Date: Fri Feb 26 22:19:39 2016 > New Revision: 296130 > URL: https://svnweb.freebsd.org/changeset/base/296130 > > Log: > Remove libexec/casper debug directory missed in r296047 > > Modified: > head/etc/mtree/BSD.debug.dist > > Modified: head/etc/mtree/BSD.debug.dist > ============================================================================== > --- head/etc/mtree/BSD.debug.dist Fri Feb 26 22:14:23 2016 (r296129) > +++ head/etc/mtree/BSD.debug.dist Fri Feb 26 22:19:39 2016 (r296130) > @@ -15,8 +15,6 @@ > lib > geom > .. > - casper > - .. > .. > libexec > .. > I think we do want this though. The casper libraries are installed to /lib/casper. -- Regards, Bryan Drewery From owner-svn-src-head@freebsd.org Fri Feb 26 22:25:19 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 59D6EAB42BA; Fri, 26 Feb 2016 22:25:19 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id 4C1A7D1; Fri, 26 Feb 2016 22:25:19 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [IPv6:::1]) by freefall.freebsd.org (Postfix) with ESMTP id 44029117B; Fri, 26 Feb 2016 22:25:19 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [172.31.3.2]) by mail.xzibition.com (Postfix) with ESMTP id F019A14211; Fri, 26 Feb 2016 22:25:18 +0000 (UTC) X-Virus-Scanned: amavisd-new at mail.xzibition.com Received: from mail.xzibition.com ([172.31.3.2]) by mail.xzibition.com (mail.xzibition.com [172.31.3.2]) (amavisd-new, port 10026) with LMTP id YgNrEBCNuQv5; Fri, 26 Feb 2016 22:25:16 +0000 (UTC) Subject: Re: svn commit: r296124 - in head: share/man/man7 share/mk sys/conf DKIM-Filter: OpenDKIM Filter v2.9.2 mail.xzibition.com 4627F14209 To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201602262214.u1QME0oM033474@repo.freebsd.org> <56D0CF75.9050306@FreeBSD.org> From: Bryan Drewery Organization: FreeBSD Message-ID: <56D0D0CE.6000603@FreeBSD.org> Date: Fri, 26 Feb 2016 14:25:18 -0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: <56D0CF75.9050306@FreeBSD.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Feb 2016 22:25:19 -0000 On 2/26/16 2:19 PM, Bryan Drewery wrote: > On 2/26/16 2:14 PM, Bryan Drewery wrote: >> Author: bdrewery >> Date: Fri Feb 26 22:14:00 2016 >> New Revision: 296124 >> URL: https://svnweb.freebsd.org/changeset/base/296124 >> >> Log: >> Import bsd.clang-analyze.mk based on NetBSD's version. >> >> This allows 'make analyze' or 'make OBJ.clang-analyzer' to run the >> Clang static analyzer and present results on stdout. >> >> Obtained from: NetBSD (CVS Rev. 1.3) >> Sponsored by: EMC / Isilon Storage Division >> Differential Revision: https://reviews.freebsd.org/D5449 >> > > I just wanted to call special attention to this one. You may find it > useful to run in something you maintain. scan-build can achieve the > same thing but this one is at least built-in and dependency-free. > > It doesn't work for the kernel yet. > Though it does work in modules! -- Regards, Bryan Drewery From owner-svn-src-head@freebsd.org Fri Feb 26 22:25:36 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9E050AB4300; Fri, 26 Feb 2016 22:25:36 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 72C7827A; Fri, 26 Feb 2016 22:25:36 +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 u1QMPZjp036785; Fri, 26 Feb 2016 22:25:35 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1QMPZ3L036784; Fri, 26 Feb 2016 22:25:35 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201602262225.u1QMPZ3L036784@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 26 Feb 2016 22:25:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r296131 - head/etc/mtree X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Feb 2016 22:25:36 -0000 Author: emaste Date: Fri Feb 26 22:25:35 2016 New Revision: 296131 URL: https://svnweb.freebsd.org/changeset/base/296131 Log: Restore lib/casper debug directory, reverting r296130 Reported by: bdrewery Pointy hat to: emaste Modified: head/etc/mtree/BSD.debug.dist Modified: head/etc/mtree/BSD.debug.dist ============================================================================== --- head/etc/mtree/BSD.debug.dist Fri Feb 26 22:19:39 2016 (r296130) +++ head/etc/mtree/BSD.debug.dist Fri Feb 26 22:25:35 2016 (r296131) @@ -15,6 +15,8 @@ lib geom .. + casper + .. .. libexec .. From owner-svn-src-head@freebsd.org Fri Feb 26 23:13:00 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 53CA9AB55D8; Fri, 26 Feb 2016 23:13:00 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 283351959; Fri, 26 Feb 2016 23:13:00 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1QNCxvn050894; Fri, 26 Feb 2016 23:12:59 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1QNCx3o050893; Fri, 26 Feb 2016 23:12:59 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201602262312.u1QNCx3o050893@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Fri, 26 Feb 2016 23:12:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r296132 - head/usr.sbin/pciconf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Feb 2016 23:13:00 -0000 Author: pfg Date: Fri Feb 26 23:12:59 2016 New Revision: 296132 URL: https://svnweb.freebsd.org/changeset/base/296132 Log: pciconf: Silence a GCC warning. Fix the build on sparc64 and powerpc. Taken from: wma Modified: head/usr.sbin/pciconf/cap.c Modified: head/usr.sbin/pciconf/cap.c ============================================================================== --- head/usr.sbin/pciconf/cap.c Fri Feb 26 22:25:35 2016 (r296131) +++ head/usr.sbin/pciconf/cap.c Fri Feb 26 23:12:59 2016 (r296132) @@ -535,7 +535,7 @@ cap_pciaf(int fd, struct pci_conf *p, ui } static const char * -ea_bei_to_name(uint8_t bei) +ea_bei_to_name(int bei) { static const char *barstr[] = { "BAR0", "BAR1", "BAR2", "BAR3", "BAR4", "BAR5" From owner-svn-src-head@freebsd.org Fri Feb 26 23:25:23 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4C8B7AB5B01; Fri, 26 Feb 2016 23:25:23 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F35BFFB; Fri, 26 Feb 2016 23:25:22 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1QNPMUa054023; Fri, 26 Feb 2016 23:25:22 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1QNPL76054020; Fri, 26 Feb 2016 23:25:21 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201602262325.u1QNPL76054020@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Fri, 26 Feb 2016 23:25:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r296133 - in head: include/rpc lib/libc/rpc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Feb 2016 23:25:23 -0000 Author: pfg Date: Fri Feb 26 23:25:21 2016 New Revision: 296133 URL: https://svnweb.freebsd.org/changeset/base/296133 Log: RPC: update the getrpcbyname() definition to include a const qualifier. Add const qualifier making getrpcbyname() and getrpcbyname_r() prototypes match those used in latest Sun RPC code (TI-RPC 2.3). Obtained from: NetBSD Modified: head/include/rpc/rpcent.h head/lib/libc/rpc/getrpcent.3 head/lib/libc/rpc/getrpcent.c Modified: head/include/rpc/rpcent.h ============================================================================== --- head/include/rpc/rpcent.h Fri Feb 26 23:12:59 2016 (r296132) +++ head/include/rpc/rpcent.h Fri Feb 26 23:25:21 2016 (r296133) @@ -56,7 +56,7 @@ __BEGIN_DECLS * These interfaces are currently implemented through nsswitch and are * MT-safe. */ -extern struct rpcent *getrpcbyname(char *); +extern struct rpcent *getrpcbyname(const char *); extern struct rpcent *getrpcbynumber(int); extern struct rpcent *getrpcent(void); extern void setrpcent(int); Modified: head/lib/libc/rpc/getrpcent.3 ============================================================================== --- head/lib/libc/rpc/getrpcent.3 Fri Feb 26 23:12:59 2016 (r296132) +++ head/lib/libc/rpc/getrpcent.3 Fri Feb 26 23:25:21 2016 (r296133) @@ -2,7 +2,7 @@ .\" $NetBSD: getrpcent.3,v 1.6 1998/02/05 18:49:06 perry Exp $ .\" $FreeBSD$ .\" -.Dd December 14, 1987 +.Dd February 26, 2016 .Dt GETRPCENT 3 .Os .Sh NAME @@ -19,7 +19,7 @@ .Ft struct rpcent * .Fn getrpcent void .Ft struct rpcent * -.Fn getrpcbyname "char *name" +.Fn getrpcbyname "const char *name" .Ft struct rpcent * .Fn getrpcbynumber "int number" .Ft void Modified: head/lib/libc/rpc/getrpcent.c ============================================================================== --- head/lib/libc/rpc/getrpcent.c Fri Feb 26 23:12:59 2016 (r296132) +++ head/lib/libc/rpc/getrpcent.c Fri Feb 26 23:25:21 2016 (r296133) @@ -969,7 +969,7 @@ getrpc(int (*fn)(union key, struct rpcen } struct rpcent * -getrpcbyname(char *name) +getrpcbyname(const char *name) { union key key; From owner-svn-src-head@freebsd.org Sat Feb 27 01:07:45 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C498AAB6166; Sat, 27 Feb 2016 01:07:45 +0000 (UTC) (envelope-from baptiste.daroussin@gmail.com) Received: from mail-wm0-x234.google.com (mail-wm0-x234.google.com [IPv6:2a00:1450:400c:c09::234]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5C4DD120B; Sat, 27 Feb 2016 01:07:45 +0000 (UTC) (envelope-from baptiste.daroussin@gmail.com) Received: by mail-wm0-x234.google.com with SMTP id g62so90588711wme.0; Fri, 26 Feb 2016 17:07:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=/iYEuA+bXNzrz7vq7HRjQHSPqS4Ke3Ihl/TH+9Y2HGg=; b=rkA5Tc2/Q2FP2iO5M27NpQzzMuf++ID1r9GEsIA9BUpeysq0KGveoGKNfMBPkzIx7S bz35KBPRSPGnt5DBNWcp1Erxdww6q7K0x7StTF4Yc4cvdr8bb6uCmXKqUDDLK+06Cy9a WM7NGF/VGi4Zop2t9djD9RPYeuoJvpApopBG+Q042NZ6jBin9XWFySefNOgd3YYZo5x+ 49pd/gefxSw6iuTVEfBXW9bm9ORoi7Ny51TUgMgpcKQJxZxj0IK6rKNBUwTlsPz7cwFz sq2823jcbEPTZxfw3AjXcinY4fen8j8bc9u5XcUxTrEYpYDliErO7FQqmk7MdREnKlZu EIwQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=/iYEuA+bXNzrz7vq7HRjQHSPqS4Ke3Ihl/TH+9Y2HGg=; b=dgLGjYKuxNujnQRKzEXEwEDp9db4mW1nruCpwqSgEx5CChhHgCLmN/F8Sl4AOaOFF6 vI0sUeAMKMH4LMNkKKvtlXvatn5wQV2xabU37wnHL/7D+h4UK69lY1bG1nf5sx5jwgzs a0SceMQ/yRW8VXGXRV02HWXaQj5r5Sg+diLkYKG8Ei+9feFg9RZRyTnKQBgZ9LPAItNc OfxTt2ForXY/Q96pKvZVaxkDrs1JedTxpJX/T5mHgMIDYlZVN2R7B+QvU933+D9581VB DPrNtpSIQeabp5zhfEMDYPK4iyLQI4ehgRaDdq/LanBFQ8yIoTfXOLcmawhCCUwQoIVU oNzA== X-Gm-Message-State: AD7BkJL70zhSa7VYZDqynlaQ/NvARUXegEF0uiaDl5YOKGunkSuLFrVNT65U1d7POmMKHg== X-Received: by 10.28.103.11 with SMTP id b11mr579472wmc.81.1456535262873; Fri, 26 Feb 2016 17:07:42 -0800 (PST) Received: from ivaldir.etoilebsd.net ([2001:41d0:8:db4c::1]) by smtp.gmail.com with ESMTPSA id qs1sm14586506wjc.2.2016.02.26.17.07.41 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 26 Feb 2016 17:07:42 -0800 (PST) Sender: Baptiste Daroussin Date: Sat, 27 Feb 2016 02:07:40 +0100 From: Baptiste Daroussin To: "Pedro F. Giffuni" Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r296104 - head/libexec/getty Message-ID: <20160227010739.GA84995@ivaldir.etoilebsd.net> References: <201602261852.u1QIq6vf073975@repo.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="n8g4imXOkfNTN/H1" Content-Disposition: inline In-Reply-To: <201602261852.u1QIq6vf073975@repo.freebsd.org> User-Agent: Mutt/1.5.24 (2015-08-30) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Feb 2016 01:07:45 -0000 --n8g4imXOkfNTN/H1 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Feb 26, 2016 at 06:52:06PM +0000, Pedro F. Giffuni wrote: > Author: pfg > Date: Fri Feb 26 18:52:06 2016 > New Revision: 296104 > URL: https://svnweb.freebsd.org/changeset/base/296104 >=20 > Log: > getty(8): Use poll(2) and nanosleep(2) instead of select(2). > =20 > Sort headers while here. > =20 > Obtained from: NetBSD (CVS Rev. 1.25 - 1.26) >=20 > Modified: > head/libexec/getty/subr.c >=20 > Modified: head/libexec/getty/subr.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/libexec/getty/subr.c Fri Feb 26 16:18:47 2016 (r296103) > +++ head/libexec/getty/subr.c Fri Feb 26 18:52:06 2016 (r296104) > @@ -38,14 +38,16 @@ static const char rcsid[] =3D > /* > * Melbourne getty. > */ > -#include > -#include > -#include > -#include > #include > #include > #include > + > +#include > +#include > +#include > #include > +#include > +#include > =20 > #include "gettytab.h" > #include "pathnames.h" > @@ -633,24 +635,21 @@ portselector(void) > const char * > autobaud(void) > { > - int rfds; > - struct timeval timeout; > +struct pollfd set[1]; Indentation issue here Bapt --n8g4imXOkfNTN/H1 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJW0PbbAAoJEGOJi9zxtz5aPvQP/2ME+Y7Dkpw/R/haGfQJ/iSH b7a4e15UvCip8KxzlBJuQoKwnPoZxuomijD9JyUGie3g8LDHH0cVNvntniriJmwx n+rLf7wbiCYdmMrxwbxSZoRDdVfdxfLPS2NxC8HIMIMWl00GlxE0fe44iqZXk9a0 pJvoCqWXW6T6Y0xRFhKGkPlTZB2BWk2EUK4c3ulW5F3JZ9fBLPvLLmEXOw4XsNjb sAJ7K8TZ2k6ivV//ig409s7wC85KsWeb8dbGTJ+t51zf/nADHcc+5AzEHVetpnlW 1G8pOSofvut/ocM8k2Ks/h3zfXq2R5AJK5iLSM7AWgv16uaxS6I3cI3RiXwzGuYd puBpNcS3/6aZMuOtDSeylECdI/mtNG2TcDkVXpS3aBP8DHVBrDbeA+qOyycA3GRL Ed2AQgsZ8spbSLotGk3+AZcG7ZuO9PgS4shx0mHdzd6qBZApoXl/SrIIP8YWNId0 9IOZZrBBbg/N1kUVLw/Nz3YF9VWvXWqah9u+JqsVhr0O0n5xFXOa2LusA0ILAEJX /EWwftszeJLL9wDr5tB4MNhAFA8BQKMTdu4dnTEO0g9K3kB1m5rC0jIAhRqaEw10 0NGgSesIYN7mVD0cYAvFdBospPVElKUebi5XzFtXh+n52Hmahrc/5uNkFaDvNgXD 4N+aLn8XPN9Yy1uEnjEF =EJTa -----END PGP SIGNATURE----- --n8g4imXOkfNTN/H1-- From owner-svn-src-head@freebsd.org Sat Feb 27 02:11:01 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C3D03AB5A38; Sat, 27 Feb 2016 02:11:01 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 94CD51095; Sat, 27 Feb 2016 02:11:01 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1R2B0R5003094; Sat, 27 Feb 2016 02:11:00 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1R2B00H003093; Sat, 27 Feb 2016 02:11:00 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201602270211.u1R2B00H003093@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Sat, 27 Feb 2016 02:11:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r296134 - head/libexec/getty X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Feb 2016 02:11:01 -0000 Author: pfg Date: Sat Feb 27 02:11:00 2016 New Revision: 296134 URL: https://svnweb.freebsd.org/changeset/base/296134 Log: Missing tab. Pointed out by: bapt Modified: head/libexec/getty/subr.c Modified: head/libexec/getty/subr.c ============================================================================== --- head/libexec/getty/subr.c Fri Feb 26 23:25:21 2016 (r296133) +++ head/libexec/getty/subr.c Sat Feb 27 02:11:00 2016 (r296134) @@ -635,7 +635,7 @@ portselector(void) const char * autobaud(void) { -struct pollfd set[1]; + struct pollfd set[1]; struct timespec timeout; char c; const char *type = "9600-baud"; From owner-svn-src-head@freebsd.org Sat Feb 27 03:34:04 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 384FAAB27DC; Sat, 27 Feb 2016 03:34:04 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 153CC15B7; Sat, 27 Feb 2016 03:34:04 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1R3Y3o1027035; Sat, 27 Feb 2016 03:34:03 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1R3Y27V027024; Sat, 27 Feb 2016 03:34:02 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201602270334.u1R3Y27V027024@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Sat, 27 Feb 2016 03:34:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r296135 - in head/sys/dev: amdsbwd arcmsr hpt27xx hptmv hptnr hptrr sdhci sound/pci tws X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Feb 2016 03:34:04 -0000 Author: jhibbits Date: Sat Feb 27 03:34:01 2016 New Revision: 296135 URL: https://svnweb.freebsd.org/changeset/base/296135 Log: Replace several bus_alloc_resource() calls with bus_alloc_resource_any() Most of these are BARs, and we allocate them in their entirety. The one outlier in this is amdsbwd, which calls bus_set_resource() prior. Reviewed by: jhb Differential Revision: https://reviews.freebsd.org/D5370 (partial) Modified: head/sys/dev/amdsbwd/amdsbwd.c head/sys/dev/arcmsr/arcmsr.c head/sys/dev/hpt27xx/hpt27xx_os_bsd.c head/sys/dev/hptmv/entry.c head/sys/dev/hptnr/hptnr_os_bsd.c head/sys/dev/hptrr/hptrr_os_bsd.c head/sys/dev/sdhci/sdhci_pci.c head/sys/dev/sound/pci/als4000.c head/sys/dev/sound/pci/cs4281.c head/sys/dev/sound/pci/vibes.c head/sys/dev/tws/tws.c Modified: head/sys/dev/amdsbwd/amdsbwd.c ============================================================================== --- head/sys/dev/amdsbwd/amdsbwd.c Sat Feb 27 02:11:00 2016 (r296134) +++ head/sys/dev/amdsbwd/amdsbwd.c Sat Feb 27 03:34:01 2016 (r296135) @@ -395,8 +395,8 @@ amdsbwd_probe(device_t dev) return (ENXIO); } rid = 0; - res = bus_alloc_resource(dev, SYS_RES_IOPORT, &rid, 0ul, ~0ul, - AMDSB_PMIO_WIDTH, RF_ACTIVE | RF_SHAREABLE); + res = bus_alloc_resource_any(dev, SYS_RES_IOPORT, &rid, + RF_ACTIVE | RF_SHAREABLE); if (res == NULL) { device_printf(dev, "bus_alloc_resource for IO failed\n"); return (ENXIO); Modified: head/sys/dev/arcmsr/arcmsr.c ============================================================================== --- head/sys/dev/arcmsr/arcmsr.c Sat Feb 27 02:11:00 2016 (r296134) +++ head/sys/dev/arcmsr/arcmsr.c Sat Feb 27 03:34:01 2016 (r296135) @@ -4143,7 +4143,7 @@ static u_int32_t arcmsr_initialize(devic u_int32_t rid0 = PCIR_BAR(0); vm_offset_t mem_base0; - acb->sys_res_arcmsr[0] = bus_alloc_resource(dev,SYS_RES_MEMORY, &rid0, 0ul, ~0ul, 0x1000, RF_ACTIVE); + acb->sys_res_arcmsr[0] = bus_alloc_resource_any(dev,SYS_RES_MEMORY, &rid0, RF_ACTIVE); if(acb->sys_res_arcmsr[0] == NULL) { arcmsr_free_resource(acb); printf("arcmsr%d: bus_alloc_resource failure!\n", device_get_unit(dev)); @@ -4177,11 +4177,11 @@ static u_int32_t arcmsr_initialize(devic size = sizeof(struct HBB_DOORBELL); for(i=0; i < 2; i++) { if(i == 0) { - acb->sys_res_arcmsr[i] = bus_alloc_resource(dev,SYS_RES_MEMORY, &rid[i], - 0ul, ~0ul, size, RF_ACTIVE); + acb->sys_res_arcmsr[i] = bus_alloc_resource_any(dev,SYS_RES_MEMORY, &rid[i], + RF_ACTIVE); } else { - acb->sys_res_arcmsr[i] = bus_alloc_resource(dev, SYS_RES_MEMORY, &rid[i], - 0ul, ~0ul, sizeof(struct HBB_RWBUFFER), RF_ACTIVE); + acb->sys_res_arcmsr[i] = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid[i], + RF_ACTIVE); } if(acb->sys_res_arcmsr[i] == NULL) { arcmsr_free_resource(acb); @@ -4224,7 +4224,7 @@ static u_int32_t arcmsr_initialize(devic u_int32_t rid0 = PCIR_BAR(1); vm_offset_t mem_base0; - acb->sys_res_arcmsr[0] = bus_alloc_resource(dev,SYS_RES_MEMORY, &rid0, 0ul, ~0ul, sizeof(struct HBC_MessageUnit), RF_ACTIVE); + acb->sys_res_arcmsr[0] = bus_alloc_resource_any(dev,SYS_RES_MEMORY, &rid0, RF_ACTIVE); if(acb->sys_res_arcmsr[0] == NULL) { arcmsr_free_resource(acb); printf("arcmsr%d: bus_alloc_resource failure!\n", device_get_unit(dev)); @@ -4251,7 +4251,7 @@ static u_int32_t arcmsr_initialize(devic u_int32_t rid0 = PCIR_BAR(0); vm_offset_t mem_base0; - acb->sys_res_arcmsr[0] = bus_alloc_resource(dev,SYS_RES_MEMORY, &rid0, 0ul, ~0ul, sizeof(struct HBD_MessageUnit), RF_ACTIVE); + acb->sys_res_arcmsr[0] = bus_alloc_resource_any(dev,SYS_RES_MEMORY, &rid0, RF_ACTIVE); if(acb->sys_res_arcmsr[0] == NULL) { arcmsr_free_resource(acb); printf("arcmsr%d: bus_alloc_resource failure!\n", device_get_unit(dev)); Modified: head/sys/dev/hpt27xx/hpt27xx_os_bsd.c ============================================================================== --- head/sys/dev/hpt27xx/hpt27xx_os_bsd.c Sat Feb 27 02:11:00 2016 (r296134) +++ head/sys/dev/hpt27xx/hpt27xx_os_bsd.c Sat Feb 27 03:34:01 2016 (r296135) @@ -120,13 +120,13 @@ void *os_map_pci_bar( if (base & 1) { hba->pcibar[index].type = SYS_RES_IOPORT; - hba->pcibar[index].res = bus_alloc_resource(hba->pcidev, - hba->pcibar[index].type, &hba->pcibar[index].rid, 0, ~0, length, RF_ACTIVE); + hba->pcibar[index].res = bus_alloc_resource_any(hba->pcidev, + hba->pcibar[index].type, &hba->pcibar[index].rid, RF_ACTIVE); hba->pcibar[index].base = (void *)(unsigned long)(base & ~0x1); } else { hba->pcibar[index].type = SYS_RES_MEMORY; - hba->pcibar[index].res = bus_alloc_resource(hba->pcidev, - hba->pcibar[index].type, &hba->pcibar[index].rid, 0, ~0, length, RF_ACTIVE); + hba->pcibar[index].res = bus_alloc_resource_any(hba->pcidev, + hba->pcibar[index].type, &hba->pcibar[index].rid, RF_ACTIVE); hba->pcibar[index].base = (char *)rman_get_virtual(hba->pcibar[index].res) + offset; } Modified: head/sys/dev/hptmv/entry.c ============================================================================== --- head/sys/dev/hptmv/entry.c Sat Feb 27 02:11:00 2016 (r296134) +++ head/sys/dev/hptmv/entry.c Sat Feb 27 03:34:01 2016 (r296135) @@ -1304,8 +1304,8 @@ init_adapter(IAL_ADAPTER_T *pAdapter) /* also map EPROM address */ rid = 0x10; - if (!(pAdapter->mem_res = bus_alloc_resource(pAdapter->hpt_dev, SYS_RES_MEMORY, &rid, - 0, ~0, MV_SATA_PCI_BAR0_SPACE_SIZE+0x40000, RF_ACTIVE)) + if (!(pAdapter->mem_res = bus_alloc_resource_any(pAdapter->hpt_dev, + SYS_RES_MEMORY, &rid, RF_ACTIVE)) || !(pMvSataAdapter->adapterIoBaseAddress = rman_get_virtual(pAdapter->mem_res))) { Modified: head/sys/dev/hptnr/hptnr_os_bsd.c ============================================================================== --- head/sys/dev/hptnr/hptnr_os_bsd.c Sat Feb 27 02:11:00 2016 (r296134) +++ head/sys/dev/hptnr/hptnr_os_bsd.c Sat Feb 27 03:34:01 2016 (r296135) @@ -106,13 +106,13 @@ void *os_map_pci_bar( if (base & 1) { hba->pcibar[index].type = SYS_RES_IOPORT; - hba->pcibar[index].res = bus_alloc_resource(hba->pcidev, - hba->pcibar[index].type, &hba->pcibar[index].rid, 0, ~0, length, RF_ACTIVE); + hba->pcibar[index].res = bus_alloc_resource_any(hba->pcidev, + hba->pcibar[index].type, &hba->pcibar[index].rid, RF_ACTIVE); hba->pcibar[index].base = (void *)(unsigned long)(base & ~0x1); } else { hba->pcibar[index].type = SYS_RES_MEMORY; - hba->pcibar[index].res = bus_alloc_resource(hba->pcidev, - hba->pcibar[index].type, &hba->pcibar[index].rid, 0, ~0, length, RF_ACTIVE); + hba->pcibar[index].res = bus_alloc_resource_any(hba->pcidev, + hba->pcibar[index].type, &hba->pcibar[index].rid, RF_ACTIVE); hba->pcibar[index].base = (char *)rman_get_virtual(hba->pcibar[index].res) + offset; } Modified: head/sys/dev/hptrr/hptrr_os_bsd.c ============================================================================== --- head/sys/dev/hptrr/hptrr_os_bsd.c Sat Feb 27 02:11:00 2016 (r296134) +++ head/sys/dev/hptrr/hptrr_os_bsd.c Sat Feb 27 03:34:01 2016 (r296135) @@ -98,8 +98,8 @@ void *os_map_pci_bar( else hba->pcibar[index].type = SYS_RES_MEMORY; - hba->pcibar[index].res = bus_alloc_resource(hba->pcidev, - hba->pcibar[index].type, &hba->pcibar[index].rid, 0, ~0, length, RF_ACTIVE); + hba->pcibar[index].res = bus_alloc_resource_any(hba->pcidev, + hba->pcibar[index].type, &hba->pcibar[index].rid, RF_ACTIVE); hba->pcibar[index].base = (char *)rman_get_virtual(hba->pcibar[index].res) + offset; return hba->pcibar[index].base; Modified: head/sys/dev/sdhci/sdhci_pci.c ============================================================================== --- head/sys/dev/sdhci/sdhci_pci.c Sat Feb 27 02:11:00 2016 (r296134) +++ head/sys/dev/sdhci/sdhci_pci.c Sat Feb 27 03:34:01 2016 (r296135) @@ -330,8 +330,8 @@ sdhci_pci_attach(device_t dev) /* Allocate memory. */ rid = PCIR_BAR(bar + i); - sc->mem_res[i] = bus_alloc_resource(dev, SYS_RES_MEMORY, - &rid, 0ul, ~0ul, 0x100, RF_ACTIVE); + sc->mem_res[i] = bus_alloc_resource_any(dev, SYS_RES_MEMORY, + &rid, RF_ACTIVE); if (sc->mem_res[i] == NULL) { device_printf(dev, "Can't allocate memory for slot %d\n", i); continue; Modified: head/sys/dev/sound/pci/als4000.c ============================================================================== --- head/sys/dev/sound/pci/als4000.c Sat Feb 27 02:11:00 2016 (r296134) +++ head/sys/dev/sound/pci/als4000.c Sat Feb 27 03:34:01 2016 (r296135) @@ -760,8 +760,8 @@ static int als_resource_grab(device_t dev, struct sc_info *sc) { sc->regid = PCIR_BAR(0); - sc->reg = bus_alloc_resource(dev, SYS_RES_IOPORT, &sc->regid, 0, ~0, - ALS_CONFIG_SPACE_BYTES, RF_ACTIVE); + sc->reg = bus_alloc_resource_any(dev, SYS_RES_IOPORT, &sc->regid, + RF_ACTIVE); if (sc->reg == 0) { device_printf(dev, "unable to allocate register space\n"); goto bad; Modified: head/sys/dev/sound/pci/cs4281.c ============================================================================== --- head/sys/dev/sound/pci/cs4281.c Sat Feb 27 02:11:00 2016 (r296134) +++ head/sys/dev/sound/pci/cs4281.c Sat Feb 27 03:34:01 2016 (r296135) @@ -778,12 +778,11 @@ cs4281_pci_attach(device_t dev) sc->regid = PCIR_BAR(0); sc->regtype = SYS_RES_MEMORY; - sc->reg = bus_alloc_resource(dev, sc->regtype, &sc->regid, - 0, ~0, CS4281PCI_BA0_SIZE, RF_ACTIVE); + sc->reg = bus_alloc_resource_any(dev, sc->regtype, &sc->regid, RF_ACTIVE); if (!sc->reg) { sc->regtype = SYS_RES_IOPORT; - sc->reg = bus_alloc_resource(dev, sc->regtype, &sc->regid, - 0, ~0, CS4281PCI_BA0_SIZE, RF_ACTIVE); + sc->reg = bus_alloc_resource_any(dev, sc->regtype, &sc->regid, + RF_ACTIVE); if (!sc->reg) { device_printf(dev, "unable to allocate register space\n"); goto bad; @@ -793,8 +792,8 @@ cs4281_pci_attach(device_t dev) sc->sh = rman_get_bushandle(sc->reg); sc->memid = PCIR_BAR(1); - sc->mem = bus_alloc_resource(dev, SYS_RES_MEMORY, &sc->memid, 0, - ~0, CS4281PCI_BA1_SIZE, RF_ACTIVE); + sc->mem = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &sc->memid, + RF_ACTIVE); if (sc->mem == NULL) { device_printf(dev, "unable to allocate fifo space\n"); goto bad; Modified: head/sys/dev/sound/pci/vibes.c ============================================================================== --- head/sys/dev/sound/pci/vibes.c Sat Feb 27 02:11:00 2016 (r296134) +++ head/sys/dev/sound/pci/vibes.c Sat Feb 27 03:34:01 2016 (r296135) @@ -738,9 +738,8 @@ sv_attach(device_t dev) { } sc->enh_rid = SV_PCI_ENHANCED; sc->enh_type = SYS_RES_IOPORT; - sc->enh_reg = bus_alloc_resource(dev, sc->enh_type, - &sc->enh_rid, 0, ~0, - SV_PCI_ENHANCED_SIZE, RF_ACTIVE); + sc->enh_reg = bus_alloc_resource_any(dev, sc->enh_type, + &sc->enh_rid, RF_ACTIVE); if (sc->enh_reg == NULL) { device_printf(dev, "sv_attach: cannot allocate enh\n"); return ENXIO; @@ -831,9 +830,8 @@ sv_attach(device_t dev) { /* Cache resource short-cuts for dma_a */ sc->dmaa_rid = SV_PCI_DMAA; sc->dmaa_type = SYS_RES_IOPORT; - sc->dmaa_reg = bus_alloc_resource(dev, sc->dmaa_type, - &sc->dmaa_rid, 0, ~0, - SV_PCI_ENHANCED_SIZE, RF_ACTIVE); + sc->dmaa_reg = bus_alloc_resource_any(dev, sc->dmaa_type, + &sc->dmaa_rid, RF_ACTIVE); if (sc->dmaa_reg == NULL) { device_printf(dev, "sv_attach: cannot allocate dmaa\n"); goto fail; @@ -850,9 +848,8 @@ sv_attach(device_t dev) { /* Cache resource short-cuts for dma_c */ sc->dmac_rid = SV_PCI_DMAC; sc->dmac_type = SYS_RES_IOPORT; - sc->dmac_reg = bus_alloc_resource(dev, sc->dmac_type, - &sc->dmac_rid, 0, ~0, - SV_PCI_ENHANCED_SIZE, RF_ACTIVE); + sc->dmac_reg = bus_alloc_resource_any(dev, sc->dmac_type, + &sc->dmac_rid, RF_ACTIVE); if (sc->dmac_reg == NULL) { device_printf(dev, "sv_attach: cannot allocate dmac\n"); goto fail; Modified: head/sys/dev/tws/tws.c ============================================================================== --- head/sys/dev/tws/tws.c Sat Feb 27 02:11:00 2016 (r296134) +++ head/sys/dev/tws/tws.c Sat Feb 27 03:34:01 2016 (r296135) @@ -257,8 +257,8 @@ tws_attach(device_t dev) #ifndef TWS_PULL_MODE_ENABLE /* Allocate bus space for inbound mfa */ sc->mfa_res_id = TWS_PCI_BAR2; /* BAR2 offset */ - if ((sc->mfa_res = bus_alloc_resource(dev, SYS_RES_MEMORY, - &(sc->mfa_res_id), 0, ~0, 0x100000, RF_ACTIVE)) + if ((sc->mfa_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, + &(sc->mfa_res_id), RF_ACTIVE)) == NULL) { tws_log(sc, ALLOC_MEMORY_RES); goto attach_fail_2; From owner-svn-src-head@freebsd.org Sat Feb 27 03:35:30 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1FB91AB28AF; Sat, 27 Feb 2016 03:35:30 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D1304180B; Sat, 27 Feb 2016 03:35:29 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1R3ZSNQ027133; Sat, 27 Feb 2016 03:35:28 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1R3ZSPX027130; Sat, 27 Feb 2016 03:35:28 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201602270335.u1R3ZSPX027130@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Sat, 27 Feb 2016 03:35:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r296136 - in head: share/man/man9 sys/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Feb 2016 03:35:30 -0000 Author: jhibbits Date: Sat Feb 27 03:35:28 2016 New Revision: 296136 URL: https://svnweb.freebsd.org/changeset/base/296136 Log: Add the bus_alloc_resource_anywhere() convenience function. Summary: Many instances of bus_alloc_resource() simply use 0 and ~0 for start and end to denote 'anywhere' with a given count. To clean this up, introduce a bus_alloc_resource_anywhere() convenience function. Bump __FreeBSD_version for the new API. Reviewed By: jhb Differential Revision: https://reviews.freebsd.org/D5370 Modified: head/share/man/man9/bus_alloc_resource.9 head/sys/sys/bus.h head/sys/sys/param.h Modified: head/share/man/man9/bus_alloc_resource.9 ============================================================================== --- head/share/man/man9/bus_alloc_resource.9 Sat Feb 27 03:34:01 2016 (r296135) +++ head/share/man/man9/bus_alloc_resource.9 Sat Feb 27 03:35:28 2016 (r296136) @@ -34,6 +34,7 @@ .Sh NAME .Nm bus_alloc_resource , .Nm bus_alloc_resource_any +.Nm bus_alloc_resource_anywhere .Nd allocate resources from a parent bus .Sh SYNOPSIS .In sys/param.h @@ -49,6 +50,10 @@ .Fc .Ft struct resource * .Fn bus_alloc_resource_any "device_t dev" "int type" "int *rid" "u_int flags" +.Fc +.Ft struct resource * +.Fn bus_alloc_resource_anywhere +.Fa "device_t dev" "int type" "int *rid" "rman_res_t count" "u_int flags" .Sh DESCRIPTION This is an easy interface to the resource-management functions. It hides the indirection through the parent's method table. @@ -57,9 +62,12 @@ rare cases) never earlier. .Pp The .Fn bus_alloc_resource_any -function is a convenience wrapper for +and +.Fn bus_alloc_resource_anywhere +functions are convenience wrappers for .Fn bus_alloc_resource . -It sets the values for +.Fn bus_alloc_resource_any +sets .Fa start , .Fa end , and @@ -67,6 +75,14 @@ and to the default resource (see description of .Fa start below). +.Fn bus_alloc_resource_anywhere +sets +.Fa start +and +.Fa end +to the default resource and uses the provided +.Fa count +argument. .Pp The arguments are as follows: .Bl -item Modified: head/sys/sys/bus.h ============================================================================== --- head/sys/sys/bus.h Sat Feb 27 03:34:01 2016 (r296135) +++ head/sys/sys/bus.h Sat Feb 27 03:35:28 2016 (r296136) @@ -481,6 +481,13 @@ bus_alloc_resource_any(device_t dev, int return (bus_alloc_resource(dev, type, rid, 0ul, ~0ul, 1, flags)); } +static __inline struct resource * +bus_alloc_resource_anywhere(device_t dev, int type, int *rid, + rman_res_t count, u_int flags) +{ + return (bus_alloc_resource(dev, type, rid, 0ul, ~0ul, count, flags)); +} + /* * Access functions for device. */ Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Sat Feb 27 03:34:01 2016 (r296135) +++ head/sys/sys/param.h Sat Feb 27 03:35:28 2016 (r296136) @@ -58,7 +58,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1100099 /* Master, propagated to newvers */ +#define __FreeBSD_version 1100100 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-head@freebsd.org Sat Feb 27 03:38:08 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 816AEAB296F; Sat, 27 Feb 2016 03:38:08 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 26D141A07; Sat, 27 Feb 2016 03:38:08 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1R3c7Hf027304; Sat, 27 Feb 2016 03:38:07 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1R3c2vN027253; Sat, 27 Feb 2016 03:38:02 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201602270338.u1R3c2vN027253@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Sat, 27 Feb 2016 03:38:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r296137 - in head/sys: arm/xscale/i8134x dev/aac dev/aacraid dev/aha dev/aic dev/an dev/ata dev/cm dev/cs dev/ct dev/digi dev/ed dev/fdc dev/fe dev/ichsmb dev/if_ndis dev/iicbus dev/le ... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Feb 2016 03:38:08 -0000 Author: jhibbits Date: Sat Feb 27 03:38:01 2016 New Revision: 296137 URL: https://svnweb.freebsd.org/changeset/base/296137 Log: Migrate many bus_alloc_resource() calls to bus_alloc_resource_anywhere(). Most calls to bus_alloc_resource() use "anywhere" as the range, with a given count. Migrate these to use the new bus_alloc_resource_anywhere() API. Reviewed by: jhb Differential Revision: https://reviews.freebsd.org/D5370 Modified: head/sys/arm/xscale/i8134x/uart_bus_i81342.c head/sys/dev/aac/aac.c head/sys/dev/aacraid/aacraid.c head/sys/dev/aha/aha_isa.c head/sys/dev/aic/aic_isa.c head/sys/dev/aic/aic_pccard.c head/sys/dev/an/if_an.c head/sys/dev/ata/ata-card.c head/sys/dev/ata/ata-cbus.c head/sys/dev/ata/ata-isa.c head/sys/dev/cm/if_cm_isa.c head/sys/dev/cs/if_cs.c head/sys/dev/ct/ct_isa.c head/sys/dev/digi/digi_isa.c head/sys/dev/ed/if_ed.c head/sys/dev/fdc/fdc_isa.c head/sys/dev/fe/if_fe.c head/sys/dev/ichsmb/ichsmb_pci.c head/sys/dev/if_ndis/if_ndis_pccard.c head/sys/dev/iicbus/iicoc.c head/sys/dev/le/if_le_isa.c head/sys/dev/mse/mse_isa.c head/sys/dev/nsp/nsp_pccard.c head/sys/dev/oce/oce_hw.c head/sys/dev/pbio/pbio.c head/sys/dev/pccard/pccard.c head/sys/dev/pccard/pccard_cis.c head/sys/dev/pci/pci_pci.c head/sys/dev/ppc/ppc.c head/sys/dev/rc/rc.c head/sys/dev/rp/rp_isa.c head/sys/dev/sbni/if_sbni_isa.c head/sys/dev/scc/scc_core.c head/sys/dev/si/si_isa.c head/sys/dev/sio/sio.c head/sys/dev/smc/if_smc.c head/sys/dev/sn/if_sn.c head/sys/dev/snc/if_snc.c head/sys/dev/snc/if_snc_cbus.c head/sys/dev/sound/isa/gusc.c head/sys/dev/sound/isa/mss.c head/sys/dev/sound/isa/sbc.c head/sys/dev/wi/if_wi.c head/sys/dev/wl/if_wl.c head/sys/dev/xe/if_xe.c head/sys/i386/isa/spic.c head/sys/netgraph/bluetooth/drivers/bt3c/ng_bt3c_pccard.c head/sys/pc98/cbus/sio.c Modified: head/sys/arm/xscale/i8134x/uart_bus_i81342.c ============================================================================== --- head/sys/arm/xscale/i8134x/uart_bus_i81342.c Sat Feb 27 03:35:28 2016 (r296136) +++ head/sys/arm/xscale/i8134x/uart_bus_i81342.c Sat Feb 27 03:38:01 2016 (r296137) @@ -74,8 +74,8 @@ uart_i81342_probe(device_t dev) sc->sc_sysdev = SLIST_FIRST(&uart_sysdevs); bcopy(&sc->sc_sysdev->bas, &sc->sc_bas, sizeof(sc->sc_bas)); } - sc->sc_rres = bus_alloc_resource(dev, SYS_RES_IOPORT, &sc->sc_rrid, - 0, ~0, uart_getrange(sc->sc_class), RF_ACTIVE); + sc->sc_rres = bus_alloc_resource_anywhere(dev, SYS_RES_IOPORT, + &sc->sc_rrid, uart_getrange(sc->sc_class), RF_ACTIVE); sc->sc_bas.bsh = rman_get_bushandle(sc->sc_rres); sc->sc_bas.bst = rman_get_bustag(sc->sc_rres); Modified: head/sys/dev/aac/aac.c ============================================================================== --- head/sys/dev/aac/aac.c Sat Feb 27 03:35:28 2016 (r296136) +++ head/sys/dev/aac/aac.c Sat Feb 27 03:38:01 2016 (r296137) @@ -1780,8 +1780,8 @@ aac_check_firmware(struct aac_softc *sc) rid = rman_get_rid(sc->aac_regs_res1); bus_release_resource(sc->aac_dev, SYS_RES_MEMORY, rid, sc->aac_regs_res1); - sc->aac_regs_res1 = bus_alloc_resource(sc->aac_dev, - SYS_RES_MEMORY, &rid, 0ul, ~0ul, atu_size, RF_ACTIVE); + sc->aac_regs_res1 = bus_alloc_resource_anywhere(sc->aac_dev, + SYS_RES_MEMORY, &rid, atu_size, RF_ACTIVE); if (sc->aac_regs_res1 == NULL) { sc->aac_regs_res1 = bus_alloc_resource_any( sc->aac_dev, SYS_RES_MEMORY, &rid, RF_ACTIVE); Modified: head/sys/dev/aacraid/aacraid.c ============================================================================== --- head/sys/dev/aacraid/aacraid.c Sat Feb 27 03:35:28 2016 (r296136) +++ head/sys/dev/aacraid/aacraid.c Sat Feb 27 03:38:01 2016 (r296137) @@ -1663,9 +1663,9 @@ aac_check_firmware(struct aac_softc *sc) bus_release_resource( sc->aac_dev, SYS_RES_MEMORY, sc->aac_regs_rid0, sc->aac_regs_res0); - sc->aac_regs_res0 = bus_alloc_resource( + sc->aac_regs_res0 = bus_alloc_resource_anywhere( sc->aac_dev, SYS_RES_MEMORY, &sc->aac_regs_rid0, - 0ul, ~0ul, atu_size, RF_ACTIVE); + atu_size, RF_ACTIVE); if (sc->aac_regs_res0 == NULL) { sc->aac_regs_res0 = bus_alloc_resource_any( sc->aac_dev, SYS_RES_MEMORY, Modified: head/sys/dev/aha/aha_isa.c ============================================================================== --- head/sys/dev/aha/aha_isa.c Sat Feb 27 03:35:28 2016 (r296136) +++ head/sys/dev/aha/aha_isa.c Sat Feb 27 03:38:01 2016 (r296137) @@ -120,8 +120,8 @@ aha_isa_probe(device_t dev) return (ENXIO); port_rid = 0; - aha->port = bus_alloc_resource(dev, SYS_RES_IOPORT, &port_rid, - 0ul, ~0ul, AHA_NREGS, RF_ACTIVE); + aha->port = bus_alloc_resource_anywhere(dev, SYS_RES_IOPORT, &port_rid, + AHA_NREGS, RF_ACTIVE); if (aha->port == NULL) return (ENXIO); @@ -191,8 +191,8 @@ aha_isa_attach(device_t dev) aha->dev = dev; aha->portrid = 0; - aha->port = bus_alloc_resource(dev, SYS_RES_IOPORT, &aha->portrid, - 0ul, ~0ul, AHA_NREGS, RF_ACTIVE); + aha->port = bus_alloc_resource_anywhere(dev, SYS_RES_IOPORT, + &aha->portrid, AHA_NREGS, RF_ACTIVE); if (!aha->port) { device_printf(dev, "Unable to allocate I/O ports\n"); goto fail; Modified: head/sys/dev/aic/aic_isa.c ============================================================================== --- head/sys/dev/aic/aic_isa.c Sat Feb 27 03:35:28 2016 (r296136) +++ head/sys/dev/aic/aic_isa.c Sat Feb 27 03:38:01 2016 (r296137) @@ -75,8 +75,8 @@ aic_isa_alloc_resources(device_t dev) sc->sc_port = sc->sc_irq = sc->sc_drq = NULL; rid = 0; - sc->sc_port = bus_alloc_resource(dev, SYS_RES_IOPORT, &rid, - 0ul, ~0ul, AIC_ISA_PORTSIZE, RF_ACTIVE); + sc->sc_port = bus_alloc_resource_anywhere(dev, SYS_RES_IOPORT, &rid, + AIC_ISA_PORTSIZE, RF_ACTIVE); if (!sc->sc_port) { device_printf(dev, "I/O port allocation failed\n"); return (ENOMEM); Modified: head/sys/dev/aic/aic_pccard.c ============================================================================== --- head/sys/dev/aic/aic_pccard.c Sat Feb 27 03:35:28 2016 (r296136) +++ head/sys/dev/aic/aic_pccard.c Sat Feb 27 03:38:01 2016 (r296137) @@ -77,8 +77,8 @@ aic_pccard_alloc_resources(device_t dev) sc->sc_port = sc->sc_irq = NULL; rid = 0; - sc->sc_port = bus_alloc_resource(dev, SYS_RES_IOPORT, &rid, - 0ul, ~0ul, AIC_PCCARD_PORTSIZE, RF_ACTIVE); + sc->sc_port = bus_alloc_resource_anywhere(dev, SYS_RES_IOPORT, &rid, + AIC_PCCARD_PORTSIZE, RF_ACTIVE); if (!sc->sc_port) return (ENOMEM); Modified: head/sys/dev/an/if_an.c ============================================================================== --- head/sys/dev/an/if_an.c Sat Feb 27 03:35:28 2016 (r296136) +++ head/sys/dev/an/if_an.c Sat Feb 27 03:38:01 2016 (r296137) @@ -394,8 +394,8 @@ an_alloc_port(device_t dev, int rid, int struct an_softc *sc = device_get_softc(dev); struct resource *res; - res = bus_alloc_resource(dev, SYS_RES_IOPORT, &rid, - 0ul, ~0ul, size, RF_ACTIVE); + res = bus_alloc_resource_anywhere(dev, SYS_RES_IOPORT, &rid, + size, RF_ACTIVE); if (res) { sc->port_rid = rid; sc->port_res = res; @@ -413,8 +413,8 @@ int an_alloc_memory(device_t dev, int ri struct an_softc *sc = device_get_softc(dev); struct resource *res; - res = bus_alloc_resource(dev, SYS_RES_MEMORY, &rid, - 0ul, ~0ul, size, RF_ACTIVE); + res = bus_alloc_resource_anywhere(dev, SYS_RES_MEMORY, &rid, + size, RF_ACTIVE); if (res) { sc->mem_rid = rid; sc->mem_res = res; @@ -433,8 +433,8 @@ int an_alloc_aux_memory(device_t dev, in struct an_softc *sc = device_get_softc(dev); struct resource *res; - res = bus_alloc_resource(dev, SYS_RES_MEMORY, &rid, - 0ul, ~0ul, size, RF_ACTIVE); + res = bus_alloc_resource_anywhere(dev, SYS_RES_MEMORY, &rid, + size, RF_ACTIVE); if (res) { sc->mem_aux_rid = rid; sc->mem_aux_res = res; Modified: head/sys/dev/ata/ata-card.c ============================================================================== --- head/sys/dev/ata/ata-card.c Sat Feb 27 03:35:28 2016 (r296136) +++ head/sys/dev/ata/ata-card.c Sat Feb 27 03:38:01 2016 (r296137) @@ -98,8 +98,8 @@ ata_pccard_attach(device_t dev) /* allocate the io range to get start and length */ rid = ATA_IOADDR_RID; - if (!(io = bus_alloc_resource(dev, SYS_RES_IOPORT, &rid, 0, ~0, - ATA_IOSIZE, RF_ACTIVE))) + if (!(io = bus_alloc_resource_anywhere(dev, SYS_RES_IOPORT, &rid, + ATA_IOSIZE, RF_ACTIVE))) return (ENXIO); /* setup the resource vectors */ @@ -119,8 +119,8 @@ ata_pccard_attach(device_t dev) } else { rid = ATA_CTLADDR_RID; - if (!(ctlio = bus_alloc_resource(dev, SYS_RES_IOPORT, &rid, 0, ~0, - ATA_CTLIOSIZE, RF_ACTIVE))) { + if (!(ctlio = bus_alloc_resource_anywhere(dev, SYS_RES_IOPORT, &rid, + ATA_CTLIOSIZE, RF_ACTIVE))) { bus_release_resource(dev, SYS_RES_IOPORT, ATA_IOADDR_RID, io); for (i = ATA_DATA; i < ATA_MAX_RES; i++) ch->r_io[i].res = NULL; Modified: head/sys/dev/ata/ata-cbus.c ============================================================================== --- head/sys/dev/ata/ata-cbus.c Sat Feb 27 03:35:28 2016 (r296136) +++ head/sys/dev/ata/ata-cbus.c Sat Feb 27 03:38:01 2016 (r296137) @@ -75,8 +75,8 @@ ata_cbus_probe(device_t dev) /* allocate the ioport range */ rid = ATA_IOADDR_RID; - if (!(io = bus_alloc_resource(dev, SYS_RES_IOPORT, &rid, 0, ~0, - ATA_PC98_IOSIZE, RF_ACTIVE))) + if (!(io = bus_alloc_resource_anywhere(dev, SYS_RES_IOPORT, &rid, + ATA_PC98_IOSIZE, RF_ACTIVE))) return ENOMEM; /* calculate & set the altport range */ @@ -106,8 +106,8 @@ ata_cbus_attach(device_t dev) /* allocate resources */ rid = ATA_IOADDR_RID; - if (!(ctlr->io = bus_alloc_resource(dev, SYS_RES_IOPORT, &rid, 0, ~0, - ATA_PC98_IOSIZE, RF_ACTIVE))) + if (!(ctlr->io = bus_alloc_resource_anywhere(dev, SYS_RES_IOPORT, &rid, + ATA_PC98_IOSIZE, RF_ACTIVE))) return ENOMEM; rid = ATA_PC98_CTLADDR_RID; Modified: head/sys/dev/ata/ata-isa.c ============================================================================== --- head/sys/dev/ata/ata-isa.c Sat Feb 27 03:35:28 2016 (r296136) +++ head/sys/dev/ata/ata-isa.c Sat Feb 27 03:38:01 2016 (r296137) @@ -69,8 +69,8 @@ ata_isa_probe(device_t dev) /* allocate the io port range */ rid = ATA_IOADDR_RID; - if (!(io = bus_alloc_resource(dev, SYS_RES_IOPORT, &rid, 0, ~0, - ATA_IOSIZE, RF_ACTIVE))) + if (!(io = bus_alloc_resource_anywhere(dev, SYS_RES_IOPORT, &rid, + ATA_IOSIZE, RF_ACTIVE))) return ENXIO; /* set the altport range */ @@ -81,8 +81,8 @@ ata_isa_probe(device_t dev) /* allocate the altport range */ rid = ATA_CTLADDR_RID; - if (!(ctlio = bus_alloc_resource(dev, SYS_RES_IOPORT, &rid, 0, ~0, - ATA_CTLIOSIZE, RF_ACTIVE))) { + if (!(ctlio = bus_alloc_resource_anywhere(dev, SYS_RES_IOPORT, &rid, + ATA_CTLIOSIZE, RF_ACTIVE))) { bus_release_resource(dev, SYS_RES_IOPORT, ATA_IOADDR_RID, io); return ENXIO; } @@ -109,8 +109,8 @@ ata_isa_attach(device_t dev) /* allocate the io port range */ rid = ATA_IOADDR_RID; - if (!(io = bus_alloc_resource(dev, SYS_RES_IOPORT, &rid, 0, ~0, - ATA_IOSIZE, RF_ACTIVE))) + if (!(io = bus_alloc_resource_anywhere(dev, SYS_RES_IOPORT, &rid, + ATA_IOSIZE, RF_ACTIVE))) return ENXIO; /* set the altport range */ @@ -121,8 +121,8 @@ ata_isa_attach(device_t dev) /* allocate the altport range */ rid = ATA_CTLADDR_RID; - if (!(ctlio = bus_alloc_resource(dev, SYS_RES_IOPORT, &rid, 0, ~0, - ATA_CTLIOSIZE, RF_ACTIVE))) { + if (!(ctlio = bus_alloc_resource_anywhere(dev, SYS_RES_IOPORT, &rid, + ATA_CTLIOSIZE, RF_ACTIVE))) { bus_release_resource(dev, SYS_RES_IOPORT, ATA_IOADDR_RID, io); return ENXIO; } Modified: head/sys/dev/cm/if_cm_isa.c ============================================================================== --- head/sys/dev/cm/if_cm_isa.c Sat Feb 27 03:35:28 2016 (r296136) +++ head/sys/dev/cm/if_cm_isa.c Sat Feb 27 03:38:01 2016 (r296137) @@ -63,8 +63,8 @@ cm_isa_probe(dev) int rid; rid = 0; - sc->port_res = bus_alloc_resource( - dev, SYS_RES_IOPORT, &rid, 0ul, ~0ul, CM_IO_PORTS, RF_ACTIVE); + sc->port_res = bus_alloc_resource_anywhere( + dev, SYS_RES_IOPORT, &rid, CM_IO_PORTS, RF_ACTIVE); if (sc->port_res == NULL) return (ENOENT); @@ -74,8 +74,8 @@ cm_isa_probe(dev) } rid = 0; - sc->mem_res = bus_alloc_resource( - dev, SYS_RES_MEMORY, &rid, 0ul, ~0ul, CM_MEM_SIZE, RF_ACTIVE); + sc->mem_res = bus_alloc_resource_anywhere( + dev, SYS_RES_MEMORY, &rid, CM_MEM_SIZE, RF_ACTIVE); if (sc->mem_res == NULL) { cm_release_resources(dev); return (ENOENT); Modified: head/sys/dev/cs/if_cs.c ============================================================================== --- head/sys/dev/cs/if_cs.c Sat Feb 27 03:35:28 2016 (r296136) +++ head/sys/dev/cs/if_cs.c Sat Feb 27 03:38:01 2016 (r296137) @@ -406,8 +406,8 @@ cs_alloc_port(device_t dev, int rid, int struct cs_softc *sc = device_get_softc(dev); struct resource *res; - res = bus_alloc_resource(dev, SYS_RES_IOPORT, &rid, - 0ul, ~0ul, size, RF_ACTIVE); + res = bus_alloc_resource_anywhere(dev, SYS_RES_IOPORT, &rid, + size, RF_ACTIVE); if (res == NULL) return (ENOENT); sc->port_rid = rid; Modified: head/sys/dev/ct/ct_isa.c ============================================================================== --- head/sys/dev/ct/ct_isa.c Sat Feb 27 03:35:28 2016 (r296136) +++ head/sys/dev/ct/ct_isa.c Sat Feb 27 03:38:01 2016 (r296137) @@ -318,8 +318,8 @@ ct_space_map(device_t dev, struct bshw * *memhp = NULL; port_rid = 0; - *iohp = bus_alloc_resource(dev, SYS_RES_IOPORT, &port_rid, 0ul, ~0ul, - BSHW_IOSZ, RF_ACTIVE); + *iohp = bus_alloc_resource_anywhere(dev, SYS_RES_IOPORT, &port_rid, + BSHW_IOSZ, RF_ACTIVE); if (*iohp == NULL) return ENXIO; @@ -327,8 +327,8 @@ ct_space_map(device_t dev, struct bshw * return 0; mem_rid = 0; - *memhp = bus_alloc_resource(dev, SYS_RES_MEMORY, &mem_rid, 0ul, ~0ul, - BSHW_MEMSZ, RF_ACTIVE); + *memhp = bus_alloc_resource_anywhere(dev, SYS_RES_MEMORY, &mem_rid, + BSHW_MEMSZ, RF_ACTIVE); if (*memhp == NULL) { bus_release_resource(dev, SYS_RES_IOPORT, port_rid, *iohp); return ENXIO; Modified: head/sys/dev/digi/digi_isa.c ============================================================================== --- head/sys/dev/digi/digi_isa.c Sat Feb 27 03:35:28 2016 (r296136) +++ head/sys/dev/digi/digi_isa.c Sat Feb 27 03:38:01 2016 (r296137) @@ -277,8 +277,8 @@ digi_isa_probe(device_t dev) /* Temporarily map our io ports */ sc->res.iorid = 0; - sc->res.io = bus_alloc_resource(dev, SYS_RES_IOPORT, &sc->res.iorid, - 0ul, ~0ul, IO_SIZE, RF_ACTIVE); + sc->res.io = bus_alloc_resource_anywhere(dev, SYS_RES_IOPORT, + &sc->res.iorid, IO_SIZE, RF_ACTIVE); if (sc->res.io == NULL) return (ENXIO); @@ -291,8 +291,8 @@ digi_isa_probe(device_t dev) /* Temporarily map our memory */ sc->res.mrid = 0; - sc->res.mem = bus_alloc_resource(dev, SYS_RES_MEMORY, &sc->res.mrid, - 0ul, ~0ul, sc->win_size, 0); + sc->res.mem = bus_alloc_resource_anywhere(dev, SYS_RES_MEMORY, + &sc->res.mrid, sc->win_size, 0); if (sc->res.mem == NULL) { device_printf(dev, "0x%lx: Memory range is in use\n", sc->pmem); bus_release_resource(dev, SYS_RES_IOPORT, sc->res.iorid, @@ -342,8 +342,8 @@ digi_isa_attach(device_t dev) /* Allocate resources (verified in digi_isa_probe()) */ sc->res.iorid = 0; - sc->res.io = bus_alloc_resource(dev, SYS_RES_IOPORT, &sc->res.iorid, - 0ul, ~0ul, iosize, RF_ACTIVE); + sc->res.io = bus_alloc_resource_anywhere(dev, SYS_RES_IOPORT, + &sc->res.iorid, iosize, RF_ACTIVE); if (sc->res.io == NULL) return (ENXIO); @@ -356,8 +356,8 @@ digi_isa_attach(device_t dev) callout_handle_init(&sc->inttest); sc->res.mrid = 0; - sc->res.mem = bus_alloc_resource(dev, SYS_RES_MEMORY, &sc->res.mrid, - 0ul, ~0ul, msize, RF_ACTIVE); + sc->res.mem = bus_alloc_resource_anywhere(dev, SYS_RES_MEMORY, + &sc->res.mrid, msize, RF_ACTIVE); if (sc->res.mem == NULL) { device_printf(dev, "0x%lx: Memory range is in use\n", sc->pmem); sc->hidewin(sc); Modified: head/sys/dev/ed/if_ed.c ============================================================================== --- head/sys/dev/ed/if_ed.c Sat Feb 27 03:35:28 2016 (r296136) +++ head/sys/dev/ed/if_ed.c Sat Feb 27 03:38:01 2016 (r296137) @@ -164,8 +164,8 @@ ed_alloc_port(device_t dev, int rid, int struct ed_softc *sc = device_get_softc(dev); struct resource *res; - res = bus_alloc_resource(dev, SYS_RES_IOPORT, &rid, - 0ul, ~0ul, size, RF_ACTIVE); + res = bus_alloc_resource_anywhere(dev, SYS_RES_IOPORT, &rid, + size, RF_ACTIVE); if (res) { sc->port_res = res; sc->port_used = size; @@ -185,8 +185,8 @@ ed_alloc_memory(device_t dev, int rid, i struct ed_softc *sc = device_get_softc(dev); struct resource *res; - res = bus_alloc_resource(dev, SYS_RES_MEMORY, &rid, - 0ul, ~0ul, size, RF_ACTIVE); + res = bus_alloc_resource_anywhere(dev, SYS_RES_MEMORY, &rid, + size, RF_ACTIVE); if (res) { sc->mem_res = res; sc->mem_used = size; Modified: head/sys/dev/fdc/fdc_isa.c ============================================================================== --- head/sys/dev/fdc/fdc_isa.c Sat Feb 27 03:35:28 2016 (r296136) +++ head/sys/dev/fdc/fdc_isa.c Sat Feb 27 03:38:01 2016 (r296137) @@ -89,8 +89,8 @@ fdc_isa_alloc_resources(device_t dev, st nport = isa_get_logicalid(dev) ? 1 : 6; for (rid = 0; ; rid++) { newrid = rid; - res = bus_alloc_resource(dev, SYS_RES_IOPORT, &newrid, - 0ul, ~0ul, rid == 0 ? nport : 1, RF_ACTIVE); + res = bus_alloc_resource_anywhere(dev, SYS_RES_IOPORT, &newrid, + rid == 0 ? nport : 1, RF_ACTIVE); if (res == NULL) break; /* Modified: head/sys/dev/fe/if_fe.c ============================================================================== --- head/sys/dev/fe/if_fe.c Sat Feb 27 03:35:28 2016 (r296136) +++ head/sys/dev/fe/if_fe.c Sat Feb 27 03:38:01 2016 (r296137) @@ -881,8 +881,8 @@ fe_alloc_port(device_t dev, int size) int rid; rid = 0; - res = bus_alloc_resource(dev, SYS_RES_IOPORT, &rid, - 0ul, ~0ul, size, RF_ACTIVE); + res = bus_alloc_resource_anywhere(dev, SYS_RES_IOPORT, &rid, + size, RF_ACTIVE); if (res) { sc->port_used = size; sc->port_res = res; Modified: head/sys/dev/ichsmb/ichsmb_pci.c ============================================================================== --- head/sys/dev/ichsmb/ichsmb_pci.c Sat Feb 27 03:35:28 2016 (r296136) +++ head/sys/dev/ichsmb/ichsmb_pci.c Sat Feb 27 03:38:01 2016 (r296137) @@ -241,11 +241,11 @@ ichsmb_pci_attach(device_t dev) /* Allocate an I/O range */ sc->io_rid = ICH_SMB_BASE; - sc->io_res = bus_alloc_resource(dev, SYS_RES_IOPORT, - &sc->io_rid, 0, ~0, 16, RF_ACTIVE); + sc->io_res = bus_alloc_resource_anywhere(dev, SYS_RES_IOPORT, + &sc->io_rid, 16, RF_ACTIVE); if (sc->io_res == NULL) - sc->io_res = bus_alloc_resource(dev, SYS_RES_IOPORT, - &sc->io_rid, 0ul, ~0ul, 32, RF_ACTIVE); + sc->io_res = bus_alloc_resource_anywhere(dev, SYS_RES_IOPORT, + &sc->io_rid, 32, RF_ACTIVE); if (sc->io_res == NULL) { device_printf(dev, "can't map I/O\n"); error = ENXIO; Modified: head/sys/dev/if_ndis/if_ndis_pccard.c ============================================================================== --- head/sys/dev/if_ndis/if_ndis_pccard.c Sat Feb 27 03:35:28 2016 (r296136) +++ head/sys/dev/if_ndis/if_ndis_pccard.c Sat Feb 27 03:38:01 2016 (r296137) @@ -280,8 +280,8 @@ ndis_alloc_amem(arg) sc = arg; rid = NDIS_AM_RID; - sc->ndis_res_am = bus_alloc_resource(sc->ndis_dev, SYS_RES_MEMORY, - &rid, 0UL, ~0UL, 0x1000, RF_ACTIVE); + sc->ndis_res_am = bus_alloc_resource_anywhere(sc->ndis_dev, + SYS_RES_MEMORY, &rid, 0x1000, RF_ACTIVE); if (sc->ndis_res_am == NULL) { device_printf(sc->ndis_dev, Modified: head/sys/dev/iicbus/iicoc.c ============================================================================== --- head/sys/dev/iicbus/iicoc.c Sat Feb 27 03:35:28 2016 (r296136) +++ head/sys/dev/iicbus/iicoc.c Sat Feb 27 03:38:01 2016 (r296137) @@ -207,8 +207,8 @@ iicoc_attach(device_t dev) sc->dev = dev; mtx_init(&sc->sc_mtx, "iicoc", "iicoc", MTX_DEF); sc->mem_rid = 0; - sc->mem_res = bus_alloc_resource(dev, - SYS_RES_MEMORY, &sc->mem_rid, 0ul, ~0ul, 0x100, RF_ACTIVE); + sc->mem_res = bus_alloc_resource_anywhere(dev, + SYS_RES_MEMORY, &sc->mem_rid, 0x100, RF_ACTIVE); if (sc->mem_res == NULL) { device_printf(dev, "Could not allocate bus resource.\n"); Modified: head/sys/dev/le/if_le_isa.c ============================================================================== --- head/sys/dev/le/if_le_isa.c Sat Feb 27 03:35:28 2016 (r296136) +++ head/sys/dev/le/if_le_isa.c Sat Feb 27 03:38:01 2016 (r296137) @@ -209,7 +209,7 @@ le_isa_probe_legacy(device_t dev, const sc = &lesc->sc_am7990.lsc; i = 0; - lesc->sc_rres = bus_alloc_resource(dev, SYS_RES_IOPORT, &i, 0, ~0, + lesc->sc_rres = bus_alloc_resource_anywhere(dev, SYS_RES_IOPORT, &i, leip->iosize, RF_ACTIVE); if (lesc->sc_rres == NULL) return (ENXIO); @@ -282,8 +282,8 @@ le_isa_attach(device_t dev) for (i = 0; i < sizeof(le_isa_params) / sizeof(le_isa_params[0]); i++) { if (le_isa_probe_legacy(dev, &le_isa_params[i]) == 0) { - lesc->sc_rres = bus_alloc_resource(dev, - SYS_RES_IOPORT, &j, 0, ~0, + lesc->sc_rres = bus_alloc_resource_anywhere(dev, + SYS_RES_IOPORT, &j, le_isa_params[i].iosize, RF_ACTIVE); rap = le_isa_params[i].rap; rdp = le_isa_params[i].rdp; Modified: head/sys/dev/mse/mse_isa.c ============================================================================== --- head/sys/dev/mse/mse_isa.c Sat Feb 27 03:35:28 2016 (r296136) +++ head/sys/dev/mse/mse_isa.c Sat Feb 27 03:38:01 2016 (r296137) @@ -206,8 +206,8 @@ mse_isa_probe(device_t dev) sc = device_get_softc(dev); rid = 0; - sc->sc_port = bus_alloc_resource(dev, SYS_RES_IOPORT, &rid, 0, ~0, - MSE_IOSIZE, RF_ACTIVE); + sc->sc_port = bus_alloc_resource_anywhere(dev, SYS_RES_IOPORT, &rid, + MSE_IOSIZE, RF_ACTIVE); if (sc->sc_port == NULL) return ENXIO; @@ -243,8 +243,8 @@ mse_isa_attach(device_t dev) sc = device_get_softc(dev); rid = 0; - sc->sc_port = bus_alloc_resource(dev, SYS_RES_IOPORT, &rid, 0, ~0, - MSE_IOSIZE, RF_ACTIVE); + sc->sc_port = bus_alloc_resource_anywhere(dev, SYS_RES_IOPORT, &rid, + MSE_IOSIZE, RF_ACTIVE); if (sc->sc_port == NULL) return ENXIO; Modified: head/sys/dev/nsp/nsp_pccard.c ============================================================================== --- head/sys/dev/nsp/nsp_pccard.c Sat Feb 27 03:35:28 2016 (r296136) +++ head/sys/dev/nsp/nsp_pccard.c Sat Feb 27 03:38:01 2016 (r296137) @@ -124,8 +124,9 @@ nsp_alloc_resource(device_t dev) mtx_init(&sc->sc_sclow.sl_lock, "nsp", NULL, MTX_DEF); sc->port_rid = 0; - sc->port_res = bus_alloc_resource(dev, SYS_RES_IOPORT, &sc->port_rid, - 0, ~0, NSP_IOSIZE, RF_ACTIVE); + sc->port_res = bus_alloc_resource_anywhere(dev, SYS_RES_IOPORT, + &sc->port_rid, NSP_IOSIZE, + RF_ACTIVE); if (sc->port_res == NULL) { nsp_release_resource(dev); return(ENOMEM); Modified: head/sys/dev/oce/oce_hw.c ============================================================================== --- head/sys/dev/oce/oce_hw.c Sat Feb 27 03:35:28 2016 (r296136) +++ head/sys/dev/oce/oce_hw.c Sat Feb 27 03:38:01 2016 (r296137) @@ -268,9 +268,8 @@ oce_hw_pci_alloc(POCE_SOFTC sc) SYS_RES_MEMORY, &rr, RF_ACTIVE|RF_SHAREABLE); else - sc->devcfg_res = bus_alloc_resource(sc->dev, - SYS_RES_MEMORY, &rr, - 0ul, ~0ul, 32768, + sc->devcfg_res = bus_alloc_resource_anywhere(sc->dev, + SYS_RES_MEMORY, &rr, 32768, RF_ACTIVE|RF_SHAREABLE); if (!sc->devcfg_res) Modified: head/sys/dev/pbio/pbio.c ============================================================================== --- head/sys/dev/pbio/pbio.c Sat Feb 27 03:35:28 2016 (r296136) +++ head/sys/dev/pbio/pbio.c Sat Feb 27 03:38:01 2016 (r296137) @@ -170,8 +170,8 @@ pbioprobe(device_t dev) if (isa_get_logicalid(dev)) /* skip PnP probes */ return (ENXIO); rid = 0; - scp->res = bus_alloc_resource(dev, SYS_RES_IOPORT, &rid, - 0, ~0, IO_PBIOSIZE, RF_ACTIVE); + scp->res = bus_alloc_resource_anywhere(dev, SYS_RES_IOPORT, &rid, + IO_PBIOSIZE, RF_ACTIVE); if (scp->res == NULL) return (ENXIO); @@ -225,8 +225,8 @@ pbioattach (device_t dev) sc = device_get_softc(dev); unit = device_get_unit(dev); rid = 0; - sc->res = bus_alloc_resource(dev, SYS_RES_IOPORT, &rid, - 0, ~0, IO_PBIOSIZE, RF_ACTIVE); + sc->res = bus_alloc_resource_anywhere(dev, SYS_RES_IOPORT, &rid, + IO_PBIOSIZE, RF_ACTIVE); if (sc->res == NULL) return (ENXIO); sc->bst = rman_get_bustag(sc->res); Modified: head/sys/dev/pccard/pccard.c ============================================================================== --- head/sys/dev/pccard/pccard.c Sat Feb 27 03:35:28 2016 (r296136) +++ head/sys/dev/pccard/pccard.c Sat Feb 27 03:38:01 2016 (r296137) @@ -693,8 +693,8 @@ pccard_function_enable(struct pccard_fun } if (tmp == NULL) { pf->ccr_rid = 0; - pf->ccr_res = bus_alloc_resource(dev, SYS_RES_MEMORY, - &pf->ccr_rid, 0, ~0, PCCARD_MEM_PAGE_SIZE, RF_ACTIVE); + pf->ccr_res = bus_alloc_resource_anywhere(dev, SYS_RES_MEMORY, + &pf->ccr_rid, PCCARD_MEM_PAGE_SIZE, RF_ACTIVE); if (!pf->ccr_res) goto bad; DEVPRINTF((dev, "ccr_res == %#lx-%#lx, base=%#x\n", Modified: head/sys/dev/pccard/pccard_cis.c ============================================================================== --- head/sys/dev/pccard/pccard_cis.c Sat Feb 27 03:35:28 2016 (r296136) +++ head/sys/dev/pccard/pccard_cis.c Sat Feb 27 03:38:01 2016 (r296137) @@ -140,7 +140,7 @@ pccard_scan_cis(device_t bus, device_t d * would make cards work better, but it is easy enough to test. */ rid = 0; - res = bus_alloc_resource(dev, SYS_RES_MEMORY, &rid, 0, ~0, + res = bus_alloc_resource_anywhere(dev, SYS_RES_MEMORY, &rid, PCCARD_CIS_SIZE, RF_ACTIVE | rman_make_alignment_flags(64*1024)); if (res == NULL) { device_printf(dev, "can't alloc memory to read attributes\n"); Modified: head/sys/dev/pci/pci_pci.c ============================================================================== --- head/sys/dev/pci/pci_pci.c Sat Feb 27 03:35:28 2016 (r296136) +++ head/sys/dev/pci/pci_pci.c Sat Feb 27 03:38:01 2016 (r296137) @@ -577,14 +577,14 @@ pcib_setup_secbus(device_t dev, struct p * if one exists, or a new bus range if one does not. */ rid = 0; - bus->res = bus_alloc_resource(dev, PCI_RES_BUS, &rid, 0ul, ~0ul, + bus->res = bus_alloc_resource_anywhere(dev, PCI_RES_BUS, &rid, min_count, 0); if (bus->res == NULL) { /* * Fall back to just allocating a range of a single bus * number. */ - bus->res = bus_alloc_resource(dev, PCI_RES_BUS, &rid, 0ul, ~0ul, + bus->res = bus_alloc_resource_anywhere(dev, PCI_RES_BUS, &rid, 1, 0); } else if (rman_get_size(bus->res) < min_count) /* Modified: head/sys/dev/ppc/ppc.c ============================================================================== --- head/sys/dev/ppc/ppc.c Sat Feb 27 03:35:28 2016 (r296136) +++ head/sys/dev/ppc/ppc.c Sat Feb 27 03:38:01 2016 (r296137) @@ -1721,19 +1721,21 @@ ppc_probe(device_t dev, int rid) /* IO port is mandatory */ /* Try "extended" IO port range...*/ - ppc->res_ioport = bus_alloc_resource(dev, SYS_RES_IOPORT, - &ppc->rid_ioport, 0, ~0, - IO_LPTSIZE_EXTENDED, RF_ACTIVE); + ppc->res_ioport = bus_alloc_resource_anywhere(dev, SYS_RES_IOPORT, + &ppc->rid_ioport, + IO_LPTSIZE_EXTENDED, + RF_ACTIVE); if (ppc->res_ioport != 0) { if (bootverbose) device_printf(dev, "using extended I/O port range\n"); } else { /* Failed? If so, then try the "normal" IO port range... */ - ppc->res_ioport = bus_alloc_resource(dev, SYS_RES_IOPORT, - &ppc->rid_ioport, 0, ~0, - IO_LPTSIZE_NORMAL, - RF_ACTIVE); + ppc->res_ioport = bus_alloc_resource_anywhere(dev, + SYS_RES_IOPORT, + &ppc->rid_ioport, + IO_LPTSIZE_NORMAL, + RF_ACTIVE); if (ppc->res_ioport != 0) { if (bootverbose) device_printf(dev, "using normal I/O port range\n"); Modified: head/sys/dev/rc/rc.c ============================================================================== --- head/sys/dev/rc/rc.c Sat Feb 27 03:35:28 2016 (r296136) +++ head/sys/dev/rc/rc.c Sat Feb 27 03:38:01 2016 (r296137) @@ -242,8 +242,8 @@ rc_attach(device_t dev) error = ENOMEM; for (i = 0; i < IOBASE_ADDRS; i++) { x = i; - sc->sc_port[i] = bus_alloc_resource(dev, SYS_RES_IOPORT, &x, - 0ul, ~0ul, 0x10, RF_ACTIVE); + sc->sc_port[i] = bus_alloc_resource_anywhere(dev, + SYS_RES_IOPORT, &x, 0x10, RF_ACTIVE); if (x != i) { device_printf(dev, "ioport %d was rid %d\n", i, x); goto fail; Modified: head/sys/dev/rp/rp_isa.c ============================================================================== --- head/sys/dev/rp/rp_isa.c Sat Feb 27 03:35:28 2016 (r296136) +++ head/sys/dev/rp/rp_isa.c Sat Feb 27 03:38:01 2016 (r296137) @@ -194,10 +194,10 @@ rp_probe(device_t dev) ctlp->io_rid[0] = 0; if (rp_controller != NULL) { controller = rp_controller; - ctlp->io[0] = bus_alloc_resource(dev, SYS_RES_IOPORT, &ctlp->io_rid[0], 0, ~0, 0x40, RF_ACTIVE); + ctlp->io[0] = bus_alloc_resource_anywhere(dev, SYS_RES_IOPORT, &ctlp->io_rid[0], 0x40, RF_ACTIVE); } else { controller = rp_controller = ctlp; - ctlp->io[0] = bus_alloc_resource(dev, SYS_RES_IOPORT, &ctlp->io_rid[0], 0, ~0, 0x44, RF_ACTIVE); + ctlp->io[0] = bus_alloc_resource_anywhere(dev, SYS_RES_IOPORT, &ctlp->io_rid[0], 0x44, RF_ACTIVE); } if (ctlp->io[0] == NULL) { device_printf(dev, "rp_attach: Resource not available.\n"); Modified: head/sys/dev/sbni/if_sbni_isa.c ============================================================================== --- head/sys/dev/sbni/if_sbni_isa.c Sat Feb 27 03:35:28 2016 (r296136) +++ head/sys/dev/sbni/if_sbni_isa.c Sat Feb 27 03:38:01 2016 (r296137) @@ -86,8 +86,9 @@ sbni_probe_isa(device_t dev) sc = device_get_softc(dev); - sc->io_res = bus_alloc_resource(dev, SYS_RES_IOPORT, &sc->io_rid, - 0ul, ~0ul, SBNI_PORTS, RF_ACTIVE); + sc->io_res = bus_alloc_resource_anywhere(dev, SYS_RES_IOPORT, + &sc->io_rid, SBNI_PORTS, + RF_ACTIVE); if (!sc->io_res) { printf("sbni: cannot allocate io ports!\n"); return (ENOENT); Modified: head/sys/dev/scc/scc_core.c ============================================================================== --- head/sys/dev/scc/scc_core.c Sat Feb 27 03:35:28 2016 (r296136) +++ head/sys/dev/scc/scc_core.c Sat Feb 27 03:38:01 2016 (r296137) @@ -129,8 +129,8 @@ scc_bfe_attach(device_t dev, u_int ipc) * Re-allocate. We expect that the softc contains the information * collected by scc_bfe_probe() intact. */ - sc->sc_rres = bus_alloc_resource(dev, sc->sc_rtype, &sc->sc_rrid, - 0, ~0, cl->cl_channels * size, RF_ACTIVE); + sc->sc_rres = bus_alloc_resource_anywhere(dev, sc->sc_rtype, + &sc->sc_rrid, cl->cl_channels * size, RF_ACTIVE); if (sc->sc_rres == NULL) return (ENXIO); sc->sc_bas.bsh = rman_get_bushandle(sc->sc_rres); @@ -378,13 +378,13 @@ scc_bfe_probe(device_t dev, u_int regshf */ sc->sc_rrid = rid; sc->sc_rtype = SYS_RES_MEMORY; - sc->sc_rres = bus_alloc_resource(dev, sc->sc_rtype, &sc->sc_rrid, - 0, ~0, cl->cl_channels * size, RF_ACTIVE); + sc->sc_rres = bus_alloc_resource_anywhere(dev, sc->sc_rtype, + &sc->sc_rrid, cl->cl_channels * size, RF_ACTIVE); if (sc->sc_rres == NULL) { sc->sc_rrid = rid; sc->sc_rtype = SYS_RES_IOPORT; - sc->sc_rres = bus_alloc_resource(dev, sc->sc_rtype, - &sc->sc_rrid, 0, ~0, cl->cl_channels * size, RF_ACTIVE); + sc->sc_rres = bus_alloc_resource_anywhere(dev, sc->sc_rtype, + &sc->sc_rrid, cl->cl_channels * size, RF_ACTIVE); if (sc->sc_rres == NULL) return (ENXIO); } Modified: head/sys/dev/si/si_isa.c ============================================================================== --- head/sys/dev/si/si_isa.c Sat Feb 27 03:35:28 2016 (r296136) +++ head/sys/dev/si/si_isa.c Sat Feb 27 03:38:01 2016 (r296137) @@ -58,9 +58,9 @@ si_isa_probe(device_t dev) unit = device_get_unit(dev); sc->sc_mem_rid = 0; - sc->sc_mem_res = bus_alloc_resource(dev, SYS_RES_MEMORY, - &sc->sc_mem_rid, - 0, ~0, SIPROBEALLOC, RF_ACTIVE); + sc->sc_mem_res = bus_alloc_resource_anywhere(dev, SYS_RES_MEMORY, + &sc->sc_mem_rid, + SIPROBEALLOC, RF_ACTIVE); if (!sc->sc_mem_res) { device_printf(dev, "cannot allocate memory resource\n"); return ENXIO; Modified: head/sys/dev/sio/sio.c ============================================================================== --- head/sys/dev/sio/sio.c Sat Feb 27 03:35:28 2016 (r296136) +++ head/sys/dev/sio/sio.c Sat Feb 27 03:38:01 2016 (r296137) @@ -444,8 +444,8 @@ sioprobe(dev, xrid, rclk, noprobe) struct resource *port; rid = xrid; - port = bus_alloc_resource(dev, SYS_RES_IOPORT, &rid, - 0, ~0, IO_COMSIZE, RF_ACTIVE); + port = bus_alloc_resource_anywhere(dev, SYS_RES_IOPORT, &rid, + IO_COMSIZE, RF_ACTIVE); if (!port) return (ENXIO); @@ -884,8 +884,8 @@ sioattach(dev, xrid, rclk) struct tty *tp; rid = xrid; - port = bus_alloc_resource(dev, SYS_RES_IOPORT, &rid, - 0, ~0, IO_COMSIZE, RF_ACTIVE); + port = bus_alloc_resource_anywhere(dev, SYS_RES_IOPORT, &rid, + IO_COMSIZE, RF_ACTIVE); if (!port) return (ENXIO); Modified: head/sys/dev/smc/if_smc.c ============================================================================== --- head/sys/dev/smc/if_smc.c Sat Feb 27 03:35:28 2016 (r296136) +++ head/sys/dev/smc/if_smc.c Sat Feb 27 03:38:01 2016 (r296137) @@ -234,7 +234,7 @@ smc_probe(device_t dev) if (sc->smc_usemem) type = SYS_RES_MEMORY; - reg = bus_alloc_resource(dev, type, &rid, 0, ~0, 16, RF_ACTIVE); + reg = bus_alloc_resource_anywhere(dev, type, &rid, 16, RF_ACTIVE); if (reg == NULL) { if (bootverbose) device_printf(dev, @@ -328,15 +328,15 @@ smc_attach(device_t dev) type = SYS_RES_MEMORY; sc->smc_reg_rid = 0; - sc->smc_reg = bus_alloc_resource(dev, type, &sc->smc_reg_rid, 0, ~0, + sc->smc_reg = bus_alloc_resource_anywhere(dev, type, &sc->smc_reg_rid, 16, RF_ACTIVE); if (sc->smc_reg == NULL) { error = ENXIO; goto done; } - sc->smc_irq = bus_alloc_resource(dev, SYS_RES_IRQ, &sc->smc_irq_rid, 0, - ~0, 1, RF_ACTIVE | RF_SHAREABLE); + sc->smc_irq = bus_alloc_resource_anywhere(dev, SYS_RES_IRQ, + &sc->smc_irq_rid, 1, RF_ACTIVE | RF_SHAREABLE); if (sc->smc_irq == NULL) { error = ENXIO; goto done; Modified: head/sys/dev/sn/if_sn.c ============================================================================== --- head/sys/dev/sn/if_sn.c Sat Feb 27 03:35:28 2016 (r296136) +++ head/sys/dev/sn/if_sn.c Sat Feb 27 03:38:01 2016 (r296137) @@ -1216,8 +1216,8 @@ sn_activate(device_t dev) struct sn_softc *sc = device_get_softc(dev); sc->port_rid = 0; - sc->port_res = bus_alloc_resource(dev, SYS_RES_IOPORT, &sc->port_rid, - 0, ~0, SMC_IO_EXTENT, RF_ACTIVE); + sc->port_res = bus_alloc_resource_anywhere(dev, SYS_RES_IOPORT, + &sc->port_rid, SMC_IO_EXTENT, RF_ACTIVE); if (!sc->port_res) { if (bootverbose) device_printf(dev, "Cannot allocate ioport\n"); Modified: head/sys/dev/snc/if_snc.c ============================================================================== --- head/sys/dev/snc/if_snc.c Sat Feb 27 03:35:28 2016 (r296136) +++ head/sys/dev/snc/if_snc.c Sat Feb 27 03:38:01 2016 (r296137) @@ -72,8 +72,8 @@ snc_alloc_port(device_t dev, int rid) struct snc_softc *sc = device_get_softc(dev); struct resource *res; - res = bus_alloc_resource(dev, SYS_RES_IOPORT, &rid, - 0ul, ~0ul, SNEC_NREGS, RF_ACTIVE); + res = bus_alloc_resource_anywhere(dev, SYS_RES_IOPORT, &rid, + SNEC_NREGS, RF_ACTIVE); if (res) { sc->ioport = res; sc->ioport_rid = rid; @@ -95,8 +95,8 @@ snc_alloc_memory(device_t dev, int rid) struct snc_softc *sc = device_get_softc(dev); struct resource *res; - res = bus_alloc_resource(dev, SYS_RES_MEMORY, &rid, - 0ul, ~0ul, SNEC_NMEMS, RF_ACTIVE); + res = bus_alloc_resource_anywhere(dev, SYS_RES_MEMORY, &rid, + SNEC_NMEMS, RF_ACTIVE); if (res) { sc->iomem = res; sc->iomem_rid = rid; Modified: head/sys/dev/snc/if_snc_cbus.c ============================================================================== --- head/sys/dev/snc/if_snc_cbus.c Sat Feb 27 03:35:28 2016 (r296136) +++ head/sys/dev/snc/if_snc_cbus.c Sat Feb 27 03:38:01 2016 (r296137) @@ -147,9 +147,9 @@ snc_isa_probe(device_t dev) for (port = 0x0888; port <= 0x3888; port += 0x1000) { bus_set_resource(dev, SYS_RES_IOPORT, rid, port, SNEC_NREGS); - res = bus_alloc_resource(dev, SYS_RES_IOPORT, &rid, - 0ul, ~0ul, SNEC_NREGS, - 0 /* !RF_ACTIVE */); + res = bus_alloc_resource_anywhere(dev, SYS_RES_IOPORT, + &rid, SNEC_NREGS, + 0 /* !RF_ACTIVE */); if (res) break; } Modified: head/sys/dev/sound/isa/gusc.c ============================================================================== --- head/sys/dev/sound/isa/gusc.c Sat Feb 27 03:35:28 2016 (r296136) +++ head/sys/dev/sound/isa/gusc.c Sat Feb 27 03:38:01 2016 (r296137) @@ -495,8 +495,12 @@ alloc_resource(sc_p scp) if (scp->io[i] == NULL) { scp->io_rid[i] = i; if (base == 0) - scp->io[i] = bus_alloc_resource(scp->dev, SYS_RES_IOPORT, &scp->io_rid[i], - 0, ~0, io_range[i], RF_ACTIVE); + scp->io[i] = + bus_alloc_resource_anywhere(scp->dev, + SYS_RES_IOPORT, + &scp->io_rid[i], + io_range[i], + RF_ACTIVE); else scp->io[i] = bus_alloc_resource(scp->dev, SYS_RES_IOPORT, &scp->io_rid[i], base + io_offset[i], @@ -540,8 +544,11 @@ alloc_resource(sc_p scp) case LOGICALID_OPL: if (scp->io[0] == NULL) { scp->io_rid[0] = 0; - scp->io[0] = bus_alloc_resource(scp->dev, SYS_RES_IOPORT, &scp->io_rid[0], - 0, ~0, io_range[0], RF_ACTIVE); + scp->io[0] = bus_alloc_resource_anywhere(scp->dev, + SYS_RES_IOPORT, + &scp->io_rid[0], + io_range[0], + RF_ACTIVE); if (scp->io[0] == NULL) return (1); scp->io_alloced[0] = 0; @@ -550,8 +557,11 @@ alloc_resource(sc_p scp) case LOGICALID_MIDI: if (scp->io[0] == NULL) { scp->io_rid[0] = 0; - scp->io[0] = bus_alloc_resource(scp->dev, SYS_RES_IOPORT, &scp->io_rid[0], - 0, ~0, io_range[0], RF_ACTIVE); + scp->io[0] = bus_alloc_resource_anywhere(scp->dev, + SYS_RES_IOPORT, + &scp->io_rid[0], + io_range[0], + RF_ACTIVE); if (scp->io[0] == NULL) return (1); scp->io_alloced[0] = 0; Modified: head/sys/dev/sound/isa/mss.c ============================================================================== --- head/sys/dev/sound/isa/mss.c Sat Feb 27 03:35:28 2016 (r296136) +++ head/sys/dev/sound/isa/mss.c Sat Feb 27 03:38:01 2016 (r296137) @@ -1289,8 +1289,8 @@ mss_probe(device_t dev) mss->irq_rid = 0; mss->drq1_rid = 0; mss->drq2_rid = -1; - mss->io_base = bus_alloc_resource(dev, SYS_RES_IOPORT, &mss->io_rid, - 0, ~0, 8, RF_ACTIVE); + mss->io_base = bus_alloc_resource_anywhere(dev, SYS_RES_IOPORT, + &mss->io_rid, 8, RF_ACTIVE); if (!mss->io_base) { BVDDB(printf("mss_probe: no address given, try 0x%x\n", 0x530)); mss->io_rid = 0; @@ -1298,8 +1298,9 @@ mss_probe(device_t dev) setres = 1; bus_set_resource(dev, SYS_RES_IOPORT, mss->io_rid, 0x530, 8); - mss->io_base = bus_alloc_resource(dev, SYS_RES_IOPORT, &mss->io_rid, - 0, ~0, 8, RF_ACTIVE); + mss->io_base = bus_alloc_resource_anywhere(dev, SYS_RES_IOPORT, + &mss->io_rid, + 8, RF_ACTIVE); } if (!mss->io_base) goto no; @@ -2091,8 +2092,8 @@ opti_init(device_t dev, struct mss_info return ENXIO; if (!mss->io_base) - mss->io_base = bus_alloc_resource(dev, SYS_RES_IOPORT, - &mss->io_rid, 0, ~0, 8, RF_ACTIVE); + mss->io_base = bus_alloc_resource_anywhere(dev, SYS_RES_IOPORT, + &mss->io_rid, 8, RF_ACTIVE); if (!mss->io_base) /* No hint specified, use 0x530 */ mss->io_base = bus_alloc_resource(dev, SYS_RES_IOPORT, @@ -2275,8 +2276,9 @@ guspcm_attach(device_t dev) if (flags & DV_F_DUAL_DMA) mss->drq2_rid = 0; - mss->conf_base = bus_alloc_resource(dev, SYS_RES_IOPORT, &mss->conf_rid, - 0, ~0, 8, RF_ACTIVE); + mss->conf_base = bus_alloc_resource_anywhere(dev, SYS_RES_IOPORT, + &mss->conf_rid, + 8, RF_ACTIVE); if (mss->conf_base == NULL) { mss_release_resources(mss, dev); Modified: head/sys/dev/sound/isa/sbc.c ============================================================================== --- head/sys/dev/sound/isa/sbc.c Sat Feb 27 03:35:28 2016 (r296136) +++ head/sys/dev/sound/isa/sbc.c Sat Feb 27 03:38:01 2016 (r296137) @@ -301,8 +301,8 @@ sbc_probe(device_t dev) io = isa_alloc_resourcev(dev, SYS_RES_IOPORT, &rid, pcm_iat, 16, RF_ACTIVE); #else - io = bus_alloc_resource(dev, SYS_RES_IOPORT, &rid, - 0, ~0, 16, RF_ACTIVE); + io = bus_alloc_resource_anywhere(dev, SYS_RES_IOPORT, &rid, + 16, RF_ACTIVE); #endif if (!io) goto bad; #ifdef PC98 @@ -708,8 +708,11 @@ alloc_resource(struct sbc_softc *scp) io_range[i]); #else scp->io_rid[i] = i; - scp->io[i] = bus_alloc_resource(scp->dev, SYS_RES_IOPORT, &scp->io_rid[i], - 0, ~0, io_range[i], RF_ACTIVE); + scp->io[i] = bus_alloc_resource_anywhere(scp->dev, + SYS_RES_IOPORT, + &scp->io_rid[i], + io_range[i], + RF_ACTIVE); #endif if (i == 0 && scp->io[i] == NULL) return (1); Modified: head/sys/dev/wi/if_wi.c ============================================================================== --- head/sys/dev/wi/if_wi.c Sat Feb 27 03:35:28 2016 (r296136) +++ head/sys/dev/wi/if_wi.c Sat Feb 27 03:38:01 2016 (r296137) @@ -1995,8 +1995,8 @@ wi_alloc(device_t dev, int rid) if (sc->wi_bus_type != WI_BUS_PCI_NATIVE) { sc->iobase_rid = rid; - sc->iobase = bus_alloc_resource(dev, SYS_RES_IOPORT, - &sc->iobase_rid, 0, ~0, (1 << 6), + sc->iobase = bus_alloc_resource_anywhere(dev, SYS_RES_IOPORT, + &sc->iobase_rid, (1 << 6), rman_make_alignment_flags(1 << 6) | RF_ACTIVE); if (sc->iobase == NULL) { device_printf(dev, "No I/O space?!\n"); Modified: head/sys/dev/wl/if_wl.c ============================================================================== --- head/sys/dev/wl/if_wl.c Sat Feb 27 03:35:28 2016 (r296136) +++ head/sys/dev/wl/if_wl.c Sat Feb 27 03:38:01 2016 (r296137) @@ -604,8 +604,8 @@ wl_allocate_resources(device_t device) struct wl_softc *sc = device_get_softc(device); int ports = 16; /* Number of ports */ - sc->res_ioport = bus_alloc_resource(device, SYS_RES_IOPORT, - &sc->rid_ioport, 0ul, ~0ul, ports, RF_ACTIVE); + sc->res_ioport = bus_alloc_resource_anywhere(device, SYS_RES_IOPORT, + &sc->rid_ioport, ports, RF_ACTIVE); if (sc->res_ioport == NULL) goto errexit; Modified: head/sys/dev/xe/if_xe.c ============================================================================== --- head/sys/dev/xe/if_xe.c Sat Feb 27 03:35:28 2016 (r296136) +++ head/sys/dev/xe/if_xe.c Sat Feb 27 03:38:01 2016 (r296137) @@ -1964,8 +1964,8 @@ xe_activate(device_t dev) if (!sc->modem) { sc->port_rid = 0; /* 0 is managed by pccard */ - sc->port_res = bus_alloc_resource(dev, SYS_RES_IOPORT, - &sc->port_rid, 0ul, ~0ul, 16, RF_ACTIVE); + sc->port_res = bus_alloc_resource_anywhere(dev, SYS_RES_IOPORT, + &sc->port_rid, 16, RF_ACTIVE); } else if (sc->dingo) { /* * Find a 16 byte aligned ioport for the card. @@ -1998,8 +1998,8 @@ xe_activate(device_t dev) */ DEVPRINTF(1, (dev, "Finding I/O port for CEM2/CEM3\n")); sc->ce2_port_rid = 0; /* 0 is managed by pccard */ - sc->ce2_port_res = bus_alloc_resource(dev, SYS_RES_IOPORT, - &sc->ce2_port_rid, 0ul, ~0ul, 8, RF_ACTIVE); + sc->ce2_port_res = bus_alloc_resource_anywhere(dev, + SYS_RES_IOPORT, &sc->ce2_port_rid, 8, RF_ACTIVE); if (sc->ce2_port_res == NULL) { DEVPRINTF(1, (dev, "Cannot allocate I/O port for modem\n")); Modified: head/sys/i386/isa/spic.c ============================================================================== --- head/sys/i386/isa/spic.c Sat Feb 27 03:35:28 2016 (r296136) +++ head/sys/i386/isa/spic.c Sat Feb 27 03:38:01 2016 (r296137) @@ -234,8 +234,8 @@ spic_probe(device_t dev) bzero(sc, sizeof(struct spic_softc)); - if (!(sc->sc_port_res = bus_alloc_resource(dev, SYS_RES_IOPORT, - &sc->sc_port_rid, 0, ~0, 5, RF_ACTIVE))) { + if (!(sc->sc_port_res = bus_alloc_resource_anywhere(dev, SYS_RES_IOPORT, + &sc->sc_port_rid, 5, RF_ACTIVE))) { device_printf(dev,"Couldn't map I/O\n"); return ENXIO; } Modified: head/sys/netgraph/bluetooth/drivers/bt3c/ng_bt3c_pccard.c ============================================================================== --- head/sys/netgraph/bluetooth/drivers/bt3c/ng_bt3c_pccard.c Sat Feb 27 03:35:28 2016 (r296136) +++ head/sys/netgraph/bluetooth/drivers/bt3c/ng_bt3c_pccard.c Sat Feb 27 03:38:01 2016 (r296137) @@ -615,8 +615,8 @@ bt3c_pccard_attach(device_t dev) /* Allocate I/O ports */ sc->iobase_rid = 0; - sc->iobase = bus_alloc_resource(dev, SYS_RES_IOPORT, &sc->iobase_rid, - 0, ~0, 8, RF_ACTIVE); + sc->iobase = bus_alloc_resource_anywhere(dev, SYS_RES_IOPORT, + &sc->iobase_rid, 8, RF_ACTIVE); if (sc->iobase == NULL) { device_printf(dev, "Could not allocate I/O ports\n"); goto bad; Modified: head/sys/pc98/cbus/sio.c ============================================================================== --- head/sys/pc98/cbus/sio.c Sat Feb 27 03:35:28 2016 (r296136) +++ head/sys/pc98/cbus/sio.c Sat Feb 27 03:38:01 2016 (r296137) @@ -795,7 +795,7 @@ sioprobe(dev, xrid, rclk, noprobe) } else if (iod.if_type == COM_IF_MODEM_CARD || iod.if_type == COM_IF_RSA98III || isa_get_vendorid(dev)) { - port = bus_alloc_resource(dev, SYS_RES_IOPORT, &rid, 0, ~0, + port = bus_alloc_resource_anywhere(dev, SYS_RES_IOPORT, &rid, if_16550a_type[iod.if_type & 0x0f].iatsz, RF_ACTIVE); } else { port = isa_alloc_resourcev(dev, SYS_RES_IOPORT, &rid, @@ -803,8 +803,8 @@ sioprobe(dev, xrid, rclk, noprobe) if_16550a_type[iod.if_type & 0x0f].iatsz, RF_ACTIVE); } #else - port = bus_alloc_resource(dev, SYS_RES_IOPORT, &rid, - 0, ~0, IO_COMSIZE, RF_ACTIVE); + port = bus_alloc_resource_anywhere(dev, SYS_RES_IOPORT, &rid, *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Sat Feb 27 12:03:09 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2AAFEAB2030; Sat, 27 Feb 2016 12:03:09 +0000 (UTC) (envelope-from skra@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EFDD81E62; Sat, 27 Feb 2016 12:03:08 +0000 (UTC) (envelope-from skra@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1RC38mv075434; Sat, 27 Feb 2016 12:03:08 GMT (envelope-from skra@FreeBSD.org) Received: (from skra@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1RC37xT075430; Sat, 27 Feb 2016 12:03:07 GMT (envelope-from skra@FreeBSD.org) Message-Id: <201602271203.u1RC37xT075430@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: skra set sender to skra@FreeBSD.org using -f From: Svatopluk Kraus Date: Sat, 27 Feb 2016 12:03:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r296138 - in head/sys: arm/arm arm/include kern sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Feb 2016 12:03:09 -0000 Author: skra Date: Sat Feb 27 12:03:07 2016 New Revision: 296138 URL: https://svnweb.freebsd.org/changeset/base/296138 Log: Move IPI related parts back to (ARM) machine specific file now, when the interrupt framework is also going to be used by another (MIPS) architecture. IPI implementations may vary much across different architectures. An IPI implementation should still define INTR_IPI_COUNT and use intr_ipi_setup_counters() to setup IPI counters which are inside of intrcnt[] and intrnames[] arrays. Those are used for sysctl and ddb. Then, intr_ipi_increment_count() should be used to increment obtained counter. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D5459 Modified: head/sys/arm/arm/machdep_intr.c head/sys/arm/include/intr.h head/sys/kern/subr_intr.c head/sys/sys/intr.h Modified: head/sys/arm/arm/machdep_intr.c ============================================================================== --- head/sys/arm/arm/machdep_intr.c Sat Feb 27 03:38:01 2016 (r296137) +++ head/sys/arm/arm/machdep_intr.c Sat Feb 27 12:03:07 2016 (r296138) @@ -52,11 +52,22 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include #include +#include + +#ifdef ARM_INTRNG +#include "pic_if.h" + +#ifdef SMP +static struct intr_irqsrc ipi_sources[INTR_IPI_COUNT]; +static u_int ipi_next_num; +#endif +#endif /* * arm_irq_memory_barrier() @@ -121,3 +132,127 @@ arm_irq_memory_barrier(uintptr_t irq) cpu_l2cache_drain_writebuf(); } +#ifdef ARM_INTRNG +#ifdef SMP +/* + * Lookup IPI source. + */ +static struct intr_irqsrc * +intr_ipi_lookup(u_int ipi) +{ + + if (ipi >= INTR_IPI_COUNT) + panic("%s: no such IPI %u", __func__, ipi); + + return (&ipi_sources[ipi]); +} + +/* + * interrupt controller dispatch function for IPIs. It should + * be called straight from the interrupt controller, when associated + * interrupt source is learned. Or from anybody who has an interrupt + * source mapped. + */ +void +intr_ipi_dispatch(struct intr_irqsrc *isrc, struct trapframe *tf) +{ + void *arg; + + KASSERT(isrc != NULL, ("%s: no source", __func__)); + + intr_ipi_increment_count(isrc->isrc_count, PCPU_GET(cpuid)); + + /* + * Supply ipi filter with trapframe argument + * if none is registered. + */ + arg = isrc->isrc_arg != NULL ? isrc->isrc_arg : tf; + isrc->isrc_ipifilter(arg); +} + +/* + * Map IPI into interrupt controller. + * + * Not SMP coherent. + */ +static int +ipi_map(struct intr_irqsrc *isrc, u_int ipi) +{ + boolean_t is_percpu; + int error; + + if (ipi >= INTR_IPI_COUNT) + panic("%s: no such IPI %u", __func__, ipi); + + KASSERT(intr_irq_root_dev != NULL, ("%s: no root attached", __func__)); + + isrc->isrc_type = INTR_ISRCT_NAMESPACE; + isrc->isrc_nspc_type = INTR_IRQ_NSPC_IPI; + isrc->isrc_nspc_num = ipi_next_num; + + error = PIC_REGISTER(intr_irq_root_dev, isrc, &is_percpu); + if (error == 0) { + isrc->isrc_dev = intr_irq_root_dev; + ipi_next_num++; + } + return (error); +} + +/* + * Setup IPI handler to interrupt source. + * + * Note that there could be more ways how to send and receive IPIs + * on a platform like fast interrupts for example. In that case, + * one can call this function with ASIF_NOALLOC flag set and then + * call intr_ipi_dispatch() when appropriate. + * + * Not SMP coherent. + */ +int +intr_ipi_set_handler(u_int ipi, const char *name, intr_ipi_filter_t *filter, + void *arg, u_int flags) +{ + struct intr_irqsrc *isrc; + int error; + + if (filter == NULL) + return(EINVAL); + + isrc = intr_ipi_lookup(ipi); + if (isrc->isrc_ipifilter != NULL) + return (EEXIST); + + if ((flags & AISHF_NOALLOC) == 0) { + error = ipi_map(isrc, ipi); + if (error != 0) + return (error); + } + + isrc->isrc_ipifilter = filter; + isrc->isrc_arg = arg; + isrc->isrc_handlers = 1; + isrc->isrc_count = intr_ipi_setup_counters(name); + isrc->isrc_index = 0; /* it should not be used in IPI case */ + + if (isrc->isrc_dev != NULL) { + PIC_ENABLE_INTR(isrc->isrc_dev, isrc); + PIC_ENABLE_SOURCE(isrc->isrc_dev, isrc); + } + return (0); +} + +/* + * Send IPI thru interrupt controller. + */ +void +pic_ipi_send(cpuset_t cpus, u_int ipi) +{ + struct intr_irqsrc *isrc; + + isrc = intr_ipi_lookup(ipi); + + KASSERT(intr_irq_root_dev != NULL, ("%s: no root attached", __func__)); + PIC_IPI_SEND(intr_irq_root_dev, isrc, cpus); +} +#endif +#endif Modified: head/sys/arm/include/intr.h ============================================================================== --- head/sys/arm/include/intr.h Sat Feb 27 03:38:01 2016 (r296137) +++ head/sys/arm/include/intr.h Sat Feb 27 12:03:07 2016 (r296138) @@ -51,6 +51,15 @@ #include +#ifdef SMP +void intr_ipi_dispatch(struct intr_irqsrc *isrc, struct trapframe *tf); + +#define AISHF_NOALLOC 0x0001 + +int intr_ipi_set_handler(u_int ipi, const char *name, intr_ipi_filter_t *filter, + void *arg, u_int flags); +#endif + #else /* ARM_INTRNG */ /* XXX move to std.* files? */ Modified: head/sys/kern/subr_intr.c ============================================================================== --- head/sys/kern/subr_intr.c Sat Feb 27 03:38:01 2016 (r296137) +++ head/sys/kern/subr_intr.c Sat Feb 27 12:03:07 2016 (r296138) @@ -89,7 +89,7 @@ void intr_irq_handler(struct trapframe * /* Root interrupt controller stuff. */ static struct intr_irqsrc *irq_root_isrc; -static device_t irq_root_dev; +device_t intr_irq_root_dev; static intr_irq_filter_t *irq_root_filter; static void *irq_root_arg; static u_int irq_root_ipicount; @@ -115,9 +115,6 @@ u_int irq_next_free; #ifdef SMP static boolean_t irq_assign_cpu = FALSE; - -static struct intr_irqsrc ipi_sources[INTR_IPI_COUNT]; -static u_int ipi_next_num; #endif /* @@ -239,36 +236,20 @@ isrc_setup_counters(struct intr_irqsrc * #ifdef SMP /* - * Virtualization for interrupt source IPI counter increment. - */ -static inline void -isrc_increment_ipi_count(struct intr_irqsrc *isrc, u_int cpu) -{ - - isrc->isrc_count[cpu]++; -} - -/* * Virtualization for interrupt source IPI counters setup. */ -static void -isrc_setup_ipi_counters(struct intr_irqsrc *isrc, const char *name) +u_long * +intr_ipi_setup_counters(const char *name) { u_int index, i; char str[INTRNAME_LEN]; index = atomic_fetchadd_int(&intrcnt_index, MAXCPU); - isrc->isrc_index = index; - isrc->isrc_count = &intrcnt[index]; - for (i = 0; i < MAXCPU; i++) { - /* - * We do not expect any race in IPI case here, - * so locking is not needed. - */ snprintf(str, INTRNAME_LEN, "cpu%d:%s", i, name); intrcnt_setname(str, index + i); } + return (&intrcnt[index]); } #endif @@ -679,7 +660,7 @@ intr_isrc_assign_cpu(void *arg, int cpu) struct intr_irqsrc *isrc = arg; int error; - if (isrc->isrc_dev != irq_root_dev) + if (isrc->isrc_dev != intr_irq_root_dev) return (EINVAL); mtx_lock(&isrc_table_lock); @@ -926,7 +907,7 @@ intr_pic_claim_root(device_t dev, intptr * Note that we further suppose that there is not threaded interrupt * routine (handler) on the root. See intr_irq_handler(). */ - if (irq_root_dev != NULL) { + if (intr_irq_root_dev != NULL) { device_printf(dev, "another root already set\n"); return (EBUSY); } @@ -949,7 +930,7 @@ intr_pic_claim_root(device_t dev, intptr device_printf(dev, "failed to install root pic handler\n"); return (error); } - irq_root_dev = dev; + intr_irq_root_dev = dev; irq_root_filter = filter; irq_root_arg = arg; irq_root_ipicount = ipicount; @@ -1211,132 +1192,6 @@ dosoftints(void) #ifdef SMP /* - * Lookup IPI source. - */ -static struct intr_irqsrc * -intr_ipi_lookup(u_int ipi) -{ - - if (ipi >= INTR_IPI_COUNT) - panic("%s: no such IPI %u", __func__, ipi); - - return (&ipi_sources[ipi]); -} - -/* - * interrupt controller dispatch function for IPIs. It should - * be called straight from the interrupt controller, when associated - * interrupt source is learned. Or from anybody who has an interrupt - * source mapped. - */ -void -intr_ipi_dispatch(struct intr_irqsrc *isrc, struct trapframe *tf) -{ - void *arg; - - KASSERT(isrc != NULL, ("%s: no source", __func__)); - - isrc_increment_ipi_count(isrc, PCPU_GET(cpuid)); - - /* - * Supply ipi filter with trapframe argument - * if none is registered. - */ - arg = isrc->isrc_arg != NULL ? isrc->isrc_arg : tf; - isrc->isrc_ipifilter(arg); -} - -/* - * Map IPI into interrupt controller. - * - * Not SMP coherent. - */ -static int -ipi_map(struct intr_irqsrc *isrc, u_int ipi) -{ - boolean_t is_percpu; - int error; - - if (ipi >= INTR_IPI_COUNT) - panic("%s: no such IPI %u", __func__, ipi); - - KASSERT(irq_root_dev != NULL, ("%s: no root attached", __func__)); - - isrc->isrc_type = INTR_ISRCT_NAMESPACE; - isrc->isrc_nspc_type = INTR_IRQ_NSPC_IPI; - isrc->isrc_nspc_num = ipi_next_num; - - error = PIC_REGISTER(irq_root_dev, isrc, &is_percpu); - - debugf("ipi %u mapped to %u on %s - error %d\n", ipi, ipi_next_num, - device_get_nameunit(irq_root_dev), error); - - if (error == 0) { - isrc->isrc_dev = irq_root_dev; - ipi_next_num++; - } - return (error); -} - -/* - * Setup IPI handler to interrupt source. - * - * Note that there could be more ways how to send and receive IPIs - * on a platform like fast interrupts for example. In that case, - * one can call this function with ASIF_NOALLOC flag set and then - * call intr_ipi_dispatch() when appropriate. - * - * Not SMP coherent. - */ -int -intr_ipi_set_handler(u_int ipi, const char *name, intr_ipi_filter_t *filter, - void *arg, u_int flags) -{ - struct intr_irqsrc *isrc; - int error; - - if (filter == NULL) - return(EINVAL); - - isrc = intr_ipi_lookup(ipi); - if (isrc->isrc_ipifilter != NULL) - return (EEXIST); - - if ((flags & AISHF_NOALLOC) == 0) { - error = ipi_map(isrc, ipi); - if (error != 0) - return (error); - } - - isrc->isrc_ipifilter = filter; - isrc->isrc_arg = arg; - isrc->isrc_handlers = 1; - isrc_setup_ipi_counters(isrc, name); - - if (isrc->isrc_dev != NULL) { - mtx_lock(&isrc_table_lock); - PIC_ENABLE_INTR(isrc->isrc_dev, isrc); - PIC_ENABLE_SOURCE(isrc->isrc_dev, isrc); - mtx_unlock(&isrc_table_lock); - } - return (0); -} - -/* - * Send IPI thru interrupt controller. - */ -void -pic_ipi_send(cpuset_t cpus, u_int ipi) -{ - struct intr_irqsrc *isrc; - - isrc = intr_ipi_lookup(ipi); - - KASSERT(irq_root_dev != NULL, ("%s: no root attached", __func__)); - PIC_IPI_SEND(irq_root_dev, isrc, cpus); -} - -/* * Init interrupt controller on another CPU. */ void @@ -1346,10 +1201,10 @@ intr_pic_init_secondary(void) /* * QQQ: Only root PIC is aware of other CPUs ??? */ - KASSERT(irq_root_dev != NULL, ("%s: no root attached", __func__)); + KASSERT(intr_irq_root_dev != NULL, ("%s: no root attached", __func__)); //mtx_lock(&isrc_table_lock); - PIC_INIT_SECONDARY(irq_root_dev); + PIC_INIT_SECONDARY(intr_irq_root_dev); //mtx_unlock(&isrc_table_lock); } #endif @@ -1360,25 +1215,6 @@ DB_SHOW_COMMAND(irqs, db_show_irqs) u_int i, irqsum; struct intr_irqsrc *isrc; -#ifdef SMP - for (i = 0; i <= mp_maxid; i++) { - struct pcpu *pc; - u_int ipi, ipisum; - - pc = pcpu_find(i); - if (pc != NULL) { - for (ipisum = 0, ipi = 0; ipi < INTR_IPI_COUNT; ipi++) { - isrc = intr_ipi_lookup(ipi); - if (isrc->isrc_count != NULL) - ipisum += isrc->isrc_count[i]; - } - printf ("cpu%u: total %u ipis %u\n", i, - pc->pc_cnt.v_intr, ipisum); - } - } - db_printf("\n"); -#endif - for (irqsum = 0, i = 0; i < NIRQ; i++) { isrc = irq_sources[i]; if (isrc == NULL) Modified: head/sys/sys/intr.h ============================================================================== --- head/sys/sys/intr.h Sat Feb 27 03:38:01 2016 (r296137) +++ head/sys/sys/intr.h Sat Feb 27 12:03:07 2016 (r296138) @@ -39,6 +39,8 @@ #ifndef _SYS_INTR_H_ #define _SYS_INTR_H_ +#include + #ifdef notyet #define INTR_SOLO INTR_MD1 typedef int intr_irq_filter_t(void *arg, struct trapframe *tf); @@ -101,6 +103,8 @@ u_int intr_namespace_map_irq(device_t de u_int intr_fdt_map_irq(phandle_t, pcell_t *, u_int); #endif +extern device_t intr_irq_root_dev; + int intr_pic_register(device_t dev, intptr_t xref); int intr_pic_unregister(device_t dev, intptr_t xref); int intr_pic_claim_root(device_t dev, intptr_t xref, intr_irq_filter_t *filter, @@ -117,14 +121,19 @@ u_int intr_irq_next_cpu(u_int current_cp #ifdef SMP int intr_irq_bind(u_int, int); -void intr_ipi_dispatch(struct intr_irqsrc *isrc, struct trapframe *tf); - -#define AISHF_NOALLOC 0x0001 +void intr_pic_init_secondary(void); -int intr_ipi_set_handler(u_int ipi, const char *name, intr_ipi_filter_t *filter, - void *arg, u_int flags); +/* Virtualization for interrupt source IPI counter increment. */ +static inline void +intr_ipi_increment_count(u_long *counter, u_int cpu) +{ + + KASSERT(cpu < MAXCPU, ("%s: too big cpu %u", __func__, cpu)); + counter[cpu]++; +} -void intr_pic_init_secondary(void); +/* Virtualization for interrupt source IPI counters setup. */ +u_long * intr_ipi_setup_counters(const char *name); #endif #endif /* _SYS_INTR_H */ From owner-svn-src-head@freebsd.org Sat Feb 27 12:34:53 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0E1EAAB5065; Sat, 27 Feb 2016 12:34:53 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D008EFD3; Sat, 27 Feb 2016 12:34:52 +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 u1RCYpiY084347; Sat, 27 Feb 2016 12:34:51 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1RCYpbx084346; Sat, 27 Feb 2016 12:34:51 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201602271234.u1RCYpbx084346@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Sat, 27 Feb 2016 12:34:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r296139 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Feb 2016 12:34:53 -0000 Author: emaste Date: Sat Feb 27 12:34:51 2016 New Revision: 296139 URL: https://svnweb.freebsd.org/changeset/base/296139 Log: Correct date on ELF Tool Chain UPDATING entry Reported by: dhw Modified: head/UPDATING Modified: head/UPDATING ============================================================================== --- head/UPDATING Sat Feb 27 12:03:07 2016 (r296138) +++ head/UPDATING Sat Feb 27 12:34:51 2016 (r296139) @@ -31,7 +31,7 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 11 disable the most expensive debugging functionality run "ln -s 'abort:false,junk:false' /etc/malloc.conf".) -20150107: +20160226: The ELF object manipulation tool objcopy is now provided by the ELF Tool Chain project rather than by GNU binutils. It should be a drop-in replacement, with the addition of arm64 support. The From owner-svn-src-head@freebsd.org Sat Feb 27 13:03:08 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BAF19AB5AE2; Sat, 27 Feb 2016 13:03:08 +0000 (UTC) (envelope-from oshogbo.vx@gmail.com) Received: from mail-wm0-x22f.google.com (mail-wm0-x22f.google.com [IPv6:2a00:1450:400c:c09::22f]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 538C31AA4; Sat, 27 Feb 2016 13:03:08 +0000 (UTC) (envelope-from oshogbo.vx@gmail.com) Received: by mail-wm0-x22f.google.com with SMTP id g62so103182001wme.0; Sat, 27 Feb 2016 05:03:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc; bh=jJokDV/OKDvxF6zJx11RyBIkEIcIKSNGRsFsb+MqE6k=; b=mUAjLd9I+/IO6H9aLq+u+ilBF2lOofJPGXm5JK0lBdyAU7yR4tpUMwzVwPDhEQhI+0 trPLf44IdVKSq7cmtBSZuZMsEAlEO7usYQhA4iAJxsBuMqBIkWX00ZYL45FrQbJTHVRO 12miH6MItZKePZV7dCAhVH84QZfxJ+rLBwtIny2NBO5vUucgu3N5PEXXMofIBKeMFrlX 6dobWE//GK0t4wnuX2ORpALFnZ+f/6D1/B4PSKxMxTT5GDlk/hHv1YpxUAZivo62UPwf MIxcimdZIVFI/YaH12mpAC+uxy8PCnQ2tJs4n4TsuG5uulR7XbmFZN5Wckz5q6to6ezN MEMA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:date :message-id:subject:from:to:cc; bh=jJokDV/OKDvxF6zJx11RyBIkEIcIKSNGRsFsb+MqE6k=; b=jMQbXe7bbROchEVjzM4eS/82S+HUgocQo/CmcpaDbfTZYZ/4KFx/5pfUFjBxzuNksp rtUUdO75Wv8+sYcTbQdhzcVJSsd382d+AfkKXDboy8tJXC/Jr0Hxu6lIjjqHsZXeRLcl ISRQ9bP7HvHbZfyczRDVtO6EXc0WJNZOospSFCb7gv2IEZ1JZ1y2Bbl/WhJ+iMmBQ/bq 8xqB0XSs53nvA/oev/0B8IneZ3Gc38bR0RTYydio8WFmsicGoOR9HaVW2gU3uw09mwkj GeFMNZxvuKdYPEjdFUyqFfhRm77bqurOq2YuuXYIcZvwfgzE3flqxIh957ai6m70AI6S iwaQ== X-Gm-Message-State: AD7BkJIkcy3GGG3fNx+jhvfGP4T0xjOrcqe/hGA2wCwAj8uFO6V6e7gzwh0SLwPUaD+RiiAuDc2RiMLEjJDv8w== MIME-Version: 1.0 X-Received: by 10.194.209.204 with SMTP id mo12mr6829548wjc.69.1456578186397; Sat, 27 Feb 2016 05:03:06 -0800 (PST) Sender: oshogbo.vx@gmail.com Received: by 10.194.34.106 with HTTP; Sat, 27 Feb 2016 05:03:06 -0800 (PST) In-Reply-To: <20160226155505.GC6148@mutt-hardenedbsd> References: <201602251823.u1PINe3W036719@repo.freebsd.org> <20160226155505.GC6148@mutt-hardenedbsd> Date: Sat, 27 Feb 2016 14:03:06 +0100 X-Google-Sender-Auth: jHN9yOenQlyWOuJ0kvuj72uWsI4 Message-ID: Subject: Re: svn commit: r296047 - in head: . contrib/mdocml contrib/tcpdump etc/defaults etc/mtree etc/rc.d gnu/usr.bin/groff/tmac lib lib/libc/posix1e lib/libcapsicum lib/libcasper lib/libcasper/libcasper lib... From: Mariusz Zaborski To: Shawn Webb Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.20 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Feb 2016 13:03:08 -0000 Thank you. I on it. On 26 February 2016 at 16:55, Shawn Webb wrote: > On Thu, Feb 25, 2016 at 06:23:40PM +0000, Mariusz Zaborski wrote: > > Author: oshogbo > > Date: Thu Feb 25 18:23:40 2016 > > New Revision: 296047 > > URL: https://svnweb.freebsd.org/changeset/base/296047 > > > > Log: > > Convert casperd(8) daemon to the libcasper. > > After calling the cap_init(3) function Casper will fork from it's > original > > process, using pdfork(2). Forking from a process has a lot of > advantages: > > 1. We have the same cwd as the original process. > > 2. The same uid, gid and groups. > > 3. The same MAC labels. > > 4. The same descriptor table. > > 5. The same routing table. > > 6. The same umask. > > 7. The same cpuset(1). > > From now services are also in form of libraries. > > We also removed libcapsicum at all and converts existing program using > Casper > > to new architecture. > > > > Discussed with: pjd, jonathan, ed, drysdale@google.com, > emaste > > Partially reviewed by: drysdale@google.com, bdrewery > > Approved by: pjd (mentor) > > Differential Revision: https://reviews.freebsd.org/D4277 > > This commit breaks `cd /usr/src/release; make real-release`. > > Log of failed build here: > > > http://jenkins.hardenedbsd.org:8180/jenkins/job/HardenedBSD-CURRENT-amd64/lastFailedBuild/console > > Reverting this commit makes everything happy again. > > Thanks, > > -- > Shawn Webb > HardenedBSD > > GPG Key ID: 0x6A84658F52456EEE > GPG Key Fingerprint: 2ABA B6BD EF6A F486 BE89 3D9E 6A84 658F 5245 6EEE > From owner-svn-src-head@freebsd.org Sat Feb 27 13:24:48 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F3FA2AB64BC; Sat, 27 Feb 2016 13:24:47 +0000 (UTC) (envelope-from ronald-lists@klop.ws) Received: from smarthost1.greenhost.nl (smarthost1.greenhost.nl [195.190.28.81]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BD8E88BB; Sat, 27 Feb 2016 13:24:47 +0000 (UTC) (envelope-from ronald-lists@klop.ws) Received: from smtp.greenhost.nl ([213.108.104.138]) by smarthost1.greenhost.nl with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.72) (envelope-from ) id 1aZecB-0004MQ-PW; Sat, 27 Feb 2016 14:09:01 +0100 Content-Type: text/plain; charset=utf-8; format=flowed; delsp=yes To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, "Pedro F. Giffuni" Subject: Re: svn commit: r296109 - head/libexec/rlogind References: <201602262002.u1QK2298094838@repo.freebsd.org> Date: Sat, 27 Feb 2016 14:08:47 +0100 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: "Ronald Klop" Message-ID: In-Reply-To: <201602262002.u1QK2298094838@repo.freebsd.org> User-Agent: Opera Mail/12.16 (FreeBSD) X-Authenticated-As-Hash: 398f5522cb258ce43cb679602f8cfe8b62a256d1 X-Virus-Scanned: by clamav at smarthost1.samage.net X-Spam-Level: / X-Spam-Score: -0.2 X-Spam-Status: No, score=-0.2 required=5.0 tests=ALL_TRUSTED, BAYES_50 autolearn=disabled version=3.4.0 X-Scan-Signature: bb59c828db3c430e2c178cb0ddebf9e4 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Feb 2016 13:24:48 -0000 Hi, I'm not a FreeBSD commiter, but read these commits to stay informed about what is happening. This commit (and the one for talk) mentions _what_ is changed, but not _why_ it is changed. I'm curious why this is better. Mind to share any comments on this? Regards, Ronald. On Fri, 26 Feb 2016 21:02:02 +0100, Pedro F. Giffuni wrote: > Author: pfg > Date: Fri Feb 26 20:02:01 2016 > New Revision: 296109 > URL: https://svnweb.freebsd.org/changeset/base/296109 > > Log: > rlogin(1): Replace select(2) with poll(2). > Obtanied from: NetBSD (CVS Rev. 1.27 - 1.28) > > Modified: > head/libexec/rlogind/rlogind.c > > Modified: head/libexec/rlogind/rlogind.c > ============================================================================== > --- head/libexec/rlogind/rlogind.c Fri Feb 26 19:49:04 2016 (r296108) > +++ head/libexec/rlogind/rlogind.c Fri Feb 26 20:02:01 2016 (r296109) > @@ -76,6 +76,7 @@ __FBSDID("$FreeBSD$"); > #include > #include > #include > +#include > #include > #include > #include > @@ -350,34 +351,27 @@ protocol(int f, int p) > nfd = f + 1; > else > nfd = p + 1; > - if (nfd > FD_SETSIZE) { > - syslog(LOG_ERR, "select mask too small, increase FD_SETSIZE"); > - fatal(f, "internal error (select mask too small)", 0); > - } > for (;;) { > - fd_set ibits, obits, ebits, *omask; > + struct pollfd set[2]; > - FD_ZERO(&ebits); > - FD_ZERO(&ibits); > - FD_ZERO(&obits); > - omask = (fd_set *)NULL; > - if (fcc) { > - FD_SET(p, &obits); > - omask = &obits; > - } else > - FD_SET(f, &ibits); > + set[0].fd = p; > + set[0].events = POLLPRI; > + set[1].fd = f; > + set[1].events = 0; > + if (fcc) > + set[0].events |= POLLOUT; > + else > + set[1].events |= POLLIN; > if (pcc >= 0) { > - if (pcc) { > - FD_SET(f, &obits); > - omask = &obits; > - } else > - FD_SET(p, &ibits); > + if (pcc) > + set[1].events |= POLLOUT; > + else > + set[0].events |= POLLIN; > } > - FD_SET(p, &ebits); > - if ((n = select(nfd, &ibits, omask, &ebits, 0)) < 0) { > + if ((n = poll(set, 2, INFTIM)) < 0) { > if (errno == EINTR) > continue; > - fatal(f, "select", 1); > + fatal(f, "poll", 1); > } > if (n == 0) { > /* shouldn't happen... */ > @@ -385,18 +379,16 @@ protocol(int f, int p) > continue; > } > #define pkcontrol(c) ((c)&(TIOCPKT_FLUSHWRITE|TIOCPKT_NOSTOP|TIOCPKT_DOSTOP)) > - if (FD_ISSET(p, &ebits)) { > + if (set[0].revents & POLLPRI) { > cc = read(p, &cntl, 1); > if (cc == 1 && pkcontrol(cntl)) { > cntl |= oobdata[0]; > send(f, &cntl, 1, MSG_OOB); > - if (cntl & TIOCPKT_FLUSHWRITE) { > + if (cntl & TIOCPKT_FLUSHWRITE) > pcc = 0; > - FD_CLR(p, &ibits); > - } > } > } > - if (FD_ISSET(f, &ibits)) { > + if (set[1].revents & POLLIN) { > fcc = read(f, fibuf, sizeof(fibuf)); > if (fcc < 0 && errno == EWOULDBLOCK) > fcc = 0; > @@ -422,11 +414,10 @@ protocol(int f, int p) > goto top; /* n^2 */ > } > } > - FD_SET(p, &obits); /* try write */ > } > } > - if (FD_ISSET(p, &obits) && fcc > 0) { > + if (set[0].revents & POLLOUT && fcc > 0) { > cc = write(p, fbp, fcc); > if (cc > 0) { > fcc -= cc; > @@ -434,7 +425,7 @@ protocol(int f, int p) > } > } > - if (FD_ISSET(p, &ibits)) { > + if (set[0].revents & POLLIN) { > pcc = read(p, pibuf, sizeof (pibuf)); > pbp = pibuf; > if (pcc < 0 && errno == EWOULDBLOCK) > @@ -443,7 +434,6 @@ protocol(int f, int p) > break; > else if (pibuf[0] == 0) { > pbp++, pcc--; > - FD_SET(f, &obits); /* try write */ > } else { > if (pkcontrol(pibuf[0])) { > pibuf[0] |= oobdata[0]; > @@ -452,18 +442,8 @@ protocol(int f, int p) > pcc = 0; > } > } > - if ((FD_ISSET(f, &obits)) && pcc > 0) { > + if (set[1].revents & POLLOUT && pcc > 0) { > cc = write(f, pbp, pcc); > - if (cc < 0 && errno == EWOULDBLOCK) { > - /* > - * This happens when we try write after read > - * from p, but some old kernels balk at large > - * writes even when select returns true. > - */ > - if (!FD_ISSET(p, &ibits)) > - sleep(5); > - continue; > - } > if (cc > 0) { > pcc -= cc; > pbp += cc; > _______________________________________________ > svn-src-all@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/svn-src-all > To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org" From owner-svn-src-head@freebsd.org Sat Feb 27 14:45:34 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3580BAB502D; Sat, 27 Feb 2016 14:45:34 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DD54DC19; Sat, 27 Feb 2016 14:45:33 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1REjWTh022987; Sat, 27 Feb 2016 14:45:32 GMT (envelope-from oshogbo@FreeBSD.org) Received: (from oshogbo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1REjWiT022986; Sat, 27 Feb 2016 14:45:32 GMT (envelope-from oshogbo@FreeBSD.org) Message-Id: <201602271445.u1REjWiT022986@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: oshogbo set sender to oshogbo@FreeBSD.org using -f From: Mariusz Zaborski Date: Sat, 27 Feb 2016 14:45:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r296140 - head/libexec/casper X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Feb 2016 14:45:34 -0000 Author: oshogbo Date: Sat Feb 27 14:45:32 2016 New Revision: 296140 URL: https://svnweb.freebsd.org/changeset/base/296140 Log: Remove reaming files of the Casper daemon. Reported by: emaste Approved by: pjd (mentor) Deleted: head/libexec/casper/ From owner-svn-src-head@freebsd.org Sat Feb 27 14:47:35 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8F1F6AB50CA for ; Sat, 27 Feb 2016 14:47:35 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from nm12-vm0.bullet.mail.bf1.yahoo.com (nm12-vm0.bullet.mail.bf1.yahoo.com [98.139.213.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 45FCDD86 for ; Sat, 27 Feb 2016 14:47:35 +0000 (UTC) (envelope-from pfg@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1456584447; bh=KcCh90kGn9w1ICTEqONrWjtEnlCUzGoQBwoSK48DPlo=; h=Subject:To:References:From:Date:In-Reply-To:From:Subject; b=QfTrRI6idJJT37jRjMcElSs30fzxX6I/IcCqguIea8wjxcspta37GuvK8EPZc97NXOdpbIgsgdc3GslLf26dVP4enIQ8Znt5BzwXG0Zcb0XcyxXrhvO0fNR2WwnXf9gRyBAdbaEm6+jSxuxdQXrAu4umpBFcUJy8UXXaai3FD/JWZkME6BkN44lBNHohQjCt00OlSc7cf93jnv8cR5j/k0JSoy5wMvFXKTfzYkLGCrViyUMx564vudV4xjhCWQx9WLM+67rx0zejuLSx5rLLLM3uTKgzJnNz3Yol88bOjcjwS88SkIsl9gJSDuxSnQ5FFJjLtlmYXExWNgM1Zn4/7g== Received: from [98.139.215.143] by nm12.bullet.mail.bf1.yahoo.com with NNFMP; 27 Feb 2016 14:47:27 -0000 Received: from [98.139.213.10] by tm14.bullet.mail.bf1.yahoo.com with NNFMP; 27 Feb 2016 14:47:27 -0000 Received: from [127.0.0.1] by smtp110.mail.bf1.yahoo.com with NNFMP; 27 Feb 2016 14:47:27 -0000 X-Yahoo-Newman-Id: 775122.57883.bm@smtp110.mail.bf1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: 4MkSC4IVM1ngFMV26T15vCV9o87zTsXqN73SDJnnSNfZ1x7 Jbl2Avtcm6JME8wjCiYY2eYLm6.TZQfTaH0qpRldhAI28jJVGqPhsm5z5coH 0fyaMUR9zuFq4qEvauH_tbS5M.UU01EsODhQcAXAwF9fdYjtvtxvg_spFe5. 90XIqBtDHqgqmPpremSz03pRtMd9pc1vzXTyPbkTqj1v6eD16t2KAxqeJHS9 Gt3TkG4haWdlnT5aVvRKopY6VfzuQC8q7mvJvgmhux_NvNf0wrjpTufC14HM MLqTV6re0loG__QzpSjr7UuOP3O.JXWQlUydjwghwxGrirDFSxAeSujawTEE _Wal_90H7y8DLYpwvhh0fE92r7jYKBttVEeItVNhT47SXV1yUM26a5swowpY MHrI0tt3E2raRCcpX6.908MKYWLF0clK7Y9VpyUKcSVmVLqGDRO.jHMj3GfF bdcPoDhku2TRDSydPouKyLtnoV6rCiN6Gh2FZF4_Tkgi_KbF3gDBCc6evfAR rvzSW2ZIhKkSXk6zlSKqLv1XAJQuU0by7 X-Yahoo-SMTP: xcjD0guswBAZaPPIbxpWwLcp9Unf Subject: Re: svn commit: r296109 - head/libexec/rlogind To: Ronald Klop , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201602262002.u1QK2298094838@repo.freebsd.org> From: Pedro Giffuni Message-ID: <56D1B725.4000506@FreeBSD.org> Date: Sat, 27 Feb 2016 09:48:05 -0500 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Feb 2016 14:47:35 -0000 Hello; On 02/27/16 08:08, Ronald Klop wrote: > Hi, > > I'm not a FreeBSD commiter, but read these commits to stay informed > about what is happening. > This commit (and the one for talk) mentions _what_ is changed, but not > _why_ it is changed. I'm curious why this is better. Mind to share any > comments on this? > Sure. The difference is very small and it could even be argued if the change is worth it at all. Both poll(2) and select(2) do the same and have basically the same performance but poll(2) is a bit more scalable. > Regards, > Ronald. > > > On Fri, 26 Feb 2016 21:02:02 +0100, Pedro F. Giffuni > wrote: > ... >> Modified: head/libexec/rlogind/rlogind.c >> ============================================================================== >> >> --- head/libexec/rlogind/rlogind.c Fri Feb 26 19:49:04 2016 >> (r296108) >> +++ head/libexec/rlogind/rlogind.c Fri Feb 26 20:02:01 2016 >> (r296109) >> @@ -76,6 +76,7 @@ __FBSDID("$FreeBSD$"); >> #include >> #include >> #include >> +#include >> #include >> #include >> #include >> @@ -350,34 +351,27 @@ protocol(int f, int p) >> nfd = f + 1; >> else >> nfd = p + 1; >> - if (nfd > FD_SETSIZE) { >> - syslog(LOG_ERR, "select mask too small, increase FD_SETSIZE"); >> - fatal(f, "internal error (select mask too small)", 0); >> - } In the case of rlogind, note that the above limitation has disappeared by using poll(2). I will add that FreeBSD has a native poll(2) implementation, it is not a wrapper around select as some old postings would suggest. I don't have any plans to do a massive shakeup against select(2), this was some lower hanging fruit that was easy to change. For new code kqueue(2) should be preferred. Pedro. From owner-svn-src-head@freebsd.org Sat Feb 27 16:27:50 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 33476AB6414; Sat, 27 Feb 2016 16:27:50 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 03D261616; Sat, 27 Feb 2016 16:27:49 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1RGRnfn052543; Sat, 27 Feb 2016 16:27:49 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1RGRnNq052542; Sat, 27 Feb 2016 16:27:49 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201602271627.u1RGRnNq052542@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Sat, 27 Feb 2016 16:27:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r296141 - head/sys/powerpc/mpc85xx X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Feb 2016 16:27:50 -0000 Author: jhibbits Date: Sat Feb 27 16:27:48 2016 New Revision: 296141 URL: https://svnweb.freebsd.org/changeset/base/296141 Log: Move another range check to use RMAN_IS_DEFAULT_RANGE(). Modified: head/sys/powerpc/mpc85xx/lbc.c Modified: head/sys/powerpc/mpc85xx/lbc.c ============================================================================== --- head/sys/powerpc/mpc85xx/lbc.c Sat Feb 27 14:45:32 2016 (r296140) +++ head/sys/powerpc/mpc85xx/lbc.c Sat Feb 27 16:27:48 2016 (r296141) @@ -674,7 +674,7 @@ lbc_alloc_resource(device_t bus, device_ int needactivate; /* We only support default allocations. */ - if (start != 0ul || end != ~0ul) + if (!RMAN_IS_DEFAULT_RANGE(start, end)) return (NULL); sc = device_get_softc(bus); From owner-svn-src-head@freebsd.org Sat Feb 27 18:38:45 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1692FAB6C4F; Sat, 27 Feb 2016 18:38:45 +0000 (UTC) (envelope-from jilles@stack.nl) Received: from mx1.stack.nl (relay04.stack.nl [IPv6:2001:610:1108:5010::107]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client CN "mailhost.stack.nl", Issuer "CA Cert Signing Authority" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id D988EA42; Sat, 27 Feb 2016 18:38:44 +0000 (UTC) (envelope-from jilles@stack.nl) Received: from toad2.stack.nl (toad2.stack.nl [IPv6:2001:610:1108:5010::161]) by mx1.stack.nl (Postfix) with ESMTP id 18942B8061; Sat, 27 Feb 2016 19:38:41 +0100 (CET) Received: by toad2.stack.nl (Postfix, from userid 1677) id 414A7892F8; Sat, 27 Feb 2016 19:38:41 +0100 (CET) Date: Sat, 27 Feb 2016 19:38:41 +0100 From: Jilles Tjoelker To: Pedro Giffuni Cc: Ronald Klop , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r296109 - head/libexec/rlogind Message-ID: <20160227183841.GA62612@stack.nl> References: <201602262002.u1QK2298094838@repo.freebsd.org> <56D1B725.4000506@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <56D1B725.4000506@FreeBSD.org> User-Agent: Mutt/1.5.23 (2014-03-12) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Feb 2016 18:38:45 -0000 On Sat, Feb 27, 2016 at 09:48:05AM -0500, Pedro Giffuni wrote: > In the case of rlogind, note that the above limitation [FD_SETSIZE] > has disappeared by using poll(2). > I will add that FreeBSD has a native poll(2) implementation, it is > not a wrapper around select as some old postings would suggest. > I don't have any plans to do a massive shakeup against select(2), this > was some lower hanging fruit that was easy to change. For new code > kqueue(2) should be preferred. The FD_SETSIZE can be a more important issue in library code which may be called from applications that have many descriptors open already. I don't agree with always using kqueue(2) for new code. Provided poll(2) has the necessary functionality and the number of file descriptors is low, using poll(2) tends to result in simpler code and better performance. Also, poll(2) is more portable and avoids a failure mode from the kqueues rlimit. -- Jilles Tjoelker From owner-svn-src-head@freebsd.org Sat Feb 27 19:02:06 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3BB0BAB643D for ; Sat, 27 Feb 2016 19:02:06 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from nm10-vm0.bullet.mail.bf1.yahoo.com (nm10-vm0.bullet.mail.bf1.yahoo.com [98.139.213.147]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E873F1210 for ; Sat, 27 Feb 2016 19:02:05 +0000 (UTC) (envelope-from pfg@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1456599723; bh=TL4CB246w1goGmeAIlsZdDqV6yMYJWUwj7mapxXhFkQ=; h=Subject:To:References:Cc:From:Date:In-Reply-To:From:Subject; b=cXtEdXcj+KwKEaSoUv9JIQACeXDpDVyO5IZE1wm069lhDg+6L74PUVqMA/jodVXpHcY0cP23sikxS/MVzx1ZkiVFFp78zQXxld9Mx60Fx9rR86YCDkL0BU0guscVTz+typ41ZTKAKUMr9eDLZa1G92oAeNLQfDUVJMMYd79dInsGojawoPK6DjTxOO4zWCfVaQ1+vmwKtUahtte234sjGMivf0paolR6gQvAImNdCogwRuJKeJx9HdUFbiJhntLXfrKa/3g5OmOTxibjveysGNUfo1hl9ltHkWV/iVEmE2HCU0t7kjLPERDflTJer4pv+d8ImsNXBmuLZw5n0fYtSg== Received: from [66.196.81.172] by nm10.bullet.mail.bf1.yahoo.com with NNFMP; 27 Feb 2016 19:02:03 -0000 Received: from [98.139.211.199] by tm18.bullet.mail.bf1.yahoo.com with NNFMP; 27 Feb 2016 19:02:03 -0000 Received: from [127.0.0.1] by smtp208.mail.bf1.yahoo.com with NNFMP; 27 Feb 2016 19:02:03 -0000 X-Yahoo-Newman-Id: 461251.33511.bm@smtp208.mail.bf1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: YomrADYVM1l2L_4Lirwc9ktpegBioDFWAGA1WLy8VlTRMsN i1lFtmK6Tl0rZZKnjFKwN7.Y76LD7LiTzanYVGdZbgfeWhfO2yO.ELIsvg08 hSXbQHdcWGB5BdkeZypO7cSUVMAxQc0UTosJx0.p9E4HoQACq0toaCS2urMP jS4usoq46YWcMUvoW1aWf4QcXweLcIdQC8EwJ89gNKrNeXHhwPfMFLFDDMmk Ba_SEtud414VhSEtnVJUv6AFuM9fTaThSPwJeT3wQZ7ZwKJGb26SXflaG_ix BuK8RXiYauu6hC70Iq6QJv50OcWAAOzyXUpbh3SE8COrPypUtOt3t7y_K1Eu 9Tw83ZLOCyuXzlU166T5NXgz0Gn3lNpnFjJZI7uAm72F_3u6xnmdHnd4HnEy 6.13DKOzBEA90G2tcTF9FjSJYpjX8shmjSXB0m4uTHZ8Hy2kdpy8Sxo2GHig OM1.jmn9uAhcloiEwqEapGYJ41rvu6zQP5Str2G2q4.yW0u9wgQolkWe8wCJ xRaTSXkiwvQSN6Wo_KcbE5U014VNo1u2P X-Yahoo-SMTP: xcjD0guswBAZaPPIbxpWwLcp9Unf Subject: Re: svn commit: r296109 - head/libexec/rlogind To: Jilles Tjoelker References: <201602262002.u1QK2298094838@repo.freebsd.org> <56D1B725.4000506@FreeBSD.org> <20160227183841.GA62612@stack.nl> Cc: Ronald Klop , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Pedro Giffuni Message-ID: <56D1F2D1.4000008@FreeBSD.org> Date: Sat, 27 Feb 2016 14:02:41 -0500 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 MIME-Version: 1.0 In-Reply-To: <20160227183841.GA62612@stack.nl> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Feb 2016 19:02:06 -0000 On 02/27/16 13:38, Jilles Tjoelker wrote: > On Sat, Feb 27, 2016 at 09:48:05AM -0500, Pedro Giffuni wrote: >> In the case of rlogind, note that the above limitation [FD_SETSIZE] >> has disappeared by using poll(2). > >> I will add that FreeBSD has a native poll(2) implementation, it is >> not a wrapper around select as some old postings would suggest. > >> I don't have any plans to do a massive shakeup against select(2), this >> was some lower hanging fruit that was easy to change. For new code >> kqueue(2) should be preferred. > > The FD_SETSIZE can be a more important issue in library code which may > be called from applications that have many descriptors open already. > > I don't agree with always using kqueue(2) for new code. Provided poll(2) > has the necessary functionality and the number of file descriptors is > low, using poll(2) tends to result in simpler code and better > performance. Also, poll(2) is more portable and avoids a failure mode > from the kqueues rlimit. > Of course it pretty much depends on what you want to do. Yes, for something like talk we are fine with poll(). I also find poll() more readable than the alternatives. Pedro. From owner-svn-src-head@freebsd.org Sat Feb 27 20:39:38 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5B9ABAB59AA; Sat, 27 Feb 2016 20:39:38 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 392F41F47; Sat, 27 Feb 2016 20:39:38 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1RKdbgI027817; Sat, 27 Feb 2016 20:39:37 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1RKdaCw027811; Sat, 27 Feb 2016 20:39:36 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201602272039.u1RKdaCw027811@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Sat, 27 Feb 2016 20:39:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r296142 - in head/sys/powerpc: booke include powerpc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Feb 2016 20:39:38 -0000 Author: jhibbits Date: Sat Feb 27 20:39:36 2016 New Revision: 296142 URL: https://svnweb.freebsd.org/changeset/base/296142 Log: Implement pmap_change_attr() for PowerPC (Book-E only for now) Summary: Some drivers need special memory requirements. X86 solves this with a pmap_change_attr() API, which DRM uses for changing the mapping of the GART and other memory regions. Implement the same function for PowerPC. AIM currently does not need this, but will in the future for DRM, so a default is added for that, for business as usual. Book-E has some drivers coming down that do require non-default memory coherency. In this case, the Datapath Acceleration Architecture (DPAA) based ethernet controller has 2 regions for the buffer portals: cache-inhibited, and cache-enabled. By default, device memory is cache-inhibited. If the cache-enabled memory regions are mapped cache-inhibited, an alignment exception is thrown on access. Test Plan: Tested with a new driver to be added after this (DPAA dTSEC ethernet driver). No alignment exceptions thrown, driver works as expected with this. Reviewed By: nwhitehorn Sponsored by: Alex Perez/Inertial Computing Differential Revision: https://reviews.freebsd.org/D5471 Modified: head/sys/powerpc/booke/pmap.c head/sys/powerpc/include/pmap.h head/sys/powerpc/include/tlb.h head/sys/powerpc/powerpc/mmu_if.m head/sys/powerpc/powerpc/pmap_dispatch.c Modified: head/sys/powerpc/booke/pmap.c ============================================================================== --- head/sys/powerpc/booke/pmap.c Sat Feb 27 16:27:48 2016 (r296141) +++ head/sys/powerpc/booke/pmap.c Sat Feb 27 20:39:36 2016 (r296142) @@ -340,6 +340,8 @@ static void mmu_booke_dumpsys_unmap(mmu static void mmu_booke_scan_init(mmu_t); static vm_offset_t mmu_booke_quick_enter_page(mmu_t mmu, vm_page_t m); static void mmu_booke_quick_remove_page(mmu_t mmu, vm_offset_t addr); +static int mmu_booke_change_attr(mmu_t mmu, vm_offset_t addr, + vm_size_t sz, vm_memattr_t mode); static mmu_method_t mmu_booke_methods[] = { /* pmap dispatcher interface */ @@ -392,6 +394,7 @@ static mmu_method_t mmu_booke_methods[] MMUMETHOD(mmu_kextract, mmu_booke_kextract), /* MMUMETHOD(mmu_kremove, mmu_booke_kremove), */ MMUMETHOD(mmu_unmapdev, mmu_booke_unmapdev), + MMUMETHOD(mmu_change_attr, mmu_booke_change_attr), /* dumpsys() support */ MMUMETHOD(mmu_dumpsys_map, mmu_booke_dumpsys_map), @@ -419,6 +422,8 @@ tlb_calc_wimg(vm_paddr_t pa, vm_memattr_ return (MAS2_I); case VM_MEMATTR_WRITE_THROUGH: return (MAS2_W | MAS2_M); + case VM_MEMATTR_CACHEABLE: + return (MAS2_M); } } @@ -2900,6 +2905,63 @@ mmu_booke_mincore(mmu_t mmu, pmap_t pmap return (0); } +static int +mmu_booke_change_attr(mmu_t mmu, vm_offset_t addr, vm_size_t sz, + vm_memattr_t mode) +{ + vm_offset_t va; + pte_t *pte; + int i, j; + + /* Check TLB1 mappings */ + for (i = 0; i < tlb1_idx; i++) { + if (!(tlb1[i].mas1 & MAS1_VALID)) + continue; + if (addr >= tlb1[i].virt && addr < tlb1[i].virt + tlb1[i].size) + break; + } + if (i < tlb1_idx) { + /* Only allow full mappings to be modified for now. */ + /* Validate the range. */ + for (j = i, va = addr; va < addr + sz; va += tlb1[j].size, j++) { + if (va != tlb1[j].virt || (sz - (va - addr) < tlb1[j].size)) + return (EINVAL); + } + for (va = addr; va < addr + sz; va += tlb1[i].size, i++) { + tlb1[i].mas2 &= ~MAS2_WIMGE_MASK; + tlb1[i].mas2 |= tlb_calc_wimg(tlb1[i].phys, mode); + + /* + * Write it out to the TLB. Should really re-sync with other + * cores. + */ + tlb1_write_entry(i); + } + return (0); + } + + /* Not in TLB1, try through pmap */ + /* First validate the range. */ + for (va = addr; va < addr + sz; va += PAGE_SIZE) { + pte = pte_find(mmu, kernel_pmap, va); + if (pte == NULL || !PTE_ISVALID(pte)) + return (EINVAL); + } + + mtx_lock_spin(&tlbivax_mutex); + tlb_miss_lock(); + for (va = addr; va < addr + sz; va += PAGE_SIZE) { + pte = pte_find(mmu, kernel_pmap, va); + *pte &= ~(PTE_MAS2_MASK << PTE_MAS2_SHIFT); + *pte |= tlb_calc_wimg(PTE_PA(pte), mode << PTE_MAS2_SHIFT); + tlb0_flush_entry(va); + } + tlb_miss_unlock(); + mtx_unlock_spin(&tlbivax_mutex); + + return (pte_vatopa(mmu, kernel_pmap, va)); +} + /**************************************************************************/ /* TID handling */ /**************************************************************************/ Modified: head/sys/powerpc/include/pmap.h ============================================================================== --- head/sys/powerpc/include/pmap.h Sat Feb 27 16:27:48 2016 (r296141) +++ head/sys/powerpc/include/pmap.h Sat Feb 27 20:39:36 2016 (r296142) @@ -238,6 +238,7 @@ void *pmap_mapdev(vm_paddr_t, vm_size_t void *pmap_mapdev_attr(vm_paddr_t, vm_size_t, vm_memattr_t); void pmap_unmapdev(vm_offset_t, vm_size_t); void pmap_page_set_memattr(vm_page_t, vm_memattr_t); +int pmap_change_attr(vm_offset_t, vm_size_t, vm_memattr_t); void pmap_deactivate(struct thread *); vm_paddr_t pmap_kextract(vm_offset_t); int pmap_dev_direct_mapped(vm_paddr_t, vm_size_t); Modified: head/sys/powerpc/include/tlb.h ============================================================================== --- head/sys/powerpc/include/tlb.h Sat Feb 27 16:27:48 2016 (r296141) +++ head/sys/powerpc/include/tlb.h Sat Feb 27 20:39:36 2016 (r296142) @@ -74,6 +74,7 @@ #define MAS2_M 0x00000004 #define MAS2_G 0x00000002 #define MAS2_E 0x00000001 +#define MAS2_WIMGE_MASK 0x0000001F #define MAS3_RPN 0xFFFFF000 #define MAS3_RPN_SHIFT 12 Modified: head/sys/powerpc/powerpc/mmu_if.m ============================================================================== --- head/sys/powerpc/powerpc/mmu_if.m Sat Feb 27 16:27:48 2016 (r296141) +++ head/sys/powerpc/powerpc/mmu_if.m Sat Feb 27 20:39:36 2016 (r296142) @@ -124,6 +124,12 @@ CODE { { return; } + + static int mmu_null_change_attr(mmu_t mmu, vm_offset_t va, + vm_size_t sz, vm_memattr_t mode) + { + return (0); + } }; @@ -956,3 +962,20 @@ METHOD void quick_remove_page { vm_offset_t _va; }; +/** + * @brief Change the specified virtual address range's memory type. + * + * @param _va The virtual base address to change + * + * @param _sz Size of the region to change + * + * @param _mode New mode to set on the VA range + * + * @retval error 0 on success, EINVAL or ENOMEM on error. + */ +METHOD int change_attr { + mmu_t _mmu; + vm_offset_t _va; + vm_size_t _sz; + vm_memattr_t _mode; +} DEFAULT mmu_null_change_attr; Modified: head/sys/powerpc/powerpc/pmap_dispatch.c ============================================================================== --- head/sys/powerpc/powerpc/pmap_dispatch.c Sat Feb 27 16:27:48 2016 (r296141) +++ head/sys/powerpc/powerpc/pmap_dispatch.c Sat Feb 27 20:39:36 2016 (r296142) @@ -564,6 +564,13 @@ pmap_quick_remove_page(vm_offset_t addr) MMU_QUICK_REMOVE_PAGE(mmu_obj, addr); } +int +pmap_change_attr(vm_offset_t addr, vm_size_t size, vm_memattr_t mode) +{ + CTR4(KTR_PMAP, "%s(%#x, %#zx, %d)", __func__, addr, size, mode); + return (MMU_CHANGE_ATTR(mmu_obj, addr, size, mode)); +} + /* * MMU install routines. Highest priority wins, equal priority also * overrides allowing last-set to win. From owner-svn-src-head@freebsd.org Sat Feb 27 21:08:28 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A8645AB656A; Sat, 27 Feb 2016 21:08:28 +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 mx1.freebsd.org (Postfix) with ESMTPS id 6AFC4128F; Sat, 27 Feb 2016 21:08:28 +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 u1RL8RsQ038724; Sat, 27 Feb 2016 21:08:27 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1RL8RPM038721; Sat, 27 Feb 2016 21:08:27 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201602272108.u1RL8RPM038721@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Sat, 27 Feb 2016 21:08:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r296148 - head/sys/dev/filemon X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Feb 2016 21:08:28 -0000 Author: bdrewery Date: Sat Feb 27 21:08:27 2016 New Revision: 296148 URL: https://svnweb.freebsd.org/changeset/base/296148 Log: Remove old compatibility checks. MFC after: 3 days Sponsored by: EMC / Isilon Storage Division Modified: head/sys/dev/filemon/filemon.c head/sys/dev/filemon/filemon_wrapper.c Modified: head/sys/dev/filemon/filemon.c ============================================================================== --- head/sys/dev/filemon/filemon.c Sat Feb 27 21:05:21 2016 (r296147) +++ head/sys/dev/filemon/filemon.c Sat Feb 27 21:08:27 2016 (r296148) @@ -35,6 +35,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -52,10 +53,6 @@ __FBSDID("$FreeBSD$"); #include #include -#if __FreeBSD_version >= 900041 -#include -#endif - #include "filemon.h" #if defined(COMPAT_IA32) || defined(COMPAT_FREEBSD32) || defined(COMPAT_ARCH32) @@ -158,9 +155,7 @@ filemon_ioctl(struct cdev *dev, u_long c int error = 0; struct filemon *filemon; struct proc *p; -#if __FreeBSD_version >= 900041 cap_rights_t rights; -#endif if ((error = devfs_get_cdevpriv((void **) &filemon)) != 0) return (error); @@ -174,9 +169,7 @@ filemon_ioctl(struct cdev *dev, u_long c fdrop(filemon->fp, td); error = fget_write(td, *(int *)data, -#if __FreeBSD_version >= 900041 cap_rights_init(&rights, CAP_PWRITE), -#endif &filemon->fp); if (error == 0) /* Write the file header. */ Modified: head/sys/dev/filemon/filemon_wrapper.c ============================================================================== --- head/sys/dev/filemon/filemon_wrapper.c Sat Feb 27 21:05:21 2016 (r296147) +++ head/sys/dev/filemon/filemon_wrapper.c Sat Feb 27 21:08:27 2016 (r296148) @@ -36,27 +36,6 @@ __FBSDID("$FreeBSD$"); #include "opt_compat.h" -#if __FreeBSD_version > 800032 -#define FILEMON_HAS_LINKAT -#endif - -#if __FreeBSD_version < 900044 /* r225617 (2011-09-16) failed to bump - __FreeBSD_version. This really should - be based on "900045". "900044" is r225469 - (2011-09-10) so this code is broken for - 9-CURRENT September 10th-16th. */ -#define sys_chdir chdir -#define sys_link link -#define sys_open open -#define sys_rename rename -#define sys_stat stat -#define sys_symlink symlink -#define sys_unlink unlink -#ifdef FILEMON_HAS_LINKAT -#define sys_linkat linkat -#endif -#endif /* __FreeBSD_version */ - static eventhandler_tag filemon_exec_tag; static eventhandler_tag filemon_exit_tag; static eventhandler_tag filemon_fork_tag; @@ -347,7 +326,6 @@ filemon_wrapper_symlink(struct thread *t return (ret); } -#ifdef FILEMON_HAS_LINKAT static int filemon_wrapper_linkat(struct thread *td, struct linkat_args *uap) { @@ -376,7 +354,6 @@ filemon_wrapper_linkat(struct thread *td return (ret); } -#endif static int filemon_wrapper_stat(struct thread *td, struct stat_args *uap) @@ -530,9 +507,7 @@ filemon_wrapper_install(void) sv_table[SYS_unlink].sy_call = (sy_call_t *) filemon_wrapper_unlink; sv_table[SYS_link].sy_call = (sy_call_t *) filemon_wrapper_link; sv_table[SYS_symlink].sy_call = (sy_call_t *) filemon_wrapper_symlink; -#ifdef FILEMON_HAS_LINKAT sv_table[SYS_linkat].sy_call = (sy_call_t *) filemon_wrapper_linkat; -#endif #if defined(COMPAT_IA32) || defined(COMPAT_FREEBSD32) || defined(COMPAT_ARCH32) sv_table = ia32_freebsd_sysvec.sv_table; @@ -545,9 +520,7 @@ filemon_wrapper_install(void) sv_table[FREEBSD32_SYS_unlink].sy_call = (sy_call_t *) filemon_wrapper_unlink; sv_table[FREEBSD32_SYS_link].sy_call = (sy_call_t *) filemon_wrapper_link; sv_table[FREEBSD32_SYS_symlink].sy_call = (sy_call_t *) filemon_wrapper_symlink; -#ifdef FILEMON_HAS_LINKAT sv_table[FREEBSD32_SYS_linkat].sy_call = (sy_call_t *) filemon_wrapper_linkat; -#endif #endif /* COMPAT_ARCH32 */ filemon_exec_tag = EVENTHANDLER_REGISTER(process_exec, @@ -575,9 +548,7 @@ filemon_wrapper_deinstall(void) sv_table[SYS_unlink].sy_call = (sy_call_t *)sys_unlink; sv_table[SYS_link].sy_call = (sy_call_t *)sys_link; sv_table[SYS_symlink].sy_call = (sy_call_t *)sys_symlink; -#ifdef FILEMON_HAS_LINKAT sv_table[SYS_linkat].sy_call = (sy_call_t *)sys_linkat; -#endif #if defined(COMPAT_IA32) || defined(COMPAT_FREEBSD32) || defined(COMPAT_ARCH32) sv_table = ia32_freebsd_sysvec.sv_table; @@ -590,9 +561,7 @@ filemon_wrapper_deinstall(void) sv_table[FREEBSD32_SYS_unlink].sy_call = (sy_call_t *)sys_unlink; sv_table[FREEBSD32_SYS_link].sy_call = (sy_call_t *)sys_link; sv_table[FREEBSD32_SYS_symlink].sy_call = (sy_call_t *)sys_symlink; -#ifdef FILEMON_HAS_LINKAT sv_table[FREEBSD32_SYS_linkat].sy_call = (sy_call_t *)sys_linkat; -#endif #endif /* COMPAT_ARCH32 */ EVENTHANDLER_DEREGISTER(process_exec, filemon_exec_tag); From owner-svn-src-head@freebsd.org Sat Feb 27 21:16:38 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 67235AB683D; Sat, 27 Feb 2016 21:16:38 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail106.syd.optusnet.com.au (mail106.syd.optusnet.com.au [211.29.132.42]) by mx1.freebsd.org (Postfix) with ESMTP id 1405F19A9; Sat, 27 Feb 2016 21:16:37 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from c110-21-41-193.carlnfd1.nsw.optusnet.com.au (c110-21-41-193.carlnfd1.nsw.optusnet.com.au [110.21.41.193]) by mail106.syd.optusnet.com.au (Postfix) with ESMTPS id E0FDD3C436F; Sun, 28 Feb 2016 08:16:26 +1100 (AEDT) Date: Sun, 28 Feb 2016 08:16:25 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Jilles Tjoelker cc: Pedro Giffuni , Ronald Klop , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r296109 - head/libexec/rlogind In-Reply-To: <20160227183841.GA62612@stack.nl> Message-ID: <20160228071106.Y838@besplex.bde.org> References: <201602262002.u1QK2298094838@repo.freebsd.org> <56D1B725.4000506@FreeBSD.org> <20160227183841.GA62612@stack.nl> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=EfU1O6SC c=1 sm=1 tr=0 a=73JWPhLeruqQCjN69UNZtQ==:117 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=kj9zAlcOel0A:10 a=D56GzbUmr8MTfhCQDr8A:9 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Feb 2016 21:16:38 -0000 On Sat, 27 Feb 2016, Jilles Tjoelker wrote: > On Sat, Feb 27, 2016 at 09:48:05AM -0500, Pedro Giffuni wrote: >> In the case of rlogind, note that the above limitation [FD_SETSIZE] >> has disappeared by using poll(2). > >> I will add that FreeBSD has a native poll(2) implementation, it is >> not a wrapper around select as some old postings would suggest. > >> I don't have any plans to do a massive shakeup against select(2), this >> was some lower hanging fruit that was easy to change. For new code >> kqueue(2) should be preferred. > > The FD_SETSIZE can be a more important issue in library code which may > be called from applications that have many descriptors open already. > > I don't agree with always using kqueue(2) for new code. Provided poll(2) > has the necessary functionality and the number of file descriptors is > low, using poll(2) tends to result in simpler code and better > performance. Also, poll(2) is more portable and avoids a failure mode > from the kqueues rlimit. All the conversions to poll() seem to be buggy. poll() gives better detection of EOF, but you have to actually check for it or you get different behaviour from select(). gdb in FreeBSD has been broken for 10-15 years by misconversion to poll(). E.g.: ttyv1:bde@besplex:~> echo "p 2+2" | gdb -q (gdb) Hangup detected on fd 0 error detected on stdin This is because it fails to check for POLLIN on stdin when it sees POLLHUP on stdin. It loses all the buffered input. I tried more input. It loses all input for a buffer size of < 8K, then starts seeing some. The details depend on the kernel buffering. PIPE_BUF is only 512 but the kernel normally uses larger buffers than that. kdump output for this: 987 cat CALL write(0x1,0x8060000,0x1fff) 987 cat GIO fd 1 wrote 4096 bytes " p 2+2 p 2+2 ... p 2" 987 cat RET write 8191/0x1fff 987 cat CALL read(0x3,0x8060000,0x4000) 987 cat GIO fd 3 read 0 bytes "" 987 cat RET read 0 987 cat CALL close(0x3) 987 cat RET close 0 987 cat CALL close(0x1) 987 cat RET close 0 987 cat CALL exit(0) 986 sh RET wait4 987/0x3db 986 sh CALL wait4(0xffffffff,0xbfbfe7c8,0x2,0) 988 gdb RET poll 1 988 gdb CALL write(0x1,0x8300000,0x18) 988 gdb GIO fd 1 wrote 24 bytes "Hangup detected on fd 0 " 988 gdb RET write 24/0x18 988 gdb CALL write(0x1,0x8300000,0x18) 988 gdb GIO fd 1 wrote 24 bytes "error detected on stdin " 988 gdb RET write 24/0x18 988 gdb CALL sigprocmask(0x1,0,0xbfbfe33c) 988 gdb RET sigprocmask 0 988 gdb CALL exit(0) 986 sh RET wait4 988/0x3dc 986 sh CALL exit(0) The changes have the opposite problem. They check for POLLIN but not POLLHUP. This depends on the unportable and broken but possibly permittied behaviour of poll() always setting POLLIN when it sets POLLHUP. select() has no way to report POLLHUP, so it converts POLLHUP to input-ready. poll() should do the following: - for hangup with buffered input, as in the above pipe case, set POLLHUP to indicate the hangup and POLLIN to indicate the data - for hangup with no buffered input, set POLLHUP to indicate the hangup and clear POLLIN to indicate no data but the usual misimplementation does: - always set POLLIN when setting POLLHUP. This makes poll() behave more like select(), so that buggy conversions to poll() work, but it means that POLLIN cannot be trusted for determining if more than non-null data can be read. This is always done for regular files IIRC. For regular files, there is never any buffered input POLLHUP with POLLIN really means POLLHUP without POLLIN. Another possible misimplementation that I have not observed is: - delay setting POLLHUP until all buffered input has been read or discardered. This would work OK for terminals since terminals are specified to discard input on hangup (but there are many races at low levels with the timing of the hangup and the input -- many drivers lose input much like gdb does -- they deliver the hangup to upper layers synchronously, but deliver buffered input later). However, for pipes the input is not discarded, so POLLHUP should not be delayed, so that applications can decide if they want to discard the input on hanhyp. The poll regression tests check which version of the bugs are implemented for pipes and sockets. They only pass for some file types because the bugs are implemented for others. The buggy cases are system-dependent. Due to the bugs, POLLIN together with POLLHUP can never be trusted. Applications should use similar code to after select() to detect EOF: switch (events & (POLLHUP | POLLIN)) { case POLLHUP: /* Non-buggy case. */ exit(0); case POLLIN: /* Normal input. */ nr = read(fd, buf, size); if (nr == 0) goto maybe_eof; /* likely EOF, but check again */ handle_input(nr); break; case POLLHUP | POLLIN: nr = read(fd, buf, size); if (nr == 0) /* * There may have been input that was eaten by a * race, but any new input would be associated with * a new connection and we don't want to see it * even if POLLHUP is not sticky for this file type. */ exit(0); } or in a sloppier version, just convert POLLHUP to POLLIN like select() does, and assume that that other threads don't eat the input so that reading 0 means EOF: if (events & POLLHUP) events |= POLLIN; if (events & POLLIN) { nr = read(fd, buf, size); if (nr == 0) exit(0); /* only likely EOF, but don't check */ } handle_input(nr); Bruce From owner-svn-src-head@freebsd.org Sat Feb 27 22:26:07 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 23680AB6FB4; Sat, 27 Feb 2016 22:26:07 +0000 (UTC) (envelope-from jmcneill@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D16F21637; Sat, 27 Feb 2016 22:26:06 +0000 (UTC) (envelope-from jmcneill@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1RMQ5R6062910; Sat, 27 Feb 2016 22:26:05 GMT (envelope-from jmcneill@FreeBSD.org) Received: (from jmcneill@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1RMQ5sk062908; Sat, 27 Feb 2016 22:26:05 GMT (envelope-from jmcneill@FreeBSD.org) Message-Id: <201602272226.u1RMQ5sk062908@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jmcneill set sender to jmcneill@FreeBSD.org using -f From: Jared McNeill Date: Sat, 27 Feb 2016 22:26:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r296149 - head/sys/arm/allwinner X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Feb 2016 22:26:07 -0000 Author: jmcneill Date: Sat Feb 27 22:26:05 2016 New Revision: 296149 URL: https://svnweb.freebsd.org/changeset/base/296149 Log: Fix PIO mode on A31 and later SoCs. Newer Allwinner MMC implementations use a different FIFO register offset (0x200 instead of 0x100). Since the FDT uses the same compat string for both cases, base the decision on which FIFO offset to use on the Allwinner SoC family. Reviewed by: Emmanuel Vadot Approved by: gonzo (mentor) Differential Revision: https://reviews.freebsd.org/D5468 Modified: head/sys/arm/allwinner/a10_mmc.c head/sys/arm/allwinner/a10_mmc.h Modified: head/sys/arm/allwinner/a10_mmc.c ============================================================================== --- head/sys/arm/allwinner/a10_mmc.c Sat Feb 27 21:08:27 2016 (r296148) +++ head/sys/arm/allwinner/a10_mmc.c Sat Feb 27 22:26:05 2016 (r296149) @@ -86,6 +86,7 @@ struct a10_mmc_softc { uint32_t a10_intr; uint32_t a10_intr_wait; void * a10_intrhand; + bus_size_t a10_fifo_reg; /* Fields required for DMA access. */ bus_addr_t a10_dma_desc_phys; @@ -170,6 +171,21 @@ a10_mmc_attach(device_t dev) return (ENXIO); } + /* + * Later chips use a different FIFO offset. Unfortunately the FDT + * uses the same compatible string for old and new implementations. + */ + switch (allwinner_soc_family()) { + case ALLWINNERSOC_SUN4I: + case ALLWINNERSOC_SUN5I: + case ALLWINNERSOC_SUN7I: + sc->a10_fifo_reg = A10_MMC_FIFO; + break; + default: + sc->a10_fifo_reg = A31_MMC_FIFO; + break; + } + /* Activate the module clock. */ switch (allwinner_soc_type()) { #if defined(SOC_ALLWINNER_A10) || defined(SOC_ALLWINNER_A20) @@ -513,9 +529,9 @@ a10_mmc_pio_transfer(struct a10_mmc_soft if ((A10_MMC_READ_4(sc, A10_MMC_STAS) & bit)) return (1); if (write) - A10_MMC_WRITE_4(sc, A10_MMC_FIFO, buf[i]); + A10_MMC_WRITE_4(sc, sc->a10_fifo_reg, buf[i]); else - buf[i] = A10_MMC_READ_4(sc, A10_MMC_FIFO); + buf[i] = A10_MMC_READ_4(sc, sc->a10_fifo_reg); sc->a10_resid = i + 1; } Modified: head/sys/arm/allwinner/a10_mmc.h ============================================================================== --- head/sys/arm/allwinner/a10_mmc.h Sat Feb 27 21:08:27 2016 (r296148) +++ head/sys/arm/allwinner/a10_mmc.h Sat Feb 27 22:26:05 2016 (r296149) @@ -56,7 +56,8 @@ #define A10_MMC_IDIE 0x8C /* IDMAC Interrupt Enable Register */ #define A10_MMC_CHDA 0x90 #define A10_MMC_CBDA 0x94 -#define A10_MMC_FIFO 0x100 /* FIFO Access Address */ +#define A10_MMC_FIFO 0x100 /* FIFO Access Address (A10/A20) */ +#define A31_MMC_FIFO 0x200 /* FIFO Access Address (A31) */ /* A10_MMC_GCTRL */ #define A10_MMC_SOFT_RESET (1U << 0) From owner-svn-src-head@freebsd.org Sat Feb 27 23:40:00 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A0557AB6600; Sat, 27 Feb 2016 23:40:00 +0000 (UTC) (envelope-from junovitch@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 726AE1891; Sat, 27 Feb 2016 23:40:00 +0000 (UTC) (envelope-from junovitch@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1RNdx4O084241; Sat, 27 Feb 2016 23:39:59 GMT (envelope-from junovitch@FreeBSD.org) Received: (from junovitch@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1RNdx5a084240; Sat, 27 Feb 2016 23:39:59 GMT (envelope-from junovitch@FreeBSD.org) Message-Id: <201602272339.u1RNdx5a084240@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: junovitch set sender to junovitch@FreeBSD.org using -f From: Jason Unovitch Date: Sat, 27 Feb 2016 23:39:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r296150 - head/share/misc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Feb 2016 23:40:00 -0000 Author: junovitch (ports committer) Date: Sat Feb 27 23:39:59 2016 New Revision: 296150 URL: https://svnweb.freebsd.org/changeset/base/296150 Log: - Add myself to ports-secteam Approved by: delphij, miwi, feld Modified: head/share/misc/organization.dot Modified: head/share/misc/organization.dot ============================================================================== --- head/share/misc/organization.dot Sat Feb 27 22:26:05 2016 (r296149) +++ head/share/misc/organization.dot Sat Feb 27 23:39:59 2016 (r296150) @@ -34,7 +34,7 @@ portmgr [label="Port Management Team\npo portmgrsecretary [label="Port Management Team Secretary\nportmgr-secretary@FreeBSD.org\nculot"] re [label="Primary Release Engineering Team\nre@FreeBSD.org\nkib, blackend, jpaetzel, hrs, kensmith"] secteam [label="Security Team\nsecteam@FreeBSD.org\nsimon, qingli, delphij,\nremko, philip, stas, cperciva,\ncsjp, rwatson, miwi, bz"] -portssecteam [label="Ports Security Team\nports-secteam@FreeBSD.org\ndelphij, eadler, feld, jgh, miwi, rea, sbz, simon, swills, zi"] +portssecteam [label="Ports Security Team\nports-secteam@FreeBSD.org\ndelphij, eadler, feld, jgh, junovitch, miwi, rea, sbz, simon, swills, zi"] secteamsecretary [label="Security Team Secretary\nsecteam-secretary@FreeBSD.org\nremko"] securityofficer [label="Security Officer Team\nsecurity-officer@FreeBSD.org\ncperciva, simon, nectar"] srccommitters [label="Src Committers\nsrc-committers@FreeBSD.org"]