From owner-svn-src-projects@freebsd.org Sun Sep 24 00:07:19 2017 Return-Path: Delivered-To: svn-src-projects@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 74CC0E14ED9 for ; Sun, 24 Sep 2017 00:07:19 +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 50EFC3E9A; Sun, 24 Sep 2017 00:07:19 +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 v8O07Ifk023460; Sun, 24 Sep 2017 00:07:18 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v8O07I5r023458; Sun, 24 Sep 2017 00:07:18 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201709240007.v8O07I5r023458@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sun, 24 Sep 2017 00:07:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r323959 - projects/runtime-coverage/tests/sys/opencrypto X-SVN-Group: projects X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: projects/runtime-coverage/tests/sys/opencrypto X-SVN-Commit-Revision: 323959 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Sep 2017 00:07:19 -0000 Author: ngie Date: Sun Sep 24 00:07:18 2017 New Revision: 323959 URL: https://svnweb.freebsd.org/changeset/base/323959 Log: Convert some idioms over to py3k-compatible idioms - Import print_function from __future__ and use print(..) instead of `print ..`. - Use repr instead of backticks when the object needs to be dumped, unless print(..) can do it lazily. Use str instead of backticks as appropriate for simplification reasons. This doesn't fully convert these modules over py3k. It just gets over some of the trivial compatibility hurdles. Modified: projects/runtime-coverage/tests/sys/opencrypto/cryptodev.py projects/runtime-coverage/tests/sys/opencrypto/cryptotest.py Modified: projects/runtime-coverage/tests/sys/opencrypto/cryptodev.py ============================================================================== --- projects/runtime-coverage/tests/sys/opencrypto/cryptodev.py Sat Sep 23 19:49:12 2017 (r323958) +++ projects/runtime-coverage/tests/sys/opencrypto/cryptodev.py Sun Sep 24 00:07:18 2017 (r323959) @@ -30,6 +30,7 @@ # $FreeBSD$ # +from __future__ import print_function import array import dpkt from fcntl import ioctl @@ -174,9 +175,9 @@ class Crypto: if not cipher and not mac: raise ValueError('one of cipher or mac MUST be specified.') ses.crid = crid - #print `ses` + #print(ses) s = array.array('B', ses.pack_hdr()) - #print `s` + #print(s) ioctl(_cryptodev, CIOCGSESSION2, s, 1) ses.unpack(s) @@ -206,7 +207,7 @@ class Crypto: ivbuf = array.array('B', iv) cop.iv = ivbuf.buffer_info()[0] - #print 'cop:', `cop` + #print('cop:', cop) ioctl(_cryptodev, CIOCCRYPT, str(cop)) s = s.tostring() @@ -234,7 +235,8 @@ class Crypto: if tag is None: tag = array.array('B', [0] * self._maclen) else: - assert len(tag) == self._maclen, `len(tag), self._maclen` + assert len(tag) == self._maclen, \ + '%d != %d' % (len(tag), self._maclen) tag = array.array('B', tag) caead.tag = tag.buffer_info()[0] @@ -288,8 +290,8 @@ class Crypto: signal.signal(signal.SIGALRM, oldalarm) - print 'time:', end - start - print 'perf MB/sec:', (reps * size) / (end - start) / 1024 / 1024 + print('time:', end - start) + print('perf MB/sec:', (reps * size) / (end - start) / 1024 / 1024) def encrypt(self, data, iv, aad=None): if aad is None: @@ -332,7 +334,7 @@ class KATParser: if i[0] == '[': yield i[1:].split(']', 1)[0], self.fielditer() else: - raise ValueError('unknown line: %s' % `i`) + raise ValueError('unknown line: %r' % repr(i)) def eatblanks(self): while True: @@ -362,12 +364,12 @@ class KATParser: if line == 'FAIL': f, v = 'FAIL', '' else: - print 'line:', `line` + print('line:', repr(line)) raise v = v.strip() if f in values: - raise ValueError('already present: %s' % `f`) + raise ValueError('already present: %r' % repr(f)) values[f] = v line = self.fp.readline().strip() if not line: @@ -377,7 +379,7 @@ class KATParser: remain = self.fields.copy() - set(values.keys()) # XXX - special case GCM decrypt if remain and not ('FAIL' in values and 'PT' in remain): - raise ValueError('not all fields found: %s' % `remain`) + raise ValueError('not all fields found: %r' % repr(remain)) yield values @@ -388,22 +390,22 @@ if __name__ == '__main__': if True: try: crid = Crypto.findcrid('aesni0') - print 'aesni:', crid + print('aesni:', crid) except IOError: - print 'aesni0 not found' + print('aesni0 not found') for i in xrange(10): try: name = Crypto.getcridname(i) - print '%2d: %s' % (i, `name`) + print('%2d: %r' % (i, repr(name))) except IOError: pass elif False: kp = KATParser('/usr/home/jmg/aesni.testing/format tweak value input - data unit seq no/XTSGenAES128.rsp', [ 'COUNT', 'DataUnitLen', 'Key', 'DataUnitSeqNumber', 'PT', 'CT' ]) for mode, ni in kp: - print `i`, `ni` + print(i, ni) for j in ni: - print `j` + print(j) elif False: key = _spdechex('c939cc13397c1d37de6ae0e1cb7c423c') iv = _spdechex('00000000000000000000000000000001') @@ -414,15 +416,15 @@ if __name__ == '__main__': c = Crypto(CRYPTO_AES_ICM, key) enc = c.encrypt(pt, iv) - print 'enc:', enc.encode('hex') - print ' ct:', ct.encode('hex') + print('enc:', enc.encode('hex')) + print(' ct:', ct.encode('hex')) assert ct == enc dec = c.decrypt(ct, iv) - print 'dec:', dec.encode('hex') - print ' pt:', pt.encode('hex') + print('dec:', dec.encode('hex')) + print(' pt:', pt.encode('hex')) assert pt == dec elif False: @@ -435,15 +437,15 @@ if __name__ == '__main__': c = Crypto(CRYPTO_AES_ICM, key) enc = c.encrypt(pt, iv) - print 'enc:', enc.encode('hex') - print ' ct:', ct.encode('hex') + print('enc:', enc.encode('hex')) + print(' ct:', ct.encode('hex')) assert ct == enc dec = c.decrypt(ct, iv) - print 'dec:', dec.encode('hex') - print ' pt:', pt.encode('hex') + print('dec:', dec.encode('hex')) + print(' pt:', pt.encode('hex')) assert pt == dec elif False: @@ -455,15 +457,15 @@ if __name__ == '__main__': enc = c.encrypt(pt, iv) - print 'enc:', enc.encode('hex') - print ' ct:', ct.encode('hex') + print('enc:', enc.encode('hex')) + print(' ct:', ct.encode('hex')) assert ct == enc dec = c.decrypt(ct, iv) - print 'dec:', dec.encode('hex') - print ' pt:', pt.encode('hex') + print('dec:', dec.encode('hex')) + print(' pt:', pt.encode('hex')) assert pt == dec elif False: @@ -481,26 +483,26 @@ if __name__ == '__main__': enc, enctag = c.encrypt(pt, iv, aad=aad) - print 'enc:', enc.encode('hex') - print ' ct:', ct.encode('hex') + print('enc:', enc.encode('hex')) + print(' ct:', ct.encode('hex')) assert enc == ct - print 'etg:', enctag.encode('hex') - print 'tag:', tag.encode('hex') + print('etg:', enctag.encode('hex')) + print('tag:', tag.encode('hex')) assert enctag == tag # Make sure we get EBADMSG #enctag = enctag[:-1] + 'a' dec, dectag = c.decrypt(ct, iv, aad=aad, tag=enctag) - print 'dec:', dec.encode('hex') - print ' pt:', pt.encode('hex') + print('dec:', dec.encode('hex')) + print(' pt:', pt.encode('hex')) assert dec == pt - print 'dtg:', dectag.encode('hex') - print 'tag:', tag.encode('hex') + print('dtg:', dectag.encode('hex')) + print('tag:', tag.encode('hex')) assert dectag == tag elif False: @@ -517,13 +519,13 @@ if __name__ == '__main__': enc, enctag = c.encrypt(pt, iv, aad=aad) - print 'enc:', enc.encode('hex') - print ' ct:', ct.encode('hex') + print('enc:', enc.encode('hex')) + print(' ct:', ct.encode('hex')) assert enc == ct - print 'etg:', enctag.encode('hex') - print 'tag:', tag.encode('hex') + print('etg:', enctag.encode('hex')) + print('tag:', tag.encode('hex')) assert enctag == tag elif False: for i in xrange(100000): @@ -550,9 +552,9 @@ if __name__ == '__main__': else: key = '1bbfeadf539daedcae33ced497343f3ca1f2474ad932b903997d44707db41382'.decode('hex') - print 'XTS %d testing:' % (len(key) * 8) + print('XTS %d testing:' % (len(key) * 8)) c = Crypto(CRYPTO_AES_XTS, key) for i in [ 8192, 192*1024]: - print 'block size: %d' % i + print('block size: %d' % i) c.perftest(COP_ENCRYPT, i) c.perftest(COP_DECRYPT, i) Modified: projects/runtime-coverage/tests/sys/opencrypto/cryptotest.py ============================================================================== --- projects/runtime-coverage/tests/sys/opencrypto/cryptotest.py Sat Sep 23 19:49:12 2017 (r323958) +++ projects/runtime-coverage/tests/sys/opencrypto/cryptotest.py Sun Sep 24 00:07:18 2017 (r323959) @@ -29,6 +29,7 @@ # $FreeBSD$ # +from __future__ import print_function import cryptodev import itertools import os @@ -57,17 +58,17 @@ def GenTestCase(cname): ############### ##### AES ##### ############### - @unittest.skipIf(cname not in aesmodules, 'skipping AES on %s' % `cname`) + @unittest.skipIf(cname not in aesmodules, 'skipping AES on %s' % (cname)) def test_xts(self): for i in katg('XTSTestVectors/format tweak value input - data unit seq no', '*.rsp'): self.runXTS(i, cryptodev.CRYPTO_AES_XTS) - @unittest.skipIf(cname not in aesmodules, 'skipping AES on %s' % `cname`) + @unittest.skipIf(cname not in aesmodules, 'skipping AES on %s' % (cname)) def test_cbc(self): for i in katg('KAT_AES', 'CBC[GKV]*.rsp'): self.runCBC(i) - @unittest.skipIf(cname not in aesmodules, 'skipping AES on %s' % `cname`) + @unittest.skipIf(cname not in aesmodules, 'skipping AES on %s' % (cname)) def test_gcm(self): for i in katg('gcmtestvectors', 'gcmEncrypt*'): self.runGCM(i, 'ENCRYPT') @@ -88,7 +89,7 @@ def GenTestCase(cname): swapptct = True curfun = Crypto.decrypt else: - raise RuntimeError('unknown mode: %s' % `mode`) + raise RuntimeError('unknown mode: %r' % repr(mode)) for bogusmode, lines in cryptodev.KATParser(fname, [ 'Count', 'Key', 'IV', 'CT', 'AAD', 'Tag', 'PT', ]): @@ -116,8 +117,8 @@ def GenTestCase(cname): rtag = rtag[:len(tag)] data['rct'] = rct.encode('hex') data['rtag'] = rtag.encode('hex') - self.assertEqual(rct, ct, `data`) - self.assertEqual(rtag, tag, `data`) + self.assertEqual(rct, ct, repr(data)) + self.assertEqual(rtag, tag, repr(data)) else: if len(tag) != 16: continue @@ -130,7 +131,7 @@ def GenTestCase(cname): data['rpt'] = rpt.encode('hex') data['rtag'] = rtag.encode('hex') self.assertEqual(rpt, pt, - `data`) + repr(data)) def runCBC(self, fname): curfun = None @@ -143,7 +144,7 @@ def GenTestCase(cname): swapptct = True curfun = Crypto.decrypt else: - raise RuntimeError('unknown mode: %s' % `mode`) + raise RuntimeError('unknown mode: %r' % repr(mode)) for data in lines: curcnt = int(data['COUNT']) @@ -171,7 +172,7 @@ def GenTestCase(cname): swapptct = True curfun = Crypto.decrypt else: - raise RuntimeError('unknown mode: %s' % `mode`) + raise RuntimeError('unknown mode: %r' % repr(mode)) for data in lines: curcnt = int(data['COUNT']) @@ -194,7 +195,7 @@ def GenTestCase(cname): ############### ##### DES ##### ############### - @unittest.skipIf(cname not in desmodules, 'skipping DES on %s' % `cname`) + @unittest.skipIf(cname not in desmodules, 'skipping DES on %s' % (cname)) def test_tdes(self): for i in katg('KAT_TDES', 'TCBC[a-z]*.rsp'): self.runTDES(i) @@ -210,7 +211,7 @@ def GenTestCase(cname): swapptct = True curfun = Crypto.decrypt else: - raise RuntimeError('unknown mode: %s' % `mode`) + raise RuntimeError('unknown mode: %r' % repr(mode)) for data in lines: curcnt = int(data['COUNT']) @@ -230,14 +231,14 @@ def GenTestCase(cname): ############### ##### SHA ##### ############### - @unittest.skipIf(cname not in shamodules, 'skipping SHA on %s' % `cname`) + @unittest.skipIf(cname not in shamodules, 'skipping SHA on %s' % str(cname)) def test_sha(self): # SHA not available in software pass #for i in iglob('SHA1*'): # self.runSHA(i) - @unittest.skipIf(cname not in shamodules, 'skipping SHA on %s' % `cname`) + @unittest.skipIf(cname not in shamodules, 'skipping SHA on %s' % str(cname)) def test_sha1hmac(self): for i in katg('hmactestvectors', 'HMAC.rsp'): self.runSHA1HMAC(i) From owner-svn-src-projects@freebsd.org Sun Sep 24 19:48:49 2017 Return-Path: Delivered-To: svn-src-projects@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CF6F5E2EBAF for ; Sun, 24 Sep 2017 19:48:49 +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 7ED59988; Sun, 24 Sep 2017 19:48:49 +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 v8OJmm43010888; Sun, 24 Sep 2017 19:48:48 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v8OJmkSb010864; Sun, 24 Sep 2017 19:48:46 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201709241948.v8OJmkSb010864@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sun, 24 Sep 2017 19:48:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r323975 - in projects/runtime-coverage: contrib/one-true-awk share/man/man4 share/misc share/mk sys/arm/broadcom/bcm2835 sys/arm/conf sys/arm/freescale/imx sys/arm/ti sys/contrib/ipfilt... X-SVN-Group: projects X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: in projects/runtime-coverage: contrib/one-true-awk share/man/man4 share/misc share/mk sys/arm/broadcom/bcm2835 sys/arm/conf sys/arm/freescale/imx sys/arm/ti sys/contrib/ipfilter/netinet sys/dev/mpr sy... X-SVN-Commit-Revision: 323975 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Sep 2017 19:48:49 -0000 Author: ngie Date: Sun Sep 24 19:48:46 2017 New Revision: 323975 URL: https://svnweb.freebsd.org/changeset/base/323975 Log: MFhead@r323974 Deleted: projects/runtime-coverage/sys/arm/conf/VIRT Modified: projects/runtime-coverage/contrib/one-true-awk/lib.c projects/runtime-coverage/contrib/one-true-awk/run.c projects/runtime-coverage/share/man/man4/mpr.4 projects/runtime-coverage/share/man/man4/mps.4 projects/runtime-coverage/share/misc/committers-src.dot projects/runtime-coverage/share/mk/bsd.lib.mk projects/runtime-coverage/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c projects/runtime-coverage/sys/arm/conf/GENERIC projects/runtime-coverage/sys/arm/freescale/imx/files.imx6 projects/runtime-coverage/sys/arm/ti/ti_sdhci.c projects/runtime-coverage/sys/contrib/ipfilter/netinet/ip_nat.c projects/runtime-coverage/sys/dev/mpr/mpr.c projects/runtime-coverage/sys/dev/mps/mps.c projects/runtime-coverage/sys/dev/sdhci/fsl_sdhci.c projects/runtime-coverage/sys/dev/sdhci/sdhci.c projects/runtime-coverage/sys/dev/sdhci/sdhci.h projects/runtime-coverage/sys/dev/sdhci/sdhci_pci.c projects/runtime-coverage/sys/dev/ti/if_ti.c projects/runtime-coverage/sys/fs/nfsclient/nfs_clcomsubs.c projects/runtime-coverage/sys/vm/vm_page.c projects/runtime-coverage/sys/vm/vm_page.h projects/runtime-coverage/tools/tools/nanobsd/defaults.sh projects/runtime-coverage/usr.bin/calendar/calendars/calendar.freebsd Directory Properties: projects/runtime-coverage/ (props changed) projects/runtime-coverage/contrib/one-true-awk/ (props changed) projects/runtime-coverage/sys/contrib/ipfilter/ (props changed) Modified: projects/runtime-coverage/contrib/one-true-awk/lib.c ============================================================================== --- projects/runtime-coverage/contrib/one-true-awk/lib.c Sun Sep 24 19:43:31 2017 (r323974) +++ projects/runtime-coverage/contrib/one-true-awk/lib.c Sun Sep 24 19:48:46 2017 (r323975) @@ -62,6 +62,7 @@ void recinit(unsigned int n) || (fldtab = (Cell **) malloc((nfields+1) * sizeof(Cell *))) == NULL || (fldtab[0] = (Cell *) malloc(sizeof(Cell))) == NULL ) FATAL("out of space for $0 and fields"); + *record = '\0'; *fldtab[0] = dollar0; fldtab[0]->sval = record; fldtab[0]->nval = tostring("0"); @@ -616,7 +617,7 @@ void eprint(void) /* try to print context around error static int been_here = 0; extern char ebuf[], *ep; - if (compile_time == 2 || compile_time == 0 || been_here++ > 0) + if (compile_time == 2 || compile_time == 0 || been_here++ > 0 || ebuf == ep) return; p = ep - 1; if (p > ebuf && *p == '\n') Modified: projects/runtime-coverage/contrib/one-true-awk/run.c ============================================================================== --- projects/runtime-coverage/contrib/one-true-awk/run.c Sun Sep 24 19:43:31 2017 (r323974) +++ projects/runtime-coverage/contrib/one-true-awk/run.c Sun Sep 24 19:48:46 2017 (r323975) @@ -918,7 +918,7 @@ int format(char **pbuf, int *pbufsize, const char *s, break; case 'c': if (isnum(x)) { - if (getfval(x)) + if ((int)getfval(x)) sprintf(p, fmt, (int) getfval(x)); else { *p++ = '\0'; /* explicit null byte */ Modified: projects/runtime-coverage/share/man/man4/mpr.4 ============================================================================== --- projects/runtime-coverage/share/man/man4/mpr.4 Sun Sep 24 19:43:31 2017 (r323974) +++ projects/runtime-coverage/share/man/man4/mpr.4 Sun Sep 24 19:48:46 2017 (r323975) @@ -337,31 +337,41 @@ dev.mpr.X.use_phy_num The same set of values are valid as when setting this tunable for all adapters. .Pp .Sh DEBUGGING -To enable debugging prints from the -.Nm -driver, set the -.Bd -literal -offset indent -hw.mpr.X.debug_level -.Ed -.Pp -tunable, either in +Driver diagnostic printing is controlled in .Xr loader.conf 5 -or by using -.Xr sysctl 8 . -These bits have the described effects: -.Bd -literal -offset indent -0x0001 Enable informational prints (set by default). -0x0002 Enable prints for driver faults (set by default). -0x0004 Enable prints for controller events. -0x0008 Enable prints for controller logging. -0x0010 Enable prints for tracing recovery operations. -0x0020 Enable prints for parameter errors and programming bugs. -0x0040 Enable prints for system initialization operations. -0x0080 Enable prints for more detailed information. -0x0100 Enable prints for user-generated commands (IOCTL). -0x0200 Enable prints for device mapping. -0x0400 Enable prints for tracing through driver functions. -.Ed +by using the global +.Va hw.mpr.debug_level +and per-device +.Va dev.mpr.X.debug_level +tunables. +One can alter the debug level for any adapter at run-time using the +.Xr sysctl 8 +variable +.Va dev.mpr.X.debug_level . +.Pp +All +.Va debug_level +variables can be named by either an integer value or a text string. +Multiple values can be specified together by either ORing the +integer values or by providing a comma-separated list of names. +The current +.Va debug_level +status is reported in both formats for convenience. +The following levels are available: +.Bl -column "FlagXX" "NameXXXX" "Description" -offset indent +.It Em Flag Ta Em Name Ta Em Description +.It 0x0001 Ta info Ta Basic information (enabled by default) +.It 0x0002 Ta fault Ta Driver faults (enabled by default) +.It 0x0004 Ta event Ta Controller events +.It 0x0008 Ta log Ta Logging data from controller +.It 0x0010 Ta recovery Ta Tracing of recovery operations +.It 0x0020 Ta error Ta Parameter errors and programming bugs +.It 0x0040 Ta init Ta System initialization operations +.It 0x0080 Ta xinfo Ta More detailed information +.It 0x0100 Ta user Ta Tracing of user-generated commands (IOCTL) +.It 0x0200 Ta mapping Ta Tracing of device mapping +.It 0x0400 Ta trace Ta Tracing through driver functions +.El .Sh SEE ALSO .Xr cam 4 , .Xr cd 4 , Modified: projects/runtime-coverage/share/man/man4/mps.4 ============================================================================== --- projects/runtime-coverage/share/man/man4/mps.4 Sun Sep 24 19:43:31 2017 (r323974) +++ projects/runtime-coverage/share/man/man4/mps.4 Sun Sep 24 19:48:46 2017 (r323975) @@ -313,31 +313,41 @@ dev.mps.X.use_phy_num The same set of values are valid as when setting this tunable for all adapters. .Pp .Sh DEBUGGING -To enable debugging prints from the -.Nm -driver, set the -.Bd -literal -offset indent -hw.mps.X.debug_level -.Ed -.Pp -tunable, either in +Driver diagnostic printing is controlled in .Xr loader.conf 5 -or by using -.Xr sysctl 8 . -These bits have the described effects: -.Bd -literal -offset indent -0x0001 Enable informational prints (set by default). -0x0002 Enable prints for driver faults (set by default). -0x0004 Enable prints for controller events. -0x0008 Enable prints for controller logging. -0x0010 Enable prints for tracing recovery operations. -0x0020 Enable prints for parameter errors and programming bugs. -0x0040 Enable prints for system initialization operations. -0x0080 Enable prints for more detailed information. -0x0100 Enable prints for user-generated commands (IOCTL). -0x0200 Enable prints for device mapping. -0x0400 Enable prints for tracing through driver functions. -.Ed +by using the global +.Va hw.mps.debug_level +and per-device +.Va dev.mps.X.debug_level +tunables. +One can alter the debug level for any adapter at run-time using the +.Xr sysctl 8 +variable +.Va dev.mps.X.debug_level . +.Pp +All +.Va debug_level +variables can be named by either an integer value or a text string. +Multiple values can be specified together by either ORing the +integer values or by providing a comma-separated list of names. +The current +.Va debug_level +status is reported in both formats for convenience. +The following levels are available: +.Bl -column "FlagXX" "NameXXXX" "Description" -offset indent +.It Em Flag Ta Em Name Ta Em Description +.It 0x0001 Ta info Ta Basic information (enabled by default) +.It 0x0002 Ta fault Ta Driver faults (enabled by default) +.It 0x0004 Ta event Ta Controller events +.It 0x0008 Ta log Ta Logging data from controller +.It 0x0010 Ta recovery Ta Tracing of recovery operations +.It 0x0020 Ta error Ta Parameter errors and programming bugs +.It 0x0040 Ta init Ta System initialization operations +.It 0x0080 Ta xinfo Ta More detailed information +.It 0x0100 Ta user Ta Tracing of user-generated commands (IOCTL) +.It 0x0200 Ta mapping Ta Tracing of device mapping +.It 0x0400 Ta trace Ta Tracing through driver functions +.El .Sh SEE ALSO .Xr cam 4 , .Xr cd 4 , Modified: projects/runtime-coverage/share/misc/committers-src.dot ============================================================================== --- projects/runtime-coverage/share/misc/committers-src.dot Sun Sep 24 19:43:31 2017 (r323974) +++ projects/runtime-coverage/share/misc/committers-src.dot Sun Sep 24 19:48:46 2017 (r323975) @@ -167,6 +167,7 @@ fabient [label="Fabien Thomas\nfabient@FreeBSD.org\n20 fanf [label="Tony Finch\nfanf@FreeBSD.org\n2002/05/05"] fjoe [label="Max Khon\nfjoe@FreeBSD.org\n2001/08/06"] flz [label="Florent Thoumie\nflz@FreeBSD.org\n2006/03/30"] +fsu [label="Fedor Uporov\nfsu@FreeBSD.org\n2017/08/28"] gabor [label="Gabor Kovesdan\ngabor@FreeBSD.org\n2010/02/02"] gad [label="Garance A. Drosehn\ngad@FreeBSD.org\n2000/10/27"] gallatin [label="Andrew Gallatin\ngallatin@FreeBSD.org\n1999/01/15"] @@ -689,6 +690,8 @@ obrien -> groudier obrien -> gshapiro obrien -> kan obrien -> sam + +pfg -> fsu peter -> asmodai peter -> jayanth Modified: projects/runtime-coverage/share/mk/bsd.lib.mk ============================================================================== --- projects/runtime-coverage/share/mk/bsd.lib.mk Sun Sep 24 19:43:31 2017 (r323974) +++ projects/runtime-coverage/share/mk/bsd.lib.mk Sun Sep 24 19:48:46 2017 (r323975) @@ -311,7 +311,11 @@ ${SHLIB_NAME}.debug: ${SHLIB_NAME_FULL} .if defined(INSTALL_PIC_ARCHIVE) && defined(LIB) && !empty(LIB) && ${MK_TOOLCHAIN} != "no" _LIBS+= lib${LIB_PRIVATE}${LIB}_pic.a +.if ${MK_COVERAGE} != "no" lib${LIB_PRIVATE}${LIB}_pic.a: ${SPOBJS} +.else +lib${LIB_PRIVATE}${LIB}_pic.a: ${SOBJS} +.endif @${ECHO} building special pic ${LIB} library @rm -f ${.TARGET} ${AR} ${ARFLAGS} ${.TARGET} ${SPOBJS} ${ARADD} Modified: projects/runtime-coverage/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c ============================================================================== --- projects/runtime-coverage/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c Sun Sep 24 19:43:31 2017 (r323974) +++ projects/runtime-coverage/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c Sun Sep 24 19:48:46 2017 (r323975) @@ -255,11 +255,7 @@ bcm_sdhci_attach(device_t dev) bus_generic_probe(dev); bus_generic_attach(dev); -#ifdef MMCCAM - sdhci_cam_start_slot(&sc->sc_slot); -#else sdhci_start_slot(&sc->sc_slot); -#endif return (0); Modified: projects/runtime-coverage/sys/arm/conf/GENERIC ============================================================================== --- projects/runtime-coverage/sys/arm/conf/GENERIC Sun Sep 24 19:43:31 2017 (r323974) +++ projects/runtime-coverage/sys/arm/conf/GENERIC Sun Sep 24 19:48:46 2017 (r323975) @@ -40,11 +40,13 @@ files "../allwinner/a83t/files.a83t" files "../allwinner/h3/files.h3" files "../broadcom/bcm2835/files.bcm2836" files "../broadcom/bcm2835/files.bcm283x" +files "../freescale/imx/files.imx6" files "../nvidia/tegra124/files.tegra124" files "../qemu/files.qemu" files "../ti/files.ti" files "../ti/am335x/files.am335x" files "../ti/omap4/files.omap4" +files "../xilinx/files.zynq7" options SOC_ALLWINNER_A10 options SOC_ALLWINNER_A13 @@ -116,6 +118,7 @@ device pty device snp device md # Memory "disks" device random # Entropy device +device firmware # firmware assist module device pl310 # PL310 L2 cache controller device psci @@ -128,6 +131,7 @@ device p2wi # Allwinner Push-Pull Two Wire device axp209 # AXP209 Power Management Unit device axp81x # AXP813/818 Power Management Unit device bcm2835_bsc +device fsliic # Freescale i2c/iic device icee # AT24Cxxx and compatible EEPROMs device sy8106a # SY8106A Buck Regulator device ti_i2c @@ -171,6 +175,7 @@ device ti_adc # reboot automatically because the boot loader might have enabled the # watchdog. device ti_wdt +device imxwdt # Watchdog. WARNING: can't be disabled!!! device scbus # SCSI bus (required for ATA/SCSI) device da # Direct Access (disks) @@ -186,6 +191,7 @@ device ehci device dwcotg # DWC OTG controller device musb +device axe # USB-Ethernet device umass # Disks/Mass storage - Requires scbus and da device uhid # "Human Interface Devices" device ukbd # Allow keyboard like HIDs to control console @@ -205,8 +211,10 @@ device miibus device awg # 10/100/1000 integrated EMAC controller device cpsw # TI Common Platform Ethernet Switch (CPSW) +device cgem # Zynq-7000 gig ethernet device device dwc # 10/100/1000 integrated GMAC controller device emac # 10/100 integrated EMAC controller +device ffec # Freescale Fast Ethernet Controller device smsc # SMSC LAN91C111 # Sound support @@ -230,6 +238,7 @@ device ti_pruss device ti_mbox # DMA controller +device fslsdma device ti_sdma # Extensible Firmware Interface @@ -237,4 +246,4 @@ options EFI # Flattened Device Tree options FDT # Configure using FDT/DTB data -makeoptions MODULES_EXTRA="dtb/allwinner dtb/am335x dtb/nvidia dtb/rpi dtb/omap4" +makeoptions MODULES_EXTRA="dtb/allwinner dtb/am335x dtb/imx6 dtb/nvidia dtb/rpi dtb/zynq dtb/omap4" Modified: projects/runtime-coverage/sys/arm/freescale/imx/files.imx6 ============================================================================== --- projects/runtime-coverage/sys/arm/freescale/imx/files.imx6 Sun Sep 24 19:43:31 2017 (r323974) +++ projects/runtime-coverage/sys/arm/freescale/imx/files.imx6 Sun Sep 24 19:48:46 2017 (r323975) @@ -22,7 +22,7 @@ arm/freescale/imx/imx_machdep.c standard arm/freescale/imx/imx_gpt.c optional imx_gpt arm/freescale/imx/imx_gpio.c optional gpio arm/freescale/imx/imx_i2c.c optional fsliic -arm/freescale/imx/imx6_sdma.c optional sdma +arm/freescale/imx/imx6_sdma.c optional fslsdma arm/freescale/imx/imx6_audmux.c optional sound arm/freescale/imx/imx6_ssi.c optional sound arm/freescale/imx/imx6_ahci.c optional ahci Modified: projects/runtime-coverage/sys/arm/ti/ti_sdhci.c ============================================================================== --- projects/runtime-coverage/sys/arm/ti/ti_sdhci.c Sun Sep 24 19:43:31 2017 (r323974) +++ projects/runtime-coverage/sys/arm/ti/ti_sdhci.c Sun Sep 24 19:48:46 2017 (r323975) @@ -683,11 +683,7 @@ ti_sdhci_attach(device_t dev) bus_generic_probe(dev); bus_generic_attach(dev); -#ifdef MMCCAM - sdhci_cam_start_slot(&sc->slot); -#else sdhci_start_slot(&sc->slot); -#endif return (0); fail: Modified: projects/runtime-coverage/sys/contrib/ipfilter/netinet/ip_nat.c ============================================================================== --- projects/runtime-coverage/sys/contrib/ipfilter/netinet/ip_nat.c Sun Sep 24 19:43:31 2017 (r323974) +++ projects/runtime-coverage/sys/contrib/ipfilter/netinet/ip_nat.c Sun Sep 24 19:48:46 2017 (r323975) @@ -6093,7 +6093,7 @@ ipf_nat_icmpquerytype(icmptype) { case ICMP_ECHOREPLY: case ICMP_ECHO: - /* route advertisement/soliciation is currently unsupported: */ + /* route advertisement/solicitation is currently unsupported: */ /* it would require rewriting the ICMP data section */ case ICMP_TSTAMP: case ICMP_TSTAMPREPLY: Modified: projects/runtime-coverage/sys/dev/mpr/mpr.c ============================================================================== --- projects/runtime-coverage/sys/dev/mpr/mpr.c Sun Sep 24 19:43:31 2017 (r323974) +++ projects/runtime-coverage/sys/dev/mpr/mpr.c Sun Sep 24 19:48:46 2017 (r323975) @@ -55,6 +55,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -105,6 +106,9 @@ static int mpr_reregister_events(struct mpr_softc *sc) static void mpr_enqueue_request(struct mpr_softc *sc, struct mpr_command *cm); static int mpr_get_iocfacts(struct mpr_softc *sc, MPI2_IOC_FACTS_REPLY *facts); static int mpr_wait_db_ack(struct mpr_softc *sc, int timeout, int sleep_flag); +static int mpr_debug_sysctl(SYSCTL_HANDLER_ARGS); +static void mpr_parse_debug(struct mpr_softc *sc, char *list); + SYSCTL_NODE(_hw, OID_AUTO, mpr, CTLFLAG_RD, 0, "MPR Driver Parameters"); MALLOC_DEFINE(M_MPR, "mpr", "mpr driver memory"); @@ -1591,7 +1595,7 @@ mpr_init_queues(struct mpr_softc *sc) void mpr_get_tunables(struct mpr_softc *sc) { - char tmpstr[80]; + char tmpstr[80], mpr_debug[80]; /* XXX default to some debugging for now */ sc->mpr_debug = MPR_INFO | MPR_FAULT; @@ -1611,7 +1615,9 @@ mpr_get_tunables(struct mpr_softc *sc) /* * Grab the global variables. */ - TUNABLE_INT_FETCH("hw.mpr.debug_level", &sc->mpr_debug); + bzero(mpr_debug, 80); + if (TUNABLE_STR_FETCH("hw.mpr.debug_level", mpr_debug, 80) != 0) + mpr_parse_debug(sc, mpr_debug); TUNABLE_INT_FETCH("hw.mpr.disable_msix", &sc->disable_msix); TUNABLE_INT_FETCH("hw.mpr.disable_msi", &sc->disable_msi); TUNABLE_INT_FETCH("hw.mpr.max_msix", &sc->max_msix); @@ -1628,7 +1634,9 @@ mpr_get_tunables(struct mpr_softc *sc) /* Grab the unit-instance variables */ snprintf(tmpstr, sizeof(tmpstr), "dev.mpr.%d.debug_level", device_get_unit(sc->mpr_dev)); - TUNABLE_INT_FETCH(tmpstr, &sc->mpr_debug); + bzero(mpr_debug, 80); + if (TUNABLE_STR_FETCH(tmpstr, mpr_debug, 80) != 0) + mpr_parse_debug(sc, mpr_debug); snprintf(tmpstr, sizeof(tmpstr), "dev.mpr.%d.disable_msix", device_get_unit(sc->mpr_dev)); @@ -1714,9 +1722,9 @@ mpr_setup_sysctl(struct mpr_softc *sc) sysctl_tree = sc->sysctl_tree; } - SYSCTL_ADD_INT(sysctl_ctx, SYSCTL_CHILDREN(sysctl_tree), - OID_AUTO, "debug_level", CTLFLAG_RW, &sc->mpr_debug, 0, - "mpr debug level"); + SYSCTL_ADD_PROC(sysctl_ctx, SYSCTL_CHILDREN(sysctl_tree), + OID_AUTO, "debug_level", CTLTYPE_STRING | CTLFLAG_RW, sc, 0, + mpr_debug_sysctl, "A", "mpr debug level"); SYSCTL_ADD_INT(sysctl_ctx, SYSCTL_CHILDREN(sysctl_tree), OID_AUTO, "disable_msix", CTLFLAG_RD, &sc->disable_msix, 0, @@ -1807,6 +1815,104 @@ mpr_setup_sysctl(struct mpr_softc *sc) SYSCTL_ADD_UQUAD(sysctl_ctx, SYSCTL_CHILDREN(sysctl_tree), OID_AUTO, "prp_page_alloc_fail", CTLFLAG_RD, &sc->prp_page_alloc_fail, "PRP page allocation failures"); +} + +static struct mpr_debug_string { + char *name; + int flag; +} mpr_debug_strings[] = { + {"info", MPR_INFO}, + {"fault", MPR_FAULT}, + {"event", MPR_EVENT}, + {"log", MPR_LOG}, + {"recovery", MPR_RECOVERY}, + {"error", MPR_ERROR}, + {"init", MPR_INIT}, + {"xinfo", MPR_XINFO}, + {"user", MPR_USER}, + {"mapping", MPR_MAPPING}, + {"trace", MPR_TRACE} +}; + +static int +mpr_debug_sysctl(SYSCTL_HANDLER_ARGS) +{ + struct mpr_softc *sc; + struct mpr_debug_string *string; + struct sbuf sbuf; + char *buffer; + size_t sz; + int i, len, debug, error; + + sc = (struct mpr_softc *)arg1; + + error = sysctl_wire_old_buffer(req, 0); + if (error != 0) + return (error); + + sbuf_new_for_sysctl(&sbuf, NULL, 128, req); + debug = sc->mpr_debug; + + sbuf_printf(&sbuf, "%#x", debug); + + sz = sizeof(mpr_debug_strings) / sizeof(mpr_debug_strings[0]); + for (i = 0; i < sz; i++) { + string = &mpr_debug_strings[i]; + if (debug & string->flag) + sbuf_printf(&sbuf, ",%s", string->name); + } + + error = sbuf_finish(&sbuf); + sbuf_delete(&sbuf); + + if (error || req->newptr == NULL) + return (error); + + len = req->newlen - req->newidx; + if (len == 0) + return (0); + + buffer = malloc(len, M_MPR, M_ZERO|M_WAITOK); + error = SYSCTL_IN(req, buffer, len); + + mpr_parse_debug(sc, buffer); + + free(buffer, M_MPR); + return (error); +} + +static void +mpr_parse_debug(struct mpr_softc *sc, char *list) +{ + struct mpr_debug_string *string; + char *token, *endtoken; + size_t sz; + int flags, i; + + if (list == NULL || *list == '\0') + return; + + flags = 0; + sz = sizeof(mpr_debug_strings) / sizeof(mpr_debug_strings[0]); + while ((token = strsep(&list, ":,")) != NULL) { + + /* Handle integer flags */ + flags |= strtol(token, &endtoken, 0); + if (token != endtoken) + continue; + + /* Handle text flags */ + for (i = 0; i < sz; i++) { + string = &mpr_debug_strings[i]; + if (strcasecmp(token, string->name) == 0) { + flags |= string->flag; + break; + } + } + } + + sc->mpr_debug = flags; + return; } int Modified: projects/runtime-coverage/sys/dev/mps/mps.c ============================================================================== --- projects/runtime-coverage/sys/dev/mps/mps.c Sun Sep 24 19:43:31 2017 (r323974) +++ projects/runtime-coverage/sys/dev/mps/mps.c Sun Sep 24 19:48:46 2017 (r323975) @@ -56,6 +56,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -102,6 +103,9 @@ static int mps_reregister_events(struct mps_softc *sc) static void mps_enqueue_request(struct mps_softc *sc, struct mps_command *cm); static int mps_get_iocfacts(struct mps_softc *sc, MPI2_IOC_FACTS_REPLY *facts); static int mps_wait_db_ack(struct mps_softc *sc, int timeout, int sleep_flag); +static int mps_debug_sysctl(SYSCTL_HANDLER_ARGS); +static void mps_parse_debug(struct mps_softc *sc, char *list); + SYSCTL_NODE(_hw, OID_AUTO, mps, CTLFLAG_RD, 0, "MPS Driver Parameters"); MALLOC_DEFINE(M_MPT2, "mps", "mpt2 driver memory"); @@ -1452,7 +1456,7 @@ mps_init_queues(struct mps_softc *sc) void mps_get_tunables(struct mps_softc *sc) { - char tmpstr[80]; + char tmpstr[80], mps_debug[80]; /* XXX default to some debugging for now */ sc->mps_debug = MPS_INFO|MPS_FAULT; @@ -1472,7 +1476,9 @@ mps_get_tunables(struct mps_softc *sc) /* * Grab the global variables. */ - TUNABLE_INT_FETCH("hw.mps.debug_level", &sc->mps_debug); + bzero(mps_debug, 80); + if (TUNABLE_STR_FETCH("hw.mps.debug_level", mps_debug, 80) != 0) + mps_parse_debug(sc, mps_debug); TUNABLE_INT_FETCH("hw.mps.disable_msix", &sc->disable_msix); TUNABLE_INT_FETCH("hw.mps.disable_msi", &sc->disable_msi); TUNABLE_INT_FETCH("hw.mps.max_msix", &sc->max_msix); @@ -1489,7 +1495,9 @@ mps_get_tunables(struct mps_softc *sc) /* Grab the unit-instance variables */ snprintf(tmpstr, sizeof(tmpstr), "dev.mps.%d.debug_level", device_get_unit(sc->mps_dev)); - TUNABLE_INT_FETCH(tmpstr, &sc->mps_debug); + bzero(mps_debug, 80); + if (TUNABLE_STR_FETCH(tmpstr, mps_debug, 80) != 0) + mps_parse_debug(sc, mps_debug); snprintf(tmpstr, sizeof(tmpstr), "dev.mps.%d.disable_msix", device_get_unit(sc->mps_dev)); @@ -1576,9 +1584,9 @@ mps_setup_sysctl(struct mps_softc *sc) sysctl_tree = sc->sysctl_tree; } - SYSCTL_ADD_INT(sysctl_ctx, SYSCTL_CHILDREN(sysctl_tree), - OID_AUTO, "debug_level", CTLFLAG_RW, &sc->mps_debug, 0, - "mps debug level"); + SYSCTL_ADD_PROC(sysctl_ctx, SYSCTL_CHILDREN(sysctl_tree), + OID_AUTO, "debug_level", CTLTYPE_STRING | CTLFLAG_RW, sc, 0, + mps_debug_sysctl, "A", "mps debug level"); SYSCTL_ADD_INT(sysctl_ctx, SYSCTL_CHILDREN(sysctl_tree), OID_AUTO, "disable_msix", CTLFLAG_RD, &sc->disable_msix, 0, @@ -1669,6 +1677,104 @@ mps_setup_sysctl(struct mps_softc *sc) SYSCTL_ADD_INT(sysctl_ctx, SYSCTL_CHILDREN(sysctl_tree), OID_AUTO, "use_phy_num", CTLFLAG_RD, &sc->use_phynum, 0, "Use the phy number for enumeration"); +} + +struct mps_debug_string { + char *name; + int flag; +} mps_debug_strings[] = { + {"info", MPS_INFO}, + {"fault", MPS_FAULT}, + {"event", MPS_EVENT}, + {"log", MPS_LOG}, + {"recovery", MPS_RECOVERY}, + {"error", MPS_ERROR}, + {"init", MPS_INIT}, + {"xinfo", MPS_XINFO}, + {"user", MPS_USER}, + {"mapping", MPS_MAPPING}, + {"trace", MPS_TRACE} +}; + +static int +mps_debug_sysctl(SYSCTL_HANDLER_ARGS) +{ + struct mps_softc *sc; + struct mps_debug_string *string; + struct sbuf sbuf; + char *buffer; + size_t sz; + int i, len, debug, error; + + sc = (struct mps_softc *)arg1; + + error = sysctl_wire_old_buffer(req, 0); + if (error != 0) + return (error); + + sbuf_new_for_sysctl(&sbuf, NULL, 128, req); + debug = sc->mps_debug; + + sbuf_printf(&sbuf, "%#x", debug); + + sz = sizeof(mps_debug_strings) / sizeof(mps_debug_strings[0]); + for (i = 0; i < sz; i++) { + string = &mps_debug_strings[i]; + if (debug & string->flag) + sbuf_printf(&sbuf, ",%s", string->name); + } + + error = sbuf_finish(&sbuf); + sbuf_delete(&sbuf); + + if (error || req->newptr == NULL) + return (error); + + len = req->newlen - req->newidx; + if (len == 0) + return (0); + + buffer = malloc(len, M_MPT2, M_ZERO|M_WAITOK); + error = SYSCTL_IN(req, buffer, len); + + mps_parse_debug(sc, buffer); + + free(buffer, M_MPT2); + return (error); +} + +static void +mps_parse_debug(struct mps_softc *sc, char *list) +{ + struct mps_debug_string *string; + char *token, *endtoken; + size_t sz; + int flags, i; + + if (list == NULL || *list == '\0') + return; + + flags = 0; + sz = sizeof(mps_debug_strings) / sizeof(mps_debug_strings[0]); + while ((token = strsep(&list, ":,")) != NULL) { + + /* Handle integer flags */ + flags |= strtol(token, &endtoken, 0); + if (token != endtoken) + continue; + + /* Handle text flags */ + for (i = 0; i < sz; i++) { + string = &mps_debug_strings[i]; + if (strcasecmp(token, string->name) == 0) { + flags |= string->flag; + break; + } + } + } + + sc->mps_debug = flags; + return; } int Modified: projects/runtime-coverage/sys/dev/sdhci/fsl_sdhci.c ============================================================================== --- projects/runtime-coverage/sys/dev/sdhci/fsl_sdhci.c Sun Sep 24 19:43:31 2017 (r323974) +++ projects/runtime-coverage/sys/dev/sdhci/fsl_sdhci.c Sun Sep 24 19:48:46 2017 (r323975) @@ -913,11 +913,7 @@ fsl_sdhci_attach(device_t dev) bus_generic_probe(dev); bus_generic_attach(dev); -#ifdef MMCCAM - sdhci_cam_start_slot(&sc->slot); -#else sdhci_start_slot(&sc->slot); -#endif return (0); Modified: projects/runtime-coverage/sys/dev/sdhci/sdhci.c ============================================================================== --- projects/runtime-coverage/sys/dev/sdhci/sdhci.c Sun Sep 24 19:43:31 2017 (r323974) +++ projects/runtime-coverage/sys/dev/sdhci/sdhci.c Sun Sep 24 19:48:46 2017 (r323975) @@ -1051,12 +1051,14 @@ no_tuning: return (0); } +#ifndef MMCCAM void sdhci_start_slot(struct sdhci_slot *slot) { sdhci_card_task(slot, 0); } +#endif int sdhci_cleanup_slot(struct sdhci_slot *slot) @@ -2383,7 +2385,7 @@ sdhci_generic_write_ivar(device_t bus, device_t child, #ifdef MMCCAM void -sdhci_cam_start_slot(struct sdhci_slot *slot) +sdhci_start_slot(struct sdhci_slot *slot) { if ((slot->devq = cam_simq_alloc(1)) == NULL) { goto fail; Modified: projects/runtime-coverage/sys/dev/sdhci/sdhci.h ============================================================================== --- projects/runtime-coverage/sys/dev/sdhci/sdhci.h Sun Sep 24 19:43:31 2017 (r323974) +++ projects/runtime-coverage/sys/dev/sdhci/sdhci.h Sun Sep 24 19:48:46 2017 (r323975) @@ -430,9 +430,4 @@ bool sdhci_generic_get_card_present(device_t brdev, st void sdhci_generic_set_uhs_timing(device_t brdev, struct sdhci_slot *slot); void sdhci_handle_card_present(struct sdhci_slot *slot, bool is_present); -#ifdef MMCCAM -/* CAM-related */ -void sdhci_cam_start_slot(struct sdhci_slot *slot); -#endif - #endif /* __SDHCI_H__ */ Modified: projects/runtime-coverage/sys/dev/sdhci/sdhci_pci.c ============================================================================== --- projects/runtime-coverage/sys/dev/sdhci/sdhci_pci.c Sun Sep 24 19:43:31 2017 (r323974) +++ projects/runtime-coverage/sys/dev/sdhci/sdhci_pci.c Sun Sep 24 19:48:46 2017 (r323975) @@ -395,11 +395,7 @@ sdhci_pci_attach(device_t dev) pci_enable_busmaster(dev); /* Process cards detection. */ for (i = 0; i < sc->num_slots; i++) { -#ifdef MMCCAM - sdhci_cam_start_slot(&sc->slots[i]); -#else sdhci_start_slot(&sc->slots[i]); -#endif } return (0); Modified: projects/runtime-coverage/sys/dev/ti/if_ti.c ============================================================================== --- projects/runtime-coverage/sys/dev/ti/if_ti.c Sun Sep 24 19:43:31 2017 (r323974) +++ projects/runtime-coverage/sys/dev/ti/if_ti.c Sun Sep 24 19:48:46 2017 (r323975) @@ -1621,7 +1621,7 @@ ti_newbuf_jumbo(struct ti_softc *sc, int idx, struct m } sf[i] = sf_buf_alloc(frame, SFB_NOWAIT); if (sf[i] == NULL) { - vm_page_unwire(frame, PQ_INACTIVE); + vm_page_unwire(frame, PQ_NONE); vm_page_free(frame); device_printf(sc->ti_dev, "buffer allocation " "failed -- packet dropped!\n"); Modified: projects/runtime-coverage/sys/fs/nfsclient/nfs_clcomsubs.c ============================================================================== --- projects/runtime-coverage/sys/fs/nfsclient/nfs_clcomsubs.c Sun Sep 24 19:43:31 2017 (r323974) +++ projects/runtime-coverage/sys/fs/nfsclient/nfs_clcomsubs.c Sun Sep 24 19:48:46 2017 (r323975) @@ -344,7 +344,7 @@ nfsm_uiombuflist(struct uio *uiop, int siz, struct mbu struct mbuf *mp, *mp2, *firstmp; int xfer, left, mlen; int uiosiz, clflg, rem; - char *cp, *tcp; + char *tcp; KASSERT(uiop->uio_iovcnt == 1, ("nfsm_uiotombuf: iovcnt != 1")); @@ -396,19 +396,7 @@ nfsm_uiombuflist(struct uio *uiop, int siz, struct mbu uiop->uio_iov->iov_len -= uiosiz; siz -= uiosiz; } - if (rem > 0) { - if (rem > M_TRAILINGSPACE(mp)) { - NFSMGET(mp); - mbuf_setlen(mp, 0); - mbuf_setnext(mp2, mp); - } - cp = NFSMTOD(mp, caddr_t) + mbuf_len(mp); - for (left = 0; left < rem; left++) - *cp++ = '\0'; - mbuf_setlen(mp, mbuf_len(mp) + rem); - if (cpp != NULL) - *cpp = cp; - } else if (cpp != NULL) + if (cpp != NULL) *cpp = NFSMTOD(mp, caddr_t) + mbuf_len(mp); if (mbp != NULL) *mbp = mp; Modified: projects/runtime-coverage/sys/vm/vm_page.c ============================================================================== --- projects/runtime-coverage/sys/vm/vm_page.c Sun Sep 24 19:43:31 2017 (r323974) +++ projects/runtime-coverage/sys/vm/vm_page.c Sun Sep 24 19:48:46 2017 (r323975) @@ -3081,23 +3081,25 @@ vm_page_unswappable(vm_page_t m) * vm_page_try_to_free() * * Attempt to free the page. If we cannot free it, we do nothing. - * 1 is returned on success, 0 on failure. + * true is returned on success, false on failure. */ -int +bool vm_page_try_to_free(vm_page_t m) { - vm_page_lock_assert(m, MA_OWNED); + vm_page_assert_locked(m); if (m->object != NULL) VM_OBJECT_ASSERT_WLOCKED(m->object); - if (m->dirty || m->hold_count || m->wire_count || + if (m->dirty != 0 || m->hold_count != 0 || m->wire_count != 0 || (m->oflags & VPO_UNMANAGED) != 0 || vm_page_busied(m)) - return (0); - pmap_remove_all(m); - if (m->dirty) - return (0); + return (false); + if (m->object != NULL && m->object->ref_count != 0) { + pmap_remove_all(m); + if (m->dirty != 0) + return (false); + } vm_page_free(m); - return (1); + return (true); } /* Modified: projects/runtime-coverage/sys/vm/vm_page.h ============================================================================== --- projects/runtime-coverage/sys/vm/vm_page.h Sun Sep 24 19:43:31 2017 (r323974) +++ projects/runtime-coverage/sys/vm/vm_page.h Sun Sep 24 19:48:46 2017 (r323975) @@ -477,7 +477,6 @@ void vm_page_change_lock(vm_page_t m, struct mtx **mtx vm_page_t vm_page_grab (vm_object_t, vm_pindex_t, int); int vm_page_grab_pages(vm_object_t object, vm_pindex_t pindex, int allocflags, vm_page_t *ma, int count); -int vm_page_try_to_free (vm_page_t); void vm_page_deactivate (vm_page_t); void vm_page_deactivate_noreuse(vm_page_t); void vm_page_dequeue(vm_page_t m); @@ -513,6 +512,7 @@ void vm_page_set_valid_range(vm_page_t m, int base, in int vm_page_sleep_if_busy(vm_page_t m, const char *msg); vm_offset_t vm_page_startup(vm_offset_t vaddr); void vm_page_sunbusy(vm_page_t m); +bool vm_page_try_to_free(vm_page_t m); int vm_page_trysbusy(vm_page_t m); void vm_page_unhold_pages(vm_page_t *ma, int count); void vm_page_unswappable(vm_page_t m); Modified: projects/runtime-coverage/tools/tools/nanobsd/defaults.sh ============================================================================== --- projects/runtime-coverage/tools/tools/nanobsd/defaults.sh Sun Sep 24 19:43:31 2017 (r323974) +++ projects/runtime-coverage/tools/tools/nanobsd/defaults.sh Sun Sep 24 19:48:46 2017 (r323975) @@ -749,7 +749,7 @@ cust_install_files ( ) ( cust_pkgng ( ) ( mkdir -p ${NANO_WORLDDIR}/usr/local/etc local PKG_CONF="${NANO_WORLDDIR}/usr/local/etc/pkg.conf" - local PKGCMD="env ASSUME_ALWAYS_YES=YES PKG_DBDIR=${NANO_PKG_META_BASE}/pkg SIGNATURE_TYPE=none /usr/sbin/pkg" + local PKGCMD="env BATCH=YES ASSUME_ALWAYS_YES=YES PKG_DBDIR=${NANO_PKG_META_BASE}/pkg SIGNATURE_TYPE=none /usr/sbin/pkg" # Ensure pkg.conf points pkg to where the package meta data lives. touch ${PKG_CONF} Modified: projects/runtime-coverage/usr.bin/calendar/calendars/calendar.freebsd ============================================================================== --- projects/runtime-coverage/usr.bin/calendar/calendars/calendar.freebsd Sun Sep 24 19:43:31 2017 (r323974) +++ projects/runtime-coverage/usr.bin/calendar/calendars/calendar.freebsd Sun Sep 24 19:48:46 2017 (r323975) @@ -419,6 +419,7 @@ 11/23 Luca Pizzamiglio born in Casalpusterlengo, Italy, 1978 11/24 Andrey Zakhvatov born in Chelyabinsk, Russian Federation, 1974 11/24 Daniel Gerzo born in Bratislava, Slovakia, 1986 +11/25 Fedor Uporov born in Yalta, Crimea, USSR, 1988 11/28 Nik Clayton born in Peterborough, United Kingdom, 1973 11/28 Stanislav Sedov born in Chelyabinsk, USSR, 1985 12/01 Hajimu Umemoto born in Nara, Japan, 1961 From owner-svn-src-projects@freebsd.org Sun Sep 24 19:53:19 2017 Return-Path: Delivered-To: svn-src-projects@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 21646E2ECF7 for ; Sun, 24 Sep 2017 19:53:19 +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 DDED6D09; Sun, 24 Sep 2017 19:53: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 v8OJrHPU014856; Sun, 24 Sep 2017 19:53:17 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v8OJrH7C014855; Sun, 24 Sep 2017 19:53:17 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201709241953.v8OJrH7C014855@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sun, 24 Sep 2017 19:53:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r323976 - projects/runtime-coverage/etc/mtree X-SVN-Group: projects X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: projects/runtime-coverage/etc/mtree X-SVN-Commit-Revision: 323976 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Sep 2017 19:53:19 -0000 Author: ngie Date: Sun Sep 24 19:53:17 2017 New Revision: 323976 URL: https://svnweb.freebsd.org/changeset/base/323976 Log: Re-add BSD.coverage.dist install This was an accidental mismerge in r321458 (MFC from ^/head) Modified: projects/runtime-coverage/etc/mtree/Makefile Modified: projects/runtime-coverage/etc/mtree/Makefile ============================================================================== --- projects/runtime-coverage/etc/mtree/Makefile Sun Sep 24 19:48:46 2017 (r323975) +++ projects/runtime-coverage/etc/mtree/Makefile Sun Sep 24 19:53:17 2017 (r323976) @@ -15,6 +15,9 @@ FILES= \ BSD.usr.dist \ BSD.var.dist +.if ${MK_COVERAGE} != "no" +_BSD.coverage.dist= BSD.coverage.dist +.endif .if ${MK_LIB32} != "no" _BSD.lib32.dist= BSD.lib32.dist .endif From owner-svn-src-projects@freebsd.org Sun Sep 24 20:16:39 2017 Return-Path: Delivered-To: svn-src-projects@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5499DE002FC for ; Sun, 24 Sep 2017 20:16:39 +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 2256E19C1; Sun, 24 Sep 2017 20:16:39 +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 v8OKGcmU023128; Sun, 24 Sep 2017 20:16:38 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v8OKGcLU023127; Sun, 24 Sep 2017 20:16:38 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201709242016.v8OKGcLU023127@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sun, 24 Sep 2017 20:16:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r323979 - projects/runtime-coverage/share/mk X-SVN-Group: projects X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: projects/runtime-coverage/share/mk X-SVN-Commit-Revision: 323979 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Sep 2017 20:16:39 -0000 Author: ngie Date: Sun Sep 24 20:16:38 2017 New Revision: 323979 URL: https://svnweb.freebsd.org/changeset/base/323979 Log: Unbreak pic library link/compilation when MK_COVERAGE == no Use a separate variable (PIC_OBJS) for the objects that should be in a pic-enabled static library. This unbreaks libexec/rtld-elf compilation when MK_COVERAGE == no. Modified: projects/runtime-coverage/share/mk/bsd.lib.mk Modified: projects/runtime-coverage/share/mk/bsd.lib.mk ============================================================================== --- projects/runtime-coverage/share/mk/bsd.lib.mk Sun Sep 24 20:05:48 2017 (r323978) +++ projects/runtime-coverage/share/mk/bsd.lib.mk Sun Sep 24 20:16:38 2017 (r323979) @@ -312,13 +312,15 @@ ${SHLIB_NAME}.debug: ${SHLIB_NAME_FULL} _LIBS+= lib${LIB_PRIVATE}${LIB}_pic.a .if ${MK_COVERAGE} != "no" -lib${LIB_PRIVATE}${LIB}_pic.a: ${SPOBJS} +PIC_OBJS= ${SPOBJS} .else -lib${LIB_PRIVATE}${LIB}_pic.a: ${SOBJS} +PIC_OBJS= ${SOBJS} .endif + +lib${LIB_PRIVATE}${LIB}_pic.a: ${PIC_OBJS} @${ECHO} building special pic ${LIB} library @rm -f ${.TARGET} - ${AR} ${ARFLAGS} ${.TARGET} ${SPOBJS} ${ARADD} + ${AR} ${ARFLAGS} ${.TARGET} ${PIC_OBJS} ${ARADD} ${RANLIB} ${RANLIBFLAGS} ${.TARGET} .endif From owner-svn-src-projects@freebsd.org Tue Sep 26 20:26:50 2017 Return-Path: Delivered-To: svn-src-projects@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E8882E208B1 for ; Tue, 26 Sep 2017 20:26:50 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 91BE07500D; Tue, 26 Sep 2017 20:26:50 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v8QKQnMN034585; Tue, 26 Sep 2017 20:26:49 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v8QKQnci034575; Tue, 26 Sep 2017 20:26:49 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201709262026.v8QKQnci034575@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Tue, 26 Sep 2017 20:26:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r324025 - in projects/pnfs-planb-server-stable11/sys/fs: nfs nfsclient nfsserver X-SVN-Group: projects X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: in projects/pnfs-planb-server-stable11/sys/fs: nfs nfsclient nfsserver X-SVN-Commit-Revision: 324025 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Sep 2017 20:26:51 -0000 Author: rmacklem Date: Tue Sep 26 20:26:48 2017 New Revision: 324025 URL: https://svnweb.freebsd.org/changeset/base/324025 Log: Add support for Flex File Layout to the client. This patch does not change the pNFS server, but adds Flex File Layout support to the NFSv4.1 client. I have done this to the stable/11 branch so that others can test more easily. This patch will go into head/current as a bunch of smaller commits. As such, it will eventually be merged from head into pnfs-planb-server. Modified: projects/pnfs-planb-server-stable11/sys/fs/nfs/nfs.h projects/pnfs-planb-server-stable11/sys/fs/nfs/nfs_commonsubs.c projects/pnfs-planb-server-stable11/sys/fs/nfs/nfs_var.h projects/pnfs-planb-server-stable11/sys/fs/nfs/nfscl.h projects/pnfs-planb-server-stable11/sys/fs/nfs/nfsclstate.h projects/pnfs-planb-server-stable11/sys/fs/nfs/nfsport.h projects/pnfs-planb-server-stable11/sys/fs/nfsclient/nfs_clcomsubs.c projects/pnfs-planb-server-stable11/sys/fs/nfsclient/nfs_clrpcops.c projects/pnfs-planb-server-stable11/sys/fs/nfsclient/nfs_clstate.c projects/pnfs-planb-server-stable11/sys/fs/nfsserver/nfs_nfsdport.c Modified: projects/pnfs-planb-server-stable11/sys/fs/nfs/nfs.h ============================================================================== --- projects/pnfs-planb-server-stable11/sys/fs/nfs/nfs.h Tue Sep 26 20:23:09 2017 (r324024) +++ projects/pnfs-planb-server-stable11/sys/fs/nfs/nfs.h Tue Sep 26 20:26:48 2017 (r324025) @@ -192,9 +192,11 @@ struct nfsd_nfsd_args { * (To support more than 1000 DSs on an MDS, this needs to be increased.) * NFSDEV_MAXMIRRORS - Maximum # of mirrors for a DS. * (Most will only have a single mirror, but this setting allows up to 3.) + * NFSDEV_MAXVERS - maximum number of NFS versions supported by Flex File. */ #define NFSDEV_MIRRORSTR 3 #define NFSDEV_MAXMIRRORS 4 +#define NFSDEV_MAXVERS 4 /* Old version. */ struct nfsd_nfsd_oargs { Modified: projects/pnfs-planb-server-stable11/sys/fs/nfs/nfs_commonsubs.c ============================================================================== --- projects/pnfs-planb-server-stable11/sys/fs/nfs/nfs_commonsubs.c Tue Sep 26 20:23:09 2017 (r324024) +++ projects/pnfs-planb-server-stable11/sys/fs/nfs/nfs_commonsubs.c Tue Sep 26 20:26:48 2017 (r324025) @@ -4025,14 +4025,13 @@ newnfs_sndunlock(int *flagp) } APPLESTATIC int -nfsv4_getipaddr(struct nfsrv_descript *nd, struct sockaddr_storage *sa, - int *isudp) +nfsv4_getipaddr(struct nfsrv_descript *nd, struct sockaddr_in *sin, + struct sockaddr_in6 *sin6, sa_family_t *saf, int *isudp) { - struct sockaddr_in *sad; - struct sockaddr_in6 *sad6; struct in_addr saddr; uint32_t portnum, *tl; - int af = 0, i, j, k; + int i, j, k; + sa_family_t af = AF_UNSPEC; char addr[64], protocol[5], *cp; int cantparse = 0, error = 0; uint16_t portv; @@ -4110,20 +4109,20 @@ nfsv4_getipaddr(struct nfsrv_descript *nd, struct sock cantparse = 1; if (cantparse == 0) { if (af == AF_INET) { - sad = (struct sockaddr_in *)sa; - if (inet_pton(af, addr, &sad->sin_addr) == 1) { - sad->sin_len = sizeof(*sad); - sad->sin_family = AF_INET; - sad->sin_port = htons(portv); + if (inet_pton(af, addr, &sin->sin_addr) == 1) { + sin->sin_len = sizeof(*sin); + sin->sin_family = AF_INET; + sin->sin_port = htons(portv); + *saf = af; return (0); } } else { - sad6 = (struct sockaddr_in6 *)sa; - if (inet_pton(af, addr, &sad6->sin6_addr) + if (inet_pton(af, addr, &sin6->sin6_addr) == 1) { - sad6->sin6_len = sizeof(*sad6); - sad6->sin6_family = AF_INET6; - sad6->sin6_port = htons(portv); + sin6->sin6_len = sizeof(*sin6); + sin6->sin6_family = AF_INET6; + sin6->sin6_port = htons(portv); + *saf = af; return (0); } } Modified: projects/pnfs-planb-server-stable11/sys/fs/nfs/nfs_var.h ============================================================================== --- projects/pnfs-planb-server-stable11/sys/fs/nfs/nfs_var.h Tue Sep 26 20:23:09 2017 (r324024) +++ projects/pnfs-planb-server-stable11/sys/fs/nfs/nfs_var.h Tue Sep 26 20:26:48 2017 (r324025) @@ -311,8 +311,8 @@ void nfsrv_cleanusergroup(void); int nfsrv_checkutf8(u_int8_t *, int); int newnfs_sndlock(int *); void newnfs_sndunlock(int *); -int nfsv4_getipaddr(struct nfsrv_descript *, struct sockaddr_storage *, - int *); +int nfsv4_getipaddr(struct nfsrv_descript *, struct sockaddr_in *, + struct sockaddr_in6 *, sa_family_t *, int *); int nfsv4_seqsession(uint32_t, uint32_t, uint32_t, struct nfsslot *, struct mbuf **, uint16_t); void nfsv4_seqsess_cacherep(uint32_t, struct nfsslot *, int, struct mbuf **); @@ -325,8 +325,9 @@ struct ucred *nfsrv_getgrpscred(struct ucred *); /* nfs_clcomsubs.c */ void nfsm_uiombuf(struct nfsrv_descript *, struct uio *, int); +struct mbuf *nfsm_uiombuflist(struct uio *, int, struct mbuf **, char **); void nfscl_reqstart(struct nfsrv_descript *, int, struct nfsmount *, - u_int8_t *, int, u_int32_t **, struct nfsclsession *); + u_int8_t *, int, u_int32_t **, struct nfsclsession *, int, int); nfsuint64 *nfscl_getcookie(struct nfsnode *, off_t off, int); void nfscl_fillsattr(struct nfsrv_descript *, struct vattr *, vnode_t, int, u_int32_t); @@ -502,17 +503,14 @@ int nfsrpc_destroysession(struct nfsmount *, struct nf struct ucred *, NFSPROC_T *); int nfsrpc_destroyclient(struct nfsmount *, struct nfsclclient *, struct ucred *, NFSPROC_T *); -int nfsrpc_layoutget(struct nfsmount *, uint8_t *, int, int, uint64_t, uint64_t, - uint64_t, int, nfsv4stateid_t *, int *, struct nfsclflayouthead *, - struct ucred *, NFSPROC_T *, void *); int nfsrpc_getdeviceinfo(struct nfsmount *, uint8_t *, int, uint32_t *, struct nfscldevinfo **, struct ucred *, NFSPROC_T *); int nfsrpc_layoutcommit(struct nfsmount *, uint8_t *, int, int, - uint64_t, uint64_t, uint64_t, nfsv4stateid_t *, int, int, uint8_t *, - struct ucred *, NFSPROC_T *, void *); -int nfsrpc_layoutreturn(struct nfsmount *, uint8_t *, int, int, int, uint32_t, - int, uint64_t, uint64_t, nfsv4stateid_t *, int, uint32_t *, struct ucred *, + uint64_t, uint64_t, uint64_t, nfsv4stateid_t *, int, struct ucred *, NFSPROC_T *, void *); +int nfsrpc_layoutreturn(struct nfsmount *, uint8_t *, int, int, int, uint32_t, + int, uint64_t, uint64_t, nfsv4stateid_t *, struct ucred *, NFSPROC_T *, + void *); int nfsrpc_reclaimcomplete(struct nfsmount *, struct ucred *, NFSPROC_T *); int nfscl_doiods(vnode_t, struct uio *, int *, int *, uint32_t, int, struct ucred *, NFSPROC_T *); @@ -581,7 +579,7 @@ int nfscl_tryclose(struct nfsclopen *, struct ucred *, struct nfsmount *, NFSPROC_T *); void nfscl_cleanup(NFSPROC_T *); int nfscl_layout(struct nfsmount *, vnode_t, u_int8_t *, int, nfsv4stateid_t *, - int, struct nfsclflayouthead *, struct nfscllayout **, struct ucred *, + int, int, struct nfsclflayouthead *, struct nfscllayout **, struct ucred *, NFSPROC_T *); struct nfscllayout *nfscl_getlayout(struct nfsclclient *, uint8_t *, int, uint64_t, struct nfsclflayout **, int *); Modified: projects/pnfs-planb-server-stable11/sys/fs/nfs/nfscl.h ============================================================================== --- projects/pnfs-planb-server-stable11/sys/fs/nfs/nfscl.h Tue Sep 26 20:23:09 2017 (r324024) +++ projects/pnfs-planb-server-stable11/sys/fs/nfs/nfscl.h Tue Sep 26 20:26:48 2017 (r324025) @@ -49,7 +49,8 @@ struct nfsv4node { */ #define NFSCL_REQSTART(n, p, v) \ nfscl_reqstart((n), (p), VFSTONFS((v)->v_mount), \ - VTONFS(v)->n_fhp->nfh_fh, VTONFS(v)->n_fhp->nfh_len, NULL, NULL) + VTONFS(v)->n_fhp->nfh_fh, VTONFS(v)->n_fhp->nfh_len, NULL, \ + NULL, 0, 0) /* * These two macros convert between a lease duration and renew interval. Modified: projects/pnfs-planb-server-stable11/sys/fs/nfs/nfsclstate.h ============================================================================== --- projects/pnfs-planb-server-stable11/sys/fs/nfs/nfsclstate.h Tue Sep 26 20:23:09 2017 (r324024) +++ projects/pnfs-planb-server-stable11/sys/fs/nfs/nfsclstate.h Tue Sep 26 20:26:48 2017 (r324025) @@ -258,9 +258,24 @@ struct nfscllayout { #define NFSLY_RECALLALL 0x0040 #define NFSLY_RETONCLOSE 0x0080 #define NFSLY_WRITTEN 0x0100 /* Has been used to write to a DS. */ +#define NFSLY_FLEXFILE 0x0200 /* - * MALLOC'd to the correct length to accommodate the file handle list. + * Flex file layout mirror specific stuff for nfsclflayout. + */ +struct nfsffm { + nfsv4stateid_t st; + char dev[NFSX_V4DEVICEID]; + uint32_t eff; + uid_t user; + gid_t group; + struct nfsfh *fh[NFSDEV_MAXVERS]; + uint16_t fhcnt; +}; + +/* + * MALLOC'd to the correct length to accommodate the file handle list for File + * layout and the list of mirrors for the Flex File Layout. * These hang off of nfsly_flayread and nfsly_flayrw, sorted in increasing * offset order. * The nfsly_flayread list holds the ones with iomode == NFSLAYOUTIOMODE_READ, @@ -268,23 +283,49 @@ struct nfscllayout { */ struct nfsclflayout { LIST_ENTRY(nfsclflayout) nfsfl_list; - uint8_t nfsfl_dev[NFSX_V4DEVICEID]; uint64_t nfsfl_off; uint64_t nfsfl_end; - uint64_t nfsfl_patoff; - struct nfscldevinfo *nfsfl_devp; uint32_t nfsfl_iomode; - uint32_t nfsfl_util; - uint32_t nfsfl_stripe1; + struct nfscldevinfo *nfsfl_devp; uint16_t nfsfl_flags; - uint16_t nfsfl_fhcnt; - struct nfsfh *nfsfl_fh[1]; /* FH list for DS */ + union { + struct { + uint64_t patoff; + uint32_t util; + uint32_t stripe1; + uint8_t dev[NFSX_V4DEVICEID]; + uint16_t fhcnt; + } fl; + struct { + uint64_t stripeunit; + uint32_t fflags; + uint32_t statshint; + uint16_t mirrorcnt; + } ff; + } nfsfl_un; + union { + struct nfsfh *fh[0]; /* FH list for DS File layout */ + struct nfsffm ffm[0]; /* Mirror list for Flex File */ + } nfsfl_un2; /* Must be last. Malloc'd to correct array length */ }; +#define nfsfl_patoff nfsfl_un.fl.patoff +#define nfsfl_util nfsfl_un.fl.util +#define nfsfl_stripe1 nfsfl_un.fl.stripe1 +#define nfsfl_dev nfsfl_un.fl.dev +#define nfsfl_fhcnt nfsfl_un.fl.fhcnt +#define nfsfl_stripeunit nfsfl_un.ff.stripeunit +#define nfsfl_fflags nfsfl_un.ff.fflags +#define nfsfl_statshint nfsfl_un.ff.statshint +#define nfsfl_mirrorcnt nfsfl_un.ff.mirrorcnt +#define nfsfl_fh nfsfl_un2.fh +#define nfsfl_ffm nfsfl_un2.ffm /* * Flags for nfsfl_flags. */ #define NFSFL_RECALL 0x0001 /* File layout has been recalled */ +#define NFSFL_FILE 0x0002 /* File layout */ +#define NFSFL_FLEXFILE 0x0004 /* Flex File layout */ /* * Structure that is used to store a LAYOUTRECALL. @@ -306,6 +347,7 @@ struct nfsclrecalllayout { * - stripe indices, each stored as one byte, since there can be many * of them. (This implies a limit of 256 on nfsdi_addrcnt, since the * indices select which address.) + * For Flex File, the addrcnt is always one and no stripe indices exist. */ struct nfscldevinfo { LIST_ENTRY(nfscldevinfo) nfsdi_list; @@ -313,10 +355,33 @@ struct nfscldevinfo { struct nfsclclient *nfsdi_clp; uint32_t nfsdi_refcnt; uint32_t nfsdi_layoutrefs; - uint16_t nfsdi_stripecnt; + union { + struct { + uint16_t stripecnt; + } fl; + struct { + int versindex; + uint32_t vers; + uint32_t minorvers; + uint32_t rsize; + uint32_t wsize; + } ff; + } nfsdi_un; uint16_t nfsdi_addrcnt; + uint16_t nfsdi_flags; struct nfsclds *nfsdi_data[0]; }; +#define nfsdi_stripecnt nfsdi_un.fl.stripecnt +#define nfsdi_versindex nfsdi_un.ff.versindex +#define nfsdi_vers nfsdi_un.ff.vers +#define nfsdi_minorvers nfsdi_un.ff.minorvers +#define nfsdi_rsize nfsdi_un.ff.rsize +#define nfsdi_wsize nfsdi_un.ff.wsize + +/* Flags for nfsdi_flags. */ +#define NFSDI_FILELAYOUT 0x0001 +#define NFSDI_FLEXFILE 0x0002 +#define NFSDI_TIGHTCOUPLED 0X0004 /* These inline functions return values from nfsdi_data[]. */ /* Modified: projects/pnfs-planb-server-stable11/sys/fs/nfs/nfsport.h ============================================================================== --- projects/pnfs-planb-server-stable11/sys/fs/nfs/nfsport.h Tue Sep 26 20:23:09 2017 (r324024) +++ projects/pnfs-planb-server-stable11/sys/fs/nfs/nfsport.h Tue Sep 26 20:26:48 2017 (r324025) @@ -921,6 +921,7 @@ int newnfs_realign(struct mbuf **, int); #define NFSSTA_HASWRITEVERF 0x00040000 /* Has write verifier */ #define NFSSTA_GOTFSINFO 0x00100000 /* Got the fsinfo */ #define NFSSTA_OPENMODE 0x00200000 /* Must use correct open mode */ +#define NFSSTA_FLEXFILE 0x00800000 /* Use Flex File Layout */ #define NFSSTA_NOLAYOUTCOMMIT 0x04000000 /* Don't do LayoutCommit */ #define NFSSTA_SESSPERSIST 0x08000000 /* Has a persistent session */ #define NFSSTA_TIMEO 0x10000000 /* Experiencing a timeout */ @@ -951,6 +952,7 @@ int newnfs_realign(struct mbuf **, int); #define NFSHASNOLAYOUTCOMMIT(n) ((n)->nm_state & NFSSTA_NOLAYOUTCOMMIT) #define NFSHASSESSPERSIST(n) ((n)->nm_state & NFSSTA_SESSPERSIST) #define NFSHASPNFS(n) ((n)->nm_state & NFSSTA_PNFS) +#define NFSHASFLEXFILE(n) ((n)->nm_state & NFSSTA_FLEXFILE) #define NFSHASOPENMODE(n) ((n)->nm_state & NFSSTA_OPENMODE) #define NFSHASONEOPENOWN(n) (((n)->nm_flag & NFSMNT_ONEOPENOWN) != 0 && \ (n)->nm_minorvers > 0) Modified: projects/pnfs-planb-server-stable11/sys/fs/nfsclient/nfs_clcomsubs.c ============================================================================== --- projects/pnfs-planb-server-stable11/sys/fs/nfsclient/nfs_clcomsubs.c Tue Sep 26 20:23:09 2017 (r324024) +++ projects/pnfs-planb-server-stable11/sys/fs/nfsclient/nfs_clcomsubs.c Tue Sep 26 20:26:48 2017 (r324025) @@ -131,7 +131,8 @@ static int nfs_bigrequest[NFSV41_NPROCS] = { */ APPLESTATIC void nfscl_reqstart(struct nfsrv_descript *nd, int procnum, struct nfsmount *nmp, - u_int8_t *nfhp, int fhlen, u_int32_t **opcntpp, struct nfsclsession *sep) + u_int8_t *nfhp, int fhlen, u_int32_t **opcntpp, struct nfsclsession *sep, + int vers, int minorvers) { struct mbuf *mb; u_int32_t *tl; @@ -142,14 +143,22 @@ nfscl_reqstart(struct nfsrv_descript *nd, int procnum, * First, fill in some of the fields of nd. */ nd->nd_slotseq = NULL; - if (NFSHASNFSV4(nmp)) { + if (vers == NFS_VER4) { nd->nd_flag = ND_NFSV4 | ND_NFSCL; - if (NFSHASNFSV4N(nmp)) + if (minorvers == NFSV41_MINORVERSION) nd->nd_flag |= ND_NFSV41; - } else if (NFSHASNFSV3(nmp)) + } else if (vers == NFS_VER3) nd->nd_flag = ND_NFSV3 | ND_NFSCL; - else - nd->nd_flag = ND_NFSV2 | ND_NFSCL; + else { + if (NFSHASNFSV4(nmp)) { + nd->nd_flag = ND_NFSV4 | ND_NFSCL; + if (NFSHASNFSV4N(nmp)) + nd->nd_flag |= ND_NFSV41; + } else if (NFSHASNFSV3(nmp)) + nd->nd_flag = ND_NFSV3 | ND_NFSCL; + else + nd->nd_flag = ND_NFSV2 | ND_NFSCL; + } nd->nd_procnum = procnum; nd->nd_repstat = 0; @@ -333,6 +342,77 @@ nfsm_uiombuf(struct nfsrv_descript *nd, struct uio *ui nd->nd_mb = mp; } #endif /* !APPLE */ + +/* + * copies a uio scatter/gather list to an mbuf chain. + * This version returns the mbuf list and does not use "nd". + * NOTE: can ony handle iovcnt == 1 + */ +struct mbuf * +nfsm_uiombuflist(struct uio *uiop, int siz, struct mbuf **mbp, char **cpp) +{ + char *uiocp; + struct mbuf *mp, *mp2, *firstmp; + int xfer, left, mlen; + int uiosiz, clflg, rem; + char *tcp; + + KASSERT(uiop->uio_iovcnt == 1, ("nfsm_uiotombuf: iovcnt != 1")); + + if (siz > ncl_mbuf_mlen) /* or should it >= MCLBYTES ?? */ + clflg = 1; + else + clflg = 0; + rem = NFSM_RNDUP(siz) - siz; + if (clflg != 0) + NFSMCLGET(mp, M_WAITOK); + else + NFSMGET(mp); + mbuf_setlen(mp, 0); + firstmp = mp2 = mp; + while (siz > 0) { + left = uiop->uio_iov->iov_len; + uiocp = uiop->uio_iov->iov_base; + if (left > siz) + left = siz; + uiosiz = left; + while (left > 0) { + mlen = M_TRAILINGSPACE(mp); + if (mlen == 0) { + if (clflg) + NFSMCLGET(mp, M_WAITOK); + else + NFSMGET(mp); + mbuf_setlen(mp, 0); + mbuf_setnext(mp2, mp); + mp2 = mp; + mlen = M_TRAILINGSPACE(mp); + } + xfer = (left > mlen) ? mlen : left; + if (uiop->uio_segflg == UIO_SYSSPACE) + NFSBCOPY(uiocp, NFSMTOD(mp, caddr_t) + + mbuf_len(mp), xfer); + else + copyin(uiocp, NFSMTOD(mp, caddr_t) + + mbuf_len(mp), xfer); + mbuf_setlen(mp, mbuf_len(mp) + xfer); + left -= xfer; + uiocp += xfer; + uiop->uio_offset += xfer; + uiop->uio_resid -= xfer; + } + tcp = (char *)uiop->uio_iov->iov_base; + tcp += uiosiz; + uiop->uio_iov->iov_base = (void *)tcp; + uiop->uio_iov->iov_len -= uiosiz; + siz -= uiosiz; + } + if (cpp != NULL) + *cpp = NFSMTOD(mp, caddr_t) + mbuf_len(mp); + if (mbp != NULL) + *mbp = mp; + return (firstmp); +} /* * Load vnode attributes from the xdr file attributes. Modified: projects/pnfs-planb-server-stable11/sys/fs/nfsclient/nfs_clrpcops.c ============================================================================== --- projects/pnfs-planb-server-stable11/sys/fs/nfsclient/nfs_clrpcops.c Tue Sep 26 20:23:09 2017 (r324024) +++ projects/pnfs-planb-server-stable11/sys/fs/nfsclient/nfs_clrpcops.c Tue Sep 26 20:26:48 2017 (r324025) @@ -109,25 +109,35 @@ static int nfsrpc_setaclrpc(vnode_t, struct ucred *, N static int nfsrpc_getlayout(struct nfsmount *, vnode_t, struct nfsfh *, int, uint32_t *, nfsv4stateid_t *, uint64_t, struct nfscllayout **, struct ucred *, NFSPROC_T *); -static int nfsrpc_fillsa(struct nfsmount *, struct sockaddr_storage *, - struct nfsclds **, NFSPROC_T *); +static int nfsrpc_fillsa(struct nfsmount *, struct sockaddr_in *, + struct sockaddr_in6 *, sa_family_t, int, struct nfsclds **, NFSPROC_T *); static void nfscl_initsessionslots(struct nfsclsession *); static int nfscl_doflayoutio(vnode_t, struct uio *, int *, int *, int *, nfsv4stateid_t *, int, struct nfscldevinfo *, struct nfscllayout *, struct nfsclflayout *, uint64_t, uint64_t, int, struct ucred *, NFSPROC_T *); +static int nfscl_dofflayoutio(vnode_t, struct uio *, int *, int *, int *, + nfsv4stateid_t *, int, struct nfscldevinfo *, struct nfscllayout *, + struct nfsclflayout *, uint64_t, uint64_t, int, int, struct mbuf *, + struct ucred *, NFSPROC_T *); +static struct mbuf *nfsm_copym(struct mbuf *, int, int); static int nfsrpc_readds(vnode_t, struct uio *, nfsv4stateid_t *, int *, - struct nfsclds *, uint64_t, int, struct nfsfh *, struct ucred *, - NFSPROC_T *); + struct nfsclds *, uint64_t, int, struct nfsfh *, int, int, int, + struct ucred *, NFSPROC_T *); static int nfsrpc_writeds(vnode_t, struct uio *, int *, int *, nfsv4stateid_t *, struct nfsclds *, uint64_t, int, - struct nfsfh *, int, struct ucred *, NFSPROC_T *); + struct nfsfh *, int, int, int, int, struct ucred *, NFSPROC_T *); +static int nfsrpc_writedsmir(vnode_t, int *, int *, nfsv4stateid_t *, + struct nfsclds *, uint64_t, int, struct nfsfh *, struct mbuf *, int, int, + struct ucred *, NFSPROC_T *); static enum nfsclds_state nfscl_getsameserver(struct nfsmount *, struct nfsclds *, struct nfsclds **); static int nfsrpc_commitds(vnode_t, uint64_t, int, struct nfsclds *, - struct nfsfh *, struct ucred *, NFSPROC_T *); + struct nfsfh *, int, int, struct ucred *, NFSPROC_T *); static void nfsrv_setuplayoutget(struct nfsrv_descript *, int, uint64_t, - uint64_t, uint64_t, nfsv4stateid_t *, int, int); + uint64_t, uint64_t, nfsv4stateid_t *, int, int, int); +static int nfsrv_parseug(struct nfsrv_descript *, int, uid_t *, gid_t *, + NFSPROC_T *); static int nfsrv_parselayoutget(struct nfsrv_descript *, nfsv4stateid_t *, int *, struct nfsclflayouthead *); static int nfsrpc_getopenlayout(struct nfsmount *, vnode_t, u_int8_t *, @@ -139,16 +149,19 @@ static int nfsrpc_getcreatelayout(vnode_t, char *, int struct nfsfh **, int *, int *, void *, int *); static int nfsrpc_openlayoutrpc(struct nfsmount *, vnode_t, u_int8_t *, int, uint8_t *, int, uint32_t, struct nfsclopen *, uint8_t *, int, - struct nfscldeleg **, nfsv4stateid_t *, int, int, int *, + struct nfscldeleg **, nfsv4stateid_t *, int, int, int, int *, struct nfsclflayouthead *, int *, struct ucred *, NFSPROC_T *); static int nfsrpc_createlayout(vnode_t, char *, int, struct vattr *, nfsquad_t, int, struct nfsclowner *, struct nfscldeleg **, struct ucred *, NFSPROC_T *, struct nfsvattr *, struct nfsvattr *, struct nfsfh **, int *, int *, void *, int *, nfsv4stateid_t *, - int, int, int *, struct nfsclflayouthead *, int *); + int, int, int, int *, struct nfsclflayouthead *, int *); +static int nfsrpc_layoutget(struct nfsmount *, uint8_t *, int, int, uint64_t, + uint64_t, uint64_t, int, int, nfsv4stateid_t *, int *, + struct nfsclflayouthead *, struct ucred *, NFSPROC_T *, void *); static int nfsrpc_layoutgetres(struct nfsmount *, vnode_t, uint8_t *, int, nfsv4stateid_t *, int, uint32_t *, struct nfscllayout **, - struct nfsclflayouthead *, int, int *, struct ucred *, NFSPROC_T *); + struct nfsclflayouthead *, int, int, int *, struct ucred *, NFSPROC_T *); /* * nfs null call from vfs. @@ -426,7 +439,7 @@ nfsrpc_openrpc(struct nfsmount *nmp, vnode_t vp, u_int dp = *dpp; *dpp = NULL; - nfscl_reqstart(nd, NFSPROC_OPEN, nmp, nfhp, fhlen, NULL, NULL); + nfscl_reqstart(nd, NFSPROC_OPEN, nmp, nfhp, fhlen, NULL, NULL, 0, 0); NFSM_BUILD(tl, u_int32_t *, 5 * NFSX_UNSIGNED); *tl++ = txdr_unsigned(op->nfso_own->nfsow_seqid); *tl++ = txdr_unsigned(mode & NFSV4OPEN_ACCESSBOTH); @@ -782,7 +795,7 @@ nfsrpc_closerpc(struct nfsrv_descript *nd, struct nfsm int error; nfscl_reqstart(nd, NFSPROC_CLOSE, nmp, op->nfso_fh, - op->nfso_fhlen, NULL, NULL); + op->nfso_fhlen, NULL, NULL, 0, 0); NFSM_BUILD(tl, u_int32_t *, NFSX_UNSIGNED + NFSX_STATEID); *tl++ = txdr_unsigned(op->nfso_own->nfsow_seqid); if (NFSHASNFSV4N(nmp)) @@ -824,7 +837,8 @@ nfsrpc_openconfirm(vnode_t vp, u_int8_t *nfhp, int fhl nmp = VFSTONFS(vnode_mount(vp)); if (NFSHASNFSV4N(nmp)) return (0); /* No confirmation for NFSv4.1. */ - nfscl_reqstart(nd, NFSPROC_OPENCONFIRM, nmp, nfhp, fhlen, NULL, NULL); + nfscl_reqstart(nd, NFSPROC_OPENCONFIRM, nmp, nfhp, fhlen, NULL, NULL, + 0, 0); NFSM_BUILD(tl, u_int32_t *, NFSX_UNSIGNED + NFSX_STATEID); *tl++ = op->nfso_stateid.seqid; *tl++ = op->nfso_stateid.other[0]; @@ -938,7 +952,7 @@ nfsrpc_setclient(struct nfsmount *nmp, struct nfsclcli tsep = NFSMNT_MDSSESSION(nmp); NFSUNLOCKMNT(nmp); - nfscl_reqstart(nd, NFSPROC_SETCLIENTID, nmp, NULL, 0, NULL, NULL); + nfscl_reqstart(nd, NFSPROC_SETCLIENTID, nmp, NULL, 0, NULL, NULL, 0, 0); NFSM_BUILD(tl, u_int32_t *, 2 * NFSX_UNSIGNED); *tl++ = txdr_unsigned(nfsboottime.tv_sec); *tl = txdr_unsigned(clp->nfsc_rev); @@ -1008,7 +1022,7 @@ nfsrpc_setclient(struct nfsmount *nmp, struct nfsclcli * and confirm it. */ nfscl_reqstart(nd, NFSPROC_SETCLIENTIDCFRM, nmp, NULL, 0, NULL, - NULL); + NULL, 0, 0); NFSM_BUILD(tl, u_int32_t *, 4 * NFSX_UNSIGNED); *tl++ = tsep->nfsess_clientid.lval[0]; *tl++ = tsep->nfsess_clientid.lval[1]; @@ -1023,7 +1037,7 @@ nfsrpc_setclient(struct nfsmount *nmp, struct nfsclcli nd->nd_mrep = NULL; if (nd->nd_repstat == 0) { nfscl_reqstart(nd, NFSPROC_GETATTR, nmp, nmp->nm_fh, - nmp->nm_fhsize, NULL, NULL); + nmp->nm_fhsize, NULL, NULL, 0, 0); NFSZERO_ATTRBIT(&attrbits); NFSSETBIT_ATTRBIT(&attrbits, NFSATTRBIT_LEASETIME); (void) nfsrv_putattrbit(nd, &attrbits); @@ -1090,7 +1104,7 @@ nfsrpc_getattrnovp(struct nfsmount *nmp, u_int8_t *fhp int error, vers = NFS_VER2; nfsattrbit_t attrbits; - nfscl_reqstart(nd, NFSPROC_GETATTR, nmp, fhp, fhlen, NULL, NULL); + nfscl_reqstart(nd, NFSPROC_GETATTR, nmp, fhp, fhlen, NULL, NULL, 0, 0); if (nd->nd_flag & ND_NFSV4) { vers = NFS_VER4; NFSGETATTR_ATTRBIT(&attrbits); @@ -3996,7 +4010,7 @@ nfsrpc_locku(struct nfsrv_descript *nd, struct nfsmoun int error; nfscl_reqstart(nd, NFSPROC_LOCKU, nmp, lp->nfsl_open->nfso_fh, - lp->nfsl_open->nfso_fhlen, NULL, NULL); + lp->nfsl_open->nfso_fhlen, NULL, NULL, 0, 0); NFSM_BUILD(tl, u_int32_t *, NFSX_STATEID + 6 * NFSX_UNSIGNED); *tl++ = txdr_unsigned(type); *tl = txdr_unsigned(lp->nfsl_seqid); @@ -4048,7 +4062,7 @@ nfsrpc_lock(struct nfsrv_descript *nd, struct nfsmount uint8_t own[NFSV4CL_LOCKNAMELEN + NFSX_V4FHMAX]; struct nfsclsession *tsep; - nfscl_reqstart(nd, NFSPROC_LOCK, nmp, nfhp, fhlen, NULL, NULL); + nfscl_reqstart(nd, NFSPROC_LOCK, nmp, nfhp, fhlen, NULL, NULL, 0, 0); NFSM_BUILD(tl, u_int32_t *, 7 * NFSX_UNSIGNED); if (type == F_RDLCK) *tl++ = txdr_unsigned(NFSV4LOCKT_READ); @@ -4321,10 +4335,11 @@ nfsrpc_renew(struct nfsclclient *clp, struct nfsclds * if (nmp == NULL) return (0); if (dsp == NULL) - nfscl_reqstart(nd, NFSPROC_RENEW, nmp, NULL, 0, NULL, NULL); + nfscl_reqstart(nd, NFSPROC_RENEW, nmp, NULL, 0, NULL, NULL, 0, + 0); else nfscl_reqstart(nd, NFSPROC_RENEW, nmp, NULL, 0, NULL, - &dsp->nfsclds_sess); + &dsp->nfsclds_sess, 0, 0); if (!NFSHASNFSV4N(nmp)) { /* NFSv4.1 just uses a Sequence Op and not a Renew. */ NFSM_BUILD(tl, u_int32_t *, 2 * NFSX_UNSIGNED); @@ -4368,11 +4383,11 @@ nfsrpc_rellockown(struct nfsmount *nmp, struct nfscllo if (NFSHASNFSV4N(nmp)) { /* For NFSv4.1, do a FreeStateID. */ nfscl_reqstart(nd, NFSPROC_FREESTATEID, nmp, NULL, 0, NULL, - NULL); + NULL, 0, 0); nfsm_stateidtom(nd, &lp->nfsl_stateid, NFSSTATEID_PUTSTATEID); } else { nfscl_reqstart(nd, NFSPROC_RELEASELCKOWN, nmp, NULL, 0, NULL, - NULL); + NULL, 0, 0); NFSM_BUILD(tl, u_int32_t *, 2 * NFSX_UNSIGNED); tsep = nfsmnt_mdssession(nmp); *tl++ = tsep->nfsess_clientid.lval[0]; @@ -4405,7 +4420,8 @@ nfsrpc_getdirpath(struct nfsmount *nmp, u_char *dirpat int error, cnt, len, setnil; u_int32_t *opcntp; - nfscl_reqstart(nd, NFSPROC_PUTROOTFH, nmp, NULL, 0, &opcntp, NULL); + nfscl_reqstart(nd, NFSPROC_PUTROOTFH, nmp, NULL, 0, &opcntp, NULL, 0, + 0); cp = dirpath; cnt = 0; do { @@ -4472,7 +4488,7 @@ nfsrpc_delegreturn(struct nfscldeleg *dp, struct ucred int error; nfscl_reqstart(nd, NFSPROC_DELEGRETURN, nmp, dp->nfsdl_fh, - dp->nfsdl_fhlen, NULL, NULL); + dp->nfsdl_fhlen, NULL, NULL, 0, 0); NFSM_BUILD(tl, u_int32_t *, NFSX_STATEID); if (NFSHASNFSV4N(nmp)) *tl++ = 0; @@ -4582,7 +4598,7 @@ nfsrpc_exchangeid(struct nfsmount *nmp, struct nfsclcl int error, len; *dspp = NULL; - nfscl_reqstart(nd, NFSPROC_EXCHANGEID, nmp, NULL, 0, NULL, NULL); + nfscl_reqstart(nd, NFSPROC_EXCHANGEID, nmp, NULL, 0, NULL, NULL, 0, 0); NFSM_BUILD(tl, uint32_t *, 2 * NFSX_UNSIGNED); *tl++ = txdr_unsigned(nfsboottime.tv_sec); /* Client owner */ *tl = txdr_unsigned(clp->nfsc_rev); @@ -4669,7 +4685,8 @@ nfsrpc_createsession(struct nfsmount *nmp, struct nfsc nmp->nm_rsize = NFS_MAXBSIZE; if (nmp->nm_wsize > NFS_MAXBSIZE || nmp->nm_wsize == 0) nmp->nm_wsize = NFS_MAXBSIZE; - nfscl_reqstart(nd, NFSPROC_CREATESESSION, nmp, NULL, 0, NULL, NULL); + nfscl_reqstart(nd, NFSPROC_CREATESESSION, nmp, NULL, 0, NULL, NULL, 0, + 0); NFSM_BUILD(tl, uint32_t *, 4 * NFSX_UNSIGNED); *tl++ = sep->nfsess_clientid.lval[0]; *tl++ = sep->nfsess_clientid.lval[1]; @@ -4783,7 +4800,8 @@ nfsrpc_destroysession(struct nfsmount *nmp, struct nfs int error; struct nfsclsession *tsep; - nfscl_reqstart(nd, NFSPROC_DESTROYSESSION, nmp, NULL, 0, NULL, NULL); + nfscl_reqstart(nd, NFSPROC_DESTROYSESSION, nmp, NULL, 0, NULL, NULL, 0, + 0); NFSM_BUILD(tl, uint32_t *, NFSX_V4SESSIONID); tsep = nfsmnt_mdssession(nmp); bcopy(tsep->nfsess_sessionid, tl, NFSX_V4SESSIONID); @@ -4810,7 +4828,8 @@ nfsrpc_destroyclient(struct nfsmount *nmp, struct nfsc int error; struct nfsclsession *tsep; - nfscl_reqstart(nd, NFSPROC_DESTROYCLIENT, nmp, NULL, 0, NULL, NULL); + nfscl_reqstart(nd, NFSPROC_DESTROYCLIENT, nmp, NULL, 0, NULL, NULL, 0, + 0); NFSM_BUILD(tl, uint32_t *, 2 * NFSX_UNSIGNED); tsep = nfsmnt_mdssession(nmp); *tl++ = tsep->nfsess_clientid.lval[0]; @@ -4828,18 +4847,20 @@ nfsrpc_destroyclient(struct nfsmount *nmp, struct nfsc /* * Do the NFSv4.1 LayoutGet. */ -int +static int nfsrpc_layoutget(struct nfsmount *nmp, uint8_t *fhp, int fhlen, int iomode, - uint64_t offset, uint64_t len, uint64_t minlen, int layoutlen, - nfsv4stateid_t *stateidp, int *retonclosep, struct nfsclflayouthead *flhp, - struct ucred *cred, NFSPROC_T *p, void *stuff) + uint64_t offset, uint64_t len, uint64_t minlen, int layouttype, + int layoutlen, nfsv4stateid_t *stateidp, int *retonclosep, + struct nfsclflayouthead *flhp, struct ucred *cred, NFSPROC_T *p, + void *stuff) { struct nfsrv_descript nfsd, *nd = &nfsd; int error; - nfscl_reqstart(nd, NFSPROC_LAYOUTGET, nmp, fhp, fhlen, NULL, NULL); + nfscl_reqstart(nd, NFSPROC_LAYOUTGET, nmp, fhp, fhlen, NULL, NULL, 0, + 0); nfsrv_setuplayoutget(nd, iomode, offset, len, minlen, stateidp, - layoutlen, 0); + layouttype, layoutlen, 0); nd->nd_flag |= ND_USEGSSNAME; error = newnfs_request(nd, nmp, NULL, &nmp->nm_sockreq, NULL, p, cred, NFS_PROG, NFS_VER4, NULL, 1, NULL, NULL); @@ -4862,18 +4883,22 @@ nfsrpc_getdeviceinfo(struct nfsmount *nmp, uint8_t *de uint32_t *notifybitsp, struct nfscldevinfo **ndip, struct ucred *cred, NFSPROC_T *p) { - uint32_t cnt, *tl; + uint32_t cnt, *tl, vers, minorvers; struct nfsrv_descript nfsd; struct nfsrv_descript *nd = &nfsd; - struct sockaddr_storage ss; - struct nfsclds *dsp = NULL, **dspp; + struct sockaddr_in sin, ssin; + struct sockaddr_in6 sin6, ssin6; + struct nfsclds *dsp = NULL, **dspp, **gotdspp; struct nfscldevinfo *ndi; - int addrcnt, bitcnt, error, i, isudp, j, pos, safilled, stripecnt; + int addrcnt = 0, bitcnt, error, gotvers, i, isudp, j, stripecnt; uint8_t stripeindex; + sa_family_t af, safilled; *ndip = NULL; ndi = NULL; - nfscl_reqstart(nd, NFSPROC_GETDEVICEINFO, nmp, NULL, 0, NULL, NULL); + gotdspp = NULL; + nfscl_reqstart(nd, NFSPROC_GETDEVICEINFO, nmp, NULL, 0, NULL, NULL, 0, + 0); NFSM_BUILD(tl, uint32_t *, NFSX_V4DEVICEID + 3 * NFSX_UNSIGNED); NFSBCOPY(deviceid, tl, NFSX_V4DEVICEID); tl += (NFSX_V4DEVICEID / NFSX_UNSIGNED); @@ -4891,55 +4916,72 @@ nfsrpc_getdeviceinfo(struct nfsmount *nmp, uint8_t *de if (error != 0) return (error); if (nd->nd_repstat == 0) { - NFSM_DISSECT(tl, uint32_t *, 3 * NFSX_UNSIGNED); - if (layouttype != fxdr_unsigned(int, *tl++)) + NFSM_DISSECT(tl, uint32_t *, 2 * NFSX_UNSIGNED); + if (layouttype != fxdr_unsigned(int, *tl)) printf("EEK! devinfo layout type not same!\n"); - stripecnt = fxdr_unsigned(int, *++tl); - NFSCL_DEBUG(4, "stripecnt=%d\n", stripecnt); - if (stripecnt < 1 || stripecnt > 4096) { - printf("NFS devinfo stripecnt %d: out of range\n", - stripecnt); - error = NFSERR_BADXDR; - goto nfsmout; - } - NFSM_DISSECT(tl, uint32_t *, (stripecnt + 1) * NFSX_UNSIGNED); - addrcnt = fxdr_unsigned(int, *(tl + stripecnt)); - NFSCL_DEBUG(4, "addrcnt=%d\n", addrcnt); - if (addrcnt < 1 || addrcnt > 128) { - printf("NFS devinfo addrcnt %d: out of range\n", - addrcnt); - error = NFSERR_BADXDR; - goto nfsmout; - } - - /* - * Now we know how many stripe indices and addresses, so - * we can allocate the structure the correct size. - */ - i = (stripecnt * sizeof(uint8_t)) / sizeof(struct nfsclds *) - + 1; - NFSCL_DEBUG(4, "stripeindices=%d\n", i); - ndi = malloc(sizeof(*ndi) + (addrcnt + i) * - sizeof(struct nfsclds *), M_NFSDEVINFO, M_WAITOK | M_ZERO); - NFSBCOPY(deviceid, ndi->nfsdi_deviceid, NFSX_V4DEVICEID); - ndi->nfsdi_refcnt = 0; - ndi->nfsdi_stripecnt = stripecnt; - ndi->nfsdi_addrcnt = addrcnt; - /* Fill in the stripe indices. */ - for (i = 0; i < stripecnt; i++) { - stripeindex = fxdr_unsigned(uint8_t, *tl++); - NFSCL_DEBUG(4, "stripeind=%d\n", stripeindex); - if (stripeindex >= addrcnt) { - printf("NFS devinfo stripeindex %d: too big\n", - (int)stripeindex); + if (layouttype == NFSLAYOUT_NFSV4_1_FILES) { + NFSM_DISSECT(tl, uint32_t *, NFSX_UNSIGNED); + stripecnt = fxdr_unsigned(int, *tl); + NFSCL_DEBUG(4, "stripecnt=%d\n", stripecnt); + if (stripecnt < 1 || stripecnt > 4096) { + printf("pNFS File layout devinfo stripecnt %d:" + " out of range\n", stripecnt); error = NFSERR_BADXDR; goto nfsmout; } - nfsfldi_setstripeindex(ndi, i, stripeindex); + NFSM_DISSECT(tl, uint32_t *, (stripecnt + 1) * + NFSX_UNSIGNED); + addrcnt = fxdr_unsigned(int, *(tl + stripecnt)); + NFSCL_DEBUG(4, "addrcnt=%d\n", addrcnt); + if (addrcnt < 1 || addrcnt > 128) { + printf("NFS devinfo addrcnt %d: out of range\n", + addrcnt); + error = NFSERR_BADXDR; + goto nfsmout; + } + + /* + * Now we know how many stripe indices and addresses, so + * we can allocate the structure the correct size. + */ + i = (stripecnt * sizeof(uint8_t)) / + sizeof(struct nfsclds *) + 1; + NFSCL_DEBUG(4, "stripeindices=%d\n", i); + ndi = malloc(sizeof(*ndi) + (addrcnt + i) * + sizeof(struct nfsclds *), M_NFSDEVINFO, M_WAITOK | + M_ZERO); + NFSBCOPY(deviceid, ndi->nfsdi_deviceid, + NFSX_V4DEVICEID); + ndi->nfsdi_refcnt = 0; + ndi->nfsdi_flags = NFSDI_FILELAYOUT; + ndi->nfsdi_stripecnt = stripecnt; + ndi->nfsdi_addrcnt = addrcnt; + /* Fill in the stripe indices. */ + for (i = 0; i < stripecnt; i++) { + stripeindex = fxdr_unsigned(uint8_t, *tl++); + NFSCL_DEBUG(4, "stripeind=%d\n", stripeindex); + if (stripeindex >= addrcnt) { + printf("pNFS File Layout devinfo" + " stripeindex %d: too big\n", + (int)stripeindex); + error = NFSERR_BADXDR; + goto nfsmout; + } + nfsfldi_setstripeindex(ndi, i, stripeindex); + } + } else if (layouttype == NFSLAYOUT_FLEXFILE) { + /* For Flex File, we only get one address list. */ + ndi = malloc(sizeof(*ndi) + sizeof(struct nfsclds *), + M_NFSDEVINFO, M_WAITOK | M_ZERO); + NFSBCOPY(deviceid, ndi->nfsdi_deviceid, + NFSX_V4DEVICEID); + ndi->nfsdi_refcnt = 0; + ndi->nfsdi_flags = NFSDI_FLEXFILE; + addrcnt = ndi->nfsdi_addrcnt = 1; } /* Now, dissect the server address(es). */ - safilled = 0; + safilled = AF_UNSPEC; for (i = 0; i < addrcnt; i++) { NFSM_DISSECT(tl, uint32_t *, NFSX_UNSIGNED); cnt = fxdr_unsigned(uint32_t, *tl); @@ -4949,63 +4991,107 @@ nfsrpc_getdeviceinfo(struct nfsmount *nmp, uint8_t *de goto nfsmout; } dspp = nfsfldi_addr(ndi, i); - pos = arc4random() % cnt; /* Choose one. */ - safilled = 0; + safilled = AF_UNSPEC; for (j = 0; j < cnt; j++) { - error = nfsv4_getipaddr(nd, &ss, &isudp); + error = nfsv4_getipaddr(nd, &sin, &sin6, &af, + &isudp); if (error != 0 && error != EPERM) { error = NFSERR_BADXDR; goto nfsmout; } if (error == 0 && isudp == 0) { /* - * The algorithm is: - * - use "pos" entry if it is of the - * same af_family or none of them - * is of the same af_family - * else - * - use the first one of the same - * af_family. + * The priority is: + * - Same address family. + * Save the address and dspp, so that + * the connection can be done after + * parsing is complete. */ - if ((safilled == 0 && ss.ss_family == - nmp->nm_nam->sa_family) || - (j == pos && - (safilled == 0 || ss.ss_family == - nmp->nm_nam->sa_family)) || - (safilled == 1 && ss.ss_family == - nmp->nm_nam->sa_family)) { - error = nfsrpc_fillsa(nmp, &ss, - &dsp, p); - if (error == 0) { - *dspp = dsp; - if (ss.ss_family == - nmp->nm_nam->sa_family) - safilled = 2; - else - safilled = 1; - } + if (safilled == AF_UNSPEC || + (af == nmp->nm_nam->sa_family && + safilled != nmp->nm_nam->sa_family) + ) { + if (af == AF_INET) + ssin = sin; + else + ssin6 = sin6; + safilled = af; + gotdspp = dspp; } } } - if (safilled == 0) - break; } + gotvers = NFS_VER4; /* Always NFSv4 for File Layout. */ + /* For Flex File, we will take one of the versions to use. */ + if (layouttype == NFSLAYOUT_FLEXFILE) { + NFSM_DISSECT(tl, uint32_t *, NFSX_UNSIGNED); + j = fxdr_unsigned(int, *tl); + if (j < 1 || j > NFSDEV_MAXVERS) { + printf("pNFS: too many versions\n"); + error = NFSERR_BADXDR; + goto nfsmout; + } + gotvers = 0; + for (i = 0; i < j; i++) { + NFSM_DISSECT(tl, uint32_t *, 5 * NFSX_UNSIGNED); + vers = fxdr_unsigned(uint32_t, *tl++); + minorvers = fxdr_unsigned(uint32_t, *tl++); + if ((vers == NFS_VER4 && minorvers == + NFSV41_MINORVERSION) || (vers == NFS_VER3 && + gotvers == 0)) { + gotvers = vers; + /* We'll take this one. */ + ndi->nfsdi_versindex = i; + ndi->nfsdi_vers = vers; + ndi->nfsdi_minorvers = minorvers; + ndi->nfsdi_rsize = fxdr_unsigned( + uint32_t, *tl++); + ndi->nfsdi_wsize = fxdr_unsigned( + uint32_t, *tl++); + if (*tl == newnfs_true) + ndi->nfsdi_flags |= + NFSDI_TIGHTCOUPLED; + else + ndi->nfsdi_flags &= + ~NFSDI_TIGHTCOUPLED; + } + } + if (gotvers == 0) { + printf("pNFS: no NFSv3 or NFSv4.1\n"); + error = NFSERR_BADXDR; + goto nfsmout; + } + } + /* And the notify bits. */ NFSM_DISSECT(tl, uint32_t *, NFSX_UNSIGNED); - if (safilled != 0) { - bitcnt = fxdr_unsigned(int, *tl); - if (bitcnt > 0) { - NFSM_DISSECT(tl, uint32_t *, NFSX_UNSIGNED); - if (notifybitsp != NULL) - *notifybitsp = - fxdr_unsigned(uint32_t, *tl); - } + bitcnt = fxdr_unsigned(int, *tl); + if (bitcnt > 0) { + NFSM_DISSECT(tl, uint32_t *, NFSX_UNSIGNED); + if (notifybitsp != NULL) + *notifybitsp = + fxdr_unsigned(uint32_t, *tl); + } + if (safilled != AF_UNSPEC) { + KASSERT(ndi != NULL, ("ndi is NULL")); *ndip = ndi; } else error = EPERM; + if (error == 0) { + /* + * Now we can do a TCP connection for the correct + * NFS version and IP address. + */ + error = nfsrpc_fillsa(nmp, &ssin, &ssin6, safilled, + gotvers, &dsp, p); + } + if (error == 0) { + KASSERT(gotdspp != NULL, ("gotdspp is NULL")); + *gotdspp = dsp; + } } - if (nd->nd_repstat != 0) + if (nd->nd_repstat != 0 && error == 0) error = nd->nd_repstat; nfsmout: if (error != 0 && ndi != NULL) @@ -5020,15 +5106,14 @@ nfsmout: int nfsrpc_layoutcommit(struct nfsmount *nmp, uint8_t *fh, int fhlen, int reclaim, uint64_t off, uint64_t len, uint64_t lastbyte, nfsv4stateid_t *stateidp, - int layouttype, int layoutupdatecnt, uint8_t *layp, struct ucred *cred, - NFSPROC_T *p, void *stuff) + int layouttype, struct ucred *cred, NFSPROC_T *p, void *stuff) { uint32_t *tl; struct nfsrv_descript nfsd, *nd = &nfsd; - int error, outcnt, i; - uint8_t *cp; + int error; - nfscl_reqstart(nd, NFSPROC_LAYOUTCOMMIT, nmp, fh, fhlen, NULL, NULL); + nfscl_reqstart(nd, NFSPROC_LAYOUTCOMMIT, nmp, fh, fhlen, NULL, NULL, + 0, 0); NFSM_BUILD(tl, uint32_t *, 5 * NFSX_UNSIGNED + 3 * NFSX_HYPER + NFSX_STATEID); txdr_hyper(off, tl); @@ -5052,17 +5137,13 @@ nfsrpc_layoutcommit(struct nfsmount *nmp, uint8_t *fh, tl += 2; *tl++ = newnfs_false; *tl++ = txdr_unsigned(layouttype); - *tl = txdr_unsigned(layoutupdatecnt); - if (layoutupdatecnt > 0) { - KASSERT(layouttype != NFSLAYOUT_NFSV4_1_FILES, - ("Must be nil for Files Layout")); - outcnt = NFSM_RNDUP(layoutupdatecnt); - NFSM_BUILD(cp, uint8_t *, outcnt); - NFSBCOPY(layp, cp, layoutupdatecnt); - cp += layoutupdatecnt; - for (i = 0; i < (outcnt - layoutupdatecnt); i++) - *cp++ = 0x0; - } + /* All supported layouts appear to be 0 length for now. */ + if (layouttype == NFSLAYOUT_NFSV4_1_FILES) + *tl = txdr_unsigned(0); + else if (layouttype == NFSLAYOUT_FLEXFILE) + *tl = txdr_unsigned(0); + else + *tl = txdr_unsigned(0); nd->nd_flag |= ND_USEGSSNAME; error = newnfs_request(nd, nmp, NULL, &nmp->nm_sockreq, NULL, p, cred, NFS_PROG, NFS_VER4, NULL, 1, NULL, NULL); @@ -5079,15 +5160,15 @@ nfsrpc_layoutcommit(struct nfsmount *nmp, uint8_t *fh, int nfsrpc_layoutreturn(struct nfsmount *nmp, uint8_t *fh, int fhlen, int reclaim, int layouttype, uint32_t iomode, int layoutreturn, uint64_t offset, - uint64_t len, nfsv4stateid_t *stateidp, int layoutcnt, uint32_t *layp, - struct ucred *cred, NFSPROC_T *p, void *stuff) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-projects@freebsd.org Thu Sep 28 05:20:40 2017 Return-Path: Delivered-To: svn-src-projects@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EFE2EE291F9 for ; Thu, 28 Sep 2017 05:20: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 AA137700CE; Thu, 28 Sep 2017 05:20: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 v8S5Kd0j057513; Thu, 28 Sep 2017 05:20:39 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v8S5Kbf5056904; Thu, 28 Sep 2017 05:20:37 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201709280520.v8S5Kbf5056904@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Thu, 28 Sep 2017 05:20:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r324076 - in projects/runtime-coverage: . cddl/contrib/opensolaris/cmd/ztest cddl/usr.sbin/zfsd contrib/gcc/config/arm etc etc/mtree lib/libcapsicum share/man/man4 share/man/man5 share/... X-SVN-Group: projects X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: in projects/runtime-coverage: . cddl/contrib/opensolaris/cmd/ztest cddl/usr.sbin/zfsd contrib/gcc/config/arm etc etc/mtree lib/libcapsicum share/man/man4 share/man/man5 share/man/man9 sys/arm/allwinne... X-SVN-Commit-Revision: 324076 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Sep 2017 05:20:41 -0000 Author: ngie Date: Thu Sep 28 05:20:37 2017 New Revision: 324076 URL: https://svnweb.freebsd.org/changeset/base/324076 Log: MFhead@r324075 Added: projects/runtime-coverage/sys/crypto/aesni/intel_sha1.c - copied unchanged from r324075, head/sys/crypto/aesni/intel_sha1.c projects/runtime-coverage/sys/crypto/aesni/intel_sha256.c - copied unchanged from r324075, head/sys/crypto/aesni/intel_sha256.c projects/runtime-coverage/sys/crypto/aesni/sha_sse.h - copied unchanged from r324075, head/sys/crypto/aesni/sha_sse.h projects/runtime-coverage/sys/dev/bhnd/bhnd_eromvar.h - copied unchanged from r324075, head/sys/dev/bhnd/bhnd_eromvar.h projects/runtime-coverage/sys/dev/bhnd/bhnd_private.h - copied unchanged from r324075, head/sys/dev/bhnd/bhnd_private.h Deleted: projects/runtime-coverage/etc/man.alias projects/runtime-coverage/usr.sbin/procctl/ Modified: projects/runtime-coverage/Makefile.inc1 projects/runtime-coverage/ObsoleteFiles.inc projects/runtime-coverage/cddl/contrib/opensolaris/cmd/ztest/ztest.c projects/runtime-coverage/cddl/usr.sbin/zfsd/zfsd_event.cc projects/runtime-coverage/contrib/gcc/config/arm/unwind-arm.c projects/runtime-coverage/etc/Makefile projects/runtime-coverage/etc/mtree/BSD.usr.dist projects/runtime-coverage/lib/libcapsicum/capsicum_helpers.h projects/runtime-coverage/share/man/man4/aesni.4 projects/runtime-coverage/share/man/man5/procfs.5 projects/runtime-coverage/share/man/man9/Makefile projects/runtime-coverage/share/man/man9/ucred.9 projects/runtime-coverage/sys/arm/allwinner/a10_ehci.c projects/runtime-coverage/sys/arm/allwinner/a10_gpio.c projects/runtime-coverage/sys/arm/allwinner/aw_usbphy.c projects/runtime-coverage/sys/boot/efi/libefi/efipart.c projects/runtime-coverage/sys/cddl/compat/opensolaris/sys/kcondvar.h projects/runtime-coverage/sys/cddl/compat/opensolaris/sys/time.h projects/runtime-coverage/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c projects/runtime-coverage/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c projects/runtime-coverage/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c projects/runtime-coverage/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_tx.c projects/runtime-coverage/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu.h projects/runtime-coverage/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zil.h projects/runtime-coverage/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zil_impl.h projects/runtime-coverage/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h projects/runtime-coverage/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/txg.c projects/runtime-coverage/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c projects/runtime-coverage/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c projects/runtime-coverage/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c projects/runtime-coverage/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c projects/runtime-coverage/sys/cddl/contrib/opensolaris/uts/common/sys/debug.h projects/runtime-coverage/sys/cddl/dev/dtmalloc/dtmalloc.c projects/runtime-coverage/sys/cddl/dev/fbt/fbt.c projects/runtime-coverage/sys/cddl/dev/profile/profile.c projects/runtime-coverage/sys/cddl/dev/prototype.c projects/runtime-coverage/sys/cddl/dev/sdt/sdt.c projects/runtime-coverage/sys/cddl/dev/systrace/systrace.c projects/runtime-coverage/sys/compat/linux/linux_stats.c projects/runtime-coverage/sys/conf/files.amd64 projects/runtime-coverage/sys/conf/files.i386 projects/runtime-coverage/sys/contrib/vchiq/interface/vchiq_arm/vchiq_2835_arm.c projects/runtime-coverage/sys/crypto/aesni/aesni.c projects/runtime-coverage/sys/crypto/aesni/aesni.h projects/runtime-coverage/sys/crypto/via/padlock_hash.c projects/runtime-coverage/sys/dev/bhnd/bcma/bcma.c projects/runtime-coverage/sys/dev/bhnd/bcma/bcma_erom.c projects/runtime-coverage/sys/dev/bhnd/bhnd.c projects/runtime-coverage/sys/dev/bhnd/bhnd.h projects/runtime-coverage/sys/dev/bhnd/bhnd_bus_if.m projects/runtime-coverage/sys/dev/bhnd/bhnd_erom.c projects/runtime-coverage/sys/dev/bhnd/bhnd_erom.h projects/runtime-coverage/sys/dev/bhnd/bhnd_erom_if.m projects/runtime-coverage/sys/dev/bhnd/bhnd_subr.c projects/runtime-coverage/sys/dev/bhnd/bhnd_types.h projects/runtime-coverage/sys/dev/bhnd/bhndb/bhnd_bhndb.c projects/runtime-coverage/sys/dev/bhnd/bhndb/bhndb.c projects/runtime-coverage/sys/dev/bhnd/bhndb/bhndb_pci.c projects/runtime-coverage/sys/dev/bhnd/bhndb/bhndb_pcivar.h projects/runtime-coverage/sys/dev/bhnd/bhndb/bhndb_private.h projects/runtime-coverage/sys/dev/bhnd/bhndb/bhndb_subr.c projects/runtime-coverage/sys/dev/bhnd/bhndb/bhndbvar.h projects/runtime-coverage/sys/dev/bhnd/bhndreg.h projects/runtime-coverage/sys/dev/bhnd/bhndvar.h projects/runtime-coverage/sys/dev/bhnd/cores/chipc/chipc.c projects/runtime-coverage/sys/dev/bhnd/cores/chipc/pwrctl/bhnd_pwrctl.c projects/runtime-coverage/sys/dev/bhnd/cores/pci/bhnd_pci_hostb.c projects/runtime-coverage/sys/dev/bhnd/cores/pmu/bhnd_pmu.c projects/runtime-coverage/sys/dev/bhnd/nvram/bhnd_sprom.c projects/runtime-coverage/sys/dev/bhnd/siba/siba.c projects/runtime-coverage/sys/dev/bhnd/siba/siba_bhndb.c projects/runtime-coverage/sys/dev/bhnd/siba/siba_erom.c projects/runtime-coverage/sys/dev/bnxt/if_bnxt.c projects/runtime-coverage/sys/dev/drm/drmP.h projects/runtime-coverage/sys/dev/drm2/i915/i915_drv.c projects/runtime-coverage/sys/dev/drm2/radeon/radeon_drv.c projects/runtime-coverage/sys/dev/e1000/if_em.c projects/runtime-coverage/sys/dev/hyperv/netvsc/if_hn.c projects/runtime-coverage/sys/dev/hyperv/netvsc/ndis.h projects/runtime-coverage/sys/dev/ixl/ixl_txrx.c projects/runtime-coverage/sys/dev/neta/if_mvneta.c projects/runtime-coverage/sys/dev/nvme/nvme_sim.c projects/runtime-coverage/sys/dev/pccard/pccardvar.h projects/runtime-coverage/sys/dev/qlxgbe/ql_glbl.h projects/runtime-coverage/sys/dev/qlxgbe/ql_hw.c projects/runtime-coverage/sys/dev/qlxgbe/ql_os.c projects/runtime-coverage/sys/fs/ext2fs/ext2_alloc.c projects/runtime-coverage/sys/fs/ext2fs/ext2_extern.h projects/runtime-coverage/sys/fs/ext2fs/ext2_inode.c projects/runtime-coverage/sys/fs/ext2fs/ext2_inode_cnv.c projects/runtime-coverage/sys/fs/nfs/nfs_var.h projects/runtime-coverage/sys/fs/nfs/nfscl.h projects/runtime-coverage/sys/fs/nfsclient/nfs_clcomsubs.c projects/runtime-coverage/sys/fs/nfsclient/nfs_clkdtrace.c projects/runtime-coverage/sys/fs/nfsclient/nfs_clrpcops.c projects/runtime-coverage/sys/fs/nfsclient/nfs_clstate.c projects/runtime-coverage/sys/fs/nfsserver/nfs_nfsdserv.c projects/runtime-coverage/sys/fs/tmpfs/tmpfs_fifoops.c projects/runtime-coverage/sys/fs/tmpfs/tmpfs_vnops.c projects/runtime-coverage/sys/fs/tmpfs/tmpfs_vnops.h projects/runtime-coverage/sys/geom/geom_subr.c projects/runtime-coverage/sys/kern/kern_mutex.c projects/runtime-coverage/sys/kern/kern_sysctl.c projects/runtime-coverage/sys/kern/sys_process.c projects/runtime-coverage/sys/kern/vfs_cache.c projects/runtime-coverage/sys/kern/vfs_export.c projects/runtime-coverage/sys/mips/broadcom/bcm_machdep.c projects/runtime-coverage/sys/mips/broadcom/bcm_machdep.h projects/runtime-coverage/sys/mips/broadcom/bcm_nvram_cfe.c projects/runtime-coverage/sys/mips/broadcom/bhnd_nexus.c projects/runtime-coverage/sys/modules/aesni/Makefile projects/runtime-coverage/sys/modules/bhnd/bhndb_pci/Makefile projects/runtime-coverage/sys/net/iflib.h projects/runtime-coverage/sys/netinet/sctp_asconf.c projects/runtime-coverage/sys/netinet/sctp_asconf.h projects/runtime-coverage/sys/netinet/tcp_syncache.c projects/runtime-coverage/sys/netipsec/xform_ah.c projects/runtime-coverage/sys/opencrypto/crypto.c projects/runtime-coverage/sys/opencrypto/cryptodev.c projects/runtime-coverage/sys/opencrypto/cryptodev.h projects/runtime-coverage/sys/opencrypto/xform_md5.c projects/runtime-coverage/sys/opencrypto/xform_null.c projects/runtime-coverage/sys/opencrypto/xform_rmd160.c projects/runtime-coverage/sys/opencrypto/xform_sha1.c projects/runtime-coverage/sys/opencrypto/xform_sha2.c projects/runtime-coverage/sys/sys/mbuf.h projects/runtime-coverage/sys/sys/module.h projects/runtime-coverage/sys/sys/mutex.h projects/runtime-coverage/sys/sys/param.h projects/runtime-coverage/sys/ufs/ffs/ffs_softdep.c projects/runtime-coverage/sys/vm/uma.h projects/runtime-coverage/sys/vm/vm_page.c projects/runtime-coverage/targets/pseudo/userland/Makefile.depend projects/runtime-coverage/tests/sys/opencrypto/cryptotest.py projects/runtime-coverage/tools/tools/nanobsd/legacy.sh projects/runtime-coverage/usr.bin/calendar/events.c projects/runtime-coverage/usr.sbin/Makefile projects/runtime-coverage/usr.sbin/mountd/mountd.c Directory Properties: projects/runtime-coverage/ (props changed) projects/runtime-coverage/cddl/ (props changed) projects/runtime-coverage/cddl/contrib/opensolaris/ (props changed) projects/runtime-coverage/contrib/gcc/ (props changed) projects/runtime-coverage/sys/cddl/contrib/opensolaris/ (props changed) Modified: projects/runtime-coverage/Makefile.inc1 ============================================================================== --- projects/runtime-coverage/Makefile.inc1 Thu Sep 28 01:27:00 2017 (r324075) +++ projects/runtime-coverage/Makefile.inc1 Thu Sep 28 05:20:37 2017 (r324076) @@ -2567,7 +2567,7 @@ delete-old-files: .PHONY done # Remove catpages without corresponding manpages. @exec 3<&0; \ - find ${DESTDIR}/usr/share/man/cat* ! -type d | \ + find ${DESTDIR}/usr/share/man/cat* ! -type d 2>/dev/null | \ sed -ep -e's:${DESTDIR}/usr/share/man/cat:${DESTDIR}/usr/share/man/man:' | \ while read catpage; do \ read manpage; \ Modified: projects/runtime-coverage/ObsoleteFiles.inc ============================================================================== --- projects/runtime-coverage/ObsoleteFiles.inc Thu Sep 28 01:27:00 2017 (r324075) +++ projects/runtime-coverage/ObsoleteFiles.inc Thu Sep 28 05:20:37 2017 (r324076) @@ -38,16 +38,137 @@ # xargs -n1 | sort | uniq -d; # done +# 20170927: crshared +OLD_FILES+=usr/share/man/man9/crshared.9.gz +# 20170927: procctl +OLD_FILES+=usr/share/man/man8/procctl.8.gz +OLD_FILES+=usr/sbin/procctl +# 20170926: remove unneeded man aliases and locales directory +OLD_FILES+=usr/share/man/en.ISO8859-1/man1 +OLD_FILES+=usr/share/man/en.ISO8859-1/man2 +OLD_FILES+=usr/share/man/en.ISO8859-1/man3 +OLD_FILES+=usr/share/man/en.ISO8859-1/man4 +OLD_FILES+=usr/share/man/en.ISO8859-1/man5 +OLD_FILES+=usr/share/man/en.ISO8859-1/man6 +OLD_FILES+=usr/share/man/en.ISO8859-1/man7 +OLD_FILES+=usr/share/man/en.ISO8859-1/man8 +OLD_FILES+=usr/share/man/en.ISO8859-1/man9 +OLD_DIRS+=usr/share/man/en.ISO8859-1 +OLD_FILES+=usr/share/man/en.ISO8859-1/mandoc.db +OLD_FILES+=usr/share/man/en.UTF-8/man1 +OLD_FILES+=usr/share/man/en.UTF-8/man2 +OLD_FILES+=usr/share/man/en.UTF-8/man3 +OLD_FILES+=usr/share/man/en.UTF-8/man4 +OLD_FILES+=usr/share/man/en.UTF-8/man5 +OLD_FILES+=usr/share/man/en.UTF-8/man6 +OLD_FILES+=usr/share/man/en.UTF-8/man7 +OLD_FILES+=usr/share/man/en.UTF-8/man8 +OLD_FILES+=usr/share/man/en.UTF-8/man9 +OLD_FILES+=usr/share/man/en.UTF-8/mandoc.db +OLD_DIRS+=usr/share/man/en.UTF-8 +OLD_FILES+=usr/share/man/en.ISO8859-15 +OLD_FILES+=usr/share/openssl/man/en.ISO8859-1/man1 +OLD_FILES+=usr/share/openssl/man/en.ISO8859-1/man3 +OLD_FILES+=usr/share/openssl/man/en.ISO8859-1/mandoc.db +OLD_DIRS+=usr/share/openssl/man/en.ISO8859-1 +OLD_FILES+=usr/share/openssl/man/en.ISO8859-15 +OLD_DIRS+=usr/share/man/ja/man1 +OLD_DIRS+=usr/share/man/ja/man2 +OLD_DIRS+=usr/share/man/ja/man3 +OLD_DIRS+=usr/share/man/ja/man4 +OLD_DIRS+=usr/share/man/ja/man5 +OLD_DIRS+=usr/share/man/ja/man6 +OLD_DIRS+=usr/share/man/ja/man7 +OLD_DIRS+=usr/share/man/ja/man8 +OLD_DIRS+=usr/share/man/ja/man9 +OLD_DIRS+=usr/share/man/ja # 20170913: remove unneeded catman utility OLD_FILES+=etc/periodic/weekly/330.catman OLD_FILES+=usr/bin/catman OLD_FILES+=usr/libexec/catman.local OLD_FILES+=usr/share/man/man1/catman.1.gz OLD_FILES+=usr/share/man/man8/catman.local.8.gz - +OLD_DIRS+=usr/share/man/cat1 +OLD_DIRS+=usr/share/man/cat2 +OLD_DIRS+=usr/share/man/cat3 +OLD_DIRS+=usr/share/man/cat4/amd64 +OLD_DIRS+=usr/share/man/cat4/arm +OLD_DIRS+=usr/share/man/cat4/i386 +OLD_DIRS+=usr/share/man/cat4/powerpc +OLD_DIRS+=usr/share/man/cat4/sparc64 +OLD_DIRS+=usr/share/man/cat4 +OLD_DIRS+=usr/share/man/cat5 +OLD_DIRS+=usr/share/man/cat6 +OLD_DIRS+=usr/share/man/cat7 +OLD_DIRS+=usr/share/man/cat8/amd64 +OLD_DIRS+=usr/share/man/cat8/arm +OLD_DIRS+=usr/share/man/cat8/i386 +OLD_DIRS+=usr/share/man/cat8/powerpc +OLD_DIRS+=usr/share/man/cat8/sparc64 +OLD_DIRS+=usr/share/man/cat8 +OLD_DIRS+=usr/share/man/cat9 +OLD_DIRS+=usr/share/man/en.ISO8859-1/cat1 +OLD_DIRS+=usr/share/man/en.ISO8859-1/cat2 +OLD_DIRS+=usr/share/man/en.ISO8859-1/cat3 +OLD_DIRS+=usr/share/man/en.ISO8859-1/cat4/amd64 +OLD_DIRS+=usr/share/man/en.ISO8859-1/cat4/arm +OLD_DIRS+=usr/share/man/en.ISO8859-1/cat4/i386 +OLD_DIRS+=usr/share/man/en.ISO8859-1/cat4/powerpc +OLD_DIRS+=usr/share/man/en.ISO8859-1/cat4/sparc64 +OLD_DIRS+=usr/share/man/en.ISO8859-1/cat4 +OLD_DIRS+=usr/share/man/en.ISO8859-1/cat5 +OLD_DIRS+=usr/share/man/en.ISO8859-1/cat6 +OLD_DIRS+=usr/share/man/en.ISO8859-1/cat7 +OLD_DIRS+=usr/share/man/en.ISO8859-1/cat8/amd64 +OLD_DIRS+=usr/share/man/en.ISO8859-1/cat8/arm +OLD_DIRS+=usr/share/man/en.ISO8859-1/cat8/i386 +OLD_DIRS+=usr/share/man/en.ISO8859-1/cat8/powerpc +OLD_DIRS+=usr/share/man/en.ISO8859-1/cat8/sparc64 +OLD_DIRS+=usr/share/man/en.ISO8859-1/cat8 +OLD_DIRS+=usr/share/man/en.ISO8859-1/cat9 +OLD_DIRS+=usr/share/man/en.UTF-8/cat1 +OLD_DIRS+=usr/share/man/en.UTF-8/cat2 +OLD_DIRS+=usr/share/man/en.UTF-8/cat3 +OLD_DIRS+=usr/share/man/en.UTF-8/cat4/amd64 +OLD_DIRS+=usr/share/man/en.UTF-8/cat4/arm +OLD_DIRS+=usr/share/man/en.UTF-8/cat4/i386 +OLD_DIRS+=usr/share/man/en.UTF-8/cat4/powerpc +OLD_DIRS+=usr/share/man/en.UTF-8/cat4/sparc64 +OLD_DIRS+=usr/share/man/en.UTF-8/cat4 +OLD_DIRS+=usr/share/man/en.UTF-8/cat5 +OLD_DIRS+=usr/share/man/en.UTF-8/cat6 +OLD_DIRS+=usr/share/man/en.UTF-8/cat7 +OLD_DIRS+=usr/share/man/en.UTF-8/cat8/amd64 +OLD_DIRS+=usr/share/man/en.UTF-8/cat8/arm +OLD_DIRS+=usr/share/man/en.UTF-8/cat8/i386 +OLD_DIRS+=usr/share/man/en.UTF-8/cat8/powerpc +OLD_DIRS+=usr/share/man/en.UTF-8/cat8/sparc64 +OLD_DIRS+=usr/share/man/en.UTF-8/cat8 +OLD_DIRS+=usr/share/man/en.UTF-8/cat9 +OLD_DIRS+=usr/share/man/ja/cat1 +OLD_DIRS+=usr/share/man/ja/cat2 +OLD_DIRS+=usr/share/man/ja/cat3 +OLD_DIRS+=usr/share/man/ja/cat4/amd64 +OLD_DIRS+=usr/share/man/ja/cat4/arm +OLD_DIRS+=usr/share/man/ja/cat4/i386 +OLD_DIRS+=usr/share/man/ja/cat4/powerpc +OLD_DIRS+=usr/share/man/ja/cat4/sparc64 +OLD_DIRS+=usr/share/man/ja/cat4 +OLD_DIRS+=usr/share/man/ja/cat5 +OLD_DIRS+=usr/share/man/ja/cat6 +OLD_DIRS+=usr/share/man/ja/cat7 +OLD_DIRS+=usr/share/man/ja/cat8/amd64 +OLD_DIRS+=usr/share/man/ja/cat8/arm +OLD_DIRS+=usr/share/man/ja/cat8/powerpc +OLD_DIRS+=usr/share/man/ja/cat8/sparc64 +OLD_DIRS+=usr/share/man/ja/cat8 +OLD_DIRS+=usr/share/man/ja/cat9 +OLD_DIRS+=usr/share/openssl/man/cat1 +OLD_DIRS+=usr/share/openssl/man/cat3 +OLD_DIRS+=usr/share/openssl/man/en.ISO8859-1/cat1 +OLD_DIRS+=usr/share/openssl/man/en.ISO8859-1/cat3 # 20170802: ksyms(4) ioctl interface was removed OLD_FILES+=usr/include/sys/ksyms.h - # 20170722: new clang import which bumps version from 4.0.0 to 5.0.0. OLD_FILES+=usr/lib/clang/4.0.0/include/sanitizer/allocator_interface.h OLD_FILES+=usr/lib/clang/4.0.0/include/sanitizer/asan_interface.h Modified: projects/runtime-coverage/cddl/contrib/opensolaris/cmd/ztest/ztest.c ============================================================================== --- projects/runtime-coverage/cddl/contrib/opensolaris/cmd/ztest/ztest.c Thu Sep 28 01:27:00 2017 (r324075) +++ projects/runtime-coverage/cddl/contrib/opensolaris/cmd/ztest/ztest.c Thu Sep 28 05:20:37 2017 (r324076) @@ -1825,13 +1825,14 @@ ztest_get_done(zgd_t *zgd, int error) ztest_object_unlock(zd, object); if (error == 0 && zgd->zgd_bp) - zil_add_block(zgd->zgd_zilog, zgd->zgd_bp); + zil_lwb_add_block(zgd->zgd_lwb, zgd->zgd_bp); umem_free(zgd, sizeof (*zgd)); } static int -ztest_get_data(void *arg, lr_write_t *lr, char *buf, zio_t *zio) +ztest_get_data(void *arg, lr_write_t *lr, char *buf, struct lwb *lwb, + zio_t *zio) { ztest_ds_t *zd = arg; objset_t *os = zd->zd_os; @@ -1845,6 +1846,10 @@ ztest_get_data(void *arg, lr_write_t *lr, char *buf, z zgd_t *zgd; int error; + ASSERT3P(lwb, !=, NULL); + ASSERT3P(zio, !=, NULL); + ASSERT3U(size, !=, 0); + ztest_object_lock(zd, object, RL_READER); error = dmu_bonus_hold(os, object, FTAG, &db); if (error) { @@ -1865,7 +1870,7 @@ ztest_get_data(void *arg, lr_write_t *lr, char *buf, z db = NULL; zgd = umem_zalloc(sizeof (*zgd), UMEM_NOFAIL); - zgd->zgd_zilog = zd->zd_zilog; + zgd->zgd_lwb = lwb; zgd->zgd_private = zd; if (buf != NULL) { /* immediate write */ Modified: projects/runtime-coverage/cddl/usr.sbin/zfsd/zfsd_event.cc ============================================================================== --- projects/runtime-coverage/cddl/usr.sbin/zfsd/zfsd_event.cc Thu Sep 28 01:27:00 2017 (r324075) +++ projects/runtime-coverage/cddl/usr.sbin/zfsd/zfsd_event.cc Thu Sep 28 05:20:37 2017 (r324076) @@ -101,7 +101,7 @@ DevfsEvent::ReadLabel(int devFd, bool &inUse, bool &de poolName = NULL; if (zpool_in_use(g_zfsHandle, devFd, &poolState, &poolName, &b_inuse) == 0) { - nvlist_t *devLabel; + nvlist_t *devLabel = NULL; inUse = b_inuse == B_TRUE; if (poolName != NULL) @@ -116,8 +116,10 @@ DevfsEvent::ReadLabel(int devFd, bool &inUse, bool &de * might be damaged. In that case, zfsd should do nothing and * wait for the sysadmin to decide. */ - if (nlabels != VDEV_LABELS || devLabel == NULL) + if (nlabels != VDEV_LABELS || devLabel == NULL) { + nvlist_free(devLabel); return (NULL); + } try { Vdev vdev(devLabel); @@ -131,6 +133,7 @@ DevfsEvent::ReadLabel(int devFd, bool &inUse, bool &de exp.GetString().insert(0, context); exp.Log(); + nvlist_free(devLabel); } } return (NULL); Modified: projects/runtime-coverage/contrib/gcc/config/arm/unwind-arm.c ============================================================================== --- projects/runtime-coverage/contrib/gcc/config/arm/unwind-arm.c Thu Sep 28 01:27:00 2017 (r324075) +++ projects/runtime-coverage/contrib/gcc/config/arm/unwind-arm.c Thu Sep 28 05:20:37 2017 (r324076) @@ -625,8 +625,8 @@ __gnu_Unwind_RaiseException (_Unwind_Control_Block * u do { /* Find the entry for this routine. */ - if (get_eit_entry (ucbp, saved_vrs.core.r[R_PC]) != _URC_OK) - return _URC_FAILURE; + if ((pr_result = get_eit_entry (ucbp, saved_vrs.core.r[R_PC])) != _URC_OK) + return pr_result; /* Call the pr to decide what to do. */ pr_result = ((personality_routine) UCB_PR_ADDR (ucbp)) @@ -773,11 +773,8 @@ __gnu_Unwind_Backtrace(_Unwind_Trace_Fn trace, void * do { /* Find the entry for this routine. */ - if (get_eit_entry (ucbp, saved_vrs.core.r[R_PC]) != _URC_OK) - { - code = _URC_FAILURE; + if ((code = get_eit_entry (ucbp, saved_vrs.core.r[R_PC])) != _URC_OK) break; - } /* The dwarf unwinder assumes the context structure holds things like the function and LSDA pointers. The ARM implementation Modified: projects/runtime-coverage/etc/Makefile ============================================================================== --- projects/runtime-coverage/etc/Makefile Thu Sep 28 01:27:00 2017 (r324075) +++ projects/runtime-coverage/etc/Makefile Thu Sep 28 05:20:37 2017 (r324076) @@ -399,31 +399,6 @@ distrib-dirs: ${MTREES:N/*} distrib-cleanup .PHONY done; true .endif ${INSTALL_SYMLINK} usr/src/sys ${DESTDIR}/sys -.if ${MK_MAN} != "no" - cd ${DESTDIR}${SHAREDIR}/man; \ - for mandir in man*; do \ - ${INSTALL_SYMLINK} ../$$mandir \ - ${DESTDIR}${SHAREDIR}/man/en.ISO8859-1/; \ - ${INSTALL_SYMLINK} ../$$mandir \ - ${DESTDIR}${SHAREDIR}/man/en.UTF-8/; \ - done -.if ${MK_OPENSSL} != "no" - cd ${DESTDIR}${SHAREDIR}/openssl/man; \ - for mandir in man*; do \ - ${INSTALL_SYMLINK} ../$$mandir \ - ${DESTDIR}${SHAREDIR}/openssl/man/en.ISO8859-1/; \ - done -.endif - set - `grep "^[a-zA-Z]" ${.CURDIR}/man.alias`; \ - while [ $$# -gt 0 ] ; do \ - ${INSTALL_SYMLINK} "$$2" "${DESTDIR}${SHAREDIR}/man/$$1"; \ - if [ "${MK_OPENSSL}" != "no" ]; then \ - ${INSTALL_SYMLINK} "$$2" \ - "${DESTDIR}${SHAREDIR}/openssl/man/$$1"; \ - fi; \ - shift; shift; \ - done -.endif .if ${MK_NLS} != "no" set - `grep "^[a-zA-Z]" ${.CURDIR}/nls.alias`; \ while [ $$# -gt 0 ] ; do \ Modified: projects/runtime-coverage/etc/mtree/BSD.usr.dist ============================================================================== --- projects/runtime-coverage/etc/mtree/BSD.usr.dist Thu Sep 28 01:27:00 2017 (r324075) +++ projects/runtime-coverage/etc/mtree/BSD.usr.dist Thu Sep 28 05:20:37 2017 (r324076) @@ -807,158 +807,6 @@ .. .. man -/set uname=man - cat1 - .. - cat2 - .. - cat3 - .. - cat4 - amd64 - .. - arm - .. - i386 - .. - powerpc - .. - sparc64 - .. - .. - cat5 - .. - cat6 - .. - cat7 - .. - cat8 - amd64 - .. - i386 - .. - powerpc - .. - sparc64 - .. - .. - cat9 - .. - en.ISO8859-1 uname=root - cat1 - .. - cat2 - .. - cat3 - .. - cat4 - amd64 - .. - arm - .. - i386 - .. - powerpc - .. - sparc64 - .. - .. - cat5 - .. - cat6 - .. - cat7 - .. - cat8 - amd64 - .. - i386 - .. - powerpc - .. - sparc64 - .. - .. - cat9 - .. - .. - en.UTF-8 uname=root - cat1 - .. - cat2 - .. - cat3 - .. - cat4 - amd64 - .. - arm - .. - i386 - .. - powerpc - .. - sparc64 - .. - .. - cat5 - .. - cat6 - .. - cat7 - .. - cat8 - amd64 - .. - i386 - .. - powerpc - .. - sparc64 - .. - .. - cat9 - .. - .. - ja uname=root - cat1 - .. - cat2 - .. - cat3 - .. - cat4 - .. - cat5 - .. - cat6 - .. - cat7 - .. - cat8 - .. - cat9 - .. -/set uname=root - man1 - .. - man2 - .. - man3 - .. - man4 - .. - man5 - .. - man6 - .. - man7 - .. - man8 - .. - man9 - .. - .. man1 .. man2 @@ -1298,18 +1146,6 @@ .. openssl man -/set uname=man - cat1 - .. - cat3 - .. - en.ISO8859-1 uname=root - cat1 - .. - cat3 - .. - .. -/set uname=root man1 .. man3 Modified: projects/runtime-coverage/lib/libcapsicum/capsicum_helpers.h ============================================================================== --- projects/runtime-coverage/lib/libcapsicum/capsicum_helpers.h Thu Sep 28 01:27:00 2017 (r324075) +++ projects/runtime-coverage/lib/libcapsicum/capsicum_helpers.h Thu Sep 28 05:20:37 2017 (r324076) @@ -50,7 +50,7 @@ caph_limit_stream(int fd, int flags) cap_rights_t rights; unsigned long cmds[] = { TIOCGETA, TIOCGWINSZ, FIODTYPE }; - cap_rights_init(&rights, CAP_FCNTL, CAP_FSTAT, CAP_IOCTL); + cap_rights_init(&rights, CAP_FCNTL, CAP_FSTAT, CAP_IOCTL, CAP_SEEK); if ((flags & CAPH_READ) != 0) cap_rights_set(&rights, CAP_READ); Modified: projects/runtime-coverage/share/man/man4/aesni.4 ============================================================================== --- projects/runtime-coverage/share/man/man4/aesni.4 Thu Sep 28 01:27:00 2017 (r324075) +++ projects/runtime-coverage/share/man/man4/aesni.4 Thu Sep 28 05:20:37 2017 (r324076) @@ -24,12 +24,12 @@ .\" .\" $FreeBSD$ .\" -.Dd December 14, 2015 +.Dd September 26, 2017 .Dt AESNI 4 .Os .Sh NAME .Nm aesni -.Nd "driver for the AES accelerator on Intel CPUs" +.Nd "driver for the AES and SHA accelerator on x86 CPUs" .Sh SYNOPSIS To compile this driver into the kernel, place the following lines in your @@ -47,8 +47,8 @@ module at boot time, place the following line in aesni_load="YES" .Ed .Sh DESCRIPTION -Starting with some models of Core i5/i7, Intel processors implement -a new set of instructions called AESNI. +Starting with Intel Westmere and AMD Bulldozer, some x86 processors implement a +new set of instructions called AESNI. The set of six instructions accelerates the calculation of the key schedule for key lengths of 128, 192, and 256 of the Advanced Encryption Standard (AES) symmetric cipher, and provides a hardware @@ -56,13 +56,24 @@ implementation of the regular and the last encryption rounds. .Pp The processor capability is reported as AESNI in the Features2 line at boot. +.Pp +Starting with the Intel Goldmont and AMD Ryzen microarchitectures, some x86 +processors implement a new set of SHA instructions. +The set of seven instructions accelerates the calculation of SHA1 and SHA256 +hashes. +.Pp +The processor capability is reported as SHA in the Structured Extended Features +line at boot. +.Pp The .Nm -driver does not attach on systems that lack the required CPU capability. +driver does not attach on systems that lack both CPU capabilities. +On systems that support only one of AESNI or SHA extensions, the driver will +attach and support that one function. .Pp The .Nm -driver registers itself to accelerate AES operations for +driver registers itself to accelerate AES and SHA operations for .Xr crypto 4 . Besides speed, the advantage of using the .Nm @@ -83,13 +94,18 @@ The .Nm driver first appeared in .Fx 9.0 . +SHA support was added in +.Fx 12.0 . .Sh AUTHORS .An -nosplit The .Nm driver was written by -.An Konstantin Belousov Aq Mt kib@FreeBSD.org . +.An Konstantin Belousov Aq Mt kib@FreeBSD.org +and +.An Conrad Meyer Aq Mt cem@FreeBSD.org . The key schedule calculation code was adopted from the sample provided by Intel and used in the analogous .Ox driver. +The hash step intrinsics implementations were supplied by Intel. Modified: projects/runtime-coverage/share/man/man5/procfs.5 ============================================================================== --- projects/runtime-coverage/share/man/man5/procfs.5 Thu Sep 28 01:27:00 2017 (r324075) +++ projects/runtime-coverage/share/man/man5/procfs.5 Thu Sep 28 05:20:37 2017 (r324076) @@ -196,7 +196,6 @@ file system on .Xr mount 2 , .Xr sigaction 2 , .Xr unmount 2 , -.Xr procctl 8 , .Xr pseudofs 9 .Sh AUTHORS .An -nosplit Modified: projects/runtime-coverage/share/man/man9/Makefile ============================================================================== --- projects/runtime-coverage/share/man/man9/Makefile Thu Sep 28 01:27:00 2017 (r324075) +++ projects/runtime-coverage/share/man/man9/Makefile Thu Sep 28 05:20:37 2017 (r324076) @@ -1929,7 +1929,6 @@ MLINKS+=ucred.9 cred_update_thread.9 \ ucred.9 crget.9 \ ucred.9 crhold.9 \ ucred.9 crsetgroups.9 \ - ucred.9 crshared.9 \ ucred.9 cru2x.9 MLINKS+=uidinfo.9 uifind.9 \ uidinfo.9 uifree.9 \ Modified: projects/runtime-coverage/share/man/man9/ucred.9 ============================================================================== --- projects/runtime-coverage/share/man/man9/ucred.9 Thu Sep 28 01:27:00 2017 (r324075) +++ projects/runtime-coverage/share/man/man9/ucred.9 Thu Sep 28 05:20:37 2017 (r324076) @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 19, 2009 +.Dd September 27, 2017 .Dt UCRED 9 .Os .Sh NAME @@ -34,7 +34,6 @@ .Nm crget , .Nm crhold , .Nm crfree , -.Nm crshared , .Nm crcopy , .Nm crdup , .Nm cru2x , @@ -49,8 +48,6 @@ .Fn crhold "struct ucred *cr" .Ft void .Fn crfree "struct ucred *cr" -.Ft int -.Fn crshared "struct ucred *cr" .Ft void .Fn crcopy "struct ucred *dest" "struct ucred *src" .Ft "struct ucred *" @@ -86,12 +83,6 @@ function decreases the reference count on the credenti If the count drops to 0, the storage for the structure is freed. .Pp The -.Fn crshared -function returns true if the credential is shared. -A credential is considered to be shared if its reference -count is greater than one. -.Pp -The .Fn crcopy function copies the contents of the source (template) credential into the destination template. @@ -170,10 +161,6 @@ and all return a pointer to a .Vt ucred structure. -.Pp -.Fn crshared -returns 0 if the credential has a reference count greater than 1; -otherwise, 1 is returned. .Sh USAGE NOTES As of .Fx 5.0 , Modified: projects/runtime-coverage/sys/arm/allwinner/a10_ehci.c ============================================================================== --- projects/runtime-coverage/sys/arm/allwinner/a10_ehci.c Thu Sep 28 01:27:00 2017 (r324075) +++ projects/runtime-coverage/sys/arm/allwinner/a10_ehci.c Thu Sep 28 05:20:37 2017 (r324076) @@ -88,11 +88,21 @@ __FBSDID("$FreeBSD$"); static device_attach_t a10_ehci_attach; static device_detach_t a10_ehci_detach; +struct clk_list { + TAILQ_ENTRY(clk_list) next; + clk_t clk; +}; + +struct hwrst_list { + TAILQ_ENTRY(hwrst_list) next; + hwreset_t rst; +}; + struct aw_ehci_softc { ehci_softc_t sc; - clk_t clk; - hwreset_t rst; - phy_t phy; + TAILQ_HEAD(, clk_list) clk_list; + TAILQ_HEAD(, hwrst_list) rst_list; + phy_t phy; }; struct aw_ehci_conf { @@ -114,6 +124,7 @@ static struct ofw_compat_data compat_data[] = { { "allwinner,sun7i-a20-ehci", (uintptr_t)&a10_ehci_conf }, { "allwinner,sun8i-a83t-ehci", (uintptr_t)&a31_ehci_conf }, { "allwinner,sun8i-h3-ehci", (uintptr_t)&a31_ehci_conf }, + /* { "allwinner,sun50i-a64-ehci", (uintptr_t)&a31_ehci_conf }, */ { NULL, (uintptr_t)NULL } }; @@ -139,8 +150,11 @@ a10_ehci_attach(device_t self) ehci_softc_t *sc = &aw_sc->sc; const struct aw_ehci_conf *conf; bus_space_handle_t bsh; - int err; - int rid; + int err, rid, off; + struct clk_list *clkp; + clk_t clk; + struct hwrst_list *rstp; + hwreset_t rst; uint32_t reg_value = 0; conf = USB_CONF(self); @@ -204,27 +218,33 @@ a10_ehci_attach(device_t self) sc->sc_flags |= EHCI_SCFLG_DONTRESET; + /* Enable clock for USB */ + TAILQ_INIT(&aw_sc->clk_list); + for (off = 0; clk_get_by_ofw_index(self, 0, off, &clk) == 0; off++) { + err = clk_enable(clk); + if (err != 0) { + device_printf(self, "Could not enable clock %s\n", + clk_get_name(clk)); + goto error; + } + clkp = malloc(sizeof(*clkp), M_DEVBUF, M_WAITOK | M_ZERO); + clkp->clk = clk; + TAILQ_INSERT_TAIL(&aw_sc->clk_list, clkp, next); + } + /* De-assert reset */ - if (hwreset_get_by_ofw_idx(self, 0, 0, &aw_sc->rst) == 0) { - err = hwreset_deassert(aw_sc->rst); + TAILQ_INIT(&aw_sc->rst_list); + for (off = 0; hwreset_get_by_ofw_idx(self, 0, off, &rst) == 0; off++) { + err = hwreset_deassert(rst); if (err != 0) { device_printf(self, "Could not de-assert reset\n"); goto error; } + rstp = malloc(sizeof(*rstp), M_DEVBUF, M_WAITOK | M_ZERO); + rstp->rst = rst; + TAILQ_INSERT_TAIL(&aw_sc->rst_list, rstp, next); } - /* Enable clock for USB */ - err = clk_get_by_ofw_index(self, 0, 0, &aw_sc->clk); - if (err != 0) { - device_printf(self, "Could not get clock\n"); - goto error; - } - err = clk_enable(aw_sc->clk); - if (err != 0) { - device_printf(self, "Could not enable clock\n"); - goto error; - } - /* Enable USB PHY */ if (phy_get_by_ofw_name(self, 0, "usb", &aw_sc->phy) == 0) { err = phy_enable(self, aw_sc->phy); @@ -272,6 +292,8 @@ a10_ehci_detach(device_t self) const struct aw_ehci_conf *conf; int err; uint32_t reg_value = 0; + struct clk_list *clk, *clk_tmp; + struct hwrst_list *rst, *rst_tmp; conf = USB_CONF(self); @@ -319,16 +341,26 @@ a10_ehci_detach(device_t self) reg_value &= ~SW_ULPI_BYPASS; /* ULPI bypass disable */ A10_WRITE_4(sc, SW_USB_PMU_IRQ_ENABLE, reg_value); - /* Disable clock for USB */ - if (aw_sc->clk != NULL) { - clk_disable(aw_sc->clk); - clk_release(aw_sc->clk); + /* Disable clock */ + TAILQ_FOREACH_SAFE(clk, &aw_sc->clk_list, next, clk_tmp) { + err = clk_disable(clk->clk); + if (err != 0) + device_printf(self, "Could not disable clock %s\n", + clk_get_name(clk->clk)); + err = clk_release(clk->clk); + if (err != 0) + device_printf(self, "Could not release clock %s\n", + clk_get_name(clk->clk)); + TAILQ_REMOVE(&aw_sc->clk_list, clk, next); + free(clk, M_DEVBUF); } /* Assert reset */ - if (aw_sc->rst != NULL) { - hwreset_assert(aw_sc->rst); - hwreset_release(aw_sc->rst); + TAILQ_FOREACH_SAFE(rst, &aw_sc->rst_list, next, rst_tmp) { + hwreset_assert(rst->rst); + hwreset_release(rst->rst); + TAILQ_REMOVE(&aw_sc->rst_list, rst, next); + free(rst, M_DEVBUF); } return (0); Modified: projects/runtime-coverage/sys/arm/allwinner/a10_gpio.c ============================================================================== --- projects/runtime-coverage/sys/arm/allwinner/a10_gpio.c Thu Sep 28 01:27:00 2017 (r324075) +++ projects/runtime-coverage/sys/arm/allwinner/a10_gpio.c Thu Sep 28 05:20:37 2017 (r324076) @@ -165,6 +165,11 @@ static struct ofw_compat_data compat_data[] = { {NULL, 0} }; +struct clk_list { + TAILQ_ENTRY(clk_list) next; + clk_t clk; +}; + struct a10_gpio_softc { device_t sc_dev; device_t sc_busdev; @@ -175,6 +180,7 @@ struct a10_gpio_softc { bus_space_handle_t sc_bsh; void * sc_intrhand; const struct allwinner_padconf * padconf; + TAILQ_HEAD(, clk_list) clk_list; }; #define A10_GPIO_LOCK(_sc) mtx_lock_spin(&(_sc)->sc_mtx) @@ -766,8 +772,10 @@ a10_gpio_attach(device_t dev) int rid, error; phandle_t gpio; struct a10_gpio_softc *sc; + struct clk_list *clkp, *clkp_tmp; clk_t clk; - hwreset_t rst; + hwreset_t rst = NULL; + int off, err; sc = device_get_softc(dev); sc->sc_dev = dev; @@ -811,12 +819,17 @@ a10_gpio_attach(device_t dev) } } - if (clk_get_by_ofw_index(dev, 0, 0, &clk) == 0) { - error = clk_enable(clk); - if (error != 0) { - device_printf(dev, "could not enable clock\n"); - return (error); + TAILQ_INIT(&sc->clk_list); + for (off = 0; clk_get_by_ofw_index(dev, 0, off, &clk) == 0; off++) { + err = clk_enable(clk); + if (err != 0) { + device_printf(dev, "Could not enable clock %s\n", + clk_get_name(clk)); + goto fail; } + clkp = malloc(sizeof(*clkp), M_DEVBUF, M_WAITOK | M_ZERO); + clkp->clk = clk; + TAILQ_INSERT_TAIL(&sc->clk_list, clkp, next); } sc->sc_busdev = gpiobus_attach_bus(dev); @@ -839,6 +852,26 @@ fail: if (sc->sc_mem_res) bus_release_resource(dev, SYS_RES_MEMORY, 0, sc->sc_mem_res); mtx_destroy(&sc->sc_mtx); + + /* Disable clock */ + TAILQ_FOREACH_SAFE(clkp, &sc->clk_list, next, clkp_tmp) { + err = clk_disable(clkp->clk); + if (err != 0) + device_printf(dev, "Could not disable clock %s\n", + clk_get_name(clkp->clk)); + err = clk_release(clkp->clk); + if (err != 0) + device_printf(dev, "Could not release clock %s\n", + clk_get_name(clkp->clk)); + TAILQ_REMOVE(&sc->clk_list, clkp, next); + free(clkp, M_DEVBUF); + } + + /* Assert resets */ + if (rst) { + hwreset_assert(rst); + hwreset_release(rst); + } return (ENXIO); } Modified: projects/runtime-coverage/sys/arm/allwinner/aw_usbphy.c ============================================================================== --- projects/runtime-coverage/sys/arm/allwinner/aw_usbphy.c Thu Sep 28 01:27:00 2017 (r324075) +++ projects/runtime-coverage/sys/arm/allwinner/aw_usbphy.c Thu Sep 28 05:20:37 2017 (r324076) @@ -158,15 +158,8 @@ awusbphy_configure(device_t dev, int phyno) return; if (sc->phy_conf->pmu_unk1 == true) - CLR4(sc->phy_ctrl, PMU_UNK_H3, PMU_UNK_H3_CLR); + CLR4(sc->pmu[phyno], PMU_UNK_H3, PMU_UNK_H3_CLR); - if (sc->phy_conf->phy0_route == true) { - if (phyno == 0) - SET4(sc->phy_ctrl, OTG_PHY_CFG, OTG_PHY_ROUTE_OTG); - else - CLR4(sc->phy_ctrl, OTG_PHY_CFG, OTG_PHY_ROUTE_OTG); - } - SET4(sc->pmu[phyno], PMU_IRQ_ENABLE, PMU_ULPI_BYPASS | PMU_AHB_INCR8 | PMU_AHB_INCR4 | PMU_AHB_INCRX_ALIGN); } @@ -266,8 +259,11 @@ awusbphy_vbus_detect(device_t dev, int *val) if (sc->vbus_det_valid) { error = gpio_pin_is_active(sc->vbus_det_pin, &active); - if (error != 0) + if (error != 0) { + device_printf(dev, "Cannot get status of id pin %d\n", + error); return (error); + } *val = active; return (0); } @@ -300,7 +296,21 @@ awusbphy_phy_enable(device_t dev, intptr_t phy, bool e /* If an external vbus is detected, do not enable phy 0 */ if (phy == 0) { error = awusbphy_vbus_detect(dev, &vbus_det); - if (error == 0 && vbus_det == 1) + if (error) + goto out; + + /* Depending on the PHY we need to route OTG to OHCI/EHCI */ + if (sc->phy_conf->phy0_route == true) { + if (vbus_det == 0) + /* Host mode */ + CLR4(sc->phy_ctrl, OTG_PHY_CFG, + OTG_PHY_ROUTE_OTG); + else + /* Peripheral mode */ + SET4(sc->phy_ctrl, OTG_PHY_CFG, + OTG_PHY_ROUTE_OTG); + } + if (vbus_det == 1) return (0); } else error = 0; @@ -308,6 +318,8 @@ awusbphy_phy_enable(device_t dev, intptr_t phy, bool e error = regulator_enable(reg); } else error = regulator_disable(reg); + +out: if (error != 0) { device_printf(dev, "couldn't %s regulator for phy %jd\n", Modified: projects/runtime-coverage/sys/boot/efi/libefi/efipart.c ============================================================================== --- projects/runtime-coverage/sys/boot/efi/libefi/efipart.c Thu Sep 28 01:27:00 2017 (r324075) +++ projects/runtime-coverage/sys/boot/efi/libefi/efipart.c Thu Sep 28 05:20:37 2017 (r324076) @@ -181,7 +181,7 @@ efipart_inithandles(void) static ACPI_HID_DEVICE_PATH * efipart_floppy(EFI_DEVICE_PATH *node) { - ACPI_HID_DEVICE_PATH *acpi = NULL; + ACPI_HID_DEVICE_PATH *acpi; if (DevicePathType(node) == ACPI_DEVICE_PATH && DevicePathSubType(node) == ACPI_DP) { @@ -192,7 +192,7 @@ efipart_floppy(EFI_DEVICE_PATH *node) return (acpi); } } - return (acpi); + return (NULL); } /* Modified: projects/runtime-coverage/sys/cddl/compat/opensolaris/sys/kcondvar.h ============================================================================== --- projects/runtime-coverage/sys/cddl/compat/opensolaris/sys/kcondvar.h Thu Sep 28 01:27:00 2017 (r324075) +++ projects/runtime-coverage/sys/cddl/compat/opensolaris/sys/kcondvar.h Thu Sep 28 05:20:37 2017 (r324076) @@ -63,13 +63,8 @@ static clock_t cv_timedwait_hires(kcondvar_t *cvp, kmutex_t *mp, hrtime_t tim, hrtime_t res, int flag) { - sbintime_t sbt; - sbintime_t pr; - sbt = tim * SBT_1NS; - pr = res * SBT_1NS; - - return (cv_timedwait_sbt(cvp, mp, sbt, pr, 0)); + return (cv_timedwait_sbt(cvp, mp, nstosbt(tim), nstosbt(res), 0)); } #endif /* _KERNEL */ Modified: projects/runtime-coverage/sys/cddl/compat/opensolaris/sys/time.h ============================================================================== --- projects/runtime-coverage/sys/cddl/compat/opensolaris/sys/time.h Thu Sep 28 01:27:00 2017 (r324075) +++ projects/runtime-coverage/sys/cddl/compat/opensolaris/sys/time.h Thu Sep 28 05:20:37 2017 (r324076) @@ -40,6 +40,9 @@ #define MSEC2NSEC(m) ((hrtime_t)(m) * (NANOSEC / MILLISEC)) #define NSEC2MSEC(n) ((n) / (NANOSEC / MILLISEC)) +#define USEC2NSEC(m) ((hrtime_t)(m) * (NANOSEC / MICROSEC)) +#define NSEC2USEC(n) ((n) / (NANOSEC / MICROSEC)) + #define NSEC2SEC(n) ((n) / (NANOSEC / SEC)) #define SEC2NSEC(m) ((hrtime_t)(m) * (NANOSEC / SEC)) Modified: projects/runtime-coverage/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c ============================================================================== --- projects/runtime-coverage/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c Thu Sep 28 01:27:00 2017 (r324075) +++ projects/runtime-coverage/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c Thu Sep 28 05:20:37 2017 (r324076) @@ -339,17 +339,17 @@ static void dtrace_nullop(void) {} -static dtrace_pops_t dtrace_provider_ops = { - (void (*)(void *, dtrace_probedesc_t *))dtrace_nullop, - (void (*)(void *, modctl_t *))dtrace_nullop, - (void (*)(void *, dtrace_id_t, void *))dtrace_nullop, - (void (*)(void *, dtrace_id_t, void *))dtrace_nullop, - (void (*)(void *, dtrace_id_t, void *))dtrace_nullop, - (void (*)(void *, dtrace_id_t, void *))dtrace_nullop, - NULL, - NULL, - NULL, - (void (*)(void *, dtrace_id_t, void *))dtrace_nullop +static dtrace_pops_t dtrace_provider_ops = { + .dtps_provide = (void (*)(void *, dtrace_probedesc_t *))dtrace_nullop, + .dtps_provide_module = (void (*)(void *, modctl_t *))dtrace_nullop, + .dtps_enable = (void (*)(void *, dtrace_id_t, void *))dtrace_nullop, + .dtps_disable = (void (*)(void *, dtrace_id_t, void *))dtrace_nullop, + .dtps_suspend = (void (*)(void *, dtrace_id_t, void *))dtrace_nullop, + .dtps_resume = (void (*)(void *, dtrace_id_t, void *))dtrace_nullop, + .dtps_getargdesc = NULL, + .dtps_getargval = NULL, + .dtps_usermode = NULL, + .dtps_destroy = (void (*)(void *, dtrace_id_t, void *))dtrace_nullop, }; static dtrace_id_t dtrace_probeid_begin; /* special BEGIN probe */ Modified: projects/runtime-coverage/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c ============================================================================== --- projects/runtime-coverage/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c Thu Sep 28 01:27:00 2017 (r324075) +++ projects/runtime-coverage/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c Thu Sep 28 05:20:37 2017 (r324076) @@ -1455,29 +1455,29 @@ static const dtrace_pattr_t pid_attr = { }; static dtrace_pops_t pid_pops = { - fasttrap_pid_provide, - NULL, - fasttrap_pid_enable, - fasttrap_pid_disable, - NULL, *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-projects@freebsd.org Fri Sep 29 04:24:16 2017 Return-Path: Delivered-To: svn-src-projects@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EDECFE223AC for ; Fri, 29 Sep 2017 04:24: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 A78487CC96; Fri, 29 Sep 2017 04:24: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 v8T4OFGS036277; Fri, 29 Sep 2017 04:24:15 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v8T4ODef036253; Fri, 29 Sep 2017 04:24:13 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201709290424.v8T4ODef036253@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Fri, 29 Sep 2017 04:24:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r324096 - in projects/runtime-coverage: sys/dev/hyperv/netvsc sys/dev/neta sys/dev/smc sys/dev/usb sys/dev/usb/net sys/fs/nfs sys/fs/nfsclient sys/i386/i386 sys/i386/include sys/i386/is... X-SVN-Group: projects X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: in projects/runtime-coverage: sys/dev/hyperv/netvsc sys/dev/neta sys/dev/smc sys/dev/usb sys/dev/usb/net sys/fs/nfs sys/fs/nfsclient sys/i386/i386 sys/i386/include sys/i386/isa sys/kern sys/netgraph s... X-SVN-Commit-Revision: 324096 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Sep 2017 04:24:17 -0000 Author: ngie Date: Fri Sep 29 04:24:13 2017 New Revision: 324096 URL: https://svnweb.freebsd.org/changeset/base/324096 Log: MFhead@r324095 Modified: projects/runtime-coverage/sys/dev/hyperv/netvsc/if_hn.c projects/runtime-coverage/sys/dev/neta/if_mvneta.c projects/runtime-coverage/sys/dev/smc/if_smc.c projects/runtime-coverage/sys/dev/usb/net/if_ure.c projects/runtime-coverage/sys/dev/usb/usbdevs projects/runtime-coverage/sys/fs/nfs/nfs_commonsubs.c projects/runtime-coverage/sys/fs/nfs/nfs_var.h projects/runtime-coverage/sys/fs/nfs/nfsport.h projects/runtime-coverage/sys/fs/nfsclient/nfs_clrpcops.c projects/runtime-coverage/sys/i386/i386/db_trace.c projects/runtime-coverage/sys/i386/i386/exception.s projects/runtime-coverage/sys/i386/i386/genassym.c projects/runtime-coverage/sys/i386/i386/locore.s projects/runtime-coverage/sys/i386/i386/machdep.c projects/runtime-coverage/sys/i386/i386/trap.c projects/runtime-coverage/sys/i386/include/asmacros.h projects/runtime-coverage/sys/i386/include/md_var.h projects/runtime-coverage/sys/i386/isa/npx.c projects/runtime-coverage/sys/kern/imgact_aout.c projects/runtime-coverage/sys/netgraph/ng_iface.c projects/runtime-coverage/sys/vm/vm_object.c projects/runtime-coverage/usr.sbin/config/config.h projects/runtime-coverage/usr.sbin/diskinfo/diskinfo.c Directory Properties: projects/runtime-coverage/ (props changed) Modified: projects/runtime-coverage/sys/dev/hyperv/netvsc/if_hn.c ============================================================================== --- projects/runtime-coverage/sys/dev/hyperv/netvsc/if_hn.c Fri Sep 29 01:19:22 2017 (r324095) +++ projects/runtime-coverage/sys/dev/hyperv/netvsc/if_hn.c Fri Sep 29 04:24:13 2017 (r324096) @@ -61,6 +61,7 @@ __FBSDID("$FreeBSD$"); #include "opt_rss.h" #include +#include #include #include #include @@ -77,7 +78,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include Modified: projects/runtime-coverage/sys/dev/neta/if_mvneta.c ============================================================================== --- projects/runtime-coverage/sys/dev/neta/if_mvneta.c Fri Sep 29 01:19:22 2017 (r324095) +++ projects/runtime-coverage/sys/dev/neta/if_mvneta.c Fri Sep 29 04:24:13 2017 (r324096) @@ -3411,6 +3411,7 @@ sysctl_mvneta_init(struct mvneta_softc *sc) }; #undef MVNETA_SYSCTL_NAME +#ifndef NO_SYSCTL_DESCR #define MVNETA_SYSCTL_DESCR(num) "configuration parameters for queue " # num static const char *sysctl_queue_descrs[] = { MVNETA_SYSCTL_DESCR(0), MVNETA_SYSCTL_DESCR(1), @@ -3419,6 +3420,7 @@ sysctl_mvneta_init(struct mvneta_softc *sc) MVNETA_SYSCTL_DESCR(6), MVNETA_SYSCTL_DESCR(7), }; #undef MVNETA_SYSCTL_DESCR +#endif ctx = device_get_sysctl_ctx(sc->dev); @@ -3442,15 +3444,14 @@ sysctl_mvneta_init(struct mvneta_softc *sc) */ /* dev.mvneta.[unit].mib. */ for (i = 0; i < MVNETA_PORTMIB_NOCOUNTER; i++) { - const char *name = mvneta_mib_list[i].sysctl_name; - const char *desc = mvneta_mib_list[i].desc; struct mvneta_sysctl_mib *mib_arg = &sc->sysctl_mib[i]; mib_arg->sc = sc; mib_arg->index = i; - SYSCTL_ADD_PROC(ctx, mchildren, OID_AUTO, name, + SYSCTL_ADD_PROC(ctx, mchildren, OID_AUTO, + mvneta_mib_list[i].sysctl_name, CTLTYPE_U64|CTLFLAG_RD, (void *)mib_arg, 0, - sysctl_read_mib, "I", desc); + sysctl_read_mib, "I", mvneta_mib_list[i].desc); } SYSCTL_ADD_UQUAD(ctx, mchildren, OID_AUTO, "rx_discard", CTLFLAG_RD, &sc->counter_pdfc, "Port Rx Discard Frame Counter"); Modified: projects/runtime-coverage/sys/dev/smc/if_smc.c ============================================================================== --- projects/runtime-coverage/sys/dev/smc/if_smc.c Fri Sep 29 01:19:22 2017 (r324095) +++ projects/runtime-coverage/sys/dev/smc/if_smc.c Fri Sep 29 04:24:13 2017 (r324096) @@ -782,7 +782,7 @@ smc_task_rx(void *context, int pending) } #ifdef DEVICE_POLLING -static void +static int smc_poll(struct ifnet *ifp, enum poll_cmd cmd, int count) { struct smc_softc *sc; @@ -792,12 +792,13 @@ smc_poll(struct ifnet *ifp, enum poll_cmd cmd, int cou SMC_LOCK(sc); if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) { SMC_UNLOCK(sc); - return; + return (0); } SMC_UNLOCK(sc); if (cmd == POLL_AND_CHECK_STATUS) taskqueue_enqueue(sc->smc_tq, &sc->smc_intr); + return (0); } #endif Modified: projects/runtime-coverage/sys/dev/usb/net/if_ure.c ============================================================================== --- projects/runtime-coverage/sys/dev/usb/net/if_ure.c Fri Sep 29 01:19:22 2017 (r324095) +++ projects/runtime-coverage/sys/dev/usb/net/if_ure.c Fri Sep 29 04:24:13 2017 (r324096) @@ -67,6 +67,7 @@ SYSCTL_INT(_hw_usb_ure, OID_AUTO, debug, CTLFLAG_RWTUN */ static const STRUCT_USB_HOST_ID ure_devs[] = { #define URE_DEV(v,p,i) { USB_VPI(USB_VENDOR_##v, USB_PRODUCT_##v##_##p, i) } + URE_DEV(LENOVO, RTL8153, 0), URE_DEV(REALTEK, RTL8152, URE_FLAG_8152), URE_DEV(REALTEK, RTL8153, 0), #undef URE_DEV Modified: projects/runtime-coverage/sys/dev/usb/usbdevs ============================================================================== --- projects/runtime-coverage/sys/dev/usb/usbdevs Fri Sep 29 01:19:22 2017 (r324095) +++ projects/runtime-coverage/sys/dev/usb/usbdevs Fri Sep 29 04:24:13 2017 (r324096) @@ -2703,6 +2703,7 @@ product LEADTEK 9531 0x2101 9531 GPS /* Lenovo products */ product LENOVO GIGALAN 0x304b USB 3.0 Ethernet product LENOVO ETHERNET 0x7203 USB 2.0 Ethernet +product LENOVO RTL8153 0x7205 USB 3.0 Ethernet /* Lexar products */ product LEXAR JUMPSHOT 0x0001 jumpSHOT CompactFlash Reader Modified: projects/runtime-coverage/sys/fs/nfs/nfs_commonsubs.c ============================================================================== --- projects/runtime-coverage/sys/fs/nfs/nfs_commonsubs.c Fri Sep 29 01:19:22 2017 (r324095) +++ projects/runtime-coverage/sys/fs/nfs/nfs_commonsubs.c Fri Sep 29 04:24:13 2017 (r324096) @@ -3938,14 +3938,13 @@ newnfs_sndunlock(int *flagp) } APPLESTATIC int -nfsv4_getipaddr(struct nfsrv_descript *nd, struct sockaddr_storage *sa, - int *isudp) +nfsv4_getipaddr(struct nfsrv_descript *nd, struct sockaddr_in *sin, + struct sockaddr_in6 *sin6, sa_family_t *saf, int *isudp) { - struct sockaddr_in *sad; - struct sockaddr_in6 *sad6; struct in_addr saddr; uint32_t portnum, *tl; - int af = 0, i, j, k; + int i, j, k; + sa_family_t af = AF_UNSPEC; char addr[64], protocol[5], *cp; int cantparse = 0, error = 0; uint16_t portv; @@ -4023,20 +4022,20 @@ nfsv4_getipaddr(struct nfsrv_descript *nd, struct sock cantparse = 1; if (cantparse == 0) { if (af == AF_INET) { - sad = (struct sockaddr_in *)sa; - if (inet_pton(af, addr, &sad->sin_addr) == 1) { - sad->sin_len = sizeof(*sad); - sad->sin_family = AF_INET; - sad->sin_port = htons(portv); + if (inet_pton(af, addr, &sin->sin_addr) == 1) { + sin->sin_len = sizeof(*sin); + sin->sin_family = AF_INET; + sin->sin_port = htons(portv); + *saf = af; return (0); } } else { - sad6 = (struct sockaddr_in6 *)sa; - if (inet_pton(af, addr, &sad6->sin6_addr) + if (inet_pton(af, addr, &sin6->sin6_addr) == 1) { - sad6->sin6_len = sizeof(*sad6); - sad6->sin6_family = AF_INET6; - sad6->sin6_port = htons(portv); + sin6->sin6_len = sizeof(*sin6); + sin6->sin6_family = AF_INET6; + sin6->sin6_port = htons(portv); + *saf = af; return (0); } } Modified: projects/runtime-coverage/sys/fs/nfs/nfs_var.h ============================================================================== --- projects/runtime-coverage/sys/fs/nfs/nfs_var.h Fri Sep 29 01:19:22 2017 (r324095) +++ projects/runtime-coverage/sys/fs/nfs/nfs_var.h Fri Sep 29 04:24:13 2017 (r324096) @@ -287,8 +287,8 @@ void nfsrv_cleanusergroup(void); int nfsrv_checkutf8(u_int8_t *, int); int newnfs_sndlock(int *); void newnfs_sndunlock(int *); -int nfsv4_getipaddr(struct nfsrv_descript *, struct sockaddr_storage *, - int *); +int nfsv4_getipaddr(struct nfsrv_descript *, struct sockaddr_in *, + struct sockaddr_in6 *, sa_family_t *, int *); int nfsv4_seqsession(uint32_t, uint32_t, uint32_t, struct nfsslot *, struct mbuf **, uint16_t); void nfsv4_seqsess_cacherep(uint32_t, struct nfsslot *, int, struct mbuf **); Modified: projects/runtime-coverage/sys/fs/nfs/nfsport.h ============================================================================== --- projects/runtime-coverage/sys/fs/nfs/nfsport.h Fri Sep 29 01:19:22 2017 (r324095) +++ projects/runtime-coverage/sys/fs/nfs/nfsport.h Fri Sep 29 04:24:13 2017 (r324096) @@ -896,6 +896,7 @@ int newnfs_realign(struct mbuf **, int); #define NFSSTA_HASWRITEVERF 0x00040000 /* Has write verifier */ #define NFSSTA_GOTFSINFO 0x00100000 /* Got the fsinfo */ #define NFSSTA_OPENMODE 0x00200000 /* Must use correct open mode */ +#define NFSSTA_FLEXFILE 0x00800000 /* Use Flex File Layout */ #define NFSSTA_NOLAYOUTCOMMIT 0x04000000 /* Don't do LayoutCommit */ #define NFSSTA_SESSPERSIST 0x08000000 /* Has a persistent session */ #define NFSSTA_TIMEO 0x10000000 /* Experiencing a timeout */ @@ -926,6 +927,7 @@ int newnfs_realign(struct mbuf **, int); #define NFSHASNOLAYOUTCOMMIT(n) ((n)->nm_state & NFSSTA_NOLAYOUTCOMMIT) #define NFSHASSESSPERSIST(n) ((n)->nm_state & NFSSTA_SESSPERSIST) #define NFSHASPNFS(n) ((n)->nm_state & NFSSTA_PNFS) +#define NFSHASFLEXFILE(n) ((n)->nm_state & NFSSTA_FLEXFILE) #define NFSHASOPENMODE(n) ((n)->nm_state & NFSSTA_OPENMODE) #define NFSHASONEOPENOWN(n) (((n)->nm_flag & NFSMNT_ONEOPENOWN) != 0 && \ (n)->nm_minorvers > 0) Modified: projects/runtime-coverage/sys/fs/nfsclient/nfs_clrpcops.c ============================================================================== --- projects/runtime-coverage/sys/fs/nfsclient/nfs_clrpcops.c Fri Sep 29 01:19:22 2017 (r324095) +++ projects/runtime-coverage/sys/fs/nfsclient/nfs_clrpcops.c Fri Sep 29 04:24:13 2017 (r324096) @@ -109,8 +109,8 @@ static int nfsrpc_setaclrpc(vnode_t, struct ucred *, N static int nfsrpc_getlayout(struct nfsmount *, vnode_t, struct nfsfh *, int, uint32_t *, nfsv4stateid_t *, uint64_t, struct nfscllayout **, struct ucred *, NFSPROC_T *); -static int nfsrpc_fillsa(struct nfsmount *, struct sockaddr_storage *, - struct nfsclds **, NFSPROC_T *); +static int nfsrpc_fillsa(struct nfsmount *, struct sockaddr_in *, + struct sockaddr_in6 *, sa_family_t, int, struct nfsclds **, NFSPROC_T *); static void nfscl_initsessionslots(struct nfsclsession *); static int nfscl_doflayoutio(vnode_t, struct uio *, int *, int *, int *, nfsv4stateid_t *, int, struct nfscldevinfo *, struct nfscllayout *, @@ -4885,14 +4885,17 @@ nfsrpc_getdeviceinfo(struct nfsmount *nmp, uint8_t *de uint32_t cnt, *tl; struct nfsrv_descript nfsd; struct nfsrv_descript *nd = &nfsd; - struct sockaddr_storage ss; - struct nfsclds *dsp = NULL, **dspp; + struct sockaddr_in sin, ssin; + struct sockaddr_in6 sin6, ssin6; + struct nfsclds *dsp = NULL, **dspp, **gotdspp; struct nfscldevinfo *ndi; - int addrcnt, bitcnt, error, i, isudp, j, pos, safilled, stripecnt; + int addrcnt = 0, bitcnt, error, gotvers, i, isudp, j, stripecnt; uint8_t stripeindex; + sa_family_t af, safilled; *ndip = NULL; ndi = NULL; + gotdspp = NULL; nfscl_reqstart(nd, NFSPROC_GETDEVICEINFO, nmp, NULL, 0, NULL, NULL, 0, 0); NFSM_BUILD(tl, uint32_t *, NFSX_V4DEVICEID + 3 * NFSX_UNSIGNED); @@ -4960,7 +4963,7 @@ nfsrpc_getdeviceinfo(struct nfsmount *nmp, uint8_t *de } /* Now, dissect the server address(es). */ - safilled = 0; + safilled = AF_UNSPEC; for (i = 0; i < addrcnt; i++) { NFSM_DISSECT(tl, uint32_t *, NFSX_UNSIGNED); cnt = fxdr_unsigned(uint32_t, *tl); @@ -4970,61 +4973,65 @@ nfsrpc_getdeviceinfo(struct nfsmount *nmp, uint8_t *de goto nfsmout; } dspp = nfsfldi_addr(ndi, i); - pos = arc4random() % cnt; /* Choose one. */ - safilled = 0; + safilled = AF_UNSPEC; for (j = 0; j < cnt; j++) { - error = nfsv4_getipaddr(nd, &ss, &isudp); + error = nfsv4_getipaddr(nd, &sin, &sin6, &af, + &isudp); if (error != 0 && error != EPERM) { error = NFSERR_BADXDR; goto nfsmout; } if (error == 0 && isudp == 0) { /* - * The algorithm is: - * - use "pos" entry if it is of the - * same af_family or none of them - * is of the same af_family - * else - * - use the first one of the same - * af_family. + * The priority is: + * - Same address family. + * Save the address and dspp, so that + * the connection can be done after + * parsing is complete. */ - if ((safilled == 0 && ss.ss_family == - nmp->nm_nam->sa_family) || - (j == pos && - (safilled == 0 || ss.ss_family == - nmp->nm_nam->sa_family)) || - (safilled == 1 && ss.ss_family == - nmp->nm_nam->sa_family)) { - error = nfsrpc_fillsa(nmp, &ss, - &dsp, p); - if (error == 0) { - *dspp = dsp; - if (ss.ss_family == - nmp->nm_nam->sa_family) - safilled = 2; - else - safilled = 1; - } + if (safilled == AF_UNSPEC || + (af == nmp->nm_nam->sa_family && + safilled != nmp->nm_nam->sa_family) + ) { + if (af == AF_INET) + ssin = sin; + else + ssin6 = sin6; + safilled = af; + gotdspp = dspp; } } } - if (safilled == 0) - break; } + gotvers = NFS_VER4; /* Always NFSv4 for File Layout. */ + /* And the notify bits. */ NFSM_DISSECT(tl, uint32_t *, NFSX_UNSIGNED); - if (safilled != 0) { - bitcnt = fxdr_unsigned(int, *tl); - if (bitcnt > 0) { - NFSM_DISSECT(tl, uint32_t *, NFSX_UNSIGNED); - if (notifybitsp != NULL) - *notifybitsp = - fxdr_unsigned(uint32_t, *tl); - } + bitcnt = fxdr_unsigned(int, *tl); + if (bitcnt > 0) { + NFSM_DISSECT(tl, uint32_t *, NFSX_UNSIGNED); + if (notifybitsp != NULL) + *notifybitsp = + fxdr_unsigned(uint32_t, *tl); + } + if (safilled != AF_UNSPEC) { + KASSERT(ndi != NULL, ("ndi is NULL")); *ndip = ndi; } else error = EPERM; + if (error == 0) { + /* + * Now we can do a TCP connection for the correct + * NFS version and IP address. + */ + error = nfsrpc_fillsa(nmp, &ssin, &ssin6, safilled, + gotvers, &dsp, p); + } + if (error == 0) { + KASSERT(gotdspp != NULL, ("gotdspp is NULL")); + *gotdspp = dsp; + } } if (nd->nd_repstat != 0) error = nd->nd_repstat; @@ -5213,11 +5220,12 @@ nfsrpc_getlayout(struct nfsmount *nmp, vnode_t vp, str * mount point and a pointer to it is returned. */ static int -nfsrpc_fillsa(struct nfsmount *nmp, struct sockaddr_storage *ssp, - struct nfsclds **dspp, NFSPROC_T *p) +nfsrpc_fillsa(struct nfsmount *nmp, struct sockaddr_in *sin, + struct sockaddr_in6 *sin6, sa_family_t af, int vers, struct nfsclds **dspp, + NFSPROC_T *p) { - struct sockaddr_in *msad, *sad, *ssd; - struct sockaddr_in6 *msad6, *sad6, *ssd6; + struct sockaddr_in *msad, *sad; + struct sockaddr_in6 *msad6, *sad6; struct nfsclclient *clp; struct nfssockreq *nrp; struct nfsclds *dsp, *tdsp; @@ -5232,10 +5240,8 @@ nfsrpc_fillsa(struct nfsmount *nmp, struct sockaddr_st NFSUNLOCKCLSTATE(); if (clp == NULL) return (EPERM); - if (ssp->ss_family == AF_INET) { - ssd = (struct sockaddr_in *)ssp; + if (af == AF_INET) { NFSLOCKMNT(nmp); - /* * Check to see if we already have a session for this * address that is usable for a DS. @@ -5246,8 +5252,8 @@ nfsrpc_fillsa(struct nfsmount *nmp, struct sockaddr_st tdsp = TAILQ_FIRST(&nmp->nm_sess); while (tdsp != NULL) { if (msad != NULL && msad->sin_family == AF_INET && - ssd->sin_addr.s_addr == msad->sin_addr.s_addr && - ssd->sin_port == msad->sin_port && + sin->sin_addr.s_addr == msad->sin_addr.s_addr && + sin->sin_port == msad->sin_port && (tdsp->nfsclds_flags & NFSCLDS_DS) != 0 && tdsp->nfsclds_sess.nfsess_defunct == 0) { *dspp = tdsp; @@ -5268,14 +5274,12 @@ nfsrpc_fillsa(struct nfsmount *nmp, struct sockaddr_st sad = malloc(sizeof(*sad), M_SONAME, M_WAITOK | M_ZERO); sad->sin_len = sizeof(*sad); sad->sin_family = AF_INET; - sad->sin_port = ssd->sin_port; - sad->sin_addr.s_addr = ssd->sin_addr.s_addr; + sad->sin_port = sin->sin_port; + sad->sin_addr.s_addr = sin->sin_addr.s_addr; nrp = malloc(sizeof(*nrp), M_NFSSOCKREQ, M_WAITOK | M_ZERO); nrp->nr_nam = (struct sockaddr *)sad; - } else if (ssp->ss_family == AF_INET6) { - ssd6 = (struct sockaddr_in6 *)ssp; + } else if (af == AF_INET6) { NFSLOCKMNT(nmp); - /* * Check to see if we already have a session for this * address that is usable for a DS. @@ -5286,9 +5290,9 @@ nfsrpc_fillsa(struct nfsmount *nmp, struct sockaddr_st tdsp = TAILQ_FIRST(&nmp->nm_sess); while (tdsp != NULL) { if (msad6 != NULL && msad6->sin6_family == AF_INET6 && - IN6_ARE_ADDR_EQUAL(&ssd6->sin6_addr, + IN6_ARE_ADDR_EQUAL(&sin6->sin6_addr, &msad6->sin6_addr) && - ssd6->sin6_port == msad6->sin6_port && + sin6->sin6_port == msad6->sin6_port && (tdsp->nfsclds_flags & NFSCLDS_DS) != 0 && tdsp->nfsclds_sess.nfsess_defunct == 0) { *dspp = tdsp; @@ -5308,8 +5312,8 @@ nfsrpc_fillsa(struct nfsmount *nmp, struct sockaddr_st sad6 = malloc(sizeof(*sad6), M_SONAME, M_WAITOK | M_ZERO); sad6->sin6_len = sizeof(*sad6); sad6->sin6_family = AF_INET6; - sad6->sin6_port = ssd6->sin6_port; - NFSBCOPY(&ssd6->sin6_addr, &sad6->sin6_addr, + sad6->sin6_port = sin6->sin6_port; + NFSBCOPY(&sin6->sin6_addr, &sad6->sin6_addr, sizeof(struct in6_addr)); nrp = malloc(sizeof(*nrp), M_NFSSOCKREQ, M_WAITOK | M_ZERO); nrp->nr_nam = (struct sockaddr *)sad6; @@ -5319,7 +5323,7 @@ nfsrpc_fillsa(struct nfsmount *nmp, struct sockaddr_st nrp->nr_sotype = SOCK_STREAM; mtx_init(&nrp->nr_mtx, "nfssock", NULL, MTX_DEF); nrp->nr_prog = NFS_PROG; - nrp->nr_vers = NFS_VER4; + nrp->nr_vers = vers; /* * Use the credentials that were used for the mount, which are Modified: projects/runtime-coverage/sys/i386/i386/db_trace.c ============================================================================== --- projects/runtime-coverage/sys/i386/i386/db_trace.c Fri Sep 29 01:19:22 2017 (r324095) +++ projects/runtime-coverage/sys/i386/i386/db_trace.c Fri Sep 29 04:24:13 2017 (r324096) @@ -326,7 +326,8 @@ db_nextframe(struct i386_frame **fp, db_addr_t *ip, st else if (strncmp(name, "Xatpic_intr", 11) == 0 || strncmp(name, "Xapic_isr", 9) == 0) frame_type = INTERRUPT; - else if (strcmp(name, "Xint0x80_syscall") == 0) + else if (strcmp(name, "Xlcall_syscall") == 0 || + strcmp(name, "Xint0x80_syscall") == 0) frame_type = SYSCALL; else if (strcmp(name, "dblfault_handler") == 0) frame_type = DOUBLE_FAULT; Modified: projects/runtime-coverage/sys/i386/i386/exception.s ============================================================================== --- projects/runtime-coverage/sys/i386/i386/exception.s Fri Sep 29 01:19:22 2017 (r324095) +++ projects/runtime-coverage/sys/i386/i386/exception.s Fri Sep 29 04:24:13 2017 (r324096) @@ -98,16 +98,15 @@ MCOUNT_LABEL(user) MCOUNT_LABEL(btrap) #define TRAP(a) pushl $(a) ; jmp alltraps -#define TRAP_NOEN(a) pushl $(a) ; jmp alltraps_noen IDTVEC(div) pushl $0; TRAP(T_DIVIDE) IDTVEC(dbg) - pushl $0; TRAP_NOEN(T_TRCTRAP) + pushl $0; TRAP(T_TRCTRAP) IDTVEC(nmi) - pushl $0; TRAP_NOEN(T_NMI) + pushl $0; TRAP(T_NMI) IDTVEC(bpt) - pushl $0; TRAP_NOEN(T_BPTFLT) + pushl $0; TRAP(T_BPTFLT) IDTVEC(dtrace_ret) pushl $0; TRAP(T_DTRACE_RET) IDTVEC(ofl) @@ -131,7 +130,7 @@ IDTVEC(stk) IDTVEC(prot) TRAP(T_PROTFLT) IDTVEC(page) - TRAP_NOEN(T_PAGEFLT) + TRAP(T_PAGEFLT) IDTVEC(mchk) pushl $0; TRAP(T_MCHK) IDTVEC(rsvd) @@ -143,21 +142,6 @@ IDTVEC(align) IDTVEC(xmm) pushl $0; TRAP(T_XMMFLT) - SUPERALIGN_TEXT - .globl alltraps_noen -alltraps_noen: - pushal - pushl $0 - movw %ds,(%esp) - pushl $0 - movw %es,(%esp) - pushl $0 - movw %fs,(%esp) - SET_KERNEL_SREGS - cld - FAKE_MCOUNT(TF_EIP(%esp)) - jmp calltrap - /* * All traps except ones for syscalls jump to alltraps. If * interrupts were enabled when the trap occurred, then interrupts @@ -180,7 +164,6 @@ alltraps: movw %fs,(%esp) alltraps_with_regs_pushed: SET_KERNEL_SREGS - sti cld FAKE_MCOUNT(TF_EIP(%esp)) calltrap: @@ -242,6 +225,40 @@ norm_ill: #endif /* + * Call gate entry for syscalls (lcall 7,0). + * This is used by FreeBSD 1.x a.out executables and "old" NetBSD executables. + * + * The intersegment call has been set up to specify one dummy parameter. + * This leaves a place to put eflags so that the call frame can be + * converted to a trap frame. Note that the eflags is (semi-)bogusly + * pushed into (what will be) tf_err and then copied later into the + * final spot. It has to be done this way because esp can't be just + * temporarily altered for the pushfl - an interrupt might come in + * and clobber the saved cs/eip. + */ + SUPERALIGN_TEXT +IDTVEC(lcall_syscall) + pushfl /* save eflags */ + popl 8(%esp) /* shuffle into tf_eflags */ + pushl $7 /* sizeof "lcall 7,0" */ + pushl $0 /* tf_trapno */ + pushal + pushl $0 + movw %ds,(%esp) + pushl $0 + movw %es,(%esp) + pushl $0 + movw %fs,(%esp) + SET_KERNEL_SREGS + cld + FAKE_MCOUNT(TF_EIP(%esp)) + pushl %esp + call syscall + add $4, %esp + MEXITCOUNT + jmp doreti + +/* * Trap gate entry for syscalls (int 0x80). * This is used by FreeBSD ELF executables, "new" NetBSD executables, and all * Linux executables. @@ -262,7 +279,6 @@ IDTVEC(int0x80_syscall) pushl $0 movw %fs,(%esp) SET_KERNEL_SREGS - sti cld FAKE_MCOUNT(TF_EIP(%esp)) pushl %esp @@ -346,7 +362,7 @@ doreti_next: #ifdef HWPMC_HOOKS je doreti_nmi #else - je doreti_notvm86 + je doreti_exit #endif /* * PSL_VM must be checked first since segment registers only @@ -362,7 +378,7 @@ doreti_next: doreti_notvm86: testb $SEL_RPL_MASK,TF_CS(%esp) /* are we returning to user mode? */ - jz doreti_nosegs /* can't handle ASTs now if not */ + jz doreti_exit /* can't handle ASTs now if not */ doreti_ast: /* @@ -399,12 +415,6 @@ doreti_popl_es: .globl doreti_popl_ds doreti_popl_ds: popl %ds - jmp doreti_iret_popal - -doreti_nosegs: - MEXITCOUNT - addl $12,%esp -doreti_iret_popal: popal addl $8,%esp .globl doreti_iret @@ -415,8 +425,16 @@ doreti_iret: * doreti_iret_fault and friends. Alternative return code for * the case where we get a fault in the doreti_exit code * above. trap() (i386/i386/trap.c) catches this specific - * case, sends the process a signal and continues in the - * corresponding place in the code below. + * case, and continues in the corresponding place in the code + * below. + * + * If the fault occured during return to usermode, we recreate + * the trap frame and call trap() to send a signal. Otherwise + * the kernel was tricked into fault by attempt to restore invalid + * usermode segment selectors on return from nested fault or + * interrupt, where interrupted kernel entry code not yet loaded + * kernel selectors. In the latter case, emulate iret and zero + * the invalid selector. */ ALIGN_TEXT .globl doreti_iret_fault @@ -427,18 +445,35 @@ doreti_iret_fault: movw %ds,(%esp) .globl doreti_popl_ds_fault doreti_popl_ds_fault: + testb $SEL_RPL_MASK,TF_CS-TF_DS(%esp) + jz doreti_popl_ds_kfault pushl $0 movw %es,(%esp) .globl doreti_popl_es_fault doreti_popl_es_fault: + testb $SEL_RPL_MASK,TF_CS-TF_ES(%esp) + jz doreti_popl_es_kfault pushl $0 movw %fs,(%esp) .globl doreti_popl_fs_fault doreti_popl_fs_fault: + testb $SEL_RPL_MASK,TF_CS-TF_FS(%esp) + jz doreti_popl_fs_kfault sti movl $0,TF_ERR(%esp) /* XXX should be the error code */ movl $T_PROTFLT,TF_TRAPNO(%esp) jmp alltraps_with_regs_pushed + +doreti_popl_ds_kfault: + movl $0,(%esp) + jmp doreti_popl_ds +doreti_popl_es_kfault: + movl $0,(%esp) + jmp doreti_popl_es +doreti_popl_fs_kfault: + movl $0,(%esp) + jmp doreti_popl_fs + #ifdef HWPMC_HOOKS doreti_nmi: /* @@ -447,7 +482,7 @@ doreti_nmi: * needs a user call chain capture. */ testb $SEL_RPL_MASK,TF_CS(%esp) - jz doreti_nosegs + jz doreti_exit movl PCPU(CURTHREAD),%eax /* curthread present? */ orl %eax,%eax jz doreti_exit Modified: projects/runtime-coverage/sys/i386/i386/genassym.c ============================================================================== --- projects/runtime-coverage/sys/i386/i386/genassym.c Fri Sep 29 01:19:22 2017 (r324095) +++ projects/runtime-coverage/sys/i386/i386/genassym.c Fri Sep 29 04:24:13 2017 (r324096) @@ -156,11 +156,15 @@ ASSYM(PCB_IDT, offsetof(struct pcb, pcb_idt)); ASSYM(PCB_LDT, offsetof(struct pcb, pcb_ldt)); ASSYM(PCB_TR, offsetof(struct pcb, pcb_tr)); +ASSYM(TF_FS, offsetof(struct trapframe, tf_fs)); +ASSYM(TF_ES, offsetof(struct trapframe, tf_es)); +ASSYM(TF_DS, offsetof(struct trapframe, tf_ds)); ASSYM(TF_TRAPNO, offsetof(struct trapframe, tf_trapno)); ASSYM(TF_ERR, offsetof(struct trapframe, tf_err)); ASSYM(TF_EIP, offsetof(struct trapframe, tf_eip)); ASSYM(TF_CS, offsetof(struct trapframe, tf_cs)); ASSYM(TF_EFLAGS, offsetof(struct trapframe, tf_eflags)); + ASSYM(SIGF_HANDLER, offsetof(struct sigframe, sf_ahu.sf_handler)); #ifdef COMPAT_43 ASSYM(SIGF_SC, offsetof(struct osigframe, sf_siginfo.si_sc)); Modified: projects/runtime-coverage/sys/i386/i386/locore.s ============================================================================== --- projects/runtime-coverage/sys/i386/i386/locore.s Fri Sep 29 01:19:22 2017 (r324095) +++ projects/runtime-coverage/sys/i386/i386/locore.s Fri Sep 29 04:24:13 2017 (r324096) @@ -335,44 +335,6 @@ osigcode: pushl %eax /* junk to fake return addr. */ int $0x80 /* enter kernel with args */ 0: jmp 0b - -/* - * The lcall $7,$0 handler cannot use the call gate that does an - * inter-privilege transition. The reason is that the call gate - * does not disable interrupts, and, before the kernel segment registers - * are loaded, we would have a window where the ring 0 code is - * executed with the wrong segments. - * - * Instead, set LDT descriptor 0 as code segment, which reflects - * the lcall $7,$0 back to ring 3 trampoline. The trampoline sets up - * the frame for int $0x80. - */ - ALIGN_TEXT -lcall_tramp: - cmpl $SYS_vfork,%eax - je 1f - pushl %ebp - movl %esp,%ebp - pushl 0x24(%ebp) /* arg 6 */ - pushl 0x20(%ebp) - pushl 0x1c(%ebp) - pushl 0x18(%ebp) - pushl 0x14(%ebp) - pushl 0x10(%ebp) /* arg 1 */ - subl $4,%esp /* gap */ - int $0x80 - leavel - lretl -1: - /* - * vfork handling is special and relies on the libc stub saving - * the return ip in %ecx. Also, we assume that the call was done - * with ucode32 selector in %cs. - */ - int $0x80 - movl $0x33,4(%esp) /* GUCODE32_SEL | SEL_UPL */ - movl %ecx,(%esp) - lretl #endif /* COMPAT_43 */ ALIGN_TEXT @@ -391,9 +353,6 @@ szfreebsd4_sigcode: .globl szosigcode szosigcode: .long esigcode-osigcode - .globl szlcallcode -szlcallcode: - .long esigcode-lcall_tramp #endif .text Modified: projects/runtime-coverage/sys/i386/i386/machdep.c ============================================================================== --- projects/runtime-coverage/sys/i386/i386/machdep.c Fri Sep 29 01:19:22 2017 (r324095) +++ projects/runtime-coverage/sys/i386/i386/machdep.c Fri Sep 29 04:24:13 2017 (r324096) @@ -1513,7 +1513,7 @@ extern inthand_t #ifdef XENHVM IDTVEC(xen_intr_upcall), #endif - IDTVEC(int0x80_syscall); + IDTVEC(lcall_syscall), IDTVEC(int0x80_syscall); #ifdef DDB /* @@ -2157,9 +2157,7 @@ i386_kdb_init(void) register_t init386(int first) { -#ifdef COMPAT_43 - struct segment_descriptor *gdp; -#endif + struct gate_descriptor *gdp; int gsel_tss, metadata_missing, x, pa; struct pcpu *pc; struct xstate_hdr *xhdr; @@ -2248,9 +2246,9 @@ init386(int first) /* exceptions */ for (x = 0; x < NIDT; x++) - setidt(x, &IDTVEC(rsvd), SDT_SYS386IGT, SEL_KPL, + setidt(x, &IDTVEC(rsvd), SDT_SYS386TGT, SEL_KPL, GSEL(GCODE_SEL, SEL_KPL)); - setidt(IDT_DE, &IDTVEC(div), SDT_SYS386IGT, SEL_KPL, + setidt(IDT_DE, &IDTVEC(div), SDT_SYS386TGT, SEL_KPL, GSEL(GCODE_SEL, SEL_KPL)); setidt(IDT_DB, &IDTVEC(dbg), SDT_SYS386IGT, SEL_KPL, GSEL(GCODE_SEL, SEL_KPL)); @@ -2258,39 +2256,39 @@ init386(int first) GSEL(GCODE_SEL, SEL_KPL)); setidt(IDT_BP, &IDTVEC(bpt), SDT_SYS386IGT, SEL_UPL, GSEL(GCODE_SEL, SEL_KPL)); - setidt(IDT_OF, &IDTVEC(ofl), SDT_SYS386IGT, SEL_UPL, + setidt(IDT_OF, &IDTVEC(ofl), SDT_SYS386TGT, SEL_UPL, GSEL(GCODE_SEL, SEL_KPL)); - setidt(IDT_BR, &IDTVEC(bnd), SDT_SYS386IGT, SEL_KPL, + setidt(IDT_BR, &IDTVEC(bnd), SDT_SYS386TGT, SEL_KPL, GSEL(GCODE_SEL, SEL_KPL)); - setidt(IDT_UD, &IDTVEC(ill), SDT_SYS386IGT, SEL_KPL, + setidt(IDT_UD, &IDTVEC(ill), SDT_SYS386TGT, SEL_KPL, GSEL(GCODE_SEL, SEL_KPL)); - setidt(IDT_NM, &IDTVEC(dna), SDT_SYS386IGT, SEL_KPL + setidt(IDT_NM, &IDTVEC(dna), SDT_SYS386TGT, SEL_KPL , GSEL(GCODE_SEL, SEL_KPL)); setidt(IDT_DF, 0, SDT_SYSTASKGT, SEL_KPL, GSEL(GPANIC_SEL, SEL_KPL)); - setidt(IDT_FPUGP, &IDTVEC(fpusegm), SDT_SYS386IGT, SEL_KPL, + setidt(IDT_FPUGP, &IDTVEC(fpusegm), SDT_SYS386TGT, SEL_KPL, GSEL(GCODE_SEL, SEL_KPL)); - setidt(IDT_TS, &IDTVEC(tss), SDT_SYS386IGT, SEL_KPL, + setidt(IDT_TS, &IDTVEC(tss), SDT_SYS386TGT, SEL_KPL, GSEL(GCODE_SEL, SEL_KPL)); - setidt(IDT_NP, &IDTVEC(missing), SDT_SYS386IGT, SEL_KPL, + setidt(IDT_NP, &IDTVEC(missing), SDT_SYS386TGT, SEL_KPL, GSEL(GCODE_SEL, SEL_KPL)); - setidt(IDT_SS, &IDTVEC(stk), SDT_SYS386IGT, SEL_KPL, + setidt(IDT_SS, &IDTVEC(stk), SDT_SYS386TGT, SEL_KPL, GSEL(GCODE_SEL, SEL_KPL)); - setidt(IDT_GP, &IDTVEC(prot), SDT_SYS386IGT, SEL_KPL, + setidt(IDT_GP, &IDTVEC(prot), SDT_SYS386TGT, SEL_KPL, GSEL(GCODE_SEL, SEL_KPL)); setidt(IDT_PF, &IDTVEC(page), SDT_SYS386IGT, SEL_KPL, GSEL(GCODE_SEL, SEL_KPL)); - setidt(IDT_MF, &IDTVEC(fpu), SDT_SYS386IGT, SEL_KPL, + setidt(IDT_MF, &IDTVEC(fpu), SDT_SYS386TGT, SEL_KPL, GSEL(GCODE_SEL, SEL_KPL)); - setidt(IDT_AC, &IDTVEC(align), SDT_SYS386IGT, SEL_KPL, + setidt(IDT_AC, &IDTVEC(align), SDT_SYS386TGT, SEL_KPL, GSEL(GCODE_SEL, SEL_KPL)); - setidt(IDT_MC, &IDTVEC(mchk), SDT_SYS386IGT, SEL_KPL, + setidt(IDT_MC, &IDTVEC(mchk), SDT_SYS386TGT, SEL_KPL, GSEL(GCODE_SEL, SEL_KPL)); - setidt(IDT_XF, &IDTVEC(xmm), SDT_SYS386IGT, SEL_KPL, + setidt(IDT_XF, &IDTVEC(xmm), SDT_SYS386TGT, SEL_KPL, GSEL(GCODE_SEL, SEL_KPL)); - setidt(IDT_SYSCALL, &IDTVEC(int0x80_syscall), SDT_SYS386IGT, SEL_UPL, + setidt(IDT_SYSCALL, &IDTVEC(int0x80_syscall), SDT_SYS386TGT, SEL_UPL, GSEL(GCODE_SEL, SEL_KPL)); #ifdef KDTRACE_HOOKS - setidt(IDT_DTRACE_RET, &IDTVEC(dtrace_ret), SDT_SYS386IGT, SEL_UPL, + setidt(IDT_DTRACE_RET, &IDTVEC(dtrace_ret), SDT_SYS386TGT, SEL_UPL, GSEL(GCODE_SEL, SEL_KPL)); #endif #ifdef XENHVM @@ -2331,9 +2329,9 @@ init386(int first) clock_init(); finishidentcpu(); /* Final stage of CPU initialization */ - setidt(IDT_UD, &IDTVEC(ill), SDT_SYS386IGT, SEL_KPL, + setidt(IDT_UD, &IDTVEC(ill), SDT_SYS386TGT, SEL_KPL, GSEL(GCODE_SEL, SEL_KPL)); - setidt(IDT_GP, &IDTVEC(prot), SDT_SYS386IGT, SEL_KPL, + setidt(IDT_GP, &IDTVEC(prot), SDT_SYS386TGT, SEL_KPL, GSEL(GCODE_SEL, SEL_KPL)); initializecpu(); /* Initialize CPU registers */ initializecpucache(); @@ -2438,21 +2436,17 @@ init386(int first) gdt[GPROC0_SEL].sd.sd_type = SDT_SYS386TSS; /* clear busy bit */ ltr(gsel_tss); -#ifdef COMPAT_43 - /* - * Make a code descriptor to emulate lcall $7,$0 with int - * $0x80. sd_hibase and sd_lobase are set after the sigtramp - * base in the shared table is known. - */ - gdp = &ldt[LSYS5CALLS_SEL].sd; - gdp->sd_type = SDT_MEMERA; - gdp->sd_dpl = SEL_UPL; - gdp->sd_p = 1; - gdp->sd_def32 = 1; - gdp->sd_gran = 1; - gdp->sd_lolimit = 0xffff; - gdp->sd_hilimit = 0xf; -#endif + /* make a call gate to reenter kernel with */ + gdp = &ldt[LSYS5CALLS_SEL].gd; + + x = (int) &IDTVEC(lcall_syscall); + gdp->gd_looffset = x; + gdp->gd_selector = GSEL(GCODE_SEL,SEL_KPL); + gdp->gd_stkcpy = 1; + gdp->gd_type = SDT_SYS386CGT; + gdp->gd_dpl = SEL_UPL; + gdp->gd_p = 1; + gdp->gd_hioffset = x >> 16; /* transfer to user mode */ Modified: projects/runtime-coverage/sys/i386/i386/trap.c ============================================================================== --- projects/runtime-coverage/sys/i386/i386/trap.c Fri Sep 29 01:19:22 2017 (r324095) +++ projects/runtime-coverage/sys/i386/i386/trap.c Fri Sep 29 04:24:13 2017 (r324096) @@ -114,6 +114,8 @@ static int trap_pfault(struct trapframe *, int, vm_off static void trap_fatal(struct trapframe *, vm_offset_t); void dblfault_handler(void); +extern inthand_t IDTVEC(lcall_syscall); + #define MAX_TRAP_MSG 32 static char *trap_msg[] = { "", /* 0 unused */ @@ -627,6 +629,23 @@ user_trctrap_out: case T_TRCTRAP: /* trace trap */ kernel_trctrap: + if (frame->tf_eip == (int)IDTVEC(lcall_syscall)) { + /* + * We've just entered system mode via the + * syscall lcall. Continue single stepping + * silently until the syscall handler has + * saved the flags. + */ + return; + } + if (frame->tf_eip == (int)IDTVEC(lcall_syscall) + 1) { + /* + * The syscall handler has now saved the + * flags. Stop single stepping it. + */ + frame->tf_eflags &= ~PSL_T; + return; + } /* * Ignore debug register trace traps due to * accesses in the user's address space, which Modified: projects/runtime-coverage/sys/i386/include/asmacros.h ============================================================================== --- projects/runtime-coverage/sys/i386/include/asmacros.h Fri Sep 29 01:19:22 2017 (r324095) +++ projects/runtime-coverage/sys/i386/include/asmacros.h Fri Sep 29 04:24:13 2017 (r324096) @@ -153,13 +153,6 @@ pushl $0 ; \ movw %fs,(%esp) -#define POP_FRAME \ - popl %fs ; \ - popl %es ; \ - popl %ds ; \ - popal ; \ - addl $4+4,%esp - /* * Access per-CPU data. */ Modified: projects/runtime-coverage/sys/i386/include/md_var.h ============================================================================== --- projects/runtime-coverage/sys/i386/include/md_var.h Fri Sep 29 01:19:22 2017 (r324095) +++ projects/runtime-coverage/sys/i386/include/md_var.h Fri Sep 29 04:24:13 2017 (r324096) @@ -43,7 +43,6 @@ extern int szfreebsd4_sigcode; #endif #ifdef COMPAT_43 extern int szosigcode; -extern int szlcallcode; #endif extern uint32_t *vm_page_dump; Modified: projects/runtime-coverage/sys/i386/isa/npx.c ============================================================================== --- projects/runtime-coverage/sys/i386/isa/npx.c Fri Sep 29 01:19:22 2017 (r324095) +++ projects/runtime-coverage/sys/i386/isa/npx.c Fri Sep 29 04:24:13 2017 (r324096) @@ -237,7 +237,7 @@ npx_probe(void) } save_idt_npxtrap = idt[IDT_MF]; - setidt(IDT_MF, probetrap, SDT_SYS386IGT, SEL_KPL, + setidt(IDT_MF, probetrap, SDT_SYS386TGT, SEL_KPL, GSEL(GCODE_SEL, SEL_KPL)); /* Modified: projects/runtime-coverage/sys/kern/imgact_aout.c ============================================================================== --- projects/runtime-coverage/sys/kern/imgact_aout.c Fri Sep 29 01:19:22 2017 (r324095) +++ projects/runtime-coverage/sys/kern/imgact_aout.c Fri Sep 29 04:24:13 2017 (r324096) @@ -27,8 +27,6 @@ #include __FBSDID("$FreeBSD$"); -#include "opt_compat.h" - #include #include #include @@ -339,18 +337,3 @@ exec_aout_imgact(struct image_params *imgp) */ static struct execsw aout_execsw = { exec_aout_imgact, "a.out" }; EXEC_SET(aout, aout_execsw); - -#if defined(__i386__) && defined(COMPAT_43) -static void -exec_init_lcall(void *arg __unused) -{ - struct segment_descriptor *gdp; - u_int lcall_addr; - - gdp = &ldt[LSYS5CALLS_SEL].sd; - lcall_addr = aout_sysvec.sv_psstrings - szlcallcode; - gdp->sd_hibase = lcall_addr >> 24; - gdp->sd_lobase = lcall_addr; -} -SYSINIT(aout, SI_SUB_EXEC + 1, SI_ORDER_ANY, exec_init_lcall, NULL); -#endif Modified: projects/runtime-coverage/sys/netgraph/ng_iface.c ============================================================================== --- projects/runtime-coverage/sys/netgraph/ng_iface.c Fri Sep 29 01:19:22 2017 (r324095) +++ projects/runtime-coverage/sys/netgraph/ng_iface.c Fri Sep 29 04:24:13 2017 (r324096) @@ -59,6 +59,7 @@ #include #include #include +#include #include #include #include Modified: projects/runtime-coverage/sys/vm/vm_object.c ============================================================================== --- projects/runtime-coverage/sys/vm/vm_object.c Fri Sep 29 01:19:22 2017 (r324095) +++ projects/runtime-coverage/sys/vm/vm_object.c Fri Sep 29 04:24:13 2017 (r324096) @@ -1990,7 +1990,8 @@ again: goto again; } if (p->wire_count != 0) { - if ((options & OBJPR_NOTMAPPED) == 0) + if ((options & OBJPR_NOTMAPPED) == 0 && + object->ref_count != 0) pmap_remove_all(p); if ((options & OBJPR_CLEANONLY) == 0) { p->valid = 0; @@ -2007,12 +2008,13 @@ again: KASSERT((p->flags & PG_FICTITIOUS) == 0, ("vm_object_page_remove: page %p is fictitious", p)); if ((options & OBJPR_CLEANONLY) != 0 && p->valid != 0) { - if ((options & OBJPR_NOTMAPPED) == 0) + if ((options & OBJPR_NOTMAPPED) == 0 && + object->ref_count != 0) pmap_remove_write(p); - if (p->dirty) + if (p->dirty != 0) continue; } - if ((options & OBJPR_NOTMAPPED) == 0) + if ((options & OBJPR_NOTMAPPED) == 0 && object->ref_count != 0) pmap_remove_all(p); p->flags &= ~PG_ZERO; if (vm_page_free_prep(p, false)) Modified: projects/runtime-coverage/usr.sbin/config/config.h ============================================================================== --- projects/runtime-coverage/usr.sbin/config/config.h Fri Sep 29 01:19:22 2017 (r324095) +++ projects/runtime-coverage/usr.sbin/config/config.h Fri Sep 29 04:24:13 2017 (r324096) @@ -152,7 +152,7 @@ struct includepath { SLIST_HEAD(, includepath) includepath; /* - * Tag present in the kernelconf.tmlp template file. It's mandatory for those + * Tag present in the kernconf.tmpl template file. It's mandatory for those * two strings to be the same. Otherwise you'll get into trouble. */ #define KERNCONFTAG "%%KERNCONFFILE%%" Modified: projects/runtime-coverage/usr.sbin/diskinfo/diskinfo.c ============================================================================== --- projects/runtime-coverage/usr.sbin/diskinfo/diskinfo.c Fri Sep 29 01:19:22 2017 (r324095) +++ projects/runtime-coverage/usr.sbin/diskinfo/diskinfo.c Fri Sep 29 04:24:13 2017 (r324096) *** DIFF OUTPUT TRUNCATED AT 1000 LINES ***