From owner-svn-src-stable@freebsd.org Sun Feb 7 09:51:23 2016 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 968C2AA0243; Sun, 7 Feb 2016 09:51:23 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 502861D9A; Sun, 7 Feb 2016 09:51:23 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u179pM61007563; Sun, 7 Feb 2016 09:51:22 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u179pMco007562; Sun, 7 Feb 2016 09:51:22 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201602070951.u179pMco007562@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 7 Feb 2016 09:51:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r295366 - stable/10/sys/kern X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Feb 2016 09:51:23 -0000 Author: kib Date: Sun Feb 7 09:51:22 2016 New Revision: 295366 URL: https://svnweb.freebsd.org/changeset/base/295366 Log: MFC r295277: When matching brand to the ELF binary by notes, try to find a brand with interpreter name exactly matching one wanted by the binary. Approved by: re (delphij) Modified: stable/10/sys/kern/imgact_elf.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/kern/imgact_elf.c ============================================================================== --- stable/10/sys/kern/imgact_elf.c Sun Feb 7 05:15:51 2016 (r295365) +++ stable/10/sys/kern/imgact_elf.c Sun Feb 7 09:51:22 2016 (r295366) @@ -261,7 +261,7 @@ __elfN(get_brandinfo)(struct image_param int interp_name_len, int32_t *osrel) { const Elf_Ehdr *hdr = (const Elf_Ehdr *)imgp->image_header; - Elf_Brandinfo *bi; + Elf_Brandinfo *bi, *bi_m; boolean_t ret; int i; @@ -273,6 +273,7 @@ __elfN(get_brandinfo)(struct image_param */ /* Look for an ".note.ABI-tag" ELF section */ + bi_m = NULL; for (i = 0; i < MAX_BRANDS; i++) { bi = elf_brand_list[i]; if (bi == NULL) @@ -280,10 +281,28 @@ __elfN(get_brandinfo)(struct image_param if (hdr->e_machine == bi->machine && (bi->flags & (BI_BRAND_NOTE|BI_BRAND_NOTE_MANDATORY)) != 0) { ret = __elfN(check_note)(imgp, bi->brand_note, osrel); + /* + * If note checker claimed the binary, but the + * interpreter path in the image does not + * match default one for the brand, try to + * search for other brands with the same + * interpreter. Either there is better brand + * with the right interpreter, or, failing + * this, we return first brand which accepted + * our note and, optionally, header. + */ + if (ret && bi_m == NULL && (strlen(bi->interp_path) + + 1 != interp_name_len || strncmp(interp, + bi->interp_path, interp_name_len) != 0)) { + bi_m = bi; + ret = 0; + } if (ret) return (bi); } } + if (bi_m != NULL) + return (bi_m); /* If the executable has a brand, search for it in the brand list. */ for (i = 0; i < MAX_BRANDS; i++) { From owner-svn-src-stable@freebsd.org Sun Feb 7 11:38:56 2016 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A4060AA1E40; Sun, 7 Feb 2016 11:38:56 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3CC3D136B; Sun, 7 Feb 2016 11:38:56 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u17BctPZ038783; Sun, 7 Feb 2016 11:38:55 GMT (envelope-from des@FreeBSD.org) Received: (from des@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u17Bctwi038780; Sun, 7 Feb 2016 11:38:55 GMT (envelope-from des@FreeBSD.org) Message-Id: <201602071138.u17Bctwi038780@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: des set sender to des@FreeBSD.org using -f From: =?UTF-8?Q?Dag-Erling_Sm=c3=b8rgrav?= Date: Sun, 7 Feb 2016 11:38:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r295367 - in stable/10: crypto/openssh crypto/openssh/contrib crypto/openssh/contrib/caldera crypto/openssh/contrib/cygwin crypto/openssh/contrib/redhat crypto/openssh/contrib/suse cryp... X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Feb 2016 11:38:56 -0000 Author: des Date: Sun Feb 7 11:38:54 2016 New Revision: 295367 URL: https://svnweb.freebsd.org/changeset/base/295367 Log: MFH (r265214, r294333, r294407, r294467): misc prop fixes MFH (r285975, r287143): register mergeinfo for security fixes MFH (r294497, r294498, r295139): internal documentation MFH (r294328): upgrade to openssh 6.7p1, re-add libwrap MFH (r294332): upgrade to openssh 6.8p1 MFH (r294367): update pam_ssh for api changes MFH (r294909): switch usedns back on MFH (r294336): upgrade to openssh 6.9p1 MFH (r294495): re-enable dsa keys MFH (r294464): upgrade to openssh 7.0p1 MFH (r294496): upgrade to openssh 7.1p2 Approved by: re (gjb) Relnotes: yes Added: stable/10/crypto/openssh/.cvsignore - copied unchanged from r294332, head/crypto/openssh/.cvsignore stable/10/crypto/openssh/bitmap.c (contents, props changed) - copied, changed from r294332, head/crypto/openssh/bitmap.c - copied unchanged from r294332, head/crypto/openssh/bitmap.h stable/10/crypto/openssh/cipher-aesctr.c - copied, changed from r294328, head/crypto/openssh/cipher-aesctr.c stable/10/crypto/openssh/cipher-aesctr.h - copied unchanged from r294328, head/crypto/openssh/cipher-aesctr.h - copied unchanged from r294332, head/crypto/openssh/opacket.c - copied unchanged from r294332, head/crypto/openssh/opacket.h stable/10/crypto/openssh/openbsd-compat/.cvsignore - copied unchanged from r294332, head/crypto/openssh/openbsd-compat/.cvsignore stable/10/crypto/openssh/openbsd-compat/kludge-fd_set.c - copied unchanged from r294328, head/crypto/openssh/openbsd-compat/kludge-fd_set.c - copied unchanged from r294332, head/crypto/openssh/openbsd-compat/md5.c - copied unchanged from r294332, head/crypto/openssh/openbsd-compat/md5.h - copied unchanged from r294332, head/crypto/openssh/openbsd-compat/reallocarray.c stable/10/crypto/openssh/openbsd-compat/regress/.cvsignore - copied unchanged from r294332, head/crypto/openssh/openbsd-compat/regress/.cvsignore stable/10/crypto/openssh/openbsd-compat/regress/opensslvertest.c - copied unchanged from r294328, head/crypto/openssh/openbsd-compat/regress/opensslvertest.c stable/10/crypto/openssh/openbsd-compat/rmd160.c (contents, props changed) - copied, changed from r294332, head/crypto/openssh/openbsd-compat/rmd160.c - copied unchanged from r294332, head/crypto/openssh/openbsd-compat/rmd160.h - copied unchanged from r294332, head/crypto/openssh/openbsd-compat/sha1.c - copied unchanged from r294332, head/crypto/openssh/openbsd-compat/sha1.h stable/10/crypto/openssh/regress/.cvsignore - copied unchanged from r294332, head/crypto/openssh/regress/.cvsignore - copied unchanged from r294336, head/crypto/openssh/regress/cfgparse.sh stable/10/crypto/openssh/regress/hostkey-agent.sh (contents, props changed) - copied, changed from r294332, head/crypto/openssh/regress/hostkey-agent.sh stable/10/crypto/openssh/regress/hostkey-rotate.sh (contents, props changed) - copied, changed from r294332, head/crypto/openssh/regress/hostkey-rotate.sh stable/10/crypto/openssh/regress/keygen-knownhosts.sh (contents, props changed) - copied, changed from r294332, head/crypto/openssh/regress/keygen-knownhosts.sh - copied unchanged from r294332, head/crypto/openssh/regress/limit-keytype.sh - copied unchanged from r294332, head/crypto/openssh/regress/multipubkey.sh stable/10/crypto/openssh/regress/netcat.c (contents, props changed) - copied, changed from r294332, head/crypto/openssh/regress/netcat.c stable/10/crypto/openssh/regress/principals-command.sh (contents, props changed) - copied, changed from r294336, head/crypto/openssh/regress/principals-command.sh stable/10/crypto/openssh/regress/t11.ok - copied unchanged from r294332, head/crypto/openssh/regress/t11.ok stable/10/crypto/openssh/regress/unittests/ - copied from r294328, head/crypto/openssh/regress/unittests/ stable/10/crypto/openssh/regress/unittests/bitmap/ - copied from r294332, head/crypto/openssh/regress/unittests/bitmap/ stable/10/crypto/openssh/regress/unittests/hostkeys/ - copied from r294332, head/crypto/openssh/regress/unittests/hostkeys/ stable/10/crypto/openssh/regress/unittests/kex/ - copied from r294332, head/crypto/openssh/regress/unittests/kex/ - copied unchanged from r294332, head/crypto/openssh/regress/valgrind-unit.sh stable/10/crypto/openssh/scard/.cvsignore - copied unchanged from r294332, head/crypto/openssh/scard/.cvsignore - copied unchanged from r294332, head/crypto/openssh/ssh_api.c - copied unchanged from r294332, head/crypto/openssh/ssh_api.h stable/10/crypto/openssh/sshbuf-getput-basic.c - copied, changed from r294328, head/crypto/openssh/sshbuf-getput-basic.c stable/10/crypto/openssh/sshbuf-getput-crypto.c - copied, changed from r294328, head/crypto/openssh/sshbuf-getput-crypto.c stable/10/crypto/openssh/sshbuf-misc.c - copied, changed from r294328, head/crypto/openssh/sshbuf-misc.c stable/10/crypto/openssh/sshbuf.c - copied, changed from r294328, head/crypto/openssh/sshbuf.c stable/10/crypto/openssh/sshbuf.h - copied, changed from r294328, head/crypto/openssh/sshbuf.h stable/10/crypto/openssh/ssherr.c - copied, changed from r294328, head/crypto/openssh/ssherr.c stable/10/crypto/openssh/ssherr.h - copied, changed from r294328, head/crypto/openssh/ssherr.h stable/10/crypto/openssh/sshkey.c - copied, changed from r294328, head/crypto/openssh/sshkey.c stable/10/crypto/openssh/sshkey.h - copied, changed from r294328, head/crypto/openssh/sshkey.h Directory Properties: stable/10/crypto/openssh/bitmap.h (props changed) stable/10/crypto/openssh/opacket.c (props changed) stable/10/crypto/openssh/opacket.h (props changed) stable/10/crypto/openssh/openbsd-compat/md5.c (props changed) stable/10/crypto/openssh/openbsd-compat/md5.h (props changed) stable/10/crypto/openssh/openbsd-compat/reallocarray.c (props changed) stable/10/crypto/openssh/openbsd-compat/rmd160.h (props changed) stable/10/crypto/openssh/openbsd-compat/sha1.c (props changed) stable/10/crypto/openssh/openbsd-compat/sha1.h (props changed) stable/10/crypto/openssh/regress/cfgparse.sh (props changed) stable/10/crypto/openssh/regress/limit-keytype.sh (props changed) stable/10/crypto/openssh/regress/multipubkey.sh (props changed) stable/10/crypto/openssh/regress/valgrind-unit.sh (props changed) stable/10/crypto/openssh/ssh_api.c (props changed) stable/10/crypto/openssh/ssh_api.h (props changed) Deleted: stable/10/crypto/openssh/compress.c stable/10/crypto/openssh/compress.h stable/10/crypto/openssh/contrib/caldera/ stable/10/crypto/openssh/moduli.0 stable/10/crypto/openssh/scp.0 stable/10/crypto/openssh/sftp-server.0 stable/10/crypto/openssh/sftp.0 stable/10/crypto/openssh/ssh-add.0 stable/10/crypto/openssh/ssh-agent.0 stable/10/crypto/openssh/ssh-keygen.0 stable/10/crypto/openssh/ssh-keyscan.0 stable/10/crypto/openssh/ssh-keysign.0 stable/10/crypto/openssh/ssh-pkcs11-helper.0 stable/10/crypto/openssh/ssh.0 stable/10/crypto/openssh/ssh_config.0 stable/10/crypto/openssh/sshd.0 stable/10/crypto/openssh/sshd_config.0 Modified: stable/10/crypto/openssh/ChangeLog stable/10/crypto/openssh/FREEBSD-upgrade stable/10/crypto/openssh/INSTALL stable/10/crypto/openssh/Makefile.in stable/10/crypto/openssh/OVERVIEW stable/10/crypto/openssh/PROTOCOL stable/10/crypto/openssh/PROTOCOL.agent stable/10/crypto/openssh/PROTOCOL.krl stable/10/crypto/openssh/PROTOCOL.mux stable/10/crypto/openssh/README stable/10/crypto/openssh/addrmatch.c stable/10/crypto/openssh/atomicio.c stable/10/crypto/openssh/auth-bsdauth.c stable/10/crypto/openssh/auth-chall.c stable/10/crypto/openssh/auth-krb5.c (contents, props changed) stable/10/crypto/openssh/auth-options.c stable/10/crypto/openssh/auth-options.h stable/10/crypto/openssh/auth-pam.c stable/10/crypto/openssh/auth-passwd.c stable/10/crypto/openssh/auth-rh-rsa.c stable/10/crypto/openssh/auth-rhosts.c stable/10/crypto/openssh/auth-rsa.c stable/10/crypto/openssh/auth.c stable/10/crypto/openssh/auth.h stable/10/crypto/openssh/auth1.c stable/10/crypto/openssh/auth2-chall.c stable/10/crypto/openssh/auth2-gss.c stable/10/crypto/openssh/auth2-hostbased.c stable/10/crypto/openssh/auth2-kbdint.c stable/10/crypto/openssh/auth2-none.c stable/10/crypto/openssh/auth2-passwd.c stable/10/crypto/openssh/auth2-pubkey.c stable/10/crypto/openssh/auth2.c stable/10/crypto/openssh/authfd.c stable/10/crypto/openssh/authfd.h stable/10/crypto/openssh/authfile.c stable/10/crypto/openssh/authfile.h stable/10/crypto/openssh/bufaux.c stable/10/crypto/openssh/bufbn.c stable/10/crypto/openssh/bufec.c stable/10/crypto/openssh/buffer.c stable/10/crypto/openssh/buffer.h stable/10/crypto/openssh/canohost.c stable/10/crypto/openssh/chacha.h stable/10/crypto/openssh/channels.c stable/10/crypto/openssh/channels.h stable/10/crypto/openssh/cipher-3des1.c stable/10/crypto/openssh/cipher-bf1.c stable/10/crypto/openssh/cipher-chachapoly.c stable/10/crypto/openssh/cipher-chachapoly.h stable/10/crypto/openssh/cipher-ctr.c stable/10/crypto/openssh/cipher.c stable/10/crypto/openssh/cipher.h stable/10/crypto/openssh/clientloop.c stable/10/crypto/openssh/compat.c stable/10/crypto/openssh/compat.h stable/10/crypto/openssh/config.guess stable/10/crypto/openssh/config.h stable/10/crypto/openssh/configure.ac stable/10/crypto/openssh/contrib/Makefile stable/10/crypto/openssh/contrib/README stable/10/crypto/openssh/contrib/cygwin/README stable/10/crypto/openssh/contrib/cygwin/ssh-host-config stable/10/crypto/openssh/contrib/cygwin/ssh-user-config stable/10/crypto/openssh/contrib/redhat/openssh.spec stable/10/crypto/openssh/contrib/suse/openssh.spec stable/10/crypto/openssh/deattack.c stable/10/crypto/openssh/deattack.h stable/10/crypto/openssh/defines.h stable/10/crypto/openssh/dh.c stable/10/crypto/openssh/dh.h stable/10/crypto/openssh/digest-libc.c stable/10/crypto/openssh/digest-openssl.c stable/10/crypto/openssh/digest.h stable/10/crypto/openssh/dispatch.c stable/10/crypto/openssh/dispatch.h stable/10/crypto/openssh/dns.c stable/10/crypto/openssh/dns.h stable/10/crypto/openssh/entropy.c stable/10/crypto/openssh/ge25519.h stable/10/crypto/openssh/groupaccess.c stable/10/crypto/openssh/gss-genr.c stable/10/crypto/openssh/gss-serv-krb5.c stable/10/crypto/openssh/gss-serv.c stable/10/crypto/openssh/hmac.c stable/10/crypto/openssh/hmac.h stable/10/crypto/openssh/hostfile.c stable/10/crypto/openssh/hostfile.h stable/10/crypto/openssh/includes.h stable/10/crypto/openssh/kex.c stable/10/crypto/openssh/kex.h stable/10/crypto/openssh/kexc25519.c stable/10/crypto/openssh/kexc25519c.c stable/10/crypto/openssh/kexc25519s.c stable/10/crypto/openssh/kexdh.c stable/10/crypto/openssh/kexdhc.c stable/10/crypto/openssh/kexdhs.c stable/10/crypto/openssh/kexecdh.c stable/10/crypto/openssh/kexecdhc.c stable/10/crypto/openssh/kexecdhs.c stable/10/crypto/openssh/kexgex.c stable/10/crypto/openssh/kexgexc.c stable/10/crypto/openssh/kexgexs.c stable/10/crypto/openssh/key.c stable/10/crypto/openssh/key.h stable/10/crypto/openssh/krl.c stable/10/crypto/openssh/krl.h stable/10/crypto/openssh/log.c stable/10/crypto/openssh/loginrec.c stable/10/crypto/openssh/mac.c stable/10/crypto/openssh/mac.h stable/10/crypto/openssh/match.c stable/10/crypto/openssh/match.h stable/10/crypto/openssh/misc.c stable/10/crypto/openssh/misc.h stable/10/crypto/openssh/moduli stable/10/crypto/openssh/moduli.c stable/10/crypto/openssh/monitor.c stable/10/crypto/openssh/monitor.h stable/10/crypto/openssh/monitor_fdpass.c stable/10/crypto/openssh/monitor_mm.c stable/10/crypto/openssh/monitor_wrap.c stable/10/crypto/openssh/monitor_wrap.h stable/10/crypto/openssh/msg.c stable/10/crypto/openssh/msg.h stable/10/crypto/openssh/mux.c stable/10/crypto/openssh/myproposal.h stable/10/crypto/openssh/openbsd-compat/Makefile.in stable/10/crypto/openssh/openbsd-compat/arc4random.c stable/10/crypto/openssh/openbsd-compat/bcrypt_pbkdf.c stable/10/crypto/openssh/openbsd-compat/bsd-cygwin_util.c stable/10/crypto/openssh/openbsd-compat/bsd-cygwin_util.h stable/10/crypto/openssh/openbsd-compat/bsd-misc.c stable/10/crypto/openssh/openbsd-compat/bsd-misc.h stable/10/crypto/openssh/openbsd-compat/bsd-snprintf.c stable/10/crypto/openssh/openbsd-compat/explicit_bzero.c stable/10/crypto/openssh/openbsd-compat/fake-rfc2553.h stable/10/crypto/openssh/openbsd-compat/getrrsetbyname-ldns.c stable/10/crypto/openssh/openbsd-compat/openbsd-compat.h stable/10/crypto/openssh/openbsd-compat/openssl-compat.c stable/10/crypto/openssh/openbsd-compat/openssl-compat.h stable/10/crypto/openssh/openbsd-compat/port-linux.c stable/10/crypto/openssh/openbsd-compat/port-tun.c stable/10/crypto/openssh/openbsd-compat/port-uw.c stable/10/crypto/openssh/openbsd-compat/readpassphrase.c stable/10/crypto/openssh/openbsd-compat/realpath.c stable/10/crypto/openssh/openbsd-compat/regress/Makefile.in stable/10/crypto/openssh/openbsd-compat/sha2.c stable/10/crypto/openssh/openbsd-compat/sha2.h stable/10/crypto/openssh/openbsd-compat/xcrypt.c stable/10/crypto/openssh/opensshd.init.in stable/10/crypto/openssh/packet.c stable/10/crypto/openssh/packet.h stable/10/crypto/openssh/platform.c stable/10/crypto/openssh/poly1305.h stable/10/crypto/openssh/progressmeter.c stable/10/crypto/openssh/progressmeter.h stable/10/crypto/openssh/readconf.c stable/10/crypto/openssh/readconf.h stable/10/crypto/openssh/regress/Makefile stable/10/crypto/openssh/regress/README.regress stable/10/crypto/openssh/regress/agent-pkcs11.sh stable/10/crypto/openssh/regress/agent-timeout.sh stable/10/crypto/openssh/regress/agent.sh stable/10/crypto/openssh/regress/broken-pipe.sh stable/10/crypto/openssh/regress/cert-hostkey.sh stable/10/crypto/openssh/regress/cert-userkey.sh stable/10/crypto/openssh/regress/cfgmatch.sh stable/10/crypto/openssh/regress/cipher-speed.sh stable/10/crypto/openssh/regress/connect-privsep.sh stable/10/crypto/openssh/regress/connect.sh stable/10/crypto/openssh/regress/dhgex.sh stable/10/crypto/openssh/regress/dynamic-forward.sh stable/10/crypto/openssh/regress/exit-status.sh stable/10/crypto/openssh/regress/forcecommand.sh stable/10/crypto/openssh/regress/forward-control.sh stable/10/crypto/openssh/regress/forwarding.sh stable/10/crypto/openssh/regress/host-expand.sh stable/10/crypto/openssh/regress/integrity.sh stable/10/crypto/openssh/regress/kextype.sh stable/10/crypto/openssh/regress/key-options.sh stable/10/crypto/openssh/regress/keygen-change.sh stable/10/crypto/openssh/regress/keys-command.sh stable/10/crypto/openssh/regress/keyscan.sh stable/10/crypto/openssh/regress/keytype.sh stable/10/crypto/openssh/regress/krl.sh stable/10/crypto/openssh/regress/localcommand.sh stable/10/crypto/openssh/regress/login-timeout.sh stable/10/crypto/openssh/regress/multiplex.sh stable/10/crypto/openssh/regress/proto-mismatch.sh stable/10/crypto/openssh/regress/proto-version.sh stable/10/crypto/openssh/regress/proxy-connect.sh stable/10/crypto/openssh/regress/reconfigure.sh stable/10/crypto/openssh/regress/reexec.sh stable/10/crypto/openssh/regress/rekey.sh stable/10/crypto/openssh/regress/ssh-com.sh stable/10/crypto/openssh/regress/ssh2putty.sh stable/10/crypto/openssh/regress/sshd-log-wrapper.sh stable/10/crypto/openssh/regress/stderr-data.sh stable/10/crypto/openssh/regress/t4.ok stable/10/crypto/openssh/regress/test-exec.sh stable/10/crypto/openssh/regress/transfer.sh stable/10/crypto/openssh/regress/try-ciphers.sh stable/10/crypto/openssh/regress/unittests/Makefile stable/10/crypto/openssh/regress/unittests/Makefile.inc stable/10/crypto/openssh/regress/unittests/hostkeys/test_iterate.c (contents, props changed) stable/10/crypto/openssh/regress/unittests/kex/test_kex.c (contents, props changed) stable/10/crypto/openssh/regress/unittests/sshbuf/test_sshbuf_getput_crypto.c stable/10/crypto/openssh/regress/unittests/sshbuf/test_sshbuf_getput_fuzz.c stable/10/crypto/openssh/regress/unittests/sshkey/common.c stable/10/crypto/openssh/regress/unittests/sshkey/mktestdata.sh stable/10/crypto/openssh/regress/unittests/sshkey/test_file.c stable/10/crypto/openssh/regress/unittests/sshkey/test_fuzz.c stable/10/crypto/openssh/regress/unittests/sshkey/test_sshkey.c stable/10/crypto/openssh/regress/unittests/sshkey/testdata/dsa_1 stable/10/crypto/openssh/regress/unittests/sshkey/testdata/dsa_1-cert.fp stable/10/crypto/openssh/regress/unittests/sshkey/testdata/dsa_1-cert.pub (contents, props changed) stable/10/crypto/openssh/regress/unittests/sshkey/testdata/dsa_1.fp stable/10/crypto/openssh/regress/unittests/sshkey/testdata/dsa_1.fp.bb stable/10/crypto/openssh/regress/unittests/sshkey/testdata/dsa_1.param.g stable/10/crypto/openssh/regress/unittests/sshkey/testdata/dsa_1.param.priv stable/10/crypto/openssh/regress/unittests/sshkey/testdata/dsa_1.param.pub (contents, props changed) stable/10/crypto/openssh/regress/unittests/sshkey/testdata/dsa_1.pub (contents, props changed) stable/10/crypto/openssh/regress/unittests/sshkey/testdata/dsa_1_pw stable/10/crypto/openssh/regress/unittests/sshkey/testdata/dsa_2 stable/10/crypto/openssh/regress/unittests/sshkey/testdata/dsa_2.fp stable/10/crypto/openssh/regress/unittests/sshkey/testdata/dsa_2.fp.bb stable/10/crypto/openssh/regress/unittests/sshkey/testdata/dsa_2.pub (contents, props changed) stable/10/crypto/openssh/regress/unittests/sshkey/testdata/dsa_n stable/10/crypto/openssh/regress/unittests/sshkey/testdata/dsa_n_pw stable/10/crypto/openssh/regress/unittests/sshkey/testdata/ecdsa_1 stable/10/crypto/openssh/regress/unittests/sshkey/testdata/ecdsa_1-cert.fp stable/10/crypto/openssh/regress/unittests/sshkey/testdata/ecdsa_1-cert.pub (contents, props changed) stable/10/crypto/openssh/regress/unittests/sshkey/testdata/ecdsa_1.fp stable/10/crypto/openssh/regress/unittests/sshkey/testdata/ecdsa_1.fp.bb stable/10/crypto/openssh/regress/unittests/sshkey/testdata/ecdsa_1.param.priv stable/10/crypto/openssh/regress/unittests/sshkey/testdata/ecdsa_1.param.pub (contents, props changed) stable/10/crypto/openssh/regress/unittests/sshkey/testdata/ecdsa_1.pub (contents, props changed) stable/10/crypto/openssh/regress/unittests/sshkey/testdata/ecdsa_1_pw stable/10/crypto/openssh/regress/unittests/sshkey/testdata/ecdsa_2 stable/10/crypto/openssh/regress/unittests/sshkey/testdata/ecdsa_2.fp stable/10/crypto/openssh/regress/unittests/sshkey/testdata/ecdsa_2.fp.bb stable/10/crypto/openssh/regress/unittests/sshkey/testdata/ecdsa_2.param.priv stable/10/crypto/openssh/regress/unittests/sshkey/testdata/ecdsa_2.param.pub (contents, props changed) stable/10/crypto/openssh/regress/unittests/sshkey/testdata/ecdsa_2.pub (contents, props changed) stable/10/crypto/openssh/regress/unittests/sshkey/testdata/ecdsa_n stable/10/crypto/openssh/regress/unittests/sshkey/testdata/ecdsa_n_pw stable/10/crypto/openssh/regress/unittests/sshkey/testdata/ed25519_1 stable/10/crypto/openssh/regress/unittests/sshkey/testdata/ed25519_1-cert.fp stable/10/crypto/openssh/regress/unittests/sshkey/testdata/ed25519_1-cert.pub (contents, props changed) stable/10/crypto/openssh/regress/unittests/sshkey/testdata/ed25519_1.fp stable/10/crypto/openssh/regress/unittests/sshkey/testdata/ed25519_1.fp.bb stable/10/crypto/openssh/regress/unittests/sshkey/testdata/ed25519_1.pub (contents, props changed) stable/10/crypto/openssh/regress/unittests/sshkey/testdata/ed25519_1_pw stable/10/crypto/openssh/regress/unittests/sshkey/testdata/ed25519_2 stable/10/crypto/openssh/regress/unittests/sshkey/testdata/ed25519_2.fp stable/10/crypto/openssh/regress/unittests/sshkey/testdata/ed25519_2.fp.bb stable/10/crypto/openssh/regress/unittests/sshkey/testdata/ed25519_2.pub (contents, props changed) stable/10/crypto/openssh/regress/unittests/sshkey/testdata/rsa1_1 stable/10/crypto/openssh/regress/unittests/sshkey/testdata/rsa1_1.fp stable/10/crypto/openssh/regress/unittests/sshkey/testdata/rsa1_1.fp.bb stable/10/crypto/openssh/regress/unittests/sshkey/testdata/rsa1_1.param.n stable/10/crypto/openssh/regress/unittests/sshkey/testdata/rsa1_1.pub (contents, props changed) stable/10/crypto/openssh/regress/unittests/sshkey/testdata/rsa1_1_pw stable/10/crypto/openssh/regress/unittests/sshkey/testdata/rsa1_2 stable/10/crypto/openssh/regress/unittests/sshkey/testdata/rsa1_2.fp stable/10/crypto/openssh/regress/unittests/sshkey/testdata/rsa1_2.fp.bb stable/10/crypto/openssh/regress/unittests/sshkey/testdata/rsa1_2.param.n stable/10/crypto/openssh/regress/unittests/sshkey/testdata/rsa1_2.pub (contents, props changed) stable/10/crypto/openssh/regress/unittests/sshkey/testdata/rsa_1 stable/10/crypto/openssh/regress/unittests/sshkey/testdata/rsa_1-cert.fp stable/10/crypto/openssh/regress/unittests/sshkey/testdata/rsa_1-cert.pub (contents, props changed) stable/10/crypto/openssh/regress/unittests/sshkey/testdata/rsa_1.fp stable/10/crypto/openssh/regress/unittests/sshkey/testdata/rsa_1.fp.bb stable/10/crypto/openssh/regress/unittests/sshkey/testdata/rsa_1.param.n stable/10/crypto/openssh/regress/unittests/sshkey/testdata/rsa_1.param.p stable/10/crypto/openssh/regress/unittests/sshkey/testdata/rsa_1.param.q stable/10/crypto/openssh/regress/unittests/sshkey/testdata/rsa_1.pub (contents, props changed) stable/10/crypto/openssh/regress/unittests/sshkey/testdata/rsa_1_pw stable/10/crypto/openssh/regress/unittests/sshkey/testdata/rsa_2 stable/10/crypto/openssh/regress/unittests/sshkey/testdata/rsa_2.fp stable/10/crypto/openssh/regress/unittests/sshkey/testdata/rsa_2.fp.bb stable/10/crypto/openssh/regress/unittests/sshkey/testdata/rsa_2.param.n stable/10/crypto/openssh/regress/unittests/sshkey/testdata/rsa_2.param.p stable/10/crypto/openssh/regress/unittests/sshkey/testdata/rsa_2.param.q stable/10/crypto/openssh/regress/unittests/sshkey/testdata/rsa_2.pub (contents, props changed) stable/10/crypto/openssh/regress/unittests/sshkey/testdata/rsa_n stable/10/crypto/openssh/regress/unittests/sshkey/testdata/rsa_n_pw stable/10/crypto/openssh/regress/unittests/test_helper/Makefile stable/10/crypto/openssh/regress/unittests/test_helper/fuzz.c stable/10/crypto/openssh/regress/unittests/test_helper/test_helper.c stable/10/crypto/openssh/regress/unittests/test_helper/test_helper.h stable/10/crypto/openssh/regress/yes-head.sh stable/10/crypto/openssh/rijndael.c stable/10/crypto/openssh/rijndael.h stable/10/crypto/openssh/roaming_client.c stable/10/crypto/openssh/roaming_common.c stable/10/crypto/openssh/roaming_dummy.c stable/10/crypto/openssh/rsa.c stable/10/crypto/openssh/rsa.h stable/10/crypto/openssh/sandbox-seccomp-filter.c stable/10/crypto/openssh/sandbox-systrace.c stable/10/crypto/openssh/scp.1 stable/10/crypto/openssh/scp.c stable/10/crypto/openssh/servconf.c stable/10/crypto/openssh/servconf.h stable/10/crypto/openssh/serverloop.c stable/10/crypto/openssh/session.c stable/10/crypto/openssh/sftp-client.c stable/10/crypto/openssh/sftp-client.h stable/10/crypto/openssh/sftp-common.c stable/10/crypto/openssh/sftp-common.h stable/10/crypto/openssh/sftp-glob.c stable/10/crypto/openssh/sftp-server.8 stable/10/crypto/openssh/sftp-server.c stable/10/crypto/openssh/sftp.1 stable/10/crypto/openssh/sftp.c stable/10/crypto/openssh/ssh-add.1 stable/10/crypto/openssh/ssh-add.c stable/10/crypto/openssh/ssh-agent.1 stable/10/crypto/openssh/ssh-agent.c stable/10/crypto/openssh/ssh-dss.c stable/10/crypto/openssh/ssh-ecdsa.c stable/10/crypto/openssh/ssh-ed25519.c stable/10/crypto/openssh/ssh-keygen.1 stable/10/crypto/openssh/ssh-keygen.c stable/10/crypto/openssh/ssh-keyscan.1 stable/10/crypto/openssh/ssh-keyscan.c stable/10/crypto/openssh/ssh-keysign.c stable/10/crypto/openssh/ssh-pkcs11-client.c stable/10/crypto/openssh/ssh-pkcs11-helper.c stable/10/crypto/openssh/ssh-pkcs11.c stable/10/crypto/openssh/ssh-pkcs11.h stable/10/crypto/openssh/ssh-rsa.c stable/10/crypto/openssh/ssh.1 stable/10/crypto/openssh/ssh.c stable/10/crypto/openssh/ssh.h stable/10/crypto/openssh/ssh_config stable/10/crypto/openssh/ssh_config.5 stable/10/crypto/openssh/ssh_namespace.h stable/10/crypto/openssh/sshconnect.c stable/10/crypto/openssh/sshconnect1.c stable/10/crypto/openssh/sshconnect2.c stable/10/crypto/openssh/sshd.8 stable/10/crypto/openssh/sshd.c stable/10/crypto/openssh/sshd_config stable/10/crypto/openssh/sshd_config.5 stable/10/crypto/openssh/sshlogin.c stable/10/crypto/openssh/sshpty.c stable/10/crypto/openssh/uidswap.c stable/10/crypto/openssh/umac.c stable/10/crypto/openssh/uuencode.c stable/10/crypto/openssh/version.h stable/10/crypto/openssh/xmalloc.c stable/10/crypto/openssh/xmalloc.h stable/10/lib/libpam/modules/pam_ssh/pam_ssh.c stable/10/secure/lib/libssh/Makefile stable/10/secure/usr.sbin/sshd/Makefile Directory Properties: stable/10/ (props changed) stable/10/crypto/openssh/ (props changed) stable/10/crypto/openssh/openbsd-compat/ (props changed) stable/10/crypto/openssh/openbsd-compat/regress/ (props changed) stable/10/crypto/openssh/regress/unittests/bitmap/Makefile (props changed) stable/10/crypto/openssh/regress/unittests/bitmap/tests.c (props changed) stable/10/crypto/openssh/regress/unittests/hostkeys/Makefile (props changed) stable/10/crypto/openssh/regress/unittests/hostkeys/mktestdata.sh (props changed) stable/10/crypto/openssh/regress/unittests/hostkeys/testdata/dsa_1.pub (props changed) stable/10/crypto/openssh/regress/unittests/hostkeys/testdata/dsa_2.pub (props changed) stable/10/crypto/openssh/regress/unittests/hostkeys/testdata/dsa_3.pub (props changed) stable/10/crypto/openssh/regress/unittests/hostkeys/testdata/dsa_4.pub (props changed) stable/10/crypto/openssh/regress/unittests/hostkeys/testdata/dsa_5.pub (props changed) stable/10/crypto/openssh/regress/unittests/hostkeys/testdata/dsa_6.pub (props changed) stable/10/crypto/openssh/regress/unittests/hostkeys/testdata/ecdsa_1.pub (props changed) stable/10/crypto/openssh/regress/unittests/hostkeys/testdata/ecdsa_2.pub (props changed) stable/10/crypto/openssh/regress/unittests/hostkeys/testdata/ecdsa_3.pub (props changed) stable/10/crypto/openssh/regress/unittests/hostkeys/testdata/ecdsa_4.pub (props changed) stable/10/crypto/openssh/regress/unittests/hostkeys/testdata/ecdsa_5.pub (props changed) stable/10/crypto/openssh/regress/unittests/hostkeys/testdata/ecdsa_6.pub (props changed) stable/10/crypto/openssh/regress/unittests/hostkeys/testdata/ed25519_1.pub (props changed) stable/10/crypto/openssh/regress/unittests/hostkeys/testdata/ed25519_2.pub (props changed) stable/10/crypto/openssh/regress/unittests/hostkeys/testdata/ed25519_3.pub (props changed) stable/10/crypto/openssh/regress/unittests/hostkeys/testdata/ed25519_4.pub (props changed) stable/10/crypto/openssh/regress/unittests/hostkeys/testdata/ed25519_5.pub (props changed) stable/10/crypto/openssh/regress/unittests/hostkeys/testdata/ed25519_6.pub (props changed) stable/10/crypto/openssh/regress/unittests/hostkeys/testdata/rsa1_1.pub (props changed) stable/10/crypto/openssh/regress/unittests/hostkeys/testdata/rsa1_2.pub (props changed) stable/10/crypto/openssh/regress/unittests/hostkeys/testdata/rsa1_3.pub (props changed) stable/10/crypto/openssh/regress/unittests/hostkeys/testdata/rsa1_4.pub (props changed) stable/10/crypto/openssh/regress/unittests/hostkeys/testdata/rsa1_5.pub (props changed) stable/10/crypto/openssh/regress/unittests/hostkeys/testdata/rsa1_6.pub (props changed) stable/10/crypto/openssh/regress/unittests/hostkeys/testdata/rsa_1.pub (props changed) stable/10/crypto/openssh/regress/unittests/hostkeys/testdata/rsa_2.pub (props changed) stable/10/crypto/openssh/regress/unittests/hostkeys/testdata/rsa_3.pub (props changed) stable/10/crypto/openssh/regress/unittests/hostkeys/testdata/rsa_4.pub (props changed) stable/10/crypto/openssh/regress/unittests/hostkeys/testdata/rsa_5.pub (props changed) stable/10/crypto/openssh/regress/unittests/hostkeys/testdata/rsa_6.pub (props changed) stable/10/crypto/openssh/regress/unittests/hostkeys/tests.c (props changed) stable/10/crypto/openssh/regress/unittests/kex/Makefile (props changed) stable/10/crypto/openssh/regress/unittests/kex/tests.c (props changed) Copied: stable/10/crypto/openssh/.cvsignore (from r294332, head/crypto/openssh/.cvsignore) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/crypto/openssh/.cvsignore Sun Feb 7 11:38:54 2016 (r295367, copy of r294332, head/crypto/openssh/.cvsignore) @@ -0,0 +1,28 @@ +*.0 +*.out +Makefile +autom4te.cache +buildit.sh +buildpkg.sh +config.cache +config.h +config.h.in +config.log +config.status +configure +openssh.xml +opensshd.init +scp +sftp +sftp-server +ssh +ssh-add +ssh-agent +ssh-keygen +ssh-keyscan +ssh-keysign +ssh-pkcs11-helper +sshd +stamp-h.in +survey +survey.sh Modified: stable/10/crypto/openssh/ChangeLog ============================================================================== --- stable/10/crypto/openssh/ChangeLog Sun Feb 7 09:51:22 2016 (r295366) +++ stable/10/crypto/openssh/ChangeLog Sun Feb 7 11:38:54 2016 (r295367) @@ -1,2887 +1,7615 @@ -20140313 - - (djm) Release OpenSSH 6.6 - -20140304 - - OpenBSD CVS Sync - - djm@cvs.openbsd.org 2014/03/03 22:22:30 - [session.c] - ignore enviornment variables with embedded '=' or '\0' characters; - spotted by Jann Horn; ok deraadt@ - -20140301 - - (djm) [regress/Makefile] Disable dhgex regress test; it breaks when - no moduli file exists at the expected location. - -20140228 - - OpenBSD CVS Sync - - djm@cvs.openbsd.org 2014/02/27 00:41:49 - [bufbn.c] - fix unsigned overflow that could lead to reading a short ssh protocol - 1 bignum value; found by Ben Hawkes; ok deraadt@ - - djm@cvs.openbsd.org 2014/02/27 08:25:09 - [bufbn.c] - off by one in range check - - djm@cvs.openbsd.org 2014/02/27 22:47:07 - [sshd_config.5] - bz#2184 clarify behaviour of a keyword that appears in multiple - matching Match blocks; ok dtucker@ - - djm@cvs.openbsd.org 2014/02/27 22:57:40 - [version.h] - openssh-6.6 - - dtucker@cvs.openbsd.org 2014/01/19 23:43:02 - [regress/sftp-chroot.sh] - Don't use -q on sftp as it suppresses logging, instead redirect the - output to the regress logfile. - - dtucker@cvs.openbsd.org 2014/01/20 00:00:30 - [sregress/ftp-chroot.sh] - append to rather than truncating the log file - - dtucker@cvs.openbsd.org 2014/01/25 04:35:32 - [regress/Makefile regress/dhgex.sh] - Add a test for DH GEX sizes - - djm@cvs.openbsd.org 2014/01/26 10:22:10 - [regress/cert-hostkey.sh] - automatically generate revoked keys from listed keys rather than - manually specifying each type; from portable - (Id sync only) - - djm@cvs.openbsd.org 2014/01/26 10:49:17 - [scp-ssh-wrapper.sh scp.sh] - make sure $SCP is tested on the remote end rather than whichever one - happens to be in $PATH; from portable - (Id sync only) - - djm@cvs.openbsd.org 2014/02/27 20:04:16 - [login-timeout.sh] - remove any existing LoginGraceTime from sshd_config before adding - a specific one for the test back in - - djm@cvs.openbsd.org 2014/02/27 21:21:25 - [agent-ptrace.sh agent.sh] - keep return values that are printed in error messages; - from portable - (Id sync only) - - (djm) [README contrib/caldera/openssh.spec contrib/redhat/openssh.spec] - [contrib/suse/openssh.spec] Crank version numbers - - (djm) [regress/host-expand.sh] Add RCS Id - -20140227 - - OpenBSD CVS Sync - - djm@cvs.openbsd.org 2014/02/26 20:18:37 - [ssh.c] - bz#2205: avoid early hostname lookups unless canonicalisation is enabled; - ok dtucker@ markus@ - - djm@cvs.openbsd.org 2014/02/26 20:28:44 - [auth2-gss.c gss-serv.c ssh-gss.h sshd.c] - bz#2107 - cache OIDs of supported GSSAPI mechanisms before privsep - sandboxing, as running this code in the sandbox can cause violations; - ok markus@ - - djm@cvs.openbsd.org 2014/02/26 20:29:29 - [channels.c] - don't assume that the socks4 username is \0 terminated; - spotted by Ben Hawkes; ok markus@ - - markus@cvs.openbsd.org 2014/02/26 21:53:37 - [sshd.c] - ssh_gssapi_prepare_supported_oids needs GSSAPI - -20140224 - - OpenBSD CVS Sync - - djm@cvs.openbsd.org 2014/02/07 06:55:54 - [cipher.c mac.c] - remove some logging that makes ssh debugging output very verbose; - ok markus - - djm@cvs.openbsd.org 2014/02/15 23:05:36 - [channels.c] - avoid spurious "getsockname failed: Bad file descriptor" errors in ssh -W; - bz#2200, debian#738692 via Colin Watson; ok dtucker@ - - djm@cvs.openbsd.org 2014/02/22 01:32:19 - [readconf.c] - when processing Match blocks, skip 'exec' clauses if previous predicates - failed to match; ok markus@ - - djm@cvs.openbsd.org 2014/02/23 20:03:42 - [ssh-ed25519.c] - check for unsigned overflow; not reachable in OpenSSH but others might - copy our code... - - djm@cvs.openbsd.org 2014/02/23 20:11:36 - [readconf.c readconf.h ssh.c ssh_config.5] - reparse ssh_config and ~/.ssh/config if hostname canonicalisation changes - the hostname. This allows users to write configurations that always - refer to canonical hostnames, e.g. - - CanonicalizeHostname yes - CanonicalDomains int.example.org example.org - CanonicalizeFallbackLocal no - - Host *.int.example.org - Compression off - Host *.example.org - User djm - - ok markus@ +commit c88ac102f0eb89f2eaa314cb2e2e0ca3c890c443 +Author: Damien Miller +Date: Thu Jan 14 11:08:19 2016 +1100 + + bump version numbers + +commit 302bc21e6fadacb04b665868cd69b625ef69df90 +Author: Damien Miller +Date: Thu Jan 14 11:04:04 2016 +1100 + + openssh-7.1p2 + +commit 6b33763242c063e4e0593877e835eeb1fd1b60aa +Author: Damien Miller +Date: Thu Jan 14 11:02:58 2016 +1100 + + forcibly disable roaming support in the client + +commit 34d364f0d2e1e30a444009f0e04299bb7c94ba13 +Author: djm@openbsd.org +Date: Mon Oct 5 17:11:21 2015 +0000 + + upstream commit + + some more bzero->explicit_bzero, from Michael McConville + + Upstream-ID: 17f19545685c33327db2efdc357c1c9225ff00d0 + +commit 8f5b93026797b9f7fba90d0c717570421ccebbd3 +Author: guenther@openbsd.org +Date: Fri Sep 11 08:50:04 2015 +0000 + + upstream commit + + Use explicit_bzero() when zeroing before free() + + from Michael McConville (mmcconv1 (at) sccs.swarthmore.edu) + ok millert@ djm@ + + Upstream-ID: 2e3337db046c3fe70c7369ee31515ac73ec00f50 + +commit d77148e3a3ef6c29b26ec74331455394581aa257 +Author: djm@openbsd.org +Date: Sun Nov 8 21:59:11 2015 +0000 + + upstream commit + + fix OOB read in packet code caused by missing return + statement found by Ben Hawkes; ok markus@ deraadt@ + + Upstream-ID: a3e3a85434ebfa0690d4879091959591f30efc62 + +commit 076d849e17ab12603627f87b301e2dca71bae518 +Author: Damien Miller +Date: Sat Nov 14 18:44:49 2015 +1100 + + read back from libcrypto RAND when privdropping + + makes certain libcrypto implementations cache a /dev/urandom fd + in preparation of sandboxing. Based on patch by Greg Hartman. + +commit f72adc0150011a28f177617a8456e1f83733099d +Author: djm@openbsd.org +Date: Sun Dec 13 22:42:23 2015 +0000 + + upstream commit + + unbreak connections with peers that set + first_kex_follows; fix from Matt Johnston va bz#2515 + + Upstream-ID: decc88ec4fc7515594fdb42b04aa03189a44184b + +commit 04bd8d019ccd906cac1a2b362517b8505f3759e6 +Author: djm@openbsd.org +Date: Tue Jan 12 23:42:54 2016 +0000 + + upstream commit + + use explicit_bzero() more liberally in the buffer code; ok + deraadt + + Upstream-ID: 0ece37069fd66bc6e4f55eb1321f93df372b65bf + +commit e91346dc2bbf460246df2ab591b7613908c1b0ad +Author: Damien Miller +Date: Fri Aug 21 14:49:03 2015 +1000 + + we don't use Github for issues/pull-requests + +commit a4f5b507c708cc3dc2c8dd2d02e4416d7514dc23 +Author: Damien Miller +Date: Fri Aug 21 14:43:55 2015 +1000 + + fix URL for connect.c + +commit d026a8d3da0f8186598442997c7d0a28e7275414 +Author: Damien Miller +Date: Fri Aug 21 13:47:10 2015 +1000 + + update version numbers for 7.1 + +commit 78f8f589f0ca1c9f41e5a9bae3cda5ce8a6b42ed +Author: djm@openbsd.org +Date: Fri Aug 21 03:45:26 2015 +0000 + + upstream commit + + openssh-7.1 + + Upstream-ID: ff7b1ef4b06caddfb45e08ba998128c88be3d73f + +commit 32a181980c62fce94f7f9ffaf6a79d90f0c309cf +Author: djm@openbsd.org +Date: Fri Aug 21 03:42:19 2015 +0000 + + upstream commit + + fix inverted logic that broke PermitRootLogin; reported + by Mantas Mikulenas; ok markus@ + + Upstream-ID: 260dd6a904c1bb7e43267e394b1c9cf70bdd5ea5 + +commit ce445b0ed927e45bd5bdce8f836eb353998dd65c +Author: deraadt@openbsd.org +Date: Thu Aug 20 22:32:42 2015 +0000 + + upstream commit + + Do not cast result of malloc/calloc/realloc* if stdlib.h + is in scope ok krw millert + + Upstream-ID: 5e50ded78cadf3841556649a16cc4b1cb6c58667 + +commit 05291e5288704d1a98bacda269eb5a0153599146 +Author: naddy@openbsd.org +Date: Thu Aug 20 19:20:06 2015 +0000 + + upstream commit + + In the certificates section, be consistent about using + "host_key" and "user_key" for the respective key types. ok sthen@ deraadt@ + + Upstream-ID: 9e037ea3b15577b238604c5533e082a3947f13cb + +commit 8543d4ef6f2e9f98c3e6b77c894ceec30c5e4ae4 +Author: djm@openbsd.org +Date: Wed Aug 19 23:21:42 2015 +0000 + + upstream commit + + Better compat matching for WinSCP, add compat matching + for FuTTY (fork of PuTTY); ok markus@ deraadt@ + + Upstream-ID: 24001d1ac115fa3260fbdc329a4b9aeb283c5389 + +commit ec6eda16ebab771aa3dfc90629b41953b999cb1e +Author: djm@openbsd.org +Date: Wed Aug 19 23:19:01 2015 +0000 + + upstream commit + + fix double-free() in error path of DSA key generation + reported by Mateusz Kocielski; ok markus@ + + Upstream-ID: 4735d8f888b10599a935fa1b374787089116713c + +commit 45b0eb752c94954a6de046bfaaf129e518ad4b5b +Author: djm@openbsd.org +Date: Wed Aug 19 23:18:26 2015 +0000 + + upstream commit + + fix free() of uninitialised pointer reported by Mateusz + Kocielski; ok markus@ + + Upstream-ID: 519552b050618501a06b7b023de5cb104e2c5663 + +commit c837643b93509a3ef538cb6624b678c5fe32ff79 +Author: djm@openbsd.org +Date: Wed Aug 19 23:17:51 2015 +0000 + + upstream commit + + fixed unlink([uninitialised memory]) reported by Mateusz + Kocielski; ok markus@ + + Upstream-ID: 14a0c4e7d891f5a8dabc4b89d4f6b7c0d5a20109 + +commit 1f8d3d629cd553031021068eb9c646a5f1e50994 +Author: jmc@openbsd.org +Date: Fri Aug 14 15:32:41 2015 +0000 + + upstream commit + + match myproposal.h order; from brian conway (i snuck in a + tweak while here) + + ok dtucker + + Upstream-ID: 35174a19b5237ea36aa3798f042bf5933b772c67 + +commit 1dc8d93ce69d6565747eb44446ed117187621b26 +Author: deraadt@openbsd.org +Date: Thu Aug 6 14:53:21 2015 +0000 + + upstream commit + + add prohibit-password as a synonymn for without-password, + since the without-password is causing too many questions. Harden it to ban + all but pubkey, hostbased, and GSSAPI auth (when the latter is enabled) from + djm, ok markus + + Upstream-ID: d53317d7b28942153e6236d3fd6e12ceb482db7a + +commit 90a95a4745a531b62b81ce3b025e892bdc434de5 +Author: Damien Miller +Date: Tue Aug 11 13:53:41 2015 +1000 + + update version in README + +commit 318c37743534b58124f1bab37a8a0087a3a9bd2f +Author: Damien Miller +Date: Tue Aug 11 13:53:09 2015 +1000 + + update versions in *.spec + +commit 5e75f5198769056089fb06c4d738ab0e5abc66f7 +Author: Damien Miller +Date: Tue Aug 11 13:34:12 2015 +1000 + + set sshpam_ctxt to NULL after free + + Avoids use-after-free in monitor when privsep child is compromised. + Reported by Moritz Jodeit; ok dtucker@ + +commit d4697fe9a28dab7255c60433e4dd23cf7fce8a8b +Author: Damien Miller +Date: Tue Aug 11 13:33:24 2015 +1000 + + Don't resend username to PAM; it already has it. + + Pointed out by Moritz Jodeit; ok dtucker@ + +commit 88763a6c893bf3dfe951ba9271bf09715e8d91ca +Author: Darren Tucker +Date: Mon Jul 27 12:14:25 2015 +1000 + + Import updated moduli file from OpenBSD. + +commit 55b263fb7cfeacb81aaf1c2036e0394c881637da +Author: Damien Miller +Date: Mon Aug 10 11:13:44 2015 +1000 + + let principals-command.sh work for noexec /var/run + +commit 2651e34cd11b1aac3a0fe23b86d8c2ff35c07897 +Author: Damien Miller +Date: Thu Aug 6 11:43:42 2015 +1000 + + work around echo -n / sed behaviour in tests + +commit d85dad81778c1aa8106acd46930b25fdf0d15b2a +Author: djm@openbsd.org +Date: Wed Aug 5 05:27:33 2015 +0000 + + upstream commit + + adjust for RSA minimum modulus switch; ok deraadt@ + + Upstream-Regress-ID: 5a72c83431b96224d583c573ca281cd3a3ebfdae + +commit 57e8e229bad5fe6056b5f1199665f5f7008192c6 +Author: djm@openbsd.org +Date: Tue Aug 4 05:23:06 2015 +0000 + + upstream commit + + backout SSH_RSA_MINIMUM_MODULUS_SIZE increase for this + release; problems spotted by sthen@ ok deraadt@ markus@ + + Upstream-ID: d0bd60dde9e8c3cd7030007680371894c1499822 + +commit f097d0ea1e0889ca0fa2e53a00214e43ab7fa22a +Author: djm@openbsd.org +Date: Sun Aug 2 09:56:42 2015 +0000 + + upstream commit + + openssh 7.0; ok deraadt@ + + Upstream-ID: c63afdef537f57f28ae84145c5a8e29e9250221f + +commit 3d5728a0f6874ce4efb16913a12963595070f3a9 +Author: chris@openbsd.org +Date: Fri Jul 31 15:38:09 2015 +0000 + + upstream commit + + Allow PermitRootLogin to be overridden by config + + ok markus@ deeradt@ + + Upstream-ID: 5cf3e26ed702888de84e2dc9d0054ccf4d9125b4 + +commit 6f941396b6835ad18018845f515b0c4fe20be21a +Author: djm@openbsd.org +Date: Thu Jul 30 23:09:15 2015 +0000 + + upstream commit + + fix pty permissions; patch from Nikolay Edigaryev; ok + deraadt + + Upstream-ID: 40ff076d2878b916fbfd8e4f45dbe5bec019e550 + +commit f4373ed1e8fbc7c8ce3fc4ea97d0ba2e0c1d7ef0 +Author: deraadt@openbsd.org +Date: Thu Jul 30 19:23:02 2015 +0000 + + upstream commit + + change default: PermitRootLogin without-password matching + install script changes coming as well ok djm markus + + Upstream-ID: 0e2a6c4441daf5498b47a61767382bead5eb8ea6 + +commit 0c30ba91f87fcda7e975e6ff8a057f624e87ea1c +Author: Damien Miller +Date: Thu Jul 30 12:31:39 2015 +1000 + + downgrade OOM adjustment logging: verbose -> debug + +commit f9eca249d4961f28ae4b09186d7dc91de74b5895 +Author: djm@openbsd.org +Date: Thu Jul 30 00:01:34 2015 +0000 + + upstream commit + + Allow ssh_config and sshd_config kex parameters options be + prefixed by a '+' to indicate that the specified items be appended to the + default rather than replacing it. + + approach suggested by dtucker@, feedback dlg@, ok markus@ + + Upstream-ID: 0f901137298fc17095d5756ff1561a7028e8882a + +commit 5cefe769105a2a2e3ca7479d28d9a325d5ef0163 +Author: djm@openbsd.org +Date: Wed Jul 29 08:34:54 2015 +0000 + + upstream commit + + fix bug in previous; was printing incorrect string for + failed host key algorithms negotiation + + Upstream-ID: 22c0dc6bc61930513065d92e11f0753adc4c6e6e + +commit f319912b0d0e1675b8bb051ed8213792c788bcb2 +Author: djm@openbsd.org +Date: Wed Jul 29 04:43:06 2015 +0000 + + upstream commit + + include the peer's offer when logging a failure to + negotiate a mutual set of algorithms (kex, pubkey, ciphers, etc.) ok markus@ + + Upstream-ID: bbb8caabf5c01790bb845f5ce135565248d7c796 + +commit b6ea0e573042eb85d84defb19227c89eb74cf05a +Author: djm@openbsd.org +Date: Tue Jul 28 23:20:42 2015 +0000 + + upstream commit + + add Cisco to the list of clients that choke on the + hostkeys update extension. Pointed out by Howard Kash + + Upstream-ID: c9eadde28ecec056c73d09ee10ba4570dfba7e84 + +commit 3f628c7b537291c1019ce86af90756fb4e66d0fd +Author: guenther@openbsd.org +Date: Mon Jul 27 16:29:23 2015 +0000 + + upstream commit + + Permit kbind(2) use in the sandbox now, to ease testing + of ld.so work using it + + reminded by miod@, ok deraadt@ + + Upstream-ID: 523922e4d1ba7a091e3824e77a8a3c818ee97413 + +commit ebe27ebe520098bbc0fe58945a87ce8490121edb +Author: millert@openbsd.org +Date: Mon Jul 20 18:44:12 2015 +0000 + + upstream commit + + Move .Pp before .Bl, not after to quiet mandoc -Tlint. + Noticed by jmc@ + + Upstream-ID: 59fadbf8407cec4e6931e50c53cfa0214a848e23 + +commit d5d91d0da819611167782c66ab629159169d94d4 +Author: millert@openbsd.org +Date: Mon Jul 20 18:42:35 2015 +0000 + + upstream commit + + Sync usage with SYNOPSIS + + Upstream-ID: 7a321a170181a54f6450deabaccb6ef60cf3f0b7 + +commit 79ec2142fbc68dd2ed9688608da355fc0b1ed743 +Author: millert@openbsd.org +Date: Mon Jul 20 15:39:52 2015 +0000 + + upstream commit + + Better desciption of Unix domain socket forwarding. + bz#2423; ok jmc@ + + Upstream-ID: 85e28874726897e3f26ae50dfa2e8d2de683805d + +commit d56fd1828074a4031b18b8faa0bf949669eb18a0 +Author: Damien Miller +Date: Mon Jul 20 11:19:51 2015 +1000 + + make realpath.c compile -Wsign-compare clean + +commit c63c9a691dca26bb7648827f5a13668832948929 +Author: djm@openbsd.org +Date: Mon Jul 20 00:30:01 2015 +0000 + + upstream commit + + mention that the default of UseDNS=no implies that + hostnames cannot be used for host matching in sshd_config and + authorized_keys; bz#2045, ok dtucker@ + + Upstream-ID: 0812705d5f2dfa59aab01f2764ee800b1741c4e1 + +commit 63ebcd0005e9894fcd6871b7b80aeea1fec0ff76 +Author: djm@openbsd.org +Date: Sat Jul 18 08:02:17 2015 +0000 + + upstream commit + + don't ignore PKCS#11 hosted keys that return empty + CKA_ID; patch by Jakub Jelen via bz#2429; ok markus + + Upstream-ID: 2f7c94744eb0342f8ee8bf97b2351d4e00116485 + +commit b15fd989c8c62074397160147a8d5bc34b3f3c63 +Author: djm@openbsd.org +Date: Sat Jul 18 08:00:21 2015 +0000 + + upstream commit + + skip uninitialised PKCS#11 slots; patch from Jakub Jelen + in bz#2427 ok markus@ + + Upstream-ID: 744c1e7796e237ad32992d0d02148e8a18f27d29 + +commit 5b64f85bb811246c59ebab70aed331f26ba37b18 +Author: djm@openbsd.org +Date: Sat Jul 18 07:57:14 2015 +0000 + + upstream commit + + only query each keyboard-interactive device once per + authentication request regardless of how many times it is listed; ok markus@ + + Upstream-ID: d73fafba6e86030436ff673656ec1f33d9ffeda1 + +commit cd7324d0667794eb5c236d8a4e0f236251babc2d +Author: djm@openbsd.org +Date: Fri Jul 17 03:34:27 2015 +0000 + + upstream commit + + remove -u flag to diff (only used for error output) to make + things easier for -portable + + Upstream-Regress-ID: a5d6777d2909540d87afec3039d9bb2414ade548 + +commit deb8d99ecba70b67f4af7880b11ca8768df9ec3a +Author: djm@openbsd.org +Date: Fri Jul 17 03:09:19 2015 +0000 + + upstream commit + + direct-streamlocal@openssh.com Unix domain foward + messages do not contain a "reserved for future use" field and in fact, + serverloop.c checks that there isn't one. Remove erroneous mention from + PROTOCOL description. bz#2421 from Daniel Black + + Upstream-ID: 3d51a19e64f72f764682f1b08f35a8aa810a43ac + +commit 356b61f365405b5257f5b2ab446e5d7bd33a7b52 +Author: djm@openbsd.org +Date: Fri Jul 17 03:04:27 2015 +0000 + + upstream commit + + describe magic for setting up Unix domain socket fowards + via the mux channel; bz#2422 patch from Daniel Black + + Upstream-ID: 943080fe3864715c423bdeb7c920bb30c4eee861 + +commit d3e2aee41487d55b8d7d40f538b84ff1db7989bc +Author: Darren Tucker +Date: Fri Jul 17 12:52:34 2015 +1000 + + Check if realpath works on nonexistent files. + + On some platforms the native realpath doesn't work with non-existent + files (this is actually specified in some versions of POSIX), however + the sftp spec says its realpath with "canonicalize any given path name". + On those platforms, use realpath from the compat library. + + In addition, when compiling with -DFORTIFY_SOURCE, glibc redefines + the realpath symbol to the checked version, so redefine ours to + something else so we pick up the compat version we want. + + bz#2428, ok djm@ + +commit 25b14610dab655646a109db5ef8cb4c4bf2a48a0 +Author: djm@openbsd.org +Date: Fri Jul 17 02:47:45 2015 +0000 + + upstream commit + + fix incorrect test for SSH1 keys when compiled without SSH1 + support + + Upstream-ID: 6004d720345b8e481c405e8ad05ce2271726e451 + +commit df56a8035d429b2184ee94aaa7e580c1ff67f73a +Author: djm@openbsd.org +Date: Wed Jul 15 08:00:11 2015 +0000 + + upstream commit + + fix NULL-deref when SSH1 reenabled + + Upstream-ID: f22fd805288c92b3e9646782d15b48894b2d5295 + +commit 41e38c4d49dd60908484e6703316651333f16b93 +Author: djm@openbsd.org +Date: Wed Jul 15 07:19:50 2015 +0000 + + upstream commit + + regen RSA1 test keys; the last batch was missing their + private parts + + Upstream-Regress-ID: 7ccf437305dd63ff0b48dd50c5fd0f4d4230c10a + +commit 5bf0933184cb622ca3f96d224bf3299fd2285acc +Author: markus@openbsd.org +Date: Fri Jul 10 06:23:25 2015 +0000 + + upstream commit + + Adapt tests, now that DSA if off by default; use + PubkeyAcceptedKeyTypes and PubkeyAcceptedKeyTypes to test DSA. + + Upstream-Regress-ID: 0ff2a3ff5ac1ce5f92321d27aa07b98656efcc5c + +commit 7a6e3fd7b41dbd3756b6bf9acd67954c0b1564cc +Author: markus@openbsd.org +Date: Tue Jul 7 14:54:16 2015 +0000 + + upstream commit + + regen test data after mktestdata.sh changes + + Upstream-Regress-ID: 3495ecb082b9a7c048a2d7c5c845d3bf181d25a4 + +commit 7c8c174c69f681d4910fa41c37646763692b28e2 +Author: markus@openbsd.org +Date: Tue Jul 7 14:53:30 2015 +0000 + + upstream commit + + adapt tests to new minimum RSA size and default FP format + + Upstream-Regress-ID: a4b30afd174ce82b96df14eb49fb0b81398ffd0e + +commit 6a977a4b68747ade189e43d302f33403fd4a47ac +Author: djm@openbsd.org +Date: Fri Jul 3 04:39:23 2015 +0000 + + upstream commit + + legacy v00 certificates are gone; adapt and don't try to + test them; "sure" markus@ dtucker@ + + Upstream-Regress-ID: c57321e69b3cd4a3b3396dfcc43f0803d047da12 + +commit 0c4123ad5e93fb90fee9c6635b13a6cdabaac385 +Author: djm@openbsd.org +Date: Wed Jul 1 23:11:18 2015 +0000 + + upstream commit + + don't expect SSH v.1 in unittests + + Upstream-Regress-ID: f8812b16668ba78e6a698646b2a652b90b653397 + +commit 3c099845798a817cdde513c39074ec2063781f18 +Author: djm@openbsd.org +Date: Mon Jun 15 06:38:50 2015 +0000 + + upstream commit + + turn SSH1 back on to match src/usr.bin/ssh being tested + + Upstream-Regress-ID: 6c4f763a2f0cc6893bf33983919e9030ae638333 + +commit b1dc2b33689668c75e95f873a42d5aea1f4af1db +Author: dtucker@openbsd.org +Date: Mon Jul 13 04:57:14 2015 +0000 + + upstream commit + + Add "PuTTY_Local:" to the clients to which we do not + offer DH-GEX. This was the string that was used for development versions + prior to September 2014 and they don't do RFC4419 DH-GEX, but unfortunately + there are some extant products based on those versions. bx2424 from Jay + Rouman, ok markus@ djm@ + + Upstream-ID: be34d41e18b966832fe09ca243d275b81882e1d5 + +commit 3a1638dda19bbc73d0ae02b4c251ce08e564b4b9 +Author: markus@openbsd.org +Date: Fri Jul 10 06:21:53 2015 +0000 + + upstream commit + + Turn off DSA by default; add HostKeyAlgorithms to the + server and PubkeyAcceptedKeyTypes to the client side, so it still can be + tested or turned back on; feedback and ok djm@ + + Upstream-ID: 8450a9e6d83f80c9bfed864ff061dfc9323cec21 + +commit 16db0a7ee9a87945cc594d13863cfcb86038db59 +Author: markus@openbsd.org +Date: Thu Jul 9 09:49:46 2015 +0000 + + upstream commit + + re-enable ed25519-certs if compiled w/o openssl; ok djm + + Upstream-ID: e10c90808b001fd2c7a93778418e9b318f5c4c49 + +commit c355bf306ac33de6545ce9dac22b84a194601e2f +Author: markus@openbsd.org +Date: Wed Jul 8 20:24:02 2015 +0000 + + upstream commit + + no need to include the old buffer/key API + + Upstream-ID: fb13c9f7c0bba2545f3eb0a0e69cb0030819f52b + +commit a3cc48cdf9853f1e832d78cb29bedfab7adce1ee +Author: markus@openbsd.org +Date: Wed Jul 8 19:09:25 2015 +0000 + + upstream commit + + typedefs for Cipher&CipherContext are unused + + Upstream-ID: 50e6a18ee92221d23ad173a96d5b6c42207cf9a7 + +commit a635bd06b5c427a57c3ae760d3a2730bb2c863c0 +Author: markus@openbsd.org +Date: Wed Jul 8 19:04:21 2015 +0000 + + upstream commit + + xmalloc.h is unused + + Upstream-ID: afb532355b7fa7135a60d944ca1e644d1d63cb58 + +commit 2521cf0e36c7f3f6b19f206da0af134f535e4a31 +Author: markus@openbsd.org +Date: Wed Jul 8 19:01:15 2015 +0000 + + upstream commit + + compress.c is gone + + Upstream-ID: 174fa7faa9b9643cba06164b5e498591356fbced + +commit c65a7aa6c43aa7a308ee1ab8a96f216169ae9615 +Author: djm@openbsd.org +Date: Fri Jul 3 04:05:54 2015 +0000 + + upstream commit + + another SSH_RSA_MINIMUM_MODULUS_SIZE that needed + cranking + + Upstream-ID: 9d8826cafe96aab4ae8e2f6fd22800874b7ffef1 + +commit b1f383da5cd3cb921fc7776f17a14f44b8a31757 +Author: djm@openbsd.org +Date: Fri Jul 3 03:56:25 2015 +0000 + + upstream commit + + add an XXX reminder for getting correct key paths from + sshd_config + + Upstream-ID: feae52b209d7782ad742df04a4260e9fe41741db + +commit 933935ce8d093996c34d7efa4d59113163080680 +Author: djm@openbsd.org +Date: Fri Jul 3 03:49:45 2015 +0000 + + upstream commit + + refuse to generate or accept RSA keys smaller than 1024 + bits; feedback and ok dtucker@ + + Upstream-ID: 7ea3d31271366ba264f06e34a3539bf1ac30f0ba + +commit bdfd29f60b74f3e678297269dc6247a5699583c1 +Author: djm@openbsd.org +Date: Fri Jul 3 03:47:00 2015 +0000 + + upstream commit + + turn off 1024 bit diffie-hellman-group1-sha1 key + exchange method (already off in server, this turns it off in the client by + default too) ok dtucker@ + + Upstream-ID: f59b88f449210ab7acf7d9d88f20f1daee97a4fa + +commit c28fc62d789d860c75e23a9fa9fb250eb2beca57 +Author: djm@openbsd.org +Date: Fri Jul 3 03:43:18 2015 +0000 + + upstream commit + + delete support for legacy v00 certificates; "sure" + markus@ dtucker@ + + Upstream-ID: b5b9bb5f9202d09e88f912989d74928601b6636f + +commit 564d63e1b4a9637a209d42a9d49646781fc9caef +Author: djm@openbsd.org +Date: Wed Jul 1 23:10:47 2015 +0000 + + upstream commit + + Compile-time disable SSH v.1 again + + Upstream-ID: 1d4b513a3a06232f02650b73bad25100d1b800af + +commit 868109b650504dd9bcccdb1f51d0906f967c20ff +Author: djm@openbsd.org +Date: Wed Jul 1 02:39:06 2015 +0000 + + upstream commit + + twiddle PermitRootLogin back + + Upstream-ID: 2bd23976305d0512e9f84d054e1fc23cd70b89f2 + +commit 7de4b03a6e4071d454b72927ffaf52949fa34545 +Author: djm@openbsd.org +Date: Wed Jul 1 02:32:17 2015 +0000 + + upstream commit + + twiddle; (this commit marks the openssh-6.9 release) + + Upstream-ID: 78500582819f61dd8adee36ec5cc9b9ac9351234 + +commit 1bf477d3cdf1a864646d59820878783d42357a1d +Author: djm@openbsd.org +Date: Wed Jul 1 02:26:31 2015 +0000 + + upstream commit + + better refuse ForwardX11Trusted=no connections attempted + after ForwardX11Timeout expires; reported by Jann Horn + + Upstream-ID: bf0fddadc1b46a0334e26c080038313b4b6dea21 + +commit 47aa7a0f8551b471fcae0447c1d78464f6dba869 +Author: djm@openbsd.org +Date: Wed Jul 1 01:56:13 2015 +0000 + + upstream commit + + put back default PermitRootLogin=no + + Upstream-ID: 7bdedd5cead99c57ed5571f3b6b7840922d5f728 + +commit 984b064fe2a23733733262f88d2e1b2a1a501662 +Author: djm@openbsd.org +Date: Wed Jul 1 01:55:13 2015 +0000 + + upstream commit + + openssh-6.9 + + Upstream-ID: 6cfe8e1904812531080e6ab6e752d7001b5b2d45 + +commit d921082ed670f516652eeba50705e1e9f6325346 +Author: djm@openbsd.org +Date: Wed Jul 1 01:55:00 2015 +0000 + + upstream commit + + reset default PermitRootLogin to 'yes' (momentarily, for + release) + + Upstream-ID: cad8513527066e65dd7a1c16363d6903e8cefa24 + +commit 66295e0e1ba860e527f191b6325d2d77dec4dbce +Author: Damien Miller +Date: Wed Jul 1 11:49:12 2015 +1000 + + crank version numbers for release + +commit 37035c07d4f26bb1fbe000d2acf78efdb008681d +Author: Damien Miller +Date: Wed Jul 1 10:49:37 2015 +1000 + + s/--with-ssh1/--without-ssh1/ + +commit 629df770dbadc2accfbe1c81b3f31f876d0acd84 +Author: djm@openbsd.org +Date: Tue Jun 30 05:25:07 2015 +0000 + + upstream commit + + fatal() when a remote window update causes the window + value to overflow. Reported by Georg Wicherski, ok markus@ + + Upstream-ID: ead397a9aceb3bf74ebfa5fcaf259d72e569f351 + +commit f715afebe735d61df3fd30ad72d9ac1c8bd3b5f2 +Author: djm@openbsd.org *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable@freebsd.org Sun Feb 7 16:51:51 2016 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 92CB9AA0B5C; Sun, 7 Feb 2016 16:51:51 +0000 (UTC) (envelope-from ume@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 6313E1ECF; Sun, 7 Feb 2016 16:51:51 +0000 (UTC) (envelope-from ume@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u17Gpo2O037591; Sun, 7 Feb 2016 16:51:50 GMT (envelope-from ume@FreeBSD.org) Received: (from ume@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u17Gpo19037590; Sun, 7 Feb 2016 16:51:50 GMT (envelope-from ume@FreeBSD.org) Message-Id: <201602071651.u17Gpo19037590@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ume set sender to ume@FreeBSD.org using -f From: Hajimu UMEMOTO Date: Sun, 7 Feb 2016 16:51:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r295378 - stable/10/share/i18n/esdb/MISC X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Feb 2016 16:51:51 -0000 Author: ume Date: Sun Feb 7 16:51:50 2016 New Revision: 295378 URL: https://svnweb.freebsd.org/changeset/base/295378 Log: MFC r295234: Make sure to enable aliases for SHIFT_JIS. Approved by: re (marius) Modified: stable/10/share/i18n/esdb/MISC/MISC.alias Directory Properties: stable/10/ (props changed) Modified: stable/10/share/i18n/esdb/MISC/MISC.alias ============================================================================== --- stable/10/share/i18n/esdb/MISC/MISC.alias Sun Feb 7 16:44:13 2016 (r295377) +++ stable/10/share/i18n/esdb/MISC/MISC.alias Sun Feb 7 16:51:50 2016 (r295378) @@ -29,10 +29,10 @@ JISX0208:1990 x0208 JOHAB cp1361 -SHIFT_JIS csshiftjis -SHIFT_JIS ms_kanji -SHIFT_JIS sjis +Shift_JIS csshiftjis +Shift_JIS ms_kanji +Shift_JIS sjis -SHIFT_JIS-2004 shift_jisx0213 +Shift_JIS-2004 shift_jisx0213 TDS565 iso-ir-230 From owner-svn-src-stable@freebsd.org Sun Feb 7 17:03:51 2016 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0B435AA1183; Sun, 7 Feb 2016 17:03:51 +0000 (UTC) (envelope-from ume@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 CF88E83A; Sun, 7 Feb 2016 17:03:50 +0000 (UTC) (envelope-from ume@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u17H3naH040635; Sun, 7 Feb 2016 17:03:49 GMT (envelope-from ume@FreeBSD.org) Received: (from ume@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u17H3nHZ040634; Sun, 7 Feb 2016 17:03:49 GMT (envelope-from ume@FreeBSD.org) Message-Id: <201602071703.u17H3nHZ040634@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ume set sender to ume@FreeBSD.org using -f From: Hajimu UMEMOTO Date: Sun, 7 Feb 2016 17:03:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r295379 - stable/9/share/i18n/esdb/MISC X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Feb 2016 17:03:51 -0000 Author: ume Date: Sun Feb 7 17:03:49 2016 New Revision: 295379 URL: https://svnweb.freebsd.org/changeset/base/295379 Log: MFC r295234: Make sure to enable aliases for SHIFT_JIS. Modified: stable/9/share/i18n/esdb/MISC/MISC.alias Directory Properties: stable/9/share/i18n/esdb/ (props changed) Modified: stable/9/share/i18n/esdb/MISC/MISC.alias ============================================================================== --- stable/9/share/i18n/esdb/MISC/MISC.alias Sun Feb 7 16:51:50 2016 (r295378) +++ stable/9/share/i18n/esdb/MISC/MISC.alias Sun Feb 7 17:03:49 2016 (r295379) @@ -29,10 +29,10 @@ JISX0208:1990 x0208 JOHAB cp1361 -SHIFT_JIS csshiftjis -SHIFT_JIS ms_kanji -SHIFT_JIS sjis +Shift_JIS csshiftjis +Shift_JIS ms_kanji +Shift_JIS sjis -SHIFT_JIS-2004 shift_jisx0213 +Shift_JIS-2004 shift_jisx0213 TDS565 iso-ir-230 From owner-svn-src-stable@freebsd.org Sun Feb 7 22:53:05 2016 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5F3AEAA1433; Sun, 7 Feb 2016 22:53:05 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 16A8E1AA8; Sun, 7 Feb 2016 22:53:05 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u17Mr4RY045001; Sun, 7 Feb 2016 22:53:04 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u17Mr4da045000; Sun, 7 Feb 2016 22:53:04 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201602072253.u17Mr4da045000@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Sun, 7 Feb 2016 22:53:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r295386 - stable/10/contrib/bsnmp/snmp_mibII X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Feb 2016 22:53:05 -0000 Author: bz Date: Sun Feb 7 22:53:03 2016 New Revision: 295386 URL: https://svnweb.freebsd.org/changeset/base/295386 Log: MFC r295202: Try to fix a bug introduced in r228623 (head). We started to copy the ifa_msghdr as otherwise platforms with strict alignment would break. It is unclear to me if there's also a problem with access to the address list following the structure. However we never copied the address list after the structure and thus are pointing at random memory. For now just use a pointer to the original memory for accessing the address list making it at least work on platforms with weak memory access. PR: 195445 Reported by: wolfgang lyxys.ka.sub.org Tested by: wolfgang lyxys.ka.sub.org (x86) Approved by: re (marius) Modified: stable/10/contrib/bsnmp/snmp_mibII/mibII.c Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/bsnmp/snmp_mibII/mibII.c ============================================================================== --- stable/10/contrib/bsnmp/snmp_mibII/mibII.c Sun Feb 7 22:12:39 2016 (r295385) +++ stable/10/contrib/bsnmp/snmp_mibII/mibII.c Sun Feb 7 22:53:03 2016 (r295386) @@ -969,7 +969,7 @@ handle_rtmsg(struct rt_msghdr *rtm) { struct sockaddr *addrs[RTAX_MAX]; struct if_msghdr *ifm; - struct ifa_msghdr ifam; + struct ifa_msghdr ifam, *ifamp; struct ifma_msghdr *ifmam; #ifdef RTM_IFANNOUNCE struct if_announcemsghdr *ifan; @@ -989,8 +989,9 @@ handle_rtmsg(struct rt_msghdr *rtm) switch (rtm->rtm_type) { case RTM_NEWADDR: - memcpy(&ifam, rtm, sizeof(ifam)); - mib_extract_addrs(ifam.ifam_addrs, (u_char *)(&ifam + 1), addrs); + ifamp = (struct ifa_msghdr *)rtm; + memcpy(&ifam, ifamp, sizeof(ifam)); + mib_extract_addrs(ifam.ifam_addrs, (u_char *)(ifamp + 1), addrs); if (addrs[RTAX_IFA] == NULL || addrs[RTAX_NETMASK] == NULL) break; @@ -1016,8 +1017,9 @@ handle_rtmsg(struct rt_msghdr *rtm) break; case RTM_DELADDR: - memcpy(&ifam, rtm, sizeof(ifam)); - mib_extract_addrs(ifam.ifam_addrs, (u_char *)(&ifam + 1), addrs); + ifamp = (struct ifa_msghdr *)rtm; + memcpy(&ifam, ifamp, sizeof(ifam)); + mib_extract_addrs(ifam.ifam_addrs, (u_char *)(ifamp + 1), addrs); if (addrs[RTAX_IFA] == NULL) break; From owner-svn-src-stable@freebsd.org Sun Feb 7 23:42:37 2016 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A96A2AA0860; Sun, 7 Feb 2016 23:42:37 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 79A5D110C; Sun, 7 Feb 2016 23:42:37 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u17NgaMZ059669; Sun, 7 Feb 2016 23:42:36 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u17NgaT3059668; Sun, 7 Feb 2016 23:42:36 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201602072342.u17NgaT3059668@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Sun, 7 Feb 2016 23:42:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r295388 - stable/10/sys/netinet X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Feb 2016 23:42:37 -0000 Author: bz Date: Sun Feb 7 23:42:36 2016 New Revision: 295388 URL: https://svnweb.freebsd.org/changeset/base/295388 Log: MFC r294514: The variable is write once only and not used. Recover the vertical space. Sponsored by: The FreeBSD Foundation Obtained from: p4 CH=180830 Reviewed by: gnn, hiren Differential Revision:https://reviews.freebsd.org/D4898 Approved by: re (marius, gjb) Modified: stable/10/sys/netinet/igmp.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/netinet/igmp.c ============================================================================== --- stable/10/sys/netinet/igmp.c Sun Feb 7 23:20:44 2016 (r295387) +++ stable/10/sys/netinet/igmp.c Sun Feb 7 23:42:36 2016 (r295388) @@ -654,16 +654,12 @@ igmp_ifdetach(struct ifnet *ifp) void igmp_domifdetach(struct ifnet *ifp) { - struct igmp_ifinfo *igi; CTR3(KTR_IGMPV3, "%s: called for ifp %p(%s)", __func__, ifp, ifp->if_xname); IGMP_LOCK(); - - igi = ((struct in_ifinfo *)ifp->if_afdata[AF_INET])->ii_igmp; igi_delete_locked(ifp); - IGMP_UNLOCK(); } From owner-svn-src-stable@freebsd.org Mon Feb 8 00:07:03 2016 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 66B6CAA15A8; Mon, 8 Feb 2016 00:07:03 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 38D111C2D; Mon, 8 Feb 2016 00:07:03 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u18072h8065681; Mon, 8 Feb 2016 00:07:02 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u18072uD065679; Mon, 8 Feb 2016 00:07:02 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201602080007.u18072uD065679@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Mon, 8 Feb 2016 00:07:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r295389 - in stable/10/sys: netinet netinet6 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Feb 2016 00:07:03 -0000 Author: bz Date: Mon Feb 8 00:07:01 2016 New Revision: 295389 URL: https://svnweb.freebsd.org/changeset/base/295389 Log: MFC r292601,292654: Since r256624 (head) we have been leaking routing table allocations on vnet enabled jail shutdown. Call the provided cleanup routines for IP versions 4 and 6 to plug these leaks. Sponsored by: The FreeBSD Foundation Reviewed by: gnn Differential Revision:https://reviews.freebsd.org/D4530 Approved by: re (gjb) Modified: stable/10/sys/netinet/in_rmx.c stable/10/sys/netinet6/in6_rmx.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/netinet/in_rmx.c ============================================================================== --- stable/10/sys/netinet/in_rmx.c Sun Feb 7 23:42:36 2016 (r295388) +++ stable/10/sys/netinet/in_rmx.c Mon Feb 8 00:07:01 2016 (r295389) @@ -373,7 +373,7 @@ in_detachhead(void **head, int off) { callout_drain(&V_rtq_timer); - return (1); + return (rn_detachhead(head)); } #endif Modified: stable/10/sys/netinet6/in6_rmx.c ============================================================================== --- stable/10/sys/netinet6/in6_rmx.c Sun Feb 7 23:42:36 2016 (r295388) +++ stable/10/sys/netinet6/in6_rmx.c Mon Feb 8 00:07:01 2016 (r295389) @@ -290,7 +290,7 @@ in6_detachhead(void **head, int off) { callout_drain(&V_rtq_mtutimer); - return (1); + return (rn_detachhead(head)); } #endif From owner-svn-src-stable@freebsd.org Mon Feb 8 11:15:37 2016 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9172AA9F4E7; Mon, 8 Feb 2016 11:15:37 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5DAA31A9A; Mon, 8 Feb 2016 11:15:37 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u18BFaEL059423; Mon, 8 Feb 2016 11:15:36 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u18BFat6059422; Mon, 8 Feb 2016 11:15:36 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201602081115.u18BFat6059422@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 8 Feb 2016 11:15:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r295392 - stable/10/sys/kern X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Feb 2016 11:15:37 -0000 Author: kib Date: Mon Feb 8 11:15:36 2016 New Revision: 295392 URL: https://svnweb.freebsd.org/changeset/base/295392 Log: MFC r294735: Don't allow opening the callout device when the callin device is already open (in disguise as the console device). Approved by: re (gjb) Modified: stable/10/sys/kern/tty.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/kern/tty.c ============================================================================== --- stable/10/sys/kern/tty.c Mon Feb 8 10:54:27 2016 (r295391) +++ stable/10/sys/kern/tty.c Mon Feb 8 11:15:36 2016 (r295392) @@ -266,10 +266,10 @@ ttydev_open(struct cdev *dev, int oflags /* * Make sure the "tty" and "cua" device cannot be opened at the - * same time. + * same time. The console is a "tty" device. */ if (TTY_CALLOUT(tp, dev)) { - if (tp->t_flags & TF_OPENED_IN) { + if (tp->t_flags & (TF_OPENED_CONS | TF_OPENED_IN)) { error = EBUSY; goto done; } @@ -322,6 +322,8 @@ ttydev_open(struct cdev *dev, int oflags tp->t_flags |= TF_OPENED_OUT; else tp->t_flags |= TF_OPENED_IN; + MPASS((tp->t_flags & (TF_OPENED_CONS | TF_OPENED_IN)) == 0 || + (tp->t_flags & TF_OPENED_OUT) == 0); done: tp->t_flags &= ~TF_OPENCLOSE; cv_broadcast(&tp->t_dcdwait); @@ -342,7 +344,8 @@ ttydev_close(struct cdev *dev, int fflag * Don't actually close the device if it is being used as the * console. */ - MPASS((tp->t_flags & TF_OPENED) != TF_OPENED); + MPASS((tp->t_flags & (TF_OPENED_CONS | TF_OPENED_IN)) == 0 || + (tp->t_flags & TF_OPENED_OUT) == 0); if (dev == dev_console) tp->t_flags &= ~TF_OPENED_CONS; else From owner-svn-src-stable@freebsd.org Mon Feb 8 11:18:14 2016 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D5F4BA9F7A2; Mon, 8 Feb 2016 11:18:14 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A5F518D; Mon, 8 Feb 2016 11:18:14 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u18BIDFd059947; Mon, 8 Feb 2016 11:18:13 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u18BIDe2059946; Mon, 8 Feb 2016 11:18:13 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201602081118.u18BIDe2059946@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 8 Feb 2016 11:18:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r295393 - stable/10/sys/kern X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Feb 2016 11:18:14 -0000 Author: kib Date: Mon Feb 8 11:18:13 2016 New Revision: 295393 URL: https://svnweb.freebsd.org/changeset/base/295393 Log: MFC r294732: Minor fixes for ddb tty-related commands. Approved by: re (gjb) Modified: stable/10/sys/kern/tty.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/kern/tty.c ============================================================================== --- stable/10/sys/kern/tty.c Mon Feb 8 11:15:36 2016 (r295392) +++ stable/10/sys/kern/tty.c Mon Feb 8 11:18:13 2016 (r295393) @@ -2153,9 +2153,11 @@ static const struct { }; #define TTY_FLAG_BITS \ - "\20\1NOPREFIX\2INITLOCK\3CALLOUT\4OPENED_IN\5OPENED_OUT\6GONE" \ - "\7OPENCLOSE\10ASYNC\11LITERAL\12HIWAT_IN\13HIWAT_OUT\14STOPPED" \ - "\15EXCLUDE\16BYPASS\17ZOMBIE\20HOOK" + "\20\1NOPREFIX\2INITLOCK\3CALLOUT\4OPENED_IN" \ + "\5OPENED_OUT\6OPENED_CONS\7GONE\10OPENCLOSE" \ + "\11ASYNC\12LITERAL\13HIWAT_IN\14HIWAT_OUT" \ + "\15STOPPED\16EXCLUDE\17BYPASS\20ZOMBIE" \ + "\21HOOK\22BUSY_IN\23BUSY_OUT" #define DB_PRINTSYM(name, addr) \ db_printf("%s " #name ": ", sep); \ @@ -2221,9 +2223,9 @@ DB_SHOW_COMMAND(tty, db_show_tty) } tp = (struct tty *)addr; - db_printf("0x%p: %s\n", tp, tty_devname(tp)); + db_printf("%p: %s\n", tp, tty_devname(tp)); db_printf("\tmtx: %p\n", tp->t_mtx); - db_printf("\tflags: %b\n", tp->t_flags, TTY_FLAG_BITS); + db_printf("\tflags: 0x%b\n", tp->t_flags, TTY_FLAG_BITS); db_printf("\trevokecnt: %u\n", tp->t_revokecnt); /* Buffering mechanisms. */ From owner-svn-src-stable@freebsd.org Mon Feb 8 12:29:19 2016 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AF220AA1645; Mon, 8 Feb 2016 12:29:19 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from zxy.spb.ru (zxy.spb.ru [195.70.199.98]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6E7FAF9F; Mon, 8 Feb 2016 12:29:19 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from slw by zxy.spb.ru with local (Exim 4.86 (FreeBSD)) (envelope-from ) id 1aSkwI-000CbJ-AG; Mon, 08 Feb 2016 15:29:10 +0300 Date: Mon, 8 Feb 2016 15:29:10 +0300 From: Slawa Olhovchenkov To: =?utf-8?Q?Jean-S=C3=A9bastien_P=C3=A9dron?= Cc: Andriy Voskoboinyk , svn-src-stable@freebsd.org, "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , svn-src-stable-10@freebsd.org Subject: Re: svn commit: r293857 - stable/10/sys/dev/drm2/i915 Message-ID: <20160208122910.GZ37895@zxy.spb.ru> References: <201601132156.u0DLunQs020854@repo.freebsd.org> <20160123162617.GL37895@zxy.spb.ru> <56A5E89A.3050106@FreeBSD.org> <20160125104506.GV88527@zxy.spb.ru> <56A619C5.6070109@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <56A619C5.6070109@FreeBSD.org> User-Agent: Mutt/1.5.24 (2015-08-30) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: slw@zxy.spb.ru X-SA-Exim-Scanned: No (on zxy.spb.ru); SAEximRunCond expanded to false X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Feb 2016 12:29:19 -0000 On Mon, Jan 25, 2016 at 01:49:09PM +0100, Jean-Sébastien Pédron wrote: > On 25/01/2016 11:50, Andriy Voskoboinyk wrote: > > Try to apply https://svnweb.freebsd.org/base?view=revision&revision=288653 > > (as for me, head/sys/dev/drm2/i915/i915_dma.c change fixes this) > > If this fixes the problem, perfect, I will merge it. BETA builds in actions, do you plan to merge at this time? From owner-svn-src-stable@freebsd.org Mon Feb 8 17:47:59 2016 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 92FD3AA242E; Mon, 8 Feb 2016 17:47:59 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 5EFC71FB4; Mon, 8 Feb 2016 17:47:59 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u18HlwIe073866; Mon, 8 Feb 2016 17:47:58 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u18Hlw0G073865; Mon, 8 Feb 2016 17:47:58 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201602081747.u18Hlw0G073865@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Mon, 8 Feb 2016 17:47:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r295402 - stable/10/sys/netpfil/pf X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Feb 2016 17:47:59 -0000 Author: glebius Date: Mon Feb 8 17:47:58 2016 New Revision: 295402 URL: https://svnweb.freebsd.org/changeset/base/295402 Log: Merge r264915: fix NULL pointer derefernce with special sequence of DIOCADDADDR and DIOCADDRULE. PR: 206933 Approved by: re (marius) Modified: stable/10/sys/netpfil/pf/pf_ioctl.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/netpfil/pf/pf_ioctl.c ============================================================================== --- stable/10/sys/netpfil/pf/pf_ioctl.c Mon Feb 8 17:47:36 2016 (r295401) +++ stable/10/sys/netpfil/pf/pf_ioctl.c Mon Feb 8 17:47:58 2016 (r295402) @@ -350,7 +350,9 @@ pf_empty_pool(struct pf_palist *poola) pfi_dynaddr_remove(pa->addr.p.dyn); break; case PF_ADDR_TABLE: - pfr_detach_table(pa->addr.p.tbl); + /* XXX: this could be unfinished pooladdr on pabuf */ + if (pa->addr.p.tbl != NULL) + pfr_detach_table(pa->addr.p.tbl); break; } if (pa->kif) From owner-svn-src-stable@freebsd.org Mon Feb 8 20:06:27 2016 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 973A1AA1445; Mon, 8 Feb 2016 20:06:27 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5193619FA; Mon, 8 Feb 2016 20:06:27 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u18K6QIV018682; Mon, 8 Feb 2016 20:06:26 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u18K6Q5k018681; Mon, 8 Feb 2016 20:06:26 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201602082006.u18K6Q5k018681@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 8 Feb 2016 20:06:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r295411 - stable/10 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Feb 2016 20:06:27 -0000 Author: emaste Date: Mon Feb 8 20:06:26 2016 New Revision: 295411 URL: https://svnweb.freebsd.org/changeset/base/295411 Log: MFC r280950: Move the efi loaders to be under sys/boot/efi In HEAD this was done to support UEFI on arm64. Merging to stable/10 to facilitate the merging of later UEFI changes. This is a commit of mergeinfo only, missed in r293297. Approved by: re (gjb) Modified: Directory Properties: stable/10/ (props changed) From owner-svn-src-stable@freebsd.org Tue Feb 9 14:35:25 2016 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 49F44AA2BC6; Tue, 9 Feb 2016 14:35:25 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 023439CC; Tue, 9 Feb 2016 14:35:24 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u19EZOuI047326; Tue, 9 Feb 2016 14:35:24 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u19EZO2w047325; Tue, 9 Feb 2016 14:35:24 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201602091435.u19EZO2w047325@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Tue, 9 Feb 2016 14:35:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r295434 - stable/10 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Feb 2016 14:35:25 -0000 Author: emaste Date: Tue Feb 9 14:35:23 2016 New Revision: 295434 URL: https://svnweb.freebsd.org/changeset/base/295434 Log: MFC r281524 -- add mergeinfo missed in r293347 Approved by: re (gjb, blanket) Modified: Directory Properties: stable/10/ (props changed) From owner-svn-src-stable@freebsd.org Tue Feb 9 18:43:53 2016 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A2B54AA280C; Tue, 9 Feb 2016 18:43:53 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 58CBF11CB; Tue, 9 Feb 2016 18:43:53 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u19IhqiX021957; Tue, 9 Feb 2016 18:43:52 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u19IhqfJ021956; Tue, 9 Feb 2016 18:43:52 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201602091843.u19IhqfJ021956@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Tue, 9 Feb 2016 18:43:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r295446 - stable/10 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Feb 2016 18:43:53 -0000 Author: emaste Date: Tue Feb 9 18:43:52 2016 New Revision: 295446 URL: https://svnweb.freebsd.org/changeset/base/295446 Log: Add missing mergeinfo for MFC of r268227 Belatedly record the MFC of r268227, committed in stable/10 r293297. Approved by: re (gjb, blanket) Modified: Directory Properties: stable/10/ (props changed) From owner-svn-src-stable@freebsd.org Tue Feb 9 22:32:26 2016 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BCF5AAA3510; Tue, 9 Feb 2016 22:32:26 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 83FB1CB2; Tue, 9 Feb 2016 22:32:26 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u19MWPRY090573; Tue, 9 Feb 2016 22:32:25 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u19MWO6X089956; Tue, 9 Feb 2016 22:32:24 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201602092232.u19MWO6X089956@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Tue, 9 Feb 2016 22:32:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r295453 - in stable/10/sys/boot: arm/at91/boot2 arm/ixp425/boot2 common efi/boot1 i386/boot2 i386/common i386/gptboot i386/zfsboot pc98/boot2 powerpc/boot1.chrp sparc64/boot1 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Feb 2016 22:32:26 -0000 Author: emaste Date: Tue Feb 9 22:32:24 2016 New Revision: 295453 URL: https://svnweb.freebsd.org/changeset/base/295453 Log: MFC boot loader path and RBX constant deduplication r294765 (imp) Move all the separate copies of the same strings into paths.h. There's nothing machine specific about these. r294765 (imp) RBX_ defines are in rbx.h, move it there. r294847 (imp) Remove static from these two. They slipped through the cracks. r294925 (imp) Fix mistake when transitioning to the new defines with ZFS loader. I hate adding yet another define, but it is the lessor of the evil choices available. Kill another evil by removing PATH_BOOT3 and replacing it with PATH_LOADER or PATH_LOADER_ZFS as appropriate. Approved by: re (gjb) Added: stable/10/sys/boot/common/paths.h - copied, changed from r294765, head/sys/boot/common/paths.h stable/10/sys/boot/common/rbx.h - copied unchanged from r294766, head/sys/boot/common/rbx.h Deleted: stable/10/sys/boot/i386/common/rbx.h Modified: stable/10/sys/boot/arm/at91/boot2/boot2.c stable/10/sys/boot/arm/ixp425/boot2/boot2.c stable/10/sys/boot/efi/boot1/boot1.c stable/10/sys/boot/i386/boot2/boot2.c stable/10/sys/boot/i386/gptboot/gptboot.c stable/10/sys/boot/i386/zfsboot/zfsboot.c stable/10/sys/boot/pc98/boot2/boot2.c stable/10/sys/boot/powerpc/boot1.chrp/boot1.c stable/10/sys/boot/sparc64/boot1/boot1.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/boot/arm/at91/boot2/boot2.c ============================================================================== --- stable/10/sys/boot/arm/at91/boot2/boot2.c Tue Feb 9 21:00:38 2016 (r295452) +++ stable/10/sys/boot/arm/at91/boot2/boot2.c Tue Feb 9 22:32:24 2016 (r295453) @@ -1,6 +1,6 @@ /*- * Copyright (c) 2008 John Hay - * Copyright (c) 2006 Warner Losh + * Copyright (c) 2006 M Warner Losh * Copyright (c) 1998 Robert Nordier * All rights reserved. * @@ -30,52 +30,16 @@ __FBSDID("$FreeBSD$"); #include "lib.h" #include "board.h" +#include "paths.h" +#include "rbx.h" -#define RBX_ASKNAME 0x0 /* -a */ -#define RBX_SINGLE 0x1 /* -s */ -/* 0x2 is reserved for log2(RB_NOSYNC). */ -/* 0x3 is reserved for log2(RB_HALT). */ -/* 0x4 is reserved for log2(RB_INITNAME). */ -#define RBX_DFLTROOT 0x5 /* -r */ -/* #define RBX_KDB 0x6 -d */ -/* 0x7 is reserved for log2(RB_RDONLY). */ -/* 0x8 is reserved for log2(RB_DUMP). */ -/* 0x9 is reserved for log2(RB_MINIROOT). */ -#define RBX_CONFIG 0xa /* -c */ -#define RBX_VERBOSE 0xb /* -v */ -/* #define RBX_SERIAL 0xc -h */ -/* #define RBX_CDROM 0xd -C */ -/* 0xe is reserved for log2(RB_POWEROFF). */ -#define RBX_GDB 0xf /* -g */ -/* #define RBX_MUTE 0x10 -m */ -/* 0x11 is reserved for log2(RB_SELFTEST). */ -/* 0x12 is reserved for boot programs. */ -/* 0x13 is reserved for boot programs. */ -/* #define RBX_PAUSE 0x14 -p */ -/* #define RBX_QUIET 0x15 -q */ -#define RBX_NOINTR 0x1c /* -n */ -/* 0x1d is reserved for log2(RB_MULTIPLE) and is just misnamed here. */ -/* #define RBX_DUAL 0x1d -D */ -/* 0x1f is reserved for log2(RB_BOOTINFO). */ - -/* pass: -a, -s, -r, -v, -g */ -#define RBX_MASK (OPT_SET(RBX_ASKNAME) | OPT_SET(RBX_SINGLE) | \ - OPT_SET(RBX_DFLTROOT) | \ - OPT_SET(RBX_VERBOSE) | \ - OPT_SET(RBX_GDB)) - -#define PATH_DOTCONFIG "/boot.config" -#define PATH_CONFIG "/boot/config" -//#define PATH_KERNEL "/boot/kernel/kernel" +#undef PATH_KERNEL #define PATH_KERNEL "/boot/kernel/kernel.gz.tramp" extern uint32_t _end; #define NOPT 6 -#define OPT_SET(opt) (1 << (opt)) -#define OPT_CHECK(opt) ((opts) & OPT_SET(opt)) - static const char optstr[NOPT] = "agnrsv"; static const unsigned char flags[NOPT] = { RBX_ASKNAME, Modified: stable/10/sys/boot/arm/ixp425/boot2/boot2.c ============================================================================== --- stable/10/sys/boot/arm/ixp425/boot2/boot2.c Tue Feb 9 21:00:38 2016 (r295452) +++ stable/10/sys/boot/arm/ixp425/boot2/boot2.c Tue Feb 9 22:32:24 2016 (r295453) @@ -28,51 +28,13 @@ __FBSDID("$FreeBSD$"); #include #include "lib.h" - -#define RBX_ASKNAME 0x0 /* -a */ -#define RBX_SINGLE 0x1 /* -s */ -/* 0x2 is reserved for log2(RB_NOSYNC). */ -/* 0x3 is reserved for log2(RB_HALT). */ -/* 0x4 is reserved for log2(RB_INITNAME). */ -#define RBX_DFLTROOT 0x5 /* -r */ -/* #define RBX_KDB 0x6 -d */ -/* 0x7 is reserved for log2(RB_RDONLY). */ -/* 0x8 is reserved for log2(RB_DUMP). */ -/* 0x9 is reserved for log2(RB_MINIROOT). */ -#define RBX_CONFIG 0xa /* -c */ -#define RBX_VERBOSE 0xb /* -v */ -/* #define RBX_SERIAL 0xc -h */ -/* #define RBX_CDROM 0xd -C */ -/* 0xe is reserved for log2(RB_POWEROFF). */ -#define RBX_GDB 0xf /* -g */ -/* #define RBX_MUTE 0x10 -m */ -/* 0x11 is reserved for log2(RB_SELFTEST). */ -/* 0x12 is reserved for boot programs. */ -/* 0x13 is reserved for boot programs. */ -/* #define RBX_PAUSE 0x14 -p */ -/* #define RBX_QUIET 0x15 -q */ -#define RBX_NOINTR 0x1c /* -n */ -/* 0x1d is reserved for log2(RB_MULTIPLE) and is just misnamed here. */ -/* #define RBX_DUAL 0x1d -D */ -/* 0x1f is reserved for log2(RB_BOOTINFO). */ - -/* pass: -a, -s, -r, -v, -g */ -#define RBX_MASK (OPT_SET(RBX_ASKNAME) | OPT_SET(RBX_SINGLE) | \ - OPT_SET(RBX_DFLTROOT) | \ - OPT_SET(RBX_VERBOSE) | \ - OPT_SET(RBX_GDB)) - -#define PATH_DOTCONFIG "/boot.config" -#define PATH_CONFIG "/boot/config" -#define PATH_KERNEL "/boot/kernel/kernel" +#include "paths.h" +#include "rbx.h" extern uint32_t _end; #define NOPT 6 -#define OPT_SET(opt) (1 << (opt)) -#define OPT_CHECK(opt) ((opts) & OPT_SET(opt)) - static const char optstr[NOPT] = "agnrsv"; static const unsigned char flags[NOPT] = { RBX_ASKNAME, Copied and modified: stable/10/sys/boot/common/paths.h (from r294765, head/sys/boot/common/paths.h) ============================================================================== --- head/sys/boot/common/paths.h Tue Jan 26 06:26:19 2016 (r294765, copy source) +++ stable/10/sys/boot/common/paths.h Tue Feb 9 22:32:24 2016 (r295453) @@ -31,9 +31,9 @@ #define PATH_DOTCONFIG "/boot.config" #define PATH_CONFIG "/boot/config" -#define PATH_BOOT3 "/boot/loader" #define PATH_LOADER "/boot/loader" #define PATH_LOADER_EFI "/boot/loader.efi" +#define PATH_LOADER_ZFS "/boot/zfsloader" #define PATH_KERNEL "/boot/kernel/kernel" #endif /* _PATHS_H_ */ Copied: stable/10/sys/boot/common/rbx.h (from r294766, head/sys/boot/common/rbx.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/sys/boot/common/rbx.h Tue Feb 9 22:32:24 2016 (r295453, copy of r294766, head/sys/boot/common/rbx.h) @@ -0,0 +1,61 @@ +/*- + * Copyright (c) 1998 Robert Nordier + * All rights reserved. + * + * Redistribution and use in source and binary forms are freely + * permitted provided that the above copyright notice and this + * paragraph and the following disclaimer are duplicated in all + * such forms. + * + * This software is provided "AS IS" and without any express or + * implied warranties, including, without limitation, the implied + * warranties of merchantability and fitness for a particular + * purpose. + * + * $FreeBSD$ + */ + +#ifndef _RBX_H_ +#define _RBX_H_ + +#define RBX_ASKNAME 0x0 /* -a */ +#define RBX_SINGLE 0x1 /* -s */ +/* 0x2 is reserved for log2(RB_NOSYNC). */ +/* 0x3 is reserved for log2(RB_HALT). */ +/* 0x4 is reserved for log2(RB_INITNAME). */ +#define RBX_DFLTROOT 0x5 /* -r */ +#define RBX_KDB 0x6 /* -d */ +/* 0x7 is reserved for log2(RB_RDONLY). */ +/* 0x8 is reserved for log2(RB_DUMP). */ +/* 0x9 is reserved for log2(RB_MINIROOT). */ +#define RBX_CONFIG 0xa /* -c */ +#define RBX_VERBOSE 0xb /* -v */ +#define RBX_SERIAL 0xc /* -h */ +#define RBX_CDROM 0xd /* -C */ +/* 0xe is reserved for log2(RB_POWEROFF). */ +#define RBX_GDB 0xf /* -g */ +#define RBX_MUTE 0x10 /* -m */ +/* 0x11 is reserved for log2(RB_SELFTEST). */ +/* 0x12 is reserved for boot programs. */ +/* 0x13 is reserved for boot programs. */ +#define RBX_PAUSE 0x14 /* -p */ +#define RBX_QUIET 0x15 /* -q */ +#define RBX_NOINTR 0x1c /* -n */ +/* 0x1d is reserved for log2(RB_MULTIPLE) and is just misnamed here. */ +#define RBX_DUAL 0x1d /* -D */ +/* 0x1f is reserved for log2(RB_BOOTINFO). */ + +/* pass: -a, -s, -r, -d, -c, -v, -h, -C, -g, -m, -p, -D */ +#define RBX_MASK (OPT_SET(RBX_ASKNAME) | OPT_SET(RBX_SINGLE) | \ + OPT_SET(RBX_DFLTROOT) | OPT_SET(RBX_KDB ) | \ + OPT_SET(RBX_CONFIG) | OPT_SET(RBX_VERBOSE) | \ + OPT_SET(RBX_SERIAL) | OPT_SET(RBX_CDROM) | \ + OPT_SET(RBX_GDB ) | OPT_SET(RBX_MUTE) | \ + OPT_SET(RBX_PAUSE) | OPT_SET(RBX_DUAL)) + +#define OPT_SET(opt) (1 << (opt)) +#define OPT_CHECK(opt) ((opts) & OPT_SET(opt)) + +extern uint32_t opts; + +#endif /* !_RBX_H_ */ Modified: stable/10/sys/boot/efi/boot1/boot1.c ============================================================================== --- stable/10/sys/boot/efi/boot1/boot1.c Tue Feb 9 21:00:38 2016 (r295452) +++ stable/10/sys/boot/efi/boot1/boot1.c Tue Feb 9 22:32:24 2016 (r295453) @@ -31,8 +31,7 @@ __FBSDID("$FreeBSD$"); #include #include "boot_module.h" - -#define _PATH_LOADER "/boot/loader.efi" +#include "paths.h" static const boot_module_t *boot_modules[] = { @@ -99,13 +98,13 @@ try_load(const boot_module_t *mod) EFI_LOADED_IMAGE *loaded_image; EFI_STATUS status; - status = mod->load(_PATH_LOADER, &dev, &buf, &bufsize); + status = mod->load(PATH_LOADER_EFI, &dev, &buf, &bufsize); if (status == EFI_NOT_FOUND) return; if (status != EFI_SUCCESS) { - printf("%s failed to load %s (%lu)\n", mod->name, _PATH_LOADER, - EFI_ERROR_CODE(status)); + printf("%s failed to load %s (%lu)\n", mod->name, + PATH_LOADER_EFI, EFI_ERROR_CODE(status)); return; } @@ -174,7 +173,7 @@ efi_main(EFI_HANDLE Ximage, EFI_SYSTEM_T conout->ClearScreen(conout); printf("\n>> FreeBSD EFI boot block\n"); - printf(" Loader path: %s\n\n", _PATH_LOADER); + printf(" Loader path: %s\n\n", PATH_LOADER_EFI); printf(" Initializing modules:"); for (i = 0; i < NUM_BOOT_MODULES; i++) { if (boot_modules[i] == NULL) Modified: stable/10/sys/boot/i386/boot2/boot2.c ============================================================================== --- stable/10/sys/boot/i386/boot2/boot2.c Tue Feb 9 21:00:38 2016 (r295452) +++ stable/10/sys/boot/i386/boot2/boot2.c Tue Feb 9 22:32:24 2016 (r295453) @@ -33,6 +33,8 @@ __FBSDID("$FreeBSD$"); #include "boot2.h" #include "lib.h" +#include "paths.h" +#include "rbx.h" /* Define to 0 to omit serial support */ #ifndef SERIAL @@ -52,46 +54,6 @@ __FBSDID("$FreeBSD$"); #define SECOND 18 /* Circa that many ticks in a second. */ -#define RBX_ASKNAME 0x0 /* -a */ -#define RBX_SINGLE 0x1 /* -s */ -/* 0x2 is reserved for log2(RB_NOSYNC). */ -/* 0x3 is reserved for log2(RB_HALT). */ -/* 0x4 is reserved for log2(RB_INITNAME). */ -#define RBX_DFLTROOT 0x5 /* -r */ -#define RBX_KDB 0x6 /* -d */ -/* 0x7 is reserved for log2(RB_RDONLY). */ -/* 0x8 is reserved for log2(RB_DUMP). */ -/* 0x9 is reserved for log2(RB_MINIROOT). */ -#define RBX_CONFIG 0xa /* -c */ -#define RBX_VERBOSE 0xb /* -v */ -#define RBX_SERIAL 0xc /* -h */ -#define RBX_CDROM 0xd /* -C */ -/* 0xe is reserved for log2(RB_POWEROFF). */ -#define RBX_GDB 0xf /* -g */ -#define RBX_MUTE 0x10 /* -m */ -/* 0x11 is reserved for log2(RB_SELFTEST). */ -/* 0x12 is reserved for boot programs. */ -/* 0x13 is reserved for boot programs. */ -#define RBX_PAUSE 0x14 /* -p */ -#define RBX_QUIET 0x15 /* -q */ -#define RBX_NOINTR 0x1c /* -n */ -/* 0x1d is reserved for log2(RB_MULTIPLE) and is just misnamed here. */ -#define RBX_DUAL 0x1d /* -D */ -/* 0x1f is reserved for log2(RB_BOOTINFO). */ - -/* pass: -a, -s, -r, -d, -c, -v, -h, -C, -g, -m, -p, -D */ -#define RBX_MASK (OPT_SET(RBX_ASKNAME) | OPT_SET(RBX_SINGLE) | \ - OPT_SET(RBX_DFLTROOT) | OPT_SET(RBX_KDB ) | \ - OPT_SET(RBX_CONFIG) | OPT_SET(RBX_VERBOSE) | \ - OPT_SET(RBX_SERIAL) | OPT_SET(RBX_CDROM) | \ - OPT_SET(RBX_GDB ) | OPT_SET(RBX_MUTE) | \ - OPT_SET(RBX_PAUSE) | OPT_SET(RBX_DUAL)) - -#define PATH_DOTCONFIG "/boot.config" -#define PATH_CONFIG "/boot/config" -#define PATH_BOOT3 "/boot/loader" -#define PATH_KERNEL "/boot/kernel/kernel" - #define ARGS 0x900 #define NOPT 14 #define NDEV 3 @@ -106,9 +68,6 @@ __FBSDID("$FreeBSD$"); #define TYPE_MAXHARD TYPE_DA #define TYPE_FD 2 -#define OPT_SET(opt) (1 << (opt)) -#define OPT_CHECK(opt) ((opts) & OPT_SET(opt)) - extern uint32_t _end; static const char optstr[NOPT] = "DhaCcdgmnpqrsv"; /* Also 'P', 'S' */ @@ -143,7 +102,7 @@ static struct dsk { } dsk; static char cmd[512], cmddup[512], knamebuf[1024]; static const char *kname; -static uint32_t opts; +uint32_t opts; static struct bootinfo bootinfo; #if SERIAL static int comspeed = SIOSPD; @@ -275,7 +234,7 @@ main(void) */ if (!kname) { - kname = PATH_BOOT3; + kname = PATH_LOADER; if (autoboot && !keyhit(3*SECOND)) { load(); kname = PATH_KERNEL; Modified: stable/10/sys/boot/i386/gptboot/gptboot.c ============================================================================== --- stable/10/sys/boot/i386/gptboot/gptboot.c Tue Feb 9 21:00:38 2016 (r295452) +++ stable/10/sys/boot/i386/gptboot/gptboot.c Tue Feb 9 22:32:24 2016 (r295453) @@ -37,11 +37,7 @@ __FBSDID("$FreeBSD$"); #include "util.h" #include "cons.h" #include "gpt.h" - -#define PATH_DOTCONFIG "/boot.config" -#define PATH_CONFIG "/boot/config" -#define PATH_BOOT3 "/boot/loader" -#define PATH_KERNEL "/boot/kernel/kernel" +#include "paths.h" #define ARGS 0x900 #define NOPT 14 @@ -180,7 +176,7 @@ main(void) if (autoboot && keyhit(3)) { if (*kname == '\0') - memcpy(kname, PATH_BOOT3, sizeof(PATH_BOOT3)); + memcpy(kname, PATH_LOADER, sizeof(PATH_LOADER)); break; } autoboot = 0; @@ -192,7 +188,7 @@ main(void) */ if (*kname != '\0') load(); - memcpy(kname, PATH_BOOT3, sizeof(PATH_BOOT3)); + memcpy(kname, PATH_LOADER, sizeof(PATH_LOADER)); load(); memcpy(kname, PATH_KERNEL, sizeof(PATH_KERNEL)); load(); Modified: stable/10/sys/boot/i386/zfsboot/zfsboot.c ============================================================================== --- stable/10/sys/boot/i386/zfsboot/zfsboot.c Tue Feb 9 21:00:38 2016 (r295452) +++ stable/10/sys/boot/i386/zfsboot/zfsboot.c Tue Feb 9 22:32:24 2016 (r295453) @@ -42,14 +42,10 @@ __FBSDID("$FreeBSD$"); #include "util.h" #include "cons.h" #include "bootargs.h" +#include "paths.h" #include "libzfs.h" -#define PATH_DOTCONFIG "/boot.config" -#define PATH_CONFIG "/boot/config" -#define PATH_BOOT3 "/boot/zfsloader" -#define PATH_KERNEL "/boot/kernel/kernel" - #define ARGS 0x900 #define NOPT 14 #define NDEV 3 @@ -550,12 +546,12 @@ main(void) } /* - * Try to exec stage 3 boot loader. If interrupted by a keypress, + * Try to exec /boot/loader. If interrupted by a keypress, * or in case of failure, try to load a kernel directly instead. */ if (autoboot && !*kname) { - memcpy(kname, PATH_BOOT3, sizeof(PATH_BOOT3)); + memcpy(kname, PATH_LOADER_ZFS, sizeof(PATH_LOADER_ZFS)); if (!keyhit(3)) { load(); memcpy(kname, PATH_KERNEL, sizeof(PATH_KERNEL)); Modified: stable/10/sys/boot/pc98/boot2/boot2.c ============================================================================== --- stable/10/sys/boot/pc98/boot2/boot2.c Tue Feb 9 21:00:38 2016 (r295452) +++ stable/10/sys/boot/pc98/boot2/boot2.c Tue Feb 9 22:32:24 2016 (r295453) @@ -35,6 +35,8 @@ __FBSDID("$FreeBSD$"); #include "boot2.h" #include "lib.h" +#include "paths.h" +#include "rbx.h" /* Define to 0 to omit serial support */ #ifndef SERIAL @@ -54,46 +56,6 @@ __FBSDID("$FreeBSD$"); #define SECOND 1 /* Circa that many ticks in a second. */ -#define RBX_ASKNAME 0x0 /* -a */ -#define RBX_SINGLE 0x1 /* -s */ -/* 0x2 is reserved for log2(RB_NOSYNC). */ -/* 0x3 is reserved for log2(RB_HALT). */ -/* 0x4 is reserved for log2(RB_INITNAME). */ -#define RBX_DFLTROOT 0x5 /* -r */ -#define RBX_KDB 0x6 /* -d */ -/* 0x7 is reserved for log2(RB_RDONLY). */ -/* 0x8 is reserved for log2(RB_DUMP). */ -/* 0x9 is reserved for log2(RB_MINIROOT). */ -#define RBX_CONFIG 0xa /* -c */ -#define RBX_VERBOSE 0xb /* -v */ -#define RBX_SERIAL 0xc /* -h */ -#define RBX_CDROM 0xd /* -C */ -/* 0xe is reserved for log2(RB_POWEROFF). */ -#define RBX_GDB 0xf /* -g */ -#define RBX_MUTE 0x10 /* -m */ -/* 0x11 is reserved for log2(RB_SELFTEST). */ -/* 0x12 is reserved for boot programs. */ -/* 0x13 is reserved for boot programs. */ -#define RBX_PAUSE 0x14 /* -p */ -#define RBX_QUIET 0x15 /* -q */ -#define RBX_NOINTR 0x1c /* -n */ -/* 0x1d is reserved for log2(RB_MULTIPLE) and is just misnamed here. */ -#define RBX_DUAL 0x1d /* -D */ -/* 0x1f is reserved for log2(RB_BOOTINFO). */ - -/* pass: -a, -s, -r, -d, -c, -v, -h, -C, -g, -m, -p, -D */ -#define RBX_MASK (OPT_SET(RBX_ASKNAME) | OPT_SET(RBX_SINGLE) | \ - OPT_SET(RBX_DFLTROOT) | OPT_SET(RBX_KDB ) | \ - OPT_SET(RBX_CONFIG) | OPT_SET(RBX_VERBOSE) | \ - OPT_SET(RBX_SERIAL) | OPT_SET(RBX_CDROM) | \ - OPT_SET(RBX_GDB ) | OPT_SET(RBX_MUTE) | \ - OPT_SET(RBX_PAUSE) | OPT_SET(RBX_DUAL)) - -#define PATH_DOTCONFIG "/boot.config" -#define PATH_CONFIG "/boot/config" -#define PATH_BOOT3 "/boot/loader" -#define PATH_KERNEL "/boot/kernel/kernel" - #define ARGS 0x900 #define NOPT 14 #define NDEV 3 @@ -105,9 +67,6 @@ __FBSDID("$FreeBSD$"); #define TYPE_DA 1 #define TYPE_FD 2 -#define OPT_SET(opt) (1 << (opt)) -#define OPT_CHECK(opt) ((opts) & OPT_SET(opt)) - extern uint32_t _end; static const char optstr[NOPT] = "DhaCcdgmnpqrsv"; /* Also 'P', 'S' */ @@ -145,7 +104,7 @@ static struct dsk { } dsk; static char cmd[512], cmddup[512], knamebuf[1024]; static const char *kname; -static uint32_t opts; +uint32_t opts; static struct bootinfo bootinfo; #if SERIAL static int comspeed = SIOSPD; @@ -414,7 +373,7 @@ main(void) */ if (!kname) { - kname = PATH_BOOT3; + kname = PATH_LOADER; if (autoboot && !keyhit(3*SECOND)) { load(); kname = PATH_KERNEL; Modified: stable/10/sys/boot/powerpc/boot1.chrp/boot1.c ============================================================================== --- stable/10/sys/boot/powerpc/boot1.chrp/boot1.c Tue Feb 9 21:00:38 2016 (r295452) +++ stable/10/sys/boot/powerpc/boot1.chrp/boot1.c Tue Feb 9 22:32:24 2016 (r295453) @@ -23,8 +23,7 @@ __FBSDID("$FreeBSD$"); #include #include -#define _PATH_LOADER "/boot/loader" -#define _PATH_KERNEL "/boot/kernel/kernel" +#include "paths.h" #define BSIZEMAX 16384 @@ -396,7 +395,7 @@ main(int ac, char **av) char bootpath_full[255]; int i, len; - path = _PATH_LOADER; + path = PATH_LOADER; for (i = 0; i < ac; i++) { switch (av[i][0]) { case '-': Modified: stable/10/sys/boot/sparc64/boot1/boot1.c ============================================================================== --- stable/10/sys/boot/sparc64/boot1/boot1.c Tue Feb 9 21:00:38 2016 (r295452) +++ stable/10/sys/boot/sparc64/boot1/boot1.c Tue Feb 9 22:32:24 2016 (r295453) @@ -24,8 +24,8 @@ __FBSDID("$FreeBSD$"); #include #include -#define _PATH_LOADER "/boot/loader" -#define _PATH_KERNEL "/boot/kernel/kernel" +#include "paths.h" + #define READ_BUF_SIZE 8192 typedef int putc_func_t(char c, void *arg); @@ -324,7 +324,7 @@ main(int ac, char **av) const char *path; int i; - path = _PATH_LOADER; + path = PATH_LOADER; for (i = 0; i < ac; i++) { switch (av[i][0]) { case '-': From owner-svn-src-stable@freebsd.org Wed Feb 10 00:08:53 2016 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 93179AA2830; Wed, 10 Feb 2016 00:08:53 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5E55E1E1D; Wed, 10 Feb 2016 00:08:53 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1A08qYa018253; Wed, 10 Feb 2016 00:08:52 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1A08pnF018243; Wed, 10 Feb 2016 00:08:51 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201602100008.u1A08pnF018243@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Wed, 10 Feb 2016 00:08:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r295454 - in stable/10: lib/libprocstat lib/libutil share/man/man5 sys/kern sys/sys X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Feb 2016 00:08:53 -0000 Author: jhb Date: Wed Feb 10 00:08:51 2016 New Revision: 295454 URL: https://svnweb.freebsd.org/changeset/base/295454 Log: MFC 287442,287537,288944: Fix corruption of coredumps due to procstat notes changing size during coredump generation. The changes in r287442 required some reworking since the 'fo_fill_kinfo' file op does not exist in stable/10. 287442: Detect badly behaved coredump note helpers Coredump notes depend on being able to invoke dump routines twice; once in a dry-run mode to get the size of the note, and another to actually emit the note to the corefile. When a note helper emits a different length section the second time around than the length it requested the first time, the kernel produces a corrupt coredump. NT_PROCSTAT_FILES output length, when packing kinfo structs, is tied to the length of filenames corresponding to vnodes in the process' fd table via vn_fullpath. As vnodes may move around during dump, this is racy. So: - Detect badly behaved notes in putnote() and pad underfilled notes. - Add a fail point, debug.fail_point.fill_kinfo_vnode__random_path to exercise the NT_PROCSTAT_FILES corruption. It simply picks random lengths to expand or truncate paths to in fo_fill_kinfo_vnode(). - Add a sysctl, kern.coredump_pack_fileinfo, to allow users to disable kinfo packing for PROCSTAT_FILES notes. This should avoid both FILES note corruption and truncation, even if filenames change, at the cost of about 1 kiB in padding bloat per open fd. Document the new sysctl in core.5. - Fix note_procstat_files to self-limit in the 2nd pass. Since sometimes this will result in a short write, pad up to our advertised size. This addresses note corruption, at the risk of sometimes truncating the last several fd info entries. - Fix NT_PROCSTAT_FILES consumers libutil and libprocstat to grok the zero padding. 287537: Follow-up to r287442: Move sysctl to compiled-once file Avoid duplicate sysctl nodes. 288944: Fix core corruption caused by race in note_procstat_vmmap This fix is spiritually similar to r287442 and was discovered thanks to the KASSERT added in that revision. NT_PROCSTAT_VMMAP output length, when packing kinfo structs, is tied to the length of filenames corresponding to vnodes in the process' vm map via vn_fullpath. As vnodes may move during coredump, this is racy. We do not remove the race, only prevent it from causing coredump corruption. - Add a sysctl, kern.coredump_pack_vmmapinfo, to allow users to disable kinfo packing for PROCSTAT_VMMAP notes. This avoids VMMAP corruption and truncation, even if names change, at the cost of up to PATH_MAX bytes per mapped object. The new sysctl is documented in core.5. - Fix note_procstat_vmmap to self-limit in the second pass. This addresses corruption, at the cost of sometimes producing a truncated result. - Fix PROCSTAT_VMMAP consumers libutil (and libprocstat, via copy-paste) to grok the new zero padding. Approved by: re (gjb) Modified: stable/10/lib/libprocstat/libprocstat.c stable/10/lib/libutil/kinfo_getfile.c stable/10/lib/libutil/kinfo_getvmmap.c stable/10/share/man/man5/core.5 stable/10/sys/kern/imgact_elf.c stable/10/sys/kern/kern_descrip.c stable/10/sys/kern/kern_exec.c stable/10/sys/kern/kern_proc.c stable/10/sys/sys/exec.h stable/10/sys/sys/user.h Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libprocstat/libprocstat.c ============================================================================== --- stable/10/lib/libprocstat/libprocstat.c Tue Feb 9 22:32:24 2016 (r295453) +++ stable/10/lib/libprocstat/libprocstat.c Wed Feb 10 00:08:51 2016 (r295454) @@ -767,6 +767,8 @@ kinfo_getfile_core(struct procstat_core eb = buf + len; while (bp < eb) { kf = (struct kinfo_file *)(uintptr_t)bp; + if (kf->kf_structsize == 0) + break; bp += kf->kf_structsize; cnt++; } @@ -782,6 +784,8 @@ kinfo_getfile_core(struct procstat_core /* Pass 2: unpack */ while (bp < eb) { kf = (struct kinfo_file *)(uintptr_t)bp; + if (kf->kf_structsize == 0) + break; /* Copy/expand into pre-zeroed buffer */ memcpy(kp, kf, kf->kf_structsize); /* Advance to next packed record */ @@ -1863,6 +1867,8 @@ kinfo_getvmmap_core(struct procstat_core eb = buf + len; while (bp < eb) { kv = (struct kinfo_vmentry *)(uintptr_t)bp; + if (kv->kve_structsize == 0) + break; bp += kv->kve_structsize; cnt++; } @@ -1878,6 +1884,8 @@ kinfo_getvmmap_core(struct procstat_core /* Pass 2: unpack */ while (bp < eb) { kv = (struct kinfo_vmentry *)(uintptr_t)bp; + if (kv->kve_structsize == 0) + break; /* Copy/expand into pre-zeroed buffer */ memcpy(kp, kv, kv->kve_structsize); /* Advance to next packed record */ Modified: stable/10/lib/libutil/kinfo_getfile.c ============================================================================== --- stable/10/lib/libutil/kinfo_getfile.c Tue Feb 9 22:32:24 2016 (r295453) +++ stable/10/lib/libutil/kinfo_getfile.c Wed Feb 10 00:08:51 2016 (r295454) @@ -44,6 +44,8 @@ kinfo_getfile(pid_t pid, int *cntp) eb = buf + len; while (bp < eb) { kf = (struct kinfo_file *)(uintptr_t)bp; + if (kf->kf_structsize == 0) + break; bp += kf->kf_structsize; cnt++; } @@ -59,6 +61,8 @@ kinfo_getfile(pid_t pid, int *cntp) /* Pass 2: unpack */ while (bp < eb) { kf = (struct kinfo_file *)(uintptr_t)bp; + if (kf->kf_structsize == 0) + break; /* Copy/expand into pre-zeroed buffer */ memcpy(kp, kf, kf->kf_structsize); /* Advance to next packed record */ Modified: stable/10/lib/libutil/kinfo_getvmmap.c ============================================================================== --- stable/10/lib/libutil/kinfo_getvmmap.c Tue Feb 9 22:32:24 2016 (r295453) +++ stable/10/lib/libutil/kinfo_getvmmap.c Wed Feb 10 00:08:51 2016 (r295454) @@ -44,6 +44,8 @@ kinfo_getvmmap(pid_t pid, int *cntp) eb = buf + len; while (bp < eb) { kv = (struct kinfo_vmentry *)(uintptr_t)bp; + if (kv->kve_structsize == 0) + break; bp += kv->kve_structsize; cnt++; } @@ -59,6 +61,8 @@ kinfo_getvmmap(pid_t pid, int *cntp) /* Pass 2: unpack */ while (bp < eb) { kv = (struct kinfo_vmentry *)(uintptr_t)bp; + if (kv->kve_structsize == 0) + break; /* Copy/expand into pre-zeroed buffer */ memcpy(kp, kv, kv->kve_structsize); /* Advance to next packed record */ Modified: stable/10/share/man/man5/core.5 ============================================================================== --- stable/10/share/man/man5/core.5 Tue Feb 9 22:32:24 2016 (r295453) +++ stable/10/share/man/man5/core.5 Wed Feb 10 00:08:51 2016 (r295454) @@ -32,7 +32,7 @@ .\" @(#)core.5 8.3 (Berkeley) 12/11/93 .\" $FreeBSD$ .\" -.Dd November 22, 2012 +.Dd October 5, 2015 .Dt CORE 5 .Os .Sh NAME @@ -126,6 +126,29 @@ Core files will have the suffix .Em .gz appended to them. .El +.Sh NOTES +Corefiles are written with open file descriptor information as an ELF note. +By default, file paths are packed to only use as much space as needed. +However, file paths can change at any time, including during core dump, +and this can result in truncated file descriptor data. +.Pp +All file descriptor information can be preserved by disabling packing. +This potentially wastes up to PATH_MAX bytes per open fd. +Packing is disabled with +.Dl sysctl kern.coredump_pack_fileinfo=0 . +.Pp +Similarly, corefiles are written with vmmap information as an ELF note, which +contains file paths. +By default, they are packed to only use as much space as +needed. +By the same mechanism as for the open files note, these paths can also +change at any time and result in a truncated note. +.Pp +All vmmap information can be preserved by disabling packing. +Like the file information, this potentially wastes up to PATH_MAX bytes per +mapped object. +Packing is disabled with +.Dl sysctl kern.coredump_pack_vmmapinfo=0 . .Sh EXAMPLES In order to store all core images in per-user private areas under .Pa /var/coredumps , Modified: stable/10/sys/kern/imgact_elf.c ============================================================================== --- stable/10/sys/kern/imgact_elf.c Tue Feb 9 22:32:24 2016 (r295453) +++ stable/10/sys/kern/imgact_elf.c Wed Feb 10 00:08:51 2016 (r295454) @@ -1709,7 +1709,8 @@ static void __elfN(putnote)(struct note_info *ninfo, struct sbuf *sb) { Elf_Note note; - ssize_t old_len; + ssize_t old_len, sect_len; + size_t new_len, descsz, i; if (ninfo->type == -1) { ninfo->outfunc(ninfo->outarg, sb, &ninfo->outsize); @@ -1728,7 +1729,33 @@ __elfN(putnote)(struct note_info *ninfo, return; sbuf_start_section(sb, &old_len); ninfo->outfunc(ninfo->outarg, sb, &ninfo->outsize); - sbuf_end_section(sb, old_len, ELF_NOTE_ROUNDSIZE, 0); + sect_len = sbuf_end_section(sb, old_len, ELF_NOTE_ROUNDSIZE, 0); + if (sect_len < 0) + return; + + new_len = (size_t)sect_len; + descsz = roundup(note.n_descsz, ELF_NOTE_ROUNDSIZE); + if (new_len < descsz) { + /* + * It is expected that individual note emitters will correctly + * predict their expected output size and fill up to that size + * themselves, padding in a format-specific way if needed. + * However, in case they don't, just do it here with zeros. + */ + for (i = 0; i < descsz - new_len; i++) + sbuf_putc(sb, 0); + } else if (new_len > descsz) { + /* + * We can't always truncate sb -- we may have drained some + * of it already. + */ + KASSERT(new_len == descsz, ("%s: Note type %u changed as we " + "read it (%zu > %zu). Since it is longer than " + "expected, this coredump's notes are corrupt. THIS " + "IS A BUG in the note_procstat routine for type %u.\n", + __func__, (unsigned)note.n_type, new_len, descsz, + (unsigned)note.n_type)); + } } /* @@ -1909,25 +1936,47 @@ static void note_procstat_files(void *arg, struct sbuf *sb, size_t *sizep) { struct proc *p; - size_t size; - int structsize; + size_t size, sect_sz, i; + ssize_t start_len, sect_len; + int structsize, filedesc_flags; + + if (coredump_pack_fileinfo) + filedesc_flags = KERN_FILEDESC_PACK_KINFO; + else + filedesc_flags = 0; p = (struct proc *)arg; + structsize = sizeof(struct kinfo_file); if (sb == NULL) { size = 0; sb = sbuf_new(NULL, NULL, 128, SBUF_FIXEDLEN); sbuf_set_drain(sb, sbuf_drain_count, &size); sbuf_bcat(sb, &structsize, sizeof(structsize)); PROC_LOCK(p); - kern_proc_filedesc_out(p, sb, -1); + kern_proc_filedesc_out(p, sb, -1, filedesc_flags); sbuf_finish(sb); sbuf_delete(sb); *sizep = size; } else { - structsize = sizeof(struct kinfo_file); + sbuf_start_section(sb, &start_len); + sbuf_bcat(sb, &structsize, sizeof(structsize)); PROC_LOCK(p); - kern_proc_filedesc_out(p, sb, -1); + kern_proc_filedesc_out(p, sb, *sizep - sizeof(structsize), + filedesc_flags); + + sect_len = sbuf_end_section(sb, start_len, 0, 0); + if (sect_len < 0) + return; + sect_sz = sect_len; + + KASSERT(sect_sz <= *sizep, + ("kern_proc_filedesc_out did not respect maxlen; " + "requested %zu, got %zu", *sizep - sizeof(structsize), + sect_sz - sizeof(structsize))); + + for (i = 0; i < *sizep - sect_sz && sb->s_error == 0; i++) + sbuf_putc(sb, 0); } } @@ -1940,24 +1989,30 @@ note_procstat_vmmap(void *arg, struct sb { struct proc *p; size_t size; - int structsize; + int structsize, vmmap_flags; + + if (coredump_pack_vmmapinfo) + vmmap_flags = KERN_VMMAP_PACK_KINFO; + else + vmmap_flags = 0; p = (struct proc *)arg; + structsize = sizeof(struct kinfo_vmentry); if (sb == NULL) { size = 0; sb = sbuf_new(NULL, NULL, 128, SBUF_FIXEDLEN); sbuf_set_drain(sb, sbuf_drain_count, &size); sbuf_bcat(sb, &structsize, sizeof(structsize)); PROC_LOCK(p); - kern_proc_vmmap_out(p, sb); + kern_proc_vmmap_out(p, sb, -1, vmmap_flags); sbuf_finish(sb); sbuf_delete(sb); *sizep = size; } else { - structsize = sizeof(struct kinfo_vmentry); sbuf_bcat(sb, &structsize, sizeof(structsize)); PROC_LOCK(p); - kern_proc_vmmap_out(p, sb); + kern_proc_vmmap_out(p, sb, *sizep - sizeof(structsize), + vmmap_flags); } } Modified: stable/10/sys/kern/kern_descrip.c ============================================================================== --- stable/10/sys/kern/kern_descrip.c Tue Feb 9 22:32:24 2016 (r295453) +++ stable/10/sys/kern/kern_descrip.c Wed Feb 10 00:08:51 2016 (r295454) @@ -49,6 +49,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -3299,6 +3300,7 @@ struct export_fd_buf { struct sbuf *sb; ssize_t remainder; struct kinfo_file kif; + int flags; }; static int @@ -3385,9 +3387,12 @@ export_fd_to_sb(void *data, int type, in kif->kf_type = type; kif->kf_ref_count = refcnt; kif->kf_offset = offset; - /* Pack record size down */ - kif->kf_structsize = offsetof(struct kinfo_file, kf_path) + - strlen(kif->kf_path) + 1; + if ((efbuf->flags & KERN_FILEDESC_PACK_KINFO) != 0) + /* Pack record size down */ + kif->kf_structsize = offsetof(struct kinfo_file, kf_path) + + strlen(kif->kf_path) + 1; + else + kif->kf_structsize = sizeof(*kif); kif->kf_structsize = roundup(kif->kf_structsize, sizeof(uint64_t)); if (efbuf->remainder != -1) { if (efbuf->remainder < kif->kf_structsize) { @@ -3413,7 +3418,8 @@ export_fd_to_sb(void *data, int type, in * Takes a locked proc as argument, and returns with the proc unlocked. */ int -kern_proc_filedesc_out(struct proc *p, struct sbuf *sb, ssize_t maxlen) +kern_proc_filedesc_out(struct proc *p, struct sbuf *sb, ssize_t maxlen, + int flags) { struct file *fp; struct filedesc *fdp; @@ -3448,6 +3454,7 @@ kern_proc_filedesc_out(struct proc *p, efbuf->fdp = NULL; efbuf->sb = sb; efbuf->remainder = maxlen; + efbuf->flags = flags; if (tracevp != NULL) export_fd_to_sb(tracevp, KF_TYPE_VNODE, KF_FD_TYPE_TRACE, FREAD | FWRITE, -1, -1, NULL, efbuf); @@ -3597,7 +3604,8 @@ sysctl_kern_proc_filedesc(SYSCTL_HANDLER return (error); } maxlen = req->oldptr != NULL ? req->oldlen : -1; - error = kern_proc_filedesc_out(p, &sb, maxlen); + error = kern_proc_filedesc_out(p, &sb, maxlen, + KERN_FILEDESC_PACK_KINFO); error2 = sbuf_finish(&sb); sbuf_delete(&sb); return (error != 0 ? error : error2); @@ -3635,6 +3643,24 @@ vntype_to_kinfo(int vtype) return (KF_VTYPE_UNKNOWN); } +static inline void +vn_fill_junk(struct kinfo_file *kif) +{ + size_t len, olen; + + /* + * Simulate vn_fullpath returning changing values for a given + * vp during e.g. coredump. + */ + len = (arc4random() % (sizeof(kif->kf_path) - 2)) + 1; + olen = strlen(kif->kf_path); + if (len < olen) + strcpy(&kif->kf_path[len - 1], "$"); + else + for (; olen < len; olen++) + strcpy(&kif->kf_path[olen], "A"); +} + static int fill_vnode_info(struct vnode *vp, struct kinfo_file *kif) { @@ -3654,6 +3680,10 @@ fill_vnode_info(struct vnode *vp, struct if (freepath != NULL) free(freepath, M_TEMP); + KFAIL_POINT_CODE(DEBUG_FP, fill_kinfo_vnode__random_path, + vn_fill_junk(kif); + ); + /* * Retrieve vnode attributes. */ Modified: stable/10/sys/kern/kern_exec.c ============================================================================== --- stable/10/sys/kern/kern_exec.c Tue Feb 9 22:32:24 2016 (r295453) +++ stable/10/sys/kern/kern_exec.c Wed Feb 10 00:08:51 2016 (r295454) @@ -102,6 +102,16 @@ SDT_PROBE_DEFINE1(proc, kernel, , exec__ MALLOC_DEFINE(M_PARGS, "proc-args", "Process arguments"); +int coredump_pack_fileinfo = 1; +SYSCTL_INT(_kern, OID_AUTO, coredump_pack_fileinfo, CTLFLAG_RWTUN, + &coredump_pack_fileinfo, 0, + "Enable file path packing in 'procstat -f' coredump notes"); + +int coredump_pack_vmmapinfo = 1; +SYSCTL_INT(_kern, OID_AUTO, coredump_pack_vmmapinfo, CTLFLAG_RWTUN, + &coredump_pack_vmmapinfo, 0, + "Enable file path packing in 'procstat -v' coredump notes"); + static int sysctl_kern_ps_strings(SYSCTL_HANDLER_ARGS); static int sysctl_kern_usrstack(SYSCTL_HANDLER_ARGS); static int sysctl_kern_stackprot(SYSCTL_HANDLER_ARGS); Modified: stable/10/sys/kern/kern_proc.c ============================================================================== --- stable/10/sys/kern/kern_proc.c Tue Feb 9 22:32:24 2016 (r295453) +++ stable/10/sys/kern/kern_proc.c Wed Feb 10 00:08:51 2016 (r295454) @@ -2228,7 +2228,7 @@ next:; * Must be called with the process locked and will return unlocked. */ int -kern_proc_vmmap_out(struct proc *p, struct sbuf *sb) +kern_proc_vmmap_out(struct proc *p, struct sbuf *sb, ssize_t maxlen, int flags) { vm_map_entry_t entry, tmp_entry; struct vattr va; @@ -2252,7 +2252,7 @@ kern_proc_vmmap_out(struct proc *p, stru PRELE(p); return (ESRCH); } - kve = malloc(sizeof(*kve), M_TEMP, M_WAITOK); + kve = malloc(sizeof(*kve), M_TEMP, M_WAITOK | M_ZERO); error = 0; map = &vm->vm_map; @@ -2387,10 +2387,23 @@ kern_proc_vmmap_out(struct proc *p, stru free(freepath, M_TEMP); /* Pack record size down */ - kve->kve_structsize = offsetof(struct kinfo_vmentry, kve_path) + - strlen(kve->kve_path) + 1; + if ((flags & KERN_VMMAP_PACK_KINFO) != 0) + kve->kve_structsize = + offsetof(struct kinfo_vmentry, kve_path) + + strlen(kve->kve_path) + 1; + else + kve->kve_structsize = sizeof(*kve); kve->kve_structsize = roundup(kve->kve_structsize, sizeof(uint64_t)); + + /* Halt filling and truncate rather than exceeding maxlen */ + if (maxlen != -1 && maxlen < kve->kve_structsize) { + error = 0; + vm_map_lock_read(map); + break; + } else if (maxlen != -1) + maxlen -= kve->kve_structsize; + if (sbuf_bcat(sb, kve, kve->kve_structsize) != 0) error = ENOMEM; vm_map_lock_read(map); @@ -2422,7 +2435,7 @@ sysctl_kern_proc_vmmap(SYSCTL_HANDLER_AR sbuf_delete(&sb); return (error); } - error = kern_proc_vmmap_out(p, &sb); + error = kern_proc_vmmap_out(p, &sb, -1, KERN_VMMAP_PACK_KINFO); error2 = sbuf_finish(&sb); sbuf_delete(&sb); return (error != 0 ? error : error2); Modified: stable/10/sys/sys/exec.h ============================================================================== --- stable/10/sys/sys/exec.h Tue Feb 9 22:32:24 2016 (r295453) +++ stable/10/sys/sys/exec.h Wed Feb 10 00:08:51 2016 (r295454) @@ -83,6 +83,9 @@ void exec_unmap_first_page(struct image_ int exec_register(const struct execsw *); int exec_unregister(const struct execsw *); +extern int coredump_pack_fileinfo; +extern int coredump_pack_vmmapinfo; + /* * note: name##_mod cannot be const storage because the * linker_file_sysinit() function modifies _file in the Modified: stable/10/sys/sys/user.h ============================================================================== --- stable/10/sys/sys/user.h Tue Feb 9 22:32:24 2016 (r295453) +++ stable/10/sys/sys/user.h Wed Feb 10 00:08:51 2016 (r295454) @@ -536,6 +536,11 @@ struct kinfo_sigtramp { #define KERN_PROC_NOTHREADS 0x1 #define KERN_PROC_MASK32 0x2 +/* Flags for kern_proc_filedesc_out. */ +#define KERN_FILEDESC_PACK_KINFO 0x00000001U + +/* Flags for kern_proc_vmmap_out. */ +#define KERN_VMMAP_PACK_KINFO 0x00000001U struct sbuf; /* @@ -547,9 +552,11 @@ struct sbuf; * to be locked on enter. On return the process is unlocked. */ -int kern_proc_filedesc_out(struct proc *p, struct sbuf *sb, ssize_t maxlen); +int kern_proc_filedesc_out(struct proc *p, struct sbuf *sb, ssize_t maxlen, + int flags); int kern_proc_out(struct proc *p, struct sbuf *sb, int flags); -int kern_proc_vmmap_out(struct proc *p, struct sbuf *sb); +int kern_proc_vmmap_out(struct proc *p, struct sbuf *sb, ssize_t maxlen, + int flags); int vntype_to_kinfo(int vtype); #endif /* !_KERNEL */ From owner-svn-src-stable@freebsd.org Wed Feb 10 07:16:19 2016 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 59D82AA3DA9; Wed, 10 Feb 2016 07:16:19 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 24F3A1471; Wed, 10 Feb 2016 07:16:19 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1A7GInI044537; Wed, 10 Feb 2016 07:16:18 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1A7GHeg044528; Wed, 10 Feb 2016 07:16:17 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201602100716.u1A7GHeg044528@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Wed, 10 Feb 2016 07:16:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r295461 - in stable/10/etc: . defaults mtree ntp periodic/daily rc.d X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Feb 2016 07:16:19 -0000 Author: cy Date: Wed Feb 10 07:16:17 2016 New Revision: 295461 URL: https://svnweb.freebsd.org/changeset/base/295461 Log: MFC r289421, r293037, r294773, and r294884. ntp leap-leapseconds support. r289421: Add default leap-seconds file. This should help ntp networks get the leap second date correct Updates to the file can be obtained from ftp://time.nist.gov/pub/ or ftp://tycho.usno.navy.mil/pub/ntp/. r293037: Update leap-seconds to latest. This will satisfy the ntpd leap-second version check. r294773: Add support for automatic leap-second file updates. The working copy of leapfile resides in /var/dbntpd.leap-seconds.list. /etc/ntp/leap-seconds (periodically updated from ftp://time.nist.gov/pub/ or ftp://tycho.usno.navy.mil/pub/ntp/) contains the master copy should automatic leapfile updates be disabled (default). Automatic leapfile updates are fetched from $ntp_leapfile_sources, defaulting to https://www.ietf.org/timezones/data/leap-seconds.list, within $ntp_leapfile_expiry_days (default 30 days) from leap-seconds file expiry. Automatic updates can be enabled by setting $daily_ntpd_leapfile_enable="YES" in periodic.conf. To avoid congesting the ntp leapfile source the automatic update randomized by default but can be disabled through daily_ntpd_avoid_congestion="NO" in periodic.conf. r294884: Allow specification of fetch options for ntp leap-seconds fetch. Approved by: re (gjb) Added: stable/10/etc/ntp/ - copied from r289421, head/etc/ntp/ stable/10/etc/periodic/daily/480.leapfile-ntpd - copied unchanged from r294773, head/etc/periodic/daily/480.leapfile-ntpd Modified: stable/10/etc/Makefile stable/10/etc/defaults/periodic.conf stable/10/etc/defaults/rc.conf stable/10/etc/mtree/BSD.var.dist stable/10/etc/ntp.conf stable/10/etc/ntp/leap-seconds stable/10/etc/periodic/daily/Makefile stable/10/etc/rc.d/ntpd Directory Properties: stable/10/ (props changed) Modified: stable/10/etc/Makefile ============================================================================== --- stable/10/etc/Makefile Wed Feb 10 04:56:38 2016 (r295460) +++ stable/10/etc/Makefile Wed Feb 10 07:16:17 2016 (r295461) @@ -244,6 +244,9 @@ distribution: ${_+_}cd ${.CURDIR}/defaults; ${MAKE} install ${_+_}cd ${.CURDIR}/devd; ${MAKE} install ${_+_}cd ${.CURDIR}/gss; ${MAKE} install +.if ${MK_NTP} != "no" + ${_+_}cd ${.CURDIR}/ntp; ${MAKE} install +.endif ${_+_}cd ${.CURDIR}/periodic; ${MAKE} install .if ${MK_PKGBOOTSTRAP} != "no" ${_+_}cd ${.CURDIR}/pkg; ${MAKE} install Modified: stable/10/etc/defaults/periodic.conf ============================================================================== --- stable/10/etc/defaults/periodic.conf Wed Feb 10 04:56:38 2016 (r295460) +++ stable/10/etc/defaults/periodic.conf Wed Feb 10 07:16:17 2016 (r295461) @@ -138,6 +138,11 @@ daily_status_mail_rejects_enable="YES" daily_status_mail_rejects_logs=3 # How many logs to check daily_status_mail_rejects_shorten="NO" # Shorten output +# 480.leapfile-ntpd +daily_ntpd_leapfile_enable="NO" # Fetch NTP leapfile +daily_ntpd_avoid_congestion="YES" # Avoid congesting + # leapfile sources + # 480.status-ntpd daily_status_ntpd_enable="NO" # Check NTP status Modified: stable/10/etc/defaults/rc.conf ============================================================================== --- stable/10/etc/defaults/rc.conf Wed Feb 10 04:56:38 2016 (r295460) +++ stable/10/etc/defaults/rc.conf Wed Feb 10 07:16:17 2016 (r295461) @@ -366,6 +366,17 @@ ntpd_config="/etc/ntp.conf" # ntpd(8) co ntpd_sync_on_start="NO" # Sync time on ntpd startup, even if offset is high ntpd_flags="-p /var/run/ntpd.pid -f /var/db/ntpd.drift" # Flags to ntpd (if enabled). +ntp_src_leapfile="/etc/ntp/leap-seconds" + # Initial source for ntpd leapfile +ntp_db_leapfile="/var/db/ntpd.leap-seconds.list" + # Working copy (updated weekly) leapfile +ntp_leapfile_sources="https://www.ietf.org/timezones/data/leap-seconds.list" + # Source from which to fetch leapfile +ntp_leapfile_fetch_opts="-mq" # Options to use for ntp leapfile fetch, + # e.g. --no-verify-peer +ntp_leapfile_expiry_days=30 # Check for new leapfile 30 days prior to + # expiry. +ntp_leapfile_fetch_verbose="NO" # Be verbose during NTP leapfile fetch # Network Information Services (NIS) options: All need rpcbind_enable="YES" ### nis_client_enable="NO" # We're an NIS client (or NO). Modified: stable/10/etc/mtree/BSD.var.dist ============================================================================== --- stable/10/etc/mtree/BSD.var.dist Wed Feb 10 04:56:38 2016 (r295460) +++ stable/10/etc/mtree/BSD.var.dist Wed Feb 10 07:16:17 2016 (r295461) @@ -46,6 +46,8 @@ .. ipf mode=0700 .. + ntp mode=0700 + .. pkg .. ports Modified: stable/10/etc/ntp.conf ============================================================================== --- stable/10/etc/ntp.conf Wed Feb 10 04:56:38 2016 (r295460) +++ stable/10/etc/ntp.conf Wed Feb 10 07:16:17 2016 (r295461) @@ -77,3 +77,10 @@ restrict 127.127.1.0 # #server 127.127.1.0 #fudge 127.127.1.0 stratum 10 + +# See http://support.ntp.org/bin/view/Support/ConfiguringNTP#Section_6.14. +# for documentation regarding leapfile. Updates to the file can be obtained +# from ftp://time.nist.gov/pub/ or ftp://tycho.usno.navy.mil/pub/ntp/. +# Use either leapfile in /etc/ntp or weekly updated leapfile in /var/db. +#leapfile "/etc/ntp/leap-seconds" +leapfile "/var/db/ntpd.leap-seconds.list" Modified: stable/10/etc/ntp/leap-seconds ============================================================================== --- head/etc/ntp/leap-seconds Fri Oct 16 14:04:16 2015 (r289421) +++ stable/10/etc/ntp/leap-seconds Wed Feb 10 07:16:17 2016 (r295461) @@ -1,119 +1,221 @@ # # $FreeBSD$ # -# ATOMIC TIME. -# The Coordinated Universal Time (UTC) is the reference time scale derived -# from The "Temps Atomique International" (TAI) calculated by the Bureau -# International des Poids et Mesures (BIPM) using a worldwide network of atomic -# clocks. UTC differs from TAI by an integer number of seconds; it is the basis -# of all activities in the world. -# -# -# ASTRONOMICAL TIME (UT1) is the time scale based on the rate of rotation of the earth. -# It is now mainly derived from Very Long Baseline Interferometry (VLBI). The various -# irregular fluctuations progressively detected in the rotation rate of the Earth lead -# in 1972 to the replacement of UT1 by UTC as the reference time scale. -# -# -# LEAP SECOND -# Atomic clocks are more stable than the rate of the earth rotatiob since the later -# undergoes a full range of geophysical perturbations at various time scales (lunisolar -# and core-mantle torques,atmospheric and oceanic effetcs, ...) -# Leap seconds are needed to keep the two time scales in agreement, i.e. UT1-UTC smaller -# than 0.9 second. So, when necessary a "leap second" is introduced in UTC. -# Since the adoption of this system in 1972 it has been necessary to add 26 seconds to UTC, -# firstly due to the initial choice of the value of the second (1/86400 mean solar day of -# the year 1820) and secondly to the general slowing down of the Earth's rotation. It is -# theorically possible to have a negative leap second (a second removed from UTC), but so far, -# all leap seconds have been positive (a second has been added to UTC). Based on what we know about the earth's rotation, -# it is unlikely that we will ever have a negative leap second. -# -# -# HISTORY -# The first leap second was added on June 30, 1972. Until 2000, it was necessary in average to add a leap second at a rate -# of 1 to 2 years. Since 2000, due to the fact that the earth rate of rotation is accelerating, leap seconds are introduced -# with an average frequency of 3 to 4 years. -# -# -# RESPONSABILITY OF THE DECISION TO INTRODUCE A LEAP SECOND IN UTC -# The decision to introduce a leap second in UTC is the responsibility of the Earth Orientation Center of -# the International Earth Rotation and reference System Service (IERS). This center is located at Paris -# Observatory. According to international agreements, leap second date have to occur at fixed date : -# first preference is given to the end of December and June, and second preference at the end of March -# and September. Since the system was introduced in 1972, only dates in June and December were used. -# -# Questions or comments to: -# Daniel Gambis, daniel.gambis@obspm.fr -# Christian Bizouard: christian.bizouard@obspm.fr -# Earth orientation Center of the IERS -# Paris Observatory, France -# -# -# -# VALIDITY OF THE FILE -# It is important to express the validity of the file. These next two dates are -# given in units of seconds since 1900.0. -# -# 1) Last update of the file. -# -# Updated through IERS Bulletin C (ftp://hpiers.obspm.fr/iers/bul/bulc/bulletinc.dat) -# -# The following line shows the last update of this file in NTP timestamp: -# -#$ 3645216000 -# -# 2) Expiration date of the file given on a semi-annual basis: last June or last December -# -# File expires on 28 December 2015 -# -# Expire date in NTP timestamp: -# -#@ 3660249600 -# -# -# LIST OF LEAP SECONDS -# NTP timestamp (X parameter) is the number of seconds since 1900.0 -# -# MJD: The Modified Julian Day number. MJD = X/86400 + 15020 -# -# DTAI: The difference DTAI= TAI-UTC in units of seconds -# It is the quantity to add to UTC to get the time in TAI -# -# Day Month Year : epoch in clear -# -#NTP Time DTAI Day Month Year -# -2272060800 10 # 1 Jan 1972 -2287785600 11 # 1 Jul 1972 -2303683200 12 # 1 Jan 1973 -2335219200 13 # 1 Jan 1974 -2366755200 14 # 1 Jan 1975 -2398291200 15 # 1 Jan 1976 -2429913600 16 # 1 Jan 1977 -2461449600 17 # 1 Jan 1978 -2492985600 18 # 1 Jan 1979 -2524521600 19 # 1 Jan 1980 -2571782400 20 # 1 Jul 1981 -2603318400 21 # 1 Jul 1982 -2634854400 22 # 1 Jul 1983 -2698012800 23 # 1 Jul 1985 -2776982400 24 # 1 Jan 1988 -2840140800 25 # 1 Jan 1990 -2871676800 26 # 1 Jan 1991 -2918937600 27 # 1 Jul 1992 -2950473600 28 # 1 Jul 1993 -2982009600 29 # 1 Jul 1994 -3029443200 30 # 1 Jan 1996 -3076704000 31 # 1 Jul 1997 -3124137600 32 # 1 Jan 1999 -3345062400 33 # 1 Jan 2006 -3439756800 34 # 1 Jan 2009 -3550089600 35 # 1 Jul 2012 -3644697600 36 # 1 Jul 2015 -# -# In order to verify the integrity of this file, a hash code -# has been generated. For more information how to use -# this hash code, please consult the README file under the -# 'sha' repertory. +# In the following text, the symbol '#' introduces +# a comment, which continues from that symbol until +# the end of the line. A plain comment line has a +# whitespace character following the comment indicator. +# There are also special comment lines defined below. +# A special comment will always have a non-whitespace +# character in column 2. +# +# A blank line should be ignored. +# +# The following table shows the corrections that must +# be applied to compute International Atomic Time (TAI) +# from the Coordinated Universal Time (UTC) values that +# are transmitted by almost all time services. +# +# The first column shows an epoch as a number of seconds +# since 1900.0 and the second column shows the number of +# seconds that must be added to UTC to compute TAI for +# any timestamp at or after that epoch. The value on +# each line is valid from the indicated initial instant +# until the epoch given on the next one or indefinitely +# into the future if there is no next line. +# (The comment on each line shows the representation of +# the corresponding initial epoch in the usual +# day-month-year format. The epoch always begins at +# 00:00:00 UTC on the indicated day. See Note 5 below.) +# +# Important notes: +# +# 1. Coordinated Universal Time (UTC) is often referred to +# as Greenwich Mean Time (GMT). The GMT time scale is no +# longer used, and the use of GMT to designate UTC is +# discouraged. +# +# 2. The UTC time scale is realized by many national +# laboratories and timing centers. Each laboratory +# identifies its realization with its name: Thus +# UTC(NIST), UTC(USNO), etc. The differences among +# these different realizations are typically on the +# order of a few nanoseconds (i.e., 0.000 000 00x s) +# and can be ignored for many purposes. These differences +# are tabulated in Circular T, which is published monthly +# by the International Bureau of Weights and Measures +# (BIPM). See www.bipm.fr for more information. +# +# 3. The current defintion of the relationship between UTC +# and TAI dates from 1 January 1972. A number of different +# time scales were in use before than epoch, and it can be +# quite difficult to compute precise timestamps and time +# intervals in those "prehistoric" days. For more information, +# consult: +# +# The Explanatory Supplement to the Astronomical +# Ephemeris. +# or +# Terry Quinn, "The BIPM and the Accurate Measurement +# of Time," Proc. of the IEEE, Vol. 79, pp. 894-905, +# July, 1991. +# +# 4. The insertion of leap seconds into UTC is currently the +# responsibility of the International Earth Rotation Service, +# which is located at the Paris Observatory: +# +# Central Bureau of IERS +# 61, Avenue de l'Observatoire +# 75014 Paris, France. +# +# Leap seconds are announced by the IERS in its Bulletin C +# +# See hpiers.obspm.fr or www.iers.org for more details. +# +# All national laboratories and timing centers use the +# data from the BIPM and the IERS to construct their +# local realizations of UTC. +# +# Although the definition also includes the possibility +# of dropping seconds ("negative" leap seconds), this has +# never been done and is unlikely to be necessary in the +# foreseeable future. +# +# 5. If your system keeps time as the number of seconds since +# some epoch (e.g., NTP timestamps), then the algorithm for +# assigning a UTC time stamp to an event that happens during a positive +# leap second is not well defined. The official name of that leap +# second is 23:59:60, but there is no way of representing that time +# in these systems. +# Many systems of this type effectively stop the system clock for +# one second during the leap second and use a time that is equivalent +# to 23:59:59 UTC twice. For these systems, the corresponding TAI +# timestamp would be obtained by advancing to the next entry in the +# following table when the time equivalent to 23:59:59 UTC +# is used for the second time. Thus the leap second which +# occurred on 30 June 1972 at 23:59:59 UTC would have TAI +# timestamps computed as follows: +# +# ... +# 30 June 1972 23:59:59 (2287785599, first time): TAI= UTC + 10 seconds +# 30 June 1972 23:59:60 (2287785599,second time): TAI= UTC + 11 seconds +# 1 July 1972 00:00:00 (2287785600) TAI= UTC + 11 seconds +# ... +# +# If your system realizes the leap second by repeating 00:00:00 UTC twice +# (this is possible but not usual), then the advance to the next entry +# in the table must occur the second time that a time equivlent to +# 00:00:00 UTC is used. Thus, using the same example as above: +# +# ... +# 30 June 1972 23:59:59 (2287785599): TAI= UTC + 10 seconds +# 30 June 1972 23:59:60 (2287785600, first time): TAI= UTC + 10 seconds +# 1 July 1972 00:00:00 (2287785600,second time): TAI= UTC + 11 seconds +# ... +# +# in both cases the use of timestamps based on TAI produces a smooth +# time scale with no discontinuity in the time interval. +# +# This complexity would not be needed for negative leap seconds (if they +# are ever used). The UTC time would skip 23:59:59 and advance from +# 23:59:58 to 00:00:00 in that case. The TAI offset would decrease by +# 1 second at the same instant. This is a much easier situation to deal +# with, since the difficulty of unambiguously representing the epoch +# during the leap second does not arise. +# +# Questions or comments to: +# Jeff Prillaman +# Time Service Department +# US Naval Observatory +# Washington, DC +# jeffrey.prillaman@usno.navy.mil +# +# Last Update of leap second values: 31 Dec 2015 +# +# The following line shows this last update date in NTP timestamp +# format. This is the date on which the most recent change to +# the leap second data was added to the file. This line can +# be identified by the unique pair of characters in the first two +# columns as shown below. +# +#$ 3660508800 +# +# The data in this file will be updated periodically as new leap +# seconds are announced. In addition to being entered on the line +# above, the update time (in NTP format) will be added to the basic +# file name leap-seconds to form the name leap-seconds.. +# In addition, the generic name leap-seconds.list will always point to +# the most recent version of the file. +# +# This update procedure will be performed only when a new leap second +# is announced. +# +# The following entry specifies the expiration date of the data +# in this file in units of seconds since 1900.0. This expiration date +# will be changed at least twice per year whether or not a new leap +# second is announced. These semi-annual changes will be made no +# later than 1 June and 1 December of each year to indicate what +# action (if any) is to be taken on 30 June and 31 December, +# respectively. (These are the customary effective dates for new +# leap seconds.) This expiration date will be identified by a +# unique pair of characters in columns 1 and 2 as shown below. +# In the unlikely event that a leap second is announced with an +# effective date other than 30 June or 31 December, then this +# file will be edited to include that leap second as soon as it is +# announced or at least one month before the effective date +# (whichever is later). +# If an announcement by the IERS specifies that no leap second is +# scheduled, then only the expiration date of the file will +# be advanced to show that the information in the file is still +# current -- the update time stamp, the data and the name of the file +# will not change. +# +# Updated through IERS Bulletin C 50 +# File expires on: 1 Jun 2016 +# +#@ 3673728000 +# +2272060800 10 # 1 Jan 1972 +2287785600 11 # 1 Jul 1972 +2303683200 12 # 1 Jan 1973 +2335219200 13 # 1 Jan 1974 +2366755200 14 # 1 Jan 1975 +2398291200 15 # 1 Jan 1976 +2429913600 16 # 1 Jan 1977 +2461449600 17 # 1 Jan 1978 +2492985600 18 # 1 Jan 1979 +2524521600 19 # 1 Jan 1980 +2571782400 20 # 1 Jul 1981 +2603318400 21 # 1 Jul 1982 +2634854400 22 # 1 Jul 1983 +2698012800 23 # 1 Jul 1985 +2776982400 24 # 1 Jan 1988 +2840140800 25 # 1 Jan 1990 +2871676800 26 # 1 Jan 1991 +2918937600 27 # 1 Jul 1992 +2950473600 28 # 1 Jul 1993 +2982009600 29 # 1 Jul 1994 +3029443200 30 # 1 Jan 1996 +3076704000 31 # 1 Jul 1997 +3124137600 32 # 1 Jan 1999 +3345062400 33 # 1 Jan 2006 +3439756800 34 # 1 Jan 2009 +3550089600 35 # 1 Jul 2012 +3644697600 36 # 1 Jul 2015 +# +# the following special comment contains the +# hash value of the data in this file computed +# use the secure hash algorithm as specified +# by FIPS 180-1. See the files in ~/sha for +# the details of how this hash value is +# computed. Note that the hash computation +# ignores comments and whitespace characters +# in data lines. It includes the NTP values +# of both the last modification time and the +# expiration time of the file, but not the +# white space on those lines. +# the hash line is also ignored in the +# computation. +# +#h 44a44c49 35b22601 a9c7054c 8c56cf57 9b6f6ed5 # -#h 620ba8af 37900668 95ac09ba d77640f9 6fd75493 Copied: stable/10/etc/periodic/daily/480.leapfile-ntpd (from r294773, head/etc/periodic/daily/480.leapfile-ntpd) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/etc/periodic/daily/480.leapfile-ntpd Wed Feb 10 07:16:17 2016 (r295461, copy of r294773, head/etc/periodic/daily/480.leapfile-ntpd) @@ -0,0 +1,28 @@ +#!/bin/sh +# +# $FreeBSD$ +# + +# If there is a global system configuration file, suck it in. +# +if [ -r /etc/defaults/periodic.conf ] +then + . /etc/defaults/periodic.conf + source_periodic_confs +fi + +case "$daily_ntpd_leapfile_enable" in + [Yy][Ee][Ss]) + case "$daily_ntpd_avoid_congestion" in + [Yy][Ee][Ss]) + # Avoid dogpiling + (sleep $(jot -r 1 0 86400); service ntpd fetch) & + ;; + *) + service ntpd fetch + ;; + esac + ;; +esac + +exit $rc Modified: stable/10/etc/periodic/daily/Makefile ============================================================================== --- stable/10/etc/periodic/daily/Makefile Wed Feb 10 04:56:38 2016 (r295460) +++ stable/10/etc/periodic/daily/Makefile Wed Feb 10 07:16:17 2016 (r295461) @@ -34,7 +34,8 @@ FILES+= 130.clean-msgs .endif .if ${MK_NTP} != "no" -FILES+= 480.status-ntpd +FILES+= 480.status-ntpd \ + 480.leapfile-ntpd .endif .if ${MK_PKGTOOLS} != "no" Modified: stable/10/etc/rc.d/ntpd ============================================================================== --- stable/10/etc/rc.d/ntpd Wed Feb 10 04:56:38 2016 (r295460) +++ stable/10/etc/rc.d/ntpd Wed Feb 10 07:16:17 2016 (r295461) @@ -14,6 +14,8 @@ name="ntpd" rcvar="ntpd_enable" command="/usr/sbin/${name}" pidfile="/var/run/${name}.pid" +extra_commands="fetch" +fetch_cmd="ntpd_fetch_leapfile" start_precmd="ntpd_precmd" load_rc_config $name @@ -30,6 +32,10 @@ ntpd_precmd() return 0; fi + if [ ! -f $ntp_db_leapfile ]; then + ntpd_fetch_leapfile + fi + # If running in a chroot cage, ensure that the appropriate files # exist inside the cage, as well as helper symlinks into the cage # from outside. @@ -44,10 +50,71 @@ ntpd_precmd() ( cd /dev ; /bin/pax -rw -pe clockctl "${ntpd_chrootdir}/dev" ) fi ln -fs "${ntpd_chrootdir}/var/db/ntp.drift" /var/db/ntp.drift + ln -fs "${ntpd_chrootdir}${ntp_tmp_leapfile}" ${ntp_tmp_leapfile} # Change run_rc_commands()'s internal copy of $ntpd_flags # rc_flags="-u ntpd:ntpd -i ${ntpd_chrootdir} $rc_flags" } +current_ntp_ts() { + # Seconds between 1900-01-01 and 1970-01-01 + # echo $(((70*365+17)*86400)) + ntp_to_unix=2208988800 + + echo $(($(date -u +%s)+$ntp_to_unix)) +} + +get_ntp_leapfile_ver() { + expr "$(awk '$1 == "#$" { print $2 }' "$1" 2>/dev/null)" : \ + '^\([1-9][0-9]*\)$' \| 0 +} + +get_ntp_leapfile_expiry() { + expr "$(awk '$1 == "#@" { print $2 }' "$1" 2>/dev/null)" : \ + '^\([1-9][0-9]*\)$' \| 0 +} + +ntpd_fetch_leapfile() { + local ntp_tmp_leapfile rc verbose + + if checkyesno ntp_leapfile_fetch_verbose; then + verbose=echo + else + verbose=: + fi + + ntp_tmp_leapfile="/var/run/ntpd.leap-seconds.list" + + ntp_ver_no_src=$(get_ntp_leapfile_ver $ntp_src_leapfile) + ntp_ver_no_db=$(get_ntp_leapfile_ver $ntp_db_leapfile) + $verbose ntp_src_leapfile version is $ntp_ver_no_src + $verbose ntp_db_leapfile version is $ntp_ver_no_db + + if [ "$ntp_ver_no_src" -gt "$ntp_ver_no_db" ]; then + $verbose replacing $ntp_db_leapfile with $ntp_src_leapfile + cp -p $ntp_src_leapfile $ntp_db_leapfile + ntp_ver_no_db=$ntp_ver_no_src + else + $verbose not replacing $ntp_db_leapfile with $ntp_src_leapfile + fi + ntp_leap_expiry=$(get_ntp_leapfile_expiry $ntp_db_leapfile) + ntp_leapfile_expiry_seconds=$((ntp_leapfile_expiry_days*86400)) + ntp_leap_fetch_date=$((ntp_leap_expiry-ntp_leapfile_expiry_seconds)) + if [ $(current_ntp_ts) -ge $ntp_leap_fetch_date ]; then + $verbose Within ntp leapfile expiry limit, initiating fetch + for url in $ntp_leapfile_sources ; do + $verbose fetching $url + fetch $ntp_leapfile_fetch_opts -o $ntp_tmp_leapfile $url && break + done + ntp_ver_no_tmp=$(get_ntp_leapfile_ver $ntp_tmp_leapfile) + if [ "$ntp_ver_no_tmp" -gt "$ntp_ver_no_db" ]; then + $verbose using $url as $ntp_db_leapfile + mv $ntp_tmp_leapfile $ntp_db_leapfile + else + $verbose using existing $ntp_db_leapfile + fi + fi +} + run_rc_command "$1" From owner-svn-src-stable@freebsd.org Wed Feb 10 07:16:24 2016 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5EB4AAA3DD2; Wed, 10 Feb 2016 07:16:24 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 24510147B; Wed, 10 Feb 2016 07:16:24 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1A7GNe6044594; Wed, 10 Feb 2016 07:16:23 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1A7GMIG044585; Wed, 10 Feb 2016 07:16:22 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201602100716.u1A7GMIG044585@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Wed, 10 Feb 2016 07:16:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r295462 - in stable/9/etc: . defaults mtree ntp periodic/daily rc.d X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Feb 2016 07:16:24 -0000 Author: cy Date: Wed Feb 10 07:16:22 2016 New Revision: 295462 URL: https://svnweb.freebsd.org/changeset/base/295462 Log: MFC r289421, r293037, r294773, and r294884. ntp leap-leapseconds support. r289421: Add default leap-seconds file. This should help ntp networks get the leap second date correct Updates to the file can be obtained from ftp://time.nist.gov/pub/ or ftp://tycho.usno.navy.mil/pub/ntp/. r293037: Update leap-seconds to latest. This will satisfy the ntpd leap-second version check. r294773: Add support for automatic leap-second file updates. The working copy of leapfile resides in /var/dbntpd.leap-seconds.list. /etc/ntp/leap-seconds (periodically updated from ftp://time.nist.gov/pub/ or ftp://tycho.usno.navy.mil/pub/ntp/) contains the master copy should automatic leapfile updates be disabled (default). Automatic leapfile updates are fetched from $ntp_leapfile_sources, defaulting to https://www.ietf.org/timezones/data/leap-seconds.list, within $ntp_leapfile_expiry_days (default 30 days) from leap-seconds file expiry. Automatic updates can be enabled by setting $daily_ntpd_leapfile_enable="YES" in periodic.conf. To avoid congesting the ntp leapfile source the automatic update randomized by default but can be disabled through daily_ntpd_avoid_congestion="NO" in periodic.conf. r294884: Allow specification of fetch options for ntp leap-seconds fetch. Added: stable/9/etc/ntp/ - copied from r289421, head/etc/ntp/ stable/9/etc/periodic/daily/480.leapfile-ntpd - copied unchanged from r294773, head/etc/periodic/daily/480.leapfile-ntpd Modified: stable/9/etc/Makefile stable/9/etc/defaults/periodic.conf stable/9/etc/defaults/rc.conf stable/9/etc/mtree/BSD.var.dist stable/9/etc/ntp.conf stable/9/etc/ntp/leap-seconds stable/9/etc/periodic/daily/Makefile stable/9/etc/rc.d/ntpd Directory Properties: stable/9/ (props changed) stable/9/etc/ (props changed) stable/9/etc/mtree/ (props changed) stable/9/etc/rc.d/ (props changed) Modified: stable/9/etc/Makefile ============================================================================== --- stable/9/etc/Makefile Wed Feb 10 07:16:17 2016 (r295461) +++ stable/9/etc/Makefile Wed Feb 10 07:16:22 2016 (r295462) @@ -240,6 +240,9 @@ distribution: ${_+_}cd ${.CURDIR}/defaults; ${MAKE} install ${_+_}cd ${.CURDIR}/devd; ${MAKE} install ${_+_}cd ${.CURDIR}/gss; ${MAKE} install +.if ${MK_NTP} != "no" + ${_+_}cd ${.CURDIR}/ntp; ${MAKE} install +.endif ${_+_}cd ${.CURDIR}/periodic; ${MAKE} install .if ${MK_PKGBOOTSTRAP} != "no" ${_+_}cd ${.CURDIR}/pkg; ${MAKE} install Modified: stable/9/etc/defaults/periodic.conf ============================================================================== --- stable/9/etc/defaults/periodic.conf Wed Feb 10 07:16:17 2016 (r295461) +++ stable/9/etc/defaults/periodic.conf Wed Feb 10 07:16:22 2016 (r295462) @@ -142,6 +142,10 @@ daily_status_mail_rejects_shorten="NO" daily_status_named_enable="YES" daily_status_named_usedns="YES" # DNS lookups are ok +# 480.leapfile-ntpd +daily_ntpd_leapfile_enable="NO" # Fetch NTP leapfile +daily_ntpd_avoid_congestion="YES" # Avoid congesting + # 480.status-ntpd daily_status_ntpd_enable="NO" # Check NTP status Modified: stable/9/etc/defaults/rc.conf ============================================================================== --- stable/9/etc/defaults/rc.conf Wed Feb 10 07:16:17 2016 (r295461) +++ stable/9/etc/defaults/rc.conf Wed Feb 10 07:16:22 2016 (r295462) @@ -364,6 +364,17 @@ ntpd_config="/etc/ntp.conf" # ntpd(8) co ntpd_sync_on_start="NO" # Sync time on ntpd startup, even if offset is high ntpd_flags="-p /var/run/ntpd.pid -f /var/db/ntpd.drift" # Flags to ntpd (if enabled). +ntp_src_leapfile="/etc/ntp/leap-seconds" + # Initial source for ntpd leapfile +ntp_db_leapfile="/var/db/ntpd.leap-seconds.list" + # Working copy (updated weekly) leapfile +ntp_leapfile_sources="https://www.ietf.org/timezones/data/leap-seconds.list" + # Source from which to fetch leapfile +ntp_leapfile_fetch_opts="-mq" # Options to use for ntp leapfile fetch, + # e.g. --no-verify-peer +ntp_leapfile_expiry_days=30 # Check for new leapfile 30 days prior to + # expiry. +ntp_leapfile_fetch_verbose="NO" # Be verbose during NTP leapfile fetch # Network Information Services (NIS) options: All need rpcbind_enable="YES" ### nis_client_enable="NO" # We're an NIS client (or NO). Modified: stable/9/etc/mtree/BSD.var.dist ============================================================================== --- stable/9/etc/mtree/BSD.var.dist Wed Feb 10 07:16:17 2016 (r295461) +++ stable/9/etc/mtree/BSD.var.dist Wed Feb 10 07:16:22 2016 (r295462) @@ -44,6 +44,8 @@ .. ipf mode=0700 .. + ntp mode=0700 + .. pkg .. ports Modified: stable/9/etc/ntp.conf ============================================================================== --- stable/9/etc/ntp.conf Wed Feb 10 07:16:17 2016 (r295461) +++ stable/9/etc/ntp.conf Wed Feb 10 07:16:22 2016 (r295462) @@ -77,3 +77,10 @@ restrict 127.127.1.0 # #server 127.127.1.0 #fudge 127.127.1.0 stratum 10 + +# See http://support.ntp.org/bin/view/Support/ConfiguringNTP#Section_6.14. +# for documentation regarding leapfile. Updates to the file can be obtained +# from ftp://time.nist.gov/pub/ or ftp://tycho.usno.navy.mil/pub/ntp/. +# Use either leapfile in /etc/ntp or weekly updated leapfile in /var/db. +#leapfile "/etc/ntp/leap-seconds" +leapfile "/var/db/ntpd.leap-seconds.list" Modified: stable/9/etc/ntp/leap-seconds ============================================================================== --- head/etc/ntp/leap-seconds Fri Oct 16 14:04:16 2015 (r289421) +++ stable/9/etc/ntp/leap-seconds Wed Feb 10 07:16:22 2016 (r295462) @@ -1,119 +1,221 @@ # # $FreeBSD$ # -# ATOMIC TIME. -# The Coordinated Universal Time (UTC) is the reference time scale derived -# from The "Temps Atomique International" (TAI) calculated by the Bureau -# International des Poids et Mesures (BIPM) using a worldwide network of atomic -# clocks. UTC differs from TAI by an integer number of seconds; it is the basis -# of all activities in the world. -# -# -# ASTRONOMICAL TIME (UT1) is the time scale based on the rate of rotation of the earth. -# It is now mainly derived from Very Long Baseline Interferometry (VLBI). The various -# irregular fluctuations progressively detected in the rotation rate of the Earth lead -# in 1972 to the replacement of UT1 by UTC as the reference time scale. -# -# -# LEAP SECOND -# Atomic clocks are more stable than the rate of the earth rotatiob since the later -# undergoes a full range of geophysical perturbations at various time scales (lunisolar -# and core-mantle torques,atmospheric and oceanic effetcs, ...) -# Leap seconds are needed to keep the two time scales in agreement, i.e. UT1-UTC smaller -# than 0.9 second. So, when necessary a "leap second" is introduced in UTC. -# Since the adoption of this system in 1972 it has been necessary to add 26 seconds to UTC, -# firstly due to the initial choice of the value of the second (1/86400 mean solar day of -# the year 1820) and secondly to the general slowing down of the Earth's rotation. It is -# theorically possible to have a negative leap second (a second removed from UTC), but so far, -# all leap seconds have been positive (a second has been added to UTC). Based on what we know about the earth's rotation, -# it is unlikely that we will ever have a negative leap second. -# -# -# HISTORY -# The first leap second was added on June 30, 1972. Until 2000, it was necessary in average to add a leap second at a rate -# of 1 to 2 years. Since 2000, due to the fact that the earth rate of rotation is accelerating, leap seconds are introduced -# with an average frequency of 3 to 4 years. -# -# -# RESPONSABILITY OF THE DECISION TO INTRODUCE A LEAP SECOND IN UTC -# The decision to introduce a leap second in UTC is the responsibility of the Earth Orientation Center of -# the International Earth Rotation and reference System Service (IERS). This center is located at Paris -# Observatory. According to international agreements, leap second date have to occur at fixed date : -# first preference is given to the end of December and June, and second preference at the end of March -# and September. Since the system was introduced in 1972, only dates in June and December were used. -# -# Questions or comments to: -# Daniel Gambis, daniel.gambis@obspm.fr -# Christian Bizouard: christian.bizouard@obspm.fr -# Earth orientation Center of the IERS -# Paris Observatory, France -# -# -# -# VALIDITY OF THE FILE -# It is important to express the validity of the file. These next two dates are -# given in units of seconds since 1900.0. -# -# 1) Last update of the file. -# -# Updated through IERS Bulletin C (ftp://hpiers.obspm.fr/iers/bul/bulc/bulletinc.dat) -# -# The following line shows the last update of this file in NTP timestamp: -# -#$ 3645216000 -# -# 2) Expiration date of the file given on a semi-annual basis: last June or last December -# -# File expires on 28 December 2015 -# -# Expire date in NTP timestamp: -# -#@ 3660249600 -# -# -# LIST OF LEAP SECONDS -# NTP timestamp (X parameter) is the number of seconds since 1900.0 -# -# MJD: The Modified Julian Day number. MJD = X/86400 + 15020 -# -# DTAI: The difference DTAI= TAI-UTC in units of seconds -# It is the quantity to add to UTC to get the time in TAI -# -# Day Month Year : epoch in clear -# -#NTP Time DTAI Day Month Year -# -2272060800 10 # 1 Jan 1972 -2287785600 11 # 1 Jul 1972 -2303683200 12 # 1 Jan 1973 -2335219200 13 # 1 Jan 1974 -2366755200 14 # 1 Jan 1975 -2398291200 15 # 1 Jan 1976 -2429913600 16 # 1 Jan 1977 -2461449600 17 # 1 Jan 1978 -2492985600 18 # 1 Jan 1979 -2524521600 19 # 1 Jan 1980 -2571782400 20 # 1 Jul 1981 -2603318400 21 # 1 Jul 1982 -2634854400 22 # 1 Jul 1983 -2698012800 23 # 1 Jul 1985 -2776982400 24 # 1 Jan 1988 -2840140800 25 # 1 Jan 1990 -2871676800 26 # 1 Jan 1991 -2918937600 27 # 1 Jul 1992 -2950473600 28 # 1 Jul 1993 -2982009600 29 # 1 Jul 1994 -3029443200 30 # 1 Jan 1996 -3076704000 31 # 1 Jul 1997 -3124137600 32 # 1 Jan 1999 -3345062400 33 # 1 Jan 2006 -3439756800 34 # 1 Jan 2009 -3550089600 35 # 1 Jul 2012 -3644697600 36 # 1 Jul 2015 -# -# In order to verify the integrity of this file, a hash code -# has been generated. For more information how to use -# this hash code, please consult the README file under the -# 'sha' repertory. +# In the following text, the symbol '#' introduces +# a comment, which continues from that symbol until +# the end of the line. A plain comment line has a +# whitespace character following the comment indicator. +# There are also special comment lines defined below. +# A special comment will always have a non-whitespace +# character in column 2. +# +# A blank line should be ignored. +# +# The following table shows the corrections that must +# be applied to compute International Atomic Time (TAI) +# from the Coordinated Universal Time (UTC) values that +# are transmitted by almost all time services. +# +# The first column shows an epoch as a number of seconds +# since 1900.0 and the second column shows the number of +# seconds that must be added to UTC to compute TAI for +# any timestamp at or after that epoch. The value on +# each line is valid from the indicated initial instant +# until the epoch given on the next one or indefinitely +# into the future if there is no next line. +# (The comment on each line shows the representation of +# the corresponding initial epoch in the usual +# day-month-year format. The epoch always begins at +# 00:00:00 UTC on the indicated day. See Note 5 below.) +# +# Important notes: +# +# 1. Coordinated Universal Time (UTC) is often referred to +# as Greenwich Mean Time (GMT). The GMT time scale is no +# longer used, and the use of GMT to designate UTC is +# discouraged. +# +# 2. The UTC time scale is realized by many national +# laboratories and timing centers. Each laboratory +# identifies its realization with its name: Thus +# UTC(NIST), UTC(USNO), etc. The differences among +# these different realizations are typically on the +# order of a few nanoseconds (i.e., 0.000 000 00x s) +# and can be ignored for many purposes. These differences +# are tabulated in Circular T, which is published monthly +# by the International Bureau of Weights and Measures +# (BIPM). See www.bipm.fr for more information. +# +# 3. The current defintion of the relationship between UTC +# and TAI dates from 1 January 1972. A number of different +# time scales were in use before than epoch, and it can be +# quite difficult to compute precise timestamps and time +# intervals in those "prehistoric" days. For more information, +# consult: +# +# The Explanatory Supplement to the Astronomical +# Ephemeris. +# or +# Terry Quinn, "The BIPM and the Accurate Measurement +# of Time," Proc. of the IEEE, Vol. 79, pp. 894-905, +# July, 1991. +# +# 4. The insertion of leap seconds into UTC is currently the +# responsibility of the International Earth Rotation Service, +# which is located at the Paris Observatory: +# +# Central Bureau of IERS +# 61, Avenue de l'Observatoire +# 75014 Paris, France. +# +# Leap seconds are announced by the IERS in its Bulletin C +# +# See hpiers.obspm.fr or www.iers.org for more details. +# +# All national laboratories and timing centers use the +# data from the BIPM and the IERS to construct their +# local realizations of UTC. +# +# Although the definition also includes the possibility +# of dropping seconds ("negative" leap seconds), this has +# never been done and is unlikely to be necessary in the +# foreseeable future. +# +# 5. If your system keeps time as the number of seconds since +# some epoch (e.g., NTP timestamps), then the algorithm for +# assigning a UTC time stamp to an event that happens during a positive +# leap second is not well defined. The official name of that leap +# second is 23:59:60, but there is no way of representing that time +# in these systems. +# Many systems of this type effectively stop the system clock for +# one second during the leap second and use a time that is equivalent +# to 23:59:59 UTC twice. For these systems, the corresponding TAI +# timestamp would be obtained by advancing to the next entry in the +# following table when the time equivalent to 23:59:59 UTC +# is used for the second time. Thus the leap second which +# occurred on 30 June 1972 at 23:59:59 UTC would have TAI +# timestamps computed as follows: +# +# ... +# 30 June 1972 23:59:59 (2287785599, first time): TAI= UTC + 10 seconds +# 30 June 1972 23:59:60 (2287785599,second time): TAI= UTC + 11 seconds +# 1 July 1972 00:00:00 (2287785600) TAI= UTC + 11 seconds +# ... +# +# If your system realizes the leap second by repeating 00:00:00 UTC twice +# (this is possible but not usual), then the advance to the next entry +# in the table must occur the second time that a time equivlent to +# 00:00:00 UTC is used. Thus, using the same example as above: +# +# ... +# 30 June 1972 23:59:59 (2287785599): TAI= UTC + 10 seconds +# 30 June 1972 23:59:60 (2287785600, first time): TAI= UTC + 10 seconds +# 1 July 1972 00:00:00 (2287785600,second time): TAI= UTC + 11 seconds +# ... +# +# in both cases the use of timestamps based on TAI produces a smooth +# time scale with no discontinuity in the time interval. +# +# This complexity would not be needed for negative leap seconds (if they +# are ever used). The UTC time would skip 23:59:59 and advance from +# 23:59:58 to 00:00:00 in that case. The TAI offset would decrease by +# 1 second at the same instant. This is a much easier situation to deal +# with, since the difficulty of unambiguously representing the epoch +# during the leap second does not arise. +# +# Questions or comments to: +# Jeff Prillaman +# Time Service Department +# US Naval Observatory +# Washington, DC +# jeffrey.prillaman@usno.navy.mil +# +# Last Update of leap second values: 31 Dec 2015 +# +# The following line shows this last update date in NTP timestamp +# format. This is the date on which the most recent change to +# the leap second data was added to the file. This line can +# be identified by the unique pair of characters in the first two +# columns as shown below. +# +#$ 3660508800 +# +# The data in this file will be updated periodically as new leap +# seconds are announced. In addition to being entered on the line +# above, the update time (in NTP format) will be added to the basic +# file name leap-seconds to form the name leap-seconds.. +# In addition, the generic name leap-seconds.list will always point to +# the most recent version of the file. +# +# This update procedure will be performed only when a new leap second +# is announced. +# +# The following entry specifies the expiration date of the data +# in this file in units of seconds since 1900.0. This expiration date +# will be changed at least twice per year whether or not a new leap +# second is announced. These semi-annual changes will be made no +# later than 1 June and 1 December of each year to indicate what +# action (if any) is to be taken on 30 June and 31 December, +# respectively. (These are the customary effective dates for new +# leap seconds.) This expiration date will be identified by a +# unique pair of characters in columns 1 and 2 as shown below. +# In the unlikely event that a leap second is announced with an +# effective date other than 30 June or 31 December, then this +# file will be edited to include that leap second as soon as it is +# announced or at least one month before the effective date +# (whichever is later). +# If an announcement by the IERS specifies that no leap second is +# scheduled, then only the expiration date of the file will +# be advanced to show that the information in the file is still +# current -- the update time stamp, the data and the name of the file +# will not change. +# +# Updated through IERS Bulletin C 50 +# File expires on: 1 Jun 2016 +# +#@ 3673728000 +# +2272060800 10 # 1 Jan 1972 +2287785600 11 # 1 Jul 1972 +2303683200 12 # 1 Jan 1973 +2335219200 13 # 1 Jan 1974 +2366755200 14 # 1 Jan 1975 +2398291200 15 # 1 Jan 1976 +2429913600 16 # 1 Jan 1977 +2461449600 17 # 1 Jan 1978 +2492985600 18 # 1 Jan 1979 +2524521600 19 # 1 Jan 1980 +2571782400 20 # 1 Jul 1981 +2603318400 21 # 1 Jul 1982 +2634854400 22 # 1 Jul 1983 +2698012800 23 # 1 Jul 1985 +2776982400 24 # 1 Jan 1988 +2840140800 25 # 1 Jan 1990 +2871676800 26 # 1 Jan 1991 +2918937600 27 # 1 Jul 1992 +2950473600 28 # 1 Jul 1993 +2982009600 29 # 1 Jul 1994 +3029443200 30 # 1 Jan 1996 +3076704000 31 # 1 Jul 1997 +3124137600 32 # 1 Jan 1999 +3345062400 33 # 1 Jan 2006 +3439756800 34 # 1 Jan 2009 +3550089600 35 # 1 Jul 2012 +3644697600 36 # 1 Jul 2015 +# +# the following special comment contains the +# hash value of the data in this file computed +# use the secure hash algorithm as specified +# by FIPS 180-1. See the files in ~/sha for +# the details of how this hash value is +# computed. Note that the hash computation +# ignores comments and whitespace characters +# in data lines. It includes the NTP values +# of both the last modification time and the +# expiration time of the file, but not the +# white space on those lines. +# the hash line is also ignored in the +# computation. +# +#h 44a44c49 35b22601 a9c7054c 8c56cf57 9b6f6ed5 # -#h 620ba8af 37900668 95ac09ba d77640f9 6fd75493 Copied: stable/9/etc/periodic/daily/480.leapfile-ntpd (from r294773, head/etc/periodic/daily/480.leapfile-ntpd) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/etc/periodic/daily/480.leapfile-ntpd Wed Feb 10 07:16:22 2016 (r295462, copy of r294773, head/etc/periodic/daily/480.leapfile-ntpd) @@ -0,0 +1,28 @@ +#!/bin/sh +# +# $FreeBSD$ +# + +# If there is a global system configuration file, suck it in. +# +if [ -r /etc/defaults/periodic.conf ] +then + . /etc/defaults/periodic.conf + source_periodic_confs +fi + +case "$daily_ntpd_leapfile_enable" in + [Yy][Ee][Ss]) + case "$daily_ntpd_avoid_congestion" in + [Yy][Ee][Ss]) + # Avoid dogpiling + (sleep $(jot -r 1 0 86400); service ntpd fetch) & + ;; + *) + service ntpd fetch + ;; + esac + ;; +esac + +exit $rc Modified: stable/9/etc/periodic/daily/Makefile ============================================================================== --- stable/9/etc/periodic/daily/Makefile Wed Feb 10 07:16:17 2016 (r295461) +++ stable/9/etc/periodic/daily/Makefile Wed Feb 10 07:16:22 2016 (r295462) @@ -40,7 +40,8 @@ FILES+= 130.clean-msgs .endif .if ${MK_NTP} != "no" -FILES+= 480.status-ntpd +FILES+= 480.status-ntpd \ + 480.leapfile-ntpd .endif .if ${MK_PKGTOOLS} != "no" Modified: stable/9/etc/rc.d/ntpd ============================================================================== --- stable/9/etc/rc.d/ntpd Wed Feb 10 07:16:17 2016 (r295461) +++ stable/9/etc/rc.d/ntpd Wed Feb 10 07:16:22 2016 (r295462) @@ -14,6 +14,8 @@ name="ntpd" rcvar="ntpd_enable" command="/usr/sbin/${name}" pidfile="/var/run/${name}.pid" +extra_commands="fetch" +fetch_cmd="ntpd_fetch_leapfile" start_precmd="ntpd_precmd" load_rc_config $name @@ -30,6 +32,10 @@ ntpd_precmd() return 0; fi + if [ ! -f $ntp_db_leapfile ]; then + ntpd_fetch_leapfile + fi + # If running in a chroot cage, ensure that the appropriate files # exist inside the cage, as well as helper symlinks into the cage # from outside. @@ -44,10 +50,71 @@ ntpd_precmd() ( cd /dev ; /bin/pax -rw -pe clockctl "${ntpd_chrootdir}/dev" ) fi ln -fs "${ntpd_chrootdir}/var/db/ntp.drift" /var/db/ntp.drift + ln -fs "${ntpd_chrootdir}${ntp_tmp_leapfile}" ${ntp_tmp_leapfile} # Change run_rc_commands()'s internal copy of $ntpd_flags # rc_flags="-u ntpd:ntpd -i ${ntpd_chrootdir} $rc_flags" } +current_ntp_ts() { + # Seconds between 1900-01-01 and 1970-01-01 + # echo $(((70*365+17)*86400)) + ntp_to_unix=2208988800 + + echo $(($(date -u +%s)+$ntp_to_unix)) +} + +get_ntp_leapfile_ver() { + expr "$(awk '$1 == "#$" { print $2 }' "$1" 2>/dev/null)" : \ + '^\([1-9][0-9]*\)$' \| 0 +} + +get_ntp_leapfile_expiry() { + expr "$(awk '$1 == "#@" { print $2 }' "$1" 2>/dev/null)" : \ + '^\([1-9][0-9]*\)$' \| 0 +} + +ntpd_fetch_leapfile() { + local ntp_tmp_leapfile rc verbose + + if checkyesno ntp_leapfile_fetch_verbose; then + verbose=echo + else + verbose=: + fi + + ntp_tmp_leapfile="/var/run/ntpd.leap-seconds.list" + + ntp_ver_no_src=$(get_ntp_leapfile_ver $ntp_src_leapfile) + ntp_ver_no_db=$(get_ntp_leapfile_ver $ntp_db_leapfile) + $verbose ntp_src_leapfile version is $ntp_ver_no_src + $verbose ntp_db_leapfile version is $ntp_ver_no_db + + if [ "$ntp_ver_no_src" -gt "$ntp_ver_no_db" ]; then + $verbose replacing $ntp_db_leapfile with $ntp_src_leapfile + cp -p $ntp_src_leapfile $ntp_db_leapfile + ntp_ver_no_db=$ntp_ver_no_src + else + $verbose not replacing $ntp_db_leapfile with $ntp_src_leapfile + fi + ntp_leap_expiry=$(get_ntp_leapfile_expiry $ntp_db_leapfile) + ntp_leapfile_expiry_seconds=$((ntp_leapfile_expiry_days*86400)) + ntp_leap_fetch_date=$((ntp_leap_expiry-ntp_leapfile_expiry_seconds)) + if [ $(current_ntp_ts) -ge $ntp_leap_fetch_date ]; then + $verbose Within ntp leapfile expiry limit, initiating fetch + for url in $ntp_leapfile_sources ; do + $verbose fetching $url + fetch $ntp_leapfile_fetch_opts -o $ntp_tmp_leapfile $url && break + done + ntp_ver_no_tmp=$(get_ntp_leapfile_ver $ntp_tmp_leapfile) + if [ "$ntp_ver_no_tmp" -gt "$ntp_ver_no_db" ]; then + $verbose using $url as $ntp_db_leapfile + mv $ntp_tmp_leapfile $ntp_db_leapfile + else + $verbose using existing $ntp_db_leapfile + fi + fi +} + run_rc_command "$1" From owner-svn-src-stable@freebsd.org Wed Feb 10 17:49:24 2016 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3F2B0AA322D; Wed, 10 Feb 2016 17:49:24 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 18DBC1C07; Wed, 10 Feb 2016 17:49:24 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1AHnN8b030558; Wed, 10 Feb 2016 17:49:23 GMT (envelope-from allanjude@FreeBSD.org) Received: (from allanjude@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1AHnM19030552; Wed, 10 Feb 2016 17:49:22 GMT (envelope-from allanjude@FreeBSD.org) Message-Id: <201602101749.u1AHnM19030552@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: allanjude set sender to allanjude@FreeBSD.org using -f From: Allan Jude Date: Wed, 10 Feb 2016 17:49:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r295475 - in stable/10/sys/boot: efi/loader i386/loader userboot/userboot zfs X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Feb 2016 17:49:24 -0000 Author: allanjude Date: Wed Feb 10 17:49:22 2016 New Revision: 295475 URL: https://svnweb.freebsd.org/changeset/base/295475 Log: Catch the EFI loader up to the latest ZFS Boot Environment Menu features MFC: r294072 Move init_zfs_bootenv to sys/boot/zfs/zfs.c instead of having a copy in each loader MFC: r294073 Connect the ZFS boot environment menu to the UEFI loader MFC: r295357 Do not set vfs.root.mountfrom unnecessarily when initializing ZFS BE menu Approved by: re (marius) Relnotes: yes Sponsored by: ScaleEngine Inc. Modified: stable/10/sys/boot/efi/loader/main.c stable/10/sys/boot/i386/loader/main.c stable/10/sys/boot/userboot/userboot/main.c stable/10/sys/boot/zfs/libzfs.h stable/10/sys/boot/zfs/zfs.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/boot/efi/loader/main.c ============================================================================== --- stable/10/sys/boot/efi/loader/main.c Wed Feb 10 16:49:20 2016 (r295474) +++ stable/10/sys/boot/efi/loader/main.c Wed Feb 10 17:49:22 2016 (r295475) @@ -198,6 +198,7 @@ main(int argc, CHAR16 *argv[]) efi_setcurrdev, env_nounset); env_setenv("loaddev", EV_VOLATILE, efi_fmtdev(&currdev), env_noset, env_nounset); + init_zfs_bootenv(zfs_fmtdev(&currdev)); break; } #endif @@ -504,6 +505,38 @@ command_lszfs(int argc, char *argv[]) } return (CMD_OK); } + +COMMAND_SET(reloadbe, "reloadbe", "refresh the list of ZFS Boot Environments", + command_reloadbe); + +static int +command_reloadbe(int argc, char *argv[]) +{ + int err; + char *root; + + if (argc > 2) { + command_errmsg = "wrong number of arguments"; + return (CMD_ERROR); + } + + if (argc == 2) { + err = zfs_bootenv(argv[1]); + } else { + root = getenv("zfs_be_root"); + if (root == NULL) { + return (CMD_OK); + } + err = zfs_bootenv(root); + } + + if (err != 0) { + command_errmsg = strerror(err); + return (CMD_ERROR); + } + + return (CMD_OK); +} #endif #ifdef EFI_ZFS_BOOT Modified: stable/10/sys/boot/i386/loader/main.c ============================================================================== --- stable/10/sys/boot/i386/loader/main.c Wed Feb 10 16:49:20 2016 (r295474) +++ stable/10/sys/boot/i386/loader/main.c Wed Feb 10 17:49:22 2016 (r295475) @@ -69,7 +69,6 @@ static int isa_inb(int port); static void isa_outb(int port, int value); void exit(int code); #ifdef LOADER_ZFS_SUPPORT -static void init_zfs_bootenv(char *currdev); static void i386_zfs_probe(void); #endif @@ -303,34 +302,6 @@ extract_currdev(void) env_nounset); } -#ifdef LOADER_ZFS_SUPPORT -static void -init_zfs_bootenv(char *currdev) -{ - char *beroot; - - if (strlen(currdev) == 0) - return; - if(strncmp(currdev, "zfs:", 4) != 0) - return; - /* Remove the trailing : */ - currdev[strlen(currdev) - 1] = '\0'; - setenv("zfs_be_active", currdev, 1); - setenv("zfs_be_currpage", "1", 1); - /* Do not overwrite if already set */ - setenv("vfs.root.mountfrom", currdev, 0); - /* Forward past zfs: */ - currdev = strchr(currdev, ':'); - currdev++; - /* Remove the last element (current bootenv) */ - beroot = strrchr(currdev, '/'); - if (beroot != NULL) - beroot[0] = '\0'; - beroot = currdev; - setenv("zfs_be_root", beroot, 1); -} -#endif - COMMAND_SET(reboot, "reboot", "reboot the system", command_reboot); static int Modified: stable/10/sys/boot/userboot/userboot/main.c ============================================================================== --- stable/10/sys/boot/userboot/userboot/main.c Wed Feb 10 16:49:20 2016 (r295474) +++ stable/10/sys/boot/userboot/userboot/main.c Wed Feb 10 17:49:22 2016 (r295475) @@ -41,7 +41,6 @@ __FBSDID("$FreeBSD$"); static void userboot_zfs_probe(void); static int userboot_zfs_found; -static void init_zfs_bootenv(char *currdev); #endif #define USERBOOT_VERSION USERBOOT_VERSION_3 @@ -200,32 +199,6 @@ extract_currdev(void) #if defined(USERBOOT_ZFS_SUPPORT) static void -init_zfs_bootenv(char *currdev) -{ - char *beroot; - - if (strlen(currdev) == 0) - return; - if(strncmp(currdev, "zfs:", 4) != 0) - return; - /* Remove the trailing : */ - currdev[strlen(currdev) - 1] = '\0'; - setenv("zfs_be_active", currdev, 1); - setenv("zfs_be_currpage", "1", 1); - /* Do not overwrite if already set */ - setenv("vfs.root.mountfrom", currdev, 0); - /* Forward past zfs: */ - currdev = strchr(currdev, ':'); - currdev++; - /* Remove the last element (current bootenv) */ - beroot = strrchr(currdev, '/'); - if (beroot != NULL) - beroot[0] = '\0'; - beroot = currdev; - setenv("zfs_be_root", beroot, 1); -} - -static void userboot_zfs_probe(void) { char devname[32]; Modified: stable/10/sys/boot/zfs/libzfs.h ============================================================================== --- stable/10/sys/boot/zfs/libzfs.h Wed Feb 10 16:49:20 2016 (r295474) +++ stable/10/sys/boot/zfs/libzfs.h Wed Feb 10 17:49:22 2016 (r295475) @@ -62,6 +62,7 @@ int zfs_parsedev(struct zfs_devdesc *dev char *zfs_fmtdev(void *vdev); int zfs_probe_dev(const char *devname, uint64_t *pool_guid); int zfs_list(const char *name); +void init_zfs_bootenv(char *currdev); int zfs_bootenv(const char *name); int zfs_belist_add(const char *name); int zfs_set_env(void); Modified: stable/10/sys/boot/zfs/zfs.c ============================================================================== --- stable/10/sys/boot/zfs/zfs.c Wed Feb 10 16:49:20 2016 (r295474) +++ stable/10/sys/boot/zfs/zfs.c Wed Feb 10 17:49:22 2016 (r295475) @@ -709,6 +709,30 @@ zfs_list(const char *name) return (zfs_list_dataset(spa, objid)); } +void +init_zfs_bootenv(char *currdev) +{ + char *beroot; + + if (strlen(currdev) == 0) + return; + if(strncmp(currdev, "zfs:", 4) != 0) + return; + /* Remove the trailing : */ + currdev[strlen(currdev) - 1] = '\0'; + setenv("zfs_be_active", currdev, 1); + setenv("zfs_be_currpage", "1", 1); + /* Forward past zfs: */ + currdev = strchr(currdev, ':'); + currdev++; + /* Remove the last element (current bootenv) */ + beroot = strrchr(currdev, '/'); + if (beroot != NULL) + beroot[0] = '\0'; + beroot = currdev; + setenv("zfs_be_root", beroot, 1); +} + int zfs_bootenv(const char *name) { @@ -779,8 +803,15 @@ int zfs_belist_add(const char *name) { + /* Skip special datasets that start with a $ character */ + if (strncmp(name, "$", 1) == 0) { + return (0); + } /* Add the boot environment to the head of the SLIST */ zfs_be = malloc(sizeof(struct zfs_be_entry)); + if (zfs_be == NULL) { + return (ENOMEM); + } zfs_be->name = name; SLIST_INSERT_HEAD(&zfs_be_head, zfs_be, entries); zfs_env_count++; From owner-svn-src-stable@freebsd.org Wed Feb 10 18:29:39 2016 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7BCA4AA47BB; Wed, 10 Feb 2016 18:29:39 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3FBF01ACC; Wed, 10 Feb 2016 18:29:39 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1AITcKs042513; Wed, 10 Feb 2016 18:29:38 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1AITbAC042505; Wed, 10 Feb 2016 18:29:37 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201602101829.u1AITbAC042505@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Wed, 10 Feb 2016 18:29:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r295480 - stable/10/sys/dev/random X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Feb 2016 18:29:39 -0000 Author: jhb Date: Wed Feb 10 18:29:37 2016 New Revision: 295480 URL: https://svnweb.freebsd.org/changeset/base/295480 Log: Adjust initialization of random(9) so it is usable earlier. A few existing SYSINITs expect the in-kernel PRNG (random(9)) to be useable at SI_SUB_RANDOM / SI_ORDER_ANY. However, the random(4) overhaul merged for 10.0 performs all of its initialization at SI_SUB_DRIVERS (since it is tied in with creating the /dev/random character device). This has changed in HEAD where the random initialization is split such that the in-kernel random(9) is initialized at SI_SUB_RANDOM and the supporting bits for userland random(4) (such as /dev/random) are initialized later. However, the changes in HEAD are large and invasive. Instead, this change is being directly committed to stable/10. This change moves most of the random(9)/random(4) initialization to SI_SUB_RANDOM with the exception that the creation of the harvesting kernel process and the /dev/random character device are deferred to new SYSINITs that run at SI_SUB_DRIVERS. This fixes the "random device not loaded; using insecure entropy" message output during boot on some systems. PR: 205800 Reviewed by: markm, so@ Approved by: so Approved by: re (gjb) Tested by: Mark Saad Modified: stable/10/sys/dev/random/live_entropy_sources.c stable/10/sys/dev/random/live_entropy_sources.h stable/10/sys/dev/random/random_adaptors.c stable/10/sys/dev/random/random_adaptors.h stable/10/sys/dev/random/random_harvestq.c stable/10/sys/dev/random/randomdev.c stable/10/sys/dev/random/randomdev_soft.c Modified: stable/10/sys/dev/random/live_entropy_sources.c ============================================================================== --- stable/10/sys/dev/random/live_entropy_sources.c Wed Feb 10 18:23:47 2016 (r295479) +++ stable/10/sys/dev/random/live_entropy_sources.c Wed Feb 10 18:29:37 2016 (r295480) @@ -189,7 +189,7 @@ live_entropy_sources_deinit(void *unused sx_destroy(&les_lock); } -SYSINIT(random_adaptors, SI_SUB_DRIVERS, SI_ORDER_FIRST, +SYSINIT(random_adaptors, SI_SUB_RANDOM, SI_ORDER_FIRST, live_entropy_sources_init, NULL); -SYSUNINIT(random_adaptors, SI_SUB_DRIVERS, SI_ORDER_FIRST, +SYSUNINIT(random_adaptors, SI_SUB_RANDOM, SI_ORDER_FIRST, live_entropy_sources_deinit, NULL); Modified: stable/10/sys/dev/random/live_entropy_sources.h ============================================================================== --- stable/10/sys/dev/random/live_entropy_sources.h Wed Feb 10 18:23:47 2016 (r295479) +++ stable/10/sys/dev/random/live_entropy_sources.h Wed Feb 10 18:29:37 2016 (r295480) @@ -52,7 +52,7 @@ void live_entropy_sources_feed(int, even modevent, \ 0 \ }; \ - DECLARE_MODULE(name, name##_mod, SI_SUB_DRIVERS, \ + DECLARE_MODULE(name, name##_mod, SI_SUB_RANDOM, \ SI_ORDER_SECOND); \ MODULE_VERSION(name, ver); \ MODULE_DEPEND(name, random, 1, 1, 1); Modified: stable/10/sys/dev/random/random_adaptors.c ============================================================================== --- stable/10/sys/dev/random/random_adaptors.c Wed Feb 10 18:23:47 2016 (r295479) +++ stable/10/sys/dev/random/random_adaptors.c Wed Feb 10 18:29:37 2016 (r295480) @@ -233,9 +233,9 @@ random_adaptors_init(void *unused) SYSCTL_NODE(_kern, OID_AUTO, random, CTLFLAG_RW, 0, "Random Number Generator"); -SYSINIT(random_adaptors, SI_SUB_DRIVERS, SI_ORDER_FIRST, random_adaptors_init, +SYSINIT(random_adaptors, SI_SUB_RANDOM, SI_ORDER_FIRST, random_adaptors_init, NULL); -SYSUNINIT(random_adaptors, SI_SUB_DRIVERS, SI_ORDER_FIRST, +SYSUNINIT(random_adaptors, SI_SUB_RANDOM, SI_ORDER_FIRST, random_adaptors_deinit, NULL); static void Modified: stable/10/sys/dev/random/random_adaptors.h ============================================================================== --- stable/10/sys/dev/random/random_adaptors.h Wed Feb 10 18:23:47 2016 (r295479) +++ stable/10/sys/dev/random/random_adaptors.h Wed Feb 10 18:29:37 2016 (r295480) @@ -47,7 +47,7 @@ extern struct random_adaptor *random_ada /* * random_adaptor's should be registered prior to - * random module (SI_SUB_DRIVERS/SI_ORDER_MIDDLE) + * random module (SI_SUB_RANDOM/SI_ORDER_MIDDLE) */ #define RANDOM_ADAPTOR_MODULE(name, modevent, ver) \ static moduledata_t name##_mod = { \ @@ -55,7 +55,7 @@ extern struct random_adaptor *random_ada modevent, \ 0 \ }; \ - DECLARE_MODULE(name, name##_mod, SI_SUB_DRIVERS, \ + DECLARE_MODULE(name, name##_mod, SI_SUB_RANDOM, \ SI_ORDER_SECOND); \ MODULE_VERSION(name, ver); \ MODULE_DEPEND(name, random, 1, 1, 1); Modified: stable/10/sys/dev/random/random_harvestq.c ============================================================================== --- stable/10/sys/dev/random/random_harvestq.c Wed Feb 10 18:23:47 2016 (r295479) +++ stable/10/sys/dev/random/random_harvestq.c Wed Feb 10 18:29:37 2016 (r295480) @@ -81,6 +81,8 @@ int random_kthread_control = 0; static struct proc *random_kthread_proc; +static event_proc_f random_cb; + #ifdef RANDOM_RWFILE static const char *entropy_files[] = { "/entropy", @@ -219,7 +221,7 @@ random_kthread(void *arg) void random_harvestq_init(event_proc_f cb) { - int error, i; + int i; struct harvest *np; /* Initialise the harvest fifos */ @@ -238,13 +240,26 @@ random_harvestq_init(event_proc_f cb) mtx_init(&harvest_mtx, "entropy harvest mutex", NULL, MTX_SPIN); + random_cb = cb; +} + +static void +random_harvestq_start_kproc(void *arg __unused) +{ + int error; + + if (random_cb == NULL) + return; + /* Start the hash/reseed thread */ - error = kproc_create(random_kthread, cb, + error = kproc_create(random_kthread, random_cb, &random_kthread_proc, RFHIGHPID, 0, "rand_harvestq"); /* RANDOM_CSPRNG_NAME */ if (error != 0) panic("Cannot create entropy maintenance thread."); } +SYSINIT(random_kthread, SI_SUB_DRIVERS, SI_ORDER_ANY, + random_harvestq_start_kproc, NULL); void random_harvestq_deinit(void) @@ -265,6 +280,17 @@ random_harvestq_deinit(void) } harvestfifo.count = 0; + /* + * Command the hash/reseed thread to end and wait for it to finish + */ + mtx_lock_spin(&harvest_mtx); + if (random_kthread_proc != NULL) { + random_kthread_control = -1; + msleep_spin((void *)&random_kthread_control, &harvest_mtx, + "term", 0); + } + mtx_unlock_spin(&harvest_mtx); + mtx_destroy(&harvest_mtx); } Modified: stable/10/sys/dev/random/randomdev.c ============================================================================== --- stable/10/sys/dev/random/randomdev.c Wed Feb 10 18:23:47 2016 (r295479) +++ stable/10/sys/dev/random/randomdev.c Wed Feb 10 18:29:37 2016 (r295480) @@ -175,15 +175,24 @@ random_initialize(void *p, struct random printf("random: <%s> initialized\n", s->ident); + /* mark random(4) as initialized, to avoid being called again */ + random_inited = 1; +} + +static void +random_makedev(void *arg __unused) +{ + + if (random_adaptor == NULL) + return; + /* Use an appropriately evil mode for those who are concerned * with daemons */ random_dev = make_dev_credf(MAKEDEV_ETERNAL_KLD, &random_cdevsw, RANDOM_MINOR, NULL, UID_ROOT, GID_WHEEL, 0666, "random"); make_dev_alias(random_dev, "urandom"); /* compatibility */ - - /* mark random(4) as initialized, to avoid being called again */ - random_inited = 1; } +SYSINIT(random_makedev, SI_SUB_DRIVERS, SI_ORDER_ANY, random_makedev, NULL); /* ARGSUSED */ static int @@ -229,5 +238,11 @@ random_modevent(module_t mod __unused, i return (error); } -DEV_MODULE(random, random_modevent, NULL); +static moduledata_t random_mod = { + "random", + random_modevent, + NULL +}; + +DECLARE_MODULE(random, random_mod, SI_SUB_RANDOM, SI_ORDER_MIDDLE); MODULE_VERSION(random, 1); Modified: stable/10/sys/dev/random/randomdev_soft.c ============================================================================== --- stable/10/sys/dev/random/randomdev_soft.c Wed Feb 10 18:23:47 2016 (r295479) +++ stable/10/sys/dev/random/randomdev_soft.c Wed Feb 10 18:29:37 2016 (r295480) @@ -182,12 +182,6 @@ randomdev_deinit(void) /* Deregister the randomness harvesting routine */ randomdev_deinit_harvester(); - /* - * Command the hash/reseed thread to end and wait for it to finish - */ - random_kthread_control = -1; - tsleep((void *)&random_kthread_control, 0, "term", 0); - #if defined(RANDOM_YARROW) random_yarrow_deinit_alg(); #endif From owner-svn-src-stable@freebsd.org Thu Feb 11 00:27:05 2016 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D566DAA3D56; Thu, 11 Feb 2016 00:27:05 +0000 (UTC) (envelope-from sobomax@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 86203E96; Thu, 11 Feb 2016 00:27:05 +0000 (UTC) (envelope-from sobomax@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1B0R4Qi049670; Thu, 11 Feb 2016 00:27:04 GMT (envelope-from sobomax@FreeBSD.org) Received: (from sobomax@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1B0R4HF049669; Thu, 11 Feb 2016 00:27:04 GMT (envelope-from sobomax@FreeBSD.org) Message-Id: <201602110027.u1B0R4HF049669@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sobomax set sender to sobomax@FreeBSD.org using -f From: Maxim Sobolev Date: Thu, 11 Feb 2016 00:27:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r295492 - in stable/10/contrib: libucl/tests unbound X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Feb 2016 00:27:05 -0000 Author: sobomax Date: Thu Feb 11 00:27:04 2016 New Revision: 295492 URL: https://svnweb.freebsd.org/changeset/base/295492 Log: MFC: r295159, kill foreign VCS files. Approved by: re (marius) Deleted: stable/10/contrib/libucl/tests/.gitignore stable/10/contrib/unbound/.gitignore Modified: Directory Properties: stable/10/ (props changed) From owner-svn-src-stable@freebsd.org Thu Feb 11 16:16:12 2016 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5CD8EAA5978; Thu, 11 Feb 2016 16:16:12 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 2526E1A9; Thu, 11 Feb 2016 16:16:12 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1BGGB9e026010; Thu, 11 Feb 2016 16:16:11 GMT (envelope-from sbruno@FreeBSD.org) Received: (from sbruno@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1BGGBXI026007; Thu, 11 Feb 2016 16:16:11 GMT (envelope-from sbruno@FreeBSD.org) Message-Id: <201602111616.u1BGGBXI026007@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sbruno set sender to sbruno@FreeBSD.org using -f From: Sean Bruno Date: Thu, 11 Feb 2016 16:16:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r295524 - in stable/10/sys: conf dev/ixgbe modules/ix modules/ixv X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Feb 2016 16:16:12 -0000 Author: sbruno Date: Thu Feb 11 16:16:10 2016 New Revision: 295524 URL: https://svnweb.freebsd.org/changeset/base/295524 Log: MFC r292674 Update ixgbe(4) to Intel FreeBSD Networking Group version 3.1.13-k. MFC r292571 and r292697 Add support for X552 and X550T. MFC r293334 Fix SFP module insertion post boot. MFC r293338 Fix VF handling of VLANs for Amazon Cloud. Reviewed by: erj smh ngie jeffrey.e.pieper@intel.com Approved by: re (marius) Relnotes: Yes Sponsored by: Intel Corporation and Limelight Networks Differential Revision: https://reviews.freebsd.org/D5117 Added: stable/10/sys/dev/ixgbe/ixgbe_osdep.c (contents, props changed) Deleted: stable/10/sys/dev/ixgbe/LICENSE Modified: stable/10/sys/conf/files stable/10/sys/dev/ixgbe/if_ix.c stable/10/sys/dev/ixgbe/if_ixv.c stable/10/sys/dev/ixgbe/ix_txrx.c stable/10/sys/dev/ixgbe/ixgbe.h stable/10/sys/dev/ixgbe/ixgbe_82598.c stable/10/sys/dev/ixgbe/ixgbe_82599.c stable/10/sys/dev/ixgbe/ixgbe_api.c stable/10/sys/dev/ixgbe/ixgbe_api.h stable/10/sys/dev/ixgbe/ixgbe_common.c stable/10/sys/dev/ixgbe/ixgbe_dcb.c stable/10/sys/dev/ixgbe/ixgbe_osdep.h stable/10/sys/dev/ixgbe/ixgbe_phy.c stable/10/sys/dev/ixgbe/ixgbe_phy.h stable/10/sys/dev/ixgbe/ixgbe_type.h stable/10/sys/dev/ixgbe/ixgbe_vf.c stable/10/sys/dev/ixgbe/ixgbe_x540.c stable/10/sys/dev/ixgbe/ixgbe_x550.c stable/10/sys/dev/ixgbe/ixgbe_x550.h stable/10/sys/modules/ix/Makefile stable/10/sys/modules/ixv/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/conf/files ============================================================================== --- stable/10/sys/conf/files Thu Feb 11 15:27:14 2016 (r295523) +++ stable/10/sys/conf/files Thu Feb 11 16:16:10 2016 (r295524) @@ -1728,6 +1728,8 @@ dev/ixgbe/ix_txrx.c optional ix inet | compile-with "${NORMAL_C} -I$S/dev/ixgbe" dev/ixgbe/ixgbe_phy.c optional ix inet | ixv inet | ixgbe inet \ compile-with "${NORMAL_C} -I$S/dev/ixgbe" +dev/ixgbe/ixgbe_osdep.c optional ix inet | ixv inet | ixgbe inet \ + compile-with "${NORMAL_C} -I$S/dev/ixgbe" dev/ixgbe/ixgbe_api.c optional ix inet | ixv inet | ixgbe inet \ compile-with "${NORMAL_C} -I$S/dev/ixgbe" dev/ixgbe/ixgbe_common.c optional ix inet | ixv inet | ixgbe inet \ Modified: stable/10/sys/dev/ixgbe/if_ix.c ============================================================================== --- stable/10/sys/dev/ixgbe/if_ix.c Thu Feb 11 15:27:14 2016 (r295523) +++ stable/10/sys/dev/ixgbe/if_ix.c Thu Feb 11 16:16:10 2016 (r295524) @@ -46,14 +46,10 @@ #endif /********************************************************************* - * Set this to one to display debug statistics - *********************************************************************/ -int ixgbe_display_debug_stats = 0; - -/********************************************************************* * Driver version *********************************************************************/ -char ixgbe_driver_version[] = "3.1.0"; +char ixgbe_driver_version[] = "3.1.13-k"; + /********************************************************************* * PCI Device ID Table @@ -94,9 +90,11 @@ static ixgbe_vendor_info_t ixgbe_vendor_ {IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_X540T, 0, 0, 0}, {IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_X540T1, 0, 0, 0}, {IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_X550T, 0, 0, 0}, + {IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_X550T1, 0, 0, 0}, {IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_X550EM_X_KR, 0, 0, 0}, {IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_X550EM_X_KX4, 0, 0, 0}, {IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_X550EM_X_10G_T, 0, 0, 0}, + {IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_X550EM_X_SFP, 0, 0, 0}, /* required last entry */ {0, 0, 0, 0, 0} }; @@ -130,7 +128,7 @@ static void ixgbe_media_status(struc static int ixgbe_media_change(struct ifnet *); static void ixgbe_identify_hardware(struct adapter *); static int ixgbe_allocate_pci_resources(struct adapter *); -static void ixgbe_get_slot_info(struct ixgbe_hw *); +static void ixgbe_get_slot_info(struct adapter *); static int ixgbe_allocate_msix(struct adapter *); static int ixgbe_allocate_legacy(struct adapter *); static int ixgbe_setup_msix(struct adapter *); @@ -141,7 +139,6 @@ static void ixgbe_config_gpie(struct ada static void ixgbe_config_dmac(struct adapter *); static void ixgbe_config_delay_values(struct adapter *); static void ixgbe_config_link(struct adapter *); -static void ixgbe_check_eee_support(struct adapter *); static void ixgbe_check_wol_support(struct adapter *); static int ixgbe_setup_low_power_mode(struct adapter *); static void ixgbe_rearm_queues(struct adapter *, u64); @@ -150,6 +147,7 @@ static void ixgbe_initialize_transmi static void ixgbe_initialize_receive_units(struct adapter *); static void ixgbe_enable_rx_drop(struct adapter *); static void ixgbe_disable_rx_drop(struct adapter *); +static void ixgbe_initialize_rss_mapping(struct adapter *); static void ixgbe_enable_intr(struct adapter *); static void ixgbe_disable_intr(struct adapter *); @@ -170,19 +168,24 @@ static void ixgbe_add_hw_stats(struc /* Sysctl handlers */ static void ixgbe_set_sysctl_value(struct adapter *, const char *, - const char *, int *, int); + const char *, int *, int); static int ixgbe_set_flowcntl(SYSCTL_HANDLER_ARGS); static int ixgbe_set_advertise(SYSCTL_HANDLER_ARGS); static int ixgbe_sysctl_thermal_test(SYSCTL_HANDLER_ARGS); static int ixgbe_sysctl_dmac(SYSCTL_HANDLER_ARGS); static int ixgbe_sysctl_phy_temp(SYSCTL_HANDLER_ARGS); static int ixgbe_sysctl_phy_overtemp_occurred(SYSCTL_HANDLER_ARGS); +#ifdef IXGBE_DEBUG +static int ixgbe_sysctl_power_state(SYSCTL_HANDLER_ARGS); +static int ixgbe_sysctl_print_rss_config(SYSCTL_HANDLER_ARGS); +#endif static int ixgbe_sysctl_wol_enable(SYSCTL_HANDLER_ARGS); static int ixgbe_sysctl_wufc(SYSCTL_HANDLER_ARGS); static int ixgbe_sysctl_eee_enable(SYSCTL_HANDLER_ARGS); static int ixgbe_sysctl_eee_negotiated(SYSCTL_HANDLER_ARGS); static int ixgbe_sysctl_eee_rx_lpi_status(SYSCTL_HANDLER_ARGS); static int ixgbe_sysctl_eee_tx_lpi_status(SYSCTL_HANDLER_ARGS); +static int ixgbe_sysctl_eee_tx_lpi_delay(SYSCTL_HANDLER_ARGS); /* Support for pluggable optic modules */ static bool ixgbe_sfp_probe(struct adapter *); @@ -446,9 +449,13 @@ ixgbe_attach(device_t dev) /* Allocate, clear, and link in our adapter structure */ adapter = device_get_softc(dev); - adapter->dev = adapter->osdep.dev = dev; + adapter->dev = dev; hw = &adapter->hw; +#ifdef DEV_NETMAP + adapter->init_locked = ixgbe_init_locked; + adapter->stop_locked = ixgbe_stop; +#endif /* Core Lock Init*/ IXGBE_CORE_LOCK_INIT(adapter, device_get_nameunit(dev)); @@ -531,18 +538,18 @@ ixgbe_attach(device_t dev) adapter->sfp_probe = TRUE; error = 0; } else if (error == IXGBE_ERR_SFP_NOT_SUPPORTED) { - device_printf(dev,"Unsupported SFP+ module detected!\n"); + device_printf(dev, "Unsupported SFP+ module detected!\n"); error = EIO; goto err_late; } else if (error) { - device_printf(dev,"Unable to initialize the shared code\n"); + device_printf(dev, "Unable to initialize the shared code\n"); error = EIO; goto err_late; } /* Make sure we have a good EEPROM before we read from it */ if (ixgbe_validate_eeprom_checksum(&adapter->hw, &csum) < 0) { - device_printf(dev,"The EEPROM Checksum Is Not Valid\n"); + device_printf(dev, "The EEPROM Checksum Is Not Valid\n"); error = EIO; goto err_late; } @@ -552,24 +559,21 @@ ixgbe_attach(device_t dev) case IXGBE_ERR_EEPROM_VERSION: device_printf(dev, "This device is a pre-production adapter/" "LOM. Please be aware there may be issues associated " - "with your hardware.\n If you are experiencing problems " + "with your hardware.\nIf you are experiencing problems " "please contact your Intel or hardware representative " "who provided you with this hardware.\n"); break; case IXGBE_ERR_SFP_NOT_SUPPORTED: - device_printf(dev,"Unsupported SFP+ Module\n"); + device_printf(dev, "Unsupported SFP+ Module\n"); error = EIO; goto err_late; case IXGBE_ERR_SFP_NOT_PRESENT: - device_printf(dev,"No SFP+ Module found\n"); + device_printf(dev, "No SFP+ Module found\n"); /* falls thru */ default: break; } - /* Detect and set physical type */ - ixgbe_setup_optics(adapter); - if ((adapter->msix > 1) && (ixgbe_enable_msix)) error = ixgbe_allocate_msix(adapter); else @@ -591,11 +595,12 @@ ixgbe_attach(device_t dev) ixgbe_unregister_vlan, adapter, EVENTHANDLER_PRI_FIRST); /* Check PCIE slot type/speed/width */ - ixgbe_get_slot_info(hw); - + ixgbe_get_slot_info(adapter); - /* Set an initial default flow control value */ + /* Set an initial default flow control & dmac value */ adapter->fc = ixgbe_fc_full; + adapter->dmac = 0; + adapter->eee_enabled = 0; #ifdef PCI_IOV if ((hw->mac.type != ixgbe_mac_82598EB) && (adapter->msix > 1)) { @@ -621,7 +626,6 @@ ixgbe_attach(device_t dev) /* Check for certain supported features */ ixgbe_check_wol_support(adapter); - ixgbe_check_eee_support(adapter); /* Add sysctls */ ixgbe_add_device_sysctls(adapter); @@ -682,6 +686,7 @@ ixgbe_detach(device_t dev) } #endif /* PCI_IOV */ + ether_ifdetach(adapter->ifp); /* Stop the adapter */ IXGBE_CORE_LOCK(adapter); ixgbe_setup_low_power_mode(adapter); @@ -723,7 +728,6 @@ ixgbe_detach(device_t dev) if (adapter->vlan_detach != NULL) EVENTHANDLER_DEREGISTER(vlan_unconfig, adapter->vlan_detach); - ether_ifdetach(adapter->ifp); callout_drain(&adapter->timer); #ifdef DEV_NETMAP netmap_detach(adapter->ifp); @@ -778,10 +782,6 @@ ixgbe_suspend(device_t dev) error = ixgbe_setup_low_power_mode(adapter); - /* Save state and power down */ - pci_save_state(dev); - pci_set_powerstate(dev, PCI_POWERSTATE_D3); - IXGBE_CORE_UNLOCK(adapter); return (error); @@ -799,9 +799,6 @@ ixgbe_resume(device_t dev) IXGBE_CORE_LOCK(adapter); - pci_set_powerstate(dev, PCI_POWERSTATE_D0); - pci_restore_state(dev); - /* Read & clear WUS register */ wus = IXGBE_READ_REG(hw, IXGBE_WUS); if (wus) @@ -820,7 +817,6 @@ ixgbe_resume(device_t dev) IXGBE_CORE_UNLOCK(adapter); - INIT_DEBUGOUT("ixgbe_resume: end"); return (0); } @@ -864,7 +860,7 @@ ixgbe_ioctl(struct ifnet * ifp, u_long c ifp->if_flags |= IFF_UP; if (!(ifp->if_drv_flags & IFF_DRV_RUNNING)) ixgbe_init(adapter); -#if defined(INET) +#ifdef INET if (!(ifp->if_flags & IFF_NOARP)) arp_ifinit(ifp, ifa); #endif @@ -922,10 +918,21 @@ ixgbe_ioctl(struct ifnet * ifp, u_long c break; case SIOCSIFCAP: { - int mask = ifr->ifr_reqcap ^ ifp->if_capenable; IOCTL_DEBUGOUT("ioctl: SIOCSIFCAP (Set Capabilities)"); - if (mask & IFCAP_HWCSUM) - ifp->if_capenable ^= IFCAP_HWCSUM; + + int mask = ifr->ifr_reqcap ^ ifp->if_capenable; + if (!mask) + break; + + /* HW cannot turn these on/off separately */ + if (mask & (IFCAP_RXCSUM | IFCAP_RXCSUM_IPV6)) { + ifp->if_capenable ^= IFCAP_RXCSUM; + ifp->if_capenable ^= IFCAP_RXCSUM_IPV6; + } + if (mask & IFCAP_TXCSUM) + ifp->if_capenable ^= IFCAP_TXCSUM; + if (mask & IFCAP_TXCSUM_IPV6) + ifp->if_capenable ^= IFCAP_TXCSUM_IPV6; if (mask & IFCAP_TSO4) ifp->if_capenable ^= IFCAP_TSO4; if (mask & IFCAP_TSO6) @@ -938,6 +945,7 @@ ixgbe_ioctl(struct ifnet * ifp, u_long c ifp->if_capenable ^= IFCAP_VLAN_HWFILTER; if (mask & IFCAP_VLAN_HWTSO) ifp->if_capenable ^= IFCAP_VLAN_HWTSO; + if (ifp->if_drv_flags & IFF_DRV_RUNNING) { IXGBE_CORE_LOCK(adapter); ixgbe_init_locked(adapter); @@ -981,6 +989,42 @@ ixgbe_ioctl(struct ifnet * ifp, u_long c return (error); } +/* + * Set the various hardware offload abilities. + * + * This takes the ifnet's if_capenable flags (e.g. set by the user using + * ifconfig) and indicates to the OS via the ifnet's if_hwassist field what + * mbuf offload flags the driver will understand. + */ +static void +ixgbe_set_if_hwassist(struct adapter *adapter) +{ + struct ifnet *ifp = adapter->ifp; + + ifp->if_hwassist = 0; +#if __FreeBSD_version >= 1000000 + if (ifp->if_capenable & IFCAP_TSO4) + ifp->if_hwassist |= CSUM_IP_TSO; + if (ifp->if_capenable & IFCAP_TSO6) + ifp->if_hwassist |= CSUM_IP6_TSO; + if (ifp->if_capenable & IFCAP_TXCSUM) + ifp->if_hwassist |= (CSUM_IP | CSUM_IP_UDP | CSUM_IP_TCP | + CSUM_IP_SCTP); + if (ifp->if_capenable & IFCAP_TXCSUM_IPV6) + ifp->if_hwassist |= (CSUM_IP6_UDP | CSUM_IP6_TCP | + CSUM_IP6_SCTP); +#else + if (ifp->if_capenable & IFCAP_TSO) + ifp->if_hwassist |= CSUM_TSO; + if (ifp->if_capenable & IFCAP_TXCSUM) { + ifp->if_hwassist |= (CSUM_TCP | CSUM_UDP); + struct ixgbe_hw *hw = &adapter->hw; + if (hw->mac.type != ixgbe_mac_82598EB) + ifp->if_hwassist |= CSUM_SCTP; + } +#endif +} + /********************************************************************* * Init entry point * @@ -1003,6 +1047,7 @@ ixgbe_init_locked(struct adapter *adapte struct rx_ring *rxr; u32 txdctl, mhadd; u32 rxdctl, rxctrl; + int err = 0; #ifdef PCI_IOV enum ixgbe_iov_mode mode; #endif @@ -1031,17 +1076,8 @@ ixgbe_init_locked(struct adapter *adapte ixgbe_set_rar(hw, 0, hw->mac.addr, adapter->pool, 1); hw->addr_ctrl.rar_used_count = 1; - /* Set the various hardware offload abilities */ - ifp->if_hwassist = 0; - if (ifp->if_capenable & IFCAP_TSO) - ifp->if_hwassist |= CSUM_TSO; - if (ifp->if_capenable & IFCAP_TXCSUM) { - ifp->if_hwassist |= (CSUM_TCP | CSUM_UDP); -#if __FreeBSD_version >= 800000 - if (hw->mac.type != ixgbe_mac_82598EB) - ifp->if_hwassist |= CSUM_SCTP; -#endif - } + /* Set hardware offload abilities from ifnet flags */ + ixgbe_set_if_hwassist(adapter); /* Prepare transmit descriptors and buffers */ if (ixgbe_setup_transmit_structures(adapter)) { @@ -1059,10 +1095,7 @@ ixgbe_init_locked(struct adapter *adapte /* Setup Multicast table */ ixgbe_set_multi(adapter); - /* - ** Determine the correct mbuf pool - ** for doing jumbo frames - */ + /* Determine the correct mbuf pool, based on frame size */ if (adapter->max_frame_size <= MCLBYTES) adapter->rx_mbuf_sz = MCLBYTES; else @@ -1198,7 +1231,7 @@ ixgbe_init_locked(struct adapter *adapte * need to be kick-started */ if (hw->phy.type == ixgbe_phy_none) { - int err = hw->phy.ops.identify(hw); + err = hw->phy.ops.identify(hw); if (err == IXGBE_ERR_SFP_NOT_SUPPORTED) { device_printf(dev, "Unsupported SFP+ module type was detected.\n"); @@ -1210,7 +1243,11 @@ ixgbe_init_locked(struct adapter *adapte IXGBE_WRITE_REG(hw, IXGBE_EITR(adapter->vector), IXGBE_LINK_ITR); /* Configure Energy Efficient Ethernet for supported devices */ - ixgbe_setup_eee(hw, adapter->eee_enabled); + if (hw->mac.ops.setup_eee) { + err = hw->mac.ops.setup_eee(hw, adapter->eee_enabled); + if (err) + device_printf(dev, "Error setting up EEE: %d\n", err); + } /* Config/Enable Link */ ixgbe_config_link(adapter); @@ -1280,7 +1317,7 @@ ixgbe_config_gpie(struct adapter *adapte /* * Thermal Failure Detection (X540) - * Link Detection (X557) + * Link Detection (X552 SFP+, X552/X557-AT) */ if (hw->mac.type == ixgbe_mac_X540 || hw->device_id == IXGBE_DEV_ID_X550EM_X_SFP || @@ -1588,6 +1625,9 @@ ixgbe_msix_link(void *arg) ++adapter->link_irq; + /* Pause other interrupts */ + IXGBE_WRITE_REG(hw, IXGBE_EIMC, IXGBE_EIMC_OTHER); + /* First get the cause */ reg_eicr = IXGBE_READ_REG(hw, IXGBE_EICS); /* Be sure the queue bits are not cleared */ @@ -1596,8 +1636,10 @@ ixgbe_msix_link(void *arg) IXGBE_WRITE_REG(hw, IXGBE_EICR, reg_eicr); /* Link status change */ - if (reg_eicr & IXGBE_EICR_LSC) + if (reg_eicr & IXGBE_EICR_LSC) { + IXGBE_WRITE_REG(hw, IXGBE_EIMC, IXGBE_EIMC_LSC); taskqueue_enqueue(adapter->tq, &adapter->link_task); + } if (adapter->hw.mac.type != ixgbe_mac_82598EB) { #ifdef IXGBE_FDIR @@ -1611,14 +1653,14 @@ ixgbe_msix_link(void *arg) } else #endif if (reg_eicr & IXGBE_EICR_ECC) { - device_printf(adapter->dev, "\nCRITICAL: ECC ERROR!! " + device_printf(adapter->dev, "CRITICAL: ECC ERROR!! " "Please Reboot!!\n"); IXGBE_WRITE_REG(hw, IXGBE_EICR, IXGBE_EICR_ECC); } /* Check for over temp condition */ if (reg_eicr & IXGBE_EICR_TS) { - device_printf(adapter->dev, "\nCRITICAL: OVER TEMP!! " + device_printf(adapter->dev, "CRITICAL: OVER TEMP!! " "PHY IS SHUT DOWN!!\n"); device_printf(adapter->dev, "System shutdown required!\n"); IXGBE_WRITE_REG(hw, IXGBE_EICR, IXGBE_EICR_TS); @@ -1660,6 +1702,7 @@ ixgbe_msix_link(void *arg) taskqueue_enqueue(adapter->tq, &adapter->phy_task); } + /* Re-enable other interrupts */ IXGBE_WRITE_REG(&adapter->hw, IXGBE_EIMS, IXGBE_EIMS_OTHER); return; } @@ -1753,6 +1796,7 @@ ixgbe_media_status(struct ifnet * ifp, s ** XXX: These need to use the proper media types once ** they're added. */ +#ifndef IFM_ETH_XTYPE if (layer & IXGBE_PHYSICAL_LAYER_10GBASE_KR) switch (adapter->link_speed) { case IXGBE_LINK_SPEED_10GB_FULL: @@ -1778,6 +1822,33 @@ ixgbe_media_status(struct ifnet * ifp, s ifmr->ifm_active |= IFM_1000_CX | IFM_FDX; break; } +#else + if (layer & IXGBE_PHYSICAL_LAYER_10GBASE_KR) + switch (adapter->link_speed) { + case IXGBE_LINK_SPEED_10GB_FULL: + ifmr->ifm_active |= IFM_10G_KR | IFM_FDX; + break; + case IXGBE_LINK_SPEED_2_5GB_FULL: + ifmr->ifm_active |= IFM_2500_KX | IFM_FDX; + break; + case IXGBE_LINK_SPEED_1GB_FULL: + ifmr->ifm_active |= IFM_1000_KX | IFM_FDX; + break; + } + else if (layer & IXGBE_PHYSICAL_LAYER_10GBASE_KX4 + || layer & IXGBE_PHYSICAL_LAYER_1000BASE_KX) + switch (adapter->link_speed) { + case IXGBE_LINK_SPEED_10GB_FULL: + ifmr->ifm_active |= IFM_10G_KX4 | IFM_FDX; + break; + case IXGBE_LINK_SPEED_2_5GB_FULL: + ifmr->ifm_active |= IFM_2500_KX | IFM_FDX; + break; + case IXGBE_LINK_SPEED_1GB_FULL: + ifmr->ifm_active |= IFM_1000_KX | IFM_FDX; + break; + } +#endif /* If nothing is recognized... */ if (IFM_SUBTYPE(ifmr->ifm_active) == 0) @@ -1820,13 +1891,14 @@ ixgbe_media_change(struct ifnet * ifp) return (EINVAL); if (hw->phy.media_type == ixgbe_media_type_backplane) - return (EPERM); + return (ENODEV); /* ** We don't actually need to check against the supported ** media types of the adapter; ifmedia will take care of ** that for us. */ +#ifndef IFM_ETH_XTYPE switch (IFM_SUBTYPE(ifm->ifm_media)) { case IFM_AUTO: case IFM_10G_T: @@ -1852,6 +1924,33 @@ ixgbe_media_change(struct ifnet * ifp) default: goto invalid; } +#else + switch (IFM_SUBTYPE(ifm->ifm_media)) { + case IFM_AUTO: + case IFM_10G_T: + speed |= IXGBE_LINK_SPEED_100_FULL; + case IFM_10G_LRM: + case IFM_10G_KR: + case IFM_10G_LR: + case IFM_10G_KX4: + speed |= IXGBE_LINK_SPEED_1GB_FULL; + case IFM_10G_TWINAX: + speed |= IXGBE_LINK_SPEED_10GB_FULL; + break; + case IFM_1000_T: + speed |= IXGBE_LINK_SPEED_100_FULL; + case IFM_1000_LX: + case IFM_1000_SX: + case IFM_1000_KX: + speed |= IXGBE_LINK_SPEED_1GB_FULL; + break; + case IFM_100_TX: + speed |= IXGBE_LINK_SPEED_100_FULL; + break; + default: + goto invalid; + } +#endif hw->mac.autotry_restart = TRUE; hw->mac.ops.setup_link(hw, speed, TRUE); @@ -2392,7 +2491,7 @@ ixgbe_allocate_msix(struct adapter *adap return (error); } #if __FreeBSD_version >= 800504 - bus_describe_intr(dev, que->res, que->tag, "que %d", i); + bus_describe_intr(dev, que->res, que->tag, "q%d", i); #endif que->msix = vector; adapter->active_queues |= (u64)(1 << que->msix); @@ -2443,8 +2542,8 @@ ixgbe_allocate_msix(struct adapter *adap device_get_nameunit(adapter->dev), cpu_id); #else - taskqueue_start_threads(&que->tq, 1, PI_NET, "%s que", - device_get_nameunit(adapter->dev)); + taskqueue_start_threads(&que->tq, 1, PI_NET, "%s:q%d", + device_get_nameunit(adapter->dev), i); #endif } @@ -2522,7 +2621,7 @@ ixgbe_setup_msix(struct adapter *adapter } /* Figure out a reasonable auto config value */ - queues = (mp_ncpus > (msgs-1)) ? (msgs-1) : mp_ncpus; + queues = (mp_ncpus > (msgs - 1)) ? (msgs - 1) : mp_ncpus; #ifdef RSS /* If we're doing RSS, clamp at the number of RSS buckets */ @@ -2532,6 +2631,9 @@ ixgbe_setup_msix(struct adapter *adapter if (ixgbe_num_queues != 0) queues = ixgbe_num_queues; + /* Set max queues to 8 when autoconfiguring */ + else if ((ixgbe_num_queues == 0) && (queues > 8)) + queues = 8; /* reflect correct sysctl value */ ixgbe_num_queues = queues; @@ -2568,12 +2670,12 @@ msi: rid, adapter->msix_mem); adapter->msix_mem = NULL; } - msgs = 1; - if (pci_alloc_msi(dev, &msgs) == 0) { - device_printf(adapter->dev,"Using an MSI interrupt\n"); + msgs = 1; + if (pci_alloc_msi(dev, &msgs) == 0) { + device_printf(adapter->dev, "Using an MSI interrupt\n"); return (msgs); } - device_printf(adapter->dev,"Using a Legacy interrupt\n"); + device_printf(adapter->dev, "Using a Legacy interrupt\n"); return (0); } @@ -2589,22 +2691,24 @@ ixgbe_allocate_pci_resources(struct adap &rid, RF_ACTIVE); if (!(adapter->pci_mem)) { - device_printf(dev,"Unable to allocate bus resource: memory\n"); + device_printf(dev, "Unable to allocate bus resource: memory\n"); return (ENXIO); } + /* Save bus_space values for READ/WRITE_REG macros */ adapter->osdep.mem_bus_space_tag = rman_get_bustag(adapter->pci_mem); adapter->osdep.mem_bus_space_handle = rman_get_bushandle(adapter->pci_mem); + /* Set hw values for shared code */ adapter->hw.hw_addr = (u8 *) &adapter->osdep.mem_bus_space_handle; + adapter->hw.back = adapter; - /* Legacy defaults */ + /* Default to 1 queue if MSI-X setup fails */ adapter->num_queues = 1; - adapter->hw.back = &adapter->osdep; /* - ** Now setup MSI or MSI/X, should + ** Now setup MSI or MSI-X, should ** return us the number of supported ** vectors. (Will be 1 for MSI) */ @@ -2729,13 +2833,22 @@ ixgbe_setup_interface(device_t dev, stru */ ifp->if_hdrlen = sizeof(struct ether_vlan_header); - ifp->if_capabilities |= IFCAP_HWCSUM | IFCAP_TSO | IFCAP_VLAN_HWCSUM; - ifp->if_capabilities |= IFCAP_JUMBO_MTU; - ifp->if_capabilities |= IFCAP_LRO; - ifp->if_capabilities |= IFCAP_VLAN_HWTAGGING + /* Set capability flags */ + ifp->if_capabilities |= IFCAP_RXCSUM + | IFCAP_TXCSUM + | IFCAP_RXCSUM_IPV6 + | IFCAP_TXCSUM_IPV6 + | IFCAP_TSO4 + | IFCAP_TSO6 + | IFCAP_LRO + | IFCAP_VLAN_HWTAGGING | IFCAP_VLAN_HWTSO + | IFCAP_VLAN_HWCSUM + | IFCAP_JUMBO_MTU | IFCAP_VLAN_MTU | IFCAP_HWSTATS; + + /* Enable the above capabilities by default */ ifp->if_capenable = ifp->if_capabilities; /* @@ -2755,9 +2868,10 @@ ixgbe_setup_interface(device_t dev, stru ifmedia_init(&adapter->media, IFM_IMASK, ixgbe_media_change, ixgbe_media_status); + adapter->phy_layer = ixgbe_get_supported_physical_layer(&adapter->hw); ixgbe_add_media_types(adapter); - /* Autoselect media by default */ + /* Set autoselect media by default */ ifmedia_set(&adapter->media, IFM_ETHER | IFM_AUTO); return (0); @@ -2770,7 +2884,7 @@ ixgbe_add_media_types(struct adapter *ad device_t dev = adapter->dev; int layer; - layer = adapter->phy_layer = ixgbe_get_supported_physical_layer(hw); + layer = adapter->phy_layer; /* Media types with matching FreeBSD media defines */ if (layer & IXGBE_PHYSICAL_LAYER_10GBASE_T) @@ -2784,20 +2898,28 @@ ixgbe_add_media_types(struct adapter *ad layer & IXGBE_PHYSICAL_LAYER_SFP_ACTIVE_DA) ifmedia_add(&adapter->media, IFM_ETHER | IFM_10G_TWINAX, 0, NULL); - if (layer & IXGBE_PHYSICAL_LAYER_10GBASE_LR) + if (layer & IXGBE_PHYSICAL_LAYER_10GBASE_LR) { ifmedia_add(&adapter->media, IFM_ETHER | IFM_10G_LR, 0, NULL); - if (layer & IXGBE_PHYSICAL_LAYER_10GBASE_SR) + if (hw->phy.multispeed_fiber) + ifmedia_add(&adapter->media, IFM_ETHER | IFM_1000_LX, 0, NULL); + } + if (layer & IXGBE_PHYSICAL_LAYER_10GBASE_SR) { ifmedia_add(&adapter->media, IFM_ETHER | IFM_10G_SR, 0, NULL); + if (hw->phy.multispeed_fiber) + ifmedia_add(&adapter->media, IFM_ETHER | IFM_1000_SX, 0, NULL); + } else if (layer & IXGBE_PHYSICAL_LAYER_1000BASE_SX) + ifmedia_add(&adapter->media, IFM_ETHER | IFM_1000_SX, 0, NULL); if (layer & IXGBE_PHYSICAL_LAYER_10GBASE_CX4) ifmedia_add(&adapter->media, IFM_ETHER | IFM_10G_CX4, 0, NULL); - if (layer & IXGBE_PHYSICAL_LAYER_1000BASE_SX) - ifmedia_add(&adapter->media, IFM_ETHER | IFM_1000_SX, 0, NULL); - /* - ** Other (no matching FreeBSD media type): - ** To workaround this, we'll assign these completely - ** inappropriate media types. - */ +#ifdef IFM_ETH_XTYPE + if (layer & IXGBE_PHYSICAL_LAYER_10GBASE_KR) + ifmedia_add(&adapter->media, IFM_ETHER | IFM_10G_KR, 0, NULL); + if (layer & IXGBE_PHYSICAL_LAYER_10GBASE_KX4) + ifmedia_add(&adapter->media, IFM_ETHER | IFM_10G_KX4, 0, NULL); + if (layer & IXGBE_PHYSICAL_LAYER_1000BASE_KX) + ifmedia_add(&adapter->media, IFM_ETHER | IFM_1000_KX, 0, NULL); +#else if (layer & IXGBE_PHYSICAL_LAYER_10GBASE_KR) { device_printf(dev, "Media supported: 10GbaseKR\n"); device_printf(dev, "10GbaseKR mapped to 10GbaseSR\n"); @@ -2813,10 +2935,9 @@ ixgbe_add_media_types(struct adapter *ad device_printf(dev, "1000baseKX mapped to 1000baseCX\n"); ifmedia_add(&adapter->media, IFM_ETHER | IFM_1000_CX, 0, NULL); } - if (layer & IXGBE_PHYSICAL_LAYER_1000BASE_BX) { - /* Someday, someone will care about you... */ +#endif + if (layer & IXGBE_PHYSICAL_LAYER_1000BASE_BX) device_printf(dev, "Media supported: 1000baseBX\n"); - } if (hw->device_id == IXGBE_DEV_ID_82598AT) { ifmedia_add(&adapter->media, @@ -2838,12 +2959,7 @@ ixgbe_config_link(struct adapter *adapte sfp = ixgbe_is_sfp(hw); if (sfp) { - if (hw->phy.multispeed_fiber) { - hw->mac.ops.setup_sfp(hw); - ixgbe_enable_tx_laser(hw); - taskqueue_enqueue(adapter->tq, &adapter->msf_task); - } else - taskqueue_enqueue(adapter->tq, &adapter->mod_task); + taskqueue_enqueue(adapter->tq, &adapter->mod_task); } else { if (hw->mac.ops.check_link) err = ixgbe_check_link(hw, &adapter->link_speed, @@ -2877,7 +2993,6 @@ ixgbe_initialize_transmit_units(struct a struct ixgbe_hw *hw = &adapter->hw; /* Setup the Base and Length of the Tx Descriptor Ring */ - for (int i = 0; i < adapter->num_queues; i++, txr++) { u64 tdba = txr->txdma.dma_paddr; u32 txctrl = 0; @@ -2897,12 +3012,15 @@ ixgbe_initialize_transmit_units(struct a txr->tail = IXGBE_TDT(j); /* Disable Head Writeback */ + /* + * Note: for X550 series devices, these registers are actually + * prefixed with TPH_ isntead of DCA_, but the addresses and + * fields remain the same. + */ switch (hw->mac.type) { case ixgbe_mac_82598EB: txctrl = IXGBE_READ_REG(hw, IXGBE_DCA_TXCTRL(j)); break; - case ixgbe_mac_82599EB: - case ixgbe_mac_X540: default: txctrl = IXGBE_READ_REG(hw, IXGBE_DCA_TXCTRL_82599(j)); break; @@ -2912,8 +3030,6 @@ ixgbe_initialize_transmit_units(struct a case ixgbe_mac_82598EB: IXGBE_WRITE_REG(hw, IXGBE_DCA_TXCTRL(j), txctrl); break; - case ixgbe_mac_82599EB: - case ixgbe_mac_X540: default: IXGBE_WRITE_REG(hw, IXGBE_DCA_TXCTRL_82599(j), txctrl); break; @@ -2946,7 +3062,7 @@ ixgbe_initialize_transmit_units(struct a } static void -ixgbe_initialise_rss_mapping(struct adapter *adapter) +ixgbe_initialize_rss_mapping(struct adapter *adapter) { struct ixgbe_hw *hw = &adapter->hw; u32 reta = 0, mrqc, rss_key[10]; @@ -3081,7 +3197,6 @@ ixgbe_initialize_receive_units(struct ad u32 bufsz, fctrl, srrctl, rxcsum; u32 hlreg; - /* * Make sure receives are disabled while * setting up the descriptor ring @@ -3146,11 +3261,11 @@ ixgbe_initialize_receive_units(struct ad srrctl &= ~IXGBE_SRRCTL_DROP_EN; } - IXGBE_WRITE_REG(hw, IXGBE_SRRCTL(i), srrctl); + IXGBE_WRITE_REG(hw, IXGBE_SRRCTL(j), srrctl); /* Setup the HW Rx Head and Tail Descriptor Pointers */ - IXGBE_WRITE_REG(hw, IXGBE_RDH(i), 0); - IXGBE_WRITE_REG(hw, IXGBE_RDT(i), 0); + IXGBE_WRITE_REG(hw, IXGBE_RDH(j), 0); + IXGBE_WRITE_REG(hw, IXGBE_RDT(j), 0); /* Set the driver rx tail address */ rxr->tail = IXGBE_RDT(rxr->me); @@ -3166,7 +3281,7 @@ ixgbe_initialize_receive_units(struct ad rxcsum = IXGBE_READ_REG(hw, IXGBE_RXCSUM); - ixgbe_initialise_rss_mapping(adapter); + ixgbe_initialize_rss_mapping(adapter); if (adapter->num_queues > 1) { /* RSS and RX IPP Checksum are mutually exclusive */ @@ -3176,6 +3291,7 @@ ixgbe_initialize_receive_units(struct ad if (ifp->if_capenable & IFCAP_RXCSUM) rxcsum |= IXGBE_RXCSUM_PCSD; + /* This is useful for calculating UDP/IP fragment checksums */ if (!(rxcsum & IXGBE_RXCSUM_PCSD)) rxcsum |= IXGBE_RXCSUM_IPPCSE; @@ -3397,9 +3513,10 @@ ixgbe_disable_intr(struct adapter *adapt ** the slot this adapter is plugged into. */ static void -ixgbe_get_slot_info(struct ixgbe_hw *hw) +ixgbe_get_slot_info(struct adapter *adapter) { - device_t dev = ((struct ixgbe_osdep *)hw->back)->dev; + device_t dev = adapter->dev; + struct ixgbe_hw *hw = &adapter->hw; struct ixgbe_mac_info *mac = &hw->mac; u16 link; u32 offset; @@ -3606,12 +3723,12 @@ ixgbe_sfp_probe(struct adapter *adapter) goto out; ret = hw->phy.ops.reset(hw); if (ret == IXGBE_ERR_SFP_NOT_SUPPORTED) { - device_printf(dev,"Unsupported SFP+ module detected!"); - printf(" Reload driver with supported module.\n"); + device_printf(dev, "Unsupported SFP+ module detected!"); + device_printf(dev, "Reload driver with supported module.\n"); adapter->sfp_probe = FALSE; goto out; } else - device_printf(dev,"SFP+ module detected!\n"); + device_printf(dev, "SFP+ module detected!\n"); /* We now have supported optics */ adapter->sfp_probe = FALSE; /* Set the optics type so system reports correctly */ @@ -3630,10 +3747,14 @@ static void ixgbe_handle_link(void *context, int pending) { struct adapter *adapter = context; + struct ixgbe_hw *hw = &adapter->hw; - ixgbe_check_link(&adapter->hw, + ixgbe_check_link(hw, &adapter->link_speed, &adapter->link_up, 0); ixgbe_update_link_status(adapter); + + /* Re-enable link interrupts */ + IXGBE_WRITE_REG(hw, IXGBE_EIMS, IXGBE_EIMS_LSC); } /* @@ -3644,23 +3765,66 @@ ixgbe_handle_mod(void *context, int pend { struct adapter *adapter = context; struct ixgbe_hw *hw = &adapter->hw; + enum ixgbe_phy_type orig_type = hw->phy.type; device_t dev = adapter->dev; u32 err; + IXGBE_CORE_LOCK(adapter); + + /* Check to see if the PHY type changed */ + if (hw->phy.ops.identify) { + hw->phy.type = ixgbe_phy_unknown; + hw->phy.ops.identify(hw); + } + + if (hw->phy.type != orig_type) { + device_printf(dev, "Detected phy_type %d\n", hw->phy.type); + + if (hw->phy.type == ixgbe_phy_none) { + hw->phy.sfp_type = ixgbe_sfp_type_unknown; + goto out; + } + + /* Try to do the initialization that was skipped before */ + if (hw->phy.ops.init) + hw->phy.ops.init(hw); + if (hw->phy.ops.reset) + hw->phy.ops.reset(hw); + } + err = hw->phy.ops.identify_sfp(hw); if (err == IXGBE_ERR_SFP_NOT_SUPPORTED) { device_printf(dev, "Unsupported SFP+ module type was detected.\n"); - return; + goto out; } err = hw->mac.ops.setup_sfp(hw); if (err == IXGBE_ERR_SFP_NOT_SUPPORTED) { device_printf(dev, "Setup failure - unsupported SFP+ module type.\n"); - return; + goto out; } - taskqueue_enqueue(adapter->tq, &adapter->msf_task); + if (hw->phy.multispeed_fiber) + taskqueue_enqueue(adapter->tq, &adapter->msf_task); +out: + /* Update media type */ + switch (hw->mac.ops.get_media_type(hw)) { + case ixgbe_media_type_fiber: + adapter->optics = IFM_10G_SR; + break; + case ixgbe_media_type_copper: + adapter->optics = IFM_10G_TWINAX; + break; + case ixgbe_media_type_cx4: + adapter->optics = IFM_10G_CX4; + break; + default: + adapter->optics = 0; + break; + } + + IXGBE_CORE_UNLOCK(adapter); return; } @@ -3675,13 +3839,10 @@ ixgbe_handle_msf(void *context, int pend struct ixgbe_hw *hw = &adapter->hw; u32 autoneg; bool negotiate; - int err; - err = hw->phy.ops.identify_sfp(hw); - if (!err) { - ixgbe_setup_optics(adapter); - INIT_DEBUGOUT1("ixgbe_sfp_probe: flags: %X\n", adapter->optics); - } + IXGBE_CORE_LOCK(adapter); + /* get_supported_phy_layer will call hw->phy.ops.identify_sfp() */ + adapter->phy_layer = ixgbe_get_supported_physical_layer(hw); autoneg = hw->phy.autoneg_advertised; if ((!autoneg) && (hw->mac.ops.get_link_capabilities)) @@ -3689,8 +3850,10 @@ ixgbe_handle_msf(void *context, int pend if (hw->mac.ops.setup_link) hw->mac.ops.setup_link(hw, autoneg, TRUE); + /* Adjust media types shown in ifconfig */ ifmedia_removeall(&adapter->media); ixgbe_add_media_types(adapter); + IXGBE_CORE_UNLOCK(adapter); return; } @@ -3768,18 +3931,6 @@ ixgbe_config_dmac(struct adapter *adapte } /* - * Checks whether the adapter supports Energy Efficient Ethernet - * or not, based on device ID. - */ -static void -ixgbe_check_eee_support(struct adapter *adapter) -{ - struct ixgbe_hw *hw = &adapter->hw; - - adapter->eee_enabled = !!(hw->mac.ops.setup_eee); -} - -/* * Checks whether the adapter's ports are capable of * Wake On LAN by reading the adapter's NVM. * @@ -3797,8 +3948,8 @@ ixgbe_check_wol_support(struct adapter * ixgbe_get_device_caps(hw, &dev_caps); if ((dev_caps & IXGBE_DEVICE_CAPS_WOL_PORT0_1) || ((dev_caps & IXGBE_DEVICE_CAPS_WOL_PORT0) && - hw->bus.func == 0)) - adapter->wol_support = hw->wol_enabled = 1; + hw->bus.func == 0)) + adapter->wol_support = hw->wol_enabled = 1; /* Save initial wake up filter configuration */ adapter->wufc = IXGBE_READ_REG(hw, IXGBE_WUFC); @@ -4145,14 +4296,24 @@ ixgbe_add_device_sysctls(struct adapter CTLTYPE_INT | CTLFLAG_RW, adapter, 0, ixgbe_sysctl_thermal_test, "I", "Thermal Test"); - /* for X550 devices */ +#ifdef IXGBE_DEBUG + /* testing sysctls (for all devices) */ + SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "power_state", + CTLTYPE_INT | CTLFLAG_RW, adapter, 0, + ixgbe_sysctl_power_state, "I", "PCI Power State"); + + SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "print_rss_config", + CTLTYPE_STRING | CTLFLAG_RD, adapter, 0, + ixgbe_sysctl_print_rss_config, "A", "Prints RSS Configuration"); +#endif + /* for X550 series devices */ if (hw->mac.type >= ixgbe_mac_X550) SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "dmac", CTLTYPE_INT | CTLFLAG_RW, adapter, 0, ixgbe_sysctl_dmac, "I", "DMA Coalesce"); - /* for X550T and X550EM backplane devices */ - if (hw->mac.ops.setup_eee) { *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable@freebsd.org Thu Feb 11 16:35:17 2016 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 761D5AA41B9; Thu, 11 Feb 2016 16:35:17 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 49F37DFD; Thu, 11 Feb 2016 16:35:17 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1BGZGAv031941; Thu, 11 Feb 2016 16:35:16 GMT (envelope-from sbruno@FreeBSD.org) Received: (from sbruno@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1BGZGTs031940; Thu, 11 Feb 2016 16:35:16 GMT (envelope-from sbruno@FreeBSD.org) Message-Id: <201602111635.u1BGZGTs031940@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sbruno set sender to sbruno@FreeBSD.org using -f From: Sean Bruno Date: Thu, 11 Feb 2016 16:35:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r295525 - stable/10/sys/dev/ixgbe X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Feb 2016 16:35:17 -0000 Author: sbruno Date: Thu Feb 11 16:35:16 2016 New Revision: 295525 URL: https://svnweb.freebsd.org/changeset/base/295525 Log: Revert sysctl description change introduced in r295008 to correctly reflect the maximum number of queues supported (8) by this driver. Submitted by: jwd Reviewed by: erj Approved by: re (gjb) Sponsored by: Intel Corporation and Limelight Networks Modified: stable/10/sys/dev/ixgbe/if_ix.c Modified: stable/10/sys/dev/ixgbe/if_ix.c ============================================================================== --- stable/10/sys/dev/ixgbe/if_ix.c Thu Feb 11 16:16:10 2016 (r295524) +++ stable/10/sys/dev/ixgbe/if_ix.c Thu Feb 11 16:35:16 2016 (r295525) @@ -320,7 +320,8 @@ SYSCTL_INT(_hw_ix, OID_AUTO, enable_msix static int ixgbe_num_queues = 0; TUNABLE_INT("hw.ix.num_queues", &ixgbe_num_queues); SYSCTL_INT(_hw_ix, OID_AUTO, num_queues, CTLFLAG_RDTUN, &ixgbe_num_queues, 0, - "Number of queues to configure, 0 indicates autoconfigure"); + "Number of queues to configure up to a mximum of 8," + "0 indicates autoconfigure"); /* ** Number of TX descriptors per ring, From owner-svn-src-stable@freebsd.org Thu Feb 11 16:39:32 2016 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9741AAA4390; Thu, 11 Feb 2016 16:39:32 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 75401FC2; Thu, 11 Feb 2016 16:39:32 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1BGdVT2032130; Thu, 11 Feb 2016 16:39:31 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1BGdVT7032125; Thu, 11 Feb 2016 16:39:31 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201602111639.u1BGdVT7032125@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Thu, 11 Feb 2016 16:39:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r295526 - in stable/10/sys/dev/sfxge: . common X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Feb 2016 16:39:32 -0000 Author: arybchik Date: Thu Feb 11 16:39:30 2016 New Revision: 295526 URL: https://svnweb.freebsd.org/changeset/base/295526 Log: MFC r295467 sfxge: implement SIOCGI2C to read information from phy modules The IOCTL is used by 'ifconfig -v' to show SFP+/QSFP+ information including inventory information and dianostics (temperature, light levels, voltage etc). Reviewed by: gnn,melifaro Approved by: re (gjb) Sponsored by: Solarflare Communications, Inc. Modified: stable/10/sys/dev/sfxge/common/efx.h stable/10/sys/dev/sfxge/common/efx_mcdi.c stable/10/sys/dev/sfxge/common/efx_mcdi.h stable/10/sys/dev/sfxge/common/efx_phy.c stable/10/sys/dev/sfxge/sfxge.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/sfxge/common/efx.h ============================================================================== --- stable/10/sys/dev/sfxge/common/efx.h Thu Feb 11 16:35:16 2016 (r295525) +++ stable/10/sys/dev/sfxge/common/efx.h Thu Feb 11 16:39:30 2016 (r295526) @@ -879,6 +879,14 @@ efx_phy_media_type_get( __in efx_nic_t *enp, __out efx_phy_media_type_t *typep); +extern efx_rc_t +efx_phy_module_get_info( + __in efx_nic_t *enp, + __in uint8_t dev_addr, + __in uint8_t offset, + __in uint8_t len, + __out_bcount(len) uint8_t *data); + #if EFSYS_OPT_PHY_STATS /* START MKCONFIG GENERATED PhyHeaderStatsBlock 30ed56ad501f8e36 */ Modified: stable/10/sys/dev/sfxge/common/efx_mcdi.c ============================================================================== --- stable/10/sys/dev/sfxge/common/efx_mcdi.c Thu Feb 11 16:35:16 2016 (r295525) +++ stable/10/sys/dev/sfxge/common/efx_mcdi.c Thu Feb 11 16:39:30 2016 (r295526) @@ -2078,5 +2078,217 @@ fail1: return (rc); } +/* + * Size of media information page in accordance with SFF-8472 and SFF-8436. + * It is used in MCDI interface as well. + */ +#define EFX_PHY_MEDIA_INFO_PAGE_SIZE 0x80 + +static __checkReturn efx_rc_t +efx_mcdi_get_phy_media_info( + __in efx_nic_t *enp, + __in uint32_t mcdi_page, + __in uint8_t offset, + __in uint8_t len, + __out_bcount(len) uint8_t *data) +{ + efx_mcdi_req_t req; + uint8_t payload[MAX(MC_CMD_GET_PHY_MEDIA_INFO_IN_LEN, + MC_CMD_GET_PHY_MEDIA_INFO_OUT_LEN( + EFX_PHY_MEDIA_INFO_PAGE_SIZE))]; + efx_rc_t rc; + + EFSYS_ASSERT((uint32_t)offset + len <= EFX_PHY_MEDIA_INFO_PAGE_SIZE); + + (void) memset(payload, 0, sizeof (payload)); + req.emr_cmd = MC_CMD_GET_PHY_MEDIA_INFO; + req.emr_in_buf = payload; + req.emr_in_length = MC_CMD_GET_PHY_MEDIA_INFO_IN_LEN; + req.emr_out_buf = payload; + req.emr_out_length = + MC_CMD_GET_PHY_MEDIA_INFO_OUT_LEN(EFX_PHY_MEDIA_INFO_PAGE_SIZE); + + MCDI_IN_SET_DWORD(req, GET_PHY_MEDIA_INFO_IN_PAGE, mcdi_page); + + efx_mcdi_execute(enp, &req); + + if (req.emr_rc != 0) { + rc = req.emr_rc; + goto fail1; + } + + if (req.emr_out_length_used != + MC_CMD_GET_PHY_MEDIA_INFO_OUT_LEN(EFX_PHY_MEDIA_INFO_PAGE_SIZE)) { + rc = EMSGSIZE; + goto fail2; + } + + if (MCDI_OUT_DWORD(req, GET_PHY_MEDIA_INFO_OUT_DATALEN) != + EFX_PHY_MEDIA_INFO_PAGE_SIZE) { + rc = EIO; + goto fail3; + } + + memcpy(data, + MCDI_OUT2(req, uint8_t, GET_PHY_MEDIA_INFO_OUT_DATA) + offset, + len); + + return (0); + +fail3: + EFSYS_PROBE(fail3); +fail2: + EFSYS_PROBE(fail2); +fail1: + EFSYS_PROBE1(fail1, efx_rc_t, rc); + + return (rc); +} + +/* + * 2-wire device address of the base information in accordance with SFF-8472 + * Diagnostic Monitoring Interface for Optical Transceivers section + * 4 Memory Organization. + */ +#define EFX_PHY_MEDIA_INFO_DEV_ADDR_SFP_BASE 0xA0 + +/* + * 2-wire device address of the digital diagnostics monitoring interface + * in accordance with SFF-8472 Diagnostic Monitoring Interface for Optical + * Transceivers section 4 Memory Organization. + */ +#define EFX_PHY_MEDIA_INFO_DEV_ADDR_SFP_DDM 0xA2 + +/* + * Hard wired 2-wire device address for QSFP+ in accordance with SFF-8436 + * QSFP+ 10 Gbs 4X PLUGGABLE TRANSCEIVER section 7.4 Device Addressing and + * Operation. + */ +#define EFX_PHY_MEDIA_INFO_DEV_ADDR_QSFP 0xA0 + + __checkReturn efx_rc_t +efx_mcdi_phy_module_get_info( + __in efx_nic_t *enp, + __in uint8_t dev_addr, + __in uint8_t offset, + __in uint8_t len, + __out_bcount(len) uint8_t *data) +{ + efx_port_t *epp = &(enp->en_port); + efx_rc_t rc; + uint32_t mcdi_lower_page; + uint32_t mcdi_upper_page; + + EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_PROBE); + + /* + * Map device address to MC_CMD_GET_PHY_MEDIA_INFO pages. + * Offset plus length interface allows to access page 0 only. + * I.e. non-zero upper pages are not accessible. + * See SFF-8472 section 4 Memory Organization and SFF-8436 section 7.6 + * QSFP+ Memory Map for details on how information is structured + * and accessible. + */ + switch (epp->ep_fixed_port_type) { + case EFX_PHY_MEDIA_SFP_PLUS: + /* + * In accordance with SFF-8472 Diagnostic Monitoring + * Interface for Optical Transceivers section 4 Memory + * Organization two 2-wire addresses are defined. + */ + switch (dev_addr) { + /* Base information */ + case EFX_PHY_MEDIA_INFO_DEV_ADDR_SFP_BASE: + /* + * MCDI page 0 should be used to access lower + * page 0 (0x00 - 0x7f) at the device address 0xA0. + */ + mcdi_lower_page = 0; + /* + * MCDI page 1 should be used to access upper + * page 0 (0x80 - 0xff) at the device address 0xA0. + */ + mcdi_upper_page = 1; + break; + /* Diagnostics */ + case EFX_PHY_MEDIA_INFO_DEV_ADDR_SFP_DDM: + /* + * MCDI page 2 should be used to access lower + * page 0 (0x00 - 0x7f) at the device address 0xA2. + */ + mcdi_lower_page = 2; + /* + * MCDI page 3 should be used to access upper + * page 0 (0x80 - 0xff) at the device address 0xA2. + */ + mcdi_upper_page = 3; + break; + default: + rc = ENOTSUP; + goto fail1; + } + break; + case EFX_PHY_MEDIA_QSFP_PLUS: + switch (dev_addr) { + case EFX_PHY_MEDIA_INFO_DEV_ADDR_QSFP: + /* + * MCDI page -1 should be used to access lower page 0 + * (0x00 - 0x7f). + */ + mcdi_lower_page = (uint32_t)-1; + /* + * MCDI page 0 should be used to access upper page 0 + * (0x80h - 0xff). + */ + mcdi_upper_page = 0; + break; + default: + rc = ENOTSUP; + goto fail1; + } + break; + default: + rc = ENOTSUP; + goto fail1; + } + + if (offset < EFX_PHY_MEDIA_INFO_PAGE_SIZE) { + uint8_t read_len = + MIN(len, EFX_PHY_MEDIA_INFO_PAGE_SIZE - offset); + + rc = efx_mcdi_get_phy_media_info(enp, + mcdi_lower_page, offset, read_len, data); + if (rc != 0) + goto fail2; + + data += read_len; + len -= read_len; + + offset = 0; + } else { + offset -= EFX_PHY_MEDIA_INFO_PAGE_SIZE; + } + + if (len > 0) { + EFSYS_ASSERT3U(len, <=, EFX_PHY_MEDIA_INFO_PAGE_SIZE); + EFSYS_ASSERT3U(offset, <, EFX_PHY_MEDIA_INFO_PAGE_SIZE); + + rc = efx_mcdi_get_phy_media_info(enp, + mcdi_upper_page, offset, len, data); + if (rc != 0) + goto fail3; + } + + return (0); + +fail3: + EFSYS_PROBE(fail3); +fail2: + EFSYS_PROBE(fail2); +fail1: + EFSYS_PROBE1(fail1, efx_rc_t, rc); + + return (rc); +} #endif /* EFSYS_OPT_MCDI */ Modified: stable/10/sys/dev/sfxge/common/efx_mcdi.h ============================================================================== --- stable/10/sys/dev/sfxge/common/efx_mcdi.h Thu Feb 11 16:35:16 2016 (r295525) +++ stable/10/sys/dev/sfxge/common/efx_mcdi.h Thu Feb 11 16:39:30 2016 (r295526) @@ -228,6 +228,14 @@ efx_mcdi_get_loopback_modes( __in efx_nic_t *enp); #endif /* EFSYS_OPT_LOOPBACK */ +extern __checkReturn efx_rc_t +efx_mcdi_phy_module_get_info( + __in efx_nic_t *enp, + __in uint8_t dev_addr, + __in uint8_t offset, + __in uint8_t len, + __out_bcount(len) uint8_t *data); + #define MCDI_IN(_emr, _type, _ofst) \ ((_type *)((_emr).emr_in_buf + (_ofst))) Modified: stable/10/sys/dev/sfxge/common/efx_phy.c ============================================================================== --- stable/10/sys/dev/sfxge/common/efx_phy.c Thu Feb 11 16:35:16 2016 (r295525) +++ stable/10/sys/dev/sfxge/common/efx_phy.c Thu Feb 11 16:39:30 2016 (r295526) @@ -560,6 +560,38 @@ efx_phy_media_type_get( *typep = epp->ep_fixed_port_type; } + __checkReturn efx_rc_t +efx_phy_module_get_info( + __in efx_nic_t *enp, + __in uint8_t dev_addr, + __in uint8_t offset, + __in uint8_t len, + __out_bcount(len) uint8_t *data) +{ + efx_rc_t rc; + + EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC); + EFSYS_ASSERT(data != NULL); + + if ((uint32_t)offset + len > 0xff) { + rc = EINVAL; + goto fail1; + } + + if ((rc = efx_mcdi_phy_module_get_info(enp, dev_addr, + offset, len, data)) != 0) + goto fail2; + + return (0); + +fail2: + EFSYS_PROBE(fail2); +fail1: + EFSYS_PROBE1(fail1, efx_rc_t, rc); + + return (rc); +} + #if EFSYS_OPT_PHY_STATS #if EFSYS_OPT_NAMES Modified: stable/10/sys/dev/sfxge/sfxge.c ============================================================================== --- stable/10/sys/dev/sfxge/sfxge.c Thu Feb 11 16:35:16 2016 (r295525) +++ stable/10/sys/dev/sfxge/sfxge.c Thu Feb 11 16:39:30 2016 (r295526) @@ -507,6 +507,30 @@ sfxge_if_ioctl(struct ifnet *ifp, unsign case SIOCGIFMEDIA: error = ifmedia_ioctl(ifp, ifr, &sc->media, command); break; +#ifdef SIOCGI2C + case SIOCGI2C: + { + struct ifi2creq i2c; + + error = copyin(ifr->ifr_data, &i2c, sizeof(i2c)); + if (error != 0) + break; + + if (i2c.len > sizeof(i2c.data)) { + error = EINVAL; + break; + } + + SFXGE_ADAPTER_LOCK(sc); + error = efx_phy_module_get_info(sc->enp, i2c.dev_addr, + i2c.offset, i2c.len, + &i2c.data[0]); + SFXGE_ADAPTER_UNLOCK(sc); + if (error == 0) + error = copyout(&i2c, ifr->ifr_data, sizeof(i2c)); + break; + } +#endif case SIOCGPRIVATE_0: error = priv_check(curthread, PRIV_DRIVER); if (error != 0) From owner-svn-src-stable@freebsd.org Thu Feb 11 16:54:25 2016 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B28ABAA4BE2; Thu, 11 Feb 2016 16:54:25 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 74DB91C78; Thu, 11 Feb 2016 16:54:25 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1BGsOCL037843; Thu, 11 Feb 2016 16:54:24 GMT (envelope-from smh@FreeBSD.org) Received: (from smh@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1BGsNaD037836; Thu, 11 Feb 2016 16:54:23 GMT (envelope-from smh@FreeBSD.org) Message-Id: <201602111654.u1BGsNaD037836@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: smh set sender to smh@FreeBSD.org using -f From: Steven Hartland Date: Thu, 11 Feb 2016 16:54:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r295528 - stable/10/sys/dev/ixgbe X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Feb 2016 16:54:25 -0000 Author: smh Date: Thu Feb 11 16:54:23 2016 New Revision: 295528 URL: https://svnweb.freebsd.org/changeset/base/295528 Log: MFC r294734, r295093 & r295094 ixgbe fixes MFC r294734 Fix ixgbe compliation with DBG 1 MFC r295093 Configure ixgbe phy & gbic power MFC r295094 Fix ixgbe flow control autoneg reporting Approved by: re (marius) Sponsored by: Multiplay Modified: stable/10/sys/dev/ixgbe/if_ix.c stable/10/sys/dev/ixgbe/ixgbe_common.c stable/10/sys/dev/ixgbe/ixgbe_osdep.h stable/10/sys/dev/ixgbe/ixgbe_phy.c stable/10/sys/dev/ixgbe/ixgbe_type.h stable/10/sys/dev/ixgbe/ixgbe_x540.c stable/10/sys/dev/ixgbe/ixgbe_x550.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/ixgbe/if_ix.c ============================================================================== --- stable/10/sys/dev/ixgbe/if_ix.c Thu Feb 11 16:43:23 2016 (r295527) +++ stable/10/sys/dev/ixgbe/if_ix.c Thu Feb 11 16:54:23 2016 (r295528) @@ -582,6 +582,12 @@ ixgbe_attach(device_t dev) if (error) goto err_late; + /* Enable the optics for 82599 SFP+ fiber */ + ixgbe_enable_tx_laser(hw); + + /* Enable power to the phy. */ + ixgbe_set_phy_power(hw, TRUE); + /* Setup OS specific network interface */ if (ixgbe_setup_interface(dev, adapter) != 0) goto err_late; @@ -1250,6 +1256,9 @@ ixgbe_init_locked(struct adapter *adapte device_printf(dev, "Error setting up EEE: %d\n", err); } + /* Enable power to the phy. */ + ixgbe_set_phy_power(hw, TRUE); + /* Config/Enable Link */ ixgbe_config_link(adapter); @@ -3970,6 +3979,9 @@ ixgbe_setup_low_power_mode(struct adapte mtx_assert(&adapter->core_mtx, MA_OWNED); + if (!hw->wol_enabled) + ixgbe_set_phy_power(hw, FALSE); + /* Limit power management flow to X550EM baseT */ if (hw->device_id == IXGBE_DEV_ID_X550EM_X_10G_T && hw->phy.ops.enter_lplu) { Modified: stable/10/sys/dev/ixgbe/ixgbe_common.c ============================================================================== --- stable/10/sys/dev/ixgbe/ixgbe_common.c Thu Feb 11 16:43:23 2016 (r295527) +++ stable/10/sys/dev/ixgbe/ixgbe_common.c Thu Feb 11 16:54:23 2016 (r295528) @@ -199,9 +199,12 @@ bool ixgbe_device_supports_autoneg_fc(st break; } - ERROR_REPORT2(IXGBE_ERROR_UNSUPPORTED, + if (!supported) { + ERROR_REPORT2(IXGBE_ERROR_UNSUPPORTED, "Device %x does not support flow control autoneg", hw->device_id); + } + return supported; } Modified: stable/10/sys/dev/ixgbe/ixgbe_osdep.h ============================================================================== --- stable/10/sys/dev/ixgbe/ixgbe_osdep.h Thu Feb 11 16:43:23 2016 (r295527) +++ stable/10/sys/dev/ixgbe/ixgbe_osdep.h Thu Feb 11 16:54:23 2016 (r295528) @@ -57,6 +57,15 @@ #define ASSERT(x) if(!(x)) panic("IXGBE: x") #define EWARN(H, W, S) printf(W) +enum { + IXGBE_ERROR_SOFTWARE, + IXGBE_ERROR_POLLING, + IXGBE_ERROR_INVALID_STATE, + IXGBE_ERROR_UNSUPPORTED, + IXGBE_ERROR_ARGUMENT, + IXGBE_ERROR_CAUTION, +}; + /* The happy-fun DELAY macro is defined in /usr/src/sys/i386/include/clock.h */ #define usec_delay(x) DELAY(x) #define msec_delay(x) DELAY(1000*(x)) @@ -73,9 +82,23 @@ #define DEBUGOUT5(S,A,B,C,D,E) printf(S "\n",A,B,C,D,E) #define DEBUGOUT6(S,A,B,C,D,E,F) printf(S "\n",A,B,C,D,E,F) #define DEBUGOUT7(S,A,B,C,D,E,F,G) printf(S "\n",A,B,C,D,E,F,G) - #define ERROR_REPORT1(S,A) printf(S "\n",A) - #define ERROR_REPORT2(S,A,B) printf(S "\n",A,B) - #define ERROR_REPORT3(S,A,B,C) printf(S "\n",A,B,C) + #define ERROR_REPORT1 ERROR_REPORT + #define ERROR_REPORT2 ERROR_REPORT + #define ERROR_REPORT3 ERROR_REPORT + #define ERROR_REPORT(level, format, arg...) do { \ + switch (level) { \ + case IXGBE_ERROR_SOFTWARE: \ + case IXGBE_ERROR_CAUTION: \ + case IXGBE_ERROR_POLLING: \ + case IXGBE_ERROR_INVALID_STATE: \ + case IXGBE_ERROR_UNSUPPORTED: \ + case IXGBE_ERROR_ARGUMENT: \ + device_printf(ixgbe_dev_from_hw(hw), format, ## arg); \ + break; \ + default: \ + break; \ + } \ + } while (0) #else #define DEBUGOUT(S) #define DEBUGOUT1(S,A) Modified: stable/10/sys/dev/ixgbe/ixgbe_phy.c ============================================================================== --- stable/10/sys/dev/ixgbe/ixgbe_phy.c Thu Feb 11 16:43:23 2016 (r295527) +++ stable/10/sys/dev/ixgbe/ixgbe_phy.c Thu Feb 11 16:54:23 2016 (r295528) @@ -2734,6 +2734,9 @@ s32 ixgbe_set_copper_phy_power(struct ix u32 status; u16 reg; + if (!on && ixgbe_mng_present(hw)) + return 0; + status = hw->phy.ops.read_reg(hw, IXGBE_MDIO_VENDOR_SPECIFIC_1_CONTROL, IXGBE_MDIO_VENDOR_SPECIFIC_1_DEV_TYPE, ®); Modified: stable/10/sys/dev/ixgbe/ixgbe_type.h ============================================================================== --- stable/10/sys/dev/ixgbe/ixgbe_type.h Thu Feb 11 16:43:23 2016 (r295527) +++ stable/10/sys/dev/ixgbe/ixgbe_type.h Thu Feb 11 16:54:23 2016 (r295528) @@ -1479,7 +1479,10 @@ struct ixgbe_dmac_config { #define IXGBE_MDIO_GLOBAL_INT_CHIP_VEN_MASK 0xFF01 /* int chip-wide mask */ #define IXGBE_MDIO_GLOBAL_INT_CHIP_VEN_FLAG 0xFC01 /* int chip-wide mask */ #define IXGBE_MDIO_GLOBAL_ALARM_1 0xCC00 /* Global alarm 1 */ +#define IXGBE_MDIO_GLOBAL_ALM_1_DEV_FAULT 0x0010 /* device fault */ #define IXGBE_MDIO_GLOBAL_ALM_1_HI_TMP_FAIL 0x4000 /* high temp failure */ +#define IXGBE_MDIO_GLOBAL_FAULT_MSG 0xC850 /* Global Fault Message */ +#define IXGBE_MDIO_GLOBAL_FAULT_MSG_HI_TMP 0x8007 /* high temp failure */ #define IXGBE_MDIO_GLOBAL_INT_MASK 0xD400 /* Global int mask */ #define IXGBE_MDIO_GLOBAL_AN_VEN_ALM_INT_EN 0x1000 /* autoneg vendor alarm int enable */ #define IXGBE_MDIO_GLOBAL_ALARM_1_INT 0x4 /* int in Global alarm 1 */ Modified: stable/10/sys/dev/ixgbe/ixgbe_x540.c ============================================================================== --- stable/10/sys/dev/ixgbe/ixgbe_x540.c Thu Feb 11 16:43:23 2016 (r295527) +++ stable/10/sys/dev/ixgbe/ixgbe_x540.c Thu Feb 11 16:54:23 2016 (r295528) @@ -82,8 +82,7 @@ s32 ixgbe_init_ops_X540(struct ixgbe_hw /* PHY */ phy->ops.init = ixgbe_init_phy_ops_generic; phy->ops.reset = NULL; - if (!ixgbe_mng_present(hw)) - phy->ops.set_phy_power = ixgbe_set_copper_phy_power; + phy->ops.set_phy_power = ixgbe_set_copper_phy_power; /* MAC */ mac->ops.reset_hw = ixgbe_reset_hw_X540; Modified: stable/10/sys/dev/ixgbe/ixgbe_x550.c ============================================================================== --- stable/10/sys/dev/ixgbe/ixgbe_x550.c Thu Feb 11 16:43:23 2016 (r295527) +++ stable/10/sys/dev/ixgbe/ixgbe_x550.c Thu Feb 11 16:54:23 2016 (r295528) @@ -965,7 +965,7 @@ void ixgbe_restore_mdd_vf_X550(struct ix num_qs = 4; /* 32 VFs / pools */ bitmask = 0x0000000F; break; - default: /* 64 VFs / pools */ + default: /* 64 VFs / pools */ num_qs = 2; bitmask = 0x00000003; break; @@ -1264,7 +1264,7 @@ static s32 ixgbe_get_lasi_ext_t_x550em(s IXGBE_MDIO_GLOBAL_ALARM_1_INT))) return status; - /* High temperature failure alarm triggered */ + /* Global alarm triggered */ status = hw->phy.ops.read_reg(hw, IXGBE_MDIO_GLOBAL_ALARM_1, IXGBE_MDIO_VENDOR_SPECIFIC_1_DEV_TYPE, ®); @@ -1277,6 +1277,21 @@ static s32 ixgbe_get_lasi_ext_t_x550em(s /* power down the PHY in case the PHY FW didn't already */ ixgbe_set_copper_phy_power(hw, FALSE); return IXGBE_ERR_OVERTEMP; + } else if (reg & IXGBE_MDIO_GLOBAL_ALM_1_DEV_FAULT) { + /* device fault alarm triggered */ + status = hw->phy.ops.read_reg(hw, IXGBE_MDIO_GLOBAL_FAULT_MSG, + IXGBE_MDIO_VENDOR_SPECIFIC_1_DEV_TYPE, + ®); + + if (status != IXGBE_SUCCESS) + return status; + + /* if device fault was due to high temp alarm handle and exit */ + if (reg == IXGBE_MDIO_GLOBAL_FAULT_MSG_HI_TMP) { + /* power down the PHY in case the PHY FW didn't */ + ixgbe_set_copper_phy_power(hw, FALSE); + return IXGBE_ERR_OVERTEMP; + } } /* Vendor alarm 2 triggered */ From owner-svn-src-stable@freebsd.org Thu Feb 11 17:31:18 2016 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A5174AA5E10; Thu, 11 Feb 2016 17:31:18 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7304E13A5; Thu, 11 Feb 2016 17:31:18 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1BHVHlM047776; Thu, 11 Feb 2016 17:31:17 GMT (envelope-from smh@FreeBSD.org) Received: (from smh@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1BHVHXI047775; Thu, 11 Feb 2016 17:31:17 GMT (envelope-from smh@FreeBSD.org) Message-Id: <201602111731.u1BHVHXI047775@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: smh set sender to smh@FreeBSD.org using -f From: Steven Hartland Date: Thu, 11 Feb 2016 17:31:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r295531 - stable/10/sys/boot/common X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Feb 2016 17:31:18 -0000 Author: smh Date: Thu Feb 11 17:31:17 2016 New Revision: 295531 URL: https://svnweb.freebsd.org/changeset/base/295531 Log: MFC r295356 (Partial) Fix EFI platform build failures on arm.armeb Approved by: re (marius) Sponsored by: Multiplay Modified: stable/10/sys/boot/common/load_elf.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/boot/common/load_elf.c ============================================================================== --- stable/10/sys/boot/common/load_elf.c Thu Feb 11 17:25:12 2016 (r295530) +++ stable/10/sys/boot/common/load_elf.c Thu Feb 11 17:31:17 2016 (r295531) @@ -856,7 +856,7 @@ __elfN(parse_modmetadata)(struct preload error = __elfN(reloc_ptr)(fp, ef, v, &md, sizeof(md)); if (error == EOPNOTSUPP) { md.md_cval += ef->off; - md.md_data = (void *)((uintptr_t)md.md_data + ef->off); + md.md_data = (void *)((uintptr_t)md.md_data + (uintptr_t)ef->off); } else if (error != 0) return (error); #endif From owner-svn-src-stable@freebsd.org Thu Feb 11 17:34:28 2016 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 12246AA5FBD; Thu, 11 Feb 2016 17:34:28 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C7B461B39; Thu, 11 Feb 2016 17:34:27 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1BHYQRX049997; Thu, 11 Feb 2016 17:34:26 GMT (envelope-from smh@FreeBSD.org) Received: (from smh@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1BHYQ0K049994; Thu, 11 Feb 2016 17:34:26 GMT (envelope-from smh@FreeBSD.org) Message-Id: <201602111734.u1BHYQ0K049994@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: smh set sender to smh@FreeBSD.org using -f From: Steven Hartland Date: Thu, 11 Feb 2016 17:34:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r295534 - stable/10/sys/dev/ixgbe X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Feb 2016 17:34:28 -0000 Author: smh Date: Thu Feb 11 17:34:26 2016 New Revision: 295534 URL: https://svnweb.freebsd.org/changeset/base/295534 Log: MFC r294795 ixgbe sysctl hardware defaults Approved by: re (marius) Sponsored by: Multiplay Modified: stable/10/sys/dev/ixgbe/if_ix.c stable/10/sys/dev/ixgbe/ixgbe.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/ixgbe/if_ix.c ============================================================================== --- stable/10/sys/dev/ixgbe/if_ix.c Thu Feb 11 17:33:55 2016 (r295533) +++ stable/10/sys/dev/ixgbe/if_ix.c Thu Feb 11 17:34:26 2016 (r295534) @@ -165,12 +165,14 @@ static void ixgbe_unregister_vlan(void * static void ixgbe_add_device_sysctls(struct adapter *); static void ixgbe_add_hw_stats(struct adapter *); +static int ixgbe_set_flowcntl(struct adapter *, int); +static int ixgbe_set_advertise(struct adapter *, int); /* Sysctl handlers */ static void ixgbe_set_sysctl_value(struct adapter *, const char *, const char *, int *, int); -static int ixgbe_set_flowcntl(SYSCTL_HANDLER_ARGS); -static int ixgbe_set_advertise(SYSCTL_HANDLER_ARGS); +static int ixgbe_sysctl_flowcntl(SYSCTL_HANDLER_ARGS); +static int ixgbe_sysctl_advertise(SYSCTL_HANDLER_ARGS); static int ixgbe_sysctl_thermal_test(SYSCTL_HANDLER_ARGS); static int ixgbe_sysctl_dmac(SYSCTL_HANDLER_ARGS); static int ixgbe_sysctl_phy_temp(SYSCTL_HANDLER_ARGS); @@ -293,6 +295,16 @@ SYSCTL_INT(_hw_ix, OID_AUTO, tx_process_ "Maximum number of sent packets to process at a time," "-1 means unlimited"); +/* Flow control setting, default to full */ +static int ixgbe_flow_control = ixgbe_fc_full; +SYSCTL_INT(_hw_ix, OID_AUTO, flow_control, CTLFLAG_RDTUN, + &ixgbe_flow_control, 0, "Default flow control used for all adapters"); + +/* Advertise Speed, default to 0 (auto) */ +static int ixgbe_advertise_speed = 0; +SYSCTL_INT(_hw_ix, OID_AUTO, advertise_speed, CTLFLAG_RDTUN, + &ixgbe_advertise_speed, 0, "Default advertised speed for all adapters"); + /* ** Smart speed setting, default to on ** this only works as a compile option @@ -575,6 +587,11 @@ ixgbe_attach(device_t dev) break; } + /* hw.ix defaults init */ + ixgbe_set_advertise(adapter, ixgbe_advertise_speed); + ixgbe_set_flowcntl(adapter, ixgbe_flow_control); + adapter->enable_aim = ixgbe_enable_aim; + if ((adapter->msix > 1) && (ixgbe_enable_msix)) error = ixgbe_allocate_msix(adapter); else @@ -1569,7 +1586,7 @@ ixgbe_msix_que(void *arg) /* Do AIM now? */ - if (ixgbe_enable_aim == FALSE) + if (adapter->enable_aim == FALSE) goto no_calc; /* ** Do Adaptive Interrupt Moderation: @@ -4295,7 +4312,7 @@ ixgbe_add_device_sysctls(struct adapter /* Sysctls for all devices */ SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "fc", CTLTYPE_INT | CTLFLAG_RW, adapter, 0, - ixgbe_set_flowcntl, "I", IXGBE_SYSCTL_DESC_SET_FC); + ixgbe_sysctl_flowcntl, "I", IXGBE_SYSCTL_DESC_SET_FC); SYSCTL_ADD_INT(ctx, child, OID_AUTO, "enable_aim", CTLFLAG_RW, @@ -4303,7 +4320,7 @@ ixgbe_add_device_sysctls(struct adapter SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "advertise_speed", CTLTYPE_INT | CTLFLAG_RW, adapter, 0, - ixgbe_set_advertise, "I", IXGBE_SYSCTL_DESC_ADV_SPEED); + ixgbe_sysctl_advertise, "I", IXGBE_SYSCTL_DESC_ADV_SPEED); SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "thermal_test", CTLTYPE_INT | CTLFLAG_RW, adapter, 0, @@ -4668,41 +4685,51 @@ ixgbe_set_sysctl_value(struct adapter *a ** 3 - full */ static int -ixgbe_set_flowcntl(SYSCTL_HANDLER_ARGS) +ixgbe_sysctl_flowcntl(SYSCTL_HANDLER_ARGS) { - int error, last; - struct adapter *adapter = (struct adapter *) arg1; + int error, fc; + struct adapter *adapter; + + adapter = (struct adapter *) arg1; + fc = adapter->fc; - last = adapter->fc; - error = sysctl_handle_int(oidp, &adapter->fc, 0, req); + error = sysctl_handle_int(oidp, &fc, 0, req); if ((error) || (req->newptr == NULL)) return (error); /* Don't bother if it's not changed */ - if (adapter->fc == last) + if (adapter->fc == fc) return (0); - switch (adapter->fc) { - case ixgbe_fc_rx_pause: - case ixgbe_fc_tx_pause: - case ixgbe_fc_full: - adapter->hw.fc.requested_mode = adapter->fc; - if (adapter->num_queues > 1) - ixgbe_disable_rx_drop(adapter); - break; - case ixgbe_fc_none: - adapter->hw.fc.requested_mode = ixgbe_fc_none; - if (adapter->num_queues > 1) - ixgbe_enable_rx_drop(adapter); - break; - default: - adapter->fc = last; - return (EINVAL); + return ixgbe_set_flowcntl(adapter, fc); +} + + +static int +ixgbe_set_flowcntl(struct adapter *adapter, int fc) +{ + + switch (fc) { + case ixgbe_fc_rx_pause: + case ixgbe_fc_tx_pause: + case ixgbe_fc_full: + adapter->hw.fc.requested_mode = adapter->fc; + if (adapter->num_queues > 1) + ixgbe_disable_rx_drop(adapter); + break; + case ixgbe_fc_none: + adapter->hw.fc.requested_mode = ixgbe_fc_none; + if (adapter->num_queues > 1) + ixgbe_enable_rx_drop(adapter); + break; + default: + return (EINVAL); } + adapter->fc = fc; /* Don't autoneg if forcing a value */ adapter->hw.fc.disable_fc_autoneg = TRUE; ixgbe_fc_enable(&adapter->hw); - return error; + return (0); } /* @@ -4713,31 +4740,39 @@ ixgbe_set_flowcntl(SYSCTL_HANDLER_ARGS) ** 0x4 - advertise 10G */ static int -ixgbe_set_advertise(SYSCTL_HANDLER_ARGS) +ixgbe_sysctl_advertise(SYSCTL_HANDLER_ARGS) { - int error = 0, requested; - struct adapter *adapter; - device_t dev; - struct ixgbe_hw *hw; - ixgbe_link_speed speed = 0; + int error, advertise; + struct adapter *adapter; adapter = (struct adapter *) arg1; - dev = adapter->dev; - hw = &adapter->hw; + advertise = adapter->advertise; - requested = adapter->advertise; - error = sysctl_handle_int(oidp, &requested, 0, req); + error = sysctl_handle_int(oidp, &advertise, 0, req); if ((error) || (req->newptr == NULL)) return (error); + /* Checks to validate new value */ + if (adapter->advertise == advertise) /* no change */ + return (0); + + return ixgbe_set_advertise(adapter, advertise); +} + +static int +ixgbe_set_advertise(struct adapter *adapter, int advertise) +{ + device_t dev; + struct ixgbe_hw *hw; + ixgbe_link_speed speed; + + hw = &adapter->hw; + dev = adapter->dev; + /* No speed changes for backplane media */ if (hw->phy.media_type == ixgbe_media_type_backplane) return (ENODEV); - /* Checks to validate new value */ - if (adapter->advertise == requested) /* no change */ - return (0); - if (!((hw->phy.media_type == ixgbe_media_type_copper) || (hw->phy.multispeed_fiber))) { device_printf(dev, @@ -4746,13 +4781,13 @@ ixgbe_set_advertise(SYSCTL_HANDLER_ARGS) return (EINVAL); } - if (requested < 0x1 || requested > 0x7) { + if (advertise < 0x1 || advertise > 0x7) { device_printf(dev, "Invalid advertised speed; valid modes are 0x1 through 0x7\n"); return (EINVAL); } - if ((requested & 0x1) + if ((advertise & 0x1) && (hw->mac.type != ixgbe_mac_X540) && (hw->mac.type != ixgbe_mac_X550)) { device_printf(dev, "Set Advertise: 100Mb on X540/X550 only\n"); @@ -4760,18 +4795,19 @@ ixgbe_set_advertise(SYSCTL_HANDLER_ARGS) } /* Set new value and report new advertised mode */ - if (requested & 0x1) + speed = 0; + if (advertise & 0x1) speed |= IXGBE_LINK_SPEED_100_FULL; - if (requested & 0x2) + if (advertise & 0x2) speed |= IXGBE_LINK_SPEED_1GB_FULL; - if (requested & 0x4) + if (advertise & 0x4) speed |= IXGBE_LINK_SPEED_10GB_FULL; + adapter->advertise = advertise; hw->mac.autotry_restart = TRUE; hw->mac.ops.setup_link(hw, speed, TRUE); - adapter->advertise = requested; - return (error); + return (0); } /* Modified: stable/10/sys/dev/ixgbe/ixgbe.h ============================================================================== --- stable/10/sys/dev/ixgbe/ixgbe.h Thu Feb 11 17:33:55 2016 (r295533) +++ stable/10/sys/dev/ixgbe/ixgbe.h Thu Feb 11 17:34:26 2016 (r295534) @@ -497,6 +497,7 @@ struct adapter { u32 optics; u32 fc; /* local flow ctrl setting */ int advertise; /* link speeds */ + bool enable_aim; /* adaptive interrupt moderation */ bool link_active; u16 max_frame_size; u16 num_segs; From owner-svn-src-stable@freebsd.org Thu Feb 11 17:55:19 2016 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 216B5AA49AB; Thu, 11 Feb 2016 17:55:19 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E7239ACA; Thu, 11 Feb 2016 17:55:18 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1BHtHAE056130; Thu, 11 Feb 2016 17:55:17 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1BHtHen056128; Thu, 11 Feb 2016 17:55:17 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201602111755.u1BHtHen056128@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 11 Feb 2016 17:55:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r295537 - in stable/10: lib/libdevctl usr.sbin/devctl X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Feb 2016 17:55:19 -0000 Author: jhb Date: Thu Feb 11 17:55:17 2016 New Revision: 295537 URL: https://svnweb.freebsd.org/changeset/base/295537 Log: MFC 295174: - Note that devctl(8) will appear in 10.3 first. - Add missing devctl_set_driver entry to namelist in devlist(3). Approved by: re (gjb) Modified: stable/10/lib/libdevctl/devctl.3 stable/10/usr.sbin/devctl/devctl.8 Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libdevctl/devctl.3 ============================================================================== --- stable/10/lib/libdevctl/devctl.3 Thu Feb 11 17:48:15 2016 (r295536) +++ stable/10/lib/libdevctl/devctl.3 Thu Feb 11 17:55:17 2016 (r295537) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 26, 2014 +.Dd February 2, 2016 .Dt DEVCTL 3 .Os .Sh NAME @@ -33,7 +33,8 @@ .Nm devctl_attach , .Nm devctl_detach , .Nm devctl_disable , -.Nm devctl_enable +.Nm devctl_enable , +.Nm devctl_set_driver .Nd device control library .Sh LIBRARY .Lb libdevctl @@ -251,4 +252,4 @@ The new device driver failed to attach. The .Nm library first appeared in -.Fx 11.0 . +.Fx 10.3 . Modified: stable/10/usr.sbin/devctl/devctl.8 ============================================================================== --- stable/10/usr.sbin/devctl/devctl.8 Thu Feb 11 17:48:15 2016 (r295536) +++ stable/10/usr.sbin/devctl/devctl.8 Thu Feb 11 17:55:17 2016 (r295537) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 5, 2015 +.Dd February 2, 2016 .Dt DEVCTL 8 .Os .Sh NAME @@ -123,4 +123,4 @@ the device will not be changed. The .Nm utility first appeared in -.Fx 11.0 . +.Fx 10.3 . From owner-svn-src-stable@freebsd.org Thu Feb 11 17:56:11 2016 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 42FDEAA4A64; Thu, 11 Feb 2016 17:56:11 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F0431C40; Thu, 11 Feb 2016 17:56:10 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1BHuAG1056202; Thu, 11 Feb 2016 17:56:10 GMT (envelope-from smh@FreeBSD.org) Received: (from smh@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1BHu910056199; Thu, 11 Feb 2016 17:56:09 GMT (envelope-from smh@FreeBSD.org) Message-Id: <201602111756.u1BHu910056199@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: smh set sender to smh@FreeBSD.org using -f From: Steven Hartland Date: Thu, 11 Feb 2016 17:56:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r295538 - in stable/10/sys/boot: efi efi/libefi ia64/efi X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Feb 2016 17:56:11 -0000 Author: smh Date: Thu Feb 11 17:56:09 2016 New Revision: 295538 URL: https://svnweb.freebsd.org/changeset/base/295538 Log: Fix ia64 build failures in EFI platform The MFC of the recent EFI work to stable/10 caused build breakage under ia64. It was not apparent that there was EFI code outside the EFI tree as this is not the case in HEAD, however in stable/10 there is for ia64. This change does the following: * Re-enables libefi for ia64 under gcc. * Adds the ignore for unsupported pragma's when building libefi for ia64. * Adds the missing parameter to efi_handle_lookup in the ia64 loader. This is a direct commit as ia64 is no longer supported after 10.x Approved by: re (marius) Sponsored by: Multiplay Modified: stable/10/sys/boot/efi/Makefile stable/10/sys/boot/efi/libefi/Makefile stable/10/sys/boot/ia64/efi/main.c Modified: stable/10/sys/boot/efi/Makefile ============================================================================== --- stable/10/sys/boot/efi/Makefile Thu Feb 11 17:55:17 2016 (r295537) +++ stable/10/sys/boot/efi/Makefile Thu Feb 11 17:56:09 2016 (r295538) @@ -11,5 +11,9 @@ SUBDIR+= libefi loader boot1 .endif # ${COMPILER_TYPE} != "gcc" +.if ${MACHINE_CPUARCH} == "ia64" +SUBDIR+= libefi +.endif + .include Modified: stable/10/sys/boot/efi/libefi/Makefile ============================================================================== --- stable/10/sys/boot/efi/libefi/Makefile Thu Feb 11 17:55:17 2016 (r295537) +++ stable/10/sys/boot/efi/libefi/Makefile Thu Feb 11 17:56:09 2016 (r295538) @@ -1,5 +1,7 @@ # $FreeBSD$ +.include + LIB= efi INTERNALLIB= WARNS?= 2 @@ -7,6 +9,10 @@ WARNS?= 2 SRCS= delay.c efi_console.c efinet.c efipart.c errno.c handles.c \ libefi.c time.c +.if ${MACHINE_CPUARCH} == "ia64" +IGNORE_PRAGMA= 1 +.endif + .if ${MACHINE_ARCH} == "amd64" CFLAGS+= -fPIC -mno-red-zone .endif Modified: stable/10/sys/boot/ia64/efi/main.c ============================================================================== --- stable/10/sys/boot/ia64/efi/main.c Thu Feb 11 17:55:17 2016 (r295537) +++ stable/10/sys/boot/ia64/efi/main.c Thu Feb 11 17:56:09 2016 (r295538) @@ -179,7 +179,8 @@ main(int argc, CHAR16 *argv[]) BS->HandleProtocol(IH, &imgid, (VOID**)&img); bzero(&currdev, sizeof(currdev)); - efi_handle_lookup(img->DeviceHandle, &currdev.d_dev, &currdev.d_unit); + efi_handle_lookup(img->DeviceHandle, &currdev.d_dev, + &currdev.d_unit, NULL); currdev.d_type = currdev.d_dev->dv_type; env_setenv("loaddev", EV_VOLATILE, ia64_fmtdev(&currdev), env_noset, From owner-svn-src-stable@freebsd.org Thu Feb 11 17:57:44 2016 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4229DAA4B8A; Thu, 11 Feb 2016 17:57:44 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id ED1E0DC4; Thu, 11 Feb 2016 17:57:43 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1BHvgkM056312; Thu, 11 Feb 2016 17:57:42 GMT (envelope-from smh@FreeBSD.org) Received: (from smh@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1BHvgdd056311; Thu, 11 Feb 2016 17:57:42 GMT (envelope-from smh@FreeBSD.org) Message-Id: <201602111757.u1BHvgdd056311@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: smh set sender to smh@FreeBSD.org using -f From: Steven Hartland Date: Thu, 11 Feb 2016 17:57:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r295539 - stable/10/sys/boot/efi/boot1 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Feb 2016 17:57:44 -0000 Author: smh Date: Thu Feb 11 17:57:42 2016 New Revision: 295539 URL: https://svnweb.freebsd.org/changeset/base/295539 Log: MFC r294768: Process /boot/config and /boot.config during EFI boot Approved by: re (marius) Sponsored by: Multiplay Modified: stable/10/sys/boot/efi/boot1/boot1.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/boot/efi/boot1/boot1.c ============================================================================== --- stable/10/sys/boot/efi/boot1/boot1.c Thu Feb 11 17:56:09 2016 (r295538) +++ stable/10/sys/boot/efi/boot1/boot1.c Thu Feb 11 17:57:42 2016 (r295539) @@ -91,13 +91,41 @@ Free(void *buf, const char *file __unuse void try_load(const boot_module_t *mod) { - size_t bufsize; + size_t bufsize, cmdsize; void *buf; + char *cmd; dev_info_t *dev; EFI_HANDLE loaderhandle; EFI_LOADED_IMAGE *loaded_image; EFI_STATUS status; + /* + * Read in and parse the command line from /boot.config or /boot/config, + * if present. We'll pass it the next stage via a simple ASCII + * string. loader.efi has a hack for ASCII strings, so we'll use that to + * keep the size down here. We only try to read the alternate file if + * we get EFI_NOT_FOUND because all other errors mean that the boot_module + * had troubles with the filesystem. We could return early, but we'll let + * loading the actual kernel sort all that out. Since these files are + * optional, we don't report errors in trying to read them. + */ + cmd = NULL; + cmdsize = 0; + status = mod->load(PATH_DOTCONFIG, &dev, &buf, &bufsize); + if (status == EFI_NOT_FOUND) + status = mod->load(PATH_CONFIG, &dev, &buf, &bufsize); + if (status == EFI_SUCCESS) { + cmdsize = bufsize + 1; + cmd = malloc(cmdsize); + if (cmd == NULL) { + free(buf); + return; + } + memcpy(cmd, buf, bufsize); + cmd[bufsize] = '\0'; + free(buf); + } + status = mod->load(PATH_LOADER_EFI, &dev, &buf, &bufsize); if (status == EFI_NOT_FOUND) return; @@ -115,6 +143,9 @@ try_load(const boot_module_t *mod) return; } + if (cmd != NULL) + printf(" command args: %s\n", cmd); + if ((status = bs->HandleProtocol(loaderhandle, &LoadedImageGUID, (VOID**)&loaded_image)) != EFI_SUCCESS) { printf("Failed to query LoadedImage provided by %s (%lu)\n", @@ -123,11 +154,16 @@ try_load(const boot_module_t *mod) } loaded_image->DeviceHandle = dev->devhandle; + loaded_image->LoadOptionsSize = cmdsize; + loaded_image->LoadOptions = cmd; if ((status = bs->StartImage(loaderhandle, NULL, NULL)) != EFI_SUCCESS) { printf("Failed to start image provided by %s (%lu)\n", mod->name, EFI_ERROR_CODE(status)); + free(cmd); + loaded_image->LoadOptionsSize = 0; + loaded_image->LoadOptions = NULL; return; } } From owner-svn-src-stable@freebsd.org Thu Feb 11 22:33:49 2016 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 821B5AA41DB; Thu, 11 Feb 2016 22:33:49 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5259DF8A; Thu, 11 Feb 2016 22:33:49 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1BMXmrt037844; Thu, 11 Feb 2016 22:33:48 GMT (envelope-from smh@FreeBSD.org) Received: (from smh@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1BMXlNk037838; Thu, 11 Feb 2016 22:33:47 GMT (envelope-from smh@FreeBSD.org) Message-Id: <201602112233.u1BMXlNk037838@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: smh set sender to smh@FreeBSD.org using -f From: Steven Hartland Date: Thu, 11 Feb 2016 22:33:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r295550 - in stable/10/sys/boot/efi: boot1 include X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Feb 2016 22:33:49 -0000 Author: smh Date: Thu Feb 11 22:33:47 2016 New Revision: 295550 URL: https://svnweb.freebsd.org/changeset/base/295550 Log: MFC r295320, r295356 (Partial) Fix EFI multi device boot support Approved by: re (marius) Sponsored by: Multiplay Modified: stable/10/sys/boot/efi/boot1/boot1.c stable/10/sys/boot/efi/boot1/boot_module.h stable/10/sys/boot/efi/boot1/ufs_module.c stable/10/sys/boot/efi/boot1/zfs_module.c stable/10/sys/boot/efi/include/efidevp.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/boot/efi/boot1/boot1.c ============================================================================== --- stable/10/sys/boot/efi/boot1/boot1.c Thu Feb 11 22:29:39 2016 (r295549) +++ stable/10/sys/boot/efi/boot1/boot1.c Thu Feb 11 22:33:47 2016 (r295550) @@ -50,9 +50,6 @@ static const boot_module_t *boot_modules void putchar(int c); EFI_STATUS efi_main(EFI_HANDLE Ximage, EFI_SYSTEM_TABLE* Xsystab); -static void try_load(const boot_module_t* mod); -static EFI_STATUS probe_handle(EFI_HANDLE h); - EFI_SYSTEM_TABLE *systab; EFI_BOOT_SERVICES *bs; static EFI_HANDLE *image; @@ -85,20 +82,300 @@ Free(void *buf, const char *file __unuse } /* - * This function only returns if it fails to load the kernel. If it - * succeeds, it simply boots the kernel. + * nodes_match returns TRUE if the imgpath isn't NULL and the nodes match, + * FALSE otherwise. */ -void -try_load(const boot_module_t *mod) +static BOOLEAN +nodes_match(EFI_DEVICE_PATH *imgpath, EFI_DEVICE_PATH *devpath) +{ + int len; + + if (imgpath == NULL || imgpath->Type != devpath->Type || + imgpath->SubType != devpath->SubType) + return (FALSE); + + len = DevicePathNodeLength(imgpath); + if (len != DevicePathNodeLength(devpath)) + return (FALSE); + + return (memcmp(imgpath, devpath, (size_t)len) == 0); +} + +/* + * device_paths_match returns TRUE if the imgpath isn't NULL and all nodes + * in imgpath and devpath match up to their respect occurances of a media + * node, FALSE otherwise. + */ +static BOOLEAN +device_paths_match(EFI_DEVICE_PATH *imgpath, EFI_DEVICE_PATH *devpath) { - size_t bufsize, cmdsize; - void *buf; + + if (imgpath == NULL) + return (FALSE); + + while (!IsDevicePathEnd(imgpath) && !IsDevicePathEnd(devpath)) { + if (IsDevicePathType(imgpath, MEDIA_DEVICE_PATH) && + IsDevicePathType(devpath, MEDIA_DEVICE_PATH)) + return (TRUE); + + if (!nodes_match(imgpath, devpath)) + return (FALSE); + + imgpath = NextDevicePathNode(imgpath); + devpath = NextDevicePathNode(devpath); + } + + return (FALSE); +} + +/* + * devpath_last returns the last non-path end node in devpath. + */ +static EFI_DEVICE_PATH * +devpath_last(EFI_DEVICE_PATH *devpath) +{ + + while (!IsDevicePathEnd(NextDevicePathNode(devpath))) + devpath = NextDevicePathNode(devpath); + + return (devpath); +} + +/* + * devpath_node_str is a basic output method for a devpath node which + * only understands a subset of the available sub types. + * + * If we switch to UEFI 2.x then we should update it to use: + * EFI_DEVICE_PATH_TO_TEXT_PROTOCOL. + */ +static int +devpath_node_str(char *buf, size_t size, EFI_DEVICE_PATH *devpath) +{ + + switch (devpath->Type) { + case MESSAGING_DEVICE_PATH: + switch (devpath->SubType) { + case MSG_ATAPI_DP: { + ATAPI_DEVICE_PATH *atapi; + + atapi = (ATAPI_DEVICE_PATH *)(void *)devpath; + return snprintf(buf, size, "ata(%s,%s,0x%x)", + (atapi->PrimarySecondary == 1) ? "Sec" : "Pri", + (atapi->SlaveMaster == 1) ? "Slave" : "Master", + atapi->Lun); + } + case MSG_USB_DP: { + USB_DEVICE_PATH *usb; + + usb = (USB_DEVICE_PATH *)devpath; + return snprintf(buf, size, "usb(0x%02x,0x%02x)", + usb->ParentPortNumber, usb->InterfaceNumber); + } + case MSG_SCSI_DP: { + SCSI_DEVICE_PATH *scsi; + + scsi = (SCSI_DEVICE_PATH *)(void *)devpath; + return snprintf(buf, size, "scsi(0x%02x,0x%02x)", + scsi->Pun, scsi->Lun); + } + case MSG_SATA_DP: { + SATA_DEVICE_PATH *sata; + + sata = (SATA_DEVICE_PATH *)(void *)devpath; + return snprintf(buf, size, "sata(0x%x,0x%x,0x%x)", + sata->HBAPortNumber, sata->PortMultiplierPortNumber, + sata->Lun); + } + default: + return snprintf(buf, size, "msg(0x%02x)", + devpath->SubType); + } + break; + case HARDWARE_DEVICE_PATH: + switch (devpath->SubType) { + case HW_PCI_DP: { + PCI_DEVICE_PATH *pci; + + pci = (PCI_DEVICE_PATH *)devpath; + return snprintf(buf, size, "pci(0x%02x,0x%02x)", + pci->Device, pci->Function); + } + default: + return snprintf(buf, size, "hw(0x%02x)", + devpath->SubType); + } + break; + case ACPI_DEVICE_PATH: { + ACPI_HID_DEVICE_PATH *acpi; + + acpi = (ACPI_HID_DEVICE_PATH *)(void *)devpath; + if ((acpi->HID & PNP_EISA_ID_MASK) == PNP_EISA_ID_CONST) { + switch (EISA_ID_TO_NUM(acpi->HID)) { + case 0x0a03: + return snprintf(buf, size, "pciroot(0x%x)", + acpi->UID); + case 0x0a08: + return snprintf(buf, size, "pcieroot(0x%x)", + acpi->UID); + case 0x0604: + return snprintf(buf, size, "floppy(0x%x)", + acpi->UID); + case 0x0301: + return snprintf(buf, size, "keyboard(0x%x)", + acpi->UID); + case 0x0501: + return snprintf(buf, size, "serial(0x%x)", + acpi->UID); + case 0x0401: + return snprintf(buf, size, "parallelport(0x%x)", + acpi->UID); + default: + return snprintf(buf, size, "acpi(pnp%04x,0x%x)", + EISA_ID_TO_NUM(acpi->HID), acpi->UID); + } + } + + return snprintf(buf, size, "acpi(0x%08x,0x%x)", acpi->HID, + acpi->UID); + } + case MEDIA_DEVICE_PATH: + switch (devpath->SubType) { + case MEDIA_CDROM_DP: { + CDROM_DEVICE_PATH *cdrom; + + cdrom = (CDROM_DEVICE_PATH *)(void *)devpath; + return snprintf(buf, size, "cdrom(%x)", + cdrom->BootEntry); + } + case MEDIA_HARDDRIVE_DP: { + HARDDRIVE_DEVICE_PATH *hd; + + hd = (HARDDRIVE_DEVICE_PATH *)(void *)devpath; + return snprintf(buf, size, "hd(%x)", + hd->PartitionNumber); + } + default: + return snprintf(buf, size, "media(0x%02x)", + devpath->SubType); + } + case BBS_DEVICE_PATH: + return snprintf(buf, size, "bbs(0x%02x)", devpath->SubType); + case END_DEVICE_PATH_TYPE: + return (0); + } + + return snprintf(buf, size, "type(0x%02x, 0x%02x)", devpath->Type, + devpath->SubType); +} + +/* + * devpath_strlcat appends a text description of devpath to buf but not more + * than size - 1 characters followed by NUL-terminator. + */ +int +devpath_strlcat(char *buf, size_t size, EFI_DEVICE_PATH *devpath) +{ + size_t len, used; + const char *sep; + + sep = ""; + used = 0; + while (!IsDevicePathEnd(devpath)) { + len = snprintf(buf, size - used, "%s", sep); + used += len; + if (used > size) + return (used); + buf += len; + + len = devpath_node_str(buf, size - used, devpath); + used += len; + if (used > size) + return (used); + buf += len; + devpath = NextDevicePathNode(devpath); + sep = ":"; + } + + return (used); +} + +/* + * devpath_str is convenience method which returns the text description of + * devpath using a static buffer, so it isn't thread safe! + */ +char * +devpath_str(EFI_DEVICE_PATH *devpath) +{ + static char buf[256]; + + devpath_strlcat(buf, sizeof(buf), devpath); + + return buf; +} + +/* + * load_loader attempts to load the loader image data. + * + * It tries each module and its respective devices, identified by mod->probe, + * in order until a successful load occurs at which point it returns EFI_SUCCESS + * and EFI_NOT_FOUND otherwise. + * + * Only devices which have preferred matching the preferred parameter are tried. + */ +static EFI_STATUS +load_loader(const boot_module_t **modp, dev_info_t **devinfop, void **bufp, + size_t *bufsize, BOOLEAN preferred) +{ + UINTN i; + dev_info_t *dev; + const boot_module_t *mod; + + for (i = 0; i < NUM_BOOT_MODULES; i++) { + if (boot_modules[i] == NULL) + continue; + mod = boot_modules[i]; + for (dev = mod->devices(); dev != NULL; dev = dev->next) { + if (dev->preferred != preferred) + continue; + + if (mod->load(PATH_LOADER_EFI, dev, bufp, bufsize) == + EFI_SUCCESS) { + *devinfop = dev; + *modp = mod; + return (EFI_SUCCESS); + } + } + } + + return (EFI_NOT_FOUND); +} + +/* + * try_boot only returns if it fails to load the loader. If it succeeds + * it simply boots, otherwise it returns the status of last EFI call. + */ +static EFI_STATUS +try_boot() +{ + size_t bufsize, loadersize, cmdsize; + void *buf, *loaderbuf; char *cmd; dev_info_t *dev; + const boot_module_t *mod; EFI_HANDLE loaderhandle; EFI_LOADED_IMAGE *loaded_image; EFI_STATUS status; + status = load_loader(&mod, &dev, &loaderbuf, &loadersize, TRUE); + if (status != EFI_SUCCESS) { + status = load_loader(&mod, &dev, &loaderbuf, &loadersize, + FALSE); + if (status != EFI_SUCCESS) { + printf("Failed to load '%s'\n", PATH_LOADER_EFI); + return (status); + } + } + /* * Read in and parse the command line from /boot.config or /boot/config, * if present. We'll pass it the next stage via a simple ASCII @@ -111,67 +388,183 @@ try_load(const boot_module_t *mod) */ cmd = NULL; cmdsize = 0; - status = mod->load(PATH_DOTCONFIG, &dev, &buf, &bufsize); + status = mod->load(PATH_DOTCONFIG, dev, &buf, &bufsize); if (status == EFI_NOT_FOUND) - status = mod->load(PATH_CONFIG, &dev, &buf, &bufsize); + status = mod->load(PATH_CONFIG, dev, &buf, &bufsize); if (status == EFI_SUCCESS) { cmdsize = bufsize + 1; cmd = malloc(cmdsize); - if (cmd == NULL) { - free(buf); - return; - } + if (cmd == NULL) + goto errout; memcpy(cmd, buf, bufsize); cmd[bufsize] = '\0'; free(buf); + buf = NULL; } - status = mod->load(PATH_LOADER_EFI, &dev, &buf, &bufsize); - if (status == EFI_NOT_FOUND) - return; - - if (status != EFI_SUCCESS) { - printf("%s failed to load %s (%lu)\n", mod->name, - PATH_LOADER_EFI, EFI_ERROR_CODE(status)); - return; - } - - if ((status = bs->LoadImage(TRUE, image, dev->devpath, buf, bufsize, - &loaderhandle)) != EFI_SUCCESS) { + if ((status = bs->LoadImage(TRUE, image, devpath_last(dev->devpath), + loaderbuf, loadersize, &loaderhandle)) != EFI_SUCCESS) { printf("Failed to load image provided by %s, size: %zu, (%lu)\n", mod->name, bufsize, EFI_ERROR_CODE(status)); - return; + goto errout; } - if (cmd != NULL) - printf(" command args: %s\n", cmd); - if ((status = bs->HandleProtocol(loaderhandle, &LoadedImageGUID, (VOID**)&loaded_image)) != EFI_SUCCESS) { printf("Failed to query LoadedImage provided by %s (%lu)\n", mod->name, EFI_ERROR_CODE(status)); - return; + goto errout; } + if (cmd != NULL) + printf(" command args: %s\n", cmd); + loaded_image->DeviceHandle = dev->devhandle; loaded_image->LoadOptionsSize = cmdsize; loaded_image->LoadOptions = cmd; + DPRINTF("Starting '%s' in 5 seconds...", PATH_LOADER_EFI); + DSTALL(1000000); + DPRINTF("."); + DSTALL(1000000); + DPRINTF("."); + DSTALL(1000000); + DPRINTF("."); + DSTALL(1000000); + DPRINTF("."); + DSTALL(1000000); + DPRINTF(".\n"); + if ((status = bs->StartImage(loaderhandle, NULL, NULL)) != EFI_SUCCESS) { printf("Failed to start image provided by %s (%lu)\n", mod->name, EFI_ERROR_CODE(status)); - free(cmd); loaded_image->LoadOptionsSize = 0; loaded_image->LoadOptions = NULL; - return; } + +errout: + if (cmd != NULL) + free(cmd); + if (buf != NULL) + free(buf); + if (loaderbuf != NULL) + free(loaderbuf); + + return (status); +} + +/* + * probe_handle determines if the passed handle represents a logical partition + * if it does it uses each module in order to probe it and if successful it + * returns EFI_SUCCESS. + */ +static EFI_STATUS +probe_handle(EFI_HANDLE h, EFI_DEVICE_PATH *imgpath, BOOLEAN *preferred) +{ + dev_info_t *devinfo; + EFI_BLOCK_IO *blkio; + EFI_DEVICE_PATH *devpath; + EFI_STATUS status; + UINTN i; + + /* Figure out if we're dealing with an actual partition. */ + status = bs->HandleProtocol(h, &DevicePathGUID, (void **)&devpath); + if (status == EFI_UNSUPPORTED) + return (status); + + if (status != EFI_SUCCESS) { + DPRINTF("\nFailed to query DevicePath (%lu)\n", + EFI_ERROR_CODE(status)); + return (status); + } + + DPRINTF("probing: %s\n", devpath_str(devpath)); + + status = bs->HandleProtocol(h, &BlockIoProtocolGUID, (void **)&blkio); + if (status == EFI_UNSUPPORTED) + return (status); + + if (status != EFI_SUCCESS) { + DPRINTF("\nFailed to query BlockIoProtocol (%lu)\n", + EFI_ERROR_CODE(status)); + return (status); + } + + if (!blkio->Media->LogicalPartition) + return (EFI_UNSUPPORTED); + + *preferred = device_paths_match(imgpath, devpath); + + /* Run through each module, see if it can load this partition */ + for (i = 0; i < NUM_BOOT_MODULES; i++) { + if (boot_modules[i] == NULL) + continue; + + if ((status = bs->AllocatePool(EfiLoaderData, + sizeof(*devinfo), (void **)&devinfo)) != + EFI_SUCCESS) { + DPRINTF("\nFailed to allocate devinfo (%lu)\n", + EFI_ERROR_CODE(status)); + continue; + } + devinfo->dev = blkio; + devinfo->devpath = devpath; + devinfo->devhandle = h; + devinfo->devdata = NULL; + devinfo->preferred = *preferred; + devinfo->next = NULL; + + status = boot_modules[i]->probe(devinfo); + if (status == EFI_SUCCESS) + return (EFI_SUCCESS); + (void)bs->FreePool(devinfo); + } + + return (EFI_UNSUPPORTED); +} + +/* + * probe_handle_status calls probe_handle and outputs the returned status + * of the call. + */ +static void +probe_handle_status(EFI_HANDLE h, EFI_DEVICE_PATH *imgpath) +{ + EFI_STATUS status; + BOOLEAN preferred; + + status = probe_handle(h, imgpath, &preferred); + + DPRINTF("probe: "); + switch (status) { + case EFI_UNSUPPORTED: + printf("."); + DPRINTF(" not supported\n"); + break; + case EFI_SUCCESS: + if (preferred) { + printf("%c", '*'); + DPRINTF(" supported (preferred)\n"); + } else { + printf("%c", '+'); + DPRINTF(" supported\n"); + } + break; + default: + printf("x"); + DPRINTF(" error (%lu)\n", EFI_ERROR_CODE(status)); + break; + } + DSTALL(500000); } EFI_STATUS efi_main(EFI_HANDLE Ximage, EFI_SYSTEM_TABLE *Xsystab) { EFI_HANDLE *handles; + EFI_LOADED_IMAGE *img; + EFI_DEVICE_PATH *imgpath; EFI_STATUS status; EFI_CONSOLE_CONTROL_PROTOCOL *ConsoleControl = NULL; SIMPLE_TEXT_OUTPUT_INTERFACE *conout = NULL; @@ -254,20 +647,22 @@ efi_main(EFI_HANDLE Ximage, EFI_SYSTEM_T /* Scan all partitions, probing with all modules. */ nhandles = hsize / sizeof(*handles); printf(" Probing %zu block devices...", nhandles); - for (i = 0; i < nhandles; i++) { - status = probe_handle(handles[i]); - switch (status) { - case EFI_UNSUPPORTED: - printf("."); - break; - case EFI_SUCCESS: - printf("+"); - break; - default: - printf("x"); - break; - } + DPRINTF("\n"); + + /* Determine the devpath of our image so we can prefer it. */ + status = bs->HandleProtocol(image, &LoadedImageGUID, (VOID**)&img); + imgpath = NULL; + if (status == EFI_SUCCESS) { + status = bs->HandleProtocol(img->DeviceHandle, &DevicePathGUID, + (void **)&imgpath); + if (status != EFI_SUCCESS) + DPRINTF("Failed to get image DevicePath (%lu)\n", + EFI_ERROR_CODE(status)); + DPRINTF("boot1 imagepath: %s\n", devpath_str(imgpath)); } + + for (i = 0; i < nhandles; i++) + probe_handle_status(handles[i], imgpath); printf(" done\n"); /* Status summary. */ @@ -278,78 +673,15 @@ efi_main(EFI_HANDLE Ximage, EFI_SYSTEM_T } } - /* Select a partition to boot by trying each module in order. */ - for (i = 0; i < NUM_BOOT_MODULES; i++) - if (boot_modules[i] != NULL) - try_load(boot_modules[i]); + try_boot(); /* If we get here, we're out of luck... */ panic("No bootable partitions found!"); } -static EFI_STATUS -probe_handle(EFI_HANDLE h) -{ - dev_info_t *devinfo; - EFI_BLOCK_IO *blkio; - EFI_DEVICE_PATH *devpath; - EFI_STATUS status; - UINTN i; - - /* Figure out if we're dealing with an actual partition. */ - status = bs->HandleProtocol(h, &DevicePathGUID, (void **)&devpath); - if (status == EFI_UNSUPPORTED) - return (status); - - if (status != EFI_SUCCESS) { - DPRINTF("\nFailed to query DevicePath (%lu)\n", - EFI_ERROR_CODE(status)); - return (status); - } - - while (!IsDevicePathEnd(NextDevicePathNode(devpath))) - devpath = NextDevicePathNode(devpath); - - status = bs->HandleProtocol(h, &BlockIoProtocolGUID, (void **)&blkio); - if (status == EFI_UNSUPPORTED) - return (status); - - if (status != EFI_SUCCESS) { - DPRINTF("\nFailed to query BlockIoProtocol (%lu)\n", - EFI_ERROR_CODE(status)); - return (status); - } - - if (!blkio->Media->LogicalPartition) - return (EFI_UNSUPPORTED); - - /* Run through each module, see if it can load this partition */ - for (i = 0; i < NUM_BOOT_MODULES; i++) { - if (boot_modules[i] == NULL) - continue; - - if ((status = bs->AllocatePool(EfiLoaderData, - sizeof(*devinfo), (void **)&devinfo)) != - EFI_SUCCESS) { - DPRINTF("\nFailed to allocate devinfo (%lu)\n", - EFI_ERROR_CODE(status)); - continue; - } - devinfo->dev = blkio; - devinfo->devpath = devpath; - devinfo->devhandle = h; - devinfo->devdata = NULL; - devinfo->next = NULL; - - status = boot_modules[i]->probe(devinfo); - if (status == EFI_SUCCESS) - return (EFI_SUCCESS); - (void)bs->FreePool(devinfo); - } - - return (EFI_UNSUPPORTED); -} - +/* + * add_device adds a device to the passed devinfo list. + */ void add_device(dev_info_t **devinfop, dev_info_t *devinfo) { Modified: stable/10/sys/boot/efi/boot1/boot_module.h ============================================================================== --- stable/10/sys/boot/efi/boot1/boot_module.h Thu Feb 11 22:29:39 2016 (r295549) +++ stable/10/sys/boot/efi/boot1/boot_module.h Thu Feb 11 22:33:47 2016 (r295550) @@ -36,9 +36,11 @@ #include #ifdef EFI_DEBUG -#define DPRINTF(fmt, ...) printf(fmt, __VA_ARGS__) +#define DPRINTF(fmt, args...) printf(fmt, ##args) +#define DSTALL(d) bs->Stall(d) #else #define DPRINTF(fmt, ...) {} +#define DSTALL(d) {} #endif /* EFI device info */ @@ -48,6 +50,7 @@ typedef struct dev_info EFI_DEVICE_PATH *devpath; EFI_HANDLE *devhandle; void *devdata; + BOOLEAN preferred; struct dev_info *next; } dev_info_t; @@ -75,19 +78,21 @@ typedef struct boot_module_t /* * load should select the best out of a set of devices that probe - * indicated were loadable and load it. + * indicated were loadable and load the specified file. * * Return codes: * EFI_SUCCESS = The module can handle the device. * EFI_NOT_FOUND = The module can not handle the device. * Other = The module encountered an error. */ - EFI_STATUS (*load)(const char *loader_path, dev_info_t **devinfo, + EFI_STATUS (*load)(const char *filepath, dev_info_t *devinfo, void **buf, size_t *bufsize); /* status outputs information about the probed devices. */ void (*status)(); + /* valid devices as found by probe. */ + dev_info_t *(*devices)(); } boot_module_t; /* Standard boot modules. */ @@ -107,4 +112,6 @@ extern int vsnprintf(char *str, size_t s extern EFI_SYSTEM_TABLE *systab; extern EFI_BOOT_SERVICES *bs; +extern int devpath_strlcat(char *buf, size_t size, EFI_DEVICE_PATH *devpath); +extern char *devpath_str(EFI_DEVICE_PATH *devpath); #endif Modified: stable/10/sys/boot/efi/boot1/ufs_module.c ============================================================================== --- stable/10/sys/boot/efi/boot1/ufs_module.c Thu Feb 11 22:29:39 2016 (r295549) +++ stable/10/sys/boot/efi/boot1/ufs_module.c Thu Feb 11 22:33:47 2016 (r295550) @@ -93,7 +93,7 @@ probe(dev_info_t* dev) } static EFI_STATUS -try_load(dev_info_t *dev, const char *loader_path, void **bufp, size_t *bufsize) +load(const char *filepath, dev_info_t *dev, void **bufp, size_t *bufsize) { ufs_ino_t ino; EFI_STATUS status; @@ -101,59 +101,46 @@ try_load(dev_info_t *dev, const char *lo ssize_t read; void *buf; - if (init_dev(dev) < 0) + DPRINTF("Loading '%s' from %s\n", filepath, devpath_str(dev->devpath)); + + if (init_dev(dev) < 0) { + DPRINTF("Failed to init device\n"); return (EFI_UNSUPPORTED); + } - if ((ino = lookup(loader_path)) == 0) + if ((ino = lookup(filepath)) == 0) { + DPRINTF("Failed to lookup '%s' (file not found?)\n", filepath); return (EFI_NOT_FOUND); + } if (fsread_size(ino, NULL, 0, &size) < 0 || size <= 0) { - printf("Failed to read size of '%s' ino: %d\n", loader_path, - ino); + printf("Failed to read size of '%s' ino: %d\n", filepath, ino); return (EFI_INVALID_PARAMETER); } if ((status = bs->AllocatePool(EfiLoaderData, size, &buf)) != EFI_SUCCESS) { - printf("Failed to allocate read buffer (%lu)\n", - EFI_ERROR_CODE(status)); + printf("Failed to allocate read buffer %zu for '%s' (%lu)\n", + size, filepath, EFI_ERROR_CODE(status)); return (status); } read = fsread(ino, buf, size); if ((size_t)read != size) { - printf("Failed to read '%s' (%zd != %zu)\n", loader_path, read, + printf("Failed to read '%s' (%zd != %zu)\n", filepath, read, size); (void)bs->FreePool(buf); return (EFI_INVALID_PARAMETER); } + DPRINTF("Load complete\n"); + *bufp = buf; *bufsize = size; return (EFI_SUCCESS); } -static EFI_STATUS -load(const char *loader_path, dev_info_t **devinfop, void **buf, - size_t *bufsize) -{ - dev_info_t *dev; - EFI_STATUS status; - - for (dev = devices; dev != NULL; dev = dev->next) { - status = try_load(dev, loader_path, buf, bufsize); - if (status == EFI_SUCCESS) { - *devinfop = dev; - return (EFI_SUCCESS); - } else if (status != EFI_NOT_FOUND) { - return (status); - } - } - - return (EFI_NOT_FOUND); -} - static void status() { @@ -176,10 +163,18 @@ status() } } +static dev_info_t * +_devices() +{ + + return (devices); +} + const boot_module_t ufs_module = { .name = "UFS", .probe = probe, .load = load, - .status = status + .status = status, + .devices = _devices }; Modified: stable/10/sys/boot/efi/boot1/zfs_module.c ============================================================================== --- stable/10/sys/boot/efi/boot1/zfs_module.c Thu Feb 11 22:29:39 2016 (r295549) +++ stable/10/sys/boot/efi/boot1/zfs_module.c Thu Feb 11 22:33:47 2016 (r295550) @@ -91,7 +91,7 @@ probe(dev_info_t *dev) } static EFI_STATUS -try_load(dev_info_t *devinfo, const char *loader_path, void **bufp, size_t *bufsize) +load(const char *filepath, dev_info_t *devinfo, void **bufp, size_t *bufsize) { spa_t *spa; struct zfsmount zfsmount; @@ -102,32 +102,41 @@ try_load(dev_info_t *devinfo, const char EFI_STATUS status; spa = devinfo->devdata; - if (zfs_spa_init(spa) != 0) { - /* Init failed, don't report this loudly. */ + + DPRINTF("load: '%s' spa: '%s', devpath: %s\n", filepath, spa->spa_name, + devpath_str(devinfo->devpath)); + + if ((err = zfs_spa_init(spa)) != 0) { + DPRINTF("Failed to load pool '%s' (%d)\n", spa->spa_name, err); return (EFI_NOT_FOUND); } - if (zfs_mount(spa, 0, &zfsmount) != 0) { - /* Mount failed, don't report this loudly. */ + if ((err = zfs_mount(spa, 0, &zfsmount)) != 0) { + DPRINTF("Failed to mount pool '%s' (%d)\n", spa->spa_name, err); return (EFI_NOT_FOUND); } - if ((err = zfs_lookup(&zfsmount, loader_path, &dn)) != 0) { - printf("Failed to lookup %s on pool %s (%d)\n", loader_path, + if ((err = zfs_lookup(&zfsmount, filepath, &dn)) != 0) { + if (err == ENOENT) { + DPRINTF("Failed to find '%s' on pool '%s' (%d)\n", + filepath, spa->spa_name, err); + return (EFI_NOT_FOUND); + } + printf("Failed to lookup '%s' on pool '%s' (%d)\n", filepath, spa->spa_name, err); return (EFI_INVALID_PARAMETER); } if ((err = zfs_dnode_stat(spa, &dn, &st)) != 0) { - printf("Failed to lookup %s on pool %s (%d)\n", loader_path, + printf("Failed to stat '%s' on pool '%s' (%d)\n", filepath, spa->spa_name, err); return (EFI_INVALID_PARAMETER); } if ((status = bs->AllocatePool(EfiLoaderData, (UINTN)st.st_size, &buf)) != EFI_SUCCESS) { - printf("Failed to allocate load buffer for pool %s (%lu)\n", - spa->spa_name, EFI_ERROR_CODE(status)); + printf("Failed to allocate load buffer %zd for pool '%s' for '%s' " + "(%lu)\n", st.st_size, spa->spa_name, filepath, EFI_ERROR_CODE(status)); return (EFI_INVALID_PARAMETER); } @@ -144,26 +153,6 @@ try_load(dev_info_t *devinfo, const char return (EFI_SUCCESS); } -static EFI_STATUS -load(const char *loader_path, dev_info_t **devinfop, void **bufp, - size_t *bufsize) -{ - dev_info_t *devinfo; - EFI_STATUS status; - - for (devinfo = devices; devinfo != NULL; devinfo = devinfo->next) { - status = try_load(devinfo, loader_path, bufp, bufsize); - if (status == EFI_SUCCESS) { - *devinfop = devinfo; - return (EFI_SUCCESS); - } else if (status != EFI_NOT_FOUND) { - return (status); - } - } - - return (EFI_NOT_FOUND); -} - static void status() { @@ -189,11 +178,19 @@ init() zfs_init(); } +static dev_info_t * +_devices() +{ + + return (devices); +} + const boot_module_t zfs_module = { .name = "ZFS", .init = init, .probe = probe, .load = load, - .status = status + .status = status, + .devices = _devices }; Modified: stable/10/sys/boot/efi/include/efidevp.h ============================================================================== --- stable/10/sys/boot/efi/include/efidevp.h Thu Feb 11 22:29:39 2016 (r295549) +++ stable/10/sys/boot/efi/include/efidevp.h Thu Feb 11 22:33:47 2016 (r295550) @@ -40,9 +40,7 @@ typedef struct _EFI_DEVICE_PATH { #define EFI_DP_TYPE_MASK 0x7F #define EFI_DP_TYPE_UNPACKED 0x80 -//#define END_DEVICE_PATH_TYPE 0xff #define END_DEVICE_PATH_TYPE 0x7f -//#define END_DEVICE_PATH_TYPE_UNPACKED 0x7f #define END_ENTIRE_DEVICE_PATH_SUBTYPE 0xff #define END_INSTANCE_DEVICE_PATH_SUBTYPE 0x01 @@ -56,8 +54,8 @@ typedef struct _EFI_DEVICE_PATH { #define DevicePathSubType(a) ( (a)->SubType ) #define DevicePathNodeLength(a) ( ((a)->Length[0]) | ((a)->Length[1] << 8) ) #define NextDevicePathNode(a) ( (EFI_DEVICE_PATH *) ( ((UINT8 *) (a)) + DevicePathNodeLength(a))) -//#define IsDevicePathEndType(a) ( DevicePathType(a) == END_DEVICE_PATH_TYPE_UNPACKED ) -#define IsDevicePathEndType(a) ( DevicePathType(a) == END_DEVICE_PATH_TYPE ) +#define IsDevicePathType(a, t) ( DevicePathType(a) == t ) +#define IsDevicePathEndType(a) IsDevicePathType(a, END_DEVICE_PATH_TYPE) #define IsDevicePathEndSubType(a) ( (a)->SubType == END_ENTIRE_DEVICE_PATH_SUBTYPE ) #define IsDevicePathEnd(a) ( IsDevicePathEndType(a) && IsDevicePathEndSubType(a) ) #define IsDevicePathUnpacked(a) ( (a)->Type & EFI_DP_TYPE_UNPACKED ) @@ -285,6 +283,13 @@ typedef struct _UART_DEVICE_PATH { #define DEVICE_PATH_MESSAGING_VT_UTF8 \ { 0xad15a0d6, 0x8bec, 0x4acf, {0xa0, 0x73, 0xd0, 0x1d, 0xe7, 0x7e, 0x2d, 0x88} } +#define MSG_SATA_DP 0x12 +typedef struct _SATA_DEVICE_PATH { + EFI_DEVICE_PATH Header; + UINT16 HBAPortNumber; + UINT16 PortMultiplierPortNumber; + UINT16 Lun; +} SATA_DEVICE_PATH; #define MEDIA_DEVICE_PATH 0x04 From owner-svn-src-stable@freebsd.org Thu Feb 11 23:43:29 2016 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 555F4AA634F; Thu, 11 Feb 2016 23:43:29 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 199DCFB1; Thu, 11 Feb 2016 23:43:29 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1BNhSZh058252; Thu, 11 Feb 2016 23:43:28 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1BNhSJA058250; Thu, 11 Feb 2016 23:43:28 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201602112343.u1BNhSJA058250@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Thu, 11 Feb 2016 23:43:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r295551 - in stable/10/sys/boot/efi: libefi loader X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Feb 2016 23:43:29 -0000 Author: imp Date: Thu Feb 11 23:43:27 2016 New Revision: 295551 URL: https://svnweb.freebsd.org/changeset/base/295551 Log: Merge from current r294767,294769,295408 r294767: Parse command line arguments in loader.fi r294769: Allow newlines to be treated as whitespace when parsing args r295408: Implement -P command line option in for EFI booting. Approved by: re@ (gjb@) Modified: stable/10/sys/boot/efi/libefi/libefi.c stable/10/sys/boot/efi/loader/main.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/boot/efi/libefi/libefi.c ============================================================================== --- stable/10/sys/boot/efi/libefi/libefi.c Thu Feb 11 22:33:47 2016 (r295550) +++ stable/10/sys/boot/efi/libefi/libefi.c Thu Feb 11 23:43:27 2016 (r295551) @@ -44,7 +44,7 @@ static CHAR16 * arg_skipsep(CHAR16 *argp) { - while (*argp == ' ' || *argp == '\t') + while (*argp == ' ' || *argp == '\t' || *argp == '\n') argp++; return (argp); } @@ -53,7 +53,7 @@ static CHAR16 * arg_skipword(CHAR16 *argp) { - while (*argp && *argp != ' ' && *argp != '\t') + while (*argp && *argp != ' ' && *argp != '\t' && *argp != '\n') argp++; return (argp); } Modified: stable/10/sys/boot/efi/loader/main.c ============================================================================== --- stable/10/sys/boot/efi/loader/main.c Thu Feb 11 22:33:47 2016 (r295550) +++ stable/10/sys/boot/efi/loader/main.c Thu Feb 11 23:43:27 2016 (r295551) @@ -29,6 +29,8 @@ __FBSDID("$FreeBSD$"); #include +#include +#include #include #include #include @@ -63,6 +65,7 @@ EFI_GUID dxe = DXE_SERVICES_TABLE_GUID; EFI_GUID hoblist = HOB_LIST_TABLE_GUID; EFI_GUID memtype = MEMORY_TYPE_INFORMATION_TABLE_GUID; EFI_GUID debugimg = DEBUG_IMAGE_INFO_TABLE_GUID; +EFI_GUID inputid = SIMPLE_TEXT_INPUT_PROTOCOL; #ifdef EFI_ZFS_BOOT static void efi_zfs_probe(void); @@ -82,16 +85,108 @@ print_str16(const CHAR16 *str) printf("%c", (char)str[i]); } +static void +cp16to8(const CHAR16 *src, char *dst, size_t len) +{ + size_t i; + + for (i = 0; i < len && src[i]; i++) + dst[i] = (char)src[i]; +} + +static int +has_keyboard(void) +{ + EFI_STATUS status; + EFI_DEVICE_PATH *path; + EFI_HANDLE *hin, *hin_end, *walker; + UINTN sz; + int retval = 0; + + /* + * Find all the handles that support the SIMPLE_TEXT_INPUT_PROTOCOL and + * do the typical dance to get the right sized buffer. + */ + sz = 0; + hin = NULL; + status = BS->LocateHandle(ByProtocol, &inputid, 0, &sz, 0); + if (status == EFI_BUFFER_TOO_SMALL) { + hin = (EFI_HANDLE *)malloc(sz); + status = BS->LocateHandle(ByProtocol, &inputid, 0, &sz, + hin); + if (EFI_ERROR(status)) + free(hin); + } + if (EFI_ERROR(status)) + return retval; + + /* + * Look at each of the handles. If it supports the device path protocol, + * use it to get the device path for this handle. Then see if that + * device path matches either the USB device path for keyboards or the + * legacy device path for keyboards. + */ + hin_end = &hin[sz / sizeof(*hin)]; + for (walker = hin; walker < hin_end; walker++) { + status = BS->HandleProtocol(*walker, &devid, (VOID **)&path); + if (EFI_ERROR(status)) + continue; + + while (!IsDevicePathEnd(path)) { + /* + * Check for the ACPI keyboard node. All PNP3xx nodes + * are keyboards of different flavors. Note: It is + * unclear of there's always a keyboard node when + * there's a keyboard controller, or if there's only one + * when a keyboard is detected at boot. + */ + if (DevicePathType(path) == ACPI_DEVICE_PATH && + (DevicePathSubType(path) == ACPI_DP || + DevicePathSubType(path) == ACPI_EXTENDED_DP)) { + ACPI_HID_DEVICE_PATH *acpi; + + acpi = (ACPI_HID_DEVICE_PATH *)(void *)path; + if ((EISA_ID_TO_NUM(acpi->HID) & 0xff00) == 0x300 && + (acpi->HID & 0xffff) == PNP_EISA_ID_CONST) { + retval = 1; + goto out; + } + /* + * Check for USB keyboard node, if present. Unlike a + * PS/2 keyboard, these definitely only appear when + * connected to the system. + */ + } else if (DevicePathType(path) == MESSAGING_DEVICE_PATH && + DevicePathSubType(path) == MSG_USB_CLASS_DP) { + USB_CLASS_DEVICE_PATH *usb; + + usb = (USB_CLASS_DEVICE_PATH *)(void *)path; + if (usb->DeviceClass == 3 && /* HID */ + usb->DeviceSubClass == 1 && /* Boot devices */ + usb->DeviceProtocol == 1) { /* Boot keyboards */ + retval = 1; + goto out; + } + } + path = NextDevicePathNode(path); + } + } +out: + free(hin); + return retval; +} + EFI_STATUS main(int argc, CHAR16 *argv[]) { char var[128]; EFI_LOADED_IMAGE *img; EFI_GUID *guid; - int i, j, vargood, unit; + int i, j, vargood, unit, howto; struct devsw *dev; uint64_t pool_guid; UINTN k; + int has_kbd; archsw.arch_autoload = efi_autoload; archsw.arch_getdev = efi_getdev; @@ -103,6 +198,8 @@ main(int argc, CHAR16 *argv[]) archsw.arch_zfs_probe = efi_zfs_probe; #endif + has_kbd = has_keyboard(); + /* * XXX Chicken-and-egg problem; we want to have console output * early, but some console attributes may depend on reading from @@ -112,27 +209,101 @@ main(int argc, CHAR16 *argv[]) cons_probe(); /* + * Parse the args to set the console settings, etc + * boot1.efi passes these in, if it can read /boot.config or /boot/config + * or iPXE may be setup to pass these in. + * * Loop through the args, and for each one that contains an '=' that is * not the first character, add it to the environment. This allows * loader and kernel env vars to be passed on the command line. Convert * args from UCS-2 to ASCII (16 to 8 bit) as they are copied. */ + howto = 0; for (i = 1; i < argc; i++) { - vargood = 0; - for (j = 0; argv[i][j] != 0; j++) { - if (j == sizeof(var)) { - vargood = 0; - break; + if (argv[i][0] == '-') { + for (j = 1; argv[i][j] != 0; j++) { + int ch; + + ch = argv[i][j]; + switch (ch) { + case 'a': + howto |= RB_ASKNAME; + break; + case 'd': + howto |= RB_KDB; + break; + case 'D': + howto |= RB_MULTIPLE; + break; + case 'h': + howto |= RB_SERIAL; + break; + case 'm': + howto |= RB_MUTE; + break; + case 'p': + howto |= RB_PAUSE; + break; + case 'P': + if (!has_kbd) + howto |= RB_SERIAL | RB_MULTIPLE; + break; + case 'r': + howto |= RB_DFLTROOT; + break; + case 's': + howto |= RB_SINGLE; + break; + case 'S': + if (argv[i][j + 1] == 0) { + if (i + 1 == argc) { + setenv("comconsole_speed", "115200", 1); + } else { + cp16to8(&argv[i + 1][0], var, + sizeof(var)); + setenv("comconsole_speedspeed", var, 1); + } + i++; + break; + } else { + cp16to8(&argv[i][j + 1], var, + sizeof(var)); + setenv("comconsole_speed", var, 1); + break; + } + case 'v': + howto |= RB_VERBOSE; + break; + } + } + } else { + vargood = 0; + for (j = 0; argv[i][j] != 0; j++) { + if (j == sizeof(var)) { + vargood = 0; + break; + } + if (j > 0 && argv[i][j] == '=') + vargood = 1; + var[j] = (char)argv[i][j]; + } + if (vargood) { + var[j] = 0; + putenv(var); } - if (j > 0 && argv[i][j] == '=') - vargood = 1; - var[j] = (char)argv[i][j]; - } - if (vargood) { - var[j] = 0; - putenv(var); } } + for (i = 0; howto_names[i].ev != NULL; i++) + if (howto & howto_names[i].mask) + setenv(howto_names[i].ev, "YES", 1); + if (howto & RB_MULTIPLE) { + if (howto & RB_SERIAL) + setenv("console", "comconsole efi" , 1); + else + setenv("console", "efi comconsole" , 1); + } else if (howto & RB_SERIAL) { + setenv("console", "comconsole" , 1); + } if (efi_copy_init()) { printf("failed to allocate staging area\n"); From owner-svn-src-stable@freebsd.org Fri Feb 12 00:03:40 2016 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CF9E3AA6CB6; Fri, 12 Feb 2016 00:03:40 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9E0281BCE; Fri, 12 Feb 2016 00:03:40 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1C03d3Z064588; Fri, 12 Feb 2016 00:03:39 GMT (envelope-from marius@FreeBSD.org) Received: (from marius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1C03dW1064587; Fri, 12 Feb 2016 00:03:39 GMT (envelope-from marius@FreeBSD.org) Message-Id: <201602120003.u1C03dW1064587@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: marius set sender to marius@FreeBSD.org using -f From: Marius Strobl Date: Fri, 12 Feb 2016 00:03:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r295552 - stable/10/sys/conf X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Feb 2016 00:03:40 -0000 Author: marius Date: Fri Feb 12 00:03:39 2016 New Revision: 295552 URL: https://svnweb.freebsd.org/changeset/base/295552 Log: Update stable/10 to BETA2 in preparation for 10.3-BETA2 builds. Approved by: re (implicit) Modified: stable/10/sys/conf/newvers.sh Modified: stable/10/sys/conf/newvers.sh ============================================================================== --- stable/10/sys/conf/newvers.sh Thu Feb 11 23:43:27 2016 (r295551) +++ stable/10/sys/conf/newvers.sh Fri Feb 12 00:03:39 2016 (r295552) @@ -32,7 +32,7 @@ TYPE="FreeBSD" REVISION="10.3" -BRANCH="BETA1" +BRANCH="BETA2" if [ "X${BRANCH_OVERRIDE}" != "X" ]; then BRANCH=${BRANCH_OVERRIDE} fi From owner-svn-src-stable@freebsd.org Fri Feb 12 11:27:20 2016 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6DBB3AA4601 for ; Fri, 12 Feb 2016 11:27:20 +0000 (UTC) (envelope-from steven.hartland@multiplay.co.uk) Received: from mail-wm0-x236.google.com (mail-wm0-x236.google.com [IPv6:2a00:1450:400c:c09::236]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EACE3179A for ; Fri, 12 Feb 2016 11:27:19 +0000 (UTC) (envelope-from steven.hartland@multiplay.co.uk) Received: by mail-wm0-x236.google.com with SMTP id p63so15284243wmp.1 for ; Fri, 12 Feb 2016 03:27:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=multiplay-co-uk.20150623.gappssmtp.com; s=20150623; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-type:content-transfer-encoding; bh=G6hlHGiHoXLRHDp6Lnr8p67aXO6JephlIDnduNG+mgA=; b=H6iEyDyc7KOejYIJTDcnQIQx1T+I8SY/kKSfhsbZ/joyGj8NX8Ox1cA8dBr1uq7XMY 3Z9CMeqVCnx3KXmEwBIHBDjPIaU1//eSexbBpST6lFhnqXpQ5fed9FSh8QXiD7xMYD41 07xfFDMnHQAXmsqPciA4XNIYUSaOpZyGz+YeYEayAk0JcBqDhDDDygeSlDuCfqhDZSys YF8ClCFGWx5uGBSdWi2zu667xf7eDxdhR7EXkGnCIlDiHHP/COoeFqF+DHGATChU/1qy T0MwCGYGD+nUpgllxAuz1A47zCtM7AiI8N1+71SzMc8vsXMC3rkjafS7WgPp+wk9XeSL 050A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-type :content-transfer-encoding; bh=G6hlHGiHoXLRHDp6Lnr8p67aXO6JephlIDnduNG+mgA=; b=jwLM4PyYPIMA+pJiMyhH6XgqfIm1AZuGZzyHnLcgFcXWtEeK+cnlt4cy6ClE0Efi5B a3NLc+cvhO8GAtxLG4nNGqFm0c/rQbrzw9fV2fhc+WYaSn4355/V5nvtH/jPO1qN1sdJ k98W1uGXpK70cEq5dn+H6mX6JhZzcYTwrjniGPxm0XwaZN25SFmht3c1qepfvP1157HK DZZeSTmvhwCZ51OCre0UDJkhi/8/XF2/FjZpGZ9krQU1H1fS9qdiXDoihuvUI3Z+flhR Ek+cqJn+HY9wyvNhKKNwqDe9cWDoGqCgPoxlyF1RBzpXEVZ1sTFB+ylA351XlgTw9mKv +vFw== X-Gm-Message-State: AG10YOSqUnBdiuG0SABTivQEin+N3OIBqVlAGT9vY4U+m0T+fQqJ/nB/Ap9E/9EZw3PCXH5K X-Received: by 10.194.61.73 with SMTP id n9mr1402443wjr.36.1455276438101; Fri, 12 Feb 2016 03:27:18 -0800 (PST) Received: from [10.10.1.58] (liv3d.labs.multiplay.co.uk. [82.69.141.171]) by smtp.gmail.com with ESMTPSA id i10sm1939201wmf.14.2016.02.12.03.27.16 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 12 Feb 2016 03:27:16 -0800 (PST) Subject: Re: svn commit: r295525 - stable/10/sys/dev/ixgbe To: Sean Bruno , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org References: <201602111635.u1BGZGTs031940@repo.freebsd.org> From: Steven Hartland Message-ID: <56BDC194.6070001@multiplay.co.uk> Date: Fri, 12 Feb 2016 11:27:16 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: <201602111635.u1BGZGTs031940@repo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Feb 2016 11:27:20 -0000 There's a typo here and the unreverted version is still present in head, was this the intention? Clearly the code does limit it to 8, so the old description is more correct, just needs the typo fixing, but I would have expected this to have been corrected in head first and then MFC'ed This was reported to me by Dmitry Luhtionov. Regards Steve On 11/02/2016 16:35, Sean Bruno wrote: > Author: sbruno > Date: Thu Feb 11 16:35:16 2016 > New Revision: 295525 > URL: https://svnweb.freebsd.org/changeset/base/295525 > > Log: > Revert sysctl description change introduced in r295008 to correctly > reflect the maximum number of queues supported (8) by this driver. > > Submitted by: jwd > Reviewed by: erj > Approved by: re (gjb) > Sponsored by: Intel Corporation and Limelight Networks > > Modified: > stable/10/sys/dev/ixgbe/if_ix.c > > Modified: stable/10/sys/dev/ixgbe/if_ix.c > ============================================================================== > --- stable/10/sys/dev/ixgbe/if_ix.c Thu Feb 11 16:16:10 2016 (r295524) > +++ stable/10/sys/dev/ixgbe/if_ix.c Thu Feb 11 16:35:16 2016 (r295525) > @@ -320,7 +320,8 @@ SYSCTL_INT(_hw_ix, OID_AUTO, enable_msix > static int ixgbe_num_queues = 0; > TUNABLE_INT("hw.ix.num_queues", &ixgbe_num_queues); > SYSCTL_INT(_hw_ix, OID_AUTO, num_queues, CTLFLAG_RDTUN, &ixgbe_num_queues, 0, > - "Number of queues to configure, 0 indicates autoconfigure"); > + "Number of queues to configure up to a mximum of 8," > + "0 indicates autoconfigure"); > > /* > ** Number of TX descriptors per ring, > From owner-svn-src-stable@freebsd.org Fri Feb 12 18:13:45 2016 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 39880AA667B; Fri, 12 Feb 2016 18:13:45 +0000 (UTC) (envelope-from dumbbell@FreeBSD.org) Received: from mail.made4.biz (mail.made4.biz [IPv6:2001:41d0:2:c018::1:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 042D7C0A; Fri, 12 Feb 2016 18:13:45 +0000 (UTC) (envelope-from dumbbell@FreeBSD.org) Received: from [176.158.145.63] (helo=magellan.dumbbell.fr) by mail.made4.biz with esmtpsa (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.86 (FreeBSD)) (envelope-from ) id 1aUIDu-00085v-L1; Fri, 12 Feb 2016 19:13:42 +0100 Subject: Re: svn commit: r293857 - stable/10/sys/dev/drm2/i915 To: Slawa Olhovchenkov References: <201601132156.u0DLunQs020854@repo.freebsd.org> <20160123162617.GL37895@zxy.spb.ru> <56A5E89A.3050106@FreeBSD.org> <20160125104506.GV88527@zxy.spb.ru> <56A619C5.6070109@FreeBSD.org> <20160208122910.GZ37895@zxy.spb.ru> Cc: Andriy Voskoboinyk , svn-src-stable@freebsd.org, "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , svn-src-stable-10@freebsd.org From: =?UTF-8?Q?Jean-S=c3=a9bastien_P=c3=a9dron?= Message-ID: <56BE20D2.3080002@FreeBSD.org> Date: Fri, 12 Feb 2016 19:13:38 +0100 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:38.0) Gecko/20100101 Thunderbird/38.5.0 MIME-Version: 1.0 In-Reply-To: <20160208122910.GZ37895@zxy.spb.ru> Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="DFdrGxF1t5AKu8e39ciD1Us4QgRu9wjPg" X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Feb 2016 18:13:45 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --DFdrGxF1t5AKu8e39ciD1Us4QgRu9wjPg Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 08/02/2016 13:29, Slawa Olhovchenkov wrote: > On Mon, Jan 25, 2016 at 01:49:09PM +0100, Jean-S=C3=A9bastien P=C3=A9dr= on wrote: >=20 >> On 25/01/2016 11:50, Andriy Voskoboinyk wrote: >>> Try to apply https://svnweb.freebsd.org/base?view=3Drevision&revision= =3D288653 >>> (as for me, head/sys/dev/drm2/i915/i915_dma.c change fixes this) >> >> If this fixes the problem, perfect, I will merge it. >=20 > BETA builds in actions, do you plan to merge at this time? Hi! I'm going to send a merge request tonight. It should be part of the next BETA or RC (but not BETA2). --=20 Jean-S=C3=A9bastien P=C3=A9dron --DFdrGxF1t5AKu8e39ciD1Us4QgRu9wjPg Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQJ8BAEBCgBmBQJWviDSXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXQ2NzA4N0ZEMUFFQUUwRTEyREJDNkE2RjAz OUU5OTc2MUE1RkQ5NENDAAoJEDnpl2Gl/ZTMmukP/3yb9NAPbdj8rZVIg63AyzY0 IM88oIqdDUpOPncNu+ZLNFi+gMgKTA2PrYvy9pUJxx333E0p1pgIX9/m+G88EUrY jORag+NeZtlHLOfoCDwEJSKCzzghRAc+w4tzseYAV674UtDKUQ1pndDI8r7fGofo gDulEsDJ2FZW4UmSL727uSIgjBs0SmlFnGSnn0+5WuMj7MGj7r9QZapVMbhxqb0u ZvBA/5mJ9/GxxyXFRsl7VAgP78ddYzE70WaFT/wR/orUPaWjNs7P2jPoebxAhOvn YhLRmlBTIbJf5qAOV1QgPXazDa+6pi+WJKT/KeDSVQxyfh/rrkOoBKYsRQj4khuS nmF+vKnJ1R/j0rQgwrOJQecqmx4R4gR40hBI7vcfvd4C6MCGknYJFZt3A9JmD1L6 j8xYjAf8kXrBbXFLmWySpW704OmAXboVBSrEHGL979bYC3G/0A99dLKkctSm2OLL nQYU9LBvGabdFPiILvCMC+MfMddJ9jrtCkRQPM7aTuNYpTzwzNviWirSXGF0u5pN RbuI4hQOPRb3CdUS0ENGrJVd7DaLdGLYNHJNA6vIqy35uwmULBMFV5yC7wbg4o5D 2sR2EEnS5Nc3fEk2ap0pLXolQaZX5BAvoTCUeYWm9p8BAuVCx+oIdkrSarq0rhIl ZuKGl5m51Hk3HgwuGNyg =6kIO -----END PGP SIGNATURE----- --DFdrGxF1t5AKu8e39ciD1Us4QgRu9wjPg-- From owner-svn-src-stable@freebsd.org Fri Feb 12 18:16:57 2016 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BF128AA6874; Fri, 12 Feb 2016 18:16:57 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from zxy.spb.ru (zxy.spb.ru [195.70.199.98]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7DE2FF03; Fri, 12 Feb 2016 18:16:57 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from slw by zxy.spb.ru with local (Exim 4.86 (FreeBSD)) (envelope-from ) id 1aUIH1-0007gV-LD; Fri, 12 Feb 2016 21:16:55 +0300 Date: Fri, 12 Feb 2016 21:16:55 +0300 From: Slawa Olhovchenkov To: =?utf-8?Q?Jean-S=C3=A9bastien_P=C3=A9dron?= Cc: Andriy Voskoboinyk , svn-src-stable@freebsd.org, "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , svn-src-stable-10@freebsd.org Subject: Re: svn commit: r293857 - stable/10/sys/dev/drm2/i915 Message-ID: <20160212181655.GO68298@zxy.spb.ru> References: <201601132156.u0DLunQs020854@repo.freebsd.org> <20160123162617.GL37895@zxy.spb.ru> <56A5E89A.3050106@FreeBSD.org> <20160125104506.GV88527@zxy.spb.ru> <56A619C5.6070109@FreeBSD.org> <20160208122910.GZ37895@zxy.spb.ru> <56BE20D2.3080002@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <56BE20D2.3080002@FreeBSD.org> User-Agent: Mutt/1.5.24 (2015-08-30) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: slw@zxy.spb.ru X-SA-Exim-Scanned: No (on zxy.spb.ru); SAEximRunCond expanded to false X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Feb 2016 18:16:57 -0000 On Fri, Feb 12, 2016 at 07:13:38PM +0100, Jean-Sébastien Pédron wrote: > On 08/02/2016 13:29, Slawa Olhovchenkov wrote: > > On Mon, Jan 25, 2016 at 01:49:09PM +0100, Jean-Sébastien Pédron wrote: > > > >> On 25/01/2016 11:50, Andriy Voskoboinyk wrote: > >>> Try to apply https://svnweb.freebsd.org/base?view=revision&revision=288653 > >>> (as for me, head/sys/dev/drm2/i915/i915_dma.c change fixes this) > >> > >> If this fixes the problem, perfect, I will merge it. > > > > BETA builds in actions, do you plan to merge at this time? > > Hi! > > I'm going to send a merge request tonight. It should be part of the next > BETA or RC (but not BETA2). Thanks! From owner-svn-src-stable@freebsd.org Sat Feb 13 19:24:10 2016 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 75B07AA7D85; Sat, 13 Feb 2016 19:24:10 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from zxy.spb.ru (zxy.spb.ru [195.70.199.98]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3684F15E7; Sat, 13 Feb 2016 19:24:10 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from slw by zxy.spb.ru with local (Exim 4.86 (FreeBSD)) (envelope-from ) id 1aUfnW-000E5S-FA; Sat, 13 Feb 2016 22:24:02 +0300 Date: Sat, 13 Feb 2016 22:24:02 +0300 From: Slawa Olhovchenkov To: Dag-Erling =?utf-8?B?U23DuHJncmF2?= Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: Re: svn commit: r294693 - in stable/10: . crypto/openssh secure/lib/libssh secure/usr.bin/ssh secure/usr.sbin/sshd share/mk tools/build/options Message-ID: <20160213192402.GC37895@zxy.spb.ru> References: <201601242228.u0OMSIn7032949@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <201601242228.u0OMSIn7032949@repo.freebsd.org> User-Agent: Mutt/1.5.24 (2015-08-30) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: slw@zxy.spb.ru X-SA-Exim-Scanned: No (on zxy.spb.ru); SAEximRunCond expanded to false X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Feb 2016 19:24:10 -0000 On Sun, Jan 24, 2016 at 10:28:18PM +0000, Dag-Erling Smørgrav wrote: > Author: des > Date: Sun Jan 24 22:28:18 2016 > New Revision: 294693 > URL: https://svnweb.freebsd.org/changeset/base/294693 > > Log: > MFH (r291198, r291260, r291261, r291375, r294325, r294335, r294563) > > Remove the HPN and None cipher patches. Now ssh terminated if found `noneenabled` in .ssh/config