From owner-dev-commits-src-main@freebsd.org Mon Sep 27 01:40:38 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4F3836AC669; Mon, 27 Sep 2021 01:40:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HHlhQ1rPCz3hG2; Mon, 27 Sep 2021 01:40:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1FBC4299; Mon, 27 Sep 2021 01:40:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18R1ecox092133; Mon, 27 Sep 2021 01:40:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18R1ecnx092132; Mon, 27 Sep 2021 01:40:38 GMT (envelope-from git) Date: Mon, 27 Sep 2021 01:40:38 GMT Message-Id: <202109270140.18R1ecnx092132@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Rick Macklem Subject: git: 62c5be4ab4c8 - main - nfscl: Add a check for "has acquired a delegation" to nfscl_removedeleg() MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 62c5be4ab4c8b8127185286e148638cb8cdf45f4 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Sep 2021 01:40:38 -0000 The branch main has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=62c5be4ab4c8b8127185286e148638cb8cdf45f4 commit 62c5be4ab4c8b8127185286e148638cb8cdf45f4 Author: Rick Macklem AuthorDate: 2021-09-27 01:37:25 +0000 Commit: Rick Macklem CommitDate: 2021-09-27 01:37:25 +0000 nfscl: Add a check for "has acquired a delegation" to nfscl_removedeleg() Commit 5e5ca4c8fc53 added a flag to a NFSv4 mount point that is set when the first delegation is acquired from the NFSv4 server. For a common case where delegations are not being issued by the NFSv4 server, the nfscl_removedeleg() code acquires the mutex lock for open/lock state, finds the delegation list empty, then just unlocks the mutex and returns. This patch adds a check of the flag to avoid the need to acquire the mutex for this common case. This change appears to be performance neutral for a small number of opens, but should reduce lock contention for a large number of opens for the common case where server is not issuing delegations. This commit should not affect the high level semantics of delegation handling. MFC after: 2 weeks --- sys/fs/nfsclient/nfs_clstate.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sys/fs/nfsclient/nfs_clstate.c b/sys/fs/nfsclient/nfs_clstate.c index 8ec5b80489f9..ddbfa40300d8 100644 --- a/sys/fs/nfsclient/nfs_clstate.c +++ b/sys/fs/nfsclient/nfs_clstate.c @@ -4604,6 +4604,12 @@ nfscl_removedeleg(vnode_t vp, NFSPROC_T *p, nfsv4stateid_t *stp) int igotlock = 0, triedrecall = 0, needsrecall, retcnt = 0, islept; nmp = VFSTONFS(vp->v_mount); + NFSLOCKMNT(nmp); + if ((nmp->nm_privflag & NFSMNTP_DELEGISSUED) == 0) { + NFSUNLOCKMNT(nmp); + return (retcnt); + } + NFSUNLOCKMNT(nmp); np = VTONFS(vp); NFSLOCKCLSTATE(); /* From owner-dev-commits-src-main@freebsd.org Mon Sep 27 03:59:33 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3553F6ADF90; Mon, 27 Sep 2021 03:59:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HHpmh73hmz3qTd; Mon, 27 Sep 2021 03:59:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D469820C2; Mon, 27 Sep 2021 03:59:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18R3xWex068759; Mon, 27 Sep 2021 03:59:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18R3xWrG068758; Mon, 27 Sep 2021 03:59:32 GMT (envelope-from git) Date: Mon, 27 Sep 2021 03:59:32 GMT Message-Id: <202109270359.18R3xWrG068758@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alan Somers Subject: git: a3a1ce3794e8 - main - fusefs: diff reduction in fuse_kernel.h MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: asomers X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a3a1ce3794e85fe27cb5af5e9f48a490a9ef70c2 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Sep 2021 03:59:33 -0000 The branch main has been updated by asomers: URL: https://cgit.FreeBSD.org/src/commit/?id=a3a1ce3794e85fe27cb5af5e9f48a490a9ef70c2 commit a3a1ce3794e85fe27cb5af5e9f48a490a9ef70c2 Author: Alan Somers AuthorDate: 2021-09-25 14:23:54 +0000 Commit: Alan Somers CommitDate: 2021-09-27 03:57:07 +0000 fusefs: diff reduction in fuse_kernel.h Synchronize formatting and documentation in fuse_kernel.h with upstream sources. MFC after: 2 weeks Reviewed by: pfg Differential Revision: https://reviews.freebsd.org/D32141 --- sys/fs/fuse/fuse_internal.c | 2 +- sys/fs/fuse/fuse_kernel.h | 85 ++++++++++++++++++++++++++++++++++++++++----- 2 files changed, 77 insertions(+), 10 deletions(-) diff --git a/sys/fs/fuse/fuse_internal.c b/sys/fs/fuse/fuse_internal.c index 82e37ed5a466..731ac9c2ba24 100644 --- a/sys/fs/fuse/fuse_internal.c +++ b/sys/fs/fuse/fuse_internal.c @@ -363,7 +363,7 @@ fuse_internal_fsync(struct vnode *vp, ffsi->fsync_flags = 0; if (datasync) - ffsi->fsync_flags = 1; + ffsi->fsync_flags = FUSE_FSYNC_FDATASYNC; if (waitfor == MNT_WAIT) { err = fdisp_wait_answ(&fdi); diff --git a/sys/fs/fuse/fuse_kernel.h b/sys/fs/fuse/fuse_kernel.h index 14cf4fabac14..bd7323e9def2 100644 --- a/sys/fs/fuse/fuse_kernel.h +++ b/sys/fs/fuse/fuse_kernel.h @@ -41,22 +41,61 @@ * * Protocol changelog: * + * 7.1: + * - add the following messages: + * FUSE_SETATTR, FUSE_SYMLINK, FUSE_MKNOD, FUSE_MKDIR, FUSE_UNLINK, + * FUSE_RMDIR, FUSE_RENAME, FUSE_LINK, FUSE_OPEN, FUSE_READ, FUSE_WRITE, + * FUSE_RELEASE, FUSE_FSYNC, FUSE_FLUSH, FUSE_SETXATTR, FUSE_GETXATTR, + * FUSE_LISTXATTR, FUSE_REMOVEXATTR, FUSE_OPENDIR, FUSE_READDIR, + * FUSE_RELEASEDIR + * - add padding to messages to accommodate 32-bit servers on 64-bit kernels + * + * 7.2: + * - add FOPEN_DIRECT_IO and FOPEN_KEEP_CACHE flags + * - add FUSE_FSYNCDIR message + * + * 7.3: + * - add FUSE_ACCESS message + * - add FUSE_CREATE message + * - add filehandle to fuse_setattr_in + * + * 7.4: + * - add frsize to fuse_kstatfs + * - clean up request size limit checking + * + * 7.5: + * - add flags and max_write to fuse_init_out + * + * 7.6: + * - add max_readahead to fuse_init_in and fuse_init_out + * + * 7.7: + * - add FUSE_INTERRUPT message + * - add POSIX file lock support + * + * 7.8: + * - add lock_owner and flags fields to fuse_release_in + * - add FUSE_BMAP message + * - add FUSE_DESTROY message + * * 7.9: * - new fuse_getattr_in input argument of GETATTR * - add lk_flags in fuse_lk_in * - add lock_owner field to fuse_setattr_in, fuse_read_in and fuse_write_in * - add blksize field to fuse_attr * - add file flags field to fuse_read_in and fuse_write_in + * - Add ATIME_NOW and MTIME_NOW flags to fuse_setattr_in * * 7.10 * - add nonseekable open flag * - * 7.11 + * 7.11 * - add IOCTL message * - add unsolicited notification support + * - add POLL message and NOTIFY_POLL notification * - * 7.12 - * - add umask flag to input argument of open, mknod and mkdir + * 7.12 + * - add umask flag to input argument of create, mknod and mkdir * - add notification messages for invalidation of inodes and * directory entries * @@ -89,6 +128,7 @@ * * 7.20 * - add FUSE_AUTO_INVAL_DATA + * * 7.21 * - add FUSE_READDIRPLUS * - send the requested events in POLL request @@ -105,7 +145,7 @@ * - add FUSE_RENAME2 request * - add FUSE_NO_OPEN_SUPPORT flag * - * 7.24 + * 7.24 * - add FUSE_LSEEK for SEEK_HOLE and SEEK_DATA support * * 7.25 @@ -134,6 +174,26 @@ #include #endif +/* + * Version negotiation: + * + * Both the kernel and userspace send the version they support in the + * INIT request and reply respectively. + * + * If the major versions match then both shall use the smallest + * of the two minor versions for communication. + * + * If the kernel supports a larger major version, then userspace shall + * reply with the major version it supports, ignore the rest of the + * INIT message and expect a new INIT message from the kernel with a + * matching major version. + * + * If the library supports a larger major version, then it shall fall + * back to the major protocol version sent by the kernel for + * communication and reply with that major version (and an arbitrary + * supported minor version). + */ + /** Version number of this interface */ #define FUSE_KERNEL_VERSION 7 @@ -331,6 +391,13 @@ struct fuse_file_lock { */ #define FUSE_POLL_SCHEDULE_NOTIFY (1 << 0) +/** + * Fsync flags + * + * FUSE_FSYNC_FDATASYNC: Sync data only, not metadata + */ +#define FUSE_FSYNC_FDATASYNC (1 << 0) + enum fuse_opcode { FUSE_LOOKUP = 1, FUSE_FORGET = 2, /* no reply */ @@ -791,14 +858,14 @@ struct fuse_notify_retrieve_in { }; struct fuse_lseek_in { - uint64_t fh; - uint64_t offset; - uint32_t whence; - uint32_t padding; + uint64_t fh; + uint64_t offset; + uint32_t whence; + uint32_t padding; }; struct fuse_lseek_out { - uint64_t offset; + uint64_t offset; }; struct fuse_copy_file_range_in { From owner-dev-commits-src-main@freebsd.org Mon Sep 27 03:59:34 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8CFB86ADBCE; Mon, 27 Sep 2021 03:59:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HHpmk28jDz3q7P; Mon, 27 Sep 2021 03:59:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F1B5B1F39; Mon, 27 Sep 2021 03:59:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18R3xXY2068783; Mon, 27 Sep 2021 03:59:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18R3xXSV068782; Mon, 27 Sep 2021 03:59:33 GMT (envelope-from git) Date: Mon, 27 Sep 2021 03:59:33 GMT Message-Id: <202109270359.18R3xXSV068782@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alan Somers Subject: git: 7124d2bc3a3b - main - fusefs: implement FUSE_NO_OPEN_SUPPORT and FUSE_NO_OPENDIR_SUPPORT MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: asomers X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 7124d2bc3a3bd58f6d3803a0579f2e0fa853b56d Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Sep 2021 03:59:34 -0000 The branch main has been updated by asomers: URL: https://cgit.FreeBSD.org/src/commit/?id=7124d2bc3a3bd58f6d3803a0579f2e0fa853b56d commit 7124d2bc3a3bd58f6d3803a0579f2e0fa853b56d Author: Alan Somers AuthorDate: 2021-09-25 03:53:28 +0000 Commit: Alan Somers CommitDate: 2021-09-27 03:57:29 +0000 fusefs: implement FUSE_NO_OPEN_SUPPORT and FUSE_NO_OPENDIR_SUPPORT For file systems that allow it, fusefs will skip FUSE_OPEN, FUSE_RELEASE, FUSE_OPENDIR, and FUSE_RELEASEDIR operations, a minor optimization. MFC after: 2 weeks Reviewed by: pfg Differential Revision: https://reviews.freebsd.org/D32141 --- sys/fs/fuse/fuse_file.c | 65 +++++++++++++++++++++++++++++------------ sys/fs/fuse/fuse_file.h | 3 +- sys/fs/fuse/fuse_internal.c | 8 +++-- sys/fs/fuse/fuse_ipc.h | 2 ++ sys/fs/fuse/fuse_kernel.h | 4 ++- tests/sys/fs/fusefs/open.cc | 66 ++++++++++++++++++++++++++++++++++++++++++ tests/sys/fs/fusefs/opendir.cc | 48 ++++++++++++++++++++++++++++++ 7 files changed, 174 insertions(+), 22 deletions(-) diff --git a/sys/fs/fuse/fuse_file.c b/sys/fs/fuse/fuse_file.c index f9b0c781f49a..a7357d85a8b3 100644 --- a/sys/fs/fuse/fuse_file.c +++ b/sys/fs/fuse/fuse_file.c @@ -124,44 +124,68 @@ int fuse_filehandle_open(struct vnode *vp, int a_mode, struct fuse_filehandle **fufhp, struct thread *td, struct ucred *cred) { + struct mount *mp = vnode_mount(vp); + struct fuse_data *data = fuse_get_mpdata(mp); struct fuse_dispatcher fdi; - struct fuse_open_in *foi; - struct fuse_open_out *foo; + const struct fuse_open_out default_foo = { + .fh = 0, + .open_flags = FOPEN_KEEP_CACHE, + .padding = 0 + }; + struct fuse_open_in *foi = NULL; + const struct fuse_open_out *foo; fufh_type_t fufh_type; - + int dataflags = data->dataflags; int err = 0; int oflags = 0; int op = FUSE_OPEN; + int relop = FUSE_RELEASE; + int fsess_no_op_support = FSESS_NO_OPEN_SUPPORT; fufh_type = fflags_2_fufh_type(a_mode); oflags = fufh_type_2_fflags(fufh_type); if (vnode_isdir(vp)) { op = FUSE_OPENDIR; + relop = FUSE_RELEASEDIR; + fsess_no_op_support = FSESS_NO_OPENDIR_SUPPORT; /* vn_open_vnode already rejects FWRITE on directories */ MPASS(fufh_type == FUFH_RDONLY || fufh_type == FUFH_EXEC); } fdisp_init(&fdi, sizeof(*foi)); - fdisp_make_vp(&fdi, op, vp, td, cred); - - foi = fdi.indata; - foi->flags = oflags; - - if ((err = fdisp_wait_answ(&fdi))) { - SDT_PROBE2(fusefs, , file, trace, 1, - "OUCH ... daemon didn't give fh"); - if (err == ENOENT) { - fuse_internal_vnode_disappear(vp); + if (fsess_not_impl(mp, op) && dataflags & fsess_no_op_support) { + /* The operation implicitly succeeds */ + foo = &default_foo; + } else { + fdisp_make_vp(&fdi, op, vp, td, cred); + + foi = fdi.indata; + foi->flags = oflags; + + err = fdisp_wait_answ(&fdi); + if (err == ENOSYS && dataflags & fsess_no_op_support) { + /* The operation implicitly succeeds */ + foo = &default_foo; + fsess_set_notimpl(mp, op); + fsess_set_notimpl(mp, relop); + err = 0; + } else if (err) { + SDT_PROBE2(fusefs, , file, trace, 1, + "OUCH ... daemon didn't give fh"); + if (err == ENOENT) + fuse_internal_vnode_disappear(vp); + goto out; + } else { + foo = fdi.answ; } - goto out; } - foo = fdi.answ; fuse_filehandle_init(vp, fufh_type, fufhp, td, cred, foo); fuse_vnode_open(vp, foo->open_flags, td); out: - fdisp_destroy(&fdi); + if (foi) + fdisp_destroy(&fdi); return err; } @@ -169,6 +193,7 @@ int fuse_filehandle_close(struct vnode *vp, struct fuse_filehandle *fufh, struct thread *td, struct ucred *cred) { + struct mount *mp = vnode_mount(vp); struct fuse_dispatcher fdi; struct fuse_release_in *fri; @@ -180,6 +205,10 @@ fuse_filehandle_close(struct vnode *vp, struct fuse_filehandle *fufh, } if (vnode_isdir(vp)) op = FUSE_RELEASEDIR; + + if (fsess_not_impl(mp, op)) + goto out; + fdisp_init(&fdi, sizeof(*fri)); fdisp_make_vp(&fdi, op, vp, td, cred); fri = fdi.indata; @@ -327,8 +356,8 @@ fuse_filehandle_getrw(struct vnode *vp, int fflag, void fuse_filehandle_init(struct vnode *vp, fufh_type_t fufh_type, - struct fuse_filehandle **fufhp, struct thread *td, struct ucred *cred, - struct fuse_open_out *foo) + struct fuse_filehandle **fufhp, struct thread *td, const struct ucred *cred, + const struct fuse_open_out *foo) { struct fuse_vnode_data *fvdat = VTOFUD(vp); struct fuse_filehandle *fufh; diff --git a/sys/fs/fuse/fuse_file.h b/sys/fs/fuse/fuse_file.h index 10c799d5d40d..25004beead51 100644 --- a/sys/fs/fuse/fuse_file.h +++ b/sys/fs/fuse/fuse_file.h @@ -211,7 +211,8 @@ int fuse_filehandle_getrw(struct vnode *vp, int fflag, void fuse_filehandle_init(struct vnode *vp, fufh_type_t fufh_type, struct fuse_filehandle **fufhp, struct thread *td, - struct ucred *cred, struct fuse_open_out *foo); + const struct ucred *cred, + const struct fuse_open_out *foo); int fuse_filehandle_open(struct vnode *vp, int mode, struct fuse_filehandle **fufhp, struct thread *td, struct ucred *cred); diff --git a/sys/fs/fuse/fuse_internal.c b/sys/fs/fuse/fuse_internal.c index 731ac9c2ba24..c52f12d3a71a 100644 --- a/sys/fs/fuse/fuse_internal.c +++ b/sys/fs/fuse/fuse_internal.c @@ -1009,6 +1009,10 @@ fuse_internal_init_callback(struct fuse_ticket *tick, struct uio *uio) data->dataflags |= FSESS_POSIX_LOCKS; if (fiio->flags & FUSE_EXPORT_SUPPORT) data->dataflags |= FSESS_EXPORT_SUPPORT; + if (fiio->flags & FUSE_NO_OPEN_SUPPORT) + data->dataflags |= FSESS_NO_OPEN_SUPPORT; + if (fiio->flags & FUSE_NO_OPENDIR_SUPPORT) + data->dataflags |= FSESS_NO_OPENDIR_SUPPORT; /* * Don't bother to check FUSE_BIG_WRITES, because it's * redundant with max_write @@ -1098,7 +1102,6 @@ fuse_internal_send_init(struct fuse_data *data, struct thread *td) * FUSE_DO_READDIRPLUS: not yet implemented * FUSE_READDIRPLUS_AUTO: not yet implemented * FUSE_ASYNC_DIO: not yet implemented - * FUSE_NO_OPEN_SUPPORT: not yet implemented * FUSE_PARALLEL_DIROPS: not yet implemented * FUSE_HANDLE_KILLPRIV: not yet implemented * FUSE_POSIX_ACL: not yet implemented @@ -1107,7 +1110,8 @@ fuse_internal_send_init(struct fuse_data *data, struct thread *td) * FUSE_MAX_PAGES: not yet implemented */ fiii->flags = FUSE_ASYNC_READ | FUSE_POSIX_LOCKS | FUSE_EXPORT_SUPPORT - | FUSE_BIG_WRITES | FUSE_WRITEBACK_CACHE; + | FUSE_BIG_WRITES | FUSE_WRITEBACK_CACHE + | FUSE_NO_OPEN_SUPPORT | FUSE_NO_OPENDIR_SUPPORT; fuse_insert_callback(fdi.tick, fuse_internal_init_callback); fuse_insert_message(fdi.tick, false); diff --git a/sys/fs/fuse/fuse_ipc.h b/sys/fs/fuse/fuse_ipc.h index 7b27fd97e212..fe616b3639a7 100644 --- a/sys/fs/fuse/fuse_ipc.h +++ b/sys/fs/fuse/fuse_ipc.h @@ -229,6 +229,8 @@ struct fuse_data { /* (and being observed by the daemon) */ #define FSESS_PUSH_SYMLINKS_IN 0x0020 /* prefix absolute symlinks with mp */ #define FSESS_DEFAULT_PERMISSIONS 0x0040 /* kernel does permission checking */ +#define FSESS_NO_OPEN_SUPPORT 0x0080 /* can elide FUSE_OPEN ops */ +#define FSESS_NO_OPENDIR_SUPPORT 0x0100 /* can elide FUSE_OPENDIR ops */ #define FSESS_ASYNC_READ 0x1000 /* allow multiple reads of some file */ #define FSESS_POSIX_LOCKS 0x2000 /* daemon supports POSIX locks */ #define FSESS_EXPORT_SUPPORT 0x10000 /* daemon supports NFS-style lookups */ diff --git a/sys/fs/fuse/fuse_kernel.h b/sys/fs/fuse/fuse_kernel.h index bd7323e9def2..51445637b9a8 100644 --- a/sys/fs/fuse/fuse_kernel.h +++ b/sys/fs/fuse/fuse_kernel.h @@ -198,7 +198,7 @@ #define FUSE_KERNEL_VERSION 7 /** Minor version number of this interface */ -#define FUSE_KERNEL_MINOR_VERSION 28 +#define FUSE_KERNEL_MINOR_VERSION 29 /** The node ID of the root inode */ #define FUSE_ROOT_ID 1 @@ -300,6 +300,7 @@ struct fuse_file_lock { * FUSE_ABORT_ERROR: reading the device after abort returns ECONNABORTED * FUSE_MAX_PAGES: init_out.max_pages contains the max number of req pages * FUSE_CACHE_SYMLINKS: cache READLINK responses + * FUSE_NO_OPENDIR_SUPPORT: kernel supports zero-message opendir */ #define FUSE_ASYNC_READ (1 << 0) #define FUSE_POSIX_LOCKS (1 << 1) @@ -325,6 +326,7 @@ struct fuse_file_lock { #define FUSE_ABORT_ERROR (1 << 21) #define FUSE_MAX_PAGES (1 << 22) #define FUSE_CACHE_SYMLINKS (1 << 23) +#define FUSE_NO_OPENDIR_SUPPORT (1 << 24) #ifdef linux /** diff --git a/tests/sys/fs/fusefs/open.cc b/tests/sys/fs/fusefs/open.cc index ede7ea9f04f7..7ac177a65d14 100644 --- a/tests/sys/fs/fusefs/open.cc +++ b/tests/sys/fs/fusefs/open.cc @@ -73,6 +73,13 @@ void test_ok(int os_flags, int fuse_flags) { }; +class OpenNoOpenSupport: public FuseTest { + virtual void SetUp() { + m_init_flags = FUSE_NO_OPEN_SUPPORT; + FuseTest::SetUp(); + } +}; + /* * fusefs(5) does not support I/O on device nodes (neither does UFS). But it * shouldn't crash @@ -274,3 +281,62 @@ TEST_F(Open, o_rdwr) test_ok(O_RDWR, O_RDWR); } +/* + * Without FUSE_NO_OPEN_SUPPORT, returning ENOSYS is an error + */ +TEST_F(Open, enosys) +{ + const char FULLPATH[] = "mountpoint/some_file.txt"; + const char RELPATH[] = "some_file.txt"; + uint64_t ino = 42; + int fd; + + FuseTest::expect_lookup(RELPATH, ino, S_IFREG | 0644, 0, 1); + EXPECT_CALL(*m_mock, process( + ResultOf([=](auto in) { + return (in.header.opcode == FUSE_OPEN && + in.body.open.flags == (uint32_t)O_RDONLY && + in.header.nodeid == ino); + }, Eq(true)), + _) + ).Times(1) + .WillOnce(Invoke(ReturnErrno(ENOSYS))); + + fd = open(FULLPATH, O_RDONLY); + ASSERT_EQ(-1, fd) << strerror(errno); + EXPECT_EQ(ENOSYS, errno); +} + +/* + * If a fuse server sets FUSE_NO_OPEN_SUPPORT and returns ENOSYS to a + * FUSE_OPEN, then it and subsequent FUSE_OPEN and FUSE_RELEASE operations will + * also succeed automatically without being sent to the server. + */ +TEST_F(OpenNoOpenSupport, enosys) +{ + const char FULLPATH[] = "mountpoint/some_file.txt"; + const char RELPATH[] = "some_file.txt"; + uint64_t ino = 42; + int fd; + + FuseTest::expect_lookup(RELPATH, ino, S_IFREG | 0644, 0, 2); + EXPECT_CALL(*m_mock, process( + ResultOf([=](auto in) { + return (in.header.opcode == FUSE_OPEN && + in.body.open.flags == (uint32_t)O_RDONLY && + in.header.nodeid == ino); + }, Eq(true)), + _) + ).Times(1) + .WillOnce(Invoke(ReturnErrno(ENOSYS))); + expect_flush(ino, 1, ReturnErrno(ENOSYS)); + + fd = open(FULLPATH, O_RDONLY); + ASSERT_LE(0, fd) << strerror(errno); + close(fd); + + fd = open(FULLPATH, O_RDONLY); + ASSERT_LE(0, fd) << strerror(errno); + + leak(fd); +} diff --git a/tests/sys/fs/fusefs/opendir.cc b/tests/sys/fs/fusefs/opendir.cc index 7943be3124ca..365aa8dff9e2 100644 --- a/tests/sys/fs/fusefs/opendir.cc +++ b/tests/sys/fs/fusefs/opendir.cc @@ -73,6 +73,13 @@ void expect_opendir(uint64_t ino, uint32_t flags, ProcessMockerT r) }; +class OpendirNoOpendirSupport: public Opendir { + virtual void SetUp() { + m_init_flags = FUSE_NO_OPENDIR_SUPPORT; + FuseTest::SetUp(); + } +}; + /* * The fuse daemon fails the request with enoent. This usually indicates a @@ -172,3 +179,44 @@ TEST_F(Opendir, opendir) errno = 0; EXPECT_NE(nullptr, opendir(FULLPATH)) << strerror(errno); } + +/* + * Without FUSE_NO_OPENDIR_SUPPORT, returning ENOSYS is an error + */ +TEST_F(Opendir, enosys) +{ + const char FULLPATH[] = "mountpoint/some_file.txt"; + const char RELPATH[] = "some_file.txt"; + uint64_t ino = 42; + + expect_lookup(RELPATH, ino); + expect_opendir(ino, O_RDONLY, ReturnErrno(ENOSYS)); + + EXPECT_EQ(-1, open(FULLPATH, O_DIRECTORY)); + EXPECT_EQ(ENOSYS, errno); +} + +/* + * If a fuse server sets FUSE_NO_OPENDIR_SUPPORT and returns ENOSYS to a + * FUSE_OPENDIR, then it and subsequent FUSE_OPENDIR and FUSE_RELEASEDIR + * operations will also succeed automatically without being sent to the server. + */ +TEST_F(OpendirNoOpendirSupport, enosys) +{ + const char FULLPATH[] = "mountpoint/some_file.txt"; + const char RELPATH[] = "some_file.txt"; + uint64_t ino = 42; + int fd; + + FuseTest::expect_lookup(RELPATH, ino, S_IFDIR | 0755, 0, 2); + expect_opendir(ino, O_RDONLY, ReturnErrno(ENOSYS)); + + fd = open(FULLPATH, O_DIRECTORY); + ASSERT_LE(0, fd) << strerror(errno); + close(fd); + + fd = open(FULLPATH, O_DIRECTORY); + ASSERT_LE(0, fd) << strerror(errno); + + leak(fd); +} From owner-dev-commits-src-main@freebsd.org Mon Sep 27 05:13:19 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BA16E6AEB30; Mon, 27 Sep 2021 05:13:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HHrPq35tWz3tRt; Mon, 27 Sep 2021 05:13:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4A5512DFC; Mon, 27 Sep 2021 05:13:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18R5DJWP074844; Mon, 27 Sep 2021 05:13:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18R5DJKV074843; Mon, 27 Sep 2021 05:13:19 GMT (envelope-from git) Date: Mon, 27 Sep 2021 05:13:19 GMT Message-Id: <202109270513.18R5DJKV074843@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Piotr Pawel Stefaniak Subject: git: 260f26f035af - main - mount: make libxo support more locale-aware MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: pstef X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 260f26f035af2095a1b55c04439f479c49e4056c Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Sep 2021 05:13:19 -0000 The branch main has been updated by pstef: URL: https://cgit.FreeBSD.org/src/commit/?id=260f26f035af2095a1b55c04439f479c49e4056c commit 260f26f035af2095a1b55c04439f479c49e4056c Author: Piotr Pawel Stefaniak AuthorDate: 2021-09-26 20:50:28 +0000 Commit: Piotr Pawel Stefaniak CommitDate: 2021-09-27 05:12:26 +0000 mount: make libxo support more locale-aware "special", "node", and "mounter" are not guaranteed to be encoded with UTF-8. Use the appropriate modifier. Reported by: eugen@ --- sbin/mount/mount.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sbin/mount/mount.c b/sbin/mount/mount.c index 80eda100c66f..9550ecd1c54e 100644 --- a/sbin/mount/mount.c +++ b/sbin/mount/mount.c @@ -671,7 +671,7 @@ prmount(struct statfs *sfp) struct passwd *pw; char *fsidbuf; - xo_emit("{:special}{L: on }{:node}{L: (}{:fstype}", sfp->f_mntfromname, + xo_emit("{:special/%hs}{L: on }{:node/%hs}{L: (}{:fstype}", sfp->f_mntfromname, sfp->f_mntonname, sfp->f_fstypename); flags = sfp->f_flags & MNT_VISFLAGMASK; @@ -687,9 +687,9 @@ prmount(struct statfs *sfp) if ((flags & MNT_USER) != 0 || sfp->f_owner != 0) { xo_emit("{D:, }{L:mounted by }"); if ((pw = getpwuid(sfp->f_owner)) != NULL) - xo_emit("{:mounter}", pw->pw_name); + xo_emit("{:mounter/%hs}", pw->pw_name); else - xo_emit("{:mounter}", sfp->f_owner); + xo_emit("{:mounter/%hs}", sfp->f_owner); } if (verbose) { if (sfp->f_syncwrites != 0 || sfp->f_asyncwrites != 0) { From owner-dev-commits-src-main@freebsd.org Mon Sep 27 05:46:07 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B69FE6AF306; Mon, 27 Sep 2021 05:46:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HHs7g20hYz3w2n; Mon, 27 Sep 2021 05:46:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 22169391F; Mon, 27 Sep 2021 05:46:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18R5k7hP014790; Mon, 27 Sep 2021 05:46:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18R5k7vE014789; Mon, 27 Sep 2021 05:46:07 GMT (envelope-from git) Date: Mon, 27 Sep 2021 05:46:07 GMT Message-Id: <202109270546.18R5k7vE014789@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Wojciech Macek Subject: git: c27214f0afa5 - main - ipsec: fix typo in comment MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: wma X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c27214f0afa526b9545dc7509e409e81978bf873 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Sep 2021 05:46:07 -0000 The branch main has been updated by wma: URL: https://cgit.FreeBSD.org/src/commit/?id=c27214f0afa526b9545dc7509e409e81978bf873 commit c27214f0afa526b9545dc7509e409e81978bf873 Author: Wojciech Macek AuthorDate: 2021-09-27 05:45:33 +0000 Commit: Wojciech Macek CommitDate: 2021-09-27 05:45:33 +0000 ipsec: fix typo in comment --- sys/netipsec/ipsec_output.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/netipsec/ipsec_output.c b/sys/netipsec/ipsec_output.c index 9beb5c47444f..230e316ea77d 100644 --- a/sys/netipsec/ipsec_output.c +++ b/sys/netipsec/ipsec_output.c @@ -344,7 +344,7 @@ setdf: if (m_length(m, NULL) + hlen > pmtu) { /* * If we're forwarding generate ICMP message here, - * so that it contains pmtu substraced by header size. + * so that it contains pmtu subtraced by header size. * Set error to EINPROGRESS, in order for the frame * to be dropped silently. */ @@ -738,7 +738,7 @@ ipsec6_check_pmtu(struct mbuf *m, struct secpolicy *sp, int forwarding) if (m_length(m, NULL) + hlen > pmtu) { /* * If we're forwarding generate ICMPv6 message here, - * so that it contains pmtu substracted by header size. + * so that it contains pmtu subtracted by header size. * Set error to EINPROGRESS, in order for the frame * to be dropped silently. */ From owner-dev-commits-src-main@freebsd.org Mon Sep 27 05:47:26 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 198096AF140; Mon, 27 Sep 2021 05:47:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HHs995yn8z3wPs; Mon, 27 Sep 2021 05:47:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id ACD313A01; Mon, 27 Sep 2021 05:47:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18R5lPwf014984; Mon, 27 Sep 2021 05:47:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18R5lPmn014983; Mon, 27 Sep 2021 05:47:25 GMT (envelope-from git) Date: Mon, 27 Sep 2021 05:47:25 GMT Message-Id: <202109270547.18R5lPmn014983@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Wojciech Macek Subject: git: 8deba29c0a63 - main - ipsec: fix typo part2 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: wma X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 8deba29c0a63e812c8a30249ea4a004dc85cdd3f Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Sep 2021 05:47:26 -0000 The branch main has been updated by wma: URL: https://cgit.FreeBSD.org/src/commit/?id=8deba29c0a63e812c8a30249ea4a004dc85cdd3f commit 8deba29c0a63e812c8a30249ea4a004dc85cdd3f Author: Wojciech Macek AuthorDate: 2021-09-27 05:46:56 +0000 Commit: Wojciech Macek CommitDate: 2021-09-27 05:46:56 +0000 ipsec: fix typo part2 --- sys/netipsec/ipsec_output.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/netipsec/ipsec_output.c b/sys/netipsec/ipsec_output.c index 230e316ea77d..0a722140f93e 100644 --- a/sys/netipsec/ipsec_output.c +++ b/sys/netipsec/ipsec_output.c @@ -344,7 +344,7 @@ setdf: if (m_length(m, NULL) + hlen > pmtu) { /* * If we're forwarding generate ICMP message here, - * so that it contains pmtu subtraced by header size. + * so that it contains pmtu subtracted by header size. * Set error to EINPROGRESS, in order for the frame * to be dropped silently. */ From owner-dev-commits-src-main@freebsd.org Mon Sep 27 06:11:17 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CE9656AF74B; Mon, 27 Sep 2021 06:11:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HHshj5KFLz4TN8; Mon, 27 Sep 2021 06:11:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 968BA3AC0; Mon, 27 Sep 2021 06:11:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18R6BHNE054018; Mon, 27 Sep 2021 06:11:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18R6BH7m054017; Mon, 27 Sep 2021 06:11:17 GMT (envelope-from git) Date: Mon, 27 Sep 2021 06:11:17 GMT Message-Id: <202109270611.18R6BH7m054017@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Yasuhiro Kimura Subject: git: 77087b11e222 - main - Add myself as ports committer and update mentor/mentee information MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: yasu X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 77087b11e222a4b21e0c72bd3d82ace0bfdf511b Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Sep 2021 06:11:17 -0000 The branch main has been updated by yasu (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=77087b11e222a4b21e0c72bd3d82ace0bfdf511b commit 77087b11e222a4b21e0c72bd3d82ace0bfdf511b Author: Yasuhiro Kimura AuthorDate: 2021-09-27 05:37:16 +0000 Commit: Yasuhiro Kimura CommitDate: 2021-09-27 06:10:47 +0000 Add myself as ports committer and update mentor/mentee information It corresponds to the 5th step of the procedure described in section 7.1 of Committer's Guide. Approved by: meta (mentor) Differential Revision: https://reviews.freebsd.org/D32151 --- share/misc/committers-ports.dot | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/share/misc/committers-ports.dot b/share/misc/committers-ports.dot index da65d0641dba..b8b74f5c25a0 100644 --- a/share/misc/committers-ports.dot +++ b/share/misc/committers-ports.dot @@ -292,6 +292,7 @@ woodsb02 [label="Ben Woods\nwoodsb02@FreeBSD.org\n2016/05/09"] wxs [label="Wesley Shields\nwxs@FreeBSD.org\n2008/01/03"] xmj [label="Johannes Jost Meixner\nxmj@FreeBSD.org\n2014/04/07"] xride [label="Soeren Straarup\nxride@FreeBSD.org\n2006/09/27"] +yasu [label="Yasuhiro Kimura\nyasu@FreeBSD.org\n2021/08/27"] ygy [label="Guangyuan Yang\nygy@FreeBSD.org\n2021/05/17"] yuri [label="Yuri Victorovich\nyuri@FreeBSD.org\n2017/10/30"] yzlin [label="Yi-Jheng Lin\nyzlin@FreeBSD.org\n2009/07/19"] @@ -607,6 +608,8 @@ matthew -> leres matthew -> lifanov matthew -> ultima +meta -> yasu + mezz -> tmclaugh miwi -> amdmi3 @@ -816,4 +819,6 @@ wxs -> skreuzer wxs -> swills wxs -> zi +ygy -> yasu + } From owner-dev-commits-src-main@freebsd.org Mon Sep 27 07:32:11 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 76C176B0616; Mon, 27 Sep 2021 07:32:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HHvV32s8zz4YPT; Mon, 27 Sep 2021 07:32:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 42BA95191; Mon, 27 Sep 2021 07:32:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18R7WBGG061285; Mon, 27 Sep 2021 07:32:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18R7WB1h061284; Mon, 27 Sep 2021 07:32:11 GMT (envelope-from git) Date: Mon, 27 Sep 2021 07:32:11 GMT Message-Id: <202109270732.18R7WB1h061284@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Eugene Grosbein Subject: git: 3b4cc56e524a - main - syslogd: undo regression after r326573 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: eugen X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3b4cc56e524ac947ba0e6571e2c455139c2839ec Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Sep 2021 07:32:11 -0000 The branch main has been updated by eugen: URL: https://cgit.FreeBSD.org/src/commit/?id=3b4cc56e524ac947ba0e6571e2c455139c2839ec commit 3b4cc56e524ac947ba0e6571e2c455139c2839ec Author: Eugene Grosbein AuthorDate: 2021-09-27 07:25:21 +0000 Commit: Eugene Grosbein CommitDate: 2021-09-27 07:25:21 +0000 syslogd: undo regression after r326573 Restore ability for our syslogd to collect pre-RFC3164 formatted messages from remote hosts that was broken with r326573. For example, the line from Cisco SCE8000 splitted for readability: 1130: 03:37:57: %USER-6-PORT_OPERSTATUS_CHANGE_TRAP: CPU#000 trap:link down EntityAdminState: 4 EntityAlarmStatus: 32 Such line was collected and stored before mentioned change but silently dropped after that. Now syslogd saves it again. Note that parsing of RFC5424 format not changed. MFC after: 1 month --- usr.sbin/syslogd/syslogd.c | 41 +++++++++++++++++------------------------ 1 file changed, 17 insertions(+), 24 deletions(-) diff --git a/usr.sbin/syslogd/syslogd.c b/usr.sbin/syslogd/syslogd.c index 1837c41c4e8b..dc07d4781553 100644 --- a/usr.sbin/syslogd/syslogd.c +++ b/usr.sbin/syslogd/syslogd.c @@ -1357,31 +1357,25 @@ parsemsg(const char *from, char *msg) size_t i; int pri; + i = -1; + pri = DEFUPRI; + /* Parse PRI. */ - if (msg[0] != '<' || !isdigit(msg[1])) { - dprintf("Invalid PRI from %s\n", from); - return; - } - for (i = 2; i <= 4; i++) { - if (msg[i] == '>') - break; - if (!isdigit(msg[i])) { - dprintf("Invalid PRI header from %s\n", from); - return; + if (msg[0] == '<' && isdigit(msg[1])) { + for (i = 2; i <= 4; i++) { + if (msg[i] == '>') { + errno = 0; + n = strtol(msg + 1, &q, 10); + if (errno == 0 && *q == msg[i] && n >= 0 && n <= INT_MAX) { + pri = n; + msg += i + 1; + i = 0; + } + break; } + } } - if (msg[i] != '>') { - dprintf("Invalid PRI header from %s\n", from); - return; - } - errno = 0; - n = strtol(msg + 1, &q, 10); - if (errno != 0 || *q != msg[i] || n < 0 || n >= INT_MAX) { - dprintf("Invalid PRI %ld from %s: %s\n", - n, from, strerror(errno)); - return; - } - pri = n; + if (pri &~ (LOG_FACMASK|LOG_PRIMASK)) pri = DEFUPRI; @@ -1394,8 +1388,7 @@ parsemsg(const char *from, char *msg) pri = LOG_MAKEPRI(LOG_USER, LOG_PRI(pri)); /* Parse VERSION. */ - msg += i + 1; - if (msg[0] == '1' && msg[1] == ' ') + if (i == 0 && msg[0] == '1' && msg[1] == ' ') parsemsg_rfc5424(from, pri, msg + 2); else parsemsg_rfc3164(from, pri, msg); From owner-dev-commits-src-main@freebsd.org Mon Sep 27 08:16:44 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1DBE26B1096; Mon, 27 Sep 2021 08:16:44 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HHwTS0KNzz4cxl; Mon, 27 Sep 2021 08:16:44 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from venus.codepro.be (venus.codepro.be [5.9.86.228]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mx1.codepro.be", Issuer "R3" (verified OK)) (Authenticated sender: kp) by smtp.freebsd.org (Postfix) with ESMTPSA id B23832FC12; Mon, 27 Sep 2021 08:16:43 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: by venus.codepro.be (Postfix, authenticated sender kp) id 74DE14662C; Mon, 27 Sep 2021 10:16:41 +0200 (CEST) From: Kristof Provost To: Alexander Motin Cc: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: Re: git: 695323ae88c7 - main - acpi_cpu: Fix panic if some CPU devices are disabled. Date: Mon, 27 Sep 2021 10:16:39 +0200 X-Mailer: MailMate (1.14r5818) Message-ID: <1D490397-E56E-4D39-A4CC-BDF0CC25E91D@FreeBSD.org> In-Reply-To: <202109252101.18PL1W4I003365@gitrepo.freebsd.org> References: <202109252101.18PL1W4I003365@gitrepo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.34 X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Sep 2021 08:16:44 -0000 On 25 Sep 2021, at 23:01, Alexander Motin wrote: > The branch main has been updated by mav: > > URL: = > https://cgit.FreeBSD.org/src/commit/?id=3D695323ae88c71776e131940ed7ded= d25365e932f > > commit 695323ae88c71776e131940ed7dedd25365e932f > Author: Alexander Motin > AuthorDate: 2021-09-25 20:54:28 +0000 > Commit: Alexander Motin > CommitDate: 2021-09-25 21:01:28 +0000 > > acpi_cpu: Fix panic if some CPU devices are disabled. > > While there, remove couple unneeded global variables. > --- > sys/dev/acpica/acpi_cpu.c | 66 = > +++++++++++++++++++++-------------------------- > 1 file changed, 29 insertions(+), 37 deletions(-) > > diff --git a/sys/dev/acpica/acpi_cpu.c b/sys/dev/acpica/acpi_cpu.c > index ab4ffda7a02e..0577b6eac8b7 100644 > --- a/sys/dev/acpica/acpi_cpu.c > +++ b/sys/dev/acpica/acpi_cpu.c > @@ -154,8 +154,6 @@ static struct sysctl_oid *cpu_sysctl_tree; > static int cpu_cx_generic; > static int cpu_cx_lowest_lim; > > -static device_t *cpu_devices; > -static int cpu_ndevices; > static struct acpi_cpu_softc **cpu_softc; > ACPI_SERIAL_DECL(cpu, "ACPI CPU"); > > @@ -443,26 +441,21 @@ acpi_cpu_attach(device_t dev) > static void > acpi_cpu_postattach(void *unused __unused) > { I=E2=80=99m seeing this panic on a bhyve VM running an up-to-date main ke= rnel: Fatal trap 12: page fault while in kernel mode cpuid =3D 2; apic id =3D 02 fault virtual address =3D 0x0 fault code =3D supervisor read data, page not present instruction pointer =3D 0x20:0xffffffff804f643c stack pointer =3D 0x28:0xffffffff8358bf20 frame pointer =3D 0x28:0xffffffff8358bfa0 code segment =3D base 0x0, limit 0xfffff, type 0x1b =3D DPL 0, pres 1, long 1, def32 0, gran 1 processor eflags =3D interrupt enabled, resume, IOPL =3D 0 current process =3D 0 (swapper) trap number =3D 12 panic: page fault cpuid =3D 2 time =3D 1 KDB: stack backtrace: db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame = 0xffffffff8358bbc0 vpanic() at vpanic+0x187/frame 0xffffffff8358bc20 panic() at panic+0x43/frame 0xffffffff8358bc80 trap_fatal() at trap_fatal+0x387/frame 0xffffffff8358bce0 trap_pfault() at trap_pfault+0x99/frame 0xffffffff8358bd40 trap() at trap+0x2a7/frame 0xffffffff8358be50 calltrap() at calltrap+0x8/frame 0xffffffff8358be50 --- trap 0xc, rip =3D 0xffffffff804f643c, rsp =3D 0xffffffff8358bf20, rb= p =3D = 0xffffffff8358bfa0 --- acpi_cpu_postattach() at acpi_cpu_postattach+0x5c/frame = 0xffffffff8358bfa0 mi_startup() at mi_startup+0x1f0/frame 0xffffffff8358bff0 btext() at btext+0x22 KDB: enter: panic [ thread pid 0 tid 100000 ] Stopped at kdb_enter+0x37: movq $0,0x1274f0e(%rip) db> I=E2=80=99ve not done any digging, but given that it seems to die in = acpi_cpu_postattach() and you touched that last =E2=80=A6, well you know = how = that goes. Best regards, Kristof From owner-dev-commits-src-main@freebsd.org Mon Sep 27 08:48:00 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5D9296B18A3; Mon, 27 Sep 2021 08:48:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HHx9X27nFz4gmm; Mon, 27 Sep 2021 08:48:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 25D8A5D5B; Mon, 27 Sep 2021 08:48:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18R8m0Qd054860; Mon, 27 Sep 2021 08:48:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18R8m0DD054859; Mon, 27 Sep 2021 08:48:00 GMT (envelope-from git) Date: Mon, 27 Sep 2021 08:48:00 GMT Message-Id: <202109270848.18R8m0DD054859@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Yasuhiro Kimura Subject: git: 74237127e340 - main - Add myself to calendar.freebsd MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: yasu X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 74237127e34084a7c178fbbe9c47c7f3e3e1ec24 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Sep 2021 08:48:00 -0000 The branch main has been updated by yasu (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=74237127e34084a7c178fbbe9c47c7f3e3e1ec24 commit 74237127e34084a7c178fbbe9c47c7f3e3e1ec24 Author: Yasuhiro Kimura AuthorDate: 2021-09-27 07:46:54 +0000 Commit: Yasuhiro Kimura CommitDate: 2021-09-27 08:47:01 +0000 Add myself to calendar.freebsd It corresponds to the 9th step of the procedure described in section 7.1 of Committer's Guide. Approved by: meta (mentor) Differential Revision: https://reviews.freebsd.org/D32153 --- usr.bin/calendar/calendars/calendar.freebsd | 1 + 1 file changed, 1 insertion(+) diff --git a/usr.bin/calendar/calendars/calendar.freebsd b/usr.bin/calendar/calendars/calendar.freebsd index 10c361fac8da..82a167621105 100644 --- a/usr.bin/calendar/calendars/calendar.freebsd +++ b/usr.bin/calendar/calendars/calendar.freebsd @@ -285,6 +285,7 @@ 07/10 David Schultz born in Oakland, California, United States, 1982 07/10 Ben Woods born in Perth, Western Australia, Australia, 1984 07/11 Jesus R. Camou born in Hermosillo, Sonora, Mexico, 1983 +07/12 Yasuhiro Kimura born in Okazaki, Aichi, Japan, 1967 07/14 Fernando Apesteguia born in Madrid, Spain, 1981 07/15 Gary Jennejohn born in Rochester, New York, United States, 1950 07/16 Suleiman Souhlal born in Roma, Italy, 1983 From owner-dev-commits-src-main@freebsd.org Mon Sep 27 11:03:33 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E1AD16B303A; Mon, 27 Sep 2021 11:03:33 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HJ09x5ysRz4qCR; Mon, 27 Sep 2021 11:03:33 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from venus.codepro.be (venus.codepro.be [5.9.86.228]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mx1.codepro.be", Issuer "R3" (verified OK)) (Authenticated sender: kp) by smtp.freebsd.org (Postfix) with ESMTPSA id 972D11412; Mon, 27 Sep 2021 11:03:33 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: by venus.codepro.be (Postfix, authenticated sender kp) id C611E46912; Mon, 27 Sep 2021 13:03:31 +0200 (CEST) From: Kristof Provost To: Emmanuel Vadot Cc: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: Re: git: a30235a4c360 - main - pkgbase: Create a FreeBSD-kerberos package Date: Mon, 27 Sep 2021 13:03:31 +0200 X-Mailer: MailMate (1.14r5818) Message-ID: In-Reply-To: <202109070952.1879q63H010763@gitrepo.freebsd.org> References: <202109070952.1879q63H010763@gitrepo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Sep 2021 11:03:34 -0000 On 7 Sep 2021, at 11:52, Emmanuel Vadot wrote: > The branch main has been updated by manu: > > URL: https://cgit.FreeBSD.org/src/commit/?id=3Da30235a4c360c06bb57be1f1= 0ae6866a71fb5622 > > commit a30235a4c360c06bb57be1f10ae6866a71fb5622 > Author: Emmanuel Vadot > AuthorDate: 2021-09-02 04:09:15 +0000 > Commit: Emmanuel Vadot > CommitDate: 2021-09-07 08:23:14 +0000 > > pkgbase: Create a FreeBSD-kerberos package > > This allows users to install or not kerberos related utilities > and libs. > > Differential Revision: https://reviews.freebsd.org/D31801 > --- Is it possible that this commit caused /etc/rc.d/gssd to no longer get in= stalled? (I=E2=80=99m not sure this is the responsible commit. I=E2=80=99ve very c= arefully avoided learning anything about our build system.) Kristof From owner-dev-commits-src-main@freebsd.org Mon Sep 27 11:47:14 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 96E626B3D3F; Mon, 27 Sep 2021 11:47:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HJ18L2hJ1z4swY; Mon, 27 Sep 2021 11:47:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 38D40105AB; Mon, 27 Sep 2021 11:47:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18RBlEwX093784; Mon, 27 Sep 2021 11:47:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18RBlEPI093783; Mon, 27 Sep 2021 11:47:14 GMT (envelope-from git) Date: Mon, 27 Sep 2021 11:47:14 GMT Message-Id: <202109271147.18RBlEPI093783@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: 4e50efb1944b - main - Check cpu_softc is not NULL before dereferencing MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 4e50efb1944bffe6ae648c8c81bd0814c18474b9 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Sep 2021 11:47:14 -0000 The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=4e50efb1944bffe6ae648c8c81bd0814c18474b9 commit 4e50efb1944bffe6ae648c8c81bd0814c18474b9 Author: Andrew Turner AuthorDate: 2021-09-27 11:22:15 +0000 Commit: Andrew Turner CommitDate: 2021-09-27 11:32:12 +0000 Check cpu_softc is not NULL before dereferencing In the acpi_cpu_postattach SYSINIT function cpu_softc may be NULL, e.g. on arm64 when booting from FDT. Check it is not NULL at the start of the function so we don't try to dereference a NULL pointer. Sponsored by: The FreeBSD Foundation --- sys/dev/acpica/acpi_cpu.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sys/dev/acpica/acpi_cpu.c b/sys/dev/acpica/acpi_cpu.c index 0577b6eac8b7..aac25af830ea 100644 --- a/sys/dev/acpica/acpi_cpu.c +++ b/sys/dev/acpica/acpi_cpu.c @@ -444,6 +444,9 @@ acpi_cpu_postattach(void *unused __unused) struct acpi_cpu_softc *sc; int attached = 0, i; + if (cpu_softc == NULL) + return; + mtx_lock(&Giant); CPU_FOREACH(i) { if ((sc = cpu_softc[i]) != NULL) From owner-dev-commits-src-main@freebsd.org Mon Sep 27 11:48:27 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2A5186B3FD1; Mon, 27 Sep 2021 11:48:27 +0000 (UTC) (envelope-from andrew@fubar.geek.nz) Received: from fry.fubar.geek.nz (fry.fubar.geek.nz [139.59.165.16]) by mx1.freebsd.org (Postfix) with ESMTP id 4HJ19l00vmz4tMB; Mon, 27 Sep 2021 11:48:26 +0000 (UTC) (envelope-from andrew@fubar.geek.nz) Received: from smtpclient.apple (cpc91232-cmbg18-2-0-cust554.5-4.cable.virginm.net [82.2.126.43]) by fry.fubar.geek.nz (Postfix) with ESMTPSA id AE6BE4E63E; Mon, 27 Sep 2021 11:48:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fubar.geek.nz; s=mail; t=1632743299; bh=Qhs50fdYsawDSqtj2RAhAth+9JRAlH7aodNqj5PYnSU=; h=From:Subject:Date:In-Reply-To:Cc:To:References; b=RqCkHVO1uVplI8rmcRIQlf01a9BVFsX6v5WHfaH/o322jySn/ZfVc+0oPw++t7jD/ 6YsBieiBhbS+BM2Da9FhL1AAsb/xCHsdL1xNrcSzmrgjCVyjMsr+ePE3sBYX6zY0Uj y/0gpyKUomZ+yCGp3wNgeumCj+Agd2PwD7zfH4+ns9BksjjNSWEdNd8pWijdmPoIRH OaAv5sE4HQtr24J3i8T1ETgdAGjfbxFadpZz4rY3nVhBL5yDog8cwdX0A4TTr++L+Y 45Fy3Fqg/R5uzvsG6r8JJmShpfNug6f2B1fBm2S2tqybSbRsnIHX+5R9hIRQH7SmOl Mgz2FnDuVt3pywdo40Q7gNOwX+EjiUyIKq1hw9HJsn/spF2Ffj9guRUdbWrDM/nrTu 1FZJJIze748QVLwvEEIhfSDawfc/RiAdRE/qcV+pwi/oNUX2iLWsNJnm7sqH8QIHkL 9tn8ZFkBLYoQFIJYs5wv3ADAtono6Nfrxa0kqd0wFPCG4IQexctCZ0ZurARAMMLh4q bz+JcawO8I2IqOO182y97ncCt+/5iBWjlMRk/lcyeH3PCfJiawo7Gq8RqCCC4vcCYH ic1rAAyS0FnEGMBLeaX+iK18kubBATqFmhMf9GJxg0Ar1wYlNS5uq9r+4DymhNYs5I C1rSWPELmQnfjbCzmeL1U4m4= From: Andrew Turner Message-Id: Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.120.0.1.13\)) Subject: Re: git: 695323ae88c7 - main - acpi_cpu: Fix panic if some CPU devices are disabled. Date: Mon, 27 Sep 2021 12:48:19 +0100 In-Reply-To: <1D490397-E56E-4D39-A4CC-BDF0CC25E91D@FreeBSD.org> Cc: Alexander Motin , "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" To: Kristof Provost References: <202109252101.18PL1W4I003365@gitrepo.freebsd.org> <1D490397-E56E-4D39-A4CC-BDF0CC25E91D@FreeBSD.org> X-Mailer: Apple Mail (2.3654.120.0.1.13) X-Rspamd-Queue-Id: 4HJ19l00vmz4tMB X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.34 X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Sep 2021 11:48:27 -0000 > On 27 Sep 2021, at 09:16, Kristof Provost wrote: >=20 > On 25 Sep 2021, at 23:01, Alexander Motin wrote: >=20 > The branch main has been updated by mav: >=20 > URL: = https://cgit.FreeBSD.org/src/commit/?id=3D695323ae88c71776e131940ed7dedd25= 365e932f = > commit 695323ae88c71776e131940ed7dedd25365e932f=20 > Author: Alexander Motin =20 > AuthorDate: 2021-09-25 20:54:28 +0000=20 > Commit: Alexander Motin =20 > CommitDate: 2021-09-25 21:01:28 +0000 >=20 > acpi_cpu: Fix panic if some CPU devices are disabled. >=20 > While there, remove couple unneeded global variables.=20 > ---=20 > sys/dev/acpica/acpi_cpu.c | 66 = +++++++++++++++++++++--------------------------=20 > 1 file changed, 29 insertions(+), 37 deletions(-) >=20 > diff --git a/sys/dev/acpica/acpi_cpu.c b/sys/dev/acpica/acpi_cpu.c=20 > index ab4ffda7a02e..0577b6eac8b7 100644=20 > --- a/sys/dev/acpica/acpi_cpu.c=20 > +++ b/sys/dev/acpica/acpi_cpu.c=20 > @@ -154,8 +154,6 @@ static struct sysctl_oid *cpu_sysctl_tree;=20 > static int cpu_cx_generic;=20 > static int cpu_cx_lowest_lim; >=20 > -static device_t *cpu_devices;=20 > -static int cpu_ndevices;=20 > static struct acpi_cpu_softc **cpu_softc;=20 > ACPI_SERIAL_DECL(cpu, "ACPI CPU"); >=20 > @@ -443,26 +441,21 @@ acpi_cpu_attach(device_t dev)=20 > static void=20 > acpi_cpu_postattach(void *unused __unused)=20 > { >=20 > I=E2=80=99m seeing this panic on a bhyve VM running an up-to-date main = kernel: >=20 > Fatal trap 12: page fault while in kernel mode > cpuid =3D 2; apic id =3D 02 > fault virtual address =3D 0x0 > fault code =3D supervisor read data, page not present > instruction pointer =3D 0x20:0xffffffff804f643c > stack pointer =3D 0x28:0xffffffff8358bf20 > frame pointer =3D 0x28:0xffffffff8358bfa0 > code segment =3D base 0x0, limit 0xfffff, type 0x1b > =3D DPL 0, pres 1, long 1, def32 0, gran 1 > processor eflags =3D interrupt enabled, resume, IOPL =3D 0 > current process =3D 0 (swapper) > trap number =3D 12 > panic: page fault > cpuid =3D 2 > time =3D 1 > KDB: stack backtrace: > db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame = 0xffffffff8358bbc0 > vpanic() at vpanic+0x187/frame 0xffffffff8358bc20 > panic() at panic+0x43/frame 0xffffffff8358bc80 > trap_fatal() at trap_fatal+0x387/frame 0xffffffff8358bce0 > trap_pfault() at trap_pfault+0x99/frame 0xffffffff8358bd40 > trap() at trap+0x2a7/frame 0xffffffff8358be50 > calltrap() at calltrap+0x8/frame 0xffffffff8358be50 > --- trap 0xc, rip =3D 0xffffffff804f643c, rsp =3D 0xffffffff8358bf20, = rbp =3D 0xffffffff8358bfa0 --- > acpi_cpu_postattach() at acpi_cpu_postattach+0x5c/frame = 0xffffffff8358bfa0 > mi_startup() at mi_startup+0x1f0/frame 0xffffffff8358bff0 > btext() at btext+0x22 > KDB: enter: panic > [ thread pid 0 tid 100000 ] > Stopped at kdb_enter+0x37: movq $0,0x1274f0e(%rip) > db> > I=E2=80=99ve not done any digging, but given that it seems to die in = acpi_cpu_postattach() and you touched that last =E2=80=A6, well you know = how that goes. >=20 I hit what looks to be the same issue on arm64. In my case it was a NULL = pointer dereference on cpu_softc because acpi_cpu_probe never called = malloc as I=E2=80=99m booting using FDT. I=E2=80=99ve pushed a fix for this in 4e50efb1. Andrew From owner-dev-commits-src-main@freebsd.org Mon Sep 27 11:51:49 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1046E6B42A4; Mon, 27 Sep 2021 11:51:49 +0000 (UTC) (envelope-from manu@bidouilliste.com) Received: from mx.blih.net (mail.blih.net [212.83.155.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "mx.blih.net", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HJ1Fc2nKkz4tQ3; Mon, 27 Sep 2021 11:51:48 +0000 (UTC) (envelope-from manu@bidouilliste.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bidouilliste.com; s=mx; t=1632743501; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=VPoVwHte/8w+m8PNK+FZZaiqd5fFdsv0nW/KyUlyk9o=; b=IZTNMue+JCiqQiTxiX27VbbXgtAMuSWy3MJrAikYB4VtIBKvOak9pQsqtIto3tOgzHzpHz TtMKjutzGp2a14tjjU3UMbf35o9jofn8dLYtkZqIdoGQ4uXU1FYHpqyNQVuVLbottGpTl8 LJFsGdwfLxDoV7VYMYiEZgiDA6/6hNw= Received: from amy (lfbn-idf2-1-644-191.w86-247.abo.wanadoo.fr [86.247.100.191]) by mx.blih.net (OpenSMTPD) with ESMTPSA id 0ca16052 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Mon, 27 Sep 2021 11:51:41 +0000 (UTC) Date: Mon, 27 Sep 2021 13:51:40 +0200 From: Emmanuel Vadot To: Kristof Provost Cc: Emmanuel Vadot , src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: Re: git: a30235a4c360 - main - pkgbase: Create a FreeBSD-kerberos package Message-Id: <20210927135140.2dcc977740609d80065aa5a7@bidouilliste.com> In-Reply-To: References: <202109070952.1879q63H010763@gitrepo.freebsd.org> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.33; amd64-portbld-freebsd14.0) Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: 4HJ1Fc2nKkz4tQ3 X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Sep 2021 11:51:49 -0000 On Mon, 27 Sep 2021 13:03:31 +0200 Kristof Provost wrote: > On 7 Sep 2021, at 11:52, Emmanuel Vadot wrote: > > The branch main has been updated by manu: > > > > URL: https://cgit.FreeBSD.org/src/commit/?id=3Da30235a4c360c06bb57be1f1= 0ae6866a71fb5622 > > > > commit a30235a4c360c06bb57be1f10ae6866a71fb5622 > > Author: Emmanuel Vadot > > AuthorDate: 2021-09-02 04:09:15 +0000 > > Commit: Emmanuel Vadot > > CommitDate: 2021-09-07 08:23:14 +0000 > > > > pkgbase: Create a FreeBSD-kerberos package > > > > This allows users to install or not kerberos related utilities > > and libs. > > > > Differential Revision: https://reviews.freebsd.org/D31801 > > --- >=20 > Is it possible that this commit caused /etc/rc.d/gssd to no longer get in= stalled? > (I?m not sure this is the responsible commit. I?ve very carefully avoided= learning anything about our build system.) >=20 > Kristof Really possible yes, Can you test : diff --git a/libexec/rc/rc.d/Makefile b/libexec/rc/rc.d/Makefile index 2271c27b7f8..5981b3b03d1 100644 --- a/libexec/rc/rc.d/Makefile +++ b/libexec/rc/rc.d/Makefile @@ -191,7 +191,7 @@ CONFS+=3D ftpd .endif =20 .if ${MK_GSSAPI} !=3D "no" -CONFGROUPS+=3D gssd +CONFGROUPS+=3D GSSD GSSD=3D gssd GSSDPACKAGE=3D kerberos .endif --=20 Emmanuel Vadot From owner-dev-commits-src-main@freebsd.org Mon Sep 27 12:28:56 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C33896B4E21; Mon, 27 Sep 2021 12:28:56 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HJ24S5C76z3DRj; Mon, 27 Sep 2021 12:28:56 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from venus.codepro.be (venus.codepro.be [5.9.86.228]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mx1.codepro.be", Issuer "R3" (verified OK)) (Authenticated sender: kp) by smtp.freebsd.org (Postfix) with ESMTPSA id 786C91E8A; Mon, 27 Sep 2021 12:28:56 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: by venus.codepro.be (Postfix, authenticated sender kp) id 32FC346969; Mon, 27 Sep 2021 14:28:54 +0200 (CEST) From: Kristof Provost To: Emmanuel Vadot Cc: Emmanuel Vadot , src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: Re: git: a30235a4c360 - main - pkgbase: Create a FreeBSD-kerberos package Date: Mon, 27 Sep 2021 14:28:53 +0200 X-Mailer: MailMate (1.14r5818) Message-ID: In-Reply-To: <20210927135140.2dcc977740609d80065aa5a7@bidouilliste.com> References: <202109070952.1879q63H010763@gitrepo.freebsd.org> <20210927135140.2dcc977740609d80065aa5a7@bidouilliste.com> MIME-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: quoted-printable X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Sep 2021 12:28:56 -0000 On 27 Sep 2021, at 13:51, Emmanuel Vadot wrote: > On Mon, 27 Sep 2021 13:03:31 +0200 > Kristof Provost wrote: > >> On 7 Sep 2021, at 11:52, Emmanuel Vadot wrote: >>> The branch main has been updated by manu: >>> >>> URL: https://cgit.FreeBSD.org/src/commit/?id=3Da30235a4c360c06bb57be1= f10ae6866a71fb5622 >>> >>> commit a30235a4c360c06bb57be1f10ae6866a71fb5622 >>> Author: Emmanuel Vadot >>> AuthorDate: 2021-09-02 04:09:15 +0000 >>> Commit: Emmanuel Vadot >>> CommitDate: 2021-09-07 08:23:14 +0000 >>> >>> pkgbase: Create a FreeBSD-kerberos package >>> >>> This allows users to install or not kerberos related utilities >>> and libs. >>> >>> Differential Revision: https://reviews.freebsd.org/D31801 >>> --- >> >> Is it possible that this commit caused /etc/rc.d/gssd to no longer get= installed? >> (I?m not sure this is the responsible commit. I?ve very carefully avoi= ded learning anything about our build system.) >> >> Kristof > > Really possible yes, > Can you test : > diff --git a/libexec/rc/rc.d/Makefile b/libexec/rc/rc.d/Makefile > index 2271c27b7f8..5981b3b03d1 100644 > --- a/libexec/rc/rc.d/Makefile > +++ b/libexec/rc/rc.d/Makefile > @@ -191,7 +191,7 @@ CONFS+=3D ftpd > .endif > > .if ${MK_GSSAPI} !=3D "no" > -CONFGROUPS+=3D gssd > +CONFGROUPS+=3D GSSD > GSSD=3D gssd > GSSDPACKAGE=3D kerberos > .endif > It looks like that does the trick. Thanks! Kristof From owner-dev-commits-src-main@freebsd.org Mon Sep 27 12:45:48 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 83B736B53D3; Mon, 27 Sep 2021 12:45:48 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HJ2Rw3Mfwz3FP4; Mon, 27 Sep 2021 12:45:48 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from venus.codepro.be (venus.codepro.be [5.9.86.228]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mx1.codepro.be", Issuer "R3" (verified OK)) (Authenticated sender: kp) by smtp.freebsd.org (Postfix) with ESMTPSA id 3A7921E95; Mon, 27 Sep 2021 12:45:48 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: by venus.codepro.be (Postfix, authenticated sender kp) id 9D50246A96; Mon, 27 Sep 2021 14:45:46 +0200 (CEST) From: Kristof Provost To: Andrew Turner Cc: Alexander Motin , src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: Re: git: 695323ae88c7 - main - acpi_cpu: Fix panic if some CPU devices are disabled. Date: Mon, 27 Sep 2021 14:45:45 +0200 X-Mailer: MailMate (1.14r5818) Message-ID: <8AEE4F18-6D9E-4FE5-A5B4-C245FE693C07@FreeBSD.org> In-Reply-To: References: <202109252101.18PL1W4I003365@gitrepo.freebsd.org> <1D490397-E56E-4D39-A4CC-BDF0CC25E91D@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Sep 2021 12:45:48 -0000 On 27 Sep 2021, at 13:48, Andrew Turner wrote: >> On 27 Sep 2021, at 09:16, Kristof Provost wrote: >> >> On 25 Sep 2021, at 23:01, Alexander Motin wrote: >> >> The branch main has been updated by mav: >> >> URL: https://cgit.FreeBSD.org/src/commit/?id=3D695323ae88c71776e131940= ed7dedd25365e932f >> commit 695323ae88c71776e131940ed7dedd25365e932f >> Author: Alexander Motin >> AuthorDate: 2021-09-25 20:54:28 +0000 >> Commit: Alexander Motin >> CommitDate: 2021-09-25 21:01:28 +0000 >> >> acpi_cpu: Fix panic if some CPU devices are disabled. >> >> While there, remove couple unneeded global variables. >> --- >> sys/dev/acpica/acpi_cpu.c | 66 +++++++++++++++++++++------------------= -------- >> 1 file changed, 29 insertions(+), 37 deletions(-) >> >> diff --git a/sys/dev/acpica/acpi_cpu.c b/sys/dev/acpica/acpi_cpu.c >> index ab4ffda7a02e..0577b6eac8b7 100644 >> --- a/sys/dev/acpica/acpi_cpu.c >> +++ b/sys/dev/acpica/acpi_cpu.c >> @@ -154,8 +154,6 @@ static struct sysctl_oid *cpu_sysctl_tree; >> static int cpu_cx_generic; >> static int cpu_cx_lowest_lim; >> >> -static device_t *cpu_devices; >> -static int cpu_ndevices; >> static struct acpi_cpu_softc **cpu_softc; >> ACPI_SERIAL_DECL(cpu, "ACPI CPU"); >> >> @@ -443,26 +441,21 @@ acpi_cpu_attach(device_t dev) >> static void >> acpi_cpu_postattach(void *unused __unused) >> { >> >> I=E2=80=99m seeing this panic on a bhyve VM running an up-to-date main= kernel: >> >> Fatal trap 12: page fault while in kernel mode >> cpuid =3D 2; apic id =3D 02 >> fault virtual address =3D 0x0 >> fault code =3D supervisor read data, page not present >> instruction pointer =3D 0x20:0xffffffff804f643c >> stack pointer =3D 0x28:0xffffffff8358bf20 >> frame pointer =3D 0x28:0xffffffff8358bfa0 >> code segment =3D base 0x0, limit 0xfffff, type 0x1b >> =3D DPL 0, pres 1, long 1, def32 0, gran 1 >> processor eflags =3D interrupt enabled, resume, IOPL =3D 0 >> current process =3D 0 (swapper) >> trap number =3D 12 >> panic: page fault >> cpuid =3D 2 >> time =3D 1 >> KDB: stack backtrace: >> db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame 0xffffffff= 8358bbc0 >> vpanic() at vpanic+0x187/frame 0xffffffff8358bc20 >> panic() at panic+0x43/frame 0xffffffff8358bc80 >> trap_fatal() at trap_fatal+0x387/frame 0xffffffff8358bce0 >> trap_pfault() at trap_pfault+0x99/frame 0xffffffff8358bd40 >> trap() at trap+0x2a7/frame 0xffffffff8358be50 >> calltrap() at calltrap+0x8/frame 0xffffffff8358be50 >> --- trap 0xc, rip =3D 0xffffffff804f643c, rsp =3D 0xffffffff8358bf20, = rbp =3D 0xffffffff8358bfa0 --- >> acpi_cpu_postattach() at acpi_cpu_postattach+0x5c/frame 0xffffffff8358= bfa0 >> mi_startup() at mi_startup+0x1f0/frame 0xffffffff8358bff0 >> btext() at btext+0x22 >> KDB: enter: panic >> [ thread pid 0 tid 100000 ] >> Stopped at kdb_enter+0x37: movq $0,0x1274f0e(%rip) >> db> >> I=E2=80=99ve not done any digging, but given that it seems to die in a= cpi_cpu_postattach() and you touched that last =E2=80=A6, well you know h= ow that goes. >> > I hit what looks to be the same issue on arm64. In my case it was a NUL= L pointer dereference on cpu_softc because acpi_cpu_probe never called ma= lloc as I=E2=80=99m booting using FDT. > > I=E2=80=99ve pushed a fix for this in 4e50efb1. > And that fixed my panic too. Thanks! Kristof From owner-dev-commits-src-main@freebsd.org Mon Sep 27 13:43:33 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 635686B5FC4; Mon, 27 Sep 2021 13:43:33 +0000 (UTC) (envelope-from mavbsd@gmail.com) Received: from mail-qk1-x729.google.com (mail-qk1-x729.google.com [IPv6:2607:f8b0:4864:20::729]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HJ3kY1mPfz3JyT; Mon, 27 Sep 2021 13:43:33 +0000 (UTC) (envelope-from mavbsd@gmail.com) Received: by mail-qk1-x729.google.com with SMTP id m7so19908274qke.8; Mon, 27 Sep 2021 06:43:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=VVvGAuMM4/FbmoMcHHjmerR2sZPD6F55MrxGqHtaGyI=; b=Yds6j2YwRP8osfmXLbXnkaIvmKjRVbLuNf8c0JTqNk48hCo3cFiAQNgXKpREL+nB0G 0K+VR2ISPpss1mZijKs74xYaMEvlj5mOVgn4e6OOunQ9ocbchOF2BKH9fAQYjkp10Yz8 KvEft7u+6DbpFtg3aoVnSIO/0LY0nQjWLwQ4eIwqb0LZGKDfwt9XqStc5BsIU+mELirv b9uiwsBC0YB7PkFHBnRJoxZYZ97J1EbEgAzHgEnstze8duW7QNmWJWNzXzFV7Ju7GhGh Eqlo/Hn98rLDqahlQdGGjVfYM7ru2PCTZUmF3X6lUxWzG9d0ga1xzuVTJp9gg3k3pXU4 ibhw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:subject:to:cc:references:from:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=VVvGAuMM4/FbmoMcHHjmerR2sZPD6F55MrxGqHtaGyI=; b=UdHsBZRtoTTyLER1DCPfeaIO9kfQyUt4JX79H768TM9QJ1Sm2fMXV9I+sHiYsQiR9l itb8FrLyg2UDZoo/cvtO3Yqg3tpTdA8630I4Qdwc7tY01tNMd19FjYO8KeQVasUlrVd8 aSr7VhHnPmUHujMpTIc+g6mUsCQTGUDQJGCfKLbw0lu2yp4RHmrYSoMpxPAEvU65Qftq 7DBdAGvMfSIkgQKrQmQ0bSVT0MIs3Uqc/G/kkpD5V8kBIuQ7lb2+LHsAmtNIdbp64NMI VOAijTi50mgNWD1QDIoPZcA0DWVNew2r0lAOKT0xgc7n1opWfFu9jni0JpqVI1s/pB6y bpQA== X-Gm-Message-State: AOAM532cpehFeR+mjVkVTwtopfiWsofH9/kRvHYiWqo7KfVCAsrpDoOg I9Ge1vQ9ITiJytOTq6wg1Z6LoayOXOg= X-Google-Smtp-Source: ABdhPJx3FGydBiJCkfLLyUALKZue69bCmfxzyN0E9t9rPfsRnWy8lD4m8qzaDMaGmygSI5zYJ3uueQ== X-Received: by 2002:a37:44ca:: with SMTP id r193mr20921qka.190.1632750212271; Mon, 27 Sep 2021 06:43:32 -0700 (PDT) Received: from spectre.mavhome.dp.ua (104-55-12-234.lightspeed.knvltn.sbcglobal.net. [104.55.12.234]) by smtp.gmail.com with ESMTPSA id i67sm12413133qkd.90.2021.09.27.06.43.31 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 27 Sep 2021 06:43:31 -0700 (PDT) Sender: Alexander Motin Subject: Re: git: 695323ae88c7 - main - acpi_cpu: Fix panic if some CPU devices are disabled. To: Andrew Turner , Kristof Provost Cc: "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" References: <202109252101.18PL1W4I003365@gitrepo.freebsd.org> <1D490397-E56E-4D39-A4CC-BDF0CC25E91D@FreeBSD.org> From: Alexander Motin Message-ID: Date: Mon, 27 Sep 2021 09:43:30 -0400 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4HJ3kY1mPfz3JyT X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Sep 2021 13:43:33 -0000 On 27.09.2021 07:48, Andrew Turner wrote: >> On 27 Sep 2021, at 09:16, Kristof Provost > I’ve not done any digging, but given that it seems to die in >> acpi_cpu_postattach() and you touched that last …, well you know how >> that goes. >> > I hit what looks to be the same issue on arm64. In my case it was a NULL > pointer dereference on cpu_softc because acpi_cpu_probe never called > malloc as I’m booting using FDT. > > I’ve pushed a fix for this in 4e50efb1. Thank you, Andrew! -- Alexander Motin From owner-dev-commits-src-main@freebsd.org Mon Sep 27 16:29:40 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 88C3F66B108; Mon, 27 Sep 2021 16:29:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HJ7QD3Pgrz3sH1; Mon, 27 Sep 2021 16:29:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 465711442F; Mon, 27 Sep 2021 16:29:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18RGTee4074871; Mon, 27 Sep 2021 16:29:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18RGTeOG074870; Mon, 27 Sep 2021 16:29:40 GMT (envelope-from git) Date: Mon, 27 Sep 2021 16:29:40 GMT Message-Id: <202109271629.18RGTeOG074870@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kevin Bowling Subject: git: 450c3f8b3d25 - main - e1000: Re-arm link changes MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 450c3f8b3d259c7eb82488319aff45f1f6554aaf Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Sep 2021 16:29:40 -0000 The branch main has been updated by kbowling (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=450c3f8b3d259c7eb82488319aff45f1f6554aaf commit 450c3f8b3d259c7eb82488319aff45f1f6554aaf Author: Kevin Bowling AuthorDate: 2021-09-27 16:17:48 +0000 Commit: Kevin Bowling CommitDate: 2021-09-27 16:25:58 +0000 e1000: Re-arm link changes A change to MSI-X link handler was somehow causing issues on MSI-based em(4) NICs. Revert the change based on user reports and testing. PR: 258551 Reported by: Franco Fichtner , t_uemura@macome.co.jp Reviewed by: markj, Franco Fichtner Tested by: t_uemura@macome.co.jp MFC after: 1 day --- sys/dev/e1000/if_em.c | 22 ++++++---------------- 1 file changed, 6 insertions(+), 16 deletions(-) diff --git a/sys/dev/e1000/if_em.c b/sys/dev/e1000/if_em.c index 47513c5d9e1e..34d7b8f5f87e 100644 --- a/sys/dev/e1000/if_em.c +++ b/sys/dev/e1000/if_em.c @@ -1495,7 +1495,6 @@ em_msix_link(void *arg) { struct e1000_softc *sc = arg; u32 reg_icr; - bool notlink = false; ++sc->link_irq; MPASS(sc->hw.back != NULL); @@ -1506,17 +1505,14 @@ em_msix_link(void *arg) if (reg_icr & (E1000_ICR_RXSEQ | E1000_ICR_LSC)) em_handle_link(sc->ctx); - else - notlink = true; - /* Re-arm for other/spurious interrupts */ - if (notlink && sc->hw.mac.type >= igb_mac_min) { + /* Re-arm unconditionally */ + if (sc->hw.mac.type >= igb_mac_min) { E1000_WRITE_REG(&sc->hw, E1000_IMS, E1000_IMS_LSC); E1000_WRITE_REG(&sc->hw, E1000_EIMS, sc->link_mask); } else if (sc->hw.mac.type == e1000_82574) { - if (notlink) - E1000_WRITE_REG(&sc->hw, E1000_IMS, E1000_IMS_LSC | - E1000_IMS_OTHER); + E1000_WRITE_REG(&sc->hw, E1000_IMS, E1000_IMS_LSC | + E1000_IMS_OTHER); /* * Because we must read the ICR for this interrupt it may * clear other causes using autoclear, for this reason we @@ -1524,7 +1520,8 @@ em_msix_link(void *arg) */ if (reg_icr) E1000_WRITE_REG(&sc->hw, E1000_ICS, sc->ims); - } + } else + E1000_WRITE_REG(&sc->hw, E1000_IMS, E1000_IMS_LSC); return (FILTER_HANDLED); } @@ -1873,13 +1870,6 @@ em_if_update_admin_status(if_ctx_t ctx) if (hw->mac.type < em_mac_min) lem_smartspeed(sc); - else if (hw->mac.type >= igb_mac_min && - sc->intr_type == IFLIB_INTR_MSIX) { - E1000_WRITE_REG(&sc->hw, E1000_IMS, E1000_IMS_LSC); - E1000_WRITE_REG(&sc->hw, E1000_EIMS, sc->link_mask); - } else if (hw->mac.type == e1000_82574 && - sc->intr_type == IFLIB_INTR_MSIX) - E1000_WRITE_REG(hw, E1000_IMS, E1000_IMS_LSC | E1000_IMS_OTHER); } static void From owner-dev-commits-src-main@freebsd.org Mon Sep 27 16:32:30 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 084C266B7E4; Mon, 27 Sep 2021 16:32:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HJ7TT6mSPz3sZC; Mon, 27 Sep 2021 16:32:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C88811462E; Mon, 27 Sep 2021 16:32:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18RGWT8h088098; Mon, 27 Sep 2021 16:32:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18RGWTpP088097; Mon, 27 Sep 2021 16:32:29 GMT (envelope-from git) Date: Mon, 27 Sep 2021 16:32:29 GMT Message-Id: <202109271632.18RGWTpP088097@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Emmanuel Vadot Subject: git: 860ee1792a6b - main - Fix gssd rc.d installation MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: manu X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 860ee1792a6b37cc531fcae94c2144c8d62e8fc2 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Sep 2021 16:32:30 -0000 The branch main has been updated by manu: URL: https://cgit.FreeBSD.org/src/commit/?id=860ee1792a6b37cc531fcae94c2144c8d62e8fc2 commit 860ee1792a6b37cc531fcae94c2144c8d62e8fc2 Author: Emmanuel Vadot AuthorDate: 2021-09-27 16:31:20 +0000 Commit: Emmanuel Vadot CommitDate: 2021-09-27 16:31:20 +0000 Fix gssd rc.d installation CONFGROUPS needs to be in CAPS Fixes: a30235a4c360 ("pkgbase: Create a FreeBSD-kerberos package") Reported by: kp --- libexec/rc/rc.d/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libexec/rc/rc.d/Makefile b/libexec/rc/rc.d/Makefile index 2271c27b7f89..5981b3b03d17 100644 --- a/libexec/rc/rc.d/Makefile +++ b/libexec/rc/rc.d/Makefile @@ -191,7 +191,7 @@ CONFS+= ftpd .endif .if ${MK_GSSAPI} != "no" -CONFGROUPS+= gssd +CONFGROUPS+= GSSD GSSD= gssd GSSDPACKAGE= kerberos .endif From owner-dev-commits-src-main@freebsd.org Mon Sep 27 16:34:36 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7227A66B556 for ; Mon, 27 Sep 2021 16:34:36 +0000 (UTC) (envelope-from kevin.bowling@kev009.com) Received: from mail-yb1-xb2b.google.com (mail-yb1-xb2b.google.com [IPv6:2607:f8b0:4864:20::b2b]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HJ7Ww2f2Dz3sjH for ; Mon, 27 Sep 2021 16:34:36 +0000 (UTC) (envelope-from kevin.bowling@kev009.com) Received: by mail-yb1-xb2b.google.com with SMTP id u32so4613461ybd.9 for ; Mon, 27 Sep 2021 09:34:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kev009.com; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=hxMHvxFZt9nZAp4eX+0WN7TJLO2HL7cZ5LjwJc+147s=; b=qEKZxwO2nir5rRE8A2a+OduA9e6yu97ulJmP/PJifO+SdgbkKHXK4B2gJOTfYY4/BO wMv1/ZGQad8A/ZtYN0JpGZIXKe+maGygBYU34nzMnQKsV9QoPjlu5Ne4TMnGnpWC1+Xk nygPKFv8jS5CJozHVSAO2ZIRvntPGqs9H+jd0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=hxMHvxFZt9nZAp4eX+0WN7TJLO2HL7cZ5LjwJc+147s=; b=rBG0624NmzGbUvzmFxXc6mm/qv45kdDCfzKVb+xrMVGKg5YG0e3gCwf3EjKWX/2An8 8WZ4rASuIzM08h54HHH0ouoEweH+GBKxyUN2WFUQBSkvvXnncsFmQR34JKKoYI99BS/E Fh5v0piOJdPQdpfARteQ25MzyAsZWrrBDs4SX69ItFDXyma2PXQOy0PZYtz5OF1TeGjl qLiRYp95G7k8QlXbwM7uEoUP+Af2TGXNt4r03+/1Zhnse3gGveZw8o22nx9VO8GQRTqQ kvGJzSwiRBoJQWlwHNZq5lUo6/qjUFId/nXiuzkEE69uLefpr0CcwSvaUrrswZZjKrYo CUUg== X-Gm-Message-State: AOAM531rI0l24NibJtMw7CJwNxR2R4ouE8gDsFgMnXmzrK9qoD7XGdfw oAzL7pNA02rb2PxvAwDRcOAgqu1tDG+jAbxKI1dAPw== X-Google-Smtp-Source: ABdhPJzfl9XqiwOckKN15TC7DGZxTpIzUYyxX5JIs7GiHs5WzADbx2+RgMI+kwPfgTZLOHjTiAYJQW0M0vfQQcni7ow= X-Received: by 2002:a5b:cd0:: with SMTP id e16mr816000ybr.533.1632760469862; Mon, 27 Sep 2021 09:34:29 -0700 (PDT) MIME-Version: 1.0 References: <202109271629.18RGTeOG074870@gitrepo.freebsd.org> In-Reply-To: <202109271629.18RGTeOG074870@gitrepo.freebsd.org> From: Kevin Bowling Date: Mon, 27 Sep 2021 09:34:18 -0700 Message-ID: Subject: Re: git: 450c3f8b3d25 - main - e1000: Re-arm link changes To: Kevin Bowling Cc: src-committers , "" , "dev-commits-src-main@FreeBSD.org" Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 4HJ7Ww2f2Dz3sjH X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Sep 2021 16:34:36 -0000 On Mon, Sep 27, 2021 at 9:29 AM Kevin Bowling wrote: > > The branch main has been updated by kbowling (ports committer): > > URL: https://cgit.FreeBSD.org/src/commit/?id=450c3f8b3d259c7eb82488319aff45f1f6554aaf > > commit 450c3f8b3d259c7eb82488319aff45f1f6554aaf > Author: Kevin Bowling > AuthorDate: 2021-09-27 16:17:48 +0000 > Commit: Kevin Bowling > CommitDate: 2021-09-27 16:25:58 +0000 > > e1000: Re-arm link changes > > A change to MSI-X link handler was somehow causing issues on > MSI-based em(4) NICs. If anyone has any deeper insight here, I'd like to fill in my knowledge. A 'device_printf' in 'em_msix_link()' never fires on em(4) using MSI so I do not see the relationship between this code and the experienced issues. > Revert the change based on user reports and testing. > > PR: 258551 > Reported by: Franco Fichtner , t_uemura@macome.co.jp > Reviewed by: markj, Franco Fichtner > Tested by: t_uemura@macome.co.jp > MFC after: 1 day > --- > sys/dev/e1000/if_em.c | 22 ++++++---------------- > 1 file changed, 6 insertions(+), 16 deletions(-) > > diff --git a/sys/dev/e1000/if_em.c b/sys/dev/e1000/if_em.c > index 47513c5d9e1e..34d7b8f5f87e 100644 > --- a/sys/dev/e1000/if_em.c > +++ b/sys/dev/e1000/if_em.c > @@ -1495,7 +1495,6 @@ em_msix_link(void *arg) > { > struct e1000_softc *sc = arg; > u32 reg_icr; > - bool notlink = false; > > ++sc->link_irq; > MPASS(sc->hw.back != NULL); > @@ -1506,17 +1505,14 @@ em_msix_link(void *arg) > > if (reg_icr & (E1000_ICR_RXSEQ | E1000_ICR_LSC)) > em_handle_link(sc->ctx); > - else > - notlink = true; > > - /* Re-arm for other/spurious interrupts */ > - if (notlink && sc->hw.mac.type >= igb_mac_min) { > + /* Re-arm unconditionally */ > + if (sc->hw.mac.type >= igb_mac_min) { > E1000_WRITE_REG(&sc->hw, E1000_IMS, E1000_IMS_LSC); > E1000_WRITE_REG(&sc->hw, E1000_EIMS, sc->link_mask); > } else if (sc->hw.mac.type == e1000_82574) { > - if (notlink) > - E1000_WRITE_REG(&sc->hw, E1000_IMS, E1000_IMS_LSC | > - E1000_IMS_OTHER); > + E1000_WRITE_REG(&sc->hw, E1000_IMS, E1000_IMS_LSC | > + E1000_IMS_OTHER); > /* > * Because we must read the ICR for this interrupt it may > * clear other causes using autoclear, for this reason we > @@ -1524,7 +1520,8 @@ em_msix_link(void *arg) > */ > if (reg_icr) > E1000_WRITE_REG(&sc->hw, E1000_ICS, sc->ims); > - } > + } else > + E1000_WRITE_REG(&sc->hw, E1000_IMS, E1000_IMS_LSC); > > return (FILTER_HANDLED); > } > @@ -1873,13 +1870,6 @@ em_if_update_admin_status(if_ctx_t ctx) > > if (hw->mac.type < em_mac_min) > lem_smartspeed(sc); > - else if (hw->mac.type >= igb_mac_min && > - sc->intr_type == IFLIB_INTR_MSIX) { > - E1000_WRITE_REG(&sc->hw, E1000_IMS, E1000_IMS_LSC); > - E1000_WRITE_REG(&sc->hw, E1000_EIMS, sc->link_mask); > - } else if (hw->mac.type == e1000_82574 && > - sc->intr_type == IFLIB_INTR_MSIX) > - E1000_WRITE_REG(hw, E1000_IMS, E1000_IMS_LSC | E1000_IMS_OTHER); > } > > static void > _______________________________________________ > dev-commits-src-main@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/dev-commits-src-main > To unsubscribe, send any mail to "dev-commits-src-main-unsubscribe@freebsd.org" From owner-dev-commits-src-main@freebsd.org Mon Sep 27 17:12:53 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8B54C66C35E; Mon, 27 Sep 2021 17:12:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HJ8N53P2mz3w2Q; Mon, 27 Sep 2021 17:12:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 55C1215014; Mon, 27 Sep 2021 17:12:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18RHCrhe041754; Mon, 27 Sep 2021 17:12:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18RHCrTl041753; Mon, 27 Sep 2021 17:12:53 GMT (envelope-from git) Date: Mon, 27 Sep 2021 17:12:53 GMT Message-Id: <202109271712.18RHCrTl041753@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: b1e2f063ae91 - main - amd64 sendsig: fix context corruption MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b1e2f063ae912dc5b7a7f6638ccb3aff14f299cf Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Sep 2021 17:12:53 -0000 The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=b1e2f063ae912dc5b7a7f6638ccb3aff14f299cf commit b1e2f063ae912dc5b7a7f6638ccb3aff14f299cf Author: Konstantin Belousov AuthorDate: 2021-09-27 16:57:25 +0000 Commit: Konstantin Belousov CommitDate: 2021-09-27 17:12:46 +0000 amd64 sendsig: fix context corruption Drop fpstate only after copying out xfpustate from the thread usermode save area. Otherwise a context switch between get_fpcontext(), which now returns the pointer directly into user save area, and copyout, would cause reinit of the save area, loosing user registers. Reported, reviewed, and tested by: markj Sponsored by: The FreeBSD Foundation MFC after: 3 days Differential revision: https://reviews.freebsd.org/D32159 --- sys/amd64/amd64/exec_machdep.c | 2 +- sys/amd64/ia32/ia32_signal.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/amd64/amd64/exec_machdep.c b/sys/amd64/amd64/exec_machdep.c index d605f080871a..b93fe7c4b3c7 100644 --- a/sys/amd64/amd64/exec_machdep.c +++ b/sys/amd64/amd64/exec_machdep.c @@ -143,7 +143,6 @@ sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask) bcopy(regs, &sf.sf_uc.uc_mcontext.mc_rdi, sizeof(*regs)); sf.sf_uc.uc_mcontext.mc_len = sizeof(sf.sf_uc.uc_mcontext); /* magic */ get_fpcontext(td, &sf.sf_uc.uc_mcontext, &xfpusave, &xfpusave_len); - fpstate_drop(td); update_pcb_bases(pcb); sf.sf_uc.uc_mcontext.mc_fsbase = pcb->pcb_fsbase; sf.sf_uc.uc_mcontext.mc_gsbase = pcb->pcb_gsbase; @@ -203,6 +202,7 @@ sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask) sigexit(td, SIGILL); } + fpstate_drop(td); regs->tf_rsp = (long)sfp; regs->tf_rip = p->p_sysent->sv_sigcode_base; regs->tf_rflags &= ~(PSL_T | PSL_D); diff --git a/sys/amd64/ia32/ia32_signal.c b/sys/amd64/ia32/ia32_signal.c index ab7100f5b9fb..6c879eccfc77 100644 --- a/sys/amd64/ia32/ia32_signal.c +++ b/sys/amd64/ia32/ia32_signal.c @@ -607,7 +607,6 @@ ia32_sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask) sf.sf_uc.uc_mcontext.mc_gs = regs->tf_gs; sf.sf_uc.uc_mcontext.mc_len = sizeof(sf.sf_uc.uc_mcontext); /* magic */ ia32_get_fpcontext(td, &sf.sf_uc.uc_mcontext, &xfpusave, &xfpusave_len); - fpstate_drop(td); sf.sf_uc.uc_mcontext.mc_fsbase = td->td_pcb->pcb_fsbase; sf.sf_uc.uc_mcontext.mc_gsbase = td->td_pcb->pcb_gsbase; @@ -661,6 +660,7 @@ ia32_sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask) sigexit(td, SIGILL); } + fpstate_drop(td); regs->tf_rsp = (uintptr_t)sfp; regs->tf_rip = p->p_sysent->sv_sigcode_base; regs->tf_rflags &= ~(PSL_T | PSL_D); From owner-dev-commits-src-main@freebsd.org Mon Sep 27 17:24:05 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D564C66C4D4; Mon, 27 Sep 2021 17:24:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HJ8d15Rzdz4RGf; Mon, 27 Sep 2021 17:24:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9BAC91529F; Mon, 27 Sep 2021 17:24:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18RHO5Mr055521; Mon, 27 Sep 2021 17:24:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18RHO5TT055520; Mon, 27 Sep 2021 17:24:05 GMT (envelope-from git) Date: Mon, 27 Sep 2021 17:24:05 GMT Message-Id: <202109271724.18RHO5TT055520@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 0eb901f76007 - main - pci_host_generic: implement bus_translate_resource (for LinuxKPI) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 0eb901f760078c9d0402fa4df522c099f0e96cb0 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Sep 2021 17:24:05 -0000 The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=0eb901f760078c9d0402fa4df522c099f0e96cb0 commit 0eb901f760078c9d0402fa4df522c099f0e96cb0 Author: Greg V AuthorDate: 2021-09-20 20:05:49 +0000 Commit: Bjoern A. Zeeb CommitDate: 2021-09-27 17:19:05 +0000 pci_host_generic: implement bus_translate_resource (for LinuxKPI) In D21096 BUS_TRANSLATE_RESOURCE was introduced to allow LinuxKPI to get physical addresses in pci_resource_start for PowerPC and implemented in ofw_pci. When the translation was implemented in pci_host_generic in 372c142b4fc, this method was not implemented; instead a local static function was added for a similar purpose. Rename the static function to "_common" and implement the bus function as a wrapper around that. With this a LinuxKPI driver using physical addresses correctly finds the configuration registers of the GPU. This unbreaks amdgpu on NXP Layerscape LX2160A SoC (SolidRun HoneyComb LX2K workstation) which has a Translation Offset in ACPI for below-4G PCI addresses. More info: https://github.com/freebsd/drm-kmod/issues/84 Tested by: dan.kotowski_a9development.com Reviewed by: hselasky Differential Revision: https://reviews.freebsd.org/D30986 --- sys/dev/pci/pci_host_generic.c | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/sys/dev/pci/pci_host_generic.c b/sys/dev/pci/pci_host_generic.c index 22b3ccdc17b1..03e8baa1b5cf 100644 --- a/sys/dev/pci/pci_host_generic.c +++ b/sys/dev/pci/pci_host_generic.c @@ -326,7 +326,7 @@ pci_host_generic_core_release_resource(device_t dev, device_t child, int type, } static bool -generic_pcie_translate_resource(device_t dev, int type, rman_res_t start, +generic_pcie_translate_resource_common(device_t dev, int type, rman_res_t start, rman_res_t end, rman_res_t *new_start, rman_res_t *new_end) { struct generic_pcie_core_softc *sc; @@ -382,6 +382,16 @@ generic_pcie_translate_resource(device_t dev, int type, rman_res_t start, return (found); } +static int +generic_pcie_translate_resource(device_t bus, int type, + rman_res_t start, rman_res_t *newstart) +{ + rman_res_t newend; /* unused */ + + return (!generic_pcie_translate_resource_common( + bus, type, start, 0, newstart, &newend)); +} + struct resource * pci_host_generic_core_alloc_resource(device_t dev, device_t child, int type, int *rid, rman_res_t start, rman_res_t end, rman_res_t count, u_int flags) @@ -406,7 +416,7 @@ pci_host_generic_core_alloc_resource(device_t dev, device_t child, int type, type, rid, start, end, count, flags)); /* Translate the address from a PCI address to a physical address */ - if (!generic_pcie_translate_resource(dev, type, start, end, &phys_start, + if (!generic_pcie_translate_resource_common(dev, type, start, end, &phys_start, &phys_end)) { device_printf(dev, "Failed to translate resource %jx-%jx type %x for %s\n", @@ -458,7 +468,7 @@ generic_pcie_activate_resource(device_t dev, device_t child, int type, start = rman_get_start(r); end = rman_get_end(r); - if (!generic_pcie_translate_resource(dev, type, start, end, &start, + if (!generic_pcie_translate_resource_common(dev, type, start, end, &start, &end)) return (EINVAL); rman_set_start(r, start); @@ -529,6 +539,7 @@ static device_method_t generic_pcie_methods[] = { DEVMETHOD(bus_activate_resource, generic_pcie_activate_resource), DEVMETHOD(bus_deactivate_resource, generic_pcie_deactivate_resource), DEVMETHOD(bus_release_resource, pci_host_generic_core_release_resource), + DEVMETHOD(bus_translate_resource, generic_pcie_translate_resource), DEVMETHOD(bus_setup_intr, bus_generic_setup_intr), DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr), From owner-dev-commits-src-main@freebsd.org Mon Sep 27 17:39:11 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9D33266C7F3; Mon, 27 Sep 2021 17:39:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HJ8yR2tPPz4SkC; Mon, 27 Sep 2021 17:39:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 438B815515; Mon, 27 Sep 2021 17:39:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18RHdBbT068994; Mon, 27 Sep 2021 17:39:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18RHdBFT068993; Mon, 27 Sep 2021 17:39:11 GMT (envelope-from git) Date: Mon, 27 Sep 2021 17:39:11 GMT Message-Id: <202109271739.18RHdBFT068993@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mitchell Horne Subject: git: bcddaadbef58 - main - rman: fix overflow in rman_reserve_resource_bound() MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mhorne X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: bcddaadbef5850ed9f040836d3f25ff57138ae28 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Sep 2021 17:39:11 -0000 The branch main has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=bcddaadbef5850ed9f040836d3f25ff57138ae28 commit bcddaadbef5850ed9f040836d3f25ff57138ae28 Author: Elliott Mitchell AuthorDate: 2021-09-27 17:13:19 +0000 Commit: Mitchell Horne CommitDate: 2021-09-27 17:38:26 +0000 rman: fix overflow in rman_reserve_resource_bound() If the default range of [0, ~0] is given, then (~0 - 0) + 1 == 0. This in turn will cause any allocation of non-zero size to fail. Zero-sized allocations are prohibited, so add a KASSERT to this effect. History indicates it is part of the original rman code. This bug may in fact be older than some contributors. Reviewed by: mhorne MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D30280 --- sys/kern/subr_rman.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sys/kern/subr_rman.c b/sys/kern/subr_rman.c index a8f5188e7f54..1bbaff8264ef 100644 --- a/sys/kern/subr_rman.c +++ b/sys/kern/subr_rman.c @@ -445,6 +445,8 @@ rman_reserve_resource_bound(struct rman *rm, rman_res_t start, rman_res_t end, "length %#jx, flags %x, device %s\n", rm->rm_descr, start, end, count, flags, dev == NULL ? "" : device_get_nameunit(dev))); + KASSERT(count != 0, ("%s: attempted to allocate an empty range", + __func__)); KASSERT((flags & RF_FIRSTSHARE) == 0, ("invalid flags %#x", flags)); new_rflags = (flags & ~RF_FIRSTSHARE) | RF_ALLOCATED; @@ -520,7 +522,7 @@ rman_reserve_resource_bound(struct rman *rm, rman_res_t start, rman_res_t end, DPRINTF(("truncated region: [%#jx, %#jx]; size %#jx (requested %#jx)\n", rstart, rend, (rend - rstart + 1), count)); - if ((rend - rstart + 1) >= count) { + if ((rend - rstart) >= (count - 1)) { DPRINTF(("candidate region: [%#jx, %#jx], size %#jx\n", rstart, rend, (rend - rstart + 1))); if ((s->r_end - s->r_start + 1) == count) { From owner-dev-commits-src-main@freebsd.org Mon Sep 27 17:48:29 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id ED8F766CE56; Mon, 27 Sep 2021 17:48:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HJ9996C63z4T6x; Mon, 27 Sep 2021 17:48:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B4D2D153BD; Mon, 27 Sep 2021 17:48:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18RHmT1L082073; Mon, 27 Sep 2021 17:48:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18RHmTAt082072; Mon, 27 Sep 2021 17:48:29 GMT (envelope-from git) Date: Mon, 27 Sep 2021 17:48:29 GMT Message-Id: <202109271748.18RHmTAt082072@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 93b14194acaf - main - LinuxKPI: disable device_release_driver() MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 93b14194acaf2c2d80df9c4900a90c6644dcd92b Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Sep 2021 17:48:30 -0000 The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=93b14194acaf2c2d80df9c4900a90c6644dcd92b commit 93b14194acaf2c2d80df9c4900a90c6644dcd92b Author: Bjoern A. Zeeb AuthorDate: 2021-09-27 17:38:41 +0000 Commit: Bjoern A. Zeeb CommitDate: 2021-09-27 17:45:06 +0000 LinuxKPI: disable device_release_driver() As reported by multiple people testing iwlwifi, device_release_driver() can lead to a panic on secondary errors (usually during attach). Disable device_release_driver() for the short-term to prevent the panic but leave it in place so it can be re-worked and fixed properly for the long-term more easily. Sponsored by: The FreeBSD Foundation MFC after: 3 days --- sys/compat/linuxkpi/common/include/linux/device.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sys/compat/linuxkpi/common/include/linux/device.h b/sys/compat/linuxkpi/common/include/linux/device.h index 4bdc3b831e58..abafcd7ba5c4 100644 --- a/sys/compat/linuxkpi/common/include/linux/device.h +++ b/sys/compat/linuxkpi/common/include/linux/device.h @@ -506,6 +506,9 @@ static inline void device_release_driver(struct device *dev) { +#if 0 + /* This leads to panics. Disable temporarily. Keep to rework. */ + /* We also need to cleanup LinuxKPI bits. What else? */ lkpi_devres_release_free_list(dev); dev_set_drvdata(dev, NULL); @@ -515,6 +518,7 @@ device_release_driver(struct device *dev) if (device_is_attached(dev->bsddev)) device_detach(dev->bsddev); mtx_unlock(&Giant); +#endif } static inline int From owner-dev-commits-src-main@freebsd.org Mon Sep 27 18:14:54 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9227A66D1D5; Mon, 27 Sep 2021 18:14:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HJ9lf3QyFz4VmG; Mon, 27 Sep 2021 18:14:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5642815A57; Mon, 27 Sep 2021 18:14:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18RIEsAf022536; Mon, 27 Sep 2021 18:14:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18RIEsvf022535; Mon, 27 Sep 2021 18:14:54 GMT (envelope-from git) Date: Mon, 27 Sep 2021 18:14:54 GMT Message-Id: <202109271814.18RIEsvf022535@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Cy Schubert Subject: git: df38343e7130 - main - ipfilter: Print the correct TCP sequence index number MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cy X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: df38343e71304169ebca0e4c4fa24b339982d7be Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Sep 2021 18:14:54 -0000 The branch main has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=df38343e71304169ebca0e4c4fa24b339982d7be commit df38343e71304169ebca0e4c4fa24b339982d7be Author: Cy Schubert AuthorDate: 2021-09-25 00:00:20 +0000 Commit: Cy Schubert CommitDate: 2021-09-27 18:13:50 +0000 ipfilter: Print the correct TCP sequence index number TCP sequence numbers in the FTP proxy are maintained in a two dimensional array. The debug message prints the same seq[N] for both. Fix that. MFC after: 3 days --- sys/contrib/ipfilter/netinet/ip_ftp_pxy.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/contrib/ipfilter/netinet/ip_ftp_pxy.c b/sys/contrib/ipfilter/netinet/ip_ftp_pxy.c index c4ee0ef593df..f4b40f3601d9 100644 --- a/sys/contrib/ipfilter/netinet/ip_ftp_pxy.c +++ b/sys/contrib/ipfilter/netinet/ip_ftp_pxy.c @@ -1415,7 +1415,7 @@ ipf_p_ftp_process(softf, fin, nat, ftp, rv) printf("%s:seq[0](%u) + (%d) != (%u)\n", "ipf_p_ftp_process", t->ftps_seq[0], ackoff, thack); - printf("%s:seq[0](%u) + (%d) != (%u)\n", + printf("%s:seq[1](%u) + (%d) != (%u)\n", "ipf_p_ftp_process", t->ftps_seq[1], ackoff, thack); } From owner-dev-commits-src-main@freebsd.org Mon Sep 27 18:14:55 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A7BFE66D55C; Mon, 27 Sep 2021 18:14:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HJ9lg4DLzz4Vjk; Mon, 27 Sep 2021 18:14:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6F52E15C15; Mon, 27 Sep 2021 18:14:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18RIEttQ022560; Mon, 27 Sep 2021 18:14:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18RIEt1g022559; Mon, 27 Sep 2021 18:14:55 GMT (envelope-from git) Date: Mon, 27 Sep 2021 18:14:55 GMT Message-Id: <202109271814.18RIEt1g022559@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Cy Schubert Subject: git: aa6cfcc820b4 - main - ipfilter: Correct a comment MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cy X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: aa6cfcc820b438cec58fbe0af408d4457f8daf9d Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Sep 2021 18:14:55 -0000 The branch main has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=aa6cfcc820b438cec58fbe0af408d4457f8daf9d commit aa6cfcc820b438cec58fbe0af408d4457f8daf9d Author: Cy Schubert AuthorDate: 2021-09-25 06:41:22 +0000 Commit: Cy Schubert CommitDate: 2021-09-27 18:13:50 +0000 ipfilter: Correct a comment Correct a comment's grammar and while at it clarify its meaining. MFC after: 3 days --- sys/contrib/ipfilter/netinet/ip_proxy.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/contrib/ipfilter/netinet/ip_proxy.c b/sys/contrib/ipfilter/netinet/ip_proxy.c index 4399a9cde8e4..a1a9379b95a6 100644 --- a/sys/contrib/ipfilter/netinet/ip_proxy.c +++ b/sys/contrib/ipfilter/netinet/ip_proxy.c @@ -1060,7 +1060,7 @@ ipf_proxy_check(fin, nat) /* pr(I) - protocol number for proxy */ /* name(I) - proxy name */ /* */ -/* Search for an proxy by the protocol it is being used with and its name. */ +/* Search for a proxy by the protocol being used and by its name. */ /* ------------------------------------------------------------------------ */ aproxy_t * ipf_proxy_lookup(arg, pr, name) From owner-dev-commits-src-main@freebsd.org Mon Sep 27 19:15:11 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 791F066E09D; Mon, 27 Sep 2021 19:15:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HJC5C2yhcz4Zpg; Mon, 27 Sep 2021 19:15:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4549C1656C; Mon, 27 Sep 2021 19:15:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18RJFBm2002308; Mon, 27 Sep 2021 19:15:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18RJFBUp002307; Mon, 27 Sep 2021 19:15:11 GMT (envelope-from git) Date: Mon, 27 Sep 2021 19:15:11 GMT Message-Id: <202109271915.18RJFBUp002307@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: David Bright Subject: git: e3cf7ebc1d36 - main - ntb_hw_intel: fix xeon NTB gen3 bar disable logic MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dab X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e3cf7ebc1d36d068f1d1a83ea73ce2eed547e3cb Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Sep 2021 19:15:11 -0000 The branch main has been updated by dab: URL: https://cgit.FreeBSD.org/src/commit/?id=e3cf7ebc1d36d068f1d1a83ea73ce2eed547e3cb commit e3cf7ebc1d36d068f1d1a83ea73ce2eed547e3cb Author: David Bright AuthorDate: 2021-09-27 13:18:46 +0000 Commit: David Bright CommitDate: 2021-09-27 19:13:03 +0000 ntb_hw_intel: fix xeon NTB gen3 bar disable logic In NTB gen3 driver, it was supposed to disable NTB bar access by default, but due to incorrect register access method, the bar disable logic does not work as expected. Those registers should be modified through NTB bar0 rather than PCI configuration space. Besides, we'd better to protect ourselves from a bad buddy node so ingress disable logic should be implemented together. Submitted by: Austin Zhang (austin.zhang@dell.com) Reviewers: markj, mav, vangyzen, dab Differential Revision: https://reviews.freebsd.org/D31736 Sponsored by: Dell EMC MFC to: stable/12, stable/13 MFC after: 1 week --- sys/dev/ntb/ntb_hw/ntb_hw_intel.c | 37 +++++++++++++++++-------------------- 1 file changed, 17 insertions(+), 20 deletions(-) diff --git a/sys/dev/ntb/ntb_hw/ntb_hw_intel.c b/sys/dev/ntb/ntb_hw/ntb_hw_intel.c index 06206f812d3f..00fcc4829b9c 100644 --- a/sys/dev/ntb/ntb_hw/ntb_hw_intel.c +++ b/sys/dev/ntb/ntb_hw/ntb_hw_intel.c @@ -2163,15 +2163,21 @@ xeon_gen3_setup_b2b_mw(struct ntb_softc *ntb) intel_ntb_reg_write(8, XEON_GEN3_REG_IMBAR2XBASE, 0); /* - * If the value in EMBAR1LIMIT is set equal to the value in EMBAR1, - * the memory window for EMBAR1 is disabled. - * Note: It is needed to avoid malacious access. + * If the value in IMBAR1XLIMIT is set equal to the value in IMBAR1XBASE, + * the local memory window exposure from EMBAR1 is disabled. + * Note: It is needed to avoid malicious access. */ - reg = pci_read_config(ntb->device, XEON_GEN3_EXT_REG_BAR1BASE, 8); - intel_ntb_reg_write(8, XEON_GEN3_REG_IMBAR1XLIMIT, reg); + intel_ntb_reg_write(8, XEON_GEN3_REG_IMBAR1XLIMIT, 0); + intel_ntb_reg_write(8, XEON_GEN3_REG_IMBAR2XLIMIT, 0); - reg = pci_read_config(ntb->device, XEON_GEN3_EXT_REG_BAR2BASE, 8); - intel_ntb_reg_write(8, XEON_GEN3_REG_IMBAR2XLIMIT, reg); + /* Config outgoing translation limits (whole bar size windows) */ + reg = intel_ntb_reg_read(8, XEON_GEN3_REG_EMBAR1XBASE); + reg += ntb->bar_info[NTB_B2B_BAR_1].size; + intel_ntb_reg_write(8, XEON_GEN3_REG_EMBAR1XLIMIT, reg); + + reg = intel_ntb_reg_read(8, XEON_GEN3_REG_EMBAR2XBASE); + reg += ntb->bar_info[NTB_B2B_BAR_2].size; + intel_ntb_reg_write(8, XEON_GEN3_REG_EMBAR2XLIMIT, reg); return (0); } @@ -3226,7 +3232,10 @@ intel_ntb_mw_set_trans(device_t dev, unsigned idx, bus_addr_t addr, size_t size) limit = 0; if (bar_is_64bit(ntb, bar_num)) { - base = intel_ntb_reg_read(8, base_reg) & BAR_HIGH_MASK; + if (ntb->type == NTB_XEON_GEN3) + base = addr; + else + base = intel_ntb_reg_read(8, base_reg) & BAR_HIGH_MASK; if (limit_reg != 0 && size != mw_size) limit = base + size; @@ -3249,18 +3258,6 @@ intel_ntb_mw_set_trans(device_t dev, unsigned idx, bus_addr_t addr, size_t size) intel_ntb_reg_write(8, xlat_reg, 0); return (EIO); } - - if (ntb->type == NTB_XEON_GEN3) { - limit = base + size; - - /* set EMBAR1/2XLIMIT */ - if (!idx) - intel_ntb_reg_write(8, - XEON_GEN3_REG_EMBAR1XLIMIT, limit); - else - intel_ntb_reg_write(8, - XEON_GEN3_REG_EMBAR2XLIMIT, limit); - } } else { /* Configure 32-bit (split) BAR MW */ if (ntb->type == NTB_XEON_GEN3) From owner-dev-commits-src-main@freebsd.org Mon Sep 27 20:56:38 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BB3D167013D; Mon, 27 Sep 2021 20:56:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HJFLG4dCFz4pXv; Mon, 27 Sep 2021 20:56:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 743A518080; Mon, 27 Sep 2021 20:56:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18RKucmN036961; Mon, 27 Sep 2021 20:56:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18RKucXG036960; Mon, 27 Sep 2021 20:56:38 GMT (envelope-from git) Date: Mon, 27 Sep 2021 20:56:38 GMT Message-Id: <202109272056.18RKucXG036960@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 72c89ce97ba3 - main - LinuxKPI: dma-mapping.h unify "mask" and "dma_mask" MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 72c89ce97ba3f023463930578c6df7f0374cbf17 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Sep 2021 20:56:38 -0000 The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=72c89ce97ba3f023463930578c6df7f0374cbf17 commit 72c89ce97ba3f023463930578c6df7f0374cbf17 Author: Bjoern A. Zeeb AuthorDate: 2021-09-27 20:48:02 +0000 Commit: Bjoern A. Zeeb CommitDate: 2021-09-27 20:53:06 +0000 LinuxKPI: dma-mapping.h unify "mask" and "dma_mask" In some places we are using "mask" and others "dma_mask" for the same thing. Harmonize the various places to "dma_mask" as used in linux_pci.c. For the declaration remove the argument names to avoid the entire problem. This is in preparation for an upcoming change. No functional changes intended. Sponsored by: The FreeBSD Foundation MFC after: 5 days --- sys/compat/linuxkpi/common/include/linux/dma-mapping.h | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/sys/compat/linuxkpi/common/include/linux/dma-mapping.h b/sys/compat/linuxkpi/common/include/linux/dma-mapping.h index 5b5bc9e90815..554d4bd4e695 100644 --- a/sys/compat/linuxkpi/common/include/linux/dma-mapping.h +++ b/sys/compat/linuxkpi/common/include/linux/dma-mapping.h @@ -91,7 +91,7 @@ struct dma_map_ops { #define DMA_BIT_MASK(n) ((2ULL << ((n) - 1)) - 1ULL) -int linux_dma_tag_init(struct device *dev, u64 mask); +int linux_dma_tag_init(struct device *, u64); void *linux_dma_alloc_coherent(struct device *dev, size_t size, dma_addr_t *dma_handle, gfp_t flag); dma_addr_t linux_dma_map_phys(struct device *dev, vm_paddr_t phys, size_t len); @@ -104,7 +104,7 @@ void linux_dma_unmap_sg_attrs(struct device *dev, struct scatterlist *sg, unsigned long attrs __unused); static inline int -dma_supported(struct device *dev, u64 mask) +dma_supported(struct device *dev, u64 dma_mask) { /* XXX busdma takes care of this elsewhere. */ @@ -122,23 +122,23 @@ dma_set_mask(struct device *dev, u64 dma_mask) } static inline int -dma_set_coherent_mask(struct device *dev, u64 mask) +dma_set_coherent_mask(struct device *dev, u64 dma_mask) { - if (!dma_supported(dev, mask)) + if (!dma_supported(dev, dma_mask)) return -EIO; /* XXX Currently we don't support a separate coherent mask. */ return 0; } static inline int -dma_set_mask_and_coherent(struct device *dev, u64 mask) +dma_set_mask_and_coherent(struct device *dev, u64 dma_mask) { int r; - r = dma_set_mask(dev, mask); + r = dma_set_mask(dev, dma_mask); if (r == 0) - dma_set_coherent_mask(dev, mask); + dma_set_coherent_mask(dev, dma_mask); return (r); } From owner-dev-commits-src-main@freebsd.org Tue Sep 28 00:32:19 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 92D8567338D for ; Tue, 28 Sep 2021 00:32:19 +0000 (UTC) (envelope-from mw@semihalf.com) Received: from mail-yb1-xb31.google.com (mail-yb1-xb31.google.com [IPv6:2607:f8b0:4864:20::b31]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HJL76646Zz3Hlg for ; Tue, 28 Sep 2021 00:32:18 +0000 (UTC) (envelope-from mw@semihalf.com) Received: by mail-yb1-xb31.google.com with SMTP id m132so7929843ybf.8 for ; Mon, 27 Sep 2021 17:32:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=semihalf-com.20210112.gappssmtp.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=x/hIE+TfQ7LP+yC/1pRdwcguGPKMPE2Y/NF68OXmXec=; b=VIbciaeqmWDlZkosHmPD+5SAAzYphYwjAoa2Gu0nRi6bN14qLAD7QkOxyNvVcqWOW+ SQn7zosZFcIWVv+L01N8oniyMgtBdHXQoX4N8K+CpsYqbROv5qJj2RtqpIuNLgLA1Rm/ EcDbaTXgRHWlctj43bE8ILWgPQsr413j+GKSX9cE2GIx+V87VrLrEcpc2fOsAdZx8JL/ FT/OqSWX5XInArBUwKLK/9H3vj4inx00Vb3HtGuF/i/My4kL/Lf0ey3KpbxkSQvq6uWb eghLsIqtckFjdNx/kiQJxkMNiT5lfwuAiKyoHZgzoCZ0xvjGtYjqxz19GO/WHCcGnno1 ePOA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=x/hIE+TfQ7LP+yC/1pRdwcguGPKMPE2Y/NF68OXmXec=; b=ZGqZBfuf8S1AQ2Soo2rt70jy173oUm317vAL59WfcyatAqYMHyamDMTIE21gYPb4Yn 8tsuSo17ndjdfPXy59SFm4ZJx6uhKzH3+arWYb3nd9RfJ1oHGYO1KsW5Tp/sBAiPMoSm /wrBTiP3d0aV8WeW1PF/HeZbEIrPMwpHTvqss5vsXrbf1ab8pr8l7R23qsmuO94utXBI BPbKbHinq+SbXVSX/I8vl5QkYZYwUuapvN9NQy6Tq9MNqVwydL3IRSBijNP3QaTD6T34 NoN080/bwKESwkm84x60qCKDMqL54MdUhc80F/DafLZN5/g0m5AHPTEVp8cBYKKG7Z+1 wHAw== X-Gm-Message-State: AOAM530PjruS+cJlaS7SUJstE85AE3J121OB1YxvOeF1mR0O7IHMMRYW m3MSoHilefW740yLflrWtr2P0uKdrep+wU9F9aum6ll/iwhFOA== X-Google-Smtp-Source: ABdhPJx4m2nXjgYtSc0XIoBs8BEFa/ZJqBRWEQ3V7lQx5fk8M2OaPFqewqdMxV+oaN0kli2KQkb0f4Y8tUk3hcXt3hI= X-Received: by 2002:a25:541:: with SMTP id 62mr3104825ybf.165.1632789138072; Mon, 27 Sep 2021 17:32:18 -0700 (PDT) MIME-Version: 1.0 References: <202109141042.18EAgYCI041614@gitrepo.freebsd.org> In-Reply-To: <202109141042.18EAgYCI041614@gitrepo.freebsd.org> From: Marcin Wojtas Date: Tue, 28 Sep 2021 02:32:07 +0200 Message-ID: Subject: Re: git: c6f3076d4405 - main - Move the GICv2m msi handling to the parent To: Andrew Turner Cc: src-committers , dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: 4HJL76646Zz3Hlg X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=semihalf-com.20210112.gappssmtp.com header.s=20210112 header.b=VIbciaeq; dmarc=none; spf=none (mx1.freebsd.org: domain of mw@semihalf.com has no SPF policy when checking 2607:f8b0:4864:20::b31) smtp.mailfrom=mw@semihalf.com X-Spamd-Result: default: False [-3.30 / 15.00]; RCVD_TLS_ALL(0.00)[]; ARC_NA(0.00)[]; R_DKIM_ALLOW(-0.20)[semihalf-com.20210112.gappssmtp.com:s=20210112]; FREEFALL_USER(0.00)[mw]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; TO_DN_SOME(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[dev-commits-src-main@freebsd.org]; DMARC_NA(0.00)[semihalf.com]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[semihalf-com.20210112.gappssmtp.com:+]; NEURAL_HAM_SHORT(-1.00)[-1.000]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::b31:from]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; R_SPF_NA(0.00)[no SPF record]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; RCVD_COUNT_TWO(0.00)[2]; MAILMAN_DEST(0.00)[dev-commits-src-main] X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Sep 2021 00:32:19 -0000 Hi Andrew, wt., 14 wrz 2021 o 12:42 Andrew Turner napisa=C5=82(a)= : > > The branch main has been updated by andrew: > > URL: https://cgit.FreeBSD.org/src/commit/?id=3Dc6f3076d44055f7b02467ce074= 210f73d0ce0ef6 > > commit c6f3076d44055f7b02467ce074210f73d0ce0ef6 > Author: Andrew Turner > AuthorDate: 2021-09-01 09:39:01 +0000 > Commit: Andrew Turner > CommitDate: 2021-09-14 07:24:52 +0000 > > Move the GICv2m msi handling to the parent > > This is in preperation for adding support for the GICv2m driver as a > child of the GICv3 driver. > > PR: 258136 > Reported by: trasz > Sponsored by: The FreeBSD Foundation > Differential Revision: https://reviews.freebsd.org/D31767 > --- > sys/arm/arm/gic.c | 296 ++++++++++++++++++++++++++++++-----------= ------ > sys/arm/arm/gic.h | 8 +- > sys/arm/arm/gic_common.h | 4 + > 3 files changed, 195 insertions(+), 113 deletions(-) > > diff --git a/sys/arm/arm/gic.c b/sys/arm/arm/gic.c > index 1851e69644ed..bd34e92b9e28 100644 > --- a/sys/arm/arm/gic.c > +++ b/sys/arm/arm/gic.c > @@ -501,6 +501,56 @@ arm_gic_read_ivar(device_t dev, device_t child, int = which, uintptr_t *result) > ("arm_gic_read_ivar: Invalid bus type %u", sc->gic_bu= s)); > *result =3D sc->gic_bus; > return (0); > + case GIC_IVAR_MBI_START: > + *result =3D sc->sc_spi_start; > + return (0); > + case GIC_IVAR_MBI_COUNT: > + *result =3D sc->sc_spi_count; > + return (0); > + } > + > + return (ENOENT); > +} > + > +static int > +arm_gic_write_ivar(device_t dev, device_t child, int which, uintptr_t va= lue) > +{ > + struct arm_gic_softc *sc; > + > + sc =3D device_get_softc(dev); > + > + switch(which) { > + case GIC_IVAR_HW_REV: > + case GIC_IVAR_BUS: > + return (EINVAL); > + case GIC_IVAR_MBI_START: > + /* > + * GIC_IVAR_MBI_START must be set once and first. This al= lows > + * us to reserve the registers when GIC_IVAR_MBI_COUNT is= set. > + */ > + MPASS(sc->sc_spi_start =3D=3D 0); > + MPASS(sc->sc_spi_count =3D=3D 0); This patch breaks GICv2m on all Marvell Armada 7k8k and CN913x. After reverting it works as expected. I tried removing the above 2 asserts + the one in line 540 - instead of init it fails later, during PCIE endpoint msix configuration: em0: Using 1024 TX descriptors and 1024 RX descriptors em0: Using 2 RX queues 2 TX queues panic: mtx_lock() of spin mutex GIC lock @ /home/mw/current/sys/arm/arm/gic.c:1145 cpuid =3D 0 time =3D 1 KDB: stack backtrace: db_trace_self() at db_trace_self db_trace_self_wrapper() at db_trace_self_wrapper+0x30 vpanic() at vpanic+0x184 panic() at panic+0x44 __mtx_lock_flags() at __mtx_lock_flags+0x1a8 arm_gic_alloc_msix() at arm_gic_alloc_msix+0x40 intr_alloc_msix() at intr_alloc_msix+0x190 generic_pcie_acpi_alloc_msix() at generic_pcie_acpi_alloc_msix+0x78 pci_alloc_msix_method() at pci_alloc_msix_method+0x1a8 iflib_device_register() at iflib_device_register+0xae4 iflib_device_attach() at iflib_device_attach+0xd0 device_attach() at device_attach+0x410 device_probe_and_attach() at device_probe_and_attach+0x7c bus_generic_attach() at bus_generic_attach+0x18 pci_attach() at pci_attach+0xe8 device_attach() at device_attach+0x410 device_probe_and_attach() at device_probe_and_attach+0x7c bus_generic_attach() at bus_generic_attach+0x18 device_attach() at device_attach+0x410 device_probe_and_attach() at device_probe_and_attach+0x7c bus_generic_new_pass() at bus_generic_new_pass+0xec bus_generic_new_pass() at bus_generic_new_pass+0xd0 bus_generic_new_pass() at bus_generic_new_pass+0xd0 bus_set_pass() at bus_set_pass+0x8c mi_startup() at mi_startup+0x12c virtdone() at virtdone+0x6c KDB: enter: panic [ thread pid 0 tid 100000 ] Stopped at kdb_enter+0x44: undefined f900c11f Any ideas? Best regards, Marcin > + MPASS(value >=3D GIC_FIRST_SPI); > + MPASS(value < sc->nirqs); > + > + sc->sc_spi_start =3D value; > + return (0); > + case GIC_IVAR_MBI_COUNT: > + MPASS(sc->sc_spi_start !=3D 0); > + MPASS(sc->sc_spi_count =3D=3D 0); > + MPASS(value >=3D sc->sc_spi_start); > + MPASS(value >=3D GIC_FIRST_SPI); > + > + sc->sc_spi_count =3D value; > + sc->sc_spi_end =3D sc->sc_spi_start + sc->sc_spi_count; > + > + MPASS(sc->sc_spi_end <=3D sc->nirqs); > + > + /* Reserve these interrupts for MSI/MSI-X use */ > + arm_gic_reserve_msi_range(dev, sc->sc_spi_start, > + sc->sc_spi_count); > + > + return (0); > } > > return (ENOENT); > @@ -995,99 +1045,20 @@ arm_gic_ipi_setup(device_t dev, u_int ipi, struct = intr_irqsrc **isrcp) > } > #endif > > -static device_method_t arm_gic_methods[] =3D { > - /* Bus interface */ > - DEVMETHOD(bus_print_child, arm_gic_print_child), > - DEVMETHOD(bus_add_child, bus_generic_add_child), > - DEVMETHOD(bus_alloc_resource, arm_gic_alloc_resource), > - DEVMETHOD(bus_release_resource, bus_generic_release_resource), > - DEVMETHOD(bus_activate_resource,bus_generic_activate_resource), > - DEVMETHOD(bus_read_ivar, arm_gic_read_ivar), > - > - /* Interrupt controller interface */ > - DEVMETHOD(pic_disable_intr, arm_gic_disable_intr), > - DEVMETHOD(pic_enable_intr, arm_gic_enable_intr), > - DEVMETHOD(pic_map_intr, arm_gic_map_intr), > - DEVMETHOD(pic_setup_intr, arm_gic_setup_intr), > - DEVMETHOD(pic_teardown_intr, arm_gic_teardown_intr), > - DEVMETHOD(pic_post_filter, arm_gic_post_filter), > - DEVMETHOD(pic_post_ithread, arm_gic_post_ithread), > - DEVMETHOD(pic_pre_ithread, arm_gic_pre_ithread), > -#ifdef SMP > - DEVMETHOD(pic_bind_intr, arm_gic_bind_intr), > - DEVMETHOD(pic_init_secondary, arm_gic_init_secondary), > - DEVMETHOD(pic_ipi_send, arm_gic_ipi_send), > - DEVMETHOD(pic_ipi_setup, arm_gic_ipi_setup), > -#endif > - { 0, 0 } > -}; > - > -DEFINE_CLASS_0(gic, arm_gic_driver, arm_gic_methods, > - sizeof(struct arm_gic_softc)); > - > -/* > - * GICv2m support -- the GICv2 MSI/MSI-X controller. > - */ > - > -#define GICV2M_MSI_TYPER 0x008 > -#define MSI_TYPER_SPI_BASE(x) (((x) >> 16) & 0x3ff) > -#define MSI_TYPER_SPI_COUNT(x) (((x) >> 0) & 0x3ff) > -#define GICv2M_MSI_SETSPI_NS 0x040 > -#define GICV2M_MSI_IIDR 0xFCC > - > -int > -arm_gicv2m_attach(device_t dev) > -{ > - struct arm_gicv2m_softc *sc; > - uint32_t typer; > - int rid; > - > - sc =3D device_get_softc(dev); > - > - rid =3D 0; > - sc->sc_mem =3D bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, > - RF_ACTIVE); > - if (sc->sc_mem =3D=3D NULL) { > - device_printf(dev, "Unable to allocate resources\n"); > - return (ENXIO); > - } > - > - typer =3D bus_read_4(sc->sc_mem, GICV2M_MSI_TYPER); > - sc->sc_spi_start =3D MSI_TYPER_SPI_BASE(typer); > - sc->sc_spi_count =3D MSI_TYPER_SPI_COUNT(typer); > - sc->sc_spi_end =3D sc->sc_spi_start + sc->sc_spi_count; > - > - /* Reserve these interrupts for MSI/MSI-X use */ > - arm_gic_reserve_msi_range(device_get_parent(dev), sc->sc_spi_star= t, > - sc->sc_spi_count); > - > - mtx_init(&sc->sc_mutex, "GICv2m lock", NULL, MTX_DEF); > - > - intr_msi_register(dev, sc->sc_xref); > - > - if (bootverbose) > - device_printf(dev, "using spi %u to %u\n", sc->sc_spi_sta= rt, > - sc->sc_spi_start + sc->sc_spi_count - 1); > - > - return (0); > -} > - > static int > -arm_gicv2m_alloc_msi(device_t dev, device_t child, int count, int maxcou= nt, > +arm_gic_alloc_msi(device_t dev, device_t child, int count, int maxcount, > device_t *pic, struct intr_irqsrc **srcs) > { > - struct arm_gic_softc *psc; > - struct arm_gicv2m_softc *sc; > + struct arm_gic_softc *sc; > int i, irq, end_irq; > bool found; > > KASSERT(powerof2(count), ("%s: bad count", __func__)); > KASSERT(powerof2(maxcount), ("%s: bad maxcount", __func__)); > > - psc =3D device_get_softc(device_get_parent(dev)); > sc =3D device_get_softc(dev); > > - mtx_lock(&sc->sc_mutex); > + mtx_lock(&sc->mutex); > > found =3D false; > for (irq =3D sc->sc_spi_start; irq < sc->sc_spi_end; irq++) { > @@ -1106,11 +1077,11 @@ arm_gicv2m_alloc_msi(device_t dev, device_t child= , int count, int maxcount, > break; > } > > - KASSERT((psc->gic_irqs[end_irq].gi_flags & GI_FLA= G_MSI)!=3D 0, > + KASSERT((sc->gic_irqs[end_irq].gi_flags & GI_FLAG= _MSI)!=3D 0, > ("%s: Non-MSI interrupt found", __func__)); > > /* This is already used */ > - if ((psc->gic_irqs[end_irq].gi_flags & GI_FLAG_MS= I_USED) =3D=3D > + if ((sc->gic_irqs[end_irq].gi_flags & GI_FLAG_MSI= _USED) =3D=3D > GI_FLAG_MSI_USED) { > found =3D false; > break; > @@ -1122,34 +1093,34 @@ arm_gicv2m_alloc_msi(device_t dev, device_t child= , int count, int maxcount, > > /* Not enough interrupts were found */ > if (!found || irq =3D=3D sc->sc_spi_end) { > - mtx_unlock(&sc->sc_mutex); > + mtx_unlock(&sc->mutex); > return (ENXIO); > } > > for (i =3D 0; i < count; i++) { > /* Mark the interrupt as used */ > - psc->gic_irqs[irq + i].gi_flags |=3D GI_FLAG_MSI_USED; > + sc->gic_irqs[irq + i].gi_flags |=3D GI_FLAG_MSI_USED; > } > - mtx_unlock(&sc->sc_mutex); > + mtx_unlock(&sc->mutex); > > for (i =3D 0; i < count; i++) > - srcs[i] =3D (struct intr_irqsrc *)&psc->gic_irqs[irq + i]= ; > - *pic =3D device_get_parent(dev); > + srcs[i] =3D (struct intr_irqsrc *)&sc->gic_irqs[irq + i]; > + *pic =3D dev; > > return (0); > } > > static int > -arm_gicv2m_release_msi(device_t dev, device_t child, int count, > +arm_gic_release_msi(device_t dev, device_t child, int count, > struct intr_irqsrc **isrc) > { > - struct arm_gicv2m_softc *sc; > + struct arm_gic_softc *sc; > struct gic_irqsrc *gi; > int i; > > sc =3D device_get_softc(dev); > > - mtx_lock(&sc->sc_mutex); > + mtx_lock(&sc->mutex); > for (i =3D 0; i < count; i++) { > gi =3D (struct gic_irqsrc *)isrc[i]; > > @@ -1159,50 +1130,48 @@ arm_gicv2m_release_msi(device_t dev, device_t chi= ld, int count, > > gi->gi_flags &=3D ~GI_FLAG_MSI_USED; > } > - mtx_unlock(&sc->sc_mutex); > + mtx_unlock(&sc->mutex); > > return (0); > } > > static int > -arm_gicv2m_alloc_msix(device_t dev, device_t child, device_t *pic, > +arm_gic_alloc_msix(device_t dev, device_t child, device_t *pic, > struct intr_irqsrc **isrcp) > { > - struct arm_gicv2m_softc *sc; > - struct arm_gic_softc *psc; > + struct arm_gic_softc *sc; > int irq; > > - psc =3D device_get_softc(device_get_parent(dev)); > sc =3D device_get_softc(dev); > > - mtx_lock(&sc->sc_mutex); > + mtx_lock(&sc->mutex); > /* Find an unused interrupt */ > for (irq =3D sc->sc_spi_start; irq < sc->sc_spi_end; irq++) { > - KASSERT((psc->gic_irqs[irq].gi_flags & GI_FLAG_MSI) !=3D = 0, > + KASSERT((sc->gic_irqs[irq].gi_flags & GI_FLAG_MSI) !=3D 0= , > ("%s: Non-MSI interrupt found", __func__)); > - if ((psc->gic_irqs[irq].gi_flags & GI_FLAG_MSI_USED) =3D= =3D 0) > + if ((sc->gic_irqs[irq].gi_flags & GI_FLAG_MSI_USED) =3D= =3D 0) > break; > } > /* No free interrupt was found */ > if (irq =3D=3D sc->sc_spi_end) { > - mtx_unlock(&sc->sc_mutex); > + mtx_unlock(&sc->mutex); > return (ENXIO); > } > > /* Mark the interrupt as used */ > - psc->gic_irqs[irq].gi_flags |=3D GI_FLAG_MSI_USED; > - mtx_unlock(&sc->sc_mutex); > + sc->gic_irqs[irq].gi_flags |=3D GI_FLAG_MSI_USED; > + mtx_unlock(&sc->mutex); > > - *isrcp =3D (struct intr_irqsrc *)&psc->gic_irqs[irq]; > - *pic =3D device_get_parent(dev); > + *isrcp =3D (struct intr_irqsrc *)&sc->gic_irqs[irq]; > + *pic =3D dev; > > return (0); > } > > static int > -arm_gicv2m_release_msix(device_t dev, device_t child, struct intr_irqsrc= *isrc) > +arm_gic_release_msix(device_t dev, device_t child, struct intr_irqsrc *i= src) > { > - struct arm_gicv2m_softc *sc; > + struct arm_gic_softc *sc; > struct gic_irqsrc *gi; > > sc =3D device_get_softc(dev); > @@ -1211,13 +1180,122 @@ arm_gicv2m_release_msix(device_t dev, device_t c= hild, struct intr_irqsrc *isrc) > KASSERT((gi->gi_flags & GI_FLAG_MSI_USED) =3D=3D GI_FLAG_MSI_USED= , > ("%s: Trying to release an unused MSI-X interrupt", __func__)= ); > > - mtx_lock(&sc->sc_mutex); > + mtx_lock(&sc->mutex); > gi->gi_flags &=3D ~GI_FLAG_MSI_USED; > - mtx_unlock(&sc->sc_mutex); > + mtx_unlock(&sc->mutex); > > return (0); > } > > +static device_method_t arm_gic_methods[] =3D { > + /* Bus interface */ > + DEVMETHOD(bus_print_child, arm_gic_print_child), > + DEVMETHOD(bus_add_child, bus_generic_add_child), > + DEVMETHOD(bus_alloc_resource, arm_gic_alloc_resource), > + DEVMETHOD(bus_release_resource, bus_generic_release_resource), > + DEVMETHOD(bus_activate_resource,bus_generic_activate_resource), > + DEVMETHOD(bus_read_ivar, arm_gic_read_ivar), > + DEVMETHOD(bus_write_ivar, arm_gic_write_ivar), > + > + /* Interrupt controller interface */ > + DEVMETHOD(pic_disable_intr, arm_gic_disable_intr), > + DEVMETHOD(pic_enable_intr, arm_gic_enable_intr), > + DEVMETHOD(pic_map_intr, arm_gic_map_intr), > + DEVMETHOD(pic_setup_intr, arm_gic_setup_intr), > + DEVMETHOD(pic_teardown_intr, arm_gic_teardown_intr), > + DEVMETHOD(pic_post_filter, arm_gic_post_filter), > + DEVMETHOD(pic_post_ithread, arm_gic_post_ithread), > + DEVMETHOD(pic_pre_ithread, arm_gic_pre_ithread), > +#ifdef SMP > + DEVMETHOD(pic_bind_intr, arm_gic_bind_intr), > + DEVMETHOD(pic_init_secondary, arm_gic_init_secondary), > + DEVMETHOD(pic_ipi_send, arm_gic_ipi_send), > + DEVMETHOD(pic_ipi_setup, arm_gic_ipi_setup), > +#endif > + > + /* MSI/MSI-X */ > + DEVMETHOD(msi_alloc_msi, arm_gic_alloc_msi), > + DEVMETHOD(msi_release_msi, arm_gic_release_msi), > + DEVMETHOD(msi_alloc_msix, arm_gic_alloc_msix), > + DEVMETHOD(msi_release_msix, arm_gic_release_msix), > + > + { 0, 0 } > +}; > + > +DEFINE_CLASS_0(gic, arm_gic_driver, arm_gic_methods, > + sizeof(struct arm_gic_softc)); > + > +/* > + * GICv2m support -- the GICv2 MSI/MSI-X controller. > + */ > + > +#define GICV2M_MSI_TYPER 0x008 > +#define MSI_TYPER_SPI_BASE(x) (((x) >> 16) & 0x3ff) > +#define MSI_TYPER_SPI_COUNT(x) (((x) >> 0) & 0x3ff) > +#define GICv2M_MSI_SETSPI_NS 0x040 > +#define GICV2M_MSI_IIDR 0xFCC > + > +int > +arm_gicv2m_attach(device_t dev) > +{ > + struct arm_gicv2m_softc *sc; > + uint32_t typer; > + u_int spi_start, spi_count; > + int rid; > + > + sc =3D device_get_softc(dev); > + > + rid =3D 0; > + sc->sc_mem =3D bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, > + RF_ACTIVE); > + if (sc->sc_mem =3D=3D NULL) { > + device_printf(dev, "Unable to allocate resources\n"); > + return (ENXIO); > + } > + > + typer =3D bus_read_4(sc->sc_mem, GICV2M_MSI_TYPER); > + spi_start =3D MSI_TYPER_SPI_BASE(typer); > + spi_count =3D MSI_TYPER_SPI_COUNT(typer); > + gic_set_mbi_start(dev, spi_start); > + gic_set_mbi_count(dev, spi_count); > + > + intr_msi_register(dev, sc->sc_xref); > + > + if (bootverbose) > + device_printf(dev, "using spi %u to %u\n", spi_start, > + spi_start + spi_count - 1); > + > + return (0); > +} > + > +static int > +arm_gicv2m_alloc_msi(device_t dev, device_t child, int count, int maxcou= nt, > + device_t *pic, struct intr_irqsrc **srcs) > +{ > + return (MSI_ALLOC_MSI(device_get_parent(dev), child, count, maxco= unt, > + pic, srcs)); > +} > + > +static int > +arm_gicv2m_release_msi(device_t dev, device_t child, int count, > + struct intr_irqsrc **isrc) > +{ > + return (MSI_RELEASE_MSI(device_get_parent(dev), child, count, isr= c)); > +} > + > +static int > +arm_gicv2m_alloc_msix(device_t dev, device_t child, device_t *pic, > + struct intr_irqsrc **isrcp) > +{ > + return (MSI_ALLOC_MSIX(device_get_parent(dev), child, pic, isrcp)= ); > +} > + > +static int > +arm_gicv2m_release_msix(device_t dev, device_t child, struct intr_irqsrc= *isrc) > +{ > + return (MSI_RELEASE_MSIX(device_get_parent(dev), child, isrc)); > +} > + > static int > arm_gicv2m_map_msi(device_t dev, device_t child, struct intr_irqsrc *isr= c, > uint64_t *addr, uint32_t *data) > diff --git a/sys/arm/arm/gic.h b/sys/arm/arm/gic.h > index 74cfbbee9d5a..55f7f0cc5e44 100644 > --- a/sys/arm/arm/gic.h > +++ b/sys/arm/arm/gic.h > @@ -63,17 +63,17 @@ struct arm_gic_softc { > > int nranges; > struct arm_gic_range * ranges; > + > + u_int sc_spi_start; > + u_int sc_spi_end; > + u_int sc_spi_count; > }; > > DECLARE_CLASS(arm_gic_driver); > > struct arm_gicv2m_softc { > struct resource *sc_mem; > - struct mtx sc_mutex; > uintptr_t sc_xref; > - u_int sc_spi_start; > - u_int sc_spi_end; > - u_int sc_spi_count; > }; > > DECLARE_CLASS(arm_gicv2m_driver); > diff --git a/sys/arm/arm/gic_common.h b/sys/arm/arm/gic_common.h > index 9e8fb19300ca..52827d03e600 100644 > --- a/sys/arm/arm/gic_common.h > +++ b/sys/arm/arm/gic_common.h > @@ -33,6 +33,8 @@ > > #define GIC_IVAR_HW_REV 500 > #define GIC_IVAR_BUS 501 > +#define GIC_IVAR_MBI_START 510 > +#define GIC_IVAR_MBI_COUNT 511 > > /* GIC_IVAR_BUS values */ > #define GIC_BUS_UNKNOWN 0 > @@ -42,6 +44,8 @@ > > __BUS_ACCESSOR(gic, hw_rev, GIC, HW_REV, u_int); > __BUS_ACCESSOR(gic, bus, GIC, BUS, u_int); > +__BUS_ACCESSOR(gic, mbi_start, GIC, MBI_START, u_int); > +__BUS_ACCESSOR(gic, mbi_count, GIC, MBI_COUNT, u_int); > > /* Software Generated Interrupts */ > #define GIC_FIRST_SGI 0 /* Irqs 0-15 are SGIs/IPI= s. */ From owner-dev-commits-src-main@freebsd.org Tue Sep 28 00:42:01 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E9723673A03 for ; Tue, 28 Sep 2021 00:42:01 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: from mail-wm1-f53.google.com (mail-wm1-f53.google.com [209.85.128.53]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HJLLK5zRbz3JNZ for ; Tue, 28 Sep 2021 00:42:01 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: by mail-wm1-f53.google.com with SMTP id z2so1975013wmc.3 for ; Mon, 27 Sep 2021 17:42:01 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=K69RWyW5Qg3EE9s3ByFGM2CuIrjDZD4vZJSeNDZWrng=; b=FUAmB+4d5qTPocwn9MFViBM8ZqGfI7Ad4zjTrvKFQSdPYrkcXWcczlADQtO2UvSB2E SRrMPwaytpk5dZxLRQ5bDDcxKWUJ0Oa8CYkR0Ykv6n4aSehpgXIt4yLKb/xfRZSjeUq0 /P8YG3MDVYNMVDCbun8+6GCopVxoMUQNKWGUvnVS6eNksqyBTNuG4+126i4LB5ugWofv +1+xyRJk6umGOdBAEbw3i7mqtIBtx1Vu/NBGIVC2XvoO+aInWDsmLYFm3G/vS6/AcHt/ u7VabjLbtHRwRMyLATv/D/9ZpjGUerjVlIREW2HBnqqMPGIzwxNocbgMhH6p5ug1CY+N lWXg== X-Gm-Message-State: AOAM533JvFAAGvoU0E8kPit0wH9s93j1hXVTFDrEK/n89xEaS+K4FXqT 3bWVVryy/1VBYysqh+l4RgOcHw== X-Google-Smtp-Source: ABdhPJwv3ZsCHHD4rdNf6zonY4DcNpBubUog72EIM+46afjxb8Y3Xer9QIdeMlI3NrCzQcnIT3HoTQ== X-Received: by 2002:a1c:ac03:: with SMTP id v3mr1969414wme.127.1632789714900; Mon, 27 Sep 2021 17:41:54 -0700 (PDT) Received: from smtpclient.apple (global-5-143.nat-2.net.cam.ac.uk. [131.111.5.143]) by smtp.gmail.com with ESMTPSA id d70sm970950wmd.3.2021.09.27.17.41.54 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 27 Sep 2021 17:41:54 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.120.0.1.13\)) Subject: Re: git: c6f3076d4405 - main - Move the GICv2m msi handling to the parent From: Jessica Clarke In-Reply-To: Date: Tue, 28 Sep 2021 01:41:53 +0100 Cc: Andrew Turner , src-committers , dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <57F5F872-08A5-45D0-AD47-C0F39B0FDFD9@freebsd.org> References: <202109141042.18EAgYCI041614@gitrepo.freebsd.org> To: Marcin Wojtas X-Mailer: Apple Mail (2.3654.120.0.1.13) X-Rspamd-Queue-Id: 4HJLLK5zRbz3JNZ X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Sep 2021 00:42:02 -0000 On 28 Sep 2021, at 01:32, Marcin Wojtas wrote: >=20 > Hi Andrew, >=20 >=20 > wt., 14 wrz 2021 o 12:42 Andrew Turner = napisa=C5=82(a): >>=20 >> The branch main has been updated by andrew: >>=20 >> URL: = https://cgit.FreeBSD.org/src/commit/?id=3Dc6f3076d44055f7b02467ce074210f73= d0ce0ef6 >>=20 >> commit c6f3076d44055f7b02467ce074210f73d0ce0ef6 >> Author: Andrew Turner >> AuthorDate: 2021-09-01 09:39:01 +0000 >> Commit: Andrew Turner >> CommitDate: 2021-09-14 07:24:52 +0000 >>=20 >> Move the GICv2m msi handling to the parent >>=20 >> This is in preperation for adding support for the GICv2m driver as = a >> child of the GICv3 driver. >>=20 >> PR: 258136 >> Reported by: trasz >> Sponsored by: The FreeBSD Foundation >> Differential Revision: https://reviews.freebsd.org/D31767 >> --- >> sys/arm/arm/gic.c | 296 = ++++++++++++++++++++++++++++++----------------- >> sys/arm/arm/gic.h | 8 +- >> sys/arm/arm/gic_common.h | 4 + >> 3 files changed, 195 insertions(+), 113 deletions(-) >>=20 >> diff --git a/sys/arm/arm/gic.c b/sys/arm/arm/gic.c >> index 1851e69644ed..bd34e92b9e28 100644 >> --- a/sys/arm/arm/gic.c >> +++ b/sys/arm/arm/gic.c >> @@ -501,6 +501,56 @@ arm_gic_read_ivar(device_t dev, device_t child, = int which, uintptr_t *result) >> ("arm_gic_read_ivar: Invalid bus type %u", = sc->gic_bus)); >> *result =3D sc->gic_bus; >> return (0); >> + case GIC_IVAR_MBI_START: >> + *result =3D sc->sc_spi_start; >> + return (0); >> + case GIC_IVAR_MBI_COUNT: >> + *result =3D sc->sc_spi_count; >> + return (0); >> + } >> + >> + return (ENOENT); >> +} >> + >> +static int >> +arm_gic_write_ivar(device_t dev, device_t child, int which, = uintptr_t value) >> +{ >> + struct arm_gic_softc *sc; >> + >> + sc =3D device_get_softc(dev); >> + >> + switch(which) { >> + case GIC_IVAR_HW_REV: >> + case GIC_IVAR_BUS: >> + return (EINVAL); >> + case GIC_IVAR_MBI_START: >> + /* >> + * GIC_IVAR_MBI_START must be set once and first. = This allows >> + * us to reserve the registers when = GIC_IVAR_MBI_COUNT is set. >> + */ >> + MPASS(sc->sc_spi_start =3D=3D 0); >> + MPASS(sc->sc_spi_count =3D=3D 0); >=20 > This patch breaks GICv2m on all Marvell Armada 7k8k and CN913x. After > reverting it works as expected. I tried removing the above 2 asserts + > the one in line 540 - instead of init it fails later, during PCIE > endpoint msix configuration: >=20 > em0: Using 1024 TX descriptors and 1024 RX descriptors > em0: Using 2 RX queues 2 TX queues > panic: mtx_lock() of spin mutex GIC lock @ > /home/mw/current/sys/arm/arm/gic.c:1145 > cpuid =3D 0 > time =3D 1 > KDB: stack backtrace: > db_trace_self() at db_trace_self > db_trace_self_wrapper() at db_trace_self_wrapper+0x30 > vpanic() at vpanic+0x184 > panic() at panic+0x44 > __mtx_lock_flags() at __mtx_lock_flags+0x1a8 > arm_gic_alloc_msix() at arm_gic_alloc_msix+0x40 > intr_alloc_msix() at intr_alloc_msix+0x190 > generic_pcie_acpi_alloc_msix() at generic_pcie_acpi_alloc_msix+0x78 > pci_alloc_msix_method() at pci_alloc_msix_method+0x1a8 > iflib_device_register() at iflib_device_register+0xae4 > iflib_device_attach() at iflib_device_attach+0xd0 > device_attach() at device_attach+0x410 > device_probe_and_attach() at device_probe_and_attach+0x7c > bus_generic_attach() at bus_generic_attach+0x18 > pci_attach() at pci_attach+0xe8 > device_attach() at device_attach+0x410 > device_probe_and_attach() at device_probe_and_attach+0x7c > bus_generic_attach() at bus_generic_attach+0x18 > device_attach() at device_attach+0x410 > device_probe_and_attach() at device_probe_and_attach+0x7c > bus_generic_new_pass() at bus_generic_new_pass+0xec > bus_generic_new_pass() at bus_generic_new_pass+0xd0 > bus_generic_new_pass() at bus_generic_new_pass+0xd0 > bus_set_pass() at bus_set_pass+0x8c > mi_startup() at mi_startup+0x12c > virtdone() at virtdone+0x6c > KDB: enter: panic > [ thread pid 0 tid 100000 ] > Stopped at kdb_enter+0x44: undefined f900c11f >=20 > Any ideas? Change all the mtx_(un)lock(&sc->mutex) to be the _spin versions. Jess From owner-dev-commits-src-main@freebsd.org Tue Sep 28 03:05:09 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8C02D675584; Tue, 28 Sep 2021 03:05:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HJPWT3FcKz3hR8; Tue, 28 Sep 2021 03:05:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 457111C779; Tue, 28 Sep 2021 03:05:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18S359xO029010; Tue, 28 Sep 2021 03:05:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18S359dk029009; Tue, 28 Sep 2021 03:05:09 GMT (envelope-from git) Date: Tue, 28 Sep 2021 03:05:09 GMT Message-Id: <202109280305.18S359dk029009@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kirk McKusick Subject: git: 1c8d670cb633 - main - Bring the tags and links entries for amd64 up to date. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mckusick X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 1c8d670cb633d39cea68cdeecab507d2ee264705 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Sep 2021 03:05:09 -0000 The branch main has been updated by mckusick: URL: https://cgit.FreeBSD.org/src/commit/?id=1c8d670cb633d39cea68cdeecab507d2ee264705 commit 1c8d670cb633d39cea68cdeecab507d2ee264705 Author: Kirk McKusick AuthorDate: 2021-09-23 23:38:37 +0000 Commit: Kirk McKusick CommitDate: 2021-09-28 03:04:51 +0000 Bring the tags and links entries for amd64 up to date. MFC after: 1 week Sponsored by: Netflix --- sys/amd64/Makefile | 8 +++++--- sys/kern/Make.tags.inc | 6 ------ 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/sys/amd64/Makefile b/sys/amd64/Makefile index 2e87b95895e7..0f1367f859f2 100644 --- a/sys/amd64/Makefile +++ b/sys/amd64/Makefile @@ -14,7 +14,7 @@ all: @echo "make links or tags only" # Directories in which to place amd64 tags links -DAMD64= acpica amd64 ia32 include linux linux32 pci vmm +DAMD64= acpica amd64 ia32 include linux linux32 pci sgx vmm links:: -for i in ${COMMDIR1}; do \ @@ -22,13 +22,13 @@ links:: -for i in ${COMMDIR2}; do \ (cd $$i && { rm -f tags; ln -s ../../${TAGDIR}/tags tags; }) done -for i in ${DAMD64}; do \ - (cd $$i && { rm -f tags; ln -s ../tags tags; }) done + (cd ${SYS}/amd64/$$i && { rm -f tags; ln -s ../tags tags; }) done SAMD64= ${SYS}/amd64/acpica/*.[ch] \ ${SYS}/amd64/amd64/*.[ch] ${SYS}/amd64/ia32/*.[ch] \ ${SYS}/amd64/include/*.[ch] ${SYS}/amd64/linux/*.[ch] \ ${SYS}/amd64/linux32/*.[ch] ${SYS}/amd64/pci/*.[ch] \ - ${SYS}/amd64/vmm/*.[ch] + ${SYS}/amd64/sgx/*.[ch] ${SYS}/amd64/vmm/*.[ch] AAMD64= ${SYS}/amd64/amd64/*.S tags:: @@ -38,3 +38,5 @@ tags:: >> tags sort -o tags tags chmod 444 tags + rm -f ${SYS}/amd64/tags + mv tags ${SYS}/amd64/tags diff --git a/sys/kern/Make.tags.inc b/sys/kern/Make.tags.inc index cdefa98a32f6..23a85150c19a 100644 --- a/sys/kern/Make.tags.inc +++ b/sys/kern/Make.tags.inc @@ -12,12 +12,10 @@ SYS?= ${.CURDIR}/.. COMM= ${SYS}/sys/vnode.h \ ${SYS}/dev/alc/*.[ch] \ - ${SYS}/dev/en/*.[ch] \ ${SYS}/dev/iicbus/*.[ch] \ ${SYS}/dev/isp/*.[ch] \ ${SYS}/dev/ppbus/*.[ch] \ ${SYS}/dev/smbus/*.[ch] \ - ${SYS}/dev/vx/*.[ch] \ ${SYS}/fs/autofs/*.[ch] \ ${SYS}/fs/cd9660/*.[ch] \ ${SYS}/fs/cuse/*.[ch] \ @@ -44,7 +42,6 @@ COMM= ${SYS}/sys/vnode.h \ ${SYS}/netinet/*.[ch] \ ${SYS}/netinet6/*.[ch] \ ${SYS}/netipsec/*.[ch] \ - ${SYS}/netnatm/*.[ch] \ ${SYS}/ddb/*.[ch] \ ${SYS}/ufs/ffs/*.[ch] \ ${SYS}/ufs/ufs/*.[ch] \ @@ -58,19 +55,16 @@ COMMDIR1= ${SYS}/conf \ ${SYS}/netinet \ ${SYS}/netinet6 \ ${SYS}/netipsec \ - ${SYS}/netnatm \ ${SYS}/ddb \ ${SYS}/vm \ ${SYS}/sys COMMDIR2= ${SYS}/dev/alc \ - ${SYS}/dev/en \ ${SYS}/dev/iicbus \ ${SYS}/dev/isp \ ${SYS}/dev/md \ ${SYS}/dev/ppbus \ ${SYS}/dev/smbus \ - ${SYS}/dev/vx \ ${SYS}/fs/autofs \ ${SYS}/fs/cd9660 \ ${SYS}/fs/cuse \ From owner-dev-commits-src-main@freebsd.org Tue Sep 28 03:05:10 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BBD646756FE; Tue, 28 Sep 2021 03:05:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HJPWV4rGFz3hWh; Tue, 28 Sep 2021 03:05:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 72D0D1CCFA; Tue, 28 Sep 2021 03:05:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18S35AGS029034; Tue, 28 Sep 2021 03:05:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18S35AmF029033; Tue, 28 Sep 2021 03:05:10 GMT (envelope-from git) Date: Tue, 28 Sep 2021 03:05:10 GMT Message-Id: <202109280305.18S35AmF029033@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kirk McKusick Subject: git: 4a365e863f20 - main - Avoid "consumer not attached in g_io_request" panic when disk lost while using a UFS snapshot. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mckusick X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 4a365e863f209b0c82641c909a858dab53b19134 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Sep 2021 03:05:10 -0000 The branch main has been updated by mckusick: URL: https://cgit.FreeBSD.org/src/commit/?id=4a365e863f209b0c82641c909a858dab53b19134 commit 4a365e863f209b0c82641c909a858dab53b19134 Author: Kirk McKusick AuthorDate: 2021-09-28 03:03:43 +0000 Commit: Kirk McKusick CommitDate: 2021-09-28 03:04:51 +0000 Avoid "consumer not attached in g_io_request" panic when disk lost while using a UFS snapshot. The UFS filesystem supports snapshots. Each snapshot is a file whose contents are a frozen image of the disk partition on which the filesystem resides. Each time an existing block in the filesystem is modified, the filesystem checks whether that block was in use at the time that the snapshot was taken. If so, and if it has not already been copied, a new block is allocated from among the blocks that were not in use at the time that the snapshot was taken and placed in the snapshot file to replace the entry that has not yet been copied. The previous contents of the block are copied to the newly allocated snapshot file block, and the write to the original is then allowed to proceed. The block allocation is done using the usual UFS_BALLOC() routine which allocates the needed block in the snapshot and returns a buffer that is set up to write data into the newly allocated block. In usual filesystem operation, the contents for the new block is copied from user space into the buffer and the buffer is then written to the file using bwrite(), bawrite(), or bdwrite(). In the case of a snapshot the new block must be filled from the disk block that is about to be rewritten. The snapshot routine has a function readblock() that it uses to read the `about to be rewritten' disk block. /* * Read the specified block into the given buffer. */ static int readblock(snapvp, bp, lbn) struct vnode *snapvp; struct buf *bp; ufs2_daddr_t lbn; { struct inode *ip; struct bio *bip; struct fs *fs; ip = VTOI(snapvp); fs = ITOFS(ip); bip = g_alloc_bio(); bip->bio_cmd = BIO_READ; bip->bio_offset = dbtob(fsbtodb(fs, blkstofrags(fs, lbn))); bip->bio_data = bp->b_data; bip->bio_length = bp->b_bcount; bip->bio_done = NULL; g_io_request(bip, ITODEVVP(ip)->v_bufobj.bo_private); bp->b_error = biowait(bip, "snaprdb"); g_destroy_bio(bip); return (bp->b_error); } When the underlying disk fails, its GEOM module is removed. Subsequent attempts to access it should return the ENXIO error. The functionality of checking for the lost disk and returning ENXIO is handled by the g_vfs_strategy() routine: void g_vfs_strategy(struct bufobj *bo, struct buf *bp) { struct g_vfs_softc *sc; struct g_consumer *cp; struct bio *bip; cp = bo->bo_private; sc = cp->geom->softc; /* * If the provider has orphaned us, just return ENXIO. */ mtx_lock(&sc->sc_mtx); if (sc->sc_orphaned || sc->sc_enxio_active) { mtx_unlock(&sc->sc_mtx); bp->b_error = ENXIO; bp->b_ioflags |= BIO_ERROR; bufdone(bp); return; } sc->sc_active++; mtx_unlock(&sc->sc_mtx); bip = g_alloc_bio(); bip->bio_cmd = bp->b_iocmd; bip->bio_offset = bp->b_iooffset; bip->bio_length = bp->b_bcount; bdata2bio(bp, bip); if ((bp->b_flags & B_BARRIER) != 0) { bip->bio_flags |= BIO_ORDERED; bp->b_flags &= ~B_BARRIER; } if (bp->b_iocmd == BIO_SPEEDUP) bip->bio_flags |= bp->b_ioflags; bip->bio_done = g_vfs_done; bip->bio_caller2 = bp; g_io_request(bip, cp); } Only after checking that the device is present does it construct the "bio" request and call g_io_request(). When readblock() constructs its own "bio" request and calls g_io_request() directly it panics with "consumer not attached in g_io_request" when the underlying device no longer exists. The fix is to have readblock() call g_vfs_strategy() rather than constructing its own "bio" request: /* * Read the specified block into the given buffer. */ static int readblock(snapvp, bp, lbn) struct vnode *snapvp; struct buf *bp; ufs2_daddr_t lbn; { struct inode *ip; struct fs *fs; ip = VTOI(snapvp); fs = ITOFS(ip); bp->b_iocmd = BIO_READ; bp->b_iooffset = dbtob(fsbtodb(fs, blkstofrags(fs, lbn))); bp->b_iodone = bdone; g_vfs_strategy(&ITODEVVP(ip)->v_bufobj, bp); bufwait(bp); return (bp->b_error); } Here it uses the buffer that will eventually be written to the disk. The g_vfs_strategy() routine uses four parts of the buffer: b_bcount, b_iocmd, b_iooffset, and b_data. The b_bcount field is already correctly set for the buffer. It is safe to set the b_iocmd and b_iooffset fields as they are set correctly when the later write is done. The write path will also clear the B_DONE flag that our use of the buffer will set. The b_iodone callback has to be set to bdone() which will do just notification that the I/O is done in bufdone(). The rest of bufdone() includes things like processing the softdeps associated with the buffer should not be done until the buffer has been written. Bufdone() will set b_iodone back to NULL after using it, so the full bufdone() processing will be done when the buffer is written. The final change from the previous version of readblock() is that it used the b_data for the destination of the read while g_vfs_strategy() uses the bdata2bio() function to take advantage of VMIO when it is available. Differential revision: https://reviews.freebsd.org/D32150 Reviewed by: kib, chs MFC after: 1 week Sponsored by: Netflix --- sys/ufs/ffs/ffs_snapshot.c | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/sys/ufs/ffs/ffs_snapshot.c b/sys/ufs/ffs/ffs_snapshot.c index baad50cab2ba..5855a679ab84 100644 --- a/sys/ufs/ffs/ffs_snapshot.c +++ b/sys/ufs/ffs/ffs_snapshot.c @@ -63,6 +63,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include @@ -2554,22 +2555,16 @@ readblock(vp, bp, lbn) ufs2_daddr_t lbn; { struct inode *ip; - struct bio *bip; struct fs *fs; ip = VTOI(vp); fs = ITOFS(ip); - bip = g_alloc_bio(); - bip->bio_cmd = BIO_READ; - bip->bio_offset = dbtob(fsbtodb(fs, blkstofrags(fs, lbn))); - bip->bio_data = bp->b_data; - bip->bio_length = bp->b_bcount; - bip->bio_done = NULL; - - g_io_request(bip, ITODEVVP(ip)->v_bufobj.bo_private); - bp->b_error = biowait(bip, "snaprdb"); - g_destroy_bio(bip); + bp->b_iocmd = BIO_READ; + bp->b_iooffset = dbtob(fsbtodb(fs, blkstofrags(fs, lbn))); + bp->b_iodone = bdone; + g_vfs_strategy(&ITODEVVP(ip)->v_bufobj, bp); + bufwait(bp); return (bp->b_error); } From owner-dev-commits-src-main@freebsd.org Tue Sep 28 06:56:26 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5237E678147; Tue, 28 Sep 2021 06:56:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HJVfL1mjGz4WPD; Tue, 28 Sep 2021 06:56:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1C7201F779; Tue, 28 Sep 2021 06:56:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18S6uQnT035764; Tue, 28 Sep 2021 06:56:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18S6uPZ5035763; Tue, 28 Sep 2021 06:56:25 GMT (envelope-from git) Date: Tue, 28 Sep 2021 06:56:25 GMT Message-Id: <202109280656.18S6uPZ5035763@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Navdeep Parhar Subject: git: 45d6fbaec23e - main - cxgbe(4): Update firmwares to 1.26.2.0. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: np X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 45d6fbaec23eee457197a14517e715c947114d99 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Sep 2021 06:56:26 -0000 The branch main has been updated by np: URL: https://cgit.FreeBSD.org/src/commit/?id=45d6fbaec23eee457197a14517e715c947114d99 commit 45d6fbaec23eee457197a14517e715c947114d99 Author: Navdeep Parhar AuthorDate: 2021-09-27 23:45:56 +0000 Commit: Navdeep Parhar CommitDate: 2021-09-28 06:52:51 +0000 cxgbe(4): Update firmwares to 1.26.2.0. The firmwares and the following changelog are from the "Chelsio Unified Wire v3.15.0.0 for Linux." Version : 1.26.2.0 Date : 09/24/2021 ==================== FIXES ----- BASE: - Added support for SFP+ RJ45 (0x1C). - Fixing backward compatibility issue with older drivers when multiple speeds are passed to firmware. OFLD: - Do not touch tp_plen_max if driver is supplying tp_plen_max. This fixes a connection reset issue in iscsi. ENHANCEMENTS ------------ BASE: - Firmware header modified to add firmware binary signature. MFC after: 1 month Sponsored by: Chelsio Communications --- sys/conf/files | 6 +++--- .../{t4fw-1.26.0.0.bin => t4fw-1.26.2.0.bin} | Bin 570368 -> 570368 bytes sys/dev/cxgbe/firmware/t4fw_interface.h | 12 ++++++++---- .../{t5fw-1.26.0.0.bin => t5fw-1.26.2.0.bin} | Bin 675840 -> 676352 bytes .../{t6fw-1.26.0.0.bin => t6fw-1.26.2.0.bin} | Bin 729088 -> 729088 bytes sys/modules/cxgbe/t4_firmware/Makefile | 2 +- sys/modules/cxgbe/t5_firmware/Makefile | 2 +- sys/modules/cxgbe/t6_firmware/Makefile | 2 +- 8 files changed, 14 insertions(+), 10 deletions(-) diff --git a/sys/conf/files b/sys/conf/files index be8acb32d14c..eaf356d8dce4 100644 --- a/sys/conf/files +++ b/sys/conf/files @@ -1495,7 +1495,7 @@ t4fw.fwo optional cxgbe \ no-implicit-rule \ clean "t4fw.fwo" t4fw.fw optional cxgbe \ - dependency "$S/dev/cxgbe/firmware/t4fw-1.26.0.0.bin" \ + dependency "$S/dev/cxgbe/firmware/t4fw-1.26.2.0.bin" \ compile-with "${CP} ${.ALLSRC} ${.TARGET}" \ no-obj no-implicit-rule \ clean "t4fw.fw" @@ -1529,7 +1529,7 @@ t5fw.fwo optional cxgbe \ no-implicit-rule \ clean "t5fw.fwo" t5fw.fw optional cxgbe \ - dependency "$S/dev/cxgbe/firmware/t5fw-1.26.0.0.bin" \ + dependency "$S/dev/cxgbe/firmware/t5fw-1.26.2.0.bin" \ compile-with "${CP} ${.ALLSRC} ${.TARGET}" \ no-obj no-implicit-rule \ clean "t5fw.fw" @@ -1563,7 +1563,7 @@ t6fw.fwo optional cxgbe \ no-implicit-rule \ clean "t6fw.fwo" t6fw.fw optional cxgbe \ - dependency "$S/dev/cxgbe/firmware/t6fw-1.26.0.0.bin" \ + dependency "$S/dev/cxgbe/firmware/t6fw-1.26.2.0.bin" \ compile-with "${CP} ${.ALLSRC} ${.TARGET}" \ no-obj no-implicit-rule \ clean "t6fw.fw" diff --git a/sys/dev/cxgbe/firmware/t4fw-1.26.0.0.bin b/sys/dev/cxgbe/firmware/t4fw-1.26.2.0.bin similarity index 57% rename from sys/dev/cxgbe/firmware/t4fw-1.26.0.0.bin rename to sys/dev/cxgbe/firmware/t4fw-1.26.2.0.bin index 04e96d16c57a..a8f611628dcc 100644 Binary files a/sys/dev/cxgbe/firmware/t4fw-1.26.0.0.bin and b/sys/dev/cxgbe/firmware/t4fw-1.26.2.0.bin differ diff --git a/sys/dev/cxgbe/firmware/t4fw_interface.h b/sys/dev/cxgbe/firmware/t4fw_interface.h index acb7a6481d9c..876fd61b4b21 100644 --- a/sys/dev/cxgbe/firmware/t4fw_interface.h +++ b/sys/dev/cxgbe/firmware/t4fw_interface.h @@ -9952,7 +9952,10 @@ struct fw_hdr { __u32 reserved3; __be32 magic; /* runtime or bootstrap fw */ __be32 flags; - __be32 reserved6[23]; + __be32 reserved6[4]; + __u8 reserved7[3]; + __u8 dsign_len; + __u8 dsign[72]; /* fw binary digital signature */ }; enum fw_hdr_chip { @@ -9992,17 +9995,17 @@ enum fw_hdr_chip { enum { T4FW_VERSION_MAJOR = 1, T4FW_VERSION_MINOR = 26, - T4FW_VERSION_MICRO = 0, + T4FW_VERSION_MICRO = 2, T4FW_VERSION_BUILD = 0, T5FW_VERSION_MAJOR = 1, T5FW_VERSION_MINOR = 26, - T5FW_VERSION_MICRO = 0, + T5FW_VERSION_MICRO = 2, T5FW_VERSION_BUILD = 0, T6FW_VERSION_MAJOR = 1, T6FW_VERSION_MINOR = 26, - T6FW_VERSION_MICRO = 0, + T6FW_VERSION_MICRO = 2, T6FW_VERSION_BUILD = 0, }; @@ -10052,6 +10055,7 @@ enum { enum fw_hdr_flags { FW_HDR_FLAGS_RESET_HALT = 0x00000001, + FW_HDR_FLAGS_SIGNED_FW = 0x00000002, }; /* diff --git a/sys/dev/cxgbe/firmware/t5fw-1.26.0.0.bin b/sys/dev/cxgbe/firmware/t5fw-1.26.2.0.bin similarity index 55% rename from sys/dev/cxgbe/firmware/t5fw-1.26.0.0.bin rename to sys/dev/cxgbe/firmware/t5fw-1.26.2.0.bin index f72bd502ea1f..b11d6d0bf49f 100644 Binary files a/sys/dev/cxgbe/firmware/t5fw-1.26.0.0.bin and b/sys/dev/cxgbe/firmware/t5fw-1.26.2.0.bin differ diff --git a/sys/dev/cxgbe/firmware/t6fw-1.26.0.0.bin b/sys/dev/cxgbe/firmware/t6fw-1.26.2.0.bin similarity index 61% rename from sys/dev/cxgbe/firmware/t6fw-1.26.0.0.bin rename to sys/dev/cxgbe/firmware/t6fw-1.26.2.0.bin index ee4341d5074f..f43d9953a7a4 100644 Binary files a/sys/dev/cxgbe/firmware/t6fw-1.26.0.0.bin and b/sys/dev/cxgbe/firmware/t6fw-1.26.2.0.bin differ diff --git a/sys/modules/cxgbe/t4_firmware/Makefile b/sys/modules/cxgbe/t4_firmware/Makefile index a202c5d2a6a0..e525edf96ce2 100644 --- a/sys/modules/cxgbe/t4_firmware/Makefile +++ b/sys/modules/cxgbe/t4_firmware/Makefile @@ -17,7 +17,7 @@ FIRMWS+= ${F}:${F:C/.txt//}:1.0.0.0 .endif .endfor -T4FW_VER= 1.26.0.0 +T4FW_VER= 1.26.2.0 FIRMWS+= t4fw-${T4FW_VER}.bin:t4fw:${T4FW_VER} .include diff --git a/sys/modules/cxgbe/t5_firmware/Makefile b/sys/modules/cxgbe/t5_firmware/Makefile index 371df89f233b..74e89e4174b5 100644 --- a/sys/modules/cxgbe/t5_firmware/Makefile +++ b/sys/modules/cxgbe/t5_firmware/Makefile @@ -17,7 +17,7 @@ FIRMWS+= ${F}:${F:C/.txt//}:1.0.0.0 .endif .endfor -T5FW_VER= 1.26.0.0 +T5FW_VER= 1.26.2.0 FIRMWS+= t5fw-${T5FW_VER}.bin:t5fw:${T5FW_VER} .include diff --git a/sys/modules/cxgbe/t6_firmware/Makefile b/sys/modules/cxgbe/t6_firmware/Makefile index 074c3991bc37..2ea01e7b776a 100644 --- a/sys/modules/cxgbe/t6_firmware/Makefile +++ b/sys/modules/cxgbe/t6_firmware/Makefile @@ -17,7 +17,7 @@ FIRMWS+= ${F}:${F:C/.txt//}:1.0.0.0 .endif .endfor -T6FW_VER= 1.26.0.0 +T6FW_VER= 1.26.2.0 FIRMWS+= t6fw-${T6FW_VER}.bin:t6fw:${T6FW_VER} .include From owner-dev-commits-src-main@freebsd.org Tue Sep 28 09:28:20 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5F68B679FEF; Tue, 28 Sep 2021 09:28:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HJZ1c22TFz4h2x; Tue, 28 Sep 2021 09:28:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 25A0221BF2; Tue, 28 Sep 2021 09:28:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18S9SKgL036469; Tue, 28 Sep 2021 09:28:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18S9SKhX036468; Tue, 28 Sep 2021 09:28:20 GMT (envelope-from git) Date: Tue, 28 Sep 2021 09:28:20 GMT Message-Id: <202109280928.18S9SKhX036468@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Hans Petter Selasky Subject: git: 4a83ca1078e3 - main - sound(4): Implement mixer mute control for feeder channels. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: hselasky X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 4a83ca1078e3ec70159741b51a6b48e844ada9f5 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Sep 2021 09:28:20 -0000 The branch main has been updated by hselasky: URL: https://cgit.FreeBSD.org/src/commit/?id=4a83ca1078e3ec70159741b51a6b48e844ada9f5 commit 4a83ca1078e3ec70159741b51a6b48e844ada9f5 Author: Hans Petter Selasky AuthorDate: 2021-09-28 07:41:18 +0000 Commit: Hans Petter Selasky CommitDate: 2021-09-28 09:20:09 +0000 sound(4): Implement mixer mute control for feeder channels. PR: 258711 Differential Revision: https://reviews.freebsd.org/D31636 MFC after: 1 week Sponsored by: NVIDIA Networking --- sys/dev/sound/pcm/channel.c | 71 ++++++++++++++++++++++ sys/dev/sound/pcm/channel.h | 8 ++- sys/dev/sound/pcm/dsp.c | 121 +++++++++++++++++++++++--------------- sys/dev/sound/pcm/feeder_volume.c | 19 ++++-- 4 files changed, 167 insertions(+), 52 deletions(-) diff --git a/sys/dev/sound/pcm/channel.c b/sys/dev/sound/pcm/channel.c index 38c578ba8282..4d56eee6847e 100644 --- a/sys/dev/sound/pcm/channel.c +++ b/sys/dev/sound/pcm/channel.c @@ -1223,6 +1223,8 @@ chn_init(struct pcm_channel *c, void *devinfo, int dir, int direction) c->volume[SND_VOL_C_MASTER][SND_CHN_T_VOL_0DB] = SND_VOL_0DB_MASTER; c->volume[SND_VOL_C_PCM][SND_CHN_T_VOL_0DB] = chn_vol_0db_pcm; + memset(c->muted, 0, sizeof(c->muted)); + chn_vpc_reset(c, SND_VOL_C_PCM, 1); ret = ENODEV; @@ -1394,6 +1396,75 @@ chn_getvolume_matrix(struct pcm_channel *c, int vc, int vt) return (c->volume[vc][vt]); } +int +chn_setmute_multi(struct pcm_channel *c, int vc, int mute) +{ + int i, ret; + + ret = 0; + + for (i = 0; i < SND_CHN_T_MAX; i++) { + if ((1 << i) & SND_CHN_LEFT_MASK) + ret |= chn_setmute_matrix(c, vc, i, mute); + else if ((1 << i) & SND_CHN_RIGHT_MASK) + ret |= chn_setmute_matrix(c, vc, i, mute) << 8; + else + ret |= chn_setmute_matrix(c, vc, i, mute) << 16; + } + return (ret); +} + +int +chn_setmute_matrix(struct pcm_channel *c, int vc, int vt, int mute) +{ + int i; + + KASSERT(c != NULL && vc >= SND_VOL_C_MASTER && vc < SND_VOL_C_MAX && + (vc == SND_VOL_C_MASTER || (vc & 1)) && + (vt == SND_CHN_T_VOL_0DB || (vt >= SND_CHN_T_BEGIN && vt <= SND_CHN_T_END)), + ("%s(): invalid mute matrix c=%p vc=%d vt=%d mute=%d", + __func__, c, vc, vt, mute)); + + CHN_LOCKASSERT(c); + + mute = (mute != 0); + + c->muted[vc][vt] = mute; + + /* + * Do relative calculation here and store it into class + 1 + * to ease the job of feeder_volume. + */ + if (vc == SND_VOL_C_MASTER) { + for (vc = SND_VOL_C_BEGIN; vc <= SND_VOL_C_END; + vc += SND_VOL_C_STEP) + c->muted[SND_VOL_C_VAL(vc)][vt] = mute; + } else if (vc & 1) { + if (vt == SND_CHN_T_VOL_0DB) { + for (i = SND_CHN_T_BEGIN; i <= SND_CHN_T_END; + i += SND_CHN_T_STEP) { + c->muted[SND_VOL_C_VAL(vc)][i] = mute; + } + } else { + c->muted[SND_VOL_C_VAL(vc)][vt] = mute; + } + } + return (mute); +} + +int +chn_getmute_matrix(struct pcm_channel *c, int vc, int vt) +{ + KASSERT(c != NULL && vc >= SND_VOL_C_MASTER && vc < SND_VOL_C_MAX && + (vt == SND_CHN_T_VOL_0DB || + (vt >= SND_CHN_T_BEGIN && vt <= SND_CHN_T_END)), + ("%s(): invalid mute matrix c=%p vc=%d vt=%d", + __func__, c, vc, vt)); + CHN_LOCKASSERT(c); + + return (c->muted[vc][vt]); +} + struct pcmchan_matrix * chn_getmatrix(struct pcm_channel *c) { diff --git a/sys/dev/sound/pcm/channel.h b/sys/dev/sound/pcm/channel.h index 34d62f4e15c2..60b7b3416cc3 100644 --- a/sys/dev/sound/pcm/channel.h +++ b/sys/dev/sound/pcm/channel.h @@ -166,7 +166,8 @@ struct pcm_channel { struct pcmchan_matrix matrix; struct pcmchan_matrix matrix_scratch; - int volume[SND_VOL_C_MAX][SND_CHN_T_VOL_MAX]; + int16_t volume[SND_VOL_C_MAX][SND_CHN_T_VOL_MAX]; + int8_t muted[SND_VOL_C_MAX][SND_CHN_T_VOL_MAX]; void *data1, *data2; }; @@ -271,6 +272,9 @@ int chn_setvolume_multi(struct pcm_channel *c, int vc, int left, int right, int center); int chn_setvolume_matrix(struct pcm_channel *c, int vc, int vt, int val); int chn_getvolume_matrix(struct pcm_channel *c, int vc, int vt); +int chn_setmute_multi(struct pcm_channel *c, int vc, int mute); +int chn_setmute_matrix(struct pcm_channel *c, int vc, int vt, int mute); +int chn_getmute_matrix(struct pcm_channel *c, int vc, int vt); void chn_vpc_reset(struct pcm_channel *c, int vc, int force); int chn_setparam(struct pcm_channel *c, uint32_t format, uint32_t speed); int chn_setspeed(struct pcm_channel *c, uint32_t speed); @@ -307,6 +311,8 @@ int chn_syncdestroy(struct pcm_channel *c); #define CHN_GETVOLUME(x, y, z) ((x)->volume[y][z]) #endif +#define CHN_GETMUTE(x, y, z) ((x)->muted[y][z]) + #ifdef OSSV4_EXPERIMENT int chn_getpeaks(struct pcm_channel *c, int *lpeak, int *rpeak); #endif diff --git a/sys/dev/sound/pcm/dsp.c b/sys/dev/sound/pcm/dsp.c index cce05f4ecf37..15f437b8627c 100644 --- a/sys/dev/sound/pcm/dsp.c +++ b/sys/dev/sound/pcm/dsp.c @@ -965,6 +965,7 @@ dsp_ioctl_channel(struct cdev *dev, struct pcm_channel *volch, u_long cmd, struct snddev_info *d; struct pcm_channel *rdch, *wrch; int j, devtype, ret; + int left, right, center, mute; d = dsp_get_info(dev); if (!PCM_REGISTERED(d) || !(dsp_get_flags(dev) & SD_F_VPC)) @@ -1003,67 +1004,95 @@ dsp_ioctl_channel(struct cdev *dev, struct pcm_channel *volch, u_long cmd, } /* Final validation */ - if (volch != NULL) { - CHN_LOCK(volch); - if (!(volch->feederflags & (1 << FEEDER_VOLUME))) { - CHN_UNLOCK(volch); - return (-1); - } - if (volch->direction == PCMDIR_PLAY) - wrch = volch; - else - rdch = volch; - } - - ret = EINVAL; + if (volch == NULL) + return (EINVAL); - if (volch != NULL && - ((j == SOUND_MIXER_PCM && volch->direction == PCMDIR_PLAY) || - (j == SOUND_MIXER_RECLEV && volch->direction == PCMDIR_REC))) { - if ((cmd & ~0xff) == MIXER_WRITE(0)) { - int left, right, center; + CHN_LOCK(volch); + if (!(volch->feederflags & (1 << FEEDER_VOLUME))) { + CHN_UNLOCK(volch); + return (EINVAL); + } + switch (cmd & ~0xff) { + case MIXER_WRITE(0): + switch (j) { + case SOUND_MIXER_MUTE: + if (volch->direction == PCMDIR_REC) { + chn_setmute_multi(volch, SND_VOL_C_PCM, (*(int *)arg & SOUND_MASK_RECLEV) != 0); + } else { + chn_setmute_multi(volch, SND_VOL_C_PCM, (*(int *)arg & SOUND_MASK_PCM) != 0); + } + break; + case SOUND_MIXER_PCM: + if (volch->direction != PCMDIR_PLAY) + break; left = *(int *)arg & 0x7f; right = ((*(int *)arg) >> 8) & 0x7f; center = (left + right) >> 1; - chn_setvolume_multi(volch, SND_VOL_C_PCM, left, right, - center); - } else if ((cmd & ~0xff) == MIXER_READ(0)) { - *(int *)arg = CHN_GETVOLUME(volch, - SND_VOL_C_PCM, SND_CHN_T_FL); - *(int *)arg |= CHN_GETVOLUME(volch, - SND_VOL_C_PCM, SND_CHN_T_FR) << 8; + chn_setvolume_multi(volch, SND_VOL_C_PCM, + left, right, center); + break; + case SOUND_MIXER_RECLEV: + if (volch->direction != PCMDIR_REC) + break; + left = *(int *)arg & 0x7f; + right = ((*(int *)arg) >> 8) & 0x7f; + center = (left + right) >> 1; + chn_setvolume_multi(volch, SND_VOL_C_PCM, + left, right, center); + break; + default: + /* ignore all other mixer writes */ + break; } - ret = 0; - } else if (rdch != NULL || wrch != NULL) { + break; + + case MIXER_READ(0): switch (j) { + case SOUND_MIXER_MUTE: + mute = CHN_GETMUTE(volch, SND_VOL_C_PCM, SND_CHN_T_FL) || + CHN_GETMUTE(volch, SND_VOL_C_PCM, SND_CHN_T_FR); + if (volch->direction == PCMDIR_REC) { + *(int *)arg = mute << SOUND_MIXER_RECLEV; + } else { + *(int *)arg = mute << SOUND_MIXER_PCM; + } + break; + case SOUND_MIXER_PCM: + if (volch->direction != PCMDIR_PLAY) + break; + *(int *)arg = CHN_GETVOLUME(volch, + SND_VOL_C_PCM, SND_CHN_T_FL); + *(int *)arg |= CHN_GETVOLUME(volch, + SND_VOL_C_PCM, SND_CHN_T_FR) << 8; + break; + case SOUND_MIXER_RECLEV: + if (volch->direction != PCMDIR_REC) + break; + *(int *)arg = CHN_GETVOLUME(volch, + SND_VOL_C_PCM, SND_CHN_T_FL); + *(int *)arg |= CHN_GETVOLUME(volch, + SND_VOL_C_PCM, SND_CHN_T_FR) << 8; + break; case SOUND_MIXER_DEVMASK: case SOUND_MIXER_CAPS: case SOUND_MIXER_STEREODEVS: - if ((cmd & ~0xff) == MIXER_READ(0)) { - *(int *)arg = 0; - if (rdch != NULL) - *(int *)arg |= SOUND_MASK_RECLEV; - if (wrch != NULL) - *(int *)arg |= SOUND_MASK_PCM; - } - ret = 0; - break; - case SOUND_MIXER_RECMASK: - case SOUND_MIXER_RECSRC: - if ((cmd & ~0xff) == MIXER_READ(0)) - *(int *)arg = 0; - ret = 0; + if (volch->direction == PCMDIR_REC) + *(int *)arg = SOUND_MASK_RECLEV; + else + *(int *)arg = SOUND_MASK_PCM; break; default: + *(int *)arg = 0; break; } - } - - if (volch != NULL) - CHN_UNLOCK(volch); + break; - return (ret); + default: + break; + } + CHN_UNLOCK(volch); + return (0); } static int diff --git a/sys/dev/sound/pcm/feeder_volume.c b/sys/dev/sound/pcm/feeder_volume.c index 322d7f6b2c84..2312bd89c9d4 100644 --- a/sys/dev/sound/pcm/feeder_volume.c +++ b/sys/dev/sound/pcm/feeder_volume.c @@ -237,10 +237,13 @@ static int feed_volume_feed(struct pcm_feeder *f, struct pcm_channel *c, uint8_t *b, uint32_t count, void *source) { + int temp_vol[SND_CHN_T_VOL_MAX]; struct feed_volume_info *info; uint32_t j, align; - int i, *vol, *matrix; + int i, *matrix; uint8_t *dst; + const int16_t *vol; + const int8_t *muted; /* * Fetch filter data operation. @@ -251,6 +254,7 @@ feed_volume_feed(struct pcm_feeder *f, struct pcm_channel *c, uint8_t *b, return (FEEDER_FEED(f->source, c, b, count, source)); vol = c->volume[SND_VOL_C_VAL(info->volume_class)]; + muted = c->muted[SND_VOL_C_VAL(info->volume_class)]; matrix = info->matrix; /* @@ -258,17 +262,22 @@ feed_volume_feed(struct pcm_feeder *f, struct pcm_channel *c, uint8_t *b, */ j = 0; i = info->channels; - do { - if (vol[matrix[--i]] != SND_VOL_FLAT) { + while (i--) { + if (vol[matrix[i]] != SND_VOL_FLAT || + muted[matrix[i]] != 0) { j = 1; break; } - } while (i != 0); + } /* Nope, just bypass entirely. */ if (j == 0) return (FEEDER_FEED(f->source, c, b, count, source)); + /* Check if any controls are muted. */ + for (j = 0; j != SND_CHN_T_VOL_MAX; j++) + temp_vol[j] = muted[j] ? 0 : vol[j]; + dst = b; align = info->bps * info->channels; @@ -281,7 +290,7 @@ feed_volume_feed(struct pcm_feeder *f, struct pcm_channel *c, uint8_t *b, if (j == 0) break; - info->apply(vol, matrix, info->channels, dst, j); + info->apply(temp_vol, matrix, info->channels, dst, j); j *= align; dst += j; From owner-dev-commits-src-main@freebsd.org Tue Sep 28 09:28:21 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7C8C067A609; Tue, 28 Sep 2021 09:28:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HJZ1d31Bhz4h30; Tue, 28 Sep 2021 09:28:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 473BD22202; Tue, 28 Sep 2021 09:28:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18S9SLrp036493; Tue, 28 Sep 2021 09:28:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18S9SLYD036492; Tue, 28 Sep 2021 09:28:21 GMT (envelope-from git) Date: Tue, 28 Sep 2021 09:28:21 GMT Message-Id: <202109280928.18S9SLYD036492@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Hans Petter Selasky Subject: git: 3984400149a5 - main - mixer(3): Add support for controlling mixer mute and volume on feeder channels. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: hselasky X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3984400149a53982f1254cfaf7b73fd2acda460a Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Sep 2021 09:28:21 -0000 The branch main has been updated by hselasky: URL: https://cgit.FreeBSD.org/src/commit/?id=3984400149a53982f1254cfaf7b73fd2acda460a commit 3984400149a53982f1254cfaf7b73fd2acda460a Author: Hans Petter Selasky AuthorDate: 2021-09-28 07:53:44 +0000 Commit: Hans Petter Selasky CommitDate: 2021-09-28 09:20:23 +0000 mixer(3): Add support for controlling mixer mute and volume on feeder channels. PR: 258711 Reported by: jbeich@FreeBSD.org Differential Revision: https://reviews.freebsd.org/D31636 Sponsored by: NVIDIA Networking --- lib/libmixer/mixer.c | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/lib/libmixer/mixer.c b/lib/libmixer/mixer.c index b10d5c6607cf..4bae6980c1c4 100644 --- a/lib/libmixer/mixer.c +++ b/lib/libmixer/mixer.c @@ -77,13 +77,13 @@ mixer_open(const char *name) if (name != NULL) { /* `name` does not start with "/dev/mixer". */ if (strncmp(name, BASEPATH, strlen(BASEPATH)) != 0) { - errno = EINVAL; - goto fail; + m->unit = -1; + } else { + /* `name` is "/dev/mixer" so, we'll use the default unit. */ + if (strncmp(name, BASEPATH, strlen(name)) == 0) + goto dunit; + m->unit = strtol(name + strlen(BASEPATH), NULL, 10); } - /* `name` is "/dev/mixer" so, we'll use the default unit. */ - if (strncmp(name, BASEPATH, strlen(name)) == 0) - goto dunit; - m->unit = strtol(name + strlen(BASEPATH), NULL, 10); (void)strlcpy(m->name, name, sizeof(m->name)); } else { dunit: @@ -101,9 +101,13 @@ dunit: /* The unit number _must_ be set before the ioctl. */ m->mi.dev = m->unit; m->ci.card = m->unit; - if (ioctl(m->fd, SNDCTL_MIXERINFO, &m->mi) < 0 || - ioctl(m->fd, SNDCTL_CARDINFO, &m->ci) < 0 || - ioctl(m->fd, SOUND_MIXER_READ_DEVMASK, &m->devmask) < 0 || + if (ioctl(m->fd, SNDCTL_MIXERINFO, &m->mi) < 0) { + memset(&m->mi, 0, sizeof(m->mi)); + strlcpy(m->mi.name, m->name, sizeof(m->mi.name)); + } + if (ioctl(m->fd, SNDCTL_CARDINFO, &m->ci) < 0) + memset(&m->ci, 0, sizeof(m->ci)); + if (ioctl(m->fd, SOUND_MIXER_READ_DEVMASK, &m->devmask) < 0 || ioctl(m->fd, SOUND_MIXER_READ_MUTE, &m->mutemask) < 0 || ioctl(m->fd, SOUND_MIXER_READ_RECMASK, &m->recmask) < 0 || ioctl(m->fd, SOUND_MIXER_READ_RECSRC, &m->recsrc) < 0) @@ -463,7 +467,7 @@ mixer_get_mode(int unit) (void)snprintf(buf, sizeof(buf), "dev.pcm.%d.mode", unit); size = sizeof(unsigned int); if (sysctlbyname(buf, &mode, &size, NULL, 0) < 0) - return (-1); + return (0); return (mode); } From owner-dev-commits-src-main@freebsd.org Tue Sep 28 12:43:48 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 32F9567C9EF; Tue, 28 Sep 2021 12:43:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HJfM80fmdz4v7x; Tue, 28 Sep 2021 12:43:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EA8C424C9F; Tue, 28 Sep 2021 12:43:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18SChllv001989; Tue, 28 Sep 2021 12:43:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18SChldh001988; Tue, 28 Sep 2021 12:43:47 GMT (envelope-from git) Date: Tue, 28 Sep 2021 12:43:47 GMT Message-Id: <202109281243.18SChldh001988@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: f3aa0098a82e - main - Use mtx_lock_spin in the gic driver MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f3aa0098a82ebf7712aa13716d794aa7e4ac59cd Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Sep 2021 12:43:48 -0000 The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=f3aa0098a82ebf7712aa13716d794aa7e4ac59cd commit f3aa0098a82ebf7712aa13716d794aa7e4ac59cd Author: Andrew Turner AuthorDate: 2021-09-28 11:36:42 +0000 Commit: Andrew Turner CommitDate: 2021-09-28 11:42:06 +0000 Use mtx_lock_spin in the gic driver The mutex was changed to a spin lock when the MSI/MSI-X handling was moved from the gicv2m to the gic driver. Update the calls to lock and unlock the mutex to the spin variant. Submitted by: jrtc27 ("Change all the mtx_(un)lock(&sc->mutex) to be the _spin versions.") Reported by: mw, antranigv@freebsd.am Sponsored by: The FreeBSD Foundation --- sys/arm/arm/gic.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/sys/arm/arm/gic.c b/sys/arm/arm/gic.c index d7edd7885404..89db4e324600 100644 --- a/sys/arm/arm/gic.c +++ b/sys/arm/arm/gic.c @@ -1056,7 +1056,7 @@ arm_gic_alloc_msi(device_t dev, device_t child, int count, int maxcount, sc = device_get_softc(dev); - mtx_lock(&sc->mutex); + mtx_lock_spin(&sc->mutex); found = false; for (irq = sc->sc_spi_start; irq < sc->sc_spi_end; irq++) { @@ -1091,7 +1091,7 @@ arm_gic_alloc_msi(device_t dev, device_t child, int count, int maxcount, /* Not enough interrupts were found */ if (!found || irq == sc->sc_spi_end) { - mtx_unlock(&sc->mutex); + mtx_unlock_spin(&sc->mutex); return (ENXIO); } @@ -1099,7 +1099,7 @@ arm_gic_alloc_msi(device_t dev, device_t child, int count, int maxcount, /* Mark the interrupt as used */ sc->gic_irqs[irq + i].gi_flags |= GI_FLAG_MSI_USED; } - mtx_unlock(&sc->mutex); + mtx_unlock_spin(&sc->mutex); for (i = 0; i < count; i++) srcs[i] = (struct intr_irqsrc *)&sc->gic_irqs[irq + i]; @@ -1118,7 +1118,7 @@ arm_gic_release_msi(device_t dev, device_t child, int count, sc = device_get_softc(dev); - mtx_lock(&sc->mutex); + mtx_lock_spin(&sc->mutex); for (i = 0; i < count; i++) { gi = (struct gic_irqsrc *)isrc[i]; @@ -1128,7 +1128,7 @@ arm_gic_release_msi(device_t dev, device_t child, int count, gi->gi_flags &= ~GI_FLAG_MSI_USED; } - mtx_unlock(&sc->mutex); + mtx_unlock_spin(&sc->mutex); return (0); } @@ -1142,7 +1142,7 @@ arm_gic_alloc_msix(device_t dev, device_t child, device_t *pic, sc = device_get_softc(dev); - mtx_lock(&sc->mutex); + mtx_lock_spin(&sc->mutex); /* Find an unused interrupt */ for (irq = sc->sc_spi_start; irq < sc->sc_spi_end; irq++) { KASSERT((sc->gic_irqs[irq].gi_flags & GI_FLAG_MSI) != 0, @@ -1152,13 +1152,13 @@ arm_gic_alloc_msix(device_t dev, device_t child, device_t *pic, } /* No free interrupt was found */ if (irq == sc->sc_spi_end) { - mtx_unlock(&sc->mutex); + mtx_unlock_spin(&sc->mutex); return (ENXIO); } /* Mark the interrupt as used */ sc->gic_irqs[irq].gi_flags |= GI_FLAG_MSI_USED; - mtx_unlock(&sc->mutex); + mtx_unlock_spin(&sc->mutex); *isrcp = (struct intr_irqsrc *)&sc->gic_irqs[irq]; *pic = dev; @@ -1178,9 +1178,9 @@ arm_gic_release_msix(device_t dev, device_t child, struct intr_irqsrc *isrc) KASSERT((gi->gi_flags & GI_FLAG_MSI_USED) == GI_FLAG_MSI_USED, ("%s: Trying to release an unused MSI-X interrupt", __func__)); - mtx_lock(&sc->mutex); + mtx_lock_spin(&sc->mutex); gi->gi_flags &= ~GI_FLAG_MSI_USED; - mtx_unlock(&sc->mutex); + mtx_unlock_spin(&sc->mutex); return (0); } From owner-dev-commits-src-main@freebsd.org Tue Sep 28 13:42:32 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2997567D806; Tue, 28 Sep 2021 13:42:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HJgfw0ZPYz3Hjj; Tue, 28 Sep 2021 13:42:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E7DDC25906; Tue, 28 Sep 2021 13:42:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18SDgVDW081761; Tue, 28 Sep 2021 13:42:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18SDgVBP081760; Tue, 28 Sep 2021 13:42:31 GMT (envelope-from git) Date: Tue, 28 Sep 2021 13:42:31 GMT Message-Id: <202109281342.18SDgVBP081760@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Michael Tuexen Subject: git: 171633765c43 - main - sctp: avoid locking an already locked mutex MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 171633765c4367dc233a4bf0e5926cb7c4decfc1 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Sep 2021 13:42:32 -0000 The branch main has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=171633765c4367dc233a4bf0e5926cb7c4decfc1 commit 171633765c4367dc233a4bf0e5926cb7c4decfc1 Author: Michael Tuexen AuthorDate: 2021-09-28 03:14:56 +0000 Commit: Michael Tuexen CommitDate: 2021-09-28 03:17:03 +0000 sctp: avoid locking an already locked mutex Reported by: syzbot+f048680690f2e8d7ddad@syzkaller.appspotmail.com Reported by: syzbot+0725c712ba89d123c2e9@syzkaller.appspotmail.com MFC after: 1 week --- sys/netinet/sctp_timer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/netinet/sctp_timer.c b/sys/netinet/sctp_timer.c index c994b90b8353..17d834cd2734 100644 --- a/sys/netinet/sctp_timer.c +++ b/sys/netinet/sctp_timer.c @@ -1387,6 +1387,7 @@ sctp_audit_stream_queues_for_size(struct sctp_inpcb *inp, struct sctp_tcb *stcb) SCTP_PRINTF("Hmm, stream queue cnt at %d I counted %d in stream out wheel\n", stcb->asoc.stream_queue_cnt, chks_in_queue); } + SCTP_TCB_SEND_UNLOCK(stcb); if (chks_in_queue) { /* call the output queue function */ sctp_chunk_output(inp, stcb, SCTP_OUTPUT_FROM_T3, SCTP_SO_NOT_LOCKED); @@ -1406,7 +1407,6 @@ sctp_audit_stream_queues_for_size(struct sctp_inpcb *inp, struct sctp_tcb *stcb) (u_long)stcb->asoc.total_output_queue_size); stcb->asoc.total_output_queue_size = 0; } - SCTP_TCB_SEND_UNLOCK(stcb); } int From owner-dev-commits-src-main@freebsd.org Tue Sep 28 13:55:44 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DAA0267DA03; Tue, 28 Sep 2021 13:55:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HJgy85ljFz3K4J; Tue, 28 Sep 2021 13:55:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A553925A9D; Tue, 28 Sep 2021 13:55:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18SDtiZf095203; Tue, 28 Sep 2021 13:55:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18SDtidU095202; Tue, 28 Sep 2021 13:55:44 GMT (envelope-from git) Date: Tue, 28 Sep 2021 13:55:44 GMT Message-Id: <202109281355.18SDtidU095202@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Michael Tuexen Subject: git: 5b53e749a95e - main - sctp: fix usage of stream scheduler functions MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5b53e749a95e7f18475df9f9ce7984a31880a7ee Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Sep 2021 13:55:44 -0000 The branch main has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=5b53e749a95e7f18475df9f9ce7984a31880a7ee commit 5b53e749a95e7f18475df9f9ce7984a31880a7ee Author: Michael Tuexen AuthorDate: 2021-09-28 03:25:58 +0000 Commit: Michael Tuexen CommitDate: 2021-09-28 03:25:58 +0000 sctp: fix usage of stream scheduler functions sctp_ss_scheduled() should only be called for streams that are scheduled. So call sctp_ss_remove_from_stream() before it. This bug was uncovered by the earlier cleanup. Reported by: syzbot+bbf739922346659df4b2@syzkaller.appspotmail.com Reported by: syzbot+0a0857458f4a7b0507c8@syzkaller.appspotmail.com Reported by: syzbot+a0b62c6107b34a04e54d@syzkaller.appspotmail.com Reported by: syzbot+0aa0d676429ebcd53299@syzkaller.appspotmail.com Reported by: syzbot+104cc0c1d3ccf2921c1d@syzkaller.appspotmail.com MFC after: 1 week --- sys/netinet/sctp_output.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/sys/netinet/sctp_output.c b/sys/netinet/sctp_output.c index cad15be7a57b..cb8b8030b6ea 100644 --- a/sys/netinet/sctp_output.c +++ b/sys/netinet/sctp_output.c @@ -7142,6 +7142,7 @@ sctp_can_we_split_this(struct sctp_tcb *stcb, uint32_t length, static uint32_t sctp_move_to_outqueue(struct sctp_tcb *stcb, + struct sctp_nets *net, struct sctp_stream_out *strq, uint32_t space_left, uint32_t frag_point, @@ -7555,6 +7556,7 @@ dont_do_it: sctp_auth_key_acquire(stcb, chk->auth_keyid); chk->holds_key_ref = 1; } + stcb->asoc.ss_functions.sctp_ss_scheduled(stcb, net, asoc, strq, to_move); chk->rec.data.tsn = atomic_fetchadd_int(&asoc->sending_seq, 1); if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_LOG_AT_SEND_2_OUTQ) { sctp_misc_ints(SCTP_STRMOUT_LOG_SEND, @@ -7672,8 +7674,8 @@ out_of: } static void -sctp_fill_outqueue(struct sctp_tcb *stcb, - struct sctp_nets *net, int frag_point, int eeor_mode, int *quit_now, int so_locked) +sctp_fill_outqueue(struct sctp_tcb *stcb, struct sctp_nets *net, int frag_point, + int eeor_mode, int *quit_now, int so_locked) { struct sctp_association *asoc; struct sctp_stream_out *strq; @@ -7708,9 +7710,9 @@ sctp_fill_outqueue(struct sctp_tcb *stcb, giveup = 0; bail = 0; while ((space_left > 0) && (strq != NULL)) { - moved = sctp_move_to_outqueue(stcb, strq, space_left, frag_point, - &giveup, eeor_mode, &bail, so_locked); - stcb->asoc.ss_functions.sctp_ss_scheduled(stcb, net, asoc, strq, moved); + moved = sctp_move_to_outqueue(stcb, net, strq, space_left, + frag_point, &giveup, eeor_mode, + &bail, so_locked); if ((giveup != 0) || (bail != 0)) { break; } From owner-dev-commits-src-main@freebsd.org Tue Sep 28 14:38:10 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 55BC567E633; Tue, 28 Sep 2021 14:38:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HJhv61yh3z3N0Y; Tue, 28 Sep 2021 14:38:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1F8C926435; Tue, 28 Sep 2021 14:38:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18SEcAUs049396; Tue, 28 Sep 2021 14:38:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18SEcAoI049395; Tue, 28 Sep 2021 14:38:10 GMT (envelope-from git) Date: Tue, 28 Sep 2021 14:38:10 GMT Message-Id: <202109281438.18SEcAoI049395@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mitchell Horne Subject: git: 800e74955d4e - main - boot(9): update to match reality MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mhorne X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 800e74955d4e5f90e7258956ba42228350f71049 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Sep 2021 14:38:10 -0000 The branch main has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=800e74955d4e5f90e7258956ba42228350f71049 commit 800e74955d4e5f90e7258956ba42228350f71049 Author: Mitchell Horne AuthorDate: 2021-09-28 14:36:09 +0000 Commit: Mitchell Horne CommitDate: 2021-09-28 14:36:09 +0000 boot(9): update to match reality This function was renamed to kern_reboot() in 2010, but the man page has failed to keep in sync. Bring it up to date on the rename, add the shutdown hooks to the synopsis, and document the (obvious) fact that kern_reboot() does not return. Fix an outdated reference to the old name in kern_reboot(), and leave a reference to the man page so future readers might find it before any large changes. Reviewed by: imp, markj MFC after: 3 days Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D32085 --- ObsoleteFiles.inc | 3 +++ share/man/man9/Makefile | 2 +- share/man/man9/{boot.9 => kern_reboot.9} | 26 ++++++++++++++++++-------- sys/kern/kern_shutdown.c | 5 +++-- 4 files changed, 25 insertions(+), 11 deletions(-) diff --git a/ObsoleteFiles.inc b/ObsoleteFiles.inc index 87a7f95b67a1..19e0428a5017 100644 --- a/ObsoleteFiles.inc +++ b/ObsoleteFiles.inc @@ -40,6 +40,9 @@ # xargs -n1 | sort | uniq -d; # done +# 20210923: rename boot(9) to kern_reboot(9) +OLD_FILES+=usr/share/man/man9/boot.9.gz + # 20210921: remove cloudabi OLD_FILES+=usr/share/man/man4/cloudabi.4.gz diff --git a/share/man/man9/Makefile b/share/man/man9/Makefile index 49601b9b7f48..fdaa14bc93e4 100644 --- a/share/man/man9/Makefile +++ b/share/man/man9/Makefile @@ -15,7 +15,6 @@ MAN= accept_filter.9 \ bhnd_erom.9 \ bios.9 \ bitset.9 \ - boot.9 \ bpf.9 \ buf.9 \ buf_ring.9 \ @@ -195,6 +194,7 @@ MAN= accept_filter.9 \ ithread.9 \ kasan.9 \ KASSERT.9 \ + kern_reboot.9 \ kern_testfrwk.9 \ kernacc.9 \ kernel_mount.9 \ diff --git a/share/man/man9/boot.9 b/share/man/man9/kern_reboot.9 similarity index 85% rename from share/man/man9/boot.9 rename to share/man/man9/kern_reboot.9 index cbd0099e4e18..587d4ab114db 100644 --- a/share/man/man9/boot.9 +++ b/share/man/man9/kern_reboot.9 @@ -34,21 +34,25 @@ .\" .\" $FreeBSD$ .\" -.Dd February 14, 1997 -.Dt BOOT 9 +.Dd Sept 23, 2021 +.Dt KERN_REBOOT 9 .Os .Sh NAME -.Nm boot +.Nm kern_reboot .Nd halt or reboot the system .Sh SYNOPSIS .In sys/types.h .In sys/systm.h .In sys/reboot.h .Ft void -.Fn boot "int howto" +.Fn kern_reboot "int howto" +.In sys/eventhandler.h +.Fn EVENTHANDLER_REGISTER "shutdown_pre_sync" "shutdown_fn" "private" "priority" +.Fn EVENTHANDLER_REGISTER "shutdown_post_sync" "shutdown_fn" "private" "priority" +.Fn EVENTHANDLER_REGISTER "shutdown_final" "shutdown_fn" "private" "priority" .Sh DESCRIPTION The -.Fn boot +.Fn kern_reboot function handles final system shutdown, and either halts or reboots the system. The exact action to be taken is determined by the flags passed in @@ -56,12 +60,12 @@ The exact action to be taken is determined by the flags passed in and by whether or not the system has finished autoconfiguration. .Pp If the system has finished autoconfiguration, -.Fn boot +.Fn kern_reboot does the following: .Bl -enum -offset indent .It If this is the first invocation of -.Fn boot +.Fn kern_reboot and the .Dv RB_NOSYNC flag is not set in @@ -93,8 +97,14 @@ Otherwise, reboots the system. .El .Pp If the system has not finished autoconfiguration, -.Fn boot +.Fn kern_reboot runs any shutdown hooks previously registered, prints a message, and halts the system. +.Sh RETURN VALUES +The +.Fn kern_reboot +function does not return. .Sh SEE ALSO +.Xr reboot 2 +.Xr EVENTHANDLER 9 .Xr vfs_unmountall 9 diff --git a/sys/kern/kern_shutdown.c b/sys/kern/kern_shutdown.c index 3cc51fd31956..efd7009df8f6 100644 --- a/sys/kern/kern_shutdown.c +++ b/sys/kern/kern_shutdown.c @@ -421,7 +421,8 @@ doadump(boolean_t textdump) } /* - * Shutdown the system cleanly to prepare for reboot, halt, or power off. + * kern_reboot(9): Shut down the system cleanly to prepare for reboot, halt, or + * power off. */ void kern_reboot(int howto) @@ -450,7 +451,7 @@ kern_reboot(int howto) sched_bind(curthread, CPU_FIRST()); thread_unlock(curthread); KASSERT(PCPU_GET(cpuid) == CPU_FIRST(), - ("boot: not running on cpu 0")); + ("%s: not running on cpu 0", __func__)); } #endif /* We're in the process of rebooting. */ From owner-dev-commits-src-main@freebsd.org Tue Sep 28 15:36:39 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3E48467EB4F for ; Tue, 28 Sep 2021 15:36:39 +0000 (UTC) (envelope-from mw@semihalf.com) Received: from mail-yb1-xb2f.google.com (mail-yb1-xb2f.google.com [IPv6:2607:f8b0:4864:20::b2f]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HJkBb0v4lz3jlS for ; Tue, 28 Sep 2021 15:36:39 +0000 (UTC) (envelope-from mw@semihalf.com) Received: by mail-yb1-xb2f.google.com with SMTP id w19so29911246ybs.3 for ; Tue, 28 Sep 2021 08:36:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=semihalf-com.20210112.gappssmtp.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=uh5xAj6E7QII6QFkS+2H8Me9eGbnj23770z6A0qXmxY=; b=U8mghCTPfRYmuxEpsguLvc2p1RID8Tvo+J5YDx3ZGWUVV3Rd0J75Ysn0wW5lTZBucu EIPU2LfMEw1hhhSMzufeMZvzFO9x7vhtbfjqB1MWbIGdzeLsq2IgnT+TyrkAbh+P1awc r23tcnzB9BCBMQmX+JIxsAWLtdmE0vJpwWHv4F8jUVkAWvZjL74jBV7LCNFEJta815J7 +U1ZQNiFvO24CTXhtaqocsYoJ7Xnu/lzNNIGqbug1F+6CqSBdCmcDK8B3YGoFRGOTvy5 XE9r9HJGs3UWHQPiKBFGp/Jb8/R5IQP2OUxghQx4ZI59N9oadI30u9iVAhklG8GNeaZx /4ug== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=uh5xAj6E7QII6QFkS+2H8Me9eGbnj23770z6A0qXmxY=; b=7D/UAsZjANY8iXfSsaUto2SkUEdZWY5ZMBLeuDHIZf/XOOiBNdRdt1QFp2nPbpwP70 8JBVrPg5At6XPaFaxf6rTwqRWJ3Bx8h740cH5+WYxZ39C5304ueF5O7eaPy435sFzXfP DO9wbUlOcGQJ80jtNtC1GgoxB3U74p45kftAtTz5asN6S6oPeliWmzEO9blvzIwMvtOL CUr/e6n27NYhyNVmpxrSG4DAr/gwVPfQ5XvvpKkf0T48pN8++U8EZlW0LyL3YawmfbCj D4TTIUZGzxJz9VBArnZ642FAo2bXsYnytJoDrNp9tWsObr/ZnX+XQ1FLv3f1UYg2cgY4 SzUQ== X-Gm-Message-State: AOAM533zEGzgtLOgKUdZ0+UHEB1d6mXSptp+wGTlMOkcYLwZmz0aU0gM wfChiTa9HJhaS6d3J6DR4/IA10aRBrh3nImaj0H7+w== X-Google-Smtp-Source: ABdhPJxVeXkgJncIyHKTn9WNNZYopjgTExBTz77SS7+akOfUNu8qn02zijIssqle9meTNYOR/HSH4fh6KvsDwTuBaqM= X-Received: by 2002:a5b:783:: with SMTP id b3mr7122459ybq.328.1632843398313; Tue, 28 Sep 2021 08:36:38 -0700 (PDT) MIME-Version: 1.0 References: <202109281243.18SChldh001988@gitrepo.freebsd.org> In-Reply-To: <202109281243.18SChldh001988@gitrepo.freebsd.org> From: Marcin Wojtas Date: Tue, 28 Sep 2021 17:36:27 +0200 Message-ID: Subject: Re: git: f3aa0098a82e - main - Use mtx_lock_spin in the gic driver To: Andrew Turner Cc: src-committers , dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: 4HJkBb0v4lz3jlS X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Sep 2021 15:36:39 -0000 Hi Andrew, wt., 28 wrz 2021 o 14:43 Andrew Turner napisa=C5=82(a)= : > > The branch main has been updated by andrew: > > URL: https://cgit.FreeBSD.org/src/commit/?id=3Df3aa0098a82ebf7712aa13716d= 794aa7e4ac59cd > > commit f3aa0098a82ebf7712aa13716d794aa7e4ac59cd > Author: Andrew Turner > AuthorDate: 2021-09-28 11:36:42 +0000 > Commit: Andrew Turner > CommitDate: 2021-09-28 11:42:06 +0000 > > Use mtx_lock_spin in the gic driver > > The mutex was changed to a spin lock when the MSI/MSI-X handling was > moved from the gicv2m to the gic driver. Update the calls to lock > and unlock the mutex to the spin variant. > > Submitted by: jrtc27 ("Change all the mtx_(un)lock(&sc->mutex) to b= e the _spin versions.") > Reported by: mw, antranigv@freebsd.am > Sponsored by: The FreeBSD Foundation > --- > sys/arm/arm/gic.c | 20 ++++++++++---------- > 1 file changed, 10 insertions(+), 10 deletions(-) > > diff --git a/sys/arm/arm/gic.c b/sys/arm/arm/gic.c > index d7edd7885404..89db4e324600 100644 > --- a/sys/arm/arm/gic.c > +++ b/sys/arm/arm/gic.c > @@ -1056,7 +1056,7 @@ arm_gic_alloc_msi(device_t dev, device_t child, int= count, int maxcount, > > sc =3D device_get_softc(dev); > > - mtx_lock(&sc->mutex); > + mtx_lock_spin(&sc->mutex); > > found =3D false; > for (irq =3D sc->sc_spi_start; irq < sc->sc_spi_end; irq++) { > @@ -1091,7 +1091,7 @@ arm_gic_alloc_msi(device_t dev, device_t child, int= count, int maxcount, > > /* Not enough interrupts were found */ > if (!found || irq =3D=3D sc->sc_spi_end) { > - mtx_unlock(&sc->mutex); > + mtx_unlock_spin(&sc->mutex); > return (ENXIO); > } > > @@ -1099,7 +1099,7 @@ arm_gic_alloc_msi(device_t dev, device_t child, int= count, int maxcount, > /* Mark the interrupt as used */ > sc->gic_irqs[irq + i].gi_flags |=3D GI_FLAG_MSI_USED; > } > - mtx_unlock(&sc->mutex); > + mtx_unlock_spin(&sc->mutex); > > for (i =3D 0; i < count; i++) > srcs[i] =3D (struct intr_irqsrc *)&sc->gic_irqs[irq + i]; > @@ -1118,7 +1118,7 @@ arm_gic_release_msi(device_t dev, device_t child, i= nt count, > > sc =3D device_get_softc(dev); > > - mtx_lock(&sc->mutex); > + mtx_lock_spin(&sc->mutex); > for (i =3D 0; i < count; i++) { > gi =3D (struct gic_irqsrc *)isrc[i]; > > @@ -1128,7 +1128,7 @@ arm_gic_release_msi(device_t dev, device_t child, i= nt count, > > gi->gi_flags &=3D ~GI_FLAG_MSI_USED; > } > - mtx_unlock(&sc->mutex); > + mtx_unlock_spin(&sc->mutex); > > return (0); > } > @@ -1142,7 +1142,7 @@ arm_gic_alloc_msix(device_t dev, device_t child, de= vice_t *pic, > > sc =3D device_get_softc(dev); > > - mtx_lock(&sc->mutex); > + mtx_lock_spin(&sc->mutex); > /* Find an unused interrupt */ > for (irq =3D sc->sc_spi_start; irq < sc->sc_spi_end; irq++) { > KASSERT((sc->gic_irqs[irq].gi_flags & GI_FLAG_MSI) !=3D 0= , > @@ -1152,13 +1152,13 @@ arm_gic_alloc_msix(device_t dev, device_t child, = device_t *pic, > } > /* No free interrupt was found */ > if (irq =3D=3D sc->sc_spi_end) { > - mtx_unlock(&sc->mutex); > + mtx_unlock_spin(&sc->mutex); > return (ENXIO); > } > > /* Mark the interrupt as used */ > sc->gic_irqs[irq].gi_flags |=3D GI_FLAG_MSI_USED; > - mtx_unlock(&sc->mutex); > + mtx_unlock_spin(&sc->mutex); > > *isrcp =3D (struct intr_irqsrc *)&sc->gic_irqs[irq]; > *pic =3D dev; > @@ -1178,9 +1178,9 @@ arm_gic_release_msix(device_t dev, device_t child, = struct intr_irqsrc *isrc) > KASSERT((gi->gi_flags & GI_FLAG_MSI_USED) =3D=3D GI_FLAG_MSI_USED= , > ("%s: Trying to release an unused MSI-X interrupt", __func__)= ); > > - mtx_lock(&sc->mutex); > + mtx_lock_spin(&sc->mutex); > gi->gi_flags &=3D ~GI_FLAG_MSI_USED; > - mtx_unlock(&sc->mutex); > + mtx_unlock_spin(&sc->mutex); > > return (0); > } Thank you for the patch, it fixes the MSI-X in my setup, but in order to operate properly on Marvell SoCs (equipped with a standard GICv2m), I have to remove the asserts, which were added in c6f3076d4405 (Move the GICv2m msi handling to the parent): diff --git a/sys/arm/arm/gic.c b/sys/arm/arm/gic.c index 89db4e324600..b5d72a2a6c49 100644 --- a/sys/arm/arm/gic.c +++ b/sys/arm/arm/gic.c @@ -528,8 +528,6 @@ arm_gic_write_ivar(device_t dev, device_t child, int which, uintptr_t value) * GIC_IVAR_MBI_START must be set once and first. This allo= ws * us to reserve the registers when GIC_IVAR_MBI_COUNT is s= et. */ - MPASS(sc->sc_spi_start =3D=3D 0); - MPASS(sc->sc_spi_count =3D=3D 0); MPASS(value >=3D GIC_FIRST_SPI); MPASS(value < sc->nirqs); @@ -537,7 +535,6 @@ arm_gic_write_ivar(device_t dev, device_t child, int which, uintptr_t value) return (0); case GIC_IVAR_MBI_COUNT: MPASS(sc->sc_spi_start !=3D 0); - MPASS(sc->sc_spi_count =3D=3D 0); sc->sc_spi_count =3D value; sc->sc_spi_end =3D sc->sc_spi_start + sc->sc_spi_count; Any thoughts? Best regards, Marcin From owner-dev-commits-src-main@freebsd.org Tue Sep 28 16:34:39 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6DBA767FC45; Tue, 28 Sep 2021 16:34:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HJlTW2fLVz3tTx; Tue, 28 Sep 2021 16:34:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3C17C27A59; Tue, 28 Sep 2021 16:34:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18SGYdJp008387; Tue, 28 Sep 2021 16:34:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18SGYdGd008386; Tue, 28 Sep 2021 16:34:39 GMT (envelope-from git) Date: Tue, 28 Sep 2021 16:34:39 GMT Message-Id: <202109281634.18SGYdGd008386@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ed Maste Subject: git: ecac5c2928ee - main - mgb: enable multicast in mgb_init MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ecac5c2928eead57c05ee7d376ff58de0a575d49 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Sep 2021 16:34:39 -0000 The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=ecac5c2928eead57c05ee7d376ff58de0a575d49 commit ecac5c2928eead57c05ee7d376ff58de0a575d49 Author: Ed Maste AuthorDate: 2021-09-28 16:06:04 +0000 Commit: Ed Maste CommitDate: 2021-09-28 16:32:44 +0000 mgb: enable multicast in mgb_init Receive Filtering Engine (RFE) configuration is not yet implemented, and mgb intended to enable all broadcast, multicast, and unicast. However, MGB_RFE_ALLOW_MULTICAST was missed (MGB_RFE_ALLOW_UNICAST was included twice). MFC after: 1 week Fixes: 8890ab7758b8 ("Introduce if_mgb driver...") Sponsored by: The FreeBSD Foundation --- sys/dev/mgb/if_mgb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/mgb/if_mgb.c b/sys/dev/mgb/if_mgb.c index e1381dbc307d..472de84c13b1 100644 --- a/sys/dev/mgb/if_mgb.c +++ b/sys/dev/mgb/if_mgb.c @@ -611,7 +611,7 @@ mgb_init(if_ctx_t ctx) CSR_CLEAR_REG(sc, MGB_RFE_CTL, MGB_RFE_ALLOW_PERFECT_FILTER); CSR_UPDATE_REG(sc, MGB_RFE_CTL, MGB_RFE_ALLOW_BROADCAST | - MGB_RFE_ALLOW_UNICAST | + MGB_RFE_ALLOW_MULTICAST | MGB_RFE_ALLOW_UNICAST); error = mii_mediachg(miid); From owner-dev-commits-src-main@freebsd.org Tue Sep 28 17:25:19 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C72B26A886C; Tue, 28 Sep 2021 17:25:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HJmbz4S8nz4TfJ; Tue, 28 Sep 2021 17:25:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7A79F5E5; Tue, 28 Sep 2021 17:25:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18SHPJlY075700; Tue, 28 Sep 2021 17:25:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18SHPJaQ075699; Tue, 28 Sep 2021 17:25:19 GMT (envelope-from git) Date: Tue, 28 Sep 2021 17:25:19 GMT Message-Id: <202109281725.18SHPJaQ075699@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ian Lepore Subject: git: 5e6f76f3704f - main - Add ethernet to the standard drivers for imx8. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ian X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5e6f76f3704f2cc5db3dbc0628a12549de1c7795 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Sep 2021 17:25:19 -0000 The branch main has been updated by ian: URL: https://cgit.FreeBSD.org/src/commit/?id=5e6f76f3704f2cc5db3dbc0628a12549de1c7795 commit 5e6f76f3704f2cc5db3dbc0628a12549de1c7795 Author: Ian Lepore AuthorDate: 2021-09-28 17:18:51 +0000 Commit: Ian Lepore CommitDate: 2021-09-28 17:18:51 +0000 Add ethernet to the standard drivers for imx8. --- sys/arm64/conf/std.imx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sys/arm64/conf/std.imx b/sys/arm64/conf/std.imx index 7a7e25cd33c6..55baf1aa712d 100644 --- a/sys/arm64/conf/std.imx +++ b/sys/arm64/conf/std.imx @@ -15,6 +15,9 @@ device uart_imx # iMX8 UART # MMC/SD/SDIO Card slot support device sdhci +# Ethernet +device ffec + options FDT # DTBs From owner-dev-commits-src-main@freebsd.org Tue Sep 28 17:52:58 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CA9916A96C6; Tue, 28 Sep 2021 17:52:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HJnCt5Gfmz4X47; Tue, 28 Sep 2021 17:52:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 94BC3A78; Tue, 28 Sep 2021 17:52:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18SHqwTd015566; Tue, 28 Sep 2021 17:52:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18SHqwY0015565; Tue, 28 Sep 2021 17:52:58 GMT (envelope-from git) Date: Tue, 28 Sep 2021 17:52:58 GMT Message-Id: <202109281752.18SHqwY0015565@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ian Lepore Subject: git: ea5c0b7b140b - main - Add the clock for the imx8 thermal monitoring unit. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ian X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ea5c0b7b140b745f8a34c313dc21432d9aaed574 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Sep 2021 17:52:58 -0000 The branch main has been updated by ian: URL: https://cgit.FreeBSD.org/src/commit/?id=ea5c0b7b140b745f8a34c313dc21432d9aaed574 commit ea5c0b7b140b745f8a34c313dc21432d9aaed574 Author: Ian Lepore AuthorDate: 2021-09-28 17:51:57 +0000 Commit: Ian Lepore CommitDate: 2021-09-28 17:51:57 +0000 Add the clock for the imx8 thermal monitoring unit. --- sys/arm64/freescale/imx/imx8mq_ccm.c | 2 ++ sys/arm64/freescale/imx/imx8mq_ccm.h | 2 ++ 2 files changed, 4 insertions(+) diff --git a/sys/arm64/freescale/imx/imx8mq_ccm.c b/sys/arm64/freescale/imx/imx8mq_ccm.c index 5c9751791415..9a0c8f318e39 100644 --- a/sys/arm64/freescale/imx/imx8mq_ccm.c +++ b/sys/arm64/freescale/imx/imx8mq_ccm.c @@ -233,6 +233,8 @@ static struct imx_clk imx_clks[] = { ROOT_GATE(IMX8MQ_CLK_USDHC1_ROOT, "usdhc1_root_clk", "usdhc1", 0x4510), ROOT_GATE(IMX8MQ_CLK_USDHC2_ROOT, "usdhc2_root_clk", "usdhc2", 0x4520), + ROOT_GATE(IMX8MQ_CLK_TMU_ROOT, "tmu_root_clk", "ipg_root", 0x4620), + COMPOSITE(IMX8MQ_CLK_ENET_AXI, "enet_axi", enet_axi_p, 0x8800, 0), COMPOSITE(IMX8MQ_CLK_ENET_REF, "enet_ref", enet_ref_p, 0xa980, 0), COMPOSITE(IMX8MQ_CLK_ENET_TIMER, "enet_timer", enet_timer_p, 0xaa00, 0), diff --git a/sys/arm64/freescale/imx/imx8mq_ccm.h b/sys/arm64/freescale/imx/imx8mq_ccm.h index dcd016fc729f..762090c6b3b8 100644 --- a/sys/arm64/freescale/imx/imx8mq_ccm.h +++ b/sys/arm64/freescale/imx/imx8mq_ccm.h @@ -143,6 +143,8 @@ #define IMX8MQ_CLK_IPG_ROOT 236 +#define IMX8MQ_CLK_TMU_ROOT 246 + #define IMX8MQ_CLK_GPIO1_ROOT 259 #define IMX8MQ_CLK_GPIO2_ROOT 260 #define IMX8MQ_CLK_GPIO3_ROOT 261 From owner-dev-commits-src-main@freebsd.org Tue Sep 28 17:58:23 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 38EDB6A92F8; Tue, 28 Sep 2021 17:58:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HJnL70QbTz4Xfb; Tue, 28 Sep 2021 17:58:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E1DA1A79; Tue, 28 Sep 2021 17:58:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18SHwMQa016189; Tue, 28 Sep 2021 17:58:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18SHwMPT016188; Tue, 28 Sep 2021 17:58:22 GMT (envelope-from git) Date: Tue, 28 Sep 2021 17:58:22 GMT Message-Id: <202109281758.18SHwMPT016188@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ed Maste Subject: git: 8b889b895382 - main - mgb: Do not KASSERT on error in mgb_init MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 8b889b8953828fe22e5de68647a35610dd87ff8f Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Sep 2021 17:58:23 -0000 The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=8b889b8953828fe22e5de68647a35610dd87ff8f commit 8b889b8953828fe22e5de68647a35610dd87ff8f Author: Ed Maste AuthorDate: 2021-09-28 17:48:49 +0000 Commit: Ed Maste CommitDate: 2021-09-28 17:57:36 +0000 mgb: Do not KASSERT on error in mgb_init There's not much we can do if mii_mediachg() fails, but KASSERT is not appropriate. MFC after: 1 week Fixes: 8890ab7758b8 ("Introduce if_mgb driver...") Sponsored by: The FreeBSD Foundation --- sys/dev/mgb/if_mgb.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sys/dev/mgb/if_mgb.c b/sys/dev/mgb/if_mgb.c index 472de84c13b1..de4f78e0fd57 100644 --- a/sys/dev/mgb/if_mgb.c +++ b/sys/dev/mgb/if_mgb.c @@ -615,7 +615,10 @@ mgb_init(if_ctx_t ctx) MGB_RFE_ALLOW_UNICAST); error = mii_mediachg(miid); - KASSERT(!error, ("mii_mediachg returned: %d", error)); + /* Not much we can do if this fails. */ + if (error) + device_printf(sc->dev, "%s: mii_mediachg returned %d", __func__, + error); } #ifdef DEBUG From owner-dev-commits-src-main@freebsd.org Tue Sep 28 18:00:43 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B80486A9888 for ; Tue, 28 Sep 2021 18:00:43 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: from mail-wr1-f42.google.com (mail-wr1-f42.google.com [209.85.221.42]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HJnNp5ZDTz4Xgw for ; Tue, 28 Sep 2021 18:00:42 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: by mail-wr1-f42.google.com with SMTP id t8so59622541wri.1 for ; Tue, 28 Sep 2021 11:00:42 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=HIO+OZgAAJI9Ryrzp/WPMvtKYBIz4HIEJXrrOfxID9U=; b=wOKlCzLZ6wLybYkbl5hc31uW+QkPJTuIuc3zr/2O9wFTgtO9jUn+5pTD3Q3yhDmiT/ yBB7dxtDp4EVLoEERHZ2N8ezAbJ4h86axGmdh0Jf61vii3iBei+6Kka5RMDBdBmJQQpu Fl+gnnAk8zkJDRtpz7kBl4FgQlZB6itOqKfbVOAJOZq6Ps7wtkJrjrCo4WWHsMQvEvym XHXrsWgpVCoY+PqXpyyWt8CiTO2YmM/CjqPXtZ+JFu/uKCWMOW7uDO8tLTIrYVgt17Na RN/kdakga56t8HQu93tyuf1pOWbtckXYHqPZNN/or0v0OLEfUDI+hSrlxOHv/DB7Mabb 8JEg== X-Gm-Message-State: AOAM531A87Z9ghxBUdzAw8GwgXEKlDs2JdbVfmNaOtwggfwMRqoGemtC 9LA6MUPqyvNNKtfOKTwtyECj7w== X-Google-Smtp-Source: ABdhPJxXALFZcwj/YtZw3ES9/Qcy46+STBuw5SqvNk2hHQvB6vU6A9wj7zIRe+m02KhFtQ0UYGGgPQ== X-Received: by 2002:adf:b60d:: with SMTP id f13mr1665843wre.239.1632852036305; Tue, 28 Sep 2021 11:00:36 -0700 (PDT) Received: from smtpclient.apple (global-5-143.nat-2.net.cam.ac.uk. [131.111.5.143]) by smtp.gmail.com with ESMTPSA id o1sm3740722wmq.26.2021.09.28.11.00.35 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 28 Sep 2021 11:00:35 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.120.0.1.13\)) Subject: Re: git: 8a8166e5bcfb - main - mmc: switch mmc_helper to device_ api From: Jessica Clarke In-Reply-To: <202109201518.18KFIKnL007451@gitrepo.freebsd.org> Date: Tue, 28 Sep 2021 19:00:34 +0100 Cc: "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Content-Transfer-Encoding: quoted-printable Message-Id: <6D76D431-43A6-4729-90A5-D19EDE05E998@freebsd.org> References: <202109201518.18KFIKnL007451@gitrepo.freebsd.org> To: Marcin Wojtas X-Mailer: Apple Mail (2.3654.120.0.1.13) X-Rspamd-Queue-Id: 4HJnNp5ZDTz4Xgw X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of jrtc27@jrtc27.com designates 209.85.221.42 as permitted sender) smtp.mailfrom=jrtc27@jrtc27.com X-Spamd-Result: default: False [-2.50 / 15.00]; TO_DN_EQ_ADDR_SOME(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; TO_DN_SOME(0.00)[]; MV_CASE(0.50)[]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17]; RCVD_COUNT_THREE(0.00)[3]; NEURAL_HAM_SHORT(-1.00)[-1.000]; FORGED_SENDER(0.30)[jrtc27@freebsd.org,jrtc27@jrtc27.com]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; MID_RHS_MATCH_FROM(0.00)[]; FROM_NEQ_ENVFROM(0.00)[jrtc27@freebsd.org,jrtc27@jrtc27.com]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; FREEFALL_USER(0.00)[jrtc27]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; NEURAL_HAM_LONG(-1.00)[-1.000]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[dev-commits-src-main@freebsd.org]; DMARC_NA(0.00)[freebsd.org]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[209.85.221.42:from]; RWL_MAILSPIKE_POSSIBLE(0.00)[209.85.221.42:from]; RCVD_TLS_ALL(0.00)[]; MAILMAN_DEST(0.00)[dev-commits-src-main] X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Sep 2021 18:00:43 -0000 On 20 Sep 2021, at 16:18, Marcin Wojtas wrote: >=20 > The branch main has been updated by mw: >=20 > URL: = https://cgit.FreeBSD.org/src/commit/?id=3D8a8166e5bcfb50e2b7280581b600d098= fa6c9fc7 >=20 > commit 8a8166e5bcfb50e2b7280581b600d098fa6c9fc7 > Author: Bartlomiej Grzesik > AuthorDate: 2021-08-02 14:27:23 +0000 > Commit: Marcin Wojtas > CommitDate: 2021-09-20 15:18:02 +0000 >=20 > mmc: switch mmc_helper to device_ api >=20 > Add generic mmc_helper which uses newly introduced = device_*_property > api. Thanks to this change the sd/mmc drivers will be capable > of parsing both DT and ACPI description. >=20 > Ensure backward compatibility for all mmc_fdt_helper users. >=20 > Reviewed by: manu, mw > Sponsored by: Semihalf > Differential revision: https://reviews.freebsd.org/D31598 > --- > sys/arm/allwinner/aw_mmc.c | 2 +- > sys/arm/broadcom/bcm2835/bcm2835_sdhci.c | 2 +- > sys/conf/files | 1 + > sys/dev/mmc/host/dwmmc_var.h | 2 +- > sys/dev/mmc/mmc_fdt_helpers.c | 116 = ++++---------------------- > sys/dev/mmc/mmc_fdt_helpers.h | 42 ++-------- > sys/dev/mmc/mmc_helpers.c | 134 = +++++++++++++++++++++++++++++++ > sys/dev/mmc/mmc_helpers.h | 70 ++++++++++++++++ > sys/dev/sdhci/sdhci_fsl_fdt.c | 2 +- > sys/dev/sdhci/sdhci_xenon.c | 2 +- > 10 files changed, 234 insertions(+), 139 deletions(-) >=20 > diff --git a/sys/arm/allwinner/aw_mmc.c b/sys/arm/allwinner/aw_mmc.c > index 9f215399e62b..3271090f19e3 100644 > --- a/sys/arm/allwinner/aw_mmc.c > +++ b/sys/arm/allwinner/aw_mmc.c > @@ -130,7 +130,7 @@ struct aw_mmc_softc { > int aw_timeout; > struct callout aw_timeoutc; > struct mmc_host aw_host; > - struct mmc_fdt_helper mmc_helper; > + struct mmc_helper mmc_helper; > #ifdef MMCCAM > union ccb * ccb; > struct mmc_sim mmc_sim; > diff --git a/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c = b/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c > index cd9b60743be3..38617dcd38eb 100644 > --- a/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c > +++ b/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c > @@ -156,7 +156,7 @@ struct bcm_sdhci_softc { > void * sc_intrhand; > struct mmc_request * sc_req; > struct sdhci_slot sc_slot; > - struct mmc_fdt_helper sc_mmc_helper; > + struct mmc_helper sc_mmc_helper; > int sc_dma_ch; > bus_dma_tag_t sc_dma_tag; > bus_dmamap_t sc_dma_map; > diff --git a/sys/conf/files b/sys/conf/files > index bf1c680093d1..1d3a36ac6bc7 100644 > --- a/sys/conf/files > +++ b/sys/conf/files > @@ -2483,6 +2483,7 @@ dev/mmc/mmcbr_if.m standard > dev/mmc/mmcbus_if.m standard > dev/mmc/mmcsd.c optional mmcsd !mmccam > dev/mmc/mmc_fdt_helpers.c optional ext_resources mmc fdt | = ext_resources mmccam fdt > +dev/mmc/mmc_helpers.c optional ext_resources mmc | = ext_resources mmccam > dev/mmc/mmc_pwrseq.c optional ext_resources mmc fdt | = ext_resources mmccam fdt > dev/mmc/mmc_pwrseq_if.m optional ext_resources mmc fdt | = ext_resources mmccam fdt > dev/mmcnull/mmcnull.c optional mmcnull > diff --git a/sys/dev/mmc/host/dwmmc_var.h = b/sys/dev/mmc/host/dwmmc_var.h > index ef7c91fa628e..a3f20278ad2a 100644 > --- a/sys/dev/mmc/host/dwmmc_var.h > +++ b/sys/dev/mmc/host/dwmmc_var.h > @@ -56,7 +56,7 @@ struct dwmmc_softc { > device_t dev; > void *intr_cookie; > struct mmc_host host; > - struct mmc_fdt_helper mmc_helper; > + struct mmc_helper mmc_helper; > struct mtx sc_mtx; > #ifdef MMCCAM > union ccb * ccb; > diff --git a/sys/dev/mmc/mmc_fdt_helpers.c = b/sys/dev/mmc/mmc_fdt_helpers.c > index 291a4bc72ff2..249a430311fa 100644 > --- a/sys/dev/mmc/mmc_fdt_helpers.c > +++ b/sys/dev/mmc/mmc_fdt_helpers.c > @@ -45,105 +45,21 @@ __FBSDID("$FreeBSD$"); > #include > #endif >=20 > -#include "mmc_pwrseq_if.h" > - > -static inline void > -mmc_fdt_parse_sd_speed(phandle_t node, struct mmc_host *host) > -{ > - bool no_18v =3D false; > - > - /*=20 > - * Parse SD supported modes=20 > - * All UHS-I modes requires 1.8V signaling. > - */ > - if (OF_hasprop(node, "no-1-8-v")) > - no_18v =3D true; > - if (OF_hasprop(node, "cap-sd-highspeed")) > - host->caps |=3D MMC_CAP_HSPEED; > - if (OF_hasprop(node, "sd-uhs-sdr12") && no_18v =3D=3D false) > - host->caps |=3D MMC_CAP_UHS_SDR12 | = MMC_CAP_SIGNALING_180; > - if (OF_hasprop(node, "sd-uhs-sdr25") && no_18v =3D=3D false) > - host->caps |=3D MMC_CAP_UHS_SDR25 | = MMC_CAP_SIGNALING_180; > - if (OF_hasprop(node, "sd-uhs-sdr50") && no_18v =3D=3D false) > - host->caps |=3D MMC_CAP_UHS_SDR50 | = MMC_CAP_SIGNALING_180; > - if (OF_hasprop(node, "sd-uhs-sdr104") && no_18v =3D=3D false) > - host->caps |=3D MMC_CAP_UHS_SDR104 | = MMC_CAP_SIGNALING_180; > - if (OF_hasprop(node, "sd-uhs-ddr50") && no_18v =3D=3D false) > - host->caps |=3D MMC_CAP_UHS_DDR50 | = MMC_CAP_SIGNALING_180; > -} > +#include >=20 > -static inline void > -mmc_fdt_parse_mmc_speed(phandle_t node, struct mmc_host *host) > -{ > - > - /* Parse eMMC supported modes */ > - if (OF_hasprop(node, "cap-mmc-highspeed")) > - host->caps |=3D MMC_CAP_HSPEED; > - if (OF_hasprop(node, "mmc-ddr-1_2v")) > - host->caps |=3D MMC_CAP_MMC_DDR52_120 | = MMC_CAP_SIGNALING_120; > - if (OF_hasprop(node, "mmc-ddr-1_8v")) > - host->caps |=3D MMC_CAP_MMC_DDR52_180 | = MMC_CAP_SIGNALING_180; > - if (OF_hasprop(node, "mmc-ddr-3_3v")) > - host->caps |=3D MMC_CAP_SIGNALING_330; > - if (OF_hasprop(node, "mmc-hs200-1_2v")) > - host->caps |=3D MMC_CAP_MMC_HS200_120 | = MMC_CAP_SIGNALING_120; > - if (OF_hasprop(node, "mmc-hs200-1_8v")) > - host->caps |=3D MMC_CAP_MMC_HS200_180 | = MMC_CAP_SIGNALING_180; > - if (OF_hasprop(node, "mmc-hs400-1_2v")) > - host->caps |=3D MMC_CAP_MMC_HS400_120 | = MMC_CAP_SIGNALING_120; > - if (OF_hasprop(node, "mmc-hs400-1_8v")) > - host->caps |=3D MMC_CAP_MMC_HS400_180 | = MMC_CAP_SIGNALING_180; > - if (OF_hasprop(node, "mmc-hs400-enhanced-strobe")) > - host->caps |=3D MMC_CAP_MMC_ENH_STROBE; > -} > +#include "mmc_pwrseq_if.h" >=20 > int > -mmc_fdt_parse(device_t dev, phandle_t node, struct mmc_fdt_helper = *helper, > +mmc_fdt_parse(device_t dev, phandle_t node, struct mmc_helper = *helper, > struct mmc_host *host) > { > - uint32_t bus_width; > + struct mmc_helper mmc_helper; > phandle_t pwrseq_xref; >=20 > - if (node <=3D 0) > - node =3D ofw_bus_get_node(dev); > - if (node <=3D 0) > - return (ENXIO); > - > - if (OF_getencprop(node, "bus-width", &bus_width, = sizeof(uint32_t)) <=3D 0) > - bus_width =3D 1; > - > - if (bus_width >=3D 4) > - host->caps |=3D MMC_CAP_4_BIT_DATA; > - if (bus_width >=3D 8) > - host->caps |=3D MMC_CAP_8_BIT_DATA; > + memset(&mmc_helper, 0, sizeof(mmc_helper)); > + mmc_parse(dev, &mmc_helper, host); >=20 > - /*=20 > - * max-frequency is optional, drivers should tweak this value > - * if it's not present based on the clock that the mmc = controller > - * operates on > - */ > - OF_getencprop(node, "max-frequency", &host->f_max, = sizeof(uint32_t)); > - > - if (OF_hasprop(node, "broken-cd")) > - helper->props |=3D MMC_PROP_BROKEN_CD; > - if (OF_hasprop(node, "non-removable")) > - helper->props |=3D MMC_PROP_NON_REMOVABLE; > - if (OF_hasprop(node, "wp-inverted")) > - helper->props |=3D MMC_PROP_WP_INVERTED; > - if (OF_hasprop(node, "cd-inverted")) > - helper->props |=3D MMC_PROP_CD_INVERTED; > - if (OF_hasprop(node, "no-sdio")) > - helper->props |=3D MMC_PROP_NO_SDIO; > - if (OF_hasprop(node, "no-sd")) > - helper->props |=3D MMC_PROP_NO_SD; > - if (OF_hasprop(node, "no-mmc")) > - helper->props |=3D MMC_PROP_NO_MMC; > - > - if (!(helper->props & MMC_PROP_NO_SD)) > - mmc_fdt_parse_sd_speed(node, host); > - > - if (!(helper->props & MMC_PROP_NO_MMC)) > - mmc_fdt_parse_mmc_speed(node, host); > + helper->props =3D mmc_helper.props; >=20 > #ifdef EXT_RESOURCES > /* > @@ -200,7 +116,7 @@ mmc_fdt_parse(device_t dev, phandle_t node, struct = mmc_fdt_helper *helper, > static void > cd_intr(void *arg) > { > - struct mmc_fdt_helper *helper =3D arg; > + struct mmc_helper *helper =3D arg; >=20 > taskqueue_enqueue_timeout(taskqueue_swi_giant, > &helper->cd_delayed_task, -(hz / 2)); > @@ -209,7 +125,7 @@ cd_intr(void *arg) > static void > cd_card_task(void *arg, int pending __unused) > { > - struct mmc_fdt_helper *helper =3D arg; > + struct mmc_helper *helper =3D arg; > bool cd_present; >=20 > cd_present =3D mmc_fdt_gpio_get_present(helper); > @@ -228,7 +144,7 @@ cd_card_task(void *arg, int pending __unused) > * Card detect setup. > */ > static void > -cd_setup(struct mmc_fdt_helper *helper, phandle_t node) > +cd_setup(struct mmc_helper *helper, phandle_t node) > { > int pincaps; > device_t dev; > @@ -330,7 +246,7 @@ without_interrupts: > * Write protect setup. > */ > static void > -wp_setup(struct mmc_fdt_helper *helper, phandle_t node) > +wp_setup(struct mmc_helper *helper, phandle_t node) > { > device_t dev; >=20 > @@ -352,7 +268,7 @@ wp_setup(struct mmc_fdt_helper *helper, phandle_t = node) > } >=20 > int > -mmc_fdt_gpio_setup(device_t dev, phandle_t node, struct = mmc_fdt_helper *helper, > +mmc_fdt_gpio_setup(device_t dev, phandle_t node, struct mmc_helper = *helper, > mmc_fdt_cd_handler handler) > { >=20 > @@ -377,7 +293,7 @@ mmc_fdt_gpio_setup(device_t dev, phandle_t node, = struct mmc_fdt_helper *helper, > } >=20 > void > -mmc_fdt_gpio_teardown(struct mmc_fdt_helper *helper) > +mmc_fdt_gpio_teardown(struct mmc_helper *helper) > { >=20 > if (helper =3D=3D NULL) > @@ -396,7 +312,7 @@ mmc_fdt_gpio_teardown(struct mmc_fdt_helper = *helper) > } >=20 > bool > -mmc_fdt_gpio_get_present(struct mmc_fdt_helper *helper) > +mmc_fdt_gpio_get_present(struct mmc_helper *helper) > { > bool pinstate; >=20 > @@ -411,7 +327,7 @@ mmc_fdt_gpio_get_present(struct mmc_fdt_helper = *helper) > } >=20 > bool > -mmc_fdt_gpio_get_readonly(struct mmc_fdt_helper *helper) > +mmc_fdt_gpio_get_readonly(struct mmc_helper *helper) > { > bool pinstate; >=20 > @@ -427,7 +343,7 @@ mmc_fdt_gpio_get_readonly(struct mmc_fdt_helper = *helper) > } >=20 > void > -mmc_fdt_set_power(struct mmc_fdt_helper *helper, enum mmc_power_mode = power_mode) > +mmc_fdt_set_power(struct mmc_helper *helper, enum mmc_power_mode = power_mode) > { > int reg_status; > int rv; > diff --git a/sys/dev/mmc/mmc_fdt_helpers.h = b/sys/dev/mmc/mmc_fdt_helpers.h > index e6d6f3fbfd84..f07ca1684440 100644 > --- a/sys/dev/mmc/mmc_fdt_helpers.h > +++ b/sys/dev/mmc/mmc_fdt_helpers.h > @@ -37,43 +37,17 @@ > #include > #endif >=20 > -struct mmc_fdt_helper { > - device_t dev; > - gpio_pin_t wp_pin; > - gpio_pin_t cd_pin; > - void * cd_ihandler; > - struct resource * cd_ires; > - int cd_irid; > - void (*cd_handler)(device_t, bool); > - struct timeout_task cd_delayed_task; > - bool cd_disabled; > - bool wp_disabled; > - bool cd_present; > - uint32_t props; > -#define MMC_PROP_BROKEN_CD (1 << 0) > -#define MMC_PROP_NON_REMOVABLE (1 << 1) > -#define MMC_PROP_WP_INVERTED (1 << 2) > -#define MMC_PROP_CD_INVERTED (1 << 3) > -#define MMC_PROP_DISABLE_WP (1 << 4) > -#define MMC_PROP_NO_SDIO (1 << 5) > -#define MMC_PROP_NO_SD (1 << 6) > -#define MMC_PROP_NO_MMC (1 << 7) > +#include >=20 > -#ifdef EXT_RESOURCES > - regulator_t vmmc_supply; > - regulator_t vqmmc_supply; > -#endif > - > - device_t mmc_pwrseq; > -}; > +#define mmc_fdt_helper mmc_helper /* For backwards compatibility */ >=20 > typedef void (*mmc_fdt_cd_handler)(device_t dev, bool present); >=20 > -int mmc_fdt_parse(device_t dev, phandle_t node, struct mmc_fdt_helper = *helper, struct mmc_host *host); > -int mmc_fdt_gpio_setup(device_t dev, phandle_t node, struct = mmc_fdt_helper *helper, mmc_fdt_cd_handler handler); > -void mmc_fdt_gpio_teardown(struct mmc_fdt_helper *helper); > -bool mmc_fdt_gpio_get_present(struct mmc_fdt_helper *helper); > -bool mmc_fdt_gpio_get_readonly(struct mmc_fdt_helper *helper); > -void mmc_fdt_set_power(struct mmc_fdt_helper *helper, enum = mmc_power_mode power_mode); > +int mmc_fdt_parse(device_t dev, phandle_t node, struct mmc_helper = *helper, struct mmc_host *host); > +int mmc_fdt_gpio_setup(device_t dev, phandle_t node, struct = mmc_helper *helper, mmc_fdt_cd_handler handler); > +void mmc_fdt_gpio_teardown(struct mmc_helper *helper); > +bool mmc_fdt_gpio_get_present(struct mmc_helper *helper); > +bool mmc_fdt_gpio_get_readonly(struct mmc_helper *helper); > +void mmc_fdt_set_power(struct mmc_helper *helper, enum mmc_power_mode = power_mode); >=20 > #endif > diff --git a/sys/dev/mmc/mmc_helpers.c b/sys/dev/mmc/mmc_helpers.c > new file mode 100644 > index 000000000000..0e1e16666367 > --- /dev/null > +++ b/sys/dev/mmc/mmc_helpers.c > @@ -0,0 +1,134 @@ > +/* > + * Copyright 2019 Emmanuel Vadot > + * Copyright (c) 2017 Ian Lepore All rights = reserved. > + * > + * Redistribution and use in source and binary forms, with or without > + * modification, are permitted provided that the following conditions = are > + * met: > + * > + * 1. Redistributions of source code must retain the above copyright > + * notice, this list of conditions and the following disclaimer. > + * 2. Redistributions in binary form must reproduce the above = copyright > + * notice, this list of conditions and the following disclaimer = in the > + * documentation and/or other materials provided with the = distribution. > + * > + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' = AND > + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, = THE > + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR > + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR = CONTRIBUTORS BE > + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, = OR > + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT = OF > + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR > + * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF = LIABILITY, > + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING = NEGLIGENCE OR > + * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, = EVEN IF > + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. > + */ > + > +#include > +__FBSDID("$FreeBSD$"); > + > +#include > +#include > +#include > +#include > +#include > + > +#include > +#include > + > +static inline void > +mmc_parse_sd_speed(device_t dev, struct mmc_host *host) > +{ > + bool no_18v =3D false; > + > + /* > + * Parse SD supported modes > + * All UHS-I modes requires 1.8V signaling. > + */ > + if (device_has_property(dev, "no-1-8-v")) > + no_18v =3D true; > + if (device_has_property(dev, "cap-sd-highspeed")) > + host->caps |=3D MMC_CAP_HSPEED; > + if (device_has_property(dev, "sd-uhs-sdr12") && !no_18v) > + host->caps |=3D MMC_CAP_UHS_SDR12 | = MMC_CAP_SIGNALING_180; > + if (device_has_property(dev, "sd-uhs-sdr25") && !no_18v) > + host->caps |=3D MMC_CAP_UHS_SDR25 | = MMC_CAP_SIGNALING_180; > + if (device_has_property(dev, "sd-uhs-sdr50") && !no_18v) > + host->caps |=3D MMC_CAP_UHS_SDR50 | = MMC_CAP_SIGNALING_180; > + if (device_has_property(dev, "sd-uhs-sdr104") && !no_18v) > + host->caps |=3D MMC_CAP_UHS_SDR104 | = MMC_CAP_SIGNALING_180; > + if (device_has_property(dev, "sd-uhs-ddr50") && !no_18v) > + host->caps |=3D MMC_CAP_UHS_DDR50 | = MMC_CAP_SIGNALING_180; > +} > + > +static inline void > +mmc_parse_mmc_speed(device_t dev, struct mmc_host *host) > +{ > + /* Parse eMMC supported modes */ > + if (device_has_property(dev, "cap-mmc-highspeed")) > + host->caps |=3D MMC_CAP_HSPEED; > + if (device_has_property(dev, "mmc-ddr-1_2v")) > + host->caps |=3D MMC_CAP_MMC_DDR52_120 | = MMC_CAP_SIGNALING_120; > + if (device_has_property(dev, "mmc-ddr-1_8v")) > + host->caps |=3D MMC_CAP_MMC_DDR52_180 | = MMC_CAP_SIGNALING_180; > + if (device_has_property(dev, "mmc-ddr-3_3v")) > + host->caps |=3D MMC_CAP_SIGNALING_330; > + if (device_has_property(dev, "mmc-hs200-1_2v")) > + host->caps |=3D MMC_CAP_MMC_HS200_120 | = MMC_CAP_SIGNALING_120; > + if (device_has_property(dev, "mmc-hs200-1_8v")) > + host->caps |=3D MMC_CAP_MMC_HS200_180 | = MMC_CAP_SIGNALING_180; > + if (device_has_property(dev, "mmc-hs400-1_2v")) > + host->caps |=3D MMC_CAP_MMC_HS400_120 | = MMC_CAP_SIGNALING_120; > + if (device_has_property(dev, "mmc-hs400-1_8v")) > + host->caps |=3D MMC_CAP_MMC_HS400_180 | = MMC_CAP_SIGNALING_180; > + if (device_has_property(dev, "mmc-hs400-enhanced-strobe")) > + host->caps |=3D MMC_CAP_MMC_ENH_STROBE; > +} > + > +int > +mmc_parse(device_t dev, struct mmc_helper *helper, struct mmc_host = *host) > +{ > + uint64_t bus_width, max_freq; > + > + bus_width =3D 0; > + if (device_get_property(dev, "bus-width", &bus_width, = sizeof(uint64_t)) <=3D 0) > + bus_width =3D 1; > + > + if (bus_width >=3D 4) > + host->caps |=3D MMC_CAP_4_BIT_DATA; > + if (bus_width >=3D 8) > + host->caps |=3D MMC_CAP_8_BIT_DATA; > + > + /* > + * max-frequency is optional, drivers should tweak this value > + * if it's not present based on the clock that the mmc = controller > + * operates on > + */ > + max_freq =3D 0; > + device_get_property(dev, "max-frequency", &max_freq, = sizeof(uint64_t)); > + host->f_max =3D max_freq; Previously OF_getencprop was called with &host->f_max so it would only be written to if it existed. Now it is instead written to with the value of 0 if the property doesn=E2=80=99t exist. Both aw_mmc and dwmmc = set f_max to a default value *before* calling mmc_fdt_parse so that is now clobbered. This commit breaks booting on the Stratix 10 which uses dwmmc (boot hangs at the point where da0 would normally attach), and reverting it succeeds. I don=E2=80=99t know if f_max being clobbered is = the cause of that (I=E2=80=99ll try tomorrow), but it seems likely, and is certainly a bug in this commit. Jess From owner-dev-commits-src-main@freebsd.org Tue Sep 28 18:06:29 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1C69E6A97B5; Tue, 28 Sep 2021 18:06:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HJnWS6nsKz4ZNn; Tue, 28 Sep 2021 18:06:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C99C410AF; Tue, 28 Sep 2021 18:06:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18SI6SZZ029851; Tue, 28 Sep 2021 18:06:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18SI6S8m029850; Tue, 28 Sep 2021 18:06:28 GMT (envelope-from git) Date: Tue, 28 Sep 2021 18:06:28 GMT Message-Id: <202109281806.18SI6S8m029850@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Li-Wen Hsu Subject: git: 819961c5808b - main - Temporarily skip sys.geom.class.multipath.failloop.failloop in CI MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: lwhsu X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 819961c5808b053c626648e202dec42a19ebe7a6 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Sep 2021 18:06:29 -0000 The branch main has been updated by lwhsu: URL: https://cgit.FreeBSD.org/src/commit/?id=819961c5808b053c626648e202dec42a19ebe7a6 commit 819961c5808b053c626648e202dec42a19ebe7a6 Author: Li-Wen Hsu AuthorDate: 2021-09-28 18:02:27 +0000 Commit: Li-Wen Hsu CommitDate: 2021-09-28 18:02:27 +0000 Temporarily skip sys.geom.class.multipath.failloop.failloop in CI This test case uses `dtrace -c` but it has some issues at the moment While here, add a checker for dtrace executes successfully or not to provide a more informative error message. PR: 258763 Sponsored by: The FreeBSD Foundation --- tests/sys/geom/class/multipath/failloop.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/sys/geom/class/multipath/failloop.sh b/tests/sys/geom/class/multipath/failloop.sh index f9a1417ae37f..b089f0f53d11 100755 --- a/tests/sys/geom/class/multipath/failloop.sh +++ b/tests/sys/geom/class/multipath/failloop.sh @@ -36,6 +36,10 @@ failloop_head() } failloop_body() { + if [ "$(atf_config_get ci false)" = "true" ]; then + atf_skip "https://bugs.freebsd.org/258763" + fi + sysctl -n kern.geom.notaste > kern.geom.notaste.txt load_gnop load_gmultipath @@ -59,6 +63,9 @@ failloop_body() # The dd command should've failed ... atf_check_equal 1 $dd_status # and triggered 1 or 2 path restores + if [ ! -f restore_count ]; then + atf_fail "dtrace didn't execute succfully" + fi if [ `cat restore_count` -gt 2 ]; then atf_fail "gmultipath restored paths too many times" fi From owner-dev-commits-src-main@freebsd.org Tue Sep 28 18:22:57 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id F1BD56A9D88; Tue, 28 Sep 2021 18:22:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HJntS6FfCz4d1J; Tue, 28 Sep 2021 18:22:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B79411614; Tue, 28 Sep 2021 18:22:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18SIMuNI055765; Tue, 28 Sep 2021 18:22:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18SIMucq055764; Tue, 28 Sep 2021 18:22:56 GMT (envelope-from git) Date: Tue, 28 Sep 2021 18:22:56 GMT Message-Id: <202109281822.18SIMucq055764@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ian Lepore Subject: git: 1acf73d54412 - main - qoriq_therm.c: avoid a segfault on the error exit path. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ian X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 1acf73d5441219d292e225bf0afbd81b490c4b91 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Sep 2021 18:22:57 -0000 The branch main has been updated by ian: URL: https://cgit.FreeBSD.org/src/commit/?id=1acf73d5441219d292e225bf0afbd81b490c4b91 commit 1acf73d5441219d292e225bf0afbd81b490c4b91 Author: Ian Lepore AuthorDate: 2021-09-28 18:19:44 +0000 Commit: Ian Lepore CommitDate: 2021-09-28 18:19:44 +0000 qoriq_therm.c: avoid a segfault on the error exit path. If anything goes wrong during attach() it is handled with a 'goto fail' which calls sysctl_ctx_free(). But the sysctl context doesn't get initialized until very late in attach(), so almost any error just results in a segfault. Move the sysctl_ctx_init() call to the beginning of the attach() function, so that it is done before any errors can happen that will lead to freeing the context. --- sys/arm64/qoriq/qoriq_therm.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/arm64/qoriq/qoriq_therm.c b/sys/arm64/qoriq/qoriq_therm.c index 33237fc94c07..c880e68025bf 100644 --- a/sys/arm64/qoriq/qoriq_therm.c +++ b/sys/arm64/qoriq/qoriq_therm.c @@ -190,7 +190,6 @@ qoriq_therm_init_sysctl(struct qoriq_therm_softc *sc) int i; struct sysctl_oid *oid, *tmp; - sysctl_ctx_init(&qoriq_therm_sysctl_ctx); /* create node for hw.temp */ oid = SYSCTL_ADD_NODE(&qoriq_therm_sysctl_ctx, SYSCTL_STATIC_CHILDREN(_hw), OID_AUTO, "temperature", @@ -269,6 +268,8 @@ qoriq_therm_attach(device_t dev) node = ofw_bus_get_node(sc->dev); sc->little_endian = OF_hasprop(node, "little-endian"); + sysctl_ctx_init(&qoriq_therm_sysctl_ctx); + rid = 0; sc->mem_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, RF_ACTIVE); From owner-dev-commits-src-main@freebsd.org Tue Sep 28 18:24:06 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6DC4B6A9D73; Tue, 28 Sep 2021 18:24:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HJnvp2flgz4dGD; Tue, 28 Sep 2021 18:24:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 30A64FDC; Tue, 28 Sep 2021 18:24:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18SIO6hQ055974; Tue, 28 Sep 2021 18:24:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18SIO61S055973; Tue, 28 Sep 2021 18:24:06 GMT (envelope-from git) Date: Tue, 28 Sep 2021 18:24:06 GMT Message-Id: <202109281824.18SIO61S055973@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Gleb Smirnoff Subject: git: c6213beff4f5 - main - Add flag BIO_SWAP to mark IOs that are associated with swap. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: glebius X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c6213beff4f51d6c9cc4e41682538d203249359e Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Sep 2021 18:24:06 -0000 The branch main has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=c6213beff4f51d6c9cc4e41682538d203249359e commit c6213beff4f51d6c9cc4e41682538d203249359e Author: Gleb Smirnoff AuthorDate: 2021-09-28 18:11:50 +0000 Commit: Gleb Smirnoff CommitDate: 2021-09-28 18:23:51 +0000 Add flag BIO_SWAP to mark IOs that are associated with swap. Submitted by: jtl Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D24400 --- sys/geom/geom_io.c | 8 ++++---- sys/sys/bio.h | 3 ++- sys/vm/swap_pager.c | 1 + 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/sys/geom/geom_io.c b/sys/geom/geom_io.c index 31213f0f2b22..c4e9be02bf44 100644 --- a/sys/geom/geom_io.c +++ b/sys/geom/geom_io.c @@ -199,12 +199,12 @@ g_clone_bio(struct bio *bp) /* * BIO_ORDERED flag may be used by disk drivers to enforce * ordering restrictions, so this flag needs to be cloned. - * BIO_UNMAPPED and BIO_VLIST should be inherited, to properly - * indicate which way the buffer is passed. + * BIO_UNMAPPED, BIO_VLIST, and BIO_SWAP should be inherited, + * to properly indicate which way the buffer is passed. * Other bio flags are not suitable for cloning. */ bp2->bio_flags = bp->bio_flags & - (BIO_ORDERED | BIO_UNMAPPED | BIO_VLIST); + (BIO_ORDERED | BIO_UNMAPPED | BIO_VLIST | BIO_SWAP); bp2->bio_length = bp->bio_length; bp2->bio_offset = bp->bio_offset; bp2->bio_data = bp->bio_data; @@ -238,7 +238,7 @@ g_duplicate_bio(struct bio *bp) struct bio *bp2; bp2 = uma_zalloc(biozone, M_WAITOK | M_ZERO); - bp2->bio_flags = bp->bio_flags & (BIO_UNMAPPED | BIO_VLIST); + bp2->bio_flags = bp->bio_flags & (BIO_UNMAPPED | BIO_VLIST | BIO_SWAP); bp2->bio_parent = bp; bp2->bio_cmd = bp->bio_cmd; bp2->bio_length = bp->bio_length; diff --git a/sys/sys/bio.h b/sys/sys/bio.h index 5fdf0ecbb917..fba1b9dce68f 100644 --- a/sys/sys/bio.h +++ b/sys/sys/bio.h @@ -67,8 +67,9 @@ #define BIO_UNMAPPED 0x10 #define BIO_TRANSIENT_MAPPING 0x20 #define BIO_VLIST 0x40 +#define BIO_SWAP 0x200 /* Swap-related I/O */ -#define PRINT_BIO_FLAGS "\20\7vlist\6transient_mapping\5unmapped" \ +#define PRINT_BIO_FLAGS "\20\12swap\7vlist\6transient_mapping\5unmapped" \ "\4ordered\3onqueue\2done\1error" #define BIO_SPEEDUP_WRITE 0x4000 /* Resource shortage at upper layers */ diff --git a/sys/vm/swap_pager.c b/sys/vm/swap_pager.c index 6d64ff883966..08a5ead438ba 100644 --- a/sys/vm/swap_pager.c +++ b/sys/vm/swap_pager.c @@ -2893,6 +2893,7 @@ swapgeom_strategy(struct buf *bp, struct swdevt *sp) bio->bio_offset = (bp->b_blkno - sp->sw_first) * PAGE_SIZE; bio->bio_length = bp->b_bcount; bio->bio_done = swapgeom_done; + bio->bio_flags |= BIO_SWAP; if (!buf_mapped(bp)) { bio->bio_ma = bp->b_pages; bio->bio_data = unmapped_buf; From owner-dev-commits-src-main@freebsd.org Tue Sep 28 18:24:07 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 860C06A99DC; Tue, 28 Sep 2021 18:24:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HJnvq3Fynz4dXJ; Tue, 28 Sep 2021 18:24:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 513CA1615; Tue, 28 Sep 2021 18:24:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18SIO79U055998; Tue, 28 Sep 2021 18:24:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18SIO7mY055997; Tue, 28 Sep 2021 18:24:07 GMT (envelope-from git) Date: Tue, 28 Sep 2021 18:24:07 GMT Message-Id: <202109281824.18SIO7mY055997@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Gleb Smirnoff Subject: git: 183f8e1e575b - main - Externalize nsw_cluster_max and initialize it early. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: glebius X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 183f8e1e575b526515e70400a22af243cd1a4a78 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Sep 2021 18:24:07 -0000 The branch main has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=183f8e1e575b526515e70400a22af243cd1a4a78 commit 183f8e1e575b526515e70400a22af243cd1a4a78 Author: Gleb Smirnoff AuthorDate: 2021-09-28 18:13:33 +0000 Commit: Gleb Smirnoff CommitDate: 2021-09-28 18:23:52 +0000 Externalize nsw_cluster_max and initialize it early. GEOM_ELI needs to know the value, cause it will soon have special memory handling for IO operations associated with swap. Move initialization to swap_pager_init(), which is executed at SI_SUB_VM, unlike swap_pager_swap_init(), which would be executed only when a swap is configured. GEOM_ELI might need the value at SI_SUB_DRIVERS, when disks are tasted by GEOM. Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D24400 --- sys/vm/swap_pager.c | 20 +++++++++++++------- sys/vm/swap_pager.h | 1 + 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/sys/vm/swap_pager.c b/sys/vm/swap_pager.c index 08a5ead438ba..9bc506c9b6b8 100644 --- a/sys/vm/swap_pager.c +++ b/sys/vm/swap_pager.c @@ -383,7 +383,7 @@ static int swap_pager_almost_full = 1; /* swap space exhaustion (w/hysteresis)*/ static struct mtx swbuf_mtx; /* to sync nsw_wcount_async */ static int nsw_wcount_async; /* limit async write buffers */ static int nsw_wcount_async_max;/* assigned maximum */ -static int nsw_cluster_max; /* maximum VOP I/O allowed */ +int nsw_cluster_max; /* maximum VOP I/O allowed */ static int sysctl_swap_async_max(SYSCTL_HANDLER_ARGS); SYSCTL_PROC(_vm, OID_AUTO, swap_async_max, CTLTYPE_INT | CTLFLAG_RW | @@ -572,6 +572,16 @@ swap_pager_init(void) mtx_init(&sw_dev_mtx, "swapdev", NULL, MTX_DEF); sx_init(&sw_alloc_sx, "swspsx"); sx_init(&swdev_syscall_lock, "swsysc"); + + /* + * The nsw_cluster_max is constrained by the bp->b_pages[] + * array, which has maxphys / PAGE_SIZE entries, and our locally + * defined MAX_PAGEOUT_CLUSTER. Also be aware that swap ops are + * constrained by the swap device interleave stripe size. + * + * Initialized early so that GEOM_ELI can see it. + */ + nsw_cluster_max = min(maxphys / PAGE_SIZE, MAX_PAGEOUT_CLUSTER); } /* @@ -591,11 +601,6 @@ swap_pager_swap_init(void) * initialize workable values (0 will work for hysteresis * but it isn't very efficient). * - * The nsw_cluster_max is constrained by the bp->b_pages[] - * array, which has maxphys / PAGE_SIZE entries, and our locally - * defined MAX_PAGEOUT_CLUSTER. Also be aware that swap ops are - * constrained by the swap device interleave stripe size. - * * Currently we hardwire nsw_wcount_async to 4. This limit is * designed to prevent other I/O from having high latencies due to * our pageout I/O. The value 4 works well for one or two active swap @@ -606,8 +611,9 @@ swap_pager_swap_init(void) * at least 2 per swap devices, and 4 is a pretty good value if you * have one NFS swap device due to the command/ack latency over NFS. * So it all works out pretty well. + * + * nsw_cluster_max is initialized in swap_pager_init(). */ - nsw_cluster_max = min(maxphys / PAGE_SIZE, MAX_PAGEOUT_CLUSTER); nsw_wcount_async = 4; nsw_wcount_async_max = nsw_wcount_async; diff --git a/sys/vm/swap_pager.h b/sys/vm/swap_pager.h index 6761d4f99ee4..20b9bc95b1b2 100644 --- a/sys/vm/swap_pager.h +++ b/sys/vm/swap_pager.h @@ -71,6 +71,7 @@ struct swdevt { #ifdef _KERNEL extern int swap_pager_avail; +extern int nsw_cluster_max; struct xswdev; int swap_dev_info(int name, struct xswdev *xs, char *devname, size_t len); From owner-dev-commits-src-main@freebsd.org Tue Sep 28 18:24:08 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DAEC36A9F04; Tue, 28 Sep 2021 18:24:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HJnvr45Fyz4dM8; Tue, 28 Sep 2021 18:24:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6A20C1598; Tue, 28 Sep 2021 18:24:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18SIO88s056022; Tue, 28 Sep 2021 18:24:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18SIO8Ss056021; Tue, 28 Sep 2021 18:24:08 GMT (envelope-from git) Date: Tue, 28 Sep 2021 18:24:08 GMT Message-Id: <202109281824.18SIO8Ss056021@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Gleb Smirnoff Subject: git: 2dbc9a388eeb - main - Fix memory deadlock when GELI partition is used for swap. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: glebius X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2dbc9a388eeb73a6b17eb6fd1349a2a7e95123cc Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Sep 2021 18:24:09 -0000 The branch main has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=2dbc9a388eeb73a6b17eb6fd1349a2a7e95123cc commit 2dbc9a388eeb73a6b17eb6fd1349a2a7e95123cc Author: Gleb Smirnoff AuthorDate: 2021-09-28 18:19:29 +0000 Commit: Gleb Smirnoff CommitDate: 2021-09-28 18:23:52 +0000 Fix memory deadlock when GELI partition is used for swap. When we get low on memory, the VM system tries to free some by swapping pages. However, if we are so low on free pages that GELI allocations block, then the swapout operation cannot complete. This keeps the VM system from being able to free enough memory so the allocation can complete. To alleviate this, keep a UMA pool at the GELI layer which is used for data buffer allocation in the fast path, and reserve some of that memory for swap operations. If an IO operation is a swap, then use the reserved memory. If the allocation still fails, return ENOMEM instead of blocking. For non-swap allocations, change the default to using M_NOWAIT. In general, this *should* be better, since it gives upper layers a signal of the memory pressure and a chance to manage their failure strategy appropriately. However, a user can set the kern.geom.eli.blocking_malloc sysctl/tunable to restore the previous M_WAITOK strategy. Submitted by: jtl Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D24400 --- sys/geom/eli/g_eli.c | 201 ++++++++++++++++++++++++++++++++++++++--- sys/geom/eli/g_eli.h | 13 ++- sys/geom/eli/g_eli_integrity.c | 37 +++++--- sys/geom/eli/g_eli_privacy.c | 25 +++-- 4 files changed, 239 insertions(+), 37 deletions(-) diff --git a/sys/geom/eli/g_eli.c b/sys/geom/eli/g_eli.c index 24b61d9f6d8e..773b9c829acc 100644 --- a/sys/geom/eli/g_eli.c +++ b/sys/geom/eli/g_eli.c @@ -53,6 +53,8 @@ __FBSDID("$FreeBSD$"); #include #include +#include +#include #include #include @@ -90,6 +92,48 @@ SYSCTL_UINT(_kern_geom_eli, OID_AUTO, threads, CTLFLAG_RWTUN, &g_eli_threads, 0, u_int g_eli_batch = 0; SYSCTL_UINT(_kern_geom_eli, OID_AUTO, batch, CTLFLAG_RWTUN, &g_eli_batch, 0, "Use crypto operations batching"); +static u_int g_eli_minbufs = 16; +static int sysctl_g_eli_minbufs(SYSCTL_HANDLER_ARGS); +SYSCTL_PROC(_kern_geom_eli, OID_AUTO, minbufs, CTLTYPE_UINT | CTLFLAG_RW | + CTLFLAG_MPSAFE, NULL, 0, sysctl_g_eli_minbufs, "IU", + "Number of GELI bufs reserved for swap transactions"); +static struct sx g_eli_umalock; /* Controls changes to UMA zone. */ +SX_SYSINIT(g_eli_umalock, &g_eli_umalock, "GELI UMA"); +static uma_zone_t g_eli_uma = NULL; +static int g_eli_alloc_sz; +static volatile int g_eli_umaoutstanding; +static volatile int g_eli_devs; +static bool g_eli_blocking_malloc = false; +SYSCTL_BOOL(_kern_geom_eli, OID_AUTO, blocking_malloc, CTLFLAG_RWTUN, + &g_eli_blocking_malloc, 0, "Use blocking malloc calls for GELI buffers"); + +/* + * Control the number of reserved entries in the GELI zone. + * If the GELI zone has already been allocated, update the zone. Otherwise, + * simply update the variable for use the next time the zone is created. + */ +static int +sysctl_g_eli_minbufs(SYSCTL_HANDLER_ARGS) +{ + int error; + u_int new; + + new = g_eli_minbufs; + error = sysctl_handle_int(oidp, &new, 0, req); + if (error != 0 || req->newptr == NULL) + return (error); + sx_xlock(&g_eli_umalock); + if (g_eli_uma != NULL) { + if (new != g_eli_minbufs) + uma_zone_reserve(g_eli_uma, new); + if (new > g_eli_minbufs) + uma_prealloc(g_eli_uma, new - g_eli_minbufs); + } + if (new != g_eli_minbufs) + g_eli_minbufs = new; + sx_xunlock(&g_eli_umalock); + return (0); +} /* * Passphrase cached during boot, in order to be more user-friendly if @@ -201,10 +245,11 @@ g_eli_crypto_rerun(struct cryptop *crp) bp = (struct bio *)crp->crp_opaque; sc = bp->bio_to->geom->softc; LIST_FOREACH(wr, &sc->sc_workers, w_next) { - if (wr->w_number == bp->bio_pflags) + if (wr->w_number == G_ELI_WORKER(bp->bio_pflags)) break; } - KASSERT(wr != NULL, ("Invalid worker (%u).", bp->bio_pflags)); + KASSERT(wr != NULL, ("Invalid worker (%u).", + G_ELI_WORKER(bp->bio_pflags))); G_ELI_DEBUG(1, "Rerunning crypto %s request (sid: %p -> %p).", bp->bio_cmd == BIO_READ ? "READ" : "WRITE", wr->w_sid, crp->crp_session); @@ -255,10 +300,7 @@ g_eli_read_done(struct bio *bp) G_ELI_LOGREQ(0, pbp, "%s() failed (error=%d)", __func__, pbp->bio_error); pbp->bio_completed = 0; - if (pbp->bio_driver2 != NULL) { - free(pbp->bio_driver2, M_ELI); - pbp->bio_driver2 = NULL; - } + g_eli_free_data(pbp); g_io_deliver(pbp, pbp->bio_error); if (sc != NULL) atomic_subtract_int(&sc->sc_inflight, 1); @@ -292,8 +334,8 @@ g_eli_write_done(struct bio *bp) pbp->bio_inbed++; if (pbp->bio_inbed < pbp->bio_children) return; - free(pbp->bio_driver2, M_ELI); - pbp->bio_driver2 = NULL; + sc = pbp->bio_to->geom->softc; + g_eli_free_data(pbp); if (pbp->bio_error != 0) { G_ELI_LOGREQ(0, pbp, "%s() failed (error=%d)", __func__, pbp->bio_error); @@ -304,7 +346,6 @@ g_eli_write_done(struct bio *bp) /* * Write is finished, send it up. */ - sc = pbp->bio_to->geom->softc; g_io_deliver(pbp, pbp->bio_error); if (sc != NULL) atomic_subtract_int(&sc->sc_inflight, 1); @@ -451,7 +492,8 @@ g_eli_start(struct bio *bp) return; } bp->bio_driver1 = cbp; - bp->bio_pflags = G_ELI_NEW_BIO; + bp->bio_pflags = 0; + G_ELI_SET_NEW_BIO(bp->bio_pflags); switch (bp->bio_cmd) { case BIO_READ: if (!(sc->sc_flags & G_ELI_FLAG_AUTH)) { @@ -576,7 +618,7 @@ g_eli_cancel(struct g_eli_softc *sc) mtx_assert(&sc->sc_queue_mtx, MA_OWNED); while ((bp = bioq_takefirst(&sc->sc_queue)) != NULL) { - KASSERT(bp->bio_pflags == G_ELI_NEW_BIO, + KASSERT(G_ELI_IS_NEW_BIO(bp->bio_pflags), ("Not new bio when canceling (bp=%p).", bp)); g_io_deliver(bp, ENXIO); } @@ -595,7 +637,7 @@ g_eli_takefirst(struct g_eli_softc *sc) * Device suspended, so we skip new I/O requests. */ TAILQ_FOREACH(bp, &sc->sc_queue.queue, bio_queue) { - if (bp->bio_pflags != G_ELI_NEW_BIO) + if (!G_ELI_IS_NEW_BIO(bp->bio_pflags)) break; } if (bp != NULL) @@ -688,11 +730,11 @@ again: msleep(sc, &sc->sc_queue_mtx, PDROP, "geli:w", 0); continue; } - if (bp->bio_pflags == G_ELI_NEW_BIO) + if (G_ELI_IS_NEW_BIO(bp->bio_pflags)) atomic_add_int(&sc->sc_inflight, 1); mtx_unlock(&sc->sc_queue_mtx); - if (bp->bio_pflags == G_ELI_NEW_BIO) { - bp->bio_pflags = 0; + if (G_ELI_IS_NEW_BIO(bp->bio_pflags)) { + G_ELI_SETWORKER(bp->bio_pflags, 0); if (sc->sc_flags & G_ELI_FLAG_AUTH) { if (bp->bio_cmd == BIO_READ) g_eli_auth_read(sc, bp); @@ -835,6 +877,132 @@ g_eli_cpu_is_disabled(int cpu) #endif } +static void +g_eli_init_uma(void) +{ + + atomic_add_int(&g_eli_devs, 1); + sx_xlock(&g_eli_umalock); + if (g_eli_uma == NULL) { + /* + * Calculate the maximum-sized swap buffer we are + * likely to see. + */ + g_eli_alloc_sz = roundup2((PAGE_SIZE + sizeof(int) + + G_ELI_AUTH_SECKEYLEN) * nsw_cluster_max + + sizeof(uintptr_t), PAGE_SIZE); + + /* + * Create the zone, setting UMA_ZONE_NOFREE so we won't + * drain the zone in a memory shortage. + */ + g_eli_uma = uma_zcreate("GELI buffers", g_eli_alloc_sz, + NULL, NULL, NULL, NULL, + UMA_ALIGN_PTR, UMA_ZONE_NOFREE); + + /* Reserve and pre-allocate pages, as appropriate. */ + uma_zone_reserve(g_eli_uma, g_eli_minbufs); + uma_prealloc(g_eli_uma, g_eli_minbufs); + } + sx_xunlock(&g_eli_umalock); +} + +/* + * Try to destroy the UMA pool. This will do nothing if there are existing + * GELI devices or existing UMA allocations. + */ +static void +g_eli_destroy_uma(void) +{ + uma_zone_t oldzone; + + sx_xlock(&g_eli_umalock); + /* Ensure we really should be destroying this. */ + if (atomic_load_int(&g_eli_devs) == 0 && + atomic_load_int(&g_eli_umaoutstanding) == 0) { + oldzone = g_eli_uma; + g_eli_uma = NULL; + } else + oldzone = NULL; + sx_xunlock(&g_eli_umalock); + + if (oldzone != NULL) + uma_zdestroy(oldzone); +} + +static void +g_eli_fini_uma(void) +{ + + /* + * If this is the last outstanding GELI device, try to + * destroy the UMA pool. + */ + if (atomic_fetchadd_int(&g_eli_devs, -1) == 1) + g_eli_destroy_uma(); +} + +/* + * Allocate a data buffer. If the size fits within our swap-sized buffers, + * try to allocate a swap-sized buffer from the UMA pool. Otherwise, fall + * back to using malloc. + * + * Swap-related requests are special: they can only use the UMA pool, they + * use M_USE_RESERVE to let them dip farther into system resources, and + * they always use M_NOWAIT to prevent swap operations from deadlocking. + */ +bool +g_eli_alloc_data(struct bio *bp, int sz) +{ + + KASSERT(sz <= g_eli_alloc_sz || (bp->bio_flags & BIO_SWAP) == 0, + ("BIO_SWAP request for %d bytes exceeds the precalculated buffer" + " size (%d)", sz, g_eli_alloc_sz)); + if (sz <= g_eli_alloc_sz) { + bp->bio_driver2 = uma_zalloc(g_eli_uma, M_NOWAIT | + ((bp->bio_flags & BIO_SWAP) != 0 ? M_USE_RESERVE : 0)); + if (bp->bio_driver2 != NULL) { + bp->bio_pflags |= G_ELI_UMA_ALLOC; + atomic_add_int(&g_eli_umaoutstanding, 1); + } + if (bp->bio_driver2 != NULL || (bp->bio_flags & BIO_SWAP) != 0) + return (bp->bio_driver2 != NULL); + } + bp->bio_pflags &= ~(G_ELI_UMA_ALLOC); + bp->bio_driver2 = malloc(sz, M_ELI, g_eli_blocking_malloc ? M_WAITOK : + M_NOWAIT); + return (bp->bio_driver2 != NULL); +} + +/* + * Free a buffer from bp->bio_driver2 which was allocated with + * g_eli_alloc_data(). This function makes sure that the memory is freed + * to the correct place. + * + * Additionally, if this function frees the last outstanding UMA request + * and there are no open GELI devices, this will destroy the UMA pool. + */ +void +g_eli_free_data(struct bio *bp) +{ + + /* + * Mimic the free(9) behavior of allowing a NULL pointer to be + * freed. + */ + if (bp->bio_driver2 == NULL) + return; + + if ((bp->bio_pflags & G_ELI_UMA_ALLOC) != 0) { + uma_zfree(g_eli_uma, bp->bio_driver2); + if (atomic_fetchadd_int(&g_eli_umaoutstanding, -1) == 1 && + atomic_load_int(&g_eli_devs) == 0) + g_eli_destroy_uma(); + } else + free(bp->bio_driver2, M_ELI); + bp->bio_driver2 = NULL; +} + struct g_geom * g_eli_create(struct gctl_req *req, struct g_class *mp, struct g_provider *bpp, const struct g_eli_metadata *md, const u_char *mkey, int nkey) @@ -927,6 +1095,7 @@ g_eli_create(struct gctl_req *req, struct g_class *mp, struct g_provider *bpp, if (threads == 0) threads = mp_ncpus; sc->sc_cpubind = (mp_ncpus > 1 && threads == mp_ncpus); + g_eli_init_uma(); for (i = 0; i < threads; i++) { if (g_eli_cpu_is_disabled(i)) { G_ELI_DEBUG(1, "%s: CPU %u disabled, skipping.", @@ -1018,6 +1187,7 @@ failed: g_destroy_consumer(cp); g_destroy_geom(gp); g_eli_key_destroy(sc); + g_eli_fini_uma(); zfree(sc, M_ELI); return (NULL); } @@ -1061,6 +1231,7 @@ g_eli_destroy(struct g_eli_softc *sc, boolean_t force) mtx_destroy(&sc->sc_queue_mtx); gp->softc = NULL; g_eli_key_destroy(sc); + g_eli_fini_uma(); zfree(sc, M_ELI); G_ELI_DEBUG(0, "Device %s destroyed.", gp->name); diff --git a/sys/geom/eli/g_eli.h b/sys/geom/eli/g_eli.h index d07afe0c8a61..9cd9f1a7f3e6 100644 --- a/sys/geom/eli/g_eli.h +++ b/sys/geom/eli/g_eli.h @@ -123,7 +123,15 @@ /* Provider uses IV-Key for encryption key generation. */ #define G_ELI_FLAG_ENC_IVKEY 0x00400000 -#define G_ELI_NEW_BIO 255 +/* BIO pflag values. */ +#define G_ELI_WORKER(pflags) ((pflags) & 0xff) +#define G_ELI_MAX_WORKERS 255 +#define G_ELI_NEW_BIO G_ELI_MAX_WORKERS +#define G_ELI_SETWORKER(pflags, w) \ + (pflags) = ((pflags) & 0xff00) | ((w) & 0xff) +#define G_ELI_SET_NEW_BIO(pflags) G_ELI_SETWORKER((pflags), G_ELI_NEW_BIO) +#define G_ELI_IS_NEW_BIO(pflags) (G_ELI_WORKER(pflags) == G_ELI_NEW_BIO) +#define G_ELI_UMA_ALLOC 0x100 /* bio_driver2 alloc came from UMA */ #define SHA512_MDLEN 64 #define G_ELI_AUTH_SECKEYLEN SHA256_DIGEST_LENGTH @@ -692,6 +700,9 @@ void g_eli_read_done(struct bio *bp); void g_eli_write_done(struct bio *bp); int g_eli_crypto_rerun(struct cryptop *crp); +bool g_eli_alloc_data(struct bio *bp, int sz); +void g_eli_free_data(struct bio *bp); + void g_eli_crypto_read(struct g_eli_softc *sc, struct bio *bp, boolean_t fromworker); void g_eli_crypto_run(struct g_eli_worker *wr, struct bio *bp); diff --git a/sys/geom/eli/g_eli_integrity.c b/sys/geom/eli/g_eli_integrity.c index e97924b8df08..17a0912797c1 100644 --- a/sys/geom/eli/g_eli_integrity.c +++ b/sys/geom/eli/g_eli_integrity.c @@ -38,7 +38,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include @@ -104,8 +103,6 @@ __FBSDID("$FreeBSD$"); * g_eli_start -> g_eli_auth_run -> g_eli_auth_write_done -> g_io_request -> g_eli_write_done -> g_io_deliver */ -MALLOC_DECLARE(M_ELI); - /* * Here we generate key for HMAC. Every sector has its own HMAC key, so it is * not possible to copy sectors. @@ -268,8 +265,7 @@ g_eli_auth_read_done(struct cryptop *crp) sc->sc_name, (intmax_t)corsize, (intmax_t)coroff); } } - free(bp->bio_driver2, M_ELI); - bp->bio_driver2 = NULL; + g_eli_free_data(bp); if (bp->bio_error != 0) { if (bp->bio_error != EINTEGRITY) { G_ELI_LOGREQ(0, bp, @@ -326,8 +322,7 @@ g_eli_auth_write_done(struct cryptop *crp) if (bp->bio_error != 0) { G_ELI_LOGREQ(0, bp, "Crypto WRITE request failed (error=%d).", bp->bio_error); - free(bp->bio_driver2, M_ELI); - bp->bio_driver2 = NULL; + g_eli_free_data(bp); cbp = bp->bio_driver1; bp->bio_driver1 = NULL; g_destroy_bio(cbp); @@ -386,7 +381,7 @@ g_eli_auth_read(struct g_eli_softc *sc, struct bio *bp) size_t size; off_t nsec; - bp->bio_pflags = 0; + G_ELI_SETWORKER(bp->bio_pflags, 0); cp = LIST_FIRST(&sc->sc_geom->consumer); cbp = bp->bio_driver1; @@ -404,7 +399,14 @@ g_eli_auth_read(struct g_eli_softc *sc, struct bio *bp) size += sizeof(int) * nsec; size += G_ELI_AUTH_SECKEYLEN * nsec; cbp->bio_offset = (bp->bio_offset / bp->bio_to->sectorsize) * sc->sc_bytes_per_sector; - bp->bio_driver2 = malloc(size, M_ELI, M_WAITOK); + if (!g_eli_alloc_data(bp, size)) { + G_ELI_LOGREQ(0, bp, "Crypto auth read request failed (ENOMEM)"); + g_destroy_bio(cbp); + bp->bio_error = ENOMEM; + g_io_deliver(bp, bp->bio_error); + atomic_subtract_int(&sc->sc_inflight, 1); + return; + } cbp->bio_data = bp->bio_driver2; /* Clear the error array. */ @@ -459,7 +461,7 @@ g_eli_auth_run(struct g_eli_worker *wr, struct bio *bp) G_ELI_LOGREQ(3, bp, "%s", __func__); - bp->bio_pflags = wr->w_number; + G_ELI_SETWORKER(bp->bio_pflags, wr->w_number); sc = wr->w_softc; /* Sectorsize of decrypted provider eg. 4096. */ decr_secsize = bp->bio_to->sectorsize; @@ -487,8 +489,19 @@ g_eli_auth_run(struct g_eli_worker *wr, struct bio *bp) size = encr_secsize * nsec; size += G_ELI_AUTH_SECKEYLEN * nsec; size += sizeof(uintptr_t); /* Space for alignment. */ - data = malloc(size, M_ELI, M_WAITOK); - bp->bio_driver2 = data; + if (!g_eli_alloc_data(bp, size)) { + G_ELI_LOGREQ(0, bp, "Crypto request failed (ENOMEM)"); + if (bp->bio_driver1 != NULL) { + g_destroy_bio(bp->bio_driver1); + bp->bio_driver1 = NULL; + } + bp->bio_error = ENOMEM; + g_io_deliver(bp, bp->bio_error); + if (sc != NULL) + atomic_subtract_int(&sc->sc_inflight, 1); + return; + } + data = bp->bio_driver2; p = data + encr_secsize * nsec; } bp->bio_inbed = 0; diff --git a/sys/geom/eli/g_eli_privacy.c b/sys/geom/eli/g_eli_privacy.c index f4e0416cc828..20a9f09452c5 100644 --- a/sys/geom/eli/g_eli_privacy.c +++ b/sys/geom/eli/g_eli_privacy.c @@ -38,7 +38,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include @@ -60,8 +59,6 @@ __FBSDID("$FreeBSD$"); * g_eli_start -> g_eli_crypto_run -> g_eli_crypto_write_done -> g_io_request -> g_eli_write_done -> g_io_deliver */ -MALLOC_DECLARE(M_ELI); - /* * Copy data from a (potentially unmapped) bio to a kernelspace buffer. * @@ -180,8 +177,7 @@ g_eli_crypto_write_done(struct cryptop *crp) if (bp->bio_error != 0) { G_ELI_LOGREQ(0, bp, "Crypto WRITE request failed (error=%d).", bp->bio_error); - free(bp->bio_driver2, M_ELI); - bp->bio_driver2 = NULL; + g_eli_free_data(bp); g_destroy_bio(cbp); g_io_deliver(bp, bp->bio_error); atomic_subtract_int(&sc->sc_inflight, 1); @@ -235,7 +231,7 @@ g_eli_crypto_read(struct g_eli_softc *sc, struct bio *bp, boolean_t fromworker) atomic_add_int(&sc->sc_inflight, 1); mtx_unlock(&sc->sc_queue_mtx); } - bp->bio_pflags = 0; + G_ELI_SETWORKER(bp->bio_pflags, 0); bp->bio_driver2 = NULL; cbp = bp->bio_driver1; cbp->bio_done = g_eli_read_done; @@ -272,7 +268,7 @@ g_eli_crypto_run(struct g_eli_worker *wr, struct bio *bp) G_ELI_LOGREQ(3, bp, "%s", __func__); - bp->bio_pflags = wr->w_number; + G_ELI_SETWORKER(bp->bio_pflags, wr->w_number); sc = wr->w_softc; secsize = LIST_FIRST(&sc->sc_geom->provider)->sectorsize; nsec = bp->bio_length / secsize; @@ -285,8 +281,19 @@ g_eli_crypto_run(struct g_eli_worker *wr, struct bio *bp) * so we need to allocate more memory for encrypted data. */ if (bp->bio_cmd == BIO_WRITE) { - data = malloc(bp->bio_length, M_ELI, M_WAITOK); - bp->bio_driver2 = data; + if (!g_eli_alloc_data(bp, bp->bio_length)) { + G_ELI_LOGREQ(0, bp, "Crypto request failed (ENOMEM)."); + if (bp->bio_driver1 != NULL) { + g_destroy_bio(bp->bio_driver1); + bp->bio_driver1 = NULL; + } + bp->bio_error = ENOMEM; + g_io_deliver(bp, bp->bio_error); + if (sc != NULL) + atomic_subtract_int(&sc->sc_inflight, 1); + return; + } + data = bp->bio_driver2; /* * This copy could be eliminated by using crypto's output * buffer, instead of using a single overwriting buffer. From owner-dev-commits-src-main@freebsd.org Tue Sep 28 18:26:43 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 29C996A9EA4 for ; Tue, 28 Sep 2021 18:26:43 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound2q.ore.mailhop.org (outbound2q.ore.mailhop.org [54.187.71.48]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4HJnyp6HRYz4dWL for ; Tue, 28 Sep 2021 18:26:42 +0000 (UTC) (envelope-from ian@freebsd.org) ARC-Seal: i=1; a=rsa-sha256; t=1632853597; cv=none; d=outbound.mailhop.org; s=arc-outbound20181012; b=A5DON/AdjioqS1MaqwORD23RSVMNlhWGIFEqosy9o63ATj0LH3MI6fJq2gRss2cP/LM8S8fLIbCDu EX7wOzxtiiBGhuxGZCFlYVKca4jZ1GCGjC/bBWvXIY2kEIZKl7+7b1IcgSYYCROt7fYd8aikFLOXip V3PKhvCbWAUQ2rQ90yMfi0/e6llIq9i8ZHJqFuTwJhny3ylcOBFbzTPLIFmWQTmffT9g1eS8kT9K/p NgQMKITzTKS32fG8sFbPzWxlu+y43cCdv31jz7gSdUQGCxYdegp9XOuvXmx2qMwMhFtd0yxfNvd9wt D9AlUvU37eRpuwovULQxbDwbeu3+2JA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=arc-outbound20181012; h=content-transfer-encoding:mime-version:content-type:references:in-reply-to: date:to:from:subject:message-id:dkim-signature:from; bh=RFCP72QPozr/dk+wlrf2/WkNKGVuksuiTywTg90G/iE=; b=OaLTM8KKqtIJiEbb71NIP2hiHsgvzgzxFWAyZg5WLTs+8BdjqhnScINxls9qkceGyBvMj1yf0eKx0 55CvZ1C20IzJAqgGGQmEWeJ1MPQS/sWiF76K6GgD5LhMaF3FLj9K7eLgWFraqbmZK6WAytTOGd3I3z JpaBUIsZg2bSOloiw74D30A/iQple14y/yrsS6YFGx37SawOii+u/InEsX2VGB442ENteIa5DsObRZ AfkWQAuttnZTgySLTY0F3C6oaDp85JquYeUE4717vubmfKfJnhxOYjM0uWAnt4eI7FAlCOrs2BEAkp NMzYokjGlTrk25ef7O+qlU4JXKLeSMg== ARC-Authentication-Results: i=1; outbound4.ore.mailhop.org; spf=softfail smtp.mailfrom=freebsd.org smtp.remote-ip=24.8.225.114; dmarc=none header.from=freebsd.org; arc=none header.oldest-pass=0; DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=dkim-high; h=content-transfer-encoding:mime-version:content-type:references:in-reply-to: date:to:from:subject:message-id:from; bh=RFCP72QPozr/dk+wlrf2/WkNKGVuksuiTywTg90G/iE=; b=HuTgb5e9TIk9zzxnnlYd1yxQpWui55osWufCUM/ky8iCdnqxy0Fkl5FUjVkK1TLoiJeHE2XaLCUij 23SCjpHviXd2Ag40Xap8r14b/8j6i2lrNLv6wN24QJTUxtLEDzY4hPVExQVar/SA9KteRPsOfLVJoA d8InKtMwWsLPb6BrSFHXLT4+AJNkHUkClVEnyCaUfKP/rmUtkUvktVg/NmYmyiKynQejdKOpQPykGn zEztJn/2MSfPTOQINK1WiHSOpLBJylI6LtK+sj87Qvb6cz8QJgUmPC8Od+H6pJDCzsotM75uDwZpQr oI17X+ljTA5SPkvKgZZVu23pn9gwNyA== X-Originating-IP: 24.8.225.114 X-MHO-RoutePath: aGlwcGll X-MHO-User: 9ca60ecf-2089-11ec-a67c-89389772cfc7 X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (c-24-8-225-114.hsd1.co.comcast.net [24.8.225.114]) by outbound4.ore.mailhop.org (Halon) with ESMTPSA id 9ca60ecf-2089-11ec-a67c-89389772cfc7; Tue, 28 Sep 2021 18:26:35 +0000 (UTC) Received: from [172.22.42.84] (rev2.hippie.lan [172.22.42.84]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id 18SIQYkF082693; Tue, 28 Sep 2021 12:26:34 -0600 (MDT) (envelope-from ian@freebsd.org) X-Authentication-Warning: paranoia.hippie.lan: Host rev2.hippie.lan [172.22.42.84] claimed to be [172.22.42.84] Message-ID: <60e58628fbc1a5d141b360aa1d3651532024ba82.camel@freebsd.org> Subject: Re: git: c6213beff4f5 - main - Add flag BIO_SWAP to mark IOs that are associated with swap. From: Ian Lepore To: Gleb Smirnoff , src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Date: Tue, 28 Sep 2021 12:26:34 -0600 In-Reply-To: <202109281824.18SIO61S055973@gitrepo.freebsd.org> References: <202109281824.18SIO61S055973@gitrepo.freebsd.org> Content-Type: text/plain; charset="ISO-8859-1" User-Agent: Evolution 3.40.3 FreeBSD GNOME Team MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4HJnyp6HRYz4dWL X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Sep 2021 18:26:43 -0000 On Tue, 2021-09-28 at 18:24 +0000, Gleb Smirnoff wrote: > The branch main has been updated by glebius: > > URL: > https://cgit.FreeBSD.org/src/commit/?id=c6213beff4f51d6c9cc4e41682538d203249359e > > commit c6213beff4f51d6c9cc4e41682538d203249359e > Author:     Gleb Smirnoff > AuthorDate: 2021-09-28 18:11:50 +0000 > Commit:     Gleb Smirnoff > CommitDate: 2021-09-28 18:23:51 +0000 > >     Add flag BIO_SWAP to mark IOs that are associated with swap. >     Why? It's not clear from the diff why the new flag was added. -- Ian From owner-dev-commits-src-main@freebsd.org Tue Sep 28 18:28:20 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8C31F6A9DF9; Tue, 28 Sep 2021 18:28:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HJp0h3YCVz4dWh; Tue, 28 Sep 2021 18:28:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 599ED1681; Tue, 28 Sep 2021 18:28:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18SISKw5056426; Tue, 28 Sep 2021 18:28:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18SISKLj056425; Tue, 28 Sep 2021 18:28:20 GMT (envelope-from git) Date: Tue, 28 Sep 2021 18:28:20 GMT Message-Id: <202109281828.18SISKLj056425@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Li-Wen Hsu Subject: git: 38dac71d0a95 - main - Fix typo MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: lwhsu X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 38dac71d0a95ab2cf2cdfa1232cc556008b7ac94 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Sep 2021 18:28:20 -0000 The branch main has been updated by lwhsu: URL: https://cgit.FreeBSD.org/src/commit/?id=38dac71d0a95ab2cf2cdfa1232cc556008b7ac94 commit 38dac71d0a95ab2cf2cdfa1232cc556008b7ac94 Author: Li-Wen Hsu AuthorDate: 2021-09-28 18:28:01 +0000 Commit: Li-Wen Hsu CommitDate: 2021-09-28 18:28:01 +0000 Fix typo Reported by: swills Sponsored by: The FreeBSD Foundation --- tests/sys/geom/class/multipath/failloop.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/sys/geom/class/multipath/failloop.sh b/tests/sys/geom/class/multipath/failloop.sh index b089f0f53d11..632458e1f0b1 100755 --- a/tests/sys/geom/class/multipath/failloop.sh +++ b/tests/sys/geom/class/multipath/failloop.sh @@ -64,7 +64,7 @@ failloop_body() atf_check_equal 1 $dd_status # and triggered 1 or 2 path restores if [ ! -f restore_count ]; then - atf_fail "dtrace didn't execute succfully" + atf_fail "dtrace didn't execute successfully" fi if [ `cat restore_count` -gt 2 ]; then atf_fail "gmultipath restored paths too many times" From owner-dev-commits-src-main@freebsd.org Tue Sep 28 18:31:19 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 52DDA6AA213; Tue, 28 Sep 2021 18:31:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HJp471whvz4dwG; Tue, 28 Sep 2021 18:31:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 21FE2FEF; Tue, 28 Sep 2021 18:31:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18SIVJgt065689; Tue, 28 Sep 2021 18:31:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18SIVJTr065688; Tue, 28 Sep 2021 18:31:19 GMT (envelope-from git) Date: Tue, 28 Sep 2021 18:31:19 GMT Message-Id: <202109281831.18SIVJTr065688@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Michael Tuexen Subject: git: fa947a3687b9 - main - sctp: cleanup and adding KASSERT()s, no functional change MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: fa947a3687b98b387de55a33154fce7d6e3dffa3 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Sep 2021 18:31:19 -0000 The branch main has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=fa947a3687b98b387de55a33154fce7d6e3dffa3 commit fa947a3687b98b387de55a33154fce7d6e3dffa3 Author: Michael Tuexen AuthorDate: 2021-09-28 18:29:43 +0000 Commit: Michael Tuexen CommitDate: 2021-09-28 18:31:12 +0000 sctp: cleanup and adding KASSERT()s, no functional change MFC after: 1 week --- sys/netinet/sctp_ss_functions.c | 55 ++++++++++++++++++++++++++++++----------- 1 file changed, 41 insertions(+), 14 deletions(-) diff --git a/sys/netinet/sctp_ss_functions.c b/sys/netinet/sctp_ss_functions.c index ff108eb0eb33..fe4b96cf00ab 100644 --- a/sys/netinet/sctp_ss_functions.c +++ b/sys/netinet/sctp_ss_functions.c @@ -63,9 +63,9 @@ sctp_ss_default_init(struct sctp_tcb *stcb, struct sctp_association *asoc) * an existing association has been changed. We need to add all * stream queues to the wheel. */ - for (i = 0; i < stcb->asoc.streamoutcnt; i++) { - stcb->asoc.ss_functions.sctp_ss_add_to_stream(stcb, &stcb->asoc, - &stcb->asoc.strmout[i], + for (i = 0; i < asoc->streamoutcnt; i++) { + stcb->asoc.ss_functions.sctp_ss_add_to_stream(stcb, asoc, + &asoc->strmout[i], NULL); } return; @@ -81,6 +81,7 @@ sctp_ss_default_clear(struct sctp_tcb *stcb, struct sctp_association *asoc, struct sctp_stream_out *strq; strq = TAILQ_FIRST(&asoc->ss_data.out.wheel); + KASSERT(strq->ss_params.scheduled, ("strq %p not scheduled", (void *)strq)); TAILQ_REMOVE(&asoc->ss_data.out.wheel, strq, ss_params.ss.rr.next_spoke); strq->ss_params.scheduled = false; } @@ -162,6 +163,9 @@ sctp_ss_default_select(struct sctp_tcb *stcb SCTP_UNUSED, struct sctp_nets *net, struct sctp_stream_out *strq, *strqt; if (asoc->ss_data.locked_on_sending) { + KASSERT(asoc->ss_data.locked_on_sending->ss_params.scheduled, + ("strq %p not scheduled", + (void *)asoc->ss_data.locked_on_sending)); return (asoc->ss_data.locked_on_sending); } strqt = asoc->ss_data.last_out_stream; @@ -170,11 +174,15 @@ default_again: if (strqt == NULL) { strq = TAILQ_FIRST(&asoc->ss_data.out.wheel); } else { + KASSERT(strqt->ss_params.scheduled, + ("strq %p not scheduled", (void *)strqt)); strq = TAILQ_NEXT(strqt, ss_params.ss.rr.next_spoke); if (strq == NULL) { strq = TAILQ_FIRST(&asoc->ss_data.out.wheel); } } + KASSERT(strq == NULL || strq->ss_params.scheduled, + ("strq %p not scheduled", (void *)strq)); /* * If CMT is off, we must validate that the stream in question has @@ -210,16 +218,18 @@ sctp_ss_default_scheduled(struct sctp_tcb *stcb, { struct sctp_stream_queue_pending *sp; + KASSERT(strq != NULL, ("strq is NULL")); + KASSERT(strq->ss_params.scheduled, ("strq %p is not scheduled", (void *)strq)); asoc->ss_data.last_out_stream = strq; - if (stcb->asoc.idata_supported == 0) { + if (asoc->idata_supported == 0) { sp = TAILQ_FIRST(&strq->outqueue); if ((sp != NULL) && (sp->some_taken == 1)) { - stcb->asoc.ss_data.locked_on_sending = strq; + asoc->ss_data.locked_on_sending = strq; } else { - stcb->asoc.ss_data.locked_on_sending = NULL; + asoc->ss_data.locked_on_sending = NULL; } } else { - stcb->asoc.ss_data.locked_on_sending = NULL; + asoc->ss_data.locked_on_sending = NULL; } return; } @@ -324,11 +334,15 @@ rrp_again: if (strqt == NULL) { strq = TAILQ_FIRST(&asoc->ss_data.out.wheel); } else { + KASSERT(strqt->ss_params.scheduled, + ("strq %p not scheduled", (void *)strqt)); strq = TAILQ_NEXT(strqt, ss_params.ss.rr.next_spoke); if (strq == NULL) { strq = TAILQ_FIRST(&asoc->ss_data.out.wheel); } } + KASSERT(strq == NULL || strq->ss_params.scheduled, + ("strq %p not scheduled", (void *)strq)); /* * If CMT is off, we must validate that the stream in question has @@ -370,6 +384,7 @@ sctp_ss_prio_clear(struct sctp_tcb *stcb, struct sctp_association *asoc, struct sctp_stream_out *strq; strq = TAILQ_FIRST(&asoc->ss_data.out.wheel); + KASSERT(strq->ss_params.scheduled, ("strq %p not scheduled", (void *)strq)); if (clear_values) { strq->ss_params.ss.prio.priority = 0; } @@ -464,6 +479,9 @@ sctp_ss_prio_select(struct sctp_tcb *stcb SCTP_UNUSED, struct sctp_nets *net, struct sctp_stream_out *strq, *strqt, *strqn; if (asoc->ss_data.locked_on_sending) { + KASSERT(asoc->ss_data.locked_on_sending->ss_params.scheduled, + ("strq %p not scheduled", + (void *)asoc->ss_data.locked_on_sending)); return (asoc->ss_data.locked_on_sending); } strqt = asoc->ss_data.last_out_stream; @@ -472,6 +490,8 @@ prio_again: if (strqt == NULL) { strq = TAILQ_FIRST(&asoc->ss_data.out.wheel); } else { + KASSERT(strqt->ss_params.scheduled, + ("strq %p not scheduled", (void *)strqt)); strqn = TAILQ_NEXT(strqt, ss_params.ss.prio.next_spoke); if (strqn != NULL && strqn->ss_params.ss.prio.priority == strqt->ss_params.ss.prio.priority) { @@ -480,6 +500,8 @@ prio_again: strq = TAILQ_FIRST(&asoc->ss_data.out.wheel); } } + KASSERT(strq == NULL || strq->ss_params.scheduled, + ("strq %p not scheduled", (void *)strq)); /* * If CMT is off, we must validate that the stream in question has @@ -544,6 +566,7 @@ sctp_ss_fb_clear(struct sctp_tcb *stcb, struct sctp_association *asoc, struct sctp_stream_out *strq; strq = TAILQ_FIRST(&asoc->ss_data.out.wheel); + KASSERT(strq->ss_params.scheduled, ("strq %p not scheduled", (void *)strq)); if (clear_values) { strq->ss_params.ss.fb.rounds = -1; } @@ -625,6 +648,9 @@ sctp_ss_fb_select(struct sctp_tcb *stcb SCTP_UNUSED, struct sctp_nets *net, struct sctp_stream_out *strq = NULL, *strqt; if (asoc->ss_data.locked_on_sending) { + KASSERT(asoc->ss_data.locked_on_sending->ss_params.scheduled, + ("strq %p not scheduled", + (void *)asoc->ss_data.locked_on_sending)); return (asoc->ss_data.locked_on_sending); } if (asoc->ss_data.last_out_stream == NULL || @@ -664,15 +690,15 @@ sctp_ss_fb_scheduled(struct sctp_tcb *stcb, struct sctp_nets *net SCTP_UNUSED, struct sctp_stream_out *strqt; int subtract; - if (stcb->asoc.idata_supported == 0) { + if (asoc->idata_supported == 0) { sp = TAILQ_FIRST(&strq->outqueue); if ((sp != NULL) && (sp->some_taken == 1)) { - stcb->asoc.ss_data.locked_on_sending = strq; + asoc->ss_data.locked_on_sending = strq; } else { - stcb->asoc.ss_data.locked_on_sending = NULL; + asoc->ss_data.locked_on_sending = NULL; } } else { - stcb->asoc.ss_data.locked_on_sending = NULL; + asoc->ss_data.locked_on_sending = NULL; } subtract = strq->ss_params.ss.fb.rounds; TAILQ_FOREACH(strqt, &asoc->ss_data.out.wheel, ss_params.ss.fb.next_spoke) { @@ -715,8 +741,8 @@ sctp_ss_fcfs_init(struct sctp_tcb *stcb, struct sctp_association *asoc) */ while (add_more) { add_more = 0; - for (i = 0; i < stcb->asoc.streamoutcnt; i++) { - sp = TAILQ_FIRST(&stcb->asoc.strmout[i].outqueue); + for (i = 0; i < asoc->streamoutcnt; i++) { + sp = TAILQ_FIRST(&asoc->strmout[i].outqueue); x = 0; /* Find n. message in current stream queue */ while (sp != NULL && x < n) { @@ -724,7 +750,7 @@ sctp_ss_fcfs_init(struct sctp_tcb *stcb, struct sctp_association *asoc) x++; } if (sp != NULL) { - sctp_ss_fcfs_add(stcb, &stcb->asoc, &stcb->asoc.strmout[i], sp); + sctp_ss_fcfs_add(stcb, asoc, &asoc->strmout[i], sp); add_more = 1; } } @@ -743,6 +769,7 @@ sctp_ss_fcfs_clear(struct sctp_tcb *stcb, struct sctp_association *asoc, while (!TAILQ_EMPTY(&asoc->ss_data.out.list)) { sp = TAILQ_FIRST(&asoc->ss_data.out.list); + KASSERT(sp->scheduled, ("sp %p not scheduled", (void *)sp)); TAILQ_REMOVE(&asoc->ss_data.out.list, sp, ss_next); sp->scheduled = false; } From owner-dev-commits-src-main@freebsd.org Tue Sep 28 18:38:42 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id EC4756AA2E1; Tue, 28 Sep 2021 18:38:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HJpDf6PNwz4fHR; Tue, 28 Sep 2021 18:38:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BB8F3163E; Tue, 28 Sep 2021 18:38:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18SIcgEv070316; Tue, 28 Sep 2021 18:38:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18SIcgnf070315; Tue, 28 Sep 2021 18:38:42 GMT (envelope-from git) Date: Tue, 28 Sep 2021 18:38:42 GMT Message-Id: <202109281838.18SIcgnf070315@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Li-Wen Hsu Subject: git: b9b5a4dd590e - main - gmultipath failloop test: Put the dtrace sanity checker in right place MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: lwhsu X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b9b5a4dd590e1b30d92dc73b3d1f22d3303e7e41 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Sep 2021 18:38:43 -0000 The branch main has been updated by lwhsu: URL: https://cgit.FreeBSD.org/src/commit/?id=b9b5a4dd590e1b30d92dc73b3d1f22d3303e7e41 commit b9b5a4dd590e1b30d92dc73b3d1f22d3303e7e41 Author: Li-Wen Hsu AuthorDate: 2021-09-28 18:38:34 +0000 Commit: Li-Wen Hsu CommitDate: 2021-09-28 18:38:34 +0000 gmultipath failloop test: Put the dtrace sanity checker in right place Check if dtrace excution is successful or not right after execution. Sponsored by: The FreeBSD Foundation --- tests/sys/geom/class/multipath/failloop.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/sys/geom/class/multipath/failloop.sh b/tests/sys/geom/class/multipath/failloop.sh index 632458e1f0b1..48006d6b10da 100755 --- a/tests/sys/geom/class/multipath/failloop.sh +++ b/tests/sys/geom/class/multipath/failloop.sh @@ -60,12 +60,12 @@ failloop_body() -i 'geom:multipath:config:restore {@restore = count()}' \ -c "dd if=/dev/zero of=/dev/multipath/"$name" bs=4096 count=1" \ 2>&1 | awk '/exited with status/ {print $NF}'` - # The dd command should've failed ... - atf_check_equal 1 $dd_status - # and triggered 1 or 2 path restores if [ ! -f restore_count ]; then atf_fail "dtrace didn't execute successfully" fi + # The dd command should've failed ... + atf_check_equal 1 $dd_status + # and triggered 1 or 2 path restores if [ `cat restore_count` -gt 2 ]; then atf_fail "gmultipath restored paths too many times" fi From owner-dev-commits-src-main@freebsd.org Tue Sep 28 18:38:52 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E58776A9EFC; Tue, 28 Sep 2021 18:38:52 +0000 (UTC) (envelope-from glebius@freebsd.org) Received: from cell.glebi.us (glebi.us [162.251.186.162]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "cell.glebi.us", Issuer "cell.glebi.us" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HJpDr4kXQz4f1f; Tue, 28 Sep 2021 18:38:52 +0000 (UTC) (envelope-from glebius@freebsd.org) Received: from cell.glebi.us (localhost [127.0.0.1]) by cell.glebi.us (8.16.1/8.16.1) with ESMTPS id 18SIcjt3024741 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Tue, 28 Sep 2021 11:38:45 -0700 (PDT) (envelope-from glebius@freebsd.org) Received: (from glebius@localhost) by cell.glebi.us (8.16.1/8.16.1/Submit) id 18SIciwB024740; Tue, 28 Sep 2021 11:38:44 -0700 (PDT) (envelope-from glebius@freebsd.org) X-Authentication-Warning: cell.glebi.us: glebius set sender to glebius@freebsd.org using -f Date: Tue, 28 Sep 2021 11:38:44 -0700 From: Gleb Smirnoff To: Ian Lepore Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: c6213beff4f5 - main - Add flag BIO_SWAP to mark IOs that are associated with swap. Message-ID: References: <202109281824.18SIO61S055973@gitrepo.freebsd.org> <60e58628fbc1a5d141b360aa1d3651532024ba82.camel@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <60e58628fbc1a5d141b360aa1d3651532024ba82.camel@freebsd.org> X-Rspamd-Queue-Id: 4HJpDr4kXQz4f1f X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Sep 2021 18:38:53 -0000 Ian, On Tue, Sep 28, 2021 at 12:26:34PM -0600, Ian Lepore wrote: I> > URL: I> > https://cgit.FreeBSD.org/src/commit/?id=c6213beff4f51d6c9cc4e41682538d203249359e I> > I> > commit c6213beff4f51d6c9cc4e41682538d203249359e I> > Author:     Gleb Smirnoff I> > AuthorDate: 2021-09-28 18:11:50 +0000 I> > Commit:     Gleb Smirnoff I> > CommitDate: 2021-09-28 18:23:51 +0000 I> > I> >     Add flag BIO_SWAP to mark IOs that are associated with swap. I> >     I> I> Why? It's not clear from the diff why the new flag was added. Next couple commits that were pushed same second use it. -- Gleb Smirnoff From owner-dev-commits-src-main@freebsd.org Tue Sep 28 19:11:31 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4D0796AABB2; Tue, 28 Sep 2021 19:11:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HJpyW1g8Dz4jZn; Tue, 28 Sep 2021 19:11:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 193C71D98; Tue, 28 Sep 2021 19:11:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18SJBVbT019389; Tue, 28 Sep 2021 19:11:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18SJBV3r019388; Tue, 28 Sep 2021 19:11:31 GMT (envelope-from git) Date: Tue, 28 Sep 2021 19:11:31 GMT Message-Id: <202109281911.18SJBV3r019388@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ed Maste Subject: git: c83ae596f3c2 - main - mgb: Staticize devclass and iflib structs (as is typical) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c83ae596f3c2ce8c4ef2bacfb63100aaf8d48bb7 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Sep 2021 19:11:31 -0000 The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=c83ae596f3c2ce8c4ef2bacfb63100aaf8d48bb7 commit c83ae596f3c2ce8c4ef2bacfb63100aaf8d48bb7 Author: Ed Maste AuthorDate: 2021-09-28 18:12:58 +0000 Commit: Ed Maste CommitDate: 2021-09-28 19:11:01 +0000 mgb: Staticize devclass and iflib structs (as is typical) MFC after: 1 week Fixes: 8890ab7758b8 ("Introduce if_mgb driver...") Sponsored by: The FreeBSD Foundation --- sys/dev/mgb/if_mgb.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/dev/mgb/if_mgb.c b/sys/dev/mgb/if_mgb.c index de4f78e0fd57..9515d0d5d788 100644 --- a/sys/dev/mgb/if_mgb.c +++ b/sys/dev/mgb/if_mgb.c @@ -206,7 +206,7 @@ static driver_t mgb_driver = { "mgb", mgb_methods, sizeof(struct mgb_softc) }; -devclass_t mgb_devclass; +static devclass_t mgb_devclass; DRIVER_MODULE(mgb, pci, mgb_driver, mgb_devclass, NULL, NULL); IFLIB_PNP_INFO(pci, mgb, mgb_vendor_info_array); MODULE_VERSION(mgb, 1); @@ -270,7 +270,7 @@ static driver_t mgb_iflib_driver = { "mgb", mgb_iflib_methods, sizeof(struct mgb_softc) }; -struct if_txrx mgb_txrx = { +static struct if_txrx mgb_txrx = { .ift_txd_encap = mgb_isc_txd_encap, .ift_txd_flush = mgb_isc_txd_flush, .ift_txd_credits_update = mgb_isc_txd_credits_update, @@ -282,7 +282,7 @@ struct if_txrx mgb_txrx = { .ift_legacy_intr = mgb_legacy_intr }; -struct if_shared_ctx mgb_sctx_init = { +static struct if_shared_ctx mgb_sctx_init = { .isc_magic = IFLIB_MAGIC, .isc_q_align = PAGE_SIZE, From owner-dev-commits-src-main@freebsd.org Tue Sep 28 19:31:43 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8E9966AADBD; Tue, 28 Sep 2021 19:31:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HJqPq3YZfz4kfk; Tue, 28 Sep 2021 19:31:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5A9D623EB; Tue, 28 Sep 2021 19:31:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18SJVhaS047436; Tue, 28 Sep 2021 19:31:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18SJVhel047435; Tue, 28 Sep 2021 19:31:43 GMT (envelope-from git) Date: Tue, 28 Sep 2021 19:31:43 GMT Message-Id: <202109281931.18SJVhel047435@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ian Lepore Subject: git: dc91a9715f8f - main - Fix busdma resource leak on usb device detach. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ian X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: dc91a9715f8fda4b3633388830a28a99f73cbe59 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Sep 2021 19:31:43 -0000 The branch main has been updated by ian: URL: https://cgit.FreeBSD.org/src/commit/?id=dc91a9715f8fda4b3633388830a28a99f73cbe59 commit dc91a9715f8fda4b3633388830a28a99f73cbe59 Author: Ian Lepore AuthorDate: 2021-09-28 19:29:10 +0000 Commit: Ian Lepore CommitDate: 2021-09-28 19:29:10 +0000 Fix busdma resource leak on usb device detach. When a usb device is detached, usb_pc_dmamap_destroy() called bus_dmamap_destroy() while the map was still loaded. That's harmless on x86 architectures, but on all other platforms it causes bus_dmamap_destroy() to return EBUSY and leak away any memory resources (including bounce buffers) associated with the mapping, as well as any allocated map structure itself. This change introduces a new is_loaded flag to the usb_page_cache struct to track whether a map is loaded or not. If the map is loaded, bus_dmamap_unload() is called before bus_dmamap_destroy() to avoid leaking away resources. MFC after: 7 days Differential Revision: https://reviews.freebsd.org/D32208 --- sys/dev/usb/usb_busdma.c | 16 +++++++++++++--- sys/dev/usb/usb_busdma.h | 1 + 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/sys/dev/usb/usb_busdma.c b/sys/dev/usb/usb_busdma.c index 4806903fa83a..62e22805b39c 100644 --- a/sys/dev/usb/usb_busdma.c +++ b/sys/dev/usb/usb_busdma.c @@ -600,6 +600,7 @@ usb_pc_alloc_mem(struct usb_page_cache *pc, struct usb_page *pg, bus_dmamem_free(utag->tag, ptr, map); goto error; } + pc->isloaded = 1; memset(ptr, 0, size); usb_pc_cpu_flush(pc); @@ -612,6 +613,7 @@ error: pc->page_start = NULL; pc->page_offset_buf = 0; pc->page_offset_end = 0; + pc->isloaded = 0; pc->map = NULL; pc->tag = NULL; return (1); @@ -626,11 +628,13 @@ void usb_pc_free_mem(struct usb_page_cache *pc) { if (pc && pc->buffer) { - bus_dmamap_unload(pc->tag, pc->map); + if (pc->isloaded) + bus_dmamap_unload(pc->tag, pc->map); bus_dmamem_free(pc->tag, pc->buffer, pc->map); pc->buffer = NULL; + pc->isloaded = 0; } } @@ -662,7 +666,8 @@ usb_pc_load_mem(struct usb_page_cache *pc, usb_size_t size, uint8_t sync) * We have to unload the previous loaded DMA * pages before trying to load a new one! */ - bus_dmamap_unload(pc->tag, pc->map); + if (pc->isloaded) + bus_dmamap_unload(pc->tag, pc->map); /* * Try to load memory into DMA. @@ -675,6 +680,7 @@ usb_pc_load_mem(struct usb_page_cache *pc, usb_size_t size, uint8_t sync) err = 0; } if (err || uptag->dma_error) { + pc->isloaded = 0; return (1); } } else { @@ -682,7 +688,8 @@ usb_pc_load_mem(struct usb_page_cache *pc, usb_size_t size, uint8_t sync) * We have to unload the previous loaded DMA * pages before trying to load a new one! */ - bus_dmamap_unload(pc->tag, pc->map); + if (pc->isloaded) + bus_dmamap_unload(pc->tag, pc->map); /* * Try to load memory into DMA. The callback @@ -693,6 +700,7 @@ usb_pc_load_mem(struct usb_page_cache *pc, usb_size_t size, uint8_t sync) &usb_pc_load_mem_cb, pc, BUS_DMA_WAITOK)) { } } + pc->isloaded = 1; } else { if (!sync) { /* @@ -785,6 +793,8 @@ void usb_pc_dmamap_destroy(struct usb_page_cache *pc) { if (pc && pc->tag) { + if (pc->isloaded) + bus_dmamap_unload(pc->tag, pc->map); bus_dmamap_destroy(pc->tag, pc->map); pc->tag = NULL; pc->map = NULL; diff --git a/sys/dev/usb/usb_busdma.h b/sys/dev/usb/usb_busdma.h index ca0631e2ce53..2f60b30963d2 100644 --- a/sys/dev/usb/usb_busdma.h +++ b/sys/dev/usb/usb_busdma.h @@ -101,6 +101,7 @@ struct usb_page_cache { * from the memory. Else write. */ uint8_t ismultiseg:1; /* set if we can have multiple * segments */ + uint8_t isloaded:1; /* Set if map is currently loaded. */ #endif }; From owner-dev-commits-src-main@freebsd.org Tue Sep 28 19:33:17 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D4B816AB002; Tue, 28 Sep 2021 19:33:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HJqRd5fxnz4kx0; Tue, 28 Sep 2021 19:33:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A158A2485; Tue, 28 Sep 2021 19:33:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18SJXHlv049288; Tue, 28 Sep 2021 19:33:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18SJXHgb049287; Tue, 28 Sep 2021 19:33:17 GMT (envelope-from git) Date: Tue, 28 Sep 2021 19:33:17 GMT Message-Id: <202109281933.18SJXHgb049287@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Li-Wen Hsu Subject: git: 0b159faaca08 - main - Temporarily skip flaky tset cases under sys.aio.aio_test in CI MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: lwhsu X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 0b159faaca08e6cc89abcd29b4b1360f97e18245 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Sep 2021 19:33:17 -0000 The branch main has been updated by lwhsu: URL: https://cgit.FreeBSD.org/src/commit/?id=0b159faaca08e6cc89abcd29b4b1360f97e18245 commit 0b159faaca08e6cc89abcd29b4b1360f97e18245 Author: Li-Wen Hsu AuthorDate: 2021-09-28 19:32:47 +0000 Commit: Li-Wen Hsu CommitDate: 2021-09-28 19:32:47 +0000 Temporarily skip flaky tset cases under sys.aio.aio_test in CI - sys.aio.aio_test.vectored_unaligned - sys.aio.aio_test.vectored_zvol_poll PR: 258766 Sponsored by: The FreeBSD Foundation --- tests/sys/aio/aio_test.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/sys/aio/aio_test.c b/tests/sys/aio/aio_test.c index c3cf1d372e23..44bf85a10241 100644 --- a/tests/sys/aio/aio_test.c +++ b/tests/sys/aio/aio_test.c @@ -1813,6 +1813,9 @@ ATF_TC_BODY(vectored_unaligned, tc) ssize_t len, total_len; int fd; + if (atf_tc_get_config_var_as_bool_wd(tc, "ci", false)) + atf_tc_skip("https://bugs.freebsd.org/258766"); + ATF_REQUIRE_KERNEL_MODULE("aio"); ATF_REQUIRE_UNSAFE_AIO(); @@ -1902,6 +1905,8 @@ ATF_TC_HEAD(vectored_zvol_poll, tc) } ATF_TC_BODY(vectored_zvol_poll, tc) { + if (atf_tc_get_config_var_as_bool_wd(tc, "ci", false)) + atf_tc_skip("https://bugs.freebsd.org/258766"); aio_zvol_test(poll, NULL, true); } ATF_TC_CLEANUP(vectored_zvol_poll, tc) From owner-dev-commits-src-main@freebsd.org Tue Sep 28 20:18:03 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 215FF6AAF78; Tue, 28 Sep 2021 20:18:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HJrRH0CbQz4pjf; Tue, 28 Sep 2021 20:18:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DB2082C30; Tue, 28 Sep 2021 20:18:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18SKI26M003169; Tue, 28 Sep 2021 20:18:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18SKI2un003168; Tue, 28 Sep 2021 20:18:02 GMT (envelope-from git) Date: Tue, 28 Sep 2021 20:18:02 GMT Message-Id: <202109282018.18SKI2un003168@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ed Maste Subject: git: 820da5820e60 - main - mgb: Apply some style(9) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 820da5820e60f538d3598d8cb226f51a01bdf01c Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Sep 2021 20:18:03 -0000 The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=820da5820e60f538d3598d8cb226f51a01bdf01c commit 820da5820e60f538d3598d8cb226f51a01bdf01c Author: Ed Maste AuthorDate: 2021-09-28 20:08:14 +0000 Commit: Ed Maste CommitDate: 2021-09-28 20:17:16 +0000 mgb: Apply some style(9) Add parens around return values, rewrap lines MFC after: 1 week Fixes: 8890ab7758b8 ("Introduce if_mgb driver...") Sponsored by: The FreeBSD Foundation --- sys/dev/mgb/if_mgb.c | 81 ++++++++++++++++++++++++---------------------------- 1 file changed, 37 insertions(+), 44 deletions(-) diff --git a/sys/dev/mgb/if_mgb.c b/sys/dev/mgb/if_mgb.c index 9515d0d5d788..d4dda0bf65fd 100644 --- a/sys/dev/mgb/if_mgb.c +++ b/sys/dev/mgb/if_mgb.c @@ -397,8 +397,7 @@ mgb_attach_pre(if_ctx_t ctx) goto fail; } - switch (pci_get_device(sc->dev)) - { + switch (pci_get_device(sc->dev)) { case MGB_LAN7430_DEVICE_ID: phyaddr = 1; break; @@ -556,7 +555,7 @@ mgb_tx_queues_alloc(if_ctx_t ctx, caddr_t *vaddrs, uint64_t *paddrs, int ntxqs, rdata->head_wb = (uint32_t *) vaddrs[q * ntxqs + 1]; rdata->head_wb_bus_addr = paddrs[q * ntxqs + 1]; } - return 0; + return (0); } static int @@ -580,7 +579,7 @@ mgb_rx_queues_alloc(if_ctx_t ctx, caddr_t *vaddrs, uint64_t *paddrs, int nrxqs, rdata->head_wb = (uint32_t *) vaddrs[q * nrxqs + 1]; rdata->head_wb_bus_addr = paddrs[q * nrxqs + 1]; } - return 0; + return (0); } static void @@ -787,19 +786,16 @@ mgb_admin_intr(void *xsc) */ /* TODO: shouldn't continue if suspended */ - if ((intr_sts & MGB_INTR_STS_ANY) == 0) - { + if ((intr_sts & MGB_INTR_STS_ANY) == 0) { device_printf(sc->dev, "non-mgb interrupt triggered.\n"); return (FILTER_SCHEDULE_THREAD); } - if ((intr_sts & MGB_INTR_STS_TEST) != 0) - { + if ((intr_sts & MGB_INTR_STS_TEST) != 0) { sc->isr_test_flag = true; CSR_WRITE_REG(sc, MGB_INTR_STS, MGB_INTR_STS_TEST); return (FILTER_HANDLED); } - if ((intr_sts & MGB_INTR_STS_RX_ANY) != 0) - { + if ((intr_sts & MGB_INTR_STS_RX_ANY) != 0) { for (qidx = 0; qidx < scctx->isc_nrxqsets; qidx++) { if ((intr_sts & MGB_INTR_STS_RX(qidx))){ iflib_rx_intr_deferred(sc->ctx, qidx); @@ -808,8 +804,7 @@ mgb_admin_intr(void *xsc) return (FILTER_HANDLED); } /* XXX: TX interrupts should not occur */ - if ((intr_sts & MGB_INTR_STS_TX_ANY) != 0) - { + if ((intr_sts & MGB_INTR_STS_TX_ANY) != 0) { for (qidx = 0; qidx < scctx->isc_ntxqsets; qidx++) { if ((intr_sts & MGB_INTR_STS_RX(qidx))) { /* clear the interrupt sts and run handler */ @@ -960,7 +955,7 @@ mgb_intr_test(struct mgb_softc *sc) MGB_INTR_STS_ANY | MGB_INTR_STS_TEST); CSR_WRITE_REG(sc, MGB_INTR_SET, MGB_INTR_STS_TEST); if (sc->isr_test_flag) - return true; + return (true); for (i = 0; i < MGB_TIMEOUT; i++) { DELAY(10); if (sc->isr_test_flag) @@ -968,7 +963,7 @@ mgb_intr_test(struct mgb_softc *sc) } CSR_WRITE_REG(sc, MGB_INTR_ENBL_CLR, MGB_INTR_STS_TEST); CSR_WRITE_REG(sc, MGB_INTR_STS, MGB_INTR_STS_TEST); - return sc->isr_test_flag; + return (sc->isr_test_flag); } static int @@ -1055,7 +1050,7 @@ mgb_isc_txd_credits_update(void *xsc, uint16_t txqid, bool clear) while (*(rdata->head_wb) != rdata->last_head) { if (!clear) - return 1; + return (1); txd = &rdata->ring[rdata->last_head]; memset(txd, 0, sizeof(struct mgb_ring_desc)); @@ -1080,8 +1075,7 @@ mgb_isc_rxd_available(void *xsc, uint16_t rxqid, qidx_t idx, qidx_t budget) rdata = &sc->rx_ring_data; scctx = iflib_get_softc_ctx(sc->ctx); - for (; idx != *(rdata->head_wb); - idx = MGB_NEXT_RING_IDX(idx)) { + for (; idx != *(rdata->head_wb); idx = MGB_NEXT_RING_IDX(idx)) { avail++; /* XXX: Could verify desc is device owned here */ if (avail == budget) @@ -1116,21 +1110,21 @@ mgb_isc_rxd_pkt_get(void *xsc, if_rxd_info_t ri) device_printf(sc->dev, "Tried to read descriptor ... " "found that it's owned by the driver\n"); - return EINVAL; + return (EINVAL); } if ((rxd.ctl & MGB_RX_DESC_CTL_FS) == 0) { device_printf(sc->dev, "Tried to read descriptor ... " "found that FS is not set.\n"); device_printf(sc->dev, "Tried to read descriptor ... that it FS is not set.\n"); - return EINVAL; + return (EINVAL); } /* XXX: Multi-packet support */ if ((rxd.ctl & MGB_RX_DESC_CTL_LS) == 0) { device_printf(sc->dev, "Tried to read descriptor ... " "found that LS is not set. (Multi-buffer packets not yet supported)\n"); - return EINVAL; + return (EINVAL); } ri->iri_frags[0].irf_flid = 0; ri->iri_frags[0].irf_idx = rdata->last_head; @@ -1212,10 +1206,10 @@ mgb_test_bar(struct mgb_softc *sc) rev = id_rev & 0xFFFF; if (dev_id == MGB_LAN7430_DEVICE_ID || dev_id == MGB_LAN7431_DEVICE_ID) { - return 0; + return (0); } else { device_printf(sc->dev, "ID check failed.\n"); - return ENXIO; + return (ENXIO); } } @@ -1229,7 +1223,7 @@ mgb_alloc_regs(struct mgb_softc *sc) sc->regs = bus_alloc_resource_any(sc->dev, SYS_RES_MEMORY, &rid, RF_ACTIVE); if (sc->regs == NULL) - return ENXIO; + return (ENXIO); return (0); } @@ -1244,7 +1238,7 @@ mgb_release_regs(struct mgb_softc *sc) rman_get_rid(sc->regs), sc->regs); sc->regs = NULL; pci_disable_busmaster(sc->dev); - return error; + return (error); } static int @@ -1264,7 +1258,7 @@ mgb_dma_init(struct mgb_softc *sc) goto fail; fail: - return error; + return (error); } static int @@ -1394,7 +1388,7 @@ mgb_dma_tx_ring_init(struct mgb_softc *sc, int channel) DMAC_START))) device_printf(sc->dev, "Failed to start TX DMAC.\n"); fail: - return error; + return (error); } static int @@ -1418,7 +1412,7 @@ mgb_dmac_control(struct mgb_softc *sc, int start, int channel, */ error = mgb_dmac_control(sc, start, channel, DMAC_STOP); if (error != 0) - return error; + return (error); CSR_WRITE_REG(sc, MGB_DMAC_CMD, MGB_DMAC_CMD_START(start, channel)); break; @@ -1431,7 +1425,7 @@ mgb_dmac_control(struct mgb_softc *sc, int start, int channel, MGB_DMAC_CMD_START(start, channel)); break; } - return error; + return (error); } static int @@ -1442,13 +1436,13 @@ mgb_fct_control(struct mgb_softc *sc, int reg, int channel, switch (cmd) { case FCT_RESET: CSR_WRITE_REG(sc, reg, MGB_FCT_RESET(channel)); - return mgb_wait_for_bits(sc, reg, 0, MGB_FCT_RESET(channel)); + return (mgb_wait_for_bits(sc, reg, 0, MGB_FCT_RESET(channel))); case FCT_ENABLE: CSR_WRITE_REG(sc, reg, MGB_FCT_ENBL(channel)); return (0); case FCT_DISABLE: CSR_WRITE_REG(sc, reg, MGB_FCT_DSBL(channel)); - return mgb_wait_for_bits(sc, reg, 0, MGB_FCT_ENBL(channel)); + return (mgb_wait_for_bits(sc, reg, 0, MGB_FCT_ENBL(channel))); } } @@ -1487,7 +1481,7 @@ mgb_hw_init(struct mgb_softc *sc) goto fail; fail: - return error; + return (error); } static int @@ -1510,7 +1504,7 @@ mgb_mac_init(struct mgb_softc *sc) CSR_UPDATE_REG(sc, MGB_MAC_TX, MGB_MAC_ENBL); CSR_UPDATE_REG(sc, MGB_MAC_RX, MGB_MAC_ENBL); - return MGB_STS_OK; + return (MGB_STS_OK); } static int @@ -1520,7 +1514,7 @@ mgb_phy_reset(struct mgb_softc *sc) CSR_UPDATE_BYTE(sc, MGB_PMT_CTL, MGB_PHY_RESET); if (mgb_wait_for_bits(sc, MGB_PMT_CTL, 0, MGB_PHY_RESET) == MGB_STS_TIMEOUT) - return MGB_STS_TIMEOUT; + return (MGB_STS_TIMEOUT); return (mgb_wait_for_bits(sc, MGB_PMT_CTL, MGB_PHY_READY, 0)); } @@ -1545,12 +1539,11 @@ mgb_wait_for_bits(struct mgb_softc *sc, int reg, int set_bits, int clear_bits) */ DELAY(100); val = CSR_READ_REG(sc, reg); - if ((val & set_bits) == set_bits && - (val & clear_bits) == 0) - return MGB_STS_OK; + if ((val & set_bits) == set_bits && (val & clear_bits) == 0) + return (MGB_STS_OK); } while (i++ < MGB_TIMEOUT); - return MGB_STS_TIMEOUT; + return (MGB_STS_TIMEOUT); } static void @@ -1571,14 +1564,14 @@ mgb_miibus_readreg(device_t dev, int phy, int reg) if (mgb_wait_for_bits(sc, MGB_MII_ACCESS, 0, MGB_MII_BUSY) == MGB_STS_TIMEOUT) - return EIO; + return (EIO); mii_access = (phy & MGB_MII_PHY_ADDR_MASK) << MGB_MII_PHY_ADDR_SHIFT; mii_access |= (reg & MGB_MII_REG_ADDR_MASK) << MGB_MII_REG_ADDR_SHIFT; mii_access |= MGB_MII_BUSY | MGB_MII_READ; CSR_WRITE_REG(sc, MGB_MII_ACCESS, mii_access); if (mgb_wait_for_bits(sc, MGB_MII_ACCESS, 0, MGB_MII_BUSY) == MGB_STS_TIMEOUT) - return EIO; + return (EIO); return (CSR_READ_2_BYTES(sc, MGB_MII_DATA)); } @@ -1590,9 +1583,9 @@ mgb_miibus_writereg(device_t dev, int phy, int reg, int data) sc = iflib_get_softc(device_get_softc(dev)); - if (mgb_wait_for_bits(sc, MGB_MII_ACCESS, - 0, MGB_MII_BUSY) == MGB_STS_TIMEOUT) - return EIO; + if (mgb_wait_for_bits(sc, MGB_MII_ACCESS, 0, MGB_MII_BUSY) == + MGB_STS_TIMEOUT) + return (EIO); mii_access = (phy & MGB_MII_PHY_ADDR_MASK) << MGB_MII_PHY_ADDR_SHIFT; mii_access |= (reg & MGB_MII_REG_ADDR_MASK) << MGB_MII_REG_ADDR_SHIFT; mii_access |= MGB_MII_BUSY | MGB_MII_WRITE; @@ -1600,8 +1593,8 @@ mgb_miibus_writereg(device_t dev, int phy, int reg, int data) CSR_WRITE_REG(sc, MGB_MII_ACCESS, mii_access); if (mgb_wait_for_bits(sc, MGB_MII_ACCESS, 0, MGB_MII_BUSY) == MGB_STS_TIMEOUT) - return EIO; - return 0; + return (EIO); + return (0); } /* XXX: May need to lock these up */ From owner-dev-commits-src-main@freebsd.org Tue Sep 28 20:31:18 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E12F06AB949; Tue, 28 Sep 2021 20:31:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HJrkZ5n0cz4qV0; Tue, 28 Sep 2021 20:31:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A83FF3156; Tue, 28 Sep 2021 20:31:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18SKVIRA026387; Tue, 28 Sep 2021 20:31:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18SKVIME026369; Tue, 28 Sep 2021 20:31:18 GMT (envelope-from git) Date: Tue, 28 Sep 2021 20:31:18 GMT Message-Id: <202109282031.18SKVIME026369@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ed Maste Subject: git: 667ea7385d9c - main - mgb: Update man page wrt state of the driver MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 667ea7385d9ce45c376260e9c2c893c51514e25e Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Sep 2021 20:31:19 -0000 The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=667ea7385d9ce45c376260e9c2c893c51514e25e commit 667ea7385d9ce45c376260e9c2c893c51514e25e Author: Ed Maste AuthorDate: 2021-09-28 20:27:28 +0000 Commit: Ed Maste CommitDate: 2021-09-28 20:28:37 +0000 mgb: Update man page wrt state of the driver Be explicit that the driver has caveats and limitations, and remove the note about not being connected to the build: I plan to connect it soon. (Also the note serves no real purpose in a man page that is not installed.) MFC after: 1 week Sponsored by: The FreeBSD Foundation --- share/man/man4/mgb.4 | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/share/man/man4/mgb.4 b/share/man/man4/mgb.4 index f491595b257e..6b3cafa5c63d 100644 --- a/share/man/man4/mgb.4 +++ b/share/man/man4/mgb.4 @@ -23,7 +23,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 2, 2019 +.Dd September 28, 2021 .Dt MGB 4 .Os .Sh NAME @@ -38,7 +38,8 @@ if_mgb_load="YES" .Sh DESCRIPTION The .Nm -driver is experimental, and is not yet connected to the build. +driver is experimental, and has a number of caveats and limitations. +It is currently available only as a kernel module. .Pp The .Nm From owner-dev-commits-src-main@freebsd.org Tue Sep 28 22:24:17 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 193D36ACDC4; Tue, 28 Sep 2021 22:24:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HJvDx09CJz3Fqx; Tue, 28 Sep 2021 22:24:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D9AC4484B; Tue, 28 Sep 2021 22:24:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18SMOGGo076698; Tue, 28 Sep 2021 22:24:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18SMOG82076697; Tue, 28 Sep 2021 22:24:16 GMT (envelope-from git) Date: Tue, 28 Sep 2021 22:24:16 GMT Message-Id: <202109282224.18SMOG82076697@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Colin Percival Subject: git: 7457840230c5 - main - loader: Set twiddle globaldiv to 16 by default MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cperciva X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 7457840230c5a470ee5df8abed6ab59c4d008a45 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Sep 2021 22:24:17 -0000 The branch main has been updated by cperciva: URL: https://cgit.FreeBSD.org/src/commit/?id=7457840230c5a470ee5df8abed6ab59c4d008a45 commit 7457840230c5a470ee5df8abed6ab59c4d008a45 Author: Colin Percival AuthorDate: 2021-09-28 18:39:59 +0000 Commit: Colin Percival CommitDate: 2021-09-28 22:24:02 +0000 loader: Set twiddle globaldiv to 16 by default Booting FreeBSD on an EC2 c5.xlarge instance, the loader "twiddles" 810 times over the course of 510 ms, a rate of 1.59 kHz. Even accepting that many systems are slower than this particular VM and will take longer to boot (especially if using spinning-rust disks), this seems like an unhelpfully large amount of twiddling when compared to the ~60 Hz frame rate of many displays; printing the twiddles also consumes roughly 10% of the boot time on the aforementioned VM. Setting the default globaldiv to 16 dramatically reduces the time spent printing twiddles to the console while still twiddling at roughly 100 Hz; this should be ample even for systems which take longer to boot and consequently twiddle slower. Note that this can adjusted via the twiddle_divisor variable in loader.conf, but that file is not processed until nearly halfway through the loader's runtime. Reviewed by: allanjude, jrtc27, kevans MFC after: 1 week Sponsored by: https://www.patreon.com/cperciva Differential Revision: --- stand/common/console.c | 2 +- stand/defaults/loader.conf | 3 ++- stand/libsa/twiddle.c | 2 +- stand/man/loader.8 | 3 ++- stand/man/loader_simp.8 | 3 ++- 5 files changed, 8 insertions(+), 5 deletions(-) diff --git a/stand/common/console.c b/stand/common/console.c index 7886f9386c14..ff864276f96c 100644 --- a/stand/common/console.c +++ b/stand/common/console.c @@ -56,7 +56,7 @@ cons_probe(void) TSENTER(); /* We want a callback to install the new value when this var changes. */ - env_setenv("twiddle_divisor", EV_VOLATILE, "1", twiddle_set, + env_setenv("twiddle_divisor", EV_VOLATILE, "16", twiddle_set, env_nounset); /* Do all console probes */ diff --git a/stand/defaults/loader.conf b/stand/defaults/loader.conf index 7bca621e6703..6feb909d708a 100644 --- a/stand/defaults/loader.conf +++ b/stand/defaults/loader.conf @@ -111,7 +111,8 @@ module_blacklist="drm drm2 radeonkms i915kms amdgpu" # Loader module blacklist #tftp.blksize="1428" # Set the RFC 2348 TFTP block size. # If the TFTP server does not support RFC 2348, # the block size is set to 512. Valid: (8,9007) -#twiddle_divisor="1" # >1 means slow down the progress indicator. +#twiddle_divisor="16" # >16 slows down the progress indicator; + # <16 speeds up the progress indicator. ### Kernel settings ######################################## # The following boot_ variables are enabled by setting them to any value. diff --git a/stand/libsa/twiddle.c b/stand/libsa/twiddle.c index 7565295fa1a3..60022e4c8167 100644 --- a/stand/libsa/twiddle.c +++ b/stand/libsa/twiddle.c @@ -42,7 +42,7 @@ __FBSDID("$FreeBSD$"); /* Extra functions from NetBSD standalone printf.c */ -static u_int globaldiv; +static u_int globaldiv = 16; void twiddle(u_int callerdiv) diff --git a/stand/man/loader.8 b/stand/man/loader.8 index e658b41f8338..c606068941a7 100644 --- a/stand/man/loader.8 +++ b/stand/man/loader.8 @@ -644,7 +644,8 @@ Throttles the output of the I/O progress indicator displayed while loading the kernel and modules. This is useful on slow serial consoles where the time spent waiting for these characters to be written can add up to many seconds. -The default is 1 (full speed); a value of 2 spins half as fast, and so on. +The default is 16; a value of 32 spins half as fast, +while a value of 8 spins twice as fast. .It Va vm.kmem_size Sets the size of kernel memory (bytes). This overrides the value determined when the kernel was compiled. diff --git a/stand/man/loader_simp.8 b/stand/man/loader_simp.8 index 689996f244fd..ba0ba76e8f88 100644 --- a/stand/man/loader_simp.8 +++ b/stand/man/loader_simp.8 @@ -624,7 +624,8 @@ Throttles the output of the I/O progress indicator displayed while loading the kernel and modules. This is useful on slow serial consoles where the time spent waiting for these characters to be written can add up to many seconds. -The default is 1 (full speed); a value of 2 spins half as fast, and so on. +The default is 16; a value of 32 spins half as fast, +while a value of 8 spins twice as fast. .It Va vm.kmem_size Sets the size of kernel memory (bytes). This overrides the value determined when the kernel was compiled. From owner-dev-commits-src-main@freebsd.org Wed Sep 29 00:10:57 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7A50C6AE528; Wed, 29 Sep 2021 00:10:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HJxc12n1dz3Njq; Wed, 29 Sep 2021 00:10:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 40AE35FFB; Wed, 29 Sep 2021 00:10:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18T0AvVR018405; Wed, 29 Sep 2021 00:10:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18T0AvGx018404; Wed, 29 Sep 2021 00:10:57 GMT (envelope-from git) Date: Wed, 29 Sep 2021 00:10:57 GMT Message-Id: <202109290010.18T0AvGx018404@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Michael Tuexen Subject: git: 28ea9470782d - main - sctp: provide a specific stream scheduler function for FCFS MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 28ea9470782d4d01004b801c3ec7d74761fcf611 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Sep 2021 00:10:57 -0000 The branch main has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=28ea9470782d4d01004b801c3ec7d74761fcf611 commit 28ea9470782d4d01004b801c3ec7d74761fcf611 Author: Michael Tuexen AuthorDate: 2021-09-29 00:08:37 +0000 Commit: Michael Tuexen CommitDate: 2021-09-29 00:08:37 +0000 sctp: provide a specific stream scheduler function for FCFS A KASSERT in the genric routine does not apply and triggers incorrectly. Reported by: syzbot+8435af157238c6a11430@syzkaller.appspotmail.com MFC after: 1 week --- sys/netinet/sctp_ss_functions.c | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/sys/netinet/sctp_ss_functions.c b/sys/netinet/sctp_ss_functions.c index fe4b96cf00ab..5293c0fee742 100644 --- a/sys/netinet/sctp_ss_functions.c +++ b/sys/netinet/sctp_ss_functions.c @@ -863,6 +863,30 @@ default_again: return (strq); } +static void +sctp_ss_fcfs_scheduled(struct sctp_tcb *stcb, + struct sctp_nets *net SCTP_UNUSED, + struct sctp_association *asoc, + struct sctp_stream_out *strq, + int moved_how_much SCTP_UNUSED) +{ + struct sctp_stream_queue_pending *sp; + + KASSERT(strq != NULL, ("strq is NULL")); + asoc->ss_data.last_out_stream = strq; + if (asoc->idata_supported == 0) { + sp = TAILQ_FIRST(&strq->outqueue); + if ((sp != NULL) && (sp->some_taken == 1)) { + asoc->ss_data.locked_on_sending = strq; + } else { + asoc->ss_data.locked_on_sending = NULL; + } + } else { + asoc->ss_data.locked_on_sending = NULL; + } + return; +} + const struct sctp_ss_functions sctp_ss_functions[] = { /* SCTP_SS_DEFAULT */ { @@ -948,7 +972,7 @@ const struct sctp_ss_functions sctp_ss_functions[] = { .sctp_ss_is_empty = sctp_ss_fcfs_is_empty, .sctp_ss_remove_from_stream = sctp_ss_fcfs_remove, .sctp_ss_select_stream = sctp_ss_fcfs_select, - .sctp_ss_scheduled = sctp_ss_default_scheduled, + .sctp_ss_scheduled = sctp_ss_fcfs_scheduled, .sctp_ss_packet_done = sctp_ss_default_packet_done, .sctp_ss_get_value = sctp_ss_default_get_value, .sctp_ss_set_value = sctp_ss_default_set_value, From owner-dev-commits-src-main@freebsd.org Wed Sep 29 01:18:57 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B26166AF8E5; Wed, 29 Sep 2021 01:18:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HJz6T4g77z3jjP; Wed, 29 Sep 2021 01:18:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 801897146; Wed, 29 Sep 2021 01:18:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18T1Iva2003473; Wed, 29 Sep 2021 01:18:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18T1IvqG003472; Wed, 29 Sep 2021 01:18:57 GMT (envelope-from git) Date: Wed, 29 Sep 2021 01:18:57 GMT Message-Id: <202109290118.18T1IvqG003472@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ed Maste Subject: git: 543df609072f - main - mgb: Connect if_mgb module to the build MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 543df609072fe49079c36d6bee510e1645edde3a Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Sep 2021 01:18:57 -0000 The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=543df609072fe49079c36d6bee510e1645edde3a commit 543df609072fe49079c36d6bee510e1645edde3a Author: Ed Maste AuthorDate: 2021-09-28 16:58:40 +0000 Commit: Ed Maste CommitDate: 2021-09-29 01:16:40 +0000 mgb: Connect if_mgb module to the build It supports the following Microchip devices: LAN7430 PCIe Gigabit Ethernet controller with PHY LAN7431 PCIe Gigabit Ethernet controller with RGMII interface The driver has a number of caveats and limitations, but is functional. Relnotes: Yes Sponsored by: The FreeBSD Foundation --- share/man/man4/Makefile | 2 ++ sys/modules/Makefile | 2 ++ 2 files changed, 4 insertions(+) diff --git a/share/man/man4/Makefile b/share/man/man4/Makefile index d83f4d03d9db..4dad9b11ec22 100644 --- a/share/man/man4/Makefile +++ b/share/man/man4/Makefile @@ -297,6 +297,7 @@ MAN= aac.4 \ mem.4 \ meteor.4 \ mfi.4 \ + ${_mgb.4} \ miibus.4 \ mld.4 \ mlx.4 \ @@ -816,6 +817,7 @@ _igc.4= igc.4 _imcsmb.4= imcsmb.4 _io.4= io.4 _itwd.4= itwd.4 +_mgb.4= mgb.4 _nda.4= nda.4 _nfe.4= nfe.4 _nfsmb.4= nfsmb.4 diff --git a/sys/modules/Makefile b/sys/modules/Makefile index 2c0c9b48941d..00f5bb281872 100644 --- a/sys/modules/Makefile +++ b/sys/modules/Makefile @@ -232,6 +232,7 @@ SUBDIR= \ ${_mana} \ md \ mdio \ + ${_mgb} \ mem \ mfi \ mii \ @@ -652,6 +653,7 @@ _ixv= ixv _lio= lio .endif _mana= mana +_mgb= mgb _nctgpio= nctgpio _ntb= ntb _ocs_fc= ocs_fc From owner-dev-commits-src-main@freebsd.org Wed Sep 29 03:24:22 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B972F669E64; Wed, 29 Sep 2021 03:24:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HK1vB4Yn3z3qs2; Wed, 29 Sep 2021 03:24:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 72E1F108CD; Wed, 29 Sep 2021 03:24:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18T3OMpW075529; Wed, 29 Sep 2021 03:24:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18T3OMpt075528; Wed, 29 Sep 2021 03:24:22 GMT (envelope-from git) Date: Wed, 29 Sep 2021 03:24:22 GMT Message-Id: <202109290324.18T3OMpt075528@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: fa81f3731d1a - main - nvme: start qpair in state RECOVERY_WAITING MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: fa81f3731d1a2984a28ae44e60d12a0659b8fd2f Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Sep 2021 03:24:22 -0000 The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=fa81f3731d1a2984a28ae44e60d12a0659b8fd2f commit fa81f3731d1a2984a28ae44e60d12a0659b8fd2f Author: Warner Losh AuthorDate: 2021-09-29 03:09:45 +0000 Commit: Warner Losh CommitDate: 2021-09-29 03:16:19 +0000 nvme: start qpair in state RECOVERY_WAITING An interrupt happens on the admin queue right away after the reset, so as soon as we enable interrupts, we'll get a call to our interrupt handler. It is safe to ignore this interrupt if we're not yet initialized, or to process it if we are. If we are initialized, we'll see there's no completion records and return. If we're not, we'll process no completion records and return. Either way, nothing is processed and nothing is lost. Until we've completely setup the qpair, we need to avoid processing completion records. Start the qpair in the waiting recovery state so we return immediately when we try to process completions. The code already sets it to 'NONE' when we're initialization is complete. It's safe to defer completion processing here because we don't send any commands before the initialization of the software state of the qpair is complete. And even if we were to somehow send a command prior to that completing, the completion record for that command would be processed when we send commands to the admin qpair after we've setup the software state. There's no good central point to add an assert for this last condition. This fixes an KASSERT "received completion for unknown cmd" panic on boot. Fixes: 502dc84a8b6703e7c0626739179a3cdffdd22d81 Sponsored by: Netflix Reviewed by: mav, cperciva, gallatin Differential Revision: https://reviews.freebsd.org/D32210 --- sys/dev/nvme/nvme_qpair.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/nvme/nvme_qpair.c b/sys/dev/nvme/nvme_qpair.c index 7a17a057f319..6ee5fa9d4c30 100644 --- a/sys/dev/nvme/nvme_qpair.c +++ b/sys/dev/nvme/nvme_qpair.c @@ -740,7 +740,7 @@ nvme_qpair_construct(struct nvme_qpair *qpair, callout_init(&qpair->timer, 1); qpair->timer_armed = false; - qpair->recovery_state = RECOVERY_NONE; + qpair->recovery_state = RECOVERY_WAITING; /* * Calcuate the stride of the doorbell register. Many emulators set this From owner-dev-commits-src-main@freebsd.org Wed Sep 29 03:24:23 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D27AA669B59; Wed, 29 Sep 2021 03:24:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HK1vC4z45z3qs6; Wed, 29 Sep 2021 03:24:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8BCBB10CCE; Wed, 29 Sep 2021 03:24:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18T3ON8k075560; Wed, 29 Sep 2021 03:24:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18T3ONUd075559; Wed, 29 Sep 2021 03:24:23 GMT (envelope-from git) Date: Wed, 29 Sep 2021 03:24:23 GMT Message-Id: <202109290324.18T3ONUd075559@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 7d5eebe0f4a0 - main - nvme: Add sanity check for phase on startup. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 7d5eebe0f4a0f2aa5c8c7dfdd1a9ce1513849da8 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Sep 2021 03:24:24 -0000 The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=7d5eebe0f4a0f2aa5c8c7dfdd1a9ce1513849da8 commit 7d5eebe0f4a0f2aa5c8c7dfdd1a9ce1513849da8 Author: Warner Losh AuthorDate: 2021-09-29 03:11:17 +0000 Commit: Warner Losh CommitDate: 2021-09-29 03:18:00 +0000 nvme: Add sanity check for phase on startup. The proper phase for the qpiar right after reset in the first interrupt is 1. For it, make sure that we're not still in phase 0. This is an illegal state to be processing interrupts and indicates that we've failed to properly protect against a race between initializing our state and processing interrupts. Modify stat resetting code so it resets the number of interrpts to 1 instead of 0 so we don't trigger a false positive panic. Sponsored by: Netflix Reviewed by: cperciva, mav (prior version) Differential Revision: https://reviews.freebsd.org/D32211 --- sys/dev/nvme/nvme_qpair.c | 21 ++++++++++++++++++--- sys/dev/nvme/nvme_sysctl.c | 7 ++++++- 2 files changed, 24 insertions(+), 4 deletions(-) diff --git a/sys/dev/nvme/nvme_qpair.c b/sys/dev/nvme/nvme_qpair.c index 6ee5fa9d4c30..827054efd48e 100644 --- a/sys/dev/nvme/nvme_qpair.c +++ b/sys/dev/nvme/nvme_qpair.c @@ -536,16 +536,31 @@ nvme_qpair_process_completions(struct nvme_qpair *qpair) int done = 0; bool in_panic = dumping || SCHEDULER_STOPPED(); - qpair->num_intr_handler_calls++; - /* * qpair is not enabled, likely because a controller reset is is in * progress. Ignore the interrupt - any I/O that was associated with - * this interrupt will get retried when the reset is complete. + * this interrupt will get retried when the reset is complete. Any + * pending completions for when we're in startup will be completed + * as soon as initialization is complete and we start sending commands + * to the device. */ if (qpair->recovery_state != RECOVERY_NONE) return (false); + /* + * Sanity check initialization. After we reset the hardware, the phase + * is defined to be 1. So if we get here with zero prior calls and the + * phase is 0, it means that we've lost a race between the + * initialization and the ISR running. With the phase wrong, we'll + * process a bunch of completions that aren't really completions leading + * to a KASSERT below. + */ + KASSERT(!(qpair->num_intr_handler_calls == 0 && qpair->phase == 0), + ("%s: Phase wrong for first interrupt call.", + device_get_nameunit(qpair->ctrlr->dev))); + + qpair->num_intr_handler_calls++; + bus_dmamap_sync(qpair->dma_tag, qpair->queuemem_map, BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE); /* diff --git a/sys/dev/nvme/nvme_sysctl.c b/sys/dev/nvme/nvme_sysctl.c index 9ec1f14511f5..58db38dc373d 100644 --- a/sys/dev/nvme/nvme_sysctl.c +++ b/sys/dev/nvme/nvme_sysctl.c @@ -155,8 +155,13 @@ static void nvme_qpair_reset_stats(struct nvme_qpair *qpair) { + /* + * Reset the values. Due to sanity checks in + * nvme_qpair_process_completions, we reset the number of interrupt + * calls to 1. + */ qpair->num_cmds = 0; - qpair->num_intr_handler_calls = 0; + qpair->num_intr_handler_calls = 1; qpair->num_retries = 0; qpair->num_failures = 0; } From owner-dev-commits-src-main@freebsd.org Wed Sep 29 03:24:25 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4CBB7669DCF; Wed, 29 Sep 2021 03:24:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HK1vF0Tmfz3qq6; Wed, 29 Sep 2021 03:24:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B690610CCF; Wed, 29 Sep 2021 03:24:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18T3OOmS075584; Wed, 29 Sep 2021 03:24:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18T3OOEm075583; Wed, 29 Sep 2021 03:24:24 GMT (envelope-from git) Date: Wed, 29 Sep 2021 03:24:24 GMT Message-Id: <202109290324.18T3OOEm075583@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 587aa25525e5 - main - nvme: count number of ignored interrupts MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 587aa25525e54ea775298c402acd7a647f9838fb Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Sep 2021 03:24:25 -0000 The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=587aa25525e54ea775298c402acd7a647f9838fb commit 587aa25525e54ea775298c402acd7a647f9838fb Author: Warner Losh AuthorDate: 2021-09-29 03:13:11 +0000 Commit: Warner Losh CommitDate: 2021-09-29 03:18:00 +0000 nvme: count number of ignored interrupts Count the number of times we're asked to process completions, but that we ignore because the state of the qpair isn't in RECOVERY_NONE. Sponsored by: Netflix Reviewed by: mav, chuck Differential Revision: https://reviews.freebsd.org/D32212 --- sys/dev/nvme/nvme_private.h | 1 + sys/dev/nvme/nvme_qpair.c | 5 ++++- sys/dev/nvme/nvme_sysctl.c | 24 ++++++++++++++++++++++++ 3 files changed, 29 insertions(+), 1 deletion(-) diff --git a/sys/dev/nvme/nvme_private.h b/sys/dev/nvme/nvme_private.h index 02cecaf03a97..b00130910a82 100644 --- a/sys/dev/nvme/nvme_private.h +++ b/sys/dev/nvme/nvme_private.h @@ -195,6 +195,7 @@ struct nvme_qpair { int64_t num_intr_handler_calls; int64_t num_retries; int64_t num_failures; + int64_t num_ignored; struct nvme_command *cmd; struct nvme_completion *cpl; diff --git a/sys/dev/nvme/nvme_qpair.c b/sys/dev/nvme/nvme_qpair.c index 827054efd48e..788322092f88 100644 --- a/sys/dev/nvme/nvme_qpair.c +++ b/sys/dev/nvme/nvme_qpair.c @@ -544,8 +544,10 @@ nvme_qpair_process_completions(struct nvme_qpair *qpair) * as soon as initialization is complete and we start sending commands * to the device. */ - if (qpair->recovery_state != RECOVERY_NONE) + if (qpair->recovery_state != RECOVERY_NONE) { + qpair->num_ignored++; return (false); + } /* * Sanity check initialization. After we reset the hardware, the phase @@ -746,6 +748,7 @@ nvme_qpair_construct(struct nvme_qpair *qpair, qpair->num_intr_handler_calls = 0; qpair->num_retries = 0; qpair->num_failures = 0; + qpair->num_ignored = 0; qpair->cmd = (struct nvme_command *)queuemem; qpair->cpl = (struct nvme_completion *)(queuemem + cmdsz); prpmem = (uint8_t *)(queuemem + cmdsz + cplsz); diff --git a/sys/dev/nvme/nvme_sysctl.c b/sys/dev/nvme/nvme_sysctl.c index 58db38dc373d..cfcc814f44d2 100644 --- a/sys/dev/nvme/nvme_sysctl.c +++ b/sys/dev/nvme/nvme_sysctl.c @@ -164,6 +164,7 @@ nvme_qpair_reset_stats(struct nvme_qpair *qpair) qpair->num_intr_handler_calls = 1; qpair->num_retries = 0; qpair->num_failures = 0; + qpair->num_ignored = 0; } static int @@ -226,6 +227,21 @@ nvme_sysctl_num_failures(SYSCTL_HANDLER_ARGS) return (sysctl_handle_64(oidp, &num_failures, 0, req)); } +static int +nvme_sysctl_num_ignored(SYSCTL_HANDLER_ARGS) +{ + struct nvme_controller *ctrlr = arg1; + int64_t num_ignored = 0; + int i; + + num_ignored = ctrlr->adminq.num_ignored; + + for (i = 0; i < ctrlr->num_io_queues; i++) + num_ignored += ctrlr->ioq[i].num_ignored; + + return (sysctl_handle_64(oidp, &num_ignored, 0, req)); +} + static int nvme_sysctl_reset_stats(SYSCTL_HANDLER_ARGS) { @@ -281,6 +297,9 @@ nvme_sysctl_initialize_queue(struct nvme_qpair *qpair, SYSCTL_ADD_QUAD(ctrlr_ctx, que_list, OID_AUTO, "num_failures", CTLFLAG_RD, &qpair->num_failures, "Number of commands ending in failure after all retries"); + SYSCTL_ADD_QUAD(ctrlr_ctx, que_list, OID_AUTO, "num_ignored", + CTLFLAG_RD, &qpair->num_ignored, + "Number of interrupts posted, but were administratively ignored"); SYSCTL_ADD_PROC(ctrlr_ctx, que_list, OID_AUTO, "dump_debug", CTLTYPE_UINT | CTLFLAG_RW | CTLFLAG_MPSAFE, @@ -344,6 +363,11 @@ nvme_sysctl_initialize_ctrlr(struct nvme_controller *ctrlr) ctrlr, 0, nvme_sysctl_num_failures, "IU", "Number of commands ending in failure after all retries"); + SYSCTL_ADD_PROC(ctrlr_ctx, ctrlr_list, OID_AUTO, + "num_ignored", CTLTYPE_S64 | CTLFLAG_RD | CTLFLAG_MPSAFE, + ctrlr, 0, nvme_sysctl_num_ignored, "IU", + "Number of interrupts ignored administratively"); + SYSCTL_ADD_PROC(ctrlr_ctx, ctrlr_list, OID_AUTO, "reset_stats", CTLTYPE_UINT | CTLFLAG_RW | CTLFLAG_MPSAFE, ctrlr, 0, nvme_sysctl_reset_stats, "IU", "Reset statistics to zero"); From owner-dev-commits-src-main@freebsd.org Wed Sep 29 03:24:26 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 300D266A3B3; Wed, 29 Sep 2021 03:24:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HK1vF71qPz3qyG; Wed, 29 Sep 2021 03:24:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CD923108CE; Wed, 29 Sep 2021 03:24:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18T3OPCO075608; Wed, 29 Sep 2021 03:24:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18T3OPwf075607; Wed, 29 Sep 2021 03:24:25 GMT (envelope-from git) Date: Wed, 29 Sep 2021 03:24:25 GMT Message-Id: <202109290324.18T3OPwf075607@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 36a87d0c6fe9 - main - nvme: Sanity check completion id MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 36a87d0c6fe9d65de23f177ef84000b205f87e39 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Sep 2021 03:24:26 -0000 The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=36a87d0c6fe9d65de23f177ef84000b205f87e39 commit 36a87d0c6fe9d65de23f177ef84000b205f87e39 Author: Warner Losh AuthorDate: 2021-09-29 03:21:50 +0000 Commit: Warner Losh CommitDate: 2021-09-29 03:21:50 +0000 nvme: Sanity check completion id Make sure the completion ID is in the range of [0..num_trackers) since the values past the end of the act_tr array are never going to be valid trackers and will lead to pain and suffering if we try to dereference them to get the tracker or to set the tracker back to NULL as we complete the I/O. Sponsored by: Netflix Reviewed by: mav, chs, chuck Differential Revision: https://reviews.freebsd.org/D32088 --- sys/dev/nvme/nvme_qpair.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/sys/dev/nvme/nvme_qpair.c b/sys/dev/nvme/nvme_qpair.c index 788322092f88..8041731099df 100644 --- a/sys/dev/nvme/nvme_qpair.c +++ b/sys/dev/nvme/nvme_qpair.c @@ -624,7 +624,10 @@ nvme_qpair_process_completions(struct nvme_qpair *qpair) NVME_STATUS_GET_P(status) == NVME_STATUS_GET_P(cpl.status), ("Phase unexpectedly inconsistent")); - tr = qpair->act_tr[cpl.cid]; + if (cpl.cid < qpair->num_trackers) + tr = qpair->act_tr[cpl.cid]; + else + tr = NULL; if (tr != NULL) { nvme_qpair_complete_tracker(tr, &cpl, ERROR_PRINT_ALL); @@ -644,7 +647,8 @@ nvme_qpair_process_completions(struct nvme_qpair *qpair) * ignore this condition because it's not unexpected. */ nvme_printf(qpair->ctrlr, - "cpl does not map to outstanding cmd\n"); + "cpl (cid = %u) does not map to outstanding cmd\n", + cpl.cid); /* nvme_dump_completion expects device endianess */ nvme_dump_completion(&qpair->cpl[qpair->cq_head]); KASSERT(0, ("received completion for unknown cmd")); From owner-dev-commits-src-main@freebsd.org Wed Sep 29 08:35:08 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DCF6666F765; Wed, 29 Sep 2021 08:35:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HK8nm5cCnz4l1h; Wed, 29 Sep 2021 08:35:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A14FA14B61; Wed, 29 Sep 2021 08:35:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18T8Z83k088200; Wed, 29 Sep 2021 08:35:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18T8Z8ns088199; Wed, 29 Sep 2021 08:35:08 GMT (envelope-from git) Date: Wed, 29 Sep 2021 08:35:08 GMT Message-Id: <202109290835.18T8Z8ns088199@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Li-Wen Hsu Subject: git: 5f07d7fe408b - main - mgb: Fix DEBUG (and LINT) build MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: lwhsu X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5f07d7fe408bbca5c2f6755c363128107916c08d Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Sep 2021 08:35:08 -0000 The branch main has been updated by lwhsu: URL: https://cgit.FreeBSD.org/src/commit/?id=5f07d7fe408bbca5c2f6755c363128107916c08d commit 5f07d7fe408bbca5c2f6755c363128107916c08d Author: Li-Wen Hsu AuthorDate: 2021-09-29 08:34:59 +0000 Commit: Li-Wen Hsu CommitDate: 2021-09-29 08:34:59 +0000 mgb: Fix DEBUG (and LINT) build Sponsored by: The FreeBSD Foundation --- sys/dev/mgb/if_mgb.c | 1 - 1 file changed, 1 deletion(-) diff --git a/sys/dev/mgb/if_mgb.c b/sys/dev/mgb/if_mgb.c index d4dda0bf65fd..bc944c92625c 100644 --- a/sys/dev/mgb/if_mgb.c +++ b/sys/dev/mgb/if_mgb.c @@ -693,7 +693,6 @@ mgb_dump_some_stats(struct mgb_softc *sc) i, sc->tx_ring_data.ring[i].addr.high, i, sc->tx_ring_data.ring[i].sts); device_printf(sc->dev, "==== DUMP_TX_DMA_RAM ====\n"); - int i; CSR_WRITE_REG(sc, 0x24, 0xF); // DP_SEL & TX_RAM_0 for (i = 0; i < 128; i++) { CSR_WRITE_REG(sc, 0x2C, i); // DP_ADDR From owner-dev-commits-src-main@freebsd.org Wed Sep 29 12:43:47 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 62A52672DD5; Wed, 29 Sep 2021 12:43:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HKGJg241qz3Pjw; Wed, 29 Sep 2021 12:43:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2760E17DFC; Wed, 29 Sep 2021 12:43:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18TChlTr021335; Wed, 29 Sep 2021 12:43:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18TChlcO021334; Wed, 29 Sep 2021 12:43:47 GMT (envelope-from git) Date: Wed, 29 Sep 2021 12:43:47 GMT Message-Id: <202109291243.18TChlcO021334@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 25adbd0b8c3f - main - neta: cleanup warning MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 25adbd0b8c3f282b8bdf252379eace8ce57bc927 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Sep 2021 12:43:47 -0000 The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=25adbd0b8c3f282b8bdf252379eace8ce57bc927 commit 25adbd0b8c3f282b8bdf252379eace8ce57bc927 Author: Bjoern A. Zeeb AuthorDate: 2021-09-29 12:37:16 +0000 Commit: Bjoern A. Zeeb CommitDate: 2021-09-29 12:37:16 +0000 neta: cleanup warning mvneta_find_ethernet_prop_switch() is file-local static to if_mvneta_fdt.c. Normally we would not need a function declararion but in case MVNETA_DEBUG is set it becomes public. Move the function declaration from if_mvneta.c to if_mvneta_fdt.c to avoid a warning during each compile. --- sys/dev/neta/if_mvneta.c | 1 - sys/dev/neta/if_mvneta_fdt.c | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/neta/if_mvneta.c b/sys/dev/neta/if_mvneta.c index fe86f4a5effe..1ddd95cced78 100644 --- a/sys/dev/neta/if_mvneta.c +++ b/sys/dev/neta/if_mvneta.c @@ -186,7 +186,6 @@ STATIC uint64_t mvneta_read_mib(struct mvneta_softc *, int); STATIC void mvneta_update_mib(struct mvneta_softc *); /* Switch */ -STATIC boolean_t mvneta_find_ethernet_prop_switch(phandle_t, phandle_t); STATIC boolean_t mvneta_has_switch(device_t); #define mvneta_sc_lock(sc) mtx_lock(&sc->mtx) diff --git a/sys/dev/neta/if_mvneta_fdt.c b/sys/dev/neta/if_mvneta_fdt.c index bedf4b253a45..85948adb69d4 100644 --- a/sys/dev/neta/if_mvneta_fdt.c +++ b/sys/dev/neta/if_mvneta_fdt.c @@ -69,6 +69,7 @@ __FBSDID("$FreeBSD$"); static int mvneta_fdt_probe(device_t); static int mvneta_fdt_attach(device_t); +STATIC boolean_t mvneta_find_ethernet_prop_switch(phandle_t, phandle_t); static device_method_t mvneta_fdt_methods[] = { /* Device interface */ From owner-dev-commits-src-main@freebsd.org Wed Sep 29 12:46:33 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 34A0C673813; Wed, 29 Sep 2021 12:46:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HKGMr6fHyz3QNF; Wed, 29 Sep 2021 12:46:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C040117DFD; Wed, 29 Sep 2021 12:46:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18TCkWnk021648; Wed, 29 Sep 2021 12:46:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18TCkWwb021647; Wed, 29 Sep 2021 12:46:32 GMT (envelope-from git) Date: Wed, 29 Sep 2021 12:46:32 GMT Message-Id: <202109291246.18TCkWwb021647@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: c39eefe715b3 - main - LinuxKPI: implement dma_set_coherent_mask() MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c39eefe715b3c835ce3d91a1c1932197c23c1f3c Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Sep 2021 12:46:33 -0000 The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=c39eefe715b3c835ce3d91a1c1932197c23c1f3c commit c39eefe715b3c835ce3d91a1c1932197c23c1f3c Author: Bjoern A. Zeeb AuthorDate: 2021-09-27 22:50:07 +0000 Commit: Bjoern A. Zeeb CommitDate: 2021-09-29 12:41:28 +0000 LinuxKPI: implement dma_set_coherent_mask() Coherent is lower 32bit only by default in Linux and our only default dma mask is 64bit currently which violates expectations unless dma_set_coherent_mask() was called explicitly with a different mask. Implement coherent by creating a second tag, and storing the tags in the objects and use the tag from the object wherever possible. This currently does not update the scatterlist or pool (both could be converted but S/G cannot be MFCed as easily). There is a 2nd change embedded in the updated logic of linux_dma_alloc_coherent() to always zero the allocation as otherwise some drivers get cranky on uninialised garbage. Sponsored by: The FreeBSD Foundation MFC after: 7 days Reviewed by: hselasky Differential Revision: https://reviews.freebsd.org/D32164 --- .../linuxkpi/common/include/linux/dma-mapping.h | 7 +- sys/compat/linuxkpi/common/src/linux_pci.c | 192 +++++++++++++-------- 2 files changed, 128 insertions(+), 71 deletions(-) diff --git a/sys/compat/linuxkpi/common/include/linux/dma-mapping.h b/sys/compat/linuxkpi/common/include/linux/dma-mapping.h index 554d4bd4e695..c86a24d1270a 100644 --- a/sys/compat/linuxkpi/common/include/linux/dma-mapping.h +++ b/sys/compat/linuxkpi/common/include/linux/dma-mapping.h @@ -92,6 +92,7 @@ struct dma_map_ops { #define DMA_BIT_MASK(n) ((2ULL << ((n) - 1)) - 1ULL) int linux_dma_tag_init(struct device *, u64); +int linux_dma_tag_init_coherent(struct device *, u64); void *linux_dma_alloc_coherent(struct device *dev, size_t size, dma_addr_t *dma_handle, gfp_t flag); dma_addr_t linux_dma_map_phys(struct device *dev, vm_paddr_t phys, size_t len); @@ -125,10 +126,10 @@ static inline int dma_set_coherent_mask(struct device *dev, u64 dma_mask) { - if (!dma_supported(dev, dma_mask)) + if (!dev->dma_priv || !dma_supported(dev, dma_mask)) return -EIO; - /* XXX Currently we don't support a separate coherent mask. */ - return 0; + + return (linux_dma_tag_init_coherent(dev, dma_mask)); } static inline int diff --git a/sys/compat/linuxkpi/common/src/linux_pci.c b/sys/compat/linuxkpi/common/src/linux_pci.c index ae45df9c6514..5e527fdf0f4b 100644 --- a/sys/compat/linuxkpi/common/src/linux_pci.c +++ b/sys/compat/linuxkpi/common/src/linux_pci.c @@ -110,13 +110,31 @@ static device_method_t pci_methods[] = { struct linux_dma_priv { uint64_t dma_mask; - struct mtx lock; bus_dma_tag_t dmat; + uint64_t dma_coherent_mask; + bus_dma_tag_t dmat_coherent; + struct mtx lock; struct pctrie ptree; }; #define DMA_PRIV_LOCK(priv) mtx_lock(&(priv)->lock) #define DMA_PRIV_UNLOCK(priv) mtx_unlock(&(priv)->lock) +static int +linux_pdev_dma_uninit(struct pci_dev *pdev) +{ + struct linux_dma_priv *priv; + + priv = pdev->dev.dma_priv; + if (priv->dmat) + bus_dma_tag_destroy(priv->dmat); + if (priv->dmat_coherent) + bus_dma_tag_destroy(priv->dmat_coherent); + mtx_destroy(&priv->lock); + pdev->dev.dma_priv = NULL; + free(priv, M_DEVBUF); + return (0); +} + static int linux_pdev_dma_init(struct pci_dev *pdev) { @@ -124,34 +142,26 @@ linux_pdev_dma_init(struct pci_dev *pdev) int error; priv = malloc(sizeof(*priv), M_DEVBUF, M_WAITOK | M_ZERO); - pdev->dev.dma_priv = priv; mtx_init(&priv->lock, "lkpi-priv-dma", NULL, MTX_DEF); - pctrie_init(&priv->ptree); - /* create a default DMA tag */ + pdev->dev.dma_priv = priv; + + /* Create a default DMA tags. */ error = linux_dma_tag_init(&pdev->dev, DMA_BIT_MASK(64)); - if (error) { - mtx_destroy(&priv->lock); - free(priv, M_DEVBUF); - pdev->dev.dma_priv = NULL; - } - return (error); -} + if (error != 0) + goto err; + /* Coherent is lower 32bit only by default in Linux. */ + error = linux_dma_tag_init_coherent(&pdev->dev, DMA_BIT_MASK(32)); + if (error != 0) + goto err; -static int -linux_pdev_dma_uninit(struct pci_dev *pdev) -{ - struct linux_dma_priv *priv; + return (error); - priv = pdev->dev.dma_priv; - if (priv->dmat) - bus_dma_tag_destroy(priv->dmat); - mtx_destroy(&priv->lock); - free(priv, M_DEVBUF); - pdev->dev.dma_priv = NULL; - return (0); +err: + linux_pdev_dma_uninit(pdev); + return (error); } int @@ -185,6 +195,37 @@ linux_dma_tag_init(struct device *dev, u64 dma_mask) return (-error); } +int +linux_dma_tag_init_coherent(struct device *dev, u64 dma_mask) +{ + struct linux_dma_priv *priv; + int error; + + priv = dev->dma_priv; + + if (priv->dmat_coherent) { + if (priv->dma_coherent_mask == dma_mask) + return (0); + + bus_dma_tag_destroy(priv->dmat_coherent); + } + + priv->dma_coherent_mask = dma_mask; + + error = bus_dma_tag_create(bus_get_dma_tag(dev->bsddev), + 1, 0, /* alignment, boundary */ + dma_mask, /* lowaddr */ + BUS_SPACE_MAXADDR, /* highaddr */ + NULL, NULL, /* filtfunc, filtfuncarg */ + BUS_SPACE_MAXSIZE, /* maxsize */ + 1, /* nsegments */ + BUS_SPACE_MAXSIZE, /* maxsegsz */ + 0, /* flags */ + NULL, NULL, /* lockfunc, lockfuncarg */ + &priv->dmat_coherent); + return (-error); +} + static struct pci_driver * linux_pci_find(device_t dev, const struct pci_device_id **idp) { @@ -704,6 +745,7 @@ struct linux_dma_obj { void *vaddr; uint64_t dma_addr; bus_dmamap_t dmamap; + bus_dma_tag_t dmat; }; static uma_zone_t linux_dma_trie_zone; @@ -749,44 +791,10 @@ linux_dma_trie_free(struct pctrie *ptree, void *node) PCTRIE_DEFINE(LINUX_DMA, linux_dma_obj, dma_addr, linux_dma_trie_alloc, linux_dma_trie_free); -void * -linux_dma_alloc_coherent(struct device *dev, size_t size, - dma_addr_t *dma_handle, gfp_t flag) -{ - struct linux_dma_priv *priv; - vm_paddr_t high; - size_t align; - void *mem; - - if (dev == NULL || dev->dma_priv == NULL) { - *dma_handle = 0; - return (NULL); - } - priv = dev->dma_priv; - if (priv->dma_mask) - high = priv->dma_mask; - else if (flag & GFP_DMA32) - high = BUS_SPACE_MAXADDR_32BIT; - else - high = BUS_SPACE_MAXADDR; - align = PAGE_SIZE << get_order(size); - mem = (void *)kmem_alloc_contig(size, flag & GFP_NATIVE_MASK, 0, high, - align, 0, VM_MEMATTR_DEFAULT); - if (mem != NULL) { - *dma_handle = linux_dma_map_phys(dev, vtophys(mem), size); - if (*dma_handle == 0) { - kmem_free((vm_offset_t)mem, size); - mem = NULL; - } - } else { - *dma_handle = 0; - } - return (mem); -} - #if defined(__i386__) || defined(__amd64__) || defined(__aarch64__) -dma_addr_t -linux_dma_map_phys(struct device *dev, vm_paddr_t phys, size_t len) +static dma_addr_t +linux_dma_map_phys_common(struct device *dev, vm_paddr_t phys, size_t len, + bus_dma_tag_t dmat) { struct linux_dma_priv *priv; struct linux_dma_obj *obj; @@ -801,25 +809,26 @@ linux_dma_map_phys(struct device *dev, vm_paddr_t phys, size_t len) * bus_dma API. This avoids tracking collisions in the pctrie * with the additional benefit of reducing overhead. */ - if (bus_dma_id_mapped(priv->dmat, phys, len)) + if (bus_dma_id_mapped(dmat, phys, len)) return (phys); obj = uma_zalloc(linux_dma_obj_zone, M_NOWAIT); if (obj == NULL) { return (0); } + obj->dmat = dmat; DMA_PRIV_LOCK(priv); - if (bus_dmamap_create(priv->dmat, 0, &obj->dmamap) != 0) { + if (bus_dmamap_create(obj->dmat, 0, &obj->dmamap) != 0) { DMA_PRIV_UNLOCK(priv); uma_zfree(linux_dma_obj_zone, obj); return (0); } nseg = -1; - if (_bus_dmamap_load_phys(priv->dmat, obj->dmamap, phys, len, + if (_bus_dmamap_load_phys(obj->dmat, obj->dmamap, phys, len, BUS_DMA_NOWAIT, &seg, &nseg) != 0) { - bus_dmamap_destroy(priv->dmat, obj->dmamap); + bus_dmamap_destroy(obj->dmat, obj->dmamap); DMA_PRIV_UNLOCK(priv); uma_zfree(linux_dma_obj_zone, obj); return (0); @@ -830,8 +839,8 @@ linux_dma_map_phys(struct device *dev, vm_paddr_t phys, size_t len) error = LINUX_DMA_PCTRIE_INSERT(&priv->ptree, obj); if (error != 0) { - bus_dmamap_unload(priv->dmat, obj->dmamap); - bus_dmamap_destroy(priv->dmat, obj->dmamap); + bus_dmamap_unload(obj->dmat, obj->dmamap); + bus_dmamap_destroy(obj->dmat, obj->dmamap); DMA_PRIV_UNLOCK(priv); uma_zfree(linux_dma_obj_zone, obj); return (0); @@ -841,12 +850,22 @@ linux_dma_map_phys(struct device *dev, vm_paddr_t phys, size_t len) } #else dma_addr_t -linux_dma_map_phys(struct device *dev, vm_paddr_t phys, size_t len) +linux_dma_map_phys_common(struct device *dev __unused, vm_paddr_t phys, + size_t len __unused, bus_dma_tag_t dmat __unused) { return (phys); } #endif +dma_addr_t +linux_dma_map_phys(struct device *dev, vm_paddr_t phys, size_t len) +{ + struct linux_dma_priv *priv; + + priv = dev->dma_priv; + return (linux_dma_map_phys_common(dev, phys, len, priv->dmat)); +} + #if defined(__i386__) || defined(__amd64__) || defined(__aarch64__) void linux_dma_unmap(struct device *dev, dma_addr_t dma_addr, size_t len) @@ -866,8 +885,8 @@ linux_dma_unmap(struct device *dev, dma_addr_t dma_addr, size_t len) return; } LINUX_DMA_PCTRIE_REMOVE(&priv->ptree, dma_addr); - bus_dmamap_unload(priv->dmat, obj->dmamap); - bus_dmamap_destroy(priv->dmat, obj->dmamap); + bus_dmamap_unload(obj->dmat, obj->dmamap); + bus_dmamap_destroy(obj->dmat, obj->dmamap); DMA_PRIV_UNLOCK(priv); uma_zfree(linux_dma_obj_zone, obj); @@ -879,6 +898,43 @@ linux_dma_unmap(struct device *dev, dma_addr_t dma_addr, size_t len) } #endif +void * +linux_dma_alloc_coherent(struct device *dev, size_t size, + dma_addr_t *dma_handle, gfp_t flag) +{ + struct linux_dma_priv *priv; + vm_paddr_t high; + size_t align; + void *mem; + + if (dev == NULL || dev->dma_priv == NULL) { + *dma_handle = 0; + return (NULL); + } + priv = dev->dma_priv; + if (priv->dma_coherent_mask) + high = priv->dma_coherent_mask; + else + /* Coherent is lower 32bit only by default in Linux. */ + high = BUS_SPACE_MAXADDR_32BIT; + align = PAGE_SIZE << get_order(size); + /* Always zero the allocation. */ + flag |= M_ZERO; + mem = (void *)kmem_alloc_contig(size, flag & GFP_NATIVE_MASK, 0, high, + align, 0, VM_MEMATTR_DEFAULT); + if (mem != NULL) { + *dma_handle = linux_dma_map_phys_common(dev, vtophys(mem), size, + priv->dmat_coherent); + if (*dma_handle == 0) { + kmem_free((vm_offset_t)mem, size); + mem = NULL; + } + } else { + *dma_handle = 0; + } + return (mem); +} + int linux_dma_map_sg_attrs(struct device *dev, struct scatterlist *sgl, int nents, enum dma_data_direction dir __unused, unsigned long attrs __unused) From owner-dev-commits-src-main@freebsd.org Wed Sep 29 12:59:41 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1433D673A84; Wed, 29 Sep 2021 12:59:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HKGg1056Qz3hbX; Wed, 29 Sep 2021 12:59:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D6F2B18900; Wed, 29 Sep 2021 12:59:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18TCxekL035492; Wed, 29 Sep 2021 12:59:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18TCxeJP035491; Wed, 29 Sep 2021 12:59:40 GMT (envelope-from git) Date: Wed, 29 Sep 2021 12:59:40 GMT Message-Id: <202109291259.18TCxeJP035491@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Jessica Clarke Subject: git: 4a331971d2f1 - main - mmc: Fix regression in 8a8166e5bcfb breaking Stratix 10 boot MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jrtc27 X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 4a331971d2f1083f35b87197da0614fa3e0e53cb Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Sep 2021 12:59:41 -0000 The branch main has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=4a331971d2f1083f35b87197da0614fa3e0e53cb commit 4a331971d2f1083f35b87197da0614fa3e0e53cb Author: Jessica Clarke AuthorDate: 2021-09-29 12:59:13 +0000 Commit: Jessica Clarke CommitDate: 2021-09-29 12:59:13 +0000 mmc: Fix regression in 8a8166e5bcfb breaking Stratix 10 boot The refactoring in 8a8166e5bcfb introduced a functional change that breaks booting on the Stratix 10, hanging when it should be attaching da0. Previously OF_getencprop was called with a pointer to host->f_max, so if it wasn't present then the existing value was left untouched, but after that commit it will instead clobber the value with 0. The dwmmc driver, as used on the Stratix 10, sets a default value before calling mmc_fdt_parse and so was broken by this functional change. It appears that aw_mmc also does the same thing, so was presumably also broken on some boards. Fixes: 8a8166e5bcfb ("mmc: switch mmc_helper to device_ api") Reviewed by: manu, mw Differential Revision: https://reviews.freebsd.org/D32209 --- sys/dev/mmc/mmc_helpers.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/dev/mmc/mmc_helpers.c b/sys/dev/mmc/mmc_helpers.c index 0e1e16666367..1a90f291fc47 100644 --- a/sys/dev/mmc/mmc_helpers.c +++ b/sys/dev/mmc/mmc_helpers.c @@ -105,9 +105,9 @@ mmc_parse(device_t dev, struct mmc_helper *helper, struct mmc_host *host) * if it's not present based on the clock that the mmc controller * operates on */ - max_freq = 0; - device_get_property(dev, "max-frequency", &max_freq, sizeof(uint64_t)); - host->f_max = max_freq; + if (device_get_property(dev, "max-frequency", &max_freq, + sizeof(uint64_t)) > 0) + host->f_max = max_freq; if (device_has_property(dev, "broken-cd")) helper->props |= MMC_PROP_BROKEN_CD; From owner-dev-commits-src-main@freebsd.org Wed Sep 29 13:42:29 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A9C7467441A; Wed, 29 Sep 2021 13:42:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HKHcP4RV3z3lmY; Wed, 29 Sep 2021 13:42:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 748E61938D; Wed, 29 Sep 2021 13:42:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18TDgTBu001105; Wed, 29 Sep 2021 13:42:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18TDgTNS001104; Wed, 29 Sep 2021 13:42:29 GMT (envelope-from git) Date: Wed, 29 Sep 2021 13:42:29 GMT Message-Id: <202109291342.18TDgTNS001104@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: bf8637181a2b - main - pf: implement adaptive mode MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: bf8637181a2bb81206ff8c685f1632d07b8feb13 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Sep 2021 13:42:29 -0000 The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=bf8637181a2bb81206ff8c685f1632d07b8feb13 commit bf8637181a2bb81206ff8c685f1632d07b8feb13 Author: Kristof Provost AuthorDate: 2021-07-24 11:59:34 +0000 Commit: Kristof Provost CommitDate: 2021-09-29 13:11:54 +0000 pf: implement adaptive mode Use atomic counters to ensure that we correctly track the number of half open states and syncookie responses in-flight. This determines if we activate or deactivate syncookies in adaptive mode. MFC after: 1 week Sponsored by: Modirum MDPay Differential Revision: https://reviews.freebsd.org/D32134 --- sys/net/pfvar.h | 5 ++++- sys/netpfil/pf/pf.c | 15 +++++++++++++ sys/netpfil/pf/pf_syncookies.c | 51 +++++++++++++++++++++++++++++++++++++----- 3 files changed, 65 insertions(+), 6 deletions(-) diff --git a/sys/net/pfvar.h b/sys/net/pfvar.h index b2c177fba68c..90ef19c59172 100644 --- a/sys/net/pfvar.h +++ b/sys/net/pfvar.h @@ -1382,7 +1382,8 @@ struct pf_pdesc { enum pf_syncookies_mode { PF_SYNCOOKIES_NEVER = 0, PF_SYNCOOKIES_ALWAYS = 1, - PF_SYNCOOKIES_MODE_MAX = PF_SYNCOOKIES_ALWAYS + PF_SYNCOOKIES_ADAPTIVE = 2, + PF_SYNCOOKIES_MODE_MAX = PF_SYNCOOKIES_ADAPTIVE }; #ifdef _KERNEL @@ -1402,6 +1403,8 @@ struct pf_kstatus { bool keep_counters; enum pf_syncookies_mode syncookies_mode; bool syncookies_active; + uint64_t syncookies_inflight[2]; + uint32_t states_halfopen; }; #endif diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index ac329a37f7bd..b67f688c3f3f 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -500,6 +500,15 @@ pf_set_protostate(struct pf_kstate *s, int which, u_int8_t newstate) s->dst.state = newstate; if (which == PF_PEER_DST) return; + if (s->src.state == newstate) + return; + if (s->creatorid == V_pf_status.hostid && + s->key[PF_SK_STACK] != NULL && + s->key[PF_SK_STACK]->proto == IPPROTO_TCP && + !(TCPS_HAVEESTABLISHED(s->src.state) || + s->src.state == TCPS_CLOSED) && + (TCPS_HAVEESTABLISHED(newstate) || newstate == TCPS_CLOSED)) + atomic_add_32(&V_pf_status.states_halfopen, -1); s->src.state = newstate; } @@ -1931,6 +1940,11 @@ pf_unlink_state(struct pf_kstate *s, u_int flags) s->timeout = PFTM_UNLINKED; + /* Ensure we remove it from the list of halfopen states, if needed. */ + if (s->key[PF_SK_STACK] != NULL && + s->key[PF_SK_STACK]->proto == IPPROTO_TCP) + pf_set_protostate(s, PF_PEER_BOTH, TCPS_CLOSED); + PF_HASHROW_UNLOCK(ih); pf_detach_state(s); @@ -4035,6 +4049,7 @@ pf_create_state(struct pf_krule *r, struct pf_krule *nr, struct pf_krule *a, pf_set_protostate(s, PF_PEER_SRC, TCPS_SYN_SENT); pf_set_protostate(s, PF_PEER_DST, TCPS_CLOSED); s->timeout = PFTM_TCP_FIRST_PACKET; + atomic_add_32(&V_pf_status.states_halfopen, 1); break; case IPPROTO_UDP: pf_set_protostate(s, PF_PEER_SRC, PFUDPS_SINGLE); diff --git a/sys/netpfil/pf/pf_syncookies.c b/sys/netpfil/pf/pf_syncookies.c index 4eabbb5e2744..11093b636777 100644 --- a/sys/netpfil/pf/pf_syncookies.c +++ b/sys/netpfil/pf/pf_syncookies.c @@ -106,6 +106,8 @@ struct pf_syncookie_status { struct callout keytimeout; uint8_t oddeven; uint8_t key[2][SIPHASH_KEY_LENGTH]; + uint32_t hiwat; /* absolute; # of states */ + uint32_t lowat; }; VNET_DEFINE_STATIC(struct pf_syncookie_status, pf_syncookie_status); #define V_pf_syncookie_status VNET(pf_syncookie_status) @@ -242,7 +244,24 @@ pf_synflood_check(struct pf_pdesc *pd) if (pd->pf_mtag && (pd->pf_mtag->tag & PF_TAG_SYNCOOKIE_RECREATED)) return (0); - return (V_pf_status.syncookies_mode); + if (V_pf_status.syncookies_mode != PF_SYNCOOKIES_ADAPTIVE) + return (V_pf_status.syncookies_mode); + + if (!V_pf_status.syncookies_active && + atomic_load_32(&V_pf_status.states_halfopen) > + V_pf_syncookie_status.hiwat) { + /* We'd want to 'pf_syncookie_newkey()' here, but that requires + * the rules write lock, which we can't get with the read lock + * held. */ + callout_reset(&V_pf_syncookie_status.keytimeout, 0, + pf_syncookie_rotate, curvnet); + V_pf_status.syncookies_active = true; + DPFPRINTF(LOG_WARNING, + ("synflood detected, enabling syncookies\n")); + // XXXTODO V_pf_status.lcounters[LCNT_SYNFLOODS]++; + } + + return (V_pf_status.syncookies_active); } void @@ -257,6 +276,9 @@ pf_syncookie_send(struct mbuf *m, int off, struct pf_pdesc *pd) iss, ntohl(pd->hdr.tcp.th_seq) + 1, TH_SYN|TH_ACK, 0, mss, 0, 1, 0); counter_u64_add(V_pf_status.lcounters[KLCNT_SYNCOOKIES_SENT], 1); + /* XXX Maybe only in adaptive mode? */ + atomic_add_64(&V_pf_status.syncookies_inflight[V_pf_syncookie_status.oddeven], + 1); } uint8_t @@ -272,11 +294,17 @@ pf_syncookie_validate(struct pf_pdesc *pd) ack = ntohl(pd->hdr.tcp.th_ack) - 1; cookie.cookie = (ack & 0xff) ^ (ack >> 24); + /* we don't know oddeven before setting the cookie (union) */ + if (atomic_load_64(&V_pf_status.syncookies_inflight[cookie.flags.oddeven]) + == 0) + return (0); + hash = pf_syncookie_mac(pd, cookie, seq); if ((ack & ~0xff) != (hash & ~0xff)) return (0); counter_u64_add(V_pf_status.lcounters[KLCNT_SYNCOOKIES_VALID], 1); + atomic_add_64(&V_pf_status.syncookies_inflight[cookie.flags.oddeven], -1); return (1); } @@ -290,13 +318,22 @@ pf_syncookie_rotate(void *arg) CURVNET_SET((struct vnet *)arg); /* do we want to disable syncookies? */ - if (V_pf_status.syncookies_active) { + if (V_pf_status.syncookies_active && + ((V_pf_status.syncookies_mode == PF_SYNCOOKIES_ADAPTIVE && + (atomic_load_32(&V_pf_status.states_halfopen) + + atomic_load_64(&V_pf_status.syncookies_inflight[0]) + + atomic_load_64(&V_pf_status.syncookies_inflight[1])) < + V_pf_syncookie_status.lowat) || + V_pf_status.syncookies_mode == PF_SYNCOOKIES_NEVER) + ) { V_pf_status.syncookies_active = false; - DPFPRINTF(PF_DEBUG_MISC, ("syncookies disabled")); + DPFPRINTF(PF_DEBUG_MISC, ("syncookies disabled\n")); } /* nothing in flight any more? delete keys and return */ - if (!V_pf_status.syncookies_active) { + if (!V_pf_status.syncookies_active && + atomic_load_64(&V_pf_status.syncookies_inflight[0]) == 0 && + atomic_load_64(&V_pf_status.syncookies_inflight[1]) == 0) { memset(V_pf_syncookie_status.key[0], 0, PF_SYNCOOKIE_SECRET_SIZE); memset(V_pf_syncookie_status.key[1], 0, @@ -305,8 +342,10 @@ pf_syncookie_rotate(void *arg) return; } + PF_RULES_WLOCK(); /* new key, including timeout */ pf_syncookie_newkey(); + PF_RULES_WUNLOCK(); CURVNET_RESTORE(); } @@ -316,11 +355,13 @@ pf_syncookie_newkey(void) { PF_RULES_WASSERT(); + MPASS(V_pf_syncookie_status.oddeven < 2); V_pf_syncookie_status.oddeven = (V_pf_syncookie_status.oddeven + 1) & 0x1; + atomic_store_64(&V_pf_status.syncookies_inflight[V_pf_syncookie_status.oddeven], 0); arc4random_buf(V_pf_syncookie_status.key[V_pf_syncookie_status.oddeven], PF_SYNCOOKIE_SECRET_SIZE); callout_reset(&V_pf_syncookie_status.keytimeout, - PF_SYNCOOKIE_SECRET_LIFETIME, pf_syncookie_rotate, curvnet); + PF_SYNCOOKIE_SECRET_LIFETIME * hz, pf_syncookie_rotate, curvnet); } /* From owner-dev-commits-src-main@freebsd.org Wed Sep 29 13:42:31 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 24343674480; Wed, 29 Sep 2021 13:42:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HKHcQ63RRz3lvM; Wed, 29 Sep 2021 13:42:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8FEA218DFE; Wed, 29 Sep 2021 13:42:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18TDgURt001129; Wed, 29 Sep 2021 13:42:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18TDgUDY001128; Wed, 29 Sep 2021 13:42:30 GMT (envelope-from git) Date: Wed, 29 Sep 2021 13:42:30 GMT Message-Id: <202109291342.18TDgUDY001128@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: 955460d41e99 - main - pf: hook up adaptive mode configuration MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 955460d41e99031906841870e02063ffdf227f09 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Sep 2021 13:42:31 -0000 The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=955460d41e99031906841870e02063ffdf227f09 commit 955460d41e99031906841870e02063ffdf227f09 Author: Kristof Provost AuthorDate: 2021-07-24 12:23:59 +0000 Commit: Kristof Provost CommitDate: 2021-09-29 13:11:54 +0000 pf: hook up adaptive mode configuration The kernel side of pf syncookie adaptive mode configuration. MFC after: 1 week Sponsored by: Modirum MDPay Differential Revision: https://reviews.freebsd.org/D32135 --- sys/netpfil/pf/pf_syncookies.c | 56 ++++++++++++++++++++++++++---------------- 1 file changed, 35 insertions(+), 21 deletions(-) diff --git a/sys/netpfil/pf/pf_syncookies.c b/sys/netpfil/pf/pf_syncookies.c index 11093b636777..32b2bec6c3d6 100644 --- a/sys/netpfil/pf/pf_syncookies.c +++ b/sys/netpfil/pf/pf_syncookies.c @@ -85,6 +85,7 @@ #include #include +#include #define DPFPRINTF(n, x) if (V_pf_status.debug >= (n)) printf x @@ -147,7 +148,10 @@ pf_get_syncookies(struct pfioc_nv *nv) nvlist_add_bool(nvl, "enabled", V_pf_status.syncookies_mode != PF_SYNCOOKIES_NEVER); - nvlist_add_bool(nvl, "adaptive", false); + nvlist_add_bool(nvl, "adaptive", + V_pf_status.syncookies_mode == PF_SYNCOOKIES_ADAPTIVE); + nvlist_add_number(nvl, "highwater", V_pf_syncookie_status.hiwat); + nvlist_add_number(nvl, "lowwater", V_pf_syncookie_status.lowat); nvlpacked = nvlist_pack(nvl, &nv->len); if (nvlpacked == NULL) { @@ -174,6 +178,10 @@ pf_set_syncookies(struct pfioc_nv *nv) void *nvlpacked = NULL; int error; bool enabled, adaptive; + uint32_t hiwat, lowat; + uint8_t newmode; + +#define ERROUT(x) ERROUT_FUNCTION(errout, x) if (nv->len > pf_ioctl_maxcount) return (ENOMEM); @@ -183,38 +191,44 @@ pf_set_syncookies(struct pfioc_nv *nv) return (ENOMEM); error = copyin(nv->data, nvlpacked, nv->len); - if (error) { - free(nvlpacked, M_TEMP); - return (error); - } + if (error) + ERROUT(error); nvl = nvlist_unpack(nvlpacked, nv->len, 0); - if (nvl == NULL) { - free(nvlpacked, M_TEMP); - return (EBADMSG); - } + if (nvl == NULL) + ERROUT(EBADMSG); if (! nvlist_exists_bool(nvl, "enabled") - || ! nvlist_exists_bool(nvl, "adaptive")) { - nvlist_destroy(nvl); - free(nvlpacked, M_TEMP); - return (EBADMSG); - } + || ! nvlist_exists_bool(nvl, "adaptive")) + ERROUT(EBADMSG); enabled = nvlist_get_bool(nvl, "enabled"); adaptive = nvlist_get_bool(nvl, "adaptive"); + PFNV_CHK(pf_nvuint32_opt(nvl, "highwater", &hiwat, + V_pf_syncookie_status.hiwat)); + PFNV_CHK(pf_nvuint32_opt(nvl, "lowwater", &lowat, + V_pf_syncookie_status.lowat)); - if (adaptive) { - nvlist_destroy(nvl); - free(nvlpacked, M_TEMP); - return (ENOTSUP); - } + if (lowat >= hiwat) + ERROUT(EINVAL); + + newmode = PF_SYNCOOKIES_NEVER; + if (enabled) + newmode = adaptive ? PF_SYNCOOKIES_ADAPTIVE : PF_SYNCOOKIES_ALWAYS; PF_RULES_WLOCK(); - error = pf_syncookies_setmode(enabled ? - PF_SYNCOOKIES_ALWAYS : PF_SYNCOOKIES_NEVER); + error = pf_syncookies_setmode(newmode); + + V_pf_syncookie_status.lowat = lowat; + V_pf_syncookie_status.hiwat = hiwat; + PF_RULES_WUNLOCK(); +#undef ERROUT +errout: + nvlist_destroy(nvl); + free(nvlpacked, M_TEMP); + return (error); } From owner-dev-commits-src-main@freebsd.org Wed Sep 29 13:42:33 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 82066673CB1; Wed, 29 Sep 2021 13:42:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HKHcT1rhJz3ls5; Wed, 29 Sep 2021 13:42:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CF37F19404; Wed, 29 Sep 2021 13:42:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18TDgWCr001183; Wed, 29 Sep 2021 13:42:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18TDgWke001182; Wed, 29 Sep 2021 13:42:32 GMT (envelope-from git) Date: Wed, 29 Sep 2021 13:42:32 GMT Message-Id: <202109291342.18TDgWke001182@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: 20f015f08d66 - main - pf.conf: document syncookies MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 20f015f08d66d0d953e49245cb95c81c118b9ee9 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Sep 2021 13:42:33 -0000 The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=20f015f08d66d0d953e49245cb95c81c118b9ee9 commit 20f015f08d66d0d953e49245cb95c81c118b9ee9 Author: Kristof Provost AuthorDate: 2021-08-14 08:42:03 +0000 Commit: Kristof Provost CommitDate: 2021-09-29 13:41:49 +0000 pf.conf: document syncookies Reviewed by: bcr Obtained from: OpenBSD MFC after: 1 week Sponsored by: Modirum MDPay Differential Revision: https://reviews.freebsd.org/D32137 --- share/man/man5/pf.conf.5 | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/share/man/man5/pf.conf.5 b/share/man/man5/pf.conf.5 index 1bc7f147e830..9f69db70d90b 100644 --- a/share/man/man5/pf.conf.5 +++ b/share/man/man5/pf.conf.5 @@ -28,7 +28,7 @@ .\" ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.Dd September 10, 2021 +.Dd September 25, 2021 .Dt PF.CONF 5 .Os .Sh NAME @@ -539,6 +539,34 @@ For example: .Bd -literal -offset indent set state-policy if-bound .Ed +.It Ar set syncookies never | always | adaptive +When +.Cm syncookies +are active, pf will answer each incoming TCP SYN with a syncookie SYNACK, +without allocating any resources. +Upon reception of the client's ACK in response to the syncookie +SYNACK, pf will evaluate the ruleset and create state if the ruleset +permits it, complete the three way handshake with the target host and +continue the connection with synproxy in place. +This allows pf to be resilient against large synflood attacks which would +run the state table against its limits otherwise. +Due to the blind answers to every incoming SYN syncookies share the caveats of +synproxy, namely seemingly accepting connections that will be dropped later on. +.Pp +.Bl -tag -width adaptive -compact +.It Cm never +pf will never send syncookie SYNACKs (the default). +.It Cm always +pf will always send syncookie SYNACKs. +.It Cm adaptive +pf will enable syncookie mode when a given percentage of the state table +is used up by half-open TCP connections, as in, those that saw the initial +SYN but didn't finish the three way handshake. +The thresholds for entering and leaving syncookie mode can be specified using +.Bd -literal -offset indent +set syncookies adaptive (start 25%, end 12%) +.Ed +.El .It Ar set state-defaults The .Ar state-defaults From owner-dev-commits-src-main@freebsd.org Wed Sep 29 13:42:32 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0B5BD674481; Wed, 29 Sep 2021 13:42:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HKHcR6bsWz3m0w; Wed, 29 Sep 2021 13:42:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B6D11191A8; Wed, 29 Sep 2021 13:42:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18TDgVKI001153; Wed, 29 Sep 2021 13:42:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18TDgVTH001152; Wed, 29 Sep 2021 13:42:31 GMT (envelope-from git) Date: Wed, 29 Sep 2021 13:42:31 GMT Message-Id: <202109291342.18TDgVTH001152@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: 5062afff9de7 - main - pfctl: userspace adaptive syncookies configration MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5062afff9de7e67da96e3f0dcb9d8bbd5a4e1c5b Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Sep 2021 13:42:32 -0000 The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=5062afff9de7e67da96e3f0dcb9d8bbd5a4e1c5b commit 5062afff9de7e67da96e3f0dcb9d8bbd5a4e1c5b Author: Kristof Provost AuthorDate: 2021-08-13 11:42:59 +0000 Commit: Kristof Provost CommitDate: 2021-09-29 13:11:54 +0000 pfctl: userspace adaptive syncookies configration Hook up the userspace bits to configure syncookies in adaptive mode. MFC after: 1 week Sponsored by: Modirum MDPay Differential Revision: https://reviews.freebsd.org/D32136 --- lib/libpfctl/libpfctl.c | 55 ++++++++++++++++++++++++++++++++++++++++++----- lib/libpfctl/libpfctl.h | 6 +++++- sbin/pfctl/parse.y | 43 ++++++++++++++++++++++++++++++++++-- sbin/pfctl/pfctl.c | 51 ++++++++++++++++++++++++++++++++++++++++++- sbin/pfctl/pfctl_parser.c | 5 +++-- sbin/pfctl/pfctl_parser.h | 8 +++++++ sys/net/pfvar.h | 3 +++ 7 files changed, 160 insertions(+), 11 deletions(-) diff --git a/lib/libpfctl/libpfctl.c b/lib/libpfctl/libpfctl.c index 576b256155fb..aaf5998ed0d6 100644 --- a/lib/libpfctl/libpfctl.c +++ b/lib/libpfctl/libpfctl.c @@ -50,6 +50,12 @@ #include "libpfctl.h" +const char* PFCTL_SYNCOOKIES_MODE_NAMES[] = { + "never", + "always", + "adaptive" +}; + static int _pfctl_clear_states(int , const struct pfctl_kill *, unsigned int *, uint64_t); @@ -938,17 +944,40 @@ pfctl_kill_states(int dev, const struct pfctl_kill *kill, unsigned int *killed) return (_pfctl_clear_states(dev, kill, killed, DIOCKILLSTATESNV)); } +static int +pfctl_get_limit(int dev, const int index, u_int *limit) +{ + struct pfioc_limit pl; + + bzero(&pl, sizeof(pl)); + pl.index = index; + + if (ioctl(dev, DIOCGETLIMIT, &pl) == -1) + return (errno); + + *limit = pl.limit; + + return (0); +} + int pfctl_set_syncookies(int dev, const struct pfctl_syncookies *s) { struct pfioc_nv nv; nvlist_t *nvl; int ret; + u_int state_limit; + + ret = pfctl_get_limit(dev, PF_LIMIT_STATES, &state_limit); + if (ret != 0) + return (ret); nvl = nvlist_create(0); nvlist_add_bool(nvl, "enabled", s->mode != PFCTL_SYNCOOKIES_NEVER); - nvlist_add_bool(nvl, "adaptive", false); /* XXX TODO */ + nvlist_add_bool(nvl, "adaptive", s->mode == PFCTL_SYNCOOKIES_ADAPTIVE); + nvlist_add_number(nvl, "highwater", state_limit * s->highwater / 100); + nvlist_add_number(nvl, "lowwater", state_limit * s->lowwater / 100); nv.data = nvlist_pack(nvl, &nv.len); nv.size = nv.len; @@ -966,12 +995,18 @@ pfctl_get_syncookies(int dev, struct pfctl_syncookies *s) { struct pfioc_nv nv; nvlist_t *nvl; - bool enabled, adaptive; + int ret; + u_int state_limit; + bool enabled, adaptive; + + ret = pfctl_get_limit(dev, PF_LIMIT_STATES, &state_limit); + if (ret != 0) + return (ret); bzero(s, sizeof(*s)); - nv.data = malloc(128); - nv.len = nv.size = 128; + nv.data = malloc(256); + nv.len = nv.size = 256; if (ioctl(dev, DIOCGETSYNCOOKIES, &nv)) { free(nv.data); @@ -987,7 +1022,17 @@ pfctl_get_syncookies(int dev, struct pfctl_syncookies *s) enabled = nvlist_get_bool(nvl, "enabled"); adaptive = nvlist_get_bool(nvl, "adaptive"); - s->mode = enabled ? PFCTL_SYNCOOKIES_ALWAYS : PFCTL_SYNCOOKIES_NEVER; + if (enabled) { + if (adaptive) + s->mode = PFCTL_SYNCOOKIES_ADAPTIVE; + else + s->mode = PFCTL_SYNCOOKIES_ALWAYS; + } else { + s->mode = PFCTL_SYNCOOKIES_NEVER; + } + + s->highwater = nvlist_get_number(nvl, "highwater") * 100 / state_limit; + s->lowwater = nvlist_get_number(nvl, "lowwater") * 100 / state_limit; nvlist_destroy(nvl); diff --git a/lib/libpfctl/libpfctl.h b/lib/libpfctl/libpfctl.h index f57497b4a88a..1f7259ee8d32 100644 --- a/lib/libpfctl/libpfctl.h +++ b/lib/libpfctl/libpfctl.h @@ -276,11 +276,15 @@ struct pfctl_states { enum pfctl_syncookies_mode { PFCTL_SYNCOOKIES_NEVER, - PFCTL_SYNCOOKIES_ALWAYS + PFCTL_SYNCOOKIES_ALWAYS, + PFCTL_SYNCOOKIES_ADAPTIVE }; +extern const char* PFCTL_SYNCOOKIES_MODE_NAMES[]; struct pfctl_syncookies { enum pfctl_syncookies_mode mode; + uint8_t highwater; /* Percent */ + uint8_t lowwater; /* Percent */ }; struct pfctl_status* pfctl_get_status(int dev); diff --git a/sbin/pfctl/parse.y b/sbin/pfctl/parse.y index 6bcf5a0bc397..89d5f330da47 100644 --- a/sbin/pfctl/parse.y +++ b/sbin/pfctl/parse.y @@ -320,6 +320,7 @@ static struct codel_opts codel_opts; static struct node_hfsc_opts hfsc_opts; static struct node_fairq_opts fairq_opts; static struct node_state_opt *keep_state_defaults = NULL; +static struct pfctl_watermarks syncookie_opts; int disallow_table(struct node_host *, const char *); int disallow_urpf_failed(struct node_host *, const char *); @@ -445,6 +446,7 @@ typedef struct { struct node_hfsc_opts hfsc_opts; struct node_fairq_opts fairq_opts; struct codel_opts codel_opts; + struct pfctl_watermarks *watermarks; } v; int lineno; } YYSTYPE; @@ -531,6 +533,7 @@ int parseport(char *, struct range *r, int); %type pool_opts pool_opt pool_opts_l %type tagged %type rtable +%type syncookie_opts %% ruleset : /* empty */ @@ -729,14 +732,19 @@ option : SET OPTIMIZATION STRING { | SET KEEPCOUNTERS { pf->keep_counters = true; } - | SET SYNCOOKIES syncookie_val { - pf->syncookies = $3; + | SET SYNCOOKIES syncookie_val syncookie_opts { + if (pfctl_cfg_syncookies(pf, $3, $4)) { + yyerror("error setting syncookies"); + YYERROR; + } } ; syncookie_val : STRING { if (!strcmp($1, "never")) $$ = PFCTL_SYNCOOKIES_NEVER; + else if (!strcmp($1, "adaptive")) + $$ = PFCTL_SYNCOOKIES_ADAPTIVE; else if (!strcmp($1, "always")) $$ = PFCTL_SYNCOOKIES_ALWAYS; else { @@ -745,6 +753,37 @@ syncookie_val : STRING { } } ; +syncookie_opts : /* empty */ { $$ = NULL; } + | { + memset(&syncookie_opts, 0, sizeof(syncookie_opts)); + } '(' syncookie_opt_l ')' { $$ = &syncookie_opts; } + ; + +syncookie_opt_l : syncookie_opt_l comma syncookie_opt + | syncookie_opt + ; + +syncookie_opt : STRING STRING { + double val; + char *cp; + + val = strtod($2, &cp); + if (cp == NULL || strcmp(cp, "%")) + YYERROR; + if (val <= 0 || val > 100) { + yyerror("illegal percentage value"); + YYERROR; + } + if (!strcmp($1, "start")) { + syncookie_opts.hi = val; + } else if (!strcmp($1, "end")) { + syncookie_opts.lo = val; + } else { + yyerror("illegal syncookie option"); + YYERROR; + } + } + ; stringall : STRING { $$ = $1; } | ALL { diff --git a/sbin/pfctl/pfctl.c b/sbin/pfctl/pfctl.c index 8f3698e398f6..d7bde0012e9b 100644 --- a/sbin/pfctl/pfctl.c +++ b/sbin/pfctl/pfctl.c @@ -1812,6 +1812,10 @@ pfctl_init_options(struct pfctl *pf) pf->limit[PF_LIMIT_TABLE_ENTRIES] = PFR_KENTRY_HIWAT; pf->debug = PF_DEBUG_URGENT; + + pf->syncookies = false; + pf->syncookieswat[0] = PF_SYNCOOKIES_LOWATPCT; + pf->syncookieswat[1] = PF_SYNCOOKIES_HIWATPCT; } int @@ -2069,7 +2073,9 @@ pfctl_load_syncookies(struct pfctl *pf, u_int8_t val) bzero(&cookies, sizeof(cookies)); - cookies.mode = val ? PFCTL_SYNCOOKIES_ALWAYS : PFCTL_SYNCOOKIES_NEVER; + cookies.mode = val; + cookies.lowwater = pf->syncookieswat[0]; + cookies.highwater = pf->syncookieswat[1]; if (pfctl_set_syncookies(dev, &cookies)) { warnx("DIOCSETSYNCOOKIES"); @@ -2078,6 +2084,49 @@ pfctl_load_syncookies(struct pfctl *pf, u_int8_t val) return (0); } +int +pfctl_cfg_syncookies(struct pfctl *pf, uint8_t val, struct pfctl_watermarks *w) +{ + if (val != PF_SYNCOOKIES_ADAPTIVE && w != NULL) { + warnx("syncookies start/end only apply to adaptive"); + return (1); + } + if (val == PF_SYNCOOKIES_ADAPTIVE && w != NULL) { + if (!w->hi) + w->hi = PF_SYNCOOKIES_HIWATPCT; + if (!w->lo) + w->lo = w->hi / 2; + if (w->lo >= w->hi) { + warnx("start must be higher than end"); + return (1); + } + pf->syncookieswat[0] = w->lo; + pf->syncookieswat[1] = w->hi; + pf->syncookieswat_set = 1; + } + + if (pf->opts & PF_OPT_VERBOSE) { + if (val == PF_SYNCOOKIES_NEVER) + printf("set syncookies never\n"); + else if (val == PF_SYNCOOKIES_ALWAYS) + printf("set syncookies always\n"); + else if (val == PF_SYNCOOKIES_ADAPTIVE) { + if (pf->syncookieswat_set) + printf("set syncookies adaptive (start %u%%, " + "end %u%%)\n", pf->syncookieswat[1], + pf->syncookieswat[0]); + else + printf("set syncookies adaptive\n"); + } else { /* cannot happen */ + warnx("king bula ate all syncookies"); + return (1); + } + } + + pf->syncookies = val; + return (0); +} + int pfctl_set_debug(struct pfctl *pf, char *d) { diff --git a/sbin/pfctl/pfctl_parser.c b/sbin/pfctl/pfctl_parser.c index 131ad22123e2..91a3a38ef016 100644 --- a/sbin/pfctl/pfctl_parser.c +++ b/sbin/pfctl/pfctl_parser.c @@ -50,6 +50,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -618,9 +619,9 @@ print_status(struct pfctl_status *s, struct pfctl_syncookies *cookies, int opts) } printf("Syncookies\n"); + assert(cookies->mode <= PFCTL_SYNCOOKIES_ADAPTIVE); printf(" %-25s %s\n", "mode", - cookies->mode == PFCTL_SYNCOOKIES_NEVER ? - "never" : "always"); + PFCTL_SYNCOOKIES_MODE_NAMES[cookies->mode]); } } diff --git a/sbin/pfctl/pfctl_parser.h b/sbin/pfctl/pfctl_parser.h index 12a66e1ae710..484830c61791 100644 --- a/sbin/pfctl/pfctl_parser.h +++ b/sbin/pfctl/pfctl_parser.h @@ -101,6 +101,8 @@ struct pfctl { char *ifname; bool keep_counters; u_int8_t syncookies; + u_int8_t syncookieswat[2]; /* lowat, highwat, in % */ + u_int8_t syncookieswat_set; u_int8_t timeout_set[PFTM_MAX]; u_int8_t limit_set[PF_LIMIT_MAX]; @@ -200,6 +202,11 @@ struct pfctl_altq { } meta; }; +struct pfctl_watermarks { + uint32_t hi; + uint32_t lo; +}; + #ifdef __FreeBSD__ /* * XXX @@ -270,6 +277,7 @@ int pfctl_set_logif(struct pfctl *, char *); int pfctl_set_hostid(struct pfctl *, u_int32_t); int pfctl_set_debug(struct pfctl *, char *); int pfctl_set_interface_flags(struct pfctl *, char *, int, int); +int pfctl_cfg_syncookies(struct pfctl *, uint8_t, struct pfctl_watermarks *); int parse_config(char *, struct pfctl *); int parse_flags(char *); diff --git a/sys/net/pfvar.h b/sys/net/pfvar.h index 90ef19c59172..ba5a2d341172 100644 --- a/sys/net/pfvar.h +++ b/sys/net/pfvar.h @@ -1386,6 +1386,9 @@ enum pf_syncookies_mode { PF_SYNCOOKIES_MODE_MAX = PF_SYNCOOKIES_ADAPTIVE }; +#define PF_SYNCOOKIES_HIWATPCT 25 +#define PF_SYNCOOKIES_LOWATPCT (PF_SYNCOOKIES_HIWATPCT / 2) + #ifdef _KERNEL struct pf_kstatus { counter_u64_t counters[PFRES_MAX]; /* reason for passing/dropping */ From owner-dev-commits-src-main@freebsd.org Wed Sep 29 13:42:35 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id EC4636742CF; Wed, 29 Sep 2021 13:42:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HKHcW3BqBz3lq3; Wed, 29 Sep 2021 13:42:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1F89919405; Wed, 29 Sep 2021 13:42:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18TDgZMd001232; Wed, 29 Sep 2021 13:42:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18TDgZxO001231; Wed, 29 Sep 2021 13:42:35 GMT (envelope-from git) Date: Wed, 29 Sep 2021 13:42:35 GMT Message-Id: <202109291342.18TDgZxO001231@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: 2f20d80692ce - main - pf tests: Basic adaptive mode syncookie test MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2f20d80692ceb584842a7642562fc9f610a5b661 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Sep 2021 13:42:36 -0000 The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=2f20d80692ceb584842a7642562fc9f610a5b661 commit 2f20d80692ceb584842a7642562fc9f610a5b661 Author: Kristof Provost AuthorDate: 2021-09-25 13:05:02 +0000 Commit: Kristof Provost CommitDate: 2021-09-29 13:42:01 +0000 pf tests: Basic adaptive mode syncookie test MFC after: 1 week Sponsored by: Modirum MDPay Differential Revision: https://reviews.freebsd.org/D32139 --- tests/sys/netpfil/pf/syncookie.sh | 50 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) diff --git a/tests/sys/netpfil/pf/syncookie.sh b/tests/sys/netpfil/pf/syncookie.sh index 8a4005d0fc6d..d85beac1a4d1 100644 --- a/tests/sys/netpfil/pf/syncookie.sh +++ b/tests/sys/netpfil/pf/syncookie.sh @@ -168,9 +168,59 @@ nostate_cleanup() pft_cleanup } +atf_test_case "adaptive" "cleanup" +adaptive_head() +{ + atf_set descr 'Adaptive mode test' + atf_set require.user root + atf_set require.progs scapy +} + +adaptive_body() +{ + pft_init + + epair=$(vnet_mkepair) + ifconfig ${epair}a 192.0.2.2/24 up + + vnet_mkjail alcatraz ${epair}b + jexec alcatraz ifconfig ${epair}b 192.0.2.1/24 up + + jexec alcatraz pfctl -e + pft_set_rules alcatraz \ + "set limit states 100" \ + "set syncookies adaptive (start 10%%, end 5%%)" \ + "pass in" \ + "pass out" + + # Sanity check + atf_check -s exit:0 -o ignore ping -c 1 192.0.2.1 + + # Now syn flood to create many states + ${common_dir}/pft_synflood.py \ + --sendif ${epair}a \ + --to 192.0.2.2 \ + --count 100 + + # Adaptive mode should kick in and stop us from creating more than + # about 10 states + states=$(jexec alcatraz pfctl -ss | grep tcp | wc -l) + if [ "$states" -gt 20 ]; + then + echo "$states" + atf_fail "Found unexpected states" + fi +} + +adaptive_cleanup() +{ + pft_cleanup +} + atf_init_test_cases() { atf_add_test_case "basic" atf_add_test_case "forward" atf_add_test_case "nostate" + atf_add_test_case "adaptive" } From owner-dev-commits-src-main@freebsd.org Wed Sep 29 13:42:34 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 860B767412C; Wed, 29 Sep 2021 13:42:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HKHcV0lWpz3m10; Wed, 29 Sep 2021 13:42:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EB5FF19119; Wed, 29 Sep 2021 13:42:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18TDgXBn001208; Wed, 29 Sep 2021 13:42:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18TDgXAS001207; Wed, 29 Sep 2021 13:42:33 GMT (envelope-from git) Date: Wed, 29 Sep 2021 13:42:33 GMT Message-Id: <202109291342.18TDgXAS001207@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: dc0636636bb1 - main - pf tests: Basic syncookie test MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: dc0636636bb1937283d4f218732ac2357f4ec4f1 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Sep 2021 13:42:34 -0000 The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=dc0636636bb1937283d4f218732ac2357f4ec4f1 commit dc0636636bb1937283d4f218732ac2357f4ec4f1 Author: Kristof Provost AuthorDate: 2021-07-10 11:20:44 +0000 Commit: Kristof Provost CommitDate: 2021-09-29 13:42:01 +0000 pf tests: Basic syncookie test MFC after: 1 week Sponsored by: Modirum MDPay Differential Revision: https://reviews.freebsd.org/D32138 --- tests/sys/netpfil/pf/syncookie.sh | 43 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/tests/sys/netpfil/pf/syncookie.sh b/tests/sys/netpfil/pf/syncookie.sh index 49acd9fab11d..8a4005d0fc6d 100644 --- a/tests/sys/netpfil/pf/syncookie.sh +++ b/tests/sys/netpfil/pf/syncookie.sh @@ -29,6 +29,48 @@ common_dir=$(atf_get_srcdir)/../common +atf_test_case "basic" "cleanup" +basic_head() +{ + atf_set descr 'Basic syncookie test' + atf_set require.user root +} + +basic_body() +{ + pft_init + + epair=$(vnet_mkepair) + + vnet_mkjail alcatraz ${epair}b + jexec alcatraz ifconfig ${epair}b 192.0.2.1/24 up + jexec alcatraz /usr/sbin/inetd -p inetd-alcatraz.pid \ + $(atf_get_srcdir)/echo_inetd.conf + + ifconfig ${epair}a 192.0.2.2/24 up + + jexec alcatraz pfctl -e + pft_set_rules alcatraz \ + "set syncookies always" \ + "pass in" \ + "pass out" + + # Sanity check + atf_check -s exit:0 -o ignore ping -c 1 192.0.2.1 + + reply=$(echo foo | nc -N -w 5 192.0.2.1 7) + if [ "${reply}" != "foo" ]; + then + atf_fail "Failed to connect to syncookie protected echo daemon" + fi +} + +basic_cleanup() +{ + rm -f inetd-alcatraz.pid + pft_cleanup +} + atf_test_case "forward" "cleanup" forward_head() { @@ -128,6 +170,7 @@ nostate_cleanup() atf_init_test_cases() { + atf_add_test_case "basic" atf_add_test_case "forward" atf_add_test_case "nostate" } From owner-dev-commits-src-main@freebsd.org Wed Sep 29 13:50:53 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id ABD95674669; Wed, 29 Sep 2021 13:50:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HKHp54PbXz3mXl; Wed, 29 Sep 2021 13:50:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 773571942B; Wed, 29 Sep 2021 13:50:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18TDoreN010170; Wed, 29 Sep 2021 13:50:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18TDor9B010169; Wed, 29 Sep 2021 13:50:53 GMT (envelope-from git) Date: Wed, 29 Sep 2021 13:50:53 GMT Message-Id: <202109291350.18TDor9B010169@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: 9589362bc980 - main - syslogd: Fix bug that caused -N to drop SecureMode if specified after -s MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9589362bc980290ff84fe61814e5716dea79e931 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Sep 2021 13:50:53 -0000 The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=9589362bc980290ff84fe61814e5716dea79e931 commit 9589362bc980290ff84fe61814e5716dea79e931 Author: jfranklin13 AuthorDate: 2021-09-28 14:49:15 +0000 Commit: Mark Johnston CommitDate: 2021-09-29 13:44:11 +0000 syslogd: Fix bug that caused -N to drop SecureMode if specified after -s MFC after: 2 weeks Pull Request: https://github.com/freebsd/freebsd-src/pull/541 --- usr.sbin/syslogd/syslogd.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/usr.sbin/syslogd/syslogd.c b/usr.sbin/syslogd/syslogd.c index dc07d4781553..5c2555480d3f 100644 --- a/usr.sbin/syslogd/syslogd.c +++ b/usr.sbin/syslogd/syslogd.c @@ -677,7 +677,8 @@ main(int argc, char *argv[]) break; case 'N': NoBind = 1; - SecureMode = 1; + if (!SecureMode) + SecureMode = 1; break; case 'n': resolve = 0; From owner-dev-commits-src-main@freebsd.org Wed Sep 29 13:55:29 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 07B2F674ABB; Wed, 29 Sep 2021 13:55:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HKHvN6brkz3n5H; Wed, 29 Sep 2021 13:55:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C3C4719591; Wed, 29 Sep 2021 13:55:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18TDtSf6014688; Wed, 29 Sep 2021 13:55:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18TDtSE6014687; Wed, 29 Sep 2021 13:55:28 GMT (envelope-from git) Date: Wed, 29 Sep 2021 13:55:28 GMT Message-Id: <202109291355.18TDtSE6014687@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 1269873159c7 - main - LinuxKPI: fix build MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 1269873159c7fa0db3b9dbf8dadc54eec5dc0d58 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Sep 2021 13:55:29 -0000 The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=1269873159c7fa0db3b9dbf8dadc54eec5dc0d58 commit 1269873159c7fa0db3b9dbf8dadc54eec5dc0d58 Author: Bjoern A. Zeeb AuthorDate: 2021-09-29 13:50:12 +0000 Commit: Bjoern A. Zeeb CommitDate: 2021-09-29 13:50:12 +0000 LinuxKPI: fix build Add a missing "static" for non-{i386,amd64,arm64} which was missed in c39eefe715b3c835ce3d91a1c1932197c23c1f3c. This should ifx the builds. Sponsored by: The FreeBSD Foundation MFC after: 7 days X-MFC with: c39eefe715b3c835ce3d91a1c1932197c23c1f3c --- sys/compat/linuxkpi/common/src/linux_pci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/compat/linuxkpi/common/src/linux_pci.c b/sys/compat/linuxkpi/common/src/linux_pci.c index 5e527fdf0f4b..73c9b67bbedb 100644 --- a/sys/compat/linuxkpi/common/src/linux_pci.c +++ b/sys/compat/linuxkpi/common/src/linux_pci.c @@ -849,7 +849,7 @@ linux_dma_map_phys_common(struct device *dev, vm_paddr_t phys, size_t len, return (obj->dma_addr); } #else -dma_addr_t +static dma_addr_t linux_dma_map_phys_common(struct device *dev __unused, vm_paddr_t phys, size_t len __unused, bus_dma_tag_t dmat __unused) { From owner-dev-commits-src-main@freebsd.org Wed Sep 29 14:02:44 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 59479674E44; Wed, 29 Sep 2021 14:02:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HKJ3m22xJz3nwv; Wed, 29 Sep 2021 14:02:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 26AE51988C; Wed, 29 Sep 2021 14:02:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18TE2iIm029565; Wed, 29 Sep 2021 14:02:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18TE2iaN029564; Wed, 29 Sep 2021 14:02:44 GMT (envelope-from git) Date: Wed, 29 Sep 2021 14:02:44 GMT Message-Id: <202109291402.18TE2iaN029564@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ed Maste Subject: git: 5aa9f8dae3d4 - main - mgb: Use MGB_DEBUG instead of DEBUG MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5aa9f8dae3d40e1780a688ce01401e799b25e7c3 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Sep 2021 14:02:44 -0000 The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=5aa9f8dae3d40e1780a688ce01401e799b25e7c3 commit 5aa9f8dae3d40e1780a688ce01401e799b25e7c3 Author: Ed Maste AuthorDate: 2021-09-29 13:59:10 +0000 Commit: Ed Maste CommitDate: 2021-09-29 14:00:55 +0000 mgb: Use MGB_DEBUG instead of DEBUG The debug register dump routine is not hooked up and is really only useful to driver developers, so put it under an mgb-specific MGB_DEBUG rather than general DEBUG. MFC after: 1 week Fixes: 8890ab7758b8 ("Introduce if_mgb driver...") Sponsored by: The FreeBSD Foundation --- sys/dev/mgb/if_mgb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/mgb/if_mgb.c b/sys/dev/mgb/if_mgb.c index bc944c92625c..c62b666f098b 100644 --- a/sys/dev/mgb/if_mgb.c +++ b/sys/dev/mgb/if_mgb.c @@ -620,7 +620,7 @@ mgb_init(if_ctx_t ctx) error); } -#ifdef DEBUG +#ifdef MGB_DEBUG static void mgb_dump_some_stats(struct mgb_softc *sc) { From owner-dev-commits-src-main@freebsd.org Wed Sep 29 14:20:05 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 336AE6751A5; Wed, 29 Sep 2021 14:20:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HKJRn0fYrz3pgw; Wed, 29 Sep 2021 14:20:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EAD9519923; Wed, 29 Sep 2021 14:20:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18TEK4jX045657; Wed, 29 Sep 2021 14:20:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18TEK4HD045653; Wed, 29 Sep 2021 14:20:04 GMT (envelope-from git) Date: Wed, 29 Sep 2021 14:20:04 GMT Message-Id: <202109291420.18TEK4HD045653@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Marcin Wojtas Subject: git: d78e464d2330 - main - sdhci_xenon: split driver file into generic file and fdt parts MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mw X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d78e464d23304084be17cb8db8981558f2829d6c Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Sep 2021 14:20:05 -0000 The branch main has been updated by mw: URL: https://cgit.FreeBSD.org/src/commit/?id=d78e464d23304084be17cb8db8981558f2829d6c commit d78e464d23304084be17cb8db8981558f2829d6c Author: Bartlomiej Grzesik AuthorDate: 2021-07-15 12:29:15 +0000 Commit: Marcin Wojtas CommitDate: 2021-09-29 14:19:28 +0000 sdhci_xenon: split driver file into generic file and fdt parts This patch splits driver code into two seperate files sdhci_xenon.c and sdhci_xenon_fdt.c. This will allow future implementation of ACPI discovery of sdhci on Xenon chips. Reviewed by: mw Sponsored by: Semihalf Differential revision: https://reviews.freebsd.org/D31599 --- sys/conf/files.arm64 | 3 +- sys/dev/sdhci/sdhci_xenon.c | 206 ++++++++++++---------------------------- sys/dev/sdhci/sdhci_xenon.h | 29 ++++++ sys/dev/sdhci/sdhci_xenon_fdt.c | 173 +++++++++++++++++++++++++++++++++ 4 files changed, 264 insertions(+), 147 deletions(-) diff --git a/sys/conf/files.arm64 b/sys/conf/files.arm64 index 2362c7817025..0d33e315db65 100644 --- a/sys/conf/files.arm64 +++ b/sys/conf/files.arm64 @@ -274,7 +274,8 @@ dev/psci/smccc.c standard dev/safexcel/safexcel.c optional safexcel fdt -dev/sdhci/sdhci_xenon.c optional sdhci_xenon sdhci fdt +dev/sdhci/sdhci_xenon.c optional sdhci_xenon sdhci +dev/sdhci/sdhci_xenon_fdt.c optional sdhci_xenon sdhci fdt dev/uart/uart_cpu_arm64.c optional uart dev/uart/uart_dev_mu.c optional uart uart_mu diff --git a/sys/dev/sdhci/sdhci_xenon.c b/sys/dev/sdhci/sdhci_xenon.c index d88514d8fd8f..6dc0974c4e4e 100644 --- a/sys/dev/sdhci/sdhci_xenon.c +++ b/sys/dev/sdhci/sdhci_xenon.c @@ -48,17 +48,12 @@ __FBSDID("$FreeBSD$"); #include #include -#include -#include -#include #include -#include #include #include #include -#include #include #include "mmcbr_if.h" @@ -69,34 +64,6 @@ __FBSDID("$FreeBSD$"); #define MAX_SLOTS 6 -static struct ofw_compat_data compat_data[] = { - { "marvell,armada-3700-sdhci", 1 }, -#ifdef SOC_MARVELL_8K - { "marvell,armada-cp110-sdhci", 1 }, - { "marvell,armada-ap806-sdhci", 1 }, - { "marvell,armada-ap807-sdhci", 1 }, -#endif - { NULL, 0 } -}; - -struct sdhci_xenon_softc { - device_t dev; /* Controller device */ - int slot_id; /* Controller ID */ - phandle_t node; /* FDT node */ - struct resource *irq_res; /* IRQ resource */ - void *intrhand; /* Interrupt handle */ - struct sdhci_fdt_gpio *gpio; /* GPIO pins for CD detection. */ - - struct sdhci_slot *slot; /* SDHCI internal data */ - struct resource *mem_res; /* Memory resource */ - - uint8_t znr; /* PHY ZNR */ - uint8_t zpr; /* PHY ZPR */ - bool slow_mode; /* PHY slow mode */ - - struct mmc_helper mmc_helper; /* MMC helper for parsing FDT */ -}; - static uint8_t sdhci_xenon_read_1(device_t dev, struct sdhci_slot *slot __unused, bus_size_t off) @@ -182,16 +149,7 @@ sdhci_xenon_get_ro(device_t bus, device_t dev) { struct sdhci_xenon_softc *sc = device_get_softc(bus); - return (sdhci_generic_get_ro(bus, dev) ^ - (sc->mmc_helper.props & MMC_PROP_WP_INVERTED)); -} - -static bool -sdhci_xenon_get_card_present(device_t dev, struct sdhci_slot *slot) -{ - struct sdhci_xenon_softc *sc = device_get_softc(dev); - - return (sdhci_fdt_gpio_get_present(sc->gpio)); + return (sdhci_generic_get_ro(bus, dev) ^ sc->wp_inverted); } static void @@ -387,19 +345,19 @@ sdhci_xenon_update_ios(device_t brdev, device_t reqdev) if (bootverbose) device_printf(sc->dev, "Powering down sd/mmc\n"); - if (sc->mmc_helper.vmmc_supply) - regulator_disable(sc->mmc_helper.vmmc_supply); - if (sc->mmc_helper.vqmmc_supply) - regulator_disable(sc->mmc_helper.vqmmc_supply); + if (sc->vmmc_supply) + regulator_disable(sc->vmmc_supply); + if (sc->vqmmc_supply) + regulator_disable(sc->vqmmc_supply); break; case power_up: if (bootverbose) device_printf(sc->dev, "Powering up sd/mmc\n"); - if (sc->mmc_helper.vmmc_supply) - regulator_enable(sc->mmc_helper.vmmc_supply); - if (sc->mmc_helper.vqmmc_supply) - regulator_enable(sc->mmc_helper.vqmmc_supply); + if (sc->vmmc_supply) + regulator_enable(sc->vmmc_supply); + if (sc->vqmmc_supply) + regulator_enable(sc->vqmmc_supply); break; }; @@ -432,8 +390,8 @@ sdhci_xenon_switch_vccq(device_t brdev, device_t reqdev) sc = device_get_softc(brdev); - if (sc->mmc_helper.vqmmc_supply == NULL) - return EOPNOTSUPP; + if (sc->vqmmc_supply == NULL && !sc->skip_regulators) + return (EOPNOTSUPP); err = 0; @@ -445,15 +403,17 @@ sdhci_xenon_switch_vccq(device_t brdev, device_t reqdev) hostctrl2 &= ~SDHCI_CTRL2_S18_ENABLE; bus_write_2(sc->mem_res, SDHCI_HOST_CONTROL2, hostctrl2); - uvolt = 3300000; - err = regulator_set_voltage(sc->mmc_helper.vqmmc_supply, - uvolt, uvolt); - if (err != 0) { - device_printf(sc->dev, - "Cannot set vqmmc to %d<->%d\n", - uvolt, - uvolt); - return (err); + if (!sc->skip_regulators) { + uvolt = 3300000; + err = regulator_set_voltage(sc->vqmmc_supply, + uvolt, uvolt); + if (err != 0) { + device_printf(sc->dev, + "Cannot set vqmmc to %d<->%d\n", + uvolt, + uvolt); + return (err); + } } /* @@ -466,25 +426,27 @@ sdhci_xenon_switch_vccq(device_t brdev, device_t reqdev) hostctrl2 = bus_read_2(sc->mem_res, SDHCI_HOST_CONTROL2); if (!(hostctrl2 & SDHCI_CTRL2_S18_ENABLE)) return (0); - return EAGAIN; + return (EAGAIN); case vccq_180: if (!(slot->host.caps & MMC_CAP_SIGNALING_180)) { - return EINVAL; + return (EINVAL); } if (hostctrl2 & SDHCI_CTRL2_S18_ENABLE) return (0); hostctrl2 |= SDHCI_CTRL2_S18_ENABLE; bus_write_2(sc->mem_res, SDHCI_HOST_CONTROL2, hostctrl2); - uvolt = 1800000; - err = regulator_set_voltage(sc->mmc_helper.vqmmc_supply, - uvolt, uvolt); - if (err != 0) { - device_printf(sc->dev, - "Cannot set vqmmc to %d<->%d\n", - uvolt, - uvolt); - return (err); + if (!sc->skip_regulators) { + uvolt = 1800000; + err = regulator_set_voltage(sc->vqmmc_supply, + uvolt, uvolt); + if (err != 0) { + device_printf(sc->dev, + "Cannot set vqmmc to %d<->%d\n", + uvolt, + uvolt); + return (err); + } } /* @@ -497,62 +459,46 @@ sdhci_xenon_switch_vccq(device_t brdev, device_t reqdev) hostctrl2 = bus_read_2(sc->mem_res, SDHCI_HOST_CONTROL2); if (hostctrl2 & SDHCI_CTRL2_S18_ENABLE) return (0); - return EAGAIN; + return (EAGAIN); default: device_printf(brdev, "Attempt to set unsupported signaling voltage\n"); - return EINVAL; + return (EINVAL); } } static void -sdhci_xenon_fdt_parse(device_t dev, struct sdhci_slot *slot) +sdhci_xenon_parse_prop(device_t dev) { - struct sdhci_xenon_softc *sc = device_get_softc(dev); - pcell_t cid; + struct sdhci_xenon_softc *sc; + uint64_t val; - mmc_fdt_parse(dev, 0, &sc->mmc_helper, &slot->host); + sc = device_get_softc(dev); + val = 0; - /* Allow dts to patch quirks, slots, and max-frequency. */ - if ((OF_getencprop(sc->node, "quirks", &cid, sizeof(cid))) > 0) - slot->quirks = cid; - if (OF_hasprop(sc->node, "marvell,xenon-phy-slow-mode")) - sc->slow_mode = true; + if (device_get_property(dev, "quirks", &val, sizeof(val)) > 0) + sc->slot->quirks = val; sc->znr = XENON_ZNR_DEF_VALUE; - if ((OF_getencprop(sc->node, "marvell,xenon-phy-znr", &cid, - sizeof(cid))) > 0) - sc->znr = cid & XENON_ZNR_MASK; + if (device_get_property(dev, "marvell,xenon-phy-znr", + &val, sizeof(val)) > 0) + sc->znr = val & XENON_ZNR_MASK; sc->zpr = XENON_ZPR_DEF_VALUE; - if ((OF_getencprop(sc->node, "marvell,xenon-phy-zpr", &cid, - sizeof(cid))) > 0) - sc->zpr = cid & XENON_ZPR_MASK; -} - -static int -sdhci_xenon_probe(device_t dev) -{ - if (!ofw_bus_status_okay(dev)) - return (ENXIO); - - if (ofw_bus_search_compatible(dev, compat_data)->ocd_data == 0) - return (ENXIO); - - device_set_desc(dev, "Armada Xenon SDHCI controller"); - - return (0); + if (device_get_property(dev, "marvell,xenon-phy-zpr", + &val, sizeof(val)) > 0) + sc->zpr = val & XENON_ZPR_MASK; + if (device_has_property(dev, "marvell,xenon-phy-slow-mode")) + sc->slow_mode = true; } -static int +int sdhci_xenon_attach(device_t dev) { struct sdhci_xenon_softc *sc = device_get_softc(dev); - struct sdhci_slot *slot; int err, rid; uint32_t reg; sc->dev = dev; sc->slot_id = 0; - sc->node = ofw_bus_get_node(dev); /* Allocate IRQ. */ rid = 0; @@ -574,27 +520,11 @@ sdhci_xenon_attach(device_t dev) return (ENOMEM); } - slot = malloc(sizeof(*slot), M_DEVBUF, M_ZERO | M_WAITOK); - - /* - * Set up any gpio pin handling described in the FDT data. This cannot - * fail; see comments in sdhci_fdt_gpio.h for details. - */ - sc->gpio = sdhci_fdt_gpio_setup(dev, slot); + sdhci_xenon_parse_prop(dev); - sdhci_xenon_fdt_parse(dev, slot); - - slot->max_clk = XENON_MMC_MAX_CLK; - if (slot->host.f_max > 0) - slot->max_clk = slot->host.f_max; - /* Check if the device is flagged as non-removable. */ - if (sc->mmc_helper.props & MMC_PROP_NON_REMOVABLE) { - slot->opt |= SDHCI_NON_REMOVABLE; - if (bootverbose) - device_printf(dev, "Non-removable media\n"); - } - - sc->slot = slot; + sc->slot->max_clk = XENON_MMC_MAX_CLK; + if (sc->slot->host.f_max > 0) + sc->slot->max_clk = sc->slot->host.f_max; if (sdhci_init_slot(dev, sc->slot, 0)) goto fail; @@ -658,14 +588,11 @@ fail: return (ENXIO); } -static int +int sdhci_xenon_detach(device_t dev) { struct sdhci_xenon_softc *sc = device_get_softc(dev); - if (sc->gpio != NULL) - sdhci_fdt_gpio_teardown(sc->gpio); - bus_generic_detach(dev); bus_teardown_intr(dev, sc->irq_res, sc->intrhand); bus_release_resource(dev, SYS_RES_IRQ, rman_get_rid(sc->irq_res), @@ -680,11 +607,6 @@ sdhci_xenon_detach(device_t dev) } static device_method_t sdhci_xenon_methods[] = { - /* device_if */ - DEVMETHOD(device_probe, sdhci_xenon_probe), - DEVMETHOD(device_attach, sdhci_xenon_attach), - DEVMETHOD(device_detach, sdhci_xenon_detach), - /* Bus interface */ DEVMETHOD(bus_read_ivar, sdhci_generic_read_ivar), DEVMETHOD(bus_write_ivar, sdhci_generic_write_ivar), @@ -708,21 +630,13 @@ static device_method_t sdhci_xenon_methods[] = { DEVMETHOD(sdhci_write_2, sdhci_xenon_write_2), DEVMETHOD(sdhci_write_4, sdhci_xenon_write_4), DEVMETHOD(sdhci_write_multi_4, sdhci_xenon_write_multi_4), - DEVMETHOD(sdhci_get_card_present, sdhci_xenon_get_card_present), DEVMETHOD(sdhci_set_uhs_timing, sdhci_xenon_set_uhs_timing), DEVMETHOD_END }; -static driver_t sdhci_xenon_driver = { - "sdhci_xenon", - sdhci_xenon_methods, - sizeof(struct sdhci_xenon_softc), -}; -static devclass_t sdhci_xenon_devclass; - -DRIVER_MODULE(sdhci_xenon, simplebus, sdhci_xenon_driver, sdhci_xenon_devclass, - NULL, NULL); +DEFINE_CLASS_0(sdhci_xenon, sdhci_xenon_driver, sdhci_xenon_methods, + sizeof(struct sdhci_xenon_softc)); SDHCI_DEPEND(sdhci_xenon); #ifndef MMCCAM diff --git a/sys/dev/sdhci/sdhci_xenon.h b/sys/dev/sdhci/sdhci_xenon.h index 07ed99339b8d..9d8449b90c82 100644 --- a/sys/dev/sdhci/sdhci_xenon.h +++ b/sys/dev/sdhci/sdhci_xenon.h @@ -101,4 +101,33 @@ #define XENON_EMMC_PHY_LOGIC_TIMING_ADJUST (XENON_EMMC_PHY_REG_BASE + 0x18) #define XENON_LOGIC_TIMING_VALUE 0x00AA8977 +DECLARE_CLASS(sdhci_xenon_driver); + +struct sdhci_xenon_softc { + device_t dev; /* Controller device */ + int slot_id; /* Controller ID */ + + struct resource *mem_res; /* Memory resource */ + struct resource *irq_res; /* IRQ resource */ + void *intrhand; /* Interrupt handle */ + + struct sdhci_slot *slot; /* SDHCI internal data */ + + uint8_t znr; /* PHY ZNR */ + uint8_t zpr; /* PHY ZPR */ + bool slow_mode; /* PHY slow mode */ + bool wp_inverted; + bool skip_regulators; /* Don't switch regulators */ + + regulator_t vmmc_supply; + regulator_t vqmmc_supply; + +#ifdef FDT + struct sdhci_fdt_gpio *gpio; /* GPIO pins for CD detection. */ +#endif +}; + +device_attach_t sdhci_xenon_attach; +device_detach_t sdhci_xenon_detach; + #endif /* _SDHCI_XENON_H_ */ diff --git a/sys/dev/sdhci/sdhci_xenon_fdt.c b/sys/dev/sdhci/sdhci_xenon_fdt.c new file mode 100644 index 000000000000..2d96105bd7e9 --- /dev/null +++ b/sys/dev/sdhci/sdhci_xenon_fdt.c @@ -0,0 +1,173 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2021 Semihalf + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include + +#include + +#include +#include + +#include +#include +#include + +#include +#include + +#include +#include +#include + +#include "mmcbr_if.h" +#include "sdhci_if.h" + +#include "opt_mmccam.h" +#include "opt_soc.h" + +static struct ofw_compat_data compat_data[] = { + { "marvell,armada-3700-sdhci", 1 }, +#ifdef SOC_MARVELL_8K + { "marvell,armada-cp110-sdhci", 1 }, + { "marvell,armada-ap806-sdhci", 1 }, + { "marvell,armada-ap807-sdhci", 1 }, +#endif + { NULL, 0 } +}; + +static bool +sdhci_xenon_fdt_get_card_present(device_t dev, struct sdhci_slot *slot) +{ + struct sdhci_xenon_softc *sc; + + sc = device_get_softc(dev); + + return (sdhci_fdt_gpio_get_present(sc->gpio)); +} + +static int +sdhci_xenon_fdt_probe(device_t dev) +{ + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + + if (ofw_bus_search_compatible(dev, compat_data)->ocd_data == 0) + return (ENXIO); + + device_set_desc(dev, "Armada Xenon SDHCI controller"); + + return (BUS_PROBE_SPECIFIC); +} + +static void +sdhci_xenon_fdt_parse(device_t dev, struct sdhci_slot *slot) +{ + struct sdhci_xenon_softc *sc; + struct mmc_helper mmc_helper; + + sc = device_get_softc(dev); + memset(&mmc_helper, 0, sizeof(mmc_helper)); + + /* MMC helper for parsing FDT */ + mmc_fdt_parse(dev, 0, &mmc_helper, &slot->host); + + sc->skip_regulators = false; + sc->vmmc_supply = mmc_helper.vmmc_supply; + sc->vqmmc_supply = mmc_helper.vqmmc_supply; + sc->wp_inverted = mmc_helper.props & MMC_PROP_WP_INVERTED; + + /* Check if the device is flagged as non-removable. */ + if (mmc_helper.props & MMC_PROP_NON_REMOVABLE) { + slot->opt |= SDHCI_NON_REMOVABLE; + if (bootverbose) + device_printf(dev, "Non-removable media\n"); + } +} + +static int +sdhci_xenon_fdt_attach(device_t dev) +{ + struct sdhci_xenon_softc *sc; + struct sdhci_slot *slot; + + sc = device_get_softc(dev); + slot = malloc(sizeof(*slot), M_DEVBUF, M_ZERO | M_WAITOK); + + sdhci_xenon_fdt_parse(dev, slot); + + /* + * Set up any gpio pin handling described in the FDT data. This cannot + * fail; see comments in sdhci_fdt_gpio.h for details. + */ + sc->gpio = sdhci_fdt_gpio_setup(dev, slot); + sc->slot = slot; + + return (sdhci_xenon_attach(dev)); +} + +static int +sdhci_xenon_fdt_detach(device_t dev) +{ + struct sdhci_xenon_softc *sc; + + sc = device_get_softc(dev); + if (sc->gpio != NULL) + sdhci_fdt_gpio_teardown(sc->gpio); + + return (sdhci_xenon_detach(dev)); +} + +static device_method_t sdhci_xenon_fdt_methods[] = { + /* device_if */ + DEVMETHOD(device_probe, sdhci_xenon_fdt_probe), + DEVMETHOD(device_attach, sdhci_xenon_fdt_attach), + DEVMETHOD(device_detach, sdhci_xenon_fdt_detach), + + DEVMETHOD(sdhci_get_card_present, sdhci_xenon_fdt_get_card_present), + + DEVMETHOD_END +}; + +DEFINE_CLASS_1(sdhci_xenon, sdhci_xenon_fdt_driver, sdhci_xenon_fdt_methods, + sizeof(struct sdhci_xenon_softc), sdhci_xenon_driver); + +static devclass_t sdhci_xenon_fdt_devclass; + +DRIVER_MODULE(sdhci_xenon, simplebus, sdhci_xenon_fdt_driver, + sdhci_xenon_fdt_devclass, NULL, NULL); + +#ifndef MMCCAM +MMC_DECLARE_BRIDGE(sdhci_xenon_fdt); +#endif From owner-dev-commits-src-main@freebsd.org Wed Sep 29 14:20:06 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3F809675417; Wed, 29 Sep 2021 14:20:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HKJRp1B1fz3q5f; Wed, 29 Sep 2021 14:20:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 09F1F19996; Wed, 29 Sep 2021 14:20:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18TEK53g045864; Wed, 29 Sep 2021 14:20:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18TEK5pl045861; Wed, 29 Sep 2021 14:20:05 GMT (envelope-from git) Date: Wed, 29 Sep 2021 14:20:05 GMT Message-Id: <202109291420.18TEK5pl045861@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Marcin Wojtas Subject: git: adbce5ff747b - main - sdhci_xenon: add ACPI support MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mw X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: adbce5ff747b6372b6cda915d06fe52b4a67b4d8 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Sep 2021 14:20:06 -0000 The branch main has been updated by mw: URL: https://cgit.FreeBSD.org/src/commit/?id=adbce5ff747b6372b6cda915d06fe52b4a67b4d8 commit adbce5ff747b6372b6cda915d06fe52b4a67b4d8 Author: Bartlomiej Grzesik AuthorDate: 2021-07-21 14:36:11 +0000 Commit: Marcin Wojtas CommitDate: 2021-09-29 14:19:28 +0000 sdhci_xenon: add ACPI support Add support for ACPI device probing for SDHCI controller found on Marvell chips. Reviewed by: mw Sponsored by: Semihalf Differential revision: https://reviews.freebsd.org/D31600 --- sys/conf/files.arm64 | 1 + sys/dev/sdhci/sdhci_xenon_acpi.c | 140 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 141 insertions(+) diff --git a/sys/conf/files.arm64 b/sys/conf/files.arm64 index 0d33e315db65..9dd071b97e37 100644 --- a/sys/conf/files.arm64 +++ b/sys/conf/files.arm64 @@ -275,6 +275,7 @@ dev/psci/smccc.c standard dev/safexcel/safexcel.c optional safexcel fdt dev/sdhci/sdhci_xenon.c optional sdhci_xenon sdhci +dev/sdhci/sdhci_xenon_acpi.c optional sdhci_xenon sdhci acpi dev/sdhci/sdhci_xenon_fdt.c optional sdhci_xenon sdhci fdt dev/uart/uart_cpu_arm64.c optional uart diff --git a/sys/dev/sdhci/sdhci_xenon_acpi.c b/sys/dev/sdhci/sdhci_xenon_acpi.c new file mode 100644 index 000000000000..1bd4c03c67e4 --- /dev/null +++ b/sys/dev/sdhci/sdhci_xenon_acpi.c @@ -0,0 +1,140 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2021 Semihalf + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include + +#include +#include +#include + +#include + +#include +#include +#include + +#ifdef EXT_RESOURCES +#include +#endif + +#include +#include + +#include "mmcbr_if.h" +#include "sdhci_if.h" + +#include "opt_mmccam.h" +#include "opt_soc.h" + +static char *sdhci_xenon_hids[] = { + "MRVL0002", + "MRVL0003", + "MRVL0004", + NULL +}; + +static int +sdhci_xenon_acpi_probe(device_t dev) +{ + device_t bus; + int err; + + bus = device_get_parent(dev); + + err = ACPI_ID_PROBE(bus, dev, sdhci_xenon_hids, NULL); + if (err <= 0) { + device_set_desc(dev, "Armada Xenon SDHCI controller"); + return (err); + } + + return (ENXIO); +} + +static int +sdhci_xenon_acpi_attach(device_t dev) +{ + struct sdhci_xenon_softc *sc; + struct sdhci_slot *slot; + struct mmc_helper mmc_helper; + + sc = device_get_softc(dev); + memset(&mmc_helper, 0, sizeof(mmc_helper)); + + slot = malloc(sizeof(*slot), M_DEVBUF, M_ZERO | M_WAITOK); + if (!slot) + return (ENOMEM); + + /* + * Don't use regularators. + * In ACPI mode the firmware takes care of them for us + */ + sc->skip_regulators = true; + sc->slot = slot; + + if (mmc_parse(dev, &mmc_helper, &slot->host) != 0) + return (ENXIO); + + if (mmc_helper.props & MMC_PROP_NON_REMOVABLE) { + slot->opt |= SDHCI_NON_REMOVABLE; + if (bootverbose) + device_printf(dev, "Non-removable media\n"); + } + + sc->wp_inverted = mmc_helper.props & MMC_PROP_WP_INVERTED; + + return (sdhci_xenon_attach(dev)); +} + +static device_method_t sdhci_xenon_acpi_methods[] = { + /* device_if */ + DEVMETHOD(device_probe, sdhci_xenon_acpi_probe), + DEVMETHOD(device_attach, sdhci_xenon_acpi_attach), + DEVMETHOD(device_detach, sdhci_xenon_detach), + + DEVMETHOD(sdhci_get_card_present, sdhci_generic_get_card_present), + + DEVMETHOD_END +}; + +DEFINE_CLASS_1(sdhci_xenon, sdhci_xenon_acpi_driver, sdhci_xenon_acpi_methods, + sizeof(struct sdhci_xenon_softc), sdhci_xenon_driver); + +static devclass_t sdhci_xenon_acpi_devclass; + +DRIVER_MODULE(sdhci_xenon, acpi, sdhci_xenon_acpi_driver, + sdhci_xenon_acpi_devclass, NULL, NULL); + +#ifndef MMCCAM +MMC_DECLARE_BRIDGE(sdhci_xenon_acpi); +#endif From owner-dev-commits-src-main@freebsd.org Wed Sep 29 14:40:10 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 64181675124; Wed, 29 Sep 2021 14:40:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HKJty2NXzz3qwj; Wed, 29 Sep 2021 14:40:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3251719577; Wed, 29 Sep 2021 14:40:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18TEeAuP073210; Wed, 29 Sep 2021 14:40:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18TEeA0w073207; Wed, 29 Sep 2021 14:40:10 GMT (envelope-from git) Date: Wed, 29 Sep 2021 14:40:10 GMT Message-Id: <202109291440.18TEeA0w073207@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mitchell Horne Subject: git: 440c645b8f14 - main - sdhci: add a missing newline MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mhorne X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 440c645b8f14cae1f80412397ad2850595ba1396 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Sep 2021 14:40:10 -0000 The branch main has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=440c645b8f14cae1f80412397ad2850595ba1396 commit 440c645b8f14cae1f80412397ad2850595ba1396 Author: Mitchell Horne AuthorDate: 2021-09-29 00:10:26 +0000 Commit: Mitchell Horne CommitDate: 2021-09-29 14:38:56 +0000 sdhci: add a missing newline --- sys/dev/sdhci/sdhci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/sdhci/sdhci.c b/sys/dev/sdhci/sdhci.c index 09df5e972ab6..7806a08a1572 100644 --- a/sys/dev/sdhci/sdhci.c +++ b/sys/dev/sdhci/sdhci.c @@ -1758,7 +1758,7 @@ sdhci_start_command(struct sdhci_slot *slot, struct mmc_command *cmd) slot->power == 0 || slot->clock == 0) { slot_printf(slot, - "Cannot issue a command (power=%d clock=%d)", + "Cannot issue a command (power=%d clock=%d)\n", slot->power, slot->clock); cmd->error = MMC_ERR_FAILED; sdhci_req_done(slot); From owner-dev-commits-src-main@freebsd.org Wed Sep 29 15:07:43 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4D520676009; Wed, 29 Sep 2021 15:07:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HKKVl1kqQz3sSC; Wed, 29 Sep 2021 15:07:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1796D1A668; Wed, 29 Sep 2021 15:07:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18TF7gHj009651; Wed, 29 Sep 2021 15:07:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18TF7gts009650; Wed, 29 Sep 2021 15:07:42 GMT (envelope-from git) Date: Wed, 29 Sep 2021 15:07:42 GMT Message-Id: <202109291507.18TF7gts009650@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ed Maste Subject: git: 09e4502d5ca4 - main - Revert "mgb: Use MGB_DEBUG instead of DEBUG" MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 09e4502d5ca41430e9647088a69d41b11deb47d9 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Sep 2021 15:07:43 -0000 The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=09e4502d5ca41430e9647088a69d41b11deb47d9 commit 09e4502d5ca41430e9647088a69d41b11deb47d9 Author: Ed Maste AuthorDate: 2021-09-29 15:04:23 +0000 Commit: Ed Maste CommitDate: 2021-09-29 15:07:11 +0000 Revert "mgb: Use MGB_DEBUG instead of DEBUG" This reverts commit 5aa9f8dae3d40e1780a688ce01401e799b25e7c3. We might as well get coverage of this code via LINT. Reported by: mhorne --- sys/dev/mgb/if_mgb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/mgb/if_mgb.c b/sys/dev/mgb/if_mgb.c index c62b666f098b..bc944c92625c 100644 --- a/sys/dev/mgb/if_mgb.c +++ b/sys/dev/mgb/if_mgb.c @@ -620,7 +620,7 @@ mgb_init(if_ctx_t ctx) error); } -#ifdef MGB_DEBUG +#ifdef DEBUG static void mgb_dump_some_stats(struct mgb_softc *sc) { From owner-dev-commits-src-main@freebsd.org Wed Sep 29 15:26:07 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id ECC6F676261; Wed, 29 Sep 2021 15:26:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HKKvz6ClQz3vM3; Wed, 29 Sep 2021 15:26:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B510B1A9B7; Wed, 29 Sep 2021 15:26:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18TFQ7Fl036179; Wed, 29 Sep 2021 15:26:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18TFQ7CY036178; Wed, 29 Sep 2021 15:26:07 GMT (envelope-from git) Date: Wed, 29 Sep 2021 15:26:07 GMT Message-Id: <202109291526.18TFQ7CY036178@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 9e1dc7bec331 - main - loader: create separate man pages for each of the loaders MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9e1dc7bec331b4d120d4b0687cfd54692e4fddcb Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Sep 2021 15:26:08 -0000 The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=9e1dc7bec331b4d120d4b0687cfd54692e4fddcb commit 9e1dc7bec331b4d120d4b0687cfd54692e4fddcb Author: Warner Losh AuthorDate: 2021-09-29 15:21:17 +0000 Commit: Warner Losh CommitDate: 2021-09-29 15:24:47 +0000 loader: create separate man pages for each of the loaders Create a man page per loader. Loader(8) will have information common to all of them, while loader_${INTERP}(8) will have information relevant to that specific loader. Rewrite loader(8) to give an overview and point to the appropriate man page. Rewrite each of the loader_${INTER}(8) man pages to contain only the relevant information to that loader. Put all the common commands, environment variables, etc in loader_simp(8) and refernce that from the loader_lua or loader_4th man pages. The loader_lua(8) could use more details about the Lua integration. Additional organization may be benefitial. Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D31340 --- stand/man/Makefile | 2 + stand/man/loader.8 | 1083 ++--------------------------------------------- stand/man/loader_4th.8 | 585 +++++++++++++++++++++++++ stand/man/loader_lua.8 | 277 ++++++++++++ stand/man/loader_simp.8 | 28 +- 5 files changed, 911 insertions(+), 1064 deletions(-) diff --git a/stand/man/Makefile b/stand/man/Makefile index 5523908b6814..27370624ff62 100644 --- a/stand/man/Makefile +++ b/stand/man/Makefile @@ -5,6 +5,8 @@ M.${MK_EFI}+= boot1.efi.8 M.yes+= loader.8 M.${MK_EFI}+= loader.efi.8 +M.${MK_FORTH}+= loader_4th.8 +M.${MK_LOADER_LUA}+= loader_lua.8 M.yes+= loader_simp.8 MAN=${M.yes} diff --git a/stand/man/loader.8 b/stand/man/loader.8 index c606068941a7..b71ac71e16ce 100644 --- a/stand/man/loader.8 +++ b/stand/man/loader.8 @@ -1,5 +1,6 @@ .\" Copyright (c) 1999 Daniel C. Sobral .\" All rights reserved. +.\" Copyright (c) 2021 Warner Losh .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions @@ -24,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 7, 2021 +.Dd September 29, 2021 .Dt LOADER 8 .Os .Sh NAME @@ -36,13 +37,14 @@ The program called is the final stage of .Fx Ns 's kernel bootstrapping process. -On IA32 (i386) architectures, it is a -.Pa BTX -client. -It is linked statically to -.Xr libstand 3 -and usually located in the directory -.Pa /boot . +It is responsible for bringing the kernel, kernel modules and other files into +memory. +It creates a set of +.Xr sh 1 +like environment variables that are passed to the kernel. +It executes boot scripts written in one of several interpreters. +Together with the scripts, it controls the booting process and +interaction with the user. .Pp It provides a scripting language that can be used to automate tasks, do pre-configuration or assist in recovery @@ -53,10 +55,17 @@ The smaller one is a set of commands designed for direct use by the casual user, called "builtin commands" for historical reasons. The main drive behind these commands is user-friendliness. -The bigger component is an -.Tn ANS -Forth compatible Forth interpreter based on FICL, by +The larger component is the scripting language built into +the boot loader. +.Fx +provides three different interpreters: Forth, Lua and Simple. +The Forth loader is based on an ANS Forth compatible +Forth interpreter based on FICL, by .An John Sadler . +The Lua loader is includes a full Lua interpreter from +.Pa https://www.lua.org/ . +The Simple loader only interprets a list of builtin commands +without any control structure. .Pp During initialization, .Nm @@ -73,1039 +82,36 @@ and are set, and .Va LINES is set to 24. -Next, -.Tn FICL -is initialized, the builtin words are added to its vocabulary, and -.Pa /boot/loader.4th -is processed if it exists. -No disk switching is possible while that file is being read. -The inner interpreter -.Nm -will use with -.Tn FICL -is then set to -.Ic interpret , -which is -.Tn FICL Ns 's -default. -After that, -.Pa /boot/loader.rc -is processed if available. -These files are processed through the -.Ic include -command, which reads all of them into memory before processing them, -making disk changes possible. -.Pp -At this point, if an -.Ic autoboot -has not been tried, and if -.Va autoboot_delay -is not set to -.Dq Li NO -(not case sensitive), then an -.Ic autoboot -will be tried. -If the system gets past this point, -.Va prompt -will be set and -.Nm -will engage interactive mode. -Please note that historically even when -.Va autoboot_delay -is set to -.Dq Li 0 -user will be able to interrupt autoboot process by pressing some key -on the console while kernel and modules are being loaded. -In some -cases such behaviour may be undesirable, to prevent it set -.Va autoboot_delay -to -.Dq Li -1 , -in this case -.Nm -will engage interactive mode only if -.Ic autoboot -has failed. +Finally, an interpreter specific file will be executed. .Sh BUILTIN COMMANDS -In -.Nm , -builtin commands take parameters from the command line. -Presently, -the only way to call them from a script is by using -.Pa evaluate -on a string. -If an error condition occurs, an exception will be generated, -which can be intercepted using -.Tn ANS -Forth exception handling -words. -If not intercepted, an error message will be displayed and -the interpreter's state will be reset, emptying the stack and restoring -interpreting mode. -.Pp -The builtin commands available are: -.Pp -.Bl -tag -width Ds -compact -.It Ic autoboot Op Ar seconds Op Ar prompt -Proceeds to bootstrap the system after a number of seconds, if not -interrupted by the user. -Displays a countdown prompt -warning the user the system is about to be booted, -unless interrupted by a key press. -The kernel will be loaded first if necessary. -Defaults to 10 seconds. -.Pp -.It Ic bcachestat -Displays statistics about disk cache usage. -For debugging only. -.Pp -.It Ic boot -.It Ic boot Ar kernelname Op Cm ... -.It Ic boot Fl flag Cm ... -Immediately proceeds to bootstrap the system, loading the kernel -if necessary. -Any flags or arguments are passed to the kernel, but they -must precede the kernel name, if a kernel name is provided. -.Pp -.Em WARNING : -The behavior of this builtin is changed if -.Xr loader.4th 8 -is loaded. -.Pp -.It Ic echo Xo -.Op Fl n -.Op Aq message -.Xc -Displays text on the screen. -A new line will be printed unless -.Fl n -is specified. -.Pp -.It Ic heap -Displays memory usage statistics. -For debugging purposes only. -.Pp -.It Ic help Op topic Op subtopic -Shows help messages read from -.Pa /boot/loader.help . -The special topic -.Em index -will list the topics available. -.Pp -.It Ic include Ar file Op Ar -Process script files. -Each file, in turn, is completely read into memory, -and then each of its lines is passed to the command line interpreter. -If any error is returned by the interpreter, the include -command aborts immediately, without reading any other files, and -returns an error itself (see -.Sx ERRORS ) . -.Pp -.It Ic load Xo -.Op Fl t Ar type -.Ar file Cm ... -.Xc -Loads a kernel, kernel loadable module (kld), disk image, -or file of opaque contents tagged as being of the type -.Ar type . -Kernel and modules can be either in a.out or ELF format. -Any arguments passed after the name of the file to be loaded -will be passed as arguments to that file. -Use the -.Li md_image -type to make the kernel create a file-backed -.Xr md 4 -disk. -This is useful for booting from a temporary rootfs. -Currently, argument passing does not work for the kernel. -.Pp -.It Ic load_geli Xo -.Op Fl n Ar keyno -.Ar prov Ar file -.Xc -Loads a -.Xr geli 8 -encryption keyfile for the given provider name. -The key index can be specified via -.Ar keyno -or will default to zero. -.Pp -.It Ic ls Xo -.Op Fl l -.Op Ar path -.Xc -Displays a listing of files in the directory -.Ar path , -or the root directory if -.Ar path -is not specified. -If -.Fl l -is specified, file sizes will be shown too. -.Pp -.It Ic lsdev Op Fl v -Lists all of the devices from which it may be possible to load modules, -as well as ZFS pools. -If -.Fl v -is specified, more details are printed, including ZFS pool information -in a format that resembles -.Nm zpool Cm status -output. -.Pp -.It Ic lsmod Op Fl v -Displays loaded modules. -If -.Fl v -is specified, more details are shown. -.Pp -.It Ic lszfs Ar filesystem -A ZFS extended command that can be used to explore the ZFS filesystem -hierarchy in a pool. -Lists the immediate children of the -.Ar filesystem . -The filesystem hierarchy is rooted at a filesystem with the same name -as the pool. -.Pp -.It Ic more Ar file Op Ar -Display the files specified, with a pause at each -.Va LINES -displayed. -.Pp -.It Ic pnpscan Op Fl v -Scans for Plug-and-Play devices. -This is not functional at present. -.Pp -.It Ic read Xo -.Op Fl t Ar seconds -.Op Fl p Ar prompt -.Op Va variable -.Xc -Reads a line of input from the terminal, storing it in -.Va variable -if specified. -A timeout can be specified with -.Fl t , -though it will be canceled at the first key pressed. -A prompt may also be displayed through the -.Fl p -flag. -.Pp -.It Ic reboot -Immediately reboots the system. -.Pp -.It Ic set Ar variable -.It Ic set Ar variable Ns = Ns Ar value -Set loader's environment variables. -.Pp -.It Ic show Op Va variable -Displays the specified variable's value, or all variables and their -values if -.Va variable -is not specified. -.Pp -.It Ic unload -Remove all modules from memory. -.Pp -.It Ic unset Va variable -Removes -.Va variable -from the environment. -.Pp -.It Ic \&? -Lists available commands. -.El +The commands common to all interpreters are described in the +.Xr loader_simp 8 +.Dq BUILTIN COMMANDS +section. .Ss BUILTIN ENVIRONMENT VARIABLES -The -.Nm -has actually two different kinds of -.Sq environment -variables. -There are ANS Forth's -.Em environmental queries , -and a separate space of environment variables used by builtins, which -are not directly available to Forth words. -It is the latter type that this section covers. -.Pp -Environment variables can be set and unset through the -.Ic set -and -.Ic unset -builtins, and can have their values interactively examined through the -use of the -.Ic show -builtin. -Their values can also be accessed as described in -.Sx BUILTIN PARSER . -.Pp -Notice that these environment variables are not inherited by any shell -after the system has been booted. -.Pp -A few variables are set automatically by -.Nm . -Others can affect the behavior of either -.Nm -or the kernel at boot. -Some options may require a value, -while others define behavior just by being set. -Both types of builtin variables are described below. -.Bl -tag -width bootfile -.It Va autoboot_delay -Number of seconds -.Ic autoboot -will wait before booting. -Configuration options are described in -.Xr loader.conf 5 . -.It Va boot_askname -Instructs the kernel to prompt the user for the name of the root device -when the kernel is booted. -.It Va boot_cdrom -Instructs the kernel to try to mount the root file system from CD-ROM. -.It Va boot_ddb -Instructs the kernel to start in the DDB debugger, rather than -proceeding to initialize when booted. -.It Va boot_dfltroot -Instructs the kernel to mount the statically compiled-in root file system. -.It Va boot_gdb -Selects gdb-remote mode for the kernel debugger by default. -.It Va boot_multicons -Enables multiple console support in the kernel early on boot. -In a running system, console configuration can be manipulated -by the -.Xr conscontrol 8 -utility. -.It Va boot_mute -All kernel console output is suppressed when console is muted. -In a running system, the state of console muting can be manipulated by the -.Xr conscontrol 8 -utility. -.It Va boot_pause -During the device probe, pause after each line is printed. -.It Va boot_serial -Force the use of a serial console even when an internal console -is present. -.It Va boot_single -Prevents the kernel from initiating a multi-user startup; instead, -a single-user mode will be entered when the kernel has finished -device probing. -.It Va boot_verbose -Setting this variable causes extra debugging information to be printed -by the kernel during the boot phase. -.It Va bootfile -List of semicolon-separated search path for bootable kernels. -The default is -.Dq Li kernel . -.It Va comconsole_speed -Defines the speed of the serial console (i386 and amd64 only). -If the previous boot stage indicated that a serial console is in use -then this variable is initialized to the current speed of the console -serial port. -Otherwise it is set to 9600 unless this was overridden using the -.Va BOOT_COMCONSOLE_SPEED -variable when -.Nm -was compiled. -Changes to the -.Va comconsole_speed -variable take effect immediately. -.It Va comconsole_port -Defines the base i/o port used to access console UART -(i386 and amd64 only). -If the variable is not set, its assumed value is 0x3F8, which -corresponds to PC port COM1, unless overridden by -.Va BOOT_COMCONSOLE_PORT -variable during the compilation of -.Nm . -Setting the -.Va comconsole_port -variable automatically set -.Va hw.uart.console -environment variable to provide a hint to kernel for location of the console. -Loader console is changed immediately after variable -.Va comconsole_port -is set. -.It Va comconsole_pcidev -Defines the location of a PCI device of the 'simple communication' -class to be used as the serial console UART (i386 and amd64 only). -The syntax of the variable is -.Li 'bus:device:function[:bar]' , -where all members must be numeric, with possible -.Li 0x -prefix to indicate a hexadecimal value. -The -.Va bar -member is optional and assumed to be 0x10 if omitted. -The bar must decode i/o space. -Setting the variable -.Va comconsole_pcidev -automatically sets the variable -.Va comconsole_port -to the base of the selected bar, and hint -.Va hw.uart.console . -Loader console is changed immediately after variable -.Va comconsole_pcidev -is set. -.It Va console -Defines the current console or consoles. -Multiple consoles may be specified. -In that case, the first listed console will become the default console for -userland output (e.g.\& from -.Xr init 8 ) . -.It Va currdev -Selects the default device to loader the kernel from. -The syntax is: -.Dl Ic loader_device: -or -.Dl Ic zfs:dataset: -Examples: -.Dl Ic disk0p2: -.Dl Ic zfs:zroot/ROOT/default: -.It Va dumpdev -Sets the device for kernel dumps. -This can be used to ensure that a device is configured before the corresponding -.Va dumpdev -directive from -.Xr rc.conf 5 -has been processed, allowing kernel panics that happen during the early stages -of boot to be captured. -.It Va init_chroot -See -.Xr init 8 . -.It Va init_exec -See -.Xr init 8 . -.It Va init_path -Sets the list of binaries which the kernel will try to run as the initial -process. -The first matching binary is used. -The default list is -.Dq Li /sbin/init:/sbin/oinit:/sbin/init.bak:\:/rescue/init . -.It Va init_script -See -.Xr init 8 . -.It Va init_shell -See -.Xr init 8 . -.It Va interpret -Has the value -.Dq Li OK -if the Forth's current state is interpreting. -.It Va LINES -Define the number of lines on the screen, to be used by the pager. -.It Va module_path -Sets the list of directories which will be searched for modules -named in a load command or implicitly required by a dependency. -The default value for this variable is -.Dq Li /boot/kernel;/boot/modules . -.It Va num_ide_disks -Sets the number of IDE disks as a workaround for some problems in -finding the root disk at boot. -This has been deprecated in favor of -.Va root_disk_unit . -.It Va prompt -Value of -.Nm Ns 's -prompt. -Defaults to -.Dq Li "${interpret}" . -If variable -.Va prompt -is unset, the default prompt is -.Ql > . -.It Va root_disk_unit -If the code which detects the disk unit number for the root disk is -confused, e.g.\& by a mix of SCSI and IDE disks, or IDE disks with -gaps in the sequence (e.g.\& no primary slave), the unit number can -be forced by setting this variable. -.It Va rootdev -By default the value of -.Va currdev -is used to set the root file system -when the kernel is booted. -This can be overridden by setting -.Va rootdev -explicitly. -.El -.Pp -Other variables are used to override kernel tunable parameters. -The following tunables are available: -.Bl -tag -width Va -.It Va efi.rt.disabled -Disable UEFI runtime services in the kernel, if applicable. -Runtime services are only available and used if the kernel is booted in a UEFI -environment. -.It Va hw.physmem -Limit the amount of physical memory the system will use. -By default the size is in bytes, but the -.Cm k , K , m , M , g -and -.Cm G -suffixes -are also accepted and indicate kilobytes, megabytes and gigabytes -respectively. -An invalid suffix will result in the variable being ignored by the -kernel. -.It Va hw.pci.host_start_mem , hw.acpi.host_start_mem -When not otherwise constrained, this limits the memory start -address. -The default is 0x80000000 and should be set to at least size of the -memory and not conflict with other resources. -Typically, only systems without PCI bridges need to set this variable -since PCI bridges typically constrain the memory starting address -(and the variable is only used when bridges do not constrain this -address). -.It Va hw.pci.enable_io_modes -Enable PCI resources which are left off by some BIOSes or are not -enabled correctly by the device driver. -Tunable value set to ON (1) by default, but this may cause problems -with some peripherals. -.It Va kern.maxusers -Set the size of a number of statically allocated system tables; see -.Xr tuning 7 -for a description of how to select an appropriate value for this -tunable. -When set, this tunable replaces the value declared in the kernel -compile-time configuration file. -.It Va kern.ipc.nmbclusters -Set the number of mbuf clusters to be allocated. -The value cannot be set below the default -determined when the kernel was compiled. -.It Va kern.ipc.nsfbufs -Set the number of -.Xr sendfile 2 -buffers to be allocated. -Overrides -.Dv NSFBUFS . -Not all architectures use such buffers; see -.Xr sendfile 2 -for details. -.It Va kern.maxswzone -Limits the amount of KVM to be used to hold swap -metadata, which directly governs the -maximum amount of swap the system can support, -at the rate of approximately 200 MB of swap space -per 1 MB of metadata. -This value is specified in bytes of KVA space. -If no value is provided, the system allocates -enough memory to handle an amount of swap -that corresponds to eight times the amount of -physical memory present in the system. -.Pp -Note that swap metadata can be fragmented, -which means that the system can run out of -space before it reaches the theoretical limit. -Therefore, care should be taken to not configure -more swap than approximately half of the -theoretical maximum. -.Pp -Running out of space for swap metadata can leave -the system in an unrecoverable state. -Therefore, you should only change -this parameter if you need to greatly extend the -KVM reservation for other resources such as the -buffer cache or -.Va kern.ipc.nmbclusters . -Modifies kernel option -.Dv VM_SWZONE_SIZE_MAX . -.It Va kern.maxbcache -Limits the amount of KVM reserved for use by the -buffer cache, specified in bytes. -The default maximum is 200MB on i386, -and 400MB on amd64. -This parameter is used to -prevent the buffer cache from eating too much -KVM in large-memory machine configurations. -Only mess around with this parameter if you need to -greatly extend the KVM reservation for other resources -such as the swap zone or -.Va kern.ipc.nmbclusters . -Note that -the NBUF parameter will override this limit. -Modifies -.Dv VM_BCACHE_SIZE_MAX . -.It Va kern.msgbufsize -Sets the size of the kernel message buffer. -The default limit of 96KB is usually sufficient unless -large amounts of trace data need to be collected -between opportunities to examine the buffer or -dump it to a file. -Overrides kernel option -.Dv MSGBUF_SIZE . -.It Va machdep.disable_mtrrs -Disable the use of i686 MTRRs (x86 only). -.It Va net.inet.tcp.tcbhashsize -Overrides the compile-time set value of -.Dv TCBHASHSIZE -or the preset default of 512. -Must be a power of 2. -.It Va twiddle_divisor -Throttles the output of the -.Sq twiddle -I/O progress indicator displayed while loading the kernel and modules. -This is useful on slow serial consoles where the time spent waiting for -these characters to be written can add up to many seconds. -The default is 16; a value of 32 spins half as fast, -while a value of 8 spins twice as fast. -.It Va vm.kmem_size -Sets the size of kernel memory (bytes). -This overrides the value determined when the kernel was compiled. -Modifies -.Dv VM_KMEM_SIZE . -.It Va vm.kmem_size_min -.It Va vm.kmem_size_max -Sets the minimum and maximum (respectively) amount of kernel memory -that will be automatically allocated by the kernel. -These override the values determined when the kernel was compiled. -Modifies -.Dv VM_KMEM_SIZE_MIN -and -.Dv VM_KMEM_SIZE_MAX . -.El -.Ss ZFS FEATURES -.Nm -supports the following format for specifying ZFS filesystems which -can be used wherever -.Xr loader 8 -refers to a device specification: -.Pp -.Ar zfs:pool/filesystem: -.Pp -where -.Pa pool/filesystem -is a ZFS filesystem name as described in -.Xr zfs 8 . -.Pp -If -.Pa /etc/fstab -does not have an entry for the root filesystem and -.Va vfs.root.mountfrom -is not set, but -.Va currdev -refers to a ZFS filesystem, then -.Nm -will instruct kernel to use that filesystem as the root filesystem. -.Ss BUILTIN PARSER -When a builtin command is executed, the rest of the line is taken -by it as arguments, and it is processed by a special parser which -is not used for regular Forth commands. -.Pp -This special parser applies the following rules to the parsed text: -.Bl -enum -.It -All backslash characters are preprocessed. -.Bl -bullet -.It -\eb , \ef , \er , \en and \et are processed as in C. -.It -\es is converted to a space. -.It -\ev is converted to -.Tn ASCII -11. -.It -\ez is just skipped. -Useful for things like -.Dq \e0xf\ez\e0xf . -.It -\e0xN and \e0xNN are replaced by the hex N or NN. -.It -\eNNN is replaced by the octal NNN -.Tn ASCII -character. -.It -\e" , \e' and \e$ will escape these characters, preventing them from -receiving special treatment in Step 2, described below. -.It -\e\e will be replaced with a single \e . -.It -In any other occurrence, backslash will just be removed. -.El -.It -Every string between non-escaped quotes or double-quotes will be treated -as a single word for the purposes of the remaining steps. -.It -Replace any -.Li $VARIABLE -or -.Li ${VARIABLE} -with the value of the environment variable -.Va VARIABLE . -.It -Space-delimited arguments are passed to the called builtin command. -Spaces can also be escaped through the use of \e\e . -.El -.Pp -An exception to this parsing rule exists, and is described in -.Sx BUILTINS AND FORTH . -.Ss BUILTINS AND FORTH -All builtin words are state-smart, immediate words. -If interpreted, they behave exactly as described previously. -If they are compiled, though, -they extract their arguments from the stack instead of the command line. -.Pp -If compiled, the builtin words expect to find, at execution time, the -following parameters on the stack: -.D1 Ar addrN lenN ... addr2 len2 addr1 len1 N -where -.Ar addrX lenX -are strings which will compose the command line that will be parsed -into the builtin's arguments. -Internally, these strings are concatenated in from 1 to N, -with a space put between each one. -.Pp -If no arguments are passed, a 0 -.Em must -be passed, even if the builtin accepts no arguments. -.Pp -While this behavior has benefits, it has its trade-offs. -If the execution token of a builtin is acquired (through -.Ic ' -or -.Ic ['] ) , -and then passed to -.Ic catch -or -.Ic execute , -the builtin behavior will depend on the system state -.Bf Em -at the time -.Ic catch -or -.Ic execute -is processed! -.Ef -This is particularly annoying for programs that want or need to -handle exceptions. -In this case, the use of a proxy is recommended. -For example: -.Dl : (boot) boot ; -.Sh FICL -.Tn FICL -is a Forth interpreter written in C, in the form of a forth -virtual machine library that can be called by C functions and vice -versa. -.Pp -In -.Nm , -each line read interactively is then fed to -.Tn FICL , -which may call -.Nm -back to execute the builtin words. -The builtin -.Ic include -will also feed -.Tn FICL , -one line at a time. -.Pp -The words available to -.Tn FICL -can be classified into four groups. -The -.Tn ANS -Forth standard words, extra -.Tn FICL -words, extra -.Fx -words, and the builtin commands; -the latter were already described. -The -.Tn ANS -Forth standard words are listed in the -.Sx STANDARDS +The environment variables common to all interpreters are described in the +.Xr loader_simp 8 +.Dq BUILTIN ENVIRONMENT VARIABLES section. -The words falling in the two other groups are described in the -following subsections. -.Ss FICL EXTRA WORDS -.Bl -tag -width wid-set-super -.It Ic .env -.It Ic .ver -.It Ic -roll -.It Ic 2constant -.It Ic >name -.It Ic body> -.It Ic compare -This is the STRING word set's -.Ic compare . -.It Ic compile-only -.It Ic endif -.It Ic forget-wid -.It Ic parse-word -.It Ic sliteral -This is the STRING word set's -.Ic sliteral . -.It Ic wid-set-super -.It Ic w@ -.It Ic w! -.It Ic x. -.It Ic empty -.It Ic cell- -.It Ic -rot -.El -.Ss FREEBSD EXTRA WORDS -.Bl -tag -width XXXXXXXX -.It Ic \&$ Pq -- -Evaluates the remainder of the input buffer, after having printed it first. -.It Ic \&% Pq -- -Evaluates the remainder of the input buffer under a -.Ic catch -exception guard. -.It Ic .# -Works like -.Ic "." -but without outputting a trailing space. -.It Ic fclose Pq Ar fd -- -Closes a file. -.It Ic fkey Pq Ar fd -- char -Reads a single character from a file. -.It Ic fload Pq Ar fd -- -Processes a file -.Em fd . -.It Ic fopen Pq Ar addr len mode Li -- Ar fd -Opens a file. -Returns a file descriptor, or \-1 in case of failure. -The -.Ar mode -parameter selects whether the file is to be opened for read access, write -access, or both. -The constants -.Dv O_RDONLY , O_WRONLY , -and -.Dv O_RDWR -are defined in -.Pa /boot/support.4th , -indicating read only, write only, and read-write access, respectively. -.It Xo -.Ic fread -.Pq Ar fd addr len -- len' -.Xc -Tries to read -.Em len -bytes from file -.Em fd -into buffer -.Em addr . -Returns the actual number of bytes read, or -1 in case of error or end of -file. -.It Ic heap? Pq -- Ar cells -Return the space remaining in the dictionary heap, in cells. -This is not related to the heap used by dynamic memory allocation words. -.It Ic inb Pq Ar port -- char -Reads a byte from a port. -.It Ic key Pq -- Ar char -Reads a single character from the console. -.It Ic key? Pq -- Ar flag -Returns -.Ic true -if there is a character available to be read from the console. -.It Ic ms Pq Ar u -- -Waits -.Em u -microseconds. -.It Ic outb Pq Ar port char -- -Writes a byte to a port. -.It Ic seconds Pq -- Ar u -Returns the number of seconds since midnight. -.It Ic tib> Pq -- Ar addr len -Returns the remainder of the input buffer as a string on the stack. -.It Ic trace! Pq Ar flag -- -Activates or deactivates tracing. -Does not work with -.Ic catch . -.El -.Ss FREEBSD DEFINED ENVIRONMENTAL QUERIES -.Bl -tag -width Ds -.It arch-i386 -.Ic TRUE -if the architecture is IA32. -.It FreeBSD_version -.Fx -version at compile time. -.It loader_version -.Nm -version. -.El -.Sh SECURITY -Access to the -.Nm -command line provides several ways of compromising system security, -including, but not limited to: -.Pp -.Bl -bullet -.It -Booting from removable storage, by setting the -.Va currdev -or -.Va loaddev -variables -.It -Executing binary of choice, by setting the *** 1134 LINES SKIPPED *** From owner-dev-commits-src-main@freebsd.org Wed Sep 29 15:43:03 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5021767659B; Wed, 29 Sep 2021 15:43:03 +0000 (UTC) (envelope-from andrew@fubar.geek.nz) Received: from fry.fubar.geek.nz (fry.fubar.geek.nz [139.59.165.16]) by mx1.freebsd.org (Postfix) with ESMTP id 4HKLHT6FXsz3wK9; Wed, 29 Sep 2021 15:43:01 +0000 (UTC) (envelope-from andrew@fubar.geek.nz) Received: from smtpclient.apple (cpc91232-cmbg18-2-0-cust554.5-4.cable.virginm.net [82.2.126.43]) by fry.fubar.geek.nz (Postfix) with ESMTPSA id 90B6F4E630; Wed, 29 Sep 2021 15:42:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fubar.geek.nz; s=mail; t=1632930144; bh=qL4oHJUVnt3YWcsblqA/C1sJy2AKwgVCIBCq1t9RIlQ=; h=Subject:From:In-Reply-To:Date:Cc:References:To; b=XGCkZLAD5PMOsdCVJKzdRudOOzu0PeV2cHWecqUV0lb+eX9/vTGgPoDq6Vcs6P4a6 iwTo/Zn/9I7gU19sjaXgiQP+mfemwl3+kJnY0Qwsbu7WOf04IiS1x+3qs/rQIvqWi3 CIPLAel1T2IXAwcxUPpxJPhoQrfMg1D9+sTVtJhn/E8ilKORGUFz1CT+2FjbdsWUDG 4MK9s/nWJXBRYMf4MSug95HmynNWbVvBxsLKP3fWqjo/42pKmRmboHnZ/GxiWEhzle EgAcaL95Nvn2EYHzGUNW0yq44XeCrNPvnmjGl7C0S1GfFNZ0DlWvokqV4PPCCeD+jx UhwHmDV/fzG0luFM/SOvF7WFUDNBocpOjOQAvPDNOibv3FUBZtk9iREp4WGiYpyYC6 g7VhFPMzwi9RVLAmDaG/errQoUutmblL+zCJGppvg3Vih2+DpIppue5oFZ40GIGvrn 1HEfV7ikkegPAzknQeKBqO9e+lwBNPFsCf1oRHfT01QHABJ50C4+Bw/lkCILhMTlyw 6yN98m3bZR+uo9L5fZ0JsYWudBVJf2bGnbIKScx98icEv/1tpf1EHV8MUWuZSzac2D NRHwm+65G90R3M4Jd9KZwfrhxwfZORBrbwgZWrSh/V6M5iii8/9rQkS13dPZu4a1Vc n3eprBgLFYsitBvjJ2l0Nkl4= Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.120.0.1.13\)) Subject: Re: git: f3aa0098a82e - main - Use mtx_lock_spin in the gic driver From: Andrew Turner In-Reply-To: Date: Wed, 29 Sep 2021 16:42:24 +0100 Cc: Andrew Turner , src-committers , dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <66731C91-BAE9-4D5D-B7DE-F1D7AA94395D@fubar.geek.nz> References: <202109281243.18SChldh001988@gitrepo.freebsd.org> To: Marcin Wojtas X-Mailer: Apple Mail (2.3654.120.0.1.13) X-Rspamd-Queue-Id: 4HKLHT6FXsz3wK9 X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=fubar.geek.nz header.s=mail header.b=XGCkZLAD; dmarc=pass (policy=none) header.from=fubar.geek.nz; spf=pass (mx1.freebsd.org: domain of andrew@fubar.geek.nz designates 139.59.165.16 as permitted sender) smtp.mailfrom=andrew@fubar.geek.nz X-Spamd-Result: default: False [-3.40 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; ARC_NA(0.00)[]; R_DKIM_ALLOW(-0.20)[fubar.geek.nz:s=mail]; FREEFALL_USER(0.00)[andrew]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; MV_CASE(0.50)[]; MID_RHS_MATCH_FROM(0.00)[]; MIME_GOOD(-0.10)[text/plain]; R_SPF_ALLOW(-0.20)[+mx]; NEURAL_HAM_LONG(-1.00)[-1.000]; RCPT_COUNT_FIVE(0.00)[5]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[fubar.geek.nz:+]; DMARC_POLICY_ALLOW(-0.50)[fubar.geek.nz,none]; NEURAL_HAM_SHORT(-1.00)[-1.000]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; RCVD_NO_TLS_LAST(0.10)[]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:14061, ipnet:139.59.160.0/20, country:US]; RCVD_COUNT_TWO(0.00)[2]; MAILMAN_DEST(0.00)[dev-commits-src-all,dev-commits-src-main] X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Sep 2021 15:43:03 -0000 > On 28 Sep 2021, at 16:36, Marcin Wojtas wrote: >=20 > Hi Andrew, >=20 > wt., 28 wrz 2021 o 14:43 Andrew Turner = napisa=C5=82(a): >>=20 >> The branch main has been updated by andrew: >>=20 >> URL: = https://cgit.FreeBSD.org/src/commit/?id=3Df3aa0098a82ebf7712aa13716d794aa7= e4ac59cd >>=20 >> commit f3aa0098a82ebf7712aa13716d794aa7e4ac59cd >> Author: Andrew Turner >> AuthorDate: 2021-09-28 11:36:42 +0000 >> Commit: Andrew Turner >> CommitDate: 2021-09-28 11:42:06 +0000 >>=20 >> Use mtx_lock_spin in the gic driver >>=20 >> The mutex was changed to a spin lock when the MSI/MSI-X handling = was >> moved from the gicv2m to the gic driver. Update the calls to lock >> and unlock the mutex to the spin variant. >>=20 >> Submitted by: jrtc27 ("Change all the mtx_(un)lock(&sc->mutex) = to be the _spin versions.") >> Reported by: mw, antranigv@freebsd.am >> Sponsored by: The FreeBSD Foundation >> --- >> sys/arm/arm/gic.c | 20 ++++++++++---------- >> 1 file changed, 10 insertions(+), 10 deletions(-) >>=20 >> diff --git a/sys/arm/arm/gic.c b/sys/arm/arm/gic.c >> index d7edd7885404..89db4e324600 100644 >> --- a/sys/arm/arm/gic.c >> +++ b/sys/arm/arm/gic.c >> @@ -1056,7 +1056,7 @@ arm_gic_alloc_msi(device_t dev, device_t child, = int count, int maxcount, >>=20 >> sc =3D device_get_softc(dev); >>=20 >> - mtx_lock(&sc->mutex); >> + mtx_lock_spin(&sc->mutex); >>=20 >> found =3D false; >> for (irq =3D sc->sc_spi_start; irq < sc->sc_spi_end; irq++) { >> @@ -1091,7 +1091,7 @@ arm_gic_alloc_msi(device_t dev, device_t child, = int count, int maxcount, >>=20 >> /* Not enough interrupts were found */ >> if (!found || irq =3D=3D sc->sc_spi_end) { >> - mtx_unlock(&sc->mutex); >> + mtx_unlock_spin(&sc->mutex); >> return (ENXIO); >> } >>=20 >> @@ -1099,7 +1099,7 @@ arm_gic_alloc_msi(device_t dev, device_t child, = int count, int maxcount, >> /* Mark the interrupt as used */ >> sc->gic_irqs[irq + i].gi_flags |=3D GI_FLAG_MSI_USED; >> } >> - mtx_unlock(&sc->mutex); >> + mtx_unlock_spin(&sc->mutex); >>=20 >> for (i =3D 0; i < count; i++) >> srcs[i] =3D (struct intr_irqsrc *)&sc->gic_irqs[irq + = i]; >> @@ -1118,7 +1118,7 @@ arm_gic_release_msi(device_t dev, device_t = child, int count, >>=20 >> sc =3D device_get_softc(dev); >>=20 >> - mtx_lock(&sc->mutex); >> + mtx_lock_spin(&sc->mutex); >> for (i =3D 0; i < count; i++) { >> gi =3D (struct gic_irqsrc *)isrc[i]; >>=20 >> @@ -1128,7 +1128,7 @@ arm_gic_release_msi(device_t dev, device_t = child, int count, >>=20 >> gi->gi_flags &=3D ~GI_FLAG_MSI_USED; >> } >> - mtx_unlock(&sc->mutex); >> + mtx_unlock_spin(&sc->mutex); >>=20 >> return (0); >> } >> @@ -1142,7 +1142,7 @@ arm_gic_alloc_msix(device_t dev, device_t = child, device_t *pic, >>=20 >> sc =3D device_get_softc(dev); >>=20 >> - mtx_lock(&sc->mutex); >> + mtx_lock_spin(&sc->mutex); >> /* Find an unused interrupt */ >> for (irq =3D sc->sc_spi_start; irq < sc->sc_spi_end; irq++) { >> KASSERT((sc->gic_irqs[irq].gi_flags & GI_FLAG_MSI) !=3D = 0, >> @@ -1152,13 +1152,13 @@ arm_gic_alloc_msix(device_t dev, device_t = child, device_t *pic, >> } >> /* No free interrupt was found */ >> if (irq =3D=3D sc->sc_spi_end) { >> - mtx_unlock(&sc->mutex); >> + mtx_unlock_spin(&sc->mutex); >> return (ENXIO); >> } >>=20 >> /* Mark the interrupt as used */ >> sc->gic_irqs[irq].gi_flags |=3D GI_FLAG_MSI_USED; >> - mtx_unlock(&sc->mutex); >> + mtx_unlock_spin(&sc->mutex); >>=20 >> *isrcp =3D (struct intr_irqsrc *)&sc->gic_irqs[irq]; >> *pic =3D dev; >> @@ -1178,9 +1178,9 @@ arm_gic_release_msix(device_t dev, device_t = child, struct intr_irqsrc *isrc) >> KASSERT((gi->gi_flags & GI_FLAG_MSI_USED) =3D=3D = GI_FLAG_MSI_USED, >> ("%s: Trying to release an unused MSI-X interrupt", = __func__)); >>=20 >> - mtx_lock(&sc->mutex); >> + mtx_lock_spin(&sc->mutex); >> gi->gi_flags &=3D ~GI_FLAG_MSI_USED; >> - mtx_unlock(&sc->mutex); >> + mtx_unlock_spin(&sc->mutex); >>=20 >> return (0); >> } >=20 > Thank you for the patch, it fixes the MSI-X in my setup, but in order > to operate properly on Marvell SoCs (equipped with a standard GICv2m), > I have to remove the asserts, which were added in c6f3076d4405 (Move > the GICv2m msi handling to the parent): >=20 > diff --git a/sys/arm/arm/gic.c b/sys/arm/arm/gic.c > index 89db4e324600..b5d72a2a6c49 100644 > --- a/sys/arm/arm/gic.c > +++ b/sys/arm/arm/gic.c > @@ -528,8 +528,6 @@ arm_gic_write_ivar(device_t dev, device_t child, > int which, uintptr_t value) > * GIC_IVAR_MBI_START must be set once and first. This = allows > * us to reserve the registers when GIC_IVAR_MBI_COUNT = is set. > */ > - MPASS(sc->sc_spi_start =3D=3D 0); > - MPASS(sc->sc_spi_count =3D=3D 0); > MPASS(value >=3D GIC_FIRST_SPI); > MPASS(value < sc->nirqs); >=20 > @@ -537,7 +535,6 @@ arm_gic_write_ivar(device_t dev, device_t child, > int which, uintptr_t value) > return (0); > case GIC_IVAR_MBI_COUNT: > MPASS(sc->sc_spi_start !=3D 0); > - MPASS(sc->sc_spi_count =3D=3D 0); >=20 > sc->sc_spi_count =3D value; > sc->sc_spi_end =3D sc->sc_spi_start + sc->sc_spi_count; >=20 > Any thoughts? Can you try the patch in https://reviews.freebsd.org/D32224. The above = change is to check there is only a single mbi range, however it appears = your hardware has multiple gicv2m devices so will try to reserve = multiple mbi ranges. Andrew From owner-dev-commits-src-main@freebsd.org Wed Sep 29 16:45:22 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 77202676D69; Wed, 29 Sep 2021 16:45:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HKMgQ2zSkz4TxZ; Wed, 29 Sep 2021 16:45:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 463EB1BD85; Wed, 29 Sep 2021 16:45:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18TGjMcx042119; Wed, 29 Sep 2021 16:45:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18TGjM7m042118; Wed, 29 Sep 2021 16:45:22 GMT (envelope-from git) Date: Wed, 29 Sep 2021 16:45:22 GMT Message-Id: <202109291645.18TGjM7m042118@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 0cfc8b10edd7 - main - f00f: We don't need giant to create IDT for workaround. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 0cfc8b10edd78c9e2738e82544fe4c4db401aea1 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Sep 2021 16:45:22 -0000 The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=0cfc8b10edd78c9e2738e82544fe4c4db401aea1 commit 0cfc8b10edd78c9e2738e82544fe4c4db401aea1 Author: Warner Losh AuthorDate: 2021-09-29 16:19:51 +0000 Commit: Warner Losh CommitDate: 2021-09-29 16:35:21 +0000 f00f: We don't need giant to create IDT for workaround. We don't need to assert we have Giant here. All machines that require the F00F workaround are UP and interrupts are disabled. Since we are single threaded, it's safe to allocate the IDT area with pmap_trm_alloc, interact with the current idt table and replace the IDT table without any Giant locking. Sponsored by: Netflix Reviewed by: kib, markj Differential Revision: https://reviews.freebsd.org/D31839 --- sys/i386/i386/machdep.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/sys/i386/i386/machdep.c b/sys/i386/i386/machdep.c index 1366939cda6e..942ff8c2ada8 100644 --- a/sys/i386/i386/machdep.c +++ b/sys/i386/i386/machdep.c @@ -2719,8 +2719,6 @@ f00f_hack(void *unused) if (!has_f00f_bug) return; - GIANT_REQUIRED; - printf("Intel Pentium detected, installing workaround for F00F bug\n"); tmp = (vm_offset_t)pmap_trm_alloc(PAGE_SIZE * 3, M_NOWAIT | M_ZERO); From owner-dev-commits-src-main@freebsd.org Wed Sep 29 16:55:42 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id ACB8E677610; Wed, 29 Sep 2021 16:55:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HKMvL4FWxz4WN0; Wed, 29 Sep 2021 16:55:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6DE861C003; Wed, 29 Sep 2021 16:55:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18TGtggG055219; Wed, 29 Sep 2021 16:55:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18TGtgkk055218; Wed, 29 Sep 2021 16:55:42 GMT (envelope-from git) Date: Wed, 29 Sep 2021 16:55:42 GMT Message-Id: <202109291655.18TGtgkk055218@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: f6de51d3e031 - main - Add the arm64 table attributes and use them MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f6de51d3e0315891f6ea9d12340b98336df409b7 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Sep 2021 16:55:42 -0000 The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=f6de51d3e0315891f6ea9d12340b98336df409b7 commit f6de51d3e0315891f6ea9d12340b98336df409b7 Author: Andrew Turner AuthorDate: 2021-09-23 15:00:55 +0000 Commit: Andrew Turner CommitDate: 2021-09-29 16:53:41 +0000 Add the arm64 table attributes and use them Add the table page table attributes on arm64 and use them to add restrictions to the block and page entries below them. This ensures we are unable to increase the permissions in these last level entries without also changing them in the upper levels. Use the attributes to ensure the kernel can't execute from userspace memory and vice versa, userspace has no access to read or write kernel memory, and that the DMAP region is non-executable. Reviewed by: alc, kib Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D32081 --- sys/arm64/arm64/locore.S | 1 + sys/arm64/arm64/pmap.c | 25 +++++++++++++++++++------ sys/arm64/include/pte.h | 9 +++++++++ 3 files changed, 29 insertions(+), 6 deletions(-) diff --git a/sys/arm64/arm64/locore.S b/sys/arm64/arm64/locore.S index dcc370326671..92415aab1555 100644 --- a/sys/arm64/arm64/locore.S +++ b/sys/arm64/arm64/locore.S @@ -552,6 +552,7 @@ LENTRY(link_l0_pagetable) /* Build the L0 block entry */ mov x12, #L0_TABLE + orr x12, x12, #(TATTR_UXN_TABLE | TATTR_AP_TABLE_NO_EL0) /* Only use the output address bits */ lsr x9, x9, #PAGE_SHIFT diff --git a/sys/arm64/arm64/pmap.c b/sys/arm64/arm64/pmap.c index e8a04ee3f2c3..95cb848df14d 100644 --- a/sys/arm64/arm64/pmap.c +++ b/sys/arm64/arm64/pmap.c @@ -789,7 +789,8 @@ pmap_bootstrap_dmap(vm_offset_t kern_l1, vm_paddr_t min_pa, freemempos += PAGE_SIZE; pmap_store(&pagetable_dmap[l1_slot], - (l2_pa & ~Ln_TABLE_MASK) | L1_TABLE); + (l2_pa & ~Ln_TABLE_MASK) | + TATTR_PXN_TABLE | L1_TABLE); memset(l2, 0, PAGE_SIZE); } @@ -1873,14 +1874,26 @@ _pmap_alloc_l3(pmap_t pmap, vm_pindex_t ptepindex, struct rwlock **lockp) */ if (ptepindex >= (NUL2E + NUL1E)) { - pd_entry_t *l0; + pd_entry_t *l0p, l0e; vm_pindex_t l0index; l0index = ptepindex - (NUL2E + NUL1E); - l0 = &pmap->pm_l0[l0index]; - KASSERT((pmap_load(l0) & ATTR_DESCR_VALID) == 0, - ("%s: L0 entry %#lx is valid", __func__, pmap_load(l0))); - pmap_store(l0, VM_PAGE_TO_PHYS(m) | L0_TABLE); + l0p = &pmap->pm_l0[l0index]; + KASSERT((pmap_load(l0p) & ATTR_DESCR_VALID) == 0, + ("%s: L0 entry %#lx is valid", __func__, pmap_load(l0p))); + l0e = VM_PAGE_TO_PHYS(m) | L0_TABLE; + + /* + * Mark all kernel memory as not accessible from userspace + * and userspace memory as not executable from the kernel. + * This has been done for the bootstrap L0 entries in + * locore.S. + */ + if (pmap == kernel_pmap) + l0e |= TATTR_UXN_TABLE | TATTR_AP_TABLE_NO_EL0; + else + l0e |= TATTR_PXN_TABLE; + pmap_store(l0p, l0e); } else if (ptepindex >= NUL2E) { vm_pindex_t l0index, l1index; pd_entry_t *l0, *l1; diff --git a/sys/arm64/include/pte.h b/sys/arm64/include/pte.h index b3bec720e9f9..6b816464c167 100644 --- a/sys/arm64/include/pte.h +++ b/sys/arm64/include/pte.h @@ -38,6 +38,15 @@ typedef uint64_t pd_entry_t; /* page directory entry */ typedef uint64_t pt_entry_t; /* page table entry */ #endif +/* Table attributes */ +#define TATTR_MASK UINT64_C(0xfff8000000000000) +#define TATTR_AP_TABLE_MASK (3UL << 61) +#define TATTR_AP_TABLE_RO (2UL << 61) +#define TATTR_AP_TABLE_NO_EL0 (1UL << 61) +#define TATTR_UXN_TABLE (1UL << 60) +#define TATTR_PXN_TABLE (1UL << 59) +/* Bits 58:51 are ignored */ + /* Block and Page attributes */ #define ATTR_MASK_H UINT64_C(0xfffc000000000000) #define ATTR_MASK_L UINT64_C(0x0000000000000fff) From owner-dev-commits-src-main@freebsd.org Wed Sep 29 17:23:11 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5EDFB678084; Wed, 29 Sep 2021 17:23:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HKNW32CQZz4Z1x; Wed, 29 Sep 2021 17:23:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2C7231C602; Wed, 29 Sep 2021 17:23:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18THNB0J095834; Wed, 29 Sep 2021 17:23:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18THNBRr095833; Wed, 29 Sep 2021 17:23:11 GMT (envelope-from git) Date: Wed, 29 Sep 2021 17:23:11 GMT Message-Id: <202109291723.18THNBRr095833@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Jamie Gritton Subject: git: 747a47261eee - main - Fix error return of kern.ipc.posix_shm_list, which caused it (and thus "posixshmcontrol ls") to fail for all jails that didn't happen to own the last shm object in the list. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jamie X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 747a47261eee59b6e9c437cd2c1b3979df5c32ac Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Sep 2021 17:23:11 -0000 The branch main has been updated by jamie: URL: https://cgit.FreeBSD.org/src/commit/?id=747a47261eee59b6e9c437cd2c1b3979df5c32ac commit 747a47261eee59b6e9c437cd2c1b3979df5c32ac Author: Jamie Gritton AuthorDate: 2021-09-29 17:20:36 +0000 Commit: Jamie Gritton CommitDate: 2021-09-29 17:20:36 +0000 Fix error return of kern.ipc.posix_shm_list, which caused it (and thus "posixshmcontrol ls") to fail for all jails that didn't happen to own the last shm object in the list. --- sys/kern/uipc_shm.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sys/kern/uipc_shm.c b/sys/kern/uipc_shm.c index c672c0477b95..63c4250f640f 100644 --- a/sys/kern/uipc_shm.c +++ b/sys/kern/uipc_shm.c @@ -2045,8 +2045,10 @@ sysctl_posix_shm_list(SYSCTL_HANDLER_ARGS) LIST_FOREACH(shmm, &shm_dictionary[i], sm_link) { error = shm_fill_kinfo_locked(shmm->sm_shmfd, &kif, true); - if (error == EPERM) + if (error == EPERM) { + error = 0; continue; + } if (error != 0) break; pack_kinfo(&kif); From owner-dev-commits-src-main@freebsd.org Wed Sep 29 18:05:05 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 70C596785E5; Wed, 29 Sep 2021 18:05:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HKPRP2kHWz4dLy; Wed, 29 Sep 2021 18:05:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3D64A1CD1A; Wed, 29 Sep 2021 18:05:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18TI55wO049922; Wed, 29 Sep 2021 18:05:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18TI55mL049921; Wed, 29 Sep 2021 18:05:05 GMT (envelope-from git) Date: Wed, 29 Sep 2021 18:05:05 GMT Message-Id: <202109291805.18TI55mL049921@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kyle Evans Subject: git: f6787614fd4d - main - cmp: accept SI suffixes for skip1 and skip2 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevans X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f6787614fd4db2a9d5e649af0e819852ebd5a19d Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Sep 2021 18:05:05 -0000 The branch main has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=f6787614fd4db2a9d5e649af0e819852ebd5a19d commit f6787614fd4db2a9d5e649af0e819852ebd5a19d Author: Kyle Evans AuthorDate: 2021-09-23 05:17:07 +0000 Commit: Kyle Evans CommitDate: 2021-09-29 18:03:34 +0000 cmp: accept SI suffixes for skip1 and skip2 This is compatible with GNU cmp. Reviewed by: bapt (earlier version), markj, imp Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D32071 --- usr.bin/cmp/Makefile | 2 ++ usr.bin/cmp/cmp.1 | 16 +++++++++++++++- usr.bin/cmp/cmp.c | 14 ++++++++++++-- usr.bin/cmp/tests/cmp_test2.sh | 17 +++++++++++++++++ 4 files changed, 46 insertions(+), 3 deletions(-) diff --git a/usr.bin/cmp/Makefile b/usr.bin/cmp/Makefile index bcde84f0255a..0392fd368503 100644 --- a/usr.bin/cmp/Makefile +++ b/usr.bin/cmp/Makefile @@ -6,6 +6,8 @@ PROG= cmp SRCS= cmp.c link.c misc.c regular.c special.c +LIBADD= util + HAS_TESTS= SUBDIR.${MK_TESTS}+= tests diff --git a/usr.bin/cmp/cmp.1 b/usr.bin/cmp/cmp.1 index fc05fb893147..6980f73e7be5 100644 --- a/usr.bin/cmp/cmp.1 +++ b/usr.bin/cmp/cmp.1 @@ -31,7 +31,7 @@ .\" @(#)cmp.1 8.1 (Berkeley) 6/6/93 .\" $FreeBSD$ .\" -.Dd June 20, 2020 +.Dd September 23, 2021 .Dt CMP 1 .Os .Sh NAME @@ -86,6 +86,11 @@ and respectively, where the comparison will begin. The offset is decimal by default, but may be expressed as a hexadecimal or octal value by preceding it with a leading ``0x'' or ``0''. +.Pp +.Ar skip1 +and +.Ar skip2 +may also be specified with SI size suffixes. .Sh EXIT STATUS The .Nm @@ -164,8 +169,17 @@ The and .Fl z options are extensions to the standard. +.Ar skip1 +and +.Ar skip2 +arguments are extensions to the standard. .Sh HISTORY A .Nm command appeared in .At v1 . +.Sh BUGS +The phrase +.Dq SI size suffixes +above refers to the traditional power of two convention, as described in +.Xr expand_number 3 . diff --git a/usr.bin/cmp/cmp.c b/usr.bin/cmp/cmp.c index 47f9b671985c..bab69125e83e 100644 --- a/usr.bin/cmp/cmp.c +++ b/usr.bin/cmp/cmp.c @@ -58,6 +58,8 @@ __FBSDID("$FreeBSD$"); #include #include +#include + #include "extern.h" bool lflag, sflag, xflag, zflag; @@ -81,6 +83,7 @@ main(int argc, char *argv[]) bool special; const char *file1, *file2; + skip1 = skip2 = 0; oflag = O_RDONLY; while ((ch = getopt_long(argc, argv, "+hlsxz", long_opts, NULL)) != -1) switch (ch) { @@ -145,8 +148,15 @@ main(int argc, char *argv[]) exit(ERR_EXIT); } - skip1 = argc > 2 ? strtol(argv[2], NULL, 0) : 0; - skip2 = argc == 4 ? strtol(argv[3], NULL, 0) : 0; + if (argc > 2 && expand_number(argv[2], &skip1) < 0) { + fprintf(stderr, "Invalid skip1: %s\n", argv[2]); + usage(); + } + + if (argc == 4 && expand_number(argv[3], &skip2) < 0) { + fprintf(stderr, "Invalid skip2: %s\n", argv[3]); + usage(); + } if (sflag && skip1 == 0 && skip2 == 0) zflag = true; diff --git a/usr.bin/cmp/tests/cmp_test2.sh b/usr.bin/cmp/tests/cmp_test2.sh index 7f9801fc92bd..334e9f357730 100755 --- a/usr.bin/cmp/tests/cmp_test2.sh +++ b/usr.bin/cmp/tests/cmp_test2.sh @@ -75,9 +75,26 @@ pr252542_body() atf_check -s exit:1 -o ignore cmp -z a b 4 3 } +atf_test_case skipsuff +skipsuff_head() +{ + atf_set "descr" "Test cmp(1) accepting SI suffixes on skips" +} +skipsuff_body() +{ + + jot -nb a -s '' 1028 > a + jot -nb b -s '' 1024 > b + jot -nb a -s '' 4 >> b + + atf_check -s exit:1 -o ignore cmp -s a b + atf_check -s exit:0 cmp -s a b 1k 1k +} + atf_init_test_cases() { atf_add_test_case special atf_add_test_case symlink atf_add_test_case pr252542 + atf_add_test_case skipsuff } From owner-dev-commits-src-main@freebsd.org Wed Sep 29 18:05:06 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 96D42678A05; Wed, 29 Sep 2021 18:05:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HKPRQ3RP3z4dRC; Wed, 29 Sep 2021 18:05:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 559951CF04; Wed, 29 Sep 2021 18:05:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18TI56v9049951; Wed, 29 Sep 2021 18:05:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18TI568j049950; Wed, 29 Sep 2021 18:05:06 GMT (envelope-from git) Date: Wed, 29 Sep 2021 18:05:06 GMT Message-Id: <202109291805.18TI568j049950@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kyle Evans Subject: git: 4e380e847460 - main - cmp: add -n, --bytes to limit number of bytes to compare MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevans X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 4e380e8474609875c4cf5277b3755ac29079a8b5 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Sep 2021 18:05:06 -0000 The branch main has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=4e380e8474609875c4cf5277b3755ac29079a8b5 commit 4e380e8474609875c4cf5277b3755ac29079a8b5 Author: Kyle Evans AuthorDate: 2021-09-23 05:26:52 +0000 Commit: Kyle Evans CommitDate: 2021-09-29 18:03:34 +0000 cmp: add -n, --bytes to limit number of bytes to compare This is compatible with GNU cmp. Reviewed by: markj Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D32072 --- usr.bin/cmp/cmp.1 | 6 ++++++ usr.bin/cmp/cmp.c | 18 +++++++++++++----- usr.bin/cmp/extern.h | 7 ++++--- usr.bin/cmp/link.c | 6 ++++-- usr.bin/cmp/regular.c | 8 +++++--- usr.bin/cmp/special.c | 4 ++-- usr.bin/cmp/tests/cmp_test2.sh | 23 +++++++++++++++++++++++ 7 files changed, 57 insertions(+), 15 deletions(-) diff --git a/usr.bin/cmp/cmp.1 b/usr.bin/cmp/cmp.1 index 6980f73e7be5..511e09ac8628 100644 --- a/usr.bin/cmp/cmp.1 +++ b/usr.bin/cmp/cmp.1 @@ -41,6 +41,7 @@ .Nm .Op Fl l | s | x .Op Fl hz +.Op Fl -bytes Ns Cm = Ns Ar num .Ar file1 file2 .Op Ar skip1 Op Ar skip2 .Sh DESCRIPTION @@ -62,6 +63,10 @@ Do not follow symbolic links. .It Fl l , Fl -verbose Print the byte number (decimal) and the differing byte values (octal) for each difference. +.It Fl n Ar num , Fl -bytes= Ns num +Only compare up to +.Ar num +bytes. .It Fl s , Fl -silent , Fl -quiet Print nothing for differing files; return exit status only. @@ -165,6 +170,7 @@ utility is expected to be compatible. The .Fl h , +.Fl n , .Fl x , and .Fl z diff --git a/usr.bin/cmp/cmp.c b/usr.bin/cmp/cmp.c index bab69125e83e..384c273f4632 100644 --- a/usr.bin/cmp/cmp.c +++ b/usr.bin/cmp/cmp.c @@ -67,6 +67,7 @@ bool lflag, sflag, xflag, zflag; static const struct option long_opts[] = { {"verbose", no_argument, NULL, 'l'}, + {"bytes", required_argument, NULL, 'n'}, {"silent", no_argument, NULL, 's'}, {"quiet", no_argument, NULL, 's'}, {NULL, no_argument, NULL, 0} @@ -78,14 +79,14 @@ int main(int argc, char *argv[]) { struct stat sb1, sb2; - off_t skip1, skip2; + off_t skip1, skip2, limit; int ch, fd1, fd2, oflag; bool special; const char *file1, *file2; skip1 = skip2 = 0; oflag = O_RDONLY; - while ((ch = getopt_long(argc, argv, "+hlsxz", long_opts, NULL)) != -1) + while ((ch = getopt_long(argc, argv, "+hln:sxz", long_opts, NULL)) != -1) switch (ch) { case 'h': /* Don't follow symlinks */ oflag |= O_NOFOLLOW; @@ -93,6 +94,13 @@ main(int argc, char *argv[]) case 'l': /* print all differences */ lflag = true; break; + case 'n': /* Limit */ + if (expand_number(optarg, &limit) < 0 || limit < 0) { + fprintf(stderr, "Invalid --bytes: %s\n", + optarg); + usage(); + } + break; case 's': /* silent run */ sflag = true; break; @@ -163,7 +171,7 @@ main(int argc, char *argv[]) if (fd1 == -1) { if (fd2 == -1) { - c_link(file1, skip1, file2, skip2); + c_link(file1, skip1, file2, skip2, limit); exit(0); } else if (!sflag) errx(ERR_EXIT, "%s: Not a symbolic link", file2); @@ -201,7 +209,7 @@ main(int argc, char *argv[]) } if (special) - c_special(fd1, file1, skip1, fd2, file2, skip2); + c_special(fd1, file1, skip1, fd2, file2, skip2, limit); else { if (zflag && sb1.st_size != sb2.st_size) { if (!sflag) @@ -210,7 +218,7 @@ main(int argc, char *argv[]) exit(DIFF_EXIT); } c_regular(fd1, file1, skip1, sb1.st_size, - fd2, file2, skip2, sb2.st_size); + fd2, file2, skip2, sb2.st_size, limit); } exit(0); } diff --git a/usr.bin/cmp/extern.h b/usr.bin/cmp/extern.h index 82c5ea42b175..803319a50ca4 100644 --- a/usr.bin/cmp/extern.h +++ b/usr.bin/cmp/extern.h @@ -38,9 +38,10 @@ #define DIFF_EXIT 1 #define ERR_EXIT 2 /* error exit code */ -void c_link(const char *, off_t, const char *, off_t); -void c_regular(int, const char *, off_t, off_t, int, const char *, off_t, off_t); -void c_special(int, const char *, off_t, int, const char *, off_t); +void c_link(const char *, off_t, const char *, off_t, off_t); +void c_regular(int, const char *, off_t, off_t, int, const char *, off_t, + off_t, off_t); +void c_special(int, const char *, off_t, int, const char *, off_t, off_t); void diffmsg(const char *, const char *, off_t, off_t); void eofmsg(const char *); diff --git a/usr.bin/cmp/link.c b/usr.bin/cmp/link.c index 9193147e830e..f0b4482a5792 100644 --- a/usr.bin/cmp/link.c +++ b/usr.bin/cmp/link.c @@ -40,7 +40,8 @@ __FBSDID("$FreeBSD$"); #include "extern.h" void -c_link(const char *file1, off_t skip1, const char *file2, off_t skip2) +c_link(const char *file1, off_t skip1, const char *file2, off_t skip2, + off_t limit) { char buf1[PATH_MAX], *p1; char buf2[PATH_MAX], *p2; @@ -72,7 +73,8 @@ c_link(const char *file1, off_t skip1, const char *file2, off_t skip2) dfound = 0; byte = 1; - for (p1 = buf1 + skip1, p2 = buf2 + skip2; *p1 && *p2; p1++, p2++) { + for (p1 = buf1 + skip1, p2 = buf2 + skip2; + *p1 && *p2 && (limit == 0 || byte <= limit); p1++, p2++) { if ((ch = *p1) != *p2) { if (xflag) { dfound = 1; diff --git a/usr.bin/cmp/regular.c b/usr.bin/cmp/regular.c index fe639663a560..a60398620282 100644 --- a/usr.bin/cmp/regular.c +++ b/usr.bin/cmp/regular.c @@ -60,7 +60,7 @@ static void segv_handler(int); void c_regular(int fd1, const char *file1, off_t skip1, off_t len1, - int fd2, const char *file2, off_t skip2, off_t len2) + int fd2, const char *file2, off_t skip2, off_t len2, off_t limit) { struct sigaction act, oact; cap_rights_t rights; @@ -86,15 +86,17 @@ c_regular(int fd1, const char *file1, off_t skip1, off_t len1, off2 = ROUNDPAGE(skip2); length = MIN(len1, len2); + if (limit > 0) + length = MIN(length, limit); if ((m1 = remmap(NULL, fd1, off1)) == NULL) { - c_special(fd1, file1, skip1, fd2, file2, skip2); + c_special(fd1, file1, skip1, fd2, file2, skip2, limit); return; } if ((m2 = remmap(NULL, fd2, off2)) == NULL) { munmap(m1, MMAP_CHUNK); - c_special(fd1, file1, skip1, fd2, file2, skip2); + c_special(fd1, file1, skip1, fd2, file2, skip2, limit); return; } diff --git a/usr.bin/cmp/special.c b/usr.bin/cmp/special.c index 930fcd5492ff..25f755f6e70a 100644 --- a/usr.bin/cmp/special.c +++ b/usr.bin/cmp/special.c @@ -49,7 +49,7 @@ __FBSDID("$FreeBSD$"); void c_special(int fd1, const char *file1, off_t skip1, - int fd2, const char *file2, off_t skip2) + int fd2, const char *file2, off_t skip2, off_t limit) { int ch1, ch2; off_t byte, line; @@ -76,7 +76,7 @@ c_special(int fd1, const char *file1, off_t skip1, if (getc(fp2) == EOF) goto eof; - for (byte = line = 1;; ++byte) { + for (byte = line = 1; limit == 0 || byte <= limit; ++byte) { ch1 = getc(fp1); ch2 = getc(fp2); if (ch1 == EOF || ch2 == EOF) diff --git a/usr.bin/cmp/tests/cmp_test2.sh b/usr.bin/cmp/tests/cmp_test2.sh index 334e9f357730..c513984daf8b 100755 --- a/usr.bin/cmp/tests/cmp_test2.sh +++ b/usr.bin/cmp/tests/cmp_test2.sh @@ -91,10 +91,33 @@ skipsuff_body() atf_check -s exit:0 cmp -s a b 1k 1k } +atf_test_case limit +limit_head() +{ + atf_set "descr" "Test cmp(1) -n (limit)" +} +limit_body() +{ + echo -n "aaaabbbb" > a + echo -n "aaaaxxxx" > b + + atf_check -s exit:1 -o ignore cmp -s a b + atf_check -s exit:0 cmp -sn 4 a b + atf_check -s exit:0 cmp -sn 3 a b + atf_check -s exit:1 -o ignore cmp -sn 5 a b + + # Test special, too. The implementation for link is effectively + # identical. + atf_check -s exit:0 -e empty -x "cat a | cmp -sn 4 b -" + atf_check -s exit:0 -e empty -x "cat a | cmp -sn 3 b -" + atf_check -s exit:1 -o ignore -x "cat a | cmp -sn 5 b -" +} + atf_init_test_cases() { atf_add_test_case special atf_add_test_case symlink atf_add_test_case pr252542 atf_add_test_case skipsuff + atf_add_test_case limit } From owner-dev-commits-src-main@freebsd.org Wed Sep 29 18:05:09 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1735C67896C; Wed, 29 Sep 2021 18:05:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HKPRS5PpHz4dJG; Wed, 29 Sep 2021 18:05:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9B1D21CE86; Wed, 29 Sep 2021 18:05:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18TI58ef050001; Wed, 29 Sep 2021 18:05:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18TI58NI050000; Wed, 29 Sep 2021 18:05:08 GMT (envelope-from git) Date: Wed, 29 Sep 2021 18:05:08 GMT Message-Id: <202109291805.18TI58NI050000@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kyle Evans Subject: git: f66b9b40f403 - main - cmp: add -b, --print-bytes MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevans X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f66b9b40f403f7c30fec3c4ceed93c6e8fafa8ac Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Sep 2021 18:05:09 -0000 The branch main has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=f66b9b40f403f7c30fec3c4ceed93c6e8fafa8ac commit f66b9b40f403f7c30fec3c4ceed93c6e8fafa8ac Author: Kyle Evans AuthorDate: 2021-09-23 05:46:30 +0000 Commit: Kyle Evans CommitDate: 2021-09-29 18:04:57 +0000 cmp: add -b, --print-bytes This is compatible with GNU cmp. Reviewed by: bapt, markj (earlier version) Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D32074 --- usr.bin/cmp/cmp.1 | 5 ++++- usr.bin/cmp/cmp.c | 8 ++++++-- usr.bin/cmp/extern.h | 4 ++-- usr.bin/cmp/link.c | 10 +++++++--- usr.bin/cmp/misc.c | 14 ++++++++++++-- usr.bin/cmp/regular.c | 10 +++++++--- usr.bin/cmp/special.c | 11 ++++++++--- usr.bin/cmp/tests/Makefile | 5 +++++ usr.bin/cmp/tests/b_flag.out | 1 + usr.bin/cmp/tests/bl_flag.out | 1 + usr.bin/cmp/tests/cmp_test2.sh | 17 +++++++++++++++++ 11 files changed, 70 insertions(+), 16 deletions(-) diff --git a/usr.bin/cmp/cmp.1 b/usr.bin/cmp/cmp.1 index 5a56802bd22e..3e616bbe806e 100644 --- a/usr.bin/cmp/cmp.1 +++ b/usr.bin/cmp/cmp.1 @@ -40,7 +40,7 @@ .Sh SYNOPSIS .Nm .Op Fl l | s | x -.Op Fl hz +.Op Fl bhz .Op Fl -ignore-initial Ns Cm = Ns Ar num1 Ns Op :num2 .Op Fl -bytes Ns Cm = Ns Ar num .Ar file1 file2 @@ -59,6 +59,8 @@ Bytes and lines are numbered beginning with one. .Pp The following options are available: .Bl -tag -width indent +.It Fl b , Fl -print-bytes +Print each byte when a difference is found. .It Fl h Do not follow symbolic links. .It Fl i Ar num1 Ns Oo :num2 Oc , Fl -ignore-initial= Ns Ar num1 Ns Op :num2 @@ -187,6 +189,7 @@ utility is expected to be .St -p1003.2 compatible. The +.Fl b , .Fl h , .Fl i , .Fl n , diff --git a/usr.bin/cmp/cmp.c b/usr.bin/cmp/cmp.c index 256cef8a0c31..98ae96c73375 100644 --- a/usr.bin/cmp/cmp.c +++ b/usr.bin/cmp/cmp.c @@ -62,10 +62,11 @@ __FBSDID("$FreeBSD$"); #include "extern.h" -bool lflag, sflag, xflag, zflag; +bool bflag, lflag, sflag, xflag, zflag; static const struct option long_opts[] = { + {"print-bytes", no_argument, NULL, 'b'}, {"ignore-initial", required_argument, NULL, 'i'}, {"verbose", no_argument, NULL, 'l'}, {"bytes", required_argument, NULL, 'n'}, @@ -106,8 +107,11 @@ main(int argc, char *argv[]) skip1 = skip2 = 0; oflag = O_RDONLY; - while ((ch = getopt_long(argc, argv, "+hi:ln:sxz", long_opts, NULL)) != -1) + while ((ch = getopt_long(argc, argv, "+bhi:ln:sxz", long_opts, NULL)) != -1) switch (ch) { + case 'b': /* Print bytes */ + bflag = true; + break; case 'h': /* Don't follow symlinks */ oflag |= O_NOFOLLOW; break; diff --git a/usr.bin/cmp/extern.h b/usr.bin/cmp/extern.h index 803319a50ca4..d98daf424995 100644 --- a/usr.bin/cmp/extern.h +++ b/usr.bin/cmp/extern.h @@ -42,7 +42,7 @@ void c_link(const char *, off_t, const char *, off_t, off_t); void c_regular(int, const char *, off_t, off_t, int, const char *, off_t, off_t, off_t); void c_special(int, const char *, off_t, int, const char *, off_t, off_t); -void diffmsg(const char *, const char *, off_t, off_t); +void diffmsg(const char *, const char *, off_t, off_t, int, int); void eofmsg(const char *); -extern bool lflag, sflag, xflag, zflag; +extern bool bflag, lflag, sflag, xflag, zflag; diff --git a/usr.bin/cmp/link.c b/usr.bin/cmp/link.c index f0b4482a5792..e01a5911faf7 100644 --- a/usr.bin/cmp/link.c +++ b/usr.bin/cmp/link.c @@ -82,10 +82,14 @@ c_link(const char *file1, off_t skip1, const char *file2, off_t skip2, (long long)byte - 1, ch, *p2); } else if (lflag) { dfound = 1; - (void)printf("%6lld %3o %3o\n", - (long long)byte, ch, *p2); + if (bflag) + (void)printf("%6lld %3o %c %3o %c\n", + (long long)byte, ch, ch, *p2, *p2); + else + (void)printf("%6lld %3o %3o\n", + (long long)byte, ch, *p2); } else - diffmsg(file1, file2, byte, 1); + diffmsg(file1, file2, byte, 1, ch, *p2); /* NOTREACHED */ } byte++; diff --git a/usr.bin/cmp/misc.c b/usr.bin/cmp/misc.c index 1e84f0d7a527..1dba34d28792 100644 --- a/usr.bin/cmp/misc.c +++ b/usr.bin/cmp/misc.c @@ -56,10 +56,20 @@ eofmsg(const char *file) } void -diffmsg(const char *file1, const char *file2, off_t byte, off_t line) +diffmsg(const char *file1, const char *file2, off_t byte, off_t line, + int b1, int b2) { - if (!sflag) + if (sflag) + goto out; + + if (bflag) { + (void)printf("%s %s differ: char %lld, line %lld is %3o %c %3o %c\n", + file1, file2, (long long)byte, (long long)line, b1, b1, + b2, b2); + } else { (void)printf("%s %s differ: char %lld, line %lld\n", file1, file2, (long long)byte, (long long)line); + } +out: exit(DIFF_EXIT); } diff --git a/usr.bin/cmp/regular.c b/usr.bin/cmp/regular.c index a60398620282..d270aeeac396 100644 --- a/usr.bin/cmp/regular.c +++ b/usr.bin/cmp/regular.c @@ -127,10 +127,14 @@ c_regular(int fd1, const char *file1, off_t skip1, off_t len1, (long long)byte - 1, ch, *p2); } else if (lflag) { dfound = 1; - (void)printf("%6lld %3o %3o\n", - (long long)byte, ch, *p2); + if (bflag) + (void)printf("%6lld %3o %c %3o %c\n", + (long long)byte, ch, ch, *p2, *p2); + else + (void)printf("%6lld %3o %3o\n", + (long long)byte, ch, *p2); } else - diffmsg(file1, file2, byte, line); + diffmsg(file1, file2, byte, line, ch, *p2); /* NOTREACHED */ } if (ch == '\n') diff --git a/usr.bin/cmp/special.c b/usr.bin/cmp/special.c index 25f755f6e70a..c206a317c0ef 100644 --- a/usr.bin/cmp/special.c +++ b/usr.bin/cmp/special.c @@ -88,10 +88,15 @@ c_special(int fd1, const char *file1, off_t skip1, (long long)byte - 1, ch1, ch2); } else if (lflag) { dfound = 1; - (void)printf("%6lld %3o %3o\n", - (long long)byte, ch1, ch2); + if (bflag) + (void)printf("%6lld %3o %c %3o %c\n", + (long long)byte, ch1, ch1, ch2, + ch2); + else + (void)printf("%6lld %3o %3o\n", + (long long)byte, ch1, ch2); } else { - diffmsg(file1, file2, byte, line); + diffmsg(file1, file2, byte, line, ch1, ch2); /* NOTREACHED */ } } diff --git a/usr.bin/cmp/tests/Makefile b/usr.bin/cmp/tests/Makefile index 087f32f4185f..99469ba42243 100644 --- a/usr.bin/cmp/tests/Makefile +++ b/usr.bin/cmp/tests/Makefile @@ -2,9 +2,14 @@ .include +PACKAGE= tests + ATF_TESTS_SH+= cmp_test2 NETBSD_ATF_TESTS_SH= cmp_test +${PACKAGE}FILES+= b_flag.out +${PACKAGE}FILES+= bl_flag.out + .include .include diff --git a/usr.bin/cmp/tests/b_flag.out b/usr.bin/cmp/tests/b_flag.out new file mode 100644 index 000000000000..bb3d288716b0 --- /dev/null +++ b/usr.bin/cmp/tests/b_flag.out @@ -0,0 +1 @@ +a b differ: char 3, line 1 is 143 c 144 d diff --git a/usr.bin/cmp/tests/bl_flag.out b/usr.bin/cmp/tests/bl_flag.out new file mode 100644 index 000000000000..8ec9007d7ed3 --- /dev/null +++ b/usr.bin/cmp/tests/bl_flag.out @@ -0,0 +1 @@ + 3 143 c 144 d diff --git a/usr.bin/cmp/tests/cmp_test2.sh b/usr.bin/cmp/tests/cmp_test2.sh index 893ee59076c3..c264827646ca 100755 --- a/usr.bin/cmp/tests/cmp_test2.sh +++ b/usr.bin/cmp/tests/cmp_test2.sh @@ -118,6 +118,22 @@ limit_body() atf_check -s exit:1 -o ignore -x "cat a | cmp -sn 5 b -" } +atf_test_case bflag +bflag_head() +{ + atf_set "descr" "Test cmp(1) -b (print bytes)" +} +bflag_body() +{ + echo -n "abcd" > a + echo -n "abdd" > b + + atf_check -s exit:1 -o file:$(atf_get_srcdir)/b_flag.out \ + cmp -b a b + atf_check -s exit:1 -o file:$(atf_get_srcdir)/bl_flag.out \ + cmp -bl a b +} + atf_init_test_cases() { atf_add_test_case special @@ -125,4 +141,5 @@ atf_init_test_cases() atf_add_test_case pr252542 atf_add_test_case skipsuff atf_add_test_case limit + atf_add_test_case bflag } From owner-dev-commits-src-main@freebsd.org Wed Sep 29 18:05:07 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E4DFD6789CD; Wed, 29 Sep 2021 18:05:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HKPRR642Nz4dV0; Wed, 29 Sep 2021 18:05:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9F3C91CAB1; Wed, 29 Sep 2021 18:05:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18TI57uN049975; Wed, 29 Sep 2021 18:05:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18TI57H8049974; Wed, 29 Sep 2021 18:05:07 GMT (envelope-from git) Date: Wed, 29 Sep 2021 18:05:07 GMT Message-Id: <202109291805.18TI57H8049974@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kyle Evans Subject: git: 8d546b6832ee - main - cmp: add -i, --ignore-initial, an alternative to skip1/skip2 args MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevans X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 8d546b6832eea031f95f30eaec3232ec1256a281 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Sep 2021 18:05:08 -0000 The branch main has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=8d546b6832eea031f95f30eaec3232ec1256a281 commit 8d546b6832eea031f95f30eaec3232ec1256a281 Author: Kyle Evans AuthorDate: 2021-09-23 05:43:32 +0000 Commit: Kyle Evans CommitDate: 2021-09-29 18:03:34 +0000 cmp: add -i, --ignore-initial, an alternative to skip1/skip2 args This is compatible with GNU cmp. Reviewed by: markj Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D32073 --- usr.bin/cmp/cmp.1 | 19 +++++++++++++++++++ usr.bin/cmp/cmp.c | 30 +++++++++++++++++++++++++++++- usr.bin/cmp/tests/cmp_test2.sh | 5 +++++ 3 files changed, 53 insertions(+), 1 deletion(-) diff --git a/usr.bin/cmp/cmp.1 b/usr.bin/cmp/cmp.1 index 511e09ac8628..5a56802bd22e 100644 --- a/usr.bin/cmp/cmp.1 +++ b/usr.bin/cmp/cmp.1 @@ -41,6 +41,7 @@ .Nm .Op Fl l | s | x .Op Fl hz +.Op Fl -ignore-initial Ns Cm = Ns Ar num1 Ns Op :num2 .Op Fl -bytes Ns Cm = Ns Ar num .Ar file1 file2 .Op Ar skip1 Op Ar skip2 @@ -60,6 +61,23 @@ The following options are available: .Bl -tag -width indent .It Fl h Do not follow symbolic links. +.It Fl i Ar num1 Ns Oo :num2 Oc , Fl -ignore-initial= Ns Ar num1 Ns Op :num2 +Skip +.Ar num1 +bytes from +.Ar file1 , +and optionally skip +.Ar num2 +bytes from +.Ar file2 . +If +.Ar num2 +is not specified, then +.Ar num1 +is applied for both +.Ar file1 +and +.Ar file2 . .It Fl l , Fl -verbose Print the byte number (decimal) and the differing byte values (octal) for each difference. @@ -170,6 +188,7 @@ utility is expected to be compatible. The .Fl h , +.Fl i , .Fl n , .Fl x , and diff --git a/usr.bin/cmp/cmp.c b/usr.bin/cmp/cmp.c index 384c273f4632..256cef8a0c31 100644 --- a/usr.bin/cmp/cmp.c +++ b/usr.bin/cmp/cmp.c @@ -66,6 +66,7 @@ bool lflag, sflag, xflag, zflag; static const struct option long_opts[] = { + {"ignore-initial", required_argument, NULL, 'i'}, {"verbose", no_argument, NULL, 'l'}, {"bytes", required_argument, NULL, 'n'}, {"silent", no_argument, NULL, 's'}, @@ -75,6 +76,25 @@ static const struct option long_opts[] = static void usage(void); +static bool +parse_iskipspec(char *spec, off_t *skip1, off_t *skip2) +{ + char *colon; + + colon = strchr(spec, ':'); + if (colon != NULL) + *colon++ = '\0'; + + if (expand_number(spec, skip1) < 0) + return (false); + + if (colon != NULL) + return (expand_number(colon, skip2) == 0); + + *skip2 = *skip1; + return (true); +} + int main(int argc, char *argv[]) { @@ -86,11 +106,19 @@ main(int argc, char *argv[]) skip1 = skip2 = 0; oflag = O_RDONLY; - while ((ch = getopt_long(argc, argv, "+hln:sxz", long_opts, NULL)) != -1) + while ((ch = getopt_long(argc, argv, "+hi:ln:sxz", long_opts, NULL)) != -1) switch (ch) { case 'h': /* Don't follow symlinks */ oflag |= O_NOFOLLOW; break; + case 'i': + if (!parse_iskipspec(optarg, &skip1, &skip2)) { + fprintf(stderr, + "Invalid --ignore-initial: %s\n", + optarg); + usage(); + } + break; case 'l': /* print all differences */ lflag = true; break; diff --git a/usr.bin/cmp/tests/cmp_test2.sh b/usr.bin/cmp/tests/cmp_test2.sh index c513984daf8b..893ee59076c3 100755 --- a/usr.bin/cmp/tests/cmp_test2.sh +++ b/usr.bin/cmp/tests/cmp_test2.sh @@ -71,8 +71,13 @@ pr252542_body() { echo -n '1234567890' > a echo -n 'abc567890' > b + echo -n 'xbc567890' > c atf_check -s exit:0 cmp -s a b 4 3 + atf_check -s exit:0 cmp -i 4:3 -s a b + atf_check -s exit:0 cmp -i 1 -s b c atf_check -s exit:1 -o ignore cmp -z a b 4 3 + atf_check -s exit:1 -o ignore cmp -i 4:3 -z a b + atf_check -s exit:1 -o ignore cmp -i 1 -z a b } atf_test_case skipsuff From owner-dev-commits-src-main@freebsd.org Wed Sep 29 19:43:14 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C252B67A4B5; Wed, 29 Sep 2021 19:43:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HKRcf2TyGz4mJF; Wed, 29 Sep 2021 19:43:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 363161E223; Wed, 29 Sep 2021 19:43:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18TJhEpf083485; Wed, 29 Sep 2021 19:43:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18TJhE5q083484; Wed, 29 Sep 2021 19:43:14 GMT (envelope-from git) Date: Wed, 29 Sep 2021 19:43:14 GMT Message-Id: <202109291943.18TJhE5q083484@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mitchell Horne Subject: git: 31991a5a4585 - main - minidump: De-duplicate is_dumpable() MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mhorne X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 31991a5a45857e88c29dec422e0b8d6f68f8877b Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Sep 2021 19:43:14 -0000 The branch main has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=31991a5a45857e88c29dec422e0b8d6f68f8877b commit 31991a5a45857e88c29dec422e0b8d6f68f8877b Author: Mitchell Horne AuthorDate: 2021-09-29 17:30:11 +0000 Commit: Mitchell Horne CommitDate: 2021-09-29 19:41:52 +0000 minidump: De-duplicate is_dumpable() The function is identical in each minidump implementation, so move it to vm_phys.c. The only slight exception is powerpc where the function was public, for use in moea64_scan_pmap(). Reviewed by: kib, markj, imp (earlier version) MFC after: 2 weeks Sponsored by: Juniper Networks, Inc. Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D31884 --- sys/amd64/amd64/minidump_machdep.c | 25 +++++-------------------- sys/amd64/amd64/uma_machdep.c | 1 + sys/arm/arm/minidump_machdep.c | 19 ++----------------- sys/arm64/arm64/minidump_machdep.c | 23 ++++------------------- sys/arm64/arm64/uma_machdep.c | 1 + sys/i386/i386/minidump_machdep_base.c | 21 +++------------------ sys/mips/mips/minidump_machdep.c | 21 +++------------------ sys/mips/mips/uma_machdep.c | 1 + sys/powerpc/aim/mmu_oea64.c | 4 ++-- sys/powerpc/include/md_var.h | 1 - sys/powerpc/powerpc/minidump_machdep.c | 17 +---------------- sys/powerpc/powerpc/uma_machdep.c | 1 + sys/riscv/riscv/minidump_machdep.c | 22 +++------------------- sys/riscv/riscv/uma_machdep.c | 1 + sys/vm/vm_phys.c | 19 +++++++++++++++++++ sys/vm/vm_phys.h | 1 + 16 files changed, 48 insertions(+), 130 deletions(-) diff --git a/sys/amd64/amd64/minidump_machdep.c b/sys/amd64/amd64/minidump_machdep.c index ea8220157083..7c54c423bbaf 100644 --- a/sys/amd64/amd64/minidump_machdep.c +++ b/sys/amd64/amd64/minidump_machdep.c @@ -66,21 +66,6 @@ static int dump_retry_count = 5; SYSCTL_INT(_machdep, OID_AUTO, dump_retry_count, CTLFLAG_RWTUN, &dump_retry_count, 0, "Number of times dump has to retry before bailing out"); -static int -is_dumpable(vm_paddr_t pa) -{ - vm_page_t m; - int i; - - if ((m = vm_phys_paddr_to_vm_page(pa)) != NULL) - return ((m->flags & PG_NODUMP) == 0); - for (i = 0; dump_avail[i] != 0 || dump_avail[i + 1] != 0; i += 2) { - if (pa >= dump_avail[i] && pa < dump_avail[i + 1]) - return (1); - } - return (0); -} - #define PG2MB(pgs) (((pgs) + (1 << 8) - 1) >> 8) static int @@ -256,7 +241,7 @@ minidumpsys(struct dumperinfo *di) va += NBPDP; pa = pdp[i] & PG_PS_FRAME; for (n = 0; n < NPDEPG * NPTEPG; n++) { - if (is_dumpable(pa)) + if (vm_phys_is_dumpable(pa)) dump_add_page(pa); pa += PAGE_SIZE; } @@ -274,7 +259,7 @@ minidumpsys(struct dumperinfo *di) /* This is an entire 2M page. */ pa = pd[j] & PG_PS_FRAME; for (k = 0; k < NPTEPG; k++) { - if (is_dumpable(pa)) + if (vm_phys_is_dumpable(pa)) dump_add_page(pa); pa += PAGE_SIZE; } @@ -283,7 +268,7 @@ minidumpsys(struct dumperinfo *di) pa = pd[j] & PG_FRAME; /* set bit for this PTE page */ - if (is_dumpable(pa)) + if (vm_phys_is_dumpable(pa)) dump_add_page(pa); /* and for each valid page in this 2MB block */ pt = (uint64_t *)PHYS_TO_DMAP(pd[j] & PG_FRAME); @@ -291,7 +276,7 @@ minidumpsys(struct dumperinfo *di) if ((pt[k] & PG_V) == 0) continue; pa = pt[k] & PG_FRAME; - if (is_dumpable(pa)) + if (vm_phys_is_dumpable(pa)) dump_add_page(pa); } } @@ -304,7 +289,7 @@ minidumpsys(struct dumperinfo *di) dumpsize += round_page(BITSET_SIZE(vm_page_dump_pages)); VM_PAGE_DUMP_FOREACH(pa) { /* Clear out undumpable pages now if needed */ - if (is_dumpable(pa)) { + if (vm_phys_is_dumpable(pa)) { dumpsize += PAGE_SIZE; } else { dump_drop_page(pa); diff --git a/sys/amd64/amd64/uma_machdep.c b/sys/amd64/amd64/uma_machdep.c index d080abeefdcc..2fc981f23c83 100644 --- a/sys/amd64/amd64/uma_machdep.c +++ b/sys/amd64/amd64/uma_machdep.c @@ -34,6 +34,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include diff --git a/sys/arm/arm/minidump_machdep.c b/sys/arm/arm/minidump_machdep.c index c5f9cb58302e..f760d774bfbb 100644 --- a/sys/arm/arm/minidump_machdep.c +++ b/sys/arm/arm/minidump_machdep.c @@ -65,21 +65,6 @@ static size_t fragsz; static void *dump_va; static uint64_t counter, progress; -static int -is_dumpable(vm_paddr_t pa) -{ - vm_page_t m; - int i; - - if ((m = vm_phys_paddr_to_vm_page(pa)) != NULL) - return ((m->flags & PG_NODUMP) == 0); - for (i = 0; dump_avail[i] != 0 || dump_avail[i + 1] != 0; i += 2) { - if (pa >= dump_avail[i] && pa < dump_avail[i + 1]) - return (1); - } - return (0); -} - #define PG2MB(pgs) (((pgs) + (1 << 8) - 1) >> 8) static int @@ -202,7 +187,7 @@ minidumpsys(struct dumperinfo *di) ptesize = 0; for (va = KERNBASE; va < kernel_vm_end; va += PAGE_SIZE) { pa = pmap_dump_kextract(va, NULL); - if (pa != 0 && is_dumpable(pa)) + if (pa != 0 && vm_phys_is_dumpable(pa)) dump_add_page(pa); ptesize += sizeof(pt2_entry_t); } @@ -214,7 +199,7 @@ minidumpsys(struct dumperinfo *di) dumpsize += round_page(BITSET_SIZE(vm_page_dump_pages)); VM_PAGE_DUMP_FOREACH(pa) { /* Clear out undumpable pages now if needed */ - if (is_dumpable(pa)) + if (vm_phys_is_dumpable(pa)) dumpsize += PAGE_SIZE; else dump_drop_page(pa); diff --git a/sys/arm64/arm64/minidump_machdep.c b/sys/arm64/arm64/minidump_machdep.c index 1dd40806669b..98d0b50be4c6 100644 --- a/sys/arm64/arm64/minidump_machdep.c +++ b/sys/arm64/arm64/minidump_machdep.c @@ -66,21 +66,6 @@ static size_t counter, progress, dumpsize; static uint64_t tmpbuffer[Ln_ENTRIES]; -static int -is_dumpable(vm_paddr_t pa) -{ - vm_page_t m; - int i; - - if ((m = vm_phys_paddr_to_vm_page(pa)) != NULL) - return ((m->flags & PG_NODUMP) == 0); - for (i = 0; dump_avail[i] != 0 || dump_avail[i + 1] != 0; i += 2) { - if (pa >= dump_avail[i] && pa < dump_avail[i + 1]) - return (1); - } - return (0); -} - static int blk_flush(struct dumperinfo *di) { @@ -226,14 +211,14 @@ minidumpsys(struct dumperinfo *di) pa = *l1 & ~ATTR_MASK; for (i = 0; i < Ln_ENTRIES * Ln_ENTRIES; i++, pa += PAGE_SIZE) - if (is_dumpable(pa)) + if (vm_phys_is_dumpable(pa)) dump_add_page(pa); pmapsize += (Ln_ENTRIES - 1) * PAGE_SIZE; va += L1_SIZE - L2_SIZE; } else if ((*l2 & ATTR_DESCR_MASK) == L2_BLOCK) { pa = *l2 & ~ATTR_MASK; for (i = 0; i < Ln_ENTRIES; i++, pa += PAGE_SIZE) { - if (is_dumpable(pa)) + if (vm_phys_is_dumpable(pa)) dump_add_page(pa); } } else if ((*l2 & ATTR_DESCR_MASK) == L2_TABLE) { @@ -241,7 +226,7 @@ minidumpsys(struct dumperinfo *di) if ((l3[i] & ATTR_DESCR_MASK) != L3_PAGE) continue; pa = l3[i] & ~ATTR_MASK; - if (is_dumpable(pa)) + if (vm_phys_is_dumpable(pa)) dump_add_page(pa); } } @@ -253,7 +238,7 @@ minidumpsys(struct dumperinfo *di) dumpsize += round_page(sizeof(dump_avail)); dumpsize += round_page(BITSET_SIZE(vm_page_dump_pages)); VM_PAGE_DUMP_FOREACH(pa) { - if (is_dumpable(pa)) + if (vm_phys_is_dumpable(pa)) dumpsize += PAGE_SIZE; else dump_drop_page(pa); diff --git a/sys/arm64/arm64/uma_machdep.c b/sys/arm64/arm64/uma_machdep.c index c848edbe32be..3ef3dd3cc9e9 100644 --- a/sys/arm64/arm64/uma_machdep.c +++ b/sys/arm64/arm64/uma_machdep.c @@ -32,6 +32,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include diff --git a/sys/i386/i386/minidump_machdep_base.c b/sys/i386/i386/minidump_machdep_base.c index e2b4234eba11..b8e9e4884552 100644 --- a/sys/i386/i386/minidump_machdep_base.c +++ b/sys/i386/i386/minidump_machdep_base.c @@ -62,21 +62,6 @@ static size_t fragsz; static void *dump_va; static uint64_t counter, progress; -static int -is_dumpable(vm_paddr_t pa) -{ - vm_page_t m; - int i; - - if ((m = vm_phys_paddr_to_vm_page(pa)) != NULL) - return ((m->flags & PG_NODUMP) == 0); - for (i = 0; dump_avail[i] != 0 || dump_avail[i + 1] != 0; i += 2) { - if (pa >= dump_avail[i] && pa < dump_avail[i + 1]) - return (1); - } - return (0); -} - #define PG2MB(pgs) (((pgs) + (1 << 8) - 1) >> 8) static int @@ -203,7 +188,7 @@ minidumpsys(struct dumperinfo *di) /* This is an entire 2M page. */ pa = pd[j] & PG_PS_FRAME; for (k = 0; k < NPTEPG; k++) { - if (is_dumpable(pa)) + if (vm_phys_is_dumpable(pa)) dump_add_page(pa); pa += PAGE_SIZE; } @@ -215,7 +200,7 @@ minidumpsys(struct dumperinfo *di) for (k = 0; k < NPTEPG; k++) { if ((pt[k] & PG_V) == PG_V) { pa = pt[k] & PG_FRAME; - if (is_dumpable(pa)) + if (vm_phys_is_dumpable(pa)) dump_add_page(pa); } } @@ -231,7 +216,7 @@ minidumpsys(struct dumperinfo *di) dumpsize += round_page(BITSET_SIZE(vm_page_dump_pages)); VM_PAGE_DUMP_FOREACH(pa) { /* Clear out undumpable pages now if needed */ - if (is_dumpable(pa)) { + if (vm_phys_is_dumpable(pa)) { dumpsize += PAGE_SIZE; } else { dump_drop_page(pa); diff --git a/sys/mips/mips/minidump_machdep.c b/sys/mips/mips/minidump_machdep.c index e1edfa9ad5d3..d35b1fd53068 100644 --- a/sys/mips/mips/minidump_machdep.c +++ b/sys/mips/mips/minidump_machdep.c @@ -64,21 +64,6 @@ static char tmpbuffer[PAGE_SIZE] __aligned(sizeof(uint64_t)); extern pd_entry_t *kernel_segmap; -static int -is_dumpable(vm_paddr_t pa) -{ - vm_page_t m; - int i; - - if ((m = vm_phys_paddr_to_vm_page(pa)) != NULL) - return ((m->flags & PG_NODUMP) == 0); - for (i = 0; dump_avail[i] != 0 || dump_avail[i + 1] != 0; i += 2) { - if (pa >= dump_avail[i] && pa < dump_avail[i + 1]) - return (1); - } - return (0); -} - static struct { int min_per; int max_per; @@ -189,7 +174,7 @@ minidumpsys(struct dumperinfo *di) for (i = 0; i < NPTEPG; i++) { if (pte_test(&pte[i], PTE_V)) { pa = TLBLO_PTE_TO_PA(pte[i]); - if (is_dumpable(pa)) + if (vm_phys_is_dumpable(pa)) dump_add_page(pa); } } @@ -200,7 +185,7 @@ minidumpsys(struct dumperinfo *di) * and pages allocated by pmap_steal reside */ for (pa = 0; pa < phys_avail[0]; pa += PAGE_SIZE) { - if (is_dumpable(pa)) + if (vm_phys_is_dumpable(pa)) dump_add_page(pa); } @@ -211,7 +196,7 @@ minidumpsys(struct dumperinfo *di) dumpsize += round_page(BITSET_SIZE(vm_page_dump_pages)); VM_PAGE_DUMP_FOREACH(pa) { /* Clear out undumpable pages now if needed */ - if (is_dumpable(pa)) + if (vm_phys_is_dumpable(pa)) dumpsize += PAGE_SIZE; else dump_drop_page(pa); diff --git a/sys/mips/mips/uma_machdep.c b/sys/mips/mips/uma_machdep.c index faf70b20b748..5b57447edd6a 100644 --- a/sys/mips/mips/uma_machdep.c +++ b/sys/mips/mips/uma_machdep.c @@ -35,6 +35,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include diff --git a/sys/powerpc/aim/mmu_oea64.c b/sys/powerpc/aim/mmu_oea64.c index c2e8e6e49913..55147d47b2bf 100644 --- a/sys/powerpc/aim/mmu_oea64.c +++ b/sys/powerpc/aim/mmu_oea64.c @@ -3362,11 +3362,11 @@ moea64_scan_pmap() if (va & PVO_LARGE) { pa_end = pa + lpsize; for (; pa < pa_end; pa += PAGE_SIZE) { - if (is_dumpable(pa)) + if (vm_phys_is_dumpable(pa)) dump_add_page(pa); } } else { - if (is_dumpable(pa)) + if (vm_phys_is_dumpable(pa)) dump_add_page(pa); } } diff --git a/sys/powerpc/include/md_var.h b/sys/powerpc/include/md_var.h index da9232313ffb..ab5f9e33a5bb 100644 --- a/sys/powerpc/include/md_var.h +++ b/sys/powerpc/include/md_var.h @@ -44,7 +44,6 @@ extern int szsigcode64, szsigcode64_elfv2; struct dumperinfo; int minidumpsys(struct dumperinfo *); -int is_dumpable(vm_paddr_t); #endif extern long Maxmem; diff --git a/sys/powerpc/powerpc/minidump_machdep.c b/sys/powerpc/powerpc/minidump_machdep.c index e049f2debcfa..e4d85fe95ed6 100644 --- a/sys/powerpc/powerpc/minidump_machdep.c +++ b/sys/powerpc/powerpc/minidump_machdep.c @@ -91,21 +91,6 @@ static size_t counter, dumpsize, progress; /* Handle chunked writes. */ static size_t fragsz; -int -is_dumpable(vm_paddr_t pa) -{ - vm_page_t m; - int i; - - if ((m = vm_phys_paddr_to_vm_page(pa)) != NULL) - return ((m->flags & PG_NODUMP) == 0); - for (i = 0; dump_avail[i] != 0 || dump_avail[i + 1] != 0; i += 2) { - if (pa >= dump_avail[i] && pa < dump_avail[i + 1]) - return (1); - } - return (0); -} - static void pmap_kenter_temporary(vm_offset_t va, vm_paddr_t pa) { @@ -276,7 +261,7 @@ retry: dumpsize += pmapsize; VM_PAGE_DUMP_FOREACH(pa) { /* Clear out undumpable pages now if needed */ - if (is_dumpable(pa)) + if (vm_phys_is_dumpable(pa)) dumpsize += PAGE_SIZE; else dump_drop_page(pa); diff --git a/sys/powerpc/powerpc/uma_machdep.c b/sys/powerpc/powerpc/uma_machdep.c index 43e2a86456fe..a1769f61d671 100644 --- a/sys/powerpc/powerpc/uma_machdep.c +++ b/sys/powerpc/powerpc/uma_machdep.c @@ -35,6 +35,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include diff --git a/sys/riscv/riscv/minidump_machdep.c b/sys/riscv/riscv/minidump_machdep.c index 2c5e27b6274f..bcedfbdf2fb2 100644 --- a/sys/riscv/riscv/minidump_machdep.c +++ b/sys/riscv/riscv/minidump_machdep.c @@ -99,22 +99,6 @@ report_progress(size_t progress, size_t dumpsize) } } -static bool -is_dumpable(vm_paddr_t pa) -{ - vm_page_t m; - int i; - - if ((m = vm_phys_paddr_to_vm_page(pa)) != NULL) - return ((m->flags & PG_NODUMP) == 0); - - for (i = 0; dump_avail[i] != 0 || dump_avail[i + 1] != 0; i += 2) { - if (pa >= dump_avail[i] && pa < dump_avail[i + 1]) - return (true); - } - return (false); -} - static int blk_flush(struct dumperinfo *di) { @@ -241,7 +225,7 @@ retry: if ((*l2 & PTE_RWX) != 0) { pa = (*l2 >> PTE_PPN1_S) << L2_SHIFT; for (i = 0; i < Ln_ENTRIES; i++, pa += PAGE_SIZE) { - if (is_dumpable(pa)) + if (vm_phys_is_dumpable(pa)) dump_add_page(pa); } } else { @@ -249,7 +233,7 @@ retry: if ((l3[i] & PTE_V) == 0) continue; pa = (l3[i] >> PTE_PPN0_S) * PAGE_SIZE; - if (is_dumpable(pa)) + if (vm_phys_is_dumpable(pa)) dump_add_page(pa); } } @@ -262,7 +246,7 @@ retry: dumpsize += round_page(BITSET_SIZE(vm_page_dump_pages)); VM_PAGE_DUMP_FOREACH(pa) { /* Clear out undumpable pages now if needed */ - if (is_dumpable(pa)) + if (vm_phys_is_dumpable(pa)) dumpsize += PAGE_SIZE; else dump_drop_page(pa); diff --git a/sys/riscv/riscv/uma_machdep.c b/sys/riscv/riscv/uma_machdep.c index 6b563ea8ab0c..f1725fde4699 100644 --- a/sys/riscv/riscv/uma_machdep.c +++ b/sys/riscv/riscv/uma_machdep.c @@ -32,6 +32,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include diff --git a/sys/vm/vm_phys.c b/sys/vm/vm_phys.c index c8f98a0b4695..b0aaa822211f 100644 --- a/sys/vm/vm_phys.c +++ b/sys/vm/vm_phys.c @@ -1593,6 +1593,25 @@ vm_phys_avail_split(vm_paddr_t pa, int i) return (0); } +/* + * Check if a given physical address can be included as part of a crash dump. + */ +bool +vm_phys_is_dumpable(vm_paddr_t pa) +{ + vm_page_t m; + int i; + + if ((m = vm_phys_paddr_to_vm_page(pa)) != NULL) + return ((m->flags & PG_NODUMP) == 0); + + for (i = 0; dump_avail[i] != 0 || dump_avail[i + 1] != 0; i += 2) { + if (pa >= dump_avail[i] && pa < dump_avail[i + 1]) + return (true); + } + return (false); +} + void vm_phys_early_add_seg(vm_paddr_t start, vm_paddr_t end) { diff --git a/sys/vm/vm_phys.h b/sys/vm/vm_phys.h index a650d7dbc380..d10eb96f938f 100644 --- a/sys/vm/vm_phys.h +++ b/sys/vm/vm_phys.h @@ -87,6 +87,7 @@ vm_paddr_t vm_phys_early_alloc(int domain, size_t alloc_size); void vm_phys_early_startup(void); int vm_phys_avail_largest(void); vm_paddr_t vm_phys_avail_size(int i); +bool vm_phys_is_dumpable(vm_paddr_t pa); static inline int vm_phys_domain(vm_paddr_t pa) From owner-dev-commits-src-main@freebsd.org Wed Sep 29 19:43:15 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9F7C167A2F7; Wed, 29 Sep 2021 19:43:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HKRcg2sgKz4mGM; Wed, 29 Sep 2021 19:43:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 432761E2CC; Wed, 29 Sep 2021 19:43:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18TJhFYA083515; Wed, 29 Sep 2021 19:43:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18TJhF3O083514; Wed, 29 Sep 2021 19:43:15 GMT (envelope-from git) Date: Wed, 29 Sep 2021 19:43:15 GMT Message-Id: <202109291943.18TJhF3O083514@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mitchell Horne Subject: git: ab4ed843a303 - main - minidump: De-duplicate the progress bar MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mhorne X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ab4ed843a303ea3e585f8ed3f79873e46d3b3ae3 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Sep 2021 19:43:15 -0000 The branch main has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=ab4ed843a303ea3e585f8ed3f79873e46d3b3ae3 commit ab4ed843a303ea3e585f8ed3f79873e46d3b3ae3 Author: Mitchell Horne AuthorDate: 2021-09-29 17:44:27 +0000 Commit: Mitchell Horne CommitDate: 2021-09-29 19:42:21 +0000 minidump: De-duplicate the progress bar The implementation of the progress bar is simple, but duplicated for most minidump implementations. Extract the common bits to kern_dump.c. Ensure that the bar is reset with each subsequent dump; this was only done on some platforms previously. Reviewed by: markj MFC after: 2 weeks Sponsored by: Juniper Networks, Inc. Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D31885 --- sys/amd64/amd64/minidump_machdep.c | 51 +++---------------------- sys/arm/arm/minidump_machdep.c | 13 +------ sys/arm/include/dump.h | 3 ++ sys/arm64/arm64/minidump_machdep.c | 46 ++--------------------- sys/arm64/include/dump.h | 3 ++ sys/i386/i386/minidump_machdep_base.c | 13 +------ sys/kern/kern_dump.c | 69 ++++++++++++++++++++++++++++++++++ sys/mips/include/dump.h | 3 ++ sys/mips/mips/minidump_machdep.c | 48 ++--------------------- sys/powerpc/include/dump.h | 3 ++ sys/powerpc/powerpc/minidump_machdep.c | 54 +++----------------------- sys/riscv/include/dump.h | 3 ++ sys/riscv/riscv/minidump_machdep.c | 46 ++--------------------- sys/sys/kerneldump.h | 3 ++ sys/x86/include/dump.h | 3 ++ 15 files changed, 113 insertions(+), 248 deletions(-) diff --git a/sys/amd64/amd64/minidump_machdep.c b/sys/amd64/amd64/minidump_machdep.c index 7c54c423bbaf..d6bdbfb7e633 100644 --- a/sys/amd64/amd64/minidump_machdep.c +++ b/sys/amd64/amd64/minidump_machdep.c @@ -60,14 +60,12 @@ static struct kerneldumpheader kdh; /* Handle chunked writes. */ static size_t fragsz; static void *dump_va; -static size_t counter, progress, dumpsize, wdog_next; +static size_t progress, dumpsize, wdog_next; static int dump_retry_count = 5; SYSCTL_INT(_machdep, OID_AUTO, dump_retry_count, CTLFLAG_RWTUN, &dump_retry_count, 0, "Number of times dump has to retry before bailing out"); -#define PG2MB(pgs) (((pgs) + (1 << 8) - 1) >> 8) - static int blk_flush(struct dumperinfo *di) { @@ -81,41 +79,6 @@ blk_flush(struct dumperinfo *di) return (error); } -static struct { - int min_per; - int max_per; - int visited; -} progress_track[10] = { - { 0, 10, 0}, - { 10, 20, 0}, - { 20, 30, 0}, - { 30, 40, 0}, - { 40, 50, 0}, - { 50, 60, 0}, - { 60, 70, 0}, - { 70, 80, 0}, - { 80, 90, 0}, - { 90, 100, 0} -}; - -static void -report_progress(size_t progress, size_t dumpsize) -{ - int sofar, i; - - sofar = 100 - ((progress * 100) / dumpsize); - for (i = 0; i < nitems(progress_track); i++) { - if (sofar < progress_track[i].min_per || - sofar > progress_track[i].max_per) - continue; - if (progress_track[i].visited) - return; - progress_track[i].visited = 1; - printf("..%d%%", sofar); - return; - } -} - /* Pat the watchdog approximately every 128MB of the dump. */ #define WDOG_DUMP_INTERVAL (128 * 1024 * 1024) @@ -152,12 +115,9 @@ blk_write(struct dumperinfo *di, char *ptr, vm_paddr_t pa, size_t sz) len = maxdumpsz - fragsz; if (len > sz) len = sz; - counter += len; progress -= len; - if (counter >> 24) { - report_progress(progress, dumpsize); - counter &= (1<<24) - 1; - } + + dumpsys_pb_progress(len); if (progress <= wdog_next) { wdog_kern_pat(WD_LASTVAL); if (wdog_next > WDOG_DUMP_INTERVAL) @@ -213,9 +173,7 @@ minidumpsys(struct dumperinfo *di) retry_count = 0; retry: retry_count++; - counter = 0; - for (i = 0; i < nitems(progress_track); i++) - progress_track[i].visited = 0; + /* Walk page table pages, set bits in vm_page_dump */ pmapsize = 0; for (va = VM_MIN_KERNEL_ADDRESS; va < MAX(KERNBASE + nkpt * NBPDR, @@ -298,6 +256,7 @@ minidumpsys(struct dumperinfo *di) dumpsize += PAGE_SIZE; wdog_next = progress = dumpsize; + dumpsys_pb_init(dumpsize); /* Initialize mdhdr */ bzero(&mdhdr, sizeof(mdhdr)); diff --git a/sys/arm/arm/minidump_machdep.c b/sys/arm/arm/minidump_machdep.c index f760d774bfbb..83c607c839ee 100644 --- a/sys/arm/arm/minidump_machdep.c +++ b/sys/arm/arm/minidump_machdep.c @@ -63,9 +63,6 @@ static struct kerneldumpheader kdh; /* Handle chunked writes. */ static size_t fragsz; static void *dump_va; -static uint64_t counter, progress; - -#define PG2MB(pgs) (((pgs) + (1 << 8) - 1) >> 8) static int blk_flush(struct dumperinfo *di) @@ -115,13 +112,8 @@ blk_write(struct dumperinfo *di, char *ptr, vm_paddr_t pa, size_t sz) len = maxdumpsz - fragsz; if (len > sz) len = sz; - counter += len; - progress -= len; - if (counter >> 22) { - printf(" %lld", PG2MB(progress >> PAGE_SHIFT)); - counter &= (1<<22) - 1; - } + dumpsys_pb_progress(len); #ifdef SW_WATCHDOG wdog_kern_pat(WD_LASTVAL); #endif @@ -182,7 +174,6 @@ minidumpsys(struct dumperinfo *di) */ dcache_wbinv_poc_all(); - counter = 0; /* Walk page table pages, set bits in vm_page_dump */ ptesize = 0; for (va = KERNBASE; va < kernel_vm_end; va += PAGE_SIZE) { @@ -206,7 +197,7 @@ minidumpsys(struct dumperinfo *di) } dumpsize += PAGE_SIZE; - progress = dumpsize; + dumpsys_pb_init(dumpsize); /* Initialize mdhdr */ bzero(&mdhdr, sizeof(mdhdr)); diff --git a/sys/arm/include/dump.h b/sys/arm/include/dump.h index 3a7432fd49d3..97db0a819701 100644 --- a/sys/arm/include/dump.h +++ b/sys/arm/include/dump.h @@ -36,6 +36,9 @@ #define DUMPSYS_MD_PA_NPAIRS 20 #define DUMPSYS_NUM_AUX_HDRS 1 +/* How often to check the dump progress bar? */ +#define DUMPSYS_PB_CHECK_BITS 22 /* Every 4MB */ + void dumpsys_wbinv_all(void); int dumpsys_write_aux_headers(struct dumperinfo *di); diff --git a/sys/arm64/arm64/minidump_machdep.c b/sys/arm64/arm64/minidump_machdep.c index 98d0b50be4c6..92b172260ae0 100644 --- a/sys/arm64/arm64/minidump_machdep.c +++ b/sys/arm64/arm64/minidump_machdep.c @@ -62,7 +62,7 @@ static struct kerneldumpheader kdh; /* Handle chunked writes. */ static size_t fragsz; static void *dump_va; -static size_t counter, progress, dumpsize; +static size_t dumpsize; static uint64_t tmpbuffer[Ln_ENTRIES]; @@ -79,41 +79,6 @@ blk_flush(struct dumperinfo *di) return (error); } -static struct { - int min_per; - int max_per; - int visited; -} progress_track[10] = { - { 0, 10, 0}, - { 10, 20, 0}, - { 20, 30, 0}, - { 30, 40, 0}, - { 40, 50, 0}, - { 50, 60, 0}, - { 60, 70, 0}, - { 70, 80, 0}, - { 80, 90, 0}, - { 90, 100, 0} -}; - -static void -report_progress(size_t progress, size_t dumpsize) -{ - int sofar, i; - - sofar = 100 - ((progress * 100) / dumpsize); - for (i = 0; i < nitems(progress_track); i++) { - if (sofar < progress_track[i].min_per || - sofar > progress_track[i].max_per) - continue; - if (progress_track[i].visited) - return; - progress_track[i].visited = 1; - printf("..%d%%", sofar); - return; - } -} - static int blk_write(struct dumperinfo *di, char *ptr, vm_paddr_t pa, size_t sz) { @@ -150,13 +115,8 @@ blk_write(struct dumperinfo *di, char *ptr, vm_paddr_t pa, size_t sz) len = maxdumpsz - fragsz; if (len > sz) len = sz; - counter += len; - progress -= len; - if (counter >> 22) { - report_progress(progress, dumpsize); - counter &= (1 << 22) - 1; - } + dumpsys_pb_progress(len); wdog_kern_pat(WD_LASTVAL); if (ptr) { @@ -245,7 +205,7 @@ minidumpsys(struct dumperinfo *di) } dumpsize += PAGE_SIZE; - progress = dumpsize; + dumpsys_pb_init(dumpsize); /* Initialize mdhdr */ bzero(&mdhdr, sizeof(mdhdr)); diff --git a/sys/arm64/include/dump.h b/sys/arm64/include/dump.h index 6f2537550c42..600cc5415970 100644 --- a/sys/arm64/include/dump.h +++ b/sys/arm64/include/dump.h @@ -40,6 +40,9 @@ #define DUMPSYS_MD_PA_NPAIRS 20 #define DUMPSYS_NUM_AUX_HDRS 1 +/* How often to check the dump progress bar? */ +#define DUMPSYS_PB_CHECK_BITS 22 /* Every 4MB */ + void dumpsys_wbinv_all(void); int dumpsys_write_aux_headers(struct dumperinfo *di); diff --git a/sys/i386/i386/minidump_machdep_base.c b/sys/i386/i386/minidump_machdep_base.c index b8e9e4884552..e3e211bf9a46 100644 --- a/sys/i386/i386/minidump_machdep_base.c +++ b/sys/i386/i386/minidump_machdep_base.c @@ -60,9 +60,6 @@ static struct kerneldumpheader kdh; /* Handle chunked writes. */ static size_t fragsz; static void *dump_va; -static uint64_t counter, progress; - -#define PG2MB(pgs) (((pgs) + (1 << 8) - 1) >> 8) static int blk_flush(struct dumperinfo *di) @@ -110,13 +107,8 @@ blk_write(struct dumperinfo *di, char *ptr, vm_paddr_t pa, size_t sz) len = maxdumpsz - fragsz; if (len > sz) len = sz; - counter += len; - progress -= len; - if (counter >> 24) { - printf(" %lld", PG2MB(progress >> PAGE_SHIFT)); - counter &= (1<<24) - 1; - } + dumpsys_pb_progress(len); wdog_kern_pat(WD_LASTVAL); if (ptr) { @@ -173,7 +165,6 @@ minidumpsys(struct dumperinfo *di) int j, k; struct minidumphdr mdhdr; - counter = 0; /* Walk page table pages, set bits in vm_page_dump */ ptesize = 0; for (va = KERNBASE; va < kernel_vm_end; va += NBPDR) { @@ -224,7 +215,7 @@ minidumpsys(struct dumperinfo *di) } dumpsize += PAGE_SIZE; - progress = dumpsize; + dumpsys_pb_init(dumpsize); /* Initialize mdhdr */ bzero(&mdhdr, sizeof(mdhdr)); diff --git a/sys/kern/kern_dump.c b/sys/kern/kern_dump.c index 7ba6847e405d..4c592f446f45 100644 --- a/sys/kern/kern_dump.c +++ b/sys/kern/kern_dump.c @@ -385,3 +385,72 @@ dumpsys_generic(struct dumperinfo *di) printf("\n** DUMP FAILED (ERROR %d) **\n", error); return (error); } + +/* Minidump progress bar */ +static struct { + const int min_per; + const int max_per; + bool visited; +} progress_track[10] = { + { 0, 10, false}, + { 10, 20, false}, + { 20, 30, false}, + { 30, 40, false}, + { 40, 50, false}, + { 50, 60, false}, + { 60, 70, false}, + { 70, 80, false}, + { 80, 90, false}, + { 90, 100, false} +}; + +static uint64_t dumpsys_pb_size; +static uint64_t dumpsys_pb_remaining; +static uint64_t dumpsys_pb_check; + +/* Reset the progress bar for a dump of dumpsize. */ +void +dumpsys_pb_init(uint64_t dumpsize) +{ + int i; + + dumpsys_pb_size = dumpsys_pb_remaining = dumpsize; + dumpsys_pb_check = 0; + + for (i = 0; i < nitems(progress_track); i++) + progress_track[i].visited = false; +} + +/* + * Update the progress according to the delta bytes that were written out. + * Check and print the progress percentage. + */ +void +dumpsys_pb_progress(size_t delta) +{ + int sofar, i; + + dumpsys_pb_remaining -= delta; + dumpsys_pb_check += delta; + + /* + * To save time while dumping, only loop through progress_track + * occasionally. + */ + if ((dumpsys_pb_check >> DUMPSYS_PB_CHECK_BITS) == 0) + return; + else + dumpsys_pb_check &= (1 << DUMPSYS_PB_CHECK_BITS) - 1; + + sofar = 100 - ((dumpsys_pb_remaining * 100) / dumpsys_pb_size); + for (i = 0; i < nitems(progress_track); i++) { + if (sofar < progress_track[i].min_per || + sofar > progress_track[i].max_per) + continue; + if (!progress_track[i].visited) { + progress_track[i].visited = true; + printf("..%d%%", sofar); + } + break; + } +} diff --git a/sys/mips/include/dump.h b/sys/mips/include/dump.h index 2224b6eea4b9..4e434861dfcc 100644 --- a/sys/mips/include/dump.h +++ b/sys/mips/include/dump.h @@ -36,6 +36,9 @@ #define DUMPSYS_MD_PA_NPAIRS 20 #define DUMPSYS_NUM_AUX_HDRS 0 +/* How often to check the dump progress bar? */ +#define DUMPSYS_PB_CHECK_BITS 22 /* Every 4MB */ + void dumpsys_wbinv_all(void); static inline void diff --git a/sys/mips/mips/minidump_machdep.c b/sys/mips/mips/minidump_machdep.c index d35b1fd53068..691e1208e684 100644 --- a/sys/mips/mips/minidump_machdep.c +++ b/sys/mips/mips/minidump_machdep.c @@ -58,47 +58,12 @@ CTASSERT(sizeof(struct kerneldumpheader) == 512); static struct kerneldumpheader kdh; /* Handle chunked writes. */ -static uint64_t counter, progress, dumpsize; +static uint64_t dumpsize; /* Just auxiliary bufffer */ static char tmpbuffer[PAGE_SIZE] __aligned(sizeof(uint64_t)); extern pd_entry_t *kernel_segmap; -static struct { - int min_per; - int max_per; - int visited; -} progress_track[10] = { - { 0, 10, 0}, - { 10, 20, 0}, - { 20, 30, 0}, - { 30, 40, 0}, - { 40, 50, 0}, - { 50, 60, 0}, - { 60, 70, 0}, - { 70, 80, 0}, - { 80, 90, 0}, - { 90, 100, 0} -}; - -static void -report_progress(uint64_t progress, uint64_t dumpsize) -{ - int sofar, i; - - sofar = 100 - ((progress * 100) / dumpsize); - for (i = 0; i < nitems(progress_track); i++) { - if (sofar < progress_track[i].min_per || - sofar > progress_track[i].max_per) - continue; - if (progress_track[i].visited) - return; - progress_track[i].visited = 1; - printf("..%d%%", sofar); - return; - } -} - static int write_buffer(struct dumperinfo *di, char *ptr, size_t sz) { @@ -115,14 +80,8 @@ write_buffer(struct dumperinfo *di, char *ptr, size_t sz) while (sz) { len = min(maxdumpsz, sz); - counter += len; - progress -= len; - - if (counter >> 22) { - report_progress(progress, dumpsize); - counter &= (1<<22) - 1; - } + dumpsys_pb_progress(len); wdog_kern_pat(WD_LASTVAL); if (ptr) { @@ -163,7 +122,6 @@ minidumpsys(struct dumperinfo *di) /* Flush cache */ mips_dcache_wbinv_all(); - counter = 0; /* Walk page table pages, set bits in vm_page_dump */ ptesize = 0; @@ -203,7 +161,7 @@ minidumpsys(struct dumperinfo *di) } dumpsize += PAGE_SIZE; - progress = dumpsize; + dumpsys_pb_init(dumpsize); /* Initialize mdhdr */ bzero(&mdhdr, sizeof(mdhdr)); diff --git a/sys/powerpc/include/dump.h b/sys/powerpc/include/dump.h index f6ccb003c89b..3debbfbe25f9 100644 --- a/sys/powerpc/include/dump.h +++ b/sys/powerpc/include/dump.h @@ -35,6 +35,9 @@ #define DUMPSYS_MD_PA_NPAIRS (PHYS_AVAIL_SZ + 1) #define DUMPSYS_NUM_AUX_HDRS 0 +/* How often to check the dump progress bar? */ +#define DUMPSYS_PB_CHECK_BITS 20 /* Every 1MB */ + void dumpsys_pa_init(void); void dumpsys_unmap_chunk(vm_paddr_t, size_t, void *); size_t dumpsys_scan_pmap(void); diff --git a/sys/powerpc/powerpc/minidump_machdep.c b/sys/powerpc/powerpc/minidump_machdep.c index e4d85fe95ed6..908e6f7a3fc7 100644 --- a/sys/powerpc/powerpc/minidump_machdep.c +++ b/sys/powerpc/powerpc/minidump_machdep.c @@ -69,24 +69,7 @@ SYSCTL_INT(_machdep, OID_AUTO, dump_retry_count, CTLFLAG_RWTUN, static struct kerneldumpheader kdh; static char pgbuf[PAGE_SIZE]; -static struct { - int min_per; - int max_per; - int visited; -} progress_track[10] = { - { 0, 10, 0}, - { 10, 20, 0}, - { 20, 30, 0}, - { 30, 40, 0}, - { 40, 50, 0}, - { 50, 60, 0}, - { 60, 70, 0}, - { 70, 80, 0}, - { 80, 90, 0}, - { 90, 100, 0} -}; - -static size_t counter, dumpsize, progress; +static size_t dumpsize; /* Handle chunked writes. */ static size_t fragsz; @@ -98,24 +81,6 @@ pmap_kenter_temporary(vm_offset_t va, vm_paddr_t pa) pmap_kenter(va, pa); } -static void -report_progress(void) -{ - int sofar, i; - - sofar = 100 - ((progress * 100) / dumpsize); - for (i = 0; i < nitems(progress_track); i++) { - if (sofar < progress_track[i].min_per || - sofar > progress_track[i].max_per) - continue; - if (progress_track[i].visited) - return; - progress_track[i].visited = 1; - printf("..%d%%", sofar); - return; - } -} - static int blk_flush(struct dumperinfo *di) { @@ -165,12 +130,8 @@ blk_write(struct dumperinfo *di, char *ptr, vm_paddr_t pa, size_t sz) len = maxdumpsz - fragsz; if (len > sz) len = sz; - counter += len; - progress -= len; - if (counter >> 20) { - report_progress(); - counter &= (1<<20) - 1; - } + + dumpsys_pb_progress(len); if (ptr) { error = dump_append(di, ptr, 0, len); @@ -231,7 +192,7 @@ int minidumpsys(struct dumperinfo *di) { vm_paddr_t pa; - int error, i, retry_count; + int error, retry_count; uint32_t pmapsize; struct minidumphdr mdhdr; @@ -241,11 +202,6 @@ retry: fragsz = 0; DBG(total = dumptotal = 0;) - /* Reset progress */ - counter = 0; - for (i = 0; i < nitems(progress_track); i++) - progress_track[i].visited = 0; - /* Build set of dumpable pages from kernel pmap */ pmapsize = dumpsys_scan_pmap(); if (pmapsize % PAGE_SIZE != 0) { @@ -266,7 +222,7 @@ retry: else dump_drop_page(pa); } - progress = dumpsize; + dumpsys_pb_init(dumpsize); /* Initialize mdhdr */ bzero(&mdhdr, sizeof(mdhdr)); diff --git a/sys/riscv/include/dump.h b/sys/riscv/include/dump.h index 182a89eb8f98..3c3152f150e9 100644 --- a/sys/riscv/include/dump.h +++ b/sys/riscv/include/dump.h @@ -37,6 +37,9 @@ #define DUMPSYS_MD_PA_NPAIRS 10 #define DUMPSYS_NUM_AUX_HDRS 0 +/* How often to check the dump progress bar? */ +#define DUMPSYS_PB_CHECK_BITS 22 /* Every 4MB */ + static inline void dumpsys_pa_init(void) { diff --git a/sys/riscv/riscv/minidump_machdep.c b/sys/riscv/riscv/minidump_machdep.c index bcedfbdf2fb2..992ab097e1b3 100644 --- a/sys/riscv/riscv/minidump_machdep.c +++ b/sys/riscv/riscv/minidump_machdep.c @@ -60,45 +60,10 @@ static struct kerneldumpheader kdh; /* Handle chunked writes. */ static size_t fragsz; static void *dump_va; -static size_t counter, progress, dumpsize; +static size_t dumpsize; static uint64_t tmpbuffer[PAGE_SIZE / sizeof(uint64_t)]; -static struct { - int min_per; - int max_per; - int visited; -} progress_track[10] = { - { 0, 10, 0}, - { 10, 20, 0}, - { 20, 30, 0}, - { 30, 40, 0}, - { 40, 50, 0}, - { 50, 60, 0}, - { 60, 70, 0}, - { 70, 80, 0}, - { 80, 90, 0}, - { 90, 100, 0} -}; - -static void -report_progress(size_t progress, size_t dumpsize) -{ - int sofar, i; - - sofar = 100 - ((progress * 100) / dumpsize); - for (i = 0; i < nitems(progress_track); i++) { - if (sofar < progress_track[i].min_per || - sofar > progress_track[i].max_per) - continue; - if (progress_track[i].visited) - return; - progress_track[i].visited = 1; - printf("..%d%%", sofar); - return; - } -} - static int blk_flush(struct dumperinfo *di) { @@ -156,13 +121,8 @@ blk_write(struct dumperinfo *di, char *ptr, vm_paddr_t pa, size_t sz) len = maxdumpsz - fragsz; if (len > sz) len = sz; - counter += len; - progress -= len; - if (counter >> 22) { - report_progress(progress, dumpsize); - counter &= (1 << 22) - 1; - } + dumpsys_pb_progress(len); wdog_kern_pat(WD_LASTVAL); if (ptr) { @@ -253,7 +213,7 @@ retry: } dumpsize += PAGE_SIZE; - progress = dumpsize; + dumpsys_pb_init(dumpsize); /* Initialize mdhdr */ bzero(&mdhdr, sizeof(mdhdr)); diff --git a/sys/sys/kerneldump.h b/sys/sys/kerneldump.h index 8ce6a7a47127..c4ce9d2f13ec 100644 --- a/sys/sys/kerneldump.h +++ b/sys/sys/kerneldump.h @@ -151,6 +151,9 @@ void dumpsys_gen_wbinv_all(void); void dumpsys_gen_unmap_chunk(vm_paddr_t, size_t, void *); int dumpsys_gen_write_aux_headers(struct dumperinfo *); +void dumpsys_pb_init(uint64_t); +void dumpsys_pb_progress(size_t); + extern int do_minidump; #endif diff --git a/sys/x86/include/dump.h b/sys/x86/include/dump.h index 91c72acb4e5b..b8da0d50a6a4 100644 --- a/sys/x86/include/dump.h +++ b/sys/x86/include/dump.h @@ -42,6 +42,9 @@ #define DUMPSYS_MD_PA_NPAIRS 10 #define DUMPSYS_NUM_AUX_HDRS 0 +/* How often to check the dump progress bar? */ +#define DUMPSYS_PB_CHECK_BITS 24 /* Every 16MB */ + static inline void dumpsys_pa_init(void) { From owner-dev-commits-src-main@freebsd.org Wed Sep 29 20:27:31 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 520E167AEF9; Wed, 29 Sep 2021 20:27:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HKSbl1dtXz4q5C; Wed, 29 Sep 2021 20:27:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 17F861EBA3; Wed, 29 Sep 2021 20:27:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18TKRVEF038469; Wed, 29 Sep 2021 20:27:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18TKRUVo038468; Wed, 29 Sep 2021 20:27:30 GMT (envelope-from git) Date: Wed, 29 Sep 2021 20:27:30 GMT Message-Id: <202109292027.18TKRUVo038468@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Vladimir Kondratyev Subject: git: a81b36c6d35d - main - LinuxKPI: Implement get_file_rcu() MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: wulf X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a81b36c6d35d74177891860b789dd02b9d1c5851 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Sep 2021 20:27:31 -0000 The branch main has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=a81b36c6d35d74177891860b789dd02b9d1c5851 commit a81b36c6d35d74177891860b789dd02b9d1c5851 Author: Vladimir Kondratyev AuthorDate: 2021-09-29 20:12:25 +0000 Commit: Vladimir Kondratyev CommitDate: 2021-09-29 20:12:25 +0000 LinuxKPI: Implement get_file_rcu() get_file_rcu() grabs a file if the file->f_count is not zero. Required by drm-kmod 5.6 Reviewed by: hselasky, manu (previous version) MFC after: 2 weeks Differential revision: https://reviews.freebsd.org/D31672 --- sys/compat/linuxkpi/common/include/linux/fs.h | 9 +++++++++ sys/compat/linuxkpi/common/src/linux_compat.c | 4 +++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/sys/compat/linuxkpi/common/include/linux/fs.h b/sys/compat/linuxkpi/common/include/linux/fs.h index 38911c276216..eaf806b6732c 100644 --- a/sys/compat/linuxkpi/common/include/linux/fs.h +++ b/sys/compat/linuxkpi/common/include/linux/fs.h @@ -108,6 +108,8 @@ struct linux_file { /* pointer to associated character device, if any */ struct linux_cdev *f_cdev; + + struct rcu_head rcu; }; #define file linux_file @@ -254,6 +256,13 @@ get_file(struct linux_file *f) return (f); } +static inline bool +get_file_rcu(struct linux_file *f) +{ + return (refcount_acquire_if_not_zero( + f->_file == NULL ? &f->f_count : &f->_file->f_count)); +} + static inline struct inode * igrab(struct inode *inode) { diff --git a/sys/compat/linuxkpi/common/src/linux_compat.c b/sys/compat/linuxkpi/common/src/linux_compat.c index 7ea33c9a0d8d..f15b9396525c 100644 --- a/sys/compat/linuxkpi/common/src/linux_compat.c +++ b/sys/compat/linuxkpi/common/src/linux_compat.c @@ -90,6 +90,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #if defined(__i386__) || defined(__amd64__) #include @@ -472,7 +473,7 @@ linux_file_free(struct linux_file *filp) if (filp->_file == NULL) { if (filp->f_shmem != NULL) vm_object_deallocate(filp->f_shmem); - kfree(filp); + kfree_rcu(filp, rcu); } else { /* * The close method of the character device or file @@ -1538,6 +1539,7 @@ linux_file_close(struct file *file, struct thread *td) ldev = filp->f_cdev; if (ldev != NULL) linux_cdev_deref(ldev); + linux_synchronize_rcu(RCU_TYPE_REGULAR); kfree(filp); return (error); From owner-dev-commits-src-main@freebsd.org Wed Sep 29 20:27:32 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8C0C067B339; Wed, 29 Sep 2021 20:27:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HKSbm2Skrz4prk; Wed, 29 Sep 2021 20:27:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 31A581EBA4; Wed, 29 Sep 2021 20:27:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18TKRW8q038502; Wed, 29 Sep 2021 20:27:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18TKRWl6038501; Wed, 29 Sep 2021 20:27:32 GMT (envelope-from git) Date: Wed, 29 Sep 2021 20:27:32 GMT Message-Id: <202109292027.18TKRWl6038501@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Vladimir Kondratyev Subject: git: 66ea390652d2 - main - LinuxKPI: Remove FreeBSD struct resource from all LKPI headers MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: wulf X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 66ea390652d2ede405b43c168157986bd2b52bb9 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Sep 2021 20:27:32 -0000 The branch main has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=66ea390652d2ede405b43c168157986bd2b52bb9 commit 66ea390652d2ede405b43c168157986bd2b52bb9 Author: Vladimir Kondratyev AuthorDate: 2021-09-29 20:12:36 +0000 Commit: Vladimir Kondratyev CommitDate: 2021-09-29 20:12:36 +0000 LinuxKPI: Remove FreeBSD struct resource from all LKPI headers except linux/pci.h to avoid conflicts with Linux version. This allows to #define resource in drm-kmod globally and strip some #ifdef-s Reviewed by: hselasky, manu MFC after: 2 weeks Differential revision: https://reviews.freebsd.org/D31673 --- .../linuxkpi/common/include/linux/interrupt.h | 168 ++------------ sys/compat/linuxkpi/common/src/linux_compat.c | 41 ---- sys/compat/linuxkpi/common/src/linux_interrupt.c | 250 +++++++++++++++++++++ sys/conf/files | 2 + sys/modules/linuxkpi/Makefile | 1 + 5 files changed, 270 insertions(+), 192 deletions(-) diff --git a/sys/compat/linuxkpi/common/include/linux/interrupt.h b/sys/compat/linuxkpi/common/include/linux/interrupt.h index 6770adad2293..4e6c859853a7 100644 --- a/sys/compat/linuxkpi/common/include/linux/interrupt.h +++ b/sys/compat/linuxkpi/common/include/linux/interrupt.h @@ -38,109 +38,31 @@ #include #include -#include -#include #include typedef irqreturn_t (*irq_handler_t)(int, void *); #define IRQF_SHARED RF_SHAREABLE -struct irq_ent { - struct list_head links; - struct device *dev; - struct resource *res; - void *arg; - irqreturn_t (*handler)(int, void *); - irqreturn_t (*thread_handler)(int, void *); - void *tag; - unsigned int irq; -}; +struct irq_ent; void linux_irq_handler(void *); void lkpi_devm_irq_release(struct device *, void *); void lkpi_irq_release(struct device *, struct irq_ent *); - -static inline int -linux_irq_rid(struct device *dev, unsigned int irq) -{ - /* check for MSI- or MSIX- interrupt */ - if (irq >= dev->irq_start && irq < dev->irq_end) - return (irq - dev->irq_start + 1); - else - return (0); -} - -static inline struct irq_ent * -linux_irq_ent(struct device *dev, unsigned int irq) -{ - struct irq_ent *irqe; - - list_for_each_entry(irqe, &dev->irqents, links) - if (irqe->irq == irq) - return (irqe); - - return (NULL); -} - -static inline int -_request_irq(struct device *xdev, unsigned int irq, - irq_handler_t handler, irq_handler_t thread_handler, - unsigned long flags, const char *name, void *arg) -{ - struct resource *res; - struct irq_ent *irqe; - struct device *dev; - int error; - int rid; - - dev = linux_pci_find_irq_dev(irq); - if (dev == NULL) - return -ENXIO; - if (xdev != NULL && xdev != dev) - return -ENXIO; - rid = linux_irq_rid(dev, irq); - res = bus_alloc_resource_any(dev->bsddev, SYS_RES_IRQ, &rid, - flags | RF_ACTIVE); - if (res == NULL) - return (-ENXIO); - if (xdev != NULL) - irqe = lkpi_devres_alloc(lkpi_devm_irq_release, sizeof(*irqe), - GFP_KERNEL | __GFP_ZERO); - else - irqe = kzalloc(sizeof(*irqe), GFP_KERNEL); - irqe->dev = dev; - irqe->res = res; - irqe->arg = arg; - irqe->handler = handler; - irqe->thread_handler = thread_handler; - irqe->irq = irq; - - error = bus_setup_intr(dev->bsddev, res, INTR_TYPE_NET | INTR_MPSAFE, - NULL, linux_irq_handler, irqe, &irqe->tag); - if (error) - goto errout; - list_add(&irqe->links, &dev->irqents); - if (xdev != NULL) - devres_add(xdev, irqe); - - return 0; - -errout: - bus_release_resource(dev->bsddev, SYS_RES_IRQ, rid, irqe->res); - if (xdev != NULL) - devres_free(irqe); - else - kfree(irqe); - return (-error); -} +int lkpi_request_irq(struct device *, unsigned int, irq_handler_t, + irq_handler_t, unsigned long, const char *, void *); +int lkpi_enable_irq(unsigned int); +void lkpi_disable_irq(unsigned int); +int lkpi_bind_irq_to_cpu(unsigned int, int); +void lkpi_free_irq(unsigned int, void *); +void lkpi_devm_free_irq(struct device *, unsigned int, void *); static inline int request_irq(unsigned int irq, irq_handler_t handler, unsigned long flags, const char *name, void *arg) { - return (_request_irq(NULL, irq, handler, NULL, flags, name, arg)); + return (lkpi_request_irq(NULL, irq, handler, NULL, flags, name, arg)); } static inline int @@ -149,7 +71,7 @@ request_threaded_irq(int irq, irq_handler_t handler, const char *name, void *arg) { - return (_request_irq(NULL, irq, handler, thread_handler, + return (lkpi_request_irq(NULL, irq, handler, thread_handler, flags, name, arg)); } @@ -159,94 +81,38 @@ devm_request_threaded_irq(struct device *dev, int irq, unsigned long flags, const char *name, void *arg) { - return (_request_irq(dev, irq, handler, thread_handler, + return (lkpi_request_irq(dev, irq, handler, thread_handler, flags, name, arg)); } static inline int enable_irq(unsigned int irq) { - struct irq_ent *irqe; - struct device *dev; - - dev = linux_pci_find_irq_dev(irq); - if (dev == NULL) - return -EINVAL; - irqe = linux_irq_ent(dev, irq); - if (irqe == NULL || irqe->tag != NULL) - return -EINVAL; - return -bus_setup_intr(dev->bsddev, irqe->res, INTR_TYPE_NET | INTR_MPSAFE, - NULL, linux_irq_handler, irqe, &irqe->tag); + return (lkpi_enable_irq(irq)); } static inline void disable_irq(unsigned int irq) { - struct irq_ent *irqe; - struct device *dev; - - dev = linux_pci_find_irq_dev(irq); - if (dev == NULL) - return; - irqe = linux_irq_ent(dev, irq); - if (irqe == NULL) - return; - if (irqe->tag != NULL) - bus_teardown_intr(dev->bsddev, irqe->res, irqe->tag); - irqe->tag = NULL; + lkpi_disable_irq(irq); } static inline int bind_irq_to_cpu(unsigned int irq, int cpu_id) { - struct irq_ent *irqe; - struct device *dev; - - dev = linux_pci_find_irq_dev(irq); - if (dev == NULL) - return (-ENOENT); - - irqe = linux_irq_ent(dev, irq); - if (irqe == NULL) - return (-ENOENT); - - return (-bus_bind_intr(dev->bsddev, irqe->res, cpu_id)); + return (lkpi_bind_irq_to_cpu(irq, cpu_id)); } static inline void -free_irq(unsigned int irq, void *device __unused) +free_irq(unsigned int irq, void *device) { - struct irq_ent *irqe; - struct device *dev; - - dev = linux_pci_find_irq_dev(irq); - if (dev == NULL) - return; - irqe = linux_irq_ent(dev, irq); - if (irqe == NULL) - return; - lkpi_irq_release(dev, irqe); - kfree(irqe); + lkpi_free_irq(irq, device); } static inline void devm_free_irq(struct device *xdev, unsigned int irq, void *p) { - struct device *dev; - struct irq_ent *irqe; - - dev = linux_pci_find_irq_dev(irq); - if (dev == NULL) - return; - if (xdev != dev) - return; - irqe = linux_irq_ent(dev, irq); - if (irqe == NULL) - return; - lkpi_irq_release(dev, irqe); - lkpi_devres_unlink(dev, irqe); - lkpi_devres_free(irqe); - return; + lkpi_devm_free_irq(xdev, irq, p); } static inline int diff --git a/sys/compat/linuxkpi/common/src/linux_compat.c b/sys/compat/linuxkpi/common/src/linux_compat.c index f15b9396525c..8e3a3ea52ff1 100644 --- a/sys/compat/linuxkpi/common/src/linux_compat.c +++ b/sys/compat/linuxkpi/common/src/linux_compat.c @@ -2466,47 +2466,6 @@ list_sort(void *priv, struct list_head *head, int (*cmp)(void *priv, free(ar, M_KMALLOC); } -void -lkpi_irq_release(struct device *dev, struct irq_ent *irqe) -{ - - if (irqe->tag != NULL) - bus_teardown_intr(dev->bsddev, irqe->res, irqe->tag); - if (irqe->res != NULL) - bus_release_resource(dev->bsddev, SYS_RES_IRQ, - rman_get_rid(irqe->res), irqe->res); - list_del(&irqe->links); -} - -void -lkpi_devm_irq_release(struct device *dev, void *p) -{ - struct irq_ent *irqe; - - if (dev == NULL || p == NULL) - return; - - irqe = p; - lkpi_irq_release(dev, irqe); -} - -void -linux_irq_handler(void *ent) -{ - struct irq_ent *irqe; - - if (linux_set_current_flags(curthread, M_NOWAIT)) - return; - - irqe = ent; - if (irqe->handler(irqe->irq, irqe->arg) == IRQ_WAKE_THREAD && - irqe->thread_handler != NULL) { - THREAD_SLEEPING_OK(); - irqe->thread_handler(irqe->irq, irqe->arg); - THREAD_NO_SLEEPING(); - } -} - #if defined(__i386__) || defined(__amd64__) int linux_wbinvd_on_all_cpus(void) diff --git a/sys/compat/linuxkpi/common/src/linux_interrupt.c b/sys/compat/linuxkpi/common/src/linux_interrupt.c new file mode 100644 index 000000000000..cc6380553497 --- /dev/null +++ b/sys/compat/linuxkpi/common/src/linux_interrupt.c @@ -0,0 +1,250 @@ +/*- + * Copyright (c) 2010 Isilon Systems, Inc. + * Copyright (c) 2010 iX Systems, Inc. + * Copyright (c) 2010 Panasas, Inc. + * Copyright (c) 2013-2015 Mellanox Technologies, Ltd. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice unmodified, this list of conditions, and the following + * disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#include +#include +#include + +#include +#include +#include +#include + +struct irq_ent { + struct list_head links; + struct device *dev; + struct resource *res; + void *arg; + irqreturn_t (*handler)(int, void *); + irqreturn_t (*thread_handler)(int, void *); + void *tag; + unsigned int irq; +}; + +static inline int +lkpi_irq_rid(struct device *dev, unsigned int irq) +{ + /* check for MSI- or MSIX- interrupt */ + if (irq >= dev->irq_start && irq < dev->irq_end) + return (irq - dev->irq_start + 1); + else + return (0); +} + +static inline struct irq_ent * +lkpi_irq_ent(struct device *dev, unsigned int irq) +{ + struct irq_ent *irqe; + + list_for_each_entry(irqe, &dev->irqents, links) + if (irqe->irq == irq) + return (irqe); + + return (NULL); +} + +void +linux_irq_handler(void *ent) +{ + struct irq_ent *irqe; + + if (linux_set_current_flags(curthread, M_NOWAIT)) + return; + + irqe = ent; + if (irqe->handler(irqe->irq, irqe->arg) == IRQ_WAKE_THREAD && + irqe->thread_handler != NULL) { + THREAD_SLEEPING_OK(); + irqe->thread_handler(irqe->irq, irqe->arg); + THREAD_NO_SLEEPING(); + } +} + +void +lkpi_irq_release(struct device *dev, struct irq_ent *irqe) +{ + if (irqe->tag != NULL) + bus_teardown_intr(dev->bsddev, irqe->res, irqe->tag); + if (irqe->res != NULL) + bus_release_resource(dev->bsddev, SYS_RES_IRQ, + rman_get_rid(irqe->res), irqe->res); + list_del(&irqe->links); +} + +void +lkpi_devm_irq_release(struct device *dev, void *p) +{ + struct irq_ent *irqe; + + if (dev == NULL || p == NULL) + return; + + irqe = p; + lkpi_irq_release(dev, irqe); +} + +int +lkpi_request_irq(struct device *xdev, unsigned int irq, + irq_handler_t handler, irq_handler_t thread_handler, + unsigned long flags, const char *name, void *arg) +{ + struct resource *res; + struct irq_ent *irqe; + struct device *dev; + int error; + int rid; + + dev = linux_pci_find_irq_dev(irq); + if (dev == NULL) + return -ENXIO; + if (xdev != NULL && xdev != dev) + return -ENXIO; + rid = lkpi_irq_rid(dev, irq); + res = bus_alloc_resource_any(dev->bsddev, SYS_RES_IRQ, &rid, + flags | RF_ACTIVE); + if (res == NULL) + return (-ENXIO); + if (xdev != NULL) + irqe = lkpi_devres_alloc(lkpi_devm_irq_release, sizeof(*irqe), + GFP_KERNEL | __GFP_ZERO); + else + irqe = kzalloc(sizeof(*irqe), GFP_KERNEL); + irqe->dev = dev; + irqe->res = res; + irqe->arg = arg; + irqe->handler = handler; + irqe->thread_handler = thread_handler; + irqe->irq = irq; + + error = bus_setup_intr(dev->bsddev, res, INTR_TYPE_NET | INTR_MPSAFE, + NULL, linux_irq_handler, irqe, &irqe->tag); + if (error) + goto errout; + list_add(&irqe->links, &dev->irqents); + if (xdev != NULL) + devres_add(xdev, irqe); + + return 0; + +errout: + bus_release_resource(dev->bsddev, SYS_RES_IRQ, rid, irqe->res); + if (xdev != NULL) + devres_free(irqe); + else + kfree(irqe); + return (-error); +} + +int +lkpi_enable_irq(unsigned int irq) +{ + struct irq_ent *irqe; + struct device *dev; + + dev = linux_pci_find_irq_dev(irq); + if (dev == NULL) + return -EINVAL; + irqe = lkpi_irq_ent(dev, irq); + if (irqe == NULL || irqe->tag != NULL) + return -EINVAL; + return -bus_setup_intr(dev->bsddev, irqe->res, INTR_TYPE_NET | INTR_MPSAFE, + NULL, linux_irq_handler, irqe, &irqe->tag); +} + +void +lkpi_disable_irq(unsigned int irq) +{ + struct irq_ent *irqe; + struct device *dev; + + dev = linux_pci_find_irq_dev(irq); + if (dev == NULL) + return; + irqe = lkpi_irq_ent(dev, irq); + if (irqe == NULL) + return; + if (irqe->tag != NULL) + bus_teardown_intr(dev->bsddev, irqe->res, irqe->tag); + irqe->tag = NULL; +} + +int +lkpi_bind_irq_to_cpu(unsigned int irq, int cpu_id) +{ + struct irq_ent *irqe; + struct device *dev; + + dev = linux_pci_find_irq_dev(irq); + if (dev == NULL) + return (-ENOENT); + + irqe = lkpi_irq_ent(dev, irq); + if (irqe == NULL) + return (-ENOENT); + + return (-bus_bind_intr(dev->bsddev, irqe->res, cpu_id)); +} + +void +lkpi_free_irq(unsigned int irq, void *device __unused) +{ + struct irq_ent *irqe; + struct device *dev; + + dev = linux_pci_find_irq_dev(irq); + if (dev == NULL) + return; + irqe = lkpi_irq_ent(dev, irq); + if (irqe == NULL) + return; + lkpi_irq_release(dev, irqe); + kfree(irqe); +} + +void +lkpi_devm_free_irq(struct device *xdev, unsigned int irq, void *p __unused) +{ + struct device *dev; + struct irq_ent *irqe; + + dev = linux_pci_find_irq_dev(irq); + if (dev == NULL) + return; + if (xdev != dev) + return; + irqe = lkpi_irq_ent(dev, irq); + if (irqe == NULL) + return; + lkpi_irq_release(dev, irqe); + lkpi_devres_unlink(dev, irqe); + lkpi_devres_free(irqe); + return; +} diff --git a/sys/conf/files b/sys/conf/files index eaf356d8dce4..828953628eda 100644 --- a/sys/conf/files +++ b/sys/conf/files @@ -4564,6 +4564,8 @@ compat/linuxkpi/common/src/linux_fpu.c optional compat_linuxkpi \ compile-with "${LINUXKPI_C}" compat/linuxkpi/common/src/linux_hrtimer.c optional compat_linuxkpi \ compile-with "${LINUXKPI_C}" +compat/linuxkpi/common/src/linux_interrupt.c optional compat_linuxkpi \ + compile-with "${LINUXKPI_C}" compat/linuxkpi/common/src/linux_kthread.c optional compat_linuxkpi \ compile-with "${LINUXKPI_C}" compat/linuxkpi/common/src/linux_lock.c optional compat_linuxkpi \ diff --git a/sys/modules/linuxkpi/Makefile b/sys/modules/linuxkpi/Makefile index f922a1fc85a2..e1b1eab6ab09 100644 --- a/sys/modules/linuxkpi/Makefile +++ b/sys/modules/linuxkpi/Makefile @@ -11,6 +11,7 @@ SRCS= linux_compat.c \ linux_fpu.c \ linux_hrtimer.c \ linux_idr.c \ + linux_interrupt.c \ linux_kmod.c \ linux_kthread.c \ linux_lock.c \ From owner-dev-commits-src-main@freebsd.org Wed Sep 29 20:27:34 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BEC7A67B33B; Wed, 29 Sep 2021 20:27:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HKSbp4FF1z4q2f; Wed, 29 Sep 2021 20:27:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6FB791EB31; Wed, 29 Sep 2021 20:27:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18TKRY5u038550; Wed, 29 Sep 2021 20:27:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18TKRYat038549; Wed, 29 Sep 2021 20:27:34 GMT (envelope-from git) Date: Wed, 29 Sep 2021 20:27:34 GMT Message-Id: <202109292027.18TKRYat038549@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Vladimir Kondratyev Subject: git: 2fe9ea5d3ad6 - main - LinuxKPI: allocate current before taking shrinkers lock MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: wulf X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2fe9ea5d3ad69d880138d98b2ae8d2c4309eeafa Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Sep 2021 20:27:34 -0000 The branch main has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=2fe9ea5d3ad69d880138d98b2ae8d2c4309eeafa commit 2fe9ea5d3ad69d880138d98b2ae8d2c4309eeafa Author: Vladimir Kondratyev AuthorDate: 2021-09-29 20:12:58 +0000 Commit: Vladimir Kondratyev CommitDate: 2021-09-29 20:12:58 +0000 LinuxKPI: allocate current before taking shrinkers lock This fixes following warnings when shrinkers are invoked first time: uma_zalloc_debug: zone "lkpicurr" with the following non-sleepable locks held: exclusive sleep mutex lkpi-shrinker (lkpi-shrinker) uma_zalloc_debug: zone "lkpimm" with the following non-sleepable locks held: exclusive sleep mutex lkpi-shrinker (lkpi-shrinker) Reviewed by: hselasky, manu MFC after: 2 weeks Differential revision: https://reviews.freebsd.org/D32066 --- sys/compat/linuxkpi/common/src/linux_shrinker.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/compat/linuxkpi/common/src/linux_shrinker.c b/sys/compat/linuxkpi/common/src/linux_shrinker.c index 0423f4e05804..b66316c22013 100644 --- a/sys/compat/linuxkpi/common/src/linux_shrinker.c +++ b/sys/compat/linuxkpi/common/src/linux_shrinker.c @@ -36,6 +36,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include TAILQ_HEAD(, shrinker) lkpi_shrinkers = TAILQ_HEAD_INITIALIZER(lkpi_shrinkers); @@ -93,6 +94,7 @@ linuxkpi_vm_lowmem(void *arg __unused) { struct shrinker *s; + linux_set_current(curthread); mtx_lock(&mtx_shrinker); TAILQ_FOREACH(s, &lkpi_shrinkers, next) { shrinker_shrink(s); From owner-dev-commits-src-main@freebsd.org Wed Sep 29 20:27:36 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1499367AD59; Wed, 29 Sep 2021 20:27:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HKSbq5Mtmz4q7Y; Wed, 29 Sep 2021 20:27:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 946571E77F; Wed, 29 Sep 2021 20:27:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18TKRZh2038574; Wed, 29 Sep 2021 20:27:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18TKRZcq038573; Wed, 29 Sep 2021 20:27:35 GMT (envelope-from git) Date: Wed, 29 Sep 2021 20:27:35 GMT Message-Id: <202109292027.18TKRZcq038573@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Vladimir Kondratyev Subject: git: 7d92d4835850 - main - LinuxKPI: Invoke release handler when file is destroyed by fput() MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: wulf X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 7d92d4835850fdc5c1ec1fa7c5634826a61ad0a5 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Sep 2021 20:27:36 -0000 The branch main has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=7d92d4835850fdc5c1ec1fa7c5634826a61ad0a5 commit 7d92d4835850fdc5c1ec1fa7c5634826a61ad0a5 Author: Vladimir Kondratyev AuthorDate: 2021-09-29 20:13:27 +0000 Commit: Vladimir Kondratyev CommitDate: 2021-09-29 20:13:27 +0000 LinuxKPI: Invoke release handler when file is destroyed by fput() Required by drm_kmod 5.6 Reviewed by: hselasky, manu MFC after: 2 weeks Differential revision: https://reviews.freebsd.org/D32067 --- sys/compat/linuxkpi/common/src/linux_compat.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/compat/linuxkpi/common/src/linux_compat.c b/sys/compat/linuxkpi/common/src/linux_compat.c index 8e3a3ea52ff1..103d7ab0c60b 100644 --- a/sys/compat/linuxkpi/common/src/linux_compat.c +++ b/sys/compat/linuxkpi/common/src/linux_compat.c @@ -471,6 +471,8 @@ void linux_file_free(struct linux_file *filp) { if (filp->_file == NULL) { + if (filp->f_op != NULL && filp->f_op->release != NULL) + filp->f_op->release(filp->f_vnode, filp); if (filp->f_shmem != NULL) vm_object_deallocate(filp->f_shmem); kfree_rcu(filp, rcu); From owner-dev-commits-src-main@freebsd.org Wed Sep 29 20:27:33 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E50AA67B33A; Wed, 29 Sep 2021 20:27:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HKSbn3Qxyz4ppg; Wed, 29 Sep 2021 20:27:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5416A1EE04; Wed, 29 Sep 2021 20:27:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18TKRXFM038526; Wed, 29 Sep 2021 20:27:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18TKRXuh038525; Wed, 29 Sep 2021 20:27:33 GMT (envelope-from git) Date: Wed, 29 Sep 2021 20:27:33 GMT Message-Id: <202109292027.18TKRXuh038525@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Vladimir Kondratyev Subject: git: b58c916f115d - main - LinuxKPI: implement _IOC_TYPE and _IOC_NR macros in linux/ioctl.h MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: wulf X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b58c916f115d9d40f91397a1b406891f36c39fad Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Sep 2021 20:27:34 -0000 The branch main has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=b58c916f115d9d40f91397a1b406891f36c39fad commit b58c916f115d9d40f91397a1b406891f36c39fad Author: Vladimir Kondratyev AuthorDate: 2021-09-29 20:12:47 +0000 Commit: Vladimir Kondratyev CommitDate: 2021-09-29 20:12:47 +0000 LinuxKPI: implement _IOC_TYPE and _IOC_NR macros in linux/ioctl.h They are used by drm-kmod Reviewed by: emaste, hselasky, manu MFC after: 2 weeks Differential revision: https://reviews.freebsd.org/D31674 --- sys/compat/linuxkpi/common/include/linux/ioctl.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sys/compat/linuxkpi/common/include/linux/ioctl.h b/sys/compat/linuxkpi/common/include/linux/ioctl.h index fdedf9c4a179..fcdb5c547e73 100644 --- a/sys/compat/linuxkpi/common/include/linux/ioctl.h +++ b/sys/compat/linuxkpi/common/include/linux/ioctl.h @@ -33,6 +33,8 @@ #include -#define _IOC_SIZE(cmd) IOCPARM_LEN(cmd) +#define _IOC_SIZE(cmd) IOCPARM_LEN(cmd) +#define _IOC_TYPE(cmd) IOCGROUP(cmd) +#define _IOC_NR(cmd) ((cmd) & 0xff) #endif /* _LINUX_IOCTL_H_ */ From owner-dev-commits-src-main@freebsd.org Wed Sep 29 20:27:38 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 551F267B2F4; Wed, 29 Sep 2021 20:27:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HKSbt0Rnwz4pq7; Wed, 29 Sep 2021 20:27:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CF4F91E7C2; Wed, 29 Sep 2021 20:27:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18TKRbu2038628; Wed, 29 Sep 2021 20:27:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18TKRb4g038627; Wed, 29 Sep 2021 20:27:37 GMT (envelope-from git) Date: Wed, 29 Sep 2021 20:27:37 GMT Message-Id: <202109292027.18TKRb4g038627@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Vladimir Kondratyev Subject: git: bd6d55adb413 - main - LinuxKPI: stub anon_inode_getfile MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: wulf X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: bd6d55adb4131d7172e0485d30ceca4e5aa12ff5 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Sep 2021 20:27:38 -0000 The branch main has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=bd6d55adb4131d7172e0485d30ceca4e5aa12ff5 commit bd6d55adb4131d7172e0485d30ceca4e5aa12ff5 Author: Vladimir Kondratyev AuthorDate: 2021-09-29 20:13:53 +0000 Commit: Vladimir Kondratyev CommitDate: 2021-09-29 20:13:53 +0000 LinuxKPI: stub anon_inode_getfile Although drm-kmod contains better implementation which is able to allocate real entries on pseudofs, this feature has never been used. Starting from drm-kmod v5.6 old implementation began to leak entries on each drm device close(). Now just drop pseudofs support instead of fixing it in drm-kmod and provide stub in base. Reviewed by: hselasky, manu MFC after: 2 weeks Differential revision: https://reviews.freebsd.org/D32069 --- .../linuxkpi/common/include/linux/anon_inodes.h | 48 ++++++++++++++++++++++ 1 file changed, 48 insertions(+) diff --git a/sys/compat/linuxkpi/common/include/linux/anon_inodes.h b/sys/compat/linuxkpi/common/include/linux/anon_inodes.h new file mode 100644 index 000000000000..8fa61cd4b45f --- /dev/null +++ b/sys/compat/linuxkpi/common/include/linux/anon_inodes.h @@ -0,0 +1,48 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2021 Vladimir Kondratyev + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#ifndef _LINUX_ANON_INODES_H_ +#define _LINUX_ANON_INODES_H_ + +#include +#include +#include + +static inline struct file * +anon_inode_getfile(const char *name __unused, + const struct file_operations *fops, void *priv, int flags __unused) +{ + struct file *file; + + file = alloc_file(FMODE_READ, fops); + file->private_data = priv; + + return (file); +} + +#endif /* _LINUX_ANON_INODES_H_ */ From owner-dev-commits-src-main@freebsd.org Wed Sep 29 20:27:41 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 93CEE67B34A; Wed, 29 Sep 2021 20:27:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HKSbx3JB5z4psR; Wed, 29 Sep 2021 20:27:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4E4481EBA5; Wed, 29 Sep 2021 20:27:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18TKRfCf038700; Wed, 29 Sep 2021 20:27:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18TKRfNC038699; Wed, 29 Sep 2021 20:27:41 GMT (envelope-from git) Date: Wed, 29 Sep 2021 20:27:41 GMT Message-Id: <202109292027.18TKRfNC038699@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Vladimir Kondratyev Subject: git: 6efabdeede7f - main - LinuxKPI: Import linux/poison.h header MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: wulf X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 6efabdeede7f3aac4b133116a421f5a7a721e24c Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Sep 2021 20:27:42 -0000 The branch main has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=6efabdeede7f3aac4b133116a421f5a7a721e24c commit 6efabdeede7f3aac4b133116a421f5a7a721e24c Author: Vladimir Kondratyev AuthorDate: 2021-09-29 20:14:34 +0000 Commit: Vladimir Kondratyev CommitDate: 2021-09-29 20:14:34 +0000 LinuxKPI: Import linux/poison.h header Required by drm-kmod 5.6 Reviewed by: hselasky, imp, manu MFC after: 2 weeks Obtained from: OpenBSD Differential revision: https://reviews.freebsd.org/D32092 --- sys/compat/linuxkpi/common/include/linux/poison.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/sys/compat/linuxkpi/common/include/linux/poison.h b/sys/compat/linuxkpi/common/include/linux/poison.h new file mode 100644 index 000000000000..35ccb5b5499a --- /dev/null +++ b/sys/compat/linuxkpi/common/include/linux/poison.h @@ -0,0 +1,9 @@ +/* Public domain. */ + +#ifndef _LINUX_POISON_H +#define _LINUX_POISON_H + +#define POISON_INUSE 0xdb +#define POISON_FREE 0xdf + +#endif From owner-dev-commits-src-main@freebsd.org Wed Sep 29 20:27:40 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9276667AD67; Wed, 29 Sep 2021 20:27:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HKSbw2NpKz4q5f; Wed, 29 Sep 2021 20:27:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 296DC1EE07; Wed, 29 Sep 2021 20:27:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18TKRe9d038676; Wed, 29 Sep 2021 20:27:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18TKReF5038675; Wed, 29 Sep 2021 20:27:40 GMT (envelope-from git) Date: Wed, 29 Sep 2021 20:27:40 GMT Message-Id: <202109292027.18TKReF5038675@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Vladimir Kondratyev Subject: git: b59ffedae8f3 - main - LinuxKPI: Add helper functions to store integers to linux/xarray.h MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: wulf X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b59ffedae8f3707bf0079b4fd0cbf8190eed0c5e Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Sep 2021 20:27:40 -0000 The branch main has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=b59ffedae8f3707bf0079b4fd0cbf8190eed0c5e commit b59ffedae8f3707bf0079b4fd0cbf8190eed0c5e Author: Vladimir Kondratyev AuthorDate: 2021-09-29 20:14:23 +0000 Commit: Vladimir Kondratyev CommitDate: 2021-09-29 20:14:23 +0000 LinuxKPI: Add helper functions to store integers to linux/xarray.h Required by drm-kmod. Reviewed by: hselasky MFC after: 2 weeks Differential revision: https://reviews.freebsd.org/D32091 --- sys/compat/linuxkpi/common/include/linux/xarray.h | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/sys/compat/linuxkpi/common/include/linux/xarray.h b/sys/compat/linuxkpi/common/include/linux/xarray.h index afe66c1f2b5f..7427f6e4f9f9 100644 --- a/sys/compat/linuxkpi/common/include/linux/xarray.h +++ b/sys/compat/linuxkpi/common/include/linux/xarray.h @@ -97,4 +97,27 @@ xa_init(struct xarray *xa) xa_init_flags(xa, 0); } +static inline void * +xa_mk_value(unsigned long v) +{ + unsigned long r = (v << 1) | 1; + + return ((void *)r); +} + +static inline bool +xa_is_value(const void *e) +{ + unsigned long v = (unsigned long)e; + + return (v & 1); +} + +static inline unsigned long +xa_to_value(const void *e) +{ + unsigned long v = (unsigned long)e; + + return (v >> 1); +} #endif /* _LINUX_XARRAY_H_ */ From owner-dev-commits-src-main@freebsd.org Wed Sep 29 20:27:39 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 93FBF67B346; Wed, 29 Sep 2021 20:27:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HKSbv2Vk9z4psF; Wed, 29 Sep 2021 20:27:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0F30F1EE06; Wed, 29 Sep 2021 20:27:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18TKRck5038652; Wed, 29 Sep 2021 20:27:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18TKRc5u038651; Wed, 29 Sep 2021 20:27:38 GMT (envelope-from git) Date: Wed, 29 Sep 2021 20:27:38 GMT Message-Id: <202109292027.18TKRc5u038651@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Vladimir Kondratyev Subject: git: 62ff0566c930 - main - LinuxKPI: Allow cdev_pager prefault handler to steal pages MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: wulf X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 62ff0566c93056e00b3c9c3f8d2ac1e7d8e0c098 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Sep 2021 20:27:39 -0000 The branch main has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=62ff0566c93056e00b3c9c3f8d2ac1e7d8e0c098 commit 62ff0566c93056e00b3c9c3f8d2ac1e7d8e0c098 Author: Vladimir Kondratyev AuthorDate: 2021-09-29 20:14:05 +0000 Commit: Vladimir Kondratyev CommitDate: 2021-09-29 20:14:05 +0000 LinuxKPI: Allow cdev_pager prefault handler to steal pages from other vm_objects. This workarounds "Page already inserted" panic in vm_page_insert routine triggered on attempt to mmap file created with shmem_file_setup call. After introduction of "GTT mmap interface v4" a.k.a. MMAP_OFFSET, vm_objects allocated by these calls may try to own intersected sets of pages that leads to the assertion. Reviewed by: kib MFC after: 2 weeks Differential revision: https://reviews.freebsd.org/D32090 --- sys/compat/linuxkpi/common/src/linux_page.c | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/sys/compat/linuxkpi/common/src/linux_page.c b/sys/compat/linuxkpi/common/src/linux_page.c index cbe6d2530b91..c7191fef3429 100644 --- a/sys/compat/linuxkpi/common/src/linux_page.c +++ b/sys/compat/linuxkpi/common/src/linux_page.c @@ -281,6 +281,7 @@ lkpi_vmf_insert_pfn_prot_locked(struct vm_area_struct *vma, unsigned long addr, unsigned long pfn, pgprot_t prot) { vm_object_t vm_obj = vma->vm_obj; + vm_object_t tmp_obj; vm_page_t page; vm_pindex_t pindex; @@ -296,6 +297,32 @@ retry: page = PHYS_TO_VM_PAGE(IDX_TO_OFF(pfn)); if (!vm_page_busy_acquire(page, VM_ALLOC_WAITFAIL)) goto retry; + if (page->object != NULL) { + tmp_obj = page->object; + vm_page_xunbusy(page); + VM_OBJECT_WUNLOCK(vm_obj); + VM_OBJECT_WLOCK(tmp_obj); + if (page->object == tmp_obj && + vm_page_busy_acquire(page, VM_ALLOC_WAITFAIL)) { + KASSERT(page->object == tmp_obj, + ("page has changed identity")); + KASSERT((page->oflags & VPO_UNMANAGED) == 0, + ("page does not belong to shmem")); + vm_pager_page_unswapped(page); + if (pmap_page_is_mapped(page)) { + vm_page_xunbusy(page); + VM_OBJECT_WUNLOCK(tmp_obj); + printf("%s: page rename failed: page " + "is mapped\n", __func__); + VM_OBJECT_WLOCK(vm_obj); + return (VM_FAULT_NOPAGE); + } + vm_page_remove(page); + } + VM_OBJECT_WUNLOCK(tmp_obj); + VM_OBJECT_WLOCK(vm_obj); + goto retry; + } if (vm_page_insert(page, vm_obj, pindex)) { vm_page_xunbusy(page); return (VM_FAULT_OOM); From owner-dev-commits-src-main@freebsd.org Wed Sep 29 20:27:46 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6964D67B609; Wed, 29 Sep 2021 20:27:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HKSc20bX7z4qDM; Wed, 29 Sep 2021 20:27:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DCDE21ED88; Wed, 29 Sep 2021 20:27:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18TKRjh1038802; Wed, 29 Sep 2021 20:27:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18TKRjJN038801; Wed, 29 Sep 2021 20:27:45 GMT (envelope-from git) Date: Wed, 29 Sep 2021 20:27:45 GMT Message-Id: <202109292027.18TKRjJN038801@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Vladimir Kondratyev Subject: git: 88531adbfbe2 - main - LinuxKPI: Update pte_fn_t definition to match Linux 5.3 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: wulf X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 88531adbfbe25c6ae56cc7bbe76c825a3f5dc504 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Sep 2021 20:27:46 -0000 The branch main has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=88531adbfbe25c6ae56cc7bbe76c825a3f5dc504 commit 88531adbfbe25c6ae56cc7bbe76c825a3f5dc504 Author: Vladimir Kondratyev AuthorDate: 2021-09-29 20:15:27 +0000 Commit: Vladimir Kondratyev CommitDate: 2021-09-29 20:15:27 +0000 LinuxKPI: Update pte_fn_t definition to match Linux 5.3 Reviewed by: emaste, hselasky, manu MFC after: 2 weeks Differential revision: https://reviews.freebsd.org/D32166 --- sys/compat/linuxkpi/common/include/linux/mm.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/compat/linuxkpi/common/include/linux/mm.h b/sys/compat/linuxkpi/common/include/linux/mm.h index 871d16cb06ff..4301e616f234 100644 --- a/sys/compat/linuxkpi/common/include/linux/mm.h +++ b/sys/compat/linuxkpi/common/include/linux/mm.h @@ -98,7 +98,7 @@ CTASSERT((VM_PROT_ALL & -(1 << 8)) == 0); #define fault_flag_allow_retry_first(flags) \ (((flags) & (FAULT_FLAG_ALLOW_RETRY | FAULT_FLAG_TRIED)) == FAULT_FLAG_ALLOW_RETRY) -typedef int (*pte_fn_t)(linux_pte_t *, pgtable_t, unsigned long addr, void *data); +typedef int (*pte_fn_t)(linux_pte_t *, unsigned long addr, void *data); struct vm_area_struct { vm_offset_t vm_start; From owner-dev-commits-src-main@freebsd.org Wed Sep 29 20:27:47 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B99C767B357; Wed, 29 Sep 2021 20:27:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HKSc320ckz4q3N; Wed, 29 Sep 2021 20:27:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 12FB91EAB8; Wed, 29 Sep 2021 20:27:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18TKRkeD038826; Wed, 29 Sep 2021 20:27:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18TKRked038825; Wed, 29 Sep 2021 20:27:46 GMT (envelope-from git) Date: Wed, 29 Sep 2021 20:27:46 GMT Message-Id: <202109292027.18TKRked038825@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Vladimir Kondratyev Subject: git: c072f6e856bc - main - LinuxKPI: Import linux_page.c and some dependent code from drm-kmod MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: wulf X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c072f6e856bc0348bf6fdd468761041948823f73 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Sep 2021 20:27:47 -0000 The branch main has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=c072f6e856bc0348bf6fdd468761041948823f73 commit c072f6e856bc0348bf6fdd468761041948823f73 Author: Vladimir Kondratyev AuthorDate: 2021-09-29 20:15:37 +0000 Commit: Vladimir Kondratyev CommitDate: 2021-09-29 20:15:37 +0000 LinuxKPI: Import linux_page.c and some dependent code from drm-kmod No functional changes intended Reviewed by: hselasky, manu, markj MFC after: 2 weeks Differential revision: https://reviews.freebsd.org/D32167 --- sys/compat/linuxkpi/common/include/linux/highmem.h | 118 +++++++++++++++++++++ sys/compat/linuxkpi/common/include/linux/mm.h | 4 + sys/compat/linuxkpi/common/include/linux/page.h | 22 ++++ .../linuxkpi/common/include/linux/scatterlist.h | 58 ++++++++++ sys/compat/linuxkpi/common/src/linux_page.c | 34 ++++++ 5 files changed, 236 insertions(+) diff --git a/sys/compat/linuxkpi/common/include/linux/highmem.h b/sys/compat/linuxkpi/common/include/linux/highmem.h new file mode 100644 index 000000000000..9378746ea480 --- /dev/null +++ b/sys/compat/linuxkpi/common/include/linux/highmem.h @@ -0,0 +1,118 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2010 Isilon Systems, Inc. + * Copyright (c) 2016 Matthew Macy (mmacy@mattmacy.io) + * Copyright (c) 2017 Mellanox Technologies, Ltd. + * Copyright (c) 2021 Vladimir Kondratyev + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#ifndef _LINUX_HIGHMEM_H_ +#define _LINUX_HIGHMEM_H_ + +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include + +#define PageHighMem(p) (0) + +static inline vm_page_t +kmap_to_page(void *addr) +{ + return (virt_to_page(addr)); +} + +static inline void * +kmap(vm_page_t page) +{ + struct sf_buf *sf; + + if (PMAP_HAS_DMAP) { + return ((void *)PHYS_TO_DMAP(VM_PAGE_TO_PHYS(page))); + } else { + sched_pin(); + sf = sf_buf_alloc(page, SFB_NOWAIT | SFB_CPUPRIVATE); + if (sf == NULL) { + sched_unpin(); + return (NULL); + } + return ((void *)sf_buf_kva(sf)); + } +} + +static inline void * +kmap_atomic_prot(vm_page_t page, pgprot_t prot) +{ + vm_memattr_t attr = pgprot2cachemode(prot); + + if (attr != VM_MEMATTR_DEFAULT) { + vm_page_lock(page); + page->flags |= PG_FICTITIOUS; + vm_page_unlock(page); + pmap_page_set_memattr(page, attr); + } + return (kmap(page)); +} + +static inline void * +kmap_atomic(vm_page_t page) +{ + return (kmap_atomic_prot(page, VM_PROT_ALL)); +} + +static inline void +kunmap(vm_page_t page) +{ + struct sf_buf *sf; + + if (!PMAP_HAS_DMAP) { + /* lookup SF buffer in list */ + sf = sf_buf_alloc(page, SFB_NOWAIT | SFB_CPUPRIVATE); + + /* double-free */ + sf_buf_free(sf); + sf_buf_free(sf); + + sched_unpin(); + } +} + +static inline void +kunmap_atomic(void *vaddr) +{ + if (!PMAP_HAS_DMAP) + kunmap(virt_to_page(vaddr)); +} + +#endif /* _LINUX_HIGHMEM_H_ */ diff --git a/sys/compat/linuxkpi/common/include/linux/mm.h b/sys/compat/linuxkpi/common/include/linux/mm.h index 4301e616f234..0ee9dd58616a 100644 --- a/sys/compat/linuxkpi/common/include/linux/mm.h +++ b/sys/compat/linuxkpi/common/include/linux/mm.h @@ -290,4 +290,8 @@ vmalloc_to_page(const void *addr) extern int is_vmalloc_addr(const void *addr); void si_meminfo(struct sysinfo *si); +#define unmap_mapping_range(...) lkpi_unmap_mapping_range(__VA_ARGS__) +void lkpi_unmap_mapping_range(void *obj, loff_t const holebegin __unused, + loff_t const holelen, int even_cows __unused); + #endif /* _LINUX_MM_H_ */ diff --git a/sys/compat/linuxkpi/common/include/linux/page.h b/sys/compat/linuxkpi/common/include/linux/page.h index c2dbab769c2a..ca7365419e22 100644 --- a/sys/compat/linuxkpi/common/include/linux/page.h +++ b/sys/compat/linuxkpi/common/include/linux/page.h @@ -41,6 +41,10 @@ #include #include +#if defined(__i386__) || defined(__amd64__) +#include +#endif + typedef unsigned long linux_pte_t; typedef unsigned long linux_pmd_t; typedef unsigned long linux_pgd_t; @@ -53,6 +57,8 @@ typedef unsigned long pgprot_t; CTASSERT((VM_PROT_ALL & -LINUXKPI_PROT_VALID) == 0); +#define PAGE_KERNEL_IO 0x0000 + static inline pgprot_t cachemode2protval(vm_memattr_t attr) { @@ -72,6 +78,7 @@ pgprot2cachemode(pgprot_t prot) #define page_to_pfn(pp) (VM_PAGE_TO_PHYS(pp) >> PAGE_SHIFT) #define pfn_to_page(pfn) (PHYS_TO_VM_PAGE((pfn) << PAGE_SHIFT)) #define nth_page(page,n) pfn_to_page(page_to_pfn(page) + (n)) +#define page_to_phys(page) VM_PAGE_TO_PHYS(page) #define clear_page(page) memset(page, 0, PAGE_SIZE) #define pgprot_noncached(prot) \ @@ -93,4 +100,19 @@ pgprot2cachemode(pgprot_t prot) #undef trunc_page #define trunc_page(x) ((uintptr_t)(x) & ~(PAGE_SIZE - 1)) +#if defined(__i386__) || defined(__amd64__) +#undef clflushopt +static inline void +lkpi_clflushopt(unsigned long addr) +{ + if (cpu_stdext_feature & CPUID_STDEXT_CLFLUSHOPT) + clflushopt(addr); + else if (cpu_feature & CPUID_CLFSH) + clflush(addr); + else + pmap_invalidate_cache(); +} +#define clflushopt(x) lkpi_clflushopt((unsigned long)(x)) +#endif + #endif /* _LINUX_PAGE_H_ */ diff --git a/sys/compat/linuxkpi/common/include/linux/scatterlist.h b/sys/compat/linuxkpi/common/include/linux/scatterlist.h index 5e42876facd0..13ee34cf9448 100644 --- a/sys/compat/linuxkpi/common/include/linux/scatterlist.h +++ b/sys/compat/linuxkpi/common/include/linux/scatterlist.h @@ -4,6 +4,7 @@ * Copyright (c) 2010 Panasas, Inc. * Copyright (c) 2013-2017 Mellanox Technologies, Ltd. * Copyright (c) 2015 Matthew Dillon + * Copyright (c) 2016 Matthew Macy * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -534,4 +535,61 @@ sg_pcopy_from_buffer(struct scatterlist *sgl, unsigned int nents, return (copied); } +static inline size_t +sg_copy_from_buffer(struct scatterlist *sgl, unsigned int nents, + const void *buf, size_t buflen) +{ + return (sg_pcopy_from_buffer(sgl, nents, buf, buflen, 0)); +} + +static inline size_t +sg_pcopy_to_buffer(struct scatterlist *sgl, unsigned int nents, + void *buf, size_t buflen, off_t offset) +{ + struct sg_page_iter iter; + struct scatterlist *sg; + struct page *page; + struct sf_buf *sf; + char *vaddr; + size_t total = 0; + size_t len; + + if (!PMAP_HAS_DMAP) + sched_pin(); + for_each_sg_page(sgl, &iter, nents, 0) { + sg = iter.sg; + + if (offset >= sg->length) { + offset -= sg->length; + continue; + } + len = ulmin(buflen, sg->length - offset); + if (len == 0) + break; + + page = sg_page_iter_page(&iter); + if (!PMAP_HAS_DMAP) { + sf = sf_buf_alloc(page, SFB_CPUPRIVATE | SFB_NOWAIT); + if (sf == NULL) + break; + vaddr = (char *)sf_buf_kva(sf); + } else + vaddr = (char *)PHYS_TO_DMAP(VM_PAGE_TO_PHYS(page)); + memcpy(buf, vaddr + sg->offset + offset, len); + if (!PMAP_HAS_DMAP) + sf_buf_free(sf); + + /* start at beginning of next page */ + offset = 0; + + /* advance buffer */ + buf = (char *)buf + len; + buflen -= len; + total += len; + } + if (!PMAP_HAS_DMAP) + sched_unpin(); + return (total); +} + #endif /* _LINUX_SCATTERLIST_H_ */ diff --git a/sys/compat/linuxkpi/common/src/linux_page.c b/sys/compat/linuxkpi/common/src/linux_page.c index c7191fef3429..8da4736ab7d5 100644 --- a/sys/compat/linuxkpi/common/src/linux_page.c +++ b/sys/compat/linuxkpi/common/src/linux_page.c @@ -334,3 +334,37 @@ retry: return (VM_FAULT_NOPAGE); } + +/* + * Although FreeBSD version of unmap_mapping_range has semantics and types of + * parameters compatible with Linux version, the values passed in are different + * @obj should match to vm_private_data field of vm_area_struct returned by + * mmap file operation handler, see linux_file_mmap_single() sources + * @holelen should match to size of area to be munmapped. + */ +void +lkpi_unmap_mapping_range(void *obj, loff_t const holebegin __unused, + loff_t const holelen, int even_cows __unused) +{ + vm_object_t devobj; + vm_page_t page; + int i, page_count; + + devobj = cdev_pager_lookup(obj); + if (devobj != NULL) { + page_count = OFF_TO_IDX(holelen); + + VM_OBJECT_WLOCK(devobj); +retry: + for (i = 0; i < page_count; i++) { + page = vm_page_lookup(devobj, i); + if (page == NULL) + continue; + if (!vm_page_busy_acquire(page, VM_ALLOC_WAITFAIL)) + goto retry; + cdev_pager_free_page(devobj, page); + } + VM_OBJECT_WUNLOCK(devobj); + vm_object_deallocate(devobj); + } +} From owner-dev-commits-src-main@freebsd.org Wed Sep 29 20:27:45 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 25EAD67B585; Wed, 29 Sep 2021 20:27:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HKSc0735pz4pmL; Wed, 29 Sep 2021 20:27:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BAEE51EE80; Wed, 29 Sep 2021 20:27:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18TKRi6N038778; Wed, 29 Sep 2021 20:27:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18TKRivY038777; Wed, 29 Sep 2021 20:27:44 GMT (envelope-from git) Date: Wed, 29 Sep 2021 20:27:44 GMT Message-Id: <202109292027.18TKRivY038777@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Vladimir Kondratyev Subject: git: b52e36384091 - main - LinuxKPI: Implement backlight_enable and backlight_disable functions MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: wulf X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b52e36384091c5f80b06b79f5889492eac074426 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Sep 2021 20:27:45 -0000 The branch main has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=b52e36384091c5f80b06b79f5889492eac074426 commit b52e36384091c5f80b06b79f5889492eac074426 Author: Vladimir Kondratyev AuthorDate: 2021-09-29 20:15:12 +0000 Commit: Vladimir Kondratyev CommitDate: 2021-09-29 20:15:12 +0000 LinuxKPI: Implement backlight_enable and backlight_disable functions For now, disable backlight if brightness level is set to 0. In the future we may implement separate knob in backlight(8). Required by drm-kmod v5.6 Reviewed by: hselasky, manu MFC after: 2 weeks Differential revision: https://reviews.freebsd.org/D32165 --- .../linuxkpi/common/include/linux/backlight.h | 22 ++++++++++++++++++++-- sys/compat/linuxkpi/common/src/linux_pci.c | 2 ++ 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/sys/compat/linuxkpi/common/include/linux/backlight.h b/sys/compat/linuxkpi/common/include/linux/backlight.h index 1d2224811124..b3a07c4cdcaa 100644 --- a/sys/compat/linuxkpi/common/include/linux/backlight.h +++ b/sys/compat/linuxkpi/common/include/linux/backlight.h @@ -79,10 +79,10 @@ void linux_backlight_device_unregister(struct backlight_device *bd); linux_backlight_device_register(name, dev, data, ops, props) #define backlight_device_unregister(bd) linux_backlight_device_unregister(bd) -static inline void +static inline int backlight_update_status(struct backlight_device *bd) { - bd->ops->update_status(bd); + return (bd->ops->update_status(bd)); } static inline void @@ -91,4 +91,22 @@ backlight_force_update(struct backlight_device *bd, int reason) bd->props.brightness = bd->ops->get_brightness(bd); } +static inline int +backlight_enable(struct backlight_device *bd) +{ + if (bd == NULL) + return (0); + bd->props.power = 0/* FB_BLANK_UNBLANK */; + return (backlight_update_status(bd)); +} + +static inline int +backlight_disable(struct backlight_device *bd) +{ + if (bd == NULL) + return (0); + bd->props.power = 4/* FB_BLANK_POWERDOWN */; + return (backlight_update_status(bd)); +} + #endif /* _LINUX_BACKLIGHT_H_ */ diff --git a/sys/compat/linuxkpi/common/src/linux_pci.c b/sys/compat/linuxkpi/common/src/linux_pci.c index 73c9b67bbedb..44ed4b22de6f 100644 --- a/sys/compat/linuxkpi/common/src/linux_pci.c +++ b/sys/compat/linuxkpi/common/src/linux_pci.c @@ -1215,6 +1215,8 @@ linux_backlight_update_status(device_t dev, struct backlight_props *props) pdev->dev.bd->props.brightness = pdev->dev.bd->props.max_brightness * props->brightness / 100; + pdev->dev.bd->props.power = props->brightness == 0 ? + 4/* FB_BLANK_POWERDOWN */ : 0/* FB_BLANK_UNBLANK */; return (pdev->dev.bd->ops->update_status(pdev->dev.bd)); } From owner-dev-commits-src-main@freebsd.org Wed Sep 29 20:27:37 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 37C0267B076; Wed, 29 Sep 2021 20:27:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HKSbs0LWpz4pq2; Wed, 29 Sep 2021 20:27:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B5D161EE05; Wed, 29 Sep 2021 20:27:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18TKRaLN038598; Wed, 29 Sep 2021 20:27:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18TKRaRQ038597; Wed, 29 Sep 2021 20:27:36 GMT (envelope-from git) Date: Wed, 29 Sep 2021 20:27:36 GMT Message-Id: <202109292027.18TKRaRQ038597@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Vladimir Kondratyev Subject: git: f6823dac8fa6 - main - LinuxKPI: Factor out vmf_insert_pfn_prot() routine MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: wulf X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f6823dac8fa6e9fc2926a866e9a0c4d43e38e236 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Sep 2021 20:27:37 -0000 The branch main has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=f6823dac8fa6e9fc2926a866e9a0c4d43e38e236 commit f6823dac8fa6e9fc2926a866e9a0c4d43e38e236 Author: Vladimir Kondratyev AuthorDate: 2021-09-29 20:13:41 +0000 Commit: Vladimir Kondratyev CommitDate: 2021-09-29 20:13:41 +0000 LinuxKPI: Factor out vmf_insert_pfn_prot() routine from GEM and TTM page fault handlers and move it in to base system. This code is tightly integrated with LKPI mmap support to belong to drm-kmod. As this routine requires associated vm_object to be locked, it got additional _locked suffix. Reviewed by: hselasky, markj MFC after: 2 weeks Differential revision: https://reviews.freebsd.org/D32068 --- sys/compat/linuxkpi/common/include/linux/mm.h | 23 +++++++++++++++++++ sys/compat/linuxkpi/common/src/linux_page.c | 32 +++++++++++++++++++++++++++ 2 files changed, 55 insertions(+) diff --git a/sys/compat/linuxkpi/common/include/linux/mm.h b/sys/compat/linuxkpi/common/include/linux/mm.h index 74709299ba1a..dc75ae4483c3 100644 --- a/sys/compat/linuxkpi/common/include/linux/mm.h +++ b/sys/compat/linuxkpi/common/include/linux/mm.h @@ -82,6 +82,9 @@ CTASSERT((VM_PROT_ALL & -(1 << 8)) == 0); #define VM_FAULT_RETRY (1 << 9) #define VM_FAULT_FALLBACK (1 << 10) +#define VM_FAULT_ERROR (VM_FAULT_OOM | VM_FAULT_SIGBUS | VM_FAULT_SIGSEGV | \ + VM_FAULT_HWPOISON |VM_FAULT_HWPOISON_LARGE | VM_FAULT_FALLBACK) + #define FAULT_FLAG_WRITE (1 << 0) #define FAULT_FLAG_MKWRITE (1 << 1) #define FAULT_FLAG_ALLOW_RETRY (1 << 2) @@ -183,6 +186,26 @@ io_remap_pfn_range(struct vm_area_struct *vma, return (0); } +vm_fault_t +lkpi_vmf_insert_pfn_prot_locked(struct vm_area_struct *vma, unsigned long addr, + unsigned long pfn, pgprot_t prot); + +static inline vm_fault_t +vmf_insert_pfn_prot(struct vm_area_struct *vma, unsigned long addr, + unsigned long pfn, pgprot_t prot) +{ + vm_fault_t ret; + + VM_OBJECT_WLOCK(vma->vm_obj); + ret = lkpi_vmf_insert_pfn_prot_locked(vma, addr, pfn, prot); + VM_OBJECT_WUNLOCK(vma->vm_obj); + + return (ret); +} +#define vmf_insert_pfn_prot(...) \ + _Static_assert(false, \ +"This function is always called in a loop. Consider using the locked version") + static inline int apply_to_page_range(struct mm_struct *mm, unsigned long address, unsigned long size, pte_fn_t fn, void *data) diff --git a/sys/compat/linuxkpi/common/src/linux_page.c b/sys/compat/linuxkpi/common/src/linux_page.c index ee41366c53a6..cbe6d2530b91 100644 --- a/sys/compat/linuxkpi/common/src/linux_page.c +++ b/sys/compat/linuxkpi/common/src/linux_page.c @@ -275,3 +275,35 @@ is_vmalloc_addr(const void *addr) { return (vtoslab((vm_offset_t)addr & ~UMA_SLAB_MASK) != NULL); } + +vm_fault_t +lkpi_vmf_insert_pfn_prot_locked(struct vm_area_struct *vma, unsigned long addr, + unsigned long pfn, pgprot_t prot) +{ + vm_object_t vm_obj = vma->vm_obj; + vm_page_t page; + vm_pindex_t pindex; + + VM_OBJECT_ASSERT_WLOCKED(vm_obj); + pindex = OFF_TO_IDX(addr - vma->vm_start); + if (vma->vm_pfn_count == 0) + vma->vm_pfn_first = pindex; + MPASS(pindex <= OFF_TO_IDX(vma->vm_end)); + +retry: + page = vm_page_grab(vm_obj, pindex, VM_ALLOC_NOCREAT); + if (page == NULL) { + page = PHYS_TO_VM_PAGE(IDX_TO_OFF(pfn)); + if (!vm_page_busy_acquire(page, VM_ALLOC_WAITFAIL)) + goto retry; + if (vm_page_insert(page, vm_obj, pindex)) { + vm_page_xunbusy(page); + return (VM_FAULT_OOM); + } + vm_page_valid(page); + } + pmap_page_set_memattr(page, pgprot2cachemode(prot)); + vma->vm_pfn_count++; + + return (VM_FAULT_NOPAGE); +} From owner-dev-commits-src-main@freebsd.org Wed Sep 29 20:27:42 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id EE28F67B580; Wed, 29 Sep 2021 20:27:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HKSby4ZJCz4q9q; Wed, 29 Sep 2021 20:27:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6F3841ED87; Wed, 29 Sep 2021 20:27:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18TKRguf038724; Wed, 29 Sep 2021 20:27:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18TKRgwq038723; Wed, 29 Sep 2021 20:27:42 GMT (envelope-from git) Date: Wed, 29 Sep 2021 20:27:42 GMT Message-Id: <202109292027.18TKRgwq038723@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Vladimir Kondratyev Subject: git: 37eba5b77a57 - main - LinuxKPI: Cast offset_in_page() parameter to unsigned long MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: wulf X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 37eba5b77a5733ac711b119141619c89b8446471 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Sep 2021 20:27:43 -0000 The branch main has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=37eba5b77a5733ac711b119141619c89b8446471 commit 37eba5b77a5733ac711b119141619c89b8446471 Author: Vladimir Kondratyev AuthorDate: 2021-09-29 20:14:47 +0000 Commit: Vladimir Kondratyev CommitDate: 2021-09-29 20:14:47 +0000 LinuxKPI: Cast offset_in_page() parameter to unsigned long to reduce number of patches in drm-kmod Reviewed by: hselasky MFC after: 2 weeks Differential revision: https://reviews.freebsd.org/D32093 --- sys/compat/linuxkpi/common/include/linux/mm.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/compat/linuxkpi/common/include/linux/mm.h b/sys/compat/linuxkpi/common/include/linux/mm.h index dc75ae4483c3..871d16cb06ff 100644 --- a/sys/compat/linuxkpi/common/include/linux/mm.h +++ b/sys/compat/linuxkpi/common/include/linux/mm.h @@ -229,7 +229,7 @@ vma_pages(struct vm_area_struct *vma) return ((vma->vm_end - vma->vm_start) >> PAGE_SHIFT); } -#define offset_in_page(off) ((off) & (PAGE_SIZE - 1)) +#define offset_in_page(off) ((unsigned long)(off) & (PAGE_SIZE - 1)) static inline void set_page_dirty(struct vm_page *page) From owner-dev-commits-src-main@freebsd.org Wed Sep 29 20:27:50 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0EA3667B511; Wed, 29 Sep 2021 20:27:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HKSc55F2zz4pmR; Wed, 29 Sep 2021 20:27:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 50B641EC10; Wed, 29 Sep 2021 20:27:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18TKRncL038880; Wed, 29 Sep 2021 20:27:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18TKRn36038879; Wed, 29 Sep 2021 20:27:49 GMT (envelope-from git) Date: Wed, 29 Sep 2021 20:27:49 GMT Message-Id: <202109292027.18TKRn36038879@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Vladimir Kondratyev Subject: git: 062f15004f4e - main - LinuxKPI: Remove vma argument from fault method of vm_operations_struct MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: wulf X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 062f15004f4e92cd984bf59ec95c189a9d998013 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Sep 2021 20:27:50 -0000 The branch main has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=062f15004f4e92cd984bf59ec95c189a9d998013 commit 062f15004f4e92cd984bf59ec95c189a9d998013 Author: Vladimir Kondratyev AuthorDate: 2021-09-29 20:26:32 +0000 Commit: Vladimir Kondratyev CommitDate: 2021-09-29 20:26:32 +0000 LinuxKPI: Remove vma argument from fault method of vm_operations_struct It is removed from Linux since 4.11. In FreeBSD it results in several #ifdefs in drm-kmod. Reviewed by: emaste, hselasky, manu Differential revision: https://reviews.freebsd.org/D32169 --- sys/compat/linuxkpi/common/include/linux/mm.h | 2 +- sys/compat/linuxkpi/common/src/linux_compat.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/compat/linuxkpi/common/include/linux/mm.h b/sys/compat/linuxkpi/common/include/linux/mm.h index 0ee9dd58616a..ec88f39ac410 100644 --- a/sys/compat/linuxkpi/common/include/linux/mm.h +++ b/sys/compat/linuxkpi/common/include/linux/mm.h @@ -137,7 +137,7 @@ struct vm_fault { struct vm_operations_struct { void (*open) (struct vm_area_struct *); void (*close) (struct vm_area_struct *); - int (*fault) (struct vm_area_struct *, struct vm_fault *); + int (*fault) (struct vm_fault *); int (*access) (struct vm_area_struct *, unsigned long, void *, int, int); }; diff --git a/sys/compat/linuxkpi/common/src/linux_compat.c b/sys/compat/linuxkpi/common/src/linux_compat.c index 103d7ab0c60b..279f7131fc57 100644 --- a/sys/compat/linuxkpi/common/src/linux_compat.c +++ b/sys/compat/linuxkpi/common/src/linux_compat.c @@ -560,11 +560,11 @@ linux_cdev_pager_populate(vm_object_t vm_obj, vm_pindex_t pidx, int fault_type, vmap->vm_pfn_pcount = &vmap->vm_pfn_count; vmap->vm_obj = vm_obj; - err = vmap->vm_ops->fault(vmap, &vmf); + err = vmap->vm_ops->fault(&vmf); while (vmap->vm_pfn_count == 0 && err == VM_FAULT_NOPAGE) { kern_yield(PRI_USER); - err = vmap->vm_ops->fault(vmap, &vmf); + err = vmap->vm_ops->fault(&vmf); } } From owner-dev-commits-src-main@freebsd.org Wed Sep 29 20:27:51 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 53BDE67B41D; Wed, 29 Sep 2021 20:27:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HKSc66CxVz4qBH; Wed, 29 Sep 2021 20:27:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7A4711EAB9; Wed, 29 Sep 2021 20:27:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18TKRohX038904; Wed, 29 Sep 2021 20:27:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18TKRoDm038903; Wed, 29 Sep 2021 20:27:50 GMT (envelope-from git) Date: Wed, 29 Sep 2021 20:27:50 GMT Message-Id: <202109292027.18TKRoDm038903@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Vladimir Kondratyev Subject: git: 30acf99a822c - main - Bump __FreeBSD_version to 1400034 for LinuxKPI changes MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: wulf X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 30acf99a822c81f0d8218d966d7f6c51edd9a6d9 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Sep 2021 20:27:51 -0000 The branch main has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=30acf99a822c81f0d8218d966d7f6c51edd9a6d9 commit 30acf99a822c81f0d8218d966d7f6c51edd9a6d9 Author: Vladimir Kondratyev AuthorDate: 2021-09-29 20:26:46 +0000 Commit: Vladimir Kondratyev CommitDate: 2021-09-29 20:26:46 +0000 Bump __FreeBSD_version to 1400034 for LinuxKPI changes --- sys/sys/param.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/sys/param.h b/sys/sys/param.h index be1488b9011a..234111e5d53c 100644 --- a/sys/sys/param.h +++ b/sys/sys/param.h @@ -76,7 +76,7 @@ * cannot include sys/param.h and should only be updated here. */ #undef __FreeBSD_version -#define __FreeBSD_version 1400033 +#define __FreeBSD_version 1400034 /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-dev-commits-src-main@freebsd.org Wed Sep 29 20:27:44 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0298667B584; Wed, 29 Sep 2021 20:27:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HKSbz5h5xz4q9r; Wed, 29 Sep 2021 20:27:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9698A1EE08; Wed, 29 Sep 2021 20:27:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18TKRhIT038754; Wed, 29 Sep 2021 20:27:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18TKRhro038753; Wed, 29 Sep 2021 20:27:43 GMT (envelope-from git) Date: Wed, 29 Sep 2021 20:27:43 GMT Message-Id: <202109292027.18TKRhro038753@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Vladimir Kondratyev Subject: git: 3d86f8f1d7d1 - main - LinuxKPI: Add dummy pgprot_decrypted() implementation MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: wulf X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3d86f8f1d7d1a070dd2e81367a4196a272b3bd07 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Sep 2021 20:27:44 -0000 The branch main has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=3d86f8f1d7d1a070dd2e81367a4196a272b3bd07 commit 3d86f8f1d7d1a070dd2e81367a4196a272b3bd07 Author: Vladimir Kondratyev AuthorDate: 2021-09-29 20:14:58 +0000 Commit: Vladimir Kondratyev CommitDate: 2021-09-29 20:14:58 +0000 LinuxKPI: Add dummy pgprot_decrypted() implementation to reduce number of #ifdefs in drm-kmod Reviewed by: hselasky MFC after: 2 weeks Differential revision: https://reviews.freebsd.org/D32094 --- sys/compat/linuxkpi/common/include/asm/pgtable.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/compat/linuxkpi/common/include/asm/pgtable.h b/sys/compat/linuxkpi/common/include/asm/pgtable.h index 1df103060368..4831c144888d 100644 --- a/sys/compat/linuxkpi/common/include/asm/pgtable.h +++ b/sys/compat/linuxkpi/common/include/asm/pgtable.h @@ -40,4 +40,6 @@ typedef unsigned long pgdval_t; typedef unsigned long pgprotval_t; typedef struct page *pgtable_t; +#define pgprot_decrypted(prot) (prot) + #endif /* _ASM_PGTABLE_H_ */ From owner-dev-commits-src-main@freebsd.org Wed Sep 29 20:27:48 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BD6F167B41B; Wed, 29 Sep 2021 20:27:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HKSc43WJ8z4qDg; Wed, 29 Sep 2021 20:27:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2BF141EC0F; Wed, 29 Sep 2021 20:27:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18TKRmtk038850; Wed, 29 Sep 2021 20:27:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18TKRmNY038849; Wed, 29 Sep 2021 20:27:48 GMT (envelope-from git) Date: Wed, 29 Sep 2021 20:27:48 GMT Message-Id: <202109292027.18TKRmNY038849@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Vladimir Kondratyev Subject: git: 5ca1f3f5e3a3 - main - LinuxKPI: Hide some internal symbols in linux_interrupt.c MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: wulf X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5ca1f3f5e3a322ddb598295825bdc1d831ba71d5 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Sep 2021 20:27:48 -0000 The branch main has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=5ca1f3f5e3a322ddb598295825bdc1d831ba71d5 commit 5ca1f3f5e3a322ddb598295825bdc1d831ba71d5 Author: Vladimir Kondratyev AuthorDate: 2021-09-29 20:26:14 +0000 Commit: Vladimir Kondratyev CommitDate: 2021-09-29 20:26:14 +0000 LinuxKPI: Hide some internal symbols in linux_interrupt.c Reviewed by: hselasky, manu Differential revision: https://reviews.freebsd.org/D32168 --- sys/compat/linuxkpi/common/include/linux/interrupt.h | 5 ----- sys/compat/linuxkpi/common/src/linux_interrupt.c | 12 ++++++------ 2 files changed, 6 insertions(+), 11 deletions(-) diff --git a/sys/compat/linuxkpi/common/include/linux/interrupt.h b/sys/compat/linuxkpi/common/include/linux/interrupt.h index 4e6c859853a7..964b95edb43f 100644 --- a/sys/compat/linuxkpi/common/include/linux/interrupt.h +++ b/sys/compat/linuxkpi/common/include/linux/interrupt.h @@ -44,11 +44,6 @@ typedef irqreturn_t (*irq_handler_t)(int, void *); #define IRQF_SHARED RF_SHAREABLE -struct irq_ent; - -void linux_irq_handler(void *); -void lkpi_devm_irq_release(struct device *, void *); -void lkpi_irq_release(struct device *, struct irq_ent *); int lkpi_request_irq(struct device *, unsigned int, irq_handler_t, irq_handler_t, unsigned long, const char *, void *); int lkpi_enable_irq(unsigned int); diff --git a/sys/compat/linuxkpi/common/src/linux_interrupt.c b/sys/compat/linuxkpi/common/src/linux_interrupt.c index cc6380553497..f96a47137fab 100644 --- a/sys/compat/linuxkpi/common/src/linux_interrupt.c +++ b/sys/compat/linuxkpi/common/src/linux_interrupt.c @@ -71,8 +71,8 @@ lkpi_irq_ent(struct device *dev, unsigned int irq) return (NULL); } -void -linux_irq_handler(void *ent) +static void +lkpi_irq_handler(void *ent) { struct irq_ent *irqe; @@ -88,7 +88,7 @@ linux_irq_handler(void *ent) } } -void +static inline void lkpi_irq_release(struct device *dev, struct irq_ent *irqe) { if (irqe->tag != NULL) @@ -99,7 +99,7 @@ lkpi_irq_release(struct device *dev, struct irq_ent *irqe) list_del(&irqe->links); } -void +static void lkpi_devm_irq_release(struct device *dev, void *p) { struct irq_ent *irqe; @@ -145,7 +145,7 @@ lkpi_request_irq(struct device *xdev, unsigned int irq, irqe->irq = irq; error = bus_setup_intr(dev->bsddev, res, INTR_TYPE_NET | INTR_MPSAFE, - NULL, linux_irq_handler, irqe, &irqe->tag); + NULL, lkpi_irq_handler, irqe, &irqe->tag); if (error) goto errout; list_add(&irqe->links, &dev->irqents); @@ -176,7 +176,7 @@ lkpi_enable_irq(unsigned int irq) if (irqe == NULL || irqe->tag != NULL) return -EINVAL; return -bus_setup_intr(dev->bsddev, irqe->res, INTR_TYPE_NET | INTR_MPSAFE, - NULL, linux_irq_handler, irqe, &irqe->tag); + NULL, lkpi_irq_handler, irqe, &irqe->tag); } void From owner-dev-commits-src-main@freebsd.org Wed Sep 29 21:11:26 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9594467C71C; Wed, 29 Sep 2021 21:11:26 +0000 (UTC) (envelope-from debdrup@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HKTZQ3CRmz4tBR; Wed, 29 Sep 2021 21:11:26 +0000 (UTC) (envelope-from debdrup@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1632949886; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=OccRYh60Th9f2x9VyXzLVjgEM++6trMn3n8rb51yuqE=; b=RUTuV4KEXaTki6CRkRPi9hLMLpfrQDzBvLFZ/mdvUZua6LO/lJzkWVuvdW/LBqTi6EL1bZ Jh35M6wQZ1fDJLErFgN2kH57Cuoc7SmKTnIpQZtuPSJtxGs6ewaX6Wi4en+XfaZdxT/hbx 8kW/MUJo2IssdJp0erllc6ZR7IgBr8BR8ECOW72bXmwdYyAllaxxCZz2CrfLTQJ17b2/3h /+BQ4OM+Wm22MN5/qNvtrNV5u7E7AtiPLS2LVzJRce9QdVeLABMWmmVsO9lZ1Po/y+mZlR UMePFFAFO7aOBaU8c1TYOhJ5YjdbedDZEMI8rHsGn+fe9szHpUghX4ewXVxQkQ== Received: by freefall.freebsd.org (Postfix, from userid 1471) id 5A24413A2B; Wed, 29 Sep 2021 21:11:26 +0000 (UTC) Date: Wed, 29 Sep 2021 23:11:24 +0200 From: Daniel Ebdrup Jensen To: dev-commits-src-main@freebsd.org, dev-commits-src-all@FreeBSD.org Subject: Re: git: 8d546b6832ee - main - cmp: add -i, --ignore-initial, an alternative to skip1/skip2 args Message-ID: <20210929211124.gpssnyprk3f4unay@nerd-thinkpad.local> Mail-Followup-To: Daniel Ebdrup Jensen , dev-commits-src-main@freebsd.org, dev-commits-src-all@FreeBSD.org References: <202109291805.18TI57H8049974@gitrepo.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="bklmzyyzej3laxfj" Content-Disposition: inline In-Reply-To: <202109291805.18TI57H8049974@gitrepo.freebsd.org> ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1632949886; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=OccRYh60Th9f2x9VyXzLVjgEM++6trMn3n8rb51yuqE=; b=ObFR81F9L+q9HSHMMbxx/WJf0+7juNL8VDHATzGP4TcZoyhmflqE8y/jWs6Nn1sEC36jNk Q5KZSpN0XY27Mm1XdAw7TuByDjei1Ck28aweQX+XgftZ8chkGeFTJfRWOldN4fvlwqZJ9I wQ9Y4T2J3eux7BBN26cLURgICO8bFaRzzfEwkyRD1mY3fe/z8VxOF/90fWx6AJBmg8t6pg cRYhV4YRRBnFKNSlLjdxV2HQlNFlmdABuJU9tLKGwWn+xzQixffGfQO7uvRCMupT4C5rnu +NK8jwVNlNhKI4WFVTm/BuUtdFF1vcH2o2oiw+q+XggVUpKHu3ImTwz4YW+CgQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1632949886; a=rsa-sha256; cv=none; b=Int7mNL4JE9XNRelLv+zLtPRKyR3hfCHa6OSATVcQQxnPBc/Z2My9YUgHz+j8Z2OxvBfIX wQ1mmPFbLYwL5L7a/KdnmZECLz3SG9/zzL+FbiHUd83i0PIBsUt3Fw5KQpv5ANT9qKZEnL UDaL2usK2+MmvFX2D8rqxJRtXjmxwry+fpb6OJG1Et2TqdX2Mw/ZVaJst85UXDYPIwRkO8 CPbnEfCNiEpxq/3+9Yqv94qwe7NO0FbHTATWDeHp3B+JgWWIiKzTaBLv0r+xGqJ34pSnaO LiInQdc4XrcCIiknUfjJhYZQZhu1U5AI9YhuapYAtCg6AWRhxF/0Ed7f15QQjw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Sep 2021 21:11:26 -0000 --bklmzyyzej3laxfj Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline On Wed, Sep 29, 2021 at 06:05:07PM +0000, Kyle Evans wrote: >The branch main has been updated by kevans: > >URL: https://cgit.FreeBSD.org/src/commit/?id=8d546b6832eea031f95f30eaec3232ec1256a281 > >commit 8d546b6832eea031f95f30eaec3232ec1256a281 >Author: Kyle Evans >AuthorDate: 2021-09-23 05:43:32 +0000 >Commit: Kyle Evans >CommitDate: 2021-09-29 18:03:34 +0000 > > cmp: add -i, --ignore-initial, an alternative to skip1/skip2 args > > This is compatible with GNU cmp. > > Reviewed by: markj > Sponsored by: Klara, Inc. > Differential Revision: https://reviews.freebsd.org/D32073 >--- > usr.bin/cmp/cmp.1 | 19 +++++++++++++++++++ > usr.bin/cmp/cmp.c | 30 +++++++++++++++++++++++++++++- > usr.bin/cmp/tests/cmp_test2.sh | 5 +++++ > 3 files changed, 53 insertions(+), 1 deletion(-) > >diff --git a/usr.bin/cmp/cmp.1 b/usr.bin/cmp/cmp.1 >index 511e09ac8628..5a56802bd22e 100644 >--- a/usr.bin/cmp/cmp.1 >+++ b/usr.bin/cmp/cmp.1 >@@ -41,6 +41,7 @@ [SNIP] Hi Kyle, You forgot a .Dd bump here :) Yours, Daniel Ebdrup Jensen --bklmzyyzej3laxfj Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQGTBAABCgB9FiEEDonNJPbg/JLIMoS6Ps5hSHzN87oFAmFU1nxfFIAAAAAALgAo aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldDBF ODlDRDI0RjZFMEZDOTJDODMyODRCQTNFQ0U2MTQ4N0NDREYzQkEACgkQPs5hSHzN 87obbwf/WM0fixuTYAHfBGQpygfnZOpW3XzrPIYMU+zfwqvbyPzjtzULQjtwSfmz QERHrYm2IgFZ646V+FQJD1aGyZ2M/rY6qF7NNPS1qLIHrSAFCNZXU4w2yvIOTGFF XRqhZ8CllJHr7e6rsOZkPDgjqLlR9uIdUSdVZqk8lVxsn+58IEel2reGlN020/WF 7xaM6IBc3RFhpDag47AD45+4BqBAHZuuOMFCjCl0qEkpbf9J/kXxve0MtQ2VqF/E vap4fP9XJIJYsvbigq7ShvSaLyLG8GdM7OpfGwhd78rxAS2WtHmTbrLjJQtP6ZeA e+RhUizuBIDBwgi28QtIzvz7dKv/Dw== =OXLf -----END PGP SIGNATURE----- --bklmzyyzej3laxfj-- From owner-dev-commits-src-main@freebsd.org Wed Sep 29 23:19:54 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 326B967D5EF; Wed, 29 Sep 2021 23:19:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HKXQf0gZgz3Hfm; Wed, 29 Sep 2021 23:19:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E8928208F7; Wed, 29 Sep 2021 23:19:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18TNJrjt066301; Wed, 29 Sep 2021 23:19:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18TNJrsn066300; Wed, 29 Sep 2021 23:19:53 GMT (envelope-from git) Date: Wed, 29 Sep 2021 23:19:53 GMT Message-Id: <202109292319.18TNJrsn066300@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 9aa29457d55e - main - loader_lua.8: Fix first version MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9aa29457d55e4c9c4eac72785886eff756fef22c Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Sep 2021 23:19:54 -0000 The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=9aa29457d55e4c9c4eac72785886eff756fef22c commit 9aa29457d55e4c9c4eac72785886eff756fef22c Author: Warner Losh AuthorDate: 2021-09-29 23:14:14 +0000 Commit: Warner Losh CommitDate: 2021-09-29 23:18:51 +0000 loader_lua.8: Fix first version Lua bindings appeared in FreeBSD 12.0. Delete the authors section of the man page, since it's unclear who wrote different parts of the man page. Noted by: Trond Endrestol Sponsored by: Netflix --- stand/man/loader_lua.8 | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/stand/man/loader_lua.8 b/stand/man/loader_lua.8 index 876f75676fc0..32085748bf1c 100644 --- a/stand/man/loader_lua.8 +++ b/stand/man/loader_lua.8 @@ -264,14 +264,4 @@ Unspecified error. The .Nm first appeared in -.Fx 3.1 . -.Sh AUTHORS -.An -nosplit -The -.Nm -was written by -.An Michael Smith Aq msmith@FreeBSD.org . -.Pp -.Tn FICL -was written by -.An John Sadler Aq john_sadler@alum.mit.edu . +.Fx 12.0 . From owner-dev-commits-src-main@freebsd.org Wed Sep 29 23:26:30 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D54BF67E199 for ; Wed, 29 Sep 2021 23:26:30 +0000 (UTC) (envelope-from mw@semihalf.com) Received: from mail-yb1-xb36.google.com (mail-yb1-xb36.google.com [IPv6:2607:f8b0:4864:20::b36]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HKXZG592Zz3HxW for ; Wed, 29 Sep 2021 23:26:30 +0000 (UTC) (envelope-from mw@semihalf.com) Received: by mail-yb1-xb36.google.com with SMTP id h2so8982857ybi.13 for ; Wed, 29 Sep 2021 16:26:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=semihalf-com.20210112.gappssmtp.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=nMnD6dEREN8xivG89DdbcMwkrwTf9d5qac7IR2fILao=; b=5urjGPcH3LFXOv1k8YDh+/2RwDf+r4G/raJwfI4snin8bQlWOLn5FFsXvk8M2Kh3PH M5gl0M2SLbaDLVrFGrrECTtCK/qPXZOMcmmSewMC68IwFyBYW3WyBqOKJSSPDAEK7+Tz J0iREnHwE244zAAye0SEEkLarf2P1QWpsN32GB9m9+XQGO9YDNjzhapf8XrXzPA5WZBT ONAEV03aJ1M9EDZguXkgwZqk/xjRMoWeUnCWVdZPJF21XVr6+PhPraF7cL9FnyiVa+HE hnbMamzqqYhqaPLqPVzCwfHWqLR7NS8yRyLStIxhzMjjKQ8jqlJEPtRIAqZGO6jOka+z m2Aw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=nMnD6dEREN8xivG89DdbcMwkrwTf9d5qac7IR2fILao=; b=KVDevLnorNXysyRZ4kRYWKXrgFkTMO7a60TkIWqKVraGXNrUW1lkLXrPs+VFAc+poO FtzRKMIBi1kXDt/BJ4BiFFSD01TuBvuSRqkZf/d65y90JVBuRyY+5M+i7z8LLy5qh+47 PgFOqogNQvbHKRcam8LLd4Kx1xfRH1vpgu763BVYsXP0XG5rMJNPnhsVLpEFVTGLBEC0 1UXtG2XX7bYBikJFv8UHiMVtFqmyDsqIH6eLOS7qocY30Zz5DcT+bkSmUO2vil5uP+Oa Ac1Qs5s2CzXZB7tb4Y2lAUbR4PjZkX/mhvOyJePyIWNBCqQmMMfXseouuZEaG38y1JO0 uE2w== X-Gm-Message-State: AOAM5305fINbi/adz80ntoQB698VqJQMZLdEClZbnrYDOP2NpffODbrN rYegeow0hEcDqFn9qZTTtavJGzzTuwQTLhsVafi7gA== X-Google-Smtp-Source: ABdhPJxDdAuFHndukuTAua/J+zgdhgX3j2gSybNsRTEG5qiGAJnAomtwCf48MYcmxrsR7VPvIuJFl99j2wrW6empsHo= X-Received: by 2002:a05:6902:1021:: with SMTP id x1mr3310889ybt.544.1632957989991; Wed, 29 Sep 2021 16:26:29 -0700 (PDT) MIME-Version: 1.0 References: <202109281243.18SChldh001988@gitrepo.freebsd.org> <66731C91-BAE9-4D5D-B7DE-F1D7AA94395D@fubar.geek.nz> In-Reply-To: <66731C91-BAE9-4D5D-B7DE-F1D7AA94395D@fubar.geek.nz> From: Marcin Wojtas Date: Thu, 30 Sep 2021 01:26:20 +0200 Message-ID: Subject: Re: git: f3aa0098a82e - main - Use mtx_lock_spin in the gic driver To: Andrew Turner Cc: Andrew Turner , src-committers , dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: 4HKXZG592Zz3HxW X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Sep 2021 23:26:30 -0000 =C5=9Br., 29 wrz 2021 o 17:42 Andrew Turner napisa= =C5=82(a): > > > > > On 28 Sep 2021, at 16:36, Marcin Wojtas wrote: > > > > Hi Andrew, > > > > wt., 28 wrz 2021 o 14:43 Andrew Turner napisa=C5= =82(a): > >> > >> The branch main has been updated by andrew: > >> > >> URL: https://cgit.FreeBSD.org/src/commit/?id=3Df3aa0098a82ebf7712aa137= 16d794aa7e4ac59cd > >> > >> commit f3aa0098a82ebf7712aa13716d794aa7e4ac59cd > >> Author: Andrew Turner > >> AuthorDate: 2021-09-28 11:36:42 +0000 > >> Commit: Andrew Turner > >> CommitDate: 2021-09-28 11:42:06 +0000 > >> > >> Use mtx_lock_spin in the gic driver > >> > >> The mutex was changed to a spin lock when the MSI/MSI-X handling wa= s > >> moved from the gicv2m to the gic driver. Update the calls to lock > >> and unlock the mutex to the spin variant. > >> > >> Submitted by: jrtc27 ("Change all the mtx_(un)lock(&sc->mutex) to= be the _spin versions.") > >> Reported by: mw, antranigv@freebsd.am > >> Sponsored by: The FreeBSD Foundation > >> --- > >> sys/arm/arm/gic.c | 20 ++++++++++---------- > >> 1 file changed, 10 insertions(+), 10 deletions(-) > >> > >> diff --git a/sys/arm/arm/gic.c b/sys/arm/arm/gic.c > >> index d7edd7885404..89db4e324600 100644 > >> --- a/sys/arm/arm/gic.c > >> +++ b/sys/arm/arm/gic.c > >> @@ -1056,7 +1056,7 @@ arm_gic_alloc_msi(device_t dev, device_t child, = int count, int maxcount, > >> > >> sc =3D device_get_softc(dev); > >> > >> - mtx_lock(&sc->mutex); > >> + mtx_lock_spin(&sc->mutex); > >> > >> found =3D false; > >> for (irq =3D sc->sc_spi_start; irq < sc->sc_spi_end; irq++) { > >> @@ -1091,7 +1091,7 @@ arm_gic_alloc_msi(device_t dev, device_t child, = int count, int maxcount, > >> > >> /* Not enough interrupts were found */ > >> if (!found || irq =3D=3D sc->sc_spi_end) { > >> - mtx_unlock(&sc->mutex); > >> + mtx_unlock_spin(&sc->mutex); > >> return (ENXIO); > >> } > >> > >> @@ -1099,7 +1099,7 @@ arm_gic_alloc_msi(device_t dev, device_t child, = int count, int maxcount, > >> /* Mark the interrupt as used */ > >> sc->gic_irqs[irq + i].gi_flags |=3D GI_FLAG_MSI_USED; > >> } > >> - mtx_unlock(&sc->mutex); > >> + mtx_unlock_spin(&sc->mutex); > >> > >> for (i =3D 0; i < count; i++) > >> srcs[i] =3D (struct intr_irqsrc *)&sc->gic_irqs[irq + i= ]; > >> @@ -1118,7 +1118,7 @@ arm_gic_release_msi(device_t dev, device_t child= , int count, > >> > >> sc =3D device_get_softc(dev); > >> > >> - mtx_lock(&sc->mutex); > >> + mtx_lock_spin(&sc->mutex); > >> for (i =3D 0; i < count; i++) { > >> gi =3D (struct gic_irqsrc *)isrc[i]; > >> > >> @@ -1128,7 +1128,7 @@ arm_gic_release_msi(device_t dev, device_t child= , int count, > >> > >> gi->gi_flags &=3D ~GI_FLAG_MSI_USED; > >> } > >> - mtx_unlock(&sc->mutex); > >> + mtx_unlock_spin(&sc->mutex); > >> > >> return (0); > >> } > >> @@ -1142,7 +1142,7 @@ arm_gic_alloc_msix(device_t dev, device_t child,= device_t *pic, > >> > >> sc =3D device_get_softc(dev); > >> > >> - mtx_lock(&sc->mutex); > >> + mtx_lock_spin(&sc->mutex); > >> /* Find an unused interrupt */ > >> for (irq =3D sc->sc_spi_start; irq < sc->sc_spi_end; irq++) { > >> KASSERT((sc->gic_irqs[irq].gi_flags & GI_FLAG_MSI) !=3D= 0, > >> @@ -1152,13 +1152,13 @@ arm_gic_alloc_msix(device_t dev, device_t chil= d, device_t *pic, > >> } > >> /* No free interrupt was found */ > >> if (irq =3D=3D sc->sc_spi_end) { > >> - mtx_unlock(&sc->mutex); > >> + mtx_unlock_spin(&sc->mutex); > >> return (ENXIO); > >> } > >> > >> /* Mark the interrupt as used */ > >> sc->gic_irqs[irq].gi_flags |=3D GI_FLAG_MSI_USED; > >> - mtx_unlock(&sc->mutex); > >> + mtx_unlock_spin(&sc->mutex); > >> > >> *isrcp =3D (struct intr_irqsrc *)&sc->gic_irqs[irq]; > >> *pic =3D dev; > >> @@ -1178,9 +1178,9 @@ arm_gic_release_msix(device_t dev, device_t chil= d, struct intr_irqsrc *isrc) > >> KASSERT((gi->gi_flags & GI_FLAG_MSI_USED) =3D=3D GI_FLAG_MSI_US= ED, > >> ("%s: Trying to release an unused MSI-X interrupt", __func_= _)); > >> > >> - mtx_lock(&sc->mutex); > >> + mtx_lock_spin(&sc->mutex); > >> gi->gi_flags &=3D ~GI_FLAG_MSI_USED; > >> - mtx_unlock(&sc->mutex); > >> + mtx_unlock_spin(&sc->mutex); > >> > >> return (0); > >> } > > > > Thank you for the patch, it fixes the MSI-X in my setup, but in order > > to operate properly on Marvell SoCs (equipped with a standard GICv2m), > > I have to remove the asserts, which were added in c6f3076d4405 (Move > > the GICv2m msi handling to the parent): > > > > diff --git a/sys/arm/arm/gic.c b/sys/arm/arm/gic.c > > index 89db4e324600..b5d72a2a6c49 100644 > > --- a/sys/arm/arm/gic.c > > +++ b/sys/arm/arm/gic.c > > @@ -528,8 +528,6 @@ arm_gic_write_ivar(device_t dev, device_t child, > > int which, uintptr_t value) > > * GIC_IVAR_MBI_START must be set once and first. This a= llows > > * us to reserve the registers when GIC_IVAR_MBI_COUNT i= s set. > > */ > > - MPASS(sc->sc_spi_start =3D=3D 0); > > - MPASS(sc->sc_spi_count =3D=3D 0); > > MPASS(value >=3D GIC_FIRST_SPI); > > MPASS(value < sc->nirqs); > > > > @@ -537,7 +535,6 @@ arm_gic_write_ivar(device_t dev, device_t child, > > int which, uintptr_t value) > > return (0); > > case GIC_IVAR_MBI_COUNT: > > MPASS(sc->sc_spi_start !=3D 0); > > - MPASS(sc->sc_spi_count =3D=3D 0); > > > > sc->sc_spi_count =3D value; > > sc->sc_spi_end =3D sc->sc_spi_start + sc->sc_spi_count; > > > > Any thoughts? > > Can you try the patch in https://reviews.freebsd.org/D32224. The above ch= ange is to check there is only a single mbi range, however it appears your = hardware has multiple gicv2m devices so will try to reserve multiple mbi ra= nges. > After applying this patch the MSI-X work fine and I can boot the OS without issue. Thanks, Marcin From owner-dev-commits-src-main@freebsd.org Thu Sep 30 00:44:27 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 046DF67F5D1; Thu, 30 Sep 2021 00:44:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HKZJB6R8fz3PQr; Thu, 30 Sep 2021 00:44:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B7ADA21F62; Thu, 30 Sep 2021 00:44:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18U0iQPp084965; Thu, 30 Sep 2021 00:44:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18U0iQiD084964; Thu, 30 Sep 2021 00:44:26 GMT (envelope-from git) Date: Thu, 30 Sep 2021 00:44:26 GMT Message-Id: <202109300044.18U0iQiD084964@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Cy Schubert Subject: git: 4a7b49a0da00 - main - ipfilter: Save time and cycles swapping bucket table sizes MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cy X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 4a7b49a0da00d7822656e2adefafac885bbfd310 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Sep 2021 00:44:27 -0000 The branch main has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=4a7b49a0da00d7822656e2adefafac885bbfd310 commit 4a7b49a0da00d7822656e2adefafac885bbfd310 Author: Cy Schubert AuthorDate: 2021-09-28 03:04:18 +0000 Commit: Cy Schubert CommitDate: 2021-09-30 00:44:02 +0000 ipfilter: Save time and cycles swapping bucket table sizes NAT hash tables are inverted for inbound vs outbound. Rather than spend the time and cycles swapping them, let's simply calculate the bucket lengths inversely. MFC after: 1 week --- sys/contrib/ipfilter/netinet/ip_nat.c | 13 +++++-------- sys/contrib/ipfilter/netinet/ip_nat6.c | 29 +++++++++++++++++------------ 2 files changed, 22 insertions(+), 20 deletions(-) diff --git a/sys/contrib/ipfilter/netinet/ip_nat.c b/sys/contrib/ipfilter/netinet/ip_nat.c index 0475a4386079..054f92a93401 100644 --- a/sys/contrib/ipfilter/netinet/ip_nat.c +++ b/sys/contrib/ipfilter/netinet/ip_nat.c @@ -3521,15 +3521,12 @@ ipf_nat_hashtab_add(softc, softn, nat) u_int hv0; u_int hv1; - hv0 = nat->nat_hv[0] % softn->ipf_nat_table_sz; - hv1 = nat->nat_hv[1] % softn->ipf_nat_table_sz; - if (nat->nat_dir == NAT_INBOUND || nat->nat_dir == NAT_DIVERTIN) { - u_int swap; - - swap = hv0; - hv0 = hv1; - hv1 = swap; + hv1 = nat->nat_hv[0] % softn->ipf_nat_table_sz; + hv0 = nat->nat_hv[1] % softn->ipf_nat_table_sz; + } else { + hv0 = nat->nat_hv[0] % softn->ipf_nat_table_sz; + hv1 = nat->nat_hv[1] % softn->ipf_nat_table_sz; } if (softn->ipf_nat_stats.ns_side[0].ns_bucketlen[hv0] >= diff --git a/sys/contrib/ipfilter/netinet/ip_nat6.c b/sys/contrib/ipfilter/netinet/ip_nat6.c index baa3c302504a..c03048ee12ac 100644 --- a/sys/contrib/ipfilter/netinet/ip_nat6.c +++ b/sys/contrib/ipfilter/netinet/ip_nat6.c @@ -2160,19 +2160,24 @@ ipf_nat6_tabmove(softn, nat) /* * Add into the NAT table in the new position */ - hv0 = NAT_HASH_FN6(&nat->nat_osrc6, nat->nat_osport, 0xffffffff); - hv0 = NAT_HASH_FN6(&nat->nat_odst6, hv0 + nat->nat_odport, - softn->ipf_nat_table_sz); - hv1 = NAT_HASH_FN6(&nat->nat_nsrc6, nat->nat_nsport, 0xffffffff); - hv1 = NAT_HASH_FN6(&nat->nat_ndst6, hv1 + nat->nat_ndport, - softn->ipf_nat_table_sz); - if (nat->nat_dir == NAT_INBOUND || nat->nat_dir == NAT_DIVERTIN) { - u_int swap; - - swap = hv0; - hv0 = hv1; - hv1 = swap; + hv1 = NAT_HASH_FN6(&nat->nat_osrc6, + nat->nat_osport, 0xffffffff); + hv1 = NAT_HASH_FN6(&nat->nat_odst6, hv1 + nat->nat_odport, + softn->ipf_nat_table_sz); + hv0 = NAT_HASH_FN6(&nat->nat_nsrc6, + nat->nat_nsport, 0xffffffff); + hv0 = NAT_HASH_FN6(&nat->nat_ndst6, hv0 + nat->nat_ndport, + softn->ipf_nat_table_sz); + } else { + hv0 = NAT_HASH_FN6(&nat->nat_osrc6, + nat->nat_osport, 0xffffffff); + hv0 = NAT_HASH_FN6(&nat->nat_odst6, hv0 + nat->nat_odport, + softn->ipf_nat_table_sz); + hv1 = NAT_HASH_FN6(&nat->nat_nsrc6, + nat->nat_nsport, 0xffffffff); + hv1 = NAT_HASH_FN6(&nat->nat_ndst6, hv1 + nat->nat_ndport, + softn->ipf_nat_table_sz); } /* TRACE nat_osrc6, nat_osport, nat_odst6, nat_odport, hv0 */ From owner-dev-commits-src-main@freebsd.org Thu Sep 30 01:18:57 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 61B6C67F770; Thu, 30 Sep 2021 01:18:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HKb412L0zz3hV8; Thu, 30 Sep 2021 01:18:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 22D542256A; Thu, 30 Sep 2021 01:18:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18U1IvsJ026218; Thu, 30 Sep 2021 01:18:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18U1IvQM026217; Thu, 30 Sep 2021 01:18:57 GMT (envelope-from git) Date: Thu, 30 Sep 2021 01:18:57 GMT Message-Id: <202109300118.18U1IvQM026217@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 6a460811b331 - main - ida: Use ida lock instead of Giant for bus_dma allocation MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 6a460811b331d9f282811578d3d85f9a7e78936e Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Sep 2021 01:18:57 -0000 The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=6a460811b331d9f282811578d3d85f9a7e78936e commit 6a460811b331d9f282811578d3d85f9a7e78936e Author: Warner Losh AuthorDate: 2021-09-30 01:05:39 +0000 Commit: Warner Losh CommitDate: 2021-09-30 01:15:16 +0000 ida: Use ida lock instead of Giant for bus_dma allocation It looks like a reference to Giant was overloooked when jhb made this MPSAFE in 6b5b57ae9f8f. Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D31841 --- sys/dev/ida/ida.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/ida/ida.c b/sys/dev/ida/ida.c index 10bba8146706..d45395a1febf 100644 --- a/sys/dev/ida/ida.c +++ b/sys/dev/ida/ida.c @@ -248,7 +248,7 @@ ida_setup(struct ida_softc *ida) /* maxsegsz */ BUS_SPACE_MAXSIZE_32BIT, /* flags */ 0, /* lockfunc */ busdma_lock_mutex, - /* lockarg */ &Giant, + /* lockarg */ &ida->lock, &ida->buffer_dmat); if (error) return (ENOMEM); From owner-dev-commits-src-main@freebsd.org Thu Sep 30 02:00:14 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B7D596A8531; Thu, 30 Sep 2021 02:00:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HKbzf4sKfz3pDk; Thu, 30 Sep 2021 02:00:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8661522FB7; Thu, 30 Sep 2021 02:00:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18U20EoV084734; Thu, 30 Sep 2021 02:00:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18U20EZD084710; Thu, 30 Sep 2021 02:00:14 GMT (envelope-from git) Date: Thu, 30 Sep 2021 02:00:14 GMT Message-Id: <202109300200.18U20EZD084710@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 79a100e28e3c - main - bluetooth: complete removal of ng_h4 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 79a100e28e3c814773bb4c1826cfa25fbe31140e Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Sep 2021 02:00:14 -0000 The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=79a100e28e3c814773bb4c1826cfa25fbe31140e commit 79a100e28e3c814773bb4c1826cfa25fbe31140e Author: Warner Losh AuthorDate: 2021-09-05 18:41:16 +0000 Commit: Warner Losh CommitDate: 2021-09-30 02:00:02 +0000 bluetooth: complete removal of ng_h4 The ng_h4 module was disconnected 13 years ago when the tty later was locked by Ed. It completely fails to compile, and has a number of false positives for Giant use. Remove it for lack of interest. Bluetooth has largely (completely?) moved on from bluetooth over UART transport. OK'd by: emax Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D31846 --- ObsoleteFiles.inc | 3 + share/man/man4/Makefile | 1 - share/man/man4/netgraph.4 | 3 +- share/man/man4/ng_h4.4 | 123 --- share/man/man5/bluetooth.device.conf.5 | 3 +- sys/conf/files | 1 - sys/modules/netgraph/bluetooth/h4/Makefile | 12 - sys/netgraph/bluetooth/drivers/h4/TODO | 13 - sys/netgraph/bluetooth/drivers/h4/ng_h4.c | 1020 ------------------------ sys/netgraph/bluetooth/drivers/h4/ng_h4_prse.h | 125 --- sys/netgraph/bluetooth/drivers/h4/ng_h4_var.h | 104 --- sys/netgraph/bluetooth/include/ng_h4.h | 114 --- 12 files changed, 5 insertions(+), 1517 deletions(-) diff --git a/ObsoleteFiles.inc b/ObsoleteFiles.inc index 19e0428a5017..4a0d2fe1b7ea 100644 --- a/ObsoleteFiles.inc +++ b/ObsoleteFiles.inc @@ -40,6 +40,9 @@ # xargs -n1 | sort | uniq -d; # done +# 20210929: Remove ng_h4 +OLD_FILES+=usr/share/man/man4/ng_h4.4.gz + # 20210923: rename boot(9) to kern_reboot(9) OLD_FILES+=usr/share/man/man9/boot.9.gz diff --git a/share/man/man4/Makefile b/share/man/man4/Makefile index 4dad9b11ec22..421de8728a05 100644 --- a/share/man/man4/Makefile +++ b/share/man/man4/Makefile @@ -353,7 +353,6 @@ MAN= aac.4 \ ng_frame_relay.4 \ ng_gif.4 \ ng_gif_demux.4 \ - ng_h4.4 \ ng_hci.4 \ ng_hole.4 \ ng_hub.4 \ diff --git a/share/man/man4/netgraph.4 b/share/man/man4/netgraph.4 index 6b850e27762a..bed412193f6b 100644 --- a/share/man/man4/netgraph.4 +++ b/share/man/man4/netgraph.4 @@ -36,7 +36,7 @@ .\" $Whistle: netgraph.4,v 1.7 1999/01/28 23:54:52 julian Exp $ .\" $FreeBSD$ .\" -.Dd January 9, 2021 +.Dd September 29, 2021 .Dt NETGRAPH 4 .Os .Sh NAME @@ -1433,7 +1433,6 @@ common networking problems, solved using .Xr ng_frame_relay 4 , .Xr ng_gif 4 , .Xr ng_gif_demux 4 , -.Xr ng_h4 4 , .Xr ng_hci 4 , .Xr ng_hole 4 , .Xr ng_hub 4 , diff --git a/share/man/man4/ng_h4.4 b/share/man/man4/ng_h4.4 deleted file mode 100644 index bb539a230eba..000000000000 --- a/share/man/man4/ng_h4.4 +++ /dev/null @@ -1,123 +0,0 @@ -.\" Copyright (c) 2001-2002 Maksim Yevmenkin -.\" All rights reserved. -.\" -.\" Redistribution and use in source and binary forms, with or without -.\" modification, are permitted provided that the following conditions -.\" are met: -.\" 1. Redistributions of source code must retain the above copyright -.\" notice, this list of conditions and the following disclaimer. -.\" 2. Redistributions in binary form must reproduce the above copyright -.\" notice, this list of conditions and the following disclaimer in the -.\" documentation and/or other materials provided with the distribution. -.\" -.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND -.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE -.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -.\" SUCH DAMAGE. -.\" -.\" $Id: ng_h4.4,v 1.2 2003/05/21 19:37:35 max Exp $ -.\" $FreeBSD$ -.\" -.Dd June 14, 2002 -.Dt NG_H4 4 -.Os -.Sh NAME -.Nm ng_h4 -.Nd Netgraph node type that is also an H4 line discipline -.Sh SYNOPSIS -.In sys/types.h -.In netgraph/bluetooth/include/ng_h4.h -.Sh DESCRIPTION -The -.Nm h4 -node type is both a persistent Netgraph node type and a H4 line -discipline. -It implements a Bluetooth HCI UART transport layer as -per chapter H4 of the Bluetooth Specification Book v1.1. -A new node is created when the corresponding line discipline, -.Dv H4DISC , -is registered on a tty device (see -.Xr tty 4 ) . -.Pp -The node has a single hook called -.Dv hook . -Incoming bytes received on the tty device are re-assembled into -HCI frames (according to the length). -Full HCI frames are sent out on the hook. -HCI frames received on -.Dv hook -are transmitted out on the tty device. -No modification to the data is performed in either direction. -While the line discipline is installed on a tty, the normal -read and write operations are unavailable, returning -.Er EIO . -.Pp -Information about the node is available via the netgraph -.Xr ioctl 2 -command -.Dv NGIOCGINFO . -This command returns a -.Vt "struct nodeinfo" -similar to the -.Dv NGM_NODEINFO -.Xr netgraph 4 -control message. -.Sh HOOKS -This node type supports the following hooks: -.Bl -tag -width ".Va hook" -.It Va hook -single HCI frame contained in single -.Vt mbuf -structure. -.El -.Sh CONTROL MESSAGES -This node type supports the generic control messages, plus the following: -.Bl -tag -width foo -.It Dv NGM_H4_NODE_RESET -Reset the node. -.It Dv NGM_H4_NODE_GET_STATE -Returns current receiving state for the node. -.It Dv NGM_H4_NODE_GET_DEBUG -Returns an integer containing the current debug level for the node. -.It Dv NGM_H4_NODE_SET_DEBUG -This command takes an integer argument and sets current debug level -for the node. -.It Dv NGM_H4_NODE_GET_QLEN -Returns current length of outgoing queue for the node. -.It Dv NGM_H4_NODE_SET_QLEN -This command takes an integer argument and sets maximum length of -outgoing queue for the node. -.It Dv NGM_H4_NODE_GET_STAT -Returns various statistic information for the node, such as: number of -bytes (frames) sent, number of bytes (frames) received and number of -input (output) errors. -.It Dv NGM_H4_NODE_RESET_STAT -Reset all statistic counters to zero. -.El -.Sh SHUTDOWN -This node shuts down when the corresponding device is closed -(or the line discipline is uninstalled on the device). -.Sh SEE ALSO -.Xr ioctl 2 , -.Xr netgraph 4 , -.Xr tty 4 , -.Xr ngctl 8 -.Sh HISTORY -The -.Nm h4 -node type was implemented in -.Fx 5.0 . -.Sh AUTHORS -.An Maksim Yevmenkin Aq Mt m_evmenkin@yahoo.com -.Sh BUGS -This node still uses -.Xr spltty 9 -to lock tty layer. -This is wrong. diff --git a/share/man/man5/bluetooth.device.conf.5 b/share/man/man5/bluetooth.device.conf.5 index 681bbd693146..f2f5bcdc8685 100644 --- a/share/man/man5/bluetooth.device.conf.5 +++ b/share/man/man5/bluetooth.device.conf.5 @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 9, 2021 +.Dd September 29, 2021 .Dt BLUETOOTH.DEVICE.CONF 5 .Os .Sh NAME @@ -173,7 +173,6 @@ The file should be used to specify configuration parameters overrides for the second USB Bluetooth device. .Sh SEE ALSO -.Xr ng_h4 4 , .Xr ng_hci 4 , .Xr ng_l2cap 4 , .Xr ng_ubt 4 , diff --git a/sys/conf/files b/sys/conf/files index 828953628eda..fd91666f3718 100644 --- a/sys/conf/files +++ b/sys/conf/files @@ -4253,7 +4253,6 @@ netgraph/atm/sscop/ng_sscop.c optional ngatm_sscop \ netgraph/atm/uni/ng_uni.c optional ngatm_uni \ compile-with "${NORMAL_C} -I$S/contrib/ngatm" netgraph/bluetooth/common/ng_bluetooth.c optional netgraph_bluetooth -netgraph/bluetooth/drivers/h4/ng_h4.c optional netgraph_bluetooth_h4 netgraph/bluetooth/drivers/ubt/ng_ubt.c optional netgraph_bluetooth_ubt usb netgraph/bluetooth/drivers/ubt/ng_ubt_intel.c optional netgraph_bluetooth_ubt usb netgraph/bluetooth/drivers/ubtbcmfw/ubtbcmfw.c optional netgraph_bluetooth_ubtbcmfw usb diff --git a/sys/modules/netgraph/bluetooth/h4/Makefile b/sys/modules/netgraph/bluetooth/h4/Makefile deleted file mode 100644 index 808f44c9dd2c..000000000000 --- a/sys/modules/netgraph/bluetooth/h4/Makefile +++ /dev/null @@ -1,12 +0,0 @@ -# $Id: Makefile,v 1.1 2002/11/24 20:40:04 max Exp $ -# $FreeBSD$ - -.PATH: ${SRCTOP}/sys/netgraph/bluetooth/drivers/h4 - -CFLAGS+= -I${SRCTOP}/sys/netgraph/bluetooth/include \ - -I${SRCTOP}/sys/netgraph/bluetooth/drivers/h4 - -KMOD= ng_h4 -SRCS= ng_h4.c - -.include diff --git a/sys/netgraph/bluetooth/drivers/h4/TODO b/sys/netgraph/bluetooth/drivers/h4/TODO deleted file mode 100644 index 0862688c19d9..000000000000 --- a/sys/netgraph/bluetooth/drivers/h4/TODO +++ /dev/null @@ -1,13 +0,0 @@ -$Id: TODO,v 1.2 2004/08/23 18:08:15 max Exp $ -$FreeBSD$ - -FIXME/TODO list - -This is a list of open issues for H4 node - -1) Locking/SMP - - External code now uses ng_send_fn to inject data into Netgraph, but - i still use splXXX to lock tty level. this is wrong and should be - fixed! - diff --git a/sys/netgraph/bluetooth/drivers/h4/ng_h4.c b/sys/netgraph/bluetooth/drivers/h4/ng_h4.c deleted file mode 100644 index 11560b7c6681..000000000000 --- a/sys/netgraph/bluetooth/drivers/h4/ng_h4.c +++ /dev/null @@ -1,1020 +0,0 @@ -/* - * ng_h4.c - */ - -/*- - * SPDX-License-Identifier: BSD-2-Clause-FreeBSD - * - * Copyright (c) 2001-2002 Maksim Yevmenkin - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * $Id: ng_h4.c,v 1.10 2005/10/31 17:57:43 max Exp $ - * $FreeBSD$ - * - * Based on: - * --------- - * - * FreeBSD: src/sys/netgraph/ng_tty.c - * Author: Archie Cobbs - * - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -/***************************************************************************** - ***************************************************************************** - ** This node implements a Bluetooth HCI UART transport layer as per chapter - ** H4 of the Bluetooth Specification Book v1.1. It is a terminal line - ** discipline that is also a netgraph node. Installing this line discipline - ** on a terminal device instantiates a new netgraph node of this type, which - ** allows access to the device via the "hook" hook of the node. - ** - ** Once the line discipline is installed, you can find out the name of the - ** corresponding netgraph node via a NGIOCGINFO ioctl(). - ***************************************************************************** - *****************************************************************************/ - -/* MALLOC define */ -#ifndef NG_SEPARATE_MALLOC -MALLOC_DEFINE(M_NETGRAPH_H4, "netgraph_h4", "Netgraph Bluetooth H4 node"); -#else -#define M_NETGRAPH_H4 M_NETGRAPH -#endif /* NG_SEPARATE_MALLOC */ - -/* Line discipline methods */ -static int ng_h4_open (struct cdev *, struct tty *); -static int ng_h4_close (struct tty *, int); -static int ng_h4_read (struct tty *, struct uio *, int); -static int ng_h4_write (struct tty *, struct uio *, int); -static int ng_h4_input (int, struct tty *); -static int ng_h4_start (struct tty *); -static int ng_h4_ioctl (struct tty *, u_long, caddr_t, - int, struct thread *); - -/* Line discipline descriptor */ -static struct linesw ng_h4_disc = { - ng_h4_open, /* open */ - ng_h4_close, /* close */ - ng_h4_read, /* read */ - ng_h4_write, /* write */ - ng_h4_ioctl, /* ioctl */ - ng_h4_input, /* input */ - ng_h4_start, /* start */ - ttymodem /* modem */ -}; - -/* Netgraph methods */ -static ng_constructor_t ng_h4_constructor; -static ng_rcvmsg_t ng_h4_rcvmsg; -static ng_shutdown_t ng_h4_shutdown; -static ng_newhook_t ng_h4_newhook; -static ng_connect_t ng_h4_connect; -static ng_rcvdata_t ng_h4_rcvdata; -static ng_disconnect_t ng_h4_disconnect; - -/* Other stuff */ -static void ng_h4_process_timeout (node_p, hook_p, void *, int); -static int ng_h4_mod_event (module_t, int, void *); - -/* Netgraph node type descriptor */ -static struct ng_type typestruct = { - .version = NG_ABI_VERSION, - .name = NG_H4_NODE_TYPE, - .mod_event = ng_h4_mod_event, - .constructor = ng_h4_constructor, - .rcvmsg = ng_h4_rcvmsg, - .shutdown = ng_h4_shutdown, - .newhook = ng_h4_newhook, - .connect = ng_h4_connect, - .rcvdata = ng_h4_rcvdata, - .disconnect = ng_h4_disconnect, - .cmdlist = ng_h4_cmdlist -}; -NETGRAPH_INIT(h4, &typestruct); -MODULE_VERSION(ng_h4, NG_BLUETOOTH_VERSION); - -static int ng_h4_node = 0; - -/***************************************************************************** - ***************************************************************************** - ** Line discipline methods - ***************************************************************************** - *****************************************************************************/ - -/* - * Set our line discipline on the tty. - */ - -static int -ng_h4_open(struct cdev *dev, struct tty *tp) -{ - struct thread *td = curthread; - char name[NG_NODESIZ]; - ng_h4_info_p sc = NULL; - int error; - - /* Super-user only */ - error = priv_check(td, PRIV_NETGRAPH_TTY); /* XXX */ - if (error != 0) - return (error); - - /* Initialize private struct */ - sc = malloc(sizeof(*sc), M_NETGRAPH_H4, M_NOWAIT|M_ZERO); - if (sc == NULL) - return (ENOMEM); - - sc->tp = tp; - sc->debug = NG_H4_WARN_LEVEL; - - sc->state = NG_H4_W4_PKT_IND; - sc->want = 1; - sc->got = 0; - - mtx_init(&sc->outq.ifq_mtx, "ng_h4 node+queue", NULL, MTX_DEF); - IFQ_SET_MAXLEN(&sc->outq, NG_H4_DEFAULTQLEN); - ng_callout_init(&sc->timo); - - NG_H4_LOCK(sc); - - /* Setup netgraph node */ - error = ng_make_node_common(&typestruct, &sc->node); - if (error != 0) { - NG_H4_UNLOCK(sc); - - printf("%s: Unable to create new node!\n", __func__); - - mtx_destroy(&sc->outq.ifq_mtx); - bzero(sc, sizeof(*sc)); - free(sc, M_NETGRAPH_H4); - - return (error); - } - - /* Assign node its name */ - snprintf(name, sizeof(name), "%s%d", typestruct.name, ng_h4_node ++); - - error = ng_name_node(sc->node, name); - if (error != 0) { - NG_H4_UNLOCK(sc); - - printf("%s: %s - node name exists?\n", __func__, name); - - NG_NODE_UNREF(sc->node); - mtx_destroy(&sc->outq.ifq_mtx); - bzero(sc, sizeof(*sc)); - free(sc, M_NETGRAPH_H4); - - return (error); - } - - /* Set back pointers */ - NG_NODE_SET_PRIVATE(sc->node, sc); - tp->t_lsc = (caddr_t) sc; - - /* The node has to be a WRITER because data can change node status */ - NG_NODE_FORCE_WRITER(sc->node); - - /* - * Pre-allocate cblocks to the an appropriate amount. - * I'm not sure what is appropriate. - */ - - ttyflush(tp, FREAD | FWRITE); - clist_alloc_cblocks(&tp->t_canq, 0, 0); - clist_alloc_cblocks(&tp->t_rawq, 0, 0); - clist_alloc_cblocks(&tp->t_outq, - MLEN + NG_H4_HIWATER, MLEN + NG_H4_HIWATER); - - NG_H4_UNLOCK(sc); - - return (error); -} /* ng_h4_open */ - -/* - * Line specific close routine, called from device close routine - * and from ttioctl. This causes the node to be destroyed as well. - */ - -static int -ng_h4_close(struct tty *tp, int flag) -{ - ng_h4_info_p sc = (ng_h4_info_p) tp->t_lsc; - - ttyflush(tp, FREAD | FWRITE); - clist_free_cblocks(&tp->t_outq); - - if (sc != NULL) { - NG_H4_LOCK(sc); - - if (callout_pending(&sc->timo)) - ng_uncallout(&sc->timo, sc->node); - - tp->t_lsc = NULL; - sc->dying = 1; - - NG_H4_UNLOCK(sc); - - ng_rmnode_self(sc->node); - } - - return (0); -} /* ng_h4_close */ - -/* - * Once the device has been turned into a node, we don't allow reading. - */ - -static int -ng_h4_read(struct tty *tp, struct uio *uio, int flag) -{ - return (EIO); -} /* ng_h4_read */ - -/* - * Once the device has been turned into a node, we don't allow writing. - */ - -static int -ng_h4_write(struct tty *tp, struct uio *uio, int flag) -{ - return (EIO); -} /* ng_h4_write */ - -/* - * We implement the NGIOCGINFO ioctl() defined in ng_message.h. - */ - -static int -ng_h4_ioctl(struct tty *tp, u_long cmd, caddr_t data, int flag, - struct thread *td) -{ - ng_h4_info_p sc = (ng_h4_info_p) tp->t_lsc; - int error = 0; - - if (sc == NULL) - return (ENXIO); - - NG_H4_LOCK(sc); - - switch (cmd) { - case NGIOCGINFO: -#undef NI -#define NI(x) ((struct nodeinfo *)(x)) - - bzero(data, sizeof(*NI(data))); - - if (NG_NODE_HAS_NAME(sc->node)) - strncpy(NI(data)->name, NG_NODE_NAME(sc->node), - sizeof(NI(data)->name) - 1); - - strncpy(NI(data)->type, sc->node->nd_type->name, - sizeof(NI(data)->type) - 1); - - NI(data)->id = (u_int32_t) ng_node2ID(sc->node); - NI(data)->hooks = NG_NODE_NUMHOOKS(sc->node); - break; - - default: - error = ENOIOCTL; - break; - } - - NG_H4_UNLOCK(sc); - - return (error); -} /* ng_h4_ioctl */ - -/* - * Receive data coming from the device. We get one character at a time, which - * is kindof silly. - */ - -static int -ng_h4_input(int c, struct tty *tp) -{ - ng_h4_info_p sc = (ng_h4_info_p) tp->t_lsc; - - if (sc == NULL || tp != sc->tp || - sc->node == NULL || NG_NODE_NOT_VALID(sc->node)) - return (0); - - NG_H4_LOCK(sc); - - /* Check for error conditions */ - if ((tp->t_state & TS_CONNECTED) == 0) { - NG_H4_INFO("%s: %s - no carrier\n", __func__, - NG_NODE_NAME(sc->node)); - - sc->state = NG_H4_W4_PKT_IND; - sc->want = 1; - sc->got = 0; - - NG_H4_UNLOCK(sc); - - return (0); /* XXX Loss of synchronization here! */ - } - - /* Check for framing error or overrun on this char */ - if (c & TTY_ERRORMASK) { - NG_H4_ERR("%s: %s - line error %#x, c=%#x\n", __func__, - NG_NODE_NAME(sc->node), c & TTY_ERRORMASK, - c & TTY_CHARMASK); - - NG_H4_STAT_IERROR(sc->stat); - - sc->state = NG_H4_W4_PKT_IND; - sc->want = 1; - sc->got = 0; - - NG_H4_UNLOCK(sc); - - return (0); /* XXX Loss of synchronization here! */ - } - - NG_H4_STAT_BYTES_RECV(sc->stat, 1); - - /* Append char to mbuf */ - if (sc->got >= sizeof(sc->ibuf)) { - NG_H4_ALERT("%s: %s - input buffer overflow, c=%#x, got=%d\n", - __func__, NG_NODE_NAME(sc->node), c & TTY_CHARMASK, - sc->got); - - NG_H4_STAT_IERROR(sc->stat); - - sc->state = NG_H4_W4_PKT_IND; - sc->want = 1; - sc->got = 0; - - NG_H4_UNLOCK(sc); - - return (0); /* XXX Loss of synchronization here! */ - } - - sc->ibuf[sc->got ++] = (c & TTY_CHARMASK); - - NG_H4_INFO("%s: %s - got char %#x, want=%d, got=%d\n", __func__, - NG_NODE_NAME(sc->node), c, sc->want, sc->got); - - if (sc->got < sc->want) { - NG_H4_UNLOCK(sc); - - return (0); /* Wait for more */ - } - - switch (sc->state) { - /* Got packet indicator */ - case NG_H4_W4_PKT_IND: - NG_H4_INFO("%s: %s - got packet indicator %#x\n", __func__, - NG_NODE_NAME(sc->node), sc->ibuf[0]); - - sc->state = NG_H4_W4_PKT_HDR; - - /* - * Since packet indicator included in the packet header - * just set sc->want to sizeof(packet header). - */ - - switch (sc->ibuf[0]) { - case NG_HCI_ACL_DATA_PKT: - sc->want = sizeof(ng_hci_acldata_pkt_t); - break; - - case NG_HCI_SCO_DATA_PKT: - sc->want = sizeof(ng_hci_scodata_pkt_t); - break; - - case NG_HCI_EVENT_PKT: - sc->want = sizeof(ng_hci_event_pkt_t); - break; - - default: - NG_H4_WARN("%s: %s - ignoring unknown packet " \ - "type=%#x\n", __func__, NG_NODE_NAME(sc->node), - sc->ibuf[0]); - - NG_H4_STAT_IERROR(sc->stat); - - sc->state = NG_H4_W4_PKT_IND; - sc->want = 1; - sc->got = 0; - break; - } - break; - - /* Got packet header */ - case NG_H4_W4_PKT_HDR: - sc->state = NG_H4_W4_PKT_DATA; - - switch (sc->ibuf[0]) { - case NG_HCI_ACL_DATA_PKT: - c = le16toh(((ng_hci_acldata_pkt_t *) - (sc->ibuf))->length); - break; - - case NG_HCI_SCO_DATA_PKT: - c = ((ng_hci_scodata_pkt_t *)(sc->ibuf))->length; - break; - - case NG_HCI_EVENT_PKT: - c = ((ng_hci_event_pkt_t *)(sc->ibuf))->length; - break; - - default: - KASSERT((0), ("Invalid packet type=%#x\n", - sc->ibuf[0])); - break; - } - - NG_H4_INFO("%s: %s - got packet header, packet type=%#x, " \ - "packet size=%d, payload size=%d\n", __func__, - NG_NODE_NAME(sc->node), sc->ibuf[0], sc->got, c); - - if (c > 0) { - sc->want += c; - - /* - * Try to prevent possible buffer overrun - * - * XXX I'm *really* confused here. It turns out - * that Xircom card sends us packets with length - * greater then 512 bytes! This is greater then - * our old receive buffer (ibuf) size. In the same - * time the card demands from us *not* to send - * packets greater then 192 bytes. Weird! How the - * hell i should know how big *receive* buffer - * should be? For now increase receiving buffer - * size to 1K and add the following check. - */ - - if (sc->want >= sizeof(sc->ibuf)) { - int b; - - NG_H4_ALERT("%s: %s - packet too big for " \ - "buffer, type=%#x, got=%d, want=%d, " \ - "length=%d\n", __func__, - NG_NODE_NAME(sc->node), sc->ibuf[0], - sc->got, sc->want, c); - - NG_H4_ALERT("Packet header:\n"); - for (b = 0; b < sc->got; b++) - NG_H4_ALERT("%#x ", sc->ibuf[b]); - NG_H4_ALERT("\n"); - - /* Reset state */ - NG_H4_STAT_IERROR(sc->stat); - - sc->state = NG_H4_W4_PKT_IND; - sc->want = 1; - sc->got = 0; - } - - break; - } - - /* else FALLTHROUGH and deliver frame */ - /* XXX Is this true? Should we deliver empty frame? */ - - /* Got packet data */ - case NG_H4_W4_PKT_DATA: - NG_H4_INFO("%s: %s - got full packet, packet type=%#x, " \ - "packet size=%d\n", __func__, - NG_NODE_NAME(sc->node), sc->ibuf[0], sc->got); - - if (sc->hook != NULL && NG_HOOK_IS_VALID(sc->hook)) { - struct mbuf *m = NULL; - - MGETHDR(m, M_NOWAIT, MT_DATA); - if (m != NULL) { - m->m_pkthdr.len = 0; - - /* XXX m_copyback() is stupid */ - m->m_len = min(MHLEN, sc->got); - - m_copyback(m, 0, sc->got, sc->ibuf); - NG_SEND_DATA_ONLY(c, sc->hook, m); - } else { - NG_H4_ERR("%s: %s - could not get mbuf\n", - __func__, NG_NODE_NAME(sc->node)); - - NG_H4_STAT_IERROR(sc->stat); - } - } - - sc->state = NG_H4_W4_PKT_IND; - sc->want = 1; - sc->got = 0; - - NG_H4_STAT_PCKTS_RECV(sc->stat); - break; - - default: - KASSERT((0), ("Invalid H4 node state=%d", sc->state)); - break; - } - - NG_H4_UNLOCK(sc); - - return (0); -} /* ng_h4_input */ - -/* - * This is called when the device driver is ready for more output. Called from - * tty system. - */ - -static int -ng_h4_start(struct tty *tp) -{ - ng_h4_info_p sc = (ng_h4_info_p) tp->t_lsc; - struct mbuf *m = NULL; - int size; - - if (sc == NULL || tp != sc->tp || - sc->node == NULL || NG_NODE_NOT_VALID(sc->node)) - return (0); - -#if 0 - while (tp->t_outq.c_cc < NG_H4_HIWATER) { /* XXX 2.2 specific ? */ -#else - while (1) { -#endif - /* Remove first mbuf from queue */ - IF_DEQUEUE(&sc->outq, m); - if (m == NULL) - break; - - /* Send as much of it as possible */ - while (m != NULL) { - size = m->m_len - b_to_q(mtod(m, u_char *), - m->m_len, &tp->t_outq); - - NG_H4_LOCK(sc); - NG_H4_STAT_BYTES_SENT(sc->stat, size); - NG_H4_UNLOCK(sc); - - m->m_data += size; - m->m_len -= size; - if (m->m_len > 0) - break; /* device can't take no more */ - - m = m_free(m); - } - - /* Put remainder of mbuf chain (if any) back on queue */ - if (m != NULL) { - IF_PREPEND(&sc->outq, m); - break; - } - - /* Full packet has been sent */ - NG_H4_LOCK(sc); - NG_H4_STAT_PCKTS_SENT(sc->stat); - NG_H4_UNLOCK(sc); - } - - /* - * Call output process whether or not there is any output. We are - * being called in lieu of ttstart and must do what it would. - */ - - tt_oproc(sc->tp); - - /* - * This timeout is needed for operation on a pseudo-tty, because the - * pty code doesn't call pppstart after it has drained the t_outq. - */ - - NG_H4_LOCK(sc); - - if (!IFQ_IS_EMPTY(&sc->outq) && !callout_pending(&sc->timo)) - ng_callout(&sc->timo, sc->node, NULL, 1, - ng_h4_process_timeout, NULL, 0); - - NG_H4_UNLOCK(sc); - - return (0); -} /* ng_h4_start */ - -/***************************************************************************** - ***************************************************************************** - ** Netgraph node methods - ***************************************************************************** - *****************************************************************************/ - -/* - * Initialize a new node of this type. We only allow nodes to be created as - * a result of setting the line discipline on a tty, so always return an error - * if not. - */ - -static int -ng_h4_constructor(node_p node) -{ - return (EOPNOTSUPP); -} /* ng_h4_constructor */ - -/* - * Add a new hook. There can only be one. - */ - -static int -ng_h4_newhook(node_p node, hook_p hook, const char *name) -{ - ng_h4_info_p sc = (ng_h4_info_p) NG_NODE_PRIVATE(node); - - if (strcmp(name, NG_H4_HOOK) != 0) - return (EINVAL); - - NG_H4_LOCK(sc); - - if (sc->hook != NULL) { - NG_H4_UNLOCK(sc); - return (EISCONN); - } - sc->hook = hook; - - NG_H4_UNLOCK(sc); - - return (0); -} /* ng_h4_newhook */ - -/* - * Connect hook. Just say yes. - */ - -static int -ng_h4_connect(hook_p hook) -{ - ng_h4_info_p sc = (ng_h4_info_p) NG_NODE_PRIVATE(NG_HOOK_NODE(hook)); - - if (hook != sc->hook) - panic("%s: hook != sc->hook\n", __func__); - - NG_HOOK_FORCE_QUEUE(NG_HOOK_PEER(hook)); - NG_HOOK_FORCE_QUEUE(hook); - - return (0); *** 681 LINES SKIPPED *** From owner-dev-commits-src-main@freebsd.org Thu Sep 30 02:08:48 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 59AD06A825D; Thu, 30 Sep 2021 02:08:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HKc9X1rXlz3pmT; Thu, 30 Sep 2021 02:08:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1F2562324A; Thu, 30 Sep 2021 02:08:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18U28mwn092477; Thu, 30 Sep 2021 02:08:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18U28mVl092476; Thu, 30 Sep 2021 02:08:48 GMT (envelope-from git) Date: Thu, 30 Sep 2021 02:08:48 GMT Message-Id: <202109300208.18U28mVl092476@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 8ea95b2fbab8 - main - loader.efi: remove extra extern ST MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 8ea95b2fbab8eb891c4191c1879199685951b1f6 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Sep 2021 02:08:48 -0000 The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=8ea95b2fbab8eb891c4191c1879199685951b1f6 commit 8ea95b2fbab8eb891c4191c1879199685951b1f6 Author: Warner Losh AuthorDate: 2021-09-30 02:07:13 +0000 Commit: Warner Losh CommitDate: 2021-09-30 02:07:13 +0000 loader.efi: remove extra extern ST The definition for 'ST' is in efilib.h, so we don't need extern ST here. Sponsored by: Netflix Reviewed by: tsoome, kevans Differential Revision: https://reviews.freebsd.org/D32225 --- stand/efi/loader/bootinfo.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/stand/efi/loader/bootinfo.c b/stand/efi/loader/bootinfo.c index f4501f18f14c..15b5d86f82b6 100644 --- a/stand/efi/loader/bootinfo.c +++ b/stand/efi/loader/bootinfo.c @@ -63,8 +63,6 @@ __FBSDID("$FreeBSD$"); int bi_load(char *args, vm_offset_t *modulep, vm_offset_t *kernendp, bool exit_bs); -extern EFI_SYSTEM_TABLE *ST; - int boot_services_gone; static int From owner-dev-commits-src-main@freebsd.org Thu Sep 30 02:19:55 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D06826A827C; Thu, 30 Sep 2021 02:19:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HKcQM5QLRz3r2h; Thu, 30 Sep 2021 02:19:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9A904236C5; Thu, 30 Sep 2021 02:19:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18U2Jt72006391; Thu, 30 Sep 2021 02:19:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18U2Jtq3006390; Thu, 30 Sep 2021 02:19:55 GMT (envelope-from git) Date: Thu, 30 Sep 2021 02:19:55 GMT Message-Id: <202109300219.18U2Jtq3006390@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: e2c1243f427b - main - fd: Move from using device_busy to a refcount MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e2c1243f427b7dd387efd42669cc199cbb9b514c Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Sep 2021 02:19:55 -0000 The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=e2c1243f427b7dd387efd42669cc199cbb9b514c commit e2c1243f427b7dd387efd42669cc199cbb9b514c Author: Warner Losh AuthorDate: 2021-09-30 02:18:28 +0000 Commit: Warner Losh CommitDate: 2021-09-30 02:18:28 +0000 fd: Move from using device_busy to a refcount Use refcounting to delay the detach rather than device_busy and/or device_unbusy. fd/fdc is one of the few consumers of device_busy in the tree for that, and it's not a good fit. Also, nothing is waking 'fd' and other drivers don't loop like this. Return EBUSY if we still have active users. Sponsored by: Netflix Reviewed by: mav Differential Revision: https://reviews.freebsd.org/D31830 --- sys/dev/fdc/fdc.c | 34 +++++++++++++++++++++++----------- 1 file changed, 23 insertions(+), 11 deletions(-) diff --git a/sys/dev/fdc/fdc.c b/sys/dev/fdc/fdc.c index 11262231c3b2..6f035e9689f1 100644 --- a/sys/dev/fdc/fdc.c +++ b/sys/dev/fdc/fdc.c @@ -261,6 +261,7 @@ struct fd_data { struct g_provider *fd_provider; device_t dev; struct bio_queue_head fd_bq; + bool gone; }; #define FD_NOT_VALID -2 @@ -1398,6 +1399,7 @@ fdautoselect(struct fd_data *fd) static g_access_t fd_access; static g_start_t fd_start; static g_ioctl_t fd_ioctl; +static g_provgone_t fd_providergone; struct g_class g_fd_class = { .name = "FD", @@ -1405,6 +1407,7 @@ struct g_class g_fd_class = { .start = fd_start, .access = fd_access, .ioctl = fd_ioctl, + .providergone = fd_providergone, }; static int @@ -1413,7 +1416,6 @@ fd_access(struct g_provider *pp, int r, int w, int e) struct fd_data *fd; struct fdc_data *fdc; int ar, aw, ae; - int busy; fd = pp->geom->softc; fdc = fd->fdc; @@ -1431,11 +1433,9 @@ fd_access(struct g_provider *pp, int r, int w, int e) if (ar == 0 && aw == 0 && ae == 0) { fd->options &= ~(FDOPT_NORETRY | FDOPT_NOERRLOG | FDOPT_NOERROR); - device_unbusy(fd->dev); return (0); } - busy = 0; if (pp->acr == 0 && pp->acw == 0 && pp->ace == 0) { if (fdmisccmd(fd, BIO_PROBE, NULL)) return (ENXIO); @@ -1453,13 +1453,9 @@ fd_access(struct g_provider *pp, int r, int w, int e) fd->flags &= ~FD_NEWDISK; mtx_unlock(&fdc->fdc_mtx); } - device_busy(fd->dev); - busy = 1; } if (w > 0 && (fd->flags & FD_WP)) { - if (busy) - device_unbusy(fd->dev); return (EROFS); } @@ -1588,8 +1584,6 @@ fd_ioctl(struct g_provider *pp, u_long cmd, void *data, int fflag, struct thread return (error); }; - - /* * Configuration/initialization stuff, per controller. */ @@ -2055,6 +2049,16 @@ fd_attach(device_t dev) return (0); } +static void +fd_providergone(struct g_provider *pp) +{ + struct fd_data *fd; + + fd = pp->geom->softc; + fd->gone = true; + wakeup(fd); +} + static void fd_detach_geom(void *arg, int flag) { @@ -2070,9 +2074,17 @@ fd_detach(device_t dev) struct fd_data *fd; fd = device_get_softc(dev); + g_waitfor_event(fd_detach_geom, fd, M_WAITOK, NULL); - while (device_get_state(dev) == DS_BUSY) - tsleep(fd, PZERO, "fdd", hz/10); + while (!fd->gone) { + tsleep(fd, PZERO, "fdgone", hz/10); + } + + /* + * There may be accesses to the floppy while we're waitng, so drain the + * motor callback here. fdc_detach turns off motor if it's still on when + * we get to this point. + */ callout_drain(&fd->toffhandle); return (0); From owner-dev-commits-src-main@freebsd.org Thu Sep 30 03:14:32 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 76DCA6A979D; Thu, 30 Sep 2021 03:14:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HKddN2jp7z3tk1; Thu, 30 Sep 2021 03:14:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3D9BF24435; Thu, 30 Sep 2021 03:14:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18U3EWUJ086183; Thu, 30 Sep 2021 03:14:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18U3EWY6086182; Thu, 30 Sep 2021 03:14:32 GMT (envelope-from git) Date: Thu, 30 Sep 2021 03:14:32 GMT Message-Id: <202109300314.18U3EWY6086182@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Jung-uk Kim Subject: git: 4fa690be2cfc - main - bluetooth: Fix build after ng_h4 removal MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jkim X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 4fa690be2cfcda81eb6d1f61025d0baff6fcc19f Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Sep 2021 03:14:32 -0000 The branch main has been updated by jkim: URL: https://cgit.FreeBSD.org/src/commit/?id=4fa690be2cfcda81eb6d1f61025d0baff6fcc19f commit 4fa690be2cfcda81eb6d1f61025d0baff6fcc19f Author: Jung-uk Kim AuthorDate: 2021-09-30 03:10:56 +0000 Commit: Jung-uk Kim CommitDate: 2021-09-30 03:10:56 +0000 bluetooth: Fix build after ng_h4 removal It was caused by 79a100e28e3c814773bb4c1826cfa25fbe31140e. --- usr.sbin/bluetooth/hcseriald/hcseriald.c | 1 - 1 file changed, 1 deletion(-) diff --git a/usr.sbin/bluetooth/hcseriald/hcseriald.c b/usr.sbin/bluetooth/hcseriald/hcseriald.c index 3d2fc60cf4de..e019d52618b8 100644 --- a/usr.sbin/bluetooth/hcseriald/hcseriald.c +++ b/usr.sbin/bluetooth/hcseriald/hcseriald.c @@ -36,7 +36,6 @@ #include #include -#include #include #include From owner-dev-commits-src-main@freebsd.org Thu Sep 30 03:23:24 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 38E296A96C0; Thu, 30 Sep 2021 03:23:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HKdqc0vcZz3vwk; Thu, 30 Sep 2021 03:23:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F128B246AD; Thu, 30 Sep 2021 03:23:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18U3NNis099777; Thu, 30 Sep 2021 03:23:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18U3NNsb099776; Thu, 30 Sep 2021 03:23:23 GMT (envelope-from git) Date: Thu, 30 Sep 2021 03:23:23 GMT Message-Id: <202109300323.18U3NNsb099776@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 66d6299848c3 - main - bluetooth: remove hcseriald MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 66d6299848c39c35327a7ea19d7cd6b03283784c Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Sep 2021 03:23:24 -0000 The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=66d6299848c39c35327a7ea19d7cd6b03283784c commit 66d6299848c39c35327a7ea19d7cd6b03283784c Author: Warner Losh AuthorDate: 2021-09-30 03:08:30 +0000 Commit: Warner Losh CommitDate: 2021-09-30 03:18:17 +0000 bluetooth: remove hcseriald Without ng_h4 gone, there's no need for hcseriald. Sponsored by: Netflix --- ObsoleteFiles.inc | 4 + libexec/rc/rc.d/bluetooth | 29 --- usr.sbin/bluetooth/Makefile | 1 - usr.sbin/bluetooth/hccontrol/hccontrol.8 | 3 +- usr.sbin/bluetooth/hcsecd/hcsecd.8 | 3 +- usr.sbin/bluetooth/hcseriald/Makefile | 11 -- usr.sbin/bluetooth/hcseriald/Makefile.depend | 18 -- usr.sbin/bluetooth/hcseriald/hcseriald.8 | 86 --------- usr.sbin/bluetooth/hcseriald/hcseriald.c | 269 --------------------------- 9 files changed, 6 insertions(+), 418 deletions(-) diff --git a/ObsoleteFiles.inc b/ObsoleteFiles.inc index 4a0d2fe1b7ea..ee77a56b7acc 100644 --- a/ObsoleteFiles.inc +++ b/ObsoleteFiles.inc @@ -40,6 +40,10 @@ # xargs -n1 | sort | uniq -d; # done +# 20210929: +OLD_FILES+=usr/sbin/hcseriald +OLD_FILES+=usr/share/man/man8/hcseriald.8.gz + # 20210929: Remove ng_h4 OLD_FILES+=usr/share/man/man4/ng_h4.4.gz diff --git a/libexec/rc/rc.d/bluetooth b/libexec/rc/rc.d/bluetooth index 318428ba2fee..b89a2c328048 100755 --- a/libexec/rc/rc.d/bluetooth +++ b/libexec/rc/rc.d/bluetooth @@ -235,26 +235,6 @@ bluetooth_start() # Try to figure out device type by looking at device name case "${dev}" in - # uartX - serial/UART Bluetooth device - uart*) - load_kld ng_h4 || return 1 - - hook="hook" - - # Obtain unit number from device. - unit=`expr ${dev} : 'uart\([0-9]\{1,\}\)'` - if [ -z "${unit}" ]; then - err 1 "Unable to get uart unit number: ${dev}" - fi - - ${hcseriald} -f /dev/cuau${unit} -n ${dev} - sleep 1 # wait a little bit - - if [ ! -f "/var/run/hcseriald.${dev}.pid" ]; then - err 1 "Unable to start hcseriald on ${dev}" - fi - ;; - # USB Bluetooth adapters ubt*) hook="hook" @@ -316,14 +296,6 @@ bluetooth_stop() # Try to figure out device type by looking at device name case "${dev}" in - # uartX - serial/UART Bluetooth device - uart*) - if [ -f "/var/run/hcseriald.${dev}.pid" ]; then - kill `cat /var/run/hcseriald.${dev}.pid` - sleep 1 # wait a little bit - fi - ;; - # 3Com Bluetooth Adapter 3CRWB60-A btccc*) ;; @@ -349,7 +321,6 @@ bluetooth_stop() load_rc_config $name hccontrol="${bluetooth_hccontrol:-/usr/sbin/hccontrol}" -hcseriald="${bluetooth_hcseriald:-/usr/sbin/hcseriald}" run_rc_command $* diff --git a/usr.sbin/bluetooth/Makefile b/usr.sbin/bluetooth/Makefile index 5868ffe90747..99f2a2eb9087 100644 --- a/usr.sbin/bluetooth/Makefile +++ b/usr.sbin/bluetooth/Makefile @@ -8,7 +8,6 @@ SUBDIR= \ btpand \ hccontrol \ hcsecd \ - hcseriald \ l2control \ l2ping \ rfcomm_pppd \ diff --git a/usr.sbin/bluetooth/hccontrol/hccontrol.8 b/usr.sbin/bluetooth/hccontrol/hccontrol.8 index e04b1f01b427..1d6e519f6acc 100644 --- a/usr.sbin/bluetooth/hccontrol/hccontrol.8 +++ b/usr.sbin/bluetooth/hccontrol/hccontrol.8 @@ -209,8 +209,7 @@ hccontrol -n ubt0hci le_set_advertising_enable enable .Xr bluetooth 3 , .Xr netgraph 3 , .Xr netgraph 4 , -.Xr ng_hci 4 , -.Xr hcseriald 8 +.Xr ng_hci 4 .Sh AUTHORS .An Maksim Yevmenkin Aq Mt m_evmenkin@yahoo.com .Sh BUGS diff --git a/usr.sbin/bluetooth/hcsecd/hcsecd.8 b/usr.sbin/bluetooth/hcsecd/hcsecd.8 index a55e85e5ab8c..2550fa1a143e 100644 --- a/usr.sbin/bluetooth/hcsecd/hcsecd.8 +++ b/usr.sbin/bluetooth/hcsecd/hcsecd.8 @@ -117,8 +117,7 @@ Display usage message and exit. .Xr ng_btsocket 4 , .Xr ng_hci 4 , .Xr hcsecd.conf 5 , -.Xr hccontrol 8 , -.Xr hcseriald 8 +.Xr hccontrol 8 .Sh AUTHORS .An Maksim Yevmenkin Aq Mt m_evmenkin@yahoo.com .Sh BUGS diff --git a/usr.sbin/bluetooth/hcseriald/Makefile b/usr.sbin/bluetooth/hcseriald/Makefile deleted file mode 100644 index 8a0d422ee74a..000000000000 --- a/usr.sbin/bluetooth/hcseriald/Makefile +++ /dev/null @@ -1,11 +0,0 @@ -# $Id: Makefile,v 1.5 2003/08/14 20:06:21 max Exp $ -# $FreeBSD$ - -PACKAGE= bluetooth -PROG= hcseriald -MAN= hcseriald.8 -WARNS?= 2 - -LIBADD= netgraph - -.include diff --git a/usr.sbin/bluetooth/hcseriald/Makefile.depend b/usr.sbin/bluetooth/hcseriald/Makefile.depend deleted file mode 100644 index 3f4cb50e1709..000000000000 --- a/usr.sbin/bluetooth/hcseriald/Makefile.depend +++ /dev/null @@ -1,18 +0,0 @@ -# $FreeBSD$ -# Autogenerated - do NOT edit! - -DIRDEPS = \ - gnu/lib/csu \ - include \ - include/xlocale \ - lib/${CSU_DIR} \ - lib/libc \ - lib/libcompiler_rt \ - lib/libnetgraph \ - - -.include - -.if ${DEP_RELDIR} == ${_DEP_RELDIR} -# local dependencies - needed for -jN in clean tree -.endif diff --git a/usr.sbin/bluetooth/hcseriald/hcseriald.8 b/usr.sbin/bluetooth/hcseriald/hcseriald.8 deleted file mode 100644 index 15f08411f98d..000000000000 --- a/usr.sbin/bluetooth/hcseriald/hcseriald.8 +++ /dev/null @@ -1,86 +0,0 @@ -.\" Copyright (c) 2001-2002 Maksim Yevmenkin -.\" All rights reserved. -.\" -.\" Redistribution and use in source and binary forms, with or without -.\" modification, are permitted provided that the following conditions -.\" are met: -.\" 1. Redistributions of source code must retain the above copyright -.\" notice, this list of conditions and the following disclaimer. -.\" 2. Redistributions in binary form must reproduce the above copyright -.\" notice, this list of conditions and the following disclaimer in the -.\" documentation and/or other materials provided with the distribution. -.\" -.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND -.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE -.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -.\" SUCH DAMAGE. -.\" -.\" $Id: hcseriald.8,v 1.3 2003/05/21 00:47:26 max Exp $ -.\" $FreeBSD$ -.\" -.Dd June 14, 2002 -.Dt HCSERIALD 8 -.Os -.Sh NAME -.Nm hcseriald -.Nd supervise serial Bluetooth devices -.Sh SYNOPSIS -.Nm -.Op Fl dh -.Fl f Ar device -.Fl n Ar node_name -.Op Fl s Ar speed -.Sh DESCRIPTION -The -.Nm -utility handles serial Bluetooth devices. -It does one simple thing: -it opens the specified serial device, sets the device parameters, and pushes -the -.Dv H4 -line discipline. -.Pp -The options are as follows: -.Bl -tag -width indent -.It Fl d -Do not disassociate from the controlling terminal, i.e., run in foreground. -.It Fl f Ar device -Callout device name. -Example: -.Fl f Pa /dev/cuau0 . -.It Fl h -Display usage message and exit. -.It Fl n Ar node_name -Set H4 Netgraph node name. -Example: -.Fl n Li sio0 . -.It Fl s Ar speed -Set serial device speed to -.Ar speed . -Example: -.Fl s Li 115200 . -.El -.Sh FILES -.Bl -tag -width ".Pa /var/run/hcserial. Ns Ar * Ns Pa .pid" -compact -.It Pa /var/run/hcserial . Ns Ar * Ns Pa .pid -Process ID of the currently running -.Nm -daemon. -Where -.Ar * -is an H4 Netgraph node name. -.El -.Sh SEE ALSO -.Xr ng_h4 4 , -.Xr ng_hci 4 , -.Xr tty 4 , -.Xr hccontrol 8 -.Sh AUTHORS -.An Maksim Yevmenkin Aq Mt m_evmenkin@yahoo.com diff --git a/usr.sbin/bluetooth/hcseriald/hcseriald.c b/usr.sbin/bluetooth/hcseriald/hcseriald.c deleted file mode 100644 index e019d52618b8..000000000000 --- a/usr.sbin/bluetooth/hcseriald/hcseriald.c +++ /dev/null @@ -1,269 +0,0 @@ -/*- - * hcseriald.c - * - * SPDX-License-Identifier: BSD-2-Clause-FreeBSD - * - * Copyright (c) 2001-2002 Maksim Yevmenkin - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * $Id: hcseriald.c,v 1.3 2003/05/21 22:40:32 max Exp $ - * $FreeBSD$ - */ - -#include -#include - -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -/* Prototypes */ -static int open_device (char const *, speed_t, char const *); -static void sighandler (int); -static void usage (); - -static char const * const hcseriald = "hcseriald"; -static int done = 0; - -int -main(int argc, char *argv[]) -{ - char *device = NULL, *name = NULL; - speed_t speed = 115200; - int n, detach = 1; - char p[FILENAME_MAX]; - FILE *f = NULL; - struct sigaction sa; - - /* Process command line arguments */ - while ((n = getopt(argc, argv, "df:n:s:h")) != -1) { - switch (n) { - case 'd': - detach = 0; - break; - - case 'f': - device = optarg; - break; - - case 'n': - name = optarg; - break; - - case 's': - speed = atoi(optarg); - if (speed < 0) - usage(argv[0]); - break; - - case 'h': - default: - usage(argv[0]); - break; - } - } - - if (device == NULL || name == NULL) - usage(argv[0]); - - openlog(hcseriald, LOG_PID | LOG_NDELAY, LOG_USER); - - /* Open device */ - n = open_device(device, speed, name); - - if (detach && daemon(0, 0) < 0) { - syslog(LOG_ERR, "Could not daemon(0, 0). %s (%d)", - strerror(errno), errno); - exit(1); - } - - /* Write PID file */ - snprintf(p, sizeof(p), "/var/run/%s.%s.pid", hcseriald, name); - f = fopen(p, "w"); - if (f == NULL) { - syslog(LOG_ERR, "Could not fopen(%s). %s (%d)", - p, strerror(errno), errno); - exit(1); - } - fprintf(f, "%d", getpid()); - fclose(f); - - /* Install signal handler */ - memset(&sa, 0, sizeof(sa)); - sa.sa_handler = sighandler; - - if (sigaction(SIGTERM, &sa, NULL) < 0) { - syslog(LOG_ERR, "Could not sigaction(SIGTERM). %s (%d)", - strerror(errno), errno); - exit(1); - } - - if (sigaction(SIGHUP, &sa, NULL) < 0) { - syslog(LOG_ERR, "Could not sigaction(SIGHUP). %s (%d)", - strerror(errno), errno); - exit(1); - } - - if (sigaction(SIGINT, &sa, NULL) < 0) { - syslog(LOG_ERR, "Could not sigaction(SIGINT). %s (%d)", - strerror(errno), errno); - exit(1); - } - - /* Keep running */ - while (!done) - select(0, NULL, NULL, NULL, NULL); - - /* Remove PID file and close device */ - unlink(p); - close(n); - closelog(); - - return (0); -} /* main */ - -/* Open terminal, set settings, push H4 line discipline and set node name */ -static int -open_device(char const *device, speed_t speed, char const *name) -{ - int fd, disc, cs, ds; - struct termios t; - struct nodeinfo ni; - struct ngm_name n; - char p[NG_NODESIZ]; - - /* Open terminal device and setup H4 line discipline */ - fd = open(device, O_RDWR|O_NOCTTY); - if (fd < 0) { - syslog(LOG_ERR, "Could not open(%s). %s (%d)", - device, strerror(errno), errno); - exit(1); - } - - tcflush(fd, TCIOFLUSH); - - if (tcgetattr(fd, &t) < 0) { - syslog(LOG_ERR, "Could not tcgetattr(%s). %s (%d)", - device, strerror(errno), errno); - exit(1); - } - - cfmakeraw(&t); - - t.c_cflag |= CLOCAL; /* clocal */ - t.c_cflag &= ~CSIZE; /* cs8 */ - t.c_cflag |= CS8; /* cs8 */ - t.c_cflag &= ~PARENB; /* -parenb */ - t.c_cflag &= ~CSTOPB; /* -cstopb */ - t.c_cflag |= CRTSCTS; /* crtscts */ - - if (tcsetattr(fd, TCSANOW, &t) < 0) { - syslog(LOG_ERR, "Could not tcsetattr(%s). %s (%d)", - device, strerror(errno), errno); - exit(1); - } - - tcflush(fd, TCIOFLUSH); - - if (cfsetspeed(&t, speed) < 0) { - syslog(LOG_ERR, "Could not cfsetspeed(%s). %s (%d)", - device, strerror(errno), errno); - exit(1); - } - - if (tcsetattr(fd, TCSANOW, &t) < 0) { - syslog(LOG_ERR, "Could not tcsetattr(%s). %s (%d)", - device, strerror(errno), errno); - exit(1); - } - - disc = H4DISC; - if (ioctl(fd, TIOCSETD, &disc) < 0) { - syslog(LOG_ERR, "Could not ioctl(%s, TIOCSETD, %d). %s (%d)", - device, disc, strerror(errno), errno); - exit(1); - } - - /* Get default name of the Netgraph node */ - memset(&ni, 0, sizeof(ni)); - if (ioctl(fd, NGIOCGINFO, &ni) < 0) { - syslog(LOG_ERR, "Could not ioctl(%d, NGIOGINFO). %s (%d)", - fd, strerror(errno), errno); - exit(1); - } - - /* Assign new name to the Netgraph node */ - snprintf(p, sizeof(p), "%s:", ni.name); - snprintf(n.name, sizeof(n.name), "%s", name); - - if (NgMkSockNode(NULL, &cs, &ds) < 0) { - syslog(LOG_ERR, "Could not NgMkSockNode(). %s (%d)", - strerror(errno), errno); - exit(1); - } - - if (NgSendMsg(cs, p, NGM_GENERIC_COOKIE, NGM_NAME, &n, sizeof(n)) < 0) { - syslog(LOG_ERR, "Could not NgSendMsg(%d, %s, NGM_NAME, %s). " \ - "%s (%d)", cs, p, n.name, strerror(errno), errno); - exit(1); - } - - close(cs); - close(ds); - - return (fd); -} /* open_device */ - -/* Signal handler */ -static void -sighandler(int s) -{ - done = 1; -} /* sighandler */ - -/* Usage */ -static void -usage(void) -{ - fprintf(stderr, "Usage: %s -f device -n node_name [-s speed -d -h]\n" \ - "Where:\n" \ - "\t-f device tty device name, ex. /dev/cuau1\n" \ - "\t-n node_name set Netgraph node name to node_name\n" \ - "\t-s speed set tty speed, ex. 115200\n" \ - "\t-d run in foreground\n" \ - "\t-h display this message\n", - hcseriald); - exit(255); -} /* usage */ - From owner-dev-commits-src-main@freebsd.org Thu Sep 30 04:03:47 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 73E826A9D4E; Thu, 30 Sep 2021 04:03:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HKfkC2m1cz4TxX; Thu, 30 Sep 2021 04:03:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3ECAD24DD9; Thu, 30 Sep 2021 04:03:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18U43l0N053711; Thu, 30 Sep 2021 04:03:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18U43lQ9053710; Thu, 30 Sep 2021 04:03:47 GMT (envelope-from git) Date: Thu, 30 Sep 2021 04:03:47 GMT Message-Id: <202109300403.18U43lQ9053710@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 24ccef81405e - main - bluetooth: Remove stray btccc references MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 24ccef81405eb25efc65f16b6e9a787f3a51151a Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Sep 2021 04:03:47 -0000 The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=24ccef81405eb25efc65f16b6e9a787f3a51151a commit 24ccef81405eb25efc65f16b6e9a787f3a51151a Author: Warner Losh AuthorDate: 2021-09-30 03:58:27 +0000 Commit: Warner Losh CommitDate: 2021-09-30 03:58:27 +0000 bluetooth: Remove stray btccc references The 3com bluetooth PC Card adapter was removed from the tree when PC Card support was removed earlier this year. Remove stray references to it still in the tree. Sponsored by: Netflix --- lib/libbluetooth/hci.c | 1 - libexec/rc/rc.d/bluetooth | 4 ---- 2 files changed, 5 deletions(-) diff --git a/lib/libbluetooth/hci.c b/lib/libbluetooth/hci.c index 3a524cebc3ae..95e96c479157 100644 --- a/lib/libbluetooth/hci.c +++ b/lib/libbluetooth/hci.c @@ -762,7 +762,6 @@ static char * bt_dev2node(char const *devname, char *nodename, int nnlen) { static char const * bt_dev_prefix[] = { - "btccc", /* 3Com Bluetooth PC-CARD */ "h4", /* UART/serial Bluetooth devices */ "ubt", /* Bluetooth USB devices */ NULL /* should be last */ diff --git a/libexec/rc/rc.d/bluetooth b/libexec/rc/rc.d/bluetooth index b89a2c328048..ca83792ab96c 100755 --- a/libexec/rc/rc.d/bluetooth +++ b/libexec/rc/rc.d/bluetooth @@ -296,10 +296,6 @@ bluetooth_stop() # Try to figure out device type by looking at device name case "${dev}" in - # 3Com Bluetooth Adapter 3CRWB60-A - btccc*) - ;; - # USB Bluetooth adapters ubt*) ;; From owner-dev-commits-src-main@freebsd.org Thu Sep 30 04:03:48 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B54756A9BDF; Thu, 30 Sep 2021 04:03:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HKfkD4DLwz4TkM; Thu, 30 Sep 2021 04:03:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 610E9249F7; Thu, 30 Sep 2021 04:03:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18U43mbx053735; Thu, 30 Sep 2021 04:03:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18U43mo8053734; Thu, 30 Sep 2021 04:03:48 GMT (envelope-from git) Date: Thu, 30 Sep 2021 04:03:48 GMT Message-Id: <202109300403.18U43mo8053734@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 5547ed2cb2bd - main - bluetooth: Remove one more h4 reference. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5547ed2cb2bdc0c8b35d50b59a10807d5e4ec4b9 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Sep 2021 04:03:48 -0000 The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=5547ed2cb2bdc0c8b35d50b59a10807d5e4ec4b9 commit 5547ed2cb2bdc0c8b35d50b59a10807d5e4ec4b9 Author: Warner Losh AuthorDate: 2021-09-30 04:02:25 +0000 Commit: Warner Losh CommitDate: 2021-09-30 04:02:25 +0000 bluetooth: Remove one more h4 reference. Sponsored by: Netflix --- lib/libbluetooth/hci.c | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/libbluetooth/hci.c b/lib/libbluetooth/hci.c index 95e96c479157..b4ee0a9069e4 100644 --- a/lib/libbluetooth/hci.c +++ b/lib/libbluetooth/hci.c @@ -762,7 +762,6 @@ static char * bt_dev2node(char const *devname, char *nodename, int nnlen) { static char const * bt_dev_prefix[] = { - "h4", /* UART/serial Bluetooth devices */ "ubt", /* Bluetooth USB devices */ NULL /* should be last */ }; From owner-dev-commits-src-main@freebsd.org Thu Sep 30 04:10:53 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 99C506AA2BA; Thu, 30 Sep 2021 04:10:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HKftP3n6Cz4Vwn; Thu, 30 Sep 2021 04:10:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5DA6124DE5; Thu, 30 Sep 2021 04:10:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18U4ArJU063283; Thu, 30 Sep 2021 04:10:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18U4ArWx063282; Thu, 30 Sep 2021 04:10:53 GMT (envelope-from git) Date: Thu, 30 Sep 2021 04:10:53 GMT Message-Id: <202109300410.18U4ArWx063282@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kyle Evans Subject: git: 6caae81d93e2 - main - modules: netflow: need opt_inet.h MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevans X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 6caae81d93e2a14fa42cb831506c3a60c25d9791 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Sep 2021 04:10:53 -0000 The branch main has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=6caae81d93e2a14fa42cb831506c3a60c25d9791 commit 6caae81d93e2a14fa42cb831506c3a60c25d9791 Author: Kyle Evans AuthorDate: 2021-09-30 04:04:18 +0000 Commit: Kyle Evans CommitDate: 2021-09-30 04:09:43 +0000 modules: netflow: need opt_inet.h This fixes the standalone build. --- sys/modules/netgraph/netflow/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/modules/netgraph/netflow/Makefile b/sys/modules/netgraph/netflow/Makefile index 365c99b3ddbe..35e8e6db7f36 100644 --- a/sys/modules/netgraph/netflow/Makefile +++ b/sys/modules/netgraph/netflow/Makefile @@ -6,6 +6,6 @@ .PATH: ${SRCTOP}/sys/netgraph/netflow KMOD= ng_netflow -SRCS= ng_netflow.c netflow.c netflow_v9.c opt_inet6.h opt_route.h +SRCS= ng_netflow.c netflow.c netflow_v9.c opt_inet.h opt_inet6.h opt_route.h .include From owner-dev-commits-src-main@freebsd.org Thu Sep 30 04:10:52 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 703966A9EF6; Thu, 30 Sep 2021 04:10:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HKftN2bqjz4VcL; Thu, 30 Sep 2021 04:10:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 38F542509C; Thu, 30 Sep 2021 04:10:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18U4AqYM062534; Thu, 30 Sep 2021 04:10:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18U4AqTi062533; Thu, 30 Sep 2021 04:10:52 GMT (envelope-from git) Date: Thu, 30 Sep 2021 04:10:52 GMT Message-Id: <202109300410.18U4AqTi062533@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kyle Evans Subject: git: 58ca99d11648 - main - modules: acpi_video: need opt_evdev.h MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevans X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 58ca99d11648f0b1749a4b29f534e87b0d88b83a Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Sep 2021 04:10:52 -0000 The branch main has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=58ca99d11648f0b1749a4b29f534e87b0d88b83a commit 58ca99d11648f0b1749a4b29f534e87b0d88b83a Author: Kyle Evans AuthorDate: 2021-09-30 04:04:00 +0000 Commit: Kyle Evans CommitDate: 2021-09-30 04:08:25 +0000 modules: acpi_video: need opt_evdev.h This fixes the standalone build. --- sys/modules/acpi/acpi_video/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/modules/acpi/acpi_video/Makefile b/sys/modules/acpi/acpi_video/Makefile index 803598144a9a..d2556c8a56dc 100644 --- a/sys/modules/acpi/acpi_video/Makefile +++ b/sys/modules/acpi/acpi_video/Makefile @@ -4,6 +4,6 @@ KMOD= acpi_video SRCS= acpi_video.c -SRCS+= opt_acpi.h acpi_if.h bus_if.h device_if.h +SRCS+= opt_acpi.h opt_evdev.h acpi_if.h bus_if.h device_if.h .include From owner-dev-commits-src-main@freebsd.org Thu Sep 30 04:10:56 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5FC0C6AA168; Thu, 30 Sep 2021 04:10:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HKftR6sf0z4Vk3; Thu, 30 Sep 2021 04:10:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C4A8025123; Thu, 30 Sep 2021 04:10:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18U4Atlr063331; Thu, 30 Sep 2021 04:10:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18U4AtDR063330; Thu, 30 Sep 2021 04:10:55 GMT (envelope-from git) Date: Thu, 30 Sep 2021 04:10:55 GMT Message-Id: <202109300410.18U4AtDR063330@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kyle Evans Subject: git: a335f76f2a40 - main - modules: a lot: need opt_kern_tls.h MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevans X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a335f76f2a40a248df01e22422b84d707bfcc4a9 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Sep 2021 04:10:56 -0000 The branch main has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=a335f76f2a40a248df01e22422b84d707bfcc4a9 commit a335f76f2a40a248df01e22422b84d707bfcc4a9 Author: Kyle Evans AuthorDate: 2021-09-30 04:07:17 +0000 Commit: Kyle Evans CommitDate: 2021-09-30 04:10:31 +0000 modules: a lot: need opt_kern_tls.h This fixes the standalone build. --- sys/modules/cc/cc_cdg/Makefile | 2 +- sys/modules/cc/cc_chd/Makefile | 2 +- sys/modules/cc/cc_dctcp/Makefile | 2 +- sys/modules/cc/cc_hd/Makefile | 2 +- sys/modules/cc/cc_htcp/Makefile | 2 +- sys/modules/cc/cc_vegas/Makefile | 2 +- sys/modules/cxgbe/cxgbei/Makefile | 1 + sys/modules/cxgbe/iw_cxgbe/Makefile | 2 +- sys/modules/ipfilter/Makefile | 2 +- sys/modules/ipfw/Makefile | 2 +- sys/modules/ipsec/Makefile | 2 +- sys/modules/khelp/h_ertt/Makefile | 2 +- sys/modules/nfscommon/Makefile | 1 + sys/modules/pf/Makefile | 3 ++- sys/modules/sctp/Makefile | 3 ++- sys/modules/siftr/Makefile | 2 +- sys/modules/tcp/tcpmd5/Makefile | 2 +- sys/modules/toecore/Makefile | 2 +- 18 files changed, 20 insertions(+), 16 deletions(-) diff --git a/sys/modules/cc/cc_cdg/Makefile b/sys/modules/cc/cc_cdg/Makefile index 83a4887af705..4e69e2d803a4 100644 --- a/sys/modules/cc/cc_cdg/Makefile +++ b/sys/modules/cc/cc_cdg/Makefile @@ -2,6 +2,6 @@ .PATH: ${SRCTOP}/sys/netinet/cc KMOD= cc_cdg -SRCS= cc_cdg.c +SRCS= cc_cdg.c opt_kern_tls.h .include diff --git a/sys/modules/cc/cc_chd/Makefile b/sys/modules/cc/cc_chd/Makefile index db7e350d49fc..02242094860a 100644 --- a/sys/modules/cc/cc_chd/Makefile +++ b/sys/modules/cc/cc_chd/Makefile @@ -2,6 +2,6 @@ .PATH: ${SRCTOP}/sys/netinet/cc KMOD= cc_chd -SRCS= cc_chd.c +SRCS= cc_chd.c opt_kern_tls.h .include diff --git a/sys/modules/cc/cc_dctcp/Makefile b/sys/modules/cc/cc_dctcp/Makefile index cb6cb06682ef..73712583ff8b 100644 --- a/sys/modules/cc/cc_dctcp/Makefile +++ b/sys/modules/cc/cc_dctcp/Makefile @@ -2,6 +2,6 @@ .PATH: ${SRCTOP}/sys/netinet/cc KMOD= cc_dctcp -SRCS= cc_dctcp.c +SRCS= cc_dctcp.c opt_kern_tls.h .include diff --git a/sys/modules/cc/cc_hd/Makefile b/sys/modules/cc/cc_hd/Makefile index 49c0dfce84e0..9ff5ee3c4594 100644 --- a/sys/modules/cc/cc_hd/Makefile +++ b/sys/modules/cc/cc_hd/Makefile @@ -2,6 +2,6 @@ .PATH: ${SRCTOP}/sys/netinet/cc KMOD= cc_hd -SRCS= cc_hd.c +SRCS= cc_hd.c opt_kern_tls.h .include diff --git a/sys/modules/cc/cc_htcp/Makefile b/sys/modules/cc/cc_htcp/Makefile index 99f3f8f8f99d..3256bc6d9445 100644 --- a/sys/modules/cc/cc_htcp/Makefile +++ b/sys/modules/cc/cc_htcp/Makefile @@ -2,6 +2,6 @@ .PATH: ${SRCTOP}/sys/netinet/cc KMOD= cc_htcp -SRCS= cc_htcp.c +SRCS= cc_htcp.c opt_kern_tls.h .include diff --git a/sys/modules/cc/cc_vegas/Makefile b/sys/modules/cc/cc_vegas/Makefile index eda8ee62d88a..5e309c96ed5c 100644 --- a/sys/modules/cc/cc_vegas/Makefile +++ b/sys/modules/cc/cc_vegas/Makefile @@ -2,6 +2,6 @@ .PATH: ${SRCTOP}/sys/netinet/cc KMOD= cc_vegas -SRCS= cc_vegas.c +SRCS= cc_vegas.c opt_kern_tls.h .include diff --git a/sys/modules/cxgbe/cxgbei/Makefile b/sys/modules/cxgbe/cxgbei/Makefile index ecd92218c8ef..7b575e320b20 100644 --- a/sys/modules/cxgbe/cxgbei/Makefile +++ b/sys/modules/cxgbe/cxgbei/Makefile @@ -11,6 +11,7 @@ SRCS+= bus_if.h SRCS+= device_if.h SRCS+= opt_inet.h SRCS+= opt_inet6.h +SRCS+= opt_kern_tls.h SRCS+= pci_if.h SRCS+= opt_cam.h SRCS+= icl_conn_if.h diff --git a/sys/modules/cxgbe/iw_cxgbe/Makefile b/sys/modules/cxgbe/iw_cxgbe/Makefile index 69ac1a4de752..72631f585bc4 100644 --- a/sys/modules/cxgbe/iw_cxgbe/Makefile +++ b/sys/modules/cxgbe/iw_cxgbe/Makefile @@ -14,7 +14,7 @@ SRCS+= provider.c SRCS+= qp.c SRCS+= resource.c SRCS+= ${LINUXKPI_GENSRCS} -SRCS+= opt_inet.h opt_inet6.h opt_ktr.h opt_ofed.h +SRCS+= opt_inet.h opt_inet6.h opt_kern_tls.h opt_ktr.h opt_ofed.h CFLAGS+= -I${CXGBE} -I${SRCTOP}/sys/ofed/include -DLINUX_TYPES_DEFINED CFLAGS+= -I${SRCTOP}/sys/ofed/include/uapi diff --git a/sys/modules/ipfilter/Makefile b/sys/modules/ipfilter/Makefile index e8c8893bdf59..3c2ba2c74c08 100644 --- a/sys/modules/ipfilter/Makefile +++ b/sys/modules/ipfilter/Makefile @@ -7,7 +7,7 @@ SRCS= mlfk_ipl.c ip_nat.c ip_frag.c ip_state.c ip_proxy.c ip_auth.c \ ip_log.c ip_fil_freebsd.c fil.c ip_lookup.c ip_pool.c ip_htable.c \ ip_sync.c \ ip_nat6.c ip_rules.c ip_scan.c ip_dstlist.c radix_ipf.c -SRCS+= opt_bpf.h opt_inet6.h +SRCS+= opt_bpf.h opt_inet6.h opt_kern_tls.h CFLAGS+= -I${SRCTOP}/sys/contrib/ipfilter CFLAGS+= -DIPFILTER=1 -DIPFILTER_LKM -DIPFILTER_LOG -DIPFILTER_LOOKUP diff --git a/sys/modules/ipfw/Makefile b/sys/modules/ipfw/Makefile index ae1b597d08ce..274b1b1e6cf5 100644 --- a/sys/modules/ipfw/Makefile +++ b/sys/modules/ipfw/Makefile @@ -7,7 +7,7 @@ SRCS= ip_fw2.c ip_fw_pfil.c ip_fw_bpf.c SRCS+= ip_fw_dynamic.c ip_fw_log.c ip_fw_eaction.c SRCS+= ip_fw_sockopt.c ip_fw_table.c ip_fw_table_algo.c ip_fw_iface.c SRCS+= ip_fw_table_value.c -SRCS+= opt_inet.h opt_inet6.h opt_ipdivert.h opt_ipfw.h +SRCS+= opt_inet.h opt_inet6.h opt_ipdivert.h opt_ipfw.h opt_kern_tls.h CFLAGS+= -DIPFIREWALL -I${SRCTOP}/sys/contrib/ck/include # diff --git a/sys/modules/ipsec/Makefile b/sys/modules/ipsec/Makefile index 46472f910d16..8bc9f47bd99a 100644 --- a/sys/modules/ipsec/Makefile +++ b/sys/modules/ipsec/Makefile @@ -5,7 +5,7 @@ KMOD= ipsec SRCS= if_ipsec.c ipsec.c ipsec_input.c ipsec_mbuf.c ipsec_mod.c \ ipsec_output.c xform_ah.c xform_esp.c xform_ipcomp.c \ - opt_inet.h opt_inet6.h opt_ipsec.h opt_sctp.h + opt_inet.h opt_inet6.h opt_ipsec.h opt_kern_tls.h opt_sctp.h SRCS.INET= udpencap.c .include diff --git a/sys/modules/khelp/h_ertt/Makefile b/sys/modules/khelp/h_ertt/Makefile index fa58264c3190..e63154ea248f 100644 --- a/sys/modules/khelp/h_ertt/Makefile +++ b/sys/modules/khelp/h_ertt/Makefile @@ -2,6 +2,6 @@ .PATH: ${SRCTOP}/sys/netinet/khelp KMOD= h_ertt -SRCS= h_ertt.c +SRCS= h_ertt.c opt_kern_tls.h .include diff --git a/sys/modules/nfscommon/Makefile b/sys/modules/nfscommon/Makefile index 28d658db75fa..cc2d48c1b1bc 100644 --- a/sys/modules/nfscommon/Makefile +++ b/sys/modules/nfscommon/Makefile @@ -9,6 +9,7 @@ SRCS= vnode_if.h \ nfs_commonsubs.c \ opt_inet.h \ opt_inet6.h \ + opt_kern_tls.h \ opt_kgssapi.h \ opt_nfs.h \ opt_ufs.h diff --git a/sys/modules/pf/Makefile b/sys/modules/pf/Makefile index d361ea0802fb..fbf5e0cbfa89 100644 --- a/sys/modules/pf/Makefile +++ b/sys/modules/pf/Makefile @@ -6,7 +6,8 @@ KMOD= pf SRCS= pf.c pf_if.c pf_lb.c pf_osfp.c pf_ioctl.c pf_norm.c pf_table.c \ pf_ruleset.c pf_nv.c pf_syncookies.c in4_cksum.c \ bus_if.h device_if.h \ - opt_pf.h opt_inet.h opt_inet6.h opt_bpf.h opt_sctp.h opt_global.h + opt_pf.h opt_inet.h opt_inet6.h opt_bpf.h opt_sctp.h opt_global.h \ + opt_kern_tls.h .if !defined(KERNBUILDDIR) # pflog can be loaded as a module, have the additional checks turned on diff --git a/sys/modules/sctp/Makefile b/sys/modules/sctp/Makefile index 1896c22dd833..925f6ef5fdfb 100644 --- a/sys/modules/sctp/Makefile +++ b/sys/modules/sctp/Makefile @@ -25,6 +25,7 @@ SRCS= sctp_asconf.c \ sctputil.c SRCS+= device_if.h bus_if.h vnode_if.h -SRCS+= opt_capsicum.h opt_ktrace.h opt_inet.h opt_inet6.h opt_sctp.h +SRCS+= opt_capsicum.h opt_ktrace.h opt_inet.h opt_inet6.h opt_kern_tls.h \ + opt_sctp.h .include diff --git a/sys/modules/siftr/Makefile b/sys/modules/siftr/Makefile index bb92bb2ac4c5..eac884ae6bab 100644 --- a/sys/modules/siftr/Makefile +++ b/sys/modules/siftr/Makefile @@ -2,7 +2,7 @@ .PATH: ${SRCTOP}/sys/netinet KMOD= siftr -SRCS= siftr.c +SRCS= siftr.c opt_kern_tls.h # Uncomment to add IPv6 support #CFLAGS+=-DSIFTR_IPV6 diff --git a/sys/modules/tcp/tcpmd5/Makefile b/sys/modules/tcp/tcpmd5/Makefile index e2d96195d806..0a10caea6845 100644 --- a/sys/modules/tcp/tcpmd5/Makefile +++ b/sys/modules/tcp/tcpmd5/Makefile @@ -3,6 +3,6 @@ .PATH: ${SRCTOP}/sys/netipsec KMOD= tcpmd5 -SRCS= xform_tcp.c opt_inet.h opt_inet6.h opt_ipsec.h +SRCS= xform_tcp.c opt_inet.h opt_inet6.h opt_ipsec.h opt_kern_tls.h .include diff --git a/sys/modules/toecore/Makefile b/sys/modules/toecore/Makefile index d3bf3b820da3..48a311c38ebf 100644 --- a/sys/modules/toecore/Makefile +++ b/sys/modules/toecore/Makefile @@ -4,6 +4,6 @@ KMOD= toecore SRCS= toecore.c -SRCS+= opt_ofed.h opt_inet.h opt_inet6.h +SRCS+= opt_ofed.h opt_inet.h opt_inet6.h opt_kern_tls.h .include From owner-dev-commits-src-main@freebsd.org Thu Sep 30 04:10:54 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DE6C56AA2C0; Thu, 30 Sep 2021 04:10:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HKftQ5cLWz4Vwv; Thu, 30 Sep 2021 04:10:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8A16324F5F; Thu, 30 Sep 2021 04:10:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18U4Assd063307; Thu, 30 Sep 2021 04:10:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18U4AsML063306; Thu, 30 Sep 2021 04:10:54 GMT (envelope-from git) Date: Thu, 30 Sep 2021 04:10:54 GMT Message-Id: <202109300410.18U4AsML063306@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kyle Evans Subject: git: 1d8c9d3c0c55 - main - modules: p2sb: need opt_platform.h MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevans X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 1d8c9d3c0c5574d4da868d37db4c32d833a7a59c Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Sep 2021 04:10:55 -0000 The branch main has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=1d8c9d3c0c5574d4da868d37db4c32d833a7a59c commit 1d8c9d3c0c5574d4da868d37db4c32d833a7a59c Author: Kyle Evans AuthorDate: 2021-09-30 04:04:52 +0000 Commit: Kyle Evans CommitDate: 2021-09-30 04:09:45 +0000 modules: p2sb: need opt_platform.h This fixes the standalone build. --- sys/modules/p2sb/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/modules/p2sb/Makefile b/sys/modules/p2sb/Makefile index 8f4d604f73d5..8dc643240d27 100644 --- a/sys/modules/p2sb/Makefile +++ b/sys/modules/p2sb/Makefile @@ -2,6 +2,6 @@ KMOD= p2sb SRCS= p2sb.c lewisburg_gpio.c lewisburg_gpiocm.c -SRCS+= device_if.h bus_if.h pci_if.h gpio_if.h +SRCS+= device_if.h bus_if.h pci_if.h gpio_if.h opt_platform.h .include From owner-dev-commits-src-main@freebsd.org Thu Sep 30 04:10:57 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9BB456AA31C; Thu, 30 Sep 2021 04:10:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HKftT0327z4Vx4; Thu, 30 Sep 2021 04:10:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D309D2509E; Thu, 30 Sep 2021 04:10:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18U4AuA2063355; Thu, 30 Sep 2021 04:10:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18U4AuxU063354; Thu, 30 Sep 2021 04:10:56 GMT (envelope-from git) Date: Thu, 30 Sep 2021 04:10:56 GMT Message-Id: <202109300410.18U4AuxU063354@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kyle Evans Subject: git: 335c4f8edb3a - main - modules: iichid: needs opt_acpi.h MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevans X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 335c4f8edb3a02ea101b0f833c22182594e63c9e Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Sep 2021 04:10:57 -0000 The branch main has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=335c4f8edb3a02ea101b0f833c22182594e63c9e commit 335c4f8edb3a02ea101b0f833c22182594e63c9e Author: Kyle Evans AuthorDate: 2021-09-30 03:47:15 +0000 Commit: Kyle Evans CommitDate: 2021-09-30 04:10:35 +0000 modules: iichid: needs opt_acpi.h This fixes the standalone build. --- sys/modules/i2c/iichid/Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/modules/i2c/iichid/Makefile b/sys/modules/i2c/iichid/Makefile index 36cdb3127088..a6affe1d76fc 100644 --- a/sys/modules/i2c/iichid/Makefile +++ b/sys/modules/i2c/iichid/Makefile @@ -3,6 +3,7 @@ .PATH: ${SRCTOP}/sys/dev/iicbus KMOD = iichid SRCS = iichid.c -SRCS += acpi_if.h bus_if.h device_if.h hid_if.h iicbus_if.h opt_hid.h +SRCS += acpi_if.h bus_if.h device_if.h hid_if.h iicbus_if.h +SRCS += opt_acpi.h opt_hid.h .include From owner-dev-commits-src-main@freebsd.org Thu Sep 30 07:48:14 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id ACDE46AD176; Thu, 30 Sep 2021 07:48:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HKljB4GmNz4mjs; Thu, 30 Sep 2021 07:48:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 727EF118; Thu, 30 Sep 2021 07:48:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18U7mEfV046434; Thu, 30 Sep 2021 07:48:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18U7mEjY046433; Thu, 30 Sep 2021 07:48:14 GMT (envelope-from git) Date: Thu, 30 Sep 2021 07:48:14 GMT Message-Id: <202109300748.18U7mEjY046433@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ram Kishore Vegesna Subject: git: 3bf42363b02c - main - ocs_fc: Emulex Gen 7 HBA support. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ram X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3bf42363b02c9bd728c92b9d9c4a5d022982a21a Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Sep 2021 07:48:14 -0000 The branch main has been updated by ram: URL: https://cgit.FreeBSD.org/src/commit/?id=3bf42363b02c9bd728c92b9d9c4a5d022982a21a commit 3bf42363b02c9bd728c92b9d9c4a5d022982a21a Author: Ram Kishore Vegesna AuthorDate: 2021-09-23 06:51:26 +0000 Commit: Ram Kishore Vegesna CommitDate: 2021-09-30 07:31:15 +0000 ocs_fc: Emulex Gen 7 HBA support. Emulex Gen7 adapter support in ocs_fc driver. Reviewed by: mav, ken --- sys/dev/ocs_fc/ocs_hw.c | 10 ++- sys/dev/ocs_fc/ocs_os.h | 10 ++- sys/dev/ocs_fc/ocs_pci.c | 63 +++++++++++++-- sys/dev/ocs_fc/sli4.c | 200 +++++++++++++++++++++++++++++++++++++---------- sys/dev/ocs_fc/sli4.h | 80 ++++++++++++++++--- 5 files changed, 296 insertions(+), 67 deletions(-) diff --git a/sys/dev/ocs_fc/ocs_hw.c b/sys/dev/ocs_fc/ocs_hw.c index aa7d5857d9d9..c14b7a97fd97 100644 --- a/sys/dev/ocs_fc/ocs_hw.c +++ b/sys/dev/ocs_fc/ocs_hw.c @@ -272,7 +272,8 @@ ocs_hw_read_max_dump_size(ocs_hw_t *hw) int rc; /* lancer only */ - if (SLI4_IF_TYPE_LANCER_FC_ETH != sli_get_if_type(&hw->sli)) { + if ((SLI4_IF_TYPE_LANCER_FC_ETH != sli_get_if_type(&hw->sli)) && + (SLI4_IF_TYPE_LANCER_G7 != sli_get_if_type(&hw->sli))) { ocs_log_debug(hw->os, "Function only supported for I/F type 2\n"); return OCS_HW_RTN_ERROR; } @@ -414,7 +415,9 @@ ocs_hw_setup(ocs_hw_t *hw, ocs_os_handle_t os, sli4_port_type_e port_type) } /* Must be done after the workaround setup */ - if (SLI4_IF_TYPE_LANCER_FC_ETH == sli_get_if_type(&hw->sli)) { + if ((SLI4_IF_TYPE_LANCER_FC_ETH == sli_get_if_type(&hw->sli)) || + (SLI4_IF_TYPE_LANCER_G7 == sli_get_if_type(&hw->sli))) { + (void)ocs_hw_read_max_dump_size(hw); } @@ -6001,7 +6004,8 @@ ocs_hw_get_linkcfg(ocs_hw_t *hw, uint32_t opts, ocs_hw_port_control_cb_t cb, voi return OCS_HW_RTN_ERROR; } - if (SLI4_IF_TYPE_LANCER_FC_ETH == sli_get_if_type(&hw->sli)) { + if ((SLI4_IF_TYPE_LANCER_FC_ETH == sli_get_if_type(&hw->sli)) || + (SLI4_IF_TYPE_LANCER_G7 == sli_get_if_type(&hw->sli))){ return ocs_hw_get_linkcfg_lancer(hw, opts, cb, arg); } else if ((SLI4_IF_TYPE_BE3_SKH_PF == sli_get_if_type(&hw->sli)) || (SLI4_IF_TYPE_BE3_SKH_VF == sli_get_if_type(&hw->sli))) { diff --git a/sys/dev/ocs_fc/ocs_os.h b/sys/dev/ocs_fc/ocs_os.h index 5e36cca3b829..ae10b00cb465 100644 --- a/sys/dev/ocs_fc/ocs_os.h +++ b/sys/dev/ocs_fc/ocs_os.h @@ -1031,14 +1031,16 @@ typedef struct ocs_pci_reg_s { #define PCI_MAX_BAR 6 #define PCI_64BIT_BAR0 0 -#define PCI_VENDOR_EMULEX 0x10df /* Emulex */ +#define PCI_VENDOR_EMULEX 0x10df /* Emulex */ -#define PCI_PRODUCT_EMULEX_OCE16001 0xe200 /* OneCore 16Gb FC (lancer) */ -#define PCI_PRODUCT_EMULEX_OCE16002 0xe200 /* OneCore 16Gb FC (lancer) */ +#define PCI_PRODUCT_EMULEX_OCE16001 0xe200 /* OneCore 16Gb FC (lancer) */ +#define PCI_PRODUCT_EMULEX_OCE16002 0xe200 /* OneCore 16Gb FC (lancer) */ #define PCI_PRODUCT_EMULEX_LPE31004 0xe300 /* LightPulse 16Gb x 4 FC (lancer-g6) */ #define PCI_PRODUCT_EMULEX_LPE32002 0xe300 /* LightPulse 32Gb x 2 FC (lancer-g6) */ +#define PCI_PRODUCT_EMULEX_LANCER_G7 0xf400 /* LightPulse 32Gb x 4 FC (lancer-g7) */ + #define PCI_PRODUCT_EMULEX_OCE1600_VF 0xe208 -#define PCI_PRODUCT_EMULEX_OCE50102 0xe260 /* OneCore FCoE (lancer) */ +#define PCI_PRODUCT_EMULEX_OCE50102 0xe260 /* OneCore FCoE (lancer) */ #define PCI_PRODUCT_EMULEX_OCE50102_VF 0xe268 /** diff --git a/sys/dev/ocs_fc/ocs_pci.c b/sys/dev/ocs_fc/ocs_pci.c index f7e67b9bd047..8714c242a212 100644 --- a/sys/dev/ocs_fc/ocs_pci.c +++ b/sys/dev/ocs_fc/ocs_pci.c @@ -102,6 +102,9 @@ ocs_pci_probe(device_t dev) case PCI_PRODUCT_EMULEX_OCE50102: desc = "Emulex LightPulse 10GbE FCoE/NIC Adapter"; break; + case PCI_PRODUCT_EMULEX_LANCER_G7: + desc = "Emulex LightPulse G7 FC Adapter"; + break; default: return ENXIO; } @@ -112,9 +115,50 @@ ocs_pci_probe(device_t dev) } static int -ocs_map_bars(device_t dev, struct ocs_softc *ocs) +ocs_map_g7_bars(device_t dev, struct ocs_softc *ocs) { + int i, r; + uint32_t val = 0; + + for (i = 0, r = 0; i < PCI_MAX_BAR; i++) { + val = pci_read_config(dev, PCIR_BAR(i), 4); + if (!PCI_BAR_MEM(val)) { + continue; + } + if (!(val & PCIM_BAR_MEM_BASE)) { + /* no address */ + continue; + } + ocs->reg[r].rid = PCIR_BAR(i); + ocs->reg[r].res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, + &ocs->reg[r].rid, RF_ACTIVE); + if (ocs->reg[r].res) { + ocs->reg[r].btag = rman_get_bustag(ocs->reg[r].res); + ocs->reg[r].bhandle = rman_get_bushandle(ocs->reg[r].res); + r++; + } else { + device_printf(dev, "bus_alloc_resource failed rid=%#x\n", + ocs->reg[r].rid); + ocs_release_bus(ocs); + return ENXIO; + } + + /* + * If the 64-bit attribute is set, both this BAR and the + * next form the complete address. Skip processing the + * next BAR. + */ + if (val & PCIM_BAR_MEM_64) { + i++; + } + } + return 0; +} + +static int +ocs_map_bars(device_t dev, struct ocs_softc *ocs) +{ /* * Map PCI BAR0 register into the CPU's space. */ @@ -401,7 +445,7 @@ ocs_device_attach(ocs_t *ocs) goto fail_intr_setup; } - if(ocs_cam_attach(ocs)) { + if (ocs_cam_attach(ocs)) { device_printf(ocs->dev, "cam attach failed \n"); goto fail_intr_setup; } @@ -489,10 +533,17 @@ ocs_pci_attach(device_t dev) pci_get_bus(dev), pci_get_slot(dev), pci_get_function(dev)); /* Map all memory BARs */ - if (ocs_map_bars(dev, ocs)) { - device_printf(dev, "Failed to map pci bars\n"); - goto release_bus; - } + if (ocs->pci_device == PCI_PRODUCT_EMULEX_LANCER_G7) { + if(ocs_map_g7_bars(dev,ocs)) { + device_printf(dev, "Failed to map pci bars\n"); + goto release_bus; + } + } else { + if (ocs_map_bars(dev, ocs)) { + device_printf(dev, "Failed to map pci bars\n"); + goto release_bus; + } + } /* create a root DMA tag for the device */ if (bus_dma_tag_create(bus_get_dma_tag(dev), diff --git a/sys/dev/ocs_fc/sli4.c b/sys/dev/ocs_fc/sli4.c index f7cea514255d..b40c4cfa2946 100644 --- a/sys/dev/ocs_fc/sli4.c +++ b/sys/dev/ocs_fc/sli4.c @@ -91,7 +91,8 @@ sli4_asic_entry_t sli4_asic_table[] = { { 0x0, 0x0c, SLI4_ASIC_TYPE_LANCERG6,SLI4_ASIC_REV_A0}, { 0x1, 0x0c, SLI4_ASIC_TYPE_LANCERG6,SLI4_ASIC_REV_A1}, { 0x3, 0x0c, SLI4_ASIC_TYPE_LANCERG6,SLI4_ASIC_REV_A3}, - + { 0x1, 0x0d, SLI4_ASIC_TYPE_LANCERG7,SLI4_ASIC_REV_A1}, + { 0x10, 0x0d, SLI4_ASIC_TYPE_LANCERG7,SLI4_ASIC_REV_B0}, { 0x00, 0x05, SLI4_ASIC_TYPE_CORSAIR, SLI4_ASIC_REV_A0}, }; @@ -124,74 +125,126 @@ const sli4_reg_t regmap[SLI4_REG_MAX][SLI4_MAX_IF_TYPES] = { /* SLI4_REG_BMBX */ { { 2, SLI4_BMBX_REG }, { 0, SLI4_BMBX_REG }, { 0, SLI4_BMBX_REG }, { 0, SLI4_BMBX_REG }, + { UINT32_MAX, UINT32_MAX }, { UINT32_MAX, UINT32_MAX } , { 0, SLI4_BMBX_REG }, }, /* SLI4_REG_EQCQ_DOORBELL */ { { 2, SLI4_EQCQ_DOORBELL_REG }, { 0, SLI4_EQCQ_DOORBELL_REG }, { 0, SLI4_EQCQ_DOORBELL_REG }, { 0, SLI4_EQCQ_DOORBELL_REG }, + { UINT32_MAX, UINT32_MAX }, { UINT32_MAX, UINT32_MAX }, + { 1, SLI4_IF6_EQ_DOORBELL_REG } + }, + // SLI4_REG_CQ_DOORBELL + { + { 2, SLI4_EQCQ_DOORBELL_REG }, { 0, SLI4_EQCQ_DOORBELL_REG }, + { 0, SLI4_EQCQ_DOORBELL_REG }, { 0, SLI4_EQCQ_DOORBELL_REG }, + { UINT32_MAX, UINT32_MAX }, { UINT32_MAX, UINT32_MAX }, + { 1, SLI4_IF6_CQ_DOORBELL_REG } }, /* SLI4_REG_FCOE_RQ_DOORBELL */ { { 2, SLI4_RQ_DOORBELL_REG }, { 0, SLI4_RQ_DOORBELL_REG }, { 0, SLI4_RQ_DOORBELL_REG }, { UINT32_MAX, UINT32_MAX }, + { UINT32_MAX, UINT32_MAX }, { UINT32_MAX, UINT32_MAX }, + { 1, SLI4_IF6_RQ_DOORBELL_REG } }, /* SLI4_REG_IO_WQ_DOORBELL */ { - { 2, SLI4_IO_WQ_DOORBELL_REG }, { 0, SLI4_IO_WQ_DOORBELL_REG }, { 0, SLI4_IO_WQ_DOORBELL_REG }, { UINT32_MAX, UINT32_MAX }, - }, + { 2, SLI4_IO_WQ_DOORBELL_REG }, { 0, SLI4_IO_WQ_DOORBELL_REG }, + { 0, SLI4_IO_WQ_DOORBELL_REG }, { UINT32_MAX, UINT32_MAX }, + { UINT32_MAX, UINT32_MAX }, { UINT32_MAX, UINT32_MAX }, + { 1, SLI4_IF6_WQ_DOORBELL_REG } + }, /* SLI4_REG_MQ_DOORBELL */ { { 2, SLI4_MQ_DOORBELL_REG }, { 0, SLI4_MQ_DOORBELL_REG }, { 0, SLI4_MQ_DOORBELL_REG }, { 0, SLI4_MQ_DOORBELL_REG }, + { UINT32_MAX, UINT32_MAX }, { UINT32_MAX, UINT32_MAX }, + { 1, SLI4_IF6_MQ_DOORBELL_REG } }, /* SLI4_REG_PHYSDEV_CONTROL */ { - { UINT32_MAX, UINT32_MAX }, { UINT32_MAX, UINT32_MAX }, { 0, SLI4_PHSDEV_CONTROL_REG_23 }, { 0, SLI4_PHSDEV_CONTROL_REG_23 }, + { UINT32_MAX, UINT32_MAX }, { UINT32_MAX, UINT32_MAX }, + { 0, SLI4_PHSDEV_CONTROL_REG_236 }, { 0, SLI4_PHSDEV_CONTROL_REG_236 }, + { UINT32_MAX, UINT32_MAX }, { UINT32_MAX, UINT32_MAX }, + { 0, SLI4_PHSDEV_CONTROL_REG_236 } }, /* SLI4_REG_SLIPORT_CONTROL */ { - { UINT32_MAX, UINT32_MAX }, { UINT32_MAX, UINT32_MAX }, { 0, SLI4_SLIPORT_CONTROL_REG }, { UINT32_MAX, UINT32_MAX }, + { UINT32_MAX, UINT32_MAX }, { UINT32_MAX, UINT32_MAX }, + { 0, SLI4_SLIPORT_CONTROL_REG }, { UINT32_MAX, UINT32_MAX }, + { UINT32_MAX, UINT32_MAX }, { UINT32_MAX, UINT32_MAX }, + { 0, SLI4_SLIPORT_CONTROL_REG }, }, /* SLI4_REG_SLIPORT_ERROR1 */ { - { UINT32_MAX, UINT32_MAX }, { UINT32_MAX, UINT32_MAX }, { 0, SLI4_SLIPORT_ERROR1 }, { UINT32_MAX, UINT32_MAX }, + { UINT32_MAX, UINT32_MAX }, { UINT32_MAX, UINT32_MAX }, + { 0, SLI4_SLIPORT_ERROR1 }, { UINT32_MAX, UINT32_MAX }, + { UINT32_MAX, UINT32_MAX }, { UINT32_MAX, UINT32_MAX }, + { 0, SLI4_SLIPORT_ERROR1 }, }, /* SLI4_REG_SLIPORT_ERROR2 */ { - { UINT32_MAX, UINT32_MAX }, { UINT32_MAX, UINT32_MAX }, { 0, SLI4_SLIPORT_ERROR2 }, { UINT32_MAX, UINT32_MAX }, + { UINT32_MAX, UINT32_MAX }, { UINT32_MAX, UINT32_MAX }, + { 0, SLI4_SLIPORT_ERROR2 }, { UINT32_MAX, UINT32_MAX }, + { UINT32_MAX, UINT32_MAX }, { UINT32_MAX, UINT32_MAX }, + { 0, SLI4_SLIPORT_ERROR2 }, }, /* SLI4_REG_SLIPORT_SEMAPHORE */ { { 1, SLI4_PORT_SEMAPHORE_REG_0 }, { 0, SLI4_PORT_SEMAPHORE_REG_1 }, - { 0, SLI4_PORT_SEMAPHORE_REG_23 }, { 0, SLI4_PORT_SEMAPHORE_REG_23 }, + { 0, SLI4_PORT_SEMAPHORE_REG_236 }, { 0, SLI4_PORT_SEMAPHORE_REG_236 }, + { UINT32_MAX, UINT32_MAX }, { UINT32_MAX, UINT32_MAX }, + { 0, SLI4_PORT_SEMAPHORE_REG_236 }, }, /* SLI4_REG_SLIPORT_STATUS */ { - { UINT32_MAX, UINT32_MAX }, { UINT32_MAX, UINT32_MAX }, { 0, SLI4_PORT_STATUS_REG_23 }, { 0, SLI4_PORT_STATUS_REG_23 }, + { UINT32_MAX, UINT32_MAX }, { UINT32_MAX, UINT32_MAX }, + { 0, SLI4_PORT_STATUS_REG_236 }, { 0, SLI4_PORT_STATUS_REG_236 }, + { UINT32_MAX, UINT32_MAX }, { UINT32_MAX, UINT32_MAX }, + { 0, SLI4_PORT_STATUS_REG_236 }, }, /* SLI4_REG_UERR_MASK_HI */ { - { 0, SLI4_UERR_MASK_HIGH_REG }, { UINT32_MAX, UINT32_MAX }, { UINT32_MAX, UINT32_MAX }, { UINT32_MAX, UINT32_MAX }, + { 0, SLI4_UERR_MASK_HIGH_REG }, { UINT32_MAX, UINT32_MAX }, + { UINT32_MAX, UINT32_MAX }, { UINT32_MAX, UINT32_MAX }, + { UINT32_MAX, UINT32_MAX }, { UINT32_MAX, UINT32_MAX }, + { UINT32_MAX, UINT32_MAX } }, /* SLI4_REG_UERR_MASK_LO */ { - { 0, SLI4_UERR_MASK_LOW_REG }, { UINT32_MAX, UINT32_MAX }, { UINT32_MAX, UINT32_MAX }, { UINT32_MAX, UINT32_MAX }, + { 0, SLI4_UERR_MASK_LOW_REG }, { UINT32_MAX, UINT32_MAX }, + { UINT32_MAX, UINT32_MAX }, { UINT32_MAX, UINT32_MAX }, + { UINT32_MAX, UINT32_MAX }, { UINT32_MAX, UINT32_MAX }, + { UINT32_MAX, UINT32_MAX } }, /* SLI4_REG_UERR_STATUS_HI */ { - { 0, SLI4_UERR_STATUS_HIGH_REG }, { UINT32_MAX, UINT32_MAX }, { UINT32_MAX, UINT32_MAX }, { UINT32_MAX, UINT32_MAX }, + { 0, SLI4_UERR_STATUS_HIGH_REG }, { UINT32_MAX, UINT32_MAX }, + { UINT32_MAX, UINT32_MAX }, { UINT32_MAX, UINT32_MAX }, + { UINT32_MAX, UINT32_MAX }, { UINT32_MAX, UINT32_MAX }, + { UINT32_MAX, UINT32_MAX } }, /* SLI4_REG_UERR_STATUS_LO */ { - { 0, SLI4_UERR_STATUS_LOW_REG }, { UINT32_MAX, UINT32_MAX }, { UINT32_MAX, UINT32_MAX }, { UINT32_MAX, UINT32_MAX }, + { 0, SLI4_UERR_STATUS_LOW_REG }, { UINT32_MAX, UINT32_MAX }, + { UINT32_MAX, UINT32_MAX }, { UINT32_MAX, UINT32_MAX }, + { UINT32_MAX, UINT32_MAX }, { UINT32_MAX, UINT32_MAX }, + { UINT32_MAX, UINT32_MAX } }, /* SLI4_REG_SW_UE_CSR1 */ { - { 1, SLI4_SW_UE_CSR1}, { UINT32_MAX, UINT32_MAX }, { UINT32_MAX, UINT32_MAX }, { UINT32_MAX, UINT32_MAX }, + { 1, SLI4_SW_UE_CSR1}, { UINT32_MAX, UINT32_MAX }, + { UINT32_MAX, UINT32_MAX }, { UINT32_MAX, UINT32_MAX }, + { UINT32_MAX, UINT32_MAX }, { UINT32_MAX, UINT32_MAX }, + { UINT32_MAX, UINT32_MAX } }, /* SLI4_REG_SW_UE_CSR2 */ { - { 1, SLI4_SW_UE_CSR2}, { UINT32_MAX, UINT32_MAX }, { UINT32_MAX, UINT32_MAX }, { UINT32_MAX, UINT32_MAX }, + { 1, SLI4_SW_UE_CSR2}, { UINT32_MAX, UINT32_MAX }, + { UINT32_MAX, UINT32_MAX }, { UINT32_MAX, UINT32_MAX }, + { UINT32_MAX, UINT32_MAX }, { UINT32_MAX, UINT32_MAX }, + { UINT32_MAX, UINT32_MAX } }, }; @@ -1739,6 +1792,7 @@ sli_cmd_common_create_cq(sli4_t *sli4, void *buf, size_t size, cmd_size = sizeof(sli4_req_common_create_cq_v0_t) + (8 * num_pages); break; case SLI4_IF_TYPE_LANCER_FC_ETH: + case SLI4_IF_TYPE_LANCER_G7: n_cqe = qmem->size / SLI4_CQE_BYTES; switch (n_cqe) { case 256: @@ -1814,6 +1868,7 @@ sli_cmd_common_create_cq(sli4_t *sli4, void *buf, size_t size, break; case SLI4_IF_TYPE_LANCER_FC_ETH: + case SLI4_IF_TYPE_LANCER_G7: { cqv2 = (sli4_req_common_create_cq_v2_t *)((uint8_t *)buf + sli_config_off); cqv2->hdr.opcode = SLI4_OPC_COMMON_CREATE_CQ; @@ -1821,6 +1876,9 @@ sli_cmd_common_create_cq(sli4_t *sli4, void *buf, size_t size, cqv2->hdr.version = 2; cqv2->hdr.request_length = cmd_size - sizeof(sli4_req_hdr_t); + if (if_type == SLI4_IF_TYPE_LANCER_G7) + cqv2->autovalid = TRUE; + cqv2->page_size = page_size; /* valid values for number of pages: 1, 2, 4, 8 (sec 4.4.3) */ @@ -1993,6 +2051,10 @@ sli_cmd_common_create_eq(sli4_t *sli4, void *buf, size_t size, ocs_dma_t *qmem, eq->hdr.subsystem = SLI4_SUBSYSTEM_COMMON; eq->hdr.request_length = sizeof(sli4_req_common_create_eq_t) - sizeof(sli4_req_hdr_t); + if (sli4->if_type == SLI4_IF_TYPE_LANCER_G7) { + eq->hdr.version = 2; + eq->autovalid = TRUE; + } /* valid values for number of pages: 1, 2, 4 (sec 4.4.3) */ eq->num_pages = qmem->size / SLI_PAGE_SIZE; switch (eq->num_pages) { @@ -2445,6 +2507,7 @@ sli_cmd_common_get_port_name(sli4_t *sli4, void *buf, size_t size) break; case SLI4_IF_TYPE_LANCER_FC_ETH: case SLI4_IF_TYPE_LANCER_RDMA: + case SLI4_IF_TYPE_LANCER_G7: version = 1; break; default: @@ -3309,6 +3372,7 @@ sli_fw_init(sli4_t *sli4) } break; case SLI4_IF_TYPE_LANCER_FC_ETH: + case SLI4_IF_TYPE_LANCER_G7: #if BYTE_ORDER == LITTLE_ENDIAN endian = SLI4_SLIPORT_CONTROL_LITTLE_ENDIAN; #else @@ -3387,11 +3451,17 @@ sli_queue_doorbell(sli4_t *sli4, sli4_queue_t *q) switch (q->type) { case SLI_QTYPE_EQ: - val = sli_eq_doorbell(q->n_posted, q->id, FALSE); + if (sli4->if_type == SLI4_IF_TYPE_LANCER_G7) + val = sli_iftype6_eq_doorbell(q->n_posted, q->id, FALSE); + else + val = sli_eq_doorbell(q->n_posted, q->id, FALSE); ocs_reg_write32(sli4->os, q->doorbell_rset, q->doorbell_offset, val); break; case SLI_QTYPE_CQ: - val = sli_cq_doorbell(q->n_posted, q->id, FALSE); + if (sli4->if_type == SLI4_IF_TYPE_LANCER_G7) + val = sli_iftype6_cq_doorbell(q->n_posted, q->id, FALSE); + else + val = sli_cq_doorbell(q->n_posted, q->id, FALSE); ocs_reg_write32(sli4->os, q->doorbell_rset, q->doorbell_offset, val); break; case SLI_QTYPE_MQ: @@ -3435,7 +3505,13 @@ sli_queue_doorbell(sli4_t *sli4, sli4_queue_t *q) break; } case SLI_QTYPE_WQ: - val = SLI4_WQ_DOORBELL(q->n_posted, q->index, q->id); + if (sli4->if_type == SLI4_IF_TYPE_LANCER_G7) { + val = SLI4_WQ_DOORBELL(q->n_posted, 0, q->id); + } else { + /* For iftype = 2 and 3, q->index value is ignored */ + val = SLI4_WQ_DOORBELL(q->n_posted, q->index, q->id); + } + ocs_reg_write32(sli4->os, q->doorbell_rset, q->doorbell_offset, val); break; default: @@ -3627,7 +3703,7 @@ sli_get_config(sli4_t *sli4) sli4->config.extent[SLI_RSRC_FCOE_RPI].size = read_config->rpi_count; sli4->config.extent[SLI_RSRC_FCOE_XRI].base[0] = read_config->xri_base; - sli4->config.extent[SLI_RSRC_FCOE_XRI].size = read_config->xri_count; + sli4->config.extent[SLI_RSRC_FCOE_XRI].size = OCS_MIN(255,read_config->xri_count); sli4->config.extent[SLI_RSRC_FCOE_FCFI].base[0] = 0; sli4->config.extent[SLI_RSRC_FCOE_FCFI].size = read_config->fcfi_count; @@ -3988,7 +4064,8 @@ sli_setup(sli4_t *sli4, ocs_os_handle_t os, sli4_port_type_e port_type) sli4->if_type = sli_intf_if_type(sli_intf); - if (SLI4_IF_TYPE_LANCER_FC_ETH == sli4->if_type) { + if ((SLI4_IF_TYPE_LANCER_FC_ETH == sli4->if_type) || + (SLI4_IF_TYPE_LANCER_G7 == sli4->if_type)) { ocs_log_debug(os, "status=%#x error1=%#x error2=%#x\n", sli_reg_read(sli4, SLI4_REG_SLIPORT_STATUS), sli_reg_read(sli4, SLI4_REG_SLIPORT_ERROR1), @@ -4320,6 +4397,11 @@ __sli_queue_init(sli4_t *sli4, sli4_queue_t *q, uint32_t qtype, /* Limit to hwf the queue size per interrupt */ q->proc_limit = n_entries / 2; + if ( (q->type == SLI_QTYPE_EQ) || (q->type == SLI_QTYPE_CQ) ) { + /* For prism, phase will be flipped after a sweep through eq and cq */ + q->phase = 1; + } + switch(q->type) { case SLI_QTYPE_EQ: q->posted_limit = q->length / 2; @@ -4381,13 +4463,13 @@ __sli_create_queue(sli4_t *sli4, sli4_queue_t *q) switch (q->type) { case SLI_QTYPE_EQ: /* No doorbell information in response for EQs */ - q->doorbell_offset = regmap[SLI4_REG_EQCQ_DOORBELL][sli4->if_type].off; - q->doorbell_rset = regmap[SLI4_REG_EQCQ_DOORBELL][sli4->if_type].rset; + q->doorbell_offset = regmap[SLI4_REG_EQ_DOORBELL][sli4->if_type].off; + q->doorbell_rset = regmap[SLI4_REG_EQ_DOORBELL][sli4->if_type].rset; break; case SLI_QTYPE_CQ: /* No doorbell information in response for CQs */ - q->doorbell_offset = regmap[SLI4_REG_EQCQ_DOORBELL][sli4->if_type].off; - q->doorbell_rset = regmap[SLI4_REG_EQCQ_DOORBELL][sli4->if_type].rset; + q->doorbell_offset = regmap[SLI4_REG_CQ_DOORBELL][sli4->if_type].off; + q->doorbell_rset = regmap[SLI4_REG_CQ_DOORBELL][sli4->if_type].rset; break; case SLI_QTYPE_MQ: /* No doorbell information in response for MQs */ @@ -4694,6 +4776,9 @@ sli_cq_alloc_set(sli4_t *sli4, sli4_queue_t *qs[], uint32_t num_cqs, req->arm = FALSE; req->num_cq_req = num_cqs; + if (sli4->if_type == SLI4_IF_TYPE_LANCER_G7) + req->autovalid = TRUE; + /* Fill page addresses of all the CQs. */ for (i = 0; i < num_cqs; i++) { req->eq_id[i] = eqs[i]->id; @@ -4724,8 +4809,8 @@ sli_cq_alloc_set(sli4_t *sli4, sli4_queue_t *qs[], uint32_t num_cqs, /* Fill the resp cq ids. */ for (i = 0; i < num_cqs; i++) { qs[i]->id = res->q_id + i; - qs[i]->doorbell_offset = regmap[SLI4_REG_EQCQ_DOORBELL][sli4->if_type].off; - qs[i]->doorbell_rset = regmap[SLI4_REG_EQCQ_DOORBELL][sli4->if_type].rset; + qs[i]->doorbell_offset = regmap[SLI4_REG_CQ_DOORBELL][sli4->if_type].off; + qs[i]->doorbell_rset = regmap[SLI4_REG_CQ_DOORBELL][sli4->if_type].rset; } } @@ -4922,9 +5007,13 @@ sli_queue_eq_arm(sli4_t *sli4, sli4_queue_t *q, uint8_t arm) uint32_t val = 0; ocs_lock(&q->lock); + if (sli4->if_type == SLI4_IF_TYPE_LANCER_G7) + val = sli_iftype6_eq_doorbell(q->n_posted, q->id, arm); + else val = sli_eq_doorbell(q->n_posted, q->id, arm); - ocs_reg_write32(sli4->os, q->doorbell_rset, q->doorbell_offset, val); - q->n_posted = 0; + + ocs_reg_write32(sli4->os, q->doorbell_rset, q->doorbell_offset, val); + q->n_posted = 0; ocs_unlock(&q->lock); return 0; @@ -4949,12 +5038,18 @@ sli_queue_arm(sli4_t *sli4, sli4_queue_t *q, uint8_t arm) switch (q->type) { case SLI_QTYPE_EQ: - val = sli_eq_doorbell(q->n_posted, q->id, arm); + if (sli4->if_type == SLI4_IF_TYPE_LANCER_G7) + val = sli_iftype6_eq_doorbell(q->n_posted, q->id, arm); + else + val = sli_eq_doorbell(q->n_posted, q->id, arm); ocs_reg_write32(sli4->os, q->doorbell_rset, q->doorbell_offset, val); q->n_posted = 0; break; case SLI_QTYPE_CQ: - val = sli_cq_doorbell(q->n_posted, q->id, arm); + if (sli4->if_type == SLI4_IF_TYPE_LANCER_G7) + val = sli_iftype6_cq_doorbell(q->n_posted, q->id, arm); + else + val = sli_cq_doorbell(q->n_posted, q->id, arm); ocs_reg_write32(sli4->os, q->doorbell_rset, q->doorbell_offset, val); q->n_posted = 0; break; @@ -5069,10 +5164,11 @@ static uint8_t sli_queue_entry_is_valid(sli4_queue_t *q, uint8_t *qe, uint8_t clear) { uint8_t valid = FALSE; + uint8_t valid_bit_set = 0; switch (q->type) { case SLI_QTYPE_EQ: - valid = ((sli4_eqe_t *)qe)->vld; + valid = (((sli4_eqe_t *)qe)->vld == q->phase) ? 1 : 0; if (valid && clear) { ((sli4_eqe_t *)qe)->vld = 0; } @@ -5082,7 +5178,10 @@ sli_queue_entry_is_valid(sli4_queue_t *q, uint8_t *qe, uint8_t clear) * For both MCQE and WCQE/RCQE, the valid bit * is bit 31 of dword 3 (0 based) */ - valid = (qe[15] & 0x80) != 0; + valid_bit_set = (qe[15] & 0x80) != 0; + if (valid_bit_set == q->phase) + valid = 1; + if (valid & clear) { qe[15] &= ~0x80; } @@ -5099,6 +5198,7 @@ sli_queue_entry_is_valid(sli4_queue_t *q, uint8_t *qe, uint8_t clear) } if (clear) { + ocs_dma_sync(&q->dma, OCS_DMASYNC_PREWRITE); } @@ -5122,6 +5222,7 @@ sli_queue_read(sli4_t *sli4, sli4_queue_t *q, uint8_t *entry) uint8_t *qe = q->dma.virt; uint32_t *qindex = NULL; + uint8_t clear = (SLI4_IF_TYPE_LANCER_G7 == sli_get_if_type(sli4)) ? FALSE : TRUE; if (SLI_QTYPE_MQ == q->type) { qindex = &q->u.r_idx; } else { @@ -5134,7 +5235,7 @@ sli_queue_read(sli4_t *sli4, sli4_queue_t *q, uint8_t *entry) qe += *qindex * q->size; - if (!sli_queue_entry_is_valid(q, qe, TRUE)) { + if (!sli_queue_entry_is_valid(q, qe, clear)) { ocs_unlock(&q->lock); return -1; } @@ -5165,6 +5266,13 @@ sli_queue_read(sli4_t *sli4, sli4_queue_t *q, uint8_t *entry) *qindex = (*qindex + 1) & (q->length - 1); if (SLI_QTYPE_MQ != q->type) { q->n_posted++; + /* + * For prism, the phase value will be used to check the validity of eq/cq entries. + * The value toggles after a complete sweep through the queue. + */ + if ((SLI4_IF_TYPE_LANCER_G7 == sli_get_if_type(sli4)) && (*qindex == 0)) { + q->phase ^= (uint16_t) 0x1; + } } break; default: @@ -5487,8 +5595,9 @@ int32_t sli_raise_ue(sli4_t *sli4, uint8_t dump) ocs_log_test(sli4->os, "invalid asic type %d\n", sli_get_asic_type(sli4)); return -1; } - } else if (SLI4_IF_TYPE_LANCER_FC_ETH == sli_get_if_type(sli4)) { - if (dump == FDD) { + } else if ((SLI4_IF_TYPE_LANCER_FC_ETH == sli_get_if_type(sli4)) || + (SLI4_IF_TYPE_LANCER_G7 == sli_get_if_type(sli4))) { + if (FDD == dump) { sli_reg_write(sli4, SLI4_REG_SLIPORT_CONTROL, SLI4_SLIPORT_CONTROL_FDD | SLI4_SLIPORT_CONTROL_IP); } else { uint32_t value = SLI4_PHYDEV_CONTROL_FRST; @@ -5532,7 +5641,8 @@ int32_t sli_dump_is_ready(sli4_t *sli4) rc = 1; } - } else if (SLI4_IF_TYPE_LANCER_FC_ETH == sli_get_if_type(sli4)) { + } else if ((SLI4_IF_TYPE_LANCER_FC_ETH == sli_get_if_type(sli4)) || + (SLI4_IF_TYPE_LANCER_G7 == sli_get_if_type(sli4))) { /* * Ensure that the port is ready AND the mailbox is * ready before signaling that the dump is ready to go. @@ -5542,7 +5652,7 @@ int32_t sli_dump_is_ready(sli4_t *sli4) if ((bmbx_val & SLI4_BMBX_RDY) && SLI4_PORT_STATUS_READY(port_val)) { - if(SLI4_PORT_STATUS_DUMP_PRESENT(port_val)) { + if(SLI4_PORT_STATUS_DUMP_PRESENT(port_val)) { rc = 1; }else if( SLI4_PORT_STATUS_FDP_PRESENT(port_val)) { rc = 2; @@ -5571,7 +5681,8 @@ int32_t sli_dump_is_present(sli4_t *sli4) uint32_t val; uint32_t ready; - if (SLI4_IF_TYPE_LANCER_FC_ETH != sli_get_if_type(sli4)) { + if ((SLI4_IF_TYPE_LANCER_FC_ETH != sli_get_if_type(sli4)) && + (SLI4_IF_TYPE_LANCER_G7 != sli_get_if_type(sli4))) { ocs_log_test(sli4->os, "Function only supported for I/F type 2"); return -1; } @@ -5658,7 +5769,8 @@ int32_t sli_fw_error_status(sli4_t *sli4) (uerr_mask_hi & uerr_status_hi) != 0) { rc = 1; } - } else if ((SLI4_IF_TYPE_LANCER_FC_ETH == sli4->if_type)) { + } else if (SLI4_IF_TYPE_LANCER_FC_ETH == sli4->if_type || + SLI4_IF_TYPE_LANCER_G7 == sli4->if_type) { uint32_t sliport_status; sliport_status = sli_reg_read(sli4, SLI4_REG_SLIPORT_STATUS); @@ -5692,9 +5804,10 @@ sli_fw_ready(sli4_t *sli4) SLI4_IF_TYPE_BE3_SKH_VF == sli4->if_type) { val = sli_reg_read(sli4, SLI4_REG_SLIPORT_SEMAPHORE); rc = ((SLI4_PORT_SEMAPHORE_STATUS_POST_READY == - SLI4_PORT_SEMAPHORE_PORT(val)) && - (!SLI4_PORT_SEMAPHORE_IN_ERR(val)) ? 1 : 0); - } else if (SLI4_IF_TYPE_LANCER_FC_ETH == sli4->if_type) { + SLI4_PORT_SEMAPHORE_PORT(val)) && + (!SLI4_PORT_SEMAPHORE_IN_ERR(val)) ? 1 : 0); + } else if (SLI4_IF_TYPE_LANCER_FC_ETH == sli4->if_type || + SLI4_IF_TYPE_LANCER_G7 == sli4->if_type) { val = sli_reg_read(sli4, SLI4_REG_SLIPORT_STATUS); rc = (SLI4_PORT_STATUS_READY(val) ? 1 : 0); } @@ -5726,6 +5839,7 @@ int32_t sli_link_is_configurable(sli4_t *sli) rc = 1; break; case SLI4_ASIC_TYPE_LANCERG6: + case SLI4_ASIC_TYPE_LANCERG7: case SLI4_ASIC_TYPE_BE3: default: rc = 0; @@ -5755,7 +5869,7 @@ int32_t sli_link_is_configurable(sli4_t *sli) */ int32_t sli_cmd_fcoe_wq_create(sli4_t *sli4, void *buf, size_t size, - ocs_dma_t *qmem, uint16_t cq_id, uint16_t ulp) + ocs_dma_t *qmem, uint16_t cq_id, uint16_t ulp) { sli4_req_fcoe_wq_create_t *wq = NULL; uint32_t sli_config_off = 0; diff --git a/sys/dev/ocs_fc/sli4.h b/sys/dev/ocs_fc/sli4.h index 4d0c8013b063..54e1915a715c 100644 --- a/sys/dev/ocs_fc/sli4.h +++ b/sys/dev/ocs_fc/sli4.h @@ -114,7 +114,8 @@ sli_page_count(size_t bytes, uint32_t page_size) #define SLI4_IF_TYPE_BE3_SKH_VF 1 #define SLI4_IF_TYPE_LANCER_FC_ETH 2 #define SLI4_IF_TYPE_LANCER_RDMA 3 -#define SLI4_MAX_IF_TYPES 4 +#define SLI4_IF_TYPE_LANCER_G7 6 +#define SLI4_MAX_IF_TYPES 7 /** * @brief ASIC_ID - SLI ASIC Type and Revision Register @@ -150,7 +151,7 @@ sli_page_count(size_t bytes, uint32_t page_size) /** * @brief EQCQ_DOORBELL - EQ and CQ Doorbell Register */ -#define SLI4_EQCQ_DOORBELL_REG 0x120 +#define SLI4_EQCQ_DOORBELL_REG 0x120 #define SLI4_EQCQ_DOORBELL_CI BIT(9) #define SLI4_EQCQ_DOORBELL_QT BIT(10) #define SLI4_EQCQ_DOORBELL_ARM BIT(29) @@ -162,6 +163,8 @@ sli_page_count(size_t bytes, uint32_t page_size) #define SLI4_EQCQ_EQ_ID_MASK_LO 0x01ff #define SLI4_EQCQ_CQ_ID_MASK_LO 0x03ff #define SLI4_EQCQ_EQCQ_ID_MASK_HI 0xf800 +#define SLI4_IF6_EQ_DOORBELL_REG 0x120 +#define SLI4_IF6_CQ_DOORBELL_REG 0xC0 /** * @brief SLIPORT_CONTROL - SLI Port Control Register @@ -257,10 +260,56 @@ static inline uint32_t sli_cq_doorbell(uint16_t n_popped, uint16_t id, uint8_t a return reg; } +static inline uint32_t sli_iftype6_eq_doorbell(uint16_t n_popped, uint16_t id, uint8_t arm) +{ + uint32_t reg = 0; +#if BYTE_ORDER == LITTLE_ENDIAN + struct { + uint32_t eq_id:12, + :4, /* clear interrupt */ + number_popped:13, + arm:1, + :1, + io:1; + } * eq_doorbell = (void *)® +#else +#error big endian version not defined +#endif + + eq_doorbell->eq_id = id; + eq_doorbell->number_popped = n_popped; + eq_doorbell->arm = arm; + + return reg; +} + +static inline uint32_t sli_iftype6_cq_doorbell(uint16_t n_popped, uint16_t id, uint8_t arm) +{ + uint32_t reg = 0; +#if BYTE_ORDER == LITTLE_ENDIAN + struct { + uint32_t cq_id:16, + number_popped:13, + arm:1, + :1, + se:1; + } * cq_doorbell = (void *)® +#else +#error big endian version not defined +#endif + + cq_doorbell->cq_id = id; + cq_doorbell->number_popped = n_popped; + cq_doorbell->arm = arm; + + return reg; +} + /** * @brief MQ_DOORBELL - MQ Doorbell Register */ -#define SLI4_MQ_DOORBELL_REG 0x0140 /* register offset */ +#define SLI4_MQ_DOORBELL_REG 0x0140 /* register offset */ +#define SLI4_IF6_MQ_DOORBELL_REG 0x0160 /* register offset if_type = 6 */ #define SLI4_MQ_DOORBELL_NUM_SHIFT 16 #define SLI4_MQ_DOORBELL_NUM_MASK 0x3fff #define SLI4_MQ_DOORBELL_ID_MASK 0xffff @@ -270,7 +319,8 @@ static inline uint32_t sli_cq_doorbell(uint16_t n_popped, uint16_t id, uint8_t a /** * @brief RQ_DOORBELL - RQ Doorbell Register */ -#define SLI4_RQ_DOORBELL_REG 0x0a0 /* register offset */ +#define SLI4_RQ_DOORBELL_REG 0x0a0 /* register offset */ +#define SLI4_IF6_RQ_DOORBELL_REG 0x0080 /* register offset of if_type = 6 */ #define SLI4_RQ_DOORBELL_NUM_SHIFT 16 #define SLI4_RQ_DOORBELL_NUM_MASK 0x3fff #define SLI4_RQ_DOORBELL_ID_MASK 0xffff @@ -280,7 +330,8 @@ static inline uint32_t sli_cq_doorbell(uint16_t n_popped, uint16_t id, uint8_t a /** * @brief WQ_DOORBELL - WQ Doorbell Register */ -#define SLI4_IO_WQ_DOORBELL_REG 0x040 /* register offset */ +#define SLI4_IO_WQ_DOORBELL_REG 0x040 /* register offset */ +#define SLI4_IF6_WQ_DOORBELL_REG 0x040 /* register offset for if_type = 6 */ #define SLI4_WQ_DOORBELL_IDX_SHIFT 16 #define SLI4_WQ_DOORBELL_IDX_MASK 0x00ff #define SLI4_WQ_DOORBELL_NUM_SHIFT 24 @@ -295,7 +346,7 @@ static inline uint32_t sli_cq_doorbell(uint16_t n_popped, uint16_t id, uint8_t a */ #define SLI4_PORT_SEMAPHORE_REG_0 0x00ac /** register offset Interface Type 0 + 1 */ #define SLI4_PORT_SEMAPHORE_REG_1 0x0180 /** register offset Interface Type 0 + 1 */ -#define SLI4_PORT_SEMAPHORE_REG_23 0x0400 /** register offset Interface Type 2 + 3 */ +#define SLI4_PORT_SEMAPHORE_REG_236 0x0400 /** register offset Interface Type 2 + 3 + 6*/ #define SLI4_PORT_SEMAPHORE_PORT_MASK 0x0000ffff #define SLI4_PORT_SEMAPHORE_PORT(r) ((r) & SLI4_PORT_SEMAPHORE_PORT_MASK) #define SLI4_PORT_SEMAPHORE_HOST_MASK 0x00ff0000 @@ -319,7 +370,7 @@ static inline uint32_t sli_cq_doorbell(uint16_t n_popped, uint16_t id, uint8_t a * @brief SLIPORT_STATUS - SLI Port Status Register */ -#define SLI4_PORT_STATUS_REG_23 0x0404 /** register offset Interface Type 2 + 3 */ +#define SLI4_PORT_STATUS_REG_236 0x0404 /** register offset Interface Type 2 + 3 + 6*/ #define SLI4_PORT_STATUS_FDP BIT(21) /** function specific dump present */ #define SLI4_PORT_STATUS_RDY BIT(23) /** ready */ #define SLI4_PORT_STATUS_RN BIT(24) /** reset needed */ @@ -332,7 +383,7 @@ static inline uint32_t sli_cq_doorbell(uint16_t n_popped, uint16_t id, uint8_t a #define SLI4_PORT_STATUS_DUMP_PRESENT(r) ((r) & SLI4_PORT_STATUS_DIP) #define SLI4_PORT_STATUS_FDP_PRESENT(r) ((r) & SLI4_PORT_STATUS_FDP) -#define SLI4_PHSDEV_CONTROL_REG_23 0x0414 /** register offset Interface Type 2 + 3 */ +#define SLI4_PHSDEV_CONTROL_REG_236 0x0414 /** register offset Interface Type 2 + 3 + 6*/ #define SLI4_PHYDEV_CONTROL_DRST BIT(0) /** physical device reset */ #define SLI4_PHYDEV_CONTROL_FRST BIT(1) /** firmware reset */ #define SLI4_PHYDEV_CONTROL_DD BIT(2) /** diagnostic dump */ @@ -1557,7 +1608,8 @@ typedef struct sli4_req_common_create_cq_v2_s { clswm:2, nodelay:1, autovalid:1, - :11, + :9, + cqe_size:2, cqecnt:2, valid:1, :1, @@ -1691,7 +1743,8 @@ typedef struct sli4_req_common_create_eq_s { #if BYTE_ORDER == LITTLE_ENDIAN uint32_t num_pages:16, :16; - uint32_t :29, + uint32_t :28, + autovalid:1, valid:1, :1, eqesz:1; @@ -2960,7 +3013,8 @@ typedef struct sli4_acqe_s { */ typedef enum { SLI4_REG_BMBX, - SLI4_REG_EQCQ_DOORBELL, + SLI4_REG_EQ_DOORBELL, + SLI4_REG_CQ_DOORBELL, SLI4_REG_FCOE_RQ_DOORBELL, SLI4_REG_IO_WQ_DOORBELL, SLI4_REG_MQ_DOORBELL, @@ -3027,6 +3081,9 @@ typedef struct sli4_queue_s { uint32_t max_num_processed; time_t max_process_time; + uint16_t phase; /** For if_type = 6, this value toggle for each iteration + of the queue, a queue entry is valid when a cqe valid + bit matches this value */ /* Type specific gunk */ union { uint32_t r_idx; /** "read" index (MQ only) */ @@ -3131,6 +3188,7 @@ typedef enum { SLI4_ASIC_TYPE_LANCER, SLI4_ASIC_TYPE_CORSAIR, SLI4_ASIC_TYPE_LANCERG6, + SLI4_ASIC_TYPE_LANCERG7 } sli4_asic_type_e; typedef enum { From owner-dev-commits-src-main@freebsd.org Thu Sep 30 07:48:16 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 11B996ACB50; Thu, 30 Sep 2021 07:48:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HKljC6kd5z4mdv; Thu, 30 Sep 2021 07:48:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A350A119; Thu, 30 Sep 2021 07:48:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18U7mFBg046458; Thu, 30 Sep 2021 07:48:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18U7mFFQ046457; Thu, 30 Sep 2021 07:48:15 GMT (envelope-from git) Date: Thu, 30 Sep 2021 07:48:15 GMT Message-Id: <202109300748.18U7mFFQ046457@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ram Kishore Vegesna Subject: git: 322dbb8ce8f6 - main - ocs_fc: Increase maximum supported SG elements to support larger transfer sizes. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ram X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 322dbb8ce8f63fd6f542309fd38324664ce8dd3f Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Sep 2021 07:48:16 -0000 The branch main has been updated by ram: URL: https://cgit.FreeBSD.org/src/commit/?id=322dbb8ce8f63fd6f542309fd38324664ce8dd3f commit 322dbb8ce8f63fd6f542309fd38324664ce8dd3f Author: Ram Kishore Vegesna AuthorDate: 2021-09-24 09:05:03 +0000 Commit: Ram Kishore Vegesna CommitDate: 2021-09-30 07:31:16 +0000 ocs_fc: Increase maximum supported SG elements to support larger transfer sizes. Reported by: ken@kdm.org Reviewed by: mav, ken --- sys/dev/ocs_fc/ocs_cam.c | 14 +++++++++----- sys/dev/ocs_fc/ocs_device.h | 2 +- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/sys/dev/ocs_fc/ocs_cam.c b/sys/dev/ocs_fc/ocs_cam.c index d3c275920c4b..53b53d1b696d 100644 --- a/sys/dev/ocs_fc/ocs_cam.c +++ b/sys/dev/ocs_fc/ocs_cam.c @@ -1704,7 +1704,7 @@ ocs_target_io(struct ocs_softc *ocs, union ccb *ccb) rc = ocs_scsi_send_resp(io, 0, &resp, ocs_scsi_target_io_cb, ccb); } else if (xferlen != 0) { - ocs_scsi_sgl_t sgl[OCS_FC_MAX_SGL]; + ocs_scsi_sgl_t *sgl; int32_t sgl_count = 0; io->tgt_io.state = OCS_CAM_IO_DATA; @@ -1712,7 +1712,9 @@ ocs_target_io(struct ocs_softc *ocs, union ccb *ccb) if (sendstatus) io->tgt_io.sendresp = 1; - sgl_count = ocs_build_scsi_sgl(ocs, ccb, io, sgl, ARRAY_SIZE(sgl)); + sgl = io->sgl; + + sgl_count = ocs_build_scsi_sgl(ocs, ccb, io, sgl, io->sgl_allocated); if (sgl_count > 0) { if (cam_dir == CAM_DIR_IN) { rc = ocs_scsi_send_rd_data(io, 0, NULL, sgl, @@ -1785,7 +1787,7 @@ ocs_initiator_io(struct ocs_softc *ocs, union ccb *ccb) struct ccb_hdr *ccb_h = &csio->ccb_h; ocs_node_t *node = NULL; ocs_io_t *io = NULL; - ocs_scsi_sgl_t sgl[OCS_FC_MAX_SGL]; + ocs_scsi_sgl_t *sgl; int32_t flags, sgl_count; ocs_fcport *fcp; @@ -1828,8 +1830,9 @@ ocs_initiator_io(struct ocs_softc *ocs, union ccb *ccb) csio->ccb_h.ccb_ocs_ptr = ocs; csio->ccb_h.ccb_io_ptr = io; + sgl = io->sgl; - sgl_count = ocs_build_scsi_sgl(ocs, ccb, io, sgl, ARRAY_SIZE(sgl)); + sgl_count = ocs_build_scsi_sgl(ocs, ccb, io, sgl, io->sgl_allocated); if (sgl_count < 0) { ocs_scsi_io_free(io); device_printf(ocs->dev, "%s: building SGL failed\n", __func__); @@ -2068,7 +2071,8 @@ ocs_action(struct cam_sim *sim, union ccb *ccb) /* Calculate the max IO supported * Worst case would be an OS page per SGL entry */ - cpi->maxio = PAGE_SIZE * + + cpi->maxio = PAGE_SIZE * (ocs_scsi_get_property(ocs, OCS_SCSI_MAX_SGL) - 1); strncpy(cpi->sim_vid, "FreeBSD", SIM_IDLEN); diff --git a/sys/dev/ocs_fc/ocs_device.h b/sys/dev/ocs_fc/ocs_device.h index f4c5baae0c54..b6d3a5d4897f 100644 --- a/sys/dev/ocs_fc/ocs_device.h +++ b/sys/dev/ocs_fc/ocs_device.h @@ -55,7 +55,7 @@ * @brief Defines the number of SGLs allocated on each IO object */ #ifndef OCS_FC_MAX_SGL -#define OCS_FC_MAX_SGL 128 +#define OCS_FC_MAX_SGL 256 #endif /*************************************************************************** From owner-dev-commits-src-main@freebsd.org Thu Sep 30 07:48:17 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 060216ACCAC; Thu, 30 Sep 2021 07:48:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HKljD6M5Lz4mJy; Thu, 30 Sep 2021 07:48:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B14C427FB8; Thu, 30 Sep 2021 07:48:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18U7mGIk046482; Thu, 30 Sep 2021 07:48:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18U7mG0e046481; Thu, 30 Sep 2021 07:48:16 GMT (envelope-from git) Date: Thu, 30 Sep 2021 07:48:16 GMT Message-Id: <202109300748.18U7mG0e046481@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ram Kishore Vegesna Subject: git: 1af49c2eeb4a - main - ocs_fc: Fix CAM status reporting in ocs_fc(4) when no data is returned. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ram X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 1af49c2eeb4a05f524ed9a6657c741bc96fbaf87 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Sep 2021 07:48:17 -0000 The branch main has been updated by ram: URL: https://cgit.FreeBSD.org/src/commit/?id=1af49c2eeb4a05f524ed9a6657c741bc96fbaf87 commit 1af49c2eeb4a05f524ed9a6657c741bc96fbaf87 Author: Ram Kishore Vegesna AuthorDate: 2021-09-24 09:19:49 +0000 Commit: Ram Kishore Vegesna CommitDate: 2021-09-30 07:31:16 +0000 ocs_fc: Fix CAM status reporting in ocs_fc(4) when no data is returned. In ocs_scsi_initiator_io_cb(), if the SCSI command that is getting completed had a residual equal to the transfer length, it was setting the CCB status to CAM_REQ_CMP. That breaks the expected behavior for commands like READ ATTRIBUTE. For READ ATTRIBUTE, if the first attribute requested doesn't exist, the command is supposed to return an error (Illegal Request, Invalid Field in CDB). The broken behavior for READ ATTRIBUTE caused LTFS tape formatting to fail. It looks for attribute 0x1623, and expects to see an error if the attribute isn't present. In addition, if the residual is negative (indicating an overrun), only set the CCB status to CAM_DATA_RUN_ERR if we have not already reported an error. The SCSI sense data will have more detail about what went wrong. sys/dev/ocs_fc/ocs_cam.c: In ocs_scsi_initiator_io_cb(), don't set the status to CAM_REQ_CMP if the residual is equal to the transfer length. Also, only set CAM_DATA_RUN_ERR if we didn't get SCSI status. Submitted by: ken@kdm.org Reviewed by: mav, ken --- sys/dev/ocs_fc/ocs_cam.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/sys/dev/ocs_fc/ocs_cam.c b/sys/dev/ocs_fc/ocs_cam.c index 53b53d1b696d..82b5371b7875 100644 --- a/sys/dev/ocs_fc/ocs_cam.c +++ b/sys/dev/ocs_fc/ocs_cam.c @@ -1491,18 +1491,18 @@ static int32_t ocs_scsi_initiator_io_cb(ocs_io_t *io, if (scsi_status == OCS_SCSI_STATUS_CHECK_RESPONSE) { csio->scsi_status = rsp->scsi_status; - if (SCSI_STATUS_OK != rsp->scsi_status) { + if (SCSI_STATUS_OK != rsp->scsi_status) ccb_status = CAM_SCSI_STATUS_ERROR; - } + else + ccb_status = CAM_REQ_CMP; csio->resid = rsp->residual; - if (rsp->residual > 0) { - uint32_t length = rsp->response_wire_length; - /* underflow */ - if (csio->dxfer_len == (length + csio->resid)) { - ccb_status = CAM_REQ_CMP; - } - } else if (rsp->residual < 0) { + + /* + * If we've already got a SCSI error, prefer that because it + * will have more detail. + */ + if ((rsp->residual < 0) && (ccb_status == CAM_REQ_CMP)) { ccb_status = CAM_DATA_RUN_ERR; } From owner-dev-commits-src-main@freebsd.org Thu Sep 30 07:48:18 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 706DB6AD024; Thu, 30 Sep 2021 07:48:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HKljG0Zy0z4mjt; Thu, 30 Sep 2021 07:48:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DC6C027ECB; Thu, 30 Sep 2021 07:48:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18U7mHHh046506; Thu, 30 Sep 2021 07:48:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18U7mHwO046505; Thu, 30 Sep 2021 07:48:17 GMT (envelope-from git) Date: Thu, 30 Sep 2021 07:48:17 GMT Message-Id: <202109300748.18U7mHwO046505@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ram Kishore Vegesna Subject: git: d063d1bc9281 - main - ocs_fc: When commands complete with an error, freeze the device queue. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ram X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d063d1bc928165e7798df5ec1c424794a1ec41e9 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Sep 2021 07:48:18 -0000 The branch main has been updated by ram: URL: https://cgit.FreeBSD.org/src/commit/?id=d063d1bc928165e7798df5ec1c424794a1ec41e9 commit d063d1bc928165e7798df5ec1c424794a1ec41e9 Author: Ram Kishore Vegesna AuthorDate: 2021-09-24 09:32:09 +0000 Commit: Ram Kishore Vegesna CommitDate: 2021-09-30 07:31:17 +0000 ocs_fc: When commands complete with an error, freeze the device queue. Proper error recovery depends on freezing the device queue when an error occurs, so we can recover from an error before sending additional commands. The ocs_fc(4) driver was not freezing the device queue for most SCSI errors, and that broke error recovery. sys/dev/ocs_fc/ocs_cam.c: In ocs_scsi_initiator_io_cb(), freeze the device queue if we're passing back status other than CAM_REQ_CMP. Submitted by: ken@kdm.org Reviewed by: mav, ken --- sys/dev/ocs_fc/ocs_cam.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/sys/dev/ocs_fc/ocs_cam.c b/sys/dev/ocs_fc/ocs_cam.c index 82b5371b7875..6a9ef6160cee 100644 --- a/sys/dev/ocs_fc/ocs_cam.c +++ b/sys/dev/ocs_fc/ocs_cam.c @@ -1523,10 +1523,6 @@ static int32_t ocs_scsi_initiator_io_cb(ocs_io_t *io, } } else if (scsi_status != OCS_SCSI_STATUS_GOOD) { ccb_status = CAM_REQ_CMP_ERR; - ocs_set_ccb_status(ccb, ccb_status); - csio->ccb_h.status |= CAM_DEV_QFRZN; - xpt_freeze_devq(csio->ccb_h.path, 1); - } else { ccb_status = CAM_REQ_CMP; } @@ -1537,8 +1533,15 @@ static int32_t ocs_scsi_initiator_io_cb(ocs_io_t *io, csio->ccb_h.ccb_io_ptr = NULL; csio->ccb_h.ccb_ocs_ptr = NULL; + ccb->ccb_h.status &= ~CAM_SIM_QUEUED; + if ((ccb_status != CAM_REQ_CMP) && + ((ccb->ccb_h.status & CAM_DEV_QFRZN) == 0)) { + ccb->ccb_h.status |= CAM_DEV_QFRZN; + xpt_freeze_devq(ccb->ccb_h.path, 1); + } + xpt_done(ccb); return 0; From owner-dev-commits-src-main@freebsd.org Thu Sep 30 07:48:19 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5510B6ACB52; Thu, 30 Sep 2021 07:48:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HKljH19XMz4mK4; Thu, 30 Sep 2021 07:48:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F3B0727E60; Thu, 30 Sep 2021 07:48:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18U7mIuU046536; Thu, 30 Sep 2021 07:48:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18U7mI1C046535; Thu, 30 Sep 2021 07:48:18 GMT (envelope-from git) Date: Thu, 30 Sep 2021 07:48:18 GMT Message-Id: <202109300748.18U7mI1C046535@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ram Kishore Vegesna Subject: git: 41e946694333 - main - ocs_fc: Fix device lost timer where device is not getting deleted. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ram X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 41e946694333bcc6f64242f294312553f2ef2dcd Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Sep 2021 07:48:19 -0000 The branch main has been updated by ram: URL: https://cgit.FreeBSD.org/src/commit/?id=41e946694333bcc6f64242f294312553f2ef2dcd commit 41e946694333bcc6f64242f294312553f2ef2dcd Author: Ram Kishore Vegesna AuthorDate: 2021-09-24 09:35:30 +0000 Commit: Ram Kishore Vegesna CommitDate: 2021-09-30 07:31:17 +0000 ocs_fc: Fix device lost timer where device is not getting deleted. Issue: Devices wont go away after the link down. Device lost timer functionality in ocs_fc is broken, `is_target` flag is not set in the target database and target delete is skipped. Fix: Remove unused flags and delete the device when timer expires. Reported by: ken@kdm.org Reviewed by: mav, ken --- sys/dev/ocs_fc/ocs.h | 4 ---- sys/dev/ocs_fc/ocs_cam.c | 5 +---- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/sys/dev/ocs_fc/ocs.h b/sys/dev/ocs_fc/ocs.h index cd212b628bd1..4d7671aa8fb6 100644 --- a/sys/dev/ocs_fc/ocs.h +++ b/sys/dev/ocs_fc/ocs.h @@ -64,14 +64,10 @@ typedef struct ocs_intr_ctx_s { typedef struct ocs_fc_rport_db_s { uint32_t node_id; uint32_t state; - uint8_t is_target; - uint8_t is_initiator; - uint32_t port_id; uint64_t wwnn; uint64_t wwpn; uint32_t gone_timer; - } ocs_fc_target_t; #define OCS_TGT_STATE_NONE 0 /* Empty DB slot */ diff --git a/sys/dev/ocs_fc/ocs_cam.c b/sys/dev/ocs_fc/ocs_cam.c index 6a9ef6160cee..b734880cefb8 100644 --- a/sys/dev/ocs_fc/ocs_cam.c +++ b/sys/dev/ocs_fc/ocs_cam.c @@ -1118,10 +1118,7 @@ ocs_ldt_task(void *arg, int pending) continue; } - if (tgt->is_target) { - tgt->is_target = 0; - ocs_delete_target(ocs, fcp, i); - } + ocs_delete_target(ocs, fcp, i); tgt->state = OCS_TGT_STATE_NONE; } From owner-dev-commits-src-main@freebsd.org Thu Sep 30 09:11:29 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8CE476AE41B; Thu, 30 Sep 2021 09:11:29 +0000 (UTC) (envelope-from manu@bidouilliste.com) Received: from mx.blih.net (mail.blih.net [212.83.155.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "mx.blih.net", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HKnYD6jTqz4sp8; Thu, 30 Sep 2021 09:11:28 +0000 (UTC) (envelope-from manu@bidouilliste.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bidouilliste.com; s=mx; t=1632993081; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=430p0AtP9MCn55BxHYRDErrhEbWlSu4jjke48UHrXPY=; b=HRez+Ijd142sGoy6MGtdOyX+QELVsz4CVakPBjvlH5a6JGhSJ59ubB1xNLLLx+XskIdFnL wbk9OO+H9ksLs/jNWMNYDKWoH2AvFtlUhsD70wHq4UtgHqpoUve8IKkFlcN5dgbJr2EkhJ M+jRINSwgb5XpLieDBjHDJihWAHbUnU= Received: from amy (lfbn-idf2-1-644-191.w86-247.abo.wanadoo.fr [86.247.100.191]) by mx.blih.net (OpenSMTPD) with ESMTPSA id 8767f146 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Thu, 30 Sep 2021 09:11:21 +0000 (UTC) Date: Thu, 30 Sep 2021 11:11:20 +0200 From: Emmanuel Vadot To: Warner Losh Cc: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: Re: git: 79a100e28e3c - main - bluetooth: complete removal of ng_h4 Message-Id: <20210930111120.e038ca0a2a3c770f4778fa84@bidouilliste.com> In-Reply-To: <202109300200.18U20EZD084710@gitrepo.freebsd.org> References: <202109300200.18U20EZD084710@gitrepo.freebsd.org> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.33; amd64-portbld-freebsd14.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4HKnYD6jTqz4sp8 X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Sep 2021 09:11:29 -0000 On Thu, 30 Sep 2021 02:00:14 GMT Warner Losh wrote: > The branch main has been updated by imp: > > URL: https://cgit.FreeBSD.org/src/commit/?id=79a100e28e3c814773bb4c1826cfa25fbe31140e > > commit 79a100e28e3c814773bb4c1826cfa25fbe31140e > Author: Warner Losh > AuthorDate: 2021-09-05 18:41:16 +0000 > Commit: Warner Losh > CommitDate: 2021-09-30 02:00:02 +0000 > > bluetooth: complete removal of ng_h4 > > The ng_h4 module was disconnected 13 years ago when the tty later was > locked by Ed. It completely fails to compile, and has a number of false > positives for Giant use. Remove it for lack of interest. Bluetooth has > largely (completely?) moved on from bluetooth over UART transport. > > OK'd by: emax > Sponsored by: Netflix > Differential Revision: https://reviews.freebsd.org/D31846 Every BT+WIFI combo chip used in SBC uses uart for bluetooth. I have no idea if it uses this or need something else as I've never looked. But anyway, if it fails to compile now I'm fine with removing it, if someone wants to add support for bluetooth to SBC they could always revive this code. -- Emmanuel Vadot From owner-dev-commits-src-main@freebsd.org Thu Sep 30 11:01:26 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DDF5E6AF5CC; Thu, 30 Sep 2021 11:01:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HKr065SFkz3GRg; Thu, 30 Sep 2021 11:01:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9B99428BA; Thu, 30 Sep 2021 11:01:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18UB1QAt009007; Thu, 30 Sep 2021 11:01:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18UB1Qxv009006; Thu, 30 Sep 2021 11:01:26 GMT (envelope-from git) Date: Thu, 30 Sep 2021 11:01:26 GMT Message-Id: <202109301101.18UB1Qxv009006@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mateusz Guzik Subject: git: 85c855d31b18 - main - fd: add pwd_hold_proc MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mjg X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 85c855d31b18d7a8ab534259f27444c81b6ec797 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Sep 2021 11:01:26 -0000 The branch main has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=85c855d31b18d7a8ab534259f27444c81b6ec797 commit 85c855d31b18d7a8ab534259f27444c81b6ec797 Author: Mateusz Guzik AuthorDate: 2021-09-30 10:49:51 +0000 Commit: Mateusz Guzik CommitDate: 2021-09-30 10:49:51 +0000 fd: add pwd_hold_proc --- sys/kern/kern_descrip.c | 20 ++++++++++++++++++++ sys/sys/filedesc.h | 1 + 2 files changed, 21 insertions(+) diff --git a/sys/kern/kern_descrip.c b/sys/kern/kern_descrip.c index 58c2d1939dba..755b5df51c6a 100644 --- a/sys/kern/kern_descrip.c +++ b/sys/kern/kern_descrip.c @@ -3791,6 +3791,26 @@ pwd_hold(struct thread *td) return (pwd); } +struct pwd * +pwd_hold_proc(struct proc *p) +{ + struct pwddesc *pdp; + struct pwd *pwd; + + PROC_ASSERT_HELD(p); + PROC_LOCK(p); + pdp = pdhold(p); + MPASS(pdp != NULL); + PROC_UNLOCK(p); + + PWDDESC_XLOCK(pdp); + pwd = pwd_hold_pwddesc(pdp); + MPASS(pwd != NULL); + PWDDESC_XUNLOCK(pdp); + pddrop(pdp); + return (pwd); +} + static struct pwd * pwd_alloc(void) { diff --git a/sys/sys/filedesc.h b/sys/sys/filedesc.h index 7f18d8a2286c..f17fdf601ba1 100644 --- a/sys/sys/filedesc.h +++ b/sys/sys/filedesc.h @@ -341,6 +341,7 @@ void pwd_set_rootvnode(void); struct pwd *pwd_hold_pwddesc(struct pwddesc *pdp); bool pwd_hold_smr(struct pwd *pwd); +struct pwd *pwd_hold_proc(struct proc *p); struct pwd *pwd_hold(struct thread *td); void pwd_drop(struct pwd *pwd); static inline void From owner-dev-commits-src-main@freebsd.org Thu Sep 30 11:01:27 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id F08F36AFAA8; Thu, 30 Sep 2021 11:01:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HKr076MFWz3Gk1; Thu, 30 Sep 2021 11:01:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BB5872A88; Thu, 30 Sep 2021 11:01:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18UB1RGX009031; Thu, 30 Sep 2021 11:01:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18UB1Rur009030; Thu, 30 Sep 2021 11:01:27 GMT (envelope-from git) Date: Thu, 30 Sep 2021 11:01:27 GMT Message-Id: <202109301101.18UB1Rur009030@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mateusz Guzik Subject: git: 69ab52838655 - main - linprocfs: find cwd and root handling MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mjg X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 69ab52838655912cf89699e0b2d21d244d3b9b27 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Sep 2021 11:01:28 -0000 The branch main has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=69ab52838655912cf89699e0b2d21d244d3b9b27 commit 69ab52838655912cf89699e0b2d21d244d3b9b27 Author: Mateusz Guzik AuthorDate: 2021-09-30 10:50:18 +0000 Commit: Mateusz Guzik CommitDate: 2021-09-30 10:59:58 +0000 linprocfs: find cwd and root handling The code would incorrectly use curthread instead of the target proc to resolve vnodes. Fixes: 8d03b99b9dafe928 ("fd: move vnodes out of filedesc into a dedicated structure") PR: 258729 Noted by: Damjan Jovanovic --- sys/compat/linprocfs/linprocfs.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/compat/linprocfs/linprocfs.c b/sys/compat/linprocfs/linprocfs.c index ae5823d96fdf..18dec7e01aae 100644 --- a/sys/compat/linprocfs/linprocfs.c +++ b/sys/compat/linprocfs/linprocfs.c @@ -1169,7 +1169,7 @@ linprocfs_doproccwd(PFS_FILL_ARGS) char *fullpath = "unknown"; char *freepath = NULL; - pwd = pwd_hold(td); + pwd = pwd_hold_proc(p); vn_fullpath(pwd->pwd_cdir, &fullpath, &freepath); sbuf_printf(sb, "%s", fullpath); if (freepath) @@ -1189,7 +1189,7 @@ linprocfs_doprocroot(PFS_FILL_ARGS) char *fullpath = "unknown"; char *freepath = NULL; - pwd = pwd_hold(td); + pwd = pwd_hold_proc(p); vp = jailed(p->p_ucred) ? pwd->pwd_jdir : pwd->pwd_rdir; vn_fullpath(vp, &fullpath, &freepath); sbuf_printf(sb, "%s", fullpath); From owner-dev-commits-src-main@freebsd.org Thu Sep 30 13:33:38 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9C1666B14DC for ; Thu, 30 Sep 2021 13:33:38 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-ua1-x92b.google.com (mail-ua1-x92b.google.com [IPv6:2607:f8b0:4864:20::92b]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HKvMk3Vtpz3kDW for ; Thu, 30 Sep 2021 13:33:38 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-ua1-x92b.google.com with SMTP id b34so4199006uad.8 for ; Thu, 30 Sep 2021 06:33:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20210112.gappssmtp.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=qoEfhX16VGpVnWzC/7+0WdYZEAS1KoA9urNmROre28A=; b=hhYnNcGQ8VLIe/1EVQKmYkt8Hwj56KZ6IjHqUD7BiAAEAhGeYgLGjITDAxRp2LZG85 EKo8lvWelDV7cKsTM+wVfUEiFHDvE2Y7HQQ/rr1GtZG/GipWmCU1lBxn8LEV0gdkuheG REiFOcVrQ/GAdougTucwfFS0kbvrzJetUzuC49E6qeJNUY/fpPVh82f+bWBqK9GAtdIr KnkuTukb1wd1yDslMoJz4lWyOEaq5LkkVgnHPdtt5qJN4LPEtX49JvtkbN3FHUN19LHH 9PjQrclxBXWTC+1YoeuZK6b08zwWEhrvzJvETHnqWs0BNi1Nj5hvAFXCrA3WCP1m4hoc nsrw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=qoEfhX16VGpVnWzC/7+0WdYZEAS1KoA9urNmROre28A=; b=TOMV9Vc4L1Ys3I0Zr9OAALU16Qc51a1CwbLLzirsoyP6vnROQd9nNaIMjBpA1pRjBw dfcnsc1URDg822pQaBZ9G+9icUjoDkaJpJ9A9rdgUxieHSBZMgEQzPcLSXdT3Yu3BLe1 17q/OW02Tpm6WcqfrwX7XVZGZ+GGOrOP+1VhBIbGtK6pEQxpaQ/+xRW0/iUH4tU6vbXq v0GAskDkLsBCKQIcV8v2taS5aK2GRY0H3+b5wgQlvVVCKosAmX6CUfhDQFAIjGeZQEGq WlbXs+vaBNeLHe1TK9tN0A2QgkMk+J09G5oIqoc5MkXHGT+orY9Mdc5F/46/U+n3I2cI V8mA== X-Gm-Message-State: AOAM533d/Cjf4SWsuEszaivYqpGcqVaa+zoiJ1wd2Ljuh9Vv0Er6W3gH 3V9SLL81rIQlrNJEE6btbf40XC6IKtaCvdi0yUy5Pg== X-Google-Smtp-Source: ABdhPJwTCnfHnrc5KlZVdXG9PwfHI/OQEYdd33ASU+E5fz4PMb/Ary6n/NHmD9gybaqECLJlhlD59vrPqwgSmXs3ZKU= X-Received: by 2002:a9f:23d0:: with SMTP id 74mr5406973uao.69.1633008817739; Thu, 30 Sep 2021 06:33:37 -0700 (PDT) MIME-Version: 1.0 References: <202109300200.18U20EZD084710@gitrepo.freebsd.org> <20210930111120.e038ca0a2a3c770f4778fa84@bidouilliste.com> In-Reply-To: <20210930111120.e038ca0a2a3c770f4778fa84@bidouilliste.com> From: Warner Losh Date: Thu, 30 Sep 2021 07:33:26 -0600 Message-ID: Subject: Re: git: 79a100e28e3c - main - bluetooth: complete removal of ng_h4 To: Emmanuel Vadot Cc: Warner Losh , src-committers , "" , dev-commits-src-main@freebsd.org X-Rspamd-Queue-Id: 4HKvMk3Vtpz3kDW X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.34 X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Sep 2021 13:33:38 -0000 On Thu, Sep 30, 2021 at 3:11 AM Emmanuel Vadot wrote: > On Thu, 30 Sep 2021 02:00:14 GMT > Warner Losh wrote: > > > The branch main has been updated by imp: > > > > URL: > https://cgit.FreeBSD.org/src/commit/?id=79a100e28e3c814773bb4c1826cfa25fbe31140e > > > > commit 79a100e28e3c814773bb4c1826cfa25fbe31140e > > Author: Warner Losh > > AuthorDate: 2021-09-05 18:41:16 +0000 > > Commit: Warner Losh > > CommitDate: 2021-09-30 02:00:02 +0000 > > > > bluetooth: complete removal of ng_h4 > > > > The ng_h4 module was disconnected 13 years ago when the tty later was > > locked by Ed. It completely fails to compile, and has a number of > false > > positives for Giant use. Remove it for lack of interest. Bluetooth > has > > largely (completely?) moved on from bluetooth over UART transport. > > > > OK'd by: emax > > Sponsored by: Netflix > > Differential Revision: https://reviews.freebsd.org/D31846 > > Every BT+WIFI combo chip used in SBC uses uart for bluetooth. > I have no idea if it uses this or need something else as I've never > looked. > But anyway, if it fails to compile now I'm fine with removing it, if > someone wants to add support for bluetooth to SBC they could always > revive this code. > Yes. If there's a need, we can revive the code... once it's fixed... It looked to take a bit more time than I had.... I've had others make the same or similar correction... Warner From owner-dev-commits-src-main@freebsd.org Thu Sep 30 14:17:21 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 20AFD6B1D6C; Thu, 30 Sep 2021 14:17:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HKwL90K1Xz3nrp; Thu, 30 Sep 2021 14:17:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DEE425157; Thu, 30 Sep 2021 14:17:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18UEHKPu065918; Thu, 30 Sep 2021 14:17:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18UEHKYt065917; Thu, 30 Sep 2021 14:17:20 GMT (envelope-from git) Date: Thu, 30 Sep 2021 14:17:20 GMT Message-Id: <202109301417.18UEHKYt065917@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mitchell Horne Subject: git: 937539e0a32c - main - libpmc: fix the 'cycles' event alias on x86 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mhorne X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 937539e0a32ce1da46223664ca1cf3b252e02ece Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Sep 2021 14:17:21 -0000 The branch main has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=937539e0a32ce1da46223664ca1cf3b252e02ece commit 937539e0a32ce1da46223664ca1cf3b252e02ece Author: Mitchell Horne AuthorDate: 2021-09-30 14:11:36 +0000 Commit: Mitchell Horne CommitDate: 2021-09-30 14:15:26 +0000 libpmc: fix the 'cycles' event alias on x86 Looking for "tsc-tsc" in the pmu tables will fail every time. Instead, make this an alias for the static TSC event defined in pmc_events.h. This fixes 'pmcstat -s cycles' on Intel and AMD. Reviewed by: emaste MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D32197 --- lib/libpmc/libpmc.c | 2 +- lib/libpmc/libpmc_pmu_util.c | 1 - sys/dev/hwpmc/pmc_events.h | 3 +++ 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/libpmc/libpmc.c b/lib/libpmc/libpmc.c index 4ff7eb893959..4df888f497c0 100644 --- a/lib/libpmc/libpmc.c +++ b/lib/libpmc/libpmc.c @@ -178,7 +178,7 @@ static const struct pmc_event_descr cortex_a76_event_table[] = static const struct pmc_event_descr tsc_event_table[] = { - __PMC_EV_TSC() + __PMC_EV_ALIAS_TSC() }; #undef PMC_CLASS_TABLE_DESC diff --git a/lib/libpmc/libpmc_pmu_util.c b/lib/libpmc/libpmc_pmu_util.c index edd99357678e..2584f08b8dc3 100644 --- a/lib/libpmc/libpmc_pmu_util.c +++ b/lib/libpmc/libpmc_pmu_util.c @@ -74,7 +74,6 @@ static struct pmu_alias pmu_intel_alias_table[] = { {"BRANCH-INSTRUCTION-RETIRED", "BR_INST_RETIRED.ALL_BRANCHES"}, {"BRANCH_MISSES_RETIRED", "BR_MISP_RETIRED.ALL_BRANCHES"}, {"BRANCH-MISSES-RETIRED", "BR_MISP_RETIRED.ALL_BRANCHES"}, - {"cycles", "tsc-tsc"}, {"unhalted-cycles", "CPU_CLK_UNHALTED.THREAD_P_ANY"}, {"instructions", "inst_retired.any_p"}, {"branch-mispredicts", "br_misp_retired.all_branches"}, diff --git a/sys/dev/hwpmc/pmc_events.h b/sys/dev/hwpmc/pmc_events.h index ae56685f5fc5..e319d72f3fa8 100644 --- a/sys/dev/hwpmc/pmc_events.h +++ b/sys/dev/hwpmc/pmc_events.h @@ -54,6 +54,9 @@ #define PMC_EV_TSC_FIRST PMC_EV_TSC_TSC #define PMC_EV_TSC_LAST PMC_EV_TSC_TSC +#define __PMC_EV_ALIAS_TSC() \ +__PMC_EV_ALIAS("cycles", TSC_TSC) + /* * Software events are dynamically defined. */ From owner-dev-commits-src-main@freebsd.org Thu Sep 30 14:17:22 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6FC776B21F1; Thu, 30 Sep 2021 14:17:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HKwLB23kfz3nRp; Thu, 30 Sep 2021 14:17:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 25C36567C; Thu, 30 Sep 2021 14:17:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18UEHL1q065947; Thu, 30 Sep 2021 14:17:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18UEHLJm065946; Thu, 30 Sep 2021 14:17:21 GMT (envelope-from git) Date: Thu, 30 Sep 2021 14:17:21 GMT Message-Id: <202109301417.18UEHLJm065946@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mitchell Horne Subject: git: a20c10893eb1 - main - libpmc: add some AMD pmu counter aliases MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mhorne X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a20c10893eb17e281f119d1b9b39c175dbf4d7bd Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Sep 2021 14:17:22 -0000 The branch main has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=a20c10893eb17e281f119d1b9b39c175dbf4d7bd commit a20c10893eb17e281f119d1b9b39c175dbf4d7bd Author: Mitchell Horne AuthorDate: 2021-09-30 14:13:37 +0000 Commit: Mitchell Horne CommitDate: 2021-09-30 14:15:26 +0000 libpmc: add some AMD pmu counter aliases Make it mostly compatible with what's defined for Intel. Except where noted, these are defined for all of amdzen(1|2|3). Reviewed by: emaste MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D32162 --- lib/libpmc/libpmc_pmu_util.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/lib/libpmc/libpmc_pmu_util.c b/lib/libpmc/libpmc_pmu_util.c index 2584f08b8dc3..0f9fc0391589 100644 --- a/lib/libpmc/libpmc_pmu_util.c +++ b/lib/libpmc/libpmc_pmu_util.c @@ -86,6 +86,19 @@ static struct pmu_alias pmu_intel_alias_table[] = { static struct pmu_alias pmu_amd_alias_table[] = { {"UNHALTED_CORE_CYCLES", "ls_not_halted_cyc"}, {"UNHALTED-CORE-CYCLES", "ls_not_halted_cyc"}, + {"LLC_MISSES", "l3_comb_clstr_state.request_miss"}, + {"LLC-MISSES", "l3_comb_clstr_state.request_miss"}, + {"LLC_REFERENCE", "l3_request_g1.caching_l3_cache_accesses"}, + {"LLC-REFERENCE", "l3_request_g1.caching_l3_cache_accesses"}, + {"BRANCH_INSTRUCTION_RETIRED", "ex_ret_brn"}, + {"BRANCH-INSTRUCTION-RETIRED", "ex_ret_brn"}, + {"BRANCH_MISSES_RETIRED", "ex_ret_brn_misp"}, + {"BRANCH-MISSES-RETIRED", "ex_ret_brn_misp"}, + {"unhalted-cycles", "ls_not_halted_cyc"}, + {"instructions", "ex_ret_instr",}, + {"branch-mispredicts", "ex_ret_brn_misp"}, + {"branches", "ex_ret_brn"}, + {"interrupts", "ls_int_taken"}, /* Not on amdzen1 */ {NULL, NULL}, }; From owner-dev-commits-src-main@freebsd.org Thu Sep 30 14:49:35 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4C6DD6B25FE; Thu, 30 Sep 2021 14:49:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HKx3M1fQPz3qZ8; Thu, 30 Sep 2021 14:49:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1876B5C2C; Thu, 30 Sep 2021 14:49:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18UEnZ4P006066; Thu, 30 Sep 2021 14:49:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18UEnYIr006065; Thu, 30 Sep 2021 14:49:34 GMT (envelope-from git) Date: Thu, 30 Sep 2021 14:49:34 GMT Message-Id: <202109301449.18UEnYIr006065@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 11572d7d7fb9 - main - net80211: reject mixed plaintext/encrypted fragments MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 11572d7d7fb9802ceb46ea9dc6cbe3bb95373e55 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Sep 2021 14:49:35 -0000 The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=11572d7d7fb9802ceb46ea9dc6cbe3bb95373e55 commit 11572d7d7fb9802ceb46ea9dc6cbe3bb95373e55 Author: Mathy Vanhoef AuthorDate: 2021-06-06 22:10:41 +0000 Commit: Bjoern A. Zeeb CommitDate: 2021-09-30 14:47:41 +0000 net80211: reject mixed plaintext/encrypted fragments ieee80211_defrag() accepts fragmented 802.11 frames in a protected Wi-Fi network even when some of the fragments are not encrypted. Track whether the fragments are encrypted or not and only accept successive ones if they match the state of the first fragment. This relates to section 6.3 in the 2021 Usenix "FragAttacks" (Fragment and Forge: Breaking Wi-Fi Through Frame Aggregation and Fragmentation) paper. Submitted by: Mathy Vanhoef (Mathy.Vanhoef kuleuven.be) Security: CVE-2020-26147 PR: 256118 Differential Revision: https://reviews.freebsd.org/D30663 --- sys/net80211/ieee80211_adhoc.c | 2 +- sys/net80211/ieee80211_hostap.c | 2 +- sys/net80211/ieee80211_input.c | 21 ++++++++++++++++++--- sys/net80211/ieee80211_input.h | 2 +- sys/net80211/ieee80211_mesh.c | 2 +- sys/net80211/ieee80211_sta.c | 2 +- sys/net80211/ieee80211_wds.c | 2 +- 7 files changed, 24 insertions(+), 9 deletions(-) diff --git a/sys/net80211/ieee80211_adhoc.c b/sys/net80211/ieee80211_adhoc.c index ea1519b3381d..a23f138802dc 100644 --- a/sys/net80211/ieee80211_adhoc.c +++ b/sys/net80211/ieee80211_adhoc.c @@ -531,7 +531,7 @@ adhoc_input(struct ieee80211_node *ni, struct mbuf *m, * Next up, any fragmentation. */ if (!IEEE80211_IS_MULTICAST(wh->i_addr1)) { - m = ieee80211_defrag(ni, m, hdrspace); + m = ieee80211_defrag(ni, m, hdrspace, has_decrypted); if (m == NULL) { /* Fragment dropped or frame not complete yet */ goto out; diff --git a/sys/net80211/ieee80211_hostap.c b/sys/net80211/ieee80211_hostap.c index 16a3d97ae7f2..15d42a682355 100644 --- a/sys/net80211/ieee80211_hostap.c +++ b/sys/net80211/ieee80211_hostap.c @@ -719,7 +719,7 @@ hostap_input(struct ieee80211_node *ni, struct mbuf *m, * Next up, any fragmentation. */ if (!IEEE80211_IS_MULTICAST(wh->i_addr1)) { - m = ieee80211_defrag(ni, m, hdrspace); + m = ieee80211_defrag(ni, m, hdrspace, has_decrypted); if (m == NULL) { /* Fragment dropped or frame not complete yet */ goto out; diff --git a/sys/net80211/ieee80211_input.c b/sys/net80211/ieee80211_input.c index aa557fc1ec24..eaeceb9d228e 100644 --- a/sys/net80211/ieee80211_input.c +++ b/sys/net80211/ieee80211_input.c @@ -170,7 +170,8 @@ ieee80211_input_mimo_all(struct ieee80211com *ic, struct mbuf *m) * XXX should handle 3 concurrent reassemblies per-spec. */ struct mbuf * -ieee80211_defrag(struct ieee80211_node *ni, struct mbuf *m, int hdrspace) +ieee80211_defrag(struct ieee80211_node *ni, struct mbuf *m, int hdrspace, + int has_decrypted) { struct ieee80211vap *vap = ni->ni_vap; struct ieee80211_frame *wh = mtod(m, struct ieee80211_frame *); @@ -189,6 +190,11 @@ ieee80211_defrag(struct ieee80211_node *ni, struct mbuf *m, int hdrspace) if (!more_frag && fragno == 0 && ni->ni_rxfrag[0] == NULL) return m; + /* Temporarily set flag to remember if fragment was encrypted. */ + /* XXX use a non-packet altering storage for this in the future. */ + if (has_decrypted) + wh->i_fc[1] |= IEEE80211_FC1_PROTECTED; + /* * Remove frag to insure it doesn't get reaped by timer. */ @@ -219,10 +225,14 @@ ieee80211_defrag(struct ieee80211_node *ni, struct mbuf *m, int hdrspace) lwh = mtod(mfrag, struct ieee80211_frame *); last_rxseq = le16toh(*(uint16_t *)lwh->i_seq); - /* NB: check seq # and frag together */ + /* + * NB: check seq # and frag together. Also check that both + * fragments are plaintext or that both are encrypted. + */ if (rxseq == last_rxseq+1 && IEEE80211_ADDR_EQ(wh->i_addr1, lwh->i_addr1) && - IEEE80211_ADDR_EQ(wh->i_addr2, lwh->i_addr2)) { + IEEE80211_ADDR_EQ(wh->i_addr2, lwh->i_addr2) && + !((wh->i_fc[1] ^ lwh->i_fc[1]) & IEEE80211_FC1_PROTECTED)) { /* XXX clear MORE_FRAG bit? */ /* track last seqnum and fragno */ *(uint16_t *) lwh->i_seq = *(uint16_t *) wh->i_seq; @@ -253,6 +263,11 @@ ieee80211_defrag(struct ieee80211_node *ni, struct mbuf *m, int hdrspace) ni->ni_rxfrag[0] = mfrag; mfrag = NULL; } + /* Remember to clear protected flag that was temporarily set. */ + if (mfrag != NULL) { + wh = mtod(mfrag, struct ieee80211_frame *); + wh->i_fc[1] &= ~IEEE80211_FC1_PROTECTED; + } return mfrag; } diff --git a/sys/net80211/ieee80211_input.h b/sys/net80211/ieee80211_input.h index 7456fc68b365..61e3099cb0a4 100644 --- a/sys/net80211/ieee80211_input.h +++ b/sys/net80211/ieee80211_input.h @@ -309,7 +309,7 @@ fail: void ieee80211_deliver_data(struct ieee80211vap *, struct ieee80211_node *, struct mbuf *); struct mbuf *ieee80211_defrag(struct ieee80211_node *, - struct mbuf *, int); + struct mbuf *, int, int); struct mbuf *ieee80211_realign(struct ieee80211vap *, struct mbuf *, size_t); struct mbuf *ieee80211_decap(struct ieee80211vap *, struct mbuf *, int); struct mbuf *ieee80211_decap1(struct mbuf *, int *); diff --git a/sys/net80211/ieee80211_mesh.c b/sys/net80211/ieee80211_mesh.c index b4326905a7a3..8dcbfa918e3b 100644 --- a/sys/net80211/ieee80211_mesh.c +++ b/sys/net80211/ieee80211_mesh.c @@ -1641,7 +1641,7 @@ mesh_input(struct ieee80211_node *ni, struct mbuf *m, */ hdrspace = ieee80211_hdrspace(ic, wh); if (!IEEE80211_IS_MULTICAST(wh->i_addr1)) { - m = ieee80211_defrag(ni, m, hdrspace); + m = ieee80211_defrag(ni, m, hdrspace, 0); if (m == NULL) { /* Fragment dropped or frame not complete yet */ goto out; diff --git a/sys/net80211/ieee80211_sta.c b/sys/net80211/ieee80211_sta.c index 43dc8b6dfeca..6d24eadc11a6 100644 --- a/sys/net80211/ieee80211_sta.c +++ b/sys/net80211/ieee80211_sta.c @@ -795,7 +795,7 @@ sta_input(struct ieee80211_node *ni, struct mbuf *m, * Next up, any fragmentation. */ if (!IEEE80211_IS_MULTICAST(wh->i_addr1)) { - m = ieee80211_defrag(ni, m, hdrspace); + m = ieee80211_defrag(ni, m, hdrspace, has_decrypted); if (m == NULL) { /* Fragment dropped or frame not complete yet */ goto out; diff --git a/sys/net80211/ieee80211_wds.c b/sys/net80211/ieee80211_wds.c index 8eaffcf87733..f59a92b992d7 100644 --- a/sys/net80211/ieee80211_wds.c +++ b/sys/net80211/ieee80211_wds.c @@ -594,7 +594,7 @@ wds_input(struct ieee80211_node *ni, struct mbuf *m, * Next up, any fragmentation. */ if (!IEEE80211_IS_MULTICAST(wh->i_addr1)) { - m = ieee80211_defrag(ni, m, hdrspace); + m = ieee80211_defrag(ni, m, hdrspace, has_decrypted); if (m == NULL) { /* Fragment dropped or frame not complete yet */ goto out; From owner-dev-commits-src-main@freebsd.org Thu Sep 30 14:52:23 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 30FB96B2856; Thu, 30 Sep 2021 14:52:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HKx6b0xC7z3qyW; Thu, 30 Sep 2021 14:52:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 003A05CA3; Thu, 30 Sep 2021 14:52:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18UEqMX0016270; Thu, 30 Sep 2021 14:52:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18UEqMXl016269; Thu, 30 Sep 2021 14:52:22 GMT (envelope-from git) Date: Thu, 30 Sep 2021 14:52:22 GMT Message-Id: <202109301452.18UEqMXl016269@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: f024bdf1155f - main - net80211: mitigation against A-MSDU design flaw MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f024bdf1155f36d2d8c4caa533b66e4040c4c469 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Sep 2021 14:52:23 -0000 The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=f024bdf1155f36d2d8c4caa533b66e4040c4c469 commit f024bdf1155f36d2d8c4caa533b66e4040c4c469 Author: Mathy Vanhoef AuthorDate: 2021-06-06 22:10:52 +0000 Commit: Bjoern A. Zeeb CommitDate: 2021-09-30 14:50:45 +0000 net80211: mitigation against A-MSDU design flaw Mitigate A-MSDU injection attacks by detecting if the destination address of a subframe equals an RFC1042 (i.e., LLC/SNAP) header, and if so dropping the complete A-MSDU frame. This mitigates known attacks, although new (unknown) aggregation-based attacks may remain possible. This defense works because in A-MSDU aggregation injection attacks, a normal encrypted Wi-Fi frame is turned into an A-MSDU frame. This means the first 6 bytes of the first A-MSDU subframe correspond to an RFC1042 header. In other words, the destination MAC address of the first A-MSDU subframe contains the start of an RFC1042 header during an aggregation attack. We can detect this and thereby prevent this specific attack. This relates to section 7.2 in the 2021 Usenix "FragAttacks" (Fragment and Forge: Breaking Wi-Fi Through Frame Aggregation and Fragmentation) paper. Submitted by: Mathy Vanhoef (Mathy.Vanhoef kuleuven.be) Security: CVE-2020-24588 PR: 256119 Differential Revision: https://reviews.freebsd.org/D30664 --- sys/net80211/ieee80211_adhoc.c | 2 +- sys/net80211/ieee80211_hostap.c | 2 +- sys/net80211/ieee80211_input.c | 20 ++++++++++++++++++-- sys/net80211/ieee80211_input.h | 3 ++- sys/net80211/ieee80211_sta.c | 2 +- sys/net80211/ieee80211_wds.c | 2 +- 6 files changed, 24 insertions(+), 7 deletions(-) diff --git a/sys/net80211/ieee80211_adhoc.c b/sys/net80211/ieee80211_adhoc.c index a23f138802dc..e2164bbb46a1 100644 --- a/sys/net80211/ieee80211_adhoc.c +++ b/sys/net80211/ieee80211_adhoc.c @@ -558,7 +558,7 @@ adhoc_input(struct ieee80211_node *ni, struct mbuf *m, /* * Finally, strip the 802.11 header. */ - m = ieee80211_decap(vap, m, hdrspace); + m = ieee80211_decap(vap, m, hdrspace, qos); if (m == NULL) { /* XXX mask bit to check for both */ /* don't count Null data frames as errors */ diff --git a/sys/net80211/ieee80211_hostap.c b/sys/net80211/ieee80211_hostap.c index 15d42a682355..75fa1c0f7b31 100644 --- a/sys/net80211/ieee80211_hostap.c +++ b/sys/net80211/ieee80211_hostap.c @@ -744,7 +744,7 @@ hostap_input(struct ieee80211_node *ni, struct mbuf *m, /* * Finally, strip the 802.11 header. */ - m = ieee80211_decap(vap, m, hdrspace); + m = ieee80211_decap(vap, m, hdrspace, qos); if (m == NULL) { /* XXX mask bit to check for both */ /* don't count Null data frames as errors */ diff --git a/sys/net80211/ieee80211_input.c b/sys/net80211/ieee80211_input.c index eaeceb9d228e..66a5ba1c4035 100644 --- a/sys/net80211/ieee80211_input.c +++ b/sys/net80211/ieee80211_input.c @@ -309,7 +309,8 @@ ieee80211_deliver_data(struct ieee80211vap *vap, } struct mbuf * -ieee80211_decap(struct ieee80211vap *vap, struct mbuf *m, int hdrlen) +ieee80211_decap(struct ieee80211vap *vap, struct mbuf *m, int hdrlen, + uint8_t qos) { struct ieee80211_qosframe_addr4 wh; struct ether_header *eh; @@ -331,7 +332,9 @@ ieee80211_decap(struct ieee80211vap *vap, struct mbuf *m, int hdrlen) llc->llc_snap.org_code[1] == 0 && llc->llc_snap.org_code[2] == 0 && /* NB: preserve AppleTalk frames that have a native SNAP hdr */ !(llc->llc_snap.ether_type == htons(ETHERTYPE_AARP) || - llc->llc_snap.ether_type == htons(ETHERTYPE_IPX))) { + llc->llc_snap.ether_type == htons(ETHERTYPE_IPX)) && + /* Do not want to touch A-MSDU frames. */ + !(qos & IEEE80211_QOS_AMSDU)) { m_adj(m, hdrlen + sizeof(struct llc) - sizeof(*eh)); llc = NULL; } else { @@ -379,6 +382,10 @@ ieee80211_decap1(struct mbuf *m, int *framelen) #define FF_LLC_SIZE (sizeof(struct ether_header) + sizeof(struct llc)) struct ether_header *eh; struct llc *llc; + const uint8_t llc_hdr_mac[ETHER_ADDR_LEN] = { + /* MAC address matching the 802.2 LLC header */ + LLC_SNAP_LSAP, LLC_SNAP_LSAP, LLC_UI, 0, 0, 0 + }; /* * The frame has an 802.3 header followed by an 802.2 @@ -391,6 +398,15 @@ ieee80211_decap1(struct mbuf *m, int *framelen) if (m->m_len < FF_LLC_SIZE && (m = m_pullup(m, FF_LLC_SIZE)) == NULL) return NULL; eh = mtod(m, struct ether_header *); /* 802.3 header is first */ + + /* + * Detect possible attack where a single 802.11 frame is processed + * as an A-MSDU frame due to an adversary setting the A-MSDU present + * bit in the 802.11 QoS header. [FragAttacks] + */ + if (memcmp(eh->ether_dhost, llc_hdr_mac, ETHER_ADDR_LEN) == 0) + return NULL; + llc = (struct llc *)&eh[1]; /* 802.2 header follows */ *framelen = ntohs(eh->ether_type) /* encap'd frame size */ + sizeof(struct ether_header) - sizeof(struct llc); diff --git a/sys/net80211/ieee80211_input.h b/sys/net80211/ieee80211_input.h index 61e3099cb0a4..2192bba405d2 100644 --- a/sys/net80211/ieee80211_input.h +++ b/sys/net80211/ieee80211_input.h @@ -311,7 +311,8 @@ void ieee80211_deliver_data(struct ieee80211vap *, struct mbuf *ieee80211_defrag(struct ieee80211_node *, struct mbuf *, int, int); struct mbuf *ieee80211_realign(struct ieee80211vap *, struct mbuf *, size_t); -struct mbuf *ieee80211_decap(struct ieee80211vap *, struct mbuf *, int); +struct mbuf *ieee80211_decap(struct ieee80211vap *, struct mbuf *, int, + uint8_t); struct mbuf *ieee80211_decap1(struct mbuf *, int *); int ieee80211_setup_rates(struct ieee80211_node *ni, const uint8_t *rates, const uint8_t *xrates, int flags); diff --git a/sys/net80211/ieee80211_sta.c b/sys/net80211/ieee80211_sta.c index 6d24eadc11a6..60a5ea100556 100644 --- a/sys/net80211/ieee80211_sta.c +++ b/sys/net80211/ieee80211_sta.c @@ -827,7 +827,7 @@ sta_input(struct ieee80211_node *ni, struct mbuf *m, /* * Finally, strip the 802.11 header. */ - m = ieee80211_decap(vap, m, hdrspace); + m = ieee80211_decap(vap, m, hdrspace, qos); if (m == NULL) { /* XXX mask bit to check for both */ /* don't count Null data frames as errors */ diff --git a/sys/net80211/ieee80211_wds.c b/sys/net80211/ieee80211_wds.c index f59a92b992d7..f88871ca4ae6 100644 --- a/sys/net80211/ieee80211_wds.c +++ b/sys/net80211/ieee80211_wds.c @@ -621,7 +621,7 @@ wds_input(struct ieee80211_node *ni, struct mbuf *m, /* * Finally, strip the 802.11 header. */ - m = ieee80211_decap(vap, m, hdrspace); + m = ieee80211_decap(vap, m, hdrspace, qos); if (m == NULL) { /* XXX mask bit to check for both */ /* don't count Null data frames as errors */ From owner-dev-commits-src-main@freebsd.org Thu Sep 30 14:55:18 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B644B6B2AEF; Thu, 30 Sep 2021 14:55:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HKx9y4mp0z3rTM; Thu, 30 Sep 2021 14:55:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 841055DBE; Thu, 30 Sep 2021 14:55:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18UEtIUn018974; Thu, 30 Sep 2021 14:55:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18UEtI0O018973; Thu, 30 Sep 2021 14:55:18 GMT (envelope-from git) Date: Thu, 30 Sep 2021 14:55:18 GMT Message-Id: <202109301455.18UEtI0O018973@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: ffc19cf52da5 - main - net80211: prevent plaintext injection by A-MSDU RFC1042/EAPOL frames MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ffc19cf52da5546973965f78cf32aa0f2c9657f8 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Sep 2021 14:55:18 -0000 The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=ffc19cf52da5546973965f78cf32aa0f2c9657f8 commit ffc19cf52da5546973965f78cf32aa0f2c9657f8 Author: Mathy Vanhoef AuthorDate: 2021-06-06 22:10:56 +0000 Commit: Bjoern A. Zeeb CommitDate: 2021-09-30 14:54:04 +0000 net80211: prevent plaintext injection by A-MSDU RFC1042/EAPOL frames No longer accept plaintext A-MSDU frames that start with an RFC1042 header with EtherType EAPOL. This is done by only accepting EAPOL packets that are included in non-aggregated 802.11 frames. Note that before this patch, FreeBSD also only accepted EAPOL frames that are sent in a non-aggregated 802.11 frame due to bugs in processing EAPOL packets inside A-MSDUs. In other words, compatibility with legitimate devices remains the same. This relates to section 6.5 in the 2021 Usenix "FragAttacks" (Fragment and Forge: Breaking Wi-Fi Through Frame Aggregation and Fragmentation) paper. Submitted by: Mathy Vanhoef (Mathy.Vanhoef kuleuven.be) Security: CVE-2020-26144 PR: 256120 MFC after: 7 days Differential Revision: https://reviews.freebsd.org/D30665 --- sys/net80211/ieee80211_adhoc.c | 18 ++++++++++++------ sys/net80211/ieee80211_hostap.c | 18 ++++++++++++------ sys/net80211/ieee80211_sta.c | 18 ++++++++++++------ sys/net80211/ieee80211_wds.c | 18 ++++++++++++------ 4 files changed, 48 insertions(+), 24 deletions(-) diff --git a/sys/net80211/ieee80211_adhoc.c b/sys/net80211/ieee80211_adhoc.c index e2164bbb46a1..150515222268 100644 --- a/sys/net80211/ieee80211_adhoc.c +++ b/sys/net80211/ieee80211_adhoc.c @@ -571,7 +571,10 @@ adhoc_input(struct ieee80211_node *ni, struct mbuf *m, IEEE80211_NODE_STAT(ni, rx_decap); goto err; } - eh = mtod(m, struct ether_header *); + if (!(qos & IEEE80211_QOS_AMSDU)) + eh = mtod(m, struct ether_header *); + else + eh = NULL; if (!ieee80211_node_is_authorized(ni)) { /* * Deny any non-PAE frames received prior to @@ -581,11 +584,13 @@ adhoc_input(struct ieee80211_node *ni, struct mbuf *m, * the port is not marked authorized by the * authenticator until the handshake has completed. */ - if (eh->ether_type != htons(ETHERTYPE_PAE)) { + if (eh == NULL || + eh->ether_type != htons(ETHERTYPE_PAE)) { IEEE80211_DISCARD_MAC(vap, IEEE80211_MSG_INPUT, - eh->ether_shost, "data", - "unauthorized port: ether type 0x%x len %u", - eh->ether_type, m->m_pkthdr.len); + ni->ni_macaddr, "data", "unauthorized or " + "unknown port: ether type 0x%x len %u", + eh == NULL ? -1 : eh->ether_type, + m->m_pkthdr.len); vap->iv_stats.is_rx_unauth++; IEEE80211_NODE_STAT(ni, rx_unauth); goto err; @@ -598,7 +603,8 @@ adhoc_input(struct ieee80211_node *ni, struct mbuf *m, if ((vap->iv_flags & IEEE80211_F_DROPUNENC) && ((has_decrypted == 0) && (m->m_flags & M_WEP) == 0) && (is_hw_decrypted == 0) && - eh->ether_type != htons(ETHERTYPE_PAE)) { + (eh == NULL || + eh->ether_type != htons(ETHERTYPE_PAE))) { /* * Drop unencrypted frames. */ diff --git a/sys/net80211/ieee80211_hostap.c b/sys/net80211/ieee80211_hostap.c index 75fa1c0f7b31..4fa9c6a72145 100644 --- a/sys/net80211/ieee80211_hostap.c +++ b/sys/net80211/ieee80211_hostap.c @@ -757,7 +757,10 @@ hostap_input(struct ieee80211_node *ni, struct mbuf *m, IEEE80211_NODE_STAT(ni, rx_decap); goto err; } - eh = mtod(m, struct ether_header *); + if (!(qos & IEEE80211_QOS_AMSDU)) + eh = mtod(m, struct ether_header *); + else + eh = NULL; if (!ieee80211_node_is_authorized(ni)) { /* * Deny any non-PAE frames received prior to @@ -767,11 +770,13 @@ hostap_input(struct ieee80211_node *ni, struct mbuf *m, * the port is not marked authorized by the * authenticator until the handshake has completed. */ - if (eh->ether_type != htons(ETHERTYPE_PAE)) { + if (eh == NULL || + eh->ether_type != htons(ETHERTYPE_PAE)) { IEEE80211_DISCARD_MAC(vap, IEEE80211_MSG_INPUT, - eh->ether_shost, "data", - "unauthorized port: ether type 0x%x len %u", - eh->ether_type, m->m_pkthdr.len); + ni->ni_macaddr, "data", "unauthorized or " + "unknown port: ether type 0x%x len %u", + eh == NULL ? -1 : eh->ether_type, + m->m_pkthdr.len); vap->iv_stats.is_rx_unauth++; IEEE80211_NODE_STAT(ni, rx_unauth); goto err; @@ -784,7 +789,8 @@ hostap_input(struct ieee80211_node *ni, struct mbuf *m, if ((vap->iv_flags & IEEE80211_F_DROPUNENC) && ((has_decrypted == 0) && (m->m_flags & M_WEP) == 0) && (is_hw_decrypted == 0) && - eh->ether_type != htons(ETHERTYPE_PAE)) { + (eh == NULL || + eh->ether_type != htons(ETHERTYPE_PAE))) { /* * Drop unencrypted frames. */ diff --git a/sys/net80211/ieee80211_sta.c b/sys/net80211/ieee80211_sta.c index 60a5ea100556..cd62266ab942 100644 --- a/sys/net80211/ieee80211_sta.c +++ b/sys/net80211/ieee80211_sta.c @@ -840,7 +840,10 @@ sta_input(struct ieee80211_node *ni, struct mbuf *m, IEEE80211_NODE_STAT(ni, rx_decap); goto err; } - eh = mtod(m, struct ether_header *); + if (!(qos & IEEE80211_QOS_AMSDU)) + eh = mtod(m, struct ether_header *); + else + eh = NULL; if (!ieee80211_node_is_authorized(ni)) { /* * Deny any non-PAE frames received prior to @@ -850,11 +853,13 @@ sta_input(struct ieee80211_node *ni, struct mbuf *m, * the port is not marked authorized by the * authenticator until the handshake has completed. */ - if (eh->ether_type != htons(ETHERTYPE_PAE)) { + if (eh == NULL || + eh->ether_type != htons(ETHERTYPE_PAE)) { IEEE80211_DISCARD_MAC(vap, IEEE80211_MSG_INPUT, - eh->ether_shost, "data", - "unauthorized port: ether type 0x%x len %u", - eh->ether_type, m->m_pkthdr.len); + ni->ni_macaddr, "data", "unauthorized or " + "unknown port: ether type 0x%x len %u", + eh == NULL ? -1 : eh->ether_type, + m->m_pkthdr.len); vap->iv_stats.is_rx_unauth++; IEEE80211_NODE_STAT(ni, rx_unauth); goto err; @@ -867,7 +872,8 @@ sta_input(struct ieee80211_node *ni, struct mbuf *m, if ((vap->iv_flags & IEEE80211_F_DROPUNENC) && ((has_decrypted == 0) && (m->m_flags & M_WEP) == 0) && (is_hw_decrypted == 0) && - eh->ether_type != htons(ETHERTYPE_PAE)) { + (eh == NULL || + eh->ether_type != htons(ETHERTYPE_PAE))) { /* * Drop unencrypted frames. */ diff --git a/sys/net80211/ieee80211_wds.c b/sys/net80211/ieee80211_wds.c index f88871ca4ae6..b73988b10d5e 100644 --- a/sys/net80211/ieee80211_wds.c +++ b/sys/net80211/ieee80211_wds.c @@ -634,7 +634,10 @@ wds_input(struct ieee80211_node *ni, struct mbuf *m, IEEE80211_NODE_STAT(ni, rx_decap); goto err; } - eh = mtod(m, struct ether_header *); + if (!(qos & IEEE80211_QOS_AMSDU)) + eh = mtod(m, struct ether_header *); + else + eh = NULL; if (!ieee80211_node_is_authorized(ni)) { /* * Deny any non-PAE frames received prior to @@ -644,11 +647,13 @@ wds_input(struct ieee80211_node *ni, struct mbuf *m, * the port is not marked authorized by the * authenticator until the handshake has completed. */ - if (eh->ether_type != htons(ETHERTYPE_PAE)) { + if (eh == NULL || + eh->ether_type != htons(ETHERTYPE_PAE)) { IEEE80211_DISCARD_MAC(vap, IEEE80211_MSG_INPUT, - eh->ether_shost, "data", - "unauthorized port: ether type 0x%x len %u", - eh->ether_type, m->m_pkthdr.len); + ni->ni_macaddr, "data", "unauthorized or " + "unknown port: ether type 0x%x len %u", + eh == NULL ? -1 : eh->ether_type, + m->m_pkthdr.len); vap->iv_stats.is_rx_unauth++; IEEE80211_NODE_STAT(ni, rx_unauth); goto err; @@ -661,7 +666,8 @@ wds_input(struct ieee80211_node *ni, struct mbuf *m, if ((vap->iv_flags & IEEE80211_F_DROPUNENC) && ((has_decrypted == 0) && (m->m_flags & M_WEP) == 0) && (is_hw_decrypted == 0) && - eh->ether_type != htons(ETHERTYPE_PAE)) { + (eh == NULL || + eh->ether_type != htons(ETHERTYPE_PAE))) { /* * Drop unencrypted frames. */ From owner-dev-commits-src-main@freebsd.org Thu Sep 30 16:13:23 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id F17C06B421B; Thu, 30 Sep 2021 16:13:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HKyw36T7Sz4RjK; Thu, 30 Sep 2021 16:13:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BDF336AF7; Thu, 30 Sep 2021 16:13:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18UGDNoF027671; Thu, 30 Sep 2021 16:13:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18UGDNmG027670; Thu, 30 Sep 2021 16:13:23 GMT (envelope-from git) Date: Thu, 30 Sep 2021 16:13:23 GMT Message-Id: <202109301613.18UGDNmG027670@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ed Maste Subject: git: 1ad2d8777897 - main - mgb: Fix nop admin interrupt handling MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 1ad2d87778970582854082bcedd2df0394fd4933 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Sep 2021 16:13:24 -0000 The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=1ad2d87778970582854082bcedd2df0394fd4933 commit 1ad2d87778970582854082bcedd2df0394fd4933 Author: Ed Maste AuthorDate: 2021-09-29 21:24:39 +0000 Commit: Ed Maste CommitDate: 2021-09-30 15:50:00 +0000 mgb: Fix nop admin interrupt handling Previously mgb_admin_intr printed a diagnostic message if no interrupt status bits were set, but it's not valid to call device_printf() from a filter. Just drop the message as it has no user-facing value. Also return FILTER_STRAY in this case - there is nothing further for the driver to do. Reviewed by: kbowling MFC after: 1 week Fixes: 8890ab7758b8 ("Introduce if_mgb driver...") Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D32231 --- sys/dev/mgb/if_mgb.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/sys/dev/mgb/if_mgb.c b/sys/dev/mgb/if_mgb.c index bc944c92625c..6d94f96c09db 100644 --- a/sys/dev/mgb/if_mgb.c +++ b/sys/dev/mgb/if_mgb.c @@ -779,16 +779,9 @@ mgb_admin_intr(void *xsc) intr_en = CSR_READ_REG(sc, MGB_INTR_ENBL_SET); intr_sts &= intr_en; - /* - * NOTE: Debugging printfs here - * will likely cause interrupt test failure. - */ - /* TODO: shouldn't continue if suspended */ - if ((intr_sts & MGB_INTR_STS_ANY) == 0) { - device_printf(sc->dev, "non-mgb interrupt triggered.\n"); - return (FILTER_SCHEDULE_THREAD); - } + if ((intr_sts & MGB_INTR_STS_ANY) == 0) + return (FILTER_STRAY); if ((intr_sts & MGB_INTR_STS_TEST) != 0) { sc->isr_test_flag = true; CSR_WRITE_REG(sc, MGB_INTR_STS, MGB_INTR_STS_TEST); From owner-dev-commits-src-main@freebsd.org Thu Sep 30 20:35:26 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DBFE16B7C0B; Thu, 30 Sep 2021 20:35:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HL4kQ5rsxz4pt8; Thu, 30 Sep 2021 20:35:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9B5BB1226E; Thu, 30 Sep 2021 20:35:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18UKZQn2074593; Thu, 30 Sep 2021 20:35:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18UKZQiC074592; Thu, 30 Sep 2021 20:35:26 GMT (envelope-from git) Date: Thu, 30 Sep 2021 20:35:26 GMT Message-Id: <202109302035.18UKZQiC074592@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: bf40080762e9 - main - uart: Allow PCI quirk for not using MSI interrupts MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: bf40080762e939b44d4dd0fbfac5127f2a2562ce Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Sep 2021 20:35:26 -0000 The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=bf40080762e939b44d4dd0fbfac5127f2a2562ce commit bf40080762e939b44d4dd0fbfac5127f2a2562ce Author: Warner Losh AuthorDate: 2021-09-30 20:15:32 +0000 Commit: Warner Losh CommitDate: 2021-09-30 20:15:32 +0000 uart: Allow PCI quirk for not using MSI interrupts Some setups claim to have one MSI, but they don't actually work. Allow these to be flagged. Sponsored by: Netflix Reviewed by: kbowling Differential Revision: https://reviews.freebsd.org/D32229 --- sys/dev/uart/uart_bus_pci.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/sys/dev/uart/uart_bus_pci.c b/sys/dev/uart/uart_bus_pci.c index 92046261f544..4090af0ea9a0 100644 --- a/sys/dev/uart/uart_bus_pci.c +++ b/sys/dev/uart/uart_bus_pci.c @@ -75,6 +75,9 @@ struct pci_id { int regshft; }; +#define PCI_NO_MSI 0x40000000 +#define PCI_RID_MASK 0x0000ffff + static const struct pci_id pci_ns8250_ids[] = { { 0x1028, 0x0008, 0xffff, 0, "Dell Remote Access Card III", 0x14, 128 * DEFAULT_RCLK }, @@ -171,7 +174,8 @@ static const struct pci_id pci_ns8250_ids[] = { { 0x8086, 0x8cbd, 0xffff, 0, "Intel Wildcat Point KT Controller", 0x10 }, { 0x8086, 0x9c3d, 0xffff, 0, "Intel Lynx Point-LP HECI KT", 0x10 }, { 0x8086, 0xa13d, 0xffff, 0, - "100 Series/C230 Series Chipset Family KT Redirection", 0x10 }, + "100 Series/C230 Series Chipset Family KT Redirection", + 0x10 | PCI_NO_MSI }, { 0x9710, 0x9820, 0x1000, 1, "NetMos NM9820 Serial Port", 0x10 }, { 0x9710, 0x9835, 0x1000, 1, "NetMos NM9835 Serial Port", 0x10 }, { 0x9710, 0x9865, 0xa000, 0x1000, "NetMos NM9865 Serial Port", 0x10 }, @@ -227,7 +231,8 @@ uart_pci_probe(device_t dev) return (ENXIO); match: - result = uart_bus_probe(dev, id->regshft, 0, id->rclk, id->rid, 0, 0); + result = uart_bus_probe(dev, id->regshft, 0, id->rclk, + id->rid & PCI_RID_MASK, 0, 0); /* Bail out on error. */ if (result > 0) return (result); @@ -241,6 +246,7 @@ static int uart_pci_attach(device_t dev) { struct uart_softc *sc; + const struct pci_id *id; int count; sc = device_get_softc(dev); @@ -249,7 +255,9 @@ uart_pci_attach(device_t dev) * Use MSI in preference to legacy IRQ if available. However, experience * suggests this is only reliable when one MSI vector is advertised. */ - if (pci_msi_count(dev) == 1) { + id = uart_pci_match(dev, pci_ns8250_ids); + if ((id == NULL || (id->rid & PCI_NO_MSI) == 0) && + pci_msi_count(dev) == 1) { count = 1; if (pci_alloc_msi(dev, &count) == 0) { sc->sc_irid = 1; From owner-dev-commits-src-main@freebsd.org Thu Sep 30 20:35:27 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E1D476B7BFE; Thu, 30 Sep 2021 20:35:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HL4kR5w5zz4pl5; Thu, 30 Sep 2021 20:35:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AC3C712768; Thu, 30 Sep 2021 20:35:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18UKZRxN074617; Thu, 30 Sep 2021 20:35:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18UKZRUe074616; Thu, 30 Sep 2021 20:35:27 GMT (envelope-from git) Date: Thu, 30 Sep 2021 20:35:27 GMT Message-Id: <202109302035.18UKZRUe074616@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 9eb5fd359969 - main - uart: Match simple comm MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9eb5fd3599695acc76291777bc587e14746e960c Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Sep 2021 20:35:28 -0000 The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=9eb5fd3599695acc76291777bc587e14746e960c commit 9eb5fd3599695acc76291777bc587e14746e960c Author: Warner Losh AuthorDate: 2021-09-30 20:16:19 +0000 Commit: Warner Losh CommitDate: 2021-09-30 20:16:19 +0000 uart: Match simple comm Match the PCI simple comm devices (or try to). Be conservative and use legacy interrupts rather than msi messages by default for this 'catch all' since it matches what Linux does (it has opt-in generally for MSI, but also matches more devices because it does a catch-all like implemented in this commit). Sponsored by: Netflix Reviewed by: kbowling Differential Revision: https://reviews.freebsd.org/D32228 --- sys/dev/uart/uart_bus_pci.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/sys/dev/uart/uart_bus_pci.c b/sys/dev/uart/uart_bus_pci.c index 4090af0ea9a0..fe5ad2b6d206 100644 --- a/sys/dev/uart/uart_bus_pci.c +++ b/sys/dev/uart/uart_bus_pci.c @@ -39,6 +39,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include @@ -218,6 +219,12 @@ uart_pci_probe(device_t dev) { struct uart_softc *sc; const struct pci_id *id; + struct pci_id cid = { + .regshft = 0, + .rclk = 0, + .rid = 0x10 | PCI_NO_MSI, + .desc = "Generic SimpleComm PCI device", + }; int result; sc = device_get_softc(dev); @@ -227,6 +234,14 @@ uart_pci_probe(device_t dev) sc->sc_class = &uart_ns8250_class; goto match; } + if (pci_get_class(dev) == PCIC_SIMPLECOMM && + pci_get_subclass(dev) == PCIS_SIMPLECOMM_UART && + pci_get_progif(dev) < PCIP_SIMPLECOMM_UART_16550A) { + /* XXX rclk what to do */ + id = &cid; + sc->sc_class = &uart_ns8250_class; + goto match; + } /* Add checks for non-ns8250 IDs here. */ return (ENXIO); From owner-dev-commits-src-main@freebsd.org Thu Sep 30 21:31:51 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B850F670557; Thu, 30 Sep 2021 21:31:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HL5zW4qncz4trP; Thu, 30 Sep 2021 21:31:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 85769135C6; Thu, 30 Sep 2021 21:31:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18ULVpUe054471; Thu, 30 Sep 2021 21:31:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18ULVpdS054470; Thu, 30 Sep 2021 21:31:51 GMT (envelope-from git) Date: Thu, 30 Sep 2021 21:31:51 GMT Message-Id: <202109302131.18ULVpdS054470@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kyle Evans Subject: git: 6a7647eccd3e - main - jail(3lua): add a jail.list() method MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevans X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 6a7647eccd3ef35189c63a61b0ec8865fd559839 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Sep 2021 21:31:51 -0000 The branch main has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=6a7647eccd3ef35189c63a61b0ec8865fd559839 commit 6a7647eccd3ef35189c63a61b0ec8865fd559839 Author: Kyle Evans AuthorDate: 2020-10-13 02:11:14 +0000 Commit: Kyle Evans CommitDate: 2021-09-30 21:30:57 +0000 jail(3lua): add a jail.list() method This is implemented as an iterator, reusing parts of the earlier logic to populate jailparams from a passed in table. The user may request any number of parameters to pull in while we're searching, but we'll force jid and name to appear at a minimum. Reviewed by: freqlabs Differential Revision: https://reviews.freebsd.org/D26756 --- lib/flua/libjail/jail.3lua | 47 ++++++ lib/flua/libjail/lua_jail.c | 322 +++++++++++++++++++++++++++++++++++----- share/examples/flua/libjail.lua | 55 ++++++- 3 files changed, 385 insertions(+), 39 deletions(-) diff --git a/lib/flua/libjail/jail.3lua b/lib/flua/libjail/jail.3lua index fb54b94844f5..aa1e0ec49616 100644 --- a/lib/flua/libjail/jail.3lua +++ b/lib/flua/libjail/jail.3lua @@ -32,6 +32,7 @@ .Sh NAME .Nm getid , .Nm getname , +.Nm list , .Nm allparams , .Nm getparams , .Nm setparams , @@ -50,6 +51,7 @@ local jail = require('jail') .It Dv jid, err = jail.getid(name) .It Dv name, err = jail.getname(jid) .It Dv params, err = jail.allparams() +.It Dv iter, jail_obj = jail.list([params]) .It Dv jid, res = jail.getparams(jid|name, params [, flags ] ) .It Dv jid, err = jail.setparams(jid|name, params, flags ) .It Dv jail.CREATE @@ -79,6 +81,21 @@ is the name of a jail or a jid in the form of a string. Get the name of a jail as a string for the given .Fa jid .Pq an integer . +.It Dv iter, jail_obj = jail.list([params]) +Returns an iterator over running jails on the system. +.Dv params +is a list of parameters to fetch for each jail as we iterate. +.Dv jid +and +.Dv name +will always be returned, and may be omitted from +.Dv params . +Additionally, +.Dv params +may be omitted or an empty table, but not nil. +.Pp +See +.Sx EXAMPLES . .It Dv params, err = jail.allparams() Get a list of all supported parameter names .Pq as strings . @@ -167,6 +184,10 @@ function returns a jail identifier integer and a table of jail parameters with parameter name strings as keys and strings for values on success, or .Dv nil and an error message string if an error occurred. +.Pp +The +.Fn list +function returns an iterator over the list of running jails. .Sh EXAMPLES Set the hostname of jail .Dq foo @@ -193,6 +214,32 @@ if not jid then end print(res["host.hostname"]) .Ed +.Pp +Iterate over jails on the system: +.Bd -literal -offset indent +local jail = require('jail') + +-- Recommended: just loop over it +for jparams in jail.list() do + print(jparams["jid"] .. " = " .. jparams["name"]) +end + +-- Request path and hostname, too +for jparams in jail.list({"path", "host.hostname"}) do + print(jparams["host.hostname"] .. " mounted at " .. jparams["path"]) +end + +-- Raw iteration protocol +local iter, jail_obj = jail.list() + +-- Request the first params +local jparams = jail_obj:next() +while jparams do + print(jparams["jid"] .. " = " .. jparams["name"]) + -- Subsequent calls may return nil + jparams = jail_obj:next() +end +.Ed .Sh SEE ALSO .Xr jail 2 , .Xr jail 3 , diff --git a/lib/flua/libjail/lua_jail.c b/lib/flua/libjail/lua_jail.c index b66c60b43bc8..7bb0e13cceea 100644 --- a/lib/flua/libjail/lua_jail.c +++ b/lib/flua/libjail/lua_jail.c @@ -2,6 +2,7 @@ * SPDX-License-Identifier: BSD-2-Clause * * Copyright (c) 2020, Ryan Moeller + * Copyright (c) 2020, Kyle Evans * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -34,6 +35,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -41,8 +43,222 @@ __FBSDID("$FreeBSD$"); #include #include +#define JAIL_METATABLE "jail iterator metatable" + +/* + * Taken from RhodiumToad's lspawn implementation, let static analyzers make + * better decisions about the behavior after we raise an error. + */ +#if defined(LUA_VERSION_NUM) && defined(LUA_API) +LUA_API int (lua_error) (lua_State *L) __dead2; +#endif +#if defined(LUA_ERRFILE) && defined(LUALIB_API) +LUALIB_API int (luaL_argerror) (lua_State *L, int arg, const char *extramsg) __dead2; +LUALIB_API int (luaL_typeerror) (lua_State *L, int arg, const char *tname) __dead2; +LUALIB_API int (luaL_error) (lua_State *L, const char *fmt, ...) __dead2; +#endif + int luaopen_jail(lua_State *); +typedef bool (*getparam_filter)(const char *, void *); + +static void getparam_table(lua_State *L, int paramindex, + struct jailparam *params, size_t paramoff, size_t *params_countp, + getparam_filter keyfilt, void *udata); + +struct l_jail_iter { + struct jailparam *params; + size_t params_count; + int jid; +}; + +static bool +l_jail_filter(const char *param_name, void *data __unused) +{ + + /* + * Allowing lastjid will mess up our iteration over all jails on the + * system, as this is a special paramter that indicates where the search + * starts from. We'll always add jid and name, so just silently remove + * these. + */ + return (strcmp(param_name, "lastjid") != 0 && + strcmp(param_name, "jid") != 0 && + strcmp(param_name, "name") != 0); +} + +static int +l_jail_iter_next(lua_State *L) +{ + struct l_jail_iter *iter, **iterp; + struct jailparam *jp; + int serrno; + + iterp = (struct l_jail_iter **)luaL_checkudata(L, 1, JAIL_METATABLE); + iter = *iterp; + luaL_argcheck(L, iter != NULL, 1, "closed jail iterator"); + + jp = iter->params; + /* Populate lastjid; we must keep it in params[0] for our sake. */ + if (jailparam_import_raw(&jp[0], &iter->jid, sizeof(iter->jid))) { + jailparam_free(jp, iter->params_count); + free(jp); + free(iter); + *iterp = NULL; + return (luaL_error(L, "jailparam_import_raw: %s", jail_errmsg)); + } + + /* The list of requested params was populated back in l_list(). */ + iter->jid = jailparam_get(jp, iter->params_count, 0); + if (iter->jid == -1) { + /* + * We probably got an ENOENT to signify the end of the jail + * listing, but just in case we didn't; stash it off and start + * cleaning up. We'll handle non-ENOENT errors later. + */ + serrno = errno; + jailparam_free(jp, iter->params_count); + free(iter->params); + free(iter); + *iterp = NULL; + if (serrno != ENOENT) + return (luaL_error(L, "jailparam_get: %s", + strerror(serrno))); + return (0); + } + + /* + * Finally, we'll fill in the return table with whatever parameters the + * user requested, in addition to the ones we forced with exception to + * lastjid. + */ + lua_newtable(L); + for (size_t i = 0; i < iter->params_count; ++i) { + char *value; + + jp = &iter->params[i]; + if (strcmp(jp->jp_name, "lastjid") == 0) + continue; + value = jailparam_export(jp); + lua_pushstring(L, value); + lua_setfield(L, -2, jp->jp_name); + free(value); + } + + return (1); +} + +static int +l_jail_iter_close(lua_State *L) +{ + struct l_jail_iter *iter, **iterp; + + /* + * Since we're using this as the __gc method as well, there's a good + * chance that it's already been cleaned up by iterating to the end of + * the list. + */ + iterp = (struct l_jail_iter **)lua_touserdata(L, 1); + iter = *iterp; + if (iter == NULL) + return (0); + + jailparam_free(iter->params, iter->params_count); + free(iter->params); + free(iter); + *iterp = NULL; + return (0); +} + +static int +l_list(lua_State *L) +{ + struct l_jail_iter *iter; + int nargs; + + nargs = lua_gettop(L); + if (nargs >= 1) + luaL_checktype(L, 1, LUA_TTABLE); + + iter = malloc(sizeof(*iter)); + if (iter == NULL) + return (luaL_error(L, "malloc: %s", strerror(errno))); + + /* + * lastjid, jid, name + length of the table. This may be too much if + * we have duplicated one of those fixed parameters. + */ + iter->params_count = 3 + (nargs != 0 ? lua_rawlen(L, 1) : 0); + iter->params = malloc(iter->params_count * sizeof(*iter->params)); + if (iter->params == NULL) { + free(iter); + return (luaL_error(L, "malloc params: %s", strerror(errno))); + } + + /* The :next() method will populate lastjid before jail_getparam(). */ + if (jailparam_init(&iter->params[0], "lastjid") == -1) { + free(iter->params); + free(iter); + return (luaL_error(L, "jailparam_init: %s", jail_errmsg)); + } + /* These two will get populated by jail_getparam(). */ + if (jailparam_init(&iter->params[1], "jid") == -1) { + jailparam_free(iter->params, 1); + free(iter->params); + free(iter); + return (luaL_error(L, "jailparam_init: %s", + jail_errmsg)); + } + if (jailparam_init(&iter->params[2], "name") == -1) { + jailparam_free(iter->params, 2); + free(iter->params); + free(iter); + return (luaL_error(L, "jailparam_init: %s", + jail_errmsg)); + } + + /* + * We only need to process additional arguments if we were given any. + * That is, we don't descend into getparam_table if we're passed nothing + * or an empty table. + */ + iter->jid = 0; + if (iter->params_count != 3) + getparam_table(L, 1, iter->params, 2, &iter->params_count, + l_jail_filter, NULL); + + /* + * Part of the iterator magic. We give it an iterator function with a + * metatable defining next() and close() that can be used for manual + * iteration. iter->jid is how we track which jail we last iterated, to + * be supplied as "lastjid". + */ + lua_pushcfunction(L, l_jail_iter_next); + *(struct l_jail_iter **)lua_newuserdata(L, + sizeof(struct l_jail_iter **)) = iter; + luaL_getmetatable(L, JAIL_METATABLE); + lua_setmetatable(L, -2); + return (2); +} + +static void +register_jail_metatable(lua_State *L) +{ + luaL_newmetatable(L, JAIL_METATABLE); + lua_newtable(L); + lua_pushcfunction(L, l_jail_iter_next); + lua_setfield(L, -2, "next"); + lua_pushcfunction(L, l_jail_iter_close); + lua_setfield(L, -2, "close"); + + lua_setfield(L, -2, "__index"); + + lua_pushcfunction(L, l_jail_iter_close); + lua_setfield(L, -2, "__gc"); + + lua_pop(L, 1); +} + static int l_getid(lua_State *L) { @@ -100,12 +316,71 @@ l_allparams(lua_State *L) return (1); } +static void +getparam_table(lua_State *L, int paramindex, struct jailparam *params, + size_t params_off, size_t *params_countp, getparam_filter keyfilt, + void *udata) +{ + size_t params_count; + int skipped; + + params_count = *params_countp; + skipped = 0; + for (size_t i = 1 + params_off; i < params_count; ++i) { + const char *param_name; + + lua_rawgeti(L, -1, i - params_off); + param_name = lua_tostring(L, -1); + if (param_name == NULL) { + jailparam_free(params, i - skipped); + free(params); + luaL_argerror(L, paramindex, + "param names must be strings"); + } + lua_pop(L, 1); + if (keyfilt != NULL && !keyfilt(param_name, udata)) { + ++skipped; + continue; + } + if (jailparam_init(¶ms[i - skipped], param_name) == -1) { + jailparam_free(params, i - skipped); + free(params); + luaL_error(L, "jailparam_init: %s", jail_errmsg); + } + } + *params_countp -= skipped; +} + +struct getparams_filter_args { + int filter_type; +}; + +static bool +l_getparams_filter(const char *param_name, void *udata) +{ + struct getparams_filter_args *gpa; + + gpa = udata; + + /* Skip name or jid, whichever was given. */ + if (gpa->filter_type == LUA_TSTRING) { + if (strcmp(param_name, "name") == 0) + return (false); + } else /* type == LUA_TNUMBER */ { + if (strcmp(param_name, "jid") == 0) + return (false); + } + + return (true); +} + static int l_getparams(lua_State *L) { const char *name; struct jailparam *params; - size_t params_count, skipped; + size_t params_count; + struct getparams_filter_args gpa; int flags, jid, type; type = lua_type(L, 1); @@ -154,40 +429,8 @@ l_getparams(lua_State *L) /* * Set the remaining param names being requested. */ - - skipped = 0; - for (size_t i = 1; i < params_count; ++i) { - const char *param_name; - - lua_rawgeti(L, -1, i); - param_name = lua_tostring(L, -1); - if (param_name == NULL) { - jailparam_free(params, i - skipped); - free(params); - return (luaL_argerror(L, 2, - "param names must be strings")); - } - lua_pop(L, 1); - /* Skip name or jid, whichever was given. */ - if (type == LUA_TSTRING) { - if (strcmp(param_name, "name") == 0) { - ++skipped; - continue; - } - } else /* type == LUA_TNUMBER */ { - if (strcmp(param_name, "jid") == 0) { - ++skipped; - continue; - } - } - if (jailparam_init(¶ms[i - skipped], param_name) == -1) { - jailparam_free(params, i - skipped); - free(params); - return (luaL_error(L, "jailparam_init: %s", - jail_errmsg)); - } - } - params_count -= skipped; + gpa.filter_type = type; + getparam_table(L, 2, params, 0, ¶ms_count, l_getparams_filter, &gpa); /* * Get the values and convert to a table. @@ -366,6 +609,13 @@ static const struct luaL_Reg l_jail[] = { * or nil, error (string) on error */ {"setparams", l_setparams}, + /** Get a list of jail parameters for running jails on the system. + * @param params optional list of parameter names (table of + * strings) + * @return iterator (function), jail_obj (object) with next and + * close methods + */ + {"list", l_list}, {NULL, NULL} }; @@ -385,5 +635,7 @@ luaopen_jail(lua_State *L) lua_pushinteger(L, JAIL_DYING); lua_setfield(L, -2, "DYING"); + register_jail_metatable(L); + return (1); } diff --git a/share/examples/flua/libjail.lua b/share/examples/flua/libjail.lua index 3ff878460d2f..1761f5c86b24 100644 --- a/share/examples/flua/libjail.lua +++ b/share/examples/flua/libjail.lua @@ -35,10 +35,23 @@ ucl = require("ucl") name = "demo" --- Create a persistent jail named "demo" with all other parameters default. -jid, err = jail.setparams(name, {persist = "true"}, jail.CREATE) -if not jid then - error(err) +local has_demo = false + +-- Make sure we don't have a demo jail to start with; "jid" and "name" are +-- always present. +for jparams in jail.list() do + if jparams["name"] == name then + has_demo = true + break + end +end + +if not has_demo then + -- Create a persistent jail named "demo" with all other parameters default. + jid, err = jail.setparams(name, {persist = "true"}, jail.CREATE) + if not jid then + error(err) + end end -- Get a list of all known jail parameter names. @@ -53,8 +66,42 @@ end -- Display the jail's parameters as a pretty-printed JSON object. print(ucl.to_json(res)) +-- Confirm that we still have it for now. +has_demo = false +for jparams in jail.list() do + if jparams["name"] == name then + has_demo = true + break + end +end + +if not has_demo then + print("demo does not exist") +end + -- Update the "persist" parameter to "false" to remove the jail. jid, err = jail.setparams(name, {persist = "false"}, jail.UPDATE) if not jid then error(err) end + +-- Verify that the jail is no longer on the system. +local is_persistent = false +has_demo = false +for jparams in jail.list({"persist"}) do + if jparams["name"] == name then + has_demo = true + jid = jparams["jid"] + is_persistent = jparams["persist"] ~= "false" + end +end + +-- In fact, it does remain until this process ends -- c'est la vie. +if has_demo then + io.write("demo still exists, jid " .. jid .. ", ") + if is_persistent then + io.write("persistent\n") + else + io.write("not persistent\n") + end +end From owner-dev-commits-src-main@freebsd.org Thu Sep 30 21:31:53 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 086B067077D; Thu, 30 Sep 2021 21:31:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HL5zX5X0Cz4vCs; Thu, 30 Sep 2021 21:31:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9EF391339F; Thu, 30 Sep 2021 21:31:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18ULVqCP054497; Thu, 30 Sep 2021 21:31:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18ULVqMP054496; Thu, 30 Sep 2021 21:31:52 GMT (envelope-from git) Date: Thu, 30 Sep 2021 21:31:52 GMT Message-Id: <202109302131.18ULVqMP054496@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kyle Evans Subject: git: a6499c56ab6c - main - jail(3lua): add jail.attach()/jail.remove() methods MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevans X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a6499c56ab6ca54f01dca44b7e34a0fc6a680e90 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Sep 2021 21:31:53 -0000 The branch main has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=a6499c56ab6ca54f01dca44b7e34a0fc6a680e90 commit a6499c56ab6ca54f01dca44b7e34a0fc6a680e90 Author: Kyle Evans AuthorDate: 2020-10-23 17:52:31 +0000 Commit: Kyle Evans CommitDate: 2021-09-30 21:31:04 +0000 jail(3lua): add jail.attach()/jail.remove() methods These aren't a part of or use libjail(3), but rather are direct syscalls. Still, they seem like good additions, allowing us to attach to already-running jails. Reviewed by: freqlabs Differential Revision: https://reviews.freebsd.org/D26927 --- lib/flua/libjail/jail.3lua | 22 ++++++++++++++ lib/flua/libjail/lua_jail.c | 74 +++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 96 insertions(+) diff --git a/lib/flua/libjail/jail.3lua b/lib/flua/libjail/jail.3lua index aa1e0ec49616..a0cb7ae1381e 100644 --- a/lib/flua/libjail/jail.3lua +++ b/lib/flua/libjail/jail.3lua @@ -30,11 +30,13 @@ .Dt JAIL 3lua .Os .Sh NAME +.Nm attach , .Nm getid , .Nm getname , .Nm list , .Nm allparams , .Nm getparams , +.Nm remove , .Nm setparams , .Nm CREATE , .Nm UPDATE , @@ -48,11 +50,13 @@ local jail = require('jail') .Ed .Pp .Bl -tag -width XXXX -compact +.It Dv ok, err = jail.attach(jid|name) .It Dv jid, err = jail.getid(name) .It Dv name, err = jail.getname(jid) .It Dv params, err = jail.allparams() .It Dv iter, jail_obj = jail.list([params]) .It Dv jid, res = jail.getparams(jid|name, params [, flags ] ) +.It Dv ok, err = jail.remove(jid|name) .It Dv jid, err = jail.setparams(jid|name, params, flags ) .It Dv jail.CREATE .It Dv jail.UPDATE @@ -71,6 +75,11 @@ and .Xr jail_set 2 system calls. .Bl -tag -width XXXX +.It Dv ok, err = jail.attach(jid|name) +Attach to the given jail, identified by an integer +.Fa jid +or the +.Fa name . .It Dv jid, err = jail.getid(name) Get the jail identifier .Pq jid @@ -114,6 +123,11 @@ See the list of flags below. Only the .Dv DYING flag is valid to set. +.It Dv ok, err = jail.remove(jid|name) +Remove the given jail, identified by an integer +.Fa jid +or the +.Fa name . .It Dv jid, err = jail.setparams(jid|name, params [, flags ] ) Set parameters for a given jail. This is used to create, update, attach to, or destroy a jail. @@ -188,6 +202,14 @@ and an error message string if an error occurred. The .Fn list function returns an iterator over the list of running jails. +.Pp +The +.Fn attach +and +.Fn remove +functions return true on success, or +.Dv nil +and an error message string if an error occurred. .Sh EXAMPLES Set the hostname of jail .Dq foo diff --git a/lib/flua/libjail/lua_jail.c b/lib/flua/libjail/lua_jail.c index 7bb0e13cceea..025694bf1181 100644 --- a/lib/flua/libjail/lua_jail.c +++ b/lib/flua/libjail/lua_jail.c @@ -575,6 +575,68 @@ l_setparams(lua_State *L) return (1); } +static int +l_attach(lua_State *L) +{ + int jid, type; + + type = lua_type(L, 1); + luaL_argcheck(L, type == LUA_TSTRING || type == LUA_TNUMBER, 1, + "expected a jail name (string) or id (integer)"); + + if (lua_isstring(L, 1)) { + /* Resolve it to a jid. */ + jid = jail_getid(lua_tostring(L, 1)); + if (jid == -1) { + lua_pushnil(L); + lua_pushstring(L, jail_errmsg); + return (2); + } + } else { + jid = lua_tointeger(L, 1); + } + + if (jail_attach(jid) == -1) { + lua_pushnil(L); + lua_pushstring(L, strerror(errno)); + return (2); + } + + lua_pushboolean(L, 1); + return (1); +} + +static int +l_remove(lua_State *L) +{ + int jid, type; + + type = lua_type(L, 1); + luaL_argcheck(L, type == LUA_TSTRING || type == LUA_TNUMBER, 1, + "expected a jail name (string) or id (integer)"); + + if (lua_isstring(L, 1)) { + /* Resolve it to a jid. */ + jid = jail_getid(lua_tostring(L, 1)); + if (jid == -1) { + lua_pushnil(L); + lua_pushstring(L, jail_errmsg); + return (2); + } + } else { + jid = lua_tointeger(L, 1); + } + + if (jail_remove(jid) == -1) { + lua_pushnil(L); + lua_pushstring(L, strerror(errno)); + return (2); + } + + lua_pushboolean(L, 1); + return (1); +} + static const struct luaL_Reg l_jail[] = { /** Get id of a jail by name. * @param name jail name (string) @@ -616,6 +678,18 @@ static const struct luaL_Reg l_jail[] = { * close methods */ {"list", l_list}, + /** Attach to a running jail. + * @param jail jail name (string) or id (integer) + * @return true (boolean) + * or nil, error (string) on error + */ + {"attach", l_attach}, + /** Remove a running jail. + * @param jail jail name (string) or id (integer) + * @return true (boolean) + * or nil, error (string) on error + */ + {"remove", l_remove}, {NULL, NULL} }; From owner-dev-commits-src-main@freebsd.org Thu Sep 30 21:59:17 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C40B6670E5B; Thu, 30 Sep 2021 21:59:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HL6b952Bkz4wbB; Thu, 30 Sep 2021 21:59:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8D2191386A; Thu, 30 Sep 2021 21:59:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18ULxHrb081954; Thu, 30 Sep 2021 21:59:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18ULxH0H081953; Thu, 30 Sep 2021 21:59:17 GMT (envelope-from git) Date: Thu, 30 Sep 2021 21:59:17 GMT Message-Id: <202109302159.18ULxH0H081953@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Colin Percival Subject: git: ce73f768b764 - main - EFI loader: Don't free bcache for DEVT_DISK devs MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cperciva X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ce73f768b76486b1562f207a6fc1cef87065418a Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Sep 2021 21:59:17 -0000 The branch main has been updated by cperciva: URL: https://cgit.FreeBSD.org/src/commit/?id=ce73f768b76486b1562f207a6fc1cef87065418a commit ce73f768b76486b1562f207a6fc1cef87065418a Author: Colin Percival AuthorDate: 2021-09-30 21:48:14 +0000 Commit: Colin Percival CommitDate: 2021-09-30 21:48:14 +0000 EFI loader: Don't free bcache for DEVT_DISK devs Booting on an EC2 c5.xlarge instance, this reduces the number of I/Os performed from 609 to 432, reduces the total number of blocks read from 61963 to 60797, and reduces the time spent in the loader by 39 ms. Note that b4cb3fe0e39a allowed the bcache to be retained for most of the boot process, but relies on mounting filesystems; this commit allows the bcache to be retained at the start of the boot process, before the root filesystem has been located. Reviewed by: imp, tsoome MFC after: 1 week Sponsored by: https://www.patreon.com/cperciva Differential Revision: https://reviews.freebsd.org/D32239 --- stand/efi/libefi/efipart.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/stand/efi/libefi/efipart.c b/stand/efi/libefi/efipart.c index aede28ef40c3..7807c17077a6 100644 --- a/stand/efi/libefi/efipart.c +++ b/stand/efi/libefi/efipart.c @@ -949,8 +949,10 @@ efipart_close(struct open_file *f) pd->pd_open--; if (pd->pd_open == 0) { pd->pd_blkio = NULL; - bcache_free(pd->pd_bcache); - pd->pd_bcache = NULL; + if (dev->dd.d_dev->dv_type != DEVT_DISK) { + bcache_free(pd->pd_bcache); + pd->pd_bcache = NULL; + } } if (dev->dd.d_dev->dv_type == DEVT_DISK) return (disk_close(dev)); From owner-dev-commits-src-main@freebsd.org Fri Oct 1 02:17:11 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D22276754AC; Fri, 1 Oct 2021 02:17:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HLDJl5KGvz3Dg9; Fri, 1 Oct 2021 02:17:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9347B171BD; Fri, 1 Oct 2021 02:17:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1912HBZ2029313; Fri, 1 Oct 2021 02:17:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1912HBW1029312; Fri, 1 Oct 2021 02:17:11 GMT (envelope-from git) Date: Fri, 1 Oct 2021 02:17:11 GMT Message-Id: <202110010217.1912HBW1029312@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Jung-uk Kim Subject: git: 1b7a2680fba5 - main - Import ACPICA 20210930 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jkim X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 1b7a2680fba589daf6f700565214919cb941ab56 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Oct 2021 02:17:11 -0000 The branch main has been updated by jkim: URL: https://cgit.FreeBSD.org/src/commit/?id=1b7a2680fba589daf6f700565214919cb941ab56 commit 1b7a2680fba589daf6f700565214919cb941ab56 Author: Jung-uk Kim AuthorDate: 2021-09-30 20:23:21 +0000 Commit: Jung-uk Kim CommitDate: 2021-10-01 02:05:52 +0000 Import ACPICA 20210930 (cherry picked from commit c509b6ab0d7e5bafc5348b08653b8738bd40716e) --- sys/contrib/dev/acpica/changes.txt | 50 ++++ sys/contrib/dev/acpica/common/dmtable.c | 58 ++++ sys/contrib/dev/acpica/common/dmtbdump2.c | 300 +++++++++++++++++++++ sys/contrib/dev/acpica/common/dmtbdump3.c | 5 + sys/contrib/dev/acpica/common/dmtbinfo2.c | 183 +++++++++++++ sys/contrib/dev/acpica/common/dmtbinfo3.c | 28 +- sys/contrib/dev/acpica/compiler/aslmethod.c | 70 ++--- sys/contrib/dev/acpica/compiler/dtcompiler.h | 4 + sys/contrib/dev/acpica/compiler/dttable2.c | 5 + sys/contrib/dev/acpica/compiler/dtutils.c | 2 + sys/contrib/dev/acpica/compiler/preprocess.h | 2 +- .../dev/acpica/components/dispatcher/dsfield.c | 2 +- .../dev/acpica/components/hardware/hwesleep.c | 7 +- .../dev/acpica/components/hardware/hwsleep.c | 10 +- .../dev/acpica/components/hardware/hwxfsleep.c | 6 + .../dev/acpica/components/utilities/utosi.c | 1 + sys/contrib/dev/acpica/include/acdisasm.h | 25 +- sys/contrib/dev/acpica/include/acglobal.h | 2 + sys/contrib/dev/acpica/include/acpixf.h | 2 +- sys/contrib/dev/acpica/include/actbinfo.h | 14 + sys/contrib/dev/acpica/include/actbl2.h | 289 +++++++++++++++++++- sys/contrib/dev/acpica/include/actbl3.h | 10 +- sys/contrib/dev/acpica/include/actypes.h | 1 + 23 files changed, 1005 insertions(+), 71 deletions(-) diff --git a/sys/contrib/dev/acpica/changes.txt b/sys/contrib/dev/acpica/changes.txt index 64ca5cccdce4..ad2323971aea 100644 --- a/sys/contrib/dev/acpica/changes.txt +++ b/sys/contrib/dev/acpica/changes.txt @@ -1,3 +1,53 @@ +---------------------------------------- +30 September 2021. Summary of changes for version 20210930: + +This release is available at https://acpica.org/downloads + +1) ACPICA kernel-resident subsystem: + +Hardware: Avoid evaluating methods too early during system resume. During +wakeup from system-wide sleep states, AcpiGetSleepTypeData() is called +and it tries to get memory from the OS in order to evaluate a control +method, but if KFENCE is enabled in the Linux kernel, the memory +allocation attempt causes an IRQ work to be queued and a self-IPI to be +sent to the CPU running the code which requires the memory controller to +be ready, so if that happens too early in the wakeup path, it doesn't +work. + +Prevent that from taking place by calling AcpiGetSleepTypeData() for S0 +upfront, when preparing to enter a given sleep state, and saving the data +obtained by it for later use during system wakeup. + +Added a new _OSI string, "Windows 2020". Posted by superm1. + +2) iASL Compiler/Disassembler and ACPICA tools: + +iASL compiler: Updated the check for usage of _CRS, _DIS, _PRS, and _SRS +objects: +New/latest rules: Under a Device Object: + 1) If _PRS is present, must have _CRS and _SRS + 2) If _SRS is present, must have _PRS (_PRS requires _CRS and +_SRS) + 3) If _DIS is present, must have _SRS (_SRS requires _PRS, _PRS +requires _CRS and _SRS) + 4) If _SRS is present, probably should have a _DIS (Remark only) + +iASL table disassembler: Added disassembly support for the NHLT ACPI +table. Note: support for Vendor-defined microphone arrays and SNR +extensions are not supported at this time -- mostly due to a lack of +example tables. Actual compiler support for NHLT is forthcoming. + +Added a new subtable type for ACPI 6.4 SRAT Generic Port Affinity. It +uses the same subtable structure as the existing Generic Initiator +Affinity type. + +Added the flag for online capable in the MADT, introduced in ACPI 6.3. +Posted by superm1. + +3) ACPICA documentation: Updated the legal info (that appears at the +start of the Documents) to clarify distribution rights that are granted. + + ---------------------------------------- 30 July 2021. Summary of changes for version 20210730: diff --git a/sys/contrib/dev/acpica/common/dmtable.c b/sys/contrib/dev/acpica/common/dmtable.c index cbef83364e73..5e3f2ef748da 100644 --- a/sys/contrib/dev/acpica/common/dmtable.c +++ b/sys/contrib/dev/acpica/common/dmtable.c @@ -417,6 +417,26 @@ static const char *AcpiDmNfitSubnames[] = "Unknown Subtable Type" /* Reserved */ }; +static const char *AcpiDmNhltLinkTypeNames[] = +{ + "Reserved for HD-Audio", /* ACPI_NHLT_RESERVED_HD_AUDIO */ + "Reserved for DSP", /* ACPI_NHLT_RESERVED_DSP */ + "Type PDM", /* ACPI_NHLT_PDM */ + "Type SSP", /* ACPI_NHLT_SSP */ + "Reserved for SlimBus", /* ACPI_NHLT_RESERVED_SLIMBUS */ + "Reserved for SoundWire", /* ACPI_NHLT_RESERVED_SOUNDWIRE */ + "Unknown Link Type" /* Reserved */ +}; + +static const char *AcpiDmNhltDirectionNames[] = +{ + "Render", /* ACPI_NHLT_DIR_RENDER */ + "Capture", /* ACPI_NHLT_DIR_CAPTURE */ + "Render with Loopback", /* ACPI_NHLT_DIR_RENDER_LOOPBACK */ + "Feedback for Render", /* ACPI_NHLT_DIR_RENDER_FEEDBACK */ + "Unknown Direction" /* Reserved */ +}; + static const char *AcpiDmPcctSubnames[] = { "Generic Communications Subspace", /* ACPI_PCCT_TYPE_GENERIC_SUBSPACE */ @@ -473,6 +493,7 @@ static const char *AcpiDmSratSubnames[] = "GICC Affinity", "GIC ITS Affinity", /* Acpi 6.2 */ "Generic Initiator Affinity", /* Acpi 6.3 */ + "Generic Port Affinity", /* Acpi 6.4 */ "Unknown Subtable Type" /* Reserved */ }; @@ -614,6 +635,7 @@ const ACPI_DMTABLE_DATA AcpiDmTableData[] = {ACPI_SIG_MSCT, NULL, AcpiDmDumpMsct, DtCompileMsct, TemplateMsct}, {ACPI_SIG_MSDM, NULL, AcpiDmDumpSlic, DtCompileSlic, TemplateMsdm}, {ACPI_SIG_NFIT, AcpiDmTableInfoNfit, AcpiDmDumpNfit, DtCompileNfit, TemplateNfit}, + {ACPI_SIG_NHLT, AcpiDmTableInfoNhlt, AcpiDmDumpNhlt, NULL, NULL}, {ACPI_SIG_PCCT, AcpiDmTableInfoPcct, AcpiDmDumpPcct, DtCompilePcct, TemplatePcct}, {ACPI_SIG_PDTT, AcpiDmTableInfoPdtt, AcpiDmDumpPdtt, DtCompilePdtt, TemplatePdtt}, {ACPI_SIG_PHAT, NULL, AcpiDmDumpPhat, DtCompilePhat, TemplatePhat}, @@ -1050,6 +1072,8 @@ AcpiDmDumpTable ( case ACPI_DMT_IVRS_DE: case ACPI_DMT_GTDT: case ACPI_DMT_MADT: + case ACPI_DMT_NHLT1: + case ACPI_DMT_NHLT1a: case ACPI_DMT_PCCT: case ACPI_DMT_PMTT: case ACPI_DMT_PPTT: @@ -1138,6 +1162,11 @@ AcpiDmDumpTable ( ByteLength = 16; break; + case ACPI_DMT_BUF18: + + ByteLength = 18; + break; + case ACPI_DMT_BUF128: ByteLength = 128; @@ -1343,6 +1372,7 @@ AcpiDmDumpTable ( case ACPI_DMT_BUF10: case ACPI_DMT_BUF12: case ACPI_DMT_BUF16: + case ACPI_DMT_BUF18: case ACPI_DMT_BUF128: /* * Buffer: Size depends on the opcode and was set above. @@ -1790,6 +1820,34 @@ AcpiDmDumpTable ( AcpiDmNfitSubnames[Temp16]); break; + case ACPI_DMT_NHLT1: + + /* NHLT link types */ + + Temp8 = *Target; + if (Temp8 > ACPI_NHLT_TYPE_RESERVED) + { + Temp8 = ACPI_NHLT_TYPE_RESERVED; + } + + AcpiOsPrintf (UINT8_FORMAT, *Target, + AcpiDmNhltLinkTypeNames[Temp8]); + break; + + case ACPI_DMT_NHLT1a: + + /* NHLT direction */ + + Temp8 = *Target; + if (Temp8 > ACPI_NHLT_DIR_RESERVED) + { + Temp8 = ACPI_NHLT_DIR_RESERVED; + } + + AcpiOsPrintf (UINT8_FORMAT, *Target, + AcpiDmNhltDirectionNames[Temp8]); + break; + case ACPI_DMT_PCCT: /* PCCT subtable types */ diff --git a/sys/contrib/dev/acpica/common/dmtbdump2.c b/sys/contrib/dev/acpica/common/dmtbdump2.c index a13e77e5c03b..e3ad649479b0 100644 --- a/sys/contrib/dev/acpica/common/dmtbdump2.c +++ b/sys/contrib/dev/acpica/common/dmtbdump2.c @@ -1467,6 +1467,306 @@ NextSubtable: } +/******************************************************************************* + * + * FUNCTION: AcpiDmDumpNhlt + * + * PARAMETERS: Table - A NHLT table + * + * RETURN: None + * + * DESCRIPTION: Format the contents of an NHLT. + * + ******************************************************************************/ + +void +AcpiDmDumpNhlt ( + ACPI_TABLE_HEADER *Table) +{ + ACPI_STATUS Status; + UINT32 Offset; + UINT32 TableLength = Table->Length; + UINT32 EndpointCount; + UINT8 FormatsCount; + ACPI_NHLT_ENDPOINT *Subtable; + ACPI_NHLT_FORMAT_CONFIG *FormatSubtable; + ACPI_TABLE_NHLT *InfoTable; + UINT32 CapabilitiesSize; + UINT32 i; + UINT32 j; + UINT32 k; + UINT32 EndpointEndOffset; + UINT8 ConfigType = 0; + UINT8 ArrayType; + ACPI_NHLT_DEVICE_SPECIFIC_CONFIG_A *DevSpecific; + ACPI_NHLT_FORMATS_CONFIG *FormatsConfig; + ACPI_NHLT_LINUX_SPECIFIC_COUNT *Count; + ACPI_NHLT_LINUX_SPECIFIC_DATA *LinuxData; + + + /* Main table */ + + AcpiOsPrintf ("/* Main table */\n"); + + Status = AcpiDmDumpTable (TableLength, 0, Table, 0, AcpiDmTableInfoNhlt); + if (ACPI_FAILURE (Status)) + { + return; + } + + /* Get the Endpoint Descriptor Count */ + + InfoTable = ACPI_ADD_PTR (ACPI_TABLE_NHLT, Table, 0); + EndpointCount = InfoTable->EndpointCount; + + /* Subtables */ + + Offset = sizeof (ACPI_TABLE_NHLT); + + while (Offset < TableLength) + { + /* A variable number of Endpoint Descriptors - process each */ + + for (i = 0; i < EndpointCount; i++) + { + /* Do the Endpoint Descriptor table */ + + Subtable = ACPI_ADD_PTR (ACPI_NHLT_ENDPOINT, Table, Offset); + if (Subtable->DescriptorLength > TableLength) + { + Offset += 1; + AcpiOsPrintf ("\n/* Endpoint Descriptor Length larger than" + " table size: %X, table %X, adjusting table offset (+1) */\n", + Subtable->DescriptorLength, TableLength); + + Subtable = ACPI_ADD_PTR (ACPI_NHLT_ENDPOINT, Table, Offset); + } + + AcpiOsPrintf ("\n/* Endpoint Descriptor #%u */\n", i+1); + Status = AcpiDmDumpTable (TableLength, Offset, Subtable, + Subtable->DescriptorLength, AcpiDmTableInfoNhlt0); + if (ACPI_FAILURE (Status)) + { + return; + } + EndpointEndOffset = Subtable->DescriptorLength + Offset; + + /* Check for endpoint descriptor beyond end-of-table */ + + if (Subtable->DescriptorLength > TableLength) + { + AcpiOsPrintf ("\n/* Endpoint Descriptor Length larger than table size: %X, table %X */\n", + Subtable->DescriptorLength, TableLength); + } + Offset += sizeof (ACPI_NHLT_ENDPOINT); + Subtable = ACPI_ADD_PTR (ACPI_NHLT_ENDPOINT, Table, Offset); + + /* Do the Device Specific table */ + + AcpiOsPrintf ("\n/* Endpoint Device_Specific_Config table */\n"); + DevSpecific = ACPI_CAST_PTR (ACPI_NHLT_DEVICE_SPECIFIC_CONFIG_A, Subtable); + CapabilitiesSize = DevSpecific->CapabilitiesSize; + + /* Different subtables based upon capabilities_size */ + + switch (CapabilitiesSize) + { + case 0: + Status = AcpiDmDumpTable (TableLength, Offset, DevSpecific, + sizeof (ACPI_NHLT_DEVICE_SPECIFIC_CONFIG_B), AcpiDmTableInfoNhlt5b); + if (ACPI_FAILURE (Status)) + { + return; + } + Offset += sizeof (ACPI_NHLT_DEVICE_SPECIFIC_CONFIG_B); + break; + + case 1: + Status = AcpiDmDumpTable (TableLength, Offset, DevSpecific, + sizeof (ACPI_NHLT_DEVICE_SPECIFIC_CONFIG_C), AcpiDmTableInfoNhlt5c); + if (ACPI_FAILURE (Status)) + { + return; + } + Offset += sizeof (ACPI_NHLT_DEVICE_SPECIFIC_CONFIG_C); + break; + + case 2: + Status = AcpiDmDumpTable (TableLength, Offset, DevSpecific, + sizeof (ACPI_NHLT_DEVICE_SPECIFIC_CONFIG), AcpiDmTableInfoNhlt5); + if (ACPI_FAILURE (Status)) + { + return; + } + Offset += sizeof (ACPI_NHLT_DEVICE_SPECIFIC_CONFIG); + break; + + case 3: + ConfigType = DevSpecific->ConfigType; + ArrayType = DevSpecific->ArrayType; + + Status = AcpiDmDumpTable (TableLength, Offset, DevSpecific, + sizeof (ACPI_NHLT_DEVICE_SPECIFIC_CONFIG_A), AcpiDmTableInfoNhlt5a); + if (ACPI_FAILURE (Status)) + { + return; + } + + /* Capabilities Size == 3 */ + Offset += sizeof (ACPI_NHLT_DEVICE_SPECIFIC_CONFIG_A); + + /* Check for a vendor-defined mic array */ + + if ((ConfigType == ACPI_NHLT_TYPE_MIC_ARRAY) && ((ArrayType & ARRAY_TYPE_MASK) == VENDOR_DEFINED)) + { + /* Vendor-defined microphone array */ + + AcpiOsPrintf ("\n/* Vendor-defined microphone array */\n"); + + Status = AcpiDmDumpTable (TableLength, Offset, DevSpecific, + sizeof (ACPI_NHLT_VENDOR_MIC_CONFIG), AcpiDmTableInfoNhlt6); + if (ACPI_FAILURE (Status)) + { + return; + } + Offset += sizeof (ACPI_NHLT_VENDOR_MIC_CONFIG); + } + break; + + default: + Status = AcpiDmDumpTable (TableLength, Offset, DevSpecific, + sizeof (ACPI_NHLT_DEVICE_SPECIFIC_CONFIG_B), AcpiDmTableInfoNhlt5b); + if (ACPI_FAILURE (Status)) + { + return; + } + + Offset += sizeof (ACPI_NHLT_DEVICE_SPECIFIC_CONFIG_B); + Status = AcpiDmDumpTable (TableLength, Offset, DevSpecific, + CapabilitiesSize, AcpiDmTableInfoNhlt3a); + if (ACPI_FAILURE (Status)) + { + return; + } + Offset += CapabilitiesSize; + break; + } + + /* Do the Formats_Config table */ + + FormatsConfig = ACPI_ADD_PTR (ACPI_NHLT_FORMATS_CONFIG, Table, Offset); + FormatsCount = FormatsConfig->FormatsCount; + + AcpiOsPrintf ("\n/* Formats_Config table */\n"); + + Status = AcpiDmDumpTable (TableLength, Offset, FormatsConfig, + sizeof (ACPI_NHLT_FORMATS_CONFIG), AcpiDmTableInfoNhlt4); + if (ACPI_FAILURE (Status)) + { + return; + } + Offset += sizeof (ACPI_NHLT_FORMATS_CONFIG); + + /* A variable number of Format_Config Descriptors - process each */ + + for (j = 0; j < FormatsCount; j++) + { + FormatSubtable = ACPI_ADD_PTR (ACPI_NHLT_FORMAT_CONFIG, Table, Offset); + CapabilitiesSize = FormatSubtable->CapabilitySize; + + /* Do the Wave_extensible struct */ + + AcpiOsPrintf ("\n/* Wave_Format_Extensible table #%u */\n", j+1); + Status = AcpiDmDumpTable (TableLength, Offset, FormatSubtable, + sizeof (ACPI_NHLT_FORMAT_CONFIG), AcpiDmTableInfoNhlt3); + if (ACPI_FAILURE (Status)) + { + return; + } + Offset += sizeof (ACPI_NHLT_WAVE_EXTENSIBLE); + + /* Do the Capabilities array */ + + Offset += sizeof (UINT32); + AcpiOsPrintf ("\n/* Specific_Config table #%u */\n", j+1); + FormatSubtable = ACPI_ADD_PTR (ACPI_NHLT_FORMAT_CONFIG, Table, Offset); + Status = AcpiDmDumpTable (TableLength, Offset, FormatSubtable, + CapabilitiesSize, AcpiDmTableInfoNhlt3a); + if (ACPI_FAILURE (Status)) + { + return; + } + Offset += CapabilitiesSize; + } + + /* + * If we are not done with the Endpoint(s) yet, then there must be + * some Linux-specific structure(s) yet to be processed. + */ + if (Offset < EndpointEndOffset) + { + AcpiOsPrintf ("\n"); + Count = ACPI_ADD_PTR (ACPI_NHLT_LINUX_SPECIFIC_COUNT, Table, Offset); + Status = AcpiDmDumpTable (TableLength, Offset, Count, + sizeof (ACPI_NHLT_LINUX_SPECIFIC_COUNT), AcpiDmTableInfoNhlt7); + if (ACPI_FAILURE (Status)) + { + return; + } + Offset += sizeof (ACPI_NHLT_LINUX_SPECIFIC_COUNT); + + /* Variable number of linux-specific structures */ + + for (k = 0; k < Count->StructureCount; k++) + { + LinuxData = ACPI_ADD_PTR (ACPI_NHLT_LINUX_SPECIFIC_DATA, Table, Offset); + + AcpiOsPrintf ("\n/* Linux-specific structure #%u */\n", k+1); + + Status = AcpiDmDumpTable (TableLength, Offset, LinuxData, + sizeof (ACPI_NHLT_LINUX_SPECIFIC_DATA), AcpiDmTableInfoNhlt7a); + if (ACPI_FAILURE (Status)) + { + return; + } + + Offset += sizeof (ACPI_NHLT_LINUX_SPECIFIC_DATA); + } + + /* Should be at the end of the Endpoint structure. Skip any extra bytes */ + + if (Offset < EndpointEndOffset) + { + AcpiOsPrintf ("\n/* Endpoint descriptor ended before endpoint size was reached. " + "skipped %X input bytes, current offset: %X, Endpoint End Offset: %X */\n", + EndpointEndOffset - Offset, Offset, EndpointEndOffset); + AcpiUtDumpBuffer (((UINT8 *)Table)+Offset, + EndpointEndOffset - Offset, DB_BYTE_DISPLAY, Offset); + Offset = EndpointEndOffset; + } + } + } + + /* Emit the table terminator (if present) */ + + if (Offset == TableLength - sizeof (ACPI_NHLT_TABLE_TERMINATOR)) + { + LinuxData = ACPI_ADD_PTR (ACPI_NHLT_LINUX_SPECIFIC_DATA, Table, Offset); + AcpiOsPrintf ("\n/* Table terminator structure */\n"); + + Status = AcpiDmDumpTable (TableLength, Offset, LinuxData, + sizeof (ACPI_NHLT_TABLE_TERMINATOR), AcpiDmTableInfoNhlt8); + if (ACPI_FAILURE (Status)) + { + return; + } + } + + return; + } +} + + /******************************************************************************* * * FUNCTION: AcpiDmDumpPcct diff --git a/sys/contrib/dev/acpica/common/dmtbdump3.c b/sys/contrib/dev/acpica/common/dmtbdump3.c index 26cfe2f9b695..f23aeaf8ee64 100644 --- a/sys/contrib/dev/acpica/common/dmtbdump3.c +++ b/sys/contrib/dev/acpica/common/dmtbdump3.c @@ -338,6 +338,11 @@ AcpiDmDumpSrat ( InfoTable = AcpiDmTableInfoSrat5; break; + case ACPI_SRAT_TYPE_GENERIC_PORT_AFFINITY: + + InfoTable = AcpiDmTableInfoSrat6; + break; + default: AcpiOsPrintf ("\n**** Unknown SRAT subtable type 0x%X\n", Subtable->Type); diff --git a/sys/contrib/dev/acpica/common/dmtbinfo2.c b/sys/contrib/dev/acpica/common/dmtbinfo2.c index 3eb4e44902d3..52173c5f8a0e 100644 --- a/sys/contrib/dev/acpica/common/dmtbinfo2.c +++ b/sys/contrib/dev/acpica/common/dmtbinfo2.c @@ -1194,6 +1194,189 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoNfit7[] = }; +/******************************************************************************* + * + * NHLT - Non HD Audio Link Table. Conforms to Intel Smart Sound Technology + * NHLT Specification, January 2020 Revision 0.8.1 + * + ******************************************************************************/ + +/* Main table */ + +ACPI_DMTABLE_INFO AcpiDmTableInfoNhlt[] = +{ + {ACPI_DMT_UINT8, ACPI_NHLT_OFFSET (EndpointCount), "Endpoint Count", 0}, + ACPI_DMT_TERMINATOR +}; + +/* Endpoint config */ + +ACPI_DMTABLE_INFO AcpiDmTableInfoNhlt0[] = +{ + {ACPI_DMT_UINT32, ACPI_NHLT0_OFFSET (DescriptorLength), "Descriptor Length", DT_LENGTH}, + {ACPI_DMT_NHLT1, ACPI_NHLT0_OFFSET (LinkType), "Link Type", 0}, + {ACPI_DMT_UINT8, ACPI_NHLT0_OFFSET (InstanceId), "Instance Id", 0}, + {ACPI_DMT_UINT16, ACPI_NHLT0_OFFSET (VendorId), "Vendor Id", 0}, + {ACPI_DMT_UINT16, ACPI_NHLT0_OFFSET (DeviceId), "Device Id", 0}, + {ACPI_DMT_UINT16, ACPI_NHLT0_OFFSET (RevisionId), "Revision Id", 0}, + {ACPI_DMT_UINT32, ACPI_NHLT0_OFFSET (SubsystemId), "Subsystem Id", 0}, + {ACPI_DMT_UINT8, ACPI_NHLT0_OFFSET (DeviceType), "Device Type", 0}, + {ACPI_DMT_NHLT1a, ACPI_NHLT0_OFFSET (Direction), "Direction", 0}, + {ACPI_DMT_UINT8, ACPI_NHLT0_OFFSET (VirtualBusId), "Virtual Bus Id", 0}, + ACPI_DMT_TERMINATOR +}; + +/* Device_Specific config */ + +ACPI_DMTABLE_INFO AcpiDmTableInfoNhlt1[] = +{ + {ACPI_DMT_UINT32, ACPI_NHLT1_OFFSET (CapabilitiesSize), "Capabilities Size", DT_LENGTH}, + {ACPI_DMT_UINT8, ACPI_NHLT1_OFFSET (VirtualSlot), "Virtual Slot", 0}, + {ACPI_DMT_UINT8, ACPI_NHLT1_OFFSET (ConfigType), "Config Type", 0}, + ACPI_DMT_TERMINATOR +}; + +/* Wave Format Extensible */ + +ACPI_DMTABLE_INFO AcpiDmTableInfoNhlt2[] = +{ + {ACPI_DMT_UINT16, ACPI_NHLT2_OFFSET (FormatTag), "Format Tag", 0}, + {ACPI_DMT_UINT16, ACPI_NHLT2_OFFSET (ChannelCount), "Channel Count", 0}, + {ACPI_DMT_UINT32, ACPI_NHLT2_OFFSET (SamplesPerSec), "Samples Per Second", 0}, + {ACPI_DMT_UINT32, ACPI_NHLT2_OFFSET (AvgBytesPerSec), "Average Bytes Per Second", 0}, + {ACPI_DMT_UINT16, ACPI_NHLT2_OFFSET (BlockAlign), "Block Alignment", 0}, + {ACPI_DMT_UINT16, ACPI_NHLT2_OFFSET (BitsPerSample), "Bits Per Sample", 0}, + {ACPI_DMT_UINT16, ACPI_NHLT2_OFFSET (ExtraFormatSize), "Extra Format Size", 0}, + {ACPI_DMT_UINT16, ACPI_NHLT2_OFFSET (ValidBitsPerSample), "Valid Bits Per Sample", 0}, + {ACPI_DMT_UINT32, ACPI_NHLT2_OFFSET (ChannelMask), "Channel Mask", 0}, + {ACPI_DMT_UUID, ACPI_NHLT2_OFFSET (SubFormatGuid), "SubFormat GUID", 0}, + ACPI_DMT_TERMINATOR +}; + +/* Format Config */ + +ACPI_DMTABLE_INFO AcpiDmTableInfoNhlt3[] = +{ + {ACPI_DMT_UINT16, ACPI_NHLT3_OFFSET (Format.FormatTag), "Format Tag", 0}, + {ACPI_DMT_UINT16, ACPI_NHLT3_OFFSET (Format.ChannelCount), "Channel Count", 0}, + {ACPI_DMT_UINT32, ACPI_NHLT3_OFFSET (Format.SamplesPerSec), "Samples Per Second", 0}, + {ACPI_DMT_UINT32, ACPI_NHLT3_OFFSET (Format.AvgBytesPerSec), "Average Bytes Per Second", 0}, + {ACPI_DMT_UINT16, ACPI_NHLT3_OFFSET (Format.BlockAlign), "Block Alignment", 0}, + {ACPI_DMT_UINT16, ACPI_NHLT3_OFFSET (Format.BitsPerSample), "Bits Per Sample", 0}, + {ACPI_DMT_UINT16, ACPI_NHLT3_OFFSET (Format.ExtraFormatSize), "Extra Format Size", 0}, + {ACPI_DMT_UINT16, ACPI_NHLT3_OFFSET (Format.ValidBitsPerSample), "Valid Bits Per Sample", 0}, + {ACPI_DMT_UINT32, ACPI_NHLT3_OFFSET (Format.ChannelMask), "Channel Mask", 0}, + {ACPI_DMT_UUID, ACPI_NHLT3_OFFSET (Format.SubFormatGuid), "SubFormat GUID", 0}, + {ACPI_DMT_UINT32, ACPI_NHLT3_OFFSET (CapabilitySize), "Capabilities Length", DT_LENGTH}, + ACPI_DMT_TERMINATOR +}; + +/* + * We treat the binary Capabilities field as its own subtable (to make + * ACPI_DMT_RAW_BUFFER work properly). + */ +ACPI_DMTABLE_INFO AcpiDmTableInfoNhlt3a[] = +{ + {ACPI_DMT_RAW_BUFFER, 0, "Capabilities", 0}, + ACPI_DMT_TERMINATOR +}; + + +/* Formats Config */ + +ACPI_DMTABLE_INFO AcpiDmTableInfoNhlt4[] = +{ + {ACPI_DMT_UINT8, ACPI_NHLT4_OFFSET (FormatsCount), "Formats Count", 0}, + ACPI_DMT_TERMINATOR +}; + +/* Specific Config, CapabilitiesSize == 2 */ + +ACPI_DMTABLE_INFO AcpiDmTableInfoNhlt5[] = +{ + {ACPI_DMT_UINT32, ACPI_NHLT5_OFFSET (CapabilitiesSize), "Capabilities Size", DT_LENGTH}, + {ACPI_DMT_UINT8, ACPI_NHLT5_OFFSET (VirtualSlot), "Virtual Slot", 0}, + {ACPI_DMT_UINT8, ACPI_NHLT5_OFFSET (ConfigType), "Config Type", 0}, + ACPI_DMT_TERMINATOR +}; + +/* Specific Config, CapabilitiesSize == 3 */ + +ACPI_DMTABLE_INFO AcpiDmTableInfoNhlt5a[] = +{ + {ACPI_DMT_UINT32, ACPI_NHLT5A_OFFSET (CapabilitiesSize), "Capabilities Size", DT_LENGTH}, + {ACPI_DMT_UINT8, ACPI_NHLT5A_OFFSET (VirtualSlot), "Virtual Slot", 0}, + {ACPI_DMT_UINT8, ACPI_NHLT5A_OFFSET (ConfigType), "Config Type", 0}, + {ACPI_DMT_UINT8, ACPI_NHLT5A_OFFSET (ArrayType), "Array Type", 0}, + ACPI_DMT_TERMINATOR +}; + +/* Specific Config, CapabilitiesSize == 0 */ + +ACPI_DMTABLE_INFO AcpiDmTableInfoNhlt5b[] = +{ + {ACPI_DMT_UINT32, ACPI_NHLT5B_OFFSET (CapabilitiesSize), "Capabilities Size", DT_LENGTH}, + ACPI_DMT_TERMINATOR +}; + +/* Specific Config, CapabilitiesSize == 1 */ + +ACPI_DMTABLE_INFO AcpiDmTableInfoNhlt5c[] = +{ + {ACPI_DMT_UINT32, ACPI_NHLT5C_OFFSET (CapabilitiesSize), "Capabilities Size", DT_LENGTH}, + {ACPI_DMT_UINT8, ACPI_NHLT5C_OFFSET (VirtualSlot), "Virtual Slot", 0}, + ACPI_DMT_TERMINATOR +}; + +/* Microphone array Config */ + +ACPI_DMTABLE_INFO AcpiDmTableInfoNhlt6[] = +{ + {ACPI_DMT_UINT8, ACPI_NHLT6_OFFSET (Type), "Type", 0}, + {ACPI_DMT_UINT8, ACPI_NHLT6_OFFSET (Panel), "Panel", 0}, + {ACPI_DMT_UINT16, ACPI_NHLT6_OFFSET (SpeakerPositionDistance), "Speaker Position Distance", 0}, + {ACPI_DMT_UINT16, ACPI_NHLT6_OFFSET (HorizontalOffset), "Horizontal Offset", 0}, + {ACPI_DMT_UINT16, ACPI_NHLT6_OFFSET (VerticalOffset), "Vertical Offset", 0}, + {ACPI_DMT_UINT8, ACPI_NHLT6_OFFSET (FrequencyLowBand), "Frequency Low Band", 0}, + {ACPI_DMT_UINT8, ACPI_NHLT6_OFFSET (FrequencyHighBand), "Frequency High Band", 0}, + {ACPI_DMT_UINT16, ACPI_NHLT6_OFFSET (DirectionAngle), "Direction Angle", 0}, + {ACPI_DMT_UINT16, ACPI_NHLT6_OFFSET (ElevationAngle), "Elevation Angle", 0}, + {ACPI_DMT_UINT16, ACPI_NHLT6_OFFSET (WorkVerticalAngleBegin), "Work Vertical Angle Begin", 0}, + {ACPI_DMT_UINT16, ACPI_NHLT6_OFFSET (WorkVerticalAngleEnd), "Work Vertical Angle End", 0}, + {ACPI_DMT_UINT16, ACPI_NHLT6_OFFSET (WorkHorizontalAngleBegin), "Work Horizontal Angle Begin", 0}, + {ACPI_DMT_UINT16, ACPI_NHLT6_OFFSET (WorkHorizontalAngleEnd), "Work Horizontal Angle End", 0}, + ACPI_DMT_TERMINATOR +}; + +/* Number of Linux-specific structures */ + +ACPI_DMTABLE_INFO AcpiDmTableInfoNhlt7[] = +{ + {ACPI_DMT_UINT8, ACPI_NHLT7_OFFSET (StructureCount), "Linux-specific struct count", 0}, + ACPI_DMT_TERMINATOR +}; + +/* The Linux-specific structure */ + +ACPI_DMTABLE_INFO AcpiDmTableInfoNhlt7a[] = +{ + {ACPI_DMT_BUF16, ACPI_NHLT7A_OFFSET (DeviceId), "Device ID", 0}, + {ACPI_DMT_UINT8, ACPI_NHLT7A_OFFSET (DeviceInstanceId), "Device Instance ID", 0}, + {ACPI_DMT_UINT8, ACPI_NHLT7A_OFFSET (DevicePortId), "Device Port ID", 0}, + {ACPI_DMT_BUF18, ACPI_NHLT7A_OFFSET (Filler), "Specific Data", 0}, + ACPI_DMT_TERMINATOR +}; + +/* Table terminator (may or may not be present) */ + +ACPI_DMTABLE_INFO AcpiDmTableInfoNhlt8[] = +{ + {ACPI_DMT_UINT32, ACPI_NHLT8_OFFSET (TerminatorValue), "Terminator Value", 0}, + {ACPI_DMT_UINT32, ACPI_NHLT8_OFFSET (TerminatorSignature), "Terminator Signature", 0}, + ACPI_DMT_TERMINATOR +}; + + /******************************************************************************* * * PCCT - Platform Communications Channel Table (ACPI 5.0) diff --git a/sys/contrib/dev/acpica/common/dmtbinfo3.c b/sys/contrib/dev/acpica/common/dmtbinfo3.c index 9b2e30814921..63c49f2680e4 100644 --- a/sys/contrib/dev/acpica/common/dmtbinfo3.c +++ b/sys/contrib/dev/acpica/common/dmtbinfo3.c @@ -368,21 +368,33 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoSrat4[] = ACPI_DMT_TERMINATOR }; +/* Common SRAT structure for Generic Affinity Subtables */ + +#define ACPI_DM_SRAT_GENERIC_AFFINITY \ + {ACPI_DMT_UINT8, ACPI_SRAT5_OFFSET (Reserved), "Reserved1", 0}, \ + {ACPI_DMT_UINT8, ACPI_SRAT5_OFFSET (DeviceHandleType), "Device Handle Type", 0}, \ + {ACPI_DMT_UINT32, ACPI_SRAT5_OFFSET (ProximityDomain), "Proximity Domain", 0}, \ + {ACPI_DMT_BUF16, ACPI_SRAT5_OFFSET (DeviceHandle), "Device Handle", 0}, \ + {ACPI_DMT_UINT32, ACPI_SRAT5_OFFSET (Flags), "Flags (decoded below)", DT_FLAG}, \ + {ACPI_DMT_FLAG0, ACPI_SRAT5_FLAG_OFFSET (Flags,0), "Enabled", 0}, \ + {ACPI_DMT_FLAG1, ACPI_SRAT5_FLAG_OFFSET (Flags,0), "Architectural Transactions", 0}, \ + {ACPI_DMT_UINT32, ACPI_SRAT5_OFFSET (Reserved1), "Reserved2", 0} + /* 5: Generic Initiator Affinity Structure (ACPI 6.3) */ ACPI_DMTABLE_INFO AcpiDmTableInfoSrat5[] = { - {ACPI_DMT_UINT8, ACPI_SRAT5_OFFSET (Reserved), "Reserved1", 0}, - {ACPI_DMT_UINT8, ACPI_SRAT5_OFFSET (DeviceHandleType), "Device Handle Type", 0}, - {ACPI_DMT_UINT32, ACPI_SRAT5_OFFSET (ProximityDomain), "Proximity Domain", 0}, - {ACPI_DMT_BUF16, ACPI_SRAT5_OFFSET (DeviceHandle), "Device Handle", 0}, - {ACPI_DMT_UINT32, ACPI_SRAT5_OFFSET (Flags), "Flags (decoded below)", DT_FLAG}, - {ACPI_DMT_FLAG0, ACPI_SRAT5_FLAG_OFFSET (Flags,0), "Enabled", 0}, - {ACPI_DMT_FLAG1, ACPI_SRAT5_FLAG_OFFSET (Flags,0), "Architectural Transactions", 0}, - {ACPI_DMT_UINT32, ACPI_SRAT5_OFFSET (Reserved1), "Reserved2", 0}, + ACPI_DM_SRAT_GENERIC_AFFINITY, ACPI_DMT_TERMINATOR }; +/* 6: Generic Port Affinity Structure (ACPI 6.4) */ + +ACPI_DMTABLE_INFO AcpiDmTableInfoSrat6[] = +{ + ACPI_DM_SRAT_GENERIC_AFFINITY, + ACPI_DMT_TERMINATOR +}; /******************************************************************************* * diff --git a/sys/contrib/dev/acpica/compiler/aslmethod.c b/sys/contrib/dev/acpica/compiler/aslmethod.c index a0cb02ae6dc8..889f2baf5e95 100644 --- a/sys/contrib/dev/acpica/compiler/aslmethod.c +++ b/sys/contrib/dev/acpica/compiler/aslmethod.c @@ -559,74 +559,56 @@ MtMethodAnalysisWalkBegin ( * * Under the Device Object: * - * 1) If _DIS is present, must have a _CRS, _PRS, and _SRS - * 2) If _PRS is present, must have a _CRS and _SRS - * 3) If _SRS is present, must have a _CRS and _PRS + * 1) If _PRS present, must have _CRS and _SRS + * 2) If _SRS present, must have _PRS (_PRS requires _CRS and _SRS) + * 3) If _DIS present, must have _SRS (_SRS requires _PRS, _PRS requires _CRS and _SRS) + * 4) If _SRS present, probably should have a _DIS (Remark only) */ CrsExists = ApFindNameInDeviceTree (METHOD_NAME__CRS, Op); DisExists = ApFindNameInDeviceTree (METHOD_NAME__DIS, Op); PrsExists = ApFindNameInDeviceTree (METHOD_NAME__PRS, Op); SrsExists = ApFindNameInDeviceTree (METHOD_NAME__SRS, Op); - /* 1) If _DIS is present, must have a _CRS, _PRS, and _SRS */ + /* 1) If _PRS is present, must have a _CRS and _SRS */ - if (DisExists) + if (PrsExists) { if (!CrsExists) { AslError (ASL_WARNING, ASL_MSG_MISSING_DEPENDENCY, Op, - "_DIS is missing a _CRS, requires a _CRS, _PRS, and a _SRS"); - } - - if (!PrsExists) - { - AslError (ASL_WARNING, ASL_MSG_MISSING_DEPENDENCY, Op, - "_DIS is missing a _PRS, requires a _CRS, _PRS, and a _SRS"); + "Device has a _PRS, missing a _CRS, required"); } - if (!SrsExists) { AslError (ASL_WARNING, ASL_MSG_MISSING_DEPENDENCY, Op, - "_DIS is missing a _SRS, requires a _CRS, _PRS, and a _SRS"); + "Device has a _PRS, missing a _SRS, required"); } } - /* 2) If _PRS is present, must have a _CRS and _SRS */ + /* 2) If _SRS is present, must have _PRS (_PRS requires _CRS and _SRS) */ - if (PrsExists) + if ((SrsExists) && (!PrsExists)) { - if (!CrsExists) - { - AslError (ASL_WARNING, ASL_MSG_MISSING_DEPENDENCY, Op, - "_PRS is missing a _CRS, requires a _CRS and a _SRS"); - } - - if (!SrsExists) - { - AslError (ASL_WARNING, ASL_MSG_MISSING_DEPENDENCY, Op, - "_PRS is missing a _SRS, requires a _CRS and a _SRS"); - } + AslError (ASL_WARNING, ASL_MSG_MISSING_DEPENDENCY, Op, + "Device has a _SRS, missing a _PRS, required"); } - /* 3) If _SRS is present, must have a _CRS and _PRS */ + /* 3) If _DIS is present, must have a _SRS */ - if (SrsExists) + if ((DisExists) && (!SrsExists)) { - if (!CrsExists) - { - AslError (ASL_WARNING, ASL_MSG_MISSING_DEPENDENCY, Op, - "_SRS is missing a _CRS, requires a _CRS and a _PRS"); - } - if (!PrsExists) - { - AslError (ASL_WARNING, ASL_MSG_MISSING_DEPENDENCY, Op, - "_SRS is missing a _PRS, requires a _CRS and a _PRS"); - } - if (!DisExists) - { - AslError (ASL_REMARK, ASL_MSG_MISSING_DEPENDENCY, Op, - "_SRS is missing a _DIS"); - } + AslError (ASL_WARNING, ASL_MSG_MISSING_DEPENDENCY, Op, + "Device has a _DIS, missing a _SRS, required"); + } + + /* + * 4) If _SRS is present, should have a _DIS (_PRS requires _CRS + * and _SRS) Remark only. + */ + if ((SrsExists) && (!DisExists)) + { + AslError (ASL_REMARK, ASL_MSG_MISSING_DEPENDENCY, Op, + "Device has a _SRS, no corresponding _DIS"); } break; diff --git a/sys/contrib/dev/acpica/compiler/dtcompiler.h b/sys/contrib/dev/acpica/compiler/dtcompiler.h index c58ad55cd6cb..e31566e0c3d3 100644 --- a/sys/contrib/dev/acpica/compiler/dtcompiler.h +++ b/sys/contrib/dev/acpica/compiler/dtcompiler.h @@ -657,6 +657,10 @@ ACPI_STATUS DtCompileNfit ( void **PFieldList); +ACPI_STATUS +DtCompileNhlt ( + void **PFieldList); + ACPI_STATUS DtCompilePcct ( void **PFieldList); diff --git a/sys/contrib/dev/acpica/compiler/dttable2.c b/sys/contrib/dev/acpica/compiler/dttable2.c index 13a4a562d3ed..a8c81e2c4729 100644 --- a/sys/contrib/dev/acpica/compiler/dttable2.c +++ b/sys/contrib/dev/acpica/compiler/dttable2.c @@ -2062,6 +2062,11 @@ DtCompileSrat ( InfoTable = AcpiDmTableInfoSrat5; break; + case ACPI_SRAT_TYPE_GENERIC_PORT_AFFINITY: + + InfoTable = AcpiDmTableInfoSrat6; + break; + default: DtFatal (ASL_MSG_UNKNOWN_SUBTABLE, SubtableStart, "SRAT"); diff --git a/sys/contrib/dev/acpica/compiler/dtutils.c b/sys/contrib/dev/acpica/compiler/dtutils.c index a847539289a1..78c0bdd8528e 100644 --- a/sys/contrib/dev/acpica/compiler/dtutils.c +++ b/sys/contrib/dev/acpica/compiler/dtutils.c @@ -581,6 +581,8 @@ DtGetFieldLength ( case ACPI_DMT_IVRS_DE: case ACPI_DMT_GTDT: case ACPI_DMT_MADT: + case ACPI_DMT_NHLT1: + case ACPI_DMT_NHLT1a: case ACPI_DMT_PCCT: case ACPI_DMT_PMTT: case ACPI_DMT_PPTT: diff --git a/sys/contrib/dev/acpica/compiler/preprocess.h b/sys/contrib/dev/acpica/compiler/preprocess.h index 6343a49c1ff2..f4c8c30966a2 100644 --- a/sys/contrib/dev/acpica/compiler/preprocess.h +++ b/sys/contrib/dev/acpica/compiler/preprocess.h @@ -355,7 +355,7 @@ PrEvaluateExpression ( /* - * prutils - Preprocesor utilities + * prutils - Preprocessor utilities */ char * PrGetNextToken ( diff --git a/sys/contrib/dev/acpica/components/dispatcher/dsfield.c b/sys/contrib/dev/acpica/components/dispatcher/dsfield.c index 5067a7aa1689..70ba3fbd8124 100644 --- a/sys/contrib/dev/acpica/components/dispatcher/dsfield.c +++ b/sys/contrib/dev/acpica/components/dispatcher/dsfield.c @@ -797,7 +797,7 @@ AcpiDsInitFieldObjects ( } #ifdef ACPI_EXEC_APP - Flags |= ACPI_NS_OVERRIDE_IF_FOUND; + Flags |= ACPI_NS_OVERRIDE_IF_FOUND; #endif /* * Walk the list of entries in the FieldList diff --git a/sys/contrib/dev/acpica/components/hardware/hwesleep.c b/sys/contrib/dev/acpica/components/hardware/hwesleep.c index 6fb1a6718378..97554dfb9880 100644 --- a/sys/contrib/dev/acpica/components/hardware/hwesleep.c +++ b/sys/contrib/dev/acpica/components/hardware/hwesleep.c @@ -312,18 +312,15 @@ ACPI_STATUS AcpiHwExtendedWakePrep ( UINT8 SleepState) { - ACPI_STATUS Status; UINT8 SleepTypeValue; ACPI_FUNCTION_TRACE (HwExtendedWakePrep); - Status = AcpiGetSleepTypeData (ACPI_STATE_S0, - &AcpiGbl_SleepTypeA, &AcpiGbl_SleepTypeB); - if (ACPI_SUCCESS (Status)) + if (AcpiGbl_SleepTypeAS0 != ACPI_SLEEP_TYPE_INVALID) { - SleepTypeValue = ((AcpiGbl_SleepTypeA << ACPI_X_SLEEP_TYPE_POSITION) & + SleepTypeValue = ((AcpiGbl_SleepTypeAS0 << ACPI_X_SLEEP_TYPE_POSITION) & ACPI_X_SLEEP_TYPE_MASK); (void) AcpiWrite ((UINT64) (SleepTypeValue | ACPI_X_SLEEP_ENABLE), diff --git a/sys/contrib/dev/acpica/components/hardware/hwsleep.c b/sys/contrib/dev/acpica/components/hardware/hwsleep.c index 9ce6fe3f93cf..63e9c69cbdb4 100644 --- a/sys/contrib/dev/acpica/components/hardware/hwsleep.c +++ b/sys/contrib/dev/acpica/components/hardware/hwsleep.c @@ -339,7 +339,7 @@ ACPI_STATUS AcpiHwLegacyWakePrep ( UINT8 SleepState) { - ACPI_STATUS Status; + ACPI_STATUS Status = AE_OK; ACPI_BIT_REGISTER_INFO *SleepTypeRegInfo; ACPI_BIT_REGISTER_INFO *SleepEnableRegInfo; *** 543 LINES SKIPPED *** From owner-dev-commits-src-main@freebsd.org Fri Oct 1 02:31:42 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 904F2675C83; Fri, 1 Oct 2021 02:31:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HLDdV3WcTz3FZB; Fri, 1 Oct 2021 02:31:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 58C5917076; Fri, 1 Oct 2021 02:31:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1912VgNL054493; Fri, 1 Oct 2021 02:31:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1912VgYQ054492; Fri, 1 Oct 2021 02:31:42 GMT (envelope-from git) Date: Fri, 1 Oct 2021 02:31:42 GMT Message-Id: <202110010231.1912VgYQ054492@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kyle Evans Subject: git: 9c999a259f00 - main - kqueue: don't arbitrarily restrict long-past values for NOTE_ABSTIME MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevans X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9c999a259f00b35f0467acd351fea9157ed7e1e4 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Oct 2021 02:31:42 -0000 The branch main has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=9c999a259f00b35f0467acd351fea9157ed7e1e4 commit 9c999a259f00b35f0467acd351fea9157ed7e1e4 Author: Kyle Evans AuthorDate: 2021-09-29 19:55:59 +0000 Commit: Kyle Evans CommitDate: 2021-10-01 02:31:24 +0000 kqueue: don't arbitrarily restrict long-past values for NOTE_ABSTIME NOTE_ABSTIME values are converted to values relative to boottime in filt_timervalidate(), and negative values are currently rejected. We don't reject times in the past in general, so clamp this up to 0 as needed such that the timer fires immediately rather than imposing what looks like an arbitrary restriction. Another possible scenario is that the system clock had to be adjusted by ~minutes or ~hours and we have less than that in terms of uptime, making a reasonable short-timeout suddenly invalid. Firing it is still a valid choice in this scenario so that applications can at least expect a consistent behavior. Reviewed by: kib, markj Discussed with: allanjude Differential Revision: https://reviews.freebsd.org/D32230 --- sys/kern/kern_event.c | 11 +++-- tests/sys/kqueue/libkqueue/timer.c | 84 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 92 insertions(+), 3 deletions(-) diff --git a/sys/kern/kern_event.c b/sys/kern/kern_event.c index 5fa5bf9cad06..3cd7753d4f6d 100644 --- a/sys/kern/kern_event.c +++ b/sys/kern/kern_event.c @@ -798,13 +798,13 @@ filt_timervalidate(struct knote *kn, sbintime_t *to) return (EINVAL); *to = timer2sbintime(kn->kn_sdata, kn->kn_sfflags); + if (*to < 0) + return (EINVAL); if ((kn->kn_sfflags & NOTE_ABSTIME) != 0) { getboottimebin(&bt); sbt = bttosbt(bt); - *to -= sbt; + *to = MAX(0, *to - sbt); } - if (*to < 0) - return (EINVAL); return (0); } @@ -815,9 +815,14 @@ filt_timerattach(struct knote *kn) sbintime_t to; int error; + to = -1; error = filt_timervalidate(kn, &to); if (error != 0) return (error); + KASSERT((kn->kn_flags & EV_ONESHOT) != 0 || to > 0, + ("%s: periodic timer has a calculated zero timeout", __func__)); + KASSERT(to >= 0, + ("%s: timer has a calculated negative timeout", __func__)); if (atomic_fetchadd_int(&kq_ncallouts, 1) + 1 > kq_calloutmax) { atomic_subtract_int(&kq_ncallouts, 1); diff --git a/tests/sys/kqueue/libkqueue/timer.c b/tests/sys/kqueue/libkqueue/timer.c index cb22887be276..76dfc99e11f0 100644 --- a/tests/sys/kqueue/libkqueue/timer.c +++ b/tests/sys/kqueue/libkqueue/timer.c @@ -247,6 +247,88 @@ test_abstime(void) success(); } +static void +test_abstime_preboot(void) +{ + const char *test_id = "kevent(EVFILT_TIMER (PREBOOT), EV_ONESHOT, NOTE_ABSTIME)"; + struct kevent kev; + struct timespec btp; + uint64_t end, start, stop; + + test_begin(test_id); + + test_no_kevents(); + + /* + * We'll expire it at just before system boot (roughly) with the hope that + * we'll get an ~immediate expiration, just as we do for any value specified + * between system boot and now. + */ + start = now(); + if (clock_gettime(CLOCK_BOOTTIME, &btp) != 0) + err(1, "%s", test_id); + + end = start - SEC_TO_US(btp.tv_sec + 1); + EV_SET(&kev, vnode_fd, EVFILT_TIMER, EV_ADD | EV_ONESHOT, + NOTE_ABSTIME | NOTE_USECONDS, end, NULL); + if (kevent(kqfd, &kev, 1, NULL, 0, NULL) < 0) + err(1, "%s", test_id); + + /* Retrieve the event */ + kev.flags = EV_ADD | EV_ONESHOT; + kev.data = 1; + kev.fflags = 0; + kevent_cmp(&kev, kevent_get(kqfd)); + + stop = now(); + if (stop < end) + err(1, "too early %jd %jd", (intmax_t)stop, (intmax_t)end); + /* Check if the event occurs again */ + sleep(3); + test_no_kevents(); + + success(); +} + +static void +test_abstime_postboot(void) +{ + const char *test_id = "kevent(EVFILT_TIMER (POSTBOOT), EV_ONESHOT, NOTE_ABSTIME)"; + struct kevent kev; + uint64_t end, start, stop; + const int timeout_sec = 1; + + test_begin(test_id); + + test_no_kevents(); + + /* + * Set a timer for 1 second ago, it should fire immediately rather than + * being rejected. + */ + start = now(); + end = start - SEC_TO_US(timeout_sec); + EV_SET(&kev, vnode_fd, EVFILT_TIMER, EV_ADD | EV_ONESHOT, + NOTE_ABSTIME | NOTE_USECONDS, end, NULL); + if (kevent(kqfd, &kev, 1, NULL, 0, NULL) < 0) + err(1, "%s", test_id); + + /* Retrieve the event */ + kev.flags = EV_ADD | EV_ONESHOT; + kev.data = 1; + kev.fflags = 0; + kevent_cmp(&kev, kevent_get(kqfd)); + + stop = now(); + if (stop < end) + err(1, "too early %jd %jd", (intmax_t)stop, (intmax_t)end); + /* Check if the event occurs again */ + sleep(3); + test_no_kevents(); + + success(); +} + static void test_update(void) { @@ -517,6 +599,8 @@ test_evfilt_timer(void) test_oneshot(); test_periodic(); test_abstime(); + test_abstime_preboot(); + test_abstime_postboot(); test_update(); test_update_equal(); test_update_expired(); From owner-dev-commits-src-main@freebsd.org Fri Oct 1 02:31:43 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D1184675B36; Fri, 1 Oct 2021 02:31:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HLDdW4tr7z3FZD; Fri, 1 Oct 2021 02:31:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 751DF17770; Fri, 1 Oct 2021 02:31:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1912Vh2L054522; Fri, 1 Oct 2021 02:31:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1912Vhip054521; Fri, 1 Oct 2021 02:31:43 GMT (envelope-from git) Date: Fri, 1 Oct 2021 02:31:43 GMT Message-Id: <202110010231.1912Vhip054521@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kyle Evans Subject: git: 4b5554cebb66 - main - kqueue: document how timers with low/past timeouts are handled MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevans X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 4b5554cebb66020f59dc869b835aebbd66e4bb8c Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Oct 2021 02:31:44 -0000 The branch main has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=4b5554cebb66020f59dc869b835aebbd66e4bb8c commit 4b5554cebb66020f59dc869b835aebbd66e4bb8c Author: Kyle Evans AuthorDate: 2021-09-30 18:19:05 +0000 Commit: Kyle Evans CommitDate: 2021-10-01 02:31:28 +0000 kqueue: document how timers with low/past timeouts are handled Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D32237 --- lib/libc/sys/kqueue.2 | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/libc/sys/kqueue.2 b/lib/libc/sys/kqueue.2 index 3ded4ae3d8f7..72b3e544391c 100644 --- a/lib/libc/sys/kqueue.2 +++ b/lib/libc/sys/kqueue.2 @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 23, 2021 +.Dd September 30, 2021 .Dt KQUEUE 2 .Os .Sh NAME @@ -599,6 +599,12 @@ On return, .Va fflags contains the events which triggered the filter. .Pp +Periodic timers with a specified timeout of 0 will be silently adjusted to +timeout after 1 of the time units specified by the requested precision in +.Va fflags . +If an absolute time is specified that has already passed, then it is treated as +if the current time were specified and the event will fire as soon as possible. +.Pp If an existing timer is re-added, the existing timer will be effectively canceled (throwing away any undelivered record of previous timer expiration) and re-started using the new parameters contained in From owner-dev-commits-src-main@freebsd.org Fri Oct 1 02:31:44 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E4C92675C39; Fri, 1 Oct 2021 02:31:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HLDdX5jKXz3FdZ; Fri, 1 Oct 2021 02:31:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9FDC217436; Fri, 1 Oct 2021 02:31:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1912ViMZ054546; Fri, 1 Oct 2021 02:31:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1912VisA054545; Fri, 1 Oct 2021 02:31:44 GMT (envelope-from git) Date: Fri, 1 Oct 2021 02:31:44 GMT Message-Id: <202110010231.1912VisA054545@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kyle Evans Subject: git: 0f43c5b55c79 - main - kqueue: clean up some igor and mandoc -Tlint warnings MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevans X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 0f43c5b55c79f8d4bae8c91e4f0c397944814152 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Oct 2021 02:31:45 -0000 The branch main has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=0f43c5b55c79f8d4bae8c91e4f0c397944814152 commit 0f43c5b55c79f8d4bae8c91e4f0c397944814152 Author: Kyle Evans AuthorDate: 2021-09-30 18:22:01 +0000 Commit: Kyle Evans CommitDate: 2021-10-01 02:31:28 +0000 kqueue: clean up some igor and mandoc -Tlint warnings --- lib/libc/sys/kqueue.2 | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/libc/sys/kqueue.2 b/lib/libc/sys/kqueue.2 index 72b3e544391c..f80c89f75d78 100644 --- a/lib/libc/sys/kqueue.2 +++ b/lib/libc/sys/kqueue.2 @@ -267,16 +267,17 @@ Causes .Fn kevent to leave unchanged any .Fa udata -associated with an existing event. This allows other aspects of the -event to be modified without requiring the caller to know the +associated with an existing event. +This allows other aspects of the event to be modified without requiring the +caller to know the .Fa udata value presently associated. This is especially useful with .Dv NOTE_TRIGGER or flags like -.Dv EV_ENABLE. +.Dv EV_ENABLE . This flag may not be used with -.Dv EV_ADD. +.Dv EV_ADD . .El .Pp The predefined system filters are listed below. From owner-dev-commits-src-main@freebsd.org Fri Oct 1 04:47:16 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C4526677C20; Fri, 1 Oct 2021 04:47:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HLHdw52H6z3kQb; Fri, 1 Oct 2021 04:47:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8C9611915F; Fri, 1 Oct 2021 04:47:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1914lGXQ029717; Fri, 1 Oct 2021 04:47:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1914lGM4029716; Fri, 1 Oct 2021 04:47:16 GMT (envelope-from git) Date: Fri, 1 Oct 2021 04:47:16 GMT Message-Id: <202110010447.1914lGM4029716@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kyle Evans Subject: git: cfb9be506285 - main - bootp: remove the USE_BFUNCS knob MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevans X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: cfb9be506285cd65120f9686d532130a3757ce56 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Oct 2021 04:47:16 -0000 The branch main has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=cfb9be506285cd65120f9686d532130a3757ce56 commit cfb9be506285cd65120f9686d532130a3757ce56 Author: Kyle Evans AuthorDate: 2021-09-30 03:01:34 +0000 Commit: Kyle Evans CommitDate: 2021-10-01 04:47:06 +0000 bootp: remove the USE_BFUNCS knob We'd likely be better served by converting these to the equivalent mem* calls, but just kill the knob for now. The b* macros being defined get in the way of _FORTIFY_SOURCE. Reviewed by: imp, markj Differential Revision: https://reviews.freebsd.org/D32235 --- libexec/bootpd/bootpd.c | 8 -------- libexec/bootpd/bootpgw/bootpgw.c | 8 -------- libexec/bootpd/dovend.c | 9 --------- libexec/bootpd/dumptab.c | 9 +-------- libexec/bootpd/hash.c | 9 +-------- libexec/bootpd/hwaddr.c | 8 -------- libexec/bootpd/lookup.c | 7 +------ libexec/bootpd/readfile.c | 8 -------- libexec/bootpd/tools/bootpef/bootpef.c | 8 -------- libexec/bootpd/tools/bootptest/bootptest.h | 8 -------- 10 files changed, 3 insertions(+), 79 deletions(-) diff --git a/libexec/bootpd/bootpd.c b/libexec/bootpd/bootpd.c index 86e4f56ab61a..42f1cd8c5912 100644 --- a/libexec/bootpd/bootpd.c +++ b/libexec/bootpd/bootpd.c @@ -73,14 +73,6 @@ __FBSDID("$FreeBSD$"); # include /* for O_RDONLY, etc */ #endif -#ifndef USE_BFUNCS -# include -/* Yes, memcpy is OK here (no overlapped copies). */ -# define bcopy(a,b,c) memcpy(b,a,c) -# define bzero(p,l) memset(p,0,l) -# define bcmp(a,b,c) memcmp(a,b,c) -#endif - #include "bootp.h" #include "hash.h" #include "hwaddr.h" diff --git a/libexec/bootpd/bootpgw/bootpgw.c b/libexec/bootpd/bootpgw/bootpgw.c index 2e2df9e71a2a..3c128c03a9a6 100644 --- a/libexec/bootpd/bootpgw/bootpgw.c +++ b/libexec/bootpd/bootpgw/bootpgw.c @@ -66,14 +66,6 @@ __FBSDID("$FreeBSD$"); # include /* for O_RDONLY, etc */ #endif -#ifndef USE_BFUNCS -# include -/* Yes, memcpy is OK here (no overlapped copies). */ -# define bcopy(a,b,c) memcpy(b,a,c) -# define bzero(p,l) memset(p,0,l) -# define bcmp(a,b,c) memcmp(a,b,c) -#endif - #include "bootp.h" #include "getif.h" #include "hwaddr.h" diff --git a/libexec/bootpd/dovend.c b/libexec/bootpd/dovend.c index cb0b4a0448c4..65543a2700c0 100644 --- a/libexec/bootpd/dovend.c +++ b/libexec/bootpd/dovend.c @@ -15,15 +15,6 @@ #include #include -#ifndef USE_BFUNCS -# include -/* Yes, memcpy is OK here (no overlapped copies). */ -# define bcopy(a,b,c) memcpy(b,a,c) -# define bzero(p,l) memset(p,0,l) -# define bcmp(a,b,c) memcmp(a,b,c) -# define index strchr -#endif - #include "bootp.h" #include "bootpd.h" #include "report.h" diff --git a/libexec/bootpd/dumptab.c b/libexec/bootpd/dumptab.c index 43e94ec4cef2..daab93f609a6 100644 --- a/libexec/bootpd/dumptab.c +++ b/libexec/bootpd/dumptab.c @@ -10,17 +10,10 @@ #include #include +#include #include #include -#ifndef USE_BFUNCS -#include -/* Yes, memcpy is OK here (no overlapped copies). */ -#define bcopy(a,b,c) memcpy(b,a,c) -#define bzero(p,l) memset(p,0,l) -#define bcmp(a,b,c) memcmp(a,b,c) -#endif - #include "bootp.h" #include "hash.h" #include "hwaddr.h" diff --git a/libexec/bootpd/hash.c b/libexec/bootpd/hash.c index 64f49d3b957d..1641a8a092cd 100644 --- a/libexec/bootpd/hash.c +++ b/libexec/bootpd/hash.c @@ -37,14 +37,7 @@ SOFTWARE. #include #include - -#ifndef USE_BFUNCS -#include -/* Yes, memcpy is OK here (no overlapped copies). */ -#define bcopy(a,b,c) memcpy(b,a,c) -#define bzero(p,l) memset(p,0,l) -#define bcmp(a,b,c) memcmp(a,b,c) -#endif +#include #include "hash.h" diff --git a/libexec/bootpd/hwaddr.c b/libexec/bootpd/hwaddr.c index ff996157b911..293c75a6b3be 100644 --- a/libexec/bootpd/hwaddr.c +++ b/libexec/bootpd/hwaddr.c @@ -38,14 +38,6 @@ #endif #include -#ifndef USE_BFUNCS -/* Yes, memcpy is OK here (no overlapped copies). */ -#include -#define bcopy(a,b,c) memcpy(b,a,c) -#define bzero(p,l) memset(p,0,l) -#define bcmp(a,b,c) memcmp(a,b,c) -#endif - #ifndef ATF_INUSE /* Not defined on some systems (i.e. Linux) */ #define ATF_INUSE 0 #endif diff --git a/libexec/bootpd/lookup.c b/libexec/bootpd/lookup.c index 54b3f62242f7..391a1d826d6e 100644 --- a/libexec/bootpd/lookup.c +++ b/libexec/bootpd/lookup.c @@ -17,14 +17,9 @@ extern int ether_hostton(); #endif #include +#include #include -#ifndef USE_BFUNCS -#include -/* Yes, memcpy is OK here (no overlapped copies). */ -#define bcopy(a,b,c) memcpy(b,a,c) -#endif - #include "bootp.h" #include "lookup.h" #include "report.h" diff --git a/libexec/bootpd/readfile.c b/libexec/bootpd/readfile.c index 900d0377279f..c09639300310 100644 --- a/libexec/bootpd/readfile.c +++ b/libexec/bootpd/readfile.c @@ -46,14 +46,6 @@ SOFTWARE. #include #include -#ifndef USE_BFUNCS -#include -/* Yes, memcpy is OK here (no overlapped copies). */ -#define bcopy(a,b,c) memcpy(b,a,c) -#define bzero(p,l) memset(p,0,l) -#define bcmp(a,b,c) memcmp(a,b,c) -#endif - #include "bootp.h" #include "hash.h" #include "hwaddr.h" diff --git a/libexec/bootpd/tools/bootpef/bootpef.c b/libexec/bootpd/tools/bootpef/bootpef.c index 04089c87b560..7ed3786d892e 100644 --- a/libexec/bootpd/tools/bootpef/bootpef.c +++ b/libexec/bootpd/tools/bootpef/bootpef.c @@ -55,14 +55,6 @@ SOFTWARE. #include #include -#ifndef USE_BFUNCS -#include -/* Yes, memcpy is OK here (no overlapped copies). */ -#define bcopy(a,b,c) memcpy(b,a,c) -#define bzero(p,l) memset(p,0,l) -#define bcmp(a,b,c) memcmp(a,b,c) -#endif - #include "bootp.h" #include "hash.h" #include "hwaddr.h" diff --git a/libexec/bootpd/tools/bootptest/bootptest.h b/libexec/bootpd/tools/bootptest/bootptest.h index 2df35dea7ffc..2d9e451bddef 100644 --- a/libexec/bootpd/tools/bootptest/bootptest.h +++ b/libexec/bootpd/tools/bootptest/bootptest.h @@ -6,14 +6,6 @@ #define ESRC(p) (p) #define EDST(p) (p) -#ifndef USE_BFUNCS -/* Use mem/str functions */ -/* There are no overlapped copies, so memcpy is OK. */ -#define bcopy(a,b,c) memcpy(b,a,c) -#define bzero(p,l) memset(p,0,l) -#define bcmp(a,b,c) memcmp(a,b,c) -#endif - extern int vflag; /* verbose flag */ /* global pointers to beginning and end of current packet (during printing) */ From owner-dev-commits-src-main@freebsd.org Fri Oct 1 04:56:09 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 44F9C6779BA; Fri, 1 Oct 2021 04:56:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HLHr91J7cz3kYH; Fri, 1 Oct 2021 04:56:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 096DE19523; Fri, 1 Oct 2021 04:56:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1914u83T043227; Fri, 1 Oct 2021 04:56:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1914u8xE043226; Fri, 1 Oct 2021 04:56:08 GMT (envelope-from git) Date: Fri, 1 Oct 2021 04:56:08 GMT Message-Id: <202110010456.1914u8xE043226@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kyle Evans Subject: git: 5487294d79f9 - main - libc: ssp: sprinkle around some __dead2 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevans X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5487294d79f9ebe72a847d0855adb4df85e0d66e Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Oct 2021 04:56:09 -0000 The branch main has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=5487294d79f9ebe72a847d0855adb4df85e0d66e commit 5487294d79f9ebe72a847d0855adb4df85e0d66e Author: Kyle Evans AuthorDate: 2021-09-29 21:48:20 +0000 Commit: Kyle Evans CommitDate: 2021-10-01 04:55:17 +0000 libc: ssp: sprinkle around some __dead2 This is consistent with, e.g., NetBSD's implementation, which declares these as noreturn in ssp/ssp.h. --- lib/libc/secure/stack_protector.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/libc/secure/stack_protector.c b/lib/libc/secure/stack_protector.c index 15460278502d..7ddd6338ec55 100644 --- a/lib/libc/secure/stack_protector.c +++ b/lib/libc/secure/stack_protector.c @@ -64,9 +64,9 @@ extern int __sysctl(const int *name, u_int namelen, void *oldp, long __stack_chk_guard[8] = {0, 0, 0, 0, 0, 0, 0, 0}; static void __guard_setup(void) _GUARD_SETUP_CTOR_ATTR; -static void __fail(const char *); -void __stack_chk_fail(void); -void __chk_fail(void); +static void __fail(const char *) __dead2; +void __stack_chk_fail(void) __dead2; +void __chk_fail(void) __dead2; /*LINTED used*/ static void From owner-dev-commits-src-main@freebsd.org Fri Oct 1 04:56:10 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 772A66779BB; Fri, 1 Oct 2021 04:56:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HLHrB2XHrz3kwb; Fri, 1 Oct 2021 04:56:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2D4241971B; Fri, 1 Oct 2021 04:56:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1914uAge043251; Fri, 1 Oct 2021 04:56:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1914uATv043250; Fri, 1 Oct 2021 04:56:10 GMT (envelope-from git) Date: Fri, 1 Oct 2021 04:56:10 GMT Message-Id: <202110010456.1914uATv043250@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kyle Evans Subject: git: 4dbd8c72d303 - main - tcp_wrappers: get rid of duplicate fgets declarations MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevans X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 4dbd8c72d3030b8f111fdac86ba45ff596595497 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Oct 2021 04:56:10 -0000 The branch main has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=4dbd8c72d3030b8f111fdac86ba45ff596595497 commit 4dbd8c72d3030b8f111fdac86ba45ff596595497 Author: Kyle Evans AuthorDate: 2021-09-30 04:21:24 +0000 Commit: Kyle Evans CommitDate: 2021-10-01 04:55:27 +0000 tcp_wrappers: get rid of duplicate fgets declarations This is declared in stdio.h, no need for this one. --- contrib/tcp_wrappers/hosts_access.c | 1 - contrib/tcp_wrappers/misc.c | 2 -- 2 files changed, 3 deletions(-) diff --git a/contrib/tcp_wrappers/hosts_access.c b/contrib/tcp_wrappers/hosts_access.c index f5ab91bebc98..58998055b516 100644 --- a/contrib/tcp_wrappers/hosts_access.c +++ b/contrib/tcp_wrappers/hosts_access.c @@ -46,7 +46,6 @@ static char sccsid[] = "@(#) hosts_access.c 1.21 97/02/12 02:13:22"; #endif #include -extern char *fgets(); extern int errno; #ifndef INADDR_NONE diff --git a/contrib/tcp_wrappers/misc.c b/contrib/tcp_wrappers/misc.c index 8f04f870e1b4..258d7091adce 100644 --- a/contrib/tcp_wrappers/misc.c +++ b/contrib/tcp_wrappers/misc.c @@ -19,8 +19,6 @@ static char sccsic[] = "@(#) misc.c 1.2 96/02/11 17:01:29"; #include "tcpd.h" -extern char *fgets(); - #ifndef INADDR_NONE #define INADDR_NONE (-1) /* XXX should be 0xffffffff */ #endif From owner-dev-commits-src-main@freebsd.org Fri Oct 1 09:26:19 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B3D8C6AA0C4; Fri, 1 Oct 2021 09:26:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HLPqv4mWGz3Phw; Fri, 1 Oct 2021 09:26:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7CD7C1CCED; Fri, 1 Oct 2021 09:26:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1919QJ0I003813; Fri, 1 Oct 2021 09:26:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1919QJ4f003812; Fri, 1 Oct 2021 09:26:19 GMT (envelope-from git) Date: Fri, 1 Oct 2021 09:26:19 GMT Message-Id: <202110010926.1919QJ4f003812@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Wojciech Macek Subject: git: 8cbbe3510536 - main - arm64: std.nxp Add enetc NIC driver MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: wma X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 8cbbe351053634f8ef8fbaf0c56d8fee46642bf6 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Oct 2021 09:26:19 -0000 The branch main has been updated by wma: URL: https://cgit.FreeBSD.org/src/commit/?id=8cbbe351053634f8ef8fbaf0c56d8fee46642bf6 commit 8cbbe351053634f8ef8fbaf0c56d8fee46642bf6 Author: Kornel Duleba AuthorDate: 2021-09-30 07:34:52 +0000 Commit: Wojciech Macek CommitDate: 2021-10-01 09:24:08 +0000 arm64: std.nxp Add enetc NIC driver It was missed during the conversion of kernel configs. Although the driver is already built as a kernel module we might want to have it built-in for diskless booting and such. --- sys/arm64/conf/std.nxp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sys/arm64/conf/std.nxp b/sys/arm64/conf/std.nxp index f67f4f0267ec..05e74fca5170 100644 --- a/sys/arm64/conf/std.nxp +++ b/sys/arm64/conf/std.nxp @@ -19,6 +19,9 @@ device dwc3 # Synopsys DWC controller # MMC/SD/SDIO Card slot support device sdhci +# Ethernet NICs +device enetc # QorIQ LS1028A NIC + options FDT device acpi From owner-dev-commits-src-main@freebsd.org Fri Oct 1 09:26:20 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BD9776A9BC9; Fri, 1 Oct 2021 09:26:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HLPqw4tP6z3PYf; Fri, 1 Oct 2021 09:26:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 88CCB1CC35; Fri, 1 Oct 2021 09:26:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1919QKQ9003843; Fri, 1 Oct 2021 09:26:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1919QK5Z003842; Fri, 1 Oct 2021 09:26:20 GMT (envelope-from git) Date: Fri, 1 Oct 2021 09:26:20 GMT Message-Id: <202110010926.1919QK5Z003842@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Wojciech Macek Subject: git: a75400c5addf - main - modules: felix: Remove etherswitch_if.c from Makefile MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: wma X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a75400c5addf905edea7897c5071904556a691f2 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Oct 2021 09:26:20 -0000 The branch main has been updated by wma: URL: https://cgit.FreeBSD.org/src/commit/?id=a75400c5addf905edea7897c5071904556a691f2 commit a75400c5addf905edea7897c5071904556a691f2 Author: Kornel Duleba AuthorDate: 2021-09-30 11:06:34 +0000 Commit: Wojciech Macek CommitDate: 2021-10-01 09:24:08 +0000 modules: felix: Remove etherswitch_if.c from Makefile Having it included confuses KOBJOPLOOKUP resulting in kobj_error_method being called instead of a devmethod from the switch driver. That in turn returns ENXIO which was treated as a pointer and dereferenced by etherswitch ioctl logic causing the kernel to panic. Fixes: b542c9e42ba4 (modules: felix: Add needed dependencies) --- sys/modules/felix/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/modules/felix/Makefile b/sys/modules/felix/Makefile index a9eac1080c91..8f30a0e72a45 100644 --- a/sys/modules/felix/Makefile +++ b/sys/modules/felix/Makefile @@ -29,7 +29,7 @@ .PATH: ${SRCTOP}/sys/dev/etherswitch/felix KMOD = felix -SRCS = felix.c etherswitch_if.c etherswitch_if.h -SRCS += bus_if.h device_if.h miibus_if.h ofw_bus_if.h pci_if.h +SRCS = felix.c +SRCS += bus_if.h device_if.h etherswitch_if.h miibus_if.h ofw_bus_if.h pci_if.h .include From owner-dev-commits-src-main@freebsd.org Fri Oct 1 09:26:22 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6B9E66A9CEA; Fri, 1 Oct 2021 09:26:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HLPqx69jRz3PfG; Fri, 1 Oct 2021 09:26:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AA3E11CEE6; Fri, 1 Oct 2021 09:26:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1919QLPo003868; Fri, 1 Oct 2021 09:26:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1919QLX9003867; Fri, 1 Oct 2021 09:26:21 GMT (envelope-from git) Date: Fri, 1 Oct 2021 09:26:21 GMT Message-Id: <202110010926.1919QLX9003867@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Wojciech Macek Subject: git: ca4a6606f0b8 - main - enetc_mdio: Fix devclass name MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: wma X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ca4a6606f0b8c4386e3c05a57e1370e2f215d5b9 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Oct 2021 09:26:22 -0000 The branch main has been updated by wma: URL: https://cgit.FreeBSD.org/src/commit/?id=ca4a6606f0b8c4386e3c05a57e1370e2f215d5b9 commit ca4a6606f0b8c4386e3c05a57e1370e2f215d5b9 Author: Kornel Duleba AuthorDate: 2021-08-05 10:31:33 +0000 Commit: Wojciech Macek CommitDate: 2021-10-01 09:24:08 +0000 enetc_mdio: Fix devclass name Use correct devclass name, due to the mismatch miibus would attach to the wrong thing causing mii_attach to silently fail. Fixes: dfcaa2c18bf9 (enetc_mdio: Support building the driver ...) --- sys/dev/enetc/enetc_mdio_pci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/enetc/enetc_mdio_pci.c b/sys/dev/enetc/enetc_mdio_pci.c index aac236d1c246..517efa9b9598 100644 --- a/sys/dev/enetc/enetc_mdio_pci.c +++ b/sys/dev/enetc/enetc_mdio_pci.c @@ -177,7 +177,7 @@ static device_method_t enetc_mdio_pci_methods[] ={ }; static driver_t enetc_mdio_pci_driver = { - "enetc_mdio_pci", + "enetc_mdio", enetc_mdio_pci_methods, sizeof(struct enetc_mdio_pci_softc), }; From owner-dev-commits-src-main@freebsd.org Fri Oct 1 10:27:57 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0F1FD6ABA94; Fri, 1 Oct 2021 10:27:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HLRC06pnTz3kYx; Fri, 1 Oct 2021 10:27:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BF9141DA9A; Fri, 1 Oct 2021 10:27:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 191ARuAG083603; Fri, 1 Oct 2021 10:27:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 191ARuRn083602; Fri, 1 Oct 2021 10:27:56 GMT (envelope-from git) Date: Fri, 1 Oct 2021 10:27:56 GMT Message-Id: <202110011027.191ARuRn083602@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: 7ec86b660991 - main - Also print symbols when printing arm64 registers MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 7ec86b66099124a9c2c88613507a10979cb8b191 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Oct 2021 10:27:57 -0000 The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=7ec86b66099124a9c2c88613507a10979cb8b191 commit 7ec86b66099124a9c2c88613507a10979cb8b191 Author: Andrew Turner AuthorDate: 2021-09-23 10:32:16 +0000 Commit: Andrew Turner CommitDate: 2021-10-01 10:27:32 +0000 Also print symbols when printing arm64 registers When printing arm64 registers because of an exception in the kernel also print the symbol and offset. This can be used to track down why the exception occured without needing external tools. Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D32077 --- sys/arm64/arm64/trap.c | 58 ++++++++++++++++++++++++++++++++++++++------------ 1 file changed, 44 insertions(+), 14 deletions(-) diff --git a/sys/arm64/arm64/trap.c b/sys/arm64/arm64/trap.c index af17a6a2951e..c1566b7df492 100644 --- a/sys/arm64/arm64/trap.c +++ b/sys/arm64/arm64/trap.c @@ -25,6 +25,8 @@ * */ +#include "opt_ddb.h" + #include __FBSDID("$FreeBSD$"); @@ -68,7 +70,8 @@ __FBSDID("$FreeBSD$"); #endif #ifdef DDB -#include +#include +#include #endif /* Called from exception.S */ @@ -78,6 +81,7 @@ void do_el0_error(struct trapframe *); void do_serror(struct trapframe *); void unhandled_exception(struct trapframe *); +static void print_gp_register(const char *name, uint64_t value); static void print_registers(struct trapframe *frame); int (*dtrace_invop_jump_addr)(struct trapframe *); @@ -207,7 +211,7 @@ align_abort(struct thread *td, struct trapframe *frame, uint64_t esr, { if (!lower) { print_registers(frame); - printf(" far: %16lx\n", far); + print_gp_register("far", far); printf(" esr: %.8lx\n", esr); panic("Misaligned access from kernel space!"); } @@ -233,7 +237,7 @@ external_abort(struct thread *td, struct trapframe *frame, uint64_t esr, } print_registers(frame); - printf(" far: %16lx\n", far); + print_gp_register("far", far); panic("Unhandled EL%d external data abort", lower ? 0: 1); } @@ -303,7 +307,7 @@ data_abort(struct thread *td, struct trapframe *frame, uint64_t esr, if (td->td_critnest != 0 || WITNESS_CHECK(WARN_SLEEPOK | WARN_GIANTOK, NULL, "Kernel page fault") != 0) { print_registers(frame); - printf(" far: %16lx\n", far); + print_gp_register("far", far); printf(" esr: %.8lx\n", esr); panic("data abort in critical section or under mutex"); } @@ -336,7 +340,7 @@ bad_far: printf("Fatal data abort:\n"); print_registers(frame); - printf(" far: %16lx\n", far); + print_gp_register("far", far); printf(" esr: %.8lx\n", esr); #ifdef KDB @@ -358,18 +362,44 @@ bad_far: userret(td, frame); } +static void +print_gp_register(const char *name, uint64_t value) +{ +#if defined(DDB) + c_db_sym_t sym; + const char *sym_name; + db_expr_t sym_value; + db_expr_t offset; +#endif + + printf(" %s: %16lx", name, value); +#if defined(DDB) + /* If this looks like a kernel address try to find the symbol */ + if (value >= VM_MIN_KERNEL_ADDRESS) { + sym = db_search_symbol(value, DB_STGY_ANY, &offset); + if (sym != C_DB_SYM_NULL) { + db_symbol_values(sym, &sym_name, &sym_value); + printf(" (%s + %lx)", sym_name, offset); + } + } +#endif + printf("\n"); +} + static void print_registers(struct trapframe *frame) { + char name[4]; u_int reg; for (reg = 0; reg < nitems(frame->tf_x); reg++) { - printf(" %sx%d: %16lx\n", (reg < 10) ? " " : "", reg, - frame->tf_x[reg]); + snprintf(name, sizeof(name), "%sx%d", (reg < 10) ? " " : "", + reg); + print_gp_register(name, frame->tf_x[reg]); } printf(" sp: %16lx\n", frame->tf_sp); - printf(" lr: %16lx\n", frame->tf_lr); - printf(" elr: %16lx\n", frame->tf_elr); + print_gp_register(" lr", frame->tf_lr); + print_gp_register("elr", frame->tf_lr); printf("spsr: %8x\n", frame->tf_spsr); } @@ -424,7 +454,7 @@ do_el1h_sync(struct thread *td, struct trapframe *frame) abort_handlers[dfsc](td, frame, esr, far, 0); } else { print_registers(frame); - printf(" far: %16lx\n", far); + print_gp_register("far", far); printf(" esr: %.8lx\n", esr); panic("Unhandled EL1 %s abort: %x", exception == EXCP_INSN_ABORT ? "instruction" : @@ -459,7 +489,7 @@ do_el1h_sync(struct thread *td, struct trapframe *frame) /* FALLTHROUGH */ default: print_registers(frame); - printf(" far: %16lx\n", READ_SPECIALREG(far_el1)); + print_gp_register("far", READ_SPECIALREG(far_el1)); panic("Unknown kernel exception %x esr_el1 %lx", exception, esr); } @@ -530,7 +560,7 @@ do_el0_sync(struct thread *td, struct trapframe *frame) abort_handlers[dfsc](td, frame, esr, far, 1); else { print_registers(frame); - printf(" far: %16lx\n", far); + print_gp_register("far", far); printf(" esr: %.8lx\n", esr); panic("Unhandled EL0 %s abort: %x", exception == EXCP_INSN_ABORT_L ? "instruction" : @@ -613,7 +643,7 @@ do_serror(struct trapframe *frame) esr = frame->tf_esr; print_registers(frame); - printf(" far: %16lx\n", far); + print_gp_register("far", far); printf(" esr: %.8lx\n", esr); panic("Unhandled System Error"); } @@ -627,7 +657,7 @@ unhandled_exception(struct trapframe *frame) esr = frame->tf_esr; print_registers(frame); - printf(" far: %16lx\n", far); + print_gp_register("far", far); printf(" esr: %.8lx\n", esr); panic("Unhandled exception"); } From owner-dev-commits-src-main@freebsd.org Fri Oct 1 10:27:58 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4EBAE6AB5CC; Fri, 1 Oct 2021 10:27:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HLRC20QPbz3kZ2; Fri, 1 Oct 2021 10:27:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E20E21DA9B; Fri, 1 Oct 2021 10:27:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 191ARvwa083627; Fri, 1 Oct 2021 10:27:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 191ARvMl083626; Fri, 1 Oct 2021 10:27:57 GMT (envelope-from git) Date: Fri, 1 Oct 2021 10:27:57 GMT Message-Id: <202110011027.191ARvMl083626@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: 3d2533f5c29f - main - Allow ddb and dtrace use the DMAP region on arm64 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3d2533f5c29fbf6e63c5e408ba13c2294a7612fd Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Oct 2021 10:27:58 -0000 The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=3d2533f5c29fbf6e63c5e408ba13c2294a7612fd commit 3d2533f5c29fbf6e63c5e408ba13c2294a7612fd Author: Andrew Turner AuthorDate: 2021-09-21 17:10:57 +0000 Commit: Andrew Turner CommitDate: 2021-10-01 10:27:33 +0000 Allow ddb and dtrace use the DMAP region on arm64 When writing to memory on arm64 we may be trying to be accessing a read-only page. In this case try to access via the DMAP region to get a writable location. While here simplify writing data in DDB and stop trashing the size as it is passed into the cache handling functions. Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D32053 --- sys/arm64/arm64/db_interface.c | 33 +++++++++------------------------ sys/arm64/arm64/machdep.c | 36 ++++++++++++++++++++++++++++++++++++ sys/arm64/include/cpufunc.h | 1 + sys/cddl/dev/fbt/aarch64/fbt_isa.c | 6 +++++- 4 files changed, 51 insertions(+), 25 deletions(-) diff --git a/sys/arm64/arm64/db_interface.c b/sys/arm64/arm64/db_interface.c index d8ae79715a19..dc0fa8ac5e1e 100644 --- a/sys/arm64/arm64/db_interface.c +++ b/sys/arm64/arm64/db_interface.c @@ -153,39 +153,24 @@ db_write_bytes(vm_offset_t addr, size_t size, char *data) jmp_buf jb; void *prev_jb; char *dst; + size_t i; int ret; - uint64_t tmp64; - uint32_t tmp32; - uint16_t tmp16; prev_jb = kdb_jmpbuf(jb); ret = setjmp(jb); if (ret == 0) { - if (size == 8 && (addr & 7) == 0) { - dst = (char *)&tmp64; - while (size-- > 0) - *dst++ = *data++; - *((uint64_t *)addr) = tmp64; - } else if (size == 4 && (addr & 3) == 0) { - dst = (char *)&tmp32; - while (size-- > 0) - *dst++ = *data++; - *((uint32_t *)addr) = tmp32; - } else if (size == 2 && (addr & 1) == 0) { - dst = (char *)&tmp16; - while (size-- > 0) - *dst++ = *data++; - *((uint32_t *)addr) = tmp16; + if (!arm64_get_writable_addr(addr, &addr)) { + ret = 1; } else { dst = (char *)addr; - while (size-- > 0) + for (i = 0; i < size; i++) *dst++ = *data++; - } - dsb(ish); + dsb(ish); - /* Clean D-cache and invalidate I-cache */ - cpu_dcache_wb_range(addr, (vm_size_t)size); - cpu_icache_sync_range(addr, (vm_size_t)size); + /* Clean D-cache and invalidate I-cache */ + cpu_dcache_wb_range(addr, (vm_size_t)size); + cpu_icache_sync_range(addr, (vm_size_t)size); + } } (void)kdb_jmpbuf(prev_jb); diff --git a/sys/arm64/arm64/machdep.c b/sys/arm64/arm64/machdep.c index 89c4f21134f8..30f07bce5551 100644 --- a/sys/arm64/arm64/machdep.c +++ b/sys/arm64/arm64/machdep.c @@ -942,6 +942,42 @@ init_proc0(vm_offset_t kstack) serror_enable(); } +/* + * Get an address to be used to write to kernel data that may be mapped + * read-only, e.g. to patch kernel code. + */ +bool +arm64_get_writable_addr(vm_offset_t addr, vm_offset_t *out) +{ + vm_paddr_t pa; + + /* Check if the page is writable */ + if (PAR_SUCCESS(arm64_address_translate_s1e1w(addr))) { + *out = addr; + return (true); + } + + /* + * Find the physical address of the given page. + */ + if (!pmap_klookup(addr, &pa)) { + return (false); + } + + /* + * If it is within the DMAP region and is writable use that. + */ + if (PHYS_IN_DMAP(pa)) { + addr = PHYS_TO_DMAP(pa); + if (PAR_SUCCESS(arm64_address_translate_s1e1w(addr))) { + *out = addr; + return (true); + } + } + + return (false); +} + typedef struct { uint32_t type; uint64_t phys_start; diff --git a/sys/arm64/include/cpufunc.h b/sys/arm64/include/cpufunc.h index 94af62380de3..16133903841f 100644 --- a/sys/arm64/include/cpufunc.h +++ b/sys/arm64/include/cpufunc.h @@ -246,6 +246,7 @@ int arm64_icache_sync_range_checked(vm_offset_t, vm_size_t); void arm64_dcache_wbinv_range(vm_offset_t, vm_size_t); void arm64_dcache_inv_range(vm_offset_t, vm_size_t); void arm64_dcache_wb_range(vm_offset_t, vm_size_t); +bool arm64_get_writable_addr(vm_offset_t, vm_offset_t *); #endif /* _KERNEL */ #endif /* _MACHINE_CPUFUNC_H_ */ diff --git a/sys/cddl/dev/fbt/aarch64/fbt_isa.c b/sys/cddl/dev/fbt/aarch64/fbt_isa.c index f9b99febe8d1..4d22f1d584d3 100644 --- a/sys/cddl/dev/fbt/aarch64/fbt_isa.c +++ b/sys/cddl/dev/fbt/aarch64/fbt_isa.c @@ -74,8 +74,12 @@ fbt_invop(uintptr_t addr, struct trapframe *frame, uintptr_t rval) void fbt_patch_tracepoint(fbt_probe_t *fbt, fbt_patchval_t val) { + vm_offset_t addr; - *fbt->fbtp_patchpoint = val; + if (!arm64_get_writable_addr((vm_offset_t)fbt->fbtp_patchpoint, &addr)) + panic("%s: Unable to write new instruction", __func__); + + *(fbt_patchval_t *)addr = val; cpu_icache_sync_range((vm_offset_t)fbt->fbtp_patchpoint, 4); } From owner-dev-commits-src-main@freebsd.org Fri Oct 1 10:27:59 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 557EA6AB5CE; Fri, 1 Oct 2021 10:27:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HLRC30t3lz3kX2; Fri, 1 Oct 2021 10:27:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id ED7671DC42; Fri, 1 Oct 2021 10:27:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 191ARwpq083655; Fri, 1 Oct 2021 10:27:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 191ARwbl083654; Fri, 1 Oct 2021 10:27:58 GMT (envelope-from git) Date: Fri, 1 Oct 2021 10:27:58 GMT Message-Id: <202110011027.191ARwbl083654@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: 18c213949540 - main - Add a gic interface to allocate MSI interrupts MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 18c2139495401bcc6d0fbc0119daf2103327c3a4 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Oct 2021 10:27:59 -0000 The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=18c2139495401bcc6d0fbc0119daf2103327c3a4 commit 18c2139495401bcc6d0fbc0119daf2103327c3a4 Author: Andrew Turner AuthorDate: 2021-09-29 13:33:18 +0000 Commit: Andrew Turner CommitDate: 2021-10-01 10:27:33 +0000 Add a gic interface to allocate MSI interrupts The previous update to handle the gicv2m as a child of the gicv3 driver assumed there was only a single gicv2m child. On some hardware there are multiple children. Support this by removing the mbi ivars and adding a new interface to handle MSI allocation in a given range. Tested by: mw, trasz Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D32224 --- sys/arm/arm/gic.c | 117 +++++++++++++++++++++-------------------------- sys/arm/arm/gic.h | 6 +-- sys/arm/arm/gic_common.h | 4 -- sys/arm/arm/gic_if.m | 39 ++++++++++++++++ sys/arm64/arm64/gic_v3.c | 117 +++++++++++++++++++++++++++++------------------ sys/conf/files.arm | 1 + sys/conf/files.arm64 | 1 + 7 files changed, 168 insertions(+), 117 deletions(-) diff --git a/sys/arm/arm/gic.c b/sys/arm/arm/gic.c index 89db4e324600..f281f29125b6 100644 --- a/sys/arm/arm/gic.c +++ b/sys/arm/arm/gic.c @@ -75,6 +75,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include "gic_if.h" #include "pic_if.h" #include "msi_if.h" @@ -501,12 +502,6 @@ arm_gic_read_ivar(device_t dev, device_t child, int which, uintptr_t *result) ("arm_gic_read_ivar: Invalid bus type %u", sc->gic_bus)); *result = sc->gic_bus; return (0); - case GIC_IVAR_MBI_START: - *result = sc->sc_spi_start; - return (0); - case GIC_IVAR_MBI_COUNT: - *result = sc->sc_spi_count; - return (0); } return (ENOENT); @@ -523,32 +518,6 @@ arm_gic_write_ivar(device_t dev, device_t child, int which, uintptr_t value) case GIC_IVAR_HW_REV: case GIC_IVAR_BUS: return (EINVAL); - case GIC_IVAR_MBI_START: - /* - * GIC_IVAR_MBI_START must be set once and first. This allows - * us to reserve the registers when GIC_IVAR_MBI_COUNT is set. - */ - MPASS(sc->sc_spi_start == 0); - MPASS(sc->sc_spi_count == 0); - MPASS(value >= GIC_FIRST_SPI); - MPASS(value < sc->nirqs); - - sc->sc_spi_start = value; - return (0); - case GIC_IVAR_MBI_COUNT: - MPASS(sc->sc_spi_start != 0); - MPASS(sc->sc_spi_count == 0); - - sc->sc_spi_count = value; - sc->sc_spi_end = sc->sc_spi_start + sc->sc_spi_count; - - MPASS(sc->sc_spi_end <= sc->nirqs); - - /* Reserve these interrupts for MSI/MSI-X use */ - arm_gic_reserve_msi_range(dev, sc->sc_spi_start, - sc->sc_spi_count); - - return (0); } return (ENOENT); @@ -1044,8 +1013,8 @@ arm_gic_ipi_setup(device_t dev, u_int ipi, struct intr_irqsrc **isrcp) #endif static int -arm_gic_alloc_msi(device_t dev, device_t child, int count, int maxcount, - device_t *pic, struct intr_irqsrc **srcs) +arm_gic_alloc_msi(device_t dev, u_int mbi_start, u_int mbi_count, int count, + int maxcount, struct intr_irqsrc **isrc) { struct arm_gic_softc *sc; int i, irq, end_irq; @@ -1059,7 +1028,7 @@ arm_gic_alloc_msi(device_t dev, device_t child, int count, int maxcount, mtx_lock_spin(&sc->mutex); found = false; - for (irq = sc->sc_spi_start; irq < sc->sc_spi_end; irq++) { + for (irq = mbi_start; irq < mbi_start + mbi_count; irq++) { /* Start on an aligned interrupt */ if ((irq & (maxcount - 1)) != 0) continue; @@ -1070,7 +1039,7 @@ arm_gic_alloc_msi(device_t dev, device_t child, int count, int maxcount, /* Check this range is valid */ for (end_irq = irq; end_irq != irq + count; end_irq++) { /* No free interrupts */ - if (end_irq == sc->sc_spi_end) { + if (end_irq == mbi_start + mbi_count) { found = false; break; } @@ -1090,7 +1059,7 @@ arm_gic_alloc_msi(device_t dev, device_t child, int count, int maxcount, } /* Not enough interrupts were found */ - if (!found || irq == sc->sc_spi_end) { + if (!found || irq == mbi_start + mbi_count) { mtx_unlock_spin(&sc->mutex); return (ENXIO); } @@ -1102,15 +1071,13 @@ arm_gic_alloc_msi(device_t dev, device_t child, int count, int maxcount, mtx_unlock_spin(&sc->mutex); for (i = 0; i < count; i++) - srcs[i] = (struct intr_irqsrc *)&sc->gic_irqs[irq + i]; - *pic = dev; + isrc[i] = (struct intr_irqsrc *)&sc->gic_irqs[irq + i]; return (0); } static int -arm_gic_release_msi(device_t dev, device_t child, int count, - struct intr_irqsrc **isrc) +arm_gic_release_msi(device_t dev, int count, struct intr_irqsrc **isrc) { struct arm_gic_softc *sc; struct gic_irqsrc *gi; @@ -1134,8 +1101,8 @@ arm_gic_release_msi(device_t dev, device_t child, int count, } static int -arm_gic_alloc_msix(device_t dev, device_t child, device_t *pic, - struct intr_irqsrc **isrcp) +arm_gic_alloc_msix(device_t dev, u_int mbi_start, u_int mbi_count, + struct intr_irqsrc **isrc) { struct arm_gic_softc *sc; int irq; @@ -1144,14 +1111,14 @@ arm_gic_alloc_msix(device_t dev, device_t child, device_t *pic, mtx_lock_spin(&sc->mutex); /* Find an unused interrupt */ - for (irq = sc->sc_spi_start; irq < sc->sc_spi_end; irq++) { + for (irq = mbi_start; irq < mbi_start + mbi_count; irq++) { KASSERT((sc->gic_irqs[irq].gi_flags & GI_FLAG_MSI) != 0, ("%s: Non-MSI interrupt found", __func__)); if ((sc->gic_irqs[irq].gi_flags & GI_FLAG_MSI_USED) == 0) break; } /* No free interrupt was found */ - if (irq == sc->sc_spi_end) { + if (irq == mbi_start + mbi_count) { mtx_unlock_spin(&sc->mutex); return (ENXIO); } @@ -1160,14 +1127,13 @@ arm_gic_alloc_msix(device_t dev, device_t child, device_t *pic, sc->gic_irqs[irq].gi_flags |= GI_FLAG_MSI_USED; mtx_unlock_spin(&sc->mutex); - *isrcp = (struct intr_irqsrc *)&sc->gic_irqs[irq]; - *pic = dev; + *isrc = (struct intr_irqsrc *)&sc->gic_irqs[irq]; return (0); } static int -arm_gic_release_msix(device_t dev, device_t child, struct intr_irqsrc *isrc) +arm_gic_release_msix(device_t dev, struct intr_irqsrc *isrc) { struct arm_gic_softc *sc; struct gic_irqsrc *gi; @@ -1211,11 +1177,12 @@ static device_method_t arm_gic_methods[] = { DEVMETHOD(pic_ipi_setup, arm_gic_ipi_setup), #endif - /* MSI/MSI-X */ - DEVMETHOD(msi_alloc_msi, arm_gic_alloc_msi), - DEVMETHOD(msi_release_msi, arm_gic_release_msi), - DEVMETHOD(msi_alloc_msix, arm_gic_alloc_msix), - DEVMETHOD(msi_release_msix, arm_gic_release_msix), + /* GIC */ + DEVMETHOD(gic_reserve_msi_range, arm_gic_reserve_msi_range), + DEVMETHOD(gic_alloc_msi, arm_gic_alloc_msi), + DEVMETHOD(gic_release_msi, arm_gic_release_msi), + DEVMETHOD(gic_alloc_msix, arm_gic_alloc_msix), + DEVMETHOD(gic_release_msix, arm_gic_release_msix), { 0, 0 } }; @@ -1238,7 +1205,6 @@ arm_gicv2m_attach(device_t dev) { struct arm_gicv2m_softc *sc; uint32_t typer; - u_int spi_start, spi_count; int rid; sc = device_get_softc(dev); @@ -1252,16 +1218,18 @@ arm_gicv2m_attach(device_t dev) } typer = bus_read_4(sc->sc_mem, GICV2M_MSI_TYPER); - spi_start = MSI_TYPER_SPI_BASE(typer); - spi_count = MSI_TYPER_SPI_COUNT(typer); - gic_set_mbi_start(dev, spi_start); - gic_set_mbi_count(dev, spi_count); + sc->sc_spi_start = MSI_TYPER_SPI_BASE(typer); + sc->sc_spi_count = MSI_TYPER_SPI_COUNT(typer); + + /* Reserve these interrupts for MSI/MSI-X use */ + GIC_RESERVE_MSI_RANGE(device_get_parent(dev), sc->sc_spi_start, + sc->sc_spi_count); intr_msi_register(dev, sc->sc_xref); if (bootverbose) - device_printf(dev, "using spi %u to %u\n", spi_start, - spi_start + spi_count - 1); + device_printf(dev, "using spi %u to %u\n", sc->sc_spi_start, + sc->sc_spi_start + sc->sc_spi_count - 1); return (0); } @@ -1270,28 +1238,47 @@ static int arm_gicv2m_alloc_msi(device_t dev, device_t child, int count, int maxcount, device_t *pic, struct intr_irqsrc **srcs) { - return (MSI_ALLOC_MSI(device_get_parent(dev), child, count, maxcount, - pic, srcs)); + struct arm_gicv2m_softc *sc; + int error; + + sc = device_get_softc(dev); + error = GIC_ALLOC_MSI(device_get_parent(dev), sc->sc_spi_start, + sc->sc_spi_count, count, maxcount, srcs); + if (error != 0) + return (error); + + *pic = dev; + return (0); } static int arm_gicv2m_release_msi(device_t dev, device_t child, int count, struct intr_irqsrc **isrc) { - return (MSI_RELEASE_MSI(device_get_parent(dev), child, count, isrc)); + return (GIC_RELEASE_MSI(device_get_parent(dev), count, isrc)); } static int arm_gicv2m_alloc_msix(device_t dev, device_t child, device_t *pic, struct intr_irqsrc **isrcp) { - return (MSI_ALLOC_MSIX(device_get_parent(dev), child, pic, isrcp)); + struct arm_gicv2m_softc *sc; + int error; + + sc = device_get_softc(dev); + error = GIC_ALLOC_MSIX(device_get_parent(dev), sc->sc_spi_start, + sc->sc_spi_count, isrcp); + if (error != 0) + return (error); + + *pic = dev; + return (0); } static int arm_gicv2m_release_msix(device_t dev, device_t child, struct intr_irqsrc *isrc) { - return (MSI_RELEASE_MSIX(device_get_parent(dev), child, isrc)); + return (GIC_RELEASE_MSIX(device_get_parent(dev), isrc)); } static int diff --git a/sys/arm/arm/gic.h b/sys/arm/arm/gic.h index 55f7f0cc5e44..ce0c8a6187e1 100644 --- a/sys/arm/arm/gic.h +++ b/sys/arm/arm/gic.h @@ -63,10 +63,6 @@ struct arm_gic_softc { int nranges; struct arm_gic_range * ranges; - - u_int sc_spi_start; - u_int sc_spi_end; - u_int sc_spi_count; }; DECLARE_CLASS(arm_gic_driver); @@ -74,6 +70,8 @@ DECLARE_CLASS(arm_gic_driver); struct arm_gicv2m_softc { struct resource *sc_mem; uintptr_t sc_xref; + u_int sc_spi_start; + u_int sc_spi_count; }; DECLARE_CLASS(arm_gicv2m_driver); diff --git a/sys/arm/arm/gic_common.h b/sys/arm/arm/gic_common.h index 52827d03e600..9e8fb19300ca 100644 --- a/sys/arm/arm/gic_common.h +++ b/sys/arm/arm/gic_common.h @@ -33,8 +33,6 @@ #define GIC_IVAR_HW_REV 500 #define GIC_IVAR_BUS 501 -#define GIC_IVAR_MBI_START 510 -#define GIC_IVAR_MBI_COUNT 511 /* GIC_IVAR_BUS values */ #define GIC_BUS_UNKNOWN 0 @@ -44,8 +42,6 @@ __BUS_ACCESSOR(gic, hw_rev, GIC, HW_REV, u_int); __BUS_ACCESSOR(gic, bus, GIC, BUS, u_int); -__BUS_ACCESSOR(gic, mbi_start, GIC, MBI_START, u_int); -__BUS_ACCESSOR(gic, mbi_count, GIC, MBI_COUNT, u_int); /* Software Generated Interrupts */ #define GIC_FIRST_SGI 0 /* Irqs 0-15 are SGIs/IPIs. */ diff --git a/sys/arm/arm/gic_if.m b/sys/arm/arm/gic_if.m new file mode 100644 index 000000000000..b9bef7db1a80 --- /dev/null +++ b/sys/arm/arm/gic_if.m @@ -0,0 +1,39 @@ + +INTERFACE gic; + +HEADER { + struct intr_irqsrc; +}; + +METHOD void reserve_msi_range { + device_t dev; + u_int mbi_start; + u_int mbi_count; +}; + +METHOD int alloc_msi { + device_t dev; + u_int mbi_start; + u_int mbi_count; + int count; + int maxcount; + struct intr_irqsrc **isrc; +}; + +METHOD int release_msi { + device_t dev; + int count; + struct intr_irqsrc **isrc; +}; + +METHOD int alloc_msix { + device_t dev; + u_int mbi_start; + u_int mbi_count; + struct intr_irqsrc **isrc; +}; + +METHOD int release_msix { + device_t dev; + struct intr_irqsrc *isrc; +}; diff --git a/sys/arm64/arm64/gic_v3.c b/sys/arm64/arm64/gic_v3.c index 23e1b3632fb8..7d9160f8ae17 100644 --- a/sys/arm64/arm64/gic_v3.c +++ b/sys/arm64/arm64/gic_v3.c @@ -69,6 +69,7 @@ __FBSDID("$FreeBSD$"); #include #endif +#include "gic_if.h" #include "pic_if.h" #include "msi_if.h" @@ -95,6 +96,12 @@ static pic_ipi_send_t gic_v3_ipi_send; static pic_ipi_setup_t gic_v3_ipi_setup; #endif +static gic_reserve_msi_range_t gic_v3_reserve_msi_range; +static gic_alloc_msi_t gic_v3_gic_alloc_msi; +static gic_release_msi_t gic_v3_gic_release_msi; +static gic_alloc_msix_t gic_v3_gic_alloc_msix; +static gic_release_msix_t gic_v3_gic_release_msix; + static msi_alloc_msi_t gic_v3_alloc_msi; static msi_release_msi_t gic_v3_release_msi; static msi_alloc_msix_t gic_v3_alloc_msix; @@ -139,6 +146,13 @@ static device_method_t gic_v3_methods[] = { DEVMETHOD(msi_release_msix, gic_v3_release_msix), DEVMETHOD(msi_map_msi, gic_v3_map_msi), + /* GIC */ + DEVMETHOD(gic_reserve_msi_range, gic_v3_reserve_msi_range), + DEVMETHOD(gic_alloc_msi, gic_v3_gic_alloc_msi), + DEVMETHOD(gic_release_msi, gic_v3_gic_release_msi), + DEVMETHOD(gic_alloc_msix, gic_v3_gic_alloc_msix), + DEVMETHOD(gic_release_msix, gic_v3_gic_release_msix), + /* End */ DEVMETHOD_END }; @@ -467,12 +481,6 @@ gic_v3_read_ivar(device_t dev, device_t child, int which, uintptr_t *result) ("gic_v3_read_ivar: Invalid bus type %u", sc->gic_bus)); *result = sc->gic_bus; return (0); - case GIC_IVAR_MBI_START: - *result = sc->gic_mbi_start; - return (0); - case GIC_IVAR_MBI_COUNT: - *result = sc->gic_mbi_end - sc->gic_mbi_start; - return (0); } return (ENOENT); @@ -491,30 +499,6 @@ gic_v3_write_ivar(device_t dev, device_t child, int which, uintptr_t value) case GIC_IVAR_HW_REV: case GIC_IVAR_BUS: return (EINVAL); - case GIC_IVAR_MBI_START: - /* - * GIC_IVAR_MBI_START must be set once and first. This allows - * us to reserve the registers when GIC_IVAR_MBI_COUNT is set. - */ - MPASS(sc->gic_mbi_start == 0); - MPASS(sc->gic_mbi_end == 0); - MPASS(value >= GIC_FIRST_SPI); - MPASS(value < sc->gic_nirqs); - - sc->gic_mbi_start = value; - return (0); - case GIC_IVAR_MBI_COUNT: - MPASS(sc->gic_mbi_start != 0); - MPASS(sc->gic_mbi_end == 0); - - sc->gic_mbi_end = value - sc->gic_mbi_start; - - MPASS(sc->gic_mbi_end <= sc->gic_nirqs); - - /* Reserve these interrupts for MSI/MSI-X use */ - gic_v3_reserve_msi_range(dev, sc->gic_mbi_start, value); - - return (0); } return (ENOENT); @@ -1385,8 +1369,8 @@ gic_v3_redist_init(struct gic_v3_softc *sc) */ static int -gic_v3_alloc_msi(device_t dev, device_t child, int count, int maxcount, - device_t *pic, struct intr_irqsrc **srcs) +gic_v3_gic_alloc_msi(device_t dev, u_int mbi_start, u_int mbi_count, + int count, int maxcount, struct intr_irqsrc **isrc) { struct gic_v3_softc *sc; int i, irq, end_irq; @@ -1400,7 +1384,7 @@ gic_v3_alloc_msi(device_t dev, device_t child, int count, int maxcount, mtx_lock(&sc->gic_mbi_mtx); found = false; - for (irq = sc->gic_mbi_start; irq < sc->gic_mbi_end; irq++) { + for (irq = mbi_start; irq < mbi_start + mbi_count; irq++) { /* Start on an aligned interrupt */ if ((irq & (maxcount - 1)) != 0) continue; @@ -1411,7 +1395,7 @@ gic_v3_alloc_msi(device_t dev, device_t child, int count, int maxcount, /* Check this range is valid */ for (end_irq = irq; end_irq != irq + count; end_irq++) { /* No free interrupts */ - if (end_irq == sc->gic_mbi_end) { + if (end_irq == mbi_start + mbi_count) { found = false; break; } @@ -1431,7 +1415,7 @@ gic_v3_alloc_msi(device_t dev, device_t child, int count, int maxcount, } /* Not enough interrupts were found */ - if (!found || irq == sc->gic_mbi_end) { + if (!found || irq == mbi_start + mbi_count) { mtx_unlock(&sc->gic_mbi_mtx); return (ENXIO); } @@ -1443,15 +1427,13 @@ gic_v3_alloc_msi(device_t dev, device_t child, int count, int maxcount, mtx_unlock(&sc->gic_mbi_mtx); for (i = 0; i < count; i++) - srcs[i] = (struct intr_irqsrc *)&sc->gic_irqs[irq + i]; - *pic = dev; + isrc[i] = (struct intr_irqsrc *)&sc->gic_irqs[irq + i]; return (0); } static int -gic_v3_release_msi(device_t dev, device_t child, int count, - struct intr_irqsrc **isrc) +gic_v3_gic_release_msi(device_t dev, int count, struct intr_irqsrc **isrc) { struct gic_v3_softc *sc; struct gic_v3_irqsrc *gi; @@ -1475,7 +1457,7 @@ gic_v3_release_msi(device_t dev, device_t child, int count, } static int -gic_v3_alloc_msix(device_t dev, device_t child, device_t *pic, +gic_v3_gic_alloc_msix(device_t dev, u_int mbi_start, u_int mbi_count, struct intr_irqsrc **isrcp) { struct gic_v3_softc *sc; @@ -1485,14 +1467,14 @@ gic_v3_alloc_msix(device_t dev, device_t child, device_t *pic, mtx_lock(&sc->gic_mbi_mtx); /* Find an unused interrupt */ - for (irq = sc->gic_mbi_start; irq < sc->gic_mbi_end; irq++) { + for (irq = mbi_start; irq < mbi_start + mbi_count; irq++) { KASSERT((sc->gic_irqs[irq].gi_flags & GI_FLAG_MSI) != 0, ("%s: Non-MSI interrupt found", __func__)); if ((sc->gic_irqs[irq].gi_flags & GI_FLAG_MSI_USED) == 0) break; } /* No free interrupt was found */ - if (irq == sc->gic_mbi_end) { + if (irq == mbi_start + mbi_count) { mtx_unlock(&sc->gic_mbi_mtx); return (ENXIO); } @@ -1502,13 +1484,12 @@ gic_v3_alloc_msix(device_t dev, device_t child, device_t *pic, mtx_unlock(&sc->gic_mbi_mtx); *isrcp = (struct intr_irqsrc *)&sc->gic_irqs[irq]; - *pic = dev; return (0); } static int -gic_v3_release_msix(device_t dev, device_t child, struct intr_irqsrc *isrc) +gic_v3_gic_release_msix(device_t dev, struct intr_irqsrc *isrc) { struct gic_v3_softc *sc; struct gic_v3_irqsrc *gi; @@ -1526,6 +1507,54 @@ gic_v3_release_msix(device_t dev, device_t child, struct intr_irqsrc *isrc) return (0); } +static int +gic_v3_alloc_msi(device_t dev, device_t child, int count, int maxcount, + device_t *pic, struct intr_irqsrc **isrc) +{ + struct gic_v3_softc *sc; + int error; + + sc = device_get_softc(dev); + error = gic_v3_gic_alloc_msi(dev, sc->gic_mbi_start, + sc->gic_mbi_end - sc->gic_mbi_start, count, maxcount, isrc); + if (error != 0) + return (error); + + *pic = dev; + return (0); +} + +static int +gic_v3_release_msi(device_t dev, device_t child, int count, + struct intr_irqsrc **isrc) +{ + return (gic_v3_gic_release_msi(dev, count, isrc)); +} + +static int +gic_v3_alloc_msix(device_t dev, device_t child, device_t *pic, + struct intr_irqsrc **isrc) +{ + struct gic_v3_softc *sc; + int error; + + sc = device_get_softc(dev); + error = gic_v3_gic_alloc_msix(dev, sc->gic_mbi_start, + sc->gic_mbi_end - sc->gic_mbi_start, isrc); + if (error != 0) + return (error); + + *pic = dev; + + return (0); +} + +static int +gic_v3_release_msix(device_t dev, device_t child, struct intr_irqsrc *isrc) +{ + return (gic_v3_gic_release_msix(dev, isrc)); +} + static int gic_v3_map_msi(device_t dev, device_t child, struct intr_irqsrc *isrc, uint64_t *addr, uint32_t *data) diff --git a/sys/conf/files.arm b/sys/conf/files.arm index 86e75ef4a2a4..76f62eb2e14e 100644 --- a/sys/conf/files.arm +++ b/sys/conf/files.arm @@ -32,6 +32,7 @@ arm/arm/gdb_machdep.c optional gdb arm/arm/generic_timer.c optional generic_timer arm/arm/gic.c optional gic arm/arm/gic_fdt.c optional gic fdt +arm/arm/gic_if.m optional gic arm/arm/identcpu-v6.c standard arm/arm/in_cksum.c optional inet | inet6 arm/arm/in_cksum_arm.S optional inet | inet6 diff --git a/sys/conf/files.arm64 b/sys/conf/files.arm64 index 9dd071b97e37..dcd9711ea7da 100644 --- a/sys/conf/files.arm64 +++ b/sys/conf/files.arm64 @@ -20,6 +20,7 @@ arm/arm/generic_timer.c standard arm/arm/gic.c standard arm/arm/gic_acpi.c optional acpi arm/arm/gic_fdt.c optional fdt +arm/arm/gic_if.m standard arm/arm/pmu.c standard arm/arm/pmu_fdt.c optional fdt arm64/acpica/acpi_iort.c optional acpi From owner-dev-commits-src-main@freebsd.org Fri Oct 1 11:15:05 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B428F6ACBA4; Fri, 1 Oct 2021 11:15:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HLSFP4VQdz3n7x; Fri, 1 Oct 2021 11:15:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7A4291E924; Fri, 1 Oct 2021 11:15:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 191BF5pj049968; Fri, 1 Oct 2021 11:15:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 191BF5KQ049967; Fri, 1 Oct 2021 11:15:05 GMT (envelope-from git) Date: Fri, 1 Oct 2021 11:15:05 GMT Message-Id: <202110011115.191BF5KQ049967@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Shteryana Shopova Subject: git: 8b959dd6a392 - main - Fix bsnmpd(1) crash with ill-formed Discovery message MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: syrinx X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 8b959dd6a3921c35395bef4a6d7ad2426a3bd88e Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Oct 2021 11:15:05 -0000 The branch main has been updated by syrinx: URL: https://cgit.FreeBSD.org/src/commit/?id=8b959dd6a3921c35395bef4a6d7ad2426a3bd88e commit 8b959dd6a3921c35395bef4a6d7ad2426a3bd88e Author: Shteryana Shopova AuthorDate: 2021-10-01 11:10:39 +0000 Commit: Shteryana Shopova CommitDate: 2021-10-01 11:10:39 +0000 Fix bsnmpd(1) crash with ill-formed Discovery message RFC 3414 Section 4. Discovery specifies that a discovery request message has a varBindList left empty. Nonetheless, bsnmpd(1) should not crash when receiving a non-zero var-bindings list in a Discovery Request message. PR: 255214 MFC after: 2 weeks --- contrib/bsnmp/snmpd/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/bsnmp/snmpd/main.c b/contrib/bsnmp/snmpd/main.c index b07308165ddd..928b84121f82 100644 --- a/contrib/bsnmp/snmpd/main.c +++ b/contrib/bsnmp/snmpd/main.c @@ -641,7 +641,7 @@ decoded: pdu->engine.engine_boots = snmpd_engine.engine_boots; pdu->engine.engine_time = snmpd_engine.engine_time; } - } else if (usm_user->suser.auth_proto != SNMP_AUTH_NOAUTH && + } else if (pdu->user.auth_proto != SNMP_AUTH_NOAUTH && (pdu->engine.engine_boots == 0 || pdu->engine.engine_time == 0)) { snmpd_usmstats.not_in_time_windows++; ret = SNMPD_INPUT_FAILED; From owner-dev-commits-src-main@freebsd.org Fri Oct 1 12:19:55 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 22A936AE1AB; Fri, 1 Oct 2021 12:19:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HLThC0Tbpz3r6w; Fri, 1 Oct 2021 12:19:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E4BDA1F04A; Fri, 1 Oct 2021 12:19:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 191CJsmv030337; Fri, 1 Oct 2021 12:19:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 191CJs5c030336; Fri, 1 Oct 2021 12:19:54 GMT (envelope-from git) Date: Fri, 1 Oct 2021 12:19:54 GMT Message-Id: <202110011219.191CJs5c030336@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Hans Petter Selasky Subject: git: 38c857d956d6 - main - mixer(3): Add symbol versioning. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: hselasky X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 38c857d956d61b811fb2047bc980b90d64a072bf Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Oct 2021 12:19:55 -0000 The branch main has been updated by hselasky: URL: https://cgit.FreeBSD.org/src/commit/?id=38c857d956d61b811fb2047bc980b90d64a072bf commit 38c857d956d61b811fb2047bc980b90d64a072bf Author: Hans Petter Selasky AuthorDate: 2021-10-01 12:14:38 +0000 Commit: Hans Petter Selasky CommitDate: 2021-10-01 12:18:43 +0000 mixer(3): Add symbol versioning. Suggested by: kib Differential Revision: https://reviews.freebsd.org/D32254 Sponsored by: NVIDIA Networking --- lib/libmixer/Makefile | 2 ++ lib/libmixer/Symbol.map | 22 ++++++++++++++++++++++ 2 files changed, 24 insertions(+) diff --git a/lib/libmixer/Makefile b/lib/libmixer/Makefile index 12081ee3835b..d7e77f79856e 100644 --- a/lib/libmixer/Makefile +++ b/lib/libmixer/Makefile @@ -4,5 +4,7 @@ LIB= mixer SRCS= ${LIB}.c INCS= ${LIB}.h MAN= ${LIB}.3 +VERSION_DEF= ${LIBCSRCDIR}/Versions.def +SYMBOL_MAPS= ${.CURDIR}/Symbol.map .include diff --git a/lib/libmixer/Symbol.map b/lib/libmixer/Symbol.map new file mode 100644 index 000000000000..6736debe1897 --- /dev/null +++ b/lib/libmixer/Symbol.map @@ -0,0 +1,22 @@ +/* + * $FreeBSD$ + */ + +FBSD_1.7 { + mixer_open; + mixer_close; + mixer_get_dev; + mixer_get_dev_byname; + mixer_add_ctl; + mixer_add_ctl_s; + mixer_remove_ctl; + mixer_get_ctl; + mixer_get_ctl_byname; + mixer_set_vol; + mixer_set_mute; + mixer_mod_recsrc; + mixer_get_default_unit; + mixer_set_default_unit; + mixer_get_mode; + mixer_get_nmixers; +}; From owner-dev-commits-src-main@freebsd.org Fri Oct 1 12:19:56 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4AFA96AE0A2; Fri, 1 Oct 2021 12:19:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HLThD1hNPz3rGY; Fri, 1 Oct 2021 12:19:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1A0661F432; Fri, 1 Oct 2021 12:19:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 191CJtMv030361; Fri, 1 Oct 2021 12:19:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 191CJtEW030360; Fri, 1 Oct 2021 12:19:55 GMT (envelope-from git) Date: Fri, 1 Oct 2021 12:19:55 GMT Message-Id: <202110011219.191CJtEW030360@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Hans Petter Selasky Subject: git: 433be7f21fd1 - main - mixer(3): Add some manual page symlinks. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: hselasky X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 433be7f21fd1606479779125f5b22ba387ff7157 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Oct 2021 12:19:56 -0000 The branch main has been updated by hselasky: URL: https://cgit.FreeBSD.org/src/commit/?id=433be7f21fd1606479779125f5b22ba387ff7157 commit 433be7f21fd1606479779125f5b22ba387ff7157 Author: Hans Petter Selasky AuthorDate: 2021-10-01 12:17:20 +0000 Commit: Hans Petter Selasky CommitDate: 2021-10-01 12:18:43 +0000 mixer(3): Add some manual page symlinks. Submitted by: christos@ Differential Revision: https://reviews.freebsd.org/D32254 Sponsored by: NVIDIA Networking --- lib/libmixer/Makefile | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/lib/libmixer/Makefile b/lib/libmixer/Makefile index d7e77f79856e..ff7dbbe3cae1 100644 --- a/lib/libmixer/Makefile +++ b/lib/libmixer/Makefile @@ -7,4 +7,27 @@ MAN= ${LIB}.3 VERSION_DEF= ${LIBCSRCDIR}/Versions.def SYMBOL_MAPS= ${.CURDIR}/Symbol.map +MLINKS+= mixer.3 mixer_open.3 +MLINKS+= mixer.3 mixer_close.3 +MLINKS+= mixer.3 mixer_get_dev.3 +MLINKS+= mixer.3 mixer_get_dev_byname.3 +MLINKS+= mixer.3 mixer_add_ctl.3 +MLINKS+= mixer.3 mixer_add_ctl_s.3 +MLINKS+= mixer.3 mixer_remove_ctl.3 +MLINKS+= mixer.3 mixer_get_ctl.3 +MLINKS+= mixer.3 mixer_get_ctl_byname.3 +MLINKS+= mixer.3 mixer_set_vol.3 +MLINKS+= mixer.3 mixer_set_mute.3 +MLINKS+= mixer.3 mixer_mod_recsrc.3 +MLINKS+= mixer.3 mixer_get_default_unit.3 +MLINKS+= mixer.3 mixer_set_default_unit.3 +MLINKS+= mixer.3 mixer_get_mode.3 +MLINKS+= mixer.3 mixer_get_nmixers.3 +MLINKS+= mixer.3 MIX_ISDEV.3 +MLINKS+= mixer.3 MIX_ISMUTE.3 +MLINKS+= mixer.3 MIX_ISREC.3 +MLINKS+= mixer.3 MIX_ISRECSRC.3 +MLINKS+= mixer.3 MIX_VOLNORM.3 +MLINKS+= mixer.3 MIX_VOLDENORM.3 + .include From owner-dev-commits-src-main@freebsd.org Fri Oct 1 14:35:29 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 270CB6B098F; Fri, 1 Oct 2021 14:35:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HLXhd0ct0z4WPh; Fri, 1 Oct 2021 14:35:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E8554210FA; Fri, 1 Oct 2021 14:35:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 191EZS15017154; Fri, 1 Oct 2021 14:35:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 191EZSbn017153; Fri, 1 Oct 2021 14:35:28 GMT (envelope-from git) Date: Fri, 1 Oct 2021 14:35:28 GMT Message-Id: <202110011435.191EZSbn017153@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Hans Petter Selasky Subject: git: 5b40c0aa73c5 - main - mixer(3): Fix buildworld after 38c857d956d61b811fb2047bc980b90d64a072bf . MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: hselasky X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5b40c0aa73c57e51f07386835237debdea805418 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Oct 2021 14:35:29 -0000 The branch main has been updated by hselasky: URL: https://cgit.FreeBSD.org/src/commit/?id=5b40c0aa73c57e51f07386835237debdea805418 commit 5b40c0aa73c57e51f07386835237debdea805418 Author: Hans Petter Selasky AuthorDate: 2021-10-01 14:34:03 +0000 Commit: Hans Petter Selasky CommitDate: 2021-10-01 14:34:10 +0000 mixer(3): Fix buildworld after 38c857d956d61b811fb2047bc980b90d64a072bf . s/default_unit/dunit/g Differential Revision: https://reviews.freebsd.org/D32254 Sponsored by: NVIDIA Networking --- lib/libmixer/Makefile | 4 ++-- lib/libmixer/Symbol.map | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/libmixer/Makefile b/lib/libmixer/Makefile index ff7dbbe3cae1..7a2b5f754e5f 100644 --- a/lib/libmixer/Makefile +++ b/lib/libmixer/Makefile @@ -19,8 +19,8 @@ MLINKS+= mixer.3 mixer_get_ctl_byname.3 MLINKS+= mixer.3 mixer_set_vol.3 MLINKS+= mixer.3 mixer_set_mute.3 MLINKS+= mixer.3 mixer_mod_recsrc.3 -MLINKS+= mixer.3 mixer_get_default_unit.3 -MLINKS+= mixer.3 mixer_set_default_unit.3 +MLINKS+= mixer.3 mixer_get_dunit.3 +MLINKS+= mixer.3 mixer_set_dunit.3 MLINKS+= mixer.3 mixer_get_mode.3 MLINKS+= mixer.3 mixer_get_nmixers.3 MLINKS+= mixer.3 MIX_ISDEV.3 diff --git a/lib/libmixer/Symbol.map b/lib/libmixer/Symbol.map index 6736debe1897..cee4e3bdbc18 100644 --- a/lib/libmixer/Symbol.map +++ b/lib/libmixer/Symbol.map @@ -15,8 +15,8 @@ FBSD_1.7 { mixer_set_vol; mixer_set_mute; mixer_mod_recsrc; - mixer_get_default_unit; - mixer_set_default_unit; + mixer_get_dunit; + mixer_set_dunit; mixer_get_mode; mixer_get_nmixers; }; From owner-dev-commits-src-main@freebsd.org Fri Oct 1 14:36:39 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3A79D6B0A10; Fri, 1 Oct 2021 14:36:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HLXjz1CQgz4WQB; Fri, 1 Oct 2021 14:36:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 09F4921268; Fri, 1 Oct 2021 14:36:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 191Eacwa017420; Fri, 1 Oct 2021 14:36:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 191Eackp017419; Fri, 1 Oct 2021 14:36:38 GMT (envelope-from git) Date: Fri, 1 Oct 2021 14:36:38 GMT Message-Id: <202110011436.191Eackp017419@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Randall Stewart Subject: git: a36230f75e0a - main - tcp: Make dsack stats available in netstat and also make sure its aware of TLP's. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rrs X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a36230f75e0ae5090e4ef47393536255b436cca6 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Oct 2021 14:36:39 -0000 The branch main has been updated by rrs: URL: https://cgit.FreeBSD.org/src/commit/?id=a36230f75e0ae5090e4ef47393536255b436cca6 commit a36230f75e0ae5090e4ef47393536255b436cca6 Author: Randall Stewart AuthorDate: 2021-10-01 14:32:30 +0000 Commit: Randall Stewart CommitDate: 2021-10-01 14:36:27 +0000 tcp: Make dsack stats available in netstat and also make sure its aware of TLP's. DSACK accounting has been for quite some time under a NETFLIX_STATS ifdef. Statistics on DSACKs however are very useful in figuring out how much bad retransmissions you are doing. This is further complicated, however, by stacks that do TLP. A TLP when discovering a lost ack in the reverse path will cause the generation of a DSACK. For this situation we introduce a new dsack-tlp-bytes as well as the more traditional dsack-bytes and dsack-packets. These will now all display in netstat -p tcp -s. This also updates all stacks that are currently built to keep track of these stats. Reviewed by: tuexen Sponsored by: Netflix Inc. Differential Revision: https://reviews.freebsd.org/D32158 --- sys/netinet/tcp_sack.c | 6 ++++++ sys/netinet/tcp_stacks/bbr.c | 4 +--- sys/netinet/tcp_stacks/rack.c | 14 +++++++++----- sys/netinet/tcp_subr.c | 27 +++++++++++++++++++++++++++ sys/netinet/tcp_var.h | 16 ++++++++++++++-- usr.bin/netstat/inet.c | 6 ++++++ 6 files changed, 63 insertions(+), 10 deletions(-) diff --git a/sys/netinet/tcp_sack.c b/sys/netinet/tcp_sack.c index 9753536926d5..25eb633fbbd4 100644 --- a/sys/netinet/tcp_sack.c +++ b/sys/netinet/tcp_sack.c @@ -604,6 +604,12 @@ tcp_sack_doack(struct tcpcb *tp, struct tcpopt *to, tcp_seq th_ack) SEQ_GT(sack.end, tp->snd_una) && SEQ_LEQ(sack.end, tp->snd_max)) { sack_blocks[num_sack_blks++] = sack; + } else if (SEQ_LEQ(sack.start, th_ack) && + SEQ_LEQ(sack.end, th_ack)) { + /* + * Its a D-SACK block. + */ + tcp_record_dsack(tp, sack.start, sack.end, 0); } } } diff --git a/sys/netinet/tcp_stacks/bbr.c b/sys/netinet/tcp_stacks/bbr.c index c96fec07b6c9..3c4cf0f54d97 100644 --- a/sys/netinet/tcp_stacks/bbr.c +++ b/sys/netinet/tcp_stacks/bbr.c @@ -7593,14 +7593,12 @@ proc_sack: } sack_blocks[num_sack_blks] = sack; num_sack_blks++; -#ifdef NETFLIX_STATS } else if (SEQ_LEQ(sack.start, th_ack) && SEQ_LEQ(sack.end, th_ack)) { /* * Its a D-SACK block. */ - tcp_record_dsack(sack.start, sack.end); -#endif + tcp_record_dsack(tp, sack.start, sack.end, 0); } } if (num_sack_blks == 0) diff --git a/sys/netinet/tcp_stacks/rack.c b/sys/netinet/tcp_stacks/rack.c index 2369a1c368bf..00f830caf217 100644 --- a/sys/netinet/tcp_stacks/rack.c +++ b/sys/netinet/tcp_stacks/rack.c @@ -9402,11 +9402,12 @@ rack_do_detection(struct tcpcb *tp, struct tcp_rack *rack, uint32_t bytes_this_ } #endif -static void +static int rack_note_dsack(struct tcp_rack *rack, tcp_seq start, tcp_seq end) { uint32_t am, l_end; + int was_tlp = 0; if (SEQ_GT(end, start)) am = end - start; @@ -9422,6 +9423,7 @@ rack_note_dsack(struct tcp_rack *rack, tcp_seq start, tcp_seq end) * our previous retransmit TLP. */ rack_log_dsack_event(rack, 7, __LINE__, start, end); + was_tlp = 1; goto skip_dsack_round; } if (rack->rc_last_sent_tlp_seq_valid) { @@ -9433,6 +9435,7 @@ rack_note_dsack(struct tcp_rack *rack, tcp_seq start, tcp_seq end) * for reordering purposes. */ rack_log_dsack_event(rack, 7, __LINE__, start, end); + was_tlp = 1; goto skip_dsack_round; } } @@ -9462,6 +9465,7 @@ skip_dsack_round: rack->r_ctl.retran_during_recovery = 0; rack->r_ctl.dsack_byte_cnt = 0; } + return (was_tlp); } static void @@ -9614,13 +9618,13 @@ rack_log_ack(struct tcpcb *tp, struct tcpopt *to, struct tcphdr *th, int entered num_sack_blks++; } else if (SEQ_LEQ(sack.start, th_ack) && SEQ_LEQ(sack.end, th_ack)) { -#ifdef NETFLIX_STATS + int was_tlp; + + was_tlp = rack_note_dsack(rack, sack.start, sack.end); /* * Its a D-SACK block. */ - tcp_record_dsack(sack.start, sack.end); -#endif - rack_note_dsack(rack, sack.start, sack.end); + tcp_record_dsack(tp, sack.start, sack.end, was_tlp); } } if (rack->rc_dsack_round_seen) { diff --git a/sys/netinet/tcp_subr.c b/sys/netinet/tcp_subr.c index 697ae7d3270b..9d66086a383b 100644 --- a/sys/netinet/tcp_subr.c +++ b/sys/netinet/tcp_subr.c @@ -390,6 +390,30 @@ static int tcp_fb_cnt = 0; struct tcp_funchead t_functions; static struct tcp_function_block *tcp_func_set_ptr = &tcp_def_funcblk; +void +tcp_record_dsack(struct tcpcb *tp, tcp_seq start, tcp_seq end, int tlp) +{ + TCPSTAT_INC(tcps_dsack_count); + tp->t_dsack_pack++; + if (tlp == 0) { + if (SEQ_GT(end, start)) { + tp->t_dsack_bytes += (end - start); + TCPSTAT_ADD(tcps_dsack_bytes, (end - start)); + } else { + tp->t_dsack_tlp_bytes += (start - end); + TCPSTAT_ADD(tcps_dsack_bytes, (start - end)); + } + } else { + if (SEQ_GT(end, start)) { + tp->t_dsack_bytes += (end - start); + TCPSTAT_ADD(tcps_dsack_tlp_bytes, (end - start)); + } else { + tp->t_dsack_tlp_bytes += (start - end); + TCPSTAT_ADD(tcps_dsack_tlp_bytes, (start - end)); + } + } +} + static struct tcp_function_block * find_tcp_functions_locked(struct tcp_function_set *fs) { @@ -4003,6 +4027,9 @@ tcp_inptoxtp(const struct inpcb *inp, struct xtcpcb *xt) xt->t_snd_wnd = tp->snd_wnd; xt->t_snd_cwnd = tp->snd_cwnd; xt->t_snd_ssthresh = tp->snd_ssthresh; + xt->t_dsack_bytes = tp->t_dsack_bytes; + xt->t_dsack_tlp_bytes = tp->t_dsack_tlp_bytes; + xt->t_dsack_pack = tp->t_dsack_pack; xt->t_maxseg = tp->t_maxseg; xt->xt_ecn = (tp->t_flags2 & TF2_ECN_PERMIT) ? 1 : 0 + (tp->t_flags2 & TF2_ACE_PERMIT) ? 2 : 0; diff --git a/sys/netinet/tcp_var.h b/sys/netinet/tcp_var.h index c26f503f4a1d..d5b2963ef4dc 100644 --- a/sys/netinet/tcp_var.h +++ b/sys/netinet/tcp_var.h @@ -265,6 +265,9 @@ struct tcpcb { uint64_t t_sndtlpbyte; /* total tail loss probe bytes sent */ uint64_t t_sndbytes; /* total bytes sent */ uint64_t t_snd_rxt_bytes; /* total bytes retransmitted */ + uint32_t t_dsack_bytes; /* Total number of dsack bytes we have received */ + uint32_t t_dsack_tlp_bytes; /* Total number of dsack bytes we have received for TLPs sent */ + uint32_t t_dsack_pack; /* Total dsack packets we have recieved */ uint8_t t_tfo_client_cookie_len; /* TCP Fast Open client cookie length */ uint32_t t_end_info_status; /* Status flag of end info */ @@ -703,7 +706,12 @@ struct tcpstat { uint64_t tcps_tunneled_pkts; /* Packets encap's in UDP received */ uint64_t tcps_tunneled_errs; /* Packets that had errors that were UDP encaped */ - uint64_t _pad[9]; /* 6 UTO, 3 TBD */ + /* Dsack related stats */ + uint64_t tcps_dsack_count; /* Number of ACKs arriving with DSACKs */ + uint64_t tcps_dsack_bytes; /* Number of bytes DSACK'ed no TLP */ + uint64_t tcps_dsack_tlp_bytes; /* Number of bytes DSACK'ed due to TLPs */ + + uint64_t _pad[6]; /* 3 UTO, 3 TBD */ }; #define tcps_rcvmemdrop tcps_rcvreassfull /* compat */ @@ -801,9 +809,12 @@ struct xtcpcb { uint32_t t_rcv_wnd; /* (s) */ uint32_t t_snd_wnd; /* (s) */ uint32_t xt_ecn; /* (s) */ + uint32_t t_dsack_bytes; /* (n) */ + uint32_t t_dsack_tlp_bytes; /* (n) */ + uint32_t t_dsack_pack; /* (n) */ uint16_t xt_encaps_port; /* (s) */ int16_t spare16; - int32_t spare32[25]; + int32_t spare32[22]; } __aligned(8); #ifdef _KERNEL @@ -1064,6 +1075,7 @@ int tcp_twcheck(struct inpcb *, struct tcpopt *, struct tcphdr *, struct mbuf *, int); void tcp_setpersist(struct tcpcb *); void tcp_slowtimo(void); +void tcp_record_dsack(struct tcpcb *tp, tcp_seq start, tcp_seq end, int tlp); struct tcptemp * tcpip_maketemplate(struct inpcb *); void tcpip_fillheaders(struct inpcb *, uint16_t, void *, void *); diff --git a/usr.bin/netstat/inet.c b/usr.bin/netstat/inet.c index 45c5f05e60b8..2d3a4bb10d52 100644 --- a/usr.bin/netstat/inet.c +++ b/usr.bin/netstat/inet.c @@ -695,6 +695,12 @@ tcp_stats(u_long off, const char *name, int af1 __unused, int proto __unused) "{N:/window probe%s}\n"); p(tcps_rcvwinupd, "\t\t{:receive-window-update-packets/%ju} " "{N:/window update packet%s}\n"); + p(tcps_dsack_count, "\t\t{:received-with-dsack-packets/%ju} " + "{N:/packet%s received with dsack}\n"); + p(tcps_dsack_bytes, "\t\t{:received-with-dsack-bytes/%ju} " + "{N:/dsack byte%s received (no TLP involved)}\n"); + p(tcps_dsack_tlp_bytes, "\t\t{:received-with-dsack-bytes-tlp/%ju} " + "{N:/dsack byte%s received (TLP responsible)}\n"); p(tcps_rcvafterclose, "\t\t{:received-after-close-packets/%ju} " "{N:/packet%s received after close}\n"); p(tcps_rcvbadsum, "\t\t{:discard-bad-checksum/%ju} " From owner-dev-commits-src-main@freebsd.org Fri Oct 1 16:43:09 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5C2C46B2363; Fri, 1 Oct 2021 16:43:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HLbWx27hLz4jJ6; Fri, 1 Oct 2021 16:43:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 29D6722F1A; Fri, 1 Oct 2021 16:43:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 191Gh91q089804; Fri, 1 Oct 2021 16:43:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 191Gh9RT089803; Fri, 1 Oct 2021 16:43:09 GMT (envelope-from git) Date: Fri, 1 Oct 2021 16:43:09 GMT Message-Id: <202110011643.191Gh9RT089803@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Eric van Gyzen Subject: git: 31466594cd09 - main - sem_clockwait_np test: relax time constraint on VMs MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: vangyzen X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 31466594cd09d1413dbd8cab516fafc3557c2200 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Oct 2021 16:43:09 -0000 The branch main has been updated by vangyzen: URL: https://cgit.FreeBSD.org/src/commit/?id=31466594cd09d1413dbd8cab516fafc3557c2200 commit 31466594cd09d1413dbd8cab516fafc3557c2200 Author: Eric van Gyzen AuthorDate: 2021-10-01 10:37:17 +0000 Commit: Eric van Gyzen CommitDate: 2021-10-01 11:39:30 +0000 sem_clockwait_np test: relax time constraint on VMs In a guest on a busy hypervisor, the time remaining after an interrupted sleep could be much lower than other environments. Relax the lower bound on VMs. MFC after: 1 week Sponsored by: Dell EMC Isilon --- contrib/netbsd-tests/lib/librt/t_sem.c | 31 +++++++++++++++++++++++++------ 1 file changed, 25 insertions(+), 6 deletions(-) diff --git a/contrib/netbsd-tests/lib/librt/t_sem.c b/contrib/netbsd-tests/lib/librt/t_sem.c index 5e059238f278..55a416083846 100644 --- a/contrib/netbsd-tests/lib/librt/t_sem.c +++ b/contrib/netbsd-tests/lib/librt/t_sem.c @@ -60,6 +60,11 @@ __COPYRIGHT("@(#) Copyright (c) 2008, 2010\ The NetBSD Foundation, inc. All rights reserved."); __RCSID("$NetBSD: t_sem.c,v 1.3 2017/01/14 20:58:20 christos Exp $"); +#ifdef __FreeBSD__ +#include +#include +#endif + #include #include @@ -78,6 +83,24 @@ __RCSID("$NetBSD: t_sem.c,v 1.3 2017/01/14 20:58:20 christos Exp $"); #define SEM_REQUIRE(x) \ ATF_REQUIRE_EQ_MSG(x, 0, "%s", strerror(errno)) +#ifdef __FreeBSD__ +static bool +machine_is_virtual(void) +{ + char vm_guest[32]; + int error; + + error = sysctlbyname("kern.vm_guest", vm_guest, + &(size_t){sizeof(vm_guest)}, NULL, 0); + ATF_CHECK_EQ_MSG(0, error, "sysctlbyname(kern.vm_guest): %s", + strerror(errno)); + if (error != 0) { + return (false); + } + return (strcmp(vm_guest, "none") != 0); +} +#endif + ATF_TC_WITH_CLEANUP(basic); ATF_TC_HEAD(basic, tc) { @@ -306,15 +329,11 @@ ATF_TC_BODY(timedwait, tc) ATF_REQUIRE_ERRNO(EINTR, sem_clockwait_np(&sem, CLOCK_MONOTONIC, 0, &ts, &remain)); ATF_REQUIRE_MSG(got_sigalrm, "did not get SIGALRM"); - /* - * If this nsec comparison turns out to be unreliable due to timing, - * it could simply check that nsec < 100 ms. - */ ATF_REQUIRE_MSG(remain.tv_sec == 0 && - remain.tv_nsec >= 25*1000*1000 && + (remain.tv_nsec >= 25*1000*1000 || machine_is_virtual()) && remain.tv_nsec <= 75*1000*1000, "the remaining time was not as expected when a relative clockwait" - " got EINTR" ); + " got EINTR: %ld.%09ld", remain.tv_sec, remain.tv_nsec); #endif } From owner-dev-commits-src-main@freebsd.org Fri Oct 1 16:43:10 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 87C2D6B25A5; Fri, 1 Oct 2021 16:43:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HLbWy2sJhz4jRt; Fri, 1 Oct 2021 16:43:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4104123004; Fri, 1 Oct 2021 16:43:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 191GhAEn089834; Fri, 1 Oct 2021 16:43:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 191GhAdh089833; Fri, 1 Oct 2021 16:43:10 GMT (envelope-from git) Date: Fri, 1 Oct 2021 16:43:10 GMT Message-Id: <202110011643.191GhAdh089833@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Eric van Gyzen Subject: git: 2334abfd01ba - main - sem test: move sem_clockwait_np tests into individual cases MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: vangyzen X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2334abfd01ba92dfa6a7ab6f2c4cc45fa64ffd3c Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Oct 2021 16:43:10 -0000 The branch main has been updated by vangyzen: URL: https://cgit.FreeBSD.org/src/commit/?id=2334abfd01ba92dfa6a7ab6f2c4cc45fa64ffd3c commit 2334abfd01ba92dfa6a7ab6f2c4cc45fa64ffd3c Author: Eric van Gyzen AuthorDate: 2021-10-01 11:24:27 +0000 Commit: Eric van Gyzen CommitDate: 2021-10-01 11:39:34 +0000 sem test: move sem_clockwait_np tests into individual cases Move these tests into individual test cases for all the usual reasons. No functional change intended. MFC after: 1 week Sponsored by: Dell EMC Isilon --- contrib/netbsd-tests/lib/librt/t_sem.c | 126 ++++++++++++++++++++++++++------- 1 file changed, 102 insertions(+), 24 deletions(-) diff --git a/contrib/netbsd-tests/lib/librt/t_sem.c b/contrib/netbsd-tests/lib/librt/t_sem.c index 55a416083846..3156b11e9bf3 100644 --- a/contrib/netbsd-tests/lib/librt/t_sem.c +++ b/contrib/netbsd-tests/lib/librt/t_sem.c @@ -221,14 +221,27 @@ sigalrm_handler(int sig __unused) got_sigalrm = 1; } +#ifdef __FreeBSD__ +/* This is refactored from the timedwait test case. */ +static void +setup_signals(void) +{ + struct sigaction act = { + .sa_handler = sigalrm_handler, + .sa_flags = 0 /* not SA_RESTART */ + }; + + ATF_REQUIRE_MSG(sigemptyset(&act.sa_mask) == 0, + "%s", strerror(errno)); + ATF_REQUIRE_MSG(sigaction(SIGALRM, &act, NULL) == 0, + "%s", strerror(errno)); +} +#endif + ATF_TC(timedwait); ATF_TC_HEAD(timedwait, tc) { - atf_tc_set_md_var(tc, "descr", "Tests sem_timedwait(3)" -#ifdef __FreeBSD__ - " and sem_clockwait_np(3)" -#endif - ); + atf_tc_set_md_var(tc, "descr", "Tests sem_timedwait(3)"); atf_tc_set_md_var(tc, "timeout", "20"); } ATF_TC_BODY(timedwait, tc) @@ -263,14 +276,10 @@ ATF_TC_BODY(timedwait, tc) ATF_REQUIRE_ERRNO(EINVAL, sem_timedwait(&sem, &ts)); /* EINTR */ - struct sigaction act = { - .sa_handler = sigalrm_handler, - .sa_flags = 0 /* not SA_RESTART */ - }; - ATF_REQUIRE_MSG(sigemptyset(&act.sa_mask) == 0, - "%s", strerror(errno)); - ATF_REQUIRE_MSG(sigaction(SIGALRM, &act, NULL) == 0, - "%s", strerror(errno)); +#ifdef __FreeBSD__ + /* This is refactored into a function. */ + setup_signals(); +#endif struct itimerval it = { .it_value.tv_usec = 50*1000 }; @@ -281,9 +290,24 @@ ATF_TC_BODY(timedwait, tc) timespec_add_ms(&ts, 100); ATF_REQUIRE_ERRNO(EINTR, sem_timedwait(&sem, &ts)); ATF_REQUIRE_MSG(got_sigalrm, "did not get SIGALRM"); +} #ifdef __FreeBSD__ - /* CLOCK_MONOTONIC, absolute */ + +ATF_TC(clockwait_monotonic_absolute); +ATF_TC_HEAD(clockwait_monotonic_absolute, tc) +{ + atf_tc_set_md_var(tc, "descr", + "sem_clockwait_np(3) with monotonic clock and absolute time"); + atf_tc_set_md_var(tc, "timeout", "20"); +} +ATF_TC_BODY(clockwait_monotonic_absolute, tc) +{ + struct timespec ts; + sem_t sem; + + SEM_REQUIRE(sem_init(&sem, 0, 0)); + SEM_REQUIRE(sem_post(&sem)); ATF_REQUIRE_MSG(clock_gettime(CLOCK_MONOTONIC, &ts) == 0, "%s", strerror(errno)); @@ -292,8 +316,22 @@ ATF_TC_BODY(timedwait, tc) &ts, NULL)); ATF_REQUIRE_ERRNO(ETIMEDOUT, sem_clockwait_np(&sem, CLOCK_MONOTONIC, TIMER_ABSTIME, &ts, NULL)); +} + +ATF_TC(clockwait_monotonic_relative); +ATF_TC_HEAD(clockwait_monotonic_relative, tc) +{ + atf_tc_set_md_var(tc, "descr", + "sem_clockwait_np(3) with monotonic clock and relative time"); + atf_tc_set_md_var(tc, "timeout", "20"); +} +ATF_TC_BODY(clockwait_monotonic_relative, tc) +{ + struct timespec ts; + sem_t sem; + + SEM_REQUIRE(sem_init(&sem, 0, 0)); - /* CLOCK_MONOTONIC, relative */ SEM_REQUIRE(sem_post(&sem)); ts.tv_sec = 0; ts.tv_nsec = 100*1000*1000; @@ -301,11 +339,28 @@ ATF_TC_BODY(timedwait, tc) &ts, NULL)); ATF_REQUIRE_ERRNO(ETIMEDOUT, sem_clockwait_np(&sem, CLOCK_MONOTONIC, 0, &ts, NULL)); +} + +ATF_TC(clockwait_absolute_intr_remaining); +ATF_TC_HEAD(clockwait_absolute_intr_remaining, tc) +{ + atf_tc_set_md_var(tc, "descr", + "sem_clockwait_np(3) with absolute time does not update " + "remaining time on EINTR"); + atf_tc_set_md_var(tc, "timeout", "20"); +} +ATF_TC_BODY(clockwait_absolute_intr_remaining, tc) +{ + struct timespec ts; + sem_t sem; + + SEM_REQUIRE(sem_init(&sem, 0, 0)); + setup_signals(); - /* absolute does not update remaining time on EINTR */ struct timespec remain = {42, 1000*1000*1000}; - got_sigalrm = 0; - it.it_value.tv_usec = 50*1000; + struct itimerval it = { + .it_value.tv_usec = 50*1000 + }; ATF_REQUIRE_MSG(setitimer(ITIMER_REAL, &it, NULL) == 0, "%s", strerror(errno)); ATF_REQUIRE_MSG(clock_gettime(CLOCK_MONOTONIC, &ts) == 0, @@ -316,12 +371,28 @@ ATF_TC_BODY(timedwait, tc) ATF_REQUIRE_MSG(got_sigalrm, "did not get SIGALRM"); ATF_REQUIRE_MSG(remain.tv_sec == 42 && remain.tv_nsec == 1000*1000*1000, "an absolute clockwait modified the remaining time on EINTR"); +} + +ATF_TC(clockwait_relative_intr_remaining); +ATF_TC_HEAD(clockwait_relative_intr_remaining, tc) +{ + atf_tc_set_md_var(tc, "descr", + "sem_clockwait_np(3) with relative time updates " + "remaining time on EINTR"); + atf_tc_set_md_var(tc, "timeout", "20"); +} +ATF_TC_BODY(clockwait_relative_intr_remaining, tc) +{ + struct timespec ts; + sem_t sem; - /* relative updates remaining time on EINTR */ - remain.tv_sec = 42; - remain.tv_nsec = 1000*1000*1000; - got_sigalrm = 0; - it.it_value.tv_usec = 50*1000; + SEM_REQUIRE(sem_init(&sem, 0, 0)); + setup_signals(); + + struct timespec remain = {42, 1000*1000*1000}; + struct itimerval it = { + .it_value.tv_usec = 50*1000 + }; ATF_REQUIRE_MSG(setitimer(ITIMER_REAL, &it, NULL) == 0, "%s", strerror(errno)); ts.tv_sec = 0; @@ -334,15 +405,22 @@ ATF_TC_BODY(timedwait, tc) remain.tv_nsec <= 75*1000*1000, "the remaining time was not as expected when a relative clockwait" " got EINTR: %ld.%09ld", remain.tv_sec, remain.tv_nsec); -#endif } +#endif /* __FreeBSD__ */ + ATF_TP_ADD_TCS(tp) { ATF_TP_ADD_TC(tp, basic); ATF_TP_ADD_TC(tp, child); ATF_TP_ADD_TC(tp, timedwait); +#ifdef __FreeBSD__ + ATF_TP_ADD_TC(tp, clockwait_monotonic_absolute); + ATF_TP_ADD_TC(tp, clockwait_monotonic_relative); + ATF_TP_ADD_TC(tp, clockwait_absolute_intr_remaining); + ATF_TP_ADD_TC(tp, clockwait_relative_intr_remaining); +#endif return atf_no_error(); } From owner-dev-commits-src-main@freebsd.org Fri Oct 1 16:43:11 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BC9586B236C; Fri, 1 Oct 2021 16:43:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HLbWz4HjFz4jXJ; Fri, 1 Oct 2021 16:43:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6723422F8E; Fri, 1 Oct 2021 16:43:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 191GhB0X089859; Fri, 1 Oct 2021 16:43:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 191GhBEb089858; Fri, 1 Oct 2021 16:43:11 GMT (envelope-from git) Date: Fri, 1 Oct 2021 16:43:11 GMT Message-Id: <202110011643.191GhBEb089858@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Eric van Gyzen Subject: git: 35e4527e88d3 - main - sem_clockwait_np test: fix usage of ATF API MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: vangyzen X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 35e4527e88d3843cccf2f15a32b1fa041a01d693 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Oct 2021 16:43:11 -0000 The branch main has been updated by vangyzen: URL: https://cgit.FreeBSD.org/src/commit/?id=35e4527e88d3843cccf2f15a32b1fa041a01d693 commit 35e4527e88d3843cccf2f15a32b1fa041a01d693 Author: Eric van Gyzen AuthorDate: 2021-10-01 11:25:48 +0000 Commit: Eric van Gyzen CommitDate: 2021-10-01 11:39:34 +0000 sem_clockwait_np test: fix usage of ATF API ATF_REQUIRE_ERRNO requires the given errno iff the given expression is true. These test cases used it incorrectly, potentially allowing sem_clockwait_np to succeed when it was expected to fail. Use separate ATF calls to require failure and the expected errno. MFC after: 1 week Sponsored by: Dell EMC Isilon --- contrib/netbsd-tests/lib/librt/t_sem.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/contrib/netbsd-tests/lib/librt/t_sem.c b/contrib/netbsd-tests/lib/librt/t_sem.c index 3156b11e9bf3..1c4290c0b3fb 100644 --- a/contrib/netbsd-tests/lib/librt/t_sem.c +++ b/contrib/netbsd-tests/lib/librt/t_sem.c @@ -366,8 +366,9 @@ ATF_TC_BODY(clockwait_absolute_intr_remaining, tc) ATF_REQUIRE_MSG(clock_gettime(CLOCK_MONOTONIC, &ts) == 0, "%s", strerror(errno)); timespec_add_ms(&ts, 100); - ATF_REQUIRE_ERRNO(EINTR, sem_clockwait_np(&sem, CLOCK_MONOTONIC, + ATF_REQUIRE_EQ(-1, sem_clockwait_np(&sem, CLOCK_MONOTONIC, TIMER_ABSTIME, &ts, &remain)); + ATF_REQUIRE_ERRNO(EINTR, 1); ATF_REQUIRE_MSG(got_sigalrm, "did not get SIGALRM"); ATF_REQUIRE_MSG(remain.tv_sec == 42 && remain.tv_nsec == 1000*1000*1000, "an absolute clockwait modified the remaining time on EINTR"); @@ -397,8 +398,9 @@ ATF_TC_BODY(clockwait_relative_intr_remaining, tc) "%s", strerror(errno)); ts.tv_sec = 0; ts.tv_nsec = 100*1000*1000; - ATF_REQUIRE_ERRNO(EINTR, sem_clockwait_np(&sem, CLOCK_MONOTONIC, 0, &ts, + ATF_REQUIRE_EQ(-1, sem_clockwait_np(&sem, CLOCK_MONOTONIC, 0, &ts, &remain)); + ATF_REQUIRE_ERRNO(EINTR, 1); ATF_REQUIRE_MSG(got_sigalrm, "did not get SIGALRM"); ATF_REQUIRE_MSG(remain.tv_sec == 0 && (remain.tv_nsec >= 25*1000*1000 || machine_is_virtual()) && From owner-dev-commits-src-main@freebsd.org Fri Oct 1 16:56:22 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 76B8F6B282A; Fri, 1 Oct 2021 16:56:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HLbqB2cs1z4kF1; Fri, 1 Oct 2021 16:56:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2F268230AD; Fri, 1 Oct 2021 16:56:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 191GuMZj004034; Fri, 1 Oct 2021 16:56:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 191GuMD0004033; Fri, 1 Oct 2021 16:56:22 GMT (envelope-from git) Date: Fri, 1 Oct 2021 16:56:22 GMT Message-Id: <202110011656.191GuMD0004033@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: d5fca1dc1d7d - main - nvme_ctrlr_enable: Remove unnecessary 5ms delays MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d5fca1dc1d7de15695b65374d6457abd29a747ee Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Oct 2021 16:56:22 -0000 The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=d5fca1dc1d7de15695b65374d6457abd29a747ee commit d5fca1dc1d7de15695b65374d6457abd29a747ee Author: Warner Losh AuthorDate: 2021-10-01 16:47:27 +0000 Commit: Warner Losh CommitDate: 2021-10-01 16:56:10 +0000 nvme_ctrlr_enable: Remove unnecessary 5ms delays Remove the 5ms delays after writing the administrative queue registers. These delays are from the very earliest days of the driver (they are in the first commit) and were most likely vestiges of the Chatham NVMe prototype card that was used to create this driver. Many of the workarounds necessary for it aren't necessary for standards compliant cards. The original driver had other areas marked for Chatham, but these were not. They are unneeded. There's three lines of supporting evidence. First, the NVMe standards make no mention of a delay time after these registers are written. Second, the Linux driver doesn't have them, even as an option. Third, all my nvme cards work w/o them. To be safe, add a write barrier between setting up the admin queue and enabling the controller. Sponsored by: Netflix Reviewed by: mav Differential Revision: https://reviews.freebsd.org/D32247 --- sys/dev/nvme/nvme_ctrlr.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/sys/dev/nvme/nvme_ctrlr.c b/sys/dev/nvme/nvme_ctrlr.c index 39cde3f065dd..897d832047ce 100644 --- a/sys/dev/nvme/nvme_ctrlr.c +++ b/sys/dev/nvme/nvme_ctrlr.c @@ -52,6 +52,12 @@ __FBSDID("$FreeBSD$"); static void nvme_ctrlr_construct_and_submit_aer(struct nvme_controller *ctrlr, struct nvme_async_event_request *aer); +static void +nvme_ctrlr_barrier(struct nvme_controller *ctrlr, int flags) +{ + bus_barrier(ctrlr->resource, 0, rman_get_size(ctrlr->resource), flags); +} + static void nvme_ctrlr_devctl_log(struct nvme_controller *ctrlr, const char *type, const char *msg, ...) { @@ -356,9 +362,7 @@ nvme_ctrlr_enable(struct nvme_controller *ctrlr) } nvme_mmio_write_8(ctrlr, asq, ctrlr->adminq.cmd_bus_addr); - DELAY(5000); nvme_mmio_write_8(ctrlr, acq, ctrlr->adminq.cpl_bus_addr); - DELAY(5000); /* acqs and asqs are 0-based. */ qsize = ctrlr->adminq.num_entries - 1; @@ -367,7 +371,6 @@ nvme_ctrlr_enable(struct nvme_controller *ctrlr) aqa = (qsize & NVME_AQA_REG_ACQS_MASK) << NVME_AQA_REG_ACQS_SHIFT; aqa |= (qsize & NVME_AQA_REG_ASQS_MASK) << NVME_AQA_REG_ASQS_SHIFT; nvme_mmio_write_4(ctrlr, aqa, aqa); - DELAY(5000); /* Initialization values for CC */ cc = 0; @@ -381,6 +384,7 @@ nvme_ctrlr_enable(struct nvme_controller *ctrlr) /* This evaluates to 0, which is according to spec. */ cc |= (PAGE_SIZE >> 13) << NVME_CC_REG_MPS_SHIFT; + nvme_ctrlr_barrier(ctrlr, BUS_SPACE_BARRIER_WRITE); nvme_mmio_write_4(ctrlr, cc, cc); return (nvme_ctrlr_wait_for_ready(ctrlr, 1)); From owner-dev-commits-src-main@freebsd.org Fri Oct 1 16:56:23 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 881306B2833; Fri, 1 Oct 2021 16:56:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HLbqC3GfKz4kC6; Fri, 1 Oct 2021 16:56:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 509CA23256; Fri, 1 Oct 2021 16:56:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 191GuNuC004058; Fri, 1 Oct 2021 16:56:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 191GuNM3004057; Fri, 1 Oct 2021 16:56:23 GMT (envelope-from git) Date: Fri, 1 Oct 2021 16:56:23 GMT Message-Id: <202110011656.191GuNM3004057@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 26259f6ab96e - main - nvme: Use MS_2_TICKS rather than rolling our own MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 26259f6ab96e68766556b973d3a4ca0ad125e174 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Oct 2021 16:56:23 -0000 The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=26259f6ab96e68766556b973d3a4ca0ad125e174 commit 26259f6ab96e68766556b973d3a4ca0ad125e174 Author: Warner Losh AuthorDate: 2021-10-01 16:50:04 +0000 Commit: Warner Losh CommitDate: 2021-10-01 16:56:10 +0000 nvme: Use MS_2_TICKS rather than rolling our own Sponsored by: Netflix Reviewed by: mav Differential Revision: https://reviews.freebsd.org/D32246 --- sys/dev/nvme/nvme_ctrlr.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/dev/nvme/nvme_ctrlr.c b/sys/dev/nvme/nvme_ctrlr.c index 897d832047ce..f22e21eaf54a 100644 --- a/sys/dev/nvme/nvme_ctrlr.c +++ b/sys/dev/nvme/nvme_ctrlr.c @@ -262,7 +262,7 @@ nvme_ctrlr_fail_req_task(void *arg, int pending) static int nvme_ctrlr_wait_for_ready(struct nvme_controller *ctrlr, int desired_val) { - int timeout = ticks + (uint64_t)ctrlr->ready_timeout_in_ms * hz / 1000; + int timeout = ticks + MSEC_2_TICKS(ctrlr->ready_timeout_in_ms); uint32_t csts; while (1) { @@ -326,7 +326,7 @@ nvme_ctrlr_disable(struct nvme_controller *ctrlr) * cope with these issues. */ if (ctrlr->quirks & QUIRK_DELAY_B4_CHK_RDY) - pause("nvmeR", B4_CHK_RDY_DELAY_MS * hz / 1000); + pause("nvmeR", MSEC_2_TICKS(B4_CHK_RDY_DELAY_MS)); return (nvme_ctrlr_wait_for_ready(ctrlr, 0)); } From owner-dev-commits-src-main@freebsd.org Fri Oct 1 16:56:25 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DABB36B298D; Fri, 1 Oct 2021 16:56:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HLbqF5W69z4k2k; Fri, 1 Oct 2021 16:56:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9E92122ECA; Fri, 1 Oct 2021 16:56:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 191GuPKE004106; Fri, 1 Oct 2021 16:56:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 191GuPrA004105; Fri, 1 Oct 2021 16:56:25 GMT (envelope-from git) Date: Fri, 1 Oct 2021 16:56:25 GMT Message-Id: <202110011656.191GuPrA004105@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 77054a897f64 - main - nvme: Explain a workaround a little better MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 77054a897f6440632267e75ebe31793c7555b79e Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Oct 2021 16:56:26 -0000 The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=77054a897f6440632267e75ebe31793c7555b79e commit 77054a897f6440632267e75ebe31793c7555b79e Author: Warner Losh AuthorDate: 2021-10-01 15:53:10 +0000 Commit: Warner Losh CommitDate: 2021-10-01 16:56:10 +0000 nvme: Explain a workaround a little better The don't touch the mmio of the drive after we do a EN 1->0 transition is only for a tiny number of dirves that have this unforunate issue. Sponsored by: Netflix --- sys/dev/nvme/nvme_ctrlr.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/dev/nvme/nvme_ctrlr.c b/sys/dev/nvme/nvme_ctrlr.c index 10b30c584f71..eb95fa33b90b 100644 --- a/sys/dev/nvme/nvme_ctrlr.c +++ b/sys/dev/nvme/nvme_ctrlr.c @@ -318,10 +318,10 @@ nvme_ctrlr_disable(struct nvme_controller *ctrlr) cc &= ~NVME_CC_REG_EN_MASK; nvme_mmio_write_4(ctrlr, cc, cc); + /* - * Some drives have issues with accessing the mmio after we - * disable, so delay for a bit after we write the bit to - * cope with these issues. + * A few drives have firmware bugs that freeze the drive if we access + * the mmio too soon after we disable. */ if (ctrlr->quirks & QUIRK_DELAY_B4_CHK_RDY) pause("nvmeR", MSEC_2_TICKS(B4_CHK_RDY_DELAY_MS)); From owner-dev-commits-src-main@freebsd.org Fri Oct 1 16:56:24 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AF7AB6B2746; Fri, 1 Oct 2021 16:56:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HLbqD3zNHz4kLm; Fri, 1 Oct 2021 16:56:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6A4B723257; Fri, 1 Oct 2021 16:56:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 191GuO2C004082; Fri, 1 Oct 2021 16:56:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 191GuOnu004081; Fri, 1 Oct 2021 16:56:24 GMT (envelope-from git) Date: Fri, 1 Oct 2021 16:56:24 GMT Message-Id: <202110011656.191GuOnu004081@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: a245627a4e95 - main - nvme_ctrlr_enable: Small style nits MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a245627a4e9553c84eddea07570daaf85c1067b6 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Oct 2021 16:56:24 -0000 The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=a245627a4e9553c84eddea07570daaf85c1067b6 commit a245627a4e9553c84eddea07570daaf85c1067b6 Author: Warner Losh AuthorDate: 2021-10-01 16:51:24 +0000 Commit: Warner Losh CommitDate: 2021-10-01 16:56:10 +0000 nvme_ctrlr_enable: Small style nits Rewrite the nested if's using the preferred FreeBSD style for branches of ifs that return. NFC. Minor tweaks to the comments to better fit new code layout. Sponsored by: Netflix Reviewed by: mav, chuck (prior rev, but comments rolled in) Differential Revision: https://reviews.freebsd.org/D32245 --- sys/dev/nvme/nvme_ctrlr.c | 33 +++++++++++++++------------------ 1 file changed, 15 insertions(+), 18 deletions(-) diff --git a/sys/dev/nvme/nvme_ctrlr.c b/sys/dev/nvme/nvme_ctrlr.c index f22e21eaf54a..10b30c584f71 100644 --- a/sys/dev/nvme/nvme_ctrlr.c +++ b/sys/dev/nvme/nvme_ctrlr.c @@ -303,19 +303,17 @@ nvme_ctrlr_disable(struct nvme_controller *ctrlr) * CSTS.RDY is 0 "has undefined results" So make sure that CSTS.RDY * isn't the desired value. Short circuit if we're already disabled. */ - if (en == 1) { - if (rdy == 0) { - /* EN == 1, wait for RDY == 1 or fail */ - err = nvme_ctrlr_wait_for_ready(ctrlr, 1); - if (err != 0) - return (err); - } - } else { - /* EN == 0 already wait for RDY == 0 */ + if (en == 0) { + /* Wait for RDY == 0 or timeout & fail */ if (rdy == 0) return (0); - else - return (nvme_ctrlr_wait_for_ready(ctrlr, 0)); + return (nvme_ctrlr_wait_for_ready(ctrlr, 0)); + } + if (rdy == 0) { + /* EN == 1, wait for RDY == 1 or timeout & fail */ + err = nvme_ctrlr_wait_for_ready(ctrlr, 1); + if (err != 0) + return (err); } cc &= ~NVME_CC_REG_EN_MASK; @@ -352,15 +350,14 @@ nvme_ctrlr_enable(struct nvme_controller *ctrlr) if (en == 1) { if (rdy == 1) return (0); - else - return (nvme_ctrlr_wait_for_ready(ctrlr, 1)); - } else { - /* EN == 0 already wait for RDY == 0 or fail */ - err = nvme_ctrlr_wait_for_ready(ctrlr, 0); - if (err != 0) - return (err); + return (nvme_ctrlr_wait_for_ready(ctrlr, 1)); } + /* EN == 0 already wait for RDY == 0 or timeout & fail */ + err = nvme_ctrlr_wait_for_ready(ctrlr, 0); + if (err != 0) + return (err); + nvme_mmio_write_8(ctrlr, asq, ctrlr->adminq.cmd_bus_addr); nvme_mmio_write_8(ctrlr, acq, ctrlr->adminq.cpl_bus_addr); From owner-dev-commits-src-main@freebsd.org Fri Oct 1 17:10:23 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9C0E16B2D85; Fri, 1 Oct 2021 17:10:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HLc7M3q0Jz4lMM; Fri, 1 Oct 2021 17:10:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5F245230C7; Fri, 1 Oct 2021 17:10:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 191HANEK026522; Fri, 1 Oct 2021 17:10:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 191HANo4026521; Fri, 1 Oct 2021 17:10:23 GMT (envelope-from git) Date: Fri, 1 Oct 2021 17:10:23 GMT Message-Id: <202110011710.191HANo4026521@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: e5e26e4a24a1 - main - nvme: Remove pause while resetting MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e5e26e4a24a1142e02a9b477877e13ed0c194f36 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Oct 2021 17:10:23 -0000 The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=e5e26e4a24a1142e02a9b477877e13ed0c194f36 commit e5e26e4a24a1142e02a9b477877e13ed0c194f36 Author: Warner Losh AuthorDate: 2021-10-01 17:09:05 +0000 Commit: Warner Losh CommitDate: 2021-10-01 17:09:05 +0000 nvme: Remove pause while resetting After some study of the code and the standard, I think we can just drop the pause(), unconditionally. If we're not initialized, then there's nothing to wait for from a software perspective. If we are initialized, then there might be outstanding I/O. If so, then the qpair 'recovery state' will transition to WAITING in nvme_ctrlr_disable_qpairs, which will ignore any interrupts for items that complete before we complete the reset by setting cc.en=0. If we go on to fail the controller, we'll cancel the outstanding I/O transactions. If we reset the controller, the hardware throws away pending transactions and we retry all the pending I/O transactions. Any transactions that happend to complete before cc.en=0 will have the same effect in the end (doing the same transaction twice is just inefficient, it won't affect the state of the device any differently than having done it once). The standard imposes no wait times here, so it isn't needed from that perspective. Unanswered Question: Do we may need to disable interrupts while we disable in legacy mode since those are level-sensitive. Sponsored by: Netflix Reviewed by: mav Differential Revision: https://reviews.freebsd.org/D32248 --- sys/dev/nvme/nvme_ctrlr.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/sys/dev/nvme/nvme_ctrlr.c b/sys/dev/nvme/nvme_ctrlr.c index eb95fa33b90b..d0be0da39902 100644 --- a/sys/dev/nvme/nvme_ctrlr.c +++ b/sys/dev/nvme/nvme_ctrlr.c @@ -410,13 +410,13 @@ nvme_ctrlr_hw_reset(struct nvme_controller *ctrlr) int err; TSENTER(); - nvme_ctrlr_disable_qpairs(ctrlr); - pause("nvmehwreset", hz / 10); + nvme_ctrlr_disable_qpairs(ctrlr); err = nvme_ctrlr_disable(ctrlr); if (err != 0) return err; + err = nvme_ctrlr_enable(ctrlr); TSEXIT(); return (err); @@ -1653,13 +1653,10 @@ nvme_ctrlr_suspend(struct nvme_controller *ctrlr) * flushes any metadata the drive may have stored so it can survive * having its power removed and prevents the unsafe shutdown count from * incriminating. Once we delete the qpairs, we have to disable them - * before shutting down. The delay is out of paranoia in - * nvme_ctrlr_hw_reset, and is repeated here (though we should have no - * pending I/O that the delay copes with). + * before shutting down. */ nvme_ctrlr_delete_qpairs(ctrlr); nvme_ctrlr_disable_qpairs(ctrlr); - pause("nvmesusp", hz / 10); nvme_ctrlr_shutdown(ctrlr); return (0); From owner-dev-commits-src-main@freebsd.org Fri Oct 1 17:10:24 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B12EF6B2AC4; Fri, 1 Oct 2021 17:10:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HLc7N4Zwmz4lMQ; Fri, 1 Oct 2021 17:10:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7E8112333D; Fri, 1 Oct 2021 17:10:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 191HAODo026552; Fri, 1 Oct 2021 17:10:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 191HAO5w026551; Fri, 1 Oct 2021 17:10:24 GMT (envelope-from git) Date: Fri, 1 Oct 2021 17:10:24 GMT Message-Id: <202110011710.191HAO5w026551@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 4b3da659bf62 - main - nvme: Only reset once on attach. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 4b3da659bf62b0f5306b5acee9add41b84361498 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Oct 2021 17:10:24 -0000 The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=4b3da659bf62b0f5306b5acee9add41b84361498 commit 4b3da659bf62b0f5306b5acee9add41b84361498 Author: Warner Losh AuthorDate: 2021-10-01 17:09:34 +0000 Commit: Warner Losh CommitDate: 2021-10-01 17:09:34 +0000 nvme: Only reset once on attach. The FreeBSD nvme driver has reset the nvme controller twice on attach to address a theoretical issue assuring the hardware is in a known state. However, exierence has shown the second reset is unnecessary and increases the time to boot. Eliminate the second reset. Should there be a situation when you need a second reset (for buggy or at least somewhat out of the mainstream hardware), the hardware option NVME_2X_RESET will restore the old behavior. Document this in nvme(4). If there's any trouble at all with this, I'll add a sysctl tunable to control it. Sponsored by: Netflix Reviewed by: cperciva, mav Differential Revision: https://reviews.freebsd.org/D32241 --- share/man/man4/nvme.4 | 8 ++++++++ sys/conf/options | 1 + sys/dev/nvme/nvme_ctrlr.c | 27 +++++++++++++++++---------- 3 files changed, 26 insertions(+), 10 deletions(-) diff --git a/share/man/man4/nvme.4 b/share/man/man4/nvme.4 index db31b6f26b3e..eb9f9b222f51 100644 --- a/share/man/man4/nvme.4 +++ b/share/man/man4/nvme.4 @@ -172,6 +172,14 @@ value in hw.nvme.verbose_cmd_dump=1 .Ed .Pp +Prior versions of the driver reset the card twice on boot. +This proved to be unnecessary and inefficient, so the driver now resets drive +controller only once. +The old behavior may be restored in the kernel config file with +.Bd -literal -offset indent +.Cd options NVME_2X_RESET +.Ed +.Pp .Sh SYSCTL VARIABLES The following controller-level sysctls are currently implemented: .Bl -tag -width indent diff --git a/sys/conf/options b/sys/conf/options index 42703b621752..2d99dc8c67db 100644 --- a/sys/conf/options +++ b/sys/conf/options @@ -1006,6 +1006,7 @@ EKCD opt_ekcd.h # NVME options NVME_USE_NVD opt_nvme.h +NVME_2X_RESET opt_nvme.h # amdsbwd options AMDSBWD_DEBUG opt_amdsbwd.h diff --git a/sys/dev/nvme/nvme_ctrlr.c b/sys/dev/nvme/nvme_ctrlr.c index d0be0da39902..ca89e99d2934 100644 --- a/sys/dev/nvme/nvme_ctrlr.c +++ b/sys/dev/nvme/nvme_ctrlr.c @@ -30,6 +30,7 @@ __FBSDID("$FreeBSD$"); #include "opt_cam.h" +#include "opt_nvme.h" #include #include @@ -1135,12 +1136,6 @@ nvme_ctrlr_start_config_hook(void *arg) TSENTER(); - /* - * Reset controller twice to ensure we do a transition from cc.en==1 to - * cc.en==0. This is because we don't really know what status the - * controller was left in when boot handed off to OS. Linux doesn't do - * this, however. If we adopt that policy, see also nvme_ctrlr_resume(). - */ if (nvme_ctrlr_hw_reset(ctrlr) != 0) { fail: nvme_ctrlr_fail(ctrlr); @@ -1148,8 +1143,17 @@ fail: return; } +#ifdef NVME_2X_RESET + /* + * Reset controller twice to ensure we do a transition from cc.en==1 to + * cc.en==0. This is because we don't really know what status the + * controller was left in when boot handed off to OS. Linux doesn't do + * this, however, and when the controller is in state cc.en == 0, no + * I/O can happen. + */ if (nvme_ctrlr_hw_reset(ctrlr) != 0) goto fail; +#endif nvme_qpair_reset(&ctrlr->adminq); nvme_admin_qpair_enable(&ctrlr->adminq); @@ -1672,14 +1676,17 @@ nvme_ctrlr_resume(struct nvme_controller *ctrlr) if (ctrlr->is_failed) return (0); - /* - * Have to reset the hardware twice, just like we do on attach. See - * nmve_attach() for why. - */ if (nvme_ctrlr_hw_reset(ctrlr) != 0) goto fail; +#ifdef NVME_2X_RESET + /* + * Prior to FreeBSD 13.1, FreeBSD's nvme driver reset the hardware twice + * to get it into a known good state. However, the hardware's state is + * good and we don't need to do this for proper functioning. + */ if (nvme_ctrlr_hw_reset(ctrlr) != 0) goto fail; +#endif /* * Now that we've reset the hardware, we can restart the controller. Any From owner-dev-commits-src-main@freebsd.org Fri Oct 1 17:31:29 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id EC81C6B320A; Fri, 1 Oct 2021 17:31:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HLcbj63Snz4mT2; Fri, 1 Oct 2021 17:31:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AFE882376B; Fri, 1 Oct 2021 17:31:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 191HVTX5053546; Fri, 1 Oct 2021 17:31:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 191HVTTK053545; Fri, 1 Oct 2021 17:31:29 GMT (envelope-from git) Date: Fri, 1 Oct 2021 17:31:29 GMT Message-Id: <202110011731.191HVTTK053545@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Gleb Smirnoff Subject: git: b984d153e057 - main - Don't set GELI UMA zone as UMA_ZONE_NOFREE. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: glebius X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b984d153e057b7879632b8e6015a05ce3f177580 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Oct 2021 17:31:30 -0000 The branch main has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=b984d153e057b7879632b8e6015a05ce3f177580 commit b984d153e057b7879632b8e6015a05ce3f177580 Author: Gleb Smirnoff AuthorDate: 2021-10-01 17:24:50 +0000 Commit: Gleb Smirnoff CommitDate: 2021-10-01 17:31:17 +0000 Don't set GELI UMA zone as UMA_ZONE_NOFREE. That fixes memory leak on last GELI provider destroyed, introduced in 2dbc9a388ee. This patch was originally developed late 2019 and the flag was necessary to prevent zone drainage under memory pressure. Today, with f09cbea31a3f the UMA is fixed not to drain into reserves. Discussed with: jtl, markj Fixes: 2dbc9a388ee PR: 258787 --- sys/geom/eli/g_eli.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/sys/geom/eli/g_eli.c b/sys/geom/eli/g_eli.c index 773b9c829acc..c2fdb70980c0 100644 --- a/sys/geom/eli/g_eli.c +++ b/sys/geom/eli/g_eli.c @@ -892,13 +892,8 @@ g_eli_init_uma(void) G_ELI_AUTH_SECKEYLEN) * nsw_cluster_max + sizeof(uintptr_t), PAGE_SIZE); - /* - * Create the zone, setting UMA_ZONE_NOFREE so we won't - * drain the zone in a memory shortage. - */ g_eli_uma = uma_zcreate("GELI buffers", g_eli_alloc_sz, - NULL, NULL, NULL, NULL, - UMA_ALIGN_PTR, UMA_ZONE_NOFREE); + NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, 0); /* Reserve and pre-allocate pages, as appropriate. */ uma_zone_reserve(g_eli_uma, g_eli_minbufs); From owner-dev-commits-src-main@freebsd.org Fri Oct 1 18:16:24 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C3DE36B390F; Fri, 1 Oct 2021 18:16:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HLdbX58XNz4pSZ; Fri, 1 Oct 2021 18:16:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 911B42407B; Fri, 1 Oct 2021 18:16:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 191IGO5e011374; Fri, 1 Oct 2021 18:16:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 191IGO91011373; Fri, 1 Oct 2021 18:16:24 GMT (envelope-from git) Date: Fri, 1 Oct 2021 18:16:24 GMT Message-Id: <202110011816.191IGO91011373@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 4aed5c3c9d1d - main - time_t is pathological: use %j + cast to print it. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 4aed5c3c9d1d78986d3feba3f128187c59fb2dfe Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Oct 2021 18:16:24 -0000 The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=4aed5c3c9d1d78986d3feba3f128187c59fb2dfe commit 4aed5c3c9d1d78986d3feba3f128187c59fb2dfe Author: Warner Losh AuthorDate: 2021-10-01 18:14:35 +0000 Commit: Warner Losh CommitDate: 2021-10-01 18:16:10 +0000 time_t is pathological: use %j + cast to print it. Sponsored by: Netflix --- contrib/netbsd-tests/lib/librt/t_sem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/netbsd-tests/lib/librt/t_sem.c b/contrib/netbsd-tests/lib/librt/t_sem.c index 1c4290c0b3fb..f542c6315528 100644 --- a/contrib/netbsd-tests/lib/librt/t_sem.c +++ b/contrib/netbsd-tests/lib/librt/t_sem.c @@ -406,7 +406,7 @@ ATF_TC_BODY(clockwait_relative_intr_remaining, tc) (remain.tv_nsec >= 25*1000*1000 || machine_is_virtual()) && remain.tv_nsec <= 75*1000*1000, "the remaining time was not as expected when a relative clockwait" - " got EINTR: %ld.%09ld", remain.tv_sec, remain.tv_nsec); + " got EINTR: %jd.%09ld", (uintmax_t)remain.tv_sec, remain.tv_nsec); } #endif /* __FreeBSD__ */ From owner-dev-commits-src-main@freebsd.org Fri Oct 1 18:17:53 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2F04D6B372E; Fri, 1 Oct 2021 18:17:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HLddF0lQyz4pND; Fri, 1 Oct 2021 18:17:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EDA9E241C9; Fri, 1 Oct 2021 18:17:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 191IHq8Z011579; Fri, 1 Oct 2021 18:17:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 191IHqH1011578; Fri, 1 Oct 2021 18:17:52 GMT (envelope-from git) Date: Fri, 1 Oct 2021 18:17:52 GMT Message-Id: <202110011817.191IHqH1011578@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kyle Evans Subject: git: 2f4dbe279f6b - main - kqueue: fix recent assertion MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevans X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2f4dbe279f6b5eb87ec493d96f6943ffdb603ba0 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Oct 2021 18:17:53 -0000 The branch main has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=2f4dbe279f6b5eb87ec493d96f6943ffdb603ba0 commit 2f4dbe279f6b5eb87ec493d96f6943ffdb603ba0 Author: Kyle Evans AuthorDate: 2021-10-01 16:59:31 +0000 Commit: Kyle Evans CommitDate: 2021-10-01 18:17:30 +0000 kqueue: fix recent assertion NOTE_ABSTIME may also have a zero timeout, which indicates that we should still fire immediately as an absolute time in the past. A test has been added for this one as well. Fixes: 9c999a259f00 ("kqueue: don't arbitrarily restrict long-past...") Point hat: kevans Reported by: syzbot+1c8d1154f560b3930042@syzkaller.appspotmail.com --- sys/kern/kern_event.c | 3 ++- tests/sys/kqueue/libkqueue/timer.c | 30 ++++++++++++++++++++++++++++++ 2 files changed, 32 insertions(+), 1 deletion(-) diff --git a/sys/kern/kern_event.c b/sys/kern/kern_event.c index 3cd7753d4f6d..c9b50912a22d 100644 --- a/sys/kern/kern_event.c +++ b/sys/kern/kern_event.c @@ -819,7 +819,8 @@ filt_timerattach(struct knote *kn) error = filt_timervalidate(kn, &to); if (error != 0) return (error); - KASSERT((kn->kn_flags & EV_ONESHOT) != 0 || to > 0, + KASSERT(to > 0 || (kn->kn_flags & EV_ONESHOT) != 0 || + (kn->kn_sfflags & NOTE_ABSTIME) != 0, ("%s: periodic timer has a calculated zero timeout", __func__)); KASSERT(to >= 0, ("%s: timer has a calculated negative timeout", __func__)); diff --git a/tests/sys/kqueue/libkqueue/timer.c b/tests/sys/kqueue/libkqueue/timer.c index 76dfc99e11f0..330c22c62bc5 100644 --- a/tests/sys/kqueue/libkqueue/timer.c +++ b/tests/sys/kqueue/libkqueue/timer.c @@ -247,6 +247,35 @@ test_abstime(void) success(); } +static void +test_abstime_epoch(void) +{ + const char *test_id = "kevent(EVFILT_TIMER (EPOCH), NOTE_ABSTIME)"; + struct kevent kev; + + test_begin(test_id); + + test_no_kevents(); + + EV_SET(&kev, vnode_fd, EVFILT_TIMER, EV_ADD, NOTE_ABSTIME, 0, + NULL); + if (kevent(kqfd, &kev, 1, NULL, 0, NULL) < 0) + err(1, "%s", test_id); + + /* Retrieve the event */ + kev.flags = EV_ADD; + kev.data = 1; + kev.fflags = 0; + kevent_cmp(&kev, kevent_get(kqfd)); + + /* Delete the event */ + kev.flags = EV_DELETE; + if (kevent(kqfd, &kev, 1, NULL, 0, NULL) < 0) + err(1, "%s", test_id); + + success(); +} + static void test_abstime_preboot(void) { @@ -599,6 +628,7 @@ test_evfilt_timer(void) test_oneshot(); test_periodic(); test_abstime(); + test_abstime_epoch(); test_abstime_preboot(); test_abstime_postboot(); test_update(); From owner-dev-commits-src-main@freebsd.org Fri Oct 1 18:33:34 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 28C206B36DA; Fri, 1 Oct 2021 18:33:34 +0000 (UTC) (envelope-from eric@vangyzen.net) Received: from smtp.vangyzen.net (hotblack.vangyzen.net [IPv6:2607:fc50:1000:7400:216:3eff:fe72:314f]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4HLdzL0Bwjz4qw9; Fri, 1 Oct 2021 18:33:33 +0000 (UTC) (envelope-from eric@vangyzen.net) Received: from disco.vangyzen.net (unknown [70.99.78.110]) by smtp.vangyzen.net (Postfix) with ESMTPSA id 3F59A56485; Fri, 1 Oct 2021 13:33:27 -0500 (CDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=vangyzen.net; s=default; t=1633113207; bh=ulqOzK4vXJnbn3Ez/Yw2gAPnYGfFwE4UAtI0iOJGl0g=; h=Subject:To:References:From:Date:In-Reply-To; b=jLdaV02ZV84O2Bwt098I7sytr0/n5Txih51S1b2ZAd2nsSlA3WxH6yHpsT98tyESE ElZQg/eFzpa0BCFgMlXqrliCy3tD8eyaKWg+sww3MNTwn49rQ1wqN3lVDH98PTnkZG c5L2/85Vv8QRJEnwy4sBVdnnOPveFH1BfbbOtZk82vQLMdja+eb7L74AzO0rKrw1T2 9n49wIu1DCWQODSE0NwNi6MfykRT0XDK7kZC2rqXNwoomzCUHlqWa1GcwOAb+//Zl8 CSS6BaaZTMpbhD22bNKYCGLPQdZAr6bG8EigpSUp83lKfylShH6QYAyg+Zt/Petyhe +6N2xOGxHWA5g== Subject: Re: git: 4aed5c3c9d1d - main - time_t is pathological: use %j + cast to print it. To: Warner Losh , src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org References: <202110011816.191IGO91011373@gitrepo.freebsd.org> From: Eric van Gyzen Message-ID: <8e2186ae-98ba-4ef4-eeea-ed3d3839a338@vangyzen.net> Date: Fri, 1 Oct 2021 13:33:22 -0500 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:78.0) Gecko/20100101 Thunderbird/78.14.0 MIME-Version: 1.0 In-Reply-To: <202110011816.191IGO91011373@gitrepo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4HLdzL0Bwjz4qw9 X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Oct 2021 18:33:34 -0000 On 10/1/21 1:16 PM, Warner Losh wrote: > commit 4aed5c3c9d1d78986d3feba3f128187c59fb2dfe > Author: Warner Losh > AuthorDate: 2021-10-01 18:14:35 +0000 > Commit: Warner Losh > CommitDate: 2021-10-01 18:16:10 +0000 > > time_t is pathological: use %j + cast to print it. You beat me by 14 minutes. Thank you. Yes, time_t is unfortunate, but it's still my fault, because I knew that before I screwed it up. :) Eric From owner-dev-commits-src-main@freebsd.org Fri Oct 1 18:51:23 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3D7FF6B40D5; Fri, 1 Oct 2021 18:51:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HLfMv1Kj3z4s9X; Fri, 1 Oct 2021 18:51:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0E191246B4; Fri, 1 Oct 2021 18:51:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 191IpMXi062169; Fri, 1 Oct 2021 18:51:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 191IpMqp062168; Fri, 1 Oct 2021 18:51:22 GMT (envelope-from git) Date: Fri, 1 Oct 2021 18:51:22 GMT Message-Id: <202110011851.191IpMqp062168@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kyle Evans Subject: git: f54b18fc4d72 - main - freebsd-version(1): Add -j flag to support jails MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevans X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f54b18fc4d72c566912b9a41601ed87a852960e7 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Oct 2021 18:51:23 -0000 The branch main has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=f54b18fc4d72c566912b9a41601ed87a852960e7 commit f54b18fc4d72c566912b9a41601ed87a852960e7 Author: Faraz Vahedi AuthorDate: 2021-10-01 18:46:23 +0000 Commit: Kyle Evans CommitDate: 2021-10-01 18:50:56 +0000 freebsd-version(1): Add -j flag to support jails Make freebsd-version(1) support jails by adding the -j flag which takes a jail jid or name as an argument. As with other options, -j flags stack and display in the order requested. Reviewed by: bcr (manpages), kevans MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D25705 --- bin/freebsd-version/freebsd-version.1 | 13 +++++++++++-- bin/freebsd-version/freebsd-version.sh.in | 29 ++++++++++++++++++++++++++--- 2 files changed, 37 insertions(+), 5 deletions(-) diff --git a/bin/freebsd-version/freebsd-version.1 b/bin/freebsd-version/freebsd-version.1 index 710bb23ac4c3..b580c580fcbc 100644 --- a/bin/freebsd-version/freebsd-version.1 +++ b/bin/freebsd-version/freebsd-version.1 @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 14, 2017 +.Dd October 1, 2021 .Dt FREEBSD-VERSION 1 .Os .Sh NAME @@ -34,6 +34,7 @@ .Sh SYNOPSIS .Nm .Op Fl kru +.Op Fl j Ar jail .Sh DESCRIPTION The .Nm @@ -60,12 +61,20 @@ Print the version and patch level of the installed userland. These are hardcoded into .Nm during the build. +.It Fl j Ar jail +Print the version and patch level of the installed userland in the +given jail specified by +.Va jid +or +.Va name . +This option can be specified multiple times. .El .Pp If several of the above options are specified, .Nm will print the installed kernel version first, then the running kernel -version, and finally the userland version, on separate lines. +version, next the userland version, and finally the userland version +of the specified jails, on separate lines. If neither is specified, it will print the userland version only. .Sh IMPLEMENTATION NOTES The diff --git a/bin/freebsd-version/freebsd-version.sh.in b/bin/freebsd-version/freebsd-version.sh.in index 9541b86a2636..be1be366f652 100644 --- a/bin/freebsd-version/freebsd-version.sh.in +++ b/bin/freebsd-version/freebsd-version.sh.in @@ -84,11 +84,20 @@ userland_version() { echo $USERLAND_VERSION } +# +# Print the hardcoded userland version of a jail. +# +jail_version() { + for i in $jail; do + jexec -- $i freebsd-version + done +} + # # Print a usage string and exit. # usage() { - echo "usage: $progname [-kru]" >&2 + echo "usage: $progname [-kru] [-j jail]" >&2 exit 1 } @@ -97,7 +106,8 @@ usage() { # main() { # parse command-line arguments - while getopts "kru" option ; do + local OPTIND=1 OPTARG option + while getopts "kruj:" option ; do case $option in k) opt_k=1 @@ -108,6 +118,14 @@ main() { u) opt_u=1 ;; + j) + if [ $opt_j ] ; then + jail="$jail $OPTARG" + else + opt_j=1 + jail="$OPTARG" + fi + ;; *) usage ;; @@ -118,7 +136,7 @@ main() { fi # default is -u - if [ $((opt_k + opt_r + opt_u)) -eq 0 ] ; then + if [ $((opt_k + opt_r + opt_u + opt_j)) -eq 0 ] ; then opt_u=1 fi @@ -136,6 +154,11 @@ main() { if [ $opt_u ] ; then userland_version fi + + # print jail version + if [ $opt_j ] ; then + jail_version + fi } main "$@" From owner-dev-commits-src-main@freebsd.org Fri Oct 1 18:51:24 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 802836B3EEF; Fri, 1 Oct 2021 18:51:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HLfMw2t3Cz4s2V; Fri, 1 Oct 2021 18:51:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3CAA1246B5; Fri, 1 Oct 2021 18:51:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 191IpOhj062193; Fri, 1 Oct 2021 18:51:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 191IpOLd062192; Fri, 1 Oct 2021 18:51:24 GMT (envelope-from git) Date: Fri, 1 Oct 2021 18:51:24 GMT Message-Id: <202110011851.191IpOLd062192@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kyle Evans Subject: git: c76da1f01064 - main - freebsd-update(8): Add -j flag to support jails MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevans X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c76da1f01064b2b9a1903b30d4b4c444b85f8724 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Oct 2021 18:51:24 -0000 The branch main has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=c76da1f01064b2b9a1903b30d4b4c444b85f8724 commit c76da1f01064b2b9a1903b30d4b4c444b85f8724 Author: Faraz Vahedi AuthorDate: 2021-10-01 18:48:57 +0000 Commit: Kyle Evans CommitDate: 2021-10-01 18:51:03 +0000 freebsd-update(8): Add -j flag to support jails Make freebsd-update(8) support jails by adding the -j flag which takes a jail jid or name as an argument. This takes advantage of the recently added -j support to freebsd-version(8) in order to get the version of the installed userland. Reviewed by: dteske, kevans MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D25711 --- usr.sbin/freebsd-update/freebsd-update.8 | 11 ++++++++++- usr.sbin/freebsd-update/freebsd-update.sh | 20 +++++++++++++++++++- 2 files changed, 29 insertions(+), 2 deletions(-) diff --git a/usr.sbin/freebsd-update/freebsd-update.8 b/usr.sbin/freebsd-update/freebsd-update.8 index 54ec17b5ea36..be477d0cdce7 100644 --- a/usr.sbin/freebsd-update/freebsd-update.8 +++ b/usr.sbin/freebsd-update/freebsd-update.8 @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 14, 2020 +.Dd October 1, 2021 .Dt FREEBSD-UPDATE 8 .Os .Sh NAME @@ -37,6 +37,7 @@ .Op Fl d Ar workdir .Op Fl f Ar conffile .Op Fl F +.Op Fl j Ar jail .Op Fl k Ar KEY .Op Fl r Ar newrelease .Op Fl s Ar server @@ -90,6 +91,14 @@ Read configuration options from Force .Nm Cm fetch to proceed in the case of an unfinished upgrade. +.It Fl j Ar jail +Operate on the given jail specified by +.Va jid +or +.Va name . +(The version of the installed userland is detected and the +.Fl -currently-running +option is no more required.) .It Fl k Ar KEY Trust an RSA key with SHA256 of .Ar KEY . diff --git a/usr.sbin/freebsd-update/freebsd-update.sh b/usr.sbin/freebsd-update/freebsd-update.sh index 4fbac58cb562..1776115d0776 100644 --- a/usr.sbin/freebsd-update/freebsd-update.sh +++ b/usr.sbin/freebsd-update/freebsd-update.sh @@ -36,7 +36,7 @@ # --no-stats -- don't show progress statistics while fetching files usage () { cat < Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 290BA6B4782; Fri, 1 Oct 2021 18:53:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HLfQY0fq6z4sRm; Fri, 1 Oct 2021 18:53:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EB0852476D; Fri, 1 Oct 2021 18:53:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 191IreJ9064050; Fri, 1 Oct 2021 18:53:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 191IreQB064049; Fri, 1 Oct 2021 18:53:40 GMT (envelope-from git) Date: Fri, 1 Oct 2021 18:53:40 GMT Message-Id: <202110011853.191IreQB064049@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: 0177102173f3 - main - arm64, riscv: Fix TRAF_PC() to return the PC, not the return address. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 0177102173f39e17366a32eb22653aeb5248c355 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Oct 2021 18:53:41 -0000 The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=0177102173f39e17366a32eb22653aeb5248c355 commit 0177102173f39e17366a32eb22653aeb5248c355 Author: John Baldwin AuthorDate: 2021-10-01 18:53:12 +0000 Commit: John Baldwin CommitDate: 2021-10-01 18:53:12 +0000 arm64, riscv: Fix TRAF_PC() to return the PC, not the return address. Reviewed by: mhorne Obtained from: CheriBSD Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D31969 --- sys/arm64/include/cpu.h | 2 +- sys/riscv/include/cpu.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/arm64/include/cpu.h b/sys/arm64/include/cpu.h index 0b1aa2d93b03..c926372a0ec6 100644 --- a/sys/arm64/include/cpu.h +++ b/sys/arm64/include/cpu.h @@ -45,7 +45,7 @@ #include #include -#define TRAPF_PC(tfp) ((tfp)->tf_lr) +#define TRAPF_PC(tfp) ((tfp)->tf_elr) #define TRAPF_USERMODE(tfp) (((tfp)->tf_spsr & PSR_M_MASK) == PSR_M_EL0t) #define cpu_getstack(td) ((td)->td_frame->tf_sp) diff --git a/sys/riscv/include/cpu.h b/sys/riscv/include/cpu.h index 79c6f730f2a6..453a6af1a0f8 100644 --- a/sys/riscv/include/cpu.h +++ b/sys/riscv/include/cpu.h @@ -41,7 +41,7 @@ #include #include -#define TRAPF_PC(tfp) ((tfp)->tf_ra) +#define TRAPF_PC(tfp) ((tfp)->tf_sepc) #define TRAPF_USERMODE(tfp) (((tfp)->tf_sstatus & SSTATUS_SPP) == 0) #define cpu_getstack(td) ((td)->td_frame->tf_sp) From owner-dev-commits-src-main@freebsd.org Fri Oct 1 19:17:21 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 24AE86B4B40; Fri, 1 Oct 2021 19:17:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HLfxs0WBpz4v49; Fri, 1 Oct 2021 19:17:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E637F24DB3; Fri, 1 Oct 2021 19:17:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 191JHKrf091828; Fri, 1 Oct 2021 19:17:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 191JHKoJ091827; Fri, 1 Oct 2021 19:17:20 GMT (envelope-from git) Date: Fri, 1 Oct 2021 19:17:20 GMT Message-Id: <202110011917.191JHKoJ091827@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Justin Hibbits Subject: git: 63cb9308a75b - main - Fix segment size in compressing core dumps MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhibbits X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 63cb9308a75b99fe057409705bc1b2ac0293f578 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Oct 2021 19:17:21 -0000 The branch main has been updated by jhibbits: URL: https://cgit.FreeBSD.org/src/commit/?id=63cb9308a75b99fe057409705bc1b2ac0293f578 commit 63cb9308a75b99fe057409705bc1b2ac0293f578 Author: Justin Hibbits AuthorDate: 2021-10-01 18:39:18 +0000 Commit: Justin Hibbits CommitDate: 2021-10-01 19:16:33 +0000 Fix segment size in compressing core dumps A core segment is bounded in size only by memory size. On 64-bit architectures this means a segment can be much larger than 4GB. However, compress_chunk() takes only a u_int, clamping segment size to 4GB-1, resulting in a truncated core. Everything else, including the compressor internally, uses size_t, so use size_t at the boundary here. This dates back to the original refactor back in 2015 (r279801 / aa14e9b7). MFC after: 1 week Sponsored by: Juniper Networks, Inc. --- sys/kern/kern_exec.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/kern/kern_exec.c b/sys/kern/kern_exec.c index cbe0152a8001..4b3035cb7e08 100644 --- a/sys/kern/kern_exec.c +++ b/sys/kern/kern_exec.c @@ -1884,9 +1884,9 @@ exec_unregister(const struct execsw *execsw_arg) * Write out a core segment to the compression stream. */ static int -compress_chunk(struct coredump_params *cp, char *base, char *buf, u_int len) +compress_chunk(struct coredump_params *cp, char *base, char *buf, size_t len) { - u_int chunk_len; + size_t chunk_len; int error; while (len > 0) { From owner-dev-commits-src-main@freebsd.org Fri Oct 1 20:40:19 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 557706B571F; Fri, 1 Oct 2021 20:40:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HLhnb1kmGz3GBH; Fri, 1 Oct 2021 20:40:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1B27925E6F; Fri, 1 Oct 2021 20:40:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 191KeJ4W004919; Fri, 1 Oct 2021 20:40:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 191KeJjc004913; Fri, 1 Oct 2021 20:40:19 GMT (envelope-from git) Date: Fri, 1 Oct 2021 20:40:19 GMT Message-Id: <202110012040.191KeJjc004913@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Gleb Smirnoff Subject: git: a37e4fd1ea8c - main - Re-style dfcef8771484 to keep the code and variables related to listening sockets separated from code for generic sockets. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: glebius X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a37e4fd1ea8ccb2a5e54083d7cfc7b1b1784072d Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Oct 2021 20:40:19 -0000 The branch main has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=a37e4fd1ea8ccb2a5e54083d7cfc7b1b1784072d commit a37e4fd1ea8ccb2a5e54083d7cfc7b1b1784072d Author: Gleb Smirnoff AuthorDate: 2021-10-01 20:38:24 +0000 Commit: Gleb Smirnoff CommitDate: 2021-10-01 20:38:24 +0000 Re-style dfcef8771484 to keep the code and variables related to listening sockets separated from code for generic sockets. No objection: markj --- sys/kern/uipc_socket.c | 30 ++++++++++++++++++------------ 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/sys/kern/uipc_socket.c b/sys/kern/uipc_socket.c index 1f999108dd71..267a33feac3b 100644 --- a/sys/kern/uipc_socket.c +++ b/sys/kern/uipc_socket.c @@ -1225,9 +1225,8 @@ int soclose(struct socket *so) { struct accept_queue lqueue; - struct socket *sp, *tsp; int error = 0; - bool last __diagused; + bool listening, last __diagused; KASSERT(!(so->so_state & SS_NOFDREF), ("soclose: SS_NOFDREF on enter")); @@ -1261,9 +1260,11 @@ drop: if (so->so_proto->pr_usrreqs->pru_close != NULL) (*so->so_proto->pr_usrreqs->pru_close)(so); - TAILQ_INIT(&lqueue); SOCK_LOCK(so); - if (SOLISTENING(so)) { + if ((listening = SOLISTENING(so))) { + struct socket *sp; + + TAILQ_INIT(&lqueue); TAILQ_SWAP(&lqueue, &so->sol_incomp, socket, so_list); TAILQ_CONCAT(&lqueue, &so->sol_comp, so_list); @@ -1282,14 +1283,19 @@ drop: KASSERT((so->so_state & SS_NOFDREF) == 0, ("soclose: NOFDREF")); so->so_state |= SS_NOFDREF; sorele(so); - TAILQ_FOREACH_SAFE(sp, &lqueue, so_list, tsp) { - SOCK_LOCK(sp); - if (refcount_load(&sp->so_count) == 0) { - SOCK_UNLOCK(sp); - soabort(sp); - } else { - /* See the handling of queued sockets in sofree(). */ - SOCK_UNLOCK(sp); + if (listening) { + struct socket *sp, *tsp; + + TAILQ_FOREACH_SAFE(sp, &lqueue, so_list, tsp) { + SOCK_LOCK(sp); + if (refcount_load(&sp->so_count) == 0) { + SOCK_UNLOCK(sp); + soabort(sp); + } else { + /* See the handling of queued sockets + in sofree(). */ + SOCK_UNLOCK(sp); + } } } CURVNET_RESTORE(); From owner-dev-commits-src-main@freebsd.org Fri Oct 1 21:00:01 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D6C686B5D9B; Fri, 1 Oct 2021 21:00:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HLjDK5ZSbz3HgD; Fri, 1 Oct 2021 21:00:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A04B92655A; Fri, 1 Oct 2021 21:00:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 191L01jx027166; Fri, 1 Oct 2021 21:00:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 191L018T027156; Fri, 1 Oct 2021 21:00:01 GMT (envelope-from git) Date: Fri, 1 Oct 2021 21:00:01 GMT Message-Id: <202110012100.191L018T027156@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Li-Wen Hsu Subject: git: fbece7609573 - main - Update Azure release bits MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: lwhsu X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: fbece7609573bd51080e949df03fa3d803a637ae Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Oct 2021 21:00:01 -0000 The branch main has been updated by lwhsu: URL: https://cgit.FreeBSD.org/src/commit/?id=fbece7609573bd51080e949df03fa3d803a637ae commit fbece7609573bd51080e949df03fa3d803a637ae Author: Li-Wen Hsu AuthorDate: 2021-10-01 20:59:10 +0000 Commit: Li-Wen Hsu CommitDate: 2021-10-01 20:59:10 +0000 Update Azure release bits Imports the changes for building official images on Azure Marketplace, which fulfill the requirements of Azure and FreeBSD cloud images like disk layout and UEFI for Gen2 VM, along with some minor improvements like configurations to speed up booting. "CLOUDWARE" list will be updated after some more collaborations with re completed. Reviewed by: re (gjb) Sponsored by: The FreeBSD Foundation Technical assistance from: Microsoft Differential Revision: https://reviews.freebsd.org/D23804 --- release/Makefile.azure | 55 +++++++++++++++++++++++++++++--------------- release/Makefile.vm | 2 +- release/tools/azure.conf | 57 ++++++++++++++++++++++++++++++++++------------ release/tools/vmimage.subr | 7 +++++- 4 files changed, 87 insertions(+), 34 deletions(-) diff --git a/release/Makefile.azure b/release/Makefile.azure index 32e91833b766..b8e7418f35f7 100644 --- a/release/Makefile.azure +++ b/release/Makefile.azure @@ -11,8 +11,8 @@ AZURE_UPLOAD_TGTS= azure-check-depends \ CLEANFILES+= ${AZURE_UPLOAD_TGTS} .if defined(AZURE_UPLOAD_CONF) && !empty(AZURE_UPLOAD_CONF) -. for VAR in _STORAGE _ACCOUNT _KEY -AZURE${VAR}!= grep -E ^AZURE${VAR} ${AZURE_UPLOAD_CONF} | awk -F' ' '{print $$2}' +. for VAR in _STORAGE _ACCOUNT _RESOURCEGROUP _KEY _LOCATION +AZURE${VAR}!= grep -E ^AZURE${VAR}= ${AZURE_UPLOAD_CONF} | awk '{print $$2}' . endfor .endif @@ -20,34 +20,53 @@ AZURE${VAR}!= grep -E ^AZURE${VAR} ${AZURE_UPLOAD_CONF} | awk -F' ' '{print $$2} SNAPSHOT_DATE!= date +-${BUILDDATE} .endif -AZURE_TARGET:= ${OSRELEASE}${SNAPSHOT_DATE}.vhd +AZURE_TARGET:= ${OSRELEASE}${SNAPSHOT_DATE} + +START_DATE!= date -v-1d -I -u +EXPIRY_DATE!= date -v+1m -I -u azure-upload: ${AZURE_UPLOAD_TGTS} azure-check-depends: -.for VAR in _STORAGE _ACCOUNT _KEY +.for VAR in _STORAGE _ACCOUNT _RESOURCEGROUP _KEY . if !defined(AZURE${VAR}) || empty(AZURE${VAR}) @echo "Variable AZURE${VAR} cannot be empty." @false . endif .endfor -.if !exists(/usr/local/bin/azure) -. if !exists(/usr/local/bin/npm) -. if !exists(${PORTSDIR}/www/npm/Makefile) -. if !exists(/usr/local/sbin/pkg-static) +.if !exists(/usr/local/bin/az) +. if !exists(${PORTSDIR}/sysutils/py-azure-cli/Makefile) +. if !exists(/usr/local/sbin/pkg-static) env ASSUME_ALWAYS_YES=yes pkg bootstrap -yf -. endif - env ASSUME_ALWAYS_YES=yes pkg install -y www/npm -. else - env UNAME_r=${UNAME_r} make -C ${PORTSDIR}/www/npm BATCH=1 all install clean . endif + env ASSUME_ALWAYS_YES=yes pkg install -y py38-azure-cli +. else + env UNAME_r=${UNAME_r} make -C ${PORTSDIR}/sysutils/py-azure-cli BATCH=1 all install clean . endif - npm install -g azure-cli .endif azure-do-upload: - /usr/local/bin/azure storage blob upload \ - ${AZURE_IMG} ${AZURE_STORAGE} ${AZURE_TARGET} \ - -t page -a ${AZURE_ACCOUNT} -k "${AZURE_KEY}" - touch ${.OBJDIR}/${.TARGET} - + /usr/local/bin/az storage blob upload \ + --account-name ${AZURE_ACCOUNT} --account-key ${AZURE_KEY} \ + --container-name ${AZURE_STORAGE} --type page \ + --file ${AZURE_IMG} --name ${AZURE_TARGET}.vhd + @echo "The disk access URL with shared access signature is:" + @echo + @echo -n https://${AZURE_ACCOUNT}.blob.core.windows.net/${AZURE_STORAGE}/${AZURE_TARGET}.vhd? + @/usr/local/bin/az storage container generate-sas \ + --account-name ${AZURE_ACCOUNT} --account-key ${AZURE_KEY} \ + --name ${AZURE_STORAGE} \ + --permissions lr \ + --start ${START_DATE} \ + --expiry ${EXPIRY_DATE} | cut -d '"' -f 2 + @echo + @echo "Please go to Microsoft Partner Center to create a new offer and publish it:" + @echo + @echo "https://partner.microsoft.com/dashboard/commercial-marketplace/overview" + @echo + @echo "After the new offer status is live, you can delete the disk file with:" + @echo + @echo /usr/local/bin/az storage blob delete \ + --account-name ${AZURE_ACCOUNT} --account-key ${AZURE_KEY} \ + --container-name ${AZURE_STORAGE} --name ${AZURE_TARGET}.vhd + @echo diff --git a/release/Makefile.vm b/release/Makefile.vm index 2240a1e5fc57..72b150022ef7 100644 --- a/release/Makefile.vm +++ b/release/Makefile.vm @@ -174,8 +174,8 @@ cloudware-release: ${MAKE} -C ${.CURDIR} ${.MAKEFLAGS} ${CLOUDTARGETS} .endif -.include "${.CURDIR}/Makefile.ec2" .include "${.CURDIR}/Makefile.azure" +.include "${.CURDIR}/Makefile.ec2" .include "${.CURDIR}/Makefile.gce" .include "${.CURDIR}/Makefile.vagrant" .include "${.CURDIR}/Makefile.inc1" diff --git a/release/tools/azure.conf b/release/tools/azure.conf index c88651a07745..a9126ed8c389 100644 --- a/release/tools/azure.conf +++ b/release/tools/azure.conf @@ -3,25 +3,54 @@ # $FreeBSD$ # +# Convention of Linux type VM on Azure is 30G +export VMSIZE=30g + # Set to a list of packages to install. -# Example: -#export VM_EXTRA_PACKAGES="www/apache24" -export VM_EXTRA_PACKAGES="${VM_EXTRA_PACKAGES} sysutils/azure-agent" +export VM_EXTRA_PACKAGES="azure-agent python python3 firstboot-freebsd-update firstboot-pkgs" # Set to a list of third-party software to enable in rc.conf(5). -# Example: -#export VM_RC_LIST="apache24" -export VM_RC_LIST= +export VM_RC_LIST="ntpd sshd waagent firstboot_freebsd_update firstboot_pkgs" + +# No swap space; waagent will allocate swap space on the resource disk. +# See ResourceDisk.EnableSwap and ResourceDisk.SwapSizeMB in waagent.conf +export NOSWAP=YES + +# https://docs.microsoft.com/en-us/azure/marketplace/azure-vm-create-certification-faq#vm-images-must-have-1mb-free-space +export VM_BOOTPARTSOFFSET=1M vm_extra_pre_umount() { - chroot ${DESTDIR} ln -s /usr/local/sbin/waagent /usr/sbin/waagent - chroot ${DESTDIR} /usr/local/sbin/waagent -verbose -install - yes | chroot ${DESTDIR} /usr/local/sbin/waagent -deprovision - echo 'sshd_enable="YES"' >> ${DESTDIR}/etc/rc.conf - echo 'ifconfig_hn0="SYNCDHCP"' >> ${DESTDIR}/etc/rc.conf - echo 'waagent_enable="YES"' >> ${DESTDIR}/etc/rc.conf - echo 'console="comconsole vidconsole"' >> ${DESTDIR}/boot/loader.conf - echo 'comconsole_speed="115200"' >> ${DESTDIR}/boot/loader.conf + # The firstboot_pkgs rc.d script will download the repository + # catalogue and install or update pkg when the instance first + # launches, so these files would just be replaced anyway; removing + # them from the image allows it to boot faster. + mount -t devfs devfs ${DESTDIR}/dev + chroot ${DESTDIR} ${EMULATOR} env ASSUME_ALWAYS_YES=yes \ + /usr/sbin/pkg delete -f -y pkg + umount ${DESTDIR}/dev + rm ${DESTDIR}/var/db/pkg/repo-*.sqlite + + yes | chroot ${DESTDIR} ${EMULATOR} /usr/local/sbin/waagent -deprovision + + cat << EOF >> ${DESTDIR}/etc/rc.conf +ifconfig_hn0="SYNCDHCP" +ntpd_sync_on_start="YES" +EOF + + cat << EOF >> ${DESTDIR}/boot/loader.conf +autoboot_delay="-1" +beastie_disable="YES" +loader_logo="none" +hw.memtest.tests="0" +console="comconsole efi vidconsole" +comconsole_speed="115200" +boot_multicons="YES" +boot_serial="YES" +mlx4en_load="YES" +mlx5en_load="YES" +EOF + + touch ${DESTDIR}/firstboot rm -f ${DESTDIR}/etc/resolv.conf diff --git a/release/tools/vmimage.subr b/release/tools/vmimage.subr index c2b2e21200f1..0d9202431822 100644 --- a/release/tools/vmimage.subr +++ b/release/tools/vmimage.subr @@ -195,6 +195,11 @@ vm_create_disk() { SWAPOPT="-p freebsd-swap/swapfs::${SWAPSIZE}" fi + if [ -n "${VM_BOOTPARTSOFFSET}" ]; then + BOOTPARTSOFFSET=":${VM_BOOTPARTSOFFSET}" + fi + + BOOTFILES="$(env TARGET=${TARGET} TARGET_ARCH=${TARGET_ARCH} \ WITH_UNIFIED_OBJDIR=yes \ make -C ${WORLDDIR}/stand -V .OBJDIR)" @@ -204,7 +209,7 @@ vm_create_disk() { amd64:amd64 | i386:i386) ESP=yes BOOTPARTS="-b ${BOOTFILES}/i386/pmbr/pmbr \ - -p freebsd-boot/bootfs:=${BOOTFILES}/i386/gptboot/gptboot" + -p freebsd-boot/bootfs:=${BOOTFILES}/i386/gptboot/gptboot${BOOTPARTSOFFSET}" ROOTFSPART="-p freebsd-ufs/rootfs:=${VMBASE}" MAKEFSARGS="-B little" ;; From owner-dev-commits-src-main@freebsd.org Fri Oct 1 21:56:34 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C14806B68CB; Fri, 1 Oct 2021 21:56:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HLkTZ4rGRz3Lk6; Fri, 1 Oct 2021 21:56:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 82ABA270F2; Fri, 1 Oct 2021 21:56:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 191LuYgk004210; Fri, 1 Oct 2021 21:56:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 191LuYB9004209; Fri, 1 Oct 2021 21:56:34 GMT (envelope-from git) Date: Fri, 1 Oct 2021 21:56:34 GMT Message-Id: <202110012156.191LuYB9004209@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mateusz Guzik Subject: git: c9536389d732 - main - vfs: hoist cn_thread assert in namei MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mjg X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c9536389d732feecf61afa4632397d67b04b2ab4 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Oct 2021 21:56:34 -0000 The branch main has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=c9536389d732feecf61afa4632397d67b04b2ab4 commit c9536389d732feecf61afa4632397d67b04b2ab4 Author: Mateusz Guzik AuthorDate: 2021-10-01 21:13:38 +0000 Commit: Mateusz Guzik CommitDate: 2021-10-01 21:56:29 +0000 vfs: hoist cn_thread assert in namei Making it condtional on whether ktrace happens to be enabled makes no sense. --- sys/kern/vfs_lookup.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/kern/vfs_lookup.c b/sys/kern/vfs_lookup.c index 28d7ada0f434..e262ebde6ae2 100644 --- a/sys/kern/vfs_lookup.c +++ b/sys/kern/vfs_lookup.c @@ -554,6 +554,8 @@ namei(struct nameidata *ndp) cnp = &ndp->ni_cnd; td = cnp->cn_thread; #ifdef INVARIANTS + KASSERT(cnp->cn_thread == curthread, + ("namei not using curthread")); KASSERT((ndp->ni_debugflags & NAMEI_DBG_CALLED) == 0, ("%s: repeated call to namei without NDREINIT", __func__)); KASSERT(ndp->ni_debugflags == NAMEI_DBG_INITED, @@ -608,8 +610,6 @@ namei(struct nameidata *ndp) #ifdef KTRACE if (KTRPOINT(td, KTR_NAMEI)) { - KASSERT(cnp->cn_thread == curthread, - ("namei not using curthread")); ktrnamei(cnp->cn_pnbuf); } #endif From owner-dev-commits-src-main@freebsd.org Fri Oct 1 22:49:40 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id EC7BA6B7048; Fri, 1 Oct 2021 22:49:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HLlfr676qz3Px1; Fri, 1 Oct 2021 22:49:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AE6F727E1F; Fri, 1 Oct 2021 22:49:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 191Mne9P071501; Fri, 1 Oct 2021 22:49:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 191Mnee0071500; Fri, 1 Oct 2021 22:49:40 GMT (envelope-from git) Date: Fri, 1 Oct 2021 22:49:40 GMT Message-Id: <202110012249.191Mnee0071500@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Michael Tuexen Subject: git: 3ff3733991ba - main - sctp: don't keep being locked on a stream which is removed MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3ff3733991ba049959c4fd2e7179ea96241a396e Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Oct 2021 22:49:41 -0000 The branch main has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=3ff3733991ba049959c4fd2e7179ea96241a396e commit 3ff3733991ba049959c4fd2e7179ea96241a396e Author: Michael Tuexen AuthorDate: 2021-10-01 22:48:01 +0000 Commit: Michael Tuexen CommitDate: 2021-10-01 22:48:01 +0000 sctp: don't keep being locked on a stream which is removed Reported by: syzbot+f5f551e8a3a0302a4914@syzkaller.appspotmail.com MFC after: 1 week --- sys/netinet/sctp_ss_functions.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/sys/netinet/sctp_ss_functions.c b/sys/netinet/sctp_ss_functions.c index 5293c0fee742..c08bec07c588 100644 --- a/sys/netinet/sctp_ss_functions.c +++ b/sys/netinet/sctp_ss_functions.c @@ -150,6 +150,9 @@ sctp_ss_default_remove(struct sctp_tcb *stcb, struct sctp_association *asoc, asoc->ss_data.last_out_stream = NULL; } } + if (asoc->ss_data.locked_on_sending == strq) { + asoc->ss_data.locked_on_sending = NULL; + } TAILQ_REMOVE(&asoc->ss_data.out.wheel, strq, ss_params.ss.rr.next_spoke); strq->ss_params.scheduled = false; } @@ -466,6 +469,9 @@ sctp_ss_prio_remove(struct sctp_tcb *stcb, struct sctp_association *asoc, asoc->ss_data.last_out_stream = NULL; } } + if (asoc->ss_data.locked_on_sending == strq) { + asoc->ss_data.locked_on_sending = NULL; + } TAILQ_REMOVE(&asoc->ss_data.out.wheel, strq, ss_params.ss.prio.next_spoke); strq->ss_params.scheduled = false; } @@ -635,6 +641,9 @@ sctp_ss_fb_remove(struct sctp_tcb *stcb, struct sctp_association *asoc, asoc->ss_data.last_out_stream = NULL; } } + if (asoc->ss_data.locked_on_sending == strq) { + asoc->ss_data.locked_on_sending = NULL; + } TAILQ_REMOVE(&asoc->ss_data.out.wheel, strq, ss_params.ss.fb.next_spoke); strq->ss_params.scheduled = false; } From owner-dev-commits-src-main@freebsd.org Sat Oct 2 00:58:31 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 69E81671A98; Sat, 2 Oct 2021 00:58:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HLpWW2crbz3sjg; Sat, 2 Oct 2021 00:58:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 38205163A; Sat, 2 Oct 2021 00:58:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1920wVNV045060; Sat, 2 Oct 2021 00:58:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1920wVqR045059; Sat, 2 Oct 2021 00:58:31 GMT (envelope-from git) Date: Sat, 2 Oct 2021 00:58:31 GMT Message-Id: <202110020058.1920wVqR045059@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mateusz Guzik Subject: git: ef7d2c1fc160 - main - nfs: eliminate thread argument from nfsvno_namei MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mjg X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ef7d2c1fc1605acdbffb233925ab69f8d57de22a Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 02 Oct 2021 00:58:31 -0000 The branch main has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=ef7d2c1fc1605acdbffb233925ab69f8d57de22a commit ef7d2c1fc1605acdbffb233925ab69f8d57de22a Author: Mateusz Guzik AuthorDate: 2021-10-01 21:20:15 +0000 Commit: Mateusz Guzik CommitDate: 2021-10-02 00:57:20 +0000 nfs: eliminate thread argument from nfsvno_namei This is a step towards retiring struct componentname cn_thread Reviewed by: rmacklem Differential Revision: https://reviews.freebsd.org/D32267 --- sys/fs/nfs/nfs_var.h | 2 +- sys/fs/nfsserver/nfs_nfsdport.c | 4 ++-- sys/fs/nfsserver/nfs_nfsdserv.c | 24 ++++++++++++------------ 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/sys/fs/nfs/nfs_var.h b/sys/fs/nfs/nfs_var.h index bae4affa72e2..ebb23d28420b 100644 --- a/sys/fs/nfs/nfs_var.h +++ b/sys/fs/nfs/nfs_var.h @@ -686,7 +686,7 @@ int nfsvno_getfh(vnode_t, fhandle_t *, NFSPROC_T *); int nfsvno_accchk(vnode_t, accmode_t, struct ucred *, struct nfsexstuff *, NFSPROC_T *, int, int, u_int32_t *); int nfsvno_namei(struct nfsrv_descript *, struct nameidata *, - vnode_t, int, struct nfsexstuff *, NFSPROC_T *, vnode_t *); + vnode_t, int, struct nfsexstuff *, vnode_t *); void nfsvno_setpathbuf(struct nameidata *, char **, u_long **); void nfsvno_relpathbuf(struct nameidata *); int nfsvno_readlink(vnode_t, struct ucred *, int, NFSPROC_T *, struct mbuf **, diff --git a/sys/fs/nfsserver/nfs_nfsdport.c b/sys/fs/nfsserver/nfs_nfsdport.c index 9250c0ce0a23..49cbd2c9de0f 100644 --- a/sys/fs/nfsserver/nfs_nfsdport.c +++ b/sys/fs/nfsserver/nfs_nfsdport.c @@ -594,7 +594,7 @@ nfsvno_setattr(struct vnode *vp, struct nfsvattr *nvap, struct ucred *cred, */ int nfsvno_namei(struct nfsrv_descript *nd, struct nameidata *ndp, - struct vnode *dp, int islocked, struct nfsexstuff *exp, struct thread *p, + struct vnode *dp, int islocked, struct nfsexstuff *exp, struct vnode **retdirp) { struct componentname *cnp = &ndp->ni_cnd; @@ -661,7 +661,7 @@ nfsvno_namei(struct nfsrv_descript *nd, struct nameidata *ndp, * because lookup() will dereference ni_startdir. */ - cnp->cn_thread = p; + cnp->cn_thread = curthread; ndp->ni_startdir = dp; ndp->ni_rootdir = rootvnode; ndp->ni_topdir = NULL; diff --git a/sys/fs/nfsserver/nfs_nfsdserv.c b/sys/fs/nfsserver/nfs_nfsdserv.c index 4394d3033fce..3b2e6c82276d 100644 --- a/sys/fs/nfsserver/nfs_nfsdserv.c +++ b/sys/fs/nfsserver/nfs_nfsdserv.c @@ -612,7 +612,7 @@ nfsrvd_lookup(struct nfsrv_descript *nd, __unused int isdgram, goto out; } if (!nd->nd_repstat) { - nd->nd_repstat = nfsvno_namei(nd, &named, dp, 0, exp, p, &dirp); + nd->nd_repstat = nfsvno_namei(nd, &named, dp, 0, exp, &dirp); } else { vrele(dp); nfsvno_relpathbuf(&named); @@ -1214,7 +1214,7 @@ nfsrvd_create(struct nfsrv_descript *nd, __unused int isdgram, goto out; } - nd->nd_repstat = nfsvno_namei(nd, &named, dp, 1, exp, p, &dirp); + nd->nd_repstat = nfsvno_namei(nd, &named, dp, 1, exp, &dirp); if (dirp) { if (nd->nd_flag & ND_NFSV2) { vrele(dirp); @@ -1420,7 +1420,7 @@ nfsrvd_mknod(struct nfsrv_descript *nd, __unused int isdgram, if (vtyp == VDIR) named.ni_cnd.cn_flags |= WILLBEDIR; - nd->nd_repstat = nfsvno_namei(nd, &named, dp, 0, exp, p, &dirp); + nd->nd_repstat = nfsvno_namei(nd, &named, dp, 0, exp, &dirp); if (nd->nd_repstat) { if (dirp) { if (nd->nd_flag & ND_NFSV3) @@ -1543,7 +1543,7 @@ nfsrvd_remove(struct nfsrv_descript *nd, __unused int isdgram, goto out; } if (!nd->nd_repstat) { - nd->nd_repstat = nfsvno_namei(nd, &named, dp, 1, exp, p, &dirp); + nd->nd_repstat = nfsvno_namei(nd, &named, dp, 1, exp, &dirp); } else { vput(dp); nfsvno_relpathbuf(&named); @@ -1717,7 +1717,7 @@ nfsrvd_rename(struct nfsrv_descript *nd, int isdgram, /* * Done parsing, now down to business. */ - nd->nd_repstat = nfsvno_namei(nd, &fromnd, dp, 0, exp, p, &fdirp); + nd->nd_repstat = nfsvno_namei(nd, &fromnd, dp, 0, exp, &fdirp); if (nd->nd_repstat) { if (nd->nd_flag & ND_NFSV3) { nfsrv_wcc(nd, fdirfor_ret, &fdirfor, fdiraft_ret, @@ -1734,7 +1734,7 @@ nfsrvd_rename(struct nfsrv_descript *nd, int isdgram, } if (vnode_vtype(fromnd.ni_vp) == VDIR) tond.ni_cnd.cn_flags |= WILLBEDIR; - nd->nd_repstat = nfsvno_namei(nd, &tond, tdp, 0, &tnes, p, &tdirp); + nd->nd_repstat = nfsvno_namei(nd, &tond, tdp, 0, &tnes, &tdirp); nd->nd_repstat = nfsvno_rename(&fromnd, &tond, nd->nd_repstat, nd->nd_flag, nd->nd_cred, p); if (fdirp) @@ -1829,7 +1829,7 @@ nfsrvd_link(struct nfsrv_descript *nd, int isdgram, } if (!nd->nd_repstat) { nd->nd_repstat = nfsvno_namei(nd, &named, dp, 0, &tnes, - p, &dirp); + &dirp); } else { if (dp) vrele(dp); @@ -1904,7 +1904,7 @@ nfsrvd_symlink(struct nfsrv_descript *nd, __unused int isdgram, goto out; } if (!nd->nd_repstat) { - nd->nd_repstat = nfsvno_namei(nd, &named, dp, 0, exp, p, &dirp); + nd->nd_repstat = nfsvno_namei(nd, &named, dp, 0, exp, &dirp); } else { vrele(dp); nfsvno_relpathbuf(&named); @@ -2028,7 +2028,7 @@ nfsrvd_mkdir(struct nfsrv_descript *nd, __unused int isdgram, } } if (!nd->nd_repstat) { - nd->nd_repstat = nfsvno_namei(nd, &named, dp, 0, exp, p, &dirp); + nd->nd_repstat = nfsvno_namei(nd, &named, dp, 0, exp, &dirp); } else { vrele(dp); nfsvno_relpathbuf(&named); @@ -3030,7 +3030,7 @@ nfsrvd_open(struct nfsrv_descript *nd, __unused int isdgram, } if (!nd->nd_repstat) { nd->nd_repstat = nfsvno_namei(nd, &named, dp, 0, exp, - p, &dirp); + &dirp); } else { vrele(dp); nfsvno_relpathbuf(&named); @@ -3688,7 +3688,7 @@ nfsrvd_secinfo(struct nfsrv_descript *nd, int isdgram, goto out; } if (!nd->nd_repstat) { - nd->nd_repstat = nfsvno_namei(nd, &named, dp, 1, exp, p, &dirp); + nd->nd_repstat = nfsvno_namei(nd, &named, dp, 1, exp, &dirp); } else { vput(dp); nfsvno_relpathbuf(&named); @@ -3822,7 +3822,7 @@ nfsrvd_secinfononame(struct nfsrv_descript *nd, int isdgram, goto nfsmout; } if (nd->nd_repstat == 0) - nd->nd_repstat = nfsvno_namei(nd, &named, dp, 1, exp, p, &dirp); + nd->nd_repstat = nfsvno_namei(nd, &named, dp, 1, exp, &dirp); else vput(dp); if (dirp != NULL) From owner-dev-commits-src-main@freebsd.org Sat Oct 2 01:18:31 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8D802671F0D; Sat, 2 Oct 2021 01:18:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HLpyb3bg9z3t9s; Sat, 2 Oct 2021 01:18:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5B36B1BCC; Sat, 2 Oct 2021 01:18:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1921IVI7072394; Sat, 2 Oct 2021 01:18:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1921IVr5072393; Sat, 2 Oct 2021 01:18:31 GMT (envelope-from git) Date: Sat, 2 Oct 2021 01:18:31 GMT Message-Id: <202110020118.1921IVr5072393@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 83581511d947 - main - nvme: Use adaptive spinning when polling for completion or state change MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 83581511d9476ef5084f47e3cc379be7191ae866 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 02 Oct 2021 01:18:31 -0000 The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=83581511d9476ef5084f47e3cc379be7191ae866 commit 83581511d9476ef5084f47e3cc379be7191ae866 Author: Warner Losh AuthorDate: 2021-10-01 17:32:48 +0000 Commit: Warner Losh CommitDate: 2021-10-02 01:17:55 +0000 nvme: Use adaptive spinning when polling for completion or state change We only use nvme_completion_poll in the initialization path. The commands they queue and wait for finish quickly as they involve no I/O to the drive's media. These command take about 20-200 microsecnds each. Set the wait time to 1us and then increase it by 1.5 each successive iteration (max 1ms). This reduces initialization time by 80ms in cpervica's tests. Use this same technique waiting for RDY state transitions. This saves another 20ms. In total we're down from ~330ms to ~2ms. Tested by: cperciva Sponsored by: Netflix Reviewed by: mav Differential Review: https://reviews.freebsd.org/D32259 --- sys/dev/nvme/nvme_ctrlr.c | 11 ++++++++++- sys/dev/nvme/nvme_private.h | 35 +++++++++++++++++++++-------------- 2 files changed, 31 insertions(+), 15 deletions(-) diff --git a/sys/dev/nvme/nvme_ctrlr.c b/sys/dev/nvme/nvme_ctrlr.c index ca89e99d2934..aa41c8fe5540 100644 --- a/sys/dev/nvme/nvme_ctrlr.c +++ b/sys/dev/nvme/nvme_ctrlr.c @@ -260,10 +260,17 @@ nvme_ctrlr_fail_req_task(void *arg, int pending) mtx_unlock(&ctrlr->lock); } +/* + * Wait for RDY to change. + * + * Starts sleeping for 1us and geometrically increases it the longer we wait, + * capped at 1ms. + */ static int nvme_ctrlr_wait_for_ready(struct nvme_controller *ctrlr, int desired_val) { int timeout = ticks + MSEC_2_TICKS(ctrlr->ready_timeout_in_ms); + sbintime_t delta_t = SBT_1US; uint32_t csts; while (1) { @@ -278,7 +285,9 @@ nvme_ctrlr_wait_for_ready(struct nvme_controller *ctrlr, int desired_val) "within %d ms\n", desired_val, ctrlr->ready_timeout_in_ms); return (ENXIO); } - pause("nvmerdy", 1); + + pause_sbt("nvmerdy", delta_t, 0, C_PREL(1)); + delta_t = min(SBT_1MS, delta_t * 3 / 2); } return (0); diff --git a/sys/dev/nvme/nvme_private.h b/sys/dev/nvme/nvme_private.h index b00130910a82..9c7c1b46eab4 100644 --- a/sys/dev/nvme/nvme_private.h +++ b/sys/dev/nvme/nvme_private.h @@ -455,25 +455,32 @@ int nvme_shutdown(device_t dev); int nvme_detach(device_t dev); /* - * Wait for a command to complete using the nvme_completion_poll_cb. - * Used in limited contexts where the caller knows it's OK to block - * briefly while the command runs. The ISR will run the callback which - * will set status->done to true, usually within microseconds. If not, - * then after one second timeout handler should reset the controller - * and abort all outstanding requests including this polled one. If - * still not after ten seconds, then something is wrong with the driver, - * and panic is the only way to recover. + * Wait for a command to complete using the nvme_completion_poll_cb. Used in + * limited contexts where the caller knows it's OK to block briefly while the + * command runs. The ISR will run the callback which will set status->done to + * true, usually within microseconds. If not, then after one second timeout + * handler should reset the controller and abort all outstanding requests + * including this polled one. If still not after ten seconds, then something is + * wrong with the driver, and panic is the only way to recover. + * + * Most commands using this interface aren't actual I/O to the drive's media so + * complete within a few microseconds. Adaptively spin for one tick to catch the + * vast majority of these without waiting for a tick plus scheduling delays. Since + * these are on startup, this drastically reduces startup time. */ static __inline void nvme_completion_poll(struct nvme_completion_poll_status *status) { - int sanity = hz * 10; - - while (!atomic_load_acq_int(&status->done) && --sanity > 0) - pause("nvme", 1); - if (sanity <= 0) - panic("NVME polled command failed to complete within 10s."); + int timeout = ticks + 10 * hz; + sbintime_t delta_t = SBT_1US; + + while (!atomic_load_acq_int(&status->done)) { + if (timeout - ticks < 0) + panic("NVME polled command failed to complete within 10s."); + pause_sbt("nvme", delta_t, 0, C_PREL(1)); + delta_t = min(SBT_1MS, delta_t * 3 / 2); + } } static __inline void From owner-dev-commits-src-main@freebsd.org Sat Oct 2 02:54:47 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A35C3672FBC; Sat, 2 Oct 2021 02:54:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HLs5g3wv6z4ZLv; Sat, 2 Oct 2021 02:54:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 66B122EE7; Sat, 2 Oct 2021 02:54:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1922slDA004050; Sat, 2 Oct 2021 02:54:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1922siPf004049; Sat, 2 Oct 2021 02:54:44 GMT (envelope-from git) Date: Sat, 2 Oct 2021 02:54:44 GMT Message-Id: <202110020254.1922siPf004049@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Philip Paeps Subject: git: 93d120dbc0d0 - main - contrib/tzdata: import tzdata 2021c MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: philip X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 93d120dbc0d039ebd3d421aad169b6a2e3ac7dbe Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 02 Oct 2021 02:54:47 -0000 The branch main has been updated by philip: URL: https://cgit.FreeBSD.org/src/commit/?id=93d120dbc0d039ebd3d421aad169b6a2e3ac7dbe commit 93d120dbc0d039ebd3d421aad169b6a2e3ac7dbe Merge: 83581511d947 9530c11c3570 Author: Philip Paeps AuthorDate: 2021-10-02 02:52:02 +0000 Commit: Philip Paeps CommitDate: 2021-10-02 02:52:02 +0000 contrib/tzdata: import tzdata 2021c Merge commit '9530c11c35707c2ed4a95aa90097b30f8a230563' Changes: https://github.com/eggert/tz/blob/2021c/NEWS MFC after: 3 days contrib/tzdata/Makefile | 6 +-- contrib/tzdata/NEWS | 50 ++++++++++++++++++++---- contrib/tzdata/SECURITY | 15 ++++++++ contrib/tzdata/africa | 37 ++++++++++++++++++ contrib/tzdata/asia | 10 ++++- contrib/tzdata/australasia | 5 +++ contrib/tzdata/backward | 93 +-------------------------------------------- contrib/tzdata/backzone | 1 + contrib/tzdata/europe | 26 ++++++++++--- contrib/tzdata/northamerica | 26 ++++++++++++- contrib/tzdata/southamerica | 4 +- contrib/tzdata/version | 2 +- 12 files changed, 163 insertions(+), 112 deletions(-) diff --cc contrib/tzdata/Makefile index 33f31684114b,000000000000..a2220986796c mode 100644,000000..100644 --- a/contrib/tzdata/Makefile +++ b/contrib/tzdata/Makefile @@@ -1,1143 -1,0 +1,1143 @@@ +# Make and install tzdb code and data. + +# This file is in the public domain, so clarified as of +# 2009-05-17 by Arthur David Olson. + +# Package name for the code distribution. +PACKAGE= tzcode + +# Version number for the distribution, overridden in the 'tarballs' rule below. +VERSION= unknown + +# Email address for bug reports. +BUGEMAIL= tz@iana.org + +# DATAFORM selects the data format. +# Available formats represent essentially the same data, albeit +# possibly with minor discrepancies that users are not likely to notice. +# To get new features and the best data right away, use: +# DATAFORM= vanguard +# To wait a while before using new features, to give downstream users +# time to upgrade zic (the default), use: +# DATAFORM= main +# To wait even longer for new features, use: +# DATAFORM= rearguard +# Rearguard users might also want "ZFLAGS = -b fat"; see below. +DATAFORM= main + +# Change the line below for your timezone (after finding the one you want in +# one of the $(TDATA) source files, or adding it to a source file). +# Alternatively, if you discover you've got the wrong timezone, you can just +# 'zic -l -' to remove it, or 'zic -l rightzone' to change it. +# Use the command +# make zonenames +# to get a list of the values you can use for LOCALTIME. + +LOCALTIME= GMT + +# The POSIXRULES macro controls interpretation of nonstandard and obsolete +# POSIX-like TZ settings like TZ='EET-2EEST' that lack DST transition rules. +# Such a setting uses the rules in a template file to determine +# "spring forward" and "fall back" days and times; the environment +# variable itself specifies UT offsets of standard and daylight saving time. +# +# If POSIXRULES is '-', no template is installed; this is the default. +# +# Any other value for POSIXRULES is obsolete and should not be relied on, as: +# * It does not work correctly in popular implementations such as GNU/Linux. +# * It does not work even in tzcode, except for historical timestamps +# that precede the last explicit transition in the POSIXRULES file. +# Hence it typically does not work for current and future timestamps. +# In short, software should avoid ruleless settings like TZ='EET-2EEST' +# and so should not depend on the value of POSIXRULES. +# +# If, despite the above, you want a template for handling these settings, +# you can change the line below (after finding the timezone you want in the +# one of the $(TDATA) source files, or adding it to a source file). +# Alternatively, if you discover you've got the wrong timezone, you can just +# 'zic -p -' to remove it, or 'zic -p rightzone' to change it. +# Use the command +# make zonenames +# to get a list of the values you can use for POSIXRULES. + +POSIXRULES= - + +# Also see TZDEFRULESTRING below, which takes effect only +# if the time zone files cannot be accessed. + + +# Installation locations. +# +# The defaults are suitable for Debian, except that if REDO is +# posix_right or right_posix then files that Debian puts under +# /usr/share/zoneinfo/posix and /usr/share/zoneinfo/right are instead +# put under /usr/share/zoneinfo-posix and /usr/share/zoneinfo-leaps, +# respectively. Problems with the Debian approach are discussed in +# the commentary for the right_posix rule (below). + +# Destination directory, which can be used for staging. +# 'make DESTDIR=/stage install' installs under /stage (e.g., to +# /stage/etc/localtime instead of to /etc/localtime). Files under +# /stage are not intended to work as-is, but can be copied by hand to +# the root directory later. If DESTDIR is empty, 'make install' does +# not stage, but installs directly into production locations. +DESTDIR = + +# Everything is installed into subdirectories of TOPDIR, and used there. +# TOPDIR should be empty (meaning the root directory), +# or a directory name that does not end in "/". +# TOPDIR should be empty or an absolute name unless you're just testing. +TOPDIR = + +# The default local timezone is taken from the file TZDEFAULT. +TZDEFAULT = $(TOPDIR)/etc/localtime + +# The subdirectory containing installed program and data files, and +# likewise for installed files that can be shared among architectures. +# These should be relative file names. +USRDIR = usr +USRSHAREDIR = $(USRDIR)/share + +# "Compiled" timezone information is placed in the "TZDIR" directory +# (and subdirectories). +# TZDIR_BASENAME should not contain "/" and should not be ".", ".." or empty. +TZDIR_BASENAME= zoneinfo +TZDIR = $(TOPDIR)/$(USRSHAREDIR)/$(TZDIR_BASENAME) + +# The "tzselect" and (if you do "make INSTALL") "date" commands go in: +BINDIR = $(TOPDIR)/$(USRDIR)/bin + +# The "zdump" command goes in: +ZDUMPDIR = $(BINDIR) + +# The "zic" command goes in: +ZICDIR = $(TOPDIR)/$(USRDIR)/sbin + +# Manual pages go in subdirectories of. . . +MANDIR = $(TOPDIR)/$(USRSHAREDIR)/man + +# Library functions are put in an archive in LIBDIR. +LIBDIR = $(TOPDIR)/$(USRDIR)/lib + + +# Types to try, as an alternative to time_t. +TIME_T_ALTERNATIVES = $(TIME_T_ALTERNATIVES_HEAD) $(TIME_T_ALTERNATIVES_TAIL) +TIME_T_ALTERNATIVES_HEAD = int_least64_t +TIME_T_ALTERNATIVES_TAIL = int_least32_t uint_least32_t uint_least64_t + +# What kind of TZif data files to generate. (TZif is the binary time +# zone data format that zic generates; see Internet RFC 8536.) +# If you want only POSIX time, with time values interpreted as +# seconds since the epoch (not counting leap seconds), use +# REDO= posix_only +# below. If you want only "right" time, with values interpreted +# as seconds since the epoch (counting leap seconds), use +# REDO= right_only +# below. If you want both sets of data available, with leap seconds not +# counted normally, use +# REDO= posix_right +# below. If you want both sets of data available, with leap seconds counted +# normally, use +# REDO= right_posix +# below. POSIX mandates that leap seconds not be counted; for compatibility +# with it, use "posix_only" or "posix_right". Use POSIX time on systems with +# leap smearing; this can work better than unsmeared "right" time with +# applications that are not leap second aware, and is closer to unsmeared +# "right" time than unsmeared POSIX time is (e.g., 0.5 vs 1.0 s max error). + +REDO= posix_right + +# Whether to put an "Expires" line in the leapseconds file. +# Use EXPIRES_LINE=1 to put the line in, 0 to omit it. +# The EXPIRES_LINE value matters only if REDO's value contains "right". +# If you change EXPIRES_LINE, remove the leapseconds file before running "make". +# zic's support for the Expires line was introduced in tzdb 2020a, +# and was modified in tzdb 2021b to generate version 4 TZif files. +# EXPIRES_LINE defaults to 0 for now so that the leapseconds file +# can be given to pre-2020a zic implementations and so that TZif files +# built by newer zic implementations can be read by pre-2021b libraries. +EXPIRES_LINE= 0 + +# To install data in text form that has all the information of the TZif data, +# (optionally incorporating leap second information), use +# TZDATA_TEXT= tzdata.zi leapseconds +# To install text data without leap second information (e.g., because +# REDO='posix_only'), use +# TZDATA_TEXT= tzdata.zi +# To avoid installing text data, use +# TZDATA_TEXT= + +TZDATA_TEXT= leapseconds tzdata.zi + +# For backward-compatibility links for old zone names, use +# BACKWARD= backward +# To omit these links, use +# BACKWARD= + +BACKWARD= backward + +# If you want out-of-scope and often-wrong data from the file 'backzone', use +# PACKRATDATA= backzone +# To omit this data, use +# PACKRATDATA= + +PACKRATDATA= + +# The name of a locale using the UTF-8 encoding, used during self-tests. +# The tests are skipped if the name does not appear to work on this system. + +UTF8_LOCALE= en_US.utf8 + +# Non-default libraries needed to link. +LDLIBS= + +# Add the following to the end of the "CFLAGS=" line as needed to override +# defaults specified in the source code. "-DFOO" is equivalent to "-DFOO=1". +# -DDEPRECATE_TWO_DIGIT_YEARS for optional runtime warnings about strftime +# formats that generate only the last two digits of year numbers +# -DEPOCH_LOCAL if the 'time' function returns local time not UT +# -DEPOCH_OFFSET=N if the 'time' function returns a value N greater +# than what POSIX specifies, assuming local time is UT. +# For example, N is 252460800 on AmigaOS. +# -DHAVE_DECL_ASCTIME_R=0 if does not declare asctime_r +# -DHAVE_DECL_ENVIRON if declares 'environ' +# -DHAVE_DIRECT_H if mkdir needs (MS-Windows) +# -DHAVE_GENERIC=0 if _Generic does not work +# -DHAVE_GETTEXT if 'gettext' works (e.g., GNU/Linux, FreeBSD, Solaris) +# -DHAVE_INCOMPATIBLE_CTIME_R if your system's time.h declares +# ctime_r and asctime_r incompatibly with the POSIX standard +# (Solaris when _POSIX_PTHREAD_SEMANTICS is not defined). +# -DHAVE_INTTYPES_H if you have a non-C99 compiler with +# -DHAVE_LINK=0 if your system lacks a link function +# -DHAVE_LOCALTIME_R=0 if your system lacks a localtime_r function +# -DHAVE_LOCALTIME_RZ=0 if you do not want zdump to use localtime_rz +# localtime_rz can make zdump significantly faster, but is nonstandard. +# -DHAVE_MALLOC_ERRNO=0 if malloc etc. do not set errno on failure. +# -DHAVE_POSIX_DECLS=0 if your system's include files do not declare +# functions like 'link' or variables like 'tzname' required by POSIX +# -DHAVE_SNPRINTF=0 if your system lacks the snprintf function +# -DHAVE_STDBOOL_H if you have a non-C99 compiler with +# -DHAVE_STDINT_H if you have a non-C99 compiler with +# -DHAVE_STRFTIME_L if declares locale_t and strftime_l +# -DHAVE_STRDUP=0 if your system lacks the strdup function +# -DHAVE_STRTOLL=0 if your system lacks the strtoll function +# -DHAVE_SYMLINK=0 if your system lacks the symlink function +# -DHAVE_SYS_STAT_H=0 if your compiler lacks a +# -DHAVE_TZSET=0 if your system lacks a tzset function +# -DHAVE_UNISTD_H=0 if your compiler lacks a +# -Dlocale_t=XXX if your system uses XXX instead of locale_t +# -DRESERVE_STD_EXT_IDS if your platform reserves standard identifiers +# with external linkage, e.g., applications cannot define 'localtime'. +# -Dssize_t=long on hosts like MS-Windows that lack ssize_t +# -DSUPPRESS_TZDIR to not prepend TZDIR to file names; this has +# security implications and is not recommended for general use +# -DTHREAD_SAFE to make localtime.c thread-safe, as POSIX requires; +# not needed by the main-program tz code, which is single-threaded. +# Append other compiler flags as needed, e.g., -pthread on GNU/Linux. +# -Dtime_tz=\"T\" to use T as the time_t type, rather than the system time_t +# This is intended for internal use only; it mangles external names. +# -DTZ_DOMAIN=\"foo\" to use "foo" for gettext domain name; default is "tz" +# -DTZ_DOMAINDIR=\"/path\" to use "/path" for gettext directory; +# the default is system-supplied, typically "/usr/lib/locale" +# -DTZDEFRULESTRING=\",date/time,date/time\" to default to the specified +# DST transitions if the time zone files cannot be accessed +# -DUNINIT_TRAP if reading uninitialized storage can cause problems +# other than simply getting garbage data +# -DUSE_LTZ=0 to build zdump with the system time zone library +# Also set TZDOBJS=zdump.o and CHECK_TIME_T_ALTERNATIVES= below. +# -DZIC_BLOAT_DEFAULT=\"fat\" to default zic's -b option to "fat", and +# similarly for "slim". Fat TZif files work around incompatibilities +# and bugs in some TZif readers, notably readers that mishandle 64-bit +# data in TZif files. Slim TZif files are more efficient and do not +# work around these incompatibilities and bugs. If not given, the +# default is "slim". +# -DZIC_MAX_ABBR_LEN_WO_WARN=3 +# (or some other number) to set the maximum time zone abbreviation length +# that zic will accept without a warning (the default is 6) +# $(GCC_DEBUG_FLAGS) if you are using recent GCC and want lots of checking +# Select instrumentation via "make GCC_INSTRUMENT='whatever'". +GCC_INSTRUMENT = \ + -fsanitize=undefined -fsanitize-address-use-after-scope \ + -fsanitize-undefined-trap-on-error -fstack-protector +# Omit -fanalyzer from GCC_DEBUG_FLAGS, as it makes GCC too slow. +GCC_DEBUG_FLAGS = -DGCC_LINT -g3 -O3 -fno-common \ + $(GCC_INSTRUMENT) \ + -Wall -Wextra \ + -Walloc-size-larger-than=100000 -Warray-bounds=2 \ + -Wbad-function-cast -Wcast-align=strict -Wdate-time \ + -Wdeclaration-after-statement -Wdouble-promotion \ + -Wduplicated-branches -Wduplicated-cond \ + -Wformat=2 -Wformat-overflow=2 -Wformat-signedness -Wformat-truncation \ + -Winit-self -Wlogical-op \ + -Wmissing-declarations -Wmissing-prototypes -Wnested-externs \ + -Wnull-dereference \ + -Wold-style-definition -Woverlength-strings -Wpointer-arith \ + -Wshadow -Wshift-overflow=2 -Wstrict-overflow \ + -Wstrict-prototypes -Wstringop-overflow=4 \ + -Wstringop-truncation -Wsuggest-attribute=cold \ + -Wsuggest-attribute=const -Wsuggest-attribute=format \ + -Wsuggest-attribute=malloc \ + -Wsuggest-attribute=noreturn -Wsuggest-attribute=pure \ + -Wtrampolines -Wundef -Wuninitialized -Wunused-macros \ + -Wvariadic-macros -Wvla -Wwrite-strings \ + -Wno-address -Wno-format-nonliteral -Wno-sign-compare \ + -Wno-type-limits -Wno-unused-parameter +# +# If your system has a "GMT offset" field in its "struct tm"s +# (or if you decide to add such a field in your system's "time.h" file), +# add the name to a define such as +# -DTM_GMTOFF=tm_gmtoff +# to the end of the "CFLAGS=" line. If not defined, the code attempts to +# guess TM_GMTOFF from other macros; define NO_TM_GMTOFF to suppress this. +# Similarly, if your system has a "zone abbreviation" field, define +# -DTM_ZONE=tm_zone +# and define NO_TM_ZONE to suppress any guessing. These two fields are not +# required by POSIX, but are widely available on GNU/Linux and BSD systems. +# +# The next batch of options control support for external variables +# exported by tzcode. In practice these variables are less useful +# than TM_GMTOFF and TM_ZONE. However, most of them are standardized. +# # +# # To omit or support the external variable "tzname", add one of: +# # -DHAVE_TZNAME=0 # do not support "tzname" +# # -DHAVE_TZNAME=1 # support "tzname", which is defined by system library +# # -DHAVE_TZNAME=2 # support and define "tzname" +# # to the "CFLAGS=" line. "tzname" is required by POSIX 1988 and later. +# # If not defined, the code attempts to guess HAVE_TZNAME from other macros. +# # Warning: unless time_tz is also defined, HAVE_TZNAME=1 can cause +# # crashes when combined with some platforms' standard libraries, +# # presumably due to memory allocation issues. +# # +# # To omit or support the external variables "timezone" and "daylight", add +# # -DUSG_COMPAT=0 # do not support +# # -DUSG_COMPAT=1 # support, and variables are defined by system library +# # -DUSG_COMPAT=2 # support and define variables +# # to the "CFLAGS=" line; "timezone" and "daylight" are inspired by +# # Unix Systems Group code and are required by POSIX 2008 (with XSI) and later. +# # If not defined, the code attempts to guess USG_COMPAT from other macros. +# # +# # To support the external variable "altzone", add +# # -DALTZONE=0 # do not support +# # -DALTZONE=1 # support "altzone", which is defined by system library +# # -DALTZONE=2 # support and define "altzone" +# # to the end of the "CFLAGS=" line; although "altzone" appeared in +# # System V Release 3.1 it has not been standardized. +# # If not defined, the code attempts to guess ALTZONE from other macros. +# +# If you want functions that were inspired by early versions of X3J11's work, +# add +# -DSTD_INSPIRED +# to the end of the "CFLAGS=" line. This arranges for the functions +# "offtime", "timelocal", "timegm", "timeoff", +# "posix2time", and "time2posix" to be added to the time conversion library. +# "offtime" is like "gmtime" except that it accepts a second (long) argument +# that gives an offset to add to the time_t when converting it. +# "timelocal" is equivalent to "mktime". +# "timegm" is like "timelocal" except that it turns a struct tm into +# a time_t using UT (rather than local time as "timelocal" does). +# "timeoff" is like "timegm" except that it accepts a second (long) argument +# that gives an offset to use when converting to a time_t. +# "posix2time" and "time2posix" are described in an included manual page. +# X3J11's work does not describe any of these functions. +# These functions may well disappear in future releases of the time +# conversion package. +# +# If you don't want functions that were inspired by NetBSD, add +# -DNETBSD_INSPIRED=0 +# to the end of the "CFLAGS=" line. Otherwise, the functions +# "localtime_rz", "mktime_z", "tzalloc", and "tzfree" are added to the +# time library, and if STD_INSPIRED is also defined the functions +# "posix2time_z" and "time2posix_z" are added as well. +# The functions ending in "_z" (or "_rz") are like their unsuffixed +# (or suffixed-by-"_r") counterparts, except with an extra first +# argument of opaque type timezone_t that specifies the timezone. +# "tzalloc" allocates a timezone_t value, and "tzfree" frees it. +# +# If you want to allocate state structures in localtime, add +# -DALL_STATE +# to the end of the "CFLAGS=" line. Storage is obtained by calling malloc. +# +# NIST-PCTS:151-2, Version 1.4, (1993-12-03) is a test suite put +# out by the National Institute of Standards and Technology +# which claims to test C and Posix conformance. If you want to pass PCTS, add +# -DPCTS +# to the end of the "CFLAGS=" line. +# +# If you want strict compliance with XPG4 as of 1994-04-09, add +# -DXPG4_1994_04_09 +# to the end of the "CFLAGS=" line. This causes "strftime" to always return +# 53 as a week number (rather than 52 or 53) for January days before +# January's first Monday when a "%V" format is used and January 1 +# falls on a Friday, Saturday, or Sunday. + +CFLAGS= + +# Linker flags. Default to $(LFLAGS) for backwards compatibility +# to release 2012h and earlier. + +LDFLAGS= $(LFLAGS) + +# For leap seconds, this Makefile uses LEAPSECONDS='-L leapseconds' in +# submake command lines. The default is no leap seconds. + +LEAPSECONDS= + +# The zic command and its arguments. + +zic= ./zic +ZIC= $(zic) $(ZFLAGS) + +# To shrink the size of installed TZif files, +# append "-r @N" to omit data before N-seconds-after-the-Epoch. +# To grow the files and work around older application bugs, append "-b fat"; +# see ZIC_BLOAT_DEFAULT above. +# See the zic man page for more about -b and -r. +ZFLAGS= + +# How to use zic to install TZif files. + +ZIC_INSTALL= $(ZIC) -d '$(DESTDIR)$(TZDIR)' $(LEAPSECONDS) + +# The name of a Posix-compliant 'awk' on your system. +# Older 'mawk' versions, such as the 'mawk' in Ubuntu 16.04, might dump core; +# on Ubuntu you can work around this with +# AWK= gawk +AWK= awk + +# The full path name of a Posix-compliant shell, preferably one that supports +# the Korn shell's 'select' statement as an extension. +# These days, Bash is the most popular. +# It should be OK to set this to /bin/sh, on platforms where /bin/sh +# lacks 'select' or doesn't completely conform to Posix, but /bin/bash +# is typically nicer if it works. +KSHELL= /bin/bash + +# Name of curl , used for HTML validation. +CURL= curl + +# Name of GNU Privacy Guard , used to sign distributions. +GPG= gpg + +# This expensive test requires USE_LTZ. +# To suppress it, define this macro to be empty. +CHECK_TIME_T_ALTERNATIVES = check_time_t_alternatives + +# SAFE_CHAR is a regular expression that matches a safe character. +# Some parts of this distribution are limited to safe characters; +# others can use any UTF-8 character. +# For now, the safe characters are a safe subset of ASCII. +# The caller must set the shell variable 'sharp' to the character '#', +# since Makefile macros cannot contain '#'. +# TAB_CHAR is a single tab character, in single quotes. +TAB_CHAR= ' ' +SAFE_CHARSET1= $(TAB_CHAR)' !\"'$$sharp'$$%&'\''()*+,./0123456789:;<=>?@' +SAFE_CHARSET2= 'ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\^_`' +SAFE_CHARSET3= 'abcdefghijklmnopqrstuvwxyz{|}~' +SAFE_CHARSET= $(SAFE_CHARSET1)$(SAFE_CHARSET2)$(SAFE_CHARSET3) +SAFE_CHAR= '[]'$(SAFE_CHARSET)'-]' + +# These characters are Latin-1, and so are likely to be displayable +# even in editors with limited character sets. +UNUSUAL_OK_LATIN_1 = «°±»½¾× +# This IPA symbol is represented in Unicode as the composition of +# U+0075 and U+032F, and U+032F is not considered alphabetic by some +# grep implementations that do not grok composition. +UNUSUAL_OK_IPA = u̯ +# Non-ASCII non-letters that OK_CHAR allows, as these characters are +# useful in commentary. +UNUSUAL_OK_CHARSET= $(UNUSUAL_OK_LATIN_1)$(UNUSUAL_OK_IPA) + +# OK_CHAR matches any character allowed in the distributed files. +# This is the same as SAFE_CHAR, except that UNUSUAL_OK_CHARSET and +# multibyte letters are also allowed so that commentary can contain a +# few safe symbols and people's names and can quote non-English sources. +# Other non-letters are limited to ASCII renderings for the +# convenience of maintainers using XEmacs 21.5.34, which by default +# mishandles Unicode characters U+0100 and greater. +OK_CHAR= '[][:alpha:]$(UNUSUAL_OK_CHARSET)'$(SAFE_CHARSET)'-]' + +# SAFE_LINE matches a line of safe characters. +# SAFE_SHARP_LINE is similar, except any OK character can follow '#'; +# this is so that comments can contain non-ASCII characters. +# OK_LINE matches a line of OK characters. +SAFE_LINE= '^'$(SAFE_CHAR)'*$$' +SAFE_SHARP_LINE='^'$(SAFE_CHAR)'*('$$sharp$(OK_CHAR)'*)?$$' +OK_LINE= '^'$(OK_CHAR)'*$$' + +# Flags to give 'tar' when making a distribution. +# Try to use flags appropriate for GNU tar. +GNUTARFLAGS= --numeric-owner --owner=0 --group=0 --mode=go+u,go-w --sort=name +TARFLAGS= `if tar $(GNUTARFLAGS) --version >/dev/null 2>&1; \ + then echo $(GNUTARFLAGS); \ + else :; \ + fi` + +# Flags to give 'gzip' when making a distribution. +GZIPFLAGS= -9n + +############################################################################### + +#MAKE= make + +cc= cc +CC= $(cc) -DTZDIR='"$(TZDIR)"' + +AR= ar + +# ':' on typical hosts; 'ranlib' on the ancient hosts that still need ranlib. +RANLIB= : + +TZCOBJS= zic.o +TZDOBJS= zdump.o localtime.o asctime.o strftime.o +DATEOBJS= date.o localtime.o strftime.o asctime.o +LIBSRCS= localtime.c asctime.c difftime.c strftime.c +LIBOBJS= localtime.o asctime.o difftime.o strftime.o +HEADERS= tzfile.h private.h +NONLIBSRCS= zic.c zdump.c +NEWUCBSRCS= date.c +SOURCES= $(HEADERS) $(LIBSRCS) $(NONLIBSRCS) $(NEWUCBSRCS) \ + tzselect.ksh workman.sh +MANS= newctime.3 newstrftime.3 newtzset.3 time2posix.3 \ + tzfile.5 tzselect.8 zic.8 zdump.8 +MANTXTS= newctime.3.txt newstrftime.3.txt newtzset.3.txt \ + time2posix.3.txt \ + tzfile.5.txt tzselect.8.txt zic.8.txt zdump.8.txt \ + date.1.txt +COMMON= calendars CONTRIBUTING LICENSE Makefile \ - NEWS README theory.html version ++ NEWS README SECURITY theory.html version +WEB_PAGES= tz-art.html tz-how-to.html tz-link.html +CHECK_WEB_PAGES=check_theory.html check_tz-art.html \ + check_tz-how-to.html check_tz-link.html +DOCS= $(MANS) date.1 $(MANTXTS) $(WEB_PAGES) +PRIMARY_YDATA= africa antarctica asia australasia \ + europe northamerica southamerica +YDATA= $(PRIMARY_YDATA) etcetera +NDATA= factory +TDATA_TO_CHECK= $(YDATA) $(NDATA) backward +TDATA= $(YDATA) $(NDATA) $(BACKWARD) +ZONETABLES= zone1970.tab zone.tab +TABDATA= iso3166.tab $(TZDATA_TEXT) $(ZONETABLES) +LEAP_DEPS= leapseconds.awk leap-seconds.list +TZDATA_ZI_DEPS= ziguard.awk zishrink.awk version $(TDATA) $(PACKRATDATA) +DSTDATA_ZI_DEPS= ziguard.awk $(TDATA) $(PACKRATDATA) +DATA= $(TDATA_TO_CHECK) backzone iso3166.tab leap-seconds.list \ + leapseconds $(ZONETABLES) +AWK_SCRIPTS= checklinks.awk checktab.awk leapseconds.awk \ + ziguard.awk zishrink.awk +MISC= $(AWK_SCRIPTS) zoneinfo2tdf.pl +TZS_YEAR= 2050 +TZS_CUTOFF_FLAG= -c $(TZS_YEAR) +TZS= to$(TZS_YEAR).tzs +TZS_NEW= to$(TZS_YEAR)new.tzs +TZS_DEPS= $(YDATA) asctime.c localtime.c \ + private.h tzfile.h zdump.c zic.c +# EIGHT_YARDS is just a yard short of the whole ENCHILADA. +EIGHT_YARDS = $(COMMON) $(DOCS) $(SOURCES) $(DATA) $(MISC) tzdata.zi +ENCHILADA = $(EIGHT_YARDS) $(TZS) + +# Consult these files when deciding whether to rebuild the 'version' file. +# This list is not the same as the output of 'git ls-files', since +# .gitignore is not distributed. +VERSION_DEPS= \ - calendars CONTRIBUTING LICENSE Makefile NEWS README \ ++ calendars CONTRIBUTING LICENSE Makefile NEWS README SECURITY \ + africa antarctica asctime.c asia australasia \ + backward backzone \ + checklinks.awk checktab.awk \ + date.1 date.c difftime.c \ + etcetera europe factory iso3166.tab \ + leap-seconds.list leapseconds.awk localtime.c \ + newctime.3 newstrftime.3 newtzset.3 northamerica \ + private.h southamerica strftime.c theory.html \ + time2posix.3 tz-art.html tz-how-to.html tz-link.html \ + tzfile.5 tzfile.h tzselect.8 tzselect.ksh \ + workman.sh zdump.8 zdump.c zic.8 zic.c \ + ziguard.awk zishrink.awk \ + zone.tab zone1970.tab zoneinfo2tdf.pl + +# And for the benefit of csh users on systems that assume the user +# shell should be used to handle commands in Makefiles. . . + +SHELL= /bin/sh + +all: tzselect zic zdump libtz.a $(TABDATA) \ + vanguard.zi main.zi rearguard.zi + +ALL: all date $(ENCHILADA) + +install: all $(DATA) $(REDO) $(MANS) + mkdir -p '$(DESTDIR)$(BINDIR)' \ + '$(DESTDIR)$(ZDUMPDIR)' '$(DESTDIR)$(ZICDIR)' \ + '$(DESTDIR)$(LIBDIR)' \ + '$(DESTDIR)$(MANDIR)/man3' '$(DESTDIR)$(MANDIR)/man5' \ + '$(DESTDIR)$(MANDIR)/man8' + $(ZIC_INSTALL) -l $(LOCALTIME) \ + `case '$(POSIXRULES)' in ?*) echo '-p';; esac \ + ` $(POSIXRULES) \ + -t '$(DESTDIR)$(TZDEFAULT)' + cp -f $(TABDATA) '$(DESTDIR)$(TZDIR)/.' + cp tzselect '$(DESTDIR)$(BINDIR)/.' + cp zdump '$(DESTDIR)$(ZDUMPDIR)/.' + cp zic '$(DESTDIR)$(ZICDIR)/.' + cp libtz.a '$(DESTDIR)$(LIBDIR)/.' + $(RANLIB) '$(DESTDIR)$(LIBDIR)/libtz.a' + cp -f newctime.3 newtzset.3 '$(DESTDIR)$(MANDIR)/man3/.' + cp -f tzfile.5 '$(DESTDIR)$(MANDIR)/man5/.' + cp -f tzselect.8 zdump.8 zic.8 '$(DESTDIR)$(MANDIR)/man8/.' + +INSTALL: ALL install date.1 + mkdir -p '$(DESTDIR)$(BINDIR)' '$(DESTDIR)$(MANDIR)/man1' + cp date '$(DESTDIR)$(BINDIR)/.' + cp -f date.1 '$(DESTDIR)$(MANDIR)/man1/.' + +# Calculate version number from git, if available. +# Otherwise, use $(VERSION) unless it is "unknown" and there is already +# a 'version' file, in which case reuse the existing 'version' contents +# and append "-dirty" if the contents do not already end in "-dirty". +version: $(VERSION_DEPS) + { (type git) >/dev/null 2>&1 && \ + V=`git describe --match '[0-9][0-9][0-9][0-9][a-z]*' \ + --abbrev=7 --dirty` || \ + if test '$(VERSION)' = unknown && V=`cat $@`; then \ + case $$V in *-dirty);; *) V=$$V-dirty;; esac; \ + else \ + V='$(VERSION)'; \ + fi; } && \ + printf '%s\n' "$$V" >$@.out + mv $@.out $@ + +# These files can be tailored by setting BACKWARD and PACKRATDATA. +vanguard.zi main.zi rearguard.zi: $(DSTDATA_ZI_DEPS) + $(AWK) -v DATAFORM=`expr $@ : '\(.*\).zi'` -f ziguard.awk \ + $(TDATA) $(PACKRATDATA) >$@.out + mv $@.out $@ +# This file has a version comment that attempts to capture any tailoring +# via BACKWARD, DATAFORM, PACKRATDATA, and REDO. +tzdata.zi: $(DATAFORM).zi version zishrink.awk + version=`sed 1q version` && \ + LC_ALL=C $(AWK) \ + -v dataform='$(DATAFORM)' \ + -v deps='$(DSTDATA_ZI_DEPS) zishrink.awk' \ + -v redo='$(REDO)' \ + -v version="$$version" \ + -f zishrink.awk \ + $(DATAFORM).zi >$@.out + mv $@.out $@ + +version.h: version + VERSION=`cat version` && printf '%s\n' \ + 'static char const PKGVERSION[]="($(PACKAGE)) ";' \ + "static char const TZVERSION[]=\"$$VERSION\";" \ + 'static char const REPORT_BUGS_TO[]="$(BUGEMAIL)";' \ + >$@.out + mv $@.out $@ + +zdump: $(TZDOBJS) + $(CC) -o $@ $(CFLAGS) $(LDFLAGS) $(TZDOBJS) $(LDLIBS) + +zic: $(TZCOBJS) + $(CC) -o $@ $(CFLAGS) $(LDFLAGS) $(TZCOBJS) $(LDLIBS) + +leapseconds: $(LEAP_DEPS) + $(AWK) -v EXPIRES_LINE=$(EXPIRES_LINE) \ + -f leapseconds.awk leap-seconds.list >$@.out + mv $@.out $@ + +# Arguments to pass to submakes of install_data. +# They can be overridden by later submake arguments. +INSTALLARGS = \ + BACKWARD='$(BACKWARD)' \ + DESTDIR='$(DESTDIR)' \ + LEAPSECONDS='$(LEAPSECONDS)' \ + PACKRATDATA='$(PACKRATDATA)' \ + TZDEFAULT='$(TZDEFAULT)' \ + TZDIR='$(TZDIR)' \ + ZIC='$(ZIC)' + +INSTALL_DATA_DEPS = zic leapseconds tzdata.zi + +# 'make install_data' installs one set of TZif files. +install_data: $(INSTALL_DATA_DEPS) + $(ZIC_INSTALL) tzdata.zi + +posix_only: $(INSTALL_DATA_DEPS) + $(MAKE) $(INSTALLARGS) LEAPSECONDS= install_data + +right_only: $(INSTALL_DATA_DEPS) + $(MAKE) $(INSTALLARGS) LEAPSECONDS='-L leapseconds' \ + install_data + +# In earlier versions of this makefile, the other two directories were +# subdirectories of $(TZDIR). However, this led to configuration errors. +# For example, with posix_right under the earlier scheme, +# TZ='right/Australia/Adelaide' got you localtime with leap seconds, +# but gmtime without leap seconds, which led to problems with applications +# like sendmail that subtract gmtime from localtime. +# Therefore, the other two directories are now siblings of $(TZDIR). +# You must replace all of $(TZDIR) to switch from not using leap seconds +# to using them, or vice versa. +right_posix: right_only + rm -fr '$(DESTDIR)$(TZDIR)-leaps' + ln -s '$(TZDIR_BASENAME)' '$(DESTDIR)$(TZDIR)-leaps' || \ + $(MAKE) $(INSTALLARGS) TZDIR='$(TZDIR)-leaps' right_only + $(MAKE) $(INSTALLARGS) TZDIR='$(TZDIR)-posix' posix_only + +posix_right: posix_only + rm -fr '$(DESTDIR)$(TZDIR)-posix' + ln -s '$(TZDIR_BASENAME)' '$(DESTDIR)$(TZDIR)-posix' || \ + $(MAKE) $(INSTALLARGS) TZDIR='$(TZDIR)-posix' posix_only + $(MAKE) $(INSTALLARGS) TZDIR='$(TZDIR)-leaps' right_only + +# This obsolescent rule is present for backwards compatibility with +# tz releases 2014g through 2015g. It should go away eventually. +posix_packrat: $(INSTALL_DATA_DEPS) + $(MAKE) $(INSTALLARGS) PACKRATDATA=backzone posix_only + +zones: $(REDO) + +# dummy.zd is not a real file; it is mentioned here only so that the +# top-level 'make' does not have a syntax error. +ZDS = dummy.zd +# Rule used only by submakes invoked by the $(TZS_NEW) rule. +# It is separate so that GNU 'make -j' can run instances in parallel. +$(ZDS): zdump + ./zdump -i $(TZS_CUTOFF_FLAG) '$(wd)/'$$(expr $@ : '\(.*\).zd') \ + >$@ + +TZS_NEW_DEPS = tzdata.zi zdump zic +$(TZS_NEW): $(TZS_NEW_DEPS) + rm -fr tzs$(TZS_YEAR).dir + mkdir tzs$(TZS_YEAR).dir + $(zic) -d tzs$(TZS_YEAR).dir tzdata.zi + $(AWK) '/^L/{print "Link\t" $$2 "\t" $$3}' \ + tzdata.zi | LC_ALL=C sort >$@.out + wd=`pwd` && \ + x=`$(AWK) '/^Z/{print "tzs$(TZS_YEAR).dir/" $$2 ".zd"}' \ + tzdata.zi \ + | LC_ALL=C sort -t . -k 2,2` && \ + set x $$x && \ + shift && \ + ZDS=$$* && \ + $(MAKE) wd="$$wd" TZS_CUTOFF_FLAG="$(TZS_CUTOFF_FLAG)" \ + ZDS="$$ZDS" $$ZDS && \ + sed 's,^TZ=".*\.dir/,TZ=",' $$ZDS >>$@.out + rm -fr tzs$(TZS_YEAR).dir + mv $@.out $@ + +# If $(TZS) exists but 'make check_tzs' fails, a maintainer should inspect the +# failed output and fix the inconsistency, perhaps by running 'make force_tzs'. +$(TZS): + touch $@ + +force_tzs: $(TZS_NEW) + cp $(TZS_NEW) $(TZS) + +libtz.a: $(LIBOBJS) + rm -f $@ + $(AR) -rc $@ $(LIBOBJS) + $(RANLIB) $@ + +date: $(DATEOBJS) + $(CC) -o $@ $(CFLAGS) $(LDFLAGS) $(DATEOBJS) $(LDLIBS) + +tzselect: tzselect.ksh version + VERSION=`cat version` && sed \ + -e 's|#!/bin/bash|#!$(KSHELL)|g' \ + -e 's|AWK=[^}]*|AWK=$(AWK)|g' \ + -e 's|\(PKGVERSION\)=.*|\1='\''($(PACKAGE)) '\''|' \ + -e 's|\(REPORT_BUGS_TO\)=.*|\1=$(BUGEMAIL)|' \ + -e 's|TZDIR=[^}]*|TZDIR=$(TZDIR)|' \ + -e 's|\(TZVERSION\)=.*|\1='"$$VERSION"'|' \ + <$@.ksh >$@.out + chmod +x $@.out + mv $@.out $@ + +check: check_character_set check_white_space check_links \ + check_name_lengths check_sorted \ + check_tables check_web check_zishrink check_tzs + +check_character_set: $(ENCHILADA) + test ! '$(UTF8_LOCALE)' || \ + ! printf 'A\304\200B\n' | \ + LC_ALL='$(UTF8_LOCALE)' grep -q '^A.B$$' >/dev/null 2>&1 || { \ + LC_ALL='$(UTF8_LOCALE)' && export LC_ALL && \ + sharp='#' && \ + ! grep -Env $(SAFE_LINE) $(MANS) date.1 $(MANTXTS) \ + $(MISC) $(SOURCES) $(WEB_PAGES) \ - CONTRIBUTING LICENSE README \ ++ CONTRIBUTING LICENSE README SECURITY \ + version tzdata.zi && \ + ! grep -Env $(SAFE_LINE)'|^UNUSUAL_OK_'$(OK_CHAR)'*$$' \ + Makefile && \ + ! grep -Env $(SAFE_SHARP_LINE) $(TDATA_TO_CHECK) backzone \ + leapseconds zone.tab && \ + ! grep -Env $(OK_LINE) $(ENCHILADA); \ + } + touch $@ + +check_white_space: $(ENCHILADA) + patfmt=' \t|[\f\r\v]' && pat=`printf "$$patfmt\\n"` && \ + ! grep -En "$$pat" \ + $$(ls $(ENCHILADA) | grep -Fvx leap-seconds.list) + ! grep -n '[[:space:]]$$' \ + $$(ls $(ENCHILADA) | grep -Fvx leap-seconds.list) + touch $@ + +PRECEDES_FILE_NAME = ^(Zone|Link[[:space:]]+[^[:space:]]+)[[:space:]]+ +FILE_NAME_COMPONENT_TOO_LONG = \ + $(PRECEDES_FILE_NAME)[^[:space:]]*[^/[:space:]]{15} + +check_name_lengths: $(TDATA_TO_CHECK) backzone + ! grep -En '$(FILE_NAME_COMPONENT_TOO_LONG)' \ + $(TDATA_TO_CHECK) backzone + touch $@ + +CHECK_CC_LIST = { n = split($$1,a,/,/); for (i=2; i<=n; i++) print a[1], a[i]; } + +check_sorted: backward backzone iso3166.tab zone.tab zone1970.tab + $(AWK) '/^Link/ {print $$3}' backward | LC_ALL=C sort -cu + $(AWK) '/^Zone/ {print $$2}' backzone | LC_ALL=C sort -cu + touch $@ + +check_links: checklinks.awk $(TDATA_TO_CHECK) tzdata.zi + $(AWK) -f checklinks.awk $(TDATA_TO_CHECK) + $(AWK) -f checklinks.awk tzdata.zi + touch $@ + +check_tables: checktab.awk $(YDATA) backward $(ZONETABLES) + for tab in $(ZONETABLES); do \ + test "$$tab" = zone.tab && links='$(BACKWARD)' || links=''; \ + $(AWK) -f checktab.awk -v zone_table=$$tab $(YDATA) $$links \ + || exit; \ + done + touch $@ + +check_tzs: $(TZS) $(TZS_NEW) + if test -s $(TZS); then \ + diff -u $(TZS) $(TZS_NEW); \ + else \ + cp $(TZS_NEW) $(TZS); \ + fi + touch $@ + +check_web: $(CHECK_WEB_PAGES) +check_theory.html: theory.html +check_tz-art.html: tz-art.html +check_tz-how-to.html: tz-how-to.html +check_tz-link.html: tz-link.html +check_theory.html check_tz-art.html check_tz-how-to.html check_tz-link.html: + $(CURL) -sS --url https://validator.w3.org/nu/ -F out=gnu \ + -F file=@$$(expr $@ : 'check_\(.*\)') -o $@.out && \ + test ! -s $@.out || { cat $@.out; exit 1; } + mv $@.out $@ + +# Check that zishrink.awk does not alter the data, and that ziguard.awk +# preserves main-format data. +check_zishrink: check_zishrink_posix check_zishrink_right +check_zishrink_posix check_zishrink_right: \ + zic leapseconds $(PACKRATDATA) $(TDATA) $(DATAFORM).zi tzdata.zi + rm -fr $@.dir $@-t.dir $@-shrunk.dir + mkdir $@.dir $@-t.dir $@-shrunk.dir + case $@ in \ + *_right) leap='-L leapseconds';; \ + *) leap=;; \ + esac && \ + $(ZIC) $$leap -d $@.dir $(DATAFORM).zi && \ + $(ZIC) $$leap -d $@-shrunk.dir tzdata.zi && \ + case $(DATAFORM) in \ + main) \ + $(ZIC) $$leap -d $@-t.dir $(TDATA) && \ + $(AWK) '/^Rule/' $(TDATA) | \ + $(ZIC) $$leap -d $@-t.dir - $(PACKRATDATA) && \ + diff -r $@.dir $@-t.dir;; \ + esac + diff -r $@.dir $@-shrunk.dir + rm -fr $@.dir $@-t.dir $@-shrunk.dir + touch $@ + +clean_misc: + rm -fr check_*.dir + rm -f *.o *.out $(TIME_T_ALTERNATIVES) \ + check_* core typecheck_* \ + date tzselect version.h zdump zic libtz.a +clean: clean_misc + rm -fr *.dir tzdb-*/ + rm -f *.zi $(TZS_NEW) + +maintainer-clean: clean + @echo 'This command is intended for maintainers to use; it' + @echo 'deletes files that may need special tools to rebuild.' + rm -f leapseconds version $(MANTXTS) $(TZS) *.asc *.tar.* + +names: + @echo $(ENCHILADA) + +public: check check_public $(CHECK_TIME_T_ALTERNATIVES) \ + tarballs signatures + +date.1.txt: date.1 +newctime.3.txt: newctime.3 +newstrftime.3.txt: newstrftime.3 +newtzset.3.txt: newtzset.3 +time2posix.3.txt: time2posix.3 +tzfile.5.txt: tzfile.5 +tzselect.8.txt: tzselect.8 +zdump.8.txt: zdump.8 +zic.8.txt: zic.8 + +$(MANTXTS): workman.sh + LC_ALL=C sh workman.sh `expr $@ : '\(.*\)\.txt$$'` >$@.out + mv $@.out $@ + +# Set file timestamps deterministically if possible, +# so that tarballs containing the timestamps are reproducible. +# +# '$(SET_TIMESTAMP_N) N DEST A B C ...' sets the timestamp of the +# file DEST to the maximum of the timestamps of the files A B C ..., +# plus N if GNU ls and touch are available. +SET_TIMESTAMP_N = sh -c '\ + n=$$0 dest=$$1; shift; \ + touch -cmr `ls -t "$$@" | sed 1q` "$$dest" && \ + if test $$n != 0 && \ + lsout=`ls -n --time-style="+%s" "$$dest" 2>/dev/null`; then \ + set x $$lsout && \ + touch -cmd @`expr $$7 + $$n` "$$dest"; \ + else :; fi' +# If DEST depends on A B C ... in this Makefile, callers should use +# $(SET_TIMESTAMP_DEP) DEST A B C ..., for the benefit of any +# downstream 'make' that considers equal timestamps to be out of date. +# POSIX allows this 'make' behavior, and HP-UX 'make' does it. +# If all that matters is that the timestamp be reproducible +# and plausible, use $(SET_TIMESTAMP). +SET_TIMESTAMP = $(SET_TIMESTAMP_N) 0 +SET_TIMESTAMP_DEP = $(SET_TIMESTAMP_N) 1 + +# Set the timestamps to those of the git repository, if available, +# and if the files have not changed since then. +# This uses GNU 'ls --time-style=+%s', which outputs the seconds count, +# and GNU 'touch -d@N FILE', where N is the number of seconds since 1970. +# If git or GNU is absent, don't bother to sync with git timestamps. +# Also, set the timestamp of each prebuilt file like 'leapseconds' +# to be the maximum of the files it depends on. +set-timestamps.out: $(EIGHT_YARDS) + rm -f $@ + if (type git) >/dev/null 2>&1 && \ + files=`git ls-files $(EIGHT_YARDS)` && \ + touch -md @1 test.out; then \ + rm -f test.out && \ + for file in $$files; do \ + if git diff --quiet $$file; then \ + time=`git log -1 --format='tformat:%ct' $$file` && \ + touch -cmd @$$time $$file; \ + else \ + echo >&2 "$$file: warning: does not match repository"; \ + fi || exit; \ + done; \ + fi + $(SET_TIMESTAMP_DEP) leapseconds $(LEAP_DEPS) + for file in `ls $(MANTXTS) | sed 's/\.txt$$//'`; do \ + $(SET_TIMESTAMP_DEP) $$file.txt $$file workman.sh || \ + exit; \ + done + $(SET_TIMESTAMP_DEP) version $(VERSION_DEPS) + $(SET_TIMESTAMP_DEP) tzdata.zi $(TZDATA_ZI_DEPS) + touch $@ +set-tzs-timestamp.out: $(TZS) + $(SET_TIMESTAMP_DEP) $(TZS) $(TZS_DEPS) + touch $@ *** 203 LINES SKIPPED *** From owner-dev-commits-src-main@freebsd.org Sat Oct 2 04:09:53 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8086F674008; Sat, 2 Oct 2021 04:09:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HLtmK2Z5Pz4hGb; Sat, 2 Oct 2021 04:09:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 33FA442C6; Sat, 2 Oct 2021 04:09:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 19249rug099019; Sat, 2 Oct 2021 04:09:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19249rMZ099018; Sat, 2 Oct 2021 04:09:53 GMT (envelope-from git) Date: Sat, 2 Oct 2021 04:09:53 GMT Message-Id: <202110020409.19249rMZ099018@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alexander Motin Subject: git: 1c119e173ddc - main - sched_ule(4): Fix possible significance loss. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mav X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 1c119e173ddc7f5603a3b6cf940dc524e494a667 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 02 Oct 2021 04:09:53 -0000 The branch main has been updated by mav: URL: https://cgit.FreeBSD.org/src/commit/?id=1c119e173ddc7f5603a3b6cf940dc524e494a667 commit 1c119e173ddc7f5603a3b6cf940dc524e494a667 Author: Alexander Motin AuthorDate: 2021-10-02 03:47:18 +0000 Commit: Alexander Motin CommitDate: 2021-10-02 04:09:45 +0000 sched_ule(4): Fix possible significance loss. Before this change kern.sched.interact sysctl setting above 32 gave all interactive threads identical priority of PRI_MIN_INTERACT due to ((PRI_MAX_INTERACT - PRI_MIN_INTERACT + 1) / sched_interact) turning zero. Setting the sysctl lower reduced the range of used priority levels up to half, that is not great either. Change of the operations order should fix the issue, always using full range of priorities, while overflow is impossible there since both score and priority values are small. While there, make the variables unsigned as they really are. MFC after: 1 month --- sys/kern/sched_ule.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/sys/kern/sched_ule.c b/sys/kern/sched_ule.c index 0f873a6a30b6..1b9473b93773 100644 --- a/sys/kern/sched_ule.c +++ b/sys/kern/sched_ule.c @@ -207,7 +207,7 @@ _Static_assert(sizeof(struct thread) + sizeof(struct td_sched) <= * sched_slice: Runtime of each thread before rescheduling. * preempt_thresh: Priority threshold for preemption and remote IPIs. */ -static int __read_mostly sched_interact = SCHED_INTERACT_THRESH; +static u_int __read_mostly sched_interact = SCHED_INTERACT_THRESH; static int __read_mostly tickincr = 8 << SCHED_TICK_SHIFT; static int __read_mostly realstathz = 127; /* reset during boot. */ static int __read_mostly sched_slice = 10; /* reset during boot. */ @@ -1616,8 +1616,7 @@ sched_interact_score(struct thread *td) static void sched_priority(struct thread *td) { - int score; - int pri; + u_int pri, score; if (PRI_BASE(td->td_pri_class) != PRI_TIMESHARE) return; @@ -1637,10 +1636,10 @@ sched_priority(struct thread *td) score = imax(0, sched_interact_score(td) + td->td_proc->p_nice); if (score < sched_interact) { pri = PRI_MIN_INTERACT; - pri += ((PRI_MAX_INTERACT - PRI_MIN_INTERACT + 1) / - sched_interact) * score; + pri += (PRI_MAX_INTERACT - PRI_MIN_INTERACT + 1) * score / + sched_interact; KASSERT(pri >= PRI_MIN_INTERACT && pri <= PRI_MAX_INTERACT, - ("sched_priority: invalid interactive priority %d score %d", + ("sched_priority: invalid interactive priority %u score %u", pri, score)); } else { pri = SCHED_PRI_MIN; @@ -1649,7 +1648,7 @@ sched_priority(struct thread *td) SCHED_PRI_RANGE - 1); pri += SCHED_PRI_NICE(td->td_proc->p_nice); KASSERT(pri >= PRI_MIN_BATCH && pri <= PRI_MAX_BATCH, - ("sched_priority: invalid priority %d: nice %d, " + ("sched_priority: invalid priority %u: nice %d, " "ticks %d ftick %d ltick %d tick pri %d", pri, td->td_proc->p_nice, td_get_sched(td)->ts_ticks, td_get_sched(td)->ts_ftick, td_get_sched(td)->ts_ltick, @@ -3174,7 +3173,7 @@ SYSCTL_PROC(_kern_sched, OID_AUTO, quantum, "Quantum for timeshare threads in microseconds"); SYSCTL_INT(_kern_sched, OID_AUTO, slice, CTLFLAG_RW, &sched_slice, 0, "Quantum for timeshare threads in stathz ticks"); -SYSCTL_INT(_kern_sched, OID_AUTO, interact, CTLFLAG_RW, &sched_interact, 0, +SYSCTL_UINT(_kern_sched, OID_AUTO, interact, CTLFLAG_RW, &sched_interact, 0, "Interactivity score threshold"); SYSCTL_INT(_kern_sched, OID_AUTO, preempt_thresh, CTLFLAG_RW, &preempt_thresh, 0, From owner-dev-commits-src-main@freebsd.org Sat Oct 2 08:43:12 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AE0396777BD; Sat, 2 Oct 2021 08:43:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HM0qh4MCXz3G5M; Sat, 2 Oct 2021 08:43:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 75A927C40; Sat, 2 Oct 2021 08:43:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1928hCi9070271; Sat, 2 Oct 2021 08:43:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1928hC84070270; Sat, 2 Oct 2021 08:43:12 GMT (envelope-from git) Date: Sat, 2 Oct 2021 08:43:12 GMT Message-Id: <202110020843.1928hC84070270@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Gordon Bergling Subject: git: 9ebd651b5850 - main - netvsc: Fix a typo in a comment MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gbe X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9ebd651b58502f0572a7832d088f53f7a2ad00a5 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 02 Oct 2021 08:43:12 -0000 The branch main has been updated by gbe (doc committer): URL: https://cgit.FreeBSD.org/src/commit/?id=9ebd651b58502f0572a7832d088f53f7a2ad00a5 commit 9ebd651b58502f0572a7832d088f53f7a2ad00a5 Author: Gordon Bergling AuthorDate: 2021-10-02 08:42:18 +0000 Commit: Gordon Bergling CommitDate: 2021-10-02 08:42:18 +0000 netvsc: Fix a typo in a comment - s/prefered/preferred/ MFC after: 3 days --- sys/dev/hyperv/netvsc/hn_rndis.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/hyperv/netvsc/hn_rndis.c b/sys/dev/hyperv/netvsc/hn_rndis.c index 794a82cf3957..108950aa3f9b 100644 --- a/sys/dev/hyperv/netvsc/hn_rndis.c +++ b/sys/dev/hyperv/netvsc/hn_rndis.c @@ -493,7 +493,7 @@ hn_rndis_query_rsscaps(struct hn_softc *sc, int *rxr_cnt0) /* * NOTE: - * Toeplitz is at the lowest bit, and it is prefered; so ffs(), + * Toeplitz is at the lowest bit, and it is preferred; so ffs(), * instead of fls(), is used here. */ hash_fnidx = ffs(caps.ndis_caps & NDIS_RSS_CAP_HASHFUNC_MASK); From owner-dev-commits-src-main@freebsd.org Sat Oct 2 08:44:12 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B3C236777C9; Sat, 2 Oct 2021 08:44:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HM0rr43tMz3GPR; Sat, 2 Oct 2021 08:44:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6C0C310593; Sat, 2 Oct 2021 08:44:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1928iCNC070459; Sat, 2 Oct 2021 08:44:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1928iCMW070458; Sat, 2 Oct 2021 08:44:12 GMT (envelope-from git) Date: Sat, 2 Oct 2021 08:44:12 GMT Message-Id: <202110020844.1928iCMW070458@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Gordon Bergling Subject: git: efd8749fe5cc - main - evdev: Fix a typo in a commit MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gbe X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: efd8749fe5cccb6c3d6b5f3c3515bf89ad306bcc Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 02 Oct 2021 08:44:12 -0000 The branch main has been updated by gbe (doc committer): URL: https://cgit.FreeBSD.org/src/commit/?id=efd8749fe5cccb6c3d6b5f3c3515bf89ad306bcc commit efd8749fe5cccb6c3d6b5f3c3515bf89ad306bcc Author: Gordon Bergling AuthorDate: 2021-10-02 08:43:41 +0000 Commit: Gordon Bergling CommitDate: 2021-10-02 08:43:41 +0000 evdev: Fix a typo in a commit - s/prefered/preferred/ MFC after: 3 days --- sys/dev/evdev/evdev.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/evdev/evdev.h b/sys/dev/evdev/evdev.h index 589bd7cfe563..90bea09b70c9 100644 --- a/sys/dev/evdev/evdev.h +++ b/sys/dev/evdev/evdev.h @@ -49,7 +49,7 @@ typedef void (evdev_keycode_t)(struct evdev_dev *, * Keyboard and mouse events recipient mask. * evdev_rcpt_mask variable should be respected by keyboard and mouse drivers * that are able to send events through both evdev and sysmouse/kbdmux - * interfaces so user can choose prefered one to not receive one event twice. + * interfaces so user can choose preferred one to not receive one event twice. */ #define EVDEV_RCPT_SYSMOUSE (1<<0) #define EVDEV_RCPT_KBDMUX (1<<1) From owner-dev-commits-src-main@freebsd.org Sat Oct 2 08:46:47 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 15F6E677BD3; Sat, 2 Oct 2021 08:46:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HM0vq08Vpz3G4H; Sat, 2 Oct 2021 08:46:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D9EE110708; Sat, 2 Oct 2021 08:46:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1928kkU4070744; Sat, 2 Oct 2021 08:46:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1928kkhg070743; Sat, 2 Oct 2021 08:46:46 GMT (envelope-from git) Date: Sat, 2 Oct 2021 08:46:46 GMT Message-Id: <202110020846.1928kkhg070743@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Gordon Bergling Subject: git: 9599d8141f79 - main - smsc(4): Fix a typo in a comment MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gbe X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9599d8141f79aa721e47d7fd91e7b9bcfef3a7d5 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 02 Oct 2021 08:46:47 -0000 The branch main has been updated by gbe (doc committer): URL: https://cgit.FreeBSD.org/src/commit/?id=9599d8141f79aa721e47d7fd91e7b9bcfef3a7d5 commit 9599d8141f79aa721e47d7fd91e7b9bcfef3a7d5 Author: Gordon Bergling AuthorDate: 2021-10-02 08:45:58 +0000 Commit: Gordon Bergling CommitDate: 2021-10-02 08:45:58 +0000 smsc(4): Fix a typo in a comment - s/setings/settings/ MFC after: 3 days --- sys/dev/usb/net/if_smsc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/usb/net/if_smsc.c b/sys/dev/usb/net/if_smsc.c index 85cc955b9fbf..33a90259b464 100644 --- a/sys/dev/usb/net/if_smsc.c +++ b/sys/dev/usb/net/if_smsc.c @@ -1411,7 +1411,7 @@ smsc_chip_init(struct smsc_softc *sc) reg_val &= ~SMSC_HW_CFG_RXDOFF; reg_val |= (ETHER_ALIGN << 9) & SMSC_HW_CFG_RXDOFF; - /* The following setings are used for 'turbo mode', a.k.a multiple frames + /* The following settings are used for 'turbo mode', a.k.a multiple frames * per Rx transaction (again info taken form Linux driver). */ if (smsc_rx_packet_batching) From owner-dev-commits-src-main@freebsd.org Sat Oct 2 08:47:53 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 05DF3677B76; Sat, 2 Oct 2021 08:47:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HM0x46VMlz3GY7; Sat, 2 Oct 2021 08:47:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BFD1810595; Sat, 2 Oct 2021 08:47:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1928lq70070925; Sat, 2 Oct 2021 08:47:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1928lqKa070924; Sat, 2 Oct 2021 08:47:52 GMT (envelope-from git) Date: Sat, 2 Oct 2021 08:47:52 GMT Message-Id: <202110020847.1928lqKa070924@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Gordon Bergling Subject: git: fafb1c574d43 - main - vnic: Fix a typo in a comment MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gbe X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: fafb1c574d43b8c3acb510d925f599fee461c039 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 02 Oct 2021 08:47:53 -0000 The branch main has been updated by gbe (doc committer): URL: https://cgit.FreeBSD.org/src/commit/?id=fafb1c574d43b8c3acb510d925f599fee461c039 commit fafb1c574d43b8c3acb510d925f599fee461c039 Author: Gordon Bergling AuthorDate: 2021-10-02 08:47:21 +0000 Commit: Gordon Bergling CommitDate: 2021-10-02 08:47:21 +0000 vnic: Fix a typo in a comment - s/setings/settings/ MFC after: 3 days --- sys/dev/vnic/thunder_mdio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/vnic/thunder_mdio.c b/sys/dev/vnic/thunder_mdio.c index 118a01a533ea..c61c0eeecf62 100644 --- a/sys/dev/vnic/thunder_mdio.c +++ b/sys/dev/vnic/thunder_mdio.c @@ -206,7 +206,7 @@ thunder_mdio_set_mode(struct thunder_mdio_softc *sc, smi_clk |= SMI_CLK_MODE; /* Enable sending 32 bit preable on SMI transactions */ smi_clk |= SMI_CLK_PREAMBLE; - /* Saved setings */ + /* Saved settings */ mdio_reg_write(sc, SMI_CLK, smi_clk); sc->mode = mode; } From owner-dev-commits-src-main@freebsd.org Sat Oct 2 08:49:14 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A9BBB6777FD; Sat, 2 Oct 2021 08:49:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HM0yf4PPLz3GSR; Sat, 2 Oct 2021 08:49:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7711D10323; Sat, 2 Oct 2021 08:49:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1928nEQ5071124; Sat, 2 Oct 2021 08:49:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1928nEcF071123; Sat, 2 Oct 2021 08:49:14 GMT (envelope-from git) Date: Sat, 2 Oct 2021 08:49:14 GMT Message-Id: <202110020849.1928nEcF071123@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Gordon Bergling Subject: git: 15c5f657a010 - main - cam: Fix a typo in a comment MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gbe X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 15c5f657a0107c7c1a3c954252a9ac6bb80f2535 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 02 Oct 2021 08:49:14 -0000 The branch main has been updated by gbe (doc committer): URL: https://cgit.FreeBSD.org/src/commit/?id=15c5f657a0107c7c1a3c954252a9ac6bb80f2535 commit 15c5f657a0107c7c1a3c954252a9ac6bb80f2535 Author: Gordon Bergling AuthorDate: 2021-10-02 08:48:43 +0000 Commit: Gordon Bergling CommitDate: 2021-10-02 08:48:43 +0000 cam: Fix a typo in a comment - s/perorming/performing/ MFC after: 3 days --- sys/cam/ctl/ctl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/cam/ctl/ctl.c b/sys/cam/ctl/ctl.c index 8ad8bcec434b..980328c1551f 100644 --- a/sys/cam/ctl/ctl.c +++ b/sys/cam/ctl/ctl.c @@ -8552,7 +8552,7 @@ done: /* * This routine is for handling a message from the other SC pertaining to * persistent reserve out. All the error checking will have been done - * so only perorming the action need be done here to keep the two + * so only performing the action need be done here to keep the two * in sync. */ static void From owner-dev-commits-src-main@freebsd.org Sat Oct 2 08:50:49 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 60B26677D31; Sat, 2 Oct 2021 08:50:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HM10T28T1z3GSv; Sat, 2 Oct 2021 08:50:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 29DD410615; Sat, 2 Oct 2021 08:50:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1928onKM079547; Sat, 2 Oct 2021 08:50:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1928onr3079546; Sat, 2 Oct 2021 08:50:49 GMT (envelope-from git) Date: Sat, 2 Oct 2021 08:50:49 GMT Message-Id: <202110020850.1928onr3079546@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Gordon Bergling Subject: git: 957d9ba0c3f9 - main - qlnxe: Fix typos in two error messages MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gbe X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 957d9ba0c3f908462915c9aed6900c50c8c76210 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 02 Oct 2021 08:50:49 -0000 The branch main has been updated by gbe (doc committer): URL: https://cgit.FreeBSD.org/src/commit/?id=957d9ba0c3f908462915c9aed6900c50c8c76210 commit 957d9ba0c3f908462915c9aed6900c50c8c76210 Author: Gordon Bergling AuthorDate: 2021-10-02 08:49:51 +0000 Commit: Gordon Bergling CommitDate: 2021-10-02 08:49:51 +0000 qlnxe: Fix typos in two error messages - s/erorr/error/ MFC after: 1 week --- sys/dev/qlnx/qlnxe/ecore_int.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/dev/qlnx/qlnxe/ecore_int.c b/sys/dev/qlnx/qlnxe/ecore_int.c index 14285a35afa5..fbf692acfb6c 100644 --- a/sys/dev/qlnx/qlnxe/ecore_int.c +++ b/sys/dev/qlnx/qlnxe/ecore_int.c @@ -364,7 +364,7 @@ enum _ecore_status_t ecore_pglueb_rbc_attn_handler(struct ecore_hwfn *p_hwfn, tmp = ecore_rd(p_hwfn, p_ptt, PGLUE_B_REG_TX_ERR_WR_DETAILS_ICPL); if (tmp & ECORE_PGLUE_ATTENTION_ICPL_VALID) - DP_NOTICE(p_hwfn, false, "ICPL eror - %08x\n", tmp); + DP_NOTICE(p_hwfn, false, "ICPL error - %08x\n", tmp); tmp = ecore_rd(p_hwfn, p_ptt, PGLUE_B_REG_MASTER_ZLR_ERR_DETAILS); if (tmp & ECORE_PGLUE_ATTENTION_ZLR_VALID) { @@ -376,7 +376,7 @@ enum _ecore_status_t ecore_pglueb_rbc_attn_handler(struct ecore_hwfn *p_hwfn, PGLUE_B_REG_MASTER_ZLR_ERR_ADD_63_32); DP_NOTICE(p_hwfn, false, - "ICPL eror - %08x [Address %08x:%08x]\n", + "ICPL error - %08x [Address %08x:%08x]\n", tmp, addr_hi, addr_lo); } From owner-dev-commits-src-main@freebsd.org Sat Oct 2 08:52:06 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D48AF678183; Sat, 2 Oct 2021 08:52:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HM11y5cwnz3H0f; Sat, 2 Oct 2021 08:52:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A1231103D2; Sat, 2 Oct 2021 08:52:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1928q6Np083862; Sat, 2 Oct 2021 08:52:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1928q6Ks083861; Sat, 2 Oct 2021 08:52:06 GMT (envelope-from git) Date: Sat, 2 Oct 2021 08:52:06 GMT Message-Id: <202110020852.1928q6Ks083861@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Gordon Bergling Subject: git: 42dfad2ef127 - main - ti(4): Fix a typo in an error message MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gbe X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 42dfad2ef12755d27e0e34656a2624f0dac2c502 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 02 Oct 2021 08:52:06 -0000 The branch main has been updated by gbe (doc committer): URL: https://cgit.FreeBSD.org/src/commit/?id=42dfad2ef12755d27e0e34656a2624f0dac2c502 commit 42dfad2ef12755d27e0e34656a2624f0dac2c502 Author: Gordon Bergling AuthorDate: 2021-10-02 08:51:29 +0000 Commit: Gordon Bergling CommitDate: 2021-10-02 08:51:29 +0000 ti(4): Fix a typo in an error message - s/chanels/channels/ MFC after: 1 week --- sys/arm/ti/ti_adc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/arm/ti/ti_adc.c b/sys/arm/ti/ti_adc.c index a0091aebf417..766729fcdab3 100644 --- a/sys/arm/ti/ti_adc.c +++ b/sys/arm/ti/ti_adc.c @@ -809,7 +809,7 @@ ti_adc_attach(device_t dev) /* Sanity check FDT data */ if (sc->sc_tsc_wires + sc->sc_adc_nchannels > TI_ADC_NPINS) { - device_printf(dev, "total number of chanels (%d) is larger than %d\n", + device_printf(dev, "total number of channels (%d) is larger than %d\n", sc->sc_tsc_wires + sc->sc_adc_nchannels, TI_ADC_NPINS); return (ENXIO); } From owner-dev-commits-src-main@freebsd.org Sat Oct 2 16:30:41 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 35AC267E384; Sat, 2 Oct 2021 16:30:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HMCC50qBSz4jKX; Sat, 2 Oct 2021 16:30:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F0883162E2; Sat, 2 Oct 2021 16:30:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 192GUeZn091047; Sat, 2 Oct 2021 16:30:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 192GUeG4091046; Sat, 2 Oct 2021 16:30:40 GMT (envelope-from git) Date: Sat, 2 Oct 2021 16:30:40 GMT Message-Id: <202110021630.192GUeG4091046@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 202692b1a733 - main - arm64: Spell BeagleBone correctly in config file. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 202692b1a733322540723c718288eff3a8054d42 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 02 Oct 2021 16:30:41 -0000 The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=202692b1a733322540723c718288eff3a8054d42 commit 202692b1a733322540723c718288eff3a8054d42 Author: Tom Hukins AuthorDate: 2021-10-02 11:07:50 +0000 Commit: Warner Losh CommitDate: 2021-10-02 16:30:14 +0000 arm64: Spell BeagleBone correctly in config file. Pull Request: https://github.com/freebsd/freebsd-src/pull/545 --- sys/arm/conf/GENERIC | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/arm/conf/GENERIC b/sys/arm/conf/GENERIC index 427f354d1f93..e51a04244367 100644 --- a/sys/arm/conf/GENERIC +++ b/sys/arm/conf/GENERIC @@ -184,7 +184,7 @@ device ti_adc device pwm # Watchdog support -# If we don't enable the watchdog driver, the BealeBone could potentially +# If we don't enable the watchdog driver, the BeagleBone could potentially # reboot automatically because the boot loader might have enabled the # watchdog. device ti_wdt From owner-dev-commits-src-main@freebsd.org Sat Oct 2 16:40:16 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E024767E25D; Sat, 2 Oct 2021 16:40:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HMCQ85p98z4jg3; Sat, 2 Oct 2021 16:40:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A424916886; Sat, 2 Oct 2021 16:40:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 192GeGHw001775; Sat, 2 Oct 2021 16:40:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 192GeG7w001769; Sat, 2 Oct 2021 16:40:16 GMT (envelope-from git) Date: Sat, 2 Oct 2021 16:40:16 GMT Message-Id: <202110021640.192GeG7w001769@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 48556dff3d02 - main - src/bin/sh: Fix spelling errors MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 48556dff3d028da85b864c6662534e1388a255c8 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 02 Oct 2021 16:40:16 -0000 The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=48556dff3d028da85b864c6662534e1388a255c8 commit 48556dff3d028da85b864c6662534e1388a255c8 Author: Elyes HAOUAS AuthorDate: 2021-10-02 16:33:51 +0000 Commit: Warner Losh CommitDate: 2021-10-02 16:39:24 +0000 src/bin/sh: Fix spelling errors Pull Request: https://github.com/freebsd/freebsd-src/pull/544 Signed-off-by: Elyes HAOUAS --- bin/sh/error.c | 2 +- bin/sh/eval.c | 2 +- bin/sh/nodetypes | 2 +- bin/sh/shell.h | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/bin/sh/error.c b/bin/sh/error.c index bee2a4fe703b..a6b407907e20 100644 --- a/bin/sh/error.c +++ b/bin/sh/error.c @@ -74,7 +74,7 @@ static void verrorwithstatus(int, const char *, va_list) __printf0like(2, 0) __d * just do a longjmp to the exception handler. The type of exception is * stored in the global variable "exception". * - * Interrupts are disabled; they should be reenabled when the exception is + * Interrupts are disabled; they should be re-enabled when the exception is * caught. */ diff --git a/bin/sh/eval.c b/bin/sh/eval.c index b95689bce006..58cfc522bb14 100644 --- a/bin/sh/eval.c +++ b/bin/sh/eval.c @@ -900,7 +900,7 @@ evalcommand(union node *cmd, int flags, struct backcmd *backcmd) * the hash table isn't filled with items * from the temporary setting. * - * It would be better to forbit using and + * It would be better to forbid using and * updating the table while this command * runs, by the command finding mechanism * is heavily integrated with hash handling, diff --git a/bin/sh/nodetypes b/bin/sh/nodetypes index 496ffba05924..0d0d657d67e8 100644 --- a/bin/sh/nodetypes +++ b/bin/sh/nodetypes @@ -64,7 +64,7 @@ NPIPE npipe # a pipeline backgnd int # set to run pipeline in background cmdlist nodelist # the commands in the pipeline -NREDIR nredir # redirection (of a compex command) +NREDIR nredir # redirection (of a complex command) type int n nodeptr # the command redirect nodeptr # list of file redirections diff --git a/bin/sh/shell.h b/bin/sh/shell.h index c06e737e658f..536efe6ce228 100644 --- a/bin/sh/shell.h +++ b/bin/sh/shell.h @@ -55,7 +55,7 @@ /* #define DEBUG 1 */ /* - * Type of used arithmetics. SUSv3 requires us to have at least signed long. + * Type of used arithmetic. SUSv3 requires us to have at least signed long. */ typedef intmax_t arith_t; #define ARITH_FORMAT_STR "%" PRIdMAX From owner-dev-commits-src-main@freebsd.org Sat Oct 2 16:40:17 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id EA1AE67D8F6; Sat, 2 Oct 2021 16:40:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HMCQ96GGDz4jQ0; Sat, 2 Oct 2021 16:40:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B7D5216985; Sat, 2 Oct 2021 16:40:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 192GeHcS002307; Sat, 2 Oct 2021 16:40:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 192GeHlb002301; Sat, 2 Oct 2021 16:40:17 GMT (envelope-from git) Date: Sat, 2 Oct 2021 16:40:17 GMT Message-Id: <202110021640.192GeHlb002301@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 28c3c137f64a - main - src/bin/mkdir: Spell occur correctly. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 28c3c137f64a7176d0ca877fb4f35ae17c7c5202 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 02 Oct 2021 16:40:18 -0000 The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=28c3c137f64a7176d0ca877fb4f35ae17c7c5202 commit 28c3c137f64a7176d0ca877fb4f35ae17c7c5202 Author: Elyes HAOUAS AuthorDate: 2021-10-02 16:34:45 +0000 Commit: Warner Losh CommitDate: 2021-10-02 16:39:31 +0000 src/bin/mkdir: Spell occur correctly. Pull Request: https://github.com/freebsd/freebsd-src/pull/544 Signed-off-by: Elyes HAOUAS --- bin/mkdir/mkdir.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/mkdir/mkdir.c b/bin/mkdir/mkdir.c index 122ec4458858..cc699d3893dc 100644 --- a/bin/mkdir/mkdir.c +++ b/bin/mkdir/mkdir.c @@ -163,7 +163,7 @@ build(char *path, mode_t omode) * POSIX 1003.2: * For each dir operand that does not name an existing * directory, effects equivalent to those caused by the - * following command shall occcur: + * following command shall occur: * * mkdir -p -m $(umask -S),u+wx $(dirname dir) && * mkdir [-m mode] dir From owner-dev-commits-src-main@freebsd.org Sat Oct 2 16:40:19 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4626067DF50; Sat, 2 Oct 2021 16:40:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HMCQC1M3Gz4jQ4; Sat, 2 Oct 2021 16:40:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D100A16887; Sat, 2 Oct 2021 16:40:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 192GeIb7002841; Sat, 2 Oct 2021 16:40:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 192GeIXJ002838; Sat, 2 Oct 2021 16:40:18 GMT (envelope-from git) Date: Sat, 2 Oct 2021 16:40:18 GMT Message-Id: <202110021640.192GeIXJ002838@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 8db446034e3e - main - src/bin/pax: Fix spelling error MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 8db446034e3e53969db8b211fb8635dd911d1133 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 02 Oct 2021 16:40:19 -0000 The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=8db446034e3e53969db8b211fb8635dd911d1133 commit 8db446034e3e53969db8b211fb8635dd911d1133 Author: Elyes HAOUAS AuthorDate: 2021-10-02 16:36:09 +0000 Commit: Warner Losh CommitDate: 2021-10-02 16:39:34 +0000 src/bin/pax: Fix spelling error "whats" -> "what's" Pull Request: https://github.com/freebsd/freebsd-src/pull/544 Signed-off-by: Elyes HAOUAS --- bin/pax/buf_subs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/pax/buf_subs.c b/bin/pax/buf_subs.c index 153b599193d8..6d50a280f29c 100644 --- a/bin/pax/buf_subs.c +++ b/bin/pax/buf_subs.c @@ -540,7 +540,7 @@ rd_wrbuf(char *in, int cpcnt) } /* - * calculate how much data to copy based on whats left and + * calculate how much data to copy based on what's left and * state of buffer */ cnt = MIN(cnt, incnt); From owner-dev-commits-src-main@freebsd.org Sat Oct 2 16:40:20 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 57EC167E511; Sat, 2 Oct 2021 16:40:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HMCQD0cgPz4jXk; Sat, 2 Oct 2021 16:40:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E6B1216888; Sat, 2 Oct 2021 16:40:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 192GeJoZ003362; Sat, 2 Oct 2021 16:40:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 192GeJTs003356; Sat, 2 Oct 2021 16:40:19 GMT (envelope-from git) Date: Sat, 2 Oct 2021 16:40:19 GMT Message-Id: <202110021640.192GeJTs003356@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 3fe686f25a0d - main - src/bin/ps: Fix spelling error MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3fe686f25a0d0844dc3afd0b3b067ec46abdbc99 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 02 Oct 2021 16:40:20 -0000 The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=3fe686f25a0d0844dc3afd0b3b067ec46abdbc99 commit 3fe686f25a0d0844dc3afd0b3b067ec46abdbc99 Author: Elyes HAOUAS AuthorDate: 2021-10-02 16:37:32 +0000 Commit: Warner Losh CommitDate: 2021-10-02 16:39:37 +0000 src/bin/ps: Fix spelling error Spell interruptible correctly. Pull Request: https://github.com/freebsd/freebsd-src/pull/544 Signed-off-by: Elyes HAOUAS --- bin/ps/print.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/ps/print.c b/bin/ps/print.c index 2b61c6b0a15a..d4dbd9624011 100644 --- a/bin/ps/print.c +++ b/bin/ps/print.c @@ -236,7 +236,7 @@ state(KINFO *k, VARENT *ve __unused) break; case SSLEEP: - if (tdflags & TDF_SINTR) /* interruptable (long) */ + if (tdflags & TDF_SINTR) /* interruptible (long) */ *cp = k->ki_p->ki_slptime >= MAXSLP ? 'I' : 'S'; else *cp = 'D'; From owner-dev-commits-src-main@freebsd.org Sat Oct 2 21:14:34 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 115596AA639; Sat, 2 Oct 2021 21:14:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HMKVd6wFmz3FYF; Sat, 2 Oct 2021 21:14:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CD3EE1A215; Sat, 2 Oct 2021 21:14:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 192LEXn5067778; Sat, 2 Oct 2021 21:14:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 192LEXEo067777; Sat, 2 Oct 2021 21:14:33 GMT (envelope-from git) Date: Sat, 2 Oct 2021 21:14:33 GMT Message-Id: <202110022114.192LEXEo067777@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Rick Macklem Subject: git: 93a32050abac - main - nfsd: Fix pNFS handling of Deallocate MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 93a32050abac11d22d849d9cf2014370662269a7 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 02 Oct 2021 21:14:34 -0000 The branch main has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=93a32050abac11d22d849d9cf2014370662269a7 commit 93a32050abac11d22d849d9cf2014370662269a7 Author: Rick Macklem AuthorDate: 2021-10-02 21:11:15 +0000 Commit: Rick Macklem CommitDate: 2021-10-02 21:11:15 +0000 nfsd: Fix pNFS handling of Deallocate For a pNFS server configuration, an NFSv4.2 Deallocate operation is proxied to the DS(s). The code that parsed the reply for the proxy RPC is broken and did not process the pre-operation attributes. This patch fixes this problem. This bug would only affect pNFS servers built from recent main/FreeBSD14 sources. --- sys/fs/nfsserver/nfs_nfsdport.c | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/sys/fs/nfsserver/nfs_nfsdport.c b/sys/fs/nfsserver/nfs_nfsdport.c index 49cbd2c9de0f..0f678cd5640e 100644 --- a/sys/fs/nfsserver/nfs_nfsdport.c +++ b/sys/fs/nfsserver/nfs_nfsdport.c @@ -5732,8 +5732,14 @@ nfsrv_deallocatedsdorpc(struct nfsmount *nmp, fhandle_t *fhp, off_t off, txdr_hyper(len, tl); tl += 2; NFSD_DEBUG(4, "nfsrv_deallocatedsdorpc: len=%jd\n", (intmax_t)len); + /* Do a Getattr for the attributes that change upon writing. */ + NFSZERO_ATTRBIT(&attrbits); + NFSSETBIT_ATTRBIT(&attrbits, NFSATTRBIT_SIZE); + NFSSETBIT_ATTRBIT(&attrbits, NFSATTRBIT_CHANGE); + NFSSETBIT_ATTRBIT(&attrbits, NFSATTRBIT_TIMEACCESS); + NFSSETBIT_ATTRBIT(&attrbits, NFSATTRBIT_TIMEMODIFY); + NFSSETBIT_ATTRBIT(&attrbits, NFSATTRBIT_SPACEUSED); *tl = txdr_unsigned(NFSV4OP_GETATTR); - NFSGETATTR_ATTRBIT(&attrbits); nfsrv_putattrbit(nd, &attrbits); error = newnfs_request(nd, nmp, NULL, &nmp->nm_sockreq, NULL, p, cred, NFS_PROG, NFS_VER4, NULL, 1, NULL, NULL); @@ -5741,8 +5747,23 @@ nfsrv_deallocatedsdorpc(struct nfsmount *nmp, fhandle_t *fhp, off_t off, free(nd, M_TEMP); return (error); } - NFSD_DEBUG(4, "nfsrv_deallocatedsdorpc: aft allocaterpc=%d\n", + NFSD_DEBUG(4, "nfsrv_deallocatedsdorpc: aft deallocaterpc=%d\n", nd->nd_repstat); + /* Get rid of weak cache consistency data for now. */ + if ((nd->nd_flag & (ND_NOMOREDATA | ND_NFSV4 | ND_V4WCCATTR)) == + (ND_NFSV4 | ND_V4WCCATTR)) { + error = nfsv4_loadattr(nd, NULL, nap, NULL, NULL, 0, NULL, NULL, + NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL); + NFSD_DEBUG(4, "nfsrv_deallocatedsdorpc: wcc attr=%d\n", error); + if (error != 0) + goto nfsmout; + /* + * Get rid of Op# and status for next op. + */ + NFSM_DISSECT(tl, uint32_t *, 2 * NFSX_UNSIGNED); + if (*++tl != 0) + nd->nd_flag |= ND_NOMOREDATA; + } if (nd->nd_repstat == 0) { NFSM_DISSECT(tl, uint32_t *, 2 * NFSX_UNSIGNED); error = nfsv4_loadattr(nd, NULL, nap, NULL, NULL, 0, NULL, NULL, From owner-dev-commits-src-main@freebsd.org Sat Oct 2 23:17:33 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 79F8B6AC05A; Sat, 2 Oct 2021 23:17:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HMNDY30gtz3MlR; Sat, 2 Oct 2021 23:17:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 46B671BABE; Sat, 2 Oct 2021 23:17:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 192NHXif028065; Sat, 2 Oct 2021 23:17:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 192NHXTV028064; Sat, 2 Oct 2021 23:17:33 GMT (envelope-from git) Date: Sat, 2 Oct 2021 23:17:33 GMT Message-Id: <202110022317.192NHXTV028064@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Robert Wing Subject: git: 9acea1640411 - main - ffs: retire unused fsckpid mount option MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9acea16404117f2f54475640ff036c12130707d8 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 02 Oct 2021 23:17:33 -0000 The branch main has been updated by rew: URL: https://cgit.FreeBSD.org/src/commit/?id=9acea16404117f2f54475640ff036c12130707d8 commit 9acea16404117f2f54475640ff036c12130707d8 Author: Robert Wing AuthorDate: 2021-10-02 23:11:40 +0000 Commit: Robert Wing CommitDate: 2021-10-02 23:11:40 +0000 ffs: retire unused fsckpid mount option The fsckpid mount option was introduced in 927a12ae16433b50 along with a couple sysctl's to support SU+J with snapshots. However, those sysctl's were never used and eventually removed in f2620e9ceb3ede02. There are no in-tree consumers of this mount option. Reviewed by: mckusick, kib Differential Revision: https://reviews.freebsd.org/D32015 --- sys/ufs/ffs/ffs_alloc.c | 3 +- sys/ufs/ffs/ffs_inode.c | 2 +- sys/ufs/ffs/ffs_vfsops.c | 117 ++--------------------------------------------- sys/ufs/ufs/ufsmount.h | 2 - 4 files changed, 6 insertions(+), 118 deletions(-) diff --git a/sys/ufs/ffs/ffs_alloc.c b/sys/ufs/ffs/ffs_alloc.c index 771377b7cefc..6a262a798d1b 100644 --- a/sys/ufs/ffs/ffs_alloc.c +++ b/sys/ufs/ffs/ffs_alloc.c @@ -3236,8 +3236,7 @@ sysctl_ffs_fsck(SYSCTL_HANDLER_ARGS) return (EINVAL); } ump = VFSTOUFS(mp); - if ((mp->mnt_flag & MNT_RDONLY) && - ump->um_fsckpid != td->td_proc->p_pid) { + if (mp->mnt_flag & MNT_RDONLY) { vn_finished_write(mp); fdrop(fp, td); return (EROFS); diff --git a/sys/ufs/ffs/ffs_inode.c b/sys/ufs/ffs/ffs_inode.c index 1159259fb2b6..17a9dceeb654 100644 --- a/sys/ufs/ffs/ffs_inode.c +++ b/sys/ufs/ffs/ffs_inode.c @@ -132,7 +132,7 @@ ffs_update(vp, waitfor) if (waitfor) ip->i_flag &= ~(IN_SIZEMOD | IN_IBLKDATA); fs = ITOFS(ip); - if (fs->fs_ronly && ITOUMP(ip)->um_fsckpid == 0) + if (fs->fs_ronly) return (0); /* * If we are updating a snapshot and another process is currently diff --git a/sys/ufs/ffs/ffs_vfsops.c b/sys/ufs/ffs/ffs_vfsops.c index fd3b2689c2ee..94afcae05ba6 100644 --- a/sys/ufs/ffs/ffs_vfsops.c +++ b/sys/ufs/ffs/ffs_vfsops.c @@ -147,7 +147,7 @@ static struct buf_ops ffs_ops = { */ static const char *ffs_opts[] = { "acls", "async", "noatime", "noclusterr", "noclusterw", "noexec", "export", "force", "from", "groupquota", - "multilabel", "nfsv4acls", "fsckpid", "snapshot", "nosuid", "suiddir", + "multilabel", "nfsv4acls", "snapshot", "nosuid", "suiddir", "nosymfollow", "sync", "union", "userquota", "untrusted", NULL }; static int ffs_enxio_enable = 1; @@ -347,7 +347,6 @@ ffs_mount(struct mount *mp) struct thread *td; struct ufsmount *ump = NULL; struct fs *fs; - pid_t fsckpid = 0; int error, error1, flags; uint64_t mntorflags, saved_mnt_flag; accmode_t accmode; @@ -395,31 +394,6 @@ ffs_mount(struct mount *mp) vfs_deleteopt(mp->mnt_opt, "snapshot"); } - if (vfs_getopt(mp->mnt_optnew, "fsckpid", NULL, NULL) == 0 && - vfs_scanopt(mp->mnt_optnew, "fsckpid", "%d", &fsckpid) == 1) { - /* - * Once we have set the restricted PID, do not - * persist "fsckpid" in the options list. - */ - vfs_deleteopt(mp->mnt_optnew, "fsckpid"); - vfs_deleteopt(mp->mnt_opt, "fsckpid"); - if (mp->mnt_flag & MNT_UPDATE) { - if (VFSTOUFS(mp)->um_fs->fs_ronly == 0 && - vfs_flagopt(mp->mnt_optnew, "ro", NULL, 0) == 0) { - vfs_mount_error(mp, - "Checker enable: Must be read-only"); - return (EINVAL); - } - } else if (vfs_flagopt(mp->mnt_optnew, "ro", NULL, 0) == 0) { - vfs_mount_error(mp, - "Checker enable: Must be read-only"); - return (EINVAL); - } - /* Set to -1 if we are done */ - if (fsckpid == 0) - fsckpid = -1; - } - if (vfs_getopt(mp->mnt_optnew, "nfsv4acls", NULL, NULL) == 0) { if (mntorflags & MNT_ACLS) { vfs_mount_error(mp, @@ -443,18 +417,6 @@ ffs_mount(struct mount *mp) fs = ump->um_fs; odevvp = ump->um_odevvp; devvp = ump->um_devvp; - if (fsckpid == -1 && ump->um_fsckpid > 0) { - if ((error = ffs_flushfiles(mp, WRITECLOSE, td)) != 0 || - (error = ffs_sbupdate(ump, MNT_WAIT, 0)) != 0) - return (error); - g_topology_lock(); - /* - * Return to normal read-only mode. - */ - error = g_access(ump->um_cp, 0, -1, 0); - g_topology_unlock(); - ump->um_fsckpid = 0; - } if (fs->fs_ronly == 0 && vfs_flagopt(mp->mnt_optnew, "ro", NULL, 0)) { /* @@ -542,14 +504,6 @@ ffs_mount(struct mount *mp) return (error); if (fs->fs_ronly && !vfs_flagopt(mp->mnt_optnew, "ro", NULL, 0)) { - /* - * If we are running a checker, do not allow upgrade. - */ - if (ump->um_fsckpid > 0) { - vfs_mount_error(mp, - "Active checker, cannot upgrade to write"); - return (EINVAL); - } /* * If upgrade to read-write by non-root, then verify * that user has necessary permissions on the device. @@ -659,39 +613,6 @@ ffs_mount(struct mount *mp) mp->mnt_flag |= MNT_NFS4ACLS; MNT_IUNLOCK(mp); } - /* - * If this is a request from fsck to clean up the filesystem, - * then allow the specified pid to proceed. - */ - if (fsckpid > 0) { - if (ump->um_fsckpid != 0) { - vfs_mount_error(mp, - "Active checker already running on %s", - fs->fs_fsmnt); - return (EINVAL); - } - KASSERT(MOUNTEDSOFTDEP(mp) == 0, - ("soft updates enabled on read-only file system")); - g_topology_lock(); - /* - * Request write access. - */ - error = g_access(ump->um_cp, 0, 1, 0); - g_topology_unlock(); - if (error) { - vfs_mount_error(mp, - "Checker activation failed on %s", - fs->fs_fsmnt); - return (error); - } - ump->um_fsckpid = fsckpid; - if (fs->fs_snapinum[0] != 0) - ffs_snapshot_mount(mp); - fs->fs_mtime = time_second; - fs->fs_fmod = 1; - fs->fs_clean = 0; - (void) ffs_sbupdate(ump, MNT_WAIT, 0); - } /* * If this is a snapshot request, take the snapshot. @@ -771,29 +692,6 @@ ffs_mount(struct mount *mp) vrele(devvp); return (error); } - if (fsckpid > 0) { - KASSERT(MOUNTEDSOFTDEP(mp) == 0, - ("soft updates enabled on read-only file system")); - ump = VFSTOUFS(mp); - fs = ump->um_fs; - g_topology_lock(); - /* - * Request write access. - */ - error = g_access(ump->um_cp, 0, 1, 0); - g_topology_unlock(); - if (error) { - printf("WARNING: %s: Checker activation " - "failed\n", fs->fs_fsmnt); - } else { - ump->um_fsckpid = fsckpid; - if (fs->fs_snapinum[0] != 0) - ffs_snapshot_mount(mp); - fs->fs_mtime = time_second; - fs->fs_clean = 0; - (void) ffs_sbupdate(ump, MNT_WAIT, 0); - } - } } MNT_ILOCK(mp); @@ -1510,7 +1408,7 @@ ffs_unmount(mp, mntflags) if (MOUNTEDSOFTDEP(mp)) softdep_unmount(mp); MPASS(ump->um_softdep == NULL); - if (fs->fs_ronly == 0 || ump->um_fsckpid > 0) { + if (fs->fs_ronly == 0) { fs->fs_clean = fs->fs_flags & (FS_UNCLEAN|FS_NEEDSFSCK) ? 0 : 1; error = ffs_sbupdate(ump, MNT_WAIT, 0); if (ffs_fsfail_cleanup(ump, error)) @@ -1530,13 +1428,6 @@ ffs_unmount(mp, mntflags) free (ump->um_trimhash, M_TRIM); } g_topology_lock(); - if (ump->um_fsckpid > 0) { - /* - * Return to normal read-only mode. - */ - error = g_access(ump->um_cp, 0, -1, 0); - ump->um_fsckpid = 0; - } g_vfs_close(ump->um_cp); g_topology_unlock(); BO_LOCK(&ump->um_odevvp->v_bufobj); @@ -1800,7 +1691,7 @@ ffs_sync(mp, waitfor) suspended = 0; td = curthread; fs = ump->um_fs; - if (fs->fs_fmod != 0 && fs->fs_ronly != 0 && ump->um_fsckpid == 0) + if (fs->fs_fmod != 0 && fs->fs_ronly != 0) panic("%s: ffs_sync: modification on read-only filesystem", fs->fs_fsmnt); if (waitfor == MNT_LAZY) { @@ -2272,7 +2163,7 @@ ffs_sbupdate(ump, waitfor, suspended) fs = ump->um_fs; if (fs->fs_ronly == 1 && (ump->um_mountp->mnt_flag & (MNT_RDONLY | MNT_UPDATE)) != - (MNT_RDONLY | MNT_UPDATE) && ump->um_fsckpid == 0) + (MNT_RDONLY | MNT_UPDATE)) panic("ffs_sbupdate: write read-only filesystem"); /* * We use the superblock's buf to serialize calls to ffs_sbupdate(). diff --git a/sys/ufs/ufs/ufsmount.h b/sys/ufs/ufs/ufsmount.h index da9a22127125..a1a2cdb3f741 100644 --- a/sys/ufs/ufs/ufsmount.h +++ b/sys/ufs/ufs/ufsmount.h @@ -82,7 +82,6 @@ LIST_HEAD(trimlist_hashhead, ffs_blkfree_trim_params); * i - ufsmount interlock (UFS_LOCK / UFS_UNLOCK) * q - associated quota file is locked * r - ref to parent mount structure is held (vfs_busy / vfs_unbusy) - * u - managed by user process fsck_ufs */ struct ufsmount { struct mount *um_mountp; /* (r) filesystem vfs struct */ @@ -102,7 +101,6 @@ struct ufsmount { struct mtx um_lock; /* (c) Protects ufsmount & fs */ struct sx um_checkpath_lock; /* (c) Protects ufs_checkpath() result */ - pid_t um_fsckpid; /* (u) PID can do fsck sysctl */ struct mount_softdeps *um_softdep; /* (c) softdep mgmt structure */ struct vnode *um_quotas[MAXQUOTAS]; /* (q) pointer to quota files */ struct ucred *um_cred[MAXQUOTAS]; /* (q) quota file access cred */ From owner-dev-commits-src-main@freebsd.org Sun Oct 3 01:08:46 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 952556AD825; Sun, 3 Oct 2021 01:08:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HMQht3VnMz3l4J; Sun, 3 Oct 2021 01:08:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 581CF1D29E; Sun, 3 Oct 2021 01:08:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 19318kif074028; Sun, 3 Oct 2021 01:08:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19318kxT074027; Sun, 3 Oct 2021 01:08:46 GMT (envelope-from git) Date: Sun, 3 Oct 2021 01:08:46 GMT Message-Id: <202110030108.19318kxT074027@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alexander Motin Subject: git: 6df1359e5542 - main - sleepqueue(9): Remove sbinuptime() from sleepq_timeout(). MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mav X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 6df1359e5542f69179c142be1ea099d447e273d1 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Oct 2021 01:08:46 -0000 The branch main has been updated by mav: URL: https://cgit.FreeBSD.org/src/commit/?id=6df1359e5542f69179c142be1ea099d447e273d1 commit 6df1359e5542f69179c142be1ea099d447e273d1 Author: Alexander Motin AuthorDate: 2021-10-03 00:57:55 +0000 Commit: Alexander Motin CommitDate: 2021-10-03 01:08:41 +0000 sleepqueue(9): Remove sbinuptime() from sleepq_timeout(). Callout c_time is always bigger or equal than the scheduled time. It is also smaller than sbinuptime() and can't change while the callback is running. So we reliably can use it instead of sbinuptime() here. In case there was a race and the callout was rescheduled to the later time, the callback will be called again. According to profiles it saves ~5% of the timer interrupt time even with fast TSC timecounter. MFC after: 1 month --- sys/kern/subr_sleepqueue.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/kern/subr_sleepqueue.c b/sys/kern/subr_sleepqueue.c index b146a978a60c..61efb1b9f377 100644 --- a/sys/kern/subr_sleepqueue.c +++ b/sys/kern/subr_sleepqueue.c @@ -1040,7 +1040,8 @@ sleepq_timeout(void *arg) (void *)td, (long)td->td_proc->p_pid, (void *)td->td_name); thread_lock(td); - if (td->td_sleeptimo == 0 || td->td_sleeptimo > sbinuptime()) { + if (td->td_sleeptimo == 0 || + td->td_sleeptimo > td->td_slpcallout.c_time) { /* * The thread does not want a timeout (yet). */ From owner-dev-commits-src-main@freebsd.org Sun Oct 3 06:03:24 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C1EEB6B218E; Sun, 3 Oct 2021 06:03:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HMYDr4s0cz4V27; Sun, 3 Oct 2021 06:03:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 865A620F51; Sun, 3 Oct 2021 06:03:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 19363OVB077214; Sun, 3 Oct 2021 06:03:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19363ORK077213; Sun, 3 Oct 2021 06:03:24 GMT (envelope-from git) Date: Sun, 3 Oct 2021 06:03:24 GMT Message-Id: <202110030603.19363ORK077213@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kyle Evans Subject: git: 6b88668f0bfc - main - vfs: remove dead fifoop VOP_KQFILTER implementations MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevans X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 6b88668f0bfcca09035549e25d0f3c181cd537c8 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Oct 2021 06:03:24 -0000 The branch main has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=6b88668f0bfcca09035549e25d0f3c181cd537c8 commit 6b88668f0bfcca09035549e25d0f3c181cd537c8 Author: Kyle Evans AuthorDate: 2021-10-02 05:17:57 +0000 Commit: Kyle Evans CommitDate: 2021-10-03 06:02:51 +0000 vfs: remove dead fifoop VOP_KQFILTER implementations These began to become obsolete in d6d64f0f2c26 (r137739) and the deal was later sealed in 003e18aef4c4 (r137801) when vfs.fifofs.fops was dropped and vop-bypass for pipes became mandatory. PR: 225934 Suggested by: markj Reviewe by: kib, markj Differential Revision: https://reviews.freebsd.org/D32270 --- sys/fs/ext2fs/ext2_vnops.c | 18 ------------------ sys/ufs/ufs/ufs_vnops.c | 19 ------------------- 2 files changed, 37 deletions(-) diff --git a/sys/fs/ext2fs/ext2_vnops.c b/sys/fs/ext2fs/ext2_vnops.c index 367d48ab68f1..e9e8c07090da 100644 --- a/sys/fs/ext2fs/ext2_vnops.c +++ b/sys/fs/ext2fs/ext2_vnops.c @@ -135,7 +135,6 @@ static vop_listextattr_t ext2_listextattr; static vop_setextattr_t ext2_setextattr; static vop_vptofh_t ext2_vptofh; static vop_close_t ext2fifo_close; -static vop_kqfilter_t ext2fifo_kqfilter; /* Global vfs data structures for ext2. */ struct vop_vector ext2_vnodeops = { @@ -191,7 +190,6 @@ struct vop_vector ext2_fifoops = { .vop_fsync = ext2_fsync, .vop_getattr = ext2_getattr, .vop_inactive = ext2_inactive, - .vop_kqfilter = ext2fifo_kqfilter, .vop_pathconf = ext2_pathconf, .vop_print = ext2_print, .vop_read = VOP_PANIC, @@ -1642,22 +1640,6 @@ ext2fifo_close(struct vop_close_args *ap) return (fifo_specops.vop_close(ap)); } -/* - * Kqfilter wrapper for fifos. - * - * Fall through to ext2 kqfilter routines if needed - */ -static int -ext2fifo_kqfilter(struct vop_kqfilter_args *ap) -{ - int error; - - error = fifo_specops.vop_kqfilter(ap); - if (error) - error = vfs_kqfilter(ap); - return (error); -} - /* * Return POSIX pathconf information applicable to ext2 filesystems. */ diff --git a/sys/ufs/ufs/ufs_vnops.c b/sys/ufs/ufs/ufs_vnops.c index 00ec8f41f432..e962ef8ca48c 100644 --- a/sys/ufs/ufs/ufs_vnops.c +++ b/sys/ufs/ufs/ufs_vnops.c @@ -130,7 +130,6 @@ static vop_strategy_t ufs_strategy; static vop_symlink_t ufs_symlink; static vop_whiteout_t ufs_whiteout; static vop_close_t ufsfifo_close; -static vop_kqfilter_t ufsfifo_kqfilter; SYSCTL_NODE(_vfs, OID_AUTO, ufs, CTLFLAG_RD | CTLFLAG_MPSAFE, 0, "UFS filesystem"); @@ -2578,23 +2577,6 @@ ufsfifo_close(ap) return (fifo_specops.vop_close(ap)); } -/* - * Kqfilter wrapper for fifos. - * - * Fall through to ufs kqfilter routines if needed - */ -static int -ufsfifo_kqfilter(ap) - struct vop_kqfilter_args *ap; -{ - int error; - - error = fifo_specops.vop_kqfilter(ap); - if (error) - error = vfs_kqfilter(ap); - return (error); -} - /* * Return POSIX pathconf information applicable to ufs filesystems. */ @@ -3013,7 +2995,6 @@ struct vop_vector ufs_fifoops = { .vop_close = ufsfifo_close, .vop_getattr = ufs_getattr, .vop_inactive = ufs_inactive, - .vop_kqfilter = ufsfifo_kqfilter, .vop_pathconf = ufs_pathconf, .vop_print = ufs_print, .vop_read = VOP_PANIC, From owner-dev-commits-src-main@freebsd.org Sun Oct 3 16:03:54 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 44BCF66A11A; Sun, 3 Oct 2021 16:03:54 +0000 (UTC) (envelope-from mpp302@gmail.com) Received: from mail-ed1-f51.google.com (mail-ed1-f51.google.com [209.85.208.51]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HMpYj1Jr5z3PDN; Sun, 3 Oct 2021 16:03:53 +0000 (UTC) (envelope-from mpp302@gmail.com) Received: by mail-ed1-f51.google.com with SMTP id bm13so4945644edb.8; Sun, 03 Oct 2021 09:03:53 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:subject:to:references:from:cc:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=c4lL/FMycZXkRlTj8HSkHnwY7EPJlAxEjattaxgWL9c=; b=SxOCQTjpIsztys8QMHmuAHyIK1l1DUT+vXs+75Jx0FJFGhSlLKOH1WAIQpPFKuV7a8 cu36Hj3FATE7ZgcSDvs3LFvKEqwGtHTWK/ikKNsjCnaazQzlN0P9heJfpCL+BMkaWO6M T/Bn8Y9YlXmeWJW96vj3zlZ3rxzi9aBLowqFukM7xuL5XIou31l8oGM5usHY/u3Vwl4Z kls+FhkyXpaNbvdT2VF+NkrgVLxxtDeCDWbjCitbbt+If9iXdSYZw9CEosDjAONoCuVW nrg2LJUH2Mw431e7wedlTRP6fuAO8+0junILCfgM512pCypox5d8xemCekXh+jR+mVbM eXhw== X-Gm-Message-State: AOAM530f6MpbU8I4350j5C5qk4hJiqKMABHaGLVQrzheWwx6FQ/txllA HwTExFG3Yh3hxZO+GfGU+WZRgsw8L3FFIg== X-Google-Smtp-Source: ABdhPJwgfH3Mi2/WWGMmwhXaAfgYElhv35UHWP2Wd/EA5LZg3ASvIofsJ3YgjX1tnrVptFjpUzWA9w== X-Received: by 2002:a17:906:5e17:: with SMTP id n23mr8808980eju.258.1633277026533; Sun, 03 Oct 2021 09:03:46 -0700 (PDT) Received: from [192.168.0.15] (ip5f5bd4ef.dynamic.kabel-deutschland.de. [95.91.212.239]) by smtp.gmail.com with ESMTPSA id f10sm6074727edu.70.2021.10.03.09.03.45 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 03 Oct 2021 09:03:45 -0700 (PDT) Subject: Re: git: 903873ce1560 - main - Implement and use new mixer(3) library for FreeBSD. To: Hans Petter Selasky , src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org References: <202109221803.18MI3gdA013391@gitrepo.freebsd.org> From: Mateusz Piotrowski <0mp@FreeBSD.org> Cc: Christos Margiolis Message-ID: <3d6a23c3-ad2c-4c5b-849e-1ef12dbf8955@FreeBSD.org> Date: Sun, 3 Oct 2021 18:03:45 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:78.0) Gecko/20100101 Thunderbird/78.14.0 MIME-Version: 1.0 In-Reply-To: <202109221803.18MI3gdA013391@gitrepo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-Rspamd-Queue-Id: 4HMpYj1Jr5z3PDN X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of mpp302@gmail.com designates 209.85.208.51 as permitted sender) smtp.mailfrom=mpp302@gmail.com X-Spamd-Result: default: False [-3.00 / 15.00]; ARC_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; RCVD_TLS_ALL(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17:c]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[FreeBSD.org]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCPT_COUNT_FIVE(0.00)[5]; NEURAL_HAM_LONG(-1.00)[-1.000]; RCVD_COUNT_THREE(0.00)[3]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_SHORT(-1.00)[-1.000]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[209.85.208.51:from]; FORGED_SENDER(0.30)[0mp@FreeBSD.org,mpp302@gmail.com]; RWL_MAILSPIKE_POSSIBLE(0.00)[209.85.208.51:from]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; FROM_NEQ_ENVFROM(0.00)[0mp@FreeBSD.org,mpp302@gmail.com]; MAILMAN_DEST(0.00)[dev-commits-src-main,dev-commits-src-all]; RECEIVED_SPAMHAUS_PBL(0.00)[95.91.212.239:received] X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Oct 2021 16:03:54 -0000 On 22/09/2021 20:03, Hans Petter Selasky wrote: > The branch main has been updated by hselasky: > > URL: https://cgit.FreeBSD.org/src/commit/?id=903873ce15600fc02a0ea42cbf888cff232b411d > > commit 903873ce15600fc02a0ea42cbf888cff232b411d > Author: Hans Petter Selasky > AuthorDate: 2021-09-22 13:42:51 +0000 > Commit: Hans Petter Selasky > CommitDate: 2021-09-22 17:43:56 +0000 > > Implement and use new mixer(3) library for FreeBSD. > > Wiki article: https://wiki.freebsd.org/SummerOfCode2021Projects/SoundMixerImprovements > This project was part of Google Summer of Code 2021. > This may be a bit late to discuss but the new mixer has a completely different set of options and command-line arguments. In addition to that, the output of the command is different. Shouldn't we keep supporting the previous way of interacting with mixer? I know that people are scripting mixer and its output in production in order to control soundcards. Are there any good reasons to keep the new mixer(8) as it is now while keeping the old name? Perhaps we could change the name of the new mixer to, e.g., newmixer. Users are going to have to rewrite their scripts for mixer(8) anyway for 14.0. Best, Mateusz Piotrowski From owner-dev-commits-src-main@freebsd.org Sun Oct 3 18:36:47 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 54DC066C8A1; Sun, 3 Oct 2021 18:36:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HMsy71xf8z3rwn; Sun, 3 Oct 2021 18:36:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 22C3B2E9E; Sun, 3 Oct 2021 18:36:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 193IalnV074862; Sun, 3 Oct 2021 18:36:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 193IalKi074861; Sun, 3 Oct 2021 18:36:47 GMT (envelope-from git) Date: Sun, 3 Oct 2021 18:36:47 GMT Message-Id: <202110031836.193IalKi074861@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Jessica Clarke Subject: git: 1be2e16df1d2 - main - riscv: Add a stub pmap_change_attr implementation MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jrtc27 X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 1be2e16df1d29148aee83964330a71ae403c6078 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Oct 2021 18:36:47 -0000 The branch main has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=1be2e16df1d29148aee83964330a71ae403c6078 commit 1be2e16df1d29148aee83964330a71ae403c6078 Author: Jessica Clarke AuthorDate: 2021-10-03 18:33:47 +0000 Commit: Jessica Clarke CommitDate: 2021-10-03 18:33:47 +0000 riscv: Add a stub pmap_change_attr implementation pmap_change_attr is required by drm-kmod so we need the function to exist. Since the Svpbmt extension is on the horizon we will likely end up with a real implementation of it, so this stub implementation does all the necessary page table walking to validate the input, ensuring that no new errors are returned once it's implemented fully (other than due to out of memory conditions when demoting L2 entries) and providing a skeleton for that future implementation. Reviewed by: markj MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D31996 --- sys/riscv/include/pmap.h | 1 + sys/riscv/riscv/pmap.c | 94 ++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 95 insertions(+) diff --git a/sys/riscv/include/pmap.h b/sys/riscv/include/pmap.h index 599adfa4ce19..024bc3743f67 100644 --- a/sys/riscv/include/pmap.h +++ b/sys/riscv/include/pmap.h @@ -144,6 +144,7 @@ struct thread; void pmap_activate_boot(pmap_t); void pmap_activate_sw(struct thread *); void pmap_bootstrap(vm_offset_t, vm_paddr_t, vm_size_t); +int pmap_change_attr(vm_offset_t va, vm_size_t size, int mode); void pmap_kenter_device(vm_offset_t, vm_size_t, vm_paddr_t); vm_paddr_t pmap_kextract(vm_offset_t va); void pmap_kremove(vm_offset_t); diff --git a/sys/riscv/riscv/pmap.c b/sys/riscv/riscv/pmap.c index 8f76881478b9..df80f07df0ca 100644 --- a/sys/riscv/riscv/pmap.c +++ b/sys/riscv/riscv/pmap.c @@ -310,6 +310,8 @@ static void _pmap_unwire_ptp(pmap_t pmap, vm_offset_t va, vm_page_t m, struct spglist *free); static int pmap_unuse_pt(pmap_t, vm_offset_t, pd_entry_t, struct spglist *); +static int pmap_change_attr_locked(vm_offset_t va, vm_size_t size, int mode); + #define pmap_clear(pte) pmap_store(pte, 0) #define pmap_clear_bits(pte, bits) atomic_clear_64(pte, bits) #define pmap_load_store(pte, entry) atomic_swap_64(pte, entry) @@ -4252,6 +4254,98 @@ pmap_page_set_memattr(vm_page_t m, vm_memattr_t ma) { m->md.pv_memattr = ma; + + /* + * If "m" is a normal page, update its direct mapping. This update + * can be relied upon to perform any cache operations that are + * required for data coherence. + */ + if ((m->flags & PG_FICTITIOUS) == 0 && + pmap_change_attr(PHYS_TO_DMAP(VM_PAGE_TO_PHYS(m)), PAGE_SIZE, + m->md.pv_memattr) != 0) + panic("memory attribute change on the direct map failed"); +} + +/* + * Changes the specified virtual address range's memory type to that given by + * the parameter "mode". The specified virtual address range must be + * completely contained within either the direct map or the kernel map. + * + * Returns zero if the change completed successfully, and either EINVAL or + * ENOMEM if the change failed. Specifically, EINVAL is returned if some part + * of the virtual address range was not mapped, and ENOMEM is returned if + * there was insufficient memory available to complete the change. In the + * latter case, the memory type may have been changed on some part of the + * virtual address range. + */ +int +pmap_change_attr(vm_offset_t va, vm_size_t size, int mode) +{ + int error; + + PMAP_LOCK(kernel_pmap); + error = pmap_change_attr_locked(va, size, mode); + PMAP_UNLOCK(kernel_pmap); + return (error); +} + +static int +pmap_change_attr_locked(vm_offset_t va, vm_size_t size, int mode) +{ + vm_offset_t base, offset, tmpva; + pd_entry_t *l1, l1e; + pd_entry_t *l2, l2e; + pt_entry_t *l3, l3e; + + PMAP_LOCK_ASSERT(kernel_pmap, MA_OWNED); + base = trunc_page(va); + offset = va & PAGE_MASK; + size = round_page(offset + size); + + if (!VIRT_IN_DMAP(base) && + !(base >= VM_MIN_KERNEL_ADDRESS && base < VM_MAX_KERNEL_ADDRESS)) + return (EINVAL); + + for (tmpva = base; tmpva < base + size; ) { + l1 = pmap_l1(kernel_pmap, tmpva); + if (l1 == NULL || ((l1e = pmap_load(l1)) & PTE_V) == 0) + return (EINVAL); + if ((l1e & PTE_RWX) != 0) { + /* + * TODO: Demote if attributes don't match and there + * isn't an L1 page left in the range, and update the + * L1 entry if the attributes don't match but there is + * an L1 page left in the range, once we support the + * upcoming Svpbmt extension. + */ + tmpva = (tmpva & ~L1_OFFSET) + L1_SIZE; + continue; + } + l2 = pmap_l1_to_l2(l1, tmpva); + if (l2 == NULL || ((l2e = pmap_load(l2)) & PTE_V) == 0) + return (EINVAL); + if ((l2e & PTE_RWX) != 0) { + /* + * TODO: Demote if attributes don't match and there + * isn't an L2 page left in the range, and update the + * L2 entry if the attributes don't match but there is + * an L2 page left in the range, once we support the + * upcoming Svpbmt extension. + */ + tmpva = (tmpva & ~L2_OFFSET) + L2_SIZE; + continue; + } + l3 = pmap_l2_to_l3(l2, tmpva); + if (l3 == NULL || ((l3e = pmap_load(l3)) & PTE_V) == 0) + return (EINVAL); + /* + * TODO: Update the L3 entry if the attributes don't match once + * we support the upcoming Svpbmt extension. + */ + tmpva += PAGE_SIZE; + } + + return (0); } /* From owner-dev-commits-src-main@freebsd.org Sun Oct 3 18:36:48 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6967B66C7DC; Sun, 3 Oct 2021 18:36:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HMsy82bC6z3ryc; Sun, 3 Oct 2021 18:36:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3A7C82B43; Sun, 3 Oct 2021 18:36:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 193Iameg074886; Sun, 3 Oct 2021 18:36:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 193IamFT074885; Sun, 3 Oct 2021 18:36:48 GMT (envelope-from git) Date: Sun, 3 Oct 2021 18:36:48 GMT Message-Id: <202110031836.193IamFT074885@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Jessica Clarke Subject: git: 7047568821a9 - main - libgcc_s: Export 64-bit int to 128-bit float functions MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jrtc27 X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 7047568821a9019359a8518e1f1481f73d6e5445 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Oct 2021 18:36:48 -0000 The branch main has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=7047568821a9019359a8518e1f1481f73d6e5445 commit 7047568821a9019359a8518e1f1481f73d6e5445 Author: Jessica Clarke AuthorDate: 2021-10-03 18:34:25 +0000 Commit: Jessica Clarke CommitDate: 2021-10-03 18:34:25 +0000 libgcc_s: Export 64-bit int to 128-bit float functions The corresponding 32-bit int and 128-bit int functions were added in 790a6be5a169, as were all combinations of the float to int functions, but these two were overlooked. __floatditf is needed to build curl for riscv as there's a signed 64-bit int to 128-bit float conversion in lib/progress.c's trspeed as of 7.77.0. Reviewed by: dim MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D31997 --- lib/libgcc_s/Symbol.map | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/libgcc_s/Symbol.map b/lib/libgcc_s/Symbol.map index 2580623d778b..292932198170 100644 --- a/lib/libgcc_s/Symbol.map +++ b/lib/libgcc_s/Symbol.map @@ -162,8 +162,10 @@ GCC_4.6.0 { __fixunstfdi; __fixunstfsi; __fixunstfti; + __floatditf; __floatsitf; __floattitf; + __floatunditf; __floatunsitf; __floatuntitf; __getf2; From owner-dev-commits-src-main@freebsd.org Sun Oct 3 18:36:49 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C509E66C7DD; Sun, 3 Oct 2021 18:36:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HMsy94ZHJz3s45; Sun, 3 Oct 2021 18:36:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 575932D9C; Sun, 3 Oct 2021 18:36:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 193IanjD074917; Sun, 3 Oct 2021 18:36:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 193Ian5c074916; Sun, 3 Oct 2021 18:36:49 GMT (envelope-from git) Date: Sun, 3 Oct 2021 18:36:49 GMT Message-Id: <202110031836.193Ian5c074916@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Jessica Clarke Subject: git: 8167c92f65bc - main - LinuxKPI: Add more #ifdef VM_MEMATTR_WRITE_COMBINING guards MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jrtc27 X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 8167c92f65bc20145467b3b98c842cde57736900 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Oct 2021 18:36:49 -0000 The branch main has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=8167c92f65bc20145467b3b98c842cde57736900 commit 8167c92f65bc20145467b3b98c842cde57736900 Author: Jessica Clarke AuthorDate: 2021-10-03 18:34:40 +0000 Commit: Jessica Clarke CommitDate: 2021-10-03 18:34:40 +0000 LinuxKPI: Add more #ifdef VM_MEMATTR_WRITE_COMBINING guards One of the three uses is already guarded; this guards the remaining ones to support architectures like riscv that do not provide write-combining, and is needed to build drm-kmod on riscv. Reviewed by: hselasky, manu MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D31999 --- sys/compat/linuxkpi/common/include/linux/io.h | 4 ++++ sys/compat/linuxkpi/common/include/linux/page.h | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/sys/compat/linuxkpi/common/include/linux/io.h b/sys/compat/linuxkpi/common/include/linux/io.h index 0104eea90ace..074417b892f9 100644 --- a/sys/compat/linuxkpi/common/include/linux/io.h +++ b/sys/compat/linuxkpi/common/include/linux/io.h @@ -411,8 +411,12 @@ void *_ioremap_attr(vm_paddr_t phys_addr, unsigned long size, int attr); #define ioremap(addr, size) \ _ioremap_attr((addr), (size), VM_MEMATTR_UNCACHEABLE) #endif +#ifdef VM_MEMATTR_WRITE_COMBINING #define ioremap_wc(addr, size) \ _ioremap_attr((addr), (size), VM_MEMATTR_WRITE_COMBINING) +#else +#define ioremap_wc(addr, size) ioremap_nocache(addr, size) +#endif #define ioremap_wb(addr, size) \ _ioremap_attr((addr), (size), VM_MEMATTR_WRITE_BACK) void iounmap(void *addr); diff --git a/sys/compat/linuxkpi/common/include/linux/page.h b/sys/compat/linuxkpi/common/include/linux/page.h index ca7365419e22..0c3d456d6ec0 100644 --- a/sys/compat/linuxkpi/common/include/linux/page.h +++ b/sys/compat/linuxkpi/common/include/linux/page.h @@ -83,8 +83,12 @@ pgprot2cachemode(pgprot_t prot) #define clear_page(page) memset(page, 0, PAGE_SIZE) #define pgprot_noncached(prot) \ (((prot) & VM_PROT_ALL) | cachemode2protval(VM_MEMATTR_UNCACHEABLE)) +#ifdef VM_MEMATTR_WRITE_COMBINING #define pgprot_writecombine(prot) \ (((prot) & VM_PROT_ALL) | cachemode2protval(VM_MEMATTR_WRITE_COMBINING)) +#else +#define pgprot_writecombine(prot) pgprot_noncached(prot) +#endif #undef PAGE_MASK #define PAGE_MASK (~(PAGE_SIZE-1)) From owner-dev-commits-src-main@freebsd.org Sun Oct 3 18:36:50 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C6E5E66C6B7; Sun, 3 Oct 2021 18:36:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HMsyB4jYCz3rnq; Sun, 3 Oct 2021 18:36:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 824C13008; Sun, 3 Oct 2021 18:36:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 193IaoAJ074941; Sun, 3 Oct 2021 18:36:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 193IaoTI074940; Sun, 3 Oct 2021 18:36:50 GMT (envelope-from git) Date: Sun, 3 Oct 2021 18:36:50 GMT Message-Id: <202110031836.193IaoTI074940@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Jessica Clarke Subject: git: 2404f03fca7e - main - riscv: Add vt and kbdmux to GENERIC for video console support MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jrtc27 X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2404f03fca7e5f62946d0da0f614c9db75a0df09 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Oct 2021 18:36:50 -0000 The branch main has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=2404f03fca7e5f62946d0da0f614c9db75a0df09 commit 2404f03fca7e5f62946d0da0f614c9db75a0df09 Author: Jessica Clarke AuthorDate: 2021-10-03 18:34:53 +0000 Commit: Jessica Clarke CommitDate: 2021-10-03 18:34:53 +0000 riscv: Add vt and kbdmux to GENERIC for video console support No in-tree drivers are supported for RISC-V (given it supports UEFI we could enable the EFI framebuffer, but U-Boot has very limited hardware support and EDK2 remains a work in progress), but drm-kmod exists with drivers for video cards that can be used with the HiFive Unmatched. Reviewed by: imp, jhb MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D32001 --- sys/riscv/conf/GENERIC | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sys/riscv/conf/GENERIC b/sys/riscv/conf/GENERIC index ae7f1c166273..a02a30d4834f 100644 --- a/sys/riscv/conf/GENERIC +++ b/sys/riscv/conf/GENERIC @@ -134,6 +134,10 @@ device uart # Generic UART driver device uart_lowrisc # lowRISC UART driver device uart_ns8250 # ns8250-type UART driver +# Console +device vt +device kbdmux + # RTC device goldfish_rtc # QEMU RTC From owner-dev-commits-src-main@freebsd.org Sun Oct 3 18:36:52 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3E06E66CA08; Sun, 3 Oct 2021 18:36:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HMsyC6Pj3z3s4G; Sun, 3 Oct 2021 18:36:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AD2172D34; Sun, 3 Oct 2021 18:36:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 193IapRp074965; Sun, 3 Oct 2021 18:36:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 193IapO6074964; Sun, 3 Oct 2021 18:36:51 GMT (envelope-from git) Date: Sun, 3 Oct 2021 18:36:51 GMT Message-Id: <202110031836.193IapO6074964@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Jessica Clarke Subject: git: 31776afdc79d - main - pci_pci: Support growing bus ranges in bus_adjust_resource for NEW_PCIB MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jrtc27 X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 31776afdc79d5fb1ea211cc2a69c17c62b3dc8ff Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Oct 2021 18:36:52 -0000 The branch main has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=31776afdc79d5fb1ea211cc2a69c17c62b3dc8ff commit 31776afdc79d5fb1ea211cc2a69c17c62b3dc8ff Author: Jessica Clarke AuthorDate: 2021-10-03 18:35:26 +0000 Commit: Jessica Clarke CommitDate: 2021-10-03 18:35:26 +0000 pci_pci: Support growing bus ranges in bus_adjust_resource for NEW_PCIB This is the same underlying problem as 262459806433, just for bus ranges rather than windows. SiFive's HiFive Unmatched has the following topology: Root Port <---> Bridge <---> Bridge <-+-> Bridge <---> (Unused) (pcib0) (pcib1) (pcib2) | (pcib3) +-> Bridge <---> xHCI | (pcib4) +-> Bridge <---> M.2 E-key | (pcib5) +-> Bridge <---> M.2 M-key | (pcib6) +-> Bridge <---> x16 slot (pcib7) If a device is plugged into the x16 slot that itself has a bridge, such as many graphics cards, we currently fail to allocate a bus number for its child bus (and so pcib_attach_child skips adding a child bus for further enumeration) as, when the new child bridge attaches, it attempts to allocate a bus number from its parent (pcib7) which in turn attempts to grow its own bus range by calling bus_adjust_resource on its own parent (pcib2) whose bus rman cannot accommodate the request and needs to itself be extended by calling its own parent (pcib1). Note that pcib3-7 do not face the same issue when they attach since pcib1 ends up managing bus numbers 1-255 from the beginning and so never needs to grow its own range. Reviewed by: jhb, mav MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D32011 --- sys/dev/pci/pci_pci.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/sys/dev/pci/pci_pci.c b/sys/dev/pci/pci_pci.c index 2b86f2f50e11..cecf75024d3f 100644 --- a/sys/dev/pci/pci_pci.c +++ b/sys/dev/pci/pci_pci.c @@ -2364,7 +2364,20 @@ pcib_adjust_resource(device_t bus, device_t child, int type, struct resource *r, start, end)); #ifdef PCI_RES_BUS - if (type != PCI_RES_BUS) + if (type == PCI_RES_BUS) { + /* + * If our bus range isn't big enough to grow the sub-allocation + * then we need to grow our bus range. Any request that would + * require us to decrease the start of our own bus range is + * invalid, we can only extend the end; ignore such requests + * and let rman_adjust_resource fail below. + */ + if (start >= sc->bus.sec && end > sc->bus.sub) { + error = pcib_grow_subbus(&sc->bus, end); + if (error != 0) + return (error); + } + } else #endif { /* From owner-dev-commits-src-main@freebsd.org Sun Oct 3 19:08:46 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5EFE566D0D3; Sun, 3 Oct 2021 19:08:46 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (turbocat.net [IPv6:2a01:4f8:c17:6c4b::2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4HMtg21gMlz3tMw; Sun, 3 Oct 2021 19:08:46 +0000 (UTC) (envelope-from hps@selasky.org) Received: from hps2020.home.selasky.org (unknown [178.17.145.105]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 1A83D2600F2; Sun, 3 Oct 2021 21:08:38 +0200 (CEST) Subject: Re: git: 903873ce1560 - main - Implement and use new mixer(3) library for FreeBSD. To: Mateusz Piotrowski <0mp@FreeBSD.org>, src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Cc: Christos Margiolis References: <202109221803.18MI3gdA013391@gitrepo.freebsd.org> <3d6a23c3-ad2c-4c5b-849e-1ef12dbf8955@FreeBSD.org> From: Hans Petter Selasky Message-ID: <487fa0f2-d845-438f-a035-8b7ccba4285a@selasky.org> Date: Sun, 3 Oct 2021 21:08:27 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:78.0) Gecko/20100101 Thunderbird/78.14.0 MIME-Version: 1.0 In-Reply-To: <3d6a23c3-ad2c-4c5b-849e-1ef12dbf8955@FreeBSD.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4HMtg21gMlz3tMw X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Oct 2021 19:08:46 -0000 On 10/3/21 6:03 PM, Mateusz Piotrowski wrote: > On 22/09/2021 20:03, Hans Petter Selasky wrote: >> The branch main has been updated by hselasky: >> >> URL: >> https://cgit.FreeBSD.org/src/commit/?id=903873ce15600fc02a0ea42cbf888cff232b411d >> >> >> commit 903873ce15600fc02a0ea42cbf888cff232b411d >> Author:     Hans Petter Selasky >> AuthorDate: 2021-09-22 13:42:51 +0000 >> Commit:     Hans Petter Selasky >> CommitDate: 2021-09-22 17:43:56 +0000 >> >>      Implement and use new mixer(3) library for FreeBSD. >>      Wiki article: >> https://wiki.freebsd.org/SummerOfCode2021Projects/SoundMixerImprovements >>      This project was part of Google Summer of Code 2021. > > This may be a bit late to discuss but the new mixer has a completely > different > set of options and command-line arguments. In addition to that, > the output of the command is different. > > Shouldn't we keep supporting the previous way of interacting with mixer? > I know that people are scripting mixer and its output in production > in order to control soundcards. Are there any good reasons to keep the new > mixer(8) as it is now while keeping the old name? Perhaps we could change > the name of the new mixer to, e.g., newmixer. Users are going to have to > rewrite their scripts for mixer(8) anyway for 14.0. > Hi Mateusz, It depends what level of compatibility you need. If you have a script parsing mixer output, then it needs to be binary compatible so to speak. That means some new features like "mute" won't work. It looks like all BSDs have diverged in the mixer area. NetBSD calls it mixerctl: https://man.netbsd.org/mixerctl.1 During the GSoc there was no requirement for binary compatibility for the mixer utility. Only in the kernel APIs are backwards compatible. Would it help to make a port, like "oldmixer", under "audio" ? Christos, feel free to chime in. --HPS From owner-dev-commits-src-main@freebsd.org Sun Oct 3 21:57:00 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 06D5666FEA7; Sun, 3 Oct 2021 21:57:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HMyP76Gs5z4gRg; Sun, 3 Oct 2021 21:56:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B36AE5966; Sun, 3 Oct 2021 21:56:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 193Lux54041353; Sun, 3 Oct 2021 21:56:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 193Luxix041352; Sun, 3 Oct 2021 21:56:59 GMT (envelope-from git) Date: Sun, 3 Oct 2021 21:56:59 GMT Message-Id: <202110032156.193Luxix041352@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Colin Percival Subject: git: b841148bbbdc - main - loader: Refactor readahead adjustment in bcache MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cperciva X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b841148bbbdc967c871e8742a6f0b7b17b2d1d91 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Oct 2021 21:57:00 -0000 The branch main has been updated by cperciva: URL: https://cgit.FreeBSD.org/src/commit/?id=b841148bbbdc967c871e8742a6f0b7b17b2d1d91 commit b841148bbbdc967c871e8742a6f0b7b17b2d1d91 Author: Colin Percival AuthorDate: 2021-10-03 19:10:36 +0000 Commit: Colin Percival CommitDate: 2021-10-03 19:10:36 +0000 loader: Refactor readahead adjustment in bcache While I'm here, add an explanatory comment. No functional change intended. Reviewed by: imp, tsoome (previous version) MFC after: 1 week Sponsored by: https://patreon.com/cperciva Differential Revision: https://reviews.freebsd.org/D32249 --- stand/common/bcache.c | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/stand/common/bcache.c b/stand/common/bcache.c index 0eeb7e74ee96..b3b8b22c7d21 100644 --- a/stand/common/bcache.c +++ b/stand/common/bcache.c @@ -238,17 +238,27 @@ read_strategy(void *devdata, int rw, daddr_t blk, size_t size, if (BCACHE_LOOKUP(bc, (daddr_t)(blk + i))) { bcache_misses += (nblk - i); complete = 0; - if (nblk - i > BCACHE_MINREADAHEAD && bc->ra > BCACHE_MINREADAHEAD) - bc->ra >>= 1; /* reduce read ahead */ break; } else { bcache_hits++; } } - if (complete) { /* whole set was in cache, return it */ + /* + * Adjust read-ahead size if appropriate. Subject to the requirement + * that bc->ra must stay in between MINREADAHEAD and READAHEAD, we + * increase it when we notice that readahead was useful and decrease + * it when we notice that readahead was not useful. + */ + if (complete) { if (bc->ra < BCACHE_READAHEAD) - bc->ra <<= 1; /* increase read ahead */ + bc->ra <<= 1; /* increase read ahead */ + } else { + if (nblk - i > BCACHE_MINREADAHEAD && bc->ra > BCACHE_MINREADAHEAD) + bc->ra >>= 1; /* reduce read ahead */ + } + + if (complete) { /* whole set was in cache, return it */ bcopy(bc->bcache_data + (bcache_blksize * BHASH(bc, blk)), buf, size); goto done; } From owner-dev-commits-src-main@freebsd.org Sun Oct 3 21:57:02 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 41AA666FD9D; Sun, 3 Oct 2021 21:57:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HMyPB14z3z4gkb; Sun, 3 Oct 2021 21:57:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F01945B9B; Sun, 3 Oct 2021 21:57:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 193Lv17Q041401; Sun, 3 Oct 2021 21:57:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 193Lv1td041400; Sun, 3 Oct 2021 21:57:01 GMT (envelope-from git) Date: Sun, 3 Oct 2021 21:57:01 GMT Message-Id: <202110032157.193Lv1td041400@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Colin Percival Subject: git: 248682a58915 - main - loader bcache: Allow readahead up to 256 kB I/Os MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cperciva X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 248682a589159619aa5f2019e415a423e849e327 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Oct 2021 21:57:02 -0000 The branch main has been updated by cperciva: URL: https://cgit.FreeBSD.org/src/commit/?id=248682a589159619aa5f2019e415a423e849e327 commit 248682a589159619aa5f2019e415a423e849e327 Author: Colin Percival AuthorDate: 2021-10-03 21:55:10 +0000 Commit: Colin Percival CommitDate: 2021-10-03 21:55:10 +0000 loader bcache: Allow readahead up to 256 kB I/Os Prior to this commit, the loader would perform readaheads of up to 128 kB; when booting on a UFS filesystem this resulted in a series of 160 kB reads (32 kB request + 128 kB readahead). This commit allows readaheads to be longer, subject to a total I/O size limit of 256 kB; i.e. 32 kB read requests will have added readaheads of up to 224 kB. In my testing on an EC2 c5.xlarge instance, this change reduces the boot time by roughly 80 ms. Reviewed by: tsoome MFC after: 1 week Sponsored by: https://www.patreon.com/cperciva Differential Revision: https://reviews.freebsd.org/D32251 --- stand/common/bcache.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/stand/common/bcache.c b/stand/common/bcache.c index b79d609b198b..99c78b0346b7 100644 --- a/stand/common/bcache.c +++ b/stand/common/bcache.c @@ -86,8 +86,9 @@ static u_int bcache_rablks; #define BHASH(bc, blkno) ((blkno) & ((bc)->bcache_nblks - 1)) #define BCACHE_LOOKUP(bc, blkno) \ ((bc)->bcache_ctl[BHASH((bc), (blkno))].bc_blkno != (blkno)) -#define BCACHE_READAHEAD 256 +#define BCACHE_READAHEAD 512 #define BCACHE_MINREADAHEAD 32 +#define BCACHE_MAXIOWRA 512 static void bcache_invalidate(struct bcache *bc, daddr_t blkno); static void bcache_insert(struct bcache *bc, daddr_t blkno); @@ -324,6 +325,8 @@ read_strategy(void *devdata, int rw, daddr_t blk, size_t size, if (ra != 0 && ra != bc->bcache_nblks) { /* do we have RA space? */ ra = MIN(bc->ra, ra - 1); ra = rounddown(ra, 16); /* multiple of 16 blocks */ + if (ra + p_size > BCACHE_MAXIOWRA) + ra = BCACHE_MAXIOWRA - p_size; bc->ralen = ra; p_size += ra; } else { From owner-dev-commits-src-main@freebsd.org Sun Oct 3 21:57:01 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 16F2E66FCBD; Sun, 3 Oct 2021 21:57:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HMyP900vwz4gkV; Sun, 3 Oct 2021 21:57:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D454A5CEC; Sun, 3 Oct 2021 21:57:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 193Lv0kl041377; Sun, 3 Oct 2021 21:57:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 193Lv0UP041376; Sun, 3 Oct 2021 21:57:00 GMT (envelope-from git) Date: Sun, 3 Oct 2021 21:57:00 GMT Message-Id: <202110032157.193Lv0UP041376@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Colin Percival Subject: git: 04b9b7c507c5 - main - loader bcache: Track unconsumed readahead MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cperciva X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 04b9b7c507c52daf7b2999329a50825db098151f Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Oct 2021 21:57:01 -0000 The branch main has been updated by cperciva: URL: https://cgit.FreeBSD.org/src/commit/?id=04b9b7c507c52daf7b2999329a50825db098151f commit 04b9b7c507c52daf7b2999329a50825db098151f Author: Colin Percival AuthorDate: 2021-10-03 21:49:41 +0000 Commit: Colin Percival CommitDate: 2021-10-03 21:54:09 +0000 loader bcache: Track unconsumed readahead The loader bcache attempts to determine whether readahead is useful, increasing or decreasing its readahead length based on whether a read could be serviced out of the cache. This resulted in two unfortunate behaviours: 1. A series of consecutive 32 kB reads are requested and bcache performs 16 kB readaheads. For each read, bcache determines that, since only the first 16 kB is already in the cache, the readahead was not useful, and keeps the readahead at the minimum (16 kB) level. 2. A series of consecutive 32 kB reads are requested and bcache starts with a 32 kB readahead resulting in a 64 kB being read on the first request. The second 32 kB request can be serviced out of the cache, and bcache responds by doubling its readahead length to 64 kB. The third 32 kB request cannot be serviced out of the cache, and bcache reduces its readahead length back down to 32 kB. The first syndrome converts a series of 32 kB reads into a series of (misaligned) 32 kB reads, while the second syndrome converts a series of 32 kB reads into a series of 64 kB reads; in both cases we do not increase the readahead length to its limit (currently 128 kB) no matter how many consecutive read requests are made. This change avoids this problem by tracking the "unconsumed readahead" length; readahead is deemed to be useful (and the read-ahead length is potentially increased) not only if a request was completely serviced out of the cache, but also if *any* of the request was serviced out of the cache and that length matches the amount of unconsumed readahead. Conversely, we now only reduce the readahead length in cases where there was unconsumed readahead data. In my testing on an EC2 c5.xlarge instance, this change reduces the boot time by roughly 120 ms. Reviewed by: imp, tsoome MFC after: 1 week Sponsored by: https://patreon.com/cperciva Differential Revision: https://reviews.freebsd.org/D32250 --- stand/common/bcache.c | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/stand/common/bcache.c b/stand/common/bcache.c index b3b8b22c7d21..b79d609b198b 100644 --- a/stand/common/bcache.c +++ b/stand/common/bcache.c @@ -67,6 +67,7 @@ struct bcache { size_t bcache_nblks; size_t ra; daddr_t bcache_nextblkno; + size_t ralen; }; static u_int bcache_total_nblks; /* set by bcache_init */ @@ -250,14 +251,23 @@ read_strategy(void *devdata, int rw, daddr_t blk, size_t size, * increase it when we notice that readahead was useful and decrease * it when we notice that readahead was not useful. */ - if (complete) { + if (complete || (i == bc->ralen && bc->ralen > 0)) { if (bc->ra < BCACHE_READAHEAD) bc->ra <<= 1; /* increase read ahead */ } else { - if (nblk - i > BCACHE_MINREADAHEAD && bc->ra > BCACHE_MINREADAHEAD) + if (nblk - i > BCACHE_MINREADAHEAD && bc->ralen > 0 && + bc->ra > BCACHE_MINREADAHEAD) bc->ra >>= 1; /* reduce read ahead */ } + /* Adjust our "unconsumed readahead" value. */ + if (blk == bc->bcache_nextblkno) { + if (nblk > bc->ralen) + bc->ralen = 0; + else + bc->ralen -= nblk; + } + if (complete) { /* whole set was in cache, return it */ bcopy(bc->bcache_data + (bcache_blksize * BHASH(bc, blk)), buf, size); goto done; @@ -314,7 +324,10 @@ read_strategy(void *devdata, int rw, daddr_t blk, size_t size, if (ra != 0 && ra != bc->bcache_nblks) { /* do we have RA space? */ ra = MIN(bc->ra, ra - 1); ra = rounddown(ra, 16); /* multiple of 16 blocks */ + bc->ralen = ra; p_size += ra; + } else { + bc->ralen = 0; } /* invalidate bcache */ From owner-dev-commits-src-main@freebsd.org Sun Oct 3 22:46:11 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DF4A3670C03; Sun, 3 Oct 2021 22:46:11 +0000 (UTC) (envelope-from eric@vangyzen.net) Received: from smtp.vangyzen.net (hotblack.vangyzen.net [199.48.133.146]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4HMzTv5Gtkz4kws; Sun, 3 Oct 2021 22:46:11 +0000 (UTC) (envelope-from eric@vangyzen.net) Received: from smtpclient.apple (unknown [70.99.78.110]) by smtp.vangyzen.net (Postfix) with ESMTPSA id 0E25A56485; Sun, 3 Oct 2021 17:46:05 -0500 (CDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=vangyzen.net; s=default; t=1633301165; bh=pv0u12ZFF/6C7hDYQGBNF7Oob1ag+RD/y4uSt6DqABE=; h=Subject:From:In-Reply-To:Date:Cc:References:To; b=JUzho3l7gjnbEZLCJO82w4g8+YFPg1xRKWsj4AvqqL0zx/Qpwziur0Q3k04RcaJ6P HpSM90/hMR8qUu20PZZpkeTdl+Q/WvuRVyzRMEiKytlMtzuJ9bm8OABoOSzxJ6NarX xKcD3JlWV1tpBgz8g0yPol7EowVofKiQwlFX7KJDqLiK8SxWoZy1s2+cx7sSMT2Gpo 1yllXbFrCdisAa+acrtU9yI1poW9LWWk5dJPrLjIQmB40OGadZX+M8zyh/4BJbVQOb g7wYSuTneXf8/WhLmHk0bwP7GT+62dyfNk5GtQagnAdBp7qGLLvhkTDCWmUOmWv2f1 aA+vKnOUfikVA== Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.120.0.1.13\)) Subject: Re: git: 903873ce1560 - main - Implement and use new mixer(3) library for FreeBSD. From: Eric van Gyzen In-Reply-To: <3d6a23c3-ad2c-4c5b-849e-1ef12dbf8955@FreeBSD.org> Date: Sun, 3 Oct 2021 17:46:04 -0500 Cc: Hans Petter Selasky , "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" , Christos Margiolis Content-Transfer-Encoding: quoted-printable Message-Id: <8D7B0F4D-D996-4AE5-85DC-FB74B8D7510F@vangyzen.net> References: <202109221803.18MI3gdA013391@gitrepo.freebsd.org> <3d6a23c3-ad2c-4c5b-849e-1ef12dbf8955@FreeBSD.org> To: Mateusz Piotrowski <0mp@freebsd.org> X-Mailer: Apple Mail (2.3654.120.0.1.13) X-Rspamd-Queue-Id: 4HMzTv5Gtkz4kws X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Oct 2021 22:46:11 -0000 > On Oct 3, 2021, at 11:03 AM, Mateusz Piotrowski <0mp@freebsd.org> = wrote: >=20 > Perhaps we could change the name of the new mixer to, e.g., newmixer. I realize that suggestion was just a quick example, but please don=E2=80=99= t call anything =E2=80=9Cnew,=E2=80=9D because it isn=E2=80=99t new for = long. ;) Eric= From owner-dev-commits-src-main@freebsd.org Sun Oct 3 23:08:21 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C01386712C8 for ; Sun, 3 Oct 2021 23:08:21 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: from mail-qv1-xf30.google.com (mail-qv1-xf30.google.com [IPv6:2607:f8b0:4864:20::f30]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HMzzT4gHbz4mQd for ; Sun, 3 Oct 2021 23:08:21 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: by mail-qv1-xf30.google.com with SMTP id k3so4373687qve.10 for ; Sun, 03 Oct 2021 16:08:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hardenedbsd.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=rnuZCFM62ZttgrAoDGOzNFO3c3AY3KgmH6knAvktaRI=; b=g4xPOQhzZ8a0YHKUNYNu1cJMqrraiFCZs66BKCodLYfG0uD/exz3bPr0gGYU6iP640 7+DbR9EU6moxXAiAJih1PoZSjpiFAZZ9L0Z1KPMIxz5C+ysK1TaB4ZtNHX1f8kgmEk9I QuU3UbunYE3xb1ZwqVjo+GlUs85MplyWTWJQgmeqimNCGrYJsL5yLLhwCgdIO86zBRMm b0tD17THUMoF8RDXZgAWP609wys0oRCHpzzEVrf3FCtpWBLd++go841tIZnECLGRozL3 KPKjUZONZc+XGzAEtbxvRR+ncS9GPgBYaai1C9BkhuXMkv+7QG36pDtFByXrVol7wTgr Chxg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=rnuZCFM62ZttgrAoDGOzNFO3c3AY3KgmH6knAvktaRI=; b=QP9n2qME7nUAvXvef3fU6NwlEDYgYACbL0x8ypg/nXR7PD2NsM0wSAs61DhmGv6q04 Mcc9WrtWirPV5g+uHqqas3a665wSRvtitKbsr8vz68qbyr/Uh4VRdPLkVmKdSxuEgGOa w/11D9WJRi7LL98NWDF/VMihMDntg1PJdNHeZDqargzW1q9kSytgVxqjMTTUlEpYhZ0Q sYt3HCsPPERS1LkAh4/kbDCRGd9UT/FoSf6U+JgB29nc4EUESXC8l4N0Wl2ZBZQnEbGH MFlQFKO9+Qi4VA7TnkkbgkEOmBYyhrmiV/iRYrb6SeaRBaeMGDGngk5rw03+zZgaEL1+ zEmQ== X-Gm-Message-State: AOAM531R2fSN+fCVkvT/hE8qdojkivFqCfbbeIaBv294HZhach+odzdX 8svlJ7k8UUWGDL7ZDKdJXHKGhA== X-Google-Smtp-Source: ABdhPJwJpxbhAFp/r0muJJ4QBBomuMf9jtP3dPbzsb8FV8CJLCOrhJRcCCkMySKDx7bEl+DpXL2rsw== X-Received: by 2002:a0c:9d07:: with SMTP id m7mr19537803qvf.60.1633302495216; Sun, 03 Oct 2021 16:08:15 -0700 (PDT) Received: from mutt-hbsd (pool-100-16-224-136.bltmmd.fios.verizon.net. [100.16.224.136]) by smtp.gmail.com with ESMTPSA id y13sm5507640qtw.62.2021.10.03.16.08.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 03 Oct 2021 16:08:14 -0700 (PDT) Date: Sun, 3 Oct 2021 19:08:14 -0400 From: Shawn Webb To: Eric van Gyzen Cc: Mateusz Piotrowski <0mp@freebsd.org>, Hans Petter Selasky , "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" , Christos Margiolis Subject: Re: git: 903873ce1560 - main - Implement and use new mixer(3) library for FreeBSD. Message-ID: <20211003230814.pqfaioaqu2yvileg@mutt-hbsd> X-Operating-System: FreeBSD mutt-hbsd 14.0-CURRENT-HBSD FreeBSD 14.0-CURRENT-HBSD X-PGP-Key: https://git.hardenedbsd.org/hardenedbsd/pubkeys/-/blob/master/Shawn_Webb/03A4CBEBB82EA5A67D9F3853FF2E67A277F8E1FA.pub.asc References: <202109221803.18MI3gdA013391@gitrepo.freebsd.org> <3d6a23c3-ad2c-4c5b-849e-1ef12dbf8955@FreeBSD.org> <8D7B0F4D-D996-4AE5-85DC-FB74B8D7510F@vangyzen.net> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="brq5zzsach3avhx5" Content-Disposition: inline In-Reply-To: <8D7B0F4D-D996-4AE5-85DC-FB74B8D7510F@vangyzen.net> X-Rspamd-Queue-Id: 4HMzzT4gHbz4mQd X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Oct 2021 23:08:21 -0000 --brq5zzsach3avhx5 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Oct 03, 2021 at 05:46:04PM -0500, Eric van Gyzen wrote: >=20 > > On Oct 3, 2021, at 11:03 AM, Mateusz Piotrowski <0mp@freebsd.org> wrote: > >=20 > > Perhaps we could change the name of the new mixer to, e.g., newmixer. >=20 > I realize that suggestion was just a quick example, but please don=E2=80= =99t call anything =E2=80=9Cnew,=E2=80=9D because it isn=E2=80=99t new for = long. ;) My bikeshed is now painted with a color called "Freshmixer". What's your bikeshed called? ;-) (This is meant in jest.) --=20 Shawn Webb Cofounder / Security Engineer HardenedBSD https://git.hardenedbsd.org/hardenedbsd/pubkeys/-/raw/master/Shawn_Webb/03A= 4CBEBB82EA5A67D9F3853FF2E67A277F8E1FA.pub.asc --brq5zzsach3avhx5 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEA6TL67gupaZ9nzhT/y5nonf44foFAmFaN9sACgkQ/y5nonf4 4fpZ3w/+K4otgLu0AuYCo6NAoiIwoE1trPV8xxsT1f24oh2sH+EVMwa+LxxgDOhM Gy2Nkwow0R5gep9CR0Z1kHOLiHtU9EYLjYBk2OSQ698+rg8wJ3up3XlRoTerghUA S3B5ROKgQmgP7rpJQBe2cdHtm5/bX3T+7AEs4ABdHmjRhu1P2ll0nu/haim/hEjC DlRPC+Jgw3iI1lsp5O+7ktwoE2if2KOae5hOvzC7plltOn4VHE6dAAGHcMXaazuo fjSTiP5v2risFyWeyWe+iIP+TE12HEVTzkY8a4UAWcz8w64lIZHM24dad7qqk9Yv 66h4fqK9kcLNfNgY/t8ydNpu+45b7mpiKmXnXF2jJd7I+sThVDVerG5E21DNpXSs L2O4wtoyXg7w+DDUnoLvyYwbIutrzeGuM2UhST6dpT7vlag3MNiryLDZ2dzqsqvO aUIb9DLHnNpaDZR71SPTb5OcHCRbHmc+tNB9BsawiRd88F969IKreeauwqByCFfo BIWVO4KuuRJm3wKv1+pdYR7cxTWwtbwPxXjI/nr+SAZMEy9OEEa0jiTyBAv+eQRC hjF+2llVxmJf1OJbP5XOL/pvoxaA+EG5QHkXbEYvRx5gZyeeNeQvBHE4iDJAgU5R XIQ68CKakhR6+RG1g4/RYYDGqWlZzFjJ63jc1z5gFjJjevvL/tk= =1rss -----END PGP SIGNATURE----- --brq5zzsach3avhx5--