From owner-dev-commits-src-main@freebsd.org Mon Mar 8 00:38: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 B73DB5561D0; Mon, 8 Mar 2021 00:38: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 4Dtzwl4PXzz4sFm; Mon, 8 Mar 2021 00:38: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 85E721FE90; Mon, 8 Mar 2021 00:38: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 1280clQ2098273; Mon, 8 Mar 2021 00:38:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1280clXY098272; Mon, 8 Mar 2021 00:38:47 GMT (envelope-from git) Date: Mon, 8 Mar 2021 00:38:47 GMT Message-Id: <202103080038.1280clXY098272@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: 38dfb0626fd3 - main - bhyve/snapshot: use SOCK_DGRAM instead of SOCK_STREAM 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: 38dfb0626fd35c64b2e2d5faae2c90e7981a3307 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, 08 Mar 2021 00:38:47 -0000 The branch main has been updated by rew: URL: https://cgit.FreeBSD.org/src/commit/?id=38dfb0626fd35c64b2e2d5faae2c90e7981a3307 commit 38dfb0626fd35c64b2e2d5faae2c90e7981a3307 Author: Robert Wing AuthorDate: 2021-03-08 00:23:29 +0000 Commit: Robert Wing CommitDate: 2021-03-08 00:23:29 +0000 bhyve/snapshot: use SOCK_DGRAM instead of SOCK_STREAM The save/restore feature uses a unix domain socket to send messages from bhyvectl(8) to a bhyve(8) process. A datagram socket will suffice for this. An added benefit of using a datagram socket is simplified code. For bhyve, the listen/accept calls are dropped; and for bhyvectl, the connect() call is dropped. EPRINTLN handles raw mode for bhyve(8), use it to print error messages. Reviewed by: jhb Differential Revision: https://reviews.freebsd.org/D28983 --- usr.sbin/bhyve/snapshot.c | 65 +++++++++++++++++--------------------------- usr.sbin/bhyvectl/bhyvectl.c | 22 ++++----------- 2 files changed, 31 insertions(+), 56 deletions(-) diff --git a/usr.sbin/bhyve/snapshot.c b/usr.sbin/bhyve/snapshot.c index 11ff963ae1fd..221558b6f205 100644 --- a/usr.sbin/bhyve/snapshot.c +++ b/usr.sbin/bhyve/snapshot.c @@ -79,6 +79,7 @@ __FBSDID("$FreeBSD$"); #include "bhyverun.h" #include "acpi.h" #include "atkbdc.h" +#include "debug.h" #include "inout.h" #include "fwctl.h" #include "ioapic.h" @@ -117,8 +118,6 @@ static sig_t old_winch_handler; #define MAX_VMNAME 100 -#define MAX_MSG_SIZE 1024 - #define SNAPSHOT_BUFFER_SIZE (20 * MB) #define JSON_STRUCT_ARR_KEY "structs" @@ -1442,24 +1441,10 @@ done: } int -get_checkpoint_msg(int conn_fd, struct vmctx *ctx) +handle_message(struct checkpoint_op *checkpoint_op, struct vmctx *ctx) { - unsigned char buf[MAX_MSG_SIZE]; - struct checkpoint_op *checkpoint_op; - int len, recv_len, total_recv = 0; - int err = 0; - - len = sizeof(struct checkpoint_op); /* expected length */ - while ((recv_len = recv(conn_fd, buf + total_recv, len - total_recv, 0)) > 0) { - total_recv += recv_len; - } - if (recv_len < 0) { - perror("Error while receiving data from bhyvectl"); - err = -1; - goto done; - } + int err; - checkpoint_op = (struct checkpoint_op *)buf; switch (checkpoint_op->op) { case START_CHECKPOINT: err = vm_checkpoint(ctx, checkpoint_op->snapshot_filename, false); @@ -1468,12 +1453,13 @@ get_checkpoint_msg(int conn_fd, struct vmctx *ctx) err = vm_checkpoint(ctx, checkpoint_op->snapshot_filename, true); break; default: - fprintf(stderr, "Unrecognized checkpoint operation.\n"); + EPRINTLN("Unrecognized checkpoint operation\n"); err = -1; } -done: - close(conn_fd); + if (err != 0) + EPRINTLN("Unable to perform the requested operation\n"); + return (err); } @@ -1483,21 +1469,25 @@ done: void * checkpoint_thread(void *param) { + struct checkpoint_op op; struct checkpoint_thread_info *thread_info; - int conn_fd, ret; + ssize_t n; pthread_set_name_np(pthread_self(), "checkpoint thread"); thread_info = (struct checkpoint_thread_info *)param; - while ((conn_fd = accept(thread_info->socket_fd, NULL, NULL)) > -1) { - ret = get_checkpoint_msg(conn_fd, thread_info->ctx); - if (ret != 0) { - fprintf(stderr, "Failed to read message on checkpoint " - "socket. Retrying.\n"); - } - } - if (conn_fd < -1) { - perror("Failed to accept connection"); + for (;;) { + n = recvfrom(thread_info->socket_fd, &op, sizeof(op), 0, NULL, 0); + + /* + * slight sanity check: see if there's enough data to at + * least determine the type of message. + */ + if (n >= sizeof(op.op)) + handle_message(&op, thread_info->ctx); + else + EPRINTLN("Failed to receive message: %s\n", + n == -1 ? strerror(errno) : "unknown error"); } return (NULL); @@ -1527,9 +1517,9 @@ init_checkpoint_thread(struct vmctx *ctx) if (err != 0) errc(1, err, "checkpoint cv init"); - socket_fd = socket(PF_UNIX, SOCK_STREAM, 0); + socket_fd = socket(PF_UNIX, SOCK_DGRAM, 0); if (socket_fd < 0) { - perror("Socket creation failed (IPC with bhyvectl"); + EPRINTLN("Socket creation failed: %s", strerror(errno)); err = -1; goto fail; } @@ -1548,13 +1538,8 @@ init_checkpoint_thread(struct vmctx *ctx) unlink(addr.sun_path); if (bind(socket_fd, (struct sockaddr *)&addr, addr.sun_len) != 0) { - perror("Failed to bind socket (IPC with bhyvectl)"); - err = -1; - goto fail; - } - - if (listen(socket_fd, 10) < 0) { - perror("Failed to listen on socket (IPC with bhyvectl)"); + EPRINTLN("Failed to bind socket \"%s\": %s\n", + addr.sun_path, strerror(errno)); err = -1; goto fail; } diff --git a/usr.sbin/bhyvectl/bhyvectl.c b/usr.sbin/bhyvectl/bhyvectl.c index 0f7b9533fe4b..df02f7caf345 100644 --- a/usr.sbin/bhyvectl/bhyvectl.c +++ b/usr.sbin/bhyvectl/bhyvectl.c @@ -1687,11 +1687,11 @@ static int send_checkpoint_op_req(struct vmctx *ctx, struct checkpoint_op *op) { struct sockaddr_un addr; - int socket_fd, len, len_sent, total_sent; - int err = 0; + ssize_t len_sent; + int err, socket_fd; char vmname_buf[MAX_VMNAME]; - socket_fd = socket(PF_UNIX, SOCK_STREAM, 0); + socket_fd = socket(PF_UNIX, SOCK_DGRAM, 0); if (socket_fd < 0) { perror("Error creating bhyvectl socket"); err = -1; @@ -1709,21 +1709,11 @@ send_checkpoint_op_req(struct vmctx *ctx, struct checkpoint_op *op) snprintf(addr.sun_path, sizeof(addr.sun_path), "%s%s", BHYVE_RUN_DIR, vmname_buf); - if (connect(socket_fd, (struct sockaddr *)&addr, - sizeof(struct sockaddr_un)) != 0) { - perror("Connect to VM socket failed"); - err = -1; - goto done; - } - - len = sizeof(*op); - total_sent = 0; - while ((len_sent = send(socket_fd, (char *)op + total_sent, len - total_sent, 0)) > 0) { - total_sent += len_sent; - } + len_sent = sendto(socket_fd, op, sizeof(*op), 0, + (struct sockaddr *)&addr, sizeof(struct sockaddr_un)); if (len_sent < 0) { - perror("Failed to send checkpoint operation request"); + perror("Failed to send message to bhyve vm"); err = -1; } From owner-dev-commits-src-main@freebsd.org Mon Mar 8 01:48: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 4FE225607D1; Mon, 8 Mar 2021 01:48: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 4Dv1TX1pBrz3DrZ; Mon, 8 Mar 2021 01:48: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 297EC207CC; Mon, 8 Mar 2021 01:48: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 1281mlM1090319; Mon, 8 Mar 2021 01:48:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1281mlli090318; Mon, 8 Mar 2021 01:48:47 GMT (envelope-from git) Date: Mon, 8 Mar 2021 01:48:47 GMT Message-Id: <202103080148.1281mlli090318@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: 56b9bee63a42 - main - Make kern.timecounter.hardware tunable 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: 56b9bee63a42dbac712acf540f23a4c3dbd099a9 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, 08 Mar 2021 01:48:48 -0000 The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=56b9bee63a42dbac712acf540f23a4c3dbd099a9 commit 56b9bee63a42dbac712acf540f23a4c3dbd099a9 Author: Konstantin Belousov AuthorDate: 2021-03-07 23:50:12 +0000 Commit: Konstantin Belousov CommitDate: 2021-03-08 01:48:21 +0000 Make kern.timecounter.hardware tunable Noted and reviewed by: kevans MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential revision: https://reviews.freebsd.org/D29122 --- sys/kern/kern_tc.c | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/sys/kern/kern_tc.c b/sys/kern/kern_tc.c index 07841fd5ca0e..b1dcb18e31be 100644 --- a/sys/kern/kern_tc.c +++ b/sys/kern/kern_tc.c @@ -141,6 +141,7 @@ SYSCTL_PROC(_kern_timecounter, OID_AUTO, alloweddeviation, volatile int rtc_generation = 1; static int tc_chosen; /* Non-zero if a specific tc was chosen via sysctl. */ +static char tc_from_tunable[16]; static void tc_windup(struct bintime *new_boottimebin); static void cpu_tick_calibrate(int); @@ -1215,11 +1216,17 @@ tc_init(struct timecounter *tc) return; if (tc->tc_quality < 0) return; - if (tc->tc_quality < timecounter->tc_quality) - return; - if (tc->tc_quality == timecounter->tc_quality && - tc->tc_frequency < timecounter->tc_frequency) - return; + if (tc_from_tunable[0] != '\0' && + strcmp(tc->tc_name, tc_from_tunable) == 0) { + tc_chosen = 1; + tc_from_tunable[0] = '\0'; + } else { + if (tc->tc_quality < timecounter->tc_quality) + return; + if (tc->tc_quality == timecounter->tc_quality && + tc->tc_frequency < timecounter->tc_frequency) + return; + } (void)tc->tc_get_timecount(tc); timecounter = tc; } @@ -1500,7 +1507,7 @@ sysctl_kern_timecounter_hardware(SYSCTL_HANDLER_ARGS) } SYSCTL_PROC(_kern_timecounter, OID_AUTO, hardware, - CTLTYPE_STRING | CTLFLAG_RW | CTLFLAG_MPSAFE, 0, 0, + CTLTYPE_STRING | CTLFLAG_RWTUN | CTLFLAG_NOFETCH | CTLFLAG_MPSAFE, 0, 0, sysctl_kern_timecounter_hardware, "A", "Timecounter hardware selected"); @@ -1940,6 +1947,9 @@ inittimehands(void *dummy) for (i = 1, thp = &ths[0]; i < timehands_count; thp = &ths[i++]) thp->th_next = &ths[i]; thp->th_next = &ths[0]; + + TUNABLE_STR_FETCH("kern.timecounter.hardware", tc_from_tunable, + sizeof(tc_from_tunable)); } SYSINIT(timehands, SI_SUB_TUNABLES, SI_ORDER_ANY, inittimehands, NULL); From owner-dev-commits-src-main@freebsd.org Mon Mar 8 03:07: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 59E8E562759; Mon, 8 Mar 2021 03:07: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 4Dv3DG26yQz3JJs; Mon, 8 Mar 2021 03:07: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 3BC4921D96; Mon, 8 Mar 2021 03:07: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 12837Qhw096681; Mon, 8 Mar 2021 03:07:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 12837Qen096680; Mon, 8 Mar 2021 03:07:26 GMT (envelope-from git) Date: Mon, 8 Mar 2021 03:07:26 GMT Message-Id: <202103080307.12837Qen096680@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Hajimu UMEMOTO Subject: git: 006a01374f59 - main - Simplify using nvlist_append_string_array(). MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ume X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 006a01374f59b839ca1c900efd274a3b92044b15 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, 08 Mar 2021 03:07:26 -0000 The branch main has been updated by ume: URL: https://cgit.FreeBSD.org/src/commit/?id=006a01374f59b839ca1c900efd274a3b92044b15 commit 006a01374f59b839ca1c900efd274a3b92044b15 Author: Hajimu UMEMOTO AuthorDate: 2021-03-08 03:03:32 +0000 Commit: Hajimu UMEMOTO CommitDate: 2021-03-08 03:03:32 +0000 Simplify using nvlist_append_string_array(). Reported by: hrs MFC after: 1 week --- usr.sbin/rtsold/rtsold.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/usr.sbin/rtsold/rtsold.c b/usr.sbin/rtsold/rtsold.c index 5e5298bfdadc..c1594ec7420a 100644 --- a/usr.sbin/rtsold/rtsold.c +++ b/usr.sbin/rtsold/rtsold.c @@ -333,10 +333,8 @@ init_capabilities(void) #ifdef WITH_CASPER const char *const scripts[] = { resolvconf_script, managedconf_script, otherconf_script }; - const char *scripts_set[nitems(scripts)]; cap_channel_t *capcasper; nvlist_t *limits; - int count; capcasper = cap_init(); if (capcasper == NULL) @@ -349,12 +347,11 @@ init_capabilities(void) capscript = cap_service_open(capcasper, "rtsold.script"); if (capscript == NULL) return (-1); - count = 0; + limits = nvlist_create(0); for (size_t i = 0; i < nitems(scripts); i++) if (scripts[i] != NULL) - scripts_set[count++] = scripts[i]; - limits = nvlist_create(0); - nvlist_add_string_array(limits, "scripts", scripts_set, count); + nvlist_append_string_array(limits, "scripts", + scripts[i]); if (cap_limit_set(capscript, limits) != 0) return (-1); From owner-dev-commits-src-main@freebsd.org Mon Mar 8 06:22: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 9A64B566867; Mon, 8 Mar 2021 06:22: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 4Dv7YY3zZZz3j23; Mon, 8 Mar 2021 06:22: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 7BA9024510; Mon, 8 Mar 2021 06:22: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 1286Mfw9059155; Mon, 8 Mar 2021 06:22:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1286Mfwu059154; Mon, 8 Mar 2021 06:22:41 GMT (envelope-from git) Date: Mon, 8 Mar 2021 06:22:41 GMT Message-Id: <202103080622.1286Mfwu059154@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: d9a50109e238 - main - if_wg: release correct lock in noise_remote_begin_session() 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: d9a50109e238e2d0171f0e647821f82efb8d037d 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, 08 Mar 2021 06:22:41 -0000 The branch main has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=d9a50109e238e2d0171f0e647821f82efb8d037d commit d9a50109e238e2d0171f0e647821f82efb8d037d Author: Kyle Evans AuthorDate: 2021-03-08 02:25:33 +0000 Commit: Kyle Evans CommitDate: 2021-03-08 06:21:03 +0000 if_wg: release correct lock in noise_remote_begin_session() The keypair lock is not taken until later. Obtained from: Jason A. Donenfeld via OpenBSD MFC after: 3 days --- sys/dev/if_wg/module/wg_noise.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/if_wg/module/wg_noise.c b/sys/dev/if_wg/module/wg_noise.c index 946a570916a6..0fa7664e66d5 100644 --- a/sys/dev/if_wg/module/wg_noise.c +++ b/sys/dev/if_wg/module/wg_noise.c @@ -454,7 +454,7 @@ noise_remote_begin_session(struct noise_remote *r) NOISE_SYMMETRIC_SIZE, NOISE_SYMMETRIC_SIZE, 0, 0, hs->hs_ck); } else { - rw_exit_write(&r->r_keypair_lock); + rw_exit_write(&r->r_handshake_lock); return EINVAL; } From owner-dev-commits-src-main@freebsd.org Mon Mar 8 06:22: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 BFA97566B8C; Mon, 8 Mar 2021 06:22: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 4Dv7YZ4zm4z3j08; Mon, 8 Mar 2021 06:22: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 9DDF624636; Mon, 8 Mar 2021 06:22: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 1286MgnT059177; Mon, 8 Mar 2021 06:22:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1286Mgeg059176; Mon, 8 Mar 2021 06:22:42 GMT (envelope-from git) Date: Mon, 8 Mar 2021 06:22:42 GMT Message-Id: <202103080622.1286Mgeg059176@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: df554850858f - main - wg_input: avoid leaking due to an m_defrag failure 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: df554850858f59fd9d54c25a96bb7dfc4237fa70 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, 08 Mar 2021 06:22:42 -0000 The branch main has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=df554850858f59fd9d54c25a96bb7dfc4237fa70 commit df554850858f59fd9d54c25a96bb7dfc4237fa70 Author: Kyle Evans AuthorDate: 2021-03-08 02:49:00 +0000 Commit: Kyle Evans CommitDate: 2021-03-08 06:21:23 +0000 wg_input: avoid leaking due to an m_defrag failure m_defrag() will not free the chain on failure, leaking the mbuf. Obtained from: OpenBSD MFC after: 3 days --- sys/dev/if_wg/module/if_wg_session.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/sys/dev/if_wg/module/if_wg_session.c b/sys/dev/if_wg/module/if_wg_session.c index 084bc789039d..cb2a88812855 100644 --- a/sys/dev/if_wg/module/if_wg_session.c +++ b/sys/dev/if_wg/module/if_wg_session.c @@ -1905,7 +1905,13 @@ wg_input(struct mbuf *m0, int offset, struct inpcb *inpcb, m_adj(m0, hlen); - if ((m = m_defrag(m0, M_NOWAIT)) == NULL) { + /* + * Ensure mbuf is contiguous over full length of the packet. This is + * done so that we can directly read the handshake values in + * wg_handshake, and so we can decrypt a transport packet by passing a + * a single buffer to noise_remote_decrypt() in wg_decap. + */ + if ((m = m_pullup(m0, m0->m_pkthdr.len)) == NULL) { DPRINTF(sc, "DEFRAG fail\n"); return; } From owner-dev-commits-src-main@freebsd.org Mon Mar 8 06:25: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 7116F566A78; Mon, 8 Mar 2021 06:25: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 4Dv7d92mBLz3jKc; Mon, 8 Mar 2021 06:25: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 518CA24511; Mon, 8 Mar 2021 06:25: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 1286Pnm1059750; Mon, 8 Mar 2021 06:25:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1286PnkD059749; Mon, 8 Mar 2021 06:25:49 GMT (envelope-from git) Date: Mon, 8 Mar 2021 06:25:49 GMT Message-Id: <202103080625.1286PnkD059749@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: 2b82c94acff6 - main - if_wg: avoid null ptr deref 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: 2b82c94acff6b4a90da5af700b59cd398481e968 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, 08 Mar 2021 06:25:49 -0000 The branch main has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=2b82c94acff6b4a90da5af700b59cd398481e968 commit 2b82c94acff6b4a90da5af700b59cd398481e968 Author: Kyle Evans AuthorDate: 2021-03-08 02:47:27 +0000 Commit: Kyle Evans CommitDate: 2021-03-08 06:25:34 +0000 if_wg: avoid null ptr deref While we're here, sync up with OpenBSD and don't use a keypair !kp_valid MFC after: 3 days --- sys/dev/if_wg/module/wg_noise.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/if_wg/module/wg_noise.c b/sys/dev/if_wg/module/wg_noise.c index 0fa7664e66d5..08a0d8d32876 100644 --- a/sys/dev/if_wg/module/wg_noise.c +++ b/sys/dev/if_wg/module/wg_noise.c @@ -673,7 +673,7 @@ noise_remote_decrypt(struct noise_remote *r, struct noise_data *data, * REKEY_AFTER_TIME_RECV seconds. */ ret = ESTALE; kp = r->r_current; - if (kp->kp_is_initiator && + if (kp != NULL && kp->kp_valid && kp->kp_is_initiator && noise_timer_expired(&kp->kp_birthdate, REKEY_AFTER_TIME_RECV, 0)) goto error; From owner-dev-commits-src-main@freebsd.org Mon Mar 8 07:16: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 71651567BD0; Mon, 8 Mar 2021 07:16:33 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from smtp-out-no.shaw.ca (smtp-out-no.shaw.ca [64.59.134.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Dv8lj0GvCz3lvn; Mon, 8 Mar 2021 07:16:32 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from spqr.komquats.com ([70.67.229.168]) by shaw.ca with ESMTPA id JA7wlTpJX2SWTJA7xlCS0f; Mon, 08 Mar 2021 00:16:30 -0700 X-Authority-Analysis: v=2.4 cv=fdJod2cF c=1 sm=1 tr=0 ts=6045cf4e a=7AlCcx2GqMg+lh9P3BclKA==:117 a=7AlCcx2GqMg+lh9P3BclKA==:17 a=xqWC_Br6kY4A:10 a=kj9zAlcOel0A:10 a=dESyimp9J3IA:10 a=ZB5LerlCAAAA:8 a=6I5d2MoRAAAA:8 a=pGLkceISAAAA:8 a=YxBL1-UpAAAA:8 a=EkcXrb_YAAAA:8 a=IN2qHnOaUhcsauUY1eUA:9 a=CjuIK1q_8ugA:10 a=YKPTzOroS2oaEK2QgPcx:22 a=IjZwj45LgO3ly-622nXo:22 a=Ia-lj3WSrqcvXOmTRaiG:22 a=LK5xJRSDVpKd5WXXoEvA:22 a=BPzZvq435JnGatEyYwdK:22 Received: from slippy.cwsent.com (slippy [IPv6:fc00:1:1:1::5b]) by spqr.komquats.com (Postfix) with ESMTPS id 10D5D2AB2; Sun, 7 Mar 2021 23:16:27 -0800 (PST) Received: from slippy (localhost [127.0.0.1]) by slippy.cwsent.com (8.16.1/8.16.1) with ESMTP id 1287GQWB055131; Sun, 7 Mar 2021 23:16:26 -0800 (PST) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <202103080716.1287GQWB055131@slippy.cwsent.com> X-Mailer: exmh version 2.9.0 11/07/2018 with nmh-1.7.1 Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: Chris Rees cc: dev-commits-src-all@freebsd.org, Baptiste Daroussin , src-committers@freebsd.org, dev-commits-src-main@freebsd.org, Rick Parrish Subject: Re: git: 77e1ccbee3ed - main - rc: implement parallel boot In-reply-to: <74fde23ead6719ac4e56dacb51bca6ed@bayofrum.net> References: <202102231027.11NARYYE041280@gitrepo.freebsd.org> <6D4FCE07-B996-430C-8EA8-6CB37A6DEEE8@bayofrum.net> <74fde23ead6719ac4e56dacb51bca6ed@bayofrum.net> Comments: In-reply-to Chris Rees message dated "Sun, 07 Mar 2021 13:43:50 -0500." Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Sun, 07 Mar 2021 23:16:26 -0800 X-CMAE-Envelope: MS4xfFQ/DyGcyBpZWDprn+Ze9YBd5CmU2P5GKf9kcMvUDGO0faejt4XfFT4h941Ya2OkxzSMBRVFCyt2RoDwUWXLee9C5rqYagPAMTVZM716ntLLyAH48EsK WQ9FossCkxfGSZnVAJEBNW2pK0qY+oXYyq4pZ1FcW7I8S/NlHZ43BzENcEvZCQe8MIFxYfRFLgxKjyp565ehpTaptvNhnKKp9BUcSQwZJZI2rGf5kW9meB9a YLzQ/O3LabwQfm9MddzIqtgy6z0CGOpHnFbMd+MrZF0X7fMkmR9bMjFkIYM8zCUBU6PSY6HUf/58CYlzuXSzAJ1+0cOIsBtZMLpYEPbPUXKHmSIQh31RkbQ5 5iMkdIPKFlEXhqWuSDt+B0y/w8CzLKGq/N9i12I2kUUZHgDgVh0= X-Rspamd-Queue-Id: 4Dv8lj0GvCz3lvn 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, 08 Mar 2021 07:16:33 -0000 In message <74fde23ead6719ac4e56dacb51bca6ed@bayofrum.net>, Chris Rees writes: > Forgot to CC the actual author! > > On 2021-02-23 17:03, Chris Rees wrote: > > Hi, > > > > On 23 February 2021 10:27:34 GMT, Baptiste Daroussin > > wrote: > >> The branch main has been updated by bapt: > >> > >> URL: > >> https://cgit.FreeBSD.org/src/commit/?id=77e1ccbee3ed6c837929e4e232fd07f95b > fc8294 > >> > >> commit 77e1ccbee3ed6c837929e4e232fd07f95bfc8294 > >> Author: Rick Parrish > >> AuthorDate: 2021-02-07 06:15:21 +0000 > >> Commit: Baptiste Daroussin > >> CommitDate: 2021-02-23 10:16:53 +0000 > >> > >> rc: implement parallel boot > >> > >> take advantage of the rcorder -p argument to implement parallel > >> booting in rc. > >> > >> According to the author non scientific tests: > >> on a Core 2 Duo with spinning disk: > >> > >> | Services enabled | before | after | saving | > >> | 0 | 8s | 8s | 0 | > >> | 1 | 13s | 13s | 0 | > >> | 2 | 17s | 13s | 5 | > >> | 3 | 23s | 13s | 10 | > >> | 4 | 28s | 13s | 15 | > >> | 5 | 33s | 13s | 20 | > >> > >> PR: 249192 > >> MFC after: 3 weeks > >> --- > >> libexec/rc/rc | 49 ++++++++++++++++++++++++++++++++++--------------- > >> 1 file changed, 34 insertions(+), 15 deletions(-) > >> > >> diff --git a/libexec/rc/rc b/libexec/rc/rc > >> index 35db4a850516..722d7fe35884 100644 > >> --- a/libexec/rc/rc > >> +++ b/libexec/rc/rc > >> @@ -91,19 +91,31 @@ if ! [ -e ${firstboot_sentinel} ]; then > >> skip_firstboot="-s firstboot" > >> fi > >> > >> +# rc_parallel_start default is "NO" > >> +rc_parallel_start=${rc_parallel_start:-NO} > > > > Should this go in defaults/rc.conf? > > I think this should be in defaults/rc.conf-- the load_rc_config line is > above it. > > Incidentally, is the plan for this to go into 13 *and* 12, or just 13? > It's an exciting step! If this does go into 13 or 12, it should be tested in -CURRENT for longer than three weeks. Probably six weeks. -- Cheers, Cy Schubert FreeBSD UNIX: Web: https://FreeBSD.org NTP: Web: https://nwtime.org The need of the many outweighs the greed of the few. From owner-dev-commits-src-main@freebsd.org Mon Mar 8 08:20: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 87907569A4E; Mon, 8 Mar 2021 08:20: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 4DvB8y3Qydz3pSS; Mon, 8 Mar 2021 08:20: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 6475925771; Mon, 8 Mar 2021 08:20: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 1288K2d9006195; Mon, 8 Mar 2021 08:20:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1288K2Fs006192; Mon, 8 Mar 2021 08:20:02 GMT (envelope-from git) Date: Mon, 8 Mar 2021 08:20:02 GMT Message-Id: <202103080820.1288K2Fs006192@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Peter Holm Subject: git: e0fd837a30bd - main - stress2: open(2) tests with BENEATH flags. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: pho X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e0fd837a30bd9e6b0046db9d459fce8b2fc89cce 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, 08 Mar 2021 08:20:02 -0000 The branch main has been updated by pho: URL: https://cgit.FreeBSD.org/src/commit/?id=e0fd837a30bd9e6b0046db9d459fce8b2fc89cce commit e0fd837a30bd9e6b0046db9d459fce8b2fc89cce Author: Peter Holm AuthorDate: 2021-03-08 08:08:58 +0000 Commit: Peter Holm CommitDate: 2021-03-08 08:19:37 +0000 stress2: open(2) tests with BENEATH flags. Update tests to reflect the changes of "open(2): Remove O_BENEATH and AT_BENEATH" in 20e91ca36a56. --- tools/test/stress2/misc/beneath.sh | 11 +++-------- tools/test/stress2/misc/beneath2.sh | 4 ++-- tools/test/stress2/misc/beneath3.sh | 2 +- tools/test/stress2/misc/beneath4.sh | 24 ++++++++++++------------ 4 files changed, 18 insertions(+), 23 deletions(-) diff --git a/tools/test/stress2/misc/beneath.sh b/tools/test/stress2/misc/beneath.sh index 6c2f71a7e992..5f61dbd5e383 100755 --- a/tools/test/stress2/misc/beneath.sh +++ b/tools/test/stress2/misc/beneath.sh @@ -27,7 +27,7 @@ # SUCH DAMAGE. # -# Test of open(2) with the O_BENEATH flag. +# Test of open(2) with the O_RESOLVE_BENEATH flag. # userret: returning with the following locks held: # shared lockmgr ufs (ufs) r = 0 (0xfffff804ec0d2a48) locked @ @@ -46,11 +46,6 @@ cat > $top/beneath.c < #include -#ifndef O_BENEATH -#define O_BENEATH 0x00400000 /* Fail if not under cwd */ -#define AT_BENEATH 0x1000 /* Fail if not under dirfd */ -#endif - int main(int argc, char *argv[]) { @@ -61,7 +56,7 @@ main(int argc, char *argv[]) for (i = 1; i < argc; i++) { name = argv[i]; alarm(120); - fd = open(name, O_RDONLY | O_BENEATH); + fd = open(name, O_RDONLY | O_RESOLVE_BENEATH); if (fd == -1) { fprintf(stderr, "open(\"%s\") failed, error %d %s\n", name, errno, strerror(errno)); @@ -69,7 +64,7 @@ main(int argc, char *argv[]) fprintf(stderr, "open(\"%s\") succeeded\n", name); close(fd); } - error = fstatat(AT_FDCWD, name, &st, AT_BENEATH); + error = fstatat(AT_FDCWD, name, &st, AT_RESOLVE_BENEATH); if (error == -1){ fprintf(stderr, "stat(\"%s\") failed, error %d %s\n", name, errno, strerror(errno)); diff --git a/tools/test/stress2/misc/beneath2.sh b/tools/test/stress2/misc/beneath2.sh index 93a937c054ff..a89cd8deb1e1 100755 --- a/tools/test/stress2/misc/beneath2.sh +++ b/tools/test/stress2/misc/beneath2.sh @@ -27,7 +27,7 @@ # SUCH DAMAGE. # -# O_BENEATH test with a relative path, which is a symbolic link pointing +# O_RESOLVE_BENEATH test with a relative path, which is a symbolic link pointing # to an absolute path. # "panic: Assertion (ndp->ni_lcf & NI_LCF_LATCH) != 0 failed at @@ -93,7 +93,7 @@ main(int argc, char *argv[]) exit(1); } file = argv[1]; - if ((fd = open(file, O_RDONLY | O_BENEATH)) != 0 && + if ((fd = open(file, O_RDONLY | O_RESOLVE_BENEATH)) != 0 && errno != ENOTCAPABLE) err(1, "open(%s)", file); diff --git a/tools/test/stress2/misc/beneath3.sh b/tools/test/stress2/misc/beneath3.sh index 52dc37a7f873..46f370899ee8 100755 --- a/tools/test/stress2/misc/beneath3.sh +++ b/tools/test/stress2/misc/beneath3.sh @@ -84,7 +84,7 @@ main(void) char file[] = "/.."; errno = 0; - fd = open(file, O_CREAT | O_RDONLY | O_BENEATH); + fd = open(file, O_CREAT | O_RDONLY | O_RESOLVE_BENEATH); if (fd != -1 || errno != ENOTCAPABLE) err(1, "open(%s) returns %d", file, fd); diff --git a/tools/test/stress2/misc/beneath4.sh b/tools/test/stress2/misc/beneath4.sh index d9ee71a8f222..f1a5c8817662 100755 --- a/tools/test/stress2/misc/beneath4.sh +++ b/tools/test/stress2/misc/beneath4.sh @@ -69,7 +69,7 @@ main(int argc, char *argv[]) sscanf(argv[3], "%x", &flag); exp = atoi(argv[4]); #if 0 - if ((flag & (AT_BENEATH | AT_RESOLVE_BENEATH)) == 0) { + if ((flag & AT_RESOLVE_BENEATH) == 0) { fprintf(stderr, "Flag must be %#x or %#x\n", AT_BENEATH, AT_RESOLVE_BENEATH); return (1); @@ -105,17 +105,17 @@ top=$dir/a cd $here s=0 -ls -lR $dir -echo AT_BENEATH -$dir/beneath4 $top a 0x1000 0 || s=1 -$dir/beneath4 $top b 0x1000 2 || s=1 -$dir/beneath4 $top c 0x1000 0 || s=1 -$dir/beneath4 $top d 0x1000 0 || s=1 -$dir/beneath4 $top e 0x1000 2 || s=1 -$dir/beneath4 $top fifo 0x1000 0 || s=1 -$dir/beneath4 $top $top/../../beneath4.d/a/a 0x1000 93 || s=1 -$dir/beneath4 $top $top/.. 0x1000 93 || s=1 -$dir/beneath4 $top ../a 0x1000 0 || s=1 +#ls -lR $dir +#echo AT_BENEATH +#$dir/beneath4 $top a 0x1000 0 || s=1 +#$dir/beneath4 $top b 0x1000 2 || s=1 +#$dir/beneath4 $top c 0x1000 0 || s=1 +#$dir/beneath4 $top d 0x1000 0 || s=1 +#$dir/beneath4 $top e 0x1000 2 || s=1 +#$dir/beneath4 $top fifo 0x1000 0 || s=1 +#$dir/beneath4 $top $top/../../beneath4.d/a/a 0x1000 93 || s=1 +#$dir/beneath4 $top $top/.. 0x1000 93 || s=1 +#$dir/beneath4 $top ../a 0x1000 0 || s=1 printf "\nAT_RESOLVE_BENEATH\n" $dir/beneath4 $top a 0x2000 0 || s=1 From owner-dev-commits-src-main@freebsd.org Mon Mar 8 09:44: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 6BE5056BD52; Mon, 8 Mar 2021 09:44: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 4DvD1z2fW1z3tdK; Mon, 8 Mar 2021 09:44: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 4DBDC26D1C; Mon, 8 Mar 2021 09:44: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 1289i7kC024209; Mon, 8 Mar 2021 09:44:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1289i7uY024208; Mon, 8 Mar 2021 09:44:07 GMT (envelope-from git) Date: Mon, 8 Mar 2021 09:44:07 GMT Message-Id: <202103080944.1289i7uY024208@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alex Richardson Subject: git: 01fe4cac28d0 - main - kern.mk: Fix wrong variable being used for linker path after 172a624f0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: arichardson X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 01fe4cac28d0b5ab2b8f4ef081fd3c81dcbb4df3 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, 08 Mar 2021 09:44:07 -0000 The branch main has been updated by arichardson: URL: https://cgit.FreeBSD.org/src/commit/?id=01fe4cac28d0b5ab2b8f4ef081fd3c81dcbb4df3 commit 01fe4cac28d0b5ab2b8f4ef081fd3c81dcbb4df3 Author: Alex Richardson AuthorDate: 2021-03-08 09:37:39 +0000 Commit: Alex Richardson CommitDate: 2021-03-08 09:37:46 +0000 kern.mk: Fix wrong variable being used for linker path after 172a624f0 When I synchronized kern.mk with bsd.sys.mk, I accidentally changed CCLDFLAGS to LDFLAGS which is not used by the kernel builds. This commit should unbreak the GitHub actions cross-build CI. I didn't notice it locally because cheribuild already passes -fuse-ld in the linker flags as it predates this being done in the makefiles. Reported By: Jose Luis Duran Fixes: 172a624f0 ("Silence annoying and incorrect non-default linker warning with GCC") --- sys/conf/kern.mk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/conf/kern.mk b/sys/conf/kern.mk index 8cc79e6645ad..b0a26cd1680c 100644 --- a/sys/conf/kern.mk +++ b/sys/conf/kern.mk @@ -283,9 +283,9 @@ CFLAGS+= -std=${CSTD} .if ${COMPILER_TYPE} == "clang" # Note: Clang does not like relative paths for ld so we map ld.lld -> lld. .if ${COMPILER_VERSION} >= 120000 -LDFLAGS+= --ld-path=${LD:[1]:S/^ld.//1W} +CCLDFLAGS+= --ld-path=${LD:[1]:S/^ld.//1W} .else -LDFLAGS+= -fuse-ld=${LD:[1]:S/^ld.//1W} +CCLDFLAGS+= -fuse-ld=${LD:[1]:S/^ld.//1W} .endif .else # GCC does not support an absolute path for -fuse-ld so we just print this From owner-dev-commits-src-main@freebsd.org Mon Mar 8 09:44: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 A34BE56BD53; Mon, 8 Mar 2021 09:44: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 4DvD204BzXz3tWV; Mon, 8 Mar 2021 09:44: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 8336426D91; Mon, 8 Mar 2021 09:44: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 1289i8EY024229; Mon, 8 Mar 2021 09:44:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1289i8Ul024226; Mon, 8 Mar 2021 09:44:08 GMT (envelope-from git) Date: Mon, 8 Mar 2021 09:44:08 GMT Message-Id: <202103080944.1289i8Ul024226@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alex Richardson Subject: git: 0b86424c31ec - main - tests/sys/cddl: correctly quote atf_set "require.progs" MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: arichardson X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 0b86424c31ece31190c94d55feb5d190be4de5df 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, 08 Mar 2021 09:44:08 -0000 The branch main has been updated by arichardson: URL: https://cgit.FreeBSD.org/src/commit/?id=0b86424c31ece31190c94d55feb5d190be4de5df commit 0b86424c31ece31190c94d55feb5d190be4de5df Author: Alex Richardson AuthorDate: 2021-03-08 09:38:24 +0000 Commit: Alex Richardson CommitDate: 2021-03-08 09:38:27 +0000 tests/sys/cddl: correctly quote atf_set "require.progs" The argument has to be a single whitespace-separate value. While touching all these lines also add ksh93, since `atf_set "require.progs"` overrides the default value specified in the Kyuafile. This then results in tests being executed despite ksh93 not being installed. Reviewed By: asomers Differential Revision: https://reviews.freebsd.org/D29066 --- tests/sys/cddl/zfs/tests/acl/cifs/cifs_test.sh | 12 +-- .../zfs/tests/acl/nontrivial/nontrivial_test.sh | 34 ++++----- .../sys/cddl/zfs/tests/acl/trivial/trivial_test.sh | 56 +++++++------- tests/sys/cddl/zfs/tests/atime/atime_test.sh | 4 +- tests/sys/cddl/zfs/tests/bootfs/bootfs_test.sh | 18 ++--- tests/sys/cddl/zfs/tests/cache/cache_test.sh | 22 +++--- .../sys/cddl/zfs/tests/cachefile/cachefile_test.sh | 8 +- tests/sys/cddl/zfs/tests/cli_root/zdb/zdb_test.sh | 2 +- tests/sys/cddl/zfs/tests/cli_root/zfs/zfs_test.sh | 6 +- .../zfs/tests/cli_root/zfs_clone/zfs_clone_test.sh | 18 ++--- .../tests/cli_root/zfs_copies/zfs_copies_test.sh | 12 +-- .../tests/cli_root/zfs_create/zfs_create_test.sh | 26 +++---- .../tests/cli_root/zfs_destroy/zfs_destroy_test.sh | 14 ++-- .../zfs/tests/cli_root/zfs_diff/zfs_diff_test.sh | 2 +- .../zfs/tests/cli_root/zfs_get/zfs_get_test.sh | 20 ++--- .../tests/cli_root/zfs_inherit/zfs_inherit_test.sh | 6 +- .../zfs/tests/cli_root/zfs_mount/zfs_mount_test.sh | 24 +++--- .../tests/cli_root/zfs_promote/zfs_promote_test.sh | 16 ++-- .../cli_root/zfs_property/zfs_property_test.sh | 2 +- .../tests/cli_root/zfs_receive/zfs_receive_test.sh | 18 ++--- .../tests/cli_root/zfs_rename/zfs_rename_test.sh | 26 +++---- .../zfs_reservation/zfs_reservation_test.sh | 4 +- .../cli_root/zfs_rollback/zfs_rollback_test.sh | 8 +- .../zfs/tests/cli_root/zfs_send/zfs_send_test.sh | 8 +- .../zfs/tests/cli_root/zfs_set/zfs_set_test.sh | 44 +++++------ .../zfs/tests/cli_root/zfs_share/zfs_share_test.sh | 22 +++--- .../cli_root/zfs_snapshot/zfs_snapshot_test.sh | 14 ++-- .../tests/cli_root/zfs_unmount/zfs_unmount_test.sh | 20 ++--- .../tests/cli_root/zfs_unshare/zfs_unshare_test.sh | 10 +-- .../tests/cli_root/zfs_upgrade/zfs_upgrade_test.sh | 14 ++-- .../cddl/zfs/tests/cli_root/zpool/zpool_test.sh | 6 +- .../zfs/tests/cli_root/zpool_add/zpool_add_test.sh | 20 ++--- .../cli_root/zpool_attach/zpool_attach_test.sh | 2 +- .../tests/cli_root/zpool_clear/zpool_clear_test.sh | 10 +-- .../cli_root/zpool_create/zpool_create_test.sh | 40 +++++----- .../cli_root/zpool_destroy/zpool_destroy_test.sh | 8 +- .../cli_root/zpool_detach/zpool_detach_test.sh | 2 +- .../cli_root/zpool_expand/zpool_expand_test.sh | 6 +- .../cli_root/zpool_export/zpool_export_test.sh | 8 +- .../zfs/tests/cli_root/zpool_get/zpool_get_test.sh | 8 +- .../cli_root/zpool_history/zpool_history_test.sh | 4 +- .../cli_root/zpool_import/zpool_import_test.sh | 46 ++++++------ .../cli_root/zpool_offline/zpool_offline_test.sh | 4 +- .../cli_root/zpool_online/zpool_online_test.sh | 4 +- .../cli_root/zpool_remove/zpool_remove_test.sh | 6 +- .../cli_root/zpool_replace/zpool_replace_test.sh | 4 +- .../tests/cli_root/zpool_scrub/zpool_scrub_test.sh | 10 +-- .../zfs/tests/cli_root/zpool_set/zpool_set_test.sh | 6 +- .../cli_root/zpool_status/zpool_status_test.sh | 4 +- .../cli_root/zpool_upgrade/zpool_upgrade_test.sh | 18 ++--- .../sys/cddl/zfs/tests/cli_user/misc/misc_test.sh | 86 +++++++++++----------- .../zfs/tests/cli_user/zfs_list/zfs_list_test.sh | 16 ++-- .../cli_user/zpool_iostat/zpool_iostat_test.sh | 6 +- .../tests/cli_user/zpool_list/zpool_list_test.sh | 4 +- .../cddl/zfs/tests/compression/compression_test.sh | 6 +- tests/sys/cddl/zfs/tests/ctime/ctime_test.sh | 2 +- .../sys/cddl/zfs/tests/delegate/zfs_allow_test.sh | 24 +++--- .../cddl/zfs/tests/delegate/zfs_unallow_test.sh | 16 ++-- tests/sys/cddl/zfs/tests/devices/devices_test.sh | 4 +- tests/sys/cddl/zfs/tests/exec/exec_test.sh | 4 +- .../sys/cddl/zfs/tests/grow_pool/grow_pool_test.sh | 2 +- .../zfs/tests/grow_replicas/grow_replicas_test.sh | 2 +- tests/sys/cddl/zfs/tests/history/history_test.sh | 20 ++--- tests/sys/cddl/zfs/tests/hotplug/hotplug_test.sh | 6 +- tests/sys/cddl/zfs/tests/hotspare/hotspare_test.sh | 52 ++++++------- .../cddl/zfs/tests/inheritance/inheritance_test.sh | 2 +- tests/sys/cddl/zfs/tests/interop/interop_test.sh | 2 +- tests/sys/cddl/zfs/tests/inuse/inuse_test.sh | 4 +- tests/sys/cddl/zfs/tests/iscsi/iscsi_test.sh | 12 +-- .../zfs/tests/largest_pool/largest_pool_test.sh | 2 +- .../cddl/zfs/tests/link_count/link_count_test.sh | 2 +- .../sys/cddl/zfs/tests/migration/migration_test.sh | 24 +++--- tests/sys/cddl/zfs/tests/mmap/mmap_test.sh | 2 +- tests/sys/cddl/zfs/tests/mount/mount_test.sh | 4 +- tests/sys/cddl/zfs/tests/mv_files/mv_files_test.sh | 4 +- tests/sys/cddl/zfs/tests/nestedfs/nestedfs_test.sh | 2 +- tests/sys/cddl/zfs/tests/no_space/no_space_test.sh | 2 +- .../tests/online_offline/online_offline_test.sh | 4 +- .../cddl/zfs/tests/pool_names/pool_names_test.sh | 4 +- .../cddl/zfs/tests/poolversion/poolversion_test.sh | 4 +- tests/sys/cddl/zfs/tests/quota/quota_test.sh | 12 +-- .../cddl/zfs/tests/redundancy/redundancy_test.sh | 2 +- tests/sys/cddl/zfs/tests/refquota/refquota_test.sh | 12 +-- .../sys/cddl/zfs/tests/refreserv/refreserv_test.sh | 10 +-- .../cddl/zfs/tests/replacement/replacement_test.sh | 6 +- .../cddl/zfs/tests/reservation/reservation_test.sh | 36 ++++----- tests/sys/cddl/zfs/tests/rootpool/rootpool_test.sh | 4 +- tests/sys/cddl/zfs/tests/rsend/rsend_test.sh | 26 +++---- .../zfs/tests/scrub_mirror/scrub_mirror_test.sh | 8 +- tests/sys/cddl/zfs/tests/slog/slog_test.sh | 28 +++---- tests/sys/cddl/zfs/tests/snapshot/snapshot_test.sh | 48 ++++++------ tests/sys/cddl/zfs/tests/snapused/snapused_test.sh | 10 +-- tests/sys/cddl/zfs/tests/sparse/sparse_test.sh | 2 +- tests/sys/cddl/zfs/tests/truncate/truncate_test.sh | 2 +- .../sys/cddl/zfs/tests/userquota/userquota_test.sh | 32 ++++---- .../cddl/zfs/tests/utils_test/utils_test_test.sh | 18 ++--- .../cddl/zfs/tests/write_dirs/write_dirs_test.sh | 4 +- tests/sys/cddl/zfs/tests/xattr/xattr_test.sh | 26 +++---- tests/sys/cddl/zfs/tests/zfsd/zfsd_test.sh | 36 ++++----- tests/sys/cddl/zfs/tests/zil/zil_test.sh | 4 +- tests/sys/cddl/zfs/tests/zinject/zinject_test.sh | 8 +- tests/sys/cddl/zfs/tests/zones/zones_test.sh | 10 +-- .../cddl/zfs/tests/zvol/zvol_cli/zvol_cli_test.sh | 6 +- .../zfs/tests/zvol/zvol_misc/zvol_misc_test.sh | 16 ++-- .../zfs/tests/zvol/zvol_swap/zvol_swap_test.sh | 12 +-- .../cddl/zfs/tests/zvol_thrash/zvol_thrash_test.sh | 2 +- 106 files changed, 705 insertions(+), 705 deletions(-) diff --git a/tests/sys/cddl/zfs/tests/acl/cifs/cifs_test.sh b/tests/sys/cddl/zfs/tests/acl/cifs/cifs_test.sh index 01a14aac61ed..e05ad8b03912 100755 --- a/tests/sys/cddl/zfs/tests/acl/cifs/cifs_test.sh +++ b/tests/sys/cddl/zfs/tests/acl/cifs/cifs_test.sh @@ -30,8 +30,8 @@ atf_test_case cifs_attr_001_pos cleanup cifs_attr_001_pos_head() { atf_set "descr" "Verify set/clear DOS attributes will succeed while user haswrite_attributes permission or PRIV_FILE_OWNER privilege" - atf_set "require.config" zfs_acl zfs_xattr - atf_set "require.progs" runwattr + atf_set "require.config" "zfs_acl zfs_xattr" + atf_set "require.progs" "ksh93 runwattr" } cifs_attr_001_pos_body() { @@ -57,8 +57,8 @@ atf_test_case cifs_attr_002_pos cleanup cifs_attr_002_pos_head() { atf_set "descr" "Verify set/clear BSD'ish attributes will succeed while user hasPRIV_FILE_FLAG_SET/PRIV_FILE_FLAG_CLEAR privilege" - atf_set "require.config" zfs_acl zfs_xattr - atf_set "require.progs" runwattr + atf_set "require.config" "zfs_acl zfs_xattr" + atf_set "require.progs" "ksh93 runwattr" } cifs_attr_002_pos_body() { @@ -84,8 +84,8 @@ atf_test_case cifs_attr_003_pos cleanup cifs_attr_003_pos_head() { atf_set "descr" "Verify DOS & BSD'ish attributes will provide theaccess limitation as expected." - atf_set "require.config" zfs_acl zfs_xattr - atf_set "require.progs" runat + atf_set "require.config" "zfs_acl zfs_xattr" + atf_set "require.progs" "ksh93 runat" } cifs_attr_003_pos_body() { diff --git a/tests/sys/cddl/zfs/tests/acl/nontrivial/nontrivial_test.sh b/tests/sys/cddl/zfs/tests/acl/nontrivial/nontrivial_test.sh index 01abe61d532f..a75c25e9c721 100755 --- a/tests/sys/cddl/zfs/tests/acl/nontrivial/nontrivial_test.sh +++ b/tests/sys/cddl/zfs/tests/acl/nontrivial/nontrivial_test.sh @@ -55,7 +55,7 @@ zfs_acl_chmod_002_pos_head() { atf_set "descr" "Verify acl after upgrading." atf_set "require.config" zfs_acl - atf_set "require.progs" zfs + atf_set "require.progs" "ksh93 zfs" } zfs_acl_chmod_002_pos_body() { @@ -80,7 +80,7 @@ zfs_acl_chmod_aclmode_001_pos_head() { atf_set "descr" "Verify chmod have correct behaviour to directory and file whenfilesystem has the different aclmode setting." atf_set "require.config" zfs_acl - atf_set "require.progs" zfs + atf_set "require.progs" "ksh93 zfs" } zfs_acl_chmod_aclmode_001_pos_body() { @@ -177,7 +177,7 @@ zfs_acl_chmod_inherit_002_pos_head() { atf_set "descr" "Verify chmod have correct behaviour to directory and file whenfilesystem has the different aclinherit setting." atf_set "require.config" zfs_acl - atf_set "require.progs" zfs + atf_set "require.progs" "ksh93 zfs" } zfs_acl_chmod_inherit_002_pos_body() { @@ -202,7 +202,7 @@ zfs_acl_chmod_inherit_003_pos_head() { atf_set "descr" "Verify chmod have correct behaviour to directory and file whenfilesystem has the different aclinherit setting." atf_set "require.config" zfs_acl - atf_set "require.progs" zfs + atf_set "require.progs" "ksh93 zfs" } zfs_acl_chmod_inherit_003_pos_body() { @@ -227,7 +227,7 @@ zfs_acl_chmod_inherit_004_pos_head() { atf_set "descr" "Verify aclinherit=passthrough-x will inherit the 'x' bits while mode request." atf_set "require.config" zfs_acl - atf_set "require.progs" zfs zpool + atf_set "require.progs" "ksh93 zfs zpool" } zfs_acl_chmod_inherit_004_pos_body() { @@ -395,8 +395,8 @@ atf_test_case zfs_acl_chmod_xattr_001_pos cleanup zfs_acl_chmod_xattr_001_pos_head() { atf_set "descr" "Verify that the permission of read_xattr/write_xattr forowner/group/everyone are correct." - atf_set "require.config" zfs_acl zfs_xattr - atf_set "require.progs" runat + atf_set "require.config" "zfs_acl zfs_xattr" + atf_set "require.progs" "ksh93 runat" } zfs_acl_chmod_xattr_001_pos_body() { @@ -421,7 +421,7 @@ zfs_acl_chmod_xattr_002_pos_head() { atf_set "descr" "Verify that the permission of write_xattr forowner/group/everyone while remove extended attributes are correct." atf_set "require.config" zfs_xattr - atf_set "require.progs" runat + atf_set "require.progs" "ksh93 runat" } zfs_acl_chmod_xattr_002_pos_body() { @@ -446,7 +446,7 @@ zfs_acl_cp_001_pos_head() { atf_set "descr" "Verify that '$CP [-p]' supports ZFS ACLs." atf_set "require.config" zfs_acl - atf_set "require.progs" zfs + atf_set "require.progs" "ksh93 zfs" } zfs_acl_cp_001_pos_body() { @@ -470,8 +470,8 @@ atf_test_case zfs_acl_cp_002_pos cleanup zfs_acl_cp_002_pos_head() { atf_set "descr" "Verify that '$CP [-p]' supports ZFS ACLs." - atf_set "require.config" zfs_acl zfs_xattr - atf_set "require.progs" zfs runat + atf_set "require.config" "zfs_acl zfs_xattr" + atf_set "require.progs" "ksh93 zfs runat" } zfs_acl_cp_002_pos_body() { @@ -496,7 +496,7 @@ zfs_acl_cpio_001_pos_head() { atf_set "descr" "Verify that '$CPIO' command supports to archive ZFS ACLs." atf_set "require.config" zfs_acl - atf_set "require.progs" zfs + atf_set "require.progs" "ksh93 zfs" } zfs_acl_cpio_001_pos_body() { @@ -520,8 +520,8 @@ atf_test_case zfs_acl_cpio_002_pos cleanup zfs_acl_cpio_002_pos_head() { atf_set "descr" "Verify that '$CPIO' command supports to archive ZFS ACLs & xattrs." - atf_set "require.config" zfs_acl zfs_xattr - atf_set "require.progs" zfs runat + atf_set "require.config" "zfs_acl zfs_xattr" + atf_set "require.progs" "ksh93 zfs runat" } zfs_acl_cpio_002_pos_body() { @@ -618,7 +618,7 @@ zfs_acl_tar_001_pos_head() { atf_set "descr" "Verify that '$TAR' command supports to archive ZFS ACLs." atf_set "require.config" zfs_acl - atf_set "require.progs" zfs + atf_set "require.progs" "ksh93 zfs" } zfs_acl_tar_001_pos_body() { @@ -642,8 +642,8 @@ atf_test_case zfs_acl_tar_002_pos cleanup zfs_acl_tar_002_pos_head() { atf_set "descr" "Verify that '$TAR' command supports to archive ZFS ACLs & xattrs." - atf_set "require.config" zfs_acl zfs_xattr - atf_set "require.progs" zfs runat + atf_set "require.config" "zfs_acl zfs_xattr" + atf_set "require.progs" "ksh93 zfs runat" } zfs_acl_tar_002_pos_body() { diff --git a/tests/sys/cddl/zfs/tests/acl/trivial/trivial_test.sh b/tests/sys/cddl/zfs/tests/acl/trivial/trivial_test.sh index f979cc30c145..26ee9f534084 100755 --- a/tests/sys/cddl/zfs/tests/acl/trivial/trivial_test.sh +++ b/tests/sys/cddl/zfs/tests/acl/trivial/trivial_test.sh @@ -53,7 +53,7 @@ atf_test_case zfs_acl_compress_001_pos cleanup zfs_acl_compress_001_pos_head() { atf_set "descr" "Compress will keep file attribute intact after the file iscompressed and uncompressed" - atf_set "require.config" zfs_acl zfs_xattr + atf_set "require.config" "zfs_acl zfs_xattr" } zfs_acl_compress_001_pos_body() { @@ -77,7 +77,7 @@ atf_test_case zfs_acl_cp_001_pos cleanup zfs_acl_cp_001_pos_head() { atf_set "descr" "Verifies that cp will include file attribute when using the -@ flag" - atf_set "require.config" zfs_acl zfs_xattr + atf_set "require.config" "zfs_acl zfs_xattr" } zfs_acl_cp_001_pos_body() { @@ -101,7 +101,7 @@ atf_test_case zfs_acl_cp_002_neg cleanup zfs_acl_cp_002_neg_head() { atf_set "descr" "Verifies that cp will not include file attribute when the -@ flagis not present." - atf_set "require.config" zfs_acl zfs_xattr + atf_set "require.config" "zfs_acl zfs_xattr" } zfs_acl_cp_002_neg_body() { @@ -125,8 +125,8 @@ atf_test_case zfs_acl_cp_003_neg cleanup zfs_acl_cp_003_neg_head() { atf_set "descr" "Verifies that cp won't be able to include file attribute whenattribute is unreadable (except root)" - atf_set "require.config" zfs_acl zfs_xattr - atf_set "require.progs" runat + atf_set "require.config" "zfs_acl zfs_xattr" + atf_set "require.progs" "ksh93 runat" } zfs_acl_cp_003_neg_body() { @@ -150,7 +150,7 @@ atf_test_case zfs_acl_find_001_pos cleanup zfs_acl_find_001_pos_head() { atf_set "descr" "Verifies ability to find files with attribute with-xattr flag and using '-exec runat ls'" - atf_set "require.config" zfs_acl zfs_xattr + atf_set "require.config" "zfs_acl zfs_xattr" } zfs_acl_find_001_pos_body() { @@ -174,8 +174,8 @@ atf_test_case zfs_acl_find_002_neg cleanup zfs_acl_find_002_neg_head() { atf_set "descr" "verifies -xattr doesn't include files withoutattribute and using '-exec runat ls'" - atf_set "require.config" zfs_acl zfs_xattr - atf_set "require.progs" runat + atf_set "require.config" "zfs_acl zfs_xattr" + atf_set "require.progs" "ksh93 runat" } zfs_acl_find_002_neg_body() { @@ -199,7 +199,7 @@ atf_test_case zfs_acl_ls_001_pos cleanup zfs_acl_ls_001_pos_head() { atf_set "descr" "Verifies that ls displays @ in the file permissions using ls -@for files with attribute." - atf_set "require.config" zfs_acl zfs_xattr + atf_set "require.config" "zfs_acl zfs_xattr" } zfs_acl_ls_001_pos_body() { @@ -223,8 +223,8 @@ atf_test_case zfs_acl_ls_002_neg cleanup zfs_acl_ls_002_neg_head() { atf_set "descr" "Verifies that ls doesn't display @ in the filepermissions using ls -@ for files without attribute." - atf_set "require.config" zfs_acl zfs_xattr - atf_set "require.progs" runat + atf_set "require.config" "zfs_acl zfs_xattr" + atf_set "require.progs" "ksh93 runat" } zfs_acl_ls_002_neg_body() { @@ -248,7 +248,7 @@ atf_test_case zfs_acl_mv_001_pos cleanup zfs_acl_mv_001_pos_head() { atf_set "descr" "Verifies that mv will include file attribute." - atf_set "require.config" zfs_acl zfs_xattr + atf_set "require.config" "zfs_acl zfs_xattr" } zfs_acl_mv_001_pos_body() { @@ -272,8 +272,8 @@ atf_test_case zfs_acl_pack_001_pos cleanup zfs_acl_pack_001_pos_head() { atf_set "descr" "Verifies that pack will keep file attribute intact after the fileis packed and unpacked" - atf_set "require.config" zfs_acl zfs_xattr - atf_set "require.progs" unpack pack + atf_set "require.config" "zfs_acl zfs_xattr" + atf_set "require.progs" "ksh93 unpack pack" } zfs_acl_pack_001_pos_body() { @@ -297,8 +297,8 @@ atf_test_case zfs_acl_pax_001_pos cleanup zfs_acl_pax_001_pos_head() { atf_set "descr" "Verify include attribute in pax archive and restore with paxshould succeed." - atf_set "require.config" zfs_acl zfs_xattr - atf_set "require.progs" pax + atf_set "require.config" "zfs_acl zfs_xattr" + atf_set "require.progs" "ksh93 pax" } zfs_acl_pax_001_pos_body() { @@ -322,8 +322,8 @@ atf_test_case zfs_acl_pax_002_pos cleanup zfs_acl_pax_002_pos_head() { atf_set "descr" "Verify include attribute in pax archive and restore with tarshould succeed." - atf_set "require.config" zfs_acl zfs_xattr - atf_set "require.progs" pax + atf_set "require.config" "zfs_acl zfs_xattr" + atf_set "require.progs" "ksh93 pax" } zfs_acl_pax_002_pos_body() { @@ -347,8 +347,8 @@ atf_test_case zfs_acl_pax_003_pos cleanup zfs_acl_pax_003_pos_head() { atf_set "descr" "Verify include attribute in pax archive and restore with cpioshould succeed." - atf_set "require.config" zfs_acl zfs_xattr - atf_set "require.progs" pax + atf_set "require.config" "zfs_acl zfs_xattr" + atf_set "require.progs" "ksh93 pax" } zfs_acl_pax_003_pos_body() { @@ -372,8 +372,8 @@ atf_test_case zfs_acl_pax_004_pos cleanup zfs_acl_pax_004_pos_head() { atf_set "descr" "Verify files include attribute in pax archive and restore with paxshould succeed." - atf_set "require.config" zfs_acl zfs_xattr - atf_set "require.progs" pax + atf_set "require.config" "zfs_acl zfs_xattr" + atf_set "require.progs" "ksh93 pax" } zfs_acl_pax_004_pos_body() { @@ -397,8 +397,8 @@ atf_test_case zfs_acl_pax_005_pos cleanup zfs_acl_pax_005_pos_head() { atf_set "descr" "Verify files include attribute in cpio archive and restore withcpio should succeed." - atf_set "require.config" zfs_acl zfs_xattr - atf_set "require.progs" pax + atf_set "require.config" "zfs_acl zfs_xattr" + atf_set "require.progs" "ksh93 pax" } zfs_acl_pax_005_pos_body() { @@ -422,8 +422,8 @@ atf_test_case zfs_acl_pax_006_pos cleanup zfs_acl_pax_006_pos_head() { atf_set "descr" "Verify files include attribute in tar archive and restore withtar should succeed." - atf_set "require.config" zfs_acl zfs_xattr - atf_set "require.progs" pax + atf_set "require.config" "zfs_acl zfs_xattr" + atf_set "require.progs" "ksh93 pax" } zfs_acl_pax_006_pos_body() { @@ -447,7 +447,7 @@ atf_test_case zfs_acl_tar_001_pos cleanup zfs_acl_tar_001_pos_head() { atf_set "descr" "Verifies that tar will include file attribute when @ flag ispresent." - atf_set "require.config" zfs_acl zfs_xattr + atf_set "require.config" "zfs_acl zfs_xattr" } zfs_acl_tar_001_pos_body() { @@ -471,7 +471,7 @@ atf_test_case zfs_acl_tar_002_neg cleanup zfs_acl_tar_002_neg_head() { atf_set "descr" "Verifies that tar will not include files attribute when @ flag isnot present" - atf_set "require.config" zfs_acl zfs_xattr + atf_set "require.config" "zfs_acl zfs_xattr" } zfs_acl_tar_002_neg_body() { diff --git a/tests/sys/cddl/zfs/tests/atime/atime_test.sh b/tests/sys/cddl/zfs/tests/atime/atime_test.sh index a36fc5c2eee2..7350c750ac3e 100755 --- a/tests/sys/cddl/zfs/tests/atime/atime_test.sh +++ b/tests/sys/cddl/zfs/tests/atime/atime_test.sh @@ -30,7 +30,7 @@ atf_test_case atime_001_pos cleanup atime_001_pos_head() { atf_set "descr" "Setting atime=on, the access time for files is updated when read." - atf_set "require.progs" zfs + atf_set "require.progs" "ksh93 zfs" } atime_001_pos_body() { @@ -56,7 +56,7 @@ atf_test_case atime_002_neg cleanup atime_002_neg_head() { atf_set "descr" "Setting atime=off, the access time for files will not be updatedwhen read." - atf_set "require.progs" zfs + atf_set "require.progs" "ksh93 zfs" } atime_002_neg_body() { diff --git a/tests/sys/cddl/zfs/tests/bootfs/bootfs_test.sh b/tests/sys/cddl/zfs/tests/bootfs/bootfs_test.sh index b6a9feb0f3ba..9cb52e73409c 100755 --- a/tests/sys/cddl/zfs/tests/bootfs/bootfs_test.sh +++ b/tests/sys/cddl/zfs/tests/bootfs/bootfs_test.sh @@ -30,7 +30,7 @@ atf_test_case bootfs_001_pos bootfs_001_pos_head() { atf_set "descr" "Valid datasets are accepted as bootfs property values" - atf_set "require.progs" zpool zfs + atf_set "require.progs" "ksh93 zpool zfs" } bootfs_001_pos_body() { @@ -45,7 +45,7 @@ atf_test_case bootfs_002_neg bootfs_002_neg_head() { atf_set "descr" "Invalid datasets are rejected as boot property values" - atf_set "require.progs" zfs zpool + atf_set "require.progs" "ksh93 zfs zpool" } bootfs_002_neg_body() { @@ -61,7 +61,7 @@ atf_test_case bootfs_003_pos bootfs_003_pos_head() { atf_set "descr" "Valid pool names are accepted by zpool set bootfs" - atf_set "require.progs" zpool zfs + atf_set "require.progs" "ksh93 zpool zfs" } bootfs_003_pos_body() { @@ -76,7 +76,7 @@ atf_test_case bootfs_004_neg bootfs_004_neg_head() { atf_set "descr" "Invalid pool names are rejected by zpool set bootfs" - atf_set "require.progs" zpool zfs + atf_set "require.progs" "ksh93 zpool zfs" } bootfs_004_neg_body() { @@ -91,7 +91,7 @@ atf_test_case bootfs_005_neg bootfs_005_neg_head() { atf_set "descr" "Boot properties cannot be set on pools with older versions" - atf_set "require.progs" zfs zpool + atf_set "require.progs" "ksh93 zfs zpool" } bootfs_005_neg_body() { @@ -107,7 +107,7 @@ atf_test_case bootfs_006_pos bootfs_006_pos_head() { atf_set "descr" "Pools of correct vdev types accept boot property" - atf_set "require.progs" zfs zpool + atf_set "require.progs" "ksh93 zfs zpool" } bootfs_006_pos_body() { @@ -122,7 +122,7 @@ atf_test_case bootfs_007_pos bootfs_007_pos_head() { atf_set "descr" "setting bootfs on a pool which was configured with the whole disk will succeed" - atf_set "require.progs" zfs zpool + atf_set "require.progs" "ksh93 zfs zpool" } bootfs_007_pos_body() { @@ -138,7 +138,7 @@ atf_test_case bootfs_008_neg bootfs_008_neg_head() { atf_set "descr" "setting bootfs on a dataset which has gzip compression enabled will fail" - atf_set "require.progs" zpool zfs + atf_set "require.progs" "ksh93 zpool zfs" } bootfs_008_neg_body() { @@ -154,7 +154,7 @@ bootfs_009_neg_head() { atf_set "descr" "Valid encrypted datasets can't be set bootfs property values" atf_set "require.config" zfs_encryption - atf_set "require.progs" zfs zpool + atf_set "require.progs" "ksh93 zfs zpool" } bootfs_009_neg_body() { diff --git a/tests/sys/cddl/zfs/tests/cache/cache_test.sh b/tests/sys/cddl/zfs/tests/cache/cache_test.sh index f722dbf0efdc..cf420d1e2b41 100755 --- a/tests/sys/cddl/zfs/tests/cache/cache_test.sh +++ b/tests/sys/cddl/zfs/tests/cache/cache_test.sh @@ -30,7 +30,7 @@ atf_test_case cache_001_pos cleanup cache_001_pos_head() { atf_set "descr" "Creating a pool with a cache device succeeds." - atf_set "require.progs" zpool + atf_set "require.progs" "ksh93 zpool" atf_set "timeout" 1200 } cache_001_pos_body() @@ -57,7 +57,7 @@ atf_test_case cache_002_pos cleanup cache_002_pos_head() { atf_set "descr" "Adding a cache device to normal pool works." - atf_set "require.progs" zpool + atf_set "require.progs" "ksh93 zpool" atf_set "timeout" 1200 } cache_002_pos_body() @@ -84,7 +84,7 @@ atf_test_case cache_003_pos cleanup cache_003_pos_head() { atf_set "descr" "Adding an extra cache device works." - atf_set "require.progs" zpool + atf_set "require.progs" "ksh93 zpool" atf_set "timeout" 1200 } cache_003_pos_body() @@ -111,7 +111,7 @@ atf_test_case cache_004_neg cleanup cache_004_neg_head() { atf_set "descr" "Attaching a cache device fails." - atf_set "require.progs" zpool + atf_set "require.progs" "ksh93 zpool" atf_set "timeout" 1200 } cache_004_neg_body() @@ -138,7 +138,7 @@ atf_test_case cache_005_neg cleanup cache_005_neg_head() { atf_set "descr" "Replacing a cache device fails." - atf_set "require.progs" zpool + atf_set "require.progs" "ksh93 zpool" atf_set "timeout" 1200 } cache_005_neg_body() @@ -165,7 +165,7 @@ atf_test_case cache_006_pos cleanup cache_006_pos_head() { atf_set "descr" "Exporting and importing pool with cache devices passes." - atf_set "require.progs" zpool + atf_set "require.progs" "ksh93 zpool" atf_set "timeout" 1200 } cache_006_pos_body() @@ -192,7 +192,7 @@ atf_test_case cache_007_neg cleanup cache_007_neg_head() { atf_set "descr" "A mirror/raidz/raidz2 cache is not supported." - atf_set "require.progs" zpool + atf_set "require.progs" "ksh93 zpool" atf_set "timeout" 1200 } cache_007_neg_body() @@ -219,7 +219,7 @@ atf_test_case cache_008_neg cleanup cache_008_neg_head() { atf_set "descr" "A raidz/raidz2 cache can not be added to existed pool." - atf_set "require.progs" zpool + atf_set "require.progs" "ksh93 zpool" atf_set "timeout" 1200 } cache_008_neg_body() @@ -246,7 +246,7 @@ atf_test_case cache_009_pos cleanup cache_009_pos_head() { atf_set "descr" "Offline and online a cache device succeed." - atf_set "require.progs" zpool + atf_set "require.progs" "ksh93 zpool" atf_set "timeout" 1200 } cache_009_pos_body() @@ -273,7 +273,7 @@ atf_test_case cache_010_neg cleanup cache_010_neg_head() { atf_set "descr" "Cache device can only be disk or slice." - atf_set "require.progs" zfs zpool + atf_set "require.progs" "ksh93 zfs zpool" atf_set "timeout" 1200 } cache_010_neg_body() @@ -300,7 +300,7 @@ atf_test_case cache_011_pos cleanup cache_011_pos_head() { atf_set "descr" "Remove cache device from pool with spare device should succeed" - atf_set "require.progs" zpool + atf_set "require.progs" "ksh93 zpool" atf_set "timeout" 1200 } cache_011_pos_body() diff --git a/tests/sys/cddl/zfs/tests/cachefile/cachefile_test.sh b/tests/sys/cddl/zfs/tests/cachefile/cachefile_test.sh index 04e7dc09f7e5..691ca66e3682 100755 --- a/tests/sys/cddl/zfs/tests/cachefile/cachefile_test.sh +++ b/tests/sys/cddl/zfs/tests/cachefile/cachefile_test.sh @@ -30,7 +30,7 @@ atf_test_case cachefile_001_pos cachefile_001_pos_head() { atf_set "descr" "Creating a pool with \cachefile\ set doesn't update zpool.cache" - atf_set "require.progs" zpool + atf_set "require.progs" "ksh93 zpool" } cachefile_001_pos_body() { @@ -47,7 +47,7 @@ atf_test_case cachefile_002_pos cachefile_002_pos_head() { atf_set "descr" "Importing a pool with \cachefile\ set doesn't update zpool.cache" - atf_set "require.progs" zpool + atf_set "require.progs" "ksh93 zpool" } cachefile_002_pos_body() { @@ -64,7 +64,7 @@ atf_test_case cachefile_003_pos cachefile_003_pos_head() { atf_set "descr" "Setting altroot=path and cachefile=$CPATH for zpool create succeed." - atf_set "require.progs" zpool + atf_set "require.progs" "ksh93 zpool" } cachefile_003_pos_body() { @@ -81,7 +81,7 @@ atf_test_case cachefile_004_pos cachefile_004_pos_head() { atf_set "descr" "Verify set, export and destroy when cachefile is set on pool." - atf_set "require.progs" zpool + atf_set "require.progs" "ksh93 zpool" } cachefile_004_pos_body() { diff --git a/tests/sys/cddl/zfs/tests/cli_root/zdb/zdb_test.sh b/tests/sys/cddl/zfs/tests/cli_root/zdb/zdb_test.sh index e75da9201b5d..60168a3da493 100755 --- a/tests/sys/cddl/zfs/tests/cli_root/zdb/zdb_test.sh +++ b/tests/sys/cddl/zfs/tests/cli_root/zdb/zdb_test.sh @@ -30,7 +30,7 @@ atf_test_case zdb_001_neg cleanup zdb_001_neg_head() { atf_set "descr" "Execute zdb using invalid parameters." - atf_set "require.progs" zdb + atf_set "require.progs" "ksh93 zdb" } zdb_001_neg_body() { diff --git a/tests/sys/cddl/zfs/tests/cli_root/zfs/zfs_test.sh b/tests/sys/cddl/zfs/tests/cli_root/zfs/zfs_test.sh index 3d2270e28af8..aa96a7846983 100755 --- a/tests/sys/cddl/zfs/tests/cli_root/zfs/zfs_test.sh +++ b/tests/sys/cddl/zfs/tests/cli_root/zfs/zfs_test.sh @@ -30,7 +30,7 @@ atf_test_case zfs_001_neg cleanup zfs_001_neg_head() { atf_set "descr" "Badly-formed zfs sub-command should return an error." - atf_set "require.progs" zfs + atf_set "require.progs" "ksh93 zfs" } zfs_001_neg_body() { @@ -54,7 +54,7 @@ atf_test_case zfs_002_pos cleanup zfs_002_pos_head() { atf_set "descr" "With ZFS_ABORT set, all zfs commands can abort and generate a core file." - atf_set "require.progs" zfs coreadm + atf_set "require.progs" "ksh93 zfs coreadm" } zfs_002_pos_body() { @@ -78,7 +78,7 @@ atf_test_case zfs_003_neg cleanup zfs_003_neg_head() { atf_set "descr" "zfs fails with unexpected scenarios." - atf_set "require.progs" zfs + atf_set "require.progs" "ksh93 zfs" } zfs_003_neg_body() { diff --git a/tests/sys/cddl/zfs/tests/cli_root/zfs_clone/zfs_clone_test.sh b/tests/sys/cddl/zfs/tests/cli_root/zfs_clone/zfs_clone_test.sh index 5e82fd885ce1..d304770f419e 100755 --- a/tests/sys/cddl/zfs/tests/cli_root/zfs_clone/zfs_clone_test.sh +++ b/tests/sys/cddl/zfs/tests/cli_root/zfs_clone/zfs_clone_test.sh @@ -30,7 +30,7 @@ atf_test_case zfs_clone_001_neg cleanup zfs_clone_001_neg_head() { atf_set "descr" "Badly-formed 'zfs clone' with inapplicable scenariosshould return an error." - atf_set "require.progs" zfs + atf_set "require.progs" "ksh93 zfs" } zfs_clone_001_neg_body() { @@ -54,7 +54,7 @@ atf_test_case zfs_clone_002_pos cleanup zfs_clone_002_pos_head() { atf_set "descr" "clone -p should work as expected." - atf_set "require.progs" zfs + atf_set "require.progs" "ksh93 zfs" } zfs_clone_002_pos_body() { @@ -78,7 +78,7 @@ atf_test_case zfs_clone_003_pos cleanup zfs_clone_003_pos_head() { atf_set "descr" "'zfs clone -o property=value filesystem' can successfully createa ZFS clone filesystem with correct property set." - atf_set "require.progs" zfs + atf_set "require.progs" "ksh93 zfs" } zfs_clone_003_pos_body() { @@ -102,7 +102,7 @@ atf_test_case zfs_clone_004_pos cleanup zfs_clone_004_pos_head() { atf_set "descr" "'zfs clone -o property=value filesystem' can successfully createa ZFS clone filesystem with multiple properties set." - atf_set "require.progs" zfs + atf_set "require.progs" "ksh93 zfs" } zfs_clone_004_pos_body() { @@ -126,7 +126,7 @@ atf_test_case zfs_clone_005_pos cleanup zfs_clone_005_pos_head() { atf_set "descr" "'zfs clone -o property=value -V size volume' can successfullycreate a ZFS clone volume with correct property set." - atf_set "require.progs" zfs + atf_set "require.progs" "ksh93 zfs" } zfs_clone_005_pos_body() { @@ -150,7 +150,7 @@ atf_test_case zfs_clone_006_pos cleanup zfs_clone_006_pos_head() { atf_set "descr" "'zfs clone -o property=value volume' can successfullycreate a ZFS clone volume with multiple correct properties set." - atf_set "require.progs" zfs + atf_set "require.progs" "ksh93 zfs" } zfs_clone_006_pos_body() { @@ -174,7 +174,7 @@ atf_test_case zfs_clone_007_pos cleanup zfs_clone_007_pos_head() { atf_set "descr" "'zfs clone -o version=' could upgrade version,but downgrade is denied." - atf_set "require.progs" zfs + atf_set "require.progs" "ksh93 zfs" } zfs_clone_007_pos_body() { @@ -198,7 +198,7 @@ atf_test_case zfs_clone_008_neg cleanup zfs_clone_008_neg_head() { atf_set "descr" "Verify 'zfs clone -o ' fails with bad argument." - atf_set "require.progs" zfs + atf_set "require.progs" "ksh93 zfs" } zfs_clone_008_neg_body() { @@ -222,7 +222,7 @@ atf_test_case zfs_clone_009_neg cleanup zfs_clone_009_neg_head() { atf_set "descr" "Verify 'zfs clone -o ' fails with bad argument." - atf_set "require.progs" zfs + atf_set "require.progs" "ksh93 zfs" } zfs_clone_009_neg_body() { diff --git a/tests/sys/cddl/zfs/tests/cli_root/zfs_copies/zfs_copies_test.sh b/tests/sys/cddl/zfs/tests/cli_root/zfs_copies/zfs_copies_test.sh index 121b94b80b92..d0cd94ae0484 100755 --- a/tests/sys/cddl/zfs/tests/cli_root/zfs_copies/zfs_copies_test.sh +++ b/tests/sys/cddl/zfs/tests/cli_root/zfs_copies/zfs_copies_test.sh @@ -30,7 +30,7 @@ atf_test_case zfs_copies_001_pos cleanup zfs_copies_001_pos_head() { atf_set "descr" "Verify 'copies' property with correct arguments works or not." - atf_set "require.progs" zfs + atf_set "require.progs" "ksh93 zfs" } zfs_copies_001_pos_body() { @@ -56,7 +56,7 @@ atf_test_case zfs_copies_002_pos cleanup zfs_copies_002_pos_head() { atf_set "descr" "Verify that the space used by multiple copies is charged correctly." - atf_set "require.progs" zfs + atf_set "require.progs" "ksh93 zfs" } zfs_copies_002_pos_body() { @@ -82,7 +82,7 @@ atf_test_case zfs_copies_003_pos cleanup zfs_copies_003_pos_head() { atf_set "descr" "Verify that ZFS volume space used by multiple copies is charged correctly." - atf_set "require.progs" zfs + atf_set "require.progs" "ksh93 zfs" } zfs_copies_003_pos_body() { @@ -108,7 +108,7 @@ atf_test_case zfs_copies_004_neg cleanup zfs_copies_004_neg_head() { atf_set "descr" "Verify that copies property cannot be set to any value other than 1,2 or 3" - atf_set "require.progs" zfs + atf_set "require.progs" "ksh93 zfs" } zfs_copies_004_neg_body() { @@ -135,7 +135,7 @@ atf_test_case zfs_copies_005_neg cleanup zfs_copies_005_neg_head() { atf_set "descr" "Verify that copies cannot be set with pool version 1" - atf_set "require.progs" zfs zpool + atf_set "require.progs" "ksh93 zfs zpool" } zfs_copies_005_neg_body() { @@ -161,7 +161,7 @@ atf_test_case zfs_copies_006_pos cleanup zfs_copies_006_pos_head() { atf_set "descr" "Verify that ZFS volume space used by multiple copies is charged correctly." - atf_set "require.progs" zfs + atf_set "require.progs" "ksh93 zfs" } zfs_copies_006_pos_body() { diff --git a/tests/sys/cddl/zfs/tests/cli_root/zfs_create/zfs_create_test.sh b/tests/sys/cddl/zfs/tests/cli_root/zfs_create/zfs_create_test.sh index 00185dbf4a0b..a79a10263386 100755 --- a/tests/sys/cddl/zfs/tests/cli_root/zfs_create/zfs_create_test.sh +++ b/tests/sys/cddl/zfs/tests/cli_root/zfs_create/zfs_create_test.sh @@ -30,7 +30,7 @@ atf_test_case zfs_create_001_pos cleanup zfs_create_001_pos_head() { atf_set "descr" "'zfs create ' can create a ZFS filesystem in the namespace." - atf_set "require.progs" zfs + atf_set "require.progs" "ksh93 zfs" } zfs_create_001_pos_body() { @@ -58,7 +58,7 @@ atf_test_case zfs_create_002_pos cleanup zfs_create_002_pos_head() { atf_set "descr" "'zfs create -s -V ' succeeds" - atf_set "require.progs" zfs + atf_set "require.progs" "ksh93 zfs" } zfs_create_002_pos_body() { @@ -86,7 +86,7 @@ atf_test_case zfs_create_003_pos cleanup zfs_create_003_pos_head() { atf_set "descr" "Verify creating volume with specified blocksize works." - atf_set "require.progs" zfs + atf_set "require.progs" "ksh93 zfs" } zfs_create_003_pos_body() { @@ -114,7 +114,7 @@ atf_test_case zfs_create_004_pos cleanup zfs_create_004_pos_head() { atf_set "descr" "'zfs create -o property=value filesystem' can successfully createa ZFS filesystem with correct property set." - atf_set "require.progs" zfs + atf_set "require.progs" "ksh93 zfs" } zfs_create_004_pos_body() { @@ -142,7 +142,7 @@ atf_test_case zfs_create_005_pos cleanup zfs_create_005_pos_head() { atf_set "descr" "'zfs create -o property=value filesystem' can successfully createa ZFS filesystem with multiple properties set." - atf_set "require.progs" zfs + atf_set "require.progs" "ksh93 zfs" } zfs_create_005_pos_body() { @@ -170,7 +170,7 @@ atf_test_case zfs_create_006_pos cleanup zfs_create_006_pos_head() { atf_set "descr" "'zfs create -o property=value -V size volume' can successfullycreate a ZFS volume with correct property set." - atf_set "require.progs" zfs + atf_set "require.progs" "ksh93 zfs" } zfs_create_006_pos_body() { @@ -198,7 +198,7 @@ atf_test_case zfs_create_007_pos cleanup zfs_create_007_pos_head() { atf_set "descr" "'zfs create -o property=value -V size volume' can successfullycreate a ZFS volume with correct property set." - atf_set "require.progs" zfs + atf_set "require.progs" "ksh93 zfs" } zfs_create_007_pos_body() { @@ -226,7 +226,7 @@ atf_test_case zfs_create_008_neg cleanup zfs_create_008_neg_head() { *** 5791 LINES SKIPPED *** From owner-dev-commits-src-main@freebsd.org Mon Mar 8 09:44: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 3EB1C56BEC0; Mon, 8 Mar 2021 09:44: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 4DvD216r2fz3tYM; Mon, 8 Mar 2021 09:44: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 B8676269FC; Mon, 8 Mar 2021 09:44: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 1289i9ke024249; Mon, 8 Mar 2021 09:44:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1289i9R8024248; Mon, 8 Mar 2021 09:44:09 GMT (envelope-from git) Date: Mon, 8 Mar 2021 09:44:09 GMT Message-Id: <202103080944.1289i9R8024248@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alex Richardson Subject: git: 221622ec0c8e - main - lib/msun: Avoid FE_INEXACT for x86 log2l/log10l MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: arichardson X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 221622ec0c8e184dd1ea7e1f77fb45d2d32cb6e2 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, 08 Mar 2021 09:44:11 -0000 The branch main has been updated by arichardson: URL: https://cgit.FreeBSD.org/src/commit/?id=221622ec0c8e184dd1ea7e1f77fb45d2d32cb6e2 commit 221622ec0c8e184dd1ea7e1f77fb45d2d32cb6e2 Author: Alex Richardson AuthorDate: 2021-03-08 09:39:29 +0000 Commit: Alex Richardson CommitDate: 2021-03-08 09:39:32 +0000 lib/msun: Avoid FE_INEXACT for x86 log2l/log10l This fixes tests/lib/msun/logarithm_test after compiling the test with -fno-builtin (D28577). Adding invln10_lo + invln10_10 results in FE_INEXACT (for all inputs) and the same for the log2l invln2_lo + invln2_hi. This patch avoids FE_INEXACT (for exact results such as 0) by defining a constant and using that. Reviewed By: dim Differential Revision: https://reviews.freebsd.org/D28786 --- lib/msun/ld128/s_logl.c | 18 +++++++++--------- lib/msun/ld80/s_logl.c | 9 ++++++--- 2 files changed, 15 insertions(+), 12 deletions(-) diff --git a/lib/msun/ld128/s_logl.c b/lib/msun/ld128/s_logl.c index 93a2a7c35ff5..4774a271e7ad 100644 --- a/lib/msun/ld128/s_logl.c +++ b/lib/msun/ld128/s_logl.c @@ -697,14 +697,15 @@ invln10_hi = 4.3429448176175356e-1, /* 0x1bcb7b15000000.0p-54 */ invln2_hi = 1.4426950402557850e0; /* 0x17154765000000.0p-52 */ static const long double invln10_lo = 1.41498268538580090791605082294397000e-10L, /* 0x137287195355baaafad33dc323ee3.0p-145L */ -invln2_lo = 6.33178418956604368501892137426645911e-10L; /* 0x15c17f0bbbe87fed0691d3e88eb57.0p-143L */ +invln2_lo = 6.33178418956604368501892137426645911e-10L, /* 0x15c17f0bbbe87fed0691d3e88eb57.0p-143L */ +invln10_lo_plus_hi = invln10_lo + invln10_hi, +invln2_lo_plus_hi = invln2_lo + invln2_hi; long double log10l(long double x) { struct ld r; - long double lo; - float hi; + long double hi, lo; ENTERI(); DOPRINT_START(&x); @@ -712,18 +713,17 @@ log10l(long double x) if (!r.lo_set) RETURNPI(r.hi); _2sumF(r.hi, r.lo); - hi = r.hi; + hi = (float)r.hi; lo = r.lo + (r.hi - hi); RETURN2PI(invln10_hi * hi, - (invln10_lo + invln10_hi) * lo + invln10_lo * hi); + invln10_lo_plus_hi * lo + invln10_lo * hi); } long double log2l(long double x) { struct ld r; - long double lo; - float hi; + long double hi, lo; ENTERI(); DOPRINT_START(&x); @@ -731,10 +731,10 @@ log2l(long double x) if (!r.lo_set) RETURNPI(r.hi); _2sumF(r.hi, r.lo); - hi = r.hi; + hi = (float)r.hi; lo = r.lo + (r.hi - hi); RETURN2PI(invln2_hi * hi, - (invln2_lo + invln2_hi) * lo + invln2_lo * hi); + invln2_lo_plus_hi * lo + invln2_lo * hi); } #endif /* STRUCT_RETURN */ diff --git a/lib/msun/ld80/s_logl.c b/lib/msun/ld80/s_logl.c index 0a220f2a2403..d787b953fedb 100644 --- a/lib/msun/ld80/s_logl.c +++ b/lib/msun/ld80/s_logl.c @@ -677,8 +677,11 @@ logl(long double x) static const double invln10_hi = 4.3429448190317999e-1, /* 0x1bcb7b1526e000.0p-54 */ invln10_lo = 7.1842412889749798e-14, /* 0x1438ca9aadd558.0p-96 */ +invln10_lo_plus_hi = invln10_lo + invln10_hi, invln2_hi = 1.4426950408887933e0, /* 0x171547652b8000.0p-52 */ -invln2_lo = 1.7010652264631490e-13; /* 0x17f0bbbe87fed0.0p-95 */ +invln2_lo = 1.7010652264631490e-13, /* 0x17f0bbbe87fed0.0p-95 */ +invln2_lo_plus_hi = invln2_lo + invln2_hi; + long double log10l(long double x) @@ -695,7 +698,7 @@ log10l(long double x) hi = (float)r.hi; lo = r.lo + (r.hi - hi); RETURN2PI(invln10_hi * hi, - (invln10_lo + invln10_hi) * lo + invln10_lo * hi); + invln10_lo_plus_hi * lo + invln10_lo * hi); } long double @@ -713,7 +716,7 @@ log2l(long double x) hi = (float)r.hi; lo = r.lo + (r.hi - hi); RETURN2PI(invln2_hi * hi, - (invln2_lo + invln2_hi) * lo + invln2_lo * hi); + invln2_lo_plus_hi * lo + invln2_lo * hi); } #endif /* STRUCT_RETURN */ From owner-dev-commits-src-main@freebsd.org Mon Mar 8 09:44: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 EAF3956BCED; Mon, 8 Mar 2021 09:44:15 +0000 (UTC) (envelope-from agh@riseup.net) Received: from mx1.riseup.net (mx1.riseup.net [198.252.153.129]) (using TLSv1.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 "*.riseup.net", Issuer "Sectigo RSA Domain Validation Secure Server CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DvD2265hjz3tdb; Mon, 8 Mar 2021 09:44:10 +0000 (UTC) (envelope-from agh@riseup.net) Received: from fews2.riseup.net (fews2-pn.riseup.net [10.0.1.84]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client CN "*.riseup.net", Issuer "Sectigo RSA Domain Validation Secure Server CA" (not verified)) by mx1.riseup.net (Postfix) with ESMTPS id 4DvD203TZ8zDrL7; Mon, 8 Mar 2021 01:44:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=riseup.net; s=squak; t=1615196648; bh=9Cs97QBmWFjv33SHmenp4cBTqCK7P0cB1uIWRwIXRlw=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=oVlsDCeKzX4vNnMWGj69AMADTGkZXIH65Z6IRDvLNHE0X4HIMWscpcWFSNLsA+/oe wam26U336oCGxcm3mnC8zDT59jrFae/Pl1n07do8lnzWg8e+Qq/Y7fEvc5LTsQeCs9 mfxokgMal6OSzGl1aPvC0yGsdQdHvIT1N4ISNsGc= X-Riseup-User-ID: 0A0EBF42FDD35DCF63E231CAA4A3059EAD9135C1AED763365B01EC14C05E7180 Received: from [127.0.0.1] (localhost [127.0.0.1]) by fews2.riseup.net (Postfix) with ESMTPSA id 4DvD201QXkz1xmR; Mon, 8 Mar 2021 01:44:08 -0800 (PST) MIME-Version: 1.0 Date: Mon, 08 Mar 2021 01:44:08 -0800 From: Alastair Hogge To: Cy Schubert Cc: Chris Rees , dev-commits-src-all@freebsd.org, Baptiste Daroussin , src-committers@freebsd.org, dev-commits-src-main@freebsd.org, Rick Parrish Subject: Re: git: 77e1ccbee3ed - main - rc: implement parallel boot In-Reply-To: <202103080716.1287GQWB055131@slippy.cwsent.com> References: <202102231027.11NARYYE041280@gitrepo.freebsd.org> <6D4FCE07-B996-430C-8EA8-6CB37A6DEEE8@bayofrum.net> <74fde23ead6719ac4e56dacb51bca6ed@bayofrum.net> <202103080716.1287GQWB055131@slippy.cwsent.com> Message-ID: <2ed29c1254d48c3724b944ba4a7d6f3c@riseup.net> Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4DvD2265hjz3tdb X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=riseup.net header.s=squak header.b=oVlsDCeK; dmarc=pass (policy=none) header.from=riseup.net; spf=pass (mx1.freebsd.org: domain of agh@riseup.net designates 198.252.153.129 as permitted sender) smtp.mailfrom=agh@riseup.net X-Spamd-Result: default: False [-5.10 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; TO_DN_SOME(0.00)[]; RWL_MAILSPIKE_GOOD(0.00)[198.252.153.129:from]; R_SPF_ALLOW(-0.20)[+mx]; RCVD_COUNT_THREE(0.00)[3]; DKIM_TRACE(0.00)[riseup.net:+]; DMARC_POLICY_ALLOW(-0.50)[riseup.net,none]; RCPT_COUNT_SEVEN(0.00)[7]; NEURAL_HAM_SHORT(-1.00)[-1.000]; RCVD_IN_DNSWL_LOW(-0.10)[198.252.153.129:from]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RBL_DBL_DONT_QUERY_IPS(0.00)[198.252.153.129:from]; MID_RHS_MATCH_FROM(0.00)[]; ASN(0.00)[asn:16652, ipnet:198.252.153.0/24, country:US]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; R_DKIM_ALLOW(-0.20)[riseup.net:s=squak]; FROM_HAS_DN(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; MIME_GOOD(-0.10)[text/plain]; SPAMHAUS_ZRD(0.00)[198.252.153.129:from:127.0.2.255]; DWL_DNSWL_LOW(-1.00)[riseup.net:dkim]; TO_MATCH_ENVRCPT_SOME(0.00)[]; FREEMAIL_CC(0.00)[bayofrum.net,freebsd.org,gmail.com]; RCVD_TLS_ALL(0.00)[]; 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: Mon, 08 Mar 2021 09:44:16 -0000 On 2021-03-08 15:16, Cy Schubert wrote: > In message <74fde23ead6719ac4e56dacb51bca6ed@bayofrum.net>, Chris Rees > writes: >> Forgot to CC the actual author! >> >> On 2021-02-23 17:03, Chris Rees wrote: >> > Hi, >> > >> > On 23 February 2021 10:27:34 GMT, Baptiste Daroussin >> > wrote: >> >> The branch main has been updated by bapt: >> >> >> >> URL: >> >> https://cgit.FreeBSD.org/src/commit/?id=77e1ccbee3ed6c837929e4e232fd07f95b >> fc8294 >> >> >> >> commit 77e1ccbee3ed6c837929e4e232fd07f95bfc8294 >> >> Author: Rick Parrish >> >> AuthorDate: 2021-02-07 06:15:21 +0000 >> >> Commit: Baptiste Daroussin >> >> CommitDate: 2021-02-23 10:16:53 +0000 >> >> >> >> rc: implement parallel boot >> >> >> >> take advantage of the rcorder -p argument to implement parallel >> >> booting in rc. >> >> >> >> According to the author non scientific tests: >> >> on a Core 2 Duo with spinning disk: >> >> >> >> | Services enabled | before | after | saving | >> >> | 0 | 8s | 8s | 0 | >> >> | 1 | 13s | 13s | 0 | >> >> | 2 | 17s | 13s | 5 | >> >> | 3 | 23s | 13s | 10 | >> >> | 4 | 28s | 13s | 15 | >> >> | 5 | 33s | 13s | 20 | >> >> >> >> PR: 249192 >> >> MFC after: 3 weeks >> >> --- >> >> libexec/rc/rc | 49 ++++++++++++++++++++++++++++++++++--------------- >> >> 1 file changed, 34 insertions(+), 15 deletions(-) >> >> >> >> diff --git a/libexec/rc/rc b/libexec/rc/rc >> >> index 35db4a850516..722d7fe35884 100644 >> >> --- a/libexec/rc/rc >> >> +++ b/libexec/rc/rc >> >> @@ -91,19 +91,31 @@ if ! [ -e ${firstboot_sentinel} ]; then >> >> skip_firstboot="-s firstboot" >> >> fi >> >> >> >> +# rc_parallel_start default is "NO" >> >> +rc_parallel_start=${rc_parallel_start:-NO} >> > >> > Should this go in defaults/rc.conf? >> >> I think this should be in defaults/rc.conf-- the load_rc_config line is >> above it. >> >> Incidentally, is the plan for this to go into 13 *and* 12, or just 13? >> It's an exciting step! > > If this does go into 13 or 12, it should be tested in -CURRENT for longer > than three weeks. Probably six weeks. mountd on my NAS fails to load because unbound (via ports) is not yet responding to any name queries: [...] Starting mountd. Mar 8 02:35:13 fafnir mountd[67654]: can't get address info for host direwolf.local. Mar 8 02:35:13 fafnir mountd[67654]: bad host direwolf.local., skipping Mar 8 02:35:13 fafnir mountd[67654]: can't get address info for host nova.local. Mar 8 02:35:13 fafnir mountd[67654]: bad host nova.local., skipping Mar 8 02:35:13 fafnir mountd[67654]: can't get address info for host deimos.local. Mar 8 02:35:13 fafnir mountd[67654]: bad host deimos.local., skipping Mar 8 02:35:13 fafnir mountd[67654]: can't get address info for host koto.local. Mar 8 02:35:13 fafnir mountd[67654]: bad host koto.local., skipping Mar 8 02:35:13 fafnir mountd[67654]: bad exports list line '/exports -maproot': no valid entries Mar 8 02:35:13 fafnir mountd[67654]: can't get address info for host direwolf.local. Mar 8 02:35:13 fafnir mountd[67654]: bad host direwolf.local., skipping Mar 8 02:35:13 fafnir mountd[67654]: can't get address info for host nova.local. Mar 8 02:35:13 fafnir mountd[67654]: bad host nova.local., skipping Mar 8 02:35:13 fafnir mountd[67654]: can't get address info for host deimos.local. Mar 8 02:35:13 fafnir mountd[67654]: bad host deimos.local., skipping Mar 8 02:35:13 fafnir mountd[67654]: can't get address info for host koto.local. Mar 8 02:35:13 fafnir mountd[67654]: bad host koto.local., skipping Mar 8 02:35:13 fafnir mountd[67654]: bad exports list line 'V4: /exports direwolf.local. nova.local. deimos.local. koto.local.': no valid entries Starting nfsd. Mounting late filesystems:. Starting cron. Configuring vt: blanktime. Performing sanity check on sshd configuration. Starting sshd. [...] From owner-dev-commits-src-main@freebsd.org Mon Mar 8 12:55: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 7B51D571C67; Mon, 8 Mar 2021 12:55:00 +0000 (UTC) (envelope-from se@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 4DvJGD2rLdz4cKY; Mon, 8 Mar 2021 12:55:00 +0000 (UTC) (envelope-from se@freebsd.org) Received: from Stefans-MBP-449.fritz.box (p200300cd5f26c900c5758f2b8c70eaef.dip0.t-ipconnect.de [IPv6:2003:cd:5f26:c900:c575:8f2b:8c70:eaef]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: se/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 6C047A75B; Mon, 8 Mar 2021 12:54:57 +0000 (UTC) (envelope-from se@freebsd.org) To: dev-commits-src-all@freebsd.org, src-committers@freebsd.org, dev-commits-src-main@freebsd.org Cc: Chris Rees , Baptiste Daroussin , Rick Parrish , Cy Schubert , Alastair Hogge References: <202102231027.11NARYYE041280@gitrepo.freebsd.org> <6D4FCE07-B996-430C-8EA8-6CB37A6DEEE8@bayofrum.net> <74fde23ead6719ac4e56dacb51bca6ed@bayofrum.net> <202103080716.1287GQWB055131@slippy.cwsent.com> <2ed29c1254d48c3724b944ba4a7d6f3c@riseup.net> From: Stefan Esser Subject: Re: git: 77e1ccbee3ed - main - rc: implement parallel boot Message-ID: <38e603a7-6c04-38f0-2ab8-84dc4303a4e6@freebsd.org> Date: Mon, 8 Mar 2021 13:54:53 +0100 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:78.0) Gecko/20100101 Thunderbird/78.8.0 MIME-Version: 1.0 In-Reply-To: <2ed29c1254d48c3724b944ba4a7d6f3c@riseup.net> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="yUCpJEhUDPo8OlbsS3xTv1HUJiJy3RHm3" 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, 08 Mar 2021 12:55:00 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --yUCpJEhUDPo8OlbsS3xTv1HUJiJy3RHm3 Content-Type: multipart/mixed; boundary="uL2uFaSH9IO96vdjjeafizosWGWwgD79v"; protected-headers="v1" From: Stefan Esser To: dev-commits-src-all@freebsd.org, src-committers@freebsd.org, dev-commits-src-main@freebsd.org Cc: Chris Rees , Baptiste Daroussin , Rick Parrish , Cy Schubert , Alastair Hogge Message-ID: <38e603a7-6c04-38f0-2ab8-84dc4303a4e6@freebsd.org> Subject: Re: git: 77e1ccbee3ed - main - rc: implement parallel boot References: <202102231027.11NARYYE041280@gitrepo.freebsd.org> <6D4FCE07-B996-430C-8EA8-6CB37A6DEEE8@bayofrum.net> <74fde23ead6719ac4e56dacb51bca6ed@bayofrum.net> <202103080716.1287GQWB055131@slippy.cwsent.com> <2ed29c1254d48c3724b944ba4a7d6f3c@riseup.net> In-Reply-To: <2ed29c1254d48c3724b944ba4a7d6f3c@riseup.net> --uL2uFaSH9IO96vdjjeafizosWGWwgD79v Content-Type: text/plain; charset=windows-1252; format=flowed Content-Language: en-US Content-Transfer-Encoding: quoted-printable Am 08.03.21 um 10:44 schrieb Alastair Hogge: > On 2021-03-08 15:16, Cy Schubert wrote: >> In message <74fde23ead6719ac4e56dacb51bca6ed@bayofrum.net>, Chris Rees= >> writes: >>> Incidentally, is the plan for this to go into 13 *and* 12, or just 13= ? >>> It's an exciting step! >> >> If this does go into 13 or 12, it should be tested in -CURRENT for lon= ger >> than three weeks. Probably six weeks. >=20 > mountd on my NAS fails to load because unbound (via ports) is not yet > responding to any name queries: SDDM fails to successfully start an X session now, too. It repeatedly tries to start the X server without success. Only a "service sddm restart" terminates this loop. I do assume that the same applies to quite a number of services that are installed form ports/packages. While we can test parallel execution of rc scripts in base, this is not easily possible for the large number of optional services provided by ports/packages. I'll try to find the cause of the start-up failure for the SDDM case on my system. But even if I get it fixed on my system, it may still fail to start the X server on systems with a different set of ports ... Regards, STefan --uL2uFaSH9IO96vdjjeafizosWGWwgD79v-- --yUCpJEhUDPo8OlbsS3xTv1HUJiJy3RHm3 Content-Type: application/pgp-signature; name="OpenPGP_signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="OpenPGP_signature" -----BEGIN PGP SIGNATURE----- wsB5BAABCAAjFiEEo3HqZZwL7MgrcVMTR+u171r99UQFAmBGHp0FAwAAAAAACgkQR+u171r99UTo mwf+Jn2TptSh6pa4EBkJOvXBNFVPKhTnh/KnYLoM4da3fNigGrnvIPpGsCG+X9tzmCWXu2fPA/Sl uNx+/i9wabN0LiKmNTfz38vxfzssv1fQ8A0JYsV0K+9u13ia9n0TUw/U1eIKvb5vLCpnj9wLT6io DNTzzU9/Cd4c852tF/j9NsAA8RNLL11j4P/tl4lr5eZgkfheZ9EL+Xw378wA2IHE7aIPlVxn4qD1 hhpHHX+/cSoQ4rABduginQKhouzxJcfAk0Tb9nyrZIV9H8OEXaLowWKRmc8nnfaLl7n+NLoF/K/2 C/ep6PlddQ7G/8hveHCghr4jxY/U1pPvfNXigBHH1w== =yrwc -----END PGP SIGNATURE----- --yUCpJEhUDPo8OlbsS3xTv1HUJiJy3RHm3-- From owner-dev-commits-src-main@freebsd.org Mon Mar 8 14:22: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 81587573E1E; Mon, 8 Mar 2021 14:22:55 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from smtp-out-so.shaw.ca (smtp-out-so.shaw.ca [64.59.136.139]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DvLCg0Ft5z4jPc; Mon, 8 Mar 2021 14:22:54 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from spqr.komquats.com ([70.67.229.168]) by shaw.ca with ESMTPA id JGmYlZYiVnRGtJGmalBX23; Mon, 08 Mar 2021 07:22:53 -0700 X-Authority-Analysis: v=2.4 cv=cagXElPM c=1 sm=1 tr=0 ts=6046333d a=7AlCcx2GqMg+lh9P3BclKA==:117 a=7AlCcx2GqMg+lh9P3BclKA==:17 a=xqWC_Br6kY4A:10 a=kj9zAlcOel0A:10 a=dESyimp9J3IA:10 a=6I5d2MoRAAAA:8 a=ZB5LerlCAAAA:8 a=pGLkceISAAAA:8 a=YxBL1-UpAAAA:8 a=bBqXziUQAAAA:8 a=VxmjJ2MpAAAA:8 a=EkcXrb_YAAAA:8 a=E-8GrYASrIsY-qedPWUA:9 a=CjuIK1q_8ugA:10 a=9Ce6f9bjfTkA:10 a=IjZwj45LgO3ly-622nXo:22 a=YKPTzOroS2oaEK2QgPcx:22 a=Ia-lj3WSrqcvXOmTRaiG:22 a=BjKv_IHbNJvPKzgot4uq:22 a=7gXAzLPJhVmCkEl4_tsf:22 a=LK5xJRSDVpKd5WXXoEvA:22 a=BPzZvq435JnGatEyYwdK:22 Received: from slippy.cwsent.com (slippy [IPv6:fc00:1:1:1::5b]) by spqr.komquats.com (Postfix) with ESMTPS id 5DC572EC0; Mon, 8 Mar 2021 06:22:49 -0800 (PST) Received: from slippy (localhost [127.0.0.1]) by slippy.cwsent.com (8.16.1/8.16.1) with ESMTP id 128EMmC9075829; Mon, 8 Mar 2021 06:22:48 -0800 (PST) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <202103081422.128EMmC9075829@slippy.cwsent.com> X-Mailer: exmh version 2.9.0 11/07/2018 with nmh-1.7.1 Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: Stefan Esser cc: dev-commits-src-all@freebsd.org, src-committers@freebsd.org, dev-commits-src-main@freebsd.org, Chris Rees , Baptiste Daroussin , Rick Parrish , Cy Schubert , Alastair Hogge Subject: Re: git: 77e1ccbee3ed - main - rc: implement parallel boot In-reply-to: <38e603a7-6c04-38f0-2ab8-84dc4303a4e6@freebsd.org> References: <202102231027.11NARYYE041280@gitrepo.freebsd.org> <6D4FCE07-B996-430C-8EA8-6CB37A6DEEE8@bayofrum.net> <74fde23ead6719ac4e56dacb51bca6ed@bayofrum.net> <202103080716.1287GQWB055131@slippy.cwsent.com> <2ed29c1254d48c3724b944ba4a7d6f3c@riseup.net> <38e603a7-6c04-38f0-2ab8-84dc4303a4e6@freebsd.org> Comments: In-reply-to Stefan Esser message dated "Mon, 08 Mar 2021 13:54:53 +0100." Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Mon, 08 Mar 2021 06:22:48 -0800 X-CMAE-Envelope: MS4xfClp1nrbq1pVTiU/6+HfHRb9ePQr9e9FK2fKGyv7DVbiT7IdBYn4pjHdrWwDeXMfTNx8sZET7eiIG4Bgb8ak8qu5kzgqWA+0UtUCZZqCIoH9ph0zOkrX zp8pknPTqbvZIxqWs2KBHZtrbUPbx1TXzE0itV0eOa5WKJNSga9kT7gO7Jug9JxOvktXUDYhfK+0xbN3Yrt9Nzg5B79dsQtoBrsAKNiiHp2jHR7GACHQTHAs skBTxGQuoC641daVP9Jc6Ff6eHCyf7WaYXonqEjNkGiBkQ4bvZlF7Ac2jvIHh6tGbawfC35hcmHf7pP1HAcfCAUC9a0fXU6N3r5OAMjAZq0LdCgD4otEUHCj SvY0Rv2FxLFDFJGj3vfOcSmj1po+ZyuK1lxWyqgsaGwDvQ1xB9ziH2YhP2QwKlmJQf7bfD606iH8+G7IF5deD0Be7RMvag== X-Rspamd-Queue-Id: 4DvLCg0Ft5z4jPc 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, 08 Mar 2021 14:22:55 -0000 In message <38e603a7-6c04-38f0-2ab8-84dc4303a4e6@freebsd.org>, Stefan Esser wri tes: > This is an OpenPGP/MIME signed message (RFC 4880 and 3156) > --yUCpJEhUDPo8OlbsS3xTv1HUJiJy3RHm3 > Content-Type: multipart/mixed; boundary="uL2uFaSH9IO96vdjjeafizosWGWwgD79v"; > protected-headers="v1" > From: Stefan Esser > To: dev-commits-src-all@freebsd.org, src-committers@freebsd.org, > dev-commits-src-main@freebsd.org > Cc: Chris Rees , Baptiste Daroussin , > Rick Parrish , Cy Schubert > , Alastair Hogge > Message-ID: <38e603a7-6c04-38f0-2ab8-84dc4303a4e6@freebsd.org> > Subject: Re: git: 77e1ccbee3ed - main - rc: implement parallel boot > References: <202102231027.11NARYYE041280@gitrepo.freebsd.org> > <6D4FCE07-B996-430C-8EA8-6CB37A6DEEE8@bayofrum.net> > <74fde23ead6719ac4e56dacb51bca6ed@bayofrum.net> > <202103080716.1287GQWB055131@slippy.cwsent.com> > <2ed29c1254d48c3724b944ba4a7d6f3c@riseup.net> > In-Reply-To: <2ed29c1254d48c3724b944ba4a7d6f3c@riseup.net> > > --uL2uFaSH9IO96vdjjeafizosWGWwgD79v > Content-Type: text/plain; charset=windows-1252; format=flowed > Content-Language: en-US > Content-Transfer-Encoding: quoted-printable > > Am 08.03.21 um 10:44 schrieb Alastair Hogge: > > On 2021-03-08 15:16, Cy Schubert wrote: > >> In message <74fde23ead6719ac4e56dacb51bca6ed@bayofrum.net>, Chris Rees= > > >> writes: > >>> Incidentally, is the plan for this to go into 13 *and* 12, or just 13= > ? > >>> It's an exciting step! > >> > >> If this does go into 13 or 12, it should be tested in -CURRENT for lon= > ger > >> than three weeks. Probably six weeks. > >=20 > > mountd on my NAS fails to load because unbound (via ports) is not yet > > responding to any name queries: > > SDDM fails to successfully start an X session now, too. > > It repeatedly tries to start the X server without success. > Only a "service sddm restart" terminates this loop. > > I do assume that the same applies to quite a number of services > that are installed form ports/packages. > > While we can test parallel execution of rc scripts in base, this > is not easily possible for the large number of optional services > provided by ports/packages. > > I'll try to find the cause of the start-up failure for the SDDM > case on my system. But even if I get it fixed on my system, it > may still fail to start the X server on systems with a different > set of ports ... > > Regards, STefan Is this new breakage after 763db589328 or before the fixes to this? -- Cheers, Cy Schubert FreeBSD UNIX: Web: https://FreeBSD.org NTP: Web: https://nwtime.org The need of the many outweighs the greed of the few. From owner-dev-commits-src-main@freebsd.org Mon Mar 8 17:05: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 297C9577CA1; Mon, 8 Mar 2021 17:05:58 +0000 (UTC) (envelope-from se@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 4DvPqp0QMNz4shN; Mon, 8 Mar 2021 17:05:58 +0000 (UTC) (envelope-from se@freebsd.org) Received: from Stefans-MBP-449.fritz.box (p200300cd5f26c900c5758f2b8c70eaef.dip0.t-ipconnect.de [IPv6:2003:cd:5f26:c900:c575:8f2b:8c70:eaef]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: se/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 1B6B6C871; Mon, 8 Mar 2021 17:05:54 +0000 (UTC) (envelope-from se@freebsd.org) To: Cy Schubert Cc: dev-commits-src-all@freebsd.org, src-committers@freebsd.org, dev-commits-src-main@freebsd.org, Chris Rees , Baptiste Daroussin , Rick Parrish , Alastair Hogge References: <202102231027.11NARYYE041280@gitrepo.freebsd.org> <6D4FCE07-B996-430C-8EA8-6CB37A6DEEE8@bayofrum.net> <74fde23ead6719ac4e56dacb51bca6ed@bayofrum.net> <202103080716.1287GQWB055131@slippy.cwsent.com> <2ed29c1254d48c3724b944ba4a7d6f3c@riseup.net> <38e603a7-6c04-38f0-2ab8-84dc4303a4e6@freebsd.org> <202103081422.128EMmC9075829@slippy.cwsent.com> From: Stefan Esser Subject: Re: git: 77e1ccbee3ed - main - rc: implement parallel boot Message-ID: <4a4e021c-c874-5511-0e5a-4364df98e2c4@freebsd.org> Date: Mon, 8 Mar 2021 18:05:50 +0100 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:78.0) Gecko/20100101 Thunderbird/78.8.0 MIME-Version: 1.0 In-Reply-To: <202103081422.128EMmC9075829@slippy.cwsent.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="NK2NXzwQu7dx8KsgmaoRg3Dm6O6zdPwBc" 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, 08 Mar 2021 17:05:58 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --NK2NXzwQu7dx8KsgmaoRg3Dm6O6zdPwBc Content-Type: multipart/mixed; boundary="IvLrYgq138dlzrHKca2qNTCpIvtGaetXM"; protected-headers="v1" From: Stefan Esser To: Cy Schubert Cc: dev-commits-src-all@freebsd.org, src-committers@freebsd.org, dev-commits-src-main@freebsd.org, Chris Rees , Baptiste Daroussin , Rick Parrish , Alastair Hogge Message-ID: <4a4e021c-c874-5511-0e5a-4364df98e2c4@freebsd.org> Subject: Re: git: 77e1ccbee3ed - main - rc: implement parallel boot References: <202102231027.11NARYYE041280@gitrepo.freebsd.org> <6D4FCE07-B996-430C-8EA8-6CB37A6DEEE8@bayofrum.net> <74fde23ead6719ac4e56dacb51bca6ed@bayofrum.net> <202103080716.1287GQWB055131@slippy.cwsent.com> <2ed29c1254d48c3724b944ba4a7d6f3c@riseup.net> <38e603a7-6c04-38f0-2ab8-84dc4303a4e6@freebsd.org> <202103081422.128EMmC9075829@slippy.cwsent.com> In-Reply-To: <202103081422.128EMmC9075829@slippy.cwsent.com> --IvLrYgq138dlzrHKca2qNTCpIvtGaetXM Content-Type: text/plain; charset=windows-1252; format=flowed Content-Language: en-US Content-Transfer-Encoding: quoted-printable Am 08.03.21 um 15:22 schrieb Cy Schubert: >> SDDM fails to successfully start an X session now, too. >> >> It repeatedly tries to start the X server without success. >> Only a "service sddm restart" terminates this loop. >> >> I do assume that the same applies to quite a number of services >> that are installed form ports/packages. >> >> While we can test parallel execution of rc scripts in base, this >> is not easily possible for the large number of optional services >> provided by ports/packages. >> >> I'll try to find the cause of the start-up failure for the SDDM >> case on my system. But even if I get it fixed on my system, it >> may still fail to start the X server on systems with a different >> set of ports ... >> >> Regards, STefan >=20 > Is this new breakage after 763db589328 or before the fixes to this? This issue exists since the initial commit that enabled parallel start=20 of rc scripts. I do not see why the X server does not start, since the commands that are started in parallel appear to be completely unrelated and I do assume that scripts are only started from the next line after the previous ones are running (but maybe not yet completely functional). SDDM is in the 2nd-last line of rcorder -p output on my system: /etc/rc.d/sendmail /usr/local/etc/rc.d/apache24 /usr/local/etc/rc.d/postfix /etc/rc.d/othermta /etc/rc.d/bgfsck /usr/local/etc/rc.d/postgresql /etc/rc.d/securelevel /usr/local/etc/rc.d/sddm (All the above listed rc files are on a single line, actually.) BTW: I was surprised to see the following line 139 in /etc/rc: files=3D`rcorder ${skip} ${skip_firstboot} /etc/rc.d/* ${local_rc}=20 ${_rc_parallel} 2>/dev/null` Since ${_rc_parallel} is at the end of the command line, it does not have any impact on the output that is generated ... This seems to indicate that scripts from /usr/local/etc/rc.d are not executed in parallel, which makes the SDDM failure even more surprising. Regards, STefan --IvLrYgq138dlzrHKca2qNTCpIvtGaetXM-- --NK2NXzwQu7dx8KsgmaoRg3Dm6O6zdPwBc Content-Type: application/pgp-signature; name="OpenPGP_signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="OpenPGP_signature" -----BEGIN PGP SIGNATURE----- wsB5BAABCAAjFiEEo3HqZZwL7MgrcVMTR+u171r99UQFAmBGWW8FAwAAAAAACgkQR+u171r99UQ/ gwgAzGhRwN1MuMAFPr9zwSW8mWHNBd5EEzwBr86SrVEHpGkiMhSBVTupwwswXEbmVTSDIcKWNaN+ /5Pf/FVaJT1tHGYbbXHI6dxHQp87CKkVzJRcs66rQD4RNyB19nO2atTjiIDFVzAp6nzjybNRpgiD fqeesP/1SU1I3MIac48UtAraoVBh2jO8syOSW92lyRathfU6zHClENbochvoEy3nuHYTBkCpLCrz uH2g27Lx43dxOV+AlxYMVFkBxbbQq1iJLACuF3MiQyCv5wccLPuFklXiB6BXlxBv9pLSNjyzLhtf A8WB7BgwwszF4wHqabiXKovs4e5jEd7TPsYMhXXgsA== =M1qa -----END PGP SIGNATURE----- --NK2NXzwQu7dx8KsgmaoRg3Dm6O6zdPwBc-- From owner-dev-commits-src-main@freebsd.org Mon Mar 8 17:47: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 53029550D0E; Mon, 8 Mar 2021 17:47:51 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from smtp-out-no.shaw.ca (smtp-out-no.shaw.ca [64.59.134.13]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DvQm65v27z4vpq; Mon, 8 Mar 2021 17:47:50 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from spqr.komquats.com ([70.67.229.168]) by shaw.ca with ESMTPA id JJyslxS0PeHr9JJytlrUFs; Mon, 08 Mar 2021 10:47:48 -0700 X-Authority-Analysis: v=2.4 cv=Yq/K+6UX c=1 sm=1 tr=0 ts=60466344 a=7AlCcx2GqMg+lh9P3BclKA==:117 a=7AlCcx2GqMg+lh9P3BclKA==:17 a=xqWC_Br6kY4A:10 a=kj9zAlcOel0A:10 a=dESyimp9J3IA:10 a=6I5d2MoRAAAA:8 a=YxBL1-UpAAAA:8 a=ZB5LerlCAAAA:8 a=pGLkceISAAAA:8 a=bBqXziUQAAAA:8 a=VxmjJ2MpAAAA:8 a=EkcXrb_YAAAA:8 a=kA6XjwGokMnRZUBWtCkA:9 a=CjuIK1q_8ugA:10 a=3x16XyzRRVwA:10 a=IjZwj45LgO3ly-622nXo:22 a=Ia-lj3WSrqcvXOmTRaiG:22 a=YKPTzOroS2oaEK2QgPcx:22 a=BjKv_IHbNJvPKzgot4uq:22 a=7gXAzLPJhVmCkEl4_tsf:22 a=LK5xJRSDVpKd5WXXoEvA:22 a=BPzZvq435JnGatEyYwdK:22 Received: from slippy.cwsent.com (slippy [IPv6:fc00:1:1:1::5b]) by spqr.komquats.com (Postfix) with ESMTPS id F07592FCF; Mon, 8 Mar 2021 09:47:44 -0800 (PST) Received: from slippy (localhost [127.0.0.1]) by slippy.cwsent.com (8.16.1/8.16.1) with ESMTP id 128HliPA008952; Mon, 8 Mar 2021 09:47:44 -0800 (PST) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <202103081747.128HliPA008952@slippy.cwsent.com> X-Mailer: exmh version 2.9.0 11/07/2018 with nmh-1.7.1 Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: Stefan Esser cc: Cy Schubert , dev-commits-src-all@freebsd.org, src-committers@freebsd.org, dev-commits-src-main@freebsd.org, Chris Rees , Baptiste Daroussin , Rick Parrish , Alastair Hogge Subject: Re: git: 77e1ccbee3ed - main - rc: implement parallel boot In-reply-to: <4a4e021c-c874-5511-0e5a-4364df98e2c4@freebsd.org> References: <202102231027.11NARYYE041280@gitrepo.freebsd.org> <6D4FCE07-B996-430C-8EA8-6CB37A6DEEE8@bayofrum.net> <74fde23ead6719ac4e56dacb51bca6ed@bayofrum.net> <202103080716.1287GQWB055131@slippy.cwsent.com> <2ed29c1254d48c3724b944ba4a7d6f3c@riseup.net> <38e603a7-6c04-38f0-2ab8-84dc4303a4e6@freebsd.org> <202103081422.128EMmC9075829@slippy.cwsent.com> <4a4e021c-c874-5511-0e5a-4364df98e2c4@freebsd.org> Comments: In-reply-to Stefan Esser message dated "Mon, 08 Mar 2021 18:05:50 +0100." Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Mon, 08 Mar 2021 09:47:44 -0800 X-CMAE-Envelope: MS4xfCHZ4J45VMNhdL8ZSCdaafCRuI8avLJKHlfxnSl5lf+I+nIBelqeVve9nL/zoPCaRhYwYHgcpan/V3fgmZ2+1z7Qf8EfJHNvMylhJwlQWJ1PNgOVDCEH 5HN6YXBv69lvrprEXDVKUikGiK99fYkosAdlcSci2d2i3r4WiAjIZFq3m++Zor8b5oXs3RyAWvCnzThuWd5p6fDsFPPoS6ZiFbMreOawyzprCNdiNEqmheln Zgo4XG57Mpb5VvA70DZK05W/mN24ReGiXFSQkRJMkRK5BH1bZBNgNYT5rJERPTE2pv7Yv0Gqbiu0GTVlTB8il0GhTw3dnXws0tLB7bjGAB9KvtpYmH+lcOZ6 /r02+rdTzhlWvko5NVvQJ7oIvJFd5/CioCGAQSRVkJL+wzqdmRyg8hnFzTs2DMDacE8UnIawylsyuBJQa4Ts3HILzHEsOg== X-Rspamd-Queue-Id: 4DvQm65v27z4vpq 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, 08 Mar 2021 17:47:51 -0000 In message <4a4e021c-c874-5511-0e5a-4364df98e2c4@freebsd.org>, Stefan Esser wri tes: > This is an OpenPGP/MIME signed message (RFC 4880 and 3156) > --NK2NXzwQu7dx8KsgmaoRg3Dm6O6zdPwBc > Content-Type: multipart/mixed; boundary="IvLrYgq138dlzrHKca2qNTCpIvtGaetXM"; > protected-headers="v1" > From: Stefan Esser > To: Cy Schubert > Cc: dev-commits-src-all@freebsd.org, src-committers@freebsd.org, > dev-commits-src-main@freebsd.org, Chris Rees , > Baptiste Daroussin , Rick Parrish , > Alastair Hogge > Message-ID: <4a4e021c-c874-5511-0e5a-4364df98e2c4@freebsd.org> > Subject: Re: git: 77e1ccbee3ed - main - rc: implement parallel boot > References: <202102231027.11NARYYE041280@gitrepo.freebsd.org> > <6D4FCE07-B996-430C-8EA8-6CB37A6DEEE8@bayofrum.net> > <74fde23ead6719ac4e56dacb51bca6ed@bayofrum.net> > <202103080716.1287GQWB055131@slippy.cwsent.com> > <2ed29c1254d48c3724b944ba4a7d6f3c@riseup.net> > <38e603a7-6c04-38f0-2ab8-84dc4303a4e6@freebsd.org> > <202103081422.128EMmC9075829@slippy.cwsent.com> > In-Reply-To: <202103081422.128EMmC9075829@slippy.cwsent.com> > > --IvLrYgq138dlzrHKca2qNTCpIvtGaetXM > Content-Type: text/plain; charset=windows-1252; format=flowed > Content-Language: en-US > Content-Transfer-Encoding: quoted-printable > > Am 08.03.21 um 15:22 schrieb Cy Schubert: > >> SDDM fails to successfully start an X session now, too. > >> > >> It repeatedly tries to start the X server without success. > >> Only a "service sddm restart" terminates this loop. > >> > >> I do assume that the same applies to quite a number of services > >> that are installed form ports/packages. > >> > >> While we can test parallel execution of rc scripts in base, this > >> is not easily possible for the large number of optional services > >> provided by ports/packages. > >> > >> I'll try to find the cause of the start-up failure for the SDDM > >> case on my system. But even if I get it fixed on my system, it > >> may still fail to start the X server on systems with a different > >> set of ports ... > >> > >> Regards, STefan > >=20 > > Is this new breakage after 763db589328 or before the fixes to this? > > This issue exists since the initial commit that enabled parallel start=20 > of rc scripts. I do not see why the X server does not start, since the > commands that are started in parallel appear to be completely unrelated > and I do assume that scripts are only started from the next line after > the previous ones are running (but maybe not yet completely functional). Yes, the original commit broke rc due to some incorrect assumptions by the author -- it messed up non-parallel boot here. I don't use parallel rc here. I think bapt@ does. > > SDDM is in the 2nd-last line of rcorder -p output on my system: > > /etc/rc.d/sendmail > /usr/local/etc/rc.d/apache24 > /usr/local/etc/rc.d/postfix > /etc/rc.d/othermta > /etc/rc.d/bgfsck > /usr/local/etc/rc.d/postgresql > /etc/rc.d/securelevel > /usr/local/etc/rc.d/sddm > > (All the above listed rc files are on a single line, actually.) When I started looking at it, it uses spaces to separate related scripts to be started serially and line feeds for parallel threads. > > > BTW: I was surprised to see the following line 139 in /etc/rc: > > files=`rcorder ${skip} ${skip_firstboot} /etc/rc.d/* ${local_rc} > ${_rc_parallel} 2>/dev/null` > > > Since ${_rc_parallel} is at the end of the command line, it does not > have any impact on the output that is generated ... > > This seems to indicate that scripts from /usr/local/etc/rc.d are not > executed in parallel, which makes the SDDM failure even more > surprising. I'll leave this to bapt@ and the author to answer. I suspect that this too wasn't tested, hence the suggestion that this not be MFCed for six weeks, or maybe never. The original commit seriously broke my infrastructure here. -- Cheers, Cy Schubert FreeBSD UNIX: Web: https://FreeBSD.org NTP: Web: https://nwtime.org The need of the many outweighs the greed of the few. From owner-dev-commits-src-main@freebsd.org Mon Mar 8 17:55: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 B0106550AE3; Mon, 8 Mar 2021 17:55: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 4DvQwN4cfFz3C5M; Mon, 8 Mar 2021 17:55: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 91569524B; Mon, 8 Mar 2021 17:55: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 128Ht0wh069328; Mon, 8 Mar 2021 17:55:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 128Ht03c069327; Mon, 8 Mar 2021 17:55:00 GMT (envelope-from git) Date: Mon, 8 Mar 2021 17:55:00 GMT Message-Id: <202103081755.128Ht03c069327@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: af06ff55535d - main - dumpon.8: Ask DDB to call doadump() rather than calling it directly 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: af06ff55535d9b2de253103e974558104e0a3d97 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, 08 Mar 2021 17:55:00 -0000 The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=af06ff55535d9b2de253103e974558104e0a3d97 commit af06ff55535d9b2de253103e974558104e0a3d97 Author: Mark Johnston AuthorDate: 2021-03-08 17:39:05 +0000 Commit: Mark Johnston CommitDate: 2021-03-08 17:39:05 +0000 dumpon.8: Ask DDB to call doadump() rather than calling it directly Sponsored by: The FreeBSD Foundation MFC after: 1 week --- sbin/dumpon/dumpon.8 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sbin/dumpon/dumpon.8 b/sbin/dumpon/dumpon.8 index acdc554ae546..de9bd648e68b 100644 --- a/sbin/dumpon/dumpon.8 +++ b/sbin/dumpon/dumpon.8 @@ -275,7 +275,7 @@ debugger: In the debugger the following commands should be typed to write a core dump and reboot: .Pp -.Dl db> call doadump(0) +.Dl db> dump .Dl db> reset .Pp After reboot From owner-dev-commits-src-main@freebsd.org Mon Mar 8 17:55: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 D87A2550E21; Mon, 8 Mar 2021 17:55: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 4DvQwP5rhxz3C7t; Mon, 8 Mar 2021 17:55: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 BAE1752E8; Mon, 8 Mar 2021 17:55: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 128Ht1HG069348; Mon, 8 Mar 2021 17:55:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 128Ht1Ke069347; Mon, 8 Mar 2021 17:55:01 GMT (envelope-from git) Date: Mon, 8 Mar 2021 17:55:01 GMT Message-Id: <202103081755.128Ht1Ke069347@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: a11009dccb6a - main - wg: Avoid leaking mbufs when the input handshake queue is full 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: a11009dccb6a2e75de2b8f1b45a0896eda2e6d85 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, 08 Mar 2021 17:55:01 -0000 The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=a11009dccb6a2e75de2b8f1b45a0896eda2e6d85 commit a11009dccb6a2e75de2b8f1b45a0896eda2e6d85 Author: Mark Johnston AuthorDate: 2021-03-08 17:39:05 +0000 Commit: Mark Johnston CommitDate: 2021-03-08 17:39:05 +0000 wg: Avoid leaking mbufs when the input handshake queue is full Reviewed by: grehan Sponsored by: The FreeBSD Foundation MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D29011 --- sys/dev/if_wg/module/if_wg_session.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sys/dev/if_wg/module/if_wg_session.c b/sys/dev/if_wg/module/if_wg_session.c index cb2a88812855..c31a06992fe9 100644 --- a/sys/dev/if_wg/module/if_wg_session.c +++ b/sys/dev/if_wg/module/if_wg_session.c @@ -1913,6 +1913,7 @@ wg_input(struct mbuf *m0, int offset, struct inpcb *inpcb, */ if ((m = m_pullup(m0, m0->m_pkthdr.len)) == NULL) { DPRINTF(sc, "DEFRAG fail\n"); + m_freem(m0); return; } data = mtod(m, void *); @@ -1943,8 +1944,10 @@ wg_input(struct mbuf *m0, int offset, struct inpcb *inpcb, verify_endpoint(m); if (mbufq_enqueue(&sc->sc_handshake_queue, m) == 0) { GROUPTASK_ENQUEUE(&sc->sc_handshake); - } else + } else { DPRINTF(sc, "Dropping handshake packet\n"); + wg_m_freem(m); + } } else if (pktlen >= sizeof(struct wg_pkt_data) + NOISE_MAC_SIZE && pkttype == MESSAGE_DATA) { From owner-dev-commits-src-main@freebsd.org Mon Mar 8 17:55:04 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 11F38550E22; Mon, 8 Mar 2021 17:55:04 +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 4DvQwR1Y3qz3CL8; Mon, 8 Mar 2021 17:55: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 DD6C6564F; Mon, 8 Mar 2021 17:55: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 128Ht2lg069369; Mon, 8 Mar 2021 17:55:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 128Ht280069368; Mon, 8 Mar 2021 17:55:02 GMT (envelope-from git) Date: Mon, 8 Mar 2021 17:55:02 GMT Message-Id: <202103081755.128Ht280069368@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: d8cebef50e7b - main - wg: Style 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: d8cebef50e7b5fac1e28bcb1f931962210f9b5f6 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, 08 Mar 2021 17:55:06 -0000 The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=d8cebef50e7b5fac1e28bcb1f931962210f9b5f6 commit d8cebef50e7b5fac1e28bcb1f931962210f9b5f6 Author: Mark Johnston AuthorDate: 2021-03-08 17:39:05 +0000 Commit: Mark Johnston CommitDate: 2021-03-08 17:39:05 +0000 wg: Style MFC after: 1 week Sponsored by: The FreeBSD Foundation --- sys/dev/if_wg/module/if_wg_session.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/sys/dev/if_wg/module/if_wg_session.c b/sys/dev/if_wg/module/if_wg_session.c index c31a06992fe9..75baae063428 100644 --- a/sys/dev/if_wg/module/if_wg_session.c +++ b/sys/dev/if_wg/module/if_wg_session.c @@ -254,15 +254,13 @@ wg_socket_reuse(struct wg_softc *sc, struct socket *so) error = sosetopt(so, &sopt); if (error) { ifp = iflib_get_ifp(sc->wg_ctx); - if_printf(ifp, - "cannot set REUSEPORT socket opt: %d\n", error); + if_printf(ifp, "cannot set REUSEPORT socket opt: %d\n", error); } sopt.sopt_name = SO_REUSEADDR; error = sosetopt(so, &sopt); if (error) { ifp = iflib_get_ifp(sc->wg_ctx); - if_printf(ifp, - "cannot set REUSEADDDR socket opt: %d\n", error); + if_printf(ifp, "cannot set REUSEADDDR socket opt: %d\n", error); } return (error); } From owner-dev-commits-src-main@freebsd.org Mon Mar 8 17:55: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 3CCBC550E27; Mon, 8 Mar 2021 17:55: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 4DvQwT4ffGz3C5j; Mon, 8 Mar 2021 17:55: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 192945791; Mon, 8 Mar 2021 17:55: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 128Ht3qZ069391; Mon, 8 Mar 2021 17:55:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 128Ht3RE069390; Mon, 8 Mar 2021 17:55:03 GMT (envelope-from git) Date: Mon, 8 Mar 2021 17:55:03 GMT Message-Id: <202103081755.128Ht3RE069390@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: 8ff2b41c05a8 - main - posix timers: Declare unexported functions as static 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: 8ff2b41c05a8f98e30250b929e9722f714f1f319 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, 08 Mar 2021 17:55:07 -0000 The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=8ff2b41c05a8f98e30250b929e9722f714f1f319 commit 8ff2b41c05a8f98e30250b929e9722f714f1f319 Author: Mark Johnston AuthorDate: 2021-03-08 17:39:06 +0000 Commit: Mark Johnston CommitDate: 2021-03-08 17:39:06 +0000 posix timers: Declare unexported functions as static MFC after: 1 week Sponsored by: The FreeBSD Foundation --- sys/kern/kern_time.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sys/kern/kern_time.c b/sys/kern/kern_time.c index 6222bdc39bee..1d5bd2343153 100644 --- a/sys/kern/kern_time.c +++ b/sys/kern/kern_time.c @@ -107,8 +107,8 @@ static void realtimer_clocktime(clockid_t, struct timespec *); static void realtimer_expire(void *); static int register_posix_clock(int, const struct kclock *); -void itimer_fire(struct itimer *it); -int itimespecfix(struct timespec *ts); +static void itimer_fire(struct itimer *it); +static int itimespecfix(struct timespec *ts); #define CLOCK_CALL(clock, call, arglist) \ ((*posix_clocks[clock].call) arglist) @@ -1592,7 +1592,7 @@ itimer_accept(struct proc *p, int timerid, ksiginfo_t *ksi) return (EINVAL); } -int +static int itimespecfix(struct timespec *ts) { @@ -1653,7 +1653,7 @@ realtimer_expire(void *arg) } } -void +static void itimer_fire(struct itimer *it) { struct proc *p = it->it_proc; From owner-dev-commits-src-main@freebsd.org Mon Mar 8 17:55: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 C13EE550EC2; Mon, 8 Mar 2021 17:55: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 4DvQwX3P75z3CRs; Mon, 8 Mar 2021 17:55: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 325C95653; Mon, 8 Mar 2021 17:55: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 128Ht5hd069409; Mon, 8 Mar 2021 17:55:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 128Ht5DE069408; Mon, 8 Mar 2021 17:55:05 GMT (envelope-from git) Date: Mon, 8 Mar 2021 17:55:05 GMT Message-Id: <202103081755.128Ht5DE069408@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: 60d12ef952a3 - main - posix timers: Sprinkle some style fixes 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: 60d12ef952a39581e967a1a608522fdbdedefa01 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, 08 Mar 2021 17:55:09 -0000 The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=60d12ef952a39581e967a1a608522fdbdedefa01 commit 60d12ef952a39581e967a1a608522fdbdedefa01 Author: Mark Johnston AuthorDate: 2021-03-08 17:39:06 +0000 Commit: Mark Johnston CommitDate: 2021-03-08 17:39:06 +0000 posix timers: Sprinkle some style fixes MFC after: 1 week Sponsored by: The FreeBSD Foundation --- sys/kern/kern_time.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/sys/kern/kern_time.c b/sys/kern/kern_time.c index 1d5bd2343153..3e85f8e1d6ec 100644 --- a/sys/kern/kern_time.c +++ b/sys/kern/kern_time.c @@ -1518,8 +1518,8 @@ realtimer_gettime(struct itimer *it, struct itimerspec *ovalue) } static int -realtimer_settime(struct itimer *it, int flags, - struct itimerspec *value, struct itimerspec *ovalue) +realtimer_settime(struct itimer *it, int flags, struct itimerspec *value, + struct itimerspec *ovalue) { struct timespec cts, ts; struct timeval tv; @@ -1548,7 +1548,7 @@ realtimer_settime(struct itimer *it, int flags, if ((flags & TIMER_ABSTIME) == 0) { /* Convert to absolute time. */ timespecadd(&it->it_time.it_value, &cts, - &it->it_time.it_value); + &it->it_time.it_value); } else { timespecsub(&ts, &cts, &ts); /* @@ -1557,8 +1557,8 @@ realtimer_settime(struct itimer *it, int flags, */ } TIMESPEC_TO_TIMEVAL(&tv, &ts); - callout_reset(&it->it_callout, tvtohz(&tv), - realtimer_expire, it); + callout_reset(&it->it_callout, tvtohz(&tv), realtimer_expire, + it); } else { callout_stop(&it->it_callout); } @@ -1618,16 +1618,16 @@ realtimer_expire(void *arg) if (timespeccmp(&cts, &it->it_time.it_value, >=)) { if (timespecisset(&it->it_time.it_interval)) { timespecadd(&it->it_time.it_value, - &it->it_time.it_interval, - &it->it_time.it_value); + &it->it_time.it_interval, + &it->it_time.it_value); while (timespeccmp(&cts, &it->it_time.it_value, >=)) { if (it->it_overrun < INT_MAX) it->it_overrun++; else it->it_ksi.ksi_errno = ERANGE; timespecadd(&it->it_time.it_value, - &it->it_time.it_interval, - &it->it_time.it_value); + &it->it_time.it_interval, + &it->it_time.it_value); } } else { /* single shot timer ? */ @@ -1637,7 +1637,7 @@ realtimer_expire(void *arg) timespecsub(&it->it_time.it_value, &cts, &ts); TIMESPEC_TO_TIMEVAL(&tv, &ts); callout_reset(&it->it_callout, tvtohz(&tv), - realtimer_expire, it); + realtimer_expire, it); } itimer_enter(it); ITIMER_UNLOCK(it); @@ -1649,7 +1649,7 @@ realtimer_expire(void *arg) timespecsub(&ts, &cts, &ts); TIMESPEC_TO_TIMEVAL(&tv, &ts); callout_reset(&it->it_callout, tvtohz(&tv), realtimer_expire, - it); + it); } } From owner-dev-commits-src-main@freebsd.org Mon Mar 8 17:55: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 65BCE550D57; Mon, 8 Mar 2021 17:55: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 4DvQwX5fqtz3CRv; Mon, 8 Mar 2021 17:55: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 59D5F56D9; Mon, 8 Mar 2021 17:55: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 128Ht6we069431; Mon, 8 Mar 2021 17:55:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 128Ht6UV069430; Mon, 8 Mar 2021 17:55:06 GMT (envelope-from git) Date: Mon, 8 Mar 2021 17:55:06 GMT Message-Id: <202103081755.128Ht6UV069430@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: 7995dae9d3f5 - main - posix timers: Improve the overrun calculation 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: 7995dae9d3f58abf38ef0001cee24131f3c9054b 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, 08 Mar 2021 17:55:10 -0000 The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=7995dae9d3f58abf38ef0001cee24131f3c9054b commit 7995dae9d3f58abf38ef0001cee24131f3c9054b Author: Mark Johnston AuthorDate: 2021-03-08 17:39:06 +0000 Commit: Mark Johnston CommitDate: 2021-03-08 17:39:06 +0000 posix timers: Improve the overrun calculation timer_settime(2) may be used to configure a timeout in the past. If the timer is also periodic, we also try to compute the number of timer overruns that occurred between the initial timeout and the time at which the timer fired. This is done in a loop which iterates once per period between the initial timeout and now. If the period is small and the initial timeout was a long time ago, this loop can take forever to run, so the system is effectively DOSed. Replace the loop with a more direct calculation of (now - initial timeout) / period to compute the number of overruns. Reported by: syzkaller Reviewed by: kib MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D29093 --- sys/kern/kern_time.c | 35 ++++++++++++++++++++++++++++------- 1 file changed, 28 insertions(+), 7 deletions(-) diff --git a/sys/kern/kern_time.c b/sys/kern/kern_time.c index 3e85f8e1d6ec..44f6b4ad07f2 100644 --- a/sys/kern/kern_time.c +++ b/sys/kern/kern_time.c @@ -1603,6 +1603,13 @@ itimespecfix(struct timespec *ts) return (0); } +#define timespectons(tsp) \ + ((uint64_t)(tsp)->tv_sec * 1000000000 + (tsp)->tv_nsec) +#define timespecfromns(ns) (struct timespec){ \ + .tv_sec = (ns) / 1000000000, \ + .tv_nsec = (ns) % 1000000000 \ +} + /* Timeout callback for realtime timer */ static void realtimer_expire(void *arg) @@ -1610,6 +1617,7 @@ realtimer_expire(void *arg) struct timespec cts, ts; struct timeval tv; struct itimer *it; + uint64_t interval, now, overruns, value; it = (struct itimer *)arg; @@ -1620,14 +1628,27 @@ realtimer_expire(void *arg) timespecadd(&it->it_time.it_value, &it->it_time.it_interval, &it->it_time.it_value); - while (timespeccmp(&cts, &it->it_time.it_value, >=)) { - if (it->it_overrun < INT_MAX) - it->it_overrun++; - else + + interval = timespectons(&it->it_time.it_interval); + value = timespectons(&it->it_time.it_value); + now = timespectons(&cts); + + if (now >= value) { + /* + * We missed at least one period. + */ + overruns = howmany(now - value + 1, interval); + if (it->it_overrun + overruns >= + it->it_overrun && + it->it_overrun + overruns <= INT_MAX) { + it->it_overrun += (int)overruns; + } else { + it->it_overrun = INT_MAX; it->it_ksi.ksi_errno = ERANGE; - timespecadd(&it->it_time.it_value, - &it->it_time.it_interval, - &it->it_time.it_value); + } + value = + now + interval - (now - value) % interval; + it->it_time.it_value = timespecfromns(value); } } else { /* single shot timer ? */ From owner-dev-commits-src-main@freebsd.org Mon Mar 8 17:55: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 9E33B5510DD; Mon, 8 Mar 2021 17:55: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 4DvQwb3r9Wz3CDX; Mon, 8 Mar 2021 17:55: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 C8C165794; Mon, 8 Mar 2021 17:55: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 128Ht9Dd069493; Mon, 8 Mar 2021 17:55:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 128Ht966069492; Mon, 8 Mar 2021 17:55:09 GMT (envelope-from git) Date: Mon, 8 Mar 2021 17:55:09 GMT Message-Id: <202103081755.128Ht966069492@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: ffe3def903a5 - main - iflib: Make if_shared_ctx_t a pointer to const 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: ffe3def903a5f239c319e5fe12450659658974a5 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, 08 Mar 2021 17:55:20 -0000 The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=ffe3def903a5f239c319e5fe12450659658974a5 commit ffe3def903a5f239c319e5fe12450659658974a5 Author: Mark Johnston AuthorDate: 2021-03-08 17:39:06 +0000 Commit: Mark Johnston CommitDate: 2021-03-08 17:39:06 +0000 iflib: Make if_shared_ctx_t a pointer to const This structure is shared among multiple instances of a driver, so we should ensure that it doesn't somehow get treated as if there's a separate instance per interface. This is especially important for software-only drivers like wg. DEVICE_REGISTER() still returns a void * and so the per-driver sctx structures are not yet defined with the const qualifier. Reviewed by: gallatin, erj MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D29102 --- sys/dev/bnxt/if_bnxt.c | 4 +--- sys/dev/e1000/if_em.c | 8 ++------ sys/dev/e1000/igb_txrx.c | 2 -- sys/dev/ixgbe/if_ix.c | 4 +--- sys/dev/ixgbe/if_ixv.c | 4 +--- sys/dev/ixgbe/ix_txrx.c | 2 -- sys/dev/ixl/if_iavf.c | 4 +--- sys/dev/ixl/if_ixl.c | 4 +--- sys/net/iflib.h | 2 +- 9 files changed, 8 insertions(+), 26 deletions(-) diff --git a/sys/dev/bnxt/if_bnxt.c b/sys/dev/bnxt/if_bnxt.c index 7811f4fdebf0..9990e26263b3 100644 --- a/sys/dev/bnxt/if_bnxt.c +++ b/sys/dev/bnxt/if_bnxt.c @@ -327,8 +327,6 @@ static struct if_shared_ctx bnxt_sctx_init = { .isc_driver_version = bnxt_driver_version, }; -if_shared_ctx_t bnxt_sctx = &bnxt_sctx_init; - /* * Device Methods */ @@ -336,7 +334,7 @@ if_shared_ctx_t bnxt_sctx = &bnxt_sctx_init; static void * bnxt_register(device_t dev) { - return bnxt_sctx; + return (&bnxt_sctx_init); } /* diff --git a/sys/dev/e1000/if_em.c b/sys/dev/e1000/if_em.c index b24280dae412..fcf328de9a2e 100644 --- a/sys/dev/e1000/if_em.c +++ b/sys/dev/e1000/if_em.c @@ -554,8 +554,6 @@ static struct if_shared_ctx em_sctx_init = { .isc_ntxd_default = {EM_DEFAULT_TXD}, }; -if_shared_ctx_t em_sctx = &em_sctx_init; - static struct if_shared_ctx igb_sctx_init = { .isc_magic = IFLIB_MAGIC, .isc_q_align = PAGE_SIZE, @@ -583,8 +581,6 @@ static struct if_shared_ctx igb_sctx_init = { .isc_ntxd_default = {EM_DEFAULT_TXD}, }; -if_shared_ctx_t igb_sctx = &igb_sctx_init; - /***************************************************************** * * Dump Registers @@ -707,13 +703,13 @@ static int em_get_regs(SYSCTL_HANDLER_ARGS) static void * em_register(device_t dev) { - return (em_sctx); + return (&em_sctx_init); } static void * igb_register(device_t dev) { - return (igb_sctx); + return (&igb_sctx_init); } static int diff --git a/sys/dev/e1000/igb_txrx.c b/sys/dev/e1000/igb_txrx.c index 6c41d440c769..9f1921bf0c7e 100644 --- a/sys/dev/e1000/igb_txrx.c +++ b/sys/dev/e1000/igb_txrx.c @@ -72,8 +72,6 @@ struct if_txrx igb_txrx = { .ift_legacy_intr = em_intr }; -extern if_shared_ctx_t em_sctx; - /********************************************************************** * * Setup work for hardware segmentation offload (TSO) on diff --git a/sys/dev/ixgbe/if_ix.c b/sys/dev/ixgbe/if_ix.c index 9f3674cdab5d..6e65f6bae55a 100644 --- a/sys/dev/ixgbe/if_ix.c +++ b/sys/dev/ixgbe/if_ix.c @@ -392,8 +392,6 @@ static struct if_shared_ctx ixgbe_sctx_init = { .isc_ntxd_default = {DEFAULT_TXD}, }; -if_shared_ctx_t ixgbe_sctx = &ixgbe_sctx_init; - /************************************************************************ * ixgbe_if_tx_queues_alloc ************************************************************************/ @@ -855,7 +853,7 @@ ixgbe_initialize_transmit_units(if_ctx_t ctx) static void * ixgbe_register(device_t dev) { - return (ixgbe_sctx); + return (&ixgbe_sctx_init); } /* ixgbe_register */ /************************************************************************ diff --git a/sys/dev/ixgbe/if_ixv.c b/sys/dev/ixgbe/if_ixv.c index 6bd92d262558..ee139430d42b 100644 --- a/sys/dev/ixgbe/if_ixv.c +++ b/sys/dev/ixgbe/if_ixv.c @@ -233,12 +233,10 @@ static struct if_shared_ctx ixv_sctx_init = { .isc_ntxd_default = {DEFAULT_TXD}, }; -if_shared_ctx_t ixv_sctx = &ixv_sctx_init; - static void * ixv_register(device_t dev) { - return (ixv_sctx); + return (&ixv_sctx_init); } /************************************************************************ diff --git a/sys/dev/ixgbe/ix_txrx.c b/sys/dev/ixgbe/ix_txrx.c index 43e64b0c0df0..9d31e0b1b43e 100644 --- a/sys/dev/ixgbe/ix_txrx.c +++ b/sys/dev/ixgbe/ix_txrx.c @@ -72,8 +72,6 @@ struct if_txrx ixgbe_txrx = { .ift_legacy_intr = NULL }; -extern if_shared_ctx_t ixgbe_sctx; - /************************************************************************ * ixgbe_tx_ctx_setup * diff --git a/sys/dev/ixl/if_iavf.c b/sys/dev/ixl/if_iavf.c index 394656d27a2f..f6eb91c2a855 100644 --- a/sys/dev/ixl/if_iavf.c +++ b/sys/dev/ixl/if_iavf.c @@ -272,13 +272,11 @@ static struct if_shared_ctx iavf_sctx_init = { .isc_ntxd_default = {IXL_DEFAULT_RING}, }; -if_shared_ctx_t iavf_sctx = &iavf_sctx_init; - /*** Functions ***/ static void * iavf_register(device_t dev) { - return (iavf_sctx); + return (&iavf_sctx_init); } static int diff --git a/sys/dev/ixl/if_ixl.c b/sys/dev/ixl/if_ixl.c index a79648de274f..c700af889cf1 100644 --- a/sys/dev/ixl/if_ixl.c +++ b/sys/dev/ixl/if_ixl.c @@ -351,13 +351,11 @@ static struct if_shared_ctx ixl_sctx_init = { .isc_ntxd_default = {IXL_DEFAULT_RING}, }; -if_shared_ctx_t ixl_sctx = &ixl_sctx_init; - /*** Functions ***/ static void * ixl_register(device_t dev) { - return (ixl_sctx); + return (&ixl_sctx_init); } static int diff --git a/sys/net/iflib.h b/sys/net/iflib.h index 1e8aed271334..f88294b3d01a 100644 --- a/sys/net/iflib.h +++ b/sys/net/iflib.h @@ -49,7 +49,7 @@ typedef uint16_t qidx_t; struct iflib_ctx; typedef struct iflib_ctx *if_ctx_t; struct if_shared_ctx; -typedef struct if_shared_ctx *if_shared_ctx_t; +typedef const struct if_shared_ctx *if_shared_ctx_t; struct if_int_delay_info; typedef struct if_int_delay_info *if_int_delay_info_t; struct if_pseudo; From owner-dev-commits-src-main@freebsd.org Mon Mar 8 17:55: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 67323550AFA; Mon, 8 Mar 2021 17:55: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 4DvQwb3myFz3CNB; Mon, 8 Mar 2021 17:55: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 764F255D6; Mon, 8 Mar 2021 17:55: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 128Ht7l4069453; Mon, 8 Mar 2021 17:55:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 128Ht71X069452; Mon, 8 Mar 2021 17:55:07 GMT (envelope-from git) Date: Mon, 8 Mar 2021 17:55:07 GMT Message-Id: <202103081755.128Ht71X069452@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: 0e72eb460228 - main - ath_hal: Stop printing messages during boot 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: 0e72eb460228e4b9cb790beb7113d0a5c88db503 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, 08 Mar 2021 17:55:21 -0000 The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=0e72eb460228e4b9cb790beb7113d0a5c88db503 commit 0e72eb460228e4b9cb790beb7113d0a5c88db503 Author: Mark Johnston AuthorDate: 2021-03-08 17:39:06 +0000 Commit: Mark Johnston CommitDate: 2021-03-08 17:39:06 +0000 ath_hal: Stop printing messages during boot ath_hal is compiled into the kernel by default and so always prints a message to dmesg even when the system has no ath hardware. MFC after: 1 week Sponsored by: The FreeBSD Foundation --- sys/dev/ath/ah_osdep.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sys/dev/ath/ah_osdep.c b/sys/dev/ath/ah_osdep.c index 44878486a0c7..a760540b0f3a 100644 --- a/sys/dev/ath/ah_osdep.c +++ b/sys/dev/ath/ah_osdep.c @@ -434,11 +434,13 @@ ath_hal_modevent(module_t mod __unused, int type, void *data __unused) switch (type) { case MOD_LOAD: - printf("[ath_hal] loaded\n"); + if (bootverbose) + printf("[ath_hal] loaded\n"); break; case MOD_UNLOAD: - printf("[ath_hal] unloaded\n"); + if (bootverbose) + printf("[ath_hal] unloaded\n"); break; case MOD_SHUTDOWN: From owner-dev-commits-src-main@freebsd.org Mon Mar 8 17:55: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 7E611550ECA; Mon, 8 Mar 2021 17:55: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 4DvQwb3n6Yz3CNC; Mon, 8 Mar 2021 17:55: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 92EE4524D; Mon, 8 Mar 2021 17:55: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 128Ht8HO069473; Mon, 8 Mar 2021 17:55:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 128Ht8Yx069472; Mon, 8 Mar 2021 17:55:08 GMT (envelope-from git) Date: Mon, 8 Mar 2021 17:55:08 GMT Message-Id: <202103081755.128Ht8Yx069472@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: 435c7cfb2418 - main - Rename _cscan_atomic.h and _cscan_bus.h to atomic_san.h and bus_san.h 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: 435c7cfb2418fdac48fa53e29e38ef03646b817d 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, 08 Mar 2021 17:55:17 -0000 The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=435c7cfb2418fdac48fa53e29e38ef03646b817d commit 435c7cfb2418fdac48fa53e29e38ef03646b817d Author: Mark Johnston AuthorDate: 2021-03-08 17:39:06 +0000 Commit: Mark Johnston CommitDate: 2021-03-08 17:39:06 +0000 Rename _cscan_atomic.h and _cscan_bus.h to atomic_san.h and bus_san.h Other kernel sanitizers (KMSAN, KASAN) require interceptors as well, so put these in a more generic place as a step towards importing the other sanitizers. No functional change intended. MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D29103 --- sys/amd64/include/atomic.h | 2 +- sys/arm64/include/atomic.h | 2 +- sys/arm64/include/bus.h | 2 +- sys/kern/subr_csan.c | 4 ++-- sys/sys/{_cscan_atomic.h => atomic_san.h} | 6 +++--- sys/sys/{_cscan_bus.h => bus_san.h} | 6 +++--- sys/x86/include/bus.h | 2 +- 7 files changed, 12 insertions(+), 12 deletions(-) diff --git a/sys/amd64/include/atomic.h b/sys/amd64/include/atomic.h index 87f7b8e8293e..61cb79645c10 100644 --- a/sys/amd64/include/atomic.h +++ b/sys/amd64/include/atomic.h @@ -69,7 +69,7 @@ #endif #if defined(KCSAN) && !defined(KCSAN_RUNTIME) -#include +#include #else #include diff --git a/sys/arm64/include/atomic.h b/sys/arm64/include/atomic.h index 9c5d6224f3e2..6c63357f85b9 100644 --- a/sys/arm64/include/atomic.h +++ b/sys/arm64/include/atomic.h @@ -54,7 +54,7 @@ #define rmb() dmb(ld) /* Full system memory barrier load */ #if defined(KCSAN) && !defined(KCSAN_RUNTIME) -#include +#include #else #include diff --git a/sys/arm64/include/bus.h b/sys/arm64/include/bus.h index 917b2618b275..417b918f595f 100644 --- a/sys/arm64/include/bus.h +++ b/sys/arm64/include/bus.h @@ -92,7 +92,7 @@ #define BUS_SPACE_BARRIER_WRITE 0x02 #if defined(KCSAN) && !defined(KCSAN_RUNTIME) -#include +#include #else struct bus_space { diff --git a/sys/kern/subr_csan.c b/sys/kern/subr_csan.c index 3fa59ef2ea66..ec2fd23729b2 100644 --- a/sys/kern/subr_csan.c +++ b/sys/kern/subr_csan.c @@ -380,7 +380,7 @@ kcsan_copyout(const void *kaddr, void *uaddr, size_t len) /* -------------------------------------------------------------------------- */ #include -#include +#include #define _CSAN_ATOMIC_FUNC_ADD(name, type) \ void kcsan_atomic_add_##name(volatile type *ptr, type val) \ @@ -688,7 +688,7 @@ CSAN_ATOMIC_FUNC_THREAD_FENCE(seq_cst) #include #include -#include +#include int kcsan_bus_space_map(bus_space_tag_t tag, bus_addr_t hnd, bus_size_t size, diff --git a/sys/sys/_cscan_atomic.h b/sys/sys/atomic_san.h similarity index 99% rename from sys/sys/_cscan_atomic.h rename to sys/sys/atomic_san.h index b458c24841bf..c2b963ae8b92 100644 --- a/sys/sys/_cscan_atomic.h +++ b/sys/sys/atomic_san.h @@ -32,8 +32,8 @@ * $FreeBSD$ */ -#ifndef _SYS__CSAN_ATOMIC_H_ -#define _SYS__CSAN_ATOMIC_H_ +#ifndef _SYS_ATOMIC_SAN_H_ +#define _SYS_ATOMIC_SAN_H_ #ifndef _MACHINE_ATOMIC_H_ #error do not include this header, use machine/atomic.h @@ -377,4 +377,4 @@ void kcsan_atomic_thread_fence_seq_cst(void); #endif /* !KCSAN_RUNTIME */ -#endif /* !_SYS__CSAN_ATOMIC_H_ */ +#endif /* !_SYS_ATOMIC_SAN_H_ */ diff --git a/sys/sys/_cscan_bus.h b/sys/sys/bus_san.h similarity index 99% rename from sys/sys/_cscan_bus.h rename to sys/sys/bus_san.h index b1fd4135261e..96b2441fbdbe 100644 --- a/sys/sys/_cscan_bus.h +++ b/sys/sys/bus_san.h @@ -32,8 +32,8 @@ * $FreeBSD$ */ -#ifndef _SYS__CSAN_BUS_H_ -#define _SYS__CSAN_BUS_H_ +#ifndef _SYS_BUS_SAN_H_ +#define _SYS_BUS_SAN_H_ #define KCSAN_BS_MULTI(rw, width, type) \ void kcsan_bus_space_##rw##_multi_##width(bus_space_tag_t, \ @@ -206,4 +206,4 @@ void kcsan_bus_space_barrier(bus_space_tag_t, bus_space_handle_t, bus_size_t, #endif /* !KCSAN_RUNTIME */ -#endif /* !_SYS__CSAN_BUS_H_ */ +#endif /* !_SYS_BUS_SAN_H_ */ diff --git a/sys/x86/include/bus.h b/sys/x86/include/bus.h index 562445b81203..da2fe237ae99 100644 --- a/sys/x86/include/bus.h +++ b/sys/x86/include/bus.h @@ -136,7 +136,7 @@ #define BUS_SPACE_BARRIER_WRITE 0x02 /* force write barrier */ #if defined(KCSAN) && !defined(KCSAN_RUNTIME) -#include +#include #else /* From owner-dev-commits-src-main@freebsd.org Mon Mar 8 17:58: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 834DA5512F8; Mon, 8 Mar 2021 17:58: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 4DvQzr3MxGz3DkD; Mon, 8 Mar 2021 17:58: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 66A0155DC; Mon, 8 Mar 2021 17:58: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 128Hw0kf070058; Mon, 8 Mar 2021 17:58:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 128Hw05O070057; Mon, 8 Mar 2021 17:58:00 GMT (envelope-from git) Date: Mon, 8 Mar 2021 17:58:00 GMT Message-Id: <202103081758.128Hw05O070057@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: 1bb7c45c532f - main - wg: Fix a mismerge 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: 1bb7c45c532f3de76120db05739ac4ee34403091 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, 08 Mar 2021 17:58:00 -0000 The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=1bb7c45c532f3de76120db05739ac4ee34403091 commit 1bb7c45c532f3de76120db05739ac4ee34403091 Author: Mark Johnston AuthorDate: 2021-03-08 17:56:14 +0000 Commit: Mark Johnston CommitDate: 2021-03-08 17:56:14 +0000 wg: Fix a mismerge df55485085 fixed a leak that I had initially fixed in a11009dccb. Fixes: a11009dccb --- sys/dev/if_wg/module/if_wg_session.c | 1 - 1 file changed, 1 deletion(-) diff --git a/sys/dev/if_wg/module/if_wg_session.c b/sys/dev/if_wg/module/if_wg_session.c index 75baae063428..e63367785ed3 100644 --- a/sys/dev/if_wg/module/if_wg_session.c +++ b/sys/dev/if_wg/module/if_wg_session.c @@ -1911,7 +1911,6 @@ wg_input(struct mbuf *m0, int offset, struct inpcb *inpcb, */ if ((m = m_pullup(m0, m0->m_pkthdr.len)) == NULL) { DPRINTF(sc, "DEFRAG fail\n"); - m_freem(m0); return; } data = mtod(m, void *); From owner-dev-commits-src-main@freebsd.org Mon Mar 8 18:05: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 F05AD551AC0; Mon, 8 Mar 2021 18:05:51 +0000 (UTC) (envelope-from kevans@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 4DvR8v6Vtnz3Fb0; Mon, 8 Mar 2021 18:05:51 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from mail-qt1-f177.google.com (mail-qt1-f177.google.com [209.85.160.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) (Authenticated sender: kevans) by smtp.freebsd.org (Postfix) with ESMTPSA id CB766C5B2; Mon, 8 Mar 2021 18:05:51 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-qt1-f177.google.com with SMTP id d11so8177460qtx.9; Mon, 08 Mar 2021 10:05:51 -0800 (PST) X-Gm-Message-State: AOAM533JEUi08ds6cl2/MoqLWiZpmawy7/+D8LmjIRit9bCqPZPpB5WV UHvkyzMHC9Y5NQoAbPlhQ80dhL/+NGpnxnLeH2g= X-Google-Smtp-Source: ABdhPJzT+d0wNTAnOrTQGBB9R6xWOWDJXpEDsa3N47V2n+KB7WIxx7vV/Am4IXyeKuzNRtS3Hojm1fiq0Ofo5cMB+4k= X-Received: by 2002:ac8:5947:: with SMTP id 7mr21872974qtz.60.1615226751399; Mon, 08 Mar 2021 10:05:51 -0800 (PST) MIME-Version: 1.0 References: <202103081758.128Hw05O070057@gitrepo.freebsd.org> In-Reply-To: <202103081758.128Hw05O070057@gitrepo.freebsd.org> From: Kyle Evans Date: Mon, 8 Mar 2021 12:05:37 -0600 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: git: 1bb7c45c532f - main - wg: Fix a mismerge To: Mark Johnston Cc: src-committers , "" , dev-commits-src-main@freebsd.org Content-Type: text/plain; charset="UTF-8" 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, 08 Mar 2021 18:05:52 -0000 On Mon, Mar 8, 2021 at 11:58 AM Mark Johnston wrote: > > The branch main has been updated by markj: > > URL: https://cgit.FreeBSD.org/src/commit/?id=1bb7c45c532f3de76120db05739ac4ee34403091 > > commit 1bb7c45c532f3de76120db05739ac4ee34403091 > Author: Mark Johnston > AuthorDate: 2021-03-08 17:56:14 +0000 > Commit: Mark Johnston > CommitDate: 2021-03-08 17:56:14 +0000 > > wg: Fix a mismerge > > df55485085 fixed a leak that I had initially fixed in a11009dccb. > > Fixes: a11009dccb Whoops, sorry about that. :-( I didn't check for conflicting work here. From owner-dev-commits-src-main@freebsd.org Mon Mar 8 18:09: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 0AAAF55187C; Mon, 8 Mar 2021 18:09:44 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-pg1-x52f.google.com (mail-pg1-x52f.google.com [IPv6:2607:f8b0:4864:20::52f]) (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 4DvRFM6jHSz3Fvt; Mon, 8 Mar 2021 18:09:43 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by mail-pg1-x52f.google.com with SMTP id g4so6912342pgj.0; Mon, 08 Mar 2021 10:09:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=JrQTRO531Ui7uqvOCGhyXvQGVLx+99kZyUrsbpQ5tXs=; b=kptDXQ76cGz0APHcQKHavz93yASaKdGA15sngImEm4icklcXJ/zOUjDXsNnwU1EWDX OJdDc66ftGa4HgwRjGUIID1TgQsY0R+J0oKcP4Klln6q5On4yYmkU3WdC3NR4W23cZNQ dtFH/pDEQkcfEai+O03/TGY7ZPtutXrg6pUKghWLiLY1bAA6vkkz9T2xguAaqrVjs9gI ZbBDg9ovlJI1T1FJi8Wf+pnZcZHB8kgtxxApTWOOFetlpolHIfpizYiffs0FzNcnx92M 9QFDMHTpwCxa/vyh8UuqXbtbQPQdeqNd0dvhY5l/Ww3e82/13ysRXQ9iy4xsFQRddHEQ 1xXQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to; bh=JrQTRO531Ui7uqvOCGhyXvQGVLx+99kZyUrsbpQ5tXs=; b=JmGgaKIrqUynsLBWx12NRLaptVAfrUPmSu/J7MXrGLOOGM4LXqJXDBKX9mZtw3+GQ3 4Vh/FYg9ORfrcY9uGw9W227U2mhTiZPh0gjf6Qg9NrzUuk0u6XfU9v96zNaIXhWfjEHS OGhea0MqbDed/SrVKpylIss2MTlQY4xXBCPMkzrTF9oxeHQD6afPbugMQLFqwz9BQD1C QwybXL3aoyDmu37i6jRoHTu6JlgzX7HmAGtpNsi0nD4e5rGHCR6+koA57YwVN7mbJeYH Eu2yTNRDFR9YB+eLkb46TsKNxK4UpEvJqpnlhlvCReeL4FBbNkGs5su37J22VSXKt/K1 Vcew== X-Gm-Message-State: AOAM5315cyHcAREf5I6hrvFuyelkjn/O2Lq1+N1lptfHYwACPEBBILuY Aq4TIP13cHIrbWvbaGx2Ol3lgYuUAFy53w== X-Google-Smtp-Source: ABdhPJyzaVwZm97KbN+GfDphibgAmFnxv8UOm0OAAa58zuMojAFPPqmG4HJLdt/91KIoDWJiWPQ1eQ== X-Received: by 2002:aa7:8e51:0:b029:1ed:2928:18ff with SMTP id d17-20020aa78e510000b02901ed292818ffmr80010pfr.76.1615226982363; Mon, 08 Mar 2021 10:09:42 -0800 (PST) Received: from spy (ip68-8-187-18.sd.sd.cox.net. [68.8.187.18]) by smtp.gmail.com with ESMTPSA id g22sm52824pju.30.2021.03.08.10.09.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Mar 2021 10:09:41 -0800 (PST) Sender: Mark Johnston Date: Mon, 8 Mar 2021 14:10:42 -0500 From: Mark Johnston To: Kyle Evans Cc: src-committers , "" , dev-commits-src-main@freebsd.org Subject: Re: git: 1bb7c45c532f - main - wg: Fix a mismerge Message-ID: References: <202103081758.128Hw05O070057@gitrepo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Rspamd-Queue-Id: 4DvRFM6jHSz3Fvt 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, 08 Mar 2021 18:09:44 -0000 On Mon, Mar 08, 2021 at 12:05:37PM -0600, Kyle Evans wrote: > On Mon, Mar 8, 2021 at 11:58 AM Mark Johnston wrote: > > > > The branch main has been updated by markj: > > > > URL: https://cgit.FreeBSD.org/src/commit/?id=1bb7c45c532f3de76120db05739ac4ee34403091 > > > > commit 1bb7c45c532f3de76120db05739ac4ee34403091 > > Author: Mark Johnston > > AuthorDate: 2021-03-08 17:56:14 +0000 > > Commit: Mark Johnston > > CommitDate: 2021-03-08 17:56:14 +0000 > > > > wg: Fix a mismerge > > > > df55485085 fixed a leak that I had initially fixed in a11009dccb. > > > > Fixes: a11009dccb > > Whoops, sorry about that. :-( I didn't check for conflicting work here. It's my fault, I saw your commit before I pushed and amended the commit log message accordingly, but then failed to actually update the diff. :/ From owner-dev-commits-src-main@freebsd.org Mon Mar 8 18:15: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 E4F195523ED; Mon, 8 Mar 2021 18:15:45 +0000 (UTC) (envelope-from jhb@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 4DvRNK6Fwbz3GMZ; Mon, 8 Mar 2021 18:15:45 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro.local (ralph.baldwin.cx [66.234.199.215]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id 57CCAD32F; Mon, 8 Mar 2021 18:15:45 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Subject: Re: git: afbee98232f4 - main - Remove xform_poly1305.h from the build, it is not necessary. To: Scott Long , src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org References: <202103052202.125M2CKd002981@gitrepo.freebsd.org> From: John Baldwin Message-ID: Date: Mon, 8 Mar 2021 10:15:40 -0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:78.0) Gecko/20100101 Thunderbird/78.7.1 MIME-Version: 1.0 In-Reply-To: <202103052202.125M2CKd002981@gitrepo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit 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, 08 Mar 2021 18:15:46 -0000 On 3/5/21 2:02 PM, Scott Long wrote: > The branch main has been updated by scottl: > > URL: https://cgit.FreeBSD.org/src/commit/?id=afbee98232f41fc05fa8a5b9a8cda4c4c65ff448 > > commit afbee98232f41fc05fa8a5b9a8cda4c4c65ff448 > Author: Scott Long > AuthorDate: 2021-03-05 21:28:10 +0000 > Commit: Scott Long > CommitDate: 2021-03-05 21:28:10 +0000 > > Remove xform_poly1305.h from the build, it is not necessary. Sorry for the breakage, thanks for fixing it. -- John Baldwin From owner-dev-commits-src-main@freebsd.org Mon Mar 8 18: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 73AD5552FD1; Mon, 8 Mar 2021 18:42:31 +0000 (UTC) (envelope-from jhb@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 4DvRzC2qdkz3J6j; Mon, 8 Mar 2021 18:42:31 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro.local (ralph.baldwin.cx [66.234.199.215]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id B4E26D68C; Mon, 8 Mar 2021 18:42:30 +0000 (UTC) (envelope-from jhb@FreeBSD.org) To: Stefan Esser , Kyle Evans Cc: src-committers , dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org References: <202103051755.125HtZsc073704@gitrepo.freebsd.org> <3e76fccd-efeb-1479-7418-7e69bed98915@freebsd.org> From: John Baldwin Subject: Re: git: bb6e84c988d3 - main - poly1305: Don't export generic Poly1305_* symbols from xform_poly1305.c. Message-ID: <196e118d-c41d-505e-2750-b05ef4328ae7@FreeBSD.org> Date: Mon, 8 Mar 2021 10:42:26 -0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:78.0) Gecko/20100101 Thunderbird/78.7.1 MIME-Version: 1.0 In-Reply-To: <3e76fccd-efeb-1479-7418-7e69bed98915@freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit 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, 08 Mar 2021 18:42:31 -0000 On 3/5/21 12:27 PM, Stefan Esser wrote: > Am 05.03.21 um 21:05 schrieb Kyle Evans: >> On Fri, Mar 5, 2021 at 11:55 AM John Baldwin wrote: >>> >>> The branch main has been updated by jhb: >>> >>> URL: https://cgit.FreeBSD.org/src/commit/?id=bb6e84c988d3f54eff602ed544ceaa9b9fe3e9ff >>> >>> commit bb6e84c988d3f54eff602ed544ceaa9b9fe3e9ff >>> Author: John Baldwin >>> AuthorDate: 2021-03-05 17:47:58 +0000 >>> Commit: John Baldwin >>> CommitDate: 2021-03-05 17:55:11 +0000 >>> >>> poly1305: Don't export generic Poly1305_* symbols from xform_poly1305.c. >>> >>> There currently isn't a need to provide a public interface to a >>> software Poly1305 implementation beyond what is already available via >>> libsodium's APIs and these symbols conflict with symbols shared within >>> the ossl.ko module between ossl_poly1305.c and ossl_chacha20.c. >>> >>> Reported by: se, kp >>> Fixes: 78991a93eb9d >>> Sponsored by: Netflix >>> --- >>> sys/opencrypto/xform_poly1305.c | 43 ++++++++++++----------------------------- >>> sys/opencrypto/xform_poly1305.h | 16 --------------- >>> 2 files changed, 12 insertions(+), 47 deletions(-) >> >> xform_poly1305.h also needs to stop being grouped in >> ^/include/Makefile (reported by jenkins via np) > > AFAICT, sys/opencrypto/xform_poly1305.h needs to be restored ... > > It is needed during buildworld (and present in stable/13). Removing it from include/Makefile as scottl@ and jkim@ did is the right fix. It was a kernel-only header with no userland-usable parts. I need to double check, but probably only cryptodev.h should be installed in /usr/include/crypto as the rest of those headers are all for kernel-only APIs. It looks like I actually need to add some missing entries to ObsoleteFiles.inc for some headers that were removed in 13. Ahhh, we used to just install *.h from sys/opencrypto (which is wrong) and it was switched in f61a3898bb989 to list files explicitly, but that is somewhat why removing headers in the past didn't trigger build breakage. -- John Baldwin From owner-dev-commits-src-main@freebsd.org Mon Mar 8 18:49: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 0BD55553329; Mon, 8 Mar 2021 18:49: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 4DvS6y6v6zz3JS1; Mon, 8 Mar 2021 18: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 DB4445FC9; Mon, 8 Mar 2021 18: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 128InEDV036915; Mon, 8 Mar 2021 18: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 128InEbC036914; Mon, 8 Mar 2021 18:49:14 GMT (envelope-from git) Date: Mon, 8 Mar 2021 18:49:14 GMT Message-Id: <202103081849.128InEbC036914@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: c5a365623f88 - main - Correct the name of the structure used for TCP socket options. 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: c5a365623f88999b524d94003187ef09fda55f67 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, 08 Mar 2021 18:49:15 -0000 The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=c5a365623f88999b524d94003187ef09fda55f67 commit c5a365623f88999b524d94003187ef09fda55f67 Author: John Baldwin AuthorDate: 2021-03-08 18:46:40 +0000 Commit: John Baldwin CommitDate: 2021-03-08 18:46:40 +0000 Correct the name of the structure used for TCP socket options. The structure was renamed while refactoring Netflix's KTLS changes for upstreaming, but the original name remained in tcp.4 and was subsequently copied to ktls.4. PR: 254141 Reported by: asomers MFC after: 3 days --- share/man/man4/ktls.4 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/share/man/man4/ktls.4 b/share/man/man4/ktls.4 index 21e1a1bdb6ca..648eeaedfa6a 100644 --- a/share/man/man4/ktls.4 +++ b/share/man/man4/ktls.4 @@ -31,7 +31,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 8, 2021 +.Dd March 8, 2021 .Dt KTLS 4 .Os .Sh NAME @@ -54,7 +54,7 @@ and .Dv TCP_RXTLS_ENABLE socket options. Both socket options accept a -.Vt struct tls_so_enable +.Vt struct tls_enable structure as their argument. The members of this structure describe the cipher suite used for the TLS session and provide the session keys used for the respective @@ -166,7 +166,7 @@ will fail with one of the following errors: .It Bq Er EINVAL The version fields in a TLS record's header did not match the version required by the -.Vt struct tls_so_enable +.Vt struct tls_enable structure used to enable in-kernel TLS. .It Bq Er EMSGSIZE A TLS record's length was either too small or too large. From owner-dev-commits-src-main@freebsd.org Mon Mar 8 19:18: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 25AA3553CF0; Mon, 8 Mar 2021 19:18: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 4DvSmQ0ZLvz3L7W; Mon, 8 Mar 2021 19:18: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 021BC681D; Mon, 8 Mar 2021 19:18: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 128JIDAa076930; Mon, 8 Mar 2021 19:18:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 128JIDTX076929; Mon, 8 Mar 2021 19:18:13 GMT (envelope-from git) Date: Mon, 8 Mar 2021 19:18:13 GMT Message-Id: <202103081918.128JIDTX076929@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: ef74bfc6fed2 - main - Add ObsoleteFiles.inc entries for various OCF headers removed in 13. 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: ef74bfc6fed298d5ca0e3cb92bf008b715ea0c2f 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, 08 Mar 2021 19:18:14 -0000 The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=ef74bfc6fed298d5ca0e3cb92bf008b715ea0c2f commit ef74bfc6fed298d5ca0e3cb92bf008b715ea0c2f Author: John Baldwin AuthorDate: 2021-03-08 19:17:21 +0000 Commit: John Baldwin CommitDate: 2021-03-08 19:17:21 +0000 Add ObsoleteFiles.inc entries for various OCF headers removed in 13. MFC after: 3 days --- ObsoleteFiles.inc | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/ObsoleteFiles.inc b/ObsoleteFiles.inc index 8dd33475fe44..8f56ef29dad5 100644 --- a/ObsoleteFiles.inc +++ b/ObsoleteFiles.inc @@ -1237,11 +1237,19 @@ OLD_DIRS+=usr/lib/clang/10.0.0/lib/freebsd OLD_DIRS+=usr/lib/clang/10.0.0/lib OLD_DIRS+=usr/lib/clang/10.0.0 +# 20200520: xform_userland.h removed +OLD_FILES+=usr/include/crypto/xform_userland.h + # 20200515: libalias cuseeme protocol support retired OLD_LIBS+=lib/libalias_cuseeme.so OLD_FILES+=usr/lib/libalias_cuseeme.a OLD_FILES+=usr/lib/libalias_cuseeme_p.a +# 20200511: Remove deprecated crypto algorithms +OLD_FILES+=usr/include/crypto/cast.h +OLD_FILES+=usr/include/crypto/castsb.h +OLD_FILES+=usr/include/crypto/skipjack.h + # 20200511: Remove ubsec(4) OLD_FILES+=usr/share/man/man4/ubsec.4.gz @@ -1277,6 +1285,7 @@ OLD_FILES+=usr/share/man/man1/gdbserver.1.gz OLD_FILES+=usr/share/man/man1/kgdb.1.gz # 20200327: OCF refactoring +OLD_FILES+=usr/include/crypto/cryptosoft.h OLD_FILES+=usr/share/man/man9/crypto_find_driver.9.gz OLD_FILES+=usr/share/man/man9/crypto_register.9.gz OLD_FILES+=usr/share/man/man9/crypto_unregister.9.gz From owner-dev-commits-src-main@freebsd.org Mon Mar 8 20: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 5752A557568; Mon, 8 Mar 2021 20: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 4DvVg820wVz3jMJ; Mon, 8 Mar 2021 20: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 37CCA7A8D; Mon, 8 Mar 2021 20:43: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 128KhmgN093934; Mon, 8 Mar 2021 20:43:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 128KhmDL093933; Mon, 8 Mar 2021 20:43:48 GMT (envelope-from git) Date: Mon, 8 Mar 2021 20:43:48 GMT Message-Id: <202103082043.128KhmDL093933@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: 8cc15b0dfc2f - main - x86: tsc: deprioritize TSC on VirtualBox 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: 8cc15b0dfc2f3299662e78f18bd6127f83c14ab4 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, 08 Mar 2021 20:43:48 -0000 The branch main has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=8cc15b0dfc2f3299662e78f18bd6127f83c14ab4 commit 8cc15b0dfc2f3299662e78f18bd6127f83c14ab4 Author: Kyle Evans AuthorDate: 2021-03-08 20:20:10 +0000 Commit: Kyle Evans CommitDate: 2021-03-08 20:43:06 +0000 x86: tsc: deprioritize TSC on VirtualBox Misbehavior has been observed with TSC under VirtualBox, where threads doing small sleeps (~1 second) may miss their wake up and hang around in a sleep state indefinitely. Switching back to ACPI-fast decidedly fixes it, so stop using TSC on VirtualBox at least for the time being. This partially reverts 84eaf2ccc6aa, applying it only to VirtualBox and increasing the quality to 0. Negative qualities can never be chosen and cannot be chosen with the tunable recently added. If we do not have a timecounter with a higher quality than 0, then TSC does at least leave the system mostly usable. PR: 253087 Reviewed by: emaste, kib MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D29132 --- sys/x86/x86/tsc.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/sys/x86/x86/tsc.c b/sys/x86/x86/tsc.c index de0a1505c2f6..5ffbb64229e9 100644 --- a/sys/x86/x86/tsc.c +++ b/sys/x86/x86/tsc.c @@ -503,6 +503,14 @@ test_tsc(int adj_max_count) if ((!smp_tsc && !tsc_is_invariant)) return (-100); + /* + * Misbehavior of TSC under VirtualBox has been observed. In + * particular, threads doing small (~1 second) sleeps may miss their + * wakeup and hang around in sleep state, causing hangs on shutdown. + */ + if (vm_guest == VM_GUEST_VBOX) + return (0); + size = (mp_maxid + 1) * 3; data = malloc(sizeof(*data) * size * N, M_TEMP, M_WAITOK); adj = 0; From owner-dev-commits-src-main@freebsd.org Mon Mar 8 20:53:04 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 C38B9557E82; Mon, 8 Mar 2021 20:53:04 +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 4DvVsr5BLbz3jmR; Mon, 8 Mar 2021 20:53:04 +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 A4C887CA8; Mon, 8 Mar 2021 20:53: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 128Kr4Tk006931; Mon, 8 Mar 2021 20:53:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 128Kr4P0006930; Mon, 8 Mar 2021 20:53:04 GMT (envelope-from git) Date: Mon, 8 Mar 2021 20:53:04 GMT Message-Id: <202103082053.128Kr4P0006930@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: f2f8405cf6b5 - main - if_vtbe: Add missing includes to fix build 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: f2f8405cf6b50a9d91acc02073abf1062d9d34f4 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, 08 Mar 2021 20:53:04 -0000 The branch main has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=f2f8405cf6b50a9d91acc02073abf1062d9d34f4 commit f2f8405cf6b50a9d91acc02073abf1062d9d34f4 Author: Jessica Clarke AuthorDate: 2021-03-08 20:47:29 +0000 Commit: Jessica Clarke CommitDate: 2021-03-08 20:48:48 +0000 if_vtbe: Add missing includes to fix build PR: 254137 Reported by: Mina Galić MFC after: 3 days Fixes: f8bc74e2f4a5 ("tap: add support for virtio-net offloads") --- sys/dev/beri/virtio/network/if_vtbe.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sys/dev/beri/virtio/network/if_vtbe.c b/sys/dev/beri/virtio/network/if_vtbe.c index 69b40588a974..5959b621954b 100644 --- a/sys/dev/beri/virtio/network/if_vtbe.c +++ b/sys/dev/beri/virtio/network/if_vtbe.c @@ -70,6 +70,10 @@ __FBSDID("$FreeBSD$"); #include #include +#include +#include +#include + #include #include #include From owner-dev-commits-src-main@freebsd.org Mon Mar 8 21:28: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 A680D558D2F; Mon, 8 Mar 2021 21:28: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 4DvWg14HHJz3mnc; Mon, 8 Mar 2021 21:28:45 +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 8194E7DFD; Mon, 8 Mar 2021 21:28: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 128LSjB7047836; Mon, 8 Mar 2021 21:28:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 128LSjLj047835; Mon, 8 Mar 2021 21:28:45 GMT (envelope-from git) Date: Mon, 8 Mar 2021 21:28:45 GMT Message-Id: <202103082128.128LSjLj047835@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Alexander V. Chernikov" Subject: git: 7634919e15f1 - main - Fix 'in6_purgeaddr: err=65, destination address delete failed' message. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: melifaro X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 7634919e15f1147b6f26d55354be375bc9b198db 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, 08 Mar 2021 21:28:45 -0000 The branch main has been updated by melifaro: URL: https://cgit.FreeBSD.org/src/commit/?id=7634919e15f1147b6f26d55354be375bc9b198db commit 7634919e15f1147b6f26d55354be375bc9b198db Author: Alexander V. Chernikov AuthorDate: 2021-03-08 20:27:29 +0000 Commit: Alexander V. Chernikov CommitDate: 2021-03-08 21:28:35 +0000 Fix 'in6_purgeaddr: err=65, destination address delete failed' message. P2P ifa may require 2 routes: one is the loopback route, another is the "prefix" route towards its destination. Current code marks loopback routes existence with IFA_RTSELF and "prefix" p2p routes with IFA_ROUTE. For historic reasons, we fill in ifa_dstaddr for loopback interfaces. To avoid installing the same route twice, we preemptively set IFA_RTSELF when adding "prefix" route for loopback. However, the teardown part doesn't have this hack, so we try to remove the same route twice. Fix this by checking if ifa_dstaddr is different from the ifa_addr and moving this logic into a separate function. Reviewed By: kp Differential Revision: https://reviews.freebsd.org/D29121 MFC after: 3 days --- sys/netinet6/in6.c | 32 ++++++++++++++++++-------------- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/sys/netinet6/in6.c b/sys/netinet6/in6.c index 4665a21c28fd..02cb9df7da3a 100644 --- a/sys/netinet6/in6.c +++ b/sys/netinet6/in6.c @@ -1294,13 +1294,27 @@ in6_handle_dstaddr_rtrequest(int cmd, struct in6_ifaddr *ia) return (error); } +static bool +ifa_is_p2p(struct in6_ifaddr *ia) +{ + int plen; + + plen = in6_mask2len(&ia->ia_prefixmask.sin6_addr, NULL); /* XXX */ + + if ((plen == 128) && (ia->ia_dstaddr.sin6_family == AF_INET6) && + !IN6_ARE_ADDR_EQUAL(&ia->ia_addr.sin6_addr, &ia->ia_dstaddr.sin6_addr)) + return (true); + + return (false); +} + void in6_purgeaddr(struct ifaddr *ifa) { struct ifnet *ifp = ifa->ifa_ifp; struct in6_ifaddr *ia = (struct in6_ifaddr *) ifa; struct in6_multi_mship *imm; - int plen, error; + int error; if (ifa->ifa_carp) (*carp_detach_p)(ifa, false); @@ -1328,10 +1342,7 @@ in6_purgeaddr(struct ifaddr *ifa) free(imm, M_IP6MADDR); } /* Check if we need to remove p2p route */ - plen = in6_mask2len(&ia->ia_prefixmask.sin6_addr, NULL); /* XXX */ - if (ia->ia_dstaddr.sin6_family != AF_INET6) - plen = 0; - if ((ia->ia_flags & IFA_ROUTE) && plen == 128) { + if ((ia->ia_flags & IFA_ROUTE) && ifa_is_p2p(ia)) { error = in6_handle_dstaddr_rtrequest(RTM_DELETE, ia); if (error != 0) log(LOG_INFO, "%s: err=%d, destination address delete " @@ -1434,7 +1445,7 @@ static int in6_notify_ifa(struct ifnet *ifp, struct in6_ifaddr *ia, struct in6_aliasreq *ifra, int hostIsNew) { - int error = 0, plen, ifacount = 0; + int error = 0, ifacount = 0; struct ifaddr *ifa; struct sockaddr_in6 *pdst; char ip6buf[INET6_ADDRSTRLEN]; @@ -1487,14 +1498,7 @@ in6_notify_ifa(struct ifnet *ifp, struct in6_ifaddr *ia, * XXX: the logic below rejects assigning multiple addresses on a p2p * interface that share the same destination. */ - plen = in6_mask2len(&ia->ia_prefixmask.sin6_addr, NULL); /* XXX */ - if (!(ia->ia_flags & IFA_ROUTE) && plen == 128 && - ia->ia_dstaddr.sin6_family == AF_INET6) { - /* - * Handle the case for ::1 . - */ - if (ifp->if_flags & IFF_LOOPBACK) - ia->ia_flags |= IFA_RTSELF; + if (!(ia->ia_flags & IFA_ROUTE) && ifa_is_p2p(ia)) { error = in6_handle_dstaddr_rtrequest(RTM_ADD, ia); if (error) goto done; From owner-dev-commits-src-main@freebsd.org Mon Mar 8 23:01: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 B492255C9A5; Mon, 8 Mar 2021 23:01: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 4DvYkC4n9cz3vqq; Mon, 8 Mar 2021 23:01: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 9795E114FB; Mon, 8 Mar 2021 23:01: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 128N1dm6078407; Mon, 8 Mar 2021 23:01:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 128N1d79078406; Mon, 8 Mar 2021 23:01:39 GMT (envelope-from git) Date: Mon, 8 Mar 2021 23:01:39 GMT Message-Id: <202103082301.128N1d79078406@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: 88a55912032a - main - config_intrhook: Move from TAILQ to STAILQ and padding 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: 88a55912032a981bfdb62d340cab058188dd1dc2 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, 08 Mar 2021 23:01:39 -0000 The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=88a55912032a981bfdb62d340cab058188dd1dc2 commit 88a55912032a981bfdb62d340cab058188dd1dc2 Author: Warner Losh AuthorDate: 2021-03-08 21:41:37 +0000 Commit: Warner Losh CommitDate: 2021-03-08 22:59:00 +0000 config_intrhook: Move from TAILQ to STAILQ and padding config_intrhook doesn't need to be a two-pointer TAILQ. We rarely add/delete from this and so those need not be optimized. Instaed, use the one-pointer STAILQ plus a uintptr_t to be used as a flags word. This will allow these changes to be MFC'd to 12 and 13 to fix a race in removable devices. Feedback from: jhb Reviewed by: mav Differential Revision: https://reviews.freebsd.org/D29004 --- sys/kern/subr_autoconf.c | 22 +++++++++++----------- sys/sys/kernel.h | 3 ++- 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/sys/kern/subr_autoconf.c b/sys/kern/subr_autoconf.c index 6a998a533801..063396a8e139 100644 --- a/sys/kern/subr_autoconf.c +++ b/sys/kern/subr_autoconf.c @@ -56,8 +56,8 @@ __FBSDID("$FreeBSD$"); /* * "Interrupt driven config" functions. */ -static TAILQ_HEAD(, intr_config_hook) intr_config_hook_list = - TAILQ_HEAD_INITIALIZER(intr_config_hook_list); +static STAILQ_HEAD(, intr_config_hook) intr_config_hook_list = + STAILQ_HEAD_INITIALIZER(intr_config_hook_list); static struct intr_config_hook *next_to_notify; static struct mtx intr_config_hook_lock; MTX_SYSINIT(intr_config_hook, &intr_config_hook_lock, "intr config", MTX_DEF); @@ -101,7 +101,7 @@ run_interrupt_driven_config_hooks_warning(int warned) if (warned < 6) { printf("run_interrupt_driven_hooks: still waiting after %d " "seconds for", warned * WARNING_INTERVAL_SECS); - TAILQ_FOREACH(hook_entry, &intr_config_hook_list, ich_links) { + STAILQ_FOREACH(hook_entry, &intr_config_hook_list, ich_links) { if (linker_search_symbol_name( (caddr_t)hook_entry->ich_func, namebuf, sizeof(namebuf), &offset) == 0) @@ -137,7 +137,7 @@ run_interrupt_driven_config_hooks() while (next_to_notify != NULL) { hook_entry = next_to_notify; - next_to_notify = TAILQ_NEXT(hook_entry, ich_links); + next_to_notify = STAILQ_NEXT(hook_entry, ich_links); mtx_unlock(&intr_config_hook_lock); (*hook_entry->ich_func)(hook_entry->ich_arg); mtx_lock(&intr_config_hook_lock); @@ -158,7 +158,7 @@ boot_run_interrupt_driven_config_hooks(void *dummy) TSWAIT("config hooks"); mtx_lock(&intr_config_hook_lock); warned = 0; - while (!TAILQ_EMPTY(&intr_config_hook_list)) { + while (!STAILQ_EMPTY(&intr_config_hook_list)) { if (msleep(&intr_config_hook_list, &intr_config_hook_lock, 0, "conifhk", WARNING_INTERVAL_SECS * hz) == EWOULDBLOCK) { @@ -187,7 +187,7 @@ config_intrhook_establish(struct intr_config_hook *hook) TSHOLD("config hooks"); mtx_lock(&intr_config_hook_lock); - TAILQ_FOREACH(hook_entry, &intr_config_hook_list, ich_links) + STAILQ_FOREACH(hook_entry, &intr_config_hook_list, ich_links) if (hook_entry == hook) break; if (hook_entry != NULL) { @@ -196,7 +196,7 @@ config_intrhook_establish(struct intr_config_hook *hook) "already established hook.\n"); return (1); } - TAILQ_INSERT_TAIL(&intr_config_hook_list, hook, ich_links); + STAILQ_INSERT_TAIL(&intr_config_hook_list, hook, ich_links); if (next_to_notify == NULL) next_to_notify = hook; mtx_unlock(&intr_config_hook_lock); @@ -232,7 +232,7 @@ config_intrhook_disestablish(struct intr_config_hook *hook) struct intr_config_hook *hook_entry; mtx_lock(&intr_config_hook_lock); - TAILQ_FOREACH(hook_entry, &intr_config_hook_list, ich_links) + STAILQ_FOREACH(hook_entry, &intr_config_hook_list, ich_links) if (hook_entry == hook) break; if (hook_entry == NULL) @@ -240,8 +240,8 @@ config_intrhook_disestablish(struct intr_config_hook *hook) "unestablished hook"); if (next_to_notify == hook) - next_to_notify = TAILQ_NEXT(hook, ich_links); - TAILQ_REMOVE(&intr_config_hook_list, hook, ich_links); + next_to_notify = STAILQ_NEXT(hook, ich_links); + STAILQ_REMOVE(&intr_config_hook_list, hook, intr_config_hook, ich_links); TSRELEASE("config hooks"); /* Wakeup anyone watching the list */ @@ -258,7 +258,7 @@ DB_SHOW_COMMAND(conifhk, db_show_conifhk) char namebuf[64]; long offset; - TAILQ_FOREACH(hook_entry, &intr_config_hook_list, ich_links) { + STAILQ_FOREACH(hook_entry, &intr_config_hook_list, ich_links) { if (linker_ddb_search_symbol_name( (caddr_t)hook_entry->ich_func, namebuf, sizeof(namebuf), &offset) == 0) { diff --git a/sys/sys/kernel.h b/sys/sys/kernel.h index 181036c98a6a..89582ca5403d 100644 --- a/sys/sys/kernel.h +++ b/sys/sys/kernel.h @@ -466,7 +466,8 @@ struct tunable_str { typedef void (*ich_func_t)(void *_arg); struct intr_config_hook { - TAILQ_ENTRY(intr_config_hook) ich_links; + STAILQ_ENTRY(intr_config_hook) ich_links; + uintptr_t ich_padding; ich_func_t ich_func; void *ich_arg; }; From owner-dev-commits-src-main@freebsd.org Mon Mar 8 23:01: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 E0CCF55CC08; Mon, 8 Mar 2021 23:01: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 4DvYkD6571z3vtJ; Mon, 8 Mar 2021 23:01: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 C3D8E114FE; Mon, 8 Mar 2021 23:01: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 128N1eP0078427; Mon, 8 Mar 2021 23:01:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 128N1eQk078426; Mon, 8 Mar 2021 23:01:40 GMT (envelope-from git) Date: Mon, 8 Mar 2021 23:01:40 GMT Message-Id: <202103082301.128N1eQk078426@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: 6ffdaa5f2d4f - main - Move back the isa non-PNP driver deadline to FreeBSD 14. 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: 6ffdaa5f2d4f0881557f64dabf61fb57541e0fba 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, 08 Mar 2021 23:01:40 -0000 The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=6ffdaa5f2d4f0881557f64dabf61fb57541e0fba commit 6ffdaa5f2d4f0881557f64dabf61fb57541e0fba Author: Warner Losh AuthorDate: 2021-03-08 22:59:48 +0000 Commit: Warner Losh CommitDate: 2021-03-08 23:00:23 +0000 Move back the isa non-PNP driver deadline to FreeBSD 14. --- sys/isa/isa_common.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/isa/isa_common.c b/sys/isa/isa_common.c index 56fa0f2ba987..7bc66d552e31 100644 --- a/sys/isa/isa_common.c +++ b/sys/isa/isa_common.c @@ -576,7 +576,7 @@ isa_probe_children(device_t dev) strcmp(kern_ident, "GENERIC") == 0 && device_is_attached(child)) device_printf(child, - "non-PNP ISA device will be removed from GENERIC in FreeBSD 12.\n"); + "non-PNP ISA device will be removed from GENERIC in FreeBSD 14.\n"); } /* From owner-dev-commits-src-main@freebsd.org Mon Mar 8 23: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 6B03755D41C; Mon, 8 Mar 2021 23: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 4DvZJG2Znsz4RnZ; Mon, 8 Mar 2021 23: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 4B26611E9F; Mon, 8 Mar 2021 23: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 128NRguw006790; Mon, 8 Mar 2021 23: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 128NRg4J006789; Mon, 8 Mar 2021 23:27:42 GMT (envelope-from git) Date: Mon, 8 Mar 2021 23:27:42 GMT Message-Id: <202103082327.128NRg4J006789@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: 455219675dbd - main - Change mwait_bm_avoidance use to match Linux. 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: 455219675dbd61010e180cacdfed51e7e34111e1 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, 08 Mar 2021 23:27:42 -0000 The branch main has been updated by mav: URL: https://cgit.FreeBSD.org/src/commit/?id=455219675dbd61010e180cacdfed51e7e34111e1 commit 455219675dbd61010e180cacdfed51e7e34111e1 Author: Alexander Motin AuthorDate: 2021-03-08 22:57:46 +0000 Commit: Alexander Motin CommitDate: 2021-03-08 23:27:36 +0000 Change mwait_bm_avoidance use to match Linux. Even though the information is very limited, it seems the intent of this flag is to control ACPI_BITREG_BUS_MASTER_STATUS use for C3, not force ACPI_BITREG_ARB_DISABLE manipulations for C2, where it was never needed, and which register not really doing anything for years. It wasted lots of CPU time on congested global ACPI hardware lock when many CPU cores were trying to enter/exit deep C-states same time. On idle 80-core system it pushed ping localhost latency up to 20ms, since badport_bandlim() via counter_ratecheck() wakes up all CPUs same time once a second just to synchronously reset the counters. Now enabling C-states increases the latency from 0.1 to just 0.25ms. Discussed with: kib MFC after: 1 month --- sys/dev/acpica/acpi_cpu.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/sys/dev/acpica/acpi_cpu.c b/sys/dev/acpica/acpi_cpu.c index ce252ab92816..436dd9ddaa93 100644 --- a/sys/dev/acpica/acpi_cpu.c +++ b/sys/dev/acpica/acpi_cpu.c @@ -1153,17 +1153,19 @@ acpi_cpu_idle(sbintime_t sbt) * driver polling for new devices keeps this bit set all the * time if USB is loaded. */ + cx_next = &sc->cpu_cx_states[cx_next_idx]; if ((cpu_quirks & CPU_QUIRK_NO_BM_CTRL) == 0 && - cx_next_idx > sc->cpu_non_c3) { + cx_next_idx > sc->cpu_non_c3 && + (!cx_next->do_mwait || cx_next->mwait_bm_avoidance)) { status = AcpiReadBitRegister(ACPI_BITREG_BUS_MASTER_STATUS, &bm_active); if (ACPI_SUCCESS(status) && bm_active != 0) { AcpiWriteBitRegister(ACPI_BITREG_BUS_MASTER_STATUS, 1); cx_next_idx = sc->cpu_non_c3; + cx_next = &sc->cpu_cx_states[cx_next_idx]; } } /* Select the next state and update statistics. */ - cx_next = &sc->cpu_cx_states[cx_next_idx]; sc->cpu_cx_stats[cx_next_idx]++; KASSERT(cx_next->type != ACPI_STATE_C0, ("acpi_cpu_idle: C0 sleep")); @@ -1197,7 +1199,7 @@ acpi_cpu_idle(sbintime_t sbt) * For C3, disable bus master arbitration and enable bus master wake * if BM control is available, otherwise flush the CPU cache. */ - if (cx_next->type == ACPI_STATE_C3 || cx_next->mwait_bm_avoidance) { + if (cx_next->type == ACPI_STATE_C3) { if ((cpu_quirks & CPU_QUIRK_NO_BM_CTRL) == 0) { AcpiWriteBitRegister(ACPI_BITREG_ARB_DISABLE, 1); AcpiWriteBitRegister(ACPI_BITREG_BUS_MASTER_RLD, 1); @@ -1237,7 +1239,7 @@ acpi_cpu_idle(sbintime_t sbt) end_time = ((cpu_ticks() - cputicks) << 20) / cpu_tickrate(); /* Enable bus master arbitration and disable bus master wakeup. */ - if ((cx_next->type == ACPI_STATE_C3 || cx_next->mwait_bm_avoidance) && + if (cx_next->type == ACPI_STATE_C3 && (cpu_quirks & CPU_QUIRK_NO_BM_CTRL) == 0) { AcpiWriteBitRegister(ACPI_BITREG_ARB_DISABLE, 0); AcpiWriteBitRegister(ACPI_BITREG_BUS_MASTER_RLD, 0); From owner-dev-commits-src-main@freebsd.org Mon Mar 8 23:54: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 5F6A355E12A; Mon, 8 Mar 2021 23:54: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 4DvZvC2DzVz4T2Y; Mon, 8 Mar 2021 23:54: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 3B4D011FEA; Mon, 8 Mar 2021 23:54: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 128NsV3b044890; Mon, 8 Mar 2021 23:54:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 128NsVrA044889; Mon, 8 Mar 2021 23:54:31 GMT (envelope-from git) Date: Mon, 8 Mar 2021 23:54:31 GMT Message-Id: <202103082354.128NsVrA044889@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: 075e4807df3e - main - Do not read timer extra time when MWAIT is used. 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: 075e4807df3e6b0d9196d56e4dbc33765d57e1f8 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, 08 Mar 2021 23:54:31 -0000 The branch main has been updated by mav: URL: https://cgit.FreeBSD.org/src/commit/?id=075e4807df3e6b0d9196d56e4dbc33765d57e1f8 commit 075e4807df3e6b0d9196d56e4dbc33765d57e1f8 Author: Alexander Motin AuthorDate: 2021-03-08 23:43:47 +0000 Commit: Alexander Motin CommitDate: 2021-03-08 23:43:47 +0000 Do not read timer extra time when MWAIT is used. When we enter C2+ state via memory read, it may take chipset some time to stop CPU. Extra register read covers that time. But MWAIT makes CPU stop immediately, so we don't need to waste time after wakeup with interrupts still disabled, increasing latency. On my system it reduces ping localhost latency, waking up all CPUs once a second, from 277us to 242us. MFC after: 1 month --- sys/dev/acpica/acpi_cpu.c | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/sys/dev/acpica/acpi_cpu.c b/sys/dev/acpica/acpi_cpu.c index 436dd9ddaa93..56182ed743de 100644 --- a/sys/dev/acpica/acpi_cpu.c +++ b/sys/dev/acpica/acpi_cpu.c @@ -1220,18 +1220,19 @@ acpi_cpu_idle(sbintime_t sbt) start_time = 0; cputicks = cpu_ticks(); } - if (cx_next->do_mwait) + if (cx_next->do_mwait) { acpi_cpu_idle_mwait(cx_next->mwait_hint); - else + } else { CPU_GET_REG(cx_next->p_lvlx, 1); + /* + * Read the end time twice. Since it may take an arbitrary time + * to enter the idle state, the first read may be executed before + * the processor has stopped. Doing it again provides enough + * margin that we are certain to have a correct value. + */ + AcpiGetTimer(&end_time); + } - /* - * Read the end time twice. Since it may take an arbitrary time - * to enter the idle state, the first read may be executed before - * the processor has stopped. Doing it again provides enough - * margin that we are certain to have a correct value. - */ - AcpiGetTimer(&end_time); if (cx_next->type == ACPI_STATE_C3) { AcpiGetTimer(&end_time); AcpiGetTimerDuration(start_time, end_time, &end_time); From owner-dev-commits-src-main@freebsd.org Tue Mar 9 00:09: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 25E1355EFA0; Tue, 9 Mar 2021 00:09: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 4DvbDs0cMsz4V3s; Tue, 9 Mar 2021 00:09: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 F126D1270A; Tue, 9 Mar 2021 00:09: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 12909meX060202; Tue, 9 Mar 2021 00:09:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 12909mew060201; Tue, 9 Mar 2021 00:09:48 GMT (envelope-from git) Date: Tue, 9 Mar 2021 00:09:48 GMT Message-Id: <202103090009.12909mew060201@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: 09673fc0f36d - main - mountd(8): generate a syslog message when the "V4:" line is missing 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: 09673fc0f36dd1cca74940a240a9ed0f62228084 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, 09 Mar 2021 00:09:49 -0000 The branch main has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=09673fc0f36dd1cca74940a240a9ed0f62228084 commit 09673fc0f36dd1cca74940a240a9ed0f62228084 Author: Rick Macklem AuthorDate: 2021-03-09 00:08:02 +0000 Commit: Rick Macklem CommitDate: 2021-03-09 00:08:02 +0000 mountd(8): generate a syslog message when the "V4:" line is missing Daniel reported that NFSv4 mounts were not working despite having set "nfsv4_server_enable=YES" in /etc/rc.conf. Mountd was logging a message that there was no /etc/exports file. He noted that creating a /etc/exports file with a "V4:" line in it was needed make NFSv4 mounts work. At least one "V4:" line in one of the exports(5) file(s) is needed to make NFSv4 mounts work. This patch fixes mountd.c so that it logs a message indicting that there is no "V4:" line in any exports(5) file when NFSv4 mounts are enabled. To avoid this message being generated erroneously, /etc/rc.d/mountd is updated to make sure vfs.nfsd.server_max_nfsvers is properly set before mountd(8) is started. Reported by: debdrup PR: 253901 MFC after: 2 weeks --- libexec/rc/rc.d/mountd | 3 +++ usr.sbin/mountd/mountd.c | 18 +++++++++++++++++- 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/libexec/rc/rc.d/mountd b/libexec/rc/rc.d/mountd index 85d04c37a018..ba573ad732cc 100755 --- a/libexec/rc/rc.d/mountd +++ b/libexec/rc/rc.d/mountd @@ -34,6 +34,9 @@ mountd_precmd() rc_flags="${rc_flags} -R" else force_depend rpcbind || return 1 + if ! checkyesno nfsv4_server_enable; then + sysctl vfs.nfsd.server_max_nfsvers=3 > /dev/null + fi fi # mountd flags will differ depending on rc.conf settings diff --git a/usr.sbin/mountd/mountd.c b/usr.sbin/mountd/mountd.c index 76972c66a6ed..c66ac13b3016 100644 --- a/usr.sbin/mountd/mountd.c +++ b/usr.sbin/mountd/mountd.c @@ -1888,10 +1888,11 @@ get_exportlist(int passno) struct iovec *iov; struct statfs *mntbufp; char errmsg[255]; - int num, i; + int error, i, nfs_maxvers, num; int iovlen; struct nfsex_args eargs; FILE *debug_file; + size_t nfs_maxvers_size; if ((debug_file = fopen(_PATH_MOUNTDDEBUG, "r")) != NULL) { fclose(debug_file); @@ -2015,6 +2016,21 @@ get_exportlist(int passno) read_exportfile(0); } + if (strlen(v4root_dirpath) == 0) { + /* Check to see if a V4: line is needed. */ + nfs_maxvers_size = sizeof(nfs_maxvers); + error = sysctlbyname("vfs.nfsd.server_max_nfsvers", + &nfs_maxvers, &nfs_maxvers_size, NULL, 0); + if (error != 0 || nfs_maxvers < NFS_VER2 || nfs_maxvers > + NFS_VER4) { + syslog(LOG_ERR, "sysctlbyname(vfs.nfsd." + "server_max_nfsvers) failed, defaulting to NFSv3"); + nfs_maxvers = NFS_VER3; + } + if (nfs_maxvers == NFS_VER4) + syslog(LOG_ERR, "NFSv4 requires at least one V4: line"); + } + if (iov != NULL) { /* Free strings allocated by strdup() in getmntopts.c */ free(iov[0].iov_base); /* fstype */ From owner-dev-commits-src-main@freebsd.org Tue Mar 9 10:53:13 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 E176757551F; Tue, 9 Mar 2021 10:53:13 +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 4DvsWF62Rpz3mL7; Tue, 9 Mar 2021 10:53:13 +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 C1F5F1AE2F; Tue, 9 Mar 2021 10:53:13 +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 129ArDuP015073; Tue, 9 Mar 2021 10:53:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 129ArDuX015072; Tue, 9 Mar 2021 10:53:13 GMT (envelope-from git) Date: Tue, 9 Mar 2021 10:53:13 GMT Message-Id: <202103091053.129ArDuX015072@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: bae59285f932 - main - if_wg: return to m_defrag() of incoming mbuf, sans leak 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: bae59285f932d59ee9fd9d6a7c41d34ef8e51186 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, 09 Mar 2021 10:53:13 -0000 The branch main has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=bae59285f932d59ee9fd9d6a7c41d34ef8e51186 commit bae59285f932d59ee9fd9d6a7c41d34ef8e51186 Author: Kyle Evans AuthorDate: 2021-03-09 10:44:31 +0000 Commit: Kyle Evans CommitDate: 2021-03-09 10:52:22 +0000 if_wg: return to m_defrag() of incoming mbuf, sans leak This partially reverts df55485085 but still fixes the leak. It was overlooked (sigh) that some packets will exceed MHLEN and cannot be physically contiguous without clustering, but we don't actually need it to be. m_defrag() should pull up enough for any of the headers that we do need to be accessible. Fixes: df55485085 Pointy hat; kevans --- sys/dev/if_wg/module/if_wg_session.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/sys/dev/if_wg/module/if_wg_session.c b/sys/dev/if_wg/module/if_wg_session.c index e63367785ed3..ae9e44cffef5 100644 --- a/sys/dev/if_wg/module/if_wg_session.c +++ b/sys/dev/if_wg/module/if_wg_session.c @@ -1904,13 +1904,12 @@ wg_input(struct mbuf *m0, int offset, struct inpcb *inpcb, m_adj(m0, hlen); /* - * Ensure mbuf is contiguous over full length of the packet. This is - * done so that we can directly read the handshake values in - * wg_handshake, and so we can decrypt a transport packet by passing a - * a single buffer to noise_remote_decrypt() in wg_decap. + * Ensure mbuf has at least enough contiguous data to peel off our + * headers at the beginning. */ - if ((m = m_pullup(m0, m0->m_pkthdr.len)) == NULL) { + if ((m = m_defrag(m0, M_NOWAIT)) == NULL) { DPRINTF(sc, "DEFRAG fail\n"); + m_freem(m0); return; } data = mtod(m, void *); From owner-dev-commits-src-main@freebsd.org Tue Mar 9 11:17: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 1E5F2575D54; Tue, 9 Mar 2021 11:17: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 4Dvt3g0Fdkz3nSW; Tue, 9 Mar 2021 11:17: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 C660D1B40B; Tue, 9 Mar 2021 11:17: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 129BHO76042852; Tue, 9 Mar 2021 11:17:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 129BHOZa042851; Tue, 9 Mar 2021 11:17:24 GMT (envelope-from git) Date: Tue, 9 Mar 2021 11:17:24 GMT Message-Id: <202103091117.129BHOZa042851@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: 1ae20f7c70ea - main - kern: malloc: fix panic on M_WAITOK during THREAD_NO_SLEEPING() 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: 1ae20f7c70ea16fa8b702e409030e170df4f5c13 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, 09 Mar 2021 11:17:54 -0000 The branch main has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=1ae20f7c70ea16fa8b702e409030e170df4f5c13 commit 1ae20f7c70ea16fa8b702e409030e170df4f5c13 Author: Kyle Evans AuthorDate: 2021-03-08 06:16:27 +0000 Commit: Kyle Evans CommitDate: 2021-03-09 11:16:39 +0000 kern: malloc: fix panic on M_WAITOK during THREAD_NO_SLEEPING() Simple condition flip; we wanted to panic here after epoch_trace_list(). Reviewed by: glebius, markj MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D29125 --- sys/kern/kern_malloc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/kern/kern_malloc.c b/sys/kern/kern_malloc.c index 48383358e3ad..0d6f9dcfcab7 100644 --- a/sys/kern/kern_malloc.c +++ b/sys/kern/kern_malloc.c @@ -537,7 +537,7 @@ malloc_dbg(caddr_t *vap, size_t *sizep, struct malloc_type *mtp, #ifdef EPOCH_TRACE epoch_trace_list(curthread); #endif - KASSERT(1, + KASSERT(0, ("malloc(M_WAITOK) with sleeping prohibited")); } } From owner-dev-commits-src-main@freebsd.org Tue Mar 9 11:17: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 1F12B575E3D; Tue, 9 Mar 2021 11:17: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 4Dvt3c5rs3z3nmK; Tue, 9 Mar 2021 11:17: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 AE6F11B3FA; Tue, 9 Mar 2021 11:17: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 129BHNLY042830; Tue, 9 Mar 2021 11:17:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 129BHN0a042829; Tue, 9 Mar 2021 11:17:23 GMT (envelope-from git) Date: Tue, 9 Mar 2021 11:17:23 GMT Message-Id: <202103091117.129BHN0a042829@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: e80e371d79d8 - main - if_wg: avoid sleeping under the net epoch 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: e80e371d79d825712a9078e0d1a14b62567291c4 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, 09 Mar 2021 11:17:54 -0000 The branch main has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=e80e371d79d825712a9078e0d1a14b62567291c4 commit e80e371d79d825712a9078e0d1a14b62567291c4 Author: Kyle Evans AuthorDate: 2021-03-08 06:06:28 +0000 Commit: Kyle Evans CommitDate: 2021-03-09 11:16:30 +0000 if_wg: avoid sleeping under the net epoch No sleeping allowed here, so avoid it. Collect the subset of data we want inside of the epoch, as we'll need extra allocations when we add items to the nvlist. Reviewed by: grehan (earlier version), markj MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D29124 --- sys/dev/if_wg/module/module.c | 136 ++++++++++++++++++++++++++++++------------ 1 file changed, 99 insertions(+), 37 deletions(-) diff --git a/sys/dev/if_wg/module/module.c b/sys/dev/if_wg/module/module.c index a40a304616c7..6ae3bf9db022 100644 --- a/sys/dev/if_wg/module/module.c +++ b/sys/dev/if_wg/module/module.c @@ -69,6 +69,14 @@ MALLOC_DEFINE(M_WG, "WG", "wireguard"); TASKQGROUP_DECLARE(if_io_tqg); +struct wg_peer_export { + struct sockaddr_storage endpoint; + uint8_t public_key[WG_KEY_SIZE]; + size_t endpoint_sz; + struct wg_allowedip *aip; + int aip_count; +}; + static int clone_count; uma_zone_t ratelimit_zone; @@ -386,37 +394,70 @@ wg_stop(if_ctx_t ctx) wg_socket_reinit(sc, NULL, NULL); } -static nvlist_t * -wg_peer_to_nvl(struct wg_peer *peer) +static int +wg_peer_to_export(struct wg_peer *peer, struct wg_peer_export *exp) { - struct wg_route *rt; - int i, count; - nvlist_t *nvl; - caddr_t key; - size_t sa_sz; - struct wg_allowedip *aip; struct wg_endpoint *ep; + struct wg_route *rt; + int i; - if ((nvl = nvlist_create(0)) == NULL) - return (NULL); - key = peer->p_remote.r_public; - nvlist_add_binary(nvl, "public-key", key, WG_KEY_SIZE); + /* Non-sleepable context. */ + NET_EPOCH_ASSERT(); + + bzero(&exp->endpoint, sizeof(exp->endpoint)); ep = &peer->p_endpoint; if (ep->e_remote.r_sa.sa_family != 0) { - sa_sz = (ep->e_remote.r_sa.sa_family == AF_INET) ? - sizeof(struct sockaddr_in) : sizeof(struct sockaddr_in6); - nvlist_add_binary(nvl, "endpoint", &ep->e_remote, sa_sz); + exp->endpoint_sz = (ep->e_remote.r_sa.sa_family == AF_INET) ? + sizeof(struct sockaddr_in) : sizeof(struct sockaddr_in6); + + memcpy(&exp->endpoint, &ep->e_remote, exp->endpoint_sz); } - i = count = 0; + + memcpy(exp->public_key, peer->p_remote.r_public, + sizeof(exp->public_key)); + + exp->aip_count = 0; CK_LIST_FOREACH(rt, &peer->p_routes, r_entry) { - count++; + exp->aip_count++; } - aip = malloc(count*sizeof(*aip), M_TEMP, M_WAITOK); + + /* Early success; no allowed-ips to copy out. */ + if (exp->aip_count == 0) + return (0); + + exp->aip = malloc(exp->aip_count * sizeof(*exp->aip), M_TEMP, M_NOWAIT); + if (exp->aip == NULL) + return (ENOMEM); + + i = 0; CK_LIST_FOREACH(rt, &peer->p_routes, r_entry) { - memcpy(&aip[i++], &rt->r_cidr, sizeof(*aip)); + memcpy(&exp->aip[i++], &rt->r_cidr, sizeof(*exp->aip)); + if (i == exp->aip_count) + break; } - nvlist_add_binary(nvl, "allowed-ips", aip, count*sizeof(*aip)); - free(aip, M_TEMP); + + /* Again, AllowedIPs might have shrank; update it. */ + exp->aip_count = i; + + return (0); +} + +static nvlist_t * +wg_peer_export_to_nvl(struct wg_peer_export *exp) +{ + nvlist_t *nvl; + + if ((nvl = nvlist_create(0)) == NULL) + return (NULL); + + nvlist_add_binary(nvl, "public-key", exp->public_key, WG_KEY_SIZE); + if (exp->endpoint_sz != 0) + nvlist_add_binary(nvl, "endpoint", &exp->endpoint, + exp->endpoint_sz); + + nvlist_add_binary(nvl, "allowed-ips", exp->aip, + exp->aip_count * sizeof(*exp->aip)); + return (nvl); } @@ -427,10 +468,8 @@ wg_marshal_peers(struct wg_softc *sc, nvlist_t **nvlp, nvlist_t ***nvl_arrayp, i int err, i, peer_count; nvlist_t *nvl, **nvl_array; struct epoch_tracker et; -#ifdef INVARIANTS - void *packed; - size_t size; -#endif + struct wg_peer_export *wpe; + nvl = NULL; nvl_array = NULL; if (nvl_arrayp) @@ -447,34 +486,44 @@ wg_marshal_peers(struct wg_softc *sc, nvlist_t **nvlp, nvlist_t ***nvl_arrayp, i if (nvlp && (nvl = nvlist_create(0)) == NULL) return (ENOMEM); + err = i = 0; nvl_array = malloc(peer_count*sizeof(void*), M_TEMP, M_WAITOK); + wpe = malloc(peer_count*sizeof(*wpe), M_TEMP, M_WAITOK | M_ZERO); + NET_EPOCH_ENTER(et); CK_LIST_FOREACH(peer, &sc->sc_hashtable.h_peers_list, p_entry) { - nvl_array[i] = wg_peer_to_nvl(peer); - if (nvl_array[i] == NULL) { - printf("wg_peer_to_nvl failed on %d peer\n", i); + if ((err = wg_peer_to_export(peer, &wpe[i])) != 0) { + printf("wg_peer_to_export failed on %d peer, error %d\n", + i, err); break; } -#ifdef INVARIANTS - packed = nvlist_pack(nvl_array[i], &size); - if (packed == NULL) { - printf("nvlist_pack(%p, %p) => %d", - nvl_array[i], &size, nvlist_error(nvl)); - } - free(packed, M_NVLIST); -#endif + i++; if (i == peer_count) break; } NET_EPOCH_EXIT(et); + + if (err != 0) + goto out; + + /* Update the peer count, in case we found fewer entries. */ *peer_countp = peer_count = i; if (peer_count == 0) { printf("no peers found in list\n"); err = ENOENT; goto out; } + + for (i = 0; i < peer_count; i++) { + nvl_array[i] = wg_peer_export_to_nvl(&wpe[i]); + if (nvl_array[i] == NULL) { + printf("wg_peer_export_to_nvl failed on %d peer\n", i); + break; + } + } + if (nvl) { nvlist_add_nvlist_array(nvl, "peer-list", (const nvlist_t * const *)nvl_array, peer_count); @@ -486,8 +535,21 @@ wg_marshal_peers(struct wg_softc *sc, nvlist_t **nvlp, nvlist_t ***nvl_arrayp, i *nvlp = nvl; } *nvl_arrayp = nvl_array; - return (0); + err = 0; out: + if (err != 0) { + for (i = 0; i < peer_count; i++) { + nvlist_destroy(nvl_array[i]); + } + + free(nvl_array, M_TEMP); + if (nvl != NULL) + nvlist_destroy(nvl); + } + + for (i = 0; i < peer_count; i++) + free(wpe[i].aip, M_TEMP); + free(wpe, M_TEMP); return (err); } From owner-dev-commits-src-main@freebsd.org Tue Mar 9 11:17: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 1E4DD575C69; Tue, 9 Mar 2021 11:17: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 4Dvt3g3LQFz3nhH; Tue, 9 Mar 2021 11:17: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 D734C1ADE4; Tue, 9 Mar 2021 11:17: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 129BHPp1042871; Tue, 9 Mar 2021 11:17:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 129BHPSv042870; Tue, 9 Mar 2021 11:17:25 GMT (envelope-from git) Date: Tue, 9 Mar 2021 11:17:25 GMT Message-Id: <202103091117.129BHPSv042870@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: 172a8241c9c9 - main - ifconfig: wg: stop requiring peer endpoints 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: 172a8241c9c9a7273a78ad73a32501d3a01afd28 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, 09 Mar 2021 11:17:54 -0000 The branch main has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=172a8241c9c9a7273a78ad73a32501d3a01afd28 commit 172a8241c9c9a7273a78ad73a32501d3a01afd28 Author: Kyle Evans AuthorDate: 2021-03-08 01:04:24 +0000 Commit: Kyle Evans CommitDate: 2021-03-09 11:16:42 +0000 ifconfig: wg: stop requiring peer endpoints The way that wireguard is designed does not actually require all peers to have endpoints. In an architecture that might mimic a traditional VPN server <-> client, the wg interface on a server would have a number of peers without set endpoints -- the expectation is that the "clients" will connect to the "server" peer, which will authenticate the connection as a known peer and learn the endpoint from there. MFC after: 3 days Discussed with: decke, grehan (independently) --- sbin/ifconfig/ifwg.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/sbin/ifconfig/ifwg.c b/sbin/ifconfig/ifwg.c index a2b22d2dfbef..105ee7ac31d1 100644 --- a/sbin/ifconfig/ifwg.c +++ b/sbin/ifconfig/ifwg.c @@ -400,8 +400,6 @@ peerfinish(int s, void *arg) errx(1, "failed to allocate nvl_array"); if (!nvlist_exists_binary(nvl_params, "public-key")) errx(1, "must specify a public-key for adding peer"); - if (!nvlist_exists_binary(nvl_params, "endpoint")) - errx(1, "must specify an endpoint for adding peer"); if (allowed_ips_count == 0) errx(1, "must specify at least one range of allowed-ips to add a peer"); From owner-dev-commits-src-main@freebsd.org Tue Mar 9 11:17: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 A42C2575D5A; Tue, 9 Mar 2021 11:17: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 4Dvt3g6SJSz3nhJ; Tue, 9 Mar 2021 11:17: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 EE69C1B3FB; Tue, 9 Mar 2021 11:17: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 129BHQuM042889; Tue, 9 Mar 2021 11:17:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 129BHQJi042888; Tue, 9 Mar 2021 11:17:26 GMT (envelope-from git) Date: Tue, 9 Mar 2021 11:17:26 GMT Message-Id: <202103091117.129BHQJi042888@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: b3dac3913dc9 - main - ifconfig: allow displaying/setting persistent-keepalive 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: b3dac3913dc90fbc6f909ee5c4a876097cd90791 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, 09 Mar 2021 11:17:54 -0000 The branch main has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=b3dac3913dc90fbc6f909ee5c4a876097cd90791 commit b3dac3913dc90fbc6f909ee5c4a876097cd90791 Author: Kyle Evans AuthorDate: 2021-03-08 01:00:58 +0000 Commit: Kyle Evans CommitDate: 2021-03-09 11:16:42 +0000 ifconfig: allow displaying/setting persistent-keepalive The kernel-side already accepted a persistent-keepalive-interval, so just add a verb to ifconfig(8) for it and start exporting it so that ifconfig(8) can view it. PR: 253790 MFC after: 3 days Discussed with: decke --- sbin/ifconfig/ifwg.c | 28 +++++++++++++++++++++++++++- sys/dev/if_wg/module/module.c | 8 ++++++++ 2 files changed, 35 insertions(+), 1 deletion(-) diff --git a/sbin/ifconfig/ifwg.c b/sbin/ifconfig/ifwg.c index 105ee7ac31d1..86bacc59f50d 100644 --- a/sbin/ifconfig/ifwg.c +++ b/sbin/ifconfig/ifwg.c @@ -280,6 +280,7 @@ dump_peer(const nvlist_t *nvl_peer) char addr_buf[INET6_ADDRSTRLEN]; size_t size; int count, port; + uint16_t persistent_keepalive; printf("[Peer]\n"); if (nvlist_exists_binary(nvl_peer, "public-key")) { @@ -292,7 +293,11 @@ dump_peer(const nvlist_t *nvl_peer) sa_ntop(endpoint, addr_buf, &port); printf("Endpoint = %s:%d\n", addr_buf, ntohs(port)); } - + if (nvlist_exists_number(nvl_peer, "persistent-keepalive-interval")) { + persistent_keepalive = nvlist_get_number(nvl_peer, + "persistent-keepalive-interval"); + printf("PersistentKeepalive = %d\n", persistent_keepalive); + } if (!nvlist_exists_binary(nvl_peer, "allowed-ips")) return; aips = nvlist_get_binary(nvl_peer, "allowed-ips", &size); @@ -475,6 +480,26 @@ DECL_CMD_FUNC(setwgpubkey, val, d) nvlist_add_binary(nvl_params, "public-key", key, WG_KEY_LEN); } +static +DECL_CMD_FUNC(setwgpersistentkeepalive, val, d) +{ + unsigned long persistent_keepalive; + char *endp; + + if (!do_peer) + errx(1, "setting persistent keepalive only valid when adding peer"); + + errno = 0; + persistent_keepalive = strtoul(val, &endp, 0); + if (errno != 0 || *endp != '\0') + errx(1, "persistent-keepalive must be numeric (seconds)"); + if (persistent_keepalive > USHRT_MAX) + errx(1, "persistent-keepalive '%lu' too large", + persistent_keepalive); + nvlist_add_number(nvl_params, "persistent-keepalive-interval", + persistent_keepalive); +} + static DECL_CMD_FUNC(setallowedips, val, d) { @@ -563,6 +588,7 @@ static struct cmd wireguard_cmds[] = { DEF_CMD("peer-list", 0, peerlist), DEF_CMD("peer", 0, peerstart), DEF_CMD_ARG("public-key", setwgpubkey), + DEF_CMD_ARG("persistent-keepalive", setwgpersistentkeepalive), DEF_CMD_ARG("allowed-ips", setallowedips), DEF_CMD_ARG("endpoint", setendpoint), }; diff --git a/sys/dev/if_wg/module/module.c b/sys/dev/if_wg/module/module.c index 6ae3bf9db022..ad2f17c1e803 100644 --- a/sys/dev/if_wg/module/module.c +++ b/sys/dev/if_wg/module/module.c @@ -75,6 +75,7 @@ struct wg_peer_export { size_t endpoint_sz; struct wg_allowedip *aip; int aip_count; + uint16_t persistent_keepalive; }; static int clone_count; @@ -416,6 +417,9 @@ wg_peer_to_export(struct wg_peer *peer, struct wg_peer_export *exp) memcpy(exp->public_key, peer->p_remote.r_public, sizeof(exp->public_key)); + exp->persistent_keepalive = + peer->p_timers.t_persistent_keepalive_interval; + exp->aip_count = 0; CK_LIST_FOREACH(rt, &peer->p_routes, r_entry) { exp->aip_count++; @@ -458,6 +462,10 @@ wg_peer_export_to_nvl(struct wg_peer_export *exp) nvlist_add_binary(nvl, "allowed-ips", exp->aip, exp->aip_count * sizeof(*exp->aip)); + if (exp->persistent_keepalive != 0) + nvlist_add_number(nvl, "persistent-keepalive-interval", + exp->persistent_keepalive); + return (nvl); } From owner-dev-commits-src-main@freebsd.org Tue Mar 9 13:28: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 8A69455204A; Tue, 9 Mar 2021 13:28: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 4DvwyL3Yp4z4QqW; Tue, 9 Mar 2021 13:28: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 628F01CB2F; Tue, 9 Mar 2021 13:28: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 129DSQx5015072; Tue, 9 Mar 2021 13:28:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 129DSQD5015071; Tue, 9 Mar 2021 13:28:26 GMT (envelope-from git) Date: Tue, 9 Mar 2021 13:28:26 GMT Message-Id: <202103091328.129DSQD5015071@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Baptiste Daroussin Subject: git: f61831d2e8bd - main - Revert "rc: implement parallel boot" MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bapt X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f61831d2e8bd44b6568b00d538e738c25190bb96 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, 09 Mar 2021 13:28:26 -0000 The branch main has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=f61831d2e8bd44b6568b00d538e738c25190bb96 commit f61831d2e8bd44b6568b00d538e738c25190bb96 Author: Baptiste Daroussin AuthorDate: 2021-03-09 13:25:32 +0000 Commit: Baptiste Daroussin CommitDate: 2021-03-09 13:26:07 +0000 Revert "rc: implement parallel boot" This is not ready yet for prime time This reverts commit 763db58932874bb47fc6f9322ab81cc947f80991. This reverts commit f1ab799927c8e93e8f58e5039f287a2ca45675ec. This reverts commit 6e822e99570fdf4c564be04840a054bccc070222. This reverts commit 77e1ccbee3ed6c837929e4e232fd07f95bfc8294. --- libexec/rc/rc | 51 +++++++++++++++------------------------------------ 1 file changed, 15 insertions(+), 36 deletions(-) diff --git a/libexec/rc/rc b/libexec/rc/rc index 2cb840e68919..35db4a850516 100644 --- a/libexec/rc/rc +++ b/libexec/rc/rc @@ -91,36 +91,22 @@ if ! [ -e ${firstboot_sentinel} ]; then skip_firstboot="-s firstboot" fi -# rc_parallel_start default is "NO" -rc_parallel_start=${rc_parallel_start:-NO} -_rc_parallel='' -# enable rcorder -p if /etc/rc.conf rc_parallel_start is "YES" -checkyesno rc_parallel_start && _rc_parallel='-p' - # Do a first pass to get everything up to $early_late_divider so that # we can do a second pass that includes $local_startup directories # -files=`rcorder ${skip} ${skip_firstboot} ${_rc_parallel} /etc/rc.d/* 2>/dev/null` +files=`rcorder ${skip} ${skip_firstboot} /etc/rc.d/* 2>/dev/null` _rc_elem_done=' ' -oldifs="$IFS" -IFS=$'\n' -for _rc_group in ${files}; do - IFS="$oldifs" - for _rc_elem in ${_rc_group}; do - run_rc_script ${_rc_elem} ${_boot} & - _rc_elem_done="${_rc_elem_done}${_rc_elem} " - - case "$_rc_elem" in - */${early_late_divider}) break ;; - esac - done - wait - IFS=$'\n' +for _rc_elem in ${files}; do + run_rc_script ${_rc_elem} ${_boot} + _rc_elem_done="${_rc_elem_done}${_rc_elem} " + + case "$_rc_elem" in + */${early_late_divider}) break ;; + esac done unset files local_rc -IFS="$oldifs" # Now that disks are mounted, for each dir in $local_startup # search for init scripts that use the new rc.d semantics. @@ -136,21 +122,14 @@ if [ -e ${firstboot_sentinel} ]; then skip_firstboot="" fi -files=`rcorder ${skip} ${skip_firstboot} /etc/rc.d/* ${local_rc} ${_rc_parallel} 2>/dev/null` -IFS=$'\n' -for _rc_group in ${files}; do - IFS="$oldifs" - for _rc_elem in ${_rc_group}; do - case "$_rc_elem_done" in - *" $_rc_elem "*) continue ;; - esac - - run_rc_script ${_rc_elem} ${_boot} & - done - wait - IFS=$'\n' +files=`rcorder ${skip} ${skip_firstboot} /etc/rc.d/* ${local_rc} 2>/dev/null` +for _rc_elem in ${files}; do + case "$_rc_elem_done" in + *" $_rc_elem "*) continue ;; + esac + + run_rc_script ${_rc_elem} ${_boot} done -IFS="$oldifs" # Remove the firstboot sentinel, and reboot if it was requested. # Be a bit paranoid about removing it to handle the common failure From owner-dev-commits-src-main@freebsd.org Tue Mar 9 15:38: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 B38BE556D50; Tue, 9 Mar 2021 15:38:15 +0000 (UTC) (envelope-from lwhsu@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 4Dvzr74jnrz4bK9; Tue, 9 Mar 2021 15:38:15 +0000 (UTC) (envelope-from lwhsu@freebsd.org) Received: from mail-yb1-f179.google.com (mail-yb1-f179.google.com [209.85.219.179]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) (Authenticated sender: lwhsu/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 8F789267BA; Tue, 9 Mar 2021 15:38:15 +0000 (UTC) (envelope-from lwhsu@freebsd.org) Received: by mail-yb1-f179.google.com with SMTP id x19so14432697ybe.0; Tue, 09 Mar 2021 07:38:15 -0800 (PST) X-Gm-Message-State: AOAM530i2hq8qKlbeGoEmwr6XIxPFMYbkfyMivddZsj7xHKReEDldFwV rPt7Cy60HzQq/ridKrxJlzsOYtP+kY6od9Ys0W8= X-Google-Smtp-Source: ABdhPJyvf5kmkM07ai8Ev3IKgTVmkk9kcZHRmPbYFPLeY9QKzM1RL8d84Ix+VyjO3CgnJvv5WQY9El+jk4Xsu8sZh9E= X-Received: by 2002:a25:34d5:: with SMTP id b204mr40863558yba.497.1615304295053; Tue, 09 Mar 2021 07:38:15 -0800 (PST) MIME-Version: 1.0 References: <202103091117.129BHOZa042851@gitrepo.freebsd.org> In-Reply-To: <202103091117.129BHOZa042851@gitrepo.freebsd.org> From: Li-Wen Hsu Date: Tue, 9 Mar 2021 23:38:04 +0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: git: 1ae20f7c70ea - main - kern: malloc: fix panic on M_WAITOK during THREAD_NO_SLEEPING() To: Kyle Evans Cc: src-committers , dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Content-Type: text/plain; charset="UTF-8" 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, 09 Mar 2021 15:38:15 -0000 On Tue, Mar 9, 2021 at 7:18 PM Kyle Evans wrote: > > The branch main has been updated by kevans: > > URL: https://cgit.FreeBSD.org/src/commit/?id=1ae20f7c70ea16fa8b702e409030e170df4f5c13 > > commit 1ae20f7c70ea16fa8b702e409030e170df4f5c13 > Author: Kyle Evans > AuthorDate: 2021-03-08 06:16:27 +0000 > Commit: Kyle Evans > CommitDate: 2021-03-09 11:16:39 +0000 > > kern: malloc: fix panic on M_WAITOK during THREAD_NO_SLEEPING() > > Simple condition flip; we wanted to panic here after epoch_trace_list(). > > Reviewed by: glebius, markj > MFC after: 3 days > Differential Revision: https://reviews.freebsd.org/D29125 > --- > sys/kern/kern_malloc.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/sys/kern/kern_malloc.c b/sys/kern/kern_malloc.c > index 48383358e3ad..0d6f9dcfcab7 100644 > --- a/sys/kern/kern_malloc.c > +++ b/sys/kern/kern_malloc.c > @@ -537,7 +537,7 @@ malloc_dbg(caddr_t *vap, size_t *sizep, struct malloc_type *mtp, > #ifdef EPOCH_TRACE > epoch_trace_list(curthread); > #endif > - KASSERT(1, > + KASSERT(0, > ("malloc(M_WAITOK) with sleeping prohibited")); > } > } I guess this reveals a bug in gmirror? Now the test case sys/geom/class/mirror/8_test:main panics: https://ci.freebsd.org/job/FreeBSD-main-amd64-test/17779/console https://ci.freebsd.org/job/FreeBSD-main-i386-test/11831/console Li-Wen From owner-dev-commits-src-main@freebsd.org Tue Mar 9 16:43: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 744AC568CC1; Tue, 9 Mar 2021 16:43: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 4Dw1HP2rfwz4fxw; Tue, 9 Mar 2021 16:43: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 54BB11F7BA; Tue, 9 Mar 2021 16:43: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 129GhTkf077302; Tue, 9 Mar 2021 16:43:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 129GhTSj077301; Tue, 9 Mar 2021 16:43:29 GMT (envelope-from git) Date: Tue, 9 Mar 2021 16:43:29 GMT Message-Id: <202103091643.129GhTSj077301@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Leandro Lupori Subject: git: 043577b721ec - main - ofwfb: fix boot on LE MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: luporl X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 043577b721ec4e5c2ab7571e6c05cfd54e49473c 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, 09 Mar 2021 16:43:29 -0000 The branch main has been updated by luporl: URL: https://cgit.FreeBSD.org/src/commit/?id=043577b721ec4e5c2ab7571e6c05cfd54e49473c commit 043577b721ec4e5c2ab7571e6c05cfd54e49473c Author: Leandro Lupori AuthorDate: 2021-03-09 15:11:58 +0000 Commit: Leandro Lupori CommitDate: 2021-03-09 16:29:24 +0000 ofwfb: fix boot on LE Some framebuffer properties obtained from the device tree were not being properly converted to host endian. Replace OF_getprop calls by OF_getencprop where needed to fix this. This fixes boot on PowerPC64 LE, when using ofwfb as the system console. Reviewed by: bdragon Sponsored by: Eldorado Research Institute (eldorado.org.br) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D27475 --- sys/dev/vt/hw/ofwfb/ofwfb.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/sys/dev/vt/hw/ofwfb/ofwfb.c b/sys/dev/vt/hw/ofwfb/ofwfb.c index 8a1b7b3688a7..9dc674c0ebf9 100644 --- a/sys/dev/vt/hw/ofwfb/ofwfb.c +++ b/sys/dev/vt/hw/ofwfb/ofwfb.c @@ -108,7 +108,7 @@ ofwfb_probe(struct vt_device *vd) return (CN_DEAD); node = -1; - if (OF_getprop(chosen, "stdout", &stdout, sizeof(stdout)) == + if (OF_getencprop(chosen, "stdout", &stdout, sizeof(stdout)) == sizeof(stdout)) node = OF_instance_to_package(stdout); if (node == -1) @@ -386,7 +386,7 @@ ofwfb_init(struct vt_device *vd) char buf[64]; phandle_t chosen; phandle_t node; - uint32_t depth, height, width, stride; + pcell_t depth, height, width, stride; uint32_t vendor_id = 0; cell_t adr[2]; uint64_t user_phys; @@ -399,7 +399,7 @@ ofwfb_init(struct vt_device *vd) node = -1; chosen = OF_finddevice("/chosen"); - if (OF_getprop(chosen, "stdout", &sc->sc_handle, + if (OF_getencprop(chosen, "stdout", &sc->sc_handle, sizeof(ihandle_t)) == sizeof(ihandle_t)) node = OF_instance_to_package(sc->sc_handle); if (node == -1) @@ -448,14 +448,14 @@ ofwfb_init(struct vt_device *vd) return (CN_DEAD); /* Only support 8 and 32-bit framebuffers */ - OF_getprop(node, "depth", &depth, sizeof(depth)); + OF_getencprop(node, "depth", &depth, sizeof(depth)); if (depth != 8 && depth != 32) return (CN_DEAD); sc->fb.fb_bpp = sc->fb.fb_depth = depth; - OF_getprop(node, "height", &height, sizeof(height)); - OF_getprop(node, "width", &width, sizeof(width)); - if (OF_getprop(node, "linebytes", &stride, sizeof(stride)) != + OF_getencprop(node, "height", &height, sizeof(height)); + OF_getencprop(node, "width", &width, sizeof(width)); + if (OF_getencprop(node, "linebytes", &stride, sizeof(stride)) != sizeof(stride)) stride = width*depth/8; @@ -537,11 +537,11 @@ ofwfb_init(struct vt_device *vd) * may be the child of the PCI device: in that case, try the * parent for the assigned-addresses property. */ - len = OF_getprop(node, "assigned-addresses", pciaddrs, - sizeof(pciaddrs)); + len = OF_getencprop(node, "assigned-addresses", + (pcell_t *)pciaddrs, sizeof(pciaddrs)); if (len == -1) { - len = OF_getprop(OF_parent(node), "assigned-addresses", - pciaddrs, sizeof(pciaddrs)); + len = OF_getencprop(OF_parent(node), "assigned-addresses", + (pcell_t *)pciaddrs, sizeof(pciaddrs)); } if (len == -1) len = 0; From owner-dev-commits-src-main@freebsd.org Tue Mar 9 17:33: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 A47C956AF89; Tue, 9 Mar 2021 17:33: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 4Dw2P84G2Rz4kT5; Tue, 9 Mar 2021 17:33: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 848E11FED6; Tue, 9 Mar 2021 17:33: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 129HXWWk043251; Tue, 9 Mar 2021 17:33:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 129HXWVF043250; Tue, 9 Mar 2021 17:33:32 GMT (envelope-from git) Date: Tue, 9 Mar 2021 17:33:32 GMT Message-Id: <202103091733.129HXWVF043250@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Jason A. Harmening" Subject: git: e4b8deb22227 - main - amd64 pmap: convert to counter(9), add PV and pagetable page counts MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jah X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e4b8deb222278b2a12c9c67021b406625f5be301 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, 09 Mar 2021 17:33:32 -0000 The branch main has been updated by jah: URL: https://cgit.FreeBSD.org/src/commit/?id=e4b8deb222278b2a12c9c67021b406625f5be301 commit e4b8deb222278b2a12c9c67021b406625f5be301 Author: Jason A. Harmening AuthorDate: 2021-02-25 05:08:42 +0000 Commit: Jason A. Harmening CommitDate: 2021-03-09 17:27:10 +0000 amd64 pmap: convert to counter(9), add PV and pagetable page counts This change converts most of the counters in the amd64 pmap from global atomics to scalable counter(9) counters. Per discussion with kib@, it also removes the handrolled per-CPU PCID save count as it isn't considered generally useful. The bulk of these counters remain guarded by PV_STATS, as it seems unlikely that they will be useful outside of very specific debugging scenarios. However, this change does add two new counters that are available without PV_STATS. pt_page_count and pv_page_count track the number of active physical-to-virtual list pages and page table pages, respectively. These will be useful in evaluating the memory footprint of pmap structures under various workloads, which will help to guide future changes in this area. Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D28923 --- sys/amd64/amd64/genassym.c | 1 - sys/amd64/amd64/pmap.c | 274 +++++++++++++++++++++++++-------------------- sys/amd64/include/pcpu.h | 3 +- 3 files changed, 155 insertions(+), 123 deletions(-) diff --git a/sys/amd64/amd64/genassym.c b/sys/amd64/amd64/genassym.c index f89c53e75508..7c29368828d0 100644 --- a/sys/amd64/amd64/genassym.c +++ b/sys/amd64/amd64/genassym.c @@ -227,7 +227,6 @@ ASSYM(PC_GS32P, offsetof(struct pcpu, pc_gs32p)); ASSYM(PC_LDT, offsetof(struct pcpu, pc_ldt)); ASSYM(PC_COMMONTSS, offsetof(struct pcpu, pc_common_tss)); ASSYM(PC_TSS, offsetof(struct pcpu, pc_tss)); -ASSYM(PC_PM_SAVE_CNT, offsetof(struct pcpu, pc_pm_save_cnt)); ASSYM(PC_KCR3, offsetof(struct pcpu, pc_kcr3)); ASSYM(PC_UCR3, offsetof(struct pcpu, pc_ucr3)); ASSYM(PC_UCR3_LOAD_MASK, offsetof(struct pcpu, pc_ucr3_load_mask)); diff --git a/sys/amd64/amd64/pmap.c b/sys/amd64/amd64/pmap.c index f509c40e760a..d153f937b888 100644 --- a/sys/amd64/amd64/pmap.c +++ b/sys/amd64/amd64/pmap.c @@ -535,21 +535,9 @@ static int pmap_pkru_copy(pmap_t dst_pmap, pmap_t src_pmap); static int pmap_pkru_deassign(pmap_t pmap, vm_offset_t sva, vm_offset_t eva); static void pmap_pkru_deassign_all(pmap_t pmap); -static int -pmap_pcid_save_cnt_proc(SYSCTL_HANDLER_ARGS) -{ - int i; - uint64_t res; - - res = 0; - CPU_FOREACH(i) { - res += cpuid_to_pcpu[i]->pc_pm_save_cnt; - } - return (sysctl_handle_64(oidp, &res, 0, req)); -} -SYSCTL_PROC(_vm_pmap, OID_AUTO, pcid_save_cnt, CTLTYPE_U64 | CTLFLAG_RD | - CTLFLAG_MPSAFE, NULL, 0, pmap_pcid_save_cnt_proc, "QU", - "Count of saved TLB context on switch"); +static COUNTER_U64_DEFINE_EARLY(pcid_save_cnt); +SYSCTL_COUNTER_U64(_vm_pmap, OID_AUTO, pcid_save_cnt, CTLFLAG_RD, + &pcid_save_cnt, "Count of saved TLB context on switch"); static LIST_HEAD(, pmap_invl_gen) pmap_invl_gen_tracker = LIST_HEAD_INITIALIZER(&pmap_invl_gen_tracker); @@ -769,19 +757,30 @@ pmap_di_store_invl(struct pmap_invl_gen *ptr, struct pmap_invl_gen *old_val, return (res); } +static COUNTER_U64_DEFINE_EARLY(pv_page_count); +SYSCTL_COUNTER_U64(_vm_pmap, OID_AUTO, pv_page_count, CTLFLAG_RD, + &pv_page_count, "Current number of allocated pv pages"); + +static COUNTER_U64_DEFINE_EARLY(pt_page_count); +SYSCTL_COUNTER_U64(_vm_pmap, OID_AUTO, pt_page_count, CTLFLAG_RD, + &pt_page_count, "Current number of allocated page table pages"); + #ifdef PV_STATS -static long invl_start_restart; -SYSCTL_LONG(_vm_pmap, OID_AUTO, invl_start_restart, CTLFLAG_RD, - &invl_start_restart, 0, - ""); -static long invl_finish_restart; -SYSCTL_LONG(_vm_pmap, OID_AUTO, invl_finish_restart, CTLFLAG_RD, - &invl_finish_restart, 0, - ""); + +static COUNTER_U64_DEFINE_EARLY(invl_start_restart); +SYSCTL_COUNTER_U64(_vm_pmap, OID_AUTO, invl_start_restart, + CTLFLAG_RD, &invl_start_restart, + "Number of delayed TLB invalidation request restarts"); + +static COUNTER_U64_DEFINE_EARLY(invl_finish_restart); +SYSCTL_COUNTER_U64(_vm_pmap, OID_AUTO, invl_finish_restart, CTLFLAG_RD, + &invl_finish_restart, + "Number of delayed TLB invalidation completion restarts"); + static int invl_max_qlen; SYSCTL_INT(_vm_pmap, OID_AUTO, invl_max_qlen, CTLFLAG_RD, &invl_max_qlen, 0, - ""); + "Maximum delayed TLB invalidation request queue length"); #endif #define di_delay locks_delay @@ -819,7 +818,7 @@ again: PV_STAT(i++); prevl = (uintptr_t)atomic_load_ptr(&p->next); if ((prevl & PMAP_INVL_GEN_NEXT_INVALID) != 0) { - PV_STAT(atomic_add_long(&invl_start_restart, 1)); + PV_STAT(counter_u64_add(invl_start_restart, 1)); lock_delay(&lda); goto again; } @@ -833,7 +832,7 @@ again: #endif if (!pmap_di_load_invl(p, &prev) || prev.next != NULL) { - PV_STAT(atomic_add_long(&invl_start_restart, 1)); + PV_STAT(counter_u64_add(invl_start_restart, 1)); lock_delay(&lda); goto again; } @@ -862,7 +861,7 @@ again: */ if (!pmap_di_store_invl(p, &prev, &new_prev)) { critical_exit(); - PV_STAT(atomic_add_long(&invl_start_restart, 1)); + PV_STAT(counter_u64_add(invl_start_restart, 1)); lock_delay(&lda); goto again; } @@ -926,7 +925,7 @@ again: for (p = &pmap_invl_gen_head; p != NULL; p = (void *)prevl) { prevl = (uintptr_t)atomic_load_ptr(&p->next); if ((prevl & PMAP_INVL_GEN_NEXT_INVALID) != 0) { - PV_STAT(atomic_add_long(&invl_finish_restart, 1)); + PV_STAT(counter_u64_add(invl_finish_restart, 1)); lock_delay(&lda); goto again; } @@ -939,7 +938,7 @@ again: * thread before us finished its DI and started it again. */ if (__predict_false(p == NULL)) { - PV_STAT(atomic_add_long(&invl_finish_restart, 1)); + PV_STAT(counter_u64_add(invl_finish_restart, 1)); lock_delay(&lda); goto again; } @@ -951,7 +950,7 @@ again: atomic_clear_ptr((uintptr_t *)&invl_gen->next, PMAP_INVL_GEN_NEXT_INVALID); critical_exit(); - PV_STAT(atomic_add_long(&invl_finish_restart, 1)); + PV_STAT(counter_u64_add(invl_finish_restart, 1)); lock_delay(&lda); goto again; } @@ -987,12 +986,15 @@ DB_SHOW_COMMAND(di_queue, pmap_di_queue) #endif #ifdef PV_STATS -static long invl_wait; -SYSCTL_LONG(_vm_pmap, OID_AUTO, invl_wait, CTLFLAG_RD, &invl_wait, 0, +static COUNTER_U64_DEFINE_EARLY(invl_wait); +SYSCTL_COUNTER_U64(_vm_pmap, OID_AUTO, invl_wait, + CTLFLAG_RD, &invl_wait, "Number of times DI invalidation blocked pmap_remove_all/write"); -static long invl_wait_slow; -SYSCTL_LONG(_vm_pmap, OID_AUTO, invl_wait_slow, CTLFLAG_RD, &invl_wait_slow, 0, - "Number of slow invalidation waits for lockless DI"); + +static COUNTER_U64_DEFINE_EARLY(invl_wait_slow); +SYSCTL_COUNTER_U64(_vm_pmap, OID_AUTO, invl_wait_slow, CTLFLAG_RD, + &invl_wait_slow, "Number of slow invalidation waits for lockless DI"); + #endif #ifdef NUMA @@ -1066,7 +1068,7 @@ pmap_delayed_invl_wait_l(vm_page_t m) while (*m_gen > pmap_invl_gen) { #ifdef PV_STATS if (!accounted) { - atomic_add_long(&invl_wait, 1); + counter_u64_add(invl_wait, 1); accounted = true; } #endif @@ -1086,7 +1088,7 @@ pmap_delayed_invl_wait_u(vm_page_t m) lock_delay_arg_init(&lda, &di_delay); while (*m_gen > atomic_load_long(&pmap_invl_gen_head.gen)) { if (fast || !pmap_invl_callout_inited) { - PV_STAT(atomic_add_long(&invl_wait, 1)); + PV_STAT(counter_u64_add(invl_wait, 1)); lock_delay(&lda); fast = false; } else { @@ -1119,7 +1121,7 @@ pmap_delayed_invl_wait_u(vm_page_t m) atomic_load_long(&pmap_invl_gen_head.gen)) { callout_reset(&pmap_invl_callout, 1, pmap_delayed_invl_callout_func, NULL); - PV_STAT(atomic_add_long(&invl_wait_slow, 1)); + PV_STAT(counter_u64_add(invl_wait_slow, 1)); pmap_delayed_invl_wait_block(m_gen, &pmap_invl_gen_head.gen); } @@ -2459,28 +2461,28 @@ SYSCTL_UINT(_vm_pmap, OID_AUTO, large_map_pml4_entries, static SYSCTL_NODE(_vm_pmap, OID_AUTO, pde, CTLFLAG_RD | CTLFLAG_MPSAFE, 0, "2MB page mapping counters"); -static u_long pmap_pde_demotions; -SYSCTL_ULONG(_vm_pmap_pde, OID_AUTO, demotions, CTLFLAG_RD, - &pmap_pde_demotions, 0, "2MB page demotions"); +static COUNTER_U64_DEFINE_EARLY(pmap_pde_demotions); +SYSCTL_COUNTER_U64(_vm_pmap_pde, OID_AUTO, demotions, + CTLFLAG_RD, &pmap_pde_demotions, "2MB page demotions"); -static u_long pmap_pde_mappings; -SYSCTL_ULONG(_vm_pmap_pde, OID_AUTO, mappings, CTLFLAG_RD, - &pmap_pde_mappings, 0, "2MB page mappings"); +static COUNTER_U64_DEFINE_EARLY(pmap_pde_mappings); +SYSCTL_COUNTER_U64(_vm_pmap_pde, OID_AUTO, mappings, CTLFLAG_RD, + &pmap_pde_mappings, "2MB page mappings"); -static u_long pmap_pde_p_failures; -SYSCTL_ULONG(_vm_pmap_pde, OID_AUTO, p_failures, CTLFLAG_RD, - &pmap_pde_p_failures, 0, "2MB page promotion failures"); +static COUNTER_U64_DEFINE_EARLY(pmap_pde_p_failures); +SYSCTL_COUNTER_U64(_vm_pmap_pde, OID_AUTO, p_failures, CTLFLAG_RD, + &pmap_pde_p_failures, "2MB page promotion failures"); -static u_long pmap_pde_promotions; -SYSCTL_ULONG(_vm_pmap_pde, OID_AUTO, promotions, CTLFLAG_RD, - &pmap_pde_promotions, 0, "2MB page promotions"); +static COUNTER_U64_DEFINE_EARLY(pmap_pde_promotions); +SYSCTL_COUNTER_U64(_vm_pmap_pde, OID_AUTO, promotions, CTLFLAG_RD, + &pmap_pde_promotions, "2MB page promotions"); static SYSCTL_NODE(_vm_pmap, OID_AUTO, pdpe, CTLFLAG_RD | CTLFLAG_MPSAFE, 0, "1GB page mapping counters"); -static u_long pmap_pdpe_demotions; -SYSCTL_ULONG(_vm_pmap_pdpe, OID_AUTO, demotions, CTLFLAG_RD, - &pmap_pdpe_demotions, 0, "1GB page demotions"); +static COUNTER_U64_DEFINE_EARLY(pmap_pdpe_demotions); +SYSCTL_COUNTER_U64(_vm_pmap_pdpe, OID_AUTO, demotions, CTLFLAG_RD, + &pmap_pdpe_demotions, "1GB page demotions"); /*************************************************** * Low level helper routines..... @@ -4016,6 +4018,8 @@ _pmap_unwire_ptp(pmap_t pmap, vm_offset_t va, vm_page_t m, struct spglist *free) pmap_unwire_ptp(pmap, va, pml4pg, free); } + counter_u64_add(pt_page_count, -1); + /* * Put page on a list so that it is released after * *ALL* TLB shootdown is done @@ -4196,6 +4200,8 @@ pmap_pinit_type(pmap_t pmap, enum pmap_type pm_type, int flags) pmltop_pg = vm_page_alloc(NULL, 0, VM_ALLOC_NORMAL | VM_ALLOC_NOOBJ | VM_ALLOC_WIRED | VM_ALLOC_ZERO | VM_ALLOC_WAITOK); + counter_u64_add(pt_page_count, 1); + pmltop_phys = VM_PAGE_TO_PHYS(pmltop_pg); pmap->pm_pmltop = (pml5_entry_t *)PHYS_TO_DMAP(pmltop_phys); @@ -4227,6 +4233,7 @@ pmap_pinit_type(pmap_t pmap, enum pmap_type pm_type, int flags) if ((curproc->p_md.md_flags & P_MD_KPTI) != 0) { pmltop_pgu = vm_page_alloc(NULL, 0, VM_ALLOC_NORMAL | VM_ALLOC_NOOBJ | VM_ALLOC_WIRED | VM_ALLOC_WAITOK); + counter_u64_add(pt_page_count, 1); pmap->pm_pmltopu = (pml4_entry_t *)PHYS_TO_DMAP( VM_PAGE_TO_PHYS(pmltop_pgu)); if (pmap_is_la57(pmap)) @@ -4414,6 +4421,7 @@ pmap_allocpte_nosleep(pmap_t pmap, vm_pindex_t ptepindex, struct rwlock **lockp, if ((m = vm_page_alloc(NULL, ptepindex, VM_ALLOC_NOOBJ | VM_ALLOC_WIRED | VM_ALLOC_ZERO)) == NULL) return (NULL); + if ((m->flags & PG_ZERO) == 0) pmap_zero_page(m); @@ -4511,6 +4519,8 @@ pmap_allocpte_nosleep(pmap_t pmap, vm_pindex_t ptepindex, struct rwlock **lockp, } pmap_resident_count_inc(pmap, 1); + counter_u64_add(pt_page_count, 1); + return (m); } @@ -4673,12 +4683,14 @@ pmap_release(pmap_t pmap) vm_page_unwire_noq(m); vm_page_free_zero(m); + counter_u64_add(pt_page_count, -1); if (pmap->pm_pmltopu != NULL) { m = PHYS_TO_VM_PAGE(DMAP_TO_PHYS((vm_offset_t)pmap-> pm_pmltopu)); vm_page_unwire_noq(m); vm_page_free(m); + counter_u64_add(pt_page_count, -1); } if (pmap->pm_type == PT_X86 && (cpu_stdext_feature2 & CPUID_STDEXT2_PKU) != 0) @@ -4794,6 +4806,7 @@ pmap_growkernel(vm_offset_t addr) panic("pmap_growkernel: no memory to grow kernel"); if ((nkpg->flags & PG_ZERO) == 0) pmap_zero_page(nkpg); + counter_u64_add(pt_page_count, 1); paddr = VM_PAGE_TO_PHYS(nkpg); *pdpe = (pdp_entry_t)(paddr | X86_PG_V | X86_PG_RW | X86_PG_A | X86_PG_M); @@ -4816,6 +4829,7 @@ pmap_growkernel(vm_offset_t addr) panic("pmap_growkernel: no memory to grow kernel"); if ((nkpg->flags & PG_ZERO) == 0) pmap_zero_page(nkpg); + counter_u64_add(pt_page_count, 1); paddr = VM_PAGE_TO_PHYS(nkpg); newpdir = paddr | X86_PG_V | X86_PG_RW | X86_PG_A | X86_PG_M; pde_store(pde, newpdir); @@ -4852,28 +4866,39 @@ pv_to_chunk(pv_entry_t pv) static const uint64_t pc_freemask[_NPCM] = { PC_FREE0, PC_FREE1, PC_FREE2 }; #ifdef PV_STATS -static int pc_chunk_count, pc_chunk_allocs, pc_chunk_frees, pc_chunk_tryfail; - -SYSCTL_INT(_vm_pmap, OID_AUTO, pc_chunk_count, CTLFLAG_RD, &pc_chunk_count, 0, - "Current number of pv entry chunks"); -SYSCTL_INT(_vm_pmap, OID_AUTO, pc_chunk_allocs, CTLFLAG_RD, &pc_chunk_allocs, 0, - "Current number of pv entry chunks allocated"); -SYSCTL_INT(_vm_pmap, OID_AUTO, pc_chunk_frees, CTLFLAG_RD, &pc_chunk_frees, 0, - "Current number of pv entry chunks frees"); -SYSCTL_INT(_vm_pmap, OID_AUTO, pc_chunk_tryfail, CTLFLAG_RD, &pc_chunk_tryfail, 0, - "Number of times tried to get a chunk page but failed."); - -static long pv_entry_frees, pv_entry_allocs, pv_entry_count; -static int pv_entry_spare; - -SYSCTL_LONG(_vm_pmap, OID_AUTO, pv_entry_frees, CTLFLAG_RD, &pv_entry_frees, 0, - "Current number of pv entry frees"); -SYSCTL_LONG(_vm_pmap, OID_AUTO, pv_entry_allocs, CTLFLAG_RD, &pv_entry_allocs, 0, - "Current number of pv entry allocs"); -SYSCTL_LONG(_vm_pmap, OID_AUTO, pv_entry_count, CTLFLAG_RD, &pv_entry_count, 0, - "Current number of pv entries"); -SYSCTL_INT(_vm_pmap, OID_AUTO, pv_entry_spare, CTLFLAG_RD, &pv_entry_spare, 0, - "Current number of spare pv entries"); + +static COUNTER_U64_DEFINE_EARLY(pc_chunk_count); +SYSCTL_COUNTER_U64(_vm_pmap, OID_AUTO, pc_chunk_count, CTLFLAG_RD, + &pc_chunk_count, "Current number of pv entry cnunks"); + +static COUNTER_U64_DEFINE_EARLY(pc_chunk_allocs); +SYSCTL_COUNTER_U64(_vm_pmap, OID_AUTO, pc_chunk_allocs, CTLFLAG_RD, + &pc_chunk_allocs, "Total number of pv entry chunks allocated"); + +static COUNTER_U64_DEFINE_EARLY(pc_chunk_frees); +SYSCTL_COUNTER_U64(_vm_pmap, OID_AUTO, pc_chunk_frees, CTLFLAG_RD, + &pc_chunk_frees, "Total number of pv entry chunks freed"); + +static COUNTER_U64_DEFINE_EARLY(pc_chunk_tryfail); +SYSCTL_COUNTER_U64(_vm_pmap, OID_AUTO, pc_chunk_tryfail, CTLFLAG_RD, + &pc_chunk_tryfail, + "Number of failed attempts to get a pv entry chunk page"); + +static COUNTER_U64_DEFINE_EARLY(pv_entry_frees); +SYSCTL_COUNTER_U64(_vm_pmap, OID_AUTO, pv_entry_frees, CTLFLAG_RD, + &pv_entry_frees, "Total number of pv entries freed"); + +static COUNTER_U64_DEFINE_EARLY(pv_entry_allocs); +SYSCTL_COUNTER_U64(_vm_pmap, OID_AUTO, pv_entry_allocs, CTLFLAG_RD, + &pv_entry_allocs, "Total number of pv entries allocated"); + +static COUNTER_U64_DEFINE_EARLY(pv_entry_count); +SYSCTL_COUNTER_U64(_vm_pmap, OID_AUTO, pv_entry_count, CTLFLAG_RD, + &pv_entry_count, "Current number of pv entries"); + +static COUNTER_U64_DEFINE_EARLY(pv_entry_spare); +SYSCTL_COUNTER_U64(_vm_pmap, OID_AUTO, pv_entry_spare, CTLFLAG_RD, + &pv_entry_spare, "Current number of spare pv entries"); #endif static void @@ -5046,15 +5071,15 @@ reclaim_pv_chunk_domain(pmap_t locked_pmap, struct rwlock **lockp, int domain) } /* Every freed mapping is for a 4 KB page. */ pmap_resident_count_dec(pmap, freed); - PV_STAT(atomic_add_long(&pv_entry_frees, freed)); - PV_STAT(atomic_add_int(&pv_entry_spare, freed)); - PV_STAT(atomic_subtract_long(&pv_entry_count, freed)); + PV_STAT(counter_u64_add(pv_entry_frees, freed)); + PV_STAT(counter_u64_add(pv_entry_spare, freed)); + PV_STAT(counter_u64_add(pv_entry_count, -freed)); TAILQ_REMOVE(&pmap->pm_pvchunk, pc, pc_list); if (pc->pc_map[0] == PC_FREE0 && pc->pc_map[1] == PC_FREE1 && pc->pc_map[2] == PC_FREE2) { - PV_STAT(atomic_subtract_int(&pv_entry_spare, _NPCPV)); - PV_STAT(atomic_subtract_int(&pc_chunk_count, 1)); - PV_STAT(atomic_add_int(&pc_chunk_frees, 1)); + PV_STAT(counter_u64_add(pv_entry_spare, -_NPCPV)); + PV_STAT(counter_u64_add(pc_chunk_count, -1)); + PV_STAT(counter_u64_add(pc_chunk_frees, 1)); /* Entire chunk is free; return it. */ m_pc = PHYS_TO_VM_PAGE(DMAP_TO_PHYS((vm_offset_t)pc)); dump_drop_page(m_pc->phys_addr); @@ -5127,9 +5152,9 @@ free_pv_entry(pmap_t pmap, pv_entry_t pv) int idx, field, bit; PMAP_LOCK_ASSERT(pmap, MA_OWNED); - PV_STAT(atomic_add_long(&pv_entry_frees, 1)); - PV_STAT(atomic_add_int(&pv_entry_spare, 1)); - PV_STAT(atomic_subtract_long(&pv_entry_count, 1)); + PV_STAT(counter_u64_add(pv_entry_frees, 1)); + PV_STAT(counter_u64_add(pv_entry_spare, 1)); + PV_STAT(counter_u64_add(pv_entry_count, -1)); pc = pv_to_chunk(pv); idx = pv - &pc->pc_pventry[0]; field = idx / 64; @@ -5153,9 +5178,10 @@ free_pv_chunk_dequeued(struct pv_chunk *pc) { vm_page_t m; - PV_STAT(atomic_subtract_int(&pv_entry_spare, _NPCPV)); - PV_STAT(atomic_subtract_int(&pc_chunk_count, 1)); - PV_STAT(atomic_add_int(&pc_chunk_frees, 1)); + PV_STAT(counter_u64_add(pv_entry_spare, -_NPCPV)); + PV_STAT(counter_u64_add(pc_chunk_count, -1)); + PV_STAT(counter_u64_add(pc_chunk_frees, 1)); + counter_u64_add(pv_page_count, -1); /* entire chunk is free, return it */ m = PHYS_TO_VM_PAGE(DMAP_TO_PHYS((vm_offset_t)pc)); dump_drop_page(m->phys_addr); @@ -5218,7 +5244,7 @@ get_pv_entry(pmap_t pmap, struct rwlock **lockp) vm_page_t m; PMAP_LOCK_ASSERT(pmap, MA_OWNED); - PV_STAT(atomic_add_long(&pv_entry_allocs, 1)); + PV_STAT(counter_u64_add(pv_entry_allocs, 1)); retry: pc = TAILQ_FIRST(&pmap->pm_pvchunk); if (pc != NULL) { @@ -5238,8 +5264,8 @@ retry: TAILQ_INSERT_TAIL(&pmap->pm_pvchunk, pc, pc_list); } - PV_STAT(atomic_add_long(&pv_entry_count, 1)); - PV_STAT(atomic_subtract_int(&pv_entry_spare, 1)); + PV_STAT(counter_u64_add(pv_entry_count, 1)); + PV_STAT(counter_u64_add(pv_entry_spare, -1)); return (pv); } } @@ -5248,15 +5274,16 @@ retry: VM_ALLOC_WIRED); if (m == NULL) { if (lockp == NULL) { - PV_STAT(pc_chunk_tryfail++); + PV_STAT(counter_u64_add(pc_chunk_tryfail, 1)); return (NULL); } m = reclaim_pv_chunk(pmap, lockp); if (m == NULL) goto retry; - } - PV_STAT(atomic_add_int(&pc_chunk_count, 1)); - PV_STAT(atomic_add_int(&pc_chunk_allocs, 1)); + } else + counter_u64_add(pv_page_count, 1); + PV_STAT(counter_u64_add(pc_chunk_count, 1)); + PV_STAT(counter_u64_add(pc_chunk_allocs, 1)); dump_add_page(m->phys_addr); pc = (void *)PHYS_TO_DMAP(m->phys_addr); pc->pc_pmap = pmap; @@ -5269,8 +5296,8 @@ retry: mtx_unlock(&pvc->pvc_lock); pv = &pc->pc_pventry[0]; TAILQ_INSERT_HEAD(&pmap->pm_pvchunk, pc, pc_list); - PV_STAT(atomic_add_long(&pv_entry_count, 1)); - PV_STAT(atomic_add_int(&pv_entry_spare, _NPCPV - 1)); + PV_STAT(counter_u64_add(pv_entry_count, 1)); + PV_STAT(counter_u64_add(pv_entry_spare, _NPCPV - 1)); return (pv); } @@ -5354,9 +5381,10 @@ retry: if (m == NULL) goto retry; reclaimed = true; - } - PV_STAT(atomic_add_int(&pc_chunk_count, 1)); - PV_STAT(atomic_add_int(&pc_chunk_allocs, 1)); + } else + counter_u64_add(pv_page_count, 1); + PV_STAT(counter_u64_add(pc_chunk_count, 1)); + PV_STAT(counter_u64_add(pc_chunk_allocs, 1)); dump_add_page(m->phys_addr); pc = (void *)PHYS_TO_DMAP(m->phys_addr); pc->pc_pmap = pmap; @@ -5365,7 +5393,7 @@ retry: pc->pc_map[2] = PC_FREE2; TAILQ_INSERT_HEAD(&pmap->pm_pvchunk, pc, pc_list); TAILQ_INSERT_TAIL(&new_tail[vm_page_domain(m)], pc, pc_lru); - PV_STAT(atomic_add_int(&pv_entry_spare, _NPCPV)); + PV_STAT(counter_u64_add(pv_entry_spare, _NPCPV)); /* * The reclaim might have freed a chunk from the current pmap. @@ -5440,7 +5468,7 @@ pmap_pv_demote_pde(pmap_t pmap, vm_offset_t va, vm_paddr_t pa, TAILQ_INSERT_TAIL(&m->md.pv_list, pv, pv_next); m->md.pv_gen++; /* Instantiate the remaining NPTEPG - 1 pv entries. */ - PV_STAT(atomic_add_long(&pv_entry_allocs, NPTEPG - 1)); + PV_STAT(counter_u64_add(pv_entry_allocs, NPTEPG - 1)); va_last = va + NBPDR - PAGE_SIZE; for (;;) { pc = TAILQ_FIRST(&pmap->pm_pvchunk); @@ -5470,8 +5498,8 @@ out: TAILQ_REMOVE(&pmap->pm_pvchunk, pc, pc_list); TAILQ_INSERT_TAIL(&pmap->pm_pvchunk, pc, pc_list); } - PV_STAT(atomic_add_long(&pv_entry_count, NPTEPG - 1)); - PV_STAT(atomic_subtract_int(&pv_entry_spare, NPTEPG - 1)); + PV_STAT(counter_u64_add(pv_entry_count, NPTEPG - 1)); + PV_STAT(counter_u64_add(pv_entry_spare, -(NPTEPG - 1))); } #if VM_NRESERVLEVEL > 0 @@ -5731,6 +5759,8 @@ pmap_demote_pde_locked(pmap_t pmap, pd_entry_t *pde, vm_offset_t va, return (FALSE); } + counter_u64_add(pt_page_count, 1); + if (!in_kernel) { mpte->ref_count = NPTEPG; pmap_resident_count_inc(pmap, 1); @@ -5795,7 +5825,7 @@ pmap_demote_pde_locked(pmap_t pmap, pd_entry_t *pde, vm_offset_t va, if ((oldpde & PG_MANAGED) != 0) pmap_pv_demote_pde(pmap, va, oldpde & PG_PS_FRAME, lockp); - atomic_add_long(&pmap_pde_demotions, 1); + counter_u64_add(pmap_pde_demotions, 1); CTR2(KTR_PMAP, "pmap_demote_pde: success for va %#lx in pmap %p", va, pmap); return (TRUE); @@ -6517,7 +6547,7 @@ setpde: if ((newpde & ((PG_FRAME & PDRMASK) | PG_A | PG_V)) != (PG_A | PG_V) || !pmap_allow_2m_x_page(pmap, pmap_pde_ept_executable(pmap, newpde))) { - atomic_add_long(&pmap_pde_p_failures, 1); + counter_u64_add(pmap_pde_p_failures, 1); CTR2(KTR_PMAP, "pmap_promote_pde: failure for va %#lx" " in pmap %p", va, pmap); return; @@ -6542,7 +6572,7 @@ setpde: setpte: oldpte = *pte; if ((oldpte & (PG_FRAME | PG_A | PG_V)) != pa) { - atomic_add_long(&pmap_pde_p_failures, 1); + counter_u64_add(pmap_pde_p_failures, 1); CTR2(KTR_PMAP, "pmap_promote_pde: failure for va %#lx" " in pmap %p", va, pmap); return; @@ -6560,7 +6590,7 @@ setpte: (va & ~PDRMASK), pmap); } if ((oldpte & PG_PTE_PROMOTE) != (newpde & PG_PTE_PROMOTE)) { - atomic_add_long(&pmap_pde_p_failures, 1); + counter_u64_add(pmap_pde_p_failures, 1); CTR2(KTR_PMAP, "pmap_promote_pde: failure for va %#lx" " in pmap %p", va, pmap); return; @@ -6580,7 +6610,7 @@ setpte: KASSERT(mpte->pindex == pmap_pde_pindex(va), ("pmap_promote_pde: page table page's pindex is wrong")); if (pmap_insert_pt_page(pmap, mpte, true)) { - atomic_add_long(&pmap_pde_p_failures, 1); + counter_u64_add(pmap_pde_p_failures, 1); CTR2(KTR_PMAP, "pmap_promote_pde: failure for va %#lx in pmap %p", va, pmap); @@ -6606,7 +6636,7 @@ setpte: else pde_store(pde, PG_PROMOTED | PG_PS | newpde); - atomic_add_long(&pmap_pde_promotions, 1); + counter_u64_add(pmap_pde_promotions, 1); CTR2(KTR_PMAP, "pmap_promote_pde: success for va %#lx" " in pmap %p", va, pmap); } @@ -7182,7 +7212,7 @@ pmap_enter_pde(pmap_t pmap, vm_offset_t va, pd_entry_t newpde, u_int flags, */ pde_store(pde, newpde); - atomic_add_long(&pmap_pde_mappings, 1); + counter_u64_add(pmap_pde_mappings, 1); CTR2(KTR_PMAP, "pmap_enter_pde: success for va %#lx in pmap %p", va, pmap); return (KERN_SUCCESS); @@ -7444,7 +7474,7 @@ pmap_object_init_pt(pmap_t pmap, vm_offset_t addr, vm_object_t object, pde_store(pde, pa | PG_PS | PG_M | PG_A | PG_U | PG_RW | PG_V); pmap_resident_count_inc(pmap, NBPDR / PAGE_SIZE); - atomic_add_long(&pmap_pde_mappings, 1); + counter_u64_add(pmap_pde_mappings, 1); } else { /* Continue on if the PDE is already valid. */ pdpg->ref_count--; @@ -7672,7 +7702,7 @@ pmap_copy(pmap_t dst_pmap, pmap_t src_pmap, vm_offset_t dst_addr, vm_size_t len, *pde = srcptepaddr & ~PG_W; pmap_resident_count_inc(dst_pmap, NBPDR / PAGE_SIZE); - atomic_add_long(&pmap_pde_mappings, 1); + counter_u64_add(pmap_pde_mappings, 1); } else pmap_abort_ptp(dst_pmap, addr, dst_pdpg); continue; @@ -8157,9 +8187,9 @@ pmap_remove_pages(pmap_t pmap) freed++; } } - PV_STAT(atomic_add_long(&pv_entry_frees, freed)); - PV_STAT(atomic_add_int(&pv_entry_spare, freed)); - PV_STAT(atomic_subtract_long(&pv_entry_count, freed)); + PV_STAT(counter_u64_add(pv_entry_frees, freed)); + PV_STAT(counter_u64_add(pv_entry_spare, freed)); + PV_STAT(counter_u64_add(pv_entry_count, -freed)); if (allfree) { TAILQ_REMOVE(&pmap->pm_pvchunk, pc, pc_list); TAILQ_INSERT_TAIL(&free_chunks[pc_to_domain(pc)], pc, pc_list); @@ -9073,6 +9103,7 @@ pmap_demote_pdpe(pmap_t pmap, pdp_entry_t *pdpe, vm_offset_t va) " in pmap %p", va, pmap); return (FALSE); } + counter_u64_add(pt_page_count, 1); pdpgpa = VM_PAGE_TO_PHYS(pdpg); firstpde = (pd_entry_t *)PHYS_TO_DMAP(pdpgpa); newpdpe = pdpgpa | PG_M | PG_A | (oldpdpe & PG_U) | PG_RW | PG_V; @@ -9100,7 +9131,7 @@ pmap_demote_pdpe(pmap_t pmap, pdp_entry_t *pdpe, vm_offset_t va) */ pmap_invalidate_page(pmap, (vm_offset_t)vtopde(va)); - pmap_pdpe_demotions++; + counter_u64_add(pmap_pdpe_demotions, 1); CTR2(KTR_PMAP, "pmap_demote_pdpe: success for va %#lx" " in pmap %p", va, pmap); return (TRUE); @@ -9622,7 +9653,7 @@ pmap_activate_sw_pcid_pti(struct thread *td, pmap_t pmap, u_int cpuid) PCPU_SET(kcr3, kcr3 | CR3_PCID_SAVE); PCPU_SET(ucr3, ucr3 | CR3_PCID_SAVE); if (cached) - PCPU_INC(pm_save_cnt); + counter_u64_add(pcid_save_cnt, 1); pmap_activate_sw_pti_post(td, pmap); } @@ -9643,7 +9674,7 @@ pmap_activate_sw_pcid_nopti(struct thread *td __unused, pmap_t pmap, cached); PCPU_SET(curpmap, pmap); if (cached) - PCPU_INC(pm_save_cnt); + counter_u64_add(pcid_save_cnt, 1); } static void @@ -10088,8 +10119,11 @@ pmap_large_map_getptp_unlocked(void) m = vm_page_alloc(NULL, 0, VM_ALLOC_NORMAL | VM_ALLOC_NOOBJ | VM_ALLOC_ZERO); - if (m != NULL && (m->flags & PG_ZERO) == 0) - pmap_zero_page(m); + if (m != NULL) { + if ((m->flags & PG_ZERO) == 0) + pmap_zero_page(m); + counter_u64_add(pt_page_count, 1); + } return (m); } diff --git a/sys/amd64/include/pcpu.h b/sys/amd64/include/pcpu.h index 4b163636c775..6326fbdae0be 100644 --- a/sys/amd64/include/pcpu.h +++ b/sys/amd64/include/pcpu.h @@ -76,7 +76,6 @@ _Static_assert(sizeof(struct monitorbuf) == 128, "2x cache line"); struct system_segment_descriptor *pc_ldt; \ /* Pointer to the CPU TSS descriptor */ \ struct system_segment_descriptor *pc_tss; \ - uint64_t pc_pm_save_cnt; \ u_int pc_cmci_mask; /* MCx banks for CMCI */ \ uint64_t pc_dbreg[16]; /* ddb debugging regs */ \ uint64_t pc_pti_stack[PC_PTI_STACK_SZ]; \ @@ -89,7 +88,7 @@ _Static_assert(sizeof(struct monitorbuf) == 128, "2x cache line"); uint32_t pc_ibpb_set; \ void *pc_mds_buf; \ void *pc_mds_buf64; \ - uint32_t pc_pad[2]; \ + uint32_t pc_pad[4]; \ uint8_t pc_mds_tmp[64]; \ u_int pc_ipi_bitmap; \ struct amd64tss pc_common_tss; \ From owner-dev-commits-src-main@freebsd.org Tue Mar 9 17:34: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 ECA9356ACE5; Tue, 9 Mar 2021 17:34:03 +0000 (UTC) (envelope-from jhb@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 4Dw2Pl6VGSz4kbP; Tue, 9 Mar 2021 17:34:03 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro.local (ralph.baldwin.cx [66.234.199.215]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id 45E23278D6; Tue, 9 Mar 2021 17:34:03 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Subject: Re: git: 1ae20f7c70ea - main - kern: malloc: fix panic on M_WAITOK during THREAD_NO_SLEEPING() To: Kyle Evans , src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org References: <202103091117.129BHOZa042851@gitrepo.freebsd.org> From: John Baldwin Message-ID: <3d67f7e4-c1fc-ca2c-8fc5-417dcf8e4145@FreeBSD.org> Date: Tue, 9 Mar 2021 09:33:59 -0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:78.0) Gecko/20100101 Thunderbird/78.7.1 MIME-Version: 1.0 In-Reply-To: <202103091117.129BHOZa042851@gitrepo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit 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, 09 Mar 2021 17:34:04 -0000 On 3/9/21 3:17 AM, Kyle Evans wrote: > The branch main has been updated by kevans: > > URL: https://cgit.FreeBSD.org/src/commit/?id=1ae20f7c70ea16fa8b702e409030e170df4f5c13 > > commit 1ae20f7c70ea16fa8b702e409030e170df4f5c13 > Author: Kyle Evans > AuthorDate: 2021-03-08 06:16:27 +0000 > Commit: Kyle Evans > CommitDate: 2021-03-09 11:16:39 +0000 > > kern: malloc: fix panic on M_WAITOK during THREAD_NO_SLEEPING() > > Simple condition flip; we wanted to panic here after epoch_trace_list(). > > Reviewed by: glebius, markj > MFC after: 3 days > Differential Revision: https://reviews.freebsd.org/D29125 > --- > sys/kern/kern_malloc.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/sys/kern/kern_malloc.c b/sys/kern/kern_malloc.c > index 48383358e3ad..0d6f9dcfcab7 100644 > --- a/sys/kern/kern_malloc.c > +++ b/sys/kern/kern_malloc.c > @@ -537,7 +537,7 @@ malloc_dbg(caddr_t *vap, size_t *sizep, struct malloc_type *mtp, > #ifdef EPOCH_TRACE > epoch_trace_list(curthread); > #endif > - KASSERT(1, > + KASSERT(0, > ("malloc(M_WAITOK) with sleeping prohibited")); I would perhaps just use panic() directly under INVARIANTS instead of KASSERT(false, ...) Either that or duplicate the condition and let the compiler deal with avoiding checking it twice, e.g.: #ifdef EPOCH_TRACE if (!THREAD_CAN_SLEEP()) epoc_trace_list(curthread); #endif KASSERT(THREAD_CAN_SLEEP(), ("malloc(M_WAITOK) with sleeping prohibited")); -- John Baldwin From owner-dev-commits-src-main@freebsd.org Tue Mar 9 19:49: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 7E15D56E05E; Tue, 9 Mar 2021 19:49: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 4Dw5Px37Ynz4rwL; Tue, 9 Mar 2021 19:49: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 5E5F121BE7; Tue, 9 Mar 2021 19:49: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 129JnPb9016659; Tue, 9 Mar 2021 19:49:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 129JnP9N016658; Tue, 9 Mar 2021 19:49:25 GMT (envelope-from git) Date: Tue, 9 Mar 2021 19:49:25 GMT Message-Id: <202103091949.129JnP9N016658@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: 299f8977cef6 - main - if_wg: wg_input: remove a couple locals (NFC) 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: 299f8977cef66d19c05d52d19b892fd8c7a235ea 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, 09 Mar 2021 19:49:25 -0000 The branch main has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=299f8977cef66d19c05d52d19b892fd8c7a235ea commit 299f8977cef66d19c05d52d19b892fd8c7a235ea Author: Kyle Evans AuthorDate: 2021-03-09 10:59:21 +0000 Commit: Kyle Evans CommitDate: 2021-03-09 19:49:13 +0000 if_wg: wg_input: remove a couple locals (NFC) We have no use for the udphdr or this hlen local, just spell out the addition inline. MFC after: 3 days Reviewed by: grehan, markj Differential Revision: https://reviews.freebsd.org/D29142 --- sys/dev/if_wg/module/if_wg_session.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/sys/dev/if_wg/module/if_wg_session.c b/sys/dev/if_wg/module/if_wg_session.c index ae9e44cffef5..5360b047426b 100644 --- a/sys/dev/if_wg/module/if_wg_session.c +++ b/sys/dev/if_wg/module/if_wg_session.c @@ -1891,17 +1891,14 @@ wg_input(struct mbuf *m0, int offset, struct inpcb *inpcb, struct wg_pkt_data *pkt_data; struct wg_endpoint *e; struct wg_softc *sc = _sc; - struct udphdr *uh; struct mbuf *m; - int pktlen, pkttype, hlen; + int pktlen, pkttype; struct noise_remote *remote; struct wg_tag *t; void *data; - uh = (struct udphdr *)(m0->m_data + offset); - hlen = offset + sizeof(struct udphdr); - - m_adj(m0, hlen); + /* Caller provided us with srcsa, no need for this header. */ + m_adj(m0, offset + sizeof(struct udphdr)); /* * Ensure mbuf has at least enough contiguous data to peel off our From owner-dev-commits-src-main@freebsd.org Tue Mar 9 19:49: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 A362156DF32; Tue, 9 Mar 2021 19:49: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 4Dw5Py49JZz4sHl; Tue, 9 Mar 2021 19:49: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 804F421EBC; Tue, 9 Mar 2021 19:49: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 129JnQf6016682; Tue, 9 Mar 2021 19:49:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 129JnQIb016681; Tue, 9 Mar 2021 19:49:26 GMT (envelope-from git) Date: Tue, 9 Mar 2021 19:49:26 GMT Message-Id: <202103091949.129JnQIb016681@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: 0dd691b41276 - main - iflib: allow clone detach if not yet init 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: 0dd691b41276ce13d25ffb1443af27f85038aa3f 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, 09 Mar 2021 19:49:26 -0000 The branch main has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=0dd691b41276ce13d25ffb1443af27f85038aa3f commit 0dd691b41276ce13d25ffb1443af27f85038aa3f Author: Kyle Evans AuthorDate: 2021-03-09 12:13:31 +0000 Commit: Kyle Evans CommitDate: 2021-03-09 19:49:13 +0000 iflib: allow clone detach if not yet init If we hit an error during init, then we'll unwind our state and attempt to detach the device -- don't block it. This was discovered by creating a wg0 with missing parameters; said failure ended up leaving this orphaned device in place and ended up panicking the system upon enumeration of the dev.* sysctl space. Reviewed by: gallatin, markj MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D29145 --- sys/net/iflib_clone.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/net/iflib_clone.c b/sys/net/iflib_clone.c index 975873c4a19c..fc4e71806926 100644 --- a/sys/net/iflib_clone.c +++ b/sys/net/iflib_clone.c @@ -83,7 +83,8 @@ iflib_pseudo_detach(device_t dev) if_ctx_t ctx; ctx = device_get_softc(dev); - if ((iflib_get_flags(ctx) & IFC_IN_DETACH) == 0) + if ((iflib_get_flags(ctx) & (IFC_INIT_DONE | IFC_IN_DETACH)) == + IFC_INIT_DONE) return (EBUSY); return (0); } From owner-dev-commits-src-main@freebsd.org Tue Mar 9 19:50: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 60C7556E351; Tue, 9 Mar 2021 19:50: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 4Dw5Rj2KjWz4sbF; Tue, 9 Mar 2021 19:50: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 42F39217DA; Tue, 9 Mar 2021 19:50: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 129JovmO024365; Tue, 9 Mar 2021 19:50:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 129Jov76024364; Tue, 9 Mar 2021 19:50:57 GMT (envelope-from git) Date: Tue, 9 Mar 2021 19:50:57 GMT Message-Id: <202103091950.129Jov76024364@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: 94dddbfd00b9 - main - if_wg: export tx_bytes, rx_bytes, and last_handshake 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: 94dddbfd00b9d53d1b6a45a58bc87b323cae6791 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, 09 Mar 2021 19:50:57 -0000 The branch main has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=94dddbfd00b9d53d1b6a45a58bc87b323cae6791 commit 94dddbfd00b9d53d1b6a45a58bc87b323cae6791 Author: Kyle Evans AuthorDate: 2021-03-09 10:57:01 +0000 Commit: Kyle Evans CommitDate: 2021-03-09 19:50:41 +0000 if_wg: export tx_bytes, rx_bytes, and last_handshake The names are self-explanatory; these are currently only used by the wg(8) tool, but they are handy data points to have. Reviewed by: grehan MFC after: 3 days Discussed with: decke Differential Revision: https://reviews.freebsd.org/D29143 --- sys/dev/if_wg/module/module.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/sys/dev/if_wg/module/module.c b/sys/dev/if_wg/module/module.c index ad2f17c1e803..4ca1c24b56b9 100644 --- a/sys/dev/if_wg/module/module.c +++ b/sys/dev/if_wg/module/module.c @@ -69,11 +69,19 @@ MALLOC_DEFINE(M_WG, "WG", "wireguard"); TASKQGROUP_DECLARE(if_io_tqg); +struct wg_timespec64 { + uint64_t tv_sec; + uint64_t tv_nsec; +}; + struct wg_peer_export { struct sockaddr_storage endpoint; + struct timespec last_handshake; uint8_t public_key[WG_KEY_SIZE]; size_t endpoint_sz; struct wg_allowedip *aip; + uint64_t rx_bytes; + uint64_t tx_bytes; int aip_count; uint16_t persistent_keepalive; }; @@ -419,6 +427,9 @@ wg_peer_to_export(struct wg_peer *peer, struct wg_peer_export *exp) exp->persistent_keepalive = peer->p_timers.t_persistent_keepalive_interval; + wg_timers_get_last_handshake(&peer->p_timers, &exp->last_handshake); + exp->rx_bytes = counter_u64_fetch(peer->p_rx_bytes); + exp->tx_bytes = counter_u64_fetch(peer->p_tx_bytes); exp->aip_count = 0; CK_LIST_FOREACH(rt, &peer->p_routes, r_entry) { @@ -449,6 +460,7 @@ wg_peer_to_export(struct wg_peer *peer, struct wg_peer_export *exp) static nvlist_t * wg_peer_export_to_nvl(struct wg_peer_export *exp) { + struct wg_timespec64 ts64; nvlist_t *nvl; if ((nvl = nvlist_create(0)) == NULL) @@ -462,10 +474,19 @@ wg_peer_export_to_nvl(struct wg_peer_export *exp) nvlist_add_binary(nvl, "allowed-ips", exp->aip, exp->aip_count * sizeof(*exp->aip)); + ts64.tv_sec = exp->last_handshake.tv_sec; + ts64.tv_nsec = exp->last_handshake.tv_nsec; + nvlist_add_binary(nvl, "last_handshake", &ts64, sizeof(ts64)); + if (exp->persistent_keepalive != 0) nvlist_add_number(nvl, "persistent-keepalive-interval", exp->persistent_keepalive); + if (exp->rx_bytes != 0) + nvlist_add_number(nvl, "rx_bytes", exp->rx_bytes); + if (exp->tx_bytes != 0) + nvlist_add_number(nvl, "tx_bytes", exp->tx_bytes); + return (nvl); } From owner-dev-commits-src-main@freebsd.org Tue Mar 9 20:08: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 3450756EF98; Tue, 9 Mar 2021 20:08: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 4Dw5rN10v4z4tgM; Tue, 9 Mar 2021 20:08: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 157172211E; Tue, 9 Mar 2021 20:08: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 129K8pel043232; Tue, 9 Mar 2021 20:08:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 129K8prR043231; Tue, 9 Mar 2021 20:08:51 GMT (envelope-from git) Date: Tue, 9 Mar 2021 20:08:51 GMT Message-Id: <202103092008.129K8prR043231@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: ebe5cf355dca - main - Implement basic support for allocating memory from a specific numa node in the LinuxKPI. 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: ebe5cf355dca1d7827a70b99a9d9c4f97f78691d 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, 09 Mar 2021 20:08:52 -0000 The branch main has been updated by hselasky: URL: https://cgit.FreeBSD.org/src/commit/?id=ebe5cf355dca1d7827a70b99a9d9c4f97f78691d commit ebe5cf355dca1d7827a70b99a9d9c4f97f78691d Author: Hans Petter Selasky AuthorDate: 2021-03-05 11:44:06 +0000 Commit: Hans Petter Selasky CommitDate: 2021-03-09 20:01:47 +0000 Implement basic support for allocating memory from a specific numa node in the LinuxKPI. Differential Revision: https://reviews.freebsd.org/D29077 Reviewed by: markj@ and kib@ MFC after: 1 week Sponsored by: Mellanox Technologies // NVIDIA Networking --- sys/compat/linuxkpi/common/include/linux/compat.h | 2 + sys/compat/linuxkpi/common/include/linux/device.h | 8 ++- sys/compat/linuxkpi/common/include/linux/slab.h | 37 ++++++++++++-- sys/compat/linuxkpi/common/src/linux_domain.c | 59 +++++++++++++++++++++++ sys/conf/files | 2 + sys/modules/linuxkpi/Makefile | 1 + 6 files changed, 100 insertions(+), 9 deletions(-) diff --git a/sys/compat/linuxkpi/common/include/linux/compat.h b/sys/compat/linuxkpi/common/include/linux/compat.h index 03b7dc60b7a1..84b7b47a36dc 100644 --- a/sys/compat/linuxkpi/common/include/linux/compat.h +++ b/sys/compat/linuxkpi/common/include/linux/compat.h @@ -35,11 +35,13 @@ #include #include +struct domainset; struct thread; struct task_struct; extern int linux_alloc_current(struct thread *, int flags); extern void linux_free_current(struct task_struct *); +extern struct domainset *linux_get_vm_domain_set(int node); static inline void linux_set_current(struct thread *td) diff --git a/sys/compat/linuxkpi/common/include/linux/device.h b/sys/compat/linuxkpi/common/include/linux/device.h index 2ffe70f45c6e..5acaa4142d62 100644 --- a/sys/compat/linuxkpi/common/include/linux/device.h +++ b/sys/compat/linuxkpi/common/include/linux/device.h @@ -554,11 +554,9 @@ class_remove_file(struct class *class, const struct class_attribute *attr) sysfs_remove_file(&class->kobj, &attr->attr); } -static inline int -dev_to_node(struct device *dev) -{ - return -1; -} +#define dev_to_node(dev) linux_dev_to_node(dev) +#define of_node_to_nid(node) -1 +int linux_dev_to_node(struct device *); char *kvasprintf(gfp_t, const char *, va_list); char *kasprintf(gfp_t, const char *, ...); diff --git a/sys/compat/linuxkpi/common/include/linux/slab.h b/sys/compat/linuxkpi/common/include/linux/slab.h index 0cd748b7ecb9..9494d458e87c 100644 --- a/sys/compat/linuxkpi/common/include/linux/slab.h +++ b/sys/compat/linuxkpi/common/include/linux/slab.h @@ -2,7 +2,7 @@ * Copyright (c) 2010 Isilon Systems, Inc. * Copyright (c) 2010 iX Systems, Inc. * Copyright (c) 2010 Panasas, Inc. - * Copyright (c) 2013-2017 Mellanox Technologies, Ltd. + * Copyright (c) 2013-2021 Mellanox Technologies, Ltd. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -38,6 +38,7 @@ #include #include +#include #include #include #include @@ -48,16 +49,15 @@ MALLOC_DECLARE(M_KMALLOC); #define kvzalloc(size, flags) kmalloc(size, (flags) | __GFP_ZERO) #define kvcalloc(n, size, flags) kvmalloc_array(n, size, (flags) | __GFP_ZERO) #define kzalloc(size, flags) kmalloc(size, (flags) | __GFP_ZERO) -#define kzalloc_node(size, flags, node) kmalloc(size, (flags) | __GFP_ZERO) +#define kzalloc_node(size, flags, node) kmalloc_node(size, (flags) | __GFP_ZERO, node) #define kfree_const(ptr) kfree(ptr) #define vzalloc(size) __vmalloc(size, GFP_KERNEL | __GFP_NOWARN | __GFP_ZERO, 0) #define vfree(arg) kfree(arg) #define kvfree(arg) kfree(arg) -#define vmalloc_node(size, node) __vmalloc(size, GFP_KERNEL, 0) +#define vmalloc_node(size, node) __vmalloc_node(size, GFP_KERNEL, node) #define vmalloc_user(size) __vmalloc(size, GFP_KERNEL | __GFP_ZERO, 0) #define vmalloc(size) __vmalloc(size, GFP_KERNEL, 0) #define __kmalloc(...) kmalloc(__VA_ARGS__) -#define kmalloc_node(chunk, flags, n) kmalloc(chunk, flags) /* * Prefix some functions with linux_ to avoid namespace conflict @@ -126,6 +126,13 @@ kmalloc(size_t size, gfp_t flags) return (malloc(size, M_KMALLOC, linux_check_m_flags(flags))); } +static inline void * +kmalloc_node(size_t size, gfp_t flags, int node) +{ + return (malloc_domainset(size, M_KMALLOC, + linux_get_vm_domain_set(node), linux_check_m_flags(flags))); +} + static inline void * kcalloc(size_t n, size_t size, gfp_t flags) { @@ -133,12 +140,27 @@ kcalloc(size_t n, size_t size, gfp_t flags) return (mallocarray(n, size, M_KMALLOC, linux_check_m_flags(flags))); } +static inline void * +kcalloc_node(size_t n, size_t size, gfp_t flags, int node) +{ + flags |= __GFP_ZERO; + return (mallocarray_domainset(n, size, M_KMALLOC, + linux_get_vm_domain_set(node), linux_check_m_flags(flags))); +} + static inline void * __vmalloc(size_t size, gfp_t flags, int other) { return (malloc(size, M_KMALLOC, linux_check_m_flags(flags))); } +static inline void * +__vmalloc_node(size_t size, gfp_t flags, int node) +{ + return (malloc_domainset(size, M_KMALLOC, + linux_get_vm_domain_set(node), linux_check_m_flags(flags))); +} + static inline void * vmalloc_32(size_t size) { @@ -151,6 +173,13 @@ kmalloc_array(size_t n, size_t size, gfp_t flags) return (mallocarray(n, size, M_KMALLOC, linux_check_m_flags(flags))); } +static inline void * +kmalloc_array_node(size_t n, size_t size, gfp_t flags, int node) +{ + return (mallocarray_domainset(n, size, M_KMALLOC, + linux_get_vm_domain_set(node), linux_check_m_flags(flags))); +} + static inline void * kvmalloc_array(size_t n, size_t size, gfp_t flags) { diff --git a/sys/compat/linuxkpi/common/src/linux_domain.c b/sys/compat/linuxkpi/common/src/linux_domain.c new file mode 100644 index 000000000000..acbf8821d42b --- /dev/null +++ b/sys/compat/linuxkpi/common/src/linux_domain.c @@ -0,0 +1,59 @@ +/*- + * Copyright (c) 2021 NVIDIA Networking + * 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. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include + +#include +#include + +struct domainset * +linux_get_vm_domain_set(int node) +{ + KASSERT(node < MAXMEMDOM, ("Invalid VM domain %d", node)); + + if (node < 0) + return (DOMAINSET_RR()); + else + return (DOMAINSET_PREF(node)); +} + +int +linux_dev_to_node(struct device *dev) +{ + int numa_domain; + + if (dev == NULL || dev->bsddev == NULL || + bus_get_domain(dev->bsddev, &numa_domain) != 0) + return (-1); + else + return (numa_domain); +} diff --git a/sys/conf/files b/sys/conf/files index 60b334f75d3f..ea2bd6db4ab0 100644 --- a/sys/conf/files +++ b/sys/conf/files @@ -4565,6 +4565,8 @@ compat/linuxkpi/common/src/linux_devres.c optional compat_linuxkpi \ compile-with "${LINUXKPI_C}" compat/linuxkpi/common/src/linux_dmi.c optional compat_linuxkpi \ compile-with "${LINUXKPI_C}" +compat/linuxkpi/common/src/linux_domain.c optional compat_linuxkpi \ + compile-with "${LINUXKPI_C}" compat/linuxkpi/common/src/linux_firmware.c optional compat_linuxkpi \ compile-with "${LINUXKPI_C}" compat/linuxkpi/common/src/linux_hrtimer.c optional compat_linuxkpi \ diff --git a/sys/modules/linuxkpi/Makefile b/sys/modules/linuxkpi/Makefile index 4274d211b10e..81aa607f1302 100644 --- a/sys/modules/linuxkpi/Makefile +++ b/sys/modules/linuxkpi/Makefile @@ -6,6 +6,7 @@ SRCS= linux_compat.c \ linux_current.c \ linux_devres.c \ linux_dmi.c \ + linux_domain.c \ linux_firmware.c \ linux_hrtimer.c \ linux_idr.c \ From owner-dev-commits-src-main@freebsd.org Tue Mar 9 20:21: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 6444356ECEE; Tue, 9 Mar 2021 20:21: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 4Dw67P2SjHz4vYX; Tue, 9 Mar 2021 20:21: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 4784A222E8; Tue, 9 Mar 2021 20:21: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 129KLr4j067775; Tue, 9 Mar 2021 20:21:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 129KLr9A067774; Tue, 9 Mar 2021 20:21:53 GMT (envelope-from git) Date: Tue, 9 Mar 2021 20:21:53 GMT Message-Id: <202103092021.129KLr9A067774@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: ce53f92e6c81 - main - wg(4): note the persistent-keepalive ifconfig(8) option 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: ce53f92e6c81aebacd265665ef1abc04b63fe124 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, 09 Mar 2021 20:21:53 -0000 The branch main has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=ce53f92e6c81aebacd265665ef1abc04b63fe124 commit ce53f92e6c81aebacd265665ef1abc04b63fe124 Author: Kyle Evans AuthorDate: 2021-03-09 14:50:38 +0000 Commit: Kyle Evans CommitDate: 2021-03-09 20:21:35 +0000 wg(4): note the persistent-keepalive ifconfig(8) option MFC after: 3 days Fixes: b3dac3913dc9 --- share/man/man4/wg.4 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/share/man/man4/wg.4 b/share/man/man4/wg.4 index 760584e3a386..335d3e70b64a 100644 --- a/share/man/man4/wg.4 +++ b/share/man/man4/wg.4 @@ -23,7 +23,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 7, 2021 +.Dd March 9, 2021 .Dt WG 4 .Os .Sh NAME @@ -78,6 +78,8 @@ A list of allowed IP addresses. The IP address of the WiredGuard to connect to. .It Cm peer-list A list of peering IP addresses to connect to. +.It Cm persistent-keepalive +Interval, in seconds, at which to send persistent keepalive packets. .El .Pp The From owner-dev-commits-src-main@freebsd.org Wed Mar 10 09:52:28 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 1492A5AB522; Wed, 10 Mar 2021 09:52:28 +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 4DwS6h041cz4n9m; Wed, 10 Mar 2021 09:52: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 E95015178; Wed, 10 Mar 2021 09:52: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 12A9qRl4040118; Wed, 10 Mar 2021 09:52:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 12A9qRKR040117; Wed, 10 Mar 2021 09:52:27 GMT (envelope-from git) Date: Wed, 10 Mar 2021 09:52:27 GMT Message-Id: <202103100952.12A9qRKR040117@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: d1cbe7908986 - main - Allocating the LinuxKPI current structure from an interrupt thread must be done using the M_NOWAIT flag after 1ae20f7c70ea . 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: d1cbe79089868226625c12ef49f51214d79aa427 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, 10 Mar 2021 09:52:28 -0000 The branch main has been updated by hselasky: URL: https://cgit.FreeBSD.org/src/commit/?id=d1cbe79089868226625c12ef49f51214d79aa427 commit d1cbe79089868226625c12ef49f51214d79aa427 Author: Hans Petter Selasky AuthorDate: 2021-03-10 09:50:01 +0000 Commit: Hans Petter Selasky CommitDate: 2021-03-10 09:51:04 +0000 Allocating the LinuxKPI current structure from an interrupt thread must be done using the M_NOWAIT flag after 1ae20f7c70ea . MFC after: 1 week Sponsored by: Mellanox Technologies // NVIDIA Networking --- sys/compat/linuxkpi/common/src/linux_compat.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/compat/linuxkpi/common/src/linux_compat.c b/sys/compat/linuxkpi/common/src/linux_compat.c index 2ad936311204..707c5e47512e 100644 --- a/sys/compat/linuxkpi/common/src/linux_compat.c +++ b/sys/compat/linuxkpi/common/src/linux_compat.c @@ -2384,7 +2384,8 @@ linux_irq_handler(void *ent) { struct irq_ent *irqe; - linux_set_current(curthread); + if (linux_set_current_flags(curthread, M_NOWAIT)) + return; irqe = ent; irqe->handler(irqe->irq, irqe->arg); From owner-dev-commits-src-main@freebsd.org Wed Mar 10 10:04: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 2BE255ABBCB; Wed, 10 Mar 2021 10:04:59 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (turbocat.net [88.99.82.50]) (using TLSv1.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 4DwSP66sczz4p1T; Wed, 10 Mar 2021 10:04:58 +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)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id EF803260185; Wed, 10 Mar 2021 11:04:56 +0100 (CET) Subject: Re: git: 1ae20f7c70ea - main - kern: malloc: fix panic on M_WAITOK during THREAD_NO_SLEEPING() To: John Baldwin , Kyle Evans , src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org References: <202103091117.129BHOZa042851@gitrepo.freebsd.org> <3d67f7e4-c1fc-ca2c-8fc5-417dcf8e4145@FreeBSD.org> From: Hans Petter Selasky Message-ID: <4a923ee1-64a0-93ab-1e73-ff164d690bfc@selasky.org> Date: Wed, 10 Mar 2021 11:04:41 +0100 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:78.0) Gecko/20100101 Thunderbird/78.5.0 MIME-Version: 1.0 In-Reply-To: <3d67f7e4-c1fc-ca2c-8fc5-417dcf8e4145@FreeBSD.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4DwSP66sczz4p1T 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, 10 Mar 2021 10:04:59 -0000 On 3/9/21 6:33 PM, John Baldwin wrote: > On 3/9/21 3:17 AM, Kyle Evans wrote: >> The branch main has been updated by kevans: >> >> URL: >> https://cgit.FreeBSD.org/src/commit/?id=1ae20f7c70ea16fa8b702e409030e170df4f5c13 >> >> >> commit 1ae20f7c70ea16fa8b702e409030e170df4f5c13 >> Author:     Kyle Evans >> AuthorDate: 2021-03-08 06:16:27 +0000 >> Commit:     Kyle Evans >> CommitDate: 2021-03-09 11:16:39 +0000 >> >>      kern: malloc: fix panic on M_WAITOK during THREAD_NO_SLEEPING() >>      Simple condition flip; we wanted to panic here after >> epoch_trace_list(). >>      Reviewed by:    glebius, markj >>      MFC after:      3 days >>      Differential Revision:  https://reviews.freebsd.org/D29125 >> --- >>   sys/kern/kern_malloc.c | 2 +- >>   1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git a/sys/kern/kern_malloc.c b/sys/kern/kern_malloc.c >> index 48383358e3ad..0d6f9dcfcab7 100644 >> --- a/sys/kern/kern_malloc.c >> +++ b/sys/kern/kern_malloc.c >> @@ -537,7 +537,7 @@ malloc_dbg(caddr_t *vap, size_t *sizep, struct >> malloc_type *mtp, >>   #ifdef EPOCH_TRACE >>               epoch_trace_list(curthread); >>   #endif >> -            KASSERT(1, >> +            KASSERT(0, >>                   ("malloc(M_WAITOK) with sleeping prohibited")); > > I would perhaps just use panic() directly under INVARIANTS instead of > KASSERT(false, ...) > > Either that or duplicate the condition and let the compiler deal with > avoiding checking > it twice, e.g.: > > #ifdef EPOCH_TRACE >      if (!THREAD_CAN_SLEEP()) >          epoc_trace_list(curthread); > #endif >      KASSERT(THREAD_CAN_SLEEP(), ("malloc(M_WAITOK) with sleeping > prohibited")); > Hi, Maybe the KASSERT() can just be a regular warning with backtrace. malloc() doesn't sleep unless there is no memory, would give developers more time to fix their bugs. --HPS From owner-dev-commits-src-main@freebsd.org Wed Mar 10 10:05:04 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 1B4095AB8D1; Wed, 10 Mar 2021 10:05:04 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.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 4DwSPC34Vkz4nsl; Wed, 10 Mar 2021 10:05:03 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.16.1/8.16.1) with ESMTPS id 12AA4nxN037623 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Wed, 10 Mar 2021 12:04:52 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua 12AA4nxN037623 Received: (from kostik@localhost) by tom.home (8.16.1/8.16.1/Submit) id 12AA4niK037622; Wed, 10 Mar 2021 12:04:49 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Wed, 10 Mar 2021 12:04:49 +0200 From: Konstantin Belousov To: Hans Petter Selasky Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: d1cbe7908986 - main - Allocating the LinuxKPI current structure from an interrupt thread must be done using the M_NOWAIT flag after 1ae20f7c70ea . Message-ID: References: <202103100952.12A9qRKR040117@gitrepo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202103100952.12A9qRKR040117@gitrepo.freebsd.org> X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on tom.home X-Rspamd-Queue-Id: 4DwSPC34Vkz4nsl 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, 10 Mar 2021 10:05:04 -0000 On Wed, Mar 10, 2021 at 09:52:27AM +0000, Hans Petter Selasky wrote: > The branch main has been updated by hselasky: > > URL: https://cgit.FreeBSD.org/src/commit/?id=d1cbe79089868226625c12ef49f51214d79aa427 > > commit d1cbe79089868226625c12ef49f51214d79aa427 > Author: Hans Petter Selasky > AuthorDate: 2021-03-10 09:50:01 +0000 > Commit: Hans Petter Selasky > CommitDate: 2021-03-10 09:51:04 +0000 > > Allocating the LinuxKPI current structure from an interrupt thread must be > done using the M_NOWAIT flag after 1ae20f7c70ea . > > MFC after: 1 week > Sponsored by: Mellanox Technologies // NVIDIA Networking > --- > sys/compat/linuxkpi/common/src/linux_compat.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/sys/compat/linuxkpi/common/src/linux_compat.c b/sys/compat/linuxkpi/common/src/linux_compat.c > index 2ad936311204..707c5e47512e 100644 > --- a/sys/compat/linuxkpi/common/src/linux_compat.c > +++ b/sys/compat/linuxkpi/common/src/linux_compat.c > @@ -2384,7 +2384,8 @@ linux_irq_handler(void *ent) > { > struct irq_ent *irqe; > > - linux_set_current(curthread); > + if (linux_set_current_flags(curthread, M_NOWAIT)) > + return; > > irqe = ent; > irqe->handler(irqe->irq, irqe->arg); This probably hangs machine instead of panicing. In low memory condition, you do not handle interrupt, which probably mean that the source is not silenced, and after EOI the same interrupt will be generated again. From owner-dev-commits-src-main@freebsd.org Wed Mar 10 10:09: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 B8B115ABCF9; Wed, 10 Mar 2021 10:09:43 +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 4DwSVb4Kkvz4pVc; Wed, 10 Mar 2021 10:09:43 +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)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 8967A260185; Wed, 10 Mar 2021 11:09:39 +0100 (CET) Subject: Re: git: d1cbe7908986 - main - Allocating the LinuxKPI current structure from an interrupt thread must be done using the M_NOWAIT flag after 1ae20f7c70ea . To: Konstantin Belousov Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org References: <202103100952.12A9qRKR040117@gitrepo.freebsd.org> From: Hans Petter Selasky Message-ID: <2b1739ab-000c-ca28-5a59-0a3e19ef4591@selasky.org> Date: Wed, 10 Mar 2021 11:09:23 +0100 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:78.0) Gecko/20100101 Thunderbird/78.5.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4DwSVb4Kkvz4pVc 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, 10 Mar 2021 10:09:43 -0000 On 3/10/21 11:04 AM, Konstantin Belousov wrote: > This probably hangs machine instead of panicing. In low memory condition, > you do not handle interrupt, which probably mean that the source is not > silenced, and after EOI the same interrupt will be generated again. Hi, This usually happens during boot. Another possibility is to panic() there. I don't see so many options. --HPS From owner-dev-commits-src-main@freebsd.org Wed Mar 10 11:54: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 195725AE322; Wed, 10 Mar 2021 11:54: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 4DwVqT0Cftz3C95; Wed, 10 Mar 2021 11:54: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 EE56A6E88; Wed, 10 Mar 2021 11:54: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 12ABsSlG098214; Wed, 10 Mar 2021 11:54:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 12ABsSR0098213; Wed, 10 Mar 2021 11:54:28 GMT (envelope-from git) Date: Wed, 10 Mar 2021 11:54:28 GMT Message-Id: <202103101154.12ABsSR0098213@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: 6eb60f5b7f7d - main - Use the word "LinuxKPI" instead of "Linux compatibility", to not confuse with user-space Linux compatibility support. No functional change. 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: 6eb60f5b7f7df1a59de139260aebfa0aa5f6d79e 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, 10 Mar 2021 11:54:29 -0000 The branch main has been updated by hselasky: URL: https://cgit.FreeBSD.org/src/commit/?id=6eb60f5b7f7df1a59de139260aebfa0aa5f6d79e commit 6eb60f5b7f7df1a59de139260aebfa0aa5f6d79e Author: Hans Petter Selasky AuthorDate: 2021-03-10 11:21:01 +0000 Commit: Hans Petter Selasky CommitDate: 2021-03-10 11:35:16 +0000 Use the word "LinuxKPI" instead of "Linux compatibility", to not confuse with user-space Linux compatibility support. No functional change. MFC after: 1 week Sponsored by: Mellanox Technologies // NVIDIA Networking --- sys/kern/kern_intr.c | 4 ++-- sys/sys/interrupt.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/kern/kern_intr.c b/sys/kern/kern_intr.c index af7c52c6b176..afaf8466a1df 100644 --- a/sys/kern/kern_intr.c +++ b/sys/kern/kern_intr.c @@ -783,8 +783,8 @@ intr_handler_barrier(struct intr_handler *handler) * Sleep until an ithread finishes executing an interrupt handler. * * XXX Doesn't currently handle interrupt filters or fast interrupt - * handlers. This is intended for compatibility with linux drivers - * only. Do not use in BSD code. + * handlers. This is intended for LinuxKPI drivers only. + * Do not use in BSD code. */ void _intr_drain(int irq) diff --git a/sys/sys/interrupt.h b/sys/sys/interrupt.h index f1770fe64b0b..56952e45fe75 100644 --- a/sys/sys/interrupt.h +++ b/sys/sys/interrupt.h @@ -190,7 +190,7 @@ int intr_event_resume_handler(void *cookie); int intr_getaffinity(int irq, int mode, void *mask); void *intr_handler_source(void *cookie); int intr_setaffinity(int irq, int mode, void *mask); -void _intr_drain(int irq); /* Linux compat only. */ +void _intr_drain(int irq); /* LinuxKPI only. */ int swi_add(struct intr_event **eventp, const char *name, driver_intr_t handler, void *arg, int pri, enum intr_type flags, void **cookiep); From owner-dev-commits-src-main@freebsd.org Wed Mar 10 11:57: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 E6BC15AE4B8; Wed, 10 Mar 2021 11:57:46 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: from mail-lj1-x235.google.com (mail-lj1-x235.google.com [IPv6:2a00:1450:4864:20::235]) (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 4DwVvG27Hpz3CPp; Wed, 10 Mar 2021 11:57:46 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: by mail-lj1-x235.google.com with SMTP id a17so25248419ljq.2; Wed, 10 Mar 2021 03:57:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=RTLQArsi/Hl0m7yp8cFzanZ4mLDILxLOMNivZaabkZM=; b=qbRy7xBn6BgVKipWSJw0tWmkm+yRy+6EoftBU9z8Q1GIZ4JRo4AjIQPy4izArHouIz sGn5HZrJcr8kUlATlncnu5TNM9mWFYNJYgvneesOL5ygWXcbkGBZEtYlqNUwB3T0MOzl EKpcaFJEP4PPBkM8wzxONl2urzEvo6FxBT7Bf9zy9SWISEiPE6mqaL1Dfw5Qkzjdr7Kb 7opsdw+3ik+kkCia3765JgvSuwO23Zd8t5vVzZ9x541Ba9Wd+W31BLaGNjosw8rwLD1J /BGzkNeZGAPB1DWHWMDUKu/7ZOXogqn66EOXbTjO5PG8jk2VCq3NgSCwBpnJGu7HMGgO BbGQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=RTLQArsi/Hl0m7yp8cFzanZ4mLDILxLOMNivZaabkZM=; b=m78GFEIt6bIb+dvK/EqAgTyS8/ov4uDrrh+w+NIK+V06qBxmO+oJiaSBMC4CwuAZKn wKaTOW+QIjvtbjrIy+fJ+kKzmItCQ0DibqmPPKITA4tfRlnh8P0FPb47+QICvktLwykt eB8/yrY7a/0cer6r/ZW+p2quTz9Smw8cZajNe29Htn/wvPyYwWhZ78Iyf6wY4RD/TRsj oxjNo162zPylx6OgWh9aoPsCT4Gcha651/Q+n6sAXjEpOOfOJ6G/K7FdxGExo3Pw2O2d APkgfbomNYyUR+Jjyoyi/cQiBoNvXQqUs5dbqg2n9eusftsYtIZ+kFVTo69ADkmBcu8x eDxw== X-Gm-Message-State: AOAM530zSA7DOVooYVF54nAAMC5isQHbYlOzsCqIV4fPNJpg3DiQ+aEr /hU/cdxYYlbkmRp66cYAsq1fBlkKpreQm5OHE3i9fqRnlVw= X-Google-Smtp-Source: ABdhPJwC0+GmcxhlaFtb7Nng99Jh68g0RfBT4wMNoT0eCS7yfYKxAV4qCce3iSSFmu5zQF/aRnl7t/167YGaxhGlq+E= X-Received: by 2002:a2e:9b14:: with SMTP id u20mr1598050lji.463.1615377464661; Wed, 10 Mar 2021 03:57:44 -0800 (PST) MIME-Version: 1.0 Received: by 2002:a2e:b54e:0:0:0:0:0 with HTTP; Wed, 10 Mar 2021 03:57:44 -0800 (PST) In-Reply-To: <202103091117.129BHOZa042851@gitrepo.freebsd.org> References: <202103091117.129BHOZa042851@gitrepo.freebsd.org> From: Mateusz Guzik Date: Wed, 10 Mar 2021 12:57:44 +0100 Message-ID: Subject: Re: git: 1ae20f7c70ea - main - kern: malloc: fix panic on M_WAITOK during THREAD_NO_SLEEPING() To: Kyle Evans Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 4DwVvG27Hpz3CPp X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=qbRy7xBn; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of mjguzik@gmail.com designates 2a00:1450:4864:20::235 as permitted sender) smtp.mailfrom=mjguzik@gmail.com X-Spamd-Result: default: False [-3.52 / 15.00]; RCVD_TLS_ALL(0.00)[]; ARC_NA(0.00)[]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; FREEMAIL_FROM(0.00)[gmail.com]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; R_SPF_ALLOW(-0.20)[+ip6:2a00:1450:4000::/36]; RBL_DBL_DONT_QUERY_IPS(0.00)[2a00:1450:4864:20::235:from]; TO_DN_SOME(0.00)[]; SPAMHAUS_ZRD(0.00)[2a00:1450:4864:20::235:from:127.0.2.255]; DKIM_TRACE(0.00)[gmail.com:+]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; RCVD_IN_DNSWL_NONE(0.00)[2a00:1450:4864:20::235:from]; NEURAL_HAM_SHORT(-0.52)[-0.515]; NEURAL_HAM_LONG(-1.00)[-1.000]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US]; RCVD_COUNT_TWO(0.00)[2]; MAILMAN_DEST(0.00)[dev-commits-src-all,dev-commits-src-main]; DWL_DNSWL_NONE(0.00)[gmail.com:dkim] 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, 10 Mar 2021 11:57:47 -0000 There is something very wrong going on here. Key thing to note is that malloc is ultimately a wrapper around uma_zalloc. Whatever asserts you may want to add to malloc to catch problems sooner, should also present in uma. uma has the following: if (flags & M_WAITOK) { WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, NULL, "uma_zalloc_debug: zone \"%s\"", zone->uz_name); } This code used to execute prior to this commit and fail to catch the problems which got reported already. In other words: - WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK is incomplete in terms of internals its internals - the above should be in malloc, perhaps after being abstracted into a an assert-helper - fixing witness deficiency will probably find a slew of new problems - this should remain as a warning (maybe rate-limited) for the foreseable future On 3/9/21, Kyle Evans wrote: > The branch main has been updated by kevans: > > URL: > https://cgit.FreeBSD.org/src/commit/?id=1ae20f7c70ea16fa8b702e409030e170df4f5c13 > > commit 1ae20f7c70ea16fa8b702e409030e170df4f5c13 > Author: Kyle Evans > AuthorDate: 2021-03-08 06:16:27 +0000 > Commit: Kyle Evans > CommitDate: 2021-03-09 11:16:39 +0000 > > kern: malloc: fix panic on M_WAITOK during THREAD_NO_SLEEPING() > > Simple condition flip; we wanted to panic here after > epoch_trace_list(). > > Reviewed by: glebius, markj > MFC after: 3 days > Differential Revision: https://reviews.freebsd.org/D29125 > --- > sys/kern/kern_malloc.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/sys/kern/kern_malloc.c b/sys/kern/kern_malloc.c > index 48383358e3ad..0d6f9dcfcab7 100644 > --- a/sys/kern/kern_malloc.c > +++ b/sys/kern/kern_malloc.c > @@ -537,7 +537,7 @@ malloc_dbg(caddr_t *vap, size_t *sizep, struct > malloc_type *mtp, > #ifdef EPOCH_TRACE > epoch_trace_list(curthread); > #endif > - KASSERT(1, > + KASSERT(0, > ("malloc(M_WAITOK) with sleeping prohibited")); > } > } > -- Mateusz Guzik From owner-dev-commits-src-main@freebsd.org Wed Mar 10 12:31: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 1E3855AF4B7; Wed, 10 Mar 2021 12:31: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 4DwWdr0Q6gz3F3n; Wed, 10 Mar 2021 12:31: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 0155A7606; Wed, 10 Mar 2021 12:31: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 12ACVBOe048175; Wed, 10 Mar 2021 12:31:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 12ACVBXA048161; Wed, 10 Mar 2021 12:31:11 GMT (envelope-from git) Date: Wed, 10 Mar 2021 12:31:11 GMT Message-Id: <202103101231.12ACVBXA048161@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: dfb33cb0ef48 - main - Allocating the LinuxKPI current structure from a software interrupt thread must be done using the M_NOWAIT flag after 1ae20f7c70ea . 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: dfb33cb0ef48084da84072244e8ca486dfcf3a96 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, 10 Mar 2021 12:31:12 -0000 The branch main has been updated by hselasky: URL: https://cgit.FreeBSD.org/src/commit/?id=dfb33cb0ef48084da84072244e8ca486dfcf3a96 commit dfb33cb0ef48084da84072244e8ca486dfcf3a96 Author: Hans Petter Selasky AuthorDate: 2021-03-10 12:26:09 +0000 Commit: Hans Petter Selasky CommitDate: 2021-03-10 12:27:40 +0000 Allocating the LinuxKPI current structure from a software interrupt thread must be done using the M_NOWAIT flag after 1ae20f7c70ea . MFC after: 1 week Sponsored by: Mellanox Technologies // NVIDIA Networking --- sys/compat/linuxkpi/common/src/linux_compat.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/sys/compat/linuxkpi/common/src/linux_compat.c b/sys/compat/linuxkpi/common/src/linux_compat.c index 707c5e47512e..5f7e2664bee1 100644 --- a/sys/compat/linuxkpi/common/src/linux_compat.c +++ b/sys/compat/linuxkpi/common/src/linux_compat.c @@ -1913,9 +1913,15 @@ linux_timer_callback_wrapper(void *context) { struct timer_list *timer; - linux_set_current(curthread); - timer = context; + + if (linux_set_current_flags(curthread, M_NOWAIT)) { + /* try again later */ + callout_reset(&timer->callout, 1, + &linux_timer_callback_wrapper, timer); + return; + } + timer->function(timer->data); } From owner-dev-commits-src-main@freebsd.org Wed Mar 10 12:45: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 68F505AFC1D; Wed, 10 Mar 2021 12:45: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 4DwWy92ZTtz3GMM; Wed, 10 Mar 2021 12:45: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 4B35074D8; Wed, 10 Mar 2021 12:45: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 12ACjLkK064811; Wed, 10 Mar 2021 12:45:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 12ACjLn7064810; Wed, 10 Mar 2021 12:45:21 GMT (envelope-from git) Date: Wed, 10 Mar 2021 12:45:21 GMT Message-Id: <202103101245.12ACjLn7064810@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alex Richardson Subject: git: 953a7d7c61f3 - main - Arch64: Clear VFP state on execve() MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: arichardson X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 953a7d7c61f3b2f5351dfe668510ec782ae282e8 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, 10 Mar 2021 12:45:21 -0000 The branch main has been updated by arichardson: URL: https://cgit.FreeBSD.org/src/commit/?id=953a7d7c61f3b2f5351dfe668510ec782ae282e8 commit 953a7d7c61f3b2f5351dfe668510ec782ae282e8 Author: Alex Richardson AuthorDate: 2021-03-09 19:11:40 +0000 Commit: Alex Richardson CommitDate: 2021-03-10 12:44:42 +0000 Arch64: Clear VFP state on execve() I noticed that many of the math-related tests were failing on AArch64. After a lot of debugging, I noticed that the floating point exception flags were not being reset when starting a new process. This change resets the VFP inside exec_setregs() to ensure no VFP register state is leaked from parent processes to children. This commit also moves the clearing of fpcr that was added in 65618fdda0f27 from fork() to execve() since that makes more sense: fork() can retain current register values, but execve() should result in a well-defined clean state. Reviewed By: andrew MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D29060 --- sys/arm64/arm64/elf32_machdep.c | 7 +++++++ sys/arm64/arm64/machdep.c | 7 +++++++ sys/arm64/arm64/vfp.c | 21 +++++++++++++++++++++ sys/arm64/arm64/vm_machdep.c | 1 - sys/arm64/include/vfp.h | 1 + sys/arm64/linux/linux_sysvec.c | 8 ++++++++ 6 files changed, 44 insertions(+), 1 deletion(-) diff --git a/sys/arm64/arm64/elf32_machdep.c b/sys/arm64/arm64/elf32_machdep.c index 916633650d69..84b62caf8590 100644 --- a/sys/arm64/arm64/elf32_machdep.c +++ b/sys/arm64/arm64/elf32_machdep.c @@ -51,6 +51,9 @@ __FBSDID("$FreeBSD$"); #include #include +#ifdef VFP +#include +#endif #include @@ -251,6 +254,10 @@ freebsd32_setregs(struct thread *td, struct image_params *imgp, tf->tf_x[14] = imgp->entry_addr; tf->tf_elr = imgp->entry_addr; tf->tf_spsr = PSR_M_32; + +#ifdef VFP + vfp_reset_state(td, td->td_pcb); +#endif } void diff --git a/sys/arm64/arm64/machdep.c b/sys/arm64/arm64/machdep.c index 73b06beeba7e..91f0a31ebe36 100644 --- a/sys/arm64/arm64/machdep.c +++ b/sys/arm64/arm64/machdep.c @@ -552,6 +552,7 @@ void exec_setregs(struct thread *td, struct image_params *imgp, uintptr_t stack) { struct trapframe *tf = td->td_frame; + struct pcb *pcb = td->td_pcb; memset(tf, 0, sizeof(struct trapframe)); @@ -559,6 +560,12 @@ exec_setregs(struct thread *td, struct image_params *imgp, uintptr_t stack) tf->tf_sp = STACKALIGN(stack); tf->tf_lr = imgp->entry_addr; tf->tf_elr = imgp->entry_addr; + +#ifdef VFP + vfp_reset_state(td, pcb); +#endif + + /* TODO: Shouldn't we also reset pcb_dbg_regs? */ } /* Sanity check these are the same size, they will be memcpy'd to and fro */ diff --git a/sys/arm64/arm64/vfp.c b/sys/arm64/arm64/vfp.c index 23c782c6dccb..5fa420e668c1 100644 --- a/sys/arm64/arm64/vfp.c +++ b/sys/arm64/arm64/vfp.c @@ -33,6 +33,7 @@ __FBSDID("$FreeBSD$"); #ifdef VFP #include #include +#include #include #include #include @@ -199,6 +200,26 @@ vfp_save_state(struct thread *td, struct pcb *pcb) critical_exit(); } +/* + * Reset the FP state to avoid leaking state from the parent process across + * execve() (and to ensure that we get a consistent floating point environment + * in every new process). + */ +void +vfp_reset_state(struct thread *td, struct pcb *pcb) +{ + critical_enter(); + bzero(&pcb->pcb_fpustate.vfp_regs, sizeof(pcb->pcb_fpustate.vfp_regs)); + KASSERT(pcb->pcb_fpusaved == &pcb->pcb_fpustate, + ("pcb_fpusaved should point to pcb_fpustate.")); + pcb->pcb_fpustate.vfp_fpcr = initial_fpcr; + pcb->pcb_fpustate.vfp_fpsr = 0; + pcb->pcb_vfpcpu = UINT_MAX; + pcb->pcb_fpflags = 0; + vfp_discard(td); + critical_exit(); +} + void vfp_restore_state(void) { diff --git a/sys/arm64/arm64/vm_machdep.c b/sys/arm64/arm64/vm_machdep.c index 9a496b40ec98..0193048e2697 100644 --- a/sys/arm64/arm64/vm_machdep.c +++ b/sys/arm64/arm64/vm_machdep.c @@ -108,7 +108,6 @@ cpu_fork(struct thread *td1, struct proc *p2, struct thread *td2, int flags) td2->td_pcb->pcb_sp = (uintptr_t)td2->td_frame; td2->td_pcb->pcb_fpusaved = &td2->td_pcb->pcb_fpustate; td2->td_pcb->pcb_vfpcpu = UINT_MAX; - td2->td_pcb->pcb_fpusaved->vfp_fpcr = initial_fpcr; /* Setup to release spin count in fork_exit(). */ td2->td_md.md_spinlock_count = 1; diff --git a/sys/arm64/include/vfp.h b/sys/arm64/include/vfp.h index b0ba01a2a319..3632e5eaa396 100644 --- a/sys/arm64/include/vfp.h +++ b/sys/arm64/include/vfp.h @@ -68,6 +68,7 @@ struct thread; void vfp_init(void); void vfp_discard(struct thread *); +void vfp_reset_state(struct thread *, struct pcb *); void vfp_restore_state(void); void vfp_save_state(struct thread *, struct pcb *); diff --git a/sys/arm64/linux/linux_sysvec.c b/sys/arm64/linux/linux_sysvec.c index 1d628ffe6ecb..67feacfa876b 100644 --- a/sys/arm64/linux/linux_sysvec.c +++ b/sys/arm64/linux/linux_sysvec.c @@ -57,6 +57,10 @@ __FBSDID("$FreeBSD$"); #include #include +#ifdef VFP +#include +#endif + MODULE_VERSION(linux64elf, 1); const char *linux_kplatform; @@ -360,6 +364,10 @@ linux_exec_setregs(struct thread *td, struct image_params *imgp, regs->tf_lr = 0xffffffffffffffff; #endif regs->tf_elr = imgp->entry_addr; + +#ifdef VFP + vfp_reset_state(td, td->td_pcb); +#endif } int From owner-dev-commits-src-main@freebsd.org Wed Mar 10 15:06: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 6B1C656B946; Wed, 10 Mar 2021 15:06: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 4Dwb4n2brvz3hYB; Wed, 10 Mar 2021 15:06: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 4BE9B11647; Wed, 10 Mar 2021 15:06: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 12AF6Hkb050419; Wed, 10 Mar 2021 15:06:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 12AF6Hmd050418; Wed, 10 Mar 2021 15:06:17 GMT (envelope-from git) Date: Wed, 10 Mar 2021 15:06:17 GMT Message-Id: <202103101506.12AF6Hmd050418@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: 7e7f7beee732 - main - ns8250: don't drop IER_TXRDY on bus_grab/ungrab 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: 7e7f7beee732810d3afcc83828341ac3e139b5bd 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, 10 Mar 2021 15:06:17 -0000 The branch main has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=7e7f7beee732810d3afcc83828341ac3e139b5bd commit 7e7f7beee732810d3afcc83828341ac3e139b5bd Author: Mitchell Horne AuthorDate: 2021-03-10 14:57:12 +0000 Commit: Mitchell Horne CommitDate: 2021-03-10 15:04:42 +0000 ns8250: don't drop IER_TXRDY on bus_grab/ungrab It has been observed that some systems are often unable to resume from ddb after entering with debug.kdb.enter=1. Checking the status further shows the terminal is blocked waiting in tty_drain(), but it never makes progress in clearing the output queue, because sc->sc_txbusy is high. I noticed that when entering polling mode for the debugger, IER_TXRDY is set in the failure case. Since this bit is never tracked by the softc, it will not be restored by ns8250_bus_ungrab(). This creates a race in which a TX interrupt can be lost, creating the hang described above. Ensuring that this bit is restored is enough to prevent this, and resume from ddb as expected. The solution is to track this bit in the sc->ier field, for the same lifetime that TX interrupts are enabled. PR: 223917, 240122 Reviewed by: imp, manu Tested by: bz MFC after: 5 days Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D29130 --- sys/dev/uart/uart_dev_ns8250.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sys/dev/uart/uart_dev_ns8250.c b/sys/dev/uart/uart_dev_ns8250.c index d920a76ae275..45b4d315c3d5 100644 --- a/sys/dev/uart/uart_dev_ns8250.c +++ b/sys/dev/uart/uart_dev_ns8250.c @@ -738,6 +738,7 @@ ns8250_bus_ipend(struct uart_softc *sc) } else { if (iir & IIR_TXRDY) { ipend |= SER_INT_TXIDLE; + ns8250->ier &= ~IER_ETXRDY; uart_setreg(bas, REG_IER, ns8250->ier); uart_barrier(bas); } else @@ -1035,7 +1036,9 @@ ns8250_bus_transmit(struct uart_softc *sc) uart_setreg(bas, REG_DATA, sc->sc_txbuf[i]); uart_barrier(bas); } - uart_setreg(bas, REG_IER, ns8250->ier | IER_ETXRDY); + if (!broken_txfifo) + ns8250->ier |= IER_ETXRDY; + uart_setreg(bas, REG_IER, ns8250->ier); uart_barrier(bas); if (broken_txfifo) ns8250_drain(bas, UART_DRAIN_TRANSMITTER); From owner-dev-commits-src-main@freebsd.org Wed Mar 10 15:53: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 B06DA56F78E; Wed, 10 Mar 2021 15: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 4Dwc7T4bPRz3m1J; Wed, 10 Mar 2021 15: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 9066812141; Wed, 10 Mar 2021 15:53: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 12AFrfW0015590; Wed, 10 Mar 2021 15:53:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 12AFrfHB015589; Wed, 10 Mar 2021 15:53:41 GMT (envelope-from git) Date: Wed, 10 Mar 2021 15:53:41 GMT Message-Id: <202103101553.12AFrfHB015589@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dag-Erling Smørgrav Subject: git: e5f02c140bf1 - main - Fix local-unbound setup for some IPv6 deployments. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e5f02c140bf1e519a95bd6331382e8a2a1b6219f 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, 10 Mar 2021 15:53:41 -0000 The branch main has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=e5f02c140bf1e519a95bd6331382e8a2a1b6219f commit e5f02c140bf1e519a95bd6331382e8a2a1b6219f Author: Dag-Erling Smørgrav AuthorDate: 2021-03-10 14:01:38 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2021-03-10 15:53:22 +0000 Fix local-unbound setup for some IPv6 deployments. PR: 250984 MFC after: 1 week --- usr.sbin/unbound/setup/local-unbound-setup.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.sbin/unbound/setup/local-unbound-setup.sh b/usr.sbin/unbound/setup/local-unbound-setup.sh index c51145cf2312..3be78339b0ba 100755 --- a/usr.sbin/unbound/setup/local-unbound-setup.sh +++ b/usr.sbin/unbound/setup/local-unbound-setup.sh @@ -66,7 +66,7 @@ bkext=$(date "+%Y%m%d.%H%M%S") RE_octet="([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])" RE_ipv4="(${RE_octet}(\\.${RE_octet}){3})" RE_word="([0-9A-Fa-f]{1,4})" -RE_ipv6="((${RE_word}:){1,}(:|(:${RE_word})*)|::1)" +RE_ipv6="((${RE_word}:){1,}(:|${RE_word}?(:${RE_word})*)|::1)" RE_port="([1-9][0-9]{0,3}|[1-5][0-9]{4,4}|6([0-4][0-9]{3}|5([0-4][0-9]{2}|5([0-2][0-9]|3[0-5]))))" RE_dnsname="([0-9A-Za-z-]{1,}(\\.[0-9A-Za-z-]{1,})*\\.?)" RE_forward_addr="((${RE_ipv4}|${RE_ipv6})(@${RE_port})?)" From owner-dev-commits-src-main@freebsd.org Wed Mar 10 15:53: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 DAB1356F80A; Wed, 10 Mar 2021 15:53: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 4Dwc7V5sKdz3ls3; Wed, 10 Mar 2021 15:53: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 BBEC2122DF; Wed, 10 Mar 2021 15:53: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 12AFrg0d015608; Wed, 10 Mar 2021 15:53:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 12AFrgIl015607; Wed, 10 Mar 2021 15:53:42 GMT (envelope-from git) Date: Wed, 10 Mar 2021 15:53:42 GMT Message-Id: <202103101553.12AFrgIl015607@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dag-Erling Smørgrav Subject: git: 409388cfac49 - main - Fix post-start check when unbound.conf has moved. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 409388cfac49a312034e9397c870e3f81ff90734 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, 10 Mar 2021 15:53:42 -0000 The branch main has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=409388cfac49a312034e9397c870e3f81ff90734 commit 409388cfac49a312034e9397c870e3f81ff90734 Author: Dag-Erling Smørgrav AuthorDate: 2021-03-10 14:18:59 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2021-03-10 15:53:25 +0000 Fix post-start check when unbound.conf has moved. Reported by: phk@ MFC after: 1 week --- libexec/rc/rc.d/local_unbound | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libexec/rc/rc.d/local_unbound b/libexec/rc/rc.d/local_unbound index 858ef56dbc0d..19cb9a6c5c01 100755 --- a/libexec/rc/rc.d/local_unbound +++ b/libexec/rc/rc.d/local_unbound @@ -106,7 +106,7 @@ local_unbound_poststart() local retry=5 echo -n "Waiting for nameserver to start..." - until "${command}-control" status | grep -q "is running" ; do + until "${command}-control" -c "${local_unbound_config}" status | grep -q "is running" ; do if [ $((retry -= 1)) -eq 0 ] ; then echo " giving up" return 1 From owner-dev-commits-src-main@freebsd.org Wed Mar 10 17:29: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 DEA48571574; Wed, 10 Mar 2021 17:29:53 +0000 (UTC) (envelope-from jhb@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 4DwfGT5yTKz3slb; Wed, 10 Mar 2021 17:29:53 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro.local (ralph.baldwin.cx [66.234.199.215]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id 52EF03790; Wed, 10 Mar 2021 17:29:53 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Subject: Re: git: 953a7d7c61f3 - main - Arch64: Clear VFP state on execve() To: Alex Richardson , src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org References: <202103101245.12ACjLn7064810@gitrepo.freebsd.org> From: John Baldwin Message-ID: Date: Wed, 10 Mar 2021 09:29:51 -0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:78.0) Gecko/20100101 Thunderbird/78.7.1 MIME-Version: 1.0 In-Reply-To: <202103101245.12ACjLn7064810@gitrepo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit 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, 10 Mar 2021 17:29:53 -0000 On 3/10/21 4:45 AM, Alex Richardson wrote: > The branch main has been updated by arichardson: > > URL: https://cgit.FreeBSD.org/src/commit/?id=953a7d7c61f3b2f5351dfe668510ec782ae282e8 > > commit 953a7d7c61f3b2f5351dfe668510ec782ae282e8 > Author: Alex Richardson > AuthorDate: 2021-03-09 19:11:40 +0000 > Commit: Alex Richardson > CommitDate: 2021-03-10 12:44:42 +0000 > > Arch64: Clear VFP state on execve() > > I noticed that many of the math-related tests were failing on AArch64. > After a lot of debugging, I noticed that the floating point exception flags > were not being reset when starting a new process. This change resets the > VFP inside exec_setregs() to ensure no VFP register state is leaked from > parent processes to children. > > This commit also moves the clearing of fpcr that was added in 65618fdda0f27 > from fork() to execve() since that makes more sense: fork() can retain > current register values, but execve() should result in a well-defined > clean state. > > Reviewed By: andrew > MFC after: 1 week > Differential Revision: https://reviews.freebsd.org/D29060 FYI, cpu_thread_copy() should copy the creating thread's state to the new thread, not reset it. POSIX actually says that new threads inherit the "floating point environment" from the creating thread for pthread_create(). I have a patch I'm testing to fix thix for x86. -- John Baldwin From owner-dev-commits-src-main@freebsd.org Wed Mar 10 17:38:04 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 B9CB1571EC4; Wed, 10 Mar 2021 17:38:04 +0000 (UTC) (envelope-from arichardson.kde@gmail.com) Received: from mail-ed1-f54.google.com (mail-ed1-f54.google.com [209.85.208.54]) (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 4DwfRw1xnQz3tLq; Wed, 10 Mar 2021 17:38:03 +0000 (UTC) (envelope-from arichardson.kde@gmail.com) Received: by mail-ed1-f54.google.com with SMTP id t1so29323963eds.7; Wed, 10 Mar 2021 09:38:03 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=CnpwdviPwppKQIfOgzncJKqkxdD2LWVsoLJ/gwSTBcE=; b=GNlKDDCPtybC1WyTDK2GEJ/sCkz2FKaI7pYcXae8llAdH+WfgwG2IWzxKSVb6SzHeP UduYWvH52TGJKD/9ab+FZQu4jXqY+XgIikmWRqsPDu5IpYehF0etLXaD1uaQphsmDBSX WXCm8o80gXypS09pgDKUC/nZz95nD92fVYXdUxur3y29QgbhVTehWY8cW4LsA3rq7QpZ +Sp2A97mtgpPJl23AJMk5hpdp2ztq+cG3G0LqBWD6H09+phiLnS46oIWbC6160Alh1pN vCipvgHrOTyBBg5ZaJbdqOkjocsi82+1XpuZweJN6s5YPHgLa3YyNtWql7CqTz4E9A5s ZLSA== X-Gm-Message-State: AOAM533y4kQ9UWe4jIivM5DTey6XOe3zO8QwiSm9c83JSWrUBbKRgZMx JVqlduvER6ypb90l/lURwn2iMh1VutfHRA== X-Google-Smtp-Source: ABdhPJxSdrevv8c1wCdmx7FBYvNkS7jbkL9xUk8BgJ+cXPuDMC2XtO+Rxzc5quGjaCuwg1/9LKYDwg== X-Received: by 2002:a50:c00b:: with SMTP id r11mr4591354edb.35.1615397882141; Wed, 10 Mar 2021 09:38:02 -0800 (PST) Received: from mail-wr1-f47.google.com (mail-wr1-f47.google.com. [209.85.221.47]) by smtp.gmail.com with ESMTPSA id y11sm61211ejd.72.2021.03.10.09.38.01 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 10 Mar 2021 09:38:02 -0800 (PST) Received: by mail-wr1-f47.google.com with SMTP id w11so24271185wrr.10; Wed, 10 Mar 2021 09:38:01 -0800 (PST) X-Received: by 2002:a05:6000:118c:: with SMTP id g12mr4676388wrx.353.1615397881613; Wed, 10 Mar 2021 09:38:01 -0800 (PST) MIME-Version: 1.0 References: <202103101245.12ACjLn7064810@gitrepo.freebsd.org> In-Reply-To: From: Alexander Richardson Date: Wed, 10 Mar 2021 17:37:50 +0000 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: git: 953a7d7c61f3 - main - Arch64: Clear VFP state on execve() To: John Baldwin Cc: src-committers , dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 4DwfRw1xnQz3tLq X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; TAGGED_FROM(0.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, 10 Mar 2021 17:38:04 -0000 On Wed, 10 Mar 2021 at 17:29, John Baldwin wrote: > > On 3/10/21 4:45 AM, Alex Richardson wrote: > > The branch main has been updated by arichardson: > > > > URL: https://cgit.FreeBSD.org/src/commit/?id=953a7d7c61f3b2f5351dfe668510ec782ae282e8 > > > > commit 953a7d7c61f3b2f5351dfe668510ec782ae282e8 > > Author: Alex Richardson > > AuthorDate: 2021-03-09 19:11:40 +0000 > > Commit: Alex Richardson > > CommitDate: 2021-03-10 12:44:42 +0000 > > > > Arch64: Clear VFP state on execve() > > > > I noticed that many of the math-related tests were failing on AArch64. > > After a lot of debugging, I noticed that the floating point exception flags > > were not being reset when starting a new process. This change resets the > > VFP inside exec_setregs() to ensure no VFP register state is leaked from > > parent processes to children. > > > > This commit also moves the clearing of fpcr that was added in 65618fdda0f27 > > from fork() to execve() since that makes more sense: fork() can retain > > current register values, but execve() should result in a well-defined > > clean state. > > > > Reviewed By: andrew > > MFC after: 1 week > > Differential Revision: https://reviews.freebsd.org/D29060 > > FYI, cpu_thread_copy() should copy the creating thread's state to the new thread, > not reset it. POSIX actually says that new threads inherit the "floating point > environment" from the creating thread for pthread_create(). I have a patch I'm > testing to fix thix for x86. > I believe sv_setregs is only called for execve() not for new threads? cpu_copy_thread() is not affected by this patch and I see it does a bcopy(td0->td_pcb, td->td_pcb, sizeof(struct pcb)); so should be fine? Alex From owner-dev-commits-src-main@freebsd.org Wed Mar 10 18:07: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 C92085721D6; Wed, 10 Mar 2021 18:07: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 4Dwg5f5LgFz3vZq; Wed, 10 Mar 2021 18:07: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 AA89C13D5B; Wed, 10 Mar 2021 18:07: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 12AI7It0089871; Wed, 10 Mar 2021 18:07:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 12AI7IVW089870; Wed, 10 Mar 2021 18:07:18 GMT (envelope-from git) Date: Wed, 10 Mar 2021 18:07:18 GMT Message-Id: <202103101807.12AI7IVW089870@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Olivier Houchard Subject: git: c328f64d8107 - main - arm64: Fix COMPAT_FREEBSD32. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cognet X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c328f64d81079bad5064c8a387883df50ab5aaed 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, 10 Mar 2021 18:07:18 -0000 The branch main has been updated by cognet: URL: https://cgit.FreeBSD.org/src/commit/?id=c328f64d81079bad5064c8a387883df50ab5aaed commit c328f64d81079bad5064c8a387883df50ab5aaed Author: Olivier Houchard AuthorDate: 2021-03-10 18:01:41 +0000 Commit: Olivier Houchard CommitDate: 2021-03-10 18:06:42 +0000 arm64: Fix COMPAT_FREEBSD32. The ENTRY() macro was modified by commit 28d945204ea1014d7de6906af8470ed8b3311335 to add an optional NOP instruction at the beginning of the function. It is of course an arm64 instruction, so unsuitable for the 32bits sigcode. So just use EENTRY() instead for aarch32_sigcode. This should fix receiving signals when running 32bits binaries on FreeBSD/arm64. MFC After: 1 week --- sys/arm64/arm64/locore.S | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/arm64/arm64/locore.S b/sys/arm64/arm64/locore.S index bd013a870e34..f5e6bbd604a5 100644 --- a/sys/arm64/arm64/locore.S +++ b/sys/arm64/arm64/locore.S @@ -805,7 +805,7 @@ esigcode: szsigcode: .quad esigcode - sigcode -ENTRY(aarch32_sigcode) +EENTRY(aarch32_sigcode) .word 0xe1a0000d // mov r0, sp .word 0xe2800040 // add r0, r0, #SIGF_UC .word 0xe59f700c // ldr r7, [pc, #12] @@ -813,7 +813,7 @@ ENTRY(aarch32_sigcode) .word 0xe59f7008 // ldr r7, [pc, #8] .word 0xef000000 // swi #0 .word 0xeafffffa // b . - 16 -END(aarch32_sigcode) +EEND(aarch32_sigcode) .word SYS_sigreturn .word SYS_exit .align 3 From owner-dev-commits-src-main@freebsd.org Wed Mar 10 18: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 AFBC6573638 for ; Wed, 10 Mar 2021 18:36:39 +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 4DwglW4Rn7z4SXl for ; Wed, 10 Mar 2021 18:36:39 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: by mail-wr1-f42.google.com with SMTP id l11so21084499wrp.7 for ; Wed, 10 Mar 2021 10:36:39 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=SYPW1/rwuoBm47vUZW2vETjGKNJorbaI7+nCpaKvVVU=; b=T1wMZSj9MiEMe6pj+n7pWNzsvUnVKqHQgCdEBsiPVVDBG+4/E0PtgECiXeOblg59qc 3CGb86QlOVKzb8aefjra70KSUPyhdwtBE4zQz1DaEPZd+AVpvSNNDclgzLeK9QgItluw 0Th4CpQf/3URMpW5M+5XqgZ4Q86qLkFMU81FbqBRv3tcMuZtFXRDXXxUntpTptLE+seQ HbWzS6dD1e42PoP56I6tTLYevepsYK70b32W3WjthWIkgdaROG0X+82Rw8Fr5gucw30i apPLWaukmAfBEqnYDFDBLPHgEICXj4ycXa8+U0TWnYIbQ3p5qFlBz2056WOwEUwvbJj0 JemQ== X-Gm-Message-State: AOAM533PVux9z6EkFHpHFjpqTeVs9YKvGYyjuU+erPYBf0ym11rpicSf gApz5OsIMz8tdiWx5shh9fq4Pg== X-Google-Smtp-Source: ABdhPJzGX01xAWHSPw7VtSJ8Pu9fCriMcwm538KbebTDykI8oKO1zN2ylCNYXgVwF5/U4UlZbpq9hQ== X-Received: by 2002:a5d:6404:: with SMTP id z4mr3449089wru.109.1615401397929; Wed, 10 Mar 2021 10:36:37 -0800 (PST) Received: from [192.168.149.251] (trinity-students-nat.trin.cam.ac.uk. [131.111.193.104]) by smtp.gmail.com with ESMTPSA id u63sm305967wmg.24.2021.03.10.10.36.36 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 10 Mar 2021 10:36:36 -0800 (PST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.120.23.2.4\)) Subject: Re: git: c328f64d8107 - main - arm64: Fix COMPAT_FREEBSD32. From: Jessica Clarke In-Reply-To: <202103101807.12AI7IVW089870@gitrepo.freebsd.org> Date: Wed, 10 Mar 2021 18:36:35 +0000 Cc: "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Content-Transfer-Encoding: quoted-printable Message-Id: <28B50FA6-65E4-4A5A-8339-8A4A8720974B@freebsd.org> References: <202103101807.12AI7IVW089870@gitrepo.freebsd.org> To: Olivier Houchard , John Baldwin X-Mailer: Apple Mail (2.3608.120.23.2.4) X-Rspamd-Queue-Id: 4DwglW4Rn7z4SXl 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, 10 Mar 2021 18:36:39 -0000 On 10 Mar 2021, at 18:07, Olivier Houchard wrote: >=20 > The branch main has been updated by cognet: >=20 > URL: = https://cgit.FreeBSD.org/src/commit/?id=3Dc328f64d81079bad5064c8a387883df5= 0ab5aaed >=20 > commit c328f64d81079bad5064c8a387883df50ab5aaed > Author: Olivier Houchard > AuthorDate: 2021-03-10 18:01:41 +0000 > Commit: Olivier Houchard > CommitDate: 2021-03-10 18:06:42 +0000 >=20 > arm64: Fix COMPAT_FREEBSD32. >=20 > The ENTRY() macro was modified by commit > 28d945204ea1014d7de6906af8470ed8b3311335 to add an optional NOP = instruction > at the beginning of the function. It is of course an arm64 = instruction, so > unsuitable for the 32bits sigcode. So just use EENTRY() instead for > aarch32_sigcode. This should fix receiving signals when running = 32bits > binaries on FreeBSD/arm64. Hmm, that's a good point, does the extra nop for the AArch64 sigcode cause issues for gdb detecting it? Perhaps we should upstream CheriBSD's SIGCODE macros?.. Jess Jess From owner-dev-commits-src-main@freebsd.org Wed Mar 10 18:39: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 D4363573373; Wed, 10 Mar 2021 18:39:46 +0000 (UTC) (envelope-from cognet@ci0.org) Received: from kanar.ci0.org (kanar.ci0.org [IPv6:2001:bc8:35e6::1]) (using TLSv1.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 "sd-143795", Issuer "sd-143795" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Dwgq64ZVWz4Sk8; Wed, 10 Mar 2021 18:39:46 +0000 (UTC) (envelope-from cognet@ci0.org) Received: from kanar.ci0.org (localhost [127.0.0.1]) by kanar.ci0.org (8.16.1/8.16.1) with ESMTPS id 12AIdYBd004713 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Wed, 10 Mar 2021 19:39:34 +0100 (CET) (envelope-from cognet@ci0.org) Received: (from doginou@localhost) by kanar.ci0.org (8.16.1/8.16.1/Submit) id 12AIdYo1004712; Wed, 10 Mar 2021 19:39:34 +0100 (CET) (envelope-from cognet@ci0.org) X-Authentication-Warning: kanar.ci0.org: doginou set sender to cognet@ci0.org using -f Date: Wed, 10 Mar 2021 19:39:34 +0100 From: Olivier Houchard To: Jessica Clarke Cc: Olivier Houchard , John Baldwin , "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Subject: Re: git: c328f64d8107 - main - arm64: Fix COMPAT_FREEBSD32. Message-ID: References: <202103101807.12AI7IVW089870@gitrepo.freebsd.org> <28B50FA6-65E4-4A5A-8339-8A4A8720974B@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <28B50FA6-65E4-4A5A-8339-8A4A8720974B@freebsd.org> X-Rspamd-Queue-Id: 4Dwgq64ZVWz4Sk8 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, 10 Mar 2021 18:39:46 -0000 Hi Jessica, On Wed, Mar 10, 2021 at 06:36:35PM +0000, Jessica Clarke wrote: > On 10 Mar 2021, at 18:07, Olivier Houchard wrote: > > > > The branch main has been updated by cognet: > > > > URL: https://cgit.FreeBSD.org/src/commit/?id=c328f64d81079bad5064c8a387883df50ab5aaed > > > > commit c328f64d81079bad5064c8a387883df50ab5aaed > > Author: Olivier Houchard > > AuthorDate: 2021-03-10 18:01:41 +0000 > > Commit: Olivier Houchard > > CommitDate: 2021-03-10 18:06:42 +0000 > > > > arm64: Fix COMPAT_FREEBSD32. > > > > The ENTRY() macro was modified by commit > > 28d945204ea1014d7de6906af8470ed8b3311335 to add an optional NOP instruction > > at the beginning of the function. It is of course an arm64 instruction, so > > unsuitable for the 32bits sigcode. So just use EENTRY() instead for > > aarch32_sigcode. This should fix receiving signals when running 32bits > > binaries on FreeBSD/arm64. > > Hmm, that's a good point, does the extra nop for the AArch64 sigcode > cause issues for gdb detecting it? > > Perhaps we should upstream CheriBSD's SIGCODE macros?.. > I wondered about that, but decided not to dig that rabbit hole :) Having specific macros would certainly make sense. Olivier From owner-dev-commits-src-main@freebsd.org Wed Mar 10 18:52: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 86D8A5740A7; Wed, 10 Mar 2021 18:52: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 4Dwh6J3NYgz4WnK; Wed, 10 Mar 2021 18:52: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 6709C16838; Wed, 10 Mar 2021 18:52: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 12AIquVl054768; Wed, 10 Mar 2021 18:52:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 12AIquTp054767; Wed, 10 Mar 2021 18:52:56 GMT (envelope-from git) Date: Wed, 10 Mar 2021 18:52:56 GMT Message-Id: <202103101852.12AIquTp054767@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: 2cee045b4d62 - main - Move time math out of disabled interrupts sections. 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: 2cee045b4d62568d065b838a6cf129fed2424709 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, 10 Mar 2021 18:52:56 -0000 The branch main has been updated by mav: URL: https://cgit.FreeBSD.org/src/commit/?id=2cee045b4d62568d065b838a6cf129fed2424709 commit 2cee045b4d62568d065b838a6cf129fed2424709 Author: Alexander Motin AuthorDate: 2021-03-10 18:39:15 +0000 Commit: Alexander Motin CommitDate: 2021-03-10 18:52:51 +0000 Move time math out of disabled interrupts sections. We don't need the result before next sleep time, so no reason to additionally increase interrupt latency. While there, remove extra PM ticks to microseconds conversion, making C2/C3 sleep times look 4 times smaller than really. The conversion is already done by AcpiGetTimerDuration(). Now I see reported sleep times up to 0.5s, just as expected for planned 2 wakeups per second. MFC after: 1 month --- sys/dev/acpica/acpi_cpu.c | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/sys/dev/acpica/acpi_cpu.c b/sys/dev/acpica/acpi_cpu.c index 56182ed743de..3c81d55436ca 100644 --- a/sys/dev/acpica/acpi_cpu.c +++ b/sys/dev/acpica/acpi_cpu.c @@ -114,8 +114,6 @@ struct acpi_cpu_device { (bus_space_write_ ## width(rman_get_bustag((reg)), \ rman_get_bushandle((reg)), 0, (val))) -#define PM_USEC(x) ((x) >> 2) /* ~4 clocks per usec (3.57955 Mhz) */ - #define ACPI_NOTIFY_CX_STATES 0x81 /* _CST changed. */ #define CPU_QUIRK_NO_C3 (1<<0) /* C3-type states are not usable. */ @@ -1107,7 +1105,7 @@ acpi_cpu_idle(sbintime_t sbt) { struct acpi_cpu_softc *sc; struct acpi_cx *cx_next; - uint64_t cputicks; + uint64_t start_ticks, end_ticks; uint32_t start_time, end_time; ACPI_STATUS status; int bm_active, cx_next_idx, i, us; @@ -1176,7 +1174,7 @@ acpi_cpu_idle(sbintime_t sbt) * we are called inside critical section, delaying context switch. */ if (cx_next->type == ACPI_STATE_C1) { - cputicks = cpu_ticks(); + start_ticks = cpu_ticks(); if (cx_next->p_lvlx != NULL) { /* C1 I/O then Halt */ CPU_GET_REG(cx_next->p_lvlx, 1); @@ -1185,12 +1183,13 @@ acpi_cpu_idle(sbintime_t sbt) acpi_cpu_idle_mwait(cx_next->mwait_hint); else acpi_cpu_c1(); - end_time = ((cpu_ticks() - cputicks) << 20) / cpu_tickrate(); - if (curthread->td_critnest == 0) - end_time = min(end_time, 500000 / hz); + end_ticks = cpu_ticks(); /* acpi_cpu_c1() returns with interrupts enabled. */ if (cx_next->do_mwait) ACPI_ENABLE_IRQS(); + end_time = ((end_ticks - start_ticks) << 20) / cpu_tickrate(); + if (!cx_next->do_mwait && curthread->td_critnest == 0) + end_time = min(end_time, 500000 / hz); sc->cpu_prev_sleep = (sc->cpu_prev_sleep * 3 + end_time) / 4; return; } @@ -1215,10 +1214,10 @@ acpi_cpu_idle(sbintime_t sbt) */ if (cx_next->type == ACPI_STATE_C3) { AcpiGetTimer(&start_time); - cputicks = 0; + start_ticks = 0; } else { start_time = 0; - cputicks = cpu_ticks(); + start_ticks = cpu_ticks(); } if (cx_next->do_mwait) { acpi_cpu_idle_mwait(cx_next->mwait_hint); @@ -1233,11 +1232,10 @@ acpi_cpu_idle(sbintime_t sbt) AcpiGetTimer(&end_time); } - if (cx_next->type == ACPI_STATE_C3) { + if (cx_next->type == ACPI_STATE_C3) AcpiGetTimer(&end_time); - AcpiGetTimerDuration(start_time, end_time, &end_time); - } else - end_time = ((cpu_ticks() - cputicks) << 20) / cpu_tickrate(); + else + end_ticks = cpu_ticks(); /* Enable bus master arbitration and disable bus master wakeup. */ if (cx_next->type == ACPI_STATE_C3 && @@ -1247,7 +1245,11 @@ acpi_cpu_idle(sbintime_t sbt) } ACPI_ENABLE_IRQS(); - sc->cpu_prev_sleep = (sc->cpu_prev_sleep * 3 + PM_USEC(end_time)) / 4; + if (cx_next->type == ACPI_STATE_C3) + AcpiGetTimerDuration(start_time, end_time, &end_time); + else + end_time = ((end_ticks - start_ticks) << 20) / cpu_tickrate(); + sc->cpu_prev_sleep = (sc->cpu_prev_sleep * 3 + end_time) / 4; } #endif From owner-dev-commits-src-main@freebsd.org Wed Mar 10 19:08: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 5A12D5746D9; Wed, 10 Mar 2021 19:08: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 4DwhS328GHz4XLd; Wed, 10 Mar 2021 19:08: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 3CA0B16974; Wed, 10 Mar 2021 19:08: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 12AJ8JQ7069325; Wed, 10 Mar 2021 19:08:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 12AJ8Jw6069324; Wed, 10 Mar 2021 19:08:19 GMT (envelope-from git) Date: Wed, 10 Mar 2021 19:08:19 GMT Message-Id: <202103101908.12AJ8Jw6069324@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: 3fa034210c75 - main - ktls: Fix non-inplace TLS 1.3 encryption. 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: 3fa034210c75431173cb0a2375f6938386e25315 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, 10 Mar 2021 19:08:19 -0000 The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=3fa034210c75431173cb0a2375f6938386e25315 commit 3fa034210c75431173cb0a2375f6938386e25315 Author: John Baldwin AuthorDate: 2021-03-10 19:07:40 +0000 Commit: John Baldwin CommitDate: 2021-03-10 19:07:40 +0000 ktls: Fix non-inplace TLS 1.3 encryption. Copy the iovec for the trailer from the proper place. This is the same fix for CBC encryption from ff6a7e4ba6bf. Reported by: gallatin Reviewed by: gallatin, markj Fixes: 49f6925ca Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D29177 --- sys/opencrypto/ktls_ocf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/opencrypto/ktls_ocf.c b/sys/opencrypto/ktls_ocf.c index 7414e26bb3e2..2f2249cd3bfe 100644 --- a/sys/opencrypto/ktls_ocf.c +++ b/sys/opencrypto/ktls_ocf.c @@ -574,7 +574,7 @@ ktls_ocf_tls13_aead_encrypt(struct ktls_session *tls, if (!inplace) { /* Duplicate the output iov to append the trailer. */ memcpy(out_iov, outiov, outiovcnt * sizeof(*out_iov)); - out_iov[outiovcnt] = iov[outiovcnt]; + out_iov[outiovcnt] = iov[iniovcnt]; out_uio.uio_iov = out_iov; out_uio.uio_iovcnt = outiovcnt + 1; From owner-dev-commits-src-main@freebsd.org Wed Mar 10 19:19: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 C3DB45749DD; Wed, 10 Mar 2021 19:19:27 +0000 (UTC) (envelope-from jhb@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 4Dwhhv5D9Wz4YJj; Wed, 10 Mar 2021 19:19:27 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro.local (ralph.baldwin.cx [66.234.199.215]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id 2E53E3F2D; Wed, 10 Mar 2021 19:19:27 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Subject: Re: git: 953a7d7c61f3 - main - Arch64: Clear VFP state on execve() To: Alexander Richardson Cc: src-committers , dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org References: <202103101245.12ACjLn7064810@gitrepo.freebsd.org> From: John Baldwin Message-ID: Date: Wed, 10 Mar 2021 11:19:26 -0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:78.0) Gecko/20100101 Thunderbird/78.7.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit 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, 10 Mar 2021 19:19:27 -0000 On 3/10/21 9:37 AM, Alexander Richardson wrote: > On Wed, 10 Mar 2021 at 17:29, John Baldwin wrote: >> >> On 3/10/21 4:45 AM, Alex Richardson wrote: >>> The branch main has been updated by arichardson: >>> >>> URL: https://cgit.FreeBSD.org/src/commit/?id=953a7d7c61f3b2f5351dfe668510ec782ae282e8 >>> >>> commit 953a7d7c61f3b2f5351dfe668510ec782ae282e8 >>> Author: Alex Richardson >>> AuthorDate: 2021-03-09 19:11:40 +0000 >>> Commit: Alex Richardson >>> CommitDate: 2021-03-10 12:44:42 +0000 >>> >>> Arch64: Clear VFP state on execve() >>> >>> I noticed that many of the math-related tests were failing on AArch64. >>> After a lot of debugging, I noticed that the floating point exception flags >>> were not being reset when starting a new process. This change resets the >>> VFP inside exec_setregs() to ensure no VFP register state is leaked from >>> parent processes to children. >>> >>> This commit also moves the clearing of fpcr that was added in 65618fdda0f27 >>> from fork() to execve() since that makes more sense: fork() can retain >>> current register values, but execve() should result in a well-defined >>> clean state. >>> >>> Reviewed By: andrew >>> MFC after: 1 week >>> Differential Revision: https://reviews.freebsd.org/D29060 >> >> FYI, cpu_thread_copy() should copy the creating thread's state to the new thread, >> not reset it. POSIX actually says that new threads inherit the "floating point >> environment" from the creating thread for pthread_create(). I have a patch I'm >> testing to fix thix for x86. >> > > I believe sv_setregs is only called for execve() not for new threads? > cpu_copy_thread() is not affected by this patch and I see it does a > bcopy(td0->td_pcb, td->td_pcb, sizeof(struct pcb)); so should be fine? Ah, I thought you touched cpu_copy_thread() as well. I do think cpu_copy_thread() resets some pcb flags which might be the thing to fix (it's what I have to fix for x86 which was copying the state, but then clearing the INITDONE flags such that the copied state was always overwritten by the trap on first use) -- John Baldwin From owner-dev-commits-src-main@freebsd.org Wed Mar 10 19:25: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 ECD4E574CF0; Wed, 10 Mar 2021 19:25:01 +0000 (UTC) (envelope-from jhb@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 4DwhqK5HWbz4YgM; Wed, 10 Mar 2021 19:25:01 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro.local (ralph.baldwin.cx [66.234.199.215]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id 2371549CE; Wed, 10 Mar 2021 19:25:01 +0000 (UTC) (envelope-from jhb@FreeBSD.org) To: Jessica Clarke , Olivier Houchard Cc: "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" References: <202103101807.12AI7IVW089870@gitrepo.freebsd.org> <28B50FA6-65E4-4A5A-8339-8A4A8720974B@freebsd.org> From: John Baldwin Subject: Re: git: c328f64d8107 - main - arm64: Fix COMPAT_FREEBSD32. Message-ID: <4e2cf000-991c-c09a-8c23-43ad4f5ef715@FreeBSD.org> Date: Wed, 10 Mar 2021 11:25:00 -0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:78.0) Gecko/20100101 Thunderbird/78.7.1 MIME-Version: 1.0 In-Reply-To: <28B50FA6-65E4-4A5A-8339-8A4A8720974B@freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit 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, 10 Mar 2021 19:25:02 -0000 On 3/10/21 10:36 AM, Jessica Clarke wrote: > On 10 Mar 2021, at 18:07, Olivier Houchard wrote: >> >> The branch main has been updated by cognet: >> >> URL: https://cgit.FreeBSD.org/src/commit/?id=c328f64d81079bad5064c8a387883df50ab5aaed >> >> commit c328f64d81079bad5064c8a387883df50ab5aaed >> Author: Olivier Houchard >> AuthorDate: 2021-03-10 18:01:41 +0000 >> Commit: Olivier Houchard >> CommitDate: 2021-03-10 18:06:42 +0000 >> >> arm64: Fix COMPAT_FREEBSD32. >> >> The ENTRY() macro was modified by commit >> 28d945204ea1014d7de6906af8470ed8b3311335 to add an optional NOP instruction >> at the beginning of the function. It is of course an arm64 instruction, so >> unsuitable for the 32bits sigcode. So just use EENTRY() instead for >> aarch32_sigcode. This should fix receiving signals when running 32bits >> binaries on FreeBSD/arm64. > > Hmm, that's a good point, does the extra nop for the AArch64 sigcode > cause issues for gdb detecting it? I think GDB might be ok because the nop comes first as it looks for the sequence of instructions after the nop to identify the signal frame (it doesn't care what instructions come before the sequence). -- John Baldwin From owner-dev-commits-src-main@freebsd.org Wed Mar 10 20:39: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 8A180577159 for ; Wed, 10 Mar 2021 20:39:15 +0000 (UTC) (envelope-from marklmi@yahoo.com) Received: from sonic308-9.consmr.mail.ne1.yahoo.com (sonic308-9.consmr.mail.ne1.yahoo.com [66.163.187.32]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4DwkSy2JkNz4f0x for ; Wed, 10 Mar 2021 20:39:14 +0000 (UTC) (envelope-from marklmi@yahoo.com) X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1615408752; bh=V2sxRL3ktHZr5KgkcgrlqR3tgcqwuxVdjmeKec1Unjg=; h=X-Sonic-MF:From:Subject:Date:To:From:Subject; b=aomnchGHZY1B/t+/UY/7rdgO5Xw4s9FTzlnU+2KHAgOPg/FDP+skXBDHssWnU71yHb9JIHxBivevz3Duz2y5jyACid1anh2j19XQN/C55YuMtdGRbbufVY9wbxOP630/iFtOanZlcsVDmiTC0lw4URZErtYiPYhg/s4kE+5EhqW5SNHD3H4uO27JWJqoKQvzg9OS2BlfYNaaqQMQ0MPen5TmisGLRIufE3IOIYQs9xRkJ5EwVmFm45OKFuqVROp0c8yaxiybO2NlVibr8TaEkIVhWZzsCPQkGbH302r75CdNQxLdMND/ZK0O10qPlm+3ZLBNKCbgZ0hhjONrjLmIzQ== X-YMail-OSG: PD6.4.AVM1lzLlaqXDuK1dcsBLc3_OmlsVetU8L_3y_y5cWMlhVy_xiAQY_qCaU t1NDfZCOGCEcL4BrVjMdMDN5Awh1s8wcVUYX8KCkBcAgt0tMLVfYipA6fki95z2VYnGiCFd17xJm AwlhbTqGla6Qun7vNr5sI2L6s7hEQ4VB9AcxIV2KBfYVvKxmAaI8HH4JSAO9JJNuxcW0C.eALnWK kCfwHO6JR1QL9Xk8a97CIml2w4sdRadOHJwGa.JbgBrsjd1RfGwGsZtOy80EAkFBFgupZhstKvLd QmbrU59YKYpMBbhMvSJjm6DjKc5iG8MaVwoIhuu9TYBmKBlaRqhouRuKrcNT4rU7hUlp2aDceNNv aSmfbZPURg4zJtz4ZZNIKlQtRZ2yrsKxz7ow7Fl7f2p55h99gpyQzj8kSrhjkjh2YZco5F9XHYtq MMRQpPuxOZZ72tdX5hvP_u6Cem.4S3NSjMP.BLMar9XqyBkCkD1DcIt6NC1wGOI6Db0em2QbcLT5 r_OrEhJXHe9LzMEXTLx_RVbCBdBy4qIVFfc4Ve9dxZqS4_MK5Qsk0QeSEnH5r1vvHk50OZMP5jHx 8X6c0Lp1Sh193LPduFYfaWuTfY14sVRPuy2Vyj33iSJTROTsRE1ocaXeXdbfadm1jkEQiWcr0c5h sc6sjS1Uzwcof05KMVNjIYxxJg1RQlb5fqwL6jsdrOtO8_qmiZ.6QI8Kt8K1v.QZPdEhk5qtjsZq Oef4NkY.Lg9eC6BiDwfDzbzF9rKeNtrT3c11RRODaBYQ1QAeMCcp26UJRx8axg0AprKpE4LURrGF LDKrKmmeZPywIyfcgQoDp216DLOrRRaKUTnoxSFKw9XFow_fw4.SCa4HPTXZPNBWBUwjBxsH5UHp lOxn0RzO41uFMWu5A.xbjnbq4WOZYgt.SBU0qc4_aH0fwL9rs2QPrBNdtAaAgB_X7KhCZGKKx7PR OzGXJYJZN9FIPqUK2e2MHax9EqGnKcJG9isnznwbvNuKM37eEB66IFI9vi.2xqmIRtNB1OtReXD6 73ozpCIdfwB0VOfurMolJ5MrNNZYGtI6XZPkqTUrdPpvbp1y3cX16Yfj5euzb40i5x1dAzREkM4m b0rNjuRh8UhHAtsnTZNRBA2ArejuDNOlOTQ65_rXs1oIvDquHs5ergLwvz8oKN56MuFTWdCnbXWP J5fVNqt6thjpwwval.1Ymi3xUyBQ0pojomU5eaEzVa8V3FAKUwL_NiINYXOl6Y_26pWQ1V3rdidd osUHpVZdGFme7AMUlGm26psvLaj_7_BSgwjPF.3nHLvYBB.t6zVrtkRUup.1ZSiDGhkxBKd5RaCc 6KvSWG8NRHi6X8oUiA_ZFMn93vz1tvU.0Ya.1e1fauRQoegMpla3pYEVx59zVEZZ5hSYT6QhFLKt Ms2JMG1lmuiyugjRUBjpxjgzqezqpZm9Wkh1Y_uHhMj0eGxKJWB.J1.7bXxdOZagFvFphWcXq0_x bJRSO8j8pjP38Ghufr391yG2SKQdzBC_Fe1aeXUY.5b2.9m8vr0DCeT12_4HHZbw19tiW5.gYGIG 8NlISux5Px_YFiMO.a_Fzr0fez80F4W4CZLXrzDZ5zuHFm6ocSmtQkspgtHAu0carCiNE5Dqeyw1 rd3KLYanrONDT7AonYCyK.0mvapLrKXnRjOz3unaZ6LpnMpEFMJCZh9IJIY4o.0MoQRs66tWelFS cUpaw7e9i.U6KcXiFcAng00vAawqa6n6vHORon_QtXIZyof4kIcrdc4YUJKEQS.2Q0qBAHCEg5Si hliwT5oltZgk4mdJxrZOf_AFS1j3F_WLMveP_Y9SggAKJLkSli0rOeLuwt5NlT1vd3wokG4P1tVv 4WhySW5MxPBj9f_nejr5YafGg1_r35jKa33bsi2OfOsAUtHLKRirU0rspzS1EgsUcEaxSeaHvMOy fRpS7yt3s3W9sQWWhMIOPEFsO1MYJ7Fta7Hj2OoQKbBckufSdRILN7tDN38mWPn0RXTErBbA04Vj cTccv_rQ_ovQUn1AAUCD79OL6rKc0H5OY.kzqkQvdu6oyZbilDYh1NPaoHFl0E.sXEX8sLS5O9zB 9jYcNHtASLlFfSk7YNQQrMCdv5JSJ6dp7Q6BtJhoAlULwD3KOYqyA6tBiMrjSei4D4d_6hf9YJLU HM5Y0QZU.N8hbW.bHArGjqg808CQSykd_P573022rdSz_nxx12s9PkFvCWRLEOT9IMKh305bMmiF aORa0FFYIyynrJsD5okES9rkBeBbtfwx3KXOPnYKaf5vON7ocLhiGbmmA7OpqCtl20k1hqa2o4rb FM1lmGnock1WCH5wzgp4gYWDOWqt0R0HAuCzTa1XT90.XA32FC1HFqD.6gN.xkBSyVvitdpX3hgb fErcr9y.vokftMCbDeVZKYHlNdNM1R1g2CLjiZt.VH30IvS2JZwGDK5DnKouFTIDXnTi8URJjyMF 11abPK9Ylay4uvk821_3BR59A2A5Fb1SoA2vPQEtdfBa_U9FnyUuUn0sRxHfO3zfhxEmH2CjVQdv qCzYRX1vuHkEDa9q8r4EohGhMPAAlgpExogJWZAmFR3fAmsF4Vv_JQFz7jMO7uyKi9mgeMxmjOZ5 clW_seLahmWGHbGB8jRO41t0qJLQX8otFJnWi3g3pKPGur9fSuFE- X-Sonic-MF: Received: from sonic.gate.mail.ne1.yahoo.com by sonic308.consmr.mail.ne1.yahoo.com with HTTP; Wed, 10 Mar 2021 20:39:12 +0000 Received: by smtp406.mail.bf1.yahoo.com (VZM Hermes SMTP Server) with ESMTPA ID a4480251ed6812e642043b7c7a0cea40; Wed, 10 Mar 2021 20:39:07 +0000 (UTC) From: Mark Millard Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.60.0.2.21\)) Subject: Re: git: c328f64d8107 - main - arm64: Fix COMPAT_FREEBSD32. Message-Id: <70652D35-2738-4E75-901C-9997869CE8D6@yahoo.com> Date: Wed, 10 Mar 2021 12:39:05 -0800 Cc: John Baldwin To: jrtc27@freebsd.org, dev-commits-src-main@freebsd.org, cognet@ci0.org X-Mailer: Apple Mail (2.3654.60.0.2.21) References: <70652D35-2738-4E75-901C-9997869CE8D6.ref@yahoo.com> X-Rspamd-Queue-Id: 4DwkSy2JkNz4f0x X-Spamd-Bar: --- X-Spamd-Result: default: False [-3.50 / 15.00]; TO_DN_SOME(0.00)[]; FREEMAIL_FROM(0.00)[yahoo.com]; MV_CASE(0.50)[]; R_SPF_ALLOW(-0.20)[+ptr:yahoo.com]; DKIM_TRACE(0.00)[yahoo.com:+]; DMARC_POLICY_ALLOW(-0.50)[yahoo.com,reject]; NEURAL_HAM_SHORT(-1.00)[-1.000]; FROM_EQ_ENVFROM(0.00)[]; RCVD_TLS_LAST(0.00)[]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[yahoo.com]; ASN(0.00)[asn:36646, ipnet:66.163.184.0/21, country:US]; RBL_DBL_DONT_QUERY_IPS(0.00)[66.163.187.32:from]; DWL_DNSWL_NONE(0.00)[yahoo.com:dkim]; MID_RHS_MATCH_FROM(0.00)[]; ARC_NA(0.00)[]; R_DKIM_ALLOW(-0.20)[yahoo.com:s=s2048]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; NEURAL_HAM_LONG(-1.00)[-1.000]; MIME_GOOD(-0.10)[text/plain]; SPAMHAUS_ZRD(0.00)[66.163.187.32:from:127.0.2.255]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[66.163.187.32:from]; RWL_MAILSPIKE_POSSIBLE(0.00)[66.163.187.32:from]; 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: Wed, 10 Mar 2021 20:39:15 -0000 Jessica Clarke jrtc27 at freebsd.org wrote on Wed Mar 10 18:36:39 UTC 2021 : > On 10 Mar 2021, at 18:07, Olivier Houchard = wrote: > >=20 > > The branch main has been updated by cognet: > >=20 > > URL: = https://cgit.FreeBSD.org/src/commit/?id=3Dc328f64d81079bad5064c8a387883df5= 0ab5aaed > >=20 > > commit c328f64d81079bad5064c8a387883df50ab5aaed > > Author: Olivier Houchard > > AuthorDate: 2021-03-10 18:01:41 +0000 > > Commit: Olivier Houchard > > CommitDate: 2021-03-10 18:06:42 +0000 > >=20 > > arm64: Fix COMPAT_FREEBSD32. > >=20 > > The ENTRY() macro was modified by commit > > 28d945204ea1014d7de6906af8470ed8b3311335 to add an optional NOP = instruction > > at the beginning of the function. It is of course an arm64 = instruction, so > > unsuitable for the 32bits sigcode. So just use EENTRY() instead = for > > aarch32_sigcode. This should fix receiving signals when running = 32bits > > binaries on FreeBSD/arm64. >=20 > Hmm, that's a good point, does the extra nop for the AArch64 sigcode > cause issues for gdb detecting it? >=20 > Perhaps we should upstream CheriBSD's SIGCODE macros?.. I'll note that, in my reports on the lists about aarch64 having problems with armv7 port building failures, I used lldb because gdb did not report backtraces beyond #0 but lldb did report more complete backtraces. However, for lldb part of my notes were a report of a potential missing frame as well: QUOTE I'll note that when I looked at detail as the assembler level it appeared that there was a frame not shown between #0 and #1 in lldb's output: Frame #1 "->" was indicating the instruction after a simple bl to a not-shown subroutine. For building textproc/libxslt : (jobserver_acquire not shown between #0 and #1) (lldb) bt * thread #1, name =3D 'gmake', stop reason =3D signal SIGSEGV * frame #0: 0xffffe190 frame #1: 0x0003b5f8 gmake`new_job(file=3D) at = job.c:1870:21 frame #2: 0x0002db80 gmake`execute_file_commands(file=3D) = at commands.c:476:3 [artificial] frame #3: 0x00049acc gmake`update_file [inlined] = remake_file(file=3D0x400a9700) at remake.c:1234:11 frame #4: 0x00049a84 gmake`update_file [inlined] = update_file_1(file=3D, depth=3D6) at remake.c:835 frame #5: 0x000494ec gmake`update_file(file=3D, = depth=3D) at remake.c:336 frame #6: 0x0004b08c gmake`check_dep(file=3D0x400a9700, = depth=3D, this_mtime=3D1, must_make_ptr=3D0xffffc4ac) at = remake.c:1024:20 frame #7: 0x00049074 gmake`update_file at remake.c:572:17 frame #8: 0x00048b80 gmake`update_file(file=3D, = depth=3D) at remake.c:336 frame #9: 0x0004b08c gmake`check_dep(file=3D0x400a9400, = depth=3D, this_mtime=3D1, must_make_ptr=3D0xffffc564) at = remake.c:1024:20 frame #10: 0x00049074 gmake`update_file at remake.c:572:17 frame #11: 0x00048b80 gmake`update_file(file=3D, = depth=3D) at remake.c:336 frame #12: 0x0004b08c gmake`check_dep(file=3D0x400a8f20, = depth=3D, this_mtime=3D1, must_make_ptr=3D0xffffc61c) at = remake.c:1024:20 frame #13: 0x00049074 gmake`update_file at remake.c:572:17 frame #14: 0x00048b80 gmake`update_file(file=3D, = depth=3D) at remake.c:336 frame #15: 0x000487e0 gmake`update_goal_chain(goaldeps=3D)= at remake.c:151:22 frame #16: 0x0003f25c gmake`main(argc=3D2, argv=3D0xffffd470, = envp=3D0xffffffff) at main.c:2589:13 frame #17: 0x0002c0fc gmake`__start(argc=3D2, argv=3D, = env=3D, ps_strings=3D, obj=3D0x400c4004, = cleanup=3D0x40091aa0) at crt1_c.c:92:7 -> 1870 got_token =3D jobserver_acquire (waiting_jobs !=3D = NULL); 0x3b5f4 <+1288>: bl 0x50078 ; jobserver_acquire = at posixos.c:265 -> 0x3b5f8 <+1292>: cmp r0, #1 END QUOTE The backtrace example above did not show jobserver_acquire as having a frame. The original note had more examples: all the example process failures had an apparently missing frame in the lldb backtrace. =3D=3D=3D Mark Millard marklmi at yahoo.com ( dsl-only.net went away in early 2018-Mar) From owner-dev-commits-src-main@freebsd.org Wed Mar 10 21:28: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 0E6055782A7; Wed, 10 Mar 2021 21:28: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 4DwlYk747hz4hdf; Wed, 10 Mar 2021 21:28: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 E5A9318905; Wed, 10 Mar 2021 21:28: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 12ALSQWY053341; Wed, 10 Mar 2021 21:28:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 12ALSQjR053340; Wed, 10 Mar 2021 21:28:26 GMT (envelope-from git) Date: Wed, 10 Mar 2021 21:28:26 GMT Message-Id: <202103102128.12ALSQjR053340@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Alexander V. Chernikov" Subject: git: b1d63265ac39 - main - Flush remaining routes from the routing table during VNET shutdown. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: melifaro X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b1d63265ac399112b3bca36c3d75df1a3c2c8102 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, 10 Mar 2021 21:28:27 -0000 The branch main has been updated by melifaro: URL: https://cgit.FreeBSD.org/src/commit/?id=b1d63265ac399112b3bca36c3d75df1a3c2c8102 commit b1d63265ac399112b3bca36c3d75df1a3c2c8102 Author: Alexander V. Chernikov AuthorDate: 2021-03-08 21:35:41 +0000 Commit: Alexander V. Chernikov CommitDate: 2021-03-10 21:10:14 +0000 Flush remaining routes from the routing table during VNET shutdown. Summary: This fixes rtentry leak for the cloned interfaces created inside the VNET. PR: 253998 Reported by: rashey at superbox.pl MFC after: 3 days Loopback teardown order is `SI_SUB_INIT_IF`, which happens after `SI_SUB_PROTO_DOMAIN` (route table teardown). Thus, any route table operations are too late to schedule. As the intent of the vnet teardown procedures to minimise the amount of effort by doing global cleanups instead of per-interface ones, address this by adding a relatively light-weight routing table cleanup function, `rib_flush_routes()`. It removes all remaining routes from the routing table and schedules the deletion, which will happen later, when `rtables_destroy()` waits for the current epoch to finish. Test Plan: ``` set_skip:set_skip_group_lo -> passed [0.053s] tail -n 200 /var/log/messages | grep rtentry ``` Reviewers: #network, kp, bz Reviewed By: kp Subscribers: imp, ae Differential Revision: https://reviews.freebsd.org/D29116 --- sys/net/route.c | 15 --------------- sys/net/route.h | 2 +- sys/net/route/route_ctl.c | 36 ++++++++++++++++++++++++++++++++++++ sys/netinet/ip_input.c | 6 +----- sys/netinet6/ip6_input.c | 5 +++-- 5 files changed, 41 insertions(+), 23 deletions(-) diff --git a/sys/net/route.c b/sys/net/route.c index d2b405fafcbf..2416aa9a983f 100644 --- a/sys/net/route.c +++ b/sys/net/route.c @@ -493,21 +493,6 @@ rt_ifdelroute(const struct rtentry *rt, const struct nhop_object *nh, void *arg) return (1); } -/* - * Delete all remaining routes using this interface - * Unfortuneatly the only way to do this is to slog through - * the entire routing table looking for routes which point - * to this interface...oh well... - */ -void -rt_flushifroutes_af(struct ifnet *ifp, int af) -{ - KASSERT((af >= 1 && af <= AF_MAX), ("%s: af %d not >= 1 and <= %d", - __func__, af, AF_MAX)); - - rib_foreach_table_walk_del(af, rt_ifdelroute, ifp); -} - void rt_flushifroutes(struct ifnet *ifp) { diff --git a/sys/net/route.h b/sys/net/route.h index ab6e1aabc5ae..3fdca303596e 100644 --- a/sys/net/route.h +++ b/sys/net/route.h @@ -429,7 +429,6 @@ struct sockaddr *rtsock_fix_netmask(const struct sockaddr *dst, void rt_updatemtu(struct ifnet *); -void rt_flushifroutes_af(struct ifnet *, int); void rt_flushifroutes(struct ifnet *ifp); /* XXX MRT NEW VERSIONS THAT USE FIBs @@ -442,6 +441,7 @@ int rib_lookup_info(uint32_t, const struct sockaddr *, uint32_t, uint32_t, void rib_free_info(struct rt_addrinfo *info); /* New API */ +void rib_flush_routes_family(int family); struct nhop_object *rib_lookup(uint32_t fibnum, const struct sockaddr *dst, uint32_t flags, uint32_t flowid); #endif diff --git a/sys/net/route/route_ctl.c b/sys/net/route/route_ctl.c index e07a94295b89..d9fd1aa18c92 100644 --- a/sys/net/route/route_ctl.c +++ b/sys/net/route/route_ctl.c @@ -1328,6 +1328,42 @@ rib_walk_del(u_int fibnum, int family, rib_filter_f_t *filter_f, void *arg, bool NET_EPOCH_EXIT(et); } +static int +rt_delete_unconditional(struct radix_node *rn, void *arg) +{ + struct rtentry *rt = RNTORT(rn); + struct rib_head *rnh = (struct rib_head *)arg; + + rn = rnh->rnh_deladdr(rt_key(rt), rt_mask(rt), &rnh->head); + if (RNTORT(rn) == rt) + rtfree(rt); + + return (0); +} + +/* + * Removes all routes from the routing table without executing notifications. + * rtentres will be removed after the end of a current epoch. + */ +static void +rib_flush_routes(struct rib_head *rnh) +{ + RIB_WLOCK(rnh); + rnh->rnh_walktree(&rnh->head, rt_delete_unconditional, rnh); + RIB_WUNLOCK(rnh); +} + +void +rib_flush_routes_family(int family) +{ + struct rib_head *rnh; + + for (uint32_t fibnum = 0; fibnum < rt_numfibs; fibnum++) { + if ((rnh = rt_tables_get_rnh(fibnum, family)) != NULL) + rib_flush_routes(rnh); + } +} + static void rib_notify(struct rib_head *rnh, enum rib_subscription_type type, struct rib_cmd_info *rc) diff --git a/sys/netinet/ip_input.c b/sys/netinet/ip_input.c index be21decff6cb..a85f8ac7b567 100644 --- a/sys/netinet/ip_input.c +++ b/sys/netinet/ip_input.c @@ -379,7 +379,6 @@ ip_init(void) static void ip_destroy(void *unused __unused) { - struct ifnet *ifp; int error; #ifdef RSS @@ -405,10 +404,7 @@ ip_destroy(void *unused __unused) in_ifscrub_all(); /* Make sure the IPv4 routes are gone as well. */ - IFNET_RLOCK(); - CK_STAILQ_FOREACH(ifp, &V_ifnet, if_link) - rt_flushifroutes_af(ifp, AF_INET); - IFNET_RUNLOCK(); + rib_flush_routes_family(AF_INET); /* Destroy IP reassembly queue. */ ipreass_destroy(); diff --git a/sys/netinet6/ip6_input.c b/sys/netinet6/ip6_input.c index 80e5acc62548..9ea578f88417 100644 --- a/sys/netinet6/ip6_input.c +++ b/sys/netinet6/ip6_input.c @@ -386,11 +386,12 @@ ip6_destroy(void *unused __unused) /* IF_ADDR_UNLOCK(ifp); */ in6_ifdetach_destroy(ifp); mld_domifdetach(ifp); - /* Make sure any routes are gone as well. */ - rt_flushifroutes_af(ifp, AF_INET6); } IFNET_RUNLOCK(); + /* Make sure any routes are gone as well. */ + rib_flush_routes_family(AF_INET6); + frag6_destroy(); nd6_destroy(); in6_ifattach_destroy(); From owner-dev-commits-src-main@freebsd.org Wed Mar 10 22:35: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 148D4579E43; Wed, 10 Mar 2021 22:35: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 4Dwn3603XNz4npR; Wed, 10 Mar 2021 22:35: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 E8E4A19743; Wed, 10 Mar 2021 22:35: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 12AMZT3K045955; Wed, 10 Mar 2021 22:35:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 12AMZTfK045954; Wed, 10 Mar 2021 22:35:29 GMT (envelope-from git) Date: Wed, 10 Mar 2021 22:35:29 GMT Message-Id: <202103102235.12AMZTfK045954@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: 15565e0a2177 - main - kern.mk: fix -Wno-error style to fix build with Clang 12 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: 15565e0a2177f53b086609fecd48991c52dad5eb 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, 10 Mar 2021 22:35:30 -0000 The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=15565e0a2177f53b086609fecd48991c52dad5eb commit 15565e0a2177f53b086609fecd48991c52dad5eb Author: Greg V AuthorDate: 2021-03-10 22:17:09 +0000 Commit: Ed Maste CommitDate: 2021-03-10 22:34:35 +0000 kern.mk: fix -Wno-error style to fix build with Clang 12 Clang 12 no longer supports -Wno-error-..., only the -Wno-error=... style (which is already used everywhere else in the tree). Differential Revision: https://reviews.freebsd.org/D29157 --- sys/conf/kern.mk | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/sys/conf/kern.mk b/sys/conf/kern.mk index b0a26cd1680c..35e873783cf0 100644 --- a/sys/conf/kern.mk +++ b/sys/conf/kern.mk @@ -17,21 +17,21 @@ CWARNFLAGS?= -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes \ # kernel where fixing them is more trouble than it is worth, or where there is # a false positive. .if ${COMPILER_TYPE} == "clang" -NO_WCONSTANT_CONVERSION= -Wno-error-constant-conversion +NO_WCONSTANT_CONVERSION= -Wno-error=constant-conversion NO_WSHIFT_COUNT_NEGATIVE= -Wno-shift-count-negative NO_WSHIFT_COUNT_OVERFLOW= -Wno-shift-count-overflow NO_WSELF_ASSIGN= -Wno-self-assign -NO_WUNNEEDED_INTERNAL_DECL= -Wno-error-unneeded-internal-declaration -NO_WSOMETIMES_UNINITIALIZED= -Wno-error-sometimes-uninitialized -NO_WCAST_QUAL= -Wno-error-cast-qual +NO_WUNNEEDED_INTERNAL_DECL= -Wno-error=unneeded-internal-declaration +NO_WSOMETIMES_UNINITIALIZED= -Wno-error=sometimes-uninitialized +NO_WCAST_QUAL= -Wno-error=cast-qual NO_WTAUTOLOGICAL_POINTER_COMPARE= -Wno-tautological-pointer-compare # Several other warnings which might be useful in some cases, but not severe # enough to error out the whole kernel build. Display them anyway, so there is # some incentive to fix them eventually. -CWARNEXTRA?= -Wno-error-tautological-compare -Wno-error-empty-body \ - -Wno-error-parentheses-equality -Wno-error-unused-function \ - -Wno-error-pointer-sign -CWARNEXTRA+= -Wno-error-shift-negative-value +CWARNEXTRA?= -Wno-error=tautological-compare -Wno-error=empty-body \ + -Wno-error=parentheses-equality -Wno-error=unused-function \ + -Wno-error=pointer-sign +CWARNEXTRA+= -Wno-error=shift-negative-value CWARNEXTRA+= -Wno-address-of-packed-member .if ${COMPILER_VERSION} >= 100000 NO_WMISLEADING_INDENTATION= -Wno-misleading-indentation From owner-dev-commits-src-main@freebsd.org Thu Mar 11 08:58: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 291BE56F64C; Thu, 11 Mar 2021 08:58: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 4Dx2tQ0Msjz4Xg2; Thu, 11 Mar 2021 08:58: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 E958F21B3C; Thu, 11 Mar 2021 08:58: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 12B8wrxh065869; Thu, 11 Mar 2021 08:58:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 12B8wrkZ065868; Thu, 11 Mar 2021 08:58:53 GMT (envelope-from git) Date: Thu, 11 Mar 2021 08:58:53 GMT Message-Id: <202103110858.12B8wrkZ065868@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: 7d4a5de84d5e - main - share/man/man9/pwmbus.9 fix types in arguments 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: 7d4a5de84d5e54242edc06573522616869e0b37a 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, 11 Mar 2021 08:58:54 -0000 The branch main has been updated by manu: URL: https://cgit.FreeBSD.org/src/commit/?id=7d4a5de84d5e54242edc06573522616869e0b37a commit 7d4a5de84d5e54242edc06573522616869e0b37a Author: Oskar Holmund AuthorDate: 2021-03-11 08:53:26 +0000 Commit: Emmanuel Vadot CommitDate: 2021-03-11 08:57:04 +0000 share/man/man9/pwmbus.9 fix types in arguments Fix the types of period and duty in share/man/man9/pwmbus.9 to match the one in sys/dev/pmw/pwmbus.c. Reviewed By: rpokala Differential Revision: https://reviews.freebsd.org/D29139 MFC after: 3 days --- share/man/man9/pwmbus.9 | 30 +++++++++++++++--------------- sys/dev/pwm/pwmbus_if.m | 14 +++++++------- 2 files changed, 22 insertions(+), 22 deletions(-) diff --git a/share/man/man9/pwmbus.9 b/share/man/man9/pwmbus.9 index a233d035dba9..858a27b9afe3 100644 --- a/share/man/man9/pwmbus.9 +++ b/share/man/man9/pwmbus.9 @@ -22,7 +22,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 21, 2019 +.Dd March 9, 2021 .Dt PWMBUS 9 .Os .Sh NAME @@ -40,19 +40,19 @@ .Cd "device pwm" .In "pwmbus_if.h" .Ft int -.Fn PWMBUS_CHANNEL_CONFIG "device_t bus" "int channel" "uint64_t period" "uint64_t duty" +.Fn PWMBUS_CHANNEL_CONFIG "device_t bus" "u_int channel" "u_int period" "u_int duty" .Ft int -.Fn PWMBUS_CHANNEL_COUNT "device_t bus" "int channel" "int *nchannel" +.Fn PWMBUS_CHANNEL_COUNT "device_t bus" "u_int *nchannel" .Ft int -.Fn PWMBUS_CHANNEL_ENABLE "device_t bus" "int channel" "bool enable" +.Fn PWMBUS_CHANNEL_ENABLE "device_t bus" "u_int channel" "bool enable" .Ft int -.Fn PWMBUS_CHANNEL_GET_CONFIG "device_t bus" "int channel" "uint64_t *period" "uint64_t *duty" +.Fn PWMBUS_CHANNEL_GET_CONFIG "device_t bus" "u_int channel" "u_int *period" "u_int *duty" .Ft int -.Fn PWMBUS_CHANNEL_GET_FLAGS "device_t bus" "int channel" "uint32_t *flags" +.Fn PWMBUS_CHANNEL_GET_FLAGS "device_t bus" "u_int channel" "uint32_t *flags" .Ft int -.Fn PWMBUS_CHANNEL_IS_ENABLED "device_t bus" "int channel" "bool *enabled" +.Fn PWMBUS_CHANNEL_IS_ENABLED "device_t bus" "u_int channel" "bool *enabled" .Ft int -.Fn PWMBUS_CHANNEL_SET_FLAGS "device_t bus" "int channel" "uint32_t flags" +.Fn PWMBUS_CHANNEL_SET_FLAGS "device_t bus" "u_int channel" "uint32_t flags" .Sh DESCRIPTION The PWMBUS (Pulse-Width Modulation) interface allows a device driver to register to a global bus so other devices in the kernel can use them in a @@ -76,7 +76,7 @@ Consult the documentation for the underlying PWM hardware device driver for details on channels that share resources. .Sh INTERFACE .Bl -tag -width indent -.It Fn PWMBUS_CHANNEL_CONFIG "device_t bus" "int channel" "uint64_t period" "uint64_t duty" +.It Fn PWMBUS_CHANNEL_CONFIG "device_t bus" "u_int channel" "u_int period" "u_int duty" Configure the period and duty (in nanoseconds) in the PWM controller on the bus for the specified channel. Returns 0 on success or @@ -85,19 +85,19 @@ if the values are not supported by the controller or .Er EBUSY if the PWMBUS controller is in use and does not support changing the value on the fly. -.It Fn PWMBUS_CHANNEL_COUNT "device_t bus" "int *nchannel" +.It Fn PWMBUS_CHANNEL_COUNT "device_t bus" "u_int *nchannel" Get the number of channels supported by the controller. -.It Fn PWMBUS_CHANNEL_ENABLE "device_t bus" "int channel" "bool enable" +.It Fn PWMBUS_CHANNEL_ENABLE "device_t bus" "u_int channel" "bool enable" Enable the PWM channel. -.It Fn PWMBUS_CHANNEL_GET_CONFIG "device_t bus" "int channel" "uint64_t *period" "uint64_t *duty" +.It Fn PWMBUS_CHANNEL_GET_CONFIG "device_t bus" "u_int channel" "u_int *period" "u_int *duty" Get the current configuration of the period and duty for the specified channel. -.It Fn PWMBUS_CHANNEL_GET_FLAGS "device_t bus" "int channel" "uint32_t *flags" +.It Fn PWMBUS_CHANNEL_GET_FLAGS "device_t bus" "u_int channel" "uint32_t *flags" Get the current flags for the channel. If the driver or controller does not support this, a default method returns a flags value of zero. -.It Fn PWMBUS_CHANNEL_IS_ENABLED "device_t bus" "int channel" "bool *enable" +.It Fn PWMBUS_CHANNEL_IS_ENABLED "device_t bus" "u_int channel" "bool *enable" Test whether the PWM channel is enabled. -.It Fn PWMBUS_CHANNEL_SET_FLAGS "device_t bus" "int channel" "uint32_t flags" +.It Fn PWMBUS_CHANNEL_SET_FLAGS "device_t bus" "u_int channel" "uint32_t flags" Set the flags of the channel (such as inverted polarity). If the driver or controller does not support this a do-nothing default method is used. diff --git a/sys/dev/pwm/pwmbus_if.m b/sys/dev/pwm/pwmbus_if.m index 4e7b49bf405c..f81e92907847 100644 --- a/sys/dev/pwm/pwmbus_if.m +++ b/sys/dev/pwm/pwmbus_if.m @@ -33,14 +33,14 @@ INTERFACE pwmbus; CODE { static int - pwm_default_set_flags(device_t dev, u_int channel, uint32_t flags) + pwm_default_set_flags(device_t bus, u_int channel, uint32_t flags) { return (EOPNOTSUPP); } static int - pwm_default_get_flags(device_t dev, u_int channel, uint32_t *flags) + pwm_default_get_flags(device_t bus, u_int channel, uint32_t *flags) { *flags = 0; @@ -55,8 +55,8 @@ CODE { METHOD int channel_config { device_t bus; u_int channel; - unsigned int period; - unsigned int duty; + u_int period; + u_int duty; }; # @@ -66,8 +66,8 @@ METHOD int channel_config { METHOD int channel_get_config { device_t bus; u_int channel; - unsigned int *period; - unsigned int *duty; + u_int *period; + u_int *duty; }; # @@ -83,7 +83,7 @@ METHOD int channel_set_flags { # Get the flags # METHOD int channel_get_flags { - device_t dev; + device_t bus; u_int channel; uint32_t *flags; } DEFAULT pwm_default_get_flags; From owner-dev-commits-src-main@freebsd.org Thu Mar 11 08:58: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 353BF56F367; Thu, 11 Mar 2021 08:58: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 4Dx2tR12KZz4Xg3; Thu, 11 Mar 2021 08:58: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 166B821F8F; Thu, 11 Mar 2021 08:58: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 12B8wseO065892; Thu, 11 Mar 2021 08:58:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 12B8wsgJ065891; Thu, 11 Mar 2021 08:58:54 GMT (envelope-from git) Date: Thu, 11 Mar 2021 08:58:54 GMT Message-Id: <202103110858.12B8wsgJ065891@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: 17b14d8f7733 - main - usr.sbin/pwm/pwm add support for flags 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: 17b14d8f7733d39397ae5fc104547e358f5f7ddf 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, 11 Mar 2021 08:58:55 -0000 The branch main has been updated by manu: URL: https://cgit.FreeBSD.org/src/commit/?id=17b14d8f7733d39397ae5fc104547e358f5f7ddf commit 17b14d8f7733d39397ae5fc104547e358f5f7ddf Author: Oskar Holmund AuthorDate: 2021-03-11 08:55:23 +0000 Commit: Emmanuel Vadot CommitDate: 2021-03-11 08:57:56 +0000 usr.sbin/pwm/pwm add support for flags The pwm utility cant set the only flag defined (PWM_POLARITY_INVERTED) so this patch add the option -I (capital letter i) to send it to the drivers. None of existing PWM driver have implemented support for flags. But soon:ish I will put up an review of a pwm driver using TI OMAP DMTimer. Differential Revision: https://reviews.freebsd.org/D29137 MFC after: 2 weeks --- sys/dev/pwm/pwmc.c | 19 ++++++++++++++++--- usr.sbin/pwm/pwm.8 | 3 +++ usr.sbin/pwm/pwm.c | 19 +++++++++++++++---- 3 files changed, 34 insertions(+), 7 deletions(-) diff --git a/sys/dev/pwm/pwmc.c b/sys/dev/pwm/pwmc.c index c49d1e894488..b2f12add3e2b 100644 --- a/sys/dev/pwm/pwmc.c +++ b/sys/dev/pwm/pwmc.c @@ -80,9 +80,16 @@ pwm_ioctl(struct cdev *dev, u_long cmd, caddr_t data, bcopy(data, &state, sizeof(state)); rv = PWMBUS_CHANNEL_CONFIG(bus, sc->chan, state.period, state.duty); - if (rv == 0) - rv = PWMBUS_CHANNEL_ENABLE(bus, sc->chan, - state.enable); + if (rv != 0) + return (rv); + + rv = PWMBUS_CHANNEL_SET_FLAGS(bus, + sc->chan, state.flags); + if (rv != 0 && rv != EOPNOTSUPP) + return (rv); + + rv = PWMBUS_CHANNEL_ENABLE(bus, sc->chan, + state.enable); break; case PWMGETSTATE: bcopy(data, &state, sizeof(state)); @@ -90,6 +97,12 @@ pwm_ioctl(struct cdev *dev, u_long cmd, caddr_t data, &state.period, &state.duty); if (rv != 0) return (rv); + + rv = PWMBUS_CHANNEL_GET_FLAGS(bus, sc->chan, + &state.flags); + if (rv != 0) + return (rv); + rv = PWMBUS_CHANNEL_IS_ENABLED(bus, sc->chan, &state.enable); if (rv != 0) diff --git a/usr.sbin/pwm/pwm.8 b/usr.sbin/pwm/pwm.8 index 37c1aa8fec49..94be5af7f703 100644 --- a/usr.sbin/pwm/pwm.8 +++ b/usr.sbin/pwm/pwm.8 @@ -35,6 +35,7 @@ .Nm .Op Fl f Ar device .Op Fl D | Fl E +.Op Fl I .Op Fl p Ar period .Op Fl d Ar duty .Sh DESCRIPTION @@ -82,6 +83,8 @@ during which the signal is asserted. Enable the PWM channel. .It Fl p Ar period Configure the period (in nanoseconds) of the PWM channel. +.It Fl I +Invert PWM signal polarity .El .Sh EXAMPLES .Bl -bullet diff --git a/usr.sbin/pwm/pwm.c b/usr.sbin/pwm/pwm.c index a69fe16fea22..441181917afd 100644 --- a/usr.sbin/pwm/pwm.c +++ b/usr.sbin/pwm/pwm.c @@ -48,6 +48,7 @@ #define PWM_SHOW_CONFIG 0x0004 #define PWM_PERIOD 0x0008 #define PWM_DUTY 0x0010 +#define PWM_INVERTED 0x0020 static char device_name[PATH_MAX] = "/dev/pwm/pwmc0.0"; @@ -66,7 +67,7 @@ usage(void) { fprintf(stderr, "Usage:\n"); fprintf(stderr, "\tpwm [-f dev] -C\n"); - fprintf(stderr, "\tpwm [-f dev] [-D | -E] [-p period] [-d duty[%%]]\n"); + fprintf(stderr, "\tpwm [-f dev] [-D | -E] [-I] [-p period] [-d duty[%%]]\n"); exit(1); } @@ -87,7 +88,7 @@ main(int argc, char *argv[]) fd = -1; period = duty = -1; - while ((ch = getopt(argc, argv, "f:EDCp:d:")) != -1) { + while ((ch = getopt(argc, argv, "f:EDCIp:d:")) != -1) { switch (ch) { case 'E': if (action & (PWM_DISABLE | PWM_SHOW_CONFIG)) @@ -104,6 +105,11 @@ main(int argc, char *argv[]) usage(); action = PWM_SHOW_CONFIG; break; + case 'I': + if (action & PWM_SHOW_CONFIG) + usage(); + action |= PWM_INVERTED; + break; case 'p': if (action & PWM_SHOW_CONFIG) usage(); @@ -172,10 +178,11 @@ main(int argc, char *argv[]) } if (action == PWM_SHOW_CONFIG) { - printf("period: %u\nduty: %u\nenabled:%d\n", + printf("period: %u\nduty: %u\nenabled:%d\ninverted:%d\n", state.period, state.duty, - state.enable); + state.enable, + state.flags & PWM_POLARITY_INVERTED); } else { if (action & PWM_ENABLE) state.enable = true; @@ -183,6 +190,10 @@ main(int argc, char *argv[]) state.enable = false; if (action & PWM_PERIOD) state.period = period; + if (action & PWM_INVERTED) + state.flags |= PWM_POLARITY_INVERTED; + else + state.flags &= ~PWM_POLARITY_INVERTED; if (action & PWM_DUTY) { if (*percent != '\0') state.duty = (uint64_t)state.period * duty / 100; From owner-dev-commits-src-main@freebsd.org Thu Mar 11 09:41: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 84359570EFC; Thu, 11 Mar 2021 09:41: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 4Dx3qC3P2vz4bR9; Thu, 11 Mar 2021 09:41: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 6713922745; Thu, 11 Mar 2021 09:41: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 12B9fBhh029737; Thu, 11 Mar 2021 09:41:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 12B9fBZS029736; Thu, 11 Mar 2021 09:41:11 GMT (envelope-from git) Date: Thu, 11 Mar 2021 09:41:11 GMT Message-Id: <202103110941.12B9fBZS029736@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: 5e9dae8e149a - main - pf: Factor out pf_krule_free() 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: 5e9dae8e149ae8848f52148b665f3a0d031ca40f 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, 11 Mar 2021 09:41:11 -0000 The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=5e9dae8e149ae8848f52148b665f3a0d031ca40f commit 5e9dae8e149ae8848f52148b665f3a0d031ca40f Author: Kristof Provost AuthorDate: 2021-03-10 10:10:04 +0000 Commit: Kristof Provost CommitDate: 2021-03-11 09:39:43 +0000 pf: Factor out pf_krule_free() Reviewed by: melifaro@ MFC after: 1 week Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D29194 --- sys/net/pfvar.h | 2 ++ sys/netpfil/pf/pf_ioctl.c | 50 ++++++++++++++++++++--------------------------- 2 files changed, 23 insertions(+), 29 deletions(-) diff --git a/sys/net/pfvar.h b/sys/net/pfvar.h index 3f2075b8f0e2..31be6b7a833d 100644 --- a/sys/net/pfvar.h +++ b/sys/net/pfvar.h @@ -1641,6 +1641,8 @@ void pf_remove_if_empty_kruleset(struct pf_kruleset *); struct pf_kruleset *pf_find_kruleset(const char *); struct pf_kruleset *pf_find_or_create_kruleset(const char *); void pf_rs_initialize(void); + +void pf_krule_free(struct pf_krule *); #endif /* The fingerprint functions can be linked into userland programs (tcpdump) */ diff --git a/sys/netpfil/pf/pf_ioctl.c b/sys/netpfil/pf/pf_ioctl.c index c32a961f5a0b..5f9eb771d0e0 100644 --- a/sys/netpfil/pf/pf_ioctl.c +++ b/sys/netpfil/pf/pf_ioctl.c @@ -466,15 +466,8 @@ pf_free_rule(struct pf_krule *rule) pfi_kkif_unref(rule->kif); pf_kanchor_remove(rule); pf_empty_kpool(&rule->rpool.list); - counter_u64_free(rule->evaluations); - for (int i = 0; i < 2; i++) { - counter_u64_free(rule->packets[i]); - counter_u64_free(rule->bytes[i]); - } - counter_u64_free(rule->states_cur); - counter_u64_free(rule->states_tot); - counter_u64_free(rule->src_nodes); - free(rule, M_PFRULE); + + pf_krule_free(rule); } static void @@ -1435,6 +1428,23 @@ pf_altq_get_nth_active(u_int32_t n) } #endif /* ALTQ */ +void +pf_krule_free(struct pf_krule *rule) +{ + if (rule == NULL) + return; + + counter_u64_free(rule->evaluations); + for (int i = 0; i < 2; i++) { + counter_u64_free(rule->packets[i]); + counter_u64_free(rule->bytes[i]); + } + counter_u64_free(rule->states_cur); + counter_u64_free(rule->states_tot); + counter_u64_free(rule->src_nodes); + free(rule, M_PFRULE); +} + static void pf_kpooladdr_to_pooladdr(const struct pf_kpooladdr *kpool, struct pf_pooladdr *pool) @@ -1990,15 +2000,7 @@ pfioctl(struct cdev *dev, u_long cmd, caddr_t addr, int flags, struct thread *td #undef ERROUT DIOCADDRULE_error: PF_RULES_WUNLOCK(); - counter_u64_free(rule->evaluations); - for (int i = 0; i < 2; i++) { - counter_u64_free(rule->packets[i]); - counter_u64_free(rule->bytes[i]); - } - counter_u64_free(rule->states_cur); - counter_u64_free(rule->states_tot); - counter_u64_free(rule->src_nodes); - free(rule, M_PFRULE); + pf_krule_free(rule); if (kif) pf_kkif_free(kif); break; @@ -2297,17 +2299,7 @@ DIOCADDRULE_error: #undef ERROUT DIOCCHANGERULE_error: PF_RULES_WUNLOCK(); - if (newrule != NULL) { - counter_u64_free(newrule->evaluations); - for (int i = 0; i < 2; i++) { - counter_u64_free(newrule->packets[i]); - counter_u64_free(newrule->bytes[i]); - } - counter_u64_free(newrule->states_cur); - counter_u64_free(newrule->states_tot); - counter_u64_free(newrule->src_nodes); - free(newrule, M_PFRULE); - } + pf_krule_free(newrule); if (kif != NULL) pf_kkif_free(kif); break; From owner-dev-commits-src-main@freebsd.org Thu Mar 11 09:41: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 B9410570FAC; Thu, 11 Mar 2021 09:41: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 4Dx3qD4RcPz4bLC; Thu, 11 Mar 2021 09:41: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 8B497226CD; Thu, 11 Mar 2021 09:41: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 12B9fCKO029759; Thu, 11 Mar 2021 09:41:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 12B9fC9Z029758; Thu, 11 Mar 2021 09:41:12 GMT (envelope-from git) Date: Thu, 11 Mar 2021 09:41:12 GMT Message-Id: <202103110941.12B9fC9Z029758@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: 913e7dc3e0eb - main - pf: Remove redundant kif != NULL checks 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: 913e7dc3e0eb7df78ec0e7ecc7dd160a316a3ac6 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, 11 Mar 2021 09:41:12 -0000 The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=913e7dc3e0eb7df78ec0e7ecc7dd160a316a3ac6 commit 913e7dc3e0eb7df78ec0e7ecc7dd160a316a3ac6 Author: Kristof Provost AuthorDate: 2021-03-10 14:50:42 +0000 Commit: Kristof Provost CommitDate: 2021-03-11 09:39:43 +0000 pf: Remove redundant kif != NULL checks pf_kkif_free() already checks for NULL, so we don't have to check before we call it. Reviewed by: melifaro@ MFC after: 1 week Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D29195 --- sys/netpfil/pf/pf_ioctl.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/sys/netpfil/pf/pf_ioctl.c b/sys/netpfil/pf/pf_ioctl.c index 5f9eb771d0e0..977f0debacaa 100644 --- a/sys/netpfil/pf/pf_ioctl.c +++ b/sys/netpfil/pf/pf_ioctl.c @@ -2001,8 +2001,7 @@ pfioctl(struct cdev *dev, u_long cmd, caddr_t addr, int flags, struct thread *td DIOCADDRULE_error: PF_RULES_WUNLOCK(); pf_krule_free(rule); - if (kif) - pf_kkif_free(kif); + pf_kkif_free(kif); break; } @@ -2300,8 +2299,7 @@ DIOCADDRULE_error: DIOCCHANGERULE_error: PF_RULES_WUNLOCK(); pf_krule_free(newrule); - if (kif != NULL) - pf_kkif_free(kif); + pf_kkif_free(kif); break; } @@ -3144,8 +3142,7 @@ DIOCCHANGEADDR_error: free(newpa, M_PFRULE); } PF_RULES_WUNLOCK(); - if (kif != NULL) - pf_kkif_free(kif); + pf_kkif_free(kif); break; } From owner-dev-commits-src-main@freebsd.org Thu Mar 11 15:24: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 00EF057950B; Thu, 11 Mar 2021 15:24: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 4DxCRc6Mp1z3C3K; Thu, 11 Mar 2021 15:24: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 CD82026F32; Thu, 11 Mar 2021 15:24: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 12BFOiP5079827; Thu, 11 Mar 2021 15:24:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 12BFOila079826; Thu, 11 Mar 2021 15:24:44 GMT (envelope-from git) Date: Thu, 11 Mar 2021 15:24:44 GMT Message-Id: <202103111524.12BFOila079826@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: 1645a4ae645f - main - usb: tiny formatting nit 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: 1645a4ae645fa9b9e3571b7512caa92e73b20635 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, 11 Mar 2021 15:24:45 -0000 The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=1645a4ae645fa9b9e3571b7512caa92e73b20635 commit 1645a4ae645fa9b9e3571b7512caa92e73b20635 Author: Warner Losh AuthorDate: 2021-03-11 15:23:32 +0000 Commit: Warner Losh CommitDate: 2021-03-11 15:24:13 +0000 usb: tiny formatting nit Format 300 baud like all the others here. No functional change. --- sys/dev/usb/serial/umct.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/dev/usb/serial/umct.c b/sys/dev/usb/serial/umct.c index 43f28c307f6d..dd452d38a67b 100644 --- a/sys/dev/usb/serial/umct.c +++ b/sys/dev/usb/serial/umct.c @@ -478,7 +478,8 @@ static uint8_t umct_calc_baud(uint32_t baud) { switch (baud) { - case B300:return (0x1); + case B300: + return (0x1); case B600: return (0x2); case B1200: From owner-dev-commits-src-main@freebsd.org Thu Mar 11 15:37: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 C19CE57954E; Thu, 11 Mar 2021 15:37: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 4DxCkp59f1z3DCS; Thu, 11 Mar 2021 15:37: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 A47A827492; Thu, 11 Mar 2021 15:37: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 12BFbsiA093086; Thu, 11 Mar 2021 15:37:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 12BFbsES093085; Thu, 11 Mar 2021 15:37:54 GMT (envelope-from git) Date: Thu, 11 Mar 2021 15:37:54 GMT Message-Id: <202103111537.12BFbsES093085@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: 968079f253c1 - main - vm_reserv: Fix list locking in vm_reserv_reclaim_contig() 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: 968079f253c11433d47bece4b41b46fcbf985903 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, 11 Mar 2021 15:37:54 -0000 The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=968079f253c11433d47bece4b41b46fcbf985903 commit 968079f253c11433d47bece4b41b46fcbf985903 Author: Mark Johnston AuthorDate: 2021-03-11 15:34:28 +0000 Commit: Mark Johnston CommitDate: 2021-03-11 15:35:35 +0000 vm_reserv: Fix list locking in vm_reserv_reclaim_contig() The per-domain partpop queue is locked by the combination of the per-domain lock and individual reservation mutexes. vm_reserv_reclaim_contig() scans the queue looking for partially populated reservations that can be reclaimed in order to satisfy the caller's allocation. During the scan, we drop the per-domain lock. At this point, the rvn pointer may be invalidated. Take care to load rvn after re-acquiring the per-domain lock. While here, simplify the condition used to check whether a reservation was dequeued while the per-domain lock was dropped. Reviewed by: alc, kib Reported by: gallatin MFC after: 3 days Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D29203 --- sys/vm/vm_reserv.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/sys/vm/vm_reserv.c b/sys/vm/vm_reserv.c index e7f542a66fdb..a9602c3977df 100644 --- a/sys/vm/vm_reserv.c +++ b/sys/vm/vm_reserv.c @@ -1344,8 +1344,8 @@ vm_reserv_reclaim_contig(int domain, u_long npages, vm_paddr_t low, TAILQ_INSERT_AFTER(queue, rv, marker, partpopq); vm_reserv_domain_unlock(domain); vm_reserv_lock(rv); - if (!rv->inpartpopq || - TAILQ_NEXT(rv, partpopq) != marker) { + if (TAILQ_PREV(marker, vm_reserv_queue, partpopq) != + rv) { vm_reserv_unlock(rv); vm_reserv_domain_lock(domain); rvn = TAILQ_NEXT(marker, partpopq); @@ -1363,8 +1363,9 @@ vm_reserv_reclaim_contig(int domain, u_long npages, vm_paddr_t low, vm_reserv_unlock(rv); return (true); } - vm_reserv_unlock(rv); vm_reserv_domain_lock(domain); + rvn = TAILQ_NEXT(rv, partpopq); + vm_reserv_unlock(rv); } vm_reserv_domain_unlock(domain); vm_reserv_domain_scan_unlock(domain); From owner-dev-commits-src-main@freebsd.org Thu Mar 11 15:50: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 4065F579E24; Thu, 11 Mar 2021 15:50: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 4DxD1v0PQ7z3F6T; Thu, 11 Mar 2021 15:50: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 010A727823; Thu, 11 Mar 2021 15:50: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 12BFowrI016114; Thu, 11 Mar 2021 15:50:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 12BFowtT016112; Thu, 11 Mar 2021 15:50:58 GMT (envelope-from git) Date: Thu, 11 Mar 2021 15:50:58 GMT Message-Id: <202103111550.12BFowtT016112@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Edward Tomasz Napierala Subject: git: dc0119c28194 - main - linsysfs: create /sys/bus/ and /sys/subsystem/ MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: trasz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: dc0119c28194b537cfa2ad95ce2e62589da7ceb0 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, 11 Mar 2021 15:50:59 -0000 The branch main has been updated by trasz: URL: https://cgit.FreeBSD.org/src/commit/?id=dc0119c28194b537cfa2ad95ce2e62589da7ceb0 commit dc0119c28194b537cfa2ad95ce2e62589da7ceb0 Author: Edward Tomasz Napierala AuthorDate: 2021-03-08 20:55:44 +0000 Commit: Edward Tomasz Napierala CommitDate: 2021-03-11 15:50:51 +0000 linsysfs: create /sys/bus/ and /sys/subsystem/ This looks like a no-op, but it prevents udevadm(8) with failing loudly, which in turn unbreaks installation of libfprint-2-2, which in Focal is a dependency for make-4.2.1-1.2. One might wonder why installing a build utility involves messing with device handling... Sponsored By: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D29133 --- sys/compat/linsysfs/linsysfs.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sys/compat/linsysfs/linsysfs.c b/sys/compat/linsysfs/linsysfs.c index 66cb36db9868..8d3be1507de9 100644 --- a/sys/compat/linsysfs/linsysfs.c +++ b/sys/compat/linsysfs/linsysfs.c @@ -633,6 +633,9 @@ linsysfs_init(PFS_INIT_ARGS) root = pi->pi_root; + /* /sys/bus/... */ + dir = pfs_create_dir(root, "bus", NULL, NULL, NULL, 0); + /* /sys/class/... */ class = pfs_create_dir(root, "class", NULL, NULL, NULL, 0); scsi = pfs_create_dir(class, "scsi_host", NULL, NULL, NULL, 0); @@ -679,6 +682,9 @@ linsysfs_init(PFS_INIT_ARGS) /* /sys/kernel/debug, mountpoint for lindebugfs. */ debug = pfs_create_dir(kernel, "debug", NULL, NULL, NULL, 0); + /* /sys/subsystem/... */ + dir = pfs_create_dir(root, "subsystem", NULL, NULL, NULL, 0); + return (0); } From owner-dev-commits-src-main@freebsd.org Thu Mar 11 16:45: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 4631B57B7A1; Thu, 11 Mar 2021 16:45: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 4DxFDS1Y6dz3JnB; Thu, 11 Mar 2021 16:45: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 27EA5FD; Thu, 11 Mar 2021 16:45: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 12BGjCKW085211; Thu, 11 Mar 2021 16:45:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 12BGjCx0085210; Thu, 11 Mar 2021 16:45:12 GMT (envelope-from git) Date: Thu, 11 Mar 2021 16:45:12 GMT Message-Id: <202103111645.12BGjCx0085210@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: e52368365db3 - main - config_intrhook: provide config_intrhook_drain 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: e52368365db3c0a696b37bfc09d08b7093b41b57 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, 11 Mar 2021 16:45:12 -0000 The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=e52368365db3c0a696b37bfc09d08b7093b41b57 commit e52368365db3c0a696b37bfc09d08b7093b41b57 Author: Warner Losh AuthorDate: 2021-03-11 15:42:09 +0000 Commit: Warner Losh CommitDate: 2021-03-11 16:45:10 +0000 config_intrhook: provide config_intrhook_drain config_intrhook_drain will remove the hook from the list as config_intrhook_disestablish does if the hook hasn't been called. If it has, config_intrhook_drain will wait for the hook to be disestablished in the normal course (or expedited, it's up to the driver to decide how and when to call config_intrhook_disestablish). This is intended for removable devices that use config_intrhook and might be attached early in boot, but that may be removed before the kernel can call the config_intrhook or before it ends. To prevent all races, the detach routine will need to call config_intrhook_train. Sponsored by: Netflix, Inc Reviewed by: jhb, mav, gde (in D29006 for man page) Differential Revision: https://reviews.freebsd.org/D29005 --- share/man/man9/Makefile | 1 + share/man/man9/config_intrhook.9 | 21 ++++++++++++++++- sys/kern/subr_autoconf.c | 50 +++++++++++++++++++++++++++++++++++++--- sys/sys/kernel.h | 6 ++++- 4 files changed, 73 insertions(+), 5 deletions(-) diff --git a/share/man/man9/Makefile b/share/man/man9/Makefile index fb010231d710..52a5d373a417 100644 --- a/share/man/man9/Makefile +++ b/share/man/man9/Makefile @@ -859,6 +859,7 @@ MLINKS+=condvar.9 cv_broadcast.9 \ condvar.9 cv_wait_unlock.9 \ condvar.9 cv_wmesg.9 MLINKS+=config_intrhook.9 config_intrhook_disestablish.9 \ + config_intrhook.9 config_intrhook_drain.9 \ config_intrhook.9 config_intrhook_establish.9 \ config_intrhook.9 config_intrhook_oneshot.9 MLINKS+=contigmalloc.9 contigmalloc_domainset.9 \ diff --git a/share/man/man9/config_intrhook.9 b/share/man/man9/config_intrhook.9 index 0414ad88218a..6892a089b00f 100644 --- a/share/man/man9/config_intrhook.9 +++ b/share/man/man9/config_intrhook.9 @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 10, 2017 +.Dd March 8, 2021 .Dt CONFIG_INTRHOOK 9 .Os .Sh NAME @@ -40,6 +40,8 @@ but before root is mounted .Fn config_intrhook_establish "struct intr_config_hook *hook" .Ft void .Fn config_intrhook_disestablish "struct intr_config_hook *hook" +.Ft int +.Fn config_intrhook_drain "struct intr_config_hook *hook" .Ft void .Fn config_intrhook_oneshot "ich_func_t func" "void *arg" .Sh DESCRIPTION @@ -55,6 +57,23 @@ The function removes the entry from the hook queue. .Pp The +.Fn config_intrhook_drain +function removes the entry from the hook queue in a safe way. +If the hook is not currently active it removes +.Fa hook +from the hook queue and returns +.Vt ICHS_QUEUED . +If the hook is active, it waits for the hook to complete before returning +.Vt ICHS_RUNNING . +If the hook has previously completed, it returns +.Vt ICHS_DONE . +Because a +.Vt config_intrhook +is undefined prior to +.Fn config_intrhook_establish , +this function may only be called after that function has returned. +.Pp +The .Fn config_intrhook_oneshot function schedules a function to be run as described for .Fn config_intrhook_establish ; diff --git a/sys/kern/subr_autoconf.c b/sys/kern/subr_autoconf.c index 063396a8e139..f6039e34e29f 100644 --- a/sys/kern/subr_autoconf.c +++ b/sys/kern/subr_autoconf.c @@ -138,6 +138,7 @@ run_interrupt_driven_config_hooks() while (next_to_notify != NULL) { hook_entry = next_to_notify; next_to_notify = STAILQ_NEXT(hook_entry, ich_links); + hook_entry->ich_state = ICHS_RUNNING; mtx_unlock(&intr_config_hook_lock); (*hook_entry->ich_func)(hook_entry->ich_arg); mtx_lock(&intr_config_hook_lock); @@ -199,6 +200,7 @@ config_intrhook_establish(struct intr_config_hook *hook) STAILQ_INSERT_TAIL(&intr_config_hook_list, hook, ich_links); if (next_to_notify == NULL) next_to_notify = hook; + hook->ich_state = ICHS_QUEUED; mtx_unlock(&intr_config_hook_lock); if (cold == 0) /* @@ -226,12 +228,11 @@ config_intrhook_oneshot(ich_func_t func, void *arg) config_intrhook_establish(&ohook->och_hook); } -void -config_intrhook_disestablish(struct intr_config_hook *hook) +static void +config_intrhook_disestablish_locked(struct intr_config_hook *hook) { struct intr_config_hook *hook_entry; - mtx_lock(&intr_config_hook_lock); STAILQ_FOREACH(hook_entry, &intr_config_hook_list, ich_links) if (hook_entry == hook) break; @@ -245,8 +246,51 @@ config_intrhook_disestablish(struct intr_config_hook *hook) TSRELEASE("config hooks"); /* Wakeup anyone watching the list */ + hook->ich_state = ICHS_DONE; wakeup(&intr_config_hook_list); +} + +void +config_intrhook_disestablish(struct intr_config_hook *hook) +{ + mtx_lock(&intr_config_hook_lock); + config_intrhook_disestablish_locked(hook); + mtx_unlock(&intr_config_hook_lock); +} + +int +config_intrhook_drain(struct intr_config_hook *hook) +{ + mtx_lock(&intr_config_hook_lock); + + /* + * The config hook has completed, so just return. + */ + if (hook->ich_state == ICHS_DONE) { + mtx_unlock(&intr_config_hook_lock); + return (ICHS_DONE); + } + + /* + * The config hook hasn't started running, just call disestablish. + */ + if (hook->ich_state == ICHS_QUEUED) { + config_intrhook_disestablish_locked(hook); + mtx_unlock(&intr_config_hook_lock); + return (ICHS_QUEUED); + } + + /* + * The config hook is running, so wait for it to complete and return. + */ + while (hook->ich_state != ICHS_DONE) { + if (msleep(&intr_config_hook_list, &intr_config_hook_lock, + 0, "confhd", hz) == EWOULDBLOCK) { + // XXX do I whine? + } + } mtx_unlock(&intr_config_hook_lock); + return (ICHS_RUNNING); } #ifdef DDB diff --git a/sys/sys/kernel.h b/sys/sys/kernel.h index 89582ca5403d..e96eb52b52fd 100644 --- a/sys/sys/kernel.h +++ b/sys/sys/kernel.h @@ -467,13 +467,17 @@ typedef void (*ich_func_t)(void *_arg); struct intr_config_hook { STAILQ_ENTRY(intr_config_hook) ich_links; - uintptr_t ich_padding; + uintptr_t ich_state; +#define ICHS_QUEUED 0x1 +#define ICHS_RUNNING 0x2 +#define ICHS_DONE 0x3 ich_func_t ich_func; void *ich_arg; }; int config_intrhook_establish(struct intr_config_hook *hook); void config_intrhook_disestablish(struct intr_config_hook *hook); +int config_intrhook_drain(struct intr_config_hook *hook); void config_intrhook_oneshot(ich_func_t _func, void *_arg); #endif /* !_SYS_KERNEL_H_*/ From owner-dev-commits-src-main@freebsd.org Thu Mar 11 16:45:13 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 7531B57B871; Thu, 11 Mar 2021 16:45:13 +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 4DxFDT2q8Lz3Jqd; Thu, 11 Mar 2021 16:45:13 +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 4A68BFE; Thu, 11 Mar 2021 16:45:13 +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 12BGjDBU085232; Thu, 11 Mar 2021 16:45:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 12BGjDvh085231; Thu, 11 Mar 2021 16:45:13 GMT (envelope-from git) Date: Thu, 11 Mar 2021 16:45:13 GMT Message-Id: <202103111645.12BGjDvh085231@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: 8423f5d4c127 - main - nvme: use config_intrhook_drain to avoid removable card races 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: 8423f5d4c127f18e7500bc455bc7b6b1691385ef 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, 11 Mar 2021 16:45:13 -0000 The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=8423f5d4c127f18e7500bc455bc7b6b1691385ef commit 8423f5d4c127f18e7500bc455bc7b6b1691385ef Author: Warner Losh AuthorDate: 2021-03-11 15:42:44 +0000 Commit: Warner Losh CommitDate: 2021-03-11 16:45:10 +0000 nvme: use config_intrhook_drain to avoid removable card races nvme drives are configured early in boot. However, a number of the configuration steps takes which take a while, so we defer those to a config intrhook that runs before the root filesystem is mounted. At the same time, the PCI hot plug wakes up and tests the status of the card. It may decide that the card has gone away and deletes the child. As part of that process nvme_detach is called. If this call happens after the config_intrhook starts to run, but before it is finished, there's a race where we can tear down the device's soft state while the config_intrhook is still using it. Use the new config_intrhook_drain to disestablish the hook. Either it will be removed w/o running, or the routine will wait for it to finish. This closes the race and allows safe hotplug at any time, even very early in boot. Sponsored by: Netflix, Inc Reviewed by: jhb, mav Differential Revision: https://reviews.freebsd.org/D29006 --- sys/dev/nvme/nvme.c | 5 +---- sys/dev/nvme/nvme_ctrlr.c | 2 -- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/sys/dev/nvme/nvme.c b/sys/dev/nvme/nvme.c index 3c145c817f88..f36125ba247b 100644 --- a/sys/dev/nvme/nvme.c +++ b/sys/dev/nvme/nvme.c @@ -143,10 +143,7 @@ nvme_detach(device_t dev) { struct nvme_controller *ctrlr = DEVICE2SOFTC(dev); - if (ctrlr->config_hook.ich_arg != NULL) { - config_intrhook_disestablish(&ctrlr->config_hook); - ctrlr->config_hook.ich_arg = NULL; - } + config_intrhook_drain(&ctrlr->config_hook); nvme_ctrlr_destruct(ctrlr, dev); return (0); diff --git a/sys/dev/nvme/nvme_ctrlr.c b/sys/dev/nvme/nvme_ctrlr.c index 351c6839a6f6..9e45c0e2d19e 100644 --- a/sys/dev/nvme/nvme_ctrlr.c +++ b/sys/dev/nvme/nvme_ctrlr.c @@ -1135,7 +1135,6 @@ nvme_ctrlr_start_config_hook(void *arg) fail: nvme_ctrlr_fail(ctrlr); config_intrhook_disestablish(&ctrlr->config_hook); - ctrlr->config_hook.ich_arg = NULL; return; } @@ -1154,7 +1153,6 @@ fail: nvme_sysctl_initialize_ctrlr(ctrlr); config_intrhook_disestablish(&ctrlr->config_hook); - ctrlr->config_hook.ich_arg = NULL; ctrlr->is_initialized = 1; nvme_notify_new_controller(ctrlr); From owner-dev-commits-src-main@freebsd.org Thu Mar 11 17:13: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 6CA4057C1A0; Thu, 11 Mar 2021 17:13:44 +0000 (UTC) (envelope-from jhb@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 4DxFsN2ftqz3Lmc; Thu, 11 Mar 2021 17:13:44 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro.local (ralph.baldwin.cx [66.234.199.215]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id B5A7CE5A6; Thu, 11 Mar 2021 17:13:43 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Subject: Re: git: d1cbe7908986 - main - Allocating the LinuxKPI current structure from an interrupt thread must be done using the M_NOWAIT flag after 1ae20f7c70ea . To: Hans Petter Selasky , Konstantin Belousov Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org References: <202103100952.12A9qRKR040117@gitrepo.freebsd.org> <2b1739ab-000c-ca28-5a59-0a3e19ef4591@selasky.org> From: John Baldwin Message-ID: <5aaa5f2a-a67d-a495-7f56-a6b31c2494c7@FreeBSD.org> Date: Thu, 11 Mar 2021 09:13:42 -0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:78.0) Gecko/20100101 Thunderbird/78.7.1 MIME-Version: 1.0 In-Reply-To: <2b1739ab-000c-ca28-5a59-0a3e19ef4591@selasky.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit 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, 11 Mar 2021 17:13:44 -0000 On 3/10/21 2:09 AM, Hans Petter Selasky wrote: > On 3/10/21 11:04 AM, Konstantin Belousov wrote: >> This probably hangs machine instead of panicing. In low memory condition, >> you do not handle interrupt, which probably mean that the source is not >> silenced, and after EOI the same interrupt will be generated again. > > Hi, > > This usually happens during boot. Another possibility is to panic() > there. I don't see so many options. Is there no way to pre-allocate this? That is, could we not have all ithreads invoke this during their initialization, and have the module handler for linuxkpi iterate over ithreads allocating one for each ithread during MOD_LOAD? I think there are few enough ithreads that allocating "extra" ones is probably ok. Alternatively, you could hook into the path when an interrupt is registered perhaps by passing some sort of INTR_LINUX flag or the like that causes kern_intr.c to allocate one for the associated ithread when the interrupt is registered. -- John Baldwin From owner-dev-commits-src-main@freebsd.org Thu Mar 11 17:24: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 8E31C57C07E; Thu, 11 Mar 2021 17:24:03 +0000 (UTC) (envelope-from jhb@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 4DxG5H3Xj6z3MTK; Thu, 11 Mar 2021 17:24:03 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro.local (ralph.baldwin.cx [66.234.199.215]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id DA889D86E; Thu, 11 Mar 2021 17:24:02 +0000 (UTC) (envelope-from jhb@FreeBSD.org) To: Mateusz Guzik , Kyle Evans Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org References: <202103091117.129BHOZa042851@gitrepo.freebsd.org> From: John Baldwin Subject: Re: git: 1ae20f7c70ea - main - kern: malloc: fix panic on M_WAITOK during THREAD_NO_SLEEPING() Message-ID: <8e37c710-bd9d-6fe0-0263-4efeabfd9beb@FreeBSD.org> Date: Thu, 11 Mar 2021 09:23:58 -0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:78.0) Gecko/20100101 Thunderbird/78.7.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit 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, 11 Mar 2021 17:24:03 -0000 On 3/10/21 3:57 AM, Mateusz Guzik wrote: > There is something very wrong going on here. > > Key thing to note is that malloc is ultimately a wrapper around > uma_zalloc. Whatever asserts you may want to add to malloc to catch > problems sooner, should also present in uma. > > uma has the following: > > if (flags & M_WAITOK) { > WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, NULL, > "uma_zalloc_debug: zone \"%s\"", zone->uz_name); > } This warns about holding locks, not about TD_NO_SLEEPING. Witness' role is to check lock orders and warn about invalid operations when holding certain locks. It does not currently verify anything about other inhibitions like TD_NO_SLEEPING. See, e.g. the list of assertions in userret() which includes a WITNESS_WARN in addition to several other checks (including TD_NO_SLEEPING). Arguably we should just move the TD_NO_SLEEPING check from malloc() to here along with the td_intr_nesting_level. Any case where you can't use malloc() with M_WAITOK you can't use uma with M_WAITOK either. > This code used to execute prior to this commit and fail to catch the > problems which got reported already. > > In other words: > - WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK is incomplete in terms of > internals its internals > - the above should be in malloc, perhaps after being abstracted into a > an assert-helper > - fixing witness deficiency will probably find a slew of new problems > - this should remain as a warning (maybe rate-limited) for the foreseable future I don't know that we've had so many issues that we can't just fix them on HEAD right now vs having to make this a warning instead of keeping it as a panic. -- John Baldwin From owner-dev-commits-src-main@freebsd.org Thu Mar 11 17:39: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 760AC57C559; Thu, 11 Mar 2021 17:39:08 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.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 4DxGQh2fMFz3NVs; Thu, 11 Mar 2021 17:39:08 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1615484348; 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: in-reply-to:in-reply-to:references:references; bh=hvpy29zrpEBk7JkeqnvMCTxdSrnsaJ21NlReM2R8SBE=; b=jCFap4bdmpWqUABJeFtlHPYTawzhUCbLkOZSgAAb2OWBaGdHHPGVJDMhp1jPgS+i9oCksZ HTBnMK1Qsvpx7pb+/MLaaFWWboe79xnsaKZQUc273iYcGWkQajjiGBoPwsjtSatUssTPWy N1zy82601a2AcHRACXS49zcOL71KtHH8k3VsaDvJGeVaVn8xSivlxoQvoBYa8cGSUYvfr7 vvC5jKCWFOoB1q+ktnkkgSM3VttHS3n6fPbSE7Pxg8TZCZpnCQhfWkNInMVUpYsTFPmUyF THRUSWwg1w0BihX8PeqYUFmJ5BZtawyJUX2mu7FmDLYbOTjSkmLNF5fHkSFkxw== Received: from mail.xzibition.com (unknown [127.0.1.132]) (using TLSv1.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 freefall.freebsd.org (Postfix) with ESMTPS id 2EAA41EEF6; Thu, 11 Mar 2021 17:39:08 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [172.31.3.2]) by mail.xzibition.com (Postfix) with ESMTP id 243C6188E7; Thu, 11 Mar 2021 17:39:07 +0000 (UTC) X-Virus-Scanned: amavisd-new at mail.xzibition.com Received: from mail.xzibition.com ([172.31.3.2]) by mail.xzibition.com (mail.xzibition.com [172.31.3.2]) (amavisd-new, port 10026) with LMTP id XfOM5E2V7DgT; Thu, 11 Mar 2021 17:39:05 +0000 (UTC) To: John Baldwin , Mateusz Guzik , Kyle Evans DKIM-Filter: OpenDKIM Filter v2.10.3 mail.xzibition.com B81C3188DF Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org References: <202103091117.129BHOZa042851@gitrepo.freebsd.org> <8e37c710-bd9d-6fe0-0263-4efeabfd9beb@FreeBSD.org> From: Bryan Drewery Organization: FreeBSD Subject: Re: git: 1ae20f7c70ea - main - kern: malloc: fix panic on M_WAITOK during THREAD_NO_SLEEPING() Message-ID: <9132135e-8653-4df8-984e-c00806e4e533@FreeBSD.org> Date: Thu, 11 Mar 2021 09:39:04 -0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.8.1 MIME-Version: 1.0 In-Reply-To: <8e37c710-bd9d-6fe0-0263-4efeabfd9beb@FreeBSD.org> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="aVuFBlAJPYlT86BMcrZFhw1NvKwD0NTlj" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1615484348; 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: in-reply-to:in-reply-to:references:references; bh=hvpy29zrpEBk7JkeqnvMCTxdSrnsaJ21NlReM2R8SBE=; b=acBlAkl5tZr3AQyx9bjqT+MhILV78eiL3qT5aMqXZeZ/qFUeTFNX5alY8BUTI1ERARGdT8 eO0idBS/wReCNvEFAU47Oex9jNeo7254ccENZiC/xvrGu/RyoVYhK36RjVkLYeEvUQO73U OdrAYRpPOJatvHkiJAsTdAZfqPGTc3DqqfFxZJJ5x9QCBGwb16OKdFiA38GF1lCpErSC6X k6lhG8QFEP3LlpCtf/53QvwS+z2W7G06b9ldYsYbPhwvZW1oXuhnGEqUHzNaPOx796JNoc StXEbcO/vmSc1p26GQxMSDIEpFxdqZzBtIWLVB58c4cOxqSpDiXwK6FSFDkUSA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1615484348; a=rsa-sha256; cv=none; b=VIjrP1b0LZf2yMpumtUjXDdzrpYsugEhOgFfY/AsmGG49HYo8cOkPsXHj2j9oKl8FWTi3F ce52XsEsfJTGLkGQFJ5EqV3AiO6zcsDWY4U10rqjtrn9RhKvTvufqQRAOEoStwQQ1tkgjO WHXltyVfLdBc7hHtrJ8oDviig2izOQRv2SeNR+63T7EqzaHNCTuXvM9dyyBGnAGt4itbEV sI3S2pcDBUs8mJn+yaOJs5z9p4uIlRt1cB0LWcuqCQPnC72eFTM2czFgVUeFanNjSJ9KuD QtjeibASmonvF8wTo4s3CFM3vw1EkRkRmVTxFhu+w7te5gZgb8NTEffBzHIXwQ== 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: Thu, 11 Mar 2021 17:39:08 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --aVuFBlAJPYlT86BMcrZFhw1NvKwD0NTlj Content-Type: multipart/mixed; boundary="o29koHnVcEqidntWU1GWZqJO9ROUgfbX6"; protected-headers="v1" From: Bryan Drewery To: John Baldwin , Mateusz Guzik , Kyle Evans Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Message-ID: <9132135e-8653-4df8-984e-c00806e4e533@FreeBSD.org> Subject: Re: git: 1ae20f7c70ea - main - kern: malloc: fix panic on M_WAITOK during THREAD_NO_SLEEPING() References: <202103091117.129BHOZa042851@gitrepo.freebsd.org> <8e37c710-bd9d-6fe0-0263-4efeabfd9beb@FreeBSD.org> In-Reply-To: <8e37c710-bd9d-6fe0-0263-4efeabfd9beb@FreeBSD.org> --o29koHnVcEqidntWU1GWZqJO9ROUgfbX6 Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable On 3/11/2021 9:23 AM, John Baldwin wrote: > On 3/10/21 3:57 AM, Mateusz Guzik wrote: =2E.. > I don't know that we've had so many issues that we can't just fix them = on > HEAD right now vs having to make this a warning instead of keeping it a= s > a panic. >=20 Given this isn't a consistency assertion, a nice temporary mechanism would be to only warn during boot but panic for instances seen after that. Perhaps collecting and spamming the early warnings continually too so they get reported. Then less people are blocked from upgrading or having to deal with boot panics, and may be able to avoid triggering other cases. It's one thing to have INVARIANTS on HEAD and expect everyone to chip in on that, but another to have a prolonged unstable range of commits. just my 2 cents, Bryan --o29koHnVcEqidntWU1GWZqJO9ROUgfbX6-- --aVuFBlAJPYlT86BMcrZFhw1NvKwD0NTlj Content-Type: application/pgp-signature; name="OpenPGP_signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="OpenPGP_signature" -----BEGIN PGP SIGNATURE----- wsB5BAABCAAjFiEE+Rc8ssOq6npcih8JNddxu25Gl88FAmBKVbgFAwAAAAAACgkQNddxu25Gl8/r DQgAyXA6GZ/RjOKrEqcb0kSnMLzTdjws/55e+zpjgJTivXbcg4rHxDrsWBriqypHD3QlzaezitD/ uJuO8F5LZq7NizWQ6GaMfiq93L875OS75WtsZo701YDmxChhO4UAantRIS9/V0B1OHaDcKzHMCJy I73mhmYPYoeScTKBDH7Folj4Hvk4Y3o9AkefiAhDDfunIpnzE1tiY9KDgLxTB7edycIaom/FjBRV S10+JSAzB0SNihlPr3229EBh8rd9zK9QTlcKRGcMCM8Ksd8l7U/miAx1MZOGWHkZ/8vUjnSUtbeO PEADeI3nEKu5fmsiRCYlHk7xZJVutHlbx2vi0B1Axw== =Gs8d -----END PGP SIGNATURE----- --aVuFBlAJPYlT86BMcrZFhw1NvKwD0NTlj-- From owner-dev-commits-src-main@freebsd.org Thu Mar 11 18:18: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 148E657D7E7; Thu, 11 Mar 2021 18:18:07 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (turbocat.net [88.99.82.50]) (using TLSv1.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 4DxHHf6dWdz3RLY; Thu, 11 Mar 2021 18:18:06 +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 32FD2260988; Thu, 11 Mar 2021 19:17:59 +0100 (CET) Subject: Re: git: d1cbe7908986 - main - Allocating the LinuxKPI current structure from an interrupt thread must be done using the M_NOWAIT flag after 1ae20f7c70ea . To: John Baldwin , Konstantin Belousov Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org References: <202103100952.12A9qRKR040117@gitrepo.freebsd.org> <2b1739ab-000c-ca28-5a59-0a3e19ef4591@selasky.org> <5aaa5f2a-a67d-a495-7f56-a6b31c2494c7@FreeBSD.org> From: Hans Petter Selasky Message-ID: Date: Thu, 11 Mar 2021 19:17:41 +0100 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:78.0) Gecko/20100101 Thunderbird/78.5.0 MIME-Version: 1.0 In-Reply-To: <5aaa5f2a-a67d-a495-7f56-a6b31c2494c7@FreeBSD.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4DxHHf6dWdz3RLY 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, 11 Mar 2021 18:18:07 -0000 On 3/11/21 6:13 PM, John Baldwin wrote: > On 3/10/21 2:09 AM, Hans Petter Selasky wrote: >> On 3/10/21 11:04 AM, Konstantin Belousov wrote: >>> This probably hangs machine instead of panicing.  In low memory >>> condition, >>> you do not handle interrupt, which probably mean that the source is not >>> silenced, and after EOI the same interrupt will be generated again. >> >> Hi, >> >> This usually happens during boot. Another possibility is to panic() >> there. I don't see so many options. > > Is there no way to pre-allocate this?  That is, could we not have all > ithreads invoke this during their initialization, and have the module > handler for linuxkpi iterate over ithreads allocating one for > each ithread during MOD_LOAD? > > I think there are few enough ithreads that allocating "extra" ones > is probably ok.  Alternatively, you could hook into the path when an > interrupt is registered perhaps by passing some sort of INTR_LINUX > flag or the like that causes kern_intr.c to allocate one for the > associated ithread when the interrupt is registered. > Yes, I have a review for that: https://reviews.freebsd.org/D29183 --HPS From owner-dev-commits-src-main@freebsd.org Thu Mar 11 18:35: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 69D355A9AC4; Thu, 11 Mar 2021 18:35:32 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.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 4DxHgm09Rxz3k9w; Thu, 11 Mar 2021 18:35:31 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.16.1/8.16.1) with ESMTPS id 12BIZNWL011269 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Thu, 11 Mar 2021 20:35:26 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua 12BIZNWL011269 Received: (from kostik@localhost) by tom.home (8.16.1/8.16.1/Submit) id 12BIZNce011267; Thu, 11 Mar 2021 20:35:23 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Thu, 11 Mar 2021 20:35:23 +0200 From: Konstantin Belousov To: Hans Petter Selasky Cc: John Baldwin , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: d1cbe7908986 - main - Allocating the LinuxKPI current structure from an interrupt thread must be done using the M_NOWAIT flag after 1ae20f7c70ea . Message-ID: References: <202103100952.12A9qRKR040117@gitrepo.freebsd.org> <2b1739ab-000c-ca28-5a59-0a3e19ef4591@selasky.org> <5aaa5f2a-a67d-a495-7f56-a6b31c2494c7@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on tom.home X-Rspamd-Queue-Id: 4DxHgm09Rxz3k9w 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, 11 Mar 2021 18:35:32 -0000 On Thu, Mar 11, 2021 at 07:17:41PM +0100, Hans Petter Selasky wrote: > On 3/11/21 6:13 PM, John Baldwin wrote: > > On 3/10/21 2:09 AM, Hans Petter Selasky wrote: > > > On 3/10/21 11:04 AM, Konstantin Belousov wrote: > > > > This probably hangs machine instead of panicing.  In low memory > > > > condition, > > > > you do not handle interrupt, which probably mean that the source is not > > > > silenced, and after EOI the same interrupt will be generated again. > > > > > > Hi, > > > > > > This usually happens during boot. Another possibility is to panic() > > > there. I don't see so many options. > > > > Is there no way to pre-allocate this?  That is, could we not have all > > ithreads invoke this during their initialization, and have the module > > handler for linuxkpi iterate over ithreads allocating one for > > each ithread during MOD_LOAD? > > > > I think there are few enough ithreads that allocating "extra" ones > > is probably ok.  Alternatively, you could hook into the path when an > > interrupt is registered perhaps by passing some sort of INTR_LINUX > > flag or the like that causes kern_intr.c to allocate one for the > > associated ithread when the interrupt is registered. > > > > Yes, I have a review for that: > https://reviews.freebsd.org/D29183 And I dislike this. It is yet another case of introducing consumer-specific logic into core. Isn't netepoch example enough? I presented another patch to Hans, where task and mm allocations are switched to zones, and the zones have reserve applied. Then allocations from ithreads use the reserve. There is one detail there, reserve is finite, for x86 I set it to the total limit of interrupts. This somewhat breaks if interrupts are deallocated and reallocated, but I think it is good enough even with this wart. From owner-dev-commits-src-main@freebsd.org Thu Mar 11 18:42: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 28CBF5A9BC0; Thu, 11 Mar 2021 18:42:12 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (turbocat.net [88.99.82.50]) (using TLSv1.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 4DxHqS01w3z3kD4; Thu, 11 Mar 2021 18:42:11 +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)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 3646B260243; Thu, 11 Mar 2021 19:42:10 +0100 (CET) Subject: Re: git: d1cbe7908986 - main - Allocating the LinuxKPI current structure from an interrupt thread must be done using the M_NOWAIT flag after 1ae20f7c70ea . To: Konstantin Belousov Cc: John Baldwin , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org References: <202103100952.12A9qRKR040117@gitrepo.freebsd.org> <2b1739ab-000c-ca28-5a59-0a3e19ef4591@selasky.org> <5aaa5f2a-a67d-a495-7f56-a6b31c2494c7@FreeBSD.org> From: Hans Petter Selasky Message-ID: <3dcd63b0-fe90-2855-f349-2117ca4b6b26@selasky.org> Date: Thu, 11 Mar 2021 19:41:53 +0100 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:78.0) Gecko/20100101 Thunderbird/78.5.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4DxHqS01w3z3kD4 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, 11 Mar 2021 18:42:12 -0000 On 3/11/21 7:35 PM, Konstantin Belousov wrote: > And I dislike this. It is yet another case of introducing consumer-specific > logic into core. Isn't netepoch example enough? > > I presented another patch to Hans, where task and mm allocations are > switched to zones, and the zones have reserve applied. Then allocations > from ithreads use the reserve. > > There is one detail there, reserve is finite, for x86 I set it to the > total limit of interrupts. This somewhat breaks if interrupts are > deallocated and reallocated, but I think it is good enough even with > this wart. Hi, Your patch doesn't address the issue of initializing the pointers in question once. Still, for every call, we need to check if the pointer is valid. This is not neccessary. Also I don't see why we need to create a own UMA zone for these simple structures. Won't the per-CPU sysctl consume more memory than the actual task structures being allocated? --HPS From owner-dev-commits-src-main@freebsd.org Thu Mar 11 18:48: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 9D9815A9DDC; Thu, 11 Mar 2021 18:48: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 4DxHyt4337z3kYY; Thu, 11 Mar 2021 18:48: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 7DC191A38; Thu, 11 Mar 2021 18:48: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 12BImcof045451; Thu, 11 Mar 2021 18:48:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 12BImc8P045448; Thu, 11 Mar 2021 18:48:38 GMT (envelope-from git) Date: Thu, 11 Mar 2021 18:48:38 GMT Message-Id: <202103111848.12BImc8P045448@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: c22076b52839 - main - man: Remove obsolete info from hosts man page 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: c22076b5283970908e74b3abece53efc4670e87d 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, 11 Mar 2021 18:48:38 -0000 The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=c22076b5283970908e74b3abece53efc4670e87d commit c22076b5283970908e74b3abece53efc4670e87d Author: Warner Losh AuthorDate: 2021-03-11 18:46:10 +0000 Commit: Warner Losh CommitDate: 2021-03-11 18:46:10 +0000 man: Remove obsolete info from hosts man page The NIC no longer provides a host database, and hasn't for quite some time. Remove that paragraph, it's not been relevant for many years. Also, hosts appeared in 4.1c, not 4.2, so correct that too. Noticed by: Henry Bent --- share/man/man5/hosts.5 | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/share/man/man5/hosts.5 b/share/man/man5/hosts.5 index 8b5dbaf3271c..d80c544b3644 100644 --- a/share/man/man5/hosts.5 +++ b/share/man/man5/hosts.5 @@ -64,20 +64,6 @@ These include addresses for the local interfaces that .Xr ifconfig 8 needs at boot time and a few machines on the local network. .Pp -This file may be created from the official host -data base maintained at the Network Information Control -Center -.Pq Tn NIC , -though local changes may be required -to bring it up to date regarding unofficial aliases -and/or unknown hosts. -As the data base maintained at -.Tn NIC -is incomplete, use of the name server is recommended for -sites on the -.Tn DARPA -Internet. -.Pp Network addresses are specified in the conventional ``.'' (dot) notation using the .Xr inet_addr 3 @@ -106,4 +92,4 @@ file resides in The .Nm file format appeared in -.Bx 4.2 . +.Bx 4.1c . From owner-dev-commits-src-main@freebsd.org Thu Mar 11 19:04: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 73F845AA7B6; Thu, 11 Mar 2021 19:04:31 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.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 4DxJKC0SFLz3mqD; Thu, 11 Mar 2021 19:04:30 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.16.1/8.16.1) with ESMTPS id 12BJ4NwJ017752 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Thu, 11 Mar 2021 21:04:26 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua 12BJ4NwJ017752 Received: (from kostik@localhost) by tom.home (8.16.1/8.16.1/Submit) id 12BJ4NYX017751; Thu, 11 Mar 2021 21:04:23 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Thu, 11 Mar 2021 21:04:23 +0200 From: Konstantin Belousov To: Hans Petter Selasky Cc: John Baldwin , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: d1cbe7908986 - main - Allocating the LinuxKPI current structure from an interrupt thread must be done using the M_NOWAIT flag after 1ae20f7c70ea . Message-ID: References: <202103100952.12A9qRKR040117@gitrepo.freebsd.org> <2b1739ab-000c-ca28-5a59-0a3e19ef4591@selasky.org> <5aaa5f2a-a67d-a495-7f56-a6b31c2494c7@FreeBSD.org> <3dcd63b0-fe90-2855-f349-2117ca4b6b26@selasky.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3dcd63b0-fe90-2855-f349-2117ca4b6b26@selasky.org> X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on tom.home X-Rspamd-Queue-Id: 4DxJKC0SFLz3mqD 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, 11 Mar 2021 19:04:31 -0000 On Thu, Mar 11, 2021 at 07:41:53PM +0100, Hans Petter Selasky wrote: > On 3/11/21 7:35 PM, Konstantin Belousov wrote: > > And I dislike this. It is yet another case of introducing consumer-specific > > logic into core. Isn't netepoch example enough? > > > > I presented another patch to Hans, where task and mm allocations are > > switched to zones, and the zones have reserve applied. Then allocations > > from ithreads use the reserve. > > > > There is one detail there, reserve is finite, for x86 I set it to the > > total limit of interrupts. This somewhat breaks if interrupts are > > deallocated and reallocated, but I think it is good enough even with > > this wart. > > Hi, > > Your patch doesn't address the issue of initializing the pointers in > question once. Still, for every call, we need to check if the pointer is > valid. This is not neccessary. I do not understand what you are saying there. Which pointers? How does it not address? > > Also I don't see why we need to create a own UMA zone for these simple > structures. Won't the per-CPU sysctl consume more memory than the actual > task structures being allocated? Dedicated UMA zone allows to gracefully solve the requirement of non-failing allocation in non-sleepable context. This is much simpler and cleaner than either trying to enumerate all existing ithreads or adding consumer-specific controls into generic kernel facility. From owner-dev-commits-src-main@freebsd.org Thu Mar 11 19:20: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 2309A5AAD83; Thu, 11 Mar 2021 19:20:26 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (turbocat.net [88.99.82.50]) (using TLSv1.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 4DxJgY6xqDz3nSn; Thu, 11 Mar 2021 19:20:25 +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 50C662601F5; Thu, 11 Mar 2021 20:20:24 +0100 (CET) Subject: Re: git: d1cbe7908986 - main - Allocating the LinuxKPI current structure from an interrupt thread must be done using the M_NOWAIT flag after 1ae20f7c70ea . To: Konstantin Belousov Cc: John Baldwin , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org References: <202103100952.12A9qRKR040117@gitrepo.freebsd.org> <2b1739ab-000c-ca28-5a59-0a3e19ef4591@selasky.org> <5aaa5f2a-a67d-a495-7f56-a6b31c2494c7@FreeBSD.org> <3dcd63b0-fe90-2855-f349-2117ca4b6b26@selasky.org> From: Hans Petter Selasky Message-ID: <8fe37b5e-29a7-ffeb-fddb-3b31a6e79ab0@selasky.org> Date: Thu, 11 Mar 2021 20:20:05 +0100 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:78.0) Gecko/20100101 Thunderbird/78.5.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4DxJgY6xqDz3nSn 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, 11 Mar 2021 19:20:26 -0000 On 3/11/21 8:04 PM, Konstantin Belousov wrote: > On Thu, Mar 11, 2021 at 07:41:53PM +0100, Hans Petter Selasky wrote: >> On 3/11/21 7:35 PM, Konstantin Belousov wrote: >>> And I dislike this. It is yet another case of introducing consumer-specific >>> logic into core. Isn't netepoch example enough? >>> >>> I presented another patch to Hans, where task and mm allocations are >>> switched to zones, and the zones have reserve applied. Then allocations >>> from ithreads use the reserve. >>> >>> There is one detail there, reserve is finite, for x86 I set it to the >>> total limit of interrupts. This somewhat breaks if interrupts are >>> deallocated and reallocated, but I think it is good enough even with >>> this wart. >> >> Hi, >> >> Your patch doesn't address the issue of initializing the pointers in >> question once. Still, for every call, we need to check if the pointer is >> valid. This is not neccessary. > I do not understand what you are saying there. > Which pointers? How does it not address? Hi, The current code calls linux_set_current() for every interrupt and timer callback. That means we continue to check td_lkpi_task for NULL for every one of these calls. Not strictly needed. > >> >> Also I don't see why we need to create a own UMA zone for these simple >> structures. Won't the per-CPU sysctl consume more memory than the actual >> task structures being allocated? > Dedicated UMA zone allows to gracefully solve the requirement of non-failing > allocation in non-sleepable context. This is much simpler and cleaner than > either trying to enumerate all existing ithreads or adding consumer-specific > controls into generic kernel facility. > Maybe I'm new to UMA zones. The M_USE_RESERVE can also be used with malloc() ? --HPS From owner-dev-commits-src-main@freebsd.org Thu Mar 11 20:08: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 B08475AB951; Thu, 11 Mar 2021 20:08: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 4DxKkk4MPPz3r2X; Thu, 11 Mar 2021 20:08: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 845E62ADA; Thu, 11 Mar 2021 20:08: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 12BK8EH2051397; Thu, 11 Mar 2021 20:08:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 12BK8Eu2051396; Thu, 11 Mar 2021 20:08:14 GMT (envelope-from git) Date: Thu, 11 Mar 2021 20:08:14 GMT Message-Id: <202103112008.12BK8Eu2051396@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Edward Tomasz Napierala Subject: git: d28cbb7944e5 - main - development(7): update to reflect Git transition MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: trasz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d28cbb7944e5b1015d94a04cadc97d473838611e 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, 11 Mar 2021 20:08:14 -0000 The branch main has been updated by trasz: URL: https://cgit.FreeBSD.org/src/commit/?id=d28cbb7944e5b1015d94a04cadc97d473838611e commit d28cbb7944e5b1015d94a04cadc97d473838611e Author: Edward Tomasz Napierala AuthorDate: 2021-03-11 20:03:30 +0000 Commit: Edward Tomasz Napierala CommitDate: 2021-03-11 20:07:53 +0000 development(7): update to reflect Git transition Reviewed By: debdrup, imp (earlier version) Sponsored By: EPSRC Differential Revision: https://reviews.freebsd.org/D28939 --- share/man/man7/development.7 | 28 ++++++++++++++++++---------- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/share/man/man7/development.7 b/share/man/man7/development.7 index 48b3b19384ab..3feb133e0534 100644 --- a/share/man/man7/development.7 +++ b/share/man/man7/development.7 @@ -23,7 +23,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 19, 2020 +.Dd March 11, 2021 .Dt DEVELOPMENT 7 .Os .Sh NAME @@ -58,17 +58,25 @@ can be found at: .Lk https://www.FreeBSD.org/doc/en/articles/committers-guide/ .Pp .Fx -src development takes place in the CURRENT branch in Subversion, -located at: +src development takes place in the project-hosted +Git repository, located at: .Pp -.Lk https://svn.FreeBSD.org/base/head +.Lk https://git.FreeBSD.org/src.git .Pp -There is also a read-only GitHub mirror at: +The push URL is: .Pp -.Lk https://github.com/freebsd/freebsd +.Lk ssh://git@gitrepo.FreeBSD.org/src.git .Pp -Changes are first committed to CURRENT and then usually merged back -to STABLE. +There is also a public, read-only GitHub mirror at: +.Pp +.Lk https://github.com/freebsd/freebsd-src +.Pp +The +.Ql main +Git branch represents CURRENT; +all changes are first committed to CURRENT and then usually cherry-picked +back to STABLE, which refers to Git branches such as +.Ql stable/13 . Every few years the CURRENT branch is renamed to STABLE, and a new CURRENT is branched, with an incremented major version number. Releases are then branched off STABLE and numbered with consecutive minor @@ -114,7 +122,7 @@ the continuous integration system is at: Check out the CURRENT branch, build it, and install, overwriting the current system: .Bd -literal -offset indent -svnlite co https://svn.FreeBSD.org/base/head src +git clone https://git.FreeBSD.org/src.git src cd src make -sj8 buildworld buildkernel installkernel shutdown -r now @@ -166,7 +174,7 @@ make buildenv TARGET_ARCH=armv6 make -sj8 kernel KERNFAST=1 DESTDIR=/clients/arm .Ed .Sh SEE ALSO -.Xr svnlite 1 , +.Xr git 1 , .Xr witness 4 , .Xr build 7 , .Xr hier 7 , From owner-dev-commits-src-main@freebsd.org Thu Mar 11 20:46: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 5899B5ACA03; Thu, 11 Mar 2021 20:46: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 4DxLZS26y5z3t1N; Thu, 11 Mar 2021 20:46: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 3BB2E3825; Thu, 11 Mar 2021 20:46: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 12BKk8Ff003179; Thu, 11 Mar 2021 20:46:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 12BKk8Aa003178; Thu, 11 Mar 2021 20:46:08 GMT (envelope-from git) Date: Thu, 11 Mar 2021 20:46:08 GMT Message-Id: <202103112046.12BKk8Aa003178@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: 2f1cfb7f63ca - main - gmirror: Pre-allocate the timeout event structure 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: 2f1cfb7f63ca744e7a143896347bdc8606c291d6 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, 11 Mar 2021 20:46:08 -0000 The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=2f1cfb7f63ca744e7a143896347bdc8606c291d6 commit 2f1cfb7f63ca744e7a143896347bdc8606c291d6 Author: Mark Johnston AuthorDate: 2021-03-11 20:43:04 +0000 Commit: Mark Johnston CommitDate: 2021-03-11 20:45:15 +0000 gmirror: Pre-allocate the timeout event structure We can't call malloc(M_WAITOK) in a callout handler. Reviewed by: imp Reported by: pho Tested by: pho MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D29223 --- sys/geom/mirror/g_mirror.c | 43 ++++++++++++++++++++++++++++++++++--------- sys/geom/mirror/g_mirror.h | 1 + 2 files changed, 35 insertions(+), 9 deletions(-) diff --git a/sys/geom/mirror/g_mirror.c b/sys/geom/mirror/g_mirror.c index 350845205485..51836b7eabb8 100644 --- a/sys/geom/mirror/g_mirror.c +++ b/sys/geom/mirror/g_mirror.c @@ -115,6 +115,7 @@ static int g_mirror_update_disk(struct g_mirror_disk *disk, u_int state); static void g_mirror_update_device(struct g_mirror_softc *sc, bool force); static void g_mirror_dumpconf(struct sbuf *sb, const char *indent, struct g_geom *gp, struct g_consumer *cp, struct g_provider *pp); +static void g_mirror_timeout_drain(struct g_mirror_softc *sc); static int g_mirror_refresh_device(struct g_mirror_softc *sc, const struct g_provider *pp, const struct g_mirror_metadata *md); static void g_mirror_sync_reinit(const struct g_mirror_disk *disk, @@ -183,15 +184,14 @@ g_mirror_event_free(struct g_mirror_event *ep) free(ep, M_MIRROR); } -int -g_mirror_event_send(void *arg, int state, int flags) +static int +g_mirror_event_dispatch(struct g_mirror_event *ep, void *arg, int state, + int flags) { struct g_mirror_softc *sc; struct g_mirror_disk *disk; - struct g_mirror_event *ep; int error; - ep = malloc(sizeof(*ep), M_MIRROR, M_WAITOK); G_MIRROR_DEBUG(4, "%s: Sending event %p.", __func__, ep); if ((flags & G_MIRROR_EVENT_DEVICE) != 0) { disk = NULL; @@ -226,6 +226,15 @@ g_mirror_event_send(void *arg, int state, int flags) return (error); } +int +g_mirror_event_send(void *arg, int state, int flags) +{ + struct g_mirror_event *ep; + + ep = malloc(sizeof(*ep), M_MIRROR, M_WAITOK); + return (g_mirror_event_dispatch(ep, arg, state, flags)); +} + static struct g_mirror_event * g_mirror_event_first(struct g_mirror_softc *sc) { @@ -582,7 +591,7 @@ g_mirror_destroy_device(struct g_mirror_softc *sc) mtx_unlock(&sc->sc_events_mtx); } } - callout_drain(&sc->sc_callout); + g_mirror_timeout_drain(sc); g_topology_lock(); LIST_FOREACH_SAFE(cp, &sc->sc_sync.ds_geom->consumer, consumer, tmpcp) { @@ -2291,13 +2300,26 @@ static void g_mirror_go(void *arg) { struct g_mirror_softc *sc; + struct g_mirror_event *ep; sc = arg; G_MIRROR_DEBUG(0, "Force device %s start due to timeout.", sc->sc_name); - g_mirror_event_send(sc, 0, + ep = sc->sc_timeout_event; + sc->sc_timeout_event = NULL; + g_mirror_event_dispatch(ep, sc, 0, G_MIRROR_EVENT_DONTWAIT | G_MIRROR_EVENT_DEVICE); } +static void +g_mirror_timeout_drain(struct g_mirror_softc *sc) +{ + sx_assert(&sc->sc_lock, SX_XLOCKED); + + callout_drain(&sc->sc_callout); + g_mirror_event_free(sc->sc_timeout_event); + sc->sc_timeout_event = NULL; +} + static u_int g_mirror_determine_state(struct g_mirror_disk *disk) { @@ -2454,7 +2476,7 @@ g_mirror_update_device(struct g_mirror_softc *sc, bool force) * Disks went down in starting phase, so destroy * device. */ - callout_drain(&sc->sc_callout); + g_mirror_timeout_drain(sc); sc->sc_flags |= G_MIRROR_DEVICE_FLAG_DESTROY; G_MIRROR_DEBUG(1, "root_mount_rel[%u] %p", __LINE__, sc->sc_rootmount); @@ -2491,7 +2513,7 @@ g_mirror_update_device(struct g_mirror_softc *sc, bool force) } } else { /* Cancel timeout. */ - callout_drain(&sc->sc_callout); + g_mirror_timeout_drain(sc); } /* @@ -3153,10 +3175,13 @@ g_mirror_create(struct g_class *mp, const struct g_mirror_metadata *md, sc->sc_rootmount = root_mount_hold("GMIRROR"); G_MIRROR_DEBUG(1, "root_mount_hold %p", sc->sc_rootmount); + /* - * Run timeout. + * Schedule startup timeout. */ timeout = g_mirror_timeout * hz; + sc->sc_timeout_event = malloc(sizeof(struct g_mirror_event), M_MIRROR, + M_WAITOK); callout_reset(&sc->sc_callout, timeout, g_mirror_go, sc); return (sc->sc_geom); } diff --git a/sys/geom/mirror/g_mirror.h b/sys/geom/mirror/g_mirror.h index 57f341f752e1..7cec94adae18 100644 --- a/sys/geom/mirror/g_mirror.h +++ b/sys/geom/mirror/g_mirror.h @@ -207,6 +207,7 @@ struct g_mirror_softc { TAILQ_HEAD(, g_mirror_event) sc_events; struct mtx sc_events_mtx; + struct g_mirror_event *sc_timeout_event; struct callout sc_callout; From owner-dev-commits-src-main@freebsd.org Thu Mar 11 21:07: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 745FF5ACDC4; Thu, 11 Mar 2021 21:07:14 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: from mail-lj1-x235.google.com (mail-lj1-x235.google.com [IPv6:2a00:1450:4864:20::235]) (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 4DxM2p2Fx1z3v29; Thu, 11 Mar 2021 21:07:14 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: by mail-lj1-x235.google.com with SMTP id f16so3985790ljm.1; Thu, 11 Mar 2021 13:07:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=jxxviOhMpR+zatahLOz7lsjVuNN2lCjSSN92wag8JA4=; b=huid5XpDTyfib/GC3t37OSavxZiajLWvgn2CozvGNIq3FCNXL0CrmcextsjEbDs4hg w0dCX3+gmigQn1hUUy/qTMOpsZKj0i/Z4MvcEgjt7MXgUtLR7RW5Hiu6H9dAWjA+1sRp iAOzWIriC35XlEl+IGzBcLba0iZYpah335ZjPUfX2ZJVU7p+MRv6dKCLHBqUVS/JK/e5 6bO44UvqPbiEsfv2e8tXVVvNpLH0VnRuL8nm1+n8DRZ4KhhfKtLPAva3dCPTe5BWLHDu Kk+rb66gC6LeHE2FYcP5FlJl+gfIDtK5ZNU4hmiOYRifUZfoNcRJfDsUQVofiyQT0UJh zdbg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=jxxviOhMpR+zatahLOz7lsjVuNN2lCjSSN92wag8JA4=; b=tfTLqn8rDiKJ0Dch48AP1PR+7V84E/n75FJdwLgms3qF/kCtx3ONqs2K7F3feHjI2H dPWxfPsA0ufbVP/O3YFNQYW3gaJMFL6T37Dm8tgmhQccZX8xRd7cAw/HUmjGKNgfYJkq gbIS0oyxQz0B0nN8Bv0nry5SKqM841EEqg5mE+9HzhhTsEO5GjGXdPo7EdIOUrGVPvik VkbBk5aet+vFhsfAyz1ICycf+izIPMAQRntdLaK0bFvGEKHCiXB3bw3bCbS4FBm/gHGT DCoYKWrWtUOY9FQ4J7KrDk9CmCC4j/BVbQis45gq6bksSJ6F8lkoTxGg77WXMoTd/oXR hpXQ== X-Gm-Message-State: AOAM532u/OOpH6/8glQM270qOvuc7PhPGeFYHzEipISXmjk9HAqbWTh/ ACWEctzaVuxPrn0c+m2gjLKhCn9Tz58BlPiDUc3YfnlP7Ug= X-Google-Smtp-Source: ABdhPJw3NtTCmKS9zZZmzpEWzNO/RDgoh/QDU/H4qTzkrhDLcemFbxljHrSbFS+9ak3f4hcW4H2A8KXbkIoIgBgB3U4= X-Received: by 2002:a2e:534a:: with SMTP id t10mr426250ljd.499.1615496832143; Thu, 11 Mar 2021 13:07:12 -0800 (PST) MIME-Version: 1.0 Received: by 2002:a2e:b54e:0:0:0:0:0 with HTTP; Thu, 11 Mar 2021 13:07:11 -0800 (PST) In-Reply-To: <8e37c710-bd9d-6fe0-0263-4efeabfd9beb@FreeBSD.org> References: <202103091117.129BHOZa042851@gitrepo.freebsd.org> <8e37c710-bd9d-6fe0-0263-4efeabfd9beb@FreeBSD.org> From: Mateusz Guzik Date: Thu, 11 Mar 2021 22:07:11 +0100 Message-ID: Subject: Re: git: 1ae20f7c70ea - main - kern: malloc: fix panic on M_WAITOK during THREAD_NO_SLEEPING() To: John Baldwin Cc: Kyle Evans , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 4DxM2p2Fx1z3v29 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, 11 Mar 2021 21:07:14 -0000 On 3/11/21, John Baldwin wrote: > On 3/10/21 3:57 AM, Mateusz Guzik wrote: >> There is something very wrong going on here. >> >> Key thing to note is that malloc is ultimately a wrapper around >> uma_zalloc. Whatever asserts you may want to add to malloc to catch >> problems sooner, should also present in uma. >> >> uma has the following: >> >> if (flags & M_WAITOK) { >> WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, NULL, >> "uma_zalloc_debug: zone \"%s\"", zone->uz_name); >> } > > This warns about holding locks, not about TD_NO_SLEEPING. Witness' role > is to check lock orders and warn about invalid operations when holding > certain locks. It does not currently verify anything about other > inhibitions > like TD_NO_SLEEPING. See, e.g. the list of assertions in userret() which > includes a WITNESS_WARN in addition to several other checks (including > TD_NO_SLEEPING). Arguably we should just move the TD_NO_SLEEPING check > from malloc() to here along with the td_intr_nesting_level. Any case > where you can't use malloc() with M_WAITOK you can't use uma with M_WAITOK > either. > My point is that the witness check is clearly deficient even ignoring uma -- there are other places which do this and fail to properly check if going off cpu is allowed. In fact, looks like the TD_NO_SLEEPING stuff is already not properly checked for when taking sleepable locks. >> This code used to execute prior to this commit and fail to catch the >> problems which got reported already. >> >> In other words: >> - WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK is incomplete in terms of >> internals its internals >> - the above should be in malloc, perhaps after being abstracted into a >> an assert-helper >> - fixing witness deficiency will probably find a slew of new problems >> - this should remain as a warning (maybe rate-limited) for the foreseable >> future > > I don't know that we've had so many issues that we can't just fix them on > HEAD right now vs having to make this a warning instead of keeping it as > a panic. > > -- > John Baldwin > -- Mateusz Guzik From owner-dev-commits-src-main@freebsd.org Thu Mar 11 21:17: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 739125ACFBA; Thu, 11 Mar 2021 21:17: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 4DxMH62qv1z3v4l; Thu, 11 Mar 2021 21:17: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 4F7F23D1F; Thu, 11 Mar 2021 21:17: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 12BLHs1G043439; Thu, 11 Mar 2021 21:17:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 12BLHsj9043438; Thu, 11 Mar 2021 21:17:54 GMT (envelope-from git) Date: Thu, 11 Mar 2021 21:17:54 GMT Message-Id: <202103112117.12BLHsj9043438@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: ba5de7e93014 - main - SPDX: Spell 4 clause BSD license 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: ba5de7e9301438f69ee3532e19d7ec6d496cda05 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, 11 Mar 2021 21:17:54 -0000 The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=ba5de7e9301438f69ee3532e19d7ec6d496cda05 commit ba5de7e9301438f69ee3532e19d7ec6d496cda05 Author: Warner Losh AuthorDate: 2021-03-11 20:25:55 +0000 Commit: Warner Losh CommitDate: 2021-03-11 21:17:54 +0000 SPDX: Spell 4 clause BSD license correctly --- sys/powerpc/aim/moea64_native.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/powerpc/aim/moea64_native.c b/sys/powerpc/aim/moea64_native.c index a5837886a2a2..29ba51a48587 100644 --- a/sys/powerpc/aim/moea64_native.c +++ b/sys/powerpc/aim/moea64_native.c @@ -1,5 +1,5 @@ /*- - * SPDX-License-Identifier: BSD-2-Clause-FreeBSD AND 4-Clause-BSD + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD AND BSD-4-Clause * * Copyright (c) 2001 The NetBSD Foundation, Inc. * All rights reserved. From owner-dev-commits-src-main@freebsd.org Fri Mar 12 00:15: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 2F6CB568874; Fri, 12 Mar 2021 00:15: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 4DxRDV0pBtz4Zdt; Fri, 12 Mar 2021 00:15: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 0E5F65FE8; Fri, 12 Mar 2021 00:15: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 12C0Fr1Q080481; Fri, 12 Mar 2021 00:15:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 12C0Frgm080480; Fri, 12 Mar 2021 00:15:53 GMT (envelope-from git) Date: Fri, 12 Mar 2021 00:15:53 GMT Message-Id: <202103120015.12C0Frgm080480@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: 8a157722e947 - main - Remove README in favor of README.md 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: 8a157722e947191a63e9108cbfb60ee2605858b4 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, 12 Mar 2021 00:15:54 -0000 The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=8a157722e947191a63e9108cbfb60ee2605858b4 commit 8a157722e947191a63e9108cbfb60ee2605858b4 Author: Warner Losh AuthorDate: 2021-03-12 00:11:28 +0000 Commit: Warner Losh CommitDate: 2021-03-12 00:14:35 +0000 Remove README in favor of README.md Complete the transition to README.md I started 3 years ago. Remove the now-redundant README file. It's currently just README.md w/o the light markup and adds no real value. This also allows us to use additional MarkDown markup as we see fit w/o worrying about keeping things in sync. --- README | 80 ------------------------------------------------------------------ 1 file changed, 80 deletions(-) diff --git a/README b/README deleted file mode 100644 index aad363baf9ea..000000000000 --- a/README +++ /dev/null @@ -1,80 +0,0 @@ -This is the top level of the FreeBSD source directory. This file -was last revised on: -$FreeBSD$ - -FreeBSD is an operating system used to power modern servers, -desktops, and embedded platforms. A large community has -continually developed it for more than thirty years. Its -advanced networking, security, and storage features have -made FreeBSD the platform of choice for many of the -busiest web sites and most pervasive embedded networking -and storage devices. - -For copyright information, please see the file COPYRIGHT in this -directory. Additional copyright information also exists for some -sources in this tree - please see the specific source directories for -more information. - -The Makefile in this directory supports a number of targets for -building components (or all) of the FreeBSD source tree. See build(7), config(8), -https://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/makeworld.html, and -https://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/kernelconfig.html -for more information, including setting make(1) variables. - -Source Roadmap: ---------------- - -bin System/user commands. - -cddl Various commands and libraries under the Common Development - and Distribution License. - -contrib Packages contributed by 3rd parties. - -crypto Cryptography stuff (see crypto/README). - -etc Template files for /etc. - -gnu Various commands and libraries under the GNU Public License. - Please see gnu/COPYING* for more information. - -include System include files. - -kerberos5 Kerberos5 (Heimdal) package. - -lib System libraries. - -libexec System daemons. - -release Release building Makefile & associated tools. - -rescue Build system for statically linked /rescue utilities. - -sbin System commands. - -secure Cryptographic libraries and commands. - -share Shared resources. - -stand Boot loader sources. - -sys Kernel sources. - -sys//conf Kernel configuration files. GENERIC is the configuration - used in release builds. NOTES contains documentation of - all possible entries. - -tests Regression tests which can be run by Kyua. See tests/README - for additional information. - -tools Utilities for regression testing and miscellaneous tasks. - -usr.bin User commands. - -usr.sbin System administration commands. - - -For information on synchronizing your source tree with one or more of -the FreeBSD Project's development branches, please see: - - https://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/current-stable.html From owner-dev-commits-src-main@freebsd.org Fri Mar 12 00:39: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 2714A569007; Fri, 12 Mar 2021 00:39: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 4DxRlH0g53z4bcl; Fri, 12 Mar 2021 00:39: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 09BAE64DA; Fri, 12 Mar 2021 00:39: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 12C0d6dS006836; Fri, 12 Mar 2021 00:39:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 12C0d6r5006835; Fri, 12 Mar 2021 00:39:06 GMT (envelope-from git) Date: Fri, 12 Mar 2021 00:39:06 GMT Message-Id: <202103120039.12C0d6r5006835@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: 2918e9fdb82f - main - readme: update style 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: 2918e9fdb82ffe5e95cab90a754bc6c2b6dd16a2 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, 12 Mar 2021 00:39:07 -0000 The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=2918e9fdb82ffe5e95cab90a754bc6c2b6dd16a2 commit 2918e9fdb82ffe5e95cab90a754bc6c2b6dd16a2 Author: Warner Losh AuthorDate: 2021-03-12 00:21:16 +0000 Commit: Warner Losh CommitDate: 2021-03-12 00:38:30 +0000 readme: update style Update the style to one sentence per line, as is currently used in the FreeBSD document project. Make the links to the handbook clickable. --- README.md | 108 ++++++++++++++++++++------------------------------------------ 1 file changed, 34 insertions(+), 74 deletions(-) diff --git a/README.md b/README.md index 72bd634cd813..9f07ed61647e 100644 --- a/README.md +++ b/README.md @@ -1,82 +1,42 @@ FreeBSD Source: --------------- -This is the top level of the FreeBSD source directory. This file -was last revised on: -$FreeBSD$ +This is the top level of the FreeBSD source directory. -FreeBSD is an operating system used to power modern servers, -desktops, and embedded platforms. A large community has -continually developed it for more than thirty years. Its -advanced networking, security, and storage features have -made FreeBSD the platform of choice for many of the -busiest web sites and most pervasive embedded networking -and storage devices. +FreeBSD is an operating system used to power modern servers, desktops, and embedded platforms. +A large community has continually developed it for more than thirty years. +Its advanced networking, security, and storage features have made FreeBSD the platform of choice for many of the busiest web sites and most pervasive embedded networking and storage devices. -For copyright information, please see the file COPYRIGHT in this -directory. Additional copyright information also exists for some -sources in this tree - please see the specific source directories for -more information. +For copyright information, please see the file COPYRIGHT in this directory. +Additional copyright information also exists for some sources in this tree - please see the specific source directories for more information. -The Makefile in this directory supports a number of targets for -building components (or all) of the FreeBSD source tree. See build(7), config(8), -https://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/makeworld.html, and -https://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/kernelconfig.html -for more information, including setting make(1) variables. +The Makefile in this directory supports a number of targets for building components (or all) of the FreeBSD source tree. +See build(7), config(8), [FreeBSD handbook on building userland](https://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/makeworld.html), and [Handbook for kernels](https://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/kernelconfig.html) for more information, including setting make(1) variables. Source Roadmap: --------------- -``` -bin System/user commands. - -cddl Various commands and libraries under the Common Development - and Distribution License. - -contrib Packages contributed by 3rd parties. - -crypto Cryptography stuff (see crypto/README). - -etc Template files for /etc. - -gnu Various commands and libraries under the GNU Public License. - Please see gnu/COPYING* for more information. - -include System include files. - -kerberos5 Kerberos5 (Heimdal) package. - -lib System libraries. - -libexec System daemons. - -release Release building Makefile & associated tools. - -rescue Build system for statically linked /rescue utilities. - -sbin System commands. - -secure Cryptographic libraries and commands. - -share Shared resources. - -stand Boot loader sources. - -sys Kernel sources. - -sys//conf Kernel configuration files. GENERIC is the configuration - used in release builds. NOTES contains documentation of - all possible entries. - -tests Regression tests which can be run by Kyua. See tests/README - for additional information. - -tools Utilities for regression testing and miscellaneous tasks. - -usr.bin User commands. - -usr.sbin System administration commands. -``` - -For information on synchronizing your source tree with one or more of -the FreeBSD Project's development branches, please see: - - https://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/current-stable.html +| Directory | Description | +| --------- | ------------ | +| bin | System/user commands. | +| cddl | Various commands and libraries under the Common Development and Distribution License. | +| contrib | Packages contributed by 3rd parties. | +| crypto | Cryptography stuff (see [crypto/README](crypto/README)). | +| etc | Template files for /etc. | +| gnu | Various commands and libraries under the GNU Public License. Please see [gnu/COPYING](gnu/COPYING) and [gnu/COPYING.LIB](gnu/COPYING.LIB) for more information. | +| include | System include files. | +| kerberos5 | Kerberos5 (Heimdal) package. | +| lib | System libraries. | +| libexec | System daemons. | +| release | Release building Makefile & associated tools. | +| rescue | Build system for statically linked /rescue utilities. | +| sbin | System commands. | +| secure | Cryptographic libraries and commands. | +| share | Shared resources. | +| stand | Boot loader sources. | +| sys | Kernel sources. | +| sys//conf | Kernel configuration files. GENERIC is the configuration used in release builds. NOTES contains documentation of all possible entries. | +| tests | Regression tests which can be run by Kyua. See [tests/README](tests/README) for additional information. | +| tools | Utilities for regression testing and miscellaneous tasks. | +| usr.bin | User commands. | +| usr.sbin | System administration commands. | + +For information on synchronizing your source tree with one or more of the FreeBSD Project's development branches, please see [FreeBSD Handbook](https://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/current-stable.html). From owner-dev-commits-src-main@freebsd.org Fri Mar 12 00: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 783955694A0; Fri, 12 Mar 2021 00: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 4DxS3G2hqkz4c0n; Fri, 12 Mar 2021 00: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 4FADE6B1A; Fri, 12 Mar 2021 00: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 12C0qwIA032261; Fri, 12 Mar 2021 00: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 12C0qwOW032260; Fri, 12 Mar 2021 00:52:58 GMT (envelope-from git) Date: Fri, 12 Mar 2021 00:52:58 GMT Message-Id: <202103120052.12C0qwOW032260@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: dbd92cc2a491 - main - Fix arch rendering 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: dbd92cc2a4915a2070c93cff423314f43edfc841 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, 12 Mar 2021 00:52:58 -0000 The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=dbd92cc2a4915a2070c93cff423314f43edfc841 commit dbd92cc2a4915a2070c93cff423314f43edfc841 Author: Warner Losh AuthorDate: 2021-03-12 00:52:13 +0000 Commit: Warner Losh CommitDate: 2021-03-12 00:52:13 +0000 Fix arch rendering --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 9f07ed61647e..74ffbfbb94bb 100644 --- a/README.md +++ b/README.md @@ -33,7 +33,7 @@ Source Roadmap: | share | Shared resources. | | stand | Boot loader sources. | | sys | Kernel sources. | -| sys//conf | Kernel configuration files. GENERIC is the configuration used in release builds. NOTES contains documentation of all possible entries. | +| sys/`arch`/conf | Kernel configuration files. GENERIC is the configuration used in release builds. NOTES contains documentation of all possible entries. | | tests | Regression tests which can be run by Kyua. See [tests/README](tests/README) for additional information. | | tools | Utilities for regression testing and miscellaneous tasks. | | usr.bin | User commands. | From owner-dev-commits-src-main@freebsd.org Fri Mar 12 00:55: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 6383C568FE5; Fri, 12 Mar 2021 00:55: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 4DxS6R2Mybz4cHW; Fri, 12 Mar 2021 00:55: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 440EC6930; Fri, 12 Mar 2021 00:55: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 12C0thNO032812; Fri, 12 Mar 2021 00:55:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 12C0thpg032811; Fri, 12 Mar 2021 00:55:43 GMT (envelope-from git) Date: Fri, 12 Mar 2021 00:55:43 GMT Message-Id: <202103120055.12C0thpg032811@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: e75eac2cb81c - main - readme: Link to COPYRIGHT 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: e75eac2cb81c510389f527da14cec4a16123e673 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, 12 Mar 2021 00:55:43 -0000 The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=e75eac2cb81c510389f527da14cec4a16123e673 commit e75eac2cb81c510389f527da14cec4a16123e673 Author: Warner Losh AuthorDate: 2021-03-12 00:55:16 +0000 Commit: Warner Losh CommitDate: 2021-03-12 00:55:16 +0000 readme: Link to COPYRIGHT file --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 74ffbfbb94bb..e6899c7549e0 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ FreeBSD is an operating system used to power modern servers, desktops, and embed A large community has continually developed it for more than thirty years. Its advanced networking, security, and storage features have made FreeBSD the platform of choice for many of the busiest web sites and most pervasive embedded networking and storage devices. -For copyright information, please see the file COPYRIGHT in this directory. +For copyright information, please see [the file COPYRIGHT](COPYRIGHT) in this directory. Additional copyright information also exists for some sources in this tree - please see the specific source directories for more information. The Makefile in this directory supports a number of targets for building components (or all) of the FreeBSD source tree. From owner-dev-commits-src-main@freebsd.org Fri Mar 12 04:43: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 DB70956DF19; Fri, 12 Mar 2021 04:43: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 4DxY8n5dZMz4ncG; Fri, 12 Mar 2021 04:43: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 B43FE11E98; Fri, 12 Mar 2021 04:43: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 12C4h52E035997; Fri, 12 Mar 2021 04:43:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 12C4h5HM035996; Fri, 12 Mar 2021 04:43:05 GMT (envelope-from git) Date: Fri, 12 Mar 2021 04:43:05 GMT Message-Id: <202103120443.12C4h5HM035996@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Wei Hu Subject: git: a491581f3f8d - main - Hyper-V: hn: Enable vSwitch RSC support in hn netvsc driver MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: whu X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a491581f3f8df07cdff0236bd556895205929af4 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, 12 Mar 2021 04:43:05 -0000 The branch main has been updated by whu: URL: https://cgit.FreeBSD.org/src/commit/?id=a491581f3f8df07cdff0236bd556895205929af4 commit a491581f3f8df07cdff0236bd556895205929af4 Author: Wei Hu AuthorDate: 2021-03-12 04:35:16 +0000 Commit: Wei Hu CommitDate: 2021-03-12 04:35:16 +0000 Hyper-V: hn: Enable vSwitch RSC support in hn netvsc driver Receive Segment Coalescing (RSC) in the vSwitch is a feature available in Windows Server 2019 hosts and later. It reduces the per packet processing overhead by coalescing multiple TCP segments when possible. This happens mostly when TCP traffics are among different guests on same host. This patch adds netvsc driver support for this feature. The patch also updates NVS version to 6.1 as needed for RSC enablement. MFC after: 2 weeks Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D29075 --- sys/dev/hyperv/netvsc/hn_nvs.c | 5 + sys/dev/hyperv/netvsc/hn_rndis.c | 25 ++++ sys/dev/hyperv/netvsc/if_hn.c | 258 ++++++++++++++++++++++++++++----------- sys/dev/hyperv/netvsc/if_hnreg.h | 14 +++ sys/dev/hyperv/netvsc/if_hnvar.h | 19 ++- sys/dev/hyperv/netvsc/ndis.h | 31 +++-- sys/net/rndis.h | 7 +- 7 files changed, 269 insertions(+), 90 deletions(-) diff --git a/sys/dev/hyperv/netvsc/hn_nvs.c b/sys/dev/hyperv/netvsc/hn_nvs.c index 73a112c4e5e1..4dbc28996617 100644 --- a/sys/dev/hyperv/netvsc/hn_nvs.c +++ b/sys/dev/hyperv/netvsc/hn_nvs.c @@ -80,6 +80,8 @@ struct hn_nvs_sendctx hn_nvs_sendctx_none = HN_NVS_SENDCTX_INITIALIZER(hn_nvs_sent_none, NULL); static const uint32_t hn_nvs_version[] = { + HN_NVS_VERSION_61, + HN_NVS_VERSION_6, HN_NVS_VERSION_5, HN_NVS_VERSION_4, HN_NVS_VERSION_2, @@ -508,6 +510,9 @@ hn_nvs_conf_ndis(struct hn_softc *sc, int mtu) conf.nvs_caps = HN_NVS_NDIS_CONF_VLAN; if (sc->hn_nvs_ver >= HN_NVS_VERSION_5) conf.nvs_caps |= HN_NVS_NDIS_CONF_SRIOV; + if (sc->hn_nvs_ver >= HN_NVS_VERSION_61) + conf.nvs_caps |= HN_NVS_NDIS_CONF_RSC; + /* NOTE: No response. */ error = hn_nvs_req_send(sc, &conf, sizeof(conf)); diff --git a/sys/dev/hyperv/netvsc/hn_rndis.c b/sys/dev/hyperv/netvsc/hn_rndis.c index b9bf683fe811..794a82cf3957 100644 --- a/sys/dev/hyperv/netvsc/hn_rndis.c +++ b/sys/dev/hyperv/netvsc/hn_rndis.c @@ -723,6 +723,17 @@ hn_rndis_conf_offload(struct hn_softc *sc, int mtu) params.ndis_udp6csum = NDIS_OFFLOAD_PARAM_RX; } + /* RSC offload */ + if (hwcaps.ndis_hdr.ndis_rev >= NDIS_OFFLOAD_PARAMS_REV_3) { + if (hwcaps.ndis_rsc.ndis_ip4 && hwcaps.ndis_rsc.ndis_ip6) { + params.ndis_rsc_ip4 = NDIS_OFFLOAD_RSC_ON; + params.ndis_rsc_ip6 = NDIS_OFFLOAD_RSC_ON; + } else { + params.ndis_rsc_ip4 = NDIS_OFFLOAD_RSC_OFF; + params.ndis_rsc_ip6 = NDIS_OFFLOAD_RSC_OFF; + } + } + if (bootverbose) { if_printf(sc->hn_ifp, "offload csum: " "ip4 %u, tcp4 %u, udp4 %u, tcp6 %u, udp6 %u\n", @@ -734,6 +745,10 @@ hn_rndis_conf_offload(struct hn_softc *sc, int mtu) if_printf(sc->hn_ifp, "offload lsov2: ip4 %u, ip6 %u\n", params.ndis_lsov2_ip4, params.ndis_lsov2_ip6); + if (hwcaps.ndis_hdr.ndis_rev >= NDIS_OFFLOAD_PARAMS_REV_3) + if_printf(sc->hn_ifp, "offload rsc: ip4 %u, ip6 %u\n", + params.ndis_rsc_ip4, + params.ndis_rsc_ip6); } error = hn_rndis_set(sc, OID_TCP_OFFLOAD_PARAMETERS, ¶ms, paramsz); @@ -969,6 +984,11 @@ hn_rndis_query_hwcaps(struct hn_softc *sc, struct ndis_offload *caps) if_printf(sc->hn_ifp, "invalid NDIS objsize %u\n", caps->ndis_hdr.ndis_size); return (EINVAL); + } else if (caps->ndis_hdr.ndis_rev >= NDIS_OFFLOAD_REV_3 && + caps->ndis_hdr.ndis_size < NDIS_OFFLOAD_SIZE) { + if_printf(sc->hn_ifp, "invalid NDIS rev3 objsize %u\n", + caps->ndis_hdr.ndis_size); + return (EINVAL); } if (bootverbose) { @@ -1001,6 +1021,11 @@ hn_rndis_query_hwcaps(struct hn_softc *sc, struct ndis_offload *caps) caps->ndis_lsov2.ndis_ip6_minsg, caps->ndis_lsov2.ndis_ip6_encap, caps->ndis_lsov2.ndis_ip6_opts); + if (caps->ndis_hdr.ndis_rev >= NDIS_OFFLOAD_REV_3) + if_printf(sc->hn_ifp, "hwcaps rsc: " + "ip4 %u ip6 %u\n", + caps->ndis_rsc.ndis_ip4, + caps->ndis_rsc.ndis_ip6); } return (0); } diff --git a/sys/dev/hyperv/netvsc/if_hn.c b/sys/dev/hyperv/netvsc/if_hn.c index 9243ff226f5b..f4bdbb1ee788 100644 --- a/sys/dev/hyperv/netvsc/if_hn.c +++ b/sys/dev/hyperv/netvsc/if_hn.c @@ -223,11 +223,25 @@ struct hn_txdesc { #define HN_TXD_FLAG_DMAMAP 0x0002 #define HN_TXD_FLAG_ONAGG 0x0004 +#define HN_NDIS_PKTINFO_SUBALLOC 0x01 +#define HN_NDIS_PKTINFO_1ST_FRAG 0x02 +#define HN_NDIS_PKTINFO_LAST_FRAG 0x04 + +struct packet_info_id { + uint8_t ver; + uint8_t flag; + uint16_t pkt_id; +}; + +#define NDIS_PKTINFOID_SZ sizeof(struct packet_info_id) + + struct hn_rxinfo { - uint32_t vlan_info; - uint32_t csum_info; - uint32_t hash_info; - uint32_t hash_value; + const uint32_t *vlan_info; + const uint32_t *csum_info; + const uint32_t *hash_info; + const uint32_t *hash_value; + const struct packet_info_id *pktinfo_id; }; struct hn_rxvf_setarg { @@ -239,15 +253,13 @@ struct hn_rxvf_setarg { #define HN_RXINFO_CSUM 0x0002 #define HN_RXINFO_HASHINF 0x0004 #define HN_RXINFO_HASHVAL 0x0008 +#define HN_RXINFO_PKTINFO_ID 0x0010 #define HN_RXINFO_ALL \ (HN_RXINFO_VLAN | \ HN_RXINFO_CSUM | \ HN_RXINFO_HASHINF | \ - HN_RXINFO_HASHVAL) - -#define HN_NDIS_VLAN_INFO_INVALID 0xffffffff -#define HN_NDIS_RXCSUM_INFO_INVALID 0 -#define HN_NDIS_HASH_INFO_INVALID 0 + HN_RXINFO_HASHVAL | \ + HN_RXINFO_PKTINFO_ID) static int hn_probe(device_t); static int hn_attach(device_t); @@ -396,8 +408,7 @@ static int hn_rxfilter_config(struct hn_softc *); static int hn_rss_reconfig(struct hn_softc *); static void hn_rss_ind_fixup(struct hn_softc *); static void hn_rss_mbuf_hash(struct hn_softc *, uint32_t); -static int hn_rxpkt(struct hn_rx_ring *, const void *, - int, const struct hn_rxinfo *); +static int hn_rxpkt(struct hn_rx_ring *); static uint32_t hn_rss_type_fromndis(uint32_t); static uint32_t hn_rss_type_tondis(uint32_t); @@ -3353,9 +3364,10 @@ again: * allocated with cluster size MJUMPAGESIZE, and filled * accordingly. * - * Return 1 if able to complete the job; otherwise 0. + * Return the last mbuf in the chain or NULL if failed to + * allocate new mbuf. */ -static int +static struct mbuf * hv_m_append(struct mbuf *m0, int len, c_caddr_t cp) { struct mbuf *m, *n; @@ -3383,7 +3395,7 @@ hv_m_append(struct mbuf *m0, int len, c_caddr_t cp) */ n = m_getjcl(M_NOWAIT, m->m_type, 0, MJUMPAGESIZE); if (n == NULL) - break; + return NULL; n->m_len = min(MJUMPAGESIZE, remainder); bcopy(cp, mtod(n, caddr_t), n->m_len); cp += n->m_len; @@ -3391,10 +3403,8 @@ hv_m_append(struct mbuf *m0, int len, c_caddr_t cp) m->m_next = n; m = n; } - if (m0->m_flags & M_PKTHDR) - m0->m_pkthdr.len += len - remainder; - return (remainder == 0); + return m; } #if defined(INET) || defined(INET6) @@ -3412,14 +3422,14 @@ hn_lro_rx(struct lro_ctrl *lc, struct mbuf *m) #endif static int -hn_rxpkt(struct hn_rx_ring *rxr, const void *data, int dlen, - const struct hn_rxinfo *info) +hn_rxpkt(struct hn_rx_ring *rxr) { struct ifnet *ifp, *hn_ifp = rxr->hn_ifp; - struct mbuf *m_new; + struct mbuf *m_new, *n; int size, do_lro = 0, do_csum = 1, is_vf = 0; int hash_type = M_HASHTYPE_NONE; int l3proto = ETHERTYPE_MAX, l4proto = IPPROTO_DONE; + int i; ifp = hn_ifp; if (rxr->hn_rxvf_ifp != NULL) { @@ -3446,20 +3456,20 @@ hn_rxpkt(struct hn_rx_ring *rxr, const void *data, int dlen, return (0); } - if (__predict_false(dlen < ETHER_HDR_LEN)) { + if (__predict_false(rxr->rsc.pktlen < ETHER_HDR_LEN)) { if_inc_counter(hn_ifp, IFCOUNTER_IERRORS, 1); return (0); } - if (dlen <= MHLEN) { + if (rxr->rsc.cnt == 1 && rxr->rsc.pktlen <= MHLEN) { m_new = m_gethdr(M_NOWAIT, MT_DATA); if (m_new == NULL) { if_inc_counter(hn_ifp, IFCOUNTER_IQDROPS, 1); return (0); } - memcpy(mtod(m_new, void *), data, dlen); - m_new->m_pkthdr.len = m_new->m_len = dlen; - rxr->hn_small_pkts++; + memcpy(mtod(m_new, void *), rxr->rsc.frag_data[0], + rxr->rsc.frag_len[0]); + m_new->m_pkthdr.len = m_new->m_len = rxr->rsc.frag_len[0]; } else { /* * Get an mbuf with a cluster. For packets 2K or less, @@ -3468,7 +3478,7 @@ hn_rxpkt(struct hn_rx_ring *rxr, const void *data, int dlen, * if looped around to the Hyper-V TX channel, so avoid them. */ size = MCLBYTES; - if (dlen > MCLBYTES) { + if (rxr->rsc.pktlen > MCLBYTES) { /* 4096 */ size = MJUMPAGESIZE; } @@ -3479,29 +3489,42 @@ hn_rxpkt(struct hn_rx_ring *rxr, const void *data, int dlen, return (0); } - hv_m_append(m_new, dlen, data); + n = m_new; + for (i = 0; i < rxr->rsc.cnt; i++) { + n = hv_m_append(n, rxr->rsc.frag_len[i], + rxr->rsc.frag_data[i]); + if (n == NULL) { + if_inc_counter(hn_ifp, IFCOUNTER_IQDROPS, 1); + return (0); + } else { + m_new->m_pkthdr.len += rxr->rsc.frag_len[i]; + } + } } + if (rxr->rsc.pktlen <= MHLEN) + rxr->hn_small_pkts++; + m_new->m_pkthdr.rcvif = ifp; if (__predict_false((hn_ifp->if_capenable & IFCAP_RXCSUM) == 0)) do_csum = 0; /* receive side checksum offload */ - if (info->csum_info != HN_NDIS_RXCSUM_INFO_INVALID) { + if (rxr->rsc.csum_info != NULL) { /* IP csum offload */ - if ((info->csum_info & NDIS_RXCSUM_INFO_IPCS_OK) && do_csum) { + if ((*(rxr->rsc.csum_info) & NDIS_RXCSUM_INFO_IPCS_OK) && do_csum) { m_new->m_pkthdr.csum_flags |= (CSUM_IP_CHECKED | CSUM_IP_VALID); rxr->hn_csum_ip++; } /* TCP/UDP csum offload */ - if ((info->csum_info & (NDIS_RXCSUM_INFO_UDPCS_OK | + if ((*(rxr->rsc.csum_info) & (NDIS_RXCSUM_INFO_UDPCS_OK | NDIS_RXCSUM_INFO_TCPCS_OK)) && do_csum) { m_new->m_pkthdr.csum_flags |= (CSUM_DATA_VALID | CSUM_PSEUDO_HDR); m_new->m_pkthdr.csum_data = 0xffff; - if (info->csum_info & NDIS_RXCSUM_INFO_TCPCS_OK) + if (*(rxr->rsc.csum_info) & NDIS_RXCSUM_INFO_TCPCS_OK) rxr->hn_csum_tcp++; else rxr->hn_csum_udp++; @@ -3514,7 +3537,7 @@ hn_rxpkt(struct hn_rx_ring *rxr, const void *data, int dlen, * the do_lro setting here is actually _not_ accurate. We * depend on the RSS hash type check to reset do_lro. */ - if ((info->csum_info & + if ((*(rxr->rsc.csum_info) & (NDIS_RXCSUM_INFO_TCPCS_OK | NDIS_RXCSUM_INFO_IPCS_OK)) == (NDIS_RXCSUM_INFO_TCPCS_OK | NDIS_RXCSUM_INFO_IPCS_OK)) do_lro = 1; @@ -3551,11 +3574,11 @@ hn_rxpkt(struct hn_rx_ring *rxr, const void *data, int dlen, } } - if (info->vlan_info != HN_NDIS_VLAN_INFO_INVALID) { + if (rxr->rsc.vlan_info != NULL) { m_new->m_pkthdr.ether_vtag = EVL_MAKETAG( - NDIS_VLAN_INFO_ID(info->vlan_info), - NDIS_VLAN_INFO_PRI(info->vlan_info), - NDIS_VLAN_INFO_CFI(info->vlan_info)); + NDIS_VLAN_INFO_ID(*(rxr->rsc.vlan_info)), + NDIS_VLAN_INFO_PRI(*(rxr->rsc.vlan_info)), + NDIS_VLAN_INFO_CFI(*(rxr->rsc.vlan_info))); m_new->m_flags |= M_VLANTAG; } @@ -3581,14 +3604,14 @@ hn_rxpkt(struct hn_rx_ring *rxr, const void *data, int dlen, * matter here), do _not_ mess with unsupported hash types or * functions. */ - if (info->hash_info != HN_NDIS_HASH_INFO_INVALID) { + if (rxr->rsc.hash_info != NULL) { rxr->hn_rss_pkts++; - m_new->m_pkthdr.flowid = info->hash_value; + m_new->m_pkthdr.flowid = *(rxr->rsc.hash_value); if (!is_vf) hash_type = M_HASHTYPE_OPAQUE_HASH; - if ((info->hash_info & NDIS_HASH_FUNCTION_MASK) == + if ((*(rxr->rsc.hash_info) & NDIS_HASH_FUNCTION_MASK) == NDIS_HASH_FUNCTION_TOEPLITZ) { - uint32_t type = (info->hash_info & NDIS_HASH_TYPE_MASK & + uint32_t type = (*(rxr->rsc.hash_info) & NDIS_HASH_TYPE_MASK & rxr->hn_mbuf_hash); /* @@ -5033,6 +5056,16 @@ hn_create_rx_data(struct hn_softc *sc, int ring_cnt) OID_AUTO, "rss_pkts", CTLFLAG_RW, &rxr->hn_rss_pkts, "# of packets w/ RSS info received"); + SYSCTL_ADD_ULONG(ctx, + SYSCTL_CHILDREN(rxr->hn_rx_sysctl_tree), + OID_AUTO, "rsc_pkts", CTLFLAG_RW, + &rxr->hn_rsc_pkts, + "# of RSC packets received"); + SYSCTL_ADD_ULONG(ctx, + SYSCTL_CHILDREN(rxr->hn_rx_sysctl_tree), + OID_AUTO, "rsc_drop", CTLFLAG_RW, + &rxr->hn_rsc_drop, + "# of RSC fragments dropped"); SYSCTL_ADD_INT(ctx, SYSCTL_CHILDREN(rxr->hn_rx_sysctl_tree), OID_AUTO, "pktbuf_len", CTLFLAG_RD, @@ -7057,37 +7090,56 @@ hn_rndis_rxinfo(const void *info_data, int info_dlen, struct hn_rxinfo *info) dlen = pi->rm_size - pi->rm_pktinfooffset; data = pi->rm_data; - switch (pi->rm_type) { - case NDIS_PKTINFO_TYPE_VLAN: - if (__predict_false(dlen < NDIS_VLAN_INFO_SIZE)) - return (EINVAL); - info->vlan_info = *((const uint32_t *)data); - mask |= HN_RXINFO_VLAN; - break; + if (pi->rm_internal == 1) { + switch (pi->rm_type) { + case NDIS_PKTINFO_IT_PKTINFO_ID: + if (__predict_false(dlen < NDIS_PKTINFOID_SZ)) + return (EINVAL); + info->pktinfo_id = + (const struct packet_info_id *)data; + mask |= HN_RXINFO_PKTINFO_ID; + break; - case NDIS_PKTINFO_TYPE_CSUM: - if (__predict_false(dlen < NDIS_RXCSUM_INFO_SIZE)) - return (EINVAL); - info->csum_info = *((const uint32_t *)data); - mask |= HN_RXINFO_CSUM; - break; + default: + goto next; + } + } else { + switch (pi->rm_type) { + case NDIS_PKTINFO_TYPE_VLAN: + if (__predict_false(dlen + < NDIS_VLAN_INFO_SIZE)) + return (EINVAL); + info->vlan_info = (const uint32_t *)data; + mask |= HN_RXINFO_VLAN; + break; - case HN_NDIS_PKTINFO_TYPE_HASHVAL: - if (__predict_false(dlen < HN_NDIS_HASH_VALUE_SIZE)) - return (EINVAL); - info->hash_value = *((const uint32_t *)data); - mask |= HN_RXINFO_HASHVAL; - break; + case NDIS_PKTINFO_TYPE_CSUM: + if (__predict_false(dlen + < NDIS_RXCSUM_INFO_SIZE)) + return (EINVAL); + info->csum_info = (const uint32_t *)data; + mask |= HN_RXINFO_CSUM; + break; - case HN_NDIS_PKTINFO_TYPE_HASHINF: - if (__predict_false(dlen < HN_NDIS_HASH_INFO_SIZE)) - return (EINVAL); - info->hash_info = *((const uint32_t *)data); - mask |= HN_RXINFO_HASHINF; - break; + case HN_NDIS_PKTINFO_TYPE_HASHVAL: + if (__predict_false(dlen + < HN_NDIS_HASH_VALUE_SIZE)) + return (EINVAL); + info->hash_value = (const uint32_t *)data; + mask |= HN_RXINFO_HASHVAL; + break; - default: - goto next; + case HN_NDIS_PKTINFO_TYPE_HASHINF: + if (__predict_false(dlen + < HN_NDIS_HASH_INFO_SIZE)) + return (EINVAL); + info->hash_info = (const uint32_t *)data; + mask |= HN_RXINFO_HASHINF; + break; + + default: + goto next; + } } if (mask == HN_RXINFO_ALL) { @@ -7104,7 +7156,7 @@ next: * - If there is no hash value, invalidate the hash info. */ if ((mask & HN_RXINFO_HASHVAL) == 0) - info->hash_info = HN_NDIS_HASH_INFO_INVALID; + info->hash_info = NULL; return (0); } @@ -7122,12 +7174,34 @@ hn_rndis_check_overlap(int off, int len, int check_off, int check_len) return (true); } +static __inline void +hn_rsc_add_data(struct hn_rx_ring *rxr, const void *data, + uint32_t len, struct hn_rxinfo *info) +{ + uint32_t cnt = rxr->rsc.cnt; + + if (cnt) { + rxr->rsc.pktlen += len; + } else { + rxr->rsc.vlan_info = info->vlan_info; + rxr->rsc.csum_info = info->csum_info; + rxr->rsc.hash_info = info->hash_info; + rxr->rsc.hash_value = info->hash_value; + rxr->rsc.pktlen = len; + } + + rxr->rsc.frag_data[cnt] = data; + rxr->rsc.frag_len[cnt] = len; + rxr->rsc.cnt++; +} + static void hn_rndis_rx_data(struct hn_rx_ring *rxr, const void *data, int dlen) { const struct rndis_packet_msg *pkt; struct hn_rxinfo info; int data_off, pktinfo_off, data_len, pktinfo_len; + bool rsc_more= false; /* * Check length. @@ -7235,9 +7309,11 @@ hn_rndis_rx_data(struct hn_rx_ring *rxr, const void *data, int dlen) /* * Check per-packet-info coverage and find useful per-packet-info. */ - info.vlan_info = HN_NDIS_VLAN_INFO_INVALID; - info.csum_info = HN_NDIS_RXCSUM_INFO_INVALID; - info.hash_info = HN_NDIS_HASH_INFO_INVALID; + info.vlan_info = NULL; + info.csum_info = NULL; + info.hash_info = NULL; + info.pktinfo_id = NULL; + if (__predict_true(pktinfo_len != 0)) { bool overlap; int error; @@ -7281,7 +7357,43 @@ hn_rndis_rx_data(struct hn_rx_ring *rxr, const void *data, int dlen) pkt->rm_len, data_off, data_len); return; } - hn_rxpkt(rxr, ((const uint8_t *)pkt) + data_off, data_len, &info); + + /* Identify RSC fragments, drop invalid packets */ + if ((info.pktinfo_id != NULL) && + (info.pktinfo_id->flag & HN_NDIS_PKTINFO_SUBALLOC)) { + if (info.pktinfo_id->flag & HN_NDIS_PKTINFO_1ST_FRAG) { + rxr->rsc.cnt = 0; + rxr->hn_rsc_pkts++; + } else if (rxr->rsc.cnt == 0) + goto drop; + + rsc_more = true; + + if (info.pktinfo_id->flag & HN_NDIS_PKTINFO_LAST_FRAG) + rsc_more = false; + + if (rsc_more && rxr->rsc.is_last) + goto drop; + } else { + rxr->rsc.cnt = 0; + } + + if (__predict_false(rxr->rsc.cnt >= HN_NVS_RSC_MAX)) + goto drop; + + /* Store data in per rx ring structure */ + hn_rsc_add_data(rxr,((const uint8_t *)pkt) + data_off, + data_len, &info); + + if (rsc_more) + return; + + hn_rxpkt(rxr); + rxr->rsc.cnt = 0; + return; +drop: + rxr->hn_rsc_drop++; + return; } static __inline void @@ -7394,6 +7506,8 @@ hn_nvs_handle_rxbuf(struct hn_rx_ring *rxr, struct vmbus_channel *chan, "ofs %d, len %d\n", i, ofs, len); continue; } + + rxr->rsc.is_last = (i == (count - 1)); hn_rndis_rxpkt(rxr, rxr->hn_rxbuf + ofs, len); } diff --git a/sys/dev/hyperv/netvsc/if_hnreg.h b/sys/dev/hyperv/netvsc/if_hnreg.h index 154d69264679..54db556cc56d 100644 --- a/sys/dev/hyperv/netvsc/if_hnreg.h +++ b/sys/dev/hyperv/netvsc/if_hnreg.h @@ -48,6 +48,8 @@ #define HN_NVS_VERSION_2 0x30002 #define HN_NVS_VERSION_4 0x40000 #define HN_NVS_VERSION_5 0x50000 +#define HN_NVS_VERSION_6 0x60000 +#define HN_NVS_VERSION_61 0x60001 #define HN_NVS_RXBUF_SIG 0xcafe #define HN_NVS_CHIM_SIG 0xface @@ -101,6 +103,7 @@ struct hn_nvs_init { uint32_t nvs_ver_min; uint32_t nvs_ver_max; uint8_t nvs_rsvd[20]; + uint8_t nvs_msg_pad[8]; } __packed; CTASSERT(sizeof(struct hn_nvs_init) >= HN_NVS_REQSIZE_MIN); @@ -118,11 +121,13 @@ struct hn_nvs_ndis_conf { uint32_t nvs_rsvd; uint64_t nvs_caps; /* HN_NVS_NDIS_CONF_ */ uint8_t nvs_rsvd1[12]; + uint8_t nvs_msg_pad[8]; } __packed; CTASSERT(sizeof(struct hn_nvs_ndis_conf) >= HN_NVS_REQSIZE_MIN); #define HN_NVS_NDIS_CONF_SRIOV 0x0004 #define HN_NVS_NDIS_CONF_VLAN 0x0008 +#define HN_NVS_NDIS_CONF_RSC 0x0080 /* No response */ struct hn_nvs_ndis_init { @@ -130,6 +135,7 @@ struct hn_nvs_ndis_init { uint32_t nvs_ndis_major; /* NDIS_VERSION_MAJOR_ */ uint32_t nvs_ndis_minor; /* NDIS_VERSION_MINOR_ */ uint8_t nvs_rsvd[20]; + uint8_t nvs_msg_pad[8]; } __packed; CTASSERT(sizeof(struct hn_nvs_ndis_init) >= HN_NVS_REQSIZE_MIN); @@ -141,6 +147,7 @@ struct hn_nvs_datapath { uint32_t nvs_type; /* HN_NVS_TYPE_SET_DATAPATH */ uint32_t nvs_active_path;/* HN_NVS_DATAPATH_* */ uint32_t nvs_rsvd[6]; + uint8_t nvs_msg_pad[8]; } __packed; CTASSERT(sizeof(struct hn_nvs_datapath) >= HN_NVS_REQSIZE_MIN); @@ -149,6 +156,7 @@ struct hn_nvs_rxbuf_conn { uint32_t nvs_gpadl; /* RXBUF vmbus GPADL */ uint16_t nvs_sig; /* HN_NVS_RXBUF_SIG */ uint8_t nvs_rsvd[22]; + uint8_t nvs_msg_pad[8]; } __packed; CTASSERT(sizeof(struct hn_nvs_rxbuf_conn) >= HN_NVS_REQSIZE_MIN); @@ -171,6 +179,7 @@ struct hn_nvs_rxbuf_disconn { uint32_t nvs_type; /* HN_NVS_TYPE_RXBUF_DISCONN */ uint16_t nvs_sig; /* HN_NVS_RXBUF_SIG */ uint8_t nvs_rsvd[26]; + uint8_t nvs_msg_pad[8]; } __packed; CTASSERT(sizeof(struct hn_nvs_rxbuf_disconn) >= HN_NVS_REQSIZE_MIN); @@ -179,6 +188,7 @@ struct hn_nvs_chim_conn { uint32_t nvs_gpadl; /* chimney buf vmbus GPADL */ uint16_t nvs_sig; /* NDIS_NVS_CHIM_SIG */ uint8_t nvs_rsvd[22]; + uint8_t nvs_msg_pad[8]; } __packed; CTASSERT(sizeof(struct hn_nvs_chim_conn) >= HN_NVS_REQSIZE_MIN); @@ -193,6 +203,7 @@ struct hn_nvs_chim_disconn { uint32_t nvs_type; /* HN_NVS_TYPE_CHIM_DISCONN */ uint16_t nvs_sig; /* HN_NVS_CHIM_SIG */ uint8_t nvs_rsvd[26]; + uint8_t nvs_msg_pad[8]; } __packed; CTASSERT(sizeof(struct hn_nvs_chim_disconn) >= HN_NVS_REQSIZE_MIN); @@ -203,6 +214,7 @@ struct hn_nvs_subch_req { uint32_t nvs_op; /* HN_NVS_SUBCH_OP_ */ uint32_t nvs_nsubch; uint8_t nvs_rsvd[20]; + uint8_t nvs_msg_pad[8]; } __packed; CTASSERT(sizeof(struct hn_nvs_subch_req) >= HN_NVS_REQSIZE_MIN); @@ -226,6 +238,7 @@ struct hn_nvs_rndis { uint32_t nvs_chim_idx; uint32_t nvs_chim_sz; uint8_t nvs_rsvd[16]; + uint8_t nvs_msg_pad[8]; } __packed; CTASSERT(sizeof(struct hn_nvs_rndis) >= HN_NVS_REQSIZE_MIN); @@ -233,6 +246,7 @@ struct hn_nvs_rndis_ack { uint32_t nvs_type; /* HN_NVS_TYPE_RNDIS_ACK */ uint32_t nvs_status; /* HN_NVS_STATUS_ */ uint8_t nvs_rsvd[24]; + uint8_t nvs_msg_pad[8]; } __packed; CTASSERT(sizeof(struct hn_nvs_rndis_ack) >= HN_NVS_REQSIZE_MIN); diff --git a/sys/dev/hyperv/netvsc/if_hnvar.h b/sys/dev/hyperv/netvsc/if_hnvar.h index c0e17c9643e0..27d93db5395e 100644 --- a/sys/dev/hyperv/netvsc/if_hnvar.h +++ b/sys/dev/hyperv/netvsc/if_hnvar.h @@ -33,7 +33,7 @@ #define HN_CHIM_SIZE (15 * 1024 * 1024) -#define HN_RXBUF_SIZE (16 * 1024 * 1024) +#define HN_RXBUF_SIZE (31 * 1024 * 1024) #define HN_RXBUF_SIZE_COMPAT (15 * 1024 * 1024) #define HN_MTU_MAX (65535 - ETHER_ADDR_LEN) @@ -56,6 +56,20 @@ struct buf_ring; #endif struct hn_tx_ring; +#define HN_NVS_RSC_MAX 562 /* Max RSC frags in one vmbus packet */ + +struct hn_rx_rsc { + const uint32_t *vlan_info; + const uint32_t *csum_info; + const uint32_t *hash_info; + const uint32_t *hash_value; + uint32_t cnt; /* fragment count */ + uint32_t pktlen; /* full packet length */ + uint8_t is_last; /* last fragment */ + const void *frag_data[HN_NVS_RSC_MAX]; + uint32_t frag_len[HN_NVS_RSC_MAX]; +}; + struct hn_rx_ring { struct ifnet *hn_ifp; struct ifnet *hn_rxvf_ifp; /* SR-IOV VF for RX */ @@ -66,6 +80,7 @@ struct hn_rx_ring { uint32_t hn_mbuf_hash; /* NDIS_HASH_ */ uint8_t *hn_rxbuf; /* shadow sc->hn_rxbuf */ int hn_rx_idx; + struct hn_rx_rsc rsc; /* Trust csum verification on host side */ int hn_trust_hcsum; /* HN_TRUST_HCSUM_ */ @@ -80,6 +95,8 @@ struct hn_rx_ring { u_long hn_pkts; u_long hn_rss_pkts; u_long hn_ack_failed; + u_long hn_rsc_pkts; + u_long hn_rsc_drop; /* Rarely used stuffs */ struct sysctl_oid *hn_rx_sysctl_tree; diff --git a/sys/dev/hyperv/netvsc/ndis.h b/sys/dev/hyperv/netvsc/ndis.h index 32b6aa307452..c69da7807a63 100644 --- a/sys/dev/hyperv/netvsc/ndis.h +++ b/sys/dev/hyperv/netvsc/ndis.h @@ -115,8 +115,8 @@ struct ndis_offload_params { /* NDIS >= 6.30 */ uint8_t ndis_rsc_ip4; /* NDIS_OFFLOAD_RSC_ */ uint8_t ndis_rsc_ip6; /* NDIS_OFFLOAD_RSC_ */ - uint32_t ndis_encap; /* NDIS_OFFLOAD_SET_ */ - uint32_t ndis_encap_types;/* NDIS_ENCAP_TYPE_ */ + uint8_t ndis_encap; /* NDIS_OFFLOAD_SET_ */ + uint8_t ndis_encap_types;/* NDIS_ENCAP_TYPE_ */ }; #define NDIS_OFFLOAD_PARAMS_SIZE sizeof(struct ndis_offload_params) @@ -305,17 +305,17 @@ struct ndis_lsov2_offload { struct ndis_ipsecv2_offload { uint32_t ndis_encap; /*NDIS_OFFLOAD_ENCAP_*/ - uint16_t ndis_ip6; - uint16_t ndis_ip4opt; - uint16_t ndis_ip6ext; - uint16_t ndis_ah; - uint16_t ndis_esp; - uint16_t ndis_ah_esp; - uint16_t ndis_xport; - uint16_t ndis_tun; - uint16_t ndis_xport_tun; - uint16_t ndis_lso; - uint16_t ndis_extseq; + uint8_t ndis_ip6; + uint8_t ndis_ip4opt; + uint8_t ndis_ip6ext; + uint8_t ndis_ah; + uint8_t ndis_esp; + uint8_t ndis_ah_esp; + uint8_t ndis_xport; + uint8_t ndis_tun; + uint8_t ndis_xport_tun; + uint8_t ndis_lso; + uint8_t ndis_extseq; uint32_t ndis_udp_esp; uint32_t ndis_auth; uint32_t ndis_crypto; @@ -323,8 +323,8 @@ struct ndis_ipsecv2_offload { }; struct ndis_rsc_offload { - uint16_t ndis_ip4; - uint16_t ndis_ip6; + uint8_t ndis_ip4; + uint8_t ndis_ip6; }; struct ndis_encap_offload { @@ -419,5 +419,4 @@ struct ndis_offload { #define NDIS_TXCSUM_INFO_MKUDPCS(thoff) \ NDIS_TXCSUM_INFO_MKL4CS((thoff), NDIS_TXCSUM_INFO_UDPCS) - #endif /* !_NET_NDIS_H_ */ diff --git a/sys/net/rndis.h b/sys/net/rndis.h index 5d45469a4b52..56350dbb7824 100644 --- a/sys/net/rndis.h +++ b/sys/net/rndis.h @@ -142,7 +142,8 @@ struct rndis_packet_msg { /* Per-packet-info for RNDIS data message */ struct rndis_pktinfo { uint32_t rm_size; - uint32_t rm_type; /* NDIS_PKTINFO_TYPE_ */ + uint32_t rm_type:31; /* NDIS_PKTINFO_TYPE_ */ + uint32_t rm_internal:1; /* Indicate if internal type */ uint32_t rm_pktinfooffset; uint8_t rm_data[]; }; @@ -165,6 +166,10 @@ struct rndis_pktinfo { #define NDIS_PKTINFO_TYPE_CACHE_NBLIST 10 #define NDIS_PKTINFO_TYPE_PKT_PAD 11 +/* Per-packet-info internal type */ +#define NDIS_PKTINFO_IT_PKTINFO_ID 1 +/* Add more internal type here */ + /* * RNDIS control messages */ From owner-dev-commits-src-main@freebsd.org Fri Mar 12 06:43: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 A217857011E; Fri, 12 Mar 2021 06:43: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 4DxbqV4Bnpz4tNn; Fri, 12 Mar 2021 06:43: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 82A151344C; Fri, 12 Mar 2021 06:43: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 12C6hI05094151; Fri, 12 Mar 2021 06:43:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 12C6hIRE094150; Fri, 12 Mar 2021 06:43:18 GMT (envelope-from git) Date: Fri, 12 Mar 2021 06:43:18 GMT Message-Id: <202103120643.12C6hIRE094150@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: 6385cabd5be6 - main - Do not complain about incorrect cylinder group check-hashes when asked to add them to a filesystem. 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: 6385cabd5be627c4f395e3abf215882aaeb36320 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, 12 Mar 2021 06:43:18 -0000 The branch main has been updated by mckusick: URL: https://cgit.FreeBSD.org/src/commit/?id=6385cabd5be627c4f395e3abf215882aaeb36320 commit 6385cabd5be627c4f395e3abf215882aaeb36320 Author: Kirk McKusick AuthorDate: 2021-03-12 06:44:33 +0000 Commit: Kirk McKusick CommitDate: 2021-03-12 06:46:15 +0000 Do not complain about incorrect cylinder group check-hashes when asked to add them to a filesystem. MFC after: 3 days Sponsored by: Netflix --- sbin/fsck_ffs/fsutil.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sbin/fsck_ffs/fsutil.c b/sbin/fsck_ffs/fsutil.c index 77571deb38f4..127884400651 100644 --- a/sbin/fsck_ffs/fsutil.c +++ b/sbin/fsck_ffs/fsutil.c @@ -926,7 +926,8 @@ check_cgmagic(int cg, struct bufarea *cgbp, int request_rebuild) * Extended cylinder group checks. */ calchash = cgp->cg_ckhash; - if ((sblock.fs_metackhash & CK_CYLGRP) != 0) { + if ((sblock.fs_metackhash & CK_CYLGRP) != 0 && + (ckhashadd & CK_CYLGRP) == 0) { cghash = cgp->cg_ckhash; cgp->cg_ckhash = 0; calchash = calculate_crc32c(~0L, (void *)cgp, sblock.fs_cgsize); From owner-dev-commits-src-main@freebsd.org Fri Mar 12 10:02: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 D9E7E5741AE for ; Fri, 12 Mar 2021 10:02:10 +0000 (UTC) (envelope-from freebsd@omnilan.de) Received: from mx0.gentlemail.de (mx0.gentlemail.de [IPv6:2a00:e10:2800::a130]) (using TLSv1.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 "CN", Issuer "CN" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DxhDx493sz3L57; Fri, 12 Mar 2021 10:02:09 +0000 (UTC) (envelope-from freebsd@omnilan.de) Received: from mh0.gentlemail.de (mh0.gentlemail.de [78.138.80.135]) by mx0.gentlemail.de (8.15.2/8.15.2) with ESMTP id 12CA1qdK012941; Fri, 12 Mar 2021 11:02:00 +0100 (CET) (envelope-from freebsd@omnilan.de) Received: from titan.inop.mo1.omnilan.net (s1.omnilan.de [217.91.127.234]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mh0.gentlemail.de (Postfix) with ESMTPSA id BC20AFCE; Fri, 12 Mar 2021 11:01:52 +0100 (CET) Subject: Re: git: 6e1d1bfcac77 - main - jail: Improve locking when removing prisons To: Jamie Gritton , dev-commits-src-main@FreeBSD.org References: <202102202242.11KMg79W017503@gitrepo.freebsd.org> From: Harry Schmalzbauer Organization: OmniLAN Message-ID: <0e8ca80f-cf62-4707-7cbd-dc0bbef061ed@omnilan.de> Date: Fri, 12 Mar 2021 11:01:52 +0100 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: <202102202242.11KMg79W017503@gitrepo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US X-Greylist: inspected by milter-greylist-4.6.2 (mx0.gentlemail.de [78.138.80.130]); Fri, 12 Mar 2021 11:02:00 +0100 (CET) for IP:'78.138.80.135' DOMAIN:'mh0.gentlemail.de' HELO:'mh0.gentlemail.de' FROM:'freebsd@omnilan.de' RCPT:'' X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.6.2 (mx0.gentlemail.de [78.138.80.130]); Fri, 12 Mar 2021 11:02:00 +0100 (CET) X-Rspamd-Queue-Id: 4DxhDx493sz3L57 X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of freebsd@omnilan.de designates 2a00:e10:2800::a130 as permitted sender) smtp.mailfrom=freebsd@omnilan.de X-Spamd-Result: default: False [-3.30 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; ARC_NA(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; R_SPF_ALLOW(-0.20)[+mx]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[omnilan.de]; RBL_DBL_DONT_QUERY_IPS(0.00)[2a00:e10:2800::a130:from]; HAS_ORG_HEADER(0.00)[]; RCVD_COUNT_THREE(0.00)[3]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; SPAMHAUS_ZRD(0.00)[2a00:e10:2800::a130:from:127.0.2.255]; NEURAL_HAM_LONG(-1.00)[-1.000]; RCPT_COUNT_TWO(0.00)[2]; NEURAL_HAM_SHORT(-1.00)[-0.999]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:61157, ipnet:2a00:e10:2800::/38, country:DE]; RCVD_TLS_LAST(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: Fri, 12 Mar 2021 10:02:11 -0000 Am 20.02.2021 um 23:42 schrieb Jamie Gritton: > The branch main has been updated by jamie: > > URL: https://cgit.FreeBSD.org/src/commit/?id=6e1d1bfcac77603541706807803a198c6d954d7c > > commit 6e1d1bfcac77603541706807803a198c6d954d7c > Author: Jamie Gritton > AuthorDate: 2021-02-20 22:38:58 +0000 > Commit: Jamie Gritton > CommitDate: 2021-02-20 22:38:58 +0000 > > jail: Improve locking when removing prisons > > Change the flow of prison_deref() so it doesn't let go of allprison_lock > until it's completely done using it (except for a possible drop as part > of an upgrade on its first try). > > Differential Revision: https://reviews.freebsd.org/D28458 > MFC after: 3 days > --- > sys/kern/kern_jail.c | 69 +++++++++++++++++++++++++++++++--------------------- > 1 file changed, 41 insertions(+), 28 deletions(-) Hello, do you still plan to MFC this?  It seems there's a bunch of locking related rework not MFC yet, but this one had the MFC tag in the commit log, so I guess it's a more important fix. Thanks! -harry From owner-dev-commits-src-main@freebsd.org Fri Mar 12 11:32: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 9447C575961; Fri, 12 Mar 2021 11:32: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 4DxkDv3k9wz3Qy9; Fri, 12 Mar 2021 11:32: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 729CA17030; Fri, 12 Mar 2021 11:32: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 12CBWFCA077287; Fri, 12 Mar 2021 11:32:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 12CBWFPD077286; Fri, 12 Mar 2021 11:32:15 GMT (envelope-from git) Date: Fri, 12 Mar 2021 11:32:15 GMT Message-Id: <202103121132.12CBWFPD077286@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: 25aac48d2ce3 - main - simplify journal_mount: move the out label after success block 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: 25aac48d2ce322355e7890a1de0f045a15d1cc09 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, 12 Mar 2021 11:32:15 -0000 The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=25aac48d2ce322355e7890a1de0f045a15d1cc09 commit 25aac48d2ce322355e7890a1de0f045a15d1cc09 Author: Konstantin Belousov AuthorDate: 2021-03-04 18:55:33 +0000 Commit: Konstantin Belousov CommitDate: 2021-03-12 11:30:37 +0000 simplify journal_mount: move the out label after success block This removes the need to check for error == 0. Reviewed by: mckusick Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Differential revision: https://reviews.freebsd.org/D29178 --- sys/ufs/ffs/ffs_softdep.c | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/sys/ufs/ffs/ffs_softdep.c b/sys/ufs/ffs/ffs_softdep.c index 786fb43c7d81..e60ac2f6868b 100644 --- a/sys/ufs/ffs/ffs_softdep.c +++ b/sys/ufs/ffs/ffs_softdep.c @@ -3016,26 +3016,26 @@ journal_mount(mp, fs, cred) jblocks->jb_low = jblocks->jb_free / 3; /* Reserve 33%. */ jblocks->jb_min = jblocks->jb_free / 10; /* Suspend at 10%. */ ump->softdep_jblocks = jblocks; -out: - if (error == 0) { - MNT_ILOCK(mp); - mp->mnt_flag |= MNT_SUJ; - mp->mnt_flag &= ~MNT_SOFTDEP; - MNT_IUNLOCK(mp); - /* - * Only validate the journal contents if the - * filesystem is clean, otherwise we write the logs - * but they'll never be used. If the filesystem was - * still dirty when we mounted it the journal is - * invalid and a new journal can only be valid if it - * starts from a clean mount. - */ - if (fs->fs_clean) { - DIP_SET(ip, i_modrev, fs->fs_mtime); - ip->i_flags |= IN_MODIFIED; - ffs_update(vp, 1); - } + + MNT_ILOCK(mp); + mp->mnt_flag |= MNT_SUJ; + mp->mnt_flag &= ~MNT_SOFTDEP; + MNT_IUNLOCK(mp); + + /* + * Only validate the journal contents if the + * filesystem is clean, otherwise we write the logs + * but they'll never be used. If the filesystem was + * still dirty when we mounted it the journal is + * invalid and a new journal can only be valid if it + * starts from a clean mount. + */ + if (fs->fs_clean) { + DIP_SET(ip, i_modrev, fs->fs_mtime); + ip->i_flags |= IN_MODIFIED; + ffs_update(vp, 1); } +out: vput(vp); return (error); } From owner-dev-commits-src-main@freebsd.org Fri Mar 12 11:32: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 B4232575962; Fri, 12 Mar 2021 11:32: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 4DxkDw4llLz3Qsc; Fri, 12 Mar 2021 11:32: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 96328170BD; Fri, 12 Mar 2021 11:32: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 12CBWGHZ077305; Fri, 12 Mar 2021 11:32:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 12CBWGuD077304; Fri, 12 Mar 2021 11:32:16 GMT (envelope-from git) Date: Fri, 12 Mar 2021 11:32:16 GMT Message-Id: <202103121132.12CBWGuD077304@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: fd97fa64638d - main - Add FFSV_FORCEINODEDEP flag for ffs_vgetf() 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: fd97fa64638d810b415af7afcc86634c9709ad12 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, 12 Mar 2021 11:32:16 -0000 The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=fd97fa64638d810b415af7afcc86634c9709ad12 commit fd97fa64638d810b415af7afcc86634c9709ad12 Author: Konstantin Belousov AuthorDate: 2021-03-03 17:40:56 +0000 Commit: Konstantin Belousov CommitDate: 2021-03-12 11:30:38 +0000 Add FFSV_FORCEINODEDEP flag for ffs_vgetf() It will be used to allow SU flush code to sync the volume while external consumers see that SU is already disabled on the filesystem. Use it where ffs_vgetf() called by SU code to process dependencies. Reviewed by: mckusick Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Differential revision: https://reviews.freebsd.org/D29178 --- sys/ufs/ffs/ffs_extern.h | 1 + sys/ufs/ffs/ffs_softdep.c | 13 +++++++------ sys/ufs/ffs/ffs_vfsops.c | 3 ++- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/sys/ufs/ffs/ffs_extern.h b/sys/ufs/ffs/ffs_extern.h index 544012089046..62486941354e 100644 --- a/sys/ufs/ffs/ffs_extern.h +++ b/sys/ufs/ffs/ffs_extern.h @@ -127,6 +127,7 @@ int ffs_breadz(struct ufsmount *, struct vnode *, daddr_t, daddr_t, int, #define FFSV_FORCEINSMQ 0x0001 #define FFSV_REPLACE 0x0002 #define FFSV_REPLACE_DOOMED 0x0004 +#define FFSV_FORCEINODEDEP 0x0008 /* * Flags to ffs_reload diff --git a/sys/ufs/ffs/ffs_softdep.c b/sys/ufs/ffs/ffs_softdep.c index e60ac2f6868b..9c32a785a321 100644 --- a/sys/ufs/ffs/ffs_softdep.c +++ b/sys/ufs/ffs/ffs_softdep.c @@ -1471,7 +1471,7 @@ get_parent_vp(struct vnode *vp, struct mount *mp, ino_t inum, struct buf *bp, ASSERT_VOP_ELOCKED(vp, "child vnode must be locked"); for (bplocked = true, pvp = NULL;;) { error = ffs_vgetf(mp, inum, LK_EXCLUSIVE | LK_NOWAIT, &pvp, - FFSV_FORCEINSMQ); + FFSV_FORCEINSMQ | FFSV_FORCEINODEDEP); if (error == 0) { /* * Since we could have unlocked vp, the inode @@ -1512,7 +1512,7 @@ get_parent_vp(struct vnode *vp, struct mount *mp, ino_t inum, struct buf *bp, VOP_UNLOCK(vp); error = ffs_vgetf(mp, inum, LK_EXCLUSIVE, &pvp, - FFSV_FORCEINSMQ); + FFSV_FORCEINSMQ | FFSV_FORCEINODEDEP); if (error != 0) { MPASS(error != ERELOOKUP); vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); @@ -8387,7 +8387,7 @@ handle_complete_freeblocks(freeblks, flags) */ if (spare && freeblks->fb_len != 0) { if (ffs_vgetf(freeblks->fb_list.wk_mp, freeblks->fb_inum, - flags, &vp, FFSV_FORCEINSMQ) != 0) + flags, &vp, FFSV_FORCEINSMQ | FFSV_FORCEINODEDEP) != 0) return (EBUSY); ip = VTOI(vp); if (ip->i_mode == 0) { @@ -10177,7 +10177,8 @@ handle_workitem_remove(dirrem, flags) mp = dirrem->dm_list.wk_mp; ump = VFSTOUFS(mp); flags |= LK_EXCLUSIVE; - if (ffs_vgetf(mp, oldinum, flags, &vp, FFSV_FORCEINSMQ) != 0) + if (ffs_vgetf(mp, oldinum, flags, &vp, FFSV_FORCEINSMQ | + FFSV_FORCEINODEDEP) != 0) return (EBUSY); ip = VTOI(vp); MPASS(ip->i_mode != 0); @@ -14269,7 +14270,7 @@ clear_remove(mp) if (error != 0) goto finish_write; error = ffs_vgetf(mp, ino, LK_EXCLUSIVE, &vp, - FFSV_FORCEINSMQ); + FFSV_FORCEINSMQ | FFSV_FORCEINODEDEP); vfs_unbusy(mp); if (error != 0) { softdep_error("clear_remove: vget", error); @@ -14349,7 +14350,7 @@ clear_inodedeps(mp) return; } if ((error = ffs_vgetf(mp, ino, LK_EXCLUSIVE, &vp, - FFSV_FORCEINSMQ)) != 0) { + FFSV_FORCEINSMQ | FFSV_FORCEINODEDEP)) != 0) { softdep_error("clear_inodedeps: vget", error); vfs_unbusy(mp); vn_finished_write(mp); diff --git a/sys/ufs/ffs/ffs_vfsops.c b/sys/ufs/ffs/ffs_vfsops.c index 762874562082..f2bfe13cf89b 100644 --- a/sys/ufs/ffs/ffs_vfsops.c +++ b/sys/ufs/ffs/ffs_vfsops.c @@ -2074,7 +2074,8 @@ ffs_vgetf(mp, ino, flags, vpp, ffs_flags) *vpp = NULL; return (error); } - if (DOINGSOFTDEP(vp)) + if (DOINGSOFTDEP(vp) && (!fs->fs_ronly || + (ffs_flags & FFSV_FORCEINODEDEP) != 0)) softdep_load_inodeblock(ip); else ip->i_effnlink = ip->i_nlink; From owner-dev-commits-src-main@freebsd.org Fri Mar 12 11:32: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 EABB0575AF4; Fri, 12 Mar 2021 11:32: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 4DxkDx6DBvz3QWG; Fri, 12 Mar 2021 11:32: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 C5A7616C4B; Fri, 12 Mar 2021 11:32: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 12CBWHeH077324; Fri, 12 Mar 2021 11:32:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 12CBWH2T077323; Fri, 12 Mar 2021 11:32:17 GMT (envelope-from git) Date: Fri, 12 Mar 2021 11:32:17 GMT Message-Id: <202103121132.12CBWH2T077323@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: a285d3edacf6 - main - ffs_extern.h: Add comments for ffs_vgetf() flags 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: a285d3edacf602e555a918119d787d94f342fe90 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, 12 Mar 2021 11:32:18 -0000 The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=a285d3edacf602e555a918119d787d94f342fe90 commit a285d3edacf602e555a918119d787d94f342fe90 Author: Konstantin Belousov AuthorDate: 2021-03-11 07:02:16 +0000 Commit: Konstantin Belousov CommitDate: 2021-03-12 11:30:59 +0000 ffs_extern.h: Add comments for ffs_vgetf() flags Requested and reviewed by: mckusick Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Differential revision: https://reviews.freebsd.org/D29178 --- sys/ufs/ffs/ffs_extern.h | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/sys/ufs/ffs/ffs_extern.h b/sys/ufs/ffs/ffs_extern.h index 62486941354e..7080edd21ab3 100644 --- a/sys/ufs/ffs/ffs_extern.h +++ b/sys/ufs/ffs/ffs_extern.h @@ -124,10 +124,12 @@ int ffs_breadz(struct ufsmount *, struct vnode *, daddr_t, daddr_t, int, /* * Flags to ffs_vgetf */ -#define FFSV_FORCEINSMQ 0x0001 -#define FFSV_REPLACE 0x0002 -#define FFSV_REPLACE_DOOMED 0x0004 -#define FFSV_FORCEINODEDEP 0x0008 +#define FFSV_FORCEINSMQ 0x0001 /* Force insertion into mount list */ +#define FFSV_REPLACE 0x0002 /* Replace existing vnode */ +#define FFSV_REPLACE_DOOMED 0x0004 /* Replace existing vnode if it is + doomed */ +#define FFSV_FORCEINODEDEP 0x0008 /* Force allocation of inodedep, ignore + MNT_SOFTDEP */ /* * Flags to ffs_reload From owner-dev-commits-src-main@freebsd.org Fri Mar 12 11:32: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 CC5AC575CA0; Fri, 12 Mar 2021 11:32: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 4DxkF50jzyz3Qp4; Fri, 12 Mar 2021 11:32: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 5705F17035; Fri, 12 Mar 2021 11:32: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 12CBWMAa077408; Fri, 12 Mar 2021 11:32:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 12CBWMbH077407; Fri, 12 Mar 2021 11:32:22 GMT (envelope-from git) Date: Fri, 12 Mar 2021 11:32:22 GMT Message-Id: <202103121132.12CBWMbH077407@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: fabbc3d879cc - main - softdep_flush(): do not access ump after we acked FLUSH_EXIT and unlocked SU lock 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: fabbc3d879cce5c37df25707107a0fcb64267346 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, 12 Mar 2021 11:32:27 -0000 The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=fabbc3d879cce5c37df25707107a0fcb64267346 commit fabbc3d879cce5c37df25707107a0fcb64267346 Author: Konstantin Belousov AuthorDate: 2021-02-28 22:45:04 +0000 Commit: Konstantin Belousov CommitDate: 2021-03-12 11:31:08 +0000 softdep_flush(): do not access ump after we acked FLUSH_EXIT and unlocked SU lock otherwise we might follow a pointer in the freed memory. Reviewed by: mckusick Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Differential revision: https://reviews.freebsd.org/D29178 --- sys/ufs/ffs/ffs_softdep.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/sys/ufs/ffs/ffs_softdep.c b/sys/ufs/ffs/ffs_softdep.c index af5b9f57b328..4e20652973b4 100644 --- a/sys/ufs/ffs/ffs_softdep.c +++ b/sys/ufs/ffs/ffs_softdep.c @@ -1569,6 +1569,7 @@ softdep_flush(addr) struct mount *mp; struct thread *td; struct ufsmount *ump; + int cleanups; td = curthread; td->td_pflags |= TDP_NORUNNINGBUF; @@ -1603,10 +1604,14 @@ softdep_flush(addr) continue; } ump->softdep_flags &= ~FLUSH_EXIT; + cleanups = ump->um_softdep->sd_cleanups; FREE_LOCK(ump); wakeup(&ump->softdep_flags); - if (print_threads) - printf("Stop thread %s: searchfailed %d, did cleanups %d\n", td->td_name, searchfailed, ump->um_softdep->sd_cleanups); + if (print_threads) { + printf("Stop thread %s: searchfailed %d, " + "did cleanups %d\n", + td->td_name, searchfailed, cleanups); + } atomic_subtract_int(&stat_flush_threads, 1); kthread_exit(); panic("kthread_exit failed\n"); From owner-dev-commits-src-main@freebsd.org Fri Mar 12 11:32: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 0B8E7575C10; Fri, 12 Mar 2021 11:32: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 4DxkF60VGrz3Qtn; Fri, 12 Mar 2021 11:32: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 7580816CBB; Fri, 12 Mar 2021 11:32: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 12CBWNbu077430; Fri, 12 Mar 2021 11:32:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 12CBWN1X077429; Fri, 12 Mar 2021 11:32:23 GMT (envelope-from git) Date: Fri, 12 Mar 2021 11:32:23 GMT Message-Id: <202103121132.12CBWN1X077429@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: d7e5e374167f - main - softdep_unmount: handle spurious wakeups 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: d7e5e374167fe98e998b80691824750f44bb050d 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, 12 Mar 2021 11:32:27 -0000 The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=d7e5e374167fe98e998b80691824750f44bb050d commit d7e5e374167fe98e998b80691824750f44bb050d Author: Konstantin Belousov AuthorDate: 2021-02-28 22:46:21 +0000 Commit: Konstantin Belousov CommitDate: 2021-03-12 11:31:08 +0000 softdep_unmount: handle spurious wakeups Reviewed by: mckusick Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Differential revision: https://reviews.freebsd.org/D29178 --- sys/ufs/ffs/ffs_softdep.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/sys/ufs/ffs/ffs_softdep.c b/sys/ufs/ffs/ffs_softdep.c index 4e20652973b4..cb0be9d21529 100644 --- a/sys/ufs/ffs/ffs_softdep.c +++ b/sys/ufs/ffs/ffs_softdep.c @@ -2805,10 +2805,13 @@ softdep_unmount(mp) ACQUIRE_LOCK(ump); ump->softdep_flags |= FLUSH_EXIT; wakeup(&ump->softdep_flushtd); - msleep(&ump->softdep_flags, LOCK_PTR(ump), PVM | PDROP, - "sdwait", 0); + while ((ump->softdep_flags & FLUSH_EXIT) != 0) { + msleep(&ump->softdep_flags, LOCK_PTR(ump), PVM, + "sdwait", 0); + } KASSERT((ump->softdep_flags & FLUSH_EXIT) == 0, ("Thread shutdown failed")); + FREE_LOCK(ump); } /* From owner-dev-commits-src-main@freebsd.org Fri Mar 12 11:32:28 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 98423575CF4; Fri, 12 Mar 2021 11:32:28 +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 4DxkF83Hhzz3Qwt; Fri, 12 Mar 2021 11:32: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 D5AF716C4D; Fri, 12 Mar 2021 11:32: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 12CBWQaN077492; Fri, 12 Mar 2021 11:32:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 12CBWQSD077491; Fri, 12 Mar 2021 11:32:26 GMT (envelope-from git) Date: Fri, 12 Mar 2021 11:32:26 GMT Message-Id: <202103121132.12CBWQSD077491@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: 7a8d4b4da69a - main - FFS: assign fully initialized struct mount_softdeps to um_softdep 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: 7a8d4b4da69af966bff4892acb2fd101a95a4848 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, 12 Mar 2021 11:32:28 -0000 The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=7a8d4b4da69af966bff4892acb2fd101a95a4848 commit 7a8d4b4da69af966bff4892acb2fd101a95a4848 Author: Konstantin Belousov AuthorDate: 2021-03-03 22:02:30 +0000 Commit: Konstantin Belousov CommitDate: 2021-03-12 11:31:08 +0000 FFS: assign fully initialized struct mount_softdeps to um_softdep Other threads observing the non-NULL um_softdep can assume that it is safe to use it. This is important for ro->rw remounts where change from read-only to read-write status cannot be made atomic. Reviewed by: mckusick Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Differential revision: https://reviews.freebsd.org/D29178 --- sys/ufs/ffs/ffs_softdep.c | 68 ++++++++++++++++++++++++----------------------- 1 file changed, 35 insertions(+), 33 deletions(-) diff --git a/sys/ufs/ffs/ffs_softdep.c b/sys/ufs/ffs/ffs_softdep.c index cb0be9d21529..cd00181b3c21 100644 --- a/sys/ufs/ffs/ffs_softdep.c +++ b/sys/ufs/ffs/ffs_softdep.c @@ -2679,50 +2679,52 @@ softdep_mount(devvp, mp, fs, cred) u_int cyl, i; int error; + ump = VFSTOUFS(mp); + sdp = malloc(sizeof(struct mount_softdeps), M_MOUNTDATA, M_WAITOK | M_ZERO); - MNT_ILOCK(mp); - mp->mnt_flag = (mp->mnt_flag & ~MNT_ASYNC) | MNT_SOFTDEP; - if ((mp->mnt_kern_flag & MNTK_SOFTDEP) == 0) { - mp->mnt_kern_flag = (mp->mnt_kern_flag & ~MNTK_ASYNC) | - MNTK_SOFTDEP | MNTK_NOASYNC; - } - ump = VFSTOUFS(mp); - ump->um_softdep = sdp; - MNT_IUNLOCK(mp); - rw_init(LOCK_PTR(ump), "per-fs softdep"); + rw_init(&sdp->sd_fslock, "SUrw"); sdp->sd_ump = ump; - LIST_INIT(&ump->softdep_workitem_pending); - LIST_INIT(&ump->softdep_journal_pending); - TAILQ_INIT(&ump->softdep_unlinked); - LIST_INIT(&ump->softdep_dirtycg); - ump->softdep_worklist_tail = NULL; - ump->softdep_on_worklist = 0; - ump->softdep_deps = 0; - LIST_INIT(&ump->softdep_mkdirlisthd); - ump->pagedep_hashtbl = hashinit(desiredvnodes / 5, M_PAGEDEP, - &ump->pagedep_hash_size); - ump->pagedep_nextclean = 0; - ump->inodedep_hashtbl = hashinit(desiredvnodes, M_INODEDEP, - &ump->inodedep_hash_size); - ump->inodedep_nextclean = 0; - ump->newblk_hashtbl = hashinit(max_softdeps / 2, M_NEWBLK, - &ump->newblk_hash_size); - ump->bmsafemap_hashtbl = hashinit(1024, M_BMSAFEMAP, - &ump->bmsafemap_hash_size); + LIST_INIT(&sdp->sd_workitem_pending); + LIST_INIT(&sdp->sd_journal_pending); + TAILQ_INIT(&sdp->sd_unlinked); + LIST_INIT(&sdp->sd_dirtycg); + sdp->sd_worklist_tail = NULL; + sdp->sd_on_worklist = 0; + sdp->sd_deps = 0; + LIST_INIT(&sdp->sd_mkdirlisthd); + sdp->sd_pdhash = hashinit(desiredvnodes / 5, M_PAGEDEP, + &sdp->sd_pdhashsize); + sdp->sd_pdnextclean = 0; + sdp->sd_idhash = hashinit(desiredvnodes, M_INODEDEP, + &sdp->sd_idhashsize); + sdp->sd_idnextclean = 0; + sdp->sd_newblkhash = hashinit(max_softdeps / 2, M_NEWBLK, + &sdp->sd_newblkhashsize); + sdp->sd_bmhash = hashinit(1024, M_BMSAFEMAP, &sdp->sd_bmhashsize); i = 1 << (ffs(desiredvnodes / 10) - 1); - ump->indir_hashtbl = malloc(i * sizeof(struct indir_hashhead), + sdp->sd_indirhash = malloc(i * sizeof(struct indir_hashhead), M_FREEWORK, M_WAITOK); - ump->indir_hash_size = i - 1; - for (i = 0; i <= ump->indir_hash_size; i++) - TAILQ_INIT(&ump->indir_hashtbl[i]); + sdp->sd_indirhashsize = i - 1; + for (i = 0; i <= sdp->sd_indirhashsize; i++) + TAILQ_INIT(&sdp->sd_indirhash[i]); #ifdef INVARIANTS for (i = 0; i <= D_LAST; i++) - LIST_INIT(&ump->softdep_alldeps[i]); + LIST_INIT(&sdp->sd_alldeps[i]); #endif ACQUIRE_GBLLOCK(&lk); TAILQ_INSERT_TAIL(&softdepmounts, sdp, sd_next); FREE_GBLLOCK(&lk); + + ump->um_softdep = sdp; + MNT_ILOCK(mp); + mp->mnt_flag = (mp->mnt_flag & ~MNT_ASYNC) | MNT_SOFTDEP; + if ((mp->mnt_kern_flag & MNTK_SOFTDEP) == 0) { + mp->mnt_kern_flag = (mp->mnt_kern_flag & ~MNTK_ASYNC) | + MNTK_SOFTDEP | MNTK_NOASYNC; + } + MNT_IUNLOCK(mp); + if ((fs->fs_flags & FS_SUJ) && (error = journal_mount(mp, fs, cred)) != 0) { printf("Failed to start journal: %d\n", error); From owner-dev-commits-src-main@freebsd.org Fri Mar 12 11:32: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 BE61F575BBE; Fri, 12 Mar 2021 11:32: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 4DxkF749YJz3Qys; Fri, 12 Mar 2021 11:32: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 9FB8F16C4C; Fri, 12 Mar 2021 11:32: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 12CBWONY077448; Fri, 12 Mar 2021 11:32:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 12CBWOxe077447; Fri, 12 Mar 2021 11:32:24 GMT (envelope-from git) Date: Fri, 12 Mar 2021 11:32:24 GMT Message-Id: <202103121132.12CBWOxe077447@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: f776c54cee81 - main - ffs_mount: when remounting ro->rw and sbupdate failed, cleanup softdeps 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: f776c54cee81b4297b59ffe87a0f154e3924ee7f 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, 12 Mar 2021 11:32:27 -0000 The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=f776c54cee81b4297b59ffe87a0f154e3924ee7f commit f776c54cee81b4297b59ffe87a0f154e3924ee7f Author: Konstantin Belousov AuthorDate: 2021-03-03 18:02:13 +0000 Commit: Konstantin Belousov CommitDate: 2021-03-12 11:31:08 +0000 ffs_mount: when remounting ro->rw and sbupdate failed, cleanup softdeps Reviewed by: mckusick Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Differential revision: https://reviews.freebsd.org/D29178 --- sys/ufs/ffs/ffs_vfsops.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/ufs/ffs/ffs_vfsops.c b/sys/ufs/ffs/ffs_vfsops.c index 273d6e497955..584a20adb54d 100644 --- a/sys/ufs/ffs/ffs_vfsops.c +++ b/sys/ufs/ffs/ffs_vfsops.c @@ -645,6 +645,8 @@ ffs_mount(struct mount *mp) fs->fs_clean = 0; if ((error = ffs_sbupdate(ump, MNT_WAIT, 0)) != 0) { fs->fs_ronly = 1; + if ((fs->fs_flags & FS_DOSOFTDEP) != 0) + softdep_unmount(mp); MNT_ILOCK(mp); mp->mnt_flag |= saved_mnt_flag; MNT_IUNLOCK(mp); From owner-dev-commits-src-main@freebsd.org Fri Mar 12 11:32:28 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 904E7575EA2; Fri, 12 Mar 2021 11:32:28 +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 4DxkF831hRz3QpG; Fri, 12 Mar 2021 11:32: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 C293116CBC; Fri, 12 Mar 2021 11:32: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 12CBWPI1077470; Fri, 12 Mar 2021 11:32:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 12CBWPxG077469; Fri, 12 Mar 2021 11:32:25 GMT (envelope-from git) Date: Fri, 12 Mar 2021 11:32:25 GMT Message-Id: <202103121132.12CBWPxG077469@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: 2af934cc15bd - main - Assert that um_softdep is NULL on free(ump), i.e. softdep_unmount() was called 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: 2af934cc15bd8e7daa2daeb806321d0daddf3b7a 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, 12 Mar 2021 11:32:28 -0000 The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=2af934cc15bd8e7daa2daeb806321d0daddf3b7a commit 2af934cc15bd8e7daa2daeb806321d0daddf3b7a Author: Konstantin Belousov AuthorDate: 2021-03-03 19:40:34 +0000 Commit: Konstantin Belousov CommitDate: 2021-03-12 11:31:08 +0000 Assert that um_softdep is NULL on free(ump), i.e. softdep_unmount() was called Reviewed by: mckusick Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Differential revision: https://reviews.freebsd.org/D29178 --- sys/ufs/ffs/ffs_vfsops.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/ufs/ffs/ffs_vfsops.c b/sys/ufs/ffs/ffs_vfsops.c index 584a20adb54d..321ed03f7f67 100644 --- a/sys/ufs/ffs/ffs_vfsops.c +++ b/sys/ufs/ffs/ffs_vfsops.c @@ -1355,6 +1355,7 @@ out: free(mp->mnt_gjprovider, M_UFSMNT); mp->mnt_gjprovider = NULL; } + MPASS(ump->um_softdep == NULL); free(ump, M_UFSMNT); mp->mnt_data = NULL; } @@ -1537,6 +1538,7 @@ ffs_unmount(mp, mntflags) UFS_UNLOCK(ump); if (MOUNTEDSOFTDEP(mp)) softdep_unmount(mp); + MPASS(ump->um_softdep == NULL); if (fs->fs_ronly == 0 || ump->um_fsckpid > 0) { fs->fs_clean = fs->fs_flags & (FS_UNCLEAN|FS_NEEDSFSCK) ? 0 : 1; error = ffs_sbupdate(ump, MNT_WAIT, 0); From owner-dev-commits-src-main@freebsd.org Fri Mar 12 11:32: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 BC416575EB1; Fri, 12 Mar 2021 11:32: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 4DxkFF0cB2z3R4h; Fri, 12 Mar 2021 11:32: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 1EC83170C3; Fri, 12 Mar 2021 11: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 12CBWSer077532; Fri, 12 Mar 2021 11: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 12CBWS8f077531; Fri, 12 Mar 2021 11:32:28 GMT (envelope-from git) Date: Fri, 12 Mar 2021 11:32:28 GMT Message-Id: <202103121132.12CBWS8f077531@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: 44691b33cc99 - main - vlrureclaim: only skip vnode with resident pages if it own the pages 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: 44691b33cc99d0e17262368b6e0f64e531994a23 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, 12 Mar 2021 11:32:34 -0000 The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=44691b33cc99d0e17262368b6e0f64e531994a23 commit 44691b33cc99d0e17262368b6e0f64e531994a23 Author: Konstantin Belousov AuthorDate: 2021-03-06 21:09:16 +0000 Commit: Konstantin Belousov CommitDate: 2021-03-12 11:31:08 +0000 vlrureclaim: only skip vnode with resident pages if it own the pages Nullfs vnode which shares vm_object and pages with the lower vnode should not be exempt from the reclaim just because lower vnode cached a lot. Their reclamation is actually very cheap and should be preferred over real fs vnodes, but this change is already useful. Reported and tested by: pho Reviewed by: mckusick Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Differential revision: https://reviews.freebsd.org/D29178 --- sys/kern/vfs_subr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c index c4772f691397..37e713ee48ea 100644 --- a/sys/kern/vfs_subr.c +++ b/sys/kern/vfs_subr.c @@ -1169,7 +1169,7 @@ restart: VI_LOCK(vp); if (vp->v_usecount > 0 || (!reclaim_nc_src && !LIST_EMPTY(&vp->v_cache_src)) || - (vp->v_object != NULL && + (vp->v_object != NULL && vp->v_object->handle == vp && vp->v_object->resident_page_count > trigger)) { VOP_UNLOCK(vp); vdropl(vp); From owner-dev-commits-src-main@freebsd.org Fri Mar 12 11:32: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 26F5D575D01; Fri, 12 Mar 2021 11:32: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 4DxkF50xdlz3R4L; Fri, 12 Mar 2021 11:32: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 DF256171EA; Fri, 12 Mar 2021 11:32: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 12CBWJhD077368; Fri, 12 Mar 2021 11:32:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 12CBWJKM077367; Fri, 12 Mar 2021 11:32:19 GMT (envelope-from git) Date: Fri, 12 Mar 2021 11:32:19 GMT Message-Id: <202103121132.12CBWJKM077367@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: 7f682bdcabda - main - Rework MOUNTED/DOING SOFTDEP/SUJ macros 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: 7f682bdcabdaf95ded6a69994344ddbc84fd36db 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, 12 Mar 2021 11:32:27 -0000 The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=7f682bdcabdaf95ded6a69994344ddbc84fd36db commit 7f682bdcabdaf95ded6a69994344ddbc84fd36db Author: Konstantin Belousov AuthorDate: 2021-03-03 17:43:17 +0000 Commit: Konstantin Belousov CommitDate: 2021-03-12 11:31:07 +0000 Rework MOUNTED/DOING SOFTDEP/SUJ macros Now MNT_SOFTDEP indicates that SU are active in any variant +-J, and SU+J is indicated by MNT_SOFTDEP | MNT_SUJ combination. The reason is that unmount will be able to easily hide SU from other operations by clearing MNT_SOFTDEP while keeping the record of the active journal. Reviewed by: mckusick Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Differential revision: https://reviews.freebsd.org/D29178 --- sys/ufs/ffs/ffs_softdep.c | 1 - sys/ufs/ufs/inode.h | 10 +++++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/sys/ufs/ffs/ffs_softdep.c b/sys/ufs/ffs/ffs_softdep.c index c1a9c300aeff..519a3679cac9 100644 --- a/sys/ufs/ffs/ffs_softdep.c +++ b/sys/ufs/ffs/ffs_softdep.c @@ -3024,7 +3024,6 @@ journal_mount(mp, fs, cred) MNT_ILOCK(mp); mp->mnt_flag |= MNT_SUJ; - mp->mnt_flag &= ~MNT_SOFTDEP; MNT_IUNLOCK(mp); /* diff --git a/sys/ufs/ufs/inode.h b/sys/ufs/ufs/inode.h index 0169d2903108..a82b4658c0af 100644 --- a/sys/ufs/ufs/inode.h +++ b/sys/ufs/ufs/inode.h @@ -265,11 +265,11 @@ struct indir { #define ITOV(ip) ((ip)->i_vnode) /* Determine if soft dependencies are being done */ -#define DOINGSOFTDEP(vp) \ - (((vp)->v_mount->mnt_flag & (MNT_SOFTDEP | MNT_SUJ)) != 0) -#define MOUNTEDSOFTDEP(mp) (((mp)->mnt_flag & (MNT_SOFTDEP | MNT_SUJ)) != 0) -#define DOINGSUJ(vp) (((vp)->v_mount->mnt_flag & MNT_SUJ) != 0) -#define MOUNTEDSUJ(mp) (((mp)->mnt_flag & MNT_SUJ) != 0) +#define MOUNTEDSOFTDEP(mp) (((mp)->mnt_flag & MNT_SOFTDEP) != 0) +#define DOINGSOFTDEP(vp) MOUNTEDSOFTDEP((vp)->v_mount) +#define MOUNTEDSUJ(mp) (((mp)->mnt_flag & (MNT_SOFTDEP | MNT_SUJ)) == \ + (MNT_SOFTDEP | MNT_SUJ)) +#define DOINGSUJ(vp) MOUNTEDSUJ((vp)->v_mount) /* This overlays the fid structure (see mount.h). */ struct ufid { From owner-dev-commits-src-main@freebsd.org Fri Mar 12 11:32: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 B1A16575C9D; Fri, 12 Mar 2021 11:32: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 4DxkF262dxz3QtF; Fri, 12 Mar 2021 11:32: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 4362117033; Fri, 12 Mar 2021 11:32: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 12CBWLBa077386; Fri, 12 Mar 2021 11:32:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 12CBWLmm077385; Fri, 12 Mar 2021 11:32:21 GMT (envelope-from git) Date: Fri, 12 Mar 2021 11:32:21 GMT Message-Id: <202103121132.12CBWLmm077385@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: 7c7a6681fab2 - main - ffs: clear MNT_SOFTDEP earlier when remounting rw to ro 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: 7c7a6681fab2c0453085d30424f479c0f766904d 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, 12 Mar 2021 11:32:26 -0000 The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=7c7a6681fab2c0453085d30424f479c0f766904d commit 7c7a6681fab2c0453085d30424f479c0f766904d Author: Konstantin Belousov AuthorDate: 2021-02-28 18:55:35 +0000 Commit: Konstantin Belousov CommitDate: 2021-03-12 11:31:07 +0000 ffs: clear MNT_SOFTDEP earlier when remounting rw to ro Suppose that we remount rw->ro and in parallel some reader tries to instantiate a vnode, e.g. during lookup. Suppose that softdep_unmount() already started, but we did not cleared the MNT_SOFTDEP flag yet. Then ffs_vgetf() calls into softdep_load_inodeblock() which accessed destroyed hashes and freed memory. Set/clear fs_ronly simultaneously (WRT to files flush) with MNT_SOFTDEP. It might be reasonable to move the change of fs_ronly to under MNT_ILOCK, but no readers take it. Reported and tested by: pho Reviewed by: mckusick Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Differential revision: https://reviews.freebsd.org/D29178 --- sys/ufs/ffs/ffs_softdep.c | 21 ++++++++++++--------- sys/ufs/ffs/ffs_vfsops.c | 28 +++++++++++++++++++++++++--- 2 files changed, 37 insertions(+), 12 deletions(-) diff --git a/sys/ufs/ffs/ffs_softdep.c b/sys/ufs/ffs/ffs_softdep.c index 519a3679cac9..af5b9f57b328 100644 --- a/sys/ufs/ffs/ffs_softdep.c +++ b/sys/ufs/ffs/ffs_softdep.c @@ -1792,10 +1792,10 @@ softdep_process_worklist(mp, full) long starttime; KASSERT(mp != NULL, ("softdep_process_worklist: NULL mp")); - if (MOUNTEDSOFTDEP(mp) == 0) + ump = VFSTOUFS(mp); + if (ump->um_softdep == NULL) return (0); matchcnt = 0; - ump = VFSTOUFS(mp); ACQUIRE_LOCK(ump); starttime = time_second; softdep_process_journal(mp, NULL, full ? MNT_WAIT : 0); @@ -2134,6 +2134,8 @@ softdep_waitidle(struct mount *mp, int flags __unused) int error, i; ump = VFSTOUFS(mp); + KASSERT(ump->um_softdep != NULL, + ("softdep_waitidle called on non-softdep filesystem")); devvp = ump->um_devvp; td = curthread; error = 0; @@ -2171,14 +2173,15 @@ softdep_flushfiles(oldmnt, flags, td) int flags; struct thread *td; { -#ifdef QUOTA struct ufsmount *ump; +#ifdef QUOTA int i; #endif int error, early, depcount, loopcnt, retry_flush_count, retry; int morework; - KASSERT(MOUNTEDSOFTDEP(oldmnt) != 0, + ump = VFSTOUFS(oldmnt); + KASSERT(ump->um_softdep != NULL, ("softdep_flushfiles called on non-softdep filesystem")); loopcnt = 10; retry_flush_count = 3; @@ -2222,7 +2225,6 @@ retry_flush: MNT_ILOCK(oldmnt); morework = oldmnt->mnt_nvnodelistsize > 0; #ifdef QUOTA - ump = VFSTOUFS(oldmnt); UFS_LOCK(ump); for (i = 0; i < MAXQUOTAS; i++) { if (ump->um_quotas[i] != NULLVP) @@ -2783,7 +2785,7 @@ softdep_unmount(mp) ("softdep_unmount called on non-softdep filesystem")); MNT_ILOCK(mp); mp->mnt_flag &= ~MNT_SOFTDEP; - if (MOUNTEDSUJ(mp) == 0) { + if ((mp->mnt_flag & MNT_SUJ) == 0) { MNT_IUNLOCK(mp); } else { mp->mnt_flag &= ~MNT_SUJ; @@ -3706,12 +3708,12 @@ softdep_process_journal(mp, needwk, flags) int off; int devbsize; - if (MOUNTEDSUJ(mp) == 0) + ump = VFSTOUFS(mp); + if (ump->um_softdep == NULL || ump->um_softdep->sd_jblocks == NULL) return; shouldflush = softdep_flushcache; bio = NULL; jseg = NULL; - ump = VFSTOUFS(mp); LOCK_OWNED(ump); fs = ump->um_fs; jblocks = ump->softdep_jblocks; @@ -14201,7 +14203,8 @@ check_clear_deps(mp) * causes deferred work to be done sooner. */ ump = VFSTOUFS(mp); - suj_susp = MOUNTEDSUJ(mp) && ump->softdep_jblocks->jb_suspended; + suj_susp = ump->um_softdep->sd_jblocks != NULL && + ump->softdep_jblocks->jb_suspended; if (req_clear_remove || req_clear_inodedeps || suj_susp) { FREE_LOCK(ump); softdep_send_speedup(ump, 0, BIO_SPEEDUP_TRIM | BIO_SPEEDUP_WRITE); diff --git a/sys/ufs/ffs/ffs_vfsops.c b/sys/ufs/ffs/ffs_vfsops.c index f2bfe13cf89b..273d6e497955 100644 --- a/sys/ufs/ffs/ffs_vfsops.c +++ b/sys/ufs/ffs/ffs_vfsops.c @@ -380,6 +380,7 @@ ffs_mount(struct mount *mp) accmode_t accmode; struct nameidata ndp; char *fspec; + bool mounted_softdep; td = curthread; if (vfs_filteropt(mp->mnt_optnew, ffs_opts)) @@ -491,6 +492,16 @@ ffs_mount(struct mount *mp) error = vfs_write_suspend_umnt(mp); if (error != 0) return (error); + + fs->fs_ronly = 1; + if (MOUNTEDSOFTDEP(mp)) { + MNT_ILOCK(mp); + mp->mnt_flag &= ~MNT_SOFTDEP; + MNT_IUNLOCK(mp); + mounted_softdep = true; + } else + mounted_softdep = false; + /* * Check for and optionally get rid of files open * for writing. @@ -498,15 +509,22 @@ ffs_mount(struct mount *mp) flags = WRITECLOSE; if (mp->mnt_flag & MNT_FORCE) flags |= FORCECLOSE; - if (MOUNTEDSOFTDEP(mp)) { + if (mounted_softdep) { error = softdep_flushfiles(mp, flags, td); } else { error = ffs_flushfiles(mp, flags, td); } if (error) { + fs->fs_ronly = 0; + if (mounted_softdep) { + MNT_ILOCK(mp); + mp->mnt_flag |= MNT_SOFTDEP; + MNT_IUNLOCK(mp); + } vfs_write_resume(mp, 0); return (error); } + if (fs->fs_pendingblocks != 0 || fs->fs_pendinginodes != 0) { printf("WARNING: %s Update error: blocks %jd " @@ -521,10 +539,15 @@ ffs_mount(struct mount *mp) if ((error = ffs_sbupdate(ump, MNT_WAIT, 0)) != 0) { fs->fs_ronly = 0; fs->fs_clean = 0; + if (mounted_softdep) { + MNT_ILOCK(mp); + mp->mnt_flag |= MNT_SOFTDEP; + MNT_IUNLOCK(mp); + } vfs_write_resume(mp, 0); return (error); } - if (MOUNTEDSOFTDEP(mp)) + if (mounted_softdep) softdep_unmount(mp); g_topology_lock(); /* @@ -532,7 +555,6 @@ ffs_mount(struct mount *mp) */ g_access(ump->um_cp, 0, -1, -1); g_topology_unlock(); - fs->fs_ronly = 1; MNT_ILOCK(mp); mp->mnt_flag |= MNT_RDONLY; MNT_IUNLOCK(mp); From owner-dev-commits-src-main@freebsd.org Fri Mar 12 11:32: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 2F5A55759F4; Fri, 12 Mar 2021 11:32: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 4DxkDz6GJXz3QqY; Fri, 12 Mar 2021 11:32: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 09C2B170BE; Fri, 12 Mar 2021 11:32: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 12CBWIYa077346; Fri, 12 Mar 2021 11:32:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 12CBWItr077345; Fri, 12 Mar 2021 11:32:18 GMT (envelope-from git) Date: Fri, 12 Mar 2021 11:32:18 GMT Message-Id: <202103121132.12CBWItr077345@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: 81cdb19e04e5 - main - ffs softdep: clear ump->um_softdep on softdep_unmount() 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: 81cdb19e04e57a934e8a5dd76e5c7e0afcba1acb 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, 12 Mar 2021 11:32:27 -0000 The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=81cdb19e04e57a934e8a5dd76e5c7e0afcba1acb commit 81cdb19e04e57a934e8a5dd76e5c7e0afcba1acb Author: Konstantin Belousov AuthorDate: 2021-03-03 17:42:24 +0000 Commit: Konstantin Belousov CommitDate: 2021-03-12 11:31:07 +0000 ffs softdep: clear ump->um_softdep on softdep_unmount() Reviewed by: mckusick Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Differential revision: https://reviews.freebsd.org/D29178 --- sys/ufs/ffs/ffs_softdep.c | 47 ++++++++++++++++++++++++++--------------------- 1 file changed, 26 insertions(+), 21 deletions(-) diff --git a/sys/ufs/ffs/ffs_softdep.c b/sys/ufs/ffs/ffs_softdep.c index 9c32a785a321..c1a9c300aeff 100644 --- a/sys/ufs/ffs/ffs_softdep.c +++ b/sys/ufs/ffs/ffs_softdep.c @@ -2776,13 +2776,11 @@ softdep_unmount(mp) struct mount *mp; { struct ufsmount *ump; -#ifdef INVARIANTS - int i; -#endif + struct mount_softdeps *ums; - KASSERT(MOUNTEDSOFTDEP(mp) != 0, - ("softdep_unmount called on non-softdep filesystem")); ump = VFSTOUFS(mp); + KASSERT(ump->um_softdep != NULL, + ("softdep_unmount called on non-softdep filesystem")); MNT_ILOCK(mp); mp->mnt_flag &= ~MNT_SOFTDEP; if (MOUNTEDSUJ(mp) == 0) { @@ -2805,30 +2803,37 @@ softdep_unmount(mp) KASSERT((ump->softdep_flags & FLUSH_EXIT) == 0, ("Thread shutdown failed")); } + /* - * Free up our resources. + * We are no longer have softdep structure attached to ump. */ + ums = ump->um_softdep; ACQUIRE_GBLLOCK(&lk); - TAILQ_REMOVE(&softdepmounts, ump->um_softdep, sd_next); + TAILQ_REMOVE(&softdepmounts, ums, sd_next); FREE_GBLLOCK(&lk); - rw_destroy(LOCK_PTR(ump)); - hashdestroy(ump->pagedep_hashtbl, M_PAGEDEP, ump->pagedep_hash_size); - hashdestroy(ump->inodedep_hashtbl, M_INODEDEP, ump->inodedep_hash_size); - hashdestroy(ump->newblk_hashtbl, M_NEWBLK, ump->newblk_hash_size); - hashdestroy(ump->bmsafemap_hashtbl, M_BMSAFEMAP, - ump->bmsafemap_hash_size); - free(ump->indir_hashtbl, M_FREEWORK); + ump->um_softdep = NULL; + + /* + * Free up our resources. + */ + rw_destroy(&ums->sd_fslock); + hashdestroy(ums->sd_pdhash, M_PAGEDEP, ums->sd_pdhashsize); + hashdestroy(ums->sd_idhash, M_INODEDEP, ums->sd_idhashsize); + hashdestroy(ums->sd_newblkhash, M_NEWBLK, ums->sd_newblkhashsize); + hashdestroy(ums->sd_bmhash, M_BMSAFEMAP, ums->sd_bmhashsize); + free(ums->sd_indirhash, M_FREEWORK); #ifdef INVARIANTS - for (i = 0; i <= D_LAST; i++) { - KASSERT(ump->softdep_curdeps[i] == 0, + for (int i = 0; i <= D_LAST; i++) { + KASSERT(ums->sd_curdeps[i] == 0, ("Unmount %s: Dep type %s != 0 (%ld)", ump->um_fs->fs_fsmnt, - TYPENAME(i), ump->softdep_curdeps[i])); - KASSERT(LIST_EMPTY(&ump->softdep_alldeps[i]), - ("Unmount %s: Dep type %s not empty (%p)", ump->um_fs->fs_fsmnt, - TYPENAME(i), LIST_FIRST(&ump->softdep_alldeps[i]))); + TYPENAME(i), ums->sd_curdeps[i])); + KASSERT(LIST_EMPTY(&ums->sd_alldeps[i]), + ("Unmount %s: Dep type %s not empty (%p)", + ump->um_fs->fs_fsmnt, + TYPENAME(i), LIST_FIRST(&ums->sd_alldeps[i]))); } #endif - free(ump->um_softdep, M_MOUNTDATA); + free(ums, M_MOUNTDATA); } static struct jblocks * From owner-dev-commits-src-main@freebsd.org Fri Mar 12 11:32: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 27B15575C2A; Fri, 12 Mar 2021 11:32: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 4DxkFD6SqBz3R6q; Fri, 12 Mar 2021 11:32: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 F305516C4E; Fri, 12 Mar 2021 11:32: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 12CBWRhv077512; Fri, 12 Mar 2021 11:32:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 12CBWRA3077511; Fri, 12 Mar 2021 11:32:27 GMT (envelope-from git) Date: Fri, 12 Mar 2021 11:32:27 GMT Message-Id: <202103121132.12CBWRA3077511@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: 0b3948e73b74 - main - softdep_unmount: assert that no dandling dependencies are left 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: 0b3948e73b749b0fefc3f9d4fc61f356542bb9b9 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, 12 Mar 2021 11:32:33 -0000 The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=0b3948e73b749b0fefc3f9d4fc61f356542bb9b9 commit 0b3948e73b749b0fefc3f9d4fc61f356542bb9b9 Author: Konstantin Belousov AuthorDate: 2021-03-06 09:52:10 +0000 Commit: Konstantin Belousov CommitDate: 2021-03-12 11:31:08 +0000 softdep_unmount: assert that no dandling dependencies are left Reviewed by: mckusick Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Differential revision: https://reviews.freebsd.org/D29178 --- sys/ufs/ffs/ffs_softdep.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/sys/ufs/ffs/ffs_softdep.c b/sys/ufs/ffs/ffs_softdep.c index cd00181b3c21..0091b5dcd3b8 100644 --- a/sys/ufs/ffs/ffs_softdep.c +++ b/sys/ufs/ffs/ffs_softdep.c @@ -2825,6 +2825,13 @@ softdep_unmount(mp) FREE_GBLLOCK(&lk); ump->um_softdep = NULL; + KASSERT(ums->sd_on_journal == 0, + ("ump %p ums %p on_journal %d", ump, ums, ums->sd_on_journal)); + KASSERT(ums->sd_on_worklist == 0, + ("ump %p ums %p on_worklist %d", ump, ums, ums->sd_on_worklist)); + KASSERT(ums->sd_deps == 0, + ("ump %p ums %p deps %d", ump, ums, ums->sd_deps)); + /* * Free up our resources. */ From owner-dev-commits-src-main@freebsd.org Fri Mar 12 11:41: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 22B295762F8; Fri, 12 Mar 2021 11:41: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 4DxkRS0Sbtz3jSF; Fri, 12 Mar 2021 11:41: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 3850B16CBD; Fri, 12 Mar 2021 11:32: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 12CBWUPP077554; Fri, 12 Mar 2021 11:32:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 12CBWUXL077553; Fri, 12 Mar 2021 11:32:30 GMT (envelope-from git) Date: Fri, 12 Mar 2021 11:32:30 GMT Message-Id: <202103121132.12CBWUXL077553@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: 16dea8341024 - main - null_vput_pair(): release use reference on dvp earlier 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: 16dea8341024b8ee8be619c27d4e63bd81bd9b6c 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, 12 Mar 2021 11:41:24 -0000 The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=16dea8341024b8ee8be619c27d4e63bd81bd9b6c commit 16dea8341024b8ee8be619c27d4e63bd81bd9b6c Author: Konstantin Belousov AuthorDate: 2021-03-07 21:08:38 +0000 Commit: Konstantin Belousov CommitDate: 2021-03-12 11:31:08 +0000 null_vput_pair(): release use reference on dvp earlier We might own the last use reference, and then vrele() at the end would need to take the dvp vnode lock to inactivate, which causes deadlock with vp. We cannot vrele() dvp from start since this might unlock ldvp. Handle it by holding the vnode and dropping use ref after lowerfs VOP_VPUT_PAIR() ended. This effectivaly requires unlock of the vp vnode after VOP_VPUT_PAIR(), so the call is changed to set unlock_vp to true unconditionally. This opens more opportunities for vp to be reclaimed, if lvp is still alive we reinstantiate vp with null_nodeget(). Reported and tested by: pho Reviewed by: mckusick Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Differential revision: https://reviews.freebsd.org/D29178 --- sys/fs/nullfs/null_vnops.c | 45 +++++++++++++++++++++++++++++++-------------- 1 file changed, 31 insertions(+), 14 deletions(-) diff --git a/sys/fs/nullfs/null_vnops.c b/sys/fs/nullfs/null_vnops.c index 45065e0be7b5..bc0f5cdb7801 100644 --- a/sys/fs/nullfs/null_vnops.c +++ b/sys/fs/nullfs/null_vnops.c @@ -985,33 +985,50 @@ null_vput_pair(struct vop_vput_pair_args *ap) vpp = ap->a_vpp; vp = NULL; lvp = NULL; - if (vpp != NULL) { + mp = NULL; + if (vpp != NULL) vp = *vpp; - if (vp != NULL) { + if (vp != NULL) { + lvp = NULLVPTOLOWERVP(vp); + vref(lvp); + if (!ap->a_unlock_vp) { vhold(vp); + vhold(lvp); mp = vp->v_mount; - lvp = NULLVPTOLOWERVP(vp); - if (ap->a_unlock_vp) - vref(lvp); + vfs_ref(mp); } } - res = VOP_VPUT_PAIR(ldvp, &lvp, ap->a_unlock_vp); + res = VOP_VPUT_PAIR(ldvp, lvp != NULL ? &lvp : NULL, true); + if (vp != NULL && ap->a_unlock_vp) + vrele(vp); + vrele(dvp); + + if (vp == NULL || ap->a_unlock_vp) + return (res); - /* lvp might have been unlocked and vp reclaimed */ - if (vp != NULL) { - if (!ap->a_unlock_vp && vp->v_vnlock != lvp->v_vnlock) { + /* lvp has been unlocked and vp might be reclaimed */ + VOP_LOCK(vp, LK_EXCLUSIVE | LK_RETRY); + if (vp->v_data == NULL && vfs_busy(mp, MBF_NOWAIT) == 0) { + vput(vp); + vget(lvp, LK_EXCLUSIVE | LK_RETRY); + if (VN_IS_DOOMED(lvp)) { + vput(lvp); + vget(vp, LK_EXCLUSIVE | LK_RETRY); + } else { error = null_nodeget(mp, lvp, &vp1); if (error == 0) { - vput(vp); *vpp = vp1; + } else { + vget(vp, LK_EXCLUSIVE | LK_RETRY); } } - if (ap->a_unlock_vp) - vrele(vp); - vdrop(vp); + vfs_unbusy(mp); } - vrele(dvp); + vdrop(lvp); + vdrop(vp); + vfs_rel(mp); + return (res); } From owner-dev-commits-src-main@freebsd.org Fri Mar 12 11:58: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 988655769BA; Fri, 12 Mar 2021 11:58: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 4Dxkpm3lKSz3k6k; Fri, 12 Mar 2021 11:58: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 7369B17608; Fri, 12 Mar 2021 11:58: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 12CBw81O004483; Fri, 12 Mar 2021 11:58:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 12CBw8PY004482; Fri, 12 Mar 2021 11:58:08 GMT (envelope-from git) Date: Fri, 12 Mar 2021 11:58:08 GMT Message-Id: <202103121158.12CBw8PY004482@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: cada2b74b8d6 - main - Update doc links in README 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: cada2b74b8d670741643dca8e3d40c39d8fc7105 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, 12 Mar 2021 11:58:08 -0000 The branch main has been updated by lwhsu: URL: https://cgit.FreeBSD.org/src/commit/?id=cada2b74b8d670741643dca8e3d40c39d8fc7105 commit cada2b74b8d670741643dca8e3d40c39d8fc7105 Author: Li-Wen Hsu AuthorDate: 2021-03-12 11:55:56 +0000 Commit: Li-Wen Hsu CommitDate: 2021-03-12 11:57:58 +0000 Update doc links in README --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index e6899c7549e0..67428843ee20 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ For copyright information, please see [the file COPYRIGHT](COPYRIGHT) in this di Additional copyright information also exists for some sources in this tree - please see the specific source directories for more information. The Makefile in this directory supports a number of targets for building components (or all) of the FreeBSD source tree. -See build(7), config(8), [FreeBSD handbook on building userland](https://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/makeworld.html), and [Handbook for kernels](https://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/kernelconfig.html) for more information, including setting make(1) variables. +See build(7), config(8), [FreeBSD handbook on building userland](https://docs.freebsd.org/en/books/handbook/cutting-edge/#makeworld), and [Handbook for kernels](https://docs.freebsd.org/en/books/handbook/kernelconfig/) for more information, including setting make(1) variables. Source Roadmap: --------------- @@ -39,4 +39,4 @@ Source Roadmap: | usr.bin | User commands. | | usr.sbin | System administration commands. | -For information on synchronizing your source tree with one or more of the FreeBSD Project's development branches, please see [FreeBSD Handbook](https://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/current-stable.html). +For information on synchronizing your source tree with one or more of the FreeBSD Project's development branches, please see [FreeBSD Handbook](https://docs.freebsd.org/en/books/handbook/cutting-edge/#current-stable). From owner-dev-commits-src-main@freebsd.org Fri Mar 12 11:58: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 B2572576CA0; Fri, 12 Mar 2021 11:58: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 4Dxkpn4hrZz3kW9; Fri, 12 Mar 2021 11:58: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 94133172E0; Fri, 12 Mar 2021 11:58: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 12CBw9PX004503; Fri, 12 Mar 2021 11:58:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 12CBw9JF004502; Fri, 12 Mar 2021 11:58:09 GMT (envelope-from git) Date: Fri, 12 Mar 2021 11:58:09 GMT Message-Id: <202103121158.12CBw9JF004502@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: aaf998056ed4 - main - Whitespace cleanup 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: aaf998056ed46c0dfb429e3e5cfe624c8aa4dec8 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, 12 Mar 2021 11:58:09 -0000 The branch main has been updated by lwhsu: URL: https://cgit.FreeBSD.org/src/commit/?id=aaf998056ed46c0dfb429e3e5cfe624c8aa4dec8 commit aaf998056ed46c0dfb429e3e5cfe624c8aa4dec8 Author: Li-Wen Hsu AuthorDate: 2021-03-12 11:57:30 +0000 Commit: Li-Wen Hsu CommitDate: 2021-03-12 11:57:58 +0000 Whitespace cleanup --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 67428843ee20..89972e866b61 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ See build(7), config(8), [FreeBSD handbook on building userland](https://docs.fr Source Roadmap: --------------- | Directory | Description | -| --------- | ------------ | +| --------- | ----------- | | bin | System/user commands. | | cddl | Various commands and libraries under the Common Development and Distribution License. | | contrib | Packages contributed by 3rd parties. | From owner-dev-commits-src-main@freebsd.org Fri Mar 12 12:00: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 E70C55771F2; Fri, 12 Mar 2021 12:00:38 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.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 4Dxksf0tyJz3kp5; Fri, 12 Mar 2021 12:00:37 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.16.1/8.16.1) with ESMTPS id 12CC0Tsp070045 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Fri, 12 Mar 2021 14:00:32 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua 12CC0Tsp070045 Received: (from kostik@localhost) by tom.home (8.16.1/8.16.1/Submit) id 12CC0SLD070042; Fri, 12 Mar 2021 14:00:28 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Fri, 12 Mar 2021 14:00:28 +0200 From: Konstantin Belousov To: Hans Petter Selasky Cc: John Baldwin , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: d1cbe7908986 - main - Allocating the LinuxKPI current structure from an interrupt thread must be done using the M_NOWAIT flag after 1ae20f7c70ea . Message-ID: References: <202103100952.12A9qRKR040117@gitrepo.freebsd.org> <2b1739ab-000c-ca28-5a59-0a3e19ef4591@selasky.org> <5aaa5f2a-a67d-a495-7f56-a6b31c2494c7@FreeBSD.org> <3dcd63b0-fe90-2855-f349-2117ca4b6b26@selasky.org> <8fe37b5e-29a7-ffeb-fddb-3b31a6e79ab0@selasky.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <8fe37b5e-29a7-ffeb-fddb-3b31a6e79ab0@selasky.org> X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on tom.home X-Rspamd-Queue-Id: 4Dxksf0tyJz3kp5 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, 12 Mar 2021 12:00:39 -0000 On Thu, Mar 11, 2021 at 08:20:05PM +0100, Hans Petter Selasky wrote: > On 3/11/21 8:04 PM, Konstantin Belousov wrote: > > On Thu, Mar 11, 2021 at 07:41:53PM +0100, Hans Petter Selasky wrote: > > > On 3/11/21 7:35 PM, Konstantin Belousov wrote: > > > > And I dislike this. It is yet another case of introducing consumer-specific > > > > logic into core. Isn't netepoch example enough? > > > > > > > > I presented another patch to Hans, where task and mm allocations are > > > > switched to zones, and the zones have reserve applied. Then allocations > > > > from ithreads use the reserve. > > > > > > > > There is one detail there, reserve is finite, for x86 I set it to the > > > > total limit of interrupts. This somewhat breaks if interrupts are > > > > deallocated and reallocated, but I think it is good enough even with > > > > this wart. > > > > > > Hi, > > > > > > Your patch doesn't address the issue of initializing the pointers in > > > question once. Still, for every call, we need to check if the pointer is > > > valid. This is not neccessary. > > I do not understand what you are saying there. > > Which pointers? How does it not address? > > Hi, > > The current code calls linux_set_current() for every interrupt and timer > callback. That means we continue to check td_lkpi_task for NULL for every > one of these calls. Not strictly needed. And how this would change? The linux_set_current() calls are spread all over the linuxkpi code, so - you cannot eliminate them for interrupt thread context - they are already there anyway. What is your point? > > > > > > > > > Also I don't see why we need to create a own UMA zone for these simple > > > structures. Won't the per-CPU sysctl consume more memory than the actual > > > task structures being allocated? > > Dedicated UMA zone allows to gracefully solve the requirement of non-failing > > allocation in non-sleepable context. This is much simpler and cleaner than > > either trying to enumerate all existing ithreads or adding consumer-specific > > controls into generic kernel facility. > > > > Maybe I'm new to UMA zones. The M_USE_RESERVE can also be used with malloc() > ? Yes M_USE_RESERVE can be used on zones without reserve (like malloc zones), but it would have a different meaning. On allocation failure due to low memory, for zones with reserve, it means: - first look at reserve, and if nothing left, you are allowed to consume the last free page in the system For zones without reserve, it just allows to utilize the last free page. In other words, if you have a reserve in zone, alloc requests are guaranteed to not fail regardless of the free memory. From owner-dev-commits-src-main@freebsd.org Fri Mar 12 12:15: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 AB763577470; Fri, 12 Mar 2021 12:15: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 4DxlBs4TbRz3lsc; Fri, 12 Mar 2021 12:15: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 88EA3179E3; Fri, 12 Mar 2021 12:15: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 12CCFX6Z031169; Fri, 12 Mar 2021 12:15:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 12CCFXXD031168; Fri, 12 Mar 2021 12:15:33 GMT (envelope-from git) Date: Fri, 12 Mar 2021 12:15:33 GMT Message-Id: <202103121215.12CCFXXD031168@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: b8f7267d499c - main - uma: allow uma_zfree_pcu(..., NULL) 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: b8f7267d499c8ef8e70b021879d3e9e087ecc32d 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, 12 Mar 2021 12:15:33 -0000 The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=b8f7267d499c8ef8e70b021879d3e9e087ecc32d commit b8f7267d499c8ef8e70b021879d3e9e087ecc32d Author: Kristof Provost AuthorDate: 2021-03-10 14:11:59 +0000 Commit: Kristof Provost CommitDate: 2021-03-12 11:12:35 +0000 uma: allow uma_zfree_pcu(..., NULL) We already allow free(NULL) and uma_zfree(..., NULL). Make uma_zfree_pcpu(..., NULL) work as well. This also means that counter_u64_free(NULL) will work. These make cleanup code simpler. MFC after: 1 week Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D29189 --- sys/vm/uma_core.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sys/vm/uma_core.c b/sys/vm/uma_core.c index 8cbd1216678a..b1762500c147 100644 --- a/sys/vm/uma_core.c +++ b/sys/vm/uma_core.c @@ -3171,6 +3171,11 @@ uma_zfree_pcpu_arg(uma_zone_t zone, void *pcpu_item, void *udata) #ifdef SMP MPASS(zone->uz_flags & UMA_ZONE_PCPU); #endif + + /* uma_zfree_pcu_*(..., NULL) does nothing, to match free(9). */ + if (pcpu_item == NULL) + return; + item = zpcpu_offset_to_base(pcpu_item); uma_zfree_arg(zone, item, udata); } From owner-dev-commits-src-main@freebsd.org Fri Mar 12 12:15: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 C86825779AC; Fri, 12 Mar 2021 12:15: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 4DxlBt5MV2z3lmC; Fri, 12 Mar 2021 12:15: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 AB073178CE; Fri, 12 Mar 2021 12:15: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 12CCFYkh031189; Fri, 12 Mar 2021 12:15:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 12CCFY0S031188; Fri, 12 Mar 2021 12:15:34 GMT (envelope-from git) Date: Fri, 12 Mar 2021 12:15:34 GMT Message-Id: <202103121215.12CCFY0S031188@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: 51dc8e7f6888 - main - Document that uma_zfree_pcpu() allows NULL now 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: 51dc8e7f688867e73eb7edc6bc65fdc77c9d5fff 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, 12 Mar 2021 12:15:34 -0000 The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=51dc8e7f688867e73eb7edc6bc65fdc77c9d5fff commit 51dc8e7f688867e73eb7edc6bc65fdc77c9d5fff Author: Kristof Provost AuthorDate: 2021-03-11 08:32:01 +0000 Commit: Kristof Provost CommitDate: 2021-03-12 11:12:35 +0000 Document that uma_zfree_pcpu() allows NULL now While here also document that for counter_u64_free(). Reviewed by: rpokala@ MFC after: 1 week Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D29215 --- share/man/man9/counter.9 | 7 +++++-- share/man/man9/zone.9 | 18 +++++++++++++++++- 2 files changed, 22 insertions(+), 3 deletions(-) diff --git a/share/man/man9/counter.9 b/share/man/man9/counter.9 index 1eb36b571249..04376ba9c994 100644 --- a/share/man/man9/counter.9 +++ b/share/man/man9/counter.9 @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 6, 2020 +.Dd March 11, 2021 .Dt COUNTER 9 .Os .Sh NAME @@ -98,10 +98,13 @@ or .Va M_WAITOK . If .Va M_NOWAIT -is specified the operation may fail. +is specified the operation may fail and return +.Dv NULL . .It Fn counter_u64_free c Free the previously allocated counter .Fa c . +It is safe to pass +.Dv NULL . .It Fn counter_u64_add c v Add .Fa v diff --git a/share/man/man9/zone.9 b/share/man/man9/zone.9 index 91c965ff69ce..7da40b13469b 100644 --- a/share/man/man9/zone.9 +++ b/share/man/man9/zone.9 @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 20, 2020 +.Dd March 11, 2021 .Dt UMA 9 .Os .Sh NAME @@ -385,6 +385,22 @@ specify an argument for the and .Dv dtor functions of the zone, respectively. +The variants +.Fn uma_zalloc_pcpu +and +.Fn uma_zfree_pcpu +allocate and free +.Va mp_ncpu +shadow copies as described for +.Dv UMA_ZONE_PCPU . +If +.Fa item +is +.Dv NULL , +then +.Fn uma_zfree_pcpu +does nothing. +.Pp The .Fn uma_zalloc_domain function allows callers to specify a fixed From owner-dev-commits-src-main@freebsd.org Fri Mar 12 12:15: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 1FCE05777D4; Fri, 12 Mar 2021 12:15: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 4DxlBw05n6z3lP1; Fri, 12 Mar 2021 12:15: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 D054817A4D; Fri, 12 Mar 2021 12:15: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 12CCFZrB031209; Fri, 12 Mar 2021 12:15:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 12CCFZYQ031208; Fri, 12 Mar 2021 12:15:35 GMT (envelope-from git) Date: Fri, 12 Mar 2021 12:15:35 GMT Message-Id: <202103121215.12CCFZYQ031208@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: 28dc2c954f50 - main - pf: Simplify cleanup 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: 28dc2c954f5096ae594ed5cd7a83d66ce4bf1ded 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, 12 Mar 2021 12:15:36 -0000 The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=28dc2c954f5096ae594ed5cd7a83d66ce4bf1ded commit 28dc2c954f5096ae594ed5cd7a83d66ce4bf1ded Author: Kristof Provost AuthorDate: 2021-03-10 14:15:16 +0000 Commit: Kristof Provost CommitDate: 2021-03-12 11:12:35 +0000 pf: Simplify cleanup We can now counter_u64_free(NULL), so remove the checks. MFC after: 1 week Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D29190 --- sys/netpfil/pf/if_pfsync.c | 6 ++---- sys/netpfil/pf/pf.c | 12 ++++-------- sys/netpfil/pf/pf_if.c | 6 ++---- 3 files changed, 8 insertions(+), 16 deletions(-) diff --git a/sys/netpfil/pf/if_pfsync.c b/sys/netpfil/pf/if_pfsync.c index 1cdb365c98df..059300f6a6a7 100644 --- a/sys/netpfil/pf/if_pfsync.c +++ b/sys/netpfil/pf/if_pfsync.c @@ -624,10 +624,8 @@ cleanup: cleanup_state: /* pf_state_insert() frees the state keys. */ if (st) { for (int i = 0; i < 2; i++) { - if (st->packets[i] != NULL) - counter_u64_free(st->packets[i]); - if (st->bytes[i] != NULL) - counter_u64_free(st->bytes[i]); + counter_u64_free(st->packets[i]); + counter_u64_free(st->bytes[i]); } if (st->dst.scrub) uma_zfree(V_pf_state_scrub_z, st->dst.scrub); diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index c131f810b0ec..f088f117b8e8 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -707,10 +707,8 @@ pf_free_src_node(struct pf_ksrc_node *sn) { for (int i = 0; i < 2; i++) { - if (sn->bytes[i]) - counter_u64_free(sn->bytes[i]); - if (sn->packets[i]) - counter_u64_free(sn->packets[i]); + counter_u64_free(sn->bytes[i]); + counter_u64_free(sn->packets[i]); } uma_zfree(V_pf_sources_z, sn); } @@ -1739,10 +1737,8 @@ pf_free_state(struct pf_state *cur) cur->timeout)); for (int i = 0; i < 2; i++) { - if (cur->bytes[i] != NULL) - counter_u64_free(cur->bytes[i]); - if (cur->packets[i] != NULL) - counter_u64_free(cur->packets[i]); + counter_u64_free(cur->bytes[i]); + counter_u64_free(cur->packets[i]); } pf_normalize_tcp_cleanup(cur); diff --git a/sys/netpfil/pf/pf_if.c b/sys/netpfil/pf/pf_if.c index e941e3a79b91..be290a1e1f2e 100644 --- a/sys/netpfil/pf/pf_if.c +++ b/sys/netpfil/pf/pf_if.c @@ -256,10 +256,8 @@ pf_kkif_free(struct pfi_kkif *kif) for (int i = 0; i < 2; i++) { for (int j = 0; j < 2; j++) { for (int k = 0; k < 2; k++) { - if (kif->pfik_packets[i][j][k]) - counter_u64_free(kif->pfik_packets[i][j][k]); - if (kif->pfik_bytes[i][j][k]) - counter_u64_free(kif->pfik_bytes[i][j][k]); + counter_u64_free(kif->pfik_packets[i][j][k]); + counter_u64_free(kif->pfik_bytes[i][j][k]); } } } From owner-dev-commits-src-main@freebsd.org Fri Mar 12 12:15: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 3A3FD5777D8; Fri, 12 Mar 2021 12:15: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 4DxlBx1rSRz3lPC; Fri, 12 Mar 2021 12:15:37 +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 048071791B; Fri, 12 Mar 2021 12:15: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 12CCFaIU031228; Fri, 12 Mar 2021 12:15:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 12CCFaAg031227; Fri, 12 Mar 2021 12:15:36 GMT (envelope-from git) Date: Fri, 12 Mar 2021 12:15:36 GMT Message-Id: <202103121215.12CCFaAg031227@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: cecfaf9bede9 - main - pf: Fully remove interrupt events on vnet cleanup 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: cecfaf9bede9665d6a10f1e575cd5d575450cff7 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, 12 Mar 2021 12:15:39 -0000 The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=cecfaf9bede9665d6a10f1e575cd5d575450cff7 commit cecfaf9bede9665d6a10f1e575cd5d575450cff7 Author: Kristof Provost AuthorDate: 2021-03-10 21:56:11 +0000 Commit: Kristof Provost CommitDate: 2021-03-12 11:12:43 +0000 pf: Fully remove interrupt events on vnet cleanup swi_remove() removes the software interrupt handler but does not remove the associated interrupt event. This is visible when creating and remove a vnet jail in `procstat -t 12`. We can remove it manually with intr_event_destroy(). PR: 254171 MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D29211 --- sys/net/pfvar.h | 2 ++ sys/netpfil/pf/if_pfsync.c | 10 ++++++++-- sys/netpfil/pf/pf.c | 1 + sys/netpfil/pf/pf_ioctl.c | 8 ++++++-- 4 files changed, 17 insertions(+), 4 deletions(-) diff --git a/sys/net/pfvar.h b/sys/net/pfvar.h index 31be6b7a833d..6102d6186cd2 100644 --- a/sys/net/pfvar.h +++ b/sys/net/pfvar.h @@ -1390,6 +1390,8 @@ VNET_DECLARE(struct pf_srchash *, pf_srchash); VNET_DECLARE(void *, pf_swi_cookie); #define V_pf_swi_cookie VNET(pf_swi_cookie) +VNET_DECLARE(struct intr_event *, pf_swi_ie); +#define V_pf_swi_ie VNET(pf_swi_ie) VNET_DECLARE(uint64_t, pf_stateid[MAXCPU]); #define V_pf_stateid VNET(pf_stateid) diff --git a/sys/netpfil/pf/if_pfsync.c b/sys/netpfil/pf/if_pfsync.c index 059300f6a6a7..cf2ff2ef0926 100644 --- a/sys/netpfil/pf/if_pfsync.c +++ b/sys/netpfil/pf/if_pfsync.c @@ -254,6 +254,8 @@ VNET_DEFINE_STATIC(struct pfsync_softc *, pfsyncif) = NULL; #define V_pfsyncif VNET(pfsyncif) VNET_DEFINE_STATIC(void *, pfsync_swi_cookie) = NULL; #define V_pfsync_swi_cookie VNET(pfsync_swi_cookie) +VNET_DEFINE_STATIC(struct intr_event *, pfsync_swi_ie); +#define V_pfsync_swi_ie VNET(pfsync_swi_ie) VNET_DEFINE_STATIC(struct pfsyncstats, pfsyncstats); #define V_pfsyncstats VNET(pfsyncstats) VNET_DEFINE_STATIC(int, pfsync_carp_adj) = CARP_MAXSKEW; @@ -2472,7 +2474,7 @@ vnet_pfsync_init(const void *unused __unused) V_pfsync_cloner = if_clone_simple(pfsyncname, pfsync_clone_create, pfsync_clone_destroy, 1); - error = swi_add(NULL, pfsyncname, pfsyncintr, V_pfsyncif, + error = swi_add(&V_pfsync_swi_ie, pfsyncname, pfsyncintr, V_pfsyncif, SWI_NET, INTR_MPSAFE, &V_pfsync_swi_cookie); if (error) { if_clone_detach(V_pfsync_cloner); @@ -2487,11 +2489,15 @@ VNET_SYSINIT(vnet_pfsync_init, SI_SUB_PROTO_FIREWALL, SI_ORDER_ANY, static void vnet_pfsync_uninit(const void *unused __unused) { + int ret; pfsync_pointers_uninit(); if_clone_detach(V_pfsync_cloner); - swi_remove(V_pfsync_swi_cookie); + ret = swi_remove(V_pfsync_swi_cookie); + MPASS(ret == 0); + ret = intr_event_destroy(V_pfsync_swi_ie); + MPASS(ret == 0); } VNET_SYSUNINIT(vnet_pfsync_uninit, SI_SUB_PROTO_FIREWALL, SI_ORDER_FOURTH, diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index f088f117b8e8..752e8a7eef1a 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -388,6 +388,7 @@ SYSCTL_ULONG(_net_pf, OID_AUTO, request_maxcount, CTLFLAG_RWTUN, &pf_ioctl_maxcount, 0, "Maximum number of tables, addresses, ... in a single ioctl() call"); VNET_DEFINE(void *, pf_swi_cookie); +VNET_DEFINE(struct intr_event *, pf_swi_ie); VNET_DEFINE(uint32_t, pf_hashseed); #define V_pf_hashseed VNET(pf_hashseed) diff --git a/sys/netpfil/pf/pf_ioctl.c b/sys/netpfil/pf/pf_ioctl.c index 977f0debacaa..c930a67ecf80 100644 --- a/sys/netpfil/pf/pf_ioctl.c +++ b/sys/netpfil/pf/pf_ioctl.c @@ -331,7 +331,7 @@ pfattach_vnet(void) for (int i = 0; i < SCNT_MAX; i++) V_pf_status.scounters[i] = counter_u64_alloc(M_WAITOK); - if (swi_add(NULL, "pf send", pf_intr, curvnet, SWI_NET, + if (swi_add(&V_pf_swi_ie, "pf send", pf_intr, curvnet, SWI_NET, INTR_MPSAFE, &V_pf_swi_cookie) != 0) /* XXXGL: leaked all above. */ return; @@ -4670,6 +4670,7 @@ pf_load(void) static void pf_unload_vnet(void) { + int ret; V_pf_vnet_active = 0; V_pf_status.running = 0; @@ -4679,7 +4680,10 @@ pf_unload_vnet(void) shutdown_pf(); PF_RULES_WUNLOCK(); - swi_remove(V_pf_swi_cookie); + ret = swi_remove(V_pf_swi_cookie); + MPASS(ret == 0); + ret = intr_event_destroy(V_pf_swi_ie); + MPASS(ret == 0); pf_unload_vnet_purge(); From owner-dev-commits-src-main@freebsd.org Fri Mar 12 13:15: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 54163578AD9; Fri, 12 Mar 2021 13:15:24 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (turbocat.net [88.99.82.50]) (using TLSv1.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 4DxmWw1Gq6z3psq; Fri, 12 Mar 2021 13:15:23 +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 78A95260783; Fri, 12 Mar 2021 14:15:21 +0100 (CET) Subject: Re: git: d1cbe7908986 - main - Allocating the LinuxKPI current structure from an interrupt thread must be done using the M_NOWAIT flag after 1ae20f7c70ea . To: Konstantin Belousov Cc: John Baldwin , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org References: <202103100952.12A9qRKR040117@gitrepo.freebsd.org> <2b1739ab-000c-ca28-5a59-0a3e19ef4591@selasky.org> <5aaa5f2a-a67d-a495-7f56-a6b31c2494c7@FreeBSD.org> <3dcd63b0-fe90-2855-f349-2117ca4b6b26@selasky.org> <8fe37b5e-29a7-ffeb-fddb-3b31a6e79ab0@selasky.org> From: Hans Petter Selasky Message-ID: Date: Fri, 12 Mar 2021 14:15:02 +0100 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:78.0) Gecko/20100101 Thunderbird/78.5.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4DxmWw1Gq6z3psq 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, 12 Mar 2021 13:15:24 -0000 Hi, On 3/12/21 1:00 PM, Konstantin Belousov wrote: > On Thu, Mar 11, 2021 at 08:20:05PM +0100, Hans Petter Selasky wrote: ... > And how this would change? The linux_set_current() calls are spread all > over the linuxkpi code, so > - you cannot eliminate them for interrupt thread context Regular interrupt threads typically don't use the "current" or "task structure" at all. > - they are already there anyway. For user-space, yes. > What is your point? I still believe an own UMA zone is overkill for the purpose of task_struct . We could just pre-allocate these structures into a linked list, and dequeue these for interrupt threads only. Every time a new interrupt is allocated we allocate one more of these structures beforehand, and then we use that structure back when the ITHREAD flags is set in the thread structure, similar to what you are doing, except we don't use UMA zones. >> >>> >>>> >>>> Also I don't see why we need to create a own UMA zone for these simple >>>> structures. Won't the per-CPU sysctl consume more memory than the actual >>>> task structures being allocated? >>> Dedicated UMA zone allows to gracefully solve the requirement of non-failing >>> allocation in non-sleepable context. This is much simpler and cleaner than >>> either trying to enumerate all existing ithreads or adding consumer-specific >>> controls into generic kernel facility. >>> >> >> Maybe I'm new to UMA zones. The M_USE_RESERVE can also be used with malloc() >> ? > Yes M_USE_RESERVE can be used on zones without reserve (like malloc zones), > but it would have a different meaning. On allocation failure due to low > memory, for zones with reserve, it means: > - first look at reserve, and if nothing left, you are allowed to consume > the last free page in the system > For zones without reserve, it just allows to utilize the last free page. > In other words, if you have a reserve in zone, alloc requests are guaranteed > to not fail regardless of the free memory. OK. --HPS From owner-dev-commits-src-main@freebsd.org Fri Mar 12 13:21: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 8B057579210; Fri, 12 Mar 2021 13:21:53 +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 4DxmgN5cxhz3qB5; Fri, 12 Mar 2021 13:21:52 +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)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 491CF2602EC; Fri, 12 Mar 2021 14:21:45 +0100 (CET) Subject: Re: git: d1cbe7908986 - main - Allocating the LinuxKPI current structure from an interrupt thread must be done using the M_NOWAIT flag after 1ae20f7c70ea . From: Hans Petter Selasky To: Konstantin Belousov Cc: John Baldwin , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org References: <202103100952.12A9qRKR040117@gitrepo.freebsd.org> <2b1739ab-000c-ca28-5a59-0a3e19ef4591@selasky.org> <5aaa5f2a-a67d-a495-7f56-a6b31c2494c7@FreeBSD.org> <3dcd63b0-fe90-2855-f349-2117ca4b6b26@selasky.org> <8fe37b5e-29a7-ffeb-fddb-3b31a6e79ab0@selasky.org> Message-ID: Date: Fri, 12 Mar 2021 14:21:27 +0100 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:78.0) Gecko/20100101 Thunderbird/78.5.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4DxmgN5cxhz3qB5 X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of hps@selasky.org designates 2a01:4f8:c17:6c4b::2 as permitted sender) smtp.mailfrom=hps@selasky.org X-Spamd-Result: default: False [-3.30 / 15.00]; RCVD_TLS_ALL(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+a:mail.turbocat.net]; NEURAL_HAM_LONG(-1.00)[-1.000]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[selasky.org]; ARC_NA(0.00)[]; RCPT_COUNT_FIVE(0.00)[5]; SPAMHAUS_ZRD(0.00)[2a01:4f8:c17:6c4b::2:from:127.0.2.255]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RBL_DBL_DONT_QUERY_IPS(0.00)[2a01:4f8:c17:6c4b::2:from]; NEURAL_HAM_SHORT(-1.00)[-1.000]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; FREEMAIL_TO(0.00)[gmail.com]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:24940, ipnet:2a01:4f8::/29, country:DE]; 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: Fri, 12 Mar 2021 13:21:53 -0000 On 3/12/21 2:15 PM, Hans Petter Selasky wrote: > We could just pre-allocate these structures into a linked list, and > dequeue these for interrupt threads only. Every time a new interrupt is > allocated we allocate one more of these structures beforehand, and then > we use that structure back when the ITHREAD flags is set in the thread > structure, similar to what you are doing, except we don't use UMA zones. Let's move the discussion over to the differential revision I've created so that we can agree on a solution. --HPS From owner-dev-commits-src-main@freebsd.org Fri Mar 12 15:34: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 29CFD57CA93; Fri, 12 Mar 2021 15:34: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 4Dxqcd0ktGz4S0r; Fri, 12 Mar 2021 15:34: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 0827E1A48E; Fri, 12 Mar 2021 15:34: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 12CFYec4093956; Fri, 12 Mar 2021 15:34:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 12CFYeiJ093955; Fri, 12 Mar 2021 15:34:40 GMT (envelope-from git) Date: Fri, 12 Mar 2021 15:34:40 GMT Message-Id: <202103121534.12CFYeiJ093955@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Edward Tomasz Napierala Subject: git: 0dfbdd9fc269 - main - linux(4): make getcwd(2) return ERANGE instead of ENOMEM MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: trasz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 0dfbdd9fc269f0438ffcc31632d35234a90584ad 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, 12 Mar 2021 15:34:41 -0000 The branch main has been updated by trasz: URL: https://cgit.FreeBSD.org/src/commit/?id=0dfbdd9fc269f0438ffcc31632d35234a90584ad commit 0dfbdd9fc269f0438ffcc31632d35234a90584ad Author: Edward Tomasz Napierala AuthorDate: 2021-03-12 15:31:37 +0000 Commit: Edward Tomasz Napierala CommitDate: 2021-03-12 15:31:45 +0000 linux(4): make getcwd(2) return ERANGE instead of ENOMEM For native FreeBSD binaries, the return value from __getcwd(2) doesn't really matter, as the libc wrapper takes over and returns the proper errno. PR: kern/254120 Reported By: Alex S Reviewed By: kib Sponsored By: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D29217 --- sys/compat/linux/linux_getcwd.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/compat/linux/linux_getcwd.c b/sys/compat/linux/linux_getcwd.c index c39e69c4e707..4917641be5e5 100644 --- a/sys/compat/linux/linux_getcwd.c +++ b/sys/compat/linux/linux_getcwd.c @@ -74,6 +74,8 @@ linux_getcwd(struct thread *td, struct linux_getcwd_args *uap) buf = malloc(buflen, M_TEMP, M_WAITOK); error = vn_getcwd(buf, &retbuf, &buflen); + if (error == ENOMEM) + error = ERANGE; if (error == 0) { error = copyout(retbuf, uap->buf, buflen); if (error == 0) From owner-dev-commits-src-main@freebsd.org Fri Mar 12 15:47: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 A6A5157CD2C; Fri, 12 Mar 2021 15:47: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 4Dxqvv4HVDz4SSM; Fri, 12 Mar 2021 15:47: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 81D051A4AF; Fri, 12 Mar 2021 15:47: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 12CFltwi007719; Fri, 12 Mar 2021 15:47:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 12CFltjp007718; Fri, 12 Mar 2021 15:47:55 GMT (envelope-from git) Date: Fri, 12 Mar 2021 15:47:55 GMT Message-Id: <202103121547.12CFltjp007718@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: 88e531f38c24 - main - autofs: best effort to maintain mounttab and mountdtab 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: 88e531f38c2412bf030f4e8dd563efc45b70797e 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, 12 Mar 2021 15:47:55 -0000 The branch main has been updated by rew: URL: https://cgit.FreeBSD.org/src/commit/?id=88e531f38c2412bf030f4e8dd563efc45b70797e commit 88e531f38c2412bf030f4e8dd563efc45b70797e Author: Robert Wing AuthorDate: 2021-02-17 07:51:38 +0000 Commit: Robert Wing CommitDate: 2021-03-12 15:41:55 +0000 autofs: best effort to maintain mounttab and mountdtab When an automounted filesystem is successfully unmounted, call rpc.umntall(8) with the -k flag. rpc.umntall(8) is used to clean up /var/db/mounttab on the client and /var/db/mountdtab on the server. This is only useful for NFSv3. PR: 251906 Reviewed by: trasz Differential Revision: https://reviews.freebsd.org/D27801 --- usr.sbin/autofs/automount.c | 2 ++ usr.sbin/autofs/autounmountd.c | 3 ++- usr.sbin/autofs/common.c | 13 +++++++++++++ usr.sbin/autofs/common.h | 1 + 4 files changed, 18 insertions(+), 1 deletion(-) diff --git a/usr.sbin/autofs/automount.c b/usr.sbin/autofs/automount.c index e28129eee5b8..cd29c910bce2 100644 --- a/usr.sbin/autofs/automount.c +++ b/usr.sbin/autofs/automount.c @@ -80,6 +80,8 @@ unmount_by_statfs(const struct statfs *sb, bool force) free(fsid_str); if (error != 0) log_warn("cannot unmount %s", sb->f_mntonname); + else + rpc_umntall(); return (error); } diff --git a/usr.sbin/autofs/autounmountd.c b/usr.sbin/autofs/autounmountd.c index 7a4f04c0b848..57375f04d743 100644 --- a/usr.sbin/autofs/autounmountd.c +++ b/usr.sbin/autofs/autounmountd.c @@ -170,7 +170,8 @@ unmount_by_fsid(const fsid_t fsid, const char *mountpoint) log_warn("cannot unmount %s (%s)", mountpoint, fsid_str); } - } + } else + rpc_umntall(); free(fsid_str); diff --git a/usr.sbin/autofs/common.c b/usr.sbin/autofs/common.c index 7c8df4205a86..4581e5c4f2f9 100644 --- a/usr.sbin/autofs/common.c +++ b/usr.sbin/autofs/common.c @@ -1204,6 +1204,19 @@ lesser_daemon(void) } } +/* + * Applicable to NFSv3 only, see rpc.umntall(8). + */ +void +rpc_umntall(void) +{ + FILE *f; + + f = auto_popen("rpc.umntall", "-k", NULL); + assert(f != NULL); + auto_pclose(f); +} + int main(int argc, char **argv) { diff --git a/usr.sbin/autofs/common.h b/usr.sbin/autofs/common.h index 34257c1caeff..e68a0be5f7c8 100644 --- a/usr.sbin/autofs/common.h +++ b/usr.sbin/autofs/common.h @@ -96,6 +96,7 @@ char *defined_expand(const char *string); void defined_init(void); void defined_parse_and_add(char *def); void lesser_daemon(void); +void rpc_umntall(void); int main_automount(int argc, char **argv); int main_automountd(int argc, char **argv); From owner-dev-commits-src-main@freebsd.org Fri Mar 12 16:46: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 4A49A57E0E3; Fri, 12 Mar 2021 16:46: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 4DxsCt1hfmz4WXt; Fri, 12 Mar 2021 16:46: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 1E5991AD50; Fri, 12 Mar 2021 16:46: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 12CGknUP086546; Fri, 12 Mar 2021 16:46:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 12CGknFp086545; Fri, 12 Mar 2021 16:46:49 GMT (envelope-from git) Date: Fri, 12 Mar 2021 16:46:49 GMT Message-Id: <202103121646.12CGknFp086545@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Brad Davis Subject: git: 81c6dfbf5608 - main - release: Move the vagrant.vmx config out to its own file to match vbox MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: brd X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 81c6dfbf5608caebb22ded98beb8527099c8d918 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, 12 Mar 2021 16:46:50 -0000 The branch main has been updated by brd: URL: https://cgit.FreeBSD.org/src/commit/?id=81c6dfbf5608caebb22ded98beb8527099c8d918 commit 81c6dfbf5608caebb22ded98beb8527099c8d918 Author: Brad Davis AuthorDate: 2021-01-26 17:02:57 +0000 Commit: Brad Davis CommitDate: 2021-03-12 16:44:42 +0000 release: Move the vagrant.vmx config out to its own file to match vbox Silly to have all these echos and makes this easier to use in other tooling. Reviewed by: gjb (re) --- release/Makefile.vagrant | 34 ++-------------------------------- release/scripts/vagrant.vmx | 31 +++++++++++++++++++++++++++++++ 2 files changed, 33 insertions(+), 32 deletions(-) diff --git a/release/Makefile.vagrant b/release/Makefile.vagrant index d49eedacb6c9..afbef8f2f3bf 100644 --- a/release/Makefile.vagrant +++ b/release/Makefile.vagrant @@ -101,37 +101,7 @@ vagrant-create-virtualbox-metadata: virtualbox/box.ovf virtualbox/box.ovf: ${.CURDIR}/scripts/box.ovf cp ${.ALLSRC} virtualbox/ -vmware/vagrant.vmx: - @(cd vmware && echo '.encoding = "UTF-8"' > vagrant.vmx) - @(cd vmware && echo 'bios.bootorder = "hdd,CDROM"' >> vagrant.vmx) - @(cd vmware && echo 'checkpoint.vmstate = ""' >> vagrant.vmx) - @(cd vmware && echo 'cleanshutdown = "TRUE"' >> vagrant.vmx) - @(cd vmware && echo 'config.version = "8"' >> vagrant.vmx) - @(cd vmware && echo 'displayname = "${VAGRANT_TARGET}"' >> vagrant.vmx) - @(cd vmware && echo 'ethernet0.addresstype = "generated"' >> vagrant.vmx) - @(cd vmware && echo 'ethernet0.bsdname = "en0"' >> vagrant.vmx) - @(cd vmware && echo 'ethernet0.connectiontype = "nat"' >> vagrant.vmx) - @(cd vmware && echo 'ethernet0.displayname = "Ethernet"' >> vagrant.vmx) - @(cd vmware && echo 'ethernet0.linkstatepropagation.enable = "FALSE"' >> vagrant.vmx) - @(cd vmware && echo 'ethernet0.pcislotnumber = "33"' >> vagrant.vmx) - @(cd vmware && echo 'ethernet0.present = "TRUE"' >> vagrant.vmx) - @(cd vmware && echo 'ethernet0.virtualdev = "e1000"' >> vagrant.vmx) - @(cd vmware && echo 'ethernet0.wakeonpcktrcv = "FALSE"' >> vagrant.vmx) - @(cd vmware && echo 'floppy0.present = "FALSE"' >> vagrant.vmx) - @(cd vmware && echo 'guestos = "freebsd-64"' >> vagrant.vmx) - @(cd vmware && echo 'gui.fullscreenatpoweron = "FALSE"' >> vagrant.vmx) - @(cd vmware && echo 'gui.viewmodeatpoweron = "windowed"' >> vagrant.vmx) - @(cd vmware && echo 'memsize = "512"' >> vagrant.vmx) - @(cd vmware && echo 'sound.startconnected = "FALSE"' >> vagrant.vmx) - @(cd vmware && echo 'softpoweroff = "TRUE"' >> vagrant.vmx) - @(cd vmware && echo 'scsi0.pcislotnumber = "16"' >> vagrant.vmx) - @(cd vmware && echo 'scsi0.present = "TRUE"' >> vagrant.vmx) - @(cd vmware && echo 'scsi0.virtualdev = "lsilogic"' >> vagrant.vmx) - @(cd vmware && echo 'scsi0:0.filename = "vagrant.vmdk"' >> vagrant.vmx) - @(cd vmware && echo 'scsi0:0.present = "TRUE"' >> vagrant.vmx) - @(cd vmware && echo 'tools.synctime = "TRUE"' >> vagrant.vmx) - @(cd vmware && echo 'usb.present = "FALSE"' >> vagrant.vmx) - @(cd vmware && echo 'virtualhw.productcompatibility = "hosted"' >> vagrant.vmx) - @(cd vmware && echo 'virtualhw.version = "9"' >> vagrant.vmx) +vmware/vagrant.vmx: ${.CURDIR}/scripts/vagrant.vmx + cp ${.ALLSRC} vmware/ vagrant-create-vmware-metadata: vmware/vagrant.vmx diff --git a/release/scripts/vagrant.vmx b/release/scripts/vagrant.vmx new file mode 100644 index 000000000000..3d4a77584832 --- /dev/null +++ b/release/scripts/vagrant.vmx @@ -0,0 +1,31 @@ +.encoding = "UTF-8" +bios.bootorder = "hdd,CDROM" +checkpoint.vmstate = "" +cleanshutdown = "TRUE" +config.version = "8" +displayname = "${VAGRANT_TARGET}" +ethernet0.addresstype = "generated" +ethernet0.bsdname = "en0" +ethernet0.connectiontype = "nat" +ethernet0.displayname = "Ethernet" +ethernet0.linkstatepropagation.enable = "FALSE" +ethernet0.pcislotnumber = "33" +ethernet0.present = "TRUE" +ethernet0.virtualdev = "e1000" +ethernet0.wakeonpcktrcv = "FALSE" +floppy0.present = "FALSE" +guestos = "freebsd-64" +gui.fullscreenatpoweron = "FALSE" +gui.viewmodeatpoweron = "windowed" +memsize = "512" +sound.startconnected = "FALSE" +softpoweroff = "TRUE" +scsi0.pcislotnumber = "16" +scsi0.present = "TRUE" +scsi0.virtualdev = "lsilogic" +scsi0:0.filename = "vagrant.vmdk" +scsi0:0.present = "TRUE" +tools.synctime = "TRUE" +usb.present = "FALSE" +virtualhw.productcompatibility = "hosted" +virtualhw.version = "9" From owner-dev-commits-src-main@freebsd.org Fri Mar 12 16:46: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 779D757E056; Fri, 12 Mar 2021 16:46: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 4DxsCv1lsqz4WXw; Fri, 12 Mar 2021 16:46: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 2F5041AD51; Fri, 12 Mar 2021 16:46: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 12CGkpDe086567; Fri, 12 Mar 2021 16:46:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 12CGkph0086566; Fri, 12 Mar 2021 16:46:51 GMT (envelope-from git) Date: Fri, 12 Mar 2021 16:46:51 GMT Message-Id: <202103121646.12CGkph0086566@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Brad Davis Subject: git: b8e12d2d5c76 - main - Improve the wording for showing the brightness level MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: brd X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b8e12d2d5c760dbe8058b5a5d8bfabdeff4dbe29 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, 12 Mar 2021 16:46:51 -0000 The branch main has been updated by brd: URL: https://cgit.FreeBSD.org/src/commit/?id=b8e12d2d5c760dbe8058b5a5d8bfabdeff4dbe29 commit b8e12d2d5c760dbe8058b5a5d8bfabdeff4dbe29 Author: Brad Davis AuthorDate: 2021-03-12 16:43:33 +0000 Commit: Brad Davis CommitDate: 2021-03-12 16:45:14 +0000 Improve the wording for showing the brightness level Reviewed by: allanjude --- usr.bin/backlight/backlight.8 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/usr.bin/backlight/backlight.8 b/usr.bin/backlight/backlight.8 index ce2d0e4b0325..adcfe159a9c1 100644 --- a/usr.bin/backlight/backlight.8 +++ b/usr.bin/backlight/backlight.8 @@ -47,8 +47,8 @@ The .Nm utility can be used to configure brightness levels for registered backlights. .Pp -If call without any option it will print the current brightness level of the first -registered backlight. +Called without any arguments it will print the current brightness level +of the first registered backlight. .Pp The options are as follows: .Bl -tag -width "-f device" From owner-dev-commits-src-main@freebsd.org Fri Mar 12 17:36: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 7B7C557F1F5; Fri, 12 Mar 2021 17:36: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 4DxtK136cKz4Zp6; Fri, 12 Mar 2021 17:36: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 534C21BB24; Fri, 12 Mar 2021 17:36: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 12CHaLsv052592; Fri, 12 Mar 2021 17:36:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 12CHaLwi052591; Fri, 12 Mar 2021 17:36:21 GMT (envelope-from git) Date: Fri, 12 Mar 2021 17:36:21 GMT Message-Id: <202103121736.12CHaLwi052591@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alex Richardson Subject: git: 34cc08e33698 - main - Save all fpcr/fpsr bits in the AArch64 fenv_t MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: arichardson X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 34cc08e336987a8ebc316595e3f552a4c09f1fd4 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, 12 Mar 2021 17:36:21 -0000 The branch main has been updated by arichardson: URL: https://cgit.FreeBSD.org/src/commit/?id=34cc08e336987a8ebc316595e3f552a4c09f1fd4 commit 34cc08e336987a8ebc316595e3f552a4c09f1fd4 Author: Alex Richardson AuthorDate: 2021-03-12 17:01:37 +0000 Commit: Alex Richardson CommitDate: 2021-03-12 17:01:41 +0000 Save all fpcr/fpsr bits in the AArch64 fenv_t The existing code masked off all bits that it didn't know about. To be future-proof, we should save and restore the entire fpcr/fpsr registers. Additionally, the existing fesetenv() was incorrectly setting the rounding mode in fpsr instead of fpcr. This patch stores fpcr in the high 32 bits of fenv_t and fpsr in the low bits instead of trying to interleave them in a single 32-bit field. Technically, this is an ABI break if you re-compile parts of your code or pass a fenv_t between DSOs that were compiled with different versions of fenv.h. However, I believe we should fix this since the existing code was broken and passing fenv_t across DSOs should rarely happen. Reviewed By: andrew Differential Revision: https://reviews.freebsd.org/D29160 --- lib/msun/aarch64/fenv.h | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/lib/msun/aarch64/fenv.h b/lib/msun/aarch64/fenv.h index 2bd29877e5dc..2a55db3a9545 100644 --- a/lib/msun/aarch64/fenv.h +++ b/lib/msun/aarch64/fenv.h @@ -35,6 +35,7 @@ #define __fenv_static static #endif +/* The high 32 bits contain fpcr, low 32 contain fpsr. */ typedef __uint64_t fenv_t; typedef __uint64_t fexcept_t; @@ -156,13 +157,12 @@ fesetround(int __round) __fenv_static inline int fegetenv(fenv_t *__envp) { - fenv_t __r; - - __mrs_fpcr(__r); - *__envp = __r & _ENABLE_MASK; + __uint64_t fpcr; + __uint64_t fpsr; - __mrs_fpsr(__r); - *__envp |= __r & (FE_ALL_EXCEPT | (_ROUND_MASK << _ROUND_SHIFT)); + __mrs_fpcr(fpcr); + __mrs_fpsr(fpsr); + *__envp = fpsr | (fpcr << 32); return (0); } @@ -173,12 +173,12 @@ feholdexcept(fenv_t *__envp) fenv_t __r; __mrs_fpcr(__r); - *__envp = __r & _ENABLE_MASK; + *__envp = __r << 32; __r &= ~(_ENABLE_MASK); __msr_fpcr(__r); __mrs_fpsr(__r); - *__envp |= __r & (FE_ALL_EXCEPT | (_ROUND_MASK << _ROUND_SHIFT)); + *__envp |= (__uint32_t)__r; __r &= ~(_ENABLE_MASK); __msr_fpsr(__r); return (0); @@ -188,8 +188,8 @@ __fenv_static inline int fesetenv(const fenv_t *__envp) { - __msr_fpcr((*__envp) & _ENABLE_MASK); - __msr_fpsr((*__envp) & (FE_ALL_EXCEPT | (_ROUND_MASK << _ROUND_SHIFT))); + __msr_fpcr((*__envp) >> 32); + __msr_fpsr((fenv_t)(__uint32_t)*__envp); return (0); } From owner-dev-commits-src-main@freebsd.org Fri Mar 12 17:36: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 AAD6C57F2A5; Fri, 12 Mar 2021 17:36: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 4DxtK23p5cz4ZcC; Fri, 12 Mar 2021 17:36: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 73C561BCF8; Fri, 12 Mar 2021 17:36: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 12CHaMUV052614; Fri, 12 Mar 2021 17:36:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 12CHaMNh052613; Fri, 12 Mar 2021 17:36:22 GMT (envelope-from git) Date: Fri, 12 Mar 2021 17:36:22 GMT Message-Id: <202103121736.12CHaMNh052613@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alex Richardson Subject: git: 8cf5812af4b7 - main - capsicum-test: Update for O_BENEATH removal MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: arichardson X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 8cf5812af4b7f4933983822ff8e1e9185818fbef 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, 12 Mar 2021 17:36:22 -0000 The branch main has been updated by arichardson: URL: https://cgit.FreeBSD.org/src/commit/?id=8cf5812af4b7f4933983822ff8e1e9185818fbef commit 8cf5812af4b7f4933983822ff8e1e9185818fbef Author: Alex Richardson AuthorDate: 2021-03-12 17:12:10 +0000 Commit: Alex Richardson CommitDate: 2021-03-12 17:12:10 +0000 capsicum-test: Update for O_BENEATH removal Update the tests to check O_RESOLVE_BENEATH instead. If this looks reasonable, I'll try to upstream this change. This keeps a compat fallback for O_BENEATH since the Linux port still has/had O_BENEATH with "no .., no absolute paths" semantics. Test Plan: `/usr/tests/sys/capsicum/capsicum-test -u 977` passes and runs the O_RESOLVE_BENEATH tests. Reviewed By: markj Differential Revision: https://reviews.freebsd.org/D29016 --- contrib/capsicum-test/openat.cc | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/contrib/capsicum-test/openat.cc b/contrib/capsicum-test/openat.cc index 5447558cde89..e3f0c2a731f8 100644 --- a/contrib/capsicum-test/openat.cc +++ b/contrib/capsicum-test/openat.cc @@ -341,22 +341,26 @@ FORK_TEST_F(OpenatTest, InCapabilityMode) { EXPECT_OPENAT_FAIL_TRAVERSAL(sub_fd_, "/etc/passwd", O_RDONLY); } -#ifdef O_BENEATH +#if !defined(O_RESOLVE_BENEATH) && defined(O_BENEATH) +#define O_RESOLVE_BENEATH O_BENEATH +#endif + +#ifdef O_RESOLVE_BENEATH TEST_F(OpenatTest, WithFlag) { - CheckPolicing(O_BENEATH); + CheckPolicing(O_RESOLVE_BENEATH); // Check with AT_FDCWD. - EXPECT_OPEN_OK(openat(AT_FDCWD, "topfile", O_RDONLY|O_BENEATH)); - EXPECT_OPEN_OK(openat(AT_FDCWD, "subdir/bottomfile", O_RDONLY|O_BENEATH)); + EXPECT_OPEN_OK(openat(AT_FDCWD, "topfile", O_RDONLY|O_RESOLVE_BENEATH)); + EXPECT_OPEN_OK(openat(AT_FDCWD, "subdir/bottomfile", O_RDONLY|O_RESOLVE_BENEATH)); - // Can't open paths starting with "/" with O_BENEATH specified. - EXPECT_OPENAT_FAIL_TRAVERSAL(AT_FDCWD, "/etc/passwd", O_RDONLY|O_BENEATH); - EXPECT_OPENAT_FAIL_TRAVERSAL(dir_fd_, "/etc/passwd", O_RDONLY|O_BENEATH); - EXPECT_OPENAT_FAIL_TRAVERSAL(sub_fd_, "/etc/passwd", O_RDONLY|O_BENEATH); + // Can't open paths starting with "/" with O_RESOLVE_BENEATH specified. + EXPECT_OPENAT_FAIL_TRAVERSAL(AT_FDCWD, "/etc/passwd", O_RDONLY|O_RESOLVE_BENEATH); + EXPECT_OPENAT_FAIL_TRAVERSAL(dir_fd_, "/etc/passwd", O_RDONLY|O_RESOLVE_BENEATH); + EXPECT_OPENAT_FAIL_TRAVERSAL(sub_fd_, "/etc/passwd", O_RDONLY|O_RESOLVE_BENEATH); } FORK_TEST_F(OpenatTest, WithFlagInCapabilityMode) { EXPECT_OK(cap_enter()); // Enter capability mode - CheckPolicing(O_BENEATH); + CheckPolicing(O_RESOLVE_BENEATH); } #endif From owner-dev-commits-src-main@freebsd.org Fri Mar 12 17:36: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 E866157F040; Fri, 12 Mar 2021 17:36: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 4DxtK34xjRz4ZWY; Fri, 12 Mar 2021 17:36: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 97B351BD0B; Fri, 12 Mar 2021 17:36: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 12CHaNd6052633; Fri, 12 Mar 2021 17:36:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 12CHaNXr052632; Fri, 12 Mar 2021 17:36:23 GMT (envelope-from git) Date: Fri, 12 Mar 2021 17:36:23 GMT Message-Id: <202103121736.12CHaNXr052632@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alex Richardson Subject: git: fe525d3f9166 - main - Allow using sanitizers for ssp tests with out-of-tree compiler MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: arichardson X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: fe525d3f916602ddac3286641dab8f5e274daa44 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, 12 Mar 2021 17:36:24 -0000 The branch main has been updated by arichardson: URL: https://cgit.FreeBSD.org/src/commit/?id=fe525d3f916602ddac3286641dab8f5e274daa44 commit fe525d3f916602ddac3286641dab8f5e274daa44 Author: Alex Richardson AuthorDate: 2021-03-12 17:15:00 +0000 Commit: Alex Richardson CommitDate: 2021-03-12 17:15:33 +0000 Allow using sanitizers for ssp tests with out-of-tree compiler With an out-of-tree Clang, we can use the -resource-dir flag when linking to point it at the runtime libraries from the current SYSROOT. This moves the path to the clang-internal library directory to a separate .mk file that can be used by Makefiles that want to find the sanitizer libraries. I intend to re-use this .mk file for my upcoming changes that allow building the entire base system with ASAN/UBSAN/MSAN. Reviewed By: dim Differential Revision: https://reviews.freebsd.org/D28852 --- lib/libc/tests/ssp/Makefile | 27 ++++++++++++--------------- lib/libclang_rt/Makefile.inc | 12 ++---------- lib/libclang_rt/compiler-rt-vars.mk | 24 ++++++++++++++++++++++++ 3 files changed, 38 insertions(+), 25 deletions(-) diff --git a/lib/libc/tests/ssp/Makefile b/lib/libc/tests/ssp/Makefile index 655130ab309d..452c57246e39 100644 --- a/lib/libc/tests/ssp/Makefile +++ b/lib/libc/tests/ssp/Makefile @@ -6,9 +6,10 @@ MK_WERROR= no WARNS?= 2 CFLAGS.h_raw+= -fstack-protector-all -Wstack-protector -.if ${COMPILER_TYPE} == "clang" && ${CC} == "cc" -# Only use -fsanitize=bounds when using the in-tree compiler. Otherwise -# we may link to a sanitizer library targeted at a newer kernel/libc. +.if ${COMPILER_TYPE} == "clang" +# Only use -fsanitize=bounds when using clang. Otherwise we are not able to +# override the sanitizer runtime libraries to be the ones installed on the +# target system. CFLAGS.h_raw+= -fsanitize=bounds .elif ${COMPILER_TYPE} == "gcc" CFLAGS.h_raw+= --param ssp-buffer-size=1 @@ -25,24 +26,20 @@ PROGS+= h_getcwd PROGS+= h_memcpy PROGS+= h_memmove PROGS+= h_memset -# This testcase doesn't run properly when not compiled with -fsantize=bounds -# with clang, which is currently contingent on a compiler_rt update -# # XXX: the h_raw/h_read testcases don't cause a SIGABRT with in-tree gcc right # now on amd64 when it trips the stack bounds specified in t_ssp.sh . This # probably needs to be fixed as it's currently hardcoded. -# -# sanitizer is not tested or supported for ARM right now. sbruno -.if ${COMPILER_TYPE} == "clang" && ${CC} == "cc" && !defined(_SKIP_BUILD) && \ +.if ${COMPILER_TYPE} == "clang" && !defined(_SKIP_BUILD) && \ (!defined(_RECURSING_PROGS) || ${PROG} == "h_raw") -.if !defined(_CLANG_RESOURCE_DIR) -_CLANG_RESOURCE_DIR!= ${CC:N${CCACHE_BIN}} -print-resource-dir -.export _CLANG_RESOURCE_DIR -.endif -_libclang_rt_arch= ${MACHINE_ARCH:S/amd64/x86_64/:C/hf$//:S/mipsn32/mips64/} -_libclang_rt_ubsan= ${_CLANG_RESOURCE_DIR}/lib/freebsd/libclang_rt.ubsan_standalone-${_libclang_rt_arch}.a +.include "${SRCTOP}/lib/libclang_rt/compiler-rt-vars.mk" +_libclang_rt_ubsan= ${SYSROOT}${SANITIZER_LIBDIR}/libclang_rt.ubsan_standalone-${CRTARCH}.a .if exists(${_libclang_rt_ubsan}) PROGS+= h_raw +LDADD.h_raw+= ${SANITIZER_LDFLAGS} +.else +.if make(all) +.info "Could not find runtime library ${_libclang_rt_ubsan}, skipping h_raw" +.endif .endif .endif PROGS+= h_read diff --git a/lib/libclang_rt/Makefile.inc b/lib/libclang_rt/Makefile.inc index 01bfd72b5a7e..946d3f4c77a7 100644 --- a/lib/libclang_rt/Makefile.inc +++ b/lib/libclang_rt/Makefile.inc @@ -2,20 +2,12 @@ .include -# armv[67] is a bit special since we allow a soft-floating version via -# CPUTYPE matching *soft*. This variant may not actually work though. -.if ${MACHINE_ARCH:Marmv[67]*} != "" && \ - (!defined(CPUTYPE) || ${CPUTYPE:M*soft*} == "") -CRTARCH?= armhf -.else -CRTARCH?= ${MACHINE_ARCH:C/amd64/x86_64/} -.endif CRTSRC= ${SRCTOP}/contrib/llvm-project/compiler-rt +.include "compiler-rt-vars.mk" .PATH: ${CRTSRC}/lib -CLANGDIR= /usr/lib/clang/11.0.1 -LIBDIR= ${CLANGDIR}/lib/freebsd +LIBDIR= ${SANITIZER_LIBDIR} SHLIBDIR= ${LIBDIR} NO_PIC= diff --git a/lib/libclang_rt/compiler-rt-vars.mk b/lib/libclang_rt/compiler-rt-vars.mk new file mode 100644 index 000000000000..17424785c372 --- /dev/null +++ b/lib/libclang_rt/compiler-rt-vars.mk @@ -0,0 +1,24 @@ +CLANG_SUBDIR=clang/11.0.1 +CLANGDIR= /usr/lib/${CLANG_SUBDIR} +SANITIZER_LIBDIR= ${CLANGDIR}/lib/freebsd + +# armv[67] is a bit special since we allow a soft-floating version via +# CPUTYPE matching *soft*. This variant may not actually work though. +.if ${MACHINE_ARCH:Marmv[67]*} != "" && \ + (!defined(CPUTYPE) || ${CPUTYPE:M*soft*} == "") +CRTARCH?= armhf +.else +CRTARCH?= ${MACHINE_ARCH:S/amd64/x86_64/:C/hf$//:S/mipsn32/mips64/} +.endif + +.if ${COMPILER_TYPE} == "clang" +# The only way to set the path to the sanitizer libraries with clang is to +# override the resource directory. +# Note: lib/freebsd is automatically appended to the -resource-dir value. +SANITIZER_LDFLAGS= -resource-dir=${SYSROOT}${CLANGDIR} +# Also set RPATH to ensure that the dynamically linked runtime libs are found. +SANITIZER_LDFLAGS+= -Wl,--enable-new-dtags +SANITIZER_LDFLAGS+= -Wl,-rpath,${SANITIZER_LIBDIR} +.else +.error "Unknown link flags for -fsanitize=... COMPILER_TYPE=${COMPILER_TYPE}" +.endif From owner-dev-commits-src-main@freebsd.org Fri Mar 12 17:36: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 43A2457F400; Fri, 12 Mar 2021 17:36: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 4DxtK769S7z4Zw3; Fri, 12 Mar 2021 17:36: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 D97861BD0C; Fri, 12 Mar 2021 17:36: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 12CHaOFX052655; Fri, 12 Mar 2021 17:36:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 12CHaOkI052654; Fri, 12 Mar 2021 17:36:24 GMT (envelope-from git) Date: Fri, 12 Mar 2021 17:36:24 GMT Message-Id: <202103121736.12CHaOkI052654@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alex Richardson Subject: git: 65f4ff4e68af - main - tests/sys/netgraph/ng_macfilter_test: Fix invalid TAP output MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: arichardson X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 65f4ff4e68afc3867781dfc8cd4faf2a8be1c74f 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, 12 Mar 2021 17:36:31 -0000 The branch main has been updated by arichardson: URL: https://cgit.FreeBSD.org/src/commit/?id=65f4ff4e68afc3867781dfc8cd4faf2a8be1c74f commit 65f4ff4e68afc3867781dfc8cd4faf2a8be1c74f Author: Alex Richardson AuthorDate: 2021-03-12 17:35:24 +0000 Commit: Alex Richardson CommitDate: 2021-03-12 17:35:26 +0000 tests/sys/netgraph/ng_macfilter_test: Fix invalid TAP output This should allow the test to pass in Jenkins. Testing it locally now reports "passed" instead of "invalid TAP data". While touching this file also fix some shellcheck warnings that were pointed out by my IDE. Reviewed By: lwhsu, afedorov Differential Revision: https://reviews.freebsd.org/D29054 --- tests/sys/netgraph/ng_macfilter_test.sh | 46 ++++++++++++++++----------------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/tests/sys/netgraph/ng_macfilter_test.sh b/tests/sys/netgraph/ng_macfilter_test.sh index 56e201094bcc..269de3e130aa 100755 --- a/tests/sys/netgraph/ng_macfilter_test.sh +++ b/tests/sys/netgraph/ng_macfilter_test.sh @@ -45,7 +45,7 @@ find_iface () { loaded_modules='' load_modules () { - for kmod in $*; do + for kmod in "$@"; do if ! kldstat -q -m $kmod; then test_comment "Loading $kmod..." kldload $kmod @@ -96,16 +96,16 @@ TSTNR=0 TSTFAILS=0 TSTSUCCS=0 -_test_next () { TSTNR=$(($TSTNR + 1)); } -_test_succ () { TSTSUCCS=$(($TSTSUCCS + 1)); } -_test_fail () { TSTFAILS=$(($TSTFAILS + 1)); } +_test_next () { TSTNR=$((TSTNR + 1)); } +_test_succ () { TSTSUCCS=$((TSTSUCCS + 1)); } +_test_fail () { TSTFAILS=$((TSTFAILS + 1)); } test_cnt () { echo "1..${1:-$TSTNR}"; } test_title () { local msg="$1" printf '### %s ' "$msg" - printf '#%.0s' `seq $((80 - ${#msg} - 5))` + printf '#%.0s' $(seq $((80 - ${#msg} - 5))) printf "\n" } test_comment () { echo "# $1"; } @@ -229,7 +229,8 @@ trap 'cleanup' EXIT created_hooks=$(gethooks) rc=0 -test_cnt +# Update this number when adding new tests +test_cnt 46 ################################################################################ @@ -244,12 +245,12 @@ test_failure "duplicate connect of default hook" ################################################################################ test_title "Test: Add and remove hooks" -ngctl connect MF: O2M: xxx1 many$(($HOOKS + 1)) -test_success "connect MF:xxx1 to O2M:many$(($HOOKS + 1))" -ngctl connect MF: O2M: xxx2 many$(($HOOKS + 2)) -test_success "connect MF:xxx2 to O2M:many$(($HOOKS + 2))" -ngctl connect MF: O2M: xxx3 many$(($HOOKS + 3)) -test_success "connect MF:xxx3 to O2M:many$(($HOOKS + 3))" +ngctl connect MF: O2M: xxx1 many$((HOOKS + 1)) +test_success "connect MF:xxx1 to O2M:many$((HOOKS + 1))" +ngctl connect MF: O2M: xxx2 many$((HOOKS + 2)) +test_success "connect MF:xxx2 to O2M:many$((HOOKS + 2))" +ngctl connect MF: O2M: xxx3 many$((HOOKS + 3)) +test_success "connect MF:xxx3 to O2M:many$((HOOKS + 3))" hooks=$(gethooks) test_eq $created_hooks:xxx1:xxx2:xxx3 $hooks 'hooks after adding xxx1-3' @@ -273,7 +274,7 @@ test_title "Test: Add many hooks" added_hooks="" for i in $(seq 10 1 $HOOKSADD); do added_hooks="$added_hooks:xxx$i" - ngctl connect MF: O2M: xxx$i many$(($HOOKS + $i)) + ngctl connect MF: O2M: xxx$i many$((HOOKS + i)) done hooks=$(gethooks) test_eq $created_hooks$added_hooks $hooks 'hooks after adding many hooks' @@ -291,21 +292,21 @@ test_bail_on_fail test_title "Test: Adding many MACs..." I=1 for i in $(seq $ITERATIONS | sort -R); do - test_comment "Iteration $I/$iterations..." + test_comment "Iteration $I/$ITERATIONS..." for j in $(seq 0 1 $SUBITERATIONS); do test $i = 2 && edge='out2' || edge='out1' ether=$(genmac $j $i) ngctl msg MF: 'direct' "{ hookname=\"$edge\" ether=$ether }" done - I=$(($I + 1)) + I=$((I + 1)) done n=$(countmacs out1) -n2=$(( ( $ITERATIONS - 1 ) * ( $SUBITERATIONS + 1 ) )) +n2=$(( ( ITERATIONS - 1 ) * ( SUBITERATIONS + 1 ) )) test_eq $n $n2 'MACs in table for out1' n=$(countmacs out2) -n2=$(( 1 * ( $SUBITERATIONS + 1 ) )) +n2=$(( 1 * ( SUBITERATIONS + 1 ) )) test_eq $n $n2 'MACs in table for out2' n=$(countmacs out3) n2=0 @@ -324,10 +325,10 @@ for i in $(seq $ITERATIONS); do done n=$(countmacs out1) -n2=$(( ( $ITERATIONS - 1 ) * ( $SUBITERATIONS + 1 - 1 ) )) +n2=$(( ( ITERATIONS - 1 ) * ( SUBITERATIONS + 1 - 1 ) )) test_eq $n $n2 'MACs in table for out1' n=$(countmacs out2) -n2=$(( 1 * ( $SUBITERATIONS + 1 - 1 ) )) +n2=$(( 1 * ( SUBITERATIONS + 1 - 1 ) )) test_eq $n $n2 'MACs in table for out2' n=$(countmacs out3) n2=$ITERATIONS @@ -340,7 +341,7 @@ test_bail_on_fail test_title "Test: Removing all MACs one by one..." I=1 for i in $(seq $ITERATIONS | sort -R); do - test_comment "Iteration $I/$iterations..." + test_comment "Iteration $I/$ITERATIONS..." for j in $(seq 0 1 $SUBITERATIONS | sort -R); do edge="default" ether=$(genmac $j $i) @@ -360,7 +361,7 @@ test_bail_on_fail test_title "Test: Randomly adding MACs on random hooks..." rm -f $entries_lst for i in $(seq $ITERATIONS); do - test_comment "Iteration $i/$iterations..." + test_comment "Iteration $i/$ITERATIONS..." for j in $(seq 0 1 $SUBITERATIONS | sort -R); do edge=$(randomedge) ether=$(genmac $j $i) @@ -390,7 +391,7 @@ test_bail_on_fail test_title "Test: Randomly changing MAC assignments..." rm -f $entries2_lst for i in $(seq $ITERATIONS); do - test_comment "Iteration $i/$iterations..." + test_comment "Iteration $i/$ITERATIONS..." cat $entries_lst | while read ether edge; do edge2=$(randomedge) @@ -425,6 +426,5 @@ test_bail_on_fail ################################################################################ -test_cnt exit 0 From owner-dev-commits-src-main@freebsd.org Fri Mar 12 17:49: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 B828357F8C0; Fri, 12 Mar 2021 17:49: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 4Dxtc34rB6z4c4V; Fri, 12 Mar 2021 17:49: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 952081B96B; Fri, 12 Mar 2021 17:49: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 12CHnNYg066632; Fri, 12 Mar 2021 17:49:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 12CHnNeS066631; Fri, 12 Mar 2021 17:49:23 GMT (envelope-from git) Date: Fri, 12 Mar 2021 17:49:23 GMT Message-Id: <202103121749.12CHnNeS066631@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: 92211458689b - main - amd64: Only update fsbase/gsbase in pcb for curthread. 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: 92211458689b448cda52a659f9d192fef5a9dd50 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, 12 Mar 2021 17:49:23 -0000 The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=92211458689b448cda52a659f9d192fef5a9dd50 commit 92211458689b448cda52a659f9d192fef5a9dd50 Author: John Baldwin AuthorDate: 2021-03-12 17:45:18 +0000 Commit: John Baldwin CommitDate: 2021-03-12 17:45:18 +0000 amd64: Only update fsbase/gsbase in pcb for curthread. Before the pcb is copied to the new thread during cpu_fork() and cpu_copy_thread(), the kernel re-reads the current register values in case they are stale. This is done by setting PCB_FULL_IRET in pcb_flags. This works fine for user threads, but the creation of kernel processes and kernel threads do not follow the normal synchronization rules for pcb_flags. Specifically, new kernel processes are always forked from thread0, not from curthread, so adjusting pcb_flags via a simple instruction without the LOCK prefix can race with thread0 running on another CPU. Similarly, kthread_add() clones from the first thread in the relevant kernel process, not from curthread. In practice, Netflix encountered a panic where the pcb_flags in the first kthread of the KTLS process were trashed due to update_pcb_bases() in cpu_copy_thread() running from thread0 to create one of the other KTLS threads racing with the first KTLS kthread calling fpu_kern_thread() on another CPU. In the panicking case, the write to update pcb_flags in fpu_kern_thread() was lost triggering an "Unregistered use of FPU in kernel" panic when the first KTLS kthread later tried to use the FPU. Reported by: gallatin Discussed with: kib MFC after: 1 week Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D29023 --- sys/amd64/amd64/vm_machdep.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sys/amd64/amd64/vm_machdep.c b/sys/amd64/amd64/vm_machdep.c index 1d9eacd8a8b8..76f7f400dd9c 100644 --- a/sys/amd64/amd64/vm_machdep.c +++ b/sys/amd64/amd64/vm_machdep.c @@ -166,7 +166,8 @@ cpu_fork(struct thread *td1, struct proc *p2, struct thread *td2, int flags) /* Ensure that td1's pcb is up to date. */ fpuexit(td1); - update_pcb_bases(td1->td_pcb); + if (td1 == curthread) + update_pcb_bases(td1->td_pcb); /* Point the stack and pcb to the actual location */ set_top_of_stack_td(td2); @@ -568,7 +569,8 @@ cpu_copy_thread(struct thread *td, struct thread *td0) * Those not loaded individually below get their default * values here. */ - update_pcb_bases(td0->td_pcb); + if (td0 == curthread) + update_pcb_bases(td0->td_pcb); bcopy(td0->td_pcb, pcb2, sizeof(*pcb2)); clear_pcb_flags(pcb2, PCB_FPUINITDONE | PCB_USERFPUINITDONE | PCB_KERNFPU); From owner-dev-commits-src-main@freebsd.org Fri Mar 12 17:49: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 C8BCD57F6D6; Fri, 12 Mar 2021 17:49: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 4Dxtc45Grjz4c4W; Fri, 12 Mar 2021 17:49: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 A867B1B96C; Fri, 12 Mar 2021 17:49: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 12CHnO2s066654; Fri, 12 Mar 2021 17:49:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 12CHnOXT066653; Fri, 12 Mar 2021 17:49:24 GMT (envelope-from git) Date: Fri, 12 Mar 2021 17:49:24 GMT Message-Id: <202103121749.12CHnOXT066653@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: 704547ce1ca5 - main - amd64: Cleanups to setting TLS registers for Linux binaries. 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: 704547ce1ca56e1123048cd152ed4e468d41d703 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, 12 Mar 2021 17:49:24 -0000 The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=704547ce1ca56e1123048cd152ed4e468d41d703 commit 704547ce1ca56e1123048cd152ed4e468d41d703 Author: John Baldwin AuthorDate: 2021-03-12 17:47:31 +0000 Commit: John Baldwin CommitDate: 2021-03-12 17:47:31 +0000 amd64: Cleanups to setting TLS registers for Linux binaries. - Use update_pcb_bases() when updating FS or GS base addresses to permit use of FSBASE and GSBASE in Linux processes. This also sets PCB_FULL_IRET. linux32 was setting PCB_32BIT which should be a no-op (exec sets it). - Remove write-only variables to construct unused segment descriptors for linux32. Reviewed by: kib MFC after: 1 week Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D29026 --- sys/amd64/linux/linux_machdep.c | 5 +++-- sys/amd64/linux32/linux32_machdep.c | 21 ++------------------- 2 files changed, 5 insertions(+), 21 deletions(-) diff --git a/sys/amd64/linux/linux_machdep.c b/sys/amd64/linux/linux_machdep.c index e44f5c320c39..01b730c2b19c 100644 --- a/sys/amd64/linux/linux_machdep.c +++ b/sys/amd64/linux/linux_machdep.c @@ -251,7 +251,7 @@ linux_arch_prctl(struct thread *td, struct linux_arch_prctl_args *args) switch (args->code) { case LINUX_ARCH_SET_GS: if (args->addr < VM_MAXUSER_ADDRESS) { - set_pcb_flags(pcb, PCB_FULL_IRET); + update_pcb_bases(pcb); pcb->pcb_gsbase = args->addr; td->td_frame->tf_gs = _ugssel; error = 0; @@ -260,7 +260,7 @@ linux_arch_prctl(struct thread *td, struct linux_arch_prctl_args *args) break; case LINUX_ARCH_SET_FS: if (args->addr < VM_MAXUSER_ADDRESS) { - set_pcb_flags(pcb, PCB_FULL_IRET); + update_pcb_bases(pcb); pcb->pcb_fsbase = args->addr; td->td_frame->tf_fs = _ufssel; error = 0; @@ -290,6 +290,7 @@ linux_set_cloned_tls(struct thread *td, void *desc) return (EPERM); pcb = td->td_pcb; + update_pcb_bases(pcb); pcb->pcb_fsbase = (register_t)desc; td->td_frame->tf_fs = _ufssel; diff --git a/sys/amd64/linux32/linux32_machdep.c b/sys/amd64/linux32/linux32_machdep.c index 1883b18eeb60..fde180d74d73 100644 --- a/sys/amd64/linux32/linux32_machdep.c +++ b/sys/amd64/linux32/linux32_machdep.c @@ -394,11 +394,9 @@ linux_old_select(struct thread *td, struct linux_old_select_args *args) int linux_set_cloned_tls(struct thread *td, void *desc) { - struct user_segment_descriptor sd; struct l_user_desc info; struct pcb *pcb; int error; - int a[2]; error = copyin(desc, &info, sizeof(struct l_user_desc)); if (error) { @@ -410,14 +408,10 @@ linux_set_cloned_tls(struct thread *td, void *desc) if (error) linux_msg(td, "set_cloned_tls copyout info failed!"); - a[0] = LINUX_LDT_entry_a(&info); - a[1] = LINUX_LDT_entry_b(&info); - - memcpy(&sd, &a, sizeof(a)); pcb = td->td_pcb; + update_pcb_bases(pcb); pcb->pcb_gsbase = (register_t)info.base_addr; td->td_frame->tf_gs = GSEL(GUGS32_SEL, SEL_UPL); - set_pcb_flags(pcb, PCB_32BIT); } return (error); @@ -668,9 +662,7 @@ linux_set_thread_area(struct thread *td, struct linux_set_thread_area_args *args) { struct l_user_desc info; - struct user_segment_descriptor sd; struct pcb *pcb; - int a[2]; int error; error = copyin(args->desc, &info, sizeof(struct l_user_desc)); @@ -721,18 +713,9 @@ linux_set_thread_area(struct thread *td, if (error) return (error); - if (LINUX_LDT_empty(&info)) { - a[0] = 0; - a[1] = 0; - } else { - a[0] = LINUX_LDT_entry_a(&info); - a[1] = LINUX_LDT_entry_b(&info); - } - - memcpy(&sd, &a, sizeof(a)); pcb = td->td_pcb; + update_pcb_bases(pcb); pcb->pcb_gsbase = (register_t)info.base_addr; - set_pcb_flags(pcb, PCB_32BIT); update_gdt_gsbase(td, info.base_addr); return (0); From owner-dev-commits-src-main@freebsd.org Fri Mar 12 17:49: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 6BD0D57FA2E; Fri, 12 Mar 2021 17:49: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 4Dxtc572Sgz4c9L; Fri, 12 Mar 2021 17:49: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 C44C71B96D; Fri, 12 Mar 2021 17:49: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 12CHnPaT066673; Fri, 12 Mar 2021 17:49:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 12CHnPuc066672; Fri, 12 Mar 2021 17:49:25 GMT (envelope-from git) Date: Fri, 12 Mar 2021 17:49:25 GMT Message-Id: <202103121749.12CHnPuc066672@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: 755efb8d8fca - main - x86: Copy the FPU/XSAVE state from the creating thread to new threads. 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: 755efb8d8fcacc6607bc46469750d78497f89378 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, 12 Mar 2021 17:49:26 -0000 The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=755efb8d8fcacc6607bc46469750d78497f89378 commit 755efb8d8fcacc6607bc46469750d78497f89378 Author: John Baldwin AuthorDate: 2021-03-12 17:47:41 +0000 Commit: John Baldwin CommitDate: 2021-03-12 17:47:41 +0000 x86: Copy the FPU/XSAVE state from the creating thread to new threads. POSIX states that new threads created via pthread_create() should inherit the "floating point environment" from the creating thread. Discussed with: kib MFC after: 1 week Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D29204 --- sys/amd64/amd64/vm_machdep.c | 10 ++++++---- sys/i386/i386/vm_machdep.c | 12 +++++++++--- 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/sys/amd64/amd64/vm_machdep.c b/sys/amd64/amd64/vm_machdep.c index 76f7f400dd9c..f10d0339a65a 100644 --- a/sys/amd64/amd64/vm_machdep.c +++ b/sys/amd64/amd64/vm_machdep.c @@ -564,16 +564,18 @@ cpu_copy_thread(struct thread *td, struct thread *td0) pcb2 = td->td_pcb; + /* Ensure that td0's pcb is up to date. */ + fpuexit(td0); + if (td0 == curthread) + update_pcb_bases(td0->td_pcb); + /* * Copy the upcall pcb. This loads kernel regs. * Those not loaded individually below get their default * values here. */ - if (td0 == curthread) - update_pcb_bases(td0->td_pcb); bcopy(td0->td_pcb, pcb2, sizeof(*pcb2)); - clear_pcb_flags(pcb2, PCB_FPUINITDONE | PCB_USERFPUINITDONE | - PCB_KERNFPU); + clear_pcb_flags(pcb2, PCB_KERNFPU); pcb2->pcb_save = get_pcb_user_save_pcb(pcb2); bcopy(get_pcb_user_save_td(td0), pcb2->pcb_save, cpu_max_ext_state_size); diff --git a/sys/i386/i386/vm_machdep.c b/sys/i386/i386/vm_machdep.c index d3182cb224bf..502de6e7f38f 100644 --- a/sys/i386/i386/vm_machdep.c +++ b/sys/i386/i386/vm_machdep.c @@ -428,14 +428,21 @@ cpu_copy_thread(struct thread *td, struct thread *td0) /* Point the pcb to the top of the stack. */ pcb2 = td->td_pcb; + /* Ensure that td0's pcb is up to date. */ + if (td0 == curthread) + td0->td_pcb->pcb_gs = rgs(); + critical_enter(); + if (PCPU_GET(fpcurthread) == td0) + npxsave(td0->td_pcb->pcb_save); + critical_exit(); + /* * Copy the upcall pcb. This loads kernel regs. * Those not loaded individually below get their default * values here. */ bcopy(td0->td_pcb, pcb2, sizeof(*pcb2)); - pcb2->pcb_flags &= ~(PCB_NPXINITDONE | PCB_NPXUSERINITDONE | - PCB_KERNNPX); + pcb2->pcb_flags &= ~PCB_KERNNPX; pcb2->pcb_save = get_pcb_user_save_pcb(pcb2); bcopy(get_pcb_user_save_td(td0), pcb2->pcb_save, cpu_max_ext_state_size); @@ -463,7 +470,6 @@ cpu_copy_thread(struct thread *td, struct thread *td0) pcb2->pcb_esp = (int)td->td_frame - sizeof(void *); /* trampoline arg */ pcb2->pcb_ebx = (int)td; /* trampoline arg */ pcb2->pcb_eip = (int)fork_trampoline + setidt_disp; - pcb2->pcb_gs = rgs(); /* * If we didn't copy the pcb, we'd need to do the following registers: * pcb2->pcb_cr3: cloned above. From owner-dev-commits-src-main@freebsd.org Fri Mar 12 17:49: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 E81AE57F8D3; Fri, 12 Mar 2021 17:49: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 4Dxtc947pVz4c2h; Fri, 12 Mar 2021 17:49: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 4425D1BB5D; Fri, 12 Mar 2021 17:49: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 12CHnTdR066736; Fri, 12 Mar 2021 17:49:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 12CHnTJF066734; Fri, 12 Mar 2021 17:49:29 GMT (envelope-from git) Date: Fri, 12 Mar 2021 17:49:29 GMT Message-Id: <202103121749.12CHnTJF066734@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: 640d54045bdb - main - Set TDP_KTHREAD before calling cpu_fork() and cpu_copy_thread(). 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: 640d54045bdbf894ae3c75cd9818c29fc2f6e5e7 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, 12 Mar 2021 17:49:30 -0000 The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=640d54045bdbf894ae3c75cd9818c29fc2f6e5e7 commit 640d54045bdbf894ae3c75cd9818c29fc2f6e5e7 Author: John Baldwin AuthorDate: 2021-03-12 17:48:20 +0000 Commit: John Baldwin CommitDate: 2021-03-12 17:48:20 +0000 Set TDP_KTHREAD before calling cpu_fork() and cpu_copy_thread(). This permits these routines to use special logic for initializing MD kthread state. For the kproc case, this required moving the logic to set these flags from kproc_create() into do_fork(). Reviewed by: kib MFC after: 1 week Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D29207 --- sys/kern/kern_fork.c | 12 ++++++++++-- sys/kern/kern_kthread.c | 17 +++++------------ sys/sys/proc.h | 1 + 3 files changed, 16 insertions(+), 14 deletions(-) diff --git a/sys/kern/kern_fork.c b/sys/kern/kern_fork.c index 870ae494de5d..3da8205d8ab0 100644 --- a/sys/kern/kern_fork.c +++ b/sys/kern/kern_fork.c @@ -497,9 +497,12 @@ do_fork(struct thread *td, struct fork_req *fr, struct proc *p2, struct thread * } else { sigacts_copy(newsigacts, p1->p_sigacts); p2->p_sigacts = newsigacts; - if ((fr->fr_flags2 & FR2_DROPSIG_CAUGHT) != 0) { + if ((fr->fr_flags2 & (FR2_DROPSIG_CAUGHT | FR2_KPROC)) != 0) { mtx_lock(&p2->p_sigacts->ps_mtx); - sig_drop_caught(p2); + if ((fr->fr_flags2 & FR2_DROPSIG_CAUGHT) != 0) + sig_drop_caught(p2); + if ((fr->fr_flags2 & FR2_KPROC) != 0) + p2->p_sigacts->ps_flag |= PS_NOCLDWAIT; mtx_unlock(&p2->p_sigacts->ps_mtx); } } @@ -511,6 +514,11 @@ do_fork(struct thread *td, struct fork_req *fr, struct proc *p2, struct thread * else p2->p_sigparent = SIGCHLD; + if ((fr->fr_flags2 & FR2_KPROC) != 0) { + p2->p_flag |= P_SYSTEM | P_KPROC; + td2->td_pflags |= TDP_KTHREAD; + } + p2->p_textvp = p1->p_textvp; p2->p_fd = fd; p2->p_fdtol = fdtol; diff --git a/sys/kern/kern_kthread.c b/sys/kern/kern_kthread.c index d049a099847c..32832bde2f53 100644 --- a/sys/kern/kern_kthread.c +++ b/sys/kern/kern_kthread.c @@ -95,6 +95,7 @@ kproc_create(void (*func)(void *), void *arg, bzero(&fr, sizeof(fr)); fr.fr_flags = RFMEM | RFFDG | RFPROC | RFSTOPPED | flags; + fr.fr_flags2 = FR2_KPROC; fr.fr_pages = pages; fr.fr_procp = &p2; error = fork1(&thread0, &fr); @@ -105,21 +106,11 @@ kproc_create(void (*func)(void *), void *arg, if (newpp != NULL) *newpp = p2; - /* this is a non-swapped system process */ - PROC_LOCK(p2); - td = FIRST_THREAD_IN_PROC(p2); - p2->p_flag |= P_SYSTEM | P_KPROC; - td->td_pflags |= TDP_KTHREAD; - mtx_lock(&p2->p_sigacts->ps_mtx); - p2->p_sigacts->ps_flag |= PS_NOCLDWAIT; - mtx_unlock(&p2->p_sigacts->ps_mtx); - PROC_UNLOCK(p2); - /* set up arg0 for 'ps', et al */ va_start(ap, fmt); vsnprintf(p2->p_comm, sizeof(p2->p_comm), fmt, ap); va_end(ap); - /* set up arg0 for 'ps', et al */ + td = FIRST_THREAD_IN_PROC(p2); va_start(ap, fmt); vsnprintf(td->td_name, sizeof(td->td_name), fmt, ap); va_end(ap); @@ -295,12 +286,14 @@ kthread_add(void (*func)(void *), void *arg, struct proc *p, TSTHREAD(newtd, newtd->td_name); newtd->td_proc = p; /* needed for cpu_copy_thread */ + newtd->td_pflags |= TDP_KTHREAD; + /* might be further optimized for kthread */ cpu_copy_thread(newtd, oldtd); + /* put the designated function(arg) as the resume context */ cpu_fork_kthread_handler(newtd, func, arg); - newtd->td_pflags |= TDP_KTHREAD; thread_cow_get_proc(newtd, p); /* this code almost the same as create_thread() in kern_thr.c */ diff --git a/sys/sys/proc.h b/sys/sys/proc.h index 0073fee2a42e..d51ad1093833 100644 --- a/sys/sys/proc.h +++ b/sys/sys/proc.h @@ -1055,6 +1055,7 @@ struct fork_req { int fr_flags2; #define FR2_DROPSIG_CAUGHT 0x00000001 /* Drop caught non-DFL signals */ #define FR2_SHARE_PATHS 0x00000002 /* Invert sense of RFFDG for paths */ +#define FR2_KPROC 0x00000004 /* Create a kernel process */ }; /* From owner-dev-commits-src-main@freebsd.org Fri Mar 12 17:49: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 E7FDA57F746; Fri, 12 Mar 2021 17:49: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 4Dxtc84sLYz4brD; Fri, 12 Mar 2021 17:49: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 1FC351BB5C; Fri, 12 Mar 2021 17:49: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 12CHnSex066717; Fri, 12 Mar 2021 17:49:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 12CHnRZd066716; Fri, 12 Mar 2021 17:49:27 GMT (envelope-from git) Date: Fri, 12 Mar 2021 17:49:27 GMT Message-Id: <202103121749.12CHnRZd066716@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: 5a50eb6585ef - main - Don't pass RFPROC to kproc_create(), it is redundant. 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: 5a50eb6585ef8d1a40c8086bab8639cc56f00df9 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, 12 Mar 2021 17:49:31 -0000 The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=5a50eb6585ef8d1a40c8086bab8639cc56f00df9 commit 5a50eb6585ef8d1a40c8086bab8639cc56f00df9 Author: John Baldwin AuthorDate: 2021-03-12 17:48:10 +0000 Commit: John Baldwin CommitDate: 2021-03-12 17:48:10 +0000 Don't pass RFPROC to kproc_create(), it is redundant. Reviewed by: tuexen, kib MFC after: 1 week Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D29206 --- sys/netinet/sctp_bsd_addr.c | 2 +- sys/netinet/sctp_pcb.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/netinet/sctp_bsd_addr.c b/sys/netinet/sctp_bsd_addr.c index aad84f71a678..2a00885d8ddd 100644 --- a/sys/netinet/sctp_bsd_addr.c +++ b/sys/netinet/sctp_bsd_addr.c @@ -108,7 +108,7 @@ sctp_startup_iterator(void) kproc_create(sctp_iterator_thread, (void *)NULL, &sctp_it_ctl.thread_proc, - RFPROC, + 0, SCTP_KTHREAD_PAGES, SCTP_KTRHEAD_NAME); } diff --git a/sys/netinet/sctp_pcb.c b/sys/netinet/sctp_pcb.c index 4d09ad3a7353..f4264ab387f1 100644 --- a/sys/netinet/sctp_pcb.c +++ b/sys/netinet/sctp_pcb.c @@ -5678,7 +5678,7 @@ sctp_startup_mcore_threads(void) (void)kproc_create(sctp_mcore_thread, (void *)&sctp_mcore_workers[cpu], &sctp_mcore_workers[cpu].thread_proc, - RFPROC, + 0, SCTP_KTHREAD_PAGES, SCTP_MCORE_NAME); } From owner-dev-commits-src-main@freebsd.org Fri Mar 12 17:49:28 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 3804457F9A5; Fri, 12 Mar 2021 17:49:28 +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 4Dxtc75bNBz4bxB; Fri, 12 Mar 2021 17:49: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 EDDD41BB5B; Fri, 12 Mar 2021 17:49: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 12CHnQAw066695; Fri, 12 Mar 2021 17:49:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 12CHnQlV066694; Fri, 12 Mar 2021 17:49:26 GMT (envelope-from git) Date: Fri, 12 Mar 2021 17:49:26 GMT Message-Id: <202103121749.12CHnQlV066694@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: 645b15e558dc - main - Remove unused wrappers around kproc_create() and kproc_exit(). 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: 645b15e558dc102ff70a6332b1d0b0aa733fd2bb 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, 12 Mar 2021 17:49:29 -0000 The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=645b15e558dc102ff70a6332b1d0b0aa733fd2bb commit 645b15e558dc102ff70a6332b1d0b0aa733fd2bb Author: John Baldwin AuthorDate: 2021-03-12 17:47:58 +0000 Commit: John Baldwin CommitDate: 2021-03-12 17:47:58 +0000 Remove unused wrappers around kproc_create() and kproc_exit(). Reviewed by: imp, kib MFC after: 1 week Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D29205 --- sys/dev/mpr/mprvar.h | 4 ---- sys/dev/mps/mpsvar.h | 4 ---- 2 files changed, 8 deletions(-) diff --git a/sys/dev/mpr/mprvar.h b/sys/dev/mpr/mprvar.h index ce755188d706..5abcdd5d4299 100644 --- a/sys/dev/mpr/mprvar.h +++ b/sys/dev/mpr/mprvar.h @@ -913,10 +913,6 @@ int mprsas_send_reset(struct mpr_softc *sc, struct mpr_command *tm, SYSCTL_DECL(_hw_mpr); /* Compatibility shims for different OS versions */ -#define mpr_kproc_create(func, farg, proc_ptr, flags, stackpgs, fmtstr, arg) \ - kproc_create(func, farg, proc_ptr, flags, stackpgs, fmtstr, arg) -#define mpr_kproc_exit(arg) kproc_exit(arg) - #if defined(CAM_PRIORITY_XPT) #define MPR_PRIORITY_XPT CAM_PRIORITY_XPT #else diff --git a/sys/dev/mps/mpsvar.h b/sys/dev/mps/mpsvar.h index 2029b570c01d..6e6c9fd28c2b 100644 --- a/sys/dev/mps/mpsvar.h +++ b/sys/dev/mps/mpsvar.h @@ -831,10 +831,6 @@ int mpssas_send_reset(struct mps_softc *sc, struct mps_command *tm, SYSCTL_DECL(_hw_mps); /* Compatibility shims for different OS versions */ -#define mps_kproc_create(func, farg, proc_ptr, flags, stackpgs, fmtstr, arg) \ - kproc_create(func, farg, proc_ptr, flags, stackpgs, fmtstr, arg) -#define mps_kproc_exit(arg) kproc_exit(arg) - #if defined(CAM_PRIORITY_XPT) #define MPS_PRIORITY_XPT CAM_PRIORITY_XPT #else From owner-dev-commits-src-main@freebsd.org Fri Mar 12 17:49: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 EB96157FA93; Fri, 12 Mar 2021 17:49: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 4DxtcD0k9hz4c7h; Fri, 12 Mar 2021 17:49: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 7EF5D1BE1C; Fri, 12 Mar 2021 17:49: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 12CHnVPZ066779; Fri, 12 Mar 2021 17:49:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 12CHnVFc066778; Fri, 12 Mar 2021 17:49:31 GMT (envelope-from git) Date: Fri, 12 Mar 2021 17:49:31 GMT Message-Id: <202103121749.12CHnVFc066778@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: 40d593d17eb6 - main - x86: Update some stale comments in cpu_fork() and cpu_copy_thread(). 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: 40d593d17eb6d70ea717d6546a16794858944176 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, 12 Mar 2021 17:49:33 -0000 The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=40d593d17eb6d70ea717d6546a16794858944176 commit 40d593d17eb6d70ea717d6546a16794858944176 Author: John Baldwin AuthorDate: 2021-03-12 17:48:49 +0000 Commit: John Baldwin CommitDate: 2021-03-12 17:48:49 +0000 x86: Update some stale comments in cpu_fork() and cpu_copy_thread(). Neither of these routines allocate stacks. Reviewed by: kib MFC after: 1 week Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D29227 --- sys/amd64/amd64/vm_machdep.c | 6 ++++-- sys/i386/i386/vm_machdep.c | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/sys/amd64/amd64/vm_machdep.c b/sys/amd64/amd64/vm_machdep.c index 6e60f2b3faff..a17ddd4ba6d8 100644 --- a/sys/amd64/amd64/vm_machdep.c +++ b/sys/amd64/amd64/vm_machdep.c @@ -198,7 +198,6 @@ cpu_fork(struct thread *td1, struct proc *p2, struct thread *td2, int flags) bcopy(&p1->p_md, mdp2, sizeof(*mdp2)); /* - * Create a new fresh stack for the new process. * Copy the trap frame for the return to user mode as if from a * syscall. This copies most of the user mode register values. */ @@ -606,7 +605,10 @@ cpu_copy_thread(struct thread *td, struct thread *td0) /* - * Create a new fresh stack for the new thread. + * Copy user general-purpose registers. + * + * Some of these registers are rewritten by cpu_set_upcall() + * and linux_set_upcall_kse(). */ bcopy(td0->td_frame, td->td_frame, sizeof(struct trapframe)); diff --git a/sys/i386/i386/vm_machdep.c b/sys/i386/i386/vm_machdep.c index 471128e1713d..5947ae5a6d15 100644 --- a/sys/i386/i386/vm_machdep.c +++ b/sys/i386/i386/vm_machdep.c @@ -205,7 +205,6 @@ cpu_fork(struct thread *td1, struct proc *p2, struct thread *td2, int flags) bcopy(&p1->p_md, mdp2, sizeof(*mdp2)); /* - * Create a new fresh stack for the new process. * Copy the trap frame for the return to user mode as if from a * syscall. This copies most of the user mode register values. * The -VM86_STACK_SPACE (-16) is so we can expand the trapframe @@ -473,7 +472,10 @@ cpu_copy_thread(struct thread *td, struct thread *td0) } /* - * Create a new fresh stack for the new thread. + * Copy user general-purpose registers. + * + * Some of these registers are rewritten by cpu_set_upcall() + * and linux_set_upcall_kse(). */ bcopy(td0->td_frame, td->td_frame, sizeof(struct trapframe)); From owner-dev-commits-src-main@freebsd.org Fri Mar 12 17:49: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 EB63657FA31; Fri, 12 Mar 2021 17:49: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 4DxtcB4XD3z4c7X; Fri, 12 Mar 2021 17:49: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 723D21BB5E; Fri, 12 Mar 2021 17:49: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 12CHnUwd066757; Fri, 12 Mar 2021 17:49:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 12CHnU0f066756; Fri, 12 Mar 2021 17:49:30 GMT (envelope-from git) Date: Fri, 12 Mar 2021 17:49:30 GMT Message-Id: <202103121749.12CHnU0f066756@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: c7b021352332 - main - x86: Always use clean FPU and segment base state for new kthreads. 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: c7b021352332a2f79907d68f971849f74b73e1c6 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, 12 Mar 2021 17:49:32 -0000 The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=c7b021352332a2f79907d68f971849f74b73e1c6 commit c7b021352332a2f79907d68f971849f74b73e1c6 Author: John Baldwin AuthorDate: 2021-03-12 17:48:36 +0000 Commit: John Baldwin CommitDate: 2021-03-12 17:48:36 +0000 x86: Always use clean FPU and segment base state for new kthreads. Reviewed by: kib MFC after: 1 week Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D29208 --- sys/amd64/amd64/vm_machdep.c | 46 +++++++++++++++++++++++++--------- sys/i386/i386/sys_machdep.c | 6 +++-- sys/i386/i386/vm_machdep.c | 59 +++++++++++++++++++++++++++++++------------- 3 files changed, 81 insertions(+), 30 deletions(-) diff --git a/sys/amd64/amd64/vm_machdep.c b/sys/amd64/amd64/vm_machdep.c index f10d0339a65a..6e60f2b3faff 100644 --- a/sys/amd64/amd64/vm_machdep.c +++ b/sys/amd64/amd64/vm_machdep.c @@ -164,10 +164,12 @@ cpu_fork(struct thread *td1, struct proc *p2, struct thread *td2, int flags) return; } - /* Ensure that td1's pcb is up to date. */ - fpuexit(td1); - if (td1 == curthread) + /* Ensure that td1's pcb is up to date for user processes. */ + if ((td2->td_pflags & TDP_KTHREAD) == 0) { + MPASS(td1 == curthread); + fpuexit(td1); update_pcb_bases(td1->td_pcb); + } /* Point the stack and pcb to the actual location */ set_top_of_stack_td(td2); @@ -178,8 +180,18 @@ cpu_fork(struct thread *td1, struct proc *p2, struct thread *td2, int flags) /* Properly initialize pcb_save */ pcb2->pcb_save = get_pcb_user_save_pcb(pcb2); - bcopy(get_pcb_user_save_td(td1), get_pcb_user_save_pcb(pcb2), - cpu_max_ext_state_size); + + /* Kernel processes start with clean FPU and segment bases. */ + if ((td2->td_pflags & TDP_KTHREAD) != 0) { + pcb2->pcb_fsbase = 0; + pcb2->pcb_gsbase = 0; + clear_pcb_flags(pcb2, PCB_FPUINITDONE | PCB_USERFPUINITDONE | + PCB_KERNFPU | PCB_KERNFPU_THR); + } else { + MPASS((pcb2->pcb_flags & (PCB_KERNFPU | PCB_KERNFPU_THR)) == 0); + bcopy(get_pcb_user_save_td(td1), get_pcb_user_save_pcb(pcb2), + cpu_max_ext_state_size); + } /* Point mdproc and then copy over td1's contents */ mdp2 = &p2->p_md; @@ -564,10 +576,12 @@ cpu_copy_thread(struct thread *td, struct thread *td0) pcb2 = td->td_pcb; - /* Ensure that td0's pcb is up to date. */ - fpuexit(td0); - if (td0 == curthread) + /* Ensure that td0's pcb is up to date for user threads. */ + if ((td->td_pflags & TDP_KTHREAD) == 0) { + MPASS(td0 == curthread); + fpuexit(td0); update_pcb_bases(td0->td_pcb); + } /* * Copy the upcall pcb. This loads kernel regs. @@ -575,12 +589,22 @@ cpu_copy_thread(struct thread *td, struct thread *td0) * values here. */ bcopy(td0->td_pcb, pcb2, sizeof(*pcb2)); - clear_pcb_flags(pcb2, PCB_KERNFPU); pcb2->pcb_save = get_pcb_user_save_pcb(pcb2); - bcopy(get_pcb_user_save_td(td0), pcb2->pcb_save, - cpu_max_ext_state_size); + + /* Kernel threads start with clean FPU and segment bases. */ + if ((td->td_pflags & TDP_KTHREAD) != 0) { + pcb2->pcb_fsbase = 0; + pcb2->pcb_gsbase = 0; + clear_pcb_flags(pcb2, PCB_FPUINITDONE | PCB_USERFPUINITDONE | + PCB_KERNFPU | PCB_KERNFPU_THR); + } else { + MPASS((pcb2->pcb_flags & (PCB_KERNFPU | PCB_KERNFPU_THR)) == 0); + bcopy(get_pcb_user_save_td(td0), pcb2->pcb_save, + cpu_max_ext_state_size); + } set_pcb_flags_raw(pcb2, PCB_FULL_IRET); + /* * Create a new fresh stack for the new thread. */ diff --git a/sys/i386/i386/sys_machdep.c b/sys/i386/i386/sys_machdep.c index 3f650b65e160..a0a1c273f467 100644 --- a/sys/i386/i386/sys_machdep.c +++ b/sys/i386/i386/sys_machdep.c @@ -108,7 +108,8 @@ set_fsbase(struct thread *td, uint32_t base) fill_based_sd(&sd, base); critical_enter(); td->td_pcb->pcb_fsd = sd; - PCPU_GET(fsgs_gdt)[0] = sd; + if (td == curthread) + PCPU_GET(fsgs_gdt)[0] = sd; critical_exit(); } @@ -120,7 +121,8 @@ set_gsbase(struct thread *td, uint32_t base) fill_based_sd(&sd, base); critical_enter(); td->td_pcb->pcb_gsd = sd; - PCPU_GET(fsgs_gdt)[1] = sd; + if (td == curthread) + PCPU_GET(fsgs_gdt)[1] = sd; critical_exit(); } diff --git a/sys/i386/i386/vm_machdep.c b/sys/i386/i386/vm_machdep.c index 502de6e7f38f..471128e1713d 100644 --- a/sys/i386/i386/vm_machdep.c +++ b/sys/i386/i386/vm_machdep.c @@ -167,13 +167,15 @@ cpu_fork(struct thread *td1, struct proc *p2, struct thread *td2, int flags) return; } - /* Ensure that td1's pcb is up to date. */ - if (td1 == curthread) + /* Ensure that td1's pcb is up to date for user processes. */ + if ((td2->td_pflags & TDP_KTHREAD) == 0) { + MPASS(td1 == curthread); td1->td_pcb->pcb_gs = rgs(); - critical_enter(); - if (PCPU_GET(fpcurthread) == td1) - npxsave(td1->td_pcb->pcb_save); - critical_exit(); + critical_enter(); + if (PCPU_GET(fpcurthread) == td1) + npxsave(td1->td_pcb->pcb_save); + critical_exit(); + } /* Point the pcb to the top of the stack */ pcb2 = get_pcb_td(td2); @@ -184,8 +186,19 @@ cpu_fork(struct thread *td1, struct proc *p2, struct thread *td2, int flags) /* Properly initialize pcb_save */ pcb2->pcb_save = get_pcb_user_save_pcb(pcb2); - bcopy(get_pcb_user_save_td(td1), get_pcb_user_save_pcb(pcb2), - cpu_max_ext_state_size); + + /* Kernel processes start with clean NPX and segment bases. */ + if ((td2->td_pflags & TDP_KTHREAD) != 0) { + pcb2->pcb_gs = _udatasel; + set_fsbase(td2, 0); + set_gsbase(td2, 0); + pcb2->pcb_flags &= ~(PCB_NPXINITDONE | PCB_NPXUSERINITDONE | + PCB_KERNNPX | PCB_KERNNPX_THR); + } else { + MPASS((pcb2->pcb_flags & (PCB_KERNNPX | PCB_KERNNPX_THR)) == 0); + bcopy(get_pcb_user_save_td(td1), get_pcb_user_save_pcb(pcb2), + cpu_max_ext_state_size); + } /* Point mdproc and then copy over td1's contents */ mdp2 = &p2->p_md; @@ -428,13 +441,15 @@ cpu_copy_thread(struct thread *td, struct thread *td0) /* Point the pcb to the top of the stack. */ pcb2 = td->td_pcb; - /* Ensure that td0's pcb is up to date. */ - if (td0 == curthread) + /* Ensure that td0's pcb is up to date for user threads. */ + if ((td->td_pflags & TDP_KTHREAD) == 0) { + MPASS(td0 == curthread); td0->td_pcb->pcb_gs = rgs(); - critical_enter(); - if (PCPU_GET(fpcurthread) == td0) - npxsave(td0->td_pcb->pcb_save); - critical_exit(); + critical_enter(); + if (PCPU_GET(fpcurthread) == td0) + npxsave(td0->td_pcb->pcb_save); + critical_exit(); + } /* * Copy the upcall pcb. This loads kernel regs. @@ -442,10 +457,20 @@ cpu_copy_thread(struct thread *td, struct thread *td0) * values here. */ bcopy(td0->td_pcb, pcb2, sizeof(*pcb2)); - pcb2->pcb_flags &= ~PCB_KERNNPX; pcb2->pcb_save = get_pcb_user_save_pcb(pcb2); - bcopy(get_pcb_user_save_td(td0), pcb2->pcb_save, - cpu_max_ext_state_size); + + /* Kernel threads start with clean NPX and segment bases. */ + if ((td->td_pflags & TDP_KTHREAD) != 0) { + pcb2->pcb_gs = _udatasel; + set_fsbase(td, 0); + set_gsbase(td, 0); + pcb2->pcb_flags &= ~(PCB_NPXINITDONE | PCB_NPXUSERINITDONE | + PCB_KERNNPX | PCB_KERNNPX_THR); + } else { + MPASS((pcb2->pcb_flags & (PCB_KERNNPX | PCB_KERNNPX_THR)) == 0); + bcopy(get_pcb_user_save_td(td0), pcb2->pcb_save, + cpu_max_ext_state_size); + } /* * Create a new fresh stack for the new thread. From owner-dev-commits-src-main@freebsd.org Fri Mar 12 18:14: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 BA4AF5A8B1F for ; Fri, 12 Mar 2021 18:14:10 +0000 (UTC) (envelope-from jamie@freebsd.org) Received: from gritton.org (gritton.org [199.192.165.131]) (using TLSv1.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 4Dxv8f4BkQz4fpY for ; Fri, 12 Mar 2021 18:14:10 +0000 (UTC) (envelope-from jamie@freebsd.org) Received: from gritton.org ([127.0.0.131]) (authenticated bits=0) by gritton.org (8.15.2/8.15.2) with ESMTPA id 12CIE2We068057; Fri, 12 Mar 2021 10:14:02 -0800 (PST) (envelope-from jamie@freebsd.org) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Date: Fri, 12 Mar 2021 10:14:02 -0800 From: James Gritton To: Harry Schmalzbauer Cc: dev-commits-src-main@freebsd.org Subject: Re: git: 6e1d1bfcac77 - main - jail: Improve locking when removing prisons In-Reply-To: <0e8ca80f-cf62-4707-7cbd-dc0bbef061ed@omnilan.de> References: <202102202242.11KMg79W017503@gitrepo.freebsd.org> <0e8ca80f-cf62-4707-7cbd-dc0bbef061ed@omnilan.de> User-Agent: Roundcube Webmail/1.4.1 Message-ID: <26d207055d570f45ba786c24855ac283@freebsd.org> X-Sender: jamie@freebsd.org X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.6.2 (gritton.org [127.0.0.131]); Fri, 12 Mar 2021 10:14:02 -0800 (PST) X-Rspamd-Queue-Id: 4Dxv8f4BkQz4fpY 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, 12 Mar 2021 18:14:10 -0000 On 2021-03-12 02:01, Harry Schmalzbauer wrote: > Am 20.02.2021 um 23:42 schrieb Jamie Gritton: >> The branch main has been updated by jamie: >> >> URL: >> https://cgit.FreeBSD.org/src/commit/?id=6e1d1bfcac77603541706807803a198c6d954d7c >> >> commit 6e1d1bfcac77603541706807803a198c6d954d7c >> Author: Jamie Gritton >> AuthorDate: 2021-02-20 22:38:58 +0000 >> Commit: Jamie Gritton >> CommitDate: 2021-02-20 22:38:58 +0000 >> >> jail: Improve locking when removing prisons >> Change the flow of prison_deref() so it doesn't let go of >> allprison_lock >> until it's completely done using it (except for a possible drop >> as part >> of an upgrade on its first try). >> Differential Revision: https://reviews.freebsd.org/D28458 >> MFC after: 3 days >> --- >> sys/kern/kern_jail.c | 69 >> +++++++++++++++++++++++++++++++--------------------- >> 1 file changed, 41 insertions(+), 28 deletions(-) > > Hello, > > do you still plan to MFC this?  It seems there's a bunch of locking > related rework not MFC yet, but this one had the MFC tag in the commit > log, so I guess it's a more important fix. Yes, still plan to, and in fact I will. I let the MFC reminder slip past me, and once 13.0 was solidified allowed it to stay slipped. I'll MFC many of the other changes as well. - Jamie From owner-dev-commits-src-main@freebsd.org Fri Mar 12 18:34: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 9BEB35A980F; Fri, 12 Mar 2021 18:34: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 4DxvcF44VZz4hTt; Fri, 12 Mar 2021 18:34:37 +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 7E6A51C534; Fri, 12 Mar 2021 18:34: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 12CIYbrh032455; Fri, 12 Mar 2021 18:34:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 12CIYbIJ032454; Fri, 12 Mar 2021 18:34:37 GMT (envelope-from git) Date: Fri, 12 Mar 2021 18:34:37 GMT Message-Id: <202103121834.12CIYbIJ032454@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Jonathan T. Looney" Subject: git: dbec10e08808 - main - Fetch the sigfastblock value in syscalls that wait for signals MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jtl X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: dbec10e08808e375365fb2a2462f306e0cdfda32 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, 12 Mar 2021 18:34:37 -0000 The branch main has been updated by jtl: URL: https://cgit.FreeBSD.org/src/commit/?id=dbec10e08808e375365fb2a2462f306e0cdfda32 commit dbec10e08808e375365fb2a2462f306e0cdfda32 Author: Jonathan T. Looney AuthorDate: 2021-03-12 18:14:17 +0000 Commit: Jonathan T. Looney CommitDate: 2021-03-12 18:14:17 +0000 Fetch the sigfastblock value in syscalls that wait for signals We have seen several cases of processes which have become "stuck" in kern_sigsuspend(). When this occurs, the kernel's td_sigblock_val is set to 0x10 (one block outstanding) and the userspace copy of the word is set to 0 (unblocked). Because the kernel's cached value shows that signals are blocked, kern_sigsuspend() blocks almost all signals, which means the process hangs indefinitely in sigsuspend(). It is not entirely clear what is causing this condition to occur. However, it seems to make sense to add some protection against this case by fetching the latest sigfastblock value from userspace for syscalls which will sleep waiting for signals. Here, the change is applied to kern_sigsuspend() and kern_sigtimedwait(). Reviewed by: kib Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D29225 --- sys/kern/kern_sig.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sys/kern/kern_sig.c b/sys/kern/kern_sig.c index 7884b5be9f91..3d55405d3151 100644 --- a/sys/kern/kern_sig.c +++ b/sys/kern/kern_sig.c @@ -1268,6 +1268,9 @@ kern_sigtimedwait(struct thread *td, sigset_t waitset, ksiginfo_t *ksi, ets.tv_nsec = 0; traced = false; + /* Ensure the sigfastblock value is up to date. */ + sigfastblock_fetch(td); + if (timeout != NULL) { if (timeout->tv_nsec >= 0 && timeout->tv_nsec < 1000000000) { timevalid = 1; @@ -1527,6 +1530,9 @@ kern_sigsuspend(struct thread *td, sigset_t mask) struct proc *p = td->td_proc; int has_sig, sig; + /* Ensure the sigfastblock value is up to date. */ + sigfastblock_fetch(td); + /* * When returning from sigsuspend, we want * the old mask to be restored after the From owner-dev-commits-src-main@freebsd.org Fri Mar 12 18:45: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 DF36A5A9862; Fri, 12 Mar 2021 18:45: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 4DxvrQ5zSjz4jDy; Fri, 12 Mar 2021 18:45: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 BE7EF1CA9C; Fri, 12 Mar 2021 18:45: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 12CIjAaP046153; Fri, 12 Mar 2021 18:45:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 12CIjAub046152; Fri, 12 Mar 2021 18:45:10 GMT (envelope-from git) Date: Fri, 12 Mar 2021 18:45:10 GMT Message-Id: <202103121845.12CIjAub046152@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alex Richardson Subject: git: 05eac56a0432 - main - lib/msun: Fix x86 GCC6 build after 221622ec0c8e184 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: arichardson X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 05eac56a0432d07acd7f159125855437a4dd6259 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, 12 Mar 2021 18:45:10 -0000 The branch main has been updated by arichardson: URL: https://cgit.FreeBSD.org/src/commit/?id=05eac56a0432d07acd7f159125855437a4dd6259 commit 05eac56a0432d07acd7f159125855437a4dd6259 Author: Alex Richardson AuthorDate: 2021-03-12 18:44:42 +0000 Commit: Alex Richardson CommitDate: 2021-03-12 18:44:44 +0000 lib/msun: Fix x86 GCC6 build after 221622ec0c8e184 Apparently GCC only supports arithmetic expressions that use static const variables in initializers starting with GCC8. To keep older versions happy use a macro instead. Fixes: 221622ec0c ("lib/msun: Avoid FE_INEXACT for x86 log2l/log10l") Reported by: Jenkins Reviewed By: imp Differential Revision: https://reviews.freebsd.org/D29233 --- lib/msun/ld80/s_logl.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/lib/msun/ld80/s_logl.c b/lib/msun/ld80/s_logl.c index d787b953fedb..c74519cafd69 100644 --- a/lib/msun/ld80/s_logl.c +++ b/lib/msun/ld80/s_logl.c @@ -674,14 +674,14 @@ logl(long double x) RETURNSPI(&r); } -static const double -invln10_hi = 4.3429448190317999e-1, /* 0x1bcb7b1526e000.0p-54 */ -invln10_lo = 7.1842412889749798e-14, /* 0x1438ca9aadd558.0p-96 */ -invln10_lo_plus_hi = invln10_lo + invln10_hi, -invln2_hi = 1.4426950408887933e0, /* 0x171547652b8000.0p-52 */ -invln2_lo = 1.7010652264631490e-13, /* 0x17f0bbbe87fed0.0p-95 */ -invln2_lo_plus_hi = invln2_lo + invln2_hi; - +/* Use macros since GCC < 8 rejects static const expressions in initializers. */ +#define invln10_hi 4.3429448190317999e-1 /* 0x1bcb7b1526e000.0p-54 */ +#define invln10_lo 7.1842412889749798e-14 /* 0x1438ca9aadd558.0p-96 */ +#define invln2_hi 1.4426950408887933e0 /* 0x171547652b8000.0p-52 */ +#define invln2_lo 1.7010652264631490e-13 /* 0x17f0bbbe87fed0.0p-95 */ +/* Let the compiler pre-calculate this sum to avoid FE_INEXACT at run time. */ +static const double invln10_lo_plus_hi = invln10_lo + invln10_hi; +static const double invln2_lo_plus_hi = invln2_lo + invln2_hi; long double log10l(long double x) From owner-dev-commits-src-main@freebsd.org Fri Mar 12 19:00: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 4BA525AA68C; Fri, 12 Mar 2021 19:00: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 4Dxw9x1fkCz4kqt; Fri, 12 Mar 2021 19:00: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 2B8E61CACD; Fri, 12 Mar 2021 19:00: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 12CJ0LSJ068538; Fri, 12 Mar 2021 19:00:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 12CJ0LIo068537; Fri, 12 Mar 2021 19:00:21 GMT (envelope-from git) Date: Fri, 12 Mar 2021 19:00:21 GMT Message-Id: <202103121900.12CJ0LIo068537@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: 8f885fd1f381 - main - ccr: Set the RX channel ID correctly in work requests. 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: 8f885fd1f38159a06db82d680fa259f358e9f872 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, 12 Mar 2021 19:00:21 -0000 The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=8f885fd1f38159a06db82d680fa259f358e9f872 commit 8f885fd1f38159a06db82d680fa259f358e9f872 Author: John Baldwin AuthorDate: 2021-03-12 18:35:05 +0000 Commit: John Baldwin CommitDate: 2021-03-12 18:59:35 +0000 ccr: Set the RX channel ID correctly in work requests. These fixes are only relevant for requests on the second port. In some cases, the crypto completion data, completion message, and receive descriptor could be written in the wrong order. - Add a separate rx_channel_id that is a copy of the port's rx_c_chan and use it when an RX channel ID is required in crypto requests instead of using the tx_channel_id. - Set the correct rx_channel_id in the CPL_RX_PHYS_ADDR used to write the crypto result. - Set the FID to the first rx queue ID on the adapter rather than the queue ID of the first rx queue for the port. - While here, use tx_chan to set the tx_channel_id though this is identical to the previous value. Reviewed by: np Reported by: Chelsio QA Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D29175 --- sys/dev/cxgbe/crypto/t4_crypto.c | 33 ++++++++++++++++++++++----------- 1 file changed, 22 insertions(+), 11 deletions(-) diff --git a/sys/dev/cxgbe/crypto/t4_crypto.c b/sys/dev/cxgbe/crypto/t4_crypto.c index 8861e710cfd2..46ea9d778fe3 100644 --- a/sys/dev/cxgbe/crypto/t4_crypto.c +++ b/sys/dev/cxgbe/crypto/t4_crypto.c @@ -165,6 +165,7 @@ struct ccr_session_blkcipher { struct ccr_port { struct sge_wrq *txq; struct sge_rxq *rxq; + int rx_channel_id; int tx_channel_id; u_int active_sessions; }; @@ -207,6 +208,7 @@ struct ccr_softc { bool detaching; struct ccr_port ports[MAX_NPORTS]; u_int port_mask; + int first_rxq_id; /* * Pre-allocate a dummy output buffer for the IV and AAD for @@ -333,6 +335,7 @@ ccr_write_phys_dsgl(struct ccr_session *s, void *dst, int nsegs) cpl->rss_hdr_int.opcode = CPL_RX_PHYS_ADDR; cpl->rss_hdr_int.qid = htobe16(s->port->rxq->iq.abs_id); cpl->rss_hdr_int.hash_val = 0; + cpl->rss_hdr_int.channel = s->port->rx_channel_id; sgl = (struct phys_sge_pairs *)(cpl + 1); j = 0; for (i = 0; i < sg->sg_nseg; i++) { @@ -423,12 +426,12 @@ ccr_populate_wreq(struct ccr_softc *sc, struct ccr_session *s, V_FW_CRYPTO_LOOKASIDE_WR_LEN16(wr_len / 16)); crwr->wreq.session_id = 0; crwr->wreq.rx_chid_to_rx_q_id = htobe32( - V_FW_CRYPTO_LOOKASIDE_WR_RX_CHID(s->port->tx_channel_id) | + V_FW_CRYPTO_LOOKASIDE_WR_RX_CHID(s->port->rx_channel_id) | V_FW_CRYPTO_LOOKASIDE_WR_LCB(0) | V_FW_CRYPTO_LOOKASIDE_WR_PHASH(0) | V_FW_CRYPTO_LOOKASIDE_WR_IV(IV_NOP) | V_FW_CRYPTO_LOOKASIDE_WR_FQIDX(0) | - V_FW_CRYPTO_LOOKASIDE_WR_TX_CH(0) | + V_FW_CRYPTO_LOOKASIDE_WR_TX_CH(0) | /* unused in firmware */ V_FW_CRYPTO_LOOKASIDE_WR_RX_Q_ID(s->port->rxq->iq.abs_id)); crwr->wreq.key_addr = 0; crwr->wreq.pld_size_hash_size = htobe32( @@ -440,7 +443,7 @@ ccr_populate_wreq(struct ccr_softc *sc, struct ccr_session *s, V_ULP_TXPKT_DATAMODIFY(0) | V_ULP_TXPKT_CHANNELID(s->port->tx_channel_id) | V_ULP_TXPKT_DEST(0) | - V_ULP_TXPKT_FID(s->port->rxq->iq.abs_id) | V_ULP_TXPKT_RO(1)); + V_ULP_TXPKT_FID(sc->first_rxq_id) | V_ULP_TXPKT_RO(1)); crwr->ulptx.len = htobe32( ((wr_len - sizeof(struct fw_crypto_lookaside_wr)) / 16)); @@ -525,7 +528,7 @@ ccr_hash(struct ccr_softc *sc, struct ccr_session *s, struct cryptop *crp) crwr->sec_cpl.op_ivinsrtofst = htobe32( V_CPL_TX_SEC_PDU_OPCODE(CPL_TX_SEC_PDU) | - V_CPL_TX_SEC_PDU_RXCHID(s->port->tx_channel_id) | + V_CPL_TX_SEC_PDU_RXCHID(s->port->rx_channel_id) | V_CPL_TX_SEC_PDU_ACKFOLLOWS(0) | V_CPL_TX_SEC_PDU_ULPTXLPBK(1) | V_CPL_TX_SEC_PDU_CPLLEN(2) | V_CPL_TX_SEC_PDU_PLACEHOLDER(0) | V_CPL_TX_SEC_PDU_IVINSRTOFST(0)); @@ -685,7 +688,7 @@ ccr_blkcipher(struct ccr_softc *sc, struct ccr_session *s, struct cryptop *crp) crwr->sec_cpl.op_ivinsrtofst = htobe32( V_CPL_TX_SEC_PDU_OPCODE(CPL_TX_SEC_PDU) | - V_CPL_TX_SEC_PDU_RXCHID(s->port->tx_channel_id) | + V_CPL_TX_SEC_PDU_RXCHID(s->port->rx_channel_id) | V_CPL_TX_SEC_PDU_ACKFOLLOWS(0) | V_CPL_TX_SEC_PDU_ULPTXLPBK(1) | V_CPL_TX_SEC_PDU_CPLLEN(2) | V_CPL_TX_SEC_PDU_PLACEHOLDER(0) | V_CPL_TX_SEC_PDU_IVINSRTOFST(1)); @@ -986,7 +989,7 @@ ccr_eta(struct ccr_softc *sc, struct ccr_session *s, struct cryptop *crp) crwr->sec_cpl.op_ivinsrtofst = htobe32( V_CPL_TX_SEC_PDU_OPCODE(CPL_TX_SEC_PDU) | - V_CPL_TX_SEC_PDU_RXCHID(s->port->tx_channel_id) | + V_CPL_TX_SEC_PDU_RXCHID(s->port->rx_channel_id) | V_CPL_TX_SEC_PDU_ACKFOLLOWS(0) | V_CPL_TX_SEC_PDU_ULPTXLPBK(1) | V_CPL_TX_SEC_PDU_CPLLEN(2) | V_CPL_TX_SEC_PDU_PLACEHOLDER(0) | V_CPL_TX_SEC_PDU_IVINSRTOFST(1)); @@ -1293,7 +1296,7 @@ ccr_gcm(struct ccr_softc *sc, struct ccr_session *s, struct cryptop *crp) crwr->sec_cpl.op_ivinsrtofst = htobe32( V_CPL_TX_SEC_PDU_OPCODE(CPL_TX_SEC_PDU) | - V_CPL_TX_SEC_PDU_RXCHID(s->port->tx_channel_id) | + V_CPL_TX_SEC_PDU_RXCHID(s->port->rx_channel_id) | V_CPL_TX_SEC_PDU_ACKFOLLOWS(0) | V_CPL_TX_SEC_PDU_ULPTXLPBK(1) | V_CPL_TX_SEC_PDU_CPLLEN(2) | V_CPL_TX_SEC_PDU_PLACEHOLDER(0) | V_CPL_TX_SEC_PDU_IVINSRTOFST(1)); @@ -1768,7 +1771,7 @@ ccr_ccm(struct ccr_softc *sc, struct ccr_session *s, struct cryptop *crp) crwr->sec_cpl.op_ivinsrtofst = htobe32( V_CPL_TX_SEC_PDU_OPCODE(CPL_TX_SEC_PDU) | - V_CPL_TX_SEC_PDU_RXCHID(s->port->tx_channel_id) | + V_CPL_TX_SEC_PDU_RXCHID(s->port->rx_channel_id) | V_CPL_TX_SEC_PDU_ACKFOLLOWS(0) | V_CPL_TX_SEC_PDU_ULPTXLPBK(1) | V_CPL_TX_SEC_PDU_CPLLEN(2) | V_CPL_TX_SEC_PDU_PLACEHOLDER(0) | V_CPL_TX_SEC_PDU_IVINSRTOFST(1)); @@ -2131,11 +2134,13 @@ ccr_sysctls(struct ccr_softc *sc) static void ccr_init_port(struct ccr_softc *sc, int port) { + struct port_info *pi; + pi = sc->adapter->port[port]; sc->ports[port].txq = &sc->adapter->sge.ctrlq[port]; - sc->ports[port].rxq = - &sc->adapter->sge.rxq[sc->adapter->port[port]->vi->first_rxq]; - sc->ports[port].tx_channel_id = port; + sc->ports[port].rxq = &sc->adapter->sge.rxq[pi->vi->first_rxq]; + sc->ports[port].rx_channel_id = pi->rx_c_chan; + sc->ports[port].tx_channel_id = pi->tx_chan; _Static_assert(sizeof(sc->port_mask) * NBBY >= MAX_NPORTS - 1, "Too many ports to fit in port_mask"); sc->port_mask |= 1u << port; @@ -2163,6 +2168,12 @@ ccr_attach(device_t dev) sc->cid = cid; sc->adapter->ccr_softc = sc; + /* + * The FID must be the first RXQ for port 0 regardless of + * which port is used to service the request. + */ + sc->first_rxq_id = sc->adapter->sge.rxq[0].iq.abs_id; + mtx_init(&sc->lock, "ccr", NULL, MTX_DEF); sc->iv_aad_buf = malloc(MAX_AAD_LEN, M_CCR, M_WAITOK); sc->sg_iv_aad = sglist_build(sc->iv_aad_buf, MAX_AAD_LEN, M_WAITOK); From owner-dev-commits-src-main@freebsd.org Fri Mar 12 19:00: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 604AE5AA61B; Fri, 12 Mar 2021 19:00: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 4Dxw9y2Gvyz4kZH; Fri, 12 Mar 2021 19:00: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 411801CC94; Fri, 12 Mar 2021 19:00: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 12CJ0Mki068560; Fri, 12 Mar 2021 19:00:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 12CJ0MgI068559; Fri, 12 Mar 2021 19:00:22 GMT (envelope-from git) Date: Fri, 12 Mar 2021 19:00:22 GMT Message-Id: <202103121900.12CJ0MgI068559@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: 9c5137beb5f2 - main - ccr: Add per-port stats of queued and completed requests. 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: 9c5137beb5f28292410888d0770bdf24c15e1312 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, 12 Mar 2021 19:00:22 -0000 The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=9c5137beb5f28292410888d0770bdf24c15e1312 commit 9c5137beb5f28292410888d0770bdf24c15e1312 Author: John Baldwin AuthorDate: 2021-03-12 18:35:32 +0000 Commit: John Baldwin CommitDate: 2021-03-12 18:59:35 +0000 ccr: Add per-port stats of queued and completed requests. Reviewed by: np Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D29176 --- sys/dev/cxgbe/crypto/t4_crypto.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/sys/dev/cxgbe/crypto/t4_crypto.c b/sys/dev/cxgbe/crypto/t4_crypto.c index 46ea9d778fe3..8cb5924c6b4c 100644 --- a/sys/dev/cxgbe/crypto/t4_crypto.c +++ b/sys/dev/cxgbe/crypto/t4_crypto.c @@ -168,6 +168,9 @@ struct ccr_port { int rx_channel_id; int tx_channel_id; u_int active_sessions; + + counter_u64_t stats_queued; + counter_u64_t stats_completed; }; struct ccr_session { @@ -2128,6 +2131,11 @@ ccr_sysctls(struct ccr_softc *sc) SYSCTL_ADD_UINT(ctx, children, OID_AUTO, "active_sessions", CTLFLAG_RD, &sc->ports[i].active_sessions, 0, "Count of active sessions"); + SYSCTL_ADD_COUNTER_U64(ctx, children, OID_AUTO, "queued", + CTLFLAG_RD, &sc->ports[i].stats_queued, "Requests queued"); + SYSCTL_ADD_COUNTER_U64(ctx, children, OID_AUTO, "completed", + CTLFLAG_RD, &sc->ports[i].stats_completed, + "Requests completed"); } } @@ -2141,6 +2149,8 @@ ccr_init_port(struct ccr_softc *sc, int port) sc->ports[port].rxq = &sc->adapter->sge.rxq[pi->vi->first_rxq]; sc->ports[port].rx_channel_id = pi->rx_c_chan; sc->ports[port].tx_channel_id = pi->tx_chan; + sc->ports[port].stats_queued = counter_u64_alloc(M_WAITOK); + sc->ports[port].stats_completed = counter_u64_alloc(M_WAITOK); _Static_assert(sizeof(sc->port_mask) * NBBY >= MAX_NPORTS - 1, "Too many ports to fit in port_mask"); sc->port_mask |= 1u << port; @@ -2199,10 +2209,19 @@ ccr_attach(device_t dev) return (0); } +static void +ccr_free_port(struct ccr_softc *sc, int port) +{ + + counter_u64_free(sc->ports[port].stats_queued); + counter_u64_free(sc->ports[port].stats_completed); +} + static int ccr_detach(device_t dev) { struct ccr_softc *sc; + int i; sc = device_get_softc(dev); @@ -2230,6 +2249,9 @@ ccr_detach(device_t dev) counter_u64_free(sc->stats_sglist_error); counter_u64_free(sc->stats_process_error); counter_u64_free(sc->stats_sw_fallback); + for_each_port(sc->adapter, i) { + ccr_free_port(sc, i); + } sglist_free(sc->sg_iv_aad); free(sc->iv_aad_buf, M_CCR); sc->adapter->ccr_softc = NULL; @@ -2827,6 +2849,7 @@ ccr_process(device_t dev, struct cryptop *crp, int hint) s->pending++; #endif counter_u64_add(sc->stats_inflight, 1); + counter_u64_add(s->port->stats_queued, 1); } else counter_u64_add(sc->stats_process_error, 1); @@ -2871,6 +2894,7 @@ do_cpl6_fw_pld(struct sge_iq *iq, const struct rss_header *rss, mtx_unlock(&s->lock); #endif counter_u64_add(sc->stats_inflight, -1); + counter_u64_add(s->port->stats_completed, 1); switch (s->mode) { case HASH: From owner-dev-commits-src-main@freebsd.org Fri Mar 12 19:00: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 CEB785AA0EC; Fri, 12 Mar 2021 19:00: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 4Dxw9z4PhFz4khm; Fri, 12 Mar 2021 19:00: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 7D0AD1CACE; Fri, 12 Mar 2021 19:00: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 12CJ0NYN068579; Fri, 12 Mar 2021 19:00:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 12CJ0Nj5068578; Fri, 12 Mar 2021 19:00:23 GMT (envelope-from git) Date: Fri, 12 Mar 2021 19:00:23 GMT Message-Id: <202103121900.12CJ0Nj5068578@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: 5fe0cd6503d3 - main - ccr: Disable requests on port 1 when needed to workaround a firmware bug. 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: 5fe0cd6503d34d23c98e9e1ff7bf10340218a5ec 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, 12 Mar 2021 19:00:23 -0000 The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=5fe0cd6503d34d23c98e9e1ff7bf10340218a5ec commit 5fe0cd6503d34d23c98e9e1ff7bf10340218a5ec Author: John Baldwin AuthorDate: 2021-03-12 18:35:56 +0000 Commit: John Baldwin CommitDate: 2021-03-12 18:59:35 +0000 ccr: Disable requests on port 1 when needed to workaround a firmware bug. Completions for crypto requests on port 1 can sometimes return a stale cookie value due to a firmware bug. Disable requests on port 1 by default on affected firmware. Reviewed by: np Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D26581 --- sys/dev/cxgbe/crypto/t4_crypto.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/sys/dev/cxgbe/crypto/t4_crypto.c b/sys/dev/cxgbe/crypto/t4_crypto.c index 8cb5924c6b4c..cdd14fcee2f9 100644 --- a/sys/dev/cxgbe/crypto/t4_crypto.c +++ b/sys/dev/cxgbe/crypto/t4_crypto.c @@ -2153,7 +2153,15 @@ ccr_init_port(struct ccr_softc *sc, int port) sc->ports[port].stats_completed = counter_u64_alloc(M_WAITOK); _Static_assert(sizeof(sc->port_mask) * NBBY >= MAX_NPORTS - 1, "Too many ports to fit in port_mask"); - sc->port_mask |= 1u << port; + + /* + * Completions for crypto requests on port 1 can sometimes + * return a stale cookie value due to a firmware bug. Disable + * requests on port 1 by default on affected firmware. + */ + if (sc->adapter->params.fw_vers >= FW_VERSION32(1, 25, 4, 0) || + port == 0) + sc->port_mask |= 1u << port; } static int From owner-dev-commits-src-main@freebsd.org Fri Mar 12 19:06: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 801855AAA06; Fri, 12 Mar 2021 19:06:24 +0000 (UTC) (envelope-from dim@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 4DxwJw2pT7z4lRw; Fri, 12 Mar 2021 19:06:24 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from tensor.andric.com (tensor.andric.com [IPv6:2001:470:7a58:1::1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "tensor.andric.com", Issuer "R3" (verified OK)) (Authenticated sender: dim) by smtp.freebsd.org (Postfix) with ESMTPSA id 3929E2AFBA; Fri, 12 Mar 2021 19:06:24 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from [IPv6:2001:470:7a58:0:b893:f361:9800:e767] (unknown [IPv6:2001:470:7a58:0:b893:f361:9800:e767]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id 645493CF18; Fri, 12 Mar 2021 20:06:22 +0100 (CET) From: Dimitry Andric Message-Id: Content-Type: multipart/signed; boundary="Apple-Mail=_764D54AA-739C-41C1-9479-859C5B8F8314"; protocol="application/pgp-signature"; micalg=pgp-sha1 Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.60.0.2.21\)) Subject: Re: git: 05eac56a0432 - main - lib/msun: Fix x86 GCC6 build after 221622ec0c8e184 Date: Fri, 12 Mar 2021 20:06:13 +0100 In-Reply-To: <202103121845.12CIjAub046152@gitrepo.freebsd.org> Cc: "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" To: Alex Richardson References: <202103121845.12CIjAub046152@gitrepo.freebsd.org> X-Mailer: Apple Mail (2.3654.60.0.2.21) 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, 12 Mar 2021 19:06:24 -0000 --Apple-Mail=_764D54AA-739C-41C1-9479-859C5B8F8314 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii On 12 Mar 2021, at 19:45, Alex Richardson = wrote: >=20 > The branch main has been updated by arichardson: >=20 > URL: = https://cgit.FreeBSD.org/src/commit/?id=3D05eac56a0432d07acd7f159125855437= a4dd6259 >=20 > commit 05eac56a0432d07acd7f159125855437a4dd6259 > Author: Alex Richardson > AuthorDate: 2021-03-12 18:44:42 +0000 > Commit: Alex Richardson > CommitDate: 2021-03-12 18:44:44 +0000 >=20 > lib/msun: Fix x86 GCC6 build after 221622ec0c8e184 >=20 > Apparently GCC only supports arithmetic expressions that use static > const variables in initializers starting with GCC8. To keep older > versions happy use a macro instead. >=20 > Fixes: 221622ec0c ("lib/msun: Avoid FE_INEXACT for x86 = log2l/log10l") > Reported by: Jenkins > Reviewed By: imp > Differential Revision: https://reviews.freebsd.org/D29233 Since gcc 6 is EOLed by upstream, why are we still running CI with it? Isn't it time to upgrade the CI compiler(s), so these kludges don't have to be used anymore? -Dimitry --Apple-Mail=_764D54AA-739C-41C1-9479-859C5B8F8314 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.2 iF0EARECAB0WIQR6tGLSzjX8bUI5T82wXqMKLiCWowUCYEu7pQAKCRCwXqMKLiCW o225AJ4rfbxpSWkb3yXP3z8CaJUPhQcS7wCeMMY22fZ6c4DzWXWWSwfcqLAsWYM= =C7K4 -----END PGP SIGNATURE----- --Apple-Mail=_764D54AA-739C-41C1-9479-859C5B8F8314-- From owner-dev-commits-src-main@freebsd.org Fri Mar 12 19:45: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 3BF655ABB26; Fri, 12 Mar 2021 19:45:17 +0000 (UTC) (envelope-from jhb@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 4Dxx9n1Hk7z4nNp; Fri, 12 Mar 2021 19:45:17 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro.local (ralph.baldwin.cx [66.234.199.215]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id 64C082B56E; Fri, 12 Mar 2021 19:45:16 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Subject: Re: git: 05eac56a0432 - main - lib/msun: Fix x86 GCC6 build after 221622ec0c8e184 To: Dimitry Andric , Alex Richardson Cc: "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" References: <202103121845.12CIjAub046152@gitrepo.freebsd.org> From: John Baldwin Message-ID: <5f6cc88d-5c16-2438-1aca-b2531d2cb9ae@FreeBSD.org> Date: Fri, 12 Mar 2021 11:45:11 -0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:78.0) Gecko/20100101 Thunderbird/78.7.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=windows-1252; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit 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, 12 Mar 2021 19:45:17 -0000 On 3/12/21 11:06 AM, Dimitry Andric wrote: > On 12 Mar 2021, at 19:45, Alex Richardson wrote: >> >> The branch main has been updated by arichardson: >> >> URL: https://cgit.FreeBSD.org/src/commit/?id=05eac56a0432d07acd7f159125855437a4dd6259 >> >> commit 05eac56a0432d07acd7f159125855437a4dd6259 >> Author: Alex Richardson >> AuthorDate: 2021-03-12 18:44:42 +0000 >> Commit: Alex Richardson >> CommitDate: 2021-03-12 18:44:44 +0000 >> >> lib/msun: Fix x86 GCC6 build after 221622ec0c8e184 >> >> Apparently GCC only supports arithmetic expressions that use static >> const variables in initializers starting with GCC8. To keep older >> versions happy use a macro instead. >> >> Fixes: 221622ec0c ("lib/msun: Avoid FE_INEXACT for x86 log2l/log10l") >> Reported by: Jenkins >> Reviewed By: imp >> Differential Revision: https://reviews.freebsd.org/D29233 > > Since gcc 6 is EOLed by upstream, why are we still running CI with it? > Isn't it time to upgrade the CI compiler(s), so these kludges don't have > to be used anymore? I'm trying, but we still don't build with GCC 9 yet everywhere. -- John Baldwin From owner-dev-commits-src-main@freebsd.org Fri Mar 12 20:08: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 1A0525AC695 for ; Fri, 12 Mar 2021 20:08:25 +0000 (UTC) (envelope-from marklmi@yahoo.com) Received: from sonic312-24.consmr.mail.gq1.yahoo.com (sonic312-24.consmr.mail.gq1.yahoo.com [98.137.69.205]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4DxxhR6Dmxz4pv4 for ; Fri, 12 Mar 2021 20:08:23 +0000 (UTC) (envelope-from marklmi@yahoo.com) X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1615579702; bh=RKLjzL7H4EinrsqtogB9qeKP+POWmwUisaKfTpZlxWJ=; h=X-Sonic-MF:From:Subject:Date:To:From:Subject; b=uiomcrE8NKvdxhaF2QOEHzLQWEsbbnKSa45Yl5JlKV4abFrHFVZPDac7li5Tw1cW9lAvQSKkkQ2/wqWi/6NlWraX1ZnX1tiTDeQ9zIV291Rk/7shHWLEiyCO/Z7vaPlF95yMoHaJGXyYq1/RfRlHDVLHOTycNMsp+nmLN+fXKglzVfYrOzlzDlT1O5HgDXY8E0nL6+eOk1J1NXSgiIbJ5vIaRsRtytUnpnu13wXPSZnCRfJd6msXcaCMhe+xBE6qP/qxR01TcdU7eyp9Zbo3btBFjCSFU0W6zW6ClH5tBtScHEsVgnTgB1i46N9ltyDswEsrPneM0GwrFAvawq1Hmw== X-YMail-OSG: LBMH3icVM1mqVy41VGB3bPmj._GAIWi6jSzKC03n6LGAYCFIGQqLod9UJ0Zy3.p CWv9LlPLGsfgsaJKC4AHyUghry6PgTiDVsYWPyEaPW_8QIG0pyc.LddowsAFyww1kbnsf6tMG5pS FUOfIR0RWPTYWv8dFqqIHldubMDWV73Q064WPUZ4rxMgW6HJ0xGga7uq9nFZ0CyOVemrmJHVwnwi 1eQF2g075r3mT05yM88Ij0sup9TrBYD5jZSLaPOfCbJgthPxurz_lKXkH9Al99oHrBP4kJQbGyco Ye3pQQ.fkLYEtIyVYURgk5VbA5Q0IAbf75HrbT6je3c46ve_9lU2.2PqpaP35tth_QvUHEkBauYD 2hym07UPImdkaYMasf6O2ZFqbzh9x.qJvB5a0U4tIOvt_CiQpRNQFwXCW44h_Eqh4_CFW05Oq8d2 nP24RwK7cNQuiZ7Hl69.F7ntmqvXHB8H.wY1gzpJ3z3D8F1kZQ8Z21g.DvnnTCPKV27Nl5x6OTIK vPn.Gn8i8VBVll_4Vl9KWob_Bim1ui4qFx2y2x.oGUQdmGuKsfLNfapDanBIZGZ87HWVGU52QONR _xLMGPqdLuFy18l2qkETty5UTthMUZ56eGC7Hu1jD4IkQ6ocfM5.BVAG1OvIDKyHjcO3RSv25guF 87SUIUyu28Pmenc_yPL7IlmA3Zra0ink1B4ep9Q86ZLPWkDnf4j6zSryXE36y0mMvpjtAx9_undg RUrR8U18rEAzNGXTa0dxT1xQ5MZ.YSA24oa2VHejfnd6M_ieWCwkY6x1xUH_BNtdX19.JqSRBe_8 G3J1Zf_QyGi7KJ13tdfzG62O3vstqINpHGvz9lxI23JUI3kS5G2f7MGv7W7eIOp6FntxVDK6iz08 mvlMxENqKoIkD3GRQXP5yQMWldMZU7uFY1RiPqhuvx56FA5qznDuqWnG4qRhaO1_Oaaq78jEA52. Bv3a9qW3ktcp.ENuUmakW6qfi8AGJkIf4fq2tvIRzbo8VCDHGmU1jYuTT8ELTEeK8PbIjjdF35ry JswVG59ywtDNfGwpFVgKXCzo_1E_BEPRBxVSuaok5b_OaoeMjJpOx8.wy56Ox2JNYYVIhqfEN6jp DM12jZK87l5C7_3DVrO4F3otYp_6I1ZTNFCCUECkuIHJtwM05AEtXLGUbyjC278bxeZ.Z7B4jRzs FSTfCLD9hX6._xOzph2SDdDwoJMPupgNdMPk3_E6dC87qw_UD2yEAnW7Ur5TceTHg7oCsuRItTgV aqt_QmfIvPqVdM.OA7W3U6y0LWrN6C8q2MP5RTCkMlB.oWSaZnbRZ5L1dEkCCi.GKN.YnPwMkkQn CRzp.ED8pjwPuQ1JmKSC9PE_JweLxcMw0hOM1GXWiqTRnYovRRBjHTk_rVrBwl6TLLTKiR_R66Yf LU6FKlHH0tBOtZD2dSHThDJP2a.ZKWttD.WMtD1akhB4SmxM8NGeoTYT5XQOiGRMaGqWkHMZoxm4 FAVKC7mOoRj5Eohwrb_QzDB7ORFLCKnuApGmp0plkoehmcWKXMgVANs8DnJ1aY.Qa5Jbv6UpRYAQ o5YjnkXAOLxrXQJ8WzKYSGvnn7.LKSsgKXdPeM1j4y0PNYZE.gMNi0_YskXf8yUzsA.R8a.zv8ZT 3TDOTxeXoimBDK0UkU997oKhNB0KkPbounVdvOSvS4a..YhTiYFJcHP3zIHQEzGcBn_acroG4hnV jC8ptFn.Ndn1cFYp3KFB4WoJvS4PgOG.6Pr1mII1cGG04IKt0MN5r7MvLXmp1Ae_ZKDDdsDAUtw_ OmZ_NREwHxv_1UzoKe_zWVkfJFSuNvImxQ8SfFJKIctNf0wjUHeV7ZTCqDpaVUPiWk07U8E1RJQd xFsqSqVnl7jtlFWb4zyIwK4orC73JyLM2MKT6nDX6rK6F_umPDz4gttUtujUIjmwApZUHvb9z5XA Mmwcixcza3KPiXZpbii9Ptiyqc5a_XxtAHTVbrbpPd2QB3KBwJuZZvnzP2KmwKWXYtwkSMWWstvH Mfki5jJAg3gbW3svjsCbRMLnVXNr4UwNxqKjzgIylgLynrD.p3dehT2iFtLSz8HF1X5.UBAy.uWf _ABxWA7wZY8tl0p7GRZdfCz9hudCHcXHKTKZF4q0xYdu0ybsMcu5EFBjlZP8mSkvMm8eTAZG1N7z 0tvQBIblpClFHAMF.g5.qjANkVdDKuneKazXTpNJKi0LuDTc.EF5is9ncgZnri8_6gW48pw7lFHO n1rkMuRvnkXlJI5IFqc3EUgfVYKgF6boza.DbyZ569wsSNHYIrl.17tZfO1NAKZB9hBaskB8Uoot E5p4JHyyxZyeu_08CXHGsJ3tZllsUVJ.3k6dpXdKL0hW0NTDt.0ion9zQ1iOHsbfWmWh2wYMyahz w3SviO90TOTZqWiDuTQonE5UvGTLnK_oCr8V1cfXltB8Xeoww6dvJQthvuScBeClB_bECR0IVZNG u2LQT11OAB2rLmC8dX9PO7tINZTqYYxlgdCF.SXrQ8_O3vMRvu2gjTB0ZXAyNRICqai7Rl0n_W71 U7RmBZTWbGQRvCMOScz5xrwYh7PTgjJGh5Lx_2NQlrA0VfoJK0KJb4s.rYv4suLsOMTIEUO2Jmmb FIpWIXMVZl1A7hMBB X-Sonic-MF: Received: from sonic.gate.mail.ne1.yahoo.com by sonic312.consmr.mail.gq1.yahoo.com with HTTP; Fri, 12 Mar 2021 20:08:22 +0000 Received: by kubenode581.mail-prod1.omega.gq1.yahoo.com (VZM Hermes SMTP Server) with ESMTPA ID 1e1273819dac0b566f7357770a053458; Fri, 12 Mar 2021 20:08:18 +0000 (UTC) From: Mark Millard Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.60.0.2.21\)) Subject: Re: git: 05eac56a0432 - main - lib/msun: Fix x86 GCC6 build after 221622ec0c8e184 Message-Id: <06797A5F-F60D-4959-8011-6CE8C93A48D4@yahoo.com> Date: Fri, 12 Mar 2021 12:08:18 -0800 To: John Baldwin , dev-commits-src-main@freebsd.org X-Mailer: Apple Mail (2.3654.60.0.2.21) References: <06797A5F-F60D-4959-8011-6CE8C93A48D4.ref@yahoo.com> X-Rspamd-Queue-Id: 4DxxhR6Dmxz4pv4 X-Spamd-Bar: --- X-Spamd-Result: default: False [-3.50 / 15.00]; TO_DN_SOME(0.00)[]; FREEMAIL_FROM(0.00)[yahoo.com]; MV_CASE(0.50)[]; R_SPF_ALLOW(-0.20)[+ptr:yahoo.com]; DKIM_TRACE(0.00)[yahoo.com:+]; RCPT_COUNT_TWO(0.00)[2]; DMARC_POLICY_ALLOW(-0.50)[yahoo.com,reject]; NEURAL_HAM_SHORT(-1.00)[-1.000]; FROM_EQ_ENVFROM(0.00)[]; RCVD_TLS_LAST(0.00)[]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[yahoo.com]; ASN(0.00)[asn:36647, ipnet:98.137.64.0/20, country:US]; RBL_DBL_DONT_QUERY_IPS(0.00)[98.137.69.205:from]; DWL_DNSWL_NONE(0.00)[yahoo.com:dkim]; MID_RHS_MATCH_FROM(0.00)[]; ARC_NA(0.00)[]; R_DKIM_ALLOW(-0.20)[yahoo.com:s=s2048]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; FROM_HAS_DN(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; MIME_GOOD(-0.10)[text/plain]; SPAMHAUS_ZRD(0.00)[98.137.69.205:from:127.0.2.255]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[98.137.69.205:from]; RWL_MAILSPIKE_POSSIBLE(0.00)[98.137.69.205:from]; 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: Fri, 12 Mar 2021 20:08:25 -0000 John Baldwin jhb at FreeBSD.org wrote on Fri Mar 12 19:45:17 UTC 2021 : > On 3/12/21 11:06 AM, Dimitry Andric wrote: > > On 12 Mar 2021, at 19:45, Alex Richardson wrote: > >> > >> The branch main has been updated by arichardson: > >> > >> URL: = https://cgit.FreeBSD.org/src/commit/?id=3D05eac56a0432d07acd7f159125855437= a4dd6259 > >> > >> commit 05eac56a0432d07acd7f159125855437a4dd6259 > >> Author: Alex Richardson > >> AuthorDate: 2021-03-12 18:44:42 +0000 > >> Commit: Alex Richardson > >> CommitDate: 2021-03-12 18:44:44 +0000 > >> > >> lib/msun: Fix x86 GCC6 build after 221622ec0c8e184 > >> > >> Apparently GCC only supports arithmetic expressions that use = static > >> const variables in initializers starting with GCC8. To keep = older > >> versions happy use a macro instead. > >> > >> Fixes: 221622ec0c ("lib/msun: Avoid FE_INEXACT for x86 = log2l/log10l") > >> Reported by: Jenkins > >> Reviewed By: imp > >> Differential Revision: https://reviews.freebsd.org/D29233 > >=20 > > Since gcc 6 is EOLed by upstream, why are we still running CI with = it? > > Isn't it time to upgrade the CI compiler(s), so these kludges don't = have > > to be used anymore? >=20 > I'm trying, but we still don't build with GCC 9 yet everywhere. Given how much of the time GCC 6 based CI builds spend broken (build after build), does it really matter if it is switched to broken GCC 9 builds where the GCC 9 related issues would then be visible to those that would look on occasion to monitor the status? Is there a significant value to having the GCC 6 based CI build results in the current context? =3D=3D=3D Mark Millard marklmi at yahoo.com ( dsl-only.net went away in early 2018-Mar) From owner-dev-commits-src-main@freebsd.org Fri Mar 12 20:50: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 AC7E25AD2CD; Fri, 12 Mar 2021 20:50: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 4DxycV4YjZz4rqp; Fri, 12 Mar 2021 20:50: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 8AD901E601; Fri, 12 Mar 2021 20:50: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 12CKo2V8006269; Fri, 12 Mar 2021 20:50:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 12CKo2ER006266; Fri, 12 Mar 2021 20:50:02 GMT (envelope-from git) Date: Fri, 12 Mar 2021 20:50:02 GMT Message-Id: <202103122050.12CKo2ER006266@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: 7381bbee29df - main - cam: Run all XPT_ASYNC ccbs in a dedicated thread 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: 7381bbee29df959e88ec59866cf2878263e7f3b2 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, 12 Mar 2021 20:50:02 -0000 The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=7381bbee29df959e88ec59866cf2878263e7f3b2 commit 7381bbee29df959e88ec59866cf2878263e7f3b2 Author: Warner Losh AuthorDate: 2021-03-12 20:20:52 +0000 Commit: Warner Losh CommitDate: 2021-03-12 20:29:42 +0000 cam: Run all XPT_ASYNC ccbs in a dedicated thread Queue all XPT_ASYNC ccb's and run those in a new cam async thread. This thread is allowed to sleep for things like memory. This should allow us to make all the registration routines for cam periph drivers simpler since they can assume they can always allocate memory. This is a separate thread so that any I/O that's completed in xpt_done_td isn't held up. This should fix the panics for WAITOK alloations that are elsewhere in the storage stack that aren't so easy to convert to NOWAIT. Additional future work will convert other allocations in the registration path to WAITOK should detailed analysis show it to be safe. Reviewed by: chs@, rpokala@ Differential Revision: https://reviews.freebsd.org/D29210 --- sys/cam/cam.h | 5 +++-- sys/cam/cam_xpt.c | 49 ++++++++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 51 insertions(+), 3 deletions(-) diff --git a/sys/cam/cam.h b/sys/cam/cam.h index 2aaa2e3a5775..70813f92ad10 100644 --- a/sys/cam/cam.h +++ b/sys/cam/cam.h @@ -94,8 +94,9 @@ typedef struct { u_int32_t generation; int index; #define CAM_UNQUEUED_INDEX -1 -#define CAM_ACTIVE_INDEX -2 -#define CAM_DONEQ_INDEX -3 +#define CAM_ACTIVE_INDEX -2 +#define CAM_DONEQ_INDEX -3 +#define CAM_ASYNC_INDEX -4 #define CAM_EXTRAQ_INDEX INT_MAX } cam_pinfo; diff --git a/sys/cam/cam_xpt.c b/sys/cam/cam_xpt.c index 9cfee80a6049..24e16bebb2e7 100644 --- a/sys/cam/cam_xpt.c +++ b/sys/cam/cam_xpt.c @@ -180,6 +180,7 @@ struct cam_doneq { static struct cam_doneq cam_doneqs[MAXCPU]; static u_int __read_mostly cam_num_doneqs; static struct proc *cam_proc; +static struct cam_doneq cam_async; SYSCTL_INT(_kern_cam, OID_AUTO, num_doneqs, CTLFLAG_RDTUN, &cam_num_doneqs, 0, "Number of completion queues/threads"); @@ -271,6 +272,7 @@ static void xptpoll(struct cam_sim *sim); static void camisr_runqueue(void); static void xpt_done_process(struct ccb_hdr *ccb_h); static void xpt_done_td(void *); +static void xpt_async_td(void *); static dev_match_ret xptbusmatch(struct dev_match_pattern *patterns, u_int num_patterns, struct cam_eb *bus); static dev_match_ret xptdevicematch(struct dev_match_pattern *patterns, @@ -972,6 +974,15 @@ xpt_init(void *dummy) return (ENOMEM); } + mtx_init(&cam_async.cam_doneq_mtx, "CAM async", NULL, MTX_DEF); + STAILQ_INIT(&cam_async.cam_doneq); + if (kproc_kthread_add(xpt_async_td, &cam_async, + &cam_proc, NULL, 0, 0, "cam", "async") != 0) { + printf("xpt_init: Cannot init async thread " + "- failing attach\n"); + return (ENOMEM); + } + /* * Register a callback for when interrupts are enabled. */ @@ -3146,8 +3157,16 @@ call_sim: xpt_done(start_ccb); break; case XPT_ASYNC: + /* + * Queue the async operation so it can be run from a sleepable + * context. + */ start_ccb->ccb_h.status = CAM_REQ_CMP; - xpt_done(start_ccb); + mtx_lock(&cam_async.cam_doneq_mtx); + STAILQ_INSERT_TAIL(&cam_async.cam_doneq, &start_ccb->ccb_h, sim_links.stqe); + start_ccb->ccb_h.pinfo.index = CAM_ASYNC_INDEX; + mtx_unlock(&cam_async.cam_doneq_mtx); + wakeup(&cam_async.cam_doneq); break; default: case XPT_SDEV_TYPE: @@ -5472,6 +5491,34 @@ xpt_done_process(struct ccb_hdr *ccb_h) mtx_unlock(mtx); } +/* + * Parameterize instead and use xpt_done_td? + */ +static void +xpt_async_td(void *arg) +{ + struct cam_doneq *queue = arg; + struct ccb_hdr *ccb_h; + STAILQ_HEAD(, ccb_hdr) doneq; + + STAILQ_INIT(&doneq); + mtx_lock(&queue->cam_doneq_mtx); + while (1) { + while (STAILQ_EMPTY(&queue->cam_doneq)) + msleep(&queue->cam_doneq, &queue->cam_doneq_mtx, + PRIBIO, "-", 0); + STAILQ_CONCAT(&doneq, &queue->cam_doneq); + mtx_unlock(&queue->cam_doneq_mtx); + + while ((ccb_h = STAILQ_FIRST(&doneq)) != NULL) { + STAILQ_REMOVE_HEAD(&doneq, sim_links.stqe); + xpt_done_process(ccb_h); + } + + mtx_lock(&queue->cam_doneq_mtx); + } +} + void xpt_done_td(void *arg) { From owner-dev-commits-src-main@freebsd.org Fri Mar 12 22:07: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 D01005AECD0; Fri, 12 Mar 2021 22:07: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 4Dy0KX5b4Rz3C4J; Fri, 12 Mar 2021 22:07: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 AECF01EFD2; Fri, 12 Mar 2021 22:07: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 12CM7Cgf010873; Fri, 12 Mar 2021 22:07:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 12CM7Ctx010872; Fri, 12 Mar 2021 22:07:12 GMT (envelope-from git) Date: Fri, 12 Mar 2021 22:07:12 GMT Message-Id: <202103122207.12CM7Ctx010872@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Peter Jeremy Subject: git: 07564e176201 - main - arm64: Add support for the RK805/RK808 RTC MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: peterj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 07564e1762010ba7e8ef5a7574bf9ceee811e95c 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, 12 Mar 2021 22:07:12 -0000 The branch main has been updated by peterj: URL: https://cgit.FreeBSD.org/src/commit/?id=07564e1762010ba7e8ef5a7574bf9ceee811e95c commit 07564e1762010ba7e8ef5a7574bf9ceee811e95c Author: Peter Jeremy AuthorDate: 2021-03-12 22:06:04 +0000 Commit: Peter Jeremy CommitDate: 2021-03-12 22:06:04 +0000 arm64: Add support for the RK805/RK808 RTC Implement a driver for the RTC embedded in the RK805/RK808 power management system used for RK3328 and RK3399 SoCs. Based on experiments on my RK808, setting the time doesn't alter the internal/inaccessible sub-second counter, therefore there's no point in calling clock_schedule(). Based on an earlier revision by andrew. Reviewed by: manu Differential Revision: https://reviews.freebsd.org/D22692 Sponsored by: Google MFC after: 1 week --- sys/arm64/rockchip/rk805.c | 123 ++++++++++++++++++++++++++++++++++++++++-- sys/arm64/rockchip/rk805reg.h | 25 +++++++++ 2 files changed, 144 insertions(+), 4 deletions(-) diff --git a/sys/arm64/rockchip/rk805.c b/sys/arm64/rockchip/rk805.c index 19397627a8b0..d3e04081aeb2 100644 --- a/sys/arm64/rockchip/rk805.c +++ b/sys/arm64/rockchip/rk805.c @@ -30,6 +30,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -46,6 +47,7 @@ __FBSDID("$FreeBSD$"); #include +#include "clock_if.h" #include "regdev_if.h" MALLOC_DEFINE(M_RK805_REG, "RK805 regulator", "RK805 power regulator"); @@ -356,10 +358,10 @@ rk805_read(device_t dev, uint8_t reg, uint8_t *data, uint8_t size) } static int -rk805_write(device_t dev, uint8_t reg, uint8_t data) +rk805_write(device_t dev, uint8_t reg, uint8_t *data, uint8_t size) { - return (iicdev_writeto(dev, reg, &data, 1, IIC_INTRWAIT)); + return (iicdev_writeto(dev, reg, data, size, IIC_INTRWAIT)); } static int @@ -415,7 +417,7 @@ rk805_regnode_enable(struct regnode *regnode, bool enable, int *udelay) val |= sc->def->enable_mask; else val &= ~sc->def->enable_mask; - rk805_write(sc->base_dev, sc->def->enable_reg, val); + rk805_write(sc->base_dev, sc->def->enable_reg, &val, 1); *udelay = 0; @@ -491,7 +493,7 @@ rk805_regnode_set_voltage(struct regnode *regnode, int min_uvolt, if (rk805_regnode_voltage_to_reg(sc, min_uvolt, max_uvolt, &val) != 0) return (ERANGE); - rk805_write(sc->base_dev, sc->def->voltage_reg, val); + rk805_write(sc->base_dev, sc->def->voltage_reg, &val, 1); rk805_read(sc->base_dev, sc->def->voltage_reg, &val, 1); @@ -624,9 +626,117 @@ rk805_start(void *pdev) device_printf(dev, "Chip Version: %x\n", data[1] & 0xf); } + /* Register this as a 1Hz clock */ + clock_register(dev, 1000000); + config_intrhook_disestablish(&sc->intr_hook); } +static int +rk805_gettime(device_t dev, struct timespec *ts) +{ + struct bcd_clocktime bct; + uint8_t data[7]; + uint8_t ctrl; + int error; + + /* Latch the RTC value into the shadow registers and set 24hr mode */ + error = rk805_read(dev, RK805_RTC_CTRL, &ctrl, 1); + if (error != 0) + return (error); + + ctrl |= RK805_RTC_READSEL; + ctrl &= ~(RK805_RTC_AMPM_MODE | RK805_RTC_GET_TIME); + error = rk805_write(dev, RK805_RTC_CTRL, &ctrl, 1); + if (error != 0) + return (error); + ctrl |= RK805_RTC_GET_TIME; + error = rk805_write(dev, RK805_RTC_CTRL, &ctrl, 1); + if (error != 0) + return (error); + ctrl &= ~RK805_RTC_GET_TIME; + error = rk805_write(dev, RK805_RTC_CTRL, &ctrl, 1); + if (error != 0) + return (error); + + /* This works as long as RK805_RTC_SECS = 0 */ + error = rk805_read(dev, RK805_RTC_SECS, data, 7); + if (error != 0) + return (error); + + /* + * If the reported year is earlier than 2019, assume the clock is unset. + * This is both later than the reset value for the RK805 and RK808 as + * well as being prior to the current time. + */ + if (data[RK805_RTC_YEARS] < 0x19) + return (EINVAL); + + memset(&bct, 0, sizeof(bct)); + bct.year = data[RK805_RTC_YEARS]; + bct.mon = data[RK805_RTC_MONTHS] & RK805_RTC_MONTHS_MASK; + bct.day = data[RK805_RTC_DAYS] & RK805_RTC_DAYS_MASK; + bct.hour = data[RK805_RTC_HOURS] & RK805_RTC_HOURS_MASK; + bct.min = data[RK805_RTC_MINUTES] & RK805_RTC_MINUTES_MASK; + bct.sec = data[RK805_RTC_SECS] & RK805_RTC_SECS_MASK; + bct.dow = data[RK805_RTC_WEEKS] & RK805_RTC_WEEKS_MASK; + /* The day of week is reported as 1-7 with 1 = Monday */ + if (bct.dow == 7) + bct.dow = 0; + bct.ispm = 0; + + if (bootverbose) + device_printf(dev, "Read RTC: %02x-%02x-%02x %02x:%02x:%02x\n", + bct.year, bct.mon, bct.day, bct.hour, bct.min, bct.sec); + + return (clock_bcd_to_ts(&bct, ts, false)); +} + +static int +rk805_settime(device_t dev, struct timespec *ts) +{ + struct bcd_clocktime bct; + uint8_t data[7]; + int error; + uint8_t ctrl; + + clock_ts_to_bcd(ts, &bct, false); + + /* This works as long as RK805_RTC_SECS = 0 */ + data[RK805_RTC_YEARS] = bct.year; + data[RK805_RTC_MONTHS] = bct.mon; + data[RK805_RTC_DAYS] = bct.day; + data[RK805_RTC_HOURS] = bct.hour; + data[RK805_RTC_MINUTES] = bct.min; + data[RK805_RTC_SECS] = bct.sec; + data[RK805_RTC_WEEKS] = bct.dow; + /* The day of week is reported as 1-7 with 1 = Monday */ + if (data[RK805_RTC_WEEKS] == 0) + data[RK805_RTC_WEEKS] = 7; + + error = rk805_read(dev, RK805_RTC_CTRL, &ctrl, 1); + if (error != 0) + return (error); + + ctrl |= RK805_RTC_CTRL_STOP; + ctrl &= ~RK805_RTC_AMPM_MODE; + error = rk805_write(dev, RK805_RTC_CTRL, &ctrl, 1); + if (error != 0) + return (error); + + error = rk805_write(dev, RK805_RTC_SECS, data, 7); + ctrl &= ~RK805_RTC_CTRL_STOP; + rk805_write(dev, RK805_RTC_CTRL, &ctrl, 1); + + if (bootverbose) + device_printf(dev, + "Set RTC at %04x-%02x-%02x %02x:%02x:%02x[.%09ld]\n", + bct.year, bct.mon, bct.day, bct.hour, bct.min, bct.sec, + bct.nsec); + + return (error); +} + static int rk805_attach(device_t dev) { @@ -724,6 +834,11 @@ static device_method_t rk805_methods[] = { /* regdev interface */ DEVMETHOD(regdev_map, rk805_map), + + /* Clock interface */ + DEVMETHOD(clock_gettime, rk805_gettime), + DEVMETHOD(clock_settime, rk805_settime), + DEVMETHOD_END }; diff --git a/sys/arm64/rockchip/rk805reg.h b/sys/arm64/rockchip/rk805reg.h index db489d77c26e..b1f4481a5b68 100644 --- a/sys/arm64/rockchip/rk805reg.h +++ b/sys/arm64/rockchip/rk805reg.h @@ -30,6 +30,31 @@ #ifndef _RK805REG_H_ #define _RK805REG_H_ +/* + * The RTC registers are the same in both RK805 and RK808. + * Note that the code assumes that RK805_RTC_SECS is 0 + */ +#define RK805_RTC_SECS 0x00 +#define RK805_RTC_SECS_MASK 0x7f +#define RK805_RTC_MINUTES 0x01 +#define RK805_RTC_MINUTES_MASK 0x7f +#define RK805_RTC_HOURS 0x02 +#define RK805_RTC_HOURS_MASK 0x3f +#define RK805_RTC_HOURS_PM 0x80 +#define RK805_RTC_DAYS 0x03 +#define RK805_RTC_DAYS_MASK 0x3f +#define RK805_RTC_MONTHS 0x04 +#define RK805_RTC_MONTHS_MASK 0x1f +#define RK805_RTC_YEARS 0x05 +#define RK805_RTC_WEEKS 0x06 /* day of week */ +#define RK805_RTC_WEEKS_MASK 0x07 + +#define RK805_RTC_CTRL 0x10 +#define RK805_RTC_CTRL_STOP (1 << 0) +#define RK805_RTC_AMPM_MODE (1 << 3) +#define RK805_RTC_GET_TIME (1 << 6) +#define RK805_RTC_READSEL (1 << 7) + #define RK805_CHIP_NAME 0x17 #define RK805_CHIP_VER 0x18 #define RK805_OTP_VER 0x19 From owner-dev-commits-src-main@freebsd.org Sat Mar 13 01: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 1B0DB5B4E06; Sat, 13 Mar 2021 01:33: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 4Dy4vk028Cz3RLy; Sat, 13 Mar 2021 01:33: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 E810121FA9; Sat, 13 Mar 2021 01:33: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 12D1XbZQ086100; Sat, 13 Mar 2021 01:33:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 12D1Xb8Q086099; Sat, 13 Mar 2021 01:33:37 GMT (envelope-from git) Date: Sat, 13 Mar 2021 01:33:37 GMT Message-Id: <202103130133.12D1Xb8Q086099@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Adrian Chadd Subject: git: 51dfae383bf6 - main - [ath] validate ts_antenna before updating tx statistics MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: adrian X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 51dfae383bf6298af9e6d816a78b92b6f34d68be 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, 13 Mar 2021 01:33:38 -0000 The branch main has been updated by adrian: URL: https://cgit.FreeBSD.org/src/commit/?id=51dfae383bf6298af9e6d816a78b92b6f34d68be commit 51dfae383bf6298af9e6d816a78b92b6f34d68be Author: Adrian Chadd AuthorDate: 2021-03-13 01:29:09 +0000 Commit: Adrian Chadd CommitDate: 2021-03-13 01:33:07 +0000 [ath] validate ts_antenna before updating tx statistics Right now ts_antenna is either 0 or 1 in each supported HAL so this is purely a sanity check. Later on if I ever get magical free time I may add some extensions for the NICs that can have slightly more complicated antenna switches for transmit and I'd like this to not bust memory. --- sys/dev/ath/if_ath.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sys/dev/ath/if_ath.c b/sys/dev/ath/if_ath.c index 34a9311c834a..0ef10e529dd5 100644 --- a/sys/dev/ath/if_ath.c +++ b/sys/dev/ath/if_ath.c @@ -4175,6 +4175,11 @@ ath_tx_update_stats(struct ath_softc *sc, struct ath_tx_status *ts, if (ts->ts_status == 0) { u_int8_t txant = ts->ts_antenna; + /* + * Handle weird/corrupted tx antenna field + */ + if (txant >= ATH_IOCTL_STATS_NUM_TX_ANTENNA) + txant = 0; sc->sc_stats.ast_ant_tx[txant]++; sc->sc_ant_tx[txant]++; if (ts->ts_finaltsi != 0) From owner-dev-commits-src-main@freebsd.org Sat Mar 13 07:35: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 1C1CA56C440; Sat, 13 Mar 2021 07:35: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 4DyDxV6W8vz4WBB; Sat, 13 Mar 2021 07:35: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 D20EE26CB5; Sat, 13 Mar 2021 07:35: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 12D7Zgsw062295; Sat, 13 Mar 2021 07:35:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 12D7ZgQf062294; Sat, 13 Mar 2021 07:35:42 GMT (envelope-from git) Date: Sat, 13 Mar 2021 07:35:42 GMT Message-Id: <202103130735.12D7ZgQf062294@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Adrian Chadd Subject: git: fb3edd4f3ff8 - main - [ath] do a cold reset if TSFOOR triggers MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: adrian X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: fb3edd4f3ff89f5883b8309ff71ff4a426279c85 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, 13 Mar 2021 07:35:43 -0000 The branch main has been updated by adrian: URL: https://cgit.FreeBSD.org/src/commit/?id=fb3edd4f3ff89f5883b8309ff71ff4a426279c85 commit fb3edd4f3ff89f5883b8309ff71ff4a426279c85 Author: Adrian Chadd AuthorDate: 2021-03-13 07:30:25 +0000 Commit: Adrian Chadd CommitDate: 2021-03-13 07:30:25 +0000 [ath] do a cold reset if TSFOOR triggers TSFOOR happens if a beacon with a given TSF isn't received within the programmed/expected TSF value, plus/minus a fudge range. (OOR == out of range.) If this happens then it could be because the baseband/mac is stuck, or the baseband is deaf. So, do a cold reset and resync the beacon to try and unstick the hardware. It also happens when a bad AP decides to err, slew its TSF because they themselves are resetting and they don't preserve the TSF "well." This has fixed a bunch of weird corner cases on my 2GHz AP radio upstairs here where it occasionally goes deaf due to how much 2GHz noise is up here (and ANI gets a little sideways) and this unsticks the station VAP. For AP modes a hung baseband/mac usually ends up as a stuck beacon and those have been addressed for a long time by just resetting the hardware. But similar hangs in station mode didn't have a similar recovery mechanism. Tested: * AR9380, STA mode, 2GHz/5GHz * AR9580, STA mode, 5GHz * QCA9344 SoC w/ on-board wifi (TL-WDR4300/3600 devices); 2GHz STA mode --- sys/dev/ath/if_ath.c | 50 ++++++++++++++++++++++++++++++++++++++++++----- sys/dev/ath/if_athioctl.h | 1 + sys/dev/ath/if_athvar.h | 1 + 3 files changed, 47 insertions(+), 5 deletions(-) diff --git a/sys/dev/ath/if_ath.c b/sys/dev/ath/if_ath.c index 0ef10e529dd5..698b8d1a2853 100644 --- a/sys/dev/ath/if_ath.c +++ b/sys/dev/ath/if_ath.c @@ -165,6 +165,7 @@ static void ath_parent(struct ieee80211com *); static void ath_fatal_proc(void *, int); static void ath_bmiss_vap(struct ieee80211vap *); static void ath_bmiss_proc(void *, int); +static void ath_tsfoor_proc(void *, int); static void ath_key_update_begin(struct ieee80211vap *); static void ath_key_update_end(struct ieee80211vap *); static void ath_update_mcast_hw(struct ath_softc *); @@ -761,6 +762,7 @@ ath_attach(u_int16_t devid, struct ath_softc *sc) TASK_INIT(&sc->sc_rxtask, 0, sc->sc_rx.recv_tasklet, sc); TASK_INIT(&sc->sc_bmisstask, 0, ath_bmiss_proc, sc); + TASK_INIT(&sc->sc_tsfoortask, 0, ath_tsfoor_proc, sc); TASK_INIT(&sc->sc_bstucktask,0, ath_bstuck_proc, sc); TASK_INIT(&sc->sc_resettask,0, ath_reset_proc, sc); TASK_INIT(&sc->sc_txqtask, 0, ath_txq_sched_tasklet, sc); @@ -2333,13 +2335,18 @@ ath_intr(void *arg) sc->sc_stats.ast_rxorn++; } if (status & HAL_INT_TSFOOR) { - /* out of range beacon - wake the chip up, - * but don't modify self-gen frame config */ - device_printf(sc->sc_dev, "%s: TSFOOR\n", __func__); - sc->sc_syncbeacon = 1; + /* + * out of range beacon - wake the chip up, + * but don't modify self-gen frame config. + * Do a full reset to clear any potential stuck + * PHY/MAC that generated this condition. + */ + sc->sc_stats.ast_tsfoor++; ATH_LOCK(sc); ath_power_setpower(sc, HAL_PM_AWAKE, 0); ATH_UNLOCK(sc); + taskqueue_enqueue(sc->sc_tq, &sc->sc_tsfoortask); + device_printf(sc->sc_dev, "%s: TSFOOR\n", __func__); } if (status & HAL_INT_MCI) { ath_btcoex_mci_intr(sc); @@ -2483,7 +2490,7 @@ ath_bmiss_proc(void *arg, int pending) ath_beacon_miss(sc); /* - * Do a reset upon any becaon miss event. + * Do a reset upon any beacon miss event. * * It may be a non-recognised RX clear hang which needs a reset * to clear. @@ -2505,6 +2512,39 @@ ath_bmiss_proc(void *arg, int pending) ATH_UNLOCK(sc); } +/* + * Handle a TSF out of range interrupt in STA mode. + * + * This may be due to a partially deaf looking radio, so + * do a full reset just in case it is indeed deaf and + * resync the beacon. + */ +static void +ath_tsfoor_proc(void *arg, int pending) +{ + struct ath_softc *sc = arg; + + DPRINTF(sc, ATH_DEBUG_ANY, "%s: pending %u\n", __func__, pending); + + ATH_LOCK(sc); + ath_power_set_power_state(sc, HAL_PM_AWAKE); + ATH_UNLOCK(sc); + + /* + * Do a full reset after any TSFOOR. It's possible that + * we've gone deaf or partially deaf (eg due to calibration + * failures) and this should clean things up a bit. + */ + ath_reset(sc, ATH_RESET_NOLOSS, HAL_RESET_FORCE_COLD); + + /* Force a beacon resync, in case they've drifted */ + sc->sc_syncbeacon = 1; + + ATH_LOCK(sc); + ath_power_restore_power_state(sc); + ATH_UNLOCK(sc); +} + /* * Handle TKIP MIC setup to deal hardware that doesn't do MIC * calcs together with WME. If necessary disable the crypto diff --git a/sys/dev/ath/if_athioctl.h b/sys/dev/ath/if_athioctl.h index fec48bb4c890..5043cd8ab467 100644 --- a/sys/dev/ath/if_athioctl.h +++ b/sys/dev/ath/if_athioctl.h @@ -177,6 +177,7 @@ struct ath_stats { u_int32_t ast_tx_nodeq_overflow; /* node sw queue overflow */ u_int32_t ast_tx_ldpc; /* TX LDPC frame */ u_int32_t ast_tx_stbc; /* TX STBC frame */ + u_int32_t ast_tsfoor; /* TSFOOR interrupts */ u_int32_t ast_pad[10]; }; diff --git a/sys/dev/ath/if_athvar.h b/sys/dev/ath/if_athvar.h index 7817fe667281..1d2f842197cd 100644 --- a/sys/dev/ath/if_athvar.h +++ b/sys/dev/ath/if_athvar.h @@ -784,6 +784,7 @@ struct ath_softc { /* recent tx frames/antenna */ struct ath_txq *sc_cabq; /* tx q for cab frames */ struct task sc_bmisstask; /* bmiss int processing */ + struct task sc_tsfoortask; /* TSFOOR int processing */ struct task sc_bstucktask; /* stuck beacon processing */ struct task sc_resettask; /* interface reset task */ struct task sc_fataltask; /* fatal task */ From owner-dev-commits-src-main@freebsd.org Sat Mar 13 09: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 D893B570055; Sat, 13 Mar 2021 09: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 4DyHWY5rn0z4cr3; Sat, 13 Mar 2021 09:31: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 BBBB868B; Sat, 13 Mar 2021 09:31: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 12D9Vrnq018782; Sat, 13 Mar 2021 09:31:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 12D9VrP7018781; Sat, 13 Mar 2021 09:31:53 GMT (envelope-from git) Date: Sat, 13 Mar 2021 09:31:53 GMT Message-Id: <202103130931.12D9VrP7018781@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: 59146a6921d0 - main - zfs: make seqc asserts conditional on replay 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: 59146a6921d06d5cf4320dc8ed82810363ffe7c4 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, 13 Mar 2021 09:31:53 -0000 The branch main has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=59146a6921d06d5cf4320dc8ed82810363ffe7c4 commit 59146a6921d06d5cf4320dc8ed82810363ffe7c4 Author: Mateusz Guzik AuthorDate: 2021-03-13 09:10:16 +0000 Commit: Mateusz Guzik CommitDate: 2021-03-13 09:31:49 +0000 zfs: make seqc asserts conditional on replay Avoids tripping on asserts when doing pool recovery. --- sys/contrib/openzfs/module/os/freebsd/zfs/zfs_acl.c | 9 ++++++--- sys/contrib/openzfs/module/zfs/zfs_replay.c | 5 ----- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/sys/contrib/openzfs/module/os/freebsd/zfs/zfs_acl.c b/sys/contrib/openzfs/module/os/freebsd/zfs/zfs_acl.c index 23b87de8bd0d..7089d0e0e887 100644 --- a/sys/contrib/openzfs/module/os/freebsd/zfs/zfs_acl.c +++ b/sys/contrib/openzfs/module/os/freebsd/zfs/zfs_acl.c @@ -1141,10 +1141,11 @@ zfs_acl_chown_setattr(znode_t *zp) int error; zfs_acl_t *aclp; - if (zp->z_zfsvfs->z_replay == B_FALSE) + if (zp->z_zfsvfs->z_replay == B_FALSE) { ASSERT_VOP_ELOCKED(ZTOV(zp), __func__); + ASSERT_VOP_IN_SEQC(ZTOV(zp)); + } ASSERT(MUTEX_HELD(&zp->z_acl_lock)); - ASSERT_VOP_IN_SEQC(ZTOV(zp)); if ((error = zfs_acl_node_read(zp, B_TRUE, &aclp, B_FALSE)) == 0) zp->z_mode = zfs_mode_compute(zp->z_mode, aclp, @@ -1172,7 +1173,9 @@ zfs_aclset_common(znode_t *zp, zfs_acl_t *aclp, cred_t *cr, dmu_tx_t *tx) int count = 0; zfs_acl_phys_t acl_phys; - ASSERT_VOP_IN_SEQC(ZTOV(zp)); + if (zp->z_zfsvfs->z_replay == B_FALSE) { + ASSERT_VOP_IN_SEQC(ZTOV(zp)); + } mode = zp->z_mode; diff --git a/sys/contrib/openzfs/module/zfs/zfs_replay.c b/sys/contrib/openzfs/module/zfs/zfs_replay.c index 53c7dbd5df43..cba5e8c9cd0b 100644 --- a/sys/contrib/openzfs/module/zfs/zfs_replay.c +++ b/sys/contrib/openzfs/module/zfs/zfs_replay.c @@ -859,12 +859,7 @@ zfs_replay_setattr(void *arg1, void *arg2, boolean_t byteswap) zfsvfs->z_fuid_replay = zfs_replay_fuid_domain(start, &start, lr->lr_uid, lr->lr_gid); - /* - * Satisfy assertions. - */ - vn_seqc_write_begin(ZTOV(zp)); error = zfs_setattr(zp, vap, 0, kcred); - vn_seqc_write_end(ZTOV(zp)); zfs_fuid_info_free(zfsvfs->z_fuid_replay); zfsvfs->z_fuid_replay = NULL; From owner-dev-commits-src-main@freebsd.org Sat Mar 13 12:00: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 BC4CA574FFA; Sat, 13 Mar 2021 12:00: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 4DyLqW4m70z4nBC; Sat, 13 Mar 2021 12:00: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 96ABA2386; Sat, 13 Mar 2021 12:00: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 12DC0tot014333; Sat, 13 Mar 2021 12:00:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 12DC0t1S014332; Sat, 13 Mar 2021 12:00:55 GMT (envelope-from git) Date: Sat, 13 Mar 2021 12:00:55 GMT Message-Id: <202103131200.12DC0t1S014332@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mariusz Zaborski Subject: git: 653ed678c703 - main - zfs: bring back possibility to rewind the checkpoint from MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: oshogbo X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 653ed678c70376b15cdc42daafa7b4554570cea2 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, 13 Mar 2021 12:00:55 -0000 The branch main has been updated by oshogbo: URL: https://cgit.FreeBSD.org/src/commit/?id=653ed678c70376b15cdc42daafa7b4554570cea2 commit 653ed678c70376b15cdc42daafa7b4554570cea2 Author: Mariusz Zaborski AuthorDate: 2021-03-13 11:56:17 +0000 Commit: Mariusz Zaborski CommitDate: 2021-03-13 11:56:17 +0000 zfs: bring back possibility to rewind the checkpoint from Add parsing of the rewind options. When I was upstreaming the change [1], I omitted the part where we detect that the pool should be rewind. When the FreeBSD repo has synced with the OpenZFS, this part of the code was removed. [1] FreeBSD repo: 277f38abffc6a8160b5044128b5b2c620fbb970c [2] OpenZFS repo: f2c027bd6a003ec5793f8716e6189c389c60f47a Originally reviewed by: tsoome, allanjude Originally reviewed by: kevans (ok from high-level overview) Signed-off-by: Mariusz Zaborski PR: 254152 Reported by: Zhenlei Huang Obtained from: https://github.com/openzfs/zfs/pull/11730 --- sys/contrib/openzfs/module/os/freebsd/zfs/zfs_vfsops.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/sys/contrib/openzfs/module/os/freebsd/zfs/zfs_vfsops.c b/sys/contrib/openzfs/module/os/freebsd/zfs/zfs_vfsops.c index 7bc6b83d0272..a537342f9678 100644 --- a/sys/contrib/openzfs/module/os/freebsd/zfs/zfs_vfsops.c +++ b/sys/contrib/openzfs/module/os/freebsd/zfs/zfs_vfsops.c @@ -1291,6 +1291,18 @@ getpoolname(const char *osname, char *poolname) return (0); } +static void +fetch_osname_options(char *name, bool *checkpointrewind) +{ + + if (name[0] == '!') { + *checkpointrewind = true; + memmove(name, name + 1, strlen(name)); + } else { + *checkpointrewind = false; + } +} + /*ARGSUSED*/ static int zfs_mount(vfs_t *vfsp) @@ -1301,6 +1313,7 @@ zfs_mount(vfs_t *vfsp) char *osname; int error = 0; int canwrite; + bool checkpointrewind; if (vfs_getopt(vfsp->mnt_optnew, "from", (void **)&osname, NULL)) return (SET_ERROR(EINVAL)); @@ -1314,6 +1327,8 @@ zfs_mount(vfs_t *vfsp) secpolicy_fs_mount_clearopts(cr, vfsp); } + fetch_osname_options(osname, &checkpointrewind); + /* * Check for mount privilege? * @@ -1392,7 +1407,7 @@ zfs_mount(vfs_t *vfsp) error = getpoolname(osname, pname); if (error == 0) - error = spa_import_rootpool(pname, false); + error = spa_import_rootpool(pname, checkpointrewind); if (error) goto out; } From owner-dev-commits-src-main@freebsd.org Sat Mar 13 13:54: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 A40F757852A; Sat, 13 Mar 2021 13:54: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 4DyPLx4ChLz4tTH; Sat, 13 Mar 2021 13:54: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 7917D3BC0; Sat, 13 Mar 2021 13:54: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 12DDsnJF065155; Sat, 13 Mar 2021 13:54:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 12DDsnKR065154; Sat, 13 Mar 2021 13:54:49 GMT (envelope-from git) Date: Sat, 13 Mar 2021 13:54:49 GMT Message-Id: <202103131354.12DDsnKR065154@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dimitry Andric Subject: git: 9097e3cbcac4 - main - Partially revert libcxxrt changes to avoid _Unwind_Exception change MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dim X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9097e3cbcac455eb0dedd097d8d5548c72568d0a 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, 13 Mar 2021 13:54:49 -0000 The branch main has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=9097e3cbcac455eb0dedd097d8d5548c72568d0a commit 9097e3cbcac455eb0dedd097d8d5548c72568d0a Author: Dimitry Andric AuthorDate: 2021-03-13 13:54:24 +0000 Commit: Dimitry Andric CommitDate: 2021-03-13 13:54:24 +0000 Partially revert libcxxrt changes to avoid _Unwind_Exception change (Note I am also applying this to main and stable/13, to restore the old libcxxrt ABI and to avoid having to maintain a compat library.) After the recent cherry-picking of libcxxrt commits 0ee0dbfb0d26 and d2b3fadf2db5, users reported that editors/libreoffice packages from the official package builders did not start anymore. It turns out that the combination of these commits subtly changes the ABI, requiring all applications that depend on internal details of struct _Unwind_Exception (available via unwind-arm.h and unwind-itanium.h) to be recompiled. However, the FreeBSD package builders always use -RELEASE jails, so these still use the old declaration of struct _Unwind_Exception, which is not entirely compatible. In particular, LibreOffice uses this struct in its internal "uno bridge" component, where it attempts to setup its own exception handling mechanism. To fix this incompatibility, go back to the old declarations of struct _Unwind_Exception, and restore the __LP64__ specific workaround we had in place before (which was to cope with yet another, older ABI bug). Effectively, this reverts upstream libcxxrt commits 88bdf6b290da ("Specify double-word alignment for ARM unwind") and b96169641f79 ("Updated Itanium unwind"), and reapplies our commit 3c4fd2463bb2 ("libcxxrt: add padding in __cxa_allocate_* to fix alignment"). PR: 253840 --- contrib/libcxxrt/exception.cc | 30 ++++++++++++++++++++++++------ contrib/libcxxrt/unwind-arm.h | 2 +- contrib/libcxxrt/unwind-itanium.h | 9 +++------ 3 files changed, 28 insertions(+), 13 deletions(-) diff --git a/contrib/libcxxrt/exception.cc b/contrib/libcxxrt/exception.cc index 0fb26ddb4ed2..0de878e9e6db 100644 --- a/contrib/libcxxrt/exception.cc +++ b/contrib/libcxxrt/exception.cc @@ -572,6 +572,19 @@ static void free_exception(char *e) } } +#ifdef __LP64__ +/** + * There's an ABI bug in __cxa_exception: unwindHeader requires 16-byte + * alignment but it was broken by the addition of the referenceCount. + * The unwindHeader is at offset 0x58 in __cxa_exception. In order to keep + * compatibility with consumers of the broken __cxa_exception, explicitly add + * padding on allocation (and account for it on free). + */ +static const int exception_alignment_padding = 8; +#else +static const int exception_alignment_padding = 0; +#endif + /** * Allocates an exception structure. Returns a pointer to the space that can * be used to store an object of thrown_size bytes. This function will use an @@ -580,16 +593,19 @@ static void free_exception(char *e) */ extern "C" void *__cxa_allocate_exception(size_t thrown_size) { - size_t size = thrown_size + sizeof(__cxa_exception); + size_t size = exception_alignment_padding + sizeof(__cxa_exception) + + thrown_size; char *buffer = alloc_or_die(size); - return buffer+sizeof(__cxa_exception); + return buffer + exception_alignment_padding + sizeof(__cxa_exception); } extern "C" void *__cxa_allocate_dependent_exception(void) { - size_t size = sizeof(__cxa_dependent_exception); + size_t size = exception_alignment_padding + + sizeof(__cxa_dependent_exception); char *buffer = alloc_or_die(size); - return buffer+sizeof(__cxa_dependent_exception); + return buffer + exception_alignment_padding + + sizeof(__cxa_dependent_exception); } /** @@ -617,7 +633,8 @@ extern "C" void __cxa_free_exception(void *thrown_exception) } } - free_exception(reinterpret_cast(ex)); + free_exception(reinterpret_cast(ex) - + exception_alignment_padding); } static void releaseException(__cxa_exception *exception) @@ -644,7 +661,8 @@ void __cxa_free_dependent_exception(void *thrown_exception) { releaseException(realExceptionFromException(reinterpret_cast<__cxa_exception*>(ex))); } - free_exception(reinterpret_cast(ex)); + free_exception(reinterpret_cast(ex) - + exception_alignment_padding); } /** diff --git a/contrib/libcxxrt/unwind-arm.h b/contrib/libcxxrt/unwind-arm.h index ec81237e573b..6eb9d9e45981 100644 --- a/contrib/libcxxrt/unwind-arm.h +++ b/contrib/libcxxrt/unwind-arm.h @@ -97,7 +97,7 @@ struct _Unwind_Exception } pr_cache; /** Force alignment of next item to 8-byte boundary */ long long int :0; -} __attribute__((__aligned__(8))); +}; /* Unwinding functions */ _Unwind_Reason_Code _Unwind_RaiseException(struct _Unwind_Exception *ucbp); diff --git a/contrib/libcxxrt/unwind-itanium.h b/contrib/libcxxrt/unwind-itanium.h index 199d91de283d..1ee0cf0e81c4 100644 --- a/contrib/libcxxrt/unwind-itanium.h +++ b/contrib/libcxxrt/unwind-itanium.h @@ -79,12 +79,9 @@ struct _Unwind_Exception { uint64_t exception_class; _Unwind_Exception_Cleanup_Fn exception_cleanup; - uintptr_t private_1; - uintptr_t private_2; -#if __SIZEOF_POINTER__ == 4 - uint32_t reserved[3]; -#endif - } __attribute__((__aligned__)); + unsigned long private_1; + unsigned long private_2; + } ; extern _Unwind_Reason_Code _Unwind_RaiseException (struct _Unwind_Exception *); extern _Unwind_Reason_Code _Unwind_ForcedUnwind (struct _Unwind_Exception *, From owner-dev-commits-src-main@freebsd.org Sat Mar 13 14:52: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 11E4F579D2D; Sat, 13 Mar 2021 14:52: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 4DyQd26rqcz4xsF; Sat, 13 Mar 2021 14: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 D33AF4AAD; Sat, 13 Mar 2021 14: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 12DEq6wW044158; Sat, 13 Mar 2021 14: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 12DEq64V044157; Sat, 13 Mar 2021 14:52:06 GMT (envelope-from git) Date: Sat, 13 Mar 2021 14:52:06 GMT Message-Id: <202103131452.12DEq64V044157@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: d197bf2b20e7 - main - net80211: 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: d197bf2b20e7efc6ffef520bf96d5f642e26a015 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, 13 Mar 2021 14:52:07 -0000 The branch main has been updated by gbe (doc committer): URL: https://cgit.FreeBSD.org/src/commit/?id=d197bf2b20e7efc6ffef520bf96d5f642e26a015 commit d197bf2b20e7efc6ffef520bf96d5f642e26a015 Author: Gordon Bergling AuthorDate: 2021-03-13 14:51:30 +0000 Commit: Gordon Bergling CommitDate: 2021-03-13 14:51:30 +0000 net80211: Fix a typo in a comment - destionation -> destination - while here, fix some whitespace issues MFC after: 1 week --- sys/net80211/ieee80211_hwmp.c | 62 +++++++++++++++++++++---------------------- 1 file changed, 31 insertions(+), 31 deletions(-) diff --git a/sys/net80211/ieee80211_hwmp.c b/sys/net80211/ieee80211_hwmp.c index 75c3eeb7c759..4fbcc9051c47 100644 --- a/sys/net80211/ieee80211_hwmp.c +++ b/sys/net80211/ieee80211_hwmp.c @@ -1,33 +1,33 @@ -/*- +/*- * SPDX-License-Identifier: BSD-2-Clause-FreeBSD * - * Copyright (c) 2009 The FreeBSD Foundation - * All rights reserved. - * + * Copyright (c) 2009 The FreeBSD Foundation + * All rights reserved. + * * This software was developed by Rui Paulo under sponsorship from the - * FreeBSD Foundation. - * - * 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. - */ + * FreeBSD Foundation. + * + * 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 #ifdef __FreeBSD__ __FBSDID("$FreeBSD$"); @@ -282,7 +282,7 @@ hwmp_vdetach(struct ieee80211vap *vap) callout_drain(&hs->hs_roottimer); IEEE80211_FREE(vap->iv_hwmp, M_80211_VAP); vap->iv_hwmp = NULL; -} +} static int hwmp_newstate(struct ieee80211vap *vap, enum ieee80211_state ostate, int arg) @@ -378,7 +378,7 @@ verify_mesh_perr_len(struct ieee80211vap *vap, } iefrm_t += IEEE80211_MESHPERR_NDEST_OFFSET + 1; /* flag is next field */ - /* We need to check each destionation flag to know size */ + /* We need to check each destination flag to know size */ for(i = 0; ipreq_lifetime = le32dec(iefrm_t); iefrm_t += 4; preq->preq_metric = le32dec(iefrm_t); iefrm_t += 4; preq->preq_tcount = *iefrm_t++; - + for (i = 0; i < preq->preq_tcount; i++) { preq->preq_targets[i].target_flags = *iefrm_t++; IEEE80211_ADDR_COPY( @@ -983,7 +983,7 @@ hwmp_recv_preq(struct ieee80211vap *vap, struct ieee80211_node *ni, return; } /* - * Acceptance criteria: if unicast addressed + * Acceptance criteria: if unicast addressed * AND no valid forwarding for Target of PREQ, discard this PREQ. */ if(rttarg != NULL) From owner-dev-commits-src-main@freebsd.org Sat Mar 13 15:11: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 DDD1457A2FA; Sat, 13 Mar 2021 15:11: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 4DyR3p60mNz4ylt; Sat, 13 Mar 2021 15:11: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 B6D924E0A; Sat, 13 Mar 2021 15:11: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 12DFBoOF069731; Sat, 13 Mar 2021 15:11:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 12DFBoKs069730; Sat, 13 Mar 2021 15:11:50 GMT (envelope-from git) Date: Sat, 13 Mar 2021 15:11:50 GMT Message-Id: <202103131511.12DFBoKs069730@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: 564a3ac63abe - main - i386: Fix a few typos 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: 564a3ac63abe166c6174ed3a58e78859a738ee58 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, 13 Mar 2021 15:11:50 -0000 The branch main has been updated by gbe (doc committer): URL: https://cgit.FreeBSD.org/src/commit/?id=564a3ac63abe166c6174ed3a58e78859a738ee58 commit 564a3ac63abe166c6174ed3a58e78859a738ee58 Author: Gordon Bergling AuthorDate: 2021-03-13 15:10:01 +0000 Commit: Gordon Bergling CommitDate: 2021-03-13 15:10:01 +0000 i386: Fix a few typos - wheter -> whether - while here, fix some whitespace issues MFC after: 1 week --- sys/i386/i386/initcpu.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/sys/i386/i386/initcpu.c b/sys/i386/i386/initcpu.c index 9ba269af2b32..ee2d7ec224e5 100644 --- a/sys/i386/i386/initcpu.c +++ b/sys/i386/i386/initcpu.c @@ -2,21 +2,21 @@ * SPDX-License-Identifier: BSD-2-Clause-FreeBSD * * Copyright (c) KATO Takenori, 1997, 1998. - * + * * All rights reserved. Unpublished rights reserved under the copyright * laws of Japan. - * + * * 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 as * the first lines of this file unmodified. * 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. @@ -837,7 +837,7 @@ enable_K5_wt_alloc(void) msr |= AMD_WT_ALLOC_TME | AMD_WT_ALLOC_FRE; /* - * There is no way to know wheter 15-16M hole exists or not. + * There is no way to know whether 15-16M hole exists or not. * Therefore, we disable write allocate for this range. */ wrmsr(0x86, 0x0ff00f0); @@ -890,7 +890,7 @@ enable_K6_wt_alloc(void) whcr |= 0x0001LL; #else /* - * There is no way to know wheter 15-16M hole exists or not. + * There is no way to know whether 15-16M hole exists or not. * Therefore, we disable write allocate for this range. */ whcr &= ~0x0001LL; @@ -940,7 +940,7 @@ enable_K6_2_wt_alloc(void) whcr |= 1LL << 16; #else /* - * There is no way to know wheter 15-16M hole exists or not. + * There is no way to know whether 15-16M hole exists or not. * Therefore, we disable write allocate for this range. */ whcr &= ~(1LL << 16); From owner-dev-commits-src-main@freebsd.org Sat Mar 13 15:38: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 0211057A960; Sat, 13 Mar 2021 15:38: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 4DyRfw6gP0z5181; Sat, 13 Mar 2021 15:38: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 D78A1549D; Sat, 13 Mar 2021 15:38: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 12DFcmvc098099; Sat, 13 Mar 2021 15:38:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 12DFcmkf098098; Sat, 13 Mar 2021 15:38:48 GMT (envelope-from git) Date: Sat, 13 Mar 2021 15:38:48 GMT Message-Id: <202103131538.12DFcmkf098098@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: 183502d1625f - main - Fix a few typos in comments 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: 183502d1625fbcc3600fbe1d196758b946749569 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, 13 Mar 2021 15:38:49 -0000 The branch main has been updated by gbe (doc committer): URL: https://cgit.FreeBSD.org/src/commit/?id=183502d1625fbcc3600fbe1d196758b946749569 commit 183502d1625fbcc3600fbe1d196758b946749569 Author: Gordon Bergling AuthorDate: 2021-03-13 15:37:28 +0000 Commit: Gordon Bergling CommitDate: 2021-03-13 15:37:28 +0000 Fix a few typos in comments - trough -> through MFC after: 1 week --- share/man/man4/ng_macfilter.4 | 2 +- sys/netinet/sctp_ss_functions.c | 2 +- sys/netpfil/ipfw/nat64/nat64_translate.c | 2 +- sys/sys/soundcard.h | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/share/man/man4/ng_macfilter.4 b/share/man/man4/ng_macfilter.4 index 5d8b9a4f780b..895d3560136b 100644 --- a/share/man/man4/ng_macfilter.4 +++ b/share/man/man4/ng_macfilter.4 @@ -45,7 +45,7 @@ address. .Pp This processing is done when traffic flows from the .Dq ether -hook trough +hook through .Nm macfilter to one of the outgoing hooks. Outbound hooks can be added to and remove from diff --git a/sys/netinet/sctp_ss_functions.c b/sys/netinet/sctp_ss_functions.c index 5f10d3e9bcb7..5557015cd2a9 100644 --- a/sys/netinet/sctp_ss_functions.c +++ b/sys/netinet/sctp_ss_functions.c @@ -583,7 +583,7 @@ sctp_ss_prio_set_value(struct sctp_tcb *stcb, struct sctp_association *asoc, /* * Fair bandwidth algorithm. - * Maintains an equal troughput per stream. + * Maintains an equal throughput per stream. */ static void sctp_ss_fb_clear(struct sctp_tcb *stcb, struct sctp_association *asoc, diff --git a/sys/netpfil/ipfw/nat64/nat64_translate.c b/sys/netpfil/ipfw/nat64/nat64_translate.c index e8fffe03497c..4ed3bfa765f6 100644 --- a/sys/netpfil/ipfw/nat64/nat64_translate.c +++ b/sys/netpfil/ipfw/nat64/nat64_translate.c @@ -722,7 +722,7 @@ nat64_icmp6_reflect(struct mbuf *m, uint8_t type, uint8_t code, uint32_t mtu, /* * Move pkthdr from original mbuf. We should have initialized some * fields, because we can reinject this mbuf to netisr and it will - * go trough input path (it requires at least rcvif should be set). + * go through input path (it requires at least rcvif should be set). * Also do M_ALIGN() to reduce chances of need to allocate new mbuf * in the chain, when we will do M_PREPEND() or make some type of * tunneling. diff --git a/sys/sys/soundcard.h b/sys/sys/soundcard.h index 41cd8593914a..285f26986434 100644 --- a/sys/sys/soundcard.h +++ b/sys/sys/soundcard.h @@ -484,7 +484,7 @@ struct sysex_info { * This structure is also used with ioctl(SNDCTL_PGMR_IFACE) which allows * a patch manager daemon to read and write device parameters. This * ioctl available through /dev/sequencer also. Avoid using it since it's - * extremely hardware dependent. In addition access trough /dev/sequencer + * extremely hardware dependent. In addition access through /dev/sequencer * may confuse the patch manager daemon. */ From owner-dev-commits-src-main@freebsd.org Sat Mar 13 17:27: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 7FBAB57D16F; Sat, 13 Mar 2021 17:27: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 4DyV4L3FBHz56yR; Sat, 13 Mar 2021 17:27: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 616EF6A19; Sat, 13 Mar 2021 17:27: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 12DHRU1C042807; Sat, 13 Mar 2021 17:27:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 12DHRUhU042806; Sat, 13 Mar 2021 17:27:30 GMT (envelope-from git) Date: Sat, 13 Mar 2021 17:27:30 GMT Message-Id: <202103131727.12DHRUhU042806@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: 5666643a9538 - main - Fix some common typos in comments 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: 5666643a95389e3ea7637b86cc556d411242f71e 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, 13 Mar 2021 17:27:30 -0000 The branch main has been updated by gbe (doc committer): URL: https://cgit.FreeBSD.org/src/commit/?id=5666643a95389e3ea7637b86cc556d411242f71e commit 5666643a95389e3ea7637b86cc556d411242f71e Author: Gordon Bergling AuthorDate: 2021-03-13 17:26:15 +0000 Commit: Gordon Bergling CommitDate: 2021-03-13 17:26:15 +0000 Fix some common typos in comments - occured -> occurred - normaly -> normally - controling -> controlling - fileds -> fields - insterted -> inserted - outputing -> outputting MFC after: 1 week --- lib/libipsec/pfkey.c | 48 ++++++++++++++++++------------------- stand/efi/include/efifs.h | 2 +- sys/dev/ixl/ixl_pf_i2c.c | 40 +++++++++++++++---------------- sys/fs/nfsclient/nfs_clrpcops.c | 4 ++-- sys/mips/ingenic/jz4780_regs.h | 6 ++--- sys/net/if_pfsync.h | 2 +- sys/netinet/tcp_log_buf.h | 6 ++--- sys/netinet/tcp_stacks/bbr.c | 8 +++---- sys/netinet/tcp_stacks/rack.c | 2 +- sys/netinet/tcp_stacks/tcp_rack.h | 2 +- tools/test/stress2/misc/nullfs17.sh | 2 +- usr.bin/ar/write.c | 4 ++-- usr.bin/fmt/fmt.c | 2 +- 13 files changed, 64 insertions(+), 64 deletions(-) diff --git a/lib/libipsec/pfkey.c b/lib/libipsec/pfkey.c index d1aae7321c2e..08098775910f 100644 --- a/lib/libipsec/pfkey.c +++ b/lib/libipsec/pfkey.c @@ -342,7 +342,7 @@ pfkey_get_softrate(type) * sending SADB_GETSPI message to the kernel. * OUT: * positive: success and return length sent. - * -1 : error occured, and set errno. + * -1 : error occurred, and set errno. */ int pfkey_send_getspi(so, satype, mode, src, dst, min, max, reqid, seq) @@ -471,7 +471,7 @@ pfkey_send_getspi(so, satype, mode, src, dst, min, max, reqid, seq) * The length of key material is a_keylen + e_keylen. * OUT: * positive: success and return length sent. - * -1 : error occured, and set errno. + * -1 : error occurred, and set errno. */ int pfkey_send_update(so, satype, mode, src, dst, spi, reqid, wsize, @@ -502,7 +502,7 @@ pfkey_send_update(so, satype, mode, src, dst, spi, reqid, wsize, * The length of key material is a_keylen + e_keylen. * OUT: * positive: success and return length sent. - * -1 : error occured, and set errno. + * -1 : error occurred, and set errno. */ int pfkey_send_add(so, satype, mode, src, dst, spi, reqid, wsize, @@ -532,7 +532,7 @@ pfkey_send_add(so, satype, mode, src, dst, spi, reqid, wsize, * sending SADB_DELETE message to the kernel. * OUT: * positive: success and return length sent. - * -1 : error occured, and set errno. + * -1 : error occurred, and set errno. */ int pfkey_send_delete(so, satype, mode, src, dst, spi) @@ -555,7 +555,7 @@ pfkey_send_delete(so, satype, mode, src, dst, spi) * * OUT: * positive: success and return length sent - * -1 : error occured, and set errno + * -1 : error occurred, and set errno */ int pfkey_send_delete_all(so, satype, mode, src, dst) @@ -637,7 +637,7 @@ pfkey_send_delete_all(so, satype, mode, src, dst) * sending SADB_GET message to the kernel. * OUT: * positive: success and return length sent. - * -1 : error occured, and set errno. + * -1 : error occurred, and set errno. */ int pfkey_send_get(so, satype, mode, src, dst, spi) @@ -657,7 +657,7 @@ pfkey_send_get(so, satype, mode, src, dst, spi) * sending SADB_REGISTER message to the kernel. * OUT: * positive: success and return length sent. - * -1 : error occured, and set errno. + * -1 : error occurred, and set errno. */ int pfkey_send_register(so, satype) @@ -699,7 +699,7 @@ pfkey_send_register(so, satype) * sadb_supported returned into ipsec_supported. * OUT: * 0: success and return length sent. - * -1: error occured, and set errno. + * -1: error occurred, and set errno. */ int pfkey_recv_register(so) @@ -739,7 +739,7 @@ pfkey_recv_register(so) * tlen: msg length, it's to makeing sure. * OUT: * 0: success and return length sent. - * -1: error occured, and set errno. + * -1: error occurred, and set errno. */ int pfkey_set_supported(msg, tlen) @@ -803,7 +803,7 @@ pfkey_set_supported(msg, tlen) * sending SADB_FLUSH message to the kernel. * OUT: * positive: success and return length sent. - * -1 : error occured, and set errno. + * -1 : error occurred, and set errno. */ int pfkey_send_flush(so, satype) @@ -822,7 +822,7 @@ pfkey_send_flush(so, satype) * sending SADB_DUMP message to the kernel. * OUT: * positive: success and return length sent. - * -1 : error occured, and set errno. + * -1 : error occurred, and set errno. */ int pfkey_send_dump(so, satype) @@ -844,8 +844,8 @@ pfkey_send_dump(so, satype) * flag: set promisc off if zero, set promisc on if non-zero. * OUT: * positive: success and return length sent. - * -1 : error occured, and set errno. - * 0 : error occured, and set errno. + * -1 : error occurred, and set errno. + * 0 : error occurred, and set errno. * others: a pointer to new allocated buffer in which supported * algorithms is. */ @@ -866,7 +866,7 @@ pfkey_send_promisc_toggle(so, flag) * sending SADB_X_SPDADD message to the kernel. * OUT: * positive: success and return length sent. - * -1 : error occured, and set errno. + * -1 : error occurred, and set errno. */ int pfkey_send_spdadd(so, src, prefs, dst, prefd, proto, policy, policylen, seq) @@ -892,7 +892,7 @@ pfkey_send_spdadd(so, src, prefs, dst, prefd, proto, policy, policylen, seq) * sending SADB_X_SPDADD message to the kernel. * OUT: * positive: success and return length sent. - * -1 : error occured, and set errno. + * -1 : error occurred, and set errno. */ int pfkey_send_spdadd2(so, src, prefs, dst, prefd, proto, ltime, vtime, @@ -920,7 +920,7 @@ pfkey_send_spdadd2(so, src, prefs, dst, prefd, proto, ltime, vtime, * sending SADB_X_SPDUPDATE message to the kernel. * OUT: * positive: success and return length sent. - * -1 : error occured, and set errno. + * -1 : error occurred, and set errno. */ int pfkey_send_spdupdate(so, src, prefs, dst, prefd, proto, policy, policylen, seq) @@ -946,7 +946,7 @@ pfkey_send_spdupdate(so, src, prefs, dst, prefd, proto, policy, policylen, seq) * sending SADB_X_SPDUPDATE message to the kernel. * OUT: * positive: success and return length sent. - * -1 : error occured, and set errno. + * -1 : error occurred, and set errno. */ int pfkey_send_spdupdate2(so, src, prefs, dst, prefd, proto, ltime, vtime, @@ -974,7 +974,7 @@ pfkey_send_spdupdate2(so, src, prefs, dst, prefd, proto, ltime, vtime, * sending SADB_X_SPDDELETE message to the kernel. * OUT: * positive: success and return length sent. - * -1 : error occured, and set errno. + * -1 : error occurred, and set errno. */ int pfkey_send_spddelete(so, src, prefs, dst, prefd, proto, policy, policylen, seq) @@ -1005,7 +1005,7 @@ pfkey_send_spddelete(so, src, prefs, dst, prefd, proto, policy, policylen, seq) * sending SADB_X_SPDDELETE message to the kernel. * OUT: * positive: success and return length sent. - * -1 : error occured, and set errno. + * -1 : error occurred, and set errno. */ int pfkey_send_spddelete2(so, spid) @@ -1024,7 +1024,7 @@ pfkey_send_spddelete2(so, spid) * sending SADB_X_SPDGET message to the kernel. * OUT: * positive: success and return length sent. - * -1 : error occured, and set errno. + * -1 : error occurred, and set errno. */ int pfkey_send_spdget(so, spid) @@ -1043,7 +1043,7 @@ pfkey_send_spdget(so, spid) * sending SADB_X_SPDSETIDX message to the kernel. * OUT: * positive: success and return length sent. - * -1 : error occured, and set errno. + * -1 : error occurred, and set errno. */ int pfkey_send_spdsetidx(so, src, prefs, dst, prefd, proto, policy, policylen, seq) @@ -1074,7 +1074,7 @@ pfkey_send_spdsetidx(so, src, prefs, dst, prefd, proto, policy, policylen, seq) * sending SADB_SPDFLUSH message to the kernel. * OUT: * positive: success and return length sent. - * -1 : error occured, and set errno. + * -1 : error occurred, and set errno. */ int pfkey_send_spdflush(so) @@ -1092,7 +1092,7 @@ pfkey_send_spdflush(so) * sending SADB_SPDDUMP message to the kernel. * OUT: * positive: success and return length sent. - * -1 : error occured, and set errno. + * -1 : error occurred, and set errno. */ int pfkey_send_spddump(so) @@ -1658,7 +1658,7 @@ pfkey_close(so) * receive sadb_msg data, and return pointer to new buffer allocated. * Must free this buffer later. * OUT: - * NULL : error occured. + * NULL : error occurred. * others : a pointer to sadb_msg structure. * * XXX should be rewritten to pass length explicitly diff --git a/stand/efi/include/efifs.h b/stand/efi/include/efifs.h index 58febb66eb75..76aa93d6d07f 100644 --- a/stand/efi/include/efifs.h +++ b/stand/efi/include/efifs.h @@ -29,7 +29,7 @@ Revision History // -// EFI Partition header (normaly starts in LBA 1) +// EFI Partition header (normally starts in LBA 1) // #define EFI_PARTITION_SIGNATURE 0x5053595320494249 diff --git a/sys/dev/ixl/ixl_pf_i2c.c b/sys/dev/ixl/ixl_pf_i2c.c index 9aea32bbe5ce..c69e2f8ac836 100644 --- a/sys/dev/ixl/ixl_pf_i2c.c +++ b/sys/dev/ixl/ixl_pf_i2c.c @@ -2,30 +2,30 @@ Copyright (c) 2013-2018, Intel Corporation All rights reserved. - - Redistribution and use in source and binary forms, with or without + + 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, + + 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 + + 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. - - 3. Neither the name of the Intel Corporation nor the names of its - contributors may be used to endorse or promote products derived from + + 3. Neither the name of the Intel Corporation nor the names of its + contributors may be used to endorse or promote products derived from this software without specific prior written permission. - + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 COPYRIGHT OWNER 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) + 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 COPYRIGHT OWNER 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. @@ -661,7 +661,7 @@ ixl_write_i2c_byte_reg(struct ixl_pf *pf, u8 byte_offset, reg |= (datai2c << I40E_GLGEN_I2CCMD_DATA_SHIFT); reg &= ~I40E_GLGEN_I2CCMD_OP_MASK; - /* Write command to registers controling I2C - data and address. */ + /* Write command to registers controlling I2C - data and address. */ wr32(hw, I40E_GLGEN_I2CCMD(hw->func_caps.mdio_port_num), reg); status = ixl_wait_for_i2c_completion(hw, hw->func_caps.mdio_port_num); diff --git a/sys/fs/nfsclient/nfs_clrpcops.c b/sys/fs/nfsclient/nfs_clrpcops.c index 527a47338b3f..7cd793502476 100644 --- a/sys/fs/nfsclient/nfs_clrpcops.c +++ b/sys/fs/nfsclient/nfs_clrpcops.c @@ -1872,7 +1872,7 @@ nfsrpc_writerpc(vnode_t vp, struct uio *uiop, int *iomode, if (nd->nd_repstat) { /* * In case the rpc gets retried, roll - * the uio fileds changed by nfsm_uiombuf() + * the uio fields changed by nfsm_uiombuf() * back. */ uiop->uio_offset -= len; @@ -6423,7 +6423,7 @@ nfsrpc_writeds(vnode_t vp, struct uio *uiop, int *iomode, int *must_commit, if (nd->nd_repstat != 0) { /* * In case the rpc gets retried, roll - * the uio fileds changed by nfsm_uiombuf() + * the uio fields changed by nfsm_uiombuf() * back. */ uiop->uio_offset -= len; diff --git a/sys/mips/ingenic/jz4780_regs.h b/sys/mips/ingenic/jz4780_regs.h index 221c21784925..c46045ae0e18 100644 --- a/sys/mips/ingenic/jz4780_regs.h +++ b/sys/mips/ingenic/jz4780_regs.h @@ -483,9 +483,9 @@ readreg(uint32_t reg) #define JZ_SMBFHCNT 0x1C /* Fast speed SMB SCL high count */ #define JZ_SMBFLCNT 0x20 /* Fast speed SMB SCL low count */ #define JZ_SMBINTST 0x2C /* SMB Interrupt Status */ - #define JZ_ISTT 0x400 /* START or RESTART occured */ - #define JZ_ISTP 0x200 /* STOP occured */ - #define JZ_TXABT 0x40 /* ABORT occured */ + #define JZ_ISTT 0x400 /* START or RESTART occurred */ + #define JZ_ISTP 0x200 /* STOP occurred */ + #define JZ_TXABT 0x40 /* ABORT occurred */ #define JZ_TXEMP 0x10 /* TX FIFO is low */ #define JZ_TXOF 0x08 /* TX FIFO is high */ #define JZ_RXFL 0x04 /* RX FIFO is at JZ_SMBRXTL*/ diff --git a/sys/net/if_pfsync.h b/sys/net/if_pfsync.h index f26a2ae34eed..ccd26c9ac0de 100644 --- a/sys/net/if_pfsync.h +++ b/sys/net/if_pfsync.h @@ -55,7 +55,7 @@ #define PFSYNC_ACT_CLR 0 /* clear all states */ #define PFSYNC_ACT_INS 1 /* insert state */ -#define PFSYNC_ACT_INS_ACK 2 /* ack of insterted state */ +#define PFSYNC_ACT_INS_ACK 2 /* ack of inserted state */ #define PFSYNC_ACT_UPD 3 /* update state */ #define PFSYNC_ACT_UPD_C 4 /* "compressed" update state */ #define PFSYNC_ACT_UPD_REQ 5 /* request "uncompressed" state */ diff --git a/sys/netinet/tcp_log_buf.h b/sys/netinet/tcp_log_buf.h index 436383124dce..bdd56c94587e 100644 --- a/sys/netinet/tcp_log_buf.h +++ b/sys/netinet/tcp_log_buf.h @@ -192,8 +192,8 @@ enum tcp_log_events { BBR_LOG_MSGSIZE, /* We received a EMSGSIZE error 19 */ BBR_LOG_BBRRTT, /* BBR RTT is updated 20 */ BBR_LOG_JUSTRET, /* We just returned out of output 21 */ - BBR_LOG_STATE, /* A BBR state change occured 22 */ - BBR_LOG_PKT_EPOCH, /* A BBR packet epoch occured 23 */ + BBR_LOG_STATE, /* A BBR state change occurred 22 */ + BBR_LOG_PKT_EPOCH, /* A BBR packet epoch occurred 23 */ BBR_LOG_PERSIST, /* BBR changed to/from a persists 24 */ TCP_LOG_FLOWEND, /* End of a flow 25 */ BBR_LOG_RTO, /* BBR's timeout includes BBR info 26 */ @@ -204,7 +204,7 @@ enum tcp_log_events { TCP_LOG_USERSEND, /* User level sends data 31 */ BBR_RSM_CLEARED, /* RSM cleared of ACK flags 32 */ BBR_LOG_STATE_TARGET, /* Log of target at state 33 */ - BBR_LOG_TIME_EPOCH, /* A timed based Epoch occured 34 */ + BBR_LOG_TIME_EPOCH, /* A timed based Epoch occurred 34 */ BBR_LOG_TO_PROCESS, /* A to was processed 35 */ BBR_LOG_BBRTSO, /* TSO update 36 */ BBR_LOG_HPTSDIAG, /* Hpts diag insert 37 */ diff --git a/sys/netinet/tcp_stacks/bbr.c b/sys/netinet/tcp_stacks/bbr.c index d57dd03ec4ec..f9535935a9db 100644 --- a/sys/netinet/tcp_stacks/bbr.c +++ b/sys/netinet/tcp_stacks/bbr.c @@ -3385,7 +3385,7 @@ bbr_get_bw_delay_prod(uint64_t rtt, uint64_t bw) { /* * Calculate the bytes in flight needed given the bw (in bytes per * second) and the specifyed rtt in useconds. We need to put out the - * returned value per RTT to match that rate. Gain will normaly + * returned value per RTT to match that rate. Gain will normally * raise it up from there. * * This should not overflow as long as the bandwidth is below 1 @@ -10667,7 +10667,7 @@ bbr_set_probebw_gains(struct tcp_bbr *bbr, uint32_t cts, uint32_t losses) } /** * We fall through and return always one of two things has - * occured. + * occurred. * 1) We are still not at target * * 2) We reached the target and set rc_bbr_state_atflight @@ -11157,7 +11157,7 @@ static void bbr_state_change(struct tcp_bbr *bbr, uint32_t cts, int32_t epoch, int32_t pkt_epoch, uint32_t losses) { /* - * A tick occured in the rtt epoch do we need to do anything? + * A tick occurred in the rtt epoch do we need to do anything? */ #ifdef BBR_INVARIANTS if ((bbr->rc_bbr_state != BBR_STATE_STARTUP) && @@ -11305,7 +11305,7 @@ bbr_state_change(struct tcp_bbr *bbr, uint32_t cts, int32_t epoch, int32_t pkt_e bbr->r_ctl.rc_bbr_enters_probertt = 1; if (bbr->rc_use_google == 0) { /* - * Restore any lowering that as occured to + * Restore any lowering that as occurred to * reach here */ if (bbr->r_ctl.bbr_rttprobe_gain_val) diff --git a/sys/netinet/tcp_stacks/rack.c b/sys/netinet/tcp_stacks/rack.c index f5b0de7cbc59..5bea540c6ab6 100644 --- a/sys/netinet/tcp_stacks/rack.c +++ b/sys/netinet/tcp_stacks/rack.c @@ -14058,7 +14058,7 @@ enobufs: } else if ((slot == 0) && (sendalot == 0) && tot_len_this_send) { /* * Get our pacing rate, if an error - * occured in sending (ENOBUF) we would + * occurred in sending (ENOBUF) we would * hit the else if with slot preset. Other * errors return. */ diff --git a/sys/netinet/tcp_stacks/tcp_rack.h b/sys/netinet/tcp_stacks/tcp_rack.h index c45b7c75cd56..04c5c4940e10 100644 --- a/sys/netinet/tcp_stacks/tcp_rack.h +++ b/sys/netinet/tcp_stacks/tcp_rack.h @@ -29,7 +29,7 @@ #define _NETINET_TCP_RACK_H_ #define RACK_ACKED 0x0001/* The remote endpoint acked this */ -#define RACK_TO_MIXED 0x0002/* A timeout occured that mixed the send order - not used */ +#define RACK_TO_MIXED 0x0002/* A timeout occurred that mixed the send order - not used */ #define RACK_DEFERRED 0x0004/* We can't use this for RTT calc - not used */ #define RACK_OVERMAX 0x0008/* We have more retran's then we can fit */ #define RACK_SACK_PASSED 0x0010/* A sack was done above this block */ diff --git a/tools/test/stress2/misc/nullfs17.sh b/tools/test/stress2/misc/nullfs17.sh index 121225f67c00..c7e447117969 100755 --- a/tools/test/stress2/misc/nullfs17.sh +++ b/tools/test/stress2/misc/nullfs17.sh @@ -29,7 +29,7 @@ # Variation of nullfs.sh # "panic: LK_RETRY set with incompatible flags (0x202400) or -# an error occured (11)" seen. +# an error occurred (11)" seen. # https://people.freebsd.org/~pho/stress/log/matt001.txt [ `id -u ` -ne 0 ] && echo "Must be root!" && exit 1 diff --git a/usr.bin/ar/write.c b/usr.bin/ar/write.c index 24bac2f25b92..6ca20a372fdb 100644 --- a/usr.bin/ar/write.c +++ b/usr.bin/ar/write.c @@ -175,7 +175,7 @@ create_obj_from_file(struct bsdar *bsdar, const char *name, time_t mtime) /* * When option '-D' is specified, mtime and UID / GID from the file - * will be replaced with 0, and file mode with 644. This ensures that + * will be replaced with 0, and file mode with 644. This ensures that * checksums will match for two archives containing the exact same * files. */ @@ -645,7 +645,7 @@ write_objs(struct bsdar *bsdar) /* * Archive string table is padded by a "\n" as the normal members. * The difference is that the size of archive string table counts - * in the pad bit, while normal members' size fileds do not. + * in the pad bit, while normal members' size fields do not. */ if (bsdar->as != NULL && bsdar->as_sz % 2 != 0) bsdar->as[bsdar->as_sz++] = '\n'; diff --git a/usr.bin/fmt/fmt.c b/usr.bin/fmt/fmt.c index be196c26977a..967de1309e9e 100644 --- a/usr.bin/fmt/fmt.c +++ b/usr.bin/fmt/fmt.c @@ -624,7 +624,7 @@ output_word(size_t indent0, size_t indent1, const wchar_t *word, size_t length, if (new_x <= goal_length) { /* * After adding the word we still aren't at the goal length, - * so clearly we add it to the buffer rather than outputing + * so clearly we add it to the buffer rather than outputting * it. */ wmemset(output_buffer + output_buffer_length, L' ', From owner-dev-commits-src-main@freebsd.org Sat Mar 13 17:38: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 712F557D5D5; Sat, 13 Mar 2021 17:38:17 +0000 (UTC) (envelope-from tijl@freebsd.org) Received: from mailrelay213.isp.belgacom.be (mailrelay213.isp.belgacom.be [195.238.22.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "relay.skynet.be", Issuer "GlobalSign RSA OV SSL CA 2018" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DyVJm6Gj7z57pR; Sat, 13 Mar 2021 17:38:16 +0000 (UTC) (envelope-from tijl@freebsd.org) IronPort-SDR: 8x4W9c24hjdW4vjtyJ7QY9JXx5Qny87QoN24bLLq1wEOyX/CVU0+W3iikNhnmQJ3tY3Z1zn0lA R8DiUkQpy/vdN8GKFgh5DOuc70GQEUvFtbAURYqm8tdX+0jQ54N3NZzb/H3B1T1ns2TqTpv1x8 +gfmjyk23BC5lvDkOFhA66cMGTzj8yQKSJ0tU9ZXkl0eBd3bpBM1xAnUDzOezcudLH8YIq5WyG FHPCv0cRR10m6W5ygMrOvUPHva49U16bXtHVD63CH2KqeVHF7OZXgZTEs6ZXDCon56+eElXHDr QxA= X-IPAS-Result: =?us-ascii?q?A2BEDACF90xg/wSs8lFaHAEBAQEBAQcBARIBAQQEAQFAB?= =?us-ascii?q?4FIAoMKFVYBUBqNRYYoghgDNwGKcIl8hUmBaAsBAQEBAQEBAQEzCgQBAYRNA?= =?us-ascii?q?oF1JjgTAgMBAQEDAgMBAQEBBgEBAQEBAQUEAYYYOQ1DARABBAGBXiKDawEFO?= =?us-ascii?q?j8QCw4KFRlXBhOCcYMLC6xJgTSJX4EJgTkBjUJCggyDdzU+gVF4FwQWgQCBB?= =?us-ascii?q?oU3BIIEQgGBDxMYXS8PaQEFPZBHE4xlml+CCYMMiUqHD4tWMYR2nx8thhKaB?= =?us-ascii?q?ZIthmuBek0wCIMkCUcZDY4oAxYUgweFRoVGQAMvCy0CBgoBAQMJgxWHY4NxA?= =?us-ascii?q?QE?= IronPort-PHdr: A9a23:vZAzfR/2xHjPev9uWQu7ngc9DhMPi/DPJgcQr6AfoPdwSMyLwZ3uM QTl6Ol3ixeRBMOHsqMC0rCK+PC/EUU7or+5+EgYd5JNUxJXwe43pCcHRPC/NEvgMfTxZDY7F skRHHVs/nW8LFQHUJ2mPw6arXK99yMdFQviPgRpOOv1BpTSj8Oq3Oyu5pHfeQpFiCe5bL9oM Rm6swrcusYVjIZgN6081gbHrnxUdupM2GhmP0iTnxHy5sex+J5s7SFdsO8/+sBDTKv3Yb02Q aRXAzo6PW814tbrtQTYQguU+nQcSGQWnQFWDAXD8Rr3Q43+sir+tup6xSmaIcj7Rq06VDi+8 6tmTgLjhSEaPDA77W7XkNR9gqxbrhy/uhJxwIzbYI+aO/Vica3QZs8aSGhbU8pNSyBNHp2wY o0SBOQBJ+ZYqIz9qkMQoxm7AQmnGf3iyjhPhn/tw6I61v4uEQfd3Ac9GN8OrHXUrNfxNKoJU e611rfHwiveYv1L1znx8o/IcgouofyVW797bMXex1U1GQzfklWQtZLqPymT1ukVrWWW6/dtW OyrhmM7qAx8rCSiytkyh4TKm48Z1FTJ+CF4zYsoONC1VkB1bNGqHZZUuC+XKpd6TMwjTmx1u Ss0xLsLsoO1cigNzZQo3R/fa/qffoiG+BLsSvieLixjhH14Yr6/gAyy8Uemx+bhVce0yE5Ho ylYntXWqHwA2ALf5tKaRvZ/4EutwzmC2gbO4e9eO080j7DUK5s5z741kZocrFrMEzftmEXzk K+WbkIk+vW06+j/YrXpuJucN4hshwH9KKsuns2/AeEmPQgUWGiX4/i81Lzh/U39WrlFkvo2k q7CsJ/EIMQUvKi5AxRP3oYk8Ra/AC+q0NUenXYZMFJIYBGKg5XzN13QL/30E+2zj0munTt13 fzLMaXtApDXIXjClLfhc6x960lZyAcr0dBf5pBUCrUaLfL9QE/+qsLXAQQiMwOp2ernD8991 owGVWKVHqCZKL/SsUOP5u83PuaDepEVtC/hJPgi4v7uiH45mUMGfaWwxpsXcmy3Eu1jI0qDY HrshMwMEWkQvgUgUuPlk0aCXiNJa3a1RaI86SkxCJi6AofbWoCtnLuB0T+mEZJIeGBKE0yDE XDtd4WBWvcMdDmSLtZ6kjweSbetUpUu1RWqtALhxbpnNPTb9TMDupL4ydd5/erTlQs99TZsF cSSz3mNT31onmMPXzI2x7p/rlBkxlif1qh4hvlYFd1P5/NVTAg6L4Xcwvd0C9DoRA3OYMyGS E27Tdm8BjExVN0xyccUY0lhA9WikgzD3y2yDrAIlryLAYc58qzG33fvOcly0G3G27Q7g1khW MtPOj7uuqkq2wnWBpLTgg2wkaqwdK9UiCLM8U+t12eDlnp0FglqXvOWc2oYYx7qStCxzUTFV LKrALI8el9dyMyGAoVQZ9DDtnkAQ+3sboeNK1mtknu9UE7bjoiHa5DnLj114Q== IronPort-HdrOrdr: A9a23:UJv61Ky7/1mA43TZH/qkKrPwqL1zdoIgy1knxilNYDZSddGVkN 3roeQD2XbP+VAscVwDufTFAqmPRnvA6YV4iLN7AZ6OVBTr0VHHEKhM9o3nqgeMJwTa9vRBkY dMGpIOa+HYKFhhkILH5xOlGMwr29mN/MmT5Nv261dIYUVUZ7p77wF/Yzz6LmRTSBNdDZQ0UL qwj/A3wAaIQngcYsSlCnRtZYGqzeHjro7sYhINGncchzWmsDXA0tLHOind9C03FxlIxa4m+W jDjhaR3NTAj9iLjiXy80WW1YlfktmJ8KonOOWczssSIVzX+2KVWLg= X-IronPort-Anti-Spam-Filtered: true Received: from 4.172-242-81.adsl-dyn.isp.belgacom.be (HELO kalimero.tijl.coosemans.org) ([81.242.172.4]) by relay.proximus.be with ESMTP; 13 Mar 2021 18:38:14 +0100 Received: from localhost (localhost [127.0.0.1]) by kalimero.tijl.coosemans.org (8.16.1/8.16.1) with ESMTP id 12DHcDZl005701; Sat, 13 Mar 2021 18:38:13 +0100 (CET) (envelope-from tijl@FreeBSD.org) Date: Sat, 13 Mar 2021 18:38:12 +0100 From: =?UTF-8?B?VMSzbA==?= Coosemans To: Dimitry Andric Cc: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: Re: git: 9097e3cbcac4 - main - Partially revert libcxxrt changes to avoid _Unwind_Exception change Message-ID: <20210313183812.77b74819@FreeBSD.org> In-Reply-To: <202103131354.12DDsnKR065154@gitrepo.freebsd.org> References: <202103131354.12DDsnKR065154@gitrepo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4DyVJm6Gj7z57pR 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: Sat, 13 Mar 2021 17:38:17 -0000 On Sat, 13 Mar 2021 13:54:49 GMT Dimitry Andric wrote: > The branch main has been updated by dim: > > URL: https://cgit.FreeBSD.org/src/commit/?id=9097e3cbcac455eb0dedd097d8d5548c72568d0a > > commit 9097e3cbcac455eb0dedd097d8d5548c72568d0a > Author: Dimitry Andric > AuthorDate: 2021-03-13 13:54:24 +0000 > Commit: Dimitry Andric > CommitDate: 2021-03-13 13:54:24 +0000 > > Partially revert libcxxrt changes to avoid _Unwind_Exception change > > (Note I am also applying this to main and stable/13, to restore the old > libcxxrt ABI and to avoid having to maintain a compat library.) > > After the recent cherry-picking of libcxxrt commits 0ee0dbfb0d26 and > d2b3fadf2db5, users reported that editors/libreoffice packages from the > official package builders did not start anymore. It turns out that the > combination of these commits subtly changes the ABI, requiring all > applications that depend on internal details of struct _Unwind_Exception > (available via unwind-arm.h and unwind-itanium.h) to be recompiled. > > However, the FreeBSD package builders always use -RELEASE jails, so > these still use the old declaration of struct _Unwind_Exception, which > is not entirely compatible. In particular, LibreOffice uses this struct > in its internal "uno bridge" component, where it attempts to setup its > own exception handling mechanism. > > To fix this incompatibility, go back to the old declarations of struct > _Unwind_Exception, and restore the __LP64__ specific workaround we had > in place before (which was to cope with yet another, older ABI bug). > > Effectively, this reverts upstream libcxxrt commits 88bdf6b290da > ("Specify double-word alignment for ARM unwind") and b96169641f79 > ("Updated Itanium unwind"), and reapplies our commit 3c4fd2463bb2 > ("libcxxrt: add padding in __cxa_allocate_* to fix alignment"). > > PR: 253840 > --- > contrib/libcxxrt/exception.cc | 30 ++++++++++++++++++++++++------ > contrib/libcxxrt/unwind-arm.h | 2 +- > contrib/libcxxrt/unwind-itanium.h | 9 +++------ > 3 files changed, 28 insertions(+), 13 deletions(-) > > diff --git a/contrib/libcxxrt/exception.cc b/contrib/libcxxrt/exception.cc > index 0fb26ddb4ed2..0de878e9e6db 100644 > --- a/contrib/libcxxrt/exception.cc > +++ b/contrib/libcxxrt/exception.cc > @@ -572,6 +572,19 @@ static void free_exception(char *e) > } > } > > +#ifdef __LP64__ > +/** > + * There's an ABI bug in __cxa_exception: unwindHeader requires 16-byte > + * alignment but it was broken by the addition of the referenceCount. > + * The unwindHeader is at offset 0x58 in __cxa_exception. In order to keep > + * compatibility with consumers of the broken __cxa_exception, explicitly add > + * padding on allocation (and account for it on free). > + */ > +static const int exception_alignment_padding = 8; > +#else > +static const int exception_alignment_padding = 0; > +#endif > + > /** > * Allocates an exception structure. Returns a pointer to the space that can > * be used to store an object of thrown_size bytes. This function will use an > @@ -580,16 +593,19 @@ static void free_exception(char *e) > */ > extern "C" void *__cxa_allocate_exception(size_t thrown_size) > { > - size_t size = thrown_size + sizeof(__cxa_exception); > + size_t size = exception_alignment_padding + sizeof(__cxa_exception) + > + thrown_size; > char *buffer = alloc_or_die(size); > - return buffer+sizeof(__cxa_exception); > + return buffer + exception_alignment_padding + sizeof(__cxa_exception); > } > > extern "C" void *__cxa_allocate_dependent_exception(void) > { > - size_t size = sizeof(__cxa_dependent_exception); > + size_t size = exception_alignment_padding + > + sizeof(__cxa_dependent_exception); > char *buffer = alloc_or_die(size); > - return buffer+sizeof(__cxa_dependent_exception); > + return buffer + exception_alignment_padding + > + sizeof(__cxa_dependent_exception); > } > > /** > @@ -617,7 +633,8 @@ extern "C" void __cxa_free_exception(void *thrown_exception) > } > } > > - free_exception(reinterpret_cast(ex)); > + free_exception(reinterpret_cast(ex) - > + exception_alignment_padding); > } > > static void releaseException(__cxa_exception *exception) > @@ -644,7 +661,8 @@ void __cxa_free_dependent_exception(void *thrown_exception) > { > releaseException(realExceptionFromException(reinterpret_cast<__cxa_exception*>(ex))); > } > - free_exception(reinterpret_cast(ex)); > + free_exception(reinterpret_cast(ex) - > + exception_alignment_padding); > } > > /** > diff --git a/contrib/libcxxrt/unwind-arm.h b/contrib/libcxxrt/unwind-arm.h > index ec81237e573b..6eb9d9e45981 100644 > --- a/contrib/libcxxrt/unwind-arm.h > +++ b/contrib/libcxxrt/unwind-arm.h > @@ -97,7 +97,7 @@ struct _Unwind_Exception > } pr_cache; > /** Force alignment of next item to 8-byte boundary */ > long long int :0; > -} __attribute__((__aligned__(8))); > +}; > > /* Unwinding functions */ > _Unwind_Reason_Code _Unwind_RaiseException(struct _Unwind_Exception *ucbp); > diff --git a/contrib/libcxxrt/unwind-itanium.h b/contrib/libcxxrt/unwind-itanium.h > index 199d91de283d..1ee0cf0e81c4 100644 > --- a/contrib/libcxxrt/unwind-itanium.h > +++ b/contrib/libcxxrt/unwind-itanium.h > @@ -79,12 +79,9 @@ struct _Unwind_Exception > { > uint64_t exception_class; > _Unwind_Exception_Cleanup_Fn exception_cleanup; > - uintptr_t private_1; > - uintptr_t private_2; > -#if __SIZEOF_POINTER__ == 4 > - uint32_t reserved[3]; > -#endif > - } __attribute__((__aligned__)); > + unsigned long private_1; > + unsigned long private_2; > + } ; Shouldn't these definitions be the same as the ones in GCC? From owner-dev-commits-src-main@freebsd.org Sat Mar 13 18:32: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 EF73A57ED25; Sat, 13 Mar 2021 18:32: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 4DyWWV6SL0z3Cb8; Sat, 13 Mar 2021 18:32: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 D0A0A7635; Sat, 13 Mar 2021 18:32: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 12DIWc8l034222; Sat, 13 Mar 2021 18:32:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 12DIWcZi034221; Sat, 13 Mar 2021 18:32:38 GMT (envelope-from git) Date: Sat, 13 Mar 2021 18:32:38 GMT Message-Id: <202103131832.12DIWcZi034221@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: a9275d996c22 - main - ls(1): Refine the HISTORY within the manual page. 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: a9275d996c229a30879baa42a6d02d24663ac43b 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, 13 Mar 2021 18:32:39 -0000 The branch main has been updated by gbe (doc committer): URL: https://cgit.FreeBSD.org/src/commit/?id=a9275d996c229a30879baa42a6d02d24663ac43b commit a9275d996c229a30879baa42a6d02d24663ac43b Author: Gordon Bergling AuthorDate: 2021-03-13 18:28:26 +0000 Commit: Gordon Bergling CommitDate: 2021-03-13 18:28:26 +0000 ls(1): Refine the HISTORY within the manual page. A simple find command appeared in Version 1 AT&T UNIX and was removed in Version 3 AT&T UNIX. It was rewritten for Version 5 AT&T UNIX and later be enhanced for the Programmer's Workbench (PWB). These changes were later incorporated in AT&T UNIX v7. Reviewed by: imp MFC after: 1 week --- usr.bin/find/find.1 | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/usr.bin/find/find.1 b/usr.bin/find/find.1 index 43b1262352a6..0c5c113479a3 100644 --- a/usr.bin/find/find.1 +++ b/usr.bin/find/find.1 @@ -31,7 +31,7 @@ .\" @(#)find.1 8.7 (Berkeley) 5/9/95 .\" $FreeBSD$ .\" -.Dd February 23, 2021 +.Dd March 13, 2021 .Dt FIND 1 .Os .Sh NAME @@ -1071,10 +1071,17 @@ and .Xr sed 1 options. .Sh HISTORY -A +A simple .Nm command appeared in -.At v1 . +.At v1 +and was removed in +.At v3 . +It was rewritten for +.At v5 +and later be enhanced for the Programmer's Workbench (PWB). +These changes were later incorporated in +.At v7. .Sh BUGS The special characters used by .Nm From owner-dev-commits-src-main@freebsd.org Sat Mar 13 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 3F07A57EF0A; Sat, 13 Mar 2021 18:36:52 +0000 (UTC) (envelope-from gbe@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 4DyWcN1L4Zz3DBR; Sat, 13 Mar 2021 18:36:52 +0000 (UTC) (envelope-from gbe@freebsd.org) Received: from localhost (p200300d5d740b96020afcfec3802e2f2.dip0.t-ipconnect.de [IPv6:2003:d5:d740:b960:20af:cfec:3802:e2f2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: gbe) by smtp.freebsd.org (Postfix) with ESMTPSA id BBC2B6416; Sat, 13 Mar 2021 18:36:51 +0000 (UTC) (envelope-from gbe@freebsd.org) Date: Sat, 13 Mar 2021 19:36:50 +0100 From: Gordon Bergling To: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: a9275d996c22 - main - ls(1): Refine the HISTORY within the manual page. Message-ID: References: <202103131832.12DIWcZi034221@gitrepo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <202103131832.12DIWcZi034221@gitrepo.freebsd.org> X-Url: X-Operating-System: FreeBSD 12.2-STABLE amd64 X-Host-Uptime: 7:34PM up 3 days, 23:56, 5 users, load averages: 0.37, 0.28, 0.20 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, 13 Mar 2021 18:36:52 -0000 Sorry, this has to be read as, find(1): Refine the HISTORY within the manual page. --Gordon On Sat, Mar 13, 2021 at 06:32:38PM +0000, Gordon Bergling wrote: > The branch main has been updated by gbe (doc committer): > > URL: https://cgit.FreeBSD.org/src/commit/?id=a9275d996c229a30879baa42a6d02d24663ac43b > > commit a9275d996c229a30879baa42a6d02d24663ac43b > Author: Gordon Bergling > AuthorDate: 2021-03-13 18:28:26 +0000 > Commit: Gordon Bergling > CommitDate: 2021-03-13 18:28:26 +0000 > > ls(1): Refine the HISTORY within the manual page. > > A simple find command appeared in Version 1 AT&T UNIX and was removed in > Version 3 AT&T UNIX. It was rewritten for Version 5 AT&T UNIX and later > be enhanced for the Programmer's Workbench (PWB). These changes were > later incorporated in AT&T UNIX v7. > > Reviewed by: imp > MFC after: 1 week > --- > usr.bin/find/find.1 | 13 ++++++++++--- > 1 file changed, 10 insertions(+), 3 deletions(-) > > diff --git a/usr.bin/find/find.1 b/usr.bin/find/find.1 > index 43b1262352a6..0c5c113479a3 100644 > --- a/usr.bin/find/find.1 > +++ b/usr.bin/find/find.1 > @@ -31,7 +31,7 @@ > .\" @(#)find.1 8.7 (Berkeley) 5/9/95 > .\" $FreeBSD$ > .\" > -.Dd February 23, 2021 > +.Dd March 13, 2021 > .Dt FIND 1 > .Os > .Sh NAME > @@ -1071,10 +1071,17 @@ and > .Xr sed 1 > options. > .Sh HISTORY > -A > +A simple > .Nm > command appeared in > -.At v1 . > +.At v1 > +and was removed in > +.At v3 . > +It was rewritten for > +.At v5 > +and later be enhanced for the Programmer's Workbench (PWB). > +These changes were later incorporated in > +.At v7. > .Sh BUGS > The special characters used by > .Nm > _______________________________________________ > 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 Sun Mar 14 00:15: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 CF26F568676; Sun, 14 Mar 2021 00:15:23 +0000 (UTC) (envelope-from dim@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 4Dyg6z5RzFz3sk9; Sun, 14 Mar 2021 00:15:23 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from tensor.andric.com (tensor.andric.com [87.251.56.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "tensor.andric.com", Issuer "R3" (verified OK)) (Authenticated sender: dim) by smtp.freebsd.org (Postfix) with ESMTPSA id 9522B88A1; Sun, 14 Mar 2021 00:15:23 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from [IPv6:2001:470:7a58:0:57d:7ad7:3c94:1ec3] (unknown [IPv6:2001:470:7a58:0:57d:7ad7:3c94:1ec3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id 10B643E7CC; Sun, 14 Mar 2021 01:15:21 +0100 (CET) From: Dimitry Andric Message-Id: Content-Type: multipart/signed; boundary="Apple-Mail=_A3542C0C-E7BF-4613-9BA6-36B2CE593D92"; protocol="application/pgp-signature"; micalg=pgp-sha1 Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.60.0.2.21\)) Subject: Re: git: 9097e3cbcac4 - main - Partially revert libcxxrt changes to avoid _Unwind_Exception change Date: Sun, 14 Mar 2021 01:15:11 +0100 In-Reply-To: <20210313183812.77b74819@FreeBSD.org> Cc: "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" To: =?utf-8?Q?T=C4=B3l_Coosemans?= References: <202103131354.12DDsnKR065154@gitrepo.freebsd.org> <20210313183812.77b74819@FreeBSD.org> X-Mailer: Apple Mail (2.3654.60.0.2.21) 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, 14 Mar 2021 00:15:23 -0000 --Apple-Mail=_A3542C0C-E7BF-4613-9BA6-36B2CE593D92 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 On 13 Mar 2021, at 18:38, T=C4=B3l Coosemans wrote: >=20 > On Sat, 13 Mar 2021 13:54:49 GMT Dimitry Andric = wrote: >> The branch main has been updated by dim: >>=20 >> URL: = https://cgit.FreeBSD.org/src/commit/?id=3D9097e3cbcac455eb0dedd097d8d5548c= 72568d0a >>=20 >> commit 9097e3cbcac455eb0dedd097d8d5548c72568d0a >> Author: Dimitry Andric >> AuthorDate: 2021-03-13 13:54:24 +0000 >> Commit: Dimitry Andric >> CommitDate: 2021-03-13 13:54:24 +0000 >>=20 >> Partially revert libcxxrt changes to avoid _Unwind_Exception = change ... >> --- a/contrib/libcxxrt/unwind-itanium.h >> +++ b/contrib/libcxxrt/unwind-itanium.h >> @@ -79,12 +79,9 @@ struct _Unwind_Exception >> { >> uint64_t exception_class; >> _Unwind_Exception_Cleanup_Fn exception_cleanup; >> - uintptr_t private_1; >> - uintptr_t private_2; >> -#if __SIZEOF_POINTER__ =3D=3D 4 >> - uint32_t reserved[3]; >> -#endif >> - } __attribute__((__aligned__)); >> + unsigned long private_1; >> + unsigned long private_2; >> + } ; >=20 > Shouldn't these definitions be the same as the ones in GCC? If you want to keep the ABI compatible with what it was, no. Otherwise, = you could consider it. But for what gain? -Dimitry --Apple-Mail=_A3542C0C-E7BF-4613-9BA6-36B2CE593D92 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.2 iF0EARECAB0WIQR6tGLSzjX8bUI5T82wXqMKLiCWowUCYE1VjwAKCRCwXqMKLiCW oxCsAKDfhglHmT2HK4yRHyDVK+2BULydnACfZDbJyxWu/MG/O2RUPa0VNoRBhKo= =jJXN -----END PGP SIGNATURE----- --Apple-Mail=_A3542C0C-E7BF-4613-9BA6-36B2CE593D92-- From owner-dev-commits-src-main@freebsd.org Sun Mar 14 01:38: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 6E99056DB8D; Sun, 14 Mar 2021 01:38: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 4Dyhyt2lHfz4Tjg; Sun, 14 Mar 2021 01:38: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 50D41150E8; Sun, 14 Mar 2021 01:38: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 12E1cUqh088128; Sun, 14 Mar 2021 01:38:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 12E1cUAJ088126; Sun, 14 Mar 2021 01:38:30 GMT (envelope-from git) Date: Sun, 14 Mar 2021 01:38:30 GMT Message-Id: <202103140138.12E1cUAJ088126@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Martin Matuska Subject: git: 9db44a8e5da9 - main - zfs: merge OpenZFS master-9305ff2ed MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mm X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9db44a8e5da9bf1ce6dd1c0f1468ddafed6d6c91 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, 14 Mar 2021 01:38:30 -0000 The branch main has been updated by mm: URL: https://cgit.FreeBSD.org/src/commit/?id=9db44a8e5da9bf1ce6dd1c0f1468ddafed6d6c91 commit 9db44a8e5da9bf1ce6dd1c0f1468ddafed6d6c91 Merge: a9275d996c22 9162a1ce3ae9 Author: Martin Matuska AuthorDate: 2021-03-14 01:23:51 +0000 Commit: Martin Matuska CommitDate: 2021-03-14 01:32:14 +0000 zfs: merge OpenZFS master-9305ff2ed Notable upstream pull request merges: #11153 Scalable teardown lock for FreeBSD #11651 Don't bomb out when using keylocation=file:// #11667 zvol: call zil_replaying() during replay #11683 abd_get_offset_struct() may allocate new abd #11693 Intentionally allow ZFS_READONLY in zfs_write #11716 zpool import cachefile improvements #11720 FreeBSD: Clean up zfsdev_close to match Linux #11730 FreeBSD: bring back possibility to rewind the checkpoint from bootloader Obtained from: OpenZFS MFC after: 2 weeks .../openzfs/.github/workflows/checkstyle.yaml | 2 +- sys/contrib/openzfs/cmd/vdev_id/vdev_id | 9 +- sys/contrib/openzfs/cmd/zpool/zpool_main.c | 307 +++++++++++++-------- sys/contrib/openzfs/cmd/zstream/zstream_redup.c | 1 + sys/contrib/openzfs/config/zfs-build.m4 | 36 +++ sys/contrib/openzfs/configure.ac | 1 + .../openzfs/include/os/freebsd/spl/sys/Makefile.am | 3 + .../openzfs/include/os/freebsd/spl/sys/debug.h | 80 +++--- .../include/os/freebsd/zfs/sys/zfs_vfsops_os.h | 2 +- .../openzfs/include/os/linux/spl/sys/debug.h | 78 +++--- .../include/os/linux/zfs/sys/zfs_vfsops_os.h | 33 +++ .../include/os/linux/zfs/sys/zfs_znode_impl.h | 4 +- sys/contrib/openzfs/include/sys/dmu_redact.h | 2 + sys/contrib/openzfs/include/sys/zfs_ioctl.h | 1 - sys/contrib/openzfs/lib/libzfs/libzfs_crypto.c | 10 +- sys/contrib/openzfs/lib/libzfs/libzfs_mount.c | 25 +- .../openzfs/lib/libzfs/os/freebsd/libzfs_zmount.c | 5 +- .../openzfs/lib/libzfs/os/linux/libzfs_mount_os.c | 6 +- sys/contrib/openzfs/lib/libzutil/zutil_import.c | 177 +++++++++--- sys/contrib/openzfs/man/man8/zfs-receive.8 | 10 + sys/contrib/openzfs/man/man8/zfs-send.8 | 7 +- sys/contrib/openzfs/module/Makefile.in | 5 + .../openzfs/module/os/freebsd/zfs/kmod_core.c | 18 +- .../openzfs/module/os/freebsd/zfs/zfs_dir.c | 2 - .../openzfs/module/os/freebsd/zfs/zvol_os.c | 9 +- sys/contrib/openzfs/module/os/linux/zfs/zfs_acl.c | 26 +- .../openzfs/module/os/linux/zfs/zio_crypt.c | 1 + sys/contrib/openzfs/module/os/linux/zfs/zvol_os.c | 102 +++++-- sys/contrib/openzfs/module/zcommon/zfs_prop.c | 2 +- sys/contrib/openzfs/module/zfs/abd.c | 6 +- sys/contrib/openzfs/module/zfs/spa_misc.c | 4 +- sys/contrib/openzfs/module/zfs/zfs_vnops.c | 6 +- sys/contrib/openzfs/module/zfs/zvol.c | 15 +- sys/contrib/openzfs/tests/runfiles/common.run | 1 + .../openzfs/tests/zfs-tests/include/commands.cfg | 2 +- .../openzfs/tests/zfs-tests/include/libtest.shlib | 19 +- .../openzfs/tests/zfs-tests/include/tunables.cfg | 8 +- .../functional/cli_root/zpool/zpool_002_pos.ksh | 37 ++- .../functional/cli_root/zpool/zpool_003_pos.ksh | 39 ++- .../functional/cli_root/zpool_import/Makefile.am | 1 + .../import_cachefile_paths_changed.ksh | 117 ++++++++ .../tests/functional/events/events_002_pos.ksh | 7 +- .../tests/functional/xattr/xattr_003_neg.ksh | 44 +-- sys/modules/zfs/zfs_config.h | 4 +- 44 files changed, 896 insertions(+), 378 deletions(-) diff --cc sys/contrib/openzfs/module/os/freebsd/zfs/zvol_os.c index 2389b1a06355,000000000000..ba315f104738 mode 100644,000000..100644 --- a/sys/contrib/openzfs/module/os/freebsd/zfs/zvol_os.c +++ b/sys/contrib/openzfs/module/os/freebsd/zfs/zvol_os.c @@@ -1,1525 -1,0 +1,1532 @@@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ +/* + * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. + * + * Copyright (c) 2006-2010 Pawel Jakub Dawidek + * All rights reserved. + * + * Portions Copyright 2010 Robert Milkowski + * + * Copyright 2011 Nexenta Systems, Inc. All rights reserved. + * Copyright (c) 2012, 2017 by Delphix. All rights reserved. + * Copyright (c) 2013, Joyent, Inc. All rights reserved. + * Copyright (c) 2014 Integros [integros.com] + */ + +/* Portions Copyright 2011 Martin Matuska */ + +/* + * ZFS volume emulation driver. + * + * Makes a DMU object look like a volume of arbitrary size, up to 2^64 bytes. + * Volumes are accessed through the symbolic links named: + * + * /dev/zvol// + * + * Volumes are persistent through reboot. No user command needs to be + * run before opening and using a device. + * + * On FreeBSD ZVOLs are simply GEOM providers like any other storage device + * in the system. Except when they're simply character devices (volmode=dev). + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include "zfs_namecheck.h" + +#define ZVOL_DUMPSIZE "dumpsize" + +#ifdef ZVOL_LOCK_DEBUG +#define ZVOL_RW_READER RW_WRITER +#define ZVOL_RW_READ_HELD RW_WRITE_HELD +#else +#define ZVOL_RW_READER RW_READER +#define ZVOL_RW_READ_HELD RW_READ_HELD +#endif + +enum zvol_geom_state { + ZVOL_GEOM_UNINIT, + ZVOL_GEOM_STOPPED, + ZVOL_GEOM_RUNNING, +}; + +struct zvol_state_os { +#define zso_dev _zso_state._zso_dev +#define zso_geom _zso_state._zso_geom + union { + /* volmode=dev */ + struct zvol_state_dev { + struct cdev *zsd_cdev; + uint64_t zsd_sync_cnt; + } _zso_dev; + + /* volmode=geom */ + struct zvol_state_geom { + struct g_provider *zsg_provider; + struct bio_queue_head zsg_queue; + struct mtx zsg_queue_mtx; + enum zvol_geom_state zsg_state; + } _zso_geom; + } _zso_state; + int zso_dying; +}; + +static uint32_t zvol_minors; + +SYSCTL_DECL(_vfs_zfs); +SYSCTL_NODE(_vfs_zfs, OID_AUTO, vol, CTLFLAG_RW, 0, "ZFS VOLUME"); +SYSCTL_INT(_vfs_zfs_vol, OID_AUTO, mode, CTLFLAG_RWTUN, &zvol_volmode, 0, + "Expose as GEOM providers (1), device files (2) or neither"); +static boolean_t zpool_on_zvol = B_FALSE; +SYSCTL_INT(_vfs_zfs_vol, OID_AUTO, recursive, CTLFLAG_RWTUN, &zpool_on_zvol, 0, + "Allow zpools to use zvols as vdevs (DANGEROUS)"); + +/* + * Toggle unmap functionality. + */ +boolean_t zvol_unmap_enabled = B_TRUE; + +SYSCTL_INT(_vfs_zfs_vol, OID_AUTO, unmap_enabled, CTLFLAG_RWTUN, + &zvol_unmap_enabled, 0, "Enable UNMAP functionality"); + +/* + * zvol maximum transfer in one DMU tx. + */ +int zvol_maxphys = DMU_MAX_ACCESS / 2; + +static void zvol_ensure_zilog(zvol_state_t *zv); + +static d_open_t zvol_cdev_open; +static d_close_t zvol_cdev_close; +static d_ioctl_t zvol_cdev_ioctl; +static d_read_t zvol_cdev_read; +static d_write_t zvol_cdev_write; +static d_strategy_t zvol_geom_bio_strategy; + +static struct cdevsw zvol_cdevsw = { + .d_name = "zvol", + .d_version = D_VERSION, + .d_flags = D_DISK | D_TRACKCLOSE, + .d_open = zvol_cdev_open, + .d_close = zvol_cdev_close, + .d_ioctl = zvol_cdev_ioctl, + .d_read = zvol_cdev_read, + .d_write = zvol_cdev_write, + .d_strategy = zvol_geom_bio_strategy, +}; + +extern uint_t zfs_geom_probe_vdev_key; + +struct g_class zfs_zvol_class = { + .name = "ZFS::ZVOL", + .version = G_VERSION, +}; + +DECLARE_GEOM_CLASS(zfs_zvol_class, zfs_zvol); + +static int zvol_geom_open(struct g_provider *pp, int flag, int count); +static int zvol_geom_close(struct g_provider *pp, int flag, int count); +static void zvol_geom_run(zvol_state_t *zv); +static void zvol_geom_destroy(zvol_state_t *zv); +static int zvol_geom_access(struct g_provider *pp, int acr, int acw, int ace); +static void zvol_geom_worker(void *arg); +static void zvol_geom_bio_start(struct bio *bp); +static int zvol_geom_bio_getattr(struct bio *bp); +/* static d_strategy_t zvol_geom_bio_strategy; (declared elsewhere) */ + +/* + * GEOM mode implementation + */ + +/*ARGSUSED*/ +static int +zvol_geom_open(struct g_provider *pp, int flag, int count) +{ + zvol_state_t *zv; + int err = 0; + boolean_t drop_suspend = B_FALSE; + boolean_t drop_namespace = B_FALSE; + + if (!zpool_on_zvol && tsd_get(zfs_geom_probe_vdev_key) != NULL) { + /* + * if zfs_geom_probe_vdev_key is set, that means that zfs is + * attempting to probe geom providers while looking for a + * replacement for a missing VDEV. In this case, the + * spa_namespace_lock will not be held, but it is still illegal + * to use a zvol as a vdev. Deadlocks can result if another + * thread has spa_namespace_lock + */ + return (SET_ERROR(EOPNOTSUPP)); + } + +retry: + rw_enter(&zvol_state_lock, ZVOL_RW_READER); + zv = pp->private; + if (zv == NULL) { + rw_exit(&zvol_state_lock); + err = SET_ERROR(ENXIO); + goto out_locked; + } + + if (zv->zv_open_count == 0 && !mutex_owned(&spa_namespace_lock)) { + /* + * We need to guarantee that the namespace lock is held + * to avoid spurious failures in zvol_first_open. + */ + drop_namespace = B_TRUE; + if (!mutex_tryenter(&spa_namespace_lock)) { + rw_exit(&zvol_state_lock); + mutex_enter(&spa_namespace_lock); + goto retry; + } + } + mutex_enter(&zv->zv_state_lock); + if (zv->zv_zso->zso_dying) { + rw_exit(&zvol_state_lock); + err = SET_ERROR(ENXIO); + goto out_zv_locked; + } + ASSERT3S(zv->zv_volmode, ==, ZFS_VOLMODE_GEOM); + + /* + * make sure zvol is not suspended during first open + * (hold zv_suspend_lock) and respect proper lock acquisition + * ordering - zv_suspend_lock before zv_state_lock + */ + if (zv->zv_open_count == 0) { + drop_suspend = B_TRUE; + if (!rw_tryenter(&zv->zv_suspend_lock, ZVOL_RW_READER)) { + mutex_exit(&zv->zv_state_lock); + rw_enter(&zv->zv_suspend_lock, ZVOL_RW_READER); + mutex_enter(&zv->zv_state_lock); + /* check to see if zv_suspend_lock is needed */ + if (zv->zv_open_count != 0) { + rw_exit(&zv->zv_suspend_lock); + drop_suspend = B_FALSE; + } + } + } + rw_exit(&zvol_state_lock); + + ASSERT(MUTEX_HELD(&zv->zv_state_lock)); + + if (zv->zv_open_count == 0) { + ASSERT(ZVOL_RW_READ_HELD(&zv->zv_suspend_lock)); + err = zvol_first_open(zv, !(flag & FWRITE)); + if (err) + goto out_zv_locked; + pp->mediasize = zv->zv_volsize; + pp->stripeoffset = 0; + pp->stripesize = zv->zv_volblocksize; + } + + /* + * Check for a bad on-disk format version now since we + * lied about owning the dataset readonly before. + */ + if ((flag & FWRITE) && ((zv->zv_flags & ZVOL_RDONLY) || + dmu_objset_incompatible_encryption_version(zv->zv_objset))) { + err = SET_ERROR(EROFS); + goto out_opened; + } + if (zv->zv_flags & ZVOL_EXCL) { + err = SET_ERROR(EBUSY); + goto out_opened; + } +#ifdef FEXCL + if (flag & FEXCL) { + if (zv->zv_open_count != 0) { + err = SET_ERROR(EBUSY); + goto out_opened; + } + zv->zv_flags |= ZVOL_EXCL; + } +#endif + + zv->zv_open_count += count; +out_opened: + if (zv->zv_open_count == 0) { + zvol_last_close(zv); + wakeup(zv); + } +out_zv_locked: + mutex_exit(&zv->zv_state_lock); +out_locked: + if (drop_namespace) + mutex_exit(&spa_namespace_lock); + if (drop_suspend) + rw_exit(&zv->zv_suspend_lock); + return (err); +} + +/*ARGSUSED*/ +static int +zvol_geom_close(struct g_provider *pp, int flag, int count) +{ + zvol_state_t *zv; + boolean_t drop_suspend = B_TRUE; + int new_open_count; + + rw_enter(&zvol_state_lock, ZVOL_RW_READER); + zv = pp->private; + if (zv == NULL) { + rw_exit(&zvol_state_lock); + return (SET_ERROR(ENXIO)); + } + + mutex_enter(&zv->zv_state_lock); + if (zv->zv_flags & ZVOL_EXCL) { + ASSERT3U(zv->zv_open_count, ==, 1); + zv->zv_flags &= ~ZVOL_EXCL; + } + + ASSERT3S(zv->zv_volmode, ==, ZFS_VOLMODE_GEOM); + + /* + * If the open count is zero, this is a spurious close. + * That indicates a bug in the kernel / DDI framework. + */ + ASSERT3U(zv->zv_open_count, >, 0); + + /* + * make sure zvol is not suspended during last close + * (hold zv_suspend_lock) and respect proper lock acquisition + * ordering - zv_suspend_lock before zv_state_lock + */ + new_open_count = zv->zv_open_count - count; + if (new_open_count == 0) { + if (!rw_tryenter(&zv->zv_suspend_lock, ZVOL_RW_READER)) { + mutex_exit(&zv->zv_state_lock); + rw_enter(&zv->zv_suspend_lock, ZVOL_RW_READER); + mutex_enter(&zv->zv_state_lock); + /* check to see if zv_suspend_lock is needed */ + new_open_count = zv->zv_open_count - count; + if (new_open_count != 0) { + rw_exit(&zv->zv_suspend_lock); + drop_suspend = B_FALSE; + } + } + } else { + drop_suspend = B_FALSE; + } + rw_exit(&zvol_state_lock); + + ASSERT(MUTEX_HELD(&zv->zv_state_lock)); + + /* + * You may get multiple opens, but only one close. + */ + zv->zv_open_count = new_open_count; + if (zv->zv_open_count == 0) { + ASSERT(ZVOL_RW_READ_HELD(&zv->zv_suspend_lock)); + zvol_last_close(zv); + wakeup(zv); + } + + mutex_exit(&zv->zv_state_lock); + + if (drop_suspend) + rw_exit(&zv->zv_suspend_lock); + return (0); +} + +static void +zvol_geom_run(zvol_state_t *zv) +{ + struct zvol_state_geom *zsg = &zv->zv_zso->zso_geom; + struct g_provider *pp = zsg->zsg_provider; + + ASSERT3S(zv->zv_volmode, ==, ZFS_VOLMODE_GEOM); + + g_error_provider(pp, 0); + + kproc_kthread_add(zvol_geom_worker, zv, &system_proc, NULL, 0, 0, + "zfskern", "zvol %s", pp->name + sizeof (ZVOL_DRIVER)); +} + +static void +zvol_geom_destroy(zvol_state_t *zv) +{ + struct zvol_state_geom *zsg = &zv->zv_zso->zso_geom; + struct g_provider *pp = zsg->zsg_provider; + + ASSERT3S(zv->zv_volmode, ==, ZFS_VOLMODE_GEOM); + + g_topology_assert(); + + mutex_enter(&zv->zv_state_lock); + VERIFY(zsg->zsg_state == ZVOL_GEOM_RUNNING); + mutex_exit(&zv->zv_state_lock); + zsg->zsg_provider = NULL; + g_wither_geom(pp->geom, ENXIO); +} + +void +zvol_wait_close(zvol_state_t *zv) +{ + + if (zv->zv_volmode != ZFS_VOLMODE_GEOM) + return; + mutex_enter(&zv->zv_state_lock); + zv->zv_zso->zso_dying = B_TRUE; + + if (zv->zv_open_count) + msleep(zv, &zv->zv_state_lock, + PRIBIO, "zvol:dying", 10*hz); + mutex_exit(&zv->zv_state_lock); +} + + +static int +zvol_geom_access(struct g_provider *pp, int acr, int acw, int ace) +{ + int count, error, flags; + + g_topology_assert(); + + /* + * To make it easier we expect either open or close, but not both + * at the same time. + */ + KASSERT((acr >= 0 && acw >= 0 && ace >= 0) || + (acr <= 0 && acw <= 0 && ace <= 0), + ("Unsupported access request to %s (acr=%d, acw=%d, ace=%d).", + pp->name, acr, acw, ace)); + + if (pp->private == NULL) { + if (acr <= 0 && acw <= 0 && ace <= 0) + return (0); + return (pp->error); + } + + /* + * We don't pass FEXCL flag to zvol_geom_open()/zvol_geom_close() if + * ace != 0, because GEOM already handles that and handles it a bit + * differently. GEOM allows for multiple read/exclusive consumers and + * ZFS allows only one exclusive consumer, no matter if it is reader or + * writer. I like better the way GEOM works so I'll leave it for GEOM + * to decide what to do. + */ + + count = acr + acw + ace; + if (count == 0) + return (0); + + flags = 0; + if (acr != 0 || ace != 0) + flags |= FREAD; + if (acw != 0) + flags |= FWRITE; + + g_topology_unlock(); + if (count > 0) + error = zvol_geom_open(pp, flags, count); + else + error = zvol_geom_close(pp, flags, -count); + g_topology_lock(); + return (error); +} + +static void +zvol_geom_worker(void *arg) +{ + zvol_state_t *zv = arg; + struct zvol_state_geom *zsg = &zv->zv_zso->zso_geom; + struct bio *bp; + + ASSERT3S(zv->zv_volmode, ==, ZFS_VOLMODE_GEOM); + + thread_lock(curthread); + sched_prio(curthread, PRIBIO); + thread_unlock(curthread); + + for (;;) { + mtx_lock(&zsg->zsg_queue_mtx); + bp = bioq_takefirst(&zsg->zsg_queue); + if (bp == NULL) { + if (zsg->zsg_state == ZVOL_GEOM_STOPPED) { + zsg->zsg_state = ZVOL_GEOM_RUNNING; + wakeup(&zsg->zsg_state); + mtx_unlock(&zsg->zsg_queue_mtx); + kthread_exit(); + } + msleep(&zsg->zsg_queue, &zsg->zsg_queue_mtx, + PRIBIO | PDROP, "zvol:io", 0); + continue; + } + mtx_unlock(&zsg->zsg_queue_mtx); + zvol_geom_bio_strategy(bp); + } +} + +static void +zvol_geom_bio_start(struct bio *bp) +{ + zvol_state_t *zv = bp->bio_to->private; + struct zvol_state_geom *zsg; + boolean_t first; + + if (zv == NULL) { + g_io_deliver(bp, ENXIO); + return; + } + if (bp->bio_cmd == BIO_GETATTR) { + if (zvol_geom_bio_getattr(bp)) + g_io_deliver(bp, EOPNOTSUPP); + return; + } + + if (!THREAD_CAN_SLEEP()) { + zsg = &zv->zv_zso->zso_geom; + mtx_lock(&zsg->zsg_queue_mtx); + first = (bioq_first(&zsg->zsg_queue) == NULL); + bioq_insert_tail(&zsg->zsg_queue, bp); + mtx_unlock(&zsg->zsg_queue_mtx); + if (first) + wakeup_one(&zsg->zsg_queue); + return; + } + + zvol_geom_bio_strategy(bp); +} + +static int +zvol_geom_bio_getattr(struct bio *bp) +{ + zvol_state_t *zv; + + zv = bp->bio_to->private; + ASSERT3P(zv, !=, NULL); + + spa_t *spa = dmu_objset_spa(zv->zv_objset); + uint64_t refd, avail, usedobjs, availobjs; + + if (g_handleattr_int(bp, "GEOM::candelete", 1)) + return (0); + if (strcmp(bp->bio_attribute, "blocksavail") == 0) { + dmu_objset_space(zv->zv_objset, &refd, &avail, + &usedobjs, &availobjs); + if (g_handleattr_off_t(bp, "blocksavail", avail / DEV_BSIZE)) + return (0); + } else if (strcmp(bp->bio_attribute, "blocksused") == 0) { + dmu_objset_space(zv->zv_objset, &refd, &avail, + &usedobjs, &availobjs); + if (g_handleattr_off_t(bp, "blocksused", refd / DEV_BSIZE)) + return (0); + } else if (strcmp(bp->bio_attribute, "poolblocksavail") == 0) { + avail = metaslab_class_get_space(spa_normal_class(spa)); + avail -= metaslab_class_get_alloc(spa_normal_class(spa)); + if (g_handleattr_off_t(bp, "poolblocksavail", + avail / DEV_BSIZE)) + return (0); + } else if (strcmp(bp->bio_attribute, "poolblocksused") == 0) { + refd = metaslab_class_get_alloc(spa_normal_class(spa)); + if (g_handleattr_off_t(bp, "poolblocksused", refd / DEV_BSIZE)) + return (0); + } + return (1); +} + +static void +zvol_geom_bio_strategy(struct bio *bp) +{ + zvol_state_t *zv; + uint64_t off, volsize; + size_t resid; + char *addr; + objset_t *os; + zfs_locked_range_t *lr; + int error = 0; + boolean_t doread = B_FALSE; + boolean_t is_dumpified; + boolean_t sync; + + if (bp->bio_to) + zv = bp->bio_to->private; + else + zv = bp->bio_dev->si_drv2; + + if (zv == NULL) { + error = SET_ERROR(ENXIO); + goto out; + } + + rw_enter(&zv->zv_suspend_lock, ZVOL_RW_READER); + + switch (bp->bio_cmd) { + case BIO_READ: + doread = B_TRUE; + break; + case BIO_WRITE: + case BIO_FLUSH: + case BIO_DELETE: + if (zv->zv_flags & ZVOL_RDONLY) { + error = SET_ERROR(EROFS); + goto resume; + } + zvol_ensure_zilog(zv); + if (bp->bio_cmd == BIO_FLUSH) + goto sync; + break; + default: + error = SET_ERROR(EOPNOTSUPP); + goto resume; + } + + off = bp->bio_offset; + volsize = zv->zv_volsize; + + os = zv->zv_objset; + ASSERT3P(os, !=, NULL); + + addr = bp->bio_data; + resid = bp->bio_length; + + if (resid > 0 && off >= volsize) { + error = SET_ERROR(EIO); + goto resume; + } + + is_dumpified = B_FALSE; + sync = !doread && !is_dumpified && + zv->zv_objset->os_sync == ZFS_SYNC_ALWAYS; + + /* + * There must be no buffer changes when doing a dmu_sync() because + * we can't change the data whilst calculating the checksum. + */ + lr = zfs_rangelock_enter(&zv->zv_rangelock, off, resid, + doread ? RL_READER : RL_WRITER); + + if (bp->bio_cmd == BIO_DELETE) { + dmu_tx_t *tx = dmu_tx_create(zv->zv_objset); + error = dmu_tx_assign(tx, TXG_WAIT); + if (error != 0) { + dmu_tx_abort(tx); + } else { + zvol_log_truncate(zv, tx, off, resid, sync); + dmu_tx_commit(tx); + error = dmu_free_long_range(zv->zv_objset, ZVOL_OBJ, + off, resid); + resid = 0; + } + goto unlock; + } + while (resid != 0 && off < volsize) { + size_t size = MIN(resid, zvol_maxphys); + if (doread) { + error = dmu_read(os, ZVOL_OBJ, off, size, addr, + DMU_READ_PREFETCH); + } else { + dmu_tx_t *tx = dmu_tx_create(os); + dmu_tx_hold_write_by_dnode(tx, zv->zv_dn, off, size); + error = dmu_tx_assign(tx, TXG_WAIT); + if (error) { + dmu_tx_abort(tx); + } else { + dmu_write(os, ZVOL_OBJ, off, size, addr, tx); + zvol_log_write(zv, tx, off, size, sync); + dmu_tx_commit(tx); + } + } + if (error) { + /* convert checksum errors into IO errors */ + if (error == ECKSUM) + error = SET_ERROR(EIO); + break; + } + off += size; + addr += size; + resid -= size; + } +unlock: + zfs_rangelock_exit(lr); + + bp->bio_completed = bp->bio_length - resid; + if (bp->bio_completed < bp->bio_length && off > volsize) + error = SET_ERROR(EINVAL); + + switch (bp->bio_cmd) { + case BIO_FLUSH: + break; + case BIO_READ: + dataset_kstats_update_read_kstats(&zv->zv_kstat, + bp->bio_completed); + break; + case BIO_WRITE: + dataset_kstats_update_write_kstats(&zv->zv_kstat, + bp->bio_completed); + break; + case BIO_DELETE: + break; + default: + break; + } + + if (sync) { +sync: + zil_commit(zv->zv_zilog, ZVOL_OBJ); + } +resume: + rw_exit(&zv->zv_suspend_lock); +out: + if (bp->bio_to) + g_io_deliver(bp, error); + else + biofinish(bp, NULL, error); +} + +/* + * Character device mode implementation + */ + +static int +zvol_cdev_read(struct cdev *dev, struct uio *uio_s, int ioflag) +{ + zvol_state_t *zv; + uint64_t volsize; + zfs_locked_range_t *lr; + int error = 0; + zfs_uio_t uio; + + zfs_uio_init(&uio, uio_s); + + zv = dev->si_drv2; + + volsize = zv->zv_volsize; + /* + * uio_loffset == volsize isn't an error as + * its required for EOF processing. + */ + if (zfs_uio_resid(&uio) > 0 && + (zfs_uio_offset(&uio) < 0 || zfs_uio_offset(&uio) > volsize)) + return (SET_ERROR(EIO)); + + lr = zfs_rangelock_enter(&zv->zv_rangelock, zfs_uio_offset(&uio), + zfs_uio_resid(&uio), RL_READER); + while (zfs_uio_resid(&uio) > 0 && zfs_uio_offset(&uio) < volsize) { + uint64_t bytes = MIN(zfs_uio_resid(&uio), DMU_MAX_ACCESS >> 1); + + /* don't read past the end */ + if (bytes > volsize - zfs_uio_offset(&uio)) + bytes = volsize - zfs_uio_offset(&uio); + + error = dmu_read_uio_dnode(zv->zv_dn, &uio, bytes); + if (error) { + /* convert checksum errors into IO errors */ + if (error == ECKSUM) + error = SET_ERROR(EIO); + break; + } + } + zfs_rangelock_exit(lr); + + return (error); +} + +static int +zvol_cdev_write(struct cdev *dev, struct uio *uio_s, int ioflag) +{ + zvol_state_t *zv; + uint64_t volsize; + zfs_locked_range_t *lr; + int error = 0; + boolean_t sync; + zfs_uio_t uio; + + zv = dev->si_drv2; + + volsize = zv->zv_volsize; + + zfs_uio_init(&uio, uio_s); + + if (zfs_uio_resid(&uio) > 0 && + (zfs_uio_offset(&uio) < 0 || zfs_uio_offset(&uio) > volsize)) + return (SET_ERROR(EIO)); + + sync = (ioflag & IO_SYNC) || + (zv->zv_objset->os_sync == ZFS_SYNC_ALWAYS); + + rw_enter(&zv->zv_suspend_lock, ZVOL_RW_READER); + zvol_ensure_zilog(zv); + + lr = zfs_rangelock_enter(&zv->zv_rangelock, zfs_uio_offset(&uio), + zfs_uio_resid(&uio), RL_WRITER); + while (zfs_uio_resid(&uio) > 0 && zfs_uio_offset(&uio) < volsize) { + uint64_t bytes = MIN(zfs_uio_resid(&uio), DMU_MAX_ACCESS >> 1); + uint64_t off = zfs_uio_offset(&uio); + dmu_tx_t *tx = dmu_tx_create(zv->zv_objset); + + if (bytes > volsize - off) /* don't write past the end */ + bytes = volsize - off; + + dmu_tx_hold_write_by_dnode(tx, zv->zv_dn, off, bytes); + error = dmu_tx_assign(tx, TXG_WAIT); + if (error) { + dmu_tx_abort(tx); + break; + } + error = dmu_write_uio_dnode(zv->zv_dn, &uio, bytes, tx); + if (error == 0) + zvol_log_write(zv, tx, off, bytes, sync); + dmu_tx_commit(tx); + + if (error) + break; + } + zfs_rangelock_exit(lr); + if (sync) + zil_commit(zv->zv_zilog, ZVOL_OBJ); + rw_exit(&zv->zv_suspend_lock); + return (error); +} + +static int +zvol_cdev_open(struct cdev *dev, int flags, int fmt, struct thread *td) +{ + zvol_state_t *zv; + struct zvol_state_dev *zsd; + int err = 0; + boolean_t drop_suspend = B_FALSE; + boolean_t drop_namespace = B_FALSE; + +retry: + rw_enter(&zvol_state_lock, ZVOL_RW_READER); + zv = dev->si_drv2; + if (zv == NULL) { + rw_exit(&zvol_state_lock); + err = SET_ERROR(ENXIO); + goto out_locked; + } + + if (zv->zv_open_count == 0 && !mutex_owned(&spa_namespace_lock)) { + /* + * We need to guarantee that the namespace lock is held + * to avoid spurious failures in zvol_first_open. + */ + drop_namespace = B_TRUE; + if (!mutex_tryenter(&spa_namespace_lock)) { + rw_exit(&zvol_state_lock); + mutex_enter(&spa_namespace_lock); + goto retry; + } + } + mutex_enter(&zv->zv_state_lock); + + ASSERT3S(zv->zv_volmode, ==, ZFS_VOLMODE_DEV); + + /* + * make sure zvol is not suspended during first open + * (hold zv_suspend_lock) and respect proper lock acquisition + * ordering - zv_suspend_lock before zv_state_lock + */ + if (zv->zv_open_count == 0) { + drop_suspend = B_TRUE; + if (!rw_tryenter(&zv->zv_suspend_lock, ZVOL_RW_READER)) { + mutex_exit(&zv->zv_state_lock); + rw_enter(&zv->zv_suspend_lock, ZVOL_RW_READER); + mutex_enter(&zv->zv_state_lock); + /* check to see if zv_suspend_lock is needed */ + if (zv->zv_open_count != 0) { + rw_exit(&zv->zv_suspend_lock); + drop_suspend = B_FALSE; + } + } + } + rw_exit(&zvol_state_lock); + + ASSERT(MUTEX_HELD(&zv->zv_state_lock)); + + if (zv->zv_open_count == 0) { + ASSERT(ZVOL_RW_READ_HELD(&zv->zv_suspend_lock)); + err = zvol_first_open(zv, !(flags & FWRITE)); + if (err) *** 1412 LINES SKIPPED *** From owner-dev-commits-src-main@freebsd.org Sun Mar 14 16:57: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 D67DE5ABFC1; Sun, 14 Mar 2021 16:57: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 4Dz5MX5jhNz4TjQ; Sun, 14 Mar 2021 16:57: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 B6E0020EB5; Sun, 14 Mar 2021 16:57: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 12EGvilu096825; Sun, 14 Mar 2021 16:57:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 12EGviQb096822; Sun, 14 Mar 2021 16:57:44 GMT (envelope-from git) Date: Sun, 14 Mar 2021 16:57:44 GMT Message-Id: <202103141657.12EGviQb096822@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dmitry Chagin Subject: git: 5224c2a3bc95 - main - Merge tcsh 6.22.03-ceccc7f MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dchagin X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5224c2a3bc95b431f729f3692f264395248d8acc 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, 14 Mar 2021 16:57:44 -0000 The branch main has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=5224c2a3bc95b431f729f3692f264395248d8acc commit 5224c2a3bc95b431f729f3692f264395248d8acc Merge: 9db44a8e5da9 1b174d6cdff5 Author: Dmitry Chagin AuthorDate: 2021-03-14 16:33:13 +0000 Commit: Dmitry Chagin CommitDate: 2021-03-14 16:33:13 +0000 Merge tcsh 6.22.03-ceccc7f PR: 252663 MFC after: 1 week contrib/tcsh/FAQ | 339 ++-- contrib/tcsh/Fixes | 23 + contrib/tcsh/Imakefile | 14 +- contrib/tcsh/Makefile.ADMIN | 24 + contrib/tcsh/Makefile.in | 11 +- contrib/tcsh/Makefile.std | 2 +- contrib/tcsh/Makefile.vms | 2 +- contrib/tcsh/README.md | 9 +- contrib/tcsh/configure | 3803 +++++++++++++++++++++++++------------------ contrib/tcsh/dot.login | 12 + contrib/tcsh/dot.tcshrc | 110 ++ contrib/tcsh/ed.chared.c | 18 +- contrib/tcsh/ed.inputl.c | 2 +- contrib/tcsh/ed.screen.c | 2 +- contrib/tcsh/ed.xmap.c | 2 +- contrib/tcsh/host.defs | 2 +- contrib/tcsh/patchlevel.h | 6 +- contrib/tcsh/sh.c | 17 +- contrib/tcsh/sh.dir.c | 41 +- contrib/tcsh/sh.dol.c | 132 +- contrib/tcsh/sh.exp.c | 2 +- contrib/tcsh/sh.func.c | 5 +- contrib/tcsh/sh.glob.c | 11 +- contrib/tcsh/sh.h | 6 +- contrib/tcsh/sh.hist.c | 10 +- contrib/tcsh/sh.lex.c | 47 +- contrib/tcsh/sh.misc.c | 21 +- contrib/tcsh/sh.set.c | 14 +- contrib/tcsh/tc.alloc.c | 10 + contrib/tcsh/tc.disc.c | 4 + contrib/tcsh/tc.os.c | 2 +- contrib/tcsh/tc.prompt.c | 2 +- contrib/tcsh/tcsh.man | 21 +- contrib/tcsh/tcsh.man.new | 64 +- contrib/tcsh/tw.parse.c | 4 +- 35 files changed, 2855 insertions(+), 1939 deletions(-) diff --cc contrib/tcsh/Makefile.ADMIN index 000000000000,5ad3bb8fb3c5..5ad3bb8fb3c5 mode 000000,100644..100644 --- a/contrib/tcsh/Makefile.ADMIN +++ b/contrib/tcsh/Makefile.ADMIN diff --cc contrib/tcsh/README.md index 58a30738daa6,000000000000..df6671b0316e mode 100644,000000..100644 --- a/contrib/tcsh/README.md +++ b/contrib/tcsh/README.md @@@ -1,26 -1,0 +1,29 @@@ +# TCSH + +*C shell with file name completion and command line editing* + +The Tcsh source code is available on GitHub as a read-only repo +mirror at: + - > http://github.com/tcsh-org/tcsh ++> https://github.com/tcsh-org/tcsh + +Instructions for compiling Tcsh can be found in [BUILDING]. + +PLEASE file any bug reports, fixes, and code for new features at: + +> https://bugs.astron.com/ + +Comments, questions, etc. (even flames) are welcome via email to +the tcsh mailing list: + +> tcsh@astron.com +> https://mailman.astron.com/mailman/listinfo/tcsh + +[![Build Status][status]][travis] ++[![Coverity Scan][badge]][coverity] + +[BUILDING]: BUILDING - [status]: https://travis-ci.org/tcsh-org/tcsh.svg?branch=master - [travis]: https://travis-ci.org/tcsh-org/tcsh ++[badge]: https://scan.coverity.com/projects/20307/badge.svg ++[coverity]: https://scan.coverity.com/projects/tcsh-org-tcsh ++[status]: https://travis-ci.com/tcsh-org/tcsh.svg?branch=master ++[travis]: https://travis-ci.com/tcsh-org/tcsh diff --cc contrib/tcsh/dot.login index 000000000000,18d6f9c9d4d3..18d6f9c9d4d3 mode 000000,100644..100644 --- a/contrib/tcsh/dot.login +++ b/contrib/tcsh/dot.login diff --cc contrib/tcsh/dot.tcshrc index 000000000000,a155ed56a932..a155ed56a932 mode 000000,100644..100644 --- a/contrib/tcsh/dot.tcshrc +++ b/contrib/tcsh/dot.tcshrc From owner-dev-commits-src-main@freebsd.org Sun Mar 14 20:00: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 2EE2D5B0B01; Sun, 14 Mar 2021 20:00:55 +0000 (UTC) (envelope-from tijl@freebsd.org) Received: from mailrelay105.isp.belgacom.be (mailrelay105.isp.belgacom.be [195.238.20.132]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "relay.skynet.be", Issuer "GlobalSign RSA OV SSL CA 2018" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Dz9Qt2m8lz4gJc; Sun, 14 Mar 2021 20:00:54 +0000 (UTC) (envelope-from tijl@freebsd.org) IronPort-SDR: 0Znml6+TqDqWxkPSz4oIHGk4aIzFH9yoTxxaFv86OVqplqXnQik3jYWlrZMAcI8alm1t1SpafP smFc2Rv6ZQrVcQCCOzsNOgt/onQAxSrrM5CJNeEsjCiT0Irwy5x3BHYlsVW5FFJUvJf60OlYxS nQNsvVX1doRUqyCQo9ZBZmOwll7yr0Zo/HV+2E3qNHFuZAMxkK9yRQX4FCjaj0I6l4GtIcPjeR 8uYxlVspkFGrsM1dIdgQjgvTSBTJ31iGbVXNvCFh6PopAbkJipJ2ysy/GzNjNQlS5l2UC85IZ5 zCs= X-IPAS-Result: =?us-ascii?q?A2AgAAC1ak5g/wSs8lFaGgEBAQEBAQEBAQEDAQEBARIBA?= =?us-ascii?q?QEBAgIBAQEBQAeBNQQBAQEBCwEBgwoVVgFQGoRBiQSGKIIbNwGKcIl8hTWBf?= =?us-ascii?q?AsBAQEBAQEBAQEzCgQBAYRNAoF1JjUIDgIDAQEBAwIDAQEBAQYBAQEBAQEFB?= =?us-ascii?q?AGGGDkNQwEQAQQBgV4ig2sBBSNJCgMQCw4KAgImAgJXBhOCcYMLC6xdgTKJW?= =?us-ascii?q?IEDBoEPKgGNQkKCDIQsPoFReBcEFoFHgxaCYASCQAaBO4FMgSiQGqlggwyJS?= =?us-ascii?q?pJlMaQVLYYSmgWSLYZWA4IMTTAIgyRQGQ2OVYhNhUZAAy8LLQIGAQkBAQMJg?= =?us-ascii?q?xWHY4NxAQE?= IronPort-PHdr: A9a23:xB8UAxXE9eygHZstPDMnnpeJ4gLV8Kw2UjF92vIco4ILSbyq+tHYB Gea288FpGHAUYiT0f9Yke2e6/mmBTVRp8/b7ztdIdRlbFwssY0uhQsuAcqIWwXQDcXBSGgEJ vlET0Jv5HqhMEJYS47UblzWpWCuv3ZJQk2sfQV6Kf7oFYHMks+5y/69+4HJYwVPmTGxfa5+I A+5oAnMssQam5ZuJrgzxxfGoHZFf/ldyH91K16Ugxvy/Nq78oR58yRXtfIh9spAXrv/cq8lU 7FWDykoPn4s6sHzuhbNUQWA5n0HUmULiRVIGBTK7Av7XpjqrCT3sPd21TSAMs33SbA0Ximi7 7tuRRT1hioLKyI1/WfKgcF2kalVog+upwZnzoDaYI+bKudwcKDfctMUSmVOQslfWjddAoOld YYDE/YNMfpaooT7ulAArQG+BQ6pBO731DFKg3v21rAk3uQmFgHGxxIvH9cUv3TSt9X+KaAfU fy0zKnKyTXOdPNY2S3j54fWbx0vvP+CUah3ccrLxkkiDgXIhUifpoL5JT2azPgNs3SF4Op6U +Kik3AqpQF+rzagxMoglpfEiI0Ux13a+yt0wYY7KMC2RUB0YNOpEZ9duz2YOodrTM0vTGFlt SIkx7MIt5O2cigExZYhyhXCZfKHdI2I7QjiVOaXOTp4imhld6yhiBmp6kiv1/fwVs6u0FZFq CdOj9rCtmgV2hHQ98SLUOVx80i/1TqVygze6P9ILVo7mKfdNpUv2KQ/loAJvkTGBiL2nUL2g 7KIeUg84eio7vjnYq3hpp+BK494kgH+Pboqmsy4Gek4MRIBX2ya+eS5yrLj50r5TK9Wjv03k KnZtIrWKtgcpq6+GA9azIMj5Ay5Dze9ytgYmmMHLF1ddBKGiYjmJU3OLej7APuimVigjjhmy +7cMrH8AJjBMGLPnbj5cbZ48UFcyQ4zzd5F55JTD7EMOO7zWk7ztNzcFRI5PRa0zPj5B9pmz YMRRHiDAqiDMKPdqVOI/P4gI/GQZI8JvzbwM/sl5//1gnIil18dZ7em0oUMZ3CjA/tqOUKZY WDjgt0ZC2cFohI+TPD2iF2FSTNTaGi9X7gm6TE/FY2rFonDRpqzj7Ofxyi7BYBZanpBClCWH nfib5+EVOsUaCKOPs9hlSQJWqW/RI8/zB2hqAj6y79iLurV5i0Yrovv1MNv5+LPjB0y8CZ7D 8Wb02yWQWF0hH0HSCEt06BkvENx0FCD0bJ3g/ZAD9xc++tJUhsmNZ7b1+F1Fs79WhzYctiVT 1amR9CmATAtTtIq2tMOeFx9FMm7gh/Z2yqqB6QYl7KRBJMq7K3TxGPxKNtnx3bBzqkhgEEsQ tFTOm2+mq5/6w/TCpbSk0WDi6mmbLgT3CnI9GeGzGqOoF1YXxBqUaXeRn0faFHWosrn6UzZV L+hFK4rMgxbyc6NMqFKcMHmjU1aRPf/P9TTe3++m2a1BRuTyLOMdpTldHsG0yXGFUcIiQcT/ WyJNVt2OiD0j2PbDSB0BBrGZU/28OI2/H+6S2ca1QyHRXZNkb2v9UhGq+abTqYvObZMkyAms DhxFVCml4bKCtiEjyR7cah2Wv97501IgzGK/zdhN4CtevgxzmUVdB566huG6g== IronPort-HdrOrdr: A9a23:lX+GJa+Idjmz89phO0Ruk+Hadb1zdoIgy1knxilNYDZSddGVkN 3roeQD2XbP+VQscVwDufTFAqmPRnvA6YV4iLN6AZ6OVBTr0VHEEKhM4YfuyDXrGWnf24dmpN xdWodkDtmYNzRHpOP7+hT9L9E73NKc+rupjuu29QYIcShOa7t8qzt/EBqRCEdsRAJLQaM+Do f03LsjmxOFWVA6Kvu2HWMEWe+rnaypqLvDbQQdDxAqrCmi5AnI1JfCCBST0hoTVDlCqI1SjV TtqADy6qW9v/zT8Ha1vFP71JhOncuk990rPqOxo/IIITbhgBvAXuRccoCF1QpanMifrH4Brf nwhSEBGPle0Fv6Q0GShi3M9mDboUsTwk6n43e9uFPCj+vFdAsXYvAx/b5xQ1/840okgcFk3M twrgSknqsSNxPPmyz53cHBU1VBtmfcmwtarccjy39YWuIlGcVshL1a51peGJMYFCL17+kcYY 5TMP0= X-IronPort-Anti-Spam-Filtered: true Received: from 4.172-242-81.adsl-dyn.isp.belgacom.be (HELO kalimero.tijl.coosemans.org) ([81.242.172.4]) by relay.proximus.be with ESMTP; 14 Mar 2021 21:00:51 +0100 Received: from localhost (localhost [127.0.0.1]) by kalimero.tijl.coosemans.org (8.16.1/8.16.1) with ESMTP id 12EK0oWN004071; Sun, 14 Mar 2021 21:00:51 +0100 (CET) (envelope-from tijl@FreeBSD.org) Date: Sun, 14 Mar 2021 21:00:49 +0100 From: =?UTF-8?B?VMSzbA==?= Coosemans To: Dimitry Andric Cc: "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" , gerald@FreeBSD.org, kib@FreeBSD.org Subject: Re: git: 9097e3cbcac4 - main - Partially revert libcxxrt changes to avoid _Unwind_Exception change Message-ID: <20210314210039.2da1b9ba@FreeBSD.org> In-Reply-To: References: <202103131354.12DDsnKR065154@gitrepo.freebsd.org> <20210313183812.77b74819@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: 4Dz9Qt2m8lz4gJc 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, 14 Mar 2021 20:00:55 -0000 On Sun, 14 Mar 2021 01:15:11 +0100 Dimitry Andric wrote: > On 13 Mar 2021, at 18:38, T=C4=B3l Coosemans wrote: >> On Sat, 13 Mar 2021 13:54:49 GMT Dimitry Andric wrote:= =20 >>> The branch main has been updated by dim: >>>=20 >>> URL: https://cgit.FreeBSD.org/src/commit/?id=3D9097e3cbcac455eb0dedd097= d8d5548c72568d0a >>>=20 >>> commit 9097e3cbcac455eb0dedd097d8d5548c72568d0a >>> Author: Dimitry Andric >>> AuthorDate: 2021-03-13 13:54:24 +0000 >>> Commit: Dimitry Andric >>> CommitDate: 2021-03-13 13:54:24 +0000 >>>=20 >>> Partially revert libcxxrt changes to avoid _Unwind_Exception change = =20 > ... >>> --- a/contrib/libcxxrt/unwind-itanium.h >>> +++ b/contrib/libcxxrt/unwind-itanium.h >>> @@ -79,12 +79,9 @@ struct _Unwind_Exception >>> { >>> uint64_t exception_class; >>> _Unwind_Exception_Cleanup_Fn exception_cleanup; >>> - uintptr_t private_1; >>> - uintptr_t private_2; >>> -#if __SIZEOF_POINTER__ =3D=3D 4 >>> - uint32_t reserved[3]; >>> -#endif >>> - } __attribute__((__aligned__)); >>> + unsigned long private_1; >>> + unsigned long private_2; >>> + } ; =20 >>=20 >> Shouldn't these definitions be the same as the ones in GCC? =20 >=20 > If you want to keep the ABI compatible with what it was, no. Otherwise, > you could consider it. But for what gain? Hmm, the ABI must have been broken by the switch to libcxxrt years ago. In that case there's ABI breakage no matter which version you choose. Maybe kib can help decide which is the lesser evil. In any case I do think the definitions in GCC should match the ones in base. Sometimes libraries compiled with GCC are combined with libraries compiled with Clang in one process. So, code compiled with GCC unwind.h should work with base system libgcc_s and code compiled with libcxxrt unwind.h should work with GCC libgcc_s. Maybe the GCC ports can be patched to match the base system but I'm not sure upstream would accept such a patch, especially since upstream libcxxrt has already become compatible. From owner-dev-commits-src-main@freebsd.org Sun Mar 14 23:20: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 100DB5B63F7; Sun, 14 Mar 2021 23:20: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 4DzFs974mCz4tVJ; Sun, 14 Mar 2021 23:20: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 E1A7125C78; Sun, 14 Mar 2021 23:20: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 12ENKTgH005639; Sun, 14 Mar 2021 23:20:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 12ENKTwE005638; Sun, 14 Mar 2021 23:20:29 GMT (envelope-from git) Date: Sun, 14 Mar 2021 23:20:29 GMT Message-Id: <202103142320.12ENKTwE005638@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ryan Libby Subject: git: 588ce1a3ac8d - main - kobj: avoid gcc -Wcast-function-type MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rlibby X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 588ce1a3ac8d61c99c7827dc71191c46c2d927b7 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, 14 Mar 2021 23:20:30 -0000 The branch main has been updated by rlibby: URL: https://cgit.FreeBSD.org/src/commit/?id=588ce1a3ac8d61c99c7827dc71191c46c2d927b7 commit 588ce1a3ac8d61c99c7827dc71191c46c2d927b7 Author: Ryan Libby AuthorDate: 2021-03-14 23:04:27 +0000 Commit: Ryan Libby CommitDate: 2021-03-14 23:04:27 +0000 kobj: avoid gcc -Wcast-function-type The actual type of kobjop_t is arbitrary, it is only used as a generic function pointer type. Declare it as void (*)(void) in order to avoid gcc's -Wcast-function-type, which is included in -Wextra. Reviewed by: avg, jhb Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D28769 --- sys/sys/kobj.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/sys/kobj.h b/sys/sys/kobj.h index da8c2d5106bb..aaf92688ca08 100644 --- a/sys/sys/kobj.h +++ b/sys/sys/kobj.h @@ -37,7 +37,7 @@ typedef struct kobj *kobj_t; typedef struct kobj_class *kobj_class_t; typedef const struct kobj_method kobj_method_t; -typedef int (*kobjop_t)(void); +typedef void (*kobjop_t)(void); typedef struct kobj_ops *kobj_ops_t; typedef struct kobjop_desc *kobjop_desc_t; struct malloc_type; From owner-dev-commits-src-main@freebsd.org Sun Mar 14 23:20: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 291705B63F8; Sun, 14 Mar 2021 23:20: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 4DzFsC0Y35z4tVK; Sun, 14 Mar 2021 23:20: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 0590E25BE6; Sun, 14 Mar 2021 23:20: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 12ENKUgD005661; Sun, 14 Mar 2021 23:20:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 12ENKUxx005660; Sun, 14 Mar 2021 23:20:30 GMT (envelope-from git) Date: Sun, 14 Mar 2021 23:20:30 GMT Message-Id: <202103142320.12ENKUxx005660@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ryan Libby Subject: git: 3e5e9939cda3 - main - ddb: enable the use of ^C and ^S/^Q MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rlibby X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3e5e9939cda3b24df37c37da5f195415a894d9fd 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, 14 Mar 2021 23:20:31 -0000 The branch main has been updated by rlibby: URL: https://cgit.FreeBSD.org/src/commit/?id=3e5e9939cda3b24df37c37da5f195415a894d9fd commit 3e5e9939cda3b24df37c37da5f195415a894d9fd Author: Ryan Libby AuthorDate: 2021-03-14 23:04:27 +0000 Commit: Ryan Libby CommitDate: 2021-03-14 23:04:27 +0000 ddb: enable the use of ^C and ^S/^Q This lets one interrupt DDB's output, which is useful if paging is disabled and the output device is slow. This follows a previous implementation in svn r311952 / git 5fddef79998678d256ba30316353393b4d8ebb32 which was reverted because it broke DDB type-ahead. Now, try this again, but with a 512-byte type-ahead buffer. While there is buffer space, control input is handled and non-control input is buffered. When the buffer is exhausted, the default is to print a warning and drop further non-control input in order to continue handling control input. sysctl debug.ddb.prioritize_control_input can be set to 0 to instead preserve all input but lose immediate handling of control input. This could for example effect pasting of a large script into the ddb console. Suggested by: Anton Rang Reviewed by: markj Discussed with: imp Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D28676 --- share/man/man4/ddb.4 | 15 +++++- sys/ddb/db_input.c | 126 +++++++++++++++++++++++++++++++++++++++++---------- sys/ddb/db_output.c | 2 +- sys/ddb/ddb.h | 1 + 4 files changed, 119 insertions(+), 25 deletions(-) diff --git a/share/man/man4/ddb.4 b/share/man/man4/ddb.4 index 1fe3490edd36..4f1614d8e006 100644 --- a/share/man/man4/ddb.4 +++ b/share/man/man4/ddb.4 @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 26, 2021 +.Dd March 14, 2021 .Dt DDB 4 .Os .Sh NAME @@ -1571,6 +1571,19 @@ The debugger may be entered by setting the .Xr sysctl 8 .Va debug.kdb.enter to 1. +.Pp +Output may be interrupted, paused, and resumed with the control +characters CTRL-C, CTRL-S, and CTRL-Q. +Because these control characters are received as in-band data from the +console, there is an input buffer, and once that buffer fills +.Nm +must either stop responding to control characters or drop additional +input while continuing to search for control characters. +This behavior is controlled by the tunable +.Xr sysctl 8 +.Va debug.ddb.prioritize_control_input , +which defaults to 1. +The input buffer size is 512 bytes. .Sh FILES Header files mentioned in this manual page can be found below .Pa /usr/include diff --git a/sys/ddb/db_input.c b/sys/ddb/db_input.c index 41396e0a041f..a7d06e17f5c1 100644 --- a/sys/ddb/db_input.c +++ b/sys/ddb/db_input.c @@ -36,6 +36,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -54,6 +55,19 @@ static char * db_lbuf_end; /* end of input line buffer */ static char * db_lc; /* current character */ static char * db_le; /* one past last character */ +/* + * Raw input buffer, processed only for certain control characters. + */ +#define DB_RAW_SIZE 512 +static char db_raw[DB_RAW_SIZE]; +static u_int db_raw_pos; +static u_int db_raw_cnt; +static int db_raw_warned; +static int ddb_prioritize_control_input = 1; +SYSCTL_INT(_debug_ddb, OID_AUTO, prioritize_control_input, CTLFLAG_RWTUN, + &ddb_prioritize_control_input, 0, + "Drop input when the buffer fills in order to keep servicing ^C/^S/^Q"); + /* * Simple input line history support. */ @@ -65,11 +79,13 @@ static int db_lhist_nlines; #define BLANK ' ' #define BACKUP '\b' -static int cnmaygetc(void); static void db_delete(int n, int bwd); static int db_inputchar(int c); static void db_putnchars(int c, int count); static void db_putstring(char *s, int count); +static int db_raw_pop(void); +static void db_raw_push(int); +static int db_raw_space(void); static void db_putstring(s, count) @@ -307,10 +323,50 @@ db_inputchar(c) return (0); } +/* Get a character from the console, first checking the raw input buffer. */ +int +db_getc(void) +{ + int c; + + if (db_raw_cnt == 0) { + c = cngetc(); + } else { + c = db_raw_pop(); + if (c == '\r') + c = '\n'; + } + return (c); +} + +/* Whether the raw input buffer has space to accept another character. */ static int -cnmaygetc() +db_raw_space(void) +{ + + return (db_raw_cnt < DB_RAW_SIZE); +} + +/* Un-get a character from the console by buffering it. */ +static void +db_raw_push(int c) { - return (-1); + + if (!db_raw_space()) + db_error(NULL); + db_raw[(db_raw_pos + db_raw_cnt++) % DB_RAW_SIZE] = c; +} + +/* Drain a character from the raw input buffer. */ +static int +db_raw_pop(void) +{ + + if (db_raw_cnt == 0) + return (-1); + db_raw_cnt--; + db_raw_warned = 0; + return (db_raw[db_raw_pos++ % DB_RAW_SIZE]); } int @@ -339,7 +395,7 @@ db_readline(lstart, lsize) db_lc = lstart; db_le = lstart; - while (!db_inputchar(cngetc())) + while (!db_inputchar(db_getc())) continue; db_capture_write(lstart, db_le - db_lbuf_start); @@ -361,30 +417,54 @@ db_readline(lstart, lsize) return (db_le - db_lbuf_start); } +static void +db_do_interrupt(const char *reason) +{ + + /* Do a pager quit too because some commands have jmpbuf handling. */ + db_disable_pager(); + db_pager_quit = 1; + db_error(reason); +} + void db_check_interrupt(void) { int c; - c = cnmaygetc(); - switch (c) { - case -1: /* no character */ - return; - - case CTRL('c'): - db_error((char *)0); - /*NOTREACHED*/ - - case CTRL('s'): - do { - c = cnmaygetc(); - if (c == CTRL('c')) - db_error((char *)0); - } while (c != CTRL('q')); - break; + /* + * Check console input for control characters. Non-control input is + * buffered. When buffer space is exhausted, either stop responding to + * control input or drop further non-control input on the floor. + */ + for (;;) { + if (!ddb_prioritize_control_input && !db_raw_space()) + return; + c = cncheckc(); + switch (c) { + case -1: /* no character */ + return; + + case CTRL('c'): + db_do_interrupt("^C"); + /*NOTREACHED*/ + + case CTRL('s'): + do { + c = cncheckc(); + if (c == CTRL('c')) + db_do_interrupt("^C"); + } while (c != CTRL('q')); + break; - default: - /* drop on floor */ - break; + default: + if (db_raw_space()) { + db_raw_push(c); + } else if (!db_raw_warned) { + db_raw_warned = 1; + db_printf("\n--Exceeded input buffer--\n"); + } + break; + } } } diff --git a/sys/ddb/db_output.c b/sys/ddb/db_output.c index 3517187f8206..41a8c7128359 100644 --- a/sys/ddb/db_output.c +++ b/sys/ddb/db_output.c @@ -260,7 +260,7 @@ db_pager(void) db_printf("--More--\r"); done = 0; while (!done) { - c = cngetc(); + c = db_getc(); switch (c) { case 'e': case 'j': diff --git a/sys/ddb/ddb.h b/sys/ddb/ddb.h index 81448474c514..5ae48d21fda9 100644 --- a/sys/ddb/ddb.h +++ b/sys/ddb/ddb.h @@ -197,6 +197,7 @@ db_addr_t db_disasm(db_addr_t loc, bool altfmt); /* instruction disassembler */ void db_error(const char *s); int db_expression(db_expr_t *valuep); +int db_getc(void); int db_get_variable(db_expr_t *valuep); void db_iprintf(const char *,...) __printflike(1, 2); struct proc *db_lookup_proc(db_expr_t addr);