From owner-svn-src-stable-9@freebsd.org Sun Nov 8 00:50:47 2015 Return-Path: Delivered-To: svn-src-stable-9@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EB932A22507; Sun, 8 Nov 2015 00:50:47 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 92CE21D50; Sun, 8 Nov 2015 00:50:47 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tA80oki4048481; Sun, 8 Nov 2015 00:50:46 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tA80ok3p048479; Sun, 8 Nov 2015 00:50:46 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201511080050.tA80ok3p048479@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sun, 8 Nov 2015 00:50:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r290527 - in stable/9: sbin/camcontrol share/misc X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Nov 2015 00:50:48 -0000 Author: ngie Date: Sun Nov 8 00:50:46 2015 New Revision: 290527 URL: https://svnweb.freebsd.org/changeset/base/290527 Log: MFstable/10 r290385: MFC r289913,r289916: r289913: Use 't' (bits) not 'i' (bytes) for describing MRIE (aka "Method of Reporting Informational Exceptions") in the SCSI mode database as the field described in X3T10/94-190 (revision 4; page 2, table 1) [1.] is 4 bits wide, not 4 bytes wide 1. http://ftp.t10.org/ftp/t10/document.94/94-190r4.pdf Bug 200619 Reported by: Michael Baptist Submitted by: Lars Skodje Sponsored by: EMC / Isilon Storage Division r289916: Limit RESOLUTION_MAX to INT_MAX, not UINT_MAX (all spelled out) so the mode value isn't always clipped to -1 when (resolution * size) == 32, which would have been the case with values => {4i,32b,32t}. This seems to have been broken in r64382. PR: 200619 Reported by: Michael Baptist Submitted by: Lars Skodje Sponsored by: EMC / Isilon Storage Division Modified: stable/9/sbin/camcontrol/modeedit.c stable/9/share/misc/scsi_modes Directory Properties: stable/9/ (props changed) stable/9/sbin/ (props changed) stable/9/sbin/camcontrol/ (props changed) stable/9/share/ (props changed) stable/9/share/misc/ (props changed) Modified: stable/9/sbin/camcontrol/modeedit.c ============================================================================== --- stable/9/sbin/camcontrol/modeedit.c Sun Nov 8 00:50:18 2015 (r290526) +++ stable/9/sbin/camcontrol/modeedit.c Sun Nov 8 00:50:46 2015 (r290527) @@ -246,7 +246,7 @@ editentry_set(char *name, char *newvalue * currently workaround it (even for int64's), so we have to kludge it. */ #define RESOLUTION_MAX(size) ((resolution * (size) == 32)? \ - (int)0xffffffff: (1 << (resolution * (size))) - 1) + INT_MAX: (1 << (resolution * (size))) - 1) assert(newvalue != NULL); if (*newvalue == '\0') Modified: stable/9/share/misc/scsi_modes ============================================================================== --- stable/9/share/misc/scsi_modes Sun Nov 8 00:50:18 2015 (r290526) +++ stable/9/share/misc/scsi_modes Sun Nov 8 00:50:46 2015 (r290527) @@ -106,7 +106,7 @@ {EBACKERR} t1 {LogErr} t1 {Reserved} *t4 - {MRIE} b4 + {MRIE} t4 {Interval Timer} i4 {Report Count} i4 } From owner-svn-src-stable-9@freebsd.org Mon Nov 9 07:10:33 2015 Return-Path: Delivered-To: svn-src-stable-9@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 948A2A2A4D5; Mon, 9 Nov 2015 07:10:33 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 61CE51AFB; Mon, 9 Nov 2015 07:10:33 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tA97AW36075465; Mon, 9 Nov 2015 07:10:32 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tA97AWbC075464; Mon, 9 Nov 2015 07:10:32 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201511090710.tA97AWbC075464@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Mon, 9 Nov 2015 07:10:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r290577 - stable/9/usr.sbin/rtsold X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Nov 2015 07:10:33 -0000 Author: ngie Date: Mon Nov 9 07:10:32 2015 New Revision: 290577 URL: https://svnweb.freebsd.org/changeset/base/290577 Log: MFstable/10 r290576: MFC r290182: Fix rtsold's usage message - Remove -a from the usage message example dealing with specific interfaces. -a only makes sense when not specifying an interface, such that it's to be run on all interfaces - Fix the pidfile option (it's -p, not -P) - Change `interfaces` to `interface` to match the manpage PR: 173744 Sponsored by: EMC / Isilon Storage Division Modified: stable/9/usr.sbin/rtsold/rtsold.c Directory Properties: stable/9/ (props changed) stable/9/usr.sbin/ (props changed) stable/9/usr.sbin/rtsold/ (props changed) Modified: stable/9/usr.sbin/rtsold/rtsold.c ============================================================================== --- stable/9/usr.sbin/rtsold/rtsold.c Mon Nov 9 07:07:25 2015 (r290576) +++ stable/9/usr.sbin/rtsold/rtsold.c Mon Nov 9 07:10:32 2015 (r290577) @@ -839,15 +839,15 @@ static void usage(void) { #ifndef SMALL - fprintf(stderr, "usage: rtsold [-adDfFm1] [-O script-name] " - "[-P pidfile] [-R script-name] interfaces...\n"); fprintf(stderr, "usage: rtsold [-dDfFm1] [-O script-name] " - "[-P pidfile] [-R script-name] -a\n"); + "[-p pidfile] [-R script-name] interface ...\n"); + fprintf(stderr, "usage: rtsold [-dDfFm1] [-O script-name] " + "[-p pidfile] [-R script-name] -a\n"); #else fprintf(stderr, "usage: rtsol [-dDF] [-O script-name] " - "[-P pidfile] [-R script-name] interfaces...\n"); + "[-p pidfile] [-R script-name] interface ...\n"); fprintf(stderr, "usage: rtsol [-dDF] [-O script-name] " - "[-P pidfile] [-R script-name] -a\n"); + "[-p pidfile] [-R script-name] -a\n"); #endif } From owner-svn-src-stable-9@freebsd.org Mon Nov 9 07:28:18 2015 Return-Path: Delivered-To: svn-src-stable-9@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7AA7EA2A8E4; Mon, 9 Nov 2015 07:28:18 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3B71D161E; Mon, 9 Nov 2015 07:28:18 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tA97SH6j081445; Mon, 9 Nov 2015 07:28:17 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tA97SHLv081443; Mon, 9 Nov 2015 07:28:17 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201511090728.tA97SHLv081443@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Mon, 9 Nov 2015 07:28:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r290581 - stable/9/tools/regression/security/open_to_operation X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Nov 2015 07:28:18 -0000 Author: ngie Date: Mon Nov 9 07:28:17 2015 New Revision: 290581 URL: https://svnweb.freebsd.org/changeset/base/290581 Log: MFstable/10 r290580: MFC r290190,r290251: r290190: Fix compiler warnings with open_to_operation.c Other sidenotes: - Remove unused variables with main(..) - Convert errx/exit with -1 to errx/exit with 1 - Fix a bogus test in try_directory_open (expected_errno == expected_errno -> errno == expected_errno) [*] - Fix some warnings related to discarded qualifiers - Remove a bogus else-statement at the end of check_mmap_exec(..) in the successful case. mmap(2), POSIX, Linux, etc all don't state what the behavior is when mixing O_WRONLY + PROT_EXEC, so assume success for now to get the test program to pass again. PR: 201286 [*] Submitted by: David Binderman Sponsored by: EMC / Isilon Storage Division r290251: Use nitems(x) instead of sizeof(x)/sizeof(x[0]) Sponsored by: EMC / Isilon Storage Division Modified: stable/9/tools/regression/security/open_to_operation/Makefile stable/9/tools/regression/security/open_to_operation/open_to_operation.c Directory Properties: stable/9/ (props changed) stable/9/tools/ (props changed) stable/9/tools/regression/ (props changed) Modified: stable/9/tools/regression/security/open_to_operation/Makefile ============================================================================== --- stable/9/tools/regression/security/open_to_operation/Makefile Mon Nov 9 07:26:34 2015 (r290580) +++ stable/9/tools/regression/security/open_to_operation/Makefile Mon Nov 9 07:28:17 2015 (r290581) @@ -2,6 +2,6 @@ PROG= open_to_operation NO_MAN= -#WARNS= 3 +WARNS?= 3 .include Modified: stable/9/tools/regression/security/open_to_operation/open_to_operation.c ============================================================================== --- stable/9/tools/regression/security/open_to_operation/open_to_operation.c Mon Nov 9 07:26:34 2015 (r290580) +++ stable/9/tools/regression/security/open_to_operation/open_to_operation.c Mon Nov 9 07:28:17 2015 (r290581) @@ -119,10 +119,10 @@ __FBSDID("$FreeBSD$"); */ static const int file_modes[] = { O_RDONLY, O_WRONLY, O_RDWR, O_RDONLY | O_TRUNC, O_WRONLY | O_TRUNC, O_RDWR | O_TRUNC }; -static const int file_modes_count = sizeof(file_modes) / sizeof(int); +static const int file_modes_count = nitems(file_modes); static const int dir_modes[] = { O_RDONLY }; -static const int dir_modes_count = sizeof(dir_modes) / sizeof(int); +static const int dir_modes_count = nitems(dir_modes); static int testnum; static int aio_present; @@ -169,9 +169,9 @@ try_directory_open(const char *testname, ok_mode(testname, NULL, mode); close(dfd); } else { - if (expected_errno && expected_errno == expected_errno) + if (expected_errno && expected_errno == errno) ok_mode(testname, NULL, mode); - else if (expected_errno) + else if (expected_errno != 0) notok_mode(testname, "wrong errno", mode); else notok_mode(testname, "failed", mode); @@ -753,7 +753,8 @@ pwritev_wrapper(int d, const void *buf, static ssize_t aio_write_wrapper(int d, const void *buf, size_t nbytes) { - struct aiocb aiocb, *aiocb_array[1]; + struct aiocb aiocb; + struct aiocb const *aiocb_array[] = { &aiocb }; bzero(&aiocb, sizeof(aiocb)); aiocb.aio_fildes = d; @@ -839,7 +840,8 @@ preadv_wrapper(int d, void *buf, size_t static ssize_t aio_read_wrapper(int d, void *buf, size_t nbytes) { - struct aiocb aiocb, *aiocb_array[1]; + struct aiocb aiocb; + struct aiocb const *aiocb_array[] = { &aiocb }; bzero(&aiocb, sizeof(aiocb)); aiocb.aio_fildes = d; @@ -847,7 +849,6 @@ aio_read_wrapper(int d, void *buf, size_ aiocb.aio_nbytes = nbytes; if (aio_read(&aiocb) < 0) return (-1); - aiocb_array[0] = &aiocb; if (aio_suspend(aiocb_array, 1, NULL) < 0) return (-1); return (aio_return(&aiocb)); @@ -1009,12 +1010,8 @@ check_mmap_exec(const char *testname, co if (isdir) notok_mode(testname, "mmap dir succeeded", mode); - else if ((mode & O_ACCMODE) == O_RDONLY || - (mode & O_ACCMODE) == O_RDWR) - ok_mode(testname, "mmap file succeeded", - mode); else - notok_mode(testname, "mmap file succeeded", + ok_mode(testname, "mmap file succeeded", mode); (void)munmap(addr, getpagesize()); } @@ -1069,7 +1066,7 @@ check_mmap_write_private(const char *tes } int -main(int argc, char *argv[]) +main(void) { char dir_path[PATH_MAX], file_path[PATH_MAX]; int dummy, fd; @@ -1084,25 +1081,25 @@ main(int argc, char *argv[]) strlcpy(dir_path, "/tmp/open-dir.XXXXXXXXXXX", sizeof(dir_path)); if (mkdtemp(dir_path) == NULL) - err(-1, "mkdtemp"); + err(1, "mkdtemp"); if (chmod(dir_path, PERM_DIR) < 0) { warn("chmod %s", dir_path); (void)rmdir(dir_path); - exit(-1); + exit(1); } strlcpy(file_path, "/tmp/open-file.XXXXXXXXXXX", sizeof(file_path)); fd = mkstemp(file_path); if (fd < 0) { warn("mkstemp"); (void)rmdir(dir_path); - exit(-1); + exit(1); } close(fd); if (chmod(file_path, PERM_FILE) < 0) { warn("chmod %s", file_path); (void)unlink(file_path); (void)rmdir(dir_path); - exit(-1); + exit(1); } check_directory_open_modes(dir_path, file_modes, file_modes_count); From owner-svn-src-stable-9@freebsd.org Mon Nov 9 07:36:56 2015 Return-Path: Delivered-To: svn-src-stable-9@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BF4F2A2ABB2; Mon, 9 Nov 2015 07:36:56 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8E8AF1DAB; Mon, 9 Nov 2015 07:36:56 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tA97atjC084298; Mon, 9 Nov 2015 07:36:55 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tA97at7T084297; Mon, 9 Nov 2015 07:36:55 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201511090736.tA97at7T084297@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Mon, 9 Nov 2015 07:36:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r290583 - stable/9/lib/libc/gen X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Nov 2015 07:36:56 -0000 Author: ngie Date: Mon Nov 9 07:36:55 2015 New Revision: 290583 URL: https://svnweb.freebsd.org/changeset/base/290583 Log: MFstable/10 r290582: MFC r290179: Remove a set but unused variable in __getgroupmembership to fix a gcc 4.9+ warning Sponsored by: EMC / Isilon Storage Division Modified: stable/9/lib/libc/gen/getgrent.c Directory Properties: stable/9/ (props changed) stable/9/lib/ (props changed) stable/9/lib/libc/ (props changed) Modified: stable/9/lib/libc/gen/getgrent.c ============================================================================== --- stable/9/lib/libc/gen/getgrent.c Mon Nov 9 07:34:30 2015 (r290582) +++ stable/9/lib/libc/gen/getgrent.c Mon Nov 9 07:36:55 2015 (r290583) @@ -659,14 +659,13 @@ __getgroupmembership(const char *uname, NS_FALLBACK_CB(getgroupmembership_fallback) { NULL, NULL, NULL } }; - int rv; assert(uname != NULL); /* groups may be NULL if just sizing when invoked with maxgrp = 0 */ assert(grpcnt != NULL); *grpcnt = 0; - rv = _nsdispatch(NULL, dtab, NSDB_GROUP, "getgroupmembership", + (void)_nsdispatch(NULL, dtab, NSDB_GROUP, "getgroupmembership", defaultsrc, uname, agroup, groups, maxgrp, grpcnt); /* too many groups found? */ From owner-svn-src-stable-9@freebsd.org Mon Nov 9 08:05:16 2015 Return-Path: Delivered-To: svn-src-stable-9@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A2850A29B47; Mon, 9 Nov 2015 08:05:16 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6F14B1072; Mon, 9 Nov 2015 08:05:16 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tA985F5N093319; Mon, 9 Nov 2015 08:05:15 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tA985FnO093318; Mon, 9 Nov 2015 08:05:15 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201511090805.tA985FnO093318@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Mon, 9 Nov 2015 08:05:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r290588 - stable/9/usr.sbin/makefs/cd9660 X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Nov 2015 08:05:16 -0000 Author: ngie Date: Mon Nov 9 08:05:15 2015 New Revision: 290588 URL: https://svnweb.freebsd.org/changeset/base/290588 Log: MFstable/10 r290587: MFC r289687,r289693: r289687: Free buffer before returning from cd9660_write_path_table to avoid leaking it after returning from the function PR: 203647 Submitted by: Thomas Schmitt Coverity CID: 978431 Sponsored by: EMC / Isilon Storage Division r289693: Unbreak makefs -t cd9660 after r289687 buffer_head needs to be freed -- not buffer Detected by jemalloc, i.e. running makefs failed the arena assert because my copy of malloc on CURRENT is compiled with the default !MALLOC_PRODUCTION asserts on Pointyhat to: ngie PR: 203647 Sponsored by: EMC / Isilon Storage Division Modified: stable/9/usr.sbin/makefs/cd9660/cd9660_write.c Directory Properties: stable/9/ (props changed) stable/9/usr.sbin/ (props changed) stable/9/usr.sbin/makefs/ (props changed) Modified: stable/9/usr.sbin/makefs/cd9660/cd9660_write.c ============================================================================== --- stable/9/usr.sbin/makefs/cd9660/cd9660_write.c Mon Nov 9 08:03:15 2015 (r290587) +++ stable/9/usr.sbin/makefs/cd9660/cd9660_write.c Mon Nov 9 08:05:15 2015 (r290588) @@ -165,7 +165,7 @@ cd9660_write_path_table(FILE *fd, off_t diskStructure.pathTableLength); unsigned char *buffer; unsigned char *buffer_head; - int len; + int len, ret; path_table_entry temp_entry; cd9660node *ptcur; @@ -213,8 +213,10 @@ cd9660_write_path_table(FILE *fd, off_t ptcur = ptcur->ptnext; } - return cd9660_write_filedata(fd, sector, buffer_head, + ret = cd9660_write_filedata(fd, sector, buffer_head, path_table_sectors); + free(buffer_head); + return ret; } From owner-svn-src-stable-9@freebsd.org Mon Nov 9 09:02:32 2015 Return-Path: Delivered-To: svn-src-stable-9@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 04EFAA26CFF; Mon, 9 Nov 2015 09:02:32 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D27761C5F; Mon, 9 Nov 2015 09:02:31 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tA992Un0010905; Mon, 9 Nov 2015 09:02:30 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tA992Ugh010901; Mon, 9 Nov 2015 09:02:30 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201511090902.tA992Ugh010901@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Mon, 9 Nov 2015 09:02:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r290590 - stable/9/usr.sbin/makefs X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Nov 2015 09:02:32 -0000 Author: ngie Date: Mon Nov 9 09:02:30 2015 New Revision: 290590 URL: https://svnweb.freebsd.org/changeset/base/290590 Log: MFstable/10 r290589: MFC r289203,r290180: r289203 (by adrian): makefs: introduce a new option to specify what to round the resulting image up to. From ticket: While trying to run FreeBSD/mips on some device having very small flash media, one is forced to compress file system with mkulzma(8) utility. It is desirable to specify small UFS block/fragment sizes like 4096/512 bytes for makefs(8) and big compression block size like 65535 bytes to mkulzma at the same time. Then one obtains very good comression ratios (like 75% and more) but faces the following problem. geom_uncompress kernel module reports GEOM provider size rounded up to its compression block size. Generally, this changes original media size and now it fails to match the size of embedded UFS file system that leads to other problems, f.e. geom_label kernel module does not like this and skips the file system while tasting the GEOM and looking for UFS label. This makes it impossible to refer to the file system using known UFS label instead of something like /dev/map/rootfs.uncompress. The following patch introduces new command line option "-r roundup" for makefs that makes it round up the image to specified block size. Hence, geom_uncompress does not change GEOM media size for images rounded that way and geom_label accepts such GEOMs just fine. With the patch applied, one can use following commands: $ makefs -t ffs -r 65536 -o bsize=4096,fsize=512,label=flash optimization=space fs.img fs $ mkulzma -s 65536 -o fs.img.ulzma fs.img PR: bin/203707 Submitted by: r290180: Follow up to roundup feature addition in r289203 - Rename -r to -R to avoid the clash with makefs -r in NetBSD - Note that -R is an FFS-specific option because it's not implemented in cd9660 today - Rename the roundup variable to "roundup-size" in the manpage and help text for consistency with other variables. - Bump .Dd (missed in r289203) PR: 203707 Differential Revision: https://reviews.freebsd.org/D3959 Reviewed by: adrian (earlier patch), emaste Sponsored by: EMC / Isilon Storage Division Modified: stable/9/usr.sbin/makefs/ffs.c stable/9/usr.sbin/makefs/makefs.8 stable/9/usr.sbin/makefs/makefs.c stable/9/usr.sbin/makefs/makefs.h Directory Properties: stable/9/ (props changed) stable/9/usr.sbin/ (props changed) stable/9/usr.sbin/makefs/ (props changed) Modified: stable/9/usr.sbin/makefs/ffs.c ============================================================================== --- stable/9/usr.sbin/makefs/ffs.c Mon Nov 9 08:59:55 2015 (r290589) +++ stable/9/usr.sbin/makefs/ffs.c Mon Nov 9 09:02:30 2015 (r290590) @@ -410,6 +410,10 @@ ffs_validate(const char *dir, fsnode *ro /* round up to the next block */ fsopts->size = roundup(fsopts->size, ffs_opts->bsize); + /* round up to requested block size, if any */ + if (fsopts->roundup > 0) + fsopts->size = roundup(fsopts->size, fsopts->roundup); + /* calculate density if necessary */ if (ffs_opts->density == -1) ffs_opts->density = fsopts->size / fsopts->inodes + 1; Modified: stable/9/usr.sbin/makefs/makefs.8 ============================================================================== --- stable/9/usr.sbin/makefs/makefs.8 Mon Nov 9 08:59:55 2015 (r290589) +++ stable/9/usr.sbin/makefs/makefs.8 Mon Nov 9 09:02:30 2015 (r290590) @@ -35,7 +35,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 16, 2013 +.Dd October 29, 2015 .Dt MAKEFS 8 .Os .Sh NAME @@ -53,6 +53,7 @@ .Op Fl m Ar maximum-size .Op Fl N Ar userdb-dir .Op Fl o Ar fs-options +.Op Fl R Ar roundup-size .Op Fl S Ar sector-size .Op Fl s Ar image-size .Op Fl t Ar fs-type @@ -195,6 +196,14 @@ Deprecated. See the .Fl Z flag. +.It Fl R Ar roundup-size +Round the image up to +.Ar roundup-size . +.Ar roundup-size +should be a multiple of the file system block size. +This option only applies to the +.Sy ffs +file system type. .It Fl S Ar sector-size Set the file system sector size to .Ar sector-size . Modified: stable/9/usr.sbin/makefs/makefs.c ============================================================================== --- stable/9/usr.sbin/makefs/makefs.c Mon Nov 9 08:59:55 2015 (r290589) +++ stable/9/usr.sbin/makefs/makefs.c Mon Nov 9 09:02:30 2015 (r290590) @@ -113,7 +113,7 @@ main(int argc, char *argv[]) start_time.tv_sec = start.tv_sec; start_time.tv_nsec = start.tv_usec * 1000; - while ((ch = getopt(argc, argv, "B:b:Dd:f:F:M:m:N:o:ps:S:t:xZ")) != -1) { + while ((ch = getopt(argc, argv, "B:b:Dd:f:F:M:m:N:o:pr:s:S:t:xZ")) != -1) { switch (ch) { case 'B': @@ -209,6 +209,12 @@ main(int argc, char *argv[]) fsoptions.sparse = 1; break; + case 'R': + /* Round image size up to specified block size */ + fsoptions.roundup = + strsuftoll("roundup-size", optarg, 0, LLONG_MAX); + break; + case 's': fsoptions.minsize = fsoptions.maxsize = strsuftoll("size", optarg, 1LL, LLONG_MAX); @@ -359,9 +365,9 @@ usage(void) prog = getprogname(); fprintf(stderr, "usage: %s [-t fs-type] [-o fs-options] [-d debug-mask] [-B endian]\n" -"\t[-S sector-size] [-M minimum-size] [-m maximum-size] [-s image-size]\n" -"\t[-b free-blocks] [-f free-files] [-F mtree-specfile] [-xZ]\n" -"\t[-N userdb-dir] image-file directory | manifest [extra-directory ...]\n", +"\t[-S sector-size] [-M minimum-size] [-m maximum-size] [-R roundup-size]\n" +"\t[-s image-size] [-b free-blocks] [-f free-files] [-F mtree-specfile]\n" +"\t[-xZ] [-N userdb-dir] image-file directory | manifest [extra-directory ...]\n", prog); exit(1); } Modified: stable/9/usr.sbin/makefs/makefs.h ============================================================================== --- stable/9/usr.sbin/makefs/makefs.h Mon Nov 9 08:59:55 2015 (r290589) +++ stable/9/usr.sbin/makefs/makefs.h Mon Nov 9 09:02:30 2015 (r290590) @@ -130,6 +130,7 @@ typedef struct { int needswap; /* non-zero if byte swapping needed */ int sectorsize; /* sector size */ int sparse; /* sparse image, don't fill it with zeros */ + off_t roundup; /* round image size up to this value */ void *fs_specific; /* File system specific additions. */ } fsinfo_t; From owner-svn-src-stable-9@freebsd.org Mon Nov 9 09:05:11 2015 Return-Path: Delivered-To: svn-src-stable-9@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 28787A26F13; Mon, 9 Nov 2015 09:05:11 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CE16D1114; Mon, 9 Nov 2015 09:05:10 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tA9959c2011220; Mon, 9 Nov 2015 09:05:09 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tA9959Xv011219; Mon, 9 Nov 2015 09:05:09 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201511090905.tA9959Xv011219@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Mon, 9 Nov 2015 09:05:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r290593 - stable/9/usr.sbin/makefs/cd9660 X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Nov 2015 09:05:11 -0000 Author: ngie Date: Mon Nov 9 09:05:09 2015 New Revision: 290593 URL: https://svnweb.freebsd.org/changeset/base/290593 Log: MFstable/10 r290591: MFC r289899: Import the fix from NetBSD kern/48852 (sic) to fix rockridge encoding of device nodes In particular, use st_rdev (the device type), not st_dev (the device inode), and fix the comparison to be correct with the st_rdev field Bug 203648 Submitted by: Thomas Schmitt Coverity CID: 1008927 Sponsored by: EMC / Isilon Storage Division Modified: stable/9/usr.sbin/makefs/cd9660/iso9660_rrip.c Directory Properties: stable/9/ (props changed) stable/9/usr.sbin/ (props changed) stable/9/usr.sbin/makefs/ (props changed) Modified: stable/9/usr.sbin/makefs/cd9660/iso9660_rrip.c ============================================================================== --- stable/9/usr.sbin/makefs/cd9660/iso9660_rrip.c Mon Nov 9 09:04:11 2015 (r290592) +++ stable/9/usr.sbin/makefs/cd9660/iso9660_rrip.c Mon Nov 9 09:05:09 2015 (r290593) @@ -1,4 +1,4 @@ -/* $NetBSD: iso9660_rrip.c,v 1.11 2012/04/29 13:32:21 joerg Exp $ */ +/* $NetBSD: iso9660_rrip.c,v 1.14 2014/05/30 13:14:47 martin Exp $ */ /* * Copyright (c) 2005 Daniel Watt, Walter Deignan, Ryan Gabrys, Alan @@ -656,13 +656,14 @@ cd9660node_rrip_pn(struct ISO_SUSP_ATTRI pn_field->attr.rr_entry.PN.h.length[0] = 20; pn_field->attr.rr_entry.PN.h.version[0] = 1; - if (sizeof (fnode->inode->st.st_dev) > 32) - cd9660_bothendian_dword((uint64_t)fnode->inode->st.st_dev >> 32, + if (sizeof (fnode->inode->st.st_rdev) > 4) + cd9660_bothendian_dword( + (uint64_t)fnode->inode->st.st_rdev >> 32, pn_field->attr.rr_entry.PN.high); else cd9660_bothendian_dword(0, pn_field->attr.rr_entry.PN.high); - cd9660_bothendian_dword(fnode->inode->st.st_dev & 0xffffffff, + cd9660_bothendian_dword(fnode->inode->st.st_rdev & 0xffffffff, pn_field->attr.rr_entry.PN.low); return 1; } From owner-svn-src-stable-9@freebsd.org Mon Nov 9 09:23:14 2015 Return-Path: Delivered-To: svn-src-stable-9@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D618FA2993A; Mon, 9 Nov 2015 09:23:14 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 84F2E1F9F; Mon, 9 Nov 2015 09:23:14 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tA99NDxs017288; Mon, 9 Nov 2015 09:23:13 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tA99NDxe017287; Mon, 9 Nov 2015 09:23:13 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201511090923.tA99NDxe017287@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Mon, 9 Nov 2015 09:23:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r290596 - stable/9/usr.sbin/makefs X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Nov 2015 09:23:14 -0000 Author: ngie Date: Mon Nov 9 09:23:13 2015 New Revision: 290596 URL: https://svnweb.freebsd.org/changeset/base/290596 Log: MFstable/10 r290595: MFC r290264: Limit isoLevel to 1 and 2 to avoid segfaulting when isoLevel is set to 3 by dereferencing a NULL function pointer Add some asserts to ensure that isolevel is always either 1 or 2. PR: 203645 Reported by: Thomas Schmitt Sponsored by: EMC / Isilon Storage Division Modified: stable/9/usr.sbin/makefs/cd9660.c Directory Properties: stable/9/ (props changed) stable/9/usr.sbin/ (props changed) stable/9/usr.sbin/makefs/ (props changed) Modified: stable/9/usr.sbin/makefs/cd9660.c ============================================================================== --- stable/9/usr.sbin/makefs/cd9660.c Mon Nov 9 09:22:11 2015 (r290595) +++ stable/9/usr.sbin/makefs/cd9660.c Mon Nov 9 09:23:13 2015 (r290596) @@ -296,8 +296,8 @@ cd9660_parse_opts(const char *option, fs int rv; /* Set up allowed options - integer options ONLY */ option_t cd9660_options[] = { - { "l", &diskStructure.isoLevel, 1, 3, "ISO Level" }, - { "isolevel", &diskStructure.isoLevel, 1, 3, "ISO Level" }, + { "l", &diskStructure.isoLevel, 1, 2, "ISO Level" }, + { "isolevel", &diskStructure.isoLevel, 1, 2, "ISO Level" }, { "verbose", &diskStructure.verbose_level, 0, 2, "Turns on verbose output" }, { "v", &diskStructure.verbose_level, 0 , 2, @@ -1055,6 +1055,7 @@ cd9660_rename_filename(cd9660node *iter, if (diskStructure.verbose_level > 0) printf("Rename_filename called\n"); + assert(1 <= diskStructure.isoLevel && diskStructure.isoLevel <= 2); /* TODO : A LOT of chanes regarding 8.3 filenames */ if (diskStructure.isoLevel == 1) maxlength = 8; @@ -1730,6 +1731,7 @@ cd9660_joliet_convert_filename(const cha static int cd9660_convert_filename(const char *oldname, char *newname, int is_file) { + assert(1 <= diskStructure.isoLevel && diskStructure.isoLevel <= 2); /* NEW */ cd9660_filename_conversion_functor conversion_function = 0; if (diskStructure.isoLevel == 1) From owner-svn-src-stable-9@freebsd.org Mon Nov 9 09:24:30 2015 Return-Path: Delivered-To: svn-src-stable-9@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3DD64A29A3C; Mon, 9 Nov 2015 09:24:30 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 071291308; Mon, 9 Nov 2015 09:24:29 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tA99OT5H017446; Mon, 9 Nov 2015 09:24:29 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tA99OTIY017445; Mon, 9 Nov 2015 09:24:29 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201511090924.tA99OTIY017445@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Mon, 9 Nov 2015 09:24:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r290598 - stable/9/usr.sbin/makefs/ffs X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Nov 2015 09:24:30 -0000 Author: ngie Date: Mon Nov 9 09:24:28 2015 New Revision: 290598 URL: https://svnweb.freebsd.org/changeset/base/290598 Log: MFstable/10 r290597: MFC r290268: Sync minor whitespace / type changes in ffs_csum_swap and ffs_sb_swap with src/sys/ufs/ffs/ffs_bswap.c@1.39 Obtained from: NetBSD Sponsored by: EMC / Isilon Storage Division Modified: stable/9/usr.sbin/makefs/ffs/ffs_bswap.c Directory Properties: stable/9/ (props changed) stable/9/usr.sbin/ (props changed) stable/9/usr.sbin/makefs/ (props changed) Modified: stable/9/usr.sbin/makefs/ffs/ffs_bswap.c ============================================================================== --- stable/9/usr.sbin/makefs/ffs/ffs_bswap.c Mon Nov 9 09:23:35 2015 (r290597) +++ stable/9/usr.sbin/makefs/ffs/ffs_bswap.c Mon Nov 9 09:24:28 2015 (r290598) @@ -67,7 +67,7 @@ void ffs_csumtotal_swap(struct csum_tota void ffs_sb_swap(struct fs *o, struct fs *n) { - int i; + size_t i; u_int32_t *o32, *n32; /* @@ -97,7 +97,7 @@ ffs_sb_swap(struct fs *o, struct fs *n) n->fs_csaddr = bswap64(o->fs_csaddr); n->fs_pendingblocks = bswap64(o->fs_pendingblocks); n->fs_pendinginodes = bswap32(o->fs_pendinginodes); - + /* These fields overlap with the second half of the * historic FS_42POSTBLFMT postbl table */ @@ -171,9 +171,9 @@ ffs_dinode2_swap(struct ufs2_dinode *o, void ffs_csum_swap(struct csum *o, struct csum *n, int size) { - int i; + size_t i; u_int32_t *oint, *nint; - + oint = (u_int32_t*)o; nint = (u_int32_t*)n; From owner-svn-src-stable-9@freebsd.org Mon Nov 9 09:29:40 2015 Return-Path: Delivered-To: svn-src-stable-9@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 53E09A29BF8; Mon, 9 Nov 2015 09:29:40 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 13E6E1900; Mon, 9 Nov 2015 09:29:40 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tA99Tdkb017925; Mon, 9 Nov 2015 09:29:39 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tA99TdqI017924; Mon, 9 Nov 2015 09:29:39 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201511090929.tA99TdqI017924@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Mon, 9 Nov 2015 09:29:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r290600 - stable/9/usr.sbin/makefs/ffs X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Nov 2015 09:29:40 -0000 Author: ngie Date: Mon Nov 9 09:29:38 2015 New Revision: 290600 URL: https://svnweb.freebsd.org/changeset/base/290600 Log: MFstable/10 r290599: MFC r266930,r289225: r266930 (by jmg): convert to using the _daddr_t types like newfs was... Put the superblock in the correct possition for UFS2... There is a bug in FFS that if we don't put it here (for UFS2), it will forcefully relocate the superblock, and I believe cause data loss.. I have a fix for that, but w/ how many releases are broken, we won't be able to switch to the better _FLOPPY (block 0) for this for a while.. r289225 (by sbruno): makefs(8) leaves sblock.fs_providersize uninitialized (zero) that can be easily checked with dumpfs(8). This may lead to other problems, f.e. geom_label kernel module sanity checks do not like zero fs_old_size value and skips such UFS1 file system while tasting (fs_old_size derives from sblock.fs_providersize). PR: 203704 Submitted by: eugen@grosbein.net Reviewed by: marcel Modified: stable/9/usr.sbin/makefs/ffs/mkfs.c Directory Properties: stable/9/ (props changed) stable/9/usr.sbin/ (props changed) stable/9/usr.sbin/makefs/ (props changed) Modified: stable/9/usr.sbin/makefs/ffs/mkfs.c ============================================================================== --- stable/9/usr.sbin/makefs/ffs/mkfs.c Mon Nov 9 09:28:34 2015 (r290599) +++ stable/9/usr.sbin/makefs/ffs/mkfs.c Mon Nov 9 09:29:38 2015 (r290600) @@ -248,15 +248,16 @@ ffs_mkfs(const char *fsys, const fsinfo_ exit(21); } sblock.fs_fsbtodb = ilog2(sblock.fs_fsize / sectorsize); - sblock.fs_size = fssize = dbtofsb(&sblock, fssize); + sblock.fs_size = sblock.fs_providersize = fssize = + dbtofsb(&sblock, fssize); if (Oflag <= 1) { sblock.fs_magic = FS_UFS1_MAGIC; sblock.fs_sblockloc = SBLOCK_UFS1; - sblock.fs_nindir = sblock.fs_bsize / sizeof(int32_t); + sblock.fs_nindir = sblock.fs_bsize / sizeof(ufs1_daddr_t); sblock.fs_inopb = sblock.fs_bsize / sizeof(struct ufs1_dinode); sblock.fs_maxsymlinklen = ((NDADDR + NIADDR) * - sizeof (int32_t)); + sizeof (ufs1_daddr_t)); sblock.fs_old_inodefmt = FS_44INODEFMT; sblock.fs_old_cgoffset = 0; sblock.fs_old_cgmask = 0xffffffff; @@ -272,15 +273,11 @@ ffs_mkfs(const char *fsys, const fsinfo_ sblock.fs_old_nrpos = 1; } else { sblock.fs_magic = FS_UFS2_MAGIC; -#if 0 /* XXX makefs is used for small filesystems. */ sblock.fs_sblockloc = SBLOCK_UFS2; -#else - sblock.fs_sblockloc = SBLOCK_UFS1; -#endif - sblock.fs_nindir = sblock.fs_bsize / sizeof(int64_t); + sblock.fs_nindir = sblock.fs_bsize / sizeof(ufs2_daddr_t); sblock.fs_inopb = sblock.fs_bsize / sizeof(struct ufs2_dinode); sblock.fs_maxsymlinklen = ((NDADDR + NIADDR) * - sizeof (int64_t)); + sizeof (ufs2_daddr_t)); } sblock.fs_sblkno = From owner-svn-src-stable-9@freebsd.org Mon Nov 9 11:27:33 2015 Return-Path: Delivered-To: svn-src-stable-9@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 29EC9A2A462; Mon, 9 Nov 2015 11:27:33 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C990D159D; Mon, 9 Nov 2015 11:27:32 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tA9BRV6T052432; Mon, 9 Nov 2015 11:27:31 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tA9BRVSu052430; Mon, 9 Nov 2015 11:27:31 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201511091127.tA9BRVSu052430@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 9 Nov 2015 11:27:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r290608 - stable/9/sys/dev/usb/net X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Nov 2015 11:27:33 -0000 Author: hselasky Date: Mon Nov 9 11:27:31 2015 New Revision: 290608 URL: https://svnweb.freebsd.org/changeset/base/290608 Log: MFC r290441: Fix for unaligned IP-header. The mbuf length fields must be set before m_adj() is called else m_adj() will not always adjust the mbuf and an unaligned read exception can trigger inside the network stack. This can happen on platforms where unaligned reads are not supported. Adjust a length check to include the 2-byte ethernet alignment while at it. Modified: stable/9/sys/dev/usb/net/if_cdce.c stable/9/sys/dev/usb/net/if_urndis.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/usb/net/if_cdce.c ============================================================================== --- stable/9/sys/dev/usb/net/if_cdce.c Mon Nov 9 11:24:59 2015 (r290607) +++ stable/9/sys/dev/usb/net/if_cdce.c Mon Nov 9 11:27:31 2015 (r290608) @@ -1381,6 +1381,7 @@ cdce_ncm_bulk_read_callback(struct usb_x /* check if we have a buffer */ if (m) { + m->m_len = m->m_pkthdr.len = temp + ETHER_ALIGN; m_adj(m, ETHER_ALIGN); usbd_copy_out(pc, offset, m->m_data, temp); Modified: stable/9/sys/dev/usb/net/if_urndis.c ============================================================================== --- stable/9/sys/dev/usb/net/if_urndis.c Mon Nov 9 11:24:59 2015 (r290607) +++ stable/9/sys/dev/usb/net/if_urndis.c Mon Nov 9 11:27:31 2015 (r290608) @@ -848,7 +848,7 @@ urndis_bulk_read_callback(struct usb_xfe DPRINTF("invalid ethernet size " "%u < %u\n", msg.rm_datalen, (unsigned)sizeof(struct ether_header)); goto tr_setup; - } else if (msg.rm_datalen > (uint32_t)MCLBYTES) { + } else if (msg.rm_datalen > (uint32_t)(MCLBYTES - ETHER_ALIGN)) { ifp->if_ierrors++; DPRINTF("invalid ethernet size " "%u > %u\n", @@ -862,6 +862,7 @@ urndis_bulk_read_callback(struct usb_xfe /* check if we have a buffer */ if (m != NULL) { + m->m_len = m->m_pkthdr.len = msg.rm_datalen + ETHER_ALIGN; m_adj(m, ETHER_ALIGN); usbd_copy_out(pc, offset + msg.rm_dataoffset + From owner-svn-src-stable-9@freebsd.org Wed Nov 11 01:32:37 2015 Return-Path: Delivered-To: svn-src-stable-9@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E6177A2A49F; Wed, 11 Nov 2015 01:32:36 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BB6A41AFF; Wed, 11 Nov 2015 01:32:36 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tAB1WZIp001540; Wed, 11 Nov 2015 01:32:35 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tAB1WZLu001538; Wed, 11 Nov 2015 01:32:35 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201511110132.tAB1WZLu001538@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Wed, 11 Nov 2015 01:32:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r290668 - in stable: 10/sys/i386/i386 10/sys/i386/include 9/sys/i386/i386 9/sys/i386/include X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Nov 2015 01:32:37 -0000 Author: jhb Date: Wed Nov 11 01:32:35 2015 New Revision: 290668 URL: https://svnweb.freebsd.org/changeset/base/290668 Log: MFC 284324,290164: Workaround debuggers that try to read the full 32-bit words holding selectors in trapframes. 284324: Ensure that the upper 16 bits of segment registers manually saved in trapframes are cleared by explicitly pushing a zero and then moving the segment register into the low 16 bits. Certain Intel processors treat a push of a segment register as a move of the segment register into the low 16 bits leaving the upper 16 bits of the word in the stack unchanged. 290164: Use movw instead of movl (or plain mov) when moving segment registers into memory. This is a nop on clang's assembler, but some assemblers complain if the size suffix is incorrect. Modified: stable/9/sys/i386/i386/exception.s stable/9/sys/i386/include/asmacros.h Directory Properties: stable/9/sys/ (props changed) Changes in other areas also in this revision: Modified: stable/10/sys/i386/i386/exception.s stable/10/sys/i386/include/asmacros.h Directory Properties: stable/10/ (props changed) Modified: stable/9/sys/i386/i386/exception.s ============================================================================== --- stable/9/sys/i386/i386/exception.s Wed Nov 11 00:45:41 2015 (r290667) +++ stable/9/sys/i386/i386/exception.s Wed Nov 11 01:32:35 2015 (r290668) @@ -158,9 +158,12 @@ IDTVEC(xmm) .type alltraps,@function alltraps: pushal - pushl %ds - pushl %es - pushl %fs + pushl $0 + movw %ds,(%esp) + pushl $0 + movw %es,(%esp) + pushl $0 + movw %fs,(%esp) alltraps_with_regs_pushed: SET_KERNEL_SREGS cld @@ -234,9 +237,12 @@ IDTVEC(lcall_syscall) pushl $7 /* sizeof "lcall 7,0" */ subl $4,%esp /* skip over tf_trapno */ pushal - pushl %ds - pushl %es - pushl %fs + pushl $0 + movw %ds,(%esp) + pushl $0 + movw %es,(%esp) + pushl $0 + movw %fs,(%esp) SET_KERNEL_SREGS cld FAKE_MCOUNT(TF_EIP(%esp)) @@ -260,9 +266,12 @@ IDTVEC(int0x80_syscall) pushl $2 /* sizeof "int 0x80" */ subl $4,%esp /* skip over tf_trapno */ pushal - pushl %ds - pushl %es - pushl %fs + pushl $0 + movw %ds,(%esp) + pushl $0 + movw %es,(%esp) + pushl $0 + movw %fs,(%esp) SET_KERNEL_SREGS cld FAKE_MCOUNT(TF_EIP(%esp)) @@ -417,13 +426,16 @@ doreti_iret: doreti_iret_fault: subl $8,%esp pushal - pushl %ds + pushl $0 + movw %ds,(%esp) .globl doreti_popl_ds_fault doreti_popl_ds_fault: - pushl %es + pushl $0 + movw %es,(%esp) .globl doreti_popl_es_fault doreti_popl_es_fault: - pushl %fs + pushl $0 + movw %fs,(%esp) .globl doreti_popl_fs_fault doreti_popl_fs_fault: sti Modified: stable/9/sys/i386/include/asmacros.h ============================================================================== --- stable/9/sys/i386/include/asmacros.h Wed Nov 11 00:45:41 2015 (r290667) +++ stable/9/sys/i386/include/asmacros.h Wed Nov 11 01:32:35 2015 (r290668) @@ -146,9 +146,12 @@ pushl $0 ; /* dummy error code */ \ pushl $0 ; /* dummy trap type */ \ pushal ; /* 8 ints */ \ - pushl %ds ; /* save data and extra segments ... */ \ - pushl %es ; \ - pushl %fs + pushl $0 ; /* save data and extra segments ... */ \ + movw %ds,(%esp) ; \ + pushl $0 ; \ + movw %es,(%esp) ; \ + pushl $0 ; \ + movw %fs,(%esp) #define POP_FRAME \ popl %fs ; \ From owner-svn-src-stable-9@freebsd.org Thu Nov 12 03:28:34 2015 Return-Path: Delivered-To: svn-src-stable-9@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 41D97A2D548; Thu, 12 Nov 2015 03:28:34 +0000 (UTC) (envelope-from edwin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id ECFAF1B33; Thu, 12 Nov 2015 03:28:33 +0000 (UTC) (envelope-from edwin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tAC3SW0v057491; Thu, 12 Nov 2015 03:28:32 GMT (envelope-from edwin@FreeBSD.org) Received: (from edwin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tAC3SWgS057483; Thu, 12 Nov 2015 03:28:32 GMT (envelope-from edwin@FreeBSD.org) Message-Id: <201511120328.tAC3SWgS057483@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: edwin set sender to edwin@FreeBSD.org using -f From: Edwin Groothuis Date: Thu, 12 Nov 2015 03:28:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r290699 - stable/9/contrib/tzdata X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Nov 2015 03:28:34 -0000 Author: edwin Date: Thu Nov 12 03:28:32 2015 New Revision: 290699 URL: https://svnweb.freebsd.org/changeset/base/290699 Log: MFC of 290697,tzdata9: Update to tzdata2015g: Turkey's 2015 fall-back transition is scheduled for Nov. 8, not Oct. 25. Norfolk moves from +1130 to +1100 on 2015-10-04 at 02:00 local time. Fiji's 2016 fall-back transition is scheduled for January 17, not 24. Fort Nelson, British Columbia will not fall back on 2015-11-01. It has effectively been on MST (-0700) since it advanced its clocks on 2015-03-08. New zone America/Fort_Nelson. Modified: stable/9/contrib/tzdata/asia stable/9/contrib/tzdata/australasia stable/9/contrib/tzdata/europe stable/9/contrib/tzdata/northamerica stable/9/contrib/tzdata/zone.tab stable/9/contrib/tzdata/zone1970.tab Directory Properties: stable/9/contrib/tzdata/ (props changed) Modified: stable/9/contrib/tzdata/asia ============================================================================== --- stable/9/contrib/tzdata/asia Thu Nov 12 03:26:05 2015 (r290698) +++ stable/9/contrib/tzdata/asia Thu Nov 12 03:28:32 2015 (r290699) @@ -131,7 +131,8 @@ Zone Asia/Yerevan 2:58:00 - LMT 1924 May # Azerbaijan # From Rustam Aliyev of the Azerbaijan Internet Forum (2005-10-23): # According to the resolution of Cabinet of Ministers, 1997 -# Resolution available at: http://aif.az/docs/daylight_res.pdf +# From Paul Eggert (2015-09-17): It was Resolution No. 21 (1997-03-17). +# http://code.az/files/daylight_res.pdf # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S Rule Azer 1997 max - Mar lastSun 4:00 1:00 S Rule Azer 1997 max - Oct lastSun 5:00 0 - @@ -1717,11 +1718,12 @@ Rule ROK 1987 1988 - Oct Sun>=8 3:00 0 S # the 8:30 time zone on August 15, one example: # http://www.bbc.com/news/world-asia-33815049 # -# From Paul Eggert (2015-08-07): -# No transition time is specified; assume 00:00. +# From Paul Eggert (2015-08-15): +# Bells rang out midnight (00:00) Friday as part of the celebrations. See: +# Talmadge E. North Korea celebrates new time zone, 'Pyongyang Time' +# http://news.yahoo.com/north-korea-celebrates-time-zone-pyongyang-time-164038128.html # There is no common English-language abbreviation for this time zone. -# Use %z rather than invent one. We can't assume %z works everywhere yet, -# so for now substitute its output manually. +# Use KST, as that's what we already use for 1954-1961 in ROK. # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Asia/Seoul 8:27:52 - LMT 1908 Apr 1 @@ -1735,7 +1737,7 @@ Zone Asia/Pyongyang 8:23:00 - LMT 1908 A 8:30 - KST 1912 Jan 1 9:00 - JCST 1937 Oct 1 9:00 - JST 1945 Aug 24 - 9:00 - KST 2015 Aug 15 + 9:00 - KST 2015 Aug 15 00:00 8:30 - KST ############################################################################### Modified: stable/9/contrib/tzdata/australasia ============================================================================== --- stable/9/contrib/tzdata/australasia Thu Nov 12 03:26:05 2015 (r290698) +++ stable/9/contrib/tzdata/australasia Thu Nov 12 03:28:32 2015 (r290699) @@ -335,10 +335,17 @@ Zone Indian/Cocos 6:27:40 - LMT 1900 # DST will start Nov. 2 this year. # http://www.fiji.gov.fj/Media-Center/Press-Releases/DAYLIGHT-SAVING-STARTS-ON-SUNDAY,-NOVEMBER-2ND.aspx -# From Paul Eggert (2014-10-20): +# From a government order dated 2015-08-26 and published as Legal Notice No. 77 +# in the Government of Fiji Gazette Supplement No. 24 (2015-08-28), +# via Ken Rylander (2015-09-02): +# the daylight saving period is 1 hour in advance of the standard time +# commencing at 2.00 am on Sunday 1st November, 2015 and ending at +# 3.00 am on Sunday 17th January, 2016. + +# From Paul Eggert (2015-09-01): # For now, guess DST from 02:00 the first Sunday in November to -# 03:00 the first Sunday on or after January 18. Although ad hoc, it -# matches this year's plan and seems more likely to match future +# 03:00 the third Sunday in January. Although ad hoc, it matches +# transitions since late 2014 and seems more likely to match future # practice than guessing no DST. # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S @@ -351,7 +358,7 @@ Rule Fiji 2011 only - Mar Sun>=1 3:00 0 Rule Fiji 2012 2013 - Jan Sun>=18 3:00 0 - Rule Fiji 2014 only - Jan Sun>=18 2:00 0 - Rule Fiji 2014 max - Nov Sun>=1 2:00 1:00 S -Rule Fiji 2015 max - Jan Sun>=18 3:00 0 - +Rule Fiji 2015 max - Jan Sun>=15 3:00 0 - # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Pacific/Fiji 11:55:44 - LMT 1915 Oct 26 # Suva 12:00 Fiji FJ%sT # Fiji Time @@ -510,7 +517,10 @@ Zone Pacific/Niue -11:19:40 - LMT 1901 # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Pacific/Norfolk 11:11:52 - LMT 1901 # Kingston 11:12 - NMT 1951 # Norfolk Mean Time - 11:30 - NFT # Norfolk Time + 11:30 - NFT 1974 Oct 27 02:00 # Norfolk T. + 11:30 1:00 NFST 1975 Mar 2 02:00 + 11:30 - NFT 2015 Oct 4 02:00 + 11:00 - NFT # Palau (Belau) # Zone NAME GMTOFF RULES FORMAT [UNTIL] @@ -1550,6 +1560,20 @@ Zone Pacific/Wallis 12:15:20 - LMT 1901 # started DST on June 3. Possibly DST was observed other years # in Midway, but we have no record of it. +# Norfolk + +# From Alexander Krivenyshev (2015-09-23): +# Norfolk Island will change ... from +1130 to +1100: +# https://www.comlaw.gov.au/Details/F2015L01483/Explanatory%20Statement/Text +# ... at 12.30 am (by legal time in New South Wales) on 4 October 2015. +# http://www.norfolkisland.gov.nf/nia/MediaRelease/Media%20Release%20Norfolk%20Island%20Standard%20Time%20Change.pdf + +# From Paul Eggert (2015-09-23): +# Transitions before 2015 are from timeanddate.com, which consulted +# the Norfolk Island Museum and the Australian Bureau of Meteorology's +# Norfolk Island station, and found no record of Norfolk observing DST +# other than in 1974/5. See: +# http://www.timeanddate.com/time/australia/norfolk-island.html # Pitcairn Modified: stable/9/contrib/tzdata/europe ============================================================================== --- stable/9/contrib/tzdata/europe Thu Nov 12 03:26:05 2015 (r290698) +++ stable/9/contrib/tzdata/europe Thu Nov 12 03:28:32 2015 (r290699) @@ -3150,6 +3150,11 @@ Zone Europe/Zurich 0:34:08 - LMT 1853 Ju # http://www.balkaneu.com/eventful-elections-turkey/ 2014-03-30. # I guess the best we can do is document the official time. +# From Fatih (2015-09-29): +# It's officially announced now by the Ministry of Energy. +# Turkey delays winter time to 8th of November 04:00 +# http://www.aa.com.tr/tr/turkiye/yaz-saati-uygulamasi-8-kasimda-sona-erecek/362217 + # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S Rule Turkey 1916 only - May 1 0:00 1:00 S Rule Turkey 1916 only - Oct 1 0:00 0 - @@ -3219,6 +3224,8 @@ Zone Europe/Istanbul 1:55:52 - LMT 1880 2:00 - EET 2011 Mar 28 1:00u 2:00 EU EE%sT 2014 Mar 30 1:00u 2:00 - EET 2014 Mar 31 1:00u + 2:00 EU EE%sT 2015 Oct 25 1:00u + 2:00 1:00 EEST 2015 Nov 8 1:00u 2:00 EU EE%sT Link Europe/Istanbul Asia/Istanbul # Istanbul is in both continents. Modified: stable/9/contrib/tzdata/northamerica ============================================================================== --- stable/9/contrib/tzdata/northamerica Thu Nov 12 03:26:05 2015 (r290698) +++ stable/9/contrib/tzdata/northamerica Thu Nov 12 03:28:32 2015 (r290699) @@ -1826,6 +1826,22 @@ Zone America/Edmonton -7:33:52 - LMT 190 # The transition dates (and times) are guesses. +# From Matt Johnson (2015-09-21): +# Fort Nelson, BC, Canada will cancel DST this year. So while previously they +# were aligned with America/Vancouver, they're now aligned with +# America/Dawson_Creek. +# http://www.northernrockies.ca/EN/meta/news/archives/2015/northern-rockies-time-change.html +# +# From Tim Parenti (2015-09-23): +# This requires a new zone for the Northern Rockies Regional Municipality, +# America/Fort_Nelson. The resolution of 2014-12-08 was reached following a +# 2014-11-15 poll with nearly 75% support. Effectively, the municipality has +# been on MST (-0700) like Dawson Creek since it advanced its clocks on +# 2015-03-08. +# +# From Paul Eggert (2015-09-23): +# Shanks says Fort Nelson did not observe DST in 1946, unlike Vancouver. + # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S Rule Vanc 1918 only - Apr 14 2:00 1:00 D Rule Vanc 1918 only - Oct 27 2:00 0 S @@ -1844,6 +1860,12 @@ Zone America/Dawson_Creek -8:00:56 - LMT -8:00 Canada P%sT 1947 -8:00 Vanc P%sT 1972 Aug 30 2:00 -7:00 - MST +Zone America/Fort_Nelson -8:10:47 - LMT 1884 + -8:00 Vanc P%sT 1946 + -8:00 - PST 1947 + -8:00 Vanc P%sT 1987 + -8:00 Canada P%sT 2015 Mar 8 2:00 + -7:00 - MST Zone America/Creston -7:46:04 - LMT 1884 -7:00 - MST 1916 Oct 1 -8:00 - PST 1918 Jun 2 Modified: stable/9/contrib/tzdata/zone.tab ============================================================================== --- stable/9/contrib/tzdata/zone.tab Thu Nov 12 03:26:05 2015 (r290698) +++ stable/9/contrib/tzdata/zone.tab Thu Nov 12 03:28:32 2015 (r290699) @@ -129,6 +129,7 @@ CA +6227-11421 America/Yellowknife Mount CA +682059-1334300 America/Inuvik Mountain Time - west Northwest Territories CA +4906-11631 America/Creston Mountain Standard Time - Creston, British Columbia CA +5946-12014 America/Dawson_Creek Mountain Standard Time - Dawson Creek & Fort Saint John, British Columbia +CA +5848-12242 America/Fort_Nelson Mountain Standard Time - Fort Nelson, British Columbia CA +4916-12307 America/Vancouver Pacific Time - west British Columbia CA +6043-13503 America/Whitehorse Pacific Time - south Yukon CA +6404-13925 America/Dawson Pacific Time - north Yukon Modified: stable/9/contrib/tzdata/zone1970.tab ============================================================================== --- stable/9/contrib/tzdata/zone1970.tab Thu Nov 12 03:26:05 2015 (r290698) +++ stable/9/contrib/tzdata/zone1970.tab Thu Nov 12 03:28:32 2015 (r290699) @@ -127,6 +127,7 @@ CA +6227-11421 America/Yellowknife Mount CA +682059-1334300 America/Inuvik Mountain Time - west Northwest Territories CA +4906-11631 America/Creston Mountain Standard Time - Creston, British Columbia CA +5946-12014 America/Dawson_Creek Mountain Standard Time - Dawson Creek & Fort Saint John, British Columbia +CA +5848-12242 America/Fort_Nelson Mountain Standard Time - Fort Nelson, British Columbia CA +4916-12307 America/Vancouver Pacific Time - west British Columbia CA +6043-13503 America/Whitehorse Pacific Time - south Yukon CA +6404-13925 America/Dawson Pacific Time - north Yukon From owner-svn-src-stable-9@freebsd.org Thu Nov 12 22:45:53 2015 Return-Path: Delivered-To: svn-src-stable-9@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 45314A2E162; Thu, 12 Nov 2015 22:45:53 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 224D3180C; Thu, 12 Nov 2015 22:45:53 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tACMjqYi006168; Thu, 12 Nov 2015 22:45:52 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tACMjqkV006166; Thu, 12 Nov 2015 22:45:52 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201511122245.tACMjqkV006166@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 12 Nov 2015 22:45:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r290730 - in stable: 10/sys/amd64/amd64 10/sys/i386/i386 9/sys/amd64/amd64 9/sys/i386/i386 X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Nov 2015 22:45:53 -0000 Author: jhb Date: Thu Nov 12 22:45:51 2015 New Revision: 290730 URL: https://svnweb.freebsd.org/changeset/base/290730 Log: MFC 285773,285775,285776: Various fixes for stack unwinding in DDB on x86. 285773: Remove some dead code from DDB's amd64 stack unwinder. The amd64 port copied some code from i386 to fetch function arguments and display them in backtraces. However, it was commented out and can't easily be implemented since the function arguments are passed in registers rather than on the stack in amd64. Remove it in preparation for some bug fixes in this area. 285775: Improve stack unwinding on i386 and amd64 after an IP fault. If we can't find a symbol corresponding to the faulting instruction, assume that the previously-executed function is a call and attempt to find the calling function using the return address on the stack. Otherwise we end up associating the last stack frame with the current call, which is incorrect and causes the unwinder to skip printing of the calling function, resulting in a confusing backtrace. 285776: Let the unwinder handle faults during function prologues or epilogues. The i386 and amd64 DDB stack unwinders contain code to detect and handle the case where the first frame is not completely set up or torn down. This code was accidentally unused however, since db_backtrace() was never called with a non-NULL trap frame. This change fixes that. Also remove get_rsp() from the amd64 code. It appears to have come from i386, which needs to take into account whether the exception triggered a CPL switch, since SS:ESP is only pushed onto the stack if so. On amd64, SS:RSP is pushed regardless, so get_rsp() was doing the wrong thing for kernel-mode exceptions. As a result, we can also remove custom print functions for these registers. Modified: stable/9/sys/amd64/amd64/db_trace.c stable/9/sys/i386/i386/db_trace.c Directory Properties: stable/9/sys/ (props changed) Changes in other areas also in this revision: Modified: stable/10/sys/amd64/amd64/db_trace.c stable/10/sys/i386/i386/db_trace.c Directory Properties: stable/10/ (props changed) Modified: stable/9/sys/amd64/amd64/db_trace.c ============================================================================== --- stable/9/sys/amd64/amd64/db_trace.c Thu Nov 12 22:24:39 2015 (r290729) +++ stable/9/sys/amd64/amd64/db_trace.c Thu Nov 12 22:45:51 2015 (r290730) @@ -61,8 +61,6 @@ static db_varfcn_t db_dr5; static db_varfcn_t db_dr6; static db_varfcn_t db_dr7; static db_varfcn_t db_frame; -static db_varfcn_t db_rsp; -static db_varfcn_t db_ss; CTASSERT(sizeof(struct dbreg) == sizeof(((struct pcpu *)NULL)->pc_dbreg)); @@ -76,12 +74,12 @@ struct db_variable db_regs[] = { { "es", DB_OFFSET(tf_es), db_frame }, { "fs", DB_OFFSET(tf_fs), db_frame }, { "gs", DB_OFFSET(tf_gs), db_frame }, - { "ss", NULL, db_ss }, + { "ss", DB_OFFSET(tf_ss), db_frame }, { "rax", DB_OFFSET(tf_rax), db_frame }, { "rcx", DB_OFFSET(tf_rcx), db_frame }, { "rdx", DB_OFFSET(tf_rdx), db_frame }, { "rbx", DB_OFFSET(tf_rbx), db_frame }, - { "rsp", NULL, db_rsp }, + { "rsp", DB_OFFSET(tf_rsp), db_frame }, { "rbp", DB_OFFSET(tf_rbp), db_frame }, { "rsi", DB_OFFSET(tf_rsi), db_frame }, { "rdi", DB_OFFSET(tf_rdi), db_frame }, @@ -130,13 +128,6 @@ DB_DRX_FUNC(dr5) DB_DRX_FUNC(dr6) DB_DRX_FUNC(dr7) -static __inline long -get_rsp(struct trapframe *tf) -{ - return ((ISPL(tf->tf_cs)) ? tf->tf_rsp : - (db_expr_t)tf + offsetof(struct trapframe, tf_rsp)); -} - static int db_frame(struct db_variable *vp, db_expr_t *valuep, int op) { @@ -153,34 +144,6 @@ db_frame(struct db_variable *vp, db_expr return (1); } -static int -db_rsp(struct db_variable *vp, db_expr_t *valuep, int op) -{ - - if (kdb_frame == NULL) - return (0); - - if (op == DB_VAR_GET) - *valuep = get_rsp(kdb_frame); - else if (ISPL(kdb_frame->tf_cs)) - kdb_frame->tf_rsp = *valuep; - return (1); -} - -static int -db_ss(struct db_variable *vp, db_expr_t *valuep, int op) -{ - - if (kdb_frame == NULL) - return (0); - - if (op == DB_VAR_GET) - *valuep = (ISPL(kdb_frame->tf_cs)) ? kdb_frame->tf_ss : rss(); - else if (ISPL(kdb_frame->tf_cs)) - kdb_frame->tf_ss = *valuep; - return (1); -} - #define NORMAL 0 #define TRAP 1 #define INTERRUPT 2 @@ -188,9 +151,7 @@ db_ss(struct db_variable *vp, db_expr_t #define TRAP_INTERRUPT 5 static void db_nextframe(struct amd64_frame **, db_addr_t *, struct thread *); -static int db_numargs(struct amd64_frame *); -static void db_print_stack_entry(const char *, int, char **, long *, db_addr_t, - void *); +static void db_print_stack_entry(const char *, db_addr_t, void *); static void decode_syscall(int, struct thread *); static const char * watchtype_str(int type); @@ -198,62 +159,11 @@ int amd64_set_watch(int watchnum, unsig int access, struct dbreg *d); int amd64_clr_watch(int watchnum, struct dbreg *d); -/* - * Figure out how many arguments were passed into the frame at "fp". - */ -static int -db_numargs(fp) - struct amd64_frame *fp; -{ -#if 1 - return (0); /* regparm, needs dwarf2 info */ -#else - long *argp; - int inst; - int args; - - argp = (long *)db_get_value((long)&fp->f_retaddr, 8, FALSE); - /* - * XXX etext is wrong for LKMs. We should attempt to interpret - * the instruction at the return address in all cases. This - * may require better fault handling. - */ - if (argp < (long *)btext || argp >= (long *)etext) { - args = 5; - } else { - inst = db_get_value((long)argp, 4, FALSE); - if ((inst & 0xff) == 0x59) /* popl %ecx */ - args = 1; - else if ((inst & 0xffff) == 0xc483) /* addl $Ibs, %esp */ - args = ((inst >> 16) & 0xff) / 4; - else - args = 5; - } - return (args); -#endif -} - static void -db_print_stack_entry(name, narg, argnp, argp, callpc, frame) - const char *name; - int narg; - char **argnp; - long *argp; - db_addr_t callpc; - void *frame; +db_print_stack_entry(const char *name, db_addr_t callpc, void *frame) { - db_printf("%s(", name); -#if 0 - while (narg) { - if (argnp) - db_printf("%s=", *argnp++); - db_printf("%lr", (long)db_get_value((long)argp, 8, FALSE)); - argp++; - if (--narg != 0) - db_printf(","); - } -#endif - db_printf(") at "); + + db_printf("%s() at ", name != NULL ? name : "??"); db_printsym(callpc, DB_STGY_PROC); if (frame != NULL) db_printf("/frame 0x%lx", (register_t)frame); @@ -348,7 +258,7 @@ db_nextframe(struct amd64_frame **fp, db return; } - db_print_stack_entry(name, 0, 0, 0, rip, &(*fp)->f_frame); + db_print_stack_entry(name, rip, &(*fp)->f_frame); /* * Point to base of trapframe which is just above the @@ -357,7 +267,7 @@ db_nextframe(struct amd64_frame **fp, db tf = (struct trapframe *)((long)*fp + 16); if (INKERNEL((long) tf)) { - rsp = get_rsp(tf); + rsp = tf->tf_rsp; rip = tf->tf_rip; rbp = tf->tf_rbp; switch (frame_type) { @@ -384,17 +294,13 @@ db_nextframe(struct amd64_frame **fp, db } static int -db_backtrace(struct thread *td, struct trapframe *tf, - struct amd64_frame *frame, db_addr_t pc, int count) +db_backtrace(struct thread *td, struct trapframe *tf, struct amd64_frame *frame, + db_addr_t pc, register_t sp, int count) { struct amd64_frame *actframe; -#define MAXNARG 16 - char *argnames[MAXNARG], **argnp = NULL; const char *name; - long *argp; db_expr_t offset; c_db_sym_t sym; - int narg; boolean_t first; if (count == -1) @@ -418,48 +324,51 @@ db_backtrace(struct thread *td, struct t */ actframe = frame; if (first) { - if (tf != NULL) { + first = FALSE; + if (sym == C_DB_SYM_NULL && sp != 0) { + /* + * If a symbol couldn't be found, we've probably + * jumped to a bogus location, so try and use + * the return address to find our caller. + */ + db_print_stack_entry(name, pc, NULL); + pc = db_get_value(sp, 8, FALSE); + if (db_search_symbol(pc, DB_STGY_PROC, + &offset) == C_DB_SYM_NULL) + break; + continue; + } else if (tf != NULL) { int instr; instr = db_get_value(pc, 4, FALSE); if ((instr & 0xffffffff) == 0xe5894855) { /* pushq %rbp; movq %rsp, %rbp */ - actframe = (void *)(get_rsp(tf) - 8); + actframe = (void *)(tf->tf_rsp - 8); } else if ((instr & 0xffffff) == 0xe58948) { /* movq %rsp, %rbp */ - actframe = (void *)get_rsp(tf); + actframe = (void *)tf->tf_rsp; if (tf->tf_rbp == 0) { /* Fake frame better. */ frame = actframe; } } else if ((instr & 0xff) == 0xc3) { /* ret */ - actframe = (void *)(get_rsp(tf) - 8); + actframe = (void *)(tf->tf_rsp - 8); } else if (offset == 0) { /* Probably an assembler symbol. */ - actframe = (void *)(get_rsp(tf) - 8); + actframe = (void *)(tf->tf_rsp - 8); } } else if (strcmp(name, "fork_trampoline") == 0) { /* * Don't try to walk back on a stack for a * process that hasn't actually been run yet. */ - db_print_stack_entry(name, 0, 0, 0, pc, - actframe); + db_print_stack_entry(name, pc, actframe); break; } - first = FALSE; - } - - argp = &actframe->f_arg0; - narg = MAXNARG; - if (sym != NULL && db_sym_numargs(sym, &narg, argnames)) { - argnp = argnames; - } else { - narg = db_numargs(frame); } - db_print_stack_entry(name, narg, argnp, argp, pc, actframe); + db_print_stack_entry(name, pc, actframe); if (actframe != frame) { /* `frame' belongs to caller. */ @@ -473,7 +382,7 @@ db_backtrace(struct thread *td, struct t if (INKERNEL((long)pc) && !INKERNEL((long)frame)) { sym = db_search_symbol(pc, DB_STGY_ANY, &offset); db_symbol_values(sym, &name, NULL); - db_print_stack_entry(name, 0, 0, 0, pc, frame); + db_print_stack_entry(name, pc, frame); break; } if (!INKERNEL((long) frame)) { @@ -495,17 +404,19 @@ db_trace_self(void) frame = (struct amd64_frame *)rbp; callpc = (db_addr_t)db_get_value((long)&frame->f_retaddr, 8, FALSE); frame = frame->f_frame; - db_backtrace(curthread, NULL, frame, callpc, -1); + db_backtrace(curthread, NULL, frame, callpc, 0, -1); } int db_trace_thread(struct thread *thr, int count) { struct pcb *ctx; + struct trapframe *tf; ctx = kdb_thr_ctx(thr); - return (db_backtrace(thr, NULL, (struct amd64_frame *)ctx->pcb_rbp, - ctx->pcb_rip, count)); + tf = thr == kdb_thread ? kdb_frame : NULL; + return (db_backtrace(thr, tf, (struct amd64_frame *)ctx->pcb_rbp, + ctx->pcb_rip, ctx->pcb_rsp, count)); } int Modified: stable/9/sys/i386/i386/db_trace.c ============================================================================== --- stable/9/sys/i386/i386/db_trace.c Thu Nov 12 22:24:39 2015 (r290729) +++ stable/9/sys/i386/i386/db_trace.c Thu Nov 12 22:45:51 2015 (r290730) @@ -390,7 +390,7 @@ db_nextframe(struct i386_frame **fp, db_ static int db_backtrace(struct thread *td, struct trapframe *tf, struct i386_frame *frame, - db_addr_t pc, int count) + db_addr_t pc, register_t sp, int count) { struct i386_frame *actframe; #define MAXNARG 16 @@ -447,7 +447,21 @@ db_backtrace(struct thread *td, struct t */ actframe = frame; if (first) { - if (tf != NULL) { + first = FALSE; + if (sym == C_DB_SYM_NULL && sp != 0) { + /* + * If a symbol couldn't be found, we've probably + * jumped to a bogus location, so try and use + * the return address to find our caller. + */ + db_print_stack_entry(name, 0, 0, 0, pc, + NULL); + pc = db_get_value(sp, 4, FALSE); + if (db_search_symbol(pc, DB_STGY_PROC, + &offset) == C_DB_SYM_NULL) + break; + continue; + } else if (tf != NULL) { instr = db_get_value(pc, 4, FALSE); if ((instr & 0xffffff) == 0x00e58955) { /* pushl %ebp; movl %esp, %ebp */ @@ -475,7 +489,6 @@ db_backtrace(struct thread *td, struct t actframe); break; } - first = FALSE; } argp = &actframe->f_arg0; @@ -522,17 +535,19 @@ db_trace_self(void) frame = (struct i386_frame *)ebp; callpc = (db_addr_t)db_get_value((int)&frame->f_retaddr, 4, FALSE); frame = frame->f_frame; - db_backtrace(curthread, NULL, frame, callpc, -1); + db_backtrace(curthread, NULL, frame, callpc, 0, -1); } int db_trace_thread(struct thread *thr, int count) { struct pcb *ctx; + struct trapframe *tf; ctx = kdb_thr_ctx(thr); - return (db_backtrace(thr, NULL, (struct i386_frame *)ctx->pcb_ebp, - ctx->pcb_eip, count)); + tf = thr == kdb_thread ? kdb_frame : NULL; + return (db_backtrace(thr, tf, (struct i386_frame *)ctx->pcb_ebp, + ctx->pcb_eip, ctx->pcb_esp, count)); } int From owner-svn-src-stable-9@freebsd.org Thu Nov 12 23:49:50 2015 Return-Path: Delivered-To: svn-src-stable-9@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 331A8A2EB58; Thu, 12 Nov 2015 23:49:50 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E5E32180B; Thu, 12 Nov 2015 23:49:49 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tACNnmcJ024387; Thu, 12 Nov 2015 23:49:48 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tACNnmBo024382; Thu, 12 Nov 2015 23:49:48 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201511122349.tACNnmBo024382@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 12 Nov 2015 23:49:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r290731 - in stable: 10/sys/amd64/amd64 10/sys/ddb 10/sys/i386/i386 9/sys/amd64/amd64 9/sys/ddb 9/sys/i386/i386 X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Nov 2015 23:49:50 -0000 Author: jhb Date: Thu Nov 12 23:49:47 2015 New Revision: 290731 URL: https://svnweb.freebsd.org/changeset/base/290731 Log: MFC 285783: Various changes to the registers displayed in DDB for x86. - Fix segment registers to only display the low 16 bits. - Remove unused handlers and entries for the debug registers. - Display xcr0 (if valid) in 'show sysregs'. - Add '0x' prefix to MSR values to match other values in 'show sysregs'. - MFamd64: Display various MSRs in 'show sysregs'. - Add a 'show dbregs' to display the value of debug registers. - Dynamically size the column width for register values to properly align columns on 64-bit platforms. - Display %gs for i386 in 'show registers'. Modified: stable/9/sys/amd64/amd64/db_trace.c stable/9/sys/amd64/amd64/machdep.c stable/9/sys/ddb/db_print.c stable/9/sys/i386/i386/db_trace.c stable/9/sys/i386/i386/machdep.c Directory Properties: stable/9/sys/ (props changed) Changes in other areas also in this revision: Modified: stable/10/sys/amd64/amd64/db_trace.c stable/10/sys/amd64/amd64/machdep.c stable/10/sys/ddb/db_print.c stable/10/sys/i386/i386/db_trace.c stable/10/sys/i386/i386/machdep.c Directory Properties: stable/10/ (props changed) Modified: stable/9/sys/amd64/amd64/db_trace.c ============================================================================== --- stable/9/sys/amd64/amd64/db_trace.c Thu Nov 12 22:45:51 2015 (r290730) +++ stable/9/sys/amd64/amd64/db_trace.c Thu Nov 12 23:49:47 2015 (r290731) @@ -52,15 +52,8 @@ __FBSDID("$FreeBSD$"); #include #include -static db_varfcn_t db_dr0; -static db_varfcn_t db_dr1; -static db_varfcn_t db_dr2; -static db_varfcn_t db_dr3; -static db_varfcn_t db_dr4; -static db_varfcn_t db_dr5; -static db_varfcn_t db_dr6; -static db_varfcn_t db_dr7; static db_varfcn_t db_frame; +static db_varfcn_t db_frame_seg; CTASSERT(sizeof(struct dbreg) == sizeof(((struct pcpu *)NULL)->pc_dbreg)); @@ -69,12 +62,12 @@ CTASSERT(sizeof(struct dbreg) == sizeof( */ #define DB_OFFSET(x) (db_expr_t *)offsetof(struct trapframe, x) struct db_variable db_regs[] = { - { "cs", DB_OFFSET(tf_cs), db_frame }, - { "ds", DB_OFFSET(tf_ds), db_frame }, - { "es", DB_OFFSET(tf_es), db_frame }, - { "fs", DB_OFFSET(tf_fs), db_frame }, - { "gs", DB_OFFSET(tf_gs), db_frame }, - { "ss", DB_OFFSET(tf_ss), db_frame }, + { "cs", DB_OFFSET(tf_cs), db_frame_seg }, + { "ds", DB_OFFSET(tf_ds), db_frame_seg }, + { "es", DB_OFFSET(tf_es), db_frame_seg }, + { "fs", DB_OFFSET(tf_fs), db_frame_seg }, + { "gs", DB_OFFSET(tf_gs), db_frame_seg }, + { "ss", DB_OFFSET(tf_ss), db_frame_seg }, { "rax", DB_OFFSET(tf_rax), db_frame }, { "rcx", DB_OFFSET(tf_rcx), db_frame }, { "rdx", DB_OFFSET(tf_rdx), db_frame }, @@ -93,40 +86,24 @@ struct db_variable db_regs[] = { { "r15", DB_OFFSET(tf_r15), db_frame }, { "rip", DB_OFFSET(tf_rip), db_frame }, { "rflags", DB_OFFSET(tf_rflags), db_frame }, -#define DB_N_SHOW_REGS 24 /* Don't show registers after here. */ - { "dr0", NULL, db_dr0 }, - { "dr1", NULL, db_dr1 }, - { "dr2", NULL, db_dr2 }, - { "dr3", NULL, db_dr3 }, - { "dr4", NULL, db_dr4 }, - { "dr5", NULL, db_dr5 }, - { "dr6", NULL, db_dr6 }, - { "dr7", NULL, db_dr7 }, }; -struct db_variable *db_eregs = db_regs + DB_N_SHOW_REGS; +struct db_variable *db_eregs = db_regs + nitems(db_regs); -#define DB_DRX_FUNC(reg) \ -static int \ -db_ ## reg (vp, valuep, op) \ - struct db_variable *vp; \ - db_expr_t * valuep; \ - int op; \ -{ \ - if (op == DB_VAR_GET) \ - *valuep = r ## reg (); \ - else \ - load_ ## reg (*valuep); \ - return (1); \ -} - -DB_DRX_FUNC(dr0) -DB_DRX_FUNC(dr1) -DB_DRX_FUNC(dr2) -DB_DRX_FUNC(dr3) -DB_DRX_FUNC(dr4) -DB_DRX_FUNC(dr5) -DB_DRX_FUNC(dr6) -DB_DRX_FUNC(dr7) +static int +db_frame_seg(struct db_variable *vp, db_expr_t *valuep, int op) +{ + uint16_t *reg; + + if (kdb_frame == NULL) + return (0); + + reg = (uint16_t *)((uintptr_t)kdb_frame + (db_expr_t)vp->valuep); + if (op == DB_VAR_GET) + *valuep = *reg; + else + *reg = *valuep; + return (1); +} static int db_frame(struct db_variable *vp, db_expr_t *valuep, int op) Modified: stable/9/sys/amd64/amd64/machdep.c ============================================================================== --- stable/9/sys/amd64/amd64/machdep.c Thu Nov 12 22:45:51 2015 (r290730) +++ stable/9/sys/amd64/amd64/machdep.c Thu Nov 12 23:49:47 2015 (r290731) @@ -1215,11 +1215,26 @@ DB_SHOW_COMMAND(sysregs, db_show_sysregs db_printf("cr2\t0x%016lx\n", rcr2()); db_printf("cr3\t0x%016lx\n", rcr3()); db_printf("cr4\t0x%016lx\n", rcr4()); - db_printf("EFER\t%016lx\n", rdmsr(MSR_EFER)); - db_printf("FEATURES_CTL\t%016lx\n", rdmsr(MSR_IA32_FEATURE_CONTROL)); - db_printf("DEBUG_CTL\t%016lx\n", rdmsr(MSR_DEBUGCTLMSR)); - db_printf("PAT\t%016lx\n", rdmsr(MSR_PAT)); - db_printf("GSBASE\t%016lx\n", rdmsr(MSR_GSBASE)); + if (rcr4() & CR4_XSAVE) + db_printf("xcr0\t0x%016lx\n", rxcr(0)); + db_printf("EFER\t0x%016lx\n", rdmsr(MSR_EFER)); + if (cpu_feature2 & (CPUID2_VMX | CPUID2_SMX)) + db_printf("FEATURES_CTL\t%016lx\n", + rdmsr(MSR_IA32_FEATURE_CONTROL)); + db_printf("DEBUG_CTL\t0x%016lx\n", rdmsr(MSR_DEBUGCTLMSR)); + db_printf("PAT\t0x%016lx\n", rdmsr(MSR_PAT)); + db_printf("GSBASE\t0x%016lx\n", rdmsr(MSR_GSBASE)); +} + +DB_SHOW_COMMAND(dbregs, db_show_dbregs) +{ + + db_printf("dr0\t0x%016lx\n", rdr0()); + db_printf("dr1\t0x%016lx\n", rdr1()); + db_printf("dr2\t0x%016lx\n", rdr2()); + db_printf("dr3\t0x%016lx\n", rdr3()); + db_printf("dr6\t0x%016lx\n", rdr6()); + db_printf("dr7\t0x%016lx\n", rdr7()); } #endif Modified: stable/9/sys/ddb/db_print.c ============================================================================== --- stable/9/sys/ddb/db_print.c Thu Nov 12 22:45:51 2015 (r290730) +++ stable/9/sys/ddb/db_print.c Thu Nov 12 23:49:47 2015 (r290731) @@ -56,7 +56,8 @@ db_show_regs(db_expr_t _1, boolean_t _2, for (regp = db_regs; regp < db_eregs; regp++) { if (!db_read_variable(regp, &value)) continue; - db_printf("%-12s%#10lr", regp->name, (unsigned long)value); + db_printf("%-12s%#*lr", regp->name, + (int)(sizeof(unsigned long) * 2 + 2), (unsigned long)value); db_find_xtrn_sym_and_offset((db_addr_t)value, &name, &offset); if (name != NULL && offset <= (unsigned long)db_maxoff && offset != value) { Modified: stable/9/sys/i386/i386/db_trace.c ============================================================================== --- stable/9/sys/i386/i386/db_trace.c Thu Nov 12 22:45:51 2015 (r290730) +++ stable/9/sys/i386/i386/db_trace.c Thu Nov 12 23:49:47 2015 (r290731) @@ -48,16 +48,10 @@ __FBSDID("$FreeBSD$"); #include #include -static db_varfcn_t db_dr0; -static db_varfcn_t db_dr1; -static db_varfcn_t db_dr2; -static db_varfcn_t db_dr3; -static db_varfcn_t db_dr4; -static db_varfcn_t db_dr5; -static db_varfcn_t db_dr6; -static db_varfcn_t db_dr7; static db_varfcn_t db_esp; static db_varfcn_t db_frame; +static db_varfcn_t db_frame_seg; +static db_varfcn_t db_gs; static db_varfcn_t db_ss; /* @@ -65,10 +59,11 @@ static db_varfcn_t db_ss; */ #define DB_OFFSET(x) (db_expr_t *)offsetof(struct trapframe, x) struct db_variable db_regs[] = { - { "cs", DB_OFFSET(tf_cs), db_frame }, - { "ds", DB_OFFSET(tf_ds), db_frame }, - { "es", DB_OFFSET(tf_es), db_frame }, - { "fs", DB_OFFSET(tf_fs), db_frame }, + { "cs", DB_OFFSET(tf_cs), db_frame_seg }, + { "ds", DB_OFFSET(tf_ds), db_frame_seg }, + { "es", DB_OFFSET(tf_es), db_frame_seg }, + { "fs", DB_OFFSET(tf_fs), db_frame_seg }, + { "gs", NULL, db_gs }, { "ss", NULL, db_ss }, { "eax", DB_OFFSET(tf_eax), db_frame }, { "ecx", DB_OFFSET(tf_ecx), db_frame }, @@ -80,40 +75,8 @@ struct db_variable db_regs[] = { { "edi", DB_OFFSET(tf_edi), db_frame }, { "eip", DB_OFFSET(tf_eip), db_frame }, { "efl", DB_OFFSET(tf_eflags), db_frame }, -#define DB_N_SHOW_REGS 15 /* Don't show registers after here. */ - { "dr0", NULL, db_dr0 }, - { "dr1", NULL, db_dr1 }, - { "dr2", NULL, db_dr2 }, - { "dr3", NULL, db_dr3 }, - { "dr4", NULL, db_dr4 }, - { "dr5", NULL, db_dr5 }, - { "dr6", NULL, db_dr6 }, - { "dr7", NULL, db_dr7 }, }; -struct db_variable *db_eregs = db_regs + DB_N_SHOW_REGS; - -#define DB_DRX_FUNC(reg) \ -static int \ -db_ ## reg (vp, valuep, op) \ - struct db_variable *vp; \ - db_expr_t * valuep; \ - int op; \ -{ \ - if (op == DB_VAR_GET) \ - *valuep = r ## reg (); \ - else \ - load_ ## reg (*valuep); \ - return (1); \ -} - -DB_DRX_FUNC(dr0) -DB_DRX_FUNC(dr1) -DB_DRX_FUNC(dr2) -DB_DRX_FUNC(dr3) -DB_DRX_FUNC(dr4) -DB_DRX_FUNC(dr5) -DB_DRX_FUNC(dr6) -DB_DRX_FUNC(dr7) +struct db_variable *db_eregs = db_regs + nitems(db_regs); static __inline int get_esp(struct trapframe *tf) @@ -139,6 +102,22 @@ db_frame(struct db_variable *vp, db_expr } static int +db_frame_seg(struct db_variable *vp, db_expr_t *valuep, int op) +{ + uint16_t *reg; + + if (kdb_frame == NULL) + return (0); + + reg = (uint16_t *)((uintptr_t)kdb_frame + (db_expr_t)vp->valuep); + if (op == DB_VAR_GET) + *valuep = *reg; + else + *reg = *valuep; + return (1); +} + +static int db_esp(struct db_variable *vp, db_expr_t *valuep, int op) { @@ -153,6 +132,17 @@ db_esp(struct db_variable *vp, db_expr_t } static int +db_gs(struct db_variable *vp, db_expr_t *valuep, int op) +{ + + if (op == DB_VAR_GET) + *valuep = rgs(); + else + load_gs(*valuep); + return (1); +} + +static int db_ss(struct db_variable *vp, db_expr_t *valuep, int op) { Modified: stable/9/sys/i386/i386/machdep.c ============================================================================== --- stable/9/sys/i386/i386/machdep.c Thu Nov 12 22:45:51 2015 (r290730) +++ stable/9/sys/i386/i386/machdep.c Thu Nov 12 23:49:47 2015 (r290731) @@ -1962,6 +1962,29 @@ DB_SHOW_COMMAND(sysregs, db_show_sysregs db_printf("cr2\t0x%08x\n", rcr2()); db_printf("cr3\t0x%08x\n", rcr3()); db_printf("cr4\t0x%08x\n", rcr4()); + if (rcr4() & CR4_XSAVE) + db_printf("xcr0\t0x%016llx\n", rxcr(0)); + if (amd_feature & (AMDID_NX | AMDID_LM)) + db_printf("EFER\t0x%016llx\n", rdmsr(MSR_EFER)); + if (cpu_feature2 & (CPUID2_VMX | CPUID2_SMX)) + db_printf("FEATURES_CTL\t0x%016llx\n", + rdmsr(MSR_IA32_FEATURE_CONTROL)); + if ((cpu_vendor_id == CPU_VENDOR_INTEL || + cpu_vendor_id == CPU_VENDOR_AMD) && CPUID_TO_FAMILY(cpu_id) >= 6) + db_printf("DEBUG_CTL\t0x%016llx\n", rdmsr(MSR_DEBUGCTLMSR)); + if (cpu_feature & CPUID_PAT) + db_printf("PAT\t0x%016llx\n", rdmsr(MSR_PAT)); +} + +DB_SHOW_COMMAND(dbregs, db_show_dbregs) +{ + + db_printf("dr0\t0x%08x\n", rdr0()); + db_printf("dr1\t0x%08x\n", rdr1()); + db_printf("dr2\t0x%08x\n", rdr2()); + db_printf("dr3\t0x%08x\n", rdr3()); + db_printf("dr6\t0x%08x\n", rdr6()); + db_printf("dr7\t0x%08x\n", rdr7()); } #endif From owner-svn-src-stable-9@freebsd.org Fri Nov 13 00:47:46 2015 Return-Path: Delivered-To: svn-src-stable-9@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4C35DA2C5EF; Fri, 13 Nov 2015 00:47:46 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0D6D118A7; Fri, 13 Nov 2015 00:47:45 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tAD0lj11050558; Fri, 13 Nov 2015 00:47:45 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tAD0ljtZ050556; Fri, 13 Nov 2015 00:47:45 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201511130047.tAD0ljtZ050556@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Fri, 13 Nov 2015 00:47:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r290733 - in stable/9/sys/i386: i386 include X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Nov 2015 00:47:46 -0000 Author: jhb Date: Fri Nov 13 00:47:44 2015 New Revision: 290733 URL: https://svnweb.freebsd.org/changeset/base/290733 Log: Fix i386 build. stable/9 does not have XSAVE support. Pointy hat to: jhb Modified: stable/9/sys/i386/i386/machdep.c stable/9/sys/i386/include/specialreg.h Modified: stable/9/sys/i386/i386/machdep.c ============================================================================== --- stable/9/sys/i386/i386/machdep.c Fri Nov 13 00:34:57 2015 (r290732) +++ stable/9/sys/i386/i386/machdep.c Fri Nov 13 00:47:44 2015 (r290733) @@ -1962,8 +1962,6 @@ DB_SHOW_COMMAND(sysregs, db_show_sysregs db_printf("cr2\t0x%08x\n", rcr2()); db_printf("cr3\t0x%08x\n", rcr3()); db_printf("cr4\t0x%08x\n", rcr4()); - if (rcr4() & CR4_XSAVE) - db_printf("xcr0\t0x%016llx\n", rxcr(0)); if (amd_feature & (AMDID_NX | AMDID_LM)) db_printf("EFER\t0x%016llx\n", rdmsr(MSR_EFER)); if (cpu_feature2 & (CPUID2_VMX | CPUID2_SMX)) Modified: stable/9/sys/i386/include/specialreg.h ============================================================================== --- stable/9/sys/i386/include/specialreg.h Fri Nov 13 00:34:57 2015 (r290732) +++ stable/9/sys/i386/include/specialreg.h Fri Nov 13 00:47:44 2015 (r290733) @@ -281,6 +281,7 @@ #define MSR_APICBASE 0x01b #define MSR_EBL_CR_POWERON 0x02a #define MSR_TEST_CTL 0x033 +#define MSR_IA32_FEATURE_CONTROL 0x03a #define MSR_BIOS_UPDT_TRIG 0x079 #define MSR_BBL_CR_D0 0x088 #define MSR_BBL_CR_D1 0x089 From owner-svn-src-stable-9@freebsd.org Fri Nov 13 00:50:37 2015 Return-Path: Delivered-To: svn-src-stable-9@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 205D8A2C6EF; Fri, 13 Nov 2015 00:50:37 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E50961BFF; Fri, 13 Nov 2015 00:50:36 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tAD0oZNw053105; Fri, 13 Nov 2015 00:50:35 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tAD0oZj4053101; Fri, 13 Nov 2015 00:50:35 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201511130050.tAD0oZj4053101@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Fri, 13 Nov 2015 00:50:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r290734 - in stable: 10/sys/amd64/amd64 10/sys/i386/i386 10/sys/i386/include 9/sys/amd64/amd64 9/sys/i386/i386 9/sys/i386/include X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Nov 2015 00:50:37 -0000 Author: jhb Date: Fri Nov 13 00:50:34 2015 New Revision: 290734 URL: https://svnweb.freebsd.org/changeset/base/290734 Log: MFC 284325: Report the values of x86 segment registers to remote debuggers. While here, also report %eflags from the i386 trapframe. Modified: stable/9/sys/amd64/amd64/gdb_machdep.c stable/9/sys/i386/i386/gdb_machdep.c stable/9/sys/i386/i386/machdep.c stable/9/sys/i386/include/gdb_machdep.h Directory Properties: stable/9/sys/ (props changed) Changes in other areas also in this revision: Modified: stable/10/sys/amd64/amd64/gdb_machdep.c stable/10/sys/i386/i386/gdb_machdep.c stable/10/sys/i386/i386/machdep.c stable/10/sys/i386/include/gdb_machdep.h Directory Properties: stable/10/ (props changed) Modified: stable/9/sys/amd64/amd64/gdb_machdep.c ============================================================================== --- stable/9/sys/amd64/amd64/gdb_machdep.c Fri Nov 13 00:47:44 2015 (r290733) +++ stable/9/sys/amd64/amd64/gdb_machdep.c Fri Nov 13 00:50:34 2015 (r290734) @@ -48,6 +48,8 @@ __FBSDID("$FreeBSD$"); void * gdb_cpu_getreg(int regnum, size_t *regsz) { + static uint32_t _kcodesel = GSEL(GCODE_SEL, SEL_KPL); + static uint32_t _kdatasel = GSEL(GDATA_SEL, SEL_KPL); *regsz = gdb_cpu_regsz(regnum); @@ -76,6 +78,8 @@ gdb_cpu_getreg(int regnum, size_t *regsz case 14: return (&kdb_thrctx->pcb_r14); case 15: return (&kdb_thrctx->pcb_r15); case 16: return (&kdb_thrctx->pcb_rip); + case 18: return (&_kcodesel); + case 19: return (&_kdatasel); } return (NULL); } Modified: stable/9/sys/i386/i386/gdb_machdep.c ============================================================================== --- stable/9/sys/i386/i386/gdb_machdep.c Fri Nov 13 00:47:44 2015 (r290733) +++ stable/9/sys/i386/i386/gdb_machdep.c Fri Nov 13 00:50:34 2015 (r290734) @@ -45,14 +45,22 @@ __FBSDID("$FreeBSD$"); void * gdb_cpu_getreg(int regnum, size_t *regsz) { + static uint32_t _kcodesel = GSEL(GCODE_SEL, SEL_KPL); + static uint32_t _kdatasel = GSEL(GDATA_SEL, SEL_KPL); + static uint32_t _kprivsel = GSEL(GPRIV_SEL, SEL_KPL); *regsz = gdb_cpu_regsz(regnum); - if (kdb_thread == curthread) { + if (kdb_thread == curthread) { switch (regnum) { case 0: return (&kdb_frame->tf_eax); case 1: return (&kdb_frame->tf_ecx); case 2: return (&kdb_frame->tf_edx); + case 9: return (&kdb_frame->tf_eflags); + case 10: return (&kdb_frame->tf_cs); + case 12: return (&kdb_frame->tf_ds); + case 13: return (&kdb_frame->tf_es); + case 14: return (&kdb_frame->tf_fs); } } switch (regnum) { @@ -62,6 +70,12 @@ gdb_cpu_getreg(int regnum, size_t *regsz case 6: return (&kdb_thrctx->pcb_esi); case 7: return (&kdb_thrctx->pcb_edi); case 8: return (&kdb_thrctx->pcb_eip); + case 10: return (&_kcodesel); + case 11: return (&_kdatasel); + case 12: return (&_kdatasel); + case 13: return (&_kdatasel); + case 14: return (&_kprivsel); + case 15: return (&kdb_thrctx->pcb_gs); } return (NULL); } Modified: stable/9/sys/i386/i386/machdep.c ============================================================================== --- stable/9/sys/i386/i386/machdep.c Fri Nov 13 00:47:44 2015 (r290733) +++ stable/9/sys/i386/i386/machdep.c Fri Nov 13 00:50:34 2015 (r290734) @@ -3172,6 +3172,7 @@ makectx(struct trapframe *tf, struct pcb pcb->pcb_ebx = tf->tf_ebx; pcb->pcb_eip = tf->tf_eip; pcb->pcb_esp = (ISPL(tf->tf_cs)) ? tf->tf_esp : (int)(tf + 1) - 8; + pcb->pcb_gs = rgs(); } int Modified: stable/9/sys/i386/include/gdb_machdep.h ============================================================================== --- stable/9/sys/i386/include/gdb_machdep.h Fri Nov 13 00:47:44 2015 (r290733) +++ stable/9/sys/i386/include/gdb_machdep.h Fri Nov 13 00:50:34 2015 (r290734) @@ -30,7 +30,7 @@ #define _MACHINE_GDB_MACHDEP_H_ #define GDB_BUFSZ 400 -#define GDB_NREGS 14 +#define GDB_NREGS 16 #define GDB_REG_PC 8 static __inline size_t From owner-svn-src-stable-9@freebsd.org Fri Nov 13 22:33:53 2015 Return-Path: Delivered-To: svn-src-stable-9@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5B75CA2EEF3; Fri, 13 Nov 2015 22:33:53 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 27A011158; Fri, 13 Nov 2015 22:33:53 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tADMXqL6049382; Fri, 13 Nov 2015 22:33:52 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tADMXqSL049381; Fri, 13 Nov 2015 22:33:52 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201511132233.tADMXqSL049381@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Fri, 13 Nov 2015 22:33:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r290804 - in stable: 10/usr.sbin/pciconf 9/usr.sbin/pciconf X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Nov 2015 22:33:53 -0000 Author: jhb Date: Fri Nov 13 22:33:51 2015 New Revision: 290804 URL: https://svnweb.freebsd.org/changeset/base/290804 Log: MFC 290412: Note if relaxed ordering or no snoop is enabled for each PCI-express device. Modified: stable/9/usr.sbin/pciconf/cap.c Directory Properties: stable/9/usr.sbin/pciconf/ (props changed) Changes in other areas also in this revision: Modified: stable/10/usr.sbin/pciconf/cap.c Directory Properties: stable/10/ (props changed) Modified: stable/9/usr.sbin/pciconf/cap.c ============================================================================== --- stable/9/usr.sbin/pciconf/cap.c Fri Nov 13 22:27:24 2015 (r290803) +++ stable/9/usr.sbin/pciconf/cap.c Fri Nov 13 22:33:51 2015 (r290804) @@ -458,6 +458,10 @@ cap_express(int fd, struct pci_conf *p, MAX_PAYLOAD(cap & PCIEM_CAP_MAX_PAYLOAD)); if ((cap & PCIEM_CAP_FLR) != 0) printf(" FLR"); + if (ctl & PCIEM_CTL_RELAXED_ORD_ENABLE) + printf(" RO"); + if (ctl & PCIEM_CTL_NOSNOOP_ENABLE) + printf(" NS"); cap = read_config(fd, &p->pc_sel, ptr + PCIER_LINK_CAP, 4); sta = read_config(fd, &p->pc_sel, ptr + PCIER_LINK_STA, 2); printf(" link x%d(x%d)", (sta & PCIEM_LINK_STA_WIDTH) >> 4, From owner-svn-src-stable-9@freebsd.org Sat Nov 14 00:04:43 2015 Return-Path: Delivered-To: svn-src-stable-9@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8AB8AA2E7EB; Sat, 14 Nov 2015 00:04:43 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3CE37123F; Sat, 14 Nov 2015 00:04:43 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tAE04gBT078653; Sat, 14 Nov 2015 00:04:42 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tAE04gJu078651; Sat, 14 Nov 2015 00:04:42 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201511140004.tAE04gJu078651@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Sat, 14 Nov 2015 00:04:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r290808 - stable/9/sys/dev/pci X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Nov 2015 00:04:43 -0000 Author: jhb Date: Sat Nov 14 00:04:42 2015 New Revision: 290808 URL: https://svnweb.freebsd.org/changeset/base/290808 Log: MFC 232472 (partial): Cache the starting location of the PCI-express capability for PCI-express devices in PCI device ivars. Modified: stable/9/sys/dev/pci/pci.c stable/9/sys/dev/pci/pcivar.h Modified: stable/9/sys/dev/pci/pci.c ============================================================================== --- stable/9/sys/dev/pci/pci.c Fri Nov 13 23:47:41 2015 (r290807) +++ stable/9/sys/dev/pci/pci.c Sat Nov 14 00:04:42 2015 (r290808) @@ -798,6 +798,9 @@ pci_read_cap(device_t pcib, pcicfgregs * * at least one PCI-express device. */ pcie_chipset = 1; + cfg->pcie.pcie_location = ptr; + val = REG(ptr + PCIR_EXPRESS_FLAGS, 2); + cfg->pcie.pcie_type = val & PCIM_EXP_FLAGS_TYPE; break; default: break; @@ -1776,10 +1779,12 @@ pci_ht_map_msi(device_t dev, uint64_t ad int pci_get_max_read_req(device_t dev) { + struct pci_devinfo *dinfo = device_get_ivars(dev); int cap; uint16_t val; - if (pci_find_cap(dev, PCIY_EXPRESS, &cap) != 0) + cap = dinfo->cfg.pcie.pcie_location; + if (cap == 0) return (0); val = pci_read_config(dev, cap + PCIER_DEVICE_CTL, 2); val &= PCIEM_CTL_MAX_READ_REQUEST; @@ -1790,10 +1795,12 @@ pci_get_max_read_req(device_t dev) int pci_set_max_read_req(device_t dev, int size) { + struct pci_devinfo *dinfo = device_get_ivars(dev); int cap; uint16_t val; - if (pci_find_cap(dev, PCIY_EXPRESS, &cap) != 0) + cap = dinfo->cfg.pcie.pcie_location; + if (cap == 0) return (0); if (size < 128) size = 128; Modified: stable/9/sys/dev/pci/pcivar.h ============================================================================== --- stable/9/sys/dev/pci/pcivar.h Fri Nov 13 23:47:41 2015 (r290807) +++ stable/9/sys/dev/pci/pcivar.h Sat Nov 14 00:04:42 2015 (r290808) @@ -124,6 +124,12 @@ struct pcicfg_ht { uint64_t ht_msiaddr; /* MSI mapping base address */ }; +/* Interesting values for PCI-express */ +struct pcicfg_pcie { + uint8_t pcie_location; /* Offset of PCI-e capability registers. */ + uint8_t pcie_type; /* Device type. */ +}; + /* config header information common to all header types */ typedef struct pcicfg { struct device *dev; /* device which owns this */ @@ -165,6 +171,7 @@ typedef struct pcicfg { struct pcicfg_msi msi; /* PCI MSI */ struct pcicfg_msix msix; /* PCI MSI-X */ struct pcicfg_ht ht; /* HyperTransport */ + struct pcicfg_pcie pcie; /* PCI Express */ } pcicfgregs; /* additional type 1 device config header information (PCI to PCI bridge) */ From owner-svn-src-stable-9@freebsd.org Sat Nov 14 01:06:47 2015 Return-Path: Delivered-To: svn-src-stable-9@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A9161A2F2CC; Sat, 14 Nov 2015 01:06:47 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 82F641B71; Sat, 14 Nov 2015 01:06:47 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tAE16k3r097983; Sat, 14 Nov 2015 01:06:46 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tAE16koW097979; Sat, 14 Nov 2015 01:06:46 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201511140106.tAE16koW097979@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Sat, 14 Nov 2015 01:06:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r290809 - in stable: 10/share/man/man9 10/sys/dev/pci 9/share/man/man9 9/sys/dev/pci X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Nov 2015 01:06:47 -0000 Author: jhb Date: Sat Nov 14 01:06:45 2015 New Revision: 290809 URL: https://svnweb.freebsd.org/changeset/base/290809 Log: MFC 290414,290415: Additional PCI helper functions. 290414: Add helper routines for PCI device drivers to read, write, and modify PCI-Express capability registers (that is, PCI config registers in the standard PCI config space belonging to the PCI-Express capability register set). Note that all of the current PCI-e registers are either 16 or 32-bits, so only widths of 2 or 4 bytes are supported. 290415: Add a new helper function for PCI devices to locate the upstream PCI-express root port of a given PCI device. Modified: stable/9/share/man/man9/Makefile stable/9/share/man/man9/pci.9 stable/9/sys/dev/pci/pci.c stable/9/sys/dev/pci/pcivar.h Directory Properties: stable/9/share/man/man9/ (props changed) stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Changes in other areas also in this revision: Modified: stable/10/share/man/man9/Makefile stable/10/share/man/man9/pci.9 stable/10/sys/dev/pci/pci.c stable/10/sys/dev/pci/pcivar.h Directory Properties: stable/10/ (props changed) Modified: stable/9/share/man/man9/Makefile ============================================================================== --- stable/9/share/man/man9/Makefile Sat Nov 14 00:04:42 2015 (r290808) +++ stable/9/share/man/man9/Makefile Sat Nov 14 01:06:45 2015 (r290809) @@ -978,6 +978,7 @@ MLINKS+=pci.9 pci_alloc_msi.9 \ pci.9 pci_find_cap.9 \ pci.9 pci_find_dbsf.9 \ pci.9 pci_find_device.9 \ + pci.9 pci_find_pcie_root_port.9 \ pci.9 pci_get_max_read_req.9 \ pci.9 pci_get_powerstate.9 \ pci.9 pci_get_vpd_ident.9 \ @@ -992,7 +993,10 @@ MLINKS+=pci.9 pci_alloc_msi.9 \ pci.9 pci_save_state.9 \ pci.9 pci_set_powerstate.9 \ pci.9 pci_set_max_read_req.9 \ - pci.9 pci_write_config.9 + pci.9 pci_write_config.9 \ + pci.9 pcie_adjust_config.9 \ + pci.9 pcie_read_config.9 \ + pci.9 pcie_write_config.9 \ MLINKS+=pfil.9 pfil_add_hook.9 \ pfil.9 pfil_hook_get.9 \ pfil.9 pfil_remove_hook.9 Modified: stable/9/share/man/man9/pci.9 ============================================================================== --- stable/9/share/man/man9/pci.9 Sat Nov 14 00:04:42 2015 (r290808) +++ stable/9/share/man/man9/pci.9 Sat Nov 14 01:06:45 2015 (r290809) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 5, 2012 +.Dd November 5, 2015 .Dt PCI 9 .Os .Sh NAME @@ -40,6 +40,7 @@ .Nm pci_find_cap , .Nm pci_find_dbsf , .Nm pci_find_device , +.Nm pci_find_pcie_root_port , .Nm pci_get_max_read_req , .Nm pci_get_powerstate , .Nm pci_get_vpd_ident , @@ -54,7 +55,10 @@ .Nm pci_save_state , .Nm pci_set_max_read_req , .Nm pci_set_powerstate , -.Nm pci_write_config +.Nm pci_write_config , +.Nm pcie_adjust_config , +.Nm pcie_read_config , +.Nm pcie_write_config .Nd PCI bus interface .Sh SYNOPSIS .In sys/bus.h @@ -80,6 +84,8 @@ .Fn pci_find_dbsf "uint32_t domain" "uint8_t bus" "uint8_t slot" "uint8_t func" .Ft device_t .Fn pci_find_device "uint16_t vendor" "uint16_t device" +.Ft device_t +.Fn pci_find_pcie_root_port "device_t dev" .Ft int .Fn pci_get_max_read_req "device_t dev" .Ft int @@ -110,6 +116,18 @@ .Fn pci_set_powerstate "device_t dev" "int state" .Ft void .Fn pci_write_config "device_t dev" "int reg" "uint32_t val" "int width" +.Ft uint32_t +.Fo pcie_adjust_config +.Fa "device_t dev" +.Fa "int reg" +.Fa "uint32_t mask" +.Fa "uint32_t val" +.Fa "int width" +.Fc +.Ft uint32_t +.Fn pcie_read_config "device_t dev" "int reg" "int width" +.Ft void +.Fn pcie_write_config "device_t dev" "int reg" "uint32_t val" "int width" .Sh DESCRIPTION The .Nm @@ -146,6 +164,48 @@ with .Fa width specifying the size of the access. .Pp +The +.Fn pcie_adjust_config +function is used to modify the value of a register in the PCI-express +capability register set of device +.Fa dev . +The offset +.Fa reg +specifies a relative offset in the register set with +.Fa width +specifying the size of the access. +The new value of the register is computed by modifying bits set in +.Fa mask +to the value in +.Fa val . +Any bits not specified in +.Fa mask +are preserved. +The previous value of the register is returned. +.Pp +The +.Fn pcie_read_config +function is used to read the value of a register in the PCI-express +capability register set of device +.Fa dev . +The offset +.Fa reg +specifies a relative offset in the register set with +.Fa width +specifying the size of the access. +.Pp +The +.Fn pcie_write_config +function is used to write the value +.Fa val +to a register in the PCI-express capability register set of device +.Fa dev . +The offset +.Fa reg +specifies a relative offset in the register set with +.Fa width +specifying the size of the access. +.Pp .Em NOTE : Device drivers should only use these functions for functionality that is not available via another @@ -225,6 +285,16 @@ If the capability is not found or the de returns an error. .Pp The +.Fn pci_find_pcie_root_port +function walks up the PCI device hierarchy to locate the PCI-express root +port upstream of +.Fa dev . +If a root port is not found, +.Fn pci_find_pcie_root_port +returns +.Dv NULL . +.Pp +The .Fn pci_get_vpd_ident function is used to fetch a device's Vital Product Data .Pq VPD Modified: stable/9/sys/dev/pci/pci.c ============================================================================== --- stable/9/sys/dev/pci/pci.c Sat Nov 14 00:04:42 2015 (r290808) +++ stable/9/sys/dev/pci/pci.c Sat Nov 14 01:06:45 2015 (r290809) @@ -1814,6 +1814,63 @@ pci_set_max_read_req(device_t dev, int s return (size); } +uint32_t +pcie_read_config(device_t dev, int reg, int width) +{ + struct pci_devinfo *dinfo = device_get_ivars(dev); + int cap; + + cap = dinfo->cfg.pcie.pcie_location; + if (cap == 0) { + if (width == 2) + return (0xffff); + return (0xffffffff); + } + + return (pci_read_config(dev, cap + reg, width)); +} + +void +pcie_write_config(device_t dev, int reg, uint32_t value, int width) +{ + struct pci_devinfo *dinfo = device_get_ivars(dev); + int cap; + + cap = dinfo->cfg.pcie.pcie_location; + if (cap == 0) + return; + pci_write_config(dev, cap + reg, value, width); +} + +/* + * Adjusts a PCI-e capability register by clearing the bits in mask + * and setting the bits in (value & mask). Bits not set in mask are + * not adjusted. + * + * Returns the old value on success or all ones on failure. + */ +uint32_t +pcie_adjust_config(device_t dev, int reg, uint32_t mask, uint32_t value, + int width) +{ + struct pci_devinfo *dinfo = device_get_ivars(dev); + uint32_t old, new; + int cap; + + cap = dinfo->cfg.pcie.pcie_location; + if (cap == 0) { + if (width == 2) + return (0xffff); + return (0xffffffff); + } + + old = pci_read_config(dev, cap + reg, width); + new = old & ~mask; + new |= (value & mask); + pci_write_config(dev, cap + reg, new, width); + return (old); +} + /* * Support for MSI message signalled interrupts. */ @@ -4686,3 +4743,44 @@ pci_restore_state(device_t dev) dinfo = device_get_ivars(dev); pci_cfg_restore(dev, dinfo); } + +/* Find the upstream port of a given PCI device in a root complex. */ +device_t +pci_find_pcie_root_port(device_t dev) +{ + struct pci_devinfo *dinfo; + devclass_t pci_class; + device_t pcib, bus; + + pci_class = devclass_find("pci"); + KASSERT(device_get_devclass(device_get_parent(dev)) == pci_class, + ("%s: non-pci device %s", __func__, device_get_nameunit(dev))); + + /* + * Walk the bridge hierarchy until we find a PCI-e root + * port or a non-PCI device. + */ + for (;;) { + bus = device_get_parent(dev); + KASSERT(bus != NULL, ("%s: null parent of %s", __func__, + device_get_nameunit(dev))); + + pcib = device_get_parent(bus); + KASSERT(pcib != NULL, ("%s: null bridge of %s", __func__, + device_get_nameunit(bus))); + + /* + * pcib's parent must be a PCI bus for this to be a + * PCI-PCI bridge. + */ + if (device_get_devclass(device_get_parent(pcib)) != pci_class) + return (NULL); + + dinfo = device_get_ivars(pcib); + if (dinfo->cfg.pcie.pcie_location != 0 && + dinfo->cfg.pcie.pcie_type == PCIEM_TYPE_ROOT_PORT) + return (pcib); + + dev = pcib; + } +} Modified: stable/9/sys/dev/pci/pcivar.h ============================================================================== --- stable/9/sys/dev/pci/pcivar.h Sat Nov 14 00:04:42 2015 (r290808) +++ stable/9/sys/dev/pci/pcivar.h Sat Nov 14 01:06:45 2015 (r290809) @@ -475,10 +475,15 @@ int pci_msix_device_blacklisted(device_t void pci_ht_map_msi(device_t dev, uint64_t addr); +device_t pci_find_pcie_root_port(device_t dev); int pci_get_max_read_req(device_t dev); void pci_restore_state(device_t dev); void pci_save_state(device_t dev); int pci_set_max_read_req(device_t dev, int size); +uint32_t pcie_read_config(device_t dev, int reg, int width); +void pcie_write_config(device_t dev, int reg, uint32_t value, int width); +uint32_t pcie_adjust_config(device_t dev, int reg, uint32_t mask, + uint32_t value, int width); #endif /* _SYS_BUS_H_ */ From owner-svn-src-stable-9@freebsd.org Sat Nov 14 17:32:39 2015 Return-Path: Delivered-To: svn-src-stable-9@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C3A46A2FF51; Sat, 14 Nov 2015 17:32:39 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8C8E41F7B; Sat, 14 Nov 2015 17:32:39 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tAEHWcnj088421; Sat, 14 Nov 2015 17:32:38 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tAEHWcdj088420; Sat, 14 Nov 2015 17:32:38 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201511141732.tAEHWcdj088420@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Sat, 14 Nov 2015 17:32:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r290827 - stable/9/share/man/man9 X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Nov 2015 17:32:39 -0000 Author: bdrewery Date: Sat Nov 14 17:32:38 2015 New Revision: 290827 URL: https://svnweb.freebsd.org/changeset/base/290827 Log: MFC r290428: remove \, it confuses things. Modified: stable/9/share/man/man9/Makefile Directory Properties: stable/9/share/man/man9/ (props changed) Modified: stable/9/share/man/man9/Makefile ============================================================================== --- stable/9/share/man/man9/Makefile Sat Nov 14 17:30:52 2015 (r290826) +++ stable/9/share/man/man9/Makefile Sat Nov 14 17:32:38 2015 (r290827) @@ -996,7 +996,7 @@ MLINKS+=pci.9 pci_alloc_msi.9 \ pci.9 pci_write_config.9 \ pci.9 pcie_adjust_config.9 \ pci.9 pcie_read_config.9 \ - pci.9 pcie_write_config.9 \ + pci.9 pcie_write_config.9 MLINKS+=pfil.9 pfil_add_hook.9 \ pfil.9 pfil_hook_get.9 \ pfil.9 pfil_remove_hook.9