From owner-svn-src-stable-7@FreeBSD.ORG Sun Mar 29 01:00:49 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 49BC2106564A; Sun, 29 Mar 2009 01:00:49 +0000 (UTC) (envelope-from kientzle@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2D5D48FC20; Sun, 29 Mar 2009 01:00:49 +0000 (UTC) (envelope-from kientzle@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2T10naj017654; Sun, 29 Mar 2009 01:00:49 GMT (envelope-from kientzle@svn.freebsd.org) Received: (from kientzle@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2T10n6a017653; Sun, 29 Mar 2009 01:00:49 GMT (envelope-from kientzle@svn.freebsd.org) Message-Id: <200903290100.n2T10n6a017653@svn.freebsd.org> From: Tim Kientzle Date: Sun, 29 Mar 2009 01:00:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190516 - stable/7/bin/pax X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Mar 2009 01:00:50 -0000 Author: kientzle Date: Sun Mar 29 01:00:48 2009 New Revision: 190516 URL: http://svn.freebsd.org/changeset/base/190516 Log: MFC r187976: Restore timestamps on symlinks Before this fix, pax would stop the restore sequence for symlinks after setting the owner. As a result, mode and timestamp were not restored. This patch corrects the problem by simply removing the short-circuit for symlinks and using lchown()/lchmod()/lutimes() always for restoring metadata. PR: bin/91316 Submitted by: Jaakko Heinonen Reviewed by: Joerg Sonnenberger Approved by: re (Ken Smith) Modified: stable/7/bin/pax/ (props changed) stable/7/bin/pax/file_subs.c Modified: stable/7/bin/pax/file_subs.c ============================================================================== --- stable/7/bin/pax/file_subs.c Sat Mar 28 23:24:34 2009 (r190515) +++ stable/7/bin/pax/file_subs.c Sun Mar 29 01:00:48 2009 (r190516) @@ -425,19 +425,11 @@ node_creat(ARCHD *arcn) * we were able to create the node. set uid/gid, modes and times */ if (pids) - res = ((arcn->type == PAX_SLK) ? - set_lids(arcn->name, arcn->sb.st_uid, arcn->sb.st_gid) : - set_ids(arcn->name, arcn->sb.st_uid, arcn->sb.st_gid)); + res = set_ids(arcn->name, arcn->sb.st_uid, arcn->sb.st_gid); else res = 0; /* - * symlinks are done now. - */ - if (arcn->type == PAX_SLK) - return(0); - - /* * IMPORTANT SECURITY NOTE: * if not preserving mode or we cannot set uid/gid, then PROHIBIT any * set uid/gid bits @@ -632,7 +624,7 @@ chk_path( char *name, uid_t st_uid, gid_ * used by -t to reset access times). * When ign is zero, only those times the user has asked for are set, the * other ones are left alone. We do not assume the un-documented feature - * of many utimes() implementations that consider a 0 time value as a do + * of many lutimes() implementations that consider a 0 time value as a do * not set request. */ @@ -661,7 +653,7 @@ set_ftime(char *fnm, time_t mtime, time_ /* * set the times */ - if (utimes(fnm, tv) < 0) + if (lutimes(fnm, tv) < 0) syswarn(1, errno, "Access/modification time set failed on: %s", fnm); return; @@ -677,30 +669,6 @@ set_ftime(char *fnm, time_t mtime, time_ int set_ids(char *fnm, uid_t uid, gid_t gid) { - if (chown(fnm, uid, gid) < 0) { - /* - * ignore EPERM unless in verbose mode or being run by root. - * if running as pax, POSIX requires a warning. - */ - if (strcmp(NM_PAX, argv0) == 0 || errno != EPERM || vflag || - geteuid() == 0) - syswarn(1, errno, "Unable to set file uid/gid of %s", - fnm); - return(-1); - } - return(0); -} - -/* - * set_lids() - * set the uid and gid of a file system node - * Return: - * 0 when set, -1 on failure - */ - -int -set_lids(char *fnm, uid_t uid, gid_t gid) -{ if (lchown(fnm, uid, gid) < 0) { /* * ignore EPERM unless in verbose mode or being run by root. @@ -724,7 +692,7 @@ void set_pmode(char *fnm, mode_t mode) { mode &= ABITS; - if (chmod(fnm, mode) < 0) + if (lchmod(fnm, mode) < 0) syswarn(1, errno, "Could not set permissions on %s", fnm); return; } From owner-svn-src-stable-7@FreeBSD.ORG Sun Mar 29 01:04:13 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8807C1065670; Sun, 29 Mar 2009 01:04:13 +0000 (UTC) (envelope-from kientzle@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 760008FC21; Sun, 29 Mar 2009 01:04:13 +0000 (UTC) (envelope-from kientzle@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2T14DN0017755; Sun, 29 Mar 2009 01:04:13 GMT (envelope-from kientzle@svn.freebsd.org) Received: (from kientzle@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2T14D7g017754; Sun, 29 Mar 2009 01:04:13 GMT (envelope-from kientzle@svn.freebsd.org) Message-Id: <200903290104.n2T14D7g017754@svn.freebsd.org> From: Tim Kientzle Date: Sun, 29 Mar 2009 01:04:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190517 - stable/7/usr.bin/tar X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Mar 2009 01:04:14 -0000 Author: kientzle Date: Sun Mar 29 01:04:13 2009 New Revision: 190517 URL: http://svn.freebsd.org/changeset/base/190517 Log: Merge r188343 from -CURRENT: Unbreak writing shar archives. When copying file data to the archive, don't write more than was read. This seems to have only affected the shar writer, since other formats proactively truncate output to the originally-advertised size. PR: bin/131244 Approved by: re (Ken Smith) Modified: stable/7/usr.bin/tar/ (props changed) stable/7/usr.bin/tar/write.c Modified: stable/7/usr.bin/tar/write.c ============================================================================== --- stable/7/usr.bin/tar/write.c Sun Mar 29 01:00:48 2009 (r190516) +++ stable/7/usr.bin/tar/write.c Sun Mar 29 01:04:13 2009 (r190517) @@ -966,7 +966,7 @@ write_file_data(struct bsdtar *bsdtar, s siginfo_printinfo(bsdtar, progress); bytes_written = archive_write_data(a, bsdtar->buff, - FILEDATABUFLEN); + bytes_read); if (bytes_written < 0) { /* Write failed; this is bad */ bsdtar_warnc(bsdtar, 0, "%s", archive_error_string(a)); From owner-svn-src-stable-7@FreeBSD.ORG Sun Mar 29 08:07:37 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AA10A106566B; Sun, 29 Mar 2009 08:07:37 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 93BCF8FC1C; Sun, 29 Mar 2009 08:07:37 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2T87beL025782; Sun, 29 Mar 2009 08:07:37 GMT (envelope-from dchagin@svn.freebsd.org) Received: (from dchagin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2T87b4D025770; Sun, 29 Mar 2009 08:07:37 GMT (envelope-from dchagin@svn.freebsd.org) Message-Id: <200903290807.n2T87b4D025770@svn.freebsd.org> From: Dmitry Chagin Date: Sun, 29 Mar 2009 08:07:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190520 - in stable/7/sys: . amd64/amd64 amd64/linux32 arm/arm compat/ia32 compat/svr4 contrib/pf dev/ath/ath_hal dev/cxgb i386/i386 i386/linux ia64/ia64 kern powerpc/powerpc sparc64/sp... X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Mar 2009 08:07:38 -0000 Author: dchagin Date: Sun Mar 29 08:07:36 2009 New Revision: 190520 URL: http://svn.freebsd.org/changeset/base/190520 Log: Merge from head to stable/7: r189771: Implement new way of branding ELF binaries by looking to a ".note.ABI-tag" section. The search order of a brand is changed, now first of all the ".note.ABI-tag" is looked through. Move code which fetch osreldate for ELF binary to check_note() handler. r189919: Use the properly sized types for ELF object header and program headers. This fixes osrel fetching from the FreeBSD branding note for the 64bit platforms (bug introduced by r189771). r190264: Fix several issues with parsing the notes for ELF objects. Badly formed ELF note may cause the caclulated pointer to the next note to point both after the note region, that was checked in the code, but also to point before the region, that was not checked [1]. Remember the first note location in note0 and leap out if the note is not between note0 and note_end. In the similar way, badly formed note may cause infinite loop by pointing next note into the same or previous note. Guard against this by limiting amount of loop iterations by arbitrary choosen big number. For clarity, check the calculated note alignment in each iteration. PR: kern/132886 Approved by: re(Ken Smith) Modified: stable/7/sys/ (props changed) stable/7/sys/amd64/amd64/elf_machdep.c stable/7/sys/amd64/linux32/linux32_sysvec.c stable/7/sys/arm/arm/elf_machdep.c stable/7/sys/compat/ia32/ia32_sysvec.c stable/7/sys/compat/svr4/svr4_sysvec.c stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/i386/i386/elf_machdep.c stable/7/sys/i386/linux/linux_sysvec.c stable/7/sys/ia64/ia64/elf_machdep.c stable/7/sys/kern/imgact_elf.c stable/7/sys/powerpc/powerpc/elf_machdep.c stable/7/sys/sparc64/sparc64/elf_machdep.c stable/7/sys/sys/imgact_elf.h Modified: stable/7/sys/amd64/amd64/elf_machdep.c ============================================================================== --- stable/7/sys/amd64/amd64/elf_machdep.c Sun Mar 29 07:10:52 2009 (r190519) +++ stable/7/sys/amd64/amd64/elf_machdep.c Sun Mar 29 08:07:36 2009 (r190520) @@ -83,7 +83,8 @@ static Elf64_Brandinfo freebsd_brand_inf .interp_path = "/libexec/ld-elf.so.1", .sysvec = &elf64_freebsd_sysvec, .interp_newpath = NULL, - .flags = BI_CAN_EXEC_DYN, + .brand_note = &elf64_freebsd_brandnote, + .flags = BI_CAN_EXEC_DYN }; SYSINIT(elf64, SI_SUB_EXEC, SI_ORDER_ANY, @@ -98,7 +99,8 @@ static Elf64_Brandinfo freebsd_brand_oin .interp_path = "/usr/libexec/ld-elf.so.1", .sysvec = &elf64_freebsd_sysvec, .interp_newpath = NULL, - .flags = BI_CAN_EXEC_DYN, + .brand_note = &elf64_freebsd_brandnote, + .flags = BI_CAN_EXEC_DYN }; SYSINIT(oelf64, SI_SUB_EXEC, SI_ORDER_ANY, Modified: stable/7/sys/amd64/linux32/linux32_sysvec.c ============================================================================== --- stable/7/sys/amd64/linux32/linux32_sysvec.c Sun Mar 29 07:10:52 2009 (r190519) +++ stable/7/sys/amd64/linux32/linux32_sysvec.c Sun Mar 29 08:07:36 2009 (r190520) @@ -1034,6 +1034,16 @@ struct sysentvec elf_linux_sysvec = { .sv_maxssiz = &linux32_maxssiz, }; +static char GNULINUX_ABI_VENDOR[] = "GNU"; + +static Elf_Brandnote linux32_brandnote = { + .hdr.n_namesz = sizeof(GNULINUX_ABI_VENDOR), + .hdr.n_descsz = 16, + .hdr.n_type = 1, + .vendor = GNULINUX_ABI_VENDOR, + .flags = 0 +}; + static Elf32_Brandinfo linux_brand = { .brand = ELFOSABI_LINUX, .machine = EM_386, @@ -1042,7 +1052,8 @@ static Elf32_Brandinfo linux_brand = { .interp_path = "/lib/ld-linux.so.1", .sysvec = &elf_linux_sysvec, .interp_newpath = NULL, - .flags = BI_CAN_EXEC_DYN, + .brand_note = &linux32_brandnote, + .flags = BI_CAN_EXEC_DYN }; static Elf32_Brandinfo linux_glibc2brand = { @@ -1053,7 +1064,8 @@ static Elf32_Brandinfo linux_glibc2brand .interp_path = "/lib/ld-linux.so.2", .sysvec = &elf_linux_sysvec, .interp_newpath = NULL, - .flags = BI_CAN_EXEC_DYN, + .brand_note = &linux32_brandnote, + .flags = BI_CAN_EXEC_DYN }; Elf32_Brandinfo *linux_brandlist[] = { Modified: stable/7/sys/arm/arm/elf_machdep.c ============================================================================== --- stable/7/sys/arm/arm/elf_machdep.c Sun Mar 29 07:10:52 2009 (r190519) +++ stable/7/sys/arm/arm/elf_machdep.c Sun Mar 29 08:07:36 2009 (r190520) @@ -83,7 +83,8 @@ static Elf32_Brandinfo freebsd_brand_inf .interp_path = "/libexec/ld-elf.so.1", .sysvec = &elf32_freebsd_sysvec, .interp_newpath = NULL, - .flags = BI_CAN_EXEC_DYN, + .brand_note = &elf32_freebsd_brandnote, + .flags = BI_CAN_EXEC_DYN }; SYSINIT(elf32, SI_SUB_EXEC, SI_ORDER_ANY, @@ -98,7 +99,8 @@ static Elf32_Brandinfo freebsd_brand_oin .interp_path = "/usr/libexec/ld-elf.so.1", .sysvec = &elf32_freebsd_sysvec, .interp_newpath = NULL, - .flags = BI_CAN_EXEC_DYN, + .brand_note = &elf32_freebsd_brandnote, + .flags = BI_CAN_EXEC_DYN }; SYSINIT(oelf32, SI_SUB_EXEC, SI_ORDER_ANY, Modified: stable/7/sys/compat/ia32/ia32_sysvec.c ============================================================================== --- stable/7/sys/compat/ia32/ia32_sysvec.c Sun Mar 29 07:10:52 2009 (r190519) +++ stable/7/sys/compat/ia32/ia32_sysvec.c Sun Mar 29 08:07:36 2009 (r190520) @@ -147,6 +147,7 @@ static Elf32_Brandinfo ia32_brand_info = .interp_path = "/libexec/ld-elf.so.1", .sysvec = &ia32_freebsd_sysvec, .interp_newpath = "/libexec/ld-elf32.so.1", + .brand_note = &elf32_freebsd_brandnote, .flags = BI_CAN_EXEC_DYN }; @@ -162,7 +163,8 @@ static Elf32_Brandinfo ia32_brand_oinfo .interp_path = "/usr/libexec/ld-elf.so.1", .sysvec = &ia32_freebsd_sysvec, .interp_newpath = "/libexec/ld-elf32.so.1", - .flags = BI_CAN_EXEC_DYN, + .brand_note = &elf32_freebsd_brandnote, + .flags = BI_CAN_EXEC_DYN }; SYSINIT(oia32, SI_SUB_EXEC, SI_ORDER_ANY, Modified: stable/7/sys/compat/svr4/svr4_sysvec.c ============================================================================== --- stable/7/sys/compat/svr4/svr4_sysvec.c Sun Mar 29 07:10:52 2009 (r190519) +++ stable/7/sys/compat/svr4/svr4_sysvec.c Sun Mar 29 08:07:36 2009 (r190520) @@ -206,6 +206,7 @@ Elf32_Brandinfo svr4_brand = { .interp_path = "/lib/libc.so.1", .sysvec = &svr4_sysvec, .interp_newpath = NULL, + .brand_note = NULL, .flags = 0 }; Modified: stable/7/sys/i386/i386/elf_machdep.c ============================================================================== --- stable/7/sys/i386/i386/elf_machdep.c Sun Mar 29 07:10:52 2009 (r190519) +++ stable/7/sys/i386/i386/elf_machdep.c Sun Mar 29 08:07:36 2009 (r190520) @@ -83,7 +83,8 @@ static Elf32_Brandinfo freebsd_brand_inf .interp_path = "/libexec/ld-elf.so.1", .sysvec = &elf32_freebsd_sysvec, .interp_newpath = NULL, - .flags = BI_CAN_EXEC_DYN, + .brand_note = &elf32_freebsd_brandnote, + .flags = BI_CAN_EXEC_DYN }; SYSINIT(elf32, SI_SUB_EXEC, SI_ORDER_ANY, @@ -98,7 +99,8 @@ static Elf32_Brandinfo freebsd_brand_oin .interp_path = "/usr/libexec/ld-elf.so.1", .sysvec = &elf32_freebsd_sysvec, .interp_newpath = NULL, - .flags = BI_CAN_EXEC_DYN, + .brand_note = &elf32_freebsd_brandnote, + .flags = BI_CAN_EXEC_DYN }; SYSINIT(oelf32, SI_SUB_EXEC, SI_ORDER_ANY, Modified: stable/7/sys/i386/linux/linux_sysvec.c ============================================================================== --- stable/7/sys/i386/linux/linux_sysvec.c Sun Mar 29 07:10:52 2009 (r190519) +++ stable/7/sys/i386/linux/linux_sysvec.c Sun Mar 29 08:07:36 2009 (r190520) @@ -869,6 +869,16 @@ struct sysentvec elf_linux_sysvec = { .sv_maxssiz = NULL }; +static char GNULINUX_ABI_VENDOR[] = "GNU"; + +static Elf_Brandnote linux_brandnote = { + .hdr.n_namesz = sizeof(GNULINUX_ABI_VENDOR), + .hdr.n_descsz = 16, + .hdr.n_type = 1, + .vendor = GNULINUX_ABI_VENDOR, + .flags = 0 +}; + static Elf32_Brandinfo linux_brand = { .brand = ELFOSABI_LINUX, .machine = EM_386, @@ -877,7 +887,8 @@ static Elf32_Brandinfo linux_brand = { .interp_path = "/lib/ld-linux.so.1", .sysvec = &elf_linux_sysvec, .interp_newpath = NULL, - .flags = BI_CAN_EXEC_DYN, + .brand_note = &linux_brandnote, + .flags = BI_CAN_EXEC_DYN }; static Elf32_Brandinfo linux_glibc2brand = { @@ -888,7 +899,8 @@ static Elf32_Brandinfo linux_glibc2brand .interp_path = "/lib/ld-linux.so.2", .sysvec = &elf_linux_sysvec, .interp_newpath = NULL, - .flags = BI_CAN_EXEC_DYN, + .brand_note = &linux_brandnote, + .flags = BI_CAN_EXEC_DYN }; Elf32_Brandinfo *linux_brandlist[] = { Modified: stable/7/sys/ia64/ia64/elf_machdep.c ============================================================================== --- stable/7/sys/ia64/ia64/elf_machdep.c Sun Mar 29 07:10:52 2009 (r190519) +++ stable/7/sys/ia64/ia64/elf_machdep.c Sun Mar 29 08:07:36 2009 (r190520) @@ -91,7 +91,8 @@ static Elf64_Brandinfo freebsd_brand_inf .interp_path = "/libexec/ld-elf.so.1", .sysvec = &elf64_freebsd_sysvec, .interp_newpath = NULL, - .flags = BI_CAN_EXEC_DYN, + .brand_note = &elf64_freebsd_brandnote, + .flags = BI_CAN_EXEC_DYN }; SYSINIT(elf64, SI_SUB_EXEC, SI_ORDER_ANY, (sysinit_cfunc_t)elf64_insert_brand_entry, &freebsd_brand_info); @@ -104,7 +105,8 @@ static Elf64_Brandinfo freebsd_brand_oin .interp_path = "/usr/libexec/ld-elf.so.1", .sysvec = &elf64_freebsd_sysvec, .interp_newpath = NULL, - .flags = BI_CAN_EXEC_DYN, + .brand_note = &elf64_freebsd_brandnote, + .flags = BI_CAN_EXEC_DYN }; SYSINIT(oelf64, SI_SUB_EXEC, SI_ORDER_ANY, (sysinit_cfunc_t)elf64_insert_brand_entry, &freebsd_brand_oinfo); Modified: stable/7/sys/kern/imgact_elf.c ============================================================================== --- stable/7/sys/kern/imgact_elf.c Sun Mar 29 07:10:52 2009 (r190519) +++ stable/7/sys/kern/imgact_elf.c Sun Mar 29 08:07:36 2009 (r190520) @@ -78,14 +78,16 @@ __FBSDID("$FreeBSD$"); #define OLD_EI_BRAND 8 static int __elfN(check_header)(const Elf_Ehdr *hdr); -static Elf_Brandinfo *__elfN(get_brandinfo)(const Elf_Ehdr *hdr, - const char *interp); +static Elf_Brandinfo *__elfN(get_brandinfo)(struct image_params *imgp, + const char *interp, int32_t *osrel); static int __elfN(load_file)(struct proc *p, const char *file, u_long *addr, u_long *entry, size_t pagesize); static int __elfN(load_section)(struct vmspace *vmspace, vm_object_t object, vm_offset_t offset, caddr_t vmaddr, size_t memsz, size_t filsz, vm_prot_t prot, size_t pagesize); static int __CONCAT(exec_, __elfN(imgact))(struct image_params *imgp); +static boolean_t __elfN(check_note)(struct image_params *imgp, + Elf_Brandnote *checknote, int32_t *osrel); SYSCTL_NODE(_kern, OID_AUTO, __CONCAT(elf, __ELF_WORD_SIZE), CTLFLAG_RW, 0, ""); @@ -110,6 +112,16 @@ static Elf_Brandinfo *elf_brand_list[MAX #define round_page_ps(va, ps) (((va) + (ps - 1)) & ~(ps - 1)) #define aligned(a, t) (trunc_page_ps((u_long)(a), sizeof(t)) == (u_long)(a)) +static const char FREEBSD_ABI_VENDOR[] = "FreeBSD"; + +Elf_Brandnote __elfN(freebsd_brandnote) = { + .hdr.n_namesz = sizeof(FREEBSD_ABI_VENDOR), + .hdr.n_descsz = sizeof(int32_t), + .hdr.n_type = 1, + .vendor = FREEBSD_ABI_VENDOR, + .flags = BN_CAN_FETCH_OSREL +}; + int __elfN(insert_brand_entry)(Elf_Brandinfo *entry) { @@ -161,19 +173,32 @@ __elfN(brand_inuse)(Elf_Brandinfo *entry } static Elf_Brandinfo * -__elfN(get_brandinfo)(const Elf_Ehdr *hdr, const char *interp) +__elfN(get_brandinfo)(struct image_params *imgp, const char *interp, + int32_t *osrel) { + const Elf_Ehdr *hdr = (const Elf_Ehdr *)imgp->image_header; Elf_Brandinfo *bi; + boolean_t ret; int i; /* - * We support three types of branding -- (1) the ELF EI_OSABI field + * We support four types of branding -- (1) the ELF EI_OSABI field * that SCO added to the ELF spec, (2) FreeBSD 3.x's traditional string - * branding w/in the ELF header, and (3) path of the `interp_path' - * field. We should also look for an ".note.ABI-tag" ELF section now - * in all Linux ELF binaries, FreeBSD 4.1+, and some NetBSD ones. + * branding w/in the ELF header, (3) path of the `interp_path' + * field, and (4) the ".note.ABI-tag" ELF section. */ + /* Look for an ".note.ABI-tag" ELF section */ + for (i = 0; i < MAX_BRANDS; i++) { + bi = elf_brand_list[i]; + if (bi != NULL && hdr->e_machine == bi->machine && + bi->brand_note != NULL) { + ret = __elfN(check_note)(imgp, bi->brand_note, osrel); + if (ret) + return (bi); + } + } + /* If the executable has a brand, search for it in the brand list. */ for (i = 0; i < MAX_BRANDS; i++) { bi = elf_brand_list[i]; @@ -597,13 +622,11 @@ fail: return (error); } -static const char FREEBSD_ABI_VENDOR[] = "FreeBSD"; - static int __CONCAT(exec_, __elfN(imgact))(struct image_params *imgp) { const Elf_Ehdr *hdr = (const Elf_Ehdr *)imgp->image_header; - const Elf_Phdr *phdr, *pnote = NULL; + const Elf_Phdr *phdr; Elf_Auxargs *elf_auxargs; struct vmspace *vmspace; vm_prot_t prot; @@ -611,12 +634,11 @@ __CONCAT(exec_, __elfN(imgact))(struct i u_long text_addr = 0, data_addr = 0; u_long seg_size, seg_addr; u_long addr, entry = 0, proghdr = 0; + int32_t osrel = 0; int error = 0, i; const char *interp = NULL, *newinterp = NULL; Elf_Brandinfo *brand_info; - const Elf_Note *note, *note_end; char *path; - const char *note_name; struct thread *td = curthread; struct sysentvec *sv; @@ -654,7 +676,7 @@ __CONCAT(exec_, __elfN(imgact))(struct i } } - brand_info = __elfN(get_brandinfo)(hdr, interp); + brand_info = __elfN(get_brandinfo)(imgp, interp, &osrel); if (brand_info == NULL) { uprintf("ELF binary type \"%u\" not known.\n", hdr->e_ident[EI_OSABI]); @@ -758,9 +780,6 @@ __CONCAT(exec_, __elfN(imgact))(struct i case PT_PHDR: /* Program header table info */ proghdr = phdr[i].p_vaddr; break; - case PT_NOTE: - pnote = &phdr[i]; - break; default: break; } @@ -849,41 +868,7 @@ __CONCAT(exec_, __elfN(imgact))(struct i imgp->auxargs = elf_auxargs; imgp->interpreted = 0; - - /* - * Try to fetch the osreldate for FreeBSD binary from the ELF - * OSABI-note. Only the first page of the image is searched, - * the same as for headers. - */ - if (pnote != NULL && pnote->p_offset < PAGE_SIZE && - pnote->p_offset + pnote->p_filesz < PAGE_SIZE ) { - note = (const Elf_Note *)(imgp->image_header + pnote->p_offset); - if (!aligned(note, Elf32_Addr)) { - free(imgp->auxargs, M_TEMP); - imgp->auxargs = NULL; - return (ENOEXEC); - } - note_end = (const Elf_Note *)(imgp->image_header + pnote->p_offset + - pnote->p_filesz); - while (note < note_end) { - if (note->n_namesz == sizeof(FREEBSD_ABI_VENDOR) && - note->n_descsz == sizeof(int32_t) && - note->n_type == 1 /* ABI_NOTETYPE */) { - note_name = (const char *)(note + 1); - if (strncmp(FREEBSD_ABI_VENDOR, note_name, - sizeof(FREEBSD_ABI_VENDOR)) == 0) { - imgp->proc->p_osrel = *(const int32_t *) - (note_name + - round_page_ps(sizeof(FREEBSD_ABI_VENDOR), - sizeof(Elf32_Addr))); - break; - } - } - note = (const Elf_Note *)((const char *)(note + 1) + - round_page_ps(note->n_namesz, sizeof(Elf32_Addr)) + - round_page_ps(note->n_descsz, sizeof(Elf32_Addr))); - } - } + imgp->proc->p_osrel = osrel; return (error); } @@ -1349,6 +1334,71 @@ __elfN(putnote)(void *dst, size_t *off, } /* + * Try to find the appropriate ABI-note section for checknote, + * fetch the osreldate for binary from the ELF OSABI-note. Only the + * first page of the image is searched, the same as for headers. + */ +static boolean_t +__elfN(check_note)(struct image_params *imgp, Elf_Brandnote *checknote, + int32_t *osrel) +{ + const Elf_Note *note, *note0, *note_end; + const Elf_Phdr *phdr, *pnote; + const Elf_Ehdr *hdr; + const char *note_name; + int i; + + pnote = NULL; + hdr = (const Elf_Ehdr *)imgp->image_header; + phdr = (const Elf_Phdr *)(imgp->image_header + hdr->e_phoff); + + for (i = 0; i < hdr->e_phnum; i++) { + if (phdr[i].p_type == PT_NOTE) { + pnote = &phdr[i]; + break; + } + } + + if (pnote == NULL || pnote->p_offset >= PAGE_SIZE || + pnote->p_offset + pnote->p_filesz >= PAGE_SIZE) + return (FALSE); + + note = note0 = (const Elf_Note *)(imgp->image_header + pnote->p_offset); + note_end = (const Elf_Note *)(imgp->image_header + + pnote->p_offset + pnote->p_filesz); + for (i = 0; i < 100 && note >= note0 && note < note_end; i++) { + if (!aligned(note, Elf32_Addr)) + return (FALSE); + if (note->n_namesz != checknote->hdr.n_namesz || + note->n_descsz != checknote->hdr.n_descsz || + note->n_type != checknote->hdr.n_type) + goto nextnote; + note_name = (const char *)(note + 1); + if (strncmp(checknote->vendor, note_name, + checknote->hdr.n_namesz) != 0) + goto nextnote; + + /* + * Fetch the osreldate for binary + * from the ELF OSABI-note if necessary. + */ + if ((checknote->flags & BN_CAN_FETCH_OSREL) != 0 && + osrel != NULL) + *osrel = *(const int32_t *) (note_name + + roundup2(checknote->hdr.n_namesz, + sizeof(Elf32_Addr))); + return (TRUE); + +nextnote: + note = (const Elf_Note *)((const char *)(note + 1) + + roundup2(note->n_namesz, sizeof(Elf32_Addr)) + + roundup2(note->n_descsz, sizeof(Elf32_Addr))); + } + + return (FALSE); +} + +/* * Tell kern_execve.c about it, with a little help from the linker. */ static struct execsw __elfN(execsw) = { Modified: stable/7/sys/powerpc/powerpc/elf_machdep.c ============================================================================== --- stable/7/sys/powerpc/powerpc/elf_machdep.c Sun Mar 29 07:10:52 2009 (r190519) +++ stable/7/sys/powerpc/powerpc/elf_machdep.c Sun Mar 29 08:07:36 2009 (r190520) @@ -86,7 +86,8 @@ static Elf32_Brandinfo freebsd_brand_inf .interp_path = "/libexec/ld-elf.so.1", .sysvec = &elf32_freebsd_sysvec, .interp_newpath = NULL, - .flags = BI_CAN_EXEC_DYN, + .brand_note = &elf32_freebsd_brandnote, + .flags = BI_CAN_EXEC_DYN }; SYSINIT(elf32, SI_SUB_EXEC, SI_ORDER_ANY, @@ -101,7 +102,8 @@ static Elf32_Brandinfo freebsd_brand_oin .interp_path = "/usr/libexec/ld-elf.so.1", .sysvec = &elf32_freebsd_sysvec, .interp_newpath = NULL, - .flags = BI_CAN_EXEC_DYN, + .brand_note = &elf32_freebsd_brandnote, + .flags = BI_CAN_EXEC_DYN }; SYSINIT(oelf32, SI_SUB_EXEC, SI_ORDER_ANY, Modified: stable/7/sys/sparc64/sparc64/elf_machdep.c ============================================================================== --- stable/7/sys/sparc64/sparc64/elf_machdep.c Sun Mar 29 07:10:52 2009 (r190519) +++ stable/7/sys/sparc64/sparc64/elf_machdep.c Sun Mar 29 08:07:36 2009 (r190520) @@ -98,7 +98,8 @@ static Elf64_Brandinfo freebsd_brand_inf .interp_path = "/libexec/ld-elf.so.1", .sysvec = &elf64_freebsd_sysvec, .interp_newpath = NULL, - .flags = BI_CAN_EXEC_DYN, + .brand_note = &elf64_freebsd_brandnote, + .flags = BI_CAN_EXEC_DYN }; SYSINIT(elf64, SI_SUB_EXEC, SI_ORDER_ANY, @@ -113,7 +114,8 @@ static Elf64_Brandinfo freebsd_brand_oin .interp_path = "/usr/libexec/ld-elf.so.1", .sysvec = &elf64_freebsd_sysvec, .interp_newpath = NULL, - .flags = BI_CAN_EXEC_DYN, + .brand_note = &elf64_freebsd_brandnote, + .flags = BI_CAN_EXEC_DYN }; SYSINIT(oelf64, SI_SUB_EXEC, SI_ORDER_ANY, Modified: stable/7/sys/sys/imgact_elf.h ============================================================================== --- stable/7/sys/sys/imgact_elf.h Sun Mar 29 07:10:52 2009 (r190519) +++ stable/7/sys/sys/imgact_elf.h Sun Mar 29 08:07:36 2009 (r190520) @@ -56,6 +56,13 @@ typedef struct { } __ElfN(Auxargs); typedef struct { + Elf_Note hdr; + const char * vendor; + int flags; +#define BN_CAN_FETCH_OSREL 0x0001 +} Elf_Brandnote; + +typedef struct { int brand; int machine; const char *compat_3_brand; /* pre Binutils 2.10 method (FBSD 3) */ @@ -63,8 +70,9 @@ typedef struct { const char *interp_path; struct sysentvec *sysvec; const char *interp_newpath; - int flags; -#define BI_CAN_EXEC_DYN 0x0001 + Elf_Brandnote *brand_note; + int flags; +#define BI_CAN_EXEC_DYN 0x0001 } __ElfN(Brandinfo); __ElfType(Auxargs); @@ -82,7 +90,7 @@ int __elfN(coredump)(struct thread *, st void __elfN(dump_thread)(struct thread *, void *, size_t *); extern int __elfN(fallback_brand); - +extern Elf_Brandnote __elfN(freebsd_brandnote); #endif /* _KERNEL */ #endif /* !_SYS_IMGACT_ELF_H_ */ From owner-svn-src-stable-7@FreeBSD.ORG Sun Mar 29 17:42:30 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 897AF1065672; Sun, 29 Mar 2009 17:42:30 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 75C788FC14; Sun, 29 Mar 2009 17:42:30 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2THgUrX040634; Sun, 29 Mar 2009 17:42:30 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2THgU0n040633; Sun, 29 Mar 2009 17:42:30 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <200903291742.n2THgU0n040633@svn.freebsd.org> From: Robert Watson Date: Sun, 29 Mar 2009 17:42:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190523 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb netinet X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Mar 2009 17:42:31 -0000 Author: rwatson Date: Sun Mar 29 17:42:30 2009 New Revision: 190523 URL: http://svn.freebsd.org/changeset/base/190523 Log: Merge r185858 from head to stable/7: Remove inconsistent white space from in_pcballoc(). Approved by: re (kib) Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/netinet/in_pcb.c Modified: stable/7/sys/netinet/in_pcb.c ============================================================================== --- stable/7/sys/netinet/in_pcb.c Sun Mar 29 15:10:49 2009 (r190522) +++ stable/7/sys/netinet/in_pcb.c Sun Mar 29 17:42:30 2009 (r190523) @@ -196,7 +196,6 @@ in_pcballoc(struct socket *so, struct in mac_create_inpcb_from_socket(so, inp); SOCK_UNLOCK(so); #endif - #ifdef IPSEC error = ipsec_init_policy(so, &inp->inp_sp); if (error != 0) { @@ -222,7 +221,6 @@ in_pcballoc(struct socket *so, struct in #endif INP_WLOCK(inp); inp->inp_gencnt = ++pcbinfo->ipi_gencnt; - #if defined(IPSEC) || defined(MAC) out: if (error != 0) { From owner-svn-src-stable-7@FreeBSD.ORG Mon Mar 30 04:42:08 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CA1DD106564A; Mon, 30 Mar 2009 04:42:08 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B73B38FC12; Mon, 30 Mar 2009 04:42:08 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2U4g8ou053881; Mon, 30 Mar 2009 04:42:08 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2U4g8Xj053880; Mon, 30 Mar 2009 04:42:08 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200903300442.n2U4g8Xj053880@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 30 Mar 2009 04:42:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190539 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb dev/msk X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Mar 2009 04:42:09 -0000 Author: yongari Date: Mon Mar 30 04:42:08 2009 New Revision: 190539 URL: http://svn.freebsd.org/changeset/base/190539 Log: MFC r190407: Fix typo. Approved by: re (Ken Smith) Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/dev/msk/if_msk.c Modified: stable/7/sys/dev/msk/if_msk.c ============================================================================== --- stable/7/sys/dev/msk/if_msk.c Mon Mar 30 01:47:32 2009 (r190538) +++ stable/7/sys/dev/msk/if_msk.c Mon Mar 30 04:42:08 2009 (r190539) @@ -4196,7 +4196,7 @@ msk_sysctl_node(struct msk_if_softc *sc_ child, rx_pkts_too_long, "frames too long"); MSK_SYSCTL_STAT32(sc_if, ctx, "jabbers", child, rx_pkts_jabbers, "Jabber errors"); - MSK_SYSCTL_STAT32(sc_if, ctx, "jabbers", + MSK_SYSCTL_STAT32(sc_if, ctx, "overflows", child, rx_fifo_oflows, "FIFO overflows"); tree = SYSCTL_ADD_NODE(ctx, schild, OID_AUTO, "tx", CTLFLAG_RD, From owner-svn-src-stable-7@FreeBSD.ORG Mon Mar 30 08:44:29 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BD4D7106564A; Mon, 30 Mar 2009 08:44:29 +0000 (UTC) (envelope-from lulf@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AB1318FC17; Mon, 30 Mar 2009 08:44:29 +0000 (UTC) (envelope-from lulf@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2U8iTDX058422; Mon, 30 Mar 2009 08:44:29 GMT (envelope-from lulf@svn.freebsd.org) Received: (from lulf@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2U8iTm0058421; Mon, 30 Mar 2009 08:44:29 GMT (envelope-from lulf@svn.freebsd.org) Message-Id: <200903300844.n2U8iTm0058421@svn.freebsd.org> From: Ulf Lilleengen Date: Mon, 30 Mar 2009 08:44:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190542 - stable/7/contrib/csup X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Mar 2009 08:44:30 -0000 Author: lulf Date: Mon Mar 30 08:44:29 2009 New Revision: 190542 URL: http://svn.freebsd.org/changeset/base/190542 Log: MFC r190406: - Remember to set umask before setting attributes of RCS file. Approved by: re (kib) Modified: stable/7/contrib/csup/ (props changed) stable/7/contrib/csup/updater.c Modified: stable/7/contrib/csup/updater.c ============================================================================== --- stable/7/contrib/csup/updater.c Mon Mar 30 08:39:42 2009 (r190541) +++ stable/7/contrib/csup/updater.c Mon Mar 30 08:44:29 2009 (r190542) @@ -1661,6 +1661,7 @@ updater_rcsedit(struct updater *up, stru else lprintf(1, " Touch %s", fup->coname); /* Install new attributes. */ + fattr_umask(sr->sr_serverattr, coll->co_umask); fattr_install(sr->sr_serverattr, fup->destpath, NULL); if (fup->attic) lprintf(1, " -> Attic"); From owner-svn-src-stable-7@FreeBSD.ORG Mon Mar 30 10:18:44 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6AA321065672; Mon, 30 Mar 2009 10:18:44 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3D4968FC13; Mon, 30 Mar 2009 10:18:44 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2UAIiaC060507; Mon, 30 Mar 2009 10:18:44 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2UAIiTA060506; Mon, 30 Mar 2009 10:18:44 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200903301018.n2UAIiTA060506@svn.freebsd.org> From: Alexander Motin Date: Mon, 30 Mar 2009 10:18:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190547 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb dev/sound/pci/hda X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Mar 2009 10:18:45 -0000 Author: mav Date: Mon Mar 30 10:18:43 2009 New Revision: 190547 URL: http://svn.freebsd.org/changeset/base/190547 Log: MFC rev. 190519: Fixup relative pointers after channel realloc. It fixes crash on systems with several HDA codecs per controller. While I am there, remove some unneeded dereferences. MFCed earlier than it should be so that it can be part of 7.2-BETA1. PR: kern/131785 Submitted by: Tor Egge Approved by: re (kensmith) Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/dev/sound/pci/hda/hdac.c Modified: stable/7/sys/dev/sound/pci/hda/hdac.c ============================================================================== --- stable/7/sys/dev/sound/pci/hda/hdac.c Mon Mar 30 10:16:49 2009 (r190546) +++ stable/7/sys/dev/sound/pci/hda/hdac.c Mon Mar 30 10:18:43 2009 (r190547) @@ -83,7 +83,7 @@ #include "mixer_if.h" -#define HDA_DRV_TEST_REV "20090316_0130" +#define HDA_DRV_TEST_REV "20090329_0131" SND_DECLARE_FILE("$FreeBSD$"); @@ -5264,7 +5264,7 @@ hdac_audio_bind_as(struct hdac_devinfo * sizeof(struct hdac_chan) * cnt, M_HDAC, M_ZERO | M_NOWAIT); if (sc->chans == NULL) { - device_printf(devinfo->codec->sc->dev, + device_printf(sc->dev, "Channels memory allocation failed!\n"); return; } @@ -5274,17 +5274,20 @@ hdac_audio_bind_as(struct hdac_devinfo * M_HDAC, M_ZERO | M_NOWAIT); if (sc->chans == NULL) { sc->num_chans = 0; - device_printf(devinfo->codec->sc->dev, + device_printf(sc->dev, "Channels memory allocation failed!\n"); return; } + /* Fixup relative pointers after realloc */ + for (j = 0; j < sc->num_chans; j++) + sc->chans[j].caps.fmtlist = sc->chans[j].fmtlist; } free = sc->num_chans; sc->num_chans += cnt; for (j = free; j < free + cnt; j++) { - devinfo->codec->sc->chans[j].devinfo = devinfo; - devinfo->codec->sc->chans[j].as = -1; + sc->chans[j].devinfo = devinfo; + sc->chans[j].as = -1; } /* Assign associations in order of their numbers, */ @@ -5293,10 +5296,10 @@ hdac_audio_bind_as(struct hdac_devinfo * continue; as[j].chan = free; - devinfo->codec->sc->chans[free].as = j; - devinfo->codec->sc->chans[free].dir = + sc->chans[free].as = j; + sc->chans[free].dir = (as[j].dir == HDA_CTL_IN) ? PCMDIR_REC : PCMDIR_PLAY; - hdac_pcmchannel_setup(&devinfo->codec->sc->chans[free]); + hdac_pcmchannel_setup(&sc->chans[free]); free++; } } From owner-svn-src-stable-7@FreeBSD.ORG Mon Mar 30 14:11:38 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6AE8C1065673; Mon, 30 Mar 2009 14:11:38 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3ABB08FC16; Mon, 30 Mar 2009 14:11:38 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2UEBcQu068881; Mon, 30 Mar 2009 14:11:38 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2UEBcDS068880; Mon, 30 Mar 2009 14:11:38 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <200903301411.n2UEBcDS068880@svn.freebsd.org> From: Robert Watson Date: Mon, 30 Mar 2009 14:11:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190556 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb netinet X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Mar 2009 14:11:39 -0000 Author: rwatson Date: Mon Mar 30 14:11:37 2009 New Revision: 190556 URL: http://svn.freebsd.org/changeset/base/190556 Log: Merge r189196 from head to stable/7: Remove unreachable code for generating RST segments from tcp_twcheck(); this code became stale when T/TCP support was removed. Discussed with: bz, sam Approved by: re (kensmith) Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/netinet/tcp_timewait.c Modified: stable/7/sys/netinet/tcp_timewait.c ============================================================================== --- stable/7/sys/netinet/tcp_timewait.c Mon Mar 30 12:26:19 2009 (r190555) +++ stable/7/sys/netinet/tcp_timewait.c Mon Mar 30 14:11:37 2009 (r190556) @@ -320,11 +320,6 @@ tcp_twcheck(struct inpcb *inp, struct tc struct tcptw *tw; int thflags; tcp_seq seq; -#ifdef INET6 - int isipv6 = (mtod(m, struct ip *)->ip_v == 6) ? 1 : 0; -#else - const int isipv6 = 0; -#endif /* tcbinfo lock required for tcp_twclose(), tcp_tw_2msl_reset(). */ INP_INFO_WLOCK_ASSERT(&tcbinfo); @@ -404,46 +399,6 @@ tcp_twcheck(struct inpcb *inp, struct tc if (thflags != TH_ACK || tlen != 0 || th->th_seq != tw->rcv_nxt || th->th_ack != tw->snd_nxt) tcp_twrespond(tw, TH_ACK); - goto drop; - - /* - * Generate a RST, dropping incoming segment. - * Make ACK acceptable to originator of segment. - * Don't bother to respond if destination was broadcast/multicast. - */ - if (m->m_flags & (M_BCAST|M_MCAST)) - goto drop; - if (isipv6) { -#ifdef INET6 - struct ip6_hdr *ip6; - - /* IPv6 anycast check is done at tcp6_input() */ - ip6 = mtod(m, struct ip6_hdr *); - if (IN6_IS_ADDR_MULTICAST(&ip6->ip6_dst) || - IN6_IS_ADDR_MULTICAST(&ip6->ip6_src)) - goto drop; -#endif - } else { - struct ip *ip; - - ip = mtod(m, struct ip *); - if (IN_MULTICAST(ntohl(ip->ip_dst.s_addr)) || - IN_MULTICAST(ntohl(ip->ip_src.s_addr)) || - ip->ip_src.s_addr == htonl(INADDR_BROADCAST) || - in_broadcast(ip->ip_dst, m->m_pkthdr.rcvif)) - goto drop; - } - if (thflags & TH_ACK) { - tcp_respond(NULL, - mtod(m, void *), th, m, 0, th->th_ack, TH_RST); - } else { - seq = th->th_seq + (thflags & TH_SYN ? 1 : 0); - tcp_respond(NULL, - mtod(m, void *), th, m, seq, 0, TH_RST|TH_ACK); - } - INP_WUNLOCK(inp); - return (0); - drop: INP_WUNLOCK(inp); m_freem(m); From owner-svn-src-stable-7@FreeBSD.ORG Mon Mar 30 18:33:05 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 41F09106564A; Mon, 30 Mar 2009 18:33:05 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2E5C88FC15; Mon, 30 Mar 2009 18:33:05 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2UIX5u9074718; Mon, 30 Mar 2009 18:33:05 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2UIX5K9074717; Mon, 30 Mar 2009 18:33:05 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200903301833.n2UIX5K9074717@svn.freebsd.org> From: John Baldwin Date: Mon, 30 Mar 2009 18:33:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190566 - in stable/7/sys: . contrib/pf dev/acpica dev/ath/ath_hal dev/cxgb X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Mar 2009 18:33:06 -0000 Author: jhb Date: Mon Mar 30 18:33:04 2009 New Revision: 190566 URL: http://svn.freebsd.org/changeset/base/190566 Log: MFC: Move the code to update cpu_cx_count out of acpi_cpu_generic_cx_probe() and into acpi_cpu_startup() which is where all the other code to update this global variable lives. This fixes a bug where cpu_cx_count was not updated correctly if acpi_cpu_generic_cx_probe() returned early. Approved by: re (kensmith) Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/acpica/acpi_cpu.c stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) Modified: stable/7/sys/dev/acpica/acpi_cpu.c ============================================================================== --- stable/7/sys/dev/acpica/acpi_cpu.c Mon Mar 30 18:01:42 2009 (r190565) +++ stable/7/sys/dev/acpica/acpi_cpu.c Mon Mar 30 18:33:04 2009 (r190566) @@ -608,10 +608,6 @@ acpi_cpu_generic_cx_probe(struct acpi_cp sc->cpu_cx_count++; } } - - /* Update the largest cx_count seen so far */ - if (sc->cpu_cx_count > cpu_cx_count) - cpu_cx_count = sc->cpu_cx_count; } /* @@ -751,6 +747,8 @@ acpi_cpu_startup(void *arg) for (i = 0; i < cpu_ndevices; i++) { sc = device_get_softc(cpu_devices[i]); acpi_cpu_generic_cx_probe(sc); + if (sc->cpu_cx_count > cpu_cx_count) + cpu_cx_count = sc->cpu_cx_count; } /* From owner-svn-src-stable-7@FreeBSD.ORG Mon Mar 30 18:43:42 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 26E601065688; Mon, 30 Mar 2009 18:43:42 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1200A8FC17; Mon, 30 Mar 2009 18:43:42 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2UIhfMk075027; Mon, 30 Mar 2009 18:43:41 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2UIhfxb075024; Mon, 30 Mar 2009 18:43:41 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200903301843.n2UIhfxb075024@svn.freebsd.org> From: John Baldwin Date: Mon, 30 Mar 2009 18:43:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190568 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb dev/twa X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Mar 2009 18:43:44 -0000 Author: jhb Date: Mon Mar 30 18:43:41 2009 New Revision: 190568 URL: http://svn.freebsd.org/changeset/base/190568 Log: MFC: Reenable 64-bit DMA for twa(4) controllers, but use a boundary of 4GB to prevent individual transactions from crossing a 4GB address boundary. Due to bus_size_t type limitations, the driver uses a 2GB boundary in PAE kernels. Approved by: re (kensmith) Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/dev/twa/tw_cl_init.c stable/7/sys/dev/twa/tw_osl.h stable/7/sys/dev/twa/tw_osl_freebsd.c Modified: stable/7/sys/dev/twa/tw_cl_init.c ============================================================================== --- stable/7/sys/dev/twa/tw_cl_init.c Mon Mar 30 18:38:03 2009 (r190567) +++ stable/7/sys/dev/twa/tw_cl_init.c Mon Mar 30 18:43:41 2009 (r190568) @@ -692,7 +692,7 @@ tw_cli_init_connection(struct tw_cli_ctl init_connect->message_credits = TW_CL_SWAP16(message_credits); init_connect->features = TW_CL_SWAP32(set_features); if (ctlr->flags & TW_CL_64BIT_ADDRESSES) - init_connect->features |= TWA_64BIT_SG_ADDRESSES; + init_connect->features |= TW_CL_SWAP32(TWA_64BIT_SG_ADDRESSES); if (set_features & TWA_EXTENDED_INIT_CONNECT) { /* * Fill in the extra fields needed for an extended Modified: stable/7/sys/dev/twa/tw_osl.h ============================================================================== --- stable/7/sys/dev/twa/tw_osl.h Mon Mar 30 18:38:03 2009 (r190567) +++ stable/7/sys/dev/twa/tw_osl.h Mon Mar 30 18:43:41 2009 (r190568) @@ -57,6 +57,12 @@ #define TW_OSLI_DEFERRED_INTR_USED */ +#ifdef PAE +#define TW_OSLI_DMA_BOUNDARY (1u << 31) +#else +#define TW_OSLI_DMA_BOUNDARY ((bus_size_t)((uint64_t)1 << 32)) +#endif + /* Possible values of req->state. */ #define TW_OSLI_REQ_STATE_INIT 0x0 /* being initialized */ #define TW_OSLI_REQ_STATE_BUSY 0x1 /* submitted to CL */ Modified: stable/7/sys/dev/twa/tw_osl_freebsd.c ============================================================================== --- stable/7/sys/dev/twa/tw_osl_freebsd.c Mon Mar 30 18:38:03 2009 (r190567) +++ stable/7/sys/dev/twa/tw_osl_freebsd.c Mon Mar 30 18:43:41 2009 (r190568) @@ -491,8 +491,8 @@ tw_osli_alloc_mem(struct twa_softc *sc) /* Create the parent dma tag. */ if (bus_dma_tag_create(NULL, /* parent */ sc->alignment, /* alignment */ - 0, /* boundary */ - BUS_SPACE_MAXADDR_32BIT,/* lowaddr */ + TW_OSLI_DMA_BOUNDARY, /* boundary */ + BUS_SPACE_MAXADDR, /* lowaddr */ BUS_SPACE_MAXADDR, /* highaddr */ NULL, NULL, /* filter, filterarg */ TW_CL_MAX_IO_SIZE, /* maxsize */ @@ -515,7 +515,7 @@ tw_osli_alloc_mem(struct twa_softc *sc) if (bus_dma_tag_create(sc->parent_tag, /* parent */ sc->alignment, /* alignment */ 0, /* boundary */ - BUS_SPACE_MAXADDR_32BIT,/* lowaddr */ + BUS_SPACE_MAXADDR, /* lowaddr */ BUS_SPACE_MAXADDR, /* highaddr */ NULL, NULL, /* filter, filterarg */ dma_mem_size, /* maxsize */ @@ -562,7 +562,7 @@ tw_osli_alloc_mem(struct twa_softc *sc) if (bus_dma_tag_create(sc->parent_tag, /* parent */ sc->alignment, /* alignment */ 0, /* boundary */ - BUS_SPACE_MAXADDR_32BIT,/* lowaddr */ + BUS_SPACE_MAXADDR, /* lowaddr */ BUS_SPACE_MAXADDR, /* highaddr */ NULL, NULL, /* filter, filterarg */ TW_CL_MAX_IO_SIZE, /* maxsize */ @@ -588,7 +588,7 @@ tw_osli_alloc_mem(struct twa_softc *sc) if (bus_dma_tag_create(sc->parent_tag, /* parent */ sc->alignment, /* alignment */ 0, /* boundary */ - BUS_SPACE_MAXADDR_32BIT,/* lowaddr */ + BUS_SPACE_MAXADDR, /* lowaddr */ BUS_SPACE_MAXADDR, /* highaddr */ NULL, NULL, /* filter, filterarg */ TW_CL_MAX_IO_SIZE, /* maxsize */ @@ -1347,7 +1347,7 @@ static TW_VOID twa_map_load_callback(TW_VOID *arg, bus_dma_segment_t *segs, TW_INT32 nsegments, TW_INT32 error) { - *((bus_addr_t *)arg) = segs[0].ds_addr; + *((TW_UINT64 *)arg) = segs[0].ds_addr; } From owner-svn-src-stable-7@FreeBSD.ORG Mon Mar 30 19:20:56 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 922AE1065673; Mon, 30 Mar 2009 19:20:56 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8019E8FC18; Mon, 30 Mar 2009 19:20:56 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2UJKu9w075966; Mon, 30 Mar 2009 19:20:56 GMT (envelope-from jeff@svn.freebsd.org) Received: (from jeff@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2UJKuuB075965; Mon, 30 Mar 2009 19:20:56 GMT (envelope-from jeff@svn.freebsd.org) Message-Id: <200903301920.n2UJKuuB075965@svn.freebsd.org> From: Jeff Roberson Date: Mon, 30 Mar 2009 19:20:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190570 - stable/7/sys/kern X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Mar 2009 19:20:57 -0000 Author: jeff Date: Mon Mar 30 19:20:56 2009 New Revision: 190570 URL: http://svn.freebsd.org/changeset/base/190570 Log: MFC SVN rev 189787. - Fix steal_thresh calculation with odd numbers of cpus and sched_affinity() for threads on runqueues. Approved by: re Modified: stable/7/sys/kern/sched_ule.c Modified: stable/7/sys/kern/sched_ule.c ============================================================================== --- stable/7/sys/kern/sched_ule.c Mon Mar 30 18:47:13 2009 (r190569) +++ stable/7/sys/kern/sched_ule.c Mon Mar 30 19:20:56 2009 (r190570) @@ -1395,11 +1395,11 @@ sched_initticks(void *dummy) */ balance_interval = realstathz; /* - * Set steal thresh to log2(mp_ncpu) but no greater than 4. This - * prevents excess thrashing on large machines and excess idle on - * smaller machines. + * Set steal thresh to roughly log2(mp_ncpu) but no greater than 4. + * This prevents excess thrashing on large machines and excess idle + * on smaller machines. */ - steal_thresh = min(ffs(mp_ncpus) - 1, 4); + steal_thresh = min(fls(mp_ncpus) - 1, 3); affinity = SCHED_AFFINITY_DEFAULT; #endif } @@ -2549,6 +2549,11 @@ sched_affinity(struct thread *td) ts = td->td_sched; if (THREAD_CAN_SCHED(td, ts->ts_cpu)) return; + if (TD_ON_RUNQ(td)) { + sched_rem(td); + sched_add(td, SRQ_BORING); + return; + } if (!TD_IS_RUNNING(td)) return; td->td_flags |= TDF_NEEDRESCHED; From owner-svn-src-stable-7@FreeBSD.ORG Tue Mar 31 01:01:02 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3FC241065670; Tue, 31 Mar 2009 01:01:02 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2B4998FC17; Tue, 31 Mar 2009 01:01:02 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2V112kt083271; Tue, 31 Mar 2009 01:01:02 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2V112iw083269; Tue, 31 Mar 2009 01:01:02 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <200903310101.n2V112iw083269@svn.freebsd.org> From: Xin LI Date: Tue, 31 Mar 2009 01:01:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190582 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/bce dev/cxgb X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 31 Mar 2009 01:01:02 -0000 Author: delphij Date: Tue Mar 31 01:01:01 2009 New Revision: 190582 URL: http://svn.freebsd.org/changeset/base/190582 Log: Update bce(4) to latest -CURRENT version: - Add several HP OEM parts' PCI IDs (187133+187317) - Remove intermediate variable busaddr and have bus_* operate directly on softc members upon initialization. (187204) - Only enable split header operation when ZERO_COPY_SOCKETS is enabled in the kernel. (189117) - Updated firmware to latest 4.6.X release. (189325) - Added missing firmware for 5709 A1 controllers. (189325) - Changed some debug statistic variable names to be more consistent. (189325) Approved by: re (kensmith) Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/bce/if_bce.c stable/7/sys/dev/bce/if_bcefw.h stable/7/sys/dev/bce/if_bcereg.h stable/7/sys/dev/cxgb/ (props changed) Modified: stable/7/sys/dev/bce/if_bce.c ============================================================================== --- stable/7/sys/dev/bce/if_bce.c Mon Mar 30 22:18:38 2009 (r190581) +++ stable/7/sys/dev/bce/if_bce.c Tue Mar 31 01:01:01 2009 (r190582) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2006-2008 Broadcom Corporation + * Copyright (c) 2006-2009 Broadcom Corporation * David Christensen . All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -38,7 +38,7 @@ __FBSDID("$FreeBSD$"); * BCM5708C B1, B2 * BCM5708S B1, B2 * BCM5709C A1, C0 - * BCM5716 C0 + * BCM5716C C0 * * The following controllers are not supported by this driver: * BCM5706C A0, A1 (pre-production) @@ -71,25 +71,24 @@ __FBSDID("$FreeBSD$"); /* 1073741824 = 1 in 2 */ /* Controls how often the l2_fhdr frame error check will fail. */ - int bce_debug_l2fhdr_status_check = 0; + int l2fhdr_error_sim_control = 0; /* Controls how often the unexpected attention check will fail. */ - int bce_debug_unexpected_attention = 0; + int unexpected_attention_sim_control = 0; /* Controls how often to simulate an mbuf allocation failure. */ - int bce_debug_mbuf_allocation_failure = 0; + int mbuf_alloc_failed_sim_control = 0; /* Controls how often to simulate a DMA mapping failure. */ - int bce_debug_dma_map_addr_failure = 0; + int dma_map_addr_failed_sim_control = 0; /* Controls how often to simulate a bootcode failure. */ - int bce_debug_bootcode_running_failure = 0; + int bootcode_running_failure_sim_control = 0; #endif /****************************************************************************/ /* BCE Build Time Options */ /****************************************************************************/ -#define BCE_USE_SPLIT_HEADER 1 /* #define BCE_NVRAM_WRITE_SUPPORT 1 */ @@ -106,6 +105,10 @@ static struct bce_type bce_devs[] = { "HP NC370T Multifunction Gigabit Server Adapter" }, { BRCM_VENDORID, BRCM_DEVICEID_BCM5706, HP_VENDORID, 0x3106, "HP NC370i Multifunction Gigabit Server Adapter" }, + { BRCM_VENDORID, BRCM_DEVICEID_BCM5706, HP_VENDORID, 0x3070, + "HP NC380T PCIe DP Multifunc Gig Server Adapter" }, + { BRCM_VENDORID, BRCM_DEVICEID_BCM5706, HP_VENDORID, 0x1709, + "HP NC371i Multifunction Gigabit Server Adapter" }, { BRCM_VENDORID, BRCM_DEVICEID_BCM5706, PCI_ANY_ID, PCI_ANY_ID, "Broadcom NetXtreme II BCM5706 1000Base-T" }, @@ -116,18 +119,38 @@ static struct bce_type bce_devs[] = { "Broadcom NetXtreme II BCM5706 1000Base-SX" }, /* BCM5708C controllers and OEM boards. */ + { BRCM_VENDORID, BRCM_DEVICEID_BCM5708, HP_VENDORID, 0x7037, + "HP NC373T PCIe Multifunction Gig Server Adapter" }, + { BRCM_VENDORID, BRCM_DEVICEID_BCM5708, HP_VENDORID, 0x7038, + "HP NC373i Multifunction Gigabit Server Adapter" }, + { BRCM_VENDORID, BRCM_DEVICEID_BCM5708, HP_VENDORID, 0x7045, + "HP NC374m PCIe Multifunction Adapter" }, { BRCM_VENDORID, BRCM_DEVICEID_BCM5708, PCI_ANY_ID, PCI_ANY_ID, "Broadcom NetXtreme II BCM5708 1000Base-T" }, /* BCM5708S controllers and OEM boards. */ + { BRCM_VENDORID, BRCM_DEVICEID_BCM5708S, HP_VENDORID, 0x1706, + "HP NC373m Multifunction Gigabit Server Adapter" }, + { BRCM_VENDORID, BRCM_DEVICEID_BCM5708S, HP_VENDORID, 0x703b, + "HP NC373i Multifunction Gigabit Server Adapter" }, + { BRCM_VENDORID, BRCM_DEVICEID_BCM5708S, HP_VENDORID, 0x703d, + "HP NC373F PCIe Multifunc Giga Server Adapter" }, { BRCM_VENDORID, BRCM_DEVICEID_BCM5708S, PCI_ANY_ID, PCI_ANY_ID, "Broadcom NetXtreme II BCM5708 1000Base-SX" }, /* BCM5709C controllers and OEM boards. */ + { BRCM_VENDORID, BRCM_DEVICEID_BCM5709, HP_VENDORID, 0x7055, + "HP NC382i DP Multifunction Gigabit Server Adapter" }, + { BRCM_VENDORID, BRCM_DEVICEID_BCM5709, HP_VENDORID, 0x7059, + "HP NC382T PCIe DP Multifunction Gigabit Server Adapter" }, { BRCM_VENDORID, BRCM_DEVICEID_BCM5709, PCI_ANY_ID, PCI_ANY_ID, "Broadcom NetXtreme II BCM5709 1000Base-T" }, /* BCM5709S controllers and OEM boards. */ + { BRCM_VENDORID, BRCM_DEVICEID_BCM5709S, HP_VENDORID, 0x171d, + "HP NC382m DP 1GbE Multifunction BL-c Adapter" }, + { BRCM_VENDORID, BRCM_DEVICEID_BCM5709S, HP_VENDORID, 0x7056, + "HP NC382i DP Multifunction Gigabit Server Adapter" }, { BRCM_VENDORID, BRCM_DEVICEID_BCM5709S, PCI_ANY_ID, PCI_ANY_ID, "Broadcom NetXtreme II BCM5709 1000Base-SX" }, @@ -270,12 +293,12 @@ static void bce_dump_enet (str static void bce_dump_mbuf (struct bce_softc *, struct mbuf *); static void bce_dump_tx_mbuf_chain (struct bce_softc *, u16, int); static void bce_dump_rx_mbuf_chain (struct bce_softc *, u16, int); -#ifdef BCE_USE_SPLIT_HEADER +#ifdef ZERO_COPY_SOCKETS static void bce_dump_pg_mbuf_chain (struct bce_softc *, u16, int); #endif static void bce_dump_txbd (struct bce_softc *, int, struct tx_bd *); static void bce_dump_rxbd (struct bce_softc *, int, struct rx_bd *); -#ifdef BCE_USE_SPLIT_HEADER +#ifdef ZERO_COPY_SOCKETS static void bce_dump_pgbd (struct bce_softc *, int, struct rx_bd *); #endif static void bce_dump_l2fhdr (struct bce_softc *, int, struct l2_fhdr *); @@ -283,7 +306,7 @@ static void bce_dump_ctx (struct bce_s static void bce_dump_ftqs (struct bce_softc *); static void bce_dump_tx_chain (struct bce_softc *, u16, int); static void bce_dump_rx_chain (struct bce_softc *, u16, int); -#ifdef BCE_USE_SPLIT_HEADER +#ifdef ZERO_COPY_SOCKETS static void bce_dump_pg_chain (struct bce_softc *, u16, int); #endif static void bce_dump_status_block (struct bce_softc *); @@ -368,7 +391,7 @@ static int bce_init_rx_chain (struct b static void bce_fill_rx_chain (struct bce_softc *); static void bce_free_rx_chain (struct bce_softc *); -#ifdef BCE_USE_SPLIT_HEADER +#ifdef ZERO_COPY_SOCKETS static int bce_get_pg_buf (struct bce_softc *, struct mbuf *, u16 *, u16 *); static int bce_init_pg_chain (struct bce_softc *); static void bce_fill_pg_chain (struct bce_softc *); @@ -472,7 +495,8 @@ SYSCTL_UINT(_hw_bce, OID_AUTO, msi_enabl /* ToDo: Add tunable to enable/disable strict MTU handling. */ /* Currently allows "loose" RX MTU checking (i.e. sets the */ /* H/W RX MTU to the size of the largest receive buffer, or */ -/* 2048 bytes). */ +/* 2048 bytes). This will cause a UNH failure but is more */ +/* desireable from a functional perspective. */ /****************************************************************************/ @@ -572,8 +596,8 @@ bce_print_adapter_info(struct bce_softc } /* Firmware version and device features. */ - printf("F/W (0x%08X); Flags( ", sc->bce_fw_ver); -#ifdef BCE_USE_SPLIT_HEADER + printf("B/C (0x%08X); Flags( ", sc->bce_bc_ver); +#ifdef ZERO_COPY_SOCKETS printf("SPLT "); #endif if (sc->bce_flags & BCE_MFW_ENABLE_FLAG) @@ -823,7 +847,7 @@ bce_attach(device_t dev) __FUNCTION__, sc->bce_shmem_base); /* Fetch the bootcode revision. */ - sc->bce_fw_ver = REG_RD_IND(sc, sc->bce_shmem_base + + sc->bce_bc_ver = REG_RD_IND(sc, sc->bce_shmem_base + BCE_DEV_INFO_BC_REV); /* Check if any management firmware is running. */ @@ -989,7 +1013,7 @@ bce_attach(device_t dev) * This may change later if the MTU size is set to * something other than 1500. */ -#ifdef BCE_USE_SPLIT_HEADER +#ifdef ZERO_COPY_SOCKETS sc->rx_bd_mbuf_alloc_size = MHLEN; /* Make sure offset is 16 byte aligned for hardware. */ sc->rx_bd_mbuf_align_pad = roundup2((MSIZE - MHLEN), 16) - @@ -2729,7 +2753,7 @@ bce_dma_free(struct bce_softc *sc) } -#ifdef BCE_USE_SPLIT_HEADER +#ifdef ZERO_COPY_SOCKETS /* Free, unmap and destroy all page buffer descriptor chain pages. */ for (i = 0; i < PG_PAGES; i++ ) { if (sc->pg_bd_chain[i] != NULL) { @@ -2793,7 +2817,7 @@ bce_dma_free(struct bce_softc *sc) sc->rx_mbuf_tag = NULL; } -#ifdef BCE_USE_SPLIT_HEADER +#ifdef ZERO_COPY_SOCKETS /* Unload and destroy the page mbuf maps. */ for (i = 0; i < TOTAL_PG_BD; i++) { if (sc->pg_mbuf_map[i] != NULL) { @@ -2840,20 +2864,16 @@ bce_dma_map_addr(void *arg, bus_dma_segm bus_addr_t *busaddr = arg; /* Simulate a mapping failure. */ - DBRUNIF(DB_RANDOMTRUE(bce_debug_dma_map_addr_failure), - printf("bce: %s(%d): Simulating DMA mapping error.\n", - __FILE__, __LINE__); + DBRUNIF(DB_RANDOMTRUE(dma_map_addr_failed_sim_control), error = ENOMEM); /* Check for an error and signal the caller that an error occurred. */ if (error) { - printf("bce %s(%d): DMA mapping error! error = %d, " - "nseg = %d\n", __FILE__, __LINE__, error, nseg); *busaddr = 0; - return; + } else { + *busaddr = segs->ds_addr; } - *busaddr = segs->ds_addr; return; } @@ -2886,7 +2906,6 @@ bce_dma_alloc(device_t dev) { struct bce_softc *sc; int i, error, rc = 0; - bus_addr_t busaddr; bus_size_t max_size, max_seg_size; int max_segments; @@ -2955,7 +2974,7 @@ bce_dma_alloc(device_t dev) sc->status_block, BCE_STATUS_BLK_SZ, bce_dma_map_addr, - &busaddr, + &sc->status_block_paddr, BUS_DMA_NOWAIT); if (error) { @@ -2965,7 +2984,6 @@ bce_dma_alloc(device_t dev) goto bce_dma_alloc_exit; } - sc->status_block_paddr = busaddr; DBPRINT(sc, BCE_INFO, "%s(): status_block_paddr = 0x%jX\n", __FUNCTION__, (uintmax_t) sc->status_block_paddr); @@ -3009,7 +3027,7 @@ bce_dma_alloc(device_t dev) sc->stats_block, BCE_STATS_BLK_SZ, bce_dma_map_addr, - &busaddr, + &sc->stats_block_paddr, BUS_DMA_NOWAIT); if(error) { @@ -3019,7 +3037,6 @@ bce_dma_alloc(device_t dev) goto bce_dma_alloc_exit; } - sc->stats_block_paddr = busaddr; DBPRINT(sc, BCE_INFO, "%s(): stats_block_paddr = 0x%jX\n", __FUNCTION__, (uintmax_t) sc->stats_block_paddr); @@ -3077,7 +3094,7 @@ bce_dma_alloc(device_t dev) sc->ctx_block[i], BCM_PAGE_SIZE, bce_dma_map_addr, - &busaddr, + &sc->ctx_paddr[i], BUS_DMA_NOWAIT); if (error) { @@ -3087,7 +3104,6 @@ bce_dma_alloc(device_t dev) goto bce_dma_alloc_exit; } - sc->ctx_paddr[i] = busaddr; DBPRINT(sc, BCE_INFO, "%s(): ctx_paddr[%d] = 0x%jX\n", __FUNCTION__, i, (uintmax_t) sc->ctx_paddr[i]); } @@ -3133,7 +3149,7 @@ bce_dma_alloc(device_t dev) sc->tx_bd_chain[i], BCE_TX_CHAIN_PAGE_SZ, bce_dma_map_addr, - &busaddr, + &sc->tx_bd_chain_paddr[i], BUS_DMA_NOWAIT); if (error) { @@ -3143,7 +3159,6 @@ bce_dma_alloc(device_t dev) goto bce_dma_alloc_exit; } - sc->tx_bd_chain_paddr[i] = busaddr; DBPRINT(sc, BCE_INFO, "%s(): tx_bd_chain_paddr[%d] = 0x%jX\n", __FUNCTION__, i, (uintmax_t) sc->tx_bd_chain_paddr[i]); } @@ -3231,7 +3246,7 @@ bce_dma_alloc(device_t dev) sc->rx_bd_chain[i], BCE_RX_CHAIN_PAGE_SZ, bce_dma_map_addr, - &busaddr, + &sc->rx_bd_chain_paddr[i], BUS_DMA_NOWAIT); if (error) { @@ -3241,7 +3256,6 @@ bce_dma_alloc(device_t dev) goto bce_dma_alloc_exit; } - sc->rx_bd_chain_paddr[i] = busaddr; DBPRINT(sc, BCE_INFO, "%s(): rx_bd_chain_paddr[%d] = 0x%jX\n", __FUNCTION__, i, (uintmax_t) sc->rx_bd_chain_paddr[i]); } @@ -3249,12 +3263,17 @@ bce_dma_alloc(device_t dev) /* * Create a DMA tag for RX mbufs. */ -#ifdef BCE_USE_SPLIT_HEADER +#ifdef ZERO_COPY_SOCKETS max_size = max_seg_size = ((sc->rx_bd_mbuf_alloc_size < MCLBYTES) ? MCLBYTES : sc->rx_bd_mbuf_alloc_size); #else max_size = max_seg_size = MJUM9BYTES; #endif + max_segments = 1; + + DBPRINT(sc, BCE_INFO, "%s(): Creating rx_mbuf_tag (max size = 0x%jX " + "max segments = %d, max segment size = 0x%jX)\n", __FUNCTION__, + (uintmax_t) max_size, max_segments, (uintmax_t) max_seg_size); if (bus_dma_tag_create(sc->parent_tag, 1, @@ -3263,7 +3282,7 @@ bce_dma_alloc(device_t dev) BUS_SPACE_MAXADDR, NULL, NULL, max_size, - 1, + max_segments, max_seg_size, 0, NULL, NULL, @@ -3285,7 +3304,7 @@ bce_dma_alloc(device_t dev) } } -#ifdef BCE_USE_SPLIT_HEADER +#ifdef ZERO_COPY_SOCKETS /* * Create a DMA tag for the page buffer descriptor chain, * allocate and clear the memory, and fetch the physical @@ -3328,7 +3347,7 @@ bce_dma_alloc(device_t dev) sc->pg_bd_chain[i], BCE_PG_CHAIN_PAGE_SZ, bce_dma_map_addr, - &busaddr, + &sc->pg_bd_chain_paddr[i], BUS_DMA_NOWAIT); if (error) { @@ -3338,7 +3357,6 @@ bce_dma_alloc(device_t dev) goto bce_dma_alloc_exit; } - sc->pg_bd_chain_paddr[i] = busaddr; DBPRINT(sc, BCE_INFO, "%s(): pg_bd_chain_paddr[%d] = 0x%jX\n", __FUNCTION__, i, (uintmax_t) sc->pg_bd_chain_paddr[i]); } @@ -4140,15 +4158,24 @@ bce_init_cpus(struct bce_softc *sc) if ((BCE_CHIP_NUM(sc) == BCE_CHIP_NUM_5709) || (BCE_CHIP_NUM(sc) == BCE_CHIP_NUM_5716)) { - bce_load_rv2p_fw(sc, bce_xi_rv2p_proc1, sizeof(bce_xi_rv2p_proc1), - RV2P_PROC1); - bce_load_rv2p_fw(sc, bce_xi_rv2p_proc2, sizeof(bce_xi_rv2p_proc2), - RV2P_PROC2); + + if ((BCE_CHIP_REV(sc) == BCE_CHIP_REV_Ax)) { + bce_load_rv2p_fw(sc, bce_xi90_rv2p_proc1, + sizeof(bce_xi90_rv2p_proc1), RV2P_PROC1); + bce_load_rv2p_fw(sc, bce_xi90_rv2p_proc2, + sizeof(bce_xi90_rv2p_proc2), RV2P_PROC2); + } else { + bce_load_rv2p_fw(sc, bce_xi_rv2p_proc1, + sizeof(bce_xi_rv2p_proc1), RV2P_PROC1); + bce_load_rv2p_fw(sc, bce_xi_rv2p_proc2, + sizeof(bce_xi_rv2p_proc2), RV2P_PROC2); + } + } else { - bce_load_rv2p_fw(sc, bce_rv2p_proc1, sizeof(bce_rv2p_proc1), - RV2P_PROC1); - bce_load_rv2p_fw(sc, bce_rv2p_proc2, sizeof(bce_rv2p_proc2), - RV2P_PROC2); + bce_load_rv2p_fw(sc, bce_rv2p_proc1, + sizeof(bce_rv2p_proc1), RV2P_PROC1); + bce_load_rv2p_fw(sc, bce_rv2p_proc2, + sizeof(bce_rv2p_proc2), RV2P_PROC2); } bce_init_rxp_cpu(sc); @@ -4367,7 +4394,7 @@ bce_stop(struct bce_softc *sc) bce_disable_intr(sc); /* Free RX buffers. */ -#ifdef BCE_USE_SPLIT_HEADER +#ifdef ZERO_COPY_SOCKETS bce_free_pg_chain(sc); #endif bce_free_rx_chain(sc); @@ -4711,7 +4738,7 @@ bce_blockinit(struct bce_softc *sc) /* Verify that bootcode is running. */ reg = REG_RD_IND(sc, sc->bce_shmem_base + BCE_DEV_INFO_SIGNATURE); - DBRUNIF(DB_RANDOMTRUE(bce_debug_bootcode_running_failure), + DBRUNIF(DB_RANDOMTRUE(bootcode_running_failure_sim_control), BCE_PRINTF("%s(%d): Simulating bootcode failure.\n", __FILE__, __LINE__); reg = 0); @@ -4798,14 +4825,14 @@ bce_get_rx_buf(struct bce_softc *sc, str if (m == NULL) { /* Simulate an mbuf allocation failure. */ - DBRUNIF(DB_RANDOMTRUE(bce_debug_mbuf_allocation_failure), - sc->mbuf_alloc_failed++; - sc->debug_mbuf_sim_alloc_failed++; + DBRUNIF(DB_RANDOMTRUE(mbuf_alloc_failed_sim_control), + sc->mbuf_alloc_failed_count++; + sc->mbuf_alloc_failed_sim_count++; rc = ENOBUFS; goto bce_get_rx_buf_exit); /* This is a new mbuf allocation. */ -#ifdef BCE_USE_SPLIT_HEADER +#ifdef ZERO_COPY_SOCKETS MGETHDR(m_new, M_DONTWAIT, MT_DATA); #else if (sc->rx_bd_mbuf_alloc_size <= MCLBYTES) @@ -4815,7 +4842,7 @@ bce_get_rx_buf(struct bce_softc *sc, str #endif if (m_new == NULL) { - sc->mbuf_alloc_failed++; + sc->mbuf_alloc_failed_count++; rc = ENOBUFS; goto bce_get_rx_buf_exit; } @@ -4845,7 +4872,9 @@ bce_get_rx_buf(struct bce_softc *sc, str BCE_PRINTF("%s(%d): Error mapping mbuf into RX chain (%d)!\n", __FILE__, __LINE__, error); + sc->dma_map_addr_rx_failed_count++; m_freem(m_new); + DBRUN(sc->debug_rx_mbuf_alloc--); rc = ENOBUFS; @@ -4884,7 +4913,7 @@ bce_get_rx_buf_exit: } -#ifdef BCE_USE_SPLIT_HEADER +#ifdef ZERO_COPY_SOCKETS /****************************************************************************/ /* Encapsulate an mbuf cluster into the page chain. */ /* */ @@ -4923,16 +4952,16 @@ bce_get_pg_buf(struct bce_softc *sc, str if (m == NULL) { /* Simulate an mbuf allocation failure. */ - DBRUNIF(DB_RANDOMTRUE(bce_debug_mbuf_allocation_failure), - sc->mbuf_alloc_failed++; - sc->debug_mbuf_sim_alloc_failed++; + DBRUNIF(DB_RANDOMTRUE(mbuf_alloc_failed_sim_control), + sc->mbuf_alloc_failed_count++; + sc->mbuf_alloc_failed_sim_count++; rc = ENOBUFS; goto bce_get_pg_buf_exit); /* This is a new mbuf allocation. */ m_new = m_getcl(M_DONTWAIT, MT_DATA, 0); if (m_new == NULL) { - sc->mbuf_alloc_failed++; + sc->mbuf_alloc_failed_count++; rc = ENOBUFS; goto bce_get_pg_buf_exit; } @@ -4993,7 +5022,7 @@ bce_get_pg_buf_exit: return(rc); } -#endif /* BCE_USE_SPLIT_HEADER */ +#endif /* ZERO_COPY_SOCKETS */ /****************************************************************************/ /* Initialize the TX context memory. */ @@ -5351,7 +5380,7 @@ bce_free_rx_chain(struct bce_softc *sc) } -#ifdef BCE_USE_SPLIT_HEADER +#ifdef ZERO_COPY_SOCKETS /****************************************************************************/ /* Allocate memory and initialize the page data structures. */ /* Assumes that bce_init_rx_chain() has not already been called. */ @@ -5517,7 +5546,7 @@ bce_free_pg_chain(struct bce_softc *sc) DBEXIT(BCE_VERBOSE_RESET | BCE_VERBOSE_RECV | BCE_VERBOSE_UNLOAD); } -#endif /* BCE_USE_SPLIT_HEADER */ +#endif /* ZERO_COPY_SOCKETS */ /****************************************************************************/ @@ -5690,7 +5719,7 @@ bce_rx_intr(struct bce_softc *sc) unsigned int pkt_len; u16 sw_rx_cons, sw_rx_cons_idx, hw_rx_cons; u32 status; -#ifdef BCE_USE_SPLIT_HEADER +#ifdef ZERO_COPY_SOCKETS unsigned int rem_len; u16 sw_pg_cons, sw_pg_cons_idx; #endif @@ -5706,7 +5735,7 @@ bce_rx_intr(struct bce_softc *sc) bus_dmamap_sync(sc->rx_bd_chain_tag, sc->rx_bd_chain_map[i], BUS_DMASYNC_POSTWRITE); -#ifdef BCE_USE_SPLIT_HEADER +#ifdef ZERO_COPY_SOCKETS /* Prepare the page chain pages to be accessed by the host CPU. */ for (int i = 0; i < PG_PAGES; i++) bus_dmamap_sync(sc->pg_bd_chain_tag, @@ -5718,7 +5747,7 @@ bce_rx_intr(struct bce_softc *sc) /* Get working copies of the driver's view of the consumer indices. */ sw_rx_cons = sc->rx_cons; -#ifdef BCE_USE_SPLIT_HEADER +#ifdef ZERO_COPY_SOCKETS sw_pg_cons = sc->pg_cons; #endif @@ -5750,20 +5779,20 @@ bce_rx_intr(struct bce_softc *sc) sc->free_rx_bd++; /* - * Frames received on the NetXteme II are prepended - * with an l2_fhdr structure which provides status - * information about the received frame (including - * VLAN tags and checksum info). The frames are also - * automatically adjusted to align the IP header - * (i.e. two null bytes are inserted before the - * Ethernet header). As a result the data DMA'd by - * the controller into the mbuf is as follows: + * Frames received on the NetXteme II are prepended with an + * l2_fhdr structure which provides status information about + * the received frame (including VLAN tags and checksum info). + * The frames are also automatically adjusted to align the IP + * header (i.e. two null bytes are inserted before the Ethernet + * header). As a result the data DMA'd by the controller into + * the mbuf is as follows: + * * +---------+-----+---------------------+-----+ * | l2_fhdr | pad | packet data | FCS | * +---------+-----+---------------------+-----+ - * The l2_fhdr needs to be checked and skipped and - * the FCS needs to be stripped before sending the - * packet up the stack. + * + * The l2_fhdr needs to be checked and skipped and the FCS needs + * to be stripped before sending the packet up the stack. */ l2fhdr = mtod(m0, struct l2_fhdr *); @@ -5780,7 +5809,7 @@ bce_rx_intr(struct bce_softc *sc) */ m_adj(m0, sizeof(struct l2_fhdr) + ETHER_ALIGN); -#ifdef BCE_USE_SPLIT_HEADER +#ifdef ZERO_COPY_SOCKETS /* * Check whether the received frame fits in a single * mbuf or not (i.e. packet data + FCS <= @@ -5878,8 +5907,9 @@ bce_rx_intr(struct bce_softc *sc) BCE_PRINTF("Invalid Ethernet frame size!\n"); m_print(m0, 128)); - DBRUNIF(DB_RANDOMTRUE(bce_debug_l2fhdr_status_check), + DBRUNIF(DB_RANDOMTRUE(l2fhdr_error_sim_control), BCE_PRINTF("Simulating l2_fhdr status error.\n"); + sc->l2fhdr_error_sim_count++; status = status | L2_FHDR_ERRORS_PHY_DECODE); /* Check the received frame for errors. */ @@ -5889,7 +5919,7 @@ bce_rx_intr(struct bce_softc *sc) /* Log the error and release the mbuf. */ ifp->if_ierrors++; - DBRUN(sc->l2fhdr_status_errors++); + sc->l2fhdr_error_count++; m_freem(m0); m0 = NULL; @@ -5930,10 +5960,7 @@ bce_rx_intr(struct bce_softc *sc) } } - /* - * If we received a packet with a vlan tag, - * attach that information to the packet. - */ + /* Attach the VLAN tag. */ if (status & L2_FHDR_STATUS_L2_VLAN_TAG) { #if __FreeBSD_version < 700000 VLAN_INPUT_TAG(ifp, m0, l2fhdr->l2_fhdr_vlan_tag, continue); @@ -5943,7 +5970,7 @@ bce_rx_intr(struct bce_softc *sc) #endif } - /* Pass the mbuf off to the upper layers. */ + /* Increment received packet statistics. */ ifp->if_ipackets++; bce_rx_int_next_rx: @@ -5953,7 +5980,7 @@ bce_rx_int_next_rx: if (m0) { /* Make sure we don't lose our place when we release the lock. */ sc->rx_cons = sw_rx_cons; -#ifdef BCE_USE_SPLIT_HEADER +#ifdef ZERO_COPY_SOCKETS sc->pg_cons = sw_pg_cons; #endif @@ -5963,7 +5990,7 @@ bce_rx_int_next_rx: /* Recover our place. */ sw_rx_cons = sc->rx_cons; -#ifdef BCE_USE_SPLIT_HEADER +#ifdef ZERO_COPY_SOCKETS sw_pg_cons = sc->pg_cons; #endif } @@ -5974,7 +6001,7 @@ bce_rx_int_next_rx: } /* No new packets to process. Refill the RX and page chains and exit. */ -#ifdef BCE_USE_SPLIT_HEADER +#ifdef ZERO_COPY_SOCKETS sc->pg_cons = sw_pg_cons; bce_fill_pg_chain(sc); #endif @@ -5986,7 +6013,7 @@ bce_rx_int_next_rx: bus_dmamap_sync(sc->rx_bd_chain_tag, sc->rx_bd_chain_map[i], BUS_DMASYNC_PREWRITE); -#ifdef BCE_USE_SPLIT_HEADER +#ifdef ZERO_COPY_SOCKETS for (int i = 0; i < PG_PAGES; i++) bus_dmamap_sync(sc->pg_bd_chain_tag, sc->pg_bd_chain_map[i], BUS_DMASYNC_PREWRITE); @@ -6232,7 +6259,7 @@ bce_init_locked(struct bce_softc *sc) * Calculate and program the hardware Ethernet MTU * size. Be generous on the receive if we have room. */ -#ifdef BCE_USE_SPLIT_HEADER +#ifdef ZERO_COPY_SOCKETS if (ifp->if_mtu <= (sc->rx_bd_mbuf_data_len + sc->pg_bd_mbuf_alloc_size)) ether_mtu = sc->rx_bd_mbuf_data_len + sc->pg_bd_mbuf_alloc_size; #else @@ -6257,14 +6284,17 @@ bce_init_locked(struct bce_softc *sc) DBPRINT(sc, BCE_INFO_LOAD, "%s(): rx_bd_mbuf_alloc_size = %d, rx_bce_mbuf_data_len = %d, " - "rx_bd_mbuf_align_pad = %d, pg_bd_mbuf_alloc_size = %d\n", - __FUNCTION__, sc->rx_bd_mbuf_alloc_size, sc->rx_bd_mbuf_data_len, - sc->rx_bd_mbuf_align_pad, sc->pg_bd_mbuf_alloc_size); + "rx_bd_mbuf_align_pad = %d\n", __FUNCTION__, + sc->rx_bd_mbuf_alloc_size, sc->rx_bd_mbuf_data_len, + sc->rx_bd_mbuf_align_pad); /* Program appropriate promiscuous/multicast filtering. */ bce_set_rx_mode(sc); -#ifdef BCE_USE_SPLIT_HEADER +#ifdef ZERO_COPY_SOCKETS + DBPRINT(sc, BCE_INFO_LOAD, "%s(): pg_bd_mbuf_alloc_size = %d\n", + __FUNCTION__, sc->pg_bd_mbuf_alloc_size); + /* Init page buffer descriptor chain. */ bce_init_pg_chain(sc); #endif @@ -6473,10 +6503,7 @@ bce_tx_encap_skip_tso: /* Check if the DMA mapping was successful */ if (error == EFBIG) { - /* The mbuf is too fragmented for our DMA mapping. */ - DBPRINT(sc, BCE_WARN, "%s(): fragmented mbuf (%d pieces)\n", - __FUNCTION__, nsegs); - DBRUN(bce_dump_mbuf(sc, m0);); + sc->fragmented_mbuf_count++; /* Try to defrag the mbuf. */ m0 = m_defrag(*m_head, M_DONTWAIT); @@ -6484,7 +6511,7 @@ bce_tx_encap_skip_tso: /* Defrag was unsuccessful */ m_freem(*m_head); *m_head = NULL; - sc->mbuf_alloc_failed++; + sc->mbuf_alloc_failed_count++; rc = ENOBUFS; goto bce_tx_encap_exit; } @@ -6497,7 +6524,7 @@ bce_tx_encap_skip_tso: /* Still getting an error after a defrag. */ if (error == ENOMEM) { /* Insufficient DMA buffers available. */ - sc->tx_dma_map_failures++; + sc->dma_map_addr_tx_failed_count++; rc = error; goto bce_tx_encap_exit; } else if (error != 0) { @@ -6507,19 +6534,19 @@ bce_tx_encap_skip_tso: __FILE__, __LINE__); m_freem(m0); *m_head = NULL; - sc->tx_dma_map_failures++; + sc->dma_map_addr_tx_failed_count++; rc = ENOBUFS; goto bce_tx_encap_exit; } } else if (error == ENOMEM) { /* Insufficient DMA buffers available. */ - sc->tx_dma_map_failures++; + sc->dma_map_addr_tx_failed_count++; rc = error; goto bce_tx_encap_exit; } else if (error != 0) { m_freem(m0); *m_head = NULL; - sc->tx_dma_map_failures++; + sc->dma_map_addr_tx_failed_count++; rc = error; goto bce_tx_encap_exit; } @@ -6777,7 +6804,7 @@ bce_ioctl(struct ifnet *ifp, u_long comm BCE_LOCK(sc); ifp->if_mtu = ifr->ifr_mtu; ifp->if_drv_flags &= ~IFF_DRV_RUNNING; -#ifdef BCE_USE_SPLIT_HEADER +#ifdef ZERO_COPY_SOCKETS /* No buffer allocation size changes are necessary. */ #else /* Recalculate our buffer allocation sizes. */ @@ -7024,9 +7051,10 @@ bce_intr(void *xsc) status_attn_bits = sc->status_block->status_attn_bits; - DBRUNIF(DB_RANDOMTRUE(bce_debug_unexpected_attention), - BCE_PRINTF("Simulating unexpected status attention bit set."); - status_attn_bits = status_attn_bits | STATUS_ATTN_BITS_PARITY_ERROR); + DBRUNIF(DB_RANDOMTRUE(unexpected_attention_sim_control), + BCE_PRINTF("Simulating unexpected status attention bit set."); + sc->unexpected_attention_sim_count++; + status_attn_bits = status_attn_bits | STATUS_ATTN_BITS_PARITY_ERROR); /* Was it a link change interrupt? */ if ((status_attn_bits & STATUS_ATTN_BITS_LINK_STATE) != @@ -7044,13 +7072,13 @@ bce_intr(void *xsc) (sc->status_block->status_attn_bits_ack & ~STATUS_ATTN_BITS_LINK_STATE))) { - DBRUN(sc->unexpected_attentions++); + sc->unexpected_attention_count++; BCE_PRINTF("%s(%d): Fatal attention detected: 0x%08X\n", __FILE__, __LINE__, sc->status_block->status_attn_bits); DBRUNMSG(BCE_FATAL, - if (bce_debug_unexpected_attention == 0) + if (unexpected_attention_sim_control == 0) bce_breakpoint(sc)); bce_init_locked(sc); @@ -7299,8 +7327,8 @@ bce_stats_update(struct bce_softc *sc) sc->stat_EtherStatsUndersizePkts = stats->stat_EtherStatsUndersizePkts; - sc->stat_EtherStatsOverrsizePkts = - stats->stat_EtherStatsOverrsizePkts; + sc->stat_EtherStatsOversizePkts = + stats->stat_EtherStatsOversizePkts; sc->stat_EtherStatsPktsRx64Octets = stats->stat_EtherStatsPktsRx64Octets; @@ -7404,7 +7432,7 @@ bce_stats_update(struct bce_softc *sc) /* ToDo: This method loses soft errors. */ ifp->if_ierrors = (u_long) sc->stat_EtherStatsUndersizePkts + - (u_long) sc->stat_EtherStatsOverrsizePkts + + (u_long) sc->stat_EtherStatsOversizePkts + (u_long) sc->stat_IfInMBUFDiscards + (u_long) sc->stat_Dot3StatsAlignmentErrors + (u_long) sc->stat_Dot3StatsFCSErrors + @@ -7478,7 +7506,7 @@ bce_tick(void *xsc) bce_stats_update(sc); /* Top off the receive and page chains. */ -#ifdef BCE_USE_SPLIT_HEADER +#ifdef ZERO_COPY_SOCKETS bce_fill_pg_chain(sc); #endif bce_fill_rx_chain(sc); @@ -7658,7 +7686,7 @@ bce_sysctl_dump_tx_chain(SYSCTL_HANDLER_ } -#ifdef BCE_USE_SPLIT_HEADER +#ifdef ZERO_COPY_SOCKETS /****************************************************************************/ /* Provides a sysctl interface to allow dumping the page chain. */ /* */ @@ -7855,6 +7883,91 @@ bce_add_sysctls(struct bce_softc *sc) #ifdef BCE_DEBUG SYSCTL_ADD_INT(ctx, children, OID_AUTO, + "l2fhdr_error_sim_control", + CTLFLAG_RW, &l2fhdr_error_sim_control, + 0, "Debug control to force l2fhdr errors"); + + SYSCTL_ADD_INT(ctx, children, OID_AUTO, + "l2fhdr_error_sim_count", + CTLFLAG_RD, &sc->l2fhdr_error_sim_count, + 0, "Number of simulated l2_fhdr errors"); +#endif + + SYSCTL_ADD_INT(ctx, children, OID_AUTO, + "l2fhdr_error_count", + CTLFLAG_RD, &sc->l2fhdr_error_count, + 0, "Number of l2_fhdr errors"); + +#ifdef BCE_DEBUG + SYSCTL_ADD_INT(ctx, children, OID_AUTO, + "mbuf_alloc_failed_sim_control", + CTLFLAG_RW, &mbuf_alloc_failed_sim_control, + 0, "Debug control to force mbuf allocation failures"); + + SYSCTL_ADD_INT(ctx, children, OID_AUTO, + "mbuf_alloc_failed_sim_count", + CTLFLAG_RD, &sc->mbuf_alloc_failed_sim_count, + 0, "Number of simulated mbuf cluster allocation failures"); +#endif + + SYSCTL_ADD_INT(ctx, children, OID_AUTO, + "mbuf_alloc_failed_count", + CTLFLAG_RD, &sc->mbuf_alloc_failed_count, + 0, "Number of mbuf allocation failures"); + + SYSCTL_ADD_INT(ctx, children, OID_AUTO, + "fragmented_mbuf_count", + CTLFLAG_RD, &sc->fragmented_mbuf_count, + 0, "Number of fragmented mbufs"); + +#ifdef BCE_DEBUG + SYSCTL_ADD_INT(ctx, children, OID_AUTO, + "dma_map_addr_failed_sim_control", + CTLFLAG_RW, &dma_map_addr_failed_sim_control, + 0, "Debug control to force DMA mapping failures"); + + /* ToDo: Figure out how to update this value in bce_dma_map_addr(). */ + SYSCTL_ADD_INT(ctx, children, OID_AUTO, + "dma_map_addr_failed_sim_count", + CTLFLAG_RD, &sc->dma_map_addr_failed_sim_count, + 0, "Number of simulated DMA mapping failures"); + +#endif + + SYSCTL_ADD_INT(ctx, children, OID_AUTO, + "dma_map_addr_rx_failed_count", + CTLFLAG_RD, &sc->dma_map_addr_rx_failed_count, + 0, "Number of RX DMA mapping failures"); + + SYSCTL_ADD_INT(ctx, children, OID_AUTO, + "dma_map_addr_tx_failed_count", + CTLFLAG_RD, &sc->dma_map_addr_tx_failed_count, + 0, "Number of TX DMA mapping failures"); + +#ifdef BCE_DEBUG + SYSCTL_ADD_INT(ctx, children, OID_AUTO, + "unexpected_attention_sim_control", + CTLFLAG_RW, &unexpected_attention_sim_control, + 0, "Debug control to simulate unexpected attentions"); + + SYSCTL_ADD_INT(ctx, children, OID_AUTO, + "unexpected_attention_sim_count", + CTLFLAG_RW, &sc->unexpected_attention_sim_count, + 0, "Number of simulated unexpected attentions"); +#endif + + SYSCTL_ADD_INT(ctx, children, OID_AUTO, + "unexpected_attention_count", + CTLFLAG_RW, &sc->unexpected_attention_count, + 0, "Number of unexpected attentions"); + +#ifdef BCE_DEBUG + SYSCTL_ADD_INT(ctx, children, OID_AUTO, + "debug_bootcode_running_failure", + CTLFLAG_RW, &bootcode_running_failure_sim_control, + 0, "Debug control to force bootcode running failures"); + + SYSCTL_ADD_INT(ctx, children, OID_AUTO, "rx_low_watermark", CTLFLAG_RD, &sc->rx_low_watermark, 0, "Lowest level of free rx_bd's"); @@ -7875,26 +7988,6 @@ bce_add_sysctls(struct bce_softc *sc) 0, "Number of times the TX chain was full"); SYSCTL_ADD_INT(ctx, children, OID_AUTO, - "l2fhdr_status_errors", - CTLFLAG_RD, &sc->l2fhdr_status_errors, - 0, "l2_fhdr status errors"); - - SYSCTL_ADD_INT(ctx, children, OID_AUTO, - "unexpected_attentions", - CTLFLAG_RD, &sc->unexpected_attentions, - 0, "Unexpected attentions"); - - SYSCTL_ADD_INT(ctx, children, OID_AUTO, - "lost_status_block_updates", - CTLFLAG_RD, &sc->lost_status_block_updates, - 0, "Lost status block updates"); - - SYSCTL_ADD_INT(ctx, children, OID_AUTO, - "debug_mbuf_sim_alloc_failed", - CTLFLAG_RD, &sc->debug_mbuf_sim_alloc_failed, - 0, "Simulated mbuf cluster allocation failures"); - - SYSCTL_ADD_INT(ctx, children, OID_AUTO, "requested_tso_frames", CTLFLAG_RD, &sc->requested_tso_frames, 0, "Number of TSO frames received"); @@ -7920,16 +8013,6 @@ bce_add_sysctls(struct bce_softc *sc) "TX interrupt time"); #endif - SYSCTL_ADD_INT(ctx, children, OID_AUTO, - "mbuf_alloc_failed", - CTLFLAG_RD, &sc->mbuf_alloc_failed, - 0, "mbuf cluster allocation failures"); - - SYSCTL_ADD_INT(ctx, children, OID_AUTO, - "tx_dma_map_failures", - CTLFLAG_RD, &sc->tx_dma_map_failures, - 0, "tx dma mapping failures"); - SYSCTL_ADD_ULONG(ctx, children, OID_AUTO, "stat_IfHcInOctets", CTLFLAG_RD, &sc->stat_IfHCInOctets, @@ -8046,9 +8129,9 @@ bce_add_sysctls(struct bce_softc *sc) 0, "Undersize packets"); SYSCTL_ADD_UINT(ctx, children, OID_AUTO, - "stat_EtherStatsOverrsizePkts", - CTLFLAG_RD, &sc->stat_EtherStatsOverrsizePkts, - 0, "stat_EtherStatsOverrsizePkts"); + "stat_EtherStatsOversizePkts", + CTLFLAG_RD, &sc->stat_EtherStatsOversizePkts, + 0, "stat_EtherStatsOversizePkts"); SYSCTL_ADD_UINT(ctx, children, OID_AUTO, "stat_EtherStatsPktsRx64Octets", @@ -8231,7 +8314,7 @@ bce_add_sysctls(struct bce_softc *sc) (void *)sc, 0, bce_sysctl_dump_tx_chain, "I", "Dump tx_bd chain"); -#ifdef BCE_USE_SPLIT_HEADER +#ifdef ZERO_COPY_SOCKETS SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "dump_pg_chain", CTLTYPE_INT | CTLFLAG_RW, (void *)sc, 0, @@ -8526,7 +8609,7 @@ bce_dump_rx_mbuf_chain(struct bce_softc } -#ifdef BCE_USE_SPLIT_HEADER +#ifdef ZERO_COPY_SOCKETS /****************************************************************************/ /* Prints out the mbufs in the mbuf page chain. */ /* */ @@ -8650,7 +8733,7 @@ bce_dump_rxbd(struct bce_softc *sc, int } -#ifdef BCE_USE_SPLIT_HEADER +#ifdef ZERO_COPY_SOCKETS /****************************************************************************/ /* Prints out a rx_bd structure in the page chain. */ /* */ @@ -9137,7 +9220,7 @@ bce_dump_rx_chain(struct bce_softc *sc, } -#ifdef BCE_USE_SPLIT_HEADER +#ifdef ZERO_COPY_SOCKETS /****************************************************************************/ /* Prints out the page chain. */ /* */ @@ -9439,9 +9522,9 @@ bce_dump_stats_block(struct bce_softc *s BCE_PRINTF(" 0x%08X : EtherStatsUndersizePkts\n", sblk->stat_EtherStatsUndersizePkts); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-7@FreeBSD.ORG Tue Mar 31 02:29:42 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A2EB41065676; Tue, 31 Mar 2009 02:29:42 +0000 (UTC) (envelope-from weongyo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9025A8FC0A; Tue, 31 Mar 2009 02:29:42 +0000 (UTC) (envelope-from weongyo@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2V2TgIM085072; Tue, 31 Mar 2009 02:29:42 GMT (envelope-from weongyo@svn.freebsd.org) Received: (from weongyo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2V2TgnP085071; Tue, 31 Mar 2009 02:29:42 GMT (envelope-from weongyo@svn.freebsd.org) Message-Id: <200903310229.n2V2TgnP085071@svn.freebsd.org> From: Weongyo Jeong Date: Tue, 31 Mar 2009 02:29:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190584 - stable/7/share/man/man4 X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 31 Mar 2009 02:29:43 -0000 Author: weongyo Date: Tue Mar 31 02:29:42 2009 New Revision: 190584 URL: http://svn.freebsd.org/changeset/base/190584 Log: MFC r190434: The malo(4) device driver first appeared in FreeBSD 7.1 not 8.0. Reported by: John Approved by: re (hrs) Modified: stable/7/share/man/man4/ (props changed) stable/7/share/man/man4/igb.4 (props changed) stable/7/share/man/man4/malo.4 Modified: stable/7/share/man/man4/malo.4 ============================================================================== --- stable/7/share/man/man4/malo.4 Tue Mar 31 01:59:47 2009 (r190583) +++ stable/7/share/man/man4/malo.4 Tue Mar 31 02:29:42 2009 (r190584) @@ -126,4 +126,4 @@ ifconfig malo0 inet 192.168.0.20 netmask The .Nm device driver first appeared in -.Fx 8.0 . +.Fx 7.1 . From owner-svn-src-stable-7@FreeBSD.ORG Tue Mar 31 16:44:08 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3645A1065719; Tue, 31 Mar 2009 16:44:08 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 234938FC16; Tue, 31 Mar 2009 16:44:08 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2VGi80s005026; Tue, 31 Mar 2009 16:44:08 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2VGi8Km005025; Tue, 31 Mar 2009 16:44:08 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <200903311644.n2VGi8Km005025@svn.freebsd.org> From: Xin LI Date: Tue, 31 Mar 2009 16:44:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190594 - stable/7/share/man/man4 X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 31 Mar 2009 16:44:09 -0000 Author: delphij Date: Tue Mar 31 16:44:07 2009 New Revision: 190594 URL: http://svn.freebsd.org/changeset/base/190594 Log: MFC r187318: Reflect PCI ID changes for bce(4). Approved by: re (kensmith) Modified: stable/7/share/man/man4/ (props changed) stable/7/share/man/man4/bce.4 Modified: stable/7/share/man/man4/bce.4 ============================================================================== --- stable/7/share/man/man4/bce.4 Tue Mar 31 14:30:46 2009 (r190593) +++ stable/7/share/man/man4/bce.4 Tue Mar 31 16:44:07 2009 (r190594) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 2, 2008 +.Dd January 15, 2009 .Dt BCE 4 .Os .Sh NAME @@ -160,6 +160,26 @@ HP NC370F Multifunction Gigabit Server A HP NC370T Multifunction Gigabit Server Adapter .It HP NC370i Multifunction Gigabit Server Adapter +.It +HP NC371i Multifunction Gigabit Server Adapter +.It +HP NC373F PCIe Multifunc Giga Server Adapter +.It +HP NC373T PCIe Multifunction Gig Server Adapter +.It +HP NC373i Multifunction Gigabit Server Adapter +.It +HP NC373m Multifunction Gigabit Server Adapter +.It +HP NC374m PCIe Multifunction Adapter +.It +HP NC380T PCIe DP Multifunc Gig Server Adapter +.It +HP NC382T PCIe DP Multifunction Gigabit Server Adapter +.It +HP NC382i DP Multifunction Gigabit Server Adapter +.It +HP NC382m DP 1GbE Multifunction BL-c Adapter .El .Sh SYSCTL VARIABLES The following variables are available as both From owner-svn-src-stable-7@FreeBSD.ORG Wed Apr 1 06:01:40 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 913711065701; Wed, 1 Apr 2009 06:01:40 +0000 (UTC) (envelope-from trhodes@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7E7768FC13; Wed, 1 Apr 2009 06:01:40 +0000 (UTC) (envelope-from trhodes@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3161e9F020586; Wed, 1 Apr 2009 06:01:40 GMT (envelope-from trhodes@svn.freebsd.org) Received: (from trhodes@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3161el0020585; Wed, 1 Apr 2009 06:01:40 GMT (envelope-from trhodes@svn.freebsd.org) Message-Id: <200904010601.n3161el0020585@svn.freebsd.org> From: Tom Rhodes Date: Wed, 1 Apr 2009 06:01:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190605 - stable/7/sbin/shutdown X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Apr 2009 06:01:41 -0000 Author: trhodes Date: Wed Apr 1 06:01:40 2009 New Revision: 190605 URL: http://svn.freebsd.org/changeset/base/190605 Log: MFC r186431: Note that when shutdown is run without options, it will place the system into single user mode at the time specified. PR: 129765 Approved by: re (kib) Modified: stable/7/sbin/shutdown/ (props changed) stable/7/sbin/shutdown/shutdown.8 Modified: stable/7/sbin/shutdown/shutdown.8 ============================================================================== --- stable/7/sbin/shutdown/shutdown.8 Wed Apr 1 04:36:37 2009 (r190604) +++ stable/7/sbin/shutdown/shutdown.8 Wed Apr 1 06:01:40 2009 (r190605) @@ -28,7 +28,7 @@ .\" @(#)shutdown.8 8.2 (Berkeley) 4/27/95 .\" $FreeBSD$ .\" -.Dd December 11, 1998 +.Dd December 23, 2008 .Dt SHUTDOWN 8 .Os .Sh NAME @@ -167,6 +167,12 @@ The file that .Nm created will be removed automatically. +.Pp +When run without options, the +.Nm +utility will place the system into single user mode at the +.Ar time +specified. .Sh FILES .Bl -tag -width /var/run/nologin -compact .It Pa /var/run/nologin From owner-svn-src-stable-7@FreeBSD.ORG Wed Apr 1 06:03:23 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AB5D11065692; Wed, 1 Apr 2009 06:03:23 +0000 (UTC) (envelope-from trhodes@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9945F8FC08; Wed, 1 Apr 2009 06:03:23 +0000 (UTC) (envelope-from trhodes@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3163NXS020652; Wed, 1 Apr 2009 06:03:23 GMT (envelope-from trhodes@svn.freebsd.org) Received: (from trhodes@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3163Ni8020651; Wed, 1 Apr 2009 06:03:23 GMT (envelope-from trhodes@svn.freebsd.org) Message-Id: <200904010603.n3163Ni8020651@svn.freebsd.org> From: Tom Rhodes Date: Wed, 1 Apr 2009 06:03:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190606 - stable/7/sbin/mount_msdosfs X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Apr 2009 06:03:24 -0000 Author: trhodes Date: Wed Apr 1 06:03:23 2009 New Revision: 190606 URL: http://svn.freebsd.org/changeset/base/190606 Log: MFC r186429: Document the "-o large" option. PR: 129792 And r186768: Add missing qualifier which was missed in the previous commit. Noticed by: brooks Approved by: re (kib) Modified: stable/7/sbin/mount_msdosfs/ (props changed) stable/7/sbin/mount_msdosfs/mount_msdosfs.8 Modified: stable/7/sbin/mount_msdosfs/mount_msdosfs.8 ============================================================================== --- stable/7/sbin/mount_msdosfs/mount_msdosfs.8 Wed Apr 1 06:01:40 2009 (r190605) +++ stable/7/sbin/mount_msdosfs/mount_msdosfs.8 Wed Apr 1 06:03:23 2009 (r190606) @@ -30,7 +30,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 7, 1994 +.Dd December 23, 2008 .Dt MOUNT_MSDOSFS 8 .Os .Sh NAME @@ -73,6 +73,11 @@ as described in .Xr mount 8 . The following MSDOS file system-specific options are available: .Bl -tag -width indent +.It Cm large +Support file systems larger than 128 gigabytes at the expense +of 32 bytes of kernel memory for each file on disk. +This memory will not be reclaimed until the file system has +been unmounted. .It Cm longnames Force Windows 95 long filenames to be visible. .It Cm shortnames From owner-svn-src-stable-7@FreeBSD.ORG Wed Apr 1 18:47:02 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BC4041065673; Wed, 1 Apr 2009 18:47:02 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 852BA8FC15; Wed, 1 Apr 2009 18:47:02 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from server.baldwin.cx (pool-98-109-39-197.nwrknj.fios.verizon.net [98.109.39.197]) by cyrus.watson.org (Postfix) with ESMTPSA id 258C046B1A; Wed, 1 Apr 2009 14:47:02 -0400 (EDT) Received: from localhost (john@localhost [127.0.0.1]) (authenticated bits=0) by server.baldwin.cx (8.14.3/8.14.3) with ESMTP id n31IkuYT041946; Wed, 1 Apr 2009 14:46:56 -0400 (EDT) (envelope-from jhb@freebsd.org) From: John Baldwin To: Dmitry Chagin Date: Wed, 1 Apr 2009 14:46:51 -0400 User-Agent: KMail/1.9.7 References: <200903290807.n2T87b4D025770@svn.freebsd.org> In-Reply-To: <200903290807.n2T87b4D025770@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200904011446.51822.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH authentication, not delayed by milter-greylist-2.0.2 (server.baldwin.cx [127.0.0.1]); Wed, 01 Apr 2009 14:46:56 -0400 (EDT) X-Virus-Scanned: ClamAV 0.94.2/9195/Wed Apr 1 12:49:01 2009 on server.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-4.4 required=4.2 tests=ALL_TRUSTED,BAYES_00 autolearn=ham version=3.1.3 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on server.baldwin.cx Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-7@freebsd.org Subject: Re: svn commit: r190520 - in stable/7/sys: . amd64/amd64 amd64/linux32 arm/arm compat/ia32 compat/svr4 contrib/pf dev/ath/ath_hal dev/cxgb i386/i386 i386/linux ia64/ia64 kern powerpc/powerpc sparc64/sp... X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Apr 2009 18:47:03 -0000 On Sunday 29 March 2009 4:07:37 am Dmitry Chagin wrote: > Author: dchagin > Date: Sun Mar 29 08:07:36 2009 > New Revision: 190520 > URL: http://svn.freebsd.org/changeset/base/190520 > > Log: > Merge from head to stable/7: > > r189771: > Implement new way of branding ELF binaries by looking to a > ".note.ABI-tag" section. > > The search order of a brand is changed, now first of all the > ".note.ABI-tag" is looked through. > > Move code which fetch osreldate for ELF binary to check_note() handler. I think this breaks the ABI of older ELF ABI kernel modules (e.g. older linux.ko binaries) since it changes the layout of the 'ElfN(Brandinfo)' structure. I think you can fix this by making the following changes in 7.x only: 1) Move the new field (brand_note) to the end of the structure. 2) Add a new flag BI_BRAND_NOTE (or some such) that indicates that the brandnote pointer is valid. Only use the brandnote field if the new flag is set and set it in all the new places that now have notes. Old modules won't have the flag set, so the new field (which would really be garbage) would be ignored. -- John Baldwin From owner-svn-src-stable-7@FreeBSD.ORG Thu Apr 2 02:26:58 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C1971106566B; Thu, 2 Apr 2009 02:26:58 +0000 (UTC) (envelope-from weongyo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AF9708FC13; Thu, 2 Apr 2009 02:26:58 +0000 (UTC) (envelope-from weongyo@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n322QwXC049221; Thu, 2 Apr 2009 02:26:58 GMT (envelope-from weongyo@svn.freebsd.org) Received: (from weongyo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n322QwA7049220; Thu, 2 Apr 2009 02:26:58 GMT (envelope-from weongyo@svn.freebsd.org) Message-Id: <200904020226.n322QwA7049220@svn.freebsd.org> From: Weongyo Jeong Date: Thu, 2 Apr 2009 02:26:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190637 - stable/7/share/man/man4 X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Apr 2009 02:26:59 -0000 Author: weongyo Date: Thu Apr 2 02:26:58 2009 New Revision: 190637 URL: http://svn.freebsd.org/changeset/base/190637 Log: MFC r190437: bump date. Pointed by: yongari Approved by: re (kib) Modified: stable/7/share/man/man4/ (props changed) stable/7/share/man/man4/igb.4 (props changed) stable/7/share/man/man4/malo.4 Modified: stable/7/share/man/man4/malo.4 ============================================================================== --- stable/7/share/man/man4/malo.4 Thu Apr 2 01:46:57 2009 (r190636) +++ stable/7/share/man/man4/malo.4 Thu Apr 2 02:26:58 2009 (r190637) @@ -31,7 +31,7 @@ .\" .\" $FreeBSD$ .\"/ -.Dd March 25, 2008 +.Dd March 26, 2009 .Dt MALO 4 .Os .Sh NAME From owner-svn-src-stable-7@FreeBSD.ORG Thu Apr 2 17:53:31 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2A7B6106564A; Thu, 2 Apr 2009 17:53:31 +0000 (UTC) (envelope-from rnoland@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 16C638FC1E; Thu, 2 Apr 2009 17:53:31 +0000 (UTC) (envelope-from rnoland@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n32HrUge071748; Thu, 2 Apr 2009 17:53:30 GMT (envelope-from rnoland@svn.freebsd.org) Received: (from rnoland@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n32HrUnl071746; Thu, 2 Apr 2009 17:53:30 GMT (envelope-from rnoland@svn.freebsd.org) Message-Id: <200904021753.n32HrUnl071746@svn.freebsd.org> From: Robert Noland Date: Thu, 2 Apr 2009 17:53:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190647 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb dev/drm X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Apr 2009 17:53:31 -0000 Author: rnoland Date: Thu Apr 2 17:53:30 2009 New Revision: 190647 URL: http://svn.freebsd.org/changeset/base/190647 Log: Merge 190123,190282 Fix up the flags to bus_dmamem again. The man page incorrectly showed the BUS_DMA_NOCACHE flags as being a valid flag for load instead of alloc. Approved by: re (kib) Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/dev/drm/ati_pcigart.c stable/7/sys/dev/drm/drm_scatter.c Modified: stable/7/sys/dev/drm/ati_pcigart.c ============================================================================== --- stable/7/sys/dev/drm/ati_pcigart.c Thu Apr 2 17:16:39 2009 (r190646) +++ stable/7/sys/dev/drm/ati_pcigart.c Thu Apr 2 17:53:30 2009 (r190647) @@ -75,14 +75,14 @@ drm_ati_alloc_pcigart_table(struct drm_d NULL, NULL, /* filtfunc, filtfuncargs */ gart_info->table_size, 1, /* maxsize, nsegs */ gart_info->table_size, /* maxsegsize */ - BUS_DMA_ALLOCNOW, NULL, NULL, /* flags, lockfunc, lockfuncargs */ + 0, NULL, NULL, /* flags, lockfunc, lockfuncargs */ &dmah->tag); if (ret != 0) { free(dmah, DRM_MEM_DMA); return ENOMEM; } - flags = BUS_DMA_NOWAIT | BUS_DMA_ZERO; + flags = BUS_DMA_WAITOK | BUS_DMA_ZERO; if (gart_info->gart_reg_if == DRM_ATI_GART_IGP) flags |= BUS_DMA_NOCACHE; @@ -95,7 +95,8 @@ drm_ati_alloc_pcigart_table(struct drm_d DRM_LOCK(); ret = bus_dmamap_load(dmah->tag, dmah->map, dmah->vaddr, - gart_info->table_size, drm_ati_alloc_pcigart_table_cb, dmah, 0); + gart_info->table_size, drm_ati_alloc_pcigart_table_cb, dmah, + BUS_DMA_NOWAIT); if (ret != 0) { bus_dmamem_free(dmah->tag, dmah->vaddr, dmah->map); bus_dma_tag_destroy(dmah->tag); Modified: stable/7/sys/dev/drm/drm_scatter.c ============================================================================== --- stable/7/sys/dev/drm/drm_scatter.c Thu Apr 2 17:16:39 2009 (r190646) +++ stable/7/sys/dev/drm/drm_scatter.c Thu Apr 2 17:53:30 2009 (r190647) @@ -92,7 +92,7 @@ drm_sg_alloc(struct drm_device *dev, str } ret = bus_dmamem_alloc(dmah->tag, &dmah->vaddr, - BUS_DMA_WAITOK | BUS_DMA_ZERO, &dmah->map); + BUS_DMA_WAITOK | BUS_DMA_ZERO | BUS_DMA_NOCACHE, &dmah->map); if (ret != 0) { bus_dma_tag_destroy(dmah->tag); free(dmah, DRM_MEM_DMA); @@ -102,8 +102,7 @@ drm_sg_alloc(struct drm_device *dev, str } ret = bus_dmamap_load(dmah->tag, dmah->map, dmah->vaddr, - request->size, drm_sg_alloc_cb, entry, - BUS_DMA_NOWAIT | BUS_DMA_NOCACHE); + request->size, drm_sg_alloc_cb, entry, BUS_DMA_NOWAIT); if (ret != 0) { bus_dmamem_free(dmah->tag, dmah->vaddr, dmah->map); bus_dma_tag_destroy(dmah->tag); From owner-svn-src-stable-7@FreeBSD.ORG Thu Apr 2 17:57:04 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 85ABD106564A; Thu, 2 Apr 2009 17:57:04 +0000 (UTC) (envelope-from rnoland@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 722558FC1D; Thu, 2 Apr 2009 17:57:04 +0000 (UTC) (envelope-from rnoland@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n32Hv43q071902; Thu, 2 Apr 2009 17:57:04 GMT (envelope-from rnoland@svn.freebsd.org) Received: (from rnoland@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n32Hv4Wv071901; Thu, 2 Apr 2009 17:57:04 GMT (envelope-from rnoland@svn.freebsd.org) Message-Id: <200904021757.n32Hv4Wv071901@svn.freebsd.org> From: Robert Noland Date: Thu, 2 Apr 2009 17:57:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190648 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb dev/drm X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Apr 2009 17:57:05 -0000 Author: rnoland Date: Thu Apr 2 17:57:04 2009 New Revision: 190648 URL: http://svn.freebsd.org/changeset/base/190648 Log: Merge 190124 Add a couple of radeon pci ids. Approved by: re (kib) Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/dev/drm/drm_pciids.h Modified: stable/7/sys/dev/drm/drm_pciids.h ============================================================================== --- stable/7/sys/dev/drm/drm_pciids.h Thu Apr 2 17:53:30 2009 (r190647) +++ stable/7/sys/dev/drm/drm_pciids.h Thu Apr 2 17:57:04 2009 (r190648) @@ -320,6 +320,8 @@ {0x1002, 0x9612, CHIP_RS780|RADEON_NEW_MEMMAP|RADEON_IS_IGP, "ATI Radeon HD 3200 Graphics"}, \ {0x1002, 0x9613, CHIP_RS780|RADEON_NEW_MEMMAP|RADEON_IS_IGP, "ATI Radeon 3100 Graphics"}, \ {0x1002, 0x9614, CHIP_RS780|RADEON_NEW_MEMMAP|RADEON_IS_IGP, "ATI Radeon 3300 Graphics"}, \ + {0x1002, 0x9615, CHIP_RS780|RADEON_NEW_MEMMAP|RADEON_IS_IGP, "ATI Radeon 3200 Graphics"}, \ + {0x1002, 0x9616, CHIP_RS780|RADEON_NEW_MEMMAP|RADEON_IS_IGP, "ATI Radeon 3000 Graphics"}, \ {0x1002, 0x9440, CHIP_RV770|RADEON_NEW_MEMMAP, "ATI Radeon 4800 Series"}, \ {0x1002, 0x9441, CHIP_RV770|RADEON_NEW_MEMMAP, "ATI Radeon 4870 X2"}, \ {0x1002, 0x9442, CHIP_RV770|RADEON_NEW_MEMMAP, "ATI Radeon 4800 Series"}, \ From owner-svn-src-stable-7@FreeBSD.ORG Thu Apr 2 17:58:20 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E3D8C1065675; Thu, 2 Apr 2009 17:58:20 +0000 (UTC) (envelope-from rnoland@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D01358FC1F; Thu, 2 Apr 2009 17:58:20 +0000 (UTC) (envelope-from rnoland@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n32HwKDX071988; Thu, 2 Apr 2009 17:58:20 GMT (envelope-from rnoland@svn.freebsd.org) Received: (from rnoland@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n32HwKJw071985; Thu, 2 Apr 2009 17:58:20 GMT (envelope-from rnoland@svn.freebsd.org) Message-Id: <200904021758.n32HwKJw071985@svn.freebsd.org> From: Robert Noland Date: Thu, 2 Apr 2009 17:58:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190649 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb dev/drm X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Apr 2009 17:58:22 -0000 Author: rnoland Date: Thu Apr 2 17:58:20 2009 New Revision: 190649 URL: http://svn.freebsd.org/changeset/base/190649 Log: Merge 190399 The GART allocations are a propery of the gart, not of scatter-gather memory. Track them in the appropriate structure. Approved by: re (kib) Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/dev/drm/ati_pcigart.c stable/7/sys/dev/drm/drmP.h stable/7/sys/dev/drm/drm_scatter.c Modified: stable/7/sys/dev/drm/ati_pcigart.c ============================================================================== --- stable/7/sys/dev/drm/ati_pcigart.c Thu Apr 2 17:57:04 2009 (r190648) +++ stable/7/sys/dev/drm/ati_pcigart.c Thu Apr 2 17:58:20 2009 (r190649) @@ -104,7 +104,7 @@ drm_ati_alloc_pcigart_table(struct drm_d return ENOMEM; } - dev->sg->dmah = dmah; + gart_info->dmah = dmah; return 0; } @@ -113,12 +113,12 @@ static void drm_ati_free_pcigart_table(struct drm_device *dev, struct drm_ati_pcigart_info *gart_info) { - struct drm_dma_handle *dmah = dev->sg->dmah; + struct drm_dma_handle *dmah = gart_info->dmah; bus_dmamem_free(dmah->tag, dmah->vaddr, dmah->map); bus_dma_tag_destroy(dmah->tag); free(dmah, DRM_MEM_DMA); - dev->sg->dmah = NULL; + gart_info->dmah = NULL; } int @@ -134,7 +134,7 @@ drm_ati_pcigart_cleanup(struct drm_devic if (gart_info->bus_addr) { if (gart_info->gart_table_location == DRM_ATI_GART_MAIN) { gart_info->bus_addr = 0; - if (dev->sg->dmah) + if (gart_info->dmah) drm_ati_free_pcigart_table(dev, gart_info); } } @@ -169,8 +169,8 @@ drm_ati_pcigart_init(struct drm_device * goto done; } - address = (void *)dev->sg->dmah->vaddr; - bus_address = dev->sg->dmah->busaddr; + address = (void *)gart_info->dmah->vaddr; + bus_address = gart_info->dmah->busaddr; } else { address = gart_info->addr; bus_address = gart_info->bus_addr; Modified: stable/7/sys/dev/drm/drmP.h ============================================================================== --- stable/7/sys/dev/drm/drmP.h Thu Apr 2 17:57:04 2009 (r190648) +++ stable/7/sys/dev/drm/drmP.h Thu Apr 2 17:58:20 2009 (r190649) @@ -480,9 +480,7 @@ typedef struct drm_sg_mem { void *virtual; int pages; dma_addr_t *busaddr; - struct drm_dma_handle *sg_dmah; /* Handle for sg_pages */ struct drm_dma_handle *dmah; /* Handle to PCI memory */ - /* for ATI PCIGART table */ } drm_sg_mem_t; typedef TAILQ_HEAD(drm_map_list, drm_local_map) drm_map_list_t; @@ -543,6 +541,7 @@ struct drm_ati_pcigart_info { struct drm_dma_handle *table_handle; drm_local_map_t mapping; int table_size; + struct drm_dma_handle *dmah; /* handle for ATI PCIGART table */ }; #ifndef DMA_BIT_MASK Modified: stable/7/sys/dev/drm/drm_scatter.c ============================================================================== --- stable/7/sys/dev/drm/drm_scatter.c Thu Apr 2 17:57:04 2009 (r190648) +++ stable/7/sys/dev/drm/drm_scatter.c Thu Apr 2 17:58:20 2009 (r190649) @@ -112,7 +112,7 @@ drm_sg_alloc(struct drm_device *dev, str return ENOMEM; } - entry->sg_dmah = dmah; + entry->dmah = dmah; entry->handle = (unsigned long)dmah->vaddr; DRM_DEBUG("sg alloc handle = %08lx\n", entry->handle); @@ -160,7 +160,7 @@ drm_sg_alloc_ioctl(struct drm_device *de void drm_sg_cleanup(struct drm_sg_mem *entry) { - struct drm_dma_handle *dmah = entry->sg_dmah; + struct drm_dma_handle *dmah = entry->dmah; bus_dmamap_unload(dmah->tag, dmah->map); bus_dmamem_free(dmah->tag, dmah->vaddr, dmah->map); From owner-svn-src-stable-7@FreeBSD.ORG Thu Apr 2 18:20:47 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 465FC1065676; Thu, 2 Apr 2009 18:20:47 +0000 (UTC) (envelope-from rnoland@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 324058FC1A; Thu, 2 Apr 2009 18:20:47 +0000 (UTC) (envelope-from rnoland@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n32IKlUw072684; Thu, 2 Apr 2009 18:20:47 GMT (envelope-from rnoland@svn.freebsd.org) Received: (from rnoland@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n32IKlSd072683; Thu, 2 Apr 2009 18:20:47 GMT (envelope-from rnoland@svn.freebsd.org) Message-Id: <200904021820.n32IKlSd072683@svn.freebsd.org> From: Robert Noland Date: Thu, 2 Apr 2009 18:20:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190652 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb dev/drm X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Apr 2009 18:20:48 -0000 Author: rnoland Date: Thu Apr 2 18:20:46 2009 New Revision: 190652 URL: http://svn.freebsd.org/changeset/base/190652 Log: Merge 190563 Load the right microcode for RS780 Approved by: re (kib) Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/dev/drm/r600_cp.c Modified: stable/7/sys/dev/drm/r600_cp.c ============================================================================== --- stable/7/sys/dev/drm/r600_cp.c Thu Apr 2 18:11:21 2009 (r190651) +++ stable/7/sys/dev/drm/r600_cp.c Thu Apr 2 18:20:46 2009 (r190652) @@ -392,17 +392,17 @@ static void r600_cp_load_microcode(drm_r DRM_INFO("Loading RS780 CP Microcode\n"); for (i = 0; i < PM4_UCODE_SIZE; i++) { RADEON_WRITE(R600_CP_ME_RAM_DATA, - RV670_cp_microcode[i][0]); + RS780_cp_microcode[i][0]); RADEON_WRITE(R600_CP_ME_RAM_DATA, - RV670_cp_microcode[i][1]); + RS780_cp_microcode[i][1]); RADEON_WRITE(R600_CP_ME_RAM_DATA, - RV670_cp_microcode[i][2]); + RS780_cp_microcode[i][2]); } RADEON_WRITE(R600_CP_PFP_UCODE_ADDR, 0); DRM_INFO("Loading RS780 PFP Microcode\n"); for (i = 0; i < PFP_UCODE_SIZE; i++) - RADEON_WRITE(R600_CP_PFP_UCODE_DATA, RV670_pfp_microcode[i]); + RADEON_WRITE(R600_CP_PFP_UCODE_DATA, RS780_pfp_microcode[i]); } RADEON_WRITE(R600_CP_PFP_UCODE_ADDR, 0); RADEON_WRITE(R600_CP_ME_RAM_WADDR, 0); From owner-svn-src-stable-7@FreeBSD.ORG Thu Apr 2 18:21:41 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9445910656BB; Thu, 2 Apr 2009 18:21:41 +0000 (UTC) (envelope-from rnoland@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7FD0A8FC29; Thu, 2 Apr 2009 18:21:41 +0000 (UTC) (envelope-from rnoland@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n32ILf7s072753; Thu, 2 Apr 2009 18:21:41 GMT (envelope-from rnoland@svn.freebsd.org) Received: (from rnoland@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n32ILfIL072752; Thu, 2 Apr 2009 18:21:41 GMT (envelope-from rnoland@svn.freebsd.org) Message-Id: <200904021821.n32ILfIL072752@svn.freebsd.org> From: Robert Noland Date: Thu, 2 Apr 2009 18:21:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190653 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb dev/drm X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Apr 2009 18:21:43 -0000 Author: rnoland Date: Thu Apr 2 18:21:41 2009 New Revision: 190653 URL: http://svn.freebsd.org/changeset/base/190653 Log: Merge 190565 We don't know what these pages are going to be used for, they should be un-cached. This got lost somewhere with all the bus_dma fixups. Approved by: re (kib) Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/dev/drm/drm_pci.c Modified: stable/7/sys/dev/drm/drm_pci.c ============================================================================== --- stable/7/sys/dev/drm/drm_pci.c Thu Apr 2 18:20:46 2009 (r190652) +++ stable/7/sys/dev/drm/drm_pci.c Thu Apr 2 18:21:41 2009 (r190653) @@ -91,7 +91,7 @@ drm_pci_alloc(struct drm_device *dev, si } ret = bus_dmamem_alloc(dmah->tag, &dmah->vaddr, - BUS_DMA_WAITOK | BUS_DMA_ZERO, &dmah->map); + BUS_DMA_WAITOK | BUS_DMA_ZERO | BUS_DMA_NOCACHE, &dmah->map); if (ret != 0) { bus_dma_tag_destroy(dmah->tag); free(dmah, DRM_MEM_DMA); From owner-svn-src-stable-7@FreeBSD.ORG Thu Apr 2 22:04:45 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5ED891065670; Thu, 2 Apr 2009 22:04:45 +0000 (UTC) (envelope-from trhodes@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 32E2F8FC0A; Thu, 2 Apr 2009 22:04:45 +0000 (UTC) (envelope-from trhodes@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n32M4jCT077586; Thu, 2 Apr 2009 22:04:45 GMT (envelope-from trhodes@svn.freebsd.org) Received: (from trhodes@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n32M4jiL077584; Thu, 2 Apr 2009 22:04:45 GMT (envelope-from trhodes@svn.freebsd.org) Message-Id: <200904022204.n32M4jiL077584@svn.freebsd.org> From: Tom Rhodes Date: Thu, 2 Apr 2009 22:04:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190660 - stable/7/usr.sbin/arp X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Apr 2009 22:04:46 -0000 Author: trhodes Date: Thu Apr 2 22:04:44 2009 New Revision: 190660 URL: http://svn.freebsd.org/changeset/base/190660 Log: nt a warning when blackhole and reject are used together. Update arp.8 manual page syntax. PR: 125896 Submitted by: Marc Olzheim Approved by: re (kib), sam Modified: stable/7/usr.sbin/arp/ (props changed) stable/7/usr.sbin/arp/arp.8 stable/7/usr.sbin/arp/arp.c Modified: stable/7/usr.sbin/arp/arp.8 ============================================================================== --- stable/7/usr.sbin/arp/arp.8 Thu Apr 2 21:58:34 2009 (r190659) +++ stable/7/usr.sbin/arp/arp.8 Thu Apr 2 22:04:44 2009 (r190660) @@ -28,7 +28,7 @@ .\" @(#)arp.8 8.1 (Berkeley) 6/6/93 .\" $FreeBSD$ .\" -.Dd March 18, 2008 +.Dd December 25, 2008 .Dt ARP 8 .Os .Sh NAME @@ -53,14 +53,12 @@ .Nm .Fl s Ar hostname ether_addr .Op Cm temp -.Op Cm reject -.Op Cm blackhole +.Op Cm blackhole No \&| Cm reject .Op Cm pub Op Cm only .Nm .Fl S Ar hostname ether_addr .Op Cm temp -.Op Cm reject -.Op Cm blackhole +.Op Cm blackhole No \&| Cm reject .Op Cm pub Op Cm only .Nm .Fl f Ar filename @@ -182,7 +180,8 @@ in the file should be of the form .Bd -ragged -offset indent -compact .Ar hostname ether_addr .Op Cm temp -.Op Cm pub +.Op Cm blackhole No \&| Cm reject +.Op Cm pub Op Cm only .Ed .Pp with argument meanings as given above. Modified: stable/7/usr.sbin/arp/arp.c ============================================================================== --- stable/7/usr.sbin/arp/arp.c Thu Apr 2 21:58:34 2009 (r190659) +++ stable/7/usr.sbin/arp/arp.c Thu Apr 2 22:04:44 2009 (r190660) @@ -330,8 +330,14 @@ set(int argc, char **argv) argc--; argv++; } } else if (strncmp(argv[0], "blackhole", 9) == 0) { + if (flags & RTF_REJECT) { + printf("Choose one of blackhole or reject, not both.\n"); + } flags |= RTF_BLACKHOLE; } else if (strncmp(argv[0], "reject", 6) == 0) { + if (flags & RTF_BLACKHOLE) { + printf("Choose one of blackhole or reject, not both.\n"); + } flags |= RTF_REJECT; } else if (strncmp(argv[0], "trail", 5) == 0) { /* XXX deprecated and undocumented feature */ @@ -630,8 +636,8 @@ usage(void) " arp [-n] [-i interface] -a", " arp -d hostname [pub]", " arp -d [-i interface] -a", - " arp -s hostname ether_addr [temp] [reject] [blackhole] [pub [only]]", - " arp -S hostname ether_addr [temp] [reject] [blackhole] [pub [only]]", + " arp -s hostname ether_addr [temp] [reject | blackhole] [pub [only]]", + " arp -S hostname ether_addr [temp] [reject | blackhole] [pub [only]]", " arp -f filename"); exit(1); } From owner-svn-src-stable-7@FreeBSD.ORG Fri Apr 3 00:12:15 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 055C5106564A; Fri, 3 Apr 2009 00:12:15 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E715C8FC12; Fri, 3 Apr 2009 00:12:14 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n330CEqO083996; Fri, 3 Apr 2009 00:12:14 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n330CEqP083995; Fri, 3 Apr 2009 00:12:14 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200904030012.n330CEqP083995@svn.freebsd.org> From: Pyun YongHyeon Date: Fri, 3 Apr 2009 00:12:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190663 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb dev/re X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Apr 2009 00:12:15 -0000 Author: yongari Date: Fri Apr 3 00:12:14 2009 New Revision: 190663 URL: http://svn.freebsd.org/changeset/base/190663 Log: MFC r190587: It seems that RTL8168D and RTL8102EL requires additional settle time to complete RL_PHYAR register write. Accessing RL_PHYAR register right after the write causes errors for subsequent PHY register accesses. Tested by: george at luckytele dot com, Steve Wills < STEVE at stevenwills dot com > Approved by: re (Kostik Belousov) Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/dev/re/if_re.c Modified: stable/7/sys/dev/re/if_re.c ============================================================================== --- stable/7/sys/dev/re/if_re.c Fri Apr 3 00:10:19 2009 (r190662) +++ stable/7/sys/dev/re/if_re.c Fri Apr 3 00:12:14 2009 (r190663) @@ -420,6 +420,7 @@ re_gmii_readreg(device_t dev, int phy, i } CSR_WRITE_4(sc, RL_PHYAR, reg << 16); + DELAY(1000); for (i = 0; i < RL_PHY_TIMEOUT; i++) { rval = CSR_READ_4(sc, RL_PHYAR); @@ -447,6 +448,7 @@ re_gmii_writereg(device_t dev, int phy, CSR_WRITE_4(sc, RL_PHYAR, (reg << 16) | (data & RL_PHYAR_PHYDATA) | RL_PHYAR_BUSY); + DELAY(1000); for (i = 0; i < RL_PHY_TIMEOUT; i++) { rval = CSR_READ_4(sc, RL_PHYAR); From owner-svn-src-stable-7@FreeBSD.ORG Fri Apr 3 03:04:26 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6099D106566B; Fri, 3 Apr 2009 03:04:26 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4EACB8FC12; Fri, 3 Apr 2009 03:04:26 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3334QNq096479; Fri, 3 Apr 2009 03:04:26 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3334QT1096478; Fri, 3 Apr 2009 03:04:26 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <200904030304.n3334QT1096478@svn.freebsd.org> From: Warner Losh Date: Fri, 3 Apr 2009 03:04:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190665 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb dev/ed X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Apr 2009 03:04:27 -0000 Author: imp Date: Fri Apr 3 03:04:26 2009 New Revision: 190665 URL: http://svn.freebsd.org/changeset/base/190665 Log: Merge 190488 from head: Fix shared memory packet movement. Approved by: re@ (kostik) Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/dev/ed/if_ed.c Modified: stable/7/sys/dev/ed/if_ed.c ============================================================================== --- stable/7/sys/dev/ed/if_ed.c Fri Apr 3 02:28:11 2009 (r190664) +++ stable/7/sys/dev/ed/if_ed.c Fri Apr 3 03:04:26 2009 (r190665) @@ -1307,7 +1307,7 @@ ed_shmem_readmem16(struct ed_softc *sc, uint16_t amount) { bus_space_read_region_2(sc->mem_bst, sc->mem_bsh, src, (uint16_t *)dst, - amount + 1 / 2); + (amount + 1) / 2); } /* From owner-svn-src-stable-7@FreeBSD.ORG Fri Apr 3 03:25:01 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 46D0410656D9; Fri, 3 Apr 2009 03:25:01 +0000 (UTC) (envelope-from weongyo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 26CD08FC08; Fri, 3 Apr 2009 03:25:01 +0000 (UTC) (envelope-from weongyo@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n333P1gS097993; Fri, 3 Apr 2009 03:25:01 GMT (envelope-from weongyo@svn.freebsd.org) Received: (from weongyo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n333P12f097991; Fri, 3 Apr 2009 03:25:01 GMT (envelope-from weongyo@svn.freebsd.org) Message-Id: <200904030325.n333P12f097991@svn.freebsd.org> From: Weongyo Jeong Date: Fri, 3 Apr 2009 03:25:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190666 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb dev/malo X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Apr 2009 03:25:02 -0000 Author: weongyo Date: Fri Apr 3 03:25:00 2009 New Revision: 190666 URL: http://svn.freebsd.org/changeset/base/190666 Log: MFC r190541: fix a bug of uses after free. Pointed by: dchagin MFC r190544: handles more exceptional cases when the driver failed to attach. MFC r190550: corrects a error message. MFC r190590: fix a bug that it passed a incorrect flag BUS_DMA_ALLOCNOW to create a device specific DMA tag. On amd64 it could exhaust all of bounce pages when bus_dma_tag_create(9) is called at malo_pci_attach() then as result in next turn it returns ENOMEM. This fix a attach fail on amd64. Pointed by: yongari Tested by: dchagin Approved by: re (kib) Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/dev/malo/if_malo_pci.c stable/7/sys/dev/malo/if_malohal.c Modified: stable/7/sys/dev/malo/if_malo_pci.c ============================================================================== --- stable/7/sys/dev/malo/if_malo_pci.c Fri Apr 3 03:04:26 2009 (r190665) +++ stable/7/sys/dev/malo/if_malo_pci.c Fri Apr 3 03:25:00 2009 (r190666) @@ -245,7 +245,7 @@ malo_pci_attach(device_t dev) BUS_SPACE_MAXADDR, /* maxsize */ 0, /* nsegments */ BUS_SPACE_MAXADDR, /* maxsegsize */ - BUS_DMA_ALLOCNOW, /* flags */ + 0, /* flags */ NULL, /* lockfunc */ NULL, /* lockarg */ &sc->malo_dmat)) { @@ -260,12 +260,13 @@ malo_pci_attach(device_t dev) error = malo_attach(pci_get_device(dev), sc); - if (error != 0) { - malo_pci_detach(dev); - return (error); - } + if (error != 0) + goto bad2; return (error); + +bad2: + bus_dma_tag_destroy(sc->malo_dmat); bad1: if (psc->malo_msi == 0) bus_teardown_intr(dev, psc->malo_res_irq[0], @@ -275,10 +276,11 @@ bad1: bus_teardown_intr(dev, psc->malo_res_irq[i], psc->malo_intrhand[i]); } - + bus_release_resources(dev, psc->malo_irq_spec, psc->malo_res_irq); bad: if (psc->malo_msi != 0) pci_release_msi(dev); + bus_release_resources(dev, psc->malo_mem_spec, psc->malo_res_mem); return (error); } Modified: stable/7/sys/dev/malo/if_malohal.c ============================================================================== --- stable/7/sys/dev/malo/if_malohal.c Fri Apr 3 03:04:26 2009 (r190665) +++ stable/7/sys/dev/malo/if_malohal.c Fri Apr 3 03:25:00 2009 (r190666) @@ -128,7 +128,7 @@ malo_hal_attach(device_t dev, uint16_t d NULL, /* lockarg */ &mh->mh_dmat); if (error != 0) { - device_printf(dev, "unable to allocate memory for cmd buffer, " + device_printf(dev, "unable to allocate memory for cmd tag, " "error %u\n", error); goto fail; } @@ -163,8 +163,6 @@ malo_hal_attach(device_t dev, uint16_t d return (mh); fail: - free(mh, M_DEVBUF); - if (mh->mh_dmamap != NULL) { bus_dmamap_unload(mh->mh_dmat, mh->mh_dmamap); if (mh->mh_cmdbuf != NULL) @@ -174,6 +172,7 @@ fail: } if (mh->mh_dmat) bus_dma_tag_destroy(mh->mh_dmat); + free(mh, M_DEVBUF); return (NULL); } From owner-svn-src-stable-7@FreeBSD.ORG Fri Apr 3 10:38:25 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 24AE2106566B; Fri, 3 Apr 2009 10:38:25 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EB31C8FC17; Fri, 3 Apr 2009 10:38:24 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n33AcONg016516; Fri, 3 Apr 2009 10:38:24 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n33AcOZp016515; Fri, 3 Apr 2009 10:38:24 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200904031038.n33AcOZp016515@svn.freebsd.org> From: Alexander Motin Date: Fri, 3 Apr 2009 10:38:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190669 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb kern X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Apr 2009 10:38:26 -0000 Author: mav Date: Fri Apr 3 10:38:24 2009 New Revision: 190669 URL: http://svn.freebsd.org/changeset/base/190669 Log: MFC rev. 188464. Check for device_set_devclass() errors and skip driver probe/attach if any. Attach called without devclass set crashes the system. On attach/resume some ATA drivers sometimes trying to create duplicate adX device. It is surely their own problem, but it is not a reason to crash here. Approved by: re (kib) Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/kern/subr_bus.c Modified: stable/7/sys/kern/subr_bus.c ============================================================================== --- stable/7/sys/kern/subr_bus.c Fri Apr 3 10:15:00 2009 (r190668) +++ stable/7/sys/kern/subr_bus.c Fri Apr 3 10:38:24 2009 (r190669) @@ -1735,8 +1735,13 @@ device_probe_child(device_t dev, device_ dl = next_matching_driver(dc, child, dl)) { PDEBUG(("Trying %s", DRIVERNAME(dl->driver))); device_set_driver(child, dl->driver); - if (!hasclass) - device_set_devclass(child, dl->driver->name); + if (!hasclass) { + if (device_set_devclass(child, dl->driver->name)) { + PDEBUG(("Unable to set device class")); + device_set_driver(child, NULL); + continue; + } + } /* Fetch any flags for the device before probing. */ resource_int_value(dl->driver->name, child->unit, @@ -1814,8 +1819,11 @@ device_probe_child(device_t dev, device_ return (result); /* Set the winning driver, devclass, and flags. */ - if (!child->devclass) - device_set_devclass(child, best->driver->name); + if (!child->devclass) { + result = device_set_devclass(child, best->driver->name); + if (result != 0) + return (result); + } device_set_driver(child, best->driver); resource_int_value(best->driver->name, child->unit, "flags", &child->devflags); From owner-svn-src-stable-7@FreeBSD.ORG Fri Apr 3 16:02:14 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 19529106577B; Fri, 3 Apr 2009 16:02:14 +0000 (UTC) (envelope-from lulf@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 04DC68FC16; Fri, 3 Apr 2009 16:02:14 +0000 (UTC) (envelope-from lulf@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n33G2Duv026616; Fri, 3 Apr 2009 16:02:13 GMT (envelope-from lulf@svn.freebsd.org) Received: (from lulf@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n33G2DrQ026612; Fri, 3 Apr 2009 16:02:13 GMT (envelope-from lulf@svn.freebsd.org) Message-Id: <200904031602.n33G2DrQ026612@svn.freebsd.org> From: Ulf Lilleengen Date: Fri, 3 Apr 2009 16:02:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190671 - stable/7/contrib/csup X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Apr 2009 16:02:15 -0000 Author: lulf Date: Fri Apr 3 16:02:13 2009 New Revision: 190671 URL: http://svn.freebsd.org/changeset/base/190671 Log: MFC r190422: - Add proper error checking and printing to the CVSMode code when reading and writing from/to streams, as leaving them out stops csup from cleaning up on SIGINT and friends properly. Approved by: re (kib) Modified: stable/7/contrib/csup/ (props changed) stable/7/contrib/csup/rcsfile.c stable/7/contrib/csup/rcsfile.h stable/7/contrib/csup/rcsparse.c stable/7/contrib/csup/updater.c Modified: stable/7/contrib/csup/rcsfile.c ============================================================================== --- stable/7/contrib/csup/rcsfile.c Fri Apr 3 13:35:54 2009 (r190670) +++ stable/7/contrib/csup/rcsfile.c Fri Apr 3 16:02:13 2009 (r190671) @@ -140,7 +140,7 @@ static void rcsfile_insertsorteddelta( struct delta *); static struct stream *rcsfile_getdeltatext(struct rcsfile *, struct delta *, struct buf **); -static void rcsdelta_writestring(char *, size_t, struct stream *); +static int rcsdelta_writestring(char *, size_t, struct stream *); static void rcsdelta_insertbranch(struct delta *, struct branch *); /* Space formatting of RCS file. */ @@ -308,14 +308,19 @@ rcsfile_write(struct rcsfile *rf, struct /* First write head. */ d = LIST_FIRST(&rf->trunk->deltalist); - stream_printf(dest, "head%s%s;\n", head_space, d->revnum); + if (stream_printf(dest, "head%s%s;\n", head_space, d->revnum) < 0) + return (-1); /* Write branch, if we have. */ - if (rf->branch != NULL) - stream_printf(dest, "branch%s%s;\n", branch_space, rf->branch); + if (rf->branch != NULL) { + if (stream_printf(dest, "branch%s%s;\n", branch_space, + rf->branch) < 0) + return (-1); + } /* Write access. */ - stream_printf(dest, "access"); + if (stream_printf(dest, "access") < 0) + return (-1); #if 0 if (!STAILQ_EMPTY(&rf->accesslist)) { /* @@ -324,32 +329,44 @@ rcsfile_write(struct rcsfile *rf, struct */ } #endif - stream_printf(dest, ";\n"); + if (stream_printf(dest, ";\n") < 0) + return (-1); /* Write out taglist. */ - stream_printf(dest, "symbols"); + if (stream_printf(dest, "symbols") < 0) + return (-1); if (!STAILQ_EMPTY(&rf->taglist)) { STAILQ_FOREACH(t, &rf->taglist, tag_next) { - stream_printf(dest, "\n%s%s:%s", tag_space, t->tag, - t->revnum); + if (stream_printf(dest, "\n%s%s:%s", tag_space, t->tag, + t->revnum) < 0) + return (-1); } } - stream_printf(dest, ";\n"); /* Write out locks and strict. */ - stream_printf(dest, "locks;"); - if (rf->strictlock) - stream_printf(dest, " strict;"); - stream_printf(dest, "\n"); + if (stream_printf(dest, ";\nlocks;") < 0) + return (-1); + if (rf->strictlock) { + if (stream_printf(dest, " strict;") < 0) + return (-1); + } + if (stream_printf(dest, "\n") < 0) + return (-1); /* Write out the comment. */ - if (rf->comment != NULL) - stream_printf(dest, "comment%s%s;\n", comment_space, rf->comment); - if (rf->expand != EXPAND_DEFAULT) - stream_printf(dest, "expand%s@%s@;\n", expand_space, - keyword_encode_expand(rf->expand)); + if (rf->comment != NULL) { + if (stream_printf(dest, "comment%s%s;\n", comment_space, + rf->comment) < 0) + return (-1); + } + if (rf->expand != EXPAND_DEFAULT) { + if (stream_printf(dest, "expand%s@%s@;\n", expand_space, + keyword_encode_expand(rf->expand)) < 0) + return (-1); + } - stream_printf(dest, "\n\n"); + if (stream_printf(dest, "\n\n") < 0) + return (-1); /* * Write out deltas. We use a stack where we push the appropriate deltas @@ -364,14 +381,18 @@ rcsfile_write(struct rcsfile *rf, struct /* Do not write out placeholders just to be safe. */ if (d->placeholder) continue; - stream_printf(dest, "%s\n", d->revnum); - stream_printf(dest, "date%s%s;%sauthor %s;%sstate", + if (stream_printf(dest, "%s\n", d->revnum) < 0) + return (-1); + if (stream_printf(dest, "date%s%s;%sauthor %s;%sstate", date_space, d->revdate, auth_space, d->author, - state_space); - if (d->state != NULL) - stream_printf(dest, " %s", d->state); - stream_printf(dest, ";\n"); - stream_printf(dest, "branches"); + state_space) < 0) + return (-1); + if (d->state != NULL) { + if (stream_printf(dest, " %s", d->state) < 0) + return (-1); + } + if (stream_printf(dest, ";\nbranches") < 0) + return (-1); /* * Write out our branches. Add them to a reversed list for use * later when we write out the text. @@ -385,30 +406,36 @@ rcsfile_write(struct rcsfile *rf, struct /* Push branch heads on stack. */ STAILQ_FOREACH(d_tmp, &deltalist_inverted, delta_prev) { - if (d_tmp == NULL) - err(1, "empty branch!"); - stream_printf(dest, "\n%s%s", branches_space, - d_tmp->revnum); + if (d_tmp == NULL) { + lprintf(2, "Empty branch!\n"); + return (-1); + } + if (stream_printf(dest, "\n%s%s", branches_space, + d_tmp->revnum) < 0) + return (-1); } - stream_printf(dest, ";\n"); - stream_printf(dest, "next%s", next_space); + if (stream_printf(dest, ";\nnext%s", next_space) < 0) + return (-1); /* Push next delta on stack. */ d_next = LIST_NEXT(d, delta_next); if (d_next != NULL) { - stream_printf(dest, "%s", d_next->revnum); + if (stream_printf(dest, "%s", d_next->revnum) < 0) + return (-1); STAILQ_INSERT_HEAD(&deltastack, d_next, stack_next); } - stream_printf(dest, ";\n\n"); + if (stream_printf(dest, ";\n\n") < 0) + return (-1); } - stream_printf(dest, "\n"); /* Write out desc. */ - stream_printf(dest, "desc\n@@"); + if (stream_printf(dest, "\ndesc\n@@") < 0) + return (-1); d = LIST_FIRST(&rf->trunk->deltalist); /* Write out deltatexts. */ error = rcsfile_write_deltatext(rf, dest); - stream_printf(dest, "\n"); + if (stream_printf(dest, "\n") < 0) + return (-1); return (error); } @@ -438,21 +465,25 @@ rcsfile_write_deltatext(struct rcsfile * /* Do not write out placeholders just to be safe. */ if (d->placeholder) return (0); - stream_printf(dest, "\n\n\n%s\n", d->revnum); - stream_printf(dest, "log\n@"); + if (stream_printf(dest, "\n\n\n%s\n", d->revnum) < 0) + return (-1); + if (stream_printf(dest, "log\n@") < 0) + return (-1); in = stream_open_buf(d->log); line = stream_getln(in, &size); while (line != NULL) { - stream_write(dest, line, size); + if (stream_write(dest, line, size) == -1) + return (-1); line = stream_getln(in, &size); } stream_close(in); - stream_printf(dest, "@\n"); - stream_printf(dest, "text\n@"); + if (stream_printf(dest, "@\ntext\n@") < 0) + return (-1); error = rcsfile_puttext(rf, dest, d, d->prev); if (error) return (error); - stream_printf(dest, "@"); + if (stream_printf(dest, "@") < 0) + return (-1); LIST_INIT(&branchlist_datesorted); d_next = LIST_NEXT(d, delta_next); @@ -535,7 +566,10 @@ rcsfile_puttext(struct rcsfile *rf, stru in = stream_open_buf(d->text); line = stream_getln(in, &size); while (line != NULL) { - stream_write(dest, line, size); + if (stream_write(dest, line, size) == -1) { + error = -1; + goto cleanup; + } line = stream_getln(in, &size); } stream_close(in); @@ -549,7 +583,10 @@ rcsfile_puttext(struct rcsfile *rf, stru } line = stream_getln(orig, &size); while (line != NULL) { - stream_write(dest, line, size); + if (stream_write(dest, line, size) == -1) { + error = -1; + goto cleanup; + } line = stream_getln(orig, &size); } stream_close(orig); @@ -1261,6 +1298,7 @@ int rcsdelta_addlog(struct delta *d, char *log, int len) { struct stream *dest; + int nbytes; assert(d != NULL); /* Strip away '@' at beginning and end. */ @@ -1268,9 +1306,9 @@ rcsdelta_addlog(struct delta *d, char *l len--; log[len - 1] = '\0'; dest = stream_open_buf(d->log); - stream_write(dest, log, len - 1); + nbytes = stream_write(dest, log, len - 1); stream_close(dest); - return (0); + return ((nbytes == -1) ? -1 : 0); } /* Add deltatext to a delta. Assume the delta already exists. */ @@ -1278,6 +1316,7 @@ int rcsdelta_addtext(struct delta *d, char *text, int len) { struct stream *dest; + int nbytes; assert(d != NULL); /* Strip away '@' at beginning and end. */ @@ -1286,36 +1325,40 @@ rcsdelta_addtext(struct delta *d, char * text[len - 1] = '\0'; dest = stream_open_buf(d->text); - stream_write(dest, text, len - 1); + nbytes = stream_write(dest, text, len - 1); stream_close(dest); - return (0); + return ((nbytes == -1) ? -1 : 0); } /* Add a deltatext logline to a delta. */ -void +int rcsdelta_appendlog(struct delta *d, char *logline, size_t size) { struct stream *dest; + int error; assert(d != NULL); dest = stream_open_buf(d->log); - rcsdelta_writestring(logline, size, dest); + error = rcsdelta_writestring(logline, size, dest); stream_close(dest); + return (error); } /* Add a deltatext textline to a delta. */ -void +int rcsdelta_appendtext(struct delta *d, char *textline, size_t size) { struct stream *dest; + int error; assert(d != NULL); dest = stream_open_buf(d->text); - rcsdelta_writestring(textline, size, dest); + error = rcsdelta_writestring(textline, size, dest); stream_close(dest); + return (error); } -static void +static int rcsdelta_writestring(char *textline, size_t size, struct stream *dest) { char buf[3]; @@ -1332,8 +1375,10 @@ rcsdelta_writestring(char *textline, siz buf[2] = '\0'; count = 2; } - stream_write(dest, buf, count); + if (stream_write(dest, buf, count) == -1) + return (-1); } + return (0); } /* Set delta state. */ Modified: stable/7/contrib/csup/rcsfile.h ============================================================================== --- stable/7/contrib/csup/rcsfile.h Fri Apr 3 13:35:54 2009 (r190670) +++ stable/7/contrib/csup/rcsfile.h Fri Apr 3 16:02:13 2009 (r190671) @@ -65,8 +65,8 @@ void rcsfile_importdelta(struct rcsfil int rcsdelta_addlog(struct delta *, char *, int); int rcsdelta_addtext(struct delta *, char *, int); -void rcsdelta_appendlog(struct delta *, char *, size_t); -void rcsdelta_appendtext(struct delta *, char *, size_t); +int rcsdelta_appendlog(struct delta *, char *, size_t); +int rcsdelta_appendtext(struct delta *, char *, size_t); void rcsdelta_setstate(struct delta *, char *); void rcsdelta_truncatetext(struct delta *, off_t); void rcsdelta_truncatelog(struct delta *, off_t); Modified: stable/7/contrib/csup/rcsparse.c ============================================================================== --- stable/7/contrib/csup/rcsparse.c Fri Apr 3 13:35:54 2009 (r190670) +++ stable/7/contrib/csup/rcsparse.c Fri Apr 3 16:02:13 2009 (r190671) @@ -309,7 +309,7 @@ parse_deltatexts(struct rcsfile *rf, yys error = 0; /* In case we don't have deltatexts. */ if (token != NUM) - return (token); + return (-1); do { /* num */ assert(token == NUM); Modified: stable/7/contrib/csup/updater.c ============================================================================== --- stable/7/contrib/csup/updater.c Fri Apr 3 13:35:54 2009 (r190670) +++ stable/7/contrib/csup/updater.c Fri Apr 3 16:02:13 2009 (r190671) @@ -1385,8 +1385,11 @@ updater_addfile(struct updater *up, stru do { nread = stream_read(up->rd, buf, (BUFSIZE > remains ? remains : BUFSIZE)); + if (nread == -1) + return (UPDATER_ERR_PROTO); remains -= nread; - stream_write(to, buf, nread); + if (stream_write(to, buf, nread) == -1) + goto bad; } while (remains > 0); stream_close(to); line = stream_getln(up->rd, NULL); @@ -1411,9 +1414,11 @@ updater_addfile(struct updater *up, stru FA_MODTIME | FA_MASK); error = updater_updatefile(up, fup, md5, isfixup); fup->wantmd5 = NULL; /* So that it doesn't get freed. */ - if (error) - return (error); - return (0); + return (error); +bad: + xasprintf(&up->errmsg, "%s: Cannot write: %s", fup->temppath, + strerror(errno)); + return (UPDATER_ERR_MSG); } static int @@ -1469,7 +1474,9 @@ updater_checkout(struct updater *up, str if (nbytes == -1) goto bad; } - stream_write(to, line, size); + nbytes = stream_write(to, line, size); + if (nbytes == -1) + goto bad; line = stream_getln(up->rd, &size); first = 0; } @@ -1682,8 +1689,11 @@ updater_rcsedit(struct updater *up, stru error = rcsfile_write(rf, dest); stream_close(dest); rcsfile_free(rf); - if (error) - lprintf(-1, "Error writing %s\n", name); + if (error) { + xasprintf(&up->errmsg, "%s: Cannot write: %s", fup->temppath, + strerror(errno)); + return (UPDATER_ERR_MSG); + } finish: sr->sr_clientattr = fattr_frompath(path, FATTR_NOFOLLOW); @@ -1768,7 +1778,9 @@ updater_addelta(struct rcsfile *rf, stru size--; logline++; } - rcsdelta_appendlog(d, logline, size); + if (rcsdelta_appendlog(d, logline, size) + < 0) + return (-1); logline = stream_getln(rd, &size); } break; @@ -1799,7 +1811,9 @@ updater_addelta(struct rcsfile *rf, stru size--; textline++; } - rcsdelta_appendtext(d, textline, size); + if (rcsdelta_appendtext(d, textline, + size) < 0) + return (-1); textline = stream_getln(rd, &size); } break; @@ -1839,8 +1853,15 @@ updater_append_file(struct updater *up, stream_filter_start(to, STREAM_FILTER_MD5, md5); /* First write the existing content. */ - while ((nread = read(fd, buf, BUFSIZE)) > 0) - stream_write(to, buf, nread); + while ((nread = read(fd, buf, BUFSIZE)) > 0) { + if (stream_write(to, buf, nread) == -1) + goto bad; + } + if (nread == -1) { + xasprintf(&up->errmsg, "%s: Error reading: %s", + strerror(errno)); + return (UPDATER_ERR_MSG); + } close(fd); bytes = fattr_filesize(fa) - pos; @@ -1848,8 +1869,11 @@ updater_append_file(struct updater *up, do { nread = stream_read(up->rd, buf, (BUFSIZE > bytes) ? bytes : BUFSIZE); + if (nread == -1) + return (UPDATER_ERR_PROTO); bytes -= nread; - stream_write(to, buf, nread); + if (stream_write(to, buf, nread) == -1) + goto bad; } while (bytes > 0); stream_close(to); @@ -1875,9 +1899,11 @@ updater_append_file(struct updater *up, FA_MODTIME | FA_MASK); error = updater_updatefile(up, fup, md5, 0); fup->wantmd5 = NULL; /* So that it doesn't get freed. */ - if (error) - return (error); - return (0); + return (error); +bad: + xasprintf(&up->errmsg, "%s: Cannot write: %s", fup->temppath, + strerror(errno)); + return (UPDATER_ERR_MSG); } /*